@v-c/image 1.0.1 → 1.0.3

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.
Files changed (52) hide show
  1. package/dist/Image.js +1 -1
  2. package/dist/Preview/index.js +1 -1
  3. package/dist/portal/dist/Portal.js +3 -2
  4. package/dist/util/dist/Dom/findDOMNode.js +20 -0
  5. package/dist/util/dist/getScrollBarSize.js +42 -44
  6. package/package.json +12 -12
  7. package/LICENSE +0 -21
  8. package/dist/Image.cjs +0 -231
  9. package/dist/Preview/CloseBtn.cjs +0 -44
  10. package/dist/Preview/Footer.cjs +0 -234
  11. package/dist/Preview/PrevNext.cjs +0 -59
  12. package/dist/Preview/index.cjs +0 -404
  13. package/dist/PreviewGroup.cjs +0 -138
  14. package/dist/common.cjs +0 -13
  15. package/dist/context.cjs +0 -11
  16. package/dist/getFixScaleEleTransPosition.cjs +0 -28
  17. package/dist/hooks/useImageTransform.cjs +0 -99
  18. package/dist/hooks/useMouseEvent.cjs +0 -96
  19. package/dist/hooks/usePreviewItems.cjs +0 -48
  20. package/dist/hooks/useRegisterImage.cjs +0 -28
  21. package/dist/hooks/useStatus.cjs +0 -49
  22. package/dist/hooks/useTouchEvent.cjs +0 -125
  23. package/dist/index.cjs +0 -11
  24. package/dist/interface.cjs +0 -1
  25. package/dist/portal/dist/Context.cjs +0 -12
  26. package/dist/portal/dist/Portal.cjs +0 -100
  27. package/dist/portal/dist/index.cjs +0 -3
  28. package/dist/portal/dist/useDom.cjs +0 -47
  29. package/dist/portal/dist/useEscKeyDown.cjs +0 -57
  30. package/dist/portal/dist/useScrollLocker.cjs +0 -28
  31. package/dist/portal/dist/util.cjs +0 -4
  32. package/dist/previewConfig.cjs +0 -5
  33. package/dist/util/dist/Dom/canUseDom.cjs +0 -4
  34. package/dist/util/dist/Dom/contains.cjs +0 -11
  35. package/dist/util/dist/Dom/dynamicCSS.cjs +0 -80
  36. package/dist/util/dist/KeyCode.cjs +0 -81
  37. package/dist/util/dist/RenderComponent.cjs +0 -29
  38. package/dist/util/dist/classnames.cjs +0 -36
  39. package/dist/util/dist/getScrollBarSize.cjs +0 -53
  40. package/dist/util/dist/hooks/useControlledState.cjs +0 -1
  41. package/dist/util/dist/hooks/useId.cjs +0 -5
  42. package/dist/util/dist/hooks/useMergedState.cjs +0 -24
  43. package/dist/util/dist/index.cjs +0 -8
  44. package/dist/util/dist/isEqual.cjs +0 -27
  45. package/dist/util/dist/omit.cjs +0 -8
  46. package/dist/util/dist/pickAttrs.cjs +0 -39
  47. package/dist/util/dist/props-util/index.cjs +0 -47
  48. package/dist/util/dist/raf.cjs +0 -36
  49. package/dist/util/dist/type.cjs +0 -2
  50. package/dist/util/dist/utils/transition.cjs +0 -21
  51. package/dist/util/dist/warning.cjs +0 -37
  52. package/dist/util.cjs +0 -27
package/dist/Image.js CHANGED
@@ -74,7 +74,7 @@ var Image_default = /* @__PURE__ */ defineComponent((props, { attrs, slots }) =>
74
74
  const { width, height } = props;
75
75
  const { className, style: attrStyle, restAttrs } = getAttrStyleAndClass(attrs);
76
76
  const coverPlacement = typeof cover.value === "object" && cover.value && cover.value.placement ? cover.value.placement || "center" : "center";
77
- const coverNode = typeof cover.value === "object" && cover.value && cover.value.coverNode ? cover.value.coverNode : cover.value;
77
+ const coverNode = slots.cover?.() || (typeof cover.value === "object" && cover.value && cover.value.coverNode ? cover.value.coverNode : cover.value);
78
78
  const imgStyle = [
79
79
  height ? { height: getStylePxValue(height) } : null,
80
80
  props.styles?.image,
@@ -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
  });
