vft 0.0.506 → 0.0.509

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 (161) hide show
  1. package/dist/index.css +1 -1
  2. package/es/components/cascader/cascader.vue2.js +203 -202
  3. package/es/components/cascader-panel/menu.vue2.js +50 -49
  4. package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
  5. package/es/components/color-picker/color-picker.vue2.js +134 -133
  6. package/es/components/config-provider/config-provider.vue.d.ts +2 -0
  7. package/es/components/config-provider/config-provider.vue2.js +5 -4
  8. package/es/components/config-provider/constants.d.ts +1 -0
  9. package/es/components/config-provider/constants.js +3 -2
  10. package/es/components/config-provider/hooks/use-global-config.js +33 -30
  11. package/es/components/config-provider/index.d.ts +9 -0
  12. package/es/components/config-provider/index.js +6 -5
  13. package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  14. package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
  15. package/es/components/date-picker/composables/use-month-range-header.js +15 -14
  16. package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
  17. package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
  18. package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
  19. package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
  20. package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
  21. package/es/components/date-time-select/date-time-select.vue2.js +39 -36
  22. package/es/components/dropdown/dropdown.vue2.js +68 -67
  23. package/es/components/empty/empty.vue2.js +39 -38
  24. package/es/components/full-screen/full-screen.vue2.js +18 -17
  25. package/es/components/image/image.vue2.js +60 -59
  26. package/es/components/image-viewer/image-viewer.vue2.js +45 -44
  27. package/es/components/index.js +161 -160
  28. package/es/components/input/index.d.ts +5 -0
  29. package/es/components/input/input.vue.d.ts +2 -0
  30. package/es/components/input/input.vue2.js +42 -41
  31. package/es/components/md-container/md-container.vue2.js +75 -74
  32. package/es/components/md-container/toc.js +37 -36
  33. package/es/components/modal/modal-footer-action.vue2.js +25 -24
  34. package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
  35. package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
  36. package/es/components/pagination/components/jumper.vue2.js +29 -28
  37. package/es/components/pagination/components/sizes.vue2.js +21 -20
  38. package/es/components/pagination/components/total.vue2.js +11 -10
  39. package/es/components/popconfirm/popconfirm.vue2.js +40 -39
  40. package/es/components/search/search.vue2.js +79 -77
  41. package/es/components/select/useSelect.js +232 -231
  42. package/es/components/super-form/super-form-action.vue2.js +41 -40
  43. package/es/components/super-form/super-form-item.vue2.js +206 -203
  44. package/es/components/super-form/use/helper.d.ts +1 -1
  45. package/es/components/super-form/use/helper.js +62 -62
  46. package/es/components/table/field.js +130 -110
  47. package/es/components/table/table.vue2.js +152 -150
  48. package/es/components/table/use/use-columns.js +29 -26
  49. package/es/components/table/use/use-data-source.js +87 -86
  50. package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
  51. package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
  52. package/es/components/transfer/transfer-panel.vue2.js +57 -56
  53. package/es/components/transfer/transfer.vue2.js +70 -69
  54. package/es/components/tree/tree.vue2.js +60 -59
  55. package/es/components/upload/index.d.ts +3 -3
  56. package/es/components/upload/upload-content.vue.d.ts +2 -2
  57. package/es/components/upload/upload-content.vue2.js +78 -75
  58. package/es/components/upload/upload-list.vue2.js +46 -45
  59. package/es/components/upload/upload.vue.d.ts +2 -2
  60. package/es/components/upload/upload.vue2.js +87 -85
  61. package/es/components/upload/utils.js +29 -29
  62. package/es/constants/date.d.ts +1 -1
  63. package/es/constants/date.js +9 -1
  64. package/es/hooks/use-z-index/index.js +3 -3
  65. package/es/index.d.ts +1 -0
  66. package/es/index.js +5 -1
  67. package/es/locale/index.d.js +1 -0
  68. package/es/locale/index.d.ts +26 -0
  69. package/es/locale/index.js +10 -0
  70. package/es/locale/lang/en.d.ts +183 -0
  71. package/es/locale/lang/en.js +241 -0
  72. package/es/locale/lang/zh-cn.d.ts +183 -0
  73. package/es/locale/lang/zh-cn.js +241 -0
  74. package/es/locale/lang/zh-tw.d.ts +183 -0
  75. package/es/locale/lang/zh-tw.js +241 -0
  76. package/es/locale/use-locale.d.ts +17 -0
  77. package/es/locale/use-locale.js +56 -0
  78. package/es/package.json.d.ts +1 -1
  79. package/es/package.json.js +1 -1
  80. package/lib/components/cascader/cascader.vue2.cjs +1 -1
  81. package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
  82. package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
  83. package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
  84. package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
  85. package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
  86. package/lib/components/config-provider/constants.cjs +1 -1
  87. package/lib/components/config-provider/constants.d.ts +1 -0
  88. package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
  89. package/lib/components/config-provider/index.cjs +1 -1
  90. package/lib/components/config-provider/index.d.ts +9 -0
  91. package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
  92. package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
  93. package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
  94. package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
  95. package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
  96. package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
  97. package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
  98. package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
  99. package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
  100. package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
  101. package/lib/components/empty/empty.vue2.cjs +1 -1
  102. package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
  103. package/lib/components/image/image.vue2.cjs +1 -1
  104. package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
  105. package/lib/components/index.cjs +1 -1
  106. package/lib/components/input/index.d.ts +5 -0
  107. package/lib/components/input/input.vue.d.ts +2 -0
  108. package/lib/components/input/input.vue2.cjs +1 -1
  109. package/lib/components/md-container/md-container.vue2.cjs +1 -1
  110. package/lib/components/md-container/toc.cjs +1 -1
  111. package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
  112. package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
  113. package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
  114. package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
  115. package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
  116. package/lib/components/pagination/components/total.vue2.cjs +1 -1
  117. package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
  118. package/lib/components/search/search.vue2.cjs +1 -1
  119. package/lib/components/select/useSelect.cjs +1 -1
  120. package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
  121. package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
  122. package/lib/components/super-form/use/helper.cjs +1 -1
  123. package/lib/components/super-form/use/helper.d.ts +1 -1
  124. package/lib/components/table/field.cjs +1 -1
  125. package/lib/components/table/table.vue2.cjs +1 -1
  126. package/lib/components/table/use/use-columns.cjs +1 -1
  127. package/lib/components/table/use/use-data-source.cjs +1 -1
  128. package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
  129. package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
  130. package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
  131. package/lib/components/transfer/transfer.vue2.cjs +1 -1
  132. package/lib/components/tree/tree.vue2.cjs +1 -1
  133. package/lib/components/upload/index.d.ts +3 -3
  134. package/lib/components/upload/upload-content.vue.d.ts +2 -2
  135. package/lib/components/upload/upload-content.vue2.cjs +1 -1
  136. package/lib/components/upload/upload-list.vue2.cjs +1 -1
  137. package/lib/components/upload/upload.vue.d.ts +2 -2
  138. package/lib/components/upload/upload.vue2.cjs +1 -1
  139. package/lib/components/upload/utils.cjs +1 -1
  140. package/lib/constants/date.cjs +1 -1
  141. package/lib/constants/date.d.ts +1 -1
  142. package/lib/index.cjs +1 -1
  143. package/lib/index.d.ts +1 -0
  144. package/lib/locale/index.cjs +1 -0
  145. package/lib/locale/index.d.cjs +1 -0
  146. package/lib/locale/index.d.ts +26 -0
  147. package/lib/locale/lang/en.cjs +1 -0
  148. package/lib/locale/lang/en.d.ts +183 -0
  149. package/lib/locale/lang/zh-cn.cjs +1 -0
  150. package/lib/locale/lang/zh-cn.d.ts +183 -0
  151. package/lib/locale/lang/zh-tw.cjs +1 -0
  152. package/lib/locale/lang/zh-tw.d.ts +183 -0
  153. package/lib/locale/use-locale.cjs +1 -0
  154. package/lib/locale/use-locale.d.ts +17 -0
  155. package/lib/package.json.cjs +1 -1
  156. package/lib/package.json.d.ts +1 -1
  157. package/package.json +2 -2
  158. package/theme-style/index.css +1 -1
  159. package/theme-style/src/super-form.scss +0 -1
  160. package/theme-style/vft-super-form.css +1 -1
  161. package/web-types.json +1 -1
