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,72 +1,71 @@
1
- import { defineComponent as p, getCurrentInstance as k, computed as s, openBlock as m, createElementBlock as l, normalizeClass as c, unref as o, createElementVNode as z, renderSlot as u, createBlock as x, normalizeProps as D, mergeProps as E, createVNode as C, createCommentVNode as d } from "vue";
1
+ import { defineComponent as d, getCurrentInstance as v, computed as s, openBlock as a, createElementBlock as l, normalizeClass as c, unref as t, createElementVNode as k, renderSlot as i, createBlock as z, normalizeProps as x, mergeProps as C, createVNode as E, createCommentVNode as u } from "vue";
2
2
  import { VftIcon as V } from "../icon/index.js";
3
3
  import "@vueuse/core";
4
- import { singleAttrToObj as h, renderTNode as w, VNode as F } from "@vft/utils";
5
- import { addUnit as $ } from "../../utils/helper.js";
4
+ import { singleAttrToObj as D, renderTNode as $, VNode as b } from "@vft/utils";
5
+ import { addUnit as h } from "../../utils/helper.js";
6
6
  import "lodash-es";
7
7
  import "../form/index.js";
8
- import { useNamespace as b } from "../../hooks/use-namespace/index.js";
8
+ import { useNamespace as w } from "../../hooks/use-namespace/index.js";
9
9
  import "../../hooks/use-model-toggle/index.js";
10
10
  import "@popperjs/core";
11
11
  import "../../hooks/use-z-index/index.js";
12
- import B from "../../locale/use-locale.js";
13
12
  import { EmptyEnum as e } from "./constants.js";
