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 +16 -0
- package/dist/es/components/src/cascader/cascader-column.vue_vue_type_script_setup_true_vapor_true_lang.mjs +25 -23
- package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs +83 -78
- package/dist/es/components/src/input/input.vue_vue_type_script_setup_true_vapor_true_lang.mjs +3 -1
- package/dist/es/components/src/popover/popover.vue_vue_type_script_setup_true_vapor_true_lang.mjs +52 -46
- 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,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
|
|
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 =
|
|
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
|
|
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 =
|
|
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 =
|
|
108
|
-
return _(() =>
|
|
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 _(() =>
|
|
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 =
|
|
114
|
-
|
|
115
|
-
}),
|
|
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 _(() =>
|
|
118
|
-
let t = () => Y(e.value), n = () => {};
|
|
119
|
-
return s(
|
|
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(
|
|
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 =
|
|
136
|
+
let c = E(o);
|
|
135
137
|
return _(() => {
|
|
136
138
|
let t = L.value;
|
|
137
|
-
|
|
138
|
-
}),
|
|
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 _(() =>
|
|
141
|
-
}), m(n, "click", j(() => J(e.value), ["stop"])), m(n, "mouseenter", j(() => te(e.value), ["stop"])),
|
|
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) =>
|
|
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,
|
package/dist/es/components/src/cascader/cascader.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -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
|
|
10
|
-
import { computed as
|
|
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 =
|
|
13
|
-
|
|
14
|
-
var
|
|
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__*/
|
|
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__*/
|
|
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(
|
|
55
|
-
let
|
|
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 =
|
|
58
|
+
}), F = C(d, "expandedKeys"), I = C(d, "expanded"), L = o(() => ({
|
|
59
59
|
label: "label",
|
|
60
60
|
key: "key",
|
|
61
61
|
children: "children",
|
|
62
|
-
...
|
|
63
|
-
})), R =
|
|
64
|
-
if (
|
|
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(", "),
|
|
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
|
-
|
|
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
|
-
|
|
78
|
-
}, W =
|
|
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
|
-
},
|
|
80
|
+
}, se = () => {
|
|
81
81
|
let e = !G.value;
|
|
82
|
-
e &&
|
|
83
|
-
},
|
|
82
|
+
e && Y(), K(e);
|
|
83
|
+
}, ce = () => {
|
|
84
84
|
K(!1);
|
|
85
|
-
},
|
|
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 =
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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 (
|
|
110
|
+
if (p.multiple) {
|
|
109
111
|
z.value = (Array.isArray(A.value) ? A.value : []).map((e) => {
|
|
110
|
-
if (
|
|
111
|
-
let t = e.split(
|
|
112
|
-
return
|
|
112
|
+
if (p.pathMode && typeof e == "string") {
|
|
113
|
+
let t = e.split(p.pathSeparator);
|
|
114
|
+
return J(p.options, t);
|
|
113
115
|
}
|
|
114
|
-
return
|
|
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 (
|
|
120
|
-
let t = A.value.split(
|
|
121
|
-
e =
|
|
122
|
-
} else Array.isArray(A.value) || (e =
|
|
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
|
-
},
|
|
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}${
|
|
127
|
-
}) :
|
|
128
|
-
},
|
|
129
|
-
A.value =
|
|
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
|
-
|
|
132
|
-
|
|
133
|
-
}),
|
|
134
|
-
|
|
133
|
+
T(A, () => {
|
|
134
|
+
Y();
|
|
135
|
+
}), h(() => {
|
|
136
|
+
X(p.options);
|
|
135
137
|
});
|
|
136
|
-
let
|
|
137
|
-
return
|
|
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
|
-
...
|
|
142
|
-
}), { onClickOutside: () =>
|
|
143
|
+
...d.popoverProps
|
|
144
|
+
}), { onClickOutside: () => ce }] }, {
|
|
143
145
|
content: () => {
|
|
144
|
-
let e =
|
|
145
|
-
return
|
|
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
|
|
149
|
+
return y(e, null, 0), s(S(a)), e;
|
|
148
150
|
}, () => {
|
|
149
|
-
let e =
|
|
150
|
-
return
|
|
151
|
-
expandTrigger: () =>
|
|
152
|
-
fieldNames: () =>
|
|
153
|
-
options: () =>
|
|
154
|
-
checkStrictly: () =>
|
|
155
|
-
multiple: () =>
|
|
156
|
-
pathMode: () =>
|
|
157
|
-
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),
|
|
169
|
+
}, 261), m(e, "click", E(() => {}, ["stop"])), e.$evtmousedown = D(() => {}, ["prevent"]), e.$evtfocusin = l(le), e;
|
|
168
170
|
},
|
|
169
|
-
default: () =>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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 {
|
|
194
|
+
export { O as default };
|
package/dist/es/components/src/input/input.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -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)
|
|
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");
|
package/dist/es/components/src/popover/popover.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -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
|
|
8
|
-
import { arrow as
|
|
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
|
|
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(
|
|
38
|
-
let C =
|
|
39
|
-
let e =
|
|
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" }),
|
|
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 &&
|
|
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
|
|
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
|
-
},
|
|
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] =
|
|
110
|
-
|
|
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
|
-
|
|
115
|
-
|
|
114
|
+
me(),
|
|
115
|
+
ge()
|
|
116
116
|
];
|
|
117
|
-
t && i.push(
|
|
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
|
|
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,
|
|
144
|
-
C.disabled || (K &&= (clearTimeout(K), null), D.value = !0,
|
|
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
|
-
},
|
|
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),
|
|
152
|
-
q.value?.cancel(), J.value?.cancel(), q.value = e(
|
|
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
|
-
|
|
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
|
|
164
|
-
F.value = {}, P.value = {}, I.value = {},
|
|
165
|
-
},
|
|
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
|
-
|
|
181
|
-
C.manual ||
|
|
180
|
+
ue(() => {
|
|
181
|
+
C.manual || Z();
|
|
182
182
|
});
|
|
183
|
-
let
|
|
183
|
+
let Ae = () => {
|
|
184
184
|
E.value || U();
|
|
185
185
|
};
|
|
186
186
|
x(E, (e) => {
|
|
187
|
-
e && (!A.value || !N.value || (O.value =
|
|
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 ?
|
|
195
|
+
e ? ke() : Z();
|
|
196
196
|
}), x(() => C.trigger, (e, t) => {
|
|
197
|
-
e !== t && (q.value?.cancel(), E.value = !1, w("change", !1),
|
|
198
|
-
})
|
|
199
|
-
|
|
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 $ =
|
|
205
|
-
return [ee(() =>
|
|
206
|
-
disabled: () => !
|
|
207
|
-
to: () =>
|
|
208
|
-
}, () =>
|
|
209
|
-
let 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: () =>
|
|
221
|
+
onAfterLeave: () => Ae,
|
|
216
222
|
persisted: ""
|
|
217
223
|
}, () => {
|
|
218
|
-
let e =
|
|
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),
|
|
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,
|
|
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 = (
|
|
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