@v-c/image 1.0.0 → 1.0.2
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/Preview/index.js +1 -1
- package/package.json +4 -4
- package/dist/Image.cjs +0 -231
- package/dist/Preview/CloseBtn.cjs +0 -44
- package/dist/Preview/Footer.cjs +0 -234
- package/dist/Preview/PrevNext.cjs +0 -59
- package/dist/Preview/index.cjs +0 -404
- package/dist/PreviewGroup.cjs +0 -138
- package/dist/common.cjs +0 -13
- package/dist/context.cjs +0 -11
- package/dist/getFixScaleEleTransPosition.cjs +0 -28
- package/dist/hooks/useImageTransform.cjs +0 -99
- package/dist/hooks/useMouseEvent.cjs +0 -96
- package/dist/hooks/usePreviewItems.cjs +0 -48
- package/dist/hooks/useRegisterImage.cjs +0 -28
- package/dist/hooks/useStatus.cjs +0 -49
- package/dist/hooks/useTouchEvent.cjs +0 -125
- package/dist/index.cjs +0 -11
- package/dist/interface.cjs +0 -1
- package/dist/portal/dist/Context.cjs +0 -12
- package/dist/portal/dist/Portal.cjs +0 -100
- package/dist/portal/dist/index.cjs +0 -3
- package/dist/portal/dist/useDom.cjs +0 -47
- package/dist/portal/dist/useEscKeyDown.cjs +0 -57
- package/dist/portal/dist/useScrollLocker.cjs +0 -28
- package/dist/portal/dist/util.cjs +0 -4
- package/dist/previewConfig.cjs +0 -5
- package/dist/util/dist/Dom/canUseDom.cjs +0 -4
- package/dist/util/dist/Dom/contains.cjs +0 -11
- package/dist/util/dist/Dom/dynamicCSS.cjs +0 -80
- package/dist/util/dist/KeyCode.cjs +0 -81
- package/dist/util/dist/RenderComponent.cjs +0 -29
- package/dist/util/dist/classnames.cjs +0 -36
- package/dist/util/dist/getScrollBarSize.cjs +0 -53
- package/dist/util/dist/hooks/useId.cjs +0 -5
- package/dist/util/dist/hooks/useMergedState.cjs +0 -24
- package/dist/util/dist/index.cjs +0 -7
- package/dist/util/dist/isEqual.cjs +0 -27
- package/dist/util/dist/omit.cjs +0 -8
- package/dist/util/dist/pickAttrs.cjs +0 -39
- package/dist/util/dist/props-util/index.cjs +0 -47
- package/dist/util/dist/raf.cjs +0 -36
- package/dist/util/dist/type.cjs +0 -2
- package/dist/util/dist/utils/transition.cjs +0 -21
- package/dist/util/dist/warning.cjs +0 -37
- package/dist/util.cjs +0 -27
package/dist/Preview/index.js
CHANGED
|
@@ -95,7 +95,7 @@ var Preview_default = /* @__PURE__ */ defineComponent((props, { attrs, slots })
|
|
|
95
95
|
watch(() => props.open, (open) => {
|
|
96
96
|
if (open) lockScroll.value = true;
|
|
97
97
|
});
|
|
98
|
-
const portalRender = shallowRef(false);
|
|
98
|
+
const portalRender = shallowRef(props?.open ?? false);
|
|
99
99
|
watch(() => props.open, (open) => {
|
|
100
100
|
if (open) portalRender.value = true;
|
|
101
101
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@v-c/image",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.2",
|
|
5
5
|
"description": "image component",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "MIT",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
".": {
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js",
|
|
17
|
-
"
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./dist/*": "./dist/*",
|
|
20
20
|
"./package.json": "./package.json"
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"vue": "^3.0.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@v-c/util": "^1.0.
|
|
36
|
-
"@v-c/portal": "^1.0.
|
|
35
|
+
"@v-c/util": "^1.0.9",
|
|
36
|
+
"@v-c/portal": "^1.0.6"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@ant-design/icons-vue": "^7.0.1"
|
package/dist/Image.cjs
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
const require_index = require("./util/dist/props-util/index.cjs");
|
|
6
|
-
const require_classnames = require("./util/dist/classnames.cjs");
|
|
7
|
-
const require_useMergedState = require("./util/dist/hooks/useMergedState.cjs");
|
|
8
|
-
require("./util/dist/index.cjs");
|
|
9
|
-
const require_pickAttrs = require("./util/dist/pickAttrs.cjs");
|
|
10
|
-
const require_common = require("./common.cjs");
|
|
11
|
-
const require_context = require("./context.cjs");
|
|
12
|
-
const require_useRegisterImage = require("./hooks/useRegisterImage.cjs");
|
|
13
|
-
const require_useStatus = require("./hooks/useStatus.cjs");
|
|
14
|
-
const require_index$2 = require("./Preview/index.cjs");
|
|
15
|
-
let vue = require("vue");
|
|
16
|
-
var Image = /* @__PURE__ */ (0, vue.defineComponent)((props, { attrs, slots }) => {
|
|
17
|
-
const groupContext = require_context.usePreviewGroupContext();
|
|
18
|
-
const prefixCls = (0, vue.computed)(() => props.prefixCls ?? "vc-image");
|
|
19
|
-
const previewPrefixCls = (0, vue.computed)(() => props.previewPrefixCls ?? `${prefixCls.value}-preview`);
|
|
20
|
-
const canPreview = (0, vue.computed)(() => !!props.preview);
|
|
21
|
-
const mergedPreviewConfig = (0, vue.computed)(() => {
|
|
22
|
-
if (props.preview && typeof props.preview === "object") return props.preview;
|
|
23
|
-
return {};
|
|
24
|
-
});
|
|
25
|
-
const previewSrc = (0, vue.computed)(() => mergedPreviewConfig.value.src);
|
|
26
|
-
const previewOpen = (0, vue.computed)(() => mergedPreviewConfig.value.open);
|
|
27
|
-
const cover = (0, vue.computed)(() => mergedPreviewConfig.value.cover);
|
|
28
|
-
const previewRootClassName = (0, vue.computed)(() => mergedPreviewConfig.value.rootClassName);
|
|
29
|
-
const [isShowPreview, setShowPreview] = require_useMergedState.useMergedState(!!previewOpen.value, { value: previewOpen });
|
|
30
|
-
const mousePosition = (0, vue.shallowRef)(null);
|
|
31
|
-
const triggerPreviewOpen = (nextOpen) => {
|
|
32
|
-
setShowPreview(nextOpen);
|
|
33
|
-
mergedPreviewConfig.value.onOpenChange?.(nextOpen);
|
|
34
|
-
};
|
|
35
|
-
const onPreviewClose = () => {
|
|
36
|
-
triggerPreviewOpen(false);
|
|
37
|
-
mousePosition.value = null;
|
|
38
|
-
};
|
|
39
|
-
const isCustomPlaceholder = (0, vue.computed)(() => !!slots.placeholder || !!(props.placeholder && props.placeholder !== true));
|
|
40
|
-
const src = (0, vue.computed)(() => previewSrc.value ?? props.src);
|
|
41
|
-
const [getImgRef, srcAndOnload, status] = require_useStatus.default({
|
|
42
|
-
src: (0, vue.computed)(() => props.src),
|
|
43
|
-
isCustomPlaceholder,
|
|
44
|
-
fallback: (0, vue.computed)(() => props.fallback)
|
|
45
|
-
});
|
|
46
|
-
const imgCommonProps = (0, vue.computed)(() => {
|
|
47
|
-
const obj = {};
|
|
48
|
-
require_common.COMMON_PROPS.forEach((prop) => {
|
|
49
|
-
if (props[prop] !== void 0) obj[prop] = props[prop];
|
|
50
|
-
});
|
|
51
|
-
return obj;
|
|
52
|
-
});
|
|
53
|
-
const imageId = require_useRegisterImage.default(canPreview, (0, vue.computed)(() => ({
|
|
54
|
-
...imgCommonProps.value,
|
|
55
|
-
src: src.value
|
|
56
|
-
})));
|
|
57
|
-
const onPreview = (e) => {
|
|
58
|
-
const rect = (e.currentTarget || e.target).getBoundingClientRect();
|
|
59
|
-
const left = rect.x + rect.width / 2;
|
|
60
|
-
const top = rect.y + rect.height / 2;
|
|
61
|
-
if (groupContext) groupContext.onPreview(imageId, src.value || "", left, top);
|
|
62
|
-
else {
|
|
63
|
-
mousePosition.value = {
|
|
64
|
-
x: left,
|
|
65
|
-
y: top
|
|
66
|
-
};
|
|
67
|
-
triggerPreviewOpen(true);
|
|
68
|
-
}
|
|
69
|
-
props.onClick?.(e);
|
|
70
|
-
};
|
|
71
|
-
const onInternalClick = (e) => {
|
|
72
|
-
props.onClick?.(e);
|
|
73
|
-
};
|
|
74
|
-
const onImgError = (e) => {
|
|
75
|
-
props.onError?.(e);
|
|
76
|
-
};
|
|
77
|
-
return () => {
|
|
78
|
-
const { width, height } = props;
|
|
79
|
-
const { className, style: attrStyle, restAttrs } = require_index.getAttrStyleAndClass(attrs);
|
|
80
|
-
const coverPlacement = typeof cover.value === "object" && cover.value && cover.value.placement ? cover.value.placement || "center" : "center";
|
|
81
|
-
const coverNode = typeof cover.value === "object" && cover.value && cover.value.coverNode ? cover.value.coverNode : cover.value;
|
|
82
|
-
const imgStyle = [
|
|
83
|
-
height ? { height: require_index.getStylePxValue(height) } : null,
|
|
84
|
-
props.styles?.image,
|
|
85
|
-
attrStyle
|
|
86
|
-
];
|
|
87
|
-
const rootStyle = {
|
|
88
|
-
width: require_index.getStylePxValue(width),
|
|
89
|
-
height: require_index.getStylePxValue(height),
|
|
90
|
-
...props.styles?.root ?? {}
|
|
91
|
-
};
|
|
92
|
-
const rootCls = require_classnames.clsx(prefixCls.value, props.rootClassName, props.classNames?.root, { [`${prefixCls.value}-error`]: status.value === "error" });
|
|
93
|
-
const imgCls = require_classnames.clsx(`${prefixCls.value}-img`, { [`${prefixCls.value}-img-placeholder`]: props.placeholder === true }, props.classNames?.image, className);
|
|
94
|
-
const imageRender = slots.imageRender ? (originNode, info) => slots.imageRender?.(originNode, info) : mergedPreviewConfig.value.imageRender;
|
|
95
|
-
const placeholderNode = slots.placeholder?.() ?? (props.placeholder === true ? null : props.placeholder);
|
|
96
|
-
const actionsRender = slots.actionsRender ? (originNode, info) => slots.actionsRender?.({
|
|
97
|
-
actionsNode: originNode,
|
|
98
|
-
...info
|
|
99
|
-
}) : mergedPreviewConfig.value.actionsRender;
|
|
100
|
-
const { src: _previewSrc, open: _previewOpen, onOpenChange: _onPreviewOpenChange, cover: _cover, rootClassName: _previewRootCls, ...restPreviewProps } = mergedPreviewConfig.value;
|
|
101
|
-
return (0, vue.createVNode)(vue.Fragment, null, [(0, vue.createVNode)("div", (0, vue.mergeProps)(require_pickAttrs.pickAttrs(restAttrs, false), {
|
|
102
|
-
"class": rootCls,
|
|
103
|
-
"onClick": canPreview.value ? onPreview : onInternalClick,
|
|
104
|
-
"style": rootStyle
|
|
105
|
-
}), [
|
|
106
|
-
(0, vue.createVNode)("img", (0, vue.mergeProps)(imgCommonProps.value, {
|
|
107
|
-
"src": srcAndOnload.value.src,
|
|
108
|
-
"class": imgCls,
|
|
109
|
-
"style": imgStyle,
|
|
110
|
-
"ref": getImgRef,
|
|
111
|
-
"width": width,
|
|
112
|
-
"height": height,
|
|
113
|
-
"onLoad": srcAndOnload.value.onLoad,
|
|
114
|
-
"onError": onImgError
|
|
115
|
-
}), null),
|
|
116
|
-
status.value === "loading" && (0, vue.createVNode)("div", {
|
|
117
|
-
"aria-hidden": "true",
|
|
118
|
-
"class": `${prefixCls.value}-placeholder`
|
|
119
|
-
}, [placeholderNode]),
|
|
120
|
-
cover.value !== false && canPreview.value && (0, vue.createVNode)("div", {
|
|
121
|
-
"class": require_classnames.clsx(`${prefixCls.value}-cover`, props.classNames?.cover, `${prefixCls.value}-cover-${coverPlacement}`),
|
|
122
|
-
"style": props.styles?.cover
|
|
123
|
-
}, [coverNode])
|
|
124
|
-
]), !groupContext && canPreview.value && (0, vue.createVNode)(require_index$2.default, (0, vue.mergeProps)({
|
|
125
|
-
"aria-hidden": !isShowPreview.value,
|
|
126
|
-
"open": isShowPreview.value,
|
|
127
|
-
"prefixCls": previewPrefixCls.value,
|
|
128
|
-
"onClose": onPreviewClose,
|
|
129
|
-
"mousePosition": mousePosition.value,
|
|
130
|
-
"src": src.value,
|
|
131
|
-
"alt": props.alt,
|
|
132
|
-
"imageInfo": {
|
|
133
|
-
width: props.width,
|
|
134
|
-
height: props.height
|
|
135
|
-
},
|
|
136
|
-
"fallback": props.fallback,
|
|
137
|
-
"imgCommonProps": imgCommonProps.value,
|
|
138
|
-
"imageRender": imageRender,
|
|
139
|
-
"actionsRender": actionsRender
|
|
140
|
-
}, restPreviewProps, {
|
|
141
|
-
"classNames": props.classNames?.popup,
|
|
142
|
-
"styles": props.styles?.popup,
|
|
143
|
-
"rootClassName": require_classnames.clsx(previewRootClassName.value, props.rootClassName)
|
|
144
|
-
}), null)]);
|
|
145
|
-
};
|
|
146
|
-
}, {
|
|
147
|
-
props: /* @__PURE__ */ (0, vue.mergeDefaults)({
|
|
148
|
-
prefixCls: {
|
|
149
|
-
type: String,
|
|
150
|
-
required: false,
|
|
151
|
-
default: void 0
|
|
152
|
-
},
|
|
153
|
-
previewPrefixCls: {
|
|
154
|
-
type: String,
|
|
155
|
-
required: false,
|
|
156
|
-
default: void 0
|
|
157
|
-
},
|
|
158
|
-
rootClassName: {
|
|
159
|
-
type: String,
|
|
160
|
-
required: false,
|
|
161
|
-
default: void 0
|
|
162
|
-
},
|
|
163
|
-
classNames: {
|
|
164
|
-
type: Object,
|
|
165
|
-
required: false,
|
|
166
|
-
default: void 0
|
|
167
|
-
},
|
|
168
|
-
styles: {
|
|
169
|
-
type: Object,
|
|
170
|
-
required: false,
|
|
171
|
-
default: void 0
|
|
172
|
-
},
|
|
173
|
-
src: {
|
|
174
|
-
type: String,
|
|
175
|
-
required: false,
|
|
176
|
-
default: void 0
|
|
177
|
-
},
|
|
178
|
-
placeholder: {
|
|
179
|
-
type: [
|
|
180
|
-
Boolean,
|
|
181
|
-
Object,
|
|
182
|
-
Function,
|
|
183
|
-
String,
|
|
184
|
-
Number,
|
|
185
|
-
null,
|
|
186
|
-
Array
|
|
187
|
-
],
|
|
188
|
-
required: false,
|
|
189
|
-
default: void 0
|
|
190
|
-
},
|
|
191
|
-
fallback: {
|
|
192
|
-
type: String,
|
|
193
|
-
required: false,
|
|
194
|
-
default: void 0
|
|
195
|
-
},
|
|
196
|
-
preview: {
|
|
197
|
-
type: [Boolean, Object],
|
|
198
|
-
required: false,
|
|
199
|
-
default: void 0
|
|
200
|
-
},
|
|
201
|
-
onClick: {
|
|
202
|
-
type: Function,
|
|
203
|
-
required: false,
|
|
204
|
-
default: void 0
|
|
205
|
-
},
|
|
206
|
-
onError: {
|
|
207
|
-
type: Function,
|
|
208
|
-
required: false,
|
|
209
|
-
default: void 0
|
|
210
|
-
},
|
|
211
|
-
width: {
|
|
212
|
-
type: [String, Number],
|
|
213
|
-
required: false,
|
|
214
|
-
default: void 0
|
|
215
|
-
},
|
|
216
|
-
height: {
|
|
217
|
-
type: [String, Number],
|
|
218
|
-
required: false,
|
|
219
|
-
default: void 0
|
|
220
|
-
}
|
|
221
|
-
}, {
|
|
222
|
-
prefixCls: "vc-image",
|
|
223
|
-
preview: true,
|
|
224
|
-
classNames: {},
|
|
225
|
-
styles: {}
|
|
226
|
-
}),
|
|
227
|
-
name: "Image",
|
|
228
|
-
inheritAttrs: false
|
|
229
|
-
});
|
|
230
|
-
var Image_default = Image;
|
|
231
|
-
exports.default = Image_default;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
let vue = require("vue");
|
|
6
|
-
var CloseBtn = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
7
|
-
return () => {
|
|
8
|
-
const { prefixCls, icon, onClick } = props;
|
|
9
|
-
return (0, vue.createVNode)("button", {
|
|
10
|
-
"class": `${prefixCls}-close`,
|
|
11
|
-
"type": "button",
|
|
12
|
-
"onClick": onClick
|
|
13
|
-
}, [icon]);
|
|
14
|
-
};
|
|
15
|
-
}, {
|
|
16
|
-
props: {
|
|
17
|
-
prefixCls: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true,
|
|
20
|
-
default: void 0
|
|
21
|
-
},
|
|
22
|
-
icon: {
|
|
23
|
-
type: [
|
|
24
|
-
Object,
|
|
25
|
-
Function,
|
|
26
|
-
String,
|
|
27
|
-
Number,
|
|
28
|
-
null,
|
|
29
|
-
Boolean,
|
|
30
|
-
Array
|
|
31
|
-
],
|
|
32
|
-
required: false,
|
|
33
|
-
default: void 0
|
|
34
|
-
},
|
|
35
|
-
onClick: {
|
|
36
|
-
type: Function,
|
|
37
|
-
required: true,
|
|
38
|
-
default: void 0
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
name: "ImagePreviewCloseBtn"
|
|
42
|
-
});
|
|
43
|
-
var CloseBtn_default = CloseBtn;
|
|
44
|
-
exports.default = CloseBtn_default;
|
package/dist/Preview/Footer.cjs
DELETED
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
const require_classnames = require("../util/dist/classnames.cjs");
|
|
6
|
-
require("../util/dist/index.cjs");
|
|
7
|
-
let vue = require("vue");
|
|
8
|
-
var Footer = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
9
|
-
const renderOperation = ({ type, disabled, onClick, icon }) => {
|
|
10
|
-
const actionCls = `${props.prefixCls}-actions-action`;
|
|
11
|
-
return (0, vue.createVNode)("div", {
|
|
12
|
-
"key": type,
|
|
13
|
-
"class": require_classnames.clsx(actionCls, `${actionCls}-${type}`, { [`${actionCls}-disabled`]: !!disabled }),
|
|
14
|
-
"onClick": () => {
|
|
15
|
-
if (!disabled) onClick();
|
|
16
|
-
}
|
|
17
|
-
}, [icon]);
|
|
18
|
-
};
|
|
19
|
-
return () => {
|
|
20
|
-
const { prefixCls, showProgress, current, count, showSwitch, classNames, styles, icons, image, transform, countRender, actionsRender, scale, minScale, maxScale, onActive, onFlipY, onFlipX, onRotateLeft, onRotateRight, onZoomOut, onZoomIn, onClose, onReset } = props;
|
|
21
|
-
const progressNode = showProgress && (0, vue.createVNode)("div", { "class": `${prefixCls}-progress` }, [countRender ? countRender(current + 1, count) : (0, vue.createVNode)("bdi", null, [`${current + 1} / ${count}`])]);
|
|
22
|
-
const switchPrevNode = showSwitch ? renderOperation({
|
|
23
|
-
icon: icons?.prev ?? icons?.left,
|
|
24
|
-
onClick: () => onActive(-1),
|
|
25
|
-
type: "prev",
|
|
26
|
-
disabled: current === 0
|
|
27
|
-
}) : void 0;
|
|
28
|
-
const switchNextNode = showSwitch ? renderOperation({
|
|
29
|
-
icon: icons?.next ?? icons?.right,
|
|
30
|
-
onClick: () => onActive(1),
|
|
31
|
-
type: "next",
|
|
32
|
-
disabled: current === count - 1
|
|
33
|
-
}) : void 0;
|
|
34
|
-
const flipYNode = renderOperation({
|
|
35
|
-
icon: icons?.flipY,
|
|
36
|
-
onClick: onFlipY,
|
|
37
|
-
type: "flipY"
|
|
38
|
-
});
|
|
39
|
-
const flipXNode = renderOperation({
|
|
40
|
-
icon: icons?.flipX,
|
|
41
|
-
onClick: onFlipX,
|
|
42
|
-
type: "flipX"
|
|
43
|
-
});
|
|
44
|
-
const rotateLeftNode = renderOperation({
|
|
45
|
-
icon: icons?.rotateLeft,
|
|
46
|
-
onClick: onRotateLeft,
|
|
47
|
-
type: "rotateLeft"
|
|
48
|
-
});
|
|
49
|
-
const rotateRightNode = renderOperation({
|
|
50
|
-
icon: icons?.rotateRight,
|
|
51
|
-
onClick: onRotateRight,
|
|
52
|
-
type: "rotateRight"
|
|
53
|
-
});
|
|
54
|
-
const zoomOutNode = renderOperation({
|
|
55
|
-
icon: icons?.zoomOut,
|
|
56
|
-
onClick: onZoomOut,
|
|
57
|
-
type: "zoomOut",
|
|
58
|
-
disabled: scale <= minScale
|
|
59
|
-
});
|
|
60
|
-
const zoomInNode = renderOperation({
|
|
61
|
-
icon: icons?.zoomIn,
|
|
62
|
-
onClick: onZoomIn,
|
|
63
|
-
type: "zoomIn",
|
|
64
|
-
disabled: scale === maxScale
|
|
65
|
-
});
|
|
66
|
-
const actionsNode = (0, vue.createVNode)("div", {
|
|
67
|
-
"class": require_classnames.clsx(`${prefixCls}-actions`, classNames.actions),
|
|
68
|
-
"style": styles.actions
|
|
69
|
-
}, [
|
|
70
|
-
flipYNode,
|
|
71
|
-
flipXNode,
|
|
72
|
-
rotateLeftNode,
|
|
73
|
-
rotateRightNode,
|
|
74
|
-
zoomOutNode,
|
|
75
|
-
zoomInNode
|
|
76
|
-
]);
|
|
77
|
-
const renderNode = actionsRender ? actionsRender(actionsNode, {
|
|
78
|
-
icons: {
|
|
79
|
-
prevIcon: switchPrevNode,
|
|
80
|
-
nextIcon: switchNextNode,
|
|
81
|
-
flipYIcon: flipYNode,
|
|
82
|
-
flipXIcon: flipXNode,
|
|
83
|
-
rotateLeftIcon: rotateLeftNode,
|
|
84
|
-
rotateRightIcon: rotateRightNode,
|
|
85
|
-
zoomOutIcon: zoomOutNode,
|
|
86
|
-
zoomInIcon: zoomInNode
|
|
87
|
-
},
|
|
88
|
-
actions: {
|
|
89
|
-
onActive,
|
|
90
|
-
onFlipY,
|
|
91
|
-
onFlipX,
|
|
92
|
-
onRotateLeft,
|
|
93
|
-
onRotateRight,
|
|
94
|
-
onZoomOut,
|
|
95
|
-
onZoomIn,
|
|
96
|
-
onReset,
|
|
97
|
-
onClose
|
|
98
|
-
},
|
|
99
|
-
transform,
|
|
100
|
-
current,
|
|
101
|
-
total: count,
|
|
102
|
-
image
|
|
103
|
-
}) : actionsNode;
|
|
104
|
-
return (0, vue.createVNode)("div", {
|
|
105
|
-
"class": require_classnames.clsx(`${prefixCls}-footer`, classNames.footer),
|
|
106
|
-
"style": styles.footer
|
|
107
|
-
}, [progressNode, renderNode]);
|
|
108
|
-
};
|
|
109
|
-
}, {
|
|
110
|
-
props: {
|
|
111
|
-
prefixCls: {
|
|
112
|
-
type: String,
|
|
113
|
-
required: true,
|
|
114
|
-
default: void 0
|
|
115
|
-
},
|
|
116
|
-
showProgress: {
|
|
117
|
-
type: Boolean,
|
|
118
|
-
required: true,
|
|
119
|
-
default: void 0
|
|
120
|
-
},
|
|
121
|
-
countRender: {
|
|
122
|
-
type: Function,
|
|
123
|
-
required: false,
|
|
124
|
-
default: void 0
|
|
125
|
-
},
|
|
126
|
-
actionsRender: {
|
|
127
|
-
type: Function,
|
|
128
|
-
required: false,
|
|
129
|
-
default: void 0
|
|
130
|
-
},
|
|
131
|
-
current: {
|
|
132
|
-
type: Number,
|
|
133
|
-
required: true,
|
|
134
|
-
default: void 0
|
|
135
|
-
},
|
|
136
|
-
count: {
|
|
137
|
-
type: Number,
|
|
138
|
-
required: true,
|
|
139
|
-
default: void 0
|
|
140
|
-
},
|
|
141
|
-
showSwitch: {
|
|
142
|
-
type: Boolean,
|
|
143
|
-
required: true,
|
|
144
|
-
default: void 0
|
|
145
|
-
},
|
|
146
|
-
icons: {
|
|
147
|
-
required: true,
|
|
148
|
-
default: void 0
|
|
149
|
-
},
|
|
150
|
-
scale: {
|
|
151
|
-
type: Number,
|
|
152
|
-
required: true,
|
|
153
|
-
default: void 0
|
|
154
|
-
},
|
|
155
|
-
minScale: {
|
|
156
|
-
type: Number,
|
|
157
|
-
required: true,
|
|
158
|
-
default: void 0
|
|
159
|
-
},
|
|
160
|
-
maxScale: {
|
|
161
|
-
type: Number,
|
|
162
|
-
required: true,
|
|
163
|
-
default: void 0
|
|
164
|
-
},
|
|
165
|
-
image: {
|
|
166
|
-
type: Object,
|
|
167
|
-
required: true,
|
|
168
|
-
default: void 0
|
|
169
|
-
},
|
|
170
|
-
transform: {
|
|
171
|
-
type: Object,
|
|
172
|
-
required: true,
|
|
173
|
-
default: void 0
|
|
174
|
-
},
|
|
175
|
-
classNames: {
|
|
176
|
-
type: Object,
|
|
177
|
-
required: true,
|
|
178
|
-
default: void 0
|
|
179
|
-
},
|
|
180
|
-
styles: {
|
|
181
|
-
type: Object,
|
|
182
|
-
required: true,
|
|
183
|
-
default: void 0
|
|
184
|
-
},
|
|
185
|
-
onActive: {
|
|
186
|
-
type: Function,
|
|
187
|
-
required: true,
|
|
188
|
-
default: void 0
|
|
189
|
-
},
|
|
190
|
-
onFlipY: {
|
|
191
|
-
type: Function,
|
|
192
|
-
required: true,
|
|
193
|
-
default: void 0
|
|
194
|
-
},
|
|
195
|
-
onFlipX: {
|
|
196
|
-
type: Function,
|
|
197
|
-
required: true,
|
|
198
|
-
default: void 0
|
|
199
|
-
},
|
|
200
|
-
onRotateLeft: {
|
|
201
|
-
type: Function,
|
|
202
|
-
required: true,
|
|
203
|
-
default: void 0
|
|
204
|
-
},
|
|
205
|
-
onRotateRight: {
|
|
206
|
-
type: Function,
|
|
207
|
-
required: true,
|
|
208
|
-
default: void 0
|
|
209
|
-
},
|
|
210
|
-
onZoomOut: {
|
|
211
|
-
type: Function,
|
|
212
|
-
required: true,
|
|
213
|
-
default: void 0
|
|
214
|
-
},
|
|
215
|
-
onZoomIn: {
|
|
216
|
-
type: Function,
|
|
217
|
-
required: true,
|
|
218
|
-
default: void 0
|
|
219
|
-
},
|
|
220
|
-
onClose: {
|
|
221
|
-
type: Function,
|
|
222
|
-
required: true,
|
|
223
|
-
default: void 0
|
|
224
|
-
},
|
|
225
|
-
onReset: {
|
|
226
|
-
type: Function,
|
|
227
|
-
required: true,
|
|
228
|
-
default: void 0
|
|
229
|
-
}
|
|
230
|
-
},
|
|
231
|
-
name: "ImagePreviewFooter"
|
|
232
|
-
});
|
|
233
|
-
var Footer_default = Footer;
|
|
234
|
-
exports.default = Footer_default;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
Object.defineProperties(exports, {
|
|
2
|
-
__esModule: { value: true },
|
|
3
|
-
[Symbol.toStringTag]: { value: "Module" }
|
|
4
|
-
});
|
|
5
|
-
const require_classnames = require("../util/dist/classnames.cjs");
|
|
6
|
-
require("../util/dist/index.cjs");
|
|
7
|
-
let vue = require("vue");
|
|
8
|
-
var PrevNext = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
|
|
9
|
-
return () => {
|
|
10
|
-
const { prefixCls, onActive, current, count, icons } = props;
|
|
11
|
-
const switchCls = `${prefixCls}-switch`;
|
|
12
|
-
const prevIcon = icons.prev ?? icons.left;
|
|
13
|
-
const nextIcon = icons.next ?? icons.right;
|
|
14
|
-
const isPrevDisabled = current === 0;
|
|
15
|
-
const isNextDisabled = current === count - 1;
|
|
16
|
-
return (0, vue.createVNode)(vue.Fragment, null, [(0, vue.createVNode)("div", {
|
|
17
|
-
"class": require_classnames.clsx(switchCls, `${switchCls}-prev`, { [`${switchCls}-disabled`]: isPrevDisabled }),
|
|
18
|
-
"onClick": () => {
|
|
19
|
-
if (!isPrevDisabled) onActive(-1);
|
|
20
|
-
}
|
|
21
|
-
}, [prevIcon]), (0, vue.createVNode)("div", {
|
|
22
|
-
"class": require_classnames.clsx(switchCls, `${switchCls}-next`, { [`${switchCls}-disabled`]: isNextDisabled }),
|
|
23
|
-
"onClick": () => {
|
|
24
|
-
if (!isNextDisabled) onActive(1);
|
|
25
|
-
}
|
|
26
|
-
}, [nextIcon])]);
|
|
27
|
-
};
|
|
28
|
-
}, {
|
|
29
|
-
props: {
|
|
30
|
-
prefixCls: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
default: void 0
|
|
34
|
-
},
|
|
35
|
-
onActive: {
|
|
36
|
-
type: Function,
|
|
37
|
-
required: true,
|
|
38
|
-
default: void 0
|
|
39
|
-
},
|
|
40
|
-
current: {
|
|
41
|
-
type: Number,
|
|
42
|
-
required: true,
|
|
43
|
-
default: void 0
|
|
44
|
-
},
|
|
45
|
-
count: {
|
|
46
|
-
type: Number,
|
|
47
|
-
required: true,
|
|
48
|
-
default: void 0
|
|
49
|
-
},
|
|
50
|
-
icons: {
|
|
51
|
-
type: Object,
|
|
52
|
-
required: true,
|
|
53
|
-
default: void 0
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
name: "ImagePreviewPrevNext"
|
|
57
|
-
});
|
|
58
|
-
var PrevNext_default = PrevNext;
|
|
59
|
-
exports.default = PrevNext_default;
|