14
- const I = p({
13
+ const B = d({
15
14
  name: "vft-empty"
16
- }), Q = /* @__PURE__ */ p({
17
- ...I,
15
+ }), J = /* @__PURE__ */ d({
16
+ ...B,
18
17
  props: {
19
18
  icon: {},
20
19
  type: { default: () => e.NoData },
21
20
  size: { default: "default" },
22
21
  desc: {}
23
22
  },
24
- setup(n) {
25
- const r = b("empty"), f = k(), { t } = B(), y = /* @__PURE__ */ new Map([
23
+ setup(o) {
24
+ const n = w("empty"), p = v(), f = /* @__PURE__ */ new Map([
26
25
  [
27
26
  e.NotFound,
28
27
  {
29
- text: t("vft.empty.notFound")
28
+ text: "页面不存在"
30
29
  }
31
30
  ],
32
31
  [
33
32
  e.Delete,
34
33
  {
35
- text: t("vft.empty.deleted")
34
+ text: "已删除"
36
35
  }
37
36
  ],
38
37
  [
39
38
  e.NetworkDisconnect,
40
39
  {
41
- text: t("vft.empty.networkDisconnect")
40
+ text: "网络已断开"
42
41
  }
43
42
  ],
44
43
  [
45
44
  e.NoData,
46
45
  {
47
- text: t("vft.empty.noData")
46
+ text: "暂无数据"
48
47
  }
49
48
  ],
50
49
  [
51
50
  e.PageError,
52
51
  {
53
- text: t("vft.empty.pageError")
52
+ text: "系统异常"
54
53
  }
55
54
  ],
56
55
  [
57
56
  e.NoFilter,
58
57
  {
59
- text: t("vft.empty.noFilter")
58
+ text: "此筛选条件下无结果"
60
59
  }
61
60
  ],
62
61
  [
63
62
  e.NoSearch,
64
63
  {
65
- text: t("vft.empty.noSearch")
64
+ text: "没有搜索结果"
66
65
  }
67
66
  ]
68
- ]), v = s(() => y.get(n.type)), N = s(() => {
69
- switch (n.size) {
67
+ ]), N = s(() => f.get(o.type)), g = s(() => {
68
+ switch (o.size) {
70
69
  case "large":
71
70
  return 120;
72
71
  case "default":
@@ -74,37 +73,37 @@ const I = p({
74
73
  case "small":
75
74
  return 60;
76
75
  default:
77
- return n.size || 80;
76
+ return o.size || 80;
78
77
  }
79
- }), g = s(() => h(n.icon, "icon", {
80
- size: $(N.value),
81
- icon: n.type
82
- })), i = s(
83
- () => w(f, "desc", { defaultNode: v.value?.text })
78
+ }), y = s(() => D(o.icon, "icon", {
79
+ size: h(g.value),
80
+ icon: o.type
81
+ })), m = s(
82
+ () => $(p, "desc", { defaultNode: N.value?.text })
84
83
  );
85
- return (a, P) => (m(), l("div", {
86
- class: c([o(r).b()])
84
+ return (r, I) => (a(), l("div", {
85
+ class: c([t(n).b()])
87
86
  }, [
88
- z("div", {
89
- class: c(o(r).e("image"))
87
+ k("div", {
88
+ class: c(t(n).e("image"))
90
89
  }, [
91
- a.$slots.img ? u(a.$slots, "img", { key: 0 }) : (m(), x(o(V), D(E({ key: 1 }, g.value)), null, 16))
90
+ r.$slots.img ? i(r.$slots, "img", { key: 0 }) : (a(), z(t(V), x(C({ key: 1 }, y.value)), null, 16))
92
91
  ], 2),
93
- i.value ? (m(), l("span", {
92
+ m.value ? (a(), l("span", {
94
93
  key: 0,
95
- class: c(o(r).e("desc"))
94
+ class: c(t(n).e("desc"))
96
95
  }, [
97
- C(o(F), { content: i.value }, null, 8, ["content"])
98
- ], 2)) : d("", !0),
99
- a.$slots.default ? (m(), l("div", {
96
+ E(t(b), { content: m.value }, null, 8, ["content"])
97
+ ], 2)) : u("", !0),
98
+ r.$slots.default ? (a(), l("div", {
100
99
  key: 1,
101
- class: c(o(r).e("bottom"))
100
+ class: c(t(n).e("bottom"))
102
101
  }, [
103
- u(a.$slots, "default")
104
- ], 2)) : d("", !0)
102
+ i(r.$slots, "default")
103
+ ], 2)) : u("", !0)
105
104
  ], 2));
106
105
  }
107
106
  });
108
107
  export {
109
- Q as default
108
+ J as default
110
109
  };
@@ -1,21 +1,20 @@
1
- import { defineComponent as r, openBlock as p, createBlock as m, unref as o, mergeProps as a } from "vue";
2
- import { useFullscreen as u } from "@vft/use";
3
- import { delObjAttrNotExist as f } from "@vft/utils";
4
- import { VftIconText as x } from "../icon-text/index.js";
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";
5
5
  import "@vueuse/core";
6
6
  import "../config-provider/hooks/use-global-config.js";
7
7
  import { primaryColor as d } from "../../utils/ns-cover.js";
8
8
  import "lodash-es";
9
9
  import "../form/index.js";
10
- import { useNamespace as _ } from "../../hooks/use-namespace/index.js";
10
+ import { useNamespace as x } 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 v from "../../locale/use-locale.js";
15
- const y = r({
14
+ const _ = r({
16
15
  name: "full-screen"
17
- }), A = /* @__PURE__ */ r({
18
- ...y,
16
+ }), z = /* @__PURE__ */ r({
17
+ ..._,
19
18
  props: {
20
19
  text: {},
21
20
  icon: {},
@@ -33,18 +32,18 @@ const y = r({
33
32
  clampTooltipCfg: {},
34
33
  useClamp: { type: Boolean }
35
34
  },
36
- setup(n) {
37
- const l = n, c = _("full-screen"), { t: e } = v(), { toggle: i, isFullscreen: t } = u(), s = d().value;
38
- return (B, C) => (p(), m(o(x), a({
39
- class: o(c).b(),
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(),
40
39
  distance: 2,
41
- "hover-color": o(s),
40
+ "hover-color": o(c),
42
41
  onClick: o(i),
43
- icon: o(t) ? "icon-exit-full-screen" : "icon-full-screen",
44
- text: o(t) ? o(e)("vft.fullScreen.exit") : o(e)("vft.fullScreen.enter")
45
- }, o(f)(l, !0, !0), { pointer: "" }), null, 16, ["class", "hover-color", "onClick", "icon", "text"]));
42
+ icon: o(e) ? "icon-exit-full-screen" : "icon-full-screen",
43
+ text: o(e) ? "退出全屏" : "全屏"
44
+ }, o(u)(n, !0, !0), { pointer: "" }), null, 16, ["class", "hover-color", "onClick", "icon", "text"]));
46
45
  }
47
46
  });
48
47
  export {
49
- A as default
48
+ z as default
50
49
  };
@@ -1,21 +1,20 @@
1
- import { defineComponent as T, useAttrs as G, ref as o, computed as d, watch as J, onMounted as Q, openBlock as s, createElementBlock as f, normalizeStyle as U, normalizeClass as y, unref as l, mergeProps as X, createCommentVNode as u, 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";
1
+ import { defineComponent as T, useAttrs as W, ref as o, computed as d, watch as G, onMounted as J, openBlock as s, createElementBlock as f, normalizeStyle as Q, normalizeClass as y, unref as l, mergeProps as U, createCommentVNode 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";
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 ce } from "../../hooks/use-namespace/index.js";
9
+ import { useNamespace as se } 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 de from "../../locale/use-locale.js";
14
- const fe = ["src", "loading"], ve = { key: 0 }, me = T({
13
+ const ue = ["src", "loading"], ce = { key: 0 }, de = T({
15
14
  name: "vft-image",
16
15
  inheritAttrs: !1
17
- }), Ve = /* @__PURE__ */ T({
18
- ...me,
16
+ }), Ie = /* @__PURE__ */ T({
17
+ ...de,
19
18
  props: {
20
19
  hideOnClickModal: { type: Boolean, default: !1 },
21
20
  src: { default: "" },
@@ -32,37 +31,37 @@ const fe = ["src", "loading"], ve = { key: 0 }, me = T({
32
31
  },
33
32
  emits: ["load", "error", "switch", "close", "show"],
34
33
  setup(e, { expose: $, emit: b }) {
35
- const c = b, n = ce("image"), { t: M } = de();
34
+ const c = b, i = se("image");
36
35
  let C = "";
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(() => {
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(() => {
40
39
  let t = e.initialIndex;
41
40
  return e.initialIndex > e.previewSrcList.length - 1 && (t = 0), t;
42
41
  }), S = d(() => e.loading === "eager" ? !1 : !H && e.loading === "lazy" || e.lazy), L = () => {
43
- v && (a.value = !0, r.value = !1, w.value = e.src);
42
+ v && (n.value = !0, r.value = !1, w.value = e.src);
44
43
  };
45
- function Y(t) {
46
- a.value = !1, r.value = !1, c("load", t);
44
+ function D(t) {
45
+ n.value = !1, r.value = !1, c("load", t);
47
46
  }
48
- function j(t) {
49
- a.value = !1, r.value = !0, c("error", t);
47
+ function Y(t) {
48
+ n.value = !1, r.value = !0, c("error", t);
50
49
  }
51
50
  function I() {
52
- ie(m.value, i.value) && (L(), B());
51
+ le(m.value, a.value) && (L(), B());
53
52
  }
54
- const x = ue(I, 200);
53
+ const x = oe(I, 200);
55
54
  async function E() {
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,
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,
58
57
  "scroll",
59
58
  x
60
59
  ), setTimeout(() => I(), 100)));
61
60
  }
62
61
  function B() {
63
- !v || !i.value || !x || (p?.(), i.value = void 0);
62
+ !v || !a.value || !x || (z?.(), a.value = void 0);
64
63
  }
65
- function q(t) {
64
+ function j(t) {
66
65
  if (t.ctrlKey) {
67
66
  if (t.deltaY < 0)
68
67
  return t.preventDefault(), !1;
@@ -70,62 +69,62 @@ const fe = ["src", "loading"], ve = { key: 0 }, me = T({
70
69
  return t.preventDefault(), !1;
71
70
  }
72
71
  }
73
- function K() {
74
- g.value && (z = A("wheel", q, {
72
+ function q() {
73
+ g.value && (p = V("wheel", j, {
75
74
  passive: !1
76
75
  }), C = document.body.style.overflow, document.body.style.overflow = "hidden", h.value = !0, c("show"));
77
76
  }
78
- function R() {
79
- z?.(), document.body.style.overflow = C, h.value = !1, c("close");
77
+ function K() {
78
+ p?.(), document.body.style.overflow = C, h.value = !1, c("close");
80
79
  }
81
- function W(t) {
80
+ function R(t) {
82
81
  c("switch", t);
83
82
  }
84
- return J(
83
+ return G(
85
84
  () => e.src,
86
85
  () => {
87
- S.value ? (a.value = !0, r.value = !1, B(), E()) : L();
86
+ S.value ? (n.value = !0, r.value = !1, B(), E()) : L();
88
87
  }
89
- ), Q(() => {
88
+ ), J(() => {
90
89
  S.value ? E() : L();
91
90
  }), $({
92
- isLoading: a
93
- }), (t, ye) => (s(), f("div", {
91
+ isLoading: n
92
+ }), (t, fe) => (s(), f("div", {
94
93
  ref_key: "container",
95
94
  ref: m,
96
- class: y([l(n).b(), t.$attrs.class]),
97
- style: U(D.value)
95
+ class: y([l(i).b(), t.$attrs.class]),
96
+ style: Q(F.value)
98
97
  }, [
99
- w.value !== void 0 && !r.value ? (s(), f("img", X({ key: 0 }, l(F), {
98
+ w.value !== void 0 && !r.value ? (s(), f("img", U({ key: 0 }, l(O), {
100
99
  src: w.value,
101
100
  loading: e.loading,
102
101
  style: N.value,
103
102
  class: [
104
- l(n).e("inner"),
105
- g.value && l(n).e("preview"),
106
- a.value && l(n).is("loading")
103
+ l(i).e("inner"),
104
+ g.value && l(i).e("preview"),
105
+ n.value && l(i).is("loading")
107
106
  ],
108
- onClick: K,
109
- onLoad: Y,
110
- onError: j,
107
+ onClick: q,
108
+ onLoad: D,
109
+ onError: Y,
111
110
  alt: ""
112
- }), null, 16, fe)) : u("", !0),
113
- a.value || r.value ? (s(), f("div", {
111
+ }), null, 16, ue)) : u("", !0),
112
+ n.value || r.value ? (s(), f("div", {
114
113
  key: 1,
115
- class: y(l(n).e("wrapper"))
114
+ class: y(l(i).e("wrapper"))
116
115
  }, [
117
- a.value ? k(t.$slots, "placeholder", { key: 0 }, () => [
118
- V("div", {
119
- class: y(l(n).e("placeholder"))
116
+ n.value ? k(t.$slots, "placeholder", { key: 0 }, () => [
117
+ A("div", {
118
+ class: y(l(i).e("placeholder"))
120
119
  }, null, 2)
121
120
  ]) : r.value ? k(t.$slots, "error", { key: 1 }, () => [
122
- V("div", {
123
- class: y(l(n).e("error"))
124
- }, Z(l(M)("vft.imageViewer.loadFailed")), 3)
121
+ A("div", {
122
+ class: y(l(i).e("error"))
123
+ }, "加载失败", 2)
125
124
  ]) : u("", !0)
126
125
  ], 2)) : u("", !0),
127
- g.value ? (s(), f(_, { key: 2 }, [
128
- h.value ? (s(), ee(l(se), {
126
+ g.value ? (s(), f(X, { key: 2 }, [
127
+ h.value ? (s(), Z(l(re), {
129
128
  key: 0,
130
129
  "z-index": e.zIndex,
131
130
  "initial-index": P.value,
@@ -135,11 +134,11 @@ const fe = ["src", "loading"], ve = { key: 0 }, me = T({
135
134
  "hide-on-click-modal": e.hideOnClickModal,
136
135
  teleported: e.previewTeleported,
137
136
  "close-on-press-escape": e.closeOnPressEscape,
138
- onClose: R,
139
- onSwitch: W
137
+ onClose: K,
138
+ onSwitch: R
140
139
  }, {
141
- default: te(() => [
142
- t.$slots.viewer ? (s(), f("div", ve, [
140
+ default: _(() => [
141
+ t.$slots.viewer ? (s(), f("div", ce, [
143
142
  k(t.$slots, "viewer")
144
143
  ])) : u("", !0)
145
144
  ]),
@@ -150,5 +149,5 @@ const fe = ["src", "loading"], ve = { key: 0 }, me = T({
150
149
  }
151
150
  });
152
151
  export {
153
- Ve as default
152
+ Ie as default
154
153
  };
@@ -1,4 +1,4 @@
1
- import { defineComponent as A, ref as h, effectScope as oe, computed as w, watch as D, nextTick as ae, onMounted as ie, openBlock as z, createBlock as se, unref as e, withCtx as R, createVNode as d, Transition as re, createElementVNode as c, normalizeStyle as S, normalizeClass as r, withModifiers as le, createElementBlock as E, Fragment as H, createCommentVNode as ce, renderList as ue, withDirectives as fe, vShow as de, renderSlot as me } from "vue";
1
+ import { defineComponent as A, ref as h, effectScope as ne, computed as w, watch as R, nextTick as oe, onMounted as ae, openBlock as z, createBlock as ie, unref as e, withCtx as S, createVNode as d, Transition as se, createElementVNode as c, normalizeStyle as V, normalizeClass as r, withModifiers as re, createElementBlock as E, Fragment as H, createCommentVNode as le, renderList as ce, withDirectives as ue, vShow as fe, renderSlot as de } 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,16 +6,15 @@ 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 ve } from "../../hooks/use-namespace/index.js";
9
+ import { useNamespace as me } from "../../hooks/use-namespace/index.js";
10
10
  import "../../hooks/use-model-toggle/index.js";
11
11
  import "@popperjs/core";
12
- import { useZIndex as ge } from "../../hooks/use-z-index/index.js";
13
- import ke from "../../locale/use-locale.js";
14
- import { VftTeleport as be } from "../teleport/index.js";
15
- const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
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({
16
15
  name: "vft-image-viewer"
17
- }), Ne = /* @__PURE__ */ A({
18
- ...pe,
16
+ }), Ye = /* @__PURE__ */ A({
17
+ ...be,
19
18
  props: {
20
19
  urlList: { default: () => [] },
21
20
  zIndex: {},
@@ -33,13 +32,13 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
33
32
  switch: (t) => Z(t)
34
33
  },
35
34
  setup(t, { expose: P, emit: W }) {
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({
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({
37
36
  scale: 1,
38
37
  deg: 0,
39
38
  offsetX: 0,
40
39
  offsetY: 0,
41
40
  enableTransition: !1
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(() => {
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(() => {
43
42
  const { scale: o, deg: n, offsetX: a, offsetY: l, enableTransition: x } = s.value;
44
43
  let u = a / o, f = l / o;
45
44
  switch (n % 360) {
@@ -61,11 +60,11 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
61
60
  transition: x ? "transform .3s" : ""
62
61
  };
63
62
  return b.maxWidth = b.maxHeight = "100%", b;
64
- }), Q = w(() => Z(t.zIndex) ? t.zIndex : j());
63
+ }), K = w(() => Z(t.zIndex) ? t.zIndex : j());
65
64
  function C() {
66
- _(), $("close");
65
+ U(), $("close");
67
66
  }
68
- function U() {
67
+ function Q() {
69
68
  const o = T((a) => {
70
69
  switch (a.code) {
71
70
  // ESC
@@ -78,7 +77,7 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
78
77
  break;
79
78
  // LEFT_ARROW
80
79
  case p.left:
81
- F();
80
+ D();
82
81
  break;
83
82
  // UP_ARROW
84
83
  case p.up:
@@ -86,7 +85,7 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
86
85
  break;
87
86
  // RIGHT_ARROW
88
87
  case p.right:
89
- V();
88
+ F();
90
89
  break;
91
90
  // DOWN_ARROW
92
91
  case p.down:
@@ -104,16 +103,16 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
104
103
  y(document, "keydown", o), y(document, "wheel", n);
105
104
  });
106
105
  }
107
- function _() {
106
+ function U() {
108
107
  Y.stop();
109
108
  }
110
- function ee() {
109
+ function _() {
111
110
  k.value = !1;
112
111
  }
113
- function te(o) {
114
- k.value = !1, o.target.alt = q("vft.imageViewer.loadFailed");
112
+ function ee(o) {
113
+ k.value = !1, o.target.alt = "加载失败";
115
114
  }
116
- function ne(o) {
115
+ function te(o) {
117
116
  if (k.value || o.button !== 0 || !I.value) return;
118
117
  s.value.enableTransition = !1;
119
118
  const { offsetX: n, offsetY: a } = s.value, l = o.pageX, x = o.pageY, u = T((b) => {
@@ -143,10 +142,10 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
143
142
  const n = t.urlList.length;
144
143
  m.value = (o + n) % n;
145
144
  }
146
- function F() {
145
+ function D() {
147
146
  O.value && !t.infinite || L(m.value - 1);
148
147
  }
149
- function V() {
148
+ function F() {
150
149
  M.value && !t.infinite || L(m.value + 1);
151
150
  }
152
151
  function g(o, n = {}) {
@@ -176,37 +175,37 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
176
175
  }
177
176
  s.value.enableTransition = l;
178
177
  }
179
- return D(J, () => {
180
- ae(() => {
178
+ return R(G, () => {
179
+ oe(() => {
181
180
  X.value[0]?.complete || (k.value = !0);
182
181
  });
183
- }), D(m, (o) => {
182
+ }), R(m, (o) => {
184
183
  N(), $("switch", o);
185
- }), ie(() => {
186
- U(), I.value?.focus?.();
184
+ }), ae(() => {
185
+ Q(), I.value?.focus?.();
187
186
  }), P({
188
187
  /** @description manually switch image */
189
188
  setActiveItem: L
190
- }), (o, n) => (z(), se(e(be), {
189
+ }), (o, n) => (z(), ie(e(ge), {
191
190
  to: "body",
192
191
  disabled: !t.teleported
193
192
  }, {
194
- default: R(() => [
195
- d(re, {
193
+ default: S(() => [
194
+ d(se, {
196
195
  name: "viewer-fade",
197
196
  appear: ""
198
197
  }, {
199
- default: R(() => [
198
+ default: S(() => [
200
199
  c("div", {
201
200
  ref_key: "wrapper",
202
201
  ref: I,
203
202
  tabindex: -1,
204
203
  class: r(e(i).e("wrapper")),
205
- style: S({ zIndex: Q.value })
204
+ style: V({ zIndex: K.value })
206
205
  }, [
207
206
  c("div", {
208
207
  class: r(e(i).e("mask")),
209
- onClick: n[0] || (n[0] = le((a) => t.hideOnClickModal && C(), ["self"]))
208
+ onClick: n[0] || (n[0] = re((a) => t.hideOnClickModal && C(), ["self"]))
210
209
  }, null, 2),
211
210
  c("span", {
212
211
  class: r([e(i).e("btn"), e(i).e("close")]),
@@ -214,14 +213,14 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
214
213
  }, [
215
214
  d(e(v), { icon: "icon-close" })
216
215
  ], 2),
217
- G.value ? ce("", !0) : (z(), E(H, { key: 0 }, [
216
+ q.value ? le("", !0) : (z(), E(H, { key: 0 }, [
218
217
  c("span", {
219
218
  class: r([
220
219
  e(i).e("btn"),
221
220
  e(i).e("prev"),
222
221
  e(i).is("disabled", !t.infinite && O.value)
223
222
  ]),
224
- onClick: F
223
+ onClick: D
225
224
  }, [
226
225
  d(e(v), { icon: "icon-arrow-left" })
227
226
  ], 2),
@@ -231,7 +230,7 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
231
230
  e(i).e("next"),
232
231
  e(i).is("disabled", !t.infinite && M.value)
233
232
  ]),
234
- onClick: V
233
+ onClick: F
235
234
  }, [
236
235
  d(e(v), { icon: "icon-arrow-right" })
237
236
  ], 2)
@@ -273,23 +272,23 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
273
272
  c("div", {
274
273
  class: r(e(i).e("canvas"))
275
274
  }, [
276
- (z(!0), E(H, null, ue(t.urlList, (a, l) => fe((z(), E("img", {
275
+ (z(!0), E(H, null, ce(t.urlList, (a, l) => ue((z(), E("img", {
277
276
  ref_for: !0,
278
277
  ref: (x) => X.value[l] = x,
279
278
  key: a,
280
279
  src: a,
281
- style: S(K.value),
280
+ style: V(J.value),
282
281
  class: r(e(i).e("img")),
283
282
  referrerpolicy: t.referrerpolicy,
284
283
  crossorigin: t.crossorigin,
285
- onLoad: ee,
286
- onError: te,
287
- onMousedown: ne
288
- }, null, 46, we)), [
289
- [de, l === m.value]
284
+ onLoad: _,
285
+ onError: ee,
286
+ onMousedown: te
287
+ }, null, 46, ke)), [
288
+ [fe, l === m.value]
290
289
  ])), 128))
291
290
  ], 2),
292
- me(o.$slots, "default")
291
+ de(o.$slots, "default")
293
292
  ], 6)
294
293
  ]),
295
294
  _: 3
@@ -300,5 +299,5 @@ const we = ["src", "referrerpolicy", "crossorigin"], pe = A({
300
299
  }
301
300
  });
302
301
  export {
303
- Ne as default
302
+ Ye as default
304
303
  };