vft 0.0.511 → 0.0.514

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 (137) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/cascader/cascader.vue2.js +202 -203
  3. package/es/components/cascader-panel/menu.vue2.js +49 -50
  4. package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
  5. package/es/components/color-picker/color-picker.vue2.js +133 -134
  6. package/es/components/config-provider/config-provider.vue.d.ts +0 -2
  7. package/es/components/config-provider/config-provider.vue2.js +4 -5
  8. package/es/components/config-provider/constants.d.ts +0 -1
  9. package/es/components/config-provider/constants.js +2 -3
  10. package/es/components/config-provider/hooks/use-global-config.js +30 -33
  11. package/es/components/config-provider/index.d.ts +0 -9
  12. package/es/components/config-provider/index.js +5 -6
  13. package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
  14. package/es/components/date-picker/composables/use-month-range-header.js +14 -15
  15. package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
  16. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
  17. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
  18. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
  19. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
  20. package/es/components/date-time-select/date-time-select.vue2.js +36 -39
  21. package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  22. package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
  23. package/es/components/dropdown/dropdown.vue.d.ts +1 -1
  24. package/es/components/dropdown/dropdown.vue2.js +67 -68
  25. package/es/components/dropdown/index.d.ts +33 -33
  26. package/es/components/empty/empty.vue2.js +38 -39
  27. package/es/components/full-screen/full-screen.vue2.js +17 -18
  28. package/es/components/image/image.vue2.js +59 -60
  29. package/es/components/image-viewer/image-viewer.vue2.js +44 -45
  30. package/es/components/index.js +97 -98
  31. package/es/components/md-container/md-container.vue2.js +74 -75
  32. package/es/components/md-container/toc.js +36 -37
  33. package/es/components/message-box/message-box.vue2.js +3 -3
  34. package/es/components/message-box/method.js +47 -48
  35. package/es/components/modal/modal-footer-action.vue2.js +24 -25
  36. package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
  37. package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
  38. package/es/components/popconfirm/popconfirm.vue2.js +39 -40
  39. package/es/components/search/search.vue2.js +50 -51
  40. package/es/components/select/useSelect.js +231 -232
  41. package/es/components/super-form/super-form-item.vue2.js +66 -66
  42. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
  43. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
  44. package/es/components/transfer/transfer-panel.vue2.js +56 -57
  45. package/es/components/transfer/transfer.vue2.js +69 -70
  46. package/es/components/tree/tree.vue2.js +59 -60
  47. package/es/components/upload/upload-content.vue2.js +49 -50
  48. package/es/components/upload/upload-list.vue2.js +45 -46
  49. package/es/components/upload/upload.vue2.js +99 -100
  50. package/es/hooks/use-z-index/index.js +3 -3
  51. package/es/index.d.ts +0 -1
  52. package/es/index.js +1 -5
  53. package/es/package.json.d.ts +1 -1
  54. package/es/package.json.js +1 -1
  55. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  56. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  57. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  58. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  59. package/lib/components/config-provider/config-provider.vue.d.ts +0 -2
  60. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  61. package/lib/components/config-provider/constants.cjs +1 -1
  62. package/lib/components/config-provider/constants.d.ts +0 -1
  63. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  64. package/lib/components/config-provider/index.cjs +1 -1
  65. package/lib/components/config-provider/index.d.ts +0 -9
  66. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  67. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  68. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  69. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  70. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  71. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  72. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  73. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  74. package/lib/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
  75. package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
  76. package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
  77. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  78. package/lib/components/dropdown/index.d.ts +33 -33
  79. package/lib/components/empty/empty.vue2.cjs +1 -1
  80. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  81. package/lib/components/image/image.vue2.cjs +1 -1
  82. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  83. package/lib/components/index.cjs +1 -1
  84. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  85. package/lib/components/md-container/toc.cjs +1 -1
  86. package/lib/components/message-box/message-box.vue2.cjs +1 -1
  87. package/lib/components/message-box/method.cjs +1 -1
  88. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  89. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  90. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  91. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  92. package/lib/components/search/search.vue2.cjs +1 -1
  93. package/lib/components/select/useSelect.cjs +1 -1
  94. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  95. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  96. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  97. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  98. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  99. package/lib/components/tree/tree.vue2.cjs +1 -1
  100. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  101. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  102. package/lib/components/upload/upload.vue2.cjs +1 -1
  103. package/lib/index.cjs +1 -1
  104. package/lib/index.d.ts +0 -1
  105. package/lib/package.json.cjs +1 -1
  106. package/lib/package.json.d.ts +1 -1
  107. package/package.json +3 -3
  108. package/theme-style/index.css +1 -1
  109. package/theme-style/src/image-viewer.scss +12 -0
  110. package/theme-style/src/message-box.scss +2 -2
  111. package/theme-style/src/table.scss +6 -0
  112. package/theme-style/vft-image-viewer.css +1 -1
  113. package/theme-style/vft-message-box.css +1 -1
  114. package/theme-style/vft-table.css +1 -1
  115. package/web-types.json +1 -1
  116. package/es/locale/index.d.js +0 -1
  117. package/es/locale/index.d.ts +0 -26
  118. package/es/locale/index.js +0 -10
  119. package/es/locale/lang/en.d.ts +0 -183
  120. package/es/locale/lang/en.js +0 -241
  121. package/es/locale/lang/zh-cn.d.ts +0 -183
  122. package/es/locale/lang/zh-cn.js +0 -241
  123. package/es/locale/lang/zh-tw.d.ts +0 -183
  124. package/es/locale/lang/zh-tw.js +0 -241
  125. package/es/locale/use-locale.d.ts +0 -17
  126. package/es/locale/use-locale.js +0 -56
  127. package/lib/locale/index.cjs +0 -1
  128. package/lib/locale/index.d.cjs +0 -1
  129. package/lib/locale/index.d.ts +0 -26
  130. package/lib/locale/lang/en.cjs +0 -1
  131. package/lib/locale/lang/en.d.ts +0 -183
  132. package/lib/locale/lang/zh-cn.cjs +0 -1
  133. package/lib/locale/lang/zh-cn.d.ts +0 -183
  134. package/lib/locale/lang/zh-tw.cjs +0 -1
  135. package/lib/locale/lang/zh-tw.d.ts +0 -183
  136. package/lib/locale/use-locale.cjs +0 -1
  137. package/lib/locale/use-locale.d.ts +0 -17
