x-next 1.6.0 → 1.7.0
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/AI_USAGE.md +57 -4
- package/CHANGELOG.md +36 -0
- package/dist/components/date-picker/DatePicker.vue.d.ts +3 -3
- package/dist/components/date-picker/index.d.ts +6 -6
- package/dist/components/draggable/Draggable.d.ts +1 -1
- package/dist/components/draggable/index.d.ts +2 -2
- package/dist/components/drawer/index.d.ts +6 -6
- package/dist/components/drawer/src/Drawer.vue.d.ts +3 -3
- package/dist/components/dropdown/Dropdown.vue.d.ts +4 -4
- package/dist/components/dropdown/DropdownButton.vue.d.ts +5 -5
- package/dist/components/dropdown/DropdownSubmenu.vue.d.ts +4 -4
- package/dist/components/dropdown/index.d.ts +29 -29
- package/dist/components/form/FormItem.vue.d.ts +12 -12
- package/dist/components/form/form-item-label.vue.d.ts +3 -3
- package/dist/components/form/index.d.ts +24 -24
- package/dist/components/form-select/Select.d.ts +3 -3
- package/dist/components/form-select/index.d.ts +6 -6
- package/dist/components/form-slider/Slider.vue.d.ts +3 -3
- package/dist/components/form-slider/index.d.ts +6 -6
- package/dist/components/form-slider/slider-button.vue.d.ts +3 -3
- package/dist/components/grid/Row.vue.d.ts +3 -3
- package/dist/components/grid/index.d.ts +9 -9
- package/dist/components/image/Image.vue.d.ts +125 -17
- package/dist/components/image/ImagePreview.vue.d.ts +97 -7
- package/dist/components/image/ImagePreviewAction.d.ts +3 -3
- package/dist/components/image/ImagePreviewGroup.vue.d.ts +100 -7
- package/dist/components/image/hooks/use-image-drag.d.ts +2 -2
- package/dist/components/image/index.d.ts +712 -124
- package/dist/components/image/interface.d.ts +9 -1
- package/dist/components/image/preview-toolbar.vue.d.ts +3 -3
- package/dist/components/index.d.ts +1 -0
- package/dist/components/menu/sub-menu-pop.vue.d.ts +3 -3
- package/dist/components/pagination/page-options.vue.d.ts +6 -6
- package/dist/components/popconfirm/src/popup.vue.d.ts +3 -3
- package/dist/components/popover/Popover.d.ts +1 -1
- package/dist/components/popover/index.d.ts +3 -3
- package/dist/components/popup/Popup.d.ts +1 -1
- package/dist/components/popup/index.d.ts +3 -3
- package/dist/components/space/Space.d.ts +1 -1
- package/dist/components/space/index.d.ts +3 -3
- package/dist/components/tabs/Tabs.d.ts +1 -1
- package/dist/components/tabs/index.d.ts +3 -3
- package/dist/components/time-picker/TimePicker.vue.d.ts +3 -3
- package/dist/components/time-picker/index.d.ts +6 -6
- package/dist/components/tooltip/Tooltip.vue.d.ts +1 -1
- package/dist/components/tooltip/index.d.ts +3 -3
- package/dist/components/trigger/Trigger.d.ts +1 -1
- package/dist/components/trigger/index.d.ts +3 -3
- package/dist/components/upload/Upload.d.ts +372 -0
- package/dist/components/upload/context.d.ts +28 -0
- package/dist/components/upload/index.d.ts +656 -0
- package/dist/components/upload/interface.d.ts +110 -0
- package/dist/components/upload/props.d.ts +321 -0
- package/dist/components/upload/upload-list-item.d.ts +15 -0
- package/dist/components/upload/upload-list.d.ts +11 -0
- package/dist/components/upload/upload-picture-item.d.ts +20 -0
- package/dist/components/upload/upload-trigger.d.ts +8 -0
- package/dist/components/upload/utils.d.ts +48 -0
- package/dist/es/_styles/palette-aliases.js +2 -4
- package/dist/es/components/image/Image.vue.js +55 -45
- package/dist/es/components/image/Image.vue2.js +113 -92
- package/dist/es/components/image/ImagePreview.vue.js +66 -53
- package/dist/es/components/image/ImagePreview.vue2.js +219 -171
- package/dist/es/components/image/ImagePreviewAction.js +12 -15
- package/dist/es/components/image/ImagePreviewGroup.vue.js +21 -20
- package/dist/es/components/image/ImagePreviewGroup.vue2.js +45 -39
- package/dist/es/components/image/hooks/use-image-drag.js +16 -14
- package/dist/es/components/index.js +33 -31
- package/dist/es/components/upload/Upload.js +420 -0
- package/dist/es/components/upload/context.js +4 -0
- package/dist/es/components/upload/index.js +8 -0
- package/dist/es/components/upload/props.js +321 -0
- package/dist/es/components/upload/upload-list-item.js +138 -0
- package/dist/es/components/upload/upload-list.js +48 -0
- package/dist/es/components/upload/upload-picture-item.js +109 -0
- package/dist/es/components/upload/upload-trigger.js +89 -0
- package/dist/es/components/upload/utils.js +195 -0
- package/dist/es/icons/_self/upload-icons.js +103 -0
- package/dist/es/index.js +40 -38
- package/dist/es/locale/en-US.js +22 -0
- package/dist/es/locale/zh-CN.js +22 -0
- package/dist/es/style.css +1 -1
- package/dist/icons/_self/upload-icons.d.ts +523 -0
- package/dist/index.cjs +4 -4
- package/dist/index.umd.js +4 -4
- package/dist/locale/interface.d.ts +32 -0
- package/dist/style/base.css +1 -1
- package/dist/style/image.css +1 -1
- package/dist/style/upload.css +1 -0
- package/dist/style/upload.js +2 -0
- package/dist/style.css +1 -1
- package/dist/types.d.ts +1 -0
- package/package.json +1 -1
- package/volar.d.ts +1 -0
- package/dist/es/_hooks/use-popup-overflow-hidden.js +0 -29
|
@@ -1,91 +1,101 @@
|
|
|
1
1
|
import C from "./Image.vue2.js";
|
|
2
|
-
import { resolveComponent as m, openBlock as
|
|
2
|
+
import { resolveComponent as m, openBlock as i, createElementBlock as d, normalizeStyle as p, normalizeClass as o, mergeProps as t, renderSlot as l, createElementVNode as a, createVNode as g, toDisplayString as v, createCommentVNode as n, createBlock as y, createSlots as w, withCtx as P } from "vue";
|
|
3
3
|
import u from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
4
|
+
const N = ["title", "src", "alt", "role", "tabindex", "aria-label", "aria-haspopup"];
|
|
5
|
+
function L(e, r, $, S, E, V) {
|
|
6
|
+
const I = m("IconImageClose"), b = m("IconLoading"), f = m("ImageFooter"), k = m("ImagePreview");
|
|
7
|
+
return i(), d("div", {
|
|
8
8
|
class: o(e.wrapperClassNames),
|
|
9
|
-
style:
|
|
9
|
+
style: p(e.wrapperStyles)
|
|
10
10
|
}, [
|
|
11
|
-
|
|
11
|
+
(i(), d("img", t({
|
|
12
12
|
ref: "refImg",
|
|
13
|
+
key: e.src,
|
|
13
14
|
class: e.className.element("img")
|
|
14
15
|
}, e.imgProps, {
|
|
15
16
|
style: { ...e.imgStyle, ...e.fitStyle },
|
|
16
17
|
title: e.title,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
src: e.src || void 0,
|
|
19
|
+
alt: e.alt ?? e.description,
|
|
20
|
+
role: e.canOpenPreview ? "button" : e.imgProps.role,
|
|
21
|
+
tabindex: e.canOpenPreview ? e.imgProps.tabindex ?? 0 : e.imgProps.tabindex,
|
|
22
|
+
"aria-label": e.canOpenPreview ? e.imgProps["aria-label"] || e.alt || e.description || e.title || e.t("imagePreview.openLabel") : e.imgProps["aria-label"],
|
|
23
|
+
"aria-haspopup": e.canOpenPreview ? "dialog" : void 0,
|
|
24
|
+
onLoad: r[0] || (r[0] = (...s) => e.onImgLoaded && e.onImgLoaded(...s)),
|
|
25
|
+
onError: r[1] || (r[1] = (...s) => e.onImgLoadError && e.onImgLoadError(...s)),
|
|
26
|
+
onClick: r[2] || (r[2] = (...s) => e.onImgClick && e.onImgClick(...s)),
|
|
27
|
+
onKeydown: r[3] || (r[3] = (...s) => e.onImgKeydown && e.onImgKeydown(...s))
|
|
28
|
+
}), null, 16, N)),
|
|
29
|
+
e.isLoaded ? n("", !0) : (i(), d("div", {
|
|
23
30
|
key: 0,
|
|
24
|
-
class: o(e.className.element("overlay"))
|
|
31
|
+
class: o(e.className.element("overlay")),
|
|
32
|
+
style: p(e.overlayStyles)
|
|
25
33
|
}, [
|
|
26
|
-
e.isError ?
|
|
27
|
-
|
|
34
|
+
e.isError ? l(e.$slots, "error", { key: 0 }, () => [
|
|
35
|
+
a("div", {
|
|
28
36
|
class: o(e.className.element("error"))
|
|
29
37
|
}, [
|
|
30
|
-
|
|
38
|
+
a("div", {
|
|
31
39
|
class: o(e.className.element("error-icon"))
|
|
32
40
|
}, [
|
|
33
|
-
|
|
34
|
-
|
|
41
|
+
l(e.$slots, "error-icon", {}, () => [
|
|
42
|
+
g(I)
|
|
35
43
|
])
|
|
36
44
|
], 2),
|
|
37
|
-
|
|
38
|
-
key: 0,
|
|
45
|
+
a("div", {
|
|
39
46
|
class: o(e.className.element("error-alt"))
|
|
40
|
-
},
|
|
47
|
+
}, v(e.alt || e.description || e.t("imagePreview.loadError")), 3)
|
|
41
48
|
], 2)
|
|
42
|
-
]) :
|
|
43
|
-
e.isLoading && (e.showLoader || e.$slots.loader) ?
|
|
44
|
-
|
|
49
|
+
]) : n("", !0),
|
|
50
|
+
e.isLoading && (e.showLoader || e.$slots.loader) ? l(e.$slots, "loader", { key: 1 }, () => [
|
|
51
|
+
a("div", {
|
|
45
52
|
class: o([e.className.element("loader")])
|
|
46
53
|
}, [
|
|
47
|
-
|
|
54
|
+
a("div", {
|
|
48
55
|
class: o(e.className.element("loader-spin"))
|
|
49
56
|
}, [
|
|
50
|
-
|
|
51
|
-
|
|
57
|
+
g(b),
|
|
58
|
+
a("div", {
|
|
52
59
|
class: o(e.className.element("loader-spin-text"))
|
|
53
|
-
}, "
|
|
60
|
+
}, v(e.t("imagePreview.loading")), 3)
|
|
54
61
|
], 2)
|
|
55
62
|
], 2)
|
|
56
|
-
]) :
|
|
57
|
-
],
|
|
58
|
-
e.showFooter ? (
|
|
63
|
+
]) : n("", !0)
|
|
64
|
+
], 6)),
|
|
65
|
+
e.showFooter ? (i(), y(f, {
|
|
59
66
|
key: 1,
|
|
60
67
|
class: o(e.footerClass),
|
|
61
68
|
"prefix-cls": e.className.block,
|
|
62
69
|
title: e.title,
|
|
63
70
|
description: e.description
|
|
64
|
-
},
|
|
71
|
+
}, w({ _: 2 }, [
|
|
65
72
|
e.$slots.extra ? {
|
|
66
73
|
name: "extra",
|
|
67
|
-
fn:
|
|
68
|
-
|
|
74
|
+
fn: P(() => [
|
|
75
|
+
l(e.$slots, "extra")
|
|
69
76
|
]),
|
|
70
77
|
key: "0"
|
|
71
78
|
} : void 0
|
|
72
|
-
]), 1032, ["class", "prefix-cls", "title", "description"])) :
|
|
73
|
-
e.
|
|
79
|
+
]), 1032, ["class", "prefix-cls", "title", "description"])) : n("", !0),
|
|
80
|
+
e.mergePreview && (e.isLoaded || e.mergedPreviewVisible) ? (i(), y(k, t({
|
|
74
81
|
key: 2,
|
|
75
82
|
src: e.src
|
|
76
83
|
}, e.previewProps, {
|
|
77
84
|
visible: e.mergedPreviewVisible,
|
|
78
85
|
"render-to-body": e.renderToBody,
|
|
79
86
|
onClose: e.onPreviewClose
|
|
80
|
-
}), {
|
|
81
|
-
actions
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
87
|
+
}), w({ _: 2 }, [
|
|
88
|
+
e.$slots["preview-actions"] ? {
|
|
89
|
+
name: "actions",
|
|
90
|
+
fn: P(() => [
|
|
91
|
+
l(e.$slots, "preview-actions")
|
|
92
|
+
]),
|
|
93
|
+
key: "0"
|
|
94
|
+
} : void 0
|
|
95
|
+
]), 1040, ["src", "visible", "render-to-body", "onClose"])) : n("", !0)
|
|
86
96
|
], 6);
|
|
87
97
|
}
|
|
88
|
-
const
|
|
98
|
+
const K = /* @__PURE__ */ u(C, [["render", L]]);
|
|
89
99
|
export {
|
|
90
|
-
|
|
100
|
+
K as default
|
|
91
101
|
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
let
|
|
15
|
-
const
|
|
1
|
+
import { defineComponent as q, toRefs as H, inject as J, ref as Q, computed as i, reactive as X, watch as C, nextTick as Y, onBeforeUnmount as Z } from "vue";
|
|
2
|
+
import $ from "../../icons/default/close-circle-fill.js";
|
|
3
|
+
import ee from "../../icons/animation/animation-loading.js";
|
|
4
|
+
import te from "./image-footer.vue.js";
|
|
5
|
+
import re from "./ImagePreview.vue.js";
|
|
6
|
+
import ie from "./hooks/use-image-load-status.js";
|
|
7
|
+
import { normalizeImageSizeProp as F } from "./utils/index.js";
|
|
8
|
+
import { omit as oe } from "../../_utils/omit.js";
|
|
9
|
+
import ae from "../../_hooks/use-merge-state.js";
|
|
10
|
+
import { PreviewGroupInjectionKey as le } from "./context.js";
|
|
11
|
+
import { isBoolean as ne } from "../../_utils/is.js";
|
|
12
|
+
import { getClassNameMixin as ue } from "../../_utils/config.js";
|
|
13
|
+
import { useLocale as se } from "../../locale/index.js";
|
|
14
|
+
let ve = 0;
|
|
15
|
+
const Le = q({
|
|
16
16
|
name: "Image",
|
|
17
17
|
components: {
|
|
18
|
-
IconImageClose:
|
|
19
|
-
IconLoading:
|
|
20
|
-
ImageFooter:
|
|
21
|
-
ImagePreview:
|
|
18
|
+
IconImageClose: $,
|
|
19
|
+
IconLoading: ee,
|
|
20
|
+
ImageFooter: te,
|
|
21
|
+
ImagePreview: re
|
|
22
22
|
},
|
|
23
23
|
inheritAttrs: !1,
|
|
24
24
|
props: {
|
|
@@ -140,15 +140,17 @@ const be = K({
|
|
|
140
140
|
type: [String, Array, Object]
|
|
141
141
|
}
|
|
142
142
|
},
|
|
143
|
-
emits:
|
|
143
|
+
emits: {
|
|
144
144
|
/**
|
|
145
145
|
* @zh 预览的打开和关闭事件
|
|
146
146
|
* @en Preview opening and closing events
|
|
147
147
|
* @param {boolean} visible
|
|
148
148
|
*/
|
|
149
|
-
"preview-visible-change",
|
|
150
|
-
"update:previewVisible"
|
|
151
|
-
|
|
149
|
+
"preview-visible-change": (o) => !0,
|
|
150
|
+
"update:previewVisible": (o) => !0,
|
|
151
|
+
load: (o) => !0,
|
|
152
|
+
error: (o) => !0
|
|
153
|
+
},
|
|
152
154
|
/**
|
|
153
155
|
* @zh 自定义错误状态的图标
|
|
154
156
|
* @en Customize the icon of error content.
|
|
@@ -169,92 +171,111 @@ const be = K({
|
|
|
169
171
|
* @en Extra content at the bottom
|
|
170
172
|
* @slot extra
|
|
171
173
|
*/
|
|
172
|
-
setup(
|
|
174
|
+
setup(o, { attrs: c, slots: j, emit: a }) {
|
|
173
175
|
const {
|
|
174
|
-
height:
|
|
175
|
-
width:
|
|
176
|
-
hideFooter:
|
|
177
|
-
title:
|
|
178
|
-
description:
|
|
179
|
-
src:
|
|
180
|
-
footerPosition:
|
|
181
|
-
defaultPreviewVisible:
|
|
182
|
-
previewVisible:
|
|
183
|
-
preview:
|
|
184
|
-
previewProps:
|
|
185
|
-
} =
|
|
186
|
-
width:
|
|
187
|
-
height:
|
|
188
|
-
})),
|
|
189
|
-
|
|
176
|
+
height: p,
|
|
177
|
+
width: d,
|
|
178
|
+
hideFooter: g,
|
|
179
|
+
title: w,
|
|
180
|
+
description: y,
|
|
181
|
+
src: n,
|
|
182
|
+
footerPosition: s,
|
|
183
|
+
defaultPreviewVisible: k,
|
|
184
|
+
previewVisible: N,
|
|
185
|
+
preview: h,
|
|
186
|
+
previewProps: b
|
|
187
|
+
} = H(o), t = J(le, void 0), { t: z } = se(), l = ue("image"), v = Q(), { isLoaded: S, isError: P, isLoading: L, setLoadStatus: f } = ie(), m = i(() => ({
|
|
188
|
+
width: F(d == null ? void 0 : d.value),
|
|
189
|
+
height: F(p == null ? void 0 : p.value)
|
|
190
|
+
})), A = i(() => o.fit ? { objectFit: o.fit } : {}), E = i(() => [
|
|
191
|
+
l.block,
|
|
190
192
|
{
|
|
191
|
-
[
|
|
192
|
-
[
|
|
193
|
+
[l.element("loading")]: L.value,
|
|
194
|
+
[l.element("loading-error")]: P.value,
|
|
193
195
|
// isLoaded / showFooter 是 ref,这里必须解引用;
|
|
194
196
|
// 直接写对象引用会让条件恒为真,没有 footer 的图片也带上定位类
|
|
195
|
-
[
|
|
196
|
-
[
|
|
197
|
+
[l.element("with-footer-inner")]: u.value && s.value === "inner",
|
|
198
|
+
[l.element("with-footer-outer")]: u.value && s.value === "outer"
|
|
199
|
+
},
|
|
200
|
+
c.class
|
|
201
|
+
]), O = i(() => [
|
|
202
|
+
{
|
|
203
|
+
...m.value,
|
|
204
|
+
height: u.value && s.value === "outer" ? void 0 : m.value.height
|
|
197
205
|
},
|
|
198
|
-
|
|
199
|
-
]),
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
value: j
|
|
206
|
+
c.style
|
|
207
|
+
]), K = i(() => ({
|
|
208
|
+
height: u.value && s.value === "outer" ? m.value.height : void 0
|
|
209
|
+
})), u = i(() => w != null && w.value || y != null && y.value || j.extra ? ne(g.value) ? !g.value && S.value : g.value === "never" : !1), M = i(() => oe(c, ["class", "style", "src"])), [T, B] = ae(
|
|
210
|
+
k.value,
|
|
211
|
+
X({
|
|
212
|
+
value: N
|
|
206
213
|
})
|
|
207
|
-
),
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
214
|
+
), U = i(() => !(t != null && t.preview) && h.value), I = i(() => h.value && S.value);
|
|
215
|
+
C(
|
|
216
|
+
n,
|
|
217
|
+
(e) => {
|
|
218
|
+
f(e ? "loading" : "error"), Y(() => {
|
|
219
|
+
const r = v.value;
|
|
220
|
+
r != null && r.complete && r.naturalWidth > 0 && e === o.src && f("loaded");
|
|
221
|
+
});
|
|
222
|
+
},
|
|
223
|
+
{ immediate: !0, flush: "sync" }
|
|
224
|
+
);
|
|
225
|
+
const V = ve++;
|
|
226
|
+
if (t) {
|
|
227
|
+
let e;
|
|
228
|
+
C(
|
|
215
229
|
[() => {
|
|
216
|
-
var
|
|
217
|
-
return (((
|
|
218
|
-
},
|
|
219
|
-
([
|
|
220
|
-
|
|
230
|
+
var r;
|
|
231
|
+
return (((r = b == null ? void 0 : b.value) == null ? void 0 : r.src) ?? (n == null ? void 0 : n.value)) || "";
|
|
232
|
+
}, h],
|
|
233
|
+
([r, W]) => {
|
|
234
|
+
e = t.registerImageUrl(V, r, W);
|
|
221
235
|
},
|
|
222
236
|
{ immediate: !0 }
|
|
223
|
-
),
|
|
237
|
+
), Z(() => e == null ? void 0 : e());
|
|
224
238
|
}
|
|
225
|
-
function
|
|
226
|
-
|
|
239
|
+
function x(e) {
|
|
240
|
+
e.target !== v.value || !n.value || (f("loaded"), a("load", e));
|
|
227
241
|
}
|
|
228
|
-
function
|
|
229
|
-
|
|
242
|
+
function D(e) {
|
|
243
|
+
e.target === v.value && (f("error"), a("error", e));
|
|
230
244
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
245
|
+
function _() {
|
|
246
|
+
I.value && (t != null && t.preview ? t.preview(V) : (a("preview-visible-change", !0), a("update:previewVisible", !0), B(!0)));
|
|
247
|
+
}
|
|
248
|
+
function G(e) {
|
|
249
|
+
!I.value || e.key !== "Enter" && e.key !== " " || (e.preventDefault(), _());
|
|
233
250
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
251
|
+
function R() {
|
|
252
|
+
a("preview-visible-change", !1), a("update:previewVisible", !1), B(!1);
|
|
236
253
|
}
|
|
237
254
|
return {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
t: z,
|
|
256
|
+
refImg: v,
|
|
257
|
+
className: l,
|
|
258
|
+
wrapperClassNames: E,
|
|
259
|
+
wrapperStyles: O,
|
|
260
|
+
overlayStyles: K,
|
|
261
|
+
showFooter: u,
|
|
262
|
+
imgProps: M,
|
|
263
|
+
imgStyle: m,
|
|
264
|
+
isLoaded: S,
|
|
265
|
+
isError: P,
|
|
266
|
+
isLoading: L,
|
|
267
|
+
mergedPreviewVisible: T,
|
|
268
|
+
mergePreview: U,
|
|
269
|
+
canOpenPreview: I,
|
|
270
|
+
onImgLoaded: x,
|
|
271
|
+
onImgLoadError: D,
|
|
272
|
+
onImgClick: _,
|
|
273
|
+
onImgKeydown: G,
|
|
274
|
+
onPreviewClose: R,
|
|
275
|
+
fitStyle: A
|
|
255
276
|
};
|
|
256
277
|
}
|
|
257
278
|
});
|
|
258
279
|
export {
|
|
259
|
-
|
|
280
|
+
Le as default
|
|
260
281
|
};
|
|
@@ -1,105 +1,118 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as i, openBlock as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
function B(e, a, T, W, z,
|
|
6
|
-
const
|
|
7
|
-
return e.mounted ? (
|
|
1
|
+
import L from "./ImagePreview.vue2.js";
|
|
2
|
+
import { resolveComponent as i, openBlock as s, createBlock as d, Teleport as I, createElementVNode as m, mergeProps as g, createVNode as t, Transition as u, withCtx as p, withDirectives as $, normalizeClass as l, vShow as N, createElementBlock as n, withModifiers as E, normalizeStyle as y, createCommentVNode as r, toDisplayString as v, renderSlot as P, normalizeProps as V } from "vue";
|
|
3
|
+
import A from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const D = ["aria-label", "aria-busy"], M = ["src", "alt", "aria-hidden"], S = ["aria-label"];
|
|
5
|
+
function B(e, a, T, W, z, K) {
|
|
6
|
+
const b = i("IconLoading"), k = i("IconImageClose"), f = i("PreviewToolbar"), w = i("IconClose"), C = i("PreviewArrow");
|
|
7
|
+
return e.mounted ? (s(), d(I, {
|
|
8
8
|
key: 0,
|
|
9
9
|
to: e.container || "body",
|
|
10
10
|
disabled: e.teleportDisabled
|
|
11
11
|
}, [
|
|
12
|
-
|
|
13
|
-
class:
|
|
14
|
-
style:
|
|
15
|
-
}, [
|
|
16
|
-
t(
|
|
12
|
+
m("div", g(e.rootAttrs, {
|
|
13
|
+
class: [e.classNames, e.$attrs.class],
|
|
14
|
+
style: [e.wrapperStyles, e.$attrs.style]
|
|
15
|
+
}), [
|
|
16
|
+
t(u, {
|
|
17
17
|
name: "image-fade",
|
|
18
18
|
onBeforeEnter: a[0] || (a[0] = (o) => o.parentElement && (o.parentElement.style.display = "block")),
|
|
19
19
|
onAfterLeave: a[1] || (a[1] = (o) => o.parentElement && (o.parentElement.style.display = ""))
|
|
20
20
|
}, {
|
|
21
|
-
default:
|
|
22
|
-
|
|
23
|
-
class:
|
|
21
|
+
default: p(() => [
|
|
22
|
+
$(m("div", {
|
|
23
|
+
class: l(e.className.element("mask"))
|
|
24
24
|
}, null, 2), [
|
|
25
|
-
[
|
|
25
|
+
[N, e.mergedVisible]
|
|
26
26
|
])
|
|
27
27
|
]),
|
|
28
28
|
_: 1
|
|
29
29
|
}),
|
|
30
|
-
e.mergedVisible ? (
|
|
30
|
+
e.mergedVisible ? (s(), n("div", {
|
|
31
31
|
key: 0,
|
|
32
32
|
ref: "refWrapper",
|
|
33
33
|
tabindex: "0",
|
|
34
34
|
role: "dialog",
|
|
35
35
|
"aria-modal": "true",
|
|
36
|
-
"aria-label": e.t("imagePreview.previewLabel", { index: 1, total: 1 }),
|
|
37
|
-
|
|
36
|
+
"aria-label": e.$attrs["aria-label"] || e.t("imagePreview.previewLabel", { index: 1, total: 1 }),
|
|
37
|
+
"aria-busy": e.isLoading || void 0,
|
|
38
|
+
class: l(e.className.element("wrapper")),
|
|
38
39
|
onClick: a[6] || (a[6] = (...o) => e.onMaskClick && e.onMaskClick(...o)),
|
|
39
|
-
onWheel: a[7] || (a[7] =
|
|
40
|
+
onWheel: a[7] || (a[7] = E((...o) => e.onWheel && e.onWheel(...o), ["prevent", "stop"])),
|
|
41
|
+
onKeydown: a[8] || (a[8] = (...o) => e.onDialogKeydown && e.onDialogKeydown(...o))
|
|
40
42
|
}, [
|
|
41
|
-
|
|
42
|
-
class:
|
|
43
|
-
style:
|
|
43
|
+
m("div", {
|
|
44
|
+
class: l(e.className.element("img-container")),
|
|
45
|
+
style: y({ transform: `scale(${e.scale}, ${e.scale})` }),
|
|
44
46
|
onClick: a[4] || (a[4] = (...o) => e.onMaskClick && e.onMaskClick(...o))
|
|
45
47
|
}, [
|
|
46
|
-
(
|
|
48
|
+
(s(), n("img", {
|
|
47
49
|
ref: "refImage",
|
|
48
50
|
key: e.src,
|
|
49
51
|
src: e.src,
|
|
50
|
-
|
|
52
|
+
alt: e.t("imagePreview.openLabel"),
|
|
53
|
+
"aria-hidden": !e.isLoaded || void 0,
|
|
54
|
+
class: l([
|
|
51
55
|
e.className.element("img"),
|
|
52
56
|
{
|
|
53
57
|
[e.className.modifier("img-moving")]: e.moving
|
|
54
58
|
}
|
|
55
59
|
]),
|
|
56
|
-
style:
|
|
57
|
-
transform: `translate(${e.translate[0]}px, ${e.translate[1]}px) rotate(${e.rotate}deg)
|
|
60
|
+
style: y({
|
|
61
|
+
transform: `translate(${e.translate[0]}px, ${e.translate[1]}px) rotate(${e.rotate}deg)`,
|
|
62
|
+
visibility: e.isLoaded ? "visible" : "hidden"
|
|
58
63
|
}),
|
|
59
64
|
onLoad: a[2] || (a[2] = (...o) => e.onImgLoad && e.onImgLoad(...o)),
|
|
60
65
|
onError: a[3] || (a[3] = (...o) => e.onImgError && e.onImgError(...o))
|
|
61
|
-
}, null, 46,
|
|
66
|
+
}, null, 46, M))
|
|
62
67
|
], 6),
|
|
63
|
-
e.isLoading ? (
|
|
68
|
+
e.isLoading ? (s(), n("div", {
|
|
64
69
|
key: 0,
|
|
65
|
-
class:
|
|
70
|
+
class: l(e.className.element("loading"))
|
|
66
71
|
}, [
|
|
67
|
-
t(
|
|
68
|
-
], 2)) :
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
t(b)
|
|
73
|
+
], 2)) : r("", !0),
|
|
74
|
+
e.isError ? (s(), n("div", {
|
|
75
|
+
key: 1,
|
|
76
|
+
class: l(e.className.element("error")),
|
|
77
|
+
role: "status"
|
|
78
|
+
}, [
|
|
79
|
+
t(k),
|
|
80
|
+
m("span", null, v(e.t("imagePreview.loadError")), 1)
|
|
81
|
+
], 2)) : r("", !0),
|
|
82
|
+
t(u, { name: "image-fade" }, {
|
|
83
|
+
default: p(() => [
|
|
84
|
+
e.scaleValueVisible ? (s(), n("div", {
|
|
72
85
|
key: 0,
|
|
73
|
-
class:
|
|
74
|
-
},
|
|
86
|
+
class: l(e.className.element("scale-value"))
|
|
87
|
+
}, v((e.scale * 100).toFixed(0)) + "% ", 3)) : r("", !0)
|
|
75
88
|
]),
|
|
76
89
|
_: 1
|
|
77
90
|
}),
|
|
78
|
-
e.isLoaded && e.actionsLayout.length ? (
|
|
79
|
-
key:
|
|
91
|
+
e.isLoaded && (e.actionsLayout.length || e.$slots.actions) ? (s(), d(f, {
|
|
92
|
+
key: 2,
|
|
80
93
|
actions: e.actions,
|
|
81
94
|
"actions-layout": e.actionsLayout
|
|
82
95
|
}, {
|
|
83
|
-
default:
|
|
84
|
-
|
|
96
|
+
default: p(() => [
|
|
97
|
+
P(e.$slots, "actions")
|
|
85
98
|
]),
|
|
86
99
|
_: 3
|
|
87
|
-
}, 8, ["actions", "actions-layout"])) :
|
|
88
|
-
e.closable ? (
|
|
89
|
-
key:
|
|
100
|
+
}, 8, ["actions", "actions-layout"])) : r("", !0),
|
|
101
|
+
e.closable ? (s(), n("button", {
|
|
102
|
+
key: 3,
|
|
90
103
|
type: "button",
|
|
91
|
-
class:
|
|
104
|
+
class: l(e.className.element("close-btn")),
|
|
92
105
|
"aria-label": e.t("imagePreview.closeLabel"),
|
|
93
106
|
onClick: a[5] || (a[5] = (...o) => e.onCloseClick && e.onCloseClick(...o))
|
|
94
107
|
}, [
|
|
95
|
-
t(
|
|
96
|
-
], 10,
|
|
97
|
-
e.inGroup ? (
|
|
98
|
-
], 42,
|
|
99
|
-
],
|
|
100
|
-
], 8, ["to", "disabled"])) :
|
|
108
|
+
t(w)
|
|
109
|
+
], 10, S)) : r("", !0),
|
|
110
|
+
e.inGroup ? (s(), d(C, V(g({ key: 4 }, e.groupArrowProps)), null, 16)) : r("", !0)
|
|
111
|
+
], 42, D)) : r("", !0)
|
|
112
|
+
], 16)
|
|
113
|
+
], 8, ["to", "disabled"])) : r("", !0);
|
|
101
114
|
}
|
|
102
|
-
const
|
|
115
|
+
const q = /* @__PURE__ */ A(L, [["render", B]]);
|
|
103
116
|
export {
|
|
104
|
-
|
|
117
|
+
q as default
|
|
105
118
|
};
|