@xto/form 1.6.5 → 1.6.6
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 +402 -394
- package/lib/index.cjs +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -281,24 +281,24 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
281
281
|
const $ = B("");
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
|
-
([A,
|
|
285
|
-
const Y = A ??
|
|
284
|
+
([A, I]) => {
|
|
285
|
+
const Y = A ?? I ?? "";
|
|
286
286
|
Y !== $.value && ($.value = Y);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
290
290
|
const z = (A) => {
|
|
291
291
|
$.value = A, t("update:modelValue", A), t("update:value", A), t("input", A);
|
|
292
|
-
},
|
|
292
|
+
}, E = V(() => String($.value).length), y = V(() => [
|
|
293
293
|
l.b(),
|
|
294
294
|
e.size !== "default" ? l.m(e.size) : "",
|
|
295
295
|
l.is("disabled", e.disabled),
|
|
296
296
|
l.is("focus", m.value),
|
|
297
297
|
l.is("has-prefix", e.prefixIcon || T.prefix),
|
|
298
298
|
l.is("has-suffix", e.suffixIcon || T.suffix || e.clearable || S.value || e.showWordLimit)
|
|
299
|
-
]),
|
|
300
|
-
const
|
|
301
|
-
t("change",
|
|
299
|
+
]), R = (A) => {
|
|
300
|
+
const I = A.target.value;
|
|
301
|
+
t("change", I);
|
|
302
302
|
}, H = (A) => {
|
|
303
303
|
m.value = !0, t("focus", A);
|
|
304
304
|
}, O = (A) => {
|
|
@@ -318,7 +318,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
318
318
|
(A = c.value) == null || A.blur();
|
|
319
319
|
},
|
|
320
320
|
inputRef: c
|
|
321
|
-
}), (A,
|
|
321
|
+
}), (A, I) => (i(), d("div", {
|
|
322
322
|
class: u(y.value)
|
|
323
323
|
}, [
|
|
324
324
|
A.$slots.prefix || s.prefixIcon ? (i(), d("span", {
|
|
@@ -334,7 +334,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
334
334
|
oe(r("input", {
|
|
335
335
|
ref_key: "inputRef",
|
|
336
336
|
ref: c,
|
|
337
|
-
"onUpdate:modelValue":
|
|
337
|
+
"onUpdate:modelValue": I[0] || (I[0] = (Y) => $.value = Y),
|
|
338
338
|
type: D.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
@@ -342,8 +342,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
342
342
|
maxlength: s.maxlength,
|
|
343
343
|
minlength: s.minlength,
|
|
344
344
|
class: u(n(l).e("inner")),
|
|
345
|
-
onInput:
|
|
346
|
-
onChange:
|
|
345
|
+
onInput: I[1] || (I[1] = (Y) => z(Y.target.value)),
|
|
346
|
+
onChange: R,
|
|
347
347
|
onFocus: H,
|
|
348
348
|
onBlur: O
|
|
349
349
|
}, null, 42, ll), [
|
|
@@ -377,7 +377,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
377
377
|
s.showWordLimit && s.maxlength ? (i(), d("span", {
|
|
378
378
|
key: 2,
|
|
379
379
|
class: u(n(l).e("count"))
|
|
380
|
-
}, N(
|
|
380
|
+
}, N(E.value) + "/" + N(s.maxlength), 3)) : U("", !0)
|
|
381
381
|
])
|
|
382
382
|
], 2)) : U("", !0)
|
|
383
383
|
], 2));
|
|
@@ -421,7 +421,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
421
421
|
function z(o) {
|
|
422
422
|
return o > e.max ? e.max : o < e.min ? e.min : o;
|
|
423
423
|
}
|
|
424
|
-
const
|
|
424
|
+
const E = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : E.value === void 0 || E.value === null ? "" : $(E.value)), R = V(() => e.disabled ? !0 : E.value === void 0 ? e.min !== -1 / 0 : E.value <= e.min), H = V(() => e.disabled ? !0 : E.value === void 0 ? e.max !== 1 / 0 : E.value >= e.max), O = V(() => [
|
|
425
425
|
l.b(),
|
|
426
426
|
e.size !== "default" ? l.m(e.size) : "",
|
|
427
427
|
l.is("disabled", e.disabled),
|
|
@@ -430,12 +430,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
430
430
|
]);
|
|
431
431
|
function M() {
|
|
432
432
|
if (e.disabled || H.value) return;
|
|
433
|
-
const o =
|
|
433
|
+
const o = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o + e.step), g = z(f);
|
|
434
434
|
v(g);
|
|
435
435
|
}
|
|
436
436
|
function h() {
|
|
437
|
-
if (e.disabled ||
|
|
438
|
-
const o =
|
|
437
|
+
if (e.disabled || R.value) return;
|
|
438
|
+
const o = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o - e.step), g = z(f);
|
|
439
439
|
v(g);
|
|
440
440
|
}
|
|
441
441
|
function v(o) {
|
|
@@ -466,7 +466,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
466
466
|
const f = o.target.value;
|
|
467
467
|
b.value = f;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function I(o) {
|
|
470
470
|
if (m.value = !1, b.value !== null) {
|
|
471
471
|
const f = x(b.value);
|
|
472
472
|
f === void 0 ? e.valueOnClear !== null ? v(e.valueOnClear) : b.value = null : v(f);
|
|
@@ -516,8 +516,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
516
516
|
s.controls ? (i(), d("button", {
|
|
517
517
|
key: 0,
|
|
518
518
|
type: "button",
|
|
519
|
-
class: u([n(l).e("decrease"), n(l).is("disabled",
|
|
520
|
-
disabled:
|
|
519
|
+
class: u([n(l).e("decrease"), n(l).is("disabled", R.value)]),
|
|
520
|
+
disabled: R.value,
|
|
521
521
|
onClick: h
|
|
522
522
|
}, " − ", 10, al)) : U("", !0),
|
|
523
523
|
r("div", {
|
|
@@ -534,7 +534,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
534
534
|
autocomplete: "off",
|
|
535
535
|
onInput: A,
|
|
536
536
|
onFocus: Y,
|
|
537
|
-
onBlur:
|
|
537
|
+
onBlur: I,
|
|
538
538
|
onKeydown: G
|
|
539
539
|
}, null, 42, tl)
|
|
540
540
|
], 2),
|
|
@@ -591,12 +591,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
591
591
|
]), z = (M) => {
|
|
592
592
|
const h = M.target.value;
|
|
593
593
|
T(h), e.autosize && c.value && (c.value.style.height = "auto", c.value.style.height = `${c.value.scrollHeight}px`);
|
|
594
|
-
},
|
|
594
|
+
}, E = (M) => {
|
|
595
595
|
const h = M.target.value;
|
|
596
596
|
t("change", h);
|
|
597
597
|
}, y = (M) => {
|
|
598
598
|
m.value = !0, t("focus", M);
|
|
599
|
-
},
|
|
599
|
+
}, R = (M) => {
|
|
600
600
|
m.value = !1, t("blur", M);
|
|
601
601
|
};
|
|
602
602
|
return k({
|
|
@@ -626,9 +626,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
626
626
|
style: te(D.value),
|
|
627
627
|
class: u(n(l).e("inner")),
|
|
628
628
|
onInput: z,
|
|
629
|
-
onChange:
|
|
629
|
+
onChange: E,
|
|
630
630
|
onFocus: y,
|
|
631
|
-
onBlur:
|
|
631
|
+
onBlur: R
|
|
632
632
|
}, null, 46, sl), [
|
|
633
633
|
[Ve, b.value]
|
|
634
634
|
]),
|
|
@@ -701,7 +701,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
701
701
|
]), z = () => {
|
|
702
702
|
S.value || (c.value ? l.changeValue(b.value) : (e("update:modelValue", b.value), e("change", b.value)));
|
|
703
703
|
};
|
|
704
|
-
return (
|
|
704
|
+
return (E, y) => (i(), d("label", {
|
|
705
705
|
class: u($.value),
|
|
706
706
|
onClick: ue(z, ["prevent"])
|
|
707
707
|
}, [
|
|
@@ -716,11 +716,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
716
716
|
value: b.value
|
|
717
717
|
}, null, 8, ul)
|
|
718
718
|
], 2),
|
|
719
|
-
|
|
719
|
+
E.$slots.default || s.label ? (i(), d("span", {
|
|
720
720
|
key: 0,
|
|
721
721
|
class: u(n(t).e("label"))
|
|
722
722
|
}, [
|
|
723
|
-
se(
|
|
723
|
+
se(E.$slots, "default", {}, () => [
|
|
724
724
|
de(N(s.label), 1)
|
|
725
725
|
])
|
|
726
726
|
], 2)) : U("", !0)
|
|
@@ -806,8 +806,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
806
806
|
const a = s, e = k, t = ae("checkbox"), l = xe("checkboxGroup", null), c = V(() => !!l), m = V(() => a.value ?? a.label), b = V(() => c.value ? l.modelValue.value.includes(m.value) : Array.isArray(a.modelValue) ? a.modelValue.includes(m.value) : !!a.modelValue), T = V(() => {
|
|
807
807
|
if (a.disabled) return !0;
|
|
808
808
|
if (c.value) {
|
|
809
|
-
const $ = l.disabled, z = l.min > 0 && l.modelValue.value.length <= l.min,
|
|
810
|
-
return b.value && z || !b.value &&
|
|
809
|
+
const $ = l.disabled, z = l.min > 0 && l.modelValue.value.length <= l.min, E = l.max > 0 && l.modelValue.value.length >= l.max;
|
|
810
|
+
return b.value && z || !b.value && E ? !0 : $;
|
|
811
811
|
}
|
|
812
812
|
return !1;
|
|
813
813
|
}), S = V(() => [
|
|
@@ -912,7 +912,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
912
912
|
for (const v of c.value)
|
|
913
913
|
await v.validate() || (h = !1);
|
|
914
914
|
return h;
|
|
915
|
-
},
|
|
915
|
+
}, E = async (h) => {
|
|
916
916
|
const v = Array.isArray(h) ? h : [h];
|
|
917
917
|
let x = !0;
|
|
918
918
|
for (const A of c.value)
|
|
@@ -922,7 +922,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
922
922
|
c.value.forEach((h) => {
|
|
923
923
|
h.resetField();
|
|
924
924
|
});
|
|
925
|
-
},
|
|
925
|
+
}, R = (h) => {
|
|
926
926
|
if (h) {
|
|
927
927
|
const v = Array.isArray(h) ? h : [h];
|
|
928
928
|
c.value.forEach((x) => {
|
|
@@ -950,9 +950,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
950
950
|
emit: t
|
|
951
951
|
}), k({
|
|
952
952
|
validate: z,
|
|
953
|
-
validateField:
|
|
953
|
+
validateField: E,
|
|
954
954
|
resetFields: y,
|
|
955
|
-
clearValidate:
|
|
955
|
+
clearValidate: R
|
|
956
956
|
}), (h, v) => (i(), d("form", {
|
|
957
957
|
class: u(T.value),
|
|
958
958
|
onSubmit: H,
|
|
@@ -1011,9 +1011,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1011
1011
|
}
|
|
1012
1012
|
if (x.validator)
|
|
1013
1013
|
try {
|
|
1014
|
-
await new Promise((A,
|
|
1014
|
+
await new Promise((A, I) => {
|
|
1015
1015
|
x.validator(x, M, (Y) => {
|
|
1016
|
-
Y ?
|
|
1016
|
+
Y ? I(Y) : A();
|
|
1017
1017
|
});
|
|
1018
1018
|
});
|
|
1019
1019
|
} catch (A) {
|
|
@@ -1023,15 +1023,15 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1023
1023
|
}
|
|
1024
1024
|
return c.value = h ? "valid" : "invalid", m.value = v, l && a.prop && l.emit("validate", a.prop, h, v), h;
|
|
1025
1025
|
}, z = () => {
|
|
1026
|
-
D(void 0),
|
|
1027
|
-
},
|
|
1026
|
+
D(void 0), E();
|
|
1027
|
+
}, E = () => {
|
|
1028
1028
|
c.value = "", m.value = "";
|
|
1029
1029
|
}, y = V(() => [
|
|
1030
1030
|
t.b(),
|
|
1031
1031
|
t.is("required", b.value),
|
|
1032
1032
|
t.is("error", c.value === "invalid"),
|
|
1033
1033
|
t.is("success", c.value === "valid")
|
|
1034
|
-
]),
|
|
1034
|
+
]), R = V(() => {
|
|
1035
1035
|
const H = a.labelWidth ?? (l == null ? void 0 : l.labelWidth) ?? "100px";
|
|
1036
1036
|
return { width: typeof H == "number" ? `${H}px` : H };
|
|
1037
1037
|
});
|
|
@@ -1042,26 +1042,26 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1042
1042
|
prop: a.prop,
|
|
1043
1043
|
validate: $,
|
|
1044
1044
|
resetField: z,
|
|
1045
|
-
clearValidate:
|
|
1045
|
+
clearValidate: E
|
|
1046
1046
|
});
|
|
1047
1047
|
}), De(() => {
|
|
1048
1048
|
l && a.prop && l.removeField({
|
|
1049
1049
|
prop: a.prop,
|
|
1050
1050
|
validate: $,
|
|
1051
1051
|
resetField: z,
|
|
1052
|
-
clearValidate:
|
|
1052
|
+
clearValidate: E
|
|
1053
1053
|
});
|
|
1054
1054
|
}), k({
|
|
1055
1055
|
validate: $,
|
|
1056
1056
|
resetField: z,
|
|
1057
|
-
clearValidate:
|
|
1057
|
+
clearValidate: E
|
|
1058
1058
|
}), (H, O) => (i(), d("div", {
|
|
1059
1059
|
class: u(y.value)
|
|
1060
1060
|
}, [
|
|
1061
1061
|
s.label || n(e).label ? (i(), d("label", {
|
|
1062
1062
|
key: 0,
|
|
1063
1063
|
class: u(n(t).e("label")),
|
|
1064
|
-
style: te(
|
|
1064
|
+
style: te(R.value)
|
|
1065
1065
|
}, [
|
|
1066
1066
|
se(H.$slots, "label", {}, () => [
|
|
1067
1067
|
de(N(s.label), 1)
|
|
@@ -1190,9 +1190,9 @@ const bl = [
|
|
|
1190
1190
|
if (a.selectionMode !== "range") return !1;
|
|
1191
1191
|
const { startDate: v, endDate: x, selecting: A } = a.rangeState || {};
|
|
1192
1192
|
if (A && v) {
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
const Y = v <
|
|
1193
|
+
const I = l.value;
|
|
1194
|
+
if (I) {
|
|
1195
|
+
const Y = v < I ? v : I, G = v < I ? I : v;
|
|
1196
1196
|
return Ue(h, Y, G);
|
|
1197
1197
|
}
|
|
1198
1198
|
return pe(h, v);
|
|
@@ -1202,7 +1202,7 @@ const bl = [
|
|
|
1202
1202
|
if (a.selectionMode !== "range") return !1;
|
|
1203
1203
|
const { startDate: v, selecting: x } = a.rangeState || {};
|
|
1204
1204
|
return x && v && l.value ? pe(h, v < l.value ? v : l.value) : v ? pe(h, v) : !1;
|
|
1205
|
-
},
|
|
1205
|
+
}, E = (h) => {
|
|
1206
1206
|
if (a.selectionMode !== "range") return !1;
|
|
1207
1207
|
const { endDate: v, selecting: x } = a.rangeState || {};
|
|
1208
1208
|
if (x && l.value) {
|
|
@@ -1210,14 +1210,14 @@ const bl = [
|
|
|
1210
1210
|
return pe(h, A < l.value ? l.value : A);
|
|
1211
1211
|
}
|
|
1212
1212
|
return v ? pe(h, v) : !1;
|
|
1213
|
-
}, y = (h) => gl(h, a.disabledDate, a.minDate, a.maxDate),
|
|
1213
|
+
}, y = (h) => gl(h, a.disabledDate, a.minDate, a.maxDate), R = (h) => [
|
|
1214
1214
|
t.e("cell"),
|
|
1215
1215
|
t.is("selected", T(h)),
|
|
1216
1216
|
t.is("today", S(h)),
|
|
1217
1217
|
t.is("disabled", y(h)),
|
|
1218
1218
|
t.is("in-range", $(h)),
|
|
1219
1219
|
t.is("range-start", z(h)),
|
|
1220
|
-
t.is("range-end",
|
|
1220
|
+
t.is("range-end", E(h)),
|
|
1221
1221
|
t.is("prev-month", !D(h) && h.getMonth() < m.value),
|
|
1222
1222
|
t.is("next-month", !D(h) && h.getMonth() > m.value)
|
|
1223
1223
|
], H = (h) => {
|
|
@@ -1242,16 +1242,16 @@ const bl = [
|
|
|
1242
1242
|
]),
|
|
1243
1243
|
r("tbody", null, [
|
|
1244
1244
|
(i(!0), d(J, null, _(b.value, (x, A) => (i(), d("tr", { key: A }, [
|
|
1245
|
-
(i(!0), d(J, null, _(x, (
|
|
1245
|
+
(i(!0), d(J, null, _(x, (I, Y) => (i(), d("td", {
|
|
1246
1246
|
key: Y,
|
|
1247
|
-
class: u(
|
|
1248
|
-
onClick: (G) => H(
|
|
1249
|
-
onMouseenter: (G) => O(
|
|
1247
|
+
class: u(R(I)),
|
|
1248
|
+
onClick: (G) => H(I),
|
|
1249
|
+
onMouseenter: (G) => O(I),
|
|
1250
1250
|
onMouseleave: M
|
|
1251
1251
|
}, [
|
|
1252
1252
|
r("span", {
|
|
1253
1253
|
class: u(n(t).e("cell-text"))
|
|
1254
|
-
}, N(
|
|
1254
|
+
}, N(I.getDate()), 3)
|
|
1255
1255
|
], 42, kl))), 128))
|
|
1256
1256
|
]))), 128))
|
|
1257
1257
|
])
|
|
@@ -1295,11 +1295,11 @@ const bl = [
|
|
|
1295
1295
|
cellpadding: "0"
|
|
1296
1296
|
}, [
|
|
1297
1297
|
r("tbody", null, [
|
|
1298
|
-
(i(!0), d(J, null, _(S.value, (z,
|
|
1298
|
+
(i(!0), d(J, null, _(S.value, (z, E) => (i(), d("tr", { key: E }, [
|
|
1299
1299
|
(i(!0), d(J, null, _(z, (y) => (i(), d("td", {
|
|
1300
1300
|
key: y,
|
|
1301
1301
|
class: u(b(y)),
|
|
1302
|
-
onClick: (
|
|
1302
|
+
onClick: (R) => T(y)
|
|
1303
1303
|
}, [
|
|
1304
1304
|
r("span", {
|
|
1305
1305
|
class: u(n(t).e("cell-text"))
|
|
@@ -1320,33 +1320,33 @@ const bl = [
|
|
|
1320
1320
|
emits: ["pick"],
|
|
1321
1321
|
setup(s, { emit: k }) {
|
|
1322
1322
|
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()), c = V(() => Ke(a.viewedYear)), m = V(() => {
|
|
1323
|
-
const [y] = c.value,
|
|
1324
|
-
|
|
1323
|
+
const [y] = c.value, R = [];
|
|
1324
|
+
R.push(y - 1);
|
|
1325
1325
|
for (let H = 0; H < 10; H++)
|
|
1326
|
-
|
|
1327
|
-
return
|
|
1326
|
+
R.push(y + H);
|
|
1327
|
+
return R.push(y + 10), R;
|
|
1328
1328
|
}), b = V(() => {
|
|
1329
1329
|
const y = [];
|
|
1330
|
-
for (let
|
|
1331
|
-
y.push(m.value.slice(
|
|
1330
|
+
for (let R = 0; R < m.value.length; R += 3)
|
|
1331
|
+
y.push(m.value.slice(R, R + 3));
|
|
1332
1332
|
return y;
|
|
1333
1333
|
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1, S = (y) => y === l.value, D = (y) => {
|
|
1334
|
-
const [
|
|
1335
|
-
return y >=
|
|
1334
|
+
const [R, H] = c.value;
|
|
1335
|
+
return y >= R && y <= H;
|
|
1336
1336
|
}, $ = (y) => {
|
|
1337
1337
|
if (!a.disabledDate) return !1;
|
|
1338
|
-
const
|
|
1339
|
-
return a.disabledDate(
|
|
1338
|
+
const R = new Date(y, 0, 1), H = new Date(y, 11, 31);
|
|
1339
|
+
return a.disabledDate(R) && a.disabledDate(H);
|
|
1340
1340
|
}, z = (y) => [
|
|
1341
1341
|
t.e("cell"),
|
|
1342
1342
|
t.is("selected", T(y)),
|
|
1343
1343
|
t.is("current", S(y)),
|
|
1344
1344
|
t.is("disabled", $(y)),
|
|
1345
1345
|
t.is("in-decade", D(y))
|
|
1346
|
-
],
|
|
1346
|
+
], E = (y) => {
|
|
1347
1347
|
$(y) || e("pick", y);
|
|
1348
1348
|
};
|
|
1349
|
-
return (y,
|
|
1349
|
+
return (y, R) => (i(), d("table", {
|
|
1350
1350
|
class: u(n(t).b()),
|
|
1351
1351
|
cellspacing: "0",
|
|
1352
1352
|
cellpadding: "0"
|
|
@@ -1356,7 +1356,7 @@ const bl = [
|
|
|
1356
1356
|
(i(!0), d(J, null, _(H, (M) => (i(), d("td", {
|
|
1357
1357
|
key: M,
|
|
1358
1358
|
class: u(z(M)),
|
|
1359
|
-
onClick: (h) =>
|
|
1359
|
+
onClick: (h) => E(M)
|
|
1360
1360
|
}, [
|
|
1361
1361
|
r("span", {
|
|
1362
1362
|
class: u(n(t).e("cell-text"))
|
|
@@ -1389,12 +1389,12 @@ const bl = [
|
|
|
1389
1389
|
},
|
|
1390
1390
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
|
|
1391
1391
|
setup(s, { expose: k, emit: a }) {
|
|
1392
|
-
const e = s, t = a, l = ae("date-picker"), c = B(!1), m = B(2e3), b = B(), T = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, S = (
|
|
1393
|
-
e.modelValue !== void 0 && t("update:modelValue",
|
|
1392
|
+
const e = s, t = a, l = ae("date-picker"), c = B(!1), m = B(2e3), b = B(), T = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, S = (L) => {
|
|
1393
|
+
e.modelValue !== void 0 && t("update:modelValue", L), e.value !== void 0 && t("update:value", L), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", L), t("change", L);
|
|
1394
1394
|
}, D = B(), $ = B(), z = B({
|
|
1395
1395
|
top: "0px",
|
|
1396
1396
|
left: "0px"
|
|
1397
|
-
}),
|
|
1397
|
+
}), E = () => Ee().next(), y = B("date"), R = B(/* @__PURE__ */ new Date()), H = B({
|
|
1398
1398
|
hours: (/* @__PURE__ */ new Date()).getHours(),
|
|
1399
1399
|
minutes: (/* @__PURE__ */ new Date()).getMinutes(),
|
|
1400
1400
|
seconds: (/* @__PURE__ */ new Date()).getSeconds()
|
|
@@ -1403,43 +1403,43 @@ const bl = [
|
|
|
1403
1403
|
startDate: null,
|
|
1404
1404
|
endDate: null
|
|
1405
1405
|
}), M = V(() => {
|
|
1406
|
-
const
|
|
1407
|
-
if (!
|
|
1406
|
+
const L = T();
|
|
1407
|
+
if (!L) return null;
|
|
1408
1408
|
if (e.type === "daterange") {
|
|
1409
|
-
if (!Array.isArray(
|
|
1410
|
-
const [
|
|
1409
|
+
if (!Array.isArray(L)) return null;
|
|
1410
|
+
const [F, W] = L;
|
|
1411
1411
|
return [
|
|
1412
|
-
|
|
1412
|
+
F instanceof Date ? F : ve(F),
|
|
1413
1413
|
W instanceof Date ? W : ve(W)
|
|
1414
1414
|
];
|
|
1415
1415
|
}
|
|
1416
|
-
return
|
|
1416
|
+
return L instanceof Date ? L : ve(L);
|
|
1417
1417
|
}), h = V(() => {
|
|
1418
1418
|
if (e.type === "daterange") return "";
|
|
1419
|
-
const
|
|
1420
|
-
if (!
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1419
|
+
const L = T();
|
|
1420
|
+
if (!L) return "";
|
|
1421
|
+
const F = L instanceof Date ? L : ve(L);
|
|
1422
|
+
if (!F) return "";
|
|
1423
1423
|
const W = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
|
|
1424
|
-
return ce(
|
|
1424
|
+
return ce(F, W);
|
|
1425
1425
|
}), v = V(() => {
|
|
1426
|
-
const
|
|
1427
|
-
if (!
|
|
1428
|
-
const [
|
|
1429
|
-
if (!
|
|
1430
|
-
const W =
|
|
1426
|
+
const L = T();
|
|
1427
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1428
|
+
const [F] = L;
|
|
1429
|
+
if (!F) return "";
|
|
1430
|
+
const W = F instanceof Date ? F : ve(F);
|
|
1431
1431
|
return W ? ce(W, e.format) : "";
|
|
1432
1432
|
}), x = V(() => {
|
|
1433
|
-
const
|
|
1434
|
-
if (!
|
|
1435
|
-
const [,
|
|
1436
|
-
if (!
|
|
1437
|
-
const W =
|
|
1433
|
+
const L = T();
|
|
1434
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1435
|
+
const [, F] = L;
|
|
1436
|
+
if (!F) return "";
|
|
1437
|
+
const W = F instanceof Date ? F : ve(F);
|
|
1438
1438
|
return W ? ce(W, e.format) : "";
|
|
1439
1439
|
}), A = V(() => {
|
|
1440
|
-
const
|
|
1441
|
-
return !
|
|
1442
|
-
}),
|
|
1440
|
+
const L = T();
|
|
1441
|
+
return !L || Array.isArray(L) ? null : L instanceof Date ? L : ve(L);
|
|
1442
|
+
}), I = V(() => R.value.getFullYear()), Y = V(() => R.value.getMonth()), G = V(() => Ke(I.value)), p = V(() => y.value === "year" ? `${G.value[0]} 年 - ${G.value[1]} 年` : y.value === "month" ? `${I.value} 年` : `${I.value} 年 ${Y.value + 1} 月`), w = V(() => [
|
|
1443
1443
|
l.b(),
|
|
1444
1444
|
l.m(e.size),
|
|
1445
1445
|
l.is("disabled", e.disabled),
|
|
@@ -1451,11 +1451,11 @@ const bl = [
|
|
|
1451
1451
|
]), o = () => {
|
|
1452
1452
|
e.disabled || e.readonly || (c.value ? g() : f());
|
|
1453
1453
|
}, f = () => {
|
|
1454
|
-
c.value = !0, m.value =
|
|
1454
|
+
c.value = !0, m.value = E(), Se(() => {
|
|
1455
1455
|
if (b.value && D.value) {
|
|
1456
|
-
const
|
|
1457
|
-
let W =
|
|
1458
|
-
he +
|
|
1456
|
+
const L = b.value.getBoundingClientRect(), F = D.value.getBoundingClientRect();
|
|
1457
|
+
let W = L.bottom + 8, he = L.left;
|
|
1458
|
+
he + F.width > window.innerWidth && (he = window.innerWidth - F.width - 8), W + F.height > window.innerHeight && (W = L.top - F.height - 8), z.value = {
|
|
1459
1459
|
top: `${W}px`,
|
|
1460
1460
|
left: `${he}px`
|
|
1461
1461
|
};
|
|
@@ -1463,105 +1463,105 @@ const bl = [
|
|
|
1463
1463
|
}), t("focus", {});
|
|
1464
1464
|
}, g = () => {
|
|
1465
1465
|
c.value = !1, y.value = "date", t("blur", {});
|
|
1466
|
-
}, X = (
|
|
1466
|
+
}, X = (L) => {
|
|
1467
1467
|
if (e.type === "date") {
|
|
1468
|
-
e.showTime && (
|
|
1469
|
-
const
|
|
1468
|
+
e.showTime && (L.setHours(H.value.hours), L.setMinutes(H.value.minutes), L.setSeconds(H.value.seconds));
|
|
1469
|
+
const F = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, W = F ? ce(L, F) : L;
|
|
1470
1470
|
S(W), e.showTime || g();
|
|
1471
1471
|
}
|
|
1472
1472
|
}, ne = () => {
|
|
1473
|
-
const
|
|
1474
|
-
if (
|
|
1475
|
-
const
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1478
|
-
const W = e.valueFormat ? ce(
|
|
1473
|
+
const L = T();
|
|
1474
|
+
if (L) {
|
|
1475
|
+
const F = L instanceof Date ? L : ve(L);
|
|
1476
|
+
if (F) {
|
|
1477
|
+
F.setHours(H.value.hours), F.setMinutes(H.value.minutes), F.setSeconds(H.value.seconds);
|
|
1478
|
+
const W = e.valueFormat ? ce(F, e.valueFormat) : F;
|
|
1479
1479
|
S(W);
|
|
1480
1480
|
}
|
|
1481
1481
|
} else {
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
const W = e.valueFormat ? ce(
|
|
1482
|
+
const F = /* @__PURE__ */ new Date();
|
|
1483
|
+
F.setHours(H.value.hours), F.setMinutes(H.value.minutes), F.setSeconds(H.value.seconds);
|
|
1484
|
+
const W = e.valueFormat ? ce(F, e.valueFormat) : F;
|
|
1485
1485
|
S(W);
|
|
1486
1486
|
}
|
|
1487
1487
|
g();
|
|
1488
|
-
}, K = (
|
|
1488
|
+
}, K = (L) => {
|
|
1489
1489
|
if (!O.value.selecting)
|
|
1490
|
-
O.value.selecting = !0, O.value.startDate =
|
|
1490
|
+
O.value.selecting = !0, O.value.startDate = L, O.value.endDate = null;
|
|
1491
1491
|
else {
|
|
1492
|
-
O.value.selecting = !1, O.value.startDate &&
|
|
1493
|
-
const
|
|
1494
|
-
S([
|
|
1492
|
+
O.value.selecting = !1, O.value.startDate && L < O.value.startDate ? [O.value.startDate, O.value.endDate] = [L, O.value.startDate] : O.value.endDate = L;
|
|
1493
|
+
const F = e.valueFormat ? ce(O.value.startDate, e.valueFormat) : O.value.startDate, W = e.valueFormat ? ce(O.value.endDate, e.valueFormat) : O.value.endDate;
|
|
1494
|
+
S([F, W]), g();
|
|
1495
1495
|
}
|
|
1496
|
-
}, re = (
|
|
1497
|
-
if (
|
|
1498
|
-
const
|
|
1496
|
+
}, re = (L) => {
|
|
1497
|
+
if (R.value = new Date(I.value, L, 1), e.type === "month") {
|
|
1498
|
+
const F = new Date(I.value, L, 1), W = e.valueFormat ? ce(F, e.valueFormat) : F;
|
|
1499
1499
|
S(W), g();
|
|
1500
1500
|
} else
|
|
1501
1501
|
y.value = "date";
|
|
1502
|
-
},
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1502
|
+
}, j = (L) => {
|
|
1503
|
+
if (R.value = new Date(L, Y.value, 1), e.type === "year") {
|
|
1504
|
+
const F = new Date(L, 0, 1), W = e.valueFormat ? ce(F, e.valueFormat) : F;
|
|
1505
1505
|
S(W), g();
|
|
1506
1506
|
} else
|
|
1507
1507
|
y.value = "month";
|
|
1508
1508
|
}, me = () => {
|
|
1509
|
-
|
|
1509
|
+
R.value = fl(R.value);
|
|
1510
1510
|
}, ye = () => {
|
|
1511
|
-
|
|
1511
|
+
R.value = ml(R.value);
|
|
1512
1512
|
}, ze = () => {
|
|
1513
|
-
y.value === "year" ?
|
|
1513
|
+
y.value === "year" ? R.value = new Date(I.value - 10, Y.value, 1) : R.value = hl(R.value);
|
|
1514
1514
|
}, we = () => {
|
|
1515
|
-
y.value === "year" ?
|
|
1515
|
+
y.value === "year" ? R.value = new Date(I.value + 10, Y.value, 1) : R.value = pl(R.value);
|
|
1516
1516
|
}, Te = () => {
|
|
1517
1517
|
y.value = "month";
|
|
1518
1518
|
}, Re = () => {
|
|
1519
1519
|
y.value = "year";
|
|
1520
|
-
},
|
|
1520
|
+
}, P = () => {
|
|
1521
1521
|
S(null), t("clear"), O.value = {
|
|
1522
1522
|
selecting: !1,
|
|
1523
1523
|
startDate: null,
|
|
1524
1524
|
endDate: null
|
|
1525
1525
|
};
|
|
1526
|
-
},
|
|
1526
|
+
}, q = (L) => {
|
|
1527
1527
|
if (!b.value) return;
|
|
1528
|
-
const
|
|
1529
|
-
b.value.contains(
|
|
1528
|
+
const F = L.target;
|
|
1529
|
+
b.value.contains(F) || D.value && D.value.contains(F) || g();
|
|
1530
1530
|
};
|
|
1531
1531
|
ie(
|
|
1532
1532
|
T,
|
|
1533
|
-
(
|
|
1534
|
-
if (
|
|
1533
|
+
(L) => {
|
|
1534
|
+
if (L)
|
|
1535
1535
|
if (Array.isArray(M.value)) {
|
|
1536
|
-
const [
|
|
1537
|
-
|
|
1538
|
-
} else M.value && (
|
|
1536
|
+
const [F] = M.value;
|
|
1537
|
+
F && (R.value = new Date(F));
|
|
1538
|
+
} else M.value && (R.value = new Date(M.value));
|
|
1539
1539
|
},
|
|
1540
1540
|
{ immediate: !0 }
|
|
1541
|
-
), ie(c, (
|
|
1542
|
-
|
|
1541
|
+
), ie(c, (L) => {
|
|
1542
|
+
L && (y.value = "date", e.type === "daterange" && (O.value = {
|
|
1543
1543
|
selecting: !1,
|
|
1544
1544
|
startDate: Array.isArray(M.value) ? M.value[0] : null,
|
|
1545
1545
|
endDate: Array.isArray(M.value) ? M.value[1] : null
|
|
1546
1546
|
}));
|
|
1547
1547
|
});
|
|
1548
|
-
const Z = (
|
|
1549
|
-
|
|
1548
|
+
const Z = (L) => {
|
|
1549
|
+
L.key === "Escape" && g();
|
|
1550
1550
|
};
|
|
1551
1551
|
return ge(() => {
|
|
1552
|
-
document.addEventListener("click",
|
|
1552
|
+
document.addEventListener("click", q), document.addEventListener("keydown", Z);
|
|
1553
1553
|
}), De(() => {
|
|
1554
|
-
document.removeEventListener("click",
|
|
1554
|
+
document.removeEventListener("click", q), document.removeEventListener("keydown", Z);
|
|
1555
1555
|
}), k({
|
|
1556
1556
|
focus: () => {
|
|
1557
|
-
var
|
|
1558
|
-
return (
|
|
1557
|
+
var L;
|
|
1558
|
+
return (L = $.value) == null ? void 0 : L.focus();
|
|
1559
1559
|
},
|
|
1560
1560
|
blur: () => {
|
|
1561
|
-
var
|
|
1562
|
-
return (
|
|
1561
|
+
var L;
|
|
1562
|
+
return (L = $.value) == null ? void 0 : L.blur();
|
|
1563
1563
|
}
|
|
1564
|
-
}), (
|
|
1564
|
+
}), (L, F) => (i(), d("div", {
|
|
1565
1565
|
ref_key: "pickerRef",
|
|
1566
1566
|
ref: b,
|
|
1567
1567
|
class: u(w.value)
|
|
@@ -1587,7 +1587,7 @@ const bl = [
|
|
|
1587
1587
|
s.clearable && h.value && !s.disabled ? (i(), d("span", {
|
|
1588
1588
|
key: 0,
|
|
1589
1589
|
class: u(n(l).e("clear")),
|
|
1590
|
-
onClick: ue(
|
|
1590
|
+
onClick: ue(P, ["stop"])
|
|
1591
1591
|
}, [
|
|
1592
1592
|
Q(n(ee), {
|
|
1593
1593
|
name: "close",
|
|
@@ -1633,7 +1633,7 @@ const bl = [
|
|
|
1633
1633
|
s.clearable && (v.value || x.value) && !s.disabled ? (i(), d("span", {
|
|
1634
1634
|
key: 0,
|
|
1635
1635
|
class: u(n(l).e("clear")),
|
|
1636
|
-
onClick: ue(
|
|
1636
|
+
onClick: ue(P, ["stop"])
|
|
1637
1637
|
}, [
|
|
1638
1638
|
Q(n(ee), {
|
|
1639
1639
|
name: "close",
|
|
@@ -1665,16 +1665,16 @@ const bl = [
|
|
|
1665
1665
|
r("button", {
|
|
1666
1666
|
type: "button",
|
|
1667
1667
|
class: u(n(l).e("prev-btn")),
|
|
1668
|
-
onClick:
|
|
1668
|
+
onClick: F[0] || (F[0] = (W) => y.value === "date" ? me() : ze())
|
|
1669
1669
|
}, " ‹ ", 2),
|
|
1670
1670
|
r("div", {
|
|
1671
1671
|
class: u(n(l).e("header-title"))
|
|
1672
1672
|
}, [
|
|
1673
1673
|
y.value === "year" ? (i(), d("span", {
|
|
1674
1674
|
key: 0,
|
|
1675
|
-
onClick:
|
|
1675
|
+
onClick: F[1] || (F[1] = (W) => y.value = "month")
|
|
1676
1676
|
}, N(p.value), 1)) : (i(), d(J, { key: 1 }, [
|
|
1677
|
-
r("span", { onClick: Re }, N(
|
|
1677
|
+
r("span", { onClick: Re }, N(I.value) + " 年", 1),
|
|
1678
1678
|
y.value === "date" ? (i(), d("span", {
|
|
1679
1679
|
key: 0,
|
|
1680
1680
|
onClick: Te
|
|
@@ -1684,7 +1684,7 @@ const bl = [
|
|
|
1684
1684
|
r("button", {
|
|
1685
1685
|
type: "button",
|
|
1686
1686
|
class: u(n(l).e("next-btn")),
|
|
1687
|
-
onClick:
|
|
1687
|
+
onClick: F[2] || (F[2] = (W) => y.value === "date" ? ye() : we())
|
|
1688
1688
|
}, " › ", 2)
|
|
1689
1689
|
], 2),
|
|
1690
1690
|
r("div", {
|
|
@@ -1693,7 +1693,7 @@ const bl = [
|
|
|
1693
1693
|
y.value === "date" ? (i(), fe(Ml, {
|
|
1694
1694
|
key: 0,
|
|
1695
1695
|
"model-value": A.value,
|
|
1696
|
-
"viewed-month":
|
|
1696
|
+
"viewed-month": R.value,
|
|
1697
1697
|
"disabled-date": s.disabledDate,
|
|
1698
1698
|
"min-date": s.minDate ? n(ve)(s.minDate) : null,
|
|
1699
1699
|
"max-date": s.maxDate ? n(ve)(s.maxDate) : null,
|
|
@@ -1704,15 +1704,15 @@ const bl = [
|
|
|
1704
1704
|
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(xl, {
|
|
1705
1705
|
key: 1,
|
|
1706
1706
|
"model-value": A.value,
|
|
1707
|
-
"viewed-year":
|
|
1707
|
+
"viewed-year": I.value,
|
|
1708
1708
|
"disabled-date": s.disabledDate,
|
|
1709
1709
|
onPick: re
|
|
1710
1710
|
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(Cl, {
|
|
1711
1711
|
key: 2,
|
|
1712
1712
|
"model-value": A.value,
|
|
1713
|
-
"viewed-year":
|
|
1713
|
+
"viewed-year": I.value,
|
|
1714
1714
|
"disabled-date": s.disabledDate,
|
|
1715
|
-
onPick:
|
|
1715
|
+
onPick: j
|
|
1716
1716
|
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : U("", !0)
|
|
1717
1717
|
], 2),
|
|
1718
1718
|
s.showTime && s.type !== "daterange" ? (i(), d("div", {
|
|
@@ -1723,7 +1723,7 @@ const bl = [
|
|
|
1723
1723
|
class: u(n(l).e("time-item"))
|
|
1724
1724
|
}, [
|
|
1725
1725
|
oe(r("select", {
|
|
1726
|
-
"onUpdate:modelValue":
|
|
1726
|
+
"onUpdate:modelValue": F[3] || (F[3] = (W) => H.value.hours = W),
|
|
1727
1727
|
class: u(n(l).e("time-select"))
|
|
1728
1728
|
}, [
|
|
1729
1729
|
(i(), d(J, null, _(24, (W) => r("option", {
|
|
@@ -1738,13 +1738,13 @@ const bl = [
|
|
|
1738
1738
|
{ number: !0 }
|
|
1739
1739
|
]
|
|
1740
1740
|
]),
|
|
1741
|
-
|
|
1741
|
+
F[6] || (F[6] = r("span", null, "时", -1))
|
|
1742
1742
|
], 2),
|
|
1743
1743
|
r("div", {
|
|
1744
1744
|
class: u(n(l).e("time-item"))
|
|
1745
1745
|
}, [
|
|
1746
1746
|
oe(r("select", {
|
|
1747
|
-
"onUpdate:modelValue":
|
|
1747
|
+
"onUpdate:modelValue": F[4] || (F[4] = (W) => H.value.minutes = W),
|
|
1748
1748
|
class: u(n(l).e("time-select"))
|
|
1749
1749
|
}, [
|
|
1750
1750
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
@@ -1759,13 +1759,13 @@ const bl = [
|
|
|
1759
1759
|
{ number: !0 }
|
|
1760
1760
|
]
|
|
1761
1761
|
]),
|
|
1762
|
-
|
|
1762
|
+
F[7] || (F[7] = r("span", null, "分", -1))
|
|
1763
1763
|
], 2),
|
|
1764
1764
|
r("div", {
|
|
1765
1765
|
class: u(n(l).e("time-item"))
|
|
1766
1766
|
}, [
|
|
1767
1767
|
oe(r("select", {
|
|
1768
|
-
"onUpdate:modelValue":
|
|
1768
|
+
"onUpdate:modelValue": F[5] || (F[5] = (W) => H.value.seconds = W),
|
|
1769
1769
|
class: u(n(l).e("time-select"))
|
|
1770
1770
|
}, [
|
|
1771
1771
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
@@ -1780,7 +1780,7 @@ const bl = [
|
|
|
1780
1780
|
{ number: !0 }
|
|
1781
1781
|
]
|
|
1782
1782
|
]),
|
|
1783
|
-
|
|
1783
|
+
F[8] || (F[8] = r("span", null, "秒", -1))
|
|
1784
1784
|
], 2)
|
|
1785
1785
|
], 2)) : U("", !0),
|
|
1786
1786
|
s.showTime && s.type !== "daterange" ? (i(), d("div", {
|
|
@@ -1844,41 +1844,41 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1844
1844
|
setup(s, { emit: k }) {
|
|
1845
1845
|
const a = s, e = k, t = ae("time-panel"), l = B(0), c = B(0), m = B(0), b = B(), T = B(), S = B(), D = V(() => a.format.includes("ss") || a.format.includes("s")), $ = V(() => {
|
|
1846
1846
|
const K = [], re = Math.max(1, a.hourStep);
|
|
1847
|
-
for (let
|
|
1848
|
-
K.push(
|
|
1847
|
+
for (let j = 0; j < 24; j += re)
|
|
1848
|
+
K.push(j);
|
|
1849
1849
|
return K;
|
|
1850
1850
|
}), z = V(() => {
|
|
1851
1851
|
const K = [], re = Math.max(1, a.minuteStep);
|
|
1852
|
-
for (let
|
|
1853
|
-
K.push(
|
|
1852
|
+
for (let j = 0; j < 60; j += re)
|
|
1853
|
+
K.push(j);
|
|
1854
1854
|
return K;
|
|
1855
|
-
}),
|
|
1855
|
+
}), E = V(() => {
|
|
1856
1856
|
const K = [], re = Math.max(1, a.secondStep);
|
|
1857
|
-
for (let
|
|
1858
|
-
K.push(
|
|
1857
|
+
for (let j = 0; j < 60; j += re)
|
|
1858
|
+
K.push(j);
|
|
1859
1859
|
return K;
|
|
1860
|
-
}), y = V(() => a.disabledHours ? new Set(a.disabledHours()) : /* @__PURE__ */ new Set()),
|
|
1860
|
+
}), y = V(() => a.disabledHours ? new Set(a.disabledHours()) : /* @__PURE__ */ new Set()), R = V(() => a.disabledMinutes ? new Set(a.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), H = V(() => a.disabledSeconds ? new Set(a.disabledSeconds(l.value, c.value)) : /* @__PURE__ */ new Set()), O = V(() => `${Me(l.value)}:${Me(c.value)}${D.value ? ":" + Me(m.value) : ""}`), M = (K) => y.value.has(K), h = (K) => R.value.has(K), v = (K) => H.value.has(K), x = (K) => {
|
|
1861
1861
|
M(K) || (l.value = K, w(b.value, Y(K)));
|
|
1862
1862
|
}, A = (K) => {
|
|
1863
1863
|
h(K) || (c.value = K, w(T.value, G(K)));
|
|
1864
|
-
},
|
|
1864
|
+
}, I = (K) => {
|
|
1865
1865
|
v(K) || (m.value = K, w(S.value, p(K)));
|
|
1866
|
-
}, Y = (K) => $.value.indexOf(K), G = (K) => z.value.indexOf(K), p = (K) =>
|
|
1866
|
+
}, Y = (K) => $.value.indexOf(K), G = (K) => z.value.indexOf(K), p = (K) => E.value.indexOf(K), w = (K, re) => {
|
|
1867
1867
|
if (!K) return;
|
|
1868
|
-
const
|
|
1868
|
+
const j = 32, ye = re * j + 84 - 200 / 2 + j / 2;
|
|
1869
1869
|
K.scrollTop = Math.max(0, ye);
|
|
1870
1870
|
}, C = () => {
|
|
1871
1871
|
if (!b.value) return;
|
|
1872
|
-
const K = b.value.scrollTop, re = Math.round((K - 84 + 100) / 32),
|
|
1873
|
-
|
|
1872
|
+
const K = b.value.scrollTop, re = Math.round((K - 84 + 100) / 32), j = $.value[Math.max(0, Math.min(re, $.value.length - 1))];
|
|
1873
|
+
j !== void 0 && !M(j) && (l.value = j);
|
|
1874
1874
|
}, o = () => {
|
|
1875
1875
|
if (!T.value) return;
|
|
1876
|
-
const K = T.value.scrollTop, re = Math.round((K - 84 + 100) / 32),
|
|
1877
|
-
|
|
1876
|
+
const K = T.value.scrollTop, re = Math.round((K - 84 + 100) / 32), j = z.value[Math.max(0, Math.min(re, z.value.length - 1))];
|
|
1877
|
+
j !== void 0 && !h(j) && (c.value = j);
|
|
1878
1878
|
}, f = () => {
|
|
1879
1879
|
if (!S.value) return;
|
|
1880
|
-
const K = S.value.scrollTop, re = Math.round((K - 84 + 100) / 32),
|
|
1881
|
-
|
|
1880
|
+
const K = S.value.scrollTop, re = Math.round((K - 84 + 100) / 32), j = E.value[Math.max(0, Math.min(re, E.value.length - 1))];
|
|
1881
|
+
j !== void 0 && !v(j) && (m.value = j);
|
|
1882
1882
|
}, g = () => {
|
|
1883
1883
|
const K = a.modelValue ? new Date(a.modelValue) : /* @__PURE__ */ new Date();
|
|
1884
1884
|
K.setHours(l.value, c.value, m.value, 0), e("confirm", K);
|
|
@@ -1921,11 +1921,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1921
1921
|
r("div", {
|
|
1922
1922
|
class: u(n(t).e("padding"))
|
|
1923
1923
|
}, null, 2),
|
|
1924
|
-
(i(!0), d(J, null, _($.value, (
|
|
1925
|
-
key:
|
|
1926
|
-
class: u([n(t).e("item"), n(t).is("selected", l.value ===
|
|
1927
|
-
onClick: (me) => x(
|
|
1928
|
-
}, N(n(Me)(
|
|
1924
|
+
(i(!0), d(J, null, _($.value, (j) => (i(), d("div", {
|
|
1925
|
+
key: j,
|
|
1926
|
+
class: u([n(t).e("item"), n(t).is("selected", l.value === j), n(t).is("disabled", M(j))]),
|
|
1927
|
+
onClick: (me) => x(j)
|
|
1928
|
+
}, N(n(Me)(j)), 11, Ll))), 128)),
|
|
1929
1929
|
r("div", {
|
|
1930
1930
|
class: u(n(t).e("padding"))
|
|
1931
1931
|
}, null, 2)
|
|
@@ -1939,11 +1939,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1939
1939
|
r("div", {
|
|
1940
1940
|
class: u(n(t).e("padding"))
|
|
1941
1941
|
}, null, 2),
|
|
1942
|
-
(i(!0), d(J, null, _(z.value, (
|
|
1943
|
-
key:
|
|
1944
|
-
class: u([n(t).e("item"), n(t).is("selected", c.value ===
|
|
1945
|
-
onClick: (me) => A(
|
|
1946
|
-
}, N(n(Me)(
|
|
1942
|
+
(i(!0), d(J, null, _(z.value, (j) => (i(), d("div", {
|
|
1943
|
+
key: j,
|
|
1944
|
+
class: u([n(t).e("item"), n(t).is("selected", c.value === j), n(t).is("disabled", h(j))]),
|
|
1945
|
+
onClick: (me) => A(j)
|
|
1946
|
+
}, N(n(Me)(j)), 11, Rl))), 128)),
|
|
1947
1947
|
r("div", {
|
|
1948
1948
|
class: u(n(t).e("padding"))
|
|
1949
1949
|
}, null, 2)
|
|
@@ -1958,11 +1958,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1958
1958
|
r("div", {
|
|
1959
1959
|
class: u(n(t).e("padding"))
|
|
1960
1960
|
}, null, 2),
|
|
1961
|
-
(i(!0), d(J, null, _(
|
|
1962
|
-
key:
|
|
1963
|
-
class: u([n(t).e("item"), n(t).is("selected", m.value ===
|
|
1964
|
-
onClick: (me) =>
|
|
1965
|
-
}, N(n(Me)(
|
|
1961
|
+
(i(!0), d(J, null, _(E.value, (j) => (i(), d("div", {
|
|
1962
|
+
key: j,
|
|
1963
|
+
class: u([n(t).e("item"), n(t).is("selected", m.value === j), n(t).is("disabled", v(j))]),
|
|
1964
|
+
onClick: (me) => I(j)
|
|
1965
|
+
}, N(n(Me)(j)), 11, Bl))), 128)),
|
|
1966
1966
|
r("div", {
|
|
1967
1967
|
class: u(n(t).e("padding"))
|
|
1968
1968
|
}, null, 2)
|
|
@@ -2019,14 +2019,14 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2019
2019
|
}), z = B({
|
|
2020
2020
|
startTime: null,
|
|
2021
2021
|
endTime: null
|
|
2022
|
-
}),
|
|
2022
|
+
}), E = B("start"), y = V(() => {
|
|
2023
2023
|
if (!e.modelValue) return null;
|
|
2024
2024
|
if (e.type === "timerange") {
|
|
2025
2025
|
const [f, g] = e.modelValue;
|
|
2026
2026
|
return [Ae(f), Ae(g)];
|
|
2027
2027
|
}
|
|
2028
2028
|
return Ae(e.modelValue);
|
|
2029
|
-
}),
|
|
2029
|
+
}), R = V(() => !y.value || Array.isArray(y.value) ? "" : ke(y.value, e.format)), H = V(() => {
|
|
2030
2030
|
if (!Array.isArray(y.value)) return "";
|
|
2031
2031
|
const [f] = y.value;
|
|
2032
2032
|
return f ? ke(f, e.format) : "";
|
|
@@ -2034,7 +2034,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2034
2034
|
if (!Array.isArray(y.value)) return "";
|
|
2035
2035
|
const [, f] = y.value;
|
|
2036
2036
|
return f ? ke(f, e.format) : "";
|
|
2037
|
-
}), M = V(() => e.type === "timerange" ?
|
|
2037
|
+
}), M = V(() => e.type === "timerange" ? E.value === "start" ? z.value.startTime : z.value.endTime || z.value.startTime : y.value), h = V(() => [
|
|
2038
2038
|
l.b(),
|
|
2039
2039
|
l.m(e.size),
|
|
2040
2040
|
l.is("disabled", e.disabled),
|
|
@@ -2043,10 +2043,10 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2043
2043
|
l.e("input"),
|
|
2044
2044
|
l.is("focus", m.value)
|
|
2045
2045
|
]), x = () => {
|
|
2046
|
-
e.disabled || e.readonly || (m.value ? Y() :
|
|
2046
|
+
e.disabled || e.readonly || (m.value ? Y() : I());
|
|
2047
2047
|
}, A = (f) => {
|
|
2048
|
-
e.disabled || e.readonly || (
|
|
2049
|
-
},
|
|
2048
|
+
e.disabled || e.readonly || (E.value = f, m.value || I());
|
|
2049
|
+
}, I = () => {
|
|
2050
2050
|
m.value = !0, b.value = c(), Se(() => {
|
|
2051
2051
|
if (T.value && S.value) {
|
|
2052
2052
|
const f = T.value.getBoundingClientRect(), g = S.value.getBoundingClientRect();
|
|
@@ -2061,8 +2061,8 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2061
2061
|
m.value = !1, t("blur", {});
|
|
2062
2062
|
}, G = (f) => {
|
|
2063
2063
|
if (e.type === "timerange")
|
|
2064
|
-
if (
|
|
2065
|
-
z.value.startTime = f,
|
|
2064
|
+
if (E.value === "start")
|
|
2065
|
+
z.value.startTime = f, E.value = "end", z.value.endTime && z.value.endTime < f && (z.value.endTime = null);
|
|
2066
2066
|
else {
|
|
2067
2067
|
z.value.startTime && f < z.value.startTime ? (z.value.endTime = z.value.startTime, z.value.startTime = f) : z.value.endTime = f;
|
|
2068
2068
|
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime, X = e.valueFormat ? ke(z.value.endTime, e.valueFormat) : z.value.endTime;
|
|
@@ -2100,7 +2100,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2100
2100
|
f && e.type === "timerange" && (z.value = {
|
|
2101
2101
|
startTime: Array.isArray(y.value) ? y.value[0] : null,
|
|
2102
2102
|
endTime: Array.isArray(y.value) ? y.value[1] : null
|
|
2103
|
-
},
|
|
2103
|
+
}, E.value = "start");
|
|
2104
2104
|
});
|
|
2105
2105
|
const o = (f) => {
|
|
2106
2106
|
f.key === "Escape" && Y();
|
|
@@ -2135,13 +2135,13 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2135
2135
|
placeholder: s.placeholder,
|
|
2136
2136
|
disabled: s.disabled,
|
|
2137
2137
|
readonly: !0,
|
|
2138
|
-
value:
|
|
2138
|
+
value: R.value,
|
|
2139
2139
|
class: u(n(l).e("input-inner"))
|
|
2140
2140
|
}, null, 10, Fl),
|
|
2141
2141
|
r("span", {
|
|
2142
2142
|
class: u(n(l).e("suffix"))
|
|
2143
2143
|
}, [
|
|
2144
|
-
s.clearable &&
|
|
2144
|
+
s.clearable && R.value && !s.disabled ? (i(), d("span", {
|
|
2145
2145
|
key: 0,
|
|
2146
2146
|
class: u(n(l).e("clear")),
|
|
2147
2147
|
onClick: ue(w, ["stop"])
|
|
@@ -2171,7 +2171,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2171
2171
|
disabled: s.disabled,
|
|
2172
2172
|
readonly: !0,
|
|
2173
2173
|
value: H.value,
|
|
2174
|
-
class: u([n(l).e("input-inner"), n(l).is("active",
|
|
2174
|
+
class: u([n(l).e("input-inner"), n(l).is("active", E.value === "start")]),
|
|
2175
2175
|
onClick: g[0] || (g[0] = ue((X) => A("start"), ["stop"]))
|
|
2176
2176
|
}, null, 10, Il),
|
|
2177
2177
|
r("span", {
|
|
@@ -2183,7 +2183,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2183
2183
|
disabled: s.disabled,
|
|
2184
2184
|
readonly: !0,
|
|
2185
2185
|
value: O.value,
|
|
2186
|
-
class: u([n(l).e("input-inner"), n(l).is("active",
|
|
2186
|
+
class: u([n(l).e("input-inner"), n(l).is("active", E.value === "end")]),
|
|
2187
2187
|
onClick: g[1] || (g[1] = ue((X) => A("end"), ["stop"]))
|
|
2188
2188
|
}, null, 10, Pl),
|
|
2189
2189
|
r("span", {
|
|
@@ -2221,7 +2221,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2221
2221
|
s.type === "timerange" ? (i(), d("div", {
|
|
2222
2222
|
key: 0,
|
|
2223
2223
|
class: u(n(l).e("popper-header"))
|
|
2224
|
-
}, N(
|
|
2224
|
+
}, N(E.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : U("", !0),
|
|
2225
2225
|
Q(Al, {
|
|
2226
2226
|
"model-value": M.value,
|
|
2227
2227
|
format: s.format,
|
|
@@ -2311,51 +2311,59 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2311
2311
|
setup(s, { emit: k }) {
|
|
2312
2312
|
const a = le({
|
|
2313
2313
|
name: "XSelectPopperContent",
|
|
2314
|
-
setup(
|
|
2314
|
+
setup(P, { slots: q }) {
|
|
2315
2315
|
const Z = xe("select");
|
|
2316
2316
|
return Z && $e("select", Z), () => {
|
|
2317
|
-
var
|
|
2318
|
-
return (
|
|
2317
|
+
var L;
|
|
2318
|
+
return (L = q.default) == null ? void 0 : L.call(q);
|
|
2319
2319
|
};
|
|
2320
2320
|
}
|
|
2321
2321
|
}), e = s, t = k, l = ae("select"), c = Le(), m = () => {
|
|
2322
|
-
const
|
|
2323
|
-
let
|
|
2322
|
+
const P = Ee();
|
|
2323
|
+
let q = P.current;
|
|
2324
2324
|
document.querySelectorAll(
|
|
2325
2325
|
".x-drawer__overlay, .x-modal__overlay, .x-select__popper, .x-dropdown__popper, .x-popover__popper"
|
|
2326
|
-
).forEach((
|
|
2327
|
-
const W = parseInt(getComputedStyle(
|
|
2328
|
-
!isNaN(W) && W >
|
|
2326
|
+
).forEach((F) => {
|
|
2327
|
+
const W = parseInt(getComputedStyle(F).zIndex, 10);
|
|
2328
|
+
!isNaN(W) && W > q && (q = W);
|
|
2329
2329
|
});
|
|
2330
|
-
const
|
|
2331
|
-
return
|
|
2332
|
-
}, b = B(), T = B(), S = B(), D = B(!1), $ = B(2e3), z = B(""),
|
|
2333
|
-
|
|
2334
|
-
}, O = V(() => e.type === "multiple" || e.mode === "multiple"), M = V(() => e.type === "cascader"), h = B([]), v = V(() =>
|
|
2335
|
-
|
|
2330
|
+
const L = q + 1;
|
|
2331
|
+
return P.set(L), L;
|
|
2332
|
+
}, b = B(), T = B(), S = B(), D = B(!1), $ = B(2e3), z = B(""), E = B(-1), y = B({ top: "0px", left: "0px" }), R = B([]), H = (P) => {
|
|
2333
|
+
R.value.find((q) => q.value === P.value) || R.value.push(P);
|
|
2334
|
+
}, O = V(() => e.type === "multiple" || e.mode === "multiple"), M = V(() => e.type === "cascader"), h = B([]), v = V(() => {
|
|
2335
|
+
const P = e.options && e.options.length > 0 ? e.options : [], q = R.value;
|
|
2336
|
+
if (q.length === 0) return P;
|
|
2337
|
+
if (P.length === 0) return q;
|
|
2338
|
+
const Z = new Set(q.map((F) => F.value)), L = [...q];
|
|
2339
|
+
for (const F of P)
|
|
2340
|
+
Z.has(F.value) || L.push(F);
|
|
2341
|
+
return L;
|
|
2342
|
+
}), x = (P) => {
|
|
2343
|
+
t("update:modelValue", P), t("update:value", P), t("change", P);
|
|
2336
2344
|
}, A = V(() => {
|
|
2337
|
-
const
|
|
2338
|
-
return O.value ? Array.isArray(
|
|
2339
|
-
}),
|
|
2340
|
-
const
|
|
2341
|
-
return M.value ? Ol(
|
|
2342
|
-
}), Y = V(() => !e.filterable || !z.value ?
|
|
2343
|
-
const
|
|
2344
|
-
return El(
|
|
2345
|
+
const P = e.modelValue ?? e.value;
|
|
2346
|
+
return O.value ? Array.isArray(P) ? P : [] : M.value ? Array.isArray(P) ? P : P != null && P !== "" ? [P] : [] : P != null && P !== "" ? [P] : [];
|
|
2347
|
+
}), I = V(() => {
|
|
2348
|
+
const P = v.value;
|
|
2349
|
+
return M.value ? Ol(P, e.childrenKey) : P.map((q) => ({ ...q, level: 0 }));
|
|
2350
|
+
}), Y = V(() => !e.filterable || !z.value ? I.value : I.value.filter((P) => {
|
|
2351
|
+
const q = P[e.labelKey] || "";
|
|
2352
|
+
return El(q, z.value, e.filterMethod);
|
|
2345
2353
|
})), G = V(() => {
|
|
2346
|
-
const
|
|
2347
|
-
for (const
|
|
2348
|
-
const Z = We(v.value,
|
|
2349
|
-
Z &&
|
|
2354
|
+
const P = [];
|
|
2355
|
+
for (const q of A.value) {
|
|
2356
|
+
const Z = We(v.value, q, e.valueKey, e.childrenKey);
|
|
2357
|
+
Z && P.push(Z);
|
|
2350
2358
|
}
|
|
2351
|
-
return
|
|
2359
|
+
return P;
|
|
2352
2360
|
}), p = V(() => {
|
|
2353
2361
|
if (O.value)
|
|
2354
2362
|
return "";
|
|
2355
2363
|
if (M.value)
|
|
2356
2364
|
return Fe(v.value, A.value[A.value.length - 1], e.valueKey, e.childrenKey).map((Z) => Z[e.labelKey]).join(e.separator);
|
|
2357
|
-
const
|
|
2358
|
-
return
|
|
2365
|
+
const P = G.value[0];
|
|
2366
|
+
return P ? P[e.labelKey] : "";
|
|
2359
2367
|
}), w = V(() => O.value ? G.value : []), C = V(() => e.collapseTags ? w.value.slice(0, e.maxCollapseTags) : w.value), o = V(() => e.collapseTags ? Math.max(0, w.value.length - e.maxCollapseTags) : 0), f = V(() => [
|
|
2360
2368
|
l.b(),
|
|
2361
2369
|
l.m(e.size),
|
|
@@ -2366,24 +2374,24 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2366
2374
|
l.is("focus", D.value)
|
|
2367
2375
|
]), g = () => {
|
|
2368
2376
|
if (!b.value || !S.value || !D.value) return;
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2371
|
-
const Z =
|
|
2372
|
-
let
|
|
2373
|
-
|
|
2377
|
+
const P = b.value.getBoundingClientRect(), q = S.value;
|
|
2378
|
+
q.offsetHeight;
|
|
2379
|
+
const Z = q.getBoundingClientRect();
|
|
2380
|
+
let L = P.bottom + 4, F = P.left;
|
|
2381
|
+
F + Z.width > window.innerWidth && (F = window.innerWidth - Z.width - 8);
|
|
2374
2382
|
let W = 274;
|
|
2375
|
-
if (
|
|
2376
|
-
const he =
|
|
2383
|
+
if (L + Z.height > window.innerHeight) {
|
|
2384
|
+
const he = P.top - Z.height - 4;
|
|
2377
2385
|
if (he >= 8)
|
|
2378
|
-
|
|
2386
|
+
L = he;
|
|
2379
2387
|
else {
|
|
2380
|
-
const Oe = window.innerHeight -
|
|
2381
|
-
Ye > Oe ? (
|
|
2388
|
+
const Oe = window.innerHeight - P.bottom - 8, Ye = P.top - 8;
|
|
2389
|
+
Ye > Oe ? (L = 8, W = Math.max(120, Ye)) : W = Math.max(120, Oe);
|
|
2382
2390
|
}
|
|
2383
2391
|
}
|
|
2384
2392
|
y.value = {
|
|
2385
|
-
top: `${
|
|
2386
|
-
left: `${
|
|
2393
|
+
top: `${L}px`,
|
|
2394
|
+
left: `${F}px`,
|
|
2387
2395
|
maxHeight: `${W}px`
|
|
2388
2396
|
};
|
|
2389
2397
|
}, X = () => {
|
|
@@ -2394,79 +2402,79 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2394
2402
|
}), t("visible-change", !0), t("focus", {}));
|
|
2395
2403
|
}, ne = () => {
|
|
2396
2404
|
D.value = !1, z.value = "", h.value = [], t("visible-change", !1), t("blur", {});
|
|
2397
|
-
}, K = (
|
|
2398
|
-
if (!
|
|
2405
|
+
}, K = (P) => {
|
|
2406
|
+
if (!P.disabled)
|
|
2399
2407
|
if (O.value) {
|
|
2400
|
-
const
|
|
2401
|
-
if (
|
|
2402
|
-
|
|
2408
|
+
const q = [...A.value], Z = P[e.valueKey], L = q.indexOf(Z);
|
|
2409
|
+
if (L > -1)
|
|
2410
|
+
q.splice(L, 1), t("remove-tag", Z);
|
|
2403
2411
|
else {
|
|
2404
|
-
if (e.multipleLimit > 0 &&
|
|
2412
|
+
if (e.multipleLimit > 0 && q.length >= e.multipleLimit)
|
|
2405
2413
|
return;
|
|
2406
|
-
|
|
2414
|
+
q.push(Z);
|
|
2407
2415
|
}
|
|
2408
|
-
x(
|
|
2416
|
+
x(q);
|
|
2409
2417
|
} else if (M.value)
|
|
2410
|
-
if (
|
|
2411
|
-
const
|
|
2412
|
-
h.value =
|
|
2418
|
+
if (P.children && P.children.length > 0) {
|
|
2419
|
+
const q = Fe(v.value, P[e.valueKey], e.valueKey, e.childrenKey);
|
|
2420
|
+
h.value = q;
|
|
2413
2421
|
} else {
|
|
2414
|
-
const Z = Fe(v.value,
|
|
2422
|
+
const Z = Fe(v.value, P[e.valueKey], e.valueKey, e.childrenKey).map((L) => L[e.valueKey]);
|
|
2415
2423
|
x(Z), ne();
|
|
2416
2424
|
}
|
|
2417
2425
|
else
|
|
2418
|
-
x(
|
|
2419
|
-
}, re = (
|
|
2420
|
-
const
|
|
2421
|
-
x(
|
|
2422
|
-
},
|
|
2423
|
-
const
|
|
2424
|
-
x(
|
|
2425
|
-
}, me = (
|
|
2426
|
-
z.value =
|
|
2427
|
-
}, ye = (
|
|
2426
|
+
x(P[e.valueKey]), ne();
|
|
2427
|
+
}, re = (P) => {
|
|
2428
|
+
const q = A.value.filter((Z) => Z !== P[e.valueKey]);
|
|
2429
|
+
x(q), t("remove-tag", P[e.valueKey]);
|
|
2430
|
+
}, j = () => {
|
|
2431
|
+
const P = O.value ? [] : "";
|
|
2432
|
+
x(P), t("clear");
|
|
2433
|
+
}, me = (P) => {
|
|
2434
|
+
z.value = P.target.value;
|
|
2435
|
+
}, ye = (P) => {
|
|
2428
2436
|
if (!b.value) return;
|
|
2429
|
-
const
|
|
2430
|
-
b.value.contains(
|
|
2431
|
-
}, ze = (
|
|
2432
|
-
if (
|
|
2437
|
+
const q = P.target, Z = S.value && S.value.contains(q);
|
|
2438
|
+
b.value.contains(q) || Z || ne();
|
|
2439
|
+
}, ze = (P) => {
|
|
2440
|
+
if (P.key === "Escape")
|
|
2433
2441
|
ne();
|
|
2434
|
-
else if (
|
|
2435
|
-
const
|
|
2436
|
-
|
|
2437
|
-
} else
|
|
2438
|
-
}, we = (
|
|
2442
|
+
else if (P.key === "Enter" && D.value) {
|
|
2443
|
+
const q = Y.value[E.value];
|
|
2444
|
+
q && K(q);
|
|
2445
|
+
} else P.key === "ArrowDown" && D.value ? (P.preventDefault(), E.value = Math.min(E.value + 1, Y.value.length - 1)) : P.key === "ArrowUp" && D.value && (P.preventDefault(), E.value = Math.max(E.value - 1, 0));
|
|
2446
|
+
}, we = (P) => A.value.includes(P[e.valueKey]), Te = (P, q) => [
|
|
2439
2447
|
l.e("option"),
|
|
2440
|
-
l.is("selected", we(
|
|
2441
|
-
l.is("disabled",
|
|
2442
|
-
l.is("hover",
|
|
2443
|
-
l.is("group", !!(
|
|
2448
|
+
l.is("selected", we(P)),
|
|
2449
|
+
l.is("disabled", P.disabled === !0),
|
|
2450
|
+
l.is("hover", E.value === q),
|
|
2451
|
+
l.is("group", !!(P.children && P.children.length > 0))
|
|
2444
2452
|
], Re = V(() => {
|
|
2445
2453
|
if (!M.value) return [];
|
|
2446
|
-
const
|
|
2447
|
-
for (const
|
|
2448
|
-
|
|
2449
|
-
return
|
|
2454
|
+
const P = [v.value];
|
|
2455
|
+
for (const q of h.value)
|
|
2456
|
+
q.children && q.children.length > 0 && P.push(q.children);
|
|
2457
|
+
return P;
|
|
2450
2458
|
});
|
|
2451
2459
|
return ge(() => {
|
|
2452
2460
|
document.addEventListener("mousedown", ye), document.addEventListener("keydown", ze);
|
|
2453
2461
|
}), De(() => {
|
|
2454
2462
|
document.removeEventListener("mousedown", ye), document.removeEventListener("keydown", ze), document.removeEventListener("scroll", g, !0);
|
|
2455
|
-
}), ie(D, (
|
|
2456
|
-
|
|
2463
|
+
}), ie(D, (P) => {
|
|
2464
|
+
P ? document.addEventListener("scroll", g, !0) : document.removeEventListener("scroll", g, !0);
|
|
2457
2465
|
}), $e("select", {
|
|
2458
2466
|
selectedValues: A,
|
|
2459
2467
|
handleSelect: K,
|
|
2460
2468
|
isSelected: we,
|
|
2461
2469
|
registerOption: H
|
|
2462
|
-
}), (
|
|
2470
|
+
}), (P, q) => (i(), d("div", {
|
|
2463
2471
|
ref_key: "selectRef",
|
|
2464
2472
|
ref: b,
|
|
2465
2473
|
class: u(f.value)
|
|
2466
2474
|
}, [
|
|
2467
2475
|
r("div", {
|
|
2468
2476
|
class: u(n(l).e("wrapper")),
|
|
2469
|
-
onClick:
|
|
2477
|
+
onClick: q[0] || (q[0] = (Z) => D.value ? ne() : X())
|
|
2470
2478
|
}, [
|
|
2471
2479
|
O.value && w.value.length > 0 ? (i(), d("div", {
|
|
2472
2480
|
key: 0,
|
|
@@ -2481,7 +2489,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2481
2489
|
}, N(Z[s.labelKey]), 3),
|
|
2482
2490
|
r("span", {
|
|
2483
2491
|
class: u(n(l).e("tag-close")),
|
|
2484
|
-
onClick: ue((
|
|
2492
|
+
onClick: ue((L) => re(Z), ["stop"])
|
|
2485
2493
|
}, "×", 10, Yl)
|
|
2486
2494
|
], 2))), 128)),
|
|
2487
2495
|
o.value > 0 ? (i(), d("span", {
|
|
@@ -2505,7 +2513,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2505
2513
|
s.clearable && A.value.length > 0 && !s.disabled ? (i(), d("span", {
|
|
2506
2514
|
key: 0,
|
|
2507
2515
|
class: u(n(l).e("clear")),
|
|
2508
|
-
onClick: ue(
|
|
2516
|
+
onClick: ue(j, ["stop"])
|
|
2509
2517
|
}, "×", 2)) : (i(), d("span", {
|
|
2510
2518
|
key: 1,
|
|
2511
2519
|
class: u([n(l).e("arrow"), n(l).is("reverse", D.value)])
|
|
@@ -2530,19 +2538,19 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2530
2538
|
key: 0,
|
|
2531
2539
|
class: u(n(l).e("cascader-panels"))
|
|
2532
2540
|
}, [
|
|
2533
|
-
(i(!0), d(J, null, _(Re.value, (Z,
|
|
2534
|
-
key:
|
|
2541
|
+
(i(!0), d(J, null, _(Re.value, (Z, L) => (i(), d("div", {
|
|
2542
|
+
key: L,
|
|
2535
2543
|
class: u(n(l).e("cascader-panel"))
|
|
2536
2544
|
}, [
|
|
2537
|
-
(i(!0), d(J, null, _(Z, (
|
|
2538
|
-
key:
|
|
2539
|
-
class: u(Te(
|
|
2540
|
-
onClick: ue((he) => K(
|
|
2545
|
+
(i(!0), d(J, null, _(Z, (F, W) => (i(), d("div", {
|
|
2546
|
+
key: F[s.valueKey],
|
|
2547
|
+
class: u(Te(F, W)),
|
|
2548
|
+
onClick: ue((he) => K(F), ["stop", "prevent"])
|
|
2541
2549
|
}, [
|
|
2542
2550
|
r("span", {
|
|
2543
2551
|
class: u(n(l).e("option-label"))
|
|
2544
|
-
}, N(
|
|
2545
|
-
|
|
2552
|
+
}, N(F[s.labelKey]), 3),
|
|
2553
|
+
F.children && F.children.length > 0 ? (i(), d("span", {
|
|
2546
2554
|
key: 0,
|
|
2547
2555
|
class: u(n(l).e("option-arrow"))
|
|
2548
2556
|
}, "›", 2)) : U("", !0)
|
|
@@ -2553,13 +2561,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2553
2561
|
key: 0,
|
|
2554
2562
|
class: u(n(l).e("empty"))
|
|
2555
2563
|
}, N(z.value ? s.noMatchText : s.noDataText), 3)) : (i(), d(J, { key: 1 }, [
|
|
2556
|
-
|
|
2564
|
+
P.$slots.default ? (i(), d("div", {
|
|
2557
2565
|
key: 0,
|
|
2558
2566
|
class: u(n(l).e("options"))
|
|
2559
2567
|
}, [
|
|
2560
2568
|
Q(n(a), null, {
|
|
2561
2569
|
default: He(() => [
|
|
2562
|
-
se(
|
|
2570
|
+
se(P.$slots, "default")
|
|
2563
2571
|
]),
|
|
2564
2572
|
_: 3
|
|
2565
2573
|
})
|
|
@@ -2567,10 +2575,10 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2567
2575
|
key: 1,
|
|
2568
2576
|
class: u(n(l).e("options"))
|
|
2569
2577
|
}, [
|
|
2570
|
-
(i(!0), d(J, null, _(Y.value, (Z,
|
|
2578
|
+
(i(!0), d(J, null, _(Y.value, (Z, L) => (i(), d("div", {
|
|
2571
2579
|
key: Z[s.valueKey],
|
|
2572
|
-
class: u(Te(Z,
|
|
2573
|
-
onClick: ue((
|
|
2580
|
+
class: u(Te(Z, L)),
|
|
2581
|
+
onClick: ue((F) => K(Z), ["stop", "prevent"])
|
|
2574
2582
|
}, [
|
|
2575
2583
|
r("span", {
|
|
2576
2584
|
class: u(n(l).e("option-label"))
|
|
@@ -2660,17 +2668,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2660
2668
|
}), b = V(() => {
|
|
2661
2669
|
var o;
|
|
2662
2670
|
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2663
|
-
}), T = B(""), S = B(""), D = B([]), $ = B([]), z = (o) => o[c.value],
|
|
2671
|
+
}), T = B(""), S = B(""), D = B([]), $ = B([]), z = (o) => o[c.value], E = (o) => o[m.value], y = (o) => o[b.value] || !1, R = V(() => e.data.filter((o) => {
|
|
2664
2672
|
const f = z(o);
|
|
2665
|
-
return e.modelValue.includes(f) ? !1 : e.filterable && T.value ? e.filterMethod ? e.filterMethod(T.value, o) :
|
|
2673
|
+
return e.modelValue.includes(f) ? !1 : e.filterable && T.value ? e.filterMethod ? e.filterMethod(T.value, o) : E(o).toLowerCase().includes(T.value.toLowerCase()) : !0;
|
|
2666
2674
|
})), H = V(() => {
|
|
2667
2675
|
const o = e.modelValue;
|
|
2668
2676
|
let f = e.data.filter((g) => {
|
|
2669
2677
|
const X = z(g);
|
|
2670
2678
|
return o.includes(X);
|
|
2671
2679
|
});
|
|
2672
|
-
return e.filterable && S.value && (f = f.filter((g) => e.filterMethod ? e.filterMethod(S.value, g) :
|
|
2673
|
-
}), O = V(() =>
|
|
2680
|
+
return e.filterable && S.value && (f = f.filter((g) => e.filterMethod ? e.filterMethod(S.value, g) : E(g).toLowerCase().includes(S.value.toLowerCase()))), e.targetOrder === "push" ? f.sort((g, X) => o.indexOf(z(g)) - o.indexOf(z(X))) : e.targetOrder === "unshift" ? f.sort((g, X) => o.indexOf(z(X)) - o.indexOf(z(g))) : f;
|
|
2681
|
+
}), O = V(() => R.value.filter((o) => D.value.includes(z(o))).every((o) => y(o))), M = V(() => H.value.filter((o) => $.value.includes(z(o))).every((o) => y(o))), h = V(() => D.value.length === 0 || O.value), v = V(() => $.value.length === 0 || M.value), x = () => {
|
|
2674
2682
|
const o = D.value.filter((g) => {
|
|
2675
2683
|
const X = e.data.find((ne) => z(ne) === g);
|
|
2676
2684
|
return X && !y(X);
|
|
@@ -2683,14 +2691,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2683
2691
|
return X && !y(X);
|
|
2684
2692
|
}), f = e.modelValue.filter((g) => !o.includes(g));
|
|
2685
2693
|
t("update:modelValue", f), t("change", f, "left", o), $.value = [];
|
|
2686
|
-
},
|
|
2694
|
+
}, I = (o) => {
|
|
2687
2695
|
const f = D.value.indexOf(o);
|
|
2688
2696
|
f > -1 ? D.value.splice(f, 1) : D.value.push(o), t("left-check-change", [...D.value]);
|
|
2689
2697
|
}, Y = (o) => {
|
|
2690
2698
|
const f = $.value.indexOf(o);
|
|
2691
2699
|
f > -1 ? $.value.splice(f, 1) : $.value.push(o), t("right-check-change", [...$.value]);
|
|
2692
2700
|
}, G = () => {
|
|
2693
|
-
D.value.length ===
|
|
2701
|
+
D.value.length === R.value.filter((o) => !y(o)).length ? D.value = [] : D.value = R.value.filter((o) => !y(o)).map((o) => z(o)), t("left-check-change", [...D.value]);
|
|
2694
2702
|
}, p = () => {
|
|
2695
2703
|
$.value.length === H.value.filter((o) => !y(o)).length ? $.value = [] : $.value = H.value.filter((o) => !y(o)).map((o) => z(o)), t("right-check-change", [...$.value]);
|
|
2696
2704
|
}, w = (o) => {
|
|
@@ -2712,15 +2720,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2712
2720
|
}, [
|
|
2713
2721
|
r("input", {
|
|
2714
2722
|
type: "checkbox",
|
|
2715
|
-
checked: D.value.length > 0 && D.value.length ===
|
|
2716
|
-
indeterminate: D.value.length > 0 && D.value.length <
|
|
2723
|
+
checked: D.value.length > 0 && D.value.length === R.value.filter((g) => !y(g)).length,
|
|
2724
|
+
indeterminate: D.value.length > 0 && D.value.length < R.value.filter((g) => !y(g)).length,
|
|
2717
2725
|
onChange: G
|
|
2718
2726
|
}, null, 40, Kl),
|
|
2719
2727
|
r("span", null, N(s.titles[0]), 1)
|
|
2720
2728
|
], 2),
|
|
2721
2729
|
r("span", {
|
|
2722
2730
|
class: u(n(l).e("count"))
|
|
2723
|
-
}, N(D.value.length) + " / " + N(
|
|
2731
|
+
}, N(D.value.length) + " / " + N(R.value.length), 3)
|
|
2724
2732
|
], 2),
|
|
2725
2733
|
s.filterable ? (i(), d("div", {
|
|
2726
2734
|
key: 0,
|
|
@@ -2742,14 +2750,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2742
2750
|
r("div", {
|
|
2743
2751
|
class: u(n(l).e("body"))
|
|
2744
2752
|
}, [
|
|
2745
|
-
(i(!0), d(J, null, _(
|
|
2753
|
+
(i(!0), d(J, null, _(R.value, (g) => (i(), d("div", {
|
|
2746
2754
|
key: z(g),
|
|
2747
2755
|
class: u([
|
|
2748
2756
|
n(l).e("item"),
|
|
2749
2757
|
n(l).is("disabled", y(g)),
|
|
2750
2758
|
n(l).is("checked", D.value.includes(z(g)))
|
|
2751
2759
|
]),
|
|
2752
|
-
onClick: (X) => !y(g) &&
|
|
2760
|
+
onClick: (X) => !y(g) && I(z(g))
|
|
2753
2761
|
}, [
|
|
2754
2762
|
r("label", {
|
|
2755
2763
|
class: u(n(l).e("checkbox"))
|
|
@@ -2760,12 +2768,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2760
2768
|
disabled: y(g),
|
|
2761
2769
|
onClick: f[2] || (f[2] = ue(() => {
|
|
2762
2770
|
}, ["stop"])),
|
|
2763
|
-
onChange: (X) =>
|
|
2771
|
+
onChange: (X) => I(z(g))
|
|
2764
2772
|
}, null, 40, jl),
|
|
2765
|
-
r("span", null, N(
|
|
2773
|
+
r("span", null, N(E(g)), 1)
|
|
2766
2774
|
], 2)
|
|
2767
2775
|
], 10, ql))), 128)),
|
|
2768
|
-
|
|
2776
|
+
R.value.length === 0 ? (i(), d("div", {
|
|
2769
2777
|
key: 0,
|
|
2770
2778
|
class: u(n(l).e("empty"))
|
|
2771
2779
|
}, [
|
|
@@ -2850,7 +2858,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2850
2858
|
}, ["stop"])),
|
|
2851
2859
|
onChange: (X) => Y(z(g))
|
|
2852
2860
|
}, null, 40, ea),
|
|
2853
|
-
r("span", null, N(
|
|
2861
|
+
r("span", null, N(E(g)), 1)
|
|
2854
2862
|
], 2)
|
|
2855
2863
|
], 10, _l))), 128)),
|
|
2856
2864
|
H.value.length === 0 ? (i(), d("div", {
|
|
@@ -2898,7 +2906,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2898
2906
|
const C = Number(w), o = a.marks[C], f = (C - a.min) / (a.max - a.min) * 100;
|
|
2899
2907
|
let g, X = {};
|
|
2900
2908
|
return typeof o == "string" ? g = o : (g = o.label || String(C), X = o.style || {}), { value: C, pos: f, label: g, style: X };
|
|
2901
|
-
}) : []), z = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0,
|
|
2909
|
+
}) : []), z = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, E = (w, C) => {
|
|
2902
2910
|
if (!l.value) return a.modelValue;
|
|
2903
2911
|
const o = l.value.getBoundingClientRect(), f = z();
|
|
2904
2912
|
let g;
|
|
@@ -2909,25 +2917,25 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2909
2917
|
if (a.disabled) return;
|
|
2910
2918
|
const C = Math.max(a.min, Math.min(a.max, w));
|
|
2911
2919
|
C !== a.modelValue && (e("update:modelValue", C), e("input", C));
|
|
2912
|
-
},
|
|
2920
|
+
}, R = (w) => {
|
|
2913
2921
|
if (a.disabled) return;
|
|
2914
2922
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
2915
|
-
const C =
|
|
2923
|
+
const C = E(w.clientX, w.clientY);
|
|
2916
2924
|
y(C), document.addEventListener("mousemove", H), document.addEventListener("mouseup", O);
|
|
2917
2925
|
}, H = (w) => {
|
|
2918
2926
|
if (!b.value) return;
|
|
2919
|
-
const C =
|
|
2927
|
+
const C = E(w.clientX, w.clientY);
|
|
2920
2928
|
y(C);
|
|
2921
2929
|
}, O = () => {
|
|
2922
2930
|
b.value = !1, e("change", a.modelValue), document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", O);
|
|
2923
2931
|
}, M = (w) => {
|
|
2924
2932
|
if (a.disabled) return;
|
|
2925
2933
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
2926
|
-
const C = w.touches[0], o =
|
|
2934
|
+
const C = w.touches[0], o = E(C.clientX, C.clientY);
|
|
2927
2935
|
y(o);
|
|
2928
2936
|
}, h = (w) => {
|
|
2929
2937
|
if (!b.value) return;
|
|
2930
|
-
const C = w.touches[0], o =
|
|
2938
|
+
const C = w.touches[0], o = E(C.clientX, C.clientY);
|
|
2931
2939
|
y(o);
|
|
2932
2940
|
}, v = () => {
|
|
2933
2941
|
b.value = !1, e("change", a.modelValue);
|
|
@@ -2939,20 +2947,20 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2939
2947
|
De(() => {
|
|
2940
2948
|
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", O);
|
|
2941
2949
|
});
|
|
2942
|
-
const
|
|
2950
|
+
const I = V(() => [
|
|
2943
2951
|
t.b(),
|
|
2944
2952
|
t.is("disabled", a.disabled),
|
|
2945
2953
|
t.is("vertical", a.vertical)
|
|
2946
2954
|
]), Y = V(() => a.vertical && a.height ? { height: typeof a.height == "number" ? `${a.height}px` : a.height } : {}), G = V(() => a.vertical ? { height: `${T.value}%` } : { width: `${T.value}%` }), p = V(() => a.vertical ? { bottom: `${T.value}%` } : { left: `${T.value}%` });
|
|
2947
2955
|
return (w, C) => (i(), d("div", {
|
|
2948
|
-
class: u(
|
|
2956
|
+
class: u(I.value),
|
|
2949
2957
|
style: te(Y.value)
|
|
2950
2958
|
}, [
|
|
2951
2959
|
r("div", {
|
|
2952
2960
|
ref_key: "sliderRef",
|
|
2953
2961
|
ref: l,
|
|
2954
2962
|
class: u(n(t).e("runway")),
|
|
2955
|
-
onMousedown:
|
|
2963
|
+
onMousedown: R,
|
|
2956
2964
|
onTouchstart: M
|
|
2957
2965
|
}, [
|
|
2958
2966
|
r("div", {
|
|
@@ -3069,7 +3077,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3069
3077
|
l.is("disabled", e.disabled),
|
|
3070
3078
|
l.is("drag", e.drag),
|
|
3071
3079
|
l.m(e.listType)
|
|
3072
|
-
]),
|
|
3080
|
+
]), E = (p) => {
|
|
3073
3081
|
const w = p.target.files;
|
|
3074
3082
|
!w || w.length === 0 || (y(Array.from(w)), c.value && (c.value.value = ""));
|
|
3075
3083
|
}, y = async (p) => {
|
|
@@ -3089,9 +3097,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3089
3097
|
uid: S(),
|
|
3090
3098
|
raw: o
|
|
3091
3099
|
};
|
|
3092
|
-
o.type.startsWith("image/") && (f.thumbUrl = await
|
|
3100
|
+
o.type.startsWith("image/") && (f.thumbUrl = await R(o), f.url = f.thumbUrl), m.value.push(f), t("update:fileList", m.value), t("change", f, m.value), (C = e.onChange) == null || C.call(e, f, m.value), e.autoUpload && H(f);
|
|
3093
3101
|
}
|
|
3094
|
-
},
|
|
3102
|
+
}, R = (p) => new Promise((w) => {
|
|
3095
3103
|
const C = new FileReader();
|
|
3096
3104
|
C.onload = (o) => {
|
|
3097
3105
|
var f;
|
|
@@ -3158,7 +3166,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3158
3166
|
e.disabled || (p = c.value) == null || p.click();
|
|
3159
3167
|
}, A = (p) => {
|
|
3160
3168
|
p.preventDefault(), !e.disabled && e.drag && (b.value = !0);
|
|
3161
|
-
},
|
|
3169
|
+
}, I = () => {
|
|
3162
3170
|
b.value = !1;
|
|
3163
3171
|
}, Y = (p) => {
|
|
3164
3172
|
var C;
|
|
@@ -3185,7 +3193,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3185
3193
|
class: u([n(l).e("drag"), n(l).is("dragover", b.value)]),
|
|
3186
3194
|
onClick: x,
|
|
3187
3195
|
onDragover: A,
|
|
3188
|
-
onDragleave:
|
|
3196
|
+
onDragleave: I,
|
|
3189
3197
|
onDrop: Y
|
|
3190
3198
|
}, [
|
|
3191
3199
|
se(p.$slots, "drag", {}, () => [
|
|
@@ -3393,7 +3401,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3393
3401
|
multiple: s.multiple,
|
|
3394
3402
|
accept: s.accept,
|
|
3395
3403
|
disabled: s.disabled,
|
|
3396
|
-
onChange:
|
|
3404
|
+
onChange: E
|
|
3397
3405
|
}, null, 42, ga),
|
|
3398
3406
|
p.$slots.tip ? (i(), d("div", {
|
|
3399
3407
|
key: 3,
|
|
@@ -3435,8 +3443,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3435
3443
|
t.is("disabled", a.disabled),
|
|
3436
3444
|
t.is("readonly", a.readonly)
|
|
3437
3445
|
]), b = (y) => a.disabled ? a.disabledVoidColor : y <= a.lowThreshold ? a.colors[0] : y <= a.highThreshold ? a.colors[1] || a.colors[0] : a.colors[2] || a.colors[1] || a.colors[0], T = (y) => {
|
|
3438
|
-
const
|
|
3439
|
-
return
|
|
3446
|
+
const R = c.value;
|
|
3447
|
+
return R >= y ? 100 : a.allowHalf && R >= y - 0.5 ? 50 : 0;
|
|
3440
3448
|
}, S = (y) => T(y) > 0 ? b(c.value) : a.disabled ? a.disabledVoidColor : a.voidColor, D = V(() => {
|
|
3441
3449
|
if (a.showScore)
|
|
3442
3450
|
return a.scoreTemplate.replace("{value}", String(a.modelValue));
|
|
@@ -3445,26 +3453,26 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3445
3453
|
return a.texts[Math.max(0, y)] || "";
|
|
3446
3454
|
}
|
|
3447
3455
|
return "";
|
|
3448
|
-
}), $ = (y,
|
|
3456
|
+
}), $ = (y, R) => {
|
|
3449
3457
|
if (!(a.disabled || a.readonly))
|
|
3450
3458
|
if (a.allowHalf) {
|
|
3451
|
-
const O =
|
|
3459
|
+
const O = R.currentTarget.getBoundingClientRect(), M = R.clientX - O.left < O.width / 2;
|
|
3452
3460
|
l.value = M ? y - 0.5 : y;
|
|
3453
3461
|
} else
|
|
3454
3462
|
l.value = y;
|
|
3455
3463
|
}, z = () => {
|
|
3456
3464
|
a.disabled || a.readonly || (l.value = -1);
|
|
3457
|
-
},
|
|
3465
|
+
}, E = (y, R) => {
|
|
3458
3466
|
if (a.disabled || a.readonly) return;
|
|
3459
3467
|
let H;
|
|
3460
3468
|
if (a.allowHalf) {
|
|
3461
|
-
const M =
|
|
3462
|
-
H =
|
|
3469
|
+
const M = R.currentTarget.getBoundingClientRect();
|
|
3470
|
+
H = R.clientX - M.left < M.width / 2 ? y - 0.5 : y;
|
|
3463
3471
|
} else
|
|
3464
3472
|
H = y;
|
|
3465
3473
|
e("update:modelValue", H), e("change", H);
|
|
3466
3474
|
};
|
|
3467
|
-
return (y,
|
|
3475
|
+
return (y, R) => (i(), d("div", {
|
|
3468
3476
|
class: u(m.value),
|
|
3469
3477
|
onMouseleave: z
|
|
3470
3478
|
}, [
|
|
@@ -3475,7 +3483,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3475
3483
|
key: H,
|
|
3476
3484
|
class: u(n(t).e("item")),
|
|
3477
3485
|
onMousemove: (O) => $(H, O),
|
|
3478
|
-
onClick: (O) =>
|
|
3486
|
+
onClick: (O) => E(H, O)
|
|
3479
3487
|
}, [
|
|
3480
3488
|
r("span", {
|
|
3481
3489
|
class: u(n(t).e("void")),
|
|
@@ -3547,7 +3555,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3547
3555
|
const x = l.value[v];
|
|
3548
3556
|
l.value[v] = l.value[v - 1], l.value[v - 1] = x, y(), e("sort", l.value), e("update:fields", l.value);
|
|
3549
3557
|
}
|
|
3550
|
-
},
|
|
3558
|
+
}, E = (h) => {
|
|
3551
3559
|
const v = l.value.findIndex((x) => x.id === h);
|
|
3552
3560
|
if (v < l.value.length - 1) {
|
|
3553
3561
|
const x = l.value[v];
|
|
@@ -3557,7 +3565,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3557
3565
|
l.value.forEach((h, v) => {
|
|
3558
3566
|
h.order = v;
|
|
3559
3567
|
});
|
|
3560
|
-
},
|
|
3568
|
+
}, R = (h) => {
|
|
3561
3569
|
c.value = { ...h };
|
|
3562
3570
|
}, H = () => {
|
|
3563
3571
|
if (c.value) {
|
|
@@ -3627,7 +3635,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3627
3635
|
key: 1,
|
|
3628
3636
|
class: "action-btn",
|
|
3629
3637
|
title: "下移",
|
|
3630
|
-
onClick: (A) =>
|
|
3638
|
+
onClick: (A) => E(x.id)
|
|
3631
3639
|
}, [
|
|
3632
3640
|
Q(n(ee), {
|
|
3633
3641
|
name: "move-down",
|
|
@@ -3637,7 +3645,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3637
3645
|
r("button", {
|
|
3638
3646
|
class: "action-btn",
|
|
3639
3647
|
title: "编辑",
|
|
3640
|
-
onClick: (A) =>
|
|
3648
|
+
onClick: (A) => R(x)
|
|
3641
3649
|
}, [
|
|
3642
3650
|
Q(n(ee), {
|
|
3643
3651
|
name: "edit",
|
|
@@ -3859,12 +3867,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3859
3867
|
}
|
|
3860
3868
|
})), z = (v) => {
|
|
3861
3869
|
m.value = v;
|
|
3862
|
-
},
|
|
3870
|
+
}, E = (v) => {
|
|
3863
3871
|
const x = v.getHtml();
|
|
3864
3872
|
b.value = x, t("update:modelValue", x), t("change", x);
|
|
3865
3873
|
}, y = (v) => {
|
|
3866
3874
|
t("focus", v);
|
|
3867
|
-
},
|
|
3875
|
+
}, R = (v) => {
|
|
3868
3876
|
t("blur", v);
|
|
3869
3877
|
};
|
|
3870
3878
|
return k({
|
|
@@ -3902,9 +3910,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3902
3910
|
style: te(S.value),
|
|
3903
3911
|
class: "x-rich-editor__content",
|
|
3904
3912
|
onOnCreated: z,
|
|
3905
|
-
onOnChange:
|
|
3913
|
+
onOnChange: E,
|
|
3906
3914
|
onOnFocus: y,
|
|
3907
|
-
onOnBlur:
|
|
3915
|
+
onOnBlur: R
|
|
3908
3916
|
}, null, 8, ["modelValue", "default-config", "mode", "style"])
|
|
3909
3917
|
], 64)) : (i(), d("div", {
|
|
3910
3918
|
key: 1,
|
|
@@ -3944,9 +3952,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3944
3952
|
return m.value.length === 0 ? "" : m.value.map((w) => y(w)).join(", ");
|
|
3945
3953
|
if (c.value.length === 0) return "";
|
|
3946
3954
|
if (a.showAllLevels)
|
|
3947
|
-
return c.value.map((w) =>
|
|
3955
|
+
return c.value.map((w) => R(w, c.value)).join(a.separator);
|
|
3948
3956
|
const p = c.value[c.value.length - 1];
|
|
3949
|
-
return
|
|
3957
|
+
return R(p, c.value);
|
|
3950
3958
|
}), z = V(() => {
|
|
3951
3959
|
var w;
|
|
3952
3960
|
const p = [a.options];
|
|
@@ -3961,7 +3969,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3961
3969
|
}
|
|
3962
3970
|
}
|
|
3963
3971
|
return p;
|
|
3964
|
-
}),
|
|
3972
|
+
}), E = V(() => {
|
|
3965
3973
|
if (!a.filterable || !b.value) return null;
|
|
3966
3974
|
const p = [], w = (C, o = []) => {
|
|
3967
3975
|
var f;
|
|
@@ -3974,7 +3982,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3974
3982
|
}
|
|
3975
3983
|
};
|
|
3976
3984
|
return w(a.options), p;
|
|
3977
|
-
}), y = (p) => p.map((w, C) =>
|
|
3985
|
+
}), y = (p) => p.map((w, C) => R(w, p.slice(0, C + 1))).join(a.separator), R = (p, w) => {
|
|
3978
3986
|
let C = a.options;
|
|
3979
3987
|
for (let f = 0; f < w.length - 1; f++) {
|
|
3980
3988
|
const g = C.find((X) => X.value === w[f]);
|
|
@@ -4001,7 +4009,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4001
4009
|
e("update:modelValue", p), e("change", p);
|
|
4002
4010
|
}, A = () => {
|
|
4003
4011
|
c.value = [], m.value = [], e("update:modelValue", S.value ? [] : ""), e("change", S.value ? [] : "");
|
|
4004
|
-
},
|
|
4012
|
+
}, I = (p) => {
|
|
4005
4013
|
b.value = p.target.value;
|
|
4006
4014
|
}, Y = (p) => {
|
|
4007
4015
|
c.value = p.map((w) => w.value), b.value = "", l.value = !1, v(c.value);
|
|
@@ -4026,7 +4034,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4026
4034
|
value: b.value,
|
|
4027
4035
|
placeholder: $.value || s.placeholder,
|
|
4028
4036
|
class: u(n(t).e("filter-input")),
|
|
4029
|
-
onInput:
|
|
4037
|
+
onInput: I
|
|
4030
4038
|
}, null, 42, Ia)) : (i(), d("span", {
|
|
4031
4039
|
key: 1,
|
|
4032
4040
|
class: u(n(t).e("text"))
|
|
@@ -4060,16 +4068,16 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4060
4068
|
oe(r("div", {
|
|
4061
4069
|
class: u(n(t).e("dropdown"))
|
|
4062
4070
|
}, [
|
|
4063
|
-
|
|
4071
|
+
E.value ? (i(), d("div", {
|
|
4064
4072
|
key: 0,
|
|
4065
4073
|
class: u(n(t).e("filter-list"))
|
|
4066
4074
|
}, [
|
|
4067
|
-
(i(!0), d(J, null, _(
|
|
4075
|
+
(i(!0), d(J, null, _(E.value, (C, o) => (i(), d("div", {
|
|
4068
4076
|
key: o,
|
|
4069
4077
|
class: u(n(t).e("filter-item")),
|
|
4070
4078
|
onClick: (f) => Y(C.path)
|
|
4071
4079
|
}, N(C.label), 11, Pa))), 128)),
|
|
4072
|
-
|
|
4080
|
+
E.value.length === 0 ? (i(), d("div", {
|
|
4073
4081
|
key: 0,
|
|
4074
4082
|
class: u(n(t).e("empty"))
|
|
4075
4083
|
}, " 无匹配数据 ", 2)) : U("", !0)
|
|
@@ -4139,16 +4147,16 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4139
4147
|
},
|
|
4140
4148
|
emits: ["update:modelValue", "change"],
|
|
4141
4149
|
setup(s, { emit: k }) {
|
|
4142
|
-
const a = s, e = k, t = ae("color-picker"), l = B(!1), c = B(0), m = B(100), b = B(100), T = B(100), S = B(), D = B(), $ = V(() => y(c.value, m.value, b.value)), z = V(() => a.showAlpha ? `${$.value}${Math.round(T.value * 2.55).toString(16).padStart(2, "0")}` : $.value),
|
|
4150
|
+
const a = s, e = k, t = ae("color-picker"), l = B(!1), c = B(0), m = B(100), b = B(100), T = B(100), S = B(), D = B(), $ = V(() => y(c.value, m.value, b.value)), z = V(() => a.showAlpha ? `${$.value}${Math.round(T.value * 2.55).toString(16).padStart(2, "0")}` : $.value), E = V(() => a.modelValue || $.value), y = (I, Y, G) => {
|
|
4143
4151
|
Y /= 100, G /= 100;
|
|
4144
|
-
const p = G * Y, w = p * (1 - Math.abs(
|
|
4152
|
+
const p = G * Y, w = p * (1 - Math.abs(I / 60 % 2 - 1)), C = G - p;
|
|
4145
4153
|
let o = 0, f = 0, g = 0;
|
|
4146
|
-
|
|
4154
|
+
I >= 0 && I < 60 ? (o = p, f = w, g = 0) : I >= 60 && I < 120 ? (o = w, f = p, g = 0) : I >= 120 && I < 180 ? (o = 0, f = p, g = w) : I >= 180 && I < 240 ? (o = 0, f = w, g = p) : I >= 240 && I < 300 ? (o = w, f = 0, g = p) : (o = p, f = 0, g = w);
|
|
4147
4155
|
const X = (ne) => Math.round((ne + C) * 255).toString(16).padStart(2, "0");
|
|
4148
4156
|
return `#${X(o)}${X(f)}${X(g)}`;
|
|
4149
|
-
},
|
|
4150
|
-
|
|
4151
|
-
const Y = parseInt(
|
|
4157
|
+
}, R = (I) => {
|
|
4158
|
+
I = I.replace("#", "");
|
|
4159
|
+
const Y = parseInt(I.slice(0, 2), 16) / 255, G = parseInt(I.slice(2, 4), 16) / 255, p = parseInt(I.slice(4, 6), 16) / 255, w = Math.max(Y, G, p), C = Math.min(Y, G, p), o = w - C;
|
|
4152
4160
|
let f = 0;
|
|
4153
4161
|
const g = w === 0 ? 0 : o / w, X = w;
|
|
4154
4162
|
if (o !== 0)
|
|
@@ -4164,37 +4172,37 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4164
4172
|
break;
|
|
4165
4173
|
}
|
|
4166
4174
|
return { h: f, s: g * 100, v: X * 100 };
|
|
4167
|
-
}, H = (
|
|
4175
|
+
}, H = (I) => {
|
|
4168
4176
|
if (!S.value) return;
|
|
4169
|
-
const Y = S.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (
|
|
4177
|
+
const Y = S.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (I.clientX - Y.left) / Y.width)), p = Math.max(0, Math.min(1, (I.clientY - Y.top) / Y.height));
|
|
4170
4178
|
m.value = Math.round(G * 100), b.value = Math.round((1 - p) * 100);
|
|
4171
|
-
}, O = (
|
|
4179
|
+
}, O = (I) => {
|
|
4172
4180
|
if (!D.value) return;
|
|
4173
|
-
const Y = D.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (
|
|
4181
|
+
const Y = D.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (I.clientX - Y.left) / Y.width));
|
|
4174
4182
|
c.value = Math.round(G * 360);
|
|
4175
|
-
}, M = (
|
|
4183
|
+
}, M = (I) => {
|
|
4176
4184
|
if (!D.value) return;
|
|
4177
|
-
const Y = D.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (
|
|
4185
|
+
const Y = D.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (I.clientX - Y.left) / Y.width));
|
|
4178
4186
|
T.value = Math.round(G * 100);
|
|
4179
|
-
}, h = (
|
|
4180
|
-
const Y =
|
|
4181
|
-
c.value = Y.h, m.value = Y.s, b.value = Y.v, e("update:modelValue",
|
|
4187
|
+
}, h = (I) => {
|
|
4188
|
+
const Y = R(I);
|
|
4189
|
+
c.value = Y.h, m.value = Y.s, b.value = Y.v, e("update:modelValue", I), e("change", I);
|
|
4182
4190
|
}, v = () => {
|
|
4183
4191
|
e("update:modelValue", z.value), e("change", z.value), l.value = !1;
|
|
4184
4192
|
}, x = () => {
|
|
4185
4193
|
e("update:modelValue", ""), e("change", ""), l.value = !1;
|
|
4186
|
-
}, A = (
|
|
4187
|
-
|
|
4194
|
+
}, A = (I) => {
|
|
4195
|
+
I.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
4188
4196
|
};
|
|
4189
|
-
return ie(l, (
|
|
4190
|
-
if (
|
|
4197
|
+
return ie(l, (I) => {
|
|
4198
|
+
if (I) {
|
|
4191
4199
|
if (document.addEventListener("click", A), a.modelValue) {
|
|
4192
|
-
const Y =
|
|
4200
|
+
const Y = R(a.modelValue.slice(0, 7));
|
|
4193
4201
|
c.value = Y.h, m.value = Y.s, b.value = Y.v, a.showAlpha && a.modelValue.length === 9 && (T.value = Math.round(parseInt(a.modelValue.slice(7, 9), 16) / 2.55));
|
|
4194
4202
|
}
|
|
4195
4203
|
} else
|
|
4196
4204
|
document.removeEventListener("click", A);
|
|
4197
|
-
}), (
|
|
4205
|
+
}), (I, Y) => (i(), d("div", {
|
|
4198
4206
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4199
4207
|
onClick: Y[1] || (Y[1] = ue(() => {
|
|
4200
4208
|
}, ["stop"]))
|
|
@@ -4205,9 +4213,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4205
4213
|
}, [
|
|
4206
4214
|
r("div", {
|
|
4207
4215
|
class: u(n(t).e("color")),
|
|
4208
|
-
style: te({ backgroundColor:
|
|
4216
|
+
style: te({ backgroundColor: E.value })
|
|
4209
4217
|
}, [
|
|
4210
|
-
|
|
4218
|
+
E.value ? U("", !0) : (i(), fe(n(ee), {
|
|
4211
4219
|
key: 0,
|
|
4212
4220
|
name: "close",
|
|
4213
4221
|
size: 12
|
|
@@ -4337,11 +4345,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4337
4345
|
c.value = h, e("update:modelValue", h), b.value = -1, D && clearTimeout(D), D = setTimeout(() => {
|
|
4338
4346
|
h || a.triggerOnFocus ? $(h) : l.value = !1;
|
|
4339
4347
|
}, a.debounce);
|
|
4340
|
-
},
|
|
4348
|
+
}, E = () => {
|
|
4341
4349
|
a.triggerOnFocus && c.value === "" && $("");
|
|
4342
4350
|
}, y = (M) => {
|
|
4343
4351
|
c.value = M[a.valueKey], e("update:modelValue", c.value), e("select", M), l.value = !1;
|
|
4344
|
-
},
|
|
4352
|
+
}, R = (M) => {
|
|
4345
4353
|
if (l.value)
|
|
4346
4354
|
switch (M.key) {
|
|
4347
4355
|
case "ArrowDown":
|
|
@@ -4386,8 +4394,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4386
4394
|
disabled: s.disabled,
|
|
4387
4395
|
class: u(n(t).e("inner")),
|
|
4388
4396
|
onInput: z,
|
|
4389
|
-
onFocus:
|
|
4390
|
-
onKeydown:
|
|
4397
|
+
onFocus: E,
|
|
4398
|
+
onKeydown: R
|
|
4391
4399
|
}, null, 42, Na),
|
|
4392
4400
|
s.clearable && c.value ? (i(), d("span", {
|
|
4393
4401
|
key: 0,
|
|
@@ -4476,7 +4484,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4476
4484
|
n(t).is("selected", z === m.value),
|
|
4477
4485
|
n(t).is("disabled", $.disabled)
|
|
4478
4486
|
]),
|
|
4479
|
-
onClick: (
|
|
4487
|
+
onClick: (E) => T($)
|
|
4480
4488
|
}, [
|
|
4481
4489
|
se(S.$slots, "default", { option: $ }, () => [
|
|
4482
4490
|
de(N($.label), 1)
|
|
@@ -4501,7 +4509,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4501
4509
|
setup(s, { emit: k }) {
|
|
4502
4510
|
const a = s, e = k, t = ae("mention"), l = B(a.modelValue), c = B(!1), m = B([]), b = B(-1), T = B(), S = B(), D = B(0), $ = B(-1), z = (M) => {
|
|
4503
4511
|
m.value = a.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(M.toLowerCase())), c.value = m.value.length > 0, b.value = -1;
|
|
4504
|
-
},
|
|
4512
|
+
}, E = (M) => {
|
|
4505
4513
|
const h = M.target;
|
|
4506
4514
|
l.value = h.value, D.value = h.selectionStart || 0;
|
|
4507
4515
|
const v = l.value.slice(0, D.value), x = v.lastIndexOf(a.prefix);
|
|
@@ -4517,7 +4525,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4517
4525
|
const A = h.length + x.length;
|
|
4518
4526
|
T.value && (T.value.setSelectionRange(A, A), T.value.focus()), S.value && (S.value.setSelectionRange(A, A), S.value.focus());
|
|
4519
4527
|
});
|
|
4520
|
-
},
|
|
4528
|
+
}, R = (M) => {
|
|
4521
4529
|
if (c.value)
|
|
4522
4530
|
switch (M.key) {
|
|
4523
4531
|
case "ArrowDown":
|
|
@@ -4560,8 +4568,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4560
4568
|
placeholder: s.placeholder,
|
|
4561
4569
|
disabled: s.disabled,
|
|
4562
4570
|
class: u(n(t).e("inner")),
|
|
4563
|
-
onInput:
|
|
4564
|
-
onKeydown:
|
|
4571
|
+
onInput: E,
|
|
4572
|
+
onKeydown: R
|
|
4565
4573
|
}, null, 42, Ka),
|
|
4566
4574
|
s.clearable && l.value ? (i(), d("span", {
|
|
4567
4575
|
key: 0,
|