@wapri/element-pro 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/CheckCard/Group.vue.d.ts +54 -0
- package/dist/CheckCard/context.d.ts +12 -0
- package/dist/CheckCard/index.d.ts +443 -0
- package/dist/CheckCard/index.vue.d.ts +53 -0
- package/dist/CheckCard/selection.d.ts +4 -0
- package/dist/CheckCard/types.d.ts +29 -0
- package/dist/ConfigProvider/context.d.ts +11 -0
- package/dist/ConfigProvider/index.d.ts +50 -0
- package/dist/ConfigProvider/index.vue.d.ts +28 -0
- package/dist/CropperUpload/CropperDialog.vue.d.ts +23 -0
- package/dist/CropperUpload/index.d.ts +241 -0
- package/dist/CropperUpload/index.vue.d.ts +81 -0
- package/dist/CropperUpload/types.d.ts +137 -0
- package/dist/CropperUpload/utils.d.ts +42 -0
- package/dist/DateQuickSelect/index.d.ts +65 -0
- package/dist/DateQuickSelect/index.vue.d.ts +55 -0
- package/dist/DateQuickSelect/types.d.ts +19 -0
- package/dist/DateQuickSelect/utils.d.ts +9 -0
- package/dist/DrawerForm/index.d.ts +201 -0
- package/dist/DrawerForm/index.vue.d.ts +76 -0
- package/dist/Ellipsis/index.d.ts +35 -0
- package/dist/Ellipsis/types.d.ts +23 -0
- package/dist/Layout/components/SidebarTrigger.vue.d.ts +21 -0
- package/dist/Layout/index.d.ts +147 -0
- package/dist/Layout/index.vue.d.ts +65 -0
- package/dist/Layout/types.d.ts +24 -0
- package/dist/MainContent/index.d.ts +115 -0
- package/dist/MainContent/index.vue.d.ts +51 -0
- package/dist/MainContent/types.d.ts +17 -0
- package/dist/ModalForm/index.d.ts +201 -0
- package/dist/ModalForm/index.vue.d.ts +76 -0
- package/dist/ProTable/components/ProTablePagination.vue.d.ts +43 -0
- package/dist/ProTable/components/ProTableSearchForm.vue.d.ts +34 -0
- package/dist/ProTable/components/ProTableSelectedFilters.vue.d.ts +21 -0
- package/dist/ProTable/components/ProTableSelectionActions.vue.d.ts +36 -0
- package/dist/ProTable/components/ProTableToolbar.vue.d.ts +47 -0
- package/dist/ProTable/composables/useProTableData.d.ts +34 -0
- package/dist/ProTable/composables/useProTableSelection.d.ts +10 -0
- package/dist/ProTable/composables/useStickyTable.d.ts +18 -0
- package/dist/ProTable/index.d.ts +412 -0
- package/dist/ProTable/index.vue.d.ts +54 -0
- package/dist/ProTable/types.d.ts +265 -0
- package/dist/ProTable/utils.d.ts +25 -0
- package/dist/ShareButton/index.d.ts +157 -0
- package/dist/ShareButton/index.vue.d.ts +60 -0
- package/dist/ShareButton/steps.d.ts +13 -0
- package/dist/ShareButton/types.d.ts +34 -0
- package/dist/Sidebar/components/SidebarGroup.vue.d.ts +53 -0
- package/dist/Sidebar/components/SidebarIcon.vue.d.ts +23 -0
- package/dist/Sidebar/components/SidebarItem.vue.d.ts +33 -0
- package/dist/Sidebar/components/SidebarItemContent.vue.d.ts +27 -0
- package/dist/Sidebar/components/SidebarLink.vue.d.ts +54 -0
- package/dist/Sidebar/components/SidebarLogo.vue.d.ts +48 -0
- package/dist/Sidebar/composables/useActiveMenuScroll.d.ts +18 -0
- package/dist/Sidebar/context.d.ts +10 -0
- package/dist/Sidebar/index.d.ts +350 -0
- package/dist/Sidebar/index.vue.d.ts +72 -0
- package/dist/Sidebar/types.d.ts +154 -0
- package/dist/Sidebar/utils.d.ts +16 -0
- package/dist/SvgIcon/iconfont.d.ts +11 -0
- package/dist/SvgIcon/index.d.ts +35 -0
- package/dist/SvgIcon/index.vue.d.ts +38 -0
- package/dist/TagSelector/index.d.ts +51 -0
- package/dist/TagSelector/index.vue.d.ts +49 -0
- package/dist/TagSelector/types.d.ts +6 -0
- package/dist/VH100/index.d.ts +40 -0
- package/dist/VH100/index.vue.d.ts +26 -0
- package/dist/constant/index.d.ts +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.mjs +3985 -0
- package/dist/shared/overlayForm/types.d.ts +25 -0
- package/dist/shared/overlayForm/useOverlayForm.d.ts +18 -0
- package/dist/style.css +1 -0
- package/dist/utils/install.d.ts +10 -0
- package/package.json +39 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const ConfigProvider: import('../utils/install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
size: {
|
|
4
|
+
type: import('vue').PropType<import('./context').ElementProSize>;
|
|
5
|
+
};
|
|
6
|
+
prefix: {
|
|
7
|
+
type: import('vue').PropType<string>;
|
|
8
|
+
};
|
|
9
|
+
iconfont: {
|
|
10
|
+
type: import('vue').PropType<string>;
|
|
11
|
+
};
|
|
12
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
13
|
+
P: {};
|
|
14
|
+
B: {};
|
|
15
|
+
D: {};
|
|
16
|
+
C: {};
|
|
17
|
+
M: {};
|
|
18
|
+
Defaults: {};
|
|
19
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
20
|
+
size: {
|
|
21
|
+
type: import('vue').PropType<import('./context').ElementProSize>;
|
|
22
|
+
};
|
|
23
|
+
prefix: {
|
|
24
|
+
type: import('vue').PropType<string>;
|
|
25
|
+
};
|
|
26
|
+
iconfont: {
|
|
27
|
+
type: import('vue').PropType<string>;
|
|
28
|
+
};
|
|
29
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, {}>;
|
|
30
|
+
__isFragment?: never;
|
|
31
|
+
__isTeleport?: never;
|
|
32
|
+
__isSuspense?: never;
|
|
33
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
34
|
+
size: {
|
|
35
|
+
type: import('vue').PropType<import('./context').ElementProSize>;
|
|
36
|
+
};
|
|
37
|
+
prefix: {
|
|
38
|
+
type: import('vue').PropType<string>;
|
|
39
|
+
};
|
|
40
|
+
iconfont: {
|
|
41
|
+
type: import('vue').PropType<string>;
|
|
42
|
+
};
|
|
43
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, {}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
44
|
+
$slots: {
|
|
45
|
+
default?(_: {}): any;
|
|
46
|
+
};
|
|
47
|
+
})> & Record<string, unknown>;
|
|
48
|
+
export type { ConfigProviderProps } from './index.vue';
|
|
49
|
+
export type { ElementProSize } from './context';
|
|
50
|
+
export default ConfigProvider;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ElementProSize } from './context';
|
|
2
|
+
|
|
3
|
+
export interface ConfigProviderProps {
|
|
4
|
+
size?: ElementProSize;
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** 图标集脚本地址,供子树里的 `SvgIcon` 使用;库内不内置任何图标源。 */
|
|
7
|
+
iconfont?: string;
|
|
8
|
+
}
|
|
9
|
+
declare function __VLS_template(): {
|
|
10
|
+
default?(_: {}): any;
|
|
11
|
+
};
|
|
12
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ConfigProviderProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ConfigProviderProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
13
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: import('vue').PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CropperDialogProps } from './types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<CropperDialogProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
+
cancel: () => void;
|
|
5
|
+
error: (error: Error) => void;
|
|
6
|
+
confirm: (file: File) => void;
|
|
7
|
+
reselect: (file: File) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<CropperDialogProps>>> & Readonly<{
|
|
9
|
+
onCancel?: (() => any) | undefined;
|
|
10
|
+
onError?: ((error: Error) => any) | undefined;
|
|
11
|
+
onConfirm?: ((file: File) => any) | undefined;
|
|
12
|
+
onReselect?: ((file: File) => any) | undefined;
|
|
13
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
|
+
export default _default;
|
|
15
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
+
} : {
|
|
20
|
+
type: import('vue').PropType<T[K]>;
|
|
21
|
+
required: true;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
export declare const CropperUpload: import('../utils/install').SFCWithInstall<{
|
|
2
|
+
new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('vue').ExtractPropTypes<{
|
|
3
|
+
title: {
|
|
4
|
+
type: import('vue').PropType<string>;
|
|
5
|
+
default: string;
|
|
6
|
+
};
|
|
7
|
+
circle: {
|
|
8
|
+
type: import('vue').PropType<boolean>;
|
|
9
|
+
default: boolean;
|
|
10
|
+
};
|
|
11
|
+
beforeUpload: {
|
|
12
|
+
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
13
|
+
};
|
|
14
|
+
ratios: {
|
|
15
|
+
type: import('vue').PropType<number[]>;
|
|
16
|
+
default: () => number[];
|
|
17
|
+
};
|
|
18
|
+
aspectRatio: {
|
|
19
|
+
type: import('vue').PropType<string | number>;
|
|
20
|
+
default: number;
|
|
21
|
+
};
|
|
22
|
+
cropperOptions: {
|
|
23
|
+
type: import('vue').PropType<import('./types').CropperOptions>;
|
|
24
|
+
default: () => {};
|
|
25
|
+
};
|
|
26
|
+
preview: {
|
|
27
|
+
type: import('vue').PropType<boolean>;
|
|
28
|
+
default: boolean;
|
|
29
|
+
};
|
|
30
|
+
outputWidth: {
|
|
31
|
+
type: import('vue').PropType<number>;
|
|
32
|
+
};
|
|
33
|
+
confirmText: {
|
|
34
|
+
type: import('vue').PropType<string>;
|
|
35
|
+
default: string;
|
|
36
|
+
};
|
|
37
|
+
cancelText: {
|
|
38
|
+
type: import('vue').PropType<string>;
|
|
39
|
+
default: string;
|
|
40
|
+
};
|
|
41
|
+
reselectText: {
|
|
42
|
+
type: import('vue').PropType<string>;
|
|
43
|
+
default: string;
|
|
44
|
+
};
|
|
45
|
+
canvasHeight: {
|
|
46
|
+
type: import('vue').PropType<string | number>;
|
|
47
|
+
default: string;
|
|
48
|
+
};
|
|
49
|
+
cropper: {
|
|
50
|
+
type: import('vue').PropType<boolean>;
|
|
51
|
+
default: boolean;
|
|
52
|
+
};
|
|
53
|
+
}>> & Readonly<{
|
|
54
|
+
onCancel?: ((rawFile: File) => any) | undefined;
|
|
55
|
+
onError?: ((error: Error) => any) | undefined;
|
|
56
|
+
onReselect?: ((rawFile: File) => any) | undefined;
|
|
57
|
+
onCrop?: ((file: File, rawFile: File) => any) | undefined;
|
|
58
|
+
}>, {
|
|
59
|
+
uploadRef: import('vue').Ref<import('element-plus').UploadInstance | undefined, import('element-plus').UploadInstance | undefined>;
|
|
60
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
61
|
+
cancel: (rawFile: File) => void;
|
|
62
|
+
error: (error: Error) => void;
|
|
63
|
+
reselect: (rawFile: File) => void;
|
|
64
|
+
crop: (file: File, rawFile: File) => void;
|
|
65
|
+
}, import('vue').PublicProps, {
|
|
66
|
+
title: string;
|
|
67
|
+
circle: boolean;
|
|
68
|
+
ratios: number[];
|
|
69
|
+
aspectRatio: number | string;
|
|
70
|
+
cropperOptions: import('./types').CropperOptions;
|
|
71
|
+
preview: boolean;
|
|
72
|
+
confirmText: string;
|
|
73
|
+
cancelText: string;
|
|
74
|
+
reselectText: string;
|
|
75
|
+
canvasHeight: number | string;
|
|
76
|
+
cropper: boolean;
|
|
77
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
78
|
+
P: {};
|
|
79
|
+
B: {};
|
|
80
|
+
D: {};
|
|
81
|
+
C: {};
|
|
82
|
+
M: {};
|
|
83
|
+
Defaults: {};
|
|
84
|
+
}, Readonly<import('vue').ExtractPropTypes<{
|
|
85
|
+
title: {
|
|
86
|
+
type: import('vue').PropType<string>;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
circle: {
|
|
90
|
+
type: import('vue').PropType<boolean>;
|
|
91
|
+
default: boolean;
|
|
92
|
+
};
|
|
93
|
+
beforeUpload: {
|
|
94
|
+
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
95
|
+
};
|
|
96
|
+
ratios: {
|
|
97
|
+
type: import('vue').PropType<number[]>;
|
|
98
|
+
default: () => number[];
|
|
99
|
+
};
|
|
100
|
+
aspectRatio: {
|
|
101
|
+
type: import('vue').PropType<string | number>;
|
|
102
|
+
default: number;
|
|
103
|
+
};
|
|
104
|
+
cropperOptions: {
|
|
105
|
+
type: import('vue').PropType<import('./types').CropperOptions>;
|
|
106
|
+
default: () => {};
|
|
107
|
+
};
|
|
108
|
+
preview: {
|
|
109
|
+
type: import('vue').PropType<boolean>;
|
|
110
|
+
default: boolean;
|
|
111
|
+
};
|
|
112
|
+
outputWidth: {
|
|
113
|
+
type: import('vue').PropType<number>;
|
|
114
|
+
};
|
|
115
|
+
confirmText: {
|
|
116
|
+
type: import('vue').PropType<string>;
|
|
117
|
+
default: string;
|
|
118
|
+
};
|
|
119
|
+
cancelText: {
|
|
120
|
+
type: import('vue').PropType<string>;
|
|
121
|
+
default: string;
|
|
122
|
+
};
|
|
123
|
+
reselectText: {
|
|
124
|
+
type: import('vue').PropType<string>;
|
|
125
|
+
default: string;
|
|
126
|
+
};
|
|
127
|
+
canvasHeight: {
|
|
128
|
+
type: import('vue').PropType<string | number>;
|
|
129
|
+
default: string;
|
|
130
|
+
};
|
|
131
|
+
cropper: {
|
|
132
|
+
type: import('vue').PropType<boolean>;
|
|
133
|
+
default: boolean;
|
|
134
|
+
};
|
|
135
|
+
}>> & Readonly<{
|
|
136
|
+
onCancel?: ((rawFile: File) => any) | undefined;
|
|
137
|
+
onError?: ((error: Error) => any) | undefined;
|
|
138
|
+
onReselect?: ((rawFile: File) => any) | undefined;
|
|
139
|
+
onCrop?: ((file: File, rawFile: File) => any) | undefined;
|
|
140
|
+
}>, {
|
|
141
|
+
uploadRef: import('vue').Ref<import('element-plus').UploadInstance | undefined, import('element-plus').UploadInstance | undefined>;
|
|
142
|
+
}, {}, {}, {}, {
|
|
143
|
+
title: string;
|
|
144
|
+
circle: boolean;
|
|
145
|
+
ratios: number[];
|
|
146
|
+
aspectRatio: number | string;
|
|
147
|
+
cropperOptions: import('./types').CropperOptions;
|
|
148
|
+
preview: boolean;
|
|
149
|
+
confirmText: string;
|
|
150
|
+
cancelText: string;
|
|
151
|
+
reselectText: string;
|
|
152
|
+
canvasHeight: number | string;
|
|
153
|
+
cropper: boolean;
|
|
154
|
+
}>;
|
|
155
|
+
__isFragment?: never;
|
|
156
|
+
__isTeleport?: never;
|
|
157
|
+
__isSuspense?: never;
|
|
158
|
+
} & import('vue').ComponentOptionsBase<Readonly<import('vue').ExtractPropTypes<{
|
|
159
|
+
title: {
|
|
160
|
+
type: import('vue').PropType<string>;
|
|
161
|
+
default: string;
|
|
162
|
+
};
|
|
163
|
+
circle: {
|
|
164
|
+
type: import('vue').PropType<boolean>;
|
|
165
|
+
default: boolean;
|
|
166
|
+
};
|
|
167
|
+
beforeUpload: {
|
|
168
|
+
type: import('vue').PropType<(rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript').Awaitable<void | undefined | null | boolean | File | Blob>>;
|
|
169
|
+
};
|
|
170
|
+
ratios: {
|
|
171
|
+
type: import('vue').PropType<number[]>;
|
|
172
|
+
default: () => number[];
|
|
173
|
+
};
|
|
174
|
+
aspectRatio: {
|
|
175
|
+
type: import('vue').PropType<string | number>;
|
|
176
|
+
default: number;
|
|
177
|
+
};
|
|
178
|
+
cropperOptions: {
|
|
179
|
+
type: import('vue').PropType<import('./types').CropperOptions>;
|
|
180
|
+
default: () => {};
|
|
181
|
+
};
|
|
182
|
+
preview: {
|
|
183
|
+
type: import('vue').PropType<boolean>;
|
|
184
|
+
default: boolean;
|
|
185
|
+
};
|
|
186
|
+
outputWidth: {
|
|
187
|
+
type: import('vue').PropType<number>;
|
|
188
|
+
};
|
|
189
|
+
confirmText: {
|
|
190
|
+
type: import('vue').PropType<string>;
|
|
191
|
+
default: string;
|
|
192
|
+
};
|
|
193
|
+
cancelText: {
|
|
194
|
+
type: import('vue').PropType<string>;
|
|
195
|
+
default: string;
|
|
196
|
+
};
|
|
197
|
+
reselectText: {
|
|
198
|
+
type: import('vue').PropType<string>;
|
|
199
|
+
default: string;
|
|
200
|
+
};
|
|
201
|
+
canvasHeight: {
|
|
202
|
+
type: import('vue').PropType<string | number>;
|
|
203
|
+
default: string;
|
|
204
|
+
};
|
|
205
|
+
cropper: {
|
|
206
|
+
type: import('vue').PropType<boolean>;
|
|
207
|
+
default: boolean;
|
|
208
|
+
};
|
|
209
|
+
}>> & Readonly<{
|
|
210
|
+
onCancel?: ((rawFile: File) => any) | undefined;
|
|
211
|
+
onError?: ((error: Error) => any) | undefined;
|
|
212
|
+
onReselect?: ((rawFile: File) => any) | undefined;
|
|
213
|
+
onCrop?: ((file: File, rawFile: File) => any) | undefined;
|
|
214
|
+
}>, {
|
|
215
|
+
uploadRef: import('vue').Ref<import('element-plus').UploadInstance | undefined, import('element-plus').UploadInstance | undefined>;
|
|
216
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
217
|
+
cancel: (rawFile: File) => void;
|
|
218
|
+
error: (error: Error) => void;
|
|
219
|
+
reselect: (rawFile: File) => void;
|
|
220
|
+
crop: (file: File, rawFile: File) => void;
|
|
221
|
+
}, string, {
|
|
222
|
+
title: string;
|
|
223
|
+
circle: boolean;
|
|
224
|
+
ratios: number[];
|
|
225
|
+
aspectRatio: number | string;
|
|
226
|
+
cropperOptions: import('./types').CropperOptions;
|
|
227
|
+
preview: boolean;
|
|
228
|
+
confirmText: string;
|
|
229
|
+
cancelText: string;
|
|
230
|
+
reselectText: string;
|
|
231
|
+
canvasHeight: number | string;
|
|
232
|
+
cropper: boolean;
|
|
233
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
|
|
234
|
+
$slots: {
|
|
235
|
+
default?(_: {}): any;
|
|
236
|
+
trigger?(_: {}): any;
|
|
237
|
+
tip?(_: {}): any;
|
|
238
|
+
};
|
|
239
|
+
})> & Record<string, unknown>;
|
|
240
|
+
export * from './types';
|
|
241
|
+
export default CropperUpload;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { UploadInstance } from 'element-plus';
|
|
2
|
+
import { CropperUploadProps } from './types';
|
|
3
|
+
|
|
4
|
+
declare function __VLS_template(): {
|
|
5
|
+
default?(_: {}): any;
|
|
6
|
+
trigger?(_: {}): any;
|
|
7
|
+
tip?(_: {}): any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<CropperUploadProps>, {
|
|
10
|
+
cropper: boolean;
|
|
11
|
+
aspectRatio: number;
|
|
12
|
+
ratios: () => number[];
|
|
13
|
+
cropperOptions: () => {};
|
|
14
|
+
preview: boolean;
|
|
15
|
+
circle: boolean;
|
|
16
|
+
canvasHeight: string;
|
|
17
|
+
title: string;
|
|
18
|
+
confirmText: string;
|
|
19
|
+
cancelText: string;
|
|
20
|
+
reselectText: string;
|
|
21
|
+
}>>, {
|
|
22
|
+
uploadRef: import('vue').Ref<UploadInstance | undefined, UploadInstance | undefined>;
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
24
|
+
cancel: (rawFile: File) => void;
|
|
25
|
+
error: (error: Error) => void;
|
|
26
|
+
reselect: (rawFile: File) => void;
|
|
27
|
+
crop: (file: File, rawFile: File) => void;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<CropperUploadProps>, {
|
|
29
|
+
cropper: boolean;
|
|
30
|
+
aspectRatio: number;
|
|
31
|
+
ratios: () => number[];
|
|
32
|
+
cropperOptions: () => {};
|
|
33
|
+
preview: boolean;
|
|
34
|
+
circle: boolean;
|
|
35
|
+
canvasHeight: string;
|
|
36
|
+
title: string;
|
|
37
|
+
confirmText: string;
|
|
38
|
+
cancelText: string;
|
|
39
|
+
reselectText: string;
|
|
40
|
+
}>>> & Readonly<{
|
|
41
|
+
onCancel?: ((rawFile: File) => any) | undefined;
|
|
42
|
+
onError?: ((error: Error) => any) | undefined;
|
|
43
|
+
onReselect?: ((rawFile: File) => any) | undefined;
|
|
44
|
+
onCrop?: ((file: File, rawFile: File) => any) | undefined;
|
|
45
|
+
}>, {
|
|
46
|
+
title: string;
|
|
47
|
+
circle: boolean;
|
|
48
|
+
ratios: number[];
|
|
49
|
+
aspectRatio: number | string;
|
|
50
|
+
cropperOptions: import('./types').CropperOptions;
|
|
51
|
+
preview: boolean;
|
|
52
|
+
confirmText: string;
|
|
53
|
+
cancelText: string;
|
|
54
|
+
reselectText: string;
|
|
55
|
+
canvasHeight: number | string;
|
|
56
|
+
cropper: boolean;
|
|
57
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
58
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
61
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
62
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
63
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
64
|
+
} : {
|
|
65
|
+
type: import('vue').PropType<T[K]>;
|
|
66
|
+
required: true;
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
type __VLS_WithDefaults<P, D> = {
|
|
70
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
71
|
+
default: D[K];
|
|
72
|
+
}> : P[K];
|
|
73
|
+
};
|
|
74
|
+
type __VLS_Prettify<T> = {
|
|
75
|
+
[K in keyof T]: T[K];
|
|
76
|
+
} & {};
|
|
77
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
78
|
+
new (): {
|
|
79
|
+
$slots: S;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { UploadHooks } from 'element-plus';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 透传给 vue-cropper 的配置。
|
|
5
|
+
* vue-cropper 未导出组件 props 的类型定义,这里只声明 CropperUpload 关心的字段,
|
|
6
|
+
* 未声明的配置不会被转发,避免与组件内部驱动的 `fixed`、`fixedNumber` 冲突。
|
|
7
|
+
*/
|
|
8
|
+
export interface CropperOptions {
|
|
9
|
+
/** 是否可拖动图片 */
|
|
10
|
+
canMove?: boolean;
|
|
11
|
+
/** 是否可拖动裁剪框 */
|
|
12
|
+
canMoveBox?: boolean;
|
|
13
|
+
/** 固定裁剪框大小,禁止拖动改变裁剪框 */
|
|
14
|
+
fixedBox?: boolean;
|
|
15
|
+
/** 裁剪框是否限制在图片范围内,关闭后裁剪结果可能带入画布背景 */
|
|
16
|
+
centerBox?: boolean;
|
|
17
|
+
/** 是否显示裁剪框尺寸提示 */
|
|
18
|
+
info?: boolean;
|
|
19
|
+
/** 是否支持滚轮 / 双指缩放 */
|
|
20
|
+
canScale?: boolean;
|
|
21
|
+
/** 图片布局方式,`contain` 居中留白、`cover` 填满容器 */
|
|
22
|
+
mode?: string;
|
|
23
|
+
/** 是否按 dpr 输出高清结果 */
|
|
24
|
+
high?: boolean;
|
|
25
|
+
/** 导出放大倍数 */
|
|
26
|
+
enlarge?: number;
|
|
27
|
+
/** 图片最大尺寸,超过该边长会先等比压缩再裁剪 */
|
|
28
|
+
maxImgSize?: number;
|
|
29
|
+
/** 导出图片质量,0-1,仅 jpeg / webp 生效 */
|
|
30
|
+
outputSize?: number;
|
|
31
|
+
/** 导出时填充的背景色,如 `#fff`;不传时透明区域保持透明 */
|
|
32
|
+
fillColor?: string;
|
|
33
|
+
}
|
|
34
|
+
/** Cropper 实例上用到的方法与只读状态,避免直接依赖 vue-cropper 宽松的组件类型。 */
|
|
35
|
+
export interface CropperInstance {
|
|
36
|
+
/** 图片显示尺寸(已按 maxImgSize 压缩) */
|
|
37
|
+
readonly trueWidth: number;
|
|
38
|
+
readonly trueHeight: number;
|
|
39
|
+
/** 当前缩放比例,由裁剪器内部维护 */
|
|
40
|
+
readonly scale: number;
|
|
41
|
+
/** 导出裁剪结果为 Blob,回调参数为 null 表示导出失败 */
|
|
42
|
+
getCropBlob: (callback: (blob: Blob | null) => void) => void;
|
|
43
|
+
/** 缩放图片,正数放大、负数缩小;步长按 `20 / 图片短边` 换算 */
|
|
44
|
+
changeScale: (factor: number) => void;
|
|
45
|
+
/** 逆时针旋转 90° */
|
|
46
|
+
rotateLeft: () => void;
|
|
47
|
+
/** 顺时针旋转 90° */
|
|
48
|
+
rotateRight: () => void;
|
|
49
|
+
/** 按当前 fixed / fixedNumber 重新生成并居中裁剪框 */
|
|
50
|
+
goAutoCrop: () => void;
|
|
51
|
+
}
|
|
52
|
+
/** vue-cropper `real-time` 事件回传的预览数据,用于右侧实时预览 */
|
|
53
|
+
export interface CropperPreview {
|
|
54
|
+
/** 裁剪框宽度(px) */
|
|
55
|
+
w: number;
|
|
56
|
+
/** 裁剪框高度(px) */
|
|
57
|
+
h: number;
|
|
58
|
+
/** 原始图片地址 */
|
|
59
|
+
url: string;
|
|
60
|
+
/** 图片的尺寸与 transform,直接绑定到预览区的 img 上 */
|
|
61
|
+
img: {
|
|
62
|
+
width: string;
|
|
63
|
+
height: string;
|
|
64
|
+
transform: string;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
export interface CropperUploadProps {
|
|
68
|
+
/**
|
|
69
|
+
* 自定义上传前钩子,与 `ElUpload` 同名 prop。
|
|
70
|
+
* 裁剪之后执行,拿到的是裁剪结果(取消裁剪时不会执行)。
|
|
71
|
+
* 返回 `false` 终止本次上传,返回 Blob / File 可再次替换上传文件。
|
|
72
|
+
*/
|
|
73
|
+
beforeUpload?: UploadHooks['beforeUpload'];
|
|
74
|
+
/** 是否启用裁剪,置为 `false` 时退化为原生 `ElUpload` */
|
|
75
|
+
cropper?: boolean;
|
|
76
|
+
/** 初始裁剪比例,也支持 `4/3` 字符串写法;需出现在 `ratios` 中,否则以 `ratios` 第一项为准 */
|
|
77
|
+
aspectRatio?: number | string;
|
|
78
|
+
/** 弹窗内可切换的比例列表,`0` 表示自由比例;只传一项时不展示比例切换 */
|
|
79
|
+
ratios?: number[];
|
|
80
|
+
/** 透传给 vue-cropper 的配置,如 `canMove`、`fixedBox`、`mode` */
|
|
81
|
+
cropperOptions?: CropperOptions;
|
|
82
|
+
/** 是否展示右侧实时预览与输出尺寸提示 */
|
|
83
|
+
preview?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* 固定输出宽度(px)。设置后确认时按该宽度等比缩放导出,高度由裁剪比例换算,
|
|
86
|
+
* 不再受 dpr / `enlarge` 影响;不设置时按裁剪框尺寸 × dpr 输出。
|
|
87
|
+
*/
|
|
88
|
+
outputWidth?: number;
|
|
89
|
+
/** 圆形裁剪,用于头像等场景,置为 `true` 时裁剪框为正圆 */
|
|
90
|
+
circle?: boolean;
|
|
91
|
+
/** 裁剪画布区域高度 */
|
|
92
|
+
canvasHeight?: number | string;
|
|
93
|
+
/** 弹窗标题 */
|
|
94
|
+
title?: string;
|
|
95
|
+
/** 确认按钮文案 */
|
|
96
|
+
confirmText?: string;
|
|
97
|
+
/** 取消按钮文案 */
|
|
98
|
+
cancelText?: string;
|
|
99
|
+
/** 「重新选择」按钮文案,设置后可在弹窗内换图而不关闭 */
|
|
100
|
+
reselectText?: string;
|
|
101
|
+
}
|
|
102
|
+
export interface CropperUploadEmits {
|
|
103
|
+
/** 裁剪完成,参数为裁剪结果与原始文件 */
|
|
104
|
+
crop: [file: File, rawFile: File];
|
|
105
|
+
/** 用户取消裁剪(含点击关闭、按下 ESC) */
|
|
106
|
+
cancel: [rawFile: File];
|
|
107
|
+
/** 读取图片或生成裁剪结果失败 */
|
|
108
|
+
error: [error: Error];
|
|
109
|
+
/** 弹窗内重新选择了图片,组件已换成新图继续裁剪 */
|
|
110
|
+
reselect: [rawFile: File];
|
|
111
|
+
}
|
|
112
|
+
/** 裁剪弹窗的内部契约,仅在 CropperUpload 内部流转。 */
|
|
113
|
+
export interface CropperDialogProps {
|
|
114
|
+
visible: boolean;
|
|
115
|
+
/** 待裁剪的原始文件 */
|
|
116
|
+
file?: File;
|
|
117
|
+
ratios: number[];
|
|
118
|
+
aspectRatio: number | string;
|
|
119
|
+
cropperOptions?: CropperOptions;
|
|
120
|
+
/** 「重新选择」时的文件过滤,跟随 ElUpload 的 accept */
|
|
121
|
+
accept?: string;
|
|
122
|
+
preview: boolean;
|
|
123
|
+
outputWidth?: number;
|
|
124
|
+
circle: boolean;
|
|
125
|
+
title: string;
|
|
126
|
+
confirmText: string;
|
|
127
|
+
cancelText: string;
|
|
128
|
+
reselectText: string;
|
|
129
|
+
canvasHeight: number | string;
|
|
130
|
+
}
|
|
131
|
+
export interface CropperDialogEmits {
|
|
132
|
+
confirm: [file: File];
|
|
133
|
+
cancel: [];
|
|
134
|
+
error: [error: Error];
|
|
135
|
+
/** 弹窗内「重新选择」了图片,父级用它替换当前待裁剪文件 */
|
|
136
|
+
reselect: [file: File];
|
|
137
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { UploadRawFile } from 'element-plus';
|
|
2
|
+
|
|
3
|
+
/** vue-cropper `outputType` 支持的格式 */
|
|
4
|
+
export type CropperOutputFormat = 'jpeg' | 'png' | 'webp';
|
|
5
|
+
/** 是否是需要裁剪的图片 */
|
|
6
|
+
export declare const isImageFile: (file: File) => boolean;
|
|
7
|
+
/** 裁剪输出类型:优先与原图一致,canvas 不支持的类型回退 png */
|
|
8
|
+
export declare const getOutputType: (raw: File) => string;
|
|
9
|
+
/** vue-cropper 的 outputType 只接收格式名,不带 `image/` 前缀 */
|
|
10
|
+
export declare const getOutputFormat: (raw: File) => CropperOutputFormat;
|
|
11
|
+
/**
|
|
12
|
+
* canvas → File;画布过大等导致 toBlob 返回空时抛出错误。
|
|
13
|
+
* `outputType` 可强制指定输出类型,圆形裁剪需要输出 png 保留透明四角。
|
|
14
|
+
*/
|
|
15
|
+
export declare const canvasToFile: (canvas: HTMLCanvasElement, raw: File, outputType?: string) => Promise<File>;
|
|
16
|
+
/** 裁剪结果是 Blob 时直接转成 File,文件名与扩展名跟随实际编码格式 */
|
|
17
|
+
export declare const blobToFile: (blob: Blob, raw: File) => File;
|
|
18
|
+
/** Blob → canvas,用于圆形裁剪时二次加工裁剪结果 */
|
|
19
|
+
export declare const blobToCanvas: (blob: Blob) => Promise<HTMLCanvasElement>;
|
|
20
|
+
/** 按目标尺寸重绘画布,用于把裁剪结果锁定成固定输出宽度 */
|
|
21
|
+
export declare const resizeCanvas: (canvas: HTMLCanvasElement, width: number, height: number) => HTMLCanvasElement;
|
|
22
|
+
/** 裁剪结果是新文件,补回原 uid 以复用 ElUpload 的进度、取消等回调 */
|
|
23
|
+
export declare const inheritUid: (file: File, raw: UploadRawFile) => UploadRawFile;
|
|
24
|
+
/**
|
|
25
|
+
* 圆形裁剪结果:把矩形画布的四角裁掉,只保留椭圆区域内的像素。
|
|
26
|
+
*
|
|
27
|
+
* vue-cropper 的 `getCropBlob` 只按裁剪框的矩形区域导出图片,
|
|
28
|
+
* 圆形裁剪仅影响弹窗内的裁剪框样式(`border-radius`),
|
|
29
|
+
* 若不在这里裁掉四角,头像上传后四角仍是图片内容,展示出来是正方形的。
|
|
30
|
+
*
|
|
31
|
+
* 裁剪框为正方形时等价于圆形,非正方形时与预览的椭圆保持一致。
|
|
32
|
+
*/
|
|
33
|
+
export declare const clipEllipseCanvas: (canvas: HTMLCanvasElement) => HTMLCanvasElement;
|
|
34
|
+
/**
|
|
35
|
+
* 比例拆成 vue-cropper 需要的 `[宽, 高]`:
|
|
36
|
+
* 1 → [1, 1],4/3 → [4, 3],无法整除时按小数保留第一个值。
|
|
37
|
+
*/
|
|
38
|
+
export declare const splitRatio: (ratio: number) => [number, number];
|
|
39
|
+
/** 比例文案:1 → 1:1,4/3 → 4:3,0 → 自由 */
|
|
40
|
+
export declare const formatRatio: (ratio: number) => string;
|
|
41
|
+
/** 比例归一化:支持 4/3、'4/3' 两种写法,无法解析时按 0(自由比例)处理 */
|
|
42
|
+
export declare const parseRatio: (value: number | string) => number;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export declare const DateQuickSelect: import('../utils/install').SFCWithInstall<import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
2
|
+
placeholder: {
|
|
3
|
+
type: import('vue').PropType<string>;
|
|
4
|
+
};
|
|
5
|
+
modelValue: {
|
|
6
|
+
type: import('vue').PropType<string | [string, string]>;
|
|
7
|
+
};
|
|
8
|
+
valueType: {
|
|
9
|
+
type: import('vue').PropType<import('./types').DateQuickSelectValueType>;
|
|
10
|
+
required: true;
|
|
11
|
+
};
|
|
12
|
+
quickSelect: {
|
|
13
|
+
type: import('vue').PropType<false | import('./types').DateQuickSelectConfig>;
|
|
14
|
+
default: boolean;
|
|
15
|
+
};
|
|
16
|
+
quickSelection: {
|
|
17
|
+
type: import('vue').PropType<import('./types').DateQuickSelectSelection>;
|
|
18
|
+
};
|
|
19
|
+
datePickerProps: {
|
|
20
|
+
type: import('vue').PropType<Record<string, unknown>>;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
23
|
+
clearable: {
|
|
24
|
+
type: import('vue').PropType<boolean>;
|
|
25
|
+
default: boolean;
|
|
26
|
+
};
|
|
27
|
+
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
28
|
+
"update:modelValue": (value: string | [string, string] | undefined) => void;
|
|
29
|
+
quickSelect: (selection: import('./types').DateQuickSelectSelection) => void;
|
|
30
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
31
|
+
placeholder: {
|
|
32
|
+
type: import('vue').PropType<string>;
|
|
33
|
+
};
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: import('vue').PropType<string | [string, string]>;
|
|
36
|
+
};
|
|
37
|
+
valueType: {
|
|
38
|
+
type: import('vue').PropType<import('./types').DateQuickSelectValueType>;
|
|
39
|
+
required: true;
|
|
40
|
+
};
|
|
41
|
+
quickSelect: {
|
|
42
|
+
type: import('vue').PropType<false | import('./types').DateQuickSelectConfig>;
|
|
43
|
+
default: boolean;
|
|
44
|
+
};
|
|
45
|
+
quickSelection: {
|
|
46
|
+
type: import('vue').PropType<import('./types').DateQuickSelectSelection>;
|
|
47
|
+
};
|
|
48
|
+
datePickerProps: {
|
|
49
|
+
type: import('vue').PropType<Record<string, unknown>>;
|
|
50
|
+
default: () => {};
|
|
51
|
+
};
|
|
52
|
+
clearable: {
|
|
53
|
+
type: import('vue').PropType<boolean>;
|
|
54
|
+
default: boolean;
|
|
55
|
+
};
|
|
56
|
+
}>> & Readonly<{
|
|
57
|
+
"onUpdate:modelValue"?: ((value: string | [string, string] | undefined) => any) | undefined;
|
|
58
|
+
onQuickSelect?: ((selection: import('./types').DateQuickSelectSelection) => any) | undefined;
|
|
59
|
+
}>, {
|
|
60
|
+
quickSelect: import('./types').DateQuickSelectConfig | false;
|
|
61
|
+
datePickerProps: Record<string, unknown>;
|
|
62
|
+
clearable: boolean;
|
|
63
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>> & Record<string, unknown>;
|
|
64
|
+
export * from './types';
|
|
65
|
+
export default DateQuickSelect;
|