@xto/form 1.6.8 → 1.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/AutoComplete/index.d.ts +29 -0
- package/es/AutoComplete/index.vue.d.ts +70 -0
- package/es/Cascader/index.d.ts +40 -0
- package/es/Cascader/index.vue.d.ts +58 -0
- package/es/Checkbox/group.vue.d.ts +34 -0
- package/es/Checkbox/index.d.ts +49 -0
- package/es/Checkbox/index.vue.d.ts +31 -0
- package/es/Checkbox/types.d.ts +106 -0
- package/es/ColorPicker/index.d.ts +15 -0
- package/es/ColorPicker/index.vue.d.ts +29 -0
- package/es/DatePicker/components/DateTable.vue.d.ts +36 -0
- package/es/DatePicker/components/MonthTable.vue.d.ts +14 -0
- package/es/DatePicker/components/YearTable.vue.d.ts +14 -0
- package/es/DatePicker/index.d.ts +35 -0
- package/es/DatePicker/index.vue.d.ts +57 -0
- package/es/DatePicker/types.d.ts +112 -0
- package/es/DatePicker/utils.d.ts +21 -0
- package/es/DynamicFields/index.d.ts +2 -0
- package/es/DynamicFields/index.vue.d.ts +52 -0
- package/es/DynamicFields/types.d.ts +36 -0
- package/es/Form/index.d.ts +77 -0
- package/es/Form/index.vue.d.ts +64 -0
- package/es/Form/item.vue.d.ts +31 -0
- package/es/Form/types.d.ts +239 -0
- package/es/Form/validators.d.ts +60 -0
- package/es/Input/index.d.ts +29 -0
- package/es/Input/index.vue.d.ts +70 -0
- package/es/Input/types.d.ts +97 -0
- package/es/InputNumber/index.vue.d.ts +57 -0
- package/es/InputNumber/types.d.ts +83 -0
- package/es/Mention/index.d.ts +27 -0
- package/es/Mention/index.vue.d.ts +45 -0
- package/es/Radio/button.vue.d.ts +29 -0
- package/es/Radio/group.vue.d.ts +35 -0
- package/es/Radio/index.d.ts +61 -0
- package/es/Radio/index.vue.d.ts +30 -0
- package/es/Radio/types.d.ts +83 -0
- package/es/Rate/index.d.ts +41 -0
- package/es/Rate/index.vue.d.ts +49 -0
- package/es/Rate/types.d.ts +71 -0
- package/es/RichEditor/index.d.ts +19 -0
- package/es/RichEditor/index.vue.d.ts +41 -0
- package/es/Segmented/index.d.ts +20 -0
- package/es/Segmented/index.vue.d.ts +52 -0
- package/es/Select/Option.vue.d.ts +9 -0
- package/es/Select/index.d.ts +48 -0
- package/es/Select/index.vue.d.ts +93 -0
- package/es/Select/types.d.ts +137 -0
- package/es/Select/utils.d.ts +8 -0
- package/es/Slider/index.d.ts +52 -0
- package/es/Slider/index.vue.d.ts +39 -0
- package/es/Slider/types.d.ts +77 -0
- package/es/Switch/index.d.ts +16 -0
- package/es/Switch/index.vue.d.ts +44 -0
- package/es/Switch/types.d.ts +69 -0
- package/es/Textarea/index.d.ts +48 -0
- package/es/Textarea/index.vue.d.ts +51 -0
- package/es/Textarea/types.d.ts +91 -0
- package/es/TimePicker/components/TimePanel.vue.d.ts +28 -0
- package/es/TimePicker/index.d.ts +39 -0
- package/es/TimePicker/index.vue.d.ts +57 -0
- package/es/TimePicker/types.d.ts +117 -0
- package/es/TimePicker/utils.d.ts +10 -0
- package/es/Transfer/index.d.ts +58 -0
- package/es/Transfer/index.vue.d.ts +62 -0
- package/es/Transfer/types.d.ts +117 -0
- package/es/Upload/index.d.ts +110 -0
- package/es/Upload/index.vue.d.ts +140 -0
- package/es/Upload/types.d.ts +238 -0
- package/es/index.d.ts +41 -0
- package/es/index.mjs +504 -497
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +10 -10
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as d, normalizeStyle as te, normalizeClass as u, createElementVNode as r, renderSlot as
|
|
1
|
+
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as d, normalizeStyle as te, normalizeClass as u, createElementVNode as r, renderSlot as ue, createTextVNode as de, toDisplayString as N, ref as B, useSlots as Le, watch as ie, unref as n, createCommentVNode as U, withDirectives as oe, vModelDynamic as je, createVNode as Q, vModelText as Ve, withKeys as Ne, withModifiers as se, inject as xe, provide as $e, toRef as Ge, onMounted as ge, onUnmounted as De, Fragment as J, renderList as _, createBlock as fe, Teleport as Ie, Transition as Pe, withCtx as He, vModelSelect as Ce, vShow as be, nextTick as Se, defineAsyncComponent as Ue, shallowRef as Je, onBeforeUnmount as Ze } from "vue";
|
|
2
2
|
import { useNamespace as ae, useZIndex as Ee } from "@xto/core";
|
|
3
3
|
const Xe = {
|
|
4
4
|
// 箭头类
|
|
@@ -201,10 +201,10 @@ const Xe = {
|
|
|
201
201
|
up: "M5 15l7-7 7 7"
|
|
202
202
|
// 上箭头
|
|
203
203
|
};
|
|
204
|
-
function
|
|
204
|
+
function Qe(s) {
|
|
205
205
|
return s in Xe;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
207
|
+
const _e = ["aria-hidden", "aria-label"], el = ["stroke-width"], ll = ["d"], ee = /* @__PURE__ */ le({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -224,7 +224,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
224
224
|
})), m = V(() => [
|
|
225
225
|
e.b(),
|
|
226
226
|
e.is("spin", a.spin)
|
|
227
|
-
]), b = V(() => a.name &&
|
|
227
|
+
]), b = V(() => a.name && Qe(a.name) ? Xe[a.name] : "");
|
|
228
228
|
return k({
|
|
229
229
|
iconSize: t,
|
|
230
230
|
iconStyle: l,
|
|
@@ -247,13 +247,13 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
247
247
|
style: te(c.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
|
-
r("path", { d: b.value }, null, 8,
|
|
251
|
-
], 12,
|
|
250
|
+
r("path", { d: b.value }, null, 8, ll)
|
|
251
|
+
], 12, el)) : ue(T.$slots, "default", { key: 1 }, () => [
|
|
252
252
|
de(N(s.name), 1)
|
|
253
253
|
])
|
|
254
|
-
], 14,
|
|
254
|
+
], 14, _e));
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
256
|
+
}), al = ["type", "placeholder", "disabled", "readonly", "maxlength", "minlength"], Qa = /* @__PURE__ */ le({
|
|
257
257
|
name: "XInput",
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
@@ -276,20 +276,20 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
276
276
|
setup(s, { expose: k, emit: a }) {
|
|
277
277
|
const e = s, t = a, l = ae("input"), c = B(), m = B(!1), b = B(!1), T = Le(), S = V(
|
|
278
278
|
() => e.type === "password" && e.showPassword && !e.disabled
|
|
279
|
-
),
|
|
279
|
+
), $ = V(() => S.value ? b.value ? "text" : "password" : e.type);
|
|
280
280
|
V(() => e.modelValue !== void 0), V(() => e.value !== void 0);
|
|
281
|
-
const
|
|
281
|
+
const D = B("");
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
284
|
([A, I]) => {
|
|
285
285
|
const Y = A ?? I ?? "";
|
|
286
|
-
Y !==
|
|
286
|
+
Y !== D.value && (D.value = Y);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
290
290
|
const z = (A) => {
|
|
291
|
-
|
|
292
|
-
}, E = V(() => String(
|
|
291
|
+
D.value = A, t("update:modelValue", A), t("update:value", A), t("input", A);
|
|
292
|
+
}, E = V(() => String(D.value).length), y = V(() => [
|
|
293
293
|
l.b(),
|
|
294
294
|
e.size !== "default" ? l.m(e.size) : "",
|
|
295
295
|
l.is("disabled", e.disabled),
|
|
@@ -304,7 +304,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
304
304
|
}, O = (A) => {
|
|
305
305
|
m.value = !1, t("blur", A);
|
|
306
306
|
}, M = () => {
|
|
307
|
-
|
|
307
|
+
D.value = "", t("update:modelValue", ""), t("update:value", ""), t("clear");
|
|
308
308
|
}, h = () => {
|
|
309
309
|
b.value = !b.value;
|
|
310
310
|
};
|
|
@@ -325,7 +325,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
325
325
|
key: 0,
|
|
326
326
|
class: u(n(l).e("prefix"))
|
|
327
327
|
}, [
|
|
328
|
-
|
|
328
|
+
ue(A.$slots, "prefix", {}, () => [
|
|
329
329
|
r("span", {
|
|
330
330
|
class: u(n(l).e("icon"))
|
|
331
331
|
}, N(s.prefixIcon), 3)
|
|
@@ -334,8 +334,8 @@ 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": I[0] || (I[0] = (Y) =>
|
|
338
|
-
type:
|
|
337
|
+
"onUpdate:modelValue": I[0] || (I[0] = (Y) => D.value = Y),
|
|
338
|
+
type: $.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
341
341
|
readonly: s.readonly,
|
|
@@ -346,14 +346,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
346
346
|
onChange: R,
|
|
347
347
|
onFocus: H,
|
|
348
348
|
onBlur: O
|
|
349
|
-
}, null, 42,
|
|
350
|
-
[
|
|
349
|
+
}, null, 42, al), [
|
|
350
|
+
[je, D.value]
|
|
351
351
|
]),
|
|
352
352
|
A.$slots.suffix || s.suffixIcon || s.clearable || S.value || s.showWordLimit ? (i(), d("span", {
|
|
353
353
|
key: 1,
|
|
354
354
|
class: u(n(l).e("suffix"))
|
|
355
355
|
}, [
|
|
356
|
-
|
|
356
|
+
ue(A.$slots, "suffix", {}, () => [
|
|
357
357
|
s.clearable && s.value && !s.disabled ? (i(), d("span", {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: u([n(l).e("icon"), n(l).e("clear")]),
|
|
@@ -382,7 +382,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
382
382
|
], 2)) : U("", !0)
|
|
383
383
|
], 2));
|
|
384
384
|
}
|
|
385
|
-
}),
|
|
385
|
+
}), tl = ["disabled"], nl = ["value", "placeholder", "disabled"], sl = ["disabled"], _a = /* @__PURE__ */ le({
|
|
386
386
|
name: "XInputNumber",
|
|
387
387
|
__name: "index",
|
|
388
388
|
props: {
|
|
@@ -405,15 +405,15 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
405
405
|
const e = s, t = a, l = ae("input-number"), c = B(), m = B(!1), b = B(null), T = B(e.modelValue), S = V(() => {
|
|
406
406
|
if (e.precision !== void 0)
|
|
407
407
|
return e.precision;
|
|
408
|
-
const o =
|
|
408
|
+
const o = $(e.step), f = e.modelValue !== void 0 && e.modelValue !== null ? $(e.modelValue) : 0;
|
|
409
409
|
return Math.max(o, f);
|
|
410
410
|
});
|
|
411
|
-
function
|
|
411
|
+
function $(o) {
|
|
412
412
|
if (o == null) return 0;
|
|
413
413
|
const f = o.toString(), g = f.indexOf(".");
|
|
414
414
|
return g === -1 ? 0 : f.length - g - 1;
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function D(o, f = S.value) {
|
|
417
417
|
if (f === 0) return Math.round(o);
|
|
418
418
|
let g = o.toFixed(f);
|
|
419
419
|
return Number(g);
|
|
@@ -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 E = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : E.value === void 0 || E.value === null ? "" :
|
|
424
|
+
const E = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : E.value === void 0 || E.value === null ? "" : D(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 = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f =
|
|
433
|
+
const o = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f = D(o + e.step), g = z(f);
|
|
434
434
|
v(g);
|
|
435
435
|
}
|
|
436
436
|
function h() {
|
|
437
437
|
if (e.disabled || R.value) return;
|
|
438
|
-
const o = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f =
|
|
438
|
+
const o = E.value ?? (e.min === -1 / 0 ? 0 : e.min), f = D(o - e.step), g = z(f);
|
|
439
439
|
v(g);
|
|
440
440
|
}
|
|
441
441
|
function v(o) {
|
|
@@ -443,12 +443,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
443
443
|
if (o === void 0)
|
|
444
444
|
e.modelValue !== void 0 && t("update:modelValue", void 0), e.value !== void 0 && t("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", void 0), t("change", void 0, f);
|
|
445
445
|
else {
|
|
446
|
-
const g =
|
|
446
|
+
const g = D(o), K = z(g);
|
|
447
447
|
if (e.stepStrictly) {
|
|
448
|
-
const ne = Math.round((
|
|
449
|
-
e.modelValue !== void 0 && t("update:modelValue", K), e.value !== void 0 && t("update:value", K), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", K), t("change", K, f);
|
|
450
|
-
} else
|
|
448
|
+
const ne = Math.round((K - e.min) / e.step), X = D(e.min + ne * e.step);
|
|
451
449
|
e.modelValue !== void 0 && t("update:modelValue", X), e.value !== void 0 && t("update:value", X), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", X), t("change", X, f);
|
|
450
|
+
} else
|
|
451
|
+
e.modelValue !== void 0 && t("update:modelValue", K), e.value !== void 0 && t("update:value", K), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", K), t("change", K, f);
|
|
452
452
|
}
|
|
453
453
|
T.value = e.modelValue ?? e.value, b.value = null;
|
|
454
454
|
}
|
|
@@ -458,9 +458,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
458
458
|
let f = o.replace(/[^\d.-]/g, "");
|
|
459
459
|
const g = f.split(".");
|
|
460
460
|
g.length > 2 && (f = g[0] + "." + g.slice(1).join("")), f.indexOf("-") > 0 && (f = f.replace(/-/g, "")), f.lastIndexOf("-") > 0 && (f = "-" + f.replace(/-/g, ""));
|
|
461
|
-
const
|
|
462
|
-
if (!isNaN(
|
|
463
|
-
return
|
|
461
|
+
const K = Number(f);
|
|
462
|
+
if (!isNaN(K))
|
|
463
|
+
return K;
|
|
464
464
|
}
|
|
465
465
|
function A(o) {
|
|
466
466
|
const f = o.target.value;
|
|
@@ -519,7 +519,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
519
519
|
class: u([n(l).e("decrease"), n(l).is("disabled", R.value)]),
|
|
520
520
|
disabled: R.value,
|
|
521
521
|
onClick: h
|
|
522
|
-
}, " − ", 10,
|
|
522
|
+
}, " − ", 10, tl)) : U("", !0),
|
|
523
523
|
r("div", {
|
|
524
524
|
class: u(n(l).e("wrapper"))
|
|
525
525
|
}, [
|
|
@@ -536,7 +536,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
536
536
|
onFocus: Y,
|
|
537
537
|
onBlur: I,
|
|
538
538
|
onKeydown: G
|
|
539
|
-
}, null, 42,
|
|
539
|
+
}, null, 42, nl)
|
|
540
540
|
], 2),
|
|
541
541
|
s.controls ? (i(), d("button", {
|
|
542
542
|
key: 1,
|
|
@@ -544,10 +544,10 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
544
544
|
class: u([n(l).e("increase"), n(l).is("disabled", H.value)]),
|
|
545
545
|
disabled: H.value,
|
|
546
546
|
onClick: M
|
|
547
|
-
}, " + ", 10,
|
|
547
|
+
}, " + ", 10, sl)) : U("", !0)
|
|
548
548
|
], 2));
|
|
549
549
|
}
|
|
550
|
-
}),
|
|
550
|
+
}), ul = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], et = /* @__PURE__ */ le({
|
|
551
551
|
name: "XTextarea",
|
|
552
552
|
__name: "index",
|
|
553
553
|
props: {
|
|
@@ -576,14 +576,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
576
576
|
);
|
|
577
577
|
const T = (M) => {
|
|
578
578
|
b.value = M, t("update:modelValue", M), t("update:value", M), t("input", M);
|
|
579
|
-
}, S = V(() => String(b.value).length),
|
|
579
|
+
}, S = V(() => String(b.value).length), $ = V(() => {
|
|
580
580
|
const M = {};
|
|
581
581
|
if (e.resize && (M.resize = e.resize), e.autosize && (M.minHeight = "auto", typeof e.autosize == "object")) {
|
|
582
582
|
const h = e.autosize.minRows || 1, v = e.autosize.maxRows;
|
|
583
583
|
M.minHeight = `${h * 22 + 12}px`, v && (M.maxHeight = `${v * 22 + 12}px`);
|
|
584
584
|
}
|
|
585
585
|
return M;
|
|
586
|
-
}),
|
|
586
|
+
}), D = V(() => [
|
|
587
587
|
l.b(),
|
|
588
588
|
l.is("disabled", e.disabled),
|
|
589
589
|
l.is("focus", m.value),
|
|
@@ -610,7 +610,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
610
610
|
},
|
|
611
611
|
textareaRef: c
|
|
612
612
|
}), (M, h) => (i(), d("div", {
|
|
613
|
-
class: u(
|
|
613
|
+
class: u(D.value),
|
|
614
614
|
style: te(s.disabled ? void 0 : { cursor: "text" })
|
|
615
615
|
}, [
|
|
616
616
|
oe(r("textarea", {
|
|
@@ -623,13 +623,13 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
623
623
|
maxlength: s.maxlength,
|
|
624
624
|
minlength: s.minlength,
|
|
625
625
|
rows: s.rows,
|
|
626
|
-
style: te(
|
|
626
|
+
style: te($.value),
|
|
627
627
|
class: u(n(l).e("inner")),
|
|
628
628
|
onInput: z,
|
|
629
629
|
onChange: E,
|
|
630
630
|
onFocus: y,
|
|
631
631
|
onBlur: R
|
|
632
|
-
}, null, 46,
|
|
632
|
+
}, null, 46, ul), [
|
|
633
633
|
[Ve, b.value]
|
|
634
634
|
]),
|
|
635
635
|
s.showWordLimit && s.maxlength ? (i(), d("span", {
|
|
@@ -638,7 +638,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
638
638
|
}, N(S.value) + "/" + N(s.maxlength), 3)) : U("", !0)
|
|
639
639
|
], 6));
|
|
640
640
|
}
|
|
641
|
-
}),
|
|
641
|
+
}), ol = ["tabindex", "aria-checked", "aria-disabled", "onKeydown"], lt = /* @__PURE__ */ le({
|
|
642
642
|
name: "XSwitch",
|
|
643
643
|
__name: "index",
|
|
644
644
|
props: {
|
|
@@ -646,8 +646,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
646
646
|
checked: { type: [Boolean, Number, String], default: void 0 },
|
|
647
647
|
disabled: { type: Boolean, default: !1 },
|
|
648
648
|
width: { default: 40 },
|
|
649
|
-
activeColor: { default: "#
|
|
650
|
-
inactiveColor: { default: "
|
|
649
|
+
activeColor: { default: "#12B6AF" },
|
|
650
|
+
inactiveColor: { default: "" },
|
|
651
651
|
activeValue: { type: [Boolean, Number, String], default: !0 },
|
|
652
652
|
inactiveValue: { type: [Boolean, Number, String], default: !1 }
|
|
653
653
|
},
|
|
@@ -657,18 +657,25 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
657
657
|
t.b(),
|
|
658
658
|
t.is("disabled", a.disabled),
|
|
659
659
|
t.is("checked", c.value)
|
|
660
|
-
]), b = V(() =>
|
|
661
|
-
width: typeof a.width == "number" ? `${a.width}px` : a.width,
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
})), T = () => {
|
|
660
|
+
]), b = V(() => {
|
|
661
|
+
const $ = { width: typeof a.width == "number" ? `${a.width}px` : a.width, height: "20px" };
|
|
662
|
+
return c.value ? a.activeColor && ($.backgroundColor = a.activeColor) : a.inactiveColor && ($.backgroundColor = a.inactiveColor), $;
|
|
663
|
+
}), T = () => {
|
|
665
664
|
if (a.disabled) return;
|
|
666
665
|
const S = c.value ? a.inactiveValue : a.activeValue;
|
|
667
666
|
a.modelValue !== void 0 && e("update:modelValue", S), a.checked !== void 0 && e("update:checked", S), a.modelValue === void 0 && a.checked === void 0 && e("update:modelValue", S), e("change", S);
|
|
668
667
|
};
|
|
669
|
-
return (S,
|
|
668
|
+
return (S, $) => (i(), d("span", {
|
|
670
669
|
class: u(m.value),
|
|
671
|
-
|
|
670
|
+
role: "switch",
|
|
671
|
+
tabindex: s.disabled ? -1 : 0,
|
|
672
|
+
"aria-checked": c.value,
|
|
673
|
+
"aria-disabled": s.disabled,
|
|
674
|
+
onClick: T,
|
|
675
|
+
onKeydown: [
|
|
676
|
+
Ne(se(T, ["prevent"]), ["enter"]),
|
|
677
|
+
Ne(se(T, ["prevent"]), ["space"])
|
|
678
|
+
]
|
|
672
679
|
}, [
|
|
673
680
|
r("span", {
|
|
674
681
|
class: u(n(t).e("core")),
|
|
@@ -678,11 +685,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
678
685
|
key: 0,
|
|
679
686
|
class: u(n(t).e("text"))
|
|
680
687
|
}, [
|
|
681
|
-
|
|
688
|
+
ue(S.$slots, "default")
|
|
682
689
|
], 2)) : U("", !0)
|
|
683
|
-
],
|
|
690
|
+
], 42, ol));
|
|
684
691
|
}
|
|
685
|
-
}),
|
|
692
|
+
}), il = ["checked", "disabled", "name", "value"], at = /* @__PURE__ */ le({
|
|
686
693
|
name: "XRadio",
|
|
687
694
|
__name: "index",
|
|
688
695
|
props: {
|
|
@@ -694,7 +701,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
694
701
|
},
|
|
695
702
|
emits: ["update:modelValue", "change"],
|
|
696
703
|
setup(s, { emit: k }) {
|
|
697
|
-
const a = s, e = k, t = ae("radio"), l = xe("radioGroup", null), c = V(() => !!l), m = V(() => c.value ? l.modelValue.value : a.modelValue), b = V(() => a.value ?? a.label), T = V(() => m.value === b.value), S = V(() => a.disabled || c.value && l.disabled),
|
|
704
|
+
const a = s, e = k, t = ae("radio"), l = xe("radioGroup", null), c = V(() => !!l), m = V(() => c.value ? l.modelValue.value : a.modelValue), b = V(() => a.value ?? a.label), T = V(() => m.value === b.value), S = V(() => a.disabled || c.value && l.disabled), $ = V(() => a.name || (c.value ? l.name : void 0)), D = V(() => [
|
|
698
705
|
t.b(),
|
|
699
706
|
t.is("checked", T.value),
|
|
700
707
|
t.is("disabled", S.value)
|
|
@@ -702,8 +709,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
702
709
|
S.value || (c.value ? l.changeValue(b.value) : (e("update:modelValue", b.value), e("change", b.value)));
|
|
703
710
|
};
|
|
704
711
|
return (E, y) => (i(), d("label", {
|
|
705
|
-
class: u(
|
|
706
|
-
onClick:
|
|
712
|
+
class: u(D.value),
|
|
713
|
+
onClick: se(z, ["prevent"])
|
|
707
714
|
}, [
|
|
708
715
|
r("span", {
|
|
709
716
|
class: u(n(t).e("input"))
|
|
@@ -712,21 +719,21 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
712
719
|
type: "radio",
|
|
713
720
|
checked: T.value,
|
|
714
721
|
disabled: S.value,
|
|
715
|
-
name:
|
|
722
|
+
name: $.value,
|
|
716
723
|
value: b.value
|
|
717
|
-
}, null, 8,
|
|
724
|
+
}, null, 8, il)
|
|
718
725
|
], 2),
|
|
719
726
|
E.$slots.default || s.label ? (i(), d("span", {
|
|
720
727
|
key: 0,
|
|
721
728
|
class: u(n(t).e("label"))
|
|
722
729
|
}, [
|
|
723
|
-
|
|
730
|
+
ue(E.$slots, "default", {}, () => [
|
|
724
731
|
de(N(s.label), 1)
|
|
725
732
|
])
|
|
726
733
|
], 2)) : U("", !0)
|
|
727
734
|
], 2));
|
|
728
735
|
}
|
|
729
|
-
}),
|
|
736
|
+
}), tt = /* @__PURE__ */ le({
|
|
730
737
|
name: "XRadioGroup",
|
|
731
738
|
__name: "group",
|
|
732
739
|
props: {
|
|
@@ -749,10 +756,10 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
749
756
|
class: u(n(t).b()),
|
|
750
757
|
role: "radiogroup"
|
|
751
758
|
}, [
|
|
752
|
-
|
|
759
|
+
ue(c.$slots, "default")
|
|
753
760
|
], 2));
|
|
754
761
|
}
|
|
755
|
-
}),
|
|
762
|
+
}), rl = ["checked", "disabled", "value"], nt = /* @__PURE__ */ le({
|
|
756
763
|
name: "XRadioButton",
|
|
757
764
|
__name: "button",
|
|
758
765
|
props: {
|
|
@@ -767,12 +774,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
767
774
|
e.b(),
|
|
768
775
|
e.is("active", b.value),
|
|
769
776
|
e.is("disabled", T.value)
|
|
770
|
-
]),
|
|
777
|
+
]), $ = () => {
|
|
771
778
|
T.value || l.value && t.changeValue(m.value);
|
|
772
779
|
};
|
|
773
|
-
return (
|
|
780
|
+
return (D, z) => (i(), d("label", {
|
|
774
781
|
class: u(S.value),
|
|
775
|
-
onClick:
|
|
782
|
+
onClick: se($, ["prevent"])
|
|
776
783
|
}, [
|
|
777
784
|
r("input", {
|
|
778
785
|
type: "radio",
|
|
@@ -780,17 +787,17 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
780
787
|
disabled: T.value,
|
|
781
788
|
value: m.value,
|
|
782
789
|
class: u(n(e).e("input"))
|
|
783
|
-
}, null, 10,
|
|
790
|
+
}, null, 10, rl),
|
|
784
791
|
r("span", {
|
|
785
792
|
class: u(n(e).e("inner"))
|
|
786
793
|
}, [
|
|
787
|
-
|
|
794
|
+
ue(D.$slots, "default", {}, () => [
|
|
788
795
|
de(N(s.label), 1)
|
|
789
796
|
])
|
|
790
797
|
], 2)
|
|
791
798
|
], 2));
|
|
792
799
|
}
|
|
793
|
-
}),
|
|
800
|
+
}), dl = ["checked", "disabled", "name", "value"], st = /* @__PURE__ */ le({
|
|
794
801
|
name: "XCheckbox",
|
|
795
802
|
__name: "index",
|
|
796
803
|
props: {
|
|
@@ -806,8 +813,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
806
813
|
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
814
|
if (a.disabled) return !0;
|
|
808
815
|
if (c.value) {
|
|
809
|
-
const
|
|
810
|
-
return b.value && z || !b.value && E ? !0 :
|
|
816
|
+
const D = l.disabled, z = l.min > 0 && l.modelValue.value.length <= l.min, E = l.max > 0 && l.modelValue.value.length >= l.max;
|
|
817
|
+
return b.value && z || !b.value && E ? !0 : D;
|
|
811
818
|
}
|
|
812
819
|
return !1;
|
|
813
820
|
}), S = V(() => [
|
|
@@ -815,23 +822,23 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
815
822
|
t.is("checked", b.value),
|
|
816
823
|
t.is("disabled", T.value),
|
|
817
824
|
t.is("indeterminate", a.indeterminate && !b.value)
|
|
818
|
-
]),
|
|
825
|
+
]), $ = () => {
|
|
819
826
|
if (!T.value)
|
|
820
827
|
if (c.value)
|
|
821
828
|
l.changeValue(m.value);
|
|
822
829
|
else {
|
|
823
|
-
let
|
|
830
|
+
let D;
|
|
824
831
|
if (Array.isArray(a.modelValue)) {
|
|
825
832
|
const z = a.modelValue.indexOf(m.value);
|
|
826
|
-
z > -1 ?
|
|
833
|
+
z > -1 ? D = [...a.modelValue.slice(0, z), ...a.modelValue.slice(z + 1)] : D = [...a.modelValue, m.value];
|
|
827
834
|
} else
|
|
828
|
-
|
|
829
|
-
e("update:modelValue",
|
|
835
|
+
D = !a.modelValue;
|
|
836
|
+
e("update:modelValue", D), e("change", D);
|
|
830
837
|
}
|
|
831
838
|
};
|
|
832
|
-
return (
|
|
839
|
+
return (D, z) => (i(), d("label", {
|
|
833
840
|
class: u(S.value),
|
|
834
|
-
onClick:
|
|
841
|
+
onClick: se($, ["prevent"])
|
|
835
842
|
}, [
|
|
836
843
|
r("span", {
|
|
837
844
|
class: u(n(t).e("input"))
|
|
@@ -842,19 +849,19 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
842
849
|
disabled: T.value,
|
|
843
850
|
name: s.name,
|
|
844
851
|
value: m.value
|
|
845
|
-
}, null, 8,
|
|
852
|
+
}, null, 8, dl)
|
|
846
853
|
], 2),
|
|
847
|
-
|
|
854
|
+
D.$slots.default || s.label !== void 0 ? (i(), d("span", {
|
|
848
855
|
key: 0,
|
|
849
856
|
class: u(n(t).e("label"))
|
|
850
857
|
}, [
|
|
851
|
-
|
|
858
|
+
ue(D.$slots, "default", {}, () => [
|
|
852
859
|
de(N(s.label), 1)
|
|
853
860
|
])
|
|
854
861
|
], 2)) : U("", !0)
|
|
855
862
|
], 2));
|
|
856
863
|
}
|
|
857
|
-
}),
|
|
864
|
+
}), ut = /* @__PURE__ */ le({
|
|
858
865
|
name: "XCheckboxGroup",
|
|
859
866
|
__name: "group",
|
|
860
867
|
props: {
|
|
@@ -879,10 +886,10 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
879
886
|
class: u(n(t).b()),
|
|
880
887
|
role: "group"
|
|
881
888
|
}, [
|
|
882
|
-
|
|
889
|
+
ue(c.$slots, "default")
|
|
883
890
|
], 2));
|
|
884
891
|
}
|
|
885
|
-
}),
|
|
892
|
+
}), ot = /* @__PURE__ */ le({
|
|
886
893
|
name: "XForm",
|
|
887
894
|
__name: "index",
|
|
888
895
|
props: {
|
|
@@ -902,9 +909,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
902
909
|
l.m(`label-${b.value ? "top" : e.labelPosition}`),
|
|
903
910
|
l.is("inline", m.value),
|
|
904
911
|
l.is("vertical", b.value)
|
|
905
|
-
]), S = V(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })),
|
|
912
|
+
]), S = V(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), $ = (h) => {
|
|
906
913
|
c.value.push(h);
|
|
907
|
-
},
|
|
914
|
+
}, D = (h) => {
|
|
908
915
|
const v = c.value.indexOf(h);
|
|
909
916
|
v > -1 && c.value.splice(v, 1);
|
|
910
917
|
}, z = async () => {
|
|
@@ -936,7 +943,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
936
943
|
console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), t("submit");
|
|
937
944
|
}, O = (h) => {
|
|
938
945
|
console.log("[XForm] handleReset triggered", h), h.preventDefault(), y(), t("reset");
|
|
939
|
-
}, M =
|
|
946
|
+
}, M = Ge(e, "model");
|
|
940
947
|
return $e("form", {
|
|
941
948
|
model: M,
|
|
942
949
|
rules: e.rules,
|
|
@@ -945,8 +952,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
945
952
|
disabled: e.disabled,
|
|
946
953
|
size: e.size,
|
|
947
954
|
labelStyle: S,
|
|
948
|
-
addField:
|
|
949
|
-
removeField:
|
|
955
|
+
addField: $,
|
|
956
|
+
removeField: D,
|
|
950
957
|
emit: t
|
|
951
958
|
}), k({
|
|
952
959
|
validate: z,
|
|
@@ -958,10 +965,10 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
958
965
|
onSubmit: H,
|
|
959
966
|
onReset: O
|
|
960
967
|
}, [
|
|
961
|
-
|
|
968
|
+
ue(h.$slots, "default")
|
|
962
969
|
], 34));
|
|
963
970
|
}
|
|
964
|
-
}),
|
|
971
|
+
}), it = /* @__PURE__ */ le({
|
|
965
972
|
name: "XFormItem",
|
|
966
973
|
__name: "item",
|
|
967
974
|
props: {
|
|
@@ -980,9 +987,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
980
987
|
var H;
|
|
981
988
|
if (!(!l || !a.prop))
|
|
982
989
|
return (H = l.model.value) == null ? void 0 : H[a.prop];
|
|
983
|
-
},
|
|
990
|
+
}, $ = (H) => {
|
|
984
991
|
!l || !a.prop || l.model.value && (l.model.value[a.prop] = H);
|
|
985
|
-
},
|
|
992
|
+
}, D = async (H) => {
|
|
986
993
|
const O = T();
|
|
987
994
|
if (O.length === 0)
|
|
988
995
|
return c.value = "valid", !0;
|
|
@@ -1023,7 +1030,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1023
1030
|
}
|
|
1024
1031
|
return c.value = h ? "valid" : "invalid", m.value = v, l && a.prop && l.emit("validate", a.prop, h, v), h;
|
|
1025
1032
|
}, z = () => {
|
|
1026
|
-
|
|
1033
|
+
$(void 0), E();
|
|
1027
1034
|
}, E = () => {
|
|
1028
1035
|
c.value = "", m.value = "";
|
|
1029
1036
|
}, y = V(() => [
|
|
@@ -1036,23 +1043,23 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1036
1043
|
return { width: typeof H == "number" ? `${H}px` : H };
|
|
1037
1044
|
});
|
|
1038
1045
|
return ie(() => S(), () => {
|
|
1039
|
-
c.value === "invalid" &&
|
|
1046
|
+
c.value === "invalid" && D("change");
|
|
1040
1047
|
}), ge(() => {
|
|
1041
1048
|
l && a.prop && l.addField({
|
|
1042
1049
|
prop: a.prop,
|
|
1043
|
-
validate:
|
|
1050
|
+
validate: D,
|
|
1044
1051
|
resetField: z,
|
|
1045
1052
|
clearValidate: E
|
|
1046
1053
|
});
|
|
1047
1054
|
}), De(() => {
|
|
1048
1055
|
l && a.prop && l.removeField({
|
|
1049
1056
|
prop: a.prop,
|
|
1050
|
-
validate:
|
|
1057
|
+
validate: D,
|
|
1051
1058
|
resetField: z,
|
|
1052
1059
|
clearValidate: E
|
|
1053
1060
|
});
|
|
1054
1061
|
}), k({
|
|
1055
|
-
validate:
|
|
1062
|
+
validate: D,
|
|
1056
1063
|
resetField: z,
|
|
1057
1064
|
clearValidate: E
|
|
1058
1065
|
}), (H, O) => (i(), d("div", {
|
|
@@ -1063,14 +1070,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1063
1070
|
class: u(n(t).e("label")),
|
|
1064
1071
|
style: te(R.value)
|
|
1065
1072
|
}, [
|
|
1066
|
-
|
|
1073
|
+
ue(H.$slots, "label", {}, () => [
|
|
1067
1074
|
de(N(s.label), 1)
|
|
1068
1075
|
])
|
|
1069
1076
|
], 6)) : U("", !0),
|
|
1070
1077
|
r("div", {
|
|
1071
1078
|
class: u(n(t).e("content"))
|
|
1072
1079
|
}, [
|
|
1073
|
-
|
|
1080
|
+
ue(H.$slots, "default"),
|
|
1074
1081
|
s.showMessage !== !1 && c.value === "invalid" ? (i(), d("div", {
|
|
1075
1082
|
key: 0,
|
|
1076
1083
|
class: u(n(t).e("error"))
|
|
@@ -1079,25 +1086,25 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1079
1086
|
], 2));
|
|
1080
1087
|
}
|
|
1081
1088
|
});
|
|
1082
|
-
function
|
|
1089
|
+
function cl(s, k) {
|
|
1083
1090
|
return new Date(s, k + 1, 0).getDate();
|
|
1084
1091
|
}
|
|
1085
|
-
function
|
|
1092
|
+
function vl(s, k) {
|
|
1086
1093
|
return new Date(s, k, 1).getDay();
|
|
1087
1094
|
}
|
|
1088
1095
|
function pe(s, k) {
|
|
1089
1096
|
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
|
|
1090
1097
|
}
|
|
1091
|
-
function
|
|
1098
|
+
function fl(s, k) {
|
|
1092
1099
|
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth();
|
|
1093
1100
|
}
|
|
1094
|
-
function
|
|
1101
|
+
function Ke(s, k, a) {
|
|
1095
1102
|
if (!k || !a) return !1;
|
|
1096
1103
|
const e = s.getTime();
|
|
1097
1104
|
return e >= k.getTime() && e <= a.getTime();
|
|
1098
1105
|
}
|
|
1099
|
-
function
|
|
1100
|
-
const e = [], t =
|
|
1106
|
+
function ml(s, k, a = 0) {
|
|
1107
|
+
const e = [], t = cl(s, k), l = vl(s, k);
|
|
1101
1108
|
let c = new Date(s, k, 1);
|
|
1102
1109
|
const m = (l - a + 7) % 7;
|
|
1103
1110
|
c.setDate(1 - m);
|
|
@@ -1125,23 +1132,23 @@ function ve(s) {
|
|
|
1125
1132
|
}
|
|
1126
1133
|
return k;
|
|
1127
1134
|
}
|
|
1128
|
-
function
|
|
1135
|
+
function hl(s) {
|
|
1129
1136
|
const k = new Date(s);
|
|
1130
1137
|
return k.setMonth(k.getMonth() - 1), k;
|
|
1131
1138
|
}
|
|
1132
|
-
function
|
|
1139
|
+
function pl(s) {
|
|
1133
1140
|
const k = new Date(s);
|
|
1134
1141
|
return k.setMonth(k.getMonth() + 1), k;
|
|
1135
1142
|
}
|
|
1136
|
-
function
|
|
1143
|
+
function gl(s) {
|
|
1137
1144
|
const k = new Date(s);
|
|
1138
1145
|
return k.setFullYear(k.getFullYear() - 1), k;
|
|
1139
1146
|
}
|
|
1140
|
-
function
|
|
1147
|
+
function bl(s) {
|
|
1141
1148
|
const k = new Date(s);
|
|
1142
1149
|
return k.setFullYear(k.getFullYear() + 1), k;
|
|
1143
1150
|
}
|
|
1144
|
-
function
|
|
1151
|
+
function We(s) {
|
|
1145
1152
|
const k = Math.floor(s / 10) * 10;
|
|
1146
1153
|
return [k, k + 9];
|
|
1147
1154
|
}
|
|
@@ -1149,13 +1156,13 @@ function Be(s) {
|
|
|
1149
1156
|
const k = new Date(s);
|
|
1150
1157
|
return k.setHours(0, 0, 0, 0), k;
|
|
1151
1158
|
}
|
|
1152
|
-
function
|
|
1159
|
+
function yl(s, k, a, e) {
|
|
1153
1160
|
if (k && k(s))
|
|
1154
1161
|
return !0;
|
|
1155
1162
|
const t = Be(s).getTime();
|
|
1156
1163
|
return !!(a && t < Be(a).getTime() || e && t > Be(e).getTime());
|
|
1157
1164
|
}
|
|
1158
|
-
const
|
|
1165
|
+
const kl = [
|
|
1159
1166
|
"一月",
|
|
1160
1167
|
"二月",
|
|
1161
1168
|
"三月",
|
|
@@ -1168,7 +1175,7 @@ const bl = [
|
|
|
1168
1175
|
"十月",
|
|
1169
1176
|
"十一月",
|
|
1170
1177
|
"十二月"
|
|
1171
|
-
],
|
|
1178
|
+
], Ml = ["日", "一", "二", "三", "四", "五", "六"], Vl = ["onClick", "onMouseenter"], xl = /* @__PURE__ */ le({
|
|
1172
1179
|
name: "XDateTable",
|
|
1173
1180
|
__name: "DateTable",
|
|
1174
1181
|
props: {
|
|
@@ -1186,18 +1193,18 @@ const bl = [
|
|
|
1186
1193
|
},
|
|
1187
1194
|
emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
|
|
1188
1195
|
setup(s, { emit: k }) {
|
|
1189
|
-
const a = s, e = k, t = ae("date-table"), l = B(null), c = V(() => a.viewedMonth.getFullYear()), m = V(() => a.viewedMonth.getMonth()), b = V(() =>
|
|
1196
|
+
const a = s, e = k, t = ae("date-table"), l = B(null), c = V(() => a.viewedMonth.getFullYear()), m = V(() => a.viewedMonth.getMonth()), b = V(() => ml(c.value, m.value, 0)), T = (h) => a.modelValue ? pe(h, a.modelValue) : !1, S = (h) => pe(h, /* @__PURE__ */ new Date()), $ = (h) => fl(h, a.viewedMonth), D = (h) => {
|
|
1190
1197
|
if (a.selectionMode !== "range") return !1;
|
|
1191
1198
|
const { startDate: v, endDate: x, selecting: A } = a.rangeState || {};
|
|
1192
1199
|
if (A && v) {
|
|
1193
1200
|
const I = l.value;
|
|
1194
1201
|
if (I) {
|
|
1195
1202
|
const Y = v < I ? v : I, G = v < I ? I : v;
|
|
1196
|
-
return
|
|
1203
|
+
return Ke(h, Y, G);
|
|
1197
1204
|
}
|
|
1198
1205
|
return pe(h, v);
|
|
1199
1206
|
}
|
|
1200
|
-
return v && x ?
|
|
1207
|
+
return v && x ? Ke(h, v, x) : !1;
|
|
1201
1208
|
}, z = (h) => {
|
|
1202
1209
|
if (a.selectionMode !== "range") return !1;
|
|
1203
1210
|
const { startDate: v, selecting: x } = a.rangeState || {};
|
|
@@ -1210,16 +1217,16 @@ const bl = [
|
|
|
1210
1217
|
return pe(h, A < l.value ? l.value : A);
|
|
1211
1218
|
}
|
|
1212
1219
|
return v ? pe(h, v) : !1;
|
|
1213
|
-
}, y = (h) =>
|
|
1220
|
+
}, y = (h) => yl(h, a.disabledDate, a.minDate, a.maxDate), R = (h) => [
|
|
1214
1221
|
t.e("cell"),
|
|
1215
1222
|
t.is("selected", T(h)),
|
|
1216
1223
|
t.is("today", S(h)),
|
|
1217
1224
|
t.is("disabled", y(h)),
|
|
1218
|
-
t.is("in-range",
|
|
1225
|
+
t.is("in-range", D(h)),
|
|
1219
1226
|
t.is("range-start", z(h)),
|
|
1220
1227
|
t.is("range-end", E(h)),
|
|
1221
|
-
t.is("prev-month",
|
|
1222
|
-
t.is("next-month",
|
|
1228
|
+
t.is("prev-month", !$(h) && h.getMonth() < m.value),
|
|
1229
|
+
t.is("next-month", !$(h) && h.getMonth() > m.value)
|
|
1223
1230
|
], H = (h) => {
|
|
1224
1231
|
y(h) || (a.selectionMode === "range" ? e("range-select", h) : e("pick", h));
|
|
1225
1232
|
}, O = (h) => {
|
|
@@ -1234,7 +1241,7 @@ const bl = [
|
|
|
1234
1241
|
}, [
|
|
1235
1242
|
r("thead", null, [
|
|
1236
1243
|
r("tr", null, [
|
|
1237
|
-
(i(!0), d(J, null, _(n(
|
|
1244
|
+
(i(!0), d(J, null, _(n(Ml), (x) => (i(), d("th", {
|
|
1238
1245
|
key: x,
|
|
1239
1246
|
class: u(n(t).e("header-cell"))
|
|
1240
1247
|
}, N(x), 3))), 128))
|
|
@@ -1252,12 +1259,12 @@ const bl = [
|
|
|
1252
1259
|
r("span", {
|
|
1253
1260
|
class: u(n(t).e("cell-text"))
|
|
1254
1261
|
}, N(I.getDate()), 3)
|
|
1255
|
-
], 42,
|
|
1262
|
+
], 42, Vl))), 128))
|
|
1256
1263
|
]))), 128))
|
|
1257
1264
|
])
|
|
1258
1265
|
], 2));
|
|
1259
1266
|
}
|
|
1260
|
-
}),
|
|
1267
|
+
}), wl = ["onClick"], Cl = /* @__PURE__ */ le({
|
|
1261
1268
|
name: "XMonthTable",
|
|
1262
1269
|
__name: "MonthTable",
|
|
1263
1270
|
props: {
|
|
@@ -1269,27 +1276,27 @@ const bl = [
|
|
|
1269
1276
|
setup(s, { emit: k }) {
|
|
1270
1277
|
const a = s, e = k, t = ae("month-table");
|
|
1271
1278
|
V(() => a.modelValue ? a.modelValue.getMonth() : -1);
|
|
1272
|
-
const l = (
|
|
1273
|
-
const
|
|
1274
|
-
return
|
|
1275
|
-
}, m = (
|
|
1279
|
+
const l = ($) => a.modelValue ? a.modelValue.getFullYear() === a.viewedYear && a.modelValue.getMonth() === $ : !1, c = ($) => {
|
|
1280
|
+
const D = /* @__PURE__ */ new Date();
|
|
1281
|
+
return D.getFullYear() === a.viewedYear && D.getMonth() === $;
|
|
1282
|
+
}, m = ($) => {
|
|
1276
1283
|
if (!a.disabledDate) return !1;
|
|
1277
|
-
const
|
|
1278
|
-
return a.disabledDate(
|
|
1279
|
-
}, b = (
|
|
1284
|
+
const D = new Date(a.viewedYear, $, 1), z = new Date(a.viewedYear, $ + 1, 0);
|
|
1285
|
+
return a.disabledDate(D) && a.disabledDate(z);
|
|
1286
|
+
}, b = ($) => [
|
|
1280
1287
|
t.e("cell"),
|
|
1281
|
-
t.is("selected", l(
|
|
1282
|
-
t.is("current", c(
|
|
1283
|
-
t.is("disabled", m(
|
|
1284
|
-
], T = (
|
|
1285
|
-
m(
|
|
1288
|
+
t.is("selected", l($)),
|
|
1289
|
+
t.is("current", c($)),
|
|
1290
|
+
t.is("disabled", m($))
|
|
1291
|
+
], T = ($) => {
|
|
1292
|
+
m($) || e("pick", $);
|
|
1286
1293
|
}, S = V(() => {
|
|
1287
|
-
const
|
|
1288
|
-
for (let
|
|
1289
|
-
|
|
1290
|
-
return
|
|
1294
|
+
const $ = [];
|
|
1295
|
+
for (let D = 0; D < 12; D += 3)
|
|
1296
|
+
$.push([D, D + 1, D + 2]);
|
|
1297
|
+
return $;
|
|
1291
1298
|
});
|
|
1292
|
-
return (D
|
|
1299
|
+
return ($, D) => (i(), d("table", {
|
|
1293
1300
|
class: u(n(t).b()),
|
|
1294
1301
|
cellspacing: "0",
|
|
1295
1302
|
cellpadding: "0"
|
|
@@ -1303,13 +1310,13 @@ const bl = [
|
|
|
1303
1310
|
}, [
|
|
1304
1311
|
r("span", {
|
|
1305
1312
|
class: u(n(t).e("cell-text"))
|
|
1306
|
-
}, N(n(
|
|
1307
|
-
], 10,
|
|
1313
|
+
}, N(n(kl)[y]), 3)
|
|
1314
|
+
], 10, wl))), 128))
|
|
1308
1315
|
]))), 128))
|
|
1309
1316
|
])
|
|
1310
1317
|
], 2));
|
|
1311
1318
|
}
|
|
1312
|
-
}),
|
|
1319
|
+
}), $l = ["onClick"], Dl = /* @__PURE__ */ le({
|
|
1313
1320
|
name: "XYearTable",
|
|
1314
1321
|
__name: "YearTable",
|
|
1315
1322
|
props: {
|
|
@@ -1319,7 +1326,7 @@ const bl = [
|
|
|
1319
1326
|
},
|
|
1320
1327
|
emits: ["pick"],
|
|
1321
1328
|
setup(s, { emit: k }) {
|
|
1322
|
-
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()), c = V(() =>
|
|
1329
|
+
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()), c = V(() => We(a.viewedYear)), m = V(() => {
|
|
1323
1330
|
const [y] = c.value, R = [];
|
|
1324
1331
|
R.push(y - 1);
|
|
1325
1332
|
for (let H = 0; H < 10; H++)
|
|
@@ -1330,10 +1337,10 @@ const bl = [
|
|
|
1330
1337
|
for (let R = 0; R < m.value.length; R += 3)
|
|
1331
1338
|
y.push(m.value.slice(R, R + 3));
|
|
1332
1339
|
return y;
|
|
1333
|
-
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1, S = (y) => y === l.value,
|
|
1340
|
+
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1, S = (y) => y === l.value, $ = (y) => {
|
|
1334
1341
|
const [R, H] = c.value;
|
|
1335
1342
|
return y >= R && y <= H;
|
|
1336
|
-
},
|
|
1343
|
+
}, D = (y) => {
|
|
1337
1344
|
if (!a.disabledDate) return !1;
|
|
1338
1345
|
const R = new Date(y, 0, 1), H = new Date(y, 11, 31);
|
|
1339
1346
|
return a.disabledDate(R) && a.disabledDate(H);
|
|
@@ -1341,10 +1348,10 @@ const bl = [
|
|
|
1341
1348
|
t.e("cell"),
|
|
1342
1349
|
t.is("selected", T(y)),
|
|
1343
1350
|
t.is("current", S(y)),
|
|
1344
|
-
t.is("disabled",
|
|
1345
|
-
t.is("in-decade",
|
|
1351
|
+
t.is("disabled", D(y)),
|
|
1352
|
+
t.is("in-decade", $(y))
|
|
1346
1353
|
], E = (y) => {
|
|
1347
|
-
|
|
1354
|
+
D(y) || e("pick", y);
|
|
1348
1355
|
};
|
|
1349
1356
|
return (y, R) => (i(), d("table", {
|
|
1350
1357
|
class: u(n(t).b()),
|
|
@@ -1361,12 +1368,12 @@ const bl = [
|
|
|
1361
1368
|
r("span", {
|
|
1362
1369
|
class: u(n(t).e("cell-text"))
|
|
1363
1370
|
}, N(M), 3)
|
|
1364
|
-
], 10,
|
|
1371
|
+
], 10, $l))), 128))
|
|
1365
1372
|
]))), 128))
|
|
1366
1373
|
])
|
|
1367
1374
|
], 2));
|
|
1368
1375
|
}
|
|
1369
|
-
}),
|
|
1376
|
+
}), Sl = ["placeholder", "disabled", "value"], zl = ["placeholder", "disabled", "value"], Tl = ["placeholder", "disabled", "value"], Hl = ["value"], Ll = ["value"], Rl = ["value"], rt = /* @__PURE__ */ le({
|
|
1370
1377
|
name: "XDatePicker",
|
|
1371
1378
|
__name: "index",
|
|
1372
1379
|
props: {
|
|
@@ -1391,7 +1398,7 @@ const bl = [
|
|
|
1391
1398
|
setup(s, { expose: k, emit: a }) {
|
|
1392
1399
|
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
1400
|
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
|
-
},
|
|
1401
|
+
}, $ = B(), D = B(), z = B({
|
|
1395
1402
|
top: "0px",
|
|
1396
1403
|
left: "0px"
|
|
1397
1404
|
}), E = () => Ee().next(), y = B("date"), R = B(/* @__PURE__ */ new Date()), H = B({
|
|
@@ -1439,7 +1446,7 @@ const bl = [
|
|
|
1439
1446
|
}), A = V(() => {
|
|
1440
1447
|
const L = T();
|
|
1441
1448
|
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(() =>
|
|
1449
|
+
}), I = V(() => R.value.getFullYear()), Y = V(() => R.value.getMonth()), G = V(() => We(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
1450
|
l.b(),
|
|
1444
1451
|
l.m(e.size),
|
|
1445
1452
|
l.is("disabled", e.disabled),
|
|
@@ -1452,8 +1459,8 @@ const bl = [
|
|
|
1452
1459
|
e.disabled || e.readonly || (c.value ? g() : f());
|
|
1453
1460
|
}, f = () => {
|
|
1454
1461
|
c.value = !0, m.value = E(), Se(() => {
|
|
1455
|
-
if (b.value &&
|
|
1456
|
-
const L = b.value.getBoundingClientRect(), F =
|
|
1462
|
+
if (b.value && $.value) {
|
|
1463
|
+
const L = b.value.getBoundingClientRect(), F = $.value.getBoundingClientRect();
|
|
1457
1464
|
let W = L.bottom + 8, he = L.left;
|
|
1458
1465
|
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
1466
|
top: `${W}px`,
|
|
@@ -1463,7 +1470,7 @@ const bl = [
|
|
|
1463
1470
|
}), t("focus", {});
|
|
1464
1471
|
}, g = () => {
|
|
1465
1472
|
c.value = !1, y.value = "date", t("blur", {});
|
|
1466
|
-
},
|
|
1473
|
+
}, K = (L) => {
|
|
1467
1474
|
if (e.type === "date") {
|
|
1468
1475
|
e.showTime && (L.setHours(H.value.hours), L.setMinutes(H.value.minutes), L.setSeconds(H.value.seconds));
|
|
1469
1476
|
const F = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, W = F ? ce(L, F) : L;
|
|
@@ -1485,7 +1492,7 @@ const bl = [
|
|
|
1485
1492
|
S(W);
|
|
1486
1493
|
}
|
|
1487
1494
|
g();
|
|
1488
|
-
},
|
|
1495
|
+
}, X = (L) => {
|
|
1489
1496
|
if (!O.value.selecting)
|
|
1490
1497
|
O.value.selecting = !0, O.value.startDate = L, O.value.endDate = null;
|
|
1491
1498
|
else {
|
|
@@ -1506,13 +1513,13 @@ const bl = [
|
|
|
1506
1513
|
} else
|
|
1507
1514
|
y.value = "month";
|
|
1508
1515
|
}, me = () => {
|
|
1509
|
-
R.value =
|
|
1516
|
+
R.value = hl(R.value);
|
|
1510
1517
|
}, ye = () => {
|
|
1511
|
-
R.value =
|
|
1518
|
+
R.value = pl(R.value);
|
|
1512
1519
|
}, ze = () => {
|
|
1513
|
-
y.value === "year" ? R.value = new Date(I.value - 10, Y.value, 1) : R.value =
|
|
1520
|
+
y.value === "year" ? R.value = new Date(I.value - 10, Y.value, 1) : R.value = gl(R.value);
|
|
1514
1521
|
}, we = () => {
|
|
1515
|
-
y.value === "year" ? R.value = new Date(I.value + 10, Y.value, 1) : R.value =
|
|
1522
|
+
y.value === "year" ? R.value = new Date(I.value + 10, Y.value, 1) : R.value = bl(R.value);
|
|
1516
1523
|
}, Te = () => {
|
|
1517
1524
|
y.value = "month";
|
|
1518
1525
|
}, Re = () => {
|
|
@@ -1526,7 +1533,7 @@ const bl = [
|
|
|
1526
1533
|
}, q = (L) => {
|
|
1527
1534
|
if (!b.value) return;
|
|
1528
1535
|
const F = L.target;
|
|
1529
|
-
b.value.contains(F) ||
|
|
1536
|
+
b.value.contains(F) || $.value && $.value.contains(F) || g();
|
|
1530
1537
|
};
|
|
1531
1538
|
ie(
|
|
1532
1539
|
T,
|
|
@@ -1555,11 +1562,11 @@ const bl = [
|
|
|
1555
1562
|
}), k({
|
|
1556
1563
|
focus: () => {
|
|
1557
1564
|
var L;
|
|
1558
|
-
return (L =
|
|
1565
|
+
return (L = D.value) == null ? void 0 : L.focus();
|
|
1559
1566
|
},
|
|
1560
1567
|
blur: () => {
|
|
1561
1568
|
var L;
|
|
1562
|
-
return (L =
|
|
1569
|
+
return (L = D.value) == null ? void 0 : L.blur();
|
|
1563
1570
|
}
|
|
1564
1571
|
}), (L, F) => (i(), d("div", {
|
|
1565
1572
|
ref_key: "pickerRef",
|
|
@@ -1573,21 +1580,21 @@ const bl = [
|
|
|
1573
1580
|
}, [
|
|
1574
1581
|
r("input", {
|
|
1575
1582
|
ref_key: "inputRef",
|
|
1576
|
-
ref:
|
|
1583
|
+
ref: D,
|
|
1577
1584
|
type: "text",
|
|
1578
1585
|
placeholder: s.placeholder,
|
|
1579
1586
|
disabled: s.disabled,
|
|
1580
1587
|
readonly: !0,
|
|
1581
1588
|
value: h.value,
|
|
1582
1589
|
class: u(n(l).e("input-inner"))
|
|
1583
|
-
}, null, 10,
|
|
1590
|
+
}, null, 10, Sl),
|
|
1584
1591
|
r("span", {
|
|
1585
1592
|
class: u(n(l).e("suffix"))
|
|
1586
1593
|
}, [
|
|
1587
1594
|
s.clearable && h.value && !s.disabled ? (i(), d("span", {
|
|
1588
1595
|
key: 0,
|
|
1589
1596
|
class: u(n(l).e("clear")),
|
|
1590
|
-
onClick:
|
|
1597
|
+
onClick: se(P, ["stop"])
|
|
1591
1598
|
}, [
|
|
1592
1599
|
Q(n(ee), {
|
|
1593
1600
|
name: "close",
|
|
@@ -1615,7 +1622,7 @@ const bl = [
|
|
|
1615
1622
|
readonly: !0,
|
|
1616
1623
|
value: v.value,
|
|
1617
1624
|
class: u(n(l).e("input-inner"))
|
|
1618
|
-
}, null, 10,
|
|
1625
|
+
}, null, 10, zl),
|
|
1619
1626
|
r("span", {
|
|
1620
1627
|
class: u(n(l).e("separator"))
|
|
1621
1628
|
}, "至", 2),
|
|
@@ -1626,14 +1633,14 @@ const bl = [
|
|
|
1626
1633
|
readonly: !0,
|
|
1627
1634
|
value: x.value,
|
|
1628
1635
|
class: u(n(l).e("input-inner"))
|
|
1629
|
-
}, null, 10,
|
|
1636
|
+
}, null, 10, Tl),
|
|
1630
1637
|
r("span", {
|
|
1631
1638
|
class: u(n(l).e("suffix"))
|
|
1632
1639
|
}, [
|
|
1633
1640
|
s.clearable && (v.value || x.value) && !s.disabled ? (i(), d("span", {
|
|
1634
1641
|
key: 0,
|
|
1635
1642
|
class: u(n(l).e("clear")),
|
|
1636
|
-
onClick:
|
|
1643
|
+
onClick: se(P, ["stop"])
|
|
1637
1644
|
}, [
|
|
1638
1645
|
Q(n(ee), {
|
|
1639
1646
|
name: "close",
|
|
@@ -1655,7 +1662,7 @@ const bl = [
|
|
|
1655
1662
|
default: He(() => [
|
|
1656
1663
|
oe(r("div", {
|
|
1657
1664
|
ref_key: "popperRef",
|
|
1658
|
-
ref:
|
|
1665
|
+
ref: $,
|
|
1659
1666
|
class: u(n(l).e("popper")),
|
|
1660
1667
|
style: te({ zIndex: m.value, ...z.value })
|
|
1661
1668
|
}, [
|
|
@@ -1690,7 +1697,7 @@ const bl = [
|
|
|
1690
1697
|
r("div", {
|
|
1691
1698
|
class: u(n(l).e("content"))
|
|
1692
1699
|
}, [
|
|
1693
|
-
y.value === "date" ? (i(), fe(
|
|
1700
|
+
y.value === "date" ? (i(), fe(xl, {
|
|
1694
1701
|
key: 0,
|
|
1695
1702
|
"model-value": A.value,
|
|
1696
1703
|
"viewed-month": R.value,
|
|
@@ -1699,15 +1706,15 @@ const bl = [
|
|
|
1699
1706
|
"max-date": s.maxDate ? n(ve)(s.maxDate) : null,
|
|
1700
1707
|
"selection-mode": s.type === "daterange" ? "range" : "single",
|
|
1701
1708
|
"range-state": O.value,
|
|
1702
|
-
onPick:
|
|
1703
|
-
onRangeSelect:
|
|
1704
|
-
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(
|
|
1709
|
+
onPick: K,
|
|
1710
|
+
onRangeSelect: X
|
|
1711
|
+
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(Cl, {
|
|
1705
1712
|
key: 1,
|
|
1706
1713
|
"model-value": A.value,
|
|
1707
1714
|
"viewed-year": I.value,
|
|
1708
1715
|
"disabled-date": s.disabledDate,
|
|
1709
1716
|
onPick: re
|
|
1710
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(
|
|
1717
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(Dl, {
|
|
1711
1718
|
key: 2,
|
|
1712
1719
|
"model-value": A.value,
|
|
1713
1720
|
"viewed-year": I.value,
|
|
@@ -1729,7 +1736,7 @@ const bl = [
|
|
|
1729
1736
|
(i(), d(J, null, _(24, (W) => r("option", {
|
|
1730
1737
|
key: W,
|
|
1731
1738
|
value: W - 1
|
|
1732
|
-
}, N(String(W - 1).padStart(2, "0")), 9,
|
|
1739
|
+
}, N(String(W - 1).padStart(2, "0")), 9, Hl)), 64))
|
|
1733
1740
|
], 2), [
|
|
1734
1741
|
[
|
|
1735
1742
|
Ce,
|
|
@@ -1750,7 +1757,7 @@ const bl = [
|
|
|
1750
1757
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
1751
1758
|
key: W,
|
|
1752
1759
|
value: W - 1
|
|
1753
|
-
}, N(String(W - 1).padStart(2, "0")), 9,
|
|
1760
|
+
}, N(String(W - 1).padStart(2, "0")), 9, Ll)), 64))
|
|
1754
1761
|
], 2), [
|
|
1755
1762
|
[
|
|
1756
1763
|
Ce,
|
|
@@ -1771,7 +1778,7 @@ const bl = [
|
|
|
1771
1778
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
1772
1779
|
key: W,
|
|
1773
1780
|
value: W - 1
|
|
1774
|
-
}, N(String(W - 1).padStart(2, "0")), 9,
|
|
1781
|
+
}, N(String(W - 1).padStart(2, "0")), 9, Rl)), 64))
|
|
1775
1782
|
], 2), [
|
|
1776
1783
|
[
|
|
1777
1784
|
Ce,
|
|
@@ -1827,7 +1834,7 @@ function Ae(s) {
|
|
|
1827
1834
|
function Me(s) {
|
|
1828
1835
|
return String(s).padStart(2, "0");
|
|
1829
1836
|
}
|
|
1830
|
-
const
|
|
1837
|
+
const Bl = ["onClick"], Al = ["onClick"], Fl = ["onClick"], Il = /* @__PURE__ */ le({
|
|
1831
1838
|
name: "XTimePanel",
|
|
1832
1839
|
__name: "TimePanel",
|
|
1833
1840
|
props: {
|
|
@@ -1842,57 +1849,57 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1842
1849
|
},
|
|
1843
1850
|
emits: ["confirm", "cancel"],
|
|
1844
1851
|
setup(s, { emit: k }) {
|
|
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(),
|
|
1846
|
-
const
|
|
1852
|
+
const a = s, e = k, t = ae("time-panel"), l = B(0), c = B(0), m = B(0), b = B(), T = B(), S = B(), $ = V(() => a.format.includes("ss") || a.format.includes("s")), D = V(() => {
|
|
1853
|
+
const X = [], re = Math.max(1, a.hourStep);
|
|
1847
1854
|
for (let j = 0; j < 24; j += re)
|
|
1848
|
-
|
|
1849
|
-
return
|
|
1855
|
+
X.push(j);
|
|
1856
|
+
return X;
|
|
1850
1857
|
}), z = V(() => {
|
|
1851
|
-
const
|
|
1858
|
+
const X = [], re = Math.max(1, a.minuteStep);
|
|
1852
1859
|
for (let j = 0; j < 60; j += re)
|
|
1853
|
-
|
|
1854
|
-
return
|
|
1860
|
+
X.push(j);
|
|
1861
|
+
return X;
|
|
1855
1862
|
}), E = V(() => {
|
|
1856
|
-
const
|
|
1863
|
+
const X = [], re = Math.max(1, a.secondStep);
|
|
1857
1864
|
for (let j = 0; j < 60; j += re)
|
|
1858
|
-
|
|
1859
|
-
return
|
|
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)}${
|
|
1861
|
-
M(
|
|
1862
|
-
}, A = (
|
|
1863
|
-
h(
|
|
1864
|
-
}, I = (
|
|
1865
|
-
v(
|
|
1866
|
-
}, Y = (
|
|
1867
|
-
if (!
|
|
1865
|
+
X.push(j);
|
|
1866
|
+
return X;
|
|
1867
|
+
}), 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)}${$.value ? ":" + Me(m.value) : ""}`), M = (X) => y.value.has(X), h = (X) => R.value.has(X), v = (X) => H.value.has(X), x = (X) => {
|
|
1868
|
+
M(X) || (l.value = X, w(b.value, Y(X)));
|
|
1869
|
+
}, A = (X) => {
|
|
1870
|
+
h(X) || (c.value = X, w(T.value, G(X)));
|
|
1871
|
+
}, I = (X) => {
|
|
1872
|
+
v(X) || (m.value = X, w(S.value, p(X)));
|
|
1873
|
+
}, Y = (X) => D.value.indexOf(X), G = (X) => z.value.indexOf(X), p = (X) => E.value.indexOf(X), w = (X, re) => {
|
|
1874
|
+
if (!X) return;
|
|
1868
1875
|
const j = 32, ye = re * j + 84 - 200 / 2 + j / 2;
|
|
1869
|
-
|
|
1876
|
+
X.scrollTop = Math.max(0, ye);
|
|
1870
1877
|
}, C = () => {
|
|
1871
1878
|
if (!b.value) return;
|
|
1872
|
-
const
|
|
1879
|
+
const X = b.value.scrollTop, re = Math.round((X - 84 + 100) / 32), j = D.value[Math.max(0, Math.min(re, D.value.length - 1))];
|
|
1873
1880
|
j !== void 0 && !M(j) && (l.value = j);
|
|
1874
1881
|
}, o = () => {
|
|
1875
1882
|
if (!T.value) return;
|
|
1876
|
-
const
|
|
1883
|
+
const X = T.value.scrollTop, re = Math.round((X - 84 + 100) / 32), j = z.value[Math.max(0, Math.min(re, z.value.length - 1))];
|
|
1877
1884
|
j !== void 0 && !h(j) && (c.value = j);
|
|
1878
1885
|
}, f = () => {
|
|
1879
1886
|
if (!S.value) return;
|
|
1880
|
-
const
|
|
1887
|
+
const X = S.value.scrollTop, re = Math.round((X - 84 + 100) / 32), j = E.value[Math.max(0, Math.min(re, E.value.length - 1))];
|
|
1881
1888
|
j !== void 0 && !v(j) && (m.value = j);
|
|
1882
1889
|
}, g = () => {
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
},
|
|
1890
|
+
const X = a.modelValue ? new Date(a.modelValue) : /* @__PURE__ */ new Date();
|
|
1891
|
+
X.setHours(l.value, c.value, m.value, 0), e("confirm", X);
|
|
1892
|
+
}, K = () => {
|
|
1886
1893
|
e("cancel");
|
|
1887
1894
|
}, ne = () => {
|
|
1888
1895
|
if (a.modelValue)
|
|
1889
1896
|
l.value = a.modelValue.getHours(), c.value = a.modelValue.getMinutes(), m.value = a.modelValue.getSeconds();
|
|
1890
1897
|
else {
|
|
1891
|
-
const
|
|
1892
|
-
l.value =
|
|
1898
|
+
const X = /* @__PURE__ */ new Date();
|
|
1899
|
+
l.value = X.getHours(), c.value = X.getMinutes(), m.value = X.getSeconds();
|
|
1893
1900
|
}
|
|
1894
1901
|
Se(() => {
|
|
1895
|
-
w(b.value, Y(l.value)), w(T.value, G(c.value)),
|
|
1902
|
+
w(b.value, Y(l.value)), w(T.value, G(c.value)), $.value && w(S.value, p(m.value));
|
|
1896
1903
|
});
|
|
1897
1904
|
};
|
|
1898
1905
|
return ie(
|
|
@@ -1903,7 +1910,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1903
1910
|
{ immediate: !0 }
|
|
1904
1911
|
), ge(() => {
|
|
1905
1912
|
ne();
|
|
1906
|
-
}), (
|
|
1913
|
+
}), (X, re) => (i(), d("div", {
|
|
1907
1914
|
class: u(n(t).b())
|
|
1908
1915
|
}, [
|
|
1909
1916
|
r("div", {
|
|
@@ -1921,11 +1928,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1921
1928
|
r("div", {
|
|
1922
1929
|
class: u(n(t).e("padding"))
|
|
1923
1930
|
}, null, 2),
|
|
1924
|
-
(i(!0), d(J, null, _(
|
|
1931
|
+
(i(!0), d(J, null, _(D.value, (j) => (i(), d("div", {
|
|
1925
1932
|
key: j,
|
|
1926
1933
|
class: u([n(t).e("item"), n(t).is("selected", l.value === j), n(t).is("disabled", M(j))]),
|
|
1927
1934
|
onClick: (me) => x(j)
|
|
1928
|
-
}, N(n(Me)(j)), 11,
|
|
1935
|
+
}, N(n(Me)(j)), 11, Bl))), 128)),
|
|
1929
1936
|
r("div", {
|
|
1930
1937
|
class: u(n(t).e("padding"))
|
|
1931
1938
|
}, null, 2)
|
|
@@ -1943,12 +1950,12 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1943
1950
|
key: j,
|
|
1944
1951
|
class: u([n(t).e("item"), n(t).is("selected", c.value === j), n(t).is("disabled", h(j))]),
|
|
1945
1952
|
onClick: (me) => A(j)
|
|
1946
|
-
}, N(n(Me)(j)), 11,
|
|
1953
|
+
}, N(n(Me)(j)), 11, Al))), 128)),
|
|
1947
1954
|
r("div", {
|
|
1948
1955
|
class: u(n(t).e("padding"))
|
|
1949
1956
|
}, null, 2)
|
|
1950
1957
|
], 34),
|
|
1951
|
-
|
|
1958
|
+
$.value ? (i(), d("div", {
|
|
1952
1959
|
key: 0,
|
|
1953
1960
|
ref_key: "secondListRef",
|
|
1954
1961
|
ref: S,
|
|
@@ -1962,7 +1969,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1962
1969
|
key: j,
|
|
1963
1970
|
class: u([n(t).e("item"), n(t).is("selected", m.value === j), n(t).is("disabled", v(j))]),
|
|
1964
1971
|
onClick: (me) => I(j)
|
|
1965
|
-
}, N(n(Me)(j)), 11,
|
|
1972
|
+
}, N(n(Me)(j)), 11, Fl))), 128)),
|
|
1966
1973
|
r("div", {
|
|
1967
1974
|
class: u(n(t).e("padding"))
|
|
1968
1975
|
}, null, 2)
|
|
@@ -1979,7 +1986,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1979
1986
|
}, [
|
|
1980
1987
|
r("button", {
|
|
1981
1988
|
class: u(n(t).e("btn-cancel")),
|
|
1982
|
-
onClick:
|
|
1989
|
+
onClick: K
|
|
1983
1990
|
}, "取消", 2),
|
|
1984
1991
|
r("button", {
|
|
1985
1992
|
class: u(n(t).e("btn-confirm")),
|
|
@@ -1989,7 +1996,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1989
1996
|
], 2)
|
|
1990
1997
|
], 2));
|
|
1991
1998
|
}
|
|
1992
|
-
}),
|
|
1999
|
+
}), Pl = ["placeholder", "disabled", "value"], El = ["placeholder", "disabled", "value"], Ol = ["placeholder", "disabled", "value"], dt = /* @__PURE__ */ le({
|
|
1993
2000
|
name: "XTimePicker",
|
|
1994
2001
|
__name: "index",
|
|
1995
2002
|
props: {
|
|
@@ -2013,7 +2020,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2013
2020
|
},
|
|
2014
2021
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
2015
2022
|
setup(s, { expose: k, emit: a }) {
|
|
2016
|
-
const e = s, t = a, l = ae("time-picker"), c = () => Ee().next(), m = B(!1), b = B(2e3), T = B(), S = B(),
|
|
2023
|
+
const e = s, t = a, l = ae("time-picker"), c = () => Ee().next(), m = B(!1), b = B(2e3), T = B(), S = B(), $ = B(), D = B({
|
|
2017
2024
|
top: "0px",
|
|
2018
2025
|
left: "0px"
|
|
2019
2026
|
}), z = B({
|
|
@@ -2050,9 +2057,9 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2050
2057
|
m.value = !0, b.value = c(), Se(() => {
|
|
2051
2058
|
if (T.value && S.value) {
|
|
2052
2059
|
const f = T.value.getBoundingClientRect(), g = S.value.getBoundingClientRect();
|
|
2053
|
-
let
|
|
2054
|
-
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8),
|
|
2055
|
-
top: `${
|
|
2060
|
+
let K = f.bottom + 8, ne = f.left;
|
|
2061
|
+
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8), K + g.height > window.innerHeight && (K = f.top - g.height - 8), D.value = {
|
|
2062
|
+
top: `${K}px`,
|
|
2056
2063
|
left: `${ne}px`
|
|
2057
2064
|
};
|
|
2058
2065
|
}
|
|
@@ -2065,8 +2072,8 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2065
2072
|
z.value.startTime = f, E.value = "end", z.value.endTime && z.value.endTime < f && (z.value.endTime = null);
|
|
2066
2073
|
else {
|
|
2067
2074
|
z.value.startTime && f < z.value.startTime ? (z.value.endTime = z.value.startTime, z.value.startTime = f) : z.value.endTime = f;
|
|
2068
|
-
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime,
|
|
2069
|
-
t("update:modelValue", [g,
|
|
2075
|
+
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime, K = e.valueFormat ? ke(z.value.endTime, e.valueFormat) : z.value.endTime;
|
|
2076
|
+
t("update:modelValue", [g, K]), t("change", [g, K]), Y();
|
|
2070
2077
|
}
|
|
2071
2078
|
else {
|
|
2072
2079
|
const g = e.valueFormat ? ke(f, e.valueFormat) : f;
|
|
@@ -2088,10 +2095,10 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2088
2095
|
() => e.modelValue,
|
|
2089
2096
|
(f) => {
|
|
2090
2097
|
if (f && e.type === "timerange") {
|
|
2091
|
-
const [g,
|
|
2098
|
+
const [g, K] = y.value;
|
|
2092
2099
|
z.value = {
|
|
2093
2100
|
startTime: g,
|
|
2094
|
-
endTime:
|
|
2101
|
+
endTime: K
|
|
2095
2102
|
};
|
|
2096
2103
|
}
|
|
2097
2104
|
},
|
|
@@ -2112,11 +2119,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2112
2119
|
}), k({
|
|
2113
2120
|
focus: () => {
|
|
2114
2121
|
var f;
|
|
2115
|
-
return (f =
|
|
2122
|
+
return (f = $.value) == null ? void 0 : f.focus();
|
|
2116
2123
|
},
|
|
2117
2124
|
blur: () => {
|
|
2118
2125
|
var f;
|
|
2119
|
-
return (f =
|
|
2126
|
+
return (f = $.value) == null ? void 0 : f.blur();
|
|
2120
2127
|
}
|
|
2121
2128
|
}), (f, g) => (i(), d("div", {
|
|
2122
2129
|
ref_key: "pickerRef",
|
|
@@ -2130,21 +2137,21 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2130
2137
|
}, [
|
|
2131
2138
|
r("input", {
|
|
2132
2139
|
ref_key: "inputRef",
|
|
2133
|
-
ref:
|
|
2140
|
+
ref: $,
|
|
2134
2141
|
type: "text",
|
|
2135
2142
|
placeholder: s.placeholder,
|
|
2136
2143
|
disabled: s.disabled,
|
|
2137
2144
|
readonly: !0,
|
|
2138
2145
|
value: R.value,
|
|
2139
2146
|
class: u(n(l).e("input-inner"))
|
|
2140
|
-
}, null, 10,
|
|
2147
|
+
}, null, 10, Pl),
|
|
2141
2148
|
r("span", {
|
|
2142
2149
|
class: u(n(l).e("suffix"))
|
|
2143
2150
|
}, [
|
|
2144
2151
|
s.clearable && R.value && !s.disabled ? (i(), d("span", {
|
|
2145
2152
|
key: 0,
|
|
2146
2153
|
class: u(n(l).e("clear")),
|
|
2147
|
-
onClick:
|
|
2154
|
+
onClick: se(w, ["stop"])
|
|
2148
2155
|
}, [
|
|
2149
2156
|
Q(n(ee), {
|
|
2150
2157
|
name: "close",
|
|
@@ -2172,8 +2179,8 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2172
2179
|
readonly: !0,
|
|
2173
2180
|
value: H.value,
|
|
2174
2181
|
class: u([n(l).e("input-inner"), n(l).is("active", E.value === "start")]),
|
|
2175
|
-
onClick: g[0] || (g[0] =
|
|
2176
|
-
}, null, 10,
|
|
2182
|
+
onClick: g[0] || (g[0] = se((K) => A("start"), ["stop"]))
|
|
2183
|
+
}, null, 10, El),
|
|
2177
2184
|
r("span", {
|
|
2178
2185
|
class: u(n(l).e("separator"))
|
|
2179
2186
|
}, "至", 2),
|
|
@@ -2184,15 +2191,15 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2184
2191
|
readonly: !0,
|
|
2185
2192
|
value: O.value,
|
|
2186
2193
|
class: u([n(l).e("input-inner"), n(l).is("active", E.value === "end")]),
|
|
2187
|
-
onClick: g[1] || (g[1] =
|
|
2188
|
-
}, null, 10,
|
|
2194
|
+
onClick: g[1] || (g[1] = se((K) => A("end"), ["stop"]))
|
|
2195
|
+
}, null, 10, Ol),
|
|
2189
2196
|
r("span", {
|
|
2190
2197
|
class: u(n(l).e("suffix"))
|
|
2191
2198
|
}, [
|
|
2192
2199
|
s.clearable && (H.value || O.value) && !s.disabled ? (i(), d("span", {
|
|
2193
2200
|
key: 0,
|
|
2194
2201
|
class: u(n(l).e("clear")),
|
|
2195
|
-
onClick:
|
|
2202
|
+
onClick: se(w, ["stop"])
|
|
2196
2203
|
}, [
|
|
2197
2204
|
Q(n(ee), {
|
|
2198
2205
|
name: "close",
|
|
@@ -2216,13 +2223,13 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2216
2223
|
ref_key: "popperRef",
|
|
2217
2224
|
ref: S,
|
|
2218
2225
|
class: u(n(l).e("popper")),
|
|
2219
|
-
style: te({ zIndex: b.value,
|
|
2226
|
+
style: te({ zIndex: b.value, ...D.value })
|
|
2220
2227
|
}, [
|
|
2221
2228
|
s.type === "timerange" ? (i(), d("div", {
|
|
2222
2229
|
key: 0,
|
|
2223
2230
|
class: u(n(l).e("popper-header"))
|
|
2224
2231
|
}, N(E.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : U("", !0),
|
|
2225
|
-
Q(
|
|
2232
|
+
Q(Il, {
|
|
2226
2233
|
"model-value": M.value,
|
|
2227
2234
|
format: s.format,
|
|
2228
2235
|
"disabled-hours": s.disabledHours,
|
|
@@ -2244,15 +2251,15 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2244
2251
|
], 2));
|
|
2245
2252
|
}
|
|
2246
2253
|
});
|
|
2247
|
-
function
|
|
2254
|
+
function Yl(s, k, a) {
|
|
2248
2255
|
return a ? a(k, s) : s.toLowerCase().includes(k.toLowerCase());
|
|
2249
2256
|
}
|
|
2250
|
-
function
|
|
2257
|
+
function qe(s, k, a = "value", e = "children") {
|
|
2251
2258
|
for (const t of s) {
|
|
2252
2259
|
if (t[a] === k)
|
|
2253
2260
|
return t;
|
|
2254
2261
|
if (t[e] && t[e].length > 0) {
|
|
2255
|
-
const l =
|
|
2262
|
+
const l = qe(t[e], k, a, e);
|
|
2256
2263
|
if (l) return l;
|
|
2257
2264
|
}
|
|
2258
2265
|
}
|
|
@@ -2274,7 +2281,7 @@ function Fe(s, k, a = "value", e = "children") {
|
|
|
2274
2281
|
}
|
|
2275
2282
|
return l(s), t;
|
|
2276
2283
|
}
|
|
2277
|
-
function
|
|
2284
|
+
function Nl(s, k = "children") {
|
|
2278
2285
|
const a = [];
|
|
2279
2286
|
function e(t, l = 0, c = null) {
|
|
2280
2287
|
for (const m of t)
|
|
@@ -2282,7 +2289,7 @@ function Ol(s, k = "children") {
|
|
|
2282
2289
|
}
|
|
2283
2290
|
return e(s), a;
|
|
2284
2291
|
}
|
|
2285
|
-
const
|
|
2292
|
+
const Ul = ["onClick"], Kl = ["placeholder", "disabled", "readonly", "value"], Xl = ["onClick"], Wl = ["onClick"], ct = /* @__PURE__ */ le({
|
|
2286
2293
|
name: "XSelect",
|
|
2287
2294
|
__name: "index",
|
|
2288
2295
|
props: {
|
|
@@ -2329,7 +2336,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2329
2336
|
});
|
|
2330
2337
|
const L = q + 1;
|
|
2331
2338
|
return P.set(L), L;
|
|
2332
|
-
}, b = B(), T = B(), S = B(),
|
|
2339
|
+
}, b = B(), T = B(), S = B(), $ = B(!1), D = B(2e3), z = B(""), E = B(-1), y = B({ top: "0px", left: "0px" }), R = B([]), H = (P) => {
|
|
2333
2340
|
R.value.find((q) => q.value === P.value) || R.value.push(P);
|
|
2334
2341
|
}, O = V(() => e.type === "multiple" || e.mode === "multiple"), M = V(() => e.type === "cascader"), h = B([]), v = V(() => {
|
|
2335
2342
|
const P = e.options && e.options.length > 0 ? e.options : [], q = R.value;
|
|
@@ -2346,14 +2353,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2346
2353
|
return O.value ? Array.isArray(P) ? P : [] : M.value ? Array.isArray(P) ? P : P != null && P !== "" ? [P] : [] : P != null && P !== "" ? [P] : [];
|
|
2347
2354
|
}), I = V(() => {
|
|
2348
2355
|
const P = v.value;
|
|
2349
|
-
return M.value ?
|
|
2356
|
+
return M.value ? Nl(P, e.childrenKey) : P.map((q) => ({ ...q, level: 0 }));
|
|
2350
2357
|
}), Y = V(() => !e.filterable || !z.value ? I.value : I.value.filter((P) => {
|
|
2351
2358
|
const q = P[e.labelKey] || "";
|
|
2352
|
-
return
|
|
2359
|
+
return Yl(q, z.value, e.filterMethod);
|
|
2353
2360
|
})), G = V(() => {
|
|
2354
2361
|
const P = [];
|
|
2355
2362
|
for (const q of A.value) {
|
|
2356
|
-
const Z =
|
|
2363
|
+
const Z = qe(v.value, q, e.valueKey, e.childrenKey);
|
|
2357
2364
|
Z && P.push(Z);
|
|
2358
2365
|
}
|
|
2359
2366
|
return P;
|
|
@@ -2371,9 +2378,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2371
2378
|
l.is("multiple", O.value),
|
|
2372
2379
|
l.is("cascader", M.value),
|
|
2373
2380
|
l.is("filterable", e.filterable),
|
|
2374
|
-
l.is("focus",
|
|
2381
|
+
l.is("focus", $.value)
|
|
2375
2382
|
]), g = () => {
|
|
2376
|
-
if (!b.value || !S.value ||
|
|
2383
|
+
if (!b.value || !S.value || !$.value) return;
|
|
2377
2384
|
const P = b.value.getBoundingClientRect(), q = S.value;
|
|
2378
2385
|
q.offsetHeight;
|
|
2379
2386
|
const Z = q.getBoundingClientRect();
|
|
@@ -2394,15 +2401,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2394
2401
|
left: `${F}px`,
|
|
2395
2402
|
maxHeight: `${W}px`
|
|
2396
2403
|
};
|
|
2397
|
-
},
|
|
2398
|
-
e.disabled || (
|
|
2404
|
+
}, K = () => {
|
|
2405
|
+
e.disabled || ($.value = !0, D.value = m(), z.value = "", Se(() => {
|
|
2399
2406
|
requestAnimationFrame(() => {
|
|
2400
2407
|
g();
|
|
2401
2408
|
});
|
|
2402
2409
|
}), t("visible-change", !0), t("focus", {}));
|
|
2403
2410
|
}, ne = () => {
|
|
2404
|
-
|
|
2405
|
-
},
|
|
2411
|
+
$.value = !1, z.value = "", h.value = [], t("visible-change", !1), t("blur", {});
|
|
2412
|
+
}, X = (P) => {
|
|
2406
2413
|
if (!P.disabled)
|
|
2407
2414
|
if (O.value) {
|
|
2408
2415
|
const q = [...A.value], Z = P[e.valueKey], L = q.indexOf(Z);
|
|
@@ -2439,10 +2446,10 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2439
2446
|
}, ze = (P) => {
|
|
2440
2447
|
if (P.key === "Escape")
|
|
2441
2448
|
ne();
|
|
2442
|
-
else if (P.key === "Enter" &&
|
|
2449
|
+
else if (P.key === "Enter" && $.value) {
|
|
2443
2450
|
const q = Y.value[E.value];
|
|
2444
|
-
q &&
|
|
2445
|
-
} else P.key === "ArrowDown" &&
|
|
2451
|
+
q && X(q);
|
|
2452
|
+
} else P.key === "ArrowDown" && $.value ? (P.preventDefault(), E.value = Math.min(E.value + 1, Y.value.length - 1)) : P.key === "ArrowUp" && $.value && (P.preventDefault(), E.value = Math.max(E.value - 1, 0));
|
|
2446
2453
|
}, we = (P) => A.value.includes(P[e.valueKey]), Te = (P, q) => [
|
|
2447
2454
|
l.e("option"),
|
|
2448
2455
|
l.is("selected", we(P)),
|
|
@@ -2460,11 +2467,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2460
2467
|
document.addEventListener("mousedown", ye), document.addEventListener("keydown", ze);
|
|
2461
2468
|
}), De(() => {
|
|
2462
2469
|
document.removeEventListener("mousedown", ye), document.removeEventListener("keydown", ze), document.removeEventListener("scroll", g, !0);
|
|
2463
|
-
}), ie(
|
|
2470
|
+
}), ie($, (P) => {
|
|
2464
2471
|
P ? document.addEventListener("scroll", g, !0) : document.removeEventListener("scroll", g, !0);
|
|
2465
2472
|
}), $e("select", {
|
|
2466
2473
|
selectedValues: A,
|
|
2467
|
-
handleSelect:
|
|
2474
|
+
handleSelect: X,
|
|
2468
2475
|
isSelected: we,
|
|
2469
2476
|
registerOption: H
|
|
2470
2477
|
}), (P, q) => (i(), d("div", {
|
|
@@ -2474,7 +2481,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2474
2481
|
}, [
|
|
2475
2482
|
r("div", {
|
|
2476
2483
|
class: u(n(l).e("wrapper")),
|
|
2477
|
-
onClick: q[0] || (q[0] = (Z) =>
|
|
2484
|
+
onClick: q[0] || (q[0] = (Z) => $.value ? ne() : K())
|
|
2478
2485
|
}, [
|
|
2479
2486
|
O.value && w.value.length > 0 ? (i(), d("div", {
|
|
2480
2487
|
key: 0,
|
|
@@ -2489,8 +2496,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2489
2496
|
}, N(Z[s.labelKey]), 3),
|
|
2490
2497
|
r("span", {
|
|
2491
2498
|
class: u(n(l).e("tag-close")),
|
|
2492
|
-
onClick:
|
|
2493
|
-
}, "×", 10,
|
|
2499
|
+
onClick: se((L) => re(Z), ["stop"])
|
|
2500
|
+
}, "×", 10, Ul)
|
|
2494
2501
|
], 2))), 128)),
|
|
2495
2502
|
o.value > 0 ? (i(), d("span", {
|
|
2496
2503
|
key: 0,
|
|
@@ -2503,20 +2510,20 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2503
2510
|
class: u(n(l).e("input")),
|
|
2504
2511
|
placeholder: O.value && w.value.length > 0 ? "" : s.placeholder,
|
|
2505
2512
|
disabled: s.disabled,
|
|
2506
|
-
readonly: !s.filterable ||
|
|
2507
|
-
value: s.filterable &&
|
|
2513
|
+
readonly: !s.filterable || !$.value,
|
|
2514
|
+
value: s.filterable && $.value ? z.value : p.value,
|
|
2508
2515
|
onInput: me
|
|
2509
|
-
}, null, 42,
|
|
2516
|
+
}, null, 42, Kl),
|
|
2510
2517
|
r("span", {
|
|
2511
2518
|
class: u(n(l).e("suffix"))
|
|
2512
2519
|
}, [
|
|
2513
2520
|
s.clearable && A.value.length > 0 && !s.disabled ? (i(), d("span", {
|
|
2514
2521
|
key: 0,
|
|
2515
2522
|
class: u(n(l).e("clear")),
|
|
2516
|
-
onClick:
|
|
2523
|
+
onClick: se(j, ["stop"])
|
|
2517
2524
|
}, "×", 2)) : (i(), d("span", {
|
|
2518
2525
|
key: 1,
|
|
2519
|
-
class: u([n(l).e("arrow"), n(l).is("reverse",
|
|
2526
|
+
class: u([n(l).e("arrow"), n(l).is("reverse", $.value)])
|
|
2520
2527
|
}, [
|
|
2521
2528
|
Q(n(ee), {
|
|
2522
2529
|
name: "chevron-down",
|
|
@@ -2532,7 +2539,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2532
2539
|
ref_key: "popperRef",
|
|
2533
2540
|
ref: S,
|
|
2534
2541
|
class: u([n(l).e("popper"), n(l).is("cascader", M.value)]),
|
|
2535
|
-
style: te({ zIndex:
|
|
2542
|
+
style: te({ zIndex: D.value, ...y.value })
|
|
2536
2543
|
}, [
|
|
2537
2544
|
M.value ? (i(), d("div", {
|
|
2538
2545
|
key: 0,
|
|
@@ -2545,7 +2552,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2545
2552
|
(i(!0), d(J, null, _(Z, (F, W) => (i(), d("div", {
|
|
2546
2553
|
key: F[s.valueKey],
|
|
2547
2554
|
class: u(Te(F, W)),
|
|
2548
|
-
onClick:
|
|
2555
|
+
onClick: se((he) => X(F), ["stop", "prevent"])
|
|
2549
2556
|
}, [
|
|
2550
2557
|
r("span", {
|
|
2551
2558
|
class: u(n(l).e("option-label"))
|
|
@@ -2554,7 +2561,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2554
2561
|
key: 0,
|
|
2555
2562
|
class: u(n(l).e("option-arrow"))
|
|
2556
2563
|
}, "›", 2)) : U("", !0)
|
|
2557
|
-
], 10,
|
|
2564
|
+
], 10, Xl))), 128))
|
|
2558
2565
|
], 2))), 128))
|
|
2559
2566
|
], 2)) : (i(), d(J, { key: 1 }, [
|
|
2560
2567
|
Y.value.length === 0 && !n(c).default ? (i(), d("div", {
|
|
@@ -2567,7 +2574,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2567
2574
|
}, [
|
|
2568
2575
|
Q(n(a), null, {
|
|
2569
2576
|
default: He(() => [
|
|
2570
|
-
|
|
2577
|
+
ue(P.$slots, "default")
|
|
2571
2578
|
]),
|
|
2572
2579
|
_: 3
|
|
2573
2580
|
})
|
|
@@ -2578,7 +2585,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2578
2585
|
(i(!0), d(J, null, _(Y.value, (Z, L) => (i(), d("div", {
|
|
2579
2586
|
key: Z[s.valueKey],
|
|
2580
2587
|
class: u(Te(Z, L)),
|
|
2581
|
-
onClick:
|
|
2588
|
+
onClick: se((F) => X(Z), ["stop", "prevent"])
|
|
2582
2589
|
}, [
|
|
2583
2590
|
r("span", {
|
|
2584
2591
|
class: u(n(l).e("option-label"))
|
|
@@ -2587,12 +2594,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2587
2594
|
key: 0,
|
|
2588
2595
|
class: u(n(l).e("option-check"))
|
|
2589
2596
|
}, "✓", 2)) : U("", !0)
|
|
2590
|
-
], 10,
|
|
2597
|
+
], 10, Wl))), 128))
|
|
2591
2598
|
], 2))
|
|
2592
2599
|
], 64))
|
|
2593
2600
|
], 64))
|
|
2594
2601
|
], 6), [
|
|
2595
|
-
[be,
|
|
2602
|
+
[be, $.value]
|
|
2596
2603
|
])
|
|
2597
2604
|
]),
|
|
2598
2605
|
_: 3
|
|
@@ -2600,7 +2607,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2600
2607
|
]))
|
|
2601
2608
|
], 2));
|
|
2602
2609
|
}
|
|
2603
|
-
}),
|
|
2610
|
+
}), vt = /* @__PURE__ */ le({
|
|
2604
2611
|
name: "XSelectOption",
|
|
2605
2612
|
__name: "Option",
|
|
2606
2613
|
props: {
|
|
@@ -2641,7 +2648,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2641
2648
|
}, "✓", 2)) : U("", !0)
|
|
2642
2649
|
], 2));
|
|
2643
2650
|
}
|
|
2644
|
-
}),
|
|
2651
|
+
}), ql = ["checked", "indeterminate"], jl = ["placeholder"], Gl = ["onClick"], Jl = ["checked", "disabled", "onChange"], Zl = ["disabled"], Ql = ["disabled"], _l = ["checked", "indeterminate"], ea = ["placeholder"], la = ["onClick"], aa = ["checked", "disabled", "onChange"], ft = /* @__PURE__ */ le({
|
|
2645
2652
|
name: "XTransfer",
|
|
2646
2653
|
__name: "index",
|
|
2647
2654
|
props: {
|
|
@@ -2668,39 +2675,39 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2668
2675
|
}), b = V(() => {
|
|
2669
2676
|
var o;
|
|
2670
2677
|
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2671
|
-
}), T = B(""), S = B(""),
|
|
2678
|
+
}), T = B(""), S = B(""), $ = B([]), D = B([]), z = (o) => o[c.value], E = (o) => o[m.value], y = (o) => o[b.value] || !1, R = V(() => e.data.filter((o) => {
|
|
2672
2679
|
const f = z(o);
|
|
2673
2680
|
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;
|
|
2674
2681
|
})), H = V(() => {
|
|
2675
2682
|
const o = e.modelValue;
|
|
2676
2683
|
let f = e.data.filter((g) => {
|
|
2677
|
-
const
|
|
2678
|
-
return o.includes(
|
|
2684
|
+
const K = z(g);
|
|
2685
|
+
return o.includes(K);
|
|
2679
2686
|
});
|
|
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,
|
|
2681
|
-
}), O = V(() => R.value.filter((o) =>
|
|
2682
|
-
const o =
|
|
2683
|
-
const
|
|
2684
|
-
return
|
|
2687
|
+
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, K) => o.indexOf(z(g)) - o.indexOf(z(K))) : e.targetOrder === "unshift" ? f.sort((g, K) => o.indexOf(z(K)) - o.indexOf(z(g))) : f;
|
|
2688
|
+
}), O = V(() => R.value.filter((o) => $.value.includes(z(o))).every((o) => y(o))), M = V(() => H.value.filter((o) => D.value.includes(z(o))).every((o) => y(o))), h = V(() => $.value.length === 0 || O.value), v = V(() => D.value.length === 0 || M.value), x = () => {
|
|
2689
|
+
const o = $.value.filter((g) => {
|
|
2690
|
+
const K = e.data.find((ne) => z(ne) === g);
|
|
2691
|
+
return K && !y(K);
|
|
2685
2692
|
});
|
|
2686
2693
|
let f;
|
|
2687
|
-
e.targetOrder === "unshift" ? f = [...o, ...e.modelValue] : f = [...e.modelValue, ...o], t("update:modelValue", f), t("change", f, "right", o),
|
|
2694
|
+
e.targetOrder === "unshift" ? f = [...o, ...e.modelValue] : f = [...e.modelValue, ...o], t("update:modelValue", f), t("change", f, "right", o), $.value = [];
|
|
2688
2695
|
}, A = () => {
|
|
2689
|
-
const o =
|
|
2690
|
-
const
|
|
2691
|
-
return
|
|
2696
|
+
const o = D.value.filter((g) => {
|
|
2697
|
+
const K = e.data.find((ne) => z(ne) === g);
|
|
2698
|
+
return K && !y(K);
|
|
2692
2699
|
}), f = e.modelValue.filter((g) => !o.includes(g));
|
|
2693
|
-
t("update:modelValue", f), t("change", f, "left", o),
|
|
2700
|
+
t("update:modelValue", f), t("change", f, "left", o), D.value = [];
|
|
2694
2701
|
}, I = (o) => {
|
|
2695
|
-
const f = D.value.indexOf(o);
|
|
2696
|
-
f > -1 ? D.value.splice(f, 1) : D.value.push(o), t("left-check-change", [...D.value]);
|
|
2697
|
-
}, Y = (o) => {
|
|
2698
2702
|
const f = $.value.indexOf(o);
|
|
2699
|
-
f > -1 ? $.value.splice(f, 1) : $.value.push(o), t("
|
|
2703
|
+
f > -1 ? $.value.splice(f, 1) : $.value.push(o), t("left-check-change", [...$.value]);
|
|
2704
|
+
}, Y = (o) => {
|
|
2705
|
+
const f = D.value.indexOf(o);
|
|
2706
|
+
f > -1 ? D.value.splice(f, 1) : D.value.push(o), t("right-check-change", [...D.value]);
|
|
2700
2707
|
}, G = () => {
|
|
2701
|
-
|
|
2708
|
+
$.value.length === R.value.filter((o) => !y(o)).length ? $.value = [] : $.value = R.value.filter((o) => !y(o)).map((o) => z(o)), t("left-check-change", [...$.value]);
|
|
2702
2709
|
}, p = () => {
|
|
2703
|
-
|
|
2710
|
+
D.value.length === H.value.filter((o) => !y(o)).length ? D.value = [] : D.value = H.value.filter((o) => !y(o)).map((o) => z(o)), t("right-check-change", [...D.value]);
|
|
2704
2711
|
}, w = (o) => {
|
|
2705
2712
|
o === "left" ? T.value = "" : S.value = "";
|
|
2706
2713
|
}, C = V(() => [l.b()]);
|
|
@@ -2720,15 +2727,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2720
2727
|
}, [
|
|
2721
2728
|
r("input", {
|
|
2722
2729
|
type: "checkbox",
|
|
2723
|
-
checked:
|
|
2724
|
-
indeterminate:
|
|
2730
|
+
checked: $.value.length > 0 && $.value.length === R.value.filter((g) => !y(g)).length,
|
|
2731
|
+
indeterminate: $.value.length > 0 && $.value.length < R.value.filter((g) => !y(g)).length,
|
|
2725
2732
|
onChange: G
|
|
2726
|
-
}, null, 40,
|
|
2733
|
+
}, null, 40, ql),
|
|
2727
2734
|
r("span", null, N(s.titles[0]), 1)
|
|
2728
2735
|
], 2),
|
|
2729
2736
|
r("span", {
|
|
2730
2737
|
class: u(n(l).e("count"))
|
|
2731
|
-
}, N(
|
|
2738
|
+
}, N($.value.length) + " / " + N(R.value.length), 3)
|
|
2732
2739
|
], 2),
|
|
2733
2740
|
s.filterable ? (i(), d("div", {
|
|
2734
2741
|
key: 0,
|
|
@@ -2738,7 +2745,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2738
2745
|
"onUpdate:modelValue": f[0] || (f[0] = (g) => T.value = g),
|
|
2739
2746
|
placeholder: s.filterPlaceholder,
|
|
2740
2747
|
class: u(n(l).e("filter-input"))
|
|
2741
|
-
}, null, 10,
|
|
2748
|
+
}, null, 10, jl), [
|
|
2742
2749
|
[Ve, T.value]
|
|
2743
2750
|
]),
|
|
2744
2751
|
T.value ? (i(), d("span", {
|
|
@@ -2755,29 +2762,29 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2755
2762
|
class: u([
|
|
2756
2763
|
n(l).e("item"),
|
|
2757
2764
|
n(l).is("disabled", y(g)),
|
|
2758
|
-
n(l).is("checked",
|
|
2765
|
+
n(l).is("checked", $.value.includes(z(g)))
|
|
2759
2766
|
]),
|
|
2760
|
-
onClick: (
|
|
2767
|
+
onClick: (K) => !y(g) && I(z(g))
|
|
2761
2768
|
}, [
|
|
2762
2769
|
r("label", {
|
|
2763
2770
|
class: u(n(l).e("checkbox"))
|
|
2764
2771
|
}, [
|
|
2765
2772
|
r("input", {
|
|
2766
2773
|
type: "checkbox",
|
|
2767
|
-
checked:
|
|
2774
|
+
checked: $.value.includes(z(g)),
|
|
2768
2775
|
disabled: y(g),
|
|
2769
|
-
onClick: f[2] || (f[2] =
|
|
2776
|
+
onClick: f[2] || (f[2] = se(() => {
|
|
2770
2777
|
}, ["stop"])),
|
|
2771
|
-
onChange: (
|
|
2772
|
-
}, null, 40,
|
|
2778
|
+
onChange: (K) => I(z(g))
|
|
2779
|
+
}, null, 40, Jl),
|
|
2773
2780
|
r("span", null, N(E(g)), 1)
|
|
2774
2781
|
], 2)
|
|
2775
|
-
], 10,
|
|
2782
|
+
], 10, Gl))), 128)),
|
|
2776
2783
|
R.value.length === 0 ? (i(), d("div", {
|
|
2777
2784
|
key: 0,
|
|
2778
2785
|
class: u(n(l).e("empty"))
|
|
2779
2786
|
}, [
|
|
2780
|
-
|
|
2787
|
+
ue(o.$slots, "left-empty", {}, () => [
|
|
2781
2788
|
f[6] || (f[6] = de("暂无数据", -1))
|
|
2782
2789
|
])
|
|
2783
2790
|
], 2)) : U("", !0)
|
|
@@ -2790,12 +2797,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2790
2797
|
class: u([n(l).e("button"), n(l).is("disabled", h.value)]),
|
|
2791
2798
|
disabled: h.value,
|
|
2792
2799
|
onClick: x
|
|
2793
|
-
}, N(s.buttonTexts[0] || ">"), 11,
|
|
2800
|
+
}, N(s.buttonTexts[0] || ">"), 11, Zl),
|
|
2794
2801
|
r("button", {
|
|
2795
2802
|
class: u([n(l).e("button"), n(l).is("disabled", v.value)]),
|
|
2796
2803
|
disabled: v.value,
|
|
2797
2804
|
onClick: A
|
|
2798
|
-
}, N(s.buttonTexts[1] || "<"), 11,
|
|
2805
|
+
}, N(s.buttonTexts[1] || "<"), 11, Ql)
|
|
2799
2806
|
], 2),
|
|
2800
2807
|
r("div", {
|
|
2801
2808
|
class: u(n(l).e("panel"))
|
|
@@ -2808,15 +2815,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2808
2815
|
}, [
|
|
2809
2816
|
r("input", {
|
|
2810
2817
|
type: "checkbox",
|
|
2811
|
-
checked:
|
|
2812
|
-
indeterminate:
|
|
2818
|
+
checked: D.value.length > 0 && D.value.length === H.value.filter((g) => !y(g)).length,
|
|
2819
|
+
indeterminate: D.value.length > 0 && D.value.length < H.value.filter((g) => !y(g)).length,
|
|
2813
2820
|
onChange: p
|
|
2814
|
-
}, null, 40,
|
|
2821
|
+
}, null, 40, _l),
|
|
2815
2822
|
r("span", null, N(s.titles[1]), 1)
|
|
2816
2823
|
], 2),
|
|
2817
2824
|
r("span", {
|
|
2818
2825
|
class: u(n(l).e("count"))
|
|
2819
|
-
}, N(
|
|
2826
|
+
}, N(D.value.length) + " / " + N(H.value.length), 3)
|
|
2820
2827
|
], 2),
|
|
2821
2828
|
s.filterable ? (i(), d("div", {
|
|
2822
2829
|
key: 0,
|
|
@@ -2826,7 +2833,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2826
2833
|
"onUpdate:modelValue": f[3] || (f[3] = (g) => S.value = g),
|
|
2827
2834
|
placeholder: s.filterPlaceholder,
|
|
2828
2835
|
class: u(n(l).e("filter-input"))
|
|
2829
|
-
}, null, 10,
|
|
2836
|
+
}, null, 10, ea), [
|
|
2830
2837
|
[Ve, S.value]
|
|
2831
2838
|
]),
|
|
2832
2839
|
S.value ? (i(), d("span", {
|
|
@@ -2843,29 +2850,29 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2843
2850
|
class: u([
|
|
2844
2851
|
n(l).e("item"),
|
|
2845
2852
|
n(l).is("disabled", y(g)),
|
|
2846
|
-
n(l).is("checked",
|
|
2853
|
+
n(l).is("checked", D.value.includes(z(g)))
|
|
2847
2854
|
]),
|
|
2848
|
-
onClick: (
|
|
2855
|
+
onClick: (K) => !y(g) && Y(z(g))
|
|
2849
2856
|
}, [
|
|
2850
2857
|
r("label", {
|
|
2851
2858
|
class: u(n(l).e("checkbox"))
|
|
2852
2859
|
}, [
|
|
2853
2860
|
r("input", {
|
|
2854
2861
|
type: "checkbox",
|
|
2855
|
-
checked:
|
|
2862
|
+
checked: D.value.includes(z(g)),
|
|
2856
2863
|
disabled: y(g),
|
|
2857
|
-
onClick: f[5] || (f[5] =
|
|
2864
|
+
onClick: f[5] || (f[5] = se(() => {
|
|
2858
2865
|
}, ["stop"])),
|
|
2859
|
-
onChange: (
|
|
2860
|
-
}, null, 40,
|
|
2866
|
+
onChange: (K) => Y(z(g))
|
|
2867
|
+
}, null, 40, aa),
|
|
2861
2868
|
r("span", null, N(E(g)), 1)
|
|
2862
2869
|
], 2)
|
|
2863
|
-
], 10,
|
|
2870
|
+
], 10, la))), 128)),
|
|
2864
2871
|
H.value.length === 0 ? (i(), d("div", {
|
|
2865
2872
|
key: 0,
|
|
2866
2873
|
class: u(n(l).e("empty"))
|
|
2867
2874
|
}, [
|
|
2868
|
-
|
|
2875
|
+
ue(o.$slots, "right-empty", {}, () => [
|
|
2869
2876
|
f[7] || (f[7] = de("暂无数据", -1))
|
|
2870
2877
|
])
|
|
2871
2878
|
], 2)) : U("", !0)
|
|
@@ -2873,7 +2880,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2873
2880
|
], 2)
|
|
2874
2881
|
], 2));
|
|
2875
2882
|
}
|
|
2876
|
-
}),
|
|
2883
|
+
}), ta = { key: 0 }, na = { key: 1 }, mt = /* @__PURE__ */ le({
|
|
2877
2884
|
name: "XSlider",
|
|
2878
2885
|
__name: "index",
|
|
2879
2886
|
props: {
|
|
@@ -2894,7 +2901,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2894
2901
|
const a = s, e = k, t = ae("slider"), l = B(), c = B(), m = B(!1), b = B(!1), T = V(() => {
|
|
2895
2902
|
const w = a.max - a.min;
|
|
2896
2903
|
return (a.modelValue - a.min) / w * 100;
|
|
2897
|
-
}), S = V(() => a.formatTooltip ? a.formatTooltip(a.modelValue) : a.modelValue),
|
|
2904
|
+
}), S = V(() => a.formatTooltip ? a.formatTooltip(a.modelValue) : a.modelValue), $ = V(() => {
|
|
2898
2905
|
if (!a.showStops || a.min >= a.max) return [];
|
|
2899
2906
|
const w = [], C = (a.max - a.min) / a.step;
|
|
2900
2907
|
for (let o = 0; o <= C; o++) {
|
|
@@ -2902,16 +2909,16 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2902
2909
|
f > a.min && f < a.max && w.push((f - a.min) / (a.max - a.min) * 100);
|
|
2903
2910
|
}
|
|
2904
2911
|
return w;
|
|
2905
|
-
}),
|
|
2912
|
+
}), D = V(() => a.marks ? Object.keys(a.marks).map((w) => {
|
|
2906
2913
|
const C = Number(w), o = a.marks[C], f = (C - a.min) / (a.max - a.min) * 100;
|
|
2907
|
-
let g,
|
|
2908
|
-
return typeof o == "string" ? g = o : (g = o.label || String(C),
|
|
2914
|
+
let g, K = {};
|
|
2915
|
+
return typeof o == "string" ? g = o : (g = o.label || String(C), K = o.style || {}), { value: C, pos: f, label: g, style: K };
|
|
2909
2916
|
}) : []), z = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, E = (w, C) => {
|
|
2910
2917
|
if (!l.value) return a.modelValue;
|
|
2911
2918
|
const o = l.value.getBoundingClientRect(), f = z();
|
|
2912
2919
|
let g;
|
|
2913
2920
|
a.vertical ? g = (o.bottom - C) / f * 100 : g = (w - o.left) / f * 100, g = Math.max(0, Math.min(100, g));
|
|
2914
|
-
const
|
|
2921
|
+
const K = a.min + g / 100 * (a.max - a.min), ne = Math.round(K / a.step) * a.step;
|
|
2915
2922
|
return Math.max(a.min, Math.min(a.max, ne));
|
|
2916
2923
|
}, y = (w) => {
|
|
2917
2924
|
if (a.disabled) return;
|
|
@@ -2967,15 +2974,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2967
2974
|
class: u(n(t).e("bar")),
|
|
2968
2975
|
style: te(G.value)
|
|
2969
2976
|
}, null, 6),
|
|
2970
|
-
s.showStops ? (i(), d("div",
|
|
2971
|
-
(i(!0), d(J, null, _(
|
|
2977
|
+
s.showStops ? (i(), d("div", ta, [
|
|
2978
|
+
(i(!0), d(J, null, _($.value, (o, f) => (i(), d("div", {
|
|
2972
2979
|
key: f,
|
|
2973
2980
|
class: u(n(t).e("stop")),
|
|
2974
2981
|
style: te(s.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2975
2982
|
}, null, 6))), 128))
|
|
2976
2983
|
])) : U("", !0),
|
|
2977
|
-
|
|
2978
|
-
(i(!0), d(J, null, _(
|
|
2984
|
+
D.value.length > 0 ? (i(), d("div", na, [
|
|
2985
|
+
(i(!0), d(J, null, _(D.value, (o) => (i(), d("div", {
|
|
2979
2986
|
key: o.value,
|
|
2980
2987
|
class: u(n(t).e("mark")),
|
|
2981
2988
|
style: te(s.vertical ? { bottom: `${o.pos}%` } : { left: `${o.pos}%`, ...o.style })
|
|
@@ -3006,22 +3013,22 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3006
3013
|
], 34)
|
|
3007
3014
|
], 6));
|
|
3008
3015
|
}
|
|
3009
|
-
}),
|
|
3016
|
+
}), sa = ["src"], ua = {
|
|
3010
3017
|
key: 0,
|
|
3011
3018
|
class: "status-uploading"
|
|
3012
|
-
},
|
|
3019
|
+
}, oa = { class: "progress-circle" }, ia = { class: "progress-text" }, ra = {
|
|
3013
3020
|
key: 1,
|
|
3014
3021
|
class: "status-error"
|
|
3015
|
-
},
|
|
3022
|
+
}, da = {
|
|
3016
3023
|
key: 2,
|
|
3017
3024
|
class: "status-success"
|
|
3018
|
-
},
|
|
3025
|
+
}, ca = {
|
|
3019
3026
|
key: 0,
|
|
3020
3027
|
class: "action-preview"
|
|
3021
|
-
},
|
|
3028
|
+
}, va = ["onClick"], fa = ["disabled"], ma = { class: "progress-text" }, ha = ["onClick"], pa = ["src"], ga = {
|
|
3022
3029
|
key: 0,
|
|
3023
3030
|
class: "action-success"
|
|
3024
|
-
},
|
|
3031
|
+
}, ba = ["onClick"], ya = ["multiple", "accept", "disabled"], ht = /* @__PURE__ */ le({
|
|
3025
3032
|
name: "XUpload",
|
|
3026
3033
|
__name: "index",
|
|
3027
3034
|
props: {
|
|
@@ -3055,7 +3062,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3055
3062
|
Le();
|
|
3056
3063
|
const c = B(), m = B([...e.fileList]), b = B(!1);
|
|
3057
3064
|
let T = 1;
|
|
3058
|
-
const S = () => Date.now() + T++,
|
|
3065
|
+
const S = () => Date.now() + T++, $ = (p) => {
|
|
3059
3066
|
var o;
|
|
3060
3067
|
const w = (o = p.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), C = {
|
|
3061
3068
|
pdf: "📄",
|
|
@@ -3072,7 +3079,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3072
3079
|
default: "📁"
|
|
3073
3080
|
};
|
|
3074
3081
|
return C[w || ""] || C.default;
|
|
3075
|
-
},
|
|
3082
|
+
}, D = V(() => e.limit ? m.value.length < e.limit : !0), z = V(() => [
|
|
3076
3083
|
l.b(),
|
|
3077
3084
|
l.is("disabled", e.disabled),
|
|
3078
3085
|
l.is("drag", e.drag),
|
|
@@ -3196,7 +3203,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3196
3203
|
onDragleave: I,
|
|
3197
3204
|
onDrop: Y
|
|
3198
3205
|
}, [
|
|
3199
|
-
|
|
3206
|
+
ue(p.$slots, "drag", {}, () => [
|
|
3200
3207
|
r("span", {
|
|
3201
3208
|
class: u(n(l).e("drag-icon"))
|
|
3202
3209
|
}, "📁", 2),
|
|
@@ -3219,20 +3226,20 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3219
3226
|
key: 0,
|
|
3220
3227
|
src: C.thumbUrl,
|
|
3221
3228
|
class: u(n(l).e("file-image"))
|
|
3222
|
-
}, null, 10,
|
|
3229
|
+
}, null, 10, sa)) : (i(), d("div", {
|
|
3223
3230
|
key: 1,
|
|
3224
3231
|
class: u(n(l).e("file-status"))
|
|
3225
3232
|
}, [
|
|
3226
|
-
C.status === "uploading" ? (i(), d("span",
|
|
3227
|
-
r("span",
|
|
3228
|
-
r("span",
|
|
3233
|
+
C.status === "uploading" ? (i(), d("span", ua, [
|
|
3234
|
+
r("span", oa, [
|
|
3235
|
+
r("span", ia, N(Math.round(C.percentage || 0)) + "%", 1)
|
|
3229
3236
|
])
|
|
3230
|
-
])) : C.status === "error" ? (i(), d("span",
|
|
3237
|
+
])) : C.status === "error" ? (i(), d("span", ra, [
|
|
3231
3238
|
Q(n(ee), {
|
|
3232
3239
|
name: "close",
|
|
3233
3240
|
size: 16
|
|
3234
3241
|
})
|
|
3235
|
-
])) : C.status === "success" ? (i(), d("span",
|
|
3242
|
+
])) : C.status === "success" ? (i(), d("span", da, [
|
|
3236
3243
|
Q(n(ee), {
|
|
3237
3244
|
name: "check",
|
|
3238
3245
|
size: 16
|
|
@@ -3242,7 +3249,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3242
3249
|
r("span", {
|
|
3243
3250
|
class: u(n(l).e("file-actions"))
|
|
3244
3251
|
}, [
|
|
3245
|
-
C.url ? (i(), d("span",
|
|
3252
|
+
C.url ? (i(), d("span", ca, [
|
|
3246
3253
|
Q(n(ee), {
|
|
3247
3254
|
name: "eye",
|
|
3248
3255
|
size: 14
|
|
@@ -3256,15 +3263,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3256
3263
|
name: "delete",
|
|
3257
3264
|
size: 14
|
|
3258
3265
|
})
|
|
3259
|
-
], 8,
|
|
3266
|
+
], 8, va)
|
|
3260
3267
|
], 2)
|
|
3261
3268
|
], 2))), 128)),
|
|
3262
|
-
|
|
3269
|
+
D.value ? (i(), d("li", {
|
|
3263
3270
|
key: 0,
|
|
3264
3271
|
class: u(n(l).e("upload-card")),
|
|
3265
3272
|
onClick: x
|
|
3266
3273
|
}, [
|
|
3267
|
-
|
|
3274
|
+
ue(p.$slots, "trigger", {}, () => [
|
|
3268
3275
|
w[1] || (w[1] = r("span", { class: "upload-icon" }, "+", -1))
|
|
3269
3276
|
])
|
|
3270
3277
|
], 2)) : U("", !0)
|
|
@@ -3273,17 +3280,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3273
3280
|
class: u(n(l).e("trigger-wrapper")),
|
|
3274
3281
|
onClick: x
|
|
3275
3282
|
}, [
|
|
3276
|
-
|
|
3277
|
-
|
|
3283
|
+
ue(p.$slots, "trigger", {}, () => [
|
|
3284
|
+
D.value ? (i(), d("button", {
|
|
3278
3285
|
key: 0,
|
|
3279
3286
|
type: "button",
|
|
3280
3287
|
class: u(n(l).e("trigger")),
|
|
3281
3288
|
disabled: s.disabled
|
|
3282
3289
|
}, [
|
|
3283
|
-
|
|
3290
|
+
ue(p.$slots, "default", {}, () => [
|
|
3284
3291
|
w[2] || (w[2] = de("点击上传", -1))
|
|
3285
3292
|
])
|
|
3286
|
-
], 10,
|
|
3293
|
+
], 10, fa)) : U("", !0)
|
|
3287
3294
|
])
|
|
3288
3295
|
], 2),
|
|
3289
3296
|
s.showFileList && m.value.length > 0 ? (i(), d("ul", {
|
|
@@ -3297,7 +3304,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3297
3304
|
s.listType === "text" ? (i(), d(J, { key: 0 }, [
|
|
3298
3305
|
r("span", {
|
|
3299
3306
|
class: u(n(l).e("file-icon"))
|
|
3300
|
-
}, N(
|
|
3307
|
+
}, N($(C)), 3),
|
|
3301
3308
|
r("span", {
|
|
3302
3309
|
class: u(n(l).e("file-name"))
|
|
3303
3310
|
}, N(C.name), 3),
|
|
@@ -3312,7 +3319,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3312
3319
|
class: "progress-bar",
|
|
3313
3320
|
style: te({ width: C.percentage + "%" })
|
|
3314
3321
|
}, null, 4),
|
|
3315
|
-
r("span",
|
|
3322
|
+
r("span", ma, N(Math.round(C.percentage || 0)) + "%", 1)
|
|
3316
3323
|
], 2)) : U("", !0),
|
|
3317
3324
|
C.status === "success" ? (i(), d("span", {
|
|
3318
3325
|
key: 1,
|
|
@@ -3343,17 +3350,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3343
3350
|
name: "close",
|
|
3344
3351
|
size: 14
|
|
3345
3352
|
})
|
|
3346
|
-
], 8,
|
|
3353
|
+
], 8, ha)
|
|
3347
3354
|
], 2)
|
|
3348
3355
|
], 64)) : s.listType === "picture" ? (i(), d(J, { key: 1 }, [
|
|
3349
3356
|
C.thumbUrl ? (i(), d("img", {
|
|
3350
3357
|
key: 0,
|
|
3351
3358
|
src: C.thumbUrl,
|
|
3352
3359
|
class: u(n(l).e("file-thumb"))
|
|
3353
|
-
}, null, 10,
|
|
3360
|
+
}, null, 10, pa)) : (i(), d("span", {
|
|
3354
3361
|
key: 1,
|
|
3355
3362
|
class: u(n(l).e("file-icon"))
|
|
3356
|
-
}, N(
|
|
3363
|
+
}, N($(C)), 3)),
|
|
3357
3364
|
r("div", {
|
|
3358
3365
|
class: u(n(l).e("file-info"))
|
|
3359
3366
|
}, [
|
|
@@ -3373,7 +3380,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3373
3380
|
r("span", {
|
|
3374
3381
|
class: u(n(l).e("file-actions"))
|
|
3375
3382
|
}, [
|
|
3376
|
-
C.status === "success" ? (i(), d("span",
|
|
3383
|
+
C.status === "success" ? (i(), d("span", ga, [
|
|
3377
3384
|
Q(n(ee), {
|
|
3378
3385
|
name: "check",
|
|
3379
3386
|
size: 14
|
|
@@ -3387,7 +3394,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3387
3394
|
name: "close",
|
|
3388
3395
|
size: 14
|
|
3389
3396
|
})
|
|
3390
|
-
], 8,
|
|
3397
|
+
], 8, ba)
|
|
3391
3398
|
], 2)
|
|
3392
3399
|
], 64)) : U("", !0)
|
|
3393
3400
|
], 2))), 128))
|
|
@@ -3402,16 +3409,16 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3402
3409
|
accept: s.accept,
|
|
3403
3410
|
disabled: s.disabled,
|
|
3404
3411
|
onChange: E
|
|
3405
|
-
}, null, 42,
|
|
3412
|
+
}, null, 42, ya),
|
|
3406
3413
|
p.$slots.tip ? (i(), d("div", {
|
|
3407
3414
|
key: 3,
|
|
3408
3415
|
class: u(n(l).e("tip"))
|
|
3409
3416
|
}, [
|
|
3410
|
-
|
|
3417
|
+
ue(p.$slots, "tip")
|
|
3411
3418
|
], 2)) : U("", !0)
|
|
3412
3419
|
], 2));
|
|
3413
3420
|
}
|
|
3414
|
-
}),
|
|
3421
|
+
}), ka = ["onMousemove", "onClick"], pt = /* @__PURE__ */ le({
|
|
3415
3422
|
name: "XRate",
|
|
3416
3423
|
__name: "index",
|
|
3417
3424
|
props: {
|
|
@@ -3445,7 +3452,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3445
3452
|
]), 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) => {
|
|
3446
3453
|
const R = c.value;
|
|
3447
3454
|
return R >= y ? 100 : a.allowHalf && R >= y - 0.5 ? 50 : 0;
|
|
3448
|
-
}, S = (y) => T(y) > 0 ? b(c.value) : a.disabled ? a.disabledVoidColor : a.voidColor,
|
|
3455
|
+
}, S = (y) => T(y) > 0 ? b(c.value) : a.disabled ? a.disabledVoidColor : a.voidColor, $ = V(() => {
|
|
3449
3456
|
if (a.showScore)
|
|
3450
3457
|
return a.scoreTemplate.replace("{value}", String(a.modelValue));
|
|
3451
3458
|
if (a.showText) {
|
|
@@ -3453,7 +3460,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3453
3460
|
return a.texts[Math.max(0, y)] || "";
|
|
3454
3461
|
}
|
|
3455
3462
|
return "";
|
|
3456
|
-
}),
|
|
3463
|
+
}), D = (y, R) => {
|
|
3457
3464
|
if (!(a.disabled || a.readonly))
|
|
3458
3465
|
if (a.allowHalf) {
|
|
3459
3466
|
const O = R.currentTarget.getBoundingClientRect(), M = R.clientX - O.left < O.width / 2;
|
|
@@ -3482,7 +3489,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3482
3489
|
(i(!0), d(J, null, _(s.max, (H) => (i(), d("span", {
|
|
3483
3490
|
key: H,
|
|
3484
3491
|
class: u(n(t).e("item")),
|
|
3485
|
-
onMousemove: (O) =>
|
|
3492
|
+
onMousemove: (O) => D(H, O),
|
|
3486
3493
|
onClick: (O) => E(H, O)
|
|
3487
3494
|
}, [
|
|
3488
3495
|
r("span", {
|
|
@@ -3496,19 +3503,19 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3496
3503
|
clipPath: `inset(0 ${100 - T(H)}% 0 0)`
|
|
3497
3504
|
})
|
|
3498
3505
|
}, N(s.icon), 7)
|
|
3499
|
-
], 42,
|
|
3506
|
+
], 42, ka))), 128))
|
|
3500
3507
|
], 2),
|
|
3501
3508
|
s.showText || s.showScore ? (i(), d("div", {
|
|
3502
3509
|
key: 0,
|
|
3503
3510
|
class: u(n(t).e("text")),
|
|
3504
3511
|
style: te({ color: s.textColor })
|
|
3505
|
-
}, N(
|
|
3512
|
+
}, N($.value), 7)) : U("", !0)
|
|
3506
3513
|
], 34));
|
|
3507
3514
|
}
|
|
3508
|
-
}),
|
|
3515
|
+
}), Ma = ["value"], Va = { class: "field-type" }, xa = { class: "field-name" }, wa = { class: "field-label" }, Ca = {
|
|
3509
3516
|
key: 0,
|
|
3510
3517
|
class: "field-required"
|
|
3511
|
-
},
|
|
3518
|
+
}, $a = ["onClick"], Da = ["onClick"], Sa = ["onClick"], za = ["onClick"], Ta = { class: "modal-content" }, Ha = { class: "modal-header" }, La = { class: "modal-body" }, Ra = { class: "edit-field" }, Ba = { class: "edit-field" }, Aa = { class: "edit-field" }, Fa = ["value"], Ia = { class: "edit-field" }, Pa = { class: "edit-field" }, gt = /* @__PURE__ */ le({
|
|
3512
3519
|
name: "XDynamicFields",
|
|
3513
3520
|
__name: "index",
|
|
3514
3521
|
props: {
|
|
@@ -3535,7 +3542,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3535
3542
|
ie(() => a.fields, (h) => {
|
|
3536
3543
|
l.value = [...h].sort((v, x) => (v.order || 0) - (x.order || 0));
|
|
3537
3544
|
}, { immediate: !0, deep: !0 });
|
|
3538
|
-
const S = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`,
|
|
3545
|
+
const S = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, $ = () => {
|
|
3539
3546
|
if (!T.value) return;
|
|
3540
3547
|
const h = {
|
|
3541
3548
|
id: S(),
|
|
@@ -3546,7 +3553,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3546
3553
|
order: l.value.length
|
|
3547
3554
|
};
|
|
3548
3555
|
l.value.push(h), e("add", h), e("update:fields", l.value);
|
|
3549
|
-
},
|
|
3556
|
+
}, D = (h) => {
|
|
3550
3557
|
const v = l.value.findIndex((x) => x.id === h);
|
|
3551
3558
|
v !== -1 && (l.value[v], l.value.splice(v, 1), e("remove", h), e("update:fields", l.value));
|
|
3552
3559
|
}, z = (h) => {
|
|
@@ -3592,13 +3599,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3592
3599
|
(i(!0), d(J, null, _(s.availableTypes, (x) => (i(), d("option", {
|
|
3593
3600
|
key: x.value,
|
|
3594
3601
|
value: x.value
|
|
3595
|
-
}, N(x.label), 9,
|
|
3602
|
+
}, N(x.label), 9, Ma))), 128))
|
|
3596
3603
|
], 2), [
|
|
3597
3604
|
[Ce, m.value]
|
|
3598
3605
|
]),
|
|
3599
3606
|
r("button", {
|
|
3600
3607
|
class: u(n(t).e("add-btn")),
|
|
3601
|
-
onClick:
|
|
3608
|
+
onClick: $
|
|
3602
3609
|
}, " + 添加字段 ", 2)
|
|
3603
3610
|
], 2)) : U("", !0),
|
|
3604
3611
|
r("div", {
|
|
@@ -3611,10 +3618,10 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3611
3618
|
r("div", {
|
|
3612
3619
|
class: u(n(t).e("info"))
|
|
3613
3620
|
}, [
|
|
3614
|
-
r("span",
|
|
3615
|
-
r("span",
|
|
3616
|
-
r("span",
|
|
3617
|
-
x.required ? (i(), d("span",
|
|
3621
|
+
r("span", Va, N(M(x.type)), 1),
|
|
3622
|
+
r("span", xa, N(x.name), 1),
|
|
3623
|
+
r("span", wa, N(x.label), 1),
|
|
3624
|
+
x.required ? (i(), d("span", Ca, "必填")) : U("", !0)
|
|
3618
3625
|
], 2),
|
|
3619
3626
|
s.editable ? (i(), d("div", {
|
|
3620
3627
|
key: 0,
|
|
@@ -3630,7 +3637,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3630
3637
|
name: "move-up",
|
|
3631
3638
|
size: 14
|
|
3632
3639
|
})
|
|
3633
|
-
], 8,
|
|
3640
|
+
], 8, $a)) : U("", !0),
|
|
3634
3641
|
s.showSort ? (i(), d("button", {
|
|
3635
3642
|
key: 1,
|
|
3636
3643
|
class: "action-btn",
|
|
@@ -3641,7 +3648,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3641
3648
|
name: "move-down",
|
|
3642
3649
|
size: 14
|
|
3643
3650
|
})
|
|
3644
|
-
], 8,
|
|
3651
|
+
], 8, Da)) : U("", !0),
|
|
3645
3652
|
r("button", {
|
|
3646
3653
|
class: "action-btn",
|
|
3647
3654
|
title: "编辑",
|
|
@@ -3651,17 +3658,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3651
3658
|
name: "edit",
|
|
3652
3659
|
size: 14
|
|
3653
3660
|
})
|
|
3654
|
-
], 8,
|
|
3661
|
+
], 8, Sa),
|
|
3655
3662
|
r("button", {
|
|
3656
3663
|
class: "action-btn action-btn--danger",
|
|
3657
3664
|
title: "删除",
|
|
3658
|
-
onClick: (A) =>
|
|
3665
|
+
onClick: (A) => D(x.id)
|
|
3659
3666
|
}, [
|
|
3660
3667
|
Q(n(ee), {
|
|
3661
3668
|
name: "close",
|
|
3662
3669
|
size: 14
|
|
3663
3670
|
})
|
|
3664
|
-
], 8,
|
|
3671
|
+
], 8, za)
|
|
3665
3672
|
], 2)) : U("", !0)
|
|
3666
3673
|
], 2))), 128))
|
|
3667
3674
|
], 2),
|
|
@@ -3675,8 +3682,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3675
3682
|
key: 2,
|
|
3676
3683
|
class: u(n(t).e("edit-modal"))
|
|
3677
3684
|
}, [
|
|
3678
|
-
r("div",
|
|
3679
|
-
r("div",
|
|
3685
|
+
r("div", Ta, [
|
|
3686
|
+
r("div", Ha, [
|
|
3680
3687
|
v[7] || (v[7] = r("span", null, "编辑字段", -1)),
|
|
3681
3688
|
r("button", {
|
|
3682
3689
|
class: "close-btn",
|
|
@@ -3688,8 +3695,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3688
3695
|
})
|
|
3689
3696
|
])
|
|
3690
3697
|
]),
|
|
3691
|
-
r("div",
|
|
3692
|
-
r("div",
|
|
3698
|
+
r("div", La, [
|
|
3699
|
+
r("div", Ra, [
|
|
3693
3700
|
v[8] || (v[8] = r("label", null, "字段名称", -1)),
|
|
3694
3701
|
oe(r("input", {
|
|
3695
3702
|
"onUpdate:modelValue": v[1] || (v[1] = (x) => c.value.name = x),
|
|
@@ -3699,7 +3706,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3699
3706
|
[Ve, c.value.name]
|
|
3700
3707
|
])
|
|
3701
3708
|
]),
|
|
3702
|
-
r("div",
|
|
3709
|
+
r("div", Ba, [
|
|
3703
3710
|
v[9] || (v[9] = r("label", null, "字段标签", -1)),
|
|
3704
3711
|
oe(r("input", {
|
|
3705
3712
|
"onUpdate:modelValue": v[2] || (v[2] = (x) => c.value.label = x),
|
|
@@ -3709,7 +3716,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3709
3716
|
[Ve, c.value.label]
|
|
3710
3717
|
])
|
|
3711
3718
|
]),
|
|
3712
|
-
r("div",
|
|
3719
|
+
r("div", Aa, [
|
|
3713
3720
|
v[10] || (v[10] = r("label", null, "字段类型", -1)),
|
|
3714
3721
|
oe(r("select", {
|
|
3715
3722
|
"onUpdate:modelValue": v[3] || (v[3] = (x) => c.value.type = x)
|
|
@@ -3717,19 +3724,19 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3717
3724
|
(i(!0), d(J, null, _(s.availableTypes, (x) => (i(), d("option", {
|
|
3718
3725
|
key: x.value,
|
|
3719
3726
|
value: x.value
|
|
3720
|
-
}, N(x.label), 9,
|
|
3727
|
+
}, N(x.label), 9, Fa))), 128))
|
|
3721
3728
|
], 512), [
|
|
3722
3729
|
[Ce, c.value.type]
|
|
3723
3730
|
])
|
|
3724
3731
|
]),
|
|
3725
|
-
r("div",
|
|
3732
|
+
r("div", Ia, [
|
|
3726
3733
|
v[11] || (v[11] = r("label", null, "是否必填", -1)),
|
|
3727
3734
|
r("button", {
|
|
3728
3735
|
class: u(["switch-btn", { "is-on": c.value.required }]),
|
|
3729
3736
|
onClick: v[4] || (v[4] = (x) => c.value.required = !c.value.required)
|
|
3730
3737
|
}, N(c.value.required ? "必填" : "可选"), 3)
|
|
3731
3738
|
]),
|
|
3732
|
-
r("div",
|
|
3739
|
+
r("div", Pa, [
|
|
3733
3740
|
v[12] || (v[12] = r("label", null, "占位文本", -1)),
|
|
3734
3741
|
oe(r("input", {
|
|
3735
3742
|
"onUpdate:modelValue": v[5] || (v[5] = (x) => c.value.placeholder = x),
|
|
@@ -3754,7 +3761,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3754
3761
|
], 2)) : U("", !0)
|
|
3755
3762
|
], 2));
|
|
3756
3763
|
}
|
|
3757
|
-
}),
|
|
3764
|
+
}), bt = /* @__PURE__ */ le({
|
|
3758
3765
|
name: "XRichEditor",
|
|
3759
3766
|
__name: "index",
|
|
3760
3767
|
props: {
|
|
@@ -3768,11 +3775,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3768
3775
|
},
|
|
3769
3776
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
3770
3777
|
setup(s, { expose: k, emit: a }) {
|
|
3771
|
-
const e = s, t = a, l =
|
|
3778
|
+
const e = s, t = a, l = Ue(
|
|
3772
3779
|
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Editor)
|
|
3773
|
-
), c =
|
|
3780
|
+
), c = Ue(
|
|
3774
3781
|
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Toolbar)
|
|
3775
|
-
), m =
|
|
3782
|
+
), m = Je(), b = B(e.modelValue), T = B(!1);
|
|
3776
3783
|
ge(() => {
|
|
3777
3784
|
T.value = !0;
|
|
3778
3785
|
}), ie(
|
|
@@ -3781,7 +3788,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3781
3788
|
v !== b.value && (b.value = v);
|
|
3782
3789
|
}
|
|
3783
3790
|
);
|
|
3784
|
-
const S = V(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height })),
|
|
3791
|
+
const S = V(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height })), $ = V(() => {
|
|
3785
3792
|
const v = {
|
|
3786
3793
|
excludeKeys: []
|
|
3787
3794
|
};
|
|
@@ -3844,7 +3851,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3844
3851
|
v.excludeKeys = x.filter((A) => !e.toolbar.includes(A));
|
|
3845
3852
|
}
|
|
3846
3853
|
return v;
|
|
3847
|
-
}),
|
|
3854
|
+
}), D = V(() => ({
|
|
3848
3855
|
placeholder: e.placeholder,
|
|
3849
3856
|
readOnly: e.disabled,
|
|
3850
3857
|
autoFocus: e.autoFocus,
|
|
@@ -3888,7 +3895,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3888
3895
|
var v;
|
|
3889
3896
|
b.value = "", (v = m.value) == null || v.clear();
|
|
3890
3897
|
}
|
|
3891
|
-
}),
|
|
3898
|
+
}), Ze(() => {
|
|
3892
3899
|
const v = m.value;
|
|
3893
3900
|
v && v.destroy();
|
|
3894
3901
|
}), (v, x) => (i(), d("div", {
|
|
@@ -3898,14 +3905,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3898
3905
|
s.toolbar !== !1 ? (i(), fe(n(c), {
|
|
3899
3906
|
key: 0,
|
|
3900
3907
|
editor: m.value,
|
|
3901
|
-
"default-config":
|
|
3908
|
+
"default-config": $.value,
|
|
3902
3909
|
mode: s.mode,
|
|
3903
3910
|
class: "x-rich-editor__toolbar"
|
|
3904
3911
|
}, null, 8, ["editor", "default-config", "mode"])) : U("", !0),
|
|
3905
3912
|
Q(n(l), {
|
|
3906
3913
|
modelValue: b.value,
|
|
3907
3914
|
"onUpdate:modelValue": x[0] || (x[0] = (A) => b.value = A),
|
|
3908
|
-
"default-config":
|
|
3915
|
+
"default-config": D.value,
|
|
3909
3916
|
mode: s.mode,
|
|
3910
3917
|
style: te(S.value),
|
|
3911
3918
|
class: "x-rich-editor__content",
|
|
@@ -3921,7 +3928,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3921
3928
|
}, N(s.placeholder), 5))
|
|
3922
3929
|
], 2));
|
|
3923
3930
|
}
|
|
3924
|
-
}),
|
|
3931
|
+
}), Ea = ["value", "placeholder"], Oa = ["onClick"], Ya = ["onClick"], Na = ["checked", "onChange"], yt = /* @__PURE__ */ le({
|
|
3925
3932
|
name: "XCascader",
|
|
3926
3933
|
__name: "index",
|
|
3927
3934
|
props: {
|
|
@@ -3947,7 +3954,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3947
3954
|
children: a.props.children || "children",
|
|
3948
3955
|
disabled: a.props.disabled || "disabled"
|
|
3949
3956
|
}));
|
|
3950
|
-
const S = V(() => a.props.multiple),
|
|
3957
|
+
const S = V(() => a.props.multiple), $ = V(() => a.props.checkStrictly), D = V(() => {
|
|
3951
3958
|
if (S.value)
|
|
3952
3959
|
return m.value.length === 0 ? "" : m.value.map((w) => y(w)).join(", ");
|
|
3953
3960
|
if (c.value.length === 0) return "";
|
|
@@ -3974,18 +3981,18 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3974
3981
|
const p = [], w = (C, o = []) => {
|
|
3975
3982
|
var f;
|
|
3976
3983
|
for (const g of C) {
|
|
3977
|
-
const
|
|
3984
|
+
const K = [...o, g];
|
|
3978
3985
|
g.label.toLowerCase().includes(b.value.toLowerCase()) && p.push({
|
|
3979
|
-
path:
|
|
3980
|
-
label:
|
|
3981
|
-
}), (f = g.children) != null && f.length && w(g.children,
|
|
3986
|
+
path: K,
|
|
3987
|
+
label: K.map((ne) => ne.label).join(a.separator)
|
|
3988
|
+
}), (f = g.children) != null && f.length && w(g.children, K);
|
|
3982
3989
|
}
|
|
3983
3990
|
};
|
|
3984
3991
|
return w(a.options), p;
|
|
3985
3992
|
}), y = (p) => p.map((w, C) => R(w, p.slice(0, C + 1))).join(a.separator), R = (p, w) => {
|
|
3986
3993
|
let C = a.options;
|
|
3987
3994
|
for (let f = 0; f < w.length - 1; f++) {
|
|
3988
|
-
const g = C.find((
|
|
3995
|
+
const g = C.find((K) => K.value === w[f]);
|
|
3989
3996
|
g != null && g.children && (C = g.children);
|
|
3990
3997
|
}
|
|
3991
3998
|
const o = C.find((f) => f.value === p);
|
|
@@ -3994,7 +4001,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3994
4001
|
var o;
|
|
3995
4002
|
if (p.disabled) return;
|
|
3996
4003
|
const C = c.value.slice(0, w);
|
|
3997
|
-
C.push(p.value), c.value = C, (!((o = p.children) != null && o.length) ||
|
|
4004
|
+
C.push(p.value), c.value = C, (!((o = p.children) != null && o.length) || $.value) && (S.value || (l.value = !1, v(C)));
|
|
3998
4005
|
}, O = (p, w, C) => {
|
|
3999
4006
|
const o = [...c.value.slice(0, w), p.value];
|
|
4000
4007
|
C ? m.value.some((f) => JSON.stringify(f) === JSON.stringify(o)) || m.value.push(o) : m.value = m.value.filter((f) => JSON.stringify(f) !== JSON.stringify(o)), x();
|
|
@@ -4022,7 +4029,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4022
4029
|
S.value ? m.value = Array.isArray(p) ? p : [] : Array.isArray(p) ? c.value = p : p !== "" && p !== null && p !== void 0 ? c.value = [p] : c.value = [];
|
|
4023
4030
|
}, { immediate: !0 }), (p, w) => (i(), d("div", {
|
|
4024
4031
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4025
|
-
onClick: w[2] || (w[2] =
|
|
4032
|
+
onClick: w[2] || (w[2] = se(() => {
|
|
4026
4033
|
}, ["stop"]))
|
|
4027
4034
|
}, [
|
|
4028
4035
|
r("div", {
|
|
@@ -4032,24 +4039,24 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4032
4039
|
s.filterable && l.value ? (i(), d("input", {
|
|
4033
4040
|
key: 0,
|
|
4034
4041
|
value: b.value,
|
|
4035
|
-
placeholder:
|
|
4042
|
+
placeholder: D.value || s.placeholder,
|
|
4036
4043
|
class: u(n(t).e("filter-input")),
|
|
4037
4044
|
onInput: I
|
|
4038
|
-
}, null, 42,
|
|
4045
|
+
}, null, 42, Ea)) : (i(), d("span", {
|
|
4039
4046
|
key: 1,
|
|
4040
4047
|
class: u(n(t).e("text"))
|
|
4041
4048
|
}, [
|
|
4042
|
-
|
|
4043
|
-
de(N(
|
|
4049
|
+
D.value ? (i(), d(J, { key: 0 }, [
|
|
4050
|
+
de(N(D.value), 1)
|
|
4044
4051
|
], 64)) : (i(), d("span", {
|
|
4045
4052
|
key: 1,
|
|
4046
4053
|
class: u(n(t).e("placeholder"))
|
|
4047
4054
|
}, N(s.placeholder), 3))
|
|
4048
4055
|
], 2)),
|
|
4049
|
-
s.clearable &&
|
|
4056
|
+
s.clearable && D.value ? (i(), d("span", {
|
|
4050
4057
|
key: 2,
|
|
4051
4058
|
class: u(n(t).e("clear")),
|
|
4052
|
-
onClick:
|
|
4059
|
+
onClick: se(A, ["stop"])
|
|
4053
4060
|
}, [
|
|
4054
4061
|
Q(n(ee), {
|
|
4055
4062
|
name: "close-circle",
|
|
@@ -4076,7 +4083,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4076
4083
|
key: o,
|
|
4077
4084
|
class: u(n(t).e("filter-item")),
|
|
4078
4085
|
onClick: (f) => Y(C.path)
|
|
4079
|
-
}, N(C.label), 11,
|
|
4086
|
+
}, N(C.label), 11, Oa))), 128)),
|
|
4080
4087
|
E.value.length === 0 ? (i(), d("div", {
|
|
4081
4088
|
key: 0,
|
|
4082
4089
|
class: u(n(t).e("empty"))
|
|
@@ -4100,19 +4107,19 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4100
4107
|
n(t).is("active", h(f, o)),
|
|
4101
4108
|
n(t).is("disabled", f.disabled)
|
|
4102
4109
|
]),
|
|
4103
|
-
onClick: (
|
|
4110
|
+
onClick: (K) => H(f, o)
|
|
4104
4111
|
}, [
|
|
4105
4112
|
S.value ? (i(), d("span", {
|
|
4106
4113
|
key: 0,
|
|
4107
4114
|
class: u(n(t).e("checkbox")),
|
|
4108
|
-
onClick: w[1] || (w[1] =
|
|
4115
|
+
onClick: w[1] || (w[1] = se(() => {
|
|
4109
4116
|
}, ["stop"]))
|
|
4110
4117
|
}, [
|
|
4111
4118
|
r("input", {
|
|
4112
4119
|
type: "checkbox",
|
|
4113
4120
|
checked: M(f, o),
|
|
4114
|
-
onChange: (
|
|
4115
|
-
}, null, 40,
|
|
4121
|
+
onChange: (K) => O(f, o, K.target.checked)
|
|
4122
|
+
}, null, 40, Na)
|
|
4116
4123
|
], 2)) : U("", !0),
|
|
4117
4124
|
r("span", {
|
|
4118
4125
|
class: u(n(t).e("label"))
|
|
@@ -4126,7 +4133,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4126
4133
|
size: 12
|
|
4127
4134
|
})
|
|
4128
4135
|
], 2)) : U("", !0)
|
|
4129
|
-
], 10,
|
|
4136
|
+
], 10, Ya);
|
|
4130
4137
|
}), 128))
|
|
4131
4138
|
], 2))), 128))
|
|
4132
4139
|
], 2))
|
|
@@ -4135,7 +4142,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4135
4142
|
])
|
|
4136
4143
|
], 2));
|
|
4137
4144
|
}
|
|
4138
|
-
}),
|
|
4145
|
+
}), Ua = ["onClick"], kt = /* @__PURE__ */ le({
|
|
4139
4146
|
name: "XColorPicker",
|
|
4140
4147
|
__name: "index",
|
|
4141
4148
|
props: {
|
|
@@ -4147,18 +4154,18 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4147
4154
|
},
|
|
4148
4155
|
emits: ["update:modelValue", "change"],
|
|
4149
4156
|
setup(s, { emit: k }) {
|
|
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(),
|
|
4157
|
+
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(), $ = B(), D = V(() => y(c.value, m.value, b.value)), z = V(() => a.showAlpha ? `${D.value}${Math.round(T.value * 2.55).toString(16).padStart(2, "0")}` : D.value), E = V(() => a.modelValue || D.value), y = (I, Y, G) => {
|
|
4151
4158
|
Y /= 100, G /= 100;
|
|
4152
4159
|
const p = G * Y, w = p * (1 - Math.abs(I / 60 % 2 - 1)), C = G - p;
|
|
4153
4160
|
let o = 0, f = 0, g = 0;
|
|
4154
4161
|
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);
|
|
4155
|
-
const
|
|
4156
|
-
return `#${
|
|
4162
|
+
const K = (ne) => Math.round((ne + C) * 255).toString(16).padStart(2, "0");
|
|
4163
|
+
return `#${K(o)}${K(f)}${K(g)}`;
|
|
4157
4164
|
}, R = (I) => {
|
|
4158
4165
|
I = I.replace("#", "");
|
|
4159
4166
|
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;
|
|
4160
4167
|
let f = 0;
|
|
4161
|
-
const g = w === 0 ? 0 : o / w,
|
|
4168
|
+
const g = w === 0 ? 0 : o / w, K = w;
|
|
4162
4169
|
if (o !== 0)
|
|
4163
4170
|
switch (w) {
|
|
4164
4171
|
case Y:
|
|
@@ -4171,18 +4178,18 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4171
4178
|
f = ((Y - G) / o + 4) * 60;
|
|
4172
4179
|
break;
|
|
4173
4180
|
}
|
|
4174
|
-
return { h: f, s: g * 100, v:
|
|
4181
|
+
return { h: f, s: g * 100, v: K * 100 };
|
|
4175
4182
|
}, H = (I) => {
|
|
4176
4183
|
if (!S.value) return;
|
|
4177
4184
|
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));
|
|
4178
4185
|
m.value = Math.round(G * 100), b.value = Math.round((1 - p) * 100);
|
|
4179
4186
|
}, O = (I) => {
|
|
4180
|
-
if (
|
|
4181
|
-
const Y =
|
|
4187
|
+
if (!$.value) return;
|
|
4188
|
+
const Y = $.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (I.clientX - Y.left) / Y.width));
|
|
4182
4189
|
c.value = Math.round(G * 360);
|
|
4183
4190
|
}, M = (I) => {
|
|
4184
|
-
if (
|
|
4185
|
-
const Y =
|
|
4191
|
+
if (!$.value) return;
|
|
4192
|
+
const Y = $.value.getBoundingClientRect(), G = Math.max(0, Math.min(1, (I.clientX - Y.left) / Y.width));
|
|
4186
4193
|
T.value = Math.round(G * 100);
|
|
4187
4194
|
}, h = (I) => {
|
|
4188
4195
|
const Y = R(I);
|
|
@@ -4204,7 +4211,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4204
4211
|
document.removeEventListener("click", A);
|
|
4205
4212
|
}), (I, Y) => (i(), d("div", {
|
|
4206
4213
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4207
|
-
onClick: Y[1] || (Y[1] =
|
|
4214
|
+
onClick: Y[1] || (Y[1] = se(() => {
|
|
4208
4215
|
}, ["stop"]))
|
|
4209
4216
|
}, [
|
|
4210
4217
|
r("div", {
|
|
@@ -4253,7 +4260,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4253
4260
|
}, [
|
|
4254
4261
|
r("div", {
|
|
4255
4262
|
ref_key: "sliderRef",
|
|
4256
|
-
ref:
|
|
4263
|
+
ref: $,
|
|
4257
4264
|
class: u(n(t).e("hue-bar")),
|
|
4258
4265
|
onClick: O
|
|
4259
4266
|
}, [
|
|
@@ -4270,7 +4277,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4270
4277
|
r("div", {
|
|
4271
4278
|
class: u(n(t).e("alpha-bar")),
|
|
4272
4279
|
style: te({
|
|
4273
|
-
background: `linear-gradient(to right, transparent, ${
|
|
4280
|
+
background: `linear-gradient(to right, transparent, ${D.value})`
|
|
4274
4281
|
}),
|
|
4275
4282
|
onClick: M
|
|
4276
4283
|
}, [
|
|
@@ -4289,7 +4296,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4289
4296
|
class: u(n(t).e("predefine-item")),
|
|
4290
4297
|
style: te({ backgroundColor: G }),
|
|
4291
4298
|
onClick: (w) => h(G)
|
|
4292
|
-
}, null, 14,
|
|
4299
|
+
}, null, 14, Ua))), 128))
|
|
4293
4300
|
], 2)) : U("", !0),
|
|
4294
4301
|
r("div", {
|
|
4295
4302
|
class: u(n(t).e("actions"))
|
|
@@ -4315,7 +4322,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4315
4322
|
])
|
|
4316
4323
|
], 2));
|
|
4317
4324
|
}
|
|
4318
|
-
}),
|
|
4325
|
+
}), Ka = ["value", "placeholder", "disabled"], Xa = ["onClick"], Mt = /* @__PURE__ */ le({
|
|
4319
4326
|
name: "XAutoComplete",
|
|
4320
4327
|
__name: "index",
|
|
4321
4328
|
props: {
|
|
@@ -4333,8 +4340,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4333
4340
|
emits: ["update:modelValue", "select", "clear"],
|
|
4334
4341
|
setup(s, { emit: k }) {
|
|
4335
4342
|
const a = s, e = k, t = ae("auto-complete"), l = B(!1), c = B(a.modelValue), m = B([]), b = B(-1), T = B(), S = B(!1);
|
|
4336
|
-
let
|
|
4337
|
-
const
|
|
4343
|
+
let $ = null;
|
|
4344
|
+
const D = (M) => {
|
|
4338
4345
|
a.fetchSuggestions ? (S.value = !0, a.fetchSuggestions(M, (h) => {
|
|
4339
4346
|
m.value = h, S.value = !1, l.value = h.length > 0;
|
|
4340
4347
|
})) : a.suggestions.length && (m.value = a.suggestions.filter(
|
|
@@ -4342,11 +4349,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4342
4349
|
), l.value = m.value.length > 0);
|
|
4343
4350
|
}, z = (M) => {
|
|
4344
4351
|
const h = M.target.value;
|
|
4345
|
-
c.value = h, e("update:modelValue", h), b.value = -1,
|
|
4346
|
-
h || a.triggerOnFocus ?
|
|
4352
|
+
c.value = h, e("update:modelValue", h), b.value = -1, $ && clearTimeout($), $ = setTimeout(() => {
|
|
4353
|
+
h || a.triggerOnFocus ? D(h) : l.value = !1;
|
|
4347
4354
|
}, a.debounce);
|
|
4348
4355
|
}, E = () => {
|
|
4349
|
-
a.triggerOnFocus && c.value === "" &&
|
|
4356
|
+
a.triggerOnFocus && c.value === "" && D("");
|
|
4350
4357
|
}, y = (M) => {
|
|
4351
4358
|
c.value = M[a.valueKey], e("update:modelValue", c.value), e("select", M), l.value = !1;
|
|
4352
4359
|
}, R = (M) => {
|
|
@@ -4380,7 +4387,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4380
4387
|
c.value = M;
|
|
4381
4388
|
}), (M, h) => (i(), d("div", {
|
|
4382
4389
|
class: u([n(t).b(), n(t).m(s.size)]),
|
|
4383
|
-
onClick: h[0] || (h[0] =
|
|
4390
|
+
onClick: h[0] || (h[0] = se(() => {
|
|
4384
4391
|
}, ["stop"]))
|
|
4385
4392
|
}, [
|
|
4386
4393
|
r("div", {
|
|
@@ -4396,7 +4403,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4396
4403
|
onInput: z,
|
|
4397
4404
|
onFocus: E,
|
|
4398
4405
|
onKeydown: R
|
|
4399
|
-
}, null, 42,
|
|
4406
|
+
}, null, 42, Ka),
|
|
4400
4407
|
s.clearable && c.value ? (i(), d("span", {
|
|
4401
4408
|
key: 0,
|
|
4402
4409
|
class: u(n(t).e("clear")),
|
|
@@ -4431,17 +4438,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4431
4438
|
]),
|
|
4432
4439
|
onClick: (A) => y(v)
|
|
4433
4440
|
}, [
|
|
4434
|
-
|
|
4441
|
+
ue(M.$slots, "default", { item: v }, () => [
|
|
4435
4442
|
de(N(v[s.valueKey]), 1)
|
|
4436
4443
|
])
|
|
4437
|
-
], 10,
|
|
4444
|
+
], 10, Xa))), 128))
|
|
4438
4445
|
], 2)
|
|
4439
4446
|
], 2), [
|
|
4440
4447
|
[be, l.value && m.value.length]
|
|
4441
4448
|
])
|
|
4442
4449
|
], 2));
|
|
4443
4450
|
}
|
|
4444
|
-
}),
|
|
4451
|
+
}), Wa = ["onClick"], Vt = /* @__PURE__ */ le({
|
|
4445
4452
|
name: "XSegmented",
|
|
4446
4453
|
__name: "index",
|
|
4447
4454
|
props: {
|
|
@@ -4455,15 +4462,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4455
4462
|
setup(s, { emit: k }) {
|
|
4456
4463
|
const a = s, e = k, t = ae("segmented"), l = B(), c = V(() => a.options.map((S) => typeof S == "string" || typeof S == "number" ? { label: String(S), value: S } : S)), m = V(() => c.value.findIndex((S) => S.value === a.modelValue)), b = V(() => {
|
|
4457
4464
|
if (!l.value || m.value < 0) return {};
|
|
4458
|
-
const
|
|
4459
|
-
return
|
|
4460
|
-
width: `${
|
|
4461
|
-
transform: `translateX(${
|
|
4465
|
+
const $ = l.value.querySelectorAll(`.${t.e("item")}`)[m.value];
|
|
4466
|
+
return $ ? {
|
|
4467
|
+
width: `${$.offsetWidth}px`,
|
|
4468
|
+
transform: `translateX(${$.offsetLeft}px)`
|
|
4462
4469
|
} : {};
|
|
4463
4470
|
}), T = (S) => {
|
|
4464
4471
|
a.disabled || S.disabled || (e("update:modelValue", S.value), e("change", S.value));
|
|
4465
4472
|
};
|
|
4466
|
-
return (S,
|
|
4473
|
+
return (S, $) => (i(), d("div", {
|
|
4467
4474
|
ref_key: "containerRef",
|
|
4468
4475
|
ref: l,
|
|
4469
4476
|
class: u([
|
|
@@ -4477,22 +4484,22 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4477
4484
|
class: u(n(t).e("thumb")),
|
|
4478
4485
|
style: te(b.value)
|
|
4479
4486
|
}, null, 6),
|
|
4480
|
-
(i(!0), d(J, null, _(c.value, (
|
|
4487
|
+
(i(!0), d(J, null, _(c.value, (D, z) => (i(), d("div", {
|
|
4481
4488
|
key: z,
|
|
4482
4489
|
class: u([
|
|
4483
4490
|
n(t).e("item"),
|
|
4484
4491
|
n(t).is("selected", z === m.value),
|
|
4485
|
-
n(t).is("disabled",
|
|
4492
|
+
n(t).is("disabled", D.disabled)
|
|
4486
4493
|
]),
|
|
4487
|
-
onClick: (E) => T(
|
|
4494
|
+
onClick: (E) => T(D)
|
|
4488
4495
|
}, [
|
|
4489
|
-
|
|
4490
|
-
de(N(
|
|
4496
|
+
ue(S.$slots, "default", { option: D }, () => [
|
|
4497
|
+
de(N(D.label), 1)
|
|
4491
4498
|
])
|
|
4492
|
-
], 10,
|
|
4499
|
+
], 10, Wa))), 128))
|
|
4493
4500
|
], 2));
|
|
4494
4501
|
}
|
|
4495
|
-
}),
|
|
4502
|
+
}), qa = ["value", "placeholder", "disabled"], ja = ["onClick"], Ga = ["src"], xt = /* @__PURE__ */ le({
|
|
4496
4503
|
name: "XMention",
|
|
4497
4504
|
__name: "index",
|
|
4498
4505
|
props: {
|
|
@@ -4507,20 +4514,20 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4507
4514
|
},
|
|
4508
4515
|
emits: ["update:modelValue", "select", "change"],
|
|
4509
4516
|
setup(s, { emit: k }) {
|
|
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(),
|
|
4517
|
+
const a = s, e = k, t = ae("mention"), l = B(a.modelValue), c = B(!1), m = B([]), b = B(-1), T = B(), S = B(), $ = B(0), D = B(-1), z = (M) => {
|
|
4511
4518
|
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;
|
|
4512
4519
|
}, E = (M) => {
|
|
4513
4520
|
const h = M.target;
|
|
4514
|
-
l.value = h.value,
|
|
4515
|
-
const v = l.value.slice(0,
|
|
4521
|
+
l.value = h.value, $.value = h.selectionStart || 0;
|
|
4522
|
+
const v = l.value.slice(0, $.value), x = v.lastIndexOf(a.prefix);
|
|
4516
4523
|
if (x >= 0) {
|
|
4517
4524
|
const A = v.slice(x + a.prefix.length);
|
|
4518
|
-
|
|
4525
|
+
D.value = x, z(A);
|
|
4519
4526
|
} else
|
|
4520
4527
|
c.value = !1;
|
|
4521
4528
|
e("update:modelValue", l.value), e("change", l.value);
|
|
4522
4529
|
}, y = (M) => {
|
|
4523
|
-
const h = l.value.slice(0,
|
|
4530
|
+
const h = l.value.slice(0, D.value), v = l.value.slice($.value), x = `${a.prefix}${M.value}${a.split}`;
|
|
4524
4531
|
l.value = h + x + v, e("update:modelValue", l.value), e("select", M, a.prefix), e("change", l.value), c.value = !1, Se(() => {
|
|
4525
4532
|
const A = h.length + x.length;
|
|
4526
4533
|
T.value && (T.value.setSelectionRange(A, A), T.value.focus()), S.value && (S.value.setSelectionRange(A, A), S.value.focus());
|
|
@@ -4555,7 +4562,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4555
4562
|
l.value = M;
|
|
4556
4563
|
}), (M, h) => (i(), d("div", {
|
|
4557
4564
|
class: u([n(t).b(), n(t).m(s.size)]),
|
|
4558
|
-
onClick: h[0] || (h[0] =
|
|
4565
|
+
onClick: h[0] || (h[0] = se(() => {
|
|
4559
4566
|
}, ["stop"]))
|
|
4560
4567
|
}, [
|
|
4561
4568
|
r("div", {
|
|
@@ -4570,7 +4577,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4570
4577
|
class: u(n(t).e("inner")),
|
|
4571
4578
|
onInput: E,
|
|
4572
4579
|
onKeydown: R
|
|
4573
|
-
}, null, 42,
|
|
4580
|
+
}, null, 42, qa),
|
|
4574
4581
|
s.clearable && l.value ? (i(), d("span", {
|
|
4575
4582
|
key: 0,
|
|
4576
4583
|
class: u(n(t).e("clear")),
|
|
@@ -4601,14 +4608,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4601
4608
|
key: 0,
|
|
4602
4609
|
src: v.avatar,
|
|
4603
4610
|
class: u(n(t).e("avatar"))
|
|
4604
|
-
}, null, 10,
|
|
4611
|
+
}, null, 10, Ga)) : U("", !0),
|
|
4605
4612
|
r("span", {
|
|
4606
4613
|
class: u(n(t).e("label"))
|
|
4607
4614
|
}, N(v.label || v.value), 3),
|
|
4608
4615
|
r("span", {
|
|
4609
4616
|
class: u(n(t).e("value"))
|
|
4610
4617
|
}, N(v.value), 3)
|
|
4611
|
-
], 10,
|
|
4618
|
+
], 10, ja))), 128))
|
|
4612
4619
|
], 2)
|
|
4613
4620
|
], 2), [
|
|
4614
4621
|
[be, c.value]
|
|
@@ -4617,30 +4624,30 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4617
4624
|
}
|
|
4618
4625
|
});
|
|
4619
4626
|
export {
|
|
4620
|
-
|
|
4621
|
-
|
|
4622
|
-
|
|
4623
|
-
|
|
4624
|
-
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
|
|
4628
|
-
|
|
4629
|
-
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4627
|
+
Mt as AutoComplete,
|
|
4628
|
+
yt as Cascader,
|
|
4629
|
+
st as Checkbox,
|
|
4630
|
+
ut as CheckboxGroup,
|
|
4631
|
+
kt as ColorPicker,
|
|
4632
|
+
rt as DatePicker,
|
|
4633
|
+
gt as DynamicFields,
|
|
4634
|
+
ot as Form,
|
|
4635
|
+
it as FormItem,
|
|
4636
|
+
Qa as Input,
|
|
4637
|
+
_a as InputNumber,
|
|
4638
|
+
xt as Mention,
|
|
4639
|
+
at as Radio,
|
|
4640
|
+
nt as RadioButton,
|
|
4641
|
+
tt as RadioGroup,
|
|
4642
|
+
pt as Rate,
|
|
4643
|
+
bt as RichEditor,
|
|
4644
|
+
Vt as Segmented,
|
|
4645
|
+
ct as Select,
|
|
4646
|
+
vt as SelectOption,
|
|
4647
|
+
mt as Slider,
|
|
4648
|
+
lt as Switch,
|
|
4649
|
+
et as Textarea,
|
|
4650
|
+
dt as TimePicker,
|
|
4651
|
+
ft as Transfer,
|
|
4652
|
+
ht as Upload
|
|
4646
4653
|
};
|