savor-ui 0.2.0 → 0.3.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 +5 -3
- package/dist/es/components/src/anchor/anchor.vue_vue_type_script_setup_true_vapor_true_lang.mjs +46 -35
- package/dist/es/components/src/avatar/types.d.ts +1 -1
- package/dist/es/components/src/button/button.vue_vue_type_script_setup_true_vapor_true_lang.mjs +29 -32
- package/dist/es/components/src/color-picker/color-picker.vue_vue_type_script_setup_true_vapor_true_lang.mjs +91 -94
- package/dist/es/components/src/config-provider/config-provider.d.ts +9 -17
- package/dist/es/components/src/config-provider/config-provider.vue.mjs +1 -1
- package/dist/es/components/src/config-provider/config-provider.vue_vue_type_script_setup_true_lang.mjs +24 -0
- package/dist/es/components/src/config-provider/index.d.ts +17 -20
- package/dist/es/components/src/config-provider-vapor/config-provider-vapor.d.ts +20 -0
- package/dist/es/components/src/config-provider-vapor/config-provider-vapor.vue.mjs +5 -0
- package/dist/es/components/src/{config-provider/config-provider.vue_vue_type_script_setup_true_vapor_true_lang.mjs → config-provider-vapor/config-provider-vapor.vue_vue_type_script_setup_true_vapor_true_lang.mjs} +4 -4
- package/dist/es/components/src/config-provider-vapor/index.d.ts +21 -0
- package/dist/es/components/src/config-provider-vapor/index.mjs +8 -0
- package/dist/es/components/src/config-provider-vapor/types.d.ts +17 -0
- package/dist/es/components/src/config-provider-vapor/types.mjs +4 -0
- package/dist/es/components/src/drawer/drawer.vue_vue_type_script_setup_true_vapor_true_lang.mjs +4 -4
- package/dist/es/components/src/dropdown/doption.vue_vue_type_script_setup_true_vapor_true_lang.mjs +20 -23
- package/dist/es/components/src/dropdown/dsubmenu.vue_vue_type_script_setup_true_vapor_true_lang.mjs +27 -30
- package/dist/es/components/src/layout/index.d.ts +1 -0
- package/dist/es/components/src/layout/layout.vue_vue_type_script_setup_true_vapor_true_lang.mjs +11 -5
- package/dist/es/components/src/layout/types.d.ts +2 -0
- package/dist/es/components/src/message/types.d.ts +2 -2
- package/dist/es/components/src/scrollbar/index.d.ts +3 -0
- package/dist/es/components/src/scrollbar/scrollbar.vue_vue_type_script_setup_true_vapor_true_lang.mjs +35 -29
- package/dist/es/components/src/scrollbar/types.d.ts +7 -0
- package/dist/es/components/src/select/index.d.ts +6 -5
- package/dist/es/components/src/select/select.d.ts +5 -5
- package/dist/es/components/src/select/select.vue_vue_type_script_setup_true_vapor_true_lang.mjs +189 -125
- package/dist/es/components/src/select/types.d.ts +6 -4
- package/dist/es/components/src/space/index.d.ts +1 -0
- package/dist/es/components/src/space/space.vue_vue_type_script_setup_true_vapor_true_lang.mjs +3 -1
- package/dist/es/components/src/space/types.d.ts +2 -0
- package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs +10 -12
- package/dist/es/components/src/table/types.d.ts +2 -2
- package/dist/es/core/components.mjs +66 -64
- package/dist/es/core/global.d.ts +1 -0
- package/dist/es/core/index.mjs +61 -59
- package/dist/es/hooks/index.d.ts +0 -1
- package/dist/es/hooks/index.mjs +0 -1
- package/dist/es/theme/components/button.scss +22 -3
- package/dist/es/theme/components/cascader.scss +3 -0
- package/dist/es/theme/components/collapse.scss +16 -17
- package/dist/es/theme/components/color-picker.scss +4 -1
- package/dist/es/theme/components/dropdown.scss +34 -24
- package/dist/es/theme/components/layout.scss +0 -1
- package/dist/es/theme/components/pagination.scss +5 -0
- package/dist/es/theme/components/segmented.scss +1 -1
- package/dist/es/theme/components/select.scss +92 -1
- package/dist/es/theme/components/space.scss +4 -0
- package/dist/es/theme/components/tabs.scss +3 -3
- package/dist/es/theme/components/wheel.scss +12 -9
- package/dist/es/theme/mixins/function.scss +9 -4
- package/dist/es/utils/src/theme/themeMap.mjs +4 -4
- package/dist/json/vetur-attributes.json +28 -2
- package/dist/json/vetur-tags.json +15 -4
- package/dist/json/web-types.json +75 -3
- package/package.json +1 -1
- package/dist/es/hooks/src/use-ripple.d.ts +0 -15
- package/dist/es/hooks/src/use-ripple.mjs +0 -86
package/dist/es/components/src/select/select.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
import { debounce as e } from "../../../utils/src/tool.mjs";
|
|
2
2
|
import "../../../utils/index.mjs";
|
|
3
3
|
import { useNamespace as t } from "../../../hooks/src/use-namespace.mjs";
|
|
4
|
-
import { useRipple as n } from "../../../hooks/src/use-ripple.mjs";
|
|
5
4
|
import "../../../hooks/index.mjs";
|
|
6
|
-
import { useFormItem as
|
|
5
|
+
import { useFormItem as n } from "../form/use-form-item.mjs";
|
|
6
|
+
import r from "../../../icons/src/close.vue.mjs";
|
|
7
7
|
import i from "../../../icons/src/down.vue.mjs";
|
|
8
8
|
import a from "../../../icons/src/loading.vue.mjs";
|
|
9
9
|
import "../../../icons/index.mjs";
|
|
10
10
|
import { SPopover as o } from "../popover/index.mjs";
|
|
11
11
|
import { SInput as s } from "../input/index.mjs";
|
|
12
12
|
import { SScrollbar as c } from "../scrollbar/index.mjs";
|
|
13
|
-
import { SEmpty as
|
|
14
|
-
import { SIcon as
|
|
15
|
-
import {
|
|
13
|
+
import { SEmpty as ee } from "../empty/index.mjs";
|
|
14
|
+
import { SIcon as l } from "../icon/index.mjs";
|
|
15
|
+
import { STag as te } from "../tag/index.mjs";
|
|
16
|
+
import { child as ne, computed as u, createComponent as d, createFor as re, createIf as f, createInvoker as p, createSlot as ie, createTemplateRefSetter as ae, defineVaporComponent as m, delegateEvents as h, mergeModels as g, on as _, reactive as oe, ref as v, renderEffect as y, setAttr as se, setClass as b, setInsertionState as x, setProp as ce, setText as S, setValue as le, template as C, toDisplayString as w, toRefs as ue, txt as T, unref as E, useModel as de, useTemplateRef as D, watch as fe, withModifiers as O, withVaporCtx as k } from "vue";
|
|
16
17
|
//#region ../components/src/select/select.vue?vue&type=script&setup=true&vapor=true&lang.ts
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
18
|
+
var pe = C(" "), me = C("<input>"), he = C("<span> "), ge = C("<span>"), _e = C("<div><div></div>"), A = C("<div>"), ve = C("<li> "), ye = C("<ul>"), be = C("<div>", !0);
|
|
19
|
+
h("mousedown", "input", "keydown", "click");
|
|
20
|
+
var j = /* @__PURE__ */ m({
|
|
20
21
|
name: "SSelect",
|
|
21
22
|
__name: "select",
|
|
22
|
-
props: /* @__PURE__ */
|
|
23
|
+
props: /* @__PURE__ */ g({
|
|
23
24
|
modelValue: {},
|
|
24
25
|
size: { default: "medium" },
|
|
25
26
|
placeholder: { default: "请选择" },
|
|
26
27
|
options: { default: () => [] },
|
|
28
|
+
multiple: { type: Boolean },
|
|
27
29
|
clearable: { type: Boolean },
|
|
28
30
|
maxHeight: { default: "200px" },
|
|
29
31
|
disabled: { type: Boolean },
|
|
@@ -43,179 +45,241 @@ var M = /* @__PURE__ */ g({
|
|
|
43
45
|
type: [
|
|
44
46
|
String,
|
|
45
47
|
Number,
|
|
46
|
-
Boolean
|
|
48
|
+
Boolean,
|
|
49
|
+
Array
|
|
47
50
|
],
|
|
48
51
|
default: void 0
|
|
49
52
|
},
|
|
50
53
|
modelModifiers: {}
|
|
51
54
|
}),
|
|
52
|
-
emits: /* @__PURE__ */
|
|
55
|
+
emits: /* @__PURE__ */ g([
|
|
53
56
|
"change",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
57
|
+
"clear",
|
|
58
|
+
"remove"
|
|
56
59
|
], ["update:modelValue"]),
|
|
57
60
|
__multiRoot: !1,
|
|
58
|
-
setup(
|
|
59
|
-
let C =
|
|
60
|
-
size:
|
|
61
|
-
error:
|
|
62
|
-
}),
|
|
61
|
+
setup(m, { expose: h, emit: g }) {
|
|
62
|
+
let C = m, j = g, M = t("select"), { size: N, error: xe } = ue(C), { mergedSize: Se, mergedError: Ce } = n({
|
|
63
|
+
size: N,
|
|
64
|
+
error: xe
|
|
65
|
+
}), P = de(m, "modelValue"), F = u(() => ({
|
|
63
66
|
label: "label",
|
|
64
67
|
value: "value",
|
|
65
68
|
disabled: "disabled",
|
|
66
69
|
...C.fieldNames
|
|
67
|
-
}))
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
});
|
|
73
|
-
let ge = (e, t) => {
|
|
74
|
-
if (e) {
|
|
75
|
-
I.value[t] = e;
|
|
76
|
-
let { cleanup: r } = n(e);
|
|
77
|
-
L.value.push(r);
|
|
78
|
-
}
|
|
79
|
-
}, z = y(!1), B = ae({
|
|
70
|
+
})), I = v(!1), we = () => {
|
|
71
|
+
I.value = !0;
|
|
72
|
+
}, Te = () => {
|
|
73
|
+
I.value = !1;
|
|
74
|
+
}, L = v(!1), R = oe({
|
|
80
75
|
label: "",
|
|
81
76
|
option: null
|
|
82
|
-
}),
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
77
|
+
}), z = D("popoverRef"), B = D("scrollbarRef"), V = D("listRef"), H = D("multipleInputRef"), U = v(!1), W = v(""), Ee = u(() => ({
|
|
78
|
+
mini: "small",
|
|
79
|
+
small: "small",
|
|
80
|
+
medium: "medium",
|
|
81
|
+
large: "large"
|
|
82
|
+
})[C.size] || "medium"), G = u(() => C.multiple ? (Array.isArray(P.value) ? P.value : []).map((e) => C.options.find((t) => t[F.value.value] === e)).filter(Boolean) : []), De = (e) => C.multiple ? (Array.isArray(P.value) ? P.value : []).includes(e[F.value.value]) : !1, K = (e) => {
|
|
83
|
+
e ? (C.multiple && C.filterable ? (W.value = "", Y("")) : C.filterable && R.label && (R.label = ""), C.filterable && !C.multiple && Y(R.label), z.value?.show(), C.multiple && C.filterable && setTimeout(() => H.value?.focus(), 0)) : (C.filterable && !C.multiple && (R.label = R.option ? R.option[F.value.label] : ""), C.multiple && C.filterable && (W.value = "", J.value = C.options), z.value?.hide(), X.value = -1), U.value = e;
|
|
84
|
+
}, Oe = () => {
|
|
85
|
+
C.disabled || (U.value ? K(!1) : K(!0));
|
|
86
|
+
}, ke = () => {
|
|
87
|
+
K(!1);
|
|
88
|
+
}, q = (e) => C.options.find((t) => t[F.value.value] === e), Ae = (e) => {
|
|
89
|
+
if (!e.disabled) if (C.multiple) {
|
|
90
|
+
let t = Array.isArray(P.value) ? [...P.value] : [], n = e[F.value.value], r = t.indexOf(n);
|
|
91
|
+
r > -1 ? t.splice(r, 1) : t.push(n), P.value = t, C.filterable && (W.value = "", Y(""), setTimeout(() => H.value?.focus(), 0));
|
|
92
|
+
} else P.value = e[F.value.value];
|
|
93
|
+
}, J = v(C.options);
|
|
94
|
+
fe(() => C.options, (e) => {
|
|
95
|
+
J.value = e;
|
|
93
96
|
});
|
|
94
|
-
let
|
|
97
|
+
let je = u(() => C.remote ? 500 : 0), Me = u(() => C.filterable && R.option && U.value ? R.option[F.value.label] : C.placeholder), Y = async (e) => {
|
|
95
98
|
if (C.filterable) {
|
|
96
|
-
if (C.filterMethod && typeof C.filterMethod == "function")
|
|
99
|
+
if (C.filterMethod && typeof C.filterMethod == "function") J.value = C.filterMethod(e);
|
|
97
100
|
else if (C.remote && typeof C.remoteMethod == "function") {
|
|
98
|
-
|
|
101
|
+
L.value = !0;
|
|
99
102
|
try {
|
|
100
|
-
|
|
103
|
+
J.value = await C.remoteMethod(e);
|
|
101
104
|
} catch (e) {
|
|
102
|
-
console.error("远程筛选出错", e),
|
|
105
|
+
console.error("远程筛选出错", e), J.value = [];
|
|
103
106
|
} finally {
|
|
104
|
-
|
|
107
|
+
L.value = !1;
|
|
105
108
|
}
|
|
106
|
-
} else
|
|
107
|
-
|
|
109
|
+
} else J.value = C.options.filter((t) => t[F.value.label].includes(e));
|
|
110
|
+
X.value = -1;
|
|
108
111
|
}
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
let n =
|
|
112
|
+
}, Ne = e((e) => {
|
|
113
|
+
Y(e);
|
|
114
|
+
}, je.value), X = v(-1), Pe = (e, t) => {
|
|
115
|
+
let n = J.value;
|
|
113
116
|
if (n.length === 0) return -1;
|
|
114
117
|
let r = e, i = t === "down" ? 1 : -1, a = n.length;
|
|
115
|
-
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][F.value.disabled]) return r;
|
|
116
119
|
return -1;
|
|
117
|
-
},
|
|
118
|
-
if (
|
|
119
|
-
let e =
|
|
120
|
+
}, Fe = () => {
|
|
121
|
+
if (X.value === -1) return;
|
|
122
|
+
let e = V.value;
|
|
120
123
|
if (!e) return;
|
|
121
|
-
let t = e.querySelectorAll("li")[
|
|
124
|
+
let t = e.querySelectorAll("li")[X.value];
|
|
122
125
|
if (!t) return;
|
|
123
|
-
let n =
|
|
126
|
+
let n = B.value, r = null;
|
|
124
127
|
if (n && n.contentRef ? r = n.contentRef : e.parentElement && (r = e.parentElement), r) {
|
|
125
128
|
let e = t.offsetTop, n = e + t.offsetHeight, i = r.scrollTop, a = i + r.clientHeight;
|
|
126
129
|
e < i ? r.scrollTop = e : n > a && (r.scrollTop = n - r.clientHeight);
|
|
127
130
|
}
|
|
128
|
-
},
|
|
131
|
+
}, Ie = (e) => {
|
|
129
132
|
switch (e.key) {
|
|
130
133
|
case "Enter":
|
|
131
|
-
e.preventDefault(),
|
|
134
|
+
e.preventDefault(), U.value ? X.value > -1 && J.value[X.value] ? Ae(J.value[X.value]) : K(!1) : K(!0);
|
|
132
135
|
break;
|
|
133
136
|
case "Escape":
|
|
134
|
-
e.preventDefault(),
|
|
137
|
+
e.preventDefault(), U.value && K(!1);
|
|
135
138
|
break;
|
|
136
139
|
case "ArrowUp":
|
|
137
|
-
if (e.preventDefault(),
|
|
138
|
-
let e = X
|
|
139
|
-
e !== -1 && (
|
|
140
|
+
if (e.preventDefault(), U.value && J.value.length > 0) {
|
|
141
|
+
let e = Pe(X.value === -1 ? 0 : X.value, "up");
|
|
142
|
+
e !== -1 && (X.value = e, Fe());
|
|
140
143
|
}
|
|
141
144
|
break;
|
|
142
145
|
case "ArrowDown":
|
|
143
|
-
if (e.preventDefault(),
|
|
144
|
-
let e = X
|
|
145
|
-
e !== -1 && (
|
|
146
|
+
if (e.preventDefault(), U.value && J.value.length > 0) {
|
|
147
|
+
let e = Pe(X.value === -1 ? -1 : X.value, "down");
|
|
148
|
+
e !== -1 && (X.value = e, Fe());
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "Backspace":
|
|
152
|
+
if (C.multiple && !W.value) {
|
|
153
|
+
let e = Array.isArray(P.value) ? [...P.value] : [];
|
|
154
|
+
if (e.length > 0) {
|
|
155
|
+
let t = e.pop();
|
|
156
|
+
P.value = e, j("remove", t);
|
|
157
|
+
}
|
|
146
158
|
}
|
|
147
159
|
break;
|
|
148
160
|
default: break;
|
|
149
161
|
}
|
|
150
|
-
},
|
|
151
|
-
|
|
162
|
+
}, Z = () => {
|
|
163
|
+
C.multiple ? P.value = [] : P.value = "", j("clear");
|
|
164
|
+
}, Le = (e, t) => {
|
|
165
|
+
t.stopPropagation();
|
|
166
|
+
let n = Array.isArray(P.value) ? [...P.value] : [], r = e[F.value.value], i = n.indexOf(r);
|
|
167
|
+
i > -1 && (n.splice(i, 1), P.value = n, j("remove", r));
|
|
168
|
+
}, Re = (e) => {
|
|
169
|
+
let t = e.target;
|
|
170
|
+
W.value = t.value, Y(t.value);
|
|
152
171
|
};
|
|
153
|
-
|
|
154
|
-
if (
|
|
155
|
-
let t =
|
|
156
|
-
t
|
|
157
|
-
} else
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
172
|
+
fe(P, (e) => {
|
|
173
|
+
if (C.multiple) {
|
|
174
|
+
let t = Array.isArray(e) ? e : [];
|
|
175
|
+
t.map((e) => q(e)).filter(Boolean), j("change", t);
|
|
176
|
+
} else if (e && !Array.isArray(e)) {
|
|
177
|
+
let t = q(e);
|
|
178
|
+
t ? (R.label = t[F.value.label], R.option = t, j("change", t[F.value.value]), K(!1)) : (R.label = "", R.option = null, j("change", ""));
|
|
179
|
+
} else R.label = "", R.option = null, j("change", "");
|
|
180
|
+
}, { immediate: !0 }), h({
|
|
181
|
+
open: () => K(!0),
|
|
182
|
+
close: () => K(!1)
|
|
161
183
|
});
|
|
162
|
-
let Q =
|
|
163
|
-
return
|
|
184
|
+
let Q = ae(), $ = be();
|
|
185
|
+
return y(() => {
|
|
186
|
+
let e = E(M);
|
|
187
|
+
b($, [
|
|
188
|
+
e.b(),
|
|
189
|
+
e.is("readonly", !m.filterable || !U.value),
|
|
190
|
+
e.is("multiple", m.multiple)
|
|
191
|
+
]);
|
|
192
|
+
}), x($, null, 0), Q(d(E(o), { $: [() => ({
|
|
164
193
|
offset: [0, 4],
|
|
165
194
|
placement: "bottom-start",
|
|
166
195
|
width: "sameWidth",
|
|
167
196
|
manual: !0,
|
|
168
|
-
...
|
|
169
|
-
}), { onClickOutside: () =>
|
|
170
|
-
content:
|
|
171
|
-
let e =
|
|
172
|
-
return
|
|
173
|
-
let e =
|
|
174
|
-
return
|
|
175
|
-
}, () =>
|
|
176
|
-
let e =
|
|
177
|
-
return
|
|
197
|
+
...m.popoverProps
|
|
198
|
+
}), { onClickOutside: () => ke }] }, {
|
|
199
|
+
content: k(() => {
|
|
200
|
+
let e = A();
|
|
201
|
+
return y(() => b(e, [E(M).e("wrapper")])), x(e, null, 0), f(() => L.value, () => {
|
|
202
|
+
let e = A();
|
|
203
|
+
return y(() => b(e, [E(M).e("loading")])), x(e, null, 0), d(E(l), null, { default: k(() => d(E(a))) }), e;
|
|
204
|
+
}, () => f(() => J.value.length === 0, () => {
|
|
205
|
+
let e = A();
|
|
206
|
+
return y(() => b(e, [E(M).e("empty")])), x(e, null, 0), ie("empty", null, () => d(E(ee))), e;
|
|
178
207
|
}, () => {
|
|
179
|
-
let e =
|
|
180
|
-
let e =
|
|
181
|
-
return
|
|
182
|
-
let t =
|
|
183
|
-
|
|
184
|
-
}),
|
|
185
|
-
let n =
|
|
186
|
-
return
|
|
187
|
-
let i =
|
|
188
|
-
|
|
208
|
+
let e = d(E(c), { maxHeight: () => m.maxHeight }, { default: () => {
|
|
209
|
+
let e = ye();
|
|
210
|
+
return y(() => {
|
|
211
|
+
let t = E(M);
|
|
212
|
+
b(e, [t.e("list"), t.m("list-" + E(N))]);
|
|
213
|
+
}), x(e, null, 0), re(() => J.value, (e, t) => {
|
|
214
|
+
let n = ve(), r = T(n);
|
|
215
|
+
return _(n, "click", p(O(() => Ae(e.value), ["stop"]))), y(() => {
|
|
216
|
+
let i = E(M), a = e.value, o = F.value, s = a[o.label], c = o.label;
|
|
217
|
+
b(n, [
|
|
189
218
|
i.e("item"),
|
|
190
219
|
i.is("disabled", a[o.disabled]),
|
|
191
|
-
i.is("active",
|
|
192
|
-
i.is("highlight",
|
|
193
|
-
]),
|
|
220
|
+
i.is("active", m.multiple ? De(a) : s === R.label),
|
|
221
|
+
i.is("highlight", s === J.value[X.value]?.[c])
|
|
222
|
+
]), se(n, "data-index", t.value), S(r, w(s));
|
|
194
223
|
}), n;
|
|
195
|
-
}, (e, t) => e[
|
|
224
|
+
}, (e, t) => e[F.value.value], 1), Q(e, V, null, "listRef"), e;
|
|
196
225
|
} });
|
|
197
|
-
return Q(e,
|
|
198
|
-
}, 5, null,
|
|
226
|
+
return Q(e, B, null, "scrollbarRef"), e;
|
|
227
|
+
}, 5, null, 5), 5, null, 4), e.$evtmousedown = p(O(() => {}, ["prevent"])), e;
|
|
199
228
|
}),
|
|
200
|
-
default:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
229
|
+
default: k(() => f(() => m.multiple, () => {
|
|
230
|
+
let e = _e(), t = ne(e);
|
|
231
|
+
return y(() => {
|
|
232
|
+
let n = E(M);
|
|
233
|
+
b(e, [n.e("tags-wrapper")]), b(t, [n.e("tags")]);
|
|
234
|
+
}), x(t, null, 0), re(() => G.value, (e) => {
|
|
235
|
+
let t = (t) => Le(e.value, t);
|
|
236
|
+
return d(E(te), {
|
|
237
|
+
size: () => Ee.value,
|
|
238
|
+
closeable: () => "",
|
|
239
|
+
onClose: () => t
|
|
240
|
+
}, { default: () => {
|
|
241
|
+
let t = pe();
|
|
242
|
+
return y(() => {
|
|
243
|
+
let n = F.value;
|
|
244
|
+
S(t, w(e.value[n.label]));
|
|
245
|
+
}), t;
|
|
246
|
+
} });
|
|
247
|
+
}, (e) => e[F.value.value], 2), x(t, null, 1), f(() => m.filterable, () => {
|
|
248
|
+
let e = me();
|
|
249
|
+
return e.$evtinput = p(Re), e.$evtkeydown = p(Ie), Q(e, H, null, "multipleInputRef"), y(() => {
|
|
250
|
+
b(e, [E(M).e("input")]), ce(e, "placeholder", G.value.length === 0 ? m.placeholder : ""), le(e, W.value);
|
|
251
|
+
}), e;
|
|
252
|
+
}, () => f(() => G.value.length === 0, () => {
|
|
253
|
+
let e = he(), t = T(e);
|
|
254
|
+
return y(() => {
|
|
255
|
+
b(e, [E(M).e("placeholder")]), S(t, w(m.placeholder));
|
|
256
|
+
}), e;
|
|
257
|
+
}, null, 1), 5, null, 0), x(e, null, 1), f(() => I.value && Array.isArray(P.value) && P.value.length > 0 && m.clearable, () => {
|
|
258
|
+
let e = ge();
|
|
259
|
+
return y(() => b(e, E(M).e("close"))), x(e, null, 0), d(E(r)), _(e, "click", p(O(Z, ["stop"]))), e.$evtmousedown = p(O(() => {}, ["prevent"])), e;
|
|
260
|
+
}, null, 1), x(e, null, 2), d(E(l), {
|
|
261
|
+
class: () => [E(M).e("suffix-icon")],
|
|
262
|
+
style: () => ({ transform: U.value ? "rotate(180deg)" : "" })
|
|
263
|
+
}, { default: k(() => d(E(i))) }), _(e, "mouseenter", p(we)), _(e, "mouseleave", p(Te)), e;
|
|
264
|
+
}, () => d(E(s), {
|
|
265
|
+
modelValue: () => R.label,
|
|
266
|
+
"onUpdate:modelValue": () => (e) => R.label = e,
|
|
267
|
+
disabled: () => m.disabled,
|
|
268
|
+
placeholder: () => Me.value,
|
|
269
|
+
readonly: () => !m.filterable || !U.value,
|
|
270
|
+
clearable: () => m.clearable,
|
|
207
271
|
style: () => "width: 100%",
|
|
208
|
-
error: () =>
|
|
209
|
-
size: () =>
|
|
210
|
-
onInput: () =>
|
|
211
|
-
onKeydown: () =>
|
|
212
|
-
onClear: () =>
|
|
213
|
-
}, { suffix:
|
|
214
|
-
class: () => [
|
|
215
|
-
style: () => ({ transform:
|
|
216
|
-
}, { default:
|
|
217
|
-
}),
|
|
272
|
+
error: () => E(Ce),
|
|
273
|
+
size: () => E(Se),
|
|
274
|
+
onInput: () => E(Ne),
|
|
275
|
+
onKeydown: () => Ie,
|
|
276
|
+
onClear: () => Z
|
|
277
|
+
}, { suffix: k(() => d(E(l), {
|
|
278
|
+
class: () => [E(M).e("suffix-icon")],
|
|
279
|
+
style: () => ({ transform: U.value ? "rotate(180deg)" : "" })
|
|
280
|
+
}, { default: k(() => d(E(i))) })) }), 5, null, 3))
|
|
281
|
+
}), z, null, "popoverRef"), $.$evtclick = p(Oe), $;
|
|
218
282
|
}
|
|
219
283
|
});
|
|
220
284
|
//#endregion
|
|
221
|
-
export {
|
|
285
|
+
export { j as default };
|
|
@@ -3,13 +3,15 @@ export interface SelectProps {
|
|
|
3
3
|
/** 选择器值(v-model) */
|
|
4
4
|
modelValue?: any;
|
|
5
5
|
/** 选择器大小
|
|
6
|
-
* @default
|
|
6
|
+
* @default medium
|
|
7
7
|
*/
|
|
8
8
|
size?: "mini" | "small" | "medium" | "large";
|
|
9
9
|
/** 选择器占位符 */
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
/** 选择器选项 */
|
|
12
12
|
options: any[];
|
|
13
|
+
/** 选择器是否可多选 */
|
|
14
|
+
multiple?: boolean;
|
|
13
15
|
/** 是否支持清空选择 */
|
|
14
16
|
clearable?: boolean;
|
|
15
17
|
/** 选择器最大高度 */
|
|
@@ -37,11 +39,11 @@ export interface SelectProps {
|
|
|
37
39
|
}
|
|
38
40
|
export interface SelectEmits {
|
|
39
41
|
/** 选择器值改变时触发 */
|
|
40
|
-
change: [value: string | number | boolean];
|
|
41
|
-
/** 选择器选项改变时触发 */
|
|
42
|
-
selectOption: [option: any];
|
|
42
|
+
change: [value: string | number | boolean | (string | number | boolean)[]];
|
|
43
43
|
/** 选择器清空时触发 */
|
|
44
44
|
clear: [];
|
|
45
|
+
/** 多选模式下移除标签时触发 */
|
|
46
|
+
remove: [value: string | number | boolean];
|
|
45
47
|
}
|
|
46
48
|
export interface SelectSlots {
|
|
47
49
|
/** 空状态 */
|
|
@@ -11,6 +11,7 @@ export declare const SSpace: ((__VLS_props: NonNullable<Awaited<typeof __VLS_set
|
|
|
11
11
|
fill?: boolean | undefined;
|
|
12
12
|
align?: "center" | "start" | "end" | undefined;
|
|
13
13
|
justify?: "center" | "start" | "end" | "between" | "around" | undefined;
|
|
14
|
+
wrap?: boolean | undefined;
|
|
14
15
|
} & (typeof globalThis extends {
|
|
15
16
|
__VLS_PROPS_FALLBACK: infer P;
|
|
16
17
|
} ? P : {});
|
package/dist/es/components/src/space/space.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -15,7 +15,8 @@ var d = l("<div>", !0), f = /* @__PURE__ */ i({
|
|
|
15
15
|
default: !1
|
|
16
16
|
},
|
|
17
17
|
align: { default: "center" },
|
|
18
|
-
justify: { default: "start" }
|
|
18
|
+
justify: { default: "start" },
|
|
19
|
+
wrap: { type: Boolean }
|
|
19
20
|
},
|
|
20
21
|
__multiRoot: !1,
|
|
21
22
|
setup(i) {
|
|
@@ -27,6 +28,7 @@ var d = l("<div>", !0), f = /* @__PURE__ */ i({
|
|
|
27
28
|
e.m(i.vertical ? "vertical" : "horizontal"),
|
|
28
29
|
e.m("align-" + i.align),
|
|
29
30
|
e.m("justify-" + i.justify),
|
|
31
|
+
e.is("wrap", i.wrap),
|
|
30
32
|
{ [e.m("fill")]: i.fill }
|
|
31
33
|
]), c(m, p.value);
|
|
32
34
|
}), s(m, null, 0), r("default", null), m;
|
package/dist/es/components/src/table/table.vue_vue_type_script_setup_true_vapor_true_lang.mjs
CHANGED
|
@@ -136,14 +136,14 @@ var k = /* @__PURE__ */ p({
|
|
|
136
136
|
let t = 0;
|
|
137
137
|
for (let n = 0; n < e; n++) {
|
|
138
138
|
let e = H.value[n];
|
|
139
|
-
e && (e.width ? t += typeof e.width == "number" ? e.width : parseInt(e.width) || 0 : P.value[n] !== void 0 && (t += P.value[n]));
|
|
139
|
+
e && (e.width && e.width !== "auto" ? t += typeof e.width == "number" ? e.width : parseInt(e.width) || 0 : P.value[n] !== void 0 && (t += P.value[n]));
|
|
140
140
|
}
|
|
141
141
|
return t;
|
|
142
142
|
}, Ce = (e) => {
|
|
143
143
|
let t = 0;
|
|
144
144
|
for (let n = 0; n < e; n++) {
|
|
145
145
|
let e = xe.value[n];
|
|
146
|
-
if (e) if (e.width) t += typeof e.width == "number" ? e.width : parseInt(e.width) || 0;
|
|
146
|
+
if (e) if (e.width && e.width !== "auto") t += typeof e.width == "number" ? e.width : parseInt(e.width) || 0;
|
|
147
147
|
else {
|
|
148
148
|
let n = H.value.findIndex((t) => t.field === e.field);
|
|
149
149
|
n !== -1 && P.value[n] !== void 0 && (t += P.value[n]);
|
|
@@ -156,11 +156,9 @@ var k = /* @__PURE__ */ p({
|
|
|
156
156
|
header: V.value.map((e, t) => e.map((e, n) => W(e, t, n))),
|
|
157
157
|
body: R.value.map((e, t) => H.value.map((e, t) => W(e, 0, t)))
|
|
158
158
|
})), W = (t, n, r) => {
|
|
159
|
-
let i = {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
boxSizing: "border-box"
|
|
163
|
-
}, a = t._fixed || t.fixed, o = t;
|
|
159
|
+
let i = { boxSizing: "border-box" };
|
|
160
|
+
t.width === "auto" ? (i.width = "1px", i.whiteSpace = "nowrap") : t.width !== void 0 && t.width !== "" ? (i.width = e(t.width), i.minWidth = e(t.minWidth) || e(t.width)) : i.minWidth = e(t.minWidth) || void 0;
|
|
161
|
+
let a = t._fixed || t.fixed, o = t;
|
|
164
162
|
if (a === "left") {
|
|
165
163
|
let e = -1;
|
|
166
164
|
e = o._isHeader && o._firstLeafIndex !== void 0 ? o._firstLeafIndex : H.value.findIndex((e) => e.field === t.field), e !== -1 && (i.position = "sticky", i.left = `${Se(e)}px`, i.zIndex = o._isHeader ? 11 : 3, i.insetLeft = `${Se(e)}px`);
|
|
@@ -174,7 +172,7 @@ var k = /* @__PURE__ */ p({
|
|
|
174
172
|
let e = 0;
|
|
175
173
|
for (let t = o._firstLeafIndex; t <= o._lastLeafIndex; t++) {
|
|
176
174
|
let n = H.value[t];
|
|
177
|
-
n && (n.width ? e += typeof n.width == "number" ? n.width : parseInt(n.width) || 0 : P.value[t] !== void 0 && (e += P.value[t]));
|
|
175
|
+
n && (n.width && n.width !== "auto" ? e += typeof n.width == "number" ? n.width : parseInt(n.width) || 0 : P.value[t] !== void 0 && (e += P.value[t]));
|
|
178
176
|
}
|
|
179
177
|
i.width = `${e}px`, i.minWidth = `${e}px`, i.maxWidth = `${e}px`;
|
|
180
178
|
}
|
|
@@ -237,20 +235,20 @@ var k = /* @__PURE__ */ p({
|
|
|
237
235
|
}, ke = () => {
|
|
238
236
|
J.value === void 0 ? J.value = [] : (J.value = [], A("select", null, -1, []));
|
|
239
237
|
}, Ae = () => {
|
|
240
|
-
k.multiple && (J.value = R.value, A("select", null, -1, J.value));
|
|
238
|
+
k.multiple && (J.value = [...R.value], A("select", null, -1, J.value));
|
|
241
239
|
}, je = (e, t, n) => {
|
|
242
240
|
if (k.multiple) {
|
|
243
241
|
let n = J.value.findIndex((e) => e._id === t._id);
|
|
244
242
|
if (e) {
|
|
245
243
|
if (n === -1) {
|
|
246
244
|
let e = R.value.find((e) => e._id === t._id);
|
|
247
|
-
J.value.
|
|
245
|
+
J.value = [...J.value, e];
|
|
248
246
|
}
|
|
249
|
-
} else n !== -1 && J.value.
|
|
247
|
+
} else n !== -1 && (J.value = J.value.toSpliced(n, 1));
|
|
250
248
|
} else e ? J.value = [R.value.find((e) => e._id === t._id)] : J.value = [];
|
|
251
249
|
A("select", t, n, J.value);
|
|
252
250
|
}, Me = (e) => {
|
|
253
|
-
k.multiple && (e ? J.value = R.value : J.value = [], A("select", null, -1, J.value));
|
|
251
|
+
k.multiple && (e ? J.value = [...R.value] : J.value = [], A("select", null, -1, J.value));
|
|
254
252
|
}, Ne = s(() => R.value.length ? J.value.length === R.value.length : !1), Pe = s(() => J.value.length > 0 && J.value.length < R.value.length);
|
|
255
253
|
ae(() => {
|
|
256
254
|
q(), K();
|
|
@@ -6,7 +6,7 @@ export interface TableProps {
|
|
|
6
6
|
/** 表格高度 */
|
|
7
7
|
height?: string | number;
|
|
8
8
|
/** 表格宽度
|
|
9
|
-
* @default
|
|
9
|
+
* @default 100%
|
|
10
10
|
*/
|
|
11
11
|
width?: string | number;
|
|
12
12
|
/** 是否显示边框
|
|
@@ -64,7 +64,7 @@ export interface TableColumnProps {
|
|
|
64
64
|
/** 选择列 */
|
|
65
65
|
type?: "select";
|
|
66
66
|
/** 列对齐方式
|
|
67
|
-
* @default
|
|
67
|
+
* @default left
|
|
68
68
|
*/
|
|
69
69
|
align?: "left" | "center" | "right";
|
|
70
70
|
/** 列标题对齐方式(默认使用 align 值) */
|