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.
- package/dist/index.css +1 -1
- package/es/components/cascader/cascader.vue2.js +203 -202
- package/es/components/cascader-panel/menu.vue2.js +50 -49
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +21 -17
- package/es/components/color-picker/color-picker.vue2.js +134 -133
- package/es/components/config-provider/config-provider.vue.d.ts +2 -0
- package/es/components/config-provider/config-provider.vue2.js +5 -4
- package/es/components/config-provider/constants.d.ts +1 -0
- package/es/components/config-provider/constants.js +3 -2
- package/es/components/config-provider/hooks/use-global-config.js +33 -30
- package/es/components/config-provider/index.d.ts +9 -0
- package/es/components/config-provider/index.js +6 -5
- package/es/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/es/components/date-picker/composables/use-basic-date-table.js +124 -123
- package/es/components/date-picker/composables/use-month-range-header.js +15 -14
- package/es/components/date-picker/composables/use-panel-date-range.js +24 -23
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +39 -38
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +179 -178
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +225 -224
- package/es/components/date-time-select/date-time-select.vue2.js +39 -36
- package/es/components/dropdown/dropdown.vue2.js +68 -67
- package/es/components/empty/empty.vue2.js +39 -38
- package/es/components/full-screen/full-screen.vue2.js +18 -17
- package/es/components/image/image.vue2.js +60 -59
- package/es/components/image-viewer/image-viewer.vue2.js +45 -44
- package/es/components/index.js +161 -160
- package/es/components/input/index.d.ts +5 -0
- package/es/components/input/input.vue.d.ts +2 -0
- package/es/components/input/input.vue2.js +42 -41
- package/es/components/md-container/md-container.vue2.js +75 -74
- package/es/components/md-container/toc.js +37 -36
- package/es/components/modal/modal-footer-action.vue2.js +25 -24
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +16 -15
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +54 -53
- package/es/components/pagination/components/jumper.vue2.js +29 -28
- package/es/components/pagination/components/sizes.vue2.js +21 -20
- package/es/components/pagination/components/total.vue2.js +11 -10
- package/es/components/popconfirm/popconfirm.vue2.js +40 -39
- package/es/components/search/search.vue2.js +79 -77
- package/es/components/select/useSelect.js +232 -231
- package/es/components/super-form/super-form-action.vue2.js +41 -40
- package/es/components/super-form/super-form-item.vue2.js +206 -203
- package/es/components/super-form/use/helper.d.ts +1 -1
- package/es/components/super-form/use/helper.js +62 -62
- package/es/components/table/field.js +130 -110
- package/es/components/table/table.vue2.js +152 -150
- package/es/components/table/use/use-columns.js +29 -26
- package/es/components/table/use/use-data-source.js +87 -86
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +66 -65
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +134 -133
- package/es/components/transfer/transfer-panel.vue2.js +57 -56
- package/es/components/transfer/transfer.vue2.js +70 -69
- package/es/components/tree/tree.vue2.js +60 -59
- package/es/components/upload/index.d.ts +3 -3
- package/es/components/upload/upload-content.vue.d.ts +2 -2
- package/es/components/upload/upload-content.vue2.js +78 -75
- package/es/components/upload/upload-list.vue2.js +46 -45
- package/es/components/upload/upload.vue.d.ts +2 -2
- package/es/components/upload/upload.vue2.js +87 -85
- package/es/components/upload/utils.js +29 -29
- package/es/constants/date.d.ts +1 -1
- package/es/constants/date.js +9 -1
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +1 -0
- package/es/index.js +5 -1
- package/es/locale/index.d.js +1 -0
- package/es/locale/index.d.ts +26 -0
- package/es/locale/index.js +10 -0
- package/es/locale/lang/en.d.ts +183 -0
- package/es/locale/lang/en.js +241 -0
- package/es/locale/lang/zh-cn.d.ts +183 -0
- package/es/locale/lang/zh-cn.js +241 -0
- package/es/locale/lang/zh-tw.d.ts +183 -0
- package/es/locale/lang/zh-tw.js +241 -0
- package/es/locale/use-locale.d.ts +17 -0
- package/es/locale/use-locale.js +56 -0
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/cascader/cascader.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +4 -4
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/config-provider/config-provider.vue.d.ts +2 -0
- package/lib/components/config-provider/config-provider.vue2.cjs +1 -1
- package/lib/components/config-provider/constants.cjs +1 -1
- package/lib/components/config-provider/constants.d.ts +1 -0
- package/lib/components/config-provider/hooks/use-global-config.cjs +1 -1
- package/lib/components/config-provider/index.cjs +1 -1
- package/lib/components/config-provider/index.d.ts +9 -0
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +1 -1
- package/lib/components/date-picker/composables/use-basic-date-table.d.ts +1 -1
- package/lib/components/date-picker/composables/use-month-range-header.cjs +1 -1
- package/lib/components/date-picker/composables/use-panel-date-range.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-month-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/basic-year-table.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-time-select/date-time-select.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/empty/empty.vue2.cjs +1 -1
- package/lib/components/full-screen/full-screen.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/index.cjs +1 -1
- package/lib/components/input/index.d.ts +5 -0
- package/lib/components/input/input.vue.d.ts +2 -0
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/use/use-tab-dropdown.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-item.vue2.cjs +1 -1
- package/lib/components/super-form/use/helper.cjs +1 -1
- package/lib/components/super-form/use/helper.d.ts +1 -1
- package/lib/components/table/field.cjs +1 -1
- package/lib/components/table/table.vue2.cjs +1 -1
- package/lib/components/table/use/use-columns.cjs +1 -1
- package/lib/components/table/use/use-data-source.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-pick.vue2.cjs +1 -1
- package/lib/components/time-picker/time-picker-com/panel-time-range.vue2.cjs +1 -1
- package/lib/components/transfer/transfer-panel.vue2.cjs +1 -1
- package/lib/components/transfer/transfer.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/index.d.ts +3 -3
- package/lib/components/upload/upload-content.vue.d.ts +2 -2
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue.d.ts +2 -2
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/upload/utils.cjs +1 -1
- package/lib/constants/date.cjs +1 -1
- package/lib/constants/date.d.ts +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/locale/index.cjs +1 -0
- package/lib/locale/index.d.cjs +1 -0
- package/lib/locale/index.d.ts +26 -0
- package/lib/locale/lang/en.cjs +1 -0
- package/lib/locale/lang/en.d.ts +183 -0
- package/lib/locale/lang/zh-cn.cjs +1 -0
- package/lib/locale/lang/zh-cn.d.ts +183 -0
- package/lib/locale/lang/zh-tw.cjs +1 -0
- package/lib/locale/lang/zh-tw.d.ts +183 -0
- package/lib/locale/use-locale.cjs +1 -0
- package/lib/locale/use-locale.d.ts +17 -0
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +2 -2
- package/theme-style/index.css +1 -1
- package/theme-style/src/super-form.scss +0 -1
- package/theme-style/vft-super-form.css +1 -1
- package/web-types.json +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import { defineComponent as T, useAttrs as
|
|
2
|
-
import { useAttrs as
|
|
3
|
-
import { isInContainer as
|
|
4
|
-
import { VftImageViewer as
|
|
5
|
-
import { isClient as v, useThrottleFn as
|
|
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
|
|
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
|
-
|
|
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
|
-
}),
|
|
17
|
-
...
|
|
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,
|
|
35
|
+
const c = b, n = ce("image"), { t: M } = de();
|
|
35
36
|
let C = "";
|
|
36
|
-
const
|
|
37
|
-
let
|
|
38
|
-
const
|
|
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 && (
|
|
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
|
-
|
|
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
|
-
|
|
52
|
+
ie(m.value, i.value) && (L(), B());
|
|
52
53
|
}
|
|
53
|
-
const x =
|
|
54
|
+
const x = ue(I, 200);
|
|
54
55
|
async function E() {
|
|
55
|
-
v && (await
|
|
56
|
-
|
|
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 || !
|
|
63
|
+
!v || !i.value || !x || (p?.(), i.value = void 0);
|
|
63
64
|
}
|
|
64
|
-
function
|
|
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
|
|
73
|
-
g.value && (
|
|
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
|
|
78
|
-
|
|
78
|
+
function R() {
|
|
79
|
+
z?.(), document.body.style.overflow = C, h.value = !1, c("close");
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function W(t) {
|
|
81
82
|
c("switch", t);
|
|
82
83
|
}
|
|
83
|
-
return
|
|
84
|
+
return J(
|
|
84
85
|
() => e.src,
|
|
85
86
|
() => {
|
|
86
|
-
S.value ? (
|
|
87
|
+
S.value ? (a.value = !0, r.value = !1, B(), E()) : L();
|
|
87
88
|
}
|
|
88
|
-
),
|
|
89
|
+
), Q(() => {
|
|
89
90
|
S.value ? E() : L();
|
|
90
91
|
}), $({
|
|
91
|
-
isLoading:
|
|
92
|
-
}), (t,
|
|
92
|
+
isLoading: a
|
|
93
|
+
}), (t, ye) => (s(), f("div", {
|
|
93
94
|
ref_key: "container",
|
|
94
95
|
ref: m,
|
|
95
|
-
class: y([l(
|
|
96
|
-
style:
|
|
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",
|
|
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(
|
|
104
|
-
g.value && l(
|
|
105
|
-
|
|
104
|
+
l(n).e("inner"),
|
|
105
|
+
g.value && l(n).e("preview"),
|
|
106
|
+
a.value && l(n).is("loading")
|
|
106
107
|
],
|
|
107
|
-
onClick:
|
|
108
|
-
onLoad:
|
|
109
|
-
onError:
|
|
108
|
+
onClick: K,
|
|
109
|
+
onLoad: Y,
|
|
110
|
+
onError: j,
|
|
110
111
|
alt: ""
|
|
111
|
-
}), null, 16,
|
|
112
|
-
|
|
112
|
+
}), null, 16, fe)) : u("", !0),
|
|
113
|
+
a.value || r.value ? (s(), f("div", {
|
|
113
114
|
key: 1,
|
|
114
|
-
class: y(l(
|
|
115
|
+
class: y(l(n).e("wrapper"))
|
|
115
116
|
}, [
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
class: y(l(
|
|
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
|
-
|
|
122
|
-
class: y(l(
|
|
123
|
-
}, "
|
|
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(
|
|
127
|
-
h.value ? (s(),
|
|
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:
|
|
138
|
-
onSwitch:
|
|
138
|
+
onClose: R,
|
|
139
|
+
onSwitch: W
|
|
139
140
|
}, {
|
|
140
|
-
default:
|
|
141
|
-
t.$slots.viewer ? (s(), f("div",
|
|
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
|
-
|
|
153
|
+
Ve as default
|
|
153
154
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, ref as h, effectScope as
|
|
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
|
|
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
|
|
13
|
-
import {
|
|
14
|
-
|
|
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
|
-
}),
|
|
17
|
-
...
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
64
|
+
}), Q = w(() => Z(t.zIndex) ? t.zIndex : j());
|
|
64
65
|
function C() {
|
|
65
|
-
|
|
66
|
+
_(), $("close");
|
|
66
67
|
}
|
|
67
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
146
|
+
function F() {
|
|
146
147
|
O.value && !t.infinite || L(m.value - 1);
|
|
147
148
|
}
|
|
148
|
-
function
|
|
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
|
|
179
|
-
|
|
179
|
+
return D(J, () => {
|
|
180
|
+
ae(() => {
|
|
180
181
|
X.value[0]?.complete || (k.value = !0);
|
|
181
182
|
});
|
|
182
|
-
}),
|
|
183
|
+
}), D(m, (o) => {
|
|
183
184
|
N(), $("switch", o);
|
|
184
|
-
}),
|
|
185
|
-
|
|
185
|
+
}), ie(() => {
|
|
186
|
+
U(), I.value?.focus?.();
|
|
186
187
|
}), P({
|
|
187
188
|
/** @description manually switch image */
|
|
188
189
|
setActiveItem: L
|
|
189
|
-
}), (o, n) => (z(),
|
|
190
|
+
}), (o, n) => (z(), se(e(be), {
|
|
190
191
|
to: "body",
|
|
191
192
|
disabled: !t.teleported
|
|
192
193
|
}, {
|
|
193
|
-
default:
|
|
194
|
-
d(
|
|
194
|
+
default: R(() => [
|
|
195
|
+
d(re, {
|
|
195
196
|
name: "viewer-fade",
|
|
196
197
|
appear: ""
|
|
197
198
|
}, {
|
|
198
|
-
default:
|
|
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:
|
|
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] =
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
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:
|
|
286
|
-
onMousedown:
|
|
287
|
-
}, null, 46,
|
|
288
|
-
[
|
|
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
|
-
|
|
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
|
-
|
|
303
|
+
Ne as default
|
|
303
304
|
};
|