savor-ui 0.15.0 → 0.15.2
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/CHANGELOG.md +14 -0
- package/dist/es/components/src/upload/index.d.ts +2 -1
- package/dist/es/components/src/upload/request.mjs +2 -2
- package/dist/es/components/src/upload/types.d.ts +4 -2
- package/dist/es/components/src/upload/upload.vue_vue_type_script_setup_true_vapor_true_lang.mjs +3 -2
- package/dist/json/vetur-attributes.json +4 -0
- package/dist/json/vetur-tags.json +1 -0
- package/dist/json/web-types.json +10 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
## [0.15.2](https://gitee.com/mach552/savor-ui/compare/v0.15.1...v0.15.2) (2026-08-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **upload:** 修复上传文件字段 ([462e464](https://gitee.com/mach552/savor-ui/commits/462e4645aca8a9301f48505126f169c173d55cb0))
|
|
11
|
+
|
|
12
|
+
## [0.15.1](https://gitee.com/mach552/savor-ui/compare/v0.15.0...v0.15.1) (2026-08-03)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **upload:** 修复无法遍历headers的问题 ([8b7d4bf](https://gitee.com/mach552/savor-ui/commits/8b7d4bf49991a1d67d0970d67f067550b004bfad))
|
|
18
|
+
|
|
5
19
|
# [0.15.0](https://gitee.com/mach552/savor-ui/compare/v0.14.2...v0.15.0) (2026-08-02)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -13,12 +13,13 @@ export declare const SUpload: ((__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
|
13
13
|
}, __VLS_exposed?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
|
14
14
|
props: PublicProps & {
|
|
15
15
|
multiple?: boolean | undefined;
|
|
16
|
-
headers?:
|
|
16
|
+
headers?: Record<string, any> | undefined;
|
|
17
17
|
data?: Record<string, any> | undefined;
|
|
18
18
|
action?: string | undefined;
|
|
19
19
|
autoUpload?: boolean | undefined;
|
|
20
20
|
drag?: boolean | undefined;
|
|
21
21
|
showList?: boolean | undefined;
|
|
22
|
+
name?: string | undefined;
|
|
22
23
|
picture?: boolean | undefined;
|
|
23
24
|
accept?: string | undefined;
|
|
24
25
|
limit?: number | undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region ../components/src/upload/request.ts
|
|
2
2
|
var e = (e) => {
|
|
3
3
|
let t = new XMLHttpRequest(), n = e.action || "";
|
|
4
|
-
if (e.headers) for (let
|
|
4
|
+
if (t.open(e.method, n), e.headers) for (let n in e.headers) t.setRequestHeader(n, e.headers[n]);
|
|
5
5
|
let r = new FormData();
|
|
6
6
|
if (e.data) for (let t in e.data) r.append(t, e.data[t]);
|
|
7
|
-
return r.append(e.name, e.file), t.
|
|
7
|
+
return r.append(e.name, e.file), t.send(r), t.onprogress = (t) => {
|
|
8
8
|
e.onProgress?.(t.loaded / t.total * 100);
|
|
9
9
|
}, t.onload = () => {
|
|
10
10
|
e.onSuccess?.(t.response);
|
|
@@ -12,7 +12,7 @@ export interface RequestOptions {
|
|
|
12
12
|
file: File;
|
|
13
13
|
name: string;
|
|
14
14
|
action?: string;
|
|
15
|
-
headers?:
|
|
15
|
+
headers?: Record<string, any>;
|
|
16
16
|
data?: Record<string, any>;
|
|
17
17
|
onError: (error: any) => void;
|
|
18
18
|
onSuccess: (response: any) => void;
|
|
@@ -22,7 +22,7 @@ export interface UploadProps {
|
|
|
22
22
|
/** 是否支持多选 */
|
|
23
23
|
multiple?: boolean;
|
|
24
24
|
/** 请求头 */
|
|
25
|
-
headers?:
|
|
25
|
+
headers?: Record<string, any>;
|
|
26
26
|
/** 请求体 */
|
|
27
27
|
data?: Record<string, any>;
|
|
28
28
|
/** 请求地址 */
|
|
@@ -33,6 +33,8 @@ export interface UploadProps {
|
|
|
33
33
|
drag?: boolean;
|
|
34
34
|
/** 是否显示上传列表 */
|
|
35
35
|
showList?: boolean;
|
|
36
|
+
/** 上传文件的名称 */
|
|
37
|
+
name?: string;
|
|
36
38
|
/** 是否显示图片墙 */
|
|
37
39
|
picture?: boolean;
|
|
38
40
|
/** 文件的类型 */
|
package/dist/es/components/src/upload/upload.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -33,6 +33,7 @@ var M = /*@__PURE__*/ y({
|
|
|
33
33
|
type: Boolean,
|
|
34
34
|
default: !0
|
|
35
35
|
},
|
|
36
|
+
name: { default: "file" },
|
|
36
37
|
picture: { type: Boolean },
|
|
37
38
|
accept: {},
|
|
38
39
|
limit: {},
|
|
@@ -151,7 +152,7 @@ var M = /*@__PURE__*/ y({
|
|
|
151
152
|
let t = d({
|
|
152
153
|
method: "POST",
|
|
153
154
|
file: e.raw,
|
|
154
|
-
name:
|
|
155
|
+
name: O.name,
|
|
155
156
|
action: O.action,
|
|
156
157
|
headers: O.headers,
|
|
157
158
|
data: O.data,
|
|
@@ -174,7 +175,7 @@ var M = /*@__PURE__*/ y({
|
|
|
174
175
|
n && await t(n);
|
|
175
176
|
} else for (let e of F.value) e.status !== "success" && await t(e);
|
|
176
177
|
};
|
|
177
|
-
|
|
178
|
+
ie(() => {
|
|
178
179
|
U.forEach((e) => e.abort()), U.clear(), F.value.forEach((e) => W(e.url));
|
|
179
180
|
}), b({ upload: Z });
|
|
180
181
|
let ye = ne(), Q = fe(), $ = f(Q);
|
package/dist/json/web-types.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"framework": "vue",
|
|
4
4
|
"name": "savor-ui",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.15.1",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"types-syntax": "typescript",
|
|
@@ -6927,7 +6927,7 @@
|
|
|
6927
6927
|
"name": "headers",
|
|
6928
6928
|
"description": "请求头",
|
|
6929
6929
|
"value": {
|
|
6930
|
-
"type": "
|
|
6930
|
+
"type": "Record<string, any>",
|
|
6931
6931
|
"kind": "expression"
|
|
6932
6932
|
}
|
|
6933
6933
|
},
|
|
@@ -6971,6 +6971,14 @@
|
|
|
6971
6971
|
"kind": "expression"
|
|
6972
6972
|
}
|
|
6973
6973
|
},
|
|
6974
|
+
{
|
|
6975
|
+
"name": "name",
|
|
6976
|
+
"description": "上传文件的名称",
|
|
6977
|
+
"value": {
|
|
6978
|
+
"type": "string",
|
|
6979
|
+
"kind": "expression"
|
|
6980
|
+
}
|
|
6981
|
+
},
|
|
6974
6982
|
{
|
|
6975
6983
|
"name": "picture",
|
|
6976
6984
|
"description": "是否显示图片墙",
|