@gx-design-vue/image 0.2.0-beta.25 → 0.2.0-beta.27
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/Image.d.ts +39 -45
- package/dist/ImagePreview/Operations.d.ts +2 -2
- package/dist/ImagePreview/hooks/getFixScaleEleTransPosition.d.ts +16 -0
- package/dist/ImagePreview/hooks/useImageTransform.d.ts +35 -0
- package/dist/ImagePreview/hooks/useMouseEvent.d.ts +10 -0
- package/dist/ImagePreview/hooks/useTouchEvent.d.ts +8 -0
- package/dist/ImagePreview/index.d.ts +93 -13
- package/dist/ImagePreview/props.d.ts +32 -5
- package/dist/ImagePreview/style.d.ts +1 -1
- package/dist/ImagePreview/typings.d.ts +0 -1
- package/dist/ImagePreview/utils/util.d.ts +4 -12
- package/dist/image.js +890 -1208
- package/dist/image.umd.cjs +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/props.d.ts +14 -19
- package/dist/style.d.ts +3 -1
- package/dist/typings.d.ts +2 -0
- package/dist/utils/util.d.ts +1 -0
- package/package.json +22 -22
package/dist/Image.d.ts
CHANGED
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import type { CSSProperties, ExtractPropTypes, SlotsType } from 'vue';
|
|
2
|
-
import {
|
|
3
|
-
export type GImageProps = Partial<ExtractPropTypes<typeof
|
|
2
|
+
import { imageProps } from './props';
|
|
3
|
+
export type GImageProps = Partial<ExtractPropTypes<typeof imageProps>>;
|
|
4
4
|
declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
5
5
|
preview: {
|
|
6
|
-
type: import("vue").PropType<import("
|
|
7
|
-
default: () => Partial<{
|
|
8
|
-
previewUrls: string[];
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
zIndex: number;
|
|
11
|
-
current: number;
|
|
12
|
-
infinite: boolean;
|
|
13
|
-
getContainer: string;
|
|
14
|
-
onHideOnClickModal: boolean;
|
|
15
|
-
countRender: import("@gx-design-vue/pro-utils/dist").WithFalse<(current: number, total: number) => import("@gx-design-vue/pro-utils/dist").CustomRender>;
|
|
16
|
-
icons: import(".").PreviewPropsIcons;
|
|
17
|
-
}>;
|
|
18
|
-
};
|
|
19
|
-
showPreview: {
|
|
20
|
-
type: import("vue").PropType<boolean>;
|
|
6
|
+
type: import("vue").PropType<import(".").BaseImagePreviewProps | boolean>;
|
|
21
7
|
default: boolean;
|
|
22
8
|
};
|
|
23
9
|
src: {
|
|
@@ -28,10 +14,16 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
28
14
|
type: import("vue").PropType<string>;
|
|
29
15
|
default: string;
|
|
30
16
|
};
|
|
17
|
+
loading: {
|
|
18
|
+
type: import("vue").PropType<"eager" | "lazy">;
|
|
19
|
+
};
|
|
31
20
|
fit: {
|
|
32
21
|
type: import("vue").PropType<"fill" | "contain" | "cover" | "none" | "scale-down">;
|
|
33
22
|
default: string;
|
|
34
23
|
};
|
|
24
|
+
crossorigin: {
|
|
25
|
+
type: import("vue").PropType<"anonymous" | "use-credentials" | "">;
|
|
26
|
+
};
|
|
35
27
|
lazy: import("vue").PropType<boolean>;
|
|
36
28
|
scrollContainer: {
|
|
37
29
|
type: import("vue").PropType<string | HTMLElement | undefined>;
|
|
@@ -53,8 +45,11 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
53
45
|
onClick: {
|
|
54
46
|
type: import("vue").PropType<(info: any) => void>;
|
|
55
47
|
};
|
|
56
|
-
|
|
57
|
-
|
|
48
|
+
wrapperStyle: {
|
|
49
|
+
type: import("vue").PropType<CSSProperties>;
|
|
50
|
+
default: () => {};
|
|
51
|
+
};
|
|
52
|
+
wrapperClass: import("vue").PropType<string>;
|
|
58
53
|
width: import("vue").PropType<number>;
|
|
59
54
|
height: import("vue").PropType<number>;
|
|
60
55
|
zIndex: {
|
|
@@ -64,23 +59,13 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
64
59
|
getContainer: {
|
|
65
60
|
type: import("vue").PropType<string>;
|
|
66
61
|
};
|
|
67
|
-
}>, () => import("ant-design-vue/es/_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin,
|
|
62
|
+
}>, () => import("ant-design-vue/es/_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
63
|
+
click: () => true;
|
|
64
|
+
load: (_event: Event) => true;
|
|
65
|
+
error: (_event: Event) => true;
|
|
66
|
+
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
68
67
|
preview: {
|
|
69
|
-
type: import("vue").PropType<import("
|
|
70
|
-
default: () => Partial<{
|
|
71
|
-
previewUrls: string[];
|
|
72
|
-
disabled: boolean;
|
|
73
|
-
zIndex: number;
|
|
74
|
-
current: number;
|
|
75
|
-
infinite: boolean;
|
|
76
|
-
getContainer: string;
|
|
77
|
-
onHideOnClickModal: boolean;
|
|
78
|
-
countRender: import("@gx-design-vue/pro-utils/dist").WithFalse<(current: number, total: number) => import("@gx-design-vue/pro-utils/dist").CustomRender>;
|
|
79
|
-
icons: import(".").PreviewPropsIcons;
|
|
80
|
-
}>;
|
|
81
|
-
};
|
|
82
|
-
showPreview: {
|
|
83
|
-
type: import("vue").PropType<boolean>;
|
|
68
|
+
type: import("vue").PropType<import(".").BaseImagePreviewProps | boolean>;
|
|
84
69
|
default: boolean;
|
|
85
70
|
};
|
|
86
71
|
src: {
|
|
@@ -91,10 +76,16 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
91
76
|
type: import("vue").PropType<string>;
|
|
92
77
|
default: string;
|
|
93
78
|
};
|
|
79
|
+
loading: {
|
|
80
|
+
type: import("vue").PropType<"eager" | "lazy">;
|
|
81
|
+
};
|
|
94
82
|
fit: {
|
|
95
83
|
type: import("vue").PropType<"fill" | "contain" | "cover" | "none" | "scale-down">;
|
|
96
84
|
default: string;
|
|
97
85
|
};
|
|
86
|
+
crossorigin: {
|
|
87
|
+
type: import("vue").PropType<"anonymous" | "use-credentials" | "">;
|
|
88
|
+
};
|
|
98
89
|
lazy: import("vue").PropType<boolean>;
|
|
99
90
|
scrollContainer: {
|
|
100
91
|
type: import("vue").PropType<string | HTMLElement | undefined>;
|
|
@@ -116,8 +107,11 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
116
107
|
onClick: {
|
|
117
108
|
type: import("vue").PropType<(info: any) => void>;
|
|
118
109
|
};
|
|
119
|
-
|
|
120
|
-
|
|
110
|
+
wrapperStyle: {
|
|
111
|
+
type: import("vue").PropType<CSSProperties>;
|
|
112
|
+
default: () => {};
|
|
113
|
+
};
|
|
114
|
+
wrapperClass: import("vue").PropType<string>;
|
|
121
115
|
width: import("vue").PropType<number>;
|
|
122
116
|
height: import("vue").PropType<number>;
|
|
123
117
|
zIndex: {
|
|
@@ -128,13 +122,14 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
128
122
|
type: import("vue").PropType<string>;
|
|
129
123
|
};
|
|
130
124
|
}>> & Readonly<{
|
|
131
|
-
|
|
132
|
-
onError?: ((
|
|
133
|
-
|
|
125
|
+
onClick?: (() => any) | undefined;
|
|
126
|
+
onError?: ((_event: Event) => any) | undefined;
|
|
127
|
+
onLoad?: ((_event: Event) => any) | undefined;
|
|
134
128
|
}>, {
|
|
135
129
|
zIndex: number;
|
|
136
|
-
|
|
137
|
-
|
|
130
|
+
placeholder: import("@gx-design-vue/pro-utils/dist").CustomRender;
|
|
131
|
+
preview: boolean | Partial<{
|
|
132
|
+
urls: string[];
|
|
138
133
|
disabled: boolean;
|
|
139
134
|
zIndex: number;
|
|
140
135
|
current: number;
|
|
@@ -144,12 +139,11 @@ declare const GImage: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
144
139
|
countRender: import("@gx-design-vue/pro-utils/dist").WithFalse<(current: number, total: number) => import("@gx-design-vue/pro-utils/dist").CustomRender>;
|
|
145
140
|
icons: import(".").PreviewPropsIcons;
|
|
146
141
|
}>;
|
|
147
|
-
showPreview: boolean;
|
|
148
142
|
src: string;
|
|
149
143
|
alt: string;
|
|
150
|
-
fit: "
|
|
151
|
-
placeholder: import("@gx-design-vue/pro-utils/dist").CustomRender;
|
|
144
|
+
fit: "fill" | "contain" | "cover" | "none" | "scale-down";
|
|
152
145
|
fallback: import("@gx-design-vue/pro-utils/dist").CustomRender;
|
|
146
|
+
wrapperStyle: CSSProperties;
|
|
153
147
|
}, SlotsType<{
|
|
154
148
|
default(): void;
|
|
155
149
|
close(): void;
|
|
@@ -33,7 +33,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
33
33
|
tools: PropType<ImagePreviewTools[]>;
|
|
34
34
|
onClose: PropType<() => void>;
|
|
35
35
|
onActive: PropType<(offset: number) => void>;
|
|
36
|
-
}>, () => JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
36
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
37
37
|
open: PropType<boolean>;
|
|
38
38
|
count: {
|
|
39
39
|
type: PropType<number>;
|
|
@@ -68,8 +68,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
68
68
|
onActive: PropType<(offset: number) => void>;
|
|
69
69
|
}>> & Readonly<{}>, {
|
|
70
70
|
zIndex: number;
|
|
71
|
-
infinite: boolean;
|
|
72
71
|
current: number;
|
|
72
|
+
infinite: boolean;
|
|
73
73
|
icons: import("./props").PreviewPropsIcons;
|
|
74
74
|
count: number;
|
|
75
75
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fix positon x,y point when
|
|
3
|
+
*
|
|
4
|
+
* Ele width && height < client
|
|
5
|
+
* - Back origin
|
|
6
|
+
*
|
|
7
|
+
* - Ele width | height > clientWidth | clientHeight
|
|
8
|
+
* - left | top > 0 -> Back 0
|
|
9
|
+
* - left | top + width | height < clientWidth | clientHeight -> Back left | top + width | height === clientWidth | clientHeight
|
|
10
|
+
*
|
|
11
|
+
* Regardless of other
|
|
12
|
+
*/
|
|
13
|
+
export default function getFixScaleEleTransPosition(width: number, height: number, left: number, top: number): null | {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
export interface TransformType {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
rotate: number;
|
|
6
|
+
scale: number;
|
|
7
|
+
flipX: boolean;
|
|
8
|
+
flipY: boolean;
|
|
9
|
+
}
|
|
10
|
+
export type TransformAction = 'flipY' | 'flipX' | 'rotateLeft' | 'rotateRight' | 'zoomIn' | 'zoomOut' | 'close' | 'prev' | 'next' | 'wheel' | 'doubleClick' | 'move' | 'dragRebound' | 'touchZoom' | 'reset';
|
|
11
|
+
export type UpdateTransformFunc = (newTransform: Partial<TransformType>, action: TransformAction) => void;
|
|
12
|
+
export type DispatchZoomChangeFunc = (ratio: number, action: TransformAction, centerX?: number, centerY?: number, isTouch?: boolean) => void;
|
|
13
|
+
export default function useImageTransform(imgRef: Ref<HTMLImageElement>, minScale: Ref<number>, maxScale: Ref<number>, onTransform?: (info: {
|
|
14
|
+
transform: TransformType;
|
|
15
|
+
action: TransformAction;
|
|
16
|
+
}) => void): {
|
|
17
|
+
transform: Ref<{
|
|
18
|
+
x: number;
|
|
19
|
+
y: number;
|
|
20
|
+
rotate: number;
|
|
21
|
+
scale: number;
|
|
22
|
+
flipX: boolean;
|
|
23
|
+
flipY: boolean;
|
|
24
|
+
}, {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
rotate: number;
|
|
28
|
+
scale: number;
|
|
29
|
+
flipX: boolean;
|
|
30
|
+
flipY: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
resetTransform: (action: TransformAction) => void;
|
|
33
|
+
updateTransform: UpdateTransformFunc;
|
|
34
|
+
dispatchZoomChange: DispatchZoomChangeFunc;
|
|
35
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { MouseEventHandler } from '../typings';
|
|
3
|
+
import type { DispatchZoomChangeFunc, TransformType, UpdateTransformFunc } from './useImageTransform';
|
|
4
|
+
export default function useMouseEvent(imgRef: Ref<HTMLImageElement>, movable: Ref<boolean>, visible: Ref<boolean>, scaleStep: Ref<number>, transform: Ref<TransformType>, updateTransform: UpdateTransformFunc, dispatchZoomChange: DispatchZoomChangeFunc): {
|
|
5
|
+
isMoving: Ref<boolean, boolean>;
|
|
6
|
+
onMouseDown: MouseEventHandler;
|
|
7
|
+
onMouseMove: MouseEventHandler;
|
|
8
|
+
onMouseUp: MouseEventHandler;
|
|
9
|
+
onWheel: (event: WheelEvent) => void;
|
|
10
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Ref } from 'vue';
|
|
2
|
+
import type { DispatchZoomChangeFunc, TransformType, UpdateTransformFunc } from './useImageTransform';
|
|
3
|
+
export default function useTouchEvent(imgRef: Ref<HTMLImageElement>, movable: Ref<boolean>, visible: Ref<boolean>, minScale: Ref<number>, transform: Ref<TransformType>, updateTransform: UpdateTransformFunc, dispatchZoomChange: DispatchZoomChangeFunc): {
|
|
4
|
+
isTouching: Ref<boolean, boolean>;
|
|
5
|
+
onTouchStart: (event: TouchEvent) => void;
|
|
6
|
+
onTouchMove: (event: TouchEvent) => void;
|
|
7
|
+
onTouchEnd: () => void;
|
|
8
|
+
};
|
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import type { ExtractPropTypes } from 'vue';
|
|
2
|
-
import
|
|
1
|
+
import type { ExtractPropTypes, SlotsType } from 'vue';
|
|
2
|
+
import type { TransformAction, TransformType } from './hooks/useImageTransform';
|
|
3
|
+
import type { PreviewPropsIcons } from './props';
|
|
4
|
+
import imagePreviewProps from './props';
|
|
3
5
|
export declare const slotsNames: string[];
|
|
4
6
|
export type ImagePreviewProps = Partial<ExtractPropTypes<typeof imagePreviewProps>>;
|
|
5
|
-
declare const
|
|
6
|
-
|
|
7
|
+
declare const GImagePreview: import("vue").DefineComponent<ExtractPropTypes<{
|
|
8
|
+
urls: {
|
|
7
9
|
type: import("vue").PropType<string[]>;
|
|
8
10
|
default: () => never[];
|
|
9
11
|
};
|
|
12
|
+
open: {
|
|
13
|
+
type: import("vue").PropType<boolean>;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
scaleStep: {
|
|
17
|
+
type: import("vue").PropType<number>;
|
|
18
|
+
default: number;
|
|
19
|
+
};
|
|
20
|
+
minScale: {
|
|
21
|
+
type: import("vue").PropType<number>;
|
|
22
|
+
default: number;
|
|
23
|
+
};
|
|
24
|
+
maxScale: {
|
|
25
|
+
type: import("vue").PropType<number>;
|
|
26
|
+
default: number;
|
|
27
|
+
};
|
|
28
|
+
movable: {
|
|
29
|
+
type: import("vue").PropType<boolean>;
|
|
30
|
+
default: boolean;
|
|
31
|
+
};
|
|
10
32
|
disabled: import("vue").PropType<boolean>;
|
|
11
33
|
zIndex: {
|
|
12
34
|
type: import("vue").PropType<number>;
|
|
@@ -32,11 +54,44 @@ declare const ImagePreview: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
32
54
|
type: import("vue").PropType<PreviewPropsIcons>;
|
|
33
55
|
default: () => PreviewPropsIcons;
|
|
34
56
|
};
|
|
35
|
-
|
|
36
|
-
|
|
57
|
+
onTransform: import("vue").PropType<(info: {
|
|
58
|
+
transform: TransformType;
|
|
59
|
+
action: TransformAction;
|
|
60
|
+
}) => void>;
|
|
61
|
+
onOpenChange: import("vue").PropType<(val: boolean) => void>;
|
|
62
|
+
'onUpdate:open': import("vue").PropType<(val: boolean) => void>;
|
|
63
|
+
}>, () => import("ant-design-vue/es/_util/type").VueNode, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
64
|
+
close: () => true;
|
|
65
|
+
transform: (_info: {
|
|
66
|
+
transform: TransformType;
|
|
67
|
+
action: TransformAction;
|
|
68
|
+
}) => true;
|
|
69
|
+
'update:open': (_val: boolean) => true;
|
|
70
|
+
}, string, import("vue").PublicProps, Readonly<ExtractPropTypes<{
|
|
71
|
+
urls: {
|
|
37
72
|
type: import("vue").PropType<string[]>;
|
|
38
73
|
default: () => never[];
|
|
39
74
|
};
|
|
75
|
+
open: {
|
|
76
|
+
type: import("vue").PropType<boolean>;
|
|
77
|
+
default: boolean;
|
|
78
|
+
};
|
|
79
|
+
scaleStep: {
|
|
80
|
+
type: import("vue").PropType<number>;
|
|
81
|
+
default: number;
|
|
82
|
+
};
|
|
83
|
+
minScale: {
|
|
84
|
+
type: import("vue").PropType<number>;
|
|
85
|
+
default: number;
|
|
86
|
+
};
|
|
87
|
+
maxScale: {
|
|
88
|
+
type: import("vue").PropType<number>;
|
|
89
|
+
default: number;
|
|
90
|
+
};
|
|
91
|
+
movable: {
|
|
92
|
+
type: import("vue").PropType<boolean>;
|
|
93
|
+
default: boolean;
|
|
94
|
+
};
|
|
40
95
|
disabled: import("vue").PropType<boolean>;
|
|
41
96
|
zIndex: {
|
|
42
97
|
type: import("vue").PropType<number>;
|
|
@@ -62,16 +117,41 @@ declare const ImagePreview: import("vue").DefineComponent<ExtractPropTypes<{
|
|
|
62
117
|
type: import("vue").PropType<PreviewPropsIcons>;
|
|
63
118
|
default: () => PreviewPropsIcons;
|
|
64
119
|
};
|
|
120
|
+
onTransform: import("vue").PropType<(info: {
|
|
121
|
+
transform: TransformType;
|
|
122
|
+
action: TransformAction;
|
|
123
|
+
}) => void>;
|
|
124
|
+
onOpenChange: import("vue").PropType<(val: boolean) => void>;
|
|
125
|
+
'onUpdate:open': import("vue").PropType<(val: boolean) => void>;
|
|
65
126
|
}>> & Readonly<{
|
|
66
|
-
onClose?: ((
|
|
67
|
-
|
|
68
|
-
|
|
127
|
+
onClose?: (() => any) | undefined;
|
|
128
|
+
onTransform?: ((_info: {
|
|
129
|
+
transform: TransformType;
|
|
130
|
+
action: TransformAction;
|
|
131
|
+
}) => any) | undefined;
|
|
132
|
+
"onUpdate:open"?: ((_val: boolean) => any) | undefined;
|
|
69
133
|
}>, {
|
|
134
|
+
urls: string[];
|
|
70
135
|
zIndex: number;
|
|
71
|
-
infinite: boolean;
|
|
72
|
-
previewUrls: string[];
|
|
73
136
|
current: number;
|
|
137
|
+
infinite: boolean;
|
|
74
138
|
onHideOnClickModal: boolean;
|
|
75
139
|
icons: PreviewPropsIcons;
|
|
76
|
-
|
|
77
|
-
|
|
140
|
+
open: boolean;
|
|
141
|
+
scaleStep: number;
|
|
142
|
+
minScale: number;
|
|
143
|
+
maxScale: number;
|
|
144
|
+
movable: boolean;
|
|
145
|
+
}, SlotsType<{
|
|
146
|
+
close(): void;
|
|
147
|
+
left(): void;
|
|
148
|
+
right(): void;
|
|
149
|
+
rotateRight(): void;
|
|
150
|
+
rotateRight(): void;
|
|
151
|
+
zoomOut(): void;
|
|
152
|
+
flipX(): void;
|
|
153
|
+
flipY(): void;
|
|
154
|
+
rotateLeft(): void;
|
|
155
|
+
placeholder(): void;
|
|
156
|
+
}>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
157
|
+
export default GImagePreview;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { PropType, VNode } from 'vue';
|
|
2
1
|
import type { CustomRender, WithFalse } from '@gx-design-vue/pro-utils';
|
|
3
|
-
|
|
2
|
+
import type { PropType, VNode } from 'vue';
|
|
3
|
+
import type { TransformAction, TransformType } from './hooks/useImageTransform';
|
|
4
|
+
export interface PreviewPropsIcons {
|
|
4
5
|
close?: VNode;
|
|
5
6
|
rotateLeft?: VNode;
|
|
6
7
|
rotateRight?: VNode;
|
|
@@ -10,9 +11,9 @@ export type PreviewPropsIcons = {
|
|
|
10
11
|
right?: VNode;
|
|
11
12
|
flipX?: VNode;
|
|
12
13
|
flipY?: VNode;
|
|
13
|
-
}
|
|
14
|
+
}
|
|
14
15
|
export type BaseImagePreviewProps = Partial<{
|
|
15
|
-
|
|
16
|
+
urls: string[];
|
|
16
17
|
disabled: boolean;
|
|
17
18
|
zIndex: number;
|
|
18
19
|
current: number;
|
|
@@ -23,10 +24,30 @@ export type BaseImagePreviewProps = Partial<{
|
|
|
23
24
|
icons: PreviewPropsIcons;
|
|
24
25
|
}>;
|
|
25
26
|
declare const _default: {
|
|
26
|
-
|
|
27
|
+
urls: {
|
|
27
28
|
type: PropType<string[]>;
|
|
28
29
|
default: () => never[];
|
|
29
30
|
};
|
|
31
|
+
open: {
|
|
32
|
+
type: PropType<boolean>;
|
|
33
|
+
default: boolean;
|
|
34
|
+
};
|
|
35
|
+
scaleStep: {
|
|
36
|
+
type: PropType<number>;
|
|
37
|
+
default: number;
|
|
38
|
+
};
|
|
39
|
+
minScale: {
|
|
40
|
+
type: PropType<number>;
|
|
41
|
+
default: number;
|
|
42
|
+
};
|
|
43
|
+
maxScale: {
|
|
44
|
+
type: PropType<number>;
|
|
45
|
+
default: number;
|
|
46
|
+
};
|
|
47
|
+
movable: {
|
|
48
|
+
type: PropType<boolean>;
|
|
49
|
+
default: boolean;
|
|
50
|
+
};
|
|
30
51
|
disabled: PropType<boolean>;
|
|
31
52
|
zIndex: {
|
|
32
53
|
type: PropType<number>;
|
|
@@ -52,5 +73,11 @@ declare const _default: {
|
|
|
52
73
|
type: PropType<PreviewPropsIcons>;
|
|
53
74
|
default: () => PreviewPropsIcons;
|
|
54
75
|
};
|
|
76
|
+
onTransform: PropType<(info: {
|
|
77
|
+
transform: TransformType;
|
|
78
|
+
action: TransformAction;
|
|
79
|
+
}) => void>;
|
|
80
|
+
onOpenChange: PropType<(val: boolean) => void>;
|
|
81
|
+
'onUpdate:open': PropType<(val: boolean) => void>;
|
|
55
82
|
};
|
|
56
83
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CSSObject } from 'ant-design-vue';
|
|
2
1
|
import type { ProAliasToken } from '@gx-design-vue/pro-provider';
|
|
2
|
+
import type { CSSObject } from 'ant-design-vue';
|
|
3
3
|
import { Keyframe } from '@gx-design-vue/pro-provider';
|
|
4
4
|
export interface ImageToken extends ProAliasToken {
|
|
5
5
|
previewCls: string;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { ComputedRef, VNode } from 'vue';
|
|
2
2
|
import type { PreviewPropsIcons } from './props';
|
|
3
3
|
export type MouseEventHandler = (e: MouseEvent) => void;
|
|
4
|
-
export type WheelEventHandler = (e: WheelEvent) => void;
|
|
5
4
|
export interface PreviewUrl {
|
|
6
5
|
url: string;
|
|
7
6
|
loading: boolean;
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function getClientSize(): {
|
|
6
|
-
width: number;
|
|
7
|
-
height: number;
|
|
8
|
-
};
|
|
9
|
-
export declare function getFixScaleEleTransPosition(width: number, height: number, left: number, top: number): null | {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
};
|
|
1
|
+
/** Scale the ratio base */
|
|
2
|
+
export declare const BASE_SCALE_RATIO = 1;
|
|
3
|
+
/** The maximum zoom ratio when the mouse zooms in, adjustable */
|
|
4
|
+
export declare const WHEEL_MAX_SCALE_RATIO = 1;
|