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 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?: Headers | undefined;
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 [n, r] of e.headers.entries()) t.setRequestHeader(n, r);
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.open(e.method, n), t.send(r), t.onprogress = (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?: 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?: 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
  /** 文件的类型 */
@@ -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: e.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
- C(!1), ie(() => {
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);
@@ -2748,6 +2748,10 @@
2748
2748
  "description": "是否显示上传列表",
2749
2749
  "type": "boolean"
2750
2750
  },
2751
+ "s-upload/name": {
2752
+ "description": "上传文件的名称",
2753
+ "type": "string"
2754
+ },
2751
2755
  "s-upload/picture": {
2752
2756
  "description": "是否显示图片墙",
2753
2757
  "type": "boolean"
@@ -1135,6 +1135,7 @@
1135
1135
  "autoUpload",
1136
1136
  "drag",
1137
1137
  "showList",
1138
+ "name",
1138
1139
  "picture",
1139
1140
  "accept",
1140
1141
  "limit",
@@ -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.14.2",
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": "Headers",
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": "是否显示图片墙",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.15.0",
3
+ "version": "0.15.2",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",