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