savor-ui 0.15.2 → 0.15.3

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,14 @@
2
2
 
3
3
 
4
4
 
5
+ ## [0.15.3](https://gitee.com/mach552/savor-ui/compare/v0.15.2...v0.15.3) (2026-08-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **cascader:** 修复选择时输入框失焦问题 ([1bc1cc9](https://gitee.com/mach552/savor-ui/commits/1bc1cc9f7ac71d40897f691aa520ffa65622c7b4))
11
+ * **upload:** 修复文件上传进度展示问题 ([46e4a45](https://gitee.com/mach552/savor-ui/commits/46e4a45d940bd7c529abe8ccc116ccf57c99d7c4))
12
+
5
13
  ## [0.15.2](https://gitee.com/mach552/savor-ui/compare/v0.15.1...v0.15.2) (2026-08-03)
6
14
 
7
15
 
@@ -7,11 +7,11 @@ import { SPopover as r } from "../popover/index.mjs";
7
7
  import { SInput as i } from "../input/index.mjs";
8
8
  import { SEmpty as a } from "../empty/index.mjs";
9
9
  import o from "./cascader-column.vue.mjs";
10
- import { computed as s, createComponent as c, createComponentWithFallback as l, createIf as u, createInvoker as d, createTemplateRefSetter as f, defineVaporComponent as p, delegateEvents as m, mergeModels as h, on as g, onMounted as _, ref as v, renderEffect as y, resolveComponent as ee, setClass as b, setInsertionState as x, template as S, toRefs as C, unref as w, useModel as T, useTemplateRef as E, watch as te, withModifiers as ne } from "vue";
10
+ import { computed as s, createComponent as c, createComponentWithFallback as l, createIf as u, createInvoker as d, createTemplateRefSetter as f, defineVaporComponent as p, delegateEvents as m, mergeModels as h, on as g, onMounted as _, ref as v, renderEffect as y, resolveComponent as ee, setClass as b, setInsertionState as x, template as S, toRefs as C, unref as w, useModel as T, useTemplateRef as E, watch as te, withModifiers as ne, withVaporModifiers as D } from "vue";
11
11
  //#region ../components/src/cascader/cascader.vue?vue&type=script&setup=true&vapor=true&lang.ts
12
- var re = S("<div style=\"padding: 12px\">"), D = S("<div>"), O = S("<div>", 1);
13
- m("click");
14
- var k = /*@__PURE__*/ p({
12
+ var O = S("<div style=\"padding: 12px\">"), k = S("<div>"), A = S("<div>", 1);
13
+ m("mousedown", "click");
14
+ var j = /*@__PURE__*/ p({
15
15
  name: "SCascader",
16
16
  __name: "cascader",
17
17
  props: /*@__PURE__*/ h({
@@ -52,42 +52,42 @@ var k = /*@__PURE__*/ p({
52
52
  "update:expanded"
53
53
  ]),
54
54
  setup(p, { emit: m }) {
55
- let h = p, S = e("cascader"), k = m, A = T(p, "modelValue"), { size: j, error: M } = C(h), { mergedSize: N, mergedError: P } = n({
56
- size: j,
57
- error: M
58
- }), F = T(p, "expandedKeys"), I = T(p, "expanded"), L = s(() => ({
55
+ let h = p, S = e("cascader"), j = m, M = T(p, "modelValue"), { size: N, error: P } = C(h), { mergedSize: F, mergedError: I } = n({
56
+ size: N,
57
+ error: P
58
+ }), L = T(p, "expandedKeys"), R = T(p, "expanded"), z = s(() => ({
59
59
  label: "label",
60
60
  key: "key",
61
61
  children: "children",
62
62
  ...h.fieldNames
63
- })), R = v(""), z = v([]), B = (e) => h.pathMode ? e.map((e) => e[L.value.key]).join(h.pathSeparator) : e[e.length - 1][L.value.key], V = (e) => e.map((e) => e[L.value.label]).join(h.pathSeparator), H = ({ item: e, expandeds: t, unchecked: n }) => {
63
+ })), B = v(""), V = v([]), H = (e) => h.pathMode ? e.map((e) => e[z.value.key]).join(h.pathSeparator) : e[e.length - 1][z.value.key], U = (e) => e.map((e) => e[z.value.label]).join(h.pathSeparator), W = ({ item: e, expandeds: t, unchecked: n }) => {
64
64
  if (h.multiple) {
65
- let r = e[L.value.key], i = z.value.findIndex((e) => e[e.length - 1][L.value.key] === r);
66
- n ? i !== -1 && (z.value = z.value.toSpliced(i, 1)) : i === -1 && (z.value = [...z.value, t]), A.value = z.value.map(B), R.value = z.value.map(V).join(", "), k("selectItem", {
65
+ let r = e[z.value.key], i = V.value.findIndex((e) => e[e.length - 1][z.value.key] === r);
66
+ n ? i !== -1 && (V.value = V.value.toSpliced(i, 1)) : i === -1 && (V.value = [...V.value, t]), M.value = V.value.map(H), B.value = V.value.map(U).join(", "), j("selectItem", {
67
67
  item: e,
68
68
  expandeds: t
69
69
  });
70
70
  return;
71
71
  }
72
- K(!1), R.value = V(t), A.value = B(t), k("selectItem", {
72
+ J(!1), B.value = U(t), M.value = H(t), j("selectItem", {
73
73
  item: e,
74
74
  expandeds: t
75
75
  });
76
- }, U = () => {
77
- k("expand", F.value);
78
- }, W = E("popoverRef"), G = v(!1), K = (e) => {
79
- G.value = e, e ? W.value?.show() : W.value?.hide();
80
- }, q = () => {
81
- let e = !G.value;
82
- e && Z(), K(e);
83
- }, J = () => {
84
- K(!1);
76
+ }, G = () => {
77
+ j("expand", L.value);
78
+ }, K = E("popoverRef"), q = v(!1), J = (e) => {
79
+ q.value = e, e ? K.value?.show() : K.value?.hide();
80
+ }, re = () => {
81
+ let e = !q.value;
82
+ e && Z(), J(e);
83
+ }, ie = () => {
84
+ J(!1);
85
85
  }, Y = (e, t, n = []) => {
86
86
  for (let r of e) {
87
87
  let e = [...n, r];
88
- if (r[L.value.key] === t) return e;
89
- if (r[L.value.children]) {
90
- let n = Y(r[L.value.children], t, e);
88
+ if (r[z.value.key] === t) return e;
89
+ if (r[z.value.children]) {
90
+ let n = Y(r[z.value.children], t, e);
91
91
  if (n) return n;
92
92
  }
93
93
  }
@@ -95,58 +95,58 @@ var k = /*@__PURE__*/ p({
95
95
  }, X = (e, t) => {
96
96
  let n = [], r = e;
97
97
  for (let e of t) {
98
- let t = r.find((t) => t[L.value.key] === e);
98
+ let t = r.find((t) => t[z.value.key] === e);
99
99
  if (!t) return null;
100
- n.push(t), r = t[L.value.children] || [];
100
+ n.push(t), r = t[z.value.children] || [];
101
101
  }
102
102
  return n;
103
103
  }, Z = () => {
104
- if (A.value === void 0 || A.value === "") {
105
- R.value = "", F.value = [], I.value = [], z.value = [];
104
+ if (M.value === void 0 || M.value === "") {
105
+ B.value = "", L.value = [], R.value = [], V.value = [];
106
106
  return;
107
107
  }
108
108
  if (h.multiple) {
109
- z.value = (Array.isArray(A.value) ? A.value : []).map((e) => {
109
+ V.value = (Array.isArray(M.value) ? M.value : []).map((e) => {
110
110
  if (h.pathMode && typeof e == "string") {
111
111
  let t = e.split(h.pathSeparator);
112
112
  return X(h.options, t);
113
113
  }
114
114
  return Y(h.options, e);
115
- }).filter((e) => e !== null), R.value = z.value.map(V).join(", ");
115
+ }).filter((e) => e !== null), B.value = V.value.map(U).join(", ");
116
116
  return;
117
117
  }
118
118
  let e = null;
119
- if (h.pathMode && typeof A.value == "string") {
120
- let t = A.value.split(h.pathSeparator);
119
+ if (h.pathMode && typeof M.value == "string") {
120
+ let t = M.value.split(h.pathSeparator);
121
121
  e = X(h.options, t);
122
- } else Array.isArray(A.value) || (e = Y(h.options, A.value));
123
- e && (F.value = e.map((e) => e[L.value.key]), I.value = e, R.value = V(e));
122
+ } else Array.isArray(M.value) || (e = Y(h.options, M.value));
123
+ e && (L.value = e.map((e) => e[z.value.key]), R.value = e, B.value = U(e));
124
124
  }, Q = (e) => {
125
- A.value === void 0 ? e.forEach((e) => {
126
- F.value.includes(e[L.value.key]) && (R.value = R.value ? `${R.value}${h.pathSeparator}${e[L.value.label]}` : e[L.value.label], e[L.value.children] && Q(e[L.value.children]));
125
+ M.value === void 0 ? e.forEach((e) => {
126
+ L.value.includes(e[z.value.key]) && (B.value = B.value ? `${B.value}${h.pathSeparator}${e[z.value.label]}` : e[z.value.label], e[z.value.children] && Q(e[z.value.children]));
127
127
  }) : Z();
128
- }, ie = () => {
129
- A.value = h.multiple ? [] : "", F.value = [], I.value = [], z.value = [], R.value = "", k("clear");
128
+ }, ae = () => {
129
+ M.value = h.multiple ? [] : "", L.value = [], R.value = [], V.value = [], B.value = "", j("clear");
130
130
  };
131
- te(A, () => {
131
+ te(M, () => {
132
132
  Z();
133
133
  }), _(() => {
134
134
  Q(h.options);
135
135
  });
136
- let ae = f(), oe = ee("SIcon"), $ = O();
137
- return y(() => b($, [w(S).b()])), x($, null, 0), ae(c(w(r), { $: [() => ({
136
+ let oe = f(), se = ee("SIcon"), $ = A();
137
+ return y(() => b($, [w(S).b()])), x($, null, 0), oe(c(w(r), { $: [() => ({
138
138
  offset: [0, 4],
139
139
  placement: "bottom-start",
140
140
  manual: !0,
141
141
  ...p.popoverProps
142
- }), { onClickOutside: () => J }] }, {
142
+ }), { onClickOutside: () => ie }] }, {
143
143
  content: () => {
144
- let e = D();
144
+ let e = k();
145
145
  return y(() => b(e, [w(S).e("wrapper")])), x(e, null, 0), u(() => !p.options.length, () => {
146
- let e = re();
146
+ let e = O();
147
147
  return x(e, null, 0), c(w(a)), e;
148
148
  }, () => {
149
- let e = D();
149
+ let e = k();
150
150
  return y(() => b(e, [w(S).e("panel")])), x(e, null, 0), c(o, {
151
151
  expandTrigger: () => p.expandTrigger,
152
152
  fieldNames: () => p.fieldNames,
@@ -155,35 +155,35 @@ var k = /*@__PURE__*/ p({
155
155
  multiple: () => p.multiple,
156
156
  pathMode: () => p.pathMode,
157
157
  pathSeparator: () => p.pathSeparator,
158
- onClickItem: () => H,
159
- onExpand: () => U,
160
- modelValue: () => A.value,
161
- "onUpdate:modelValue": () => (e) => A.value = e,
162
- expanded: () => I.value,
163
- "onUpdate:expanded": () => (e) => I.value = e,
164
- expandedKeys: () => F.value,
165
- "onUpdate:expandedKeys": () => (e) => F.value = e
158
+ onClickItem: () => W,
159
+ onExpand: () => G,
160
+ modelValue: () => M.value,
161
+ "onUpdate:modelValue": () => (e) => M.value = e,
162
+ expanded: () => R.value,
163
+ "onUpdate:expanded": () => (e) => R.value = e,
164
+ expandedKeys: () => L.value,
165
+ "onUpdate:expandedKeys": () => (e) => L.value = e
166
166
  }), e;
167
- }, 261), g(e, "click", ne(() => {}, ["stop"])), e;
167
+ }, 261), g(e, "click", ne(() => {}, ["stop"])), e.$evtmousedown = D(() => {}, ["prevent"]), e;
168
168
  },
169
169
  default: () => c(w(i), {
170
170
  placeholder: () => p.placeholder,
171
171
  disabled: () => p.disabled,
172
- error: () => w(P),
173
- size: () => w(N),
172
+ error: () => w(I),
173
+ size: () => w(F),
174
174
  filled: () => p.filled,
175
- modelValue: () => R.value,
176
- "onUpdate:modelValue": () => (e) => R.value = e,
175
+ modelValue: () => B.value,
176
+ "onUpdate:modelValue": () => (e) => B.value = e,
177
177
  readonly: "",
178
178
  clearable: () => p.clearable,
179
179
  style: "width: 100%",
180
- onClear: () => ie
181
- }, { suffix: () => l(oe, {
180
+ onClear: () => ae
181
+ }, { suffix: () => l(se, {
182
182
  class: () => [w(S).e("suffix-icon")],
183
- style: () => ({ transform: G.value ? "rotate(180deg)" : "" })
183
+ style: () => ({ transform: q.value ? "rotate(180deg)" : "" })
184
184
  }, () => c(w(t))) })
185
- }), W, null, "popoverRef"), $.$evtclick = d(q), $;
185
+ }), K, null, "popoverRef"), $.$evtclick = d(re), $;
186
186
  }
187
187
  });
188
188
  //#endregion
189
- export { k as default };
189
+ export { j as default };
@@ -7,9 +7,9 @@ var e = (e) => {
7
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
- e.onSuccess?.(t.response);
11
- }, t.onerror = (t) => {
12
- e.onError?.(t);
10
+ t.status >= 200 && t.status < 300 ? e.onSuccess?.(t.response) : e.onError?.(/* @__PURE__ */ Error(`Request failed with status ${t.status}`));
11
+ }, t.onerror = () => {
12
+ e.onError?.(/* @__PURE__ */ Error("Network error"));
13
13
  }, t;
14
14
  };
15
15
  //#endregion
@@ -11,13 +11,13 @@ import s from "../../../icons/src/upload.vue.mjs";
11
11
  import c from "../../../icons/src/zoom-in.vue.mjs";
12
12
  import "../../../icons/index.mjs";
13
13
  import { SButton as l } from "../button/index.mjs";
14
- import { SImagePreview as ee } from "../image/index.mjs";
15
- import { SProgress as u } from "../progress/index.mjs";
16
- import { httpRequest as d } from "./request.mjs";
14
+ import { SImagePreview as u } from "../image/index.mjs";
15
+ import { SProgress as d } from "../progress/index.mjs";
16
+ import { httpRequest as ee } from "./request.mjs";
17
17
  import te from "./upload-drag.vue.mjs";
18
- import { child as f, computed as p, createComponent as m, createFor as h, createIf as g, createInvoker as _, createSlot as v, createTemplateRefSetter as ne, defineVaporComponent as y, delegateEvents as b, mergeModels as x, next as S, on as re, onUnmounted as ie, ref as C, renderEffect as w, setClass as T, setInsertionState as E, setProp as D, setText as ae, template as O, toDisplayString as oe, txt as se, unref as k, useModel as A, useTemplateRef as ce } from "vue";
18
+ import { child as f, computed as p, createComponent as m, createFor as h, createIf as g, createInvoker as _, createSlot as v, createTemplateRefSetter as ne, defineVaporComponent as y, delegateEvents as b, mergeModels as x, next as S, on as re, onUnmounted as ie, ref as C, renderEffect as w, setClass as T, setInsertionState as E, setProp as D, setStyle as O, setText as ae, template as k, toDisplayString as oe, txt as se, unref as A, useModel as ce, useTemplateRef as le } from "vue";
19
19
  //#region ../components/src/upload/upload.vue?vue&type=script&setup=true&vapor=true&lang.ts
20
- var le = O("<img>"), j = O("<div>"), ue = O("<div></div>"), de = O("<div><div> </div><div></div><div>"), fe = O("<div><input type=file>", 1);
20
+ var ue = k("<img>"), j = k("<div>"), de = k("<div></div>"), fe = k("<div><div><div> </div><div></div><div>"), pe = k("<div><input type=file>", 1);
21
21
  b("click");
22
22
  var M = /*@__PURE__*/ y({
23
23
  name: "SUpload",
@@ -66,22 +66,22 @@ var M = /*@__PURE__*/ y({
66
66
  "remove"
67
67
  ], ["update:modelValue"]),
68
68
  setup(y, { expose: b, emit: x }) {
69
- let O = y, M = x, N = t("upload"), P = ce("inputRef"), F = C([]), I = A(y, "modelValue"), L = (e) => e ? e.split(",").map((e) => e.trim()).filter(Boolean) : [], R = p(() => L(I.value).map((e, t) => ({
69
+ let k = y, M = x, N = t("upload"), P = le("inputRef"), F = C([]), I = ce(y, "modelValue"), L = (e) => e ? e.split(",").map((e) => e.trim()).filter(Boolean) : [], R = p(() => L(I.value).map((e, t) => ({
70
70
  uid: `model-${t}-${e}`,
71
71
  name: decodeURIComponent(e.split("/").pop()?.split("?")[0] || e),
72
72
  size: 0,
73
73
  url: e,
74
74
  status: "success",
75
75
  percentage: 100
76
- }))), z = p(() => [...F.value, ...R.value]), B = p(() => F.value.length + R.value.length), pe = p(() => !(O.limit && B.value >= O.limit)), V = C(!1), H = C(""), U = /* @__PURE__ */ new Map(), me = (e) => e.type.startsWith("image/"), W = (e) => {
76
+ }))), z = p(() => [...F.value, ...R.value]), B = p(() => F.value.length + R.value.length), me = p(() => !(k.limit && B.value >= k.limit)), V = C(!1), H = C(""), U = /* @__PURE__ */ new Map(), he = (e) => e.type.startsWith("image/"), W = (e) => {
77
77
  e && e.startsWith("blob:") && URL.revokeObjectURL(e);
78
78
  }, G = () => {
79
- O.disabled || P.value?.click();
79
+ k.disabled || P.value?.click();
80
80
  }, K = (t) => {
81
81
  let n = [];
82
82
  for (let e of t) n.push(e);
83
- if (O.limit) {
84
- let t = O.limit - B.value;
83
+ if (k.limit) {
84
+ let t = k.limit - B.value;
85
85
  if (t <= 0) {
86
86
  M("exceed", z.value);
87
87
  return;
@@ -101,18 +101,18 @@ var M = /*@__PURE__*/ y({
101
101
  name: t.name,
102
102
  size: t.size,
103
103
  raw: t,
104
- url: me(t) ? URL.createObjectURL(t) : void 0,
104
+ url: he(t) ? URL.createObjectURL(t) : void 0,
105
105
  status: "ready",
106
106
  percentage: 0
107
107
  };
108
108
  F.value = [...F.value, n];
109
109
  }
110
- M("change", z.value), O.autoUpload && Z();
111
- }, he = (e) => {
110
+ M("change", z.value), k.autoUpload && Z();
111
+ }, ge = (e) => {
112
112
  let t = e.target, n = t.files;
113
113
  n && K(n), t.value = "";
114
- }, ge = (e) => {
115
- O.disabled || K(e);
114
+ }, _e = (e) => {
115
+ k.disabled || K(e);
116
116
  }, q = (e) => {
117
117
  if (e.uid.startsWith("model-")) {
118
118
  I.value = L(I.value).filter((t) => t !== e.url).join(","), M("remove", e, z.value), M("change", z.value);
@@ -122,18 +122,18 @@ var M = /*@__PURE__*/ y({
122
122
  t !== -1 && (W(e.url), F.value = F.value.toSpliced(t, 1), M("remove", e, z.value), M("change", z.value));
123
123
  }, J = (e) => {
124
124
  Z(e);
125
- }, _e = (e) => {
125
+ }, Y = (e) => {
126
126
  let t = U.get(e.uid);
127
127
  t && (t.abort(), U.delete(e.uid), X(e.uid, { status: "error" }));
128
- }, Y = (e) => {
128
+ }, ve = (e) => {
129
129
  H.value = e.url || "", V.value = !0, M("preview", e);
130
130
  }, X = (e, t) => {
131
131
  let n = F.value.findIndex((t) => t.uid === e);
132
- n !== -1 && (F.value[n] = {
133
- ...F.value[n],
132
+ n !== -1 && (F.value = F.value.map((e, r) => r === n ? {
133
+ ...e,
134
134
  ...t
135
- }, F.value = [...F.value]);
136
- }, ve = (e) => {
135
+ } : e));
136
+ }, ye = (e) => {
137
137
  if (!e) return;
138
138
  let t = L(I.value);
139
139
  t.includes(e) || (t.push(e), I.value = t.join(","));
@@ -141,7 +141,7 @@ var M = /*@__PURE__*/ y({
141
141
  let t = async (e) => {
142
142
  if (e.status === "uploading" || !e.raw) return;
143
143
  try {
144
- await O.beforeUpload?.(e);
144
+ await k.beforeUpload?.(e);
145
145
  } catch {
146
146
  return;
147
147
  }
@@ -149,18 +149,18 @@ var M = /*@__PURE__*/ y({
149
149
  status: "uploading",
150
150
  percentage: 0
151
151
  });
152
- let t = d({
152
+ let t = ee({
153
153
  method: "POST",
154
154
  file: e.raw,
155
- name: O.name,
156
- action: O.action,
157
- headers: O.headers,
158
- data: O.data,
155
+ name: k.name,
156
+ action: k.action,
157
+ headers: k.headers,
158
+ data: k.data,
159
159
  onProgress: (t) => {
160
160
  X(e.uid, { percentage: t }), M("progress", e, t);
161
161
  },
162
162
  onSuccess: (t) => {
163
- ve(O.afterSuccess?.(e, t) ?? "");
163
+ ye(k.afterSuccess?.(e, t) ?? "");
164
164
  let n = F.value.findIndex((t) => t.uid === e.uid);
165
165
  n !== -1 && (W(e.url), F.value = F.value.toSpliced(n, 1)), U.delete(e.uid), M("success", e, t);
166
166
  },
@@ -178,95 +178,110 @@ var M = /*@__PURE__*/ y({
178
178
  ie(() => {
179
179
  U.forEach((e) => e.abort()), U.clear(), F.value.forEach((e) => W(e.url));
180
180
  }), b({ upload: Z });
181
- let ye = ne(), Q = fe(), $ = f(Q);
182
- return re($, "change", he), ye($, P, null, "inputRef"), w(() => {
183
- let e = k(N);
181
+ let be = ne(), Q = pe(), $ = f(Q);
182
+ return re($, "change", ge), be($, P, null, "inputRef"), w(() => {
183
+ let e = A(N);
184
184
  T(Q, [
185
185
  e.b(),
186
186
  e.is("picture", y.picture),
187
- e.is("disabled", O.disabled)
187
+ e.is("disabled", k.disabled)
188
188
  ]), T($, [e.e("inner")]), D($, "multiple", y.multiple), D($, "accept", y.accept);
189
189
  }), E(Q, null, 1), g(() => y.picture, () => {
190
190
  let e = j();
191
- return w(() => T(e, [k(N).e("picture-wall")])), E(e, null, 0), h(() => z.value, (e) => {
191
+ return w(() => T(e, [A(N).e("picture-wall")])), E(e, null, 0), h(() => z.value, (e) => {
192
192
  let t = j();
193
193
  return w(() => {
194
- let n = k(N);
194
+ let n = A(N);
195
195
  T(t, [n.e("picture-item"), n.is(e.value.status)]);
196
196
  }), E(t, null, 0), g(() => e.value.url, () => {
197
- let t = le();
197
+ let t = ue();
198
198
  return w(() => {
199
199
  let n = e.value;
200
- D(t, "src", n.url), T(t, [k(N).e("picture-thumb")]), D(t, "alt", n.name);
200
+ D(t, "src", n.url), T(t, [A(N).e("picture-thumb")]), D(t, "alt", n.name);
201
201
  }), t;
202
202
  }, () => {
203
203
  let e = j();
204
- return w(() => T(e, [k(N).e("picture-placeholder")])), E(e, null, 0), m(k(i)), e;
204
+ return w(() => T(e, [A(N).e("picture-placeholder")])), E(e, null, 0), m(A(i)), e;
205
205
  }, 261), E(t, null, 1), g(() => e.value.status === "uploading", () => {
206
206
  let t = j();
207
- return w(() => T(t, [k(N).e("picture-loading")])), E(t, null, 0), m(k(u), {
207
+ return w(() => {
208
+ T(t, [A(N).e("picture-progress-bar")]), O(t, { height: 100 - (e.value.percentage ?? 0) + "%" });
209
+ }), t;
210
+ }), E(t, null, 2), g(() => e.value.status === "uploading", () => {
211
+ let t = j();
212
+ return w(() => T(t, [A(N).e("picture-loading")])), E(t, null, 0), m(A(d), {
208
213
  percent: () => parseInt((e.value.percentage / 100).toFixed(1)),
209
214
  type: "primary"
210
215
  }), t;
211
216
  }, () => {
212
217
  let t = j();
213
- return w(() => T(t, [k(N).e("picture-mask")])), E(t, null, 0), g(() => !O.disabled && !y.autoUpload && y.showUpload && (e.value.status === "ready" || e.value.status === "error"), () => {
218
+ return w(() => T(t, [A(N).e("picture-mask")])), E(t, null, 0), g(() => !k.disabled && !y.autoUpload && y.showUpload && e.value.status === "ready", () => {
214
219
  let t = j();
215
- return w(() => T(t, [k(N).e("picture-action")])), E(t, null, 0), m(k(s)), t.$evtclick = _(() => Z(e.value)), t;
220
+ return w(() => T(t, [A(N).e("picture-action")])), E(t, null, 0), m(A(s)), t.$evtclick = _(() => Z(e.value)), t;
216
221
  }), E(t, null, 1), g(() => e.value.url, () => {
217
222
  let t = j();
218
- return w(() => T(t, [k(N).e("picture-action")])), E(t, null, 0), m(k(c)), t.$evtclick = _(() => Y(e.value)), t;
219
- }), E(t, null, 2), g(() => !O.disabled && y.showRetry && e.value.status === "error", () => {
223
+ return w(() => T(t, [A(N).e("picture-action")])), E(t, null, 0), m(A(c)), t.$evtclick = _(() => ve(e.value)), t;
224
+ }), E(t, null, 2), g(() => !k.disabled && y.showRetry && e.value.status === "error", () => {
220
225
  let t = j();
221
- return w(() => T(t, [k(N).e("picture-action")])), E(t, null, 0), m(k(o)), t.$evtclick = _(() => J(e.value)), t;
222
- }), E(t, null, 3), g(() => !O.disabled, () => {
226
+ return w(() => T(t, [A(N).e("picture-action")])), E(t, null, 0), m(A(o)), t.$evtclick = _(() => J(e.value)), t;
227
+ }), E(t, null, 3), g(() => !k.disabled, () => {
223
228
  let t = j();
224
- return w(() => T(t, [k(N).e("picture-action")])), E(t, null, 0), m(k(r)), t.$evtclick = _(() => q(e.value)), t;
229
+ return w(() => T(t, [A(N).e("picture-action")])), E(t, null, 0), m(A(r)), t.$evtclick = _(() => q(e.value)), t;
225
230
  }), t;
226
- }, 517), t;
227
- }, (e) => e.uid, 8), E(e, null, 1), g(() => pe.value, () => {
231
+ }, 773), t;
232
+ }, (e) => e.uid, 8), E(e, null, 1), g(() => me.value, () => {
228
233
  let e = j();
229
- return w(() => T(e, [k(N).e("picture-trigger")])), E(e, null, 0), v("trigger", null, () => m(k(a))), e.$evtclick = _(G), e;
234
+ return w(() => T(e, [A(N).e("picture-trigger")])), E(e, null, 0), v("trigger", null, () => m(A(a))), e.$evtclick = _(G), e;
230
235
  }), e;
231
236
  }, () => {
232
- let e = ue();
233
- return w(() => T(e, [k(N).e("content")])), E(e, null, 0), g(() => y.drag, () => m(te, {
234
- disabled: () => O.disabled,
237
+ let e = de();
238
+ return w(() => T(e, [A(N).e("content")])), E(e, null, 0), g(() => y.drag, () => m(te, {
239
+ disabled: () => k.disabled,
235
240
  onClick: () => G,
236
- onChange: () => ge
241
+ onChange: () => _e
237
242
  }, () => v("drag", null, null, 4)), () => {
238
243
  let e = j();
239
- return w(() => T(e, [k(N).e("btn")])), E(e, null, 0), v("btn", null, () => m(k(l), {
244
+ return w(() => T(e, [A(N).e("btn")])), E(e, null, 0), v("btn", null, () => m(A(l), {
240
245
  type: "primary",
241
246
  label: "选择文件",
242
- disabled: () => O.disabled
247
+ disabled: () => k.disabled
243
248
  })), e.$evtclick = _(G), e;
244
- }, 2309), [e, g(() => y.showList && z.value.length > 0, () => {
249
+ }, 2565), [e, g(() => y.showList && z.value.length > 0, () => {
245
250
  let e = j();
246
- return w(() => T(e, [k(N).e("list")])), E(e, null, 0), h(() => z.value, (e) => {
247
- let t = de(), i = f(t), a = S(i, 1), c = S(a, 2), l = se(i);
251
+ return w(() => T(e, [A(N).e("list")])), E(e, null, 0), h(() => z.value, (e) => {
252
+ let t = fe(), i = f(t, 1), a = f(i), c = S(a, 1), l = S(c, 2);
253
+ w(() => {
254
+ let n = A(N);
255
+ T(t, [n.e("item"), n.is(e.value.status, !0)]);
256
+ }), E(t, 0, 0), g(() => e.value.status === "uploading", () => {
257
+ let t = j();
258
+ return w(() => {
259
+ T(t, [A(N).e("progress-bar")]), O(t, { width: (e.value.percentage ?? 0) + "%" });
260
+ }), t;
261
+ });
262
+ let u = se(a);
248
263
  return w(() => {
249
- let n = k(N), r = e.value;
250
- T(t, [n.e("item"), n.is(r.status)]), T(i, [n.e("name")]), ae(l, oe(r.name)), T(a, [n.e("progress")]);
251
- }), E(a, null, 0), g(() => e.value.percentage && e.value.status === "uploading", () => m(k(u), {
264
+ let t = A(N);
265
+ T(i, [t.e("item-content")]), T(a, [t.e("name")]), ae(u, oe(e.value.name)), T(c, [t.e("progress")]);
266
+ }), E(c, null, 0), g(() => e.value.percentage && e.value.status === "uploading", () => m(A(d), {
252
267
  percent: () => parseInt((e.value.percentage / 100).toFixed(1)),
253
268
  type: "primary"
254
- })), w(() => T(c, [k(N).e("actions")])), E(c, null, 0), g(() => !O.disabled && !y.autoUpload && y.showUpload && (e.value.status === "ready" || e.value.status === "error"), () => {
269
+ })), w(() => T(l, [A(N).e("actions")])), E(l, null, 0), g(() => !k.disabled && !y.autoUpload && y.showUpload && e.value.status === "ready", () => {
255
270
  let t = j();
256
- return w(() => T(t, [k(N).e("action")])), E(t, null, 0), m(k(s)), t.$evtclick = _(() => Z(e.value)), t;
257
- }), E(c, null, 1), g(() => !O.disabled && y.showRetry && e.value.status === "error", () => {
271
+ return w(() => T(t, [A(N).e("action")])), E(t, null, 0), m(A(s)), t.$evtclick = _(() => Z(e.value)), t;
272
+ }), E(l, null, 1), g(() => !k.disabled && y.showRetry && e.value.status === "error", () => {
258
273
  let t = j();
259
- return w(() => T(t, [k(N).e("action")])), E(t, null, 0), m(k(o)), t.$evtclick = _(() => J(e.value)), t;
260
- }), E(c, null, 2), g(() => !O.disabled && y.showCancel && e.value.status === "uploading", () => {
274
+ return w(() => T(t, [A(N).e("action")])), E(t, null, 0), m(A(o)), t.$evtclick = _(() => J(e.value)), t;
275
+ }), E(l, null, 2), g(() => !k.disabled && y.showCancel && e.value.status === "uploading", () => {
261
276
  let t = j();
262
- return w(() => T(t, [k(N).e("action")])), E(t, null, 0), m(k(n)), t.$evtclick = _(() => _e(e.value)), t;
263
- }), E(c, null, 3), g(() => !O.disabled, () => {
277
+ return w(() => T(t, [A(N).e("action")])), E(t, null, 0), m(A(n)), t.$evtclick = _(() => Y(e.value)), t;
278
+ }), E(l, null, 3), g(() => !k.disabled, () => {
264
279
  let t = j();
265
- return w(() => T(t, [k(N).e("action")])), E(t, null, 0), m(k(r)), t.$evtclick = _(() => q(e.value)), t;
280
+ return w(() => T(t, [A(N).e("action")])), E(t, null, 0), m(A(r)), t.$evtclick = _(() => q(e.value)), t;
266
281
  }), t;
267
282
  }, (e) => e.uid, 9), e;
268
283
  })];
269
- }, 2057), E(Q, null, 2), m(k(ee), {
284
+ }, 2313), E(Q, null, 2), m(A(u), {
270
285
  modelValue: () => V.value,
271
286
  "onUpdate:modelValue": () => (e) => V.value = e,
272
287
  src: () => H.value
@@ -279,7 +279,7 @@
279
279
  }
280
280
 
281
281
  @include b(button-group) {
282
- display: flex;
282
+ display: inline-flex;
283
283
  @include b(button) {
284
284
  &:not(:last-child) {
285
285
  border-top-right-radius: 0;
@@ -100,6 +100,7 @@
100
100
  vertical-align: top;
101
101
  resize: vertical;
102
102
  color: getCssVar("color", "text-1");
103
+ font-family: inherit;
103
104
  &::placeholder {
104
105
  color: getCssVar("color", "text-3");
105
106
  }
@@ -45,12 +45,37 @@
45
45
  gap: 4px;
46
46
  }
47
47
  @include e(item) {
48
+ position: relative;
49
+ overflow: hidden;
48
50
  display: flex;
49
51
  align-items: center;
50
52
  background-color: getCssVar("color", "fill-2");
51
53
  padding: 8px 12px;
52
54
  gap: 12px;
53
55
  border-radius: getCssVar("radius", "medium");
56
+ @include when(success) {
57
+ background-color: getCssVar("color", "success-1");
58
+ }
59
+ @include when(error) {
60
+ background-color: getCssVar("color", "danger-1");
61
+ }
62
+ }
63
+ @include e(progress-bar) {
64
+ position: absolute;
65
+ top: 0;
66
+ left: 0;
67
+ bottom: 0;
68
+ background-color: getCssVar("color", "primary-1");
69
+ transition: width 0.2s getCssVar("bezier", "1");
70
+ z-index: 0;
71
+ }
72
+ @include e(item-content) {
73
+ position: relative;
74
+ z-index: 1;
75
+ display: flex;
76
+ align-items: center;
77
+ gap: 12px;
78
+ width: 100%;
54
79
  }
55
80
  @include e(name) {
56
81
  max-width: 200px;
@@ -127,6 +152,16 @@
127
152
  }
128
153
  }
129
154
  }
155
+ @include e(picture-progress-bar) {
156
+ position: absolute;
157
+ bottom: 0;
158
+ left: 0;
159
+ right: 0;
160
+ background-color: getCssVar("color", "primary-1");
161
+ transition: height 0.2s getCssVar("bezier", "1");
162
+ z-index: 0;
163
+ pointer-events: none;
164
+ }
130
165
  @include e(picture-thumb) {
131
166
  width: 100%;
132
167
  height: 100%;
@@ -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.15.1",
5
+ "version": "0.15.2",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "types-syntax": "typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "savor-ui",
3
- "version": "0.15.2",
3
+ "version": "0.15.3",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",