@dazhicheng/ui 1.5.13 → 1.5.14
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/components/tt-modal-form/hooks/useModalFormSlot.d.ts +6 -0
- package/dist/components/tt-modal-form/index.d.ts +2 -0
- package/dist/components/tt-modal-form/index.vue.d.ts +43 -0
- package/dist/components/tt-modal-form/props.d.ts +38 -0
- package/dist/components/tt-modal-form/useModalForm.d.ts +6 -0
- package/dist/components/tt-upload/index.d.ts +450 -0
- package/dist/components/tt-upload/src/TtUpload.d.ts +471 -0
- package/dist/components/tt-upload/src/typing.d.ts +240 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8411 -7890
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,240 @@
|
|
|
1
|
+
import { ExtractPropTypes, PropType } from 'vue';
|
|
2
|
+
export interface TtUploadFileItem {
|
|
3
|
+
/** 文件唯一标识 */
|
|
4
|
+
id: string | number;
|
|
5
|
+
/** 文件名 */
|
|
6
|
+
name: string;
|
|
7
|
+
/** 文件URL(用于预览/下载) */
|
|
8
|
+
url?: string;
|
|
9
|
+
/** 文件大小(字节) */
|
|
10
|
+
size?: number;
|
|
11
|
+
/** 文件类型 */
|
|
12
|
+
type?: string;
|
|
13
|
+
/** 上传时间 */
|
|
14
|
+
uploadTime?: string;
|
|
15
|
+
/** 原始文件对象 */
|
|
16
|
+
raw?: File;
|
|
17
|
+
/** 扩展数据 */
|
|
18
|
+
[key: string]: unknown;
|
|
19
|
+
}
|
|
20
|
+
export declare const ttUploadProps: {
|
|
21
|
+
readonly action: {
|
|
22
|
+
readonly type: PropType<string>;
|
|
23
|
+
readonly default: "";
|
|
24
|
+
};
|
|
25
|
+
readonly accept: {
|
|
26
|
+
readonly type: PropType<string>;
|
|
27
|
+
readonly default: ".pdf,.xlsx,.xls,.doc,.docx,.jpg,.jpeg,.png";
|
|
28
|
+
};
|
|
29
|
+
readonly multiple: {
|
|
30
|
+
readonly type: PropType<boolean>;
|
|
31
|
+
readonly default: true;
|
|
32
|
+
};
|
|
33
|
+
readonly drag: {
|
|
34
|
+
readonly type: PropType<boolean>;
|
|
35
|
+
readonly default: true;
|
|
36
|
+
};
|
|
37
|
+
/** 是否使用弹框模式 */
|
|
38
|
+
readonly modal: {
|
|
39
|
+
readonly type: PropType<boolean>;
|
|
40
|
+
readonly default: true;
|
|
41
|
+
};
|
|
42
|
+
/** 弹框标题 */
|
|
43
|
+
readonly title: {
|
|
44
|
+
readonly type: PropType<string>;
|
|
45
|
+
readonly default: "导入";
|
|
46
|
+
};
|
|
47
|
+
/** 弹框宽度 */
|
|
48
|
+
readonly modalWidth: {
|
|
49
|
+
readonly type: PropType<string | number>;
|
|
50
|
+
readonly default: 890;
|
|
51
|
+
};
|
|
52
|
+
/** 确定按钮文字 */
|
|
53
|
+
readonly okText: {
|
|
54
|
+
readonly type: PropType<string>;
|
|
55
|
+
readonly default: "确认";
|
|
56
|
+
};
|
|
57
|
+
/** 取消按钮文字 */
|
|
58
|
+
readonly cancelText: {
|
|
59
|
+
readonly type: PropType<string>;
|
|
60
|
+
readonly default: "取消";
|
|
61
|
+
};
|
|
62
|
+
/** 已上传文件列表 */
|
|
63
|
+
readonly fileList: {
|
|
64
|
+
readonly type: PropType<TtUploadFileItem[]>;
|
|
65
|
+
readonly default: () => never[];
|
|
66
|
+
};
|
|
67
|
+
/** 上传提示文字 */
|
|
68
|
+
readonly uploadTip: {
|
|
69
|
+
readonly type: PropType<string>;
|
|
70
|
+
readonly default: "可以上传pdf、excel、word、图片格式";
|
|
71
|
+
};
|
|
72
|
+
/** 最大上传文件大小(MB) */
|
|
73
|
+
readonly maxSize: {
|
|
74
|
+
readonly type: PropType<number>;
|
|
75
|
+
readonly default: 50;
|
|
76
|
+
};
|
|
77
|
+
/** 是否显示已上传列表 */
|
|
78
|
+
readonly showFileList: {
|
|
79
|
+
readonly type: PropType<boolean>;
|
|
80
|
+
readonly default: true;
|
|
81
|
+
};
|
|
82
|
+
/** 是否显示模板下载链接 */
|
|
83
|
+
readonly showTemplateDownload: {
|
|
84
|
+
readonly type: PropType<boolean>;
|
|
85
|
+
readonly default: true;
|
|
86
|
+
};
|
|
87
|
+
/** 模板下载链接文字 */
|
|
88
|
+
readonly templateText: {
|
|
89
|
+
readonly type: PropType<string>;
|
|
90
|
+
readonly default: "模板下载";
|
|
91
|
+
};
|
|
92
|
+
/** 是否显示查看按钮 */
|
|
93
|
+
readonly showPreview: {
|
|
94
|
+
readonly type: PropType<boolean>;
|
|
95
|
+
readonly default: true;
|
|
96
|
+
};
|
|
97
|
+
/** 是否显示下载按钮 */
|
|
98
|
+
readonly showDownload: {
|
|
99
|
+
readonly type: PropType<boolean>;
|
|
100
|
+
readonly default: true;
|
|
101
|
+
};
|
|
102
|
+
/** 是否显示删除按钮 */
|
|
103
|
+
readonly showDelete: {
|
|
104
|
+
readonly type: PropType<boolean>;
|
|
105
|
+
readonly default: true;
|
|
106
|
+
};
|
|
107
|
+
/** 文件数量达到该值时切换为网格布局 */
|
|
108
|
+
readonly gridThreshold: {
|
|
109
|
+
readonly type: PropType<number>;
|
|
110
|
+
readonly default: 4;
|
|
111
|
+
};
|
|
112
|
+
/** 网格模式下每行列数 */
|
|
113
|
+
readonly gridColumns: {
|
|
114
|
+
readonly type: PropType<number>;
|
|
115
|
+
readonly default: 4;
|
|
116
|
+
};
|
|
117
|
+
/** 显示已上传数量统计(需传入 limit) */
|
|
118
|
+
readonly showCount: {
|
|
119
|
+
readonly type: PropType<boolean>;
|
|
120
|
+
readonly default: true;
|
|
121
|
+
};
|
|
122
|
+
readonly beforeUpload: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | (() => (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | {
|
|
123
|
+
(): (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>;
|
|
124
|
+
new (): any;
|
|
125
|
+
readonly prototype: any;
|
|
126
|
+
} | ((new (...args: any[]) => (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | (() => (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>) | {
|
|
127
|
+
(): (rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<void | undefined | null | boolean | File | Blob>;
|
|
128
|
+
new (): any;
|
|
129
|
+
readonly prototype: any;
|
|
130
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
131
|
+
readonly beforeRemove: {
|
|
132
|
+
readonly type: import('vue').PropType<(uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => import('element-plus/es/utils/typescript.mjs').Awaitable<boolean>>;
|
|
133
|
+
readonly required: false;
|
|
134
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
135
|
+
__epPropKey: true;
|
|
136
|
+
};
|
|
137
|
+
readonly onRemove: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
138
|
+
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
139
|
+
new (): any;
|
|
140
|
+
readonly prototype: any;
|
|
141
|
+
} | ((new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
142
|
+
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
143
|
+
new (): any;
|
|
144
|
+
readonly prototype: any;
|
|
145
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
146
|
+
readonly onChange: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
147
|
+
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
148
|
+
new (): any;
|
|
149
|
+
readonly prototype: any;
|
|
150
|
+
} | ((new (...args: any[]) => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
151
|
+
(): (uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
152
|
+
new (): any;
|
|
153
|
+
readonly prototype: any;
|
|
154
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
155
|
+
readonly onPreview: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (uploadFile: import('element-plus').UploadFile) => void) | (() => (uploadFile: import('element-plus').UploadFile) => void) | {
|
|
156
|
+
(): (uploadFile: import('element-plus').UploadFile) => void;
|
|
157
|
+
new (): any;
|
|
158
|
+
readonly prototype: any;
|
|
159
|
+
} | ((new (...args: any[]) => (uploadFile: import('element-plus').UploadFile) => void) | (() => (uploadFile: import('element-plus').UploadFile) => void) | {
|
|
160
|
+
(): (uploadFile: import('element-plus').UploadFile) => void;
|
|
161
|
+
new (): any;
|
|
162
|
+
readonly prototype: any;
|
|
163
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
164
|
+
readonly onSuccess: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
165
|
+
(): (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
166
|
+
new (): any;
|
|
167
|
+
readonly prototype: any;
|
|
168
|
+
} | ((new (...args: any[]) => (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
169
|
+
(): (response: any, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
170
|
+
new (): any;
|
|
171
|
+
readonly prototype: any;
|
|
172
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
173
|
+
readonly onProgress: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
174
|
+
(): (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
175
|
+
new (): any;
|
|
176
|
+
readonly prototype: any;
|
|
177
|
+
} | ((new (...args: any[]) => (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
178
|
+
(): (evt: import('element-plus').UploadProgressEvent, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
179
|
+
new (): any;
|
|
180
|
+
readonly prototype: any;
|
|
181
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
182
|
+
readonly onError: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
183
|
+
(): (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
184
|
+
new (): any;
|
|
185
|
+
readonly prototype: any;
|
|
186
|
+
} | ((new (...args: any[]) => (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | (() => (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void) | {
|
|
187
|
+
(): (error: Error, uploadFile: import('element-plus').UploadFile, uploadFiles: import('element-plus').UploadFiles) => void;
|
|
188
|
+
new (): any;
|
|
189
|
+
readonly prototype: any;
|
|
190
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
191
|
+
readonly onExceed: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void) | (() => (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void) | {
|
|
192
|
+
(): (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void;
|
|
193
|
+
new (): any;
|
|
194
|
+
readonly prototype: any;
|
|
195
|
+
} | ((new (...args: any[]) => (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void) | (() => (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void) | {
|
|
196
|
+
(): (files: File[], uploadFiles: import('element-plus').UploadUserFile[]) => void;
|
|
197
|
+
new (): any;
|
|
198
|
+
readonly prototype: any;
|
|
199
|
+
})[], unknown, unknown, () => void, boolean>;
|
|
200
|
+
readonly crossorigin: {
|
|
201
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => "" | "anonymous" | "use-credentials") | ((new (...args: any[]) => "" | "anonymous" | "use-credentials") | (() => "" | "anonymous" | "use-credentials"))[], unknown, unknown>>;
|
|
202
|
+
readonly required: false;
|
|
203
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
204
|
+
__epPropKey: true;
|
|
205
|
+
};
|
|
206
|
+
readonly headers: {
|
|
207
|
+
readonly type: import('vue').PropType<import('element-plus/es/utils/index.mjs').EpPropMergeType<(new (...args: any[]) => Record<string, any> | Headers) | (() => Record<string, any> | Headers) | ((new (...args: any[]) => Record<string, any> | Headers) | (() => Record<string, any> | Headers))[], unknown, unknown>>;
|
|
208
|
+
readonly required: false;
|
|
209
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
210
|
+
__epPropKey: true;
|
|
211
|
+
};
|
|
212
|
+
readonly method: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "post", boolean>;
|
|
213
|
+
readonly data: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>> | Promise<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | (() => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | ((new (...args: any[]) => import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>> | Promise<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)) | (() => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus/es/utils/typescript.mjs').Mutable<Record<string, any>>> | ((rawFile: import('element-plus').UploadRawFile) => import('element-plus/es/utils/typescript.mjs').Awaitable<import('element-plus').UploadData>)))[], unknown, unknown, () => import('element-plus/es/utils/typescript.mjs').Mutable<{}>, boolean>;
|
|
214
|
+
readonly name: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, unknown, unknown, "file", boolean>;
|
|
215
|
+
readonly withCredentials: BooleanConstructor;
|
|
216
|
+
readonly autoUpload: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
217
|
+
readonly listType: import('element-plus/es/utils/index.mjs').EpPropFinalized<StringConstructor, "picture" | "text" | "picture-card", unknown, "text", boolean>;
|
|
218
|
+
readonly httpRequest: import('element-plus/es/utils/index.mjs').EpPropFinalized<(new (...args: any[]) => import('element-plus').UploadRequestHandler) | (() => import('element-plus').UploadRequestHandler) | {
|
|
219
|
+
(): import('element-plus').UploadRequestHandler;
|
|
220
|
+
new (): any;
|
|
221
|
+
readonly prototype: any;
|
|
222
|
+
} | ((new (...args: any[]) => import('element-plus').UploadRequestHandler) | (() => import('element-plus').UploadRequestHandler) | {
|
|
223
|
+
(): import('element-plus').UploadRequestHandler;
|
|
224
|
+
new (): any;
|
|
225
|
+
readonly prototype: any;
|
|
226
|
+
})[], unknown, unknown, import('element-plus').UploadRequestHandler, boolean>;
|
|
227
|
+
readonly disabled: import('element-plus/es/utils/index.mjs').EpPropFinalized<BooleanConstructor, unknown, unknown, undefined, boolean>;
|
|
228
|
+
readonly limit: NumberConstructor;
|
|
229
|
+
readonly directory: BooleanConstructor;
|
|
230
|
+
};
|
|
231
|
+
export type TtUploadProps = ExtractPropTypes<typeof ttUploadProps>;
|
|
232
|
+
export interface TtUploadEmits {
|
|
233
|
+
(e: "update:fileList", val: TtUploadFileItem[]): void;
|
|
234
|
+
(e: "preview", file: TtUploadFileItem): void;
|
|
235
|
+
(e: "download", file: TtUploadFileItem): void;
|
|
236
|
+
(e: "delete", file: TtUploadFileItem): void;
|
|
237
|
+
(e: "templateDownload"): void;
|
|
238
|
+
(e: "ok", fileList: TtUploadFileItem[]): void;
|
|
239
|
+
(e: "cancel"): void;
|
|
240
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -12,11 +12,13 @@ export * from './components/tt-text';
|
|
|
12
12
|
export * from './components/tt-tree-select';
|
|
13
13
|
export * from './directives';
|
|
14
14
|
export * from './components/tt-form';
|
|
15
|
+
export * from './components/tt-modal-form';
|
|
15
16
|
export * from './components/tt-image';
|
|
16
17
|
export * from './components/tt-loading';
|
|
17
18
|
export * from './components/tt-part';
|
|
18
19
|
export * from './components/tt-part-item';
|
|
19
20
|
export * from './components/tt-table';
|
|
21
|
+
export * from './components/tt-upload';
|
|
20
22
|
export { useFormat } from './hooks/useFormat';
|
|
21
23
|
export { useLoading } from './hooks/useLoading';
|
|
22
24
|
/**
|