@@ -6,6 +6,7 @@ import { canUseDom } from "../../util/dist/Dom/canUseDom.js";
6
6
  import { useDom } from "./useDom.js";
7
7
  import { useEscKeyDown } from "./useEscKeyDown.js";
8
8
  import { useScrollLocker } from "./useScrollLocker.js";
9
+ import { getDOM } from "../../util/dist/Dom/findDOMNode.js";
9
10
  import { Teleport, computed, createVNode, defineComponent, isVNode, mergeDefaults, onMounted, shallowRef, watch } from "vue";
10
11
  function _isSlot(s) {
11
12
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
@@ -14,8 +15,8 @@ function getPortalContainer(getContainer) {
14
15
  if (getContainer === false) return false;
15
16
  if (!canUseDom() || !getContainer) return null;
16
17
  if (typeof getContainer === "string") return document.querySelector(getContainer);
17
- if (typeof getContainer === "function") return getContainer();
18
- return getContainer;
18
+ if (typeof getContainer === "function") return getDOM(getContainer());
19
+ return typeof getContainer === "object" ? getDOM(getContainer) : getContainer;
19
20
  }
20
21
  var Portal_default = /* @__PURE__ */ defineComponent((props, { slots, expose }) => {
21
22
  const shouldRender = shallowRef(props.open);
@@ -0,0 +1,20 @@
1
+ import { canUseDom } from "./canUseDom.js";
2
+ import { unref } from "vue";
3
+ function isDOM(node) {
4
+ return node instanceof HTMLElement || node instanceof SVGElement;
5
+ }
6
+ function getDOM(elementRef) {
7
+ const unrefElementRef = unref(elementRef);
8
+ if (!canUseDom()) return unrefElementRef;
9
+ const dom = findDOMNode(unrefElementRef) || (unrefElementRef && typeof unrefElementRef === "object" ? findDOMNode(unrefElementRef.nativeElement) : null);
10
+ if (dom && (dom.nodeType === 3 || dom.nodeType === 8) && dom.nextElementSibling) return dom.nextElementSibling;
11
+ return dom;
12
+ }
13
+ function findDOMNode(_node) {
14
+ const node = unref(_node);
15
+ if (!canUseDom()) return node;
16
+ if (isDOM(node)) return node;
17
+ else if (node && "$el" in node) return node.$el;
18
+ return null;
19
+ }
20
+ export { getDOM };
@@ -1,53 +1,51 @@
1
- var cached;
2
- function getScrollBarSize(fresh) {
3
- if (typeof document === "undefined") return 0;
4
- if (fresh || cached === void 0) {
5
- const inner = document.createElement("div");
6
- inner.style.width = "100%";
7
- inner.style.height = "200px";
8
- const outer = document.createElement("div");
9
- const outerStyle = outer.style;
10
- outerStyle.position = "absolute";
11
- outerStyle.top = "0";
12
- outerStyle.left = "0";
13
- outerStyle.pointerEvents = "none";
14
- outerStyle.visibility = "hidden";
15
- outerStyle.width = "200px";
16
- outerStyle.height = "150px";
17
- outerStyle.overflow = "hidden";
18
- outer.appendChild(inner);
19
- document.body.appendChild(outer);
20
- const widthContained = inner.offsetWidth;
21
- outer.style.overflow = "scroll";
22
- let widthScroll = inner.offsetWidth;
23
- if (widthContained === widthScroll) widthScroll = outer.clientWidth;
24
- document.body.removeChild(outer);
25
- cached = widthContained - widthScroll;
1
+ import { removeCSS, updateCSS } from "./Dom/dynamicCSS.js";
2
+ function measureScrollbarSize(ele) {
3
+ const randomId = `vc-scrollbar-measure-${Math.random().toString(36).substring(7)}`;
4
+ const measureEle = document.createElement("div");
5
+ measureEle.id = randomId;
6
+ const measureStyle = measureEle.style;
7
+ measureStyle.position = "absolute";
8
+ measureStyle.left = "0";
9
+ measureStyle.top = "0";
10
+ measureStyle.width = "100px";
11
+ measureStyle.height = "100px";
12
+ measureStyle.overflow = "scroll";
13
+ let fallbackWidth;
14
+ let fallbackHeight;
15
+ if (ele) {
16
+ const targetStyle = getComputedStyle(ele);
17
+ measureStyle.scrollbarColor = targetStyle.scrollbarColor;
18
+ measureStyle.scrollbarWidth = targetStyle.scrollbarWidth;
19
+ const webkitScrollbarStyle = getComputedStyle(ele, "::-webkit-scrollbar");
20
+ const width = parseInt(webkitScrollbarStyle.width, 10);
21
+ const height = parseInt(webkitScrollbarStyle.height, 10);
22
+ try {
23
+ updateCSS(`
24
+ #${randomId}::-webkit-scrollbar {
25
+ ${width ? `width: ${webkitScrollbarStyle.width};` : ""}
26
+ ${height ? `height: ${webkitScrollbarStyle.height};` : ""}
27
+ }`, randomId);
28
+ } catch (e) {
29
+ console.error(e);
30
+ fallbackWidth = width;
31
+ fallbackHeight = height;
32
+ }
26
33
  }
27
- return cached;
28
- }
29
- function ensureSize(str) {
30
- const match = str.match(/^(.*)px$/);
31
- const value = Number(match?.[1]);
32
- return Number.isNaN(value) ? getScrollBarSize() : value;
34
+ document.body.appendChild(measureEle);
35
+ const scrollWidth = ele && fallbackWidth && !Number.isNaN(fallbackWidth) ? fallbackWidth : measureEle.offsetWidth - measureEle.clientWidth;
36
+ const scrollHeight = ele && fallbackHeight && !Number.isNaN(fallbackHeight) ? fallbackHeight : measureEle.offsetHeight - measureEle.clientHeight;
37
+ document.body.removeChild(measureEle);
38
+ removeCSS(randomId);
39
+ return {
40
+ width: scrollWidth,
41
+ height: scrollHeight
42
+ };
33
43
  }
34
44
  function getTargetScrollBarSize(target) {
35
45
  if (typeof document === "undefined" || !target || !(target instanceof Element)) return {
36
46
  width: 0,
37
47
  height: 0
38
48
  };
39
- if (typeof navigator !== "undefined" && /jsdom/i.test(navigator.userAgent)) return {
40
- width: 0,
41
- height: 0
42
- };
43
- let width = "0px";
44
- let height = "0px";
45
- try {
46
- ({width, height} = getComputedStyle(target, "::-webkit-scrollbar"));
47
- } catch {}
48
- return {
49
- width: ensureSize(width),
50
- height: ensureSize(height)
51
- };
49
+ return measureScrollbarSize(target);
52
50
  }
53
51
  export { getTargetScrollBarSize };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@v-c/image",
3
3
  "type": "module",
4
- "version": "1.0.1",
4
+ "version": "1.0.3",
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
- "require": "./dist/index.cjs"
17
+ "default": "./dist/index.js"
18
18
  },
19
19
  "./dist/*": "./dist/*",
20
20
  "./package.json": "./package.json"
@@ -28,21 +28,21 @@
28
28
  "publishConfig": {
29
29
  "access": "public"
30
30
  },
31
+ "scripts": {
32
+ "build": "vite build",
33
+ "prepublish": "pnpm build",
34
+ "test": "vitest run",
35
+ "patch": "bumpp --release patch",
36
+ "bump": "bumpp"
37
+ },
31
38
  "peerDependencies": {
32
39
  "vue": "^3.0.0"
33
40
  },
34
41
  "dependencies": {
35
- "@v-c/portal": "^1.0.6",
36
- "@v-c/util": "^1.0.9"
42
+ "@v-c/portal": "workspace:^",
43
+ "@v-c/util": "workspace:^"
37
44
  },
38
45
  "devDependencies": {
39
46
  "@ant-design/icons-vue": "^7.0.1"
40
- },
41
- "scripts": {
42
- "build": "vite build",
43
- "prepublish": "pnpm build",
44
- "test": "vitest run",
45
- "patch": "bumpp --release patch",
46
- "bump": "bumpp"
47
47
  }
48
- }
48
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 antdv-community
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
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;