@veltra/desktop 1.11.0 → 1.12.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/dist/components/file-viewer/previewers/image-previewer.js +28 -124
- package/dist/components/file-viewer/previewers/image-previewer.js.map +1 -1
- package/dist/components/file-viewer/style2.css +0 -27
- package/dist/components/image-previewer/image-previewer.js +286 -0
- package/dist/components/image-previewer/image-previewer.js.map +1 -0
- package/dist/components/image-previewer/style.d.ts +1 -0
- package/dist/components/image-previewer/style.js +2 -0
- package/dist/components/image-previewer/style2.css +174 -0
- package/dist/components/index.d.ts +21 -20
- package/dist/components/index.js +41 -39
- package/dist/components/index.js.map +1 -1
- package/dist/index.d.ts +55 -53
- package/dist/index.js +54 -53
- package/dist/types/image-previewer.d.ts +48 -0
- package/dist/types/index.d.ts +2 -1
- package/package.json +1 -1
- package/src/components/file-viewer/__test__/file-viewer.test.ts +58 -0
- package/src/components/file-viewer/previewers/image-previewer.vue +25 -138
- package/src/components/file-viewer/style.scss +2 -33
- package/src/components/image-previewer/__test__/image-previewer.test.ts +292 -0
- package/src/components/image-previewer/image-previewer.vue +314 -0
- package/src/components/image-previewer/index.ts +1 -0
- package/src/components/image-previewer/style.scss +188 -0
- package/src/components/image-previewer/style.ts +2 -0
- package/src/components/index.ts +2 -0
- package/src/types/image-previewer.ts +50 -0
- package/src/types/index.ts +1 -0
|
@@ -1,149 +1,53 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import _sfc_main$1 from "../../image-previewer/image-previewer.js";
|
|
2
|
+
import { createBlock, defineComponent, normalizeClass, openBlock, unref, useTemplateRef } from "vue";
|
|
3
3
|
import { bem } from "@veltra/utils";
|
|
4
4
|
//#region src/components/file-viewer/previewers/image-previewer.vue
|
|
5
|
-
const _hoisted_1 = ["src", "alt"];
|
|
6
5
|
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
7
6
|
name: "UFileViewerImagePreviewer",
|
|
8
|
-
inheritAttrs: false,
|
|
9
7
|
__name: "image-previewer",
|
|
10
8
|
props: { file: {} },
|
|
11
9
|
emits: ["error", "zoom-change"],
|
|
12
10
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
13
|
-
const props = __props;
|
|
14
11
|
const emit = __emit;
|
|
15
12
|
const cls = bem("file-viewer");
|
|
16
|
-
const
|
|
17
|
-
const root = useTemplateRef("root");
|
|
18
|
-
const url = shallowRef("");
|
|
19
|
-
const loading = ref(true);
|
|
20
|
-
const failed = ref(false);
|
|
21
|
-
/** 缩放级别;缩放入口统一经 setScale 收敛到 [ZOOM_MIN, ZOOM_MAX] */
|
|
22
|
-
const scale = ref(1);
|
|
23
|
-
/** 拖拽起止各写一次,仅驱动 grabbing 光标 */
|
|
24
|
-
const isDragging = ref(false);
|
|
25
|
-
let panState;
|
|
26
|
-
let offsetX = 0;
|
|
27
|
-
let offsetY = 0;
|
|
28
|
-
/** transform 唯一写入口:直接写根元素 style,绕开响应式 */
|
|
29
|
-
function applyTransform() {
|
|
30
|
-
const el = root.value;
|
|
31
|
-
if (!el) return;
|
|
32
|
-
el.style.transform = `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${scale.value})`;
|
|
33
|
-
}
|
|
34
|
-
function setScale(value) {
|
|
35
|
-
scale.value = clampZoom(value);
|
|
36
|
-
if (scale.value <= 1) {
|
|
37
|
-
offsetX = 0;
|
|
38
|
-
offsetY = 0;
|
|
39
|
-
}
|
|
40
|
-
applyTransform();
|
|
41
|
-
emit("zoom-change", scale.value);
|
|
42
|
-
}
|
|
13
|
+
const previewer = useTemplateRef("previewer");
|
|
43
14
|
function zoomIn() {
|
|
44
|
-
|
|
15
|
+
previewer.value?.zoomIn();
|
|
45
16
|
}
|
|
46
17
|
function zoomOut() {
|
|
47
|
-
|
|
18
|
+
previewer.value?.zoomOut();
|
|
48
19
|
}
|
|
49
20
|
function resetZoom() {
|
|
50
|
-
|
|
21
|
+
previewer.value?.resetZoom();
|
|
22
|
+
}
|
|
23
|
+
function onZoomChange(level) {
|
|
24
|
+
emit("zoom-change", level);
|
|
25
|
+
}
|
|
26
|
+
function onError(err) {
|
|
27
|
+
emit("error", err);
|
|
51
28
|
}
|
|
52
29
|
__expose({
|
|
53
30
|
zoomIn,
|
|
54
31
|
zoomOut,
|
|
55
32
|
resetZoom
|
|
56
33
|
});
|
|
57
|
-
function onPointerDown(e) {
|
|
58
|
-
if (scale.value <= 1 || e.button !== 0) return;
|
|
59
|
-
panState = {
|
|
60
|
-
pointerId: e.pointerId,
|
|
61
|
-
startX: e.clientX,
|
|
62
|
-
startY: e.clientY,
|
|
63
|
-
originX: offsetX,
|
|
64
|
-
originY: offsetY
|
|
65
|
-
};
|
|
66
|
-
isDragging.value = true;
|
|
67
|
-
root.value?.setPointerCapture(e.pointerId);
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
}
|
|
70
|
-
function onPointerMove(e) {
|
|
71
|
-
if (!panState || panState.pointerId !== e.pointerId) return;
|
|
72
|
-
offsetX = panState.originX + e.clientX - panState.startX;
|
|
73
|
-
offsetY = panState.originY + e.clientY - panState.startY;
|
|
74
|
-
applyTransform();
|
|
75
|
-
}
|
|
76
|
-
function onPointerEnd(e) {
|
|
77
|
-
if (!panState || panState.pointerId !== e.pointerId) return;
|
|
78
|
-
const el = root.value;
|
|
79
|
-
if (el?.hasPointerCapture(e.pointerId)) el.releasePointerCapture(e.pointerId);
|
|
80
|
-
panState = void 0;
|
|
81
|
-
isDragging.value = false;
|
|
82
|
-
}
|
|
83
|
-
function onWheel(e) {
|
|
84
|
-
if (!(e.ctrlKey || e.metaKey)) return;
|
|
85
|
-
e.preventDefault();
|
|
86
|
-
setScale(scale.value + (e.deltaY > 0 ? -ZOOM_STEP : ZOOM_STEP));
|
|
87
|
-
}
|
|
88
|
-
function onDblclick() {
|
|
89
|
-
if (scale.value === 1) setScale(2);
|
|
90
|
-
else resetZoom();
|
|
91
|
-
}
|
|
92
|
-
let revoke;
|
|
93
|
-
function load() {
|
|
94
|
-
loading.value = true;
|
|
95
|
-
failed.value = false;
|
|
96
|
-
revoke?.();
|
|
97
|
-
const r = toBlobUrl(props.file.src, props.file.mime);
|
|
98
|
-
url.value = r.url;
|
|
99
|
-
revoke = r.revoke;
|
|
100
|
-
setScale(1);
|
|
101
|
-
}
|
|
102
|
-
function onImgError(e) {
|
|
103
|
-
loading.value = false;
|
|
104
|
-
failed.value = true;
|
|
105
|
-
emit("error", e);
|
|
106
|
-
}
|
|
107
|
-
watch(() => props.file.src, () => load(), { immediate: true });
|
|
108
|
-
onBeforeUnmount(() => {
|
|
109
|
-
revoke?.();
|
|
110
|
-
url.value = "";
|
|
111
|
-
});
|
|
112
34
|
return (_ctx, _cache) => {
|
|
113
|
-
return openBlock(),
|
|
114
|
-
ref_key: "
|
|
115
|
-
ref:
|
|
116
|
-
class:
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
url.value ? (openBlock(), createElementBlock("img", {
|
|
130
|
-
key: 0,
|
|
131
|
-
src: url.value,
|
|
132
|
-
alt: __props.file.name,
|
|
133
|
-
draggable: "false",
|
|
134
|
-
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
135
|
-
onLoad: _cache[1] || (_cache[1] = ($event) => loading.value = false),
|
|
136
|
-
onError: onImgError
|
|
137
|
-
}, null, 40, _hoisted_1)) : createCommentVNode("v-if", true),
|
|
138
|
-
loading.value ? (openBlock(), createElementBlock("div", {
|
|
139
|
-
key: 1,
|
|
140
|
-
class: normalizeClass(unref(cls).e("loading"))
|
|
141
|
-
}, "加载中…", 2)) : createCommentVNode("v-if", true),
|
|
142
|
-
failed.value ? (openBlock(), createElementBlock("div", {
|
|
143
|
-
key: 2,
|
|
144
|
-
class: normalizeClass(unref(cls).e("loading"))
|
|
145
|
-
}, "图片加载失败", 2)) : createCommentVNode("v-if", true)
|
|
146
|
-
], 16);
|
|
35
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
|
36
|
+
ref_key: "previewer",
|
|
37
|
+
ref: previewer,
|
|
38
|
+
class: normalizeClass(unref(cls).e("image")),
|
|
39
|
+
src: __props.file.src,
|
|
40
|
+
alt: __props.file.name,
|
|
41
|
+
mime: __props.file.mime,
|
|
42
|
+
modal: false,
|
|
43
|
+
onZoomChange,
|
|
44
|
+
onError
|
|
45
|
+
}, null, 8, [
|
|
46
|
+
"class",
|
|
47
|
+
"src",
|
|
48
|
+
"alt",
|
|
49
|
+
"mime"
|
|
50
|
+
]);
|
|
147
51
|
};
|
|
148
52
|
}
|
|
149
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-previewer.js","names":["_openBlock","
|
|
1
|
+
{"version":3,"file":"image-previewer.js","names":["_openBlock","_createBlock","UImagePreviewer","_normalizeClass","_unref"],"sources":["../../../../src/components/file-viewer/previewers/image-previewer.vue"],"sourcesContent":["<template>\n <UImagePreviewer\n ref=\"previewer\"\n :class=\"cls.e('image')\"\n :src=\"file.src\"\n :alt=\"file.name\"\n :mime=\"file.mime\"\n :modal=\"false\"\n @zoom-change=\"onZoomChange\"\n @error=\"onError\"\n />\n</template>\n\n<script lang=\"ts\" setup>\nimport { bem } from '@veltra/utils'\nimport { useTemplateRef } from 'vue'\n\nimport type { FileViewerItem } from '../../../types/file-viewer'\nimport type { ImagePreviewerExposed } from '../../../types/image-previewer'\nimport UImagePreviewer from '../../image-previewer/image-previewer.vue'\n\ndefineOptions({ name: 'UFileViewerImagePreviewer' })\n\ndefineProps<{ file: FileViewerItem }>()\n\nconst emit = defineEmits<{\n (e: 'error', err: unknown): void\n (e: 'zoom-change', level: number): void\n}>()\n\nconst cls = bem('file-viewer')\n\n// 缩放命令转发给内嵌预览面,file-viewer 工具栏经本 expose 驱动\nconst previewer = useTemplateRef<ImagePreviewerExposed>('previewer')\n\nfunction zoomIn() {\n previewer.value?.zoomIn()\n}\n\nfunction zoomOut() {\n previewer.value?.zoomOut()\n}\n\nfunction resetZoom() {\n previewer.value?.resetZoom()\n}\n\nfunction onZoomChange(level: number) {\n emit('zoom-change', level)\n}\n\nfunction onError(err: unknown) {\n emit('error', err)\n}\n\ndefineExpose({ zoomIn, zoomOut, resetZoom })\n</script>\n"],"mappings":";;;;;;;;;;EAyBA,MAAM,OAAO;EAKb,MAAM,MAAM,IAAI,aAAa;EAG7B,MAAM,YAAY,eAAsC,WAAW;EAEnE,SAAS,SAAS;GAChB,UAAU,OAAO,OAAO;EAC1B;EAEA,SAAS,UAAU;GACjB,UAAU,OAAO,QAAQ;EAC3B;EAEA,SAAS,YAAY;GACnB,UAAU,OAAO,UAAU;EAC7B;EAEA,SAAS,aAAa,OAAe;GACnC,KAAK,eAAe,KAAK;EAC3B;EAEA,SAAS,QAAQ,KAAc;GAC7B,KAAK,SAAS,GAAG;EACnB;EAEA,SAAa;GAAE;GAAQ;GAAS;EAAU,CAAC;;GAtDzC,OAAAA,UAAA,GAAAC,YASEC,aAAA;IARI,SAAA;IAAJ,KAAI;IACH,OAAKC,eAAEC,MAAA,GAAA,CAAG,CAAC,EAAC,OAAA,CAAA;IACZ,KAAK,QAAA,KAAK;IACV,KAAK,QAAA,KAAK;IACV,MAAM,QAAA,KAAK;IACX,OAAO;IACM;IACN"}
|
|
@@ -385,33 +385,6 @@
|
|
|
385
385
|
justify-content: center;
|
|
386
386
|
color: var(--u-text-color-second);
|
|
387
387
|
}
|
|
388
|
-
.u-file-viewer__image {
|
|
389
|
-
position: absolute;
|
|
390
|
-
inset: 0;
|
|
391
|
-
display: flex;
|
|
392
|
-
align-items: center;
|
|
393
|
-
justify-content: center;
|
|
394
|
-
padding: clamp(20px, 3vw, 44px);
|
|
395
|
-
user-select: none;
|
|
396
|
-
transform-origin: center center;
|
|
397
|
-
transition: transform var(--u-transition-fast) var(--u-transition-ease);
|
|
398
|
-
will-change: transform;
|
|
399
|
-
}
|
|
400
|
-
.u-file-viewer__image.is-pannable {
|
|
401
|
-
cursor: grab;
|
|
402
|
-
touch-action: none;
|
|
403
|
-
}
|
|
404
|
-
.u-file-viewer__image.is-dragging {
|
|
405
|
-
cursor: grabbing;
|
|
406
|
-
transition: none;
|
|
407
|
-
}
|
|
408
|
-
.u-file-viewer__image img {
|
|
409
|
-
max-width: 100%;
|
|
410
|
-
max-height: 100%;
|
|
411
|
-
object-fit: contain;
|
|
412
|
-
border-radius: 6px;
|
|
413
|
-
background: var(--u-file-viewer-light-surface);
|
|
414
|
-
}
|
|
415
388
|
.u-file-viewer.is-modal .u-file-viewer__image {
|
|
416
389
|
padding: clamp(18px, 4vw, 64px);
|
|
417
390
|
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
import _sfc_main$1 from "../icon/icon.js";
|
|
2
|
+
import { ZOOM_MIN, ZOOM_STEP, clampZoom, toBlobUrl } from "../file-viewer/helper.js";
|
|
3
|
+
import { Fragment, Teleport, Transition, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createVNode, defineComponent, mergeModels, mergeProps, normalizeClass, onBeforeUnmount, openBlock, ref, shallowRef, toDisplayString, unref, useAttrs, useModel, useTemplateRef, watch, withCtx, withModifiers } from "vue";
|
|
4
|
+
import { bem } from "@veltra/utils";
|
|
5
|
+
import { Close, Refresh, ZoomIn, ZoomOut } from "@veltra/icons/normal";
|
|
6
|
+
//#region src/components/image-previewer/image-previewer.vue
|
|
7
|
+
const _hoisted_1 = ["src", "alt"];
|
|
8
|
+
const _hoisted_2 = ["disabled"];
|
|
9
|
+
const _hoisted_3 = ["disabled"];
|
|
10
|
+
const _hoisted_4 = ["disabled"];
|
|
11
|
+
const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
12
|
+
name: "UImagePreviewer",
|
|
13
|
+
inheritAttrs: false,
|
|
14
|
+
__name: "image-previewer",
|
|
15
|
+
props: /*@__PURE__*/ mergeModels({
|
|
16
|
+
src: {},
|
|
17
|
+
alt: {},
|
|
18
|
+
mime: {},
|
|
19
|
+
modal: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
open: { type: Boolean },
|
|
24
|
+
closeOnClickBackdrop: {
|
|
25
|
+
type: Boolean,
|
|
26
|
+
default: true
|
|
27
|
+
},
|
|
28
|
+
closeOnEsc: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: true
|
|
31
|
+
}
|
|
32
|
+
}, {
|
|
33
|
+
"open": {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true
|
|
36
|
+
},
|
|
37
|
+
"openModifiers": {}
|
|
38
|
+
}),
|
|
39
|
+
emits: /*@__PURE__*/ mergeModels([
|
|
40
|
+
"update:open",
|
|
41
|
+
"close",
|
|
42
|
+
"zoom-change",
|
|
43
|
+
"error"
|
|
44
|
+
], ["update:open"]),
|
|
45
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
46
|
+
const emit = __emit;
|
|
47
|
+
const cls = bem("image-previewer");
|
|
48
|
+
const attrs = useAttrs();
|
|
49
|
+
const stage = useTemplateRef("stage");
|
|
50
|
+
const open = useModel(__props, "open");
|
|
51
|
+
const url = shallowRef("");
|
|
52
|
+
const loading = ref(false);
|
|
53
|
+
const failed = ref(false);
|
|
54
|
+
/** 缩放级别;缩放入口统一经 setScale 收敛到 [ZOOM_MIN, ZOOM_MAX] */
|
|
55
|
+
const scale = ref(1);
|
|
56
|
+
/** 拖拽起止各写一次,仅驱动 grabbing 光标 */
|
|
57
|
+
const isDragging = ref(false);
|
|
58
|
+
const zoomPercent = computed(() => `${Math.round(scale.value * 100)}%`);
|
|
59
|
+
let panState;
|
|
60
|
+
let offsetX = 0;
|
|
61
|
+
let offsetY = 0;
|
|
62
|
+
/** transform 唯一写入口:直接写预览面 style,绕开响应式 */
|
|
63
|
+
function applyTransform() {
|
|
64
|
+
const el = stage.value;
|
|
65
|
+
if (!el) return;
|
|
66
|
+
el.style.transform = `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${scale.value})`;
|
|
67
|
+
}
|
|
68
|
+
function setScale(value) {
|
|
69
|
+
scale.value = clampZoom(value);
|
|
70
|
+
if (scale.value <= 1) {
|
|
71
|
+
offsetX = 0;
|
|
72
|
+
offsetY = 0;
|
|
73
|
+
}
|
|
74
|
+
applyTransform();
|
|
75
|
+
emit("zoom-change", scale.value);
|
|
76
|
+
}
|
|
77
|
+
function zoomIn() {
|
|
78
|
+
setScale(scale.value + ZOOM_STEP);
|
|
79
|
+
}
|
|
80
|
+
function zoomOut() {
|
|
81
|
+
setScale(scale.value - ZOOM_STEP);
|
|
82
|
+
}
|
|
83
|
+
function resetZoom() {
|
|
84
|
+
setScale(1);
|
|
85
|
+
}
|
|
86
|
+
__expose({
|
|
87
|
+
zoomIn,
|
|
88
|
+
zoomOut,
|
|
89
|
+
resetZoom
|
|
90
|
+
});
|
|
91
|
+
function onPointerDown(e) {
|
|
92
|
+
if (scale.value <= 1 || e.button !== 0) return;
|
|
93
|
+
panState = {
|
|
94
|
+
pointerId: e.pointerId,
|
|
95
|
+
startX: e.clientX,
|
|
96
|
+
startY: e.clientY,
|
|
97
|
+
originX: offsetX,
|
|
98
|
+
originY: offsetY
|
|
99
|
+
};
|
|
100
|
+
isDragging.value = true;
|
|
101
|
+
stage.value?.setPointerCapture(e.pointerId);
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
}
|
|
104
|
+
function onPointerMove(e) {
|
|
105
|
+
if (!panState || panState.pointerId !== e.pointerId) return;
|
|
106
|
+
offsetX = panState.originX + e.clientX - panState.startX;
|
|
107
|
+
offsetY = panState.originY + e.clientY - panState.startY;
|
|
108
|
+
applyTransform();
|
|
109
|
+
}
|
|
110
|
+
function onPointerEnd(e) {
|
|
111
|
+
if (!panState || panState.pointerId !== e.pointerId) return;
|
|
112
|
+
const el = stage.value;
|
|
113
|
+
if (el?.hasPointerCapture(e.pointerId)) el.releasePointerCapture(e.pointerId);
|
|
114
|
+
panState = void 0;
|
|
115
|
+
isDragging.value = false;
|
|
116
|
+
}
|
|
117
|
+
function onWheel(e) {
|
|
118
|
+
if (!(e.ctrlKey || e.metaKey)) return;
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
setScale(scale.value + (e.deltaY > 0 ? -ZOOM_STEP : ZOOM_STEP));
|
|
121
|
+
}
|
|
122
|
+
function onDblclick() {
|
|
123
|
+
if (scale.value === 1) setScale(2);
|
|
124
|
+
else resetZoom();
|
|
125
|
+
}
|
|
126
|
+
function onBackdropMousedown() {
|
|
127
|
+
if (!__props.modal) return;
|
|
128
|
+
if (__props.closeOnClickBackdrop === false) return;
|
|
129
|
+
if (scale.value > 1) return;
|
|
130
|
+
close();
|
|
131
|
+
}
|
|
132
|
+
function close() {
|
|
133
|
+
if (!__props.modal) return;
|
|
134
|
+
open.value = false;
|
|
135
|
+
emit("close");
|
|
136
|
+
}
|
|
137
|
+
function handleWindowKeydown(e) {
|
|
138
|
+
if (e.key !== "Escape") return;
|
|
139
|
+
if (!__props.modal || !open.value) return;
|
|
140
|
+
if (__props.closeOnEsc === false) return;
|
|
141
|
+
e.stopPropagation();
|
|
142
|
+
close();
|
|
143
|
+
}
|
|
144
|
+
let revoke;
|
|
145
|
+
function load() {
|
|
146
|
+
if (__props.src === void 0 || __props.src === null) {
|
|
147
|
+
revoke?.();
|
|
148
|
+
revoke = void 0;
|
|
149
|
+
url.value = "";
|
|
150
|
+
loading.value = false;
|
|
151
|
+
failed.value = false;
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
loading.value = true;
|
|
155
|
+
failed.value = false;
|
|
156
|
+
revoke?.();
|
|
157
|
+
const r = toBlobUrl(__props.src, __props.mime);
|
|
158
|
+
url.value = r.url;
|
|
159
|
+
revoke = r.revoke;
|
|
160
|
+
setScale(1);
|
|
161
|
+
}
|
|
162
|
+
function onImgError(e) {
|
|
163
|
+
loading.value = false;
|
|
164
|
+
failed.value = true;
|
|
165
|
+
emit("error", e);
|
|
166
|
+
}
|
|
167
|
+
watch(() => __props.src, () => load(), { immediate: true });
|
|
168
|
+
let previousBodyOverflow = "";
|
|
169
|
+
let isBodyLocked = false;
|
|
170
|
+
function lockBody() {
|
|
171
|
+
if (isBodyLocked || typeof document === "undefined") return;
|
|
172
|
+
previousBodyOverflow = document.body.style.overflow;
|
|
173
|
+
document.body.style.overflow = "hidden";
|
|
174
|
+
isBodyLocked = true;
|
|
175
|
+
}
|
|
176
|
+
function unlockBody() {
|
|
177
|
+
if (!isBodyLocked || typeof document === "undefined") return;
|
|
178
|
+
document.body.style.overflow = previousBodyOverflow;
|
|
179
|
+
isBodyLocked = false;
|
|
180
|
+
}
|
|
181
|
+
watch([() => __props.modal, open], ([modalOpen, openNow], _, onCleanup) => {
|
|
182
|
+
onCleanup(() => {
|
|
183
|
+
unlockBody();
|
|
184
|
+
if (typeof window !== "undefined") window.removeEventListener("keydown", handleWindowKeydown, true);
|
|
185
|
+
});
|
|
186
|
+
if (modalOpen && openNow) {
|
|
187
|
+
lockBody();
|
|
188
|
+
if (typeof window !== "undefined") window.addEventListener("keydown", handleWindowKeydown, true);
|
|
189
|
+
} else unlockBody();
|
|
190
|
+
}, { immediate: true });
|
|
191
|
+
onBeforeUnmount(() => {
|
|
192
|
+
revoke?.();
|
|
193
|
+
url.value = "";
|
|
194
|
+
});
|
|
195
|
+
return (_ctx, _cache) => {
|
|
196
|
+
return openBlock(), createBlock(Teleport, {
|
|
197
|
+
to: "body",
|
|
198
|
+
disabled: !__props.modal
|
|
199
|
+
}, [createVNode(Transition, { name: __props.modal ? "u-image-previewer-fade" : "" }, {
|
|
200
|
+
default: withCtx(() => [!__props.modal || open.value ? (openBlock(), createElementBlock("div", {
|
|
201
|
+
key: 0,
|
|
202
|
+
class: normalizeClass([unref(cls).b, unref(bem).is("modal", __props.modal)])
|
|
203
|
+
}, [createElementVNode("div", mergeProps({
|
|
204
|
+
ref_key: "stage",
|
|
205
|
+
ref: stage,
|
|
206
|
+
class: [
|
|
207
|
+
unref(cls).e("stage"),
|
|
208
|
+
unref(bem).is("pannable", scale.value > 1),
|
|
209
|
+
unref(bem).is("dragging", isDragging.value)
|
|
210
|
+
]
|
|
211
|
+
}, unref(attrs), {
|
|
212
|
+
onMousedown: withModifiers(onBackdropMousedown, ["self"]),
|
|
213
|
+
onPointerdown: onPointerDown,
|
|
214
|
+
onPointermove: onPointerMove,
|
|
215
|
+
onPointerup: onPointerEnd,
|
|
216
|
+
onPointercancel: onPointerEnd,
|
|
217
|
+
onWheel,
|
|
218
|
+
onDblclick
|
|
219
|
+
}), [url.value ? (openBlock(), createElementBlock("img", {
|
|
220
|
+
key: 0,
|
|
221
|
+
src: url.value,
|
|
222
|
+
alt: __props.alt ?? "图片预览",
|
|
223
|
+
draggable: "false",
|
|
224
|
+
onDragstart: _cache[0] || (_cache[0] = withModifiers(() => {}, ["prevent"])),
|
|
225
|
+
onLoad: _cache[1] || (_cache[1] = ($event) => loading.value = false),
|
|
226
|
+
onError: onImgError
|
|
227
|
+
}, null, 40, _hoisted_1)) : createCommentVNode("v-if", true), loading.value ? (openBlock(), createElementBlock("div", {
|
|
228
|
+
key: 1,
|
|
229
|
+
class: normalizeClass(unref(cls).e("loading"))
|
|
230
|
+
}, "加载中…", 2)) : failed.value ? (openBlock(), createElementBlock("div", {
|
|
231
|
+
key: 2,
|
|
232
|
+
class: normalizeClass(unref(cls).e("loading"))
|
|
233
|
+
}, "图片加载失败", 2)) : createCommentVNode("v-if", true)], 16), __props.modal ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createElementVNode("button", {
|
|
234
|
+
class: normalizeClass(unref(cls).e("close")),
|
|
235
|
+
type: "button",
|
|
236
|
+
"aria-label": "关闭",
|
|
237
|
+
title: "关闭",
|
|
238
|
+
onClick: close
|
|
239
|
+
}, [createVNode(unref(_sfc_main$1), { size: 18 }, {
|
|
240
|
+
default: withCtx(() => [createVNode(unref(Close))]),
|
|
241
|
+
_: 1
|
|
242
|
+
})], 2), createElementVNode("div", { class: normalizeClass(unref(cls).e("toolbar")) }, [
|
|
243
|
+
createElementVNode("button", {
|
|
244
|
+
class: normalizeClass(unref(cls).e("tool")),
|
|
245
|
+
type: "button",
|
|
246
|
+
disabled: scale.value <= unref(ZOOM_MIN),
|
|
247
|
+
"aria-label": "缩小",
|
|
248
|
+
title: "缩小",
|
|
249
|
+
onClick: zoomOut
|
|
250
|
+
}, [createVNode(unref(_sfc_main$1), { size: 16 }, {
|
|
251
|
+
default: withCtx(() => [createVNode(unref(ZoomOut))]),
|
|
252
|
+
_: 1
|
|
253
|
+
})], 10, _hoisted_2),
|
|
254
|
+
createElementVNode("span", { class: normalizeClass(unref(cls).e("zoom-value")) }, toDisplayString(zoomPercent.value), 3),
|
|
255
|
+
createElementVNode("button", {
|
|
256
|
+
class: normalizeClass(unref(cls).e("tool")),
|
|
257
|
+
type: "button",
|
|
258
|
+
disabled: scale.value >= unref(3),
|
|
259
|
+
"aria-label": "放大",
|
|
260
|
+
title: "放大",
|
|
261
|
+
onClick: zoomIn
|
|
262
|
+
}, [createVNode(unref(_sfc_main$1), { size: 16 }, {
|
|
263
|
+
default: withCtx(() => [createVNode(unref(ZoomIn))]),
|
|
264
|
+
_: 1
|
|
265
|
+
})], 10, _hoisted_3),
|
|
266
|
+
createElementVNode("button", {
|
|
267
|
+
class: normalizeClass(unref(cls).e("tool")),
|
|
268
|
+
type: "button",
|
|
269
|
+
disabled: scale.value === 1,
|
|
270
|
+
"aria-label": "重置视图",
|
|
271
|
+
title: "重置视图",
|
|
272
|
+
onClick: resetZoom
|
|
273
|
+
}, [createVNode(unref(_sfc_main$1), { size: 16 }, {
|
|
274
|
+
default: withCtx(() => [createVNode(unref(Refresh))]),
|
|
275
|
+
_: 1
|
|
276
|
+
})], 10, _hoisted_4)
|
|
277
|
+
], 2)], 64)) : createCommentVNode("v-if", true)], 2)) : createCommentVNode("v-if", true)]),
|
|
278
|
+
_: 1
|
|
279
|
+
}, 8, ["name"])], 8, ["disabled"]);
|
|
280
|
+
};
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
//#endregion
|
|
284
|
+
export { _sfc_main as default };
|
|
285
|
+
|
|
286
|
+
//# sourceMappingURL=image-previewer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-previewer.js","names":["_useModel","_openBlock","_createBlock","_Teleport","_createVNode","_Transition","_withCtx","_createElementBlock","_normalizeClass","_unref","_createElementVNode","_mergeProps","_withModifiers","_createCommentVNode","_Fragment","UIcon","_toDisplayString"],"sources":["../../../src/components/image-previewer/image-previewer.vue"],"sourcesContent":["<template>\n <Teleport to=\"body\" :disabled=\"!modal\">\n <transition :name=\"modal ? 'u-image-previewer-fade' : ''\">\n <div v-if=\"!modal || open\" :class=\"[cls.b, bem.is('modal', modal)]\">\n <div\n ref=\"stage\"\n :class=\"[cls.e('stage'), bem.is('pannable', scale > 1), bem.is('dragging', isDragging)]\"\n v-bind=\"attrs\"\n @mousedown.self=\"onBackdropMousedown\"\n @pointerdown=\"onPointerDown\"\n @pointermove=\"onPointerMove\"\n @pointerup=\"onPointerEnd\"\n @pointercancel=\"onPointerEnd\"\n @wheel=\"onWheel\"\n @dblclick=\"onDblclick\"\n >\n <img\n v-if=\"url\"\n :src=\"url\"\n :alt=\"alt ?? '图片预览'\"\n draggable=\"false\"\n @dragstart.prevent\n @load=\"loading = false\"\n @error=\"onImgError\"\n />\n <div v-if=\"loading\" :class=\"cls.e('loading')\">加载中…</div>\n <div v-else-if=\"failed\" :class=\"cls.e('loading')\">图片加载失败</div>\n </div>\n\n <template v-if=\"modal\">\n <button\n :class=\"cls.e('close')\"\n type=\"button\"\n aria-label=\"关闭\"\n title=\"关闭\"\n @click=\"close\"\n >\n <u-icon :size=\"18\">\n <Close />\n </u-icon>\n </button>\n <div :class=\"cls.e('toolbar')\">\n <button\n :class=\"cls.e('tool')\"\n type=\"button\"\n :disabled=\"scale <= ZOOM_MIN\"\n aria-label=\"缩小\"\n title=\"缩小\"\n @click=\"zoomOut\"\n >\n <u-icon :size=\"16\">\n <ZoomOut />\n </u-icon>\n </button>\n <span :class=\"cls.e('zoom-value')\">{{ zoomPercent }}</span>\n <button\n :class=\"cls.e('tool')\"\n type=\"button\"\n :disabled=\"scale >= ZOOM_MAX\"\n aria-label=\"放大\"\n title=\"放大\"\n @click=\"zoomIn\"\n >\n <u-icon :size=\"16\">\n <ZoomIn />\n </u-icon>\n </button>\n <button\n :class=\"cls.e('tool')\"\n type=\"button\"\n :disabled=\"scale === 1\"\n aria-label=\"重置视图\"\n title=\"重置视图\"\n @click=\"resetZoom\"\n >\n <u-icon :size=\"16\">\n <Refresh />\n </u-icon>\n </button>\n </div>\n </template>\n </div>\n </transition>\n </Teleport>\n</template>\n\n<script lang=\"ts\" setup>\nimport { Close, Refresh, ZoomIn, ZoomOut } from '@veltra/icons/normal'\nimport { bem } from '@veltra/utils'\nimport { computed, onBeforeUnmount, ref, shallowRef, useAttrs, useTemplateRef, watch } from 'vue'\n\nimport type {\n ImagePreviewerEmits,\n ImagePreviewerExposed,\n ImagePreviewerProps\n} from '../../types/image-previewer'\nimport { ZOOM_MAX, ZOOM_MIN, ZOOM_STEP, clampZoom, toBlobUrl } from '../file-viewer/helper'\nimport { UIcon } from '../icon'\n\n// 根为 Teleport,无 fallthrough 落点:attrs(含宿主 class)由内层预览面承接\ndefineOptions({ name: 'UImagePreviewer', inheritAttrs: false })\n\nconst {\n src,\n alt,\n mime,\n modal = true,\n closeOnClickBackdrop = true,\n closeOnEsc = true\n} = defineProps<ImagePreviewerProps>()\n\nconst emit = defineEmits<ImagePreviewerEmits>()\n\nconst cls = bem('image-previewer')\nconst attrs = useAttrs()\n\nconst stage = useTemplateRef<HTMLDivElement>('stage')\n\nconst open = defineModel<boolean>('open', { default: true })\n\nconst url = shallowRef<string>('')\nconst loading = ref(false)\nconst failed = ref(false)\n\n/** 缩放级别;缩放入口统一经 setScale 收敛到 [ZOOM_MIN, ZOOM_MAX] */\nconst scale = ref(1)\n/** 拖拽起止各写一次,仅驱动 grabbing 光标 */\nconst isDragging = ref(false)\n\nconst zoomPercent = computed(() => `${Math.round(scale.value * 100)}%`)\n\n// ---- pan 热状态:全部走普通变量,pointermove 不触发重渲染 ----\nlet panState:\n | { pointerId: number; startX: number; startY: number; originX: number; originY: number }\n | undefined\nlet offsetX = 0\nlet offsetY = 0\n\n/** transform 唯一写入口:直接写预览面 style,绕开响应式 */\nfunction applyTransform() {\n const el = stage.value\n if (!el) return\n el.style.transform = `translate3d(${offsetX}px, ${offsetY}px, 0) scale(${scale.value})`\n}\n\nfunction setScale(value: number) {\n scale.value = clampZoom(value)\n if (scale.value <= 1) {\n // 未放大时不允许平移,offset 归零\n offsetX = 0\n offsetY = 0\n }\n applyTransform()\n emit('zoom-change', scale.value)\n}\n\nfunction zoomIn() {\n setScale(scale.value + ZOOM_STEP)\n}\n\nfunction zoomOut() {\n setScale(scale.value - ZOOM_STEP)\n}\n\nfunction resetZoom() {\n setScale(1)\n}\n\ndefineExpose<ImagePreviewerExposed>({ zoomIn, zoomOut, resetZoom })\n\nfunction onPointerDown(e: PointerEvent) {\n if (scale.value <= 1 || e.button !== 0) return\n panState = {\n pointerId: e.pointerId,\n startX: e.clientX,\n startY: e.clientY,\n originX: offsetX,\n originY: offsetY\n }\n isDragging.value = true\n stage.value?.setPointerCapture(e.pointerId)\n e.preventDefault()\n}\n\nfunction onPointerMove(e: PointerEvent) {\n if (!panState || panState.pointerId !== e.pointerId) return\n offsetX = panState.originX + e.clientX - panState.startX\n offsetY = panState.originY + e.clientY - panState.startY\n applyTransform()\n}\n\nfunction onPointerEnd(e: PointerEvent) {\n if (!panState || panState.pointerId !== e.pointerId) return\n const el = stage.value\n if (el?.hasPointerCapture(e.pointerId)) {\n el.releasePointerCapture(e.pointerId)\n }\n panState = undefined\n isDragging.value = false\n}\n\nfunction onWheel(e: WheelEvent) {\n if (!(e.ctrlKey || e.metaKey)) return\n e.preventDefault()\n setScale(scale.value + (e.deltaY > 0 ? -ZOOM_STEP : ZOOM_STEP))\n}\n\nfunction onDblclick() {\n if (scale.value === 1) {\n setScale(2)\n } else {\n resetZoom()\n }\n}\n\nfunction onBackdropMousedown() {\n if (!modal) return\n if (closeOnClickBackdrop === false) return\n // 放大后空白区域是平移热区,不作为关闭入口\n if (scale.value > 1) return\n close()\n}\n\nfunction close() {\n if (!modal) return\n open.value = false\n emit('close')\n}\n\nfunction handleWindowKeydown(e: KeyboardEvent) {\n if (e.key !== 'Escape') return\n if (!modal || !open.value) return\n if (closeOnEsc === false) return\n e.stopPropagation()\n close()\n}\n\nlet revoke: (() => void) | undefined\n\nfunction load() {\n if (src === undefined || src === null) {\n revoke?.()\n revoke = undefined\n url.value = ''\n loading.value = false\n failed.value = false\n return\n }\n loading.value = true\n failed.value = false\n revoke?.()\n const r = toBlobUrl(src, mime)\n url.value = r.url\n revoke = r.revoke\n // 新图回到初始视图,并同步工具栏回显\n setScale(1)\n}\n\nfunction onImgError(e: Event) {\n loading.value = false\n failed.value = true\n emit('error', e)\n}\n\nwatch(\n () => src,\n () => load(),\n { immediate: true }\n)\n\n// lightbox 打开时:锁定 body 滚动 + 挂 Esc 监听\nlet previousBodyOverflow = ''\nlet isBodyLocked = false\n\nfunction lockBody() {\n if (isBodyLocked || typeof document === 'undefined') return\n previousBodyOverflow = document.body.style.overflow\n document.body.style.overflow = 'hidden'\n isBodyLocked = true\n}\n\nfunction unlockBody() {\n if (!isBodyLocked || typeof document === 'undefined') return\n document.body.style.overflow = previousBodyOverflow\n isBodyLocked = false\n}\n\nwatch(\n [() => modal, open],\n ([modalOpen, openNow], _, onCleanup) => {\n // 依赖重跑前与作用域销毁时统一解锁 + 摘除 keydown 监听\n onCleanup(() => {\n unlockBody()\n if (typeof window !== 'undefined') {\n window.removeEventListener('keydown', handleWindowKeydown, true)\n }\n })\n if (modalOpen && openNow) {\n lockBody()\n if (typeof window !== 'undefined') {\n window.addEventListener('keydown', handleWindowKeydown, true)\n }\n } else {\n unlockBody()\n }\n },\n { immediate: true }\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