savor-ui 0.15.2 → 0.15.4

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,22 @@
2
2
 
3
3
 
4
4
 
5
+ ## [0.15.4](https://gitee.com/mach552/savor-ui/compare/v0.15.3...v0.15.4) (2026-08-04)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **cascader:** 修复输入框聚焦逻辑 ([a2b0716](https://gitee.com/mach552/savor-ui/commits/a2b07160fd609dfeaaf720ff5f8be8d1403c2eac))
11
+ * **popover:** 修复切换页面后无法关闭问题 ([ffaf459](https://gitee.com/mach552/savor-ui/commits/ffaf4591e5485eb086ca8cb48e03fa9a3bcabe56))
12
+
13
+ ## [0.15.3](https://gitee.com/mach552/savor-ui/compare/v0.15.2...v0.15.3) (2026-08-04)
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * **cascader:** 修复选择时输入框失焦问题 ([1bc1cc9](https://gitee.com/mach552/savor-ui/commits/1bc1cc9f7ac71d40897f691aa520ffa65622c7b4))
19
+ * **upload:** 修复文件上传进度展示问题 ([46e4a45](https://gitee.com/mach552/savor-ui/commits/46e4a45d940bd7c529abe8ccc116ccf57c99d7c4))
20
+
5
21
  ## [0.15.2](https://gitee.com/mach552/savor-ui/compare/v0.15.1...v0.15.2) (2026-08-03)
6
22
 
7
23
 
@@ -5,9 +5,9 @@ import "../../../icons/index.mjs";
5
5
  import { SScrollbar as n } from "../scrollbar/index.mjs";
6
6
  import { SCheckbox as r } from "../checkbox/index.mjs";
7
7
  import { SRadio as i } from "../radio/index.mjs";
8
- import { child as a, computed as o, createComponent as s, createComponentWithFallback as c, createFor as l, createIf as u, defineVaporComponent as d, mergeModels as f, nextTick as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as v, setClass as y, setInsertionState as b, setProp as x, setStaticTemplateRef as S, setStyle as C, setText as w, template as T, toDisplayString as E, txt as D, unref as O, useModel as k, useTemplateRef as ee, watch as A, withModifiers as j } from "vue";
8
+ import { child as a, computed as o, createComponent as s, createComponentWithFallback as c, createFor as l, createIf as u, defineVaporComponent as d, mergeModels as f, nextTick as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as ee, setClass as v, setInsertionState as y, setProp as b, setStaticTemplateRef as x, setStyle as S, setText as C, template as w, toDisplayString as T, txt as E, unref as D, useModel as O, useTemplateRef as k, watch as A, withModifiers as j } from "vue";
9
9
  //#region ../components/src/cascader/cascader-column.vue?vue&type=script&setup=true&vapor=true&lang.ts
10
- var M = T("<div>"), N = T("<div><div> </div>"), P = /*@__PURE__*/ d({
10
+ var M = w("<div>"), N = w("<div><div> </div>"), P = /*@__PURE__*/ d({
11
11
  name: "SCascaderColumn",
12
12
  __name: "cascader-column",
13
13
  props: /*@__PURE__*/ f({
@@ -47,12 +47,12 @@ var M = T("<div>"), N = T("<div><div> </div>"), P = /*@__PURE__*/ d({
47
47
  ]),
48
48
  __multiRoot: !0,
49
49
  setup(d, { emit: f }) {
50
- let T = f, P = d, F = f, I = e("cascader"), L = o(() => ({
50
+ let w = f, P = d, F = f, I = e("cascader"), L = o(() => ({
51
51
  label: "label",
52
52
  key: "key",
53
53
  children: "children",
54
54
  ...P.fieldNames
55
- })), R = ee("scrollbarRef"), z = k(d, "modelValue"), B = k(d, "expandedKeys"), V = k(d, "expanded"), H = g([]), U = g([]), W = g(!0), G = o(() => {
55
+ })), R = k("scrollbarRef"), z = O(d, "modelValue"), B = O(d, "expandedKeys"), V = O(d, "expanded"), H = g([]), U = g([]), W = g(!0), G = o(() => {
56
56
  let e = z.value;
57
57
  if (!Array.isArray(e)) {
58
58
  if (P.pathMode && typeof e == "string" && e !== "") {
@@ -104,44 +104,46 @@ var M = T("<div>"), N = T("<div><div> </div>"), P = /*@__PURE__*/ d({
104
104
  });
105
105
  });
106
106
  });
107
- let ne = v("CascaderColumn", !0), $ = M();
108
- return _(() => y($, [O(I).e("column")])), b($, null, 0), S(s(O(n), { height: "100%" }, () => {
107
+ let ne = ee("CascaderColumn", !0), $ = M();
108
+ return _(() => v($, [D(I).e("column")])), y($, null, 0), x(s(D(n), { height: "100%" }, () => {
109
109
  let e = M();
110
- return _(() => y(e, [O(I).e("list")])), b(e, null, 0), l(() => H.value, (e) => {
110
+ return _(() => v(e, [D(I).e("list")])), y(e, null, 0), l(() => H.value, (e) => {
111
111
  let n = N(), o = a(n, 1);
112
112
  _(() => {
113
- let t = O(I), r = L.value;
114
- y(n, [t.e("item"), t.is("checked", e.value[r.key] === B.value[d.id])]);
115
- }), b(n, 0, 0), u(() => d.checkStrictly || d.multiple, () => {
113
+ let t = D(I), r = L.value;
114
+ v(n, [t.e("item"), t.is("checked", e.value[r.key] === B.value[d.id])]);
115
+ }), y(n, 0, 0), u(() => d.checkStrictly || d.multiple, () => {
116
116
  let t = M();
117
- return _(() => y(t, [O(I).e("check")])), b(t, null, 0), u(() => d.checkStrictly && !d.multiple, () => {
118
- let t = () => Y(e.value), n = () => {};
119
- return s(O(i), {
117
+ return _(() => v(t, [D(I).e("check")])), y(t, null, 0), u(() => d.checkStrictly && !d.multiple, () => {
118
+ let t = () => Y(e.value), n = () => {}, r = () => {};
119
+ return s(D(i), {
120
120
  value: () => e.value[L.value.key],
121
121
  "model-value": () => G.value,
122
122
  onChange: () => t,
123
- onClick: () => j(n, ["stop"])
123
+ onClick: () => j(n, ["stop"]),
124
+ onMousedown: () => j(r, ["prevent"])
124
125
  });
125
126
  }, () => u(() => d.multiple, () => {
126
- let t = (t) => X(t, e.value), n = () => {};
127
- return s(O(r), {
127
+ let t = (t) => X(t, e.value), n = () => {}, i = () => {};
128
+ return s(D(r), {
128
129
  "model-value": () => q(e.value),
129
130
  onChange: () => t,
130
- onClick: () => j(n, ["stop"])
131
+ onClick: () => j(n, ["stop"]),
132
+ onMousedown: () => j(i, ["prevent"])
131
133
  });
132
134
  }), 261), t;
133
135
  });
134
- let c = D(o);
136
+ let c = E(o);
135
137
  return _(() => {
136
138
  let t = L.value;
137
- y(o, [O(I).e("label")]), C(o, { padding: d.checkStrictly || d.multiple ? "0 12px" : "0 16px" }), w(c, E(e.value[t.label]));
138
- }), b(n, null, 2), u(() => e.value.isFolder, () => {
139
+ v(o, [D(I).e("label")]), S(o, { padding: d.checkStrictly || d.multiple ? "0 12px" : "0 16px" }), C(c, T(e.value[t.label]));
140
+ }), y(n, null, 2), u(() => e.value.isFolder, () => {
139
141
  let e = M();
140
- return _(() => y(e, [O(I).e("arrow")])), b(e, null, 0), s(O(t)), e;
141
- }), m(n, "click", j(() => J(e.value), ["stop"])), m(n, "mouseenter", j(() => te(e.value), ["stop"])), x(n, "id", `item-${e.value[L.value.key]}`), n;
142
+ return _(() => v(e, [D(I).e("arrow")])), y(e, null, 0), s(D(t)), e;
143
+ }), m(n, "click", j(() => J(e.value), ["stop"])), m(n, "mouseenter", j(() => te(e.value), ["stop"])), b(n, "id", `item-${e.value[L.value.key]}`), n;
142
144
  }, (e) => e[L.value.key], 9), e;
143
145
  }), R, null, "scrollbarRef"), [$, u(() => U.value.length > 0 && W.value, () => {
144
- let e = (e) => T("clickItem", e), t = (e) => T("expand", e);
146
+ let e = (e) => w("clickItem", e), t = (e) => w("expand", e);
145
147
  return c(ne, {
146
148
  options: () => U.value,
147
149
  onClickItem: () => e,
@@ -6,15 +6,15 @@ import { useFormItem as n } from "../form/use-form-item.mjs";
6
6
  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
- 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";
9
+ import ee from "./cascader-column.vue.mjs";
10
+ import { computed as o, createComponent as s, createComponentWithFallback as c, createIf as te, createInvoker as l, createTemplateRefSetter as u, defineVaporComponent as d, delegateEvents as f, mergeModels as p, on as m, onMounted as h, ref as g, renderEffect as _, resolveComponent as ne, setClass as v, setInsertionState as y, template as b, toRefs as x, unref as S, useModel as C, useTemplateRef as w, watch as T, withModifiers as E, 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 re = b("<div style=\"padding: 12px\">"), ie = b("<div>"), ae = b("<div data-skip-blur-validation>"), oe = b("<div>", 1);
13
+ f("mousedown", "focusin", "click");
14
+ var O = /*@__PURE__*/ d({
15
15
  name: "SCascader",
16
16
  __name: "cascader",
17
- props: /*@__PURE__*/ h({
17
+ props: /*@__PURE__*/ p({
18
18
  modelValue: {},
19
19
  options: { default: () => [] },
20
20
  placeholder: { default: "请选择" },
@@ -42,7 +42,7 @@ var k = /*@__PURE__*/ p({
42
42
  expanded: { default: () => [] },
43
43
  expandedModifiers: {}
44
44
  }),
45
- emits: /*@__PURE__*/ h([
45
+ emits: /*@__PURE__*/ p([
46
46
  "selectItem",
47
47
  "expand",
48
48
  "clear"
@@ -51,48 +51,50 @@ var k = /*@__PURE__*/ p({
51
51
  "update:expandedKeys",
52
52
  "update:expanded"
53
53
  ]),
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({
54
+ setup(d, { emit: f }) {
55
+ let p = d, b = e("cascader"), O = f, k = w("inputRef"), A = C(d, "modelValue"), { size: j, error: M } = x(p), { mergedSize: N, mergedError: P } = n({
56
56
  size: j,
57
57
  error: M
58
- }), F = T(p, "expandedKeys"), I = T(p, "expanded"), L = s(() => ({
58
+ }), F = C(d, "expandedKeys"), I = C(d, "expanded"), L = o(() => ({
59
59
  label: "label",
60
60
  key: "key",
61
61
  children: "children",
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 }) => {
64
- if (h.multiple) {
62
+ ...p.fieldNames
63
+ })), R = g(""), z = g([]), B = (e) => p.pathMode ? e.map((e) => e[L.value.key]).join(p.pathSeparator) : e[e.length - 1][L.value.key], V = (e) => e.map((e) => e[L.value.label]).join(p.pathSeparator), H = ({ item: e, expandeds: t, unchecked: n }) => {
64
+ if (p.multiple) {
65
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", {
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(", "), O("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
+ R.value = V(t), A.value = B(t), O("selectItem", {
73
73
  item: e,
74
74
  expandeds: t
75
- });
75
+ }), K(!1);
76
76
  }, U = () => {
77
- k("expand", F.value);
78
- }, W = E("popoverRef"), G = v(!1), K = (e) => {
77
+ O("expand", F.value);
78
+ }, W = w("popoverRef"), G = g(!1), K = (e) => {
79
79
  G.value = e, e ? W.value?.show() : W.value?.hide();
80
- }, q = () => {
80
+ }, se = () => {
81
81
  let e = !G.value;
82
- e && Z(), K(e);
83
- }, J = () => {
82
+ e && Y(), K(e);
83
+ }, ce = () => {
84
84
  K(!1);
85
- }, Y = (e, t, n = []) => {
85
+ }, le = (e) => {
86
+ e.target && k.value?.focus();
87
+ }, q = (e, t, n = []) => {
86
88
  for (let r of e) {
87
89
  let e = [...n, r];
88
90
  if (r[L.value.key] === t) return e;
89
91
  if (r[L.value.children]) {
90
- let n = Y(r[L.value.children], t, e);
92
+ let n = q(r[L.value.children], t, e);
91
93
  if (n) return n;
92
94
  }
93
95
  }
94
96
  return null;
95
- }, X = (e, t) => {
97
+ }, J = (e, t) => {
96
98
  let n = [], r = e;
97
99
  for (let e of t) {
98
100
  let t = r.find((t) => t[L.value.key] === e);
@@ -100,61 +102,61 @@ var k = /*@__PURE__*/ p({
100
102
  n.push(t), r = t[L.value.children] || [];
101
103
  }
102
104
  return n;
103
- }, Z = () => {
105
+ }, Y = () => {
104
106
  if (A.value === void 0 || A.value === "") {
105
107
  R.value = "", F.value = [], I.value = [], z.value = [];
106
108
  return;
107
109
  }
108
- if (h.multiple) {
110
+ if (p.multiple) {
109
111
  z.value = (Array.isArray(A.value) ? A.value : []).map((e) => {
110
- if (h.pathMode && typeof e == "string") {
111
- let t = e.split(h.pathSeparator);
112
- return X(h.options, t);
112
+ if (p.pathMode && typeof e == "string") {
113
+ let t = e.split(p.pathSeparator);
114
+ return J(p.options, t);
113
115
  }
114
- return Y(h.options, e);
116
+ return q(p.options, e);
115
117
  }).filter((e) => e !== null), R.value = z.value.map(V).join(", ");
116
118
  return;
117
119
  }
118
120
  let e = null;
119
- if (h.pathMode && typeof A.value == "string") {
120
- let t = A.value.split(h.pathSeparator);
121
- e = X(h.options, t);
122
- } else Array.isArray(A.value) || (e = Y(h.options, A.value));
121
+ if (p.pathMode && typeof A.value == "string") {
122
+ let t = A.value.split(p.pathSeparator);
123
+ e = J(p.options, t);
124
+ } else Array.isArray(A.value) || (e = q(p.options, A.value));
123
125
  e && (F.value = e.map((e) => e[L.value.key]), I.value = e, R.value = V(e));
124
- }, Q = (e) => {
126
+ }, X = (e) => {
125
127
  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]));
127
- }) : Z();
128
- }, ie = () => {
129
- A.value = h.multiple ? [] : "", F.value = [], I.value = [], z.value = [], R.value = "", k("clear");
128
+ F.value.includes(e[L.value.key]) && (R.value = R.value ? `${R.value}${p.pathSeparator}${e[L.value.label]}` : e[L.value.label], e[L.value.children] && X(e[L.value.children]));
129
+ }) : Y();
130
+ }, ue = () => {
131
+ A.value = p.multiple ? [] : "", F.value = [], I.value = [], z.value = [], R.value = "", O("clear");
130
132
  };
131
- te(A, () => {
132
- Z();
133
- }), _(() => {
134
- Q(h.options);
133
+ T(A, () => {
134
+ Y();
135
+ }), h(() => {
136
+ X(p.options);
135
137
  });
136
- let ae = f(), oe = ee("SIcon"), $ = O();
137
- return y(() => b($, [w(S).b()])), x($, null, 0), ae(c(w(r), { $: [() => ({
138
+ let Z = u(), Q = ne("SIcon"), $ = oe();
139
+ return _(() => v($, [S(b).b()])), y($, null, 0), Z(s(S(r), { $: [() => ({
138
140
  offset: [0, 4],
139
141
  placement: "bottom-start",
140
142
  manual: !0,
141
- ...p.popoverProps
142
- }), { onClickOutside: () => J }] }, {
143
+ ...d.popoverProps
144
+ }), { onClickOutside: () => ce }] }, {
143
145
  content: () => {
144
- let e = D();
145
- return y(() => b(e, [w(S).e("wrapper")])), x(e, null, 0), u(() => !p.options.length, () => {
146
+ let e = ae();
147
+ return _(() => v(e, [S(b).e("wrapper")])), y(e, null, 0), te(() => !d.options.length, () => {
146
148
  let e = re();
147
- return x(e, null, 0), c(w(a)), e;
149
+ return y(e, null, 0), s(S(a)), e;
148
150
  }, () => {
149
- let e = D();
150
- return y(() => b(e, [w(S).e("panel")])), x(e, null, 0), c(o, {
151
- expandTrigger: () => p.expandTrigger,
152
- fieldNames: () => p.fieldNames,
153
- options: () => p.options,
154
- checkStrictly: () => p.checkStrictly,
155
- multiple: () => p.multiple,
156
- pathMode: () => p.pathMode,
157
- pathSeparator: () => p.pathSeparator,
151
+ let e = ie();
152
+ return _(() => v(e, [S(b).e("panel")])), y(e, null, 0), s(ee, {
153
+ expandTrigger: () => d.expandTrigger,
154
+ fieldNames: () => d.fieldNames,
155
+ options: () => d.options,
156
+ checkStrictly: () => d.checkStrictly,
157
+ multiple: () => d.multiple,
158
+ pathMode: () => d.pathMode,
159
+ pathSeparator: () => d.pathSeparator,
158
160
  onClickItem: () => H,
159
161
  onExpand: () => U,
160
162
  modelValue: () => A.value,
@@ -164,26 +166,29 @@ var k = /*@__PURE__*/ p({
164
166
  expandedKeys: () => F.value,
165
167
  "onUpdate:expandedKeys": () => (e) => F.value = e
166
168
  }), e;
167
- }, 261), g(e, "click", ne(() => {}, ["stop"])), e;
169
+ }, 261), m(e, "click", E(() => {}, ["stop"])), e.$evtmousedown = D(() => {}, ["prevent"]), e.$evtfocusin = l(le), e;
168
170
  },
169
- default: () => c(w(i), {
170
- placeholder: () => p.placeholder,
171
- disabled: () => p.disabled,
172
- error: () => w(P),
173
- size: () => w(N),
174
- filled: () => p.filled,
175
- modelValue: () => R.value,
176
- "onUpdate:modelValue": () => (e) => R.value = e,
177
- readonly: "",
178
- clearable: () => p.clearable,
179
- style: "width: 100%",
180
- onClear: () => ie
181
- }, { suffix: () => l(oe, {
182
- class: () => [w(S).e("suffix-icon")],
183
- style: () => ({ transform: G.value ? "rotate(180deg)" : "" })
184
- }, () => c(w(t))) })
185
- }), W, null, "popoverRef"), $.$evtclick = d(q), $;
171
+ default: () => {
172
+ let e = s(S(i), {
173
+ placeholder: () => d.placeholder,
174
+ disabled: () => d.disabled,
175
+ error: () => S(P),
176
+ size: () => S(N),
177
+ filled: () => d.filled,
178
+ modelValue: () => R.value,
179
+ "onUpdate:modelValue": () => (e) => R.value = e,
180
+ readonly: "",
181
+ clearable: () => d.clearable,
182
+ style: "width: 100%",
183
+ onClear: () => ue
184
+ }, { suffix: () => c(Q, {
185
+ class: () => [S(b).e("suffix-icon")],
186
+ style: () => ({ transform: G.value ? "rotate(180deg)" : "" })
187
+ }, () => s(S(t))) });
188
+ return Z(e, k, null, "inputRef"), e;
189
+ }
190
+ }), W, null, "popoverRef"), $.$evtclick = l(se), $;
186
191
  }
187
192
  });
188
193
  //#endregion
189
- export { k as default };
194
+ export { O as default };
@@ -70,7 +70,9 @@ var A = /*@__PURE__*/ d({
70
70
  }, de = (e) => {
71
71
  M("focus", e);
72
72
  }, fe = (e) => {
73
- M("blur", e), Y("blur");
73
+ M("blur", e);
74
+ let t = e.relatedTarget;
75
+ t && t.closest("[data-skip-blur-validation]") || Y("blur");
74
76
  }, pe = (e) => {
75
77
  M("press-enter", z.value, e);
76
78
  }, J = ae("inputRef");
@@ -4,10 +4,10 @@ import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
4
4
  import { useOutsideClick as n } from "../../../hooks/src/use-outside-click.mjs";
5
5
  import { useZIndex as r } from "../../../hooks/src/use-zIndex.mjs";
6
6
  import "../../../hooks/index.mjs";
7
- import { VaporTeleport as i, VaporTransition as a, applyVShow as o, child as s, computed as c, createComponent as l, createDynamicComponent as ee, createIf as u, createSlot as te, createTemplateRefSetter as ne, defineVaporComponent as d, nextTick as re, onMounted as ie, onUnmounted as ae, ref as f, renderEffect as p, setClass as m, setDynamicEvents as h, setInsertionState as g, setStyle as _, setText as oe, template as v, toDisplayString as se, unref as y, useSlots as ce, useTemplateRef as b, watch as x, watchEffect as le } from "vue";
8
- import { arrow as ue, autoUpdate as de, computePosition as fe, flip as pe, offset as me, shift as he } from "@floating-ui/dom";
7
+ import { VaporTeleport as i, VaporTransition as a, applyVShow as o, child as s, computed as c, createComponent as l, createDynamicComponent as ee, createIf as te, createSlot as ne, createTemplateRefSetter as re, defineVaporComponent as u, nextTick as d, onDeactivated as ie, onMounted as ae, onUnmounted as oe, ref as f, renderEffect as p, setClass as m, setDynamicEvents as h, setInsertionState as g, setStyle as _, setText as se, template as v, toDisplayString as ce, unref as y, useSlots as le, useTemplateRef as b, watch as x, watchEffect as ue } from "vue";
8
+ import { arrow as de, autoUpdate as fe, computePosition as pe, flip as me, offset as he, shift as ge } from "@floating-ui/dom";
9
9
  //#region ../components/src/popover/popover.vue?vue&type=script&setup=true&vapor=true&lang.ts
10
- var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<div><div>"), S = /*@__PURE__*/ d({
10
+ var _e = v(" "), ve = v("<div data-popover-arrow>"), ye = v("<div>"), be = v("<div><div>"), S = /*@__PURE__*/ u({
11
11
  name: "SPopover",
12
12
  __name: "popover",
13
13
  props: {
@@ -34,9 +34,9 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
34
34
  },
35
35
  emits: ["change", "click-outside"],
36
36
  __multiRoot: !0,
37
- setup(d, { expose: v, emit: S }) {
38
- let C = d, w = S, T = t("popover"), be = ce(), E = f(!1), D = f(!1), { nextZIndex: xe } = r(), O = f(), k = b("containerNode"), A = b("wrapperNode"), j = b("contentNode"), M = f(null), Se = () => {
39
- let e = be.default?.();
37
+ setup(u, { expose: v, emit: S }) {
38
+ let C = u, w = S, T = t("popover"), xe = le(), E = f(!1), D = f(!1), { nextZIndex: Se } = r(), O = f(), k = b("containerNode"), A = b("wrapperNode"), j = b("contentNode"), M = f(null), Ce = () => {
39
+ let e = xe.default?.();
40
40
  return M.value = e, e;
41
41
  }, N = f(null), P = f({}), F = f({}), I = f({}), L = f(null), R = () => {
42
42
  N.value && Object.entries(F.value).forEach(([e, t]) => {
@@ -66,25 +66,25 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
66
66
  if (!e || N.value) return;
67
67
  let t = null;
68
68
  t = e instanceof HTMLElement ? e : B(e), t && t !== N.value && (R(), N.value = t);
69
- }, { flush: "post" }), ie(() => {
69
+ }, { flush: "post" }), ae(() => {
70
70
  if (N.value) return;
71
71
  let e = M.value;
72
72
  if (!e) return;
73
73
  let t = e instanceof HTMLElement ? e : B(e);
74
74
  t && t !== N.value && (R(), N.value = t);
75
75
  }), x(N, (e) => {
76
- e && re().then(() => {
76
+ e && d().then(() => {
77
77
  Object.entries(F.value).forEach(([t, n]) => {
78
78
  e.addEventListener(t, n);
79
79
  });
80
80
  });
81
81
  }, { flush: "post" });
82
- let Ce = () => {
82
+ let we = () => {
83
83
  if (!j.value || !N.value) return;
84
84
  j.value.style.width = "";
85
85
  let e = "";
86
86
  typeof C.width == "number" ? (e = `${C.width}px`, j.value.style.width = e) : C.width === "sameWidth" ? (e = `${N.value.getBoundingClientRect().width}px`, j.value.style.width = e) : C.width === "auto" && (e = "", j.value.style.width = e);
87
- }, we = c(() => C.offset ? C.offset : C.trigger === "contextmenu" && C.alignPoint ? [0, 0] : C.showArrow ? [0, 8] : [0, 0]), V = () => {
87
+ }, Te = c(() => C.offset ? C.offset : C.trigger === "contextmenu" && C.alignPoint ? [0, 0] : C.showArrow ? [0, 8] : [0, 0]), V = () => {
88
88
  if (C.trigger === "contextmenu" && C.alignPoint && L.value) {
89
89
  let e = L.value;
90
90
  return { getBoundingClientRect() {
@@ -106,19 +106,19 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
106
106
  H &&= (H(), null);
107
107
  }, W = async () => {
108
108
  if (!A.value || !N.value) return;
109
- let e = V(), t = j.value?.querySelector("[data-popover-arrow]"), [n, r] = we.value, i = [
110
- me({
109
+ let e = V(), t = j.value?.querySelector("[data-popover-arrow]"), [n, r] = Te.value, i = [
110
+ he({
111
111
  mainAxis: r,
112
112
  crossAxis: n
113
113
  }),
114
- pe(),
115
- he()
114
+ me(),
115
+ ge()
116
116
  ];
117
- t && i.push(ue({
117
+ t && i.push(de({
118
118
  element: t,
119
119
  padding: 8
120
120
  }));
121
- let { x: a, y: o, placement: s, middlewareData: c } = await fe(e, A.value, {
121
+ let { x: a, y: o, placement: s, middlewareData: c } = await pe(e, A.value, {
122
122
  placement: C.placement,
123
123
  strategy: "fixed",
124
124
  middleware: i
@@ -140,18 +140,18 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
140
140
  } : {
141
141
  openDelay: typeof C.delay == "number" ? C.delay : C.delay[0],
142
142
  closeDelay: typeof C.delay == "number" ? 50 : C.delay[1]
143
- }), K = null, Te = () => {
144
- C.disabled || (K &&= (clearTimeout(K), null), D.value = !0, re(() => {
143
+ }), K = null, Ee = () => {
144
+ C.disabled || (K &&= (clearTimeout(K), null), D.value = !0, d(() => {
145
145
  E.value = !0, w("change", !0);
146
146
  }));
147
- }, Ee = () => {
147
+ }, De = () => {
148
148
  E.value = !1, L.value = null, w("change", !1), K && clearTimeout(K), K = setTimeout(() => {
149
149
  C.destroyOnClose && (D.value = !1), K = null;
150
150
  }, 300);
151
- }, q = f(null), J = f(null), De = () => {
152
- q.value?.cancel(), J.value?.cancel(), q.value = e(Te, G.value.openDelay), J.value = e(Ee, G.value.closeDelay);
151
+ }, q = f(null), J = f(null), Oe = () => {
152
+ q.value?.cancel(), J.value?.cancel(), q.value = e(Ee, G.value.openDelay), J.value = e(De, G.value.closeDelay);
153
153
  };
154
- De(), x(G, De);
154
+ Oe(), x(G, Oe);
155
155
  let Y = () => {
156
156
  J.value?.cancel(), q.value?.();
157
157
  }, X = () => {
@@ -160,9 +160,9 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
160
160
  n(k, (e) => {
161
161
  N.value && e.target && typeof N.value.contains == "function" && N.value.contains(e.target) || (E.value && w("click-outside", e), !C.manual && (C.trigger === "hover" || C.trigger === "contextmenu" || C.trigger === "click") && X());
162
162
  });
163
- let Z = () => {
164
- F.value = {}, P.value = {}, I.value = {}, Q();
165
- }, Q = () => {
163
+ let ke = () => {
164
+ F.value = {}, P.value = {}, I.value = {}, Z();
165
+ }, Z = () => {
166
166
  C.manual || (C.trigger === "hover" && (F.value.mouseenter = Y, F.value.mouseleave = X, P.value.mouseenter = Y, P.value.mouseleave = X), C.trigger === "click" && (F.value.click = () => {
167
167
  let e = E.value ? J.value : q.value;
168
168
  (E.value ? q.value : J.value)?.cancel(), e?.();
@@ -177,14 +177,14 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
177
177
  }, Y();
178
178
  }));
179
179
  };
180
- le(() => {
181
- C.manual || Q();
180
+ ue(() => {
181
+ C.manual || Z();
182
182
  });
183
- let Oe = () => {
183
+ let Ae = () => {
184
184
  E.value || U();
185
185
  };
186
186
  x(E, (e) => {
187
- e && (!A.value || !N.value || (O.value = xe(), Ce(), U(), H = de(V(), A.value, W)));
187
+ e && (!A.value || !N.value || (O.value = Se(), we(), U(), H = fe(V(), A.value, W)));
188
188
  }, { flush: "post" }), x([
189
189
  () => C.placement,
190
190
  () => C.offset,
@@ -192,39 +192,45 @@ var ge = v(" "), _e = v("<div data-popover-arrow>"), ve = v("<div>"), ye = v("<d
192
192
  ], () => {
193
193
  E.value && W();
194
194
  }), x(() => C.manual, (e) => {
195
- e ? Z() : Q();
195
+ e ? ke() : Z();
196
196
  }), x(() => C.trigger, (e, t) => {
197
- e !== t && (q.value?.cancel(), E.value = !1, w("change", !1), Z());
198
- }), ae(() => {
199
- K &&= (clearTimeout(K), null), U(), R();
197
+ e !== t && (q.value?.cancel(), E.value = !1, w("change", !1), ke());
198
+ });
199
+ let Q = () => {
200
+ q.value?.cancel(), J.value?.cancel(), K &&= (clearTimeout(K), null), E.value = !1, D.value = !1, U();
201
+ };
202
+ ie(() => {
203
+ Q();
204
+ }), oe(() => {
205
+ Q(), R();
200
206
  }), v({
201
207
  show: Y,
202
208
  hide: X
203
209
  });
204
- let $ = ne();
205
- return [ee(() => Se()), l(i, {
206
- disabled: () => !d.teleportBody,
207
- to: () => d.teleport
208
- }, () => u(() => D.value, () => {
209
- let e = ye(), t = s(e);
210
+ let $ = re();
211
+ return [ee(() => Ce()), l(i, {
212
+ disabled: () => !u.teleportBody,
213
+ to: () => u.teleport
214
+ }, () => te(() => D.value, () => {
215
+ let e = be(), t = s(e);
210
216
  return p(() => {
211
217
  let n = y(T);
212
218
  h(e, P.value), m(e, [n.b()]), m(t, [n.e("wrapper")]), _(t, { zIndex: O.value });
213
219
  }), g(t, null, 0), l(a, {
214
220
  name: "popover-fade",
215
- onAfterLeave: () => Oe,
221
+ onAfterLeave: () => Ae,
216
222
  persisted: ""
217
223
  }, () => {
218
- let e = ve();
224
+ let e = ye();
219
225
  return p(() => {
220
226
  h(e, I.value), m(e, [y(T).e("content")]);
221
- }), g(e, null, 0), te("content", null, () => {
222
- let e = ge();
223
- return p(() => oe(e, se(d.content))), e;
224
- }), g(e, null, 1), u(() => d.showArrow, () => {
227
+ }), g(e, null, 0), ne("content", null, () => {
225
228
  let e = _e();
229
+ return p(() => se(e, ce(u.content))), e;
230
+ }), g(e, null, 1), te(() => u.showArrow, () => {
231
+ let e = ve();
226
232
  return p(() => {
227
- m(e, [y(T).e("arrow")]), _(e, d.arrowStyle);
233
+ m(e, [y(T).e("arrow")]), _(e, u.arrowStyle);
228
234
  }), e;
229
235
  }), o(e, () => E.value), $(e, j, null, "contentNode"), e;
230
236
  }), $(t, A, null, "wrapperNode"), $(e, k, null, "containerNode"), e;
@@ -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.3",
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.4",
4
4
  "description": "A Vue3 Components Library",
5
5
  "keywords": [
6
6
  "component library",