@xto/form 1.0.3 → 1.1.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/es/index.mjs +1342 -1324
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useNamespace as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as Z, ref as E, useSlots as Ae, computed as h, openBlock as i, createElementBlock as c, normalizeClass as u, unref as s, renderSlot as le, createElementVNode as f, toDisplayString as z, createCommentVNode as N, withDirectives as ve, vModelDynamic as ze, watch as ce, normalizeStyle as ae, vModelText as Te, inject as we, withModifiers as ue, createTextVNode as fe, provide as Ve, toRef as He, onMounted as ye, onUnmounted as ke, Fragment as j, renderList as _, createBlock as he, Teleport as Re, createVNode as xe, Transition as Be, withCtx as Fe, vShow as Ie, nextTick as Ce } from "vue";
|
|
2
|
+
import { useNamespace as Q, useZIndex as Le } from "@xto/core";
|
|
3
|
+
const Oe = ["type", "placeholder", "disabled", "readonly", "maxlength", "minlength"], nl = /* @__PURE__ */ Z({
|
|
4
4
|
name: "XInput",
|
|
5
5
|
__name: "index",
|
|
6
6
|
props: {
|
|
7
|
-
modelValue: { default:
|
|
7
|
+
modelValue: { default: void 0 },
|
|
8
|
+
value: { default: void 0 },
|
|
8
9
|
type: { default: "text" },
|
|
9
10
|
placeholder: { default: "" },
|
|
10
11
|
size: { default: "default" },
|
|
@@ -18,100 +19,98 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
18
19
|
prefixIcon: {},
|
|
19
20
|
suffixIcon: {}
|
|
20
21
|
},
|
|
21
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur", "clear"],
|
|
22
|
+
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur", "clear"],
|
|
22
23
|
setup(n, { expose: p, emit: e }) {
|
|
23
|
-
const t = n, l = e, a =
|
|
24
|
+
const t = n, l = e, a = Q("input"), g = E(), v = E(!1), w = E(!1), k = Ae(), L = h(
|
|
24
25
|
() => t.type === "password" && t.showPassword && !t.disabled
|
|
25
|
-
),
|
|
26
|
-
get: () => t.modelValue,
|
|
27
|
-
set: (
|
|
28
|
-
|
|
26
|
+
), D = h(() => L.value ? w.value ? "text" : "password" : t.type), x = h({
|
|
27
|
+
get: () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : "",
|
|
28
|
+
set: (B) => {
|
|
29
|
+
l("update:modelValue", B), l("update:value", B), l("input", B);
|
|
30
|
+
}
|
|
31
|
+
}), C = h(() => String(x.value).length), I = h(() => [
|
|
29
32
|
a.b(),
|
|
30
33
|
t.size !== "default" ? a.m(t.size) : "",
|
|
31
34
|
a.is("disabled", t.disabled),
|
|
32
35
|
a.is("focus", v.value),
|
|
33
|
-
a.is("has-prefix", t.prefixIcon ||
|
|
34
|
-
a.is("has-suffix", t.suffixIcon ||
|
|
35
|
-
]),
|
|
36
|
-
const
|
|
37
|
-
l("
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
l("update:modelValue", ""), l("clear");
|
|
47
|
-
}, T = () => {
|
|
48
|
-
V.value = !V.value;
|
|
36
|
+
a.is("has-prefix", t.prefixIcon || k.prefix),
|
|
37
|
+
a.is("has-suffix", t.suffixIcon || k.suffix || t.clearable || L.value || t.showWordLimit)
|
|
38
|
+
]), d = (B) => {
|
|
39
|
+
const K = B.target.value;
|
|
40
|
+
l("change", K);
|
|
41
|
+
}, V = (B) => {
|
|
42
|
+
v.value = !0, l("focus", B);
|
|
43
|
+
}, M = (B) => {
|
|
44
|
+
v.value = !1, l("blur", B);
|
|
45
|
+
}, S = () => {
|
|
46
|
+
l("update:modelValue", ""), l("update:value", ""), l("clear");
|
|
47
|
+
}, P = () => {
|
|
48
|
+
w.value = !w.value;
|
|
49
49
|
};
|
|
50
50
|
return p({
|
|
51
51
|
focus: () => {
|
|
52
|
-
var
|
|
53
|
-
(
|
|
52
|
+
var B;
|
|
53
|
+
(B = g.value) == null || B.focus();
|
|
54
54
|
},
|
|
55
55
|
blur: () => {
|
|
56
|
-
var
|
|
57
|
-
(
|
|
56
|
+
var B;
|
|
57
|
+
(B = g.value) == null || B.blur();
|
|
58
58
|
},
|
|
59
|
-
inputRef:
|
|
60
|
-
}), (
|
|
61
|
-
class: u(
|
|
59
|
+
inputRef: g
|
|
60
|
+
}), (B, K) => (i(), c("div", {
|
|
61
|
+
class: u(I.value)
|
|
62
62
|
}, [
|
|
63
|
-
|
|
63
|
+
B.$slots.prefix || n.prefixIcon ? (i(), c("span", {
|
|
64
64
|
key: 0,
|
|
65
65
|
class: u(s(a).e("prefix"))
|
|
66
66
|
}, [
|
|
67
|
-
le(
|
|
67
|
+
le(B.$slots, "prefix", {}, () => [
|
|
68
68
|
f("span", {
|
|
69
69
|
class: u(s(a).e("icon"))
|
|
70
|
-
},
|
|
70
|
+
}, z(n.prefixIcon), 3)
|
|
71
71
|
])
|
|
72
|
-
], 2)) :
|
|
73
|
-
|
|
72
|
+
], 2)) : N("", !0),
|
|
73
|
+
ve(f("input", {
|
|
74
74
|
ref_key: "inputRef",
|
|
75
|
-
ref:
|
|
76
|
-
"onUpdate:modelValue":
|
|
77
|
-
type:
|
|
75
|
+
ref: g,
|
|
76
|
+
"onUpdate:modelValue": K[0] || (K[0] = (X) => x.value = X),
|
|
77
|
+
type: D.value,
|
|
78
78
|
placeholder: n.placeholder,
|
|
79
79
|
disabled: n.disabled,
|
|
80
80
|
readonly: n.readonly,
|
|
81
81
|
maxlength: n.maxlength,
|
|
82
82
|
minlength: n.minlength,
|
|
83
83
|
class: u(s(a).e("inner")),
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
[Ee, w.value]
|
|
84
|
+
onChange: d,
|
|
85
|
+
onFocus: V,
|
|
86
|
+
onBlur: M
|
|
87
|
+
}, null, 42, Oe), [
|
|
88
|
+
[ze, x.value]
|
|
90
89
|
]),
|
|
91
|
-
|
|
90
|
+
B.$slots.suffix || n.suffixIcon || n.clearable || L.value || n.showWordLimit ? (i(), c("span", {
|
|
92
91
|
key: 1,
|
|
93
92
|
class: u(s(a).e("suffix"))
|
|
94
93
|
}, [
|
|
95
|
-
le(
|
|
96
|
-
n.clearable &&
|
|
94
|
+
le(B.$slots, "suffix", {}, () => [
|
|
95
|
+
n.clearable && x.value && !n.disabled ? (i(), c("span", {
|
|
97
96
|
key: 0,
|
|
98
97
|
class: u([s(a).e("icon"), s(a).e("clear")]),
|
|
99
|
-
onClick:
|
|
100
|
-
}, " ✕ ", 2)) :
|
|
101
|
-
|
|
98
|
+
onClick: S
|
|
99
|
+
}, " ✕ ", 2)) : N("", !0),
|
|
100
|
+
L.value ? (i(), c("span", {
|
|
102
101
|
key: 1,
|
|
103
102
|
class: u([s(a).e("icon"), s(a).e("password")]),
|
|
104
|
-
onClick:
|
|
105
|
-
},
|
|
106
|
-
n.showWordLimit && n.maxlength ? (
|
|
103
|
+
onClick: P
|
|
104
|
+
}, z(w.value ? "🙈" : "👁️"), 3)) : N("", !0),
|
|
105
|
+
n.showWordLimit && n.maxlength ? (i(), c("span", {
|
|
107
106
|
key: 2,
|
|
108
107
|
class: u(s(a).e("count"))
|
|
109
|
-
},
|
|
108
|
+
}, z(C.value) + "/" + z(n.maxlength), 3)) : N("", !0)
|
|
110
109
|
])
|
|
111
|
-
], 2)) :
|
|
110
|
+
], 2)) : N("", !0)
|
|
112
111
|
], 2));
|
|
113
112
|
}
|
|
114
|
-
}),
|
|
113
|
+
}), Ne = ["disabled"], Ke = ["value", "placeholder", "disabled"], Xe = ["disabled"], sl = /* @__PURE__ */ Z({
|
|
115
114
|
name: "XInputNumber",
|
|
116
115
|
__name: "index",
|
|
117
116
|
props: {
|
|
@@ -130,155 +129,156 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
130
129
|
},
|
|
131
130
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
132
131
|
setup(n, { expose: p, emit: e }) {
|
|
133
|
-
const t = n, l = e, a =
|
|
132
|
+
const t = n, l = e, a = Q("input-number"), g = E(), v = E(!1), w = E(null), k = E(t.modelValue), L = h(() => {
|
|
134
133
|
if (t.precision !== void 0)
|
|
135
134
|
return t.precision;
|
|
136
|
-
const o =
|
|
137
|
-
return Math.max(o,
|
|
135
|
+
const o = D(t.step), r = t.modelValue !== void 0 ? D(t.modelValue) : 0;
|
|
136
|
+
return Math.max(o, r);
|
|
138
137
|
});
|
|
139
|
-
function
|
|
140
|
-
const
|
|
141
|
-
return m === -1 ? 0 :
|
|
138
|
+
function D(o) {
|
|
139
|
+
const r = o.toString(), m = r.indexOf(".");
|
|
140
|
+
return m === -1 ? 0 : r.length - m - 1;
|
|
142
141
|
}
|
|
143
|
-
function
|
|
144
|
-
if (
|
|
145
|
-
let m = o.toFixed(
|
|
142
|
+
function x(o, r = L.value) {
|
|
143
|
+
if (r === 0) return Math.round(o);
|
|
144
|
+
let m = o.toFixed(r);
|
|
146
145
|
return Number(m);
|
|
147
146
|
}
|
|
148
|
-
function
|
|
147
|
+
function C(o) {
|
|
149
148
|
return o > t.max ? t.max : o < t.min ? t.min : o;
|
|
150
149
|
}
|
|
151
|
-
const
|
|
150
|
+
const I = h(() => t.modelValue), d = h(() => w.value !== null ? w.value : I.value === void 0 ? "" : x(I.value)), V = h(() => t.disabled ? !0 : I.value === void 0 ? t.min !== -1 / 0 : I.value <= t.min), M = h(() => t.disabled ? !0 : I.value === void 0 ? t.max !== 1 / 0 : I.value >= t.max), S = h(() => [
|
|
152
151
|
a.b(),
|
|
153
152
|
t.size !== "default" ? a.m(t.size) : "",
|
|
154
153
|
a.is("disabled", t.disabled),
|
|
155
154
|
a.is("focus", v.value),
|
|
156
155
|
t.controlsPosition ? a.m(t.controlsPosition) : ""
|
|
157
156
|
]);
|
|
158
|
-
function
|
|
157
|
+
function P() {
|
|
159
158
|
if (t.disabled || M.value) return;
|
|
160
|
-
const o =
|
|
161
|
-
|
|
159
|
+
const o = I.value ?? (t.min === -1 / 0 ? 0 : t.min), r = x(o + t.step), m = C(r);
|
|
160
|
+
T(m);
|
|
162
161
|
}
|
|
163
|
-
function
|
|
164
|
-
if (t.disabled ||
|
|
165
|
-
const o =
|
|
166
|
-
|
|
162
|
+
function b() {
|
|
163
|
+
if (t.disabled || V.value) return;
|
|
164
|
+
const o = I.value ?? (t.min === -1 / 0 ? 0 : t.min), r = x(o - t.step), m = C(r);
|
|
165
|
+
T(m);
|
|
167
166
|
}
|
|
168
|
-
function
|
|
169
|
-
const
|
|
167
|
+
function T(o) {
|
|
168
|
+
const r = k.value;
|
|
170
169
|
if (o === void 0)
|
|
171
|
-
l("update:modelValue", void 0), l("change", void 0,
|
|
170
|
+
l("update:modelValue", void 0), l("change", void 0, r);
|
|
172
171
|
else {
|
|
173
|
-
const m =
|
|
172
|
+
const m = x(o), O = C(m);
|
|
174
173
|
if (t.stepStrictly) {
|
|
175
|
-
const
|
|
176
|
-
l("update:modelValue",
|
|
174
|
+
const te = Math.round((O - t.min) / t.step), A = x(t.min + te * t.step);
|
|
175
|
+
l("update:modelValue", A), l("change", A, r);
|
|
177
176
|
} else
|
|
178
|
-
l("update:modelValue", O), l("change", O,
|
|
177
|
+
l("update:modelValue", O), l("change", O, r);
|
|
179
178
|
}
|
|
180
|
-
|
|
179
|
+
k.value = t.modelValue, w.value = null;
|
|
181
180
|
}
|
|
182
|
-
function
|
|
181
|
+
function B(o) {
|
|
183
182
|
if (o === "" || o === "-")
|
|
184
183
|
return;
|
|
185
|
-
let
|
|
186
|
-
const m =
|
|
187
|
-
m.length > 2 && (
|
|
188
|
-
const O = Number(
|
|
184
|
+
let r = o.replace(/[^\d.-]/g, "");
|
|
185
|
+
const m = r.split(".");
|
|
186
|
+
m.length > 2 && (r = m[0] + "." + m.slice(1).join("")), r.indexOf("-") > 0 && (r = r.replace(/-/g, "")), r.lastIndexOf("-") > 0 && (r = "-" + r.replace(/-/g, ""));
|
|
187
|
+
const O = Number(r);
|
|
189
188
|
if (!isNaN(O))
|
|
190
189
|
return O;
|
|
191
190
|
}
|
|
192
|
-
function
|
|
193
|
-
const
|
|
194
|
-
|
|
191
|
+
function K(o) {
|
|
192
|
+
const r = o.target.value;
|
|
193
|
+
w.value = r;
|
|
195
194
|
}
|
|
196
|
-
function
|
|
197
|
-
if (v.value = !1,
|
|
198
|
-
const
|
|
199
|
-
|
|
195
|
+
function X(o) {
|
|
196
|
+
if (v.value = !1, w.value !== null) {
|
|
197
|
+
const r = B(w.value);
|
|
198
|
+
r === void 0 ? t.valueOnClear !== null ? T(t.valueOnClear) : w.value = null : T(r);
|
|
200
199
|
}
|
|
201
200
|
l("blur", o);
|
|
202
201
|
}
|
|
203
202
|
function q(o) {
|
|
204
|
-
v.value = !0,
|
|
203
|
+
v.value = !0, k.value = t.modelValue, l("focus", o);
|
|
205
204
|
}
|
|
206
|
-
function
|
|
207
|
-
var
|
|
205
|
+
function J(o) {
|
|
206
|
+
var r;
|
|
208
207
|
if (!t.disabled)
|
|
209
208
|
switch (o.key) {
|
|
210
209
|
case "ArrowUp":
|
|
211
|
-
o.preventDefault(),
|
|
210
|
+
o.preventDefault(), P();
|
|
212
211
|
break;
|
|
213
212
|
case "ArrowDown":
|
|
214
|
-
o.preventDefault(),
|
|
213
|
+
o.preventDefault(), b();
|
|
215
214
|
break;
|
|
216
215
|
case "Enter":
|
|
217
|
-
(
|
|
216
|
+
(r = g.value) == null || r.blur();
|
|
218
217
|
break;
|
|
219
218
|
}
|
|
220
219
|
}
|
|
221
|
-
function D() {
|
|
222
|
-
V.value = null, t.valueOnClear !== null && t.valueOnClear !== void 0 ? R(t.valueOnClear) : (l("update:modelValue", void 0), l("change", void 0, x.value), x.value = void 0);
|
|
223
|
-
}
|
|
224
220
|
function $() {
|
|
221
|
+
w.value = null, t.valueOnClear !== null && t.valueOnClear !== void 0 ? T(t.valueOnClear) : (l("update:modelValue", void 0), l("change", void 0, k.value), k.value = void 0);
|
|
222
|
+
}
|
|
223
|
+
function R() {
|
|
225
224
|
var o;
|
|
226
|
-
(o =
|
|
225
|
+
(o = g.value) == null || o.focus();
|
|
227
226
|
}
|
|
228
|
-
function
|
|
227
|
+
function y() {
|
|
229
228
|
var o;
|
|
230
|
-
(o =
|
|
229
|
+
(o = g.value) == null || o.blur();
|
|
231
230
|
}
|
|
232
|
-
return
|
|
233
|
-
|
|
231
|
+
return ce(() => t.modelValue, (o) => {
|
|
232
|
+
k.value = o, w.value = null;
|
|
234
233
|
}, { immediate: !0 }), p({
|
|
235
|
-
focus:
|
|
236
|
-
blur:
|
|
237
|
-
clear:
|
|
238
|
-
increase:
|
|
239
|
-
decrease:
|
|
240
|
-
}), (o,
|
|
241
|
-
class: u(
|
|
234
|
+
focus: R,
|
|
235
|
+
blur: y,
|
|
236
|
+
clear: $,
|
|
237
|
+
increase: P,
|
|
238
|
+
decrease: b
|
|
239
|
+
}), (o, r) => (i(), c("div", {
|
|
240
|
+
class: u(S.value)
|
|
242
241
|
}, [
|
|
243
|
-
n.controls ? (
|
|
242
|
+
n.controls ? (i(), c("button", {
|
|
244
243
|
key: 0,
|
|
245
244
|
type: "button",
|
|
246
|
-
class: u([s(a).e("decrease"), s(a).is("disabled",
|
|
247
|
-
disabled:
|
|
248
|
-
onClick:
|
|
249
|
-
}, " − ", 10,
|
|
245
|
+
class: u([s(a).e("decrease"), s(a).is("disabled", V.value)]),
|
|
246
|
+
disabled: V.value,
|
|
247
|
+
onClick: b
|
|
248
|
+
}, " − ", 10, Ne)) : N("", !0),
|
|
250
249
|
f("div", {
|
|
251
250
|
class: u(s(a).e("wrapper"))
|
|
252
251
|
}, [
|
|
253
252
|
f("input", {
|
|
254
253
|
ref_key: "inputRef",
|
|
255
|
-
ref:
|
|
256
|
-
value:
|
|
254
|
+
ref: g,
|
|
255
|
+
value: d.value,
|
|
257
256
|
placeholder: n.placeholder,
|
|
258
257
|
disabled: n.disabled,
|
|
259
258
|
class: u(s(a).e("inner")),
|
|
260
259
|
type: "text",
|
|
261
260
|
autocomplete: "off",
|
|
262
|
-
onInput:
|
|
261
|
+
onInput: K,
|
|
263
262
|
onFocus: q,
|
|
264
|
-
onBlur:
|
|
265
|
-
onKeydown:
|
|
266
|
-
}, null, 42,
|
|
263
|
+
onBlur: X,
|
|
264
|
+
onKeydown: J
|
|
265
|
+
}, null, 42, Ke)
|
|
267
266
|
], 2),
|
|
268
|
-
n.controls ? (
|
|
267
|
+
n.controls ? (i(), c("button", {
|
|
269
268
|
key: 1,
|
|
270
269
|
type: "button",
|
|
271
270
|
class: u([s(a).e("increase"), s(a).is("disabled", M.value)]),
|
|
272
271
|
disabled: M.value,
|
|
273
|
-
onClick:
|
|
274
|
-
}, " + ", 10,
|
|
272
|
+
onClick: P
|
|
273
|
+
}, " + ", 10, Xe)) : N("", !0)
|
|
275
274
|
], 2));
|
|
276
275
|
}
|
|
277
|
-
}),
|
|
276
|
+
}), Ue = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], ul = /* @__PURE__ */ Z({
|
|
278
277
|
name: "XTextarea",
|
|
279
278
|
__name: "index",
|
|
280
279
|
props: {
|
|
281
|
-
modelValue: { default:
|
|
280
|
+
modelValue: { default: void 0 },
|
|
281
|
+
value: { default: void 0 },
|
|
282
282
|
placeholder: { default: "" },
|
|
283
283
|
disabled: { type: Boolean, default: !1 },
|
|
284
284
|
readonly: { type: Boolean, default: !1 },
|
|
@@ -289,74 +289,75 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
289
289
|
showWordLimit: { type: Boolean, default: !1 },
|
|
290
290
|
resize: { default: "vertical" }
|
|
291
291
|
},
|
|
292
|
-
emits: ["update:modelValue", "input", "change", "focus", "blur"],
|
|
292
|
+
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur"],
|
|
293
293
|
setup(n, { expose: p, emit: e }) {
|
|
294
|
-
const t = n, l = e, a =
|
|
295
|
-
get: () => t.modelValue,
|
|
296
|
-
set: (
|
|
297
|
-
|
|
298
|
-
const B = {};
|
|
299
|
-
if (t.resize && (B.resize = t.resize), t.autosize && (B.minHeight = "auto", typeof t.autosize == "object")) {
|
|
300
|
-
const I = t.autosize.minRows || 1, T = t.autosize.maxRows;
|
|
301
|
-
B.minHeight = `${I * 22 + 12}px`, T && (B.maxHeight = `${T * 22 + 12}px`);
|
|
294
|
+
const t = n, l = e, a = Q("textarea"), g = E(), v = E(!1), w = h({
|
|
295
|
+
get: () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : "",
|
|
296
|
+
set: (S) => {
|
|
297
|
+
l("update:modelValue", S), l("update:value", S), l("input", S);
|
|
302
298
|
}
|
|
303
|
-
|
|
304
|
-
|
|
299
|
+
}), k = h(() => String(w.value).length), L = h(() => {
|
|
300
|
+
const S = {};
|
|
301
|
+
if (t.resize && (S.resize = t.resize), t.autosize && (S.minHeight = "auto", typeof t.autosize == "object")) {
|
|
302
|
+
const P = t.autosize.minRows || 1, b = t.autosize.maxRows;
|
|
303
|
+
S.minHeight = `${P * 22 + 12}px`, b && (S.maxHeight = `${b * 22 + 12}px`);
|
|
304
|
+
}
|
|
305
|
+
return S;
|
|
306
|
+
}), D = h(() => [
|
|
305
307
|
a.b(),
|
|
306
308
|
a.is("disabled", t.disabled),
|
|
307
309
|
a.is("focus", v.value),
|
|
308
|
-
a.is("exceed", t.maxlength &&
|
|
309
|
-
]),
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
v.value = !1, l("blur", B);
|
|
310
|
+
a.is("exceed", t.maxlength && k.value > t.maxlength)
|
|
311
|
+
]), x = () => {
|
|
312
|
+
t.autosize && g.value && (g.value.style.height = "auto", g.value.style.height = `${g.value.scrollHeight}px`);
|
|
313
|
+
}, C = (S) => {
|
|
314
|
+
const P = S.target.value;
|
|
315
|
+
l("change", P);
|
|
316
|
+
}, I = (S) => {
|
|
317
|
+
v.value = !0, l("focus", S);
|
|
318
|
+
}, d = (S) => {
|
|
319
|
+
v.value = !1, l("blur", S);
|
|
319
320
|
};
|
|
320
321
|
return p({
|
|
321
322
|
focus: () => {
|
|
322
|
-
var
|
|
323
|
-
(
|
|
323
|
+
var S;
|
|
324
|
+
(S = g.value) == null || S.focus();
|
|
324
325
|
},
|
|
325
326
|
blur: () => {
|
|
326
|
-
var
|
|
327
|
-
(
|
|
327
|
+
var S;
|
|
328
|
+
(S = g.value) == null || S.blur();
|
|
328
329
|
},
|
|
329
|
-
textareaRef:
|
|
330
|
-
}), (
|
|
331
|
-
class: u(
|
|
330
|
+
textareaRef: g
|
|
331
|
+
}), (S, P) => (i(), c("div", {
|
|
332
|
+
class: u(D.value),
|
|
332
333
|
style: ae(n.disabled ? void 0 : { cursor: "text" })
|
|
333
334
|
}, [
|
|
334
|
-
|
|
335
|
+
ve(f("textarea", {
|
|
335
336
|
ref_key: "textareaRef",
|
|
336
|
-
ref:
|
|
337
|
-
"onUpdate:modelValue":
|
|
337
|
+
ref: g,
|
|
338
|
+
"onUpdate:modelValue": P[0] || (P[0] = (b) => w.value = b),
|
|
338
339
|
placeholder: n.placeholder,
|
|
339
340
|
disabled: n.disabled,
|
|
340
341
|
readonly: n.readonly,
|
|
341
342
|
maxlength: n.maxlength,
|
|
342
343
|
minlength: n.minlength,
|
|
343
344
|
rows: n.rows,
|
|
344
|
-
style: ae(
|
|
345
|
+
style: ae(L.value),
|
|
345
346
|
class: u(s(a).e("inner")),
|
|
346
|
-
onInput:
|
|
347
|
-
onChange:
|
|
348
|
-
onFocus:
|
|
349
|
-
onBlur:
|
|
350
|
-
}, null, 46,
|
|
351
|
-
[
|
|
347
|
+
onInput: x,
|
|
348
|
+
onChange: C,
|
|
349
|
+
onFocus: I,
|
|
350
|
+
onBlur: d
|
|
351
|
+
}, null, 46, Ue), [
|
|
352
|
+
[Te, w.value]
|
|
352
353
|
]),
|
|
353
|
-
n.showWordLimit && n.maxlength ? (
|
|
354
|
+
n.showWordLimit && n.maxlength ? (i(), c("span", {
|
|
354
355
|
key: 0,
|
|
355
356
|
class: u(s(a).e("count"))
|
|
356
|
-
},
|
|
357
|
+
}, z(k.value) + "/" + z(n.maxlength), 3)) : N("", !0)
|
|
357
358
|
], 6));
|
|
358
359
|
}
|
|
359
|
-
}),
|
|
360
|
+
}), ol = /* @__PURE__ */ Z({
|
|
360
361
|
name: "XSwitch",
|
|
361
362
|
__name: "index",
|
|
362
363
|
props: {
|
|
@@ -370,7 +371,7 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
370
371
|
},
|
|
371
372
|
emits: ["update:modelValue", "change"],
|
|
372
373
|
setup(n, { emit: p }) {
|
|
373
|
-
const e = n, t = p, l =
|
|
374
|
+
const e = n, t = p, l = Q("switch"), a = h(() => e.modelValue === e.activeValue), g = h(() => [
|
|
374
375
|
l.b(),
|
|
375
376
|
l.is("disabled", e.disabled),
|
|
376
377
|
l.is("checked", a.value)
|
|
@@ -378,28 +379,28 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
378
379
|
width: typeof e.width == "number" ? `${e.width}px` : e.width,
|
|
379
380
|
height: "20px",
|
|
380
381
|
backgroundColor: a.value ? e.activeColor : e.inactiveColor
|
|
381
|
-
})),
|
|
382
|
+
})), w = () => {
|
|
382
383
|
if (e.disabled) return;
|
|
383
|
-
const
|
|
384
|
-
t("update:modelValue",
|
|
384
|
+
const k = a.value ? e.inactiveValue : e.activeValue;
|
|
385
|
+
t("update:modelValue", k), t("change", k);
|
|
385
386
|
};
|
|
386
|
-
return (
|
|
387
|
-
class: u(
|
|
388
|
-
onClick:
|
|
387
|
+
return (k, L) => (i(), c("span", {
|
|
388
|
+
class: u(g.value),
|
|
389
|
+
onClick: w
|
|
389
390
|
}, [
|
|
390
391
|
f("span", {
|
|
391
392
|
class: u(s(l).e("core")),
|
|
392
393
|
style: ae(v.value)
|
|
393
394
|
}, null, 6),
|
|
394
|
-
|
|
395
|
+
k.$slots.default ? (i(), c("span", {
|
|
395
396
|
key: 0,
|
|
396
397
|
class: u(s(l).e("text"))
|
|
397
398
|
}, [
|
|
398
|
-
le(
|
|
399
|
-
], 2)) :
|
|
399
|
+
le(k.$slots, "default")
|
|
400
|
+
], 2)) : N("", !0)
|
|
400
401
|
], 2));
|
|
401
402
|
}
|
|
402
|
-
}),
|
|
403
|
+
}), We = ["checked", "disabled", "name", "value"], rl = /* @__PURE__ */ Z({
|
|
403
404
|
name: "XRadio",
|
|
404
405
|
__name: "index",
|
|
405
406
|
props: {
|
|
@@ -411,39 +412,39 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
411
412
|
},
|
|
412
413
|
emits: ["update:modelValue", "change"],
|
|
413
414
|
setup(n, { emit: p }) {
|
|
414
|
-
const e = n, t = p, l =
|
|
415
|
+
const e = n, t = p, l = Q("radio"), a = we("radioGroup", null), g = h(() => !!a), v = h(() => g.value ? a.modelValue.value : e.modelValue), w = h(() => e.value ?? e.label), k = h(() => v.value === w.value), L = h(() => e.disabled || g.value && a.disabled), D = h(() => e.name || (g.value ? a.name : void 0)), x = h(() => [
|
|
415
416
|
l.b(),
|
|
416
|
-
l.is("checked",
|
|
417
|
-
l.is("disabled",
|
|
418
|
-
]),
|
|
419
|
-
|
|
417
|
+
l.is("checked", k.value),
|
|
418
|
+
l.is("disabled", L.value)
|
|
419
|
+
]), C = () => {
|
|
420
|
+
L.value || (g.value ? a.changeValue(w.value) : (t("update:modelValue", w.value), t("change", w.value)));
|
|
420
421
|
};
|
|
421
|
-
return (
|
|
422
|
-
class: u(
|
|
423
|
-
onClick: ue(
|
|
422
|
+
return (I, d) => (i(), c("label", {
|
|
423
|
+
class: u(x.value),
|
|
424
|
+
onClick: ue(C, ["prevent"])
|
|
424
425
|
}, [
|
|
425
426
|
f("span", {
|
|
426
427
|
class: u(s(l).e("input"))
|
|
427
428
|
}, [
|
|
428
429
|
f("input", {
|
|
429
430
|
type: "radio",
|
|
430
|
-
checked:
|
|
431
|
-
disabled:
|
|
432
|
-
name:
|
|
433
|
-
value:
|
|
434
|
-
}, null, 8,
|
|
431
|
+
checked: k.value,
|
|
432
|
+
disabled: L.value,
|
|
433
|
+
name: D.value,
|
|
434
|
+
value: w.value
|
|
435
|
+
}, null, 8, We)
|
|
435
436
|
], 2),
|
|
436
|
-
|
|
437
|
+
I.$slots.default || n.label ? (i(), c("span", {
|
|
437
438
|
key: 0,
|
|
438
439
|
class: u(s(l).e("label"))
|
|
439
440
|
}, [
|
|
440
|
-
le(
|
|
441
|
-
|
|
441
|
+
le(I.$slots, "default", {}, () => [
|
|
442
|
+
fe(z(n.label), 1)
|
|
442
443
|
])
|
|
443
|
-
], 2)) :
|
|
444
|
+
], 2)) : N("", !0)
|
|
444
445
|
], 2));
|
|
445
446
|
}
|
|
446
|
-
}),
|
|
447
|
+
}), il = /* @__PURE__ */ Z({
|
|
447
448
|
name: "XRadioGroup",
|
|
448
449
|
__name: "group",
|
|
449
450
|
props: {
|
|
@@ -453,22 +454,22 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
453
454
|
},
|
|
454
455
|
emits: ["update:modelValue", "change"],
|
|
455
456
|
setup(n, { emit: p }) {
|
|
456
|
-
const e = n, t = p, l =
|
|
457
|
-
t("update:modelValue",
|
|
457
|
+
const e = n, t = p, l = Q("radio-group"), a = (g) => {
|
|
458
|
+
t("update:modelValue", g), t("change", g);
|
|
458
459
|
};
|
|
459
|
-
return
|
|
460
|
+
return Ve("radioGroup", {
|
|
460
461
|
modelValue: h(() => e.modelValue),
|
|
461
462
|
name: e.name || `radio-group-${Date.now()}`,
|
|
462
463
|
disabled: e.disabled,
|
|
463
464
|
changeValue: a
|
|
464
|
-
}), (
|
|
465
|
+
}), (g, v) => (i(), c("div", {
|
|
465
466
|
class: u(s(l).b()),
|
|
466
467
|
role: "radiogroup"
|
|
467
468
|
}, [
|
|
468
|
-
le(
|
|
469
|
+
le(g.$slots, "default")
|
|
469
470
|
], 2));
|
|
470
471
|
}
|
|
471
|
-
}),
|
|
472
|
+
}), Ge = ["checked", "disabled", "value"], cl = /* @__PURE__ */ Z({
|
|
472
473
|
name: "XRadioButton",
|
|
473
474
|
__name: "button",
|
|
474
475
|
props: {
|
|
@@ -479,34 +480,34 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
479
480
|
},
|
|
480
481
|
emits: ["update:modelValue", "change"],
|
|
481
482
|
setup(n, { emit: p }) {
|
|
482
|
-
const e = n, t =
|
|
483
|
+
const e = n, t = Q("radio-button"), l = we("radioGroup", null), a = h(() => !!l), g = h(() => a.value ? l.modelValue.value : null), v = h(() => e.value ?? e.label), w = h(() => g.value === v.value), k = h(() => e.disabled || a.value && l.disabled), L = h(() => [
|
|
483
484
|
t.b(),
|
|
484
|
-
t.is("active",
|
|
485
|
-
t.is("disabled",
|
|
486
|
-
]),
|
|
487
|
-
|
|
485
|
+
t.is("active", w.value),
|
|
486
|
+
t.is("disabled", k.value)
|
|
487
|
+
]), D = () => {
|
|
488
|
+
k.value || a.value && l.changeValue(v.value);
|
|
488
489
|
};
|
|
489
|
-
return (
|
|
490
|
-
class: u(
|
|
491
|
-
onClick: ue(
|
|
490
|
+
return (x, C) => (i(), c("label", {
|
|
491
|
+
class: u(L.value),
|
|
492
|
+
onClick: ue(D, ["prevent"])
|
|
492
493
|
}, [
|
|
493
494
|
f("input", {
|
|
494
495
|
type: "radio",
|
|
495
|
-
checked:
|
|
496
|
-
disabled:
|
|
496
|
+
checked: w.value,
|
|
497
|
+
disabled: k.value,
|
|
497
498
|
value: v.value,
|
|
498
499
|
class: u(s(t).e("input"))
|
|
499
|
-
}, null, 10,
|
|
500
|
+
}, null, 10, Ge),
|
|
500
501
|
f("span", {
|
|
501
502
|
class: u(s(t).e("inner"))
|
|
502
503
|
}, [
|
|
503
|
-
le(
|
|
504
|
-
|
|
504
|
+
le(x.$slots, "default", {}, () => [
|
|
505
|
+
fe(z(n.label), 1)
|
|
505
506
|
])
|
|
506
507
|
], 2)
|
|
507
508
|
], 2));
|
|
508
509
|
}
|
|
509
|
-
}),
|
|
510
|
+
}), qe = ["checked", "disabled", "name", "value"], dl = /* @__PURE__ */ Z({
|
|
510
511
|
name: "XCheckbox",
|
|
511
512
|
__name: "index",
|
|
512
513
|
props: {
|
|
@@ -519,58 +520,58 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
519
520
|
},
|
|
520
521
|
emits: ["update:modelValue", "change"],
|
|
521
522
|
setup(n, { emit: p }) {
|
|
522
|
-
const e = n, t = p, l =
|
|
523
|
+
const e = n, t = p, l = Q("checkbox"), a = we("checkboxGroup", null), g = h(() => !!a), v = h(() => e.value ?? e.label), w = h(() => g.value ? a.modelValue.value.includes(v.value) : Array.isArray(e.modelValue) ? e.modelValue.includes(v.value) : !!e.modelValue), k = h(() => {
|
|
523
524
|
if (e.disabled) return !0;
|
|
524
|
-
if (
|
|
525
|
-
const
|
|
526
|
-
return
|
|
525
|
+
if (g.value) {
|
|
526
|
+
const x = a.disabled, C = a.min > 0 && a.modelValue.value.length <= a.min, I = a.max > 0 && a.modelValue.value.length >= a.max;
|
|
527
|
+
return w.value && C || !w.value && I ? !0 : x;
|
|
527
528
|
}
|
|
528
529
|
return !1;
|
|
529
|
-
}),
|
|
530
|
+
}), L = h(() => [
|
|
530
531
|
l.b(),
|
|
531
|
-
l.is("checked",
|
|
532
|
-
l.is("disabled",
|
|
533
|
-
l.is("indeterminate", e.indeterminate && !
|
|
534
|
-
]),
|
|
535
|
-
if (!
|
|
536
|
-
if (
|
|
532
|
+
l.is("checked", w.value),
|
|
533
|
+
l.is("disabled", k.value),
|
|
534
|
+
l.is("indeterminate", e.indeterminate && !w.value)
|
|
535
|
+
]), D = () => {
|
|
536
|
+
if (!k.value)
|
|
537
|
+
if (g.value)
|
|
537
538
|
a.changeValue(v.value);
|
|
538
539
|
else {
|
|
539
|
-
let
|
|
540
|
+
let x;
|
|
540
541
|
if (Array.isArray(e.modelValue)) {
|
|
541
|
-
const
|
|
542
|
-
|
|
542
|
+
const C = e.modelValue.indexOf(v.value);
|
|
543
|
+
C > -1 ? x = [...e.modelValue.slice(0, C), ...e.modelValue.slice(C + 1)] : x = [...e.modelValue, v.value];
|
|
543
544
|
} else
|
|
544
|
-
|
|
545
|
-
t("update:modelValue",
|
|
545
|
+
x = !e.modelValue;
|
|
546
|
+
t("update:modelValue", x), t("change", x);
|
|
546
547
|
}
|
|
547
548
|
};
|
|
548
|
-
return (
|
|
549
|
-
class: u(
|
|
550
|
-
onClick: ue(
|
|
549
|
+
return (x, C) => (i(), c("label", {
|
|
550
|
+
class: u(L.value),
|
|
551
|
+
onClick: ue(D, ["prevent"])
|
|
551
552
|
}, [
|
|
552
553
|
f("span", {
|
|
553
554
|
class: u(s(l).e("input"))
|
|
554
555
|
}, [
|
|
555
556
|
f("input", {
|
|
556
557
|
type: "checkbox",
|
|
557
|
-
checked:
|
|
558
|
-
disabled:
|
|
558
|
+
checked: w.value,
|
|
559
|
+
disabled: k.value,
|
|
559
560
|
name: n.name,
|
|
560
561
|
value: v.value
|
|
561
|
-
}, null, 8,
|
|
562
|
+
}, null, 8, qe)
|
|
562
563
|
], 2),
|
|
563
|
-
|
|
564
|
+
x.$slots.default || n.label !== void 0 ? (i(), c("span", {
|
|
564
565
|
key: 0,
|
|
565
566
|
class: u(s(l).e("label"))
|
|
566
567
|
}, [
|
|
567
|
-
le(
|
|
568
|
-
|
|
568
|
+
le(x.$slots, "default", {}, () => [
|
|
569
|
+
fe(z(n.label), 1)
|
|
569
570
|
])
|
|
570
|
-
], 2)) :
|
|
571
|
+
], 2)) : N("", !0)
|
|
571
572
|
], 2));
|
|
572
573
|
}
|
|
573
|
-
}),
|
|
574
|
+
}), vl = /* @__PURE__ */ Z({
|
|
574
575
|
name: "XCheckboxGroup",
|
|
575
576
|
__name: "group",
|
|
576
577
|
props: {
|
|
@@ -581,24 +582,24 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
581
582
|
},
|
|
582
583
|
emits: ["update:modelValue", "change"],
|
|
583
584
|
setup(n, { emit: p }) {
|
|
584
|
-
const e = n, t = p, l =
|
|
585
|
-
const v = [...e.modelValue],
|
|
586
|
-
|
|
585
|
+
const e = n, t = p, l = Q("checkbox-group"), a = (g) => {
|
|
586
|
+
const v = [...e.modelValue], w = v.indexOf(g);
|
|
587
|
+
w > -1 ? v.splice(w, 1) : v.push(g), t("update:modelValue", v), t("change", v);
|
|
587
588
|
};
|
|
588
|
-
return
|
|
589
|
+
return Ve("checkboxGroup", {
|
|
589
590
|
modelValue: h(() => e.modelValue),
|
|
590
591
|
disabled: e.disabled,
|
|
591
592
|
min: e.min,
|
|
592
593
|
max: e.max,
|
|
593
594
|
changeValue: a
|
|
594
|
-
}), (
|
|
595
|
+
}), (g, v) => (i(), c("div", {
|
|
595
596
|
class: u(s(l).b()),
|
|
596
597
|
role: "group"
|
|
597
598
|
}, [
|
|
598
|
-
le(
|
|
599
|
+
le(g.$slots, "default")
|
|
599
600
|
], 2));
|
|
600
601
|
}
|
|
601
|
-
}),
|
|
602
|
+
}), fl = /* @__PURE__ */ Z({
|
|
602
603
|
name: "XForm",
|
|
603
604
|
__name: "index",
|
|
604
605
|
props: {
|
|
@@ -606,72 +607,78 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
606
607
|
rules: { default: () => ({}) },
|
|
607
608
|
labelWidth: { default: "100px" },
|
|
608
609
|
labelPosition: { default: "right" },
|
|
610
|
+
layout: { default: "horizontal" },
|
|
609
611
|
inline: { type: Boolean, default: !1 },
|
|
610
612
|
disabled: { type: Boolean, default: !1 },
|
|
611
613
|
size: { default: "default" }
|
|
612
614
|
},
|
|
613
|
-
emits: ["validate"],
|
|
615
|
+
emits: ["validate", "submit", "reset"],
|
|
614
616
|
setup(n, { expose: p, emit: e }) {
|
|
615
|
-
const t = n, l = e, a =
|
|
617
|
+
const t = n, l = e, a = Q("form"), g = E([]), v = h(() => t.layout === "inline" || t.inline), w = h(() => t.layout === "vertical" || t.labelPosition === "top"), k = h(() => [
|
|
616
618
|
a.b(),
|
|
617
|
-
a.m(`label-${t.labelPosition}`),
|
|
618
|
-
a.is("inline",
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
619
|
+
a.m(`label-${w.value ? "top" : t.labelPosition}`),
|
|
620
|
+
a.is("inline", v.value),
|
|
621
|
+
a.is("vertical", w.value)
|
|
622
|
+
]), L = h(() => ({ width: typeof t.labelWidth == "number" ? `${t.labelWidth}px` : t.labelWidth })), D = (b) => {
|
|
623
|
+
g.value.push(b);
|
|
624
|
+
}, x = (b) => {
|
|
625
|
+
const T = g.value.indexOf(b);
|
|
626
|
+
T > -1 && g.value.splice(T, 1);
|
|
624
627
|
}, C = async () => {
|
|
625
|
-
let
|
|
626
|
-
for (const
|
|
627
|
-
await
|
|
628
|
-
return
|
|
629
|
-
},
|
|
630
|
-
const
|
|
631
|
-
let
|
|
632
|
-
for (const
|
|
633
|
-
|
|
634
|
-
return
|
|
635
|
-
},
|
|
636
|
-
|
|
637
|
-
|
|
628
|
+
let b = !0;
|
|
629
|
+
for (const T of g.value)
|
|
630
|
+
await T.validate() || (b = !1);
|
|
631
|
+
return b;
|
|
632
|
+
}, I = async (b) => {
|
|
633
|
+
const T = Array.isArray(b) ? b : [b];
|
|
634
|
+
let B = !0;
|
|
635
|
+
for (const K of g.value)
|
|
636
|
+
T.includes(K.prop) && (await K.validate() || (B = !1));
|
|
637
|
+
return B;
|
|
638
|
+
}, d = () => {
|
|
639
|
+
g.value.forEach((b) => {
|
|
640
|
+
b.resetField();
|
|
638
641
|
});
|
|
639
|
-
},
|
|
640
|
-
if (
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
|
|
642
|
+
}, V = (b) => {
|
|
643
|
+
if (b) {
|
|
644
|
+
const T = Array.isArray(b) ? b : [b];
|
|
645
|
+
g.value.forEach((B) => {
|
|
646
|
+
T.includes(B.prop) && B.clearValidate();
|
|
644
647
|
});
|
|
645
648
|
} else
|
|
646
|
-
|
|
647
|
-
|
|
649
|
+
g.value.forEach((T) => {
|
|
650
|
+
T.clearValidate();
|
|
648
651
|
});
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
|
|
652
|
+
}, M = (b) => {
|
|
653
|
+
console.log("[XForm] handleSubmit triggered", b), b.preventDefault(), l("submit");
|
|
654
|
+
}, S = (b) => {
|
|
655
|
+
console.log("[XForm] handleReset triggered", b), b.preventDefault(), d(), l("reset");
|
|
656
|
+
}, P = He(t, "model");
|
|
657
|
+
return Ve("form", {
|
|
658
|
+
model: P,
|
|
652
659
|
rules: t.rules,
|
|
653
660
|
labelWidth: t.labelWidth,
|
|
654
|
-
labelPosition: t.labelPosition,
|
|
661
|
+
labelPosition: w.value ? "top" : t.labelPosition,
|
|
655
662
|
disabled: t.disabled,
|
|
656
663
|
size: t.size,
|
|
657
|
-
labelStyle:
|
|
658
|
-
addField:
|
|
659
|
-
removeField:
|
|
664
|
+
labelStyle: L,
|
|
665
|
+
addField: D,
|
|
666
|
+
removeField: x,
|
|
660
667
|
emit: l
|
|
661
668
|
}), p({
|
|
662
669
|
validate: C,
|
|
663
|
-
validateField:
|
|
664
|
-
resetFields:
|
|
665
|
-
clearValidate:
|
|
666
|
-
}), (
|
|
667
|
-
class: u(
|
|
668
|
-
onSubmit:
|
|
669
|
-
|
|
670
|
+
validateField: I,
|
|
671
|
+
resetFields: d,
|
|
672
|
+
clearValidate: V
|
|
673
|
+
}), (b, T) => (i(), c("form", {
|
|
674
|
+
class: u(k.value),
|
|
675
|
+
onSubmit: M,
|
|
676
|
+
onReset: S
|
|
670
677
|
}, [
|
|
671
|
-
le(
|
|
678
|
+
le(b.$slots, "default")
|
|
672
679
|
], 34));
|
|
673
680
|
}
|
|
674
|
-
}),
|
|
681
|
+
}), ml = /* @__PURE__ */ Z({
|
|
675
682
|
name: "XFormItem",
|
|
676
683
|
__name: "item",
|
|
677
684
|
props: {
|
|
@@ -683,140 +690,141 @@ const Ye = ["type", "placeholder", "disabled", "readonly", "maxlength", "minleng
|
|
|
683
690
|
showMessage: { type: Boolean }
|
|
684
691
|
},
|
|
685
692
|
setup(n, { expose: p }) {
|
|
686
|
-
const e = n, t =
|
|
687
|
-
const
|
|
688
|
-
return e.rules &&
|
|
689
|
-
},
|
|
693
|
+
const e = n, t = Q("form-item"), l = we("form", null), a = E(""), g = E(""), v = h(() => e.required ? !0 : w().some((M) => M.required)), w = () => {
|
|
694
|
+
const V = [];
|
|
695
|
+
return e.rules && V.push(...e.rules), l && e.prop && l.rules[e.prop] && V.push(...l.rules[e.prop]), V;
|
|
696
|
+
}, k = () => {
|
|
697
|
+
var V;
|
|
690
698
|
if (!(!l || !e.prop))
|
|
691
|
-
return l.model[e.prop];
|
|
692
|
-
},
|
|
693
|
-
!l || !e.prop || (l.model[e.prop] =
|
|
694
|
-
},
|
|
695
|
-
const M =
|
|
699
|
+
return (V = l.model.value) == null ? void 0 : V[e.prop];
|
|
700
|
+
}, L = (V) => {
|
|
701
|
+
!l || !e.prop || l.model.value && (l.model.value[e.prop] = V);
|
|
702
|
+
}, D = async (V) => {
|
|
703
|
+
const M = w();
|
|
696
704
|
if (M.length === 0)
|
|
697
705
|
return a.value = "valid", !0;
|
|
698
|
-
const
|
|
699
|
-
let
|
|
700
|
-
for (const
|
|
701
|
-
if (!(
|
|
702
|
-
if (
|
|
703
|
-
|
|
706
|
+
const S = k();
|
|
707
|
+
let P = !0, b = "";
|
|
708
|
+
for (const T of M)
|
|
709
|
+
if (!(V && T.trigger && T.trigger !== V)) {
|
|
710
|
+
if (T.required && (S == null || S === "" || Array.isArray(S) && S.length === 0)) {
|
|
711
|
+
P = !1, b = T.message || "该字段为必填项";
|
|
704
712
|
break;
|
|
705
713
|
}
|
|
706
|
-
if (
|
|
707
|
-
const
|
|
708
|
-
if (
|
|
709
|
-
|
|
714
|
+
if (T.min !== void 0 || T.max !== void 0) {
|
|
715
|
+
const B = typeof S == "string" ? S.length : 0;
|
|
716
|
+
if (T.min !== void 0 && B < T.min) {
|
|
717
|
+
P = !1, b = T.message || `长度不能小于 ${T.min} 个字符`;
|
|
710
718
|
break;
|
|
711
719
|
}
|
|
712
|
-
if (
|
|
713
|
-
|
|
720
|
+
if (T.max !== void 0 && B > T.max) {
|
|
721
|
+
P = !1, b = T.message || `长度不能大于 ${T.max} 个字符`;
|
|
714
722
|
break;
|
|
715
723
|
}
|
|
716
724
|
}
|
|
717
|
-
if (
|
|
718
|
-
|
|
725
|
+
if (T.pattern && S && !T.pattern.test(S)) {
|
|
726
|
+
P = !1, b = T.message || "格式不正确";
|
|
719
727
|
break;
|
|
720
728
|
}
|
|
721
|
-
if (
|
|
729
|
+
if (T.validator)
|
|
722
730
|
try {
|
|
723
|
-
await new Promise((
|
|
724
|
-
|
|
725
|
-
|
|
731
|
+
await new Promise((B, K) => {
|
|
732
|
+
T.validator(T, S, (X) => {
|
|
733
|
+
X ? K(X) : B();
|
|
726
734
|
});
|
|
727
735
|
});
|
|
728
|
-
} catch (
|
|
729
|
-
|
|
736
|
+
} catch (B) {
|
|
737
|
+
P = !1, b = B.message || T.message || "验证失败";
|
|
730
738
|
break;
|
|
731
739
|
}
|
|
732
740
|
}
|
|
733
|
-
return a.value =
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
},
|
|
737
|
-
a.value = "",
|
|
738
|
-
},
|
|
741
|
+
return a.value = P ? "valid" : "invalid", g.value = b, l && e.prop && l.emit("validate", e.prop, P, b), P;
|
|
742
|
+
}, x = () => {
|
|
743
|
+
L(void 0), C();
|
|
744
|
+
}, C = () => {
|
|
745
|
+
a.value = "", g.value = "";
|
|
746
|
+
}, I = h(() => [
|
|
739
747
|
t.b(),
|
|
740
748
|
t.is("required", v.value),
|
|
741
749
|
t.is("error", a.value === "invalid"),
|
|
742
750
|
t.is("success", a.value === "valid")
|
|
743
|
-
]),
|
|
744
|
-
const
|
|
745
|
-
return { width: typeof
|
|
751
|
+
]), d = h(() => {
|
|
752
|
+
const V = e.labelWidth ?? (l == null ? void 0 : l.labelWidth) ?? "100px";
|
|
753
|
+
return { width: typeof V == "number" ? `${V}px` : V };
|
|
746
754
|
});
|
|
747
|
-
return
|
|
748
|
-
a.value === "invalid" &&
|
|
749
|
-
}),
|
|
755
|
+
return ce(() => k(), () => {
|
|
756
|
+
a.value === "invalid" && D("change");
|
|
757
|
+
}), ye(() => {
|
|
750
758
|
l && e.prop && l.addField({
|
|
751
759
|
prop: e.prop,
|
|
752
|
-
validate:
|
|
753
|
-
resetField:
|
|
754
|
-
clearValidate:
|
|
760
|
+
validate: D,
|
|
761
|
+
resetField: x,
|
|
762
|
+
clearValidate: C
|
|
755
763
|
});
|
|
756
|
-
}),
|
|
764
|
+
}), ke(() => {
|
|
757
765
|
l && e.prop && l.removeField({
|
|
758
766
|
prop: e.prop,
|
|
759
|
-
validate:
|
|
760
|
-
resetField:
|
|
761
|
-
clearValidate:
|
|
767
|
+
validate: D,
|
|
768
|
+
resetField: x,
|
|
769
|
+
clearValidate: C
|
|
762
770
|
});
|
|
763
771
|
}), p({
|
|
764
|
-
validate:
|
|
765
|
-
resetField:
|
|
766
|
-
clearValidate:
|
|
767
|
-
}), (
|
|
768
|
-
class: u(
|
|
772
|
+
validate: D,
|
|
773
|
+
resetField: x,
|
|
774
|
+
clearValidate: C
|
|
775
|
+
}), (V, M) => (i(), c("div", {
|
|
776
|
+
class: u(I.value)
|
|
769
777
|
}, [
|
|
770
|
-
n.label ? (
|
|
778
|
+
n.label ? (i(), c("label", {
|
|
771
779
|
key: 0,
|
|
772
780
|
class: u(s(t).e("label")),
|
|
773
|
-
style: ae(
|
|
774
|
-
},
|
|
781
|
+
style: ae(d.value)
|
|
782
|
+
}, z(n.label), 7)) : N("", !0),
|
|
775
783
|
f("div", {
|
|
776
784
|
class: u(s(t).e("content"))
|
|
777
785
|
}, [
|
|
778
|
-
le(
|
|
779
|
-
n.showMessage !== !1 && a.value === "invalid" ? (
|
|
786
|
+
le(V.$slots, "default"),
|
|
787
|
+
n.showMessage !== !1 && a.value === "invalid" ? (i(), c("div", {
|
|
780
788
|
key: 0,
|
|
781
789
|
class: u(s(t).e("error"))
|
|
782
|
-
},
|
|
790
|
+
}, z(g.value), 3)) : N("", !0)
|
|
783
791
|
], 2)
|
|
784
792
|
], 2));
|
|
785
793
|
}
|
|
786
794
|
});
|
|
787
|
-
function
|
|
795
|
+
function je(n, p) {
|
|
788
796
|
return new Date(n, p + 1, 0).getDate();
|
|
789
797
|
}
|
|
790
|
-
function
|
|
798
|
+
function Ze(n, p) {
|
|
791
799
|
return new Date(n, p, 1).getDay();
|
|
792
800
|
}
|
|
793
|
-
function
|
|
801
|
+
function de(n, p) {
|
|
794
802
|
return !n || !p ? !1 : n.getFullYear() === p.getFullYear() && n.getMonth() === p.getMonth() && n.getDate() === p.getDate();
|
|
795
803
|
}
|
|
796
|
-
function
|
|
804
|
+
function Qe(n, p) {
|
|
797
805
|
return !n || !p ? !1 : n.getFullYear() === p.getFullYear() && n.getMonth() === p.getMonth();
|
|
798
806
|
}
|
|
799
|
-
function
|
|
807
|
+
function Pe(n, p, e) {
|
|
800
808
|
if (!p || !e) return !1;
|
|
801
809
|
const t = n.getTime();
|
|
802
810
|
return t >= p.getTime() && t <= e.getTime();
|
|
803
811
|
}
|
|
804
|
-
function
|
|
805
|
-
const t = [], l =
|
|
806
|
-
let
|
|
812
|
+
function Je(n, p, e = 0) {
|
|
813
|
+
const t = [], l = je(n, p), a = Ze(n, p);
|
|
814
|
+
let g = new Date(n, p, 1);
|
|
807
815
|
const v = (a - e + 7) % 7;
|
|
808
|
-
|
|
809
|
-
let
|
|
810
|
-
for (; (
|
|
816
|
+
g.setDate(1 - v);
|
|
817
|
+
let w = [], k = new Date(g);
|
|
818
|
+
for (; (k.getMonth() <= p || k.getMonth() === p && k.getDate() <= l) && (w.push(new Date(k)), !(w.length === 7 && (t.push(w), w = [], k.getMonth() > p) || (k.setDate(k.getDate() + 1), t.length > 7))); )
|
|
811
819
|
;
|
|
812
|
-
return
|
|
820
|
+
return w.length > 0 && t.push(w), t;
|
|
813
821
|
}
|
|
814
|
-
function
|
|
822
|
+
function ie(n, p = "YYYY-MM-DD") {
|
|
815
823
|
if (!n) return "";
|
|
816
|
-
const e = n.getFullYear(), t = n.getMonth() + 1, l = n.getDate(), a = n.getHours(),
|
|
817
|
-
return p.replace(/YYYY/g, String(e)).replace(/YY/g, String(e).slice(-2)).replace(/MM/g, String(t).padStart(2, "0")).replace(/M/g, String(t)).replace(/DD/g, String(l).padStart(2, "0")).replace(/D/g, String(l)).replace(/HH/g, String(a).padStart(2, "0")).replace(/H/g, String(a)).replace(/mm/g, String(
|
|
824
|
+
const e = n.getFullYear(), t = n.getMonth() + 1, l = n.getDate(), a = n.getHours(), g = n.getMinutes(), v = n.getSeconds();
|
|
825
|
+
return p.replace(/YYYY/g, String(e)).replace(/YY/g, String(e).slice(-2)).replace(/MM/g, String(t).padStart(2, "0")).replace(/M/g, String(t)).replace(/DD/g, String(l).padStart(2, "0")).replace(/D/g, String(l)).replace(/HH/g, String(a).padStart(2, "0")).replace(/H/g, String(a)).replace(/mm/g, String(g).padStart(2, "0")).replace(/m/g, String(g)).replace(/ss/g, String(v).padStart(2, "0")).replace(/s/g, String(v));
|
|
818
826
|
}
|
|
819
|
-
function
|
|
827
|
+
function be(n) {
|
|
820
828
|
if (!n) return null;
|
|
821
829
|
if (n instanceof Date)
|
|
822
830
|
return isNaN(n.getTime()) ? null : n;
|
|
@@ -829,37 +837,37 @@ function he(n) {
|
|
|
829
837
|
}
|
|
830
838
|
return p;
|
|
831
839
|
}
|
|
832
|
-
function
|
|
840
|
+
function _e(n) {
|
|
833
841
|
const p = new Date(n);
|
|
834
842
|
return p.setMonth(p.getMonth() - 1), p;
|
|
835
843
|
}
|
|
836
|
-
function
|
|
844
|
+
function et(n) {
|
|
837
845
|
const p = new Date(n);
|
|
838
846
|
return p.setMonth(p.getMonth() + 1), p;
|
|
839
847
|
}
|
|
840
|
-
function
|
|
848
|
+
function tt(n) {
|
|
841
849
|
const p = new Date(n);
|
|
842
850
|
return p.setFullYear(p.getFullYear() - 1), p;
|
|
843
851
|
}
|
|
844
|
-
function
|
|
852
|
+
function lt(n) {
|
|
845
853
|
const p = new Date(n);
|
|
846
854
|
return p.setFullYear(p.getFullYear() + 1), p;
|
|
847
855
|
}
|
|
848
|
-
function
|
|
856
|
+
function Ee(n) {
|
|
849
857
|
const p = Math.floor(n / 10) * 10;
|
|
850
858
|
return [p, p + 9];
|
|
851
859
|
}
|
|
852
|
-
function
|
|
860
|
+
function Se(n) {
|
|
853
861
|
const p = new Date(n);
|
|
854
862
|
return p.setHours(0, 0, 0, 0), p;
|
|
855
863
|
}
|
|
856
|
-
function
|
|
864
|
+
function at(n, p, e, t) {
|
|
857
865
|
if (p && p(n))
|
|
858
866
|
return !0;
|
|
859
|
-
const l =
|
|
860
|
-
return !!(e && l <
|
|
867
|
+
const l = Se(n).getTime();
|
|
868
|
+
return !!(e && l < Se(e).getTime() || t && l > Se(t).getTime());
|
|
861
869
|
}
|
|
862
|
-
const
|
|
870
|
+
const nt = [
|
|
863
871
|
"一月",
|
|
864
872
|
"二月",
|
|
865
873
|
"三月",
|
|
@@ -872,7 +880,7 @@ const tt = [
|
|
|
872
880
|
"十月",
|
|
873
881
|
"十一月",
|
|
874
882
|
"十二月"
|
|
875
|
-
],
|
|
883
|
+
], st = ["日", "一", "二", "三", "四", "五", "六"], ut = ["onClick", "onMouseenter"], ot = /* @__PURE__ */ Z({
|
|
876
884
|
name: "XDateTable",
|
|
877
885
|
__name: "DateTable",
|
|
878
886
|
props: {
|
|
@@ -890,78 +898,78 @@ const tt = [
|
|
|
890
898
|
},
|
|
891
899
|
emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
|
|
892
900
|
setup(n, { emit: p }) {
|
|
893
|
-
const e = n, t = p, l =
|
|
901
|
+
const e = n, t = p, l = Q("date-table"), a = E(null), g = h(() => e.viewedMonth.getFullYear()), v = h(() => e.viewedMonth.getMonth()), w = h(() => Je(g.value, v.value, 0)), k = (b) => e.modelValue ? de(b, e.modelValue) : !1, L = (b) => de(b, /* @__PURE__ */ new Date()), D = (b) => Qe(b, e.viewedMonth), x = (b) => {
|
|
894
902
|
if (e.selectionMode !== "range") return !1;
|
|
895
|
-
const { startDate:
|
|
896
|
-
if (
|
|
897
|
-
const
|
|
898
|
-
if (
|
|
899
|
-
const q =
|
|
900
|
-
return
|
|
903
|
+
const { startDate: T, endDate: B, selecting: K } = e.rangeState || {};
|
|
904
|
+
if (K && T) {
|
|
905
|
+
const X = a.value;
|
|
906
|
+
if (X) {
|
|
907
|
+
const q = T < X ? T : X, J = T < X ? X : T;
|
|
908
|
+
return Pe(b, q, J);
|
|
901
909
|
}
|
|
902
|
-
return
|
|
910
|
+
return de(b, T);
|
|
903
911
|
}
|
|
904
|
-
return
|
|
905
|
-
},
|
|
912
|
+
return T && B ? Pe(b, T, B) : !1;
|
|
913
|
+
}, C = (b) => {
|
|
906
914
|
if (e.selectionMode !== "range") return !1;
|
|
907
|
-
const { startDate:
|
|
908
|
-
return
|
|
909
|
-
},
|
|
915
|
+
const { startDate: T, selecting: B } = e.rangeState || {};
|
|
916
|
+
return B && T && a.value ? de(b, T < a.value ? T : a.value) : T ? de(b, T) : !1;
|
|
917
|
+
}, I = (b) => {
|
|
910
918
|
if (e.selectionMode !== "range") return !1;
|
|
911
|
-
const { endDate:
|
|
912
|
-
if (
|
|
913
|
-
const { startDate:
|
|
914
|
-
return
|
|
919
|
+
const { endDate: T, selecting: B } = e.rangeState || {};
|
|
920
|
+
if (B && a.value) {
|
|
921
|
+
const { startDate: K } = e.rangeState || {};
|
|
922
|
+
return de(b, K < a.value ? a.value : K);
|
|
915
923
|
}
|
|
916
|
-
return
|
|
917
|
-
},
|
|
924
|
+
return T ? de(b, T) : !1;
|
|
925
|
+
}, d = (b) => at(b, e.disabledDate, e.minDate, e.maxDate), V = (b) => [
|
|
918
926
|
l.e("cell"),
|
|
919
|
-
l.is("selected",
|
|
920
|
-
l.is("today",
|
|
921
|
-
l.is("disabled",
|
|
922
|
-
l.is("in-range",
|
|
923
|
-
l.is("range-start", b
|
|
924
|
-
l.is("range-end",
|
|
925
|
-
l.is("prev-month", !
|
|
926
|
-
l.is("next-month", !
|
|
927
|
-
], M = (
|
|
928
|
-
|
|
929
|
-
},
|
|
930
|
-
a.value =
|
|
931
|
-
},
|
|
927
|
+
l.is("selected", k(b)),
|
|
928
|
+
l.is("today", L(b)),
|
|
929
|
+
l.is("disabled", d(b)),
|
|
930
|
+
l.is("in-range", x(b)),
|
|
931
|
+
l.is("range-start", C(b)),
|
|
932
|
+
l.is("range-end", I(b)),
|
|
933
|
+
l.is("prev-month", !D(b) && b.getMonth() < v.value),
|
|
934
|
+
l.is("next-month", !D(b) && b.getMonth() > v.value)
|
|
935
|
+
], M = (b) => {
|
|
936
|
+
d(b) || (e.selectionMode === "range" ? t("range-select", b) : t("pick", b));
|
|
937
|
+
}, S = (b) => {
|
|
938
|
+
a.value = b;
|
|
939
|
+
}, P = () => {
|
|
932
940
|
a.value = null;
|
|
933
941
|
};
|
|
934
|
-
return (
|
|
942
|
+
return (b, T) => (i(), c("table", {
|
|
935
943
|
class: u(s(l).b()),
|
|
936
944
|
cellspacing: "0",
|
|
937
945
|
cellpadding: "0"
|
|
938
946
|
}, [
|
|
939
947
|
f("thead", null, [
|
|
940
948
|
f("tr", null, [
|
|
941
|
-
(
|
|
942
|
-
key:
|
|
949
|
+
(i(!0), c(j, null, _(s(st), (B) => (i(), c("th", {
|
|
950
|
+
key: B,
|
|
943
951
|
class: u(s(l).e("header-cell"))
|
|
944
|
-
},
|
|
952
|
+
}, z(B), 3))), 128))
|
|
945
953
|
])
|
|
946
954
|
]),
|
|
947
955
|
f("tbody", null, [
|
|
948
|
-
(
|
|
949
|
-
(
|
|
956
|
+
(i(!0), c(j, null, _(w.value, (B, K) => (i(), c("tr", { key: K }, [
|
|
957
|
+
(i(!0), c(j, null, _(B, (X, q) => (i(), c("td", {
|
|
950
958
|
key: q,
|
|
951
|
-
class: u(
|
|
952
|
-
onClick: (
|
|
953
|
-
onMouseenter: (
|
|
954
|
-
onMouseleave:
|
|
959
|
+
class: u(V(X)),
|
|
960
|
+
onClick: (J) => M(X),
|
|
961
|
+
onMouseenter: (J) => S(X),
|
|
962
|
+
onMouseleave: P
|
|
955
963
|
}, [
|
|
956
964
|
f("span", {
|
|
957
965
|
class: u(s(l).e("cell-text"))
|
|
958
|
-
},
|
|
959
|
-
], 42,
|
|
966
|
+
}, z(X.getDate()), 3)
|
|
967
|
+
], 42, ut))), 128))
|
|
960
968
|
]))), 128))
|
|
961
969
|
])
|
|
962
970
|
], 2));
|
|
963
971
|
}
|
|
964
|
-
}),
|
|
972
|
+
}), rt = ["onClick"], it = /* @__PURE__ */ Z({
|
|
965
973
|
name: "XMonthTable",
|
|
966
974
|
__name: "MonthTable",
|
|
967
975
|
props: {
|
|
@@ -971,49 +979,49 @@ const tt = [
|
|
|
971
979
|
},
|
|
972
980
|
emits: ["pick"],
|
|
973
981
|
setup(n, { emit: p }) {
|
|
974
|
-
const e = n, t = p, l =
|
|
982
|
+
const e = n, t = p, l = Q("month-table");
|
|
975
983
|
h(() => e.modelValue ? e.modelValue.getMonth() : -1);
|
|
976
|
-
const a = (
|
|
977
|
-
const
|
|
978
|
-
return
|
|
979
|
-
}, v = (
|
|
984
|
+
const a = (D) => e.modelValue ? e.modelValue.getFullYear() === e.viewedYear && e.modelValue.getMonth() === D : !1, g = (D) => {
|
|
985
|
+
const x = /* @__PURE__ */ new Date();
|
|
986
|
+
return x.getFullYear() === e.viewedYear && x.getMonth() === D;
|
|
987
|
+
}, v = (D) => {
|
|
980
988
|
if (!e.disabledDate) return !1;
|
|
981
|
-
const
|
|
982
|
-
return e.disabledDate(
|
|
983
|
-
},
|
|
989
|
+
const x = new Date(e.viewedYear, D, 1), C = new Date(e.viewedYear, D + 1, 0);
|
|
990
|
+
return e.disabledDate(x) && e.disabledDate(C);
|
|
991
|
+
}, w = (D) => [
|
|
984
992
|
l.e("cell"),
|
|
985
|
-
l.is("selected", a(
|
|
986
|
-
l.is("current",
|
|
987
|
-
l.is("disabled", v(
|
|
988
|
-
],
|
|
989
|
-
v(
|
|
990
|
-
},
|
|
991
|
-
const
|
|
992
|
-
for (let
|
|
993
|
-
|
|
994
|
-
return
|
|
993
|
+
l.is("selected", a(D)),
|
|
994
|
+
l.is("current", g(D)),
|
|
995
|
+
l.is("disabled", v(D))
|
|
996
|
+
], k = (D) => {
|
|
997
|
+
v(D) || t("pick", D);
|
|
998
|
+
}, L = h(() => {
|
|
999
|
+
const D = [];
|
|
1000
|
+
for (let x = 0; x < 12; x += 3)
|
|
1001
|
+
D.push([x, x + 1, x + 2]);
|
|
1002
|
+
return D;
|
|
995
1003
|
});
|
|
996
|
-
return (
|
|
1004
|
+
return (D, x) => (i(), c("table", {
|
|
997
1005
|
class: u(s(l).b()),
|
|
998
1006
|
cellspacing: "0",
|
|
999
1007
|
cellpadding: "0"
|
|
1000
1008
|
}, [
|
|
1001
1009
|
f("tbody", null, [
|
|
1002
|
-
(
|
|
1003
|
-
(
|
|
1004
|
-
key:
|
|
1005
|
-
class: u(
|
|
1006
|
-
onClick: (
|
|
1010
|
+
(i(!0), c(j, null, _(L.value, (C, I) => (i(), c("tr", { key: I }, [
|
|
1011
|
+
(i(!0), c(j, null, _(C, (d) => (i(), c("td", {
|
|
1012
|
+
key: d,
|
|
1013
|
+
class: u(w(d)),
|
|
1014
|
+
onClick: (V) => k(d)
|
|
1007
1015
|
}, [
|
|
1008
1016
|
f("span", {
|
|
1009
1017
|
class: u(s(l).e("cell-text"))
|
|
1010
|
-
},
|
|
1011
|
-
], 10,
|
|
1018
|
+
}, z(s(nt)[d]), 3)
|
|
1019
|
+
], 10, rt))), 128))
|
|
1012
1020
|
]))), 128))
|
|
1013
1021
|
])
|
|
1014
1022
|
], 2));
|
|
1015
1023
|
}
|
|
1016
|
-
}),
|
|
1024
|
+
}), ct = ["onClick"], dt = /* @__PURE__ */ Z({
|
|
1017
1025
|
name: "XYearTable",
|
|
1018
1026
|
__name: "YearTable",
|
|
1019
1027
|
props: {
|
|
@@ -1023,58 +1031,59 @@ const tt = [
|
|
|
1023
1031
|
},
|
|
1024
1032
|
emits: ["pick"],
|
|
1025
1033
|
setup(n, { emit: p }) {
|
|
1026
|
-
const e = n, t = p, l =
|
|
1027
|
-
const [
|
|
1028
|
-
|
|
1034
|
+
const e = n, t = p, l = Q("year-table"), a = h(() => (/* @__PURE__ */ new Date()).getFullYear()), g = h(() => Ee(e.viewedYear)), v = h(() => {
|
|
1035
|
+
const [d] = g.value, V = [];
|
|
1036
|
+
V.push(d - 1);
|
|
1029
1037
|
for (let M = 0; M < 10; M++)
|
|
1030
|
-
|
|
1031
|
-
return
|
|
1032
|
-
}),
|
|
1033
|
-
const
|
|
1034
|
-
for (let
|
|
1035
|
-
|
|
1036
|
-
return
|
|
1037
|
-
}),
|
|
1038
|
-
const [
|
|
1039
|
-
return
|
|
1040
|
-
},
|
|
1038
|
+
V.push(d + M);
|
|
1039
|
+
return V.push(d + 10), V;
|
|
1040
|
+
}), w = h(() => {
|
|
1041
|
+
const d = [];
|
|
1042
|
+
for (let V = 0; V < v.value.length; V += 3)
|
|
1043
|
+
d.push(v.value.slice(V, V + 3));
|
|
1044
|
+
return d;
|
|
1045
|
+
}), k = (d) => e.modelValue ? e.modelValue.getFullYear() === d : !1, L = (d) => d === a.value, D = (d) => {
|
|
1046
|
+
const [V, M] = g.value;
|
|
1047
|
+
return d >= V && d <= M;
|
|
1048
|
+
}, x = (d) => {
|
|
1041
1049
|
if (!e.disabledDate) return !1;
|
|
1042
|
-
const
|
|
1043
|
-
return e.disabledDate(
|
|
1044
|
-
},
|
|
1050
|
+
const V = new Date(d, 0, 1), M = new Date(d, 11, 31);
|
|
1051
|
+
return e.disabledDate(V) && e.disabledDate(M);
|
|
1052
|
+
}, C = (d) => [
|
|
1045
1053
|
l.e("cell"),
|
|
1046
|
-
l.is("selected",
|
|
1047
|
-
l.is("current",
|
|
1048
|
-
l.is("disabled",
|
|
1049
|
-
l.is("in-decade",
|
|
1050
|
-
],
|
|
1051
|
-
|
|
1054
|
+
l.is("selected", k(d)),
|
|
1055
|
+
l.is("current", L(d)),
|
|
1056
|
+
l.is("disabled", x(d)),
|
|
1057
|
+
l.is("in-decade", D(d))
|
|
1058
|
+
], I = (d) => {
|
|
1059
|
+
x(d) || t("pick", d);
|
|
1052
1060
|
};
|
|
1053
|
-
return (
|
|
1061
|
+
return (d, V) => (i(), c("table", {
|
|
1054
1062
|
class: u(s(l).b()),
|
|
1055
1063
|
cellspacing: "0",
|
|
1056
1064
|
cellpadding: "0"
|
|
1057
1065
|
}, [
|
|
1058
1066
|
f("tbody", null, [
|
|
1059
|
-
(
|
|
1060
|
-
(
|
|
1061
|
-
key:
|
|
1062
|
-
class: u(
|
|
1063
|
-
onClick: (
|
|
1067
|
+
(i(!0), c(j, null, _(w.value, (M, S) => (i(), c("tr", { key: S }, [
|
|
1068
|
+
(i(!0), c(j, null, _(M, (P) => (i(), c("td", {
|
|
1069
|
+
key: P,
|
|
1070
|
+
class: u(C(P)),
|
|
1071
|
+
onClick: (b) => I(P)
|
|
1064
1072
|
}, [
|
|
1065
1073
|
f("span", {
|
|
1066
1074
|
class: u(s(l).e("cell-text"))
|
|
1067
|
-
},
|
|
1068
|
-
], 10,
|
|
1075
|
+
}, z(P), 3)
|
|
1076
|
+
], 10, ct))), 128))
|
|
1069
1077
|
]))), 128))
|
|
1070
1078
|
])
|
|
1071
1079
|
], 2));
|
|
1072
1080
|
}
|
|
1073
|
-
}),
|
|
1081
|
+
}), vt = ["placeholder", "disabled", "value"], ft = ["placeholder", "disabled", "value"], mt = ["placeholder", "disabled", "value"], pl = /* @__PURE__ */ Z({
|
|
1074
1082
|
name: "XDatePicker",
|
|
1075
1083
|
__name: "index",
|
|
1076
1084
|
props: {
|
|
1077
|
-
modelValue: { default:
|
|
1085
|
+
modelValue: { default: void 0 },
|
|
1086
|
+
value: { default: void 0 },
|
|
1078
1087
|
type: { default: "date" },
|
|
1079
1088
|
placeholder: { default: "请选择日期" },
|
|
1080
1089
|
startPlaceholder: { default: "开始日期" },
|
|
@@ -1089,180 +1098,183 @@ const tt = [
|
|
|
1089
1098
|
minDate: {},
|
|
1090
1099
|
maxDate: {}
|
|
1091
1100
|
},
|
|
1092
|
-
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
1101
|
+
emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
|
|
1093
1102
|
setup(n, { expose: p, emit: e }) {
|
|
1094
|
-
const t = n, l = e, a =
|
|
1103
|
+
const t = n, l = e, a = Q("date-picker"), g = E(!1), v = E(2e3), w = E(), k = () => t.modelValue !== void 0 ? t.modelValue : t.value !== void 0 ? t.value : null, L = (H) => {
|
|
1104
|
+
l("update:modelValue", H), l("update:value", H), l("change", H);
|
|
1105
|
+
}, D = E(), x = E(), C = E({
|
|
1095
1106
|
top: "0px",
|
|
1096
1107
|
left: "0px"
|
|
1097
|
-
}),
|
|
1108
|
+
}), I = () => Le().next(), d = E("date"), V = E(/* @__PURE__ */ new Date()), M = E({
|
|
1098
1109
|
selecting: !1,
|
|
1099
1110
|
startDate: null,
|
|
1100
1111
|
endDate: null
|
|
1101
|
-
}),
|
|
1102
|
-
|
|
1112
|
+
}), S = h(() => {
|
|
1113
|
+
const H = k();
|
|
1114
|
+
if (!H) return null;
|
|
1103
1115
|
if (t.type === "daterange") {
|
|
1104
|
-
const [
|
|
1105
|
-
return [
|
|
1116
|
+
const [G, se] = H;
|
|
1117
|
+
return [be(G), be(se)];
|
|
1106
1118
|
}
|
|
1107
|
-
return
|
|
1108
|
-
}),
|
|
1109
|
-
if (!Array.isArray(
|
|
1110
|
-
const [
|
|
1111
|
-
return
|
|
1112
|
-
}),
|
|
1113
|
-
if (!Array.isArray(
|
|
1114
|
-
const [,
|
|
1115
|
-
return
|
|
1116
|
-
}),
|
|
1119
|
+
return be(H);
|
|
1120
|
+
}), P = h(() => !S.value || Array.isArray(S.value) ? "" : ie(S.value, t.format)), b = h(() => {
|
|
1121
|
+
if (!Array.isArray(S.value)) return "";
|
|
1122
|
+
const [H] = S.value;
|
|
1123
|
+
return H ? ie(H, t.format) : "";
|
|
1124
|
+
}), T = h(() => {
|
|
1125
|
+
if (!Array.isArray(S.value)) return "";
|
|
1126
|
+
const [, H] = S.value;
|
|
1127
|
+
return H ? ie(H, t.format) : "";
|
|
1128
|
+
}), B = h(() => Array.isArray(S.value) ? null : S.value), K = h(() => V.value.getFullYear()), X = h(() => V.value.getMonth()), q = h(() => Ee(K.value)), J = h(() => d.value === "year" ? `${q.value[0]} 年 - ${q.value[1]} 年` : d.value === "month" ? `${K.value} 年` : `${K.value} 年 ${X.value + 1} 月`), $ = h(() => [
|
|
1117
1129
|
a.b(),
|
|
1118
1130
|
a.m(t.size),
|
|
1119
1131
|
a.is("disabled", t.disabled),
|
|
1120
1132
|
a.is("range", t.type === "daterange")
|
|
1121
|
-
]),
|
|
1133
|
+
]), R = h(() => [
|
|
1122
1134
|
a.e("input"),
|
|
1123
|
-
a.is("focus",
|
|
1124
|
-
a.is("has-value", !!
|
|
1125
|
-
]),
|
|
1126
|
-
t.disabled || t.readonly || (
|
|
1127
|
-
},
|
|
1128
|
-
|
|
1129
|
-
if (
|
|
1130
|
-
const
|
|
1131
|
-
let se =
|
|
1132
|
-
|
|
1135
|
+
a.is("focus", g.value),
|
|
1136
|
+
a.is("has-value", !!P.value || !!(b.value || T.value))
|
|
1137
|
+
]), y = () => {
|
|
1138
|
+
t.disabled || t.readonly || (g.value ? r() : o());
|
|
1139
|
+
}, o = () => {
|
|
1140
|
+
g.value = !0, v.value = I(), Ce(() => {
|
|
1141
|
+
if (w.value && D.value) {
|
|
1142
|
+
const H = w.value.getBoundingClientRect(), G = D.value.getBoundingClientRect();
|
|
1143
|
+
let se = H.bottom + 8, De = H.left;
|
|
1144
|
+
De + G.width > window.innerWidth && (De = window.innerWidth - G.width - 8), se + G.height > window.innerHeight && (se = H.top - G.height - 8), C.value = {
|
|
1133
1145
|
top: `${se}px`,
|
|
1134
|
-
left: `${
|
|
1146
|
+
left: `${De}px`
|
|
1135
1147
|
};
|
|
1136
1148
|
}
|
|
1137
1149
|
}), l("focus", {});
|
|
1138
|
-
},
|
|
1139
|
-
|
|
1140
|
-
},
|
|
1150
|
+
}, r = () => {
|
|
1151
|
+
g.value = !1, d.value = "date", l("blur", {});
|
|
1152
|
+
}, m = (H) => {
|
|
1141
1153
|
if (t.type === "date") {
|
|
1142
|
-
const G = t.valueFormat ?
|
|
1143
|
-
|
|
1154
|
+
const G = t.valueFormat ? ie(H, t.valueFormat) : H;
|
|
1155
|
+
L(G), r();
|
|
1144
1156
|
}
|
|
1145
|
-
},
|
|
1146
|
-
if (!
|
|
1147
|
-
|
|
1157
|
+
}, O = (H) => {
|
|
1158
|
+
if (!M.value.selecting)
|
|
1159
|
+
M.value.selecting = !0, M.value.startDate = H, M.value.endDate = null;
|
|
1148
1160
|
else {
|
|
1149
|
-
|
|
1150
|
-
const G = t.valueFormat ?
|
|
1151
|
-
|
|
1161
|
+
M.value.selecting = !1, M.value.startDate && H < M.value.startDate ? [M.value.startDate, M.value.endDate] = [H, M.value.startDate] : M.value.endDate = H;
|
|
1162
|
+
const G = t.valueFormat ? ie(M.value.startDate, t.valueFormat) : M.value.startDate, se = t.valueFormat ? ie(M.value.endDate, t.valueFormat) : M.value.endDate;
|
|
1163
|
+
L([G, se]), r();
|
|
1152
1164
|
}
|
|
1153
|
-
},
|
|
1154
|
-
if (
|
|
1155
|
-
const G = new Date(
|
|
1156
|
-
|
|
1165
|
+
}, te = (H) => {
|
|
1166
|
+
if (V.value = new Date(K.value, H, 1), t.type === "month") {
|
|
1167
|
+
const G = new Date(K.value, H, 1), se = t.valueFormat ? ie(G, t.valueFormat) : G;
|
|
1168
|
+
L(se), r();
|
|
1157
1169
|
} else
|
|
1158
|
-
|
|
1159
|
-
},
|
|
1160
|
-
if (
|
|
1161
|
-
const G = new Date(
|
|
1162
|
-
|
|
1170
|
+
d.value = "date";
|
|
1171
|
+
}, A = (H) => {
|
|
1172
|
+
if (V.value = new Date(H, X.value, 1), t.type === "year") {
|
|
1173
|
+
const G = new Date(H, 0, 1), se = t.valueFormat ? ie(G, t.valueFormat) : G;
|
|
1174
|
+
L(se), r();
|
|
1163
1175
|
} else
|
|
1164
|
-
|
|
1176
|
+
d.value = "month";
|
|
1165
1177
|
}, ee = () => {
|
|
1166
|
-
|
|
1167
|
-
}, P = () => {
|
|
1168
|
-
S.value = Qe(S.value);
|
|
1169
|
-
}, te = () => {
|
|
1170
|
-
b.value === "year" ? S.value = new Date(R.value - 10, H.value, 1) : S.value = Je(S.value);
|
|
1178
|
+
V.value = _e(V.value);
|
|
1171
1179
|
}, Y = () => {
|
|
1172
|
-
|
|
1173
|
-
},
|
|
1174
|
-
|
|
1175
|
-
},
|
|
1176
|
-
|
|
1180
|
+
V.value = et(V.value);
|
|
1181
|
+
}, re = () => {
|
|
1182
|
+
d.value === "year" ? V.value = new Date(K.value - 10, X.value, 1) : V.value = tt(V.value);
|
|
1183
|
+
}, ge = () => {
|
|
1184
|
+
d.value === "year" ? V.value = new Date(K.value + 10, X.value, 1) : V.value = lt(V.value);
|
|
1185
|
+
}, F = () => {
|
|
1186
|
+
d.value = "month";
|
|
1187
|
+
}, U = () => {
|
|
1188
|
+
d.value = "year";
|
|
1177
1189
|
}, W = () => {
|
|
1178
|
-
|
|
1190
|
+
L(null), l("clear"), M.value = {
|
|
1179
1191
|
selecting: !1,
|
|
1180
1192
|
startDate: null,
|
|
1181
1193
|
endDate: null
|
|
1182
1194
|
};
|
|
1183
|
-
}, ne = (
|
|
1184
|
-
if (!
|
|
1185
|
-
const G =
|
|
1186
|
-
|
|
1195
|
+
}, ne = (H) => {
|
|
1196
|
+
if (!w.value) return;
|
|
1197
|
+
const G = H.target;
|
|
1198
|
+
w.value.contains(G) || D.value && D.value.contains(G) || r();
|
|
1187
1199
|
};
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
(
|
|
1191
|
-
if (
|
|
1192
|
-
if (Array.isArray(
|
|
1193
|
-
const [G] =
|
|
1194
|
-
G && (
|
|
1195
|
-
} else
|
|
1200
|
+
ce(
|
|
1201
|
+
k,
|
|
1202
|
+
(H) => {
|
|
1203
|
+
if (H)
|
|
1204
|
+
if (Array.isArray(S.value)) {
|
|
1205
|
+
const [G] = S.value;
|
|
1206
|
+
G && (V.value = new Date(G));
|
|
1207
|
+
} else S.value && (V.value = new Date(S.value));
|
|
1196
1208
|
},
|
|
1197
1209
|
{ immediate: !0 }
|
|
1198
|
-
),
|
|
1199
|
-
|
|
1210
|
+
), ce(g, (H) => {
|
|
1211
|
+
H && (d.value = "date", t.type === "daterange" && (M.value = {
|
|
1200
1212
|
selecting: !1,
|
|
1201
|
-
startDate: Array.isArray(
|
|
1202
|
-
endDate: Array.isArray(
|
|
1213
|
+
startDate: Array.isArray(S.value) ? S.value[0] : null,
|
|
1214
|
+
endDate: Array.isArray(S.value) ? S.value[1] : null
|
|
1203
1215
|
}));
|
|
1204
1216
|
});
|
|
1205
|
-
const oe = (
|
|
1206
|
-
|
|
1217
|
+
const oe = (H) => {
|
|
1218
|
+
H.key === "Escape" && r();
|
|
1207
1219
|
};
|
|
1208
|
-
return
|
|
1220
|
+
return ye(() => {
|
|
1209
1221
|
document.addEventListener("click", ne), document.addEventListener("keydown", oe);
|
|
1210
|
-
}),
|
|
1222
|
+
}), ke(() => {
|
|
1211
1223
|
document.removeEventListener("click", ne), document.removeEventListener("keydown", oe);
|
|
1212
1224
|
}), p({
|
|
1213
1225
|
focus: () => {
|
|
1214
|
-
var
|
|
1215
|
-
return (
|
|
1226
|
+
var H;
|
|
1227
|
+
return (H = x.value) == null ? void 0 : H.focus();
|
|
1216
1228
|
},
|
|
1217
1229
|
blur: () => {
|
|
1218
|
-
var
|
|
1219
|
-
return (
|
|
1230
|
+
var H;
|
|
1231
|
+
return (H = x.value) == null ? void 0 : H.blur();
|
|
1220
1232
|
}
|
|
1221
|
-
}), (
|
|
1233
|
+
}), (H, G) => (i(), c("div", {
|
|
1222
1234
|
ref_key: "pickerRef",
|
|
1223
|
-
ref:
|
|
1224
|
-
class: u(
|
|
1235
|
+
ref: w,
|
|
1236
|
+
class: u($.value)
|
|
1225
1237
|
}, [
|
|
1226
|
-
n.type !== "daterange" ? (
|
|
1238
|
+
n.type !== "daterange" ? (i(), c("div", {
|
|
1227
1239
|
key: 0,
|
|
1228
|
-
class: u(
|
|
1229
|
-
onClick:
|
|
1240
|
+
class: u(R.value),
|
|
1241
|
+
onClick: y
|
|
1230
1242
|
}, [
|
|
1231
1243
|
f("input", {
|
|
1232
1244
|
ref_key: "inputRef",
|
|
1233
|
-
ref:
|
|
1245
|
+
ref: x,
|
|
1234
1246
|
type: "text",
|
|
1235
1247
|
placeholder: n.placeholder,
|
|
1236
1248
|
disabled: n.disabled,
|
|
1237
1249
|
readonly: !0,
|
|
1238
|
-
value:
|
|
1250
|
+
value: P.value,
|
|
1239
1251
|
class: u(s(a).e("input-inner"))
|
|
1240
|
-
}, null, 10,
|
|
1252
|
+
}, null, 10, vt),
|
|
1241
1253
|
f("span", {
|
|
1242
1254
|
class: u(s(a).e("suffix"))
|
|
1243
1255
|
}, [
|
|
1244
|
-
n.clearable &&
|
|
1256
|
+
n.clearable && P.value && !n.disabled ? (i(), c("span", {
|
|
1245
1257
|
key: 0,
|
|
1246
1258
|
class: u(s(a).e("clear")),
|
|
1247
1259
|
onClick: ue(W, ["stop"])
|
|
1248
|
-
}, " ✕ ", 2)) : (
|
|
1260
|
+
}, " ✕ ", 2)) : (i(), c("span", {
|
|
1249
1261
|
key: 1,
|
|
1250
1262
|
class: u(s(a).e("icon"))
|
|
1251
1263
|
}, "📅", 2))
|
|
1252
1264
|
], 2)
|
|
1253
|
-
], 2)) : (
|
|
1265
|
+
], 2)) : (i(), c("div", {
|
|
1254
1266
|
key: 1,
|
|
1255
|
-
class: u(
|
|
1256
|
-
onClick:
|
|
1267
|
+
class: u(R.value),
|
|
1268
|
+
onClick: y
|
|
1257
1269
|
}, [
|
|
1258
1270
|
f("input", {
|
|
1259
1271
|
type: "text",
|
|
1260
1272
|
placeholder: n.startPlaceholder,
|
|
1261
1273
|
disabled: n.disabled,
|
|
1262
1274
|
readonly: !0,
|
|
1263
|
-
value:
|
|
1275
|
+
value: b.value,
|
|
1264
1276
|
class: u(s(a).e("input-inner"))
|
|
1265
|
-
}, null, 10,
|
|
1277
|
+
}, null, 10, ft),
|
|
1266
1278
|
f("span", {
|
|
1267
1279
|
class: u(s(a).e("separator"))
|
|
1268
1280
|
}, "至", 2),
|
|
@@ -1271,28 +1283,28 @@ const tt = [
|
|
|
1271
1283
|
placeholder: n.endPlaceholder,
|
|
1272
1284
|
disabled: n.disabled,
|
|
1273
1285
|
readonly: !0,
|
|
1274
|
-
value:
|
|
1286
|
+
value: T.value,
|
|
1275
1287
|
class: u(s(a).e("input-inner"))
|
|
1276
|
-
}, null, 10,
|
|
1288
|
+
}, null, 10, mt),
|
|
1277
1289
|
f("span", {
|
|
1278
1290
|
class: u(s(a).e("suffix"))
|
|
1279
1291
|
}, [
|
|
1280
|
-
n.clearable && (
|
|
1292
|
+
n.clearable && (b.value || T.value) && !n.disabled ? (i(), c("span", {
|
|
1281
1293
|
key: 0,
|
|
1282
1294
|
class: u(s(a).e("clear")),
|
|
1283
1295
|
onClick: ue(W, ["stop"])
|
|
1284
|
-
}, " ✕ ", 2)) : (
|
|
1296
|
+
}, " ✕ ", 2)) : (i(), c("span", {
|
|
1285
1297
|
key: 1,
|
|
1286
1298
|
class: u(s(a).e("icon"))
|
|
1287
1299
|
}, "📅", 2))
|
|
1288
1300
|
], 2)
|
|
1289
1301
|
], 2)),
|
|
1290
|
-
(
|
|
1291
|
-
|
|
1292
|
-
default:
|
|
1293
|
-
|
|
1302
|
+
(i(), he(Re, { to: "body" }, [
|
|
1303
|
+
xe(Be, { name: "fade" }, {
|
|
1304
|
+
default: Fe(() => [
|
|
1305
|
+
ve(f("div", {
|
|
1294
1306
|
ref_key: "popperRef",
|
|
1295
|
-
ref:
|
|
1307
|
+
ref: D,
|
|
1296
1308
|
class: u(s(a).e("popper")),
|
|
1297
1309
|
style: ae({ zIndex: v.value, ...C.value })
|
|
1298
1310
|
}, [
|
|
@@ -1302,58 +1314,58 @@ const tt = [
|
|
|
1302
1314
|
f("button", {
|
|
1303
1315
|
type: "button",
|
|
1304
1316
|
class: u(s(a).e("prev-btn")),
|
|
1305
|
-
onClick: G[0] || (G[0] = (se) =>
|
|
1317
|
+
onClick: G[0] || (G[0] = (se) => d.value === "date" ? ee() : re())
|
|
1306
1318
|
}, " ‹ ", 2),
|
|
1307
1319
|
f("div", {
|
|
1308
1320
|
class: u(s(a).e("header-title"))
|
|
1309
1321
|
}, [
|
|
1310
|
-
|
|
1322
|
+
d.value === "year" ? (i(), c("span", {
|
|
1311
1323
|
key: 0,
|
|
1312
|
-
onClick: G[1] || (G[1] = (se) =>
|
|
1313
|
-
},
|
|
1314
|
-
f("span", { onClick:
|
|
1315
|
-
|
|
1324
|
+
onClick: G[1] || (G[1] = (se) => d.value = "month")
|
|
1325
|
+
}, z(J.value), 1)) : (i(), c(j, { key: 1 }, [
|
|
1326
|
+
f("span", { onClick: U }, z(K.value) + " 年", 1),
|
|
1327
|
+
d.value === "date" ? (i(), c("span", {
|
|
1316
1328
|
key: 0,
|
|
1317
|
-
onClick:
|
|
1318
|
-
},
|
|
1329
|
+
onClick: F
|
|
1330
|
+
}, z(X.value + 1) + " 月", 1)) : N("", !0)
|
|
1319
1331
|
], 64))
|
|
1320
1332
|
], 2),
|
|
1321
1333
|
f("button", {
|
|
1322
1334
|
type: "button",
|
|
1323
1335
|
class: u(s(a).e("next-btn")),
|
|
1324
|
-
onClick: G[2] || (G[2] = (se) =>
|
|
1336
|
+
onClick: G[2] || (G[2] = (se) => d.value === "date" ? Y() : ge())
|
|
1325
1337
|
}, " › ", 2)
|
|
1326
1338
|
], 2),
|
|
1327
1339
|
f("div", {
|
|
1328
1340
|
class: u(s(a).e("content"))
|
|
1329
1341
|
}, [
|
|
1330
|
-
|
|
1342
|
+
d.value === "date" ? (i(), he(ot, {
|
|
1331
1343
|
key: 0,
|
|
1332
|
-
"model-value":
|
|
1333
|
-
"viewed-month":
|
|
1344
|
+
"model-value": B.value,
|
|
1345
|
+
"viewed-month": V.value,
|
|
1334
1346
|
"disabled-date": n.disabledDate,
|
|
1335
|
-
"min-date": n.minDate ? s(
|
|
1336
|
-
"max-date": n.maxDate ? s(
|
|
1347
|
+
"min-date": n.minDate ? s(be)(n.minDate) : null,
|
|
1348
|
+
"max-date": n.maxDate ? s(be)(n.maxDate) : null,
|
|
1337
1349
|
"selection-mode": n.type === "daterange" ? "range" : "single",
|
|
1338
|
-
"range-state":
|
|
1339
|
-
onPick:
|
|
1340
|
-
onRangeSelect:
|
|
1341
|
-
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) :
|
|
1350
|
+
"range-state": M.value,
|
|
1351
|
+
onPick: m,
|
|
1352
|
+
onRangeSelect: O
|
|
1353
|
+
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : d.value === "month" ? (i(), he(it, {
|
|
1342
1354
|
key: 1,
|
|
1343
|
-
"model-value":
|
|
1344
|
-
"viewed-year":
|
|
1355
|
+
"model-value": B.value,
|
|
1356
|
+
"viewed-year": K.value,
|
|
1345
1357
|
"disabled-date": n.disabledDate,
|
|
1346
|
-
onPick:
|
|
1347
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) :
|
|
1358
|
+
onPick: te
|
|
1359
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : d.value === "year" ? (i(), he(dt, {
|
|
1348
1360
|
key: 2,
|
|
1349
|
-
"model-value":
|
|
1350
|
-
"viewed-year":
|
|
1361
|
+
"model-value": B.value,
|
|
1362
|
+
"viewed-year": K.value,
|
|
1351
1363
|
"disabled-date": n.disabledDate,
|
|
1352
|
-
onPick:
|
|
1353
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) :
|
|
1364
|
+
onPick: A
|
|
1365
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : N("", !0)
|
|
1354
1366
|
], 2)
|
|
1355
1367
|
], 6), [
|
|
1356
|
-
[
|
|
1368
|
+
[Ie, g.value]
|
|
1357
1369
|
])
|
|
1358
1370
|
]),
|
|
1359
1371
|
_: 1
|
|
@@ -1362,12 +1374,12 @@ const tt = [
|
|
|
1362
1374
|
], 2));
|
|
1363
1375
|
}
|
|
1364
1376
|
});
|
|
1365
|
-
function
|
|
1377
|
+
function me(n, p = "HH:mm:ss") {
|
|
1366
1378
|
if (!n) return "";
|
|
1367
1379
|
const e = n.getHours(), t = n.getMinutes(), l = n.getSeconds();
|
|
1368
1380
|
return p.replace(/HH/g, String(e).padStart(2, "0")).replace(/H/g, String(e)).replace(/mm/g, String(t).padStart(2, "0")).replace(/m/g, String(t)).replace(/ss/g, String(l).padStart(2, "0")).replace(/s/g, String(l));
|
|
1369
1381
|
}
|
|
1370
|
-
function
|
|
1382
|
+
function $e(n) {
|
|
1371
1383
|
if (!n) return null;
|
|
1372
1384
|
if (n instanceof Date)
|
|
1373
1385
|
return isNaN(n.getTime()) ? null : n;
|
|
@@ -1383,10 +1395,10 @@ function De(n) {
|
|
|
1383
1395
|
const e = new Date(n);
|
|
1384
1396
|
return isNaN(e.getTime()) ? null : e;
|
|
1385
1397
|
}
|
|
1386
|
-
function
|
|
1398
|
+
function pe(n) {
|
|
1387
1399
|
return String(n).padStart(2, "0");
|
|
1388
1400
|
}
|
|
1389
|
-
const
|
|
1401
|
+
const pt = ["onClick"], ht = ["onClick"], gt = ["onClick"], bt = /* @__PURE__ */ Z({
|
|
1390
1402
|
name: "XTimePanel",
|
|
1391
1403
|
__name: "TimePanel",
|
|
1392
1404
|
props: {
|
|
@@ -1401,68 +1413,68 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1401
1413
|
},
|
|
1402
1414
|
emits: ["confirm", "cancel"],
|
|
1403
1415
|
setup(n, { emit: p }) {
|
|
1404
|
-
const e = n, t = p, l =
|
|
1405
|
-
const
|
|
1406
|
-
for (let Y = 0; Y < 24; Y +=
|
|
1407
|
-
|
|
1408
|
-
return
|
|
1409
|
-
}),
|
|
1410
|
-
const
|
|
1411
|
-
for (let Y = 0; Y < 60; Y +=
|
|
1412
|
-
|
|
1413
|
-
return
|
|
1414
|
-
}),
|
|
1415
|
-
const
|
|
1416
|
-
for (let Y = 0; Y < 60; Y +=
|
|
1417
|
-
|
|
1418
|
-
return
|
|
1419
|
-
}),
|
|
1420
|
-
|
|
1421
|
-
},
|
|
1422
|
-
|
|
1423
|
-
},
|
|
1424
|
-
|
|
1425
|
-
}, q = (
|
|
1426
|
-
if (!
|
|
1427
|
-
const Y = 32,
|
|
1428
|
-
|
|
1429
|
-
},
|
|
1430
|
-
if (!
|
|
1431
|
-
const
|
|
1432
|
-
Y !== void 0 && !
|
|
1416
|
+
const e = n, t = p, l = Q("time-panel"), a = E(0), g = E(0), v = E(0), w = E(), k = E(), L = E(), D = h(() => e.format.includes("ss") || e.format.includes("s")), x = h(() => {
|
|
1417
|
+
const A = [], ee = Math.max(1, e.hourStep);
|
|
1418
|
+
for (let Y = 0; Y < 24; Y += ee)
|
|
1419
|
+
A.push(Y);
|
|
1420
|
+
return A;
|
|
1421
|
+
}), C = h(() => {
|
|
1422
|
+
const A = [], ee = Math.max(1, e.minuteStep);
|
|
1423
|
+
for (let Y = 0; Y < 60; Y += ee)
|
|
1424
|
+
A.push(Y);
|
|
1425
|
+
return A;
|
|
1426
|
+
}), I = h(() => {
|
|
1427
|
+
const A = [], ee = Math.max(1, e.secondStep);
|
|
1428
|
+
for (let Y = 0; Y < 60; Y += ee)
|
|
1429
|
+
A.push(Y);
|
|
1430
|
+
return A;
|
|
1431
|
+
}), d = h(() => e.disabledHours ? new Set(e.disabledHours()) : /* @__PURE__ */ new Set()), V = h(() => e.disabledMinutes ? new Set(e.disabledMinutes(a.value)) : /* @__PURE__ */ new Set()), M = h(() => e.disabledSeconds ? new Set(e.disabledSeconds(a.value, g.value)) : /* @__PURE__ */ new Set()), S = h(() => `${pe(a.value)}:${pe(g.value)}${D.value ? ":" + pe(v.value) : ""}`), P = (A) => d.value.has(A), b = (A) => V.value.has(A), T = (A) => M.value.has(A), B = (A) => {
|
|
1432
|
+
P(A) || (a.value = A, R(w.value, q(A)));
|
|
1433
|
+
}, K = (A) => {
|
|
1434
|
+
b(A) || (g.value = A, R(k.value, J(A)));
|
|
1435
|
+
}, X = (A) => {
|
|
1436
|
+
T(A) || (v.value = A, R(L.value, $(A)));
|
|
1437
|
+
}, q = (A) => x.value.indexOf(A), J = (A) => C.value.indexOf(A), $ = (A) => I.value.indexOf(A), R = (A, ee) => {
|
|
1438
|
+
if (!A) return;
|
|
1439
|
+
const Y = 32, ge = ee * Y + 84 - 200 / 2 + Y / 2;
|
|
1440
|
+
A.scrollTop = Math.max(0, ge);
|
|
1441
|
+
}, y = () => {
|
|
1442
|
+
if (!w.value) return;
|
|
1443
|
+
const A = w.value.scrollTop, ee = Math.round((A - 84 + 100) / 32), Y = x.value[Math.max(0, Math.min(ee, x.value.length - 1))];
|
|
1444
|
+
Y !== void 0 && !P(Y) && (a.value = Y);
|
|
1433
1445
|
}, o = () => {
|
|
1434
|
-
if (!
|
|
1435
|
-
const
|
|
1436
|
-
Y !== void 0 && !
|
|
1437
|
-
},
|
|
1438
|
-
if (!
|
|
1439
|
-
const
|
|
1440
|
-
Y !== void 0 && !
|
|
1446
|
+
if (!k.value) return;
|
|
1447
|
+
const A = k.value.scrollTop, ee = Math.round((A - 84 + 100) / 32), Y = C.value[Math.max(0, Math.min(ee, C.value.length - 1))];
|
|
1448
|
+
Y !== void 0 && !b(Y) && (g.value = Y);
|
|
1449
|
+
}, r = () => {
|
|
1450
|
+
if (!L.value) return;
|
|
1451
|
+
const A = L.value.scrollTop, ee = Math.round((A - 84 + 100) / 32), Y = I.value[Math.max(0, Math.min(ee, I.value.length - 1))];
|
|
1452
|
+
Y !== void 0 && !T(Y) && (v.value = Y);
|
|
1441
1453
|
}, m = () => {
|
|
1442
|
-
const
|
|
1443
|
-
|
|
1454
|
+
const A = e.modelValue ? new Date(e.modelValue) : /* @__PURE__ */ new Date();
|
|
1455
|
+
A.setHours(a.value, g.value, v.value, 0), t("confirm", A);
|
|
1444
1456
|
}, O = () => {
|
|
1445
1457
|
t("cancel");
|
|
1446
|
-
},
|
|
1458
|
+
}, te = () => {
|
|
1447
1459
|
if (e.modelValue)
|
|
1448
|
-
a.value = e.modelValue.getHours(),
|
|
1460
|
+
a.value = e.modelValue.getHours(), g.value = e.modelValue.getMinutes(), v.value = e.modelValue.getSeconds();
|
|
1449
1461
|
else {
|
|
1450
|
-
const
|
|
1451
|
-
a.value =
|
|
1462
|
+
const A = /* @__PURE__ */ new Date();
|
|
1463
|
+
a.value = A.getHours(), g.value = A.getMinutes(), v.value = A.getSeconds();
|
|
1452
1464
|
}
|
|
1453
|
-
|
|
1454
|
-
|
|
1465
|
+
Ce(() => {
|
|
1466
|
+
R(w.value, q(a.value)), R(k.value, J(g.value)), D.value && R(L.value, $(v.value));
|
|
1455
1467
|
});
|
|
1456
1468
|
};
|
|
1457
|
-
return
|
|
1469
|
+
return ce(
|
|
1458
1470
|
() => e.modelValue,
|
|
1459
1471
|
() => {
|
|
1460
|
-
|
|
1472
|
+
te();
|
|
1461
1473
|
},
|
|
1462
1474
|
{ immediate: !0 }
|
|
1463
|
-
),
|
|
1464
|
-
|
|
1465
|
-
}), (
|
|
1475
|
+
), ye(() => {
|
|
1476
|
+
te();
|
|
1477
|
+
}), (A, ee) => (i(), c("div", {
|
|
1466
1478
|
class: u(s(l).b())
|
|
1467
1479
|
}, [
|
|
1468
1480
|
f("div", {
|
|
@@ -1473,66 +1485,66 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1473
1485
|
}, null, 2),
|
|
1474
1486
|
f("div", {
|
|
1475
1487
|
ref_key: "hourListRef",
|
|
1476
|
-
ref:
|
|
1488
|
+
ref: w,
|
|
1477
1489
|
class: u(s(l).e("list")),
|
|
1478
|
-
onScroll:
|
|
1490
|
+
onScroll: y
|
|
1479
1491
|
}, [
|
|
1480
1492
|
f("div", {
|
|
1481
1493
|
class: u(s(l).e("padding"))
|
|
1482
1494
|
}, null, 2),
|
|
1483
|
-
(
|
|
1495
|
+
(i(!0), c(j, null, _(x.value, (Y) => (i(), c("div", {
|
|
1484
1496
|
key: Y,
|
|
1485
|
-
class: u([s(l).e("item"), s(l).is("selected", a.value === Y), s(l).is("disabled",
|
|
1486
|
-
onClick: (
|
|
1487
|
-
},
|
|
1497
|
+
class: u([s(l).e("item"), s(l).is("selected", a.value === Y), s(l).is("disabled", P(Y))]),
|
|
1498
|
+
onClick: (re) => B(Y)
|
|
1499
|
+
}, z(s(pe)(Y)), 11, pt))), 128)),
|
|
1488
1500
|
f("div", {
|
|
1489
1501
|
class: u(s(l).e("padding"))
|
|
1490
1502
|
}, null, 2)
|
|
1491
1503
|
], 34),
|
|
1492
1504
|
f("div", {
|
|
1493
1505
|
ref_key: "minuteListRef",
|
|
1494
|
-
ref:
|
|
1506
|
+
ref: k,
|
|
1495
1507
|
class: u(s(l).e("list")),
|
|
1496
1508
|
onScroll: o
|
|
1497
1509
|
}, [
|
|
1498
1510
|
f("div", {
|
|
1499
1511
|
class: u(s(l).e("padding"))
|
|
1500
1512
|
}, null, 2),
|
|
1501
|
-
(
|
|
1513
|
+
(i(!0), c(j, null, _(C.value, (Y) => (i(), c("div", {
|
|
1502
1514
|
key: Y,
|
|
1503
|
-
class: u([s(l).e("item"), s(l).is("selected",
|
|
1504
|
-
onClick: (
|
|
1505
|
-
},
|
|
1515
|
+
class: u([s(l).e("item"), s(l).is("selected", g.value === Y), s(l).is("disabled", b(Y))]),
|
|
1516
|
+
onClick: (re) => K(Y)
|
|
1517
|
+
}, z(s(pe)(Y)), 11, ht))), 128)),
|
|
1506
1518
|
f("div", {
|
|
1507
1519
|
class: u(s(l).e("padding"))
|
|
1508
1520
|
}, null, 2)
|
|
1509
1521
|
], 34),
|
|
1510
|
-
|
|
1522
|
+
D.value ? (i(), c("div", {
|
|
1511
1523
|
key: 0,
|
|
1512
1524
|
ref_key: "secondListRef",
|
|
1513
|
-
ref:
|
|
1525
|
+
ref: L,
|
|
1514
1526
|
class: u(s(l).e("list")),
|
|
1515
|
-
onScroll:
|
|
1527
|
+
onScroll: r
|
|
1516
1528
|
}, [
|
|
1517
1529
|
f("div", {
|
|
1518
1530
|
class: u(s(l).e("padding"))
|
|
1519
1531
|
}, null, 2),
|
|
1520
|
-
(
|
|
1532
|
+
(i(!0), c(j, null, _(I.value, (Y) => (i(), c("div", {
|
|
1521
1533
|
key: Y,
|
|
1522
|
-
class: u([s(l).e("item"), s(l).is("selected", v.value === Y), s(l).is("disabled",
|
|
1523
|
-
onClick: (
|
|
1524
|
-
},
|
|
1534
|
+
class: u([s(l).e("item"), s(l).is("selected", v.value === Y), s(l).is("disabled", T(Y))]),
|
|
1535
|
+
onClick: (re) => X(Y)
|
|
1536
|
+
}, z(s(pe)(Y)), 11, gt))), 128)),
|
|
1525
1537
|
f("div", {
|
|
1526
1538
|
class: u(s(l).e("padding"))
|
|
1527
1539
|
}, null, 2)
|
|
1528
|
-
], 34)) :
|
|
1540
|
+
], 34)) : N("", !0)
|
|
1529
1541
|
], 2),
|
|
1530
1542
|
f("div", {
|
|
1531
1543
|
class: u(s(l).e("footer"))
|
|
1532
1544
|
}, [
|
|
1533
1545
|
f("span", {
|
|
1534
1546
|
class: u(s(l).e("current-time"))
|
|
1535
|
-
},
|
|
1547
|
+
}, z(S.value), 3),
|
|
1536
1548
|
f("div", {
|
|
1537
1549
|
class: u(s(l).e("actions"))
|
|
1538
1550
|
}, [
|
|
@@ -1548,7 +1560,7 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1548
1560
|
], 2)
|
|
1549
1561
|
], 2));
|
|
1550
1562
|
}
|
|
1551
|
-
}),
|
|
1563
|
+
}), yt = ["placeholder", "disabled", "value"], kt = ["placeholder", "disabled", "value"], xt = ["placeholder", "disabled", "value"], hl = /* @__PURE__ */ Z({
|
|
1552
1564
|
name: "XTimePicker",
|
|
1553
1565
|
__name: "index",
|
|
1554
1566
|
props: {
|
|
@@ -1572,147 +1584,147 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1572
1584
|
},
|
|
1573
1585
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
1574
1586
|
setup(n, { expose: p, emit: e }) {
|
|
1575
|
-
const t = n, l = e, a =
|
|
1587
|
+
const t = n, l = e, a = Q("time-picker"), g = () => Le().next(), v = E(!1), w = E(2e3), k = E(), L = E(), D = E(), x = E({
|
|
1576
1588
|
top: "0px",
|
|
1577
1589
|
left: "0px"
|
|
1578
|
-
}),
|
|
1590
|
+
}), C = E({
|
|
1579
1591
|
startTime: null,
|
|
1580
1592
|
endTime: null
|
|
1581
|
-
}),
|
|
1593
|
+
}), I = E("start"), d = h(() => {
|
|
1582
1594
|
if (!t.modelValue) return null;
|
|
1583
1595
|
if (t.type === "timerange") {
|
|
1584
|
-
const [
|
|
1585
|
-
return [
|
|
1596
|
+
const [r, m] = t.modelValue;
|
|
1597
|
+
return [$e(r), $e(m)];
|
|
1586
1598
|
}
|
|
1587
|
-
return
|
|
1588
|
-
}),
|
|
1589
|
-
if (!Array.isArray(
|
|
1590
|
-
const [
|
|
1591
|
-
return
|
|
1592
|
-
}),
|
|
1593
|
-
if (!Array.isArray(
|
|
1594
|
-
const [,
|
|
1595
|
-
return
|
|
1596
|
-
}),
|
|
1599
|
+
return $e(t.modelValue);
|
|
1600
|
+
}), V = h(() => !d.value || Array.isArray(d.value) ? "" : me(d.value, t.format)), M = h(() => {
|
|
1601
|
+
if (!Array.isArray(d.value)) return "";
|
|
1602
|
+
const [r] = d.value;
|
|
1603
|
+
return r ? me(r, t.format) : "";
|
|
1604
|
+
}), S = h(() => {
|
|
1605
|
+
if (!Array.isArray(d.value)) return "";
|
|
1606
|
+
const [, r] = d.value;
|
|
1607
|
+
return r ? me(r, t.format) : "";
|
|
1608
|
+
}), P = h(() => t.type === "timerange" ? I.value === "start" ? C.value.startTime : C.value.endTime || C.value.startTime : d.value), b = h(() => [
|
|
1597
1609
|
a.b(),
|
|
1598
1610
|
a.m(t.size),
|
|
1599
1611
|
a.is("disabled", t.disabled),
|
|
1600
1612
|
a.is("range", t.type === "timerange")
|
|
1601
|
-
]),
|
|
1613
|
+
]), T = h(() => [
|
|
1602
1614
|
a.e("input"),
|
|
1603
1615
|
a.is("focus", v.value)
|
|
1604
|
-
]),
|
|
1605
|
-
t.disabled || t.readonly || (v.value ? q() :
|
|
1606
|
-
},
|
|
1607
|
-
t.disabled || t.readonly || (
|
|
1608
|
-
},
|
|
1609
|
-
v.value = !0,
|
|
1610
|
-
if (
|
|
1611
|
-
const
|
|
1612
|
-
let O =
|
|
1613
|
-
|
|
1616
|
+
]), B = () => {
|
|
1617
|
+
t.disabled || t.readonly || (v.value ? q() : X());
|
|
1618
|
+
}, K = (r) => {
|
|
1619
|
+
t.disabled || t.readonly || (I.value = r, v.value || X());
|
|
1620
|
+
}, X = () => {
|
|
1621
|
+
v.value = !0, w.value = g(), Ce(() => {
|
|
1622
|
+
if (k.value && L.value) {
|
|
1623
|
+
const r = k.value.getBoundingClientRect(), m = L.value.getBoundingClientRect();
|
|
1624
|
+
let O = r.bottom + 8, te = r.left;
|
|
1625
|
+
te + m.width > window.innerWidth && (te = window.innerWidth - m.width - 8), O + m.height > window.innerHeight && (O = r.top - m.height - 8), x.value = {
|
|
1614
1626
|
top: `${O}px`,
|
|
1615
|
-
left: `${
|
|
1627
|
+
left: `${te}px`
|
|
1616
1628
|
};
|
|
1617
1629
|
}
|
|
1618
1630
|
}), l("focus", {});
|
|
1619
1631
|
}, q = () => {
|
|
1620
1632
|
v.value = !1, l("blur", {});
|
|
1621
|
-
},
|
|
1633
|
+
}, J = (r) => {
|
|
1622
1634
|
if (t.type === "timerange")
|
|
1623
|
-
if (
|
|
1624
|
-
|
|
1635
|
+
if (I.value === "start")
|
|
1636
|
+
C.value.startTime = r, I.value = "end", C.value.endTime && C.value.endTime < r && (C.value.endTime = null);
|
|
1625
1637
|
else {
|
|
1626
|
-
|
|
1627
|
-
const m = t.valueFormat ?
|
|
1638
|
+
C.value.startTime && r < C.value.startTime ? (C.value.endTime = C.value.startTime, C.value.startTime = r) : C.value.endTime = r;
|
|
1639
|
+
const m = t.valueFormat ? me(C.value.startTime, t.valueFormat) : C.value.startTime, O = t.valueFormat ? me(C.value.endTime, t.valueFormat) : C.value.endTime;
|
|
1628
1640
|
l("update:modelValue", [m, O]), l("change", [m, O]), q();
|
|
1629
1641
|
}
|
|
1630
1642
|
else {
|
|
1631
|
-
const m = t.valueFormat ?
|
|
1643
|
+
const m = t.valueFormat ? me(r, t.valueFormat) : r;
|
|
1632
1644
|
l("update:modelValue", m), l("change", m), q();
|
|
1633
1645
|
}
|
|
1634
|
-
}, D = () => {
|
|
1635
|
-
q();
|
|
1636
1646
|
}, $ = () => {
|
|
1637
|
-
|
|
1647
|
+
q();
|
|
1648
|
+
}, R = () => {
|
|
1649
|
+
l("update:modelValue", null), l("change", null), l("clear"), C.value = {
|
|
1638
1650
|
startTime: null,
|
|
1639
1651
|
endTime: null
|
|
1640
1652
|
};
|
|
1641
|
-
},
|
|
1642
|
-
if (!
|
|
1643
|
-
const m =
|
|
1644
|
-
|
|
1653
|
+
}, y = (r) => {
|
|
1654
|
+
if (!k.value) return;
|
|
1655
|
+
const m = r.target;
|
|
1656
|
+
k.value.contains(m) || L.value && L.value.contains(m) || q();
|
|
1645
1657
|
};
|
|
1646
|
-
|
|
1658
|
+
ce(
|
|
1647
1659
|
() => t.modelValue,
|
|
1648
|
-
(
|
|
1649
|
-
if (
|
|
1650
|
-
const [m, O] =
|
|
1651
|
-
|
|
1660
|
+
(r) => {
|
|
1661
|
+
if (r && t.type === "timerange") {
|
|
1662
|
+
const [m, O] = d.value;
|
|
1663
|
+
C.value = {
|
|
1652
1664
|
startTime: m,
|
|
1653
1665
|
endTime: O
|
|
1654
1666
|
};
|
|
1655
1667
|
}
|
|
1656
1668
|
},
|
|
1657
1669
|
{ immediate: !0 }
|
|
1658
|
-
),
|
|
1659
|
-
|
|
1660
|
-
startTime: Array.isArray(
|
|
1661
|
-
endTime: Array.isArray(
|
|
1662
|
-
},
|
|
1670
|
+
), ce(v, (r) => {
|
|
1671
|
+
r && t.type === "timerange" && (C.value = {
|
|
1672
|
+
startTime: Array.isArray(d.value) ? d.value[0] : null,
|
|
1673
|
+
endTime: Array.isArray(d.value) ? d.value[1] : null
|
|
1674
|
+
}, I.value = "start");
|
|
1663
1675
|
});
|
|
1664
|
-
const o = (
|
|
1665
|
-
|
|
1676
|
+
const o = (r) => {
|
|
1677
|
+
r.key === "Escape" && q();
|
|
1666
1678
|
};
|
|
1667
|
-
return
|
|
1668
|
-
document.addEventListener("click",
|
|
1669
|
-
}),
|
|
1670
|
-
document.removeEventListener("click",
|
|
1679
|
+
return ye(() => {
|
|
1680
|
+
document.addEventListener("click", y), document.addEventListener("keydown", o);
|
|
1681
|
+
}), ke(() => {
|
|
1682
|
+
document.removeEventListener("click", y), document.removeEventListener("keydown", o);
|
|
1671
1683
|
}), p({
|
|
1672
1684
|
focus: () => {
|
|
1673
|
-
var
|
|
1674
|
-
return (
|
|
1685
|
+
var r;
|
|
1686
|
+
return (r = D.value) == null ? void 0 : r.focus();
|
|
1675
1687
|
},
|
|
1676
1688
|
blur: () => {
|
|
1677
|
-
var
|
|
1678
|
-
return (
|
|
1689
|
+
var r;
|
|
1690
|
+
return (r = D.value) == null ? void 0 : r.blur();
|
|
1679
1691
|
}
|
|
1680
|
-
}), (
|
|
1692
|
+
}), (r, m) => (i(), c("div", {
|
|
1681
1693
|
ref_key: "pickerRef",
|
|
1682
|
-
ref:
|
|
1683
|
-
class: u(
|
|
1694
|
+
ref: k,
|
|
1695
|
+
class: u(b.value)
|
|
1684
1696
|
}, [
|
|
1685
|
-
n.type !== "timerange" ? (
|
|
1697
|
+
n.type !== "timerange" ? (i(), c("div", {
|
|
1686
1698
|
key: 0,
|
|
1687
|
-
class: u(
|
|
1688
|
-
onClick:
|
|
1699
|
+
class: u(T.value),
|
|
1700
|
+
onClick: B
|
|
1689
1701
|
}, [
|
|
1690
1702
|
f("input", {
|
|
1691
1703
|
ref_key: "inputRef",
|
|
1692
|
-
ref:
|
|
1704
|
+
ref: D,
|
|
1693
1705
|
type: "text",
|
|
1694
1706
|
placeholder: n.placeholder,
|
|
1695
1707
|
disabled: n.disabled,
|
|
1696
1708
|
readonly: !0,
|
|
1697
|
-
value:
|
|
1709
|
+
value: V.value,
|
|
1698
1710
|
class: u(s(a).e("input-inner"))
|
|
1699
|
-
}, null, 10,
|
|
1711
|
+
}, null, 10, yt),
|
|
1700
1712
|
f("span", {
|
|
1701
1713
|
class: u(s(a).e("suffix"))
|
|
1702
1714
|
}, [
|
|
1703
|
-
n.clearable &&
|
|
1715
|
+
n.clearable && V.value && !n.disabled ? (i(), c("span", {
|
|
1704
1716
|
key: 0,
|
|
1705
1717
|
class: u(s(a).e("clear")),
|
|
1706
|
-
onClick: ue(
|
|
1707
|
-
}, " ✕ ", 2)) : (
|
|
1718
|
+
onClick: ue(R, ["stop"])
|
|
1719
|
+
}, " ✕ ", 2)) : (i(), c("span", {
|
|
1708
1720
|
key: 1,
|
|
1709
1721
|
class: u(s(a).e("icon"))
|
|
1710
1722
|
}, "🕐", 2))
|
|
1711
1723
|
], 2)
|
|
1712
|
-
], 2)) : (
|
|
1724
|
+
], 2)) : (i(), c("div", {
|
|
1713
1725
|
key: 1,
|
|
1714
|
-
class: u(
|
|
1715
|
-
onClick:
|
|
1726
|
+
class: u(T.value),
|
|
1727
|
+
onClick: B
|
|
1716
1728
|
}, [
|
|
1717
1729
|
f("input", {
|
|
1718
1730
|
type: "text",
|
|
@@ -1720,9 +1732,9 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1720
1732
|
disabled: n.disabled,
|
|
1721
1733
|
readonly: !0,
|
|
1722
1734
|
value: M.value,
|
|
1723
|
-
class: u([s(a).e("input-inner"), s(a).is("active",
|
|
1724
|
-
onClick: m[0] || (m[0] = ue((O) =>
|
|
1725
|
-
}, null, 10,
|
|
1735
|
+
class: u([s(a).e("input-inner"), s(a).is("active", I.value === "start")]),
|
|
1736
|
+
onClick: m[0] || (m[0] = ue((O) => K("start"), ["stop"]))
|
|
1737
|
+
}, null, 10, kt),
|
|
1726
1738
|
f("span", {
|
|
1727
1739
|
class: u(s(a).e("separator"))
|
|
1728
1740
|
}, "至", 2),
|
|
@@ -1731,38 +1743,38 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1731
1743
|
placeholder: n.endPlaceholder,
|
|
1732
1744
|
disabled: n.disabled,
|
|
1733
1745
|
readonly: !0,
|
|
1734
|
-
value:
|
|
1735
|
-
class: u([s(a).e("input-inner"), s(a).is("active",
|
|
1736
|
-
onClick: m[1] || (m[1] = ue((O) =>
|
|
1737
|
-
}, null, 10,
|
|
1746
|
+
value: S.value,
|
|
1747
|
+
class: u([s(a).e("input-inner"), s(a).is("active", I.value === "end")]),
|
|
1748
|
+
onClick: m[1] || (m[1] = ue((O) => K("end"), ["stop"]))
|
|
1749
|
+
}, null, 10, xt),
|
|
1738
1750
|
f("span", {
|
|
1739
1751
|
class: u(s(a).e("suffix"))
|
|
1740
1752
|
}, [
|
|
1741
|
-
n.clearable && (M.value ||
|
|
1753
|
+
n.clearable && (M.value || S.value) && !n.disabled ? (i(), c("span", {
|
|
1742
1754
|
key: 0,
|
|
1743
1755
|
class: u(s(a).e("clear")),
|
|
1744
|
-
onClick: ue(
|
|
1745
|
-
}, " ✕ ", 2)) : (
|
|
1756
|
+
onClick: ue(R, ["stop"])
|
|
1757
|
+
}, " ✕ ", 2)) : (i(), c("span", {
|
|
1746
1758
|
key: 1,
|
|
1747
1759
|
class: u(s(a).e("icon"))
|
|
1748
1760
|
}, "🕐", 2))
|
|
1749
1761
|
], 2)
|
|
1750
1762
|
], 2)),
|
|
1751
|
-
(
|
|
1752
|
-
|
|
1753
|
-
default:
|
|
1754
|
-
|
|
1763
|
+
(i(), he(Re, { to: "body" }, [
|
|
1764
|
+
xe(Be, { name: "fade" }, {
|
|
1765
|
+
default: Fe(() => [
|
|
1766
|
+
ve(f("div", {
|
|
1755
1767
|
ref_key: "popperRef",
|
|
1756
|
-
ref:
|
|
1768
|
+
ref: L,
|
|
1757
1769
|
class: u(s(a).e("popper")),
|
|
1758
|
-
style: ae({ zIndex:
|
|
1770
|
+
style: ae({ zIndex: w.value, ...x.value })
|
|
1759
1771
|
}, [
|
|
1760
|
-
n.type === "timerange" ? (
|
|
1772
|
+
n.type === "timerange" ? (i(), c("div", {
|
|
1761
1773
|
key: 0,
|
|
1762
1774
|
class: u(s(a).e("popper-header"))
|
|
1763
|
-
},
|
|
1764
|
-
|
|
1765
|
-
"model-value":
|
|
1775
|
+
}, z(I.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : N("", !0),
|
|
1776
|
+
xe(bt, {
|
|
1777
|
+
"model-value": P.value,
|
|
1766
1778
|
format: n.format,
|
|
1767
1779
|
"disabled-hours": n.disabledHours,
|
|
1768
1780
|
"disabled-minutes": n.disabledMinutes,
|
|
@@ -1770,11 +1782,11 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1770
1782
|
"hour-step": n.hourStep,
|
|
1771
1783
|
"minute-step": n.minuteStep,
|
|
1772
1784
|
"second-step": n.secondStep,
|
|
1773
|
-
onConfirm:
|
|
1774
|
-
onCancel:
|
|
1785
|
+
onConfirm: J,
|
|
1786
|
+
onCancel: $
|
|
1775
1787
|
}, null, 8, ["model-value", "format", "disabled-hours", "disabled-minutes", "disabled-seconds", "hour-step", "minute-step", "second-step"])
|
|
1776
1788
|
], 6), [
|
|
1777
|
-
[
|
|
1789
|
+
[Ie, v.value]
|
|
1778
1790
|
])
|
|
1779
1791
|
]),
|
|
1780
1792
|
_: 1
|
|
@@ -1783,24 +1795,24 @@ const vt = ["onClick"], ft = ["onClick"], mt = ["onClick"], pt = /* @__PURE__ */
|
|
|
1783
1795
|
], 2));
|
|
1784
1796
|
}
|
|
1785
1797
|
});
|
|
1786
|
-
function
|
|
1798
|
+
function wt(n, p, e) {
|
|
1787
1799
|
return e ? e(p, n) : n.toLowerCase().includes(p.toLowerCase());
|
|
1788
1800
|
}
|
|
1789
|
-
function
|
|
1801
|
+
function Ye(n, p, e = "value", t = "children") {
|
|
1790
1802
|
for (const l of n) {
|
|
1791
1803
|
if (l[e] === p)
|
|
1792
1804
|
return l;
|
|
1793
1805
|
if (l[t] && l[t].length > 0) {
|
|
1794
|
-
const a =
|
|
1806
|
+
const a = Ye(l[t], p, e, t);
|
|
1795
1807
|
if (a) return a;
|
|
1796
1808
|
}
|
|
1797
1809
|
}
|
|
1798
1810
|
return null;
|
|
1799
1811
|
}
|
|
1800
|
-
function
|
|
1812
|
+
function Me(n, p, e = "value", t = "children") {
|
|
1801
1813
|
const l = [];
|
|
1802
|
-
function a(
|
|
1803
|
-
for (const v of
|
|
1814
|
+
function a(g) {
|
|
1815
|
+
for (const v of g) {
|
|
1804
1816
|
if (v[e] === p)
|
|
1805
1817
|
return l.push(v), !0;
|
|
1806
1818
|
if (v[t] && v[t].length > 0) {
|
|
@@ -1813,19 +1825,20 @@ function Se(n, p, e = "value", t = "children") {
|
|
|
1813
1825
|
}
|
|
1814
1826
|
return a(n), l;
|
|
1815
1827
|
}
|
|
1816
|
-
function
|
|
1828
|
+
function Vt(n, p = "children") {
|
|
1817
1829
|
const e = [];
|
|
1818
|
-
function t(l, a = 0,
|
|
1830
|
+
function t(l, a = 0, g = null) {
|
|
1819
1831
|
for (const v of l)
|
|
1820
|
-
e.push({ ...v, level: a, parent:
|
|
1832
|
+
e.push({ ...v, level: a, parent: g }), v[p] && v[p].length > 0 && t(v[p], a + 1, v);
|
|
1821
1833
|
}
|
|
1822
1834
|
return t(n), e;
|
|
1823
1835
|
}
|
|
1824
|
-
const
|
|
1836
|
+
const Ct = ["onClick"], Dt = ["placeholder", "disabled", "readonly", "value"], St = ["onClick"], $t = ["onClick"], gl = /* @__PURE__ */ Z({
|
|
1825
1837
|
name: "XSelect",
|
|
1826
1838
|
__name: "index",
|
|
1827
1839
|
props: {
|
|
1828
|
-
modelValue: { default:
|
|
1840
|
+
modelValue: { default: void 0 },
|
|
1841
|
+
value: { default: void 0 },
|
|
1829
1842
|
options: { default: () => [] },
|
|
1830
1843
|
type: { default: "single" },
|
|
1831
1844
|
placeholder: { default: "请选择" },
|
|
@@ -1844,220 +1857,225 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
1844
1857
|
noDataText: { default: "暂无数据" },
|
|
1845
1858
|
noMatchText: { default: "无匹配数据" }
|
|
1846
1859
|
},
|
|
1847
|
-
emits: ["update:modelValue", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
|
|
1860
|
+
emits: ["update:modelValue", "update:value", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
|
|
1848
1861
|
setup(n, { emit: p }) {
|
|
1849
|
-
const e = n, t = p, l =
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1862
|
+
const e = n, t = p, l = Q("select"), a = () => Le().next(), g = E(), v = E(), w = E(), k = E(!1), L = E(2e3), D = E(""), x = E(-1), C = E({ top: "0px", left: "0px" }), I = h(() => e.type === "multiple"), d = h(() => e.type === "cascader"), V = E([]), M = () => e.modelValue !== void 0 ? e.modelValue : e.value !== void 0 ? e.value : "", S = (F) => {
|
|
1863
|
+
t("update:modelValue", F), t("update:value", F), t("change", F);
|
|
1864
|
+
}, P = h(() => {
|
|
1865
|
+
const F = M();
|
|
1866
|
+
return I.value ? Array.isArray(F) ? F : [] : d.value ? Array.isArray(F) ? F : F ? [F] : [] : F !== "" && F !== null && F !== void 0 ? [F] : [];
|
|
1867
|
+
}), b = h(() => d.value ? Vt(e.options, e.childrenKey) : e.options.map((F) => ({ ...F, level: 0 }))), T = h(() => !e.filterable || !D.value ? b.value : b.value.filter((F) => {
|
|
1868
|
+
const U = F[e.labelKey] || "";
|
|
1869
|
+
return wt(U, D.value, e.filterMethod);
|
|
1870
|
+
})), B = h(() => {
|
|
1871
|
+
const F = [];
|
|
1872
|
+
for (const U of P.value) {
|
|
1873
|
+
const W = Ye(e.options, U, e.valueKey, e.childrenKey);
|
|
1874
|
+
W && F.push(W);
|
|
1857
1875
|
}
|
|
1858
|
-
return
|
|
1859
|
-
}),
|
|
1860
|
-
if (
|
|
1876
|
+
return F;
|
|
1877
|
+
}), K = h(() => {
|
|
1878
|
+
if (I.value)
|
|
1861
1879
|
return "";
|
|
1862
|
-
if (
|
|
1863
|
-
return
|
|
1864
|
-
const
|
|
1865
|
-
return
|
|
1866
|
-
}),
|
|
1880
|
+
if (d.value)
|
|
1881
|
+
return Me(e.options, P.value[P.value.length - 1], e.valueKey, e.childrenKey).map((W) => W[e.labelKey]).join(e.separator);
|
|
1882
|
+
const F = B.value[0];
|
|
1883
|
+
return F ? F[e.labelKey] : "";
|
|
1884
|
+
}), X = h(() => I.value ? B.value : []), q = h(() => e.collapseTags ? X.value.slice(0, e.maxCollapseTags) : X.value), J = h(() => e.collapseTags ? Math.max(0, X.value.length - e.maxCollapseTags) : 0), $ = h(() => [
|
|
1867
1885
|
l.b(),
|
|
1868
1886
|
l.m(e.size),
|
|
1869
1887
|
l.is("disabled", e.disabled),
|
|
1870
|
-
l.is("multiple",
|
|
1871
|
-
l.is("cascader",
|
|
1888
|
+
l.is("multiple", I.value),
|
|
1889
|
+
l.is("cascader", d.value),
|
|
1872
1890
|
l.is("filterable", e.filterable),
|
|
1873
|
-
l.is("focus",
|
|
1874
|
-
]),
|
|
1875
|
-
if (!
|
|
1876
|
-
const
|
|
1877
|
-
let W =
|
|
1878
|
-
ne +
|
|
1891
|
+
l.is("focus", k.value)
|
|
1892
|
+
]), R = () => {
|
|
1893
|
+
if (!g.value || !w.value || !k.value) return;
|
|
1894
|
+
const F = g.value.getBoundingClientRect(), U = w.value.getBoundingClientRect();
|
|
1895
|
+
let W = F.bottom + 4, ne = F.left;
|
|
1896
|
+
ne + U.width > window.innerWidth && (ne = window.innerWidth - U.width - 8), W + U.height > window.innerHeight && (W = F.top - U.height - 4), C.value = {
|
|
1879
1897
|
top: `${W}px`,
|
|
1880
1898
|
left: `${ne}px`
|
|
1881
1899
|
};
|
|
1882
|
-
},
|
|
1883
|
-
e.disabled || (
|
|
1884
|
-
|
|
1900
|
+
}, y = () => {
|
|
1901
|
+
e.disabled || (k.value = !0, L.value = a(), D.value = "", Ce(() => {
|
|
1902
|
+
R();
|
|
1885
1903
|
}), t("visible-change", !0), t("focus", {}));
|
|
1886
|
-
},
|
|
1887
|
-
|
|
1888
|
-
},
|
|
1889
|
-
if (!
|
|
1890
|
-
if (
|
|
1891
|
-
const
|
|
1904
|
+
}, o = () => {
|
|
1905
|
+
k.value = !1, D.value = "", V.value = [], t("visible-change", !1), t("blur", {});
|
|
1906
|
+
}, r = (F) => {
|
|
1907
|
+
if (!F.disabled)
|
|
1908
|
+
if (I.value) {
|
|
1909
|
+
const U = [...P.value], W = F[e.valueKey], ne = U.indexOf(W);
|
|
1892
1910
|
if (ne > -1)
|
|
1893
|
-
|
|
1911
|
+
U.splice(ne, 1), t("remove-tag", W);
|
|
1894
1912
|
else {
|
|
1895
|
-
if (e.multipleLimit > 0 &&
|
|
1913
|
+
if (e.multipleLimit > 0 && U.length >= e.multipleLimit)
|
|
1896
1914
|
return;
|
|
1897
|
-
|
|
1915
|
+
U.push(W);
|
|
1898
1916
|
}
|
|
1899
|
-
|
|
1900
|
-
} else if (
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1903
|
-
|
|
1917
|
+
S(U);
|
|
1918
|
+
} else if (d.value)
|
|
1919
|
+
if (F.children && F.children.length > 0) {
|
|
1920
|
+
const U = Me(e.options, F[e.valueKey], e.valueKey, e.childrenKey);
|
|
1921
|
+
V.value = U;
|
|
1904
1922
|
} else {
|
|
1905
|
-
const W =
|
|
1906
|
-
|
|
1923
|
+
const W = Me(e.options, F[e.valueKey], e.valueKey, e.childrenKey).map((ne) => ne[e.valueKey]);
|
|
1924
|
+
S(W), o();
|
|
1907
1925
|
}
|
|
1908
1926
|
else
|
|
1909
|
-
|
|
1910
|
-
},
|
|
1911
|
-
const
|
|
1912
|
-
|
|
1913
|
-
},
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1916
|
-
},
|
|
1917
|
-
|
|
1918
|
-
},
|
|
1919
|
-
if (!
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
}, ee = (
|
|
1923
|
-
if (
|
|
1924
|
-
|
|
1925
|
-
else if (
|
|
1926
|
-
const
|
|
1927
|
-
|
|
1928
|
-
} else
|
|
1929
|
-
},
|
|
1927
|
+
S(F[e.valueKey]), o();
|
|
1928
|
+
}, m = (F) => {
|
|
1929
|
+
const U = P.value.filter((W) => W !== F[e.valueKey]);
|
|
1930
|
+
S(U), t("remove-tag", F[e.valueKey]);
|
|
1931
|
+
}, O = () => {
|
|
1932
|
+
const F = I.value ? [] : "";
|
|
1933
|
+
S(F), t("clear");
|
|
1934
|
+
}, te = (F) => {
|
|
1935
|
+
D.value = F.target.value;
|
|
1936
|
+
}, A = (F) => {
|
|
1937
|
+
if (!g.value) return;
|
|
1938
|
+
const U = F.target;
|
|
1939
|
+
g.value.contains(U) || w.value && w.value.contains(U) || o();
|
|
1940
|
+
}, ee = (F) => {
|
|
1941
|
+
if (F.key === "Escape")
|
|
1942
|
+
o();
|
|
1943
|
+
else if (F.key === "Enter" && k.value) {
|
|
1944
|
+
const U = T.value[x.value];
|
|
1945
|
+
U && r(U);
|
|
1946
|
+
} else F.key === "ArrowDown" && k.value ? (F.preventDefault(), x.value = Math.min(x.value + 1, T.value.length - 1)) : F.key === "ArrowUp" && k.value && (F.preventDefault(), x.value = Math.max(x.value - 1, 0));
|
|
1947
|
+
}, Y = (F) => P.value.includes(F[e.valueKey]), re = (F, U) => [
|
|
1930
1948
|
l.e("option"),
|
|
1931
|
-
l.is("selected",
|
|
1932
|
-
l.is("disabled",
|
|
1933
|
-
l.is("hover",
|
|
1934
|
-
l.is("group", !!(
|
|
1935
|
-
],
|
|
1936
|
-
if (!
|
|
1937
|
-
const
|
|
1938
|
-
for (const
|
|
1939
|
-
|
|
1940
|
-
return
|
|
1949
|
+
l.is("selected", Y(F)),
|
|
1950
|
+
l.is("disabled", F.disabled === !0),
|
|
1951
|
+
l.is("hover", x.value === U),
|
|
1952
|
+
l.is("group", !!(F.children && F.children.length > 0))
|
|
1953
|
+
], ge = h(() => {
|
|
1954
|
+
if (!d.value) return [];
|
|
1955
|
+
const F = [e.options];
|
|
1956
|
+
for (const U of V.value)
|
|
1957
|
+
U.children && U.children.length > 0 && F.push(U.children);
|
|
1958
|
+
return F;
|
|
1941
1959
|
});
|
|
1942
|
-
return
|
|
1943
|
-
document.addEventListener("click",
|
|
1944
|
-
}),
|
|
1945
|
-
document.removeEventListener("click",
|
|
1946
|
-
}),
|
|
1947
|
-
|
|
1948
|
-
}),
|
|
1949
|
-
selectedValues:
|
|
1950
|
-
handleSelect:
|
|
1951
|
-
isSelected:
|
|
1952
|
-
}), (
|
|
1960
|
+
return ye(() => {
|
|
1961
|
+
document.addEventListener("click", A), document.addEventListener("keydown", ee);
|
|
1962
|
+
}), ke(() => {
|
|
1963
|
+
document.removeEventListener("click", A), document.removeEventListener("keydown", ee), document.removeEventListener("scroll", R, !0);
|
|
1964
|
+
}), ce(k, (F) => {
|
|
1965
|
+
F ? document.addEventListener("scroll", R, !0) : document.removeEventListener("scroll", R, !0);
|
|
1966
|
+
}), Ve("select", {
|
|
1967
|
+
selectedValues: P,
|
|
1968
|
+
handleSelect: r,
|
|
1969
|
+
isSelected: Y
|
|
1970
|
+
}), (F, U) => (i(), c("div", {
|
|
1953
1971
|
ref_key: "selectRef",
|
|
1954
|
-
ref:
|
|
1955
|
-
class: u(
|
|
1972
|
+
ref: g,
|
|
1973
|
+
class: u($.value)
|
|
1956
1974
|
}, [
|
|
1957
1975
|
f("div", {
|
|
1958
1976
|
class: u(s(l).e("wrapper")),
|
|
1959
|
-
onClick:
|
|
1977
|
+
onClick: U[0] || (U[0] = (W) => k.value ? o() : y())
|
|
1960
1978
|
}, [
|
|
1961
|
-
|
|
1979
|
+
I.value && X.value.length > 0 ? (i(), c("div", {
|
|
1962
1980
|
key: 0,
|
|
1963
1981
|
class: u(s(l).e("tags"))
|
|
1964
1982
|
}, [
|
|
1965
|
-
(
|
|
1983
|
+
(i(!0), c(j, null, _(q.value, (W) => (i(), c("span", {
|
|
1966
1984
|
key: W[n.valueKey],
|
|
1967
1985
|
class: u(s(l).e("tag"))
|
|
1968
1986
|
}, [
|
|
1969
1987
|
f("span", {
|
|
1970
1988
|
class: u(s(l).e("tag-text"))
|
|
1971
|
-
},
|
|
1989
|
+
}, z(W[n.labelKey]), 3),
|
|
1972
1990
|
f("span", {
|
|
1973
1991
|
class: u(s(l).e("tag-close")),
|
|
1974
|
-
onClick: ue((ne) =>
|
|
1975
|
-
}, "×", 10,
|
|
1992
|
+
onClick: ue((ne) => m(W), ["stop"])
|
|
1993
|
+
}, "×", 10, Ct)
|
|
1976
1994
|
], 2))), 128)),
|
|
1977
|
-
|
|
1995
|
+
J.value > 0 ? (i(), c("span", {
|
|
1978
1996
|
key: 0,
|
|
1979
1997
|
class: u(s(l).e("tag-count"))
|
|
1980
|
-
}, " +" +
|
|
1981
|
-
], 2)) :
|
|
1998
|
+
}, " +" + z(J.value), 3)) : N("", !0)
|
|
1999
|
+
], 2)) : N("", !0),
|
|
1982
2000
|
f("input", {
|
|
1983
2001
|
ref_key: "inputRef",
|
|
1984
2002
|
ref: v,
|
|
1985
2003
|
class: u(s(l).e("input")),
|
|
1986
|
-
placeholder:
|
|
2004
|
+
placeholder: I.value && X.value.length > 0 ? "" : n.placeholder,
|
|
1987
2005
|
disabled: n.disabled,
|
|
1988
|
-
readonly: !n.filterable || !
|
|
1989
|
-
value: n.filterable &&
|
|
1990
|
-
onInput:
|
|
1991
|
-
}, null, 42,
|
|
2006
|
+
readonly: !n.filterable || !k.value,
|
|
2007
|
+
value: n.filterable && k.value ? D.value : K.value,
|
|
2008
|
+
onInput: te
|
|
2009
|
+
}, null, 42, Dt),
|
|
1992
2010
|
f("span", {
|
|
1993
2011
|
class: u(s(l).e("suffix"))
|
|
1994
2012
|
}, [
|
|
1995
|
-
n.clearable &&
|
|
2013
|
+
n.clearable && P.value.length > 0 && !n.disabled ? (i(), c("span", {
|
|
1996
2014
|
key: 0,
|
|
1997
2015
|
class: u(s(l).e("clear")),
|
|
1998
|
-
onClick: ue(
|
|
1999
|
-
}, "×", 2)) : (
|
|
2016
|
+
onClick: ue(O, ["stop"])
|
|
2017
|
+
}, "×", 2)) : (i(), c("span", {
|
|
2000
2018
|
key: 1,
|
|
2001
|
-
class: u([s(l).e("arrow"), s(l).is("reverse",
|
|
2019
|
+
class: u([s(l).e("arrow"), s(l).is("reverse", k.value)])
|
|
2002
2020
|
}, "▼", 2))
|
|
2003
2021
|
], 2)
|
|
2004
2022
|
], 2),
|
|
2005
|
-
(
|
|
2006
|
-
|
|
2007
|
-
default:
|
|
2008
|
-
|
|
2023
|
+
(i(), he(Re, { to: "body" }, [
|
|
2024
|
+
xe(Be, { name: "fade" }, {
|
|
2025
|
+
default: Fe(() => [
|
|
2026
|
+
ve(f("div", {
|
|
2009
2027
|
ref_key: "popperRef",
|
|
2010
|
-
ref:
|
|
2011
|
-
class: u([s(l).e("popper"), s(l).is("cascader",
|
|
2012
|
-
style: ae({ zIndex:
|
|
2028
|
+
ref: w,
|
|
2029
|
+
class: u([s(l).e("popper"), s(l).is("cascader", d.value)]),
|
|
2030
|
+
style: ae({ zIndex: L.value, ...C.value })
|
|
2013
2031
|
}, [
|
|
2014
|
-
|
|
2032
|
+
d.value ? (i(), c("div", {
|
|
2015
2033
|
key: 0,
|
|
2016
2034
|
class: u(s(l).e("cascader-panels"))
|
|
2017
2035
|
}, [
|
|
2018
|
-
(
|
|
2036
|
+
(i(!0), c(j, null, _(ge.value, (W, ne) => (i(), c("div", {
|
|
2019
2037
|
key: ne,
|
|
2020
2038
|
class: u(s(l).e("cascader-panel"))
|
|
2021
2039
|
}, [
|
|
2022
|
-
(
|
|
2040
|
+
(i(!0), c(j, null, _(W, (oe, H) => (i(), c("div", {
|
|
2023
2041
|
key: oe[n.valueKey],
|
|
2024
|
-
class: u(
|
|
2025
|
-
onClick: (G) =>
|
|
2042
|
+
class: u(re(oe, H)),
|
|
2043
|
+
onClick: (G) => r(oe)
|
|
2026
2044
|
}, [
|
|
2027
2045
|
f("span", {
|
|
2028
2046
|
class: u(s(l).e("option-label"))
|
|
2029
|
-
},
|
|
2030
|
-
oe.children && oe.children.length > 0 ? (
|
|
2047
|
+
}, z(oe[n.labelKey]), 3),
|
|
2048
|
+
oe.children && oe.children.length > 0 ? (i(), c("span", {
|
|
2031
2049
|
key: 0,
|
|
2032
2050
|
class: u(s(l).e("option-arrow"))
|
|
2033
|
-
}, "›", 2)) :
|
|
2034
|
-
], 10,
|
|
2051
|
+
}, "›", 2)) : N("", !0)
|
|
2052
|
+
], 10, St))), 128))
|
|
2035
2053
|
], 2))), 128))
|
|
2036
|
-
], 2)) : (
|
|
2037
|
-
|
|
2054
|
+
], 2)) : (i(), c(j, { key: 1 }, [
|
|
2055
|
+
T.value.length === 0 ? (i(), c("div", {
|
|
2038
2056
|
key: 0,
|
|
2039
2057
|
class: u(s(l).e("empty"))
|
|
2040
|
-
},
|
|
2058
|
+
}, z(D.value ? n.noMatchText : n.noDataText), 3)) : (i(), c("div", {
|
|
2041
2059
|
key: 1,
|
|
2042
2060
|
class: u(s(l).e("options"))
|
|
2043
2061
|
}, [
|
|
2044
|
-
(
|
|
2062
|
+
(i(!0), c(j, null, _(T.value, (W, ne) => (i(), c("div", {
|
|
2045
2063
|
key: W[n.valueKey],
|
|
2046
|
-
class: u(
|
|
2047
|
-
onClick: (oe) =>
|
|
2064
|
+
class: u(re(W, ne)),
|
|
2065
|
+
onClick: (oe) => r(W)
|
|
2048
2066
|
}, [
|
|
2049
2067
|
f("span", {
|
|
2050
2068
|
class: u(s(l).e("option-label"))
|
|
2051
|
-
},
|
|
2052
|
-
|
|
2069
|
+
}, z(W[n.labelKey]), 3),
|
|
2070
|
+
Y(W) ? (i(), c("span", {
|
|
2053
2071
|
key: 0,
|
|
2054
2072
|
class: u(s(l).e("option-check"))
|
|
2055
|
-
}, "✓", 2)) :
|
|
2056
|
-
], 10,
|
|
2073
|
+
}, "✓", 2)) : N("", !0)
|
|
2074
|
+
], 10, $t))), 128))
|
|
2057
2075
|
], 2))
|
|
2058
2076
|
], 64))
|
|
2059
2077
|
], 6), [
|
|
2060
|
-
[
|
|
2078
|
+
[Ie, k.value]
|
|
2061
2079
|
])
|
|
2062
2080
|
]),
|
|
2063
2081
|
_: 1
|
|
@@ -2065,7 +2083,7 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2065
2083
|
]))
|
|
2066
2084
|
], 2));
|
|
2067
2085
|
}
|
|
2068
|
-
}),
|
|
2086
|
+
}), Mt = ["checked", "indeterminate"], Tt = ["placeholder"], Rt = ["onClick"], Bt = ["checked", "disabled", "onChange"], Ft = ["disabled"], It = ["disabled"], Lt = ["checked", "indeterminate"], Pt = ["placeholder"], At = ["onClick"], Et = ["checked", "disabled", "onChange"], bl = /* @__PURE__ */ Z({
|
|
2069
2087
|
name: "XTransfer",
|
|
2070
2088
|
__name: "index",
|
|
2071
2089
|
props: {
|
|
@@ -2083,55 +2101,55 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2083
2101
|
},
|
|
2084
2102
|
emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
|
|
2085
2103
|
setup(n, { expose: p, emit: e }) {
|
|
2086
|
-
const t = n, l = e, a =
|
|
2104
|
+
const t = n, l = e, a = Q("transfer"), g = h(() => {
|
|
2087
2105
|
var o;
|
|
2088
2106
|
return ((o = t.props) == null ? void 0 : o.key) || "key";
|
|
2089
2107
|
}), v = h(() => {
|
|
2090
2108
|
var o;
|
|
2091
2109
|
return ((o = t.props) == null ? void 0 : o.label) || "label";
|
|
2092
|
-
}),
|
|
2110
|
+
}), w = h(() => {
|
|
2093
2111
|
var o;
|
|
2094
2112
|
return ((o = t.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2095
|
-
}),
|
|
2096
|
-
const
|
|
2097
|
-
return t.modelValue.includes(
|
|
2113
|
+
}), k = E(""), L = E(""), D = E([]), x = E([]), C = (o) => o[g.value], I = (o) => o[v.value], d = (o) => o[w.value] || !1, V = h(() => t.data.filter((o) => {
|
|
2114
|
+
const r = C(o);
|
|
2115
|
+
return t.modelValue.includes(r) ? !1 : t.filterable && k.value ? t.filterMethod ? t.filterMethod(k.value, o) : I(o).toLowerCase().includes(k.value.toLowerCase()) : !0;
|
|
2098
2116
|
})), M = h(() => {
|
|
2099
2117
|
const o = t.modelValue;
|
|
2100
|
-
let
|
|
2101
|
-
const O =
|
|
2118
|
+
let r = t.data.filter((m) => {
|
|
2119
|
+
const O = C(m);
|
|
2102
2120
|
return o.includes(O);
|
|
2103
2121
|
});
|
|
2104
|
-
return t.filterable &&
|
|
2105
|
-
}),
|
|
2106
|
-
const o =
|
|
2107
|
-
const O = t.data.find((
|
|
2108
|
-
return O && !
|
|
2122
|
+
return t.filterable && L.value && (r = r.filter((m) => t.filterMethod ? t.filterMethod(L.value, m) : I(m).toLowerCase().includes(L.value.toLowerCase()))), t.targetOrder === "push" ? r.sort((m, O) => o.indexOf(C(m)) - o.indexOf(C(O))) : t.targetOrder === "unshift" ? r.sort((m, O) => o.indexOf(C(O)) - o.indexOf(C(m))) : r;
|
|
2123
|
+
}), S = h(() => V.value.filter((o) => D.value.includes(C(o))).every((o) => d(o))), P = h(() => M.value.filter((o) => x.value.includes(C(o))).every((o) => d(o))), b = h(() => D.value.length === 0 || S.value), T = h(() => x.value.length === 0 || P.value), B = () => {
|
|
2124
|
+
const o = D.value.filter((m) => {
|
|
2125
|
+
const O = t.data.find((te) => C(te) === m);
|
|
2126
|
+
return O && !d(O);
|
|
2109
2127
|
});
|
|
2110
|
-
let
|
|
2111
|
-
t.targetOrder === "unshift" ?
|
|
2112
|
-
},
|
|
2113
|
-
const o =
|
|
2114
|
-
const O = t.data.find((
|
|
2115
|
-
return O && !
|
|
2116
|
-
}),
|
|
2117
|
-
l("update:modelValue",
|
|
2118
|
-
},
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2128
|
+
let r;
|
|
2129
|
+
t.targetOrder === "unshift" ? r = [...o, ...t.modelValue] : r = [...t.modelValue, ...o], l("update:modelValue", r), l("change", r, "right", o), D.value = [];
|
|
2130
|
+
}, K = () => {
|
|
2131
|
+
const o = x.value.filter((m) => {
|
|
2132
|
+
const O = t.data.find((te) => C(te) === m);
|
|
2133
|
+
return O && !d(O);
|
|
2134
|
+
}), r = t.modelValue.filter((m) => !o.includes(m));
|
|
2135
|
+
l("update:modelValue", r), l("change", r, "left", o), x.value = [];
|
|
2136
|
+
}, X = (o) => {
|
|
2137
|
+
const r = D.value.indexOf(o);
|
|
2138
|
+
r > -1 ? D.value.splice(r, 1) : D.value.push(o), l("left-check-change", [...D.value]);
|
|
2121
2139
|
}, q = (o) => {
|
|
2122
|
-
const
|
|
2123
|
-
|
|
2124
|
-
},
|
|
2125
|
-
|
|
2126
|
-
},
|
|
2127
|
-
|
|
2128
|
-
},
|
|
2129
|
-
o === "left" ?
|
|
2130
|
-
},
|
|
2140
|
+
const r = x.value.indexOf(o);
|
|
2141
|
+
r > -1 ? x.value.splice(r, 1) : x.value.push(o), l("right-check-change", [...x.value]);
|
|
2142
|
+
}, J = () => {
|
|
2143
|
+
D.value.length === V.value.filter((o) => !d(o)).length ? D.value = [] : D.value = V.value.filter((o) => !d(o)).map((o) => C(o)), l("left-check-change", [...D.value]);
|
|
2144
|
+
}, $ = () => {
|
|
2145
|
+
x.value.length === M.value.filter((o) => !d(o)).length ? x.value = [] : x.value = M.value.filter((o) => !d(o)).map((o) => C(o)), l("right-check-change", [...x.value]);
|
|
2146
|
+
}, R = (o) => {
|
|
2147
|
+
o === "left" ? k.value = "" : L.value = "";
|
|
2148
|
+
}, y = h(() => [a.b()]);
|
|
2131
2149
|
return p({
|
|
2132
|
-
clearQuery:
|
|
2133
|
-
}), (o,
|
|
2134
|
-
class: u(
|
|
2150
|
+
clearQuery: R
|
|
2151
|
+
}), (o, r) => (i(), c("div", {
|
|
2152
|
+
class: u(y.value)
|
|
2135
2153
|
}, [
|
|
2136
2154
|
f("div", {
|
|
2137
2155
|
class: u(s(a).e("panel"))
|
|
@@ -2144,82 +2162,82 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2144
2162
|
}, [
|
|
2145
2163
|
f("input", {
|
|
2146
2164
|
type: "checkbox",
|
|
2147
|
-
checked:
|
|
2148
|
-
indeterminate:
|
|
2149
|
-
onChange:
|
|
2150
|
-
}, null, 40,
|
|
2151
|
-
f("span", null,
|
|
2165
|
+
checked: D.value.length > 0 && D.value.length === V.value.filter((m) => !d(m)).length,
|
|
2166
|
+
indeterminate: D.value.length > 0 && D.value.length < V.value.filter((m) => !d(m)).length,
|
|
2167
|
+
onChange: J
|
|
2168
|
+
}, null, 40, Mt),
|
|
2169
|
+
f("span", null, z(n.titles[0]), 1)
|
|
2152
2170
|
], 2),
|
|
2153
2171
|
f("span", {
|
|
2154
2172
|
class: u(s(a).e("count"))
|
|
2155
|
-
},
|
|
2173
|
+
}, z(D.value.length) + " / " + z(V.value.length), 3)
|
|
2156
2174
|
], 2),
|
|
2157
|
-
n.filterable ? (
|
|
2175
|
+
n.filterable ? (i(), c("div", {
|
|
2158
2176
|
key: 0,
|
|
2159
2177
|
class: u(s(a).e("filter"))
|
|
2160
2178
|
}, [
|
|
2161
|
-
|
|
2162
|
-
"onUpdate:modelValue":
|
|
2179
|
+
ve(f("input", {
|
|
2180
|
+
"onUpdate:modelValue": r[0] || (r[0] = (m) => k.value = m),
|
|
2163
2181
|
placeholder: n.filterPlaceholder,
|
|
2164
2182
|
class: u(s(a).e("filter-input"))
|
|
2165
|
-
}, null, 10,
|
|
2166
|
-
[
|
|
2183
|
+
}, null, 10, Tt), [
|
|
2184
|
+
[Te, k.value]
|
|
2167
2185
|
]),
|
|
2168
|
-
|
|
2186
|
+
k.value ? (i(), c("span", {
|
|
2169
2187
|
key: 0,
|
|
2170
2188
|
class: u(s(a).e("filter-clear")),
|
|
2171
|
-
onClick:
|
|
2172
|
-
}, "×", 2)) :
|
|
2173
|
-
], 2)) :
|
|
2189
|
+
onClick: r[1] || (r[1] = (m) => R("left"))
|
|
2190
|
+
}, "×", 2)) : N("", !0)
|
|
2191
|
+
], 2)) : N("", !0),
|
|
2174
2192
|
f("div", {
|
|
2175
2193
|
class: u(s(a).e("body"))
|
|
2176
2194
|
}, [
|
|
2177
|
-
(
|
|
2178
|
-
key:
|
|
2195
|
+
(i(!0), c(j, null, _(V.value, (m) => (i(), c("div", {
|
|
2196
|
+
key: C(m),
|
|
2179
2197
|
class: u([
|
|
2180
2198
|
s(a).e("item"),
|
|
2181
|
-
s(a).is("disabled",
|
|
2182
|
-
s(a).is("checked",
|
|
2199
|
+
s(a).is("disabled", d(m)),
|
|
2200
|
+
s(a).is("checked", D.value.includes(C(m)))
|
|
2183
2201
|
]),
|
|
2184
|
-
onClick: (O) => !
|
|
2202
|
+
onClick: (O) => !d(m) && X(C(m))
|
|
2185
2203
|
}, [
|
|
2186
2204
|
f("label", {
|
|
2187
2205
|
class: u(s(a).e("checkbox"))
|
|
2188
2206
|
}, [
|
|
2189
2207
|
f("input", {
|
|
2190
2208
|
type: "checkbox",
|
|
2191
|
-
checked:
|
|
2192
|
-
disabled:
|
|
2193
|
-
onClick:
|
|
2209
|
+
checked: D.value.includes(C(m)),
|
|
2210
|
+
disabled: d(m),
|
|
2211
|
+
onClick: r[2] || (r[2] = ue(() => {
|
|
2194
2212
|
}, ["stop"])),
|
|
2195
|
-
onChange: (O) =>
|
|
2196
|
-
}, null, 40,
|
|
2197
|
-
f("span", null,
|
|
2213
|
+
onChange: (O) => X(C(m))
|
|
2214
|
+
}, null, 40, Bt),
|
|
2215
|
+
f("span", null, z(I(m)), 1)
|
|
2198
2216
|
], 2)
|
|
2199
|
-
], 10,
|
|
2200
|
-
|
|
2217
|
+
], 10, Rt))), 128)),
|
|
2218
|
+
V.value.length === 0 ? (i(), c("div", {
|
|
2201
2219
|
key: 0,
|
|
2202
2220
|
class: u(s(a).e("empty"))
|
|
2203
2221
|
}, [
|
|
2204
2222
|
le(o.$slots, "left-empty", {}, () => [
|
|
2205
|
-
|
|
2223
|
+
r[6] || (r[6] = fe("暂无数据", -1))
|
|
2206
2224
|
])
|
|
2207
|
-
], 2)) :
|
|
2225
|
+
], 2)) : N("", !0)
|
|
2208
2226
|
], 2)
|
|
2209
2227
|
], 2),
|
|
2210
2228
|
f("div", {
|
|
2211
2229
|
class: u(s(a).e("buttons"))
|
|
2212
2230
|
}, [
|
|
2231
|
+
f("button", {
|
|
2232
|
+
class: u([s(a).e("button"), s(a).is("disabled", b.value)]),
|
|
2233
|
+
disabled: b.value,
|
|
2234
|
+
onClick: B
|
|
2235
|
+
}, z(n.buttonTexts[0] || ">"), 11, Ft),
|
|
2213
2236
|
f("button", {
|
|
2214
2237
|
class: u([s(a).e("button"), s(a).is("disabled", T.value)]),
|
|
2215
2238
|
disabled: T.value,
|
|
2216
|
-
onClick:
|
|
2217
|
-
},
|
|
2218
|
-
f("button", {
|
|
2219
|
-
class: u([s(a).e("button"), s(a).is("disabled", R.value)]),
|
|
2220
|
-
disabled: R.value,
|
|
2221
|
-
onClick: z
|
|
2222
|
-
}, E(n.buttonTexts[1] || "<"), 11, Rt)
|
|
2239
|
+
onClick: K
|
|
2240
|
+
}, z(n.buttonTexts[1] || "<"), 11, It)
|
|
2223
2241
|
], 2),
|
|
2224
2242
|
f("div", {
|
|
2225
2243
|
class: u(s(a).e("panel"))
|
|
@@ -2232,72 +2250,72 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2232
2250
|
}, [
|
|
2233
2251
|
f("input", {
|
|
2234
2252
|
type: "checkbox",
|
|
2235
|
-
checked:
|
|
2236
|
-
indeterminate:
|
|
2237
|
-
onChange:
|
|
2238
|
-
}, null, 40,
|
|
2239
|
-
f("span", null,
|
|
2253
|
+
checked: x.value.length > 0 && x.value.length === M.value.filter((m) => !d(m)).length,
|
|
2254
|
+
indeterminate: x.value.length > 0 && x.value.length < M.value.filter((m) => !d(m)).length,
|
|
2255
|
+
onChange: $
|
|
2256
|
+
}, null, 40, Lt),
|
|
2257
|
+
f("span", null, z(n.titles[1]), 1)
|
|
2240
2258
|
], 2),
|
|
2241
2259
|
f("span", {
|
|
2242
2260
|
class: u(s(a).e("count"))
|
|
2243
|
-
},
|
|
2261
|
+
}, z(x.value.length) + " / " + z(M.value.length), 3)
|
|
2244
2262
|
], 2),
|
|
2245
|
-
n.filterable ? (
|
|
2263
|
+
n.filterable ? (i(), c("div", {
|
|
2246
2264
|
key: 0,
|
|
2247
2265
|
class: u(s(a).e("filter"))
|
|
2248
2266
|
}, [
|
|
2249
|
-
|
|
2250
|
-
"onUpdate:modelValue":
|
|
2267
|
+
ve(f("input", {
|
|
2268
|
+
"onUpdate:modelValue": r[3] || (r[3] = (m) => L.value = m),
|
|
2251
2269
|
placeholder: n.filterPlaceholder,
|
|
2252
2270
|
class: u(s(a).e("filter-input"))
|
|
2253
|
-
}, null, 10,
|
|
2254
|
-
[
|
|
2271
|
+
}, null, 10, Pt), [
|
|
2272
|
+
[Te, L.value]
|
|
2255
2273
|
]),
|
|
2256
|
-
|
|
2274
|
+
L.value ? (i(), c("span", {
|
|
2257
2275
|
key: 0,
|
|
2258
2276
|
class: u(s(a).e("filter-clear")),
|
|
2259
|
-
onClick:
|
|
2260
|
-
}, "×", 2)) :
|
|
2261
|
-
], 2)) :
|
|
2277
|
+
onClick: r[4] || (r[4] = (m) => R("right"))
|
|
2278
|
+
}, "×", 2)) : N("", !0)
|
|
2279
|
+
], 2)) : N("", !0),
|
|
2262
2280
|
f("div", {
|
|
2263
2281
|
class: u(s(a).e("body"))
|
|
2264
2282
|
}, [
|
|
2265
|
-
(
|
|
2266
|
-
key:
|
|
2283
|
+
(i(!0), c(j, null, _(M.value, (m) => (i(), c("div", {
|
|
2284
|
+
key: C(m),
|
|
2267
2285
|
class: u([
|
|
2268
2286
|
s(a).e("item"),
|
|
2269
|
-
s(a).is("disabled",
|
|
2270
|
-
s(a).is("checked",
|
|
2287
|
+
s(a).is("disabled", d(m)),
|
|
2288
|
+
s(a).is("checked", x.value.includes(C(m)))
|
|
2271
2289
|
]),
|
|
2272
|
-
onClick: (O) => !
|
|
2290
|
+
onClick: (O) => !d(m) && q(C(m))
|
|
2273
2291
|
}, [
|
|
2274
2292
|
f("label", {
|
|
2275
2293
|
class: u(s(a).e("checkbox"))
|
|
2276
2294
|
}, [
|
|
2277
2295
|
f("input", {
|
|
2278
2296
|
type: "checkbox",
|
|
2279
|
-
checked:
|
|
2280
|
-
disabled:
|
|
2281
|
-
onClick:
|
|
2297
|
+
checked: x.value.includes(C(m)),
|
|
2298
|
+
disabled: d(m),
|
|
2299
|
+
onClick: r[5] || (r[5] = ue(() => {
|
|
2282
2300
|
}, ["stop"])),
|
|
2283
|
-
onChange: (O) => q(
|
|
2284
|
-
}, null, 40,
|
|
2285
|
-
f("span", null,
|
|
2301
|
+
onChange: (O) => q(C(m))
|
|
2302
|
+
}, null, 40, Et),
|
|
2303
|
+
f("span", null, z(I(m)), 1)
|
|
2286
2304
|
], 2)
|
|
2287
|
-
], 10,
|
|
2288
|
-
M.value.length === 0 ? (
|
|
2305
|
+
], 10, At))), 128)),
|
|
2306
|
+
M.value.length === 0 ? (i(), c("div", {
|
|
2289
2307
|
key: 0,
|
|
2290
2308
|
class: u(s(a).e("empty"))
|
|
2291
2309
|
}, [
|
|
2292
2310
|
le(o.$slots, "right-empty", {}, () => [
|
|
2293
|
-
|
|
2311
|
+
r[7] || (r[7] = fe("暂无数据", -1))
|
|
2294
2312
|
])
|
|
2295
|
-
], 2)) :
|
|
2313
|
+
], 2)) : N("", !0)
|
|
2296
2314
|
], 2)
|
|
2297
2315
|
], 2)
|
|
2298
2316
|
], 2));
|
|
2299
2317
|
}
|
|
2300
|
-
}),
|
|
2318
|
+
}), Yt = { key: 0 }, zt = { key: 1 }, yl = /* @__PURE__ */ Z({
|
|
2301
2319
|
name: "XSlider",
|
|
2302
2320
|
__name: "index",
|
|
2303
2321
|
props: {
|
|
@@ -2315,114 +2333,114 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2315
2333
|
},
|
|
2316
2334
|
emits: ["update:modelValue", "change", "input"],
|
|
2317
2335
|
setup(n, { emit: p }) {
|
|
2318
|
-
const e = n, t = p, l =
|
|
2319
|
-
const
|
|
2320
|
-
return (e.modelValue - e.min) /
|
|
2321
|
-
}),
|
|
2336
|
+
const e = n, t = p, l = Q("slider"), a = E(), g = E(), v = E(!1), w = E(!1), k = h(() => {
|
|
2337
|
+
const R = e.max - e.min;
|
|
2338
|
+
return (e.modelValue - e.min) / R * 100;
|
|
2339
|
+
}), L = h(() => e.formatTooltip ? e.formatTooltip(e.modelValue) : e.modelValue), D = h(() => {
|
|
2322
2340
|
if (!e.showStops || e.min >= e.max) return [];
|
|
2323
|
-
const
|
|
2324
|
-
for (let o = 0; o <=
|
|
2325
|
-
const
|
|
2326
|
-
|
|
2341
|
+
const R = [], y = (e.max - e.min) / e.step;
|
|
2342
|
+
for (let o = 0; o <= y; o++) {
|
|
2343
|
+
const r = e.min + o * e.step;
|
|
2344
|
+
r > e.min && r < e.max && R.push((r - e.min) / (e.max - e.min) * 100);
|
|
2327
2345
|
}
|
|
2328
|
-
return
|
|
2329
|
-
}),
|
|
2330
|
-
const
|
|
2346
|
+
return R;
|
|
2347
|
+
}), x = h(() => e.marks ? Object.keys(e.marks).map((R) => {
|
|
2348
|
+
const y = Number(R), o = e.marks[y], r = (y - e.min) / (e.max - e.min) * 100;
|
|
2331
2349
|
let m, O = {};
|
|
2332
|
-
return typeof o == "string" ? m = o : (m = o.label || String(
|
|
2333
|
-
}) : []),
|
|
2350
|
+
return typeof o == "string" ? m = o : (m = o.label || String(y), O = o.style || {}), { value: y, pos: r, label: m, style: O };
|
|
2351
|
+
}) : []), C = () => a.value ? e.vertical ? a.value.offsetHeight : a.value.offsetWidth : 0, I = (R, y) => {
|
|
2334
2352
|
if (!a.value) return e.modelValue;
|
|
2335
|
-
const o = a.value.getBoundingClientRect(),
|
|
2353
|
+
const o = a.value.getBoundingClientRect(), r = C();
|
|
2336
2354
|
let m;
|
|
2337
|
-
e.vertical ? m = (o.bottom -
|
|
2338
|
-
const O = e.min + m / 100 * (e.max - e.min),
|
|
2339
|
-
return Math.max(e.min, Math.min(e.max,
|
|
2340
|
-
},
|
|
2355
|
+
e.vertical ? m = (o.bottom - y) / r * 100 : m = (R - o.left) / r * 100, m = Math.max(0, Math.min(100, m));
|
|
2356
|
+
const O = e.min + m / 100 * (e.max - e.min), te = Math.round(O / e.step) * e.step;
|
|
2357
|
+
return Math.max(e.min, Math.min(e.max, te));
|
|
2358
|
+
}, d = (R) => {
|
|
2341
2359
|
if (e.disabled) return;
|
|
2342
|
-
const
|
|
2343
|
-
|
|
2344
|
-
},
|
|
2360
|
+
const y = Math.max(e.min, Math.min(e.max, R));
|
|
2361
|
+
y !== e.modelValue && (t("update:modelValue", y), t("input", y));
|
|
2362
|
+
}, V = (R) => {
|
|
2345
2363
|
if (e.disabled) return;
|
|
2346
|
-
|
|
2347
|
-
const
|
|
2348
|
-
|
|
2349
|
-
}, M = (
|
|
2350
|
-
if (!
|
|
2351
|
-
const
|
|
2352
|
-
|
|
2353
|
-
},
|
|
2354
|
-
|
|
2355
|
-
},
|
|
2364
|
+
R.preventDefault(), w.value = !0, v.value = !0;
|
|
2365
|
+
const y = I(R.clientX, R.clientY);
|
|
2366
|
+
d(y), document.addEventListener("mousemove", M), document.addEventListener("mouseup", S);
|
|
2367
|
+
}, M = (R) => {
|
|
2368
|
+
if (!w.value) return;
|
|
2369
|
+
const y = I(R.clientX, R.clientY);
|
|
2370
|
+
d(y);
|
|
2371
|
+
}, S = () => {
|
|
2372
|
+
w.value = !1, t("change", e.modelValue), document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", S);
|
|
2373
|
+
}, P = (R) => {
|
|
2356
2374
|
if (e.disabled) return;
|
|
2357
|
-
|
|
2358
|
-
const
|
|
2359
|
-
|
|
2360
|
-
},
|
|
2361
|
-
if (!
|
|
2362
|
-
const
|
|
2363
|
-
|
|
2364
|
-
},
|
|
2365
|
-
|
|
2366
|
-
},
|
|
2375
|
+
R.preventDefault(), w.value = !0, v.value = !0;
|
|
2376
|
+
const y = R.touches[0], o = I(y.clientX, y.clientY);
|
|
2377
|
+
d(o);
|
|
2378
|
+
}, b = (R) => {
|
|
2379
|
+
if (!w.value) return;
|
|
2380
|
+
const y = R.touches[0], o = I(y.clientX, y.clientY);
|
|
2381
|
+
d(o);
|
|
2382
|
+
}, T = () => {
|
|
2383
|
+
w.value = !1, t("change", e.modelValue);
|
|
2384
|
+
}, B = () => {
|
|
2367
2385
|
e.showTooltip && (v.value = !0);
|
|
2368
|
-
},
|
|
2369
|
-
|
|
2386
|
+
}, K = () => {
|
|
2387
|
+
w.value || (v.value = !1);
|
|
2370
2388
|
};
|
|
2371
|
-
|
|
2372
|
-
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup",
|
|
2389
|
+
ke(() => {
|
|
2390
|
+
document.removeEventListener("mousemove", M), document.removeEventListener("mouseup", S);
|
|
2373
2391
|
});
|
|
2374
|
-
const
|
|
2392
|
+
const X = h(() => [
|
|
2375
2393
|
l.b(),
|
|
2376
2394
|
l.is("disabled", e.disabled),
|
|
2377
2395
|
l.is("vertical", e.vertical)
|
|
2378
|
-
]), q = h(() => e.vertical && e.height ? { height: typeof e.height == "number" ? `${e.height}px` : e.height } : {}),
|
|
2379
|
-
return (
|
|
2380
|
-
class: u(
|
|
2396
|
+
]), q = h(() => e.vertical && e.height ? { height: typeof e.height == "number" ? `${e.height}px` : e.height } : {}), J = h(() => e.vertical ? { height: `${k.value}%` } : { width: `${k.value}%` }), $ = h(() => e.vertical ? { bottom: `${k.value}%` } : { left: `${k.value}%` });
|
|
2397
|
+
return (R, y) => (i(), c("div", {
|
|
2398
|
+
class: u(X.value),
|
|
2381
2399
|
style: ae(q.value)
|
|
2382
2400
|
}, [
|
|
2383
2401
|
f("div", {
|
|
2384
2402
|
ref_key: "sliderRef",
|
|
2385
2403
|
ref: a,
|
|
2386
2404
|
class: u(s(l).e("runway")),
|
|
2387
|
-
onMousedown:
|
|
2388
|
-
onTouchstart:
|
|
2405
|
+
onMousedown: V,
|
|
2406
|
+
onTouchstart: P
|
|
2389
2407
|
}, [
|
|
2390
2408
|
f("div", {
|
|
2391
2409
|
class: u(s(l).e("bar")),
|
|
2392
|
-
style: ae(
|
|
2410
|
+
style: ae(J.value)
|
|
2393
2411
|
}, null, 6),
|
|
2394
|
-
n.showStops ? (
|
|
2395
|
-
(
|
|
2396
|
-
key:
|
|
2412
|
+
n.showStops ? (i(), c("div", Yt, [
|
|
2413
|
+
(i(!0), c(j, null, _(D.value, (o, r) => (i(), c("div", {
|
|
2414
|
+
key: r,
|
|
2397
2415
|
class: u(s(l).e("stop")),
|
|
2398
2416
|
style: ae(n.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2399
2417
|
}, null, 6))), 128))
|
|
2400
|
-
])) :
|
|
2401
|
-
|
|
2402
|
-
(
|
|
2418
|
+
])) : N("", !0),
|
|
2419
|
+
x.value.length > 0 ? (i(), c("div", zt, [
|
|
2420
|
+
(i(!0), c(j, null, _(x.value, (o) => (i(), c("div", {
|
|
2403
2421
|
key: o.value,
|
|
2404
2422
|
class: u(s(l).e("mark")),
|
|
2405
2423
|
style: ae(n.vertical ? { bottom: `${o.pos}%` } : { left: `${o.pos}%`, ...o.style })
|
|
2406
2424
|
}, [
|
|
2407
2425
|
f("span", {
|
|
2408
2426
|
class: u(s(l).e("mark-text"))
|
|
2409
|
-
},
|
|
2427
|
+
}, z(o.label), 3)
|
|
2410
2428
|
], 6))), 128))
|
|
2411
|
-
])) :
|
|
2429
|
+
])) : N("", !0),
|
|
2412
2430
|
f("div", {
|
|
2413
2431
|
ref_key: "buttonRef",
|
|
2414
|
-
ref:
|
|
2432
|
+
ref: g,
|
|
2415
2433
|
class: u(s(l).e("button-wrapper")),
|
|
2416
|
-
style: ae(
|
|
2417
|
-
onMouseenter:
|
|
2418
|
-
onMouseleave:
|
|
2419
|
-
onTouchmove:
|
|
2420
|
-
onTouchend:
|
|
2434
|
+
style: ae($.value),
|
|
2435
|
+
onMouseenter: B,
|
|
2436
|
+
onMouseleave: K,
|
|
2437
|
+
onTouchmove: b,
|
|
2438
|
+
onTouchend: T
|
|
2421
2439
|
}, [
|
|
2422
|
-
n.showTooltip && v.value ? (
|
|
2440
|
+
n.showTooltip && v.value ? (i(), c("div", {
|
|
2423
2441
|
key: 0,
|
|
2424
2442
|
class: u(s(l).e("tooltip"))
|
|
2425
|
-
},
|
|
2443
|
+
}, z(L.value), 3)) : N("", !0),
|
|
2426
2444
|
f("div", {
|
|
2427
2445
|
class: u(s(l).e("button"))
|
|
2428
2446
|
}, null, 2)
|
|
@@ -2430,22 +2448,22 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2430
2448
|
], 34)
|
|
2431
2449
|
], 6));
|
|
2432
2450
|
}
|
|
2433
|
-
}),
|
|
2451
|
+
}), Ht = ["src"], Ot = {
|
|
2434
2452
|
key: 0,
|
|
2435
2453
|
class: "status-uploading"
|
|
2436
|
-
},
|
|
2454
|
+
}, Nt = { class: "progress-circle" }, Kt = { class: "progress-text" }, Xt = {
|
|
2437
2455
|
key: 1,
|
|
2438
2456
|
class: "status-error"
|
|
2439
|
-
},
|
|
2457
|
+
}, Ut = {
|
|
2440
2458
|
key: 2,
|
|
2441
2459
|
class: "status-success"
|
|
2442
|
-
},
|
|
2460
|
+
}, Wt = {
|
|
2443
2461
|
key: 0,
|
|
2444
2462
|
class: "action-preview"
|
|
2445
|
-
},
|
|
2463
|
+
}, Gt = ["onClick"], qt = ["disabled"], jt = { class: "progress-text" }, Zt = ["onClick"], Qt = ["src"], Jt = {
|
|
2446
2464
|
key: 0,
|
|
2447
2465
|
class: "action-success"
|
|
2448
|
-
},
|
|
2466
|
+
}, _t = ["onClick"], el = ["multiple", "accept", "disabled"], kl = /* @__PURE__ */ Z({
|
|
2449
2467
|
name: "XUpload",
|
|
2450
2468
|
__name: "index",
|
|
2451
2469
|
props: {
|
|
@@ -2475,13 +2493,13 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2475
2493
|
},
|
|
2476
2494
|
emits: ["update:fileList", "success", "error", "progress", "change", "remove", "exceed"],
|
|
2477
2495
|
setup(n, { expose: p, emit: e }) {
|
|
2478
|
-
const t = n, l = e, a =
|
|
2479
|
-
|
|
2480
|
-
const
|
|
2481
|
-
let
|
|
2482
|
-
const
|
|
2496
|
+
const t = n, l = e, a = Q("upload");
|
|
2497
|
+
Ae();
|
|
2498
|
+
const g = E(), v = E([...t.fileList]), w = E(!1);
|
|
2499
|
+
let k = 1;
|
|
2500
|
+
const L = () => Date.now() + k++, D = ($) => {
|
|
2483
2501
|
var o;
|
|
2484
|
-
const
|
|
2502
|
+
const R = (o = $.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), y = {
|
|
2485
2503
|
pdf: "📄",
|
|
2486
2504
|
doc: "📝",
|
|
2487
2505
|
docx: "📝",
|
|
@@ -2495,302 +2513,302 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2495
2513
|
mp4: "🎬",
|
|
2496
2514
|
default: "📁"
|
|
2497
2515
|
};
|
|
2498
|
-
return
|
|
2499
|
-
},
|
|
2516
|
+
return y[R || ""] || y.default;
|
|
2517
|
+
}, x = h(() => t.limit ? v.value.length < t.limit : !0), C = h(() => [
|
|
2500
2518
|
a.b(),
|
|
2501
2519
|
a.is("disabled", t.disabled),
|
|
2502
2520
|
a.is("drag", t.drag),
|
|
2503
2521
|
a.m(t.listType)
|
|
2504
|
-
]),
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2507
|
-
},
|
|
2508
|
-
var
|
|
2509
|
-
if (t.limit && v.value.length +
|
|
2510
|
-
l("exceed",
|
|
2522
|
+
]), I = ($) => {
|
|
2523
|
+
const R = $.target.files;
|
|
2524
|
+
!R || R.length === 0 || (d(Array.from(R)), g.value && (g.value.value = ""));
|
|
2525
|
+
}, d = async ($) => {
|
|
2526
|
+
var R, y;
|
|
2527
|
+
if (t.limit && v.value.length + $.length > t.limit) {
|
|
2528
|
+
l("exceed", $, v.value), (R = t.onExceed) == null || R.call(t, $, v.value);
|
|
2511
2529
|
return;
|
|
2512
2530
|
}
|
|
2513
|
-
for (const o of
|
|
2514
|
-
if (t.beforeUpload && await t.beforeUpload(o,
|
|
2531
|
+
for (const o of $) {
|
|
2532
|
+
if (t.beforeUpload && await t.beforeUpload(o, $) === !1)
|
|
2515
2533
|
continue;
|
|
2516
|
-
const
|
|
2534
|
+
const r = {
|
|
2517
2535
|
name: o.name,
|
|
2518
2536
|
size: o.size,
|
|
2519
2537
|
status: "ready",
|
|
2520
2538
|
percentage: 0,
|
|
2521
|
-
uid:
|
|
2539
|
+
uid: L(),
|
|
2522
2540
|
raw: o
|
|
2523
2541
|
};
|
|
2524
|
-
o.type.startsWith("image/") && (
|
|
2542
|
+
o.type.startsWith("image/") && (r.thumbUrl = await V(o), r.url = r.thumbUrl), v.value.push(r), l("update:fileList", v.value), l("change", r, v.value), (y = t.onChange) == null || y.call(t, r, v.value), t.autoUpload && M(r);
|
|
2525
2543
|
}
|
|
2526
|
-
},
|
|
2527
|
-
const
|
|
2528
|
-
|
|
2529
|
-
var
|
|
2530
|
-
|
|
2531
|
-
},
|
|
2532
|
-
}), M = (
|
|
2533
|
-
if (
|
|
2534
|
-
|
|
2544
|
+
}, V = ($) => new Promise((R) => {
|
|
2545
|
+
const y = new FileReader();
|
|
2546
|
+
y.onload = (o) => {
|
|
2547
|
+
var r;
|
|
2548
|
+
R((r = o.target) == null ? void 0 : r.result);
|
|
2549
|
+
}, y.readAsDataURL($);
|
|
2550
|
+
}), M = ($) => {
|
|
2551
|
+
if (!$.raw) return;
|
|
2552
|
+
$.status = "uploading", (t.httpRequest || S)({
|
|
2535
2553
|
action: t.action,
|
|
2536
2554
|
headers: t.headers,
|
|
2537
2555
|
data: t.data,
|
|
2538
|
-
file:
|
|
2556
|
+
file: $.raw,
|
|
2539
2557
|
name: t.name,
|
|
2540
2558
|
withCredentials: t.withCredentials,
|
|
2541
|
-
onProgress: (
|
|
2559
|
+
onProgress: (y) => {
|
|
2542
2560
|
var o;
|
|
2543
|
-
|
|
2561
|
+
$.percentage = y.percent, l("progress", y, $, v.value), (o = t.onProgress) == null || o.call(t, y, $, v.value);
|
|
2544
2562
|
},
|
|
2545
|
-
onSuccess: (
|
|
2563
|
+
onSuccess: (y) => {
|
|
2546
2564
|
var o;
|
|
2547
|
-
|
|
2565
|
+
$.status = "success", $.response = y, l("success", y, $, v.value), (o = t.onSuccess) == null || o.call(t, y, $, v.value);
|
|
2548
2566
|
},
|
|
2549
|
-
onError: (
|
|
2567
|
+
onError: (y) => {
|
|
2550
2568
|
var o;
|
|
2551
|
-
|
|
2569
|
+
$.status = "error", l("error", y, $, v.value), (o = t.onError) == null || o.call(t, y, $, v.value);
|
|
2552
2570
|
}
|
|
2553
2571
|
});
|
|
2554
|
-
},
|
|
2572
|
+
}, S = ($) => new Promise((R, y) => {
|
|
2555
2573
|
const o = new XMLHttpRequest();
|
|
2556
2574
|
o.upload.addEventListener("progress", (m) => {
|
|
2557
|
-
m.lengthComputable &&
|
|
2575
|
+
m.lengthComputable && $.onProgress({ percent: m.loaded / m.total * 100 });
|
|
2558
2576
|
}), o.addEventListener("load", () => {
|
|
2559
2577
|
if (o.status < 200 || o.status >= 300) {
|
|
2560
|
-
|
|
2578
|
+
$.onError(new Error("Upload failed")), y(new Error("Upload failed"));
|
|
2561
2579
|
return;
|
|
2562
2580
|
}
|
|
2563
2581
|
try {
|
|
2564
2582
|
const m = JSON.parse(o.responseText);
|
|
2565
|
-
|
|
2583
|
+
$.onSuccess(m), R(m);
|
|
2566
2584
|
} catch {
|
|
2567
|
-
|
|
2585
|
+
$.onSuccess(o.responseText), R(o.responseText);
|
|
2568
2586
|
}
|
|
2569
2587
|
}), o.addEventListener("error", () => {
|
|
2570
|
-
|
|
2588
|
+
$.onError(new Error("Upload error")), y(new Error("Upload error"));
|
|
2571
2589
|
});
|
|
2572
|
-
const
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
}), o.open("POST",
|
|
2576
|
-
o.setRequestHeader(m,
|
|
2577
|
-
}), o.send(
|
|
2578
|
-
}),
|
|
2579
|
-
var
|
|
2580
|
-
if (t.beforeRemove && await t.beforeRemove(
|
|
2590
|
+
const r = new FormData();
|
|
2591
|
+
r.append($.name, $.file), $.data && Object.keys($.data).forEach((m) => {
|
|
2592
|
+
r.append(m, $.data[m]);
|
|
2593
|
+
}), o.open("POST", $.action, !0), $.withCredentials && (o.withCredentials = !0), $.headers && Object.keys($.headers).forEach((m) => {
|
|
2594
|
+
o.setRequestHeader(m, $.headers[m]);
|
|
2595
|
+
}), o.send(r);
|
|
2596
|
+
}), P = async ($) => {
|
|
2597
|
+
var y;
|
|
2598
|
+
if (t.beforeRemove && await t.beforeRemove($, v.value) === !1)
|
|
2581
2599
|
return;
|
|
2582
|
-
const
|
|
2583
|
-
|
|
2600
|
+
const R = v.value.findIndex((o) => o.uid === $.uid);
|
|
2601
|
+
R > -1 && (v.value.splice(R, 1), l("update:fileList", v.value), l("remove", $, v.value), (y = t.onRemove) == null || y.call(t, $, v.value));
|
|
2602
|
+
}, b = () => {
|
|
2603
|
+
v.value.filter(($) => $.status === "ready" && $.raw).forEach(($) => M($));
|
|
2584
2604
|
}, T = () => {
|
|
2585
|
-
v.value.filter((D) => D.status === "ready" && D.raw).forEach((D) => M(D));
|
|
2586
|
-
}, R = () => {
|
|
2587
2605
|
v.value = [], l("update:fileList", v.value);
|
|
2588
|
-
},
|
|
2589
|
-
var
|
|
2590
|
-
t.disabled || (
|
|
2591
|
-
},
|
|
2592
|
-
|
|
2593
|
-
},
|
|
2594
|
-
|
|
2595
|
-
}, q = (
|
|
2596
|
-
var
|
|
2597
|
-
if (
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2600
|
-
},
|
|
2601
|
-
if (
|
|
2602
|
-
const
|
|
2603
|
-
let
|
|
2604
|
-
for (; o >= 1024 &&
|
|
2605
|
-
o /= 1024,
|
|
2606
|
-
return `${o.toFixed(2)} ${
|
|
2606
|
+
}, B = () => {
|
|
2607
|
+
var $;
|
|
2608
|
+
t.disabled || ($ = g.value) == null || $.click();
|
|
2609
|
+
}, K = ($) => {
|
|
2610
|
+
$.preventDefault(), !t.disabled && t.drag && (w.value = !0);
|
|
2611
|
+
}, X = () => {
|
|
2612
|
+
w.value = !1;
|
|
2613
|
+
}, q = ($) => {
|
|
2614
|
+
var y;
|
|
2615
|
+
if ($.preventDefault(), w.value = !1, t.disabled) return;
|
|
2616
|
+
const R = (y = $.dataTransfer) == null ? void 0 : y.files;
|
|
2617
|
+
R && R.length > 0 && d(Array.from(R));
|
|
2618
|
+
}, J = ($) => {
|
|
2619
|
+
if (!$) return "0 B";
|
|
2620
|
+
const R = ["B", "KB", "MB", "GB"];
|
|
2621
|
+
let y = 0, o = $;
|
|
2622
|
+
for (; o >= 1024 && y < R.length - 1; )
|
|
2623
|
+
o /= 1024, y++;
|
|
2624
|
+
return `${o.toFixed(2)} ${R[y]}`;
|
|
2607
2625
|
};
|
|
2608
2626
|
return p({
|
|
2609
|
-
submit:
|
|
2610
|
-
clearFiles:
|
|
2627
|
+
submit: b,
|
|
2628
|
+
clearFiles: T,
|
|
2611
2629
|
uploadFiles: v
|
|
2612
|
-
}), (
|
|
2613
|
-
class: u(
|
|
2630
|
+
}), ($, R) => (i(), c("div", {
|
|
2631
|
+
class: u(C.value)
|
|
2614
2632
|
}, [
|
|
2615
|
-
n.drag ? (
|
|
2633
|
+
n.drag ? (i(), c("div", {
|
|
2616
2634
|
key: 0,
|
|
2617
|
-
class: u([s(a).e("drag"), s(a).is("dragover",
|
|
2618
|
-
onClick:
|
|
2619
|
-
onDragover:
|
|
2620
|
-
onDragleave:
|
|
2635
|
+
class: u([s(a).e("drag"), s(a).is("dragover", w.value)]),
|
|
2636
|
+
onClick: B,
|
|
2637
|
+
onDragover: K,
|
|
2638
|
+
onDragleave: X,
|
|
2621
2639
|
onDrop: q
|
|
2622
2640
|
}, [
|
|
2623
|
-
le(
|
|
2641
|
+
le($.$slots, "drag", {}, () => [
|
|
2624
2642
|
f("span", {
|
|
2625
2643
|
class: u(s(a).e("drag-icon"))
|
|
2626
2644
|
}, "📁", 2),
|
|
2627
2645
|
f("div", {
|
|
2628
2646
|
class: u(s(a).e("drag-text"))
|
|
2629
|
-
}, [
|
|
2630
|
-
|
|
2647
|
+
}, [...R[0] || (R[0] = [
|
|
2648
|
+
fe(" 将文件拖到此处,或", -1),
|
|
2631
2649
|
f("em", null, "点击上传", -1)
|
|
2632
2650
|
])], 2)
|
|
2633
2651
|
])
|
|
2634
|
-
], 34)) : n.listType === "picture-card" ? (
|
|
2652
|
+
], 34)) : n.listType === "picture-card" ? (i(), c("ul", {
|
|
2635
2653
|
key: 1,
|
|
2636
2654
|
class: u([s(a).e("files"), s(a).e("upload-list")])
|
|
2637
2655
|
}, [
|
|
2638
|
-
(
|
|
2639
|
-
key:
|
|
2640
|
-
class: u([s(a).e("file"), s(a).is(`status-${
|
|
2656
|
+
(i(!0), c(j, null, _(v.value, (y) => (i(), c("li", {
|
|
2657
|
+
key: y.uid,
|
|
2658
|
+
class: u([s(a).e("file"), s(a).is(`status-${y.status}`)])
|
|
2641
2659
|
}, [
|
|
2642
|
-
|
|
2660
|
+
y.thumbUrl && y.status !== "uploading" ? (i(), c("img", {
|
|
2643
2661
|
key: 0,
|
|
2644
|
-
src:
|
|
2662
|
+
src: y.thumbUrl,
|
|
2645
2663
|
class: u(s(a).e("file-image"))
|
|
2646
|
-
}, null, 10,
|
|
2664
|
+
}, null, 10, Ht)) : (i(), c("div", {
|
|
2647
2665
|
key: 1,
|
|
2648
2666
|
class: u(s(a).e("file-status"))
|
|
2649
2667
|
}, [
|
|
2650
|
-
|
|
2651
|
-
f("span",
|
|
2652
|
-
f("span",
|
|
2668
|
+
y.status === "uploading" ? (i(), c("span", Ot, [
|
|
2669
|
+
f("span", Nt, [
|
|
2670
|
+
f("span", Kt, z(Math.round(y.percentage || 0)) + "%", 1)
|
|
2653
2671
|
])
|
|
2654
|
-
])) :
|
|
2672
|
+
])) : y.status === "error" ? (i(), c("span", Xt, "✕")) : y.status === "success" ? (i(), c("span", Ut, "✓")) : N("", !0)
|
|
2655
2673
|
], 2)),
|
|
2656
2674
|
f("span", {
|
|
2657
2675
|
class: u(s(a).e("file-actions"))
|
|
2658
2676
|
}, [
|
|
2659
|
-
|
|
2677
|
+
y.url ? (i(), c("span", Wt, "👁️")) : N("", !0),
|
|
2660
2678
|
f("span", {
|
|
2661
2679
|
class: "action-remove",
|
|
2662
|
-
onClick: (o) =>
|
|
2663
|
-
}, "🗑️", 8,
|
|
2680
|
+
onClick: (o) => P(y)
|
|
2681
|
+
}, "🗑️", 8, Gt)
|
|
2664
2682
|
], 2)
|
|
2665
2683
|
], 2))), 128)),
|
|
2666
|
-
|
|
2684
|
+
x.value ? (i(), c("li", {
|
|
2667
2685
|
key: 0,
|
|
2668
2686
|
class: u(s(a).e("upload-card")),
|
|
2669
|
-
onClick:
|
|
2687
|
+
onClick: B
|
|
2670
2688
|
}, [
|
|
2671
|
-
le(
|
|
2672
|
-
|
|
2689
|
+
le($.$slots, "trigger", {}, () => [
|
|
2690
|
+
R[1] || (R[1] = f("span", { class: "upload-icon" }, "+", -1))
|
|
2673
2691
|
])
|
|
2674
|
-
], 2)) :
|
|
2675
|
-
], 2)) : (
|
|
2692
|
+
], 2)) : N("", !0)
|
|
2693
|
+
], 2)) : (i(), c(j, { key: 2 }, [
|
|
2676
2694
|
f("div", {
|
|
2677
2695
|
class: u(s(a).e("trigger-wrapper")),
|
|
2678
|
-
onClick:
|
|
2696
|
+
onClick: B
|
|
2679
2697
|
}, [
|
|
2680
|
-
le(
|
|
2681
|
-
|
|
2698
|
+
le($.$slots, "trigger", {}, () => [
|
|
2699
|
+
x.value ? (i(), c("button", {
|
|
2682
2700
|
key: 0,
|
|
2683
2701
|
type: "button",
|
|
2684
2702
|
class: u(s(a).e("trigger")),
|
|
2685
2703
|
disabled: n.disabled
|
|
2686
2704
|
}, [
|
|
2687
|
-
le(
|
|
2688
|
-
|
|
2705
|
+
le($.$slots, "default", {}, () => [
|
|
2706
|
+
R[2] || (R[2] = fe("点击上传", -1))
|
|
2689
2707
|
])
|
|
2690
|
-
], 10,
|
|
2708
|
+
], 10, qt)) : N("", !0)
|
|
2691
2709
|
])
|
|
2692
2710
|
], 2),
|
|
2693
|
-
n.showFileList && v.value.length > 0 ? (
|
|
2711
|
+
n.showFileList && v.value.length > 0 ? (i(), c("ul", {
|
|
2694
2712
|
key: 0,
|
|
2695
2713
|
class: u(s(a).e("files"))
|
|
2696
2714
|
}, [
|
|
2697
|
-
(
|
|
2698
|
-
key:
|
|
2699
|
-
class: u([s(a).e("file"), s(a).is(`status-${
|
|
2715
|
+
(i(!0), c(j, null, _(v.value, (y) => (i(), c("li", {
|
|
2716
|
+
key: y.uid,
|
|
2717
|
+
class: u([s(a).e("file"), s(a).is(`status-${y.status}`)])
|
|
2700
2718
|
}, [
|
|
2701
|
-
n.listType === "text" ? (
|
|
2719
|
+
n.listType === "text" ? (i(), c(j, { key: 0 }, [
|
|
2702
2720
|
f("span", {
|
|
2703
2721
|
class: u(s(a).e("file-icon"))
|
|
2704
|
-
},
|
|
2722
|
+
}, z(D(y)), 3),
|
|
2705
2723
|
f("span", {
|
|
2706
2724
|
class: u(s(a).e("file-name"))
|
|
2707
|
-
},
|
|
2725
|
+
}, z(y.name), 3),
|
|
2708
2726
|
f("span", {
|
|
2709
2727
|
class: u(s(a).e("file-size"))
|
|
2710
|
-
},
|
|
2711
|
-
|
|
2728
|
+
}, z(J(y.size)), 3),
|
|
2729
|
+
y.status === "uploading" ? (i(), c("span", {
|
|
2712
2730
|
key: 0,
|
|
2713
2731
|
class: u(s(a).e("file-progress"))
|
|
2714
2732
|
}, [
|
|
2715
2733
|
f("span", {
|
|
2716
2734
|
class: "progress-bar",
|
|
2717
|
-
style: ae({ width:
|
|
2735
|
+
style: ae({ width: y.percentage + "%" })
|
|
2718
2736
|
}, null, 4),
|
|
2719
|
-
f("span",
|
|
2720
|
-
], 2)) :
|
|
2721
|
-
|
|
2737
|
+
f("span", jt, z(Math.round(y.percentage || 0)) + "%", 1)
|
|
2738
|
+
], 2)) : N("", !0),
|
|
2739
|
+
y.status === "success" ? (i(), c("span", {
|
|
2722
2740
|
key: 1,
|
|
2723
2741
|
class: u(s(a).e("file-success"))
|
|
2724
|
-
}, "✓", 2)) :
|
|
2725
|
-
|
|
2742
|
+
}, "✓", 2)) : N("", !0),
|
|
2743
|
+
y.status === "error" ? (i(), c("span", {
|
|
2726
2744
|
key: 2,
|
|
2727
2745
|
class: u(s(a).e("file-error"))
|
|
2728
|
-
}, "✕", 2)) :
|
|
2746
|
+
}, "✕", 2)) : N("", !0),
|
|
2729
2747
|
f("span", {
|
|
2730
2748
|
class: u(s(a).e("file-actions"))
|
|
2731
2749
|
}, [
|
|
2732
2750
|
f("span", {
|
|
2733
2751
|
class: "action-remove",
|
|
2734
|
-
onClick: (o) =>
|
|
2735
|
-
}, "✕", 8,
|
|
2752
|
+
onClick: (o) => P(y)
|
|
2753
|
+
}, "✕", 8, Zt)
|
|
2736
2754
|
], 2)
|
|
2737
|
-
], 64)) : n.listType === "picture" ? (
|
|
2738
|
-
|
|
2755
|
+
], 64)) : n.listType === "picture" ? (i(), c(j, { key: 1 }, [
|
|
2756
|
+
y.thumbUrl ? (i(), c("img", {
|
|
2739
2757
|
key: 0,
|
|
2740
|
-
src:
|
|
2758
|
+
src: y.thumbUrl,
|
|
2741
2759
|
class: u(s(a).e("file-thumb"))
|
|
2742
|
-
}, null, 10,
|
|
2760
|
+
}, null, 10, Qt)) : (i(), c("span", {
|
|
2743
2761
|
key: 1,
|
|
2744
2762
|
class: u(s(a).e("file-icon"))
|
|
2745
|
-
},
|
|
2763
|
+
}, z(D(y)), 3)),
|
|
2746
2764
|
f("div", {
|
|
2747
2765
|
class: u(s(a).e("file-info"))
|
|
2748
2766
|
}, [
|
|
2749
2767
|
f("span", {
|
|
2750
2768
|
class: u(s(a).e("file-name"))
|
|
2751
|
-
},
|
|
2752
|
-
|
|
2769
|
+
}, z(y.name), 3),
|
|
2770
|
+
y.status === "uploading" ? (i(), c("span", {
|
|
2753
2771
|
key: 0,
|
|
2754
2772
|
class: u(s(a).e("file-progress"))
|
|
2755
2773
|
}, [
|
|
2756
2774
|
f("span", {
|
|
2757
2775
|
class: "progress-bar",
|
|
2758
|
-
style: ae({ width:
|
|
2776
|
+
style: ae({ width: y.percentage + "%" })
|
|
2759
2777
|
}, null, 4)
|
|
2760
|
-
], 2)) :
|
|
2778
|
+
], 2)) : N("", !0)
|
|
2761
2779
|
], 2),
|
|
2762
2780
|
f("span", {
|
|
2763
2781
|
class: u(s(a).e("file-actions"))
|
|
2764
2782
|
}, [
|
|
2765
|
-
|
|
2783
|
+
y.status === "success" ? (i(), c("span", Jt, "✓")) : N("", !0),
|
|
2766
2784
|
f("span", {
|
|
2767
2785
|
class: "action-remove",
|
|
2768
|
-
onClick: (o) =>
|
|
2769
|
-
}, "✕", 8,
|
|
2786
|
+
onClick: (o) => P(y)
|
|
2787
|
+
}, "✕", 8, _t)
|
|
2770
2788
|
], 2)
|
|
2771
|
-
], 64)) :
|
|
2789
|
+
], 64)) : N("", !0)
|
|
2772
2790
|
], 2))), 128))
|
|
2773
|
-
], 2)) :
|
|
2791
|
+
], 2)) : N("", !0)
|
|
2774
2792
|
], 64)),
|
|
2775
2793
|
f("input", {
|
|
2776
2794
|
ref_key: "inputRef",
|
|
2777
|
-
ref:
|
|
2795
|
+
ref: g,
|
|
2778
2796
|
type: "file",
|
|
2779
2797
|
class: u(s(a).e("input")),
|
|
2780
2798
|
multiple: n.multiple,
|
|
2781
2799
|
accept: n.accept,
|
|
2782
2800
|
disabled: n.disabled,
|
|
2783
|
-
onChange:
|
|
2784
|
-
}, null, 42,
|
|
2785
|
-
|
|
2801
|
+
onChange: I
|
|
2802
|
+
}, null, 42, el),
|
|
2803
|
+
$.$slots.tip ? (i(), c("div", {
|
|
2786
2804
|
key: 3,
|
|
2787
2805
|
class: u(s(a).e("tip"))
|
|
2788
2806
|
}, [
|
|
2789
|
-
le(
|
|
2790
|
-
], 2)) :
|
|
2807
|
+
le($.$slots, "tip")
|
|
2808
|
+
], 2)) : N("", !0)
|
|
2791
2809
|
], 2));
|
|
2792
2810
|
}
|
|
2793
|
-
}),
|
|
2811
|
+
}), tl = ["onMousemove", "onClick"], xl = /* @__PURE__ */ Z({
|
|
2794
2812
|
name: "XRate",
|
|
2795
2813
|
__name: "index",
|
|
2796
2814
|
props: {
|
|
@@ -2816,92 +2834,92 @@ const xt = ["onClick"], wt = ["placeholder", "disabled", "readonly", "value"], V
|
|
|
2816
2834
|
},
|
|
2817
2835
|
emits: ["update:modelValue", "change"],
|
|
2818
2836
|
setup(n, { emit: p }) {
|
|
2819
|
-
const e = n, t = p, l =
|
|
2837
|
+
const e = n, t = p, l = Q("rate"), a = E(-1), g = h(() => a.value > -1 ? a.value : e.modelValue), v = h(() => [
|
|
2820
2838
|
l.b(),
|
|
2821
2839
|
l.m(e.size),
|
|
2822
2840
|
l.is("disabled", e.disabled),
|
|
2823
2841
|
l.is("readonly", e.readonly)
|
|
2824
|
-
]),
|
|
2825
|
-
const
|
|
2826
|
-
return
|
|
2827
|
-
},
|
|
2842
|
+
]), w = (d) => e.disabled ? e.disabledVoidColor : d <= e.lowThreshold ? e.colors[0] : d <= e.highThreshold ? e.colors[1] || e.colors[0] : e.colors[2] || e.colors[1] || e.colors[0], k = (d) => {
|
|
2843
|
+
const V = g.value;
|
|
2844
|
+
return V >= d ? 100 : e.allowHalf && V >= d - 0.5 ? 50 : 0;
|
|
2845
|
+
}, L = (d) => k(d) > 0 ? w(g.value) : e.disabled ? e.disabledVoidColor : e.voidColor, D = h(() => {
|
|
2828
2846
|
if (e.showScore)
|
|
2829
2847
|
return e.scoreTemplate.replace("{value}", String(e.modelValue));
|
|
2830
2848
|
if (e.showText) {
|
|
2831
|
-
const
|
|
2832
|
-
return e.texts[Math.max(0,
|
|
2849
|
+
const d = Math.min(Math.ceil(e.modelValue || 0), e.max) - 1;
|
|
2850
|
+
return e.texts[Math.max(0, d)] || "";
|
|
2833
2851
|
}
|
|
2834
2852
|
return "";
|
|
2835
|
-
}),
|
|
2853
|
+
}), x = (d, V) => {
|
|
2836
2854
|
if (!(e.disabled || e.readonly))
|
|
2837
2855
|
if (e.allowHalf) {
|
|
2838
|
-
const
|
|
2839
|
-
a.value =
|
|
2856
|
+
const S = V.currentTarget.getBoundingClientRect(), P = V.clientX - S.left < S.width / 2;
|
|
2857
|
+
a.value = P ? d - 0.5 : d;
|
|
2840
2858
|
} else
|
|
2841
|
-
a.value =
|
|
2842
|
-
},
|
|
2859
|
+
a.value = d;
|
|
2860
|
+
}, C = () => {
|
|
2843
2861
|
e.disabled || e.readonly || (a.value = -1);
|
|
2844
|
-
},
|
|
2862
|
+
}, I = (d, V) => {
|
|
2845
2863
|
if (e.disabled || e.readonly) return;
|
|
2846
2864
|
let M;
|
|
2847
2865
|
if (e.allowHalf) {
|
|
2848
|
-
const
|
|
2849
|
-
M =
|
|
2866
|
+
const P = V.currentTarget.getBoundingClientRect();
|
|
2867
|
+
M = V.clientX - P.left < P.width / 2 ? d - 0.5 : d;
|
|
2850
2868
|
} else
|
|
2851
|
-
M =
|
|
2869
|
+
M = d;
|
|
2852
2870
|
t("update:modelValue", M), t("change", M);
|
|
2853
2871
|
};
|
|
2854
|
-
return (
|
|
2872
|
+
return (d, V) => (i(), c("div", {
|
|
2855
2873
|
class: u(v.value),
|
|
2856
|
-
onMouseleave:
|
|
2874
|
+
onMouseleave: C
|
|
2857
2875
|
}, [
|
|
2858
2876
|
f("div", {
|
|
2859
2877
|
class: u(s(l).e("items"))
|
|
2860
2878
|
}, [
|
|
2861
|
-
(
|
|
2879
|
+
(i(!0), c(j, null, _(n.max, (M) => (i(), c("span", {
|
|
2862
2880
|
key: M,
|
|
2863
2881
|
class: u(s(l).e("item")),
|
|
2864
|
-
onMousemove: (
|
|
2865
|
-
onClick: (
|
|
2882
|
+
onMousemove: (S) => x(M, S),
|
|
2883
|
+
onClick: (S) => I(M, S)
|
|
2866
2884
|
}, [
|
|
2867
2885
|
f("span", {
|
|
2868
2886
|
class: u(s(l).e("void")),
|
|
2869
2887
|
style: ae({ color: n.disabled ? n.disabledVoidColor : n.voidColor })
|
|
2870
|
-
},
|
|
2888
|
+
}, z(n.disabled ? n.disabledVoidIcon : n.voidIcon), 7),
|
|
2871
2889
|
f("span", {
|
|
2872
|
-
class: u([s(l).e("fill"),
|
|
2890
|
+
class: u([s(l).e("fill"), k(M) > 0 ? "is-active" : ""]),
|
|
2873
2891
|
style: ae({
|
|
2874
|
-
color:
|
|
2875
|
-
clipPath: `inset(0 ${100 -
|
|
2892
|
+
color: L(M),
|
|
2893
|
+
clipPath: `inset(0 ${100 - k(M)}% 0 0)`
|
|
2876
2894
|
})
|
|
2877
|
-
},
|
|
2878
|
-
], 42,
|
|
2895
|
+
}, z(n.icon), 7)
|
|
2896
|
+
], 42, tl))), 128))
|
|
2879
2897
|
], 2),
|
|
2880
|
-
n.showText || n.showScore ? (
|
|
2898
|
+
n.showText || n.showScore ? (i(), c("div", {
|
|
2881
2899
|
key: 0,
|
|
2882
2900
|
class: u(s(l).e("text")),
|
|
2883
2901
|
style: ae({ color: n.textColor })
|
|
2884
|
-
},
|
|
2902
|
+
}, z(D.value), 7)) : N("", !0)
|
|
2885
2903
|
], 34));
|
|
2886
2904
|
}
|
|
2887
2905
|
});
|
|
2888
2906
|
export {
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
+
dl as Checkbox,
|
|
2908
|
+
vl as CheckboxGroup,
|
|
2909
|
+
pl as DatePicker,
|
|
2910
|
+
fl as Form,
|
|
2911
|
+
ml as FormItem,
|
|
2912
|
+
nl as Input,
|
|
2913
|
+
sl as InputNumber,
|
|
2914
|
+
rl as Radio,
|
|
2915
|
+
cl as RadioButton,
|
|
2916
|
+
il as RadioGroup,
|
|
2917
|
+
xl as Rate,
|
|
2918
|
+
gl as Select,
|
|
2919
|
+
yl as Slider,
|
|
2920
|
+
ol as Switch,
|
|
2921
|
+
ul as Textarea,
|
|
2922
|
+
hl as TimePicker,
|
|
2923
|
+
bl as Transfer,
|
|
2924
|
+
kl as Upload
|
|
2907
2925
|
};
|