@xto/form 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +114 -114
- package/lib/index.cjs +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -282,8 +282,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
284
|
([F, B]) => {
|
|
285
|
-
const
|
|
286
|
-
|
|
285
|
+
const E = F ?? B ?? "";
|
|
286
|
+
E !== C.value && (C.value = E);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
@@ -334,7 +334,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
334
334
|
ue(d("input", {
|
|
335
335
|
ref_key: "inputRef",
|
|
336
336
|
ref: f,
|
|
337
|
-
"onUpdate:modelValue": B[0] || (B[0] = (
|
|
337
|
+
"onUpdate:modelValue": B[0] || (B[0] = (E) => C.value = E),
|
|
338
338
|
type: T.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
@@ -342,7 +342,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
342
342
|
maxlength: s.maxlength,
|
|
343
343
|
minlength: s.minlength,
|
|
344
344
|
class: u(n(t).e("inner")),
|
|
345
|
-
onInput: B[1] || (B[1] = (
|
|
345
|
+
onInput: B[1] || (B[1] = (E) => z(E.target.value)),
|
|
346
346
|
onChange: H,
|
|
347
347
|
onFocus: L,
|
|
348
348
|
onBlur: A
|
|
@@ -473,7 +473,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
473
473
|
}
|
|
474
474
|
a("blur", o);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function E(o) {
|
|
477
477
|
m.value = !0, S.value = e.modelValue, a("focus", o);
|
|
478
478
|
}
|
|
479
479
|
function j(o) {
|
|
@@ -533,7 +533,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
533
533
|
type: "text",
|
|
534
534
|
autocomplete: "off",
|
|
535
535
|
onInput: F,
|
|
536
|
-
onFocus:
|
|
536
|
+
onFocus: E,
|
|
537
537
|
onBlur: B,
|
|
538
538
|
onKeydown: j
|
|
539
539
|
}, null, 42, ll)
|
|
@@ -1188,8 +1188,8 @@ const pl = [
|
|
|
1188
1188
|
if (F && r) {
|
|
1189
1189
|
const B = t.value;
|
|
1190
1190
|
if (B) {
|
|
1191
|
-
const
|
|
1192
|
-
return Ye(h,
|
|
1191
|
+
const E = r < B ? r : B, j = r < B ? B : r;
|
|
1192
|
+
return Ye(h, E, j);
|
|
1193
1193
|
}
|
|
1194
1194
|
return pe(h, r);
|
|
1195
1195
|
}
|
|
@@ -1238,8 +1238,8 @@ const pl = [
|
|
|
1238
1238
|
]),
|
|
1239
1239
|
d("tbody", null, [
|
|
1240
1240
|
(i(!0), c(J, null, Q(y.value, ($, F) => (i(), c("tr", { key: F }, [
|
|
1241
|
-
(i(!0), c(J, null, Q($, (B,
|
|
1242
|
-
key:
|
|
1241
|
+
(i(!0), c(J, null, Q($, (B, E) => (i(), c("td", {
|
|
1242
|
+
key: E,
|
|
1243
1243
|
class: u(H(B)),
|
|
1244
1244
|
onClick: (j) => L(B),
|
|
1245
1245
|
onMouseenter: (j) => A(B),
|
|
@@ -1435,7 +1435,7 @@ const pl = [
|
|
|
1435
1435
|
}), F = M(() => {
|
|
1436
1436
|
const I = S();
|
|
1437
1437
|
return !I || Array.isArray(I) ? null : I instanceof Date ? I : fe(I);
|
|
1438
|
-
}), B = M(() => H.value.getFullYear()),
|
|
1438
|
+
}), B = M(() => H.value.getFullYear()), E = M(() => H.value.getMonth()), j = M(() => Ne(B.value)), p = M(() => b.value === "year" ? `${j.value[0]} 年 - ${j.value[1]} 年` : b.value === "month" ? `${B.value} 年` : `${B.value} 年 ${E.value + 1} 月`), w = M(() => [
|
|
1439
1439
|
t.b(),
|
|
1440
1440
|
t.m(e.size),
|
|
1441
1441
|
t.is("disabled", e.disabled),
|
|
@@ -1496,7 +1496,7 @@ const pl = [
|
|
|
1496
1496
|
} else
|
|
1497
1497
|
b.value = "date";
|
|
1498
1498
|
}, q = (I) => {
|
|
1499
|
-
if (H.value = new Date(I,
|
|
1499
|
+
if (H.value = new Date(I, E.value, 1), e.type === "year") {
|
|
1500
1500
|
const Y = new Date(I, 0, 1), W = e.valueFormat ? ve(Y, e.valueFormat) : Y;
|
|
1501
1501
|
D(W), g();
|
|
1502
1502
|
} else
|
|
@@ -1506,12 +1506,12 @@ const pl = [
|
|
|
1506
1506
|
}, ye = () => {
|
|
1507
1507
|
H.value = vl(H.value);
|
|
1508
1508
|
}, xe = () => {
|
|
1509
|
-
b.value === "year" ? H.value = new Date(B.value - 10,
|
|
1509
|
+
b.value === "year" ? H.value = new Date(B.value - 10, E.value, 1) : H.value = fl(H.value);
|
|
1510
1510
|
}, ze = () => {
|
|
1511
|
-
b.value === "year" ? H.value = new Date(B.value + 10,
|
|
1511
|
+
b.value === "year" ? H.value = new Date(B.value + 10, E.value, 1) : H.value = ml(H.value);
|
|
1512
1512
|
}, Te = () => {
|
|
1513
1513
|
b.value = "month";
|
|
1514
|
-
},
|
|
1514
|
+
}, O = () => {
|
|
1515
1515
|
b.value = "year";
|
|
1516
1516
|
}, G = () => {
|
|
1517
1517
|
D(null), a("clear"), A.value = {
|
|
@@ -1670,11 +1670,11 @@ const pl = [
|
|
|
1670
1670
|
key: 0,
|
|
1671
1671
|
onClick: Y[1] || (Y[1] = (W) => b.value = "month")
|
|
1672
1672
|
}, U(p.value), 1)) : (i(), c(J, { key: 1 }, [
|
|
1673
|
-
d("span", { onClick:
|
|
1673
|
+
d("span", { onClick: O }, U(B.value) + " 年", 1),
|
|
1674
1674
|
b.value === "date" ? (i(), c("span", {
|
|
1675
1675
|
key: 0,
|
|
1676
1676
|
onClick: Te
|
|
1677
|
-
}, U(
|
|
1677
|
+
}, U(E.value + 1) + " 月", 1)) : X("", !0)
|
|
1678
1678
|
], 64))
|
|
1679
1679
|
], 2),
|
|
1680
1680
|
d("button", {
|
|
@@ -1854,12 +1854,12 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1854
1854
|
K.push(q);
|
|
1855
1855
|
return K;
|
|
1856
1856
|
}), b = M(() => l.disabledHours ? new Set(l.disabledHours()) : /* @__PURE__ */ new Set()), H = M(() => l.disabledMinutes ? new Set(l.disabledMinutes(t.value)) : /* @__PURE__ */ new Set()), L = M(() => l.disabledSeconds ? new Set(l.disabledSeconds(t.value, f.value)) : /* @__PURE__ */ new Set()), A = M(() => `${Me(t.value)}:${Me(f.value)}${T.value ? ":" + Me(m.value) : ""}`), V = (K) => b.value.has(K), h = (K) => H.value.has(K), r = (K) => L.value.has(K), $ = (K) => {
|
|
1857
|
-
V(K) || (t.value = K, w(y.value,
|
|
1857
|
+
V(K) || (t.value = K, w(y.value, E(K)));
|
|
1858
1858
|
}, F = (K) => {
|
|
1859
1859
|
h(K) || (f.value = K, w(S.value, j(K)));
|
|
1860
1860
|
}, B = (K) => {
|
|
1861
1861
|
r(K) || (m.value = K, w(D.value, p(K)));
|
|
1862
|
-
},
|
|
1862
|
+
}, E = (K) => C.value.indexOf(K), j = (K) => z.value.indexOf(K), p = (K) => P.value.indexOf(K), w = (K, re) => {
|
|
1863
1863
|
if (!K) return;
|
|
1864
1864
|
const q = 32, ye = re * q + 84 - 200 / 2 + q / 2;
|
|
1865
1865
|
K.scrollTop = Math.max(0, ye);
|
|
@@ -1888,7 +1888,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1888
1888
|
t.value = K.getHours(), f.value = K.getMinutes(), m.value = K.getSeconds();
|
|
1889
1889
|
}
|
|
1890
1890
|
De(() => {
|
|
1891
|
-
w(y.value,
|
|
1891
|
+
w(y.value, E(t.value)), w(S.value, j(f.value)), T.value && w(D.value, p(m.value));
|
|
1892
1892
|
});
|
|
1893
1893
|
};
|
|
1894
1894
|
return ie(
|
|
@@ -2039,7 +2039,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2039
2039
|
t.e("input"),
|
|
2040
2040
|
t.is("focus", m.value)
|
|
2041
2041
|
]), $ = () => {
|
|
2042
|
-
e.disabled || e.readonly || (m.value ?
|
|
2042
|
+
e.disabled || e.readonly || (m.value ? E() : B());
|
|
2043
2043
|
}, F = (v) => {
|
|
2044
2044
|
e.disabled || e.readonly || (P.value = v, m.value || B());
|
|
2045
2045
|
}, B = () => {
|
|
@@ -2053,7 +2053,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2053
2053
|
};
|
|
2054
2054
|
}
|
|
2055
2055
|
}), a("focus", {});
|
|
2056
|
-
},
|
|
2056
|
+
}, E = () => {
|
|
2057
2057
|
m.value = !1, a("blur", {});
|
|
2058
2058
|
}, j = (v) => {
|
|
2059
2059
|
if (e.type === "timerange")
|
|
@@ -2062,14 +2062,14 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2062
2062
|
else {
|
|
2063
2063
|
z.value.startTime && v < z.value.startTime ? (z.value.endTime = z.value.startTime, z.value.startTime = v) : z.value.endTime = v;
|
|
2064
2064
|
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime, N = e.valueFormat ? ke(z.value.endTime, e.valueFormat) : z.value.endTime;
|
|
2065
|
-
a("update:modelValue", [g, N]), a("change", [g, N]),
|
|
2065
|
+
a("update:modelValue", [g, N]), a("change", [g, N]), E();
|
|
2066
2066
|
}
|
|
2067
2067
|
else {
|
|
2068
2068
|
const g = e.valueFormat ? ke(v, e.valueFormat) : v;
|
|
2069
|
-
a("update:modelValue", g), a("change", g),
|
|
2069
|
+
a("update:modelValue", g), a("change", g), E();
|
|
2070
2070
|
}
|
|
2071
2071
|
}, p = () => {
|
|
2072
|
-
|
|
2072
|
+
E();
|
|
2073
2073
|
}, w = () => {
|
|
2074
2074
|
a("update:modelValue", null), a("change", null), a("clear"), z.value = {
|
|
2075
2075
|
startTime: null,
|
|
@@ -2078,7 +2078,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2078
2078
|
}, x = (v) => {
|
|
2079
2079
|
if (!S.value) return;
|
|
2080
2080
|
const g = v.target;
|
|
2081
|
-
S.value.contains(g) || D.value && D.value.contains(g) ||
|
|
2081
|
+
S.value.contains(g) || D.value && D.value.contains(g) || E();
|
|
2082
2082
|
};
|
|
2083
2083
|
ie(
|
|
2084
2084
|
() => e.modelValue,
|
|
@@ -2099,7 +2099,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2099
2099
|
}, P.value = "start");
|
|
2100
2100
|
});
|
|
2101
2101
|
const o = (v) => {
|
|
2102
|
-
v.key === "Escape" &&
|
|
2102
|
+
v.key === "Escape" && E();
|
|
2103
2103
|
};
|
|
2104
2104
|
return ge(() => {
|
|
2105
2105
|
document.addEventListener("click", x), document.addEventListener("keydown", o);
|
|
@@ -2305,34 +2305,34 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2305
2305
|
},
|
|
2306
2306
|
emits: ["update:modelValue", "update:value", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
|
|
2307
2307
|
setup(s, { emit: k }) {
|
|
2308
|
-
const l = s, e = k, a = ae("select"), t = Ae(), f = () => Oe().next(), m = R(), y = R(), S = R(), D = R(!1), T = R(2e3), C = R(""), z = R(-1), P = R({ top: "0px", left: "0px" }), b = R([]), H = (
|
|
2309
|
-
b.value.find((G) => G.value ===
|
|
2310
|
-
}, L = M(() => l.type === "multiple" || l.mode === "multiple"), A = M(() => l.type === "cascader"), V = R([]), h = M(() => l.options && l.options.length > 0 ? l.options : b.value), r = (
|
|
2311
|
-
l.modelValue !== void 0 && e("update:modelValue",
|
|
2308
|
+
const l = s, e = k, a = ae("select"), t = Ae(), f = () => Oe().next(), m = R(), y = R(), S = R(), D = R(!1), T = R(2e3), C = R(""), z = R(-1), P = R({ top: "0px", left: "0px" }), b = R([]), H = (O) => {
|
|
2309
|
+
b.value.find((G) => G.value === O.value) || b.value.push(O);
|
|
2310
|
+
}, L = M(() => l.type === "multiple" || l.mode === "multiple"), A = M(() => l.type === "cascader"), V = R([]), h = M(() => l.options && l.options.length > 0 ? l.options : b.value), r = (O) => {
|
|
2311
|
+
l.modelValue !== void 0 && e("update:modelValue", O), l.value !== void 0 && e("update:value", O), l.modelValue === void 0 && l.value === void 0 && e("update:modelValue", O), e("change", O);
|
|
2312
2312
|
}, $ = M(() => {
|
|
2313
|
-
const
|
|
2314
|
-
return L.value ? Array.isArray(
|
|
2313
|
+
const O = l.modelValue !== void 0 ? l.modelValue : l.value !== void 0 ? l.value : "";
|
|
2314
|
+
return L.value ? Array.isArray(O) ? O : [] : A.value ? Array.isArray(O) ? O : O ? [O] : [] : O !== "" && O !== null && O !== void 0 ? [O] : [];
|
|
2315
2315
|
}), F = M(() => {
|
|
2316
|
-
const
|
|
2317
|
-
return A.value ? Pl(
|
|
2318
|
-
}), B = M(() => !l.filterable || !C.value ? F.value : F.value.filter((
|
|
2319
|
-
const G =
|
|
2316
|
+
const O = h.value;
|
|
2317
|
+
return A.value ? Pl(O, l.childrenKey) : O.map((G) => ({ ...G, level: 0 }));
|
|
2318
|
+
}), B = M(() => !l.filterable || !C.value ? F.value : F.value.filter((O) => {
|
|
2319
|
+
const G = O[l.labelKey] || "";
|
|
2320
2320
|
return Il(G, C.value, l.filterMethod);
|
|
2321
|
-
})),
|
|
2322
|
-
const
|
|
2321
|
+
})), E = M(() => {
|
|
2322
|
+
const O = [];
|
|
2323
2323
|
for (const G of $.value) {
|
|
2324
2324
|
const _ = Xe(h.value, G, l.valueKey, l.childrenKey);
|
|
2325
|
-
_ &&
|
|
2325
|
+
_ && O.push(_);
|
|
2326
2326
|
}
|
|
2327
|
-
return
|
|
2327
|
+
return O;
|
|
2328
2328
|
}), j = M(() => {
|
|
2329
2329
|
if (L.value)
|
|
2330
2330
|
return "";
|
|
2331
2331
|
if (A.value)
|
|
2332
2332
|
return Be(h.value, $.value[$.value.length - 1], l.valueKey, l.childrenKey).map((_) => _[l.labelKey]).join(l.separator);
|
|
2333
|
-
const
|
|
2334
|
-
return
|
|
2335
|
-
}), p = M(() => L.value ?
|
|
2333
|
+
const O = E.value[0];
|
|
2334
|
+
return O ? O[l.labelKey] : "";
|
|
2335
|
+
}), p = M(() => L.value ? E.value : []), w = M(() => l.collapseTags ? p.value.slice(0, l.maxCollapseTags) : p.value), x = M(() => l.collapseTags ? Math.max(0, p.value.length - l.maxCollapseTags) : 0), o = M(() => [
|
|
2336
2336
|
a.b(),
|
|
2337
2337
|
a.m(l.size),
|
|
2338
2338
|
a.is("disabled", l.disabled),
|
|
@@ -2342,9 +2342,9 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2342
2342
|
a.is("focus", D.value)
|
|
2343
2343
|
]), v = () => {
|
|
2344
2344
|
if (!m.value || !S.value || !D.value) return;
|
|
2345
|
-
const
|
|
2346
|
-
let _ =
|
|
2347
|
-
de + G.width > window.innerWidth && (de = window.innerWidth - G.width - 8), _ + G.height > window.innerHeight && (_ =
|
|
2345
|
+
const O = m.value.getBoundingClientRect(), G = S.value.getBoundingClientRect();
|
|
2346
|
+
let _ = O.bottom + 4, de = O.left;
|
|
2347
|
+
de + G.width > window.innerWidth && (de = window.innerWidth - G.width - 8), _ + G.height > window.innerHeight && (_ = O.top - G.height - 4), P.value = {
|
|
2348
2348
|
top: `${_}px`,
|
|
2349
2349
|
left: `${de}px`
|
|
2350
2350
|
};
|
|
@@ -2354,10 +2354,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2354
2354
|
}), e("visible-change", !0), e("focus", {}));
|
|
2355
2355
|
}, N = () => {
|
|
2356
2356
|
D.value = !1, C.value = "", V.value = [], e("visible-change", !1), e("blur", {});
|
|
2357
|
-
}, ne = (
|
|
2358
|
-
if (!
|
|
2357
|
+
}, ne = (O) => {
|
|
2358
|
+
if (!O.disabled)
|
|
2359
2359
|
if (L.value) {
|
|
2360
|
-
const G = [...$.value], _ =
|
|
2360
|
+
const G = [...$.value], _ = O[l.valueKey], de = G.indexOf(_);
|
|
2361
2361
|
if (de > -1)
|
|
2362
2362
|
G.splice(de, 1), e("remove-tag", _);
|
|
2363
2363
|
else {
|
|
@@ -2367,59 +2367,59 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2367
2367
|
}
|
|
2368
2368
|
r(G);
|
|
2369
2369
|
} else if (A.value)
|
|
2370
|
-
if (
|
|
2371
|
-
const G = Be(h.value,
|
|
2370
|
+
if (O.children && O.children.length > 0) {
|
|
2371
|
+
const G = Be(h.value, O[l.valueKey], l.valueKey, l.childrenKey);
|
|
2372
2372
|
V.value = G;
|
|
2373
2373
|
} else {
|
|
2374
|
-
const _ = Be(h.value,
|
|
2374
|
+
const _ = Be(h.value, O[l.valueKey], l.valueKey, l.childrenKey).map((de) => de[l.valueKey]);
|
|
2375
2375
|
r(_), N();
|
|
2376
2376
|
}
|
|
2377
2377
|
else
|
|
2378
|
-
r(
|
|
2379
|
-
}, K = (
|
|
2380
|
-
const G = $.value.filter((_) => _ !==
|
|
2381
|
-
r(G), e("remove-tag",
|
|
2378
|
+
r(O[l.valueKey]), N();
|
|
2379
|
+
}, K = (O) => {
|
|
2380
|
+
const G = $.value.filter((_) => _ !== O[l.valueKey]);
|
|
2381
|
+
r(G), e("remove-tag", O[l.valueKey]);
|
|
2382
2382
|
}, re = () => {
|
|
2383
|
-
const
|
|
2384
|
-
r(
|
|
2385
|
-
}, q = (
|
|
2386
|
-
C.value =
|
|
2387
|
-
}, me = (
|
|
2383
|
+
const O = L.value ? [] : "";
|
|
2384
|
+
r(O), e("clear");
|
|
2385
|
+
}, q = (O) => {
|
|
2386
|
+
C.value = O.target.value;
|
|
2387
|
+
}, me = (O) => {
|
|
2388
2388
|
if (!m.value) return;
|
|
2389
|
-
const G =
|
|
2389
|
+
const G = O.target;
|
|
2390
2390
|
m.value.contains(G) || S.value && S.value.contains(G) || N();
|
|
2391
|
-
}, ye = (
|
|
2392
|
-
if (
|
|
2391
|
+
}, ye = (O) => {
|
|
2392
|
+
if (O.key === "Escape")
|
|
2393
2393
|
N();
|
|
2394
|
-
else if (
|
|
2394
|
+
else if (O.key === "Enter" && D.value) {
|
|
2395
2395
|
const G = B.value[z.value];
|
|
2396
2396
|
G && ne(G);
|
|
2397
|
-
} else
|
|
2398
|
-
}, xe = (
|
|
2397
|
+
} else O.key === "ArrowDown" && D.value ? (O.preventDefault(), z.value = Math.min(z.value + 1, B.value.length - 1)) : O.key === "ArrowUp" && D.value && (O.preventDefault(), z.value = Math.max(z.value - 1, 0));
|
|
2398
|
+
}, xe = (O) => $.value.includes(O[l.valueKey]), ze = (O, G) => [
|
|
2399
2399
|
a.e("option"),
|
|
2400
|
-
a.is("selected", xe(
|
|
2401
|
-
a.is("disabled",
|
|
2400
|
+
a.is("selected", xe(O)),
|
|
2401
|
+
a.is("disabled", O.disabled === !0),
|
|
2402
2402
|
a.is("hover", z.value === G),
|
|
2403
|
-
a.is("group", !!(
|
|
2403
|
+
a.is("group", !!(O.children && O.children.length > 0))
|
|
2404
2404
|
], Te = M(() => {
|
|
2405
2405
|
if (!A.value) return [];
|
|
2406
|
-
const
|
|
2406
|
+
const O = [h.value];
|
|
2407
2407
|
for (const G of V.value)
|
|
2408
|
-
G.children && G.children.length > 0 &&
|
|
2409
|
-
return
|
|
2408
|
+
G.children && G.children.length > 0 && O.push(G.children);
|
|
2409
|
+
return O;
|
|
2410
2410
|
});
|
|
2411
2411
|
return ge(() => {
|
|
2412
2412
|
document.addEventListener("click", me), document.addEventListener("keydown", ye);
|
|
2413
2413
|
}), $e(() => {
|
|
2414
2414
|
document.removeEventListener("click", me), document.removeEventListener("keydown", ye), document.removeEventListener("scroll", v, !0);
|
|
2415
|
-
}), ie(D, (
|
|
2416
|
-
|
|
2415
|
+
}), ie(D, (O) => {
|
|
2416
|
+
O ? document.addEventListener("scroll", v, !0) : document.removeEventListener("scroll", v, !0);
|
|
2417
2417
|
}), Se("select", {
|
|
2418
2418
|
selectedValues: $,
|
|
2419
2419
|
handleSelect: ne,
|
|
2420
2420
|
isSelected: xe,
|
|
2421
2421
|
registerOption: H
|
|
2422
|
-
}), (
|
|
2422
|
+
}), (O, G) => (i(), c("div", {
|
|
2423
2423
|
ref_key: "selectRef",
|
|
2424
2424
|
ref: m,
|
|
2425
2425
|
class: u(o.value)
|
|
@@ -2513,11 +2513,11 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2513
2513
|
key: 0,
|
|
2514
2514
|
class: u(n(a).e("empty"))
|
|
2515
2515
|
}, U(C.value ? s.noMatchText : s.noDataText), 3)) : (i(), c(J, { key: 1 }, [
|
|
2516
|
-
|
|
2516
|
+
O.$slots.default ? (i(), c("div", {
|
|
2517
2517
|
key: 0,
|
|
2518
2518
|
class: u(n(a).e("options"))
|
|
2519
2519
|
}, [
|
|
2520
|
-
se(
|
|
2520
|
+
se(O.$slots, "default")
|
|
2521
2521
|
], 2)) : (i(), c("div", {
|
|
2522
2522
|
key: 1,
|
|
2523
2523
|
class: u(n(a).e("options"))
|
|
@@ -2556,33 +2556,33 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2556
2556
|
disabled: { type: Boolean, default: !1 }
|
|
2557
2557
|
},
|
|
2558
2558
|
setup(s) {
|
|
2559
|
-
const k = s, l = ae("select"), e = Ce("select");
|
|
2559
|
+
const k = s, l = ae("select"), e = Ce("select"), a = R(!1);
|
|
2560
2560
|
ge(() => {
|
|
2561
|
-
e && e.registerOption && e.registerOption({
|
|
2561
|
+
e && (a.value = !0, e.registerOption && e.registerOption({
|
|
2562
2562
|
value: k.value,
|
|
2563
2563
|
label: k.label,
|
|
2564
2564
|
disabled: k.disabled
|
|
2565
|
-
});
|
|
2565
|
+
}));
|
|
2566
2566
|
});
|
|
2567
|
-
const
|
|
2568
|
-
k.disabled
|
|
2567
|
+
const t = M(() => !e || !e.selectedValues ? !1 : e.selectedValues.value.includes(k.value)), f = (m) => {
|
|
2568
|
+
m.stopPropagation(), !k.disabled && e && e.handleSelect && e.handleSelect({
|
|
2569
2569
|
value: k.value,
|
|
2570
2570
|
label: k.label,
|
|
2571
2571
|
disabled: k.disabled
|
|
2572
2572
|
});
|
|
2573
2573
|
};
|
|
2574
|
-
return (
|
|
2574
|
+
return (m, y) => (i(), c("div", {
|
|
2575
2575
|
class: u([
|
|
2576
2576
|
n(l).e("option"),
|
|
2577
|
-
n(l).is("selected",
|
|
2577
|
+
n(l).is("selected", t.value),
|
|
2578
2578
|
n(l).is("disabled", s.disabled)
|
|
2579
2579
|
]),
|
|
2580
|
-
onClick:
|
|
2580
|
+
onClick: f
|
|
2581
2581
|
}, [
|
|
2582
2582
|
d("span", {
|
|
2583
2583
|
class: u(n(l).e("option-label"))
|
|
2584
2584
|
}, U(s.label), 3),
|
|
2585
|
-
|
|
2585
|
+
t.value ? (i(), c("span", {
|
|
2586
2586
|
key: 0,
|
|
2587
2587
|
class: u(n(l).e("option-check"))
|
|
2588
2588
|
}, "✓", 2)) : X("", !0)
|
|
@@ -2641,7 +2641,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2641
2641
|
}, B = (o) => {
|
|
2642
2642
|
const v = T.value.indexOf(o);
|
|
2643
2643
|
v > -1 ? T.value.splice(v, 1) : T.value.push(o), a("left-check-change", [...T.value]);
|
|
2644
|
-
},
|
|
2644
|
+
}, E = (o) => {
|
|
2645
2645
|
const v = C.value.indexOf(o);
|
|
2646
2646
|
v > -1 ? C.value.splice(v, 1) : C.value.push(o), a("right-check-change", [...C.value]);
|
|
2647
2647
|
}, j = () => {
|
|
@@ -2792,7 +2792,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2792
2792
|
n(t).is("disabled", b(g)),
|
|
2793
2793
|
n(t).is("checked", C.value.includes(z(g)))
|
|
2794
2794
|
]),
|
|
2795
|
-
onClick: (N) => !b(g) &&
|
|
2795
|
+
onClick: (N) => !b(g) && E(z(g))
|
|
2796
2796
|
}, [
|
|
2797
2797
|
d("label", {
|
|
2798
2798
|
class: u(n(t).e("checkbox"))
|
|
@@ -2803,7 +2803,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2803
2803
|
disabled: b(g),
|
|
2804
2804
|
onClick: v[5] || (v[5] = oe(() => {
|
|
2805
2805
|
}, ["stop"])),
|
|
2806
|
-
onChange: (N) =>
|
|
2806
|
+
onChange: (N) => E(z(g))
|
|
2807
2807
|
}, null, 40, Ql),
|
|
2808
2808
|
d("span", null, U(P(g)), 1)
|
|
2809
2809
|
], 2)
|
|
@@ -2898,10 +2898,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2898
2898
|
a.b(),
|
|
2899
2899
|
a.is("disabled", l.disabled),
|
|
2900
2900
|
a.is("vertical", l.vertical)
|
|
2901
|
-
]),
|
|
2901
|
+
]), E = M(() => l.vertical && l.height ? { height: typeof l.height == "number" ? `${l.height}px` : l.height } : {}), j = M(() => l.vertical ? { height: `${S.value}%` } : { width: `${S.value}%` }), p = M(() => l.vertical ? { bottom: `${S.value}%` } : { left: `${S.value}%` });
|
|
2902
2902
|
return (w, x) => (i(), c("div", {
|
|
2903
2903
|
class: u(B.value),
|
|
2904
|
-
style: te(
|
|
2904
|
+
style: te(E.value)
|
|
2905
2905
|
}, [
|
|
2906
2906
|
d("div", {
|
|
2907
2907
|
ref_key: "sliderRef",
|
|
@@ -3115,7 +3115,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3115
3115
|
p.preventDefault(), !e.disabled && e.drag && (y.value = !0);
|
|
3116
3116
|
}, B = () => {
|
|
3117
3117
|
y.value = !1;
|
|
3118
|
-
},
|
|
3118
|
+
}, E = (p) => {
|
|
3119
3119
|
var x;
|
|
3120
3120
|
if (p.preventDefault(), y.value = !1, e.disabled) return;
|
|
3121
3121
|
const w = (x = p.dataTransfer) == null ? void 0 : x.files;
|
|
@@ -3141,7 +3141,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3141
3141
|
onClick: $,
|
|
3142
3142
|
onDragover: F,
|
|
3143
3143
|
onDragleave: B,
|
|
3144
|
-
onDrop:
|
|
3144
|
+
onDrop: E
|
|
3145
3145
|
}, [
|
|
3146
3146
|
se(p.$slots, "drag", {}, () => [
|
|
3147
3147
|
d("span", {
|
|
@@ -3958,7 +3958,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3958
3958
|
f.value = [], m.value = [], e("update:modelValue", D.value ? [] : ""), e("change", D.value ? [] : "");
|
|
3959
3959
|
}, B = (p) => {
|
|
3960
3960
|
y.value = p.target.value;
|
|
3961
|
-
},
|
|
3961
|
+
}, E = (p) => {
|
|
3962
3962
|
f.value = p.map((w) => w.value), y.value = "", t.value = !1, r(f.value);
|
|
3963
3963
|
}, j = (p) => {
|
|
3964
3964
|
p.target.closest(`.${a.b()}`) || (t.value = !1);
|
|
@@ -4022,7 +4022,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4022
4022
|
(i(!0), c(J, null, Q(P.value, (x, o) => (i(), c("div", {
|
|
4023
4023
|
key: o,
|
|
4024
4024
|
class: u(n(a).e("filter-item")),
|
|
4025
|
-
onClick: (v) =>
|
|
4025
|
+
onClick: (v) => E(x.path)
|
|
4026
4026
|
}, U(x.label), 11, Fa))), 128)),
|
|
4027
4027
|
P.value.length === 0 ? (i(), c("div", {
|
|
4028
4028
|
key: 0,
|
|
@@ -4094,46 +4094,46 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4094
4094
|
},
|
|
4095
4095
|
emits: ["update:modelValue", "change"],
|
|
4096
4096
|
setup(s, { emit: k }) {
|
|
4097
|
-
const l = s, e = k, a = ae("color-picker"), t = R(!1), f = R(0), m = R(100), y = R(100), S = R(100), D = R(), T = R(), C = M(() => b(f.value, m.value, y.value)), z = M(() => l.showAlpha ? `${C.value}${Math.round(S.value * 2.55).toString(16).padStart(2, "0")}` : C.value), P = M(() => l.modelValue || C.value), b = (B,
|
|
4098
|
-
|
|
4099
|
-
const p = j *
|
|
4097
|
+
const l = s, e = k, a = ae("color-picker"), t = R(!1), f = R(0), m = R(100), y = R(100), S = R(100), D = R(), T = R(), C = M(() => b(f.value, m.value, y.value)), z = M(() => l.showAlpha ? `${C.value}${Math.round(S.value * 2.55).toString(16).padStart(2, "0")}` : C.value), P = M(() => l.modelValue || C.value), b = (B, E, j) => {
|
|
4098
|
+
E /= 100, j /= 100;
|
|
4099
|
+
const p = j * E, w = p * (1 - Math.abs(B / 60 % 2 - 1)), x = j - p;
|
|
4100
4100
|
let o = 0, v = 0, g = 0;
|
|
4101
4101
|
B >= 0 && B < 60 ? (o = p, v = w, g = 0) : B >= 60 && B < 120 ? (o = w, v = p, g = 0) : B >= 120 && B < 180 ? (o = 0, v = p, g = w) : B >= 180 && B < 240 ? (o = 0, v = w, g = p) : B >= 240 && B < 300 ? (o = w, v = 0, g = p) : (o = p, v = 0, g = w);
|
|
4102
4102
|
const N = (ne) => Math.round((ne + x) * 255).toString(16).padStart(2, "0");
|
|
4103
4103
|
return `#${N(o)}${N(v)}${N(g)}`;
|
|
4104
4104
|
}, H = (B) => {
|
|
4105
4105
|
B = B.replace("#", "");
|
|
4106
|
-
const
|
|
4106
|
+
const E = parseInt(B.slice(0, 2), 16) / 255, j = parseInt(B.slice(2, 4), 16) / 255, p = parseInt(B.slice(4, 6), 16) / 255, w = Math.max(E, j, p), x = Math.min(E, j, p), o = w - x;
|
|
4107
4107
|
let v = 0;
|
|
4108
4108
|
const g = w === 0 ? 0 : o / w, N = w;
|
|
4109
4109
|
if (o !== 0)
|
|
4110
4110
|
switch (w) {
|
|
4111
|
-
case
|
|
4111
|
+
case E:
|
|
4112
4112
|
v = ((j - p) / o + (j < p ? 6 : 0)) * 60;
|
|
4113
4113
|
break;
|
|
4114
4114
|
case j:
|
|
4115
|
-
v = ((p -
|
|
4115
|
+
v = ((p - E) / o + 2) * 60;
|
|
4116
4116
|
break;
|
|
4117
4117
|
case p:
|
|
4118
|
-
v = ((
|
|
4118
|
+
v = ((E - j) / o + 4) * 60;
|
|
4119
4119
|
break;
|
|
4120
4120
|
}
|
|
4121
4121
|
return { h: v, s: g * 100, v: N * 100 };
|
|
4122
4122
|
}, L = (B) => {
|
|
4123
4123
|
if (!D.value) return;
|
|
4124
|
-
const
|
|
4124
|
+
const E = D.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - E.left) / E.width)), p = Math.max(0, Math.min(1, (B.clientY - E.top) / E.height));
|
|
4125
4125
|
m.value = Math.round(j * 100), y.value = Math.round((1 - p) * 100);
|
|
4126
4126
|
}, A = (B) => {
|
|
4127
4127
|
if (!T.value) return;
|
|
4128
|
-
const
|
|
4128
|
+
const E = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - E.left) / E.width));
|
|
4129
4129
|
f.value = Math.round(j * 360);
|
|
4130
4130
|
}, V = (B) => {
|
|
4131
4131
|
if (!T.value) return;
|
|
4132
|
-
const
|
|
4132
|
+
const E = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - E.left) / E.width));
|
|
4133
4133
|
S.value = Math.round(j * 100);
|
|
4134
4134
|
}, h = (B) => {
|
|
4135
|
-
const
|
|
4136
|
-
f.value =
|
|
4135
|
+
const E = H(B);
|
|
4136
|
+
f.value = E.h, m.value = E.s, y.value = E.v, e("update:modelValue", B), e("change", B);
|
|
4137
4137
|
}, r = () => {
|
|
4138
4138
|
e("update:modelValue", z.value), e("change", z.value), t.value = !1;
|
|
4139
4139
|
}, $ = () => {
|
|
@@ -4144,19 +4144,19 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4144
4144
|
return ie(t, (B) => {
|
|
4145
4145
|
if (B) {
|
|
4146
4146
|
if (document.addEventListener("click", F), l.modelValue) {
|
|
4147
|
-
const
|
|
4148
|
-
f.value =
|
|
4147
|
+
const E = H(l.modelValue.slice(0, 7));
|
|
4148
|
+
f.value = E.h, m.value = E.s, y.value = E.v, l.showAlpha && l.modelValue.length === 9 && (S.value = Math.round(parseInt(l.modelValue.slice(7, 9), 16) / 2.55));
|
|
4149
4149
|
}
|
|
4150
4150
|
} else
|
|
4151
4151
|
document.removeEventListener("click", F);
|
|
4152
|
-
}), (B,
|
|
4152
|
+
}), (B, E) => (i(), c("div", {
|
|
4153
4153
|
class: u([n(a).b(), n(a).m(s.size), n(a).is("disabled", s.disabled)]),
|
|
4154
|
-
onClick:
|
|
4154
|
+
onClick: E[1] || (E[1] = oe(() => {
|
|
4155
4155
|
}, ["stop"]))
|
|
4156
4156
|
}, [
|
|
4157
4157
|
d("div", {
|
|
4158
4158
|
class: u(n(a).e("trigger")),
|
|
4159
|
-
onClick:
|
|
4159
|
+
onClick: E[0] || (E[0] = (j) => !s.disabled && (t.value = !t.value))
|
|
4160
4160
|
}, [
|
|
4161
4161
|
d("div", {
|
|
4162
4162
|
class: u(n(a).e("color")),
|