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.
Files changed (44) hide show
  1. package/attributes.json +1 -1
  2. package/dist/index.css +1 -1
  3. package/es/components/full-screen/full-screen.vue2.js +19 -17
  4. package/es/components/logo/index.d.ts +6 -0
  5. package/es/components/logo/logo.vue2.js +23 -22
  6. package/es/components/logo/types.d.ts +2 -0
  7. package/es/components/multiple-tabs/multiple-tabs.vue2.js +39 -39
  8. package/es/components/side-menu/side-menu.vue2.js +94 -94
  9. package/es/hooks/use-z-index/index.js +3 -3
  10. package/es/package.json.d.ts +1 -1
  11. package/es/package.json.js +1 -1
  12. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  13. package/lib/components/logo/index.d.ts +6 -0
  14. package/lib/components/logo/logo.vue2.cjs +1 -1
  15. package/lib/components/logo/types.d.ts +2 -0
  16. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  17. package/lib/components/side-menu/side-menu.vue2.cjs +1 -1
  18. package/lib/package.json.cjs +1 -1
  19. package/lib/package.json.d.ts +1 -1
  20. package/package.json +4 -4
  21. package/tags.json +1 -1
  22. package/theme-style/index.css +1 -1
  23. package/theme-style/src/md/table.scss +1 -4
  24. package/theme-style/vft-autocomplete.css +1 -1
  25. package/theme-style/vft-button-group.css +1 -1
  26. package/theme-style/vft-button.css +1 -1
  27. package/theme-style/vft-cascader.css +1 -1
  28. package/theme-style/vft-checkbox.css +1 -1
  29. package/theme-style/vft-color-picker.css +1 -1
  30. package/theme-style/vft-date-picker.css +1 -1
  31. package/theme-style/vft-dropdown.css +1 -1
  32. package/theme-style/vft-input.css +1 -1
  33. package/theme-style/vft-link.css +1 -1
  34. package/theme-style/vft-md-container.css +1 -1
  35. package/theme-style/vft-md-vue-playground.css +1 -1
  36. package/theme-style/vft-multiple-tabs.css +1 -1
  37. package/theme-style/vft-popper.css +1 -1
  38. package/theme-style/vft-radio.css +1 -1
  39. package/theme-style/vft-result.css +1 -1
  40. package/theme-style/vft-select.css +1 -1
  41. package/theme-style/vft-tag.css +1 -1
  42. package/theme-style/vft-time-picker.css +1 -1
  43. package/theme-style/vft-time-select.css +1 -1
  44. package/web-types.json +1 -1
@@ -1,20 +1,20 @@
1
- import { defineComponent as r, openBlock as p, createBlock as s, unref as o, mergeProps as m } from "vue";
2
- import { useFullscreen as a } from "@vft/use";
3
- import { delObjAttrNotExist as u } from "@vft/utils";
4
- import { VftIconText as f } from "../icon-text/index.js";
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 d } from "../../utils/ns-cover.js";
7
+ import { primaryColor as _ } from "../../utils/ns-cover.js";
8
8
  import "lodash-es";
9
9
  import "../form/index.js";
10
- import { useNamespace as x } from "../../hooks/use-namespace/index.js";
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 _ = r({
14
+ const y = t({
15
15
  name: "full-screen"
16
- }), z = /* @__PURE__ */ r({
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(t) {
36
- const n = t, l = x("full-screen"), { toggle: i, isFullscreen: e } = a(), c = d().value;
37
- return (y, B) => (p(), s(o(f), m({
38
- class: o(l).b(),
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": o(c),
41
- onClick: o(i),
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(u)(n, !0, !0), { pointer: "" }), null, 16, ["class", "hover-color", "onClick", "icon", "text"]));
46
+ }, o(d)(l, !0, !0), { pointer: "" }), null, 16, ["class", "hover-color", "onClick", "icon", "text"]));
45
47
  }
46
48
  });
