@cyberpunk-vue/components 1.13.10 → 1.13.11
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/dialog/index.d.ts +3 -3
- package/dist/dialog/src/dialog.vue.d.ts +1 -1
- package/dist/image/index.d.ts +12 -12
- package/dist/image/src/image.d.ts +46 -7
- package/dist/image/src/image.vue.d.ts +5 -5
- package/dist/image-preview/index.d.ts +237 -0
- package/dist/image-preview/src/image-preview.d.ts +45 -1
- package/dist/image-preview/src/image-preview.vue.d.ts +18 -29
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1039 -997
- package/dist/upload/index.d.ts +3 -3
- package/dist/upload/src/upload.vue.d.ts +1 -1
- package/package.json +4 -4
package/dist/dialog/index.d.ts
CHANGED
|
@@ -280,13 +280,13 @@ export declare const CpDialog: import('../utils').SFCWithInstall<{
|
|
|
280
280
|
loadingClass: import('.').DialogCustomClass;
|
|
281
281
|
loadingStyle: string | import('vue').CSSProperties;
|
|
282
282
|
overlayStyle: string | import('vue').CSSProperties;
|
|
283
|
+
closeOnClickModal: boolean;
|
|
283
284
|
draggable: boolean;
|
|
284
285
|
closeOnEscape: boolean;
|
|
285
286
|
fullscreen: boolean;
|
|
286
287
|
fullscreenInset: import('.').DialogFullscreenInset;
|
|
287
288
|
modal: boolean;
|
|
288
289
|
appendToBody: boolean;
|
|
289
|
-
closeOnClickModal: boolean;
|
|
290
290
|
showClose: boolean;
|
|
291
291
|
beforeClose: import('.').DialogBeforeCloseFn;
|
|
292
292
|
lockScroll: boolean;
|
|
@@ -564,13 +564,13 @@ export declare const CpDialog: import('../utils').SFCWithInstall<{
|
|
|
564
564
|
loadingClass: import('.').DialogCustomClass;
|
|
565
565
|
loadingStyle: string | import('vue').CSSProperties;
|
|
566
566
|
overlayStyle: string | import('vue').CSSProperties;
|
|
567
|
+
closeOnClickModal: boolean;
|
|
567
568
|
draggable: boolean;
|
|
568
569
|
closeOnEscape: boolean;
|
|
569
570
|
fullscreen: boolean;
|
|
570
571
|
fullscreenInset: import('.').DialogFullscreenInset;
|
|
571
572
|
modal: boolean;
|
|
572
573
|
appendToBody: boolean;
|
|
573
|
-
closeOnClickModal: boolean;
|
|
574
574
|
showClose: boolean;
|
|
575
575
|
beforeClose: import('.').DialogBeforeCloseFn;
|
|
576
576
|
lockScroll: boolean;
|
|
@@ -850,13 +850,13 @@ export declare const CpDialog: import('../utils').SFCWithInstall<{
|
|
|
850
850
|
loadingClass: import('.').DialogCustomClass;
|
|
851
851
|
loadingStyle: string | import('vue').CSSProperties;
|
|
852
852
|
overlayStyle: string | import('vue').CSSProperties;
|
|
853
|
+
closeOnClickModal: boolean;
|
|
853
854
|
draggable: boolean;
|
|
854
855
|
closeOnEscape: boolean;
|
|
855
856
|
fullscreen: boolean;
|
|
856
857
|
fullscreenInset: import('.').DialogFullscreenInset;
|
|
857
858
|
modal: boolean;
|
|
858
859
|
appendToBody: boolean;
|
|
859
|
-
closeOnClickModal: boolean;
|
|
860
860
|
showClose: boolean;
|
|
861
861
|
beforeClose: import('.').DialogBeforeCloseFn;
|
|
862
862
|
lockScroll: boolean;
|
|
@@ -490,13 +490,13 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
490
490
|
loadingClass: import('./dialog').DialogCustomClass;
|
|
491
491
|
loadingStyle: string | CSSProperties;
|
|
492
492
|
overlayStyle: string | CSSProperties;
|
|
493
|
+
closeOnClickModal: boolean;
|
|
493
494
|
draggable: boolean;
|
|
494
495
|
closeOnEscape: boolean;
|
|
495
496
|
fullscreen: boolean;
|
|
496
497
|
fullscreenInset: import('./dialog').DialogFullscreenInset;
|
|
497
498
|
modal: boolean;
|
|
498
499
|
appendToBody: boolean;
|
|
499
|
-
closeOnClickModal: boolean;
|
|
500
500
|
showClose: boolean;
|
|
501
501
|
beforeClose: DialogBeforeCloseFn;
|
|
502
502
|
lockScroll: boolean;
|
package/dist/image/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
33
33
|
readonly default: false;
|
|
34
34
|
};
|
|
35
35
|
readonly preview: {
|
|
36
|
-
readonly type:
|
|
36
|
+
readonly type: import('vue').PropType<import('.').ImagePreviewConfig>;
|
|
37
37
|
readonly default: false;
|
|
38
38
|
};
|
|
39
39
|
readonly previewSrc: {
|
|
@@ -117,14 +117,14 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
117
117
|
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
118
118
|
readonly color: string;
|
|
119
119
|
readonly shape: import('.').ImageShape;
|
|
120
|
+
readonly initialIndex: number;
|
|
121
|
+
readonly download: boolean;
|
|
120
122
|
readonly src: string;
|
|
121
123
|
readonly alt: string;
|
|
122
124
|
readonly lazy: boolean;
|
|
123
|
-
readonly preview:
|
|
125
|
+
readonly preview: import('.').ImagePreviewConfig;
|
|
124
126
|
readonly previewSrc: string;
|
|
125
127
|
readonly previewSrcList: string[];
|
|
126
|
-
readonly initialIndex: number;
|
|
127
|
-
readonly download: boolean;
|
|
128
128
|
readonly fallbackSrc: string;
|
|
129
129
|
readonly showDecor: boolean;
|
|
130
130
|
readonly decorPosition: import('.').ImageDecorPosition;
|
|
@@ -166,7 +166,7 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
166
166
|
readonly default: false;
|
|
167
167
|
};
|
|
168
168
|
readonly preview: {
|
|
169
|
-
readonly type:
|
|
169
|
+
readonly type: import('vue').PropType<import('.').ImagePreviewConfig>;
|
|
170
170
|
readonly default: false;
|
|
171
171
|
};
|
|
172
172
|
readonly previewSrc: {
|
|
@@ -247,14 +247,14 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
247
247
|
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
248
248
|
readonly color: string;
|
|
249
249
|
readonly shape: import('.').ImageShape;
|
|
250
|
+
readonly initialIndex: number;
|
|
251
|
+
readonly download: boolean;
|
|
250
252
|
readonly src: string;
|
|
251
253
|
readonly alt: string;
|
|
252
254
|
readonly lazy: boolean;
|
|
253
|
-
readonly preview:
|
|
255
|
+
readonly preview: import('.').ImagePreviewConfig;
|
|
254
256
|
readonly previewSrc: string;
|
|
255
257
|
readonly previewSrcList: string[];
|
|
256
|
-
readonly initialIndex: number;
|
|
257
|
-
readonly download: boolean;
|
|
258
258
|
readonly fallbackSrc: string;
|
|
259
259
|
readonly showDecor: boolean;
|
|
260
260
|
readonly decorPosition: import('.').ImageDecorPosition;
|
|
@@ -290,7 +290,7 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
290
290
|
readonly default: false;
|
|
291
291
|
};
|
|
292
292
|
readonly preview: {
|
|
293
|
-
readonly type:
|
|
293
|
+
readonly type: import('vue').PropType<import('.').ImagePreviewConfig>;
|
|
294
294
|
readonly default: false;
|
|
295
295
|
};
|
|
296
296
|
readonly previewSrc: {
|
|
@@ -374,14 +374,14 @@ export declare const CpImage: import('../utils').SFCWithInstall<{
|
|
|
374
374
|
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
375
375
|
readonly color: string;
|
|
376
376
|
readonly shape: import('.').ImageShape;
|
|
377
|
+
readonly initialIndex: number;
|
|
378
|
+
readonly download: boolean;
|
|
377
379
|
readonly src: string;
|
|
378
380
|
readonly alt: string;
|
|
379
381
|
readonly lazy: boolean;
|
|
380
|
-
readonly preview:
|
|
382
|
+
readonly preview: import('.').ImagePreviewConfig;
|
|
381
383
|
readonly previewSrc: string;
|
|
382
384
|
readonly previewSrcList: string[];
|
|
383
|
-
readonly initialIndex: number;
|
|
384
|
-
readonly download: boolean;
|
|
385
385
|
readonly fallbackSrc: string;
|
|
386
386
|
readonly showDecor: boolean;
|
|
387
387
|
readonly decorPosition: import('.').ImageDecorPosition;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
2
|
import { DurationValue } from '@cyberpunk-vue/hooks';
|
|
3
|
+
import { ImagePreviewClosePayload, ImagePreviewProps, ImagePreviewSwitchPayload } from '../../image-preview/src/image-preview';
|
|
3
4
|
/**
|
|
4
5
|
* 图片适应模式
|
|
5
6
|
* - `contain` - 保持比例,完整显示
|
|
@@ -25,6 +26,29 @@ export type ImageShape = 'clip' | 'no-clip' | 'round' | 'circle';
|
|
|
25
26
|
* - `top-right` - 右上角
|
|
26
27
|
*/
|
|
27
28
|
export type ImageDecorPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right';
|
|
29
|
+
export type ImagePreviewOptions = Partial<Omit<ImagePreviewProps, 'modelValue' | 'urlList' | 'initialIndex'>> & {
|
|
30
|
+
/**
|
|
31
|
+
* 单图预览地址,不传时使用图片当前 src
|
|
32
|
+
*/
|
|
33
|
+
url?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 多图预览列表,优先级高于 url
|
|
36
|
+
*/
|
|
37
|
+
urlList?: string[];
|
|
38
|
+
/**
|
|
39
|
+
* 初始显示的图片索引
|
|
40
|
+
*/
|
|
41
|
+
initialIndex?: number;
|
|
42
|
+
/**
|
|
43
|
+
* 关闭预览时触发
|
|
44
|
+
*/
|
|
45
|
+
onClose?: (payload: ImagePreviewClosePayload) => void;
|
|
46
|
+
/**
|
|
47
|
+
* 切换图片时触发
|
|
48
|
+
*/
|
|
49
|
+
onSwitch?: (payload: ImagePreviewSwitchPayload) => void;
|
|
50
|
+
};
|
|
51
|
+
export type ImagePreviewConfig = boolean | ImagePreviewOptions;
|
|
28
52
|
/**
|
|
29
53
|
* CpImage 组件 Props 定义
|
|
30
54
|
*
|
|
@@ -43,6 +67,17 @@ export type ImageDecorPosition = 'bottom-left' | 'bottom-right' | 'top-left' | '
|
|
|
43
67
|
*
|
|
44
68
|
* <!-- 圆形头像 -->
|
|
45
69
|
* <CpImage src="/avatar.jpg" shape="circle" :width="64" :height="64" />
|
|
70
|
+
*
|
|
71
|
+
* <!-- 聚合式预览配置 -->
|
|
72
|
+
* <CpImage
|
|
73
|
+
* src="/thumb.jpg"
|
|
74
|
+
* :preview="{
|
|
75
|
+
* urlList: ['/a.jpg', '/b.jpg'],
|
|
76
|
+
* initialIndex: 0,
|
|
77
|
+
* closeOnClickModal: false,
|
|
78
|
+
* onClose: ({ index }) => console.log(index)
|
|
79
|
+
* }"
|
|
80
|
+
* />
|
|
46
81
|
* ```
|
|
47
82
|
* @category 展示组件
|
|
48
83
|
* @displayName CpImage 图片
|
|
@@ -97,17 +132,18 @@ export declare const imageProps: {
|
|
|
97
132
|
readonly default: false;
|
|
98
133
|
};
|
|
99
134
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
135
|
+
* 预览配置
|
|
136
|
+
* 设为 true 时使用当前图片和默认预览配置;传入对象时可聚合配置预览图片、交互行为和事件回调。
|
|
102
137
|
* @default false
|
|
103
138
|
*/
|
|
104
139
|
readonly preview: {
|
|
105
|
-
readonly type:
|
|
140
|
+
readonly type: PropType<ImagePreviewConfig>;
|
|
106
141
|
readonly default: false;
|
|
107
142
|
};
|
|
108
143
|
/**
|
|
109
|
-
*
|
|
144
|
+
* 已废弃:请使用 `preview.url`
|
|
110
145
|
* 在预览中使用的高清图片地址,不指定则使用 src
|
|
146
|
+
* @deprecated 请使用 `preview.url`
|
|
111
147
|
* @default ''
|
|
112
148
|
*/
|
|
113
149
|
readonly previewSrc: {
|
|
@@ -115,8 +151,9 @@ export declare const imageProps: {
|
|
|
115
151
|
readonly default: "";
|
|
116
152
|
};
|
|
117
153
|
/**
|
|
118
|
-
*
|
|
154
|
+
* 已废弃:请使用 `preview.urlList`
|
|
119
155
|
* 传入后自动启用预览,点击图片可查看整个图片列表
|
|
156
|
+
* @deprecated 请使用 `preview.urlList`
|
|
120
157
|
* @default []
|
|
121
158
|
*/
|
|
122
159
|
readonly previewSrcList: {
|
|
@@ -124,7 +161,8 @@ export declare const imageProps: {
|
|
|
124
161
|
readonly default: () => never[];
|
|
125
162
|
};
|
|
126
163
|
/**
|
|
127
|
-
*
|
|
164
|
+
* 已废弃:请使用 `preview.initialIndex`
|
|
165
|
+
* @deprecated 请使用 `preview.initialIndex`
|
|
128
166
|
* @default 0
|
|
129
167
|
* @example `<CpImage :preview-src-list="[...]" :initial-index="1" />`
|
|
130
168
|
*/
|
|
@@ -133,7 +171,8 @@ export declare const imageProps: {
|
|
|
133
171
|
readonly default: 0;
|
|
134
172
|
};
|
|
135
173
|
/**
|
|
136
|
-
*
|
|
174
|
+
* 已废弃:请使用 `preview.download`
|
|
175
|
+
* @deprecated 请使用 `preview.download`
|
|
137
176
|
* @default false
|
|
138
177
|
*/
|
|
139
178
|
readonly download: {
|
|
@@ -33,7 +33,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
33
33
|
readonly default: false;
|
|
34
34
|
};
|
|
35
35
|
readonly preview: {
|
|
36
|
-
readonly type:
|
|
36
|
+
readonly type: import('vue').PropType<import('./image').ImagePreviewConfig>;
|
|
37
37
|
readonly default: false;
|
|
38
38
|
};
|
|
39
39
|
readonly previewSrc: {
|
|
@@ -134,7 +134,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
134
134
|
readonly default: false;
|
|
135
135
|
};
|
|
136
136
|
readonly preview: {
|
|
137
|
-
readonly type:
|
|
137
|
+
readonly type: import('vue').PropType<import('./image').ImagePreviewConfig>;
|
|
138
138
|
readonly default: false;
|
|
139
139
|
};
|
|
140
140
|
readonly previewSrc: {
|
|
@@ -220,14 +220,14 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
220
220
|
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
221
221
|
readonly color: string;
|
|
222
222
|
readonly shape: import('./image').ImageShape;
|
|
223
|
+
readonly initialIndex: number;
|
|
224
|
+
readonly download: boolean;
|
|
223
225
|
readonly src: string;
|
|
224
226
|
readonly alt: string;
|
|
225
227
|
readonly lazy: boolean;
|
|
226
|
-
readonly preview:
|
|
228
|
+
readonly preview: import('./image').ImagePreviewConfig;
|
|
227
229
|
readonly previewSrc: string;
|
|
228
230
|
readonly previewSrcList: string[];
|
|
229
|
-
readonly initialIndex: number;
|
|
230
|
-
readonly download: boolean;
|
|
231
231
|
readonly fallbackSrc: string;
|
|
232
232
|
readonly showDecor: boolean;
|
|
233
233
|
readonly decorPosition: import('./image').ImageDecorPosition;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CpImagePreview 大图预览组件
|
|
3
|
+
*
|
|
4
|
+
* @description 赛博朋克风格全屏大图预览组件,支持缩放、旋转、多图切换。
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```vue
|
|
8
|
+
* <CpImagePreview v-model="visible" :url-list="['/a.jpg', '/b.jpg']" />
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const CpImagePreview: import('../utils').SFCWithInstall<{
|
|
12
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
13
|
+
readonly modelValue: {
|
|
14
|
+
readonly type: BooleanConstructor;
|
|
15
|
+
readonly default: false;
|
|
16
|
+
};
|
|
17
|
+
readonly urlList: {
|
|
18
|
+
readonly type: import('vue').PropType<string[]>;
|
|
19
|
+
readonly default: () => never[];
|
|
20
|
+
};
|
|
21
|
+
readonly initialIndex: {
|
|
22
|
+
readonly type: NumberConstructor;
|
|
23
|
+
readonly default: 0;
|
|
24
|
+
};
|
|
25
|
+
readonly zIndex: {
|
|
26
|
+
readonly type: NumberConstructor;
|
|
27
|
+
readonly default: 2000;
|
|
28
|
+
};
|
|
29
|
+
readonly infinite: {
|
|
30
|
+
readonly type: BooleanConstructor;
|
|
31
|
+
readonly default: true;
|
|
32
|
+
};
|
|
33
|
+
readonly teleportTo: {
|
|
34
|
+
readonly type: import('vue').PropType<string | HTMLElement>;
|
|
35
|
+
readonly default: "body";
|
|
36
|
+
};
|
|
37
|
+
readonly type: {
|
|
38
|
+
readonly type: import('vue').PropType<"default" | "primary" | "success" | "warning" | "error" | "info">;
|
|
39
|
+
readonly default: "primary";
|
|
40
|
+
};
|
|
41
|
+
readonly color: {
|
|
42
|
+
readonly type: StringConstructor;
|
|
43
|
+
readonly default: "";
|
|
44
|
+
};
|
|
45
|
+
readonly download: {
|
|
46
|
+
readonly type: BooleanConstructor;
|
|
47
|
+
readonly default: false;
|
|
48
|
+
};
|
|
49
|
+
readonly closeOnClickModal: {
|
|
50
|
+
readonly type: BooleanConstructor;
|
|
51
|
+
readonly default: true;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{
|
|
54
|
+
onSwitch?: ((index: number) => any) | undefined;
|
|
55
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
56
|
+
onClose?: ((payload: import('.').ImagePreviewPayload) => any) | undefined;
|
|
57
|
+
}>, {
|
|
58
|
+
close: () => void;
|
|
59
|
+
prev: () => void;
|
|
60
|
+
next: () => void;
|
|
61
|
+
zoomIn: () => void;
|
|
62
|
+
zoomOut: () => void;
|
|
63
|
+
rotateLeft: () => void;
|
|
64
|
+
rotateRight: () => void;
|
|
65
|
+
resetTransform: () => void;
|
|
66
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
67
|
+
switch: (index: number) => void;
|
|
68
|
+
"update:modelValue": (value: boolean) => void;
|
|
69
|
+
close: (payload: import('.').ImagePreviewPayload) => void;
|
|
70
|
+
}, import('vue').PublicProps, {
|
|
71
|
+
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
72
|
+
readonly color: string;
|
|
73
|
+
readonly modelValue: boolean;
|
|
74
|
+
readonly infinite: boolean;
|
|
75
|
+
readonly zIndex: number;
|
|
76
|
+
readonly urlList: string[];
|
|
77
|
+
readonly initialIndex: number;
|
|
78
|
+
readonly teleportTo: string | HTMLElement;
|
|
79
|
+
readonly download: boolean;
|
|
80
|
+
readonly closeOnClickModal: boolean;
|
|
81
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
82
|
+
P: {};
|
|
83
|
+
B: {};
|
|
84
|
+
D: {};
|
|
85
|
+
C: {};
|
|
86
|
+
M: {};
|
|
87
|
+
Defaults: {};
|
|
88
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
89
|
+
readonly modelValue: {
|
|
90
|
+
readonly type: BooleanConstructor;
|
|
91
|
+
readonly default: false;
|
|
92
|
+
};
|
|
93
|
+
readonly urlList: {
|
|
94
|
+
readonly type: import('vue').PropType<string[]>;
|
|
95
|
+
readonly default: () => never[];
|
|
96
|
+
};
|
|
97
|
+
readonly initialIndex: {
|
|
98
|
+
readonly type: NumberConstructor;
|
|
99
|
+
readonly default: 0;
|
|
100
|
+
};
|
|
101
|
+
readonly zIndex: {
|
|
102
|
+
readonly type: NumberConstructor;
|
|
103
|
+
readonly default: 2000;
|
|
104
|
+
};
|
|
105
|
+
readonly infinite: {
|
|
106
|
+
readonly type: BooleanConstructor;
|
|
107
|
+
readonly default: true;
|
|
108
|
+
};
|
|
109
|
+
readonly teleportTo: {
|
|
110
|
+
readonly type: import('vue').PropType<string | HTMLElement>;
|
|
111
|
+
readonly default: "body";
|
|
112
|
+
};
|
|
113
|
+
readonly type: {
|
|
114
|
+
readonly type: import('vue').PropType<"default" | "primary" | "success" | "warning" | "error" | "info">;
|
|
115
|
+
readonly default: "primary";
|
|
116
|
+
};
|
|
117
|
+
readonly color: {
|
|
118
|
+
readonly type: StringConstructor;
|
|
119
|
+
readonly default: "";
|
|
120
|
+
};
|
|
121
|
+
readonly download: {
|
|
122
|
+
readonly type: BooleanConstructor;
|
|
123
|
+
readonly default: false;
|
|
124
|
+
};
|
|
125
|
+
readonly closeOnClickModal: {
|
|
126
|
+
readonly type: BooleanConstructor;
|
|
127
|
+
readonly default: true;
|
|
128
|
+
};
|
|
129
|
+
}>> & Readonly<{
|
|
130
|
+
onSwitch?: ((index: number) => any) | undefined;
|
|
131
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
132
|
+
onClose?: ((payload: import('.').ImagePreviewPayload) => any) | undefined;
|
|
133
|
+
}>, {
|
|
134
|
+
close: () => void;
|
|
135
|
+
prev: () => void;
|
|
136
|
+
next: () => void;
|
|
137
|
+
zoomIn: () => void;
|
|
138
|
+
zoomOut: () => void;
|
|
139
|
+
rotateLeft: () => void;
|
|
140
|
+
rotateRight: () => void;
|
|
141
|
+
resetTransform: () => void;
|
|
142
|
+
}, {}, {}, {}, {
|
|
143
|
+
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
144
|
+
readonly color: string;
|
|
145
|
+
readonly modelValue: boolean;
|
|
146
|
+
readonly infinite: boolean;
|
|
147
|
+
readonly zIndex: number;
|
|
148
|
+
readonly urlList: string[];
|
|
149
|
+
readonly initialIndex: number;
|
|
150
|
+
readonly teleportTo: string | HTMLElement;
|
|
151
|
+
readonly download: boolean;
|
|
152
|
+
readonly closeOnClickModal: boolean;
|
|
153
|
+
}>;
|
|
154
|
+
__isFragment?: never;
|
|
155
|
+
__isTeleport?: never;
|
|
156
|
+
__isSuspense?: never;
|
|
157
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
158
|
+
readonly modelValue: {
|
|
159
|
+
readonly type: BooleanConstructor;
|
|
160
|
+
readonly default: false;
|
|
161
|
+
};
|
|
162
|
+
readonly urlList: {
|
|
163
|
+
readonly type: import('vue').PropType<string[]>;
|
|
164
|
+
readonly default: () => never[];
|
|
165
|
+
};
|
|
166
|
+
readonly initialIndex: {
|
|
167
|
+
readonly type: NumberConstructor;
|
|
168
|
+
readonly default: 0;
|
|
169
|
+
};
|
|
170
|
+
readonly zIndex: {
|
|
171
|
+
readonly type: NumberConstructor;
|
|
172
|
+
readonly default: 2000;
|
|
173
|
+
};
|
|
174
|
+
readonly infinite: {
|
|
175
|
+
readonly type: BooleanConstructor;
|
|
176
|
+
readonly default: true;
|
|
177
|
+
};
|
|
178
|
+
readonly teleportTo: {
|
|
179
|
+
readonly type: import('vue').PropType<string | HTMLElement>;
|
|
180
|
+
readonly default: "body";
|
|
181
|
+
};
|
|
182
|
+
readonly type: {
|
|
183
|
+
readonly type: import('vue').PropType<"default" | "primary" | "success" | "warning" | "error" | "info">;
|
|
184
|
+
readonly default: "primary";
|
|
185
|
+
};
|
|
186
|
+
readonly color: {
|
|
187
|
+
readonly type: StringConstructor;
|
|
188
|
+
readonly default: "";
|
|
189
|
+
};
|
|
190
|
+
readonly download: {
|
|
191
|
+
readonly type: BooleanConstructor;
|
|
192
|
+
readonly default: false;
|
|
193
|
+
};
|
|
194
|
+
readonly closeOnClickModal: {
|
|
195
|
+
readonly type: BooleanConstructor;
|
|
196
|
+
readonly default: true;
|
|
197
|
+
};
|
|
198
|
+
}>> & Readonly<{
|
|
199
|
+
onSwitch?: ((index: number) => any) | undefined;
|
|
200
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
201
|
+
onClose?: ((payload: import('.').ImagePreviewPayload) => any) | undefined;
|
|
202
|
+
}>, {
|
|
203
|
+
close: () => void;
|
|
204
|
+
prev: () => void;
|
|
205
|
+
next: () => void;
|
|
206
|
+
zoomIn: () => void;
|
|
207
|
+
zoomOut: () => void;
|
|
208
|
+
rotateLeft: () => void;
|
|
209
|
+
rotateRight: () => void;
|
|
210
|
+
resetTransform: () => void;
|
|
211
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
212
|
+
switch: (index: number) => void;
|
|
213
|
+
"update:modelValue": (value: boolean) => void;
|
|
214
|
+
close: (payload: import('.').ImagePreviewPayload) => void;
|
|
215
|
+
}, string, {
|
|
216
|
+
readonly type: "primary" | "success" | "warning" | "error" | "info" | "default";
|
|
217
|
+
readonly color: string;
|
|
218
|
+
readonly modelValue: boolean;
|
|
219
|
+
readonly infinite: boolean;
|
|
220
|
+
readonly zIndex: number;
|
|
221
|
+
readonly urlList: string[];
|
|
222
|
+
readonly initialIndex: number;
|
|
223
|
+
readonly teleportTo: string | HTMLElement;
|
|
224
|
+
readonly download: boolean;
|
|
225
|
+
readonly closeOnClickModal: boolean;
|
|
226
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
227
|
+
$slots: Readonly<{
|
|
228
|
+
toolbar?: (props: import('.').ImagePreviewToolbarSlotProps) => unknown;
|
|
229
|
+
'toolbar-append'?: (props: import('.').ImagePreviewToolbarSlotProps) => unknown;
|
|
230
|
+
}> & {
|
|
231
|
+
toolbar?: (props: import('.').ImagePreviewToolbarSlotProps) => unknown;
|
|
232
|
+
'toolbar-append'?: (props: import('.').ImagePreviewToolbarSlotProps) => unknown;
|
|
233
|
+
};
|
|
234
|
+
})>;
|
|
235
|
+
export default CpImagePreview;
|
|
236
|
+
export * from './src/image-preview';
|
|
237
|
+
export type { CpImagePreviewInstance } from './src/instance';
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
export interface ImagePreviewPayload {
|
|
3
|
+
index: number;
|
|
4
|
+
url: string;
|
|
5
|
+
urlList: string[];
|
|
6
|
+
}
|
|
7
|
+
export type ImagePreviewClosePayload = ImagePreviewPayload;
|
|
8
|
+
export type ImagePreviewSwitchPayload = ImagePreviewPayload;
|
|
9
|
+
export interface ImagePreviewToolbarSlotProps {
|
|
10
|
+
scale: number;
|
|
11
|
+
rotate: number;
|
|
12
|
+
currentIndex: number;
|
|
13
|
+
currentUrl: string;
|
|
14
|
+
urlList: string[];
|
|
15
|
+
isSingle: boolean;
|
|
16
|
+
canPrev: boolean;
|
|
17
|
+
canNext: boolean;
|
|
18
|
+
zoomMin: number;
|
|
19
|
+
zoomMax: number;
|
|
20
|
+
zoomIn: () => void;
|
|
21
|
+
zoomOut: () => void;
|
|
22
|
+
rotateLeft: () => void;
|
|
23
|
+
rotateRight: () => void;
|
|
24
|
+
resetTransform: () => void;
|
|
25
|
+
prev: () => void;
|
|
26
|
+
next: () => void;
|
|
27
|
+
close: () => void;
|
|
28
|
+
download: () => void;
|
|
29
|
+
}
|
|
2
30
|
/**
|
|
3
31
|
* CpImagePreview 组件 Props 定义
|
|
4
32
|
*
|
|
@@ -9,6 +37,14 @@ import { ExtractPropTypes, PropType } from 'vue';
|
|
|
9
37
|
* <!-- 基础用法 -->
|
|
10
38
|
* <CpImagePreview v-model="visible" :url-list="urls" />
|
|
11
39
|
*
|
|
40
|
+
* <!-- 禁止点击遮罩关闭,并在关闭时获取停留位置 -->
|
|
41
|
+
* <CpImagePreview
|
|
42
|
+
* v-model="visible"
|
|
43
|
+
* :url-list="urls"
|
|
44
|
+
* :close-on-click-modal="false"
|
|
45
|
+
* @close="({ index, url }) => console.log(index, url)"
|
|
46
|
+
* />
|
|
47
|
+
*
|
|
12
48
|
* <!-- 在内置工具栏末尾追加按钮 -->
|
|
13
49
|
* <CpImagePreview v-model="visible" :url-list="urls">
|
|
14
50
|
* <template #toolbar-append="{ currentUrl, close }">
|
|
@@ -114,6 +150,14 @@ export declare const imagePreviewProps: {
|
|
|
114
150
|
readonly type: BooleanConstructor;
|
|
115
151
|
readonly default: false;
|
|
116
152
|
};
|
|
153
|
+
/**
|
|
154
|
+
* 点击遮罩是否关闭预览
|
|
155
|
+
* @default true
|
|
156
|
+
*/
|
|
157
|
+
readonly closeOnClickModal: {
|
|
158
|
+
readonly type: BooleanConstructor;
|
|
159
|
+
readonly default: true;
|
|
160
|
+
};
|
|
117
161
|
};
|
|
118
162
|
export type ImagePreviewProps = ExtractPropTypes<typeof imagePreviewProps>;
|
|
119
163
|
/**
|
|
@@ -123,7 +167,7 @@ export declare const imagePreviewEmits: {
|
|
|
123
167
|
/** v-model 绑定 */
|
|
124
168
|
'update:modelValue': (value: boolean) => boolean;
|
|
125
169
|
/** 关闭时触发 */
|
|
126
|
-
close: () => boolean;
|
|
170
|
+
close: (payload: ImagePreviewClosePayload) => boolean;
|
|
127
171
|
/** 切换图片时触发 */
|
|
128
172
|
switch: (index: number) => boolean;
|
|
129
173
|
};
|