@@ -1,20 +1,21 @@
1
- import { defineComponent as T, useAttrs as W, ref as o, computed as d, watch as G, onMounted as J, createElementBlock as f, openBlock as s, normalizeStyle as Q, normalizeClass as y, unref as l, createCommentVNode as u, mergeProps as U, renderSlot as k, createElementVNode as A, Fragment as X, createBlock as Z, withCtx as _, nextTick as ee } from "vue";
2
- import { useAttrs as te } from "@vft/use";
3
- import { isInContainer as le, isElement as ne, isString as ae, getScrollContainer as ie } from "@vft/utils";
4
- import { VftImageViewer as re } from "../image-viewer/index.js";
5
- import { isClient as v, useThrottleFn as oe, useEventListener as V } from "@vueuse/core";
1
+ import { defineComponent as T, useAttrs as G, ref as o, computed as d, watch as J, onMounted as Q, createElementBlock as f, openBlock as s, normalizeStyle as U, normalizeClass as y, unref as l, createCommentVNode as u, mergeProps as X, renderSlot as k, createElementVNode as V, toDisplayString as Z, Fragment as _, createBlock as ee, withCtx as te, nextTick as le } from "vue";
2
+ import { useAttrs as ae } from "@vft/use";
3
+ import { isInContainer as ie, isElement as ne, isString as re, getScrollContainer as oe } from "@vft/utils";
4
+ import { VftImageViewer as se } from "../image-viewer/index.js";
5
+ import { isClient as v, useThrottleFn as ue, useEventListener as A } from "@vueuse/core";
6
6
  import "../config-provider/hooks/use-global-config.js";