47
49
  export {
48
- z as default
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 c, computed as r, getCurrentInstance as p, openBlock as o, createElementBlock as l, normalizeStyle as d, normalizeClass as n, unref as a, createCommentVNode as i, toDisplayString as k } from "vue";
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 C } from "../../hooks/use-namespace/index.js";
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 h } from "@vft/router";
12
- const y = ["src"], v = c({
11
+ import { useRouterHelper as v } from "@vft/router";
12
+ const y = ["src", "alt"], P = r({
13
13
  name: "vft-logo"
14
- }), R = /* @__PURE__ */ c({
15
- ...v,
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 = C("logo"), s = r(() => [e.b()]), m = p().appContext.config.globalProperties.$router, { go: u } = h(m);
23
- function g() {
24
- t.jumpPath && u(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 f = r(
27
+ const d = o(
27
28
  () => t.jumpPath ? {} : e.cssVarBlock({ cursor: "inital" })
28
29
  );
29
- return (j, x) => t.logo || t.title ? (o(), l("div", {
30
+ return (x, B) => t.logo || t.title ? (l(), n("div", {
30
31
  key: 0,
31
- class: n(s.value),
32
- onClick: g,
33
- style: d(f.value)
32
+ class: i(s.value),
33
+ onClick: f,
34
+ style: p(d.value)
34
35
  }, [
35
- t.logo ? (o(), l("img", {
36
+ t.logo ? (l(), n("img", {
36
37
  key: 0,
37
- class: n(a(e).e("img")),
38
+ class: i(c(e).e("img")),
38
39
  src: t.logo,
39
- alt: ""
40
- }, null, 10, y)) : i("", !0),
41
- t.title ? (o(), l("div", {
40
+ alt: m.value
41
+ }, null, 10, y)) : a("", !0),
42
+ t.title ? (l(), n("div", {
42
43
  key: 1,
43
- class: n(a(e).e("title"))
44
- }, k(t.title), 3)) : i("", !0)
45
- ], 6)) : i("", !0);
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 {
@@ -3,6 +3,8 @@ export interface LogoProps {
3
3
  title?: string;
4
4
  /** logo 图片地址 */
5
5
  logo?: string;
6
+ /** logo 图片的 alt 文本(无障碍 / SEO);缺省时回退到 title,再回退到 'Logo' */
7
+ alt?: string;
6
8
  /** 点击 logo 跳转路径 */
7
9
  jumpPath?: string;
8
10
  }
@@ -1,4 +1,4 @@
1
- import { defineComponent as B, getCurrentInstance as q, computed as d, ref as v, watchEffect as G, unref as t, onMounted as J, openBlock as g, createElementBlock as P, normalizeStyle as O, normalizeClass as V, createVNode as h, createSlots as Q, withCtx as T, Fragment as X, renderList as Y, createBlock as Z, renderSlot as ee, createElementVNode as te } from "vue";
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 { useRouterHelper as ie, getRouterKeyPath as b, listenerRouteChange as re } from "@vft/router";
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 R = le("multiple-tabs"), s = q().appContext.config.globalProperties.$router, I = ve(s), l = se(), f = d(
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 = d(
38
- () => Math.max(u.fixTabCount, f.value)
39
- ), r = v(""), i = v(0), p = v(), { go: C } = ie(s), m = d(() => l.getTabList.filter((e) => !e.meta?.hideTab));
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 (r.value) {
42
- const e = m.value.findIndex((n) => b(n) === r.value);
43
- e === -1 ? i.value = m.value?.length - 1 : i.value = e, i.value = i.value < f.value ? f.value - 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(s.currentRoute);
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, S = b(e);
51
- if (r.value !== S && (r.value = S), W) {
52
- const k = s.getRoutes().find((j) => j.path === a);
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 (r.value === e.paneName)
62
+ if (s.value === e.paneName)
63
63
  return;
64
- const n = m.value[e.attrs.index];
65
- r.value = e.paneName;
64
+ const n = d.value[e.attrs.index];
65
+ s.value = e.paneName;
66
66
  const a = n?.meta?.hideActiveRoute?.fullPath;
67
- C(a || n.fullPath || n.path);
67
+ y(a || n.fullPath || n.path);
68
68
  }
69
69
  function _(e) {
70
- l.closeTabByKey(e, s);
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 = d(() => {
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], s);
104
- }, x = v(!1);
105
- let y;
103
+ l.toggleFullScreen(l.getTabList[i.value], r);
104
+ }, x = h(!1);
105
+ let S;
106
106
  const U = () => {
107
- clearInterval(y), x.value = !0, l.refreshPage(0, s, l.getTabList[i.value]), y = setTimeout(() => {
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) => (g(), P("div", {
114
- class: V(t(R).b()),
113
+ }), (e, n) => (T(), P("div", {
114
+ class: V(t(C).b()),
115
115
  style: O(z.value)
116
116
  }, [
117
- h(t(ae), {
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: r.value,
122
- "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = 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: T(() => [
128
- (g(!0), P(X, null, Y(m.value, (a, c) => (g(), Z(t(ne), {
129
- key: t(b)(a) + c,
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(b)(a)
132
+ name: t(f)(a)
133
133
  }, {
134
- label: T(() => [
135
- h(de, {
134
+ label: R(() => [
135
+ b(de, {
136
136
  "context-menu-style": H,
137
- "affix-num": f.value,
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: T(() => [
150
+ fn: R(() => [
151
151
  ee(e.$slots, "nav-right", {}, () => [
152
152
  te("div", {
153
- class: V(t(R).e("nav-right"))
153
+ class: V(t(C).e("nav-right"))
154
154
  }, [
155
- h(t(w), {
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
- h(t(w), {
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 de, useSlots as ce, getCurrentInstance as pe, ref as h, computed as b, watch as fe, onMounted as me, nextTick as ve, createVNode as m, h as y, isVNode as he } from "vue";
2
- import { VftIcon as ge } from "../icon/index.js";
3
- import { VftMenu as be, VftSubMenu as ye, VftMenuItem as j, VftMenuItemGroup as Me } from "../menu/index.js";
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 Se } from "@vft/utils";
6
- import { addUnit as O } from "../../utils/helper.js";
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 Ce, useRouterHelper as Oe } from "@vft/router";
10
- import { useSortable as xe } from "@vft/use/sortable";
11
- import { useNamespace as Te } from "../../hooks/use-namespace/index.js";
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 Be } from "./use-drag-line.js";
16
- function _e(g) {
17
- return typeof g == "function" || Object.prototype.toString.call(g) === "[object Object]" && !he(g);
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 we = H({
19
+ const De = H({
20
20
  name: "vft-side-menu"
21
- }), Ue = /* @__PURE__ */ H({
22
- ...we,
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: J,
110
- emit: L
109
+ expose: L,
110
+ emit: P
111
111
  }) {
112
- const t = g, r = L, {
113
- defaultActive: P,
112
+ const t = g, r = P, {
113
+ defaultActive: U,
114
114
  collapse: f,
115
- uniqueOpened: U,
116
- defaultOpeneds: $,
117
- openMenuCollapse: F,
115
+ uniqueOpened: $,
116
+ defaultOpeneds: F,
117
+ openMenuCollapse: Y,
118
118
  defaultOpenedsLevel: M
119
- } = de(t), s = Te("side-menu"), d = ce(), x = pe(), T = h(), a = b(() => ({
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
- })), Y = (e, n = 1 / 0) => {
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
- Ce(({
135
+ xe(({
136
136
  route: e
137
137
  }) => {
138
- !e || e.meta?.hideSide && !t.useRouterJump || (T.value = e.path);
138
+ !e || e.meta?.hideSide && !t.useRouterJump || e.path && (_.value = e.path);
139
139
  });
140
- const Z = (e) => {
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
- B({
144
+ w({
145
145
  activeDom: o,
146
146
  offset: l
147
147
  });
148
148
  }
149
149
  r("subMenuOpenClick", e);
150
- }, z = (e) => {
150
+ }, G = (e) => {
151
151
  r("subMenuClick", e);
152
- }, B = ({
152
+ }, w = ({
153
153
  activeDom: e = null,
154
154
  offset: n = 0,
155
155
  delay: l = 300
156
156
  } = {}) => {
157
- v.value?.menu && setTimeout(() => {
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 && (v.value.menu.scrollTop = v.value.menu.scrollTop + (o.getBoundingClientRect().top - v.value.menu.getBoundingClientRect().top) + n);
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
- }, Q = (e, n) => !t.enableScroll || !e ? e : f.value && n > t.scrollThreshold ? y(Me, {
165
+ }, X = (e, n) => !t.enableScroll || !e ? e : f.value && n > t.scrollThreshold ? y(Ce, {
166
166
  style: {
167
- maxHeight: O(t.scrollMaxHeight),
167
+ maxHeight: T(t.scrollMaxHeight),
168
168
  overflowY: "auto"
169
169
  }
170
- }, () => e) : e, _ = (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], R = !!e?.[a.value.disabled], I = t.disabledJudgeTurnOver ? !R : R, N = c || l || n + o;
172
- return u?.length ? y(ye, {
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: N,
176
- index: N,
175
+ key: V,
176
+ index: V,
177
177
  title: o,
178
178
  icon: i,
179
- disabled: t.openDisabled && I,
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 ae = u?.map((p, ue) => {
189
- const C = p[a.value.path], V = p[a.value.index], se = p[a.value.icon], ie = p[a.value.title], W = !!p[a.value.disabled], re = t.disabledJudgeTurnOver ? !W : W;
190
- return p?.[a.value.children]?.length ? _(p, ue) : (
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: V || C,
195
- index: V || C,
196
- route: C,
197
- icon: se,
198
- title: ie,
199
- disabled: t.openDisabled && re
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 Q(ae, u?.length || 0);
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 && I,
215
- onMouseenter: () => G(e),
216
- onMouseleave: () => K(e)
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
- }, v = h(), X = b(() => ({
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
- })), w = x.appContext.config.globalProperties.$router;
227
- function ee(e, n) {
226
+ }));
227
+ function te(e, n) {
228
228
  if (t.useRouterJump) {
229
229
  const {
230
230
  go: l
231
- } = Oe(w), o = e.route;
231
+ } = Te(S), o = e.route;
232
232
  let u = e.route;
233
- e.indexPath.some((i) => Se(i)) && (u = e.indexPath.slice(-2).join("/"));
234
- const c = w.getRoutes().filter((i) => i.path === u)?.[0]?.meta?.linkTarget;
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 S = h(), k = h(), D = h(), te = b(() => ({
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: O(t.width),
248
+ width: T(t.width),
249
249
  height: t.height
250
250
  }));
251
- fe(() => f.value, (e) => {
252
- le.value || (e ? r("update:width", t.collapseWidth) : r("update:width", D.value || t.width), D.value = t.width);
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: le
256
- } = Be(S, k, x), oe = b(() => ({
257
- left: O(t.width)
258
- })), ne = b(() => [s.b(), t.isFixedLeft ? s.m("fixed") : ""]), A = h([]);
259
- return me(() => {
260
- ve(() => {
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
- } = xe(e, {
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
- }), J({
279
- sideRef: S,
280
- jumpActiveDom: B,
281
- menuRef: v
278
+ }), L({
279
+ sideRef: O,
280
+ jumpActiveDom: w,
281
+ menuRef: h
282
282
  }), () => {
283
283
  let e;
284
- return M.value && (A.value = Y(t.menus, E(M.value) ? M.value : 1 / 0)), m("div", {
285
- ref: S,
286
- class: ne.value,
287
- style: te.value
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(be, {
291
- ref: v,
292
- onSelect: ee,
293
- onOpen: Z,
294
- onSubMenuClick: z,
295
- defaultActive: P?.value || T.value,
296
- defaultOpeneds: $?.value || A.value,
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: X.value,
300
- collapse: F.value ? f.value : !1,
301
- uniqueOpened: U.value,
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
- }, _e(e = t.menus.map((n, l) => _(n, l))) ? e : {
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(ge, {
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: k,
319
- style: oe.value,
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
- Ue as default
326
+ Fe as default
327
327
  };