vft 0.0.511 → 0.0.513
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/autocomplete/autocomplete.vue.d.ts +2 -2
- package/es/components/autocomplete/index.d.ts +6 -6
- package/es/components/button/index.d.ts +9 -9
- package/es/components/cascader/cascader.vue2.js +202 -203
- package/es/components/cascader-panel/menu.vue2.js +49 -50
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +18 -19
- package/es/components/color-picker/color-picker.vue2.js +133 -134
- package/es/components/config-provider/config-provider.vue.d.ts +0 -2
- package/es/components/config-provider/config-provider.vue2.js +4 -5
- package/es/components/config-provider/constants.d.ts +0 -1
- package/es/components/config-provider/constants.js +2 -3
- package/es/components/config-provider/hooks/use-global-config.js +30 -33
- package/es/components/config-provider/index.d.ts +0 -9
- package/es/components/config-provider/index.js +5 -6
- package/es/components/date-picker/composables/use-basic-date-table.js +82 -83
- package/es/components/date-picker/composables/use-month-range-header.js +14 -15
- package/es/components/date-picker/composables/use-panel-date-range.js +23 -24
- package/es/components/date-picker/date-picker-com/basic-month-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/basic-year-table.vue2.js +38 -39
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +183 -184
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +224 -225
- package/es/components/date-time-select/date-time-select.vue2.js +36 -39
- package/es/components/dropdown/dropdown-item-impl.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue.d.ts +1 -1
- package/es/components/dropdown/dropdown.vue2.js +67 -68
- package/es/components/dropdown/index.d.ts +33 -33
- package/es/components/empty/empty.vue2.js +38 -39
- package/es/components/full-screen/full-screen.vue2.js +17 -18
- package/es/components/image/image.vue2.js +59 -60
- package/es/components/image-viewer/image-viewer.vue2.js +44 -45
- package/es/components/index.js +97 -98
- package/es/components/md-container/md-container.vue2.js +74 -75
- package/es/components/md-container/toc.js +36 -37
- package/es/components/message-box/message-box.vue2.js +3 -3
- package/es/components/message-box/method.js +47 -48
- package/es/components/modal/modal-footer-action.vue2.js +24 -25
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +15 -16
- package/es/components/multiple-tabs/use/use-tab-dropdown.js +53 -54
- package/es/components/popconfirm/index.d.ts +15 -15
- package/es/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/es/components/popconfirm/popconfirm.vue2.js +39 -40
- package/es/components/search/search.vue2.js +50 -51
- package/es/components/select/index.d.ts +4 -4
- package/es/components/select/select.vue.d.ts +4 -4
- package/es/components/select/useSelect.d.ts +4 -4
- package/es/components/select/useSelect.js +231 -232
- package/es/components/time-picker/time-picker-com/panel-time-pick.vue2.js +65 -66
- package/es/components/time-picker/time-picker-com/panel-time-range.vue2.js +133 -134
- package/es/components/transfer/transfer-panel.vue2.js +56 -57
- package/es/components/transfer/transfer.vue2.js +69 -70
- package/es/components/tree/tree.vue2.js +59 -60
- package/es/components/upload/upload-content.vue2.js +49 -50
- package/es/components/upload/upload-list.vue2.js +45 -46
- package/es/components/upload/upload.vue2.js +99 -100
- package/es/hooks/use-z-index/index.js +3 -3
- package/es/index.d.ts +0 -1
- package/es/index.js +1 -5
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/lib/components/autocomplete/autocomplete.vue.d.ts +2 -2
- package/lib/components/autocomplete/index.d.ts +6 -6
- package/lib/components/button/index.d.ts +9 -9
- 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 +0 -2
- 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 +0 -1
- 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 +0 -9
- package/lib/components/date-picker/composables/use-basic-date-table.cjs +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-item-impl.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown-item.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue.d.ts +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/dropdown/index.d.ts +33 -33
- 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/md-container/md-container.vue2.cjs +1 -1
- package/lib/components/md-container/toc.cjs +1 -1
- package/lib/components/message-box/message-box.vue2.cjs +1 -1
- package/lib/components/message-box/method.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/popconfirm/index.d.ts +15 -15
- package/lib/components/popconfirm/popconfirm.vue.d.ts +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +4 -4
- package/lib/components/select/select.vue.d.ts +4 -4
- package/lib/components/select/useSelect.cjs +1 -1
- package/lib/components/select/useSelect.d.ts +4 -4
- 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/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +0 -1
- 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/message-box.scss +2 -2
- package/theme-style/src/table.scss +2 -0
- package/theme-style/vft-message-box.css +1 -1
- package/theme-style/vft-table.css +1 -1
- package/web-types.json +1 -1
- package/es/locale/index.d.js +0 -1
- package/es/locale/index.d.ts +0 -26
- package/es/locale/index.js +0 -10
- package/es/locale/lang/en.d.ts +0 -183
- package/es/locale/lang/en.js +0 -241
- package/es/locale/lang/zh-cn.d.ts +0 -183
- package/es/locale/lang/zh-cn.js +0 -241
- package/es/locale/lang/zh-tw.d.ts +0 -183
- package/es/locale/lang/zh-tw.js +0 -241
- package/es/locale/use-locale.d.ts +0 -17
- package/es/locale/use-locale.js +0 -56
- package/lib/locale/index.cjs +0 -1
- package/lib/locale/index.d.cjs +0 -1
- package/lib/locale/index.d.ts +0 -26
- package/lib/locale/lang/en.cjs +0 -1
- package/lib/locale/lang/en.d.ts +0 -183
- package/lib/locale/lang/zh-cn.cjs +0 -1
- package/lib/locale/lang/zh-cn.d.ts +0 -183
- package/lib/locale/lang/zh-tw.cjs +0 -1
- package/lib/locale/lang/zh-tw.d.ts +0 -183
- package/lib/locale/use-locale.cjs +0 -1
- package/lib/locale/use-locale.d.ts +0 -17
|
@@ -1,72 +1,71 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
|
|
5
|
-
import { addUnit as
|
|
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
|
|
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
|
|
13
|
+
const B = d({
|
|
15
14
|
name: "vft-empty"
|
|
16
|
-
}),
|
|
17
|
-
...
|
|
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(
|
|
25
|
-
const
|
|
23
|
+
setup(o) {
|
|
24
|
+
const n = w("empty"), p = v(), f = /* @__PURE__ */ new Map([
|
|
26
25
|
[
|
|
27
26
|
e.NotFound,
|
|
28
27
|
{
|
|
29
|
-
text:
|
|
28
|
+
text: "页面不存在"
|
|
30
29
|
}
|
|
31
30
|
],
|
|
32
31
|
[
|
|
33
32
|
e.Delete,
|
|
34
33
|
{
|
|
35
|
-
text:
|
|
34
|
+
text: "已删除"
|
|
36
35
|
}
|
|
37
36
|
],
|
|
38
37
|
[
|
|
39
38
|
e.NetworkDisconnect,
|
|
40
39
|
{
|
|
41
|
-
text:
|
|
40
|
+
text: "网络已断开"
|
|
42
41
|
}
|
|
43
42
|
],
|
|
44
43
|
[
|
|
45
44
|
e.NoData,
|
|
46
45
|
{
|
|
47
|
-
text:
|
|
46
|
+
text: "暂无数据"
|
|
48
47
|
}
|
|
49
48
|
],
|
|
50
49
|
[
|
|
51
50
|
e.PageError,
|
|
52
51
|
{
|
|
53
|
-
text:
|
|
52
|
+
text: "系统异常"
|
|
54
53
|
}
|
|
55
54
|
],
|
|
56
55
|
[
|
|
57
56
|
e.NoFilter,
|
|
58
57
|
{
|
|
59
|
-
text:
|
|
58
|
+
text: "此筛选条件下无结果"
|
|
60
59
|
}
|
|
61
60
|
],
|
|
62
61
|
[
|
|
63
62
|
e.NoSearch,
|
|
64
63
|
{
|
|
65
|
-
text:
|
|
64
|
+
text: "没有搜索结果"
|
|
66
65
|
}
|
|
67
66
|
]
|
|
68
|
-
]),
|
|
69
|
-
switch (
|
|
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
|
|
76
|
+
return o.size || 80;
|
|
78
77
|
}
|
|
79
|
-
}),
|
|
80
|
-
size:
|
|
81
|
-
icon:
|
|
82
|
-
})),
|
|
83
|
-
() =>
|
|
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 (
|
|
86
|
-
class: c([
|
|
84
|
+
return (r, I) => (a(), l("div", {
|
|
85
|
+
class: c([t(n).b()])
|
|
87
86
|
}, [
|
|
88
|
-
|
|
89
|
-
class: c(
|
|
87
|
+
k("div", {
|
|
88
|
+
class: c(t(n).e("image"))
|
|
90
89
|
}, [
|
|
91
|
-
|
|
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
|
-
|
|
92
|
+
m.value ? (a(), l("span", {
|
|
94
93
|
key: 0,
|
|
95
|
-
class: c(
|
|
94
|
+
class: c(t(n).e("desc"))
|
|
96
95
|
}, [
|
|
97
|
-
|
|
98
|
-
], 2)) :
|
|
99
|
-
|
|
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(
|
|
100
|
+
class: c(t(n).e("bottom"))
|
|
102
101
|
}, [
|
|
103
|
-
|
|
104
|
-
], 2)) :
|
|
102
|
+
i(r.$slots, "default")
|
|
103
|
+
], 2)) : u("", !0)
|
|
105
104
|
], 2));
|
|
106
105
|
}
|
|
107
106
|
});
|
|
108
107
|
export {
|
|
109
|
-
|
|
108
|
+
J as default
|
|
110
109
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { defineComponent as r, openBlock as p, createBlock as
|
|
2
|
-
import { useFullscreen as
|
|
3
|
-
import { delObjAttrNotExist as
|
|
4
|
-
import { VftIconText as
|
|
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
|
|
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
|
-
|
|
15
|
-
const y = r({
|
|
14
|
+
const _ = r({
|
|
16
15
|
name: "full-screen"
|
|
17
|
-
}),
|
|
18
|
-
...
|
|
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(
|
|
37
|
-
const
|
|
38
|
-
return (
|
|
39
|
-
class: o(
|
|
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(
|
|
40
|
+
"hover-color": o(c),
|
|
42
41
|
onClick: o(i),
|
|
43
|
-
icon: o(
|
|
44
|
-
text: o(
|
|
45
|
-
}, o(
|
|
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
|
-
|
|
48
|
+
z as default
|
|
50
49
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
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 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
|
|
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
|
-
|
|
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
|
-
}),
|
|
18
|
-
...
|
|
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,
|
|
34
|
+
const c = b, i = se("image");
|
|
36
35
|
let C = "";
|
|
37
|
-
const
|
|
38
|
-
let
|
|
39
|
-
const
|
|
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 && (
|
|
42
|
+
v && (n.value = !0, r.value = !1, w.value = e.src);
|
|
44
43
|
};
|
|
45
|
-
function
|
|
46
|
-
|
|
44
|
+
function D(t) {
|
|
45
|
+
n.value = !1, r.value = !1, c("load", t);
|
|
47
46
|
}
|
|
48
|
-
function
|
|
49
|
-
|
|
47
|
+
function Y(t) {
|
|
48
|
+
n.value = !1, r.value = !0, c("error", t);
|
|
50
49
|
}
|
|
51
50
|
function I() {
|
|
52
|
-
|
|
51
|
+
le(m.value, a.value) && (L(), B());
|
|
53
52
|
}
|
|
54
|
-
const x =
|
|
53
|
+
const x = oe(I, 200);
|
|
55
54
|
async function E() {
|
|
56
|
-
v && (await
|
|
57
|
-
|
|
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 || !
|
|
62
|
+
!v || !a.value || !x || (z?.(), a.value = void 0);
|
|
64
63
|
}
|
|
65
|
-
function
|
|
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
|
|
74
|
-
g.value && (
|
|
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
|
|
79
|
-
|
|
77
|
+
function K() {
|
|
78
|
+
p?.(), document.body.style.overflow = C, h.value = !1, c("close");
|
|
80
79
|
}
|
|
81
|
-
function
|
|
80
|
+
function R(t) {
|
|
82
81
|
c("switch", t);
|
|
83
82
|
}
|
|
84
|
-
return
|
|
83
|
+
return G(
|
|
85
84
|
() => e.src,
|
|
86
85
|
() => {
|
|
87
|
-
S.value ? (
|
|
86
|
+
S.value ? (n.value = !0, r.value = !1, B(), E()) : L();
|
|
88
87
|
}
|
|
89
|
-
),
|
|
88
|
+
), J(() => {
|
|
90
89
|
S.value ? E() : L();
|
|
91
90
|
}), $({
|
|
92
|
-
isLoading:
|
|
93
|
-
}), (t,
|
|
91
|
+
isLoading: n
|
|
92
|
+
}), (t, fe) => (s(), f("div", {
|
|
94
93
|
ref_key: "container",
|
|
95
94
|
ref: m,
|
|
96
|
-
class: y([l(
|
|
97
|
-
style:
|
|
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",
|
|
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(
|
|
105
|
-
g.value && l(
|
|
106
|
-
|
|
103
|
+
l(i).e("inner"),
|
|
104
|
+
g.value && l(i).e("preview"),
|
|
105
|
+
n.value && l(i).is("loading")
|
|
107
106
|
],
|
|
108
|
-
onClick:
|
|
109
|
-
onLoad:
|
|
110
|
-
onError:
|
|
107
|
+
onClick: q,
|
|
108
|
+
onLoad: D,
|
|
109
|
+
onError: Y,
|
|
111
110
|
alt: ""
|
|
112
|
-
}), null, 16,
|
|
113
|
-
|
|
111
|
+
}), null, 16, ue)) : u("", !0),
|
|
112
|
+
n.value || r.value ? (s(), f("div", {
|
|
114
113
|
key: 1,
|
|
115
|
-
class: y(l(
|
|
114
|
+
class: y(l(i).e("wrapper"))
|
|
116
115
|
}, [
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
class: y(l(
|
|
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
|
-
|
|
123
|
-
class: y(l(
|
|
124
|
-
},
|
|
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(
|
|
128
|
-
h.value ? (s(),
|
|
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:
|
|
139
|
-
onSwitch:
|
|
137
|
+
onClose: K,
|
|
138
|
+
onSwitch: R
|
|
140
139
|
}, {
|
|
141
|
-
default:
|
|
142
|
-
t.$slots.viewer ? (s(), f("div",
|
|
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
|
-
|
|
152
|
+
Ie as default
|
|
154
153
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as A, ref as h, effectScope as
|
|
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
|
|
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
|
|
13
|
-
import
|
|
14
|
-
|
|
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
|
-
}),
|
|
18
|
-
...
|
|
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 =
|
|
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
|
-
}),
|
|
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
|
-
}),
|
|
63
|
+
}), K = w(() => Z(t.zIndex) ? t.zIndex : j());
|
|
65
64
|
function C() {
|
|
66
|
-
|
|
65
|
+
U(), $("close");
|
|
67
66
|
}
|
|
68
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
109
|
+
function _() {
|
|
111
110
|
k.value = !1;
|
|
112
111
|
}
|
|
113
|
-
function
|
|
114
|
-
k.value = !1, o.target.alt =
|
|
112
|
+
function ee(o) {
|
|
113
|
+
k.value = !1, o.target.alt = "加载失败";
|
|
115
114
|
}
|
|
116
|
-
function
|
|
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
|
|
145
|
+
function D() {
|
|
147
146
|
O.value && !t.infinite || L(m.value - 1);
|
|
148
147
|
}
|
|
149
|
-
function
|
|
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
|
|
180
|
-
|
|
178
|
+
return R(G, () => {
|
|
179
|
+
oe(() => {
|
|
181
180
|
X.value[0]?.complete || (k.value = !0);
|
|
182
181
|
});
|
|
183
|
-
}),
|
|
182
|
+
}), R(m, (o) => {
|
|
184
183
|
N(), $("switch", o);
|
|
185
|
-
}),
|
|
186
|
-
|
|
184
|
+
}), ae(() => {
|
|
185
|
+
Q(), I.value?.focus?.();
|
|
187
186
|
}), P({
|
|
188
187
|
/** @description manually switch image */
|
|
189
188
|
setActiveItem: L
|
|
190
|
-
}), (o, n) => (z(),
|
|
189
|
+
}), (o, n) => (z(), ie(e(ge), {
|
|
191
190
|
to: "body",
|
|
192
191
|
disabled: !t.teleported
|
|
193
192
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
d(
|
|
193
|
+
default: S(() => [
|
|
194
|
+
d(se, {
|
|
196
195
|
name: "viewer-fade",
|
|
197
196
|
appear: ""
|
|
198
197
|
}, {
|
|
199
|
-
default:
|
|
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:
|
|
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] =
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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,
|
|
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:
|
|
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:
|
|
286
|
-
onError:
|
|
287
|
-
onMousedown:
|
|
288
|
-
}, null, 46,
|
|
289
|
-
[
|
|
284
|
+
onLoad: _,
|
|
285
|
+
onError: ee,
|
|
286
|
+
onMousedown: te
|
|
287
|
+
}, null, 46, ke)), [
|
|
288
|
+
[fe, l === m.value]
|
|
290
289
|
])), 128))
|
|
291
290
|
], 2),
|
|
292
|
-
|
|
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
|
-
|
|
302
|
+
Ye as default
|
|
304
303
|
};
|