7
7
  import "lodash-es";
8
8
  import "../form/index.js";
9
- import { useNamespace as se } from "../../hooks/use-namespace/index.js";
9
+ import { useNamespace as ce } 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
- const ue = ["src", "loading"], ce = { key: 0 }, de = T({
13
+ import { useLocale as de } from "../../locale/use-locale.js";
14
+ const fe = ["src", "loading"], ve = { key: 0 }, me = T({
14
15
  name: "vft-image",
15
16
  inheritAttrs: !1
16
- }), Ie = /* @__PURE__ */ T({
17
- ...de,
17
+ }), Ve = /* @__PURE__ */ T({
18
+ ...me,
18
19
  props: {
19
20
  hideOnClickModal: { type: Boolean, default: !1 },
20
21
  src: { default: "" },
@@ -31,37 +32,37 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
31
32
  },
32
33
  emits: ["load", "error", "switch", "close", "show"],
33
34
  setup(e, { expose: $, emit: b }) {
34
- const c = b, i = se("image");
35
+ const c = b, n = ce("image"), { t: M } = de();
35
36
  let C = "";
36
- const M = W(), O = te(), w = o(), r = o(!1), n = o(!0), h = o(!1), m = o(), a = o(), H = v && "loading" in HTMLImageElement.prototype;
37
- let z, p;
38
- const F = d(() => M.style), N = d(() => v && e.fit ? { objectFit: e.fit } : {}), g = d(() => Array.isArray(e.previewSrcList) && e.previewSrcList.length > 0), P = d(() => {
37
+ const O = G(), F = ae(), w = o(), r = o(!1), a = o(!0), h = o(!1), m = o(), i = o(), H = v && "loading" in HTMLImageElement.prototype;
38
+ let p, z;
39
+ const D = d(() => O.style), N = d(() => v && e.fit ? { objectFit: e.fit } : {}), g = d(() => Array.isArray(e.previewSrcList) && e.previewSrcList.length > 0), P = d(() => {
39
40
  let t = e.initialIndex;
40
41
  return e.initialIndex > e.previewSrcList.length - 1 && (t = 0), t;
41
42
  }), S = d(() => e.loading === "eager" ? !1 : !H && e.loading === "lazy" || e.lazy), L = () => {
42
- v && (n.value = !0, r.value = !1, w.value = e.src);
43
+ v && (a.value = !0, r.value = !1, w.value = e.src);
43
44
  };
44
- function D(t) {
45
- n.value = !1, r.value = !1, c("load", t);
46
- }
47
45
  function Y(t) {
48
- n.value = !1, r.value = !0, c("error", t);
46
+ a.value = !1, r.value = !1, c("load", t);
47
+ }
48
+ function j(t) {
49
+ a.value = !1, r.value = !0, c("error", t);
49
50
  }
50
51
  function I() {
51
- le(m.value, a.value) && (L(), B());
52
+ ie(m.value, i.value) && (L(), B());
52
53
  }
53
- const x = oe(I, 200);
54
+ const x = ue(I, 200);
54
55
  async function E() {
55
- v && (await ee(), ne(e.scrollContainer) ? a.value = e.scrollContainer : ae(e.scrollContainer) && e.scrollContainer !== "" ? a.value = document.querySelector(e.scrollContainer) ?? void 0 : m.value && (a.value = ie(m.value)), a.value && (z = V(
56
- a,
56
+ v && (await le(), ne(e.scrollContainer) ? i.value = e.scrollContainer : re(e.scrollContainer) && e.scrollContainer !== "" ? i.value = document.querySelector(e.scrollContainer) ?? void 0 : m.value && (i.value = oe(m.value)), i.value && (p = A(
57
+ i,
57
58
  "scroll",
58
59
  x
59
60
  ), setTimeout(() => I(), 100)));
60
61
  }
61
62
  function B() {
62
- !v || !a.value || !x || (z?.(), a.value = void 0);
63
+ !v || !i.value || !x || (p?.(), i.value = void 0);
63
64
  }
64
- function j(t) {
65
+ function q(t) {
65
66
  if (t.ctrlKey) {
66
67
  if (t.deltaY < 0)
67
68
  return t.preventDefault(), !1;
@@ -69,62 +70,62 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
69
70
  return t.preventDefault(), !1;
70
71
  }
71
72
  }
72
- function q() {
73
- g.value && (p = V("wheel", j, {
73
+ function K() {
74
+ g.value && (z = A("wheel", q, {
74
75
  passive: !1
75
76
  }), C = document.body.style.overflow, document.body.style.overflow = "hidden", h.value = !0, c("show"));
76
77
  }
77
- function K() {
78
- p?.(), document.body.style.overflow = C, h.value = !1, c("close");
78
+ function R() {
79
+ z?.(), document.body.style.overflow = C, h.value = !1, c("close");
79
80
  }
80
- function R(t) {
81
+ function W(t) {
81
82
  c("switch", t);
82
83
  }
83
- return G(
84
+ return J(
84
85
  () => e.src,
85
86
  () => {
86
- S.value ? (n.value = !0, r.value = !1, B(), E()) : L();
87
+ S.value ? (a.value = !0, r.value = !1, B(), E()) : L();
87
88
  }
88
- ), J(() => {
89
+ ), Q(() => {
89
90
  S.value ? E() : L();
90
91
  }), $({
91
- isLoading: n
92
- }), (t, fe) => (s(), f("div", {
92
+ isLoading: a
93
+ }), (t, ye) => (s(), f("div", {
93
94
  ref_key: "container",
94
95
  ref: m,
95
- class: y([l(i).b(), t.$attrs.class]),
96
- style: Q(F.value)
96
+ class: y([l(n).b(), t.$attrs.class]),
97
+ style: U(D.value)
97
98
  }, [
98
- w.value !== void 0 && !r.value ? (s(), f("img", U({ key: 0 }, l(O), {
99
+ w.value !== void 0 && !r.value ? (s(), f("img", X({ key: 0 }, l(F), {
99
100
  src: w.value,
100
101
  loading: e.loading,
101
102
  style: N.value,
102
103
  class: [
103
- l(i).e("inner"),
104
- g.value && l(i).e("preview"),
105
- n.value && l(i).is("loading")
104
+ l(n).e("inner"),
105
+ g.value && l(n).e("preview"),
106
+ a.value && l(n).is("loading")
106
107
  ],
107
- onClick: q,
108
- onLoad: D,
109
- onError: Y,
108
+ onClick: K,
109
+ onLoad: Y,
110
+ onError: j,
110
111
  alt: ""
111
- }), null, 16, ue)) : u("", !0),
112
- n.value || r.value ? (s(), f("div", {
112
+ }), null, 16, fe)) : u("", !0),
113
+ a.value || r.value ? (s(), f("div", {
113
114
  key: 1,
114
- class: y(l(i).e("wrapper"))
115
+ class: y(l(n).e("wrapper"))
115
116
  }, [
116
- n.value ? k(t.$slots, "placeholder", { key: 0 }, () => [
117
- A("div", {
118
- class: y(l(i).e("placeholder"))
117
+ a.value ? k(t.$slots, "placeholder", { key: 0 }, () => [
118
+ V("div", {
119
+ class: y(l(n).e("placeholder"))
119
120
  }, null, 2)
120
121
  ]) : r.value ? k(t.$slots, "error", { key: 1 }, () => [
121
- A("div", {
122
- class: y(l(i).e("error"))
123
- }, "加载失败", 2)
122
+ V("div", {
123
+ class: y(l(n).e("error"))
124
+ }, Z(l(M)("vft.imageViewer.loadFailed")), 3)
124
125
  ]) : u("", !0)
125
126
  ], 2)) : u("", !0),
126
- g.value ? (s(), f(X, { key: 2 }, [
127
- h.value ? (s(), Z(l(re), {
127
+ g.value ? (s(), f(_, { key: 2 }, [
128
+ h.value ? (s(), ee(l(se), {
128
129
  key: 0,
129
130
  "z-index": e.zIndex,
130
131
  "initial-index": P.value,
@@ -134,11 +135,11 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
134
135
  "hide-on-click-modal": e.hideOnClickModal,
135
136
  teleported: e.previewTeleported,
136
137
  "close-on-press-escape": e.closeOnPressEscape,
137
- onClose: K,
138
- onSwitch: R
138
+ onClose: R,
139
+ onSwitch: W
139
140
  }, {
140
- default: _(() => [
141
- t.$slots.viewer ? (s(), f("div", ce, [
141
+ default: te(() => [
142
+ t.$slots.viewer ? (s(), f("div", ve, [
142
143
  k(t.$slots, "viewer")
143
144
  ])) : u("", !0)
144
145
  ]),
@@ -149,5 +150,5 @@ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
149
150
  }
150
151
  });
151
152
  export {
152
- Ie as default
153
+ Ve as default
153
154
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as A, ref as h, effectScope as ne, computed as w, watch as R, nextTick as oe, onMounted as ae, createBlock as ie, openBlock as z, unref as e, withCtx as S, createVNode as d, Transition as se, createElementVNode as c, normalizeStyle as V, normalizeClass as r, createElementBlock as E, createCommentVNode as re, renderSlot as le, withModifiers as ce, Fragment as H, renderList as ue, withDirectives as fe, vShow as de } from "vue";
1
+ import { defineComponent as A, ref as h, effectScope as oe, computed as w, watch as D, nextTick as ae, onMounted as ie, createBlock as se, openBlock as z, unref as e, withCtx as R, createVNode as d, Transition as re, createElementVNode as c, normalizeStyle as S, normalizeClass as r, createElementBlock as E, createCommentVNode as le, renderSlot as ce, withModifiers as ue, Fragment as H, renderList as fe, withDirectives as de, vShow as me } from "vue";
2
2
  import { EVENT_CODE as p } from "@vft/constants";
3
3
  import { isNumber as Z } from "@vft/utils";
4
4
  import { VftIcon as v } from "../icon/index.js";
@@ -6,15 +6,16 @@ import { useEventListener as y } from "@vueuse/core";
6
6
  import "../config-provider/hooks/use-global-config.js";
7
7
  import { throttle as T } from "lodash-es";
8
8
  import "../form/index.js";
9
- import { useNamespace as me } from "../../hooks/use-namespace/index.js";
9
+ import { useNamespace as ve } from "../../hooks/use-namespace/index.js";
10
10
  import "../../hooks/use-model-toggle/index.js";
11
11
  import "@popperjs/core";
12
- import { useZIndex as ve } from "../../hooks/use-z-index/index.js";
13
- import { VftTeleport as ge } from "../teleport/index.js";
14
- const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
12
+ import { useZIndex as ge } from "../../hooks/use-z-index/index.js";
13
+ import { useLocale as ke } from "../../locale/use-locale.js";
14
+ import { VftTeleport as be } from "../teleport/index.js";
15
+ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
15
16
  name: "vft-image-viewer"
16
- }), Ye = /* @__PURE__ */ A({
17
- ...be,
17
+ }), Ne = /* @__PURE__ */ A({
18
+ ...pe,
18
19
  props: {
19
20
  urlList: { default: () => [] },
20
21
  zIndex: {},
@@ -32,13 +33,13 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
32
33
  switch: (t) => Z(t)
33
34
  },
34
35
  setup(t, { expose: P, emit: W }) {
35
- const $ = W, i = me("image-viewer"), { nextZIndex: j } = ve(), I = h(), X = h([]), Y = ne(), k = h(!0), m = h(t.initialIndex), s = h({
36
+ const $ = W, i = ve("image-viewer"), { nextZIndex: j } = ge(), { t: q } = ke(), I = h(), X = h([]), Y = oe(), k = h(!0), m = h(t.initialIndex), s = h({
36
37
  scale: 1,
37
38
  deg: 0,
38
39
  offsetX: 0,
39
40
  offsetY: 0,
40
41
  enableTransition: !1
41
- }), q = w(() => t.urlList.length <= 1), O = w(() => m.value === 0), M = w(() => m.value === t.urlList.length - 1), G = w(() => t.urlList[m.value]), J = w(() => {
42
+ }), G = w(() => t.urlList.length <= 1), O = w(() => m.value === 0), M = w(() => m.value === t.urlList.length - 1), J = w(() => t.urlList[m.value]), K = w(() => {
42
43
  const { scale: o, deg: n, offsetX: a, offsetY: l, enableTransition: x } = s.value;
43
44
  let u = a / o, f = l / o;
44
45
  switch (n % 360) {
@@ -60,11 +61,11 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
60
61
  transition: x ? "transform .3s" : ""
61
62
  };
62
63
  return b.maxWidth = b.maxHeight = "100%", b;
63
- }), K = w(() => Z(t.zIndex) ? t.zIndex : j());
64
+ }), Q = w(() => Z(t.zIndex) ? t.zIndex : j());
64
65
  function C() {
65
- U(), $("close");
66
+ _(), $("close");
66
67
  }
67
- function Q() {
68
+ function U() {
68
69
  const o = T((a) => {
69
70
  switch (a.code) {
70
71
  // ESC
@@ -77,7 +78,7 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
77
78
  break;
78
79
  // LEFT_ARROW
79
80
  case p.left:
80
- D();
81
+ F();
81
82
  break;
82
83
  // UP_ARROW
83
84
  case p.up:
@@ -85,7 +86,7 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
85
86
  break;
86
87
  // RIGHT_ARROW
87
88
  case p.right:
88
- F();
89
+ V();
89
90
  break;
90
91
  // DOWN_ARROW
91
92
  case p.down:
@@ -103,16 +104,16 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
103
104
  y(document, "keydown", o), y(document, "wheel", n);
104
105
  });
105
106
  }
106
- function U() {
107
+ function _() {
107
108
  Y.stop();
108
109
  }
109
- function _() {
110
+ function ee() {
110
111
  k.value = !1;
111
112
  }
112
- function ee(o) {
113
- k.value = !1, o.target.alt = "加载失败";
114
- }
115
113
  function te(o) {
114
+ k.value = !1, o.target.alt = q("vft.imageViewer.loadFailed");
115
+ }
116
+ function ne(o) {
116
117
  if (k.value || o.button !== 0 || !I.value) return;
117
118
  s.value.enableTransition = !1;
118
119
  const { offsetX: n, offsetY: a } = s.value, l = o.pageX, x = o.pageY, u = T((b) => {
@@ -142,10 +143,10 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
142
143
  const n = t.urlList.length;
143
144
  m.value = (o + n) % n;
144
145
  }
145
- function D() {
146
+ function F() {
146
147
  O.value && !t.infinite || L(m.value - 1);
147
148
  }
148
- function F() {
149
+ function V() {
149
150
  M.value && !t.infinite || L(m.value + 1);
150
151
  }
151
152
  function g(o, n = {}) {
@@ -175,37 +176,37 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
175
176
  }
176
177
  s.value.enableTransition = l;
177
178
  }
178
- return R(G, () => {
179
- oe(() => {
179
+ return D(J, () => {
180
+ ae(() => {
180
181
  X.value[0]?.complete || (k.value = !0);
181
182
  });
182
- }), R(m, (o) => {
183
+ }), D(m, (o) => {
183
184
  N(), $("switch", o);
184
- }), ae(() => {
185
- Q(), I.value?.focus?.();
185
+ }), ie(() => {
186
+ U(), I.value?.focus?.();
186
187
  }), P({
187
188
  /** @description manually switch image */
188
189
  setActiveItem: L
189
- }), (o, n) => (z(), ie(e(ge), {
190
+ }), (o, n) => (z(), se(e(be), {
190
191
  to: "body",
191
192
  disabled: !t.teleported
192
193
  }, {
193
- default: S(() => [
194
- d(se, {
194
+ default: R(() => [
195
+ d(re, {
195
196
  name: "viewer-fade",
196
197
  appear: ""
197
198
  }, {
198
- default: S(() => [
199
+ default: R(() => [
199
200
  c("div", {
200
201
  ref_key: "wrapper",
201
202
  ref: I,
202
203
  tabindex: -1,
203
204
  class: r(e(i).e("wrapper")),
204
- style: V({ zIndex: K.value })
205
+ style: S({ zIndex: Q.value })
205
206
  }, [
206
207
  c("div", {
207
208
  class: r(e(i).e("mask")),
208
- onClick: n[0] || (n[0] = ce((a) => t.hideOnClickModal && C(), ["self"]))
209
+ onClick: n[0] || (n[0] = ue((a) => t.hideOnClickModal && C(), ["self"]))
209
210
  }, null, 2),
210
211
  c("span", {
211
212
  class: r([e(i).e("btn"), e(i).e("close")]),
@@ -213,14 +214,14 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
213
214
  }, [
214
215
  d(e(v), { icon: "icon-close" })
215
216
  ], 2),
216
- q.value ? re("", !0) : (z(), E(H, { key: 0 }, [
217
+ G.value ? le("", !0) : (z(), E(H, { key: 0 }, [
217
218
  c("span", {
218
219
  class: r([
219
220
  e(i).e("btn"),
220
221
  e(i).e("prev"),
221
222
  e(i).is("disabled", !t.infinite && O.value)
222
223
  ]),
223
- onClick: D
224
+ onClick: F
224
225
  }, [
225
226
  d(e(v), { icon: "icon-arrow-left" })
226
227
  ], 2),
@@ -230,7 +231,7 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
230
231
  e(i).e("next"),
231
232
  e(i).is("disabled", !t.infinite && M.value)
232
233
  ]),
233
- onClick: F
234
+ onClick: V
234
235
  }, [
235
236
  d(e(v), { icon: "icon-arrow-right" })
236
237
  ], 2)
@@ -272,23 +273,23 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
272
273
  c("div", {
273
274
  class: r(e(i).e("canvas"))
274
275
  }, [
275
- (z(!0), E(H, null, ue(t.urlList, (a, l) => fe((z(), E("img", {
276
+ (z(!0), E(H, null, fe(t.urlList, (a, l) => de((z(), E("img", {
276
277
  ref_for: !0,
277
278
  ref: (x) => X.value[l] = x,
278
279
  key: a,
279
280
  src: a,
280
- style: V(J.value),
281
+ style: S(K.value),
281
282
  class: r(e(i).e("img")),
282
283
  referrerpolicy: t.referrerpolicy,
283
284
  crossorigin: t.crossorigin,
284
- onLoad: _,
285
- onError: ee,
286
- onMousedown: te
287
- }, null, 46, ke)), [
288
- [de, l === m.value]
285
+ onLoad: ee,
286
+ onError: te,
287
+ onMousedown: ne
288
+ }, null, 46, we)), [
289
+ [me, l === m.value]
289
290
  ])), 128))
290
291
  ], 2),
291
- le(o.$slots, "default")
292
+ ce(o.$slots, "default")
292
293
  ], 6)
293
294
  ]),
294
295
  _: 3
@@ -299,5 +300,5 @@ const ke = ["src", "referrerpolicy", "crossorigin"], be = A({
299
300
  }
300
301
  });
301
302
  export {
302
- Ye as default
303
+ Ne as default
303
304
  };