vft 0.0.436 → 0.0.438

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 (34) hide show
  1. package/es/components/autocomplete/autocomplete.vue.d.ts +2 -2
  2. package/es/components/autocomplete/index.d.ts +6 -6
  3. package/es/components/button/index.d.ts +9 -9
  4. package/es/components/carousel/use-carousel.js +1 -1
  5. package/es/components/config-provider/hooks/use-global-config.js +3 -3
  6. package/es/components/input/input.vue2.js +4 -4
  7. package/es/components/input-tag/composables/use-input-tag.js +1 -1
  8. package/es/components/md-container/md-container.vue2.js +26 -28
  9. package/es/components/menu/sub-menu.vue2.js +57 -57
  10. package/es/components/popconfirm/index.d.ts +15 -15
  11. package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
  12. package/es/components/select/index.d.ts +4 -4
  13. package/es/components/select/select.vue.d.ts +4 -4
  14. package/es/components/select/useSelect.d.ts +4 -4
  15. package/es/components/super-form/super-form-item.vue2.js +1 -1
  16. package/es/hooks/use-z-index/index.js +3 -3
  17. package/es/package.json.d.ts +1 -1
  18. package/es/package.json.js +1 -1
  19. package/es/utils/vue/vnode.js +1 -1
  20. package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
  21. package/lib/components/autocomplete/index.d.ts +6 -6
  22. package/lib/components/button/index.d.ts +9 -9
  23. package/lib/components/input/input.vue2.cjs +1 -1
  24. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  25. package/lib/components/menu/sub-menu.vue2.cjs +1 -1
  26. package/lib/components/popconfirm/index.d.ts +15 -15
  27. package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
  28. package/lib/components/select/index.d.ts +4 -4
  29. package/lib/components/select/select.vue.d.ts +4 -4
  30. package/lib/components/select/useSelect.d.ts +4 -4
  31. package/lib/package.json.cjs +1 -1
  32. package/lib/package.json.d.ts +1 -1
  33. package/package.json +3 -3
  34. package/web-types.json +1 -1
@@ -61,9 +61,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
61
61
  readonly placement?: import("@popperjs/core").Placement | undefined;
62
62
  readonly strategy?: "fixed" | "absolute" | undefined;
63
63
  readonly effect?: "light" | "dark" | undefined;
64
- readonly visible?: boolean | null | undefined;
65
64
  readonly teleported?: boolean | undefined;
66
65
  readonly open?: boolean | undefined;
66
+ readonly visible?: boolean | null | undefined;
67
67
  readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
68
68
  readonly arrowOffset?: number | undefined;
69
69
  readonly gpuAcceleration?: boolean | undefined;
@@ -479,9 +479,9 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
479
479
  readonly placement?: import("@popperjs/core").Placement | undefined;
480
480
  readonly strategy?: "fixed" | "absolute" | undefined;
481
481
  readonly effect?: "light" | "dark" | undefined;
482
- readonly visible?: boolean | null | undefined;
483
482
  readonly teleported?: boolean | undefined;
484
483
  readonly open?: boolean | undefined;
484
+ readonly visible?: boolean | null | undefined;
485
485
  readonly trigger?: import("vft/es/components/tooltip").TooltipTriggerType | undefined;
486
486
  readonly arrowOffset?: number | undefined;
487
487
  readonly gpuAcceleration?: boolean | undefined;
@@ -85,9 +85,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
85
85
  readonly placement?: import("@popperjs/core").Placement | undefined;
86
86
  readonly strategy?: "fixed" | "absolute" | undefined;
87
87
  readonly effect?: "light" | "dark" | undefined;
88
- readonly visible?: boolean | null | undefined;
89
88
  readonly teleported?: boolean | undefined;
90
89
  readonly open?: boolean | undefined;
90
+ readonly visible?: boolean | null | undefined;
91
91
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
92
92
  readonly arrowOffset?: number | undefined;
93
93
  readonly gpuAcceleration?: boolean | undefined;
@@ -503,9 +503,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
503
503
  readonly placement?: import("@popperjs/core").Placement | undefined;
504
504
  readonly strategy?: "fixed" | "absolute" | undefined;
505
505
  readonly effect?: "light" | "dark" | undefined;
