@xto/form 1.3.0 → 1.3.2
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 +1044 -1036
- package/lib/index.cjs +1 -1
- package/package.json +8 -8
package/es/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as le, computed as
|
|
2
|
-
import { useNamespace as ae, useZIndex as
|
|
1
|
+
import { defineComponent as le, computed as M, openBlock as i, createElementBlock as c, normalizeStyle as te, normalizeClass as u, createElementVNode as d, renderSlot as se, createTextVNode as ce, toDisplayString as U, ref as R, useSlots as Ae, watch as ie, unref as n, createCommentVNode as X, withDirectives as ue, vModelDynamic as Ke, createVNode as Z, vModelText as Ve, inject as Ce, withModifiers as oe, provide as Se, toRef as We, onMounted as ge, onUnmounted as $e, Fragment as J, renderList as Q, createBlock as he, Teleport as Fe, Transition as Ie, withCtx as Pe, vModelSelect as we, vShow as be, nextTick as De, defineAsyncComponent as Ee, shallowRef as qe, onBeforeUnmount as je } from "vue";
|
|
2
|
+
import { useNamespace as ae, useZIndex as Oe } from "@xto/core";
|
|
3
3
|
const Ue = {
|
|
4
4
|
// 箭头类
|
|
5
5
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
@@ -214,22 +214,22 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
214
214
|
spin: { type: Boolean, default: !1 },
|
|
215
215
|
strokeWidth: { default: 2 }
|
|
216
216
|
},
|
|
217
|
-
setup(s, { expose:
|
|
218
|
-
const l = s, e = ae("icon"), a =
|
|
217
|
+
setup(s, { expose: k }) {
|
|
218
|
+
const l = s, e = ae("icon"), a = M(() => typeof l.size == "number" ? `${l.size}px` : l.size), t = M(() => ({
|
|
219
219
|
width: a.value,
|
|
220
220
|
height: a.value,
|
|
221
221
|
color: l.color
|
|
222
|
-
})), f =
|
|
222
|
+
})), f = M(() => ({
|
|
223
223
|
strokeWidth: l.strokeWidth
|
|
224
|
-
})), m =
|
|
224
|
+
})), m = M(() => [
|
|
225
225
|
e.b(),
|
|
226
226
|
e.is("spin", l.spin)
|
|
227
|
-
]), y =
|
|
228
|
-
return
|
|
227
|
+
]), y = M(() => l.name && Ge(l.name) ? Ue[l.name] : "");
|
|
228
|
+
return k({
|
|
229
229
|
iconSize: a,
|
|
230
230
|
iconStyle: t,
|
|
231
231
|
iconPath: y
|
|
232
|
-
}), (S,
|
|
232
|
+
}), (S, D) => (i(), c("span", {
|
|
233
233
|
class: u(m.value),
|
|
234
234
|
style: te(t.value),
|
|
235
235
|
"aria-hidden": !s.name,
|
|
@@ -249,7 +249,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
249
249
|
}, [
|
|
250
250
|
d("path", { d: y.value }, null, 8, Qe)
|
|
251
251
|
], 12, Ze)) : se(S.$slots, "default", { key: 1 }, () => [
|
|
252
|
-
|
|
252
|
+
ce(U(s.name), 1)
|
|
253
253
|
])
|
|
254
254
|
], 14, Je));
|
|
255
255
|
}
|
|
@@ -273,68 +273,68 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
273
273
|
suffixIcon: {}
|
|
274
274
|
},
|
|
275
275
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur", "clear"],
|
|
276
|
-
setup(s, { expose:
|
|
277
|
-
const e = s, a = l, t = ae("input"), f = R(), m = R(!1), y = R(!1), S = Ae(),
|
|
276
|
+
setup(s, { expose: k, emit: l }) {
|
|
277
|
+
const e = s, a = l, t = ae("input"), f = R(), m = R(!1), y = R(!1), S = Ae(), D = M(
|
|
278
278
|
() => e.type === "password" && e.showPassword && !e.disabled
|
|
279
|
-
), T =
|
|
280
|
-
|
|
279
|
+
), T = M(() => D.value ? y.value ? "text" : "password" : e.type);
|
|
280
|
+
M(() => e.modelValue !== void 0), M(() => e.value !== void 0);
|
|
281
281
|
const C = R("");
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
|
-
([
|
|
285
|
-
const O =
|
|
284
|
+
([F, B]) => {
|
|
285
|
+
const O = F ?? B ?? "";
|
|
286
286
|
O !== C.value && (C.value = O);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
290
|
-
const z = (
|
|
291
|
-
C.value =
|
|
292
|
-
},
|
|
290
|
+
const z = (F) => {
|
|
291
|
+
C.value = F, a("update:modelValue", F), a("update:value", F), a("input", F);
|
|
292
|
+
}, P = M(() => String(C.value).length), b = M(() => [
|
|
293
293
|
t.b(),
|
|
294
294
|
e.size !== "default" ? t.m(e.size) : "",
|
|
295
295
|
t.is("disabled", e.disabled),
|
|
296
296
|
t.is("focus", m.value),
|
|
297
297
|
t.is("has-prefix", e.prefixIcon || S.prefix),
|
|
298
|
-
t.is("has-suffix", e.suffixIcon || S.suffix || e.clearable ||
|
|
299
|
-
]), H = (
|
|
300
|
-
const
|
|
301
|
-
a("change",
|
|
302
|
-
}, L = (
|
|
303
|
-
m.value = !0, a("focus",
|
|
304
|
-
},
|
|
305
|
-
m.value = !1, a("blur",
|
|
298
|
+
t.is("has-suffix", e.suffixIcon || S.suffix || e.clearable || D.value || e.showWordLimit)
|
|
299
|
+
]), H = (F) => {
|
|
300
|
+
const B = F.target.value;
|
|
301
|
+
a("change", B);
|
|
302
|
+
}, L = (F) => {
|
|
303
|
+
m.value = !0, a("focus", F);
|
|
304
|
+
}, A = (F) => {
|
|
305
|
+
m.value = !1, a("blur", F);
|
|
306
306
|
}, V = () => {
|
|
307
307
|
C.value = "", a("update:modelValue", ""), a("update:value", ""), a("clear");
|
|
308
308
|
}, h = () => {
|
|
309
309
|
y.value = !y.value;
|
|
310
310
|
};
|
|
311
|
-
return
|
|
311
|
+
return k({
|
|
312
312
|
focus: () => {
|
|
313
|
-
var
|
|
314
|
-
(
|
|
313
|
+
var F;
|
|
314
|
+
(F = f.value) == null || F.focus();
|
|
315
315
|
},
|
|
316
316
|
blur: () => {
|
|
317
|
-
var
|
|
318
|
-
(
|
|
317
|
+
var F;
|
|
318
|
+
(F = f.value) == null || F.blur();
|
|
319
319
|
},
|
|
320
320
|
inputRef: f
|
|
321
|
-
}), (
|
|
321
|
+
}), (F, B) => (i(), c("div", {
|
|
322
322
|
class: u(b.value)
|
|
323
323
|
}, [
|
|
324
|
-
|
|
324
|
+
F.$slots.prefix || s.prefixIcon ? (i(), c("span", {
|
|
325
325
|
key: 0,
|
|
326
326
|
class: u(n(t).e("prefix"))
|
|
327
327
|
}, [
|
|
328
|
-
se(
|
|
328
|
+
se(F.$slots, "prefix", {}, () => [
|
|
329
329
|
d("span", {
|
|
330
330
|
class: u(n(t).e("icon"))
|
|
331
331
|
}, U(s.prefixIcon), 3)
|
|
332
332
|
])
|
|
333
|
-
], 2)) :
|
|
333
|
+
], 2)) : X("", !0),
|
|
334
334
|
ue(d("input", {
|
|
335
335
|
ref_key: "inputRef",
|
|
336
336
|
ref: f,
|
|
337
|
-
"onUpdate:modelValue":
|
|
337
|
+
"onUpdate:modelValue": B[0] || (B[0] = (O) => C.value = O),
|
|
338
338
|
type: T.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
@@ -342,18 +342,18 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
342
342
|
maxlength: s.maxlength,
|
|
343
343
|
minlength: s.minlength,
|
|
344
344
|
class: u(n(t).e("inner")),
|
|
345
|
-
onInput:
|
|
345
|
+
onInput: B[1] || (B[1] = (O) => z(O.target.value)),
|
|
346
346
|
onChange: H,
|
|
347
347
|
onFocus: L,
|
|
348
|
-
onBlur:
|
|
348
|
+
onBlur: A
|
|
349
349
|
}, null, 42, _e), [
|
|
350
350
|
[Ke, C.value]
|
|
351
351
|
]),
|
|
352
|
-
|
|
352
|
+
F.$slots.suffix || s.suffixIcon || s.clearable || D.value || s.showWordLimit ? (i(), c("span", {
|
|
353
353
|
key: 1,
|
|
354
354
|
class: u(n(t).e("suffix"))
|
|
355
355
|
}, [
|
|
356
|
-
se(
|
|
356
|
+
se(F.$slots, "suffix", {}, () => [
|
|
357
357
|
s.clearable && s.value && !s.disabled ? (i(), c("span", {
|
|
358
358
|
key: 0,
|
|
359
359
|
class: u([n(t).e("icon"), n(t).e("clear")]),
|
|
@@ -363,8 +363,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
363
363
|
name: "close",
|
|
364
364
|
size: 14
|
|
365
365
|
})
|
|
366
|
-
], 2)) :
|
|
367
|
-
|
|
366
|
+
], 2)) : X("", !0),
|
|
367
|
+
D.value ? (i(), c("span", {
|
|
368
368
|
key: 1,
|
|
369
369
|
class: u([n(t).e("icon"), n(t).e("password")]),
|
|
370
370
|
onClick: h
|
|
@@ -373,13 +373,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
373
373
|
name: y.value ? "eye-off" : "eye",
|
|
374
374
|
size: 14
|
|
375
375
|
}, null, 8, ["name"])
|
|
376
|
-
], 2)) :
|
|
376
|
+
], 2)) : X("", !0),
|
|
377
377
|
s.showWordLimit && s.maxlength ? (i(), c("span", {
|
|
378
378
|
key: 2,
|
|
379
379
|
class: u(n(t).e("count"))
|
|
380
|
-
}, U(
|
|
380
|
+
}, U(P.value) + "/" + U(s.maxlength), 3)) : X("", !0)
|
|
381
381
|
])
|
|
382
|
-
], 2)) :
|
|
382
|
+
], 2)) : X("", !0)
|
|
383
383
|
], 2));
|
|
384
384
|
}
|
|
385
385
|
}), el = ["disabled"], ll = ["value", "placeholder", "disabled"], al = ["disabled"], Ga = /* @__PURE__ */ le({
|
|
@@ -401,8 +401,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
401
401
|
valueOnClear: { default: null }
|
|
402
402
|
},
|
|
403
403
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur"],
|
|
404
|
-
setup(s, { expose:
|
|
405
|
-
const e = s, a = l, t = ae("input-number"), f = R(), m = R(!1), y = R(null), S = R(e.modelValue),
|
|
404
|
+
setup(s, { expose: k, emit: l }) {
|
|
405
|
+
const e = s, a = l, t = ae("input-number"), f = R(), m = R(!1), y = R(null), S = R(e.modelValue), D = M(() => {
|
|
406
406
|
if (e.precision !== void 0)
|
|
407
407
|
return e.precision;
|
|
408
408
|
const o = T(e.step), v = e.modelValue !== void 0 && e.modelValue !== null ? T(e.modelValue) : 0;
|
|
@@ -413,7 +413,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
413
413
|
const v = o.toString(), g = v.indexOf(".");
|
|
414
414
|
return g === -1 ? 0 : v.length - g - 1;
|
|
415
415
|
}
|
|
416
|
-
function C(o, v =
|
|
416
|
+
function C(o, v = D.value) {
|
|
417
417
|
if (v === 0) return Math.round(o);
|
|
418
418
|
let g = o.toFixed(v);
|
|
419
419
|
return Number(g);
|
|
@@ -421,7 +421,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 P = M(() => e.modelValue ?? e.value ?? void 0), b = M(() => y.value !== null ? y.value : P.value === void 0 || P.value === null ? "" : C(P.value)), H = M(() => e.disabled ? !0 : P.value === void 0 ? e.min !== -1 / 0 : P.value <= e.min), L = M(() => e.disabled ? !0 : P.value === void 0 ? e.max !== 1 / 0 : P.value >= e.max), A = M(() => [
|
|
425
425
|
t.b(),
|
|
426
426
|
e.size !== "default" ? t.m(e.size) : "",
|
|
427
427
|
t.is("disabled", e.disabled),
|
|
@@ -430,12 +430,12 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
430
430
|
]);
|
|
431
431
|
function V() {
|
|
432
432
|
if (e.disabled || L.value) return;
|
|
433
|
-
const o =
|
|
433
|
+
const o = P.value ?? (e.min === -1 / 0 ? 0 : e.min), v = C(o + e.step), g = z(v);
|
|
434
434
|
r(g);
|
|
435
435
|
}
|
|
436
436
|
function h() {
|
|
437
437
|
if (e.disabled || H.value) return;
|
|
438
|
-
const o =
|
|
438
|
+
const o = P.value ?? (e.min === -1 / 0 ? 0 : e.min), v = C(o - e.step), g = z(v);
|
|
439
439
|
r(g);
|
|
440
440
|
}
|
|
441
441
|
function r(o) {
|
|
@@ -443,32 +443,32 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
443
443
|
if (o === void 0)
|
|
444
444
|
e.modelValue !== void 0 && a("update:modelValue", void 0), e.value !== void 0 && a("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", void 0), a("change", void 0, v);
|
|
445
445
|
else {
|
|
446
|
-
const g = C(o),
|
|
446
|
+
const g = C(o), N = z(g);
|
|
447
447
|
if (e.stepStrictly) {
|
|
448
|
-
const ne = Math.round((
|
|
448
|
+
const ne = Math.round((N - e.min) / e.step), K = C(e.min + ne * e.step);
|
|
449
449
|
e.modelValue !== void 0 && a("update:modelValue", K), e.value !== void 0 && a("update:value", K), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", K), a("change", K, v);
|
|
450
450
|
} else
|
|
451
|
-
e.modelValue !== void 0 && a("update:modelValue",
|
|
451
|
+
e.modelValue !== void 0 && a("update:modelValue", N), e.value !== void 0 && a("update:value", N), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", N), a("change", N, v);
|
|
452
452
|
}
|
|
453
453
|
S.value = e.modelValue ?? e.value, y.value = null;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function $(o) {
|
|
456
456
|
if (o === "" || o === "-")
|
|
457
457
|
return;
|
|
458
458
|
let v = o.replace(/[^\d.-]/g, "");
|
|
459
459
|
const g = v.split(".");
|
|
460
460
|
g.length > 2 && (v = g[0] + "." + g.slice(1).join("")), v.indexOf("-") > 0 && (v = v.replace(/-/g, "")), v.lastIndexOf("-") > 0 && (v = "-" + v.replace(/-/g, ""));
|
|
461
|
-
const
|
|
462
|
-
if (!isNaN(
|
|
463
|
-
return
|
|
461
|
+
const N = Number(v);
|
|
462
|
+
if (!isNaN(N))
|
|
463
|
+
return N;
|
|
464
464
|
}
|
|
465
|
-
function
|
|
465
|
+
function F(o) {
|
|
466
466
|
const v = o.target.value;
|
|
467
467
|
y.value = v;
|
|
468
468
|
}
|
|
469
|
-
function
|
|
469
|
+
function B(o) {
|
|
470
470
|
if (m.value = !1, y.value !== null) {
|
|
471
|
-
const v =
|
|
471
|
+
const v = $(y.value);
|
|
472
472
|
v === void 0 ? e.valueOnClear !== null ? r(e.valueOnClear) : y.value = null : r(v);
|
|
473
473
|
}
|
|
474
474
|
a("blur", o);
|
|
@@ -494,24 +494,24 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
494
494
|
function p() {
|
|
495
495
|
y.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ? r(e.valueOnClear) : (e.modelValue !== void 0 && a("update:modelValue", void 0), e.value !== void 0 && a("update:value", void 0), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", void 0), a("change", void 0, S.value), S.value = void 0);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
497
|
+
function w() {
|
|
498
498
|
var o;
|
|
499
499
|
(o = f.value) == null || o.focus();
|
|
500
500
|
}
|
|
501
|
-
function
|
|
501
|
+
function x() {
|
|
502
502
|
var o;
|
|
503
503
|
(o = f.value) == null || o.blur();
|
|
504
504
|
}
|
|
505
505
|
return ie([() => e.modelValue, () => e.value], ([o, v]) => {
|
|
506
506
|
S.value = o ?? v, y.value = null;
|
|
507
|
-
}, { immediate: !0 }),
|
|
508
|
-
focus:
|
|
509
|
-
blur:
|
|
507
|
+
}, { immediate: !0 }), k({
|
|
508
|
+
focus: w,
|
|
509
|
+
blur: x,
|
|
510
510
|
clear: p,
|
|
511
511
|
increase: V,
|
|
512
512
|
decrease: h
|
|
513
513
|
}), (o, v) => (i(), c("div", {
|
|
514
|
-
class: u(
|
|
514
|
+
class: u(A.value)
|
|
515
515
|
}, [
|
|
516
516
|
s.controls ? (i(), c("button", {
|
|
517
517
|
key: 0,
|
|
@@ -519,7 +519,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
519
519
|
class: u([n(t).e("decrease"), n(t).is("disabled", H.value)]),
|
|
520
520
|
disabled: H.value,
|
|
521
521
|
onClick: h
|
|
522
|
-
}, " − ", 10, el)) :
|
|
522
|
+
}, " − ", 10, el)) : X("", !0),
|
|
523
523
|
d("div", {
|
|
524
524
|
class: u(n(t).e("wrapper"))
|
|
525
525
|
}, [
|
|
@@ -532,9 +532,9 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
532
532
|
class: u(n(t).e("inner")),
|
|
533
533
|
type: "text",
|
|
534
534
|
autocomplete: "off",
|
|
535
|
-
onInput:
|
|
535
|
+
onInput: F,
|
|
536
536
|
onFocus: O,
|
|
537
|
-
onBlur:
|
|
537
|
+
onBlur: B,
|
|
538
538
|
onKeydown: j
|
|
539
539
|
}, null, 42, ll)
|
|
540
540
|
], 2),
|
|
@@ -544,7 +544,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
544
544
|
class: u([n(t).e("increase"), n(t).is("disabled", L.value)]),
|
|
545
545
|
disabled: L.value,
|
|
546
546
|
onClick: V
|
|
547
|
-
}, " + ", 10, al)) :
|
|
547
|
+
}, " + ", 10, al)) : X("", !0)
|
|
548
548
|
], 2));
|
|
549
549
|
}
|
|
550
550
|
}), tl = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], Ja = /* @__PURE__ */ le({
|
|
@@ -564,7 +564,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
564
564
|
resize: { default: "vertical" }
|
|
565
565
|
},
|
|
566
566
|
emits: ["update:modelValue", "update:value", "input", "change", "focus", "blur"],
|
|
567
|
-
setup(s, { expose:
|
|
567
|
+
setup(s, { expose: k, emit: l }) {
|
|
568
568
|
const e = s, a = l, t = ae("textarea"), f = R(), m = R(!1), y = R("");
|
|
569
569
|
ie(
|
|
570
570
|
[() => e.modelValue, () => e.value],
|
|
@@ -576,22 +576,22 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
576
576
|
);
|
|
577
577
|
const S = (V) => {
|
|
578
578
|
y.value = V, a("update:modelValue", V), a("update:value", V), a("input", V);
|
|
579
|
-
},
|
|
579
|
+
}, D = M(() => String(y.value).length), T = M(() => {
|
|
580
580
|
const V = {};
|
|
581
581
|
if (e.resize && (V.resize = e.resize), e.autosize && (V.minHeight = "auto", typeof e.autosize == "object")) {
|
|
582
582
|
const h = e.autosize.minRows || 1, r = e.autosize.maxRows;
|
|
583
583
|
V.minHeight = `${h * 22 + 12}px`, r && (V.maxHeight = `${r * 22 + 12}px`);
|
|
584
584
|
}
|
|
585
585
|
return V;
|
|
586
|
-
}), C =
|
|
586
|
+
}), C = M(() => [
|
|
587
587
|
t.b(),
|
|
588
588
|
t.is("disabled", e.disabled),
|
|
589
589
|
t.is("focus", m.value),
|
|
590
|
-
t.is("exceed", e.maxlength &&
|
|
590
|
+
t.is("exceed", e.maxlength && D.value > e.maxlength)
|
|
591
591
|
]), z = (V) => {
|
|
592
592
|
const h = V.target.value;
|
|
593
593
|
S(h), e.autosize && f.value && (f.value.style.height = "auto", f.value.style.height = `${f.value.scrollHeight}px`);
|
|
594
|
-
},
|
|
594
|
+
}, P = (V) => {
|
|
595
595
|
const h = V.target.value;
|
|
596
596
|
a("change", h);
|
|
597
597
|
}, b = (V) => {
|
|
@@ -599,7 +599,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
599
599
|
}, H = (V) => {
|
|
600
600
|
m.value = !1, a("blur", V);
|
|
601
601
|
};
|
|
602
|
-
return
|
|
602
|
+
return k({
|
|
603
603
|
focus: () => {
|
|
604
604
|
var V;
|
|
605
605
|
(V = f.value) == null || V.focus();
|
|
@@ -626,16 +626,16 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
626
626
|
style: te(T.value),
|
|
627
627
|
class: u(n(t).e("inner")),
|
|
628
628
|
onInput: z,
|
|
629
|
-
onChange:
|
|
629
|
+
onChange: P,
|
|
630
630
|
onFocus: b,
|
|
631
631
|
onBlur: H
|
|
632
632
|
}, null, 46, tl), [
|
|
633
|
-
[
|
|
633
|
+
[Ve, y.value]
|
|
634
634
|
]),
|
|
635
635
|
s.showWordLimit && s.maxlength ? (i(), c("span", {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: u(n(t).e("count"))
|
|
638
|
-
}, U(
|
|
638
|
+
}, U(D.value) + "/" + U(s.maxlength), 3)) : X("", !0)
|
|
639
639
|
], 6));
|
|
640
640
|
}
|
|
641
641
|
}), Za = /* @__PURE__ */ le({
|
|
@@ -652,21 +652,21 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
652
652
|
inactiveValue: { type: [Boolean, Number, String], default: !1 }
|
|
653
653
|
},
|
|
654
654
|
emits: ["update:modelValue", "update:checked", "change"],
|
|
655
|
-
setup(s, { emit:
|
|
656
|
-
const l = s, e =
|
|
655
|
+
setup(s, { emit: k }) {
|
|
656
|
+
const l = s, e = k, a = ae("switch"), t = M(() => l.modelValue !== void 0 ? l.modelValue : l.checked !== void 0 ? l.checked : !1), f = M(() => t.value === l.activeValue), m = M(() => [
|
|
657
657
|
a.b(),
|
|
658
658
|
a.is("disabled", l.disabled),
|
|
659
659
|
a.is("checked", f.value)
|
|
660
|
-
]), y =
|
|
660
|
+
]), y = M(() => ({
|
|
661
661
|
width: typeof l.width == "number" ? `${l.width}px` : l.width,
|
|
662
662
|
height: "20px",
|
|
663
663
|
backgroundColor: f.value ? l.activeColor : l.inactiveColor
|
|
664
664
|
})), S = () => {
|
|
665
665
|
if (l.disabled) return;
|
|
666
|
-
const
|
|
667
|
-
l.modelValue !== void 0 && e("update:modelValue",
|
|
666
|
+
const D = f.value ? l.inactiveValue : l.activeValue;
|
|
667
|
+
l.modelValue !== void 0 && e("update:modelValue", D), l.checked !== void 0 && e("update:checked", D), l.modelValue === void 0 && l.checked === void 0 && e("update:modelValue", D), e("change", D);
|
|
668
668
|
};
|
|
669
|
-
return (
|
|
669
|
+
return (D, T) => (i(), c("span", {
|
|
670
670
|
class: u(m.value),
|
|
671
671
|
onClick: S
|
|
672
672
|
}, [
|
|
@@ -674,12 +674,12 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
674
674
|
class: u(n(a).e("core")),
|
|
675
675
|
style: te(y.value)
|
|
676
676
|
}, null, 6),
|
|
677
|
-
|
|
677
|
+
D.$slots.default ? (i(), c("span", {
|
|
678
678
|
key: 0,
|
|
679
679
|
class: u(n(a).e("text"))
|
|
680
680
|
}, [
|
|
681
|
-
se(
|
|
682
|
-
], 2)) :
|
|
681
|
+
se(D.$slots, "default")
|
|
682
|
+
], 2)) : X("", !0)
|
|
683
683
|
], 2));
|
|
684
684
|
}
|
|
685
685
|
}), nl = ["checked", "disabled", "name", "value"], Qa = /* @__PURE__ */ le({
|
|
@@ -693,15 +693,15 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
693
693
|
name: {}
|
|
694
694
|
},
|
|
695
695
|
emits: ["update:modelValue", "change"],
|
|
696
|
-
setup(s, { emit:
|
|
697
|
-
const l = s, e =
|
|
696
|
+
setup(s, { emit: k }) {
|
|
697
|
+
const l = s, e = k, a = ae("radio"), t = Ce("radioGroup", null), f = M(() => !!t), m = M(() => f.value ? t.modelValue.value : l.modelValue), y = M(() => l.value ?? l.label), S = M(() => m.value === y.value), D = M(() => l.disabled || f.value && t.disabled), T = M(() => l.name || (f.value ? t.name : void 0)), C = M(() => [
|
|
698
698
|
a.b(),
|
|
699
699
|
a.is("checked", S.value),
|
|
700
|
-
a.is("disabled",
|
|
700
|
+
a.is("disabled", D.value)
|
|
701
701
|
]), z = () => {
|
|
702
|
-
|
|
702
|
+
D.value || (f.value ? t.changeValue(y.value) : (e("update:modelValue", y.value), e("change", y.value)));
|
|
703
703
|
};
|
|
704
|
-
return (
|
|
704
|
+
return (P, b) => (i(), c("label", {
|
|
705
705
|
class: u(C.value),
|
|
706
706
|
onClick: oe(z, ["prevent"])
|
|
707
707
|
}, [
|
|
@@ -711,19 +711,19 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
711
711
|
d("input", {
|
|
712
712
|
type: "radio",
|
|
713
713
|
checked: S.value,
|
|
714
|
-
disabled:
|
|
714
|
+
disabled: D.value,
|
|
715
715
|
name: T.value,
|
|
716
716
|
value: y.value
|
|
717
717
|
}, null, 8, nl)
|
|
718
718
|
], 2),
|
|
719
|
-
|
|
719
|
+
P.$slots.default || s.label ? (i(), c("span", {
|
|
720
720
|
key: 0,
|
|
721
721
|
class: u(n(a).e("label"))
|
|
722
722
|
}, [
|
|
723
|
-
se(
|
|
724
|
-
|
|
723
|
+
se(P.$slots, "default", {}, () => [
|
|
724
|
+
ce(U(s.label), 1)
|
|
725
725
|
])
|
|
726
|
-
], 2)) :
|
|
726
|
+
], 2)) : X("", !0)
|
|
727
727
|
], 2));
|
|
728
728
|
}
|
|
729
729
|
}), _a = /* @__PURE__ */ le({
|
|
@@ -736,12 +736,12 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
736
736
|
name: {}
|
|
737
737
|
},
|
|
738
738
|
emits: ["update:modelValue", "update:value", "change"],
|
|
739
|
-
setup(s, { emit:
|
|
740
|
-
const l = s, e =
|
|
739
|
+
setup(s, { emit: k }) {
|
|
740
|
+
const l = s, e = k, a = ae("radio-group"), t = (f) => {
|
|
741
741
|
l.modelValue !== void 0 && e("update:modelValue", f), l.value !== void 0 && e("update:value", f), l.modelValue === void 0 && l.value === void 0 && e("update:modelValue", f), e("change", f);
|
|
742
742
|
};
|
|
743
|
-
return
|
|
744
|
-
modelValue:
|
|
743
|
+
return Se("radioGroup", {
|
|
744
|
+
modelValue: M(() => l.modelValue ?? l.value),
|
|
745
745
|
name: l.name || `radio-group-${Date.now()}`,
|
|
746
746
|
disabled: l.disabled,
|
|
747
747
|
changeValue: t
|
|
@@ -762,8 +762,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
762
762
|
name: {}
|
|
763
763
|
},
|
|
764
764
|
emits: ["update:modelValue", "change"],
|
|
765
|
-
setup(s, { emit:
|
|
766
|
-
const l = s, e = ae("radio-button"), a =
|
|
765
|
+
setup(s, { emit: k }) {
|
|
766
|
+
const l = s, e = ae("radio-button"), a = Ce("radioGroup", null), t = M(() => !!a), f = M(() => t.value ? a.modelValue.value : null), m = M(() => l.value ?? l.label), y = M(() => f.value === m.value), S = M(() => l.disabled || t.value && a.disabled), D = M(() => [
|
|
767
767
|
e.b(),
|
|
768
768
|
e.is("active", y.value),
|
|
769
769
|
e.is("disabled", S.value)
|
|
@@ -771,7 +771,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
771
771
|
S.value || t.value && a.changeValue(m.value);
|
|
772
772
|
};
|
|
773
773
|
return (C, z) => (i(), c("label", {
|
|
774
|
-
class: u(
|
|
774
|
+
class: u(D.value),
|
|
775
775
|
onClick: oe(T, ["prevent"])
|
|
776
776
|
}, [
|
|
777
777
|
d("input", {
|
|
@@ -785,7 +785,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
785
785
|
class: u(n(e).e("inner"))
|
|
786
786
|
}, [
|
|
787
787
|
se(C.$slots, "default", {}, () => [
|
|
788
|
-
|
|
788
|
+
ce(U(s.label), 1)
|
|
789
789
|
])
|
|
790
790
|
], 2)
|
|
791
791
|
], 2));
|
|
@@ -802,15 +802,15 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
802
802
|
indeterminate: { type: Boolean }
|
|
803
803
|
},
|
|
804
804
|
emits: ["update:modelValue", "change"],
|
|
805
|
-
setup(s, { emit:
|
|
806
|
-
const l = s, e =
|
|
805
|
+
setup(s, { emit: k }) {
|
|
806
|
+
const l = s, e = k, a = ae("checkbox"), t = Ce("checkboxGroup", null), f = M(() => !!t), m = M(() => l.value ?? l.label), y = M(() => f.value ? t.modelValue.value.includes(m.value) : Array.isArray(l.modelValue) ? l.modelValue.includes(m.value) : !!l.modelValue), S = M(() => {
|
|
807
807
|
if (l.disabled) return !0;
|
|
808
808
|
if (f.value) {
|
|
809
|
-
const C = t.disabled, z = t.min > 0 && t.modelValue.value.length <= t.min,
|
|
810
|
-
return y.value && z || !y.value &&
|
|
809
|
+
const C = t.disabled, z = t.min > 0 && t.modelValue.value.length <= t.min, P = t.max > 0 && t.modelValue.value.length >= t.max;
|
|
810
|
+
return y.value && z || !y.value && P ? !0 : C;
|
|
811
811
|
}
|
|
812
812
|
return !1;
|
|
813
|
-
}),
|
|
813
|
+
}), D = M(() => [
|
|
814
814
|
a.b(),
|
|
815
815
|
a.is("checked", y.value),
|
|
816
816
|
a.is("disabled", S.value),
|
|
@@ -830,7 +830,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
830
830
|
}
|
|
831
831
|
};
|
|
832
832
|
return (C, z) => (i(), c("label", {
|
|
833
|
-
class: u(
|
|
833
|
+
class: u(D.value),
|
|
834
834
|
onClick: oe(T, ["prevent"])
|
|
835
835
|
}, [
|
|
836
836
|
d("span", {
|
|
@@ -849,9 +849,9 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
849
849
|
class: u(n(a).e("label"))
|
|
850
850
|
}, [
|
|
851
851
|
se(C.$slots, "default", {}, () => [
|
|
852
|
-
|
|
852
|
+
ce(U(s.label), 1)
|
|
853
853
|
])
|
|
854
|
-
], 2)) :
|
|
854
|
+
], 2)) : X("", !0)
|
|
855
855
|
], 2));
|
|
856
856
|
}
|
|
857
857
|
}), at = /* @__PURE__ */ le({
|
|
@@ -864,13 +864,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
864
864
|
max: { default: 0 }
|
|
865
865
|
},
|
|
866
866
|
emits: ["update:modelValue", "change"],
|
|
867
|
-
setup(s, { emit:
|
|
868
|
-
const l = s, e =
|
|
867
|
+
setup(s, { emit: k }) {
|
|
868
|
+
const l = s, e = k, a = ae("checkbox-group"), t = (f) => {
|
|
869
869
|
const m = [...l.modelValue], y = m.indexOf(f);
|
|
870
870
|
y > -1 ? m.splice(y, 1) : m.push(f), e("update:modelValue", m), e("change", m);
|
|
871
871
|
};
|
|
872
|
-
return
|
|
873
|
-
modelValue:
|
|
872
|
+
return Se("checkboxGroup", {
|
|
873
|
+
modelValue: M(() => l.modelValue),
|
|
874
874
|
disabled: l.disabled,
|
|
875
875
|
min: l.min,
|
|
876
876
|
max: l.max,
|
|
@@ -896,13 +896,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
896
896
|
size: { default: "default" }
|
|
897
897
|
},
|
|
898
898
|
emits: ["validate", "submit", "reset"],
|
|
899
|
-
setup(s, { expose:
|
|
900
|
-
const e = s, a = l, t = ae("form"), f = R([]), m =
|
|
899
|
+
setup(s, { expose: k, emit: l }) {
|
|
900
|
+
const e = s, a = l, t = ae("form"), f = R([]), m = M(() => e.layout === "inline" || e.inline), y = M(() => e.layout === "vertical" || e.labelPosition === "top"), S = M(() => [
|
|
901
901
|
t.b(),
|
|
902
902
|
t.m(`label-${y.value ? "top" : e.labelPosition}`),
|
|
903
903
|
t.is("inline", m.value),
|
|
904
904
|
t.is("vertical", y.value)
|
|
905
|
-
]),
|
|
905
|
+
]), D = M(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), T = (h) => {
|
|
906
906
|
f.value.push(h);
|
|
907
907
|
}, C = (h) => {
|
|
908
908
|
const r = f.value.indexOf(h);
|
|
@@ -912,12 +912,12 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
912
912
|
for (const r of f.value)
|
|
913
913
|
await r.validate() || (h = !1);
|
|
914
914
|
return h;
|
|
915
|
-
},
|
|
915
|
+
}, P = async (h) => {
|
|
916
916
|
const r = Array.isArray(h) ? h : [h];
|
|
917
|
-
let
|
|
918
|
-
for (const
|
|
919
|
-
r.includes(
|
|
920
|
-
return
|
|
917
|
+
let $ = !0;
|
|
918
|
+
for (const F of f.value)
|
|
919
|
+
r.includes(F.prop) && (await F.validate() || ($ = !1));
|
|
920
|
+
return $;
|
|
921
921
|
}, b = () => {
|
|
922
922
|
f.value.forEach((h) => {
|
|
923
923
|
h.resetField();
|
|
@@ -925,8 +925,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
925
925
|
}, H = (h) => {
|
|
926
926
|
if (h) {
|
|
927
927
|
const r = Array.isArray(h) ? h : [h];
|
|
928
|
-
f.value.forEach((
|
|
929
|
-
r.includes(
|
|
928
|
+
f.value.forEach(($) => {
|
|
929
|
+
r.includes($.prop) && $.clearValidate();
|
|
930
930
|
});
|
|
931
931
|
} else
|
|
932
932
|
f.value.forEach((r) => {
|
|
@@ -934,29 +934,29 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
934
934
|
});
|
|
935
935
|
}, L = (h) => {
|
|
936
936
|
console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), a("submit");
|
|
937
|
-
},
|
|
937
|
+
}, A = (h) => {
|
|
938
938
|
console.log("[XForm] handleReset triggered", h), h.preventDefault(), b(), a("reset");
|
|
939
939
|
}, V = We(e, "model");
|
|
940
|
-
return
|
|
940
|
+
return Se("form", {
|
|
941
941
|
model: V,
|
|
942
942
|
rules: e.rules,
|
|
943
943
|
labelWidth: e.labelWidth,
|
|
944
944
|
labelPosition: y.value ? "top" : e.labelPosition,
|
|
945
945
|
disabled: e.disabled,
|
|
946
946
|
size: e.size,
|
|
947
|
-
labelStyle:
|
|
947
|
+
labelStyle: D,
|
|
948
948
|
addField: T,
|
|
949
949
|
removeField: C,
|
|
950
950
|
emit: a
|
|
951
|
-
}),
|
|
951
|
+
}), k({
|
|
952
952
|
validate: z,
|
|
953
|
-
validateField:
|
|
953
|
+
validateField: P,
|
|
954
954
|
resetFields: b,
|
|
955
955
|
clearValidate: H
|
|
956
956
|
}), (h, r) => (i(), c("form", {
|
|
957
957
|
class: u(S.value),
|
|
958
958
|
onSubmit: L,
|
|
959
|
-
onReset:
|
|
959
|
+
onReset: A
|
|
960
960
|
}, [
|
|
961
961
|
se(h.$slots, "default")
|
|
962
962
|
], 34));
|
|
@@ -972,97 +972,97 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
972
972
|
rules: {},
|
|
973
973
|
showMessage: { type: Boolean }
|
|
974
974
|
},
|
|
975
|
-
setup(s, { expose:
|
|
976
|
-
const l = s, e = ae("form-item"), a =
|
|
975
|
+
setup(s, { expose: k }) {
|
|
976
|
+
const l = s, e = ae("form-item"), a = Ce("form", null), t = R(""), f = R(""), m = M(() => l.required ? !0 : y().some((L) => L.required)), y = () => {
|
|
977
977
|
const H = [];
|
|
978
978
|
return l.rules && H.push(...l.rules), a && l.prop && a.rules[l.prop] && H.push(...a.rules[l.prop]), H;
|
|
979
979
|
}, S = () => {
|
|
980
980
|
var H;
|
|
981
981
|
if (!(!a || !l.prop))
|
|
982
982
|
return (H = a.model.value) == null ? void 0 : H[l.prop];
|
|
983
|
-
},
|
|
983
|
+
}, D = (H) => {
|
|
984
984
|
!a || !l.prop || a.model.value && (a.model.value[l.prop] = H);
|
|
985
985
|
}, T = async (H) => {
|
|
986
986
|
const L = y();
|
|
987
987
|
if (L.length === 0)
|
|
988
988
|
return t.value = "valid", !0;
|
|
989
|
-
const
|
|
989
|
+
const A = S();
|
|
990
990
|
let V = !0, h = "";
|
|
991
991
|
for (const r of L)
|
|
992
992
|
if (!(H && r.trigger && r.trigger !== H)) {
|
|
993
|
-
if (r.required && (
|
|
993
|
+
if (r.required && (A == null || A === "" || Array.isArray(A) && A.length === 0)) {
|
|
994
994
|
V = !1, h = r.message || "该字段为必填项";
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
997
|
if (r.min !== void 0 || r.max !== void 0) {
|
|
998
|
-
const
|
|
999
|
-
if (r.min !== void 0 &&
|
|
998
|
+
const $ = typeof A == "string" ? A.length : 0;
|
|
999
|
+
if (r.min !== void 0 && $ < r.min) {
|
|
1000
1000
|
V = !1, h = r.message || `长度不能小于 ${r.min} 个字符`;
|
|
1001
1001
|
break;
|
|
1002
1002
|
}
|
|
1003
|
-
if (r.max !== void 0 &&
|
|
1003
|
+
if (r.max !== void 0 && $ > r.max) {
|
|
1004
1004
|
V = !1, h = r.message || `长度不能大于 ${r.max} 个字符`;
|
|
1005
1005
|
break;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
|
-
if (r.pattern &&
|
|
1008
|
+
if (r.pattern && A && !r.pattern.test(A)) {
|
|
1009
1009
|
V = !1, h = r.message || "格式不正确";
|
|
1010
1010
|
break;
|
|
1011
1011
|
}
|
|
1012
1012
|
if (r.validator)
|
|
1013
1013
|
try {
|
|
1014
|
-
await new Promise((
|
|
1015
|
-
r.validator(r,
|
|
1016
|
-
|
|
1014
|
+
await new Promise(($, F) => {
|
|
1015
|
+
r.validator(r, A, (B) => {
|
|
1016
|
+
B ? F(B) : $();
|
|
1017
1017
|
});
|
|
1018
1018
|
});
|
|
1019
|
-
} catch (
|
|
1020
|
-
V = !1, h =
|
|
1019
|
+
} catch ($) {
|
|
1020
|
+
V = !1, h = $.message || r.message || "验证失败";
|
|
1021
1021
|
break;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
1024
|
return t.value = V ? "valid" : "invalid", f.value = h, a && l.prop && a.emit("validate", l.prop, V, h), V;
|
|
1025
1025
|
}, C = () => {
|
|
1026
|
-
|
|
1026
|
+
D(void 0), z();
|
|
1027
1027
|
}, z = () => {
|
|
1028
1028
|
t.value = "", f.value = "";
|
|
1029
|
-
},
|
|
1029
|
+
}, P = M(() => [
|
|
1030
1030
|
e.b(),
|
|
1031
1031
|
e.is("required", m.value),
|
|
1032
1032
|
e.is("error", t.value === "invalid"),
|
|
1033
1033
|
e.is("success", t.value === "valid")
|
|
1034
|
-
]), b =
|
|
1034
|
+
]), b = M(() => {
|
|
1035
1035
|
const H = l.labelWidth ?? (a == null ? void 0 : a.labelWidth) ?? "100px";
|
|
1036
1036
|
return { width: typeof H == "number" ? `${H}px` : H };
|
|
1037
1037
|
});
|
|
1038
1038
|
return ie(() => S(), () => {
|
|
1039
1039
|
t.value === "invalid" && T("change");
|
|
1040
|
-
}),
|
|
1040
|
+
}), ge(() => {
|
|
1041
1041
|
a && l.prop && a.addField({
|
|
1042
1042
|
prop: l.prop,
|
|
1043
1043
|
validate: T,
|
|
1044
1044
|
resetField: C,
|
|
1045
1045
|
clearValidate: z
|
|
1046
1046
|
});
|
|
1047
|
-
}),
|
|
1047
|
+
}), $e(() => {
|
|
1048
1048
|
a && l.prop && a.removeField({
|
|
1049
1049
|
prop: l.prop,
|
|
1050
1050
|
validate: T,
|
|
1051
1051
|
resetField: C,
|
|
1052
1052
|
clearValidate: z
|
|
1053
1053
|
});
|
|
1054
|
-
}),
|
|
1054
|
+
}), k({
|
|
1055
1055
|
validate: T,
|
|
1056
1056
|
resetField: C,
|
|
1057
1057
|
clearValidate: z
|
|
1058
1058
|
}), (H, L) => (i(), c("div", {
|
|
1059
|
-
class: u(
|
|
1059
|
+
class: u(P.value)
|
|
1060
1060
|
}, [
|
|
1061
1061
|
s.label ? (i(), c("label", {
|
|
1062
1062
|
key: 0,
|
|
1063
1063
|
class: u(n(e).e("label")),
|
|
1064
1064
|
style: te(b.value)
|
|
1065
|
-
}, U(s.label), 7)) :
|
|
1065
|
+
}, U(s.label), 7)) : X("", !0),
|
|
1066
1066
|
d("div", {
|
|
1067
1067
|
class: u(n(e).e("content"))
|
|
1068
1068
|
}, [
|
|
@@ -1070,83 +1070,83 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
1070
1070
|
s.showMessage !== !1 && t.value === "invalid" ? (i(), c("div", {
|
|
1071
1071
|
key: 0,
|
|
1072
1072
|
class: u(n(e).e("error"))
|
|
1073
|
-
}, U(f.value), 3)) :
|
|
1073
|
+
}, U(f.value), 3)) : X("", !0)
|
|
1074
1074
|
], 2)
|
|
1075
1075
|
], 2));
|
|
1076
1076
|
}
|
|
1077
1077
|
});
|
|
1078
|
-
function ol(s,
|
|
1079
|
-
return new Date(s,
|
|
1078
|
+
function ol(s, k) {
|
|
1079
|
+
return new Date(s, k + 1, 0).getDate();
|
|
1080
1080
|
}
|
|
1081
|
-
function il(s,
|
|
1082
|
-
return new Date(s,
|
|
1081
|
+
function il(s, k) {
|
|
1082
|
+
return new Date(s, k, 1).getDay();
|
|
1083
1083
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return !s || !
|
|
1084
|
+
function pe(s, k) {
|
|
1085
|
+
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth() && s.getDate() === k.getDate();
|
|
1086
1086
|
}
|
|
1087
|
-
function rl(s,
|
|
1088
|
-
return !s || !
|
|
1087
|
+
function rl(s, k) {
|
|
1088
|
+
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth();
|
|
1089
1089
|
}
|
|
1090
|
-
function Ye(s,
|
|
1091
|
-
if (!
|
|
1090
|
+
function Ye(s, k, l) {
|
|
1091
|
+
if (!k || !l) return !1;
|
|
1092
1092
|
const e = s.getTime();
|
|
1093
|
-
return e >=
|
|
1093
|
+
return e >= k.getTime() && e <= l.getTime();
|
|
1094
1094
|
}
|
|
1095
|
-
function dl(s,
|
|
1096
|
-
const e = [], a = ol(s,
|
|
1097
|
-
let f = new Date(s,
|
|
1095
|
+
function dl(s, k, l = 0) {
|
|
1096
|
+
const e = [], a = ol(s, k), t = il(s, k);
|
|
1097
|
+
let f = new Date(s, k, 1);
|
|
1098
1098
|
const m = (t - l + 7) % 7;
|
|
1099
1099
|
f.setDate(1 - m);
|
|
1100
1100
|
let y = [], S = new Date(f);
|
|
1101
|
-
for (; (S.getMonth() <=
|
|
1101
|
+
for (; (S.getMonth() <= k || S.getMonth() === k && S.getDate() <= a) && (y.push(new Date(S)), !(y.length === 7 && (e.push(y), y = [], S.getMonth() > k) || (S.setDate(S.getDate() + 1), e.length > 7))); )
|
|
1102
1102
|
;
|
|
1103
1103
|
return y.length > 0 && e.push(y), e;
|
|
1104
1104
|
}
|
|
1105
|
-
function
|
|
1105
|
+
function ve(s, k = "YYYY-MM-DD") {
|
|
1106
1106
|
if (!s) return "";
|
|
1107
1107
|
const l = s.getFullYear(), e = s.getMonth() + 1, a = s.getDate(), t = s.getHours(), f = s.getMinutes(), m = s.getSeconds();
|
|
1108
|
-
return
|
|
1108
|
+
return k.replace(/YYYY/g, String(l)).replace(/YY/g, String(l).slice(-2)).replace(/MM/g, String(e).padStart(2, "0")).replace(/M/g, String(e)).replace(/DD/g, String(a).padStart(2, "0")).replace(/D/g, String(a)).replace(/HH/g, String(t).padStart(2, "0")).replace(/H/g, String(t)).replace(/mm/g, String(f).padStart(2, "0")).replace(/m/g, String(f)).replace(/ss/g, String(m).padStart(2, "0")).replace(/s/g, String(m));
|
|
1109
1109
|
}
|
|
1110
|
-
function
|
|
1110
|
+
function fe(s) {
|
|
1111
1111
|
if (!s || Array.isArray(s)) return null;
|
|
1112
1112
|
if (s instanceof Date)
|
|
1113
1113
|
return isNaN(s.getTime()) ? null : s;
|
|
1114
1114
|
if (typeof s == "number")
|
|
1115
1115
|
return new Date(s);
|
|
1116
1116
|
if (typeof s != "string") return null;
|
|
1117
|
-
const
|
|
1118
|
-
if (isNaN(
|
|
1117
|
+
const k = new Date(s);
|
|
1118
|
+
if (isNaN(k.getTime())) {
|
|
1119
1119
|
const l = s.match(/^(\d{4})-(\d{1,2})-(\d{1,2})/);
|
|
1120
1120
|
return l ? new Date(parseInt(l[1]), parseInt(l[2]) - 1, parseInt(l[3])) : null;
|
|
1121
1121
|
}
|
|
1122
|
-
return
|
|
1122
|
+
return k;
|
|
1123
1123
|
}
|
|
1124
1124
|
function cl(s) {
|
|
1125
|
-
const
|
|
1126
|
-
return
|
|
1125
|
+
const k = new Date(s);
|
|
1126
|
+
return k.setMonth(k.getMonth() - 1), k;
|
|
1127
1127
|
}
|
|
1128
1128
|
function vl(s) {
|
|
1129
|
-
const
|
|
1130
|
-
return
|
|
1129
|
+
const k = new Date(s);
|
|
1130
|
+
return k.setMonth(k.getMonth() + 1), k;
|
|
1131
1131
|
}
|
|
1132
1132
|
function fl(s) {
|
|
1133
|
-
const
|
|
1134
|
-
return
|
|
1133
|
+
const k = new Date(s);
|
|
1134
|
+
return k.setFullYear(k.getFullYear() - 1), k;
|
|
1135
1135
|
}
|
|
1136
1136
|
function ml(s) {
|
|
1137
|
-
const
|
|
1138
|
-
return
|
|
1137
|
+
const k = new Date(s);
|
|
1138
|
+
return k.setFullYear(k.getFullYear() + 1), k;
|
|
1139
1139
|
}
|
|
1140
1140
|
function Ne(s) {
|
|
1141
|
-
const
|
|
1142
|
-
return [
|
|
1141
|
+
const k = Math.floor(s / 10) * 10;
|
|
1142
|
+
return [k, k + 9];
|
|
1143
1143
|
}
|
|
1144
1144
|
function Le(s) {
|
|
1145
|
-
const
|
|
1146
|
-
return
|
|
1145
|
+
const k = new Date(s);
|
|
1146
|
+
return k.setHours(0, 0, 0, 0), k;
|
|
1147
1147
|
}
|
|
1148
|
-
function hl(s,
|
|
1149
|
-
if (
|
|
1148
|
+
function hl(s, k, l, e) {
|
|
1149
|
+
if (k && k(s))
|
|
1150
1150
|
return !0;
|
|
1151
1151
|
const a = Le(s).getTime();
|
|
1152
1152
|
return !!(l && a < Le(l).getTime() || e && a > Le(e).getTime());
|
|
@@ -1181,44 +1181,44 @@ const pl = [
|
|
|
1181
1181
|
selectionMode: { default: "single" }
|
|
1182
1182
|
},
|
|
1183
1183
|
emits: ["pick", "range-select", "range-move", "update:viewedMonth"],
|
|
1184
|
-
setup(s, { emit:
|
|
1185
|
-
const l = s, e =
|
|
1184
|
+
setup(s, { emit: k }) {
|
|
1185
|
+
const l = s, e = k, a = ae("date-table"), t = R(null), f = M(() => l.viewedMonth.getFullYear()), m = M(() => l.viewedMonth.getMonth()), y = M(() => dl(f.value, m.value, 0)), S = (h) => l.modelValue ? pe(h, l.modelValue) : !1, D = (h) => pe(h, /* @__PURE__ */ new Date()), T = (h) => rl(h, l.viewedMonth), C = (h) => {
|
|
1186
1186
|
if (l.selectionMode !== "range") return !1;
|
|
1187
|
-
const { startDate: r, endDate:
|
|
1188
|
-
if (
|
|
1189
|
-
const
|
|
1190
|
-
if (
|
|
1191
|
-
const O = r <
|
|
1187
|
+
const { startDate: r, endDate: $, selecting: F } = l.rangeState || {};
|
|
1188
|
+
if (F && r) {
|
|
1189
|
+
const B = t.value;
|
|
1190
|
+
if (B) {
|
|
1191
|
+
const O = r < B ? r : B, j = r < B ? B : r;
|
|
1192
1192
|
return Ye(h, O, j);
|
|
1193
1193
|
}
|
|
1194
|
-
return
|
|
1194
|
+
return pe(h, r);
|
|
1195
1195
|
}
|
|
1196
|
-
return r &&
|
|
1196
|
+
return r && $ ? Ye(h, r, $) : !1;
|
|
1197
1197
|
}, z = (h) => {
|
|
1198
1198
|
if (l.selectionMode !== "range") return !1;
|
|
1199
|
-
const { startDate: r, selecting:
|
|
1200
|
-
return
|
|
1201
|
-
},
|
|
1199
|
+
const { startDate: r, selecting: $ } = l.rangeState || {};
|
|
1200
|
+
return $ && r && t.value ? pe(h, r < t.value ? r : t.value) : r ? pe(h, r) : !1;
|
|
1201
|
+
}, P = (h) => {
|
|
1202
1202
|
if (l.selectionMode !== "range") return !1;
|
|
1203
|
-
const { endDate: r, selecting:
|
|
1204
|
-
if (
|
|
1205
|
-
const { startDate:
|
|
1206
|
-
return
|
|
1203
|
+
const { endDate: r, selecting: $ } = l.rangeState || {};
|
|
1204
|
+
if ($ && t.value) {
|
|
1205
|
+
const { startDate: F } = l.rangeState || {};
|
|
1206
|
+
return pe(h, F < t.value ? t.value : F);
|
|
1207
1207
|
}
|
|
1208
|
-
return r ?
|
|
1208
|
+
return r ? pe(h, r) : !1;
|
|
1209
1209
|
}, b = (h) => hl(h, l.disabledDate, l.minDate, l.maxDate), H = (h) => [
|
|
1210
1210
|
a.e("cell"),
|
|
1211
1211
|
a.is("selected", S(h)),
|
|
1212
|
-
a.is("today",
|
|
1212
|
+
a.is("today", D(h)),
|
|
1213
1213
|
a.is("disabled", b(h)),
|
|
1214
1214
|
a.is("in-range", C(h)),
|
|
1215
1215
|
a.is("range-start", z(h)),
|
|
1216
|
-
a.is("range-end",
|
|
1216
|
+
a.is("range-end", P(h)),
|
|
1217
1217
|
a.is("prev-month", !T(h) && h.getMonth() < m.value),
|
|
1218
1218
|
a.is("next-month", !T(h) && h.getMonth() > m.value)
|
|
1219
1219
|
], L = (h) => {
|
|
1220
1220
|
b(h) || (l.selectionMode === "range" ? e("range-select", h) : e("pick", h));
|
|
1221
|
-
},
|
|
1221
|
+
}, A = (h) => {
|
|
1222
1222
|
t.value = h;
|
|
1223
1223
|
}, V = () => {
|
|
1224
1224
|
t.value = null;
|
|
@@ -1230,24 +1230,24 @@ const pl = [
|
|
|
1230
1230
|
}, [
|
|
1231
1231
|
d("thead", null, [
|
|
1232
1232
|
d("tr", null, [
|
|
1233
|
-
(i(!0), c(J, null, Q(n(gl), (
|
|
1234
|
-
key:
|
|
1233
|
+
(i(!0), c(J, null, Q(n(gl), ($) => (i(), c("th", {
|
|
1234
|
+
key: $,
|
|
1235
1235
|
class: u(n(a).e("header-cell"))
|
|
1236
|
-
}, U(
|
|
1236
|
+
}, U($), 3))), 128))
|
|
1237
1237
|
])
|
|
1238
1238
|
]),
|
|
1239
1239
|
d("tbody", null, [
|
|
1240
|
-
(i(!0), c(J, null, Q(y.value, (
|
|
1241
|
-
(i(!0), c(J, null, Q(
|
|
1240
|
+
(i(!0), c(J, null, Q(y.value, ($, F) => (i(), c("tr", { key: F }, [
|
|
1241
|
+
(i(!0), c(J, null, Q($, (B, O) => (i(), c("td", {
|
|
1242
1242
|
key: O,
|
|
1243
|
-
class: u(H(
|
|
1244
|
-
onClick: (j) => L(
|
|
1245
|
-
onMouseenter: (j) =>
|
|
1243
|
+
class: u(H(B)),
|
|
1244
|
+
onClick: (j) => L(B),
|
|
1245
|
+
onMouseenter: (j) => A(B),
|
|
1246
1246
|
onMouseleave: V
|
|
1247
1247
|
}, [
|
|
1248
1248
|
d("span", {
|
|
1249
1249
|
class: u(n(a).e("cell-text"))
|
|
1250
|
-
}, U(
|
|
1250
|
+
}, U(B.getDate()), 3)
|
|
1251
1251
|
], 42, bl))), 128))
|
|
1252
1252
|
]))), 128))
|
|
1253
1253
|
])
|
|
@@ -1262,9 +1262,9 @@ const pl = [
|
|
|
1262
1262
|
disabledDate: {}
|
|
1263
1263
|
},
|
|
1264
1264
|
emits: ["pick"],
|
|
1265
|
-
setup(s, { emit:
|
|
1266
|
-
const l = s, e =
|
|
1267
|
-
|
|
1265
|
+
setup(s, { emit: k }) {
|
|
1266
|
+
const l = s, e = k, a = ae("month-table");
|
|
1267
|
+
M(() => l.modelValue ? l.modelValue.getMonth() : -1);
|
|
1268
1268
|
const t = (T) => l.modelValue ? l.modelValue.getFullYear() === l.viewedYear && l.modelValue.getMonth() === T : !1, f = (T) => {
|
|
1269
1269
|
const C = /* @__PURE__ */ new Date();
|
|
1270
1270
|
return C.getFullYear() === l.viewedYear && C.getMonth() === T;
|
|
@@ -1279,7 +1279,7 @@ const pl = [
|
|
|
1279
1279
|
a.is("disabled", m(T))
|
|
1280
1280
|
], S = (T) => {
|
|
1281
1281
|
m(T) || e("pick", T);
|
|
1282
|
-
},
|
|
1282
|
+
}, D = M(() => {
|
|
1283
1283
|
const T = [];
|
|
1284
1284
|
for (let C = 0; C < 12; C += 3)
|
|
1285
1285
|
T.push([C, C + 1, C + 2]);
|
|
@@ -1291,7 +1291,7 @@ const pl = [
|
|
|
1291
1291
|
cellpadding: "0"
|
|
1292
1292
|
}, [
|
|
1293
1293
|
d("tbody", null, [
|
|
1294
|
-
(i(!0), c(J, null, Q(
|
|
1294
|
+
(i(!0), c(J, null, Q(D.value, (z, P) => (i(), c("tr", { key: P }, [
|
|
1295
1295
|
(i(!0), c(J, null, Q(z, (b) => (i(), c("td", {
|
|
1296
1296
|
key: b,
|
|
1297
1297
|
class: u(y(b)),
|
|
@@ -1314,19 +1314,19 @@ const pl = [
|
|
|
1314
1314
|
disabledDate: {}
|
|
1315
1315
|
},
|
|
1316
1316
|
emits: ["pick"],
|
|
1317
|
-
setup(s, { emit:
|
|
1318
|
-
const l = s, e =
|
|
1317
|
+
setup(s, { emit: k }) {
|
|
1318
|
+
const l = s, e = k, a = ae("year-table"), t = M(() => (/* @__PURE__ */ new Date()).getFullYear()), f = M(() => Ne(l.viewedYear)), m = M(() => {
|
|
1319
1319
|
const [b] = f.value, H = [];
|
|
1320
1320
|
H.push(b - 1);
|
|
1321
1321
|
for (let L = 0; L < 10; L++)
|
|
1322
1322
|
H.push(b + L);
|
|
1323
1323
|
return H.push(b + 10), H;
|
|
1324
|
-
}), y =
|
|
1324
|
+
}), y = M(() => {
|
|
1325
1325
|
const b = [];
|
|
1326
1326
|
for (let H = 0; H < m.value.length; H += 3)
|
|
1327
1327
|
b.push(m.value.slice(H, H + 3));
|
|
1328
1328
|
return b;
|
|
1329
|
-
}), S = (b) => l.modelValue ? l.modelValue.getFullYear() === b : !1,
|
|
1329
|
+
}), S = (b) => l.modelValue ? l.modelValue.getFullYear() === b : !1, D = (b) => b === t.value, T = (b) => {
|
|
1330
1330
|
const [H, L] = f.value;
|
|
1331
1331
|
return b >= H && b <= L;
|
|
1332
1332
|
}, C = (b) => {
|
|
@@ -1336,10 +1336,10 @@ const pl = [
|
|
|
1336
1336
|
}, z = (b) => [
|
|
1337
1337
|
a.e("cell"),
|
|
1338
1338
|
a.is("selected", S(b)),
|
|
1339
|
-
a.is("current",
|
|
1339
|
+
a.is("current", D(b)),
|
|
1340
1340
|
a.is("disabled", C(b)),
|
|
1341
1341
|
a.is("in-decade", T(b))
|
|
1342
|
-
],
|
|
1342
|
+
], P = (b) => {
|
|
1343
1343
|
C(b) || e("pick", b);
|
|
1344
1344
|
};
|
|
1345
1345
|
return (b, H) => (i(), c("table", {
|
|
@@ -1348,11 +1348,11 @@ const pl = [
|
|
|
1348
1348
|
cellpadding: "0"
|
|
1349
1349
|
}, [
|
|
1350
1350
|
d("tbody", null, [
|
|
1351
|
-
(i(!0), c(J, null, Q(y.value, (L,
|
|
1351
|
+
(i(!0), c(J, null, Q(y.value, (L, A) => (i(), c("tr", { key: A }, [
|
|
1352
1352
|
(i(!0), c(J, null, Q(L, (V) => (i(), c("td", {
|
|
1353
1353
|
key: V,
|
|
1354
1354
|
class: u(z(V)),
|
|
1355
|
-
onClick: (h) =>
|
|
1355
|
+
onClick: (h) => P(V)
|
|
1356
1356
|
}, [
|
|
1357
1357
|
d("span", {
|
|
1358
1358
|
class: u(n(a).e("cell-text"))
|
|
@@ -1384,187 +1384,187 @@ const pl = [
|
|
|
1384
1384
|
showTime: { type: Boolean, default: !1 }
|
|
1385
1385
|
},
|
|
1386
1386
|
emits: ["update:modelValue", "update:value", "change", "focus", "blur", "clear"],
|
|
1387
|
-
setup(s, { expose:
|
|
1388
|
-
const e = s, a = l, t = ae("date-picker"), f = R(!1), m = R(2e3), y = R(), S = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null,
|
|
1389
|
-
e.modelValue !== void 0 && a("update:modelValue",
|
|
1387
|
+
setup(s, { expose: k, emit: l }) {
|
|
1388
|
+
const e = s, a = l, t = ae("date-picker"), f = R(!1), m = R(2e3), y = R(), S = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, D = (I) => {
|
|
1389
|
+
e.modelValue !== void 0 && a("update:modelValue", I), e.value !== void 0 && a("update:value", I), e.modelValue === void 0 && e.value === void 0 && a("update:modelValue", I), a("change", I);
|
|
1390
1390
|
}, T = R(), C = R(), z = R({
|
|
1391
1391
|
top: "0px",
|
|
1392
1392
|
left: "0px"
|
|
1393
|
-
}),
|
|
1393
|
+
}), P = () => Oe().next(), b = R("date"), H = R(/* @__PURE__ */ new Date()), L = R({
|
|
1394
1394
|
hours: (/* @__PURE__ */ new Date()).getHours(),
|
|
1395
1395
|
minutes: (/* @__PURE__ */ new Date()).getMinutes(),
|
|
1396
1396
|
seconds: (/* @__PURE__ */ new Date()).getSeconds()
|
|
1397
|
-
}),
|
|
1397
|
+
}), A = R({
|
|
1398
1398
|
selecting: !1,
|
|
1399
1399
|
startDate: null,
|
|
1400
1400
|
endDate: null
|
|
1401
|
-
}), V =
|
|
1402
|
-
const
|
|
1403
|
-
if (!
|
|
1401
|
+
}), V = M(() => {
|
|
1402
|
+
const I = S();
|
|
1403
|
+
if (!I) return null;
|
|
1404
1404
|
if (e.type === "daterange") {
|
|
1405
|
-
if (!Array.isArray(
|
|
1406
|
-
const [
|
|
1405
|
+
if (!Array.isArray(I)) return null;
|
|
1406
|
+
const [Y, W] = I;
|
|
1407
1407
|
return [
|
|
1408
|
-
|
|
1409
|
-
W instanceof Date ? W :
|
|
1408
|
+
Y instanceof Date ? Y : fe(Y),
|
|
1409
|
+
W instanceof Date ? W : fe(W)
|
|
1410
1410
|
];
|
|
1411
1411
|
}
|
|
1412
|
-
return
|
|
1413
|
-
}), h =
|
|
1412
|
+
return I instanceof Date ? I : fe(I);
|
|
1413
|
+
}), h = M(() => {
|
|
1414
1414
|
if (e.type === "daterange") return "";
|
|
1415
|
-
const
|
|
1416
|
-
if (!
|
|
1417
|
-
const
|
|
1418
|
-
if (!
|
|
1415
|
+
const I = S();
|
|
1416
|
+
if (!I) return "";
|
|
1417
|
+
const Y = I instanceof Date ? I : fe(I);
|
|
1418
|
+
if (!Y) return "";
|
|
1419
1419
|
const W = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
|
|
1420
|
-
return
|
|
1421
|
-
}), r =
|
|
1422
|
-
const
|
|
1423
|
-
if (!
|
|
1424
|
-
const [
|
|
1425
|
-
if (!
|
|
1426
|
-
const W =
|
|
1427
|
-
return W ?
|
|
1428
|
-
}),
|
|
1429
|
-
const
|
|
1430
|
-
if (!
|
|
1431
|
-
const [,
|
|
1432
|
-
if (!
|
|
1433
|
-
const W =
|
|
1434
|
-
return W ?
|
|
1435
|
-
}),
|
|
1436
|
-
const
|
|
1437
|
-
return !
|
|
1438
|
-
}),
|
|
1420
|
+
return ve(Y, W);
|
|
1421
|
+
}), r = M(() => {
|
|
1422
|
+
const I = S();
|
|
1423
|
+
if (!I || !Array.isArray(I)) return "";
|
|
1424
|
+
const [Y] = I;
|
|
1425
|
+
if (!Y) return "";
|
|
1426
|
+
const W = Y instanceof Date ? Y : fe(Y);
|
|
1427
|
+
return W ? ve(W, e.format) : "";
|
|
1428
|
+
}), $ = M(() => {
|
|
1429
|
+
const I = S();
|
|
1430
|
+
if (!I || !Array.isArray(I)) return "";
|
|
1431
|
+
const [, Y] = I;
|
|
1432
|
+
if (!Y) return "";
|
|
1433
|
+
const W = Y instanceof Date ? Y : fe(Y);
|
|
1434
|
+
return W ? ve(W, e.format) : "";
|
|
1435
|
+
}), F = M(() => {
|
|
1436
|
+
const I = S();
|
|
1437
|
+
return !I || Array.isArray(I) ? null : I instanceof Date ? I : fe(I);
|
|
1438
|
+
}), B = M(() => H.value.getFullYear()), O = M(() => H.value.getMonth()), j = M(() => Ne(B.value)), p = M(() => b.value === "year" ? `${j.value[0]} 年 - ${j.value[1]} 年` : b.value === "month" ? `${B.value} 年` : `${B.value} 年 ${O.value + 1} 月`), w = M(() => [
|
|
1439
1439
|
t.b(),
|
|
1440
1440
|
t.m(e.size),
|
|
1441
1441
|
t.is("disabled", e.disabled),
|
|
1442
1442
|
t.is("range", e.type === "daterange")
|
|
1443
|
-
]),
|
|
1443
|
+
]), x = M(() => [
|
|
1444
1444
|
t.e("input"),
|
|
1445
1445
|
t.is("focus", f.value),
|
|
1446
|
-
t.is("has-value", !!h.value || !!(r.value ||
|
|
1446
|
+
t.is("has-value", !!h.value || !!(r.value || $.value))
|
|
1447
1447
|
]), o = () => {
|
|
1448
1448
|
e.disabled || e.readonly || (f.value ? g() : v());
|
|
1449
1449
|
}, v = () => {
|
|
1450
|
-
f.value = !0, m.value =
|
|
1450
|
+
f.value = !0, m.value = P(), De(() => {
|
|
1451
1451
|
if (y.value && T.value) {
|
|
1452
|
-
const
|
|
1453
|
-
let W =
|
|
1454
|
-
|
|
1452
|
+
const I = y.value.getBoundingClientRect(), Y = T.value.getBoundingClientRect();
|
|
1453
|
+
let W = I.bottom + 8, He = I.left;
|
|
1454
|
+
He + Y.width > window.innerWidth && (He = window.innerWidth - Y.width - 8), W + Y.height > window.innerHeight && (W = I.top - Y.height - 8), z.value = {
|
|
1455
1455
|
top: `${W}px`,
|
|
1456
|
-
left: `${
|
|
1456
|
+
left: `${He}px`
|
|
1457
1457
|
};
|
|
1458
1458
|
}
|
|
1459
1459
|
}), a("focus", {});
|
|
1460
1460
|
}, g = () => {
|
|
1461
1461
|
f.value = !1, b.value = "date", a("blur", {});
|
|
1462
|
-
},
|
|
1462
|
+
}, N = (I) => {
|
|
1463
1463
|
if (e.type === "date") {
|
|
1464
|
-
e.showTime && (
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1464
|
+
e.showTime && (I.setHours(L.value.hours), I.setMinutes(L.value.minutes), I.setSeconds(L.value.seconds));
|
|
1465
|
+
const Y = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, W = Y ? ve(I, Y) : I;
|
|
1466
|
+
D(W), e.showTime || g();
|
|
1467
1467
|
}
|
|
1468
1468
|
}, ne = () => {
|
|
1469
|
-
const
|
|
1470
|
-
if (
|
|
1471
|
-
const
|
|
1472
|
-
if (
|
|
1473
|
-
|
|
1474
|
-
const W = e.valueFormat ?
|
|
1475
|
-
|
|
1469
|
+
const I = S();
|
|
1470
|
+
if (I) {
|
|
1471
|
+
const Y = I instanceof Date ? I : fe(I);
|
|
1472
|
+
if (Y) {
|
|
1473
|
+
Y.setHours(L.value.hours), Y.setMinutes(L.value.minutes), Y.setSeconds(L.value.seconds);
|
|
1474
|
+
const W = e.valueFormat ? ve(Y, e.valueFormat) : Y;
|
|
1475
|
+
D(W);
|
|
1476
1476
|
}
|
|
1477
1477
|
} else {
|
|
1478
|
-
const
|
|
1479
|
-
|
|
1480
|
-
const W = e.valueFormat ?
|
|
1481
|
-
|
|
1478
|
+
const Y = /* @__PURE__ */ new Date();
|
|
1479
|
+
Y.setHours(L.value.hours), Y.setMinutes(L.value.minutes), Y.setSeconds(L.value.seconds);
|
|
1480
|
+
const W = e.valueFormat ? ve(Y, e.valueFormat) : Y;
|
|
1481
|
+
D(W);
|
|
1482
1482
|
}
|
|
1483
1483
|
g();
|
|
1484
|
-
}, K = (
|
|
1485
|
-
if (!
|
|
1486
|
-
|
|
1484
|
+
}, K = (I) => {
|
|
1485
|
+
if (!A.value.selecting)
|
|
1486
|
+
A.value.selecting = !0, A.value.startDate = I, A.value.endDate = null;
|
|
1487
1487
|
else {
|
|
1488
|
-
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1488
|
+
A.value.selecting = !1, A.value.startDate && I < A.value.startDate ? [A.value.startDate, A.value.endDate] = [I, A.value.startDate] : A.value.endDate = I;
|
|
1489
|
+
const Y = e.valueFormat ? ve(A.value.startDate, e.valueFormat) : A.value.startDate, W = e.valueFormat ? ve(A.value.endDate, e.valueFormat) : A.value.endDate;
|
|
1490
|
+
D([Y, W]), g();
|
|
1491
1491
|
}
|
|
1492
|
-
}, re = (
|
|
1493
|
-
if (H.value = new Date(
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1492
|
+
}, re = (I) => {
|
|
1493
|
+
if (H.value = new Date(B.value, I, 1), e.type === "month") {
|
|
1494
|
+
const Y = new Date(B.value, I, 1), W = e.valueFormat ? ve(Y, e.valueFormat) : Y;
|
|
1495
|
+
D(W), g();
|
|
1496
1496
|
} else
|
|
1497
1497
|
b.value = "date";
|
|
1498
|
-
}, q = (
|
|
1499
|
-
if (H.value = new Date(
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1498
|
+
}, q = (I) => {
|
|
1499
|
+
if (H.value = new Date(I, O.value, 1), e.type === "year") {
|
|
1500
|
+
const Y = new Date(I, 0, 1), W = e.valueFormat ? ve(Y, e.valueFormat) : Y;
|
|
1501
|
+
D(W), g();
|
|
1502
1502
|
} else
|
|
1503
1503
|
b.value = "month";
|
|
1504
1504
|
}, me = () => {
|
|
1505
1505
|
H.value = cl(H.value);
|
|
1506
|
-
},
|
|
1506
|
+
}, ye = () => {
|
|
1507
1507
|
H.value = vl(H.value);
|
|
1508
|
-
},
|
|
1509
|
-
b.value === "year" ? H.value = new Date(
|
|
1510
|
-
}, Ve = () => {
|
|
1511
|
-
b.value === "year" ? H.value = new Date(A.value + 10, O.value, 1) : H.value = ml(H.value);
|
|
1508
|
+
}, xe = () => {
|
|
1509
|
+
b.value === "year" ? H.value = new Date(B.value - 10, O.value, 1) : H.value = fl(H.value);
|
|
1512
1510
|
}, ze = () => {
|
|
1511
|
+
b.value === "year" ? H.value = new Date(B.value + 10, O.value, 1) : H.value = ml(H.value);
|
|
1512
|
+
}, Te = () => {
|
|
1513
1513
|
b.value = "month";
|
|
1514
|
-
},
|
|
1514
|
+
}, E = () => {
|
|
1515
1515
|
b.value = "year";
|
|
1516
|
-
},
|
|
1517
|
-
|
|
1516
|
+
}, G = () => {
|
|
1517
|
+
D(null), a("clear"), A.value = {
|
|
1518
1518
|
selecting: !1,
|
|
1519
1519
|
startDate: null,
|
|
1520
1520
|
endDate: null
|
|
1521
1521
|
};
|
|
1522
|
-
},
|
|
1522
|
+
}, _ = (I) => {
|
|
1523
1523
|
if (!y.value) return;
|
|
1524
|
-
const
|
|
1525
|
-
y.value.contains(
|
|
1524
|
+
const Y = I.target;
|
|
1525
|
+
y.value.contains(Y) || T.value && T.value.contains(Y) || g();
|
|
1526
1526
|
};
|
|
1527
1527
|
ie(
|
|
1528
1528
|
S,
|
|
1529
|
-
(
|
|
1530
|
-
if (
|
|
1529
|
+
(I) => {
|
|
1530
|
+
if (I)
|
|
1531
1531
|
if (Array.isArray(V.value)) {
|
|
1532
|
-
const [
|
|
1533
|
-
|
|
1532
|
+
const [Y] = V.value;
|
|
1533
|
+
Y && (H.value = new Date(Y));
|
|
1534
1534
|
} else V.value && (H.value = new Date(V.value));
|
|
1535
1535
|
},
|
|
1536
1536
|
{ immediate: !0 }
|
|
1537
|
-
), ie(f, (
|
|
1538
|
-
|
|
1537
|
+
), ie(f, (I) => {
|
|
1538
|
+
I && (b.value = "date", e.type === "daterange" && (A.value = {
|
|
1539
1539
|
selecting: !1,
|
|
1540
1540
|
startDate: Array.isArray(V.value) ? V.value[0] : null,
|
|
1541
1541
|
endDate: Array.isArray(V.value) ? V.value[1] : null
|
|
1542
1542
|
}));
|
|
1543
1543
|
});
|
|
1544
|
-
const
|
|
1545
|
-
|
|
1544
|
+
const de = (I) => {
|
|
1545
|
+
I.key === "Escape" && g();
|
|
1546
1546
|
};
|
|
1547
|
-
return
|
|
1548
|
-
document.addEventListener("click",
|
|
1549
|
-
}),
|
|
1550
|
-
document.removeEventListener("click",
|
|
1551
|
-
}),
|
|
1547
|
+
return ge(() => {
|
|
1548
|
+
document.addEventListener("click", _), document.addEventListener("keydown", de);
|
|
1549
|
+
}), $e(() => {
|
|
1550
|
+
document.removeEventListener("click", _), document.removeEventListener("keydown", de);
|
|
1551
|
+
}), k({
|
|
1552
1552
|
focus: () => {
|
|
1553
|
-
var
|
|
1554
|
-
return (
|
|
1553
|
+
var I;
|
|
1554
|
+
return (I = C.value) == null ? void 0 : I.focus();
|
|
1555
1555
|
},
|
|
1556
1556
|
blur: () => {
|
|
1557
|
-
var
|
|
1558
|
-
return (
|
|
1557
|
+
var I;
|
|
1558
|
+
return (I = C.value) == null ? void 0 : I.blur();
|
|
1559
1559
|
}
|
|
1560
|
-
}), (
|
|
1560
|
+
}), (I, Y) => (i(), c("div", {
|
|
1561
1561
|
ref_key: "pickerRef",
|
|
1562
1562
|
ref: y,
|
|
1563
|
-
class: u(
|
|
1563
|
+
class: u(w.value)
|
|
1564
1564
|
}, [
|
|
1565
1565
|
s.type !== "daterange" ? (i(), c("div", {
|
|
1566
1566
|
key: 0,
|
|
1567
|
-
class: u(
|
|
1567
|
+
class: u(x.value),
|
|
1568
1568
|
onClick: o
|
|
1569
1569
|
}, [
|
|
1570
1570
|
d("input", {
|
|
@@ -1583,7 +1583,7 @@ const pl = [
|
|
|
1583
1583
|
s.clearable && h.value && !s.disabled ? (i(), c("span", {
|
|
1584
1584
|
key: 0,
|
|
1585
1585
|
class: u(n(t).e("clear")),
|
|
1586
|
-
onClick: oe(
|
|
1586
|
+
onClick: oe(G, ["stop"])
|
|
1587
1587
|
}, [
|
|
1588
1588
|
Z(n(ee), {
|
|
1589
1589
|
name: "close",
|
|
@@ -1601,7 +1601,7 @@ const pl = [
|
|
|
1601
1601
|
], 2)
|
|
1602
1602
|
], 2)) : (i(), c("div", {
|
|
1603
1603
|
key: 1,
|
|
1604
|
-
class: u(
|
|
1604
|
+
class: u(x.value),
|
|
1605
1605
|
onClick: o
|
|
1606
1606
|
}, [
|
|
1607
1607
|
d("input", {
|
|
@@ -1620,16 +1620,16 @@ const pl = [
|
|
|
1620
1620
|
placeholder: s.endPlaceholder,
|
|
1621
1621
|
disabled: s.disabled,
|
|
1622
1622
|
readonly: !0,
|
|
1623
|
-
value:
|
|
1623
|
+
value: $.value,
|
|
1624
1624
|
class: u(n(t).e("input-inner"))
|
|
1625
1625
|
}, null, 10, $l),
|
|
1626
1626
|
d("span", {
|
|
1627
1627
|
class: u(n(t).e("suffix"))
|
|
1628
1628
|
}, [
|
|
1629
|
-
s.clearable && (r.value ||
|
|
1629
|
+
s.clearable && (r.value || $.value) && !s.disabled ? (i(), c("span", {
|
|
1630
1630
|
key: 0,
|
|
1631
1631
|
class: u(n(t).e("clear")),
|
|
1632
|
-
onClick: oe(
|
|
1632
|
+
onClick: oe(G, ["stop"])
|
|
1633
1633
|
}, [
|
|
1634
1634
|
Z(n(ee), {
|
|
1635
1635
|
name: "close",
|
|
@@ -1646,7 +1646,7 @@ const pl = [
|
|
|
1646
1646
|
], 2))
|
|
1647
1647
|
], 2)
|
|
1648
1648
|
], 2)),
|
|
1649
|
-
(i(),
|
|
1649
|
+
(i(), he(Fe, { to: "body" }, [
|
|
1650
1650
|
Z(Ie, { name: "fade" }, {
|
|
1651
1651
|
default: Pe(() => [
|
|
1652
1652
|
ue(d("div", {
|
|
@@ -1661,55 +1661,55 @@ const pl = [
|
|
|
1661
1661
|
d("button", {
|
|
1662
1662
|
type: "button",
|
|
1663
1663
|
class: u(n(t).e("prev-btn")),
|
|
1664
|
-
onClick:
|
|
1664
|
+
onClick: Y[0] || (Y[0] = (W) => b.value === "date" ? me() : xe())
|
|
1665
1665
|
}, " ‹ ", 2),
|
|
1666
1666
|
d("div", {
|
|
1667
1667
|
class: u(n(t).e("header-title"))
|
|
1668
1668
|
}, [
|
|
1669
1669
|
b.value === "year" ? (i(), c("span", {
|
|
1670
1670
|
key: 0,
|
|
1671
|
-
onClick:
|
|
1671
|
+
onClick: Y[1] || (Y[1] = (W) => b.value = "month")
|
|
1672
1672
|
}, U(p.value), 1)) : (i(), c(J, { key: 1 }, [
|
|
1673
|
-
d("span", { onClick:
|
|
1673
|
+
d("span", { onClick: E }, U(B.value) + " 年", 1),
|
|
1674
1674
|
b.value === "date" ? (i(), c("span", {
|
|
1675
1675
|
key: 0,
|
|
1676
|
-
onClick:
|
|
1677
|
-
}, U(O.value + 1) + " 月", 1)) :
|
|
1676
|
+
onClick: Te
|
|
1677
|
+
}, U(O.value + 1) + " 月", 1)) : X("", !0)
|
|
1678
1678
|
], 64))
|
|
1679
1679
|
], 2),
|
|
1680
1680
|
d("button", {
|
|
1681
1681
|
type: "button",
|
|
1682
1682
|
class: u(n(t).e("next-btn")),
|
|
1683
|
-
onClick:
|
|
1683
|
+
onClick: Y[2] || (Y[2] = (W) => b.value === "date" ? ye() : ze())
|
|
1684
1684
|
}, " › ", 2)
|
|
1685
1685
|
], 2),
|
|
1686
1686
|
d("div", {
|
|
1687
1687
|
class: u(n(t).e("content"))
|
|
1688
1688
|
}, [
|
|
1689
|
-
b.value === "date" ? (i(),
|
|
1689
|
+
b.value === "date" ? (i(), he(yl, {
|
|
1690
1690
|
key: 0,
|
|
1691
|
-
"model-value":
|
|
1691
|
+
"model-value": F.value,
|
|
1692
1692
|
"viewed-month": H.value,
|
|
1693
1693
|
"disabled-date": s.disabledDate,
|
|
1694
|
-
"min-date": s.minDate ? n(
|
|
1695
|
-
"max-date": s.maxDate ? n(
|
|
1694
|
+
"min-date": s.minDate ? n(fe)(s.minDate) : null,
|
|
1695
|
+
"max-date": s.maxDate ? n(fe)(s.maxDate) : null,
|
|
1696
1696
|
"selection-mode": s.type === "daterange" ? "range" : "single",
|
|
1697
|
-
"range-state":
|
|
1698
|
-
onPick:
|
|
1697
|
+
"range-state": A.value,
|
|
1698
|
+
onPick: N,
|
|
1699
1699
|
onRangeSelect: K
|
|
1700
|
-
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : b.value === "month" ? (i(),
|
|
1700
|
+
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : b.value === "month" ? (i(), he(Ml, {
|
|
1701
1701
|
key: 1,
|
|
1702
|
-
"model-value":
|
|
1703
|
-
"viewed-year":
|
|
1702
|
+
"model-value": F.value,
|
|
1703
|
+
"viewed-year": B.value,
|
|
1704
1704
|
"disabled-date": s.disabledDate,
|
|
1705
1705
|
onPick: re
|
|
1706
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : b.value === "year" ? (i(),
|
|
1706
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : b.value === "year" ? (i(), he(xl, {
|
|
1707
1707
|
key: 2,
|
|
1708
|
-
"model-value":
|
|
1709
|
-
"viewed-year":
|
|
1708
|
+
"model-value": F.value,
|
|
1709
|
+
"viewed-year": B.value,
|
|
1710
1710
|
"disabled-date": s.disabledDate,
|
|
1711
1711
|
onPick: q
|
|
1712
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) :
|
|
1712
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : X("", !0)
|
|
1713
1713
|
], 2),
|
|
1714
1714
|
s.showTime && s.type !== "daterange" ? (i(), c("div", {
|
|
1715
1715
|
key: 0,
|
|
@@ -1719,7 +1719,7 @@ const pl = [
|
|
|
1719
1719
|
class: u(n(t).e("time-item"))
|
|
1720
1720
|
}, [
|
|
1721
1721
|
ue(d("select", {
|
|
1722
|
-
"onUpdate:modelValue":
|
|
1722
|
+
"onUpdate:modelValue": Y[3] || (Y[3] = (W) => L.value.hours = W),
|
|
1723
1723
|
class: u(n(t).e("time-select"))
|
|
1724
1724
|
}, [
|
|
1725
1725
|
(i(), c(J, null, Q(24, (W) => d("option", {
|
|
@@ -1728,19 +1728,19 @@ const pl = [
|
|
|
1728
1728
|
}, U(String(W - 1).padStart(2, "0")), 9, Dl)), 64))
|
|
1729
1729
|
], 2), [
|
|
1730
1730
|
[
|
|
1731
|
-
|
|
1731
|
+
we,
|
|
1732
1732
|
L.value.hours,
|
|
1733
1733
|
void 0,
|
|
1734
1734
|
{ number: !0 }
|
|
1735
1735
|
]
|
|
1736
1736
|
]),
|
|
1737
|
-
|
|
1737
|
+
Y[6] || (Y[6] = d("span", null, "时", -1))
|
|
1738
1738
|
], 2),
|
|
1739
1739
|
d("div", {
|
|
1740
1740
|
class: u(n(t).e("time-item"))
|
|
1741
1741
|
}, [
|
|
1742
1742
|
ue(d("select", {
|
|
1743
|
-
"onUpdate:modelValue":
|
|
1743
|
+
"onUpdate:modelValue": Y[4] || (Y[4] = (W) => L.value.minutes = W),
|
|
1744
1744
|
class: u(n(t).e("time-select"))
|
|
1745
1745
|
}, [
|
|
1746
1746
|
(i(), c(J, null, Q(60, (W) => d("option", {
|
|
@@ -1749,19 +1749,19 @@ const pl = [
|
|
|
1749
1749
|
}, U(String(W - 1).padStart(2, "0")), 9, zl)), 64))
|
|
1750
1750
|
], 2), [
|
|
1751
1751
|
[
|
|
1752
|
-
|
|
1752
|
+
we,
|
|
1753
1753
|
L.value.minutes,
|
|
1754
1754
|
void 0,
|
|
1755
1755
|
{ number: !0 }
|
|
1756
1756
|
]
|
|
1757
1757
|
]),
|
|
1758
|
-
|
|
1758
|
+
Y[7] || (Y[7] = d("span", null, "分", -1))
|
|
1759
1759
|
], 2),
|
|
1760
1760
|
d("div", {
|
|
1761
1761
|
class: u(n(t).e("time-item"))
|
|
1762
1762
|
}, [
|
|
1763
1763
|
ue(d("select", {
|
|
1764
|
-
"onUpdate:modelValue":
|
|
1764
|
+
"onUpdate:modelValue": Y[5] || (Y[5] = (W) => L.value.seconds = W),
|
|
1765
1765
|
class: u(n(t).e("time-select"))
|
|
1766
1766
|
}, [
|
|
1767
1767
|
(i(), c(J, null, Q(60, (W) => d("option", {
|
|
@@ -1770,15 +1770,15 @@ const pl = [
|
|
|
1770
1770
|
}, U(String(W - 1).padStart(2, "0")), 9, Sl)), 64))
|
|
1771
1771
|
], 2), [
|
|
1772
1772
|
[
|
|
1773
|
-
|
|
1773
|
+
we,
|
|
1774
1774
|
L.value.seconds,
|
|
1775
1775
|
void 0,
|
|
1776
1776
|
{ number: !0 }
|
|
1777
1777
|
]
|
|
1778
1778
|
]),
|
|
1779
|
-
|
|
1779
|
+
Y[8] || (Y[8] = d("span", null, "秒", -1))
|
|
1780
1780
|
], 2)
|
|
1781
|
-
], 2)) :
|
|
1781
|
+
], 2)) : X("", !0),
|
|
1782
1782
|
s.showTime && s.type !== "daterange" ? (i(), c("div", {
|
|
1783
1783
|
key: 1,
|
|
1784
1784
|
class: u(n(t).e("footer"))
|
|
@@ -1788,9 +1788,9 @@ const pl = [
|
|
|
1788
1788
|
class: u(n(t).e("confirm-btn")),
|
|
1789
1789
|
onClick: ne
|
|
1790
1790
|
}, "确定", 2)
|
|
1791
|
-
], 2)) :
|
|
1791
|
+
], 2)) : X("", !0)
|
|
1792
1792
|
], 6), [
|
|
1793
|
-
[
|
|
1793
|
+
[be, f.value]
|
|
1794
1794
|
])
|
|
1795
1795
|
]),
|
|
1796
1796
|
_: 1
|
|
@@ -1799,10 +1799,10 @@ const pl = [
|
|
|
1799
1799
|
], 2));
|
|
1800
1800
|
}
|
|
1801
1801
|
});
|
|
1802
|
-
function
|
|
1802
|
+
function ke(s, k = "HH:mm:ss") {
|
|
1803
1803
|
if (!s) return "";
|
|
1804
1804
|
const l = s.getHours(), e = s.getMinutes(), a = s.getSeconds();
|
|
1805
|
-
return
|
|
1805
|
+
return k.replace(/HH/g, String(l).padStart(2, "0")).replace(/H/g, String(l)).replace(/mm/g, String(e).padStart(2, "0")).replace(/m/g, String(e)).replace(/ss/g, String(a).padStart(2, "0")).replace(/s/g, String(a));
|
|
1806
1806
|
}
|
|
1807
1807
|
function Re(s) {
|
|
1808
1808
|
if (!s) return null;
|
|
@@ -1812,15 +1812,15 @@ function Re(s) {
|
|
|
1812
1812
|
const e = /* @__PURE__ */ new Date();
|
|
1813
1813
|
return e.setTime(s), e;
|
|
1814
1814
|
}
|
|
1815
|
-
const
|
|
1816
|
-
if (
|
|
1815
|
+
const k = s.match(/^(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?/);
|
|
1816
|
+
if (k) {
|
|
1817
1817
|
const e = /* @__PURE__ */ new Date();
|
|
1818
|
-
return e.setHours(parseInt(
|
|
1818
|
+
return e.setHours(parseInt(k[1]), parseInt(k[2]), k[3] ? parseInt(k[3]) : 0, 0), e;
|
|
1819
1819
|
}
|
|
1820
1820
|
const l = new Date(s);
|
|
1821
1821
|
return isNaN(l.getTime()) ? null : l;
|
|
1822
1822
|
}
|
|
1823
|
-
function
|
|
1823
|
+
function Me(s) {
|
|
1824
1824
|
return String(s).padStart(2, "0");
|
|
1825
1825
|
}
|
|
1826
1826
|
const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */ le({
|
|
@@ -1837,33 +1837,33 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1837
1837
|
secondStep: { default: 1 }
|
|
1838
1838
|
},
|
|
1839
1839
|
emits: ["confirm", "cancel"],
|
|
1840
|
-
setup(s, { emit:
|
|
1841
|
-
const l = s, e =
|
|
1840
|
+
setup(s, { emit: k }) {
|
|
1841
|
+
const l = s, e = k, a = ae("time-panel"), t = R(0), f = R(0), m = R(0), y = R(), S = R(), D = R(), T = M(() => l.format.includes("ss") || l.format.includes("s")), C = M(() => {
|
|
1842
1842
|
const K = [], re = Math.max(1, l.hourStep);
|
|
1843
1843
|
for (let q = 0; q < 24; q += re)
|
|
1844
1844
|
K.push(q);
|
|
1845
1845
|
return K;
|
|
1846
|
-
}), z =
|
|
1846
|
+
}), z = M(() => {
|
|
1847
1847
|
const K = [], re = Math.max(1, l.minuteStep);
|
|
1848
1848
|
for (let q = 0; q < 60; q += re)
|
|
1849
1849
|
K.push(q);
|
|
1850
1850
|
return K;
|
|
1851
|
-
}),
|
|
1851
|
+
}), P = M(() => {
|
|
1852
1852
|
const K = [], re = Math.max(1, l.secondStep);
|
|
1853
1853
|
for (let q = 0; q < 60; q += re)
|
|
1854
1854
|
K.push(q);
|
|
1855
1855
|
return K;
|
|
1856
|
-
}), b =
|
|
1857
|
-
V(K) || (t.value = K,
|
|
1856
|
+
}), b = M(() => l.disabledHours ? new Set(l.disabledHours()) : /* @__PURE__ */ new Set()), H = M(() => l.disabledMinutes ? new Set(l.disabledMinutes(t.value)) : /* @__PURE__ */ new Set()), L = M(() => l.disabledSeconds ? new Set(l.disabledSeconds(t.value, f.value)) : /* @__PURE__ */ new Set()), A = M(() => `${Me(t.value)}:${Me(f.value)}${T.value ? ":" + Me(m.value) : ""}`), V = (K) => b.value.has(K), h = (K) => H.value.has(K), r = (K) => L.value.has(K), $ = (K) => {
|
|
1857
|
+
V(K) || (t.value = K, w(y.value, O(K)));
|
|
1858
|
+
}, F = (K) => {
|
|
1859
|
+
h(K) || (f.value = K, w(S.value, j(K)));
|
|
1858
1860
|
}, B = (K) => {
|
|
1859
|
-
|
|
1860
|
-
},
|
|
1861
|
-
r(K) || (m.value = K, x($.value, p(K)));
|
|
1862
|
-
}, O = (K) => C.value.indexOf(K), j = (K) => z.value.indexOf(K), p = (K) => E.value.indexOf(K), x = (K, re) => {
|
|
1861
|
+
r(K) || (m.value = K, w(D.value, p(K)));
|
|
1862
|
+
}, O = (K) => C.value.indexOf(K), j = (K) => z.value.indexOf(K), p = (K) => P.value.indexOf(K), w = (K, re) => {
|
|
1863
1863
|
if (!K) return;
|
|
1864
|
-
const q = 32,
|
|
1865
|
-
K.scrollTop = Math.max(0,
|
|
1866
|
-
},
|
|
1864
|
+
const q = 32, ye = re * q + 84 - 200 / 2 + q / 2;
|
|
1865
|
+
K.scrollTop = Math.max(0, ye);
|
|
1866
|
+
}, x = () => {
|
|
1867
1867
|
if (!y.value) return;
|
|
1868
1868
|
const K = y.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = C.value[Math.max(0, Math.min(re, C.value.length - 1))];
|
|
1869
1869
|
q !== void 0 && !V(q) && (t.value = q);
|
|
@@ -1872,13 +1872,13 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1872
1872
|
const K = S.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = z.value[Math.max(0, Math.min(re, z.value.length - 1))];
|
|
1873
1873
|
q !== void 0 && !h(q) && (f.value = q);
|
|
1874
1874
|
}, v = () => {
|
|
1875
|
-
if (
|
|
1876
|
-
const K =
|
|
1875
|
+
if (!D.value) return;
|
|
1876
|
+
const K = D.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = P.value[Math.max(0, Math.min(re, P.value.length - 1))];
|
|
1877
1877
|
q !== void 0 && !r(q) && (m.value = q);
|
|
1878
1878
|
}, g = () => {
|
|
1879
1879
|
const K = l.modelValue ? new Date(l.modelValue) : /* @__PURE__ */ new Date();
|
|
1880
1880
|
K.setHours(t.value, f.value, m.value, 0), e("confirm", K);
|
|
1881
|
-
},
|
|
1881
|
+
}, N = () => {
|
|
1882
1882
|
e("cancel");
|
|
1883
1883
|
}, ne = () => {
|
|
1884
1884
|
if (l.modelValue)
|
|
@@ -1887,8 +1887,8 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1887
1887
|
const K = /* @__PURE__ */ new Date();
|
|
1888
1888
|
t.value = K.getHours(), f.value = K.getMinutes(), m.value = K.getSeconds();
|
|
1889
1889
|
}
|
|
1890
|
-
|
|
1891
|
-
|
|
1890
|
+
De(() => {
|
|
1891
|
+
w(y.value, O(t.value)), w(S.value, j(f.value)), T.value && w(D.value, p(m.value));
|
|
1892
1892
|
});
|
|
1893
1893
|
};
|
|
1894
1894
|
return ie(
|
|
@@ -1897,7 +1897,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1897
1897
|
ne();
|
|
1898
1898
|
},
|
|
1899
1899
|
{ immediate: !0 }
|
|
1900
|
-
),
|
|
1900
|
+
), ge(() => {
|
|
1901
1901
|
ne();
|
|
1902
1902
|
}), (K, re) => (i(), c("div", {
|
|
1903
1903
|
class: u(n(a).b())
|
|
@@ -1912,7 +1912,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1912
1912
|
ref_key: "hourListRef",
|
|
1913
1913
|
ref: y,
|
|
1914
1914
|
class: u(n(a).e("list")),
|
|
1915
|
-
onScroll:
|
|
1915
|
+
onScroll: x
|
|
1916
1916
|
}, [
|
|
1917
1917
|
d("div", {
|
|
1918
1918
|
class: u(n(a).e("padding"))
|
|
@@ -1920,8 +1920,8 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1920
1920
|
(i(!0), c(J, null, Q(C.value, (q) => (i(), c("div", {
|
|
1921
1921
|
key: q,
|
|
1922
1922
|
class: u([n(a).e("item"), n(a).is("selected", t.value === q), n(a).is("disabled", V(q))]),
|
|
1923
|
-
onClick: (me) =>
|
|
1924
|
-
}, U(n(
|
|
1923
|
+
onClick: (me) => $(q)
|
|
1924
|
+
}, U(n(Me)(q)), 11, Tl))), 128)),
|
|
1925
1925
|
d("div", {
|
|
1926
1926
|
class: u(n(a).e("padding"))
|
|
1927
1927
|
}, null, 2)
|
|
@@ -1938,8 +1938,8 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1938
1938
|
(i(!0), c(J, null, Q(z.value, (q) => (i(), c("div", {
|
|
1939
1939
|
key: q,
|
|
1940
1940
|
class: u([n(a).e("item"), n(a).is("selected", f.value === q), n(a).is("disabled", h(q))]),
|
|
1941
|
-
onClick: (me) =>
|
|
1942
|
-
}, U(n(
|
|
1941
|
+
onClick: (me) => F(q)
|
|
1942
|
+
}, U(n(Me)(q)), 11, Hl))), 128)),
|
|
1943
1943
|
d("div", {
|
|
1944
1944
|
class: u(n(a).e("padding"))
|
|
1945
1945
|
}, null, 2)
|
|
@@ -1947,35 +1947,35 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1947
1947
|
T.value ? (i(), c("div", {
|
|
1948
1948
|
key: 0,
|
|
1949
1949
|
ref_key: "secondListRef",
|
|
1950
|
-
ref:
|
|
1950
|
+
ref: D,
|
|
1951
1951
|
class: u(n(a).e("list")),
|
|
1952
1952
|
onScroll: v
|
|
1953
1953
|
}, [
|
|
1954
1954
|
d("div", {
|
|
1955
1955
|
class: u(n(a).e("padding"))
|
|
1956
1956
|
}, null, 2),
|
|
1957
|
-
(i(!0), c(J, null, Q(
|
|
1957
|
+
(i(!0), c(J, null, Q(P.value, (q) => (i(), c("div", {
|
|
1958
1958
|
key: q,
|
|
1959
1959
|
class: u([n(a).e("item"), n(a).is("selected", m.value === q), n(a).is("disabled", r(q))]),
|
|
1960
|
-
onClick: (me) =>
|
|
1961
|
-
}, U(n(
|
|
1960
|
+
onClick: (me) => B(q)
|
|
1961
|
+
}, U(n(Me)(q)), 11, Ll))), 128)),
|
|
1962
1962
|
d("div", {
|
|
1963
1963
|
class: u(n(a).e("padding"))
|
|
1964
1964
|
}, null, 2)
|
|
1965
|
-
], 34)) :
|
|
1965
|
+
], 34)) : X("", !0)
|
|
1966
1966
|
], 2),
|
|
1967
1967
|
d("div", {
|
|
1968
1968
|
class: u(n(a).e("footer"))
|
|
1969
1969
|
}, [
|
|
1970
1970
|
d("span", {
|
|
1971
1971
|
class: u(n(a).e("current-time"))
|
|
1972
|
-
}, U(
|
|
1972
|
+
}, U(A.value), 3),
|
|
1973
1973
|
d("div", {
|
|
1974
1974
|
class: u(n(a).e("actions"))
|
|
1975
1975
|
}, [
|
|
1976
1976
|
d("button", {
|
|
1977
1977
|
class: u(n(a).e("btn-cancel")),
|
|
1978
|
-
onClick:
|
|
1978
|
+
onClick: N
|
|
1979
1979
|
}, "取消", 2),
|
|
1980
1980
|
d("button", {
|
|
1981
1981
|
class: u(n(a).e("btn-confirm")),
|
|
@@ -2008,47 +2008,47 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2008
2008
|
secondStep: { default: 1 }
|
|
2009
2009
|
},
|
|
2010
2010
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
2011
|
-
setup(s, { expose:
|
|
2012
|
-
const e = s, a = l, t = ae("time-picker"), f = () =>
|
|
2011
|
+
setup(s, { expose: k, emit: l }) {
|
|
2012
|
+
const e = s, a = l, t = ae("time-picker"), f = () => Oe().next(), m = R(!1), y = R(2e3), S = R(), D = R(), T = R(), C = R({
|
|
2013
2013
|
top: "0px",
|
|
2014
2014
|
left: "0px"
|
|
2015
2015
|
}), z = R({
|
|
2016
2016
|
startTime: null,
|
|
2017
2017
|
endTime: null
|
|
2018
|
-
}),
|
|
2018
|
+
}), P = R("start"), b = M(() => {
|
|
2019
2019
|
if (!e.modelValue) return null;
|
|
2020
2020
|
if (e.type === "timerange") {
|
|
2021
2021
|
const [v, g] = e.modelValue;
|
|
2022
2022
|
return [Re(v), Re(g)];
|
|
2023
2023
|
}
|
|
2024
2024
|
return Re(e.modelValue);
|
|
2025
|
-
}), H =
|
|
2025
|
+
}), H = M(() => !b.value || Array.isArray(b.value) ? "" : ke(b.value, e.format)), L = M(() => {
|
|
2026
2026
|
if (!Array.isArray(b.value)) return "";
|
|
2027
2027
|
const [v] = b.value;
|
|
2028
|
-
return v ?
|
|
2029
|
-
}),
|
|
2028
|
+
return v ? ke(v, e.format) : "";
|
|
2029
|
+
}), A = M(() => {
|
|
2030
2030
|
if (!Array.isArray(b.value)) return "";
|
|
2031
2031
|
const [, v] = b.value;
|
|
2032
|
-
return v ?
|
|
2033
|
-
}), V =
|
|
2032
|
+
return v ? ke(v, e.format) : "";
|
|
2033
|
+
}), V = M(() => e.type === "timerange" ? P.value === "start" ? z.value.startTime : z.value.endTime || z.value.startTime : b.value), h = M(() => [
|
|
2034
2034
|
t.b(),
|
|
2035
2035
|
t.m(e.size),
|
|
2036
2036
|
t.is("disabled", e.disabled),
|
|
2037
2037
|
t.is("range", e.type === "timerange")
|
|
2038
|
-
]), r =
|
|
2038
|
+
]), r = M(() => [
|
|
2039
2039
|
t.e("input"),
|
|
2040
2040
|
t.is("focus", m.value)
|
|
2041
|
-
]),
|
|
2042
|
-
e.disabled || e.readonly || (m.value ? O() :
|
|
2043
|
-
},
|
|
2044
|
-
e.disabled || e.readonly || (
|
|
2045
|
-
},
|
|
2046
|
-
m.value = !0, y.value = f(),
|
|
2047
|
-
if (S.value &&
|
|
2048
|
-
const v = S.value.getBoundingClientRect(), g =
|
|
2049
|
-
let
|
|
2050
|
-
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8),
|
|
2051
|
-
top: `${
|
|
2041
|
+
]), $ = () => {
|
|
2042
|
+
e.disabled || e.readonly || (m.value ? O() : B());
|
|
2043
|
+
}, F = (v) => {
|
|
2044
|
+
e.disabled || e.readonly || (P.value = v, m.value || B());
|
|
2045
|
+
}, B = () => {
|
|
2046
|
+
m.value = !0, y.value = f(), De(() => {
|
|
2047
|
+
if (S.value && D.value) {
|
|
2048
|
+
const v = S.value.getBoundingClientRect(), g = D.value.getBoundingClientRect();
|
|
2049
|
+
let N = v.bottom + 8, ne = v.left;
|
|
2050
|
+
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8), N + g.height > window.innerHeight && (N = v.top - g.height - 8), C.value = {
|
|
2051
|
+
top: `${N}px`,
|
|
2052
2052
|
left: `${ne}px`
|
|
2053
2053
|
};
|
|
2054
2054
|
}
|
|
@@ -2057,37 +2057,37 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2057
2057
|
m.value = !1, a("blur", {});
|
|
2058
2058
|
}, j = (v) => {
|
|
2059
2059
|
if (e.type === "timerange")
|
|
2060
|
-
if (
|
|
2061
|
-
z.value.startTime = v,
|
|
2060
|
+
if (P.value === "start")
|
|
2061
|
+
z.value.startTime = v, P.value = "end", z.value.endTime && z.value.endTime < v && (z.value.endTime = null);
|
|
2062
2062
|
else {
|
|
2063
2063
|
z.value.startTime && v < z.value.startTime ? (z.value.endTime = z.value.startTime, z.value.startTime = v) : z.value.endTime = v;
|
|
2064
|
-
const g = e.valueFormat ?
|
|
2065
|
-
a("update:modelValue", [g,
|
|
2064
|
+
const g = e.valueFormat ? ke(z.value.startTime, e.valueFormat) : z.value.startTime, N = e.valueFormat ? ke(z.value.endTime, e.valueFormat) : z.value.endTime;
|
|
2065
|
+
a("update:modelValue", [g, N]), a("change", [g, N]), O();
|
|
2066
2066
|
}
|
|
2067
2067
|
else {
|
|
2068
|
-
const g = e.valueFormat ?
|
|
2068
|
+
const g = e.valueFormat ? ke(v, e.valueFormat) : v;
|
|
2069
2069
|
a("update:modelValue", g), a("change", g), O();
|
|
2070
2070
|
}
|
|
2071
2071
|
}, p = () => {
|
|
2072
2072
|
O();
|
|
2073
|
-
},
|
|
2073
|
+
}, w = () => {
|
|
2074
2074
|
a("update:modelValue", null), a("change", null), a("clear"), z.value = {
|
|
2075
2075
|
startTime: null,
|
|
2076
2076
|
endTime: null
|
|
2077
2077
|
};
|
|
2078
|
-
},
|
|
2078
|
+
}, x = (v) => {
|
|
2079
2079
|
if (!S.value) return;
|
|
2080
2080
|
const g = v.target;
|
|
2081
|
-
S.value.contains(g) ||
|
|
2081
|
+
S.value.contains(g) || D.value && D.value.contains(g) || O();
|
|
2082
2082
|
};
|
|
2083
2083
|
ie(
|
|
2084
2084
|
() => e.modelValue,
|
|
2085
2085
|
(v) => {
|
|
2086
2086
|
if (v && e.type === "timerange") {
|
|
2087
|
-
const [g,
|
|
2087
|
+
const [g, N] = b.value;
|
|
2088
2088
|
z.value = {
|
|
2089
2089
|
startTime: g,
|
|
2090
|
-
endTime:
|
|
2090
|
+
endTime: N
|
|
2091
2091
|
};
|
|
2092
2092
|
}
|
|
2093
2093
|
},
|
|
@@ -2096,16 +2096,16 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2096
2096
|
v && e.type === "timerange" && (z.value = {
|
|
2097
2097
|
startTime: Array.isArray(b.value) ? b.value[0] : null,
|
|
2098
2098
|
endTime: Array.isArray(b.value) ? b.value[1] : null
|
|
2099
|
-
},
|
|
2099
|
+
}, P.value = "start");
|
|
2100
2100
|
});
|
|
2101
2101
|
const o = (v) => {
|
|
2102
2102
|
v.key === "Escape" && O();
|
|
2103
2103
|
};
|
|
2104
|
-
return
|
|
2105
|
-
document.addEventListener("click",
|
|
2106
|
-
}),
|
|
2107
|
-
document.removeEventListener("click",
|
|
2108
|
-
}),
|
|
2104
|
+
return ge(() => {
|
|
2105
|
+
document.addEventListener("click", x), document.addEventListener("keydown", o);
|
|
2106
|
+
}), $e(() => {
|
|
2107
|
+
document.removeEventListener("click", x), document.removeEventListener("keydown", o);
|
|
2108
|
+
}), k({
|
|
2109
2109
|
focus: () => {
|
|
2110
2110
|
var v;
|
|
2111
2111
|
return (v = T.value) == null ? void 0 : v.focus();
|
|
@@ -2122,7 +2122,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2122
2122
|
s.type !== "timerange" ? (i(), c("div", {
|
|
2123
2123
|
key: 0,
|
|
2124
2124
|
class: u(r.value),
|
|
2125
|
-
onClick:
|
|
2125
|
+
onClick: $
|
|
2126
2126
|
}, [
|
|
2127
2127
|
d("input", {
|
|
2128
2128
|
ref_key: "inputRef",
|
|
@@ -2140,7 +2140,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2140
2140
|
s.clearable && H.value && !s.disabled ? (i(), c("span", {
|
|
2141
2141
|
key: 0,
|
|
2142
2142
|
class: u(n(t).e("clear")),
|
|
2143
|
-
onClick: oe(
|
|
2143
|
+
onClick: oe(w, ["stop"])
|
|
2144
2144
|
}, [
|
|
2145
2145
|
Z(n(ee), {
|
|
2146
2146
|
name: "close",
|
|
@@ -2159,7 +2159,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2159
2159
|
], 2)) : (i(), c("div", {
|
|
2160
2160
|
key: 1,
|
|
2161
2161
|
class: u(r.value),
|
|
2162
|
-
onClick:
|
|
2162
|
+
onClick: $
|
|
2163
2163
|
}, [
|
|
2164
2164
|
d("input", {
|
|
2165
2165
|
type: "text",
|
|
@@ -2167,8 +2167,8 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2167
2167
|
disabled: s.disabled,
|
|
2168
2168
|
readonly: !0,
|
|
2169
2169
|
value: L.value,
|
|
2170
|
-
class: u([n(t).e("input-inner"), n(t).is("active",
|
|
2171
|
-
onClick: g[0] || (g[0] = oe((
|
|
2170
|
+
class: u([n(t).e("input-inner"), n(t).is("active", P.value === "start")]),
|
|
2171
|
+
onClick: g[0] || (g[0] = oe((N) => F("start"), ["stop"]))
|
|
2172
2172
|
}, null, 10, Al),
|
|
2173
2173
|
d("span", {
|
|
2174
2174
|
class: u(n(t).e("separator"))
|
|
@@ -2178,17 +2178,17 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2178
2178
|
placeholder: s.endPlaceholder,
|
|
2179
2179
|
disabled: s.disabled,
|
|
2180
2180
|
readonly: !0,
|
|
2181
|
-
value:
|
|
2182
|
-
class: u([n(t).e("input-inner"), n(t).is("active",
|
|
2183
|
-
onClick: g[1] || (g[1] = oe((
|
|
2181
|
+
value: A.value,
|
|
2182
|
+
class: u([n(t).e("input-inner"), n(t).is("active", P.value === "end")]),
|
|
2183
|
+
onClick: g[1] || (g[1] = oe((N) => F("end"), ["stop"]))
|
|
2184
2184
|
}, null, 10, Fl),
|
|
2185
2185
|
d("span", {
|
|
2186
2186
|
class: u(n(t).e("suffix"))
|
|
2187
2187
|
}, [
|
|
2188
|
-
s.clearable && (L.value ||
|
|
2188
|
+
s.clearable && (L.value || A.value) && !s.disabled ? (i(), c("span", {
|
|
2189
2189
|
key: 0,
|
|
2190
2190
|
class: u(n(t).e("clear")),
|
|
2191
|
-
onClick: oe(
|
|
2191
|
+
onClick: oe(w, ["stop"])
|
|
2192
2192
|
}, [
|
|
2193
2193
|
Z(n(ee), {
|
|
2194
2194
|
name: "close",
|
|
@@ -2205,19 +2205,19 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2205
2205
|
], 2))
|
|
2206
2206
|
], 2)
|
|
2207
2207
|
], 2)),
|
|
2208
|
-
(i(),
|
|
2208
|
+
(i(), he(Fe, { to: "body" }, [
|
|
2209
2209
|
Z(Ie, { name: "fade" }, {
|
|
2210
2210
|
default: Pe(() => [
|
|
2211
2211
|
ue(d("div", {
|
|
2212
2212
|
ref_key: "popperRef",
|
|
2213
|
-
ref:
|
|
2213
|
+
ref: D,
|
|
2214
2214
|
class: u(n(t).e("popper")),
|
|
2215
2215
|
style: te({ zIndex: y.value, ...C.value })
|
|
2216
2216
|
}, [
|
|
2217
2217
|
s.type === "timerange" ? (i(), c("div", {
|
|
2218
2218
|
key: 0,
|
|
2219
2219
|
class: u(n(t).e("popper-header"))
|
|
2220
|
-
}, U(
|
|
2220
|
+
}, U(P.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : X("", !0),
|
|
2221
2221
|
Z(Rl, {
|
|
2222
2222
|
"model-value": V.value,
|
|
2223
2223
|
format: s.format,
|
|
@@ -2231,7 +2231,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2231
2231
|
onCancel: p
|
|
2232
2232
|
}, null, 8, ["model-value", "format", "disabled-hours", "disabled-minutes", "disabled-seconds", "hour-step", "minute-step", "second-step"])
|
|
2233
2233
|
], 6), [
|
|
2234
|
-
[
|
|
2234
|
+
[be, m.value]
|
|
2235
2235
|
])
|
|
2236
2236
|
]),
|
|
2237
2237
|
_: 1
|
|
@@ -2240,25 +2240,25 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2240
2240
|
], 2));
|
|
2241
2241
|
}
|
|
2242
2242
|
});
|
|
2243
|
-
function Il(s,
|
|
2244
|
-
return l ? l(
|
|
2243
|
+
function Il(s, k, l) {
|
|
2244
|
+
return l ? l(k, s) : s.toLowerCase().includes(k.toLowerCase());
|
|
2245
2245
|
}
|
|
2246
|
-
function Xe(s,
|
|
2246
|
+
function Xe(s, k, l = "value", e = "children") {
|
|
2247
2247
|
for (const a of s) {
|
|
2248
|
-
if (a[l] ===
|
|
2248
|
+
if (a[l] === k)
|
|
2249
2249
|
return a;
|
|
2250
2250
|
if (a[e] && a[e].length > 0) {
|
|
2251
|
-
const t = Xe(a[e],
|
|
2251
|
+
const t = Xe(a[e], k, l, e);
|
|
2252
2252
|
if (t) return t;
|
|
2253
2253
|
}
|
|
2254
2254
|
}
|
|
2255
2255
|
return null;
|
|
2256
2256
|
}
|
|
2257
|
-
function Be(s,
|
|
2257
|
+
function Be(s, k, l = "value", e = "children") {
|
|
2258
2258
|
const a = [];
|
|
2259
2259
|
function t(f) {
|
|
2260
2260
|
for (const m of f) {
|
|
2261
|
-
if (m[l] ===
|
|
2261
|
+
if (m[l] === k)
|
|
2262
2262
|
return a.push(m), !0;
|
|
2263
2263
|
if (m[e] && m[e].length > 0) {
|
|
2264
2264
|
if (a.push(m), t(m[e]))
|
|
@@ -2270,15 +2270,15 @@ function Be(s, M, l = "value", e = "children") {
|
|
|
2270
2270
|
}
|
|
2271
2271
|
return t(s), a;
|
|
2272
2272
|
}
|
|
2273
|
-
function Pl(s,
|
|
2273
|
+
function Pl(s, k = "children") {
|
|
2274
2274
|
const l = [];
|
|
2275
2275
|
function e(a, t = 0, f = null) {
|
|
2276
2276
|
for (const m of a)
|
|
2277
|
-
l.push({ ...m, level: t, parent: f }), m[
|
|
2277
|
+
l.push({ ...m, level: t, parent: f }), m[k] && m[k].length > 0 && e(m[k], t + 1, m);
|
|
2278
2278
|
}
|
|
2279
2279
|
return e(s), l;
|
|
2280
2280
|
}
|
|
2281
|
-
const
|
|
2281
|
+
const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Yl = ["onClick"], Ul = ["onClick"], ot = /* @__PURE__ */ le({
|
|
2282
2282
|
name: "XSelect",
|
|
2283
2283
|
__name: "index",
|
|
2284
2284
|
props: {
|
|
@@ -2304,131 +2304,131 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2304
2304
|
mode: { default: "single" }
|
|
2305
2305
|
},
|
|
2306
2306
|
emits: ["update:modelValue", "update:value", "change", "clear", "focus", "blur", "visible-change", "remove-tag"],
|
|
2307
|
-
setup(s, { emit:
|
|
2308
|
-
const l = s, e =
|
|
2309
|
-
b.value.find((G) => G.value ===
|
|
2310
|
-
}, L =
|
|
2311
|
-
l.modelValue !== void 0 && e("update:modelValue",
|
|
2312
|
-
},
|
|
2313
|
-
const
|
|
2314
|
-
return L.value ? Array.isArray(
|
|
2315
|
-
}),
|
|
2316
|
-
const
|
|
2317
|
-
return
|
|
2318
|
-
}),
|
|
2319
|
-
const G =
|
|
2307
|
+
setup(s, { emit: k }) {
|
|
2308
|
+
const l = s, e = k, a = ae("select"), t = Ae(), f = () => Oe().next(), m = R(), y = R(), S = R(), D = R(!1), T = R(2e3), C = R(""), z = R(-1), P = R({ top: "0px", left: "0px" }), b = R([]), H = (E) => {
|
|
2309
|
+
b.value.find((G) => G.value === E.value) || b.value.push(E);
|
|
2310
|
+
}, L = M(() => l.type === "multiple" || l.mode === "multiple"), A = M(() => l.type === "cascader"), V = R([]), h = M(() => l.options && l.options.length > 0 ? l.options : b.value), r = (E) => {
|
|
2311
|
+
l.modelValue !== void 0 && e("update:modelValue", E), l.value !== void 0 && e("update:value", E), l.modelValue === void 0 && l.value === void 0 && e("update:modelValue", E), e("change", E);
|
|
2312
|
+
}, $ = M(() => {
|
|
2313
|
+
const E = l.modelValue !== void 0 ? l.modelValue : l.value !== void 0 ? l.value : "";
|
|
2314
|
+
return L.value ? Array.isArray(E) ? E : [] : A.value ? Array.isArray(E) ? E : E ? [E] : [] : E !== "" && E !== null && E !== void 0 ? [E] : [];
|
|
2315
|
+
}), F = M(() => {
|
|
2316
|
+
const E = h.value;
|
|
2317
|
+
return A.value ? Pl(E, l.childrenKey) : E.map((G) => ({ ...G, level: 0 }));
|
|
2318
|
+
}), B = M(() => !l.filterable || !C.value ? F.value : F.value.filter((E) => {
|
|
2319
|
+
const G = E[l.labelKey] || "";
|
|
2320
2320
|
return Il(G, C.value, l.filterMethod);
|
|
2321
|
-
})),
|
|
2322
|
-
const
|
|
2323
|
-
for (const G of
|
|
2321
|
+
})), O = M(() => {
|
|
2322
|
+
const E = [];
|
|
2323
|
+
for (const G of $.value) {
|
|
2324
2324
|
const _ = Xe(h.value, G, l.valueKey, l.childrenKey);
|
|
2325
|
-
_ &&
|
|
2325
|
+
_ && E.push(_);
|
|
2326
2326
|
}
|
|
2327
|
-
return
|
|
2328
|
-
}),
|
|
2327
|
+
return E;
|
|
2328
|
+
}), j = M(() => {
|
|
2329
2329
|
if (L.value)
|
|
2330
2330
|
return "";
|
|
2331
|
-
if (
|
|
2332
|
-
return Be(h.value,
|
|
2333
|
-
const
|
|
2334
|
-
return
|
|
2335
|
-
}),
|
|
2331
|
+
if (A.value)
|
|
2332
|
+
return Be(h.value, $.value[$.value.length - 1], l.valueKey, l.childrenKey).map((_) => _[l.labelKey]).join(l.separator);
|
|
2333
|
+
const E = O.value[0];
|
|
2334
|
+
return E ? E[l.labelKey] : "";
|
|
2335
|
+
}), p = M(() => L.value ? O.value : []), w = M(() => l.collapseTags ? p.value.slice(0, l.maxCollapseTags) : p.value), x = M(() => l.collapseTags ? Math.max(0, p.value.length - l.maxCollapseTags) : 0), o = M(() => [
|
|
2336
2336
|
a.b(),
|
|
2337
2337
|
a.m(l.size),
|
|
2338
2338
|
a.is("disabled", l.disabled),
|
|
2339
2339
|
a.is("multiple", L.value),
|
|
2340
|
-
a.is("cascader",
|
|
2340
|
+
a.is("cascader", A.value),
|
|
2341
2341
|
a.is("filterable", l.filterable),
|
|
2342
|
-
a.is("focus",
|
|
2343
|
-
]),
|
|
2344
|
-
if (!m.value || !S.value ||
|
|
2345
|
-
const
|
|
2346
|
-
let _ =
|
|
2347
|
-
|
|
2342
|
+
a.is("focus", D.value)
|
|
2343
|
+
]), v = () => {
|
|
2344
|
+
if (!m.value || !S.value || !D.value) return;
|
|
2345
|
+
const E = m.value.getBoundingClientRect(), G = S.value.getBoundingClientRect();
|
|
2346
|
+
let _ = E.bottom + 4, de = E.left;
|
|
2347
|
+
de + G.width > window.innerWidth && (de = window.innerWidth - G.width - 8), _ + G.height > window.innerHeight && (_ = E.top - G.height - 4), P.value = {
|
|
2348
2348
|
top: `${_}px`,
|
|
2349
|
-
left: `${
|
|
2349
|
+
left: `${de}px`
|
|
2350
2350
|
};
|
|
2351
|
-
},
|
|
2352
|
-
l.disabled || (
|
|
2353
|
-
|
|
2351
|
+
}, g = () => {
|
|
2352
|
+
l.disabled || (D.value = !0, T.value = f(), C.value = "", De(() => {
|
|
2353
|
+
v();
|
|
2354
2354
|
}), e("visible-change", !0), e("focus", {}));
|
|
2355
|
-
},
|
|
2356
|
-
|
|
2357
|
-
},
|
|
2358
|
-
if (!
|
|
2355
|
+
}, N = () => {
|
|
2356
|
+
D.value = !1, C.value = "", V.value = [], e("visible-change", !1), e("blur", {});
|
|
2357
|
+
}, ne = (E) => {
|
|
2358
|
+
if (!E.disabled)
|
|
2359
2359
|
if (L.value) {
|
|
2360
|
-
const G = [
|
|
2361
|
-
if (
|
|
2362
|
-
G.splice(
|
|
2360
|
+
const G = [...$.value], _ = E[l.valueKey], de = G.indexOf(_);
|
|
2361
|
+
if (de > -1)
|
|
2362
|
+
G.splice(de, 1), e("remove-tag", _);
|
|
2363
2363
|
else {
|
|
2364
2364
|
if (l.multipleLimit > 0 && G.length >= l.multipleLimit)
|
|
2365
2365
|
return;
|
|
2366
2366
|
G.push(_);
|
|
2367
2367
|
}
|
|
2368
|
-
|
|
2369
|
-
} else if (
|
|
2370
|
-
if (
|
|
2371
|
-
const G = Be(h.value,
|
|
2368
|
+
r(G);
|
|
2369
|
+
} else if (A.value)
|
|
2370
|
+
if (E.children && E.children.length > 0) {
|
|
2371
|
+
const G = Be(h.value, E[l.valueKey], l.valueKey, l.childrenKey);
|
|
2372
2372
|
V.value = G;
|
|
2373
2373
|
} else {
|
|
2374
|
-
const _ = Be(h.value,
|
|
2375
|
-
|
|
2374
|
+
const _ = Be(h.value, E[l.valueKey], l.valueKey, l.childrenKey).map((de) => de[l.valueKey]);
|
|
2375
|
+
r(_), N();
|
|
2376
2376
|
}
|
|
2377
2377
|
else
|
|
2378
|
-
|
|
2379
|
-
},
|
|
2380
|
-
const G =
|
|
2381
|
-
|
|
2382
|
-
},
|
|
2383
|
-
const
|
|
2384
|
-
|
|
2385
|
-
},
|
|
2386
|
-
C.value =
|
|
2387
|
-
},
|
|
2378
|
+
r(E[l.valueKey]), N();
|
|
2379
|
+
}, K = (E) => {
|
|
2380
|
+
const G = $.value.filter((_) => _ !== E[l.valueKey]);
|
|
2381
|
+
r(G), e("remove-tag", E[l.valueKey]);
|
|
2382
|
+
}, re = () => {
|
|
2383
|
+
const E = L.value ? [] : "";
|
|
2384
|
+
r(E), e("clear");
|
|
2385
|
+
}, q = (E) => {
|
|
2386
|
+
C.value = E.target.value;
|
|
2387
|
+
}, me = (E) => {
|
|
2388
2388
|
if (!m.value) return;
|
|
2389
|
-
const G =
|
|
2390
|
-
m.value.contains(G) || S.value && S.value.contains(G) ||
|
|
2391
|
-
},
|
|
2392
|
-
if (
|
|
2393
|
-
|
|
2394
|
-
else if (
|
|
2395
|
-
const G =
|
|
2396
|
-
G &&
|
|
2397
|
-
} else
|
|
2398
|
-
},
|
|
2389
|
+
const G = E.target;
|
|
2390
|
+
m.value.contains(G) || S.value && S.value.contains(G) || N();
|
|
2391
|
+
}, ye = (E) => {
|
|
2392
|
+
if (E.key === "Escape")
|
|
2393
|
+
N();
|
|
2394
|
+
else if (E.key === "Enter" && D.value) {
|
|
2395
|
+
const G = B.value[z.value];
|
|
2396
|
+
G && ne(G);
|
|
2397
|
+
} else E.key === "ArrowDown" && D.value ? (E.preventDefault(), z.value = Math.min(z.value + 1, B.value.length - 1)) : E.key === "ArrowUp" && D.value && (E.preventDefault(), z.value = Math.max(z.value - 1, 0));
|
|
2398
|
+
}, xe = (E) => $.value.includes(E[l.valueKey]), ze = (E, G) => [
|
|
2399
2399
|
a.e("option"),
|
|
2400
|
-
a.is("selected",
|
|
2401
|
-
a.is("disabled",
|
|
2400
|
+
a.is("selected", xe(E)),
|
|
2401
|
+
a.is("disabled", E.disabled === !0),
|
|
2402
2402
|
a.is("hover", z.value === G),
|
|
2403
|
-
a.is("group", !!(
|
|
2404
|
-
],
|
|
2405
|
-
if (!
|
|
2406
|
-
const
|
|
2403
|
+
a.is("group", !!(E.children && E.children.length > 0))
|
|
2404
|
+
], Te = M(() => {
|
|
2405
|
+
if (!A.value) return [];
|
|
2406
|
+
const E = [h.value];
|
|
2407
2407
|
for (const G of V.value)
|
|
2408
|
-
G.children && G.children.length > 0 &&
|
|
2409
|
-
return
|
|
2408
|
+
G.children && G.children.length > 0 && E.push(G.children);
|
|
2409
|
+
return E;
|
|
2410
2410
|
});
|
|
2411
|
-
return
|
|
2412
|
-
document.addEventListener("click",
|
|
2413
|
-
}),
|
|
2414
|
-
document.removeEventListener("click",
|
|
2415
|
-
}), ie(
|
|
2416
|
-
|
|
2417
|
-
}),
|
|
2418
|
-
selectedValues:
|
|
2419
|
-
handleSelect:
|
|
2420
|
-
isSelected:
|
|
2411
|
+
return ge(() => {
|
|
2412
|
+
document.addEventListener("click", me), document.addEventListener("keydown", ye);
|
|
2413
|
+
}), $e(() => {
|
|
2414
|
+
document.removeEventListener("click", me), document.removeEventListener("keydown", ye), document.removeEventListener("scroll", v, !0);
|
|
2415
|
+
}), ie(D, (E) => {
|
|
2416
|
+
E ? document.addEventListener("scroll", v, !0) : document.removeEventListener("scroll", v, !0);
|
|
2417
|
+
}), Se("select", {
|
|
2418
|
+
selectedValues: $,
|
|
2419
|
+
handleSelect: ne,
|
|
2420
|
+
isSelected: xe,
|
|
2421
2421
|
registerOption: H
|
|
2422
|
-
}), (
|
|
2422
|
+
}), (E, G) => (i(), c("div", {
|
|
2423
2423
|
ref_key: "selectRef",
|
|
2424
2424
|
ref: m,
|
|
2425
|
-
class: u(
|
|
2425
|
+
class: u(o.value)
|
|
2426
2426
|
}, [
|
|
2427
2427
|
d("div", {
|
|
2428
2428
|
class: u(n(a).e("wrapper")),
|
|
2429
|
-
onClick: G[0] || (G[0] = (_) =>
|
|
2429
|
+
onClick: G[0] || (G[0] = (_) => D.value ? N() : g())
|
|
2430
2430
|
}, [
|
|
2431
|
-
L.value &&
|
|
2431
|
+
L.value && p.value.length > 0 ? (i(), c("div", {
|
|
2432
2432
|
key: 0,
|
|
2433
2433
|
class: u(n(a).e("tags"))
|
|
2434
2434
|
}, [
|
|
@@ -2441,34 +2441,34 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2441
2441
|
}, U(_[s.labelKey]), 3),
|
|
2442
2442
|
d("span", {
|
|
2443
2443
|
class: u(n(a).e("tag-close")),
|
|
2444
|
-
onClick: oe((
|
|
2445
|
-
}, "×", 10,
|
|
2444
|
+
onClick: oe((de) => K(_), ["stop"])
|
|
2445
|
+
}, "×", 10, Ol)
|
|
2446
2446
|
], 2))), 128)),
|
|
2447
|
-
|
|
2447
|
+
x.value > 0 ? (i(), c("span", {
|
|
2448
2448
|
key: 0,
|
|
2449
2449
|
class: u(n(a).e("tag-count"))
|
|
2450
|
-
}, " +" + U(
|
|
2451
|
-
], 2)) :
|
|
2450
|
+
}, " +" + U(x.value), 3)) : X("", !0)
|
|
2451
|
+
], 2)) : X("", !0),
|
|
2452
2452
|
d("input", {
|
|
2453
2453
|
ref_key: "inputRef",
|
|
2454
2454
|
ref: y,
|
|
2455
2455
|
class: u(n(a).e("input")),
|
|
2456
|
-
placeholder: L.value &&
|
|
2456
|
+
placeholder: L.value && p.value.length > 0 ? "" : s.placeholder,
|
|
2457
2457
|
disabled: s.disabled,
|
|
2458
|
-
readonly: !s.filterable ||
|
|
2459
|
-
value: s.filterable &&
|
|
2460
|
-
onInput:
|
|
2461
|
-
}, null, 42,
|
|
2458
|
+
readonly: !s.filterable || !D.value,
|
|
2459
|
+
value: s.filterable && D.value ? C.value : j.value,
|
|
2460
|
+
onInput: q
|
|
2461
|
+
}, null, 42, El),
|
|
2462
2462
|
d("span", {
|
|
2463
2463
|
class: u(n(a).e("suffix"))
|
|
2464
2464
|
}, [
|
|
2465
|
-
s.clearable &&
|
|
2465
|
+
s.clearable && $.value.length > 0 && !s.disabled ? (i(), c("span", {
|
|
2466
2466
|
key: 0,
|
|
2467
2467
|
class: u(n(a).e("clear")),
|
|
2468
|
-
onClick: oe(
|
|
2468
|
+
onClick: oe(re, ["stop"])
|
|
2469
2469
|
}, "×", 2)) : (i(), c("span", {
|
|
2470
2470
|
key: 1,
|
|
2471
|
-
class: u([n(a).e("arrow"), n(a).is("reverse",
|
|
2471
|
+
class: u([n(a).e("arrow"), n(a).is("reverse", D.value)])
|
|
2472
2472
|
}, [
|
|
2473
2473
|
Z(n(ee), {
|
|
2474
2474
|
name: "chevron-down",
|
|
@@ -2477,39 +2477,39 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2477
2477
|
], 2))
|
|
2478
2478
|
], 2)
|
|
2479
2479
|
], 2),
|
|
2480
|
-
(i(),
|
|
2480
|
+
(i(), he(Fe, { to: "body" }, [
|
|
2481
2481
|
Z(Ie, { name: "fade" }, {
|
|
2482
2482
|
default: Pe(() => [
|
|
2483
2483
|
ue(d("div", {
|
|
2484
2484
|
ref_key: "popperRef",
|
|
2485
2485
|
ref: S,
|
|
2486
|
-
class: u([n(a).e("popper"), n(a).is("cascader",
|
|
2487
|
-
style: te({ zIndex: T.value, ...
|
|
2486
|
+
class: u([n(a).e("popper"), n(a).is("cascader", A.value)]),
|
|
2487
|
+
style: te({ zIndex: T.value, ...P.value })
|
|
2488
2488
|
}, [
|
|
2489
|
-
|
|
2489
|
+
A.value ? (i(), c("div", {
|
|
2490
2490
|
key: 0,
|
|
2491
2491
|
class: u(n(a).e("cascader-panels"))
|
|
2492
2492
|
}, [
|
|
2493
|
-
(i(!0), c(J, null, Q(
|
|
2494
|
-
key:
|
|
2493
|
+
(i(!0), c(J, null, Q(Te.value, (_, de) => (i(), c("div", {
|
|
2494
|
+
key: de,
|
|
2495
2495
|
class: u(n(a).e("cascader-panel"))
|
|
2496
2496
|
}, [
|
|
2497
|
-
(i(!0), c(J, null, Q(_, (
|
|
2498
|
-
key:
|
|
2499
|
-
class: u(ze(
|
|
2500
|
-
onClick: (
|
|
2497
|
+
(i(!0), c(J, null, Q(_, (I, Y) => (i(), c("div", {
|
|
2498
|
+
key: I[s.valueKey],
|
|
2499
|
+
class: u(ze(I, Y)),
|
|
2500
|
+
onClick: (W) => ne(I)
|
|
2501
2501
|
}, [
|
|
2502
2502
|
d("span", {
|
|
2503
2503
|
class: u(n(a).e("option-label"))
|
|
2504
|
-
}, U(
|
|
2505
|
-
|
|
2504
|
+
}, U(I[s.labelKey]), 3),
|
|
2505
|
+
I.children && I.children.length > 0 ? (i(), c("span", {
|
|
2506
2506
|
key: 0,
|
|
2507
2507
|
class: u(n(a).e("option-arrow"))
|
|
2508
|
-
}, "›", 2)) :
|
|
2508
|
+
}, "›", 2)) : X("", !0)
|
|
2509
2509
|
], 10, Yl))), 128))
|
|
2510
2510
|
], 2))), 128))
|
|
2511
2511
|
], 2)) : (i(), c(J, { key: 1 }, [
|
|
2512
|
-
|
|
2512
|
+
B.value.length === 0 && !n(t).default ? (i(), c("div", {
|
|
2513
2513
|
key: 0,
|
|
2514
2514
|
class: u(n(a).e("empty"))
|
|
2515
2515
|
}, U(C.value ? s.noMatchText : s.noDataText), 3)) : (i(), c(J, { key: 1 }, [
|
|
@@ -2517,29 +2517,29 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2517
2517
|
key: 0,
|
|
2518
2518
|
class: u(n(a).e("options"))
|
|
2519
2519
|
}, [
|
|
2520
|
-
se(
|
|
2520
|
+
se(E.$slots, "default")
|
|
2521
2521
|
], 2)) : (i(), c("div", {
|
|
2522
2522
|
key: 1,
|
|
2523
2523
|
class: u(n(a).e("options"))
|
|
2524
2524
|
}, [
|
|
2525
|
-
(i(!0), c(J, null, Q(
|
|
2525
|
+
(i(!0), c(J, null, Q(B.value, (_, de) => (i(), c("div", {
|
|
2526
2526
|
key: _[s.valueKey],
|
|
2527
|
-
class: u(ze(_,
|
|
2528
|
-
onClick: (
|
|
2527
|
+
class: u(ze(_, de)),
|
|
2528
|
+
onClick: (I) => ne(_)
|
|
2529
2529
|
}, [
|
|
2530
2530
|
d("span", {
|
|
2531
2531
|
class: u(n(a).e("option-label"))
|
|
2532
2532
|
}, U(_[s.labelKey]), 3),
|
|
2533
|
-
|
|
2533
|
+
xe(_) ? (i(), c("span", {
|
|
2534
2534
|
key: 0,
|
|
2535
2535
|
class: u(n(a).e("option-check"))
|
|
2536
|
-
}, "✓", 2)) :
|
|
2536
|
+
}, "✓", 2)) : X("", !0)
|
|
2537
2537
|
], 10, Ul))), 128))
|
|
2538
2538
|
], 2))
|
|
2539
2539
|
], 64))
|
|
2540
2540
|
], 64))
|
|
2541
2541
|
], 6), [
|
|
2542
|
-
[
|
|
2542
|
+
[be, D.value]
|
|
2543
2543
|
])
|
|
2544
2544
|
]),
|
|
2545
2545
|
_: 3
|
|
@@ -2556,11 +2556,19 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2556
2556
|
disabled: { type: Boolean, default: !1 }
|
|
2557
2557
|
},
|
|
2558
2558
|
setup(s) {
|
|
2559
|
-
const
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2559
|
+
const k = s, l = ae("select"), e = Ce("select");
|
|
2560
|
+
ge(() => {
|
|
2561
|
+
e && e.registerOption && e.registerOption({
|
|
2562
|
+
value: k.value,
|
|
2563
|
+
label: k.label,
|
|
2564
|
+
disabled: k.disabled
|
|
2565
|
+
});
|
|
2566
|
+
});
|
|
2567
|
+
const a = M(() => e ? e.isSelected({ value: k.value }) : !1), t = () => {
|
|
2568
|
+
k.disabled || e && e.handleSelect({
|
|
2569
|
+
value: k.value,
|
|
2570
|
+
label: k.label,
|
|
2571
|
+
disabled: k.disabled
|
|
2564
2572
|
});
|
|
2565
2573
|
};
|
|
2566
2574
|
return (f, m) => (i(), c("div", {
|
|
@@ -2577,7 +2585,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2577
2585
|
a.value ? (i(), c("span", {
|
|
2578
2586
|
key: 0,
|
|
2579
2587
|
class: u(n(l).e("option-check"))
|
|
2580
|
-
}, "✓", 2)) :
|
|
2588
|
+
}, "✓", 2)) : X("", !0)
|
|
2581
2589
|
], 2));
|
|
2582
2590
|
}
|
|
2583
2591
|
}), Nl = ["checked", "indeterminate"], Xl = ["placeholder"], Kl = ["onClick"], Wl = ["checked", "disabled", "onChange"], ql = ["disabled"], jl = ["disabled"], Gl = ["checked", "indeterminate"], Jl = ["placeholder"], Zl = ["onClick"], Ql = ["checked", "disabled", "onChange"], rt = /* @__PURE__ */ le({
|
|
@@ -2597,40 +2605,40 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2597
2605
|
rightDefaultChecked: { default: () => [] }
|
|
2598
2606
|
},
|
|
2599
2607
|
emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
|
|
2600
|
-
setup(s, { expose:
|
|
2601
|
-
const e = s, a = l, t = ae("transfer"), f =
|
|
2608
|
+
setup(s, { expose: k, emit: l }) {
|
|
2609
|
+
const e = s, a = l, t = ae("transfer"), f = M(() => {
|
|
2602
2610
|
var o;
|
|
2603
2611
|
return ((o = e.props) == null ? void 0 : o.key) || "key";
|
|
2604
|
-
}), m =
|
|
2612
|
+
}), m = M(() => {
|
|
2605
2613
|
var o;
|
|
2606
2614
|
return ((o = e.props) == null ? void 0 : o.label) || "label";
|
|
2607
|
-
}), y =
|
|
2615
|
+
}), y = M(() => {
|
|
2608
2616
|
var o;
|
|
2609
2617
|
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2610
|
-
}), S = R(""),
|
|
2618
|
+
}), S = R(""), D = R(""), T = R([]), C = R([]), z = (o) => o[f.value], P = (o) => o[m.value], b = (o) => o[y.value] || !1, H = M(() => e.data.filter((o) => {
|
|
2611
2619
|
const v = z(o);
|
|
2612
|
-
return e.modelValue.includes(v) ? !1 : e.filterable && S.value ? e.filterMethod ? e.filterMethod(S.value, o) :
|
|
2613
|
-
})), L =
|
|
2620
|
+
return e.modelValue.includes(v) ? !1 : e.filterable && S.value ? e.filterMethod ? e.filterMethod(S.value, o) : P(o).toLowerCase().includes(S.value.toLowerCase()) : !0;
|
|
2621
|
+
})), L = M(() => {
|
|
2614
2622
|
const o = e.modelValue;
|
|
2615
2623
|
let v = e.data.filter((g) => {
|
|
2616
|
-
const
|
|
2617
|
-
return o.includes(
|
|
2624
|
+
const N = z(g);
|
|
2625
|
+
return o.includes(N);
|
|
2618
2626
|
});
|
|
2619
|
-
return e.filterable &&
|
|
2620
|
-
}),
|
|
2627
|
+
return e.filterable && D.value && (v = v.filter((g) => e.filterMethod ? e.filterMethod(D.value, g) : P(g).toLowerCase().includes(D.value.toLowerCase()))), e.targetOrder === "push" ? v.sort((g, N) => o.indexOf(z(g)) - o.indexOf(z(N))) : e.targetOrder === "unshift" ? v.sort((g, N) => o.indexOf(z(N)) - o.indexOf(z(g))) : v;
|
|
2628
|
+
}), A = M(() => H.value.filter((o) => T.value.includes(z(o))).every((o) => b(o))), V = M(() => L.value.filter((o) => C.value.includes(z(o))).every((o) => b(o))), h = M(() => T.value.length === 0 || A.value), r = M(() => C.value.length === 0 || V.value), $ = () => {
|
|
2621
2629
|
const o = T.value.filter((g) => {
|
|
2622
|
-
const
|
|
2623
|
-
return
|
|
2630
|
+
const N = e.data.find((ne) => z(ne) === g);
|
|
2631
|
+
return N && !b(N);
|
|
2624
2632
|
});
|
|
2625
2633
|
let v;
|
|
2626
2634
|
e.targetOrder === "unshift" ? v = [...o, ...e.modelValue] : v = [...e.modelValue, ...o], a("update:modelValue", v), a("change", v, "right", o), T.value = [];
|
|
2627
|
-
},
|
|
2635
|
+
}, F = () => {
|
|
2628
2636
|
const o = C.value.filter((g) => {
|
|
2629
|
-
const
|
|
2630
|
-
return
|
|
2637
|
+
const N = e.data.find((ne) => z(ne) === g);
|
|
2638
|
+
return N && !b(N);
|
|
2631
2639
|
}), v = e.modelValue.filter((g) => !o.includes(g));
|
|
2632
2640
|
a("update:modelValue", v), a("change", v, "left", o), C.value = [];
|
|
2633
|
-
},
|
|
2641
|
+
}, B = (o) => {
|
|
2634
2642
|
const v = T.value.indexOf(o);
|
|
2635
2643
|
v > -1 ? T.value.splice(v, 1) : T.value.push(o), a("left-check-change", [...T.value]);
|
|
2636
2644
|
}, O = (o) => {
|
|
@@ -2640,13 +2648,13 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2640
2648
|
T.value.length === H.value.filter((o) => !b(o)).length ? T.value = [] : T.value = H.value.filter((o) => !b(o)).map((o) => z(o)), a("left-check-change", [...T.value]);
|
|
2641
2649
|
}, p = () => {
|
|
2642
2650
|
C.value.length === L.value.filter((o) => !b(o)).length ? C.value = [] : C.value = L.value.filter((o) => !b(o)).map((o) => z(o)), a("right-check-change", [...C.value]);
|
|
2643
|
-
},
|
|
2644
|
-
o === "left" ? S.value = "" :
|
|
2645
|
-
},
|
|
2646
|
-
return
|
|
2647
|
-
clearQuery:
|
|
2651
|
+
}, w = (o) => {
|
|
2652
|
+
o === "left" ? S.value = "" : D.value = "";
|
|
2653
|
+
}, x = M(() => [t.b()]);
|
|
2654
|
+
return k({
|
|
2655
|
+
clearQuery: w
|
|
2648
2656
|
}), (o, v) => (i(), c("div", {
|
|
2649
|
-
class: u(
|
|
2657
|
+
class: u(x.value)
|
|
2650
2658
|
}, [
|
|
2651
2659
|
d("div", {
|
|
2652
2660
|
class: u(n(t).e("panel"))
|
|
@@ -2678,14 +2686,14 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2678
2686
|
placeholder: s.filterPlaceholder,
|
|
2679
2687
|
class: u(n(t).e("filter-input"))
|
|
2680
2688
|
}, null, 10, Xl), [
|
|
2681
|
-
[
|
|
2689
|
+
[Ve, S.value]
|
|
2682
2690
|
]),
|
|
2683
2691
|
S.value ? (i(), c("span", {
|
|
2684
2692
|
key: 0,
|
|
2685
2693
|
class: u(n(t).e("filter-clear")),
|
|
2686
|
-
onClick: v[1] || (v[1] = (g) =>
|
|
2687
|
-
}, "×", 2)) :
|
|
2688
|
-
], 2)) :
|
|
2694
|
+
onClick: v[1] || (v[1] = (g) => w("left"))
|
|
2695
|
+
}, "×", 2)) : X("", !0)
|
|
2696
|
+
], 2)) : X("", !0),
|
|
2689
2697
|
d("div", {
|
|
2690
2698
|
class: u(n(t).e("body"))
|
|
2691
2699
|
}, [
|
|
@@ -2696,7 +2704,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2696
2704
|
n(t).is("disabled", b(g)),
|
|
2697
2705
|
n(t).is("checked", T.value.includes(z(g)))
|
|
2698
2706
|
]),
|
|
2699
|
-
onClick: (
|
|
2707
|
+
onClick: (N) => !b(g) && B(z(g))
|
|
2700
2708
|
}, [
|
|
2701
2709
|
d("label", {
|
|
2702
2710
|
class: u(n(t).e("checkbox"))
|
|
@@ -2707,9 +2715,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2707
2715
|
disabled: b(g),
|
|
2708
2716
|
onClick: v[2] || (v[2] = oe(() => {
|
|
2709
2717
|
}, ["stop"])),
|
|
2710
|
-
onChange: (
|
|
2718
|
+
onChange: (N) => B(z(g))
|
|
2711
2719
|
}, null, 40, Wl),
|
|
2712
|
-
d("span", null, U(
|
|
2720
|
+
d("span", null, U(P(g)), 1)
|
|
2713
2721
|
], 2)
|
|
2714
2722
|
], 10, Kl))), 128)),
|
|
2715
2723
|
H.value.length === 0 ? (i(), c("div", {
|
|
@@ -2717,9 +2725,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2717
2725
|
class: u(n(t).e("empty"))
|
|
2718
2726
|
}, [
|
|
2719
2727
|
se(o.$slots, "left-empty", {}, () => [
|
|
2720
|
-
v[6] || (v[6] =
|
|
2728
|
+
v[6] || (v[6] = ce("暂无数据", -1))
|
|
2721
2729
|
])
|
|
2722
|
-
], 2)) :
|
|
2730
|
+
], 2)) : X("", !0)
|
|
2723
2731
|
], 2)
|
|
2724
2732
|
], 2),
|
|
2725
2733
|
d("div", {
|
|
@@ -2728,12 +2736,12 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2728
2736
|
d("button", {
|
|
2729
2737
|
class: u([n(t).e("button"), n(t).is("disabled", h.value)]),
|
|
2730
2738
|
disabled: h.value,
|
|
2731
|
-
onClick:
|
|
2739
|
+
onClick: $
|
|
2732
2740
|
}, U(s.buttonTexts[0] || ">"), 11, ql),
|
|
2733
2741
|
d("button", {
|
|
2734
2742
|
class: u([n(t).e("button"), n(t).is("disabled", r.value)]),
|
|
2735
2743
|
disabled: r.value,
|
|
2736
|
-
onClick:
|
|
2744
|
+
onClick: F
|
|
2737
2745
|
}, U(s.buttonTexts[1] || "<"), 11, jl)
|
|
2738
2746
|
], 2),
|
|
2739
2747
|
d("div", {
|
|
@@ -2762,18 +2770,18 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2762
2770
|
class: u(n(t).e("filter"))
|
|
2763
2771
|
}, [
|
|
2764
2772
|
ue(d("input", {
|
|
2765
|
-
"onUpdate:modelValue": v[3] || (v[3] = (g) =>
|
|
2773
|
+
"onUpdate:modelValue": v[3] || (v[3] = (g) => D.value = g),
|
|
2766
2774
|
placeholder: s.filterPlaceholder,
|
|
2767
2775
|
class: u(n(t).e("filter-input"))
|
|
2768
2776
|
}, null, 10, Jl), [
|
|
2769
|
-
[
|
|
2777
|
+
[Ve, D.value]
|
|
2770
2778
|
]),
|
|
2771
|
-
|
|
2779
|
+
D.value ? (i(), c("span", {
|
|
2772
2780
|
key: 0,
|
|
2773
2781
|
class: u(n(t).e("filter-clear")),
|
|
2774
|
-
onClick: v[4] || (v[4] = (g) =>
|
|
2775
|
-
}, "×", 2)) :
|
|
2776
|
-
], 2)) :
|
|
2782
|
+
onClick: v[4] || (v[4] = (g) => w("right"))
|
|
2783
|
+
}, "×", 2)) : X("", !0)
|
|
2784
|
+
], 2)) : X("", !0),
|
|
2777
2785
|
d("div", {
|
|
2778
2786
|
class: u(n(t).e("body"))
|
|
2779
2787
|
}, [
|
|
@@ -2784,7 +2792,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2784
2792
|
n(t).is("disabled", b(g)),
|
|
2785
2793
|
n(t).is("checked", C.value.includes(z(g)))
|
|
2786
2794
|
]),
|
|
2787
|
-
onClick: (
|
|
2795
|
+
onClick: (N) => !b(g) && O(z(g))
|
|
2788
2796
|
}, [
|
|
2789
2797
|
d("label", {
|
|
2790
2798
|
class: u(n(t).e("checkbox"))
|
|
@@ -2795,9 +2803,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2795
2803
|
disabled: b(g),
|
|
2796
2804
|
onClick: v[5] || (v[5] = oe(() => {
|
|
2797
2805
|
}, ["stop"])),
|
|
2798
|
-
onChange: (
|
|
2806
|
+
onChange: (N) => O(z(g))
|
|
2799
2807
|
}, null, 40, Ql),
|
|
2800
|
-
d("span", null, U(
|
|
2808
|
+
d("span", null, U(P(g)), 1)
|
|
2801
2809
|
], 2)
|
|
2802
2810
|
], 10, Zl))), 128)),
|
|
2803
2811
|
L.value.length === 0 ? (i(), c("div", {
|
|
@@ -2805,9 +2813,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2805
2813
|
class: u(n(t).e("empty"))
|
|
2806
2814
|
}, [
|
|
2807
2815
|
se(o.$slots, "right-empty", {}, () => [
|
|
2808
|
-
v[7] || (v[7] =
|
|
2816
|
+
v[7] || (v[7] = ce("暂无数据", -1))
|
|
2809
2817
|
])
|
|
2810
|
-
], 2)) :
|
|
2818
|
+
], 2)) : X("", !0)
|
|
2811
2819
|
], 2)
|
|
2812
2820
|
], 2)
|
|
2813
2821
|
], 2));
|
|
@@ -2829,70 +2837,70 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2829
2837
|
marks: {}
|
|
2830
2838
|
},
|
|
2831
2839
|
emits: ["update:modelValue", "change", "input"],
|
|
2832
|
-
setup(s, { emit:
|
|
2833
|
-
const l = s, e =
|
|
2834
|
-
const
|
|
2835
|
-
return (l.modelValue - l.min) /
|
|
2836
|
-
}),
|
|
2840
|
+
setup(s, { emit: k }) {
|
|
2841
|
+
const l = s, e = k, a = ae("slider"), t = R(), f = R(), m = R(!1), y = R(!1), S = M(() => {
|
|
2842
|
+
const w = l.max - l.min;
|
|
2843
|
+
return (l.modelValue - l.min) / w * 100;
|
|
2844
|
+
}), D = M(() => l.formatTooltip ? l.formatTooltip(l.modelValue) : l.modelValue), T = M(() => {
|
|
2837
2845
|
if (!l.showStops || l.min >= l.max) return [];
|
|
2838
|
-
const
|
|
2839
|
-
for (let o = 0; o <=
|
|
2846
|
+
const w = [], x = (l.max - l.min) / l.step;
|
|
2847
|
+
for (let o = 0; o <= x; o++) {
|
|
2840
2848
|
const v = l.min + o * l.step;
|
|
2841
|
-
v > l.min && v < l.max &&
|
|
2849
|
+
v > l.min && v < l.max && w.push((v - l.min) / (l.max - l.min) * 100);
|
|
2842
2850
|
}
|
|
2843
|
-
return
|
|
2844
|
-
}), C =
|
|
2845
|
-
const
|
|
2846
|
-
let g,
|
|
2847
|
-
return typeof o == "string" ? g = o : (g = o.label || String(
|
|
2848
|
-
}) : []), z = () => t.value ? l.vertical ? t.value.offsetHeight : t.value.offsetWidth : 0,
|
|
2851
|
+
return w;
|
|
2852
|
+
}), C = M(() => l.marks ? Object.keys(l.marks).map((w) => {
|
|
2853
|
+
const x = Number(w), o = l.marks[x], v = (x - l.min) / (l.max - l.min) * 100;
|
|
2854
|
+
let g, N = {};
|
|
2855
|
+
return typeof o == "string" ? g = o : (g = o.label || String(x), N = o.style || {}), { value: x, pos: v, label: g, style: N };
|
|
2856
|
+
}) : []), z = () => t.value ? l.vertical ? t.value.offsetHeight : t.value.offsetWidth : 0, P = (w, x) => {
|
|
2849
2857
|
if (!t.value) return l.modelValue;
|
|
2850
2858
|
const o = t.value.getBoundingClientRect(), v = z();
|
|
2851
2859
|
let g;
|
|
2852
|
-
l.vertical ? g = (o.bottom -
|
|
2853
|
-
const
|
|
2860
|
+
l.vertical ? g = (o.bottom - x) / v * 100 : g = (w - o.left) / v * 100, g = Math.max(0, Math.min(100, g));
|
|
2861
|
+
const N = l.min + g / 100 * (l.max - l.min), ne = Math.round(N / l.step) * l.step;
|
|
2854
2862
|
return Math.max(l.min, Math.min(l.max, ne));
|
|
2855
|
-
}, b = (
|
|
2863
|
+
}, b = (w) => {
|
|
2856
2864
|
if (l.disabled) return;
|
|
2857
|
-
const
|
|
2858
|
-
|
|
2859
|
-
}, H = (
|
|
2865
|
+
const x = Math.max(l.min, Math.min(l.max, w));
|
|
2866
|
+
x !== l.modelValue && (e("update:modelValue", x), e("input", x));
|
|
2867
|
+
}, H = (w) => {
|
|
2860
2868
|
if (l.disabled) return;
|
|
2861
|
-
|
|
2862
|
-
const
|
|
2863
|
-
b(
|
|
2864
|
-
}, L = (
|
|
2869
|
+
w.preventDefault(), y.value = !0, m.value = !0;
|
|
2870
|
+
const x = P(w.clientX, w.clientY);
|
|
2871
|
+
b(x), document.addEventListener("mousemove", L), document.addEventListener("mouseup", A);
|
|
2872
|
+
}, L = (w) => {
|
|
2865
2873
|
if (!y.value) return;
|
|
2866
|
-
const
|
|
2867
|
-
b(
|
|
2868
|
-
},
|
|
2869
|
-
y.value = !1, e("change", l.modelValue), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup",
|
|
2870
|
-
}, V = (
|
|
2874
|
+
const x = P(w.clientX, w.clientY);
|
|
2875
|
+
b(x);
|
|
2876
|
+
}, A = () => {
|
|
2877
|
+
y.value = !1, e("change", l.modelValue), document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", A);
|
|
2878
|
+
}, V = (w) => {
|
|
2871
2879
|
if (l.disabled) return;
|
|
2872
|
-
|
|
2873
|
-
const
|
|
2880
|
+
w.preventDefault(), y.value = !0, m.value = !0;
|
|
2881
|
+
const x = w.touches[0], o = P(x.clientX, x.clientY);
|
|
2874
2882
|
b(o);
|
|
2875
|
-
}, h = (
|
|
2883
|
+
}, h = (w) => {
|
|
2876
2884
|
if (!y.value) return;
|
|
2877
|
-
const
|
|
2885
|
+
const x = w.touches[0], o = P(x.clientX, x.clientY);
|
|
2878
2886
|
b(o);
|
|
2879
2887
|
}, r = () => {
|
|
2880
2888
|
y.value = !1, e("change", l.modelValue);
|
|
2881
|
-
},
|
|
2889
|
+
}, $ = () => {
|
|
2882
2890
|
l.showTooltip && (m.value = !0);
|
|
2883
|
-
},
|
|
2891
|
+
}, F = () => {
|
|
2884
2892
|
y.value || (m.value = !1);
|
|
2885
2893
|
};
|
|
2886
|
-
|
|
2887
|
-
document.removeEventListener("mousemove", L), document.removeEventListener("mouseup",
|
|
2894
|
+
$e(() => {
|
|
2895
|
+
document.removeEventListener("mousemove", L), document.removeEventListener("mouseup", A);
|
|
2888
2896
|
});
|
|
2889
|
-
const
|
|
2897
|
+
const B = M(() => [
|
|
2890
2898
|
a.b(),
|
|
2891
2899
|
a.is("disabled", l.disabled),
|
|
2892
2900
|
a.is("vertical", l.vertical)
|
|
2893
|
-
]), O =
|
|
2894
|
-
return (
|
|
2895
|
-
class: u(
|
|
2901
|
+
]), O = M(() => l.vertical && l.height ? { height: typeof l.height == "number" ? `${l.height}px` : l.height } : {}), j = M(() => l.vertical ? { height: `${S.value}%` } : { width: `${S.value}%` }), p = M(() => l.vertical ? { bottom: `${S.value}%` } : { left: `${S.value}%` });
|
|
2902
|
+
return (w, x) => (i(), c("div", {
|
|
2903
|
+
class: u(B.value),
|
|
2896
2904
|
style: te(O.value)
|
|
2897
2905
|
}, [
|
|
2898
2906
|
d("div", {
|
|
@@ -2912,7 +2920,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2912
2920
|
class: u(n(a).e("stop")),
|
|
2913
2921
|
style: te(s.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2914
2922
|
}, null, 6))), 128))
|
|
2915
|
-
])) :
|
|
2923
|
+
])) : X("", !0),
|
|
2916
2924
|
C.value.length > 0 ? (i(), c("div", ea, [
|
|
2917
2925
|
(i(!0), c(J, null, Q(C.value, (o) => (i(), c("div", {
|
|
2918
2926
|
key: o.value,
|
|
@@ -2923,21 +2931,21 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2923
2931
|
class: u(n(a).e("mark-text"))
|
|
2924
2932
|
}, U(o.label), 3)
|
|
2925
2933
|
], 6))), 128))
|
|
2926
|
-
])) :
|
|
2934
|
+
])) : X("", !0),
|
|
2927
2935
|
d("div", {
|
|
2928
2936
|
ref_key: "buttonRef",
|
|
2929
2937
|
ref: f,
|
|
2930
2938
|
class: u(n(a).e("button-wrapper")),
|
|
2931
2939
|
style: te(p.value),
|
|
2932
|
-
onMouseenter:
|
|
2933
|
-
onMouseleave:
|
|
2940
|
+
onMouseenter: $,
|
|
2941
|
+
onMouseleave: F,
|
|
2934
2942
|
onTouchmove: h,
|
|
2935
2943
|
onTouchend: r
|
|
2936
2944
|
}, [
|
|
2937
2945
|
s.showTooltip && m.value ? (i(), c("div", {
|
|
2938
2946
|
key: 0,
|
|
2939
2947
|
class: u(n(a).e("tooltip"))
|
|
2940
|
-
}, U(
|
|
2948
|
+
}, U(D.value), 3)) : X("", !0),
|
|
2941
2949
|
d("div", {
|
|
2942
2950
|
class: u(n(a).e("button"))
|
|
2943
2951
|
}, null, 2)
|
|
@@ -2989,14 +2997,14 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2989
2997
|
onExceed: {}
|
|
2990
2998
|
},
|
|
2991
2999
|
emits: ["update:fileList", "success", "error", "progress", "change", "remove", "exceed"],
|
|
2992
|
-
setup(s, { expose:
|
|
3000
|
+
setup(s, { expose: k, emit: l }) {
|
|
2993
3001
|
const e = s, a = l, t = ae("upload");
|
|
2994
3002
|
Ae();
|
|
2995
3003
|
const f = R(), m = R([...e.fileList]), y = R(!1);
|
|
2996
3004
|
let S = 1;
|
|
2997
|
-
const
|
|
3005
|
+
const D = () => Date.now() + S++, T = (p) => {
|
|
2998
3006
|
var o;
|
|
2999
|
-
const
|
|
3007
|
+
const w = (o = p.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), x = {
|
|
3000
3008
|
pdf: "📄",
|
|
3001
3009
|
doc: "📝",
|
|
3002
3010
|
docx: "📝",
|
|
@@ -3010,19 +3018,19 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3010
3018
|
mp4: "🎬",
|
|
3011
3019
|
default: "📁"
|
|
3012
3020
|
};
|
|
3013
|
-
return w
|
|
3014
|
-
}, C =
|
|
3021
|
+
return x[w || ""] || x.default;
|
|
3022
|
+
}, C = M(() => e.limit ? m.value.length < e.limit : !0), z = M(() => [
|
|
3015
3023
|
t.b(),
|
|
3016
3024
|
t.is("disabled", e.disabled),
|
|
3017
3025
|
t.is("drag", e.drag),
|
|
3018
3026
|
t.m(e.listType)
|
|
3019
|
-
]),
|
|
3020
|
-
const
|
|
3021
|
-
!
|
|
3027
|
+
]), P = (p) => {
|
|
3028
|
+
const w = p.target.files;
|
|
3029
|
+
!w || w.length === 0 || (b(Array.from(w)), f.value && (f.value.value = ""));
|
|
3022
3030
|
}, b = async (p) => {
|
|
3023
|
-
var
|
|
3031
|
+
var w, x;
|
|
3024
3032
|
if (e.limit && m.value.length + p.length > e.limit) {
|
|
3025
|
-
a("exceed", p, m.value), (
|
|
3033
|
+
a("exceed", p, m.value), (w = e.onExceed) == null || w.call(e, p, m.value);
|
|
3026
3034
|
return;
|
|
3027
3035
|
}
|
|
3028
3036
|
for (const o of p) {
|
|
@@ -3033,56 +3041,56 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3033
3041
|
size: o.size,
|
|
3034
3042
|
status: "ready",
|
|
3035
3043
|
percentage: 0,
|
|
3036
|
-
uid:
|
|
3044
|
+
uid: D(),
|
|
3037
3045
|
raw: o
|
|
3038
3046
|
};
|
|
3039
|
-
o.type.startsWith("image/") && (v.thumbUrl = await H(o), v.url = v.thumbUrl), m.value.push(v), a("update:fileList", m.value), a("change", v, m.value), (
|
|
3047
|
+
o.type.startsWith("image/") && (v.thumbUrl = await H(o), v.url = v.thumbUrl), m.value.push(v), a("update:fileList", m.value), a("change", v, m.value), (x = e.onChange) == null || x.call(e, v, m.value), e.autoUpload && L(v);
|
|
3040
3048
|
}
|
|
3041
|
-
}, H = (p) => new Promise((
|
|
3042
|
-
const
|
|
3043
|
-
|
|
3049
|
+
}, H = (p) => new Promise((w) => {
|
|
3050
|
+
const x = new FileReader();
|
|
3051
|
+
x.onload = (o) => {
|
|
3044
3052
|
var v;
|
|
3045
|
-
|
|
3046
|
-
},
|
|
3053
|
+
w((v = o.target) == null ? void 0 : v.result);
|
|
3054
|
+
}, x.readAsDataURL(p);
|
|
3047
3055
|
}), L = (p) => {
|
|
3048
3056
|
if (!p.raw) return;
|
|
3049
|
-
p.status = "uploading", (e.httpRequest ||
|
|
3057
|
+
p.status = "uploading", (e.httpRequest || A)({
|
|
3050
3058
|
action: e.action,
|
|
3051
3059
|
headers: e.headers,
|
|
3052
3060
|
data: e.data,
|
|
3053
3061
|
file: p.raw,
|
|
3054
3062
|
name: e.name,
|
|
3055
3063
|
withCredentials: e.withCredentials,
|
|
3056
|
-
onProgress: (
|
|
3064
|
+
onProgress: (x) => {
|
|
3057
3065
|
var o;
|
|
3058
|
-
p.percentage =
|
|
3066
|
+
p.percentage = x.percent, a("progress", x, p, m.value), (o = e.onProgress) == null || o.call(e, x, p, m.value);
|
|
3059
3067
|
},
|
|
3060
|
-
onSuccess: (
|
|
3068
|
+
onSuccess: (x) => {
|
|
3061
3069
|
var o;
|
|
3062
|
-
p.status = "success", p.response =
|
|
3070
|
+
p.status = "success", p.response = x, a("success", x, p, m.value), (o = e.onSuccess) == null || o.call(e, x, p, m.value);
|
|
3063
3071
|
},
|
|
3064
|
-
onError: (
|
|
3072
|
+
onError: (x) => {
|
|
3065
3073
|
var o;
|
|
3066
|
-
p.status = "error", a("error",
|
|
3074
|
+
p.status = "error", a("error", x, p, m.value), (o = e.onError) == null || o.call(e, x, p, m.value);
|
|
3067
3075
|
}
|
|
3068
3076
|
});
|
|
3069
|
-
},
|
|
3077
|
+
}, A = (p) => new Promise((w, x) => {
|
|
3070
3078
|
const o = new XMLHttpRequest();
|
|
3071
3079
|
o.upload.addEventListener("progress", (g) => {
|
|
3072
3080
|
g.lengthComputable && p.onProgress({ percent: g.loaded / g.total * 100 });
|
|
3073
3081
|
}), o.addEventListener("load", () => {
|
|
3074
3082
|
if (o.status < 200 || o.status >= 300) {
|
|
3075
|
-
p.onError(new Error("Upload failed")),
|
|
3083
|
+
p.onError(new Error("Upload failed")), x(new Error("Upload failed"));
|
|
3076
3084
|
return;
|
|
3077
3085
|
}
|
|
3078
3086
|
try {
|
|
3079
3087
|
const g = JSON.parse(o.responseText);
|
|
3080
|
-
p.onSuccess(g),
|
|
3088
|
+
p.onSuccess(g), w(g);
|
|
3081
3089
|
} catch {
|
|
3082
|
-
p.onSuccess(o.responseText),
|
|
3090
|
+
p.onSuccess(o.responseText), w(o.responseText);
|
|
3083
3091
|
}
|
|
3084
3092
|
}), o.addEventListener("error", () => {
|
|
3085
|
-
p.onError(new Error("Upload error")),
|
|
3093
|
+
p.onError(new Error("Upload error")), x(new Error("Upload error"));
|
|
3086
3094
|
});
|
|
3087
3095
|
const v = new FormData();
|
|
3088
3096
|
v.append(p.name, p.file), p.data && Object.keys(p.data).forEach((g) => {
|
|
@@ -3091,48 +3099,48 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3091
3099
|
o.setRequestHeader(g, p.headers[g]);
|
|
3092
3100
|
}), o.send(v);
|
|
3093
3101
|
}), V = async (p) => {
|
|
3094
|
-
var
|
|
3102
|
+
var x;
|
|
3095
3103
|
if (e.beforeRemove && await e.beforeRemove(p, m.value) === !1)
|
|
3096
3104
|
return;
|
|
3097
|
-
const
|
|
3098
|
-
|
|
3105
|
+
const w = m.value.findIndex((o) => o.uid === p.uid);
|
|
3106
|
+
w > -1 && (m.value.splice(w, 1), a("update:fileList", m.value), a("remove", p, m.value), (x = e.onRemove) == null || x.call(e, p, m.value));
|
|
3099
3107
|
}, h = () => {
|
|
3100
3108
|
m.value.filter((p) => p.status === "ready" && p.raw).forEach((p) => L(p));
|
|
3101
3109
|
}, r = () => {
|
|
3102
3110
|
m.value = [], a("update:fileList", m.value);
|
|
3103
|
-
},
|
|
3111
|
+
}, $ = () => {
|
|
3104
3112
|
var p;
|
|
3105
3113
|
e.disabled || (p = f.value) == null || p.click();
|
|
3106
|
-
},
|
|
3114
|
+
}, F = (p) => {
|
|
3107
3115
|
p.preventDefault(), !e.disabled && e.drag && (y.value = !0);
|
|
3108
|
-
},
|
|
3116
|
+
}, B = () => {
|
|
3109
3117
|
y.value = !1;
|
|
3110
3118
|
}, O = (p) => {
|
|
3111
|
-
var
|
|
3119
|
+
var x;
|
|
3112
3120
|
if (p.preventDefault(), y.value = !1, e.disabled) return;
|
|
3113
|
-
const
|
|
3114
|
-
|
|
3121
|
+
const w = (x = p.dataTransfer) == null ? void 0 : x.files;
|
|
3122
|
+
w && w.length > 0 && b(Array.from(w));
|
|
3115
3123
|
}, j = (p) => {
|
|
3116
3124
|
if (!p) return "0 B";
|
|
3117
|
-
const
|
|
3118
|
-
let
|
|
3119
|
-
for (; o >= 1024 &&
|
|
3120
|
-
o /= 1024,
|
|
3121
|
-
return `${o.toFixed(2)} ${x
|
|
3125
|
+
const w = ["B", "KB", "MB", "GB"];
|
|
3126
|
+
let x = 0, o = p;
|
|
3127
|
+
for (; o >= 1024 && x < w.length - 1; )
|
|
3128
|
+
o /= 1024, x++;
|
|
3129
|
+
return `${o.toFixed(2)} ${w[x]}`;
|
|
3122
3130
|
};
|
|
3123
|
-
return
|
|
3131
|
+
return k({
|
|
3124
3132
|
submit: h,
|
|
3125
3133
|
clearFiles: r,
|
|
3126
3134
|
uploadFiles: m
|
|
3127
|
-
}), (p,
|
|
3135
|
+
}), (p, w) => (i(), c("div", {
|
|
3128
3136
|
class: u(z.value)
|
|
3129
3137
|
}, [
|
|
3130
3138
|
s.drag ? (i(), c("div", {
|
|
3131
3139
|
key: 0,
|
|
3132
3140
|
class: u([n(t).e("drag"), n(t).is("dragover", y.value)]),
|
|
3133
|
-
onClick:
|
|
3134
|
-
onDragover:
|
|
3135
|
-
onDragleave:
|
|
3141
|
+
onClick: $,
|
|
3142
|
+
onDragover: F,
|
|
3143
|
+
onDragleave: B,
|
|
3136
3144
|
onDrop: O
|
|
3137
3145
|
}, [
|
|
3138
3146
|
se(p.$slots, "drag", {}, () => [
|
|
@@ -3141,8 +3149,8 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3141
3149
|
}, "📁", 2),
|
|
3142
3150
|
d("div", {
|
|
3143
3151
|
class: u(n(t).e("drag-text"))
|
|
3144
|
-
}, [...
|
|
3145
|
-
|
|
3152
|
+
}, [...w[0] || (w[0] = [
|
|
3153
|
+
ce(" 将文件拖到此处,或", -1),
|
|
3146
3154
|
d("em", null, "点击上传", -1)
|
|
3147
3155
|
])], 2)
|
|
3148
3156
|
])
|
|
@@ -3150,46 +3158,46 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3150
3158
|
key: 1,
|
|
3151
3159
|
class: u([n(t).e("files"), n(t).e("upload-list")])
|
|
3152
3160
|
}, [
|
|
3153
|
-
(i(!0), c(J, null, Q(m.value, (
|
|
3154
|
-
key:
|
|
3155
|
-
class: u([n(t).e("file"), n(t).is(`status-${
|
|
3161
|
+
(i(!0), c(J, null, Q(m.value, (x) => (i(), c("li", {
|
|
3162
|
+
key: x.uid,
|
|
3163
|
+
class: u([n(t).e("file"), n(t).is(`status-${x.status}`)])
|
|
3156
3164
|
}, [
|
|
3157
|
-
|
|
3165
|
+
x.thumbUrl && x.status !== "uploading" ? (i(), c("img", {
|
|
3158
3166
|
key: 0,
|
|
3159
|
-
src:
|
|
3167
|
+
src: x.thumbUrl,
|
|
3160
3168
|
class: u(n(t).e("file-image"))
|
|
3161
3169
|
}, null, 10, la)) : (i(), c("div", {
|
|
3162
3170
|
key: 1,
|
|
3163
3171
|
class: u(n(t).e("file-status"))
|
|
3164
3172
|
}, [
|
|
3165
|
-
|
|
3173
|
+
x.status === "uploading" ? (i(), c("span", aa, [
|
|
3166
3174
|
d("span", ta, [
|
|
3167
|
-
d("span", na, U(Math.round(
|
|
3175
|
+
d("span", na, U(Math.round(x.percentage || 0)) + "%", 1)
|
|
3168
3176
|
])
|
|
3169
|
-
])) :
|
|
3177
|
+
])) : x.status === "error" ? (i(), c("span", sa, [
|
|
3170
3178
|
Z(n(ee), {
|
|
3171
3179
|
name: "close",
|
|
3172
3180
|
size: 16
|
|
3173
3181
|
})
|
|
3174
|
-
])) :
|
|
3182
|
+
])) : x.status === "success" ? (i(), c("span", ua, [
|
|
3175
3183
|
Z(n(ee), {
|
|
3176
3184
|
name: "check",
|
|
3177
3185
|
size: 16
|
|
3178
3186
|
})
|
|
3179
|
-
])) :
|
|
3187
|
+
])) : X("", !0)
|
|
3180
3188
|
], 2)),
|
|
3181
3189
|
d("span", {
|
|
3182
3190
|
class: u(n(t).e("file-actions"))
|
|
3183
3191
|
}, [
|
|
3184
|
-
|
|
3192
|
+
x.url ? (i(), c("span", oa, [
|
|
3185
3193
|
Z(n(ee), {
|
|
3186
3194
|
name: "eye",
|
|
3187
3195
|
size: 14
|
|
3188
3196
|
})
|
|
3189
|
-
])) :
|
|
3197
|
+
])) : X("", !0),
|
|
3190
3198
|
d("span", {
|
|
3191
3199
|
class: "action-remove",
|
|
3192
|
-
onClick: (o) => V(
|
|
3200
|
+
onClick: (o) => V(x)
|
|
3193
3201
|
}, [
|
|
3194
3202
|
Z(n(ee), {
|
|
3195
3203
|
name: "delete",
|
|
@@ -3201,16 +3209,16 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3201
3209
|
C.value ? (i(), c("li", {
|
|
3202
3210
|
key: 0,
|
|
3203
3211
|
class: u(n(t).e("upload-card")),
|
|
3204
|
-
onClick:
|
|
3212
|
+
onClick: $
|
|
3205
3213
|
}, [
|
|
3206
3214
|
se(p.$slots, "trigger", {}, () => [
|
|
3207
|
-
|
|
3215
|
+
w[1] || (w[1] = d("span", { class: "upload-icon" }, "+", -1))
|
|
3208
3216
|
])
|
|
3209
|
-
], 2)) :
|
|
3217
|
+
], 2)) : X("", !0)
|
|
3210
3218
|
], 2)) : (i(), c(J, { key: 2 }, [
|
|
3211
3219
|
d("div", {
|
|
3212
3220
|
class: u(n(t).e("trigger-wrapper")),
|
|
3213
|
-
onClick:
|
|
3221
|
+
onClick: $
|
|
3214
3222
|
}, [
|
|
3215
3223
|
se(p.$slots, "trigger", {}, () => [
|
|
3216
3224
|
C.value ? (i(), c("button", {
|
|
@@ -3220,40 +3228,40 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3220
3228
|
disabled: s.disabled
|
|
3221
3229
|
}, [
|
|
3222
3230
|
se(p.$slots, "default", {}, () => [
|
|
3223
|
-
|
|
3231
|
+
w[2] || (w[2] = ce("点击上传", -1))
|
|
3224
3232
|
])
|
|
3225
|
-
], 10, ra)) :
|
|
3233
|
+
], 10, ra)) : X("", !0)
|
|
3226
3234
|
])
|
|
3227
3235
|
], 2),
|
|
3228
3236
|
s.showFileList && m.value.length > 0 ? (i(), c("ul", {
|
|
3229
3237
|
key: 0,
|
|
3230
3238
|
class: u(n(t).e("files"))
|
|
3231
3239
|
}, [
|
|
3232
|
-
(i(!0), c(J, null, Q(m.value, (
|
|
3233
|
-
key:
|
|
3234
|
-
class: u([n(t).e("file"), n(t).is(`status-${
|
|
3240
|
+
(i(!0), c(J, null, Q(m.value, (x) => (i(), c("li", {
|
|
3241
|
+
key: x.uid,
|
|
3242
|
+
class: u([n(t).e("file"), n(t).is(`status-${x.status}`)])
|
|
3235
3243
|
}, [
|
|
3236
3244
|
s.listType === "text" ? (i(), c(J, { key: 0 }, [
|
|
3237
3245
|
d("span", {
|
|
3238
3246
|
class: u(n(t).e("file-icon"))
|
|
3239
|
-
}, U(T(
|
|
3247
|
+
}, U(T(x)), 3),
|
|
3240
3248
|
d("span", {
|
|
3241
3249
|
class: u(n(t).e("file-name"))
|
|
3242
|
-
}, U(
|
|
3250
|
+
}, U(x.name), 3),
|
|
3243
3251
|
d("span", {
|
|
3244
3252
|
class: u(n(t).e("file-size"))
|
|
3245
|
-
}, U(j(
|
|
3246
|
-
|
|
3253
|
+
}, U(j(x.size)), 3),
|
|
3254
|
+
x.status === "uploading" ? (i(), c("span", {
|
|
3247
3255
|
key: 0,
|
|
3248
3256
|
class: u(n(t).e("file-progress"))
|
|
3249
3257
|
}, [
|
|
3250
3258
|
d("span", {
|
|
3251
3259
|
class: "progress-bar",
|
|
3252
|
-
style: te({ width:
|
|
3260
|
+
style: te({ width: x.percentage + "%" })
|
|
3253
3261
|
}, null, 4),
|
|
3254
|
-
d("span", da, U(Math.round(
|
|
3255
|
-
], 2)) :
|
|
3256
|
-
|
|
3262
|
+
d("span", da, U(Math.round(x.percentage || 0)) + "%", 1)
|
|
3263
|
+
], 2)) : X("", !0),
|
|
3264
|
+
x.status === "success" ? (i(), c("span", {
|
|
3257
3265
|
key: 1,
|
|
3258
3266
|
class: u(n(t).e("file-success"))
|
|
3259
3267
|
}, [
|
|
@@ -3261,8 +3269,8 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3261
3269
|
name: "check",
|
|
3262
3270
|
size: 14
|
|
3263
3271
|
})
|
|
3264
|
-
], 2)) :
|
|
3265
|
-
|
|
3272
|
+
], 2)) : X("", !0),
|
|
3273
|
+
x.status === "error" ? (i(), c("span", {
|
|
3266
3274
|
key: 2,
|
|
3267
3275
|
class: u(n(t).e("file-error"))
|
|
3268
3276
|
}, [
|
|
@@ -3270,13 +3278,13 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3270
3278
|
name: "close",
|
|
3271
3279
|
size: 14
|
|
3272
3280
|
})
|
|
3273
|
-
], 2)) :
|
|
3281
|
+
], 2)) : X("", !0),
|
|
3274
3282
|
d("span", {
|
|
3275
3283
|
class: u(n(t).e("file-actions"))
|
|
3276
3284
|
}, [
|
|
3277
3285
|
d("span", {
|
|
3278
3286
|
class: "action-remove",
|
|
3279
|
-
onClick: (o) => V(
|
|
3287
|
+
onClick: (o) => V(x)
|
|
3280
3288
|
}, [
|
|
3281
3289
|
Z(n(ee), {
|
|
3282
3290
|
name: "close",
|
|
@@ -3285,42 +3293,42 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3285
3293
|
], 8, ca)
|
|
3286
3294
|
], 2)
|
|
3287
3295
|
], 64)) : s.listType === "picture" ? (i(), c(J, { key: 1 }, [
|
|
3288
|
-
|
|
3296
|
+
x.thumbUrl ? (i(), c("img", {
|
|
3289
3297
|
key: 0,
|
|
3290
|
-
src:
|
|
3298
|
+
src: x.thumbUrl,
|
|
3291
3299
|
class: u(n(t).e("file-thumb"))
|
|
3292
3300
|
}, null, 10, va)) : (i(), c("span", {
|
|
3293
3301
|
key: 1,
|
|
3294
3302
|
class: u(n(t).e("file-icon"))
|
|
3295
|
-
}, U(T(
|
|
3303
|
+
}, U(T(x)), 3)),
|
|
3296
3304
|
d("div", {
|
|
3297
3305
|
class: u(n(t).e("file-info"))
|
|
3298
3306
|
}, [
|
|
3299
3307
|
d("span", {
|
|
3300
3308
|
class: u(n(t).e("file-name"))
|
|
3301
|
-
}, U(
|
|
3302
|
-
|
|
3309
|
+
}, U(x.name), 3),
|
|
3310
|
+
x.status === "uploading" ? (i(), c("span", {
|
|
3303
3311
|
key: 0,
|
|
3304
3312
|
class: u(n(t).e("file-progress"))
|
|
3305
3313
|
}, [
|
|
3306
3314
|
d("span", {
|
|
3307
3315
|
class: "progress-bar",
|
|
3308
|
-
style: te({ width:
|
|
3316
|
+
style: te({ width: x.percentage + "%" })
|
|
3309
3317
|
}, null, 4)
|
|
3310
|
-
], 2)) :
|
|
3318
|
+
], 2)) : X("", !0)
|
|
3311
3319
|
], 2),
|
|
3312
3320
|
d("span", {
|
|
3313
3321
|
class: u(n(t).e("file-actions"))
|
|
3314
3322
|
}, [
|
|
3315
|
-
|
|
3323
|
+
x.status === "success" ? (i(), c("span", fa, [
|
|
3316
3324
|
Z(n(ee), {
|
|
3317
3325
|
name: "check",
|
|
3318
3326
|
size: 14
|
|
3319
3327
|
})
|
|
3320
|
-
])) :
|
|
3328
|
+
])) : X("", !0),
|
|
3321
3329
|
d("span", {
|
|
3322
3330
|
class: "action-remove",
|
|
3323
|
-
onClick: (o) => V(
|
|
3331
|
+
onClick: (o) => V(x)
|
|
3324
3332
|
}, [
|
|
3325
3333
|
Z(n(ee), {
|
|
3326
3334
|
name: "close",
|
|
@@ -3328,9 +3336,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3328
3336
|
})
|
|
3329
3337
|
], 8, ma)
|
|
3330
3338
|
], 2)
|
|
3331
|
-
], 64)) :
|
|
3339
|
+
], 64)) : X("", !0)
|
|
3332
3340
|
], 2))), 128))
|
|
3333
|
-
], 2)) :
|
|
3341
|
+
], 2)) : X("", !0)
|
|
3334
3342
|
], 64)),
|
|
3335
3343
|
d("input", {
|
|
3336
3344
|
ref_key: "inputRef",
|
|
@@ -3340,14 +3348,14 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3340
3348
|
multiple: s.multiple,
|
|
3341
3349
|
accept: s.accept,
|
|
3342
3350
|
disabled: s.disabled,
|
|
3343
|
-
onChange:
|
|
3351
|
+
onChange: P
|
|
3344
3352
|
}, null, 42, ha),
|
|
3345
3353
|
p.$slots.tip ? (i(), c("div", {
|
|
3346
3354
|
key: 3,
|
|
3347
3355
|
class: u(n(t).e("tip"))
|
|
3348
3356
|
}, [
|
|
3349
3357
|
se(p.$slots, "tip")
|
|
3350
|
-
], 2)) :
|
|
3358
|
+
], 2)) : X("", !0)
|
|
3351
3359
|
], 2));
|
|
3352
3360
|
}
|
|
3353
3361
|
}), pa = ["onMousemove", "onClick"], vt = /* @__PURE__ */ le({
|
|
@@ -3375,8 +3383,8 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3375
3383
|
size: { default: "default" }
|
|
3376
3384
|
},
|
|
3377
3385
|
emits: ["update:modelValue", "change"],
|
|
3378
|
-
setup(s, { emit:
|
|
3379
|
-
const l = s, e =
|
|
3386
|
+
setup(s, { emit: k }) {
|
|
3387
|
+
const l = s, e = k, a = ae("rate"), t = R(-1), f = M(() => t.value > -1 ? t.value : l.modelValue), m = M(() => [
|
|
3380
3388
|
a.b(),
|
|
3381
3389
|
a.m(l.size),
|
|
3382
3390
|
a.is("disabled", l.disabled),
|
|
@@ -3384,7 +3392,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3384
3392
|
]), y = (b) => l.disabled ? l.disabledVoidColor : b <= l.lowThreshold ? l.colors[0] : b <= l.highThreshold ? l.colors[1] || l.colors[0] : l.colors[2] || l.colors[1] || l.colors[0], S = (b) => {
|
|
3385
3393
|
const H = f.value;
|
|
3386
3394
|
return H >= b ? 100 : l.allowHalf && H >= b - 0.5 ? 50 : 0;
|
|
3387
|
-
},
|
|
3395
|
+
}, D = (b) => S(b) > 0 ? y(f.value) : l.disabled ? l.disabledVoidColor : l.voidColor, T = M(() => {
|
|
3388
3396
|
if (l.showScore)
|
|
3389
3397
|
return l.scoreTemplate.replace("{value}", String(l.modelValue));
|
|
3390
3398
|
if (l.showText) {
|
|
@@ -3395,13 +3403,13 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3395
3403
|
}), C = (b, H) => {
|
|
3396
3404
|
if (!(l.disabled || l.readonly))
|
|
3397
3405
|
if (l.allowHalf) {
|
|
3398
|
-
const
|
|
3406
|
+
const A = H.currentTarget.getBoundingClientRect(), V = H.clientX - A.left < A.width / 2;
|
|
3399
3407
|
t.value = V ? b - 0.5 : b;
|
|
3400
3408
|
} else
|
|
3401
3409
|
t.value = b;
|
|
3402
3410
|
}, z = () => {
|
|
3403
3411
|
l.disabled || l.readonly || (t.value = -1);
|
|
3404
|
-
},
|
|
3412
|
+
}, P = (b, H) => {
|
|
3405
3413
|
if (l.disabled || l.readonly) return;
|
|
3406
3414
|
let L;
|
|
3407
3415
|
if (l.allowHalf) {
|
|
@@ -3421,8 +3429,8 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3421
3429
|
(i(!0), c(J, null, Q(s.max, (L) => (i(), c("span", {
|
|
3422
3430
|
key: L,
|
|
3423
3431
|
class: u(n(a).e("item")),
|
|
3424
|
-
onMousemove: (
|
|
3425
|
-
onClick: (
|
|
3432
|
+
onMousemove: (A) => C(L, A),
|
|
3433
|
+
onClick: (A) => P(L, A)
|
|
3426
3434
|
}, [
|
|
3427
3435
|
d("span", {
|
|
3428
3436
|
class: u(n(a).e("void")),
|
|
@@ -3431,7 +3439,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3431
3439
|
d("span", {
|
|
3432
3440
|
class: u([n(a).e("fill"), S(L) > 0 ? "is-active" : ""]),
|
|
3433
3441
|
style: te({
|
|
3434
|
-
color:
|
|
3442
|
+
color: D(L),
|
|
3435
3443
|
clipPath: `inset(0 ${100 - S(L)}% 0 0)`
|
|
3436
3444
|
})
|
|
3437
3445
|
}, U(s.icon), 7)
|
|
@@ -3441,7 +3449,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3441
3449
|
key: 0,
|
|
3442
3450
|
class: u(n(a).e("text")),
|
|
3443
3451
|
style: te({ color: s.textColor })
|
|
3444
|
-
}, U(T.value), 7)) :
|
|
3452
|
+
}, U(T.value), 7)) : X("", !0)
|
|
3445
3453
|
], 34));
|
|
3446
3454
|
}
|
|
3447
3455
|
}), ga = ["value"], ba = { class: "field-type" }, ya = { class: "field-name" }, ka = { class: "field-label" }, Ma = {
|
|
@@ -3466,18 +3474,18 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3466
3474
|
] }
|
|
3467
3475
|
},
|
|
3468
3476
|
emits: ["update:fields", "add", "remove", "sort", "update"],
|
|
3469
|
-
setup(s, { emit:
|
|
3470
|
-
const l = s, e =
|
|
3477
|
+
setup(s, { emit: k }) {
|
|
3478
|
+
const l = s, e = k, a = ae("dynamic-fields"), t = R([]), f = R(null), m = R("input"), y = M(() => [
|
|
3471
3479
|
a.b(),
|
|
3472
3480
|
a.is("editable", l.editable)
|
|
3473
|
-
]), S =
|
|
3481
|
+
]), S = M(() => t.value.length < l.maxFields);
|
|
3474
3482
|
ie(() => l.fields, (h) => {
|
|
3475
|
-
t.value = [...h].sort((r,
|
|
3483
|
+
t.value = [...h].sort((r, $) => (r.order || 0) - ($.order || 0));
|
|
3476
3484
|
}, { immediate: !0, deep: !0 });
|
|
3477
|
-
const
|
|
3485
|
+
const D = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, T = () => {
|
|
3478
3486
|
if (!S.value) return;
|
|
3479
3487
|
const h = {
|
|
3480
|
-
id:
|
|
3488
|
+
id: D(),
|
|
3481
3489
|
name: `field_${t.value.length + 1}`,
|
|
3482
3490
|
label: "新字段",
|
|
3483
3491
|
type: m.value,
|
|
@@ -3486,19 +3494,19 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3486
3494
|
};
|
|
3487
3495
|
t.value.push(h), e("add", h), e("update:fields", t.value);
|
|
3488
3496
|
}, C = (h) => {
|
|
3489
|
-
const r = t.value.findIndex((
|
|
3497
|
+
const r = t.value.findIndex(($) => $.id === h);
|
|
3490
3498
|
r !== -1 && (t.value[r], t.value.splice(r, 1), e("remove", h), e("update:fields", t.value));
|
|
3491
3499
|
}, z = (h) => {
|
|
3492
|
-
const r = t.value.findIndex((
|
|
3500
|
+
const r = t.value.findIndex(($) => $.id === h);
|
|
3493
3501
|
if (r > 0) {
|
|
3494
|
-
const
|
|
3495
|
-
t.value[r] = t.value[r - 1], t.value[r - 1] =
|
|
3502
|
+
const $ = t.value[r];
|
|
3503
|
+
t.value[r] = t.value[r - 1], t.value[r - 1] = $, b(), e("sort", t.value), e("update:fields", t.value);
|
|
3496
3504
|
}
|
|
3497
|
-
},
|
|
3498
|
-
const r = t.value.findIndex((
|
|
3505
|
+
}, P = (h) => {
|
|
3506
|
+
const r = t.value.findIndex(($) => $.id === h);
|
|
3499
3507
|
if (r < t.value.length - 1) {
|
|
3500
|
-
const
|
|
3501
|
-
t.value[r] = t.value[r + 1], t.value[r + 1] =
|
|
3508
|
+
const $ = t.value[r];
|
|
3509
|
+
t.value[r] = t.value[r + 1], t.value[r + 1] = $, b(), e("sort", t.value), e("update:fields", t.value);
|
|
3502
3510
|
}
|
|
3503
3511
|
}, b = () => {
|
|
3504
3512
|
t.value.forEach((h, r) => {
|
|
@@ -3511,10 +3519,10 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3511
3519
|
const h = t.value.findIndex((r) => r.id === f.value.id);
|
|
3512
3520
|
h !== -1 && (t.value[h] = f.value, e("update", f.value.id, f.value), e("update:fields", t.value)), f.value = null;
|
|
3513
3521
|
}
|
|
3514
|
-
},
|
|
3522
|
+
}, A = () => {
|
|
3515
3523
|
f.value = null;
|
|
3516
3524
|
}, V = (h) => {
|
|
3517
|
-
const r = l.availableTypes.find((
|
|
3525
|
+
const r = l.availableTypes.find(($) => $.value === h);
|
|
3518
3526
|
return (r == null ? void 0 : r.label) || h;
|
|
3519
3527
|
};
|
|
3520
3528
|
return (h, r) => (i(), c("div", {
|
|
@@ -3525,35 +3533,35 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3525
3533
|
class: u(n(a).e("add"))
|
|
3526
3534
|
}, [
|
|
3527
3535
|
ue(d("select", {
|
|
3528
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
3536
|
+
"onUpdate:modelValue": r[0] || (r[0] = ($) => m.value = $),
|
|
3529
3537
|
class: u(n(a).e("type-select"))
|
|
3530
3538
|
}, [
|
|
3531
|
-
(i(!0), c(J, null, Q(s.availableTypes, (
|
|
3532
|
-
key:
|
|
3533
|
-
value:
|
|
3534
|
-
}, U(
|
|
3539
|
+
(i(!0), c(J, null, Q(s.availableTypes, ($) => (i(), c("option", {
|
|
3540
|
+
key: $.value,
|
|
3541
|
+
value: $.value
|
|
3542
|
+
}, U($.label), 9, ga))), 128))
|
|
3535
3543
|
], 2), [
|
|
3536
|
-
[
|
|
3544
|
+
[we, m.value]
|
|
3537
3545
|
]),
|
|
3538
3546
|
d("button", {
|
|
3539
3547
|
class: u(n(a).e("add-btn")),
|
|
3540
3548
|
onClick: T
|
|
3541
3549
|
}, " + 添加字段 ", 2)
|
|
3542
|
-
], 2)) :
|
|
3550
|
+
], 2)) : X("", !0),
|
|
3543
3551
|
d("div", {
|
|
3544
3552
|
class: u(n(a).e("list"))
|
|
3545
3553
|
}, [
|
|
3546
|
-
(i(!0), c(J, null, Q(t.value, (
|
|
3547
|
-
key:
|
|
3554
|
+
(i(!0), c(J, null, Q(t.value, ($) => (i(), c("div", {
|
|
3555
|
+
key: $.id,
|
|
3548
3556
|
class: u(n(a).e("item"))
|
|
3549
3557
|
}, [
|
|
3550
3558
|
d("div", {
|
|
3551
3559
|
class: u(n(a).e("info"))
|
|
3552
3560
|
}, [
|
|
3553
|
-
d("span", ba, U(V(
|
|
3554
|
-
d("span", ya, U(
|
|
3555
|
-
d("span", ka, U(
|
|
3556
|
-
|
|
3561
|
+
d("span", ba, U(V($.type)), 1),
|
|
3562
|
+
d("span", ya, U($.name), 1),
|
|
3563
|
+
d("span", ka, U($.label), 1),
|
|
3564
|
+
$.required ? (i(), c("span", Ma, "必填")) : X("", !0)
|
|
3557
3565
|
], 2),
|
|
3558
3566
|
s.editable ? (i(), c("div", {
|
|
3559
3567
|
key: 0,
|
|
@@ -3563,28 +3571,28 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3563
3571
|
key: 0,
|
|
3564
3572
|
class: "action-btn",
|
|
3565
3573
|
title: "上移",
|
|
3566
|
-
onClick: (
|
|
3574
|
+
onClick: (F) => z($.id)
|
|
3567
3575
|
}, [
|
|
3568
3576
|
Z(n(ee), {
|
|
3569
3577
|
name: "move-up",
|
|
3570
3578
|
size: 14
|
|
3571
3579
|
})
|
|
3572
|
-
], 8, Va)) :
|
|
3580
|
+
], 8, Va)) : X("", !0),
|
|
3573
3581
|
s.showSort ? (i(), c("button", {
|
|
3574
3582
|
key: 1,
|
|
3575
3583
|
class: "action-btn",
|
|
3576
3584
|
title: "下移",
|
|
3577
|
-
onClick: (
|
|
3585
|
+
onClick: (F) => P($.id)
|
|
3578
3586
|
}, [
|
|
3579
3587
|
Z(n(ee), {
|
|
3580
3588
|
name: "move-down",
|
|
3581
3589
|
size: 14
|
|
3582
3590
|
})
|
|
3583
|
-
], 8, xa)) :
|
|
3591
|
+
], 8, xa)) : X("", !0),
|
|
3584
3592
|
d("button", {
|
|
3585
3593
|
class: "action-btn",
|
|
3586
3594
|
title: "编辑",
|
|
3587
|
-
onClick: (
|
|
3595
|
+
onClick: (F) => H($)
|
|
3588
3596
|
}, [
|
|
3589
3597
|
Z(n(ee), {
|
|
3590
3598
|
name: "edit",
|
|
@@ -3594,14 +3602,14 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3594
3602
|
d("button", {
|
|
3595
3603
|
class: "action-btn action-btn--danger",
|
|
3596
3604
|
title: "删除",
|
|
3597
|
-
onClick: (
|
|
3605
|
+
onClick: (F) => C($.id)
|
|
3598
3606
|
}, [
|
|
3599
3607
|
Z(n(ee), {
|
|
3600
3608
|
name: "close",
|
|
3601
3609
|
size: 14
|
|
3602
3610
|
})
|
|
3603
3611
|
], 8, Ca)
|
|
3604
|
-
], 2)) :
|
|
3612
|
+
], 2)) : X("", !0)
|
|
3605
3613
|
], 2))), 128))
|
|
3606
3614
|
], 2),
|
|
3607
3615
|
t.value.length === 0 ? (i(), c("div", {
|
|
@@ -3609,7 +3617,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3609
3617
|
class: u(n(a).e("empty"))
|
|
3610
3618
|
}, [...r[6] || (r[6] = [
|
|
3611
3619
|
d("span", null, "暂无字段配置", -1)
|
|
3612
|
-
])], 2)) :
|
|
3620
|
+
])], 2)) : X("", !0),
|
|
3613
3621
|
f.value ? (i(), c("div", {
|
|
3614
3622
|
key: 2,
|
|
3615
3623
|
class: u(n(a).e("edit-modal"))
|
|
@@ -3619,7 +3627,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3619
3627
|
r[7] || (r[7] = d("span", null, "编辑字段", -1)),
|
|
3620
3628
|
d("button", {
|
|
3621
3629
|
class: "close-btn",
|
|
3622
|
-
onClick:
|
|
3630
|
+
onClick: A
|
|
3623
3631
|
}, [
|
|
3624
3632
|
Z(n(ee), {
|
|
3625
3633
|
name: "close",
|
|
@@ -3631,58 +3639,58 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3631
3639
|
d("div", Sa, [
|
|
3632
3640
|
r[8] || (r[8] = d("label", null, "字段名称", -1)),
|
|
3633
3641
|
ue(d("input", {
|
|
3634
|
-
"onUpdate:modelValue": r[1] || (r[1] = (
|
|
3642
|
+
"onUpdate:modelValue": r[1] || (r[1] = ($) => f.value.name = $),
|
|
3635
3643
|
type: "text",
|
|
3636
3644
|
placeholder: "变量名称"
|
|
3637
3645
|
}, null, 512), [
|
|
3638
|
-
[
|
|
3646
|
+
[Ve, f.value.name]
|
|
3639
3647
|
])
|
|
3640
3648
|
]),
|
|
3641
3649
|
d("div", Ta, [
|
|
3642
3650
|
r[9] || (r[9] = d("label", null, "字段标签", -1)),
|
|
3643
3651
|
ue(d("input", {
|
|
3644
|
-
"onUpdate:modelValue": r[2] || (r[2] = (
|
|
3652
|
+
"onUpdate:modelValue": r[2] || (r[2] = ($) => f.value.label = $),
|
|
3645
3653
|
type: "text",
|
|
3646
3654
|
placeholder: "显示标签"
|
|
3647
3655
|
}, null, 512), [
|
|
3648
|
-
[
|
|
3656
|
+
[Ve, f.value.label]
|
|
3649
3657
|
])
|
|
3650
3658
|
]),
|
|
3651
3659
|
d("div", Ha, [
|
|
3652
3660
|
r[10] || (r[10] = d("label", null, "字段类型", -1)),
|
|
3653
3661
|
ue(d("select", {
|
|
3654
|
-
"onUpdate:modelValue": r[3] || (r[3] = (
|
|
3662
|
+
"onUpdate:modelValue": r[3] || (r[3] = ($) => f.value.type = $)
|
|
3655
3663
|
}, [
|
|
3656
|
-
(i(!0), c(J, null, Q(s.availableTypes, (
|
|
3657
|
-
key:
|
|
3658
|
-
value:
|
|
3659
|
-
}, U(
|
|
3664
|
+
(i(!0), c(J, null, Q(s.availableTypes, ($) => (i(), c("option", {
|
|
3665
|
+
key: $.value,
|
|
3666
|
+
value: $.value
|
|
3667
|
+
}, U($.label), 9, La))), 128))
|
|
3660
3668
|
], 512), [
|
|
3661
|
-
[
|
|
3669
|
+
[we, f.value.type]
|
|
3662
3670
|
])
|
|
3663
3671
|
]),
|
|
3664
3672
|
d("div", Ra, [
|
|
3665
3673
|
r[11] || (r[11] = d("label", null, "是否必填", -1)),
|
|
3666
3674
|
d("button", {
|
|
3667
3675
|
class: u(["switch-btn", { "is-on": f.value.required }]),
|
|
3668
|
-
onClick: r[4] || (r[4] = (
|
|
3676
|
+
onClick: r[4] || (r[4] = ($) => f.value.required = !f.value.required)
|
|
3669
3677
|
}, U(f.value.required ? "必填" : "可选"), 3)
|
|
3670
3678
|
]),
|
|
3671
3679
|
d("div", Ba, [
|
|
3672
3680
|
r[12] || (r[12] = d("label", null, "占位文本", -1)),
|
|
3673
3681
|
ue(d("input", {
|
|
3674
|
-
"onUpdate:modelValue": r[5] || (r[5] = (
|
|
3682
|
+
"onUpdate:modelValue": r[5] || (r[5] = ($) => f.value.placeholder = $),
|
|
3675
3683
|
type: "text",
|
|
3676
3684
|
placeholder: "输入提示"
|
|
3677
3685
|
}, null, 512), [
|
|
3678
|
-
[
|
|
3686
|
+
[Ve, f.value.placeholder]
|
|
3679
3687
|
])
|
|
3680
3688
|
])
|
|
3681
3689
|
]),
|
|
3682
3690
|
d("div", { class: "modal-footer" }, [
|
|
3683
3691
|
d("button", {
|
|
3684
3692
|
class: "cancel-btn",
|
|
3685
|
-
onClick:
|
|
3693
|
+
onClick: A
|
|
3686
3694
|
}, "取消"),
|
|
3687
3695
|
d("button", {
|
|
3688
3696
|
class: "save-btn",
|
|
@@ -3690,7 +3698,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3690
3698
|
}, "保存")
|
|
3691
3699
|
])
|
|
3692
3700
|
])
|
|
3693
|
-
], 2)) :
|
|
3701
|
+
], 2)) : X("", !0)
|
|
3694
3702
|
], 2));
|
|
3695
3703
|
}
|
|
3696
3704
|
}), mt = /* @__PURE__ */ le({
|
|
@@ -3706,13 +3714,13 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3706
3714
|
autoFocus: { type: Boolean, default: !1 }
|
|
3707
3715
|
},
|
|
3708
3716
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
3709
|
-
setup(s, { expose:
|
|
3710
|
-
const e = s, a = l, t =
|
|
3717
|
+
setup(s, { expose: k, emit: l }) {
|
|
3718
|
+
const e = s, a = l, t = Ee(
|
|
3711
3719
|
() => import("./index.esm-C9sEwyHF.mjs").then((r) => r.Editor)
|
|
3712
|
-
), f =
|
|
3720
|
+
), f = Ee(
|
|
3713
3721
|
() => import("./index.esm-C9sEwyHF.mjs").then((r) => r.Toolbar)
|
|
3714
3722
|
), m = qe(), y = R(e.modelValue), S = R(!1);
|
|
3715
|
-
|
|
3723
|
+
ge(() => {
|
|
3716
3724
|
S.value = !0;
|
|
3717
3725
|
}), ie(
|
|
3718
3726
|
() => e.modelValue,
|
|
@@ -3720,12 +3728,12 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3720
3728
|
r !== y.value && (y.value = r);
|
|
3721
3729
|
}
|
|
3722
3730
|
);
|
|
3723
|
-
const
|
|
3731
|
+
const D = M(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height })), T = M(() => {
|
|
3724
3732
|
const r = {
|
|
3725
3733
|
excludeKeys: []
|
|
3726
3734
|
};
|
|
3727
3735
|
if (Array.isArray(e.toolbar)) {
|
|
3728
|
-
const
|
|
3736
|
+
const $ = [
|
|
3729
3737
|
"headerSelect",
|
|
3730
3738
|
"header1",
|
|
3731
3739
|
"header2",
|
|
@@ -3780,10 +3788,10 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3780
3788
|
"redo",
|
|
3781
3789
|
"fullScreen"
|
|
3782
3790
|
];
|
|
3783
|
-
r.excludeKeys =
|
|
3791
|
+
r.excludeKeys = $.filter((F) => !e.toolbar.includes(F));
|
|
3784
3792
|
}
|
|
3785
3793
|
return r;
|
|
3786
|
-
}), C =
|
|
3794
|
+
}), C = M(() => ({
|
|
3787
3795
|
placeholder: e.placeholder,
|
|
3788
3796
|
readOnly: e.disabled,
|
|
3789
3797
|
autoFocus: e.autoFocus,
|
|
@@ -3791,30 +3799,30 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3791
3799
|
// 上传图片配置
|
|
3792
3800
|
uploadImage: {
|
|
3793
3801
|
// 自定义上传
|
|
3794
|
-
async customUpload(r,
|
|
3795
|
-
const
|
|
3796
|
-
|
|
3802
|
+
async customUpload(r, $) {
|
|
3803
|
+
const F = URL.createObjectURL(r);
|
|
3804
|
+
$(F, r.name, F);
|
|
3797
3805
|
}
|
|
3798
3806
|
},
|
|
3799
3807
|
// 上传视频配置
|
|
3800
3808
|
uploadVideo: {
|
|
3801
|
-
async customUpload(r,
|
|
3802
|
-
const
|
|
3803
|
-
|
|
3809
|
+
async customUpload(r, $) {
|
|
3810
|
+
const F = URL.createObjectURL(r);
|
|
3811
|
+
$(F, "");
|
|
3804
3812
|
}
|
|
3805
3813
|
}
|
|
3806
3814
|
}
|
|
3807
3815
|
})), z = (r) => {
|
|
3808
3816
|
m.value = r;
|
|
3809
|
-
},
|
|
3810
|
-
const
|
|
3811
|
-
y.value =
|
|
3817
|
+
}, P = (r) => {
|
|
3818
|
+
const $ = r.getHtml();
|
|
3819
|
+
y.value = $, a("update:modelValue", $), a("change", $);
|
|
3812
3820
|
}, b = (r) => {
|
|
3813
3821
|
a("focus", r);
|
|
3814
3822
|
}, H = (r) => {
|
|
3815
3823
|
a("blur", r);
|
|
3816
3824
|
};
|
|
3817
|
-
return
|
|
3825
|
+
return k({
|
|
3818
3826
|
getEditor: () => m.value,
|
|
3819
3827
|
getText: () => {
|
|
3820
3828
|
var r;
|
|
@@ -3830,32 +3838,32 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3830
3838
|
}), je(() => {
|
|
3831
3839
|
const r = m.value;
|
|
3832
3840
|
r && r.destroy();
|
|
3833
|
-
}), (r,
|
|
3841
|
+
}), (r, $) => (i(), c("div", {
|
|
3834
3842
|
class: u(["x-rich-editor", { "is-disabled": s.disabled }])
|
|
3835
3843
|
}, [
|
|
3836
3844
|
S.value ? (i(), c(J, { key: 0 }, [
|
|
3837
|
-
s.toolbar !== !1 ? (i(),
|
|
3845
|
+
s.toolbar !== !1 ? (i(), he(n(f), {
|
|
3838
3846
|
key: 0,
|
|
3839
3847
|
editor: m.value,
|
|
3840
3848
|
"default-config": T.value,
|
|
3841
3849
|
mode: s.mode,
|
|
3842
3850
|
class: "x-rich-editor__toolbar"
|
|
3843
|
-
}, null, 8, ["editor", "default-config", "mode"])) :
|
|
3851
|
+
}, null, 8, ["editor", "default-config", "mode"])) : X("", !0),
|
|
3844
3852
|
Z(n(t), {
|
|
3845
3853
|
modelValue: y.value,
|
|
3846
|
-
"onUpdate:modelValue":
|
|
3854
|
+
"onUpdate:modelValue": $[0] || ($[0] = (F) => y.value = F),
|
|
3847
3855
|
"default-config": C.value,
|
|
3848
3856
|
mode: s.mode,
|
|
3849
|
-
style: te(
|
|
3857
|
+
style: te(D.value),
|
|
3850
3858
|
class: "x-rich-editor__content",
|
|
3851
3859
|
onOnCreated: z,
|
|
3852
|
-
onOnChange:
|
|
3860
|
+
onOnChange: P,
|
|
3853
3861
|
onOnFocus: b,
|
|
3854
3862
|
onOnBlur: H
|
|
3855
3863
|
}, null, 8, ["modelValue", "default-config", "mode", "style"])
|
|
3856
3864
|
], 64)) : (i(), c("div", {
|
|
3857
3865
|
key: 1,
|
|
3858
|
-
style: te(
|
|
3866
|
+
style: te(D.value),
|
|
3859
3867
|
class: "x-rich-editor__placeholder"
|
|
3860
3868
|
}, U(s.placeholder), 5))
|
|
3861
3869
|
], 2));
|
|
@@ -3876,110 +3884,110 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3876
3884
|
separator: { default: " / " }
|
|
3877
3885
|
},
|
|
3878
3886
|
emits: ["update:modelValue", "change"],
|
|
3879
|
-
setup(s, { emit:
|
|
3880
|
-
const l = s, e =
|
|
3887
|
+
setup(s, { emit: k }) {
|
|
3888
|
+
const l = s, e = k, a = ae("cascader"), t = R(!1), f = R([]), m = R([]);
|
|
3881
3889
|
R("");
|
|
3882
3890
|
const y = R(""), S = R();
|
|
3883
|
-
|
|
3891
|
+
M(() => ({
|
|
3884
3892
|
value: l.props.value || "value",
|
|
3885
3893
|
label: l.props.label || "label",
|
|
3886
3894
|
children: l.props.children || "children",
|
|
3887
3895
|
disabled: l.props.disabled || "disabled"
|
|
3888
3896
|
}));
|
|
3889
|
-
const
|
|
3890
|
-
if (
|
|
3891
|
-
return m.value.length === 0 ? "" : m.value.map((
|
|
3897
|
+
const D = M(() => l.props.multiple), T = M(() => l.props.checkStrictly), C = M(() => {
|
|
3898
|
+
if (D.value)
|
|
3899
|
+
return m.value.length === 0 ? "" : m.value.map((w) => b(w)).join(", ");
|
|
3892
3900
|
if (f.value.length === 0) return "";
|
|
3893
3901
|
if (l.showAllLevels)
|
|
3894
|
-
return f.value.map((
|
|
3902
|
+
return f.value.map((w) => H(w, f.value)).join(l.separator);
|
|
3895
3903
|
const p = f.value[f.value.length - 1];
|
|
3896
3904
|
return H(p, f.value);
|
|
3897
|
-
}), z =
|
|
3898
|
-
var
|
|
3905
|
+
}), z = M(() => {
|
|
3906
|
+
var w;
|
|
3899
3907
|
const p = [l.options];
|
|
3900
3908
|
if (f.value.length > 0) {
|
|
3901
|
-
let
|
|
3909
|
+
let x = l.options;
|
|
3902
3910
|
for (const o of f.value) {
|
|
3903
|
-
const v =
|
|
3904
|
-
if ((
|
|
3905
|
-
p.push(v.children),
|
|
3911
|
+
const v = x.find((g) => g.value === o);
|
|
3912
|
+
if ((w = v == null ? void 0 : v.children) != null && w.length)
|
|
3913
|
+
p.push(v.children), x = v.children;
|
|
3906
3914
|
else
|
|
3907
3915
|
break;
|
|
3908
3916
|
}
|
|
3909
3917
|
}
|
|
3910
3918
|
return p;
|
|
3911
|
-
}),
|
|
3919
|
+
}), P = M(() => {
|
|
3912
3920
|
if (!l.filterable || !y.value) return null;
|
|
3913
|
-
const p = [],
|
|
3921
|
+
const p = [], w = (x, o = []) => {
|
|
3914
3922
|
var v;
|
|
3915
|
-
for (const g of
|
|
3916
|
-
const
|
|
3923
|
+
for (const g of x) {
|
|
3924
|
+
const N = [...o, g];
|
|
3917
3925
|
g.label.toLowerCase().includes(y.value.toLowerCase()) && p.push({
|
|
3918
|
-
path:
|
|
3919
|
-
label:
|
|
3920
|
-
}), (v = g.children) != null && v.length &&
|
|
3926
|
+
path: N,
|
|
3927
|
+
label: N.map((ne) => ne.label).join(l.separator)
|
|
3928
|
+
}), (v = g.children) != null && v.length && w(g.children, N);
|
|
3921
3929
|
}
|
|
3922
3930
|
};
|
|
3923
|
-
return
|
|
3924
|
-
}), b = (p) => p.map((
|
|
3925
|
-
let
|
|
3926
|
-
for (let v = 0; v <
|
|
3927
|
-
const g =
|
|
3928
|
-
g != null && g.children && (
|
|
3931
|
+
return w(l.options), p;
|
|
3932
|
+
}), b = (p) => p.map((w, x) => H(w, p.slice(0, x + 1))).join(l.separator), H = (p, w) => {
|
|
3933
|
+
let x = l.options;
|
|
3934
|
+
for (let v = 0; v < w.length - 1; v++) {
|
|
3935
|
+
const g = x.find((N) => N.value === w[v]);
|
|
3936
|
+
g != null && g.children && (x = g.children);
|
|
3929
3937
|
}
|
|
3930
|
-
const o =
|
|
3938
|
+
const o = x.find((v) => v.value === p);
|
|
3931
3939
|
return (o == null ? void 0 : o.label) || String(p);
|
|
3932
|
-
}, L = (p,
|
|
3940
|
+
}, L = (p, w) => {
|
|
3933
3941
|
var o;
|
|
3934
3942
|
if (p.disabled) return;
|
|
3935
|
-
const
|
|
3936
|
-
|
|
3937
|
-
},
|
|
3938
|
-
const o = [...f.value.slice(0,
|
|
3939
|
-
|
|
3940
|
-
}, V = (p,
|
|
3941
|
-
const
|
|
3942
|
-
return m.value.some((o) => JSON.stringify(o) === JSON.stringify(
|
|
3943
|
-
}, h = (p,
|
|
3944
|
-
const
|
|
3945
|
-
e("update:modelValue",
|
|
3946
|
-
},
|
|
3947
|
-
const p = l.props.emitPath !== !1 ? m.value : m.value.map((
|
|
3943
|
+
const x = f.value.slice(0, w);
|
|
3944
|
+
x.push(p.value), f.value = x, (!((o = p.children) != null && o.length) || T.value) && (D.value || (t.value = !1, r(x)));
|
|
3945
|
+
}, A = (p, w, x) => {
|
|
3946
|
+
const o = [...f.value.slice(0, w), p.value];
|
|
3947
|
+
x ? m.value.some((v) => JSON.stringify(v) === JSON.stringify(o)) || m.value.push(o) : m.value = m.value.filter((v) => JSON.stringify(v) !== JSON.stringify(o)), $();
|
|
3948
|
+
}, V = (p, w) => {
|
|
3949
|
+
const x = [...f.value.slice(0, w), p.value];
|
|
3950
|
+
return m.value.some((o) => JSON.stringify(o) === JSON.stringify(x));
|
|
3951
|
+
}, h = (p, w) => f.value[w] === p.value, r = (p) => {
|
|
3952
|
+
const w = l.props.emitPath !== !1 ? p : p[p.length - 1];
|
|
3953
|
+
e("update:modelValue", w), e("change", w);
|
|
3954
|
+
}, $ = () => {
|
|
3955
|
+
const p = l.props.emitPath !== !1 ? m.value : m.value.map((w) => w[w.length - 1]);
|
|
3948
3956
|
e("update:modelValue", p), e("change", p);
|
|
3949
|
-
},
|
|
3950
|
-
f.value = [], m.value = [], e("update:modelValue",
|
|
3951
|
-
},
|
|
3957
|
+
}, F = () => {
|
|
3958
|
+
f.value = [], m.value = [], e("update:modelValue", D.value ? [] : ""), e("change", D.value ? [] : "");
|
|
3959
|
+
}, B = (p) => {
|
|
3952
3960
|
y.value = p.target.value;
|
|
3953
3961
|
}, O = (p) => {
|
|
3954
|
-
f.value = p.map((
|
|
3962
|
+
f.value = p.map((w) => w.value), y.value = "", t.value = !1, r(f.value);
|
|
3955
3963
|
}, j = (p) => {
|
|
3956
3964
|
p.target.closest(`.${a.b()}`) || (t.value = !1);
|
|
3957
3965
|
};
|
|
3958
3966
|
return ie(t, (p) => {
|
|
3959
3967
|
p ? document.addEventListener("click", j) : (document.removeEventListener("click", j), y.value = "");
|
|
3960
3968
|
}), ie(() => l.modelValue, (p) => {
|
|
3961
|
-
|
|
3962
|
-
}, { immediate: !0 }), (p,
|
|
3969
|
+
D.value ? m.value = Array.isArray(p) ? p : [] : Array.isArray(p) ? f.value = p : p !== "" && p !== null && p !== void 0 ? f.value = [p] : f.value = [];
|
|
3970
|
+
}, { immediate: !0 }), (p, w) => (i(), c("div", {
|
|
3963
3971
|
class: u([n(a).b(), n(a).m(s.size), n(a).is("disabled", s.disabled)]),
|
|
3964
|
-
onClick:
|
|
3972
|
+
onClick: w[2] || (w[2] = oe(() => {
|
|
3965
3973
|
}, ["stop"]))
|
|
3966
3974
|
}, [
|
|
3967
3975
|
d("div", {
|
|
3968
3976
|
class: u([n(a).e("input"), n(a).is("focus", t.value)]),
|
|
3969
|
-
onClick:
|
|
3977
|
+
onClick: w[0] || (w[0] = (x) => !s.disabled && (t.value = !0))
|
|
3970
3978
|
}, [
|
|
3971
3979
|
s.filterable && t.value ? (i(), c("input", {
|
|
3972
3980
|
key: 0,
|
|
3973
3981
|
value: y.value,
|
|
3974
3982
|
placeholder: C.value || s.placeholder,
|
|
3975
3983
|
class: u(n(a).e("filter-input")),
|
|
3976
|
-
onInput:
|
|
3984
|
+
onInput: B
|
|
3977
3985
|
}, null, 42, Aa)) : (i(), c("span", {
|
|
3978
3986
|
key: 1,
|
|
3979
3987
|
class: u(n(a).e("text"))
|
|
3980
3988
|
}, [
|
|
3981
3989
|
C.value ? (i(), c(J, { key: 0 }, [
|
|
3982
|
-
|
|
3990
|
+
ce(U(C.value), 1)
|
|
3983
3991
|
], 64)) : (i(), c("span", {
|
|
3984
3992
|
key: 1,
|
|
3985
3993
|
class: u(n(a).e("placeholder"))
|
|
@@ -3988,13 +3996,13 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3988
3996
|
s.clearable && C.value ? (i(), c("span", {
|
|
3989
3997
|
key: 2,
|
|
3990
3998
|
class: u(n(a).e("clear")),
|
|
3991
|
-
onClick: oe(
|
|
3999
|
+
onClick: oe(F, ["stop"])
|
|
3992
4000
|
}, [
|
|
3993
4001
|
Z(n(ee), {
|
|
3994
4002
|
name: "close-circle",
|
|
3995
4003
|
size: 14
|
|
3996
4004
|
})
|
|
3997
|
-
], 2)) :
|
|
4005
|
+
], 2)) : X("", !0),
|
|
3998
4006
|
d("span", {
|
|
3999
4007
|
class: u(n(a).e("arrow"))
|
|
4000
4008
|
}, [
|
|
@@ -4007,30 +4015,30 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4007
4015
|
ue(d("div", {
|
|
4008
4016
|
class: u(n(a).e("dropdown"))
|
|
4009
4017
|
}, [
|
|
4010
|
-
|
|
4018
|
+
P.value ? (i(), c("div", {
|
|
4011
4019
|
key: 0,
|
|
4012
4020
|
class: u(n(a).e("filter-list"))
|
|
4013
4021
|
}, [
|
|
4014
|
-
(i(!0), c(J, null, Q(
|
|
4022
|
+
(i(!0), c(J, null, Q(P.value, (x, o) => (i(), c("div", {
|
|
4015
4023
|
key: o,
|
|
4016
4024
|
class: u(n(a).e("filter-item")),
|
|
4017
|
-
onClick: (v) => O(
|
|
4018
|
-
}, U(
|
|
4019
|
-
|
|
4025
|
+
onClick: (v) => O(x.path)
|
|
4026
|
+
}, U(x.label), 11, Fa))), 128)),
|
|
4027
|
+
P.value.length === 0 ? (i(), c("div", {
|
|
4020
4028
|
key: 0,
|
|
4021
4029
|
class: u(n(a).e("empty"))
|
|
4022
|
-
}, " 无匹配数据 ", 2)) :
|
|
4030
|
+
}, " 无匹配数据 ", 2)) : X("", !0)
|
|
4023
4031
|
], 2)) : (i(), c("div", {
|
|
4024
4032
|
key: 1,
|
|
4025
4033
|
class: u(n(a).e("menu")),
|
|
4026
4034
|
ref_key: "menuRef",
|
|
4027
4035
|
ref: S
|
|
4028
4036
|
}, [
|
|
4029
|
-
(i(!0), c(J, null, Q(z.value, (
|
|
4037
|
+
(i(!0), c(J, null, Q(z.value, (x, o) => (i(), c("div", {
|
|
4030
4038
|
key: o,
|
|
4031
4039
|
class: u(n(a).e("column"))
|
|
4032
4040
|
}, [
|
|
4033
|
-
(i(!0), c(J, null, Q(
|
|
4041
|
+
(i(!0), c(J, null, Q(x, (v) => {
|
|
4034
4042
|
var g;
|
|
4035
4043
|
return i(), c("div", {
|
|
4036
4044
|
key: v.value,
|
|
@@ -4039,20 +4047,20 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4039
4047
|
n(a).is("active", h(v, o)),
|
|
4040
4048
|
n(a).is("disabled", v.disabled)
|
|
4041
4049
|
]),
|
|
4042
|
-
onClick: (
|
|
4050
|
+
onClick: (N) => L(v, o)
|
|
4043
4051
|
}, [
|
|
4044
|
-
|
|
4052
|
+
D.value ? (i(), c("span", {
|
|
4045
4053
|
key: 0,
|
|
4046
4054
|
class: u(n(a).e("checkbox")),
|
|
4047
|
-
onClick:
|
|
4055
|
+
onClick: w[1] || (w[1] = oe(() => {
|
|
4048
4056
|
}, ["stop"]))
|
|
4049
4057
|
}, [
|
|
4050
4058
|
d("input", {
|
|
4051
4059
|
type: "checkbox",
|
|
4052
4060
|
checked: V(v, o),
|
|
4053
|
-
onChange: (
|
|
4061
|
+
onChange: (N) => A(v, o, N.target.checked)
|
|
4054
4062
|
}, null, 40, Pa)
|
|
4055
|
-
], 2)) :
|
|
4063
|
+
], 2)) : X("", !0),
|
|
4056
4064
|
d("span", {
|
|
4057
4065
|
class: u(n(a).e("label"))
|
|
4058
4066
|
}, U(v.label), 3),
|
|
@@ -4064,17 +4072,17 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4064
4072
|
name: "right",
|
|
4065
4073
|
size: 12
|
|
4066
4074
|
})
|
|
4067
|
-
], 2)) :
|
|
4075
|
+
], 2)) : X("", !0)
|
|
4068
4076
|
], 10, Ia);
|
|
4069
4077
|
}), 128))
|
|
4070
4078
|
], 2))), 128))
|
|
4071
4079
|
], 2))
|
|
4072
4080
|
], 2), [
|
|
4073
|
-
[
|
|
4081
|
+
[be, t.value]
|
|
4074
4082
|
])
|
|
4075
4083
|
], 2));
|
|
4076
4084
|
}
|
|
4077
|
-
}),
|
|
4085
|
+
}), Oa = ["onClick"], pt = /* @__PURE__ */ le({
|
|
4078
4086
|
name: "XColorPicker",
|
|
4079
4087
|
__name: "index",
|
|
4080
4088
|
props: {
|
|
@@ -4085,21 +4093,21 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4085
4093
|
size: { default: "default" }
|
|
4086
4094
|
},
|
|
4087
4095
|
emits: ["update:modelValue", "change"],
|
|
4088
|
-
setup(s, { emit:
|
|
4089
|
-
const l = s, e =
|
|
4096
|
+
setup(s, { emit: k }) {
|
|
4097
|
+
const l = s, e = k, a = ae("color-picker"), t = R(!1), f = R(0), m = R(100), y = R(100), S = R(100), D = R(), T = R(), C = M(() => b(f.value, m.value, y.value)), z = M(() => l.showAlpha ? `${C.value}${Math.round(S.value * 2.55).toString(16).padStart(2, "0")}` : C.value), P = M(() => l.modelValue || C.value), b = (B, O, j) => {
|
|
4090
4098
|
O /= 100, j /= 100;
|
|
4091
|
-
const p = j * O,
|
|
4099
|
+
const p = j * O, w = p * (1 - Math.abs(B / 60 % 2 - 1)), x = j - p;
|
|
4092
4100
|
let o = 0, v = 0, g = 0;
|
|
4093
|
-
|
|
4094
|
-
const
|
|
4095
|
-
return `#${
|
|
4096
|
-
}, H = (
|
|
4097
|
-
|
|
4098
|
-
const O = parseInt(
|
|
4101
|
+
B >= 0 && B < 60 ? (o = p, v = w, g = 0) : B >= 60 && B < 120 ? (o = w, v = p, g = 0) : B >= 120 && B < 180 ? (o = 0, v = p, g = w) : B >= 180 && B < 240 ? (o = 0, v = w, g = p) : B >= 240 && B < 300 ? (o = w, v = 0, g = p) : (o = p, v = 0, g = w);
|
|
4102
|
+
const N = (ne) => Math.round((ne + x) * 255).toString(16).padStart(2, "0");
|
|
4103
|
+
return `#${N(o)}${N(v)}${N(g)}`;
|
|
4104
|
+
}, H = (B) => {
|
|
4105
|
+
B = B.replace("#", "");
|
|
4106
|
+
const O = parseInt(B.slice(0, 2), 16) / 255, j = parseInt(B.slice(2, 4), 16) / 255, p = parseInt(B.slice(4, 6), 16) / 255, w = Math.max(O, j, p), x = Math.min(O, j, p), o = w - x;
|
|
4099
4107
|
let v = 0;
|
|
4100
|
-
const g =
|
|
4108
|
+
const g = w === 0 ? 0 : o / w, N = w;
|
|
4101
4109
|
if (o !== 0)
|
|
4102
|
-
switch (
|
|
4110
|
+
switch (w) {
|
|
4103
4111
|
case O:
|
|
4104
4112
|
v = ((j - p) / o + (j < p ? 6 : 0)) * 60;
|
|
4105
4113
|
break;
|
|
@@ -4110,38 +4118,38 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4110
4118
|
v = ((O - j) / o + 4) * 60;
|
|
4111
4119
|
break;
|
|
4112
4120
|
}
|
|
4113
|
-
return { h: v, s: g * 100, v:
|
|
4114
|
-
}, L = (
|
|
4115
|
-
if (
|
|
4116
|
-
const O =
|
|
4121
|
+
return { h: v, s: g * 100, v: N * 100 };
|
|
4122
|
+
}, L = (B) => {
|
|
4123
|
+
if (!D.value) return;
|
|
4124
|
+
const O = D.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - O.left) / O.width)), p = Math.max(0, Math.min(1, (B.clientY - O.top) / O.height));
|
|
4117
4125
|
m.value = Math.round(j * 100), y.value = Math.round((1 - p) * 100);
|
|
4118
|
-
},
|
|
4126
|
+
}, A = (B) => {
|
|
4119
4127
|
if (!T.value) return;
|
|
4120
|
-
const O = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (
|
|
4128
|
+
const O = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - O.left) / O.width));
|
|
4121
4129
|
f.value = Math.round(j * 360);
|
|
4122
|
-
}, V = (
|
|
4130
|
+
}, V = (B) => {
|
|
4123
4131
|
if (!T.value) return;
|
|
4124
|
-
const O = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (
|
|
4132
|
+
const O = T.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (B.clientX - O.left) / O.width));
|
|
4125
4133
|
S.value = Math.round(j * 100);
|
|
4126
|
-
}, h = (
|
|
4127
|
-
const O = H(
|
|
4128
|
-
f.value = O.h, m.value = O.s, y.value = O.v, e("update:modelValue",
|
|
4134
|
+
}, h = (B) => {
|
|
4135
|
+
const O = H(B);
|
|
4136
|
+
f.value = O.h, m.value = O.s, y.value = O.v, e("update:modelValue", B), e("change", B);
|
|
4129
4137
|
}, r = () => {
|
|
4130
4138
|
e("update:modelValue", z.value), e("change", z.value), t.value = !1;
|
|
4131
|
-
},
|
|
4139
|
+
}, $ = () => {
|
|
4132
4140
|
e("update:modelValue", ""), e("change", ""), t.value = !1;
|
|
4133
|
-
},
|
|
4134
|
-
|
|
4141
|
+
}, F = (B) => {
|
|
4142
|
+
B.target.closest(`.${a.b()}`) || (t.value = !1);
|
|
4135
4143
|
};
|
|
4136
|
-
return ie(t, (
|
|
4137
|
-
if (
|
|
4138
|
-
if (document.addEventListener("click",
|
|
4144
|
+
return ie(t, (B) => {
|
|
4145
|
+
if (B) {
|
|
4146
|
+
if (document.addEventListener("click", F), l.modelValue) {
|
|
4139
4147
|
const O = H(l.modelValue.slice(0, 7));
|
|
4140
4148
|
f.value = O.h, m.value = O.s, y.value = O.v, l.showAlpha && l.modelValue.length === 9 && (S.value = Math.round(parseInt(l.modelValue.slice(7, 9), 16) / 2.55));
|
|
4141
4149
|
}
|
|
4142
4150
|
} else
|
|
4143
|
-
document.removeEventListener("click",
|
|
4144
|
-
}), (
|
|
4151
|
+
document.removeEventListener("click", F);
|
|
4152
|
+
}), (B, O) => (i(), c("div", {
|
|
4145
4153
|
class: u([n(a).b(), n(a).m(s.size), n(a).is("disabled", s.disabled)]),
|
|
4146
4154
|
onClick: O[1] || (O[1] = oe(() => {
|
|
4147
4155
|
}, ["stop"]))
|
|
@@ -4152,9 +4160,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4152
4160
|
}, [
|
|
4153
4161
|
d("div", {
|
|
4154
4162
|
class: u(n(a).e("color")),
|
|
4155
|
-
style: te({ backgroundColor:
|
|
4163
|
+
style: te({ backgroundColor: P.value })
|
|
4156
4164
|
}, [
|
|
4157
|
-
|
|
4165
|
+
P.value ? X("", !0) : (i(), he(n(ee), {
|
|
4158
4166
|
key: 0,
|
|
4159
4167
|
name: "close",
|
|
4160
4168
|
size: 12
|
|
@@ -4166,7 +4174,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4166
4174
|
}, [
|
|
4167
4175
|
d("div", {
|
|
4168
4176
|
ref_key: "panelRef",
|
|
4169
|
-
ref:
|
|
4177
|
+
ref: D,
|
|
4170
4178
|
class: u(n(a).e("panel")),
|
|
4171
4179
|
style: te({
|
|
4172
4180
|
backgroundColor: `hsl(${f.value}, 100%, 50%)`
|
|
@@ -4194,7 +4202,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4194
4202
|
ref_key: "sliderRef",
|
|
4195
4203
|
ref: T,
|
|
4196
4204
|
class: u(n(a).e("hue-bar")),
|
|
4197
|
-
onClick:
|
|
4205
|
+
onClick: A
|
|
4198
4206
|
}, [
|
|
4199
4207
|
d("div", {
|
|
4200
4208
|
class: u(n(a).e("hue-thumb")),
|
|
@@ -4218,7 +4226,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4218
4226
|
style: te({ left: `${S.value}%` })
|
|
4219
4227
|
}, null, 6)
|
|
4220
4228
|
], 6)
|
|
4221
|
-
], 2)) :
|
|
4229
|
+
], 2)) : X("", !0),
|
|
4222
4230
|
s.predefine.length ? (i(), c("div", {
|
|
4223
4231
|
key: 1,
|
|
4224
4232
|
class: u(n(a).e("predefine"))
|
|
@@ -4227,9 +4235,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4227
4235
|
key: p,
|
|
4228
4236
|
class: u(n(a).e("predefine-item")),
|
|
4229
4237
|
style: te({ backgroundColor: j }),
|
|
4230
|
-
onClick: (
|
|
4231
|
-
}, null, 14,
|
|
4232
|
-
], 2)) :
|
|
4238
|
+
onClick: (w) => h(j)
|
|
4239
|
+
}, null, 14, Oa))), 128))
|
|
4240
|
+
], 2)) : X("", !0),
|
|
4233
4241
|
d("div", {
|
|
4234
4242
|
class: u(n(a).e("actions"))
|
|
4235
4243
|
}, [
|
|
@@ -4241,7 +4249,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4241
4249
|
}, [
|
|
4242
4250
|
d("button", {
|
|
4243
4251
|
class: u(n(a).e("btn")),
|
|
4244
|
-
onClick:
|
|
4252
|
+
onClick: $
|
|
4245
4253
|
}, "清空", 2),
|
|
4246
4254
|
d("button", {
|
|
4247
4255
|
class: u([n(a).e("btn"), n(a).e("btn--primary")]),
|
|
@@ -4250,11 +4258,11 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4250
4258
|
], 2)
|
|
4251
4259
|
], 2)
|
|
4252
4260
|
], 2), [
|
|
4253
|
-
[
|
|
4261
|
+
[be, t.value]
|
|
4254
4262
|
])
|
|
4255
4263
|
], 2));
|
|
4256
4264
|
}
|
|
4257
|
-
}),
|
|
4265
|
+
}), Ea = ["value", "placeholder", "disabled"], Ya = ["onClick"], gt = /* @__PURE__ */ le({
|
|
4258
4266
|
name: "XAutoComplete",
|
|
4259
4267
|
__name: "index",
|
|
4260
4268
|
props: {
|
|
@@ -4270,12 +4278,12 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4270
4278
|
size: { default: "default" }
|
|
4271
4279
|
},
|
|
4272
4280
|
emits: ["update:modelValue", "select", "clear"],
|
|
4273
|
-
setup(s, { emit:
|
|
4274
|
-
const l = s, e =
|
|
4281
|
+
setup(s, { emit: k }) {
|
|
4282
|
+
const l = s, e = k, a = ae("auto-complete"), t = R(!1), f = R(l.modelValue), m = R([]), y = R(-1), S = R(), D = R(!1);
|
|
4275
4283
|
let T = null;
|
|
4276
4284
|
const C = (V) => {
|
|
4277
|
-
l.fetchSuggestions ? (
|
|
4278
|
-
m.value = h,
|
|
4285
|
+
l.fetchSuggestions ? (D.value = !0, l.fetchSuggestions(V, (h) => {
|
|
4286
|
+
m.value = h, D.value = !1, t.value = h.length > 0;
|
|
4279
4287
|
})) : l.suggestions.length && (m.value = l.suggestions.filter(
|
|
4280
4288
|
(h) => h[l.valueKey].toLowerCase().includes(V.toLowerCase())
|
|
4281
4289
|
), t.value = m.value.length > 0);
|
|
@@ -4284,7 +4292,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4284
4292
|
f.value = h, e("update:modelValue", h), y.value = -1, T && clearTimeout(T), T = setTimeout(() => {
|
|
4285
4293
|
h || l.triggerOnFocus ? C(h) : t.value = !1;
|
|
4286
4294
|
}, l.debounce);
|
|
4287
|
-
},
|
|
4295
|
+
}, P = () => {
|
|
4288
4296
|
l.triggerOnFocus && f.value === "" && C("");
|
|
4289
4297
|
}, b = (V) => {
|
|
4290
4298
|
f.value = V[l.valueKey], e("update:modelValue", f.value), e("select", V), t.value = !1;
|
|
@@ -4310,11 +4318,11 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4310
4318
|
}, L = () => {
|
|
4311
4319
|
var V;
|
|
4312
4320
|
f.value = "", e("update:modelValue", ""), e("clear"), t.value = !1, (V = S.value) == null || V.focus();
|
|
4313
|
-
},
|
|
4321
|
+
}, A = (V) => {
|
|
4314
4322
|
V.target.closest(`.${a.b()}`) || (t.value = !1);
|
|
4315
4323
|
};
|
|
4316
4324
|
return ie(t, (V) => {
|
|
4317
|
-
V ? document.addEventListener("click",
|
|
4325
|
+
V ? document.addEventListener("click", A) : (document.removeEventListener("click", A), y.value = -1);
|
|
4318
4326
|
}), ie(() => l.modelValue, (V) => {
|
|
4319
4327
|
f.value = V;
|
|
4320
4328
|
}), (V, h) => (i(), c("div", {
|
|
@@ -4333,9 +4341,9 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4333
4341
|
disabled: s.disabled,
|
|
4334
4342
|
class: u(n(a).e("inner")),
|
|
4335
4343
|
onInput: z,
|
|
4336
|
-
onFocus:
|
|
4344
|
+
onFocus: P,
|
|
4337
4345
|
onKeydown: H
|
|
4338
|
-
}, null, 42,
|
|
4346
|
+
}, null, 42, Ea),
|
|
4339
4347
|
s.clearable && f.value ? (i(), c("span", {
|
|
4340
4348
|
key: 0,
|
|
4341
4349
|
class: u(n(a).e("clear")),
|
|
@@ -4345,8 +4353,8 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4345
4353
|
name: "close-circle",
|
|
4346
4354
|
size: 14
|
|
4347
4355
|
})
|
|
4348
|
-
], 2)) :
|
|
4349
|
-
|
|
4356
|
+
], 2)) : X("", !0),
|
|
4357
|
+
D.value ? (i(), c("span", {
|
|
4350
4358
|
key: 1,
|
|
4351
4359
|
class: u(n(a).e("loading"))
|
|
4352
4360
|
}, [
|
|
@@ -4354,7 +4362,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4354
4362
|
name: "loading",
|
|
4355
4363
|
size: 14
|
|
4356
4364
|
})
|
|
4357
|
-
], 2)) :
|
|
4365
|
+
], 2)) : X("", !0)
|
|
4358
4366
|
], 2),
|
|
4359
4367
|
ue(d("div", {
|
|
4360
4368
|
class: u(n(a).e("dropdown"))
|
|
@@ -4362,21 +4370,21 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4362
4370
|
d("ul", {
|
|
4363
4371
|
class: u(n(a).e("list"))
|
|
4364
4372
|
}, [
|
|
4365
|
-
(i(!0), c(J, null, Q(m.value, (r,
|
|
4366
|
-
key:
|
|
4373
|
+
(i(!0), c(J, null, Q(m.value, (r, $) => (i(), c("li", {
|
|
4374
|
+
key: $,
|
|
4367
4375
|
class: u([
|
|
4368
4376
|
n(a).e("item"),
|
|
4369
|
-
n(a).is("highlighted",
|
|
4377
|
+
n(a).is("highlighted", $ === y.value)
|
|
4370
4378
|
]),
|
|
4371
|
-
onClick: (
|
|
4379
|
+
onClick: (F) => b(r)
|
|
4372
4380
|
}, [
|
|
4373
4381
|
se(V.$slots, "default", { item: r }, () => [
|
|
4374
|
-
|
|
4382
|
+
ce(U(r[s.valueKey]), 1)
|
|
4375
4383
|
])
|
|
4376
4384
|
], 10, Ya))), 128))
|
|
4377
4385
|
], 2)
|
|
4378
4386
|
], 2), [
|
|
4379
|
-
[
|
|
4387
|
+
[be, t.value && m.value.length]
|
|
4380
4388
|
])
|
|
4381
4389
|
], 2));
|
|
4382
4390
|
}
|
|
@@ -4391,18 +4399,18 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4391
4399
|
size: { default: "default" }
|
|
4392
4400
|
},
|
|
4393
4401
|
emits: ["update:modelValue", "change"],
|
|
4394
|
-
setup(s, { emit:
|
|
4395
|
-
const l = s, e =
|
|
4402
|
+
setup(s, { emit: k }) {
|
|
4403
|
+
const l = s, e = k, a = ae("segmented"), t = R(), f = M(() => l.options.map((D) => typeof D == "string" || typeof D == "number" ? { label: String(D), value: D } : D)), m = M(() => f.value.findIndex((D) => D.value === l.modelValue)), y = M(() => {
|
|
4396
4404
|
if (!t.value || m.value < 0) return {};
|
|
4397
4405
|
const T = t.value.querySelectorAll(`.${a.e("item")}`)[m.value];
|
|
4398
4406
|
return T ? {
|
|
4399
4407
|
width: `${T.offsetWidth}px`,
|
|
4400
4408
|
transform: `translateX(${T.offsetLeft}px)`
|
|
4401
4409
|
} : {};
|
|
4402
|
-
}), S = (
|
|
4403
|
-
l.disabled ||
|
|
4410
|
+
}), S = (D) => {
|
|
4411
|
+
l.disabled || D.disabled || (e("update:modelValue", D.value), e("change", D.value));
|
|
4404
4412
|
};
|
|
4405
|
-
return (
|
|
4413
|
+
return (D, T) => (i(), c("div", {
|
|
4406
4414
|
ref_key: "containerRef",
|
|
4407
4415
|
ref: t,
|
|
4408
4416
|
class: u([
|
|
@@ -4423,10 +4431,10 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4423
4431
|
n(a).is("selected", z === m.value),
|
|
4424
4432
|
n(a).is("disabled", C.disabled)
|
|
4425
4433
|
]),
|
|
4426
|
-
onClick: (
|
|
4434
|
+
onClick: (P) => S(C)
|
|
4427
4435
|
}, [
|
|
4428
|
-
se(
|
|
4429
|
-
|
|
4436
|
+
se(D.$slots, "default", { option: C }, () => [
|
|
4437
|
+
ce(U(C.label), 1)
|
|
4430
4438
|
])
|
|
4431
4439
|
], 10, Ua))), 128))
|
|
4432
4440
|
], 2));
|
|
@@ -4445,24 +4453,24 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4445
4453
|
size: { default: "default" }
|
|
4446
4454
|
},
|
|
4447
4455
|
emits: ["update:modelValue", "select", "change"],
|
|
4448
|
-
setup(s, { emit:
|
|
4449
|
-
const l = s, e =
|
|
4456
|
+
setup(s, { emit: k }) {
|
|
4457
|
+
const l = s, e = k, a = ae("mention"), t = R(l.modelValue), f = R(!1), m = R([]), y = R(-1), S = R(), D = R(), T = R(0), C = R(-1), z = (V) => {
|
|
4450
4458
|
m.value = l.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(V.toLowerCase())), f.value = m.value.length > 0, y.value = -1;
|
|
4451
|
-
},
|
|
4459
|
+
}, P = (V) => {
|
|
4452
4460
|
const h = V.target;
|
|
4453
4461
|
t.value = h.value, T.value = h.selectionStart || 0;
|
|
4454
|
-
const r = t.value.slice(0, T.value),
|
|
4455
|
-
if (
|
|
4456
|
-
const
|
|
4457
|
-
C.value =
|
|
4462
|
+
const r = t.value.slice(0, T.value), $ = r.lastIndexOf(l.prefix);
|
|
4463
|
+
if ($ >= 0) {
|
|
4464
|
+
const F = r.slice($ + l.prefix.length);
|
|
4465
|
+
C.value = $, z(F);
|
|
4458
4466
|
} else
|
|
4459
4467
|
f.value = !1;
|
|
4460
4468
|
e("update:modelValue", t.value), e("change", t.value);
|
|
4461
4469
|
}, b = (V) => {
|
|
4462
|
-
const h = t.value.slice(0, C.value), r = t.value.slice(T.value),
|
|
4463
|
-
t.value = h +
|
|
4464
|
-
const
|
|
4465
|
-
S.value && (S.value.setSelectionRange(
|
|
4470
|
+
const h = t.value.slice(0, C.value), r = t.value.slice(T.value), $ = `${l.prefix}${V.value}${l.split}`;
|
|
4471
|
+
t.value = h + $ + r, e("update:modelValue", t.value), e("select", V, l.prefix), e("change", t.value), f.value = !1, De(() => {
|
|
4472
|
+
const F = h.length + $.length;
|
|
4473
|
+
S.value && (S.value.setSelectionRange(F, F), S.value.focus()), D.value && (D.value.setSelectionRange(F, F), D.value.focus());
|
|
4466
4474
|
});
|
|
4467
4475
|
}, H = (V) => {
|
|
4468
4476
|
if (f.value)
|
|
@@ -4485,11 +4493,11 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4485
4493
|
}
|
|
4486
4494
|
}, L = () => {
|
|
4487
4495
|
t.value = "", e("update:modelValue", ""), e("change", "");
|
|
4488
|
-
},
|
|
4496
|
+
}, A = (V) => {
|
|
4489
4497
|
V.target.closest(`.${a.b()}`) || (f.value = !1);
|
|
4490
4498
|
};
|
|
4491
4499
|
return ie(f, (V) => {
|
|
4492
|
-
V ? document.addEventListener("click",
|
|
4500
|
+
V ? document.addEventListener("click", A) : document.removeEventListener("click", A);
|
|
4493
4501
|
}), ie(() => l.modelValue, (V) => {
|
|
4494
4502
|
t.value = V;
|
|
4495
4503
|
}), (V, h) => (i(), c("div", {
|
|
@@ -4507,7 +4515,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4507
4515
|
placeholder: s.placeholder,
|
|
4508
4516
|
disabled: s.disabled,
|
|
4509
4517
|
class: u(n(a).e("inner")),
|
|
4510
|
-
onInput:
|
|
4518
|
+
onInput: P,
|
|
4511
4519
|
onKeydown: H
|
|
4512
4520
|
}, null, 42, Na),
|
|
4513
4521
|
s.clearable && t.value ? (i(), c("span", {
|
|
@@ -4519,7 +4527,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4519
4527
|
name: "close-circle",
|
|
4520
4528
|
size: 14
|
|
4521
4529
|
})
|
|
4522
|
-
], 2)) :
|
|
4530
|
+
], 2)) : X("", !0)
|
|
4523
4531
|
], 2),
|
|
4524
4532
|
ue(d("div", {
|
|
4525
4533
|
class: u(n(a).e("dropdown"))
|
|
@@ -4527,20 +4535,20 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4527
4535
|
d("ul", {
|
|
4528
4536
|
class: u(n(a).e("list"))
|
|
4529
4537
|
}, [
|
|
4530
|
-
(i(!0), c(J, null, Q(m.value, (r,
|
|
4538
|
+
(i(!0), c(J, null, Q(m.value, (r, $) => (i(), c("li", {
|
|
4531
4539
|
key: r.value,
|
|
4532
4540
|
class: u([
|
|
4533
4541
|
n(a).e("item"),
|
|
4534
|
-
n(a).is("highlighted",
|
|
4542
|
+
n(a).is("highlighted", $ === y.value),
|
|
4535
4543
|
n(a).is("disabled", r.disabled)
|
|
4536
4544
|
]),
|
|
4537
|
-
onClick: (
|
|
4545
|
+
onClick: (F) => b(r)
|
|
4538
4546
|
}, [
|
|
4539
4547
|
r.avatar ? (i(), c("img", {
|
|
4540
4548
|
key: 0,
|
|
4541
4549
|
src: r.avatar,
|
|
4542
4550
|
class: u(n(a).e("avatar"))
|
|
4543
|
-
}, null, 10, Ka)) :
|
|
4551
|
+
}, null, 10, Ka)) : X("", !0),
|
|
4544
4552
|
d("span", {
|
|
4545
4553
|
class: u(n(a).e("label"))
|
|
4546
4554
|
}, U(r.label || r.value), 3),
|
|
@@ -4550,7 +4558,7 @@ const El = ["onClick"], Ol = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4550
4558
|
], 10, Xa))), 128))
|
|
4551
4559
|
], 2)
|
|
4552
4560
|
], 2), [
|
|
4553
|
-
[
|
|
4561
|
+
[be, f.value]
|
|
4554
4562
|
])
|
|
4555
4563
|
], 2));
|
|
4556
4564
|
}
|