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 +8 -0
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +63 -63
- package/dist/es/components/src/upload/request.mjs +3 -3
- package/dist/es/components/src/upload/upload.vue_vue_type_script_setup_true_vapor_true_lang.mjs +84 -69
- package/dist/es/theme/components/button.scss +1 -1
- package/dist/es/theme/components/textarea.scss +1 -0
- package/dist/es/theme/components/upload.scss +35 -0
- package/dist/json/web-types.json +1 -1
- package/package.json +1 -1
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
|
|
package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -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
|
|
13
|
-
m("click");
|
|
14
|
-
var
|
|
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"),
|
|
56
|
-
size:
|
|
57
|
-
error:
|
|
58
|
-
}),
|
|
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
|
-
})),
|
|
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[
|
|
66
|
-
n ? i !== -1 && (
|
|
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
|
-
|
|
72
|
+
J(!1), B.value = U(t), M.value = H(t), j("selectItem", {
|
|
73
73
|
item: e,
|
|
74
74
|
expandeds: t
|
|
75
75
|
});
|
|
76
|
-
},
|
|
77
|
-
|
|
78
|
-
},
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
let e = !
|
|
82
|
-
e && Z(),
|
|
83
|
-
},
|
|
84
|
-
|
|
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[
|
|
89
|
-
if (r[
|
|
90
|
-
let n = Y(r[
|
|
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[
|
|
98
|
+
let t = r.find((t) => t[z.value.key] === e);
|
|
99
99
|
if (!t) return null;
|
|
100
|
-
n.push(t), r = t[
|
|
100
|
+
n.push(t), r = t[z.value.children] || [];
|
|
101
101
|
}
|
|
102
102
|
return n;
|
|
103
103
|
}, Z = () => {
|
|
104
|
-
if (
|
|
105
|
-
|
|
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
|
-
|
|
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),
|
|
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
|
|
120
|
-
let t =
|
|
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(
|
|
123
|
-
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
|
-
|
|
126
|
-
|
|
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
|
-
},
|
|
129
|
-
|
|
128
|
+
}, ae = () => {
|
|
129
|
+
M.value = h.multiple ? [] : "", L.value = [], R.value = [], V.value = [], B.value = "", j("clear");
|
|
130
130
|
};
|
|
131
|
-
te(
|
|
131
|
+
te(M, () => {
|
|
132
132
|
Z();
|
|
133
133
|
}), _(() => {
|
|
134
134
|
Q(h.options);
|
|
135
135
|
});
|
|
136
|
-
let
|
|
137
|
-
return y(() => b($, [w(S).b()])), x($, null, 0),
|
|
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: () =>
|
|
142
|
+
}), { onClickOutside: () => ie }] }, {
|
|
143
143
|
content: () => {
|
|
144
|
-
let e =
|
|
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 =
|
|
146
|
+
let e = O();
|
|
147
147
|
return x(e, null, 0), c(w(a)), e;
|
|
148
148
|
}, () => {
|
|
149
|
-
let e =
|
|
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: () =>
|
|
159
|
-
onExpand: () =>
|
|
160
|
-
modelValue: () =>
|
|
161
|
-
"onUpdate:modelValue": () => (e) =>
|
|
162
|
-
expanded: () =>
|
|
163
|
-
"onUpdate:expanded": () => (e) =>
|
|
164
|
-
expandedKeys: () =>
|
|
165
|
-
"onUpdate:expandedKeys": () => (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(
|
|
173
|
-
size: () => w(
|
|
172
|
+
error: () => w(I),
|
|
173
|
+
size: () => w(F),
|
|
174
174
|
filled: () => p.filled,
|
|
175
|
-
modelValue: () =>
|
|
176
|
-
"onUpdate:modelValue": () => (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: () =>
|
|
181
|
-
}, { suffix: () => l(
|
|
180
|
+
onClear: () => ae
|
|
181
|
+
}, { suffix: () => l(se, {
|
|
182
182
|
class: () => [w(S).e("suffix-icon")],
|
|
183
|
-
style: () => ({ transform:
|
|
183
|
+
style: () => ({ transform: q.value ? "rotate(180deg)" : "" })
|
|
184
184
|
}, () => c(w(t))) })
|
|
185
|
-
}),
|
|
185
|
+
}), K, null, "popoverRef"), $.$evtclick = d(re), $;
|
|
186
186
|
}
|
|
187
187
|
});
|
|
188
188
|
//#endregion
|
|
189
|
-
export {
|
|
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 = (
|
|
12
|
-
e.onError?.(
|
|
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
|
package/dist/es/components/src/upload/upload.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -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
|
|
15
|
-
import { SProgress as
|
|
16
|
-
import { httpRequest as
|
|
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
|
|
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
|
|
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
|
|
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),
|
|
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
|
-
|
|
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 (
|
|
84
|
-
let t =
|
|
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:
|
|
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),
|
|
111
|
-
},
|
|
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
|
-
},
|
|
115
|
-
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
|
133
|
-
...
|
|
132
|
+
n !== -1 && (F.value = F.value.map((e, r) => r === n ? {
|
|
133
|
+
...e,
|
|
134
134
|
...t
|
|
135
|
-
}
|
|
136
|
-
},
|
|
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
|
|
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 =
|
|
152
|
+
let t = ee({
|
|
153
153
|
method: "POST",
|
|
154
154
|
file: e.raw,
|
|
155
|
-
name:
|
|
156
|
-
action:
|
|
157
|
-
headers:
|
|
158
|
-
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
|
-
|
|
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
|
|
182
|
-
return re($, "change",
|
|
183
|
-
let e =
|
|
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",
|
|
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, [
|
|
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 =
|
|
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 =
|
|
197
|
+
let t = ue();
|
|
198
198
|
return w(() => {
|
|
199
199
|
let n = e.value;
|
|
200
|
-
D(t, "src", n.url), T(t, [
|
|
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, [
|
|
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(() =>
|
|
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, [
|
|
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, [
|
|
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, [
|
|
219
|
-
}), E(t, null, 2), g(() => !
|
|
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, [
|
|
222
|
-
}), E(t, null, 3), g(() => !
|
|
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, [
|
|
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
|
-
},
|
|
227
|
-
}, (e) => e.uid, 8), E(e, null, 1), g(() =>
|
|
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, [
|
|
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 =
|
|
233
|
-
return w(() => T(e, [
|
|
234
|
-
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: () =>
|
|
241
|
+
onChange: () => _e
|
|
237
242
|
}, () => v("drag", null, null, 4)), () => {
|
|
238
243
|
let e = j();
|
|
239
|
-
return w(() => T(e, [
|
|
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: () =>
|
|
247
|
+
disabled: () => k.disabled
|
|
243
248
|
})), e.$evtclick = _(G), e;
|
|
244
|
-
},
|
|
249
|
+
}, 2565), [e, g(() => y.showList && z.value.length > 0, () => {
|
|
245
250
|
let e = j();
|
|
246
|
-
return w(() => T(e, [
|
|
247
|
-
let t =
|
|
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
|
|
250
|
-
T(
|
|
251
|
-
}), E(
|
|
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(
|
|
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, [
|
|
257
|
-
}), E(
|
|
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, [
|
|
260
|
-
}), E(
|
|
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, [
|
|
263
|
-
}), E(
|
|
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, [
|
|
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
|
-
},
|
|
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
|
|
@@ -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%;
|
package/dist/json/web-types.json
CHANGED