savor-ui 0.27.0 → 0.29.0
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 +20 -0
- package/dist/es/components/index.d.ts +1 -0
- package/dist/es/components/index.mjs +3 -2
- package/dist/es/components/src/select/select.vue.mjs +126 -124
- package/dist/es/components/src/steps/index.d.ts +2 -1
- package/dist/es/components/src/steps/steps.vue.mjs +74 -73
- package/dist/es/components/src/steps/types.d.ts +3 -1
- package/dist/es/components/src/transfer/index.d.ts +33 -0
- package/dist/es/components/src/transfer/index.mjs +7 -0
- package/dist/es/components/src/transfer/transfer.d.ts +25 -0
- package/dist/es/components/src/transfer/transfer.vue.mjs +228 -0
- package/dist/es/components/src/transfer/types.d.ts +61 -0
- package/dist/es/components/src/tree/node.d.ts +4 -0
- package/dist/es/components/src/tree/node.vue.mjs +13 -14
- package/dist/es/components/src/tree/tree.vue.mjs +14 -7
- package/dist/es/components/src/tree/types.d.ts +4 -0
- package/dist/es/core/components.mjs +17 -15
- package/dist/es/core/global.d.ts +1 -0
- package/dist/es/core/index.mjs +15 -14
- package/dist/es/hooks/src/use-element-size.mjs +38 -7
- package/dist/es/theme/components/checkbox.scss +3 -0
- package/dist/es/theme/components/index.scss +1 -0
- package/dist/es/theme/components/steps.scss +158 -36
- package/dist/es/theme/components/transfer.scss +205 -0
- package/dist/es/theme/components/tree.scss +2 -2
- package/dist/json/vetur-attributes.json +46 -0
- package/dist/json/vetur-tags.json +18 -1
- package/dist/json/web-types.json +123 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,26 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
# [0.29.0](https://gitee.com/mach552/savor-ui/compare/v0.28.0...v0.29.0) (2026-08-30)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **steps:** 新增`arrow`属性开启箭头模式 ([707c65d](https://gitee.com/mach552/savor-ui/commits/707c65db08fa6a996ef2be37ab92d90fe32a1009))
|
|
11
|
+
|
|
12
|
+
# [0.28.0](https://gitee.com/mach552/savor-ui/compare/v0.27.0...v0.28.0) (2026-08-29)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **select:** 修复标签背景和输入框背景同色问题 ([1d79224](https://gitee.com/mach552/savor-ui/commits/1d792247ec47bf0d403791212889bd478bbb68b4))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* **transfer:** 新增穿梭框组件 ([b0f1371](https://gitee.com/mach552/savor-ui/commits/b0f137168c1ccb0b89c3265cee79020d027d6786))
|
|
23
|
+
* **tree:** 新增节点默认插槽 ([565dd84](https://gitee.com/mach552/savor-ui/commits/565dd847d2e0b0ad8fb17477058f1f50ccfda85f))
|
|
24
|
+
|
|
5
25
|
# [0.27.0](https://gitee.com/mach552/savor-ui/compare/v0.26.1...v0.27.0) (2026-08-29)
|
|
6
26
|
|
|
7
27
|
|
|
@@ -63,6 +63,7 @@ export * from './src/tabs';
|
|
|
63
63
|
export * from './src/tag';
|
|
64
64
|
export * from './src/text';
|
|
65
65
|
export * from './src/textarea';
|
|
66
|
+
export * from './src/transfer';
|
|
66
67
|
export * from './src/timeline';
|
|
67
68
|
export * from './src/tooltip';
|
|
68
69
|
export * from './src/transition';
|
|
@@ -85,10 +85,11 @@ import "./src/switch/index.mjs";
|
|
|
85
85
|
import "./src/table/types.mjs";
|
|
86
86
|
import "./src/table/index.mjs";
|
|
87
87
|
import "./src/textarea/index.mjs";
|
|
88
|
-
import "./src/timeline/types.mjs";
|
|
89
|
-
import "./src/timeline/index.mjs";
|
|
90
88
|
import "./src/tree/types.mjs";
|
|
91
89
|
import "./src/tree/index.mjs";
|
|
90
|
+
import "./src/transfer/index.mjs";
|
|
91
|
+
import "./src/timeline/types.mjs";
|
|
92
|
+
import "./src/timeline/index.mjs";
|
|
92
93
|
import "./src/tree-select/index.mjs";
|
|
93
94
|
import "./src/upload/index.mjs";
|
|
94
95
|
import "./src/virtual-list/index.mjs";
|
|
@@ -13,11 +13,11 @@ import { SIcon as c } from "../icon/index.mjs";
|
|
|
13
13
|
import { SScrollbar as ee } from "../scrollbar/index.mjs";
|
|
14
14
|
import { SEmpty as te } from "../empty/index.mjs";
|
|
15
15
|
import { STag as ne } from "../tag/index.mjs";
|
|
16
|
-
import { child as re, computed as l, createComponent as u, createFor as ie, createIf as d, createInvoker as f, createSlot as ae, createTemplateRefSetter as oe, defineVaporComponent as p, delegateEvents as m, inject as se, mergeModels as h, on as g, reactive as ce, ref as _, renderEffect as v, setAttr as le, setClass as y, setInsertionState as b, setProp as ue, setText as x, setValue as de, template as S, toDisplayString as C, toRefs as fe, txt as w, unref as T, useModel as pe, useTemplateRef as E, watch as me, withModifiers as he, withVaporModifiers as
|
|
16
|
+
import { child as re, computed as l, createComponent as u, createFor as ie, createIf as d, createInvoker as f, createSlot as ae, createTemplateRefSetter as oe, defineVaporComponent as p, delegateEvents as m, inject as se, mergeModels as h, on as g, reactive as ce, ref as _, renderEffect as v, setAttr as le, setClass as y, setInsertionState as b, setProp as ue, setText as x, setValue as de, template as S, toDisplayString as C, toRefs as fe, txt as w, unref as T, useModel as pe, useTemplateRef as E, watch as me, withModifiers as he, withVaporModifiers as ge } from "vue";
|
|
17
17
|
//#region ../components/src/select/select.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
18
|
-
var
|
|
18
|
+
var _e = S(" "), ve = S("<input>"), ye = S("<span> "), be = S("<span>"), xe = S("<div><div></div>"), D = S("<div>"), Se = S("<li> "), Ce = S("<ul>"), we = S("<div>", 1);
|
|
19
19
|
m("mousedown", "input", "keydown", "click");
|
|
20
|
-
var
|
|
20
|
+
var O = /*@__PURE__*/ p({
|
|
21
21
|
name: "SSelect",
|
|
22
22
|
__name: "select",
|
|
23
23
|
props: /*@__PURE__*/ h({
|
|
@@ -59,137 +59,137 @@ var k = /*@__PURE__*/ p({
|
|
|
59
59
|
"remove"
|
|
60
60
|
], ["update:modelValue"]),
|
|
61
61
|
setup(p, { expose: m, emit: h }) {
|
|
62
|
-
let S = p,
|
|
63
|
-
size:
|
|
64
|
-
error:
|
|
65
|
-
}),
|
|
62
|
+
let S = p, O = h, k = t("select"), { size: A, error: Te } = fe(S), { mergedSize: j, mergedError: Ee } = i({
|
|
63
|
+
size: A,
|
|
64
|
+
error: Te
|
|
65
|
+
}), De = se(a, void 0), M = l(() => De?.inputFilled?.value || S.filled), N = pe(p, "modelValue"), P = l(() => ({
|
|
66
66
|
label: "label",
|
|
67
67
|
value: "value",
|
|
68
68
|
disabled: "disabled",
|
|
69
69
|
...S.fieldNames
|
|
70
|
-
})),
|
|
71
|
-
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
},
|
|
70
|
+
})), F = _(!1), Oe = () => {
|
|
71
|
+
F.value = !0;
|
|
72
|
+
}, ke = () => {
|
|
73
|
+
F.value = !1;
|
|
74
|
+
}, I = _(!1), L = ce({
|
|
75
75
|
label: "",
|
|
76
76
|
option: null
|
|
77
|
-
}),
|
|
77
|
+
}), R = E("popoverRef"), z = E("scrollbarRef"), Ae = E("listRef"), B = E("multipleInputRef"), V = _(!1), H = _(""), je = l(() => ({
|
|
78
78
|
mini: "tiny",
|
|
79
79
|
small: "tiny",
|
|
80
80
|
medium: "mini",
|
|
81
81
|
large: "small"
|
|
82
|
-
})[S.size] || "medium"),
|
|
83
|
-
e ? (S.multiple && S.filterable ? (
|
|
84
|
-
}, Me = () => {
|
|
85
|
-
S.disabled || (H.value ? G(!1) : G(!0));
|
|
82
|
+
})[S.size] || "medium"), U = l(() => S.multiple ? (Array.isArray(N.value) ? N.value : []).map((e) => S.options.find((t) => t[P.value.value] === e)).filter(Boolean) : []), Me = (e) => S.multiple ? (Array.isArray(N.value) ? N.value : []).includes(e[P.value.value]) : !1, W = (e) => {
|
|
83
|
+
e ? (S.multiple && S.filterable ? (H.value = "", J("")) : S.filterable && L.label && (L.label = ""), S.filterable && !S.multiple && J(L.label), R.value?.show(), S.multiple && S.filterable && setTimeout(() => B.value?.focus(), 0)) : (S.filterable && !S.multiple && (L.label = L.option ? L.option[P.value.label] : ""), S.multiple && S.filterable && (H.value = "", q.value = S.options), R.value?.hide(), Y.value = -1), V.value = e;
|
|
86
84
|
}, Ne = () => {
|
|
87
|
-
|
|
88
|
-
},
|
|
85
|
+
S.disabled || (V.value ? W(!1) : W(!0));
|
|
86
|
+
}, Pe = () => {
|
|
87
|
+
W(!1);
|
|
88
|
+
}, G = (e) => S.options.find((t) => t[P.value.value] === e), K = (e) => {
|
|
89
89
|
if (!e.disabled) if (S.multiple) {
|
|
90
|
-
let t = Array.isArray(
|
|
91
|
-
r > -1 ? t.splice(r, 1) : t.push(n),
|
|
92
|
-
} else
|
|
93
|
-
},
|
|
90
|
+
let t = Array.isArray(N.value) ? [...N.value] : [], n = e[P.value.value], r = t.indexOf(n);
|
|
91
|
+
r > -1 ? t.splice(r, 1) : t.push(n), N.value = t, S.filterable && (H.value = "", J(""), setTimeout(() => B.value?.focus(), 0));
|
|
92
|
+
} else N.value = e[P.value.value];
|
|
93
|
+
}, q = _(S.options);
|
|
94
94
|
me(() => S.options, (e) => {
|
|
95
|
-
|
|
95
|
+
q.value = e;
|
|
96
96
|
});
|
|
97
|
-
let
|
|
97
|
+
let Fe = l(() => S.remote ? 500 : 0), Ie = l(() => S.filterable && L.option && V.value ? L.option[P.value.label] : S.placeholder), J = async (e) => {
|
|
98
98
|
if (S.filterable) {
|
|
99
|
-
if (S.filterMethod && typeof S.filterMethod == "function")
|
|
99
|
+
if (S.filterMethod && typeof S.filterMethod == "function") q.value = S.filterMethod(e);
|
|
100
100
|
else if (S.remote && typeof S.remoteMethod == "function") {
|
|
101
|
-
|
|
101
|
+
I.value = !0;
|
|
102
102
|
try {
|
|
103
|
-
|
|
103
|
+
q.value = await S.remoteMethod(e);
|
|
104
104
|
} catch (e) {
|
|
105
|
-
console.error("远程筛选出错", e),
|
|
105
|
+
console.error("远程筛选出错", e), q.value = [];
|
|
106
106
|
} finally {
|
|
107
|
-
|
|
107
|
+
I.value = !1;
|
|
108
108
|
}
|
|
109
|
-
} else
|
|
110
|
-
|
|
109
|
+
} else q.value = S.options.filter((t) => t[P.value.label].includes(e));
|
|
110
|
+
Y.value = -1;
|
|
111
111
|
}
|
|
112
|
-
},
|
|
113
|
-
|
|
114
|
-
},
|
|
115
|
-
let n =
|
|
112
|
+
}, Le = e((e) => {
|
|
113
|
+
J(e);
|
|
114
|
+
}, Fe.value), Y = _(-1), X = (e, t) => {
|
|
115
|
+
let n = q.value;
|
|
116
116
|
if (n.length === 0) return -1;
|
|
117
117
|
let r = e, i = t === "down" ? 1 : -1, a = n.length;
|
|
118
|
-
for (let e = 0; e < a; e++) if (r = (r + i + a) % a, !n[r][
|
|
118
|
+
for (let e = 0; e < a; e++) if (r = (r + i + a) % a, !n[r][P.value.disabled]) return r;
|
|
119
119
|
return -1;
|
|
120
|
-
},
|
|
121
|
-
if (
|
|
122
|
-
let e =
|
|
120
|
+
}, Re = () => {
|
|
121
|
+
if (Y.value === -1) return;
|
|
122
|
+
let e = Ae.value;
|
|
123
123
|
if (!e) return;
|
|
124
|
-
let t = e.querySelectorAll("li")[
|
|
124
|
+
let t = e.querySelectorAll("li")[Y.value];
|
|
125
125
|
if (!t) return;
|
|
126
|
-
let n =
|
|
126
|
+
let n = z.value, r = null;
|
|
127
127
|
if (n && n.contentRef ? r = n.contentRef : e.parentElement && (r = e.parentElement), r) {
|
|
128
128
|
let e = t.offsetTop, n = e + t.offsetHeight, i = r.scrollTop, a = i + r.clientHeight;
|
|
129
129
|
e < i ? r.scrollTop = e : n > a && (r.scrollTop = n - r.clientHeight);
|
|
130
130
|
}
|
|
131
|
-
},
|
|
131
|
+
}, ze = (e) => {
|
|
132
132
|
switch (e.key) {
|
|
133
133
|
case "Enter":
|
|
134
|
-
e.preventDefault(),
|
|
134
|
+
e.preventDefault(), V.value ? Y.value > -1 && q.value[Y.value] ? K(q.value[Y.value]) : W(!1) : W(!0);
|
|
135
135
|
break;
|
|
136
136
|
case "Escape":
|
|
137
|
-
e.preventDefault(),
|
|
137
|
+
e.preventDefault(), V.value && W(!1);
|
|
138
138
|
break;
|
|
139
139
|
case "ArrowUp":
|
|
140
|
-
if (e.preventDefault(),
|
|
141
|
-
let e =
|
|
142
|
-
e !== -1 && (
|
|
140
|
+
if (e.preventDefault(), V.value && q.value.length > 0) {
|
|
141
|
+
let e = X(Y.value === -1 ? 0 : Y.value, "up");
|
|
142
|
+
e !== -1 && (Y.value = e, Re());
|
|
143
143
|
}
|
|
144
144
|
break;
|
|
145
145
|
case "ArrowDown":
|
|
146
|
-
if (e.preventDefault(),
|
|
147
|
-
let e =
|
|
148
|
-
e !== -1 && (
|
|
146
|
+
if (e.preventDefault(), V.value && q.value.length > 0) {
|
|
147
|
+
let e = X(Y.value === -1 ? -1 : Y.value, "down");
|
|
148
|
+
e !== -1 && (Y.value = e, Re());
|
|
149
149
|
}
|
|
150
150
|
break;
|
|
151
151
|
case "Backspace":
|
|
152
|
-
if (S.multiple && !
|
|
153
|
-
let e = Array.isArray(
|
|
152
|
+
if (S.multiple && !H.value) {
|
|
153
|
+
let e = Array.isArray(N.value) ? [...N.value] : [];
|
|
154
154
|
if (e.length > 0) {
|
|
155
155
|
let t = e.pop();
|
|
156
|
-
|
|
156
|
+
N.value = e, O("remove", t);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
break;
|
|
160
160
|
default: break;
|
|
161
161
|
}
|
|
162
|
-
},
|
|
163
|
-
S.multiple ?
|
|
162
|
+
}, Z = () => {
|
|
163
|
+
S.multiple ? N.value = [] : N.value = "", O("clear");
|
|
164
164
|
}, Be = (e, t) => {
|
|
165
165
|
t.stopPropagation();
|
|
166
|
-
let n = Array.isArray(
|
|
167
|
-
i > -1 && (n.splice(i, 1),
|
|
166
|
+
let n = Array.isArray(N.value) ? [...N.value] : [], r = e[P.value.value], i = n.indexOf(r);
|
|
167
|
+
i > -1 && (n.splice(i, 1), N.value = n, O("remove", r));
|
|
168
168
|
}, Ve = (e) => {
|
|
169
169
|
let t = e.target;
|
|
170
|
-
|
|
170
|
+
H.value = t.value, J(t.value);
|
|
171
171
|
};
|
|
172
|
-
me(
|
|
172
|
+
me(N, (e) => {
|
|
173
173
|
if (S.multiple) {
|
|
174
174
|
let t = Array.isArray(e) ? e : [];
|
|
175
|
-
t.map((e) =>
|
|
175
|
+
t.map((e) => G(e)).filter(Boolean), O("change", t);
|
|
176
176
|
} else if (e && !Array.isArray(e)) {
|
|
177
|
-
let t =
|
|
178
|
-
t ? (
|
|
179
|
-
} else
|
|
177
|
+
let t = G(e);
|
|
178
|
+
t ? (L.label = t[P.value.label], L.option = t, O("change", t[P.value.value]), W(!1)) : (L.label = "", L.option = null, O("change", ""));
|
|
179
|
+
} else L.label = "", L.option = null, O("change", "");
|
|
180
180
|
}, { immediate: !0 }), m({
|
|
181
|
-
open: () =>
|
|
182
|
-
close: () =>
|
|
181
|
+
open: () => W(!0),
|
|
182
|
+
close: () => W(!1)
|
|
183
183
|
});
|
|
184
|
-
let Q = oe(), $ =
|
|
184
|
+
let Q = oe(), $ = we();
|
|
185
185
|
return v(() => {
|
|
186
|
-
let e = T(
|
|
186
|
+
let e = T(k);
|
|
187
187
|
y($, [
|
|
188
188
|
e.b(),
|
|
189
|
-
e.is("readonly", !p.filterable || !
|
|
189
|
+
e.is("readonly", !p.filterable || !V.value),
|
|
190
190
|
e.is("multiple", p.multiple),
|
|
191
191
|
e.is("disabled", p.disabled),
|
|
192
|
-
e.m(T(
|
|
192
|
+
e.m(T(j))
|
|
193
193
|
]);
|
|
194
194
|
}), b($, null, 0), Q(u(T(o), { $: [() => ({
|
|
195
195
|
offset: [0, 4],
|
|
@@ -197,92 +197,94 @@ var k = /*@__PURE__*/ p({
|
|
|
197
197
|
width: "sameWidth",
|
|
198
198
|
manual: !0,
|
|
199
199
|
...p.popoverProps
|
|
200
|
-
}), { onClickOutside: () =>
|
|
200
|
+
}), { onClickOutside: () => Pe }] }, {
|
|
201
201
|
content: () => {
|
|
202
|
-
let e =
|
|
203
|
-
return v(() => y(e, [T(
|
|
204
|
-
let e =
|
|
205
|
-
return v(() => y(e, [T(
|
|
206
|
-
}, () => d(() =>
|
|
207
|
-
let e =
|
|
208
|
-
return v(() => y(e, [T(
|
|
202
|
+
let e = D();
|
|
203
|
+
return v(() => y(e, [T(k).e("wrapper")])), b(e, null, 0), d(() => I.value, () => {
|
|
204
|
+
let e = D();
|
|
205
|
+
return v(() => y(e, [T(k).e("loading")])), b(e, null, 0), u(T(c), { loading: "" }), e;
|
|
206
|
+
}, () => d(() => q.value.length === 0, () => {
|
|
207
|
+
let e = D();
|
|
208
|
+
return v(() => y(e, [T(k).e("empty")])), b(e, null, 0), ae("empty", null, () => u(T(te))), e;
|
|
209
209
|
}, () => {
|
|
210
210
|
let e = u(T(ee), { maxHeight: () => p.maxHeight }, () => {
|
|
211
|
-
let e =
|
|
211
|
+
let e = Ce();
|
|
212
212
|
return v(() => {
|
|
213
|
-
let t = T(
|
|
214
|
-
y(e, [t.e("list"), t.m("list-" + T(
|
|
215
|
-
}), b(e, null, 0), ie(() =>
|
|
216
|
-
let n =
|
|
217
|
-
return g(n, "click", he(() =>
|
|
218
|
-
let i = T(
|
|
213
|
+
let t = T(k);
|
|
214
|
+
y(e, [t.e("list"), t.m("list-" + T(A))]);
|
|
215
|
+
}), b(e, null, 0), ie(() => q.value, (e, t) => {
|
|
216
|
+
let n = Se(), r = w(n);
|
|
217
|
+
return g(n, "click", he(() => K(e.value), ["stop"])), v(() => {
|
|
218
|
+
let i = T(k), a = e.value, o = P.value, s = a[o.label], c = o.label;
|
|
219
219
|
y(n, [
|
|
220
220
|
i.e("item"),
|
|
221
221
|
i.is("disabled", a[o.disabled]),
|
|
222
|
-
i.is("active", p.multiple ?
|
|
223
|
-
i.is("highlight", s ===
|
|
222
|
+
i.is("active", p.multiple ? Me(a) : s === L.label),
|
|
223
|
+
i.is("highlight", s === q.value[Y.value]?.[c])
|
|
224
224
|
]), le(n, "data-index", t.value), x(r, C(s));
|
|
225
225
|
}), n;
|
|
226
|
-
}, (e, t) => e[
|
|
226
|
+
}, (e, t) => e[P.value.value], 9), Q(e, Ae, null, "listRef"), e;
|
|
227
227
|
});
|
|
228
|
-
return Q(e,
|
|
229
|
-
}, 1541), 1285), e.$evtmousedown =
|
|
228
|
+
return Q(e, z, null, "scrollbarRef"), e;
|
|
229
|
+
}, 1541), 1285), e.$evtmousedown = ge(() => {}, ["prevent"]), e;
|
|
230
230
|
},
|
|
231
231
|
default: () => d(() => p.multiple, () => {
|
|
232
|
-
let e =
|
|
232
|
+
let e = xe(), t = re(e);
|
|
233
233
|
return v(() => {
|
|
234
|
-
let n = T(
|
|
235
|
-
y(e, [n.e("tags-wrapper"), n.is("filled",
|
|
236
|
-
}), b(t, null, 0), ie(() =>
|
|
234
|
+
let n = T(k);
|
|
235
|
+
y(e, [n.e("tags-wrapper"), n.is("filled", M.value)]), y(t, [n.e("tags")]);
|
|
236
|
+
}), b(t, null, 0), ie(() => U.value, (e) => {
|
|
237
237
|
let t = (t) => Be(e.value, t);
|
|
238
238
|
return u(T(ne), {
|
|
239
|
-
size: () =>
|
|
239
|
+
size: () => je.value,
|
|
240
240
|
closable: "",
|
|
241
|
+
color: () => M.value ? "var(--s-color-bg-2)" : "",
|
|
242
|
+
style: () => ({ color: M.value ? "var(--s-color-text-1)" : "" }),
|
|
241
243
|
onClose: () => t
|
|
242
244
|
}, () => {
|
|
243
|
-
let t =
|
|
245
|
+
let t = _e();
|
|
244
246
|
return v(() => {
|
|
245
|
-
let n =
|
|
247
|
+
let n = P.value;
|
|
246
248
|
x(t, C(e.value[n.label]));
|
|
247
249
|
}), t;
|
|
248
250
|
});
|
|
249
|
-
}, (e) => e[
|
|
250
|
-
let e =
|
|
251
|
-
return e.$evtinput = f(Ve), e.$evtkeydown = f(
|
|
252
|
-
y(e, [T(
|
|
251
|
+
}, (e) => e[P.value.value], 2), b(t, null, 1), d(() => p.filterable, () => {
|
|
252
|
+
let e = ve();
|
|
253
|
+
return e.$evtinput = f(Ve), e.$evtkeydown = f(ze), Q(e, B, null, "multipleInputRef"), v(() => {
|
|
254
|
+
y(e, [T(k).e("inner")]), ue(e, "placeholder", U.value.length === 0 ? p.placeholder : ""), de(e, H.value);
|
|
253
255
|
}), e;
|
|
254
|
-
}, () => d(() =>
|
|
255
|
-
let e =
|
|
256
|
+
}, () => d(() => U.value.length === 0, () => {
|
|
257
|
+
let e = ye(), t = w(e);
|
|
256
258
|
return v(() => {
|
|
257
|
-
y(e, [T(
|
|
259
|
+
y(e, [T(k).e("placeholder")]), x(t, C(p.placeholder));
|
|
258
260
|
}), e;
|
|
259
|
-
}), 261), b(e, null, 1), d(() =>
|
|
260
|
-
let e =
|
|
261
|
-
return v(() => y(e, T(
|
|
261
|
+
}), 261), b(e, null, 1), d(() => F.value && Array.isArray(N.value) && N.value.length > 0 && p.clearable, () => {
|
|
262
|
+
let e = be();
|
|
263
|
+
return v(() => y(e, T(k).e("close"))), b(e, null, 0), u(T(r)), g(e, "click", he(Z, ["stop"])), e.$evtmousedown = ge(() => {}, ["prevent"]), e;
|
|
262
264
|
}), b(e, null, 2), u(T(c), {
|
|
263
|
-
class: () => [T(
|
|
264
|
-
style: () => ({ transform:
|
|
265
|
-
}, () => u(T(n))), g(e, "mouseenter",
|
|
265
|
+
class: () => [T(k).e("suffix-icon")],
|
|
266
|
+
style: () => ({ transform: V.value ? "rotate(180deg)" : "" })
|
|
267
|
+
}, () => u(T(n))), g(e, "mouseenter", Oe), g(e, "mouseleave", ke), e;
|
|
266
268
|
}, () => u(T(s), {
|
|
267
|
-
modelValue: () =>
|
|
268
|
-
"onUpdate:modelValue": () => (e) =>
|
|
269
|
+
modelValue: () => L.label,
|
|
270
|
+
"onUpdate:modelValue": () => (e) => L.label = e,
|
|
269
271
|
disabled: () => p.disabled,
|
|
270
|
-
placeholder: () =>
|
|
271
|
-
readonly: () => !p.filterable || !
|
|
272
|
+
placeholder: () => Ie.value,
|
|
273
|
+
readonly: () => !p.filterable || !V.value,
|
|
272
274
|
clearable: () => p.clearable,
|
|
273
275
|
style: "width: 100%",
|
|
274
|
-
error: () => T(
|
|
275
|
-
size: () => T(
|
|
276
|
-
filled: () =>
|
|
277
|
-
onInput: () => T(
|
|
278
|
-
onKeydown: () =>
|
|
279
|
-
onClear: () =>
|
|
276
|
+
error: () => T(Ee),
|
|
277
|
+
size: () => T(j),
|
|
278
|
+
filled: () => M.value,
|
|
279
|
+
onInput: () => T(Le),
|
|
280
|
+
onKeydown: () => ze,
|
|
281
|
+
onClear: () => Z
|
|
280
282
|
}, { suffix: () => u(T(c), {
|
|
281
|
-
class: () => [T(
|
|
282
|
-
style: () => ({ transform:
|
|
283
|
+
class: () => [T(k).e("suffix-icon")],
|
|
284
|
+
style: () => ({ transform: V.value ? "rotate(180deg)" : "" })
|
|
283
285
|
}, () => u(T(n))) }), 1157)
|
|
284
|
-
}),
|
|
286
|
+
}), R, null, "popoverRef"), $.$evtclick = f(Ne), $;
|
|
285
287
|
}
|
|
286
288
|
});
|
|
287
289
|
//#endregion
|
|
288
|
-
export {
|
|
290
|
+
export { O as default };
|
|
@@ -9,12 +9,13 @@ export declare const SSteps: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
|
|
|
9
9
|
items: StepsItemProps[];
|
|
10
10
|
current?: number | undefined;
|
|
11
11
|
vertical?: boolean | undefined;
|
|
12
|
-
size?: "small" | "medium" | undefined;
|
|
12
|
+
size?: "mini" | "small" | "medium" | "large" | "larger" | undefined;
|
|
13
13
|
alignCenter?: boolean | undefined;
|
|
14
14
|
status?: "wait" | "loading" | "done" | "error" | "process" | undefined;
|
|
15
15
|
changeable?: boolean | undefined;
|
|
16
16
|
dot?: boolean | undefined;
|
|
17
17
|
simple?: boolean | undefined;
|
|
18
|
+
arrow?: boolean | undefined;
|
|
18
19
|
onChange?: ((index: number) => any) | undefined;
|
|
19
20
|
"onUpdate:current"?: ((value: number) => any) | undefined;
|
|
20
21
|
} & (typeof globalThis extends {
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useElementSize as e } from "../../../hooks/src/use-element-size.mjs";
|
|
2
|
+
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
2
3
|
import "../../../hooks/index.mjs";
|
|
3
|
-
import { RightLine as
|
|
4
|
-
import { CheckLine as
|
|
5
|
-
import { SIcon as
|
|
6
|
-
import { child as
|
|
4
|
+
import { RightLine as n } from "../../../icons/src/svg/arrow/index.mjs";
|
|
5
|
+
import { CheckLine as r } from "../../../icons/src/svg/system/index.mjs";
|
|
6
|
+
import { SIcon as i } from "../icon/index.mjs";
|
|
7
|
+
import { child as a, createComponent as o, createFor as s, createIf as c, createInvoker as l, defineVaporComponent as u, delegateEvents as d, mergeModels as f, renderEffect as p, setClass as m, setInsertionState as h, setStaticTemplateRef as g, setStyle as _, setText as v, template as y, toDisplayString as b, txt as x, unref as S, useModel as C, useTemplateRef as w, watch as T } from "vue";
|
|
7
8
|
//#region ../components/src/steps/steps.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var
|
|
9
|
+
var E = y("<div>"), D = y("<span> "), O = y("<div> "), k = y("<div><div><div> </div></div>"), A = y("<div>", 1);
|
|
10
|
+
d("click");
|
|
11
|
+
var j = /*@__PURE__*/ u({
|
|
11
12
|
name: "SSteps",
|
|
12
13
|
__name: "steps",
|
|
13
|
-
props: /*@__PURE__*/
|
|
14
|
+
props: /*@__PURE__*/ f({
|
|
14
15
|
items: { default: () => [] },
|
|
15
16
|
current: {},
|
|
16
|
-
vertical: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: !1
|
|
19
|
-
},
|
|
17
|
+
vertical: { type: Boolean },
|
|
20
18
|
size: { default: "medium" },
|
|
21
19
|
alignCenter: { type: Boolean },
|
|
22
20
|
status: { default: "process" },
|
|
23
|
-
changeable: {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
dot: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
default: !1
|
|
30
|
-
},
|
|
31
|
-
simple: { type: Boolean }
|
|
21
|
+
changeable: { type: Boolean },
|
|
22
|
+
dot: { type: Boolean },
|
|
23
|
+
simple: { type: Boolean },
|
|
24
|
+
arrow: { type: Boolean }
|
|
32
25
|
}, {
|
|
33
26
|
current: { default: 0 },
|
|
34
27
|
currentModifiers: {}
|
|
35
28
|
}),
|
|
36
|
-
emits: /*@__PURE__*/
|
|
37
|
-
setup(
|
|
38
|
-
let
|
|
29
|
+
emits: /*@__PURE__*/ f(["change"], ["update:current"]),
|
|
30
|
+
setup(u, { emit: d }) {
|
|
31
|
+
let f = u, y = d, j = t("steps"), M = C(u, "current"), N = w("stepsRef"), { height: P } = e(N);
|
|
32
|
+
T(P, (e) => {
|
|
33
|
+
N.value?.style.setProperty("--s-steps-height", e + "px");
|
|
34
|
+
}, { immediate: !0 });
|
|
35
|
+
let F = (e) => e > M.value ? "wait" : e < M.value ? "done" : e === M.value ? f.status : "", I = (e) => {
|
|
39
36
|
let t = { backgroundColor: "" }, n = e + 1;
|
|
40
|
-
if (n >=
|
|
41
|
-
switch (
|
|
37
|
+
if (n >= f.items.length) return t.backgroundColor = "var(--s-color-fill-3)", t;
|
|
38
|
+
switch (F(n)) {
|
|
42
39
|
case "done":
|
|
43
40
|
t.backgroundColor = "var(--s-color-success-6)";
|
|
44
41
|
break;
|
|
@@ -51,62 +48,66 @@ var k = /*@__PURE__*/ l({
|
|
|
51
48
|
default: t.backgroundColor = "var(--s-color-fill-3)";
|
|
52
49
|
}
|
|
53
50
|
return t;
|
|
54
|
-
},
|
|
55
|
-
|
|
51
|
+
}, L = (e) => f.arrow ? "0%" : e < f.items.length - 1 && !f.alignCenter ? 100 / (f.items.length - 1) + "%" : 100 / f.items.length + "%", R = (e) => {
|
|
52
|
+
f.changeable && (f.items[e]?.disabled || (M.value = e));
|
|
56
53
|
};
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
T(M, (e) => {
|
|
55
|
+
y("change", e);
|
|
59
56
|
});
|
|
60
|
-
let
|
|
57
|
+
let z = A();
|
|
61
58
|
return p(() => {
|
|
62
|
-
let e =
|
|
63
|
-
m(
|
|
59
|
+
let e = S(j);
|
|
60
|
+
m(z, [
|
|
64
61
|
e.b(),
|
|
65
|
-
e.m(
|
|
66
|
-
e.is("vertical",
|
|
67
|
-
e.is("dot",
|
|
68
|
-
e.is("simple",
|
|
62
|
+
e.m(u.size),
|
|
63
|
+
e.is("vertical", u.vertical),
|
|
64
|
+
e.is("dot", u.dot),
|
|
65
|
+
e.is("simple", u.simple),
|
|
66
|
+
e.is("arrow", u.arrow)
|
|
69
67
|
]);
|
|
70
|
-
}), h(
|
|
71
|
-
let
|
|
68
|
+
}), h(z, null, 0), s(() => u.items, (e, t) => {
|
|
69
|
+
let s = k(), d = a(s, 1), f = a(d);
|
|
72
70
|
p(() => {
|
|
73
|
-
let e =
|
|
74
|
-
m(
|
|
71
|
+
let e = S(j), n = t.value;
|
|
72
|
+
m(s, [
|
|
75
73
|
e.e("step"),
|
|
76
|
-
e.m(
|
|
77
|
-
e.is("center",
|
|
78
|
-
e.is("changeable",
|
|
79
|
-
]),
|
|
80
|
-
}), h(
|
|
81
|
-
let e =
|
|
82
|
-
return p(() => {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
let e =
|
|
92
|
-
return p(() =>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
74
|
+
e.m(F(n)),
|
|
75
|
+
e.is("center", u.alignCenter),
|
|
76
|
+
e.is("changeable", u.changeable)
|
|
77
|
+
]), _(s, { flexBasis: L(n) });
|
|
78
|
+
}), h(s, 0, 0), c(() => !u.arrow, () => {
|
|
79
|
+
let e = E();
|
|
80
|
+
return p(() => m(e, [S(j).e("head")])), h(e, null, 0), c(() => t.value < u.items.length - 1 && !u.simple, () => {
|
|
81
|
+
let e = E();
|
|
82
|
+
return p(() => {
|
|
83
|
+
m(e, [S(j).e("line")]), _(e, I(t.value));
|
|
84
|
+
}), e;
|
|
85
|
+
}), h(e, null, 1), c(() => u.dot, () => {
|
|
86
|
+
let e = E();
|
|
87
|
+
return p(() => m(e, [S(j).e("dot")])), e;
|
|
88
|
+
}, () => {
|
|
89
|
+
let e = E();
|
|
90
|
+
return p(() => m(e, [S(j).e("icon")])), h(e, null, 0), c(() => F(t.value) === "loading", () => o(S(i), { loading: "" })), h(e, null, 1), c(() => F(t.value) === "done", () => o(S(r)), () => {
|
|
91
|
+
let e = D(), n = x(e);
|
|
92
|
+
return p(() => v(n, b(t.value + 1))), e;
|
|
93
|
+
}, 1029), e;
|
|
94
|
+
}, 517), e;
|
|
95
|
+
});
|
|
96
|
+
let g = x(f);
|
|
96
97
|
return p(() => {
|
|
97
|
-
let t =
|
|
98
|
-
m(
|
|
99
|
-
}), h(
|
|
100
|
-
let t =
|
|
98
|
+
let t = S(j);
|
|
99
|
+
m(d, [t.e("content")]), m(f, [t.e("title")]), v(g, b(e.value.title));
|
|
100
|
+
}), h(d, null, 1), c(() => !u.simple && !u.arrow || u.arrow && e.value.description, () => {
|
|
101
|
+
let t = O(), n = x(t);
|
|
101
102
|
return p(() => {
|
|
102
|
-
m(t, [
|
|
103
|
+
m(t, [S(j).e("description")]), v(n, b(e.value.description));
|
|
103
104
|
}), t;
|
|
104
|
-
}), h(
|
|
105
|
-
let e =
|
|
106
|
-
return p(() => m(e, [
|
|
107
|
-
}),
|
|
108
|
-
}, (e, t) => t, 9),
|
|
105
|
+
}), h(s, null, 2), c(() => t.value < u.items.length - 1 && u.simple, () => {
|
|
106
|
+
let e = E();
|
|
107
|
+
return p(() => m(e, [S(j).e("arrow")])), h(e, null, 0), o(S(n)), e;
|
|
108
|
+
}), s.$evtclick = l(() => R(t.value)), s;
|
|
109
|
+
}, (e, t) => t, 9), g(z, N, null, "stepsRef"), z;
|
|
109
110
|
}
|
|
110
111
|
});
|
|
111
112
|
//#endregion
|
|
112
|
-
export {
|
|
113
|
+
export { j as default };
|