506
- readonly visible?: boolean | null | undefined;
507
506
  readonly teleported?: boolean | undefined;
508
507
  readonly open?: boolean | undefined;
508
+ readonly visible?: boolean | null | undefined;
509
509
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
510
510
  readonly arrowOffset?: number | undefined;
511
511
  readonly gpuAcceleration?: boolean | undefined;
@@ -1006,9 +1006,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1006
1006
  readonly placement?: import("@popperjs/core").Placement | undefined;
1007
1007
  readonly strategy?: "fixed" | "absolute" | undefined;
1008
1008
  readonly effect?: "light" | "dark" | undefined;
1009
- readonly visible?: boolean | null | undefined;
1010
1009
  readonly teleported?: boolean | undefined;
1011
1010
  readonly open?: boolean | undefined;
1011
+ readonly visible?: boolean | null | undefined;
1012
1012
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1013
1013
  readonly arrowOffset?: number | undefined;
1014
1014
  readonly gpuAcceleration?: boolean | undefined;
@@ -1424,9 +1424,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1424
1424
  readonly placement?: import("@popperjs/core").Placement | undefined;
1425
1425
  readonly strategy?: "fixed" | "absolute" | undefined;
1426
1426
  readonly effect?: "light" | "dark" | undefined;
1427
- readonly visible?: boolean | null | undefined;
1428
1427
  readonly teleported?: boolean | undefined;
1429
1428
  readonly open?: boolean | undefined;
1429
+ readonly visible?: boolean | null | undefined;
1430
1430
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1431
1431
  readonly arrowOffset?: number | undefined;
1432
1432
  readonly gpuAcceleration?: boolean | undefined;
@@ -1916,9 +1916,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
1916
1916
  readonly placement?: import("@popperjs/core").Placement | undefined;
1917
1917
  readonly strategy?: "fixed" | "absolute" | undefined;
1918
1918
  readonly effect?: "light" | "dark" | undefined;
1919
- readonly visible?: boolean | null | undefined;
1920
1919
  readonly teleported?: boolean | undefined;
1921
1920
  readonly open?: boolean | undefined;
1921
+ readonly visible?: boolean | null | undefined;
1922
1922
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
1923
1923
  readonly arrowOffset?: number | undefined;
1924
1924
  readonly gpuAcceleration?: boolean | undefined;