@@ -1,41 +1,40 @@
1
1
  import { jumpElement as h } from "@vft/utils";
2
- import v from "../../locale/use-locale.js";
3
- import { defineComponent as g, ref as C, getCurrentInstance as T, computed as $, onMounted as I, watch as b, h as n } from "vue";
4
- import { isActiveLink as k } from "./utils.js";
5
- const y = ({ title: e, level: o, slug: t }) => n(
2
+ import { defineComponent as v, ref as f, getCurrentInstance as g, computed as T, onMounted as C, watch as $, h as o } from "vue";
3
+ import { isActiveLink as I } from "./utils.js";
4
+ const k = ({ title: t, level: e, slug: l }) => o(
6
5
  "a",
7
6
  {
8
- href: `#${t}`,
9
- class: ["toc-link", `level${o}`]
7
+ href: `#${l}`,
8
+ class: ["toc-link", `level${e}`]
10
9
  },
11
- e
12
- ), u = (e, o, t) => e.length && o > 0 ? n(
10
+ t
11
+ ), a = (t, e, l) => t.length && e > 0 ? o(
13
12
  "ul",
14
13
  { class: "toc-list" },
15
- e.map((l) => [
16
- n(
14
+ t.map((c) => [
15
+ o(
17
16
  "li",
18
17
  {
19
18
  class: [
20
19
  "toc-item",
21
20
  {
22
- active: k(
23
- t,
24
- `#${decodeURIComponent(l.slug)}`
21
+ active: I(
22
+ l,
23
+ `#${decodeURIComponent(c.slug)}`
25
24
  )
26
25
  }
27
26
  ],
28
- onClick: (s) => H(s, l.slug)
27
+ onClick: (r) => y(r, c.slug)
29
28
  },
30
- y(l)
29
+ k(c)
31
30
  ),
32
- u(l.children, o - 1, t)
31
+ a(c.children, e - 1, l)
33
32
  ])
34
33
  ) : null;
35
- function H(e, o) {
36
- e.preventDefault(), h(`[id="${o}"]`);
34
+ function y(t, e) {
35
+ t.preventDefault(), h(`[id="${e}"]`);
37
36
  }
38
- const w = g({
37
+ const A = v({
39
38
  props: {
40
39
  /**
41
40
  * TOC items config
@@ -56,37 +55,37 @@ const w = g({
56
55
  default: 2
57
56
  }
58
57
  },
59
- setup(e) {
60
- const { t: o } = v(), t = C(), s = T().appContext.config.globalProperties.$router, a = $(() => s.currentRoute.value), m = (c) => {
61
- t.value?.scrollTo({ top: c, behavior: "smooth" });
58
+ setup(t) {
59
+ const e = f(), c = g().appContext.config.globalProperties.$router, r = T(() => c.currentRoute.value), u = (n) => {
60
+ e.value?.scrollTo({ top: n, behavior: "smooth" });
62
61
  };
63
- return I(() => {
64
- b(
65
- () => a.value.hash,
66
- (c) => {
67
- if (t.value) {
62
+ return C(() => {
63
+ $(
64
+ () => r.value.hash,
65
+ (n) => {
66
+ if (e.value) {
68
67
  const p = document.querySelector(
69
- `#toc a.toc-link[href$="${c}"]`
68
+ `#toc a.toc-link[href$="${n}"]`
70
69
  );
71
70
  if (!p) return;
72
- const { top: r, height: d } = t.value.getBoundingClientRect(), { top: i, height: f } = p.getBoundingClientRect();
73
- i < r ? m(t.value.scrollTop + i - r) : i + f > r + d && m(
74
- t.value.scrollTop + i + f - r - d
71
+ const { top: i, height: d } = e.value.getBoundingClientRect(), { top: s, height: m } = p.getBoundingClientRect();
72
+ s < i ? u(e.value.scrollTop + s - i) : s + m > i + d && u(
73
+ e.value.scrollTop + s + m - i - d
75
74
  );
76
75
  }
77
76
  }
78
77
  );
79
78
  }), () => {
80
- const c = e.items.length ? u(e.items, e.headerDepth, a.value) || [] : u([], e.headerDepth, a.value) || null;
81
- return c ? n("div", { class: "toc-place-holder" }, [
82
- n("aside", { id: "toc" }, [
83
- n("div", { class: "toc-header" }, [o("vft.mdContainer.tableOfContents")]),
84
- n("div", { class: "toc-wrapper", ref: t }, [c])
79
+ const n = t.items.length ? a(t.items, t.headerDepth, r.value) || [] : a([], t.headerDepth, r.value) || null;
80
+ return n ? o("div", { class: "toc-place-holder" }, [
81
+ o("aside", { id: "toc" }, [
82
+ o("div", { class: "toc-header" }, ["此页内容"]),
83
+ o("div", { class: "toc-wrapper", ref: e }, [n])
85
84
  ])
86
85
  ]) : null;
87
86
  };
88
87
  }
89
88
  });
90
89
  export {
91
- w as default
90
+ A as default
92
91
  };
@@ -106,12 +106,12 @@ const xe = ["aria-label", "aria-describedby"], we = ["id"], he = J({
106
106
  ), F(
107
107
  () => d.value,
108
108
  (n) => {
109
- n && (l.boxType !== "prompt" && (e.autofocus ? C.value = P.value?.$el ?? f.value : C.value = f.value), e.zIndex = $()), l.boxType === "prompt" && (n ? T().then(() => {
109
+ console.log(333), n && (l.boxType !== "prompt" && (e.autofocus ? C.value = P.value?.$el ?? f.value : C.value = f.value), e.zIndex = $()), l.boxType === "prompt" && (n ? T().then(() => {
110
110
  B.value && B.value.$el && (e.autofocus ? C.value = le() ?? f.value : C.value = f.value);
111
111
  }) : (e.editorErrorMessage = "", e.validateError = !1));
112
112
  }
113
113
  ), ie(async () => {
114
- await T(), l.closeOnHashChange && window.addEventListener("hashchange", b);
114
+ await T(), console.log(444), l.closeOnHashChange && window.addEventListener("hashchange", b);
115
115
  }), re(() => {
116
116
  l.closeOnHashChange && window.removeEventListener("hashchange", b);
117
117
  });
@@ -164,7 +164,7 @@ const xe = ["aria-label", "aria-describedby"], we = ["id"], he = J({
164
164
  handleClose: U,
165
165
  handleAction: r
166
166
  }), (n, o) => (u(), y(ue, {
167
- name: "fade-in-linear",
167
+ name: "vft-fade-in-linear",
168
168
  onAfterLeave: o[11] || (o[11] = (s) => n.$emit("vanish"))
169
169
  }, {
170
170
  default: x(() => [
@@ -1,101 +1,100 @@
1
- import { isString as g, hasOwn as u, isFunction as d, isElement as f, isObject as p, isUndefined as C } from "@vft/utils";
2
- import { isClient as b } from "@vueuse/core";
3
- import { debugWarn as A } from "../../utils/error.js";
1
+ import { isString as g, hasOwn as m, isFunction as u, isElement as f, isObject as E, isUndefined as x } from "@vft/utils";
2
+ import { isClient as C } from "@vueuse/core";
3
+ import { debugWarn as b } from "../../utils/error.js";
4
4
  import "../config-provider/hooks/use-global-config.js";
5
- import { isVNode as h, render as E, createVNode as O } from "vue";
5
+ import { isVNode as p, render as h, createVNode as A } from "vue";
6
6
  import "lodash-es";
7
7
  import "../form/index.js";
8
- import T from "./message-box.vue2.js";
9
- const a = /* @__PURE__ */ new Map(), _ = (e) => {
8
+ import O from "./message-box.vue2.js";
9
+ const a = /* @__PURE__ */ new Map(), T = (e) => {
10
10
  let n = document.body;
11
- return e.appendTo && (g(e.appendTo) && (n = document.querySelector(e.appendTo)), f(e.appendTo) && (n = e.appendTo), f(n) || (A(
11
+ return e.appendTo && (g(e.appendTo) && (n = document.querySelector(e.appendTo)), f(e.appendTo) && (n = e.appendTo), f(n) || (b(
12
12
  "VftMessageBox",
13
13
  "the appendTo option is not an HTMLElement. Falling back to document.body."
14
14
  ), n = document.body)), n;
15
- }, i = (e, n) => {
16
- const c = e.component?.proxy;
17
- return () => c.handleAction(n);
18
- }, v = (e, n, c = null) => {
19
- const l = O(
20
- T,
15
+ }, d = (e, n) => () => {
16
+ e.component?.exposed?.handleAction(n);
17
+ }, _ = (e, n, s = null) => {
18
+ const c = A(
19
+ O,
21
20
  e,
22
- d(e.message) || h(e.message) ? {
23
- default: d(e.message) ? () => e.message({
24
- confirm: i(l, "confirm"),
25
- cancel: i(l, "cancel"),
26
- close: i(l, "close")
21
+ u(e.message) || p(e.message) ? {
22
+ default: u(e.message) ? () => e.message({
23
+ confirm: d(c, "confirm"),
24
+ cancel: d(c, "cancel"),
25
+ close: d(c, "close")
27
26
  }) : () => e.message
28
27
  } : null
29
28
  );
30
- return l.appContext = c, E(l, n), _(e).appendChild(n.firstElementChild), l.component;
29
+ return c.appContext = s, h(c, n), T(e).appendChild(n.firstElementChild), c.component;
31
30
  }, M = () => document.createElement("div"), w = (e, n) => {
32
- const c = M();
31
+ const s = M();
33
32
  e.onVanish = () => {
34
- E(null, c), a.delete(s);
33
+ h(null, s), a.delete(l);
35
34
  }, e.onAction = (t) => {
36
- const m = a.get(s);
37
- let o;
38
- e.showInput ? o = { value: s.state.inputValue, action: t } : o = t, e.callback ? e.callback(o, l.proxy) : t === "cancel" || t === "close" ? e.distinguishCancelAndClose && t !== "cancel" ? m.reject("close") : m.reject("cancel") : m.resolve(o);
35
+ const i = a.get(l);
36
+ let r;
37
+ e.showInput ? r = { value: l.state.inputValue, action: t } : r = t, e.callback ? e.callback(r, c.proxy) : t === "cancel" || t === "close" ? e.distinguishCancelAndClose && t !== "cancel" ? i.reject("close") : i.reject("cancel") : i.resolve(r);
39
38
  };
40
- const l = v(e, c, n), s = l.proxy;
39
+ const c = _(e, s, n), l = c.exposed;
41
40
  for (const t in e)
42
- u(e, t) && !u(s.$props, t) && (s.state[t] = e[t]);
43
- return s.visible = !0, s;
41
+ m(e, t) && !m(c.props, t) && (l.state[t] = e[t]);
42
+ return l.visible.value = !0, l;
44
43
  };
45
- function r(e, n = null) {
46
- if (!b) return Promise.reject();
47
- let c;
48
- return g(e) || h(e) ? e = {
44
+ function o(e, n = null) {
45
+ if (!C) return Promise.reject();
46
+ let s;
47
+ return g(e) || p(e) ? e = {
49
48
  message: e
50
- } : c = e.callback, new Promise((l, s) => {
49
+ } : s = e.callback, new Promise((c, l) => {
51
50
  const t = w(
52
51
  e,
53
- n ?? r._context
52
+ n ?? o._context
54
53
  );
55
54
  a.set(t, {
56
55
  options: e,
57
- callback: c,
58
- resolve: l,
59
- reject: s
56
+ callback: s,
57
+ resolve: c,
58
+ reject: l
60
59
  });
61
60
  });
62
61
  }
63
- const x = ["alert", "confirm", "prompt"], S = {
62
+ const S = ["alert", "confirm", "prompt"], v = {
64
63
  alert: { closeOnPressEscape: !1, closeOnClickModal: !1 },
65
64
  confirm: { showCancelButton: !0 },
66
65
  prompt: { showCancelButton: !0, showInput: !0 }
67
66
  };
68
- x.forEach((e) => {
69
- r[e] = y(
67
+ S.forEach((e) => {
68
+ o[e] = B(
70
69
  e
71
70
  );
72
71
  });
73
- function y(e) {
74
- return (n, c, l, s) => {
72
+ function B(e) {
73
+ return (n, s, c, l) => {
75
74
  let t = "";
76
- return p(c) ? (l = c, t = "") : C(c) ? t = "" : t = c, r(
75
+ return E(s) ? (c = s, t = "") : x(s) ? t = "" : t = s, o(
77
76
  Object.assign(
78
77
  {
79
78
  title: t,
80
79
  message: n,
81
80
  type: "",
82
- ...S[e]
81
+ ...v[e]
83
82
  },
84
- l,
83
+ c,
85
84
  {
86
85
  boxType: e
87
86
  }
88
87
  ),
89
- s
88
+ l
90
89
  );
91
90
  };
92
91
  }
93
- r.close = () => {
92
+ o.close = () => {
94
93
  a.forEach((e, n) => {
95
94
  n.doClose();
96
95
  }), a.clear();
97
96
  };
98
- r._context = null;
97
+ o._context = null;
99
98
  export {
100
- r as default
99
+ o as default
101
100
  };
@@ -1,6 +1,6 @@
1
- import { defineComponent as w, computed as e, openBlock as n, createBlock as s, unref as o, normalizeProps as v, guardReactiveProps as y, withCtx as a, mergeProps as l, createTextVNode as p, toDisplayString as f, createCommentVNode as B, renderSlot as b } from "vue";
1
+ import { defineComponent as O, computed as e, openBlock as n, createBlock as s, unref as o, normalizeProps as w, guardReactiveProps as y, withCtx as i, mergeProps as c, createTextVNode as l, toDisplayString as p, createCommentVNode as f, renderSlot as B } from "vue";
2
2
  import { VftRow as g } from "../row/index.js";
3
- import { VftButton as d } from "../button/index.js";
3
+ import { VftButton as b } from "../button/index.js";
4
4
  import "@vueuse/core";
5
5
  import "@vft/utils";
6
6
  import "../config-provider/hooks/use-global-config.js";
@@ -10,8 +10,7 @@ import { useNamespace as h } from "../../hooks/use-namespace/index.js";
10
10
  import "../../hooks/use-model-toggle/index.js";
11
11
  import "@popperjs/core";
12
12
  import "../../hooks/use-z-index/index.js";
13
- import x from "../../locale/use-locale.js";
14
- const q = /* @__PURE__ */ w({
13
+ const A = /* @__PURE__ */ O({
15
14
  __name: "modal-footer-action",
16
15
  props: {
17
16
  showSubmitButton: { type: Boolean },
@@ -21,41 +20,41 @@ const q = /* @__PURE__ */ w({
21
20
  actionRowOptions: {}
22
21
  },
23
22
  setup(t) {
24
- const i = h("form-action"), { t: r } = x(), O = e(() => ({
23
+ const a = h("form-action"), d = e(() => ({
25
24
  justify: "end",
26
25
  ...t.actionRowOptions
27
- })), m = e(
28
- () => Object.assign({ btnText: r("vft.modal.confirm") }, t.submitButtonOptions)
29
- ), c = e(
30
- () => Object.assign({ btnText: r("vft.modal.cancel") }, t.cancelButtonOptions)
26
+ })), r = e(
27
+ () => Object.assign({ btnText: "确认" }, t.submitButtonOptions)
28
+ ), u = e(
29
+ () => Object.assign({ btnText: "取消" }, t.cancelButtonOptions)
31
30
  );
32
- return (u, C) => (n(), s(o(g), v(y(O.value)), {
33
- default: a(() => [
34
- t.showCancelButton ? (n(), s(o(d), l({ key: 0 }, c.value, {
35
- class: o(i).e("cancel")
31
+ return (m, v) => (n(), s(o(g), w(y(d.value)), {
32
+ default: i(() => [
33
+ t.showCancelButton ? (n(), s(o(b), c({ key: 0 }, u.value, {
34
+ class: o(a).e("cancel")
36
35
  }), {
37
- default: a(() => [
38
- p(f(c.value.btnText), 1)
36
+ default: i(() => [
37
+ l(p(u.value.btnText), 1)
39
38
  ]),
40
39
  _: 1
41
- }, 16, ["class"])) : B("", !0),
42
- b(u.$slots, "submitBefore"),
43
- t.showSubmitButton ? (n(), s(o(d), l({
40
+ }, 16, ["class"])) : f("", !0),
41
+ B(m.$slots, "submitBefore"),
42
+ t.showSubmitButton ? (n(), s(o(b), c({
44
43
  key: 1,
45
44
  type: "primary",
46
- class: o(i).e("submit")
47
- }, m.value), {
48
- default: a(() => [
49
- p(f(m.value.btnText), 1)
45
+ class: o(a).e("submit")
46
+ }, r.value), {
47
+ default: i(() => [
48
+ l(p(r.value.btnText), 1)
50
49
  ]),
51
50
  _: 1
52
- }, 16, ["class"])) : B("", !0),
53
- b(u.$slots, "submitAfter")
51
+ }, 16, ["class"])) : f("", !0),
52
+ B(m.$slots, "submitAfter")
54
53
  ]),
55
54
  _: 3
56
55
  }, 16));
57
56
  }
58
57
  });
59
58
  export {
60
- q as default
59
+ A as default
61
60
  };
@@ -7,11 +7,11 @@ import { addUnit as o } from "../../utils/helper.js";
7
7
  import { generateCssVars as M } from "../../utils/ns-cover.js";
8
8
  import "lodash-es";
9
9
  import "../form/index.js";
10
- import { useNamespace as ie } from "../../hooks/use-namespace/index.js";
10
+ 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 le, getRouterKeyPath as b, listenerRouteChange as re } from "@vft/router";
14
+ import { useRouterHelper as ie, getRouterKeyPath as b, 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";
@@ -19,10 +19,9 @@ import { onBeforeRouteLeave as me } from "vue-router";
19
19
  import de from "./tab-content.vue2.js";
20
20
  import { initAffixTabs as ve, useTabsDrag as he } from "./use/use-multiple-tabs.js";
21
21
  import "../context-menu/context-menu.vue2.js";
22
- import "../../locale/use-locale.js";
23
22
  const be = B({
24
23
  name: "vft-multiple-tabs"
25
- }), De = /* @__PURE__ */ B({
24
+ }), ze = /* @__PURE__ */ B({
26
25
  ...be,
27
26
  props: {
28
27
  tabsStyle: {},
@@ -33,15 +32,15 @@ const be = B({
33
32
  fixExtraScrollWidth: {}
34
33
  },
35
34
  setup(u) {
36
- const R = ie("multiple-tabs"), s = q().appContext.config.globalProperties.$router, I = ve(s), i = se(), f = d(
37
- () => i.getTabList.filter((e) => !e.meta?.hideTab && $(e)).length
35
+ const R = le("multiple-tabs"), s = q().appContext.config.globalProperties.$router, I = ve(s), l = se(), f = d(
36
+ () => l.getTabList.filter((e) => !e.meta?.hideTab && $(e)).length
38
37
  ), L = d(
39
38
  () => Math.max(u.fixTabCount, f.value)
40
- ), r = v(""), l = v(0), p = v(), { go: C } = le(s), m = d(() => i.getTabList.filter((e) => !e.meta?.hideTab));
39
+ ), r = v(""), i = v(0), p = v(), { go: C } = ie(s), m = d(() => l.getTabList.filter((e) => !e.meta?.hideTab));
41
40
  G(() => {
42
41
  if (r.value) {
43
42
  const e = m.value.findIndex((n) => b(n) === r.value);
44
- e === -1 ? l.value = m.value?.length - 1 : l.value = e, l.value = l.value < f.value ? f.value - 1 : l.value;
43
+ e === -1 ? i.value = m.value?.length - 1 : i.value = e, i.value = i.value < f.value ? f.value - 1 : i.value;
45
44
  }
46
45
  }), oe && me(() => {
47
46
  p.value = t(s.currentRoute);
@@ -51,13 +50,13 @@ const be = B({
51
50
  const { meta: n = {} } = e, { currentActivePath: a, hideTab: c } = n, W = c ? a : null, S = b(e);
52
51
  if (r.value !== S && (r.value = S), W) {
53
52
  const k = s.getRoutes().find((j) => j.path === a);
54
- k && i.addTab(
53
+ k && l.addTab(
55
54
  k,
56
55
  t(p),
57
- l.value,
56
+ i.value,
58
57
  e
59
58
  );
60
- } else c || i.addTab(t(e), t(p), l.value);
59
+ } else c || l.addTab(t(e), t(p), i.value);
61
60
  });
62
61
  function N(e) {
63
62
  if (r.value === e.paneName)
@@ -68,7 +67,7 @@ const be = B({
68
67
  C(a || n.fullPath || n.path);
69
68
  }
70
69
  function _(e) {
71
- i.closeTabByKey(e, s);
70
+ l.closeTabByKey(e, s);
72
71
  }
73
72
  const { refs: E, setRefs: F } = ce();
74
73
  function A(e) {
@@ -101,11 +100,11 @@ const be = B({
101
100
  ),
102
101
  ...u.contextMenuStyle
103
102
  }, K = () => {
104
- i.toggleFullScreen(i.getTabList[l.value], s);
103
+ l.toggleFullScreen(l.getTabList[i.value], s);
105
104
  }, x = v(!1);
106
105
  let y;
107
106
  const U = () => {
108
- clearInterval(y), x.value = !0, i.refreshPage(0, s, i.getTabList[l.value]), y = setTimeout(() => {
107
+ clearInterval(y), x.value = !0, l.refreshPage(0, s, l.getTabList[i.value]), y = setTimeout(() => {
109
108
  x.value = !1;
110
109
  }, 500);
111
110
  };
@@ -162,7 +161,7 @@ const be = B({
162
161
  }, null, 8, ["rotate"]),
163
162
  h(t(w), {
164
163
  onClick: K,
165
- icon: t(i).isFullScreen ? "icon-collapse" : "icon-expand",
164
+ icon: t(l).isFullScreen ? "icon-collapse" : "icon-expand",
166
165
  pointer: ""
167
166
  }, null, 8, ["icon"])
168
167
  ], 2)
@@ -175,5 +174,5 @@ const be = B({
175
174
  }
176
175
  });
177
176
  export {
178
- De as default
177
+ ze as default
179
178
  };
@@ -1,114 +1,113 @@
1
- import { getRouterKeyPath as u } from "@vft/router";
2
- import { useMultipleTabStore as S, useTabs as O, isTabPinned as A } from "@vft/store";
1
+ import { getRouterKeyPath as a } from "@vft/router";
2
+ import { useMultipleTabStore as S, useTabs as O, isTabPinned as U } from "@vft/store";
3
3
  import "@vft/utils";
4
- import { reactive as U, computed as q } from "vue";
4
+ import { reactive as q, computed as y } from "vue";
5
5
  import "../../context-menu/context-menu.vue2.js";
6
6
  import "../../icon/index.js";
7
- import y from "../../../locale/use-locale.js";
8
7
  import "vue-router";
9
- function H(e, i) {
10
- const { t: n } = y(), s = U({
8
+ function F(e, o) {
9
+ const s = q({
11
10
  current: null,
12
11
  currentIndex: 0
13
- }), t = S(), {
14
- refreshPage: p,
15
- closeAll: g,
16
- close: f,
17
- closeLeft: h,
18
- closeOther: b,
19
- closeRight: T,
20
- newWinTab: v,
21
- fullScreen: x,
22
- alonePage: L,
23
- pinTab: C,
24
- unpinTab: m
25
- } = O(), D = q(() => {
12
+ }), n = S(), {
13
+ refreshPage: g,
14
+ closeAll: u,
15
+ close: h,
16
+ closeLeft: p,
17
+ closeOther: f,
18
+ closeRight: x,
19
+ newWinTab: b,
20
+ fullScreen: T,
21
+ alonePage: C,
22
+ pinTab: L,
23
+ unpinTab: v
24
+ } = O(), D = y(() => {
26
25
  if (!e)
27
26
  return;
28
- const { meta: l } = e, o = s.currentIndex, r = A(e), c = !r, a = !!l?.userPinned, P = o === 0 || o <= i, M = t.getTabList.length <= i || o === t.getTabList.length - 1 && t.getLastDragEndIndex >= 0, R = t.getTabList.length === i || t.getTabList.length === i + 1 && o === i, d = t.getTabList.length === i;
27
+ const { meta: i } = e, t = s.currentIndex, r = U(e), c = !r, l = !!i?.userPinned, w = t === 0 || t <= o, M = n.getTabList.length <= o || t === n.getTabList.length - 1 && n.getLastDragEndIndex >= 0, R = n.getTabList.length === o || n.getTabList.length === o + 1 && t === o, d = n.getTabList.length === o;
29
28
  return [
30
29
  {
31
30
  iconCfg: { icon: "icon-refresh-right" },
32
- text: n("vft.multipleTabs.refresh"),
33
- handler: () => p(e)
31
+ text: "刷新",
32
+ handler: () => g(e)
34
33
  },
35
34
  {
36
35
  iconCfg: { icon: "icon-new-tab" },
37
- text: n("vft.multipleTabs.openInNewTab"),
38
- handler: () => v(e),
36
+ text: "新页面打开",
37
+ handler: () => b(e),
39
38
  divider: !0
40
39
  },
41
40
  {
42
41
  iconCfg: { icon: "icon-close-tab" },
43
- text: n("vft.multipleTabs.closeTab"),
42
+ text: "关闭标签页",
44
43
  disabled: r || d,
45
- handler: () => f(e)
44
+ handler: () => h(e)
46
45
  },
47
46
  {
48
47
  iconCfg: { icon: "icon-arrow-close-left" },
49
- text: n("vft.multipleTabs.closeLeft"),
50
- disabled: P,
51
- handler: () => h(e)
48
+ text: "关闭左侧标签页",
49
+ disabled: w,
50
+ handler: () => p(e)
52
51
  },
53
52
  {
54
53
  iconCfg: { icon: "icon-arrow-close-right" },
55
- text: n("vft.multipleTabs.closeRight"),
54
+ text: "关闭右侧标签页",
56
55
  disabled: M,
57
56
  divider: !0,
58
- handler: () => T(e)
57
+ handler: () => x(e)
59
58
  },
60
59
  {
61
60
  iconCfg: { icon: "icon-close-box-multiple-outline" },
62
- text: n("vft.multipleTabs.closeOther"),
61
+ text: "关闭其它标签页",
63
62
  disabled: R,
64
- handler: () => b(e)
63
+ handler: () => f(e)
65
64
  },
66
65
  {
67
66
  iconCfg: { icon: "icon-vector-square-delete" },
68
- text: n("vft.multipleTabs.closeAll"),
67
+ text: "关闭所有标签页",
69
68
  disabled: d,
70
69
  divider: !0,
71
- handler: () => g()
70
+ handler: () => u()
72
71
  },
73
72
  {
74
73
  iconCfg: { icon: "icon-full-screen" },
75
- text: n("vft.multipleTabs.fullScreen"),
76
- handler: () => x(e)
74
+ text: "全屏",
75
+ handler: () => T(e)
77
76
  },
78
77
  {
79
78
  iconCfg: { icon: "icon-separate" },
80
- text: n("vft.multipleTabs.standalone"),
81
- handler: () => L(e),
82
- divider: c || a
79
+ text: "独立页面",
80
+ handler: () => C(e),
81
+ divider: c || l
83
82
  },
84
83
  ...c ? [
85
84
  {
86
85
  iconCfg: { icon: "icon-tab-pin" },
87
- text: n("vft.multipleTabs.pin"),
88
- handler: () => C(e)
86
+ text: "固定",
87
+ handler: () => L(e)
89
88
  }
90
- ] : a ? [
89
+ ] : l ? [
91
90
  {
92
91
  iconCfg: { icon: "icon-tab-unpin" },
93
- text: n("vft.multipleTabs.unpin"),
94
- handler: () => m(e)
92
+ text: "取消固定",
93
+ handler: () => v(e)
95
94
  }
96
95
  ] : []
97
96
  ];
98
97
  });
99
- function w(l) {
100
- return (o) => {
101
- if (!l)
98
+ function P(i) {
99
+ return (t) => {
100
+ if (!i)
102
101
  return;
103
- o?.preventDefault();
104
- const r = t.getTabList.findIndex(
105
- (c) => u(c) === u(l)
102
+ t?.preventDefault();
103
+ const r = n.getTabList.findIndex(
104
+ (c) => a(c) === a(i)
106
105
  );
107
- s.current = l, s.currentIndex = r;
106
+ s.current = i, s.currentIndex = r;
108
107
  };
109
108
  }
110
- return { getDropMenuList: D, handleContextMenu: w };
109
+ return { getDropMenuList: D, handleContextMenu: P };
111
110
  }
112
111
  export {
113
- H as useTabDropdown
112
+ F as useTabDropdown
114
113
  };