vft 0.0.97 → 0.0.98
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/es/components/affix/affix.vue2.js +25 -26
- package/es/components/alert/alert.vue2.js +17 -18
- package/es/components/backtop/backtop.vue2.js +14 -15
- package/es/components/button/button-group.vue2.js +14 -15
- package/es/components/button/button.vue2.js +24 -25
- package/es/components/card/card.vue2.js +10 -11
- package/es/components/check-tag/check-tag.vue2.js +10 -11
- package/es/components/checkbox/checkbox-button.vue2.js +13 -14
- package/es/components/checkbox/checkbox-group.vue2.js +15 -16
- package/es/components/checkbox/checkbox.vue2.js +24 -25
- package/es/components/clamp/clamp.vue2.js +16 -17
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +13 -14
- package/es/components/col/col.vue2.js +20 -21
- package/es/components/collapse-transition/src/collapse-transition.vue2.js +12 -13
- package/es/components/collection/collection-item.vue2.js +6 -7
- package/es/components/collection/collection.vue2.js +5 -7
- package/es/components/color-picker/color-picker.vue2.js +45 -46
- package/es/components/color-picker/components/alpha-slider.vue2.js +20 -21
- package/es/components/config-provider/config-provider.vue2.js +22 -23
- package/es/components/container/aside.vue2.js +12 -13
- package/es/components/container/container.vue2.js +10 -11
- package/es/components/container/footer.vue2.js +11 -12
- package/es/components/container/header.vue2.js +10 -11
- package/es/components/container/main.vue2.js +12 -13
- package/es/components/context-menu/context-menu.vue2.js +18 -19
- package/es/components/date-picker/date-picker-com/basic-date-table.vue2.js +87 -87
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +1 -1
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +1 -1
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +2 -2
- package/es/components/date-picker/date-picker-com/panel-month-range.vue2.js +39 -40
- package/es/components/date-time-select/date-time-select.vue2.js +20 -21
- package/es/components/descriptions/description-item.vue2.js +9 -10
- package/es/components/descriptions/description.vue2.js +20 -21
- package/es/components/descriptions/descriptions-row.vue2.js +15 -16
- package/es/components/dialog/dialog-content.vue2.js +12 -13
- package/es/components/dialog/dialog.vue2.js +40 -41
- package/es/components/divider/divider.vue2.js +10 -11
- package/es/components/dropdown/dropdown.vue2.js +38 -39
- package/es/components/empty/empty.vue2.js +11 -12
- package/es/components/footer-layout/footer-layout.vue2.js +7 -8
- package/es/components/form/form-item.vue2.js +43 -44
- package/es/components/form/form.vue2.js +28 -29
- package/es/components/full-screen/full-screen.vue2.js +15 -16
- package/es/components/header-layout/header-layout.vue2.js +21 -22
- package/es/components/horizontal-menu/horizontal-menu.vue2.js +50 -51
- package/es/components/icon/icon.vue2.js +12 -13
- package/es/components/icon-text/icon-text.vue2.js +13 -14
- package/es/components/iframe-layout/iframe-layout.vue2.js +15 -16
- package/es/components/iframe-layout/iframe-page.vue2.js +12 -13
- package/es/components/image/image.vue2.js +25 -26
- package/es/components/image-viewer/image-viewer.vue2.js +54 -55
- package/es/components/index.js +90 -90
- package/es/components/link/link.vue2.js +11 -12
- package/es/components/list-cell/list-cell.vue2.js +21 -22
- package/es/components/logo/logo.vue2.js +12 -13
- package/es/components/md-comment/md-comment.vue2.js +12 -13
- package/es/components/md-container/md-container.vue2.js +33 -34
- package/es/components/md-vue-playground/md-vue-playground.vue2.js +18 -19
- package/es/components/menu/menu-item-group.vue2.js +13 -14
- package/es/components/menu/menu-item.vue2.js +12 -13
- package/es/components/menu/menu.vue2.js +44 -45
- package/es/components/menu/sub-menu.vue2.js +30 -31
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +35 -38
- package/es/components/overlay/overlay.vue2.js +23 -24
- package/es/components/page-wrapper/page-wrapper.vue2.js +17 -18
- package/es/components/pagination/pagination.vue2.js +17 -18
- package/es/components/popconfirm/popconfirm.vue2.js +17 -18
- package/es/components/popover/popover.vue2.js +31 -32
- package/es/components/popper/arrow.vue2.js +15 -16
- package/es/components/popper/content.vue2.js +38 -39
- package/es/components/popper/popper.vue2.js +13 -14
- package/es/components/popper/trigger.vue2.js +11 -12
- package/es/components/qrcode/qrcode.vue2.js +21 -22
- package/es/components/radio/radio-button.vue2.js +16 -17
- package/es/components/radio/radio-group.vue2.js +16 -17
- package/es/components/radio/radio.vue2.js +15 -16
- package/es/components/result/result.vue2.js +12 -13
- package/es/components/router-view-content/router-view-content.vue2.js +10 -11
- package/es/components/row/row.vue2.js +17 -18
- package/es/components/scrollbar/scrollbar.vue2.js +30 -31
- package/es/components/search/search.vue2.js +39 -40
- package/es/components/side-menu/side-menu.vue2.js +43 -45
- package/es/components/skeleton/skeleton-item.vue2.js +9 -10
- package/es/components/skeleton/skeleton.vue2.js +11 -12
- package/es/components/switch/switch.vue2.js +27 -28
- package/es/components/table/table.vue2.js +36 -37
- package/es/components/tabs/tab-nav.vue2.js +28 -29
- package/es/components/tabs/tab-pane.vue2.js +23 -24
- package/es/components/tabs/tabs.vue2.js +30 -31
- package/es/components/time-picker/common/picker.vue2.js +48 -49
- package/es/components/time-select/time-select.vue2.js +28 -29
- package/es/components/tooltip/content.vue2.js +36 -37
- package/es/components/tooltip/tooltip.vue2.js +15 -16
- package/es/components/tooltip/trigger.vue2.js +37 -38
- package/es/components/verify-code/verify-code.vue2.js +19 -20
- package/es/constants/date.js +7 -7
- package/es/index.js +90 -90
- package/es/package.json.js +1 -1
- package/lib/components/affix/affix.vue2.cjs +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/backtop/backtop.vue2.cjs +1 -1
- package/lib/components/button/button-group.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/check-tag/check-tag.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/collapse-transition/src/collapse-transition.vue2.cjs +1 -1
- package/lib/components/collection/collection-item.vue2.cjs +1 -1
- package/lib/components/collection/collection.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/alpha-slider.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/container/aside.vue2.cjs +1 -1
- package/lib/components/container/container.vue2.cjs +1 -1
- package/lib/components/container/footer.vue2.cjs +1 -1
- package/lib/components/container/header.vue2.cjs +1 -1
- package/lib/components/container/main.vue2.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-date-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-month-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/descriptions/description-item.vue2.cjs +1 -1
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/footer-layout/footer-layout.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/form/form.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/horizontal-menu/horizontal-menu.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/md-comment/md-comment.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-vue-playground/md-vue-playground.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/menu/menu.vue2.cjs +1 -1
- package/lib/components/menu/sub-menu.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/overlay/overlay.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/pagination.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/arrow.vue2.cjs +1 -1
- package/lib/components/popper/content.vue2.cjs +1 -1
- package/lib/components/popper/popper.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/radio/radio.vue2.cjs +1 -1
- package/lib/components/result/result.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/tabs/tab-nav.vue2.cjs +1 -1
- package/lib/components/tabs/tab-pane.vue2.cjs +1 -1
- package/lib/components/tabs/tabs.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue2.cjs +1 -1
- package/lib/components/time-select/time-select.vue2.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/constants/date.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/package.json +8 -8
- package/web-types.json +1 -1
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as Q, useSlots as X, getCurrentInstance as Y, ref as i, computed as Z, watch as O, watchEffect as _, provide as A, reactive as ee, onMounted as te, h as I, nextTick as ne } from "vue";
|
|
2
2
|
import { useResizeObserver as le } from "@vueuse/core";
|
|
3
3
|
import { isNullOrUndefined as B } from "@vft/utils";
|
|
4
4
|
import { flattedChildren as oe } from "../../utils/vue/vnode.js";
|
|
5
5
|
import "lodash";
|
|
6
6
|
import "../../utils/ns-cover.js";
|
|
7
|
-
import { useNamespace as
|
|
7
|
+
import { useNamespace as E } from "../../hooks/use-namespace/index.js";
|
|
8
8
|
import "@popperjs/core";
|
|
9
9
|
import "../../hooks/use-z-index/index.js";
|
|
10
10
|
import ue from "./utils/menu-bar.js";
|
|
11
11
|
import ae from "./menu-collapse-transition.vue.js";
|
|
12
|
-
import
|
|
13
|
-
import { useMenuCssVar as
|
|
12
|
+
import ie from "./sub-menu.vue2.js";
|
|
13
|
+
import { useMenuCssVar as se } from "./use-menu-css-var.js";
|
|
14
14
|
import { VftIcon as ce } from "../icon/index.js";
|
|
15
15
|
const M = (
|
|
16
16
|
/* hoist-static*/
|
|
17
|
-
|
|
18
|
-
),
|
|
19
|
-
name: M.b()
|
|
20
|
-
|
|
21
|
-
...re,
|
|
17
|
+
E("menu")
|
|
18
|
+
), Oe = /* @__PURE__ */ Q({
|
|
19
|
+
name: M.b(),
|
|
20
|
+
__name: "menu",
|
|
22
21
|
props: {
|
|
23
22
|
mode: { default: "vertical" },
|
|
24
23
|
defaultActive: { default: "" },
|
|
@@ -31,10 +30,10 @@ const M = (
|
|
|
31
30
|
ellipsis: { type: Boolean, default: !0 }
|
|
32
31
|
},
|
|
33
32
|
emits: ["update:collapse", "select", "close", "open"],
|
|
34
|
-
setup(n, { expose:
|
|
35
|
-
const y = X(), v = Y(), T = v.appContext.config.globalProperties.$router,
|
|
33
|
+
setup(n, { expose: W, emit: b }) {
|
|
34
|
+
const y = X(), v = Y(), T = v.appContext.config.globalProperties.$router, s = i(), z = E("sub-menu"), f = i(-1), u = i(
|
|
36
35
|
n.defaultOpeneds && !n.collapse ? n.defaultOpeneds.slice(0) : []
|
|
37
|
-
), a =
|
|
36
|
+
), a = i(n.defaultActive), r = i({}), h = i({}), V = Z(() => n.mode === "horizontal" || n.mode === "vertical" && n.collapse), $ = () => {
|
|
38
37
|
const e = a.value && r.value[a.value];
|
|
39
38
|
if (!e || n.mode === "horizontal" || n.collapse)
|
|
40
39
|
return;
|
|
@@ -47,9 +46,9 @@ const M = (
|
|
|
47
46
|
}, C = (e, t, l) => {
|
|
48
47
|
const o = u.value.indexOf(e);
|
|
49
48
|
o !== -1 && u.value.splice(o, 1), b("close", { index: e, indexPath: t, e: l });
|
|
50
|
-
},
|
|
49
|
+
}, q = ({ e, index: t, indexPath: l }) => {
|
|
51
50
|
u.value.includes(t) ? C(t, l, e) : g(t, l, e);
|
|
52
|
-
},
|
|
51
|
+
}, D = (e) => {
|
|
53
52
|
(n.mode === "horizontal" || n.collapse) && (u.value = []);
|
|
54
53
|
const { index: t, indexPath: l } = e;
|
|
55
54
|
if (!(B(t) || B(l)))
|
|
@@ -58,21 +57,21 @@ const M = (
|
|
|
58
57
|
b("select", e, m);
|
|
59
58
|
} else
|
|
60
59
|
a.value = t, b("select", e);
|
|
61
|
-
},
|
|
60
|
+
}, L = (e) => {
|
|
62
61
|
const t = r.value, l = t[e] || a.value && t[a.value] || t[n.defaultActive];
|
|
63
62
|
l ? a.value = l.index : a.value = e;
|
|
64
|
-
},
|
|
63
|
+
}, F = () => {
|
|
65
64
|
var d;
|
|
66
|
-
if (!
|
|
65
|
+
if (!s.value)
|
|
67
66
|
return -1;
|
|
68
|
-
const e = Array.from(((d =
|
|
67
|
+
const e = Array.from(((d = s.value) == null ? void 0 : d.childNodes) ?? []).filter(
|
|
69
68
|
(S) => S.nodeName !== "#text" || S.nodeValue
|
|
70
|
-
), t = 64, l = Number.parseInt(getComputedStyle(
|
|
69
|
+
), t = 64, l = Number.parseInt(getComputedStyle(s.value).paddingLeft, 10), o = Number.parseInt(getComputedStyle(s.value).paddingRight, 10), m = s.value.clientWidth - l - o;
|
|
71
70
|
let c = 0, p = 0;
|
|
72
|
-
return e.forEach((S,
|
|
73
|
-
c += S.offsetWidth || 0, c <= m - t && (p =
|
|
71
|
+
return e.forEach((S, K) => {
|
|
72
|
+
c += S.offsetWidth || 0, c <= m - t && (p = K + 1);
|
|
74
73
|
}), p === e.length ? -1 : p;
|
|
75
|
-
},
|
|
74
|
+
}, U = (e, t = 33.34) => {
|
|
76
75
|
let l;
|
|
77
76
|
return () => {
|
|
78
77
|
l && clearTimeout(l), l = setTimeout(() => {
|
|
@@ -84,35 +83,35 @@ const M = (
|
|
|
84
83
|
const P = () => {
|
|
85
84
|
const e = () => {
|
|
86
85
|
f.value = -1, ne(() => {
|
|
87
|
-
f.value =
|
|
86
|
+
f.value = F();
|
|
88
87
|
});
|
|
89
88
|
};
|
|
90
|
-
N ? e() :
|
|
89
|
+
N ? e() : U(e)(), N = !1;
|
|
91
90
|
};
|
|
92
91
|
O(
|
|
93
92
|
() => n.defaultActive,
|
|
94
93
|
(e) => {
|
|
95
|
-
r.value[e] || (a.value = ""),
|
|
94
|
+
r.value[e] || (a.value = ""), L(e);
|
|
96
95
|
}
|
|
97
96
|
), O(
|
|
98
97
|
() => n.collapse,
|
|
99
98
|
(e) => {
|
|
100
99
|
e && (u.value = []);
|
|
101
100
|
}
|
|
102
|
-
), O(r.value,
|
|
101
|
+
), O(r.value, $);
|
|
103
102
|
let x;
|
|
104
103
|
_(() => {
|
|
105
|
-
n.mode === "horizontal" && n.ellipsis ? x = le(
|
|
104
|
+
n.mode === "horizontal" && n.ellipsis ? x = le(s, P).stop : x == null || x();
|
|
106
105
|
});
|
|
107
106
|
const R = (e) => {
|
|
108
107
|
h.value[e.index] = e;
|
|
109
108
|
}, k = (e) => {
|
|
110
109
|
delete h.value[e.index];
|
|
111
|
-
},
|
|
110
|
+
}, j = (e) => {
|
|
112
111
|
r.value[e.index] = e;
|
|
113
|
-
},
|
|
112
|
+
}, G = (e) => {
|
|
114
113
|
delete r.value[e.index];
|
|
115
|
-
}, w =
|
|
114
|
+
}, w = i(!1), H = i(), J = i();
|
|
116
115
|
return A(
|
|
117
116
|
"rootMenu",
|
|
118
117
|
ee({
|
|
@@ -121,48 +120,48 @@ const M = (
|
|
|
121
120
|
items: r,
|
|
122
121
|
subMenus: h,
|
|
123
122
|
activeIndex: a,
|
|
124
|
-
isMenuPopup:
|
|
123
|
+
isMenuPopup: V,
|
|
125
124
|
inSubMenu: w,
|
|
126
|
-
inSubMenuMouseEnterTimer:
|
|
127
|
-
inSubMenuMouseleaveTimer:
|
|
128
|
-
addMenuItem:
|
|
129
|
-
removeMenuItem:
|
|
125
|
+
inSubMenuMouseEnterTimer: H,
|
|
126
|
+
inSubMenuMouseleaveTimer: J,
|
|
127
|
+
addMenuItem: j,
|
|
128
|
+
removeMenuItem: G,
|
|
130
129
|
addSubMenu: R,
|
|
131
130
|
removeSubMenu: k,
|
|
132
131
|
openMenu: g,
|
|
133
132
|
closeMenu: C,
|
|
134
|
-
handleMenuItemClick:
|
|
135
|
-
handleSubMenuClick:
|
|
133
|
+
handleMenuItemClick: D,
|
|
134
|
+
handleSubMenuClick: q
|
|
136
135
|
})
|
|
137
136
|
), A(`subMenu:${v.uid}`, {
|
|
138
137
|
addSubMenu: R,
|
|
139
138
|
removeSubMenu: k,
|
|
140
|
-
mouseInChild:
|
|
139
|
+
mouseInChild: i(!1),
|
|
141
140
|
// 表示当前是第一级的 sub-menu
|
|
142
141
|
level: 0
|
|
143
142
|
}), te(() => {
|
|
144
143
|
n.mode === "horizontal" && new ue(v.vnode.el, M.namespace.value);
|
|
145
|
-
}),
|
|
144
|
+
}), W({
|
|
146
145
|
open: (e) => {
|
|
147
146
|
const { indexPath: t } = h.value[e];
|
|
148
147
|
t.forEach((l) => g(l, t));
|
|
149
148
|
},
|
|
150
149
|
close: C,
|
|
151
150
|
handleResize: P,
|
|
152
|
-
menu:
|
|
151
|
+
menu: s,
|
|
153
152
|
inSubMenu: w
|
|
154
153
|
}), () => {
|
|
155
154
|
var m;
|
|
156
155
|
let e = ((m = y.default) == null ? void 0 : m.call(y)) ?? [];
|
|
157
156
|
const t = [];
|
|
158
|
-
if (n.mode === "horizontal" &&
|
|
157
|
+
if (n.mode === "horizontal" && s.value) {
|
|
159
158
|
const c = oe(e), p = f.value === -1 ? c : c.slice(
|
|
160
159
|
0,
|
|
161
160
|
f.value
|
|
162
161
|
), d = f.value === -1 ? [] : c.slice(f.value);
|
|
163
162
|
d != null && d.length && n.ellipsis && (e = p, t.push(
|
|
164
163
|
I(
|
|
165
|
-
|
|
164
|
+
ie,
|
|
166
165
|
{
|
|
167
166
|
index: "sub-menu-more",
|
|
168
167
|
class: z.e("hide-arrow")
|
|
@@ -180,12 +179,12 @@ const M = (
|
|
|
180
179
|
)
|
|
181
180
|
));
|
|
182
181
|
}
|
|
183
|
-
const l =
|
|
182
|
+
const l = se(v.props, 0), o = I(
|
|
184
183
|
"ul",
|
|
185
184
|
{
|
|
186
185
|
key: String(n.collapse),
|
|
187
186
|
role: "menubar",
|
|
188
|
-
ref:
|
|
187
|
+
ref: s,
|
|
189
188
|
style: l.value,
|
|
190
189
|
class: {
|
|
191
190
|
[M.b()]: !0,
|
|
@@ -200,5 +199,5 @@ const M = (
|
|
|
200
199
|
}
|
|
201
200
|
});
|
|
202
201
|
export {
|
|
203
|
-
|
|
202
|
+
Oe as default
|
|
204
203
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as ne, getCurrentInstance as re, computed as r, inject as L, ref as g, reactive as ie, watch as le, provide as ue, onMounted as ae, onBeforeUnmount as se, useSlots as pe, h as a, Fragment as me, withDirectives as ce, vShow as de } from "vue";
|
|
2
2
|
import "../divider/index.js";
|
|
3
3
|
import { VftIcon as U } from "../icon/index.js";
|
|
4
4
|
import "../avatar/index.js";
|
|
@@ -78,7 +78,7 @@ import "../md-vue-playground/index.js";
|
|
|
78
78
|
import "../md-code-demo/index.js";
|
|
79
79
|
import "../md-code-tabs/index.js";
|
|
80
80
|
import "../message/index.js";
|
|
81
|
-
import { useNamespace as
|
|
81
|
+
import { useNamespace as z } from "../../hooks/use-namespace/index.js";
|
|
82
82
|
import "@popperjs/core";
|
|
83
83
|
import "lodash";
|
|
84
84
|
import "../../hooks/use-z-index/index.js";
|
|
@@ -87,14 +87,13 @@ import { throwError as q } from "../../utils/error.js";
|
|
|
87
87
|
import "../../utils/ns-cover.js";
|
|
88
88
|
import be from "./use-menu.js";
|
|
89
89
|
import { useMenuCssVar as he } from "./use-menu-css-var.js";
|
|
90
|
-
const
|
|
90
|
+
const k = (
|
|
91
91
|
/* hoist-static*/
|
|
92
|
-
|
|
93
|
-
),
|
|
94
|
-
name:
|
|
95
|
-
inheritAttrs: !1
|
|
96
|
-
|
|
97
|
-
...Te,
|
|
92
|
+
z("sub-menu")
|
|
93
|
+
), ot = /* @__PURE__ */ ne({
|
|
94
|
+
name: k.b(),
|
|
95
|
+
inheritAttrs: !1,
|
|
96
|
+
__name: "sub-menu",
|
|
98
97
|
props: {
|
|
99
98
|
index: {},
|
|
100
99
|
showTimeout: {
|
|
@@ -130,19 +129,19 @@ const z = (
|
|
|
130
129
|
},
|
|
131
130
|
emits: ["mouseenter", "mouseleave"],
|
|
132
131
|
setup(o, {
|
|
133
|
-
expose:
|
|
132
|
+
expose: G,
|
|
134
133
|
emit: E
|
|
135
134
|
}) {
|
|
136
135
|
const f = re(), {
|
|
137
136
|
indexPath: T,
|
|
138
137
|
parentMenu: A
|
|
139
|
-
} = be(f, r(() => o.index)), p =
|
|
140
|
-
e || q(
|
|
138
|
+
} = be(f, r(() => o.index)), p = z("menu"), s = z("sub-menu"), e = L("rootMenu");
|
|
139
|
+
e || q(k.b(), "can not inject root menu");
|
|
141
140
|
const u = L(`subMenu:${A.value.uid}`);
|
|
142
|
-
u || q(
|
|
141
|
+
u || q(k.b(), "can not inject sub menu");
|
|
143
142
|
const w = g({});
|
|
144
143
|
let m;
|
|
145
|
-
const B = g(!1),
|
|
144
|
+
const B = g(!1), J = g(), P = g(null), j = r(() => d.value === "horizontal" && C.value ? "bottom-start" : "right-start"), C = r(() => u.level === 0), y = r(() => o.teleported === void 0 ? C.value : o.teleported), K = r(() => e.props.collapse ? `${p.namespace.value}-zoom-in-left` : `${p.namespace.value}-zoom-in-top`), Q = r(() => d.value === "horizontal" && C.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 = r(() => e.openedMenus.includes(o.index)), M = r(() => {
|
|
146
145
|
let t = !1;
|
|
147
146
|
return Object.values(w.value).forEach((l) => {
|
|
148
147
|
l.active && (t = !0);
|
|
@@ -156,11 +155,11 @@ const z = (
|
|
|
156
155
|
} : {
|
|
157
156
|
borderBottomColor: M.value ? e.props.activeTextColor ? $.value : "" : "transparent",
|
|
158
157
|
color: M.value ? $.value : O.value
|
|
159
|
-
}),
|
|
158
|
+
}), W = () => {
|
|
160
159
|
var t, l, i;
|
|
161
160
|
return (i = (l = (t = P.value) == null ? void 0 : t.popperRef) == null ? void 0 : l.popperInstanceRef) == null ? void 0 : i.destroy();
|
|
162
|
-
},
|
|
163
|
-
t ||
|
|
161
|
+
}, X = (t) => {
|
|
162
|
+
t || W();
|
|
164
163
|
}, R = (t) => {
|
|
165
164
|
if (e.props.menuTrigger === "hover" && e.props.mode === "horizontal" || e.props.collapse && e.props.mode === "vertical" || o.disabled)
|
|
166
165
|
return;
|
|
@@ -178,11 +177,11 @@ const z = (
|
|
|
178
177
|
} = Z(() => {
|
|
179
178
|
e.openMenu(o.index, T.value);
|
|
180
179
|
}, l), y.value && ((i = A.value.vnode.el) == null || i.dispatchEvent(new MouseEvent("mouseenter"))), E("mouseenter", t)));
|
|
181
|
-
},
|
|
180
|
+
}, Y = () => {
|
|
182
181
|
e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseEnterTimer = setTimeout(() => {
|
|
183
182
|
e.inSubMenu = !0;
|
|
184
183
|
}, o.showTimeout + 10);
|
|
185
|
-
},
|
|
184
|
+
}, _ = () => {
|
|
186
185
|
e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseleaveTimer = setTimeout(() => {
|
|
187
186
|
e.inSubMenu = !1;
|
|
188
187
|
}, o.hideTimeout - 10);
|
|
@@ -194,7 +193,7 @@ const z = (
|
|
|
194
193
|
!B.value && e.closeMenu(o.index, T.value);
|
|
195
194
|
}, o.hideTimeout), y.value && l && ((i = f.parent) == null ? void 0 : i.type.name) === "vft-sub-menu" && ((n = u.handleMouseleave) == null || n.call(u, t, !0)), E("mouseleave", t));
|
|
196
195
|
};
|
|
197
|
-
le(() => e.props.collapse, (t) =>
|
|
196
|
+
le(() => e.props.collapse, (t) => X(!!t));
|
|
198
197
|
{
|
|
199
198
|
const t = (i) => {
|
|
200
199
|
w.value[i.index] = i;
|
|
@@ -209,21 +208,21 @@ const z = (
|
|
|
209
208
|
level: u.level + 1
|
|
210
209
|
});
|
|
211
210
|
}
|
|
212
|
-
|
|
211
|
+
G({
|
|
213
212
|
opened: c
|
|
214
213
|
}), ae(() => {
|
|
215
214
|
e.addSubMenu(x), u.addSubMenu(x);
|
|
216
215
|
}), se(() => {
|
|
217
216
|
u.removeSubMenu(x), e.removeSubMenu(x);
|
|
218
217
|
});
|
|
219
|
-
const v = pe(), D = r(() => I(o.icon, "icon")),
|
|
218
|
+
const v = pe(), D = r(() => I(o.icon, "icon")), ee = r(() => I(o.expandIcon, "icon")), oe = r(() => I(o.collapseIcon, "icon")), te = r(() => d.value === "horizontal" && C.value || d.value === "vertical" && !e.props.collapse ? {
|
|
220
219
|
icon: "ico-ep:arrow-down",
|
|
221
220
|
size: 20,
|
|
222
|
-
...
|
|
221
|
+
...ee.value
|
|
223
222
|
} : {
|
|
224
223
|
icon: "ico-ep:arrow-right",
|
|
225
224
|
size: 18,
|
|
226
|
-
...
|
|
225
|
+
...oe.value
|
|
227
226
|
}), H = r(() => Me(f, "title"));
|
|
228
227
|
return () => {
|
|
229
228
|
var i;
|
|
@@ -234,7 +233,7 @@ const z = (
|
|
|
234
233
|
title: f.props.title
|
|
235
234
|
}, H.value), o.showArrow ? a(U, {
|
|
236
235
|
class: s.e("icon-arrow"),
|
|
237
|
-
...
|
|
236
|
+
...te.value,
|
|
238
237
|
style: {
|
|
239
238
|
transform: c.value ? "rotateZ(180deg)" : "none"
|
|
240
239
|
}
|
|
@@ -249,8 +248,8 @@ const z = (
|
|
|
249
248
|
popperClass: o.popperClass,
|
|
250
249
|
placement: j.value,
|
|
251
250
|
teleported: y.value,
|
|
252
|
-
fallbackPlacements:
|
|
253
|
-
transition:
|
|
251
|
+
fallbackPlacements: Q.value,
|
|
252
|
+
transition: K.value,
|
|
254
253
|
gpuAcceleration: !1,
|
|
255
254
|
...o.toolTipCfg
|
|
256
255
|
}, {
|
|
@@ -282,7 +281,7 @@ const z = (
|
|
|
282
281
|
style: [N.value, {
|
|
283
282
|
backgroundColor: F.value
|
|
284
283
|
}],
|
|
285
|
-
ref:
|
|
284
|
+
ref: J,
|
|
286
285
|
onClick: R
|
|
287
286
|
}, t) : null, a(ve, {}, {
|
|
288
287
|
default: () => {
|
|
@@ -300,13 +299,13 @@ const z = (
|
|
|
300
299
|
role: "menuitem",
|
|
301
300
|
ariaHaspopup: !0,
|
|
302
301
|
ariaExpanded: c.value,
|
|
303
|
-
onMouseenter: [
|
|
304
|
-
onMouseleave: [
|
|
302
|
+
onMouseenter: [Y, (n) => b(n)],
|
|
303
|
+
onMouseleave: [_, (n) => S(n, !0)],
|
|
305
304
|
onFocus: b
|
|
306
305
|
}, [l]);
|
|
307
306
|
};
|
|
308
307
|
}
|
|
309
308
|
});
|
|
310
309
|
export {
|
|
311
|
-
|
|
310
|
+
ot as default
|
|
312
311
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as D, ref as b, getCurrentInstance as E, computed as h, watchEffect as H, unref as r, openBlock as x, createElementBlock as R, normalizeClass as K, normalizeStyle as $, createVNode as S, withCtx as C, Fragment as F, renderList as U, createBlock as j } from "vue";
|
|
2
2
|
import { useRouterHelper as q, getRouterKeyPath as f, listenerRouteChange as G } from "@vft/router";
|
|
3
3
|
import { useMultipleTabStore as J, useTabs as L } from "@vft/store";
|
|
4
4
|
import { useRefs as O } from "@vft/use";
|
|
@@ -91,13 +91,12 @@ import "../md-code-tabs/index.js";
|
|
|
91
91
|
import "../message/index.js";
|
|
92
92
|
import tt from "./tab-content.vue2.js";
|
|
93
93
|
import { initAffixTabs as et, useTabsDrag as ot } from "./use/use-multiple-tabs.js";
|
|
94
|
-
const
|
|
94
|
+
const P = (
|
|
95
95
|
/* hoist-static*/
|
|
96
96
|
X("multiple-tabs")
|
|
97
|
-
),
|
|
98
|
-
name:
|
|
99
|
-
|
|
100
|
-
...rt,
|
|
97
|
+
), je = /* @__PURE__ */ D({
|
|
98
|
+
name: P.b(),
|
|
99
|
+
__name: "multiple-tabs",
|
|
101
100
|
props: {
|
|
102
101
|
tabsStyle: {},
|
|
103
102
|
contextMenuStyle: {},
|
|
@@ -106,9 +105,7 @@ const M = (
|
|
|
106
105
|
setup(d) {
|
|
107
106
|
const i = et();
|
|
108
107
|
d.canDrag && ot(i);
|
|
109
|
-
const u = J(), m = b(""), a = b(0), v = b(),
|
|
110
|
-
console.log(p, "===---");
|
|
111
|
-
const { go: g } = q(p), c = h(() => u.getTabList.filter((t) => {
|
|
108
|
+
const u = J(), m = b(""), a = b(0), v = b(), s = E().appContext.config.globalProperties.$router, { go: g } = q(s), c = h(() => u.getTabList.filter((t) => {
|
|
112
109
|
var e;
|
|
113
110
|
return !((e = t.meta) != null && e.hideTab);
|
|
114
111
|
}));
|
|
@@ -118,37 +115,37 @@ const M = (
|
|
|
118
115
|
const e = c.value.findIndex((o) => f(o) === m.value);
|
|
119
116
|
e === -1 ? a.value = ((t = c.value) == null ? void 0 : t.length) - 1 : a.value = e, a.value = a.value < (i == null ? void 0 : i.length) ? (i == null ? void 0 : i.length) - 1 : a.value;
|
|
120
117
|
}
|
|
121
|
-
}),
|
|
122
|
-
|
|
118
|
+
}), W(() => {
|
|
119
|
+
v.value = r(s.currentRoute);
|
|
123
120
|
}), G((t) => {
|
|
124
121
|
var T;
|
|
125
122
|
if (!t || (T = t.meta) != null && T.hasTokenToRoot)
|
|
126
123
|
return;
|
|
127
|
-
const { meta: e = {} } = t, { currentActivePath: o, hideTab: n } = e,
|
|
128
|
-
if (m.value !==
|
|
129
|
-
let y =
|
|
124
|
+
const { meta: e = {} } = t, { currentActivePath: o, hideTab: n } = e, p = n ? o : null, l = f(t);
|
|
125
|
+
if (m.value !== l && (m.value = l), p) {
|
|
126
|
+
let y = s.getRoutes().find((z) => z.path === o);
|
|
130
127
|
y && u.addTab(y, r(v), a.value, t);
|
|
131
128
|
} else
|
|
132
129
|
u.addTab(r(t), r(v), a.value);
|
|
133
130
|
});
|
|
134
|
-
function
|
|
135
|
-
var n,
|
|
131
|
+
function M(t) {
|
|
132
|
+
var n, p;
|
|
136
133
|
if (m.value === t.paneName)
|
|
137
134
|
return;
|
|
138
135
|
const e = c.value[t.attrs.index];
|
|
139
136
|
m.value = t.paneName;
|
|
140
|
-
const o = (
|
|
137
|
+
const o = (p = (n = e == null ? void 0 : e.meta) == null ? void 0 : n.hideActiveRoute) == null ? void 0 : p.fullPath;
|
|
141
138
|
g(o || e.fullPath || e.path);
|
|
142
139
|
}
|
|
143
|
-
function
|
|
144
|
-
u.closeTabByKey(t,
|
|
140
|
+
function k(t) {
|
|
141
|
+
u.closeTabByKey(t, s);
|
|
145
142
|
}
|
|
146
|
-
const [
|
|
147
|
-
function
|
|
143
|
+
const [B, I] = O();
|
|
144
|
+
function N(t) {
|
|
148
145
|
const e = t.pane.attrs.index, o = t.event;
|
|
149
|
-
|
|
146
|
+
B.value[e].handleContext(o);
|
|
150
147
|
}
|
|
151
|
-
const
|
|
148
|
+
const w = h(() => ({ ..._({
|
|
152
149
|
padding: "4px 0 0",
|
|
153
150
|
"border-bottom": "none",
|
|
154
151
|
"header-height": "26px",
|
|
@@ -160,11 +157,11 @@ const M = (
|
|
|
160
157
|
"scroll-padding": "0 20px",
|
|
161
158
|
"header-margin": "0 0 0 8px",
|
|
162
159
|
"item-border": "none"
|
|
163
|
-
}, "tabs"), ...d.tabsStyle })), { closeCurrent:
|
|
160
|
+
}, "tabs"), ...d.tabsStyle })), { closeCurrent: V } = L();
|
|
164
161
|
Q("command+e, ctrl+e", function() {
|
|
165
|
-
return
|
|
162
|
+
return V(), !1;
|
|
166
163
|
});
|
|
167
|
-
const
|
|
164
|
+
const A = h(() => ({
|
|
168
165
|
..._({
|
|
169
166
|
"sub-item-height": "40px",
|
|
170
167
|
"item-min-width": "150px"
|
|
@@ -172,34 +169,34 @@ const M = (
|
|
|
172
169
|
...d.contextMenuStyle
|
|
173
170
|
}));
|
|
174
171
|
return (t, e) => (x(), R("div", {
|
|
175
|
-
class: K(r(
|
|
176
|
-
style: $(
|
|
172
|
+
class: K(r(P).b()),
|
|
173
|
+
style: $(w.value)
|
|
177
174
|
}, [
|
|
178
175
|
S(r(Y), {
|
|
179
176
|
showBar: !1,
|
|
180
177
|
"model-value": m.value,
|
|
181
178
|
"onUpdate:modelValue": e[0] || (e[0] = (o) => m.value = o),
|
|
182
|
-
onTabClick:
|
|
183
|
-
onTabRemove:
|
|
184
|
-
onTabContextMenu:
|
|
179
|
+
onTabClick: M,
|
|
180
|
+
onTabRemove: k,
|
|
181
|
+
onTabContextMenu: N
|
|
185
182
|
}, {
|
|
186
183
|
default: C(() => [
|
|
187
184
|
(x(!0), R(F, null, U(c.value, (o, n) => {
|
|
188
|
-
var
|
|
185
|
+
var p;
|
|
189
186
|
return x(), j(r(Z), {
|
|
190
187
|
key: r(f)(o) + n,
|
|
191
|
-
closable: !((
|
|
188
|
+
closable: !((p = o.meta) != null && p.affix),
|
|
192
189
|
index: n,
|
|
193
190
|
name: r(f)(o)
|
|
194
191
|
}, {
|
|
195
192
|
label: C(() => {
|
|
196
|
-
var
|
|
193
|
+
var l;
|
|
197
194
|
return [
|
|
198
195
|
S(tt, {
|
|
199
|
-
contextMenuStyle:
|
|
200
|
-
affixNum: (
|
|
196
|
+
contextMenuStyle: A.value,
|
|
197
|
+
affixNum: (l = r(i)) == null ? void 0 : l.length,
|
|
201
198
|
ref_for: !0,
|
|
202
|
-
ref: r(
|
|
199
|
+
ref: r(I)(n),
|
|
203
200
|
tabItem: o
|
|
204
201
|
}, null, 8, ["contextMenuStyle", "affixNum", "tabItem"])
|
|
205
202
|
];
|
|
@@ -214,5 +211,5 @@ const M = (
|
|
|
214
211
|
}
|
|
215
212
|
});
|
|
216
213
|
export {
|
|
217
|
-
|
|
214
|
+
je as default
|
|
218
215
|
};
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
1
|
+
import { defineComponent as k, useSlots as y, createVNode as v, renderSlot as l, h as r } from "vue";
|
|
2
|
+
import { useNamespace as x } from "../../hooks/use-namespace/index.js";
|
|
3
3
|
import "@popperjs/core";
|
|
4
4
|
import "lodash";
|
|
5
5
|
import "../../hooks/use-z-index/index.js";
|
|
6
6
|
import "@vueuse/core";
|
|
7
|
-
import { noop as
|
|
7
|
+
import { noop as u } from "@vft/utils";
|
|
8
8
|
import "../../utils/ns-cover.js";
|
|
9
9
|
const i = (
|
|
10
10
|
/* hoist-static*/
|
|
11
|
-
|
|
12
|
-
),
|
|
13
|
-
name: i.b()
|
|
14
|
-
|
|
15
|
-
...C,
|
|
11
|
+
x("overlay")
|
|
12
|
+
), h = /* @__PURE__ */ k({
|
|
13
|
+
name: i.b(),
|
|
14
|
+
__name: "overlay",
|
|
16
15
|
props: {
|
|
17
16
|
mask: { type: Boolean },
|
|
18
17
|
onlyNode: { type: Boolean },
|
|
@@ -21,39 +20,39 @@ const i = (
|
|
|
21
20
|
zIndex: {}
|
|
22
21
|
},
|
|
23
22
|
emits: ["click"],
|
|
24
|
-
setup(o, { emit:
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
return { onClick:
|
|
23
|
+
setup(o, { emit: c }) {
|
|
24
|
+
const d = (n) => {
|
|
25
|
+
if (!n)
|
|
26
|
+
return { onClick: u, onMousedown: u, onMouseup: u };
|
|
28
27
|
let s = !1, a = !1;
|
|
29
28
|
return { onClick: (e) => {
|
|
30
|
-
s && a &&
|
|
29
|
+
s && a && n(e), s = a = !1;
|
|
31
30
|
}, onMousedown: (e) => {
|
|
32
31
|
s = e.target === e.currentTarget;
|
|
33
32
|
}, onMouseup: (e) => {
|
|
34
33
|
a = e.target === e.currentTarget;
|
|
35
34
|
} };
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
}, { onClick:
|
|
39
|
-
return () => o.mask ?
|
|
35
|
+
}, t = y(), m = (n) => {
|
|
36
|
+
c("click", n);
|
|
37
|
+
}, { onClick: p, onMousedown: f, onMouseup: M } = d(o.customMaskEvent ? void 0 : m);
|
|
38
|
+
return () => o.mask ? v(
|
|
40
39
|
"div",
|
|
41
40
|
{
|
|
42
41
|
class: [i.b(), o.overlayClass],
|
|
43
42
|
style: {
|
|
44
43
|
zIndex: o.zIndex
|
|
45
44
|
},
|
|
46
|
-
onClick:
|
|
47
|
-
onMousedown:
|
|
48
|
-
onMouseup:
|
|
45
|
+
onClick: p,
|
|
46
|
+
onMousedown: f,
|
|
47
|
+
onMouseup: M
|
|
49
48
|
},
|
|
50
|
-
[
|
|
49
|
+
[l(t, "default")],
|
|
51
50
|
14,
|
|
52
51
|
["onClick", "onMouseup", "onMousedown"]
|
|
53
52
|
) : o.onlyNode ? r(
|
|
54
53
|
"div",
|
|
55
54
|
{},
|
|
56
|
-
[
|
|
55
|
+
[l(t, "default")]
|
|
57
56
|
) : r(
|
|
58
57
|
"div",
|
|
59
58
|
{
|
|
@@ -67,10 +66,10 @@ const i = (
|
|
|
67
66
|
left: "0px"
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
|
-
[
|
|
69
|
+
[l(t, "default")]
|
|
71
70
|
);
|
|
72
71
|
}
|
|
73
72
|
});
|
|
74
73
|
export {
|
|
75
|
-
|
|
74
|
+
h as default
|
|
76
75
|
};
|