@@ -2334,9 +2334,9 @@ export declare const VftAutocomplete: import("vft/es/utils").SFCWithInstall<{
2334
2334
  readonly placement?: import("@popperjs/core").Placement | undefined;
2335
2335
  readonly strategy?: "fixed" | "absolute" | undefined;
2336
2336
  readonly effect?: "light" | "dark" | undefined;
2337
- readonly visible?: boolean | null | undefined;
2338
2337
  readonly teleported?: boolean | undefined;
2339
2338
  readonly open?: boolean | undefined;
2339
+ readonly visible?: boolean | null | undefined;
2340
2340
  readonly trigger?: import("vft/es/vft").TooltipTriggerType | undefined;
2341
2341
  readonly arrowOffset?: number | undefined;
2342
2342
  readonly gpuAcceleration?: boolean | undefined;
@@ -24,12 +24,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
24
24
  autofocus: {
25
25
  type: import("vue").PropType<boolean>;
26
26
  };
27
- icon: {
28
- type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
29
- };
30
27
  dark: {
31
28
  type: import("vue").PropType<boolean>;
32
29
  };
30
+ icon: {
31
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
32
+ };
33
33
  loading: {
34
34
  type: import("vue").PropType<boolean>;
35
35
  };
@@ -114,12 +114,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
114
114
  autofocus: {
115
115
  type: import("vue").PropType<boolean>;
116
116
  };
117
- icon: {
118
- type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
119
- };
120
117
  dark: {
121
118
  type: import("vue").PropType<boolean>;
122
119
  };
120
+ icon: {
121
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
122
+ };
123
123
  loading: {
124
124
  type: import("vue").PropType<boolean>;
125
125
  };
@@ -199,12 +199,12 @@ export declare const VftButton: import("vft/es/utils").SFCWithInstall<{
199
199
  autofocus: {
200
200
  type: import("vue").PropType<boolean>;
201
201
  };
202
- icon: {
203
- type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
204
- };
205
202
  dark: {
206
203
  type: import("vue").PropType<boolean>;
207
204
  };
205
+ icon: {
206
+ type: import("vue").PropType<string | import("vft/es/vft").IconProps>;
207
+ };
208
208
  loading: {
209
209
  type: import("vue").PropType<boolean>;
210
210
  };
@@ -11,7 +11,7 @@ import "../../hooks/use-model-toggle/index.js";
11
11
  import { useOrderedChildren as ge } from "../../hooks/use-ordered-children/index.js";
12
12
  import "@popperjs/core";
13
13
  import "../../hooks/use-z-index/index.js";
14
- import { carouselContextKey as Se, CAROUSEL_ITEM_NAME as H } from "./constants.js";
14
+ import { CAROUSEL_ITEM_NAME as H, carouselContextKey as Se } from "./constants.js";
15
15
  const L = 300, ze = (t, O, M) => {
16
16
  const {
17
17
  children: o,
@@ -1,7 +1,7 @@
1
1
  import { keysOf as f } from "@vft/utils";
2
2
  import "@vueuse/core";
3
3
  import { debugWarn as v } from "../../../utils/error.js";
4
- import { getCurrentInstance as l, computed as i, unref as p, provide as g, ref as C, inject as x } from "vue";
4
+ import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
5
5
  import "lodash-es";
6
6
  import "../../form/index.js";
7
7
  import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
9
9
  import "@popperjs/core";
10
10
  import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
11
11
  import { configProviderContextKey as m } from "../constants.js";
12
- const a = C();
12
+ const a = g();
13
13
  function d(o, e = void 0) {
14
14
  const n = l() ? x(m, a) : a;
15
15
  return o ? i(() => n?.value?.[o] ?? e) : n;
@@ -27,7 +27,7 @@ function B(o) {
27
27
  };
28
28
  }
29
29
  const S = (o, e, n = !1) => {
30
- const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? g : void 0);
30
+ const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
31
31
  if (!u) {
32
32
  v(
33
33
  "provideGlobalConfig",
@@ -13,8 +13,8 @@ import "../../hooks/use-z-index/index.js";
13
13
  import { UPDATE_MODEL_EVENT as Q } from "@vft/constants";
14
14
  import { useAttrs as Ze, useCursor as _e } from "@vft/use";
15
15
  import { calcTextareaHeight as he } from "./utils.js";
16
- import { useFormItem as et, useFormItemInputId as tt } from "../form/hooks/use-form-item.js";
17
- import { useFormSize as at, useFormDisabled as nt } from "../form/hooks/use-form-common-props.js";
16
+ import { useFormSize as et, useFormDisabled as tt } from "../form/hooks/use-form-common-props.js";
17
+ import { useFormItem as at, useFormItemInputId as nt } from "../form/hooks/use-form-item.js";
18
18
  const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "readonly", "autocomplete", "tabindex", "aria-label", "placeholder", "form"], st = ["id", "tabindex", "disabled", "readonly", "autocomplete", "aria-label", "placeholder", "form"], It = /* @__PURE__ */ Oe({
19
19
  __name: "input",
20
20
  props: {
@@ -85,9 +85,9 @@ const ot = ["role"], lt = ["id", "type", "disabled", "formatter", "parser", "rea
85
85
  n.is("focus", v.value)
86
86
  ]), d = Ze({
87
87
  excludeKeys: l(() => Object.keys(X.value))
88
- }), { form: Ce, formItem: F } = et(), { inputId: Y } = tt(we.props, {
88
+ }), { form: Ce, formItem: F } = at(), { inputId: Y } = nt(we.props, {
89
89
  formItemContext: F
90
- }), ke = at(), x = nt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
90
+ }), ke = et(), x = tt(), n = ye("input"), Z = ye("textarea"), M = H(), p = H(), v = S(!1), N = S(!1), C = S(!1), K = S(!1), _ = S(), O = H(e.inputStyle), k = l(() => M.value || p.value), T = l(() => G(e.prefixIcon, "icon", { size: 16 })), ee = l(() => G(e.suffixIcon, "icon", { size: 16 })), Ie = l(() => G(e.clearIcon, "icon", {
91
91
  icon: "icon-circle-close",
92
92
  size: 16
93
93
  })), te = l(() => Ce?.statusIcon ?? !1), I = l(() => F?.validateState || ""), ae = l(
@@ -1,6 +1,6 @@
1
1
  import { shallowRef as B, ref as L, computed as c, watch as G } from "vue";
2
2
  import { EVENT_CODE as g } from "../../../constants/aria.js";
3
- import { CHANGE_EVENT as i, UPDATE_MODEL_EVENT as d, INPUT_EVENT as H } from "../../../constants/event.js";
3
+ import { CHANGE_EVENT as i, INPUT_EVENT as H, UPDATE_MODEL_EVENT as d } from "../../../constants/event.js";
4
4
  import "@vueuse/core";
5
5
  import { isUndefined as K } from "@vft/utils";
6
6
  import { debugWarn as C } from "../../../utils/error.js";
@@ -1,11 +1,11 @@
1
- import { defineComponent as S, getCurrentInstance as R, ref as $, computed as v, onMounted as A, nextTick as P, onDeactivated as q, onBeforeMount as z, createElementBlock as u, openBlock as r, normalizeClass as c, unref as e, createBlock as C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as _, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
2
- import { VftIcon as k } from "../icon/index.js";
1
+ import { defineComponent as T, getCurrentInstance as R, ref as $, computed as v, onMounted as P, nextTick as q, onDeactivated as z, onBeforeMount as A, createElementBlock as u, openBlock as s, normalizeClass as c, unref as e, createBlock as C, createCommentVNode as x, createElementVNode as i, createVNode as m, toDisplayString as k, Fragment as I, renderList as B, withCtx as F, createTextVNode as H, renderSlot as J } from "vue";
2
+ import { VftIcon as b } from "../icon/index.js";
3
3
  import { VftIconText as O } from "../icon-text/index.js";
4
4
  import { VftMdComment as j } from "../md-comment/index.js";
5
5
  import { VftSideMenu as U } from "../side-menu/index.js";
6
6
  import { VftTag as Y } from "../tag/index.js";
7
7
  import "@vueuse/core";
8
- import { handleScrollPosition as G, jumpElement as b, getRandomElementForArr as K, isClient as Q } from "@vft/utils";
8
+ import { handleScrollPosition as G, jumpElement as S, getRandomElementForArr as K, isClient as Q } from "@vft/utils";
9
9
  import "../config-provider/hooks/use-global-config.js";
10
10
  import { primaryColor as W } from "../../utils/ns-cover.js";
11
11
  import { debounce as X } from "lodash-es";
@@ -26,18 +26,18 @@ const re = { class: "info-container" }, se = {
26
26
  }, ce = { class: "infos" }, me = {
27
27
  class: "reading",
28
28
  title: "阅读量"
29
- }, de = ["data-path"], ue = S({
29
+ }, de = ["data-path"], ue = T({
30
30
  name: "vft-md-container"
31
- }), Pe = /* @__PURE__ */ S({
31
+ }), qe = /* @__PURE__ */ T({
32
32
  ...ue,
33
33
  props: {
34
34
  tocList: {},
35
35
  scrollDom: { default: ".layout-content" }
36
36
  },
37
- setup(s) {
38
- const l = Z("md-container"), T = R(), f = $(), d = v(() => s.tocList && s.tocList !== "undefined" ? JSON.parse(s.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
37
+ setup(r) {
38
+ const l = Z("md-container"), _ = R(), f = $(), d = v(() => r.tocList && r.tocList !== "undefined" ? JSON.parse(r.tocList) : ""), { initPhotoSwipe: D } = oe(`.${l.e("content")} img`);
39
39
  D(), ae();
40
- const p = T.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
40
+ const p = _.appContext.config.globalProperties.$router, a = p.currentRoute.value, L = W(), V = Q ? location.pathname : "", { go: w } = ee(p);
41
41
  function E(o) {
42
42
  w(`/?classify=${o}`);
43
43
  }
@@ -46,24 +46,22 @@ const re = { class: "info-container" }, se = {
46
46
  scrollDom: ".layout-content",
47
47
  contentDom: ".header-anchor",
48
48
  selectAttrName: "href",
49
- offset: 100,
49
+ offset: 130,
50
50
  callback: (o) => {
51
- f.value.menuRef.updateActiveIndex(
52
- o.slice(1)
53
- );
51
+ f.value.menuRef.activeIndex = o.slice(1);
54
52
  }
55
53
  }),
56
54
  100
57
55
  ), h = (o) => {
58
- b(`#${o.index}`);
56
+ S(`#${o.index}`, r.scrollDom, 120);
59
57
  }, y = () => {
60
- const o = document.querySelector(s.scrollDom);
58
+ const o = document.querySelector(r.scrollDom);
61
59
  o && o.removeEventListener("scroll", g);
62
60
  };
63
- return A(() => {
64
- P(() => {
61
+ return P(() => {
62
+ q(() => {
65
63
  setTimeout(() => {
66
- b(encodeURI(a.hash));
64
+ S(encodeURI(a.hash));
67
65
  }), setTimeout(() => {
68
66
  const t = document.querySelector(".layout-content");
69
67
  t && t.addEventListener("scroll", g);
@@ -76,14 +74,14 @@ const re = { class: "info-container" }, se = {
76
74
  n[t].offsetHeight === 0 ? (n[t].style.height = "auto", n[t].style.visibility = "visible") : (n[t].style.height = "0px", n[t].style.visibility = "hidden");
77
75
  });
78
76
  });
79
- }), q(() => {
80
- y();
81
77
  }), z(() => {
82
78
  y();
83
- }), (o, n) => (r(), u("div", {
79
+ }), A(() => {
80
+ y();
81
+ }), (o, n) => (s(), u("div", {
84
82
  class: c([e(l).b(), e(l).is("api", M.value)])
85
83
  }, [
86
- d.value?.length ? (r(), C(e(U), {
84
+ d.value?.length ? (s(), C(e(U), {
87
85
  key: 0,
88
86
  ref_key: "sideMenuRef",
89
87
  ref: f,
@@ -105,15 +103,15 @@ const re = { class: "info-container" }, se = {
105
103
  }, [
106
104
  i("h1", {
107
105
  class: c(e(l).e("title"))
108
- }, _(e(a).meta?.title), 3),
106
+ }, k(e(a).meta?.title), 3),
109
107
  i("div", re, [
110
- e(a).meta?.category?.length ? (r(), u("div", se, [
111
- m(e(k), {
108
+ e(a).meta?.category?.length ? (s(), u("div", se, [
109
+ m(e(b), {
112
110
  size: 14,
113
111
  color: e(L),
114
112
  icon: "icon-category"
115
113
  }, null, 8, ["color"]),
116
- (r(!0), u(I, null, B(e(a).meta?.category, (t, N) => (r(), C(e(Y), {
114
+ (s(!0), u(I, null, B(e(a).meta?.category, (t, N) => (s(), C(e(Y), {
117
115
  size: "small",
118
116
  class: "tag",
119
117
  type: e(K)(e(le), 1)[0],
@@ -121,7 +119,7 @@ const re = { class: "info-container" }, se = {
121
119
  onClick: (fe) => E(t)
122
120
  }, {
123
121
  default: F(() => [
124
- H(_(t), 1)
122
+ H(k(t), 1)
125
123
  ]),
126
124
  _: 2
127
125
  }, 1032, ["type", "onClick"]))), 128))
@@ -138,7 +136,7 @@ const re = { class: "info-container" }, se = {
138
136
  )
139
137
  }, null, 8, ["text"]),
140
138
  i("div", me, [
141
- m(e(k), {
139
+ m(e(b), {
142
140
  icon: "icon-reading",
143
141
  size: 14,
144
142
  class: "mr-5px"
@@ -169,5 +167,5 @@ const re = { class: "info-container" }, se = {
169
167
  }
170
168
  });
171
169
  export {
172
- Pe as default
170
+ qe as default
173
171
  };
@@ -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 u, Fragment as pe, withDirectives as me, vShow as de } from "vue";
1
+ import { defineComponent as Z, getCurrentInstance as le, computed as l, inject as D, ref as x, reactive as ue, watch as ae, provide as se, onMounted as ie, onBeforeUnmount as re, useSlots as ce, h as a, Fragment as de, withDirectives as pe, vShow as me } 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";
@@ -14,11 +14,11 @@ import "@popperjs/core";
14
14
  import "../../hooks/use-z-index/index.js";
15
15
  import he from "./use-menu.js";
16
16
  import { useMenuCssVar as Te } from "./use-menu-css-var.js";
17
- const Ce = Z({
17
+ const xe = Z({
18
18
  name: "vft-sub-menu",
19
19
  inheritAttrs: !1
20
20
  }), Ve = /* @__PURE__ */ Z({
21
- ...Ce,
21
+ ...xe,
22
22
  props: {
23
23
  index: {},
24
24
  showTimeout: {
@@ -53,29 +53,29 @@ const Ce = Z({
53
53
  expose: q,
54
54
  emit: G
55
55
  }) {
56
- const y = G, I = w("sub-menu"), m = le(), {
56
+ const I = G, y = w("sub-menu"), p = le(), {
57
57
  indexPath: f,
58
58
  parentMenu: k
59
- } = he(m, l(() => o.index)), i = w("menu"), a = w("sub-menu"), e = D("rootMenu");
60
- e || U(I.b(), "can not inject root menu");
61
- const r = D(`subMenu:${k.value.uid}`);
62
- r || U(I.b(), "can not inject sub menu");
63
- const S = C({});
59
+ } = he(p, l(() => o.index)), r = w("menu"), u = w("sub-menu"), e = D("rootMenu");
60
+ e || U(y.b(), "can not inject root menu");
61
+ const i = D(`subMenu:${k.value.uid}`);
62
+ i || U(y.b(), "can not inject sub menu");
63
+ const C = x({});
64
64
  let M;
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(() => {
65
+ const z = x(!1), J = x(), E = x(null), A = l(() => d.value === "horizontal" && b.value ? "bottom-start" : "right-start"), b = l(() => i.level === 0), S = l(() => o.teleported === void 0 ? b.value : o.teleported), K = l(() => e.props.collapse ? `${r.namespace.value}-zoom-in-left` : `${r.namespace.value}-zoom-in-top`), Q = l(() => d.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)), m = l(() => {
66
66
  let t = !1;
67
- return Object.values(S.value).forEach((s) => {
67
+ return Object.values(C.value).forEach((s) => {
68
68
  s.active && (t = !0);
69
69
  }), o.index === e.activeIndex && (t = !0), t;
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({
70
+ }), B = l(() => e.props.backgroundColor || ""), P = l(() => e.props.activeTextColor || ""), F = l(() => e.props.textColor || ""), d = l(() => e.props.mode), W = l(() => e.props.persistent), h = ue({
71
71
  index: o.index,
72
72
  indexPath: f,
73
- active: d
74
- }), j = Te(e.props, r.level + 1), $ = l(() => p.value !== "horizontal" ? {
73
+ active: m
74
+ }), j = Te(e.props, i.level + 1), $ = l(() => d.value !== "horizontal" ? {
75
75
  color: F.value
76
76
  } : {
77
- borderBottomColor: d.value ? e.props.activeTextColor ? P.value : "" : "transparent",
78
- color: d.value ? P.value : F.value
77
+ borderBottomColor: m.value ? e.props.activeTextColor ? P.value : "" : "transparent",
78
+ color: m.value ? P.value : F.value
79
79
  }), X = () => E.value?.popperRef?.popperInstanceRef?.destroy(), Y = (t) => {
80
80
  t || X();
81
81
  }, O = (t) => {
@@ -83,7 +83,7 @@ const Ce = Z({
83
83
  e: t,
84
84
  index: o.index,
85
85
  indexPath: f.value,
86
- active: d.value
86
+ active: m.value
87
87
  };
88
88
  if (e.props.menuTrigger === "hover" && e.props.mode === "horizontal" && !fe() || e.props.collapse && e.props.mode === "vertical" || o.disabled) {
89
89
  e.handleSubMenuClick({
@@ -94,11 +94,11 @@ const Ce = Z({
94
94
  }
95
95
  e.handleSubMenuClick(s);
96
96
  }, v = (t, s = o.showTimeout) => {
97
- t.type !== "focus" && (e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || o.disabled || (r.mouseInChild.value = !0, M?.(), {
97
+ t.type !== "focus" && (e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || o.disabled || (i.mouseInChild.value = !0, M?.(), {
98
98
  stop: M
99
99
  } = H(() => {
100
100
  e.openMenu(o.index, f.value);
101
- }, s), x.value && k.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter")), y("mouseenter", t)));
101
+ }, s), S.value && k.value.vnode.el?.dispatchEvent(new MouseEvent("mouseenter")), I("mouseenter", t)));
102
102
  }, _ = () => {
103
103
  e.inSubMenuMouseEnterTimer && clearTimeout(e.inSubMenuMouseEnterTimer), e.inSubMenuMouseleaveTimer && clearTimeout(e.inSubMenuMouseleaveTimer), e.inSubMenuMouseEnterTimer = setTimeout(() => {
104
104
  e.inSubMenu = !0;
@@ -108,35 +108,33 @@ const Ce = Z({
108
108
  e.inSubMenu = !1;
109
109
  }, o.hideTimeout - 10);
110
110
  }, T = (t, s = !1) => {
111
- e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || (M?.(), r.mouseInChild.value = !1, {
111
+ e.props.menuTrigger === "click" && e.props.mode === "horizontal" || !e.props.collapse && e.props.mode === "vertical" || (M?.(), i.mouseInChild.value = !1, {
112
112
  stop: M
113
113
  } = H(() => {
114
114
  !z.value && e.closeMenu(o.index, f.value);
115
- }, o.hideTimeout), x.value && s && m.parent?.type.name === "vft-sub-menu" && r.handleMouseleave?.(t, !0), y("mouseleave", t));
115
+ }, o.hideTimeout), S.value && s && p.parent?.type.name === "vft-sub-menu" && i.handleMouseleave?.(t, !0), I("mouseleave", t));
116
116
  };
117
117
  ae(() => e.props.collapse, (t) => Y(!!t));
118
118
  {
119
119
  const t = (n) => {
120
- S.value[n.index] = n;
120
+ C.value[n.index] = n;
121
121
  }, s = (n) => {
122
- delete S.value[n.index];
122
+ delete C.value[n.index];
123
123
  };
124
- se(`subMenu:${m.uid}`, {
124
+ se(`subMenu:${p.uid}`, {
125
125
  addSubMenu: t,
126
126
  removeSubMenu: s,
127
127
  handleMouseleave: T,
128
128
  mouseInChild: z,
129
- level: r.level + 1
129
+ level: i.level + 1
130
130
  });
131
131
  }
132
- q({
133
- opened: c
132
+ ie(() => {
133
+ e.addSubMenu(h), i.addSubMenu(h);
134
134
  }), re(() => {
135
- e.addSubMenu(h), r.addSubMenu(h);
136
- }), ie(() => {
137
- r.removeSubMenu(h), e.removeSubMenu(h);
135
+ i.removeSubMenu(h), e.removeSubMenu(h);
138
136
  });
139
- const V = ce(), N = l(() => g(o.icon, "icon")), oe = l(() => g(o.expandIcon, "icon")), te = l(() => g(o.collapseIcon, "icon")), ne = l(() => p.value === "horizontal" && b.value || p.value === "vertical" && !e.props.collapse ? {
137
+ const V = ce(), N = l(() => g(o.icon, "icon")), oe = l(() => g(o.expandIcon, "icon")), te = l(() => g(o.collapseIcon, "icon")), ne = l(() => d.value === "horizontal" && b.value || d.value === "vertical" && !e.props.collapse ? {
140
138
  icon: "icon-arrow-down",
141
139
  size: 20,
142
140
  ...oe.value
@@ -144,20 +142,22 @@ const Ce = Z({
144
142
  icon: "icon-arrow-right",
145
143
  size: 18,
146
144
  ...te.value
147
- }), R = l(() => ve(m, "title"));
148
- return () => {
149
- const t = [N.value?.icon ? u(L, {
145
+ }), R = l(() => ve(p, "title"));
146
+ return q({
147
+ opened: c
148
+ }), () => {
149
+ const t = [N.value?.icon ? a(L, {
150
150
  ...N.value
151
- }) : null, u("span", {
152
- class: [a.e("text"), a.is("arrow", o.showArrow)],
153
- title: m.props.title
154
- }, R.value), o.showArrow ? u(L, {
155
- class: a.e("icon-arrow"),
151
+ }) : null, a("span", {
152
+ class: [u.e("text"), u.is("arrow", o.showArrow)],
153
+ title: p.props.title
154
+ }, R.value), o.showArrow ? a(L, {
155
+ class: u.e("icon-arrow"),
156
156
  ...ne.value,
157
157
  style: {
158
158
  transform: c.value ? "rotateZ(180deg)" : "none"
159
159
  }
160
- }) : !1], s = e.isMenuPopup ? u(Me, {
160
+ }) : !1], s = e.isMenuPopup ? a(Me, {
161
161
  ref: E,
162
162
  visible: c.value,
163
163
  effect: "light",
@@ -167,25 +167,25 @@ const Ce = Z({
167
167
  persistent: W.value,
168
168
  popperClass: o.popperClass,
169
169
  placement: A.value,
170
- teleported: x.value,
170
+ teleported: S.value,
171
171
  fallbackPlacements: Q.value,
172
172
  transition: K.value,
173
173
  gpuAcceleration: !1,
174
174
  ...o.toolTipCfg
175
175
  }, {
176
- content: () => u("div", {
177
- class: [i.m(p.value), i.m("popup-container"), o.popperClass],
176
+ content: () => a("div", {
177
+ class: [r.m(d.value), r.m("popup-container"), o.popperClass],
178
178
  onMouseenter: (n) => v(n, 100),
179
179
  onMouseleave: (n) => T(n, !0),
180
180
  onFocus: (n) => v(n, 100)
181
- }, [u("div", {
182
- class: [i.b(), i.m("popup"), i.m(`popup-${A.value}`)],
181
+ }, [a("div", {
182
+ class: [r.b(), r.m("popup"), r.m(`popup-${A.value}`)],
183
183
  style: j.value
184
- }, [u("ul", {
185
- class: i.m("popup-ul-list")
184
+ }, [a("ul", {
185
+ class: r.m("popup-ul-list")
186
186
  }, V.default?.())])]),
187
- default: () => u("div", {
188
- class: a.e("title"),
187
+ default: () => a("div", {
188
+ class: [u.e("title"), u.is("active", o.index === e.activeIndex)],
189
189
  style: [$.value, {
190
190
  backgroundColor: B.value
191
191
  }],
@@ -195,23 +195,23 @@ const Ce = Z({
195
195
  }, t)
196
196
  }) : (
197
197
  // 以下是无需 tooltip 渲染的组件,通常是侧边栏没有折叠的时候
198
- u(pe, {}, [R.value ? u("div", {
199
- class: a.e("title"),
198
+ a(de, {}, [R.value ? a("div", {
199
+ class: [u.e("title"), u.is("active", o.index === e.activeIndex)],
200
200
  style: [$.value, {
201
201
  backgroundColor: B.value
202
202
  }],
203
203
  ref: J,
204
204
  onClick: O
205
- }, t) : null, u(be, {}, {
206
- default: () => me(u("ul", {
205
+ }, t) : null, a(be, {}, {
206
+ default: () => pe(a("ul", {
207
207
  role: "menu",
208
- class: [i.b(), i.m("inline")],
208
+ class: [r.b(), r.m("inline")],
209
209
  style: j.value
210
- }, [V.default?.()]), [[de, c.value]])
210
+ }, [V.default?.()]), [[me, c.value]])
211
211
  })])
212
212
  );
213
- return u("li", {
214
- class: [a.b(), a.is("active", d.value), a.e(String(r.level)), a.is("in-popup", r.level !== 0), a.is("opened", c.value), a.is("arrow", !0), a.is("disabled", o.disabled)],
213
+ return a("li", {
214
+ class: [u.b(), u.is("active", m.value), u.e(String(i.level)), u.is("in-popup", i.level !== 0), u.is("opened", c.value), u.is("arrow", !0), u.is("disabled", o.disabled)],
215
215
  role: "menuitem",
216
216
  ariaHaspopup: !0,
217
217
  ariaExpanded: c.value,