@xto/form 1.6.5 → 1.6.6-debug.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +907 -872
- package/lib/index.cjs +2 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as
|
|
2
|
-
import { useNamespace as ae, useZIndex as
|
|
1
|
+
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as c, normalizeStyle as te, normalizeClass as u, createElementVNode as r, renderSlot as se, createTextVNode as ce, toDisplayString as N, ref as B, useSlots as Le, watch as ie, unref as n, createCommentVNode as U, withDirectives as oe, vModelDynamic as qe, createVNode as Q, vModelText as Ve, inject as xe, withModifiers as ue, provide as $e, toRef as je, onMounted as ge, onUnmounted as De, Fragment as Z, renderList as _, createBlock as fe, Teleport as Fe, Transition as Pe, withCtx as He, vModelSelect as Ce, vShow as be, nextTick as Se, defineAsyncComponent as Ne, shallowRef as Ge, onBeforeUnmount as Je } from "vue";
|
|
2
|
+
import { useNamespace as ae, useZIndex as Oe } from "@xto/core";
|
|
3
3
|
const Xe = {
|
|
4
4
|
// 箭头类
|
|
5
5
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
@@ -219,7 +219,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
219
219
|
width: t.value,
|
|
220
220
|
height: t.value,
|
|
221
221
|
color: a.color
|
|
222
|
-
})),
|
|
222
|
+
})), d = V(() => ({
|
|
223
223
|
strokeWidth: a.strokeWidth
|
|
224
224
|
})), m = V(() => [
|
|
225
225
|
e.b(),
|
|
@@ -229,14 +229,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
229
229
|
iconSize: t,
|
|
230
230
|
iconStyle: l,
|
|
231
231
|
iconPath: b
|
|
232
|
-
}), (T, S) => (i(),
|
|
232
|
+
}), (T, S) => (i(), c("span", {
|
|
233
233
|
class: u(m.value),
|
|
234
234
|
style: te(l.value),
|
|
235
235
|
"aria-hidden": !s.name,
|
|
236
236
|
"aria-label": s.name,
|
|
237
237
|
role: "img"
|
|
238
238
|
}, [
|
|
239
|
-
b.value ? (i(),
|
|
239
|
+
b.value ? (i(), c("svg", {
|
|
240
240
|
key: 0,
|
|
241
241
|
viewBox: "0 0 24 24",
|
|
242
242
|
fill: "none",
|
|
@@ -244,12 +244,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
244
244
|
"stroke-width": s.strokeWidth,
|
|
245
245
|
"stroke-linecap": "round",
|
|
246
246
|
"stroke-linejoin": "round",
|
|
247
|
-
style: te(
|
|
247
|
+
style: te(d.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
250
|
r("path", { d: b.value }, null, 8, el)
|
|
251
251
|
], 12, _e)) : se(T.$slots, "default", { key: 1 }, () => [
|
|
252
|
-
|
|
252
|
+
ce(N(s.name), 1)
|
|
253
253
|
])
|
|
254
254
|
], 14, Qe));
|
|
255
255
|
}
|
|
@@ -274,34 +274,34 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
274
274
|
},
|
|
275
275
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur", "clear"],
|
|
276
276
|
setup(s, { expose: k, emit: a }) {
|
|
277
|
-
const e = s, t = a, l = ae("input"),
|
|
277
|
+
const e = s, t = a, l = ae("input"), d = B(), m = B(!1), b = B(!1), T = Le(), S = V(
|
|
278
278
|
() => e.type === "password" && e.showPassword && !e.disabled
|
|
279
279
|
), D = V(() => S.value ? b.value ? "text" : "password" : e.type);
|
|
280
280
|
V(() => e.modelValue !== void 0), V(() => e.value !== void 0);
|
|
281
281
|
const $ = B("");
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
|
-
([A,
|
|
285
|
-
const Y = A ??
|
|
284
|
+
([A, P]) => {
|
|
285
|
+
const Y = A ?? P ?? "";
|
|
286
286
|
Y !== $.value && ($.value = Y);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
290
290
|
const z = (A) => {
|
|
291
291
|
$.value = A, t("update:modelValue", A), t("update:value", A), t("input", A);
|
|
292
|
-
},
|
|
292
|
+
}, O = V(() => String($.value).length), y = V(() => [
|
|
293
293
|
l.b(),
|
|
294
294
|
e.size !== "default" ? l.m(e.size) : "",
|
|
295
295
|
l.is("disabled", e.disabled),
|
|
296
296
|
l.is("focus", m.value),
|
|
297
297
|
l.is("has-prefix", e.prefixIcon || T.prefix),
|
|
298
298
|
l.is("has-suffix", e.suffixIcon || T.suffix || e.clearable || S.value || e.showWordLimit)
|
|
299
|
-
]),
|
|
300
|
-
const
|
|
301
|
-
t("change",
|
|
299
|
+
]), R = (A) => {
|
|
300
|
+
const P = A.target.value;
|
|
301
|
+
t("change", P);
|
|
302
302
|
}, H = (A) => {
|
|
303
303
|
m.value = !0, t("focus", A);
|
|
304
|
-
},
|
|
304
|
+
}, E = (A) => {
|
|
305
305
|
m.value = !1, t("blur", A);
|
|
306
306
|
}, M = () => {
|
|
307
307
|
$.value = "", t("update:modelValue", ""), t("update:value", ""), t("clear");
|
|
@@ -311,17 +311,17 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
311
311
|
return k({
|
|
312
312
|
focus: () => {
|
|
313
313
|
var A;
|
|
314
|
-
(A =
|
|
314
|
+
(A = d.value) == null || A.focus();
|
|
315
315
|
},
|
|
316
316
|
blur: () => {
|
|
317
317
|
var A;
|
|
318
|
-
(A =
|
|
318
|
+
(A = d.value) == null || A.blur();
|
|
319
319
|
},
|
|
320
|
-
inputRef:
|
|
321
|
-
}), (A,
|
|
320
|
+
inputRef: d
|
|
321
|
+
}), (A, P) => (i(), c("div", {
|
|
322
322
|
class: u(y.value)
|
|
323
323
|
}, [
|
|
324
|
-
A.$slots.prefix || s.prefixIcon ? (i(),
|
|
324
|
+
A.$slots.prefix || s.prefixIcon ? (i(), c("span", {
|
|
325
325
|
key: 0,
|
|
326
326
|
class: u(n(l).e("prefix"))
|
|
327
327
|
}, [
|
|
@@ -333,8 +333,8 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
333
333
|
], 2)) : U("", !0),
|
|
334
334
|
oe(r("input", {
|
|
335
335
|
ref_key: "inputRef",
|
|
336
|
-
ref:
|
|
337
|
-
"onUpdate:modelValue":
|
|
336
|
+
ref: d,
|
|
337
|
+
"onUpdate:modelValue": P[0] || (P[0] = (Y) => $.value = Y),
|
|
338
338
|
type: D.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
@@ -342,19 +342,19 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
342
342
|
maxlength: s.maxlength,
|
|
343
343
|
minlength: s.minlength,
|
|
344
344
|
class: u(n(l).e("inner")),
|
|
345
|
-
onInput:
|
|
346
|
-
onChange:
|
|
345
|
+
onInput: P[1] || (P[1] = (Y) => z(Y.target.value)),
|
|
346
|
+
onChange: R,
|
|
347
347
|
onFocus: H,
|
|
348
|
-
onBlur:
|
|
348
|
+
onBlur: E
|
|
349
349
|
}, null, 42, ll), [
|
|
350
350
|
[qe, $.value]
|
|
351
351
|
]),
|
|
352
|
-
A.$slots.suffix || s.suffixIcon || s.clearable || S.value || s.showWordLimit ? (i(),
|
|
352
|
+
A.$slots.suffix || s.suffixIcon || s.clearable || S.value || s.showWordLimit ? (i(), c("span", {
|
|
353
353
|
key: 1,
|
|
354
354
|
class: u(n(l).e("suffix"))
|
|
355
355
|
}, [
|
|
356
356
|
se(A.$slots, "suffix", {}, () => [
|
|
357
|
-
s.clearable && s.value && !s.disabled ? (i(),
|
|
357
|
+
s.clearable && s.value && !s.disabled ? (i(), c("span", {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: u([n(l).e("icon"), n(l).e("clear")]),
|
|
360
360
|
onClick: M
|
|
@@ -364,7 +364,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
364
364
|
size: 14
|
|
365
365
|
})
|
|
366
366
|
], 2)) : U("", !0),
|
|
367
|
-
S.value ? (i(),
|
|
367
|
+
S.value ? (i(), c("span", {
|
|
368
368
|
key: 1,
|
|
369
369
|
class: u([n(l).e("icon"), n(l).e("password")]),
|
|
370
370
|
onClick: h
|
|
@@ -374,10 +374,10 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
374
374
|
size: 14
|
|
375
375
|
}, null, 8, ["name"])
|
|
376
376
|
], 2)) : U("", !0),
|
|
377
|
-
s.showWordLimit && s.maxlength ? (i(),
|
|
377
|
+
s.showWordLimit && s.maxlength ? (i(), c("span", {
|
|
378
378
|
key: 2,
|
|
379
379
|
class: u(n(l).e("count"))
|
|
380
|
-
}, N(
|
|
380
|
+
}, N(O.value) + "/" + N(s.maxlength), 3)) : U("", !0)
|
|
381
381
|
])
|
|
382
382
|
], 2)) : U("", !0)
|
|
383
383
|
], 2));
|
|
@@ -402,7 +402,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
402
402
|
},
|
|
403
403
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur"],
|
|
404
404
|
setup(s, { expose: k, emit: a }) {
|
|
405
|
-
const e = s, t = a, l = ae("input-number"),
|
|
405
|
+
const e = s, t = a, l = ae("input-number"), d = 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
408
|
const o = D(e.step), f = e.modelValue !== void 0 && e.modelValue !== null ? D(e.modelValue) : 0;
|
|
@@ -421,7 +421,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
421
421
|
function z(o) {
|
|
422
422
|
return o > e.max ? e.max : o < e.min ? e.min : o;
|
|
423
423
|
}
|
|
424
|
-
const
|
|
424
|
+
const O = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : O.value === void 0 || O.value === null ? "" : $(O.value)), R = V(() => e.disabled ? !0 : O.value === void 0 ? e.min !== -1 / 0 : O.value <= e.min), H = V(() => e.disabled ? !0 : O.value === void 0 ? e.max !== 1 / 0 : O.value >= e.max), E = V(() => [
|
|
425
425
|
l.b(),
|
|
426
426
|
e.size !== "default" ? l.m(e.size) : "",
|
|
427
427
|
l.is("disabled", e.disabled),
|
|
@@ -430,12 +430,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
430
430
|
]);
|
|
431
431
|
function M() {
|
|
432
432
|
if (e.disabled || H.value) return;
|
|
433
|
-
const o =
|
|
433
|
+
const o = O.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o + e.step), g = z(f);
|
|
434
434
|
v(g);
|
|
435
435
|
}
|
|
436
436
|
function h() {
|
|
437
|
-
if (e.disabled ||
|
|
438
|
-
const o =
|
|
437
|
+
if (e.disabled || R.value) return;
|
|
438
|
+
const o = O.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o - e.step), g = z(f);
|
|
439
439
|
v(g);
|
|
440
440
|
}
|
|
441
441
|
function v(o) {
|
|
@@ -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 = $(o),
|
|
446
|
+
const g = $(o), K = z(g);
|
|
447
447
|
if (e.stepStrictly) {
|
|
448
|
-
const ne = Math.round((
|
|
449
|
-
e.modelValue !== void 0 && t("update:modelValue",
|
|
448
|
+
const ne = Math.round((K - e.min) / e.step), W = $(e.min + ne * e.step);
|
|
449
|
+
e.modelValue !== void 0 && t("update:modelValue", W), e.value !== void 0 && t("update:value", W), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", W), t("change", W, f);
|
|
450
450
|
} else
|
|
451
|
-
e.modelValue !== void 0 && t("update:modelValue",
|
|
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,15 +458,15 @@ 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;
|
|
467
467
|
b.value = f;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function P(o) {
|
|
470
470
|
if (m.value = !1, b.value !== null) {
|
|
471
471
|
const f = x(b.value);
|
|
472
472
|
f === void 0 ? e.valueOnClear !== null ? v(e.valueOnClear) : b.value = null : v(f);
|
|
@@ -476,7 +476,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
476
476
|
function Y(o) {
|
|
477
477
|
m.value = !0, T.value = e.modelValue, t("focus", o);
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function J(o) {
|
|
480
480
|
var f;
|
|
481
481
|
if (!e.disabled)
|
|
482
482
|
switch (o.key) {
|
|
@@ -487,7 +487,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
487
487
|
o.preventDefault(), h();
|
|
488
488
|
break;
|
|
489
489
|
case "Enter":
|
|
490
|
-
(f =
|
|
490
|
+
(f = d.value) == null || f.blur();
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -496,11 +496,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
496
496
|
}
|
|
497
497
|
function w() {
|
|
498
498
|
var o;
|
|
499
|
-
(o =
|
|
499
|
+
(o = d.value) == null || o.focus();
|
|
500
500
|
}
|
|
501
501
|
function C() {
|
|
502
502
|
var o;
|
|
503
|
-
(o =
|
|
503
|
+
(o = d.value) == null || o.blur();
|
|
504
504
|
}
|
|
505
505
|
return ie([() => e.modelValue, () => e.value], ([o, f]) => {
|
|
506
506
|
T.value = o ?? f, b.value = null;
|
|
@@ -510,14 +510,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
510
510
|
clear: p,
|
|
511
511
|
increase: M,
|
|
512
512
|
decrease: h
|
|
513
|
-
}), (o, f) => (i(),
|
|
514
|
-
class: u(
|
|
513
|
+
}), (o, f) => (i(), c("div", {
|
|
514
|
+
class: u(E.value)
|
|
515
515
|
}, [
|
|
516
|
-
s.controls ? (i(),
|
|
516
|
+
s.controls ? (i(), c("button", {
|
|
517
517
|
key: 0,
|
|
518
518
|
type: "button",
|
|
519
|
-
class: u([n(l).e("decrease"), n(l).is("disabled",
|
|
520
|
-
disabled:
|
|
519
|
+
class: u([n(l).e("decrease"), n(l).is("disabled", R.value)]),
|
|
520
|
+
disabled: R.value,
|
|
521
521
|
onClick: h
|
|
522
522
|
}, " − ", 10, al)) : U("", !0),
|
|
523
523
|
r("div", {
|
|
@@ -525,7 +525,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
525
525
|
}, [
|
|
526
526
|
r("input", {
|
|
527
527
|
ref_key: "inputRef",
|
|
528
|
-
ref:
|
|
528
|
+
ref: d,
|
|
529
529
|
value: y.value,
|
|
530
530
|
placeholder: s.placeholder,
|
|
531
531
|
disabled: s.disabled,
|
|
@@ -534,11 +534,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
534
534
|
autocomplete: "off",
|
|
535
535
|
onInput: A,
|
|
536
536
|
onFocus: Y,
|
|
537
|
-
onBlur:
|
|
538
|
-
onKeydown:
|
|
537
|
+
onBlur: P,
|
|
538
|
+
onKeydown: J
|
|
539
539
|
}, null, 42, tl)
|
|
540
540
|
], 2),
|
|
541
|
-
s.controls ? (i(),
|
|
541
|
+
s.controls ? (i(), c("button", {
|
|
542
542
|
key: 1,
|
|
543
543
|
type: "button",
|
|
544
544
|
class: u([n(l).e("increase"), n(l).is("disabled", H.value)]),
|
|
@@ -565,7 +565,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
565
565
|
},
|
|
566
566
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur"],
|
|
567
567
|
setup(s, { expose: k, emit: a }) {
|
|
568
|
-
const e = s, t = a, l = ae("textarea"),
|
|
568
|
+
const e = s, t = a, l = ae("textarea"), d = B(), m = B(!1), b = B("");
|
|
569
569
|
ie(
|
|
570
570
|
[() => e.modelValue, () => e.value],
|
|
571
571
|
([M, h]) => {
|
|
@@ -590,32 +590,32 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
590
590
|
l.is("exceed", e.maxlength && S.value > e.maxlength)
|
|
591
591
|
]), z = (M) => {
|
|
592
592
|
const h = M.target.value;
|
|
593
|
-
T(h), e.autosize &&
|
|
594
|
-
},
|
|
593
|
+
T(h), e.autosize && d.value && (d.value.style.height = "auto", d.value.style.height = `${d.value.scrollHeight}px`);
|
|
594
|
+
}, O = (M) => {
|
|
595
595
|
const h = M.target.value;
|
|
596
596
|
t("change", h);
|
|
597
597
|
}, y = (M) => {
|
|
598
598
|
m.value = !0, t("focus", M);
|
|
599
|
-
},
|
|
599
|
+
}, R = (M) => {
|
|
600
600
|
m.value = !1, t("blur", M);
|
|
601
601
|
};
|
|
602
602
|
return k({
|
|
603
603
|
focus: () => {
|
|
604
604
|
var M;
|
|
605
|
-
(M =
|
|
605
|
+
(M = d.value) == null || M.focus();
|
|
606
606
|
},
|
|
607
607
|
blur: () => {
|
|
608
608
|
var M;
|
|
609
|
-
(M =
|
|
609
|
+
(M = d.value) == null || M.blur();
|
|
610
610
|
},
|
|
611
|
-
textareaRef:
|
|
612
|
-
}), (M, h) => (i(),
|
|
611
|
+
textareaRef: d
|
|
612
|
+
}), (M, h) => (i(), c("div", {
|
|
613
613
|
class: u($.value),
|
|
614
614
|
style: te(s.disabled ? void 0 : { cursor: "text" })
|
|
615
615
|
}, [
|
|
616
616
|
oe(r("textarea", {
|
|
617
617
|
ref_key: "textareaRef",
|
|
618
|
-
ref:
|
|
618
|
+
ref: d,
|
|
619
619
|
"onUpdate:modelValue": h[0] || (h[0] = (v) => b.value = v),
|
|
620
620
|
placeholder: s.placeholder,
|
|
621
621
|
disabled: s.disabled,
|
|
@@ -626,13 +626,13 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
626
626
|
style: te(D.value),
|
|
627
627
|
class: u(n(l).e("inner")),
|
|
628
628
|
onInput: z,
|
|
629
|
-
onChange:
|
|
629
|
+
onChange: O,
|
|
630
630
|
onFocus: y,
|
|
631
|
-
onBlur:
|
|
631
|
+
onBlur: R
|
|
632
632
|
}, null, 46, sl), [
|
|
633
633
|
[Ve, b.value]
|
|
634
634
|
]),
|
|
635
|
-
s.showWordLimit && s.maxlength ? (i(),
|
|
635
|
+
s.showWordLimit && s.maxlength ? (i(), c("span", {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: u(n(l).e("count"))
|
|
638
638
|
}, N(S.value) + "/" + N(s.maxlength), 3)) : U("", !0)
|
|
@@ -653,20 +653,20 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
653
653
|
},
|
|
654
654
|
emits: ["update:modelValue", "update:checked", "change"],
|
|
655
655
|
setup(s, { emit: k }) {
|
|
656
|
-
const a = s, e = k, t = ae("switch"), l = V(() => a.modelValue !== void 0 ? a.modelValue : a.checked !== void 0 ? a.checked : !1),
|
|
656
|
+
const a = s, e = k, t = ae("switch"), l = V(() => a.modelValue !== void 0 ? a.modelValue : a.checked !== void 0 ? a.checked : !1), d = V(() => l.value === a.activeValue), m = V(() => [
|
|
657
657
|
t.b(),
|
|
658
658
|
t.is("disabled", a.disabled),
|
|
659
|
-
t.is("checked",
|
|
659
|
+
t.is("checked", d.value)
|
|
660
660
|
]), b = V(() => ({
|
|
661
661
|
width: typeof a.width == "number" ? `${a.width}px` : a.width,
|
|
662
662
|
height: "20px",
|
|
663
|
-
backgroundColor:
|
|
663
|
+
backgroundColor: d.value ? a.activeColor : a.inactiveColor
|
|
664
664
|
})), T = () => {
|
|
665
665
|
if (a.disabled) return;
|
|
666
|
-
const S =
|
|
666
|
+
const S = d.value ? a.inactiveValue : a.activeValue;
|
|
667
667
|
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
668
|
};
|
|
669
|
-
return (S, D) => (i(),
|
|
669
|
+
return (S, D) => (i(), c("span", {
|
|
670
670
|
class: u(m.value),
|
|
671
671
|
onClick: T
|
|
672
672
|
}, [
|
|
@@ -674,7 +674,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
674
674
|
class: u(n(t).e("core")),
|
|
675
675
|
style: te(b.value)
|
|
676
676
|
}, null, 6),
|
|
677
|
-
S.$slots.default ? (i(),
|
|
677
|
+
S.$slots.default ? (i(), c("span", {
|
|
678
678
|
key: 0,
|
|
679
679
|
class: u(n(t).e("text"))
|
|
680
680
|
}, [
|
|
@@ -694,14 +694,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
694
694
|
},
|
|
695
695
|
emits: ["update:modelValue", "change"],
|
|
696
696
|
setup(s, { emit: k }) {
|
|
697
|
-
const a = s, e = k, t = ae("radio"), l = xe("radioGroup", null),
|
|
697
|
+
const a = s, e = k, t = ae("radio"), l = xe("radioGroup", null), d = V(() => !!l), m = V(() => d.value ? l.modelValue.value : a.modelValue), b = V(() => a.value ?? a.label), T = V(() => m.value === b.value), S = V(() => a.disabled || d.value && l.disabled), D = V(() => a.name || (d.value ? l.name : void 0)), $ = V(() => [
|
|
698
698
|
t.b(),
|
|
699
699
|
t.is("checked", T.value),
|
|
700
700
|
t.is("disabled", S.value)
|
|
701
701
|
]), z = () => {
|
|
702
|
-
S.value || (
|
|
702
|
+
S.value || (d.value ? l.changeValue(b.value) : (e("update:modelValue", b.value), e("change", b.value)));
|
|
703
703
|
};
|
|
704
|
-
return (
|
|
704
|
+
return (O, y) => (i(), c("label", {
|
|
705
705
|
class: u($.value),
|
|
706
706
|
onClick: ue(z, ["prevent"])
|
|
707
707
|
}, [
|
|
@@ -716,12 +716,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
716
716
|
value: b.value
|
|
717
717
|
}, null, 8, ul)
|
|
718
718
|
], 2),
|
|
719
|
-
|
|
719
|
+
O.$slots.default || s.label ? (i(), c("span", {
|
|
720
720
|
key: 0,
|
|
721
721
|
class: u(n(t).e("label"))
|
|
722
722
|
}, [
|
|
723
|
-
se(
|
|
724
|
-
|
|
723
|
+
se(O.$slots, "default", {}, () => [
|
|
724
|
+
ce(N(s.label), 1)
|
|
725
725
|
])
|
|
726
726
|
], 2)) : U("", !0)
|
|
727
727
|
], 2));
|
|
@@ -737,19 +737,19 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
737
737
|
},
|
|
738
738
|
emits: ["update:modelValue", "update:value", "change"],
|
|
739
739
|
setup(s, { emit: k }) {
|
|
740
|
-
const a = s, e = k, t = ae("radio-group"), l = (
|
|
741
|
-
a.modelValue !== void 0 && e("update:modelValue",
|
|
740
|
+
const a = s, e = k, t = ae("radio-group"), l = (d) => {
|
|
741
|
+
a.modelValue !== void 0 && e("update:modelValue", d), a.value !== void 0 && e("update:value", d), a.modelValue === void 0 && a.value === void 0 && e("update:modelValue", d), e("change", d);
|
|
742
742
|
};
|
|
743
743
|
return $e("radioGroup", {
|
|
744
744
|
modelValue: V(() => a.modelValue ?? a.value),
|
|
745
745
|
name: a.name || `radio-group-${Date.now()}`,
|
|
746
746
|
disabled: a.disabled,
|
|
747
747
|
changeValue: l
|
|
748
|
-
}), (
|
|
748
|
+
}), (d, m) => (i(), c("div", {
|
|
749
749
|
class: u(n(t).b()),
|
|
750
750
|
role: "radiogroup"
|
|
751
751
|
}, [
|
|
752
|
-
se(
|
|
752
|
+
se(d.$slots, "default")
|
|
753
753
|
], 2));
|
|
754
754
|
}
|
|
755
755
|
}), ol = ["checked", "disabled", "value"], at = /* @__PURE__ */ le({
|
|
@@ -763,14 +763,14 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
763
763
|
},
|
|
764
764
|
emits: ["update:modelValue", "change"],
|
|
765
765
|
setup(s, { emit: k }) {
|
|
766
|
-
const a = s, e = ae("radio-button"), t = xe("radioGroup", null), l = V(() => !!t),
|
|
766
|
+
const a = s, e = ae("radio-button"), t = xe("radioGroup", null), l = V(() => !!t), d = V(() => l.value ? t.modelValue.value : null), m = V(() => a.value ?? a.label), b = V(() => d.value === m.value), T = V(() => a.disabled || l.value && t.disabled), S = V(() => [
|
|
767
767
|
e.b(),
|
|
768
768
|
e.is("active", b.value),
|
|
769
769
|
e.is("disabled", T.value)
|
|
770
770
|
]), D = () => {
|
|
771
771
|
T.value || l.value && t.changeValue(m.value);
|
|
772
772
|
};
|
|
773
|
-
return ($, z) => (i(),
|
|
773
|
+
return ($, z) => (i(), c("label", {
|
|
774
774
|
class: u(S.value),
|
|
775
775
|
onClick: ue(D, ["prevent"])
|
|
776
776
|
}, [
|
|
@@ -785,7 +785,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
785
785
|
class: u(n(e).e("inner"))
|
|
786
786
|
}, [
|
|
787
787
|
se($.$slots, "default", {}, () => [
|
|
788
|
-
|
|
788
|
+
ce(N(s.label), 1)
|
|
789
789
|
])
|
|
790
790
|
], 2)
|
|
791
791
|
], 2));
|
|
@@ -803,11 +803,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
803
803
|
},
|
|
804
804
|
emits: ["update:modelValue", "change"],
|
|
805
805
|
setup(s, { emit: k }) {
|
|
806
|
-
const a = s, e = k, t = ae("checkbox"), l = xe("checkboxGroup", null),
|
|
806
|
+
const a = s, e = k, t = ae("checkbox"), l = xe("checkboxGroup", null), d = V(() => !!l), m = V(() => a.value ?? a.label), b = V(() => d.value ? l.modelValue.value.includes(m.value) : Array.isArray(a.modelValue) ? a.modelValue.includes(m.value) : !!a.modelValue), T = V(() => {
|
|
807
807
|
if (a.disabled) return !0;
|
|
808
|
-
if (
|
|
809
|
-
const $ = l.disabled, z = l.min > 0 && l.modelValue.value.length <= l.min,
|
|
810
|
-
return b.value && z || !b.value &&
|
|
808
|
+
if (d.value) {
|
|
809
|
+
const $ = l.disabled, z = l.min > 0 && l.modelValue.value.length <= l.min, O = l.max > 0 && l.modelValue.value.length >= l.max;
|
|
810
|
+
return b.value && z || !b.value && O ? !0 : $;
|
|
811
811
|
}
|
|
812
812
|
return !1;
|
|
813
813
|
}), S = V(() => [
|
|
@@ -817,7 +817,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
817
817
|
t.is("indeterminate", a.indeterminate && !b.value)
|
|
818
818
|
]), D = () => {
|
|
819
819
|
if (!T.value)
|
|
820
|
-
if (
|
|
820
|
+
if (d.value)
|
|
821
821
|
l.changeValue(m.value);
|
|
822
822
|
else {
|
|
823
823
|
let $;
|
|
@@ -829,7 +829,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
829
829
|
e("update:modelValue", $), e("change", $);
|
|
830
830
|
}
|
|
831
831
|
};
|
|
832
|
-
return ($, z) => (i(),
|
|
832
|
+
return ($, z) => (i(), c("label", {
|
|
833
833
|
class: u(S.value),
|
|
834
834
|
onClick: ue(D, ["prevent"])
|
|
835
835
|
}, [
|
|
@@ -844,12 +844,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
844
844
|
value: m.value
|
|
845
845
|
}, null, 8, il)
|
|
846
846
|
], 2),
|
|
847
|
-
$.$slots.default || s.label !== void 0 ? (i(),
|
|
847
|
+
$.$slots.default || s.label !== void 0 ? (i(), c("span", {
|
|
848
848
|
key: 0,
|
|
849
849
|
class: u(n(t).e("label"))
|
|
850
850
|
}, [
|
|
851
851
|
se($.$slots, "default", {}, () => [
|
|
852
|
-
|
|
852
|
+
ce(N(s.label), 1)
|
|
853
853
|
])
|
|
854
854
|
], 2)) : U("", !0)
|
|
855
855
|
], 2));
|
|
@@ -865,9 +865,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
865
865
|
},
|
|
866
866
|
emits: ["update:modelValue", "change"],
|
|
867
867
|
setup(s, { emit: k }) {
|
|
868
|
-
const a = s, e = k, t = ae("checkbox-group"), l = (
|
|
869
|
-
const m = [...a.modelValue], b = m.indexOf(
|
|
870
|
-
b > -1 ? m.splice(b, 1) : m.push(
|
|
868
|
+
const a = s, e = k, t = ae("checkbox-group"), l = (d) => {
|
|
869
|
+
const m = [...a.modelValue], b = m.indexOf(d);
|
|
870
|
+
b > -1 ? m.splice(b, 1) : m.push(d), e("update:modelValue", m), e("change", m);
|
|
871
871
|
};
|
|
872
872
|
return $e("checkboxGroup", {
|
|
873
873
|
modelValue: V(() => a.modelValue),
|
|
@@ -875,11 +875,11 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
875
875
|
min: a.min,
|
|
876
876
|
max: a.max,
|
|
877
877
|
changeValue: l
|
|
878
|
-
}), (
|
|
878
|
+
}), (d, m) => (i(), c("div", {
|
|
879
879
|
class: u(n(t).b()),
|
|
880
880
|
role: "group"
|
|
881
881
|
}, [
|
|
882
|
-
se(
|
|
882
|
+
se(d.$slots, "default")
|
|
883
883
|
], 2));
|
|
884
884
|
}
|
|
885
885
|
}), st = /* @__PURE__ */ le({
|
|
@@ -897,44 +897,44 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
897
897
|
},
|
|
898
898
|
emits: ["validate", "submit", "reset"],
|
|
899
899
|
setup(s, { expose: k, emit: a }) {
|
|
900
|
-
const e = s, t = a, l = ae("form"),
|
|
900
|
+
const e = s, t = a, l = ae("form"), d = B([]), m = V(() => e.layout === "inline" || e.inline), b = V(() => e.layout === "vertical" || e.labelPosition === "top"), T = V(() => [
|
|
901
901
|
l.b(),
|
|
902
902
|
l.m(`label-${b.value ? "top" : e.labelPosition}`),
|
|
903
903
|
l.is("inline", m.value),
|
|
904
904
|
l.is("vertical", b.value)
|
|
905
905
|
]), S = V(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), D = (h) => {
|
|
906
|
-
|
|
906
|
+
d.value.push(h);
|
|
907
907
|
}, $ = (h) => {
|
|
908
|
-
const v =
|
|
909
|
-
v > -1 &&
|
|
908
|
+
const v = d.value.indexOf(h);
|
|
909
|
+
v > -1 && d.value.splice(v, 1);
|
|
910
910
|
}, z = async () => {
|
|
911
911
|
let h = !0;
|
|
912
|
-
for (const v of
|
|
912
|
+
for (const v of d.value)
|
|
913
913
|
await v.validate() || (h = !1);
|
|
914
914
|
return h;
|
|
915
|
-
},
|
|
915
|
+
}, O = async (h) => {
|
|
916
916
|
const v = Array.isArray(h) ? h : [h];
|
|
917
917
|
let x = !0;
|
|
918
|
-
for (const A of
|
|
918
|
+
for (const A of d.value)
|
|
919
919
|
v.includes(A.prop) && (await A.validate() || (x = !1));
|
|
920
920
|
return x;
|
|
921
921
|
}, y = () => {
|
|
922
|
-
|
|
922
|
+
d.value.forEach((h) => {
|
|
923
923
|
h.resetField();
|
|
924
924
|
});
|
|
925
|
-
},
|
|
925
|
+
}, R = (h) => {
|
|
926
926
|
if (h) {
|
|
927
927
|
const v = Array.isArray(h) ? h : [h];
|
|
928
|
-
|
|
928
|
+
d.value.forEach((x) => {
|
|
929
929
|
v.includes(x.prop) && x.clearValidate();
|
|
930
930
|
});
|
|
931
931
|
} else
|
|
932
|
-
|
|
932
|
+
d.value.forEach((v) => {
|
|
933
933
|
v.clearValidate();
|
|
934
934
|
});
|
|
935
935
|
}, H = (h) => {
|
|
936
936
|
console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), t("submit");
|
|
937
|
-
},
|
|
937
|
+
}, E = (h) => {
|
|
938
938
|
console.log("[XForm] handleReset triggered", h), h.preventDefault(), y(), t("reset");
|
|
939
939
|
}, M = je(e, "model");
|
|
940
940
|
return $e("form", {
|
|
@@ -950,13 +950,13 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
950
950
|
emit: t
|
|
951
951
|
}), k({
|
|
952
952
|
validate: z,
|
|
953
|
-
validateField:
|
|
953
|
+
validateField: O,
|
|
954
954
|
resetFields: y,
|
|
955
|
-
clearValidate:
|
|
956
|
-
}), (h, v) => (i(),
|
|
955
|
+
clearValidate: R
|
|
956
|
+
}), (h, v) => (i(), c("form", {
|
|
957
957
|
class: u(T.value),
|
|
958
958
|
onSubmit: H,
|
|
959
|
-
onReset:
|
|
959
|
+
onReset: E
|
|
960
960
|
}, [
|
|
961
961
|
se(h.$slots, "default")
|
|
962
962
|
], 34));
|
|
@@ -973,7 +973,7 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
973
973
|
showMessage: { type: Boolean }
|
|
974
974
|
},
|
|
975
975
|
setup(s, { expose: k }) {
|
|
976
|
-
const a = s, e = Le(), t = ae("form-item"), l = xe("form", null),
|
|
976
|
+
const a = s, e = Le(), t = ae("form-item"), l = xe("form", null), d = B(""), m = B(""), b = V(() => a.required ? !0 : T().some((E) => E.required)), T = () => {
|
|
977
977
|
const H = [];
|
|
978
978
|
return a.rules && H.push(...a.rules), l && a.prop && l.rules[a.prop] && H.push(...l.rules[a.prop]), H;
|
|
979
979
|
}, S = () => {
|
|
@@ -983,12 +983,12 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
983
983
|
}, D = (H) => {
|
|
984
984
|
!l || !a.prop || l.model.value && (l.model.value[a.prop] = H);
|
|
985
985
|
}, $ = async (H) => {
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
988
|
-
return
|
|
986
|
+
const E = T();
|
|
987
|
+
if (E.length === 0)
|
|
988
|
+
return d.value = "valid", !0;
|
|
989
989
|
const M = S();
|
|
990
990
|
let h = !0, v = "";
|
|
991
|
-
for (const x of
|
|
991
|
+
for (const x of E)
|
|
992
992
|
if (!(H && x.trigger && x.trigger !== H)) {
|
|
993
993
|
if (x.required && (M == null || M === "" || Array.isArray(M) && M.length === 0)) {
|
|
994
994
|
h = !1, v = x.message || "该字段为必填项";
|
|
@@ -1011,9 +1011,9 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1011
1011
|
}
|
|
1012
1012
|
if (x.validator)
|
|
1013
1013
|
try {
|
|
1014
|
-
await new Promise((A,
|
|
1014
|
+
await new Promise((A, P) => {
|
|
1015
1015
|
x.validator(x, M, (Y) => {
|
|
1016
|
-
Y ?
|
|
1016
|
+
Y ? P(Y) : A();
|
|
1017
1017
|
});
|
|
1018
1018
|
});
|
|
1019
1019
|
} catch (A) {
|
|
@@ -1021,57 +1021,57 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1021
1021
|
break;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
return
|
|
1024
|
+
return d.value = h ? "valid" : "invalid", m.value = v, l && a.prop && l.emit("validate", a.prop, h, v), h;
|
|
1025
1025
|
}, z = () => {
|
|
1026
|
-
D(void 0),
|
|
1027
|
-
},
|
|
1028
|
-
|
|
1026
|
+
D(void 0), O();
|
|
1027
|
+
}, O = () => {
|
|
1028
|
+
d.value = "", m.value = "";
|
|
1029
1029
|
}, y = V(() => [
|
|
1030
1030
|
t.b(),
|
|
1031
1031
|
t.is("required", b.value),
|
|
1032
|
-
t.is("error",
|
|
1033
|
-
t.is("success",
|
|
1034
|
-
]),
|
|
1032
|
+
t.is("error", d.value === "invalid"),
|
|
1033
|
+
t.is("success", d.value === "valid")
|
|
1034
|
+
]), R = V(() => {
|
|
1035
1035
|
const H = a.labelWidth ?? (l == null ? void 0 : l.labelWidth) ?? "100px";
|
|
1036
1036
|
return { width: typeof H == "number" ? `${H}px` : H };
|
|
1037
1037
|
});
|
|
1038
1038
|
return ie(() => S(), () => {
|
|
1039
|
-
|
|
1039
|
+
d.value === "invalid" && $("change");
|
|
1040
1040
|
}), ge(() => {
|
|
1041
1041
|
l && a.prop && l.addField({
|
|
1042
1042
|
prop: a.prop,
|
|
1043
1043
|
validate: $,
|
|
1044
1044
|
resetField: z,
|
|
1045
|
-
clearValidate:
|
|
1045
|
+
clearValidate: O
|
|
1046
1046
|
});
|
|
1047
1047
|
}), De(() => {
|
|
1048
1048
|
l && a.prop && l.removeField({
|
|
1049
1049
|
prop: a.prop,
|
|
1050
1050
|
validate: $,
|
|
1051
1051
|
resetField: z,
|
|
1052
|
-
clearValidate:
|
|
1052
|
+
clearValidate: O
|
|
1053
1053
|
});
|
|
1054
1054
|
}), k({
|
|
1055
1055
|
validate: $,
|
|
1056
1056
|
resetField: z,
|
|
1057
|
-
clearValidate:
|
|
1058
|
-
}), (H,
|
|
1057
|
+
clearValidate: O
|
|
1058
|
+
}), (H, E) => (i(), c("div", {
|
|
1059
1059
|
class: u(y.value)
|
|
1060
1060
|
}, [
|
|
1061
|
-
s.label || n(e).label ? (i(),
|
|
1061
|
+
s.label || n(e).label ? (i(), c("label", {
|
|
1062
1062
|
key: 0,
|
|
1063
1063
|
class: u(n(t).e("label")),
|
|
1064
|
-
style: te(
|
|
1064
|
+
style: te(R.value)
|
|
1065
1065
|
}, [
|
|
1066
1066
|
se(H.$slots, "label", {}, () => [
|
|
1067
|
-
|
|
1067
|
+
ce(N(s.label), 1)
|
|
1068
1068
|
])
|
|
1069
1069
|
], 6)) : U("", !0),
|
|
1070
1070
|
r("div", {
|
|
1071
1071
|
class: u(n(t).e("content"))
|
|
1072
1072
|
}, [
|
|
1073
1073
|
se(H.$slots, "default"),
|
|
1074
|
-
s.showMessage !== !1 &&
|
|
1074
|
+
s.showMessage !== !1 && d.value === "invalid" ? (i(), c("div", {
|
|
1075
1075
|
key: 0,
|
|
1076
1076
|
class: u(n(t).e("error"))
|
|
1077
1077
|
}, N(m.value), 3)) : U("", !0)
|
|
@@ -1082,13 +1082,13 @@ const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee
|
|
|
1082
1082
|
function rl(s, k) {
|
|
1083
1083
|
return new Date(s, k + 1, 0).getDate();
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function cl(s, k) {
|
|
1086
1086
|
return new Date(s, k, 1).getDay();
|
|
1087
1087
|
}
|
|
1088
1088
|
function pe(s, k) {
|
|
1089
1089
|
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
|
|
1090
1090
|
}
|
|
1091
|
-
function
|
|
1091
|
+
function dl(s, k) {
|
|
1092
1092
|
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth();
|
|
1093
1093
|
}
|
|
1094
1094
|
function Ue(s, k, a) {
|
|
@@ -1097,19 +1097,19 @@ function Ue(s, k, a) {
|
|
|
1097
1097
|
return e >= k.getTime() && e <= a.getTime();
|
|
1098
1098
|
}
|
|
1099
1099
|
function vl(s, k, a = 0) {
|
|
1100
|
-
const e = [], t = rl(s, k), l =
|
|
1101
|
-
let
|
|
1100
|
+
const e = [], t = rl(s, k), l = cl(s, k);
|
|
1101
|
+
let d = new Date(s, k, 1);
|
|
1102
1102
|
const m = (l - a + 7) % 7;
|
|
1103
|
-
|
|
1104
|
-
let b = [], T = new Date(
|
|
1103
|
+
d.setDate(1 - m);
|
|
1104
|
+
let b = [], T = new Date(d);
|
|
1105
1105
|
for (; (T.getMonth() <= k || T.getMonth() === k && T.getDate() <= t) && (b.push(new Date(T)), !(b.length === 7 && (e.push(b), b = [], T.getMonth() > k) || (T.setDate(T.getDate() + 1), e.length > 7))); )
|
|
1106
1106
|
;
|
|
1107
1107
|
return b.length > 0 && e.push(b), e;
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1109
|
+
function de(s, k = "YYYY-MM-DD") {
|
|
1110
1110
|
if (!s) return "";
|
|
1111
|
-
const a = s.getFullYear(), e = s.getMonth() + 1, t = s.getDate(), l = s.getHours(),
|
|
1112
|
-
return k.replace(/YYYY/g, String(a)).replace(/YY/g, String(a).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(t).padStart(2, "0")).replace(/D/g, String(t)).replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(
|
|
1111
|
+
const a = s.getFullYear(), e = s.getMonth() + 1, t = s.getDate(), l = s.getHours(), d = s.getMinutes(), m = s.getSeconds();
|
|
1112
|
+
return k.replace(/YYYY/g, String(a)).replace(/YY/g, String(a).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(t).padStart(2, "0")).replace(/D/g, String(t)).replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(d).padStart(2, "0")).replace(/m/g, String(d)).replace(/ss/g, String(m).padStart(2, "0")).replace(/s/g, String(m));
|
|
1113
1113
|
}
|
|
1114
1114
|
function ve(s) {
|
|
1115
1115
|
if (!s || Array.isArray(s)) return null;
|
|
@@ -1186,14 +1186,14 @@ const bl = [
|
|
|
1186
1186
|
},
|
|
1187
1187
|
emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
|
|
1188
1188
|
setup(s, { emit: k }) {
|
|
1189
|
-
const a = s, e = k, t = ae("date-table"), l = B(null),
|
|
1189
|
+
const a = s, e = k, t = ae("date-table"), l = B(null), d = V(() => a.viewedMonth.getFullYear()), m = V(() => a.viewedMonth.getMonth()), b = V(() => vl(d.value, m.value, 0)), T = (h) => a.modelValue ? pe(h, a.modelValue) : !1, S = (h) => pe(h, /* @__PURE__ */ new Date()), D = (h) => dl(h, a.viewedMonth), $ = (h) => {
|
|
1190
1190
|
if (a.selectionMode !== "range") return !1;
|
|
1191
1191
|
const { startDate: v, endDate: x, selecting: A } = a.rangeState || {};
|
|
1192
1192
|
if (A && v) {
|
|
1193
|
-
const
|
|
1194
|
-
if (
|
|
1195
|
-
const Y = v <
|
|
1196
|
-
return Ue(h, Y,
|
|
1193
|
+
const P = l.value;
|
|
1194
|
+
if (P) {
|
|
1195
|
+
const Y = v < P ? v : P, J = v < P ? P : v;
|
|
1196
|
+
return Ue(h, Y, J);
|
|
1197
1197
|
}
|
|
1198
1198
|
return pe(h, v);
|
|
1199
1199
|
}
|
|
@@ -1202,7 +1202,7 @@ const bl = [
|
|
|
1202
1202
|
if (a.selectionMode !== "range") return !1;
|
|
1203
1203
|
const { startDate: v, selecting: x } = a.rangeState || {};
|
|
1204
1204
|
return x && v && l.value ? pe(h, v < l.value ? v : l.value) : v ? pe(h, v) : !1;
|
|
1205
|
-
},
|
|
1205
|
+
}, O = (h) => {
|
|
1206
1206
|
if (a.selectionMode !== "range") return !1;
|
|
1207
1207
|
const { endDate: v, selecting: x } = a.rangeState || {};
|
|
1208
1208
|
if (x && l.value) {
|
|
@@ -1210,48 +1210,48 @@ const bl = [
|
|
|
1210
1210
|
return pe(h, A < l.value ? l.value : A);
|
|
1211
1211
|
}
|
|
1212
1212
|
return v ? pe(h, v) : !1;
|
|
1213
|
-
}, y = (h) => gl(h, a.disabledDate, a.minDate, a.maxDate),
|
|
1213
|
+
}, y = (h) => gl(h, a.disabledDate, a.minDate, a.maxDate), R = (h) => [
|
|
1214
1214
|
t.e("cell"),
|
|
1215
1215
|
t.is("selected", T(h)),
|
|
1216
1216
|
t.is("today", S(h)),
|
|
1217
1217
|
t.is("disabled", y(h)),
|
|
1218
1218
|
t.is("in-range", $(h)),
|
|
1219
1219
|
t.is("range-start", z(h)),
|
|
1220
|
-
t.is("range-end",
|
|
1220
|
+
t.is("range-end", O(h)),
|
|
1221
1221
|
t.is("prev-month", !D(h) && h.getMonth() < m.value),
|
|
1222
1222
|
t.is("next-month", !D(h) && h.getMonth() > m.value)
|
|
1223
1223
|
], H = (h) => {
|
|
1224
1224
|
y(h) || (a.selectionMode === "range" ? e("range-select", h) : e("pick", h));
|
|
1225
|
-
},
|
|
1225
|
+
}, E = (h) => {
|
|
1226
1226
|
l.value = h;
|
|
1227
1227
|
}, M = () => {
|
|
1228
1228
|
l.value = null;
|
|
1229
1229
|
};
|
|
1230
|
-
return (h, v) => (i(),
|
|
1230
|
+
return (h, v) => (i(), c("table", {
|
|
1231
1231
|
class: u(n(t).b()),
|
|
1232
1232
|
cellspacing: "0",
|
|
1233
1233
|
cellpadding: "0"
|
|
1234
1234
|
}, [
|
|
1235
1235
|
r("thead", null, [
|
|
1236
1236
|
r("tr", null, [
|
|
1237
|
-
(i(!0),
|
|
1237
|
+
(i(!0), c(Z, null, _(n(yl), (x) => (i(), c("th", {
|
|
1238
1238
|
key: x,
|
|
1239
1239
|
class: u(n(t).e("header-cell"))
|
|
1240
1240
|
}, N(x), 3))), 128))
|
|
1241
1241
|
])
|
|
1242
1242
|
]),
|
|
1243
1243
|
r("tbody", null, [
|
|
1244
|
-
(i(!0),
|
|
1245
|
-
(i(!0),
|
|
1244
|
+
(i(!0), c(Z, null, _(b.value, (x, A) => (i(), c("tr", { key: A }, [
|
|
1245
|
+
(i(!0), c(Z, null, _(x, (P, Y) => (i(), c("td", {
|
|
1246
1246
|
key: Y,
|
|
1247
|
-
class: u(
|
|
1248
|
-
onClick: (
|
|
1249
|
-
onMouseenter: (
|
|
1247
|
+
class: u(R(P)),
|
|
1248
|
+
onClick: (J) => H(P),
|
|
1249
|
+
onMouseenter: (J) => E(P),
|
|
1250
1250
|
onMouseleave: M
|
|
1251
1251
|
}, [
|
|
1252
1252
|
r("span", {
|
|
1253
1253
|
class: u(n(t).e("cell-text"))
|
|
1254
|
-
}, N(
|
|
1254
|
+
}, N(P.getDate()), 3)
|
|
1255
1255
|
], 42, kl))), 128))
|
|
1256
1256
|
]))), 128))
|
|
1257
1257
|
])
|
|
@@ -1269,7 +1269,7 @@ const bl = [
|
|
|
1269
1269
|
setup(s, { emit: k }) {
|
|
1270
1270
|
const a = s, e = k, t = ae("month-table");
|
|
1271
1271
|
V(() => a.modelValue ? a.modelValue.getMonth() : -1);
|
|
1272
|
-
const l = (D) => a.modelValue ? a.modelValue.getFullYear() === a.viewedYear && a.modelValue.getMonth() === D : !1,
|
|
1272
|
+
const l = (D) => a.modelValue ? a.modelValue.getFullYear() === a.viewedYear && a.modelValue.getMonth() === D : !1, d = (D) => {
|
|
1273
1273
|
const $ = /* @__PURE__ */ new Date();
|
|
1274
1274
|
return $.getFullYear() === a.viewedYear && $.getMonth() === D;
|
|
1275
1275
|
}, m = (D) => {
|
|
@@ -1279,7 +1279,7 @@ const bl = [
|
|
|
1279
1279
|
}, b = (D) => [
|
|
1280
1280
|
t.e("cell"),
|
|
1281
1281
|
t.is("selected", l(D)),
|
|
1282
|
-
t.is("current",
|
|
1282
|
+
t.is("current", d(D)),
|
|
1283
1283
|
t.is("disabled", m(D))
|
|
1284
1284
|
], T = (D) => {
|
|
1285
1285
|
m(D) || e("pick", D);
|
|
@@ -1289,17 +1289,17 @@ const bl = [
|
|
|
1289
1289
|
D.push([$, $ + 1, $ + 2]);
|
|
1290
1290
|
return D;
|
|
1291
1291
|
});
|
|
1292
|
-
return (D, $) => (i(),
|
|
1292
|
+
return (D, $) => (i(), c("table", {
|
|
1293
1293
|
class: u(n(t).b()),
|
|
1294
1294
|
cellspacing: "0",
|
|
1295
1295
|
cellpadding: "0"
|
|
1296
1296
|
}, [
|
|
1297
1297
|
r("tbody", null, [
|
|
1298
|
-
(i(!0),
|
|
1299
|
-
(i(!0),
|
|
1298
|
+
(i(!0), c(Z, null, _(S.value, (z, O) => (i(), c("tr", { key: O }, [
|
|
1299
|
+
(i(!0), c(Z, null, _(z, (y) => (i(), c("td", {
|
|
1300
1300
|
key: y,
|
|
1301
1301
|
class: u(b(y)),
|
|
1302
|
-
onClick: (
|
|
1302
|
+
onClick: (R) => T(y)
|
|
1303
1303
|
}, [
|
|
1304
1304
|
r("span", {
|
|
1305
1305
|
class: u(n(t).e("cell-text"))
|
|
@@ -1319,44 +1319,44 @@ const bl = [
|
|
|
1319
1319
|
},
|
|
1320
1320
|
emits: ["pick"],
|
|
1321
1321
|
setup(s, { emit: k }) {
|
|
1322
|
-
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()),
|
|
1323
|
-
const [y] =
|
|
1324
|
-
|
|
1322
|
+
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()), d = V(() => Ke(a.viewedYear)), m = V(() => {
|
|
1323
|
+
const [y] = d.value, R = [];
|
|
1324
|
+
R.push(y - 1);
|
|
1325
1325
|
for (let H = 0; H < 10; H++)
|
|
1326
|
-
|
|
1327
|
-
return
|
|
1326
|
+
R.push(y + H);
|
|
1327
|
+
return R.push(y + 10), R;
|
|
1328
1328
|
}), b = V(() => {
|
|
1329
1329
|
const y = [];
|
|
1330
|
-
for (let
|
|
1331
|
-
y.push(m.value.slice(
|
|
1330
|
+
for (let R = 0; R < m.value.length; R += 3)
|
|
1331
|
+
y.push(m.value.slice(R, R + 3));
|
|
1332
1332
|
return y;
|
|
1333
1333
|
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1, S = (y) => y === l.value, D = (y) => {
|
|
1334
|
-
const [
|
|
1335
|
-
return y >=
|
|
1334
|
+
const [R, H] = d.value;
|
|
1335
|
+
return y >= R && y <= H;
|
|
1336
1336
|
}, $ = (y) => {
|
|
1337
1337
|
if (!a.disabledDate) return !1;
|
|
1338
|
-
const
|
|
1339
|
-
return a.disabledDate(
|
|
1338
|
+
const R = new Date(y, 0, 1), H = new Date(y, 11, 31);
|
|
1339
|
+
return a.disabledDate(R) && a.disabledDate(H);
|
|
1340
1340
|
}, z = (y) => [
|
|
1341
1341
|
t.e("cell"),
|
|
1342
1342
|
t.is("selected", T(y)),
|
|
1343
1343
|
t.is("current", S(y)),
|
|
1344
1344
|
t.is("disabled", $(y)),
|
|
1345
1345
|
t.is("in-decade", D(y))
|
|
1346
|
-
],
|
|
1346
|
+
], O = (y) => {
|
|
1347
1347
|
$(y) || e("pick", y);
|
|
1348
1348
|
};
|
|
1349
|
-
return (y,
|
|
1349
|
+
return (y, R) => (i(), c("table", {
|
|
1350
1350
|
class: u(n(t).b()),
|
|
1351
1351
|
cellspacing: "0",
|
|
1352
1352
|
cellpadding: "0"
|
|
1353
1353
|
}, [
|
|
1354
1354
|
r("tbody", null, [
|
|
1355
|
-
(i(!0),
|
|
1356
|
-
(i(!0),
|
|
1355
|
+
(i(!0), c(Z, null, _(b.value, (H, E) => (i(), c("tr", { key: E }, [
|
|
1356
|
+
(i(!0), c(Z, null, _(H, (M) => (i(), c("td", {
|
|
1357
1357
|
key: M,
|
|
1358
1358
|
class: u(z(M)),
|
|
1359
|
-
onClick: (h) =>
|
|
1359
|
+
onClick: (h) => O(M)
|
|
1360
1360
|
}, [
|
|
1361
1361
|
r("span", {
|
|
1362
1362
|
class: u(n(t).e("cell-text"))
|
|
@@ -1389,184 +1389,184 @@ const bl = [
|
|
|
1389
1389
|
},
|
|
1390
1390
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
|
|
1391
1391
|
setup(s, { expose: k, emit: a }) {
|
|
1392
|
-
const e = s, t = a, l = ae("date-picker"),
|
|
1393
|
-
e.modelValue !== void 0 && t("update:modelValue",
|
|
1392
|
+
const e = s, t = a, l = ae("date-picker"), d = B(!1), m = B(2e3), b = B(), T = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, S = (L) => {
|
|
1393
|
+
e.modelValue !== void 0 && t("update:modelValue", L), e.value !== void 0 && t("update:value", L), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", L), t("change", L);
|
|
1394
1394
|
}, D = B(), $ = B(), z = B({
|
|
1395
1395
|
top: "0px",
|
|
1396
1396
|
left: "0px"
|
|
1397
|
-
}),
|
|
1397
|
+
}), O = () => Oe().next(), y = B("date"), R = B(/* @__PURE__ */ new Date()), H = B({
|
|
1398
1398
|
hours: (/* @__PURE__ */ new Date()).getHours(),
|
|
1399
1399
|
minutes: (/* @__PURE__ */ new Date()).getMinutes(),
|
|
1400
1400
|
seconds: (/* @__PURE__ */ new Date()).getSeconds()
|
|
1401
|
-
}),
|
|
1401
|
+
}), E = B({
|
|
1402
1402
|
selecting: !1,
|
|
1403
1403
|
startDate: null,
|
|
1404
1404
|
endDate: null
|
|
1405
1405
|
}), M = V(() => {
|
|
1406
|
-
const
|
|
1407
|
-
if (!
|
|
1406
|
+
const L = T();
|
|
1407
|
+
if (!L) return null;
|
|
1408
1408
|
if (e.type === "daterange") {
|
|
1409
|
-
if (!Array.isArray(
|
|
1410
|
-
const [
|
|
1409
|
+
if (!Array.isArray(L)) return null;
|
|
1410
|
+
const [F, q] = L;
|
|
1411
1411
|
return [
|
|
1412
|
-
|
|
1413
|
-
|
|
1412
|
+
F instanceof Date ? F : ve(F),
|
|
1413
|
+
q instanceof Date ? q : ve(q)
|
|
1414
1414
|
];
|
|
1415
1415
|
}
|
|
1416
|
-
return
|
|
1416
|
+
return L instanceof Date ? L : ve(L);
|
|
1417
1417
|
}), h = V(() => {
|
|
1418
1418
|
if (e.type === "daterange") return "";
|
|
1419
|
-
const
|
|
1420
|
-
if (!
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1423
|
-
const
|
|
1424
|
-
return
|
|
1419
|
+
const L = T();
|
|
1420
|
+
if (!L) return "";
|
|
1421
|
+
const F = L instanceof Date ? L : ve(L);
|
|
1422
|
+
if (!F) return "";
|
|
1423
|
+
const q = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
|
|
1424
|
+
return de(F, q);
|
|
1425
1425
|
}), v = V(() => {
|
|
1426
|
-
const
|
|
1427
|
-
if (!
|
|
1428
|
-
const [
|
|
1429
|
-
if (!
|
|
1430
|
-
const
|
|
1431
|
-
return
|
|
1426
|
+
const L = T();
|
|
1427
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1428
|
+
const [F] = L;
|
|
1429
|
+
if (!F) return "";
|
|
1430
|
+
const q = F instanceof Date ? F : ve(F);
|
|
1431
|
+
return q ? de(q, e.format) : "";
|
|
1432
1432
|
}), x = V(() => {
|
|
1433
|
-
const
|
|
1434
|
-
if (!
|
|
1435
|
-
const [,
|
|
1436
|
-
if (!
|
|
1437
|
-
const
|
|
1438
|
-
return
|
|
1433
|
+
const L = T();
|
|
1434
|
+
if (!L || !Array.isArray(L)) return "";
|
|
1435
|
+
const [, F] = L;
|
|
1436
|
+
if (!F) return "";
|
|
1437
|
+
const q = F instanceof Date ? F : ve(F);
|
|
1438
|
+
return q ? de(q, e.format) : "";
|
|
1439
1439
|
}), A = V(() => {
|
|
1440
|
-
const
|
|
1441
|
-
return !
|
|
1442
|
-
}),
|
|
1440
|
+
const L = T();
|
|
1441
|
+
return !L || Array.isArray(L) ? null : L instanceof Date ? L : ve(L);
|
|
1442
|
+
}), P = V(() => R.value.getFullYear()), Y = V(() => R.value.getMonth()), J = V(() => Ke(P.value)), p = V(() => y.value === "year" ? `${J.value[0]} 年 - ${J.value[1]} 年` : y.value === "month" ? `${P.value} 年` : `${P.value} 年 ${Y.value + 1} 月`), w = V(() => [
|
|
1443
1443
|
l.b(),
|
|
1444
1444
|
l.m(e.size),
|
|
1445
1445
|
l.is("disabled", e.disabled),
|
|
1446
1446
|
l.is("range", e.type === "daterange")
|
|
1447
1447
|
]), C = V(() => [
|
|
1448
1448
|
l.e("input"),
|
|
1449
|
-
l.is("focus",
|
|
1449
|
+
l.is("focus", d.value),
|
|
1450
1450
|
l.is("has-value", !!h.value || !!(v.value || x.value))
|
|
1451
1451
|
]), o = () => {
|
|
1452
|
-
e.disabled || e.readonly || (
|
|
1452
|
+
e.disabled || e.readonly || (d.value ? g() : f());
|
|
1453
1453
|
}, f = () => {
|
|
1454
|
-
|
|
1454
|
+
d.value = !0, m.value = O(), Se(() => {
|
|
1455
1455
|
if (b.value && D.value) {
|
|
1456
|
-
const
|
|
1457
|
-
let
|
|
1458
|
-
he +
|
|
1459
|
-
top: `${
|
|
1456
|
+
const L = b.value.getBoundingClientRect(), F = D.value.getBoundingClientRect();
|
|
1457
|
+
let q = L.bottom + 8, he = L.left;
|
|
1458
|
+
he + F.width > window.innerWidth && (he = window.innerWidth - F.width - 8), q + F.height > window.innerHeight && (q = L.top - F.height - 8), z.value = {
|
|
1459
|
+
top: `${q}px`,
|
|
1460
1460
|
left: `${he}px`
|
|
1461
1461
|
};
|
|
1462
1462
|
}
|
|
1463
1463
|
}), t("focus", {});
|
|
1464
1464
|
}, g = () => {
|
|
1465
|
-
|
|
1466
|
-
},
|
|
1465
|
+
d.value = !1, y.value = "date", t("blur", {});
|
|
1466
|
+
}, K = (L) => {
|
|
1467
1467
|
if (e.type === "date") {
|
|
1468
|
-
e.showTime && (
|
|
1469
|
-
const
|
|
1470
|
-
S(
|
|
1468
|
+
e.showTime && (L.setHours(H.value.hours), L.setMinutes(H.value.minutes), L.setSeconds(H.value.seconds));
|
|
1469
|
+
const F = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, q = F ? de(L, F) : L;
|
|
1470
|
+
S(q), e.showTime || g();
|
|
1471
1471
|
}
|
|
1472
1472
|
}, ne = () => {
|
|
1473
|
-
const
|
|
1474
|
-
if (
|
|
1475
|
-
const
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1478
|
-
const
|
|
1479
|
-
S(
|
|
1473
|
+
const L = T();
|
|
1474
|
+
if (L) {
|
|
1475
|
+
const F = L instanceof Date ? L : ve(L);
|
|
1476
|
+
if (F) {
|
|
1477
|
+
F.setHours(H.value.hours), F.setMinutes(H.value.minutes), F.setSeconds(H.value.seconds);
|
|
1478
|
+
const q = e.valueFormat ? de(F, e.valueFormat) : F;
|
|
1479
|
+
S(q);
|
|
1480
1480
|
}
|
|
1481
1481
|
} else {
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
const
|
|
1485
|
-
S(
|
|
1482
|
+
const F = /* @__PURE__ */ new Date();
|
|
1483
|
+
F.setHours(H.value.hours), F.setMinutes(H.value.minutes), F.setSeconds(H.value.seconds);
|
|
1484
|
+
const q = e.valueFormat ? de(F, e.valueFormat) : F;
|
|
1485
|
+
S(q);
|
|
1486
1486
|
}
|
|
1487
1487
|
g();
|
|
1488
|
-
},
|
|
1489
|
-
if (!
|
|
1490
|
-
|
|
1488
|
+
}, W = (L) => {
|
|
1489
|
+
if (!E.value.selecting)
|
|
1490
|
+
E.value.selecting = !0, E.value.startDate = L, E.value.endDate = null;
|
|
1491
1491
|
else {
|
|
1492
|
-
|
|
1493
|
-
const
|
|
1494
|
-
S([
|
|
1492
|
+
E.value.selecting = !1, E.value.startDate && L < E.value.startDate ? [E.value.startDate, E.value.endDate] = [L, E.value.startDate] : E.value.endDate = L;
|
|
1493
|
+
const F = e.valueFormat ? de(E.value.startDate, e.valueFormat) : E.value.startDate, q = e.valueFormat ? de(E.value.endDate, e.valueFormat) : E.value.endDate;
|
|
1494
|
+
S([F, q]), g();
|
|
1495
1495
|
}
|
|
1496
|
-
}, re = (
|
|
1497
|
-
if (
|
|
1498
|
-
const
|
|
1499
|
-
S(
|
|
1496
|
+
}, re = (L) => {
|
|
1497
|
+
if (R.value = new Date(P.value, L, 1), e.type === "month") {
|
|
1498
|
+
const F = new Date(P.value, L, 1), q = e.valueFormat ? de(F, e.valueFormat) : F;
|
|
1499
|
+
S(q), g();
|
|
1500
1500
|
} else
|
|
1501
1501
|
y.value = "date";
|
|
1502
|
-
},
|
|
1503
|
-
if (
|
|
1504
|
-
const
|
|
1505
|
-
S(
|
|
1502
|
+
}, j = (L) => {
|
|
1503
|
+
if (R.value = new Date(L, Y.value, 1), e.type === "year") {
|
|
1504
|
+
const F = new Date(L, 0, 1), q = e.valueFormat ? de(F, e.valueFormat) : F;
|
|
1505
|
+
S(q), g();
|
|
1506
1506
|
} else
|
|
1507
1507
|
y.value = "month";
|
|
1508
1508
|
}, me = () => {
|
|
1509
|
-
|
|
1509
|
+
R.value = fl(R.value);
|
|
1510
1510
|
}, ye = () => {
|
|
1511
|
-
|
|
1511
|
+
R.value = ml(R.value);
|
|
1512
1512
|
}, ze = () => {
|
|
1513
|
-
y.value === "year" ?
|
|
1513
|
+
y.value === "year" ? R.value = new Date(P.value - 10, Y.value, 1) : R.value = hl(R.value);
|
|
1514
1514
|
}, we = () => {
|
|
1515
|
-
y.value === "year" ?
|
|
1515
|
+
y.value === "year" ? R.value = new Date(P.value + 10, Y.value, 1) : R.value = pl(R.value);
|
|
1516
1516
|
}, Te = () => {
|
|
1517
1517
|
y.value = "month";
|
|
1518
1518
|
}, Re = () => {
|
|
1519
1519
|
y.value = "year";
|
|
1520
|
-
},
|
|
1521
|
-
S(null), t("clear"),
|
|
1520
|
+
}, I = () => {
|
|
1521
|
+
S(null), t("clear"), E.value = {
|
|
1522
1522
|
selecting: !1,
|
|
1523
1523
|
startDate: null,
|
|
1524
1524
|
endDate: null
|
|
1525
1525
|
};
|
|
1526
|
-
},
|
|
1526
|
+
}, X = (L) => {
|
|
1527
1527
|
if (!b.value) return;
|
|
1528
|
-
const
|
|
1529
|
-
b.value.contains(
|
|
1528
|
+
const F = L.target;
|
|
1529
|
+
b.value.contains(F) || D.value && D.value.contains(F) || g();
|
|
1530
1530
|
};
|
|
1531
1531
|
ie(
|
|
1532
1532
|
T,
|
|
1533
|
-
(
|
|
1534
|
-
if (
|
|
1533
|
+
(L) => {
|
|
1534
|
+
if (L)
|
|
1535
1535
|
if (Array.isArray(M.value)) {
|
|
1536
|
-
const [
|
|
1537
|
-
|
|
1538
|
-
} else M.value && (
|
|
1536
|
+
const [F] = M.value;
|
|
1537
|
+
F && (R.value = new Date(F));
|
|
1538
|
+
} else M.value && (R.value = new Date(M.value));
|
|
1539
1539
|
},
|
|
1540
1540
|
{ immediate: !0 }
|
|
1541
|
-
), ie(
|
|
1542
|
-
|
|
1541
|
+
), ie(d, (L) => {
|
|
1542
|
+
L && (y.value = "date", e.type === "daterange" && (E.value = {
|
|
1543
1543
|
selecting: !1,
|
|
1544
1544
|
startDate: Array.isArray(M.value) ? M.value[0] : null,
|
|
1545
1545
|
endDate: Array.isArray(M.value) ? M.value[1] : null
|
|
1546
1546
|
}));
|
|
1547
1547
|
});
|
|
1548
|
-
const
|
|
1549
|
-
|
|
1548
|
+
const G = (L) => {
|
|
1549
|
+
L.key === "Escape" && g();
|
|
1550
1550
|
};
|
|
1551
1551
|
return ge(() => {
|
|
1552
|
-
document.addEventListener("click",
|
|
1552
|
+
document.addEventListener("click", X), document.addEventListener("keydown", G);
|
|
1553
1553
|
}), De(() => {
|
|
1554
|
-
document.removeEventListener("click",
|
|
1554
|
+
document.removeEventListener("click", X), document.removeEventListener("keydown", G);
|
|
1555
1555
|
}), k({
|
|
1556
1556
|
focus: () => {
|
|
1557
|
-
var
|
|
1558
|
-
return (
|
|
1557
|
+
var L;
|
|
1558
|
+
return (L = $.value) == null ? void 0 : L.focus();
|
|
1559
1559
|
},
|
|
1560
1560
|
blur: () => {
|
|
1561
|
-
var
|
|
1562
|
-
return (
|
|
1561
|
+
var L;
|
|
1562
|
+
return (L = $.value) == null ? void 0 : L.blur();
|
|
1563
1563
|
}
|
|
1564
|
-
}), (
|
|
1564
|
+
}), (L, F) => (i(), c("div", {
|
|
1565
1565
|
ref_key: "pickerRef",
|
|
1566
1566
|
ref: b,
|
|
1567
1567
|
class: u(w.value)
|
|
1568
1568
|
}, [
|
|
1569
|
-
s.type !== "daterange" ? (i(),
|
|
1569
|
+
s.type !== "daterange" ? (i(), c("div", {
|
|
1570
1570
|
key: 0,
|
|
1571
1571
|
class: u(C.value),
|
|
1572
1572
|
onClick: o
|
|
@@ -1584,16 +1584,16 @@ const bl = [
|
|
|
1584
1584
|
r("span", {
|
|
1585
1585
|
class: u(n(l).e("suffix"))
|
|
1586
1586
|
}, [
|
|
1587
|
-
s.clearable && h.value && !s.disabled ? (i(),
|
|
1587
|
+
s.clearable && h.value && !s.disabled ? (i(), c("span", {
|
|
1588
1588
|
key: 0,
|
|
1589
1589
|
class: u(n(l).e("clear")),
|
|
1590
|
-
onClick: ue(
|
|
1590
|
+
onClick: ue(I, ["stop"])
|
|
1591
1591
|
}, [
|
|
1592
1592
|
Q(n(ee), {
|
|
1593
1593
|
name: "close",
|
|
1594
1594
|
size: 14
|
|
1595
1595
|
})
|
|
1596
|
-
], 2)) : (i(),
|
|
1596
|
+
], 2)) : (i(), c("span", {
|
|
1597
1597
|
key: 1,
|
|
1598
1598
|
class: u(n(l).e("icon"))
|
|
1599
1599
|
}, [
|
|
@@ -1603,7 +1603,7 @@ const bl = [
|
|
|
1603
1603
|
})
|
|
1604
1604
|
], 2))
|
|
1605
1605
|
], 2)
|
|
1606
|
-
], 2)) : (i(),
|
|
1606
|
+
], 2)) : (i(), c("div", {
|
|
1607
1607
|
key: 1,
|
|
1608
1608
|
class: u(C.value),
|
|
1609
1609
|
onClick: o
|
|
@@ -1630,16 +1630,16 @@ const bl = [
|
|
|
1630
1630
|
r("span", {
|
|
1631
1631
|
class: u(n(l).e("suffix"))
|
|
1632
1632
|
}, [
|
|
1633
|
-
s.clearable && (v.value || x.value) && !s.disabled ? (i(),
|
|
1633
|
+
s.clearable && (v.value || x.value) && !s.disabled ? (i(), c("span", {
|
|
1634
1634
|
key: 0,
|
|
1635
1635
|
class: u(n(l).e("clear")),
|
|
1636
|
-
onClick: ue(
|
|
1636
|
+
onClick: ue(I, ["stop"])
|
|
1637
1637
|
}, [
|
|
1638
1638
|
Q(n(ee), {
|
|
1639
1639
|
name: "close",
|
|
1640
1640
|
size: 14
|
|
1641
1641
|
})
|
|
1642
|
-
], 2)) : (i(),
|
|
1642
|
+
], 2)) : (i(), c("span", {
|
|
1643
1643
|
key: 1,
|
|
1644
1644
|
class: u(n(l).e("icon"))
|
|
1645
1645
|
}, [
|
|
@@ -1650,7 +1650,7 @@ const bl = [
|
|
|
1650
1650
|
], 2))
|
|
1651
1651
|
], 2)
|
|
1652
1652
|
], 2)),
|
|
1653
|
-
(i(), fe(
|
|
1653
|
+
(i(), fe(Fe, { to: "body" }, [
|
|
1654
1654
|
Q(Pe, { name: "fade" }, {
|
|
1655
1655
|
default: He(() => [
|
|
1656
1656
|
oe(r("div", {
|
|
@@ -1665,17 +1665,17 @@ const bl = [
|
|
|
1665
1665
|
r("button", {
|
|
1666
1666
|
type: "button",
|
|
1667
1667
|
class: u(n(l).e("prev-btn")),
|
|
1668
|
-
onClick:
|
|
1668
|
+
onClick: F[0] || (F[0] = (q) => y.value === "date" ? me() : ze())
|
|
1669
1669
|
}, " ‹ ", 2),
|
|
1670
1670
|
r("div", {
|
|
1671
1671
|
class: u(n(l).e("header-title"))
|
|
1672
1672
|
}, [
|
|
1673
|
-
y.value === "year" ? (i(),
|
|
1673
|
+
y.value === "year" ? (i(), c("span", {
|
|
1674
1674
|
key: 0,
|
|
1675
|
-
onClick:
|
|
1676
|
-
}, N(p.value), 1)) : (i(),
|
|
1677
|
-
r("span", { onClick: Re }, N(
|
|
1678
|
-
y.value === "date" ? (i(),
|
|
1675
|
+
onClick: F[1] || (F[1] = (q) => y.value = "month")
|
|
1676
|
+
}, N(p.value), 1)) : (i(), c(Z, { key: 1 }, [
|
|
1677
|
+
r("span", { onClick: Re }, N(P.value) + " 年", 1),
|
|
1678
|
+
y.value === "date" ? (i(), c("span", {
|
|
1679
1679
|
key: 0,
|
|
1680
1680
|
onClick: Te
|
|
1681
1681
|
}, N(Y.value + 1) + " 月", 1)) : U("", !0)
|
|
@@ -1684,7 +1684,7 @@ const bl = [
|
|
|
1684
1684
|
r("button", {
|
|
1685
1685
|
type: "button",
|
|
1686
1686
|
class: u(n(l).e("next-btn")),
|
|
1687
|
-
onClick:
|
|
1687
|
+
onClick: F[2] || (F[2] = (q) => y.value === "date" ? ye() : we())
|
|
1688
1688
|
}, " › ", 2)
|
|
1689
1689
|
], 2),
|
|
1690
1690
|
r("div", {
|
|
@@ -1693,29 +1693,29 @@ const bl = [
|
|
|
1693
1693
|
y.value === "date" ? (i(), fe(Ml, {
|
|
1694
1694
|
key: 0,
|
|
1695
1695
|
"model-value": A.value,
|
|
1696
|
-
"viewed-month":
|
|
1696
|
+
"viewed-month": R.value,
|
|
1697
1697
|
"disabled-date": s.disabledDate,
|
|
1698
1698
|
"min-date": s.minDate ? n(ve)(s.minDate) : null,
|
|
1699
1699
|
"max-date": s.maxDate ? n(ve)(s.maxDate) : null,
|
|
1700
1700
|
"selection-mode": s.type === "daterange" ? "range" : "single",
|
|
1701
|
-
"range-state":
|
|
1702
|
-
onPick:
|
|
1703
|
-
onRangeSelect:
|
|
1701
|
+
"range-state": E.value,
|
|
1702
|
+
onPick: K,
|
|
1703
|
+
onRangeSelect: W
|
|
1704
1704
|
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(xl, {
|
|
1705
1705
|
key: 1,
|
|
1706
1706
|
"model-value": A.value,
|
|
1707
|
-
"viewed-year":
|
|
1707
|
+
"viewed-year": P.value,
|
|
1708
1708
|
"disabled-date": s.disabledDate,
|
|
1709
1709
|
onPick: re
|
|
1710
1710
|
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(Cl, {
|
|
1711
1711
|
key: 2,
|
|
1712
1712
|
"model-value": A.value,
|
|
1713
|
-
"viewed-year":
|
|
1713
|
+
"viewed-year": P.value,
|
|
1714
1714
|
"disabled-date": s.disabledDate,
|
|
1715
|
-
onPick:
|
|
1715
|
+
onPick: j
|
|
1716
1716
|
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : U("", !0)
|
|
1717
1717
|
], 2),
|
|
1718
|
-
s.showTime && s.type !== "daterange" ? (i(),
|
|
1718
|
+
s.showTime && s.type !== "daterange" ? (i(), c("div", {
|
|
1719
1719
|
key: 0,
|
|
1720
1720
|
class: u(n(l).e("time"))
|
|
1721
1721
|
}, [
|
|
@@ -1723,13 +1723,13 @@ const bl = [
|
|
|
1723
1723
|
class: u(n(l).e("time-item"))
|
|
1724
1724
|
}, [
|
|
1725
1725
|
oe(r("select", {
|
|
1726
|
-
"onUpdate:modelValue":
|
|
1726
|
+
"onUpdate:modelValue": F[3] || (F[3] = (q) => H.value.hours = q),
|
|
1727
1727
|
class: u(n(l).e("time-select"))
|
|
1728
1728
|
}, [
|
|
1729
|
-
(i(),
|
|
1730
|
-
key:
|
|
1731
|
-
value:
|
|
1732
|
-
}, N(String(
|
|
1729
|
+
(i(), c(Z, null, _(24, (q) => r("option", {
|
|
1730
|
+
key: q,
|
|
1731
|
+
value: q - 1
|
|
1732
|
+
}, N(String(q - 1).padStart(2, "0")), 9, zl)), 64))
|
|
1733
1733
|
], 2), [
|
|
1734
1734
|
[
|
|
1735
1735
|
Ce,
|
|
@@ -1738,19 +1738,19 @@ const bl = [
|
|
|
1738
1738
|
{ number: !0 }
|
|
1739
1739
|
]
|
|
1740
1740
|
]),
|
|
1741
|
-
|
|
1741
|
+
F[6] || (F[6] = r("span", null, "时", -1))
|
|
1742
1742
|
], 2),
|
|
1743
1743
|
r("div", {
|
|
1744
1744
|
class: u(n(l).e("time-item"))
|
|
1745
1745
|
}, [
|
|
1746
1746
|
oe(r("select", {
|
|
1747
|
-
"onUpdate:modelValue":
|
|
1747
|
+
"onUpdate:modelValue": F[4] || (F[4] = (q) => H.value.minutes = q),
|
|
1748
1748
|
class: u(n(l).e("time-select"))
|
|
1749
1749
|
}, [
|
|
1750
|
-
(i(),
|
|
1751
|
-
key:
|
|
1752
|
-
value:
|
|
1753
|
-
}, N(String(
|
|
1750
|
+
(i(), c(Z, null, _(60, (q) => r("option", {
|
|
1751
|
+
key: q,
|
|
1752
|
+
value: q - 1
|
|
1753
|
+
}, N(String(q - 1).padStart(2, "0")), 9, Tl)), 64))
|
|
1754
1754
|
], 2), [
|
|
1755
1755
|
[
|
|
1756
1756
|
Ce,
|
|
@@ -1759,19 +1759,19 @@ const bl = [
|
|
|
1759
1759
|
{ number: !0 }
|
|
1760
1760
|
]
|
|
1761
1761
|
]),
|
|
1762
|
-
|
|
1762
|
+
F[7] || (F[7] = r("span", null, "分", -1))
|
|
1763
1763
|
], 2),
|
|
1764
1764
|
r("div", {
|
|
1765
1765
|
class: u(n(l).e("time-item"))
|
|
1766
1766
|
}, [
|
|
1767
1767
|
oe(r("select", {
|
|
1768
|
-
"onUpdate:modelValue":
|
|
1768
|
+
"onUpdate:modelValue": F[5] || (F[5] = (q) => H.value.seconds = q),
|
|
1769
1769
|
class: u(n(l).e("time-select"))
|
|
1770
1770
|
}, [
|
|
1771
|
-
(i(),
|
|
1772
|
-
key:
|
|
1773
|
-
value:
|
|
1774
|
-
}, N(String(
|
|
1771
|
+
(i(), c(Z, null, _(60, (q) => r("option", {
|
|
1772
|
+
key: q,
|
|
1773
|
+
value: q - 1
|
|
1774
|
+
}, N(String(q - 1).padStart(2, "0")), 9, Hl)), 64))
|
|
1775
1775
|
], 2), [
|
|
1776
1776
|
[
|
|
1777
1777
|
Ce,
|
|
@@ -1780,10 +1780,10 @@ const bl = [
|
|
|
1780
1780
|
{ number: !0 }
|
|
1781
1781
|
]
|
|
1782
1782
|
]),
|
|
1783
|
-
|
|
1783
|
+
F[8] || (F[8] = r("span", null, "秒", -1))
|
|
1784
1784
|
], 2)
|
|
1785
1785
|
], 2)) : U("", !0),
|
|
1786
|
-
s.showTime && s.type !== "daterange" ? (i(),
|
|
1786
|
+
s.showTime && s.type !== "daterange" ? (i(), c("div", {
|
|
1787
1787
|
key: 1,
|
|
1788
1788
|
class: u(n(l).e("footer"))
|
|
1789
1789
|
}, [
|
|
@@ -1794,7 +1794,7 @@ const bl = [
|
|
|
1794
1794
|
}, "确定", 2)
|
|
1795
1795
|
], 2)) : U("", !0)
|
|
1796
1796
|
], 6), [
|
|
1797
|
-
[be,
|
|
1797
|
+
[be, d.value]
|
|
1798
1798
|
])
|
|
1799
1799
|
]),
|
|
1800
1800
|
_: 1
|
|
@@ -1842,57 +1842,57 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1842
1842
|
},
|
|
1843
1843
|
emits: ["confirm", "cancel"],
|
|
1844
1844
|
setup(s, { emit: k }) {
|
|
1845
|
-
const a = s, e = k, t = ae("time-panel"), l = B(0),
|
|
1846
|
-
const
|
|
1847
|
-
for (let
|
|
1848
|
-
|
|
1849
|
-
return
|
|
1845
|
+
const a = s, e = k, t = ae("time-panel"), l = B(0), d = B(0), m = B(0), b = B(), T = B(), S = B(), D = V(() => a.format.includes("ss") || a.format.includes("s")), $ = V(() => {
|
|
1846
|
+
const W = [], re = Math.max(1, a.hourStep);
|
|
1847
|
+
for (let j = 0; j < 24; j += re)
|
|
1848
|
+
W.push(j);
|
|
1849
|
+
return W;
|
|
1850
1850
|
}), z = V(() => {
|
|
1851
|
-
const
|
|
1852
|
-
for (let
|
|
1853
|
-
|
|
1854
|
-
return
|
|
1855
|
-
}),
|
|
1856
|
-
const
|
|
1857
|
-
for (let
|
|
1858
|
-
|
|
1859
|
-
return
|
|
1860
|
-
}), y = V(() => a.disabledHours ? new Set(a.disabledHours()) : /* @__PURE__ */ new Set()),
|
|
1861
|
-
M(
|
|
1862
|
-
}, A = (
|
|
1863
|
-
h(
|
|
1864
|
-
},
|
|
1865
|
-
v(
|
|
1866
|
-
}, Y = (
|
|
1867
|
-
if (!
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1851
|
+
const W = [], re = Math.max(1, a.minuteStep);
|
|
1852
|
+
for (let j = 0; j < 60; j += re)
|
|
1853
|
+
W.push(j);
|
|
1854
|
+
return W;
|
|
1855
|
+
}), O = V(() => {
|
|
1856
|
+
const W = [], re = Math.max(1, a.secondStep);
|
|
1857
|
+
for (let j = 0; j < 60; j += re)
|
|
1858
|
+
W.push(j);
|
|
1859
|
+
return W;
|
|
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, d.value)) : /* @__PURE__ */ new Set()), E = V(() => `${Me(l.value)}:${Me(d.value)}${D.value ? ":" + Me(m.value) : ""}`), M = (W) => y.value.has(W), h = (W) => R.value.has(W), v = (W) => H.value.has(W), x = (W) => {
|
|
1861
|
+
M(W) || (l.value = W, w(b.value, Y(W)));
|
|
1862
|
+
}, A = (W) => {
|
|
1863
|
+
h(W) || (d.value = W, w(T.value, J(W)));
|
|
1864
|
+
}, P = (W) => {
|
|
1865
|
+
v(W) || (m.value = W, w(S.value, p(W)));
|
|
1866
|
+
}, Y = (W) => $.value.indexOf(W), J = (W) => z.value.indexOf(W), p = (W) => O.value.indexOf(W), w = (W, re) => {
|
|
1867
|
+
if (!W) return;
|
|
1868
|
+
const j = 32, ye = re * j + 84 - 200 / 2 + j / 2;
|
|
1869
|
+
W.scrollTop = Math.max(0, ye);
|
|
1870
1870
|
}, C = () => {
|
|
1871
1871
|
if (!b.value) return;
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1872
|
+
const W = b.value.scrollTop, re = Math.round((W - 84 + 100) / 32), j = $.value[Math.max(0, Math.min(re, $.value.length - 1))];
|
|
1873
|
+
j !== void 0 && !M(j) && (l.value = j);
|
|
1874
1874
|
}, o = () => {
|
|
1875
1875
|
if (!T.value) return;
|
|
1876
|
-
const
|
|
1877
|
-
|
|
1876
|
+
const W = T.value.scrollTop, re = Math.round((W - 84 + 100) / 32), j = z.value[Math.max(0, Math.min(re, z.value.length - 1))];
|
|
1877
|
+
j !== void 0 && !h(j) && (d.value = j);
|
|
1878
1878
|
}, f = () => {
|
|
1879
1879
|
if (!S.value) return;
|
|
1880
|
-
const
|
|
1881
|
-
|
|
1880
|
+
const W = S.value.scrollTop, re = Math.round((W - 84 + 100) / 32), j = O.value[Math.max(0, Math.min(re, O.value.length - 1))];
|
|
1881
|
+
j !== void 0 && !v(j) && (m.value = j);
|
|
1882
1882
|
}, g = () => {
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
},
|
|
1883
|
+
const W = a.modelValue ? new Date(a.modelValue) : /* @__PURE__ */ new Date();
|
|
1884
|
+
W.setHours(l.value, d.value, m.value, 0), e("confirm", W);
|
|
1885
|
+
}, K = () => {
|
|
1886
1886
|
e("cancel");
|
|
1887
1887
|
}, ne = () => {
|
|
1888
1888
|
if (a.modelValue)
|
|
1889
|
-
l.value = a.modelValue.getHours(),
|
|
1889
|
+
l.value = a.modelValue.getHours(), d.value = a.modelValue.getMinutes(), m.value = a.modelValue.getSeconds();
|
|
1890
1890
|
else {
|
|
1891
|
-
const
|
|
1892
|
-
l.value =
|
|
1891
|
+
const W = /* @__PURE__ */ new Date();
|
|
1892
|
+
l.value = W.getHours(), d.value = W.getMinutes(), m.value = W.getSeconds();
|
|
1893
1893
|
}
|
|
1894
1894
|
Se(() => {
|
|
1895
|
-
w(b.value, Y(l.value)), w(T.value,
|
|
1895
|
+
w(b.value, Y(l.value)), w(T.value, J(d.value)), D.value && w(S.value, p(m.value));
|
|
1896
1896
|
});
|
|
1897
1897
|
};
|
|
1898
1898
|
return ie(
|
|
@@ -1903,7 +1903,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1903
1903
|
{ immediate: !0 }
|
|
1904
1904
|
), ge(() => {
|
|
1905
1905
|
ne();
|
|
1906
|
-
}), (
|
|
1906
|
+
}), (W, re) => (i(), c("div", {
|
|
1907
1907
|
class: u(n(t).b())
|
|
1908
1908
|
}, [
|
|
1909
1909
|
r("div", {
|
|
@@ -1921,11 +1921,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1921
1921
|
r("div", {
|
|
1922
1922
|
class: u(n(t).e("padding"))
|
|
1923
1923
|
}, null, 2),
|
|
1924
|
-
(i(!0),
|
|
1925
|
-
key:
|
|
1926
|
-
class: u([n(t).e("item"), n(t).is("selected", l.value ===
|
|
1927
|
-
onClick: (me) => x(
|
|
1928
|
-
}, N(n(Me)(
|
|
1924
|
+
(i(!0), c(Z, null, _($.value, (j) => (i(), c("div", {
|
|
1925
|
+
key: j,
|
|
1926
|
+
class: u([n(t).e("item"), n(t).is("selected", l.value === j), n(t).is("disabled", M(j))]),
|
|
1927
|
+
onClick: (me) => x(j)
|
|
1928
|
+
}, N(n(Me)(j)), 11, Ll))), 128)),
|
|
1929
1929
|
r("div", {
|
|
1930
1930
|
class: u(n(t).e("padding"))
|
|
1931
1931
|
}, null, 2)
|
|
@@ -1939,16 +1939,16 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1939
1939
|
r("div", {
|
|
1940
1940
|
class: u(n(t).e("padding"))
|
|
1941
1941
|
}, null, 2),
|
|
1942
|
-
(i(!0),
|
|
1943
|
-
key:
|
|
1944
|
-
class: u([n(t).e("item"), n(t).is("selected",
|
|
1945
|
-
onClick: (me) => A(
|
|
1946
|
-
}, N(n(Me)(
|
|
1942
|
+
(i(!0), c(Z, null, _(z.value, (j) => (i(), c("div", {
|
|
1943
|
+
key: j,
|
|
1944
|
+
class: u([n(t).e("item"), n(t).is("selected", d.value === j), n(t).is("disabled", h(j))]),
|
|
1945
|
+
onClick: (me) => A(j)
|
|
1946
|
+
}, N(n(Me)(j)), 11, Rl))), 128)),
|
|
1947
1947
|
r("div", {
|
|
1948
1948
|
class: u(n(t).e("padding"))
|
|
1949
1949
|
}, null, 2)
|
|
1950
1950
|
], 34),
|
|
1951
|
-
D.value ? (i(),
|
|
1951
|
+
D.value ? (i(), c("div", {
|
|
1952
1952
|
key: 0,
|
|
1953
1953
|
ref_key: "secondListRef",
|
|
1954
1954
|
ref: S,
|
|
@@ -1958,11 +1958,11 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1958
1958
|
r("div", {
|
|
1959
1959
|
class: u(n(t).e("padding"))
|
|
1960
1960
|
}, null, 2),
|
|
1961
|
-
(i(!0),
|
|
1962
|
-
key:
|
|
1963
|
-
class: u([n(t).e("item"), n(t).is("selected", m.value ===
|
|
1964
|
-
onClick: (me) =>
|
|
1965
|
-
}, N(n(Me)(
|
|
1961
|
+
(i(!0), c(Z, null, _(O.value, (j) => (i(), c("div", {
|
|
1962
|
+
key: j,
|
|
1963
|
+
class: u([n(t).e("item"), n(t).is("selected", m.value === j), n(t).is("disabled", v(j))]),
|
|
1964
|
+
onClick: (me) => P(j)
|
|
1965
|
+
}, N(n(Me)(j)), 11, Bl))), 128)),
|
|
1966
1966
|
r("div", {
|
|
1967
1967
|
class: u(n(t).e("padding"))
|
|
1968
1968
|
}, null, 2)
|
|
@@ -1973,13 +1973,13 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1973
1973
|
}, [
|
|
1974
1974
|
r("span", {
|
|
1975
1975
|
class: u(n(t).e("current-time"))
|
|
1976
|
-
}, N(
|
|
1976
|
+
}, N(E.value), 3),
|
|
1977
1977
|
r("div", {
|
|
1978
1978
|
class: u(n(t).e("actions"))
|
|
1979
1979
|
}, [
|
|
1980
1980
|
r("button", {
|
|
1981
1981
|
class: u(n(t).e("btn-cancel")),
|
|
1982
|
-
onClick:
|
|
1982
|
+
onClick: K
|
|
1983
1983
|
}, "取消", 2),
|
|
1984
1984
|
r("button", {
|
|
1985
1985
|
class: u(n(t).e("btn-confirm")),
|
|
@@ -1989,7 +1989,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
1989
1989
|
], 2)
|
|
1990
1990
|
], 2));
|
|
1991
1991
|
}
|
|
1992
|
-
}),
|
|
1992
|
+
}), Il = ["placeholder", "disabled", "value"], Fl = ["placeholder", "disabled", "value"], Pl = ["placeholder", "disabled", "value"], it = /* @__PURE__ */ le({
|
|
1993
1993
|
name: "XTimePicker",
|
|
1994
1994
|
__name: "index",
|
|
1995
1995
|
props: {
|
|
@@ -2013,28 +2013,28 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2013
2013
|
},
|
|
2014
2014
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
2015
2015
|
setup(s, { expose: k, emit: a }) {
|
|
2016
|
-
const e = s, t = a, l = ae("time-picker"),
|
|
2016
|
+
const e = s, t = a, l = ae("time-picker"), d = () => Oe().next(), m = B(!1), b = B(2e3), T = B(), S = B(), D = B(), $ = B({
|
|
2017
2017
|
top: "0px",
|
|
2018
2018
|
left: "0px"
|
|
2019
2019
|
}), z = B({
|
|
2020
2020
|
startTime: null,
|
|
2021
2021
|
endTime: null
|
|
2022
|
-
}),
|
|
2022
|
+
}), O = B("start"), y = V(() => {
|
|
2023
2023
|
if (!e.modelValue) return null;
|
|
2024
2024
|
if (e.type === "timerange") {
|
|
2025
2025
|
const [f, g] = e.modelValue;
|
|
2026
2026
|
return [Ae(f), Ae(g)];
|
|
2027
2027
|
}
|
|
2028
2028
|
return Ae(e.modelValue);
|
|
2029
|
-
}),
|
|
2029
|
+
}), R = V(() => !y.value || Array.isArray(y.value) ? "" : ke(y.value, e.format)), H = V(() => {
|
|
2030
2030
|
if (!Array.isArray(y.value)) return "";
|
|
2031
2031
|
const [f] = y.value;
|
|
2032
2032
|
return f ? ke(f, e.format) : "";
|
|
2033
|
-
}),
|
|
2033
|
+
}), E = V(() => {
|
|
2034
2034
|
if (!Array.isArray(y.value)) return "";
|
|
2035
2035
|
const [, f] = y.value;
|
|
2036
2036
|
return f ? ke(f, e.format) : "";
|
|
2037
|
-
}), M = V(() => e.type === "timerange" ?
|
|
2037
|
+
}), M = V(() => e.type === "timerange" ? O.value === "start" ? z.value.startTime : z.value.endTime || z.value.startTime : y.value), h = V(() => [
|
|
2038
2038
|
l.b(),
|
|
2039
2039
|
l.m(e.size),
|
|
2040
2040
|
l.is("disabled", e.disabled),
|
|
@@ -2043,30 +2043,30 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2043
2043
|
l.e("input"),
|
|
2044
2044
|
l.is("focus", m.value)
|
|
2045
2045
|
]), x = () => {
|
|
2046
|
-
e.disabled || e.readonly || (m.value ? Y() :
|
|
2046
|
+
e.disabled || e.readonly || (m.value ? Y() : P());
|
|
2047
2047
|
}, A = (f) => {
|
|
2048
|
-
e.disabled || e.readonly || (
|
|
2049
|
-
},
|
|
2050
|
-
m.value = !0, b.value =
|
|
2048
|
+
e.disabled || e.readonly || (O.value = f, m.value || P());
|
|
2049
|
+
}, P = () => {
|
|
2050
|
+
m.value = !0, b.value = d(), Se(() => {
|
|
2051
2051
|
if (T.value && S.value) {
|
|
2052
2052
|
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: `${
|
|
2053
|
+
let K = f.bottom + 8, ne = f.left;
|
|
2054
|
+
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8), K + g.height > window.innerHeight && (K = f.top - g.height - 8), $.value = {
|
|
2055
|
+
top: `${K}px`,
|
|
2056
2056
|
left: `${ne}px`
|
|
2057
2057
|
};
|
|
2058
2058
|
}
|
|
2059
2059
|
}), t("focus", {});
|
|
2060
2060
|
}, Y = () => {
|
|
2061
2061
|
m.value = !1, t("blur", {});
|
|
2062
|
-
},
|
|
2062
|
+
}, J = (f) => {
|
|
2063
2063
|
if (e.type === "timerange")
|
|
2064
|
-
if (
|
|
2065
|
-
z.value.startTime = f,
|
|
2064
|
+
if (O.value === "start")
|
|
2065
|
+
z.value.startTime = f, O.value = "end", z.value.endTime && z.value.endTime < f && (z.value.endTime = null);
|
|
2066
2066
|
else {
|
|
2067
2067
|
z.value.startTime && f < z.value.startTime ? (z.value.endTime = z.value.startTime, z.value.startTime = f) : z.value.endTime = f;
|
|
2068
|
-
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime,
|
|
2069
|
-
t("update:modelValue", [g,
|
|
2068
|
+
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;
|
|
2069
|
+
t("update:modelValue", [g, K]), t("change", [g, K]), Y();
|
|
2070
2070
|
}
|
|
2071
2071
|
else {
|
|
2072
2072
|
const g = e.valueFormat ? ke(f, e.valueFormat) : f;
|
|
@@ -2088,10 +2088,10 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2088
2088
|
() => e.modelValue,
|
|
2089
2089
|
(f) => {
|
|
2090
2090
|
if (f && e.type === "timerange") {
|
|
2091
|
-
const [g,
|
|
2091
|
+
const [g, K] = y.value;
|
|
2092
2092
|
z.value = {
|
|
2093
2093
|
startTime: g,
|
|
2094
|
-
endTime:
|
|
2094
|
+
endTime: K
|
|
2095
2095
|
};
|
|
2096
2096
|
}
|
|
2097
2097
|
},
|
|
@@ -2100,7 +2100,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2100
2100
|
f && e.type === "timerange" && (z.value = {
|
|
2101
2101
|
startTime: Array.isArray(y.value) ? y.value[0] : null,
|
|
2102
2102
|
endTime: Array.isArray(y.value) ? y.value[1] : null
|
|
2103
|
-
},
|
|
2103
|
+
}, O.value = "start");
|
|
2104
2104
|
});
|
|
2105
2105
|
const o = (f) => {
|
|
2106
2106
|
f.key === "Escape" && Y();
|
|
@@ -2118,12 +2118,12 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2118
2118
|
var f;
|
|
2119
2119
|
return (f = D.value) == null ? void 0 : f.blur();
|
|
2120
2120
|
}
|
|
2121
|
-
}), (f, g) => (i(),
|
|
2121
|
+
}), (f, g) => (i(), c("div", {
|
|
2122
2122
|
ref_key: "pickerRef",
|
|
2123
2123
|
ref: T,
|
|
2124
2124
|
class: u(h.value)
|
|
2125
2125
|
}, [
|
|
2126
|
-
s.type !== "timerange" ? (i(),
|
|
2126
|
+
s.type !== "timerange" ? (i(), c("div", {
|
|
2127
2127
|
key: 0,
|
|
2128
2128
|
class: u(v.value),
|
|
2129
2129
|
onClick: x
|
|
@@ -2135,13 +2135,13 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2135
2135
|
placeholder: s.placeholder,
|
|
2136
2136
|
disabled: s.disabled,
|
|
2137
2137
|
readonly: !0,
|
|
2138
|
-
value:
|
|
2138
|
+
value: R.value,
|
|
2139
2139
|
class: u(n(l).e("input-inner"))
|
|
2140
|
-
}, null, 10,
|
|
2140
|
+
}, null, 10, Il),
|
|
2141
2141
|
r("span", {
|
|
2142
2142
|
class: u(n(l).e("suffix"))
|
|
2143
2143
|
}, [
|
|
2144
|
-
s.clearable &&
|
|
2144
|
+
s.clearable && R.value && !s.disabled ? (i(), c("span", {
|
|
2145
2145
|
key: 0,
|
|
2146
2146
|
class: u(n(l).e("clear")),
|
|
2147
2147
|
onClick: ue(w, ["stop"])
|
|
@@ -2150,7 +2150,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2150
2150
|
name: "close",
|
|
2151
2151
|
size: 14
|
|
2152
2152
|
})
|
|
2153
|
-
], 2)) : (i(),
|
|
2153
|
+
], 2)) : (i(), c("span", {
|
|
2154
2154
|
key: 1,
|
|
2155
2155
|
class: u(n(l).e("icon"))
|
|
2156
2156
|
}, [
|
|
@@ -2160,7 +2160,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2160
2160
|
})
|
|
2161
2161
|
], 2))
|
|
2162
2162
|
], 2)
|
|
2163
|
-
], 2)) : (i(),
|
|
2163
|
+
], 2)) : (i(), c("div", {
|
|
2164
2164
|
key: 1,
|
|
2165
2165
|
class: u(v.value),
|
|
2166
2166
|
onClick: x
|
|
@@ -2171,9 +2171,9 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2171
2171
|
disabled: s.disabled,
|
|
2172
2172
|
readonly: !0,
|
|
2173
2173
|
value: H.value,
|
|
2174
|
-
class: u([n(l).e("input-inner"), n(l).is("active",
|
|
2175
|
-
onClick: g[0] || (g[0] = ue((
|
|
2176
|
-
}, null, 10,
|
|
2174
|
+
class: u([n(l).e("input-inner"), n(l).is("active", O.value === "start")]),
|
|
2175
|
+
onClick: g[0] || (g[0] = ue((K) => A("start"), ["stop"]))
|
|
2176
|
+
}, null, 10, Fl),
|
|
2177
2177
|
r("span", {
|
|
2178
2178
|
class: u(n(l).e("separator"))
|
|
2179
2179
|
}, "至", 2),
|
|
@@ -2182,14 +2182,14 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2182
2182
|
placeholder: s.endPlaceholder,
|
|
2183
2183
|
disabled: s.disabled,
|
|
2184
2184
|
readonly: !0,
|
|
2185
|
-
value:
|
|
2186
|
-
class: u([n(l).e("input-inner"), n(l).is("active",
|
|
2187
|
-
onClick: g[1] || (g[1] = ue((
|
|
2185
|
+
value: E.value,
|
|
2186
|
+
class: u([n(l).e("input-inner"), n(l).is("active", O.value === "end")]),
|
|
2187
|
+
onClick: g[1] || (g[1] = ue((K) => A("end"), ["stop"]))
|
|
2188
2188
|
}, null, 10, Pl),
|
|
2189
2189
|
r("span", {
|
|
2190
2190
|
class: u(n(l).e("suffix"))
|
|
2191
2191
|
}, [
|
|
2192
|
-
s.clearable && (H.value ||
|
|
2192
|
+
s.clearable && (H.value || E.value) && !s.disabled ? (i(), c("span", {
|
|
2193
2193
|
key: 0,
|
|
2194
2194
|
class: u(n(l).e("clear")),
|
|
2195
2195
|
onClick: ue(w, ["stop"])
|
|
@@ -2198,7 +2198,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2198
2198
|
name: "close",
|
|
2199
2199
|
size: 14
|
|
2200
2200
|
})
|
|
2201
|
-
], 2)) : (i(),
|
|
2201
|
+
], 2)) : (i(), c("span", {
|
|
2202
2202
|
key: 1,
|
|
2203
2203
|
class: u(n(l).e("icon"))
|
|
2204
2204
|
}, [
|
|
@@ -2209,7 +2209,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2209
2209
|
], 2))
|
|
2210
2210
|
], 2)
|
|
2211
2211
|
], 2)),
|
|
2212
|
-
(i(), fe(
|
|
2212
|
+
(i(), fe(Fe, { to: "body" }, [
|
|
2213
2213
|
Q(Pe, { name: "fade" }, {
|
|
2214
2214
|
default: He(() => [
|
|
2215
2215
|
oe(r("div", {
|
|
@@ -2218,10 +2218,10 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2218
2218
|
class: u(n(l).e("popper")),
|
|
2219
2219
|
style: te({ zIndex: b.value, ...$.value })
|
|
2220
2220
|
}, [
|
|
2221
|
-
s.type === "timerange" ? (i(),
|
|
2221
|
+
s.type === "timerange" ? (i(), c("div", {
|
|
2222
2222
|
key: 0,
|
|
2223
2223
|
class: u(n(l).e("popper-header"))
|
|
2224
|
-
}, N(
|
|
2224
|
+
}, N(O.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : U("", !0),
|
|
2225
2225
|
Q(Al, {
|
|
2226
2226
|
"model-value": M.value,
|
|
2227
2227
|
format: s.format,
|
|
@@ -2231,7 +2231,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2231
2231
|
"hour-step": s.hourStep,
|
|
2232
2232
|
"minute-step": s.minuteStep,
|
|
2233
2233
|
"second-step": s.secondStep,
|
|
2234
|
-
onConfirm:
|
|
2234
|
+
onConfirm: J,
|
|
2235
2235
|
onCancel: p
|
|
2236
2236
|
}, null, 8, ["model-value", "format", "disabled-hours", "disabled-minutes", "disabled-seconds", "hour-step", "minute-step", "second-step"])
|
|
2237
2237
|
], 6), [
|
|
@@ -2244,7 +2244,7 @@ const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */
|
|
|
2244
2244
|
], 2));
|
|
2245
2245
|
}
|
|
2246
2246
|
});
|
|
2247
|
-
function
|
|
2247
|
+
function Ol(s, k, a) {
|
|
2248
2248
|
return a ? a(k, s) : s.toLowerCase().includes(k.toLowerCase());
|
|
2249
2249
|
}
|
|
2250
2250
|
function We(s, k, a = "value", e = "children") {
|
|
@@ -2258,10 +2258,10 @@ function We(s, k, a = "value", e = "children") {
|
|
|
2258
2258
|
}
|
|
2259
2259
|
return null;
|
|
2260
2260
|
}
|
|
2261
|
-
function
|
|
2261
|
+
function Ie(s, k, a = "value", e = "children") {
|
|
2262
2262
|
const t = [];
|
|
2263
|
-
function l(
|
|
2264
|
-
for (const m of
|
|
2263
|
+
function l(d) {
|
|
2264
|
+
for (const m of d) {
|
|
2265
2265
|
if (m[a] === k)
|
|
2266
2266
|
return t.push(m), !0;
|
|
2267
2267
|
if (m[e] && m[e].length > 0) {
|
|
@@ -2274,11 +2274,11 @@ function Fe(s, k, a = "value", e = "children") {
|
|
|
2274
2274
|
}
|
|
2275
2275
|
return l(s), t;
|
|
2276
2276
|
}
|
|
2277
|
-
function
|
|
2277
|
+
function El(s, k = "children") {
|
|
2278
2278
|
const a = [];
|
|
2279
|
-
function e(t, l = 0,
|
|
2279
|
+
function e(t, l = 0, d = null) {
|
|
2280
2280
|
for (const m of t)
|
|
2281
|
-
a.push({ ...m, level: l, parent:
|
|
2281
|
+
a.push({ ...m, level: l, parent: d }), m[k] && m[k].length > 0 && e(m[k], l + 1, m);
|
|
2282
2282
|
}
|
|
2283
2283
|
return e(s), a;
|
|
2284
2284
|
}
|
|
@@ -2311,180 +2311,215 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2311
2311
|
setup(s, { emit: k }) {
|
|
2312
2312
|
const a = le({
|
|
2313
2313
|
name: "XSelectPopperContent",
|
|
2314
|
-
setup(
|
|
2315
|
-
const
|
|
2316
|
-
return
|
|
2317
|
-
var
|
|
2318
|
-
return (
|
|
2314
|
+
setup(I, { slots: X }) {
|
|
2315
|
+
const G = xe("select");
|
|
2316
|
+
return G && $e("select", G), () => {
|
|
2317
|
+
var L;
|
|
2318
|
+
return (L = X.default) == null ? void 0 : L.call(X);
|
|
2319
2319
|
};
|
|
2320
2320
|
}
|
|
2321
|
-
}), e = s, t = k, l = ae("select"),
|
|
2322
|
-
const
|
|
2323
|
-
let
|
|
2321
|
+
}), e = s, t = k, l = ae("select"), d = Le(), m = () => {
|
|
2322
|
+
const I = Oe();
|
|
2323
|
+
let X = I.current;
|
|
2324
2324
|
document.querySelectorAll(
|
|
2325
2325
|
".x-drawer__overlay, .x-modal__overlay, .x-select__popper, .x-dropdown__popper, .x-popover__popper"
|
|
2326
|
-
).forEach((
|
|
2327
|
-
const
|
|
2328
|
-
!isNaN(
|
|
2326
|
+
).forEach((F) => {
|
|
2327
|
+
const q = parseInt(getComputedStyle(F).zIndex, 10);
|
|
2328
|
+
!isNaN(q) && q > X && (X = q);
|
|
2329
2329
|
});
|
|
2330
|
-
const
|
|
2331
|
-
return
|
|
2332
|
-
}, b = B(), T = B(), S = B(), D = B(!1), $ = B(2e3), z = B(""),
|
|
2333
|
-
|
|
2334
|
-
},
|
|
2335
|
-
|
|
2330
|
+
const L = X + 1;
|
|
2331
|
+
return I.set(L), L;
|
|
2332
|
+
}, b = B(), T = B(), S = B(), D = B(!1), $ = B(2e3), z = B(""), O = B(-1), y = B({ top: "0px", left: "0px" }), R = B([]), H = (I) => {
|
|
2333
|
+
R.value.find((X) => X.value === I.value) || R.value.push(I);
|
|
2334
|
+
}, E = V(() => e.type === "multiple" || e.mode === "multiple"), M = V(() => e.type === "cascader"), h = B([]), v = V(() => {
|
|
2335
|
+
const I = e.options && e.options.length > 0 ? e.options : [], X = R.value;
|
|
2336
|
+
if (X.length === 0) return I;
|
|
2337
|
+
if (I.length === 0) return X;
|
|
2338
|
+
const G = new Set(X.map((F) => F.value)), L = [...X];
|
|
2339
|
+
for (const F of I)
|
|
2340
|
+
G.has(F.value) || L.push(F);
|
|
2341
|
+
return L;
|
|
2342
|
+
}), x = (I) => {
|
|
2343
|
+
t("update:modelValue", I), t("update:value", I), t("change", I);
|
|
2336
2344
|
}, A = V(() => {
|
|
2337
|
-
const
|
|
2338
|
-
return
|
|
2339
|
-
}),
|
|
2340
|
-
const
|
|
2341
|
-
return M.value ?
|
|
2342
|
-
}), Y = V(() => !e.filterable || !z.value ?
|
|
2343
|
-
const
|
|
2344
|
-
return
|
|
2345
|
-
})),
|
|
2346
|
-
const
|
|
2347
|
-
for (const
|
|
2348
|
-
const
|
|
2349
|
-
|
|
2345
|
+
const I = e.modelValue ?? e.value;
|
|
2346
|
+
return E.value ? Array.isArray(I) ? I : [] : M.value ? Array.isArray(I) ? I : I != null && I !== "" ? [I] : [] : I != null && I !== "" ? [I] : [];
|
|
2347
|
+
}), P = V(() => {
|
|
2348
|
+
const I = v.value;
|
|
2349
|
+
return M.value ? El(I, e.childrenKey) : I.map((X) => ({ ...X, level: 0 }));
|
|
2350
|
+
}), Y = V(() => !e.filterable || !z.value ? P.value : P.value.filter((I) => {
|
|
2351
|
+
const X = I[e.labelKey] || "";
|
|
2352
|
+
return Ol(X, z.value, e.filterMethod);
|
|
2353
|
+
})), J = V(() => {
|
|
2354
|
+
const I = [];
|
|
2355
|
+
for (const X of A.value) {
|
|
2356
|
+
const G = We(v.value, X, e.valueKey, e.childrenKey);
|
|
2357
|
+
G && I.push(G);
|
|
2350
2358
|
}
|
|
2351
|
-
return
|
|
2359
|
+
return I;
|
|
2352
2360
|
}), p = V(() => {
|
|
2353
|
-
if (
|
|
2361
|
+
if (E.value)
|
|
2354
2362
|
return "";
|
|
2355
2363
|
if (M.value)
|
|
2356
|
-
return
|
|
2357
|
-
const
|
|
2358
|
-
return
|
|
2359
|
-
}), w = V(() =>
|
|
2364
|
+
return Ie(v.value, A.value[A.value.length - 1], e.valueKey, e.childrenKey).map((G) => G[e.labelKey]).join(e.separator);
|
|
2365
|
+
const I = J.value[0];
|
|
2366
|
+
return I ? I[e.labelKey] : "";
|
|
2367
|
+
}), w = V(() => E.value ? J.value : []), C = V(() => e.collapseTags ? w.value.slice(0, e.maxCollapseTags) : w.value), o = V(() => e.collapseTags ? Math.max(0, w.value.length - e.maxCollapseTags) : 0), f = V(() => [
|
|
2360
2368
|
l.b(),
|
|
2361
2369
|
l.m(e.size),
|
|
2362
2370
|
l.is("disabled", e.disabled),
|
|
2363
|
-
l.is("multiple",
|
|
2371
|
+
l.is("multiple", E.value),
|
|
2364
2372
|
l.is("cascader", M.value),
|
|
2365
2373
|
l.is("filterable", e.filterable),
|
|
2366
2374
|
l.is("focus", D.value)
|
|
2367
2375
|
]), g = () => {
|
|
2368
2376
|
if (!b.value || !S.value || !D.value) return;
|
|
2369
|
-
const
|
|
2370
|
-
|
|
2371
|
-
const
|
|
2372
|
-
let
|
|
2373
|
-
|
|
2374
|
-
let
|
|
2375
|
-
if (
|
|
2376
|
-
const he =
|
|
2377
|
+
const I = b.value.getBoundingClientRect(), X = S.value;
|
|
2378
|
+
X.offsetHeight;
|
|
2379
|
+
const G = X.getBoundingClientRect();
|
|
2380
|
+
let L = I.bottom + 4, F = I.left;
|
|
2381
|
+
F + G.width > window.innerWidth && (F = window.innerWidth - G.width - 8);
|
|
2382
|
+
let q = 274;
|
|
2383
|
+
if (L + G.height > window.innerHeight) {
|
|
2384
|
+
const he = I.top - G.height - 4;
|
|
2377
2385
|
if (he >= 8)
|
|
2378
|
-
|
|
2386
|
+
L = he;
|
|
2379
2387
|
else {
|
|
2380
|
-
const
|
|
2381
|
-
Ye >
|
|
2388
|
+
const Ee = window.innerHeight - I.bottom - 8, Ye = I.top - 8;
|
|
2389
|
+
Ye > Ee ? (L = 8, q = Math.max(120, Ye)) : q = Math.max(120, Ee);
|
|
2382
2390
|
}
|
|
2383
2391
|
}
|
|
2384
2392
|
y.value = {
|
|
2385
|
-
top: `${
|
|
2386
|
-
left: `${
|
|
2387
|
-
maxHeight: `${
|
|
2393
|
+
top: `${L}px`,
|
|
2394
|
+
left: `${F}px`,
|
|
2395
|
+
maxHeight: `${q}px`
|
|
2388
2396
|
};
|
|
2389
|
-
},
|
|
2390
|
-
e.disabled
|
|
2397
|
+
}, K = () => {
|
|
2398
|
+
if (e.disabled) return;
|
|
2399
|
+
D.value = !0, $.value = m(), z.value = "", console.log("[XSelect-Debug] showPopper 触发", (() => {
|
|
2400
|
+
var X;
|
|
2401
|
+
return {
|
|
2402
|
+
visible: D.value,
|
|
2403
|
+
zIndex: $.value,
|
|
2404
|
+
"props.options.length": ((X = e.options) == null ? void 0 : X.length) ?? -1,
|
|
2405
|
+
"slotOptions.length": R.value.length,
|
|
2406
|
+
"mergedOptions.length": v.value.length,
|
|
2407
|
+
"filteredOptions.length": Y.value.length,
|
|
2408
|
+
hasDefaultSlot: !!d.default
|
|
2409
|
+
};
|
|
2410
|
+
})()), Se(() => {
|
|
2391
2411
|
requestAnimationFrame(() => {
|
|
2392
|
-
g()
|
|
2412
|
+
if (g(), S.value) {
|
|
2413
|
+
const X = S.value.getBoundingClientRect(), G = getComputedStyle(S.value);
|
|
2414
|
+
console.log("[XSelect-Debug] 定位后 popper DOM", {
|
|
2415
|
+
display: G.display,
|
|
2416
|
+
visibility: G.visibility,
|
|
2417
|
+
opacity: G.opacity,
|
|
2418
|
+
zIndex: G.zIndex,
|
|
2419
|
+
top: G.top,
|
|
2420
|
+
left: G.left,
|
|
2421
|
+
"rect.top": X.top,
|
|
2422
|
+
"rect.height": X.height,
|
|
2423
|
+
"visible.value 仍为 true?": D.value
|
|
2424
|
+
});
|
|
2425
|
+
}
|
|
2393
2426
|
});
|
|
2394
|
-
}), t("visible-change", !0), t("focus", {})
|
|
2395
|
-
}, ne = () => {
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2427
|
+
}), t("visible-change", !0), t("focus", {});
|
|
2428
|
+
}, ne = (I = "unknown") => {
|
|
2429
|
+
var X;
|
|
2430
|
+
console.log(`[XSelect-Debug] hidePopper reason=${I}`, (X = new Error().stack) == null ? void 0 : X.split(`
|
|
2431
|
+
`).slice(2, 5).join(" | ")), D.value = !1, z.value = "", h.value = [], t("visible-change", !1), t("blur", {});
|
|
2432
|
+
}, W = (I) => {
|
|
2433
|
+
if (!I.disabled)
|
|
2434
|
+
if (E.value) {
|
|
2435
|
+
const X = [...A.value], G = I[e.valueKey], L = X.indexOf(G);
|
|
2436
|
+
if (L > -1)
|
|
2437
|
+
X.splice(L, 1), t("remove-tag", G);
|
|
2403
2438
|
else {
|
|
2404
|
-
if (e.multipleLimit > 0 &&
|
|
2439
|
+
if (e.multipleLimit > 0 && X.length >= e.multipleLimit)
|
|
2405
2440
|
return;
|
|
2406
|
-
|
|
2441
|
+
X.push(G);
|
|
2407
2442
|
}
|
|
2408
|
-
x(
|
|
2443
|
+
x(X);
|
|
2409
2444
|
} else if (M.value)
|
|
2410
|
-
if (
|
|
2411
|
-
const
|
|
2412
|
-
h.value =
|
|
2445
|
+
if (I.children && I.children.length > 0) {
|
|
2446
|
+
const X = Ie(v.value, I[e.valueKey], e.valueKey, e.childrenKey);
|
|
2447
|
+
h.value = X;
|
|
2413
2448
|
} else {
|
|
2414
|
-
const
|
|
2415
|
-
x(
|
|
2449
|
+
const G = Ie(v.value, I[e.valueKey], e.valueKey, e.childrenKey).map((L) => L[e.valueKey]);
|
|
2450
|
+
x(G), ne("cascader-leaf");
|
|
2416
2451
|
}
|
|
2417
2452
|
else
|
|
2418
|
-
x(
|
|
2419
|
-
}, re = (
|
|
2420
|
-
const
|
|
2421
|
-
x(
|
|
2422
|
-
},
|
|
2423
|
-
const
|
|
2424
|
-
x(
|
|
2425
|
-
}, me = (
|
|
2426
|
-
z.value =
|
|
2427
|
-
}, ye = (
|
|
2453
|
+
x(I[e.valueKey]), ne("select-option");
|
|
2454
|
+
}, re = (I) => {
|
|
2455
|
+
const X = A.value.filter((G) => G !== I[e.valueKey]);
|
|
2456
|
+
x(X), t("remove-tag", I[e.valueKey]);
|
|
2457
|
+
}, j = () => {
|
|
2458
|
+
const I = E.value ? [] : "";
|
|
2459
|
+
x(I), t("clear");
|
|
2460
|
+
}, me = (I) => {
|
|
2461
|
+
z.value = I.target.value;
|
|
2462
|
+
}, ye = (I) => {
|
|
2428
2463
|
if (!b.value) return;
|
|
2429
|
-
const
|
|
2430
|
-
b.value.contains(
|
|
2431
|
-
}, ze = (
|
|
2432
|
-
if (
|
|
2433
|
-
ne();
|
|
2434
|
-
else if (
|
|
2435
|
-
const
|
|
2436
|
-
|
|
2437
|
-
} else
|
|
2438
|
-
}, we = (
|
|
2464
|
+
const X = I.target, G = S.value && S.value.contains(X);
|
|
2465
|
+
b.value.contains(X) || G || ne("clickOutside");
|
|
2466
|
+
}, ze = (I) => {
|
|
2467
|
+
if (I.key === "Escape")
|
|
2468
|
+
ne("escape");
|
|
2469
|
+
else if (I.key === "Enter" && D.value) {
|
|
2470
|
+
const X = Y.value[O.value];
|
|
2471
|
+
X && W(X);
|
|
2472
|
+
} else I.key === "ArrowDown" && D.value ? (I.preventDefault(), O.value = Math.min(O.value + 1, Y.value.length - 1)) : I.key === "ArrowUp" && D.value && (I.preventDefault(), O.value = Math.max(O.value - 1, 0));
|
|
2473
|
+
}, we = (I) => A.value.includes(I[e.valueKey]), Te = (I, X) => [
|
|
2439
2474
|
l.e("option"),
|
|
2440
|
-
l.is("selected", we(
|
|
2441
|
-
l.is("disabled",
|
|
2442
|
-
l.is("hover",
|
|
2443
|
-
l.is("group", !!(
|
|
2475
|
+
l.is("selected", we(I)),
|
|
2476
|
+
l.is("disabled", I.disabled === !0),
|
|
2477
|
+
l.is("hover", O.value === X),
|
|
2478
|
+
l.is("group", !!(I.children && I.children.length > 0))
|
|
2444
2479
|
], Re = V(() => {
|
|
2445
2480
|
if (!M.value) return [];
|
|
2446
|
-
const
|
|
2447
|
-
for (const
|
|
2448
|
-
|
|
2449
|
-
return
|
|
2481
|
+
const I = [v.value];
|
|
2482
|
+
for (const X of h.value)
|
|
2483
|
+
X.children && X.children.length > 0 && I.push(X.children);
|
|
2484
|
+
return I;
|
|
2450
2485
|
});
|
|
2451
2486
|
return ge(() => {
|
|
2452
2487
|
document.addEventListener("mousedown", ye), document.addEventListener("keydown", ze);
|
|
2453
2488
|
}), De(() => {
|
|
2454
2489
|
document.removeEventListener("mousedown", ye), document.removeEventListener("keydown", ze), document.removeEventListener("scroll", g, !0);
|
|
2455
|
-
}), ie(D, (
|
|
2456
|
-
|
|
2490
|
+
}), ie(D, (I) => {
|
|
2491
|
+
I ? document.addEventListener("scroll", g, !0) : document.removeEventListener("scroll", g, !0);
|
|
2457
2492
|
}), $e("select", {
|
|
2458
2493
|
selectedValues: A,
|
|
2459
|
-
handleSelect:
|
|
2494
|
+
handleSelect: W,
|
|
2460
2495
|
isSelected: we,
|
|
2461
2496
|
registerOption: H
|
|
2462
|
-
}), (
|
|
2497
|
+
}), (I, X) => (i(), c("div", {
|
|
2463
2498
|
ref_key: "selectRef",
|
|
2464
2499
|
ref: b,
|
|
2465
2500
|
class: u(f.value)
|
|
2466
2501
|
}, [
|
|
2467
2502
|
r("div", {
|
|
2468
2503
|
class: u(n(l).e("wrapper")),
|
|
2469
|
-
onClick:
|
|
2504
|
+
onClick: X[0] || (X[0] = (G) => D.value ? ne("wrapper-toggle") : K())
|
|
2470
2505
|
}, [
|
|
2471
|
-
|
|
2506
|
+
E.value && w.value.length > 0 ? (i(), c("div", {
|
|
2472
2507
|
key: 0,
|
|
2473
2508
|
class: u(n(l).e("tags"))
|
|
2474
2509
|
}, [
|
|
2475
|
-
(i(!0),
|
|
2476
|
-
key:
|
|
2510
|
+
(i(!0), c(Z, null, _(C.value, (G) => (i(), c("span", {
|
|
2511
|
+
key: G[s.valueKey],
|
|
2477
2512
|
class: u(n(l).e("tag"))
|
|
2478
2513
|
}, [
|
|
2479
2514
|
r("span", {
|
|
2480
2515
|
class: u(n(l).e("tag-text"))
|
|
2481
|
-
}, N(
|
|
2516
|
+
}, N(G[s.labelKey]), 3),
|
|
2482
2517
|
r("span", {
|
|
2483
2518
|
class: u(n(l).e("tag-close")),
|
|
2484
|
-
onClick: ue((
|
|
2519
|
+
onClick: ue((L) => re(G), ["stop"])
|
|
2485
2520
|
}, "×", 10, Yl)
|
|
2486
2521
|
], 2))), 128)),
|
|
2487
|
-
o.value > 0 ? (i(),
|
|
2522
|
+
o.value > 0 ? (i(), c("span", {
|
|
2488
2523
|
key: 0,
|
|
2489
2524
|
class: u(n(l).e("tag-count"))
|
|
2490
2525
|
}, " +" + N(o.value), 3)) : U("", !0)
|
|
@@ -2493,7 +2528,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2493
2528
|
ref_key: "inputRef",
|
|
2494
2529
|
ref: T,
|
|
2495
2530
|
class: u(n(l).e("input")),
|
|
2496
|
-
placeholder:
|
|
2531
|
+
placeholder: E.value && w.value.length > 0 ? "" : s.placeholder,
|
|
2497
2532
|
disabled: s.disabled,
|
|
2498
2533
|
readonly: !s.filterable || !D.value,
|
|
2499
2534
|
value: s.filterable && D.value ? z.value : p.value,
|
|
@@ -2502,11 +2537,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2502
2537
|
r("span", {
|
|
2503
2538
|
class: u(n(l).e("suffix"))
|
|
2504
2539
|
}, [
|
|
2505
|
-
s.clearable && A.value.length > 0 && !s.disabled ? (i(),
|
|
2540
|
+
s.clearable && A.value.length > 0 && !s.disabled ? (i(), c("span", {
|
|
2506
2541
|
key: 0,
|
|
2507
2542
|
class: u(n(l).e("clear")),
|
|
2508
|
-
onClick: ue(
|
|
2509
|
-
}, "×", 2)) : (i(),
|
|
2543
|
+
onClick: ue(j, ["stop"])
|
|
2544
|
+
}, "×", 2)) : (i(), c("span", {
|
|
2510
2545
|
key: 1,
|
|
2511
2546
|
class: u([n(l).e("arrow"), n(l).is("reverse", D.value)])
|
|
2512
2547
|
}, [
|
|
@@ -2517,7 +2552,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2517
2552
|
], 2))
|
|
2518
2553
|
], 2)
|
|
2519
2554
|
], 2),
|
|
2520
|
-
(i(), fe(
|
|
2555
|
+
(i(), fe(Fe, { to: "body" }, [
|
|
2521
2556
|
Q(Pe, { name: "fade" }, {
|
|
2522
2557
|
default: He(() => [
|
|
2523
2558
|
oe(r("div", {
|
|
@@ -2526,56 +2561,56 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2526
2561
|
class: u([n(l).e("popper"), n(l).is("cascader", M.value)]),
|
|
2527
2562
|
style: te({ zIndex: $.value, ...y.value })
|
|
2528
2563
|
}, [
|
|
2529
|
-
M.value ? (i(),
|
|
2564
|
+
M.value ? (i(), c("div", {
|
|
2530
2565
|
key: 0,
|
|
2531
2566
|
class: u(n(l).e("cascader-panels"))
|
|
2532
2567
|
}, [
|
|
2533
|
-
(i(!0),
|
|
2534
|
-
key:
|
|
2568
|
+
(i(!0), c(Z, null, _(Re.value, (G, L) => (i(), c("div", {
|
|
2569
|
+
key: L,
|
|
2535
2570
|
class: u(n(l).e("cascader-panel"))
|
|
2536
2571
|
}, [
|
|
2537
|
-
(i(!0),
|
|
2538
|
-
key:
|
|
2539
|
-
class: u(Te(
|
|
2540
|
-
onClick: ue((he) =>
|
|
2572
|
+
(i(!0), c(Z, null, _(G, (F, q) => (i(), c("div", {
|
|
2573
|
+
key: F[s.valueKey],
|
|
2574
|
+
class: u(Te(F, q)),
|
|
2575
|
+
onClick: ue((he) => W(F), ["stop", "prevent"])
|
|
2541
2576
|
}, [
|
|
2542
2577
|
r("span", {
|
|
2543
2578
|
class: u(n(l).e("option-label"))
|
|
2544
|
-
}, N(
|
|
2545
|
-
|
|
2579
|
+
}, N(F[s.labelKey]), 3),
|
|
2580
|
+
F.children && F.children.length > 0 ? (i(), c("span", {
|
|
2546
2581
|
key: 0,
|
|
2547
2582
|
class: u(n(l).e("option-arrow"))
|
|
2548
2583
|
}, "›", 2)) : U("", !0)
|
|
2549
2584
|
], 10, Ul))), 128))
|
|
2550
2585
|
], 2))), 128))
|
|
2551
|
-
], 2)) : (i(),
|
|
2552
|
-
Y.value.length === 0 && !n(
|
|
2586
|
+
], 2)) : (i(), c(Z, { key: 1 }, [
|
|
2587
|
+
Y.value.length === 0 && !n(d).default ? (i(), c("div", {
|
|
2553
2588
|
key: 0,
|
|
2554
2589
|
class: u(n(l).e("empty"))
|
|
2555
|
-
}, N(z.value ? s.noMatchText : s.noDataText), 3)) : (i(),
|
|
2556
|
-
|
|
2590
|
+
}, N(z.value ? s.noMatchText : s.noDataText), 3)) : (i(), c(Z, { key: 1 }, [
|
|
2591
|
+
I.$slots.default ? (i(), c("div", {
|
|
2557
2592
|
key: 0,
|
|
2558
2593
|
class: u(n(l).e("options"))
|
|
2559
2594
|
}, [
|
|
2560
2595
|
Q(n(a), null, {
|
|
2561
2596
|
default: He(() => [
|
|
2562
|
-
se(
|
|
2597
|
+
se(I.$slots, "default")
|
|
2563
2598
|
]),
|
|
2564
2599
|
_: 3
|
|
2565
2600
|
})
|
|
2566
|
-
], 2)) : (i(),
|
|
2601
|
+
], 2)) : (i(), c("div", {
|
|
2567
2602
|
key: 1,
|
|
2568
2603
|
class: u(n(l).e("options"))
|
|
2569
2604
|
}, [
|
|
2570
|
-
(i(!0),
|
|
2571
|
-
key:
|
|
2572
|
-
class: u(Te(
|
|
2573
|
-
onClick: ue((
|
|
2605
|
+
(i(!0), c(Z, null, _(Y.value, (G, L) => (i(), c("div", {
|
|
2606
|
+
key: G[s.valueKey],
|
|
2607
|
+
class: u(Te(G, L)),
|
|
2608
|
+
onClick: ue((F) => W(G), ["stop", "prevent"])
|
|
2574
2609
|
}, [
|
|
2575
2610
|
r("span", {
|
|
2576
2611
|
class: u(n(l).e("option-label"))
|
|
2577
|
-
}, N(
|
|
2578
|
-
we(
|
|
2612
|
+
}, N(G[s.labelKey]), 3),
|
|
2613
|
+
we(G) ? (i(), c("span", {
|
|
2579
2614
|
key: 0,
|
|
2580
2615
|
class: u(n(l).e("option-check"))
|
|
2581
2616
|
}, "✓", 2)) : U("", !0)
|
|
@@ -2592,7 +2627,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2592
2627
|
]))
|
|
2593
2628
|
], 2));
|
|
2594
2629
|
}
|
|
2595
|
-
}),
|
|
2630
|
+
}), ct = /* @__PURE__ */ le({
|
|
2596
2631
|
name: "XSelectOption",
|
|
2597
2632
|
__name: "Option",
|
|
2598
2633
|
props: {
|
|
@@ -2609,14 +2644,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2609
2644
|
disabled: k.disabled
|
|
2610
2645
|
});
|
|
2611
2646
|
});
|
|
2612
|
-
const t = V(() => !e || !e.selectedValues ? !1 : e.selectedValues.value.includes(k.value)), l = (
|
|
2613
|
-
|
|
2647
|
+
const t = V(() => !e || !e.selectedValues ? !1 : e.selectedValues.value.includes(k.value)), l = (d) => {
|
|
2648
|
+
d.stopPropagation(), d.preventDefault(), !k.disabled && e && e.handleSelect && e.handleSelect({
|
|
2614
2649
|
value: k.value,
|
|
2615
2650
|
label: k.label,
|
|
2616
2651
|
disabled: k.disabled
|
|
2617
2652
|
});
|
|
2618
2653
|
};
|
|
2619
|
-
return (
|
|
2654
|
+
return (d, m) => (i(), c("div", {
|
|
2620
2655
|
class: u([
|
|
2621
2656
|
n(a).e("option"),
|
|
2622
2657
|
n(a).is("selected", t.value),
|
|
@@ -2627,13 +2662,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2627
2662
|
r("span", {
|
|
2628
2663
|
class: u(n(a).e("option-label"))
|
|
2629
2664
|
}, N(s.label), 3),
|
|
2630
|
-
t.value ? (i(),
|
|
2665
|
+
t.value ? (i(), c("span", {
|
|
2631
2666
|
key: 0,
|
|
2632
2667
|
class: u(n(a).e("option-check"))
|
|
2633
2668
|
}, "✓", 2)) : U("", !0)
|
|
2634
2669
|
], 2));
|
|
2635
2670
|
}
|
|
2636
|
-
}), Kl = ["checked", "indeterminate"], Wl = ["placeholder"], ql = ["onClick"], jl = ["checked", "disabled", "onChange"], Gl = ["disabled"], Jl = ["disabled"], Zl = ["checked", "indeterminate"], Ql = ["placeholder"], _l = ["onClick"], ea = ["checked", "disabled", "onChange"],
|
|
2671
|
+
}), Kl = ["checked", "indeterminate"], Wl = ["placeholder"], ql = ["onClick"], jl = ["checked", "disabled", "onChange"], Gl = ["disabled"], Jl = ["disabled"], Zl = ["checked", "indeterminate"], Ql = ["placeholder"], _l = ["onClick"], ea = ["checked", "disabled", "onChange"], dt = /* @__PURE__ */ le({
|
|
2637
2672
|
name: "XTransfer",
|
|
2638
2673
|
__name: "index",
|
|
2639
2674
|
props: {
|
|
@@ -2651,7 +2686,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2651
2686
|
},
|
|
2652
2687
|
emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
|
|
2653
2688
|
setup(s, { expose: k, emit: a }) {
|
|
2654
|
-
const e = s, t = a, l = ae("transfer"),
|
|
2689
|
+
const e = s, t = a, l = ae("transfer"), d = V(() => {
|
|
2655
2690
|
var o;
|
|
2656
2691
|
return ((o = e.props) == null ? void 0 : o.key) || "key";
|
|
2657
2692
|
}), m = V(() => {
|
|
@@ -2660,37 +2695,37 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2660
2695
|
}), b = V(() => {
|
|
2661
2696
|
var o;
|
|
2662
2697
|
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2663
|
-
}), T = B(""), S = B(""), D = B([]), $ = B([]), z = (o) => o[
|
|
2698
|
+
}), T = B(""), S = B(""), D = B([]), $ = B([]), z = (o) => o[d.value], O = (o) => o[m.value], y = (o) => o[b.value] || !1, R = V(() => e.data.filter((o) => {
|
|
2664
2699
|
const f = z(o);
|
|
2665
|
-
return e.modelValue.includes(f) ? !1 : e.filterable && T.value ? e.filterMethod ? e.filterMethod(T.value, o) :
|
|
2700
|
+
return e.modelValue.includes(f) ? !1 : e.filterable && T.value ? e.filterMethod ? e.filterMethod(T.value, o) : O(o).toLowerCase().includes(T.value.toLowerCase()) : !0;
|
|
2666
2701
|
})), H = V(() => {
|
|
2667
2702
|
const o = e.modelValue;
|
|
2668
2703
|
let f = e.data.filter((g) => {
|
|
2669
|
-
const
|
|
2670
|
-
return o.includes(
|
|
2704
|
+
const K = z(g);
|
|
2705
|
+
return o.includes(K);
|
|
2671
2706
|
});
|
|
2672
|
-
return e.filterable && S.value && (f = f.filter((g) => e.filterMethod ? e.filterMethod(S.value, g) :
|
|
2673
|
-
}),
|
|
2707
|
+
return e.filterable && S.value && (f = f.filter((g) => e.filterMethod ? e.filterMethod(S.value, g) : O(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;
|
|
2708
|
+
}), E = V(() => R.value.filter((o) => D.value.includes(z(o))).every((o) => y(o))), M = V(() => H.value.filter((o) => $.value.includes(z(o))).every((o) => y(o))), h = V(() => D.value.length === 0 || E.value), v = V(() => $.value.length === 0 || M.value), x = () => {
|
|
2674
2709
|
const o = D.value.filter((g) => {
|
|
2675
|
-
const
|
|
2676
|
-
return
|
|
2710
|
+
const K = e.data.find((ne) => z(ne) === g);
|
|
2711
|
+
return K && !y(K);
|
|
2677
2712
|
});
|
|
2678
2713
|
let f;
|
|
2679
2714
|
e.targetOrder === "unshift" ? f = [...o, ...e.modelValue] : f = [...e.modelValue, ...o], t("update:modelValue", f), t("change", f, "right", o), D.value = [];
|
|
2680
2715
|
}, A = () => {
|
|
2681
2716
|
const o = $.value.filter((g) => {
|
|
2682
|
-
const
|
|
2683
|
-
return
|
|
2717
|
+
const K = e.data.find((ne) => z(ne) === g);
|
|
2718
|
+
return K && !y(K);
|
|
2684
2719
|
}), f = e.modelValue.filter((g) => !o.includes(g));
|
|
2685
2720
|
t("update:modelValue", f), t("change", f, "left", o), $.value = [];
|
|
2686
|
-
},
|
|
2721
|
+
}, P = (o) => {
|
|
2687
2722
|
const f = D.value.indexOf(o);
|
|
2688
2723
|
f > -1 ? D.value.splice(f, 1) : D.value.push(o), t("left-check-change", [...D.value]);
|
|
2689
2724
|
}, Y = (o) => {
|
|
2690
2725
|
const f = $.value.indexOf(o);
|
|
2691
2726
|
f > -1 ? $.value.splice(f, 1) : $.value.push(o), t("right-check-change", [...$.value]);
|
|
2692
|
-
},
|
|
2693
|
-
D.value.length ===
|
|
2727
|
+
}, J = () => {
|
|
2728
|
+
D.value.length === R.value.filter((o) => !y(o)).length ? D.value = [] : D.value = R.value.filter((o) => !y(o)).map((o) => z(o)), t("left-check-change", [...D.value]);
|
|
2694
2729
|
}, p = () => {
|
|
2695
2730
|
$.value.length === H.value.filter((o) => !y(o)).length ? $.value = [] : $.value = H.value.filter((o) => !y(o)).map((o) => z(o)), t("right-check-change", [...$.value]);
|
|
2696
2731
|
}, w = (o) => {
|
|
@@ -2698,7 +2733,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2698
2733
|
}, C = V(() => [l.b()]);
|
|
2699
2734
|
return k({
|
|
2700
2735
|
clearQuery: w
|
|
2701
|
-
}), (o, f) => (i(),
|
|
2736
|
+
}), (o, f) => (i(), c("div", {
|
|
2702
2737
|
class: u(C.value)
|
|
2703
2738
|
}, [
|
|
2704
2739
|
r("div", {
|
|
@@ -2712,17 +2747,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2712
2747
|
}, [
|
|
2713
2748
|
r("input", {
|
|
2714
2749
|
type: "checkbox",
|
|
2715
|
-
checked: D.value.length > 0 && D.value.length ===
|
|
2716
|
-
indeterminate: D.value.length > 0 && D.value.length <
|
|
2717
|
-
onChange:
|
|
2750
|
+
checked: D.value.length > 0 && D.value.length === R.value.filter((g) => !y(g)).length,
|
|
2751
|
+
indeterminate: D.value.length > 0 && D.value.length < R.value.filter((g) => !y(g)).length,
|
|
2752
|
+
onChange: J
|
|
2718
2753
|
}, null, 40, Kl),
|
|
2719
2754
|
r("span", null, N(s.titles[0]), 1)
|
|
2720
2755
|
], 2),
|
|
2721
2756
|
r("span", {
|
|
2722
2757
|
class: u(n(l).e("count"))
|
|
2723
|
-
}, N(D.value.length) + " / " + N(
|
|
2758
|
+
}, N(D.value.length) + " / " + N(R.value.length), 3)
|
|
2724
2759
|
], 2),
|
|
2725
|
-
s.filterable ? (i(),
|
|
2760
|
+
s.filterable ? (i(), c("div", {
|
|
2726
2761
|
key: 0,
|
|
2727
2762
|
class: u(n(l).e("filter"))
|
|
2728
2763
|
}, [
|
|
@@ -2733,7 +2768,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2733
2768
|
}, null, 10, Wl), [
|
|
2734
2769
|
[Ve, T.value]
|
|
2735
2770
|
]),
|
|
2736
|
-
T.value ? (i(),
|
|
2771
|
+
T.value ? (i(), c("span", {
|
|
2737
2772
|
key: 0,
|
|
2738
2773
|
class: u(n(l).e("filter-clear")),
|
|
2739
2774
|
onClick: f[1] || (f[1] = (g) => w("left"))
|
|
@@ -2742,14 +2777,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2742
2777
|
r("div", {
|
|
2743
2778
|
class: u(n(l).e("body"))
|
|
2744
2779
|
}, [
|
|
2745
|
-
(i(!0),
|
|
2780
|
+
(i(!0), c(Z, null, _(R.value, (g) => (i(), c("div", {
|
|
2746
2781
|
key: z(g),
|
|
2747
2782
|
class: u([
|
|
2748
2783
|
n(l).e("item"),
|
|
2749
2784
|
n(l).is("disabled", y(g)),
|
|
2750
2785
|
n(l).is("checked", D.value.includes(z(g)))
|
|
2751
2786
|
]),
|
|
2752
|
-
onClick: (
|
|
2787
|
+
onClick: (K) => !y(g) && P(z(g))
|
|
2753
2788
|
}, [
|
|
2754
2789
|
r("label", {
|
|
2755
2790
|
class: u(n(l).e("checkbox"))
|
|
@@ -2760,17 +2795,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2760
2795
|
disabled: y(g),
|
|
2761
2796
|
onClick: f[2] || (f[2] = ue(() => {
|
|
2762
2797
|
}, ["stop"])),
|
|
2763
|
-
onChange: (
|
|
2798
|
+
onChange: (K) => P(z(g))
|
|
2764
2799
|
}, null, 40, jl),
|
|
2765
|
-
r("span", null, N(
|
|
2800
|
+
r("span", null, N(O(g)), 1)
|
|
2766
2801
|
], 2)
|
|
2767
2802
|
], 10, ql))), 128)),
|
|
2768
|
-
|
|
2803
|
+
R.value.length === 0 ? (i(), c("div", {
|
|
2769
2804
|
key: 0,
|
|
2770
2805
|
class: u(n(l).e("empty"))
|
|
2771
2806
|
}, [
|
|
2772
2807
|
se(o.$slots, "left-empty", {}, () => [
|
|
2773
|
-
f[6] || (f[6] =
|
|
2808
|
+
f[6] || (f[6] = ce("暂无数据", -1))
|
|
2774
2809
|
])
|
|
2775
2810
|
], 2)) : U("", !0)
|
|
2776
2811
|
], 2)
|
|
@@ -2810,7 +2845,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2810
2845
|
class: u(n(l).e("count"))
|
|
2811
2846
|
}, N($.value.length) + " / " + N(H.value.length), 3)
|
|
2812
2847
|
], 2),
|
|
2813
|
-
s.filterable ? (i(),
|
|
2848
|
+
s.filterable ? (i(), c("div", {
|
|
2814
2849
|
key: 0,
|
|
2815
2850
|
class: u(n(l).e("filter"))
|
|
2816
2851
|
}, [
|
|
@@ -2821,7 +2856,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2821
2856
|
}, null, 10, Ql), [
|
|
2822
2857
|
[Ve, S.value]
|
|
2823
2858
|
]),
|
|
2824
|
-
S.value ? (i(),
|
|
2859
|
+
S.value ? (i(), c("span", {
|
|
2825
2860
|
key: 0,
|
|
2826
2861
|
class: u(n(l).e("filter-clear")),
|
|
2827
2862
|
onClick: f[4] || (f[4] = (g) => w("right"))
|
|
@@ -2830,14 +2865,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2830
2865
|
r("div", {
|
|
2831
2866
|
class: u(n(l).e("body"))
|
|
2832
2867
|
}, [
|
|
2833
|
-
(i(!0),
|
|
2868
|
+
(i(!0), c(Z, null, _(H.value, (g) => (i(), c("div", {
|
|
2834
2869
|
key: z(g),
|
|
2835
2870
|
class: u([
|
|
2836
2871
|
n(l).e("item"),
|
|
2837
2872
|
n(l).is("disabled", y(g)),
|
|
2838
2873
|
n(l).is("checked", $.value.includes(z(g)))
|
|
2839
2874
|
]),
|
|
2840
|
-
onClick: (
|
|
2875
|
+
onClick: (K) => !y(g) && Y(z(g))
|
|
2841
2876
|
}, [
|
|
2842
2877
|
r("label", {
|
|
2843
2878
|
class: u(n(l).e("checkbox"))
|
|
@@ -2848,17 +2883,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2848
2883
|
disabled: y(g),
|
|
2849
2884
|
onClick: f[5] || (f[5] = ue(() => {
|
|
2850
2885
|
}, ["stop"])),
|
|
2851
|
-
onChange: (
|
|
2886
|
+
onChange: (K) => Y(z(g))
|
|
2852
2887
|
}, null, 40, ea),
|
|
2853
|
-
r("span", null, N(
|
|
2888
|
+
r("span", null, N(O(g)), 1)
|
|
2854
2889
|
], 2)
|
|
2855
2890
|
], 10, _l))), 128)),
|
|
2856
|
-
H.value.length === 0 ? (i(),
|
|
2891
|
+
H.value.length === 0 ? (i(), c("div", {
|
|
2857
2892
|
key: 0,
|
|
2858
2893
|
class: u(n(l).e("empty"))
|
|
2859
2894
|
}, [
|
|
2860
2895
|
se(o.$slots, "right-empty", {}, () => [
|
|
2861
|
-
f[7] || (f[7] =
|
|
2896
|
+
f[7] || (f[7] = ce("暂无数据", -1))
|
|
2862
2897
|
])
|
|
2863
2898
|
], 2)) : U("", !0)
|
|
2864
2899
|
], 2)
|
|
@@ -2883,7 +2918,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2883
2918
|
},
|
|
2884
2919
|
emits: ["update:modelValue", "change", "input"],
|
|
2885
2920
|
setup(s, { emit: k }) {
|
|
2886
|
-
const a = s, e = k, t = ae("slider"), l = B(),
|
|
2921
|
+
const a = s, e = k, t = ae("slider"), l = B(), d = B(), m = B(!1), b = B(!1), T = V(() => {
|
|
2887
2922
|
const w = a.max - a.min;
|
|
2888
2923
|
return (a.modelValue - a.min) / w * 100;
|
|
2889
2924
|
}), S = V(() => a.formatTooltip ? a.formatTooltip(a.modelValue) : a.modelValue), D = V(() => {
|
|
@@ -2896,38 +2931,38 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2896
2931
|
return w;
|
|
2897
2932
|
}), $ = V(() => a.marks ? Object.keys(a.marks).map((w) => {
|
|
2898
2933
|
const C = Number(w), o = a.marks[C], f = (C - a.min) / (a.max - a.min) * 100;
|
|
2899
|
-
let g,
|
|
2900
|
-
return typeof o == "string" ? g = o : (g = o.label || String(C),
|
|
2901
|
-
}) : []), z = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0,
|
|
2934
|
+
let g, K = {};
|
|
2935
|
+
return typeof o == "string" ? g = o : (g = o.label || String(C), K = o.style || {}), { value: C, pos: f, label: g, style: K };
|
|
2936
|
+
}) : []), z = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, O = (w, C) => {
|
|
2902
2937
|
if (!l.value) return a.modelValue;
|
|
2903
2938
|
const o = l.value.getBoundingClientRect(), f = z();
|
|
2904
2939
|
let g;
|
|
2905
2940
|
a.vertical ? g = (o.bottom - C) / f * 100 : g = (w - o.left) / f * 100, g = Math.max(0, Math.min(100, g));
|
|
2906
|
-
const
|
|
2941
|
+
const K = a.min + g / 100 * (a.max - a.min), ne = Math.round(K / a.step) * a.step;
|
|
2907
2942
|
return Math.max(a.min, Math.min(a.max, ne));
|
|
2908
2943
|
}, y = (w) => {
|
|
2909
2944
|
if (a.disabled) return;
|
|
2910
2945
|
const C = Math.max(a.min, Math.min(a.max, w));
|
|
2911
2946
|
C !== a.modelValue && (e("update:modelValue", C), e("input", C));
|
|
2912
|
-
},
|
|
2947
|
+
}, R = (w) => {
|
|
2913
2948
|
if (a.disabled) return;
|
|
2914
2949
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
2915
|
-
const C =
|
|
2916
|
-
y(C), document.addEventListener("mousemove", H), document.addEventListener("mouseup",
|
|
2950
|
+
const C = O(w.clientX, w.clientY);
|
|
2951
|
+
y(C), document.addEventListener("mousemove", H), document.addEventListener("mouseup", E);
|
|
2917
2952
|
}, H = (w) => {
|
|
2918
2953
|
if (!b.value) return;
|
|
2919
|
-
const C =
|
|
2954
|
+
const C = O(w.clientX, w.clientY);
|
|
2920
2955
|
y(C);
|
|
2921
|
-
},
|
|
2922
|
-
b.value = !1, e("change", a.modelValue), document.removeEventListener("mousemove", H), document.removeEventListener("mouseup",
|
|
2956
|
+
}, E = () => {
|
|
2957
|
+
b.value = !1, e("change", a.modelValue), document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", E);
|
|
2923
2958
|
}, M = (w) => {
|
|
2924
2959
|
if (a.disabled) return;
|
|
2925
2960
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
2926
|
-
const C = w.touches[0], o =
|
|
2961
|
+
const C = w.touches[0], o = O(C.clientX, C.clientY);
|
|
2927
2962
|
y(o);
|
|
2928
2963
|
}, h = (w) => {
|
|
2929
2964
|
if (!b.value) return;
|
|
2930
|
-
const C = w.touches[0], o =
|
|
2965
|
+
const C = w.touches[0], o = O(C.clientX, C.clientY);
|
|
2931
2966
|
y(o);
|
|
2932
2967
|
}, v = () => {
|
|
2933
2968
|
b.value = !1, e("change", a.modelValue);
|
|
@@ -2937,37 +2972,37 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2937
2972
|
b.value || (m.value = !1);
|
|
2938
2973
|
};
|
|
2939
2974
|
De(() => {
|
|
2940
|
-
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup",
|
|
2975
|
+
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", E);
|
|
2941
2976
|
});
|
|
2942
|
-
const
|
|
2977
|
+
const P = V(() => [
|
|
2943
2978
|
t.b(),
|
|
2944
2979
|
t.is("disabled", a.disabled),
|
|
2945
2980
|
t.is("vertical", a.vertical)
|
|
2946
|
-
]), Y = V(() => a.vertical && a.height ? { height: typeof a.height == "number" ? `${a.height}px` : a.height } : {}),
|
|
2947
|
-
return (w, C) => (i(),
|
|
2948
|
-
class: u(
|
|
2981
|
+
]), Y = V(() => a.vertical && a.height ? { height: typeof a.height == "number" ? `${a.height}px` : a.height } : {}), J = V(() => a.vertical ? { height: `${T.value}%` } : { width: `${T.value}%` }), p = V(() => a.vertical ? { bottom: `${T.value}%` } : { left: `${T.value}%` });
|
|
2982
|
+
return (w, C) => (i(), c("div", {
|
|
2983
|
+
class: u(P.value),
|
|
2949
2984
|
style: te(Y.value)
|
|
2950
2985
|
}, [
|
|
2951
2986
|
r("div", {
|
|
2952
2987
|
ref_key: "sliderRef",
|
|
2953
2988
|
ref: l,
|
|
2954
2989
|
class: u(n(t).e("runway")),
|
|
2955
|
-
onMousedown:
|
|
2990
|
+
onMousedown: R,
|
|
2956
2991
|
onTouchstart: M
|
|
2957
2992
|
}, [
|
|
2958
2993
|
r("div", {
|
|
2959
2994
|
class: u(n(t).e("bar")),
|
|
2960
|
-
style: te(
|
|
2995
|
+
style: te(J.value)
|
|
2961
2996
|
}, null, 6),
|
|
2962
|
-
s.showStops ? (i(),
|
|
2963
|
-
(i(!0),
|
|
2997
|
+
s.showStops ? (i(), c("div", la, [
|
|
2998
|
+
(i(!0), c(Z, null, _(D.value, (o, f) => (i(), c("div", {
|
|
2964
2999
|
key: f,
|
|
2965
3000
|
class: u(n(t).e("stop")),
|
|
2966
3001
|
style: te(s.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2967
3002
|
}, null, 6))), 128))
|
|
2968
3003
|
])) : U("", !0),
|
|
2969
|
-
$.value.length > 0 ? (i(),
|
|
2970
|
-
(i(!0),
|
|
3004
|
+
$.value.length > 0 ? (i(), c("div", aa, [
|
|
3005
|
+
(i(!0), c(Z, null, _($.value, (o) => (i(), c("div", {
|
|
2971
3006
|
key: o.value,
|
|
2972
3007
|
class: u(n(t).e("mark")),
|
|
2973
3008
|
style: te(s.vertical ? { bottom: `${o.pos}%` } : { left: `${o.pos}%`, ...o.style })
|
|
@@ -2979,7 +3014,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2979
3014
|
])) : U("", !0),
|
|
2980
3015
|
r("div", {
|
|
2981
3016
|
ref_key: "buttonRef",
|
|
2982
|
-
ref:
|
|
3017
|
+
ref: d,
|
|
2983
3018
|
class: u(n(t).e("button-wrapper")),
|
|
2984
3019
|
style: te(p.value),
|
|
2985
3020
|
onMouseenter: x,
|
|
@@ -2987,7 +3022,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
2987
3022
|
onTouchmove: h,
|
|
2988
3023
|
onTouchend: v
|
|
2989
3024
|
}, [
|
|
2990
|
-
s.showTooltip && m.value ? (i(),
|
|
3025
|
+
s.showTooltip && m.value ? (i(), c("div", {
|
|
2991
3026
|
key: 0,
|
|
2992
3027
|
class: u(n(t).e("tooltip"))
|
|
2993
3028
|
}, N(S.value), 3)) : U("", !0),
|
|
@@ -3010,7 +3045,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3010
3045
|
}, ra = {
|
|
3011
3046
|
key: 0,
|
|
3012
3047
|
class: "action-preview"
|
|
3013
|
-
},
|
|
3048
|
+
}, ca = ["onClick"], da = ["disabled"], va = { class: "progress-text" }, fa = ["onClick"], ma = ["src"], ha = {
|
|
3014
3049
|
key: 0,
|
|
3015
3050
|
class: "action-success"
|
|
3016
3051
|
}, pa = ["onClick"], ga = ["multiple", "accept", "disabled"], ft = /* @__PURE__ */ le({
|
|
@@ -3045,7 +3080,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3045
3080
|
setup(s, { expose: k, emit: a }) {
|
|
3046
3081
|
const e = s, t = a, l = ae("upload");
|
|
3047
3082
|
Le();
|
|
3048
|
-
const
|
|
3083
|
+
const d = B(), m = B([...e.fileList]), b = B(!1);
|
|
3049
3084
|
let T = 1;
|
|
3050
3085
|
const S = () => Date.now() + T++, D = (p) => {
|
|
3051
3086
|
var o;
|
|
@@ -3069,9 +3104,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3069
3104
|
l.is("disabled", e.disabled),
|
|
3070
3105
|
l.is("drag", e.drag),
|
|
3071
3106
|
l.m(e.listType)
|
|
3072
|
-
]),
|
|
3107
|
+
]), O = (p) => {
|
|
3073
3108
|
const w = p.target.files;
|
|
3074
|
-
!w || w.length === 0 || (y(Array.from(w)),
|
|
3109
|
+
!w || w.length === 0 || (y(Array.from(w)), d.value && (d.value.value = ""));
|
|
3075
3110
|
}, y = async (p) => {
|
|
3076
3111
|
var w, C;
|
|
3077
3112
|
if (e.limit && m.value.length + p.length > e.limit) {
|
|
@@ -3089,9 +3124,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3089
3124
|
uid: S(),
|
|
3090
3125
|
raw: o
|
|
3091
3126
|
};
|
|
3092
|
-
o.type.startsWith("image/") && (f.thumbUrl = await
|
|
3127
|
+
o.type.startsWith("image/") && (f.thumbUrl = await R(o), f.url = f.thumbUrl), m.value.push(f), t("update:fileList", m.value), t("change", f, m.value), (C = e.onChange) == null || C.call(e, f, m.value), e.autoUpload && H(f);
|
|
3093
3128
|
}
|
|
3094
|
-
},
|
|
3129
|
+
}, R = (p) => new Promise((w) => {
|
|
3095
3130
|
const C = new FileReader();
|
|
3096
3131
|
C.onload = (o) => {
|
|
3097
3132
|
var f;
|
|
@@ -3099,7 +3134,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3099
3134
|
}, C.readAsDataURL(p);
|
|
3100
3135
|
}), H = (p) => {
|
|
3101
3136
|
if (!p.raw) return;
|
|
3102
|
-
p.status = "uploading", (e.httpRequest ||
|
|
3137
|
+
p.status = "uploading", (e.httpRequest || E)({
|
|
3103
3138
|
action: e.action,
|
|
3104
3139
|
headers: e.headers,
|
|
3105
3140
|
data: e.data,
|
|
@@ -3119,7 +3154,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3119
3154
|
p.status = "error", t("error", C, p, m.value), (o = e.onError) == null || o.call(e, C, p, m.value);
|
|
3120
3155
|
}
|
|
3121
3156
|
});
|
|
3122
|
-
},
|
|
3157
|
+
}, E = (p) => new Promise((w, C) => {
|
|
3123
3158
|
const o = new XMLHttpRequest();
|
|
3124
3159
|
o.upload.addEventListener("progress", (g) => {
|
|
3125
3160
|
g.lengthComputable && p.onProgress({ percent: g.loaded / g.total * 100 });
|
|
@@ -3155,17 +3190,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3155
3190
|
m.value = [], t("update:fileList", m.value);
|
|
3156
3191
|
}, x = () => {
|
|
3157
3192
|
var p;
|
|
3158
|
-
e.disabled || (p =
|
|
3193
|
+
e.disabled || (p = d.value) == null || p.click();
|
|
3159
3194
|
}, A = (p) => {
|
|
3160
3195
|
p.preventDefault(), !e.disabled && e.drag && (b.value = !0);
|
|
3161
|
-
},
|
|
3196
|
+
}, P = () => {
|
|
3162
3197
|
b.value = !1;
|
|
3163
3198
|
}, Y = (p) => {
|
|
3164
3199
|
var C;
|
|
3165
3200
|
if (p.preventDefault(), b.value = !1, e.disabled) return;
|
|
3166
3201
|
const w = (C = p.dataTransfer) == null ? void 0 : C.files;
|
|
3167
3202
|
w && w.length > 0 && y(Array.from(w));
|
|
3168
|
-
},
|
|
3203
|
+
}, J = (p) => {
|
|
3169
3204
|
if (!p) return "0 B";
|
|
3170
3205
|
const w = ["B", "KB", "MB", "GB"];
|
|
3171
3206
|
let C = 0, o = p;
|
|
@@ -3177,15 +3212,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3177
3212
|
submit: h,
|
|
3178
3213
|
clearFiles: v,
|
|
3179
3214
|
uploadFiles: m
|
|
3180
|
-
}), (p, w) => (i(),
|
|
3215
|
+
}), (p, w) => (i(), c("div", {
|
|
3181
3216
|
class: u(z.value)
|
|
3182
3217
|
}, [
|
|
3183
|
-
s.drag ? (i(),
|
|
3218
|
+
s.drag ? (i(), c("div", {
|
|
3184
3219
|
key: 0,
|
|
3185
3220
|
class: u([n(l).e("drag"), n(l).is("dragover", b.value)]),
|
|
3186
3221
|
onClick: x,
|
|
3187
3222
|
onDragover: A,
|
|
3188
|
-
onDragleave:
|
|
3223
|
+
onDragleave: P,
|
|
3189
3224
|
onDrop: Y
|
|
3190
3225
|
}, [
|
|
3191
3226
|
se(p.$slots, "drag", {}, () => [
|
|
@@ -3195,36 +3230,36 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3195
3230
|
r("div", {
|
|
3196
3231
|
class: u(n(l).e("drag-text"))
|
|
3197
3232
|
}, [...w[0] || (w[0] = [
|
|
3198
|
-
|
|
3233
|
+
ce(" 将文件拖到此处,或", -1),
|
|
3199
3234
|
r("em", null, "点击上传", -1)
|
|
3200
3235
|
])], 2)
|
|
3201
3236
|
])
|
|
3202
|
-
], 34)) : s.listType === "picture-card" ? (i(),
|
|
3237
|
+
], 34)) : s.listType === "picture-card" ? (i(), c("ul", {
|
|
3203
3238
|
key: 1,
|
|
3204
3239
|
class: u([n(l).e("files"), n(l).e("upload-list")])
|
|
3205
3240
|
}, [
|
|
3206
|
-
(i(!0),
|
|
3241
|
+
(i(!0), c(Z, null, _(m.value, (C) => (i(), c("li", {
|
|
3207
3242
|
key: C.uid,
|
|
3208
3243
|
class: u([n(l).e("file"), n(l).is(`status-${C.status}`)])
|
|
3209
3244
|
}, [
|
|
3210
|
-
C.thumbUrl && C.status !== "uploading" ? (i(),
|
|
3245
|
+
C.thumbUrl && C.status !== "uploading" ? (i(), c("img", {
|
|
3211
3246
|
key: 0,
|
|
3212
3247
|
src: C.thumbUrl,
|
|
3213
3248
|
class: u(n(l).e("file-image"))
|
|
3214
|
-
}, null, 10, ta)) : (i(),
|
|
3249
|
+
}, null, 10, ta)) : (i(), c("div", {
|
|
3215
3250
|
key: 1,
|
|
3216
3251
|
class: u(n(l).e("file-status"))
|
|
3217
3252
|
}, [
|
|
3218
|
-
C.status === "uploading" ? (i(),
|
|
3253
|
+
C.status === "uploading" ? (i(), c("span", na, [
|
|
3219
3254
|
r("span", sa, [
|
|
3220
3255
|
r("span", ua, N(Math.round(C.percentage || 0)) + "%", 1)
|
|
3221
3256
|
])
|
|
3222
|
-
])) : C.status === "error" ? (i(),
|
|
3257
|
+
])) : C.status === "error" ? (i(), c("span", oa, [
|
|
3223
3258
|
Q(n(ee), {
|
|
3224
3259
|
name: "close",
|
|
3225
3260
|
size: 16
|
|
3226
3261
|
})
|
|
3227
|
-
])) : C.status === "success" ? (i(),
|
|
3262
|
+
])) : C.status === "success" ? (i(), c("span", ia, [
|
|
3228
3263
|
Q(n(ee), {
|
|
3229
3264
|
name: "check",
|
|
3230
3265
|
size: 16
|
|
@@ -3234,7 +3269,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3234
3269
|
r("span", {
|
|
3235
3270
|
class: u(n(l).e("file-actions"))
|
|
3236
3271
|
}, [
|
|
3237
|
-
C.url ? (i(),
|
|
3272
|
+
C.url ? (i(), c("span", ra, [
|
|
3238
3273
|
Q(n(ee), {
|
|
3239
3274
|
name: "eye",
|
|
3240
3275
|
size: 14
|
|
@@ -3248,10 +3283,10 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3248
3283
|
name: "delete",
|
|
3249
3284
|
size: 14
|
|
3250
3285
|
})
|
|
3251
|
-
], 8,
|
|
3286
|
+
], 8, ca)
|
|
3252
3287
|
], 2)
|
|
3253
3288
|
], 2))), 128)),
|
|
3254
|
-
$.value ? (i(),
|
|
3289
|
+
$.value ? (i(), c("li", {
|
|
3255
3290
|
key: 0,
|
|
3256
3291
|
class: u(n(l).e("upload-card")),
|
|
3257
3292
|
onClick: x
|
|
@@ -3260,33 +3295,33 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3260
3295
|
w[1] || (w[1] = r("span", { class: "upload-icon" }, "+", -1))
|
|
3261
3296
|
])
|
|
3262
3297
|
], 2)) : U("", !0)
|
|
3263
|
-
], 2)) : (i(),
|
|
3298
|
+
], 2)) : (i(), c(Z, { key: 2 }, [
|
|
3264
3299
|
r("div", {
|
|
3265
3300
|
class: u(n(l).e("trigger-wrapper")),
|
|
3266
3301
|
onClick: x
|
|
3267
3302
|
}, [
|
|
3268
3303
|
se(p.$slots, "trigger", {}, () => [
|
|
3269
|
-
$.value ? (i(),
|
|
3304
|
+
$.value ? (i(), c("button", {
|
|
3270
3305
|
key: 0,
|
|
3271
3306
|
type: "button",
|
|
3272
3307
|
class: u(n(l).e("trigger")),
|
|
3273
3308
|
disabled: s.disabled
|
|
3274
3309
|
}, [
|
|
3275
3310
|
se(p.$slots, "default", {}, () => [
|
|
3276
|
-
w[2] || (w[2] =
|
|
3311
|
+
w[2] || (w[2] = ce("点击上传", -1))
|
|
3277
3312
|
])
|
|
3278
|
-
], 10,
|
|
3313
|
+
], 10, da)) : U("", !0)
|
|
3279
3314
|
])
|
|
3280
3315
|
], 2),
|
|
3281
|
-
s.showFileList && m.value.length > 0 ? (i(),
|
|
3316
|
+
s.showFileList && m.value.length > 0 ? (i(), c("ul", {
|
|
3282
3317
|
key: 0,
|
|
3283
3318
|
class: u(n(l).e("files"))
|
|
3284
3319
|
}, [
|
|
3285
|
-
(i(!0),
|
|
3320
|
+
(i(!0), c(Z, null, _(m.value, (C) => (i(), c("li", {
|
|
3286
3321
|
key: C.uid,
|
|
3287
3322
|
class: u([n(l).e("file"), n(l).is(`status-${C.status}`)])
|
|
3288
3323
|
}, [
|
|
3289
|
-
s.listType === "text" ? (i(),
|
|
3324
|
+
s.listType === "text" ? (i(), c(Z, { key: 0 }, [
|
|
3290
3325
|
r("span", {
|
|
3291
3326
|
class: u(n(l).e("file-icon"))
|
|
3292
3327
|
}, N(D(C)), 3),
|
|
@@ -3295,8 +3330,8 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3295
3330
|
}, N(C.name), 3),
|
|
3296
3331
|
r("span", {
|
|
3297
3332
|
class: u(n(l).e("file-size"))
|
|
3298
|
-
}, N(
|
|
3299
|
-
C.status === "uploading" ? (i(),
|
|
3333
|
+
}, N(J(C.size)), 3),
|
|
3334
|
+
C.status === "uploading" ? (i(), c("span", {
|
|
3300
3335
|
key: 0,
|
|
3301
3336
|
class: u(n(l).e("file-progress"))
|
|
3302
3337
|
}, [
|
|
@@ -3306,7 +3341,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3306
3341
|
}, null, 4),
|
|
3307
3342
|
r("span", va, N(Math.round(C.percentage || 0)) + "%", 1)
|
|
3308
3343
|
], 2)) : U("", !0),
|
|
3309
|
-
C.status === "success" ? (i(),
|
|
3344
|
+
C.status === "success" ? (i(), c("span", {
|
|
3310
3345
|
key: 1,
|
|
3311
3346
|
class: u(n(l).e("file-success"))
|
|
3312
3347
|
}, [
|
|
@@ -3315,7 +3350,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3315
3350
|
size: 14
|
|
3316
3351
|
})
|
|
3317
3352
|
], 2)) : U("", !0),
|
|
3318
|
-
C.status === "error" ? (i(),
|
|
3353
|
+
C.status === "error" ? (i(), c("span", {
|
|
3319
3354
|
key: 2,
|
|
3320
3355
|
class: u(n(l).e("file-error"))
|
|
3321
3356
|
}, [
|
|
@@ -3337,12 +3372,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3337
3372
|
})
|
|
3338
3373
|
], 8, fa)
|
|
3339
3374
|
], 2)
|
|
3340
|
-
], 64)) : s.listType === "picture" ? (i(),
|
|
3341
|
-
C.thumbUrl ? (i(),
|
|
3375
|
+
], 64)) : s.listType === "picture" ? (i(), c(Z, { key: 1 }, [
|
|
3376
|
+
C.thumbUrl ? (i(), c("img", {
|
|
3342
3377
|
key: 0,
|
|
3343
3378
|
src: C.thumbUrl,
|
|
3344
3379
|
class: u(n(l).e("file-thumb"))
|
|
3345
|
-
}, null, 10, ma)) : (i(),
|
|
3380
|
+
}, null, 10, ma)) : (i(), c("span", {
|
|
3346
3381
|
key: 1,
|
|
3347
3382
|
class: u(n(l).e("file-icon"))
|
|
3348
3383
|
}, N(D(C)), 3)),
|
|
@@ -3352,7 +3387,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3352
3387
|
r("span", {
|
|
3353
3388
|
class: u(n(l).e("file-name"))
|
|
3354
3389
|
}, N(C.name), 3),
|
|
3355
|
-
C.status === "uploading" ? (i(),
|
|
3390
|
+
C.status === "uploading" ? (i(), c("span", {
|
|
3356
3391
|
key: 0,
|
|
3357
3392
|
class: u(n(l).e("file-progress"))
|
|
3358
3393
|
}, [
|
|
@@ -3365,7 +3400,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3365
3400
|
r("span", {
|
|
3366
3401
|
class: u(n(l).e("file-actions"))
|
|
3367
3402
|
}, [
|
|
3368
|
-
C.status === "success" ? (i(),
|
|
3403
|
+
C.status === "success" ? (i(), c("span", ha, [
|
|
3369
3404
|
Q(n(ee), {
|
|
3370
3405
|
name: "check",
|
|
3371
3406
|
size: 14
|
|
@@ -3387,15 +3422,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3387
3422
|
], 64)),
|
|
3388
3423
|
r("input", {
|
|
3389
3424
|
ref_key: "inputRef",
|
|
3390
|
-
ref:
|
|
3425
|
+
ref: d,
|
|
3391
3426
|
type: "file",
|
|
3392
3427
|
class: u(n(l).e("input")),
|
|
3393
3428
|
multiple: s.multiple,
|
|
3394
3429
|
accept: s.accept,
|
|
3395
3430
|
disabled: s.disabled,
|
|
3396
|
-
onChange:
|
|
3431
|
+
onChange: O
|
|
3397
3432
|
}, null, 42, ga),
|
|
3398
|
-
p.$slots.tip ? (i(),
|
|
3433
|
+
p.$slots.tip ? (i(), c("div", {
|
|
3399
3434
|
key: 3,
|
|
3400
3435
|
class: u(n(l).e("tip"))
|
|
3401
3436
|
}, [
|
|
@@ -3429,15 +3464,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3429
3464
|
},
|
|
3430
3465
|
emits: ["update:modelValue", "change"],
|
|
3431
3466
|
setup(s, { emit: k }) {
|
|
3432
|
-
const a = s, e = k, t = ae("rate"), l = B(-1),
|
|
3467
|
+
const a = s, e = k, t = ae("rate"), l = B(-1), d = V(() => l.value > -1 ? l.value : a.modelValue), m = V(() => [
|
|
3433
3468
|
t.b(),
|
|
3434
3469
|
t.m(a.size),
|
|
3435
3470
|
t.is("disabled", a.disabled),
|
|
3436
3471
|
t.is("readonly", a.readonly)
|
|
3437
3472
|
]), b = (y) => a.disabled ? a.disabledVoidColor : y <= a.lowThreshold ? a.colors[0] : y <= a.highThreshold ? a.colors[1] || a.colors[0] : a.colors[2] || a.colors[1] || a.colors[0], T = (y) => {
|
|
3438
|
-
const
|
|
3439
|
-
return
|
|
3440
|
-
}, S = (y) => T(y) > 0 ? b(
|
|
3473
|
+
const R = d.value;
|
|
3474
|
+
return R >= y ? 100 : a.allowHalf && R >= y - 0.5 ? 50 : 0;
|
|
3475
|
+
}, S = (y) => T(y) > 0 ? b(d.value) : a.disabled ? a.disabledVoidColor : a.voidColor, D = V(() => {
|
|
3441
3476
|
if (a.showScore)
|
|
3442
3477
|
return a.scoreTemplate.replace("{value}", String(a.modelValue));
|
|
3443
3478
|
if (a.showText) {
|
|
@@ -3445,37 +3480,37 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3445
3480
|
return a.texts[Math.max(0, y)] || "";
|
|
3446
3481
|
}
|
|
3447
3482
|
return "";
|
|
3448
|
-
}), $ = (y,
|
|
3483
|
+
}), $ = (y, R) => {
|
|
3449
3484
|
if (!(a.disabled || a.readonly))
|
|
3450
3485
|
if (a.allowHalf) {
|
|
3451
|
-
const
|
|
3486
|
+
const E = R.currentTarget.getBoundingClientRect(), M = R.clientX - E.left < E.width / 2;
|
|
3452
3487
|
l.value = M ? y - 0.5 : y;
|
|
3453
3488
|
} else
|
|
3454
3489
|
l.value = y;
|
|
3455
3490
|
}, z = () => {
|
|
3456
3491
|
a.disabled || a.readonly || (l.value = -1);
|
|
3457
|
-
},
|
|
3492
|
+
}, O = (y, R) => {
|
|
3458
3493
|
if (a.disabled || a.readonly) return;
|
|
3459
3494
|
let H;
|
|
3460
3495
|
if (a.allowHalf) {
|
|
3461
|
-
const M =
|
|
3462
|
-
H =
|
|
3496
|
+
const M = R.currentTarget.getBoundingClientRect();
|
|
3497
|
+
H = R.clientX - M.left < M.width / 2 ? y - 0.5 : y;
|
|
3463
3498
|
} else
|
|
3464
3499
|
H = y;
|
|
3465
3500
|
e("update:modelValue", H), e("change", H);
|
|
3466
3501
|
};
|
|
3467
|
-
return (y,
|
|
3502
|
+
return (y, R) => (i(), c("div", {
|
|
3468
3503
|
class: u(m.value),
|
|
3469
3504
|
onMouseleave: z
|
|
3470
3505
|
}, [
|
|
3471
3506
|
r("div", {
|
|
3472
3507
|
class: u(n(t).e("items"))
|
|
3473
3508
|
}, [
|
|
3474
|
-
(i(!0),
|
|
3509
|
+
(i(!0), c(Z, null, _(s.max, (H) => (i(), c("span", {
|
|
3475
3510
|
key: H,
|
|
3476
3511
|
class: u(n(t).e("item")),
|
|
3477
|
-
onMousemove: (
|
|
3478
|
-
onClick: (
|
|
3512
|
+
onMousemove: (E) => $(H, E),
|
|
3513
|
+
onClick: (E) => O(H, E)
|
|
3479
3514
|
}, [
|
|
3480
3515
|
r("span", {
|
|
3481
3516
|
class: u(n(t).e("void")),
|
|
@@ -3490,7 +3525,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3490
3525
|
}, N(s.icon), 7)
|
|
3491
3526
|
], 42, ba))), 128))
|
|
3492
3527
|
], 2),
|
|
3493
|
-
s.showText || s.showScore ? (i(),
|
|
3528
|
+
s.showText || s.showScore ? (i(), c("div", {
|
|
3494
3529
|
key: 0,
|
|
3495
3530
|
class: u(n(t).e("text")),
|
|
3496
3531
|
style: te({ color: s.textColor })
|
|
@@ -3500,7 +3535,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3500
3535
|
}), ya = ["value"], ka = { class: "field-type" }, Ma = { class: "field-name" }, Va = { class: "field-label" }, xa = {
|
|
3501
3536
|
key: 0,
|
|
3502
3537
|
class: "field-required"
|
|
3503
|
-
}, wa = ["onClick"], Ca = ["onClick"], $a = ["onClick"], Da = ["onClick"], Sa = { class: "modal-content" }, za = { class: "modal-header" }, Ta = { class: "modal-body" }, Ha = { class: "edit-field" }, La = { class: "edit-field" }, Ra = { class: "edit-field" }, Ba = ["value"], Aa = { class: "edit-field" },
|
|
3538
|
+
}, wa = ["onClick"], Ca = ["onClick"], $a = ["onClick"], Da = ["onClick"], Sa = { class: "modal-content" }, za = { class: "modal-header" }, Ta = { class: "modal-body" }, Ha = { class: "edit-field" }, La = { class: "edit-field" }, Ra = { class: "edit-field" }, Ba = ["value"], Aa = { class: "edit-field" }, Ia = { class: "edit-field" }, ht = /* @__PURE__ */ le({
|
|
3504
3539
|
name: "XDynamicFields",
|
|
3505
3540
|
__name: "index",
|
|
3506
3541
|
props: {
|
|
@@ -3520,7 +3555,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3520
3555
|
},
|
|
3521
3556
|
emits: ["update:fields", "add", "remove", "sort", "update"],
|
|
3522
3557
|
setup(s, { emit: k }) {
|
|
3523
|
-
const a = s, e = k, t = ae("dynamic-fields"), l = B([]),
|
|
3558
|
+
const a = s, e = k, t = ae("dynamic-fields"), l = B([]), d = B(null), m = B("input"), b = V(() => [
|
|
3524
3559
|
t.b(),
|
|
3525
3560
|
t.is("editable", a.editable)
|
|
3526
3561
|
]), T = V(() => l.value.length < a.maxFields);
|
|
@@ -3547,7 +3582,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3547
3582
|
const x = l.value[v];
|
|
3548
3583
|
l.value[v] = l.value[v - 1], l.value[v - 1] = x, y(), e("sort", l.value), e("update:fields", l.value);
|
|
3549
3584
|
}
|
|
3550
|
-
},
|
|
3585
|
+
}, O = (h) => {
|
|
3551
3586
|
const v = l.value.findIndex((x) => x.id === h);
|
|
3552
3587
|
if (v < l.value.length - 1) {
|
|
3553
3588
|
const x = l.value[v];
|
|
@@ -3557,23 +3592,23 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3557
3592
|
l.value.forEach((h, v) => {
|
|
3558
3593
|
h.order = v;
|
|
3559
3594
|
});
|
|
3560
|
-
},
|
|
3561
|
-
|
|
3595
|
+
}, R = (h) => {
|
|
3596
|
+
d.value = { ...h };
|
|
3562
3597
|
}, H = () => {
|
|
3563
|
-
if (
|
|
3564
|
-
const h = l.value.findIndex((v) => v.id ===
|
|
3565
|
-
h !== -1 && (l.value[h] =
|
|
3598
|
+
if (d.value) {
|
|
3599
|
+
const h = l.value.findIndex((v) => v.id === d.value.id);
|
|
3600
|
+
h !== -1 && (l.value[h] = d.value, e("update", d.value.id, d.value), e("update:fields", l.value)), d.value = null;
|
|
3566
3601
|
}
|
|
3567
|
-
},
|
|
3568
|
-
|
|
3602
|
+
}, E = () => {
|
|
3603
|
+
d.value = null;
|
|
3569
3604
|
}, M = (h) => {
|
|
3570
3605
|
const v = a.availableTypes.find((x) => x.value === h);
|
|
3571
3606
|
return (v == null ? void 0 : v.label) || h;
|
|
3572
3607
|
};
|
|
3573
|
-
return (h, v) => (i(),
|
|
3608
|
+
return (h, v) => (i(), c("div", {
|
|
3574
3609
|
class: u(b.value)
|
|
3575
3610
|
}, [
|
|
3576
|
-
s.editable && T.value ? (i(),
|
|
3611
|
+
s.editable && T.value ? (i(), c("div", {
|
|
3577
3612
|
key: 0,
|
|
3578
3613
|
class: u(n(t).e("add"))
|
|
3579
3614
|
}, [
|
|
@@ -3581,7 +3616,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3581
3616
|
"onUpdate:modelValue": v[0] || (v[0] = (x) => m.value = x),
|
|
3582
3617
|
class: u(n(t).e("type-select"))
|
|
3583
3618
|
}, [
|
|
3584
|
-
(i(!0),
|
|
3619
|
+
(i(!0), c(Z, null, _(s.availableTypes, (x) => (i(), c("option", {
|
|
3585
3620
|
key: x.value,
|
|
3586
3621
|
value: x.value
|
|
3587
3622
|
}, N(x.label), 9, ya))), 128))
|
|
@@ -3596,7 +3631,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3596
3631
|
r("div", {
|
|
3597
3632
|
class: u(n(t).e("list"))
|
|
3598
3633
|
}, [
|
|
3599
|
-
(i(!0),
|
|
3634
|
+
(i(!0), c(Z, null, _(l.value, (x) => (i(), c("div", {
|
|
3600
3635
|
key: x.id,
|
|
3601
3636
|
class: u(n(t).e("item"))
|
|
3602
3637
|
}, [
|
|
@@ -3606,13 +3641,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3606
3641
|
r("span", ka, N(M(x.type)), 1),
|
|
3607
3642
|
r("span", Ma, N(x.name), 1),
|
|
3608
3643
|
r("span", Va, N(x.label), 1),
|
|
3609
|
-
x.required ? (i(),
|
|
3644
|
+
x.required ? (i(), c("span", xa, "必填")) : U("", !0)
|
|
3610
3645
|
], 2),
|
|
3611
|
-
s.editable ? (i(),
|
|
3646
|
+
s.editable ? (i(), c("div", {
|
|
3612
3647
|
key: 0,
|
|
3613
3648
|
class: u(n(t).e("actions"))
|
|
3614
3649
|
}, [
|
|
3615
|
-
s.showSort ? (i(),
|
|
3650
|
+
s.showSort ? (i(), c("button", {
|
|
3616
3651
|
key: 0,
|
|
3617
3652
|
class: "action-btn",
|
|
3618
3653
|
title: "上移",
|
|
@@ -3623,11 +3658,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3623
3658
|
size: 14
|
|
3624
3659
|
})
|
|
3625
3660
|
], 8, wa)) : U("", !0),
|
|
3626
|
-
s.showSort ? (i(),
|
|
3661
|
+
s.showSort ? (i(), c("button", {
|
|
3627
3662
|
key: 1,
|
|
3628
3663
|
class: "action-btn",
|
|
3629
3664
|
title: "下移",
|
|
3630
|
-
onClick: (A) =>
|
|
3665
|
+
onClick: (A) => O(x.id)
|
|
3631
3666
|
}, [
|
|
3632
3667
|
Q(n(ee), {
|
|
3633
3668
|
name: "move-down",
|
|
@@ -3637,7 +3672,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3637
3672
|
r("button", {
|
|
3638
3673
|
class: "action-btn",
|
|
3639
3674
|
title: "编辑",
|
|
3640
|
-
onClick: (A) =>
|
|
3675
|
+
onClick: (A) => R(x)
|
|
3641
3676
|
}, [
|
|
3642
3677
|
Q(n(ee), {
|
|
3643
3678
|
name: "edit",
|
|
@@ -3657,13 +3692,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3657
3692
|
], 2)) : U("", !0)
|
|
3658
3693
|
], 2))), 128))
|
|
3659
3694
|
], 2),
|
|
3660
|
-
l.value.length === 0 ? (i(),
|
|
3695
|
+
l.value.length === 0 ? (i(), c("div", {
|
|
3661
3696
|
key: 1,
|
|
3662
3697
|
class: u(n(t).e("empty"))
|
|
3663
3698
|
}, [...v[6] || (v[6] = [
|
|
3664
3699
|
r("span", null, "暂无字段配置", -1)
|
|
3665
3700
|
])], 2)) : U("", !0),
|
|
3666
|
-
|
|
3701
|
+
d.value ? (i(), c("div", {
|
|
3667
3702
|
key: 2,
|
|
3668
3703
|
class: u(n(t).e("edit-modal"))
|
|
3669
3704
|
}, [
|
|
@@ -3672,7 +3707,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3672
3707
|
v[7] || (v[7] = r("span", null, "编辑字段", -1)),
|
|
3673
3708
|
r("button", {
|
|
3674
3709
|
class: "close-btn",
|
|
3675
|
-
onClick:
|
|
3710
|
+
onClick: E
|
|
3676
3711
|
}, [
|
|
3677
3712
|
Q(n(ee), {
|
|
3678
3713
|
name: "close",
|
|
@@ -3684,58 +3719,58 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3684
3719
|
r("div", Ha, [
|
|
3685
3720
|
v[8] || (v[8] = r("label", null, "字段名称", -1)),
|
|
3686
3721
|
oe(r("input", {
|
|
3687
|
-
"onUpdate:modelValue": v[1] || (v[1] = (x) =>
|
|
3722
|
+
"onUpdate:modelValue": v[1] || (v[1] = (x) => d.value.name = x),
|
|
3688
3723
|
type: "text",
|
|
3689
3724
|
placeholder: "变量名称"
|
|
3690
3725
|
}, null, 512), [
|
|
3691
|
-
[Ve,
|
|
3726
|
+
[Ve, d.value.name]
|
|
3692
3727
|
])
|
|
3693
3728
|
]),
|
|
3694
3729
|
r("div", La, [
|
|
3695
3730
|
v[9] || (v[9] = r("label", null, "字段标签", -1)),
|
|
3696
3731
|
oe(r("input", {
|
|
3697
|
-
"onUpdate:modelValue": v[2] || (v[2] = (x) =>
|
|
3732
|
+
"onUpdate:modelValue": v[2] || (v[2] = (x) => d.value.label = x),
|
|
3698
3733
|
type: "text",
|
|
3699
3734
|
placeholder: "显示标签"
|
|
3700
3735
|
}, null, 512), [
|
|
3701
|
-
[Ve,
|
|
3736
|
+
[Ve, d.value.label]
|
|
3702
3737
|
])
|
|
3703
3738
|
]),
|
|
3704
3739
|
r("div", Ra, [
|
|
3705
3740
|
v[10] || (v[10] = r("label", null, "字段类型", -1)),
|
|
3706
3741
|
oe(r("select", {
|
|
3707
|
-
"onUpdate:modelValue": v[3] || (v[3] = (x) =>
|
|
3742
|
+
"onUpdate:modelValue": v[3] || (v[3] = (x) => d.value.type = x)
|
|
3708
3743
|
}, [
|
|
3709
|
-
(i(!0),
|
|
3744
|
+
(i(!0), c(Z, null, _(s.availableTypes, (x) => (i(), c("option", {
|
|
3710
3745
|
key: x.value,
|
|
3711
3746
|
value: x.value
|
|
3712
3747
|
}, N(x.label), 9, Ba))), 128))
|
|
3713
3748
|
], 512), [
|
|
3714
|
-
[Ce,
|
|
3749
|
+
[Ce, d.value.type]
|
|
3715
3750
|
])
|
|
3716
3751
|
]),
|
|
3717
3752
|
r("div", Aa, [
|
|
3718
3753
|
v[11] || (v[11] = r("label", null, "是否必填", -1)),
|
|
3719
3754
|
r("button", {
|
|
3720
|
-
class: u(["switch-btn", { "is-on":
|
|
3721
|
-
onClick: v[4] || (v[4] = (x) =>
|
|
3722
|
-
}, N(
|
|
3755
|
+
class: u(["switch-btn", { "is-on": d.value.required }]),
|
|
3756
|
+
onClick: v[4] || (v[4] = (x) => d.value.required = !d.value.required)
|
|
3757
|
+
}, N(d.value.required ? "必填" : "可选"), 3)
|
|
3723
3758
|
]),
|
|
3724
|
-
r("div",
|
|
3759
|
+
r("div", Ia, [
|
|
3725
3760
|
v[12] || (v[12] = r("label", null, "占位文本", -1)),
|
|
3726
3761
|
oe(r("input", {
|
|
3727
|
-
"onUpdate:modelValue": v[5] || (v[5] = (x) =>
|
|
3762
|
+
"onUpdate:modelValue": v[5] || (v[5] = (x) => d.value.placeholder = x),
|
|
3728
3763
|
type: "text",
|
|
3729
3764
|
placeholder: "输入提示"
|
|
3730
3765
|
}, null, 512), [
|
|
3731
|
-
[Ve,
|
|
3766
|
+
[Ve, d.value.placeholder]
|
|
3732
3767
|
])
|
|
3733
3768
|
])
|
|
3734
3769
|
]),
|
|
3735
3770
|
r("div", { class: "modal-footer" }, [
|
|
3736
3771
|
r("button", {
|
|
3737
3772
|
class: "cancel-btn",
|
|
3738
|
-
onClick:
|
|
3773
|
+
onClick: E
|
|
3739
3774
|
}, "取消"),
|
|
3740
3775
|
r("button", {
|
|
3741
3776
|
class: "save-btn",
|
|
@@ -3762,7 +3797,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3762
3797
|
setup(s, { expose: k, emit: a }) {
|
|
3763
3798
|
const e = s, t = a, l = Ne(
|
|
3764
3799
|
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Editor)
|
|
3765
|
-
),
|
|
3800
|
+
), d = Ne(
|
|
3766
3801
|
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Toolbar)
|
|
3767
3802
|
), m = Ge(), b = B(e.modelValue), T = B(!1);
|
|
3768
3803
|
ge(() => {
|
|
@@ -3859,12 +3894,12 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3859
3894
|
}
|
|
3860
3895
|
})), z = (v) => {
|
|
3861
3896
|
m.value = v;
|
|
3862
|
-
},
|
|
3897
|
+
}, O = (v) => {
|
|
3863
3898
|
const x = v.getHtml();
|
|
3864
3899
|
b.value = x, t("update:modelValue", x), t("change", x);
|
|
3865
3900
|
}, y = (v) => {
|
|
3866
3901
|
t("focus", v);
|
|
3867
|
-
},
|
|
3902
|
+
}, R = (v) => {
|
|
3868
3903
|
t("blur", v);
|
|
3869
3904
|
};
|
|
3870
3905
|
return k({
|
|
@@ -3883,11 +3918,11 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3883
3918
|
}), Je(() => {
|
|
3884
3919
|
const v = m.value;
|
|
3885
3920
|
v && v.destroy();
|
|
3886
|
-
}), (v, x) => (i(),
|
|
3921
|
+
}), (v, x) => (i(), c("div", {
|
|
3887
3922
|
class: u(["x-rich-editor", { "is-disabled": s.disabled }])
|
|
3888
3923
|
}, [
|
|
3889
|
-
T.value ? (i(),
|
|
3890
|
-
s.toolbar !== !1 ? (i(), fe(n(
|
|
3924
|
+
T.value ? (i(), c(Z, { key: 0 }, [
|
|
3925
|
+
s.toolbar !== !1 ? (i(), fe(n(d), {
|
|
3891
3926
|
key: 0,
|
|
3892
3927
|
editor: m.value,
|
|
3893
3928
|
"default-config": D.value,
|
|
@@ -3902,18 +3937,18 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3902
3937
|
style: te(S.value),
|
|
3903
3938
|
class: "x-rich-editor__content",
|
|
3904
3939
|
onOnCreated: z,
|
|
3905
|
-
onOnChange:
|
|
3940
|
+
onOnChange: O,
|
|
3906
3941
|
onOnFocus: y,
|
|
3907
|
-
onOnBlur:
|
|
3942
|
+
onOnBlur: R
|
|
3908
3943
|
}, null, 8, ["modelValue", "default-config", "mode", "style"])
|
|
3909
|
-
], 64)) : (i(),
|
|
3944
|
+
], 64)) : (i(), c("div", {
|
|
3910
3945
|
key: 1,
|
|
3911
3946
|
style: te(S.value),
|
|
3912
3947
|
class: "x-rich-editor__placeholder"
|
|
3913
3948
|
}, N(s.placeholder), 5))
|
|
3914
3949
|
], 2));
|
|
3915
3950
|
}
|
|
3916
|
-
}),
|
|
3951
|
+
}), Fa = ["value", "placeholder"], Pa = ["onClick"], Oa = ["onClick"], Ea = ["checked", "onChange"], gt = /* @__PURE__ */ le({
|
|
3917
3952
|
name: "XCascader",
|
|
3918
3953
|
__name: "index",
|
|
3919
3954
|
props: {
|
|
@@ -3930,7 +3965,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3930
3965
|
},
|
|
3931
3966
|
emits: ["update:modelValue", "change"],
|
|
3932
3967
|
setup(s, { emit: k }) {
|
|
3933
|
-
const a = s, e = k, t = ae("cascader"), l = B(!1),
|
|
3968
|
+
const a = s, e = k, t = ae("cascader"), l = B(!1), d = B([]), m = B([]);
|
|
3934
3969
|
B("");
|
|
3935
3970
|
const b = B(""), T = B();
|
|
3936
3971
|
V(() => ({
|
|
@@ -3942,17 +3977,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3942
3977
|
const S = V(() => a.props.multiple), D = V(() => a.props.checkStrictly), $ = V(() => {
|
|
3943
3978
|
if (S.value)
|
|
3944
3979
|
return m.value.length === 0 ? "" : m.value.map((w) => y(w)).join(", ");
|
|
3945
|
-
if (
|
|
3980
|
+
if (d.value.length === 0) return "";
|
|
3946
3981
|
if (a.showAllLevels)
|
|
3947
|
-
return
|
|
3948
|
-
const p =
|
|
3949
|
-
return
|
|
3982
|
+
return d.value.map((w) => R(w, d.value)).join(a.separator);
|
|
3983
|
+
const p = d.value[d.value.length - 1];
|
|
3984
|
+
return R(p, d.value);
|
|
3950
3985
|
}), z = V(() => {
|
|
3951
3986
|
var w;
|
|
3952
3987
|
const p = [a.options];
|
|
3953
|
-
if (
|
|
3988
|
+
if (d.value.length > 0) {
|
|
3954
3989
|
let C = a.options;
|
|
3955
|
-
for (const o of
|
|
3990
|
+
for (const o of d.value) {
|
|
3956
3991
|
const f = C.find((g) => g.value === o);
|
|
3957
3992
|
if ((w = f == null ? void 0 : f.children) != null && w.length)
|
|
3958
3993
|
p.push(f.children), C = f.children;
|
|
@@ -3961,23 +3996,23 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3961
3996
|
}
|
|
3962
3997
|
}
|
|
3963
3998
|
return p;
|
|
3964
|
-
}),
|
|
3999
|
+
}), O = V(() => {
|
|
3965
4000
|
if (!a.filterable || !b.value) return null;
|
|
3966
4001
|
const p = [], w = (C, o = []) => {
|
|
3967
4002
|
var f;
|
|
3968
4003
|
for (const g of C) {
|
|
3969
|
-
const
|
|
4004
|
+
const K = [...o, g];
|
|
3970
4005
|
g.label.toLowerCase().includes(b.value.toLowerCase()) && p.push({
|
|
3971
|
-
path:
|
|
3972
|
-
label:
|
|
3973
|
-
}), (f = g.children) != null && f.length && w(g.children,
|
|
4006
|
+
path: K,
|
|
4007
|
+
label: K.map((ne) => ne.label).join(a.separator)
|
|
4008
|
+
}), (f = g.children) != null && f.length && w(g.children, K);
|
|
3974
4009
|
}
|
|
3975
4010
|
};
|
|
3976
4011
|
return w(a.options), p;
|
|
3977
|
-
}), y = (p) => p.map((w, C) =>
|
|
4012
|
+
}), y = (p) => p.map((w, C) => R(w, p.slice(0, C + 1))).join(a.separator), R = (p, w) => {
|
|
3978
4013
|
let C = a.options;
|
|
3979
4014
|
for (let f = 0; f < w.length - 1; f++) {
|
|
3980
|
-
const g = C.find((
|
|
4015
|
+
const g = C.find((K) => K.value === w[f]);
|
|
3981
4016
|
g != null && g.children && (C = g.children);
|
|
3982
4017
|
}
|
|
3983
4018
|
const o = C.find((f) => f.value === p);
|
|
@@ -3985,34 +4020,34 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
3985
4020
|
}, H = (p, w) => {
|
|
3986
4021
|
var o;
|
|
3987
4022
|
if (p.disabled) return;
|
|
3988
|
-
const C =
|
|
3989
|
-
C.push(p.value),
|
|
3990
|
-
},
|
|
3991
|
-
const o = [...
|
|
4023
|
+
const C = d.value.slice(0, w);
|
|
4024
|
+
C.push(p.value), d.value = C, (!((o = p.children) != null && o.length) || D.value) && (S.value || (l.value = !1, v(C)));
|
|
4025
|
+
}, E = (p, w, C) => {
|
|
4026
|
+
const o = [...d.value.slice(0, w), p.value];
|
|
3992
4027
|
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();
|
|
3993
4028
|
}, M = (p, w) => {
|
|
3994
|
-
const C = [...
|
|
4029
|
+
const C = [...d.value.slice(0, w), p.value];
|
|
3995
4030
|
return m.value.some((o) => JSON.stringify(o) === JSON.stringify(C));
|
|
3996
|
-
}, h = (p, w) =>
|
|
4031
|
+
}, h = (p, w) => d.value[w] === p.value, v = (p) => {
|
|
3997
4032
|
const w = a.props.emitPath !== !1 ? p : p[p.length - 1];
|
|
3998
4033
|
e("update:modelValue", w), e("change", w);
|
|
3999
4034
|
}, x = () => {
|
|
4000
4035
|
const p = a.props.emitPath !== !1 ? m.value : m.value.map((w) => w[w.length - 1]);
|
|
4001
4036
|
e("update:modelValue", p), e("change", p);
|
|
4002
4037
|
}, A = () => {
|
|
4003
|
-
|
|
4004
|
-
},
|
|
4038
|
+
d.value = [], m.value = [], e("update:modelValue", S.value ? [] : ""), e("change", S.value ? [] : "");
|
|
4039
|
+
}, P = (p) => {
|
|
4005
4040
|
b.value = p.target.value;
|
|
4006
4041
|
}, Y = (p) => {
|
|
4007
|
-
|
|
4008
|
-
},
|
|
4042
|
+
d.value = p.map((w) => w.value), b.value = "", l.value = !1, v(d.value);
|
|
4043
|
+
}, J = (p) => {
|
|
4009
4044
|
p.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
4010
4045
|
};
|
|
4011
4046
|
return ie(l, (p) => {
|
|
4012
|
-
p ? document.addEventListener("click",
|
|
4047
|
+
p ? document.addEventListener("click", J) : (document.removeEventListener("click", J), b.value = "");
|
|
4013
4048
|
}), ie(() => a.modelValue, (p) => {
|
|
4014
|
-
S.value ? m.value = Array.isArray(p) ? p : [] : Array.isArray(p) ?
|
|
4015
|
-
}, { immediate: !0 }), (p, w) => (i(),
|
|
4049
|
+
S.value ? m.value = Array.isArray(p) ? p : [] : Array.isArray(p) ? d.value = p : p !== "" && p !== null && p !== void 0 ? d.value = [p] : d.value = [];
|
|
4050
|
+
}, { immediate: !0 }), (p, w) => (i(), c("div", {
|
|
4016
4051
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4017
4052
|
onClick: w[2] || (w[2] = ue(() => {
|
|
4018
4053
|
}, ["stop"]))
|
|
@@ -4021,24 +4056,24 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4021
4056
|
class: u([n(t).e("input"), n(t).is("focus", l.value)]),
|
|
4022
4057
|
onClick: w[0] || (w[0] = (C) => !s.disabled && (l.value = !0))
|
|
4023
4058
|
}, [
|
|
4024
|
-
s.filterable && l.value ? (i(),
|
|
4059
|
+
s.filterable && l.value ? (i(), c("input", {
|
|
4025
4060
|
key: 0,
|
|
4026
4061
|
value: b.value,
|
|
4027
4062
|
placeholder: $.value || s.placeholder,
|
|
4028
4063
|
class: u(n(t).e("filter-input")),
|
|
4029
|
-
onInput:
|
|
4030
|
-
}, null, 42,
|
|
4064
|
+
onInput: P
|
|
4065
|
+
}, null, 42, Fa)) : (i(), c("span", {
|
|
4031
4066
|
key: 1,
|
|
4032
4067
|
class: u(n(t).e("text"))
|
|
4033
4068
|
}, [
|
|
4034
|
-
$.value ? (i(),
|
|
4035
|
-
|
|
4036
|
-
], 64)) : (i(),
|
|
4069
|
+
$.value ? (i(), c(Z, { key: 0 }, [
|
|
4070
|
+
ce(N($.value), 1)
|
|
4071
|
+
], 64)) : (i(), c("span", {
|
|
4037
4072
|
key: 1,
|
|
4038
4073
|
class: u(n(t).e("placeholder"))
|
|
4039
4074
|
}, N(s.placeholder), 3))
|
|
4040
4075
|
], 2)),
|
|
4041
|
-
s.clearable && $.value ? (i(),
|
|
4076
|
+
s.clearable && $.value ? (i(), c("span", {
|
|
4042
4077
|
key: 2,
|
|
4043
4078
|
class: u(n(t).e("clear")),
|
|
4044
4079
|
onClick: ue(A, ["stop"])
|
|
@@ -4060,41 +4095,41 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4060
4095
|
oe(r("div", {
|
|
4061
4096
|
class: u(n(t).e("dropdown"))
|
|
4062
4097
|
}, [
|
|
4063
|
-
|
|
4098
|
+
O.value ? (i(), c("div", {
|
|
4064
4099
|
key: 0,
|
|
4065
4100
|
class: u(n(t).e("filter-list"))
|
|
4066
4101
|
}, [
|
|
4067
|
-
(i(!0),
|
|
4102
|
+
(i(!0), c(Z, null, _(O.value, (C, o) => (i(), c("div", {
|
|
4068
4103
|
key: o,
|
|
4069
4104
|
class: u(n(t).e("filter-item")),
|
|
4070
4105
|
onClick: (f) => Y(C.path)
|
|
4071
4106
|
}, N(C.label), 11, Pa))), 128)),
|
|
4072
|
-
|
|
4107
|
+
O.value.length === 0 ? (i(), c("div", {
|
|
4073
4108
|
key: 0,
|
|
4074
4109
|
class: u(n(t).e("empty"))
|
|
4075
4110
|
}, " 无匹配数据 ", 2)) : U("", !0)
|
|
4076
|
-
], 2)) : (i(),
|
|
4111
|
+
], 2)) : (i(), c("div", {
|
|
4077
4112
|
key: 1,
|
|
4078
4113
|
class: u(n(t).e("menu")),
|
|
4079
4114
|
ref_key: "menuRef",
|
|
4080
4115
|
ref: T
|
|
4081
4116
|
}, [
|
|
4082
|
-
(i(!0),
|
|
4117
|
+
(i(!0), c(Z, null, _(z.value, (C, o) => (i(), c("div", {
|
|
4083
4118
|
key: o,
|
|
4084
4119
|
class: u(n(t).e("column"))
|
|
4085
4120
|
}, [
|
|
4086
|
-
(i(!0),
|
|
4121
|
+
(i(!0), c(Z, null, _(C, (f) => {
|
|
4087
4122
|
var g;
|
|
4088
|
-
return i(),
|
|
4123
|
+
return i(), c("div", {
|
|
4089
4124
|
key: f.value,
|
|
4090
4125
|
class: u([
|
|
4091
4126
|
n(t).e("option"),
|
|
4092
4127
|
n(t).is("active", h(f, o)),
|
|
4093
4128
|
n(t).is("disabled", f.disabled)
|
|
4094
4129
|
]),
|
|
4095
|
-
onClick: (
|
|
4130
|
+
onClick: (K) => H(f, o)
|
|
4096
4131
|
}, [
|
|
4097
|
-
S.value ? (i(),
|
|
4132
|
+
S.value ? (i(), c("span", {
|
|
4098
4133
|
key: 0,
|
|
4099
4134
|
class: u(n(t).e("checkbox")),
|
|
4100
4135
|
onClick: w[1] || (w[1] = ue(() => {
|
|
@@ -4103,13 +4138,13 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4103
4138
|
r("input", {
|
|
4104
4139
|
type: "checkbox",
|
|
4105
4140
|
checked: M(f, o),
|
|
4106
|
-
onChange: (
|
|
4107
|
-
}, null, 40,
|
|
4141
|
+
onChange: (K) => E(f, o, K.target.checked)
|
|
4142
|
+
}, null, 40, Ea)
|
|
4108
4143
|
], 2)) : U("", !0),
|
|
4109
4144
|
r("span", {
|
|
4110
4145
|
class: u(n(t).e("label"))
|
|
4111
4146
|
}, N(f.label), 3),
|
|
4112
|
-
(g = f.children) != null && g.length ? (i(),
|
|
4147
|
+
(g = f.children) != null && g.length ? (i(), c("span", {
|
|
4113
4148
|
key: 1,
|
|
4114
4149
|
class: u(n(t).e("option-arrow"))
|
|
4115
4150
|
}, [
|
|
@@ -4118,7 +4153,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4118
4153
|
size: 12
|
|
4119
4154
|
})
|
|
4120
4155
|
], 2)) : U("", !0)
|
|
4121
|
-
], 10,
|
|
4156
|
+
], 10, Oa);
|
|
4122
4157
|
}), 128))
|
|
4123
4158
|
], 2))), 128))
|
|
4124
4159
|
], 2))
|
|
@@ -4139,75 +4174,75 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4139
4174
|
},
|
|
4140
4175
|
emits: ["update:modelValue", "change"],
|
|
4141
4176
|
setup(s, { emit: k }) {
|
|
4142
|
-
const a = s, e = k, t = ae("color-picker"), l = B(!1),
|
|
4143
|
-
Y /= 100,
|
|
4144
|
-
const p =
|
|
4177
|
+
const a = s, e = k, t = ae("color-picker"), l = B(!1), d = B(0), m = B(100), b = B(100), T = B(100), S = B(), D = B(), $ = V(() => y(d.value, m.value, b.value)), z = V(() => a.showAlpha ? `${$.value}${Math.round(T.value * 2.55).toString(16).padStart(2, "0")}` : $.value), O = V(() => a.modelValue || $.value), y = (P, Y, J) => {
|
|
4178
|
+
Y /= 100, J /= 100;
|
|
4179
|
+
const p = J * Y, w = p * (1 - Math.abs(P / 60 % 2 - 1)), C = J - p;
|
|
4145
4180
|
let o = 0, f = 0, g = 0;
|
|
4146
|
-
|
|
4147
|
-
const
|
|
4148
|
-
return `#${
|
|
4149
|
-
},
|
|
4150
|
-
|
|
4151
|
-
const Y = parseInt(
|
|
4181
|
+
P >= 0 && P < 60 ? (o = p, f = w, g = 0) : P >= 60 && P < 120 ? (o = w, f = p, g = 0) : P >= 120 && P < 180 ? (o = 0, f = p, g = w) : P >= 180 && P < 240 ? (o = 0, f = w, g = p) : P >= 240 && P < 300 ? (o = w, f = 0, g = p) : (o = p, f = 0, g = w);
|
|
4182
|
+
const K = (ne) => Math.round((ne + C) * 255).toString(16).padStart(2, "0");
|
|
4183
|
+
return `#${K(o)}${K(f)}${K(g)}`;
|
|
4184
|
+
}, R = (P) => {
|
|
4185
|
+
P = P.replace("#", "");
|
|
4186
|
+
const Y = parseInt(P.slice(0, 2), 16) / 255, J = parseInt(P.slice(2, 4), 16) / 255, p = parseInt(P.slice(4, 6), 16) / 255, w = Math.max(Y, J, p), C = Math.min(Y, J, p), o = w - C;
|
|
4152
4187
|
let f = 0;
|
|
4153
|
-
const g = w === 0 ? 0 : o / w,
|
|
4188
|
+
const g = w === 0 ? 0 : o / w, K = w;
|
|
4154
4189
|
if (o !== 0)
|
|
4155
4190
|
switch (w) {
|
|
4156
4191
|
case Y:
|
|
4157
|
-
f = ((
|
|
4192
|
+
f = ((J - p) / o + (J < p ? 6 : 0)) * 60;
|
|
4158
4193
|
break;
|
|
4159
|
-
case
|
|
4194
|
+
case J:
|
|
4160
4195
|
f = ((p - Y) / o + 2) * 60;
|
|
4161
4196
|
break;
|
|
4162
4197
|
case p:
|
|
4163
|
-
f = ((Y -
|
|
4198
|
+
f = ((Y - J) / o + 4) * 60;
|
|
4164
4199
|
break;
|
|
4165
4200
|
}
|
|
4166
|
-
return { h: f, s: g * 100, v:
|
|
4167
|
-
}, H = (
|
|
4201
|
+
return { h: f, s: g * 100, v: K * 100 };
|
|
4202
|
+
}, H = (P) => {
|
|
4168
4203
|
if (!S.value) return;
|
|
4169
|
-
const Y = S.value.getBoundingClientRect(),
|
|
4170
|
-
m.value = Math.round(
|
|
4171
|
-
},
|
|
4204
|
+
const Y = S.value.getBoundingClientRect(), J = Math.max(0, Math.min(1, (P.clientX - Y.left) / Y.width)), p = Math.max(0, Math.min(1, (P.clientY - Y.top) / Y.height));
|
|
4205
|
+
m.value = Math.round(J * 100), b.value = Math.round((1 - p) * 100);
|
|
4206
|
+
}, E = (P) => {
|
|
4172
4207
|
if (!D.value) return;
|
|
4173
|
-
const Y = D.value.getBoundingClientRect(),
|
|
4174
|
-
|
|
4175
|
-
}, M = (
|
|
4208
|
+
const Y = D.value.getBoundingClientRect(), J = Math.max(0, Math.min(1, (P.clientX - Y.left) / Y.width));
|
|
4209
|
+
d.value = Math.round(J * 360);
|
|
4210
|
+
}, M = (P) => {
|
|
4176
4211
|
if (!D.value) return;
|
|
4177
|
-
const Y = D.value.getBoundingClientRect(),
|
|
4178
|
-
T.value = Math.round(
|
|
4179
|
-
}, h = (
|
|
4180
|
-
const Y =
|
|
4181
|
-
|
|
4212
|
+
const Y = D.value.getBoundingClientRect(), J = Math.max(0, Math.min(1, (P.clientX - Y.left) / Y.width));
|
|
4213
|
+
T.value = Math.round(J * 100);
|
|
4214
|
+
}, h = (P) => {
|
|
4215
|
+
const Y = R(P);
|
|
4216
|
+
d.value = Y.h, m.value = Y.s, b.value = Y.v, e("update:modelValue", P), e("change", P);
|
|
4182
4217
|
}, v = () => {
|
|
4183
4218
|
e("update:modelValue", z.value), e("change", z.value), l.value = !1;
|
|
4184
4219
|
}, x = () => {
|
|
4185
4220
|
e("update:modelValue", ""), e("change", ""), l.value = !1;
|
|
4186
|
-
}, A = (
|
|
4187
|
-
|
|
4221
|
+
}, A = (P) => {
|
|
4222
|
+
P.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
4188
4223
|
};
|
|
4189
|
-
return ie(l, (
|
|
4190
|
-
if (
|
|
4224
|
+
return ie(l, (P) => {
|
|
4225
|
+
if (P) {
|
|
4191
4226
|
if (document.addEventListener("click", A), a.modelValue) {
|
|
4192
|
-
const Y =
|
|
4193
|
-
|
|
4227
|
+
const Y = R(a.modelValue.slice(0, 7));
|
|
4228
|
+
d.value = Y.h, m.value = Y.s, b.value = Y.v, a.showAlpha && a.modelValue.length === 9 && (T.value = Math.round(parseInt(a.modelValue.slice(7, 9), 16) / 2.55));
|
|
4194
4229
|
}
|
|
4195
4230
|
} else
|
|
4196
4231
|
document.removeEventListener("click", A);
|
|
4197
|
-
}), (
|
|
4232
|
+
}), (P, Y) => (i(), c("div", {
|
|
4198
4233
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4199
4234
|
onClick: Y[1] || (Y[1] = ue(() => {
|
|
4200
4235
|
}, ["stop"]))
|
|
4201
4236
|
}, [
|
|
4202
4237
|
r("div", {
|
|
4203
4238
|
class: u(n(t).e("trigger")),
|
|
4204
|
-
onClick: Y[0] || (Y[0] = (
|
|
4239
|
+
onClick: Y[0] || (Y[0] = (J) => !s.disabled && (l.value = !l.value))
|
|
4205
4240
|
}, [
|
|
4206
4241
|
r("div", {
|
|
4207
4242
|
class: u(n(t).e("color")),
|
|
4208
|
-
style: te({ backgroundColor:
|
|
4243
|
+
style: te({ backgroundColor: O.value })
|
|
4209
4244
|
}, [
|
|
4210
|
-
|
|
4245
|
+
O.value ? U("", !0) : (i(), fe(n(ee), {
|
|
4211
4246
|
key: 0,
|
|
4212
4247
|
name: "close",
|
|
4213
4248
|
size: 12
|
|
@@ -4222,7 +4257,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4222
4257
|
ref: S,
|
|
4223
4258
|
class: u(n(t).e("panel")),
|
|
4224
4259
|
style: te({
|
|
4225
|
-
backgroundColor: `hsl(${
|
|
4260
|
+
backgroundColor: `hsl(${d.value}, 100%, 50%)`
|
|
4226
4261
|
}),
|
|
4227
4262
|
onClick: H
|
|
4228
4263
|
}, [
|
|
@@ -4247,15 +4282,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4247
4282
|
ref_key: "sliderRef",
|
|
4248
4283
|
ref: D,
|
|
4249
4284
|
class: u(n(t).e("hue-bar")),
|
|
4250
|
-
onClick:
|
|
4285
|
+
onClick: E
|
|
4251
4286
|
}, [
|
|
4252
4287
|
r("div", {
|
|
4253
4288
|
class: u(n(t).e("hue-thumb")),
|
|
4254
|
-
style: te({ left: `${
|
|
4289
|
+
style: te({ left: `${d.value / 360 * 100}%` })
|
|
4255
4290
|
}, null, 6)
|
|
4256
4291
|
], 2)
|
|
4257
4292
|
], 2),
|
|
4258
|
-
s.showAlpha ? (i(),
|
|
4293
|
+
s.showAlpha ? (i(), c("div", {
|
|
4259
4294
|
key: 0,
|
|
4260
4295
|
class: u(n(t).e("alpha"))
|
|
4261
4296
|
}, [
|
|
@@ -4272,15 +4307,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4272
4307
|
}, null, 6)
|
|
4273
4308
|
], 6)
|
|
4274
4309
|
], 2)) : U("", !0),
|
|
4275
|
-
s.predefine.length ? (i(),
|
|
4310
|
+
s.predefine.length ? (i(), c("div", {
|
|
4276
4311
|
key: 1,
|
|
4277
4312
|
class: u(n(t).e("predefine"))
|
|
4278
4313
|
}, [
|
|
4279
|
-
(i(!0),
|
|
4314
|
+
(i(!0), c(Z, null, _(s.predefine, (J, p) => (i(), c("div", {
|
|
4280
4315
|
key: p,
|
|
4281
4316
|
class: u(n(t).e("predefine-item")),
|
|
4282
|
-
style: te({ backgroundColor:
|
|
4283
|
-
onClick: (w) => h(
|
|
4317
|
+
style: te({ backgroundColor: J }),
|
|
4318
|
+
onClick: (w) => h(J)
|
|
4284
4319
|
}, null, 14, Ya))), 128))
|
|
4285
4320
|
], 2)) : U("", !0),
|
|
4286
4321
|
r("div", {
|
|
@@ -4324,7 +4359,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4324
4359
|
},
|
|
4325
4360
|
emits: ["update:modelValue", "select", "clear"],
|
|
4326
4361
|
setup(s, { emit: k }) {
|
|
4327
|
-
const a = s, e = k, t = ae("auto-complete"), l = B(!1),
|
|
4362
|
+
const a = s, e = k, t = ae("auto-complete"), l = B(!1), d = B(a.modelValue), m = B([]), b = B(-1), T = B(), S = B(!1);
|
|
4328
4363
|
let D = null;
|
|
4329
4364
|
const $ = (M) => {
|
|
4330
4365
|
a.fetchSuggestions ? (S.value = !0, a.fetchSuggestions(M, (h) => {
|
|
@@ -4334,14 +4369,14 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4334
4369
|
), l.value = m.value.length > 0);
|
|
4335
4370
|
}, z = (M) => {
|
|
4336
4371
|
const h = M.target.value;
|
|
4337
|
-
|
|
4372
|
+
d.value = h, e("update:modelValue", h), b.value = -1, D && clearTimeout(D), D = setTimeout(() => {
|
|
4338
4373
|
h || a.triggerOnFocus ? $(h) : l.value = !1;
|
|
4339
4374
|
}, a.debounce);
|
|
4340
|
-
},
|
|
4341
|
-
a.triggerOnFocus &&
|
|
4375
|
+
}, O = () => {
|
|
4376
|
+
a.triggerOnFocus && d.value === "" && $("");
|
|
4342
4377
|
}, y = (M) => {
|
|
4343
|
-
|
|
4344
|
-
},
|
|
4378
|
+
d.value = M[a.valueKey], e("update:modelValue", d.value), e("select", M), l.value = !1;
|
|
4379
|
+
}, R = (M) => {
|
|
4345
4380
|
if (l.value)
|
|
4346
4381
|
switch (M.key) {
|
|
4347
4382
|
case "ArrowDown":
|
|
@@ -4362,15 +4397,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4362
4397
|
}
|
|
4363
4398
|
}, H = () => {
|
|
4364
4399
|
var M;
|
|
4365
|
-
|
|
4366
|
-
},
|
|
4400
|
+
d.value = "", e("update:modelValue", ""), e("clear"), l.value = !1, (M = T.value) == null || M.focus();
|
|
4401
|
+
}, E = (M) => {
|
|
4367
4402
|
M.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
4368
4403
|
};
|
|
4369
4404
|
return ie(l, (M) => {
|
|
4370
|
-
M ? document.addEventListener("click",
|
|
4405
|
+
M ? document.addEventListener("click", E) : (document.removeEventListener("click", E), b.value = -1);
|
|
4371
4406
|
}), ie(() => a.modelValue, (M) => {
|
|
4372
|
-
|
|
4373
|
-
}), (M, h) => (i(),
|
|
4407
|
+
d.value = M;
|
|
4408
|
+
}), (M, h) => (i(), c("div", {
|
|
4374
4409
|
class: u([n(t).b(), n(t).m(s.size)]),
|
|
4375
4410
|
onClick: h[0] || (h[0] = ue(() => {
|
|
4376
4411
|
}, ["stop"]))
|
|
@@ -4381,15 +4416,15 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4381
4416
|
r("input", {
|
|
4382
4417
|
ref_key: "inputRef",
|
|
4383
4418
|
ref: T,
|
|
4384
|
-
value:
|
|
4419
|
+
value: d.value,
|
|
4385
4420
|
placeholder: s.placeholder,
|
|
4386
4421
|
disabled: s.disabled,
|
|
4387
4422
|
class: u(n(t).e("inner")),
|
|
4388
4423
|
onInput: z,
|
|
4389
|
-
onFocus:
|
|
4390
|
-
onKeydown:
|
|
4424
|
+
onFocus: O,
|
|
4425
|
+
onKeydown: R
|
|
4391
4426
|
}, null, 42, Na),
|
|
4392
|
-
s.clearable &&
|
|
4427
|
+
s.clearable && d.value ? (i(), c("span", {
|
|
4393
4428
|
key: 0,
|
|
4394
4429
|
class: u(n(t).e("clear")),
|
|
4395
4430
|
onClick: H
|
|
@@ -4399,7 +4434,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4399
4434
|
size: 14
|
|
4400
4435
|
})
|
|
4401
4436
|
], 2)) : U("", !0),
|
|
4402
|
-
S.value ? (i(),
|
|
4437
|
+
S.value ? (i(), c("span", {
|
|
4403
4438
|
key: 1,
|
|
4404
4439
|
class: u(n(t).e("loading"))
|
|
4405
4440
|
}, [
|
|
@@ -4415,7 +4450,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4415
4450
|
r("ul", {
|
|
4416
4451
|
class: u(n(t).e("list"))
|
|
4417
4452
|
}, [
|
|
4418
|
-
(i(!0),
|
|
4453
|
+
(i(!0), c(Z, null, _(m.value, (v, x) => (i(), c("li", {
|
|
4419
4454
|
key: x,
|
|
4420
4455
|
class: u([
|
|
4421
4456
|
n(t).e("item"),
|
|
@@ -4424,7 +4459,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4424
4459
|
onClick: (A) => y(v)
|
|
4425
4460
|
}, [
|
|
4426
4461
|
se(M.$slots, "default", { item: v }, () => [
|
|
4427
|
-
|
|
4462
|
+
ce(N(v[s.valueKey]), 1)
|
|
4428
4463
|
])
|
|
4429
4464
|
], 10, Ua))), 128))
|
|
4430
4465
|
], 2)
|
|
@@ -4445,7 +4480,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4445
4480
|
},
|
|
4446
4481
|
emits: ["update:modelValue", "change"],
|
|
4447
4482
|
setup(s, { emit: k }) {
|
|
4448
|
-
const a = s, e = k, t = ae("segmented"), l = B(),
|
|
4483
|
+
const a = s, e = k, t = ae("segmented"), l = B(), d = V(() => a.options.map((S) => typeof S == "string" || typeof S == "number" ? { label: String(S), value: S } : S)), m = V(() => d.value.findIndex((S) => S.value === a.modelValue)), b = V(() => {
|
|
4449
4484
|
if (!l.value || m.value < 0) return {};
|
|
4450
4485
|
const D = l.value.querySelectorAll(`.${t.e("item")}`)[m.value];
|
|
4451
4486
|
return D ? {
|
|
@@ -4455,7 +4490,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4455
4490
|
}), T = (S) => {
|
|
4456
4491
|
a.disabled || S.disabled || (e("update:modelValue", S.value), e("change", S.value));
|
|
4457
4492
|
};
|
|
4458
|
-
return (S, D) => (i(),
|
|
4493
|
+
return (S, D) => (i(), c("div", {
|
|
4459
4494
|
ref_key: "containerRef",
|
|
4460
4495
|
ref: l,
|
|
4461
4496
|
class: u([
|
|
@@ -4469,17 +4504,17 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4469
4504
|
class: u(n(t).e("thumb")),
|
|
4470
4505
|
style: te(b.value)
|
|
4471
4506
|
}, null, 6),
|
|
4472
|
-
(i(!0),
|
|
4507
|
+
(i(!0), c(Z, null, _(d.value, ($, z) => (i(), c("div", {
|
|
4473
4508
|
key: z,
|
|
4474
4509
|
class: u([
|
|
4475
4510
|
n(t).e("item"),
|
|
4476
4511
|
n(t).is("selected", z === m.value),
|
|
4477
4512
|
n(t).is("disabled", $.disabled)
|
|
4478
4513
|
]),
|
|
4479
|
-
onClick: (
|
|
4514
|
+
onClick: (O) => T($)
|
|
4480
4515
|
}, [
|
|
4481
4516
|
se(S.$slots, "default", { option: $ }, () => [
|
|
4482
|
-
|
|
4517
|
+
ce(N($.label), 1)
|
|
4483
4518
|
])
|
|
4484
4519
|
], 10, Xa))), 128))
|
|
4485
4520
|
], 2));
|
|
@@ -4499,9 +4534,9 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4499
4534
|
},
|
|
4500
4535
|
emits: ["update:modelValue", "select", "change"],
|
|
4501
4536
|
setup(s, { emit: k }) {
|
|
4502
|
-
const a = s, e = k, t = ae("mention"), l = B(a.modelValue),
|
|
4503
|
-
m.value = a.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(M.toLowerCase())),
|
|
4504
|
-
},
|
|
4537
|
+
const a = s, e = k, t = ae("mention"), l = B(a.modelValue), d = B(!1), m = B([]), b = B(-1), T = B(), S = B(), D = B(0), $ = B(-1), z = (M) => {
|
|
4538
|
+
m.value = a.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(M.toLowerCase())), d.value = m.value.length > 0, b.value = -1;
|
|
4539
|
+
}, O = (M) => {
|
|
4505
4540
|
const h = M.target;
|
|
4506
4541
|
l.value = h.value, D.value = h.selectionStart || 0;
|
|
4507
4542
|
const v = l.value.slice(0, D.value), x = v.lastIndexOf(a.prefix);
|
|
@@ -4509,16 +4544,16 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4509
4544
|
const A = v.slice(x + a.prefix.length);
|
|
4510
4545
|
$.value = x, z(A);
|
|
4511
4546
|
} else
|
|
4512
|
-
|
|
4547
|
+
d.value = !1;
|
|
4513
4548
|
e("update:modelValue", l.value), e("change", l.value);
|
|
4514
4549
|
}, y = (M) => {
|
|
4515
4550
|
const h = l.value.slice(0, $.value), v = l.value.slice(D.value), x = `${a.prefix}${M.value}${a.split}`;
|
|
4516
|
-
l.value = h + x + v, e("update:modelValue", l.value), e("select", M, a.prefix), e("change", l.value),
|
|
4551
|
+
l.value = h + x + v, e("update:modelValue", l.value), e("select", M, a.prefix), e("change", l.value), d.value = !1, Se(() => {
|
|
4517
4552
|
const A = h.length + x.length;
|
|
4518
4553
|
T.value && (T.value.setSelectionRange(A, A), T.value.focus()), S.value && (S.value.setSelectionRange(A, A), S.value.focus());
|
|
4519
4554
|
});
|
|
4520
|
-
},
|
|
4521
|
-
if (
|
|
4555
|
+
}, R = (M) => {
|
|
4556
|
+
if (d.value)
|
|
4522
4557
|
switch (M.key) {
|
|
4523
4558
|
case "ArrowDown":
|
|
4524
4559
|
M.preventDefault(), b.value = Math.min(
|
|
@@ -4533,25 +4568,25 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4533
4568
|
M.preventDefault(), b.value >= 0 && y(m.value[b.value]);
|
|
4534
4569
|
break;
|
|
4535
4570
|
case "Escape":
|
|
4536
|
-
|
|
4571
|
+
d.value = !1;
|
|
4537
4572
|
break;
|
|
4538
4573
|
}
|
|
4539
4574
|
}, H = () => {
|
|
4540
4575
|
l.value = "", e("update:modelValue", ""), e("change", "");
|
|
4541
|
-
},
|
|
4542
|
-
M.target.closest(`.${t.b()}`) || (
|
|
4576
|
+
}, E = (M) => {
|
|
4577
|
+
M.target.closest(`.${t.b()}`) || (d.value = !1);
|
|
4543
4578
|
};
|
|
4544
|
-
return ie(
|
|
4545
|
-
M ? document.addEventListener("click",
|
|
4579
|
+
return ie(d, (M) => {
|
|
4580
|
+
M ? document.addEventListener("click", E) : document.removeEventListener("click", E);
|
|
4546
4581
|
}), ie(() => a.modelValue, (M) => {
|
|
4547
4582
|
l.value = M;
|
|
4548
|
-
}), (M, h) => (i(),
|
|
4583
|
+
}), (M, h) => (i(), c("div", {
|
|
4549
4584
|
class: u([n(t).b(), n(t).m(s.size)]),
|
|
4550
4585
|
onClick: h[0] || (h[0] = ue(() => {
|
|
4551
4586
|
}, ["stop"]))
|
|
4552
4587
|
}, [
|
|
4553
4588
|
r("div", {
|
|
4554
|
-
class: u([n(t).e("input"), n(t).is("focus",
|
|
4589
|
+
class: u([n(t).e("input"), n(t).is("focus", d.value)])
|
|
4555
4590
|
}, [
|
|
4556
4591
|
r("input", {
|
|
4557
4592
|
ref_key: "inputRef",
|
|
@@ -4560,10 +4595,10 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4560
4595
|
placeholder: s.placeholder,
|
|
4561
4596
|
disabled: s.disabled,
|
|
4562
4597
|
class: u(n(t).e("inner")),
|
|
4563
|
-
onInput:
|
|
4564
|
-
onKeydown:
|
|
4598
|
+
onInput: O,
|
|
4599
|
+
onKeydown: R
|
|
4565
4600
|
}, null, 42, Ka),
|
|
4566
|
-
s.clearable && l.value ? (i(),
|
|
4601
|
+
s.clearable && l.value ? (i(), c("span", {
|
|
4567
4602
|
key: 0,
|
|
4568
4603
|
class: u(n(t).e("clear")),
|
|
4569
4604
|
onClick: H
|
|
@@ -4580,7 +4615,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4580
4615
|
r("ul", {
|
|
4581
4616
|
class: u(n(t).e("list"))
|
|
4582
4617
|
}, [
|
|
4583
|
-
(i(!0),
|
|
4618
|
+
(i(!0), c(Z, null, _(m.value, (v, x) => (i(), c("li", {
|
|
4584
4619
|
key: v.value,
|
|
4585
4620
|
class: u([
|
|
4586
4621
|
n(t).e("item"),
|
|
@@ -4589,7 +4624,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4589
4624
|
]),
|
|
4590
4625
|
onClick: (A) => y(v)
|
|
4591
4626
|
}, [
|
|
4592
|
-
v.avatar ? (i(),
|
|
4627
|
+
v.avatar ? (i(), c("img", {
|
|
4593
4628
|
key: 0,
|
|
4594
4629
|
src: v.avatar,
|
|
4595
4630
|
class: u(n(t).e("avatar"))
|
|
@@ -4603,7 +4638,7 @@ const Yl = ["onClick"], Nl = ["placeholder", "disabled", "readonly", "value"], U
|
|
|
4603
4638
|
], 10, Wa))), 128))
|
|
4604
4639
|
], 2)
|
|
4605
4640
|
], 2), [
|
|
4606
|
-
[be,
|
|
4641
|
+
[be, d.value]
|
|
4607
4642
|
])
|
|
4608
4643
|
], 2));
|
|
4609
4644
|
}
|
|
@@ -4628,11 +4663,11 @@ export {
|
|
|
4628
4663
|
pt as RichEditor,
|
|
4629
4664
|
kt as Segmented,
|
|
4630
4665
|
rt as Select,
|
|
4631
|
-
|
|
4666
|
+
ct as SelectOption,
|
|
4632
4667
|
vt as Slider,
|
|
4633
4668
|
_a as Switch,
|
|
4634
4669
|
Qa as Textarea,
|
|
4635
4670
|
it as TimePicker,
|
|
4636
|
-
|
|
4671
|
+
dt as Transfer,
|
|
4637
4672
|
ft as Upload
|
|
4638
4673
|
};
|