@xto/form 1.6.2 → 1.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +892 -886
- package/lib/index.cjs +1 -1
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as d, normalizeStyle as te, normalizeClass as u, createElementVNode as r, renderSlot as se, createTextVNode as de, toDisplayString as U, ref as R, useSlots as Le, watch as ie, unref as n, createCommentVNode as N, withDirectives as oe, vModelDynamic as
|
|
2
|
-
import { useNamespace as ae, useZIndex as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as le, computed as V, openBlock as i, createElementBlock as d, normalizeStyle as te, normalizeClass as u, createElementVNode as r, renderSlot as se, createTextVNode as de, toDisplayString as U, ref as R, useSlots as Le, watch as ie, unref as n, createCommentVNode as N, 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 J, renderList as _, createBlock as fe, Teleport as Ie, Transition as Pe, withCtx as He, vModelSelect as Ce, vShow as be, nextTick as ze, defineAsyncComponent as Ue, shallowRef as Ge, onBeforeUnmount as Je } from "vue";
|
|
2
|
+
import { useNamespace as ae, useZIndex as Ee } from "@xto/core";
|
|
3
|
+
const Xe = {
|
|
4
4
|
// 箭头类
|
|
5
5
|
"arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
|
|
6
6
|
"arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
|
|
@@ -201,10 +201,10 @@ const Ue = {
|
|
|
201
201
|
up: "M5 15l7-7 7 7"
|
|
202
202
|
// 上箭头
|
|
203
203
|
};
|
|
204
|
-
function
|
|
205
|
-
return s in
|
|
204
|
+
function Ze(s) {
|
|
205
|
+
return s in Xe;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
207
|
+
const Qe = ["aria-hidden", "aria-label"], _e = ["stroke-width"], el = ["d"], ee = /* @__PURE__ */ le({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -219,17 +219,17 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
219
219
|
width: t.value,
|
|
220
220
|
height: t.value,
|
|
221
221
|
color: a.color
|
|
222
|
-
})),
|
|
222
|
+
})), c = V(() => ({
|
|
223
223
|
strokeWidth: a.strokeWidth
|
|
224
224
|
})), m = V(() => [
|
|
225
225
|
e.b(),
|
|
226
226
|
e.is("spin", a.spin)
|
|
227
|
-
]), b = V(() => a.name &&
|
|
227
|
+
]), b = V(() => a.name && Ze(a.name) ? Xe[a.name] : "");
|
|
228
228
|
return k({
|
|
229
229
|
iconSize: t,
|
|
230
230
|
iconStyle: l,
|
|
231
231
|
iconPath: b
|
|
232
|
-
}), (T,
|
|
232
|
+
}), (T, z) => (i(), d("span", {
|
|
233
233
|
class: u(m.value),
|
|
234
234
|
style: te(l.value),
|
|
235
235
|
"aria-hidden": !s.name,
|
|
@@ -244,16 +244,16 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
244
244
|
"stroke-width": s.strokeWidth,
|
|
245
245
|
"stroke-linecap": "round",
|
|
246
246
|
"stroke-linejoin": "round",
|
|
247
|
-
style: te(
|
|
247
|
+
style: te(c.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
|
-
r("path", { d: b.value }, null, 8,
|
|
251
|
-
], 12,
|
|
250
|
+
r("path", { d: b.value }, null, 8, el)
|
|
251
|
+
], 12, _e)) : se(T.$slots, "default", { key: 1 }, () => [
|
|
252
252
|
de(U(s.name), 1)
|
|
253
253
|
])
|
|
254
|
-
], 14,
|
|
254
|
+
], 14, Qe));
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
256
|
+
}), ll = ["type", "placeholder", "disabled", "readonly", "maxlength", "minlength"], Ja = /* @__PURE__ */ le({
|
|
257
257
|
name: "XInput",
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
@@ -274,20 +274,20 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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"), c = R(), m = R(!1), b = R(!1), T = Le(), z = V(
|
|
278
278
|
() => e.type === "password" && e.showPassword && !e.disabled
|
|
279
|
-
), D = V(() =>
|
|
279
|
+
), D = V(() => z.value ? b.value ? "text" : "password" : e.type);
|
|
280
280
|
V(() => e.modelValue !== void 0), V(() => e.value !== void 0);
|
|
281
281
|
const $ = R("");
|
|
282
282
|
ie(
|
|
283
283
|
[() => e.modelValue, () => e.value],
|
|
284
284
|
([B, F]) => {
|
|
285
|
-
const
|
|
286
|
-
|
|
285
|
+
const Y = B ?? F ?? "";
|
|
286
|
+
Y !== $.value && ($.value = Y);
|
|
287
287
|
},
|
|
288
288
|
{ immediate: !0 }
|
|
289
289
|
);
|
|
290
|
-
const
|
|
290
|
+
const S = (B) => {
|
|
291
291
|
$.value = B, t("update:modelValue", B), t("update:value", B), t("input", B);
|
|
292
292
|
}, I = V(() => String($.value).length), y = V(() => [
|
|
293
293
|
l.b(),
|
|
@@ -295,13 +295,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
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 ||
|
|
298
|
+
l.is("has-suffix", e.suffixIcon || T.suffix || e.clearable || z.value || e.showWordLimit)
|
|
299
299
|
]), L = (B) => {
|
|
300
300
|
const F = B.target.value;
|
|
301
301
|
t("change", F);
|
|
302
302
|
}, H = (B) => {
|
|
303
303
|
m.value = !0, t("focus", B);
|
|
304
|
-
},
|
|
304
|
+
}, E = (B) => {
|
|
305
305
|
m.value = !1, t("blur", B);
|
|
306
306
|
}, M = () => {
|
|
307
307
|
$.value = "", t("update:modelValue", ""), t("update:value", ""), t("clear");
|
|
@@ -311,13 +311,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
311
311
|
return k({
|
|
312
312
|
focus: () => {
|
|
313
313
|
var B;
|
|
314
|
-
(B =
|
|
314
|
+
(B = c.value) == null || B.focus();
|
|
315
315
|
},
|
|
316
316
|
blur: () => {
|
|
317
317
|
var B;
|
|
318
|
-
(B =
|
|
318
|
+
(B = c.value) == null || B.blur();
|
|
319
319
|
},
|
|
320
|
-
inputRef:
|
|
320
|
+
inputRef: c
|
|
321
321
|
}), (B, F) => (i(), d("div", {
|
|
322
322
|
class: u(y.value)
|
|
323
323
|
}, [
|
|
@@ -333,8 +333,8 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
333
333
|
], 2)) : N("", !0),
|
|
334
334
|
oe(r("input", {
|
|
335
335
|
ref_key: "inputRef",
|
|
336
|
-
ref:
|
|
337
|
-
"onUpdate:modelValue": F[0] || (F[0] = (
|
|
336
|
+
ref: c,
|
|
337
|
+
"onUpdate:modelValue": F[0] || (F[0] = (Y) => $.value = Y),
|
|
338
338
|
type: D.value,
|
|
339
339
|
placeholder: s.placeholder,
|
|
340
340
|
disabled: s.disabled,
|
|
@@ -342,14 +342,14 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
342
342
|
maxlength: s.maxlength,
|
|
343
343
|
minlength: s.minlength,
|
|
344
344
|
class: u(n(l).e("inner")),
|
|
345
|
-
onInput: F[1] || (F[1] = (
|
|
345
|
+
onInput: F[1] || (F[1] = (Y) => S(Y.target.value)),
|
|
346
346
|
onChange: L,
|
|
347
347
|
onFocus: H,
|
|
348
|
-
onBlur:
|
|
349
|
-
}, null, 42,
|
|
350
|
-
[
|
|
348
|
+
onBlur: E
|
|
349
|
+
}, null, 42, ll), [
|
|
350
|
+
[qe, $.value]
|
|
351
351
|
]),
|
|
352
|
-
B.$slots.suffix || s.suffixIcon || s.clearable ||
|
|
352
|
+
B.$slots.suffix || s.suffixIcon || s.clearable || z.value || s.showWordLimit ? (i(), d("span", {
|
|
353
353
|
key: 1,
|
|
354
354
|
class: u(n(l).e("suffix"))
|
|
355
355
|
}, [
|
|
@@ -364,7 +364,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
364
364
|
size: 14
|
|
365
365
|
})
|
|
366
366
|
], 2)) : N("", !0),
|
|
367
|
-
|
|
367
|
+
z.value ? (i(), d("span", {
|
|
368
368
|
key: 1,
|
|
369
369
|
class: u([n(l).e("icon"), n(l).e("password")]),
|
|
370
370
|
onClick: h
|
|
@@ -382,7 +382,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
382
382
|
], 2)) : N("", !0)
|
|
383
383
|
], 2));
|
|
384
384
|
}
|
|
385
|
-
}),
|
|
385
|
+
}), al = ["disabled"], tl = ["value", "placeholder", "disabled"], nl = ["disabled"], Za = /* @__PURE__ */ le({
|
|
386
386
|
name: "XInputNumber",
|
|
387
387
|
__name: "index",
|
|
388
388
|
props: {
|
|
@@ -402,7 +402,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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"), c = R(), m = R(!1), b = R(null), T = R(e.modelValue), z = 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 Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 = z.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 S(o) {
|
|
422
422
|
return o > e.max ? e.max : o < e.min ? e.min : o;
|
|
423
423
|
}
|
|
424
|
-
const I = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : I.value === void 0 || I.value === null ? "" : $(I.value)), L = V(() => e.disabled ? !0 : I.value === void 0 ? e.min !== -1 / 0 : I.value <= e.min), H = V(() => e.disabled ? !0 : I.value === void 0 ? e.max !== 1 / 0 : I.value >= e.max),
|
|
424
|
+
const I = V(() => e.modelValue ?? e.value ?? void 0), y = V(() => b.value !== null ? b.value : I.value === void 0 || I.value === null ? "" : $(I.value)), L = V(() => e.disabled ? !0 : I.value === void 0 ? e.min !== -1 / 0 : I.value <= e.min), H = V(() => e.disabled ? !0 : I.value === void 0 ? e.max !== 1 / 0 : I.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,20 +430,20 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
430
430
|
]);
|
|
431
431
|
function M() {
|
|
432
432
|
if (e.disabled || H.value) return;
|
|
433
|
-
const o = I.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o + e.step), g =
|
|
434
|
-
|
|
433
|
+
const o = I.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o + e.step), g = S(f);
|
|
434
|
+
v(g);
|
|
435
435
|
}
|
|
436
436
|
function h() {
|
|
437
437
|
if (e.disabled || L.value) return;
|
|
438
|
-
const o = I.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o - e.step), g =
|
|
439
|
-
|
|
438
|
+
const o = I.value ?? (e.min === -1 / 0 ? 0 : e.min), f = $(o - e.step), g = S(f);
|
|
439
|
+
v(g);
|
|
440
440
|
}
|
|
441
|
-
function
|
|
441
|
+
function v(o) {
|
|
442
442
|
const f = T.value;
|
|
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), X =
|
|
446
|
+
const g = $(o), X = S(g);
|
|
447
447
|
if (e.stepStrictly) {
|
|
448
448
|
const ne = Math.round((X - e.min) / e.step), K = $(e.min + ne * e.step);
|
|
449
449
|
e.modelValue !== void 0 && t("update:modelValue", K), e.value !== void 0 && t("update:value", K), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", K), t("change", K, f);
|
|
@@ -469,11 +469,11 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
469
469
|
function F(o) {
|
|
470
470
|
if (m.value = !1, b.value !== null) {
|
|
471
471
|
const f = x(b.value);
|
|
472
|
-
f === void 0 ? e.valueOnClear !== null ?
|
|
472
|
+
f === void 0 ? e.valueOnClear !== null ? v(e.valueOnClear) : b.value = null : v(f);
|
|
473
473
|
}
|
|
474
474
|
t("blur", o);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function Y(o) {
|
|
477
477
|
m.value = !0, T.value = e.modelValue, t("focus", o);
|
|
478
478
|
}
|
|
479
479
|
function j(o) {
|
|
@@ -487,20 +487,20 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
487
487
|
o.preventDefault(), h();
|
|
488
488
|
break;
|
|
489
489
|
case "Enter":
|
|
490
|
-
(f =
|
|
490
|
+
(f = c.value) == null || f.blur();
|
|
491
491
|
break;
|
|
492
492
|
}
|
|
493
493
|
}
|
|
494
494
|
function p() {
|
|
495
|
-
b.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ?
|
|
495
|
+
b.value = null, e.valueOnClear !== null && e.valueOnClear !== void 0 ? v(e.valueOnClear) : (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, T.value), T.value = void 0);
|
|
496
496
|
}
|
|
497
497
|
function w() {
|
|
498
498
|
var o;
|
|
499
|
-
(o =
|
|
499
|
+
(o = c.value) == null || o.focus();
|
|
500
500
|
}
|
|
501
501
|
function C() {
|
|
502
502
|
var o;
|
|
503
|
-
(o =
|
|
503
|
+
(o = c.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;
|
|
@@ -511,7 +511,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
511
511
|
increase: M,
|
|
512
512
|
decrease: h
|
|
513
513
|
}), (o, f) => (i(), d("div", {
|
|
514
|
-
class: u(
|
|
514
|
+
class: u(E.value)
|
|
515
515
|
}, [
|
|
516
516
|
s.controls ? (i(), d("button", {
|
|
517
517
|
key: 0,
|
|
@@ -519,13 +519,13 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
519
519
|
class: u([n(l).e("decrease"), n(l).is("disabled", L.value)]),
|
|
520
520
|
disabled: L.value,
|
|
521
521
|
onClick: h
|
|
522
|
-
}, " − ", 10,
|
|
522
|
+
}, " − ", 10, al)) : N("", !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: c,
|
|
529
529
|
value: y.value,
|
|
530
530
|
placeholder: s.placeholder,
|
|
531
531
|
disabled: s.disabled,
|
|
@@ -533,10 +533,10 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
533
533
|
type: "text",
|
|
534
534
|
autocomplete: "off",
|
|
535
535
|
onInput: B,
|
|
536
|
-
onFocus:
|
|
536
|
+
onFocus: Y,
|
|
537
537
|
onBlur: F,
|
|
538
538
|
onKeydown: j
|
|
539
|
-
}, null, 42,
|
|
539
|
+
}, null, 42, tl)
|
|
540
540
|
], 2),
|
|
541
541
|
s.controls ? (i(), d("button", {
|
|
542
542
|
key: 1,
|
|
@@ -544,10 +544,10 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
544
544
|
class: u([n(l).e("increase"), n(l).is("disabled", H.value)]),
|
|
545
545
|
disabled: H.value,
|
|
546
546
|
onClick: M
|
|
547
|
-
}, " + ", 10,
|
|
547
|
+
}, " + ", 10, nl)) : N("", !0)
|
|
548
548
|
], 2));
|
|
549
549
|
}
|
|
550
|
-
}),
|
|
550
|
+
}), sl = ["placeholder", "disabled", "readonly", "maxlength", "minlength", "rows"], Qa = /* @__PURE__ */ le({
|
|
551
551
|
name: "XTextarea",
|
|
552
552
|
__name: "index",
|
|
553
553
|
props: {
|
|
@@ -565,32 +565,32 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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"), c = R(), m = R(!1), b = R("");
|
|
569
569
|
ie(
|
|
570
570
|
[() => e.modelValue, () => e.value],
|
|
571
571
|
([M, h]) => {
|
|
572
|
-
const
|
|
573
|
-
|
|
572
|
+
const v = M ?? h ?? "";
|
|
573
|
+
v !== b.value && (b.value = v);
|
|
574
574
|
},
|
|
575
575
|
{ immediate: !0 }
|
|
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
|
+
}, z = 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
|
-
const h = e.autosize.minRows || 1,
|
|
583
|
-
M.minHeight = `${h * 22 + 12}px`,
|
|
582
|
+
const h = e.autosize.minRows || 1, v = e.autosize.maxRows;
|
|
583
|
+
M.minHeight = `${h * 22 + 12}px`, v && (M.maxHeight = `${v * 22 + 12}px`);
|
|
584
584
|
}
|
|
585
585
|
return M;
|
|
586
586
|
}), $ = V(() => [
|
|
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 && z.value > e.maxlength)
|
|
591
|
+
]), S = (M) => {
|
|
592
592
|
const h = M.target.value;
|
|
593
|
-
T(h), e.autosize &&
|
|
593
|
+
T(h), e.autosize && c.value && (c.value.style.height = "auto", c.value.style.height = `${c.value.scrollHeight}px`);
|
|
594
594
|
}, I = (M) => {
|
|
595
595
|
const h = M.target.value;
|
|
596
596
|
t("change", h);
|
|
@@ -602,21 +602,21 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
602
602
|
return k({
|
|
603
603
|
focus: () => {
|
|
604
604
|
var M;
|
|
605
|
-
(M =
|
|
605
|
+
(M = c.value) == null || M.focus();
|
|
606
606
|
},
|
|
607
607
|
blur: () => {
|
|
608
608
|
var M;
|
|
609
|
-
(M =
|
|
609
|
+
(M = c.value) == null || M.blur();
|
|
610
610
|
},
|
|
611
|
-
textareaRef:
|
|
611
|
+
textareaRef: c
|
|
612
612
|
}), (M, h) => (i(), d("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:
|
|
619
|
-
"onUpdate:modelValue": h[0] || (h[0] = (
|
|
618
|
+
ref: c,
|
|
619
|
+
"onUpdate:modelValue": h[0] || (h[0] = (v) => b.value = v),
|
|
620
620
|
placeholder: s.placeholder,
|
|
621
621
|
disabled: s.disabled,
|
|
622
622
|
readonly: s.readonly,
|
|
@@ -625,20 +625,20 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
625
625
|
rows: s.rows,
|
|
626
626
|
style: te(D.value),
|
|
627
627
|
class: u(n(l).e("inner")),
|
|
628
|
-
onInput:
|
|
628
|
+
onInput: S,
|
|
629
629
|
onChange: I,
|
|
630
630
|
onFocus: y,
|
|
631
631
|
onBlur: L
|
|
632
|
-
}, null, 46,
|
|
633
|
-
[
|
|
632
|
+
}, null, 46, sl), [
|
|
633
|
+
[Ve, b.value]
|
|
634
634
|
]),
|
|
635
635
|
s.showWordLimit && s.maxlength ? (i(), d("span", {
|
|
636
636
|
key: 0,
|
|
637
637
|
class: u(n(l).e("count"))
|
|
638
|
-
}, U(
|
|
638
|
+
}, U(z.value) + "/" + U(s.maxlength), 3)) : N("", !0)
|
|
639
639
|
], 6));
|
|
640
640
|
}
|
|
641
|
-
}),
|
|
641
|
+
}), _a = /* @__PURE__ */ le({
|
|
642
642
|
name: "XSwitch",
|
|
643
643
|
__name: "index",
|
|
644
644
|
props: {
|
|
@@ -653,20 +653,20 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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), c = 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", c.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: c.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 z = c.value ? a.inactiveValue : a.activeValue;
|
|
667
|
+
a.modelValue !== void 0 && e("update:modelValue", z), a.checked !== void 0 && e("update:checked", z), a.modelValue === void 0 && a.checked === void 0 && e("update:modelValue", z), e("change", z);
|
|
668
668
|
};
|
|
669
|
-
return (
|
|
669
|
+
return (z, D) => (i(), d("span", {
|
|
670
670
|
class: u(m.value),
|
|
671
671
|
onClick: T
|
|
672
672
|
}, [
|
|
@@ -674,15 +674,15 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
674
674
|
class: u(n(t).e("core")),
|
|
675
675
|
style: te(b.value)
|
|
676
676
|
}, null, 6),
|
|
677
|
-
|
|
677
|
+
z.$slots.default ? (i(), d("span", {
|
|
678
678
|
key: 0,
|
|
679
679
|
class: u(n(t).e("text"))
|
|
680
680
|
}, [
|
|
681
|
-
se(
|
|
681
|
+
se(z.$slots, "default")
|
|
682
682
|
], 2)) : N("", !0)
|
|
683
683
|
], 2));
|
|
684
684
|
}
|
|
685
|
-
}),
|
|
685
|
+
}), ul = ["checked", "disabled", "name", "value"], et = /* @__PURE__ */ le({
|
|
686
686
|
name: "XRadio",
|
|
687
687
|
__name: "index",
|
|
688
688
|
props: {
|
|
@@ -694,16 +694,16 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 =
|
|
697
|
+
const a = s, e = k, t = ae("radio"), l = xe("radioGroup", null), c = V(() => !!l), m = V(() => c.value ? l.modelValue.value : a.modelValue), b = V(() => a.value ?? a.label), T = V(() => m.value === b.value), z = V(() => a.disabled || c.value && l.disabled), D = V(() => a.name || (c.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", z.value)
|
|
701
|
+
]), S = () => {
|
|
702
|
+
z.value || (c.value ? l.changeValue(b.value) : (e("update:modelValue", b.value), e("change", b.value)));
|
|
703
703
|
};
|
|
704
704
|
return (I, y) => (i(), d("label", {
|
|
705
705
|
class: u($.value),
|
|
706
|
-
onClick: ue(
|
|
706
|
+
onClick: ue(S, ["prevent"])
|
|
707
707
|
}, [
|
|
708
708
|
r("span", {
|
|
709
709
|
class: u(n(t).e("input"))
|
|
@@ -711,10 +711,10 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
711
711
|
r("input", {
|
|
712
712
|
type: "radio",
|
|
713
713
|
checked: T.value,
|
|
714
|
-
disabled:
|
|
714
|
+
disabled: z.value,
|
|
715
715
|
name: D.value,
|
|
716
716
|
value: b.value
|
|
717
|
-
}, null, 8,
|
|
717
|
+
}, null, 8, ul)
|
|
718
718
|
], 2),
|
|
719
719
|
I.$slots.default || s.label ? (i(), d("span", {
|
|
720
720
|
key: 0,
|
|
@@ -726,7 +726,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
726
726
|
], 2)) : N("", !0)
|
|
727
727
|
], 2));
|
|
728
728
|
}
|
|
729
|
-
}),
|
|
729
|
+
}), lt = /* @__PURE__ */ le({
|
|
730
730
|
name: "XRadioGroup",
|
|
731
731
|
__name: "group",
|
|
732
732
|
props: {
|
|
@@ -737,22 +737,22 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 = (c) => {
|
|
741
|
+
a.modelValue !== void 0 && e("update:modelValue", c), a.value !== void 0 && e("update:value", c), a.modelValue === void 0 && a.value === void 0 && e("update:modelValue", c), e("change", c);
|
|
742
742
|
};
|
|
743
|
-
return
|
|
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
|
+
}), (c, m) => (i(), d("div", {
|
|
749
749
|
class: u(n(t).b()),
|
|
750
750
|
role: "radiogroup"
|
|
751
751
|
}, [
|
|
752
|
-
se(
|
|
752
|
+
se(c.$slots, "default")
|
|
753
753
|
], 2));
|
|
754
754
|
}
|
|
755
|
-
}),
|
|
755
|
+
}), ol = ["checked", "disabled", "value"], at = /* @__PURE__ */ le({
|
|
756
756
|
name: "XRadioButton",
|
|
757
757
|
__name: "button",
|
|
758
758
|
props: {
|
|
@@ -763,15 +763,15 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 =
|
|
766
|
+
const a = s, e = ae("radio-button"), t = xe("radioGroup", null), l = V(() => !!t), c = V(() => l.value ? t.modelValue.value : null), m = V(() => a.value ?? a.label), b = V(() => c.value === m.value), T = V(() => a.disabled || l.value && t.disabled), z = 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 ($, S) => (i(), d("label", {
|
|
774
|
+
class: u(z.value),
|
|
775
775
|
onClick: ue(D, ["prevent"])
|
|
776
776
|
}, [
|
|
777
777
|
r("input", {
|
|
@@ -780,7 +780,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
780
780
|
disabled: T.value,
|
|
781
781
|
value: m.value,
|
|
782
782
|
class: u(n(e).e("input"))
|
|
783
|
-
}, null, 10,
|
|
783
|
+
}, null, 10, ol),
|
|
784
784
|
r("span", {
|
|
785
785
|
class: u(n(e).e("inner"))
|
|
786
786
|
}, [
|
|
@@ -790,7 +790,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
790
790
|
], 2)
|
|
791
791
|
], 2));
|
|
792
792
|
}
|
|
793
|
-
}),
|
|
793
|
+
}), il = ["checked", "disabled", "name", "value"], tt = /* @__PURE__ */ le({
|
|
794
794
|
name: "XCheckbox",
|
|
795
795
|
__name: "index",
|
|
796
796
|
props: {
|
|
@@ -803,34 +803,34 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 =
|
|
806
|
+
const a = s, e = k, t = ae("checkbox"), l = xe("checkboxGroup", null), c = V(() => !!l), m = V(() => a.value ?? a.label), b = V(() => c.value ? l.modelValue.value.includes(m.value) : Array.isArray(a.modelValue) ? a.modelValue.includes(m.value) : !!a.modelValue), T = V(() => {
|
|
807
807
|
if (a.disabled) return !0;
|
|
808
|
-
if (
|
|
809
|
-
const $ = l.disabled,
|
|
810
|
-
return b.value &&
|
|
808
|
+
if (c.value) {
|
|
809
|
+
const $ = l.disabled, S = l.min > 0 && l.modelValue.value.length <= l.min, I = l.max > 0 && l.modelValue.value.length >= l.max;
|
|
810
|
+
return b.value && S || !b.value && I ? !0 : $;
|
|
811
811
|
}
|
|
812
812
|
return !1;
|
|
813
|
-
}),
|
|
813
|
+
}), z = 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 (c.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 S = a.modelValue.indexOf(m.value);
|
|
826
|
+
S > -1 ? $ = [...a.modelValue.slice(0, S), ...a.modelValue.slice(S + 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 ($, S) => (i(), d("label", {
|
|
833
|
+
class: u(z.value),
|
|
834
834
|
onClick: ue(D, ["prevent"])
|
|
835
835
|
}, [
|
|
836
836
|
r("span", {
|
|
@@ -842,7 +842,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
842
842
|
disabled: T.value,
|
|
843
843
|
name: s.name,
|
|
844
844
|
value: m.value
|
|
845
|
-
}, null, 8,
|
|
845
|
+
}, null, 8, il)
|
|
846
846
|
], 2),
|
|
847
847
|
$.$slots.default || s.label !== void 0 ? (i(), d("span", {
|
|
848
848
|
key: 0,
|
|
@@ -854,7 +854,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
854
854
|
], 2)) : N("", !0)
|
|
855
855
|
], 2));
|
|
856
856
|
}
|
|
857
|
-
}),
|
|
857
|
+
}), nt = /* @__PURE__ */ le({
|
|
858
858
|
name: "XCheckboxGroup",
|
|
859
859
|
__name: "group",
|
|
860
860
|
props: {
|
|
@@ -865,24 +865,24 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 = (c) => {
|
|
869
|
+
const m = [...a.modelValue], b = m.indexOf(c);
|
|
870
|
+
b > -1 ? m.splice(b, 1) : m.push(c), e("update:modelValue", m), e("change", m);
|
|
871
871
|
};
|
|
872
|
-
return
|
|
872
|
+
return $e("checkboxGroup", {
|
|
873
873
|
modelValue: V(() => a.modelValue),
|
|
874
874
|
disabled: a.disabled,
|
|
875
875
|
min: a.min,
|
|
876
876
|
max: a.max,
|
|
877
877
|
changeValue: l
|
|
878
|
-
}), (
|
|
878
|
+
}), (c, m) => (i(), d("div", {
|
|
879
879
|
class: u(n(t).b()),
|
|
880
880
|
role: "group"
|
|
881
881
|
}, [
|
|
882
|
-
se(
|
|
882
|
+
se(c.$slots, "default")
|
|
883
883
|
], 2));
|
|
884
884
|
}
|
|
885
|
-
}),
|
|
885
|
+
}), st = /* @__PURE__ */ le({
|
|
886
886
|
name: "XForm",
|
|
887
887
|
__name: "index",
|
|
888
888
|
props: {
|
|
@@ -897,71 +897,71 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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"), c = R([]), 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
|
+
]), z = V(() => ({ width: typeof e.labelWidth == "number" ? `${e.labelWidth}px` : e.labelWidth })), D = (h) => {
|
|
906
|
+
c.value.push(h);
|
|
907
907
|
}, $ = (h) => {
|
|
908
|
-
const
|
|
909
|
-
|
|
910
|
-
},
|
|
908
|
+
const v = c.value.indexOf(h);
|
|
909
|
+
v > -1 && c.value.splice(v, 1);
|
|
910
|
+
}, S = async () => {
|
|
911
911
|
let h = !0;
|
|
912
|
-
for (const
|
|
913
|
-
await
|
|
912
|
+
for (const v of c.value)
|
|
913
|
+
await v.validate() || (h = !1);
|
|
914
914
|
return h;
|
|
915
915
|
}, I = async (h) => {
|
|
916
|
-
const
|
|
916
|
+
const v = Array.isArray(h) ? h : [h];
|
|
917
917
|
let x = !0;
|
|
918
|
-
for (const B of
|
|
919
|
-
|
|
918
|
+
for (const B of c.value)
|
|
919
|
+
v.includes(B.prop) && (await B.validate() || (x = !1));
|
|
920
920
|
return x;
|
|
921
921
|
}, y = () => {
|
|
922
|
-
|
|
922
|
+
c.value.forEach((h) => {
|
|
923
923
|
h.resetField();
|
|
924
924
|
});
|
|
925
925
|
}, L = (h) => {
|
|
926
926
|
if (h) {
|
|
927
|
-
const
|
|
928
|
-
|
|
929
|
-
|
|
927
|
+
const v = Array.isArray(h) ? h : [h];
|
|
928
|
+
c.value.forEach((x) => {
|
|
929
|
+
v.includes(x.prop) && x.clearValidate();
|
|
930
930
|
});
|
|
931
931
|
} else
|
|
932
|
-
|
|
933
|
-
|
|
932
|
+
c.value.forEach((v) => {
|
|
933
|
+
v.clearValidate();
|
|
934
934
|
});
|
|
935
935
|
}, H = (h) => {
|
|
936
936
|
console.log("[XForm] handleSubmit triggered", h), h.preventDefault(), t("submit");
|
|
937
|
-
},
|
|
937
|
+
}, E = (h) => {
|
|
938
938
|
console.log("[XForm] handleReset triggered", h), h.preventDefault(), y(), t("reset");
|
|
939
|
-
}, M =
|
|
940
|
-
return
|
|
939
|
+
}, M = je(e, "model");
|
|
940
|
+
return $e("form", {
|
|
941
941
|
model: M,
|
|
942
942
|
rules: e.rules,
|
|
943
943
|
labelWidth: e.labelWidth,
|
|
944
944
|
labelPosition: b.value ? "top" : e.labelPosition,
|
|
945
945
|
disabled: e.disabled,
|
|
946
946
|
size: e.size,
|
|
947
|
-
labelStyle:
|
|
947
|
+
labelStyle: z,
|
|
948
948
|
addField: D,
|
|
949
949
|
removeField: $,
|
|
950
950
|
emit: t
|
|
951
951
|
}), k({
|
|
952
|
-
validate:
|
|
952
|
+
validate: S,
|
|
953
953
|
validateField: I,
|
|
954
954
|
resetFields: y,
|
|
955
955
|
clearValidate: L
|
|
956
|
-
}), (h,
|
|
956
|
+
}), (h, v) => (i(), d("form", {
|
|
957
957
|
class: u(T.value),
|
|
958
958
|
onSubmit: H,
|
|
959
|
-
onReset:
|
|
959
|
+
onReset: E
|
|
960
960
|
}, [
|
|
961
961
|
se(h.$slots, "default")
|
|
962
962
|
], 34));
|
|
963
963
|
}
|
|
964
|
-
}),
|
|
964
|
+
}), ut = /* @__PURE__ */ le({
|
|
965
965
|
name: "XFormItem",
|
|
966
966
|
__name: "item",
|
|
967
967
|
props: {
|
|
@@ -973,89 +973,89 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["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 =
|
|
976
|
+
const a = s, e = Le(), t = ae("form-item"), l = xe("form", null), c = R(""), m = R(""), 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
|
+
}, z = () => {
|
|
980
980
|
var H;
|
|
981
981
|
if (!(!l || !a.prop))
|
|
982
982
|
return (H = l.model.value) == null ? void 0 : H[a.prop];
|
|
983
983
|
}, D = (H) => {
|
|
984
984
|
!l || !a.prop || l.model.value && (l.model.value[a.prop] = H);
|
|
985
985
|
}, $ = async (H) => {
|
|
986
|
-
const
|
|
987
|
-
if (
|
|
988
|
-
return
|
|
989
|
-
const M =
|
|
990
|
-
let h = !0,
|
|
991
|
-
for (const x of
|
|
986
|
+
const E = T();
|
|
987
|
+
if (E.length === 0)
|
|
988
|
+
return c.value = "valid", !0;
|
|
989
|
+
const M = z();
|
|
990
|
+
let h = !0, v = "";
|
|
991
|
+
for (const x of E)
|
|
992
992
|
if (!(H && x.trigger && x.trigger !== H)) {
|
|
993
993
|
if (x.required && (M == null || M === "" || Array.isArray(M) && M.length === 0)) {
|
|
994
|
-
h = !1,
|
|
994
|
+
h = !1, v = x.message || "该字段为必填项";
|
|
995
995
|
break;
|
|
996
996
|
}
|
|
997
997
|
if (x.min !== void 0 || x.max !== void 0) {
|
|
998
998
|
const B = typeof M == "string" ? M.length : 0;
|
|
999
999
|
if (x.min !== void 0 && B < x.min) {
|
|
1000
|
-
h = !1,
|
|
1000
|
+
h = !1, v = x.message || `长度不能小于 ${x.min} 个字符`;
|
|
1001
1001
|
break;
|
|
1002
1002
|
}
|
|
1003
1003
|
if (x.max !== void 0 && B > x.max) {
|
|
1004
|
-
h = !1,
|
|
1004
|
+
h = !1, v = x.message || `长度不能大于 ${x.max} 个字符`;
|
|
1005
1005
|
break;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
1008
|
if (x.pattern && M && !x.pattern.test(M)) {
|
|
1009
|
-
h = !1,
|
|
1009
|
+
h = !1, v = x.message || "格式不正确";
|
|
1010
1010
|
break;
|
|
1011
1011
|
}
|
|
1012
1012
|
if (x.validator)
|
|
1013
1013
|
try {
|
|
1014
1014
|
await new Promise((B, F) => {
|
|
1015
|
-
x.validator(x, M, (
|
|
1016
|
-
|
|
1015
|
+
x.validator(x, M, (Y) => {
|
|
1016
|
+
Y ? F(Y) : B();
|
|
1017
1017
|
});
|
|
1018
1018
|
});
|
|
1019
1019
|
} catch (B) {
|
|
1020
|
-
h = !1,
|
|
1020
|
+
h = !1, v = B.message || x.message || "验证失败";
|
|
1021
1021
|
break;
|
|
1022
1022
|
}
|
|
1023
1023
|
}
|
|
1024
|
-
return
|
|
1025
|
-
},
|
|
1024
|
+
return c.value = h ? "valid" : "invalid", m.value = v, l && a.prop && l.emit("validate", a.prop, h, v), h;
|
|
1025
|
+
}, S = () => {
|
|
1026
1026
|
D(void 0), I();
|
|
1027
1027
|
}, I = () => {
|
|
1028
|
-
|
|
1028
|
+
c.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",
|
|
1032
|
+
t.is("error", c.value === "invalid"),
|
|
1033
|
+
t.is("success", c.value === "valid")
|
|
1034
1034
|
]), L = 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
|
-
|
|
1040
|
-
}),
|
|
1038
|
+
return ie(() => z(), () => {
|
|
1039
|
+
c.value === "invalid" && $("change");
|
|
1040
|
+
}), ge(() => {
|
|
1041
1041
|
l && a.prop && l.addField({
|
|
1042
1042
|
prop: a.prop,
|
|
1043
1043
|
validate: $,
|
|
1044
|
-
resetField:
|
|
1044
|
+
resetField: S,
|
|
1045
1045
|
clearValidate: I
|
|
1046
1046
|
});
|
|
1047
|
-
}),
|
|
1047
|
+
}), De(() => {
|
|
1048
1048
|
l && a.prop && l.removeField({
|
|
1049
1049
|
prop: a.prop,
|
|
1050
1050
|
validate: $,
|
|
1051
|
-
resetField:
|
|
1051
|
+
resetField: S,
|
|
1052
1052
|
clearValidate: I
|
|
1053
1053
|
});
|
|
1054
1054
|
}), k({
|
|
1055
1055
|
validate: $,
|
|
1056
|
-
resetField:
|
|
1056
|
+
resetField: S,
|
|
1057
1057
|
clearValidate: I
|
|
1058
|
-
}), (H,
|
|
1058
|
+
}), (H, E) => (i(), d("div", {
|
|
1059
1059
|
class: u(y.value)
|
|
1060
1060
|
}, [
|
|
1061
1061
|
s.label || n(e).label ? (i(), d("label", {
|
|
@@ -1071,7 +1071,7 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
1071
1071
|
class: u(n(t).e("content"))
|
|
1072
1072
|
}, [
|
|
1073
1073
|
se(H.$slots, "default"),
|
|
1074
|
-
s.showMessage !== !1 &&
|
|
1074
|
+
s.showMessage !== !1 && c.value === "invalid" ? (i(), d("div", {
|
|
1075
1075
|
key: 0,
|
|
1076
1076
|
class: u(n(t).e("error"))
|
|
1077
1077
|
}, U(m.value), 3)) : N("", !0)
|
|
@@ -1079,37 +1079,37 @@ const Je = ["aria-hidden", "aria-label"], Ze = ["stroke-width"], Qe = ["d"], ee
|
|
|
1079
1079
|
], 2));
|
|
1080
1080
|
}
|
|
1081
1081
|
});
|
|
1082
|
-
function
|
|
1082
|
+
function rl(s, k) {
|
|
1083
1083
|
return new Date(s, k + 1, 0).getDate();
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function dl(s, k) {
|
|
1086
1086
|
return new Date(s, k, 1).getDay();
|
|
1087
1087
|
}
|
|
1088
|
-
function
|
|
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 cl(s, k) {
|
|
1092
1092
|
return !s || !k ? !1 : s.getFullYear() === k.getFullYear() && s.getMonth() === k.getMonth();
|
|
1093
1093
|
}
|
|
1094
|
-
function
|
|
1094
|
+
function Ne(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
|
-
function
|
|
1100
|
-
const e = [], t =
|
|
1101
|
-
let
|
|
1099
|
+
function vl(s, k, a = 0) {
|
|
1100
|
+
const e = [], t = rl(s, k), l = dl(s, k);
|
|
1101
|
+
let c = new Date(s, k, 1);
|
|
1102
1102
|
const m = (l - a + 7) % 7;
|
|
1103
|
-
|
|
1104
|
-
let b = [], T = new Date(
|
|
1103
|
+
c.setDate(1 - m);
|
|
1104
|
+
let b = [], T = new Date(c);
|
|
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
1109
|
function ce(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(), c = 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(c).padStart(2, "0")).replace(/m/g, String(c)).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;
|
|
@@ -1125,23 +1125,23 @@ function ve(s) {
|
|
|
1125
1125
|
}
|
|
1126
1126
|
return k;
|
|
1127
1127
|
}
|
|
1128
|
-
function
|
|
1128
|
+
function fl(s) {
|
|
1129
1129
|
const k = new Date(s);
|
|
1130
1130
|
return k.setMonth(k.getMonth() - 1), k;
|
|
1131
1131
|
}
|
|
1132
|
-
function
|
|
1132
|
+
function ml(s) {
|
|
1133
1133
|
const k = new Date(s);
|
|
1134
1134
|
return k.setMonth(k.getMonth() + 1), k;
|
|
1135
1135
|
}
|
|
1136
|
-
function
|
|
1136
|
+
function hl(s) {
|
|
1137
1137
|
const k = new Date(s);
|
|
1138
1138
|
return k.setFullYear(k.getFullYear() - 1), k;
|
|
1139
1139
|
}
|
|
1140
|
-
function
|
|
1140
|
+
function pl(s) {
|
|
1141
1141
|
const k = new Date(s);
|
|
1142
1142
|
return k.setFullYear(k.getFullYear() + 1), k;
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function Ke(s) {
|
|
1145
1145
|
const k = Math.floor(s / 10) * 10;
|
|
1146
1146
|
return [k, k + 9];
|
|
1147
1147
|
}
|
|
@@ -1149,13 +1149,13 @@ function Be(s) {
|
|
|
1149
1149
|
const k = new Date(s);
|
|
1150
1150
|
return k.setHours(0, 0, 0, 0), k;
|
|
1151
1151
|
}
|
|
1152
|
-
function
|
|
1152
|
+
function gl(s, k, a, e) {
|
|
1153
1153
|
if (k && k(s))
|
|
1154
1154
|
return !0;
|
|
1155
1155
|
const t = Be(s).getTime();
|
|
1156
1156
|
return !!(a && t < Be(a).getTime() || e && t > Be(e).getTime());
|
|
1157
1157
|
}
|
|
1158
|
-
const
|
|
1158
|
+
const bl = [
|
|
1159
1159
|
"一月",
|
|
1160
1160
|
"二月",
|
|
1161
1161
|
"三月",
|
|
@@ -1168,7 +1168,7 @@ const pl = [
|
|
|
1168
1168
|
"十月",
|
|
1169
1169
|
"十一月",
|
|
1170
1170
|
"十二月"
|
|
1171
|
-
],
|
|
1171
|
+
], yl = ["日", "一", "二", "三", "四", "五", "六"], kl = ["onClick", "onMouseenter"], Ml = /* @__PURE__ */ le({
|
|
1172
1172
|
name: "XDateTable",
|
|
1173
1173
|
__name: "DateTable",
|
|
1174
1174
|
props: {
|
|
@@ -1186,55 +1186,55 @@ const pl = [
|
|
|
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 = R(null),
|
|
1189
|
+
const a = s, e = k, t = ae("date-table"), l = R(null), c = V(() => a.viewedMonth.getFullYear()), m = V(() => a.viewedMonth.getMonth()), b = V(() => vl(c.value, m.value, 0)), T = (h) => a.modelValue ? pe(h, a.modelValue) : !1, z = (h) => pe(h, /* @__PURE__ */ new Date()), D = (h) => cl(h, a.viewedMonth), $ = (h) => {
|
|
1190
1190
|
if (a.selectionMode !== "range") return !1;
|
|
1191
|
-
const { startDate:
|
|
1192
|
-
if (B &&
|
|
1191
|
+
const { startDate: v, endDate: x, selecting: B } = a.rangeState || {};
|
|
1192
|
+
if (B && v) {
|
|
1193
1193
|
const F = l.value;
|
|
1194
1194
|
if (F) {
|
|
1195
|
-
const
|
|
1196
|
-
return
|
|
1195
|
+
const Y = v < F ? v : F, j = v < F ? F : v;
|
|
1196
|
+
return Ne(h, Y, j);
|
|
1197
1197
|
}
|
|
1198
|
-
return
|
|
1198
|
+
return pe(h, v);
|
|
1199
1199
|
}
|
|
1200
|
-
return
|
|
1201
|
-
},
|
|
1200
|
+
return v && x ? Ne(h, v, x) : !1;
|
|
1201
|
+
}, S = (h) => {
|
|
1202
1202
|
if (a.selectionMode !== "range") return !1;
|
|
1203
|
-
const { startDate:
|
|
1204
|
-
return x &&
|
|
1203
|
+
const { startDate: v, selecting: x } = a.rangeState || {};
|
|
1204
|
+
return x && v && l.value ? pe(h, v < l.value ? v : l.value) : v ? pe(h, v) : !1;
|
|
1205
1205
|
}, I = (h) => {
|
|
1206
1206
|
if (a.selectionMode !== "range") return !1;
|
|
1207
|
-
const { endDate:
|
|
1207
|
+
const { endDate: v, selecting: x } = a.rangeState || {};
|
|
1208
1208
|
if (x && l.value) {
|
|
1209
1209
|
const { startDate: B } = a.rangeState || {};
|
|
1210
|
-
return
|
|
1210
|
+
return pe(h, B < l.value ? l.value : B);
|
|
1211
1211
|
}
|
|
1212
|
-
return
|
|
1213
|
-
}, y = (h) =>
|
|
1212
|
+
return v ? pe(h, v) : !1;
|
|
1213
|
+
}, y = (h) => gl(h, a.disabledDate, a.minDate, a.maxDate), L = (h) => [
|
|
1214
1214
|
t.e("cell"),
|
|
1215
1215
|
t.is("selected", T(h)),
|
|
1216
|
-
t.is("today",
|
|
1216
|
+
t.is("today", z(h)),
|
|
1217
1217
|
t.is("disabled", y(h)),
|
|
1218
1218
|
t.is("in-range", $(h)),
|
|
1219
|
-
t.is("range-start",
|
|
1219
|
+
t.is("range-start", S(h)),
|
|
1220
1220
|
t.is("range-end", I(h)),
|
|
1221
1221
|
t.is("prev-month", !D(h) && h.getMonth() < m.value),
|
|
1222
1222
|
t.is("next-month", !D(h) && h.getMonth() > m.value)
|
|
1223
1223
|
], H = (h) => {
|
|
1224
1224
|
y(h) || (a.selectionMode === "range" ? e("range-select", h) : e("pick", h));
|
|
1225
|
-
},
|
|
1225
|
+
}, E = (h) => {
|
|
1226
1226
|
l.value = h;
|
|
1227
1227
|
}, M = () => {
|
|
1228
1228
|
l.value = null;
|
|
1229
1229
|
};
|
|
1230
|
-
return (h,
|
|
1230
|
+
return (h, v) => (i(), d("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), d(J, null, _(n(
|
|
1237
|
+
(i(!0), d(J, null, _(n(yl), (x) => (i(), d("th", {
|
|
1238
1238
|
key: x,
|
|
1239
1239
|
class: u(n(t).e("header-cell"))
|
|
1240
1240
|
}, U(x), 3))), 128))
|
|
@@ -1242,22 +1242,22 @@ const pl = [
|
|
|
1242
1242
|
]),
|
|
1243
1243
|
r("tbody", null, [
|
|
1244
1244
|
(i(!0), d(J, null, _(b.value, (x, B) => (i(), d("tr", { key: B }, [
|
|
1245
|
-
(i(!0), d(J, null, _(x, (F,
|
|
1246
|
-
key:
|
|
1245
|
+
(i(!0), d(J, null, _(x, (F, Y) => (i(), d("td", {
|
|
1246
|
+
key: Y,
|
|
1247
1247
|
class: u(L(F)),
|
|
1248
1248
|
onClick: (j) => H(F),
|
|
1249
|
-
onMouseenter: (j) =>
|
|
1249
|
+
onMouseenter: (j) => E(F),
|
|
1250
1250
|
onMouseleave: M
|
|
1251
1251
|
}, [
|
|
1252
1252
|
r("span", {
|
|
1253
1253
|
class: u(n(t).e("cell-text"))
|
|
1254
1254
|
}, U(F.getDate()), 3)
|
|
1255
|
-
], 42,
|
|
1255
|
+
], 42, kl))), 128))
|
|
1256
1256
|
]))), 128))
|
|
1257
1257
|
])
|
|
1258
1258
|
], 2));
|
|
1259
1259
|
}
|
|
1260
|
-
}),
|
|
1260
|
+
}), Vl = ["onClick"], xl = /* @__PURE__ */ le({
|
|
1261
1261
|
name: "XMonthTable",
|
|
1262
1262
|
__name: "MonthTable",
|
|
1263
1263
|
props: {
|
|
@@ -1269,21 +1269,21 @@ const pl = [
|
|
|
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, c = (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), S = new Date(a.viewedYear, D + 1, 0);
|
|
1278
|
+
return a.disabledDate($) && a.disabledDate(S);
|
|
1279
1279
|
}, b = (D) => [
|
|
1280
1280
|
t.e("cell"),
|
|
1281
1281
|
t.is("selected", l(D)),
|
|
1282
|
-
t.is("current",
|
|
1282
|
+
t.is("current", c(D)),
|
|
1283
1283
|
t.is("disabled", m(D))
|
|
1284
1284
|
], T = (D) => {
|
|
1285
1285
|
m(D) || e("pick", D);
|
|
1286
|
-
},
|
|
1286
|
+
}, z = V(() => {
|
|
1287
1287
|
const D = [];
|
|
1288
1288
|
for (let $ = 0; $ < 12; $ += 3)
|
|
1289
1289
|
D.push([$, $ + 1, $ + 2]);
|
|
@@ -1295,21 +1295,21 @@ const pl = [
|
|
|
1295
1295
|
cellpadding: "0"
|
|
1296
1296
|
}, [
|
|
1297
1297
|
r("tbody", null, [
|
|
1298
|
-
(i(!0), d(J, null, _(
|
|
1299
|
-
(i(!0), d(J, null, _(
|
|
1298
|
+
(i(!0), d(J, null, _(z.value, (S, I) => (i(), d("tr", { key: I }, [
|
|
1299
|
+
(i(!0), d(J, null, _(S, (y) => (i(), d("td", {
|
|
1300
1300
|
key: y,
|
|
1301
1301
|
class: u(b(y)),
|
|
1302
1302
|
onClick: (L) => T(y)
|
|
1303
1303
|
}, [
|
|
1304
1304
|
r("span", {
|
|
1305
1305
|
class: u(n(t).e("cell-text"))
|
|
1306
|
-
}, U(n(
|
|
1307
|
-
], 10,
|
|
1306
|
+
}, U(n(bl)[y]), 3)
|
|
1307
|
+
], 10, Vl))), 128))
|
|
1308
1308
|
]))), 128))
|
|
1309
1309
|
])
|
|
1310
1310
|
], 2));
|
|
1311
1311
|
}
|
|
1312
|
-
}),
|
|
1312
|
+
}), wl = ["onClick"], Cl = /* @__PURE__ */ le({
|
|
1313
1313
|
name: "XYearTable",
|
|
1314
1314
|
__name: "YearTable",
|
|
1315
1315
|
props: {
|
|
@@ -1319,8 +1319,8 @@ const pl = [
|
|
|
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] =
|
|
1322
|
+
const a = s, e = k, t = ae("year-table"), l = V(() => (/* @__PURE__ */ new Date()).getFullYear()), c = V(() => Ke(a.viewedYear)), m = V(() => {
|
|
1323
|
+
const [y] = c.value, L = [];
|
|
1324
1324
|
L.push(y - 1);
|
|
1325
1325
|
for (let H = 0; H < 10; H++)
|
|
1326
1326
|
L.push(y + H);
|
|
@@ -1330,17 +1330,17 @@ const pl = [
|
|
|
1330
1330
|
for (let L = 0; L < m.value.length; L += 3)
|
|
1331
1331
|
y.push(m.value.slice(L, L + 3));
|
|
1332
1332
|
return y;
|
|
1333
|
-
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1,
|
|
1334
|
-
const [L, H] =
|
|
1333
|
+
}), T = (y) => a.modelValue ? a.modelValue.getFullYear() === y : !1, z = (y) => y === l.value, D = (y) => {
|
|
1334
|
+
const [L, H] = c.value;
|
|
1335
1335
|
return y >= L && y <= H;
|
|
1336
1336
|
}, $ = (y) => {
|
|
1337
1337
|
if (!a.disabledDate) return !1;
|
|
1338
1338
|
const L = new Date(y, 0, 1), H = new Date(y, 11, 31);
|
|
1339
1339
|
return a.disabledDate(L) && a.disabledDate(H);
|
|
1340
|
-
},
|
|
1340
|
+
}, S = (y) => [
|
|
1341
1341
|
t.e("cell"),
|
|
1342
1342
|
t.is("selected", T(y)),
|
|
1343
|
-
t.is("current",
|
|
1343
|
+
t.is("current", z(y)),
|
|
1344
1344
|
t.is("disabled", $(y)),
|
|
1345
1345
|
t.is("in-decade", D(y))
|
|
1346
1346
|
], I = (y) => {
|
|
@@ -1352,21 +1352,21 @@ const pl = [
|
|
|
1352
1352
|
cellpadding: "0"
|
|
1353
1353
|
}, [
|
|
1354
1354
|
r("tbody", null, [
|
|
1355
|
-
(i(!0), d(J, null, _(b.value, (H,
|
|
1355
|
+
(i(!0), d(J, null, _(b.value, (H, E) => (i(), d("tr", { key: E }, [
|
|
1356
1356
|
(i(!0), d(J, null, _(H, (M) => (i(), d("td", {
|
|
1357
1357
|
key: M,
|
|
1358
|
-
class: u(
|
|
1358
|
+
class: u(S(M)),
|
|
1359
1359
|
onClick: (h) => I(M)
|
|
1360
1360
|
}, [
|
|
1361
1361
|
r("span", {
|
|
1362
1362
|
class: u(n(t).e("cell-text"))
|
|
1363
1363
|
}, U(M), 3)
|
|
1364
|
-
], 10,
|
|
1364
|
+
], 10, wl))), 128))
|
|
1365
1365
|
]))), 128))
|
|
1366
1366
|
])
|
|
1367
1367
|
], 2));
|
|
1368
1368
|
}
|
|
1369
|
-
}),
|
|
1369
|
+
}), $l = ["placeholder", "disabled", "value"], Dl = ["placeholder", "disabled", "value"], zl = ["placeholder", "disabled", "value"], Sl = ["value"], Tl = ["value"], Hl = ["value"], ot = /* @__PURE__ */ le({
|
|
1370
1370
|
name: "XDatePicker",
|
|
1371
1371
|
__name: "index",
|
|
1372
1372
|
props: {
|
|
@@ -1389,16 +1389,16 @@ const pl = [
|
|
|
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"),
|
|
1392
|
+
const e = s, t = a, l = ae("date-picker"), c = R(!1), m = R(2e3), b = R(), T = () => e.modelValue !== void 0 && e.modelValue !== null ? e.modelValue : e.value !== void 0 && e.value !== null ? e.value : null, z = (A) => {
|
|
1393
1393
|
e.modelValue !== void 0 && t("update:modelValue", A), e.value !== void 0 && t("update:value", A), e.modelValue === void 0 && e.value === void 0 && t("update:modelValue", A), t("change", A);
|
|
1394
|
-
}, D = R(), $ = R(),
|
|
1394
|
+
}, D = R(), $ = R(), S = R({
|
|
1395
1395
|
top: "0px",
|
|
1396
1396
|
left: "0px"
|
|
1397
|
-
}), I = () =>
|
|
1397
|
+
}), I = () => Ee().next(), y = R("date"), L = R(/* @__PURE__ */ new Date()), H = R({
|
|
1398
1398
|
hours: (/* @__PURE__ */ new Date()).getHours(),
|
|
1399
1399
|
minutes: (/* @__PURE__ */ new Date()).getMinutes(),
|
|
1400
1400
|
seconds: (/* @__PURE__ */ new Date()).getSeconds()
|
|
1401
|
-
}),
|
|
1401
|
+
}), E = R({
|
|
1402
1402
|
selecting: !1,
|
|
1403
1403
|
startDate: null,
|
|
1404
1404
|
endDate: null
|
|
@@ -1407,9 +1407,9 @@ const pl = [
|
|
|
1407
1407
|
if (!A) return null;
|
|
1408
1408
|
if (e.type === "daterange") {
|
|
1409
1409
|
if (!Array.isArray(A)) return null;
|
|
1410
|
-
const [
|
|
1410
|
+
const [P, W] = A;
|
|
1411
1411
|
return [
|
|
1412
|
-
|
|
1412
|
+
P instanceof Date ? P : ve(P),
|
|
1413
1413
|
W instanceof Date ? W : ve(W)
|
|
1414
1414
|
];
|
|
1415
1415
|
}
|
|
@@ -1418,128 +1418,128 @@ const pl = [
|
|
|
1418
1418
|
if (e.type === "daterange") return "";
|
|
1419
1419
|
const A = T();
|
|
1420
1420
|
if (!A) return "";
|
|
1421
|
-
const
|
|
1422
|
-
if (!
|
|
1421
|
+
const P = A instanceof Date ? A : ve(A);
|
|
1422
|
+
if (!P) return "";
|
|
1423
1423
|
const W = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.format;
|
|
1424
|
-
return ce(
|
|
1425
|
-
}),
|
|
1424
|
+
return ce(P, W);
|
|
1425
|
+
}), v = V(() => {
|
|
1426
1426
|
const A = T();
|
|
1427
1427
|
if (!A || !Array.isArray(A)) return "";
|
|
1428
|
-
const [
|
|
1429
|
-
if (!
|
|
1430
|
-
const W =
|
|
1428
|
+
const [P] = A;
|
|
1429
|
+
if (!P) return "";
|
|
1430
|
+
const W = P instanceof Date ? P : ve(P);
|
|
1431
1431
|
return W ? ce(W, e.format) : "";
|
|
1432
1432
|
}), x = V(() => {
|
|
1433
1433
|
const A = T();
|
|
1434
1434
|
if (!A || !Array.isArray(A)) return "";
|
|
1435
|
-
const [,
|
|
1436
|
-
if (!
|
|
1437
|
-
const W =
|
|
1435
|
+
const [, P] = A;
|
|
1436
|
+
if (!P) return "";
|
|
1437
|
+
const W = P instanceof Date ? P : ve(P);
|
|
1438
1438
|
return W ? ce(W, e.format) : "";
|
|
1439
1439
|
}), B = V(() => {
|
|
1440
1440
|
const A = T();
|
|
1441
1441
|
return !A || Array.isArray(A) ? null : A instanceof Date ? A : ve(A);
|
|
1442
|
-
}), F = V(() => L.value.getFullYear()),
|
|
1442
|
+
}), F = V(() => L.value.getFullYear()), Y = V(() => L.value.getMonth()), j = V(() => Ke(F.value)), p = V(() => y.value === "year" ? `${j.value[0]} 年 - ${j.value[1]} 年` : y.value === "month" ? `${F.value} 年` : `${F.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",
|
|
1450
|
-
l.is("has-value", !!h.value || !!(
|
|
1449
|
+
l.is("focus", c.value),
|
|
1450
|
+
l.is("has-value", !!h.value || !!(v.value || x.value))
|
|
1451
1451
|
]), o = () => {
|
|
1452
|
-
e.disabled || e.readonly || (
|
|
1452
|
+
e.disabled || e.readonly || (c.value ? g() : f());
|
|
1453
1453
|
}, f = () => {
|
|
1454
|
-
|
|
1454
|
+
c.value = !0, m.value = I(), ze(() => {
|
|
1455
1455
|
if (b.value && D.value) {
|
|
1456
|
-
const A = b.value.getBoundingClientRect(),
|
|
1457
|
-
let W = A.bottom + 8,
|
|
1458
|
-
|
|
1456
|
+
const A = b.value.getBoundingClientRect(), P = D.value.getBoundingClientRect();
|
|
1457
|
+
let W = A.bottom + 8, he = A.left;
|
|
1458
|
+
he + P.width > window.innerWidth && (he = window.innerWidth - P.width - 8), W + P.height > window.innerHeight && (W = A.top - P.height - 8), S.value = {
|
|
1459
1459
|
top: `${W}px`,
|
|
1460
|
-
left: `${
|
|
1460
|
+
left: `${he}px`
|
|
1461
1461
|
};
|
|
1462
1462
|
}
|
|
1463
1463
|
}), t("focus", {});
|
|
1464
1464
|
}, g = () => {
|
|
1465
|
-
|
|
1465
|
+
c.value = !1, y.value = "date", t("blur", {});
|
|
1466
1466
|
}, X = (A) => {
|
|
1467
1467
|
if (e.type === "date") {
|
|
1468
1468
|
e.showTime && (A.setHours(H.value.hours), A.setMinutes(H.value.minutes), A.setSeconds(H.value.seconds));
|
|
1469
|
-
const
|
|
1470
|
-
|
|
1469
|
+
const P = e.showTime ? "YYYY-MM-DD HH:mm:ss" : e.valueFormat, W = P ? ce(A, P) : A;
|
|
1470
|
+
z(W), e.showTime || g();
|
|
1471
1471
|
}
|
|
1472
1472
|
}, ne = () => {
|
|
1473
1473
|
const A = T();
|
|
1474
1474
|
if (A) {
|
|
1475
|
-
const
|
|
1476
|
-
if (
|
|
1477
|
-
|
|
1478
|
-
const W = e.valueFormat ? ce(
|
|
1479
|
-
|
|
1475
|
+
const P = A instanceof Date ? A : ve(A);
|
|
1476
|
+
if (P) {
|
|
1477
|
+
P.setHours(H.value.hours), P.setMinutes(H.value.minutes), P.setSeconds(H.value.seconds);
|
|
1478
|
+
const W = e.valueFormat ? ce(P, e.valueFormat) : P;
|
|
1479
|
+
z(W);
|
|
1480
1480
|
}
|
|
1481
1481
|
} else {
|
|
1482
|
-
const
|
|
1483
|
-
|
|
1484
|
-
const W = e.valueFormat ? ce(
|
|
1485
|
-
|
|
1482
|
+
const P = /* @__PURE__ */ new Date();
|
|
1483
|
+
P.setHours(H.value.hours), P.setMinutes(H.value.minutes), P.setSeconds(H.value.seconds);
|
|
1484
|
+
const W = e.valueFormat ? ce(P, e.valueFormat) : P;
|
|
1485
|
+
z(W);
|
|
1486
1486
|
}
|
|
1487
1487
|
g();
|
|
1488
1488
|
}, K = (A) => {
|
|
1489
|
-
if (!
|
|
1490
|
-
|
|
1489
|
+
if (!E.value.selecting)
|
|
1490
|
+
E.value.selecting = !0, E.value.startDate = A, E.value.endDate = null;
|
|
1491
1491
|
else {
|
|
1492
|
-
|
|
1493
|
-
const
|
|
1494
|
-
|
|
1492
|
+
E.value.selecting = !1, E.value.startDate && A < E.value.startDate ? [E.value.startDate, E.value.endDate] = [A, E.value.startDate] : E.value.endDate = A;
|
|
1493
|
+
const P = e.valueFormat ? ce(E.value.startDate, e.valueFormat) : E.value.startDate, W = e.valueFormat ? ce(E.value.endDate, e.valueFormat) : E.value.endDate;
|
|
1494
|
+
z([P, W]), g();
|
|
1495
1495
|
}
|
|
1496
1496
|
}, re = (A) => {
|
|
1497
1497
|
if (L.value = new Date(F.value, A, 1), e.type === "month") {
|
|
1498
|
-
const
|
|
1499
|
-
|
|
1498
|
+
const P = new Date(F.value, A, 1), W = e.valueFormat ? ce(P, e.valueFormat) : P;
|
|
1499
|
+
z(W), g();
|
|
1500
1500
|
} else
|
|
1501
1501
|
y.value = "date";
|
|
1502
1502
|
}, q = (A) => {
|
|
1503
|
-
if (L.value = new Date(A,
|
|
1504
|
-
const
|
|
1505
|
-
|
|
1503
|
+
if (L.value = new Date(A, Y.value, 1), e.type === "year") {
|
|
1504
|
+
const P = new Date(A, 0, 1), W = e.valueFormat ? ce(P, e.valueFormat) : P;
|
|
1505
|
+
z(W), g();
|
|
1506
1506
|
} else
|
|
1507
1507
|
y.value = "month";
|
|
1508
1508
|
}, me = () => {
|
|
1509
|
-
L.value =
|
|
1510
|
-
},
|
|
1511
|
-
L.value =
|
|
1509
|
+
L.value = fl(L.value);
|
|
1510
|
+
}, ye = () => {
|
|
1511
|
+
L.value = ml(L.value);
|
|
1512
1512
|
}, Se = () => {
|
|
1513
|
-
y.value === "year" ? L.value = new Date(F.value - 10,
|
|
1514
|
-
},
|
|
1515
|
-
y.value === "year" ? L.value = new Date(F.value + 10,
|
|
1516
|
-
},
|
|
1513
|
+
y.value === "year" ? L.value = new Date(F.value - 10, Y.value, 1) : L.value = hl(L.value);
|
|
1514
|
+
}, we = () => {
|
|
1515
|
+
y.value === "year" ? L.value = new Date(F.value + 10, Y.value, 1) : L.value = pl(L.value);
|
|
1516
|
+
}, Te = () => {
|
|
1517
1517
|
y.value = "month";
|
|
1518
1518
|
}, Re = () => {
|
|
1519
1519
|
y.value = "year";
|
|
1520
|
-
},
|
|
1521
|
-
|
|
1520
|
+
}, O = () => {
|
|
1521
|
+
z(null), t("clear"), E.value = {
|
|
1522
1522
|
selecting: !1,
|
|
1523
1523
|
startDate: null,
|
|
1524
1524
|
endDate: null
|
|
1525
1525
|
};
|
|
1526
1526
|
}, G = (A) => {
|
|
1527
1527
|
if (!b.value) return;
|
|
1528
|
-
const
|
|
1529
|
-
b.value.contains(
|
|
1528
|
+
const P = A.target;
|
|
1529
|
+
b.value.contains(P) || D.value && D.value.contains(P) || g();
|
|
1530
1530
|
};
|
|
1531
1531
|
ie(
|
|
1532
1532
|
T,
|
|
1533
1533
|
(A) => {
|
|
1534
1534
|
if (A)
|
|
1535
1535
|
if (Array.isArray(M.value)) {
|
|
1536
|
-
const [
|
|
1537
|
-
|
|
1536
|
+
const [P] = M.value;
|
|
1537
|
+
P && (L.value = new Date(P));
|
|
1538
1538
|
} else M.value && (L.value = new Date(M.value));
|
|
1539
1539
|
},
|
|
1540
1540
|
{ immediate: !0 }
|
|
1541
|
-
), ie(
|
|
1542
|
-
A && (y.value = "date", e.type === "daterange" && (
|
|
1541
|
+
), ie(c, (A) => {
|
|
1542
|
+
A && (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
|
|
@@ -1548,9 +1548,9 @@ const pl = [
|
|
|
1548
1548
|
const Z = (A) => {
|
|
1549
1549
|
A.key === "Escape" && g();
|
|
1550
1550
|
};
|
|
1551
|
-
return
|
|
1551
|
+
return ge(() => {
|
|
1552
1552
|
document.addEventListener("click", G), document.addEventListener("keydown", Z);
|
|
1553
|
-
}),
|
|
1553
|
+
}), De(() => {
|
|
1554
1554
|
document.removeEventListener("click", G), document.removeEventListener("keydown", Z);
|
|
1555
1555
|
}), k({
|
|
1556
1556
|
focus: () => {
|
|
@@ -1561,7 +1561,7 @@ const pl = [
|
|
|
1561
1561
|
var A;
|
|
1562
1562
|
return (A = $.value) == null ? void 0 : A.blur();
|
|
1563
1563
|
}
|
|
1564
|
-
}), (A,
|
|
1564
|
+
}), (A, P) => (i(), d("div", {
|
|
1565
1565
|
ref_key: "pickerRef",
|
|
1566
1566
|
ref: b,
|
|
1567
1567
|
class: u(w.value)
|
|
@@ -1580,14 +1580,14 @@ const pl = [
|
|
|
1580
1580
|
readonly: !0,
|
|
1581
1581
|
value: h.value,
|
|
1582
1582
|
class: u(n(l).e("input-inner"))
|
|
1583
|
-
}, null, 10,
|
|
1583
|
+
}, null, 10, $l),
|
|
1584
1584
|
r("span", {
|
|
1585
1585
|
class: u(n(l).e("suffix"))
|
|
1586
1586
|
}, [
|
|
1587
1587
|
s.clearable && h.value && !s.disabled ? (i(), d("span", {
|
|
1588
1588
|
key: 0,
|
|
1589
1589
|
class: u(n(l).e("clear")),
|
|
1590
|
-
onClick: ue(
|
|
1590
|
+
onClick: ue(O, ["stop"])
|
|
1591
1591
|
}, [
|
|
1592
1592
|
Q(n(ee), {
|
|
1593
1593
|
name: "close",
|
|
@@ -1613,9 +1613,9 @@ const pl = [
|
|
|
1613
1613
|
placeholder: s.startPlaceholder,
|
|
1614
1614
|
disabled: s.disabled,
|
|
1615
1615
|
readonly: !0,
|
|
1616
|
-
value:
|
|
1616
|
+
value: v.value,
|
|
1617
1617
|
class: u(n(l).e("input-inner"))
|
|
1618
|
-
}, null, 10,
|
|
1618
|
+
}, null, 10, Dl),
|
|
1619
1619
|
r("span", {
|
|
1620
1620
|
class: u(n(l).e("separator"))
|
|
1621
1621
|
}, "至", 2),
|
|
@@ -1626,14 +1626,14 @@ const pl = [
|
|
|
1626
1626
|
readonly: !0,
|
|
1627
1627
|
value: x.value,
|
|
1628
1628
|
class: u(n(l).e("input-inner"))
|
|
1629
|
-
}, null, 10,
|
|
1629
|
+
}, null, 10, zl),
|
|
1630
1630
|
r("span", {
|
|
1631
1631
|
class: u(n(l).e("suffix"))
|
|
1632
1632
|
}, [
|
|
1633
|
-
s.clearable && (
|
|
1633
|
+
s.clearable && (v.value || x.value) && !s.disabled ? (i(), d("span", {
|
|
1634
1634
|
key: 0,
|
|
1635
1635
|
class: u(n(l).e("clear")),
|
|
1636
|
-
onClick: ue(
|
|
1636
|
+
onClick: ue(O, ["stop"])
|
|
1637
1637
|
}, [
|
|
1638
1638
|
Q(n(ee), {
|
|
1639
1639
|
name: "close",
|
|
@@ -1657,7 +1657,7 @@ const pl = [
|
|
|
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, ...S.value })
|
|
1661
1661
|
}, [
|
|
1662
1662
|
r("div", {
|
|
1663
1663
|
class: u(n(l).e("header"))
|
|
@@ -1665,32 +1665,32 @@ const pl = [
|
|
|
1665
1665
|
r("button", {
|
|
1666
1666
|
type: "button",
|
|
1667
1667
|
class: u(n(l).e("prev-btn")),
|
|
1668
|
-
onClick:
|
|
1668
|
+
onClick: P[0] || (P[0] = (W) => y.value === "date" ? me() : Se())
|
|
1669
1669
|
}, " ‹ ", 2),
|
|
1670
1670
|
r("div", {
|
|
1671
1671
|
class: u(n(l).e("header-title"))
|
|
1672
1672
|
}, [
|
|
1673
1673
|
y.value === "year" ? (i(), d("span", {
|
|
1674
1674
|
key: 0,
|
|
1675
|
-
onClick:
|
|
1675
|
+
onClick: P[1] || (P[1] = (W) => y.value = "month")
|
|
1676
1676
|
}, U(p.value), 1)) : (i(), d(J, { key: 1 }, [
|
|
1677
1677
|
r("span", { onClick: Re }, U(F.value) + " 年", 1),
|
|
1678
1678
|
y.value === "date" ? (i(), d("span", {
|
|
1679
1679
|
key: 0,
|
|
1680
|
-
onClick:
|
|
1681
|
-
}, U(
|
|
1680
|
+
onClick: Te
|
|
1681
|
+
}, U(Y.value + 1) + " 月", 1)) : N("", !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: P[2] || (P[2] = (W) => y.value === "date" ? ye() : we())
|
|
1688
1688
|
}, " › ", 2)
|
|
1689
1689
|
], 2),
|
|
1690
1690
|
r("div", {
|
|
1691
1691
|
class: u(n(l).e("content"))
|
|
1692
1692
|
}, [
|
|
1693
|
-
y.value === "date" ? (i(), fe(
|
|
1693
|
+
y.value === "date" ? (i(), fe(Ml, {
|
|
1694
1694
|
key: 0,
|
|
1695
1695
|
"model-value": B.value,
|
|
1696
1696
|
"viewed-month": L.value,
|
|
@@ -1698,16 +1698,16 @@ const pl = [
|
|
|
1698
1698
|
"min-date": s.minDate ? n(ve)(s.minDate) : null,
|
|
1699
1699
|
"max-date": s.maxDate ? n(ve)(s.maxDate) : null,
|
|
1700
1700
|
"selection-mode": s.type === "daterange" ? "range" : "single",
|
|
1701
|
-
"range-state":
|
|
1701
|
+
"range-state": E.value,
|
|
1702
1702
|
onPick: X,
|
|
1703
1703
|
onRangeSelect: K
|
|
1704
|
-
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(
|
|
1704
|
+
}, null, 8, ["model-value", "viewed-month", "disabled-date", "min-date", "max-date", "selection-mode", "range-state"])) : y.value === "month" ? (i(), fe(xl, {
|
|
1705
1705
|
key: 1,
|
|
1706
1706
|
"model-value": B.value,
|
|
1707
1707
|
"viewed-year": F.value,
|
|
1708
1708
|
"disabled-date": s.disabledDate,
|
|
1709
1709
|
onPick: re
|
|
1710
|
-
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(
|
|
1710
|
+
}, null, 8, ["model-value", "viewed-year", "disabled-date"])) : y.value === "year" ? (i(), fe(Cl, {
|
|
1711
1711
|
key: 2,
|
|
1712
1712
|
"model-value": B.value,
|
|
1713
1713
|
"viewed-year": F.value,
|
|
@@ -1723,64 +1723,64 @@ const pl = [
|
|
|
1723
1723
|
class: u(n(l).e("time-item"))
|
|
1724
1724
|
}, [
|
|
1725
1725
|
oe(r("select", {
|
|
1726
|
-
"onUpdate:modelValue":
|
|
1726
|
+
"onUpdate:modelValue": P[3] || (P[3] = (W) => H.value.hours = W),
|
|
1727
1727
|
class: u(n(l).e("time-select"))
|
|
1728
1728
|
}, [
|
|
1729
1729
|
(i(), d(J, null, _(24, (W) => r("option", {
|
|
1730
1730
|
key: W,
|
|
1731
1731
|
value: W - 1
|
|
1732
|
-
}, U(String(W - 1).padStart(2, "0")), 9,
|
|
1732
|
+
}, U(String(W - 1).padStart(2, "0")), 9, Sl)), 64))
|
|
1733
1733
|
], 2), [
|
|
1734
1734
|
[
|
|
1735
|
-
|
|
1735
|
+
Ce,
|
|
1736
1736
|
H.value.hours,
|
|
1737
1737
|
void 0,
|
|
1738
1738
|
{ number: !0 }
|
|
1739
1739
|
]
|
|
1740
1740
|
]),
|
|
1741
|
-
|
|
1741
|
+
P[6] || (P[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": P[4] || (P[4] = (W) => H.value.minutes = W),
|
|
1748
1748
|
class: u(n(l).e("time-select"))
|
|
1749
1749
|
}, [
|
|
1750
1750
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
1751
1751
|
key: W,
|
|
1752
1752
|
value: W - 1
|
|
1753
|
-
}, U(String(W - 1).padStart(2, "0")), 9,
|
|
1753
|
+
}, U(String(W - 1).padStart(2, "0")), 9, Tl)), 64))
|
|
1754
1754
|
], 2), [
|
|
1755
1755
|
[
|
|
1756
|
-
|
|
1756
|
+
Ce,
|
|
1757
1757
|
H.value.minutes,
|
|
1758
1758
|
void 0,
|
|
1759
1759
|
{ number: !0 }
|
|
1760
1760
|
]
|
|
1761
1761
|
]),
|
|
1762
|
-
|
|
1762
|
+
P[7] || (P[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": P[5] || (P[5] = (W) => H.value.seconds = W),
|
|
1769
1769
|
class: u(n(l).e("time-select"))
|
|
1770
1770
|
}, [
|
|
1771
1771
|
(i(), d(J, null, _(60, (W) => r("option", {
|
|
1772
1772
|
key: W,
|
|
1773
1773
|
value: W - 1
|
|
1774
|
-
}, U(String(W - 1).padStart(2, "0")), 9,
|
|
1774
|
+
}, U(String(W - 1).padStart(2, "0")), 9, Hl)), 64))
|
|
1775
1775
|
], 2), [
|
|
1776
1776
|
[
|
|
1777
|
-
|
|
1777
|
+
Ce,
|
|
1778
1778
|
H.value.seconds,
|
|
1779
1779
|
void 0,
|
|
1780
1780
|
{ number: !0 }
|
|
1781
1781
|
]
|
|
1782
1782
|
]),
|
|
1783
|
-
|
|
1783
|
+
P[8] || (P[8] = r("span", null, "秒", -1))
|
|
1784
1784
|
], 2)
|
|
1785
1785
|
], 2)) : N("", !0),
|
|
1786
1786
|
s.showTime && s.type !== "daterange" ? (i(), d("div", {
|
|
@@ -1794,7 +1794,7 @@ const pl = [
|
|
|
1794
1794
|
}, "确定", 2)
|
|
1795
1795
|
], 2)) : N("", !0)
|
|
1796
1796
|
], 6), [
|
|
1797
|
-
[
|
|
1797
|
+
[be, c.value]
|
|
1798
1798
|
])
|
|
1799
1799
|
]),
|
|
1800
1800
|
_: 1
|
|
@@ -1803,7 +1803,7 @@ const pl = [
|
|
|
1803
1803
|
], 2));
|
|
1804
1804
|
}
|
|
1805
1805
|
});
|
|
1806
|
-
function
|
|
1806
|
+
function ke(s, k = "HH:mm:ss") {
|
|
1807
1807
|
if (!s) return "";
|
|
1808
1808
|
const a = s.getHours(), e = s.getMinutes(), t = s.getSeconds();
|
|
1809
1809
|
return k.replace(/HH/g, String(a).padStart(2, "0")).replace(/H/g, String(a)).replace(/mm/g, String(e).padStart(2, "0")).replace(/m/g, String(e)).replace(/ss/g, String(t).padStart(2, "0")).replace(/s/g, String(t));
|
|
@@ -1824,10 +1824,10 @@ function Ae(s) {
|
|
|
1824
1824
|
const a = new Date(s);
|
|
1825
1825
|
return isNaN(a.getTime()) ? null : a;
|
|
1826
1826
|
}
|
|
1827
|
-
function
|
|
1827
|
+
function Me(s) {
|
|
1828
1828
|
return String(s).padStart(2, "0");
|
|
1829
1829
|
}
|
|
1830
|
-
const
|
|
1830
|
+
const Ll = ["onClick"], Rl = ["onClick"], Bl = ["onClick"], Al = /* @__PURE__ */ le({
|
|
1831
1831
|
name: "XTimePanel",
|
|
1832
1832
|
__name: "TimePanel",
|
|
1833
1833
|
props: {
|
|
@@ -1842,12 +1842,12 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__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 = R(0),
|
|
1845
|
+
const a = s, e = k, t = ae("time-panel"), l = R(0), c = R(0), m = R(0), b = R(), T = R(), z = R(), D = V(() => a.format.includes("ss") || a.format.includes("s")), $ = V(() => {
|
|
1846
1846
|
const K = [], re = Math.max(1, a.hourStep);
|
|
1847
1847
|
for (let q = 0; q < 24; q += re)
|
|
1848
1848
|
K.push(q);
|
|
1849
1849
|
return K;
|
|
1850
|
-
}),
|
|
1850
|
+
}), S = V(() => {
|
|
1851
1851
|
const K = [], re = Math.max(1, a.minuteStep);
|
|
1852
1852
|
for (let q = 0; q < 60; q += re)
|
|
1853
1853
|
K.push(q);
|
|
@@ -1857,42 +1857,42 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1857
1857
|
for (let q = 0; q < 60; q += re)
|
|
1858
1858
|
K.push(q);
|
|
1859
1859
|
return K;
|
|
1860
|
-
}), y = V(() => a.disabledHours ? new Set(a.disabledHours()) : /* @__PURE__ */ new Set()), L = V(() => a.disabledMinutes ? new Set(a.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), H = V(() => a.disabledSeconds ? new Set(a.disabledSeconds(l.value,
|
|
1861
|
-
M(K) || (l.value = K, w(b.value,
|
|
1860
|
+
}), y = V(() => a.disabledHours ? new Set(a.disabledHours()) : /* @__PURE__ */ new Set()), L = V(() => a.disabledMinutes ? new Set(a.disabledMinutes(l.value)) : /* @__PURE__ */ new Set()), H = V(() => a.disabledSeconds ? new Set(a.disabledSeconds(l.value, c.value)) : /* @__PURE__ */ new Set()), E = V(() => `${Me(l.value)}:${Me(c.value)}${D.value ? ":" + Me(m.value) : ""}`), M = (K) => y.value.has(K), h = (K) => L.value.has(K), v = (K) => H.value.has(K), x = (K) => {
|
|
1861
|
+
M(K) || (l.value = K, w(b.value, Y(K)));
|
|
1862
1862
|
}, B = (K) => {
|
|
1863
|
-
h(K) || (
|
|
1863
|
+
h(K) || (c.value = K, w(T.value, j(K)));
|
|
1864
1864
|
}, F = (K) => {
|
|
1865
|
-
|
|
1866
|
-
},
|
|
1865
|
+
v(K) || (m.value = K, w(z.value, p(K)));
|
|
1866
|
+
}, Y = (K) => $.value.indexOf(K), j = (K) => S.value.indexOf(K), p = (K) => I.value.indexOf(K), w = (K, re) => {
|
|
1867
1867
|
if (!K) return;
|
|
1868
|
-
const q = 32,
|
|
1869
|
-
K.scrollTop = Math.max(0,
|
|
1868
|
+
const q = 32, ye = re * q + 84 - 200 / 2 + q / 2;
|
|
1869
|
+
K.scrollTop = Math.max(0, ye);
|
|
1870
1870
|
}, C = () => {
|
|
1871
1871
|
if (!b.value) return;
|
|
1872
1872
|
const K = b.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = $.value[Math.max(0, Math.min(re, $.value.length - 1))];
|
|
1873
1873
|
q !== void 0 && !M(q) && (l.value = q);
|
|
1874
1874
|
}, o = () => {
|
|
1875
1875
|
if (!T.value) return;
|
|
1876
|
-
const K = T.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q =
|
|
1877
|
-
q !== void 0 && !h(q) && (
|
|
1876
|
+
const K = T.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = S.value[Math.max(0, Math.min(re, S.value.length - 1))];
|
|
1877
|
+
q !== void 0 && !h(q) && (c.value = q);
|
|
1878
1878
|
}, f = () => {
|
|
1879
|
-
if (!
|
|
1880
|
-
const K =
|
|
1881
|
-
q !== void 0 && !
|
|
1879
|
+
if (!z.value) return;
|
|
1880
|
+
const K = z.value.scrollTop, re = Math.round((K - 84 + 100) / 32), q = I.value[Math.max(0, Math.min(re, I.value.length - 1))];
|
|
1881
|
+
q !== void 0 && !v(q) && (m.value = q);
|
|
1882
1882
|
}, g = () => {
|
|
1883
1883
|
const K = a.modelValue ? new Date(a.modelValue) : /* @__PURE__ */ new Date();
|
|
1884
|
-
K.setHours(l.value,
|
|
1884
|
+
K.setHours(l.value, c.value, m.value, 0), e("confirm", K);
|
|
1885
1885
|
}, X = () => {
|
|
1886
1886
|
e("cancel");
|
|
1887
1887
|
}, ne = () => {
|
|
1888
1888
|
if (a.modelValue)
|
|
1889
|
-
l.value = a.modelValue.getHours(),
|
|
1889
|
+
l.value = a.modelValue.getHours(), c.value = a.modelValue.getMinutes(), m.value = a.modelValue.getSeconds();
|
|
1890
1890
|
else {
|
|
1891
1891
|
const K = /* @__PURE__ */ new Date();
|
|
1892
|
-
l.value = K.getHours(),
|
|
1892
|
+
l.value = K.getHours(), c.value = K.getMinutes(), m.value = K.getSeconds();
|
|
1893
1893
|
}
|
|
1894
|
-
|
|
1895
|
-
w(b.value,
|
|
1894
|
+
ze(() => {
|
|
1895
|
+
w(b.value, Y(l.value)), w(T.value, j(c.value)), D.value && w(z.value, p(m.value));
|
|
1896
1896
|
});
|
|
1897
1897
|
};
|
|
1898
1898
|
return ie(
|
|
@@ -1901,7 +1901,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1901
1901
|
ne();
|
|
1902
1902
|
},
|
|
1903
1903
|
{ immediate: !0 }
|
|
1904
|
-
),
|
|
1904
|
+
), ge(() => {
|
|
1905
1905
|
ne();
|
|
1906
1906
|
}), (K, re) => (i(), d("div", {
|
|
1907
1907
|
class: u(n(t).b())
|
|
@@ -1925,7 +1925,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1925
1925
|
key: q,
|
|
1926
1926
|
class: u([n(t).e("item"), n(t).is("selected", l.value === q), n(t).is("disabled", M(q))]),
|
|
1927
1927
|
onClick: (me) => x(q)
|
|
1928
|
-
}, U(n(
|
|
1928
|
+
}, U(n(Me)(q)), 11, Ll))), 128)),
|
|
1929
1929
|
r("div", {
|
|
1930
1930
|
class: u(n(t).e("padding"))
|
|
1931
1931
|
}, null, 2)
|
|
@@ -1939,11 +1939,11 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1939
1939
|
r("div", {
|
|
1940
1940
|
class: u(n(t).e("padding"))
|
|
1941
1941
|
}, null, 2),
|
|
1942
|
-
(i(!0), d(J, null, _(
|
|
1942
|
+
(i(!0), d(J, null, _(S.value, (q) => (i(), d("div", {
|
|
1943
1943
|
key: q,
|
|
1944
|
-
class: u([n(t).e("item"), n(t).is("selected",
|
|
1944
|
+
class: u([n(t).e("item"), n(t).is("selected", c.value === q), n(t).is("disabled", h(q))]),
|
|
1945
1945
|
onClick: (me) => B(q)
|
|
1946
|
-
}, U(n(
|
|
1946
|
+
}, U(n(Me)(q)), 11, Rl))), 128)),
|
|
1947
1947
|
r("div", {
|
|
1948
1948
|
class: u(n(t).e("padding"))
|
|
1949
1949
|
}, null, 2)
|
|
@@ -1951,7 +1951,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1951
1951
|
D.value ? (i(), d("div", {
|
|
1952
1952
|
key: 0,
|
|
1953
1953
|
ref_key: "secondListRef",
|
|
1954
|
-
ref:
|
|
1954
|
+
ref: z,
|
|
1955
1955
|
class: u(n(t).e("list")),
|
|
1956
1956
|
onScroll: f
|
|
1957
1957
|
}, [
|
|
@@ -1960,9 +1960,9 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1960
1960
|
}, null, 2),
|
|
1961
1961
|
(i(!0), d(J, null, _(I.value, (q) => (i(), d("div", {
|
|
1962
1962
|
key: q,
|
|
1963
|
-
class: u([n(t).e("item"), n(t).is("selected", m.value === q), n(t).is("disabled",
|
|
1963
|
+
class: u([n(t).e("item"), n(t).is("selected", m.value === q), n(t).is("disabled", v(q))]),
|
|
1964
1964
|
onClick: (me) => F(q)
|
|
1965
|
-
}, U(n(
|
|
1965
|
+
}, U(n(Me)(q)), 11, Bl))), 128)),
|
|
1966
1966
|
r("div", {
|
|
1967
1967
|
class: u(n(t).e("padding"))
|
|
1968
1968
|
}, null, 2)
|
|
@@ -1973,7 +1973,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1973
1973
|
}, [
|
|
1974
1974
|
r("span", {
|
|
1975
1975
|
class: u(n(t).e("current-time"))
|
|
1976
|
-
}, U(
|
|
1976
|
+
}, U(E.value), 3),
|
|
1977
1977
|
r("div", {
|
|
1978
1978
|
class: u(n(t).e("actions"))
|
|
1979
1979
|
}, [
|
|
@@ -1989,7 +1989,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
1989
1989
|
], 2)
|
|
1990
1990
|
], 2));
|
|
1991
1991
|
}
|
|
1992
|
-
}),
|
|
1992
|
+
}), Fl = ["placeholder", "disabled", "value"], Il = ["placeholder", "disabled", "value"], Pl = ["placeholder", "disabled", "value"], it = /* @__PURE__ */ le({
|
|
1993
1993
|
name: "XTimePicker",
|
|
1994
1994
|
__name: "index",
|
|
1995
1995
|
props: {
|
|
@@ -2013,10 +2013,10 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__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"), c = () => Ee().next(), m = R(!1), b = R(2e3), T = R(), z = R(), D = R(), $ = R({
|
|
2017
2017
|
top: "0px",
|
|
2018
2018
|
left: "0px"
|
|
2019
|
-
}),
|
|
2019
|
+
}), S = R({
|
|
2020
2020
|
startTime: null,
|
|
2021
2021
|
endTime: null
|
|
2022
2022
|
}), I = R("start"), y = V(() => {
|
|
@@ -2026,30 +2026,30 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2026
2026
|
return [Ae(f), Ae(g)];
|
|
2027
2027
|
}
|
|
2028
2028
|
return Ae(e.modelValue);
|
|
2029
|
-
}), L = V(() => !y.value || Array.isArray(y.value) ? "" :
|
|
2029
|
+
}), L = 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
|
-
return f ?
|
|
2033
|
-
}),
|
|
2032
|
+
return f ? ke(f, e.format) : "";
|
|
2033
|
+
}), E = V(() => {
|
|
2034
2034
|
if (!Array.isArray(y.value)) return "";
|
|
2035
2035
|
const [, f] = y.value;
|
|
2036
|
-
return f ?
|
|
2037
|
-
}), M = V(() => e.type === "timerange" ? I.value === "start" ?
|
|
2036
|
+
return f ? ke(f, e.format) : "";
|
|
2037
|
+
}), M = V(() => e.type === "timerange" ? I.value === "start" ? S.value.startTime : S.value.endTime || S.value.startTime : y.value), h = V(() => [
|
|
2038
2038
|
l.b(),
|
|
2039
2039
|
l.m(e.size),
|
|
2040
2040
|
l.is("disabled", e.disabled),
|
|
2041
2041
|
l.is("range", e.type === "timerange")
|
|
2042
|
-
]),
|
|
2042
|
+
]), v = V(() => [
|
|
2043
2043
|
l.e("input"),
|
|
2044
2044
|
l.is("focus", m.value)
|
|
2045
2045
|
]), x = () => {
|
|
2046
|
-
e.disabled || e.readonly || (m.value ?
|
|
2046
|
+
e.disabled || e.readonly || (m.value ? Y() : F());
|
|
2047
2047
|
}, B = (f) => {
|
|
2048
2048
|
e.disabled || e.readonly || (I.value = f, m.value || F());
|
|
2049
2049
|
}, F = () => {
|
|
2050
|
-
m.value = !0, b.value =
|
|
2051
|
-
if (T.value &&
|
|
2052
|
-
const f = T.value.getBoundingClientRect(), g =
|
|
2050
|
+
m.value = !0, b.value = c(), ze(() => {
|
|
2051
|
+
if (T.value && z.value) {
|
|
2052
|
+
const f = T.value.getBoundingClientRect(), g = z.value.getBoundingClientRect();
|
|
2053
2053
|
let X = f.bottom + 8, ne = f.left;
|
|
2054
2054
|
ne + g.width > window.innerWidth && (ne = window.innerWidth - g.width - 8), X + g.height > window.innerHeight && (X = f.top - g.height - 8), $.value = {
|
|
2055
2055
|
top: `${X}px`,
|
|
@@ -2057,39 +2057,39 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
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
2064
|
if (I.value === "start")
|
|
2065
|
-
|
|
2065
|
+
S.value.startTime = f, I.value = "end", S.value.endTime && S.value.endTime < f && (S.value.endTime = null);
|
|
2066
2066
|
else {
|
|
2067
|
-
|
|
2068
|
-
const g = e.valueFormat ?
|
|
2069
|
-
t("update:modelValue", [g, X]), t("change", [g, X]),
|
|
2067
|
+
S.value.startTime && f < S.value.startTime ? (S.value.endTime = S.value.startTime, S.value.startTime = f) : S.value.endTime = f;
|
|
2068
|
+
const g = e.valueFormat ? ke(S.value.startTime, e.valueFormat) : S.value.startTime, X = e.valueFormat ? ke(S.value.endTime, e.valueFormat) : S.value.endTime;
|
|
2069
|
+
t("update:modelValue", [g, X]), t("change", [g, X]), Y();
|
|
2070
2070
|
}
|
|
2071
2071
|
else {
|
|
2072
|
-
const g = e.valueFormat ?
|
|
2073
|
-
t("update:modelValue", g), t("change", g),
|
|
2072
|
+
const g = e.valueFormat ? ke(f, e.valueFormat) : f;
|
|
2073
|
+
t("update:modelValue", g), t("change", g), Y();
|
|
2074
2074
|
}
|
|
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"), S.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) || z.value && z.value.contains(g) || Y();
|
|
2086
2086
|
};
|
|
2087
2087
|
ie(
|
|
2088
2088
|
() => e.modelValue,
|
|
2089
2089
|
(f) => {
|
|
2090
2090
|
if (f && e.type === "timerange") {
|
|
2091
2091
|
const [g, X] = y.value;
|
|
2092
|
-
|
|
2092
|
+
S.value = {
|
|
2093
2093
|
startTime: g,
|
|
2094
2094
|
endTime: X
|
|
2095
2095
|
};
|
|
@@ -2097,17 +2097,17 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2097
2097
|
},
|
|
2098
2098
|
{ immediate: !0 }
|
|
2099
2099
|
), ie(m, (f) => {
|
|
2100
|
-
f && e.type === "timerange" && (
|
|
2100
|
+
f && e.type === "timerange" && (S.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
|
}, I.value = "start");
|
|
2104
2104
|
});
|
|
2105
2105
|
const o = (f) => {
|
|
2106
|
-
f.key === "Escape" &&
|
|
2106
|
+
f.key === "Escape" && Y();
|
|
2107
2107
|
};
|
|
2108
|
-
return
|
|
2108
|
+
return ge(() => {
|
|
2109
2109
|
document.addEventListener("click", C), document.addEventListener("keydown", o);
|
|
2110
|
-
}),
|
|
2110
|
+
}), De(() => {
|
|
2111
2111
|
document.removeEventListener("click", C), document.removeEventListener("keydown", o);
|
|
2112
2112
|
}), k({
|
|
2113
2113
|
focus: () => {
|
|
@@ -2125,7 +2125,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2125
2125
|
}, [
|
|
2126
2126
|
s.type !== "timerange" ? (i(), d("div", {
|
|
2127
2127
|
key: 0,
|
|
2128
|
-
class: u(
|
|
2128
|
+
class: u(v.value),
|
|
2129
2129
|
onClick: x
|
|
2130
2130
|
}, [
|
|
2131
2131
|
r("input", {
|
|
@@ -2137,7 +2137,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2137
2137
|
readonly: !0,
|
|
2138
2138
|
value: L.value,
|
|
2139
2139
|
class: u(n(l).e("input-inner"))
|
|
2140
|
-
}, null, 10,
|
|
2140
|
+
}, null, 10, Fl),
|
|
2141
2141
|
r("span", {
|
|
2142
2142
|
class: u(n(l).e("suffix"))
|
|
2143
2143
|
}, [
|
|
@@ -2162,7 +2162,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2162
2162
|
], 2)
|
|
2163
2163
|
], 2)) : (i(), d("div", {
|
|
2164
2164
|
key: 1,
|
|
2165
|
-
class: u(
|
|
2165
|
+
class: u(v.value),
|
|
2166
2166
|
onClick: x
|
|
2167
2167
|
}, [
|
|
2168
2168
|
r("input", {
|
|
@@ -2173,7 +2173,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2173
2173
|
value: H.value,
|
|
2174
2174
|
class: u([n(l).e("input-inner"), n(l).is("active", I.value === "start")]),
|
|
2175
2175
|
onClick: g[0] || (g[0] = ue((X) => B("start"), ["stop"]))
|
|
2176
|
-
}, null, 10,
|
|
2176
|
+
}, null, 10, Il),
|
|
2177
2177
|
r("span", {
|
|
2178
2178
|
class: u(n(l).e("separator"))
|
|
2179
2179
|
}, "至", 2),
|
|
@@ -2182,14 +2182,14 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2182
2182
|
placeholder: s.endPlaceholder,
|
|
2183
2183
|
disabled: s.disabled,
|
|
2184
2184
|
readonly: !0,
|
|
2185
|
-
value:
|
|
2185
|
+
value: E.value,
|
|
2186
2186
|
class: u([n(l).e("input-inner"), n(l).is("active", I.value === "end")]),
|
|
2187
2187
|
onClick: g[1] || (g[1] = ue((X) => B("end"), ["stop"]))
|
|
2188
|
-
}, null, 10,
|
|
2188
|
+
}, null, 10, Pl),
|
|
2189
2189
|
r("span", {
|
|
2190
2190
|
class: u(n(l).e("suffix"))
|
|
2191
2191
|
}, [
|
|
2192
|
-
s.clearable && (H.value ||
|
|
2192
|
+
s.clearable && (H.value || E.value) && !s.disabled ? (i(), d("span", {
|
|
2193
2193
|
key: 0,
|
|
2194
2194
|
class: u(n(l).e("clear")),
|
|
2195
2195
|
onClick: ue(w, ["stop"])
|
|
@@ -2214,7 +2214,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2214
2214
|
default: He(() => [
|
|
2215
2215
|
oe(r("div", {
|
|
2216
2216
|
ref_key: "popperRef",
|
|
2217
|
-
ref:
|
|
2217
|
+
ref: z,
|
|
2218
2218
|
class: u(n(l).e("popper")),
|
|
2219
2219
|
style: te({ zIndex: b.value, ...$.value })
|
|
2220
2220
|
}, [
|
|
@@ -2222,7 +2222,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2222
2222
|
key: 0,
|
|
2223
2223
|
class: u(n(l).e("popper-header"))
|
|
2224
2224
|
}, U(I.value === "start" ? "请选择开始时间" : "请选择结束时间"), 3)) : N("", !0),
|
|
2225
|
-
Q(
|
|
2225
|
+
Q(Al, {
|
|
2226
2226
|
"model-value": M.value,
|
|
2227
2227
|
format: s.format,
|
|
2228
2228
|
"disabled-hours": s.disabledHours,
|
|
@@ -2235,7 +2235,7 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
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), [
|
|
2238
|
-
[
|
|
2238
|
+
[be, m.value]
|
|
2239
2239
|
])
|
|
2240
2240
|
]),
|
|
2241
2241
|
_: 1
|
|
@@ -2244,15 +2244,15 @@ const Tl = ["onClick"], Hl = ["onClick"], Ll = ["onClick"], Rl = /* @__PURE__ */
|
|
|
2244
2244
|
], 2));
|
|
2245
2245
|
}
|
|
2246
2246
|
});
|
|
2247
|
-
function
|
|
2247
|
+
function El(s, k, a) {
|
|
2248
2248
|
return a ? a(k, s) : s.toLowerCase().includes(k.toLowerCase());
|
|
2249
2249
|
}
|
|
2250
|
-
function
|
|
2250
|
+
function We(s, k, a = "value", e = "children") {
|
|
2251
2251
|
for (const t of s) {
|
|
2252
2252
|
if (t[a] === k)
|
|
2253
2253
|
return t;
|
|
2254
2254
|
if (t[e] && t[e].length > 0) {
|
|
2255
|
-
const l =
|
|
2255
|
+
const l = We(t[e], k, a, e);
|
|
2256
2256
|
if (l) return l;
|
|
2257
2257
|
}
|
|
2258
2258
|
}
|
|
@@ -2260,8 +2260,8 @@ function Xe(s, k, a = "value", e = "children") {
|
|
|
2260
2260
|
}
|
|
2261
2261
|
function Fe(s, k, a = "value", e = "children") {
|
|
2262
2262
|
const t = [];
|
|
2263
|
-
function l(
|
|
2264
|
-
for (const m of
|
|
2263
|
+
function l(c) {
|
|
2264
|
+
for (const m of c) {
|
|
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 Ol(s, k = "children") {
|
|
2278
2278
|
const a = [];
|
|
2279
|
-
function e(t, l = 0,
|
|
2279
|
+
function e(t, l = 0, c = null) {
|
|
2280
2280
|
for (const m of t)
|
|
2281
|
-
a.push({ ...m, level: l, parent:
|
|
2281
|
+
a.push({ ...m, level: l, parent: c }), m[k] && m[k].length > 0 && e(m[k], l + 1, m);
|
|
2282
2282
|
}
|
|
2283
2283
|
return e(s), a;
|
|
2284
2284
|
}
|
|
2285
|
-
const
|
|
2285
|
+
const Yl = ["onClick"], Ul = ["placeholder", "disabled", "readonly", "value"], Nl = ["onClick"], Xl = ["onClick"], rt = /* @__PURE__ */ le({
|
|
2286
2286
|
name: "XSelect",
|
|
2287
2287
|
__name: "index",
|
|
2288
2288
|
props: {
|
|
@@ -2311,76 +2311,82 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2311
2311
|
setup(s, { emit: k }) {
|
|
2312
2312
|
const a = le({
|
|
2313
2313
|
name: "XSelectPopperContent",
|
|
2314
|
-
setup(
|
|
2315
|
-
const Z =
|
|
2316
|
-
return Z &&
|
|
2314
|
+
setup(O, { slots: G }) {
|
|
2315
|
+
const Z = xe("select");
|
|
2316
|
+
return Z && $e("select", Z), () => {
|
|
2317
2317
|
var A;
|
|
2318
2318
|
return (A = G.default) == null ? void 0 : A.call(G);
|
|
2319
2319
|
};
|
|
2320
2320
|
}
|
|
2321
|
-
}), e = s, t = k, l = ae("select"),
|
|
2322
|
-
L.value.find((G) => G.value ===
|
|
2323
|
-
},
|
|
2324
|
-
t("update:modelValue",
|
|
2321
|
+
}), e = s, t = k, l = ae("select"), c = Le(), m = () => Ee().next(), b = R(), T = R(), z = R(), D = R(!1), $ = R(2e3), S = R(""), I = R(-1), y = R({ top: "0px", left: "0px" }), L = R([]), H = (O) => {
|
|
2322
|
+
L.value.find((G) => G.value === O.value) || L.value.push(O);
|
|
2323
|
+
}, E = V(() => e.type === "multiple" || e.mode === "multiple"), M = V(() => e.type === "cascader"), h = R([]), v = V(() => e.options && e.options.length > 0 ? e.options : L.value), x = (O) => {
|
|
2324
|
+
t("update:modelValue", O), t("update:value", O), t("change", O);
|
|
2325
2325
|
}, B = V(() => {
|
|
2326
|
-
const
|
|
2327
|
-
return
|
|
2326
|
+
const O = e.modelValue ?? e.value;
|
|
2327
|
+
return E.value ? Array.isArray(O) ? O : [] : M.value ? Array.isArray(O) ? O : O != null && O !== "" ? [O] : [] : O != null && O !== "" ? [O] : [];
|
|
2328
2328
|
}), F = V(() => {
|
|
2329
|
-
const
|
|
2330
|
-
return M.value ?
|
|
2331
|
-
}),
|
|
2332
|
-
|
|
2333
|
-
return
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
"mergedOptions.length": c.value.length,
|
|
2337
|
-
"flatOptions.length": F.value.length,
|
|
2338
|
-
filterable: e.filterable,
|
|
2339
|
-
query: z.value
|
|
2340
|
-
}), !e.filterable || !z.value ? F.value : F.value.filter((G) => {
|
|
2341
|
-
const Z = G[e.labelKey] || "";
|
|
2342
|
-
return Il(Z, z.value, e.filterMethod);
|
|
2343
|
-
});
|
|
2344
|
-
}), j = V(() => {
|
|
2345
|
-
const E = [];
|
|
2329
|
+
const O = v.value;
|
|
2330
|
+
return M.value ? Ol(O, e.childrenKey) : O.map((G) => ({ ...G, level: 0 }));
|
|
2331
|
+
}), Y = V(() => !e.filterable || !S.value ? F.value : F.value.filter((O) => {
|
|
2332
|
+
const G = O[e.labelKey] || "";
|
|
2333
|
+
return El(G, S.value, e.filterMethod);
|
|
2334
|
+
})), j = V(() => {
|
|
2335
|
+
const O = [];
|
|
2346
2336
|
for (const G of B.value) {
|
|
2347
|
-
const Z =
|
|
2348
|
-
Z &&
|
|
2337
|
+
const Z = We(v.value, G, e.valueKey, e.childrenKey);
|
|
2338
|
+
Z && O.push(Z);
|
|
2349
2339
|
}
|
|
2350
|
-
return
|
|
2340
|
+
return O;
|
|
2351
2341
|
}), p = V(() => {
|
|
2352
|
-
if (
|
|
2342
|
+
if (E.value)
|
|
2353
2343
|
return "";
|
|
2354
2344
|
if (M.value)
|
|
2355
|
-
return Fe(
|
|
2356
|
-
const
|
|
2357
|
-
return
|
|
2358
|
-
}), w = V(() =>
|
|
2345
|
+
return Fe(v.value, B.value[B.value.length - 1], e.valueKey, e.childrenKey).map((Z) => Z[e.labelKey]).join(e.separator);
|
|
2346
|
+
const O = j.value[0];
|
|
2347
|
+
return O ? O[e.labelKey] : "";
|
|
2348
|
+
}), 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(() => [
|
|
2359
2349
|
l.b(),
|
|
2360
2350
|
l.m(e.size),
|
|
2361
2351
|
l.is("disabled", e.disabled),
|
|
2362
|
-
l.is("multiple",
|
|
2352
|
+
l.is("multiple", E.value),
|
|
2363
2353
|
l.is("cascader", M.value),
|
|
2364
2354
|
l.is("filterable", e.filterable),
|
|
2365
2355
|
l.is("focus", D.value)
|
|
2366
2356
|
]), g = () => {
|
|
2367
|
-
if (!b.value || !
|
|
2368
|
-
const
|
|
2369
|
-
|
|
2370
|
-
|
|
2371
|
-
|
|
2372
|
-
|
|
2357
|
+
if (!b.value || !z.value || !D.value) return;
|
|
2358
|
+
const O = b.value.getBoundingClientRect(), G = z.value;
|
|
2359
|
+
G.offsetHeight;
|
|
2360
|
+
const Z = G.getBoundingClientRect();
|
|
2361
|
+
let A = O.bottom + 4, P = O.left;
|
|
2362
|
+
P + Z.width > window.innerWidth && (P = window.innerWidth - Z.width - 8);
|
|
2363
|
+
let W = 274;
|
|
2364
|
+
if (A + Z.height > window.innerHeight) {
|
|
2365
|
+
const he = O.top - Z.height - 4;
|
|
2366
|
+
if (he >= 8)
|
|
2367
|
+
A = he;
|
|
2368
|
+
else {
|
|
2369
|
+
const Oe = window.innerHeight - O.bottom - 8, Ye = O.top - 8;
|
|
2370
|
+
Ye > Oe ? (A = 8, W = Math.max(120, Ye)) : W = Math.max(120, Oe);
|
|
2371
|
+
}
|
|
2372
|
+
}
|
|
2373
|
+
y.value = {
|
|
2374
|
+
top: `${A}px`,
|
|
2375
|
+
left: `${P}px`,
|
|
2376
|
+
maxHeight: `${W}px`
|
|
2373
2377
|
};
|
|
2374
2378
|
}, X = () => {
|
|
2375
|
-
e.disabled || (D.value = !0, $.value = m(),
|
|
2376
|
-
|
|
2379
|
+
e.disabled || (D.value = !0, $.value = m(), S.value = "", ze(() => {
|
|
2380
|
+
requestAnimationFrame(() => {
|
|
2381
|
+
g();
|
|
2382
|
+
});
|
|
2377
2383
|
}), t("visible-change", !0), t("focus", {}));
|
|
2378
2384
|
}, ne = () => {
|
|
2379
|
-
D.value = !1,
|
|
2380
|
-
}, K = (
|
|
2381
|
-
if (!
|
|
2382
|
-
if (
|
|
2383
|
-
const G = [...B.value], Z =
|
|
2385
|
+
D.value = !1, S.value = "", h.value = [], t("visible-change", !1), t("blur", {});
|
|
2386
|
+
}, K = (O) => {
|
|
2387
|
+
if (!O.disabled)
|
|
2388
|
+
if (E.value) {
|
|
2389
|
+
const G = [...B.value], Z = O[e.valueKey], A = G.indexOf(Z);
|
|
2384
2390
|
if (A > -1)
|
|
2385
2391
|
G.splice(A, 1), t("remove-tag", Z);
|
|
2386
2392
|
else {
|
|
@@ -2390,59 +2396,59 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2390
2396
|
}
|
|
2391
2397
|
x(G);
|
|
2392
2398
|
} else if (M.value)
|
|
2393
|
-
if (
|
|
2394
|
-
const G = Fe(
|
|
2399
|
+
if (O.children && O.children.length > 0) {
|
|
2400
|
+
const G = Fe(v.value, O[e.valueKey], e.valueKey, e.childrenKey);
|
|
2395
2401
|
h.value = G;
|
|
2396
2402
|
} else {
|
|
2397
|
-
const Z = Fe(
|
|
2403
|
+
const Z = Fe(v.value, O[e.valueKey], e.valueKey, e.childrenKey).map((A) => A[e.valueKey]);
|
|
2398
2404
|
x(Z), ne();
|
|
2399
2405
|
}
|
|
2400
2406
|
else
|
|
2401
|
-
x(
|
|
2402
|
-
}, re = (
|
|
2403
|
-
const G = B.value.filter((Z) => Z !==
|
|
2404
|
-
x(G), t("remove-tag",
|
|
2407
|
+
x(O[e.valueKey]), ne();
|
|
2408
|
+
}, re = (O) => {
|
|
2409
|
+
const G = B.value.filter((Z) => Z !== O[e.valueKey]);
|
|
2410
|
+
x(G), t("remove-tag", O[e.valueKey]);
|
|
2405
2411
|
}, q = () => {
|
|
2406
|
-
const
|
|
2407
|
-
x(
|
|
2408
|
-
}, me = (
|
|
2409
|
-
|
|
2410
|
-
},
|
|
2412
|
+
const O = E.value ? [] : "";
|
|
2413
|
+
x(O), t("clear");
|
|
2414
|
+
}, me = (O) => {
|
|
2415
|
+
S.value = O.target.value;
|
|
2416
|
+
}, ye = (O) => {
|
|
2411
2417
|
if (!b.value) return;
|
|
2412
|
-
const G =
|
|
2418
|
+
const G = O.target, Z = z.value && z.value.contains(G);
|
|
2413
2419
|
b.value.contains(G) || Z || ne();
|
|
2414
|
-
}, Se = (
|
|
2415
|
-
if (
|
|
2420
|
+
}, Se = (O) => {
|
|
2421
|
+
if (O.key === "Escape")
|
|
2416
2422
|
ne();
|
|
2417
|
-
else if (
|
|
2418
|
-
const G =
|
|
2423
|
+
else if (O.key === "Enter" && D.value) {
|
|
2424
|
+
const G = Y.value[I.value];
|
|
2419
2425
|
G && K(G);
|
|
2420
|
-
} else
|
|
2421
|
-
},
|
|
2426
|
+
} else O.key === "ArrowDown" && D.value ? (O.preventDefault(), I.value = Math.min(I.value + 1, Y.value.length - 1)) : O.key === "ArrowUp" && D.value && (O.preventDefault(), I.value = Math.max(I.value - 1, 0));
|
|
2427
|
+
}, we = (O) => B.value.includes(O[e.valueKey]), Te = (O, G) => [
|
|
2422
2428
|
l.e("option"),
|
|
2423
|
-
l.is("selected",
|
|
2424
|
-
l.is("disabled",
|
|
2429
|
+
l.is("selected", we(O)),
|
|
2430
|
+
l.is("disabled", O.disabled === !0),
|
|
2425
2431
|
l.is("hover", I.value === G),
|
|
2426
|
-
l.is("group", !!(
|
|
2432
|
+
l.is("group", !!(O.children && O.children.length > 0))
|
|
2427
2433
|
], Re = V(() => {
|
|
2428
2434
|
if (!M.value) return [];
|
|
2429
|
-
const
|
|
2435
|
+
const O = [v.value];
|
|
2430
2436
|
for (const G of h.value)
|
|
2431
|
-
G.children && G.children.length > 0 &&
|
|
2432
|
-
return
|
|
2437
|
+
G.children && G.children.length > 0 && O.push(G.children);
|
|
2438
|
+
return O;
|
|
2433
2439
|
});
|
|
2434
|
-
return
|
|
2435
|
-
document.addEventListener("mousedown",
|
|
2436
|
-
}),
|
|
2437
|
-
document.removeEventListener("mousedown",
|
|
2438
|
-
}), ie(D, (
|
|
2439
|
-
|
|
2440
|
-
}),
|
|
2440
|
+
return ge(() => {
|
|
2441
|
+
document.addEventListener("mousedown", ye), document.addEventListener("keydown", Se);
|
|
2442
|
+
}), De(() => {
|
|
2443
|
+
document.removeEventListener("mousedown", ye), document.removeEventListener("keydown", Se), document.removeEventListener("scroll", g, !0);
|
|
2444
|
+
}), ie(D, (O) => {
|
|
2445
|
+
O ? document.addEventListener("scroll", g, !0) : document.removeEventListener("scroll", g, !0);
|
|
2446
|
+
}), $e("select", {
|
|
2441
2447
|
selectedValues: B,
|
|
2442
2448
|
handleSelect: K,
|
|
2443
|
-
isSelected:
|
|
2449
|
+
isSelected: we,
|
|
2444
2450
|
registerOption: H
|
|
2445
|
-
}), (
|
|
2451
|
+
}), (O, G) => (i(), d("div", {
|
|
2446
2452
|
ref_key: "selectRef",
|
|
2447
2453
|
ref: b,
|
|
2448
2454
|
class: u(f.value)
|
|
@@ -2451,7 +2457,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2451
2457
|
class: u(n(l).e("wrapper")),
|
|
2452
2458
|
onClick: G[0] || (G[0] = (Z) => D.value ? ne() : X())
|
|
2453
2459
|
}, [
|
|
2454
|
-
|
|
2460
|
+
E.value && w.value.length > 0 ? (i(), d("div", {
|
|
2455
2461
|
key: 0,
|
|
2456
2462
|
class: u(n(l).e("tags"))
|
|
2457
2463
|
}, [
|
|
@@ -2465,7 +2471,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2465
2471
|
r("span", {
|
|
2466
2472
|
class: u(n(l).e("tag-close")),
|
|
2467
2473
|
onClick: ue((A) => re(Z), ["stop"])
|
|
2468
|
-
}, "×", 10,
|
|
2474
|
+
}, "×", 10, Yl)
|
|
2469
2475
|
], 2))), 128)),
|
|
2470
2476
|
o.value > 0 ? (i(), d("span", {
|
|
2471
2477
|
key: 0,
|
|
@@ -2476,12 +2482,12 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2476
2482
|
ref_key: "inputRef",
|
|
2477
2483
|
ref: T,
|
|
2478
2484
|
class: u(n(l).e("input")),
|
|
2479
|
-
placeholder:
|
|
2485
|
+
placeholder: E.value && w.value.length > 0 ? "" : s.placeholder,
|
|
2480
2486
|
disabled: s.disabled,
|
|
2481
2487
|
readonly: !s.filterable || !D.value,
|
|
2482
|
-
value: s.filterable && D.value ?
|
|
2488
|
+
value: s.filterable && D.value ? S.value : p.value,
|
|
2483
2489
|
onInput: me
|
|
2484
|
-
}, null, 42,
|
|
2490
|
+
}, null, 42, Ul),
|
|
2485
2491
|
r("span", {
|
|
2486
2492
|
class: u(n(l).e("suffix"))
|
|
2487
2493
|
}, [
|
|
@@ -2505,7 +2511,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2505
2511
|
default: He(() => [
|
|
2506
2512
|
oe(r("div", {
|
|
2507
2513
|
ref_key: "popperRef",
|
|
2508
|
-
ref:
|
|
2514
|
+
ref: z,
|
|
2509
2515
|
class: u([n(l).e("popper"), n(l).is("cascader", M.value)]),
|
|
2510
2516
|
style: te({ zIndex: $.value, ...y.value })
|
|
2511
2517
|
}, [
|
|
@@ -2517,32 +2523,32 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2517
2523
|
key: A,
|
|
2518
2524
|
class: u(n(l).e("cascader-panel"))
|
|
2519
2525
|
}, [
|
|
2520
|
-
(i(!0), d(J, null, _(Z, (
|
|
2521
|
-
key:
|
|
2522
|
-
class: u(
|
|
2523
|
-
onClick: ue((
|
|
2526
|
+
(i(!0), d(J, null, _(Z, (P, W) => (i(), d("div", {
|
|
2527
|
+
key: P[s.valueKey],
|
|
2528
|
+
class: u(Te(P, W)),
|
|
2529
|
+
onClick: ue((he) => K(P), ["stop", "prevent"])
|
|
2524
2530
|
}, [
|
|
2525
2531
|
r("span", {
|
|
2526
2532
|
class: u(n(l).e("option-label"))
|
|
2527
|
-
}, U(
|
|
2528
|
-
|
|
2533
|
+
}, U(P[s.labelKey]), 3),
|
|
2534
|
+
P.children && P.children.length > 0 ? (i(), d("span", {
|
|
2529
2535
|
key: 0,
|
|
2530
2536
|
class: u(n(l).e("option-arrow"))
|
|
2531
2537
|
}, "›", 2)) : N("", !0)
|
|
2532
|
-
], 10,
|
|
2538
|
+
], 10, Nl))), 128))
|
|
2533
2539
|
], 2))), 128))
|
|
2534
2540
|
], 2)) : (i(), d(J, { key: 1 }, [
|
|
2535
|
-
|
|
2541
|
+
Y.value.length === 0 && !n(c).default ? (i(), d("div", {
|
|
2536
2542
|
key: 0,
|
|
2537
2543
|
class: u(n(l).e("empty"))
|
|
2538
|
-
}, U(
|
|
2539
|
-
|
|
2544
|
+
}, U(S.value ? s.noMatchText : s.noDataText), 3)) : (i(), d(J, { key: 1 }, [
|
|
2545
|
+
O.$slots.default ? (i(), d("div", {
|
|
2540
2546
|
key: 0,
|
|
2541
2547
|
class: u(n(l).e("options"))
|
|
2542
2548
|
}, [
|
|
2543
2549
|
Q(n(a), null, {
|
|
2544
2550
|
default: He(() => [
|
|
2545
|
-
se(
|
|
2551
|
+
se(O.$slots, "default")
|
|
2546
2552
|
]),
|
|
2547
2553
|
_: 3
|
|
2548
2554
|
})
|
|
@@ -2550,24 +2556,24 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2550
2556
|
key: 1,
|
|
2551
2557
|
class: u(n(l).e("options"))
|
|
2552
2558
|
}, [
|
|
2553
|
-
(i(!0), d(J, null, _(
|
|
2559
|
+
(i(!0), d(J, null, _(Y.value, (Z, A) => (i(), d("div", {
|
|
2554
2560
|
key: Z[s.valueKey],
|
|
2555
|
-
class: u(
|
|
2556
|
-
onClick: ue((
|
|
2561
|
+
class: u(Te(Z, A)),
|
|
2562
|
+
onClick: ue((P) => K(Z), ["stop", "prevent"])
|
|
2557
2563
|
}, [
|
|
2558
2564
|
r("span", {
|
|
2559
2565
|
class: u(n(l).e("option-label"))
|
|
2560
2566
|
}, U(Z[s.labelKey]), 3),
|
|
2561
|
-
|
|
2567
|
+
we(Z) ? (i(), d("span", {
|
|
2562
2568
|
key: 0,
|
|
2563
2569
|
class: u(n(l).e("option-check"))
|
|
2564
2570
|
}, "✓", 2)) : N("", !0)
|
|
2565
|
-
], 10,
|
|
2571
|
+
], 10, Xl))), 128))
|
|
2566
2572
|
], 2))
|
|
2567
2573
|
], 64))
|
|
2568
2574
|
], 64))
|
|
2569
2575
|
], 6), [
|
|
2570
|
-
[
|
|
2576
|
+
[be, D.value]
|
|
2571
2577
|
])
|
|
2572
2578
|
]),
|
|
2573
2579
|
_: 3
|
|
@@ -2575,7 +2581,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2575
2581
|
]))
|
|
2576
2582
|
], 2));
|
|
2577
2583
|
}
|
|
2578
|
-
}),
|
|
2584
|
+
}), dt = /* @__PURE__ */ le({
|
|
2579
2585
|
name: "XSelectOption",
|
|
2580
2586
|
__name: "Option",
|
|
2581
2587
|
props: {
|
|
@@ -2584,22 +2590,22 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2584
2590
|
disabled: { type: Boolean, default: !1 }
|
|
2585
2591
|
},
|
|
2586
2592
|
setup(s) {
|
|
2587
|
-
const k = s, a = ae("select"), e =
|
|
2588
|
-
|
|
2593
|
+
const k = s, a = ae("select"), e = xe("select");
|
|
2594
|
+
ge(() => {
|
|
2589
2595
|
e && e.registerOption && e.registerOption({
|
|
2590
2596
|
value: k.value,
|
|
2591
2597
|
label: k.label,
|
|
2592
2598
|
disabled: k.disabled
|
|
2593
2599
|
});
|
|
2594
2600
|
});
|
|
2595
|
-
const t = V(() => !e || !e.selectedValues ? !1 : e.selectedValues.value.includes(k.value)), l = (
|
|
2596
|
-
|
|
2601
|
+
const t = V(() => !e || !e.selectedValues ? !1 : e.selectedValues.value.includes(k.value)), l = (c) => {
|
|
2602
|
+
c.stopPropagation(), c.preventDefault(), !k.disabled && e && e.handleSelect && e.handleSelect({
|
|
2597
2603
|
value: k.value,
|
|
2598
2604
|
label: k.label,
|
|
2599
2605
|
disabled: k.disabled
|
|
2600
2606
|
});
|
|
2601
2607
|
};
|
|
2602
|
-
return (
|
|
2608
|
+
return (c, m) => (i(), d("div", {
|
|
2603
2609
|
class: u([
|
|
2604
2610
|
n(a).e("option"),
|
|
2605
2611
|
n(a).is("selected", t.value),
|
|
@@ -2616,7 +2622,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2616
2622
|
}, "✓", 2)) : N("", !0)
|
|
2617
2623
|
], 2));
|
|
2618
2624
|
}
|
|
2619
|
-
}),
|
|
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"], ct = /* @__PURE__ */ le({
|
|
2620
2626
|
name: "XTransfer",
|
|
2621
2627
|
__name: "index",
|
|
2622
2628
|
props: {
|
|
@@ -2634,7 +2640,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2634
2640
|
},
|
|
2635
2641
|
emits: ["update:modelValue", "change", "left-check-change", "right-check-change"],
|
|
2636
2642
|
setup(s, { expose: k, emit: a }) {
|
|
2637
|
-
const e = s, t = a, l = ae("transfer"),
|
|
2643
|
+
const e = s, t = a, l = ae("transfer"), c = V(() => {
|
|
2638
2644
|
var o;
|
|
2639
2645
|
return ((o = e.props) == null ? void 0 : o.key) || "key";
|
|
2640
2646
|
}), m = V(() => {
|
|
@@ -2643,41 +2649,41 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2643
2649
|
}), b = V(() => {
|
|
2644
2650
|
var o;
|
|
2645
2651
|
return ((o = e.props) == null ? void 0 : o.disabled) || "disabled";
|
|
2646
|
-
}), T = R(""),
|
|
2647
|
-
const f =
|
|
2652
|
+
}), T = R(""), z = R(""), D = R([]), $ = R([]), S = (o) => o[c.value], I = (o) => o[m.value], y = (o) => o[b.value] || !1, L = V(() => e.data.filter((o) => {
|
|
2653
|
+
const f = S(o);
|
|
2648
2654
|
return e.modelValue.includes(f) ? !1 : e.filterable && T.value ? e.filterMethod ? e.filterMethod(T.value, o) : I(o).toLowerCase().includes(T.value.toLowerCase()) : !0;
|
|
2649
2655
|
})), H = V(() => {
|
|
2650
2656
|
const o = e.modelValue;
|
|
2651
2657
|
let f = e.data.filter((g) => {
|
|
2652
|
-
const X =
|
|
2658
|
+
const X = S(g);
|
|
2653
2659
|
return o.includes(X);
|
|
2654
2660
|
});
|
|
2655
|
-
return e.filterable &&
|
|
2656
|
-
}),
|
|
2661
|
+
return e.filterable && z.value && (f = f.filter((g) => e.filterMethod ? e.filterMethod(z.value, g) : I(g).toLowerCase().includes(z.value.toLowerCase()))), e.targetOrder === "push" ? f.sort((g, X) => o.indexOf(S(g)) - o.indexOf(S(X))) : e.targetOrder === "unshift" ? f.sort((g, X) => o.indexOf(S(X)) - o.indexOf(S(g))) : f;
|
|
2662
|
+
}), E = V(() => L.value.filter((o) => D.value.includes(S(o))).every((o) => y(o))), M = V(() => H.value.filter((o) => $.value.includes(S(o))).every((o) => y(o))), h = V(() => D.value.length === 0 || E.value), v = V(() => $.value.length === 0 || M.value), x = () => {
|
|
2657
2663
|
const o = D.value.filter((g) => {
|
|
2658
|
-
const X = e.data.find((ne) =>
|
|
2664
|
+
const X = e.data.find((ne) => S(ne) === g);
|
|
2659
2665
|
return X && !y(X);
|
|
2660
2666
|
});
|
|
2661
2667
|
let f;
|
|
2662
2668
|
e.targetOrder === "unshift" ? f = [...o, ...e.modelValue] : f = [...e.modelValue, ...o], t("update:modelValue", f), t("change", f, "right", o), D.value = [];
|
|
2663
2669
|
}, B = () => {
|
|
2664
2670
|
const o = $.value.filter((g) => {
|
|
2665
|
-
const X = e.data.find((ne) =>
|
|
2671
|
+
const X = e.data.find((ne) => S(ne) === g);
|
|
2666
2672
|
return X && !y(X);
|
|
2667
2673
|
}), f = e.modelValue.filter((g) => !o.includes(g));
|
|
2668
2674
|
t("update:modelValue", f), t("change", f, "left", o), $.value = [];
|
|
2669
2675
|
}, F = (o) => {
|
|
2670
2676
|
const f = D.value.indexOf(o);
|
|
2671
2677
|
f > -1 ? D.value.splice(f, 1) : D.value.push(o), t("left-check-change", [...D.value]);
|
|
2672
|
-
},
|
|
2678
|
+
}, Y = (o) => {
|
|
2673
2679
|
const f = $.value.indexOf(o);
|
|
2674
2680
|
f > -1 ? $.value.splice(f, 1) : $.value.push(o), t("right-check-change", [...$.value]);
|
|
2675
2681
|
}, j = () => {
|
|
2676
|
-
D.value.length === L.value.filter((o) => !y(o)).length ? D.value = [] : D.value = L.value.filter((o) => !y(o)).map((o) =>
|
|
2682
|
+
D.value.length === L.value.filter((o) => !y(o)).length ? D.value = [] : D.value = L.value.filter((o) => !y(o)).map((o) => S(o)), t("left-check-change", [...D.value]);
|
|
2677
2683
|
}, p = () => {
|
|
2678
|
-
$.value.length === H.value.filter((o) => !y(o)).length ? $.value = [] : $.value = H.value.filter((o) => !y(o)).map((o) =>
|
|
2684
|
+
$.value.length === H.value.filter((o) => !y(o)).length ? $.value = [] : $.value = H.value.filter((o) => !y(o)).map((o) => S(o)), t("right-check-change", [...$.value]);
|
|
2679
2685
|
}, w = (o) => {
|
|
2680
|
-
o === "left" ? T.value = "" :
|
|
2686
|
+
o === "left" ? T.value = "" : z.value = "";
|
|
2681
2687
|
}, C = V(() => [l.b()]);
|
|
2682
2688
|
return k({
|
|
2683
2689
|
clearQuery: w
|
|
@@ -2698,7 +2704,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2698
2704
|
checked: D.value.length > 0 && D.value.length === L.value.filter((g) => !y(g)).length,
|
|
2699
2705
|
indeterminate: D.value.length > 0 && D.value.length < L.value.filter((g) => !y(g)).length,
|
|
2700
2706
|
onChange: j
|
|
2701
|
-
}, null, 40,
|
|
2707
|
+
}, null, 40, Kl),
|
|
2702
2708
|
r("span", null, U(s.titles[0]), 1)
|
|
2703
2709
|
], 2),
|
|
2704
2710
|
r("span", {
|
|
@@ -2713,8 +2719,8 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2713
2719
|
"onUpdate:modelValue": f[0] || (f[0] = (g) => T.value = g),
|
|
2714
2720
|
placeholder: s.filterPlaceholder,
|
|
2715
2721
|
class: u(n(l).e("filter-input"))
|
|
2716
|
-
}, null, 10,
|
|
2717
|
-
[
|
|
2722
|
+
}, null, 10, Wl), [
|
|
2723
|
+
[Ve, T.value]
|
|
2718
2724
|
]),
|
|
2719
2725
|
T.value ? (i(), d("span", {
|
|
2720
2726
|
key: 0,
|
|
@@ -2726,28 +2732,28 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2726
2732
|
class: u(n(l).e("body"))
|
|
2727
2733
|
}, [
|
|
2728
2734
|
(i(!0), d(J, null, _(L.value, (g) => (i(), d("div", {
|
|
2729
|
-
key:
|
|
2735
|
+
key: S(g),
|
|
2730
2736
|
class: u([
|
|
2731
2737
|
n(l).e("item"),
|
|
2732
2738
|
n(l).is("disabled", y(g)),
|
|
2733
|
-
n(l).is("checked", D.value.includes(
|
|
2739
|
+
n(l).is("checked", D.value.includes(S(g)))
|
|
2734
2740
|
]),
|
|
2735
|
-
onClick: (X) => !y(g) && F(
|
|
2741
|
+
onClick: (X) => !y(g) && F(S(g))
|
|
2736
2742
|
}, [
|
|
2737
2743
|
r("label", {
|
|
2738
2744
|
class: u(n(l).e("checkbox"))
|
|
2739
2745
|
}, [
|
|
2740
2746
|
r("input", {
|
|
2741
2747
|
type: "checkbox",
|
|
2742
|
-
checked: D.value.includes(
|
|
2748
|
+
checked: D.value.includes(S(g)),
|
|
2743
2749
|
disabled: y(g),
|
|
2744
2750
|
onClick: f[2] || (f[2] = ue(() => {
|
|
2745
2751
|
}, ["stop"])),
|
|
2746
|
-
onChange: (X) => F(
|
|
2747
|
-
}, null, 40,
|
|
2752
|
+
onChange: (X) => F(S(g))
|
|
2753
|
+
}, null, 40, jl),
|
|
2748
2754
|
r("span", null, U(I(g)), 1)
|
|
2749
2755
|
], 2)
|
|
2750
|
-
], 10,
|
|
2756
|
+
], 10, ql))), 128)),
|
|
2751
2757
|
L.value.length === 0 ? (i(), d("div", {
|
|
2752
2758
|
key: 0,
|
|
2753
2759
|
class: u(n(l).e("empty"))
|
|
@@ -2765,12 +2771,12 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2765
2771
|
class: u([n(l).e("button"), n(l).is("disabled", h.value)]),
|
|
2766
2772
|
disabled: h.value,
|
|
2767
2773
|
onClick: x
|
|
2768
|
-
}, U(s.buttonTexts[0] || ">"), 11,
|
|
2774
|
+
}, U(s.buttonTexts[0] || ">"), 11, Gl),
|
|
2769
2775
|
r("button", {
|
|
2770
|
-
class: u([n(l).e("button"), n(l).is("disabled",
|
|
2771
|
-
disabled:
|
|
2776
|
+
class: u([n(l).e("button"), n(l).is("disabled", v.value)]),
|
|
2777
|
+
disabled: v.value,
|
|
2772
2778
|
onClick: B
|
|
2773
|
-
}, U(s.buttonTexts[1] || "<"), 11,
|
|
2779
|
+
}, U(s.buttonTexts[1] || "<"), 11, Jl)
|
|
2774
2780
|
], 2),
|
|
2775
2781
|
r("div", {
|
|
2776
2782
|
class: u(n(l).e("panel"))
|
|
@@ -2786,7 +2792,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2786
2792
|
checked: $.value.length > 0 && $.value.length === H.value.filter((g) => !y(g)).length,
|
|
2787
2793
|
indeterminate: $.value.length > 0 && $.value.length < H.value.filter((g) => !y(g)).length,
|
|
2788
2794
|
onChange: p
|
|
2789
|
-
}, null, 40,
|
|
2795
|
+
}, null, 40, Zl),
|
|
2790
2796
|
r("span", null, U(s.titles[1]), 1)
|
|
2791
2797
|
], 2),
|
|
2792
2798
|
r("span", {
|
|
@@ -2798,13 +2804,13 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2798
2804
|
class: u(n(l).e("filter"))
|
|
2799
2805
|
}, [
|
|
2800
2806
|
oe(r("input", {
|
|
2801
|
-
"onUpdate:modelValue": f[3] || (f[3] = (g) =>
|
|
2807
|
+
"onUpdate:modelValue": f[3] || (f[3] = (g) => z.value = g),
|
|
2802
2808
|
placeholder: s.filterPlaceholder,
|
|
2803
2809
|
class: u(n(l).e("filter-input"))
|
|
2804
|
-
}, null, 10,
|
|
2805
|
-
[
|
|
2810
|
+
}, null, 10, Ql), [
|
|
2811
|
+
[Ve, z.value]
|
|
2806
2812
|
]),
|
|
2807
|
-
|
|
2813
|
+
z.value ? (i(), d("span", {
|
|
2808
2814
|
key: 0,
|
|
2809
2815
|
class: u(n(l).e("filter-clear")),
|
|
2810
2816
|
onClick: f[4] || (f[4] = (g) => w("right"))
|
|
@@ -2814,28 +2820,28 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2814
2820
|
class: u(n(l).e("body"))
|
|
2815
2821
|
}, [
|
|
2816
2822
|
(i(!0), d(J, null, _(H.value, (g) => (i(), d("div", {
|
|
2817
|
-
key:
|
|
2823
|
+
key: S(g),
|
|
2818
2824
|
class: u([
|
|
2819
2825
|
n(l).e("item"),
|
|
2820
2826
|
n(l).is("disabled", y(g)),
|
|
2821
|
-
n(l).is("checked", $.value.includes(
|
|
2827
|
+
n(l).is("checked", $.value.includes(S(g)))
|
|
2822
2828
|
]),
|
|
2823
|
-
onClick: (X) => !y(g) &&
|
|
2829
|
+
onClick: (X) => !y(g) && Y(S(g))
|
|
2824
2830
|
}, [
|
|
2825
2831
|
r("label", {
|
|
2826
2832
|
class: u(n(l).e("checkbox"))
|
|
2827
2833
|
}, [
|
|
2828
2834
|
r("input", {
|
|
2829
2835
|
type: "checkbox",
|
|
2830
|
-
checked: $.value.includes(
|
|
2836
|
+
checked: $.value.includes(S(g)),
|
|
2831
2837
|
disabled: y(g),
|
|
2832
2838
|
onClick: f[5] || (f[5] = ue(() => {
|
|
2833
2839
|
}, ["stop"])),
|
|
2834
|
-
onChange: (X) =>
|
|
2835
|
-
}, null, 40,
|
|
2840
|
+
onChange: (X) => Y(S(g))
|
|
2841
|
+
}, null, 40, ea),
|
|
2836
2842
|
r("span", null, U(I(g)), 1)
|
|
2837
2843
|
], 2)
|
|
2838
|
-
], 10,
|
|
2844
|
+
], 10, _l))), 128)),
|
|
2839
2845
|
H.value.length === 0 ? (i(), d("div", {
|
|
2840
2846
|
key: 0,
|
|
2841
2847
|
class: u(n(l).e("empty"))
|
|
@@ -2848,7 +2854,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2848
2854
|
], 2)
|
|
2849
2855
|
], 2));
|
|
2850
2856
|
}
|
|
2851
|
-
}),
|
|
2857
|
+
}), la = { key: 0 }, aa = { key: 1 }, vt = /* @__PURE__ */ le({
|
|
2852
2858
|
name: "XSlider",
|
|
2853
2859
|
__name: "index",
|
|
2854
2860
|
props: {
|
|
@@ -2866,10 +2872,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2866
2872
|
},
|
|
2867
2873
|
emits: ["update:modelValue", "change", "input"],
|
|
2868
2874
|
setup(s, { emit: k }) {
|
|
2869
|
-
const a = s, e = k, t = ae("slider"), l = R(),
|
|
2875
|
+
const a = s, e = k, t = ae("slider"), l = R(), c = R(), m = R(!1), b = R(!1), T = V(() => {
|
|
2870
2876
|
const w = a.max - a.min;
|
|
2871
2877
|
return (a.modelValue - a.min) / w * 100;
|
|
2872
|
-
}),
|
|
2878
|
+
}), z = V(() => a.formatTooltip ? a.formatTooltip(a.modelValue) : a.modelValue), D = V(() => {
|
|
2873
2879
|
if (!a.showStops || a.min >= a.max) return [];
|
|
2874
2880
|
const w = [], C = (a.max - a.min) / a.step;
|
|
2875
2881
|
for (let o = 0; o <= C; o++) {
|
|
@@ -2881,9 +2887,9 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2881
2887
|
const C = Number(w), o = a.marks[C], f = (C - a.min) / (a.max - a.min) * 100;
|
|
2882
2888
|
let g, X = {};
|
|
2883
2889
|
return typeof o == "string" ? g = o : (g = o.label || String(C), X = o.style || {}), { value: C, pos: f, label: g, style: X };
|
|
2884
|
-
}) : []),
|
|
2890
|
+
}) : []), S = () => l.value ? a.vertical ? l.value.offsetHeight : l.value.offsetWidth : 0, I = (w, C) => {
|
|
2885
2891
|
if (!l.value) return a.modelValue;
|
|
2886
|
-
const o = l.value.getBoundingClientRect(), f =
|
|
2892
|
+
const o = l.value.getBoundingClientRect(), f = S();
|
|
2887
2893
|
let g;
|
|
2888
2894
|
a.vertical ? g = (o.bottom - C) / f * 100 : g = (w - o.left) / f * 100, g = Math.max(0, Math.min(100, g));
|
|
2889
2895
|
const X = a.min + g / 100 * (a.max - a.min), ne = Math.round(X / a.step) * a.step;
|
|
@@ -2896,13 +2902,13 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2896
2902
|
if (a.disabled) return;
|
|
2897
2903
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
2898
2904
|
const C = I(w.clientX, w.clientY);
|
|
2899
|
-
y(C), document.addEventListener("mousemove", H), document.addEventListener("mouseup",
|
|
2905
|
+
y(C), document.addEventListener("mousemove", H), document.addEventListener("mouseup", E);
|
|
2900
2906
|
}, H = (w) => {
|
|
2901
2907
|
if (!b.value) return;
|
|
2902
2908
|
const C = I(w.clientX, w.clientY);
|
|
2903
2909
|
y(C);
|
|
2904
|
-
},
|
|
2905
|
-
b.value = !1, e("change", a.modelValue), document.removeEventListener("mousemove", H), document.removeEventListener("mouseup",
|
|
2910
|
+
}, E = () => {
|
|
2911
|
+
b.value = !1, e("change", a.modelValue), document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", E);
|
|
2906
2912
|
}, M = (w) => {
|
|
2907
2913
|
if (a.disabled) return;
|
|
2908
2914
|
w.preventDefault(), b.value = !0, m.value = !0;
|
|
@@ -2912,24 +2918,24 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2912
2918
|
if (!b.value) return;
|
|
2913
2919
|
const C = w.touches[0], o = I(C.clientX, C.clientY);
|
|
2914
2920
|
y(o);
|
|
2915
|
-
},
|
|
2921
|
+
}, v = () => {
|
|
2916
2922
|
b.value = !1, e("change", a.modelValue);
|
|
2917
2923
|
}, x = () => {
|
|
2918
2924
|
a.showTooltip && (m.value = !0);
|
|
2919
2925
|
}, B = () => {
|
|
2920
2926
|
b.value || (m.value = !1);
|
|
2921
2927
|
};
|
|
2922
|
-
|
|
2923
|
-
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup",
|
|
2928
|
+
De(() => {
|
|
2929
|
+
document.removeEventListener("mousemove", H), document.removeEventListener("mouseup", E);
|
|
2924
2930
|
});
|
|
2925
2931
|
const F = V(() => [
|
|
2926
2932
|
t.b(),
|
|
2927
2933
|
t.is("disabled", a.disabled),
|
|
2928
2934
|
t.is("vertical", a.vertical)
|
|
2929
|
-
]),
|
|
2935
|
+
]), 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}%` });
|
|
2930
2936
|
return (w, C) => (i(), d("div", {
|
|
2931
2937
|
class: u(F.value),
|
|
2932
|
-
style: te(
|
|
2938
|
+
style: te(Y.value)
|
|
2933
2939
|
}, [
|
|
2934
2940
|
r("div", {
|
|
2935
2941
|
ref_key: "sliderRef",
|
|
@@ -2942,14 +2948,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2942
2948
|
class: u(n(t).e("bar")),
|
|
2943
2949
|
style: te(j.value)
|
|
2944
2950
|
}, null, 6),
|
|
2945
|
-
s.showStops ? (i(), d("div",
|
|
2951
|
+
s.showStops ? (i(), d("div", la, [
|
|
2946
2952
|
(i(!0), d(J, null, _(D.value, (o, f) => (i(), d("div", {
|
|
2947
2953
|
key: f,
|
|
2948
2954
|
class: u(n(t).e("stop")),
|
|
2949
2955
|
style: te(s.vertical ? { bottom: `${o}%` } : { left: `${o}%` })
|
|
2950
2956
|
}, null, 6))), 128))
|
|
2951
2957
|
])) : N("", !0),
|
|
2952
|
-
$.value.length > 0 ? (i(), d("div",
|
|
2958
|
+
$.value.length > 0 ? (i(), d("div", aa, [
|
|
2953
2959
|
(i(!0), d(J, null, _($.value, (o) => (i(), d("div", {
|
|
2954
2960
|
key: o.value,
|
|
2955
2961
|
class: u(n(t).e("mark")),
|
|
@@ -2962,18 +2968,18 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2962
2968
|
])) : N("", !0),
|
|
2963
2969
|
r("div", {
|
|
2964
2970
|
ref_key: "buttonRef",
|
|
2965
|
-
ref:
|
|
2971
|
+
ref: c,
|
|
2966
2972
|
class: u(n(t).e("button-wrapper")),
|
|
2967
2973
|
style: te(p.value),
|
|
2968
2974
|
onMouseenter: x,
|
|
2969
2975
|
onMouseleave: B,
|
|
2970
2976
|
onTouchmove: h,
|
|
2971
|
-
onTouchend:
|
|
2977
|
+
onTouchend: v
|
|
2972
2978
|
}, [
|
|
2973
2979
|
s.showTooltip && m.value ? (i(), d("div", {
|
|
2974
2980
|
key: 0,
|
|
2975
2981
|
class: u(n(t).e("tooltip"))
|
|
2976
|
-
}, U(
|
|
2982
|
+
}, U(z.value), 3)) : N("", !0),
|
|
2977
2983
|
r("div", {
|
|
2978
2984
|
class: u(n(t).e("button"))
|
|
2979
2985
|
}, null, 2)
|
|
@@ -2981,22 +2987,22 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
2981
2987
|
], 34)
|
|
2982
2988
|
], 6));
|
|
2983
2989
|
}
|
|
2984
|
-
}),
|
|
2990
|
+
}), ta = ["src"], na = {
|
|
2985
2991
|
key: 0,
|
|
2986
2992
|
class: "status-uploading"
|
|
2987
|
-
},
|
|
2993
|
+
}, sa = { class: "progress-circle" }, ua = { class: "progress-text" }, oa = {
|
|
2988
2994
|
key: 1,
|
|
2989
2995
|
class: "status-error"
|
|
2990
|
-
},
|
|
2996
|
+
}, ia = {
|
|
2991
2997
|
key: 2,
|
|
2992
2998
|
class: "status-success"
|
|
2993
|
-
},
|
|
2999
|
+
}, ra = {
|
|
2994
3000
|
key: 0,
|
|
2995
3001
|
class: "action-preview"
|
|
2996
|
-
},
|
|
3002
|
+
}, da = ["onClick"], ca = ["disabled"], va = { class: "progress-text" }, fa = ["onClick"], ma = ["src"], ha = {
|
|
2997
3003
|
key: 0,
|
|
2998
3004
|
class: "action-success"
|
|
2999
|
-
},
|
|
3005
|
+
}, pa = ["onClick"], ga = ["multiple", "accept", "disabled"], ft = /* @__PURE__ */ le({
|
|
3000
3006
|
name: "XUpload",
|
|
3001
3007
|
__name: "index",
|
|
3002
3008
|
props: {
|
|
@@ -3028,9 +3034,9 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3028
3034
|
setup(s, { expose: k, emit: a }) {
|
|
3029
3035
|
const e = s, t = a, l = ae("upload");
|
|
3030
3036
|
Le();
|
|
3031
|
-
const
|
|
3037
|
+
const c = R(), m = R([...e.fileList]), b = R(!1);
|
|
3032
3038
|
let T = 1;
|
|
3033
|
-
const
|
|
3039
|
+
const z = () => Date.now() + T++, D = (p) => {
|
|
3034
3040
|
var o;
|
|
3035
3041
|
const w = (o = p.name.split(".").pop()) == null ? void 0 : o.toLowerCase(), C = {
|
|
3036
3042
|
pdf: "📄",
|
|
@@ -3047,14 +3053,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3047
3053
|
default: "📁"
|
|
3048
3054
|
};
|
|
3049
3055
|
return C[w || ""] || C.default;
|
|
3050
|
-
}, $ = V(() => e.limit ? m.value.length < e.limit : !0),
|
|
3056
|
+
}, $ = V(() => e.limit ? m.value.length < e.limit : !0), S = V(() => [
|
|
3051
3057
|
l.b(),
|
|
3052
3058
|
l.is("disabled", e.disabled),
|
|
3053
3059
|
l.is("drag", e.drag),
|
|
3054
3060
|
l.m(e.listType)
|
|
3055
3061
|
]), I = (p) => {
|
|
3056
3062
|
const w = p.target.files;
|
|
3057
|
-
!w || w.length === 0 || (y(Array.from(w)),
|
|
3063
|
+
!w || w.length === 0 || (y(Array.from(w)), c.value && (c.value.value = ""));
|
|
3058
3064
|
}, y = async (p) => {
|
|
3059
3065
|
var w, C;
|
|
3060
3066
|
if (e.limit && m.value.length + p.length > e.limit) {
|
|
@@ -3069,7 +3075,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3069
3075
|
size: o.size,
|
|
3070
3076
|
status: "ready",
|
|
3071
3077
|
percentage: 0,
|
|
3072
|
-
uid:
|
|
3078
|
+
uid: z(),
|
|
3073
3079
|
raw: o
|
|
3074
3080
|
};
|
|
3075
3081
|
o.type.startsWith("image/") && (f.thumbUrl = await L(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,7 +3088,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3082
3088
|
}, C.readAsDataURL(p);
|
|
3083
3089
|
}), H = (p) => {
|
|
3084
3090
|
if (!p.raw) return;
|
|
3085
|
-
p.status = "uploading", (e.httpRequest ||
|
|
3091
|
+
p.status = "uploading", (e.httpRequest || E)({
|
|
3086
3092
|
action: e.action,
|
|
3087
3093
|
headers: e.headers,
|
|
3088
3094
|
data: e.data,
|
|
@@ -3102,7 +3108,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3102
3108
|
p.status = "error", t("error", C, p, m.value), (o = e.onError) == null || o.call(e, C, p, m.value);
|
|
3103
3109
|
}
|
|
3104
3110
|
});
|
|
3105
|
-
},
|
|
3111
|
+
}, E = (p) => new Promise((w, C) => {
|
|
3106
3112
|
const o = new XMLHttpRequest();
|
|
3107
3113
|
o.upload.addEventListener("progress", (g) => {
|
|
3108
3114
|
g.lengthComputable && p.onProgress({ percent: g.loaded / g.total * 100 });
|
|
@@ -3134,16 +3140,16 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3134
3140
|
w > -1 && (m.value.splice(w, 1), t("update:fileList", m.value), t("remove", p, m.value), (C = e.onRemove) == null || C.call(e, p, m.value));
|
|
3135
3141
|
}, h = () => {
|
|
3136
3142
|
m.value.filter((p) => p.status === "ready" && p.raw).forEach((p) => H(p));
|
|
3137
|
-
},
|
|
3143
|
+
}, v = () => {
|
|
3138
3144
|
m.value = [], t("update:fileList", m.value);
|
|
3139
3145
|
}, x = () => {
|
|
3140
3146
|
var p;
|
|
3141
|
-
e.disabled || (p =
|
|
3147
|
+
e.disabled || (p = c.value) == null || p.click();
|
|
3142
3148
|
}, B = (p) => {
|
|
3143
3149
|
p.preventDefault(), !e.disabled && e.drag && (b.value = !0);
|
|
3144
3150
|
}, F = () => {
|
|
3145
3151
|
b.value = !1;
|
|
3146
|
-
},
|
|
3152
|
+
}, Y = (p) => {
|
|
3147
3153
|
var C;
|
|
3148
3154
|
if (p.preventDefault(), b.value = !1, e.disabled) return;
|
|
3149
3155
|
const w = (C = p.dataTransfer) == null ? void 0 : C.files;
|
|
@@ -3158,10 +3164,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3158
3164
|
};
|
|
3159
3165
|
return k({
|
|
3160
3166
|
submit: h,
|
|
3161
|
-
clearFiles:
|
|
3167
|
+
clearFiles: v,
|
|
3162
3168
|
uploadFiles: m
|
|
3163
3169
|
}), (p, w) => (i(), d("div", {
|
|
3164
|
-
class: u(
|
|
3170
|
+
class: u(S.value)
|
|
3165
3171
|
}, [
|
|
3166
3172
|
s.drag ? (i(), d("div", {
|
|
3167
3173
|
key: 0,
|
|
@@ -3169,7 +3175,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3169
3175
|
onClick: x,
|
|
3170
3176
|
onDragover: B,
|
|
3171
3177
|
onDragleave: F,
|
|
3172
|
-
onDrop:
|
|
3178
|
+
onDrop: Y
|
|
3173
3179
|
}, [
|
|
3174
3180
|
se(p.$slots, "drag", {}, () => [
|
|
3175
3181
|
r("span", {
|
|
@@ -3194,20 +3200,20 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3194
3200
|
key: 0,
|
|
3195
3201
|
src: C.thumbUrl,
|
|
3196
3202
|
class: u(n(l).e("file-image"))
|
|
3197
|
-
}, null, 10,
|
|
3203
|
+
}, null, 10, ta)) : (i(), d("div", {
|
|
3198
3204
|
key: 1,
|
|
3199
3205
|
class: u(n(l).e("file-status"))
|
|
3200
3206
|
}, [
|
|
3201
|
-
C.status === "uploading" ? (i(), d("span",
|
|
3202
|
-
r("span",
|
|
3203
|
-
r("span",
|
|
3207
|
+
C.status === "uploading" ? (i(), d("span", na, [
|
|
3208
|
+
r("span", sa, [
|
|
3209
|
+
r("span", ua, U(Math.round(C.percentage || 0)) + "%", 1)
|
|
3204
3210
|
])
|
|
3205
|
-
])) : C.status === "error" ? (i(), d("span",
|
|
3211
|
+
])) : C.status === "error" ? (i(), d("span", oa, [
|
|
3206
3212
|
Q(n(ee), {
|
|
3207
3213
|
name: "close",
|
|
3208
3214
|
size: 16
|
|
3209
3215
|
})
|
|
3210
|
-
])) : C.status === "success" ? (i(), d("span",
|
|
3216
|
+
])) : C.status === "success" ? (i(), d("span", ia, [
|
|
3211
3217
|
Q(n(ee), {
|
|
3212
3218
|
name: "check",
|
|
3213
3219
|
size: 16
|
|
@@ -3217,7 +3223,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3217
3223
|
r("span", {
|
|
3218
3224
|
class: u(n(l).e("file-actions"))
|
|
3219
3225
|
}, [
|
|
3220
|
-
C.url ? (i(), d("span",
|
|
3226
|
+
C.url ? (i(), d("span", ra, [
|
|
3221
3227
|
Q(n(ee), {
|
|
3222
3228
|
name: "eye",
|
|
3223
3229
|
size: 14
|
|
@@ -3231,7 +3237,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3231
3237
|
name: "delete",
|
|
3232
3238
|
size: 14
|
|
3233
3239
|
})
|
|
3234
|
-
], 8,
|
|
3240
|
+
], 8, da)
|
|
3235
3241
|
], 2)
|
|
3236
3242
|
], 2))), 128)),
|
|
3237
3243
|
$.value ? (i(), d("li", {
|
|
@@ -3258,7 +3264,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3258
3264
|
se(p.$slots, "default", {}, () => [
|
|
3259
3265
|
w[2] || (w[2] = de("点击上传", -1))
|
|
3260
3266
|
])
|
|
3261
|
-
], 10,
|
|
3267
|
+
], 10, ca)) : N("", !0)
|
|
3262
3268
|
])
|
|
3263
3269
|
], 2),
|
|
3264
3270
|
s.showFileList && m.value.length > 0 ? (i(), d("ul", {
|
|
@@ -3287,7 +3293,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3287
3293
|
class: "progress-bar",
|
|
3288
3294
|
style: te({ width: C.percentage + "%" })
|
|
3289
3295
|
}, null, 4),
|
|
3290
|
-
r("span",
|
|
3296
|
+
r("span", va, U(Math.round(C.percentage || 0)) + "%", 1)
|
|
3291
3297
|
], 2)) : N("", !0),
|
|
3292
3298
|
C.status === "success" ? (i(), d("span", {
|
|
3293
3299
|
key: 1,
|
|
@@ -3318,14 +3324,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3318
3324
|
name: "close",
|
|
3319
3325
|
size: 14
|
|
3320
3326
|
})
|
|
3321
|
-
], 8,
|
|
3327
|
+
], 8, fa)
|
|
3322
3328
|
], 2)
|
|
3323
3329
|
], 64)) : s.listType === "picture" ? (i(), d(J, { key: 1 }, [
|
|
3324
3330
|
C.thumbUrl ? (i(), d("img", {
|
|
3325
3331
|
key: 0,
|
|
3326
3332
|
src: C.thumbUrl,
|
|
3327
3333
|
class: u(n(l).e("file-thumb"))
|
|
3328
|
-
}, null, 10,
|
|
3334
|
+
}, null, 10, ma)) : (i(), d("span", {
|
|
3329
3335
|
key: 1,
|
|
3330
3336
|
class: u(n(l).e("file-icon"))
|
|
3331
3337
|
}, U(D(C)), 3)),
|
|
@@ -3348,7 +3354,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3348
3354
|
r("span", {
|
|
3349
3355
|
class: u(n(l).e("file-actions"))
|
|
3350
3356
|
}, [
|
|
3351
|
-
C.status === "success" ? (i(), d("span",
|
|
3357
|
+
C.status === "success" ? (i(), d("span", ha, [
|
|
3352
3358
|
Q(n(ee), {
|
|
3353
3359
|
name: "check",
|
|
3354
3360
|
size: 14
|
|
@@ -3362,7 +3368,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3362
3368
|
name: "close",
|
|
3363
3369
|
size: 14
|
|
3364
3370
|
})
|
|
3365
|
-
], 8,
|
|
3371
|
+
], 8, pa)
|
|
3366
3372
|
], 2)
|
|
3367
3373
|
], 64)) : N("", !0)
|
|
3368
3374
|
], 2))), 128))
|
|
@@ -3370,14 +3376,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3370
3376
|
], 64)),
|
|
3371
3377
|
r("input", {
|
|
3372
3378
|
ref_key: "inputRef",
|
|
3373
|
-
ref:
|
|
3379
|
+
ref: c,
|
|
3374
3380
|
type: "file",
|
|
3375
3381
|
class: u(n(l).e("input")),
|
|
3376
3382
|
multiple: s.multiple,
|
|
3377
3383
|
accept: s.accept,
|
|
3378
3384
|
disabled: s.disabled,
|
|
3379
3385
|
onChange: I
|
|
3380
|
-
}, null, 42,
|
|
3386
|
+
}, null, 42, ga),
|
|
3381
3387
|
p.$slots.tip ? (i(), d("div", {
|
|
3382
3388
|
key: 3,
|
|
3383
3389
|
class: u(n(l).e("tip"))
|
|
@@ -3386,7 +3392,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3386
3392
|
], 2)) : N("", !0)
|
|
3387
3393
|
], 2));
|
|
3388
3394
|
}
|
|
3389
|
-
}),
|
|
3395
|
+
}), ba = ["onMousemove", "onClick"], mt = /* @__PURE__ */ le({
|
|
3390
3396
|
name: "XRate",
|
|
3391
3397
|
__name: "index",
|
|
3392
3398
|
props: {
|
|
@@ -3412,15 +3418,15 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3412
3418
|
},
|
|
3413
3419
|
emits: ["update:modelValue", "change"],
|
|
3414
3420
|
setup(s, { emit: k }) {
|
|
3415
|
-
const a = s, e = k, t = ae("rate"), l = R(-1),
|
|
3421
|
+
const a = s, e = k, t = ae("rate"), l = R(-1), c = V(() => l.value > -1 ? l.value : a.modelValue), m = V(() => [
|
|
3416
3422
|
t.b(),
|
|
3417
3423
|
t.m(a.size),
|
|
3418
3424
|
t.is("disabled", a.disabled),
|
|
3419
3425
|
t.is("readonly", a.readonly)
|
|
3420
3426
|
]), 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) => {
|
|
3421
|
-
const L =
|
|
3427
|
+
const L = c.value;
|
|
3422
3428
|
return L >= y ? 100 : a.allowHalf && L >= y - 0.5 ? 50 : 0;
|
|
3423
|
-
},
|
|
3429
|
+
}, z = (y) => T(y) > 0 ? b(c.value) : a.disabled ? a.disabledVoidColor : a.voidColor, D = V(() => {
|
|
3424
3430
|
if (a.showScore)
|
|
3425
3431
|
return a.scoreTemplate.replace("{value}", String(a.modelValue));
|
|
3426
3432
|
if (a.showText) {
|
|
@@ -3431,11 +3437,11 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3431
3437
|
}), $ = (y, L) => {
|
|
3432
3438
|
if (!(a.disabled || a.readonly))
|
|
3433
3439
|
if (a.allowHalf) {
|
|
3434
|
-
const
|
|
3440
|
+
const E = L.currentTarget.getBoundingClientRect(), M = L.clientX - E.left < E.width / 2;
|
|
3435
3441
|
l.value = M ? y - 0.5 : y;
|
|
3436
3442
|
} else
|
|
3437
3443
|
l.value = y;
|
|
3438
|
-
},
|
|
3444
|
+
}, S = () => {
|
|
3439
3445
|
a.disabled || a.readonly || (l.value = -1);
|
|
3440
3446
|
}, I = (y, L) => {
|
|
3441
3447
|
if (a.disabled || a.readonly) return;
|
|
@@ -3449,7 +3455,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3449
3455
|
};
|
|
3450
3456
|
return (y, L) => (i(), d("div", {
|
|
3451
3457
|
class: u(m.value),
|
|
3452
|
-
onMouseleave:
|
|
3458
|
+
onMouseleave: S
|
|
3453
3459
|
}, [
|
|
3454
3460
|
r("div", {
|
|
3455
3461
|
class: u(n(t).e("items"))
|
|
@@ -3457,8 +3463,8 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3457
3463
|
(i(!0), d(J, null, _(s.max, (H) => (i(), d("span", {
|
|
3458
3464
|
key: H,
|
|
3459
3465
|
class: u(n(t).e("item")),
|
|
3460
|
-
onMousemove: (
|
|
3461
|
-
onClick: (
|
|
3466
|
+
onMousemove: (E) => $(H, E),
|
|
3467
|
+
onClick: (E) => I(H, E)
|
|
3462
3468
|
}, [
|
|
3463
3469
|
r("span", {
|
|
3464
3470
|
class: u(n(t).e("void")),
|
|
@@ -3467,11 +3473,11 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3467
3473
|
r("span", {
|
|
3468
3474
|
class: u([n(t).e("fill"), T(H) > 0 ? "is-active" : ""]),
|
|
3469
3475
|
style: te({
|
|
3470
|
-
color:
|
|
3476
|
+
color: z(H),
|
|
3471
3477
|
clipPath: `inset(0 ${100 - T(H)}% 0 0)`
|
|
3472
3478
|
})
|
|
3473
3479
|
}, U(s.icon), 7)
|
|
3474
|
-
], 42,
|
|
3480
|
+
], 42, ba))), 128))
|
|
3475
3481
|
], 2),
|
|
3476
3482
|
s.showText || s.showScore ? (i(), d("div", {
|
|
3477
3483
|
key: 0,
|
|
@@ -3480,10 +3486,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3480
3486
|
}, U(D.value), 7)) : N("", !0)
|
|
3481
3487
|
], 34));
|
|
3482
3488
|
}
|
|
3483
|
-
}),
|
|
3489
|
+
}), ya = ["value"], ka = { class: "field-type" }, Ma = { class: "field-name" }, Va = { class: "field-label" }, xa = {
|
|
3484
3490
|
key: 0,
|
|
3485
3491
|
class: "field-required"
|
|
3486
|
-
},
|
|
3492
|
+
}, wa = ["onClick"], Ca = ["onClick"], $a = ["onClick"], Da = ["onClick"], za = { class: "modal-content" }, Sa = { 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" }, Fa = { class: "edit-field" }, ht = /* @__PURE__ */ le({
|
|
3487
3493
|
name: "XDynamicFields",
|
|
3488
3494
|
__name: "index",
|
|
3489
3495
|
props: {
|
|
@@ -3503,17 +3509,17 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3503
3509
|
},
|
|
3504
3510
|
emits: ["update:fields", "add", "remove", "sort", "update"],
|
|
3505
3511
|
setup(s, { emit: k }) {
|
|
3506
|
-
const a = s, e = k, t = ae("dynamic-fields"), l = R([]),
|
|
3512
|
+
const a = s, e = k, t = ae("dynamic-fields"), l = R([]), c = R(null), m = R("input"), b = V(() => [
|
|
3507
3513
|
t.b(),
|
|
3508
3514
|
t.is("editable", a.editable)
|
|
3509
3515
|
]), T = V(() => l.value.length < a.maxFields);
|
|
3510
3516
|
ie(() => a.fields, (h) => {
|
|
3511
|
-
l.value = [...h].sort((
|
|
3517
|
+
l.value = [...h].sort((v, x) => (v.order || 0) - (x.order || 0));
|
|
3512
3518
|
}, { immediate: !0, deep: !0 });
|
|
3513
|
-
const
|
|
3519
|
+
const z = () => `field_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, D = () => {
|
|
3514
3520
|
if (!T.value) return;
|
|
3515
3521
|
const h = {
|
|
3516
|
-
id:
|
|
3522
|
+
id: z(),
|
|
3517
3523
|
name: `field_${l.value.length + 1}`,
|
|
3518
3524
|
label: "新字段",
|
|
3519
3525
|
type: m.value,
|
|
@@ -3522,38 +3528,38 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3522
3528
|
};
|
|
3523
3529
|
l.value.push(h), e("add", h), e("update:fields", l.value);
|
|
3524
3530
|
}, $ = (h) => {
|
|
3525
|
-
const
|
|
3526
|
-
|
|
3527
|
-
},
|
|
3528
|
-
const
|
|
3529
|
-
if (
|
|
3530
|
-
const x = l.value[
|
|
3531
|
-
l.value[
|
|
3531
|
+
const v = l.value.findIndex((x) => x.id === h);
|
|
3532
|
+
v !== -1 && (l.value[v], l.value.splice(v, 1), e("remove", h), e("update:fields", l.value));
|
|
3533
|
+
}, S = (h) => {
|
|
3534
|
+
const v = l.value.findIndex((x) => x.id === h);
|
|
3535
|
+
if (v > 0) {
|
|
3536
|
+
const x = l.value[v];
|
|
3537
|
+
l.value[v] = l.value[v - 1], l.value[v - 1] = x, y(), e("sort", l.value), e("update:fields", l.value);
|
|
3532
3538
|
}
|
|
3533
3539
|
}, I = (h) => {
|
|
3534
|
-
const
|
|
3535
|
-
if (
|
|
3536
|
-
const x = l.value[
|
|
3537
|
-
l.value[
|
|
3540
|
+
const v = l.value.findIndex((x) => x.id === h);
|
|
3541
|
+
if (v < l.value.length - 1) {
|
|
3542
|
+
const x = l.value[v];
|
|
3543
|
+
l.value[v] = l.value[v + 1], l.value[v + 1] = x, y(), e("sort", l.value), e("update:fields", l.value);
|
|
3538
3544
|
}
|
|
3539
3545
|
}, y = () => {
|
|
3540
|
-
l.value.forEach((h,
|
|
3541
|
-
h.order =
|
|
3546
|
+
l.value.forEach((h, v) => {
|
|
3547
|
+
h.order = v;
|
|
3542
3548
|
});
|
|
3543
3549
|
}, L = (h) => {
|
|
3544
|
-
|
|
3550
|
+
c.value = { ...h };
|
|
3545
3551
|
}, H = () => {
|
|
3546
|
-
if (
|
|
3547
|
-
const h = l.value.findIndex((
|
|
3548
|
-
h !== -1 && (l.value[h] =
|
|
3552
|
+
if (c.value) {
|
|
3553
|
+
const h = l.value.findIndex((v) => v.id === c.value.id);
|
|
3554
|
+
h !== -1 && (l.value[h] = c.value, e("update", c.value.id, c.value), e("update:fields", l.value)), c.value = null;
|
|
3549
3555
|
}
|
|
3550
|
-
},
|
|
3551
|
-
|
|
3556
|
+
}, E = () => {
|
|
3557
|
+
c.value = null;
|
|
3552
3558
|
}, M = (h) => {
|
|
3553
|
-
const
|
|
3554
|
-
return (
|
|
3559
|
+
const v = a.availableTypes.find((x) => x.value === h);
|
|
3560
|
+
return (v == null ? void 0 : v.label) || h;
|
|
3555
3561
|
};
|
|
3556
|
-
return (h,
|
|
3562
|
+
return (h, v) => (i(), d("div", {
|
|
3557
3563
|
class: u(b.value)
|
|
3558
3564
|
}, [
|
|
3559
3565
|
s.editable && T.value ? (i(), d("div", {
|
|
@@ -3561,15 +3567,15 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3561
3567
|
class: u(n(t).e("add"))
|
|
3562
3568
|
}, [
|
|
3563
3569
|
oe(r("select", {
|
|
3564
|
-
"onUpdate:modelValue":
|
|
3570
|
+
"onUpdate:modelValue": v[0] || (v[0] = (x) => m.value = x),
|
|
3565
3571
|
class: u(n(t).e("type-select"))
|
|
3566
3572
|
}, [
|
|
3567
3573
|
(i(!0), d(J, null, _(s.availableTypes, (x) => (i(), d("option", {
|
|
3568
3574
|
key: x.value,
|
|
3569
3575
|
value: x.value
|
|
3570
|
-
}, U(x.label), 9,
|
|
3576
|
+
}, U(x.label), 9, ya))), 128))
|
|
3571
3577
|
], 2), [
|
|
3572
|
-
[
|
|
3578
|
+
[Ce, m.value]
|
|
3573
3579
|
]),
|
|
3574
3580
|
r("button", {
|
|
3575
3581
|
class: u(n(t).e("add-btn")),
|
|
@@ -3586,10 +3592,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3586
3592
|
r("div", {
|
|
3587
3593
|
class: u(n(t).e("info"))
|
|
3588
3594
|
}, [
|
|
3589
|
-
r("span",
|
|
3590
|
-
r("span",
|
|
3591
|
-
r("span",
|
|
3592
|
-
x.required ? (i(), d("span",
|
|
3595
|
+
r("span", ka, U(M(x.type)), 1),
|
|
3596
|
+
r("span", Ma, U(x.name), 1),
|
|
3597
|
+
r("span", Va, U(x.label), 1),
|
|
3598
|
+
x.required ? (i(), d("span", xa, "必填")) : N("", !0)
|
|
3593
3599
|
], 2),
|
|
3594
3600
|
s.editable ? (i(), d("div", {
|
|
3595
3601
|
key: 0,
|
|
@@ -3599,13 +3605,13 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3599
3605
|
key: 0,
|
|
3600
3606
|
class: "action-btn",
|
|
3601
3607
|
title: "上移",
|
|
3602
|
-
onClick: (B) =>
|
|
3608
|
+
onClick: (B) => S(x.id)
|
|
3603
3609
|
}, [
|
|
3604
3610
|
Q(n(ee), {
|
|
3605
3611
|
name: "move-up",
|
|
3606
3612
|
size: 14
|
|
3607
3613
|
})
|
|
3608
|
-
], 8,
|
|
3614
|
+
], 8, wa)) : N("", !0),
|
|
3609
3615
|
s.showSort ? (i(), d("button", {
|
|
3610
3616
|
key: 1,
|
|
3611
3617
|
class: "action-btn",
|
|
@@ -3616,7 +3622,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3616
3622
|
name: "move-down",
|
|
3617
3623
|
size: 14
|
|
3618
3624
|
})
|
|
3619
|
-
], 8,
|
|
3625
|
+
], 8, Ca)) : N("", !0),
|
|
3620
3626
|
r("button", {
|
|
3621
3627
|
class: "action-btn",
|
|
3622
3628
|
title: "编辑",
|
|
@@ -3626,7 +3632,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3626
3632
|
name: "edit",
|
|
3627
3633
|
size: 14
|
|
3628
3634
|
})
|
|
3629
|
-
], 8,
|
|
3635
|
+
], 8, $a),
|
|
3630
3636
|
r("button", {
|
|
3631
3637
|
class: "action-btn action-btn--danger",
|
|
3632
3638
|
title: "删除",
|
|
@@ -3636,26 +3642,26 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3636
3642
|
name: "close",
|
|
3637
3643
|
size: 14
|
|
3638
3644
|
})
|
|
3639
|
-
], 8,
|
|
3645
|
+
], 8, Da)
|
|
3640
3646
|
], 2)) : N("", !0)
|
|
3641
3647
|
], 2))), 128))
|
|
3642
3648
|
], 2),
|
|
3643
3649
|
l.value.length === 0 ? (i(), d("div", {
|
|
3644
3650
|
key: 1,
|
|
3645
3651
|
class: u(n(t).e("empty"))
|
|
3646
|
-
}, [...
|
|
3652
|
+
}, [...v[6] || (v[6] = [
|
|
3647
3653
|
r("span", null, "暂无字段配置", -1)
|
|
3648
3654
|
])], 2)) : N("", !0),
|
|
3649
|
-
|
|
3655
|
+
c.value ? (i(), d("div", {
|
|
3650
3656
|
key: 2,
|
|
3651
3657
|
class: u(n(t).e("edit-modal"))
|
|
3652
3658
|
}, [
|
|
3653
|
-
r("div",
|
|
3654
|
-
r("div",
|
|
3655
|
-
|
|
3659
|
+
r("div", za, [
|
|
3660
|
+
r("div", Sa, [
|
|
3661
|
+
v[7] || (v[7] = r("span", null, "编辑字段", -1)),
|
|
3656
3662
|
r("button", {
|
|
3657
3663
|
class: "close-btn",
|
|
3658
|
-
onClick:
|
|
3664
|
+
onClick: E
|
|
3659
3665
|
}, [
|
|
3660
3666
|
Q(n(ee), {
|
|
3661
3667
|
name: "close",
|
|
@@ -3663,62 +3669,62 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3663
3669
|
})
|
|
3664
3670
|
])
|
|
3665
3671
|
]),
|
|
3666
|
-
r("div",
|
|
3667
|
-
r("div",
|
|
3668
|
-
|
|
3672
|
+
r("div", Ta, [
|
|
3673
|
+
r("div", Ha, [
|
|
3674
|
+
v[8] || (v[8] = r("label", null, "字段名称", -1)),
|
|
3669
3675
|
oe(r("input", {
|
|
3670
|
-
"onUpdate:modelValue":
|
|
3676
|
+
"onUpdate:modelValue": v[1] || (v[1] = (x) => c.value.name = x),
|
|
3671
3677
|
type: "text",
|
|
3672
3678
|
placeholder: "变量名称"
|
|
3673
3679
|
}, null, 512), [
|
|
3674
|
-
[
|
|
3680
|
+
[Ve, c.value.name]
|
|
3675
3681
|
])
|
|
3676
3682
|
]),
|
|
3677
|
-
r("div",
|
|
3678
|
-
|
|
3683
|
+
r("div", La, [
|
|
3684
|
+
v[9] || (v[9] = r("label", null, "字段标签", -1)),
|
|
3679
3685
|
oe(r("input", {
|
|
3680
|
-
"onUpdate:modelValue":
|
|
3686
|
+
"onUpdate:modelValue": v[2] || (v[2] = (x) => c.value.label = x),
|
|
3681
3687
|
type: "text",
|
|
3682
3688
|
placeholder: "显示标签"
|
|
3683
3689
|
}, null, 512), [
|
|
3684
|
-
[
|
|
3690
|
+
[Ve, c.value.label]
|
|
3685
3691
|
])
|
|
3686
3692
|
]),
|
|
3687
|
-
r("div",
|
|
3688
|
-
|
|
3693
|
+
r("div", Ra, [
|
|
3694
|
+
v[10] || (v[10] = r("label", null, "字段类型", -1)),
|
|
3689
3695
|
oe(r("select", {
|
|
3690
|
-
"onUpdate:modelValue":
|
|
3696
|
+
"onUpdate:modelValue": v[3] || (v[3] = (x) => c.value.type = x)
|
|
3691
3697
|
}, [
|
|
3692
3698
|
(i(!0), d(J, null, _(s.availableTypes, (x) => (i(), d("option", {
|
|
3693
3699
|
key: x.value,
|
|
3694
3700
|
value: x.value
|
|
3695
|
-
}, U(x.label), 9,
|
|
3701
|
+
}, U(x.label), 9, Ba))), 128))
|
|
3696
3702
|
], 512), [
|
|
3697
|
-
[
|
|
3703
|
+
[Ce, c.value.type]
|
|
3698
3704
|
])
|
|
3699
3705
|
]),
|
|
3700
|
-
r("div",
|
|
3701
|
-
|
|
3706
|
+
r("div", Aa, [
|
|
3707
|
+
v[11] || (v[11] = r("label", null, "是否必填", -1)),
|
|
3702
3708
|
r("button", {
|
|
3703
|
-
class: u(["switch-btn", { "is-on":
|
|
3704
|
-
onClick:
|
|
3705
|
-
}, U(
|
|
3709
|
+
class: u(["switch-btn", { "is-on": c.value.required }]),
|
|
3710
|
+
onClick: v[4] || (v[4] = (x) => c.value.required = !c.value.required)
|
|
3711
|
+
}, U(c.value.required ? "必填" : "可选"), 3)
|
|
3706
3712
|
]),
|
|
3707
|
-
r("div",
|
|
3708
|
-
|
|
3713
|
+
r("div", Fa, [
|
|
3714
|
+
v[12] || (v[12] = r("label", null, "占位文本", -1)),
|
|
3709
3715
|
oe(r("input", {
|
|
3710
|
-
"onUpdate:modelValue":
|
|
3716
|
+
"onUpdate:modelValue": v[5] || (v[5] = (x) => c.value.placeholder = x),
|
|
3711
3717
|
type: "text",
|
|
3712
3718
|
placeholder: "输入提示"
|
|
3713
3719
|
}, null, 512), [
|
|
3714
|
-
[
|
|
3720
|
+
[Ve, c.value.placeholder]
|
|
3715
3721
|
])
|
|
3716
3722
|
])
|
|
3717
3723
|
]),
|
|
3718
3724
|
r("div", { class: "modal-footer" }, [
|
|
3719
3725
|
r("button", {
|
|
3720
3726
|
class: "cancel-btn",
|
|
3721
|
-
onClick:
|
|
3727
|
+
onClick: E
|
|
3722
3728
|
}, "取消"),
|
|
3723
3729
|
r("button", {
|
|
3724
3730
|
class: "save-btn",
|
|
@@ -3729,7 +3735,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3729
3735
|
], 2)) : N("", !0)
|
|
3730
3736
|
], 2));
|
|
3731
3737
|
}
|
|
3732
|
-
}),
|
|
3738
|
+
}), pt = /* @__PURE__ */ le({
|
|
3733
3739
|
name: "XRichEditor",
|
|
3734
3740
|
__name: "index",
|
|
3735
3741
|
props: {
|
|
@@ -3743,21 +3749,21 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3743
3749
|
},
|
|
3744
3750
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
3745
3751
|
setup(s, { expose: k, emit: a }) {
|
|
3746
|
-
const e = s, t = a, l =
|
|
3747
|
-
() => import("./index.esm-C9sEwyHF.mjs").then((
|
|
3748
|
-
),
|
|
3749
|
-
() => import("./index.esm-C9sEwyHF.mjs").then((
|
|
3750
|
-
), m =
|
|
3751
|
-
|
|
3752
|
+
const e = s, t = a, l = Ue(
|
|
3753
|
+
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Editor)
|
|
3754
|
+
), c = Ue(
|
|
3755
|
+
() => import("./index.esm-C9sEwyHF.mjs").then((v) => v.Toolbar)
|
|
3756
|
+
), m = Ge(), b = R(e.modelValue), T = R(!1);
|
|
3757
|
+
ge(() => {
|
|
3752
3758
|
T.value = !0;
|
|
3753
3759
|
}), ie(
|
|
3754
3760
|
() => e.modelValue,
|
|
3755
|
-
(
|
|
3756
|
-
|
|
3761
|
+
(v) => {
|
|
3762
|
+
v !== b.value && (b.value = v);
|
|
3757
3763
|
}
|
|
3758
3764
|
);
|
|
3759
|
-
const
|
|
3760
|
-
const
|
|
3765
|
+
const z = V(() => ({ height: typeof e.height == "number" ? `${e.height}px` : e.height })), D = V(() => {
|
|
3766
|
+
const v = {
|
|
3761
3767
|
excludeKeys: []
|
|
3762
3768
|
};
|
|
3763
3769
|
if (Array.isArray(e.toolbar)) {
|
|
@@ -3816,9 +3822,9 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3816
3822
|
"redo",
|
|
3817
3823
|
"fullScreen"
|
|
3818
3824
|
];
|
|
3819
|
-
|
|
3825
|
+
v.excludeKeys = x.filter((B) => !e.toolbar.includes(B));
|
|
3820
3826
|
}
|
|
3821
|
-
return
|
|
3827
|
+
return v;
|
|
3822
3828
|
}), $ = V(() => ({
|
|
3823
3829
|
placeholder: e.placeholder,
|
|
3824
3830
|
readOnly: e.disabled,
|
|
@@ -3827,50 +3833,50 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3827
3833
|
// 上传图片配置
|
|
3828
3834
|
uploadImage: {
|
|
3829
3835
|
// 自定义上传
|
|
3830
|
-
async customUpload(
|
|
3831
|
-
const B = URL.createObjectURL(
|
|
3832
|
-
x(B,
|
|
3836
|
+
async customUpload(v, x) {
|
|
3837
|
+
const B = URL.createObjectURL(v);
|
|
3838
|
+
x(B, v.name, B);
|
|
3833
3839
|
}
|
|
3834
3840
|
},
|
|
3835
3841
|
// 上传视频配置
|
|
3836
3842
|
uploadVideo: {
|
|
3837
|
-
async customUpload(
|
|
3838
|
-
const B = URL.createObjectURL(
|
|
3843
|
+
async customUpload(v, x) {
|
|
3844
|
+
const B = URL.createObjectURL(v);
|
|
3839
3845
|
x(B, "");
|
|
3840
3846
|
}
|
|
3841
3847
|
}
|
|
3842
3848
|
}
|
|
3843
|
-
})),
|
|
3844
|
-
m.value =
|
|
3845
|
-
}, I = (
|
|
3846
|
-
const x =
|
|
3849
|
+
})), S = (v) => {
|
|
3850
|
+
m.value = v;
|
|
3851
|
+
}, I = (v) => {
|
|
3852
|
+
const x = v.getHtml();
|
|
3847
3853
|
b.value = x, t("update:modelValue", x), t("change", x);
|
|
3848
|
-
}, y = (
|
|
3849
|
-
t("focus",
|
|
3850
|
-
}, L = (
|
|
3851
|
-
t("blur",
|
|
3854
|
+
}, y = (v) => {
|
|
3855
|
+
t("focus", v);
|
|
3856
|
+
}, L = (v) => {
|
|
3857
|
+
t("blur", v);
|
|
3852
3858
|
};
|
|
3853
3859
|
return k({
|
|
3854
3860
|
getEditor: () => m.value,
|
|
3855
3861
|
getText: () => {
|
|
3856
|
-
var
|
|
3857
|
-
return ((
|
|
3862
|
+
var v;
|
|
3863
|
+
return ((v = m.value) == null ? void 0 : v.getText()) || "";
|
|
3858
3864
|
},
|
|
3859
|
-
setHtml: (
|
|
3860
|
-
b.value =
|
|
3865
|
+
setHtml: (v) => {
|
|
3866
|
+
b.value = v;
|
|
3861
3867
|
},
|
|
3862
3868
|
clear: () => {
|
|
3863
|
-
var
|
|
3864
|
-
b.value = "", (
|
|
3869
|
+
var v;
|
|
3870
|
+
b.value = "", (v = m.value) == null || v.clear();
|
|
3865
3871
|
}
|
|
3866
|
-
}),
|
|
3867
|
-
const
|
|
3868
|
-
|
|
3869
|
-
}), (
|
|
3872
|
+
}), Je(() => {
|
|
3873
|
+
const v = m.value;
|
|
3874
|
+
v && v.destroy();
|
|
3875
|
+
}), (v, x) => (i(), d("div", {
|
|
3870
3876
|
class: u(["x-rich-editor", { "is-disabled": s.disabled }])
|
|
3871
3877
|
}, [
|
|
3872
3878
|
T.value ? (i(), d(J, { key: 0 }, [
|
|
3873
|
-
s.toolbar !== !1 ? (i(), fe(n(
|
|
3879
|
+
s.toolbar !== !1 ? (i(), fe(n(c), {
|
|
3874
3880
|
key: 0,
|
|
3875
3881
|
editor: m.value,
|
|
3876
3882
|
"default-config": D.value,
|
|
@@ -3882,21 +3888,21 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3882
3888
|
"onUpdate:modelValue": x[0] || (x[0] = (B) => b.value = B),
|
|
3883
3889
|
"default-config": $.value,
|
|
3884
3890
|
mode: s.mode,
|
|
3885
|
-
style: te(
|
|
3891
|
+
style: te(z.value),
|
|
3886
3892
|
class: "x-rich-editor__content",
|
|
3887
|
-
onOnCreated:
|
|
3893
|
+
onOnCreated: S,
|
|
3888
3894
|
onOnChange: I,
|
|
3889
3895
|
onOnFocus: y,
|
|
3890
3896
|
onOnBlur: L
|
|
3891
3897
|
}, null, 8, ["modelValue", "default-config", "mode", "style"])
|
|
3892
3898
|
], 64)) : (i(), d("div", {
|
|
3893
3899
|
key: 1,
|
|
3894
|
-
style: te(
|
|
3900
|
+
style: te(z.value),
|
|
3895
3901
|
class: "x-rich-editor__placeholder"
|
|
3896
3902
|
}, U(s.placeholder), 5))
|
|
3897
3903
|
], 2));
|
|
3898
3904
|
}
|
|
3899
|
-
}),
|
|
3905
|
+
}), Ia = ["value", "placeholder"], Pa = ["onClick"], Ea = ["onClick"], Oa = ["checked", "onChange"], gt = /* @__PURE__ */ le({
|
|
3900
3906
|
name: "XCascader",
|
|
3901
3907
|
__name: "index",
|
|
3902
3908
|
props: {
|
|
@@ -3913,7 +3919,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3913
3919
|
},
|
|
3914
3920
|
emits: ["update:modelValue", "change"],
|
|
3915
3921
|
setup(s, { emit: k }) {
|
|
3916
|
-
const a = s, e = k, t = ae("cascader"), l = R(!1),
|
|
3922
|
+
const a = s, e = k, t = ae("cascader"), l = R(!1), c = R([]), m = R([]);
|
|
3917
3923
|
R("");
|
|
3918
3924
|
const b = R(""), T = R();
|
|
3919
3925
|
V(() => ({
|
|
@@ -3922,20 +3928,20 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3922
3928
|
children: a.props.children || "children",
|
|
3923
3929
|
disabled: a.props.disabled || "disabled"
|
|
3924
3930
|
}));
|
|
3925
|
-
const
|
|
3926
|
-
if (
|
|
3931
|
+
const z = V(() => a.props.multiple), D = V(() => a.props.checkStrictly), $ = V(() => {
|
|
3932
|
+
if (z.value)
|
|
3927
3933
|
return m.value.length === 0 ? "" : m.value.map((w) => y(w)).join(", ");
|
|
3928
|
-
if (
|
|
3934
|
+
if (c.value.length === 0) return "";
|
|
3929
3935
|
if (a.showAllLevels)
|
|
3930
|
-
return
|
|
3931
|
-
const p =
|
|
3932
|
-
return L(p,
|
|
3933
|
-
}),
|
|
3936
|
+
return c.value.map((w) => L(w, c.value)).join(a.separator);
|
|
3937
|
+
const p = c.value[c.value.length - 1];
|
|
3938
|
+
return L(p, c.value);
|
|
3939
|
+
}), S = V(() => {
|
|
3934
3940
|
var w;
|
|
3935
3941
|
const p = [a.options];
|
|
3936
|
-
if (
|
|
3942
|
+
if (c.value.length > 0) {
|
|
3937
3943
|
let C = a.options;
|
|
3938
|
-
for (const o of
|
|
3944
|
+
for (const o of c.value) {
|
|
3939
3945
|
const f = C.find((g) => g.value === o);
|
|
3940
3946
|
if ((w = f == null ? void 0 : f.children) != null && w.length)
|
|
3941
3947
|
p.push(f.children), C = f.children;
|
|
@@ -3968,33 +3974,33 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
3968
3974
|
}, H = (p, w) => {
|
|
3969
3975
|
var o;
|
|
3970
3976
|
if (p.disabled) return;
|
|
3971
|
-
const C =
|
|
3972
|
-
C.push(p.value),
|
|
3973
|
-
},
|
|
3974
|
-
const o = [...
|
|
3977
|
+
const C = c.value.slice(0, w);
|
|
3978
|
+
C.push(p.value), c.value = C, (!((o = p.children) != null && o.length) || D.value) && (z.value || (l.value = !1, v(C)));
|
|
3979
|
+
}, E = (p, w, C) => {
|
|
3980
|
+
const o = [...c.value.slice(0, w), p.value];
|
|
3975
3981
|
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();
|
|
3976
3982
|
}, M = (p, w) => {
|
|
3977
|
-
const C = [...
|
|
3983
|
+
const C = [...c.value.slice(0, w), p.value];
|
|
3978
3984
|
return m.value.some((o) => JSON.stringify(o) === JSON.stringify(C));
|
|
3979
|
-
}, h = (p, w) =>
|
|
3985
|
+
}, h = (p, w) => c.value[w] === p.value, v = (p) => {
|
|
3980
3986
|
const w = a.props.emitPath !== !1 ? p : p[p.length - 1];
|
|
3981
3987
|
e("update:modelValue", w), e("change", w);
|
|
3982
3988
|
}, x = () => {
|
|
3983
3989
|
const p = a.props.emitPath !== !1 ? m.value : m.value.map((w) => w[w.length - 1]);
|
|
3984
3990
|
e("update:modelValue", p), e("change", p);
|
|
3985
3991
|
}, B = () => {
|
|
3986
|
-
|
|
3992
|
+
c.value = [], m.value = [], e("update:modelValue", z.value ? [] : ""), e("change", z.value ? [] : "");
|
|
3987
3993
|
}, F = (p) => {
|
|
3988
3994
|
b.value = p.target.value;
|
|
3989
|
-
},
|
|
3990
|
-
|
|
3995
|
+
}, Y = (p) => {
|
|
3996
|
+
c.value = p.map((w) => w.value), b.value = "", l.value = !1, v(c.value);
|
|
3991
3997
|
}, j = (p) => {
|
|
3992
3998
|
p.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
3993
3999
|
};
|
|
3994
4000
|
return ie(l, (p) => {
|
|
3995
4001
|
p ? document.addEventListener("click", j) : (document.removeEventListener("click", j), b.value = "");
|
|
3996
4002
|
}), ie(() => a.modelValue, (p) => {
|
|
3997
|
-
|
|
4003
|
+
z.value ? m.value = Array.isArray(p) ? p : [] : Array.isArray(p) ? c.value = p : p !== "" && p !== null && p !== void 0 ? c.value = [p] : c.value = [];
|
|
3998
4004
|
}, { immediate: !0 }), (p, w) => (i(), d("div", {
|
|
3999
4005
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4000
4006
|
onClick: w[2] || (w[2] = ue(() => {
|
|
@@ -4010,7 +4016,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4010
4016
|
placeholder: $.value || s.placeholder,
|
|
4011
4017
|
class: u(n(t).e("filter-input")),
|
|
4012
4018
|
onInput: F
|
|
4013
|
-
}, null, 42,
|
|
4019
|
+
}, null, 42, Ia)) : (i(), d("span", {
|
|
4014
4020
|
key: 1,
|
|
4015
4021
|
class: u(n(t).e("text"))
|
|
4016
4022
|
}, [
|
|
@@ -4050,8 +4056,8 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4050
4056
|
(i(!0), d(J, null, _(I.value, (C, o) => (i(), d("div", {
|
|
4051
4057
|
key: o,
|
|
4052
4058
|
class: u(n(t).e("filter-item")),
|
|
4053
|
-
onClick: (f) =>
|
|
4054
|
-
}, U(C.label), 11,
|
|
4059
|
+
onClick: (f) => Y(C.path)
|
|
4060
|
+
}, U(C.label), 11, Pa))), 128)),
|
|
4055
4061
|
I.value.length === 0 ? (i(), d("div", {
|
|
4056
4062
|
key: 0,
|
|
4057
4063
|
class: u(n(t).e("empty"))
|
|
@@ -4062,7 +4068,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4062
4068
|
ref_key: "menuRef",
|
|
4063
4069
|
ref: T
|
|
4064
4070
|
}, [
|
|
4065
|
-
(i(!0), d(J, null, _(
|
|
4071
|
+
(i(!0), d(J, null, _(S.value, (C, o) => (i(), d("div", {
|
|
4066
4072
|
key: o,
|
|
4067
4073
|
class: u(n(t).e("column"))
|
|
4068
4074
|
}, [
|
|
@@ -4077,7 +4083,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4077
4083
|
]),
|
|
4078
4084
|
onClick: (X) => H(f, o)
|
|
4079
4085
|
}, [
|
|
4080
|
-
|
|
4086
|
+
z.value ? (i(), d("span", {
|
|
4081
4087
|
key: 0,
|
|
4082
4088
|
class: u(n(t).e("checkbox")),
|
|
4083
4089
|
onClick: w[1] || (w[1] = ue(() => {
|
|
@@ -4086,8 +4092,8 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4086
4092
|
r("input", {
|
|
4087
4093
|
type: "checkbox",
|
|
4088
4094
|
checked: M(f, o),
|
|
4089
|
-
onChange: (X) =>
|
|
4090
|
-
}, null, 40,
|
|
4095
|
+
onChange: (X) => E(f, o, X.target.checked)
|
|
4096
|
+
}, null, 40, Oa)
|
|
4091
4097
|
], 2)) : N("", !0),
|
|
4092
4098
|
r("span", {
|
|
4093
4099
|
class: u(n(t).e("label"))
|
|
@@ -4101,16 +4107,16 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4101
4107
|
size: 12
|
|
4102
4108
|
})
|
|
4103
4109
|
], 2)) : N("", !0)
|
|
4104
|
-
], 10,
|
|
4110
|
+
], 10, Ea);
|
|
4105
4111
|
}), 128))
|
|
4106
4112
|
], 2))), 128))
|
|
4107
4113
|
], 2))
|
|
4108
4114
|
], 2), [
|
|
4109
|
-
[
|
|
4115
|
+
[be, l.value]
|
|
4110
4116
|
])
|
|
4111
4117
|
], 2));
|
|
4112
4118
|
}
|
|
4113
|
-
}),
|
|
4119
|
+
}), Ya = ["onClick"], bt = /* @__PURE__ */ le({
|
|
4114
4120
|
name: "XColorPicker",
|
|
4115
4121
|
__name: "index",
|
|
4116
4122
|
props: {
|
|
@@ -4122,48 +4128,48 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4122
4128
|
},
|
|
4123
4129
|
emits: ["update:modelValue", "change"],
|
|
4124
4130
|
setup(s, { emit: k }) {
|
|
4125
|
-
const a = s, e = k, t = ae("color-picker"), l = R(!1),
|
|
4126
|
-
|
|
4127
|
-
const p = j *
|
|
4131
|
+
const a = s, e = k, t = ae("color-picker"), l = R(!1), c = R(0), m = R(100), b = R(100), T = R(100), z = R(), D = R(), $ = V(() => y(c.value, m.value, b.value)), S = V(() => a.showAlpha ? `${$.value}${Math.round(T.value * 2.55).toString(16).padStart(2, "0")}` : $.value), I = V(() => a.modelValue || $.value), y = (F, Y, j) => {
|
|
4132
|
+
Y /= 100, j /= 100;
|
|
4133
|
+
const p = j * Y, w = p * (1 - Math.abs(F / 60 % 2 - 1)), C = j - p;
|
|
4128
4134
|
let o = 0, f = 0, g = 0;
|
|
4129
4135
|
F >= 0 && F < 60 ? (o = p, f = w, g = 0) : F >= 60 && F < 120 ? (o = w, f = p, g = 0) : F >= 120 && F < 180 ? (o = 0, f = p, g = w) : F >= 180 && F < 240 ? (o = 0, f = w, g = p) : F >= 240 && F < 300 ? (o = w, f = 0, g = p) : (o = p, f = 0, g = w);
|
|
4130
4136
|
const X = (ne) => Math.round((ne + C) * 255).toString(16).padStart(2, "0");
|
|
4131
4137
|
return `#${X(o)}${X(f)}${X(g)}`;
|
|
4132
4138
|
}, L = (F) => {
|
|
4133
4139
|
F = F.replace("#", "");
|
|
4134
|
-
const
|
|
4140
|
+
const Y = parseInt(F.slice(0, 2), 16) / 255, j = parseInt(F.slice(2, 4), 16) / 255, p = parseInt(F.slice(4, 6), 16) / 255, w = Math.max(Y, j, p), C = Math.min(Y, j, p), o = w - C;
|
|
4135
4141
|
let f = 0;
|
|
4136
4142
|
const g = w === 0 ? 0 : o / w, X = w;
|
|
4137
4143
|
if (o !== 0)
|
|
4138
4144
|
switch (w) {
|
|
4139
|
-
case
|
|
4145
|
+
case Y:
|
|
4140
4146
|
f = ((j - p) / o + (j < p ? 6 : 0)) * 60;
|
|
4141
4147
|
break;
|
|
4142
4148
|
case j:
|
|
4143
|
-
f = ((p -
|
|
4149
|
+
f = ((p - Y) / o + 2) * 60;
|
|
4144
4150
|
break;
|
|
4145
4151
|
case p:
|
|
4146
|
-
f = ((
|
|
4152
|
+
f = ((Y - j) / o + 4) * 60;
|
|
4147
4153
|
break;
|
|
4148
4154
|
}
|
|
4149
4155
|
return { h: f, s: g * 100, v: X * 100 };
|
|
4150
4156
|
}, H = (F) => {
|
|
4151
|
-
if (!
|
|
4152
|
-
const
|
|
4157
|
+
if (!z.value) return;
|
|
4158
|
+
const Y = z.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (F.clientX - Y.left) / Y.width)), p = Math.max(0, Math.min(1, (F.clientY - Y.top) / Y.height));
|
|
4153
4159
|
m.value = Math.round(j * 100), b.value = Math.round((1 - p) * 100);
|
|
4154
|
-
},
|
|
4160
|
+
}, E = (F) => {
|
|
4155
4161
|
if (!D.value) return;
|
|
4156
|
-
const
|
|
4157
|
-
|
|
4162
|
+
const Y = D.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (F.clientX - Y.left) / Y.width));
|
|
4163
|
+
c.value = Math.round(j * 360);
|
|
4158
4164
|
}, M = (F) => {
|
|
4159
4165
|
if (!D.value) return;
|
|
4160
|
-
const
|
|
4166
|
+
const Y = D.value.getBoundingClientRect(), j = Math.max(0, Math.min(1, (F.clientX - Y.left) / Y.width));
|
|
4161
4167
|
T.value = Math.round(j * 100);
|
|
4162
4168
|
}, h = (F) => {
|
|
4163
|
-
const
|
|
4164
|
-
|
|
4165
|
-
},
|
|
4166
|
-
e("update:modelValue",
|
|
4169
|
+
const Y = L(F);
|
|
4170
|
+
c.value = Y.h, m.value = Y.s, b.value = Y.v, e("update:modelValue", F), e("change", F);
|
|
4171
|
+
}, v = () => {
|
|
4172
|
+
e("update:modelValue", S.value), e("change", S.value), l.value = !1;
|
|
4167
4173
|
}, x = () => {
|
|
4168
4174
|
e("update:modelValue", ""), e("change", ""), l.value = !1;
|
|
4169
4175
|
}, B = (F) => {
|
|
@@ -4172,19 +4178,19 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4172
4178
|
return ie(l, (F) => {
|
|
4173
4179
|
if (F) {
|
|
4174
4180
|
if (document.addEventListener("click", B), a.modelValue) {
|
|
4175
|
-
const
|
|
4176
|
-
|
|
4181
|
+
const Y = L(a.modelValue.slice(0, 7));
|
|
4182
|
+
c.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));
|
|
4177
4183
|
}
|
|
4178
4184
|
} else
|
|
4179
4185
|
document.removeEventListener("click", B);
|
|
4180
|
-
}), (F,
|
|
4186
|
+
}), (F, Y) => (i(), d("div", {
|
|
4181
4187
|
class: u([n(t).b(), n(t).m(s.size), n(t).is("disabled", s.disabled)]),
|
|
4182
|
-
onClick:
|
|
4188
|
+
onClick: Y[1] || (Y[1] = ue(() => {
|
|
4183
4189
|
}, ["stop"]))
|
|
4184
4190
|
}, [
|
|
4185
4191
|
r("div", {
|
|
4186
4192
|
class: u(n(t).e("trigger")),
|
|
4187
|
-
onClick:
|
|
4193
|
+
onClick: Y[0] || (Y[0] = (j) => !s.disabled && (l.value = !l.value))
|
|
4188
4194
|
}, [
|
|
4189
4195
|
r("div", {
|
|
4190
4196
|
class: u(n(t).e("color")),
|
|
@@ -4202,10 +4208,10 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4202
4208
|
}, [
|
|
4203
4209
|
r("div", {
|
|
4204
4210
|
ref_key: "panelRef",
|
|
4205
|
-
ref:
|
|
4211
|
+
ref: z,
|
|
4206
4212
|
class: u(n(t).e("panel")),
|
|
4207
4213
|
style: te({
|
|
4208
|
-
backgroundColor: `hsl(${
|
|
4214
|
+
backgroundColor: `hsl(${c.value}, 100%, 50%)`
|
|
4209
4215
|
}),
|
|
4210
4216
|
onClick: H
|
|
4211
4217
|
}, [
|
|
@@ -4230,11 +4236,11 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4230
4236
|
ref_key: "sliderRef",
|
|
4231
4237
|
ref: D,
|
|
4232
4238
|
class: u(n(t).e("hue-bar")),
|
|
4233
|
-
onClick:
|
|
4239
|
+
onClick: E
|
|
4234
4240
|
}, [
|
|
4235
4241
|
r("div", {
|
|
4236
4242
|
class: u(n(t).e("hue-thumb")),
|
|
4237
|
-
style: te({ left: `${
|
|
4243
|
+
style: te({ left: `${c.value / 360 * 100}%` })
|
|
4238
4244
|
}, null, 6)
|
|
4239
4245
|
], 2)
|
|
4240
4246
|
], 2),
|
|
@@ -4264,14 +4270,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4264
4270
|
class: u(n(t).e("predefine-item")),
|
|
4265
4271
|
style: te({ backgroundColor: j }),
|
|
4266
4272
|
onClick: (w) => h(j)
|
|
4267
|
-
}, null, 14,
|
|
4273
|
+
}, null, 14, Ya))), 128))
|
|
4268
4274
|
], 2)) : N("", !0),
|
|
4269
4275
|
r("div", {
|
|
4270
4276
|
class: u(n(t).e("actions"))
|
|
4271
4277
|
}, [
|
|
4272
4278
|
r("span", {
|
|
4273
4279
|
class: u(n(t).e("value"))
|
|
4274
|
-
}, U(
|
|
4280
|
+
}, U(S.value), 3),
|
|
4275
4281
|
r("div", {
|
|
4276
4282
|
class: u(n(t).e("btns"))
|
|
4277
4283
|
}, [
|
|
@@ -4281,16 +4287,16 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4281
4287
|
}, "清空", 2),
|
|
4282
4288
|
r("button", {
|
|
4283
4289
|
class: u([n(t).e("btn"), n(t).e("btn--primary")]),
|
|
4284
|
-
onClick:
|
|
4290
|
+
onClick: v
|
|
4285
4291
|
}, "确定", 2)
|
|
4286
4292
|
], 2)
|
|
4287
4293
|
], 2)
|
|
4288
4294
|
], 2), [
|
|
4289
|
-
[
|
|
4295
|
+
[be, l.value]
|
|
4290
4296
|
])
|
|
4291
4297
|
], 2));
|
|
4292
4298
|
}
|
|
4293
|
-
}),
|
|
4299
|
+
}), Ua = ["value", "placeholder", "disabled"], Na = ["onClick"], yt = /* @__PURE__ */ le({
|
|
4294
4300
|
name: "XAutoComplete",
|
|
4295
4301
|
__name: "index",
|
|
4296
4302
|
props: {
|
|
@@ -4307,23 +4313,23 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4307
4313
|
},
|
|
4308
4314
|
emits: ["update:modelValue", "select", "clear"],
|
|
4309
4315
|
setup(s, { emit: k }) {
|
|
4310
|
-
const a = s, e = k, t = ae("auto-complete"), l = R(!1),
|
|
4316
|
+
const a = s, e = k, t = ae("auto-complete"), l = R(!1), c = R(a.modelValue), m = R([]), b = R(-1), T = R(), z = R(!1);
|
|
4311
4317
|
let D = null;
|
|
4312
4318
|
const $ = (M) => {
|
|
4313
|
-
a.fetchSuggestions ? (
|
|
4314
|
-
m.value = h,
|
|
4319
|
+
a.fetchSuggestions ? (z.value = !0, a.fetchSuggestions(M, (h) => {
|
|
4320
|
+
m.value = h, z.value = !1, l.value = h.length > 0;
|
|
4315
4321
|
})) : a.suggestions.length && (m.value = a.suggestions.filter(
|
|
4316
4322
|
(h) => h[a.valueKey].toLowerCase().includes(M.toLowerCase())
|
|
4317
4323
|
), l.value = m.value.length > 0);
|
|
4318
|
-
},
|
|
4324
|
+
}, S = (M) => {
|
|
4319
4325
|
const h = M.target.value;
|
|
4320
|
-
|
|
4326
|
+
c.value = h, e("update:modelValue", h), b.value = -1, D && clearTimeout(D), D = setTimeout(() => {
|
|
4321
4327
|
h || a.triggerOnFocus ? $(h) : l.value = !1;
|
|
4322
4328
|
}, a.debounce);
|
|
4323
4329
|
}, I = () => {
|
|
4324
|
-
a.triggerOnFocus &&
|
|
4330
|
+
a.triggerOnFocus && c.value === "" && $("");
|
|
4325
4331
|
}, y = (M) => {
|
|
4326
|
-
|
|
4332
|
+
c.value = M[a.valueKey], e("update:modelValue", c.value), e("select", M), l.value = !1;
|
|
4327
4333
|
}, L = (M) => {
|
|
4328
4334
|
if (l.value)
|
|
4329
4335
|
switch (M.key) {
|
|
@@ -4345,14 +4351,14 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4345
4351
|
}
|
|
4346
4352
|
}, H = () => {
|
|
4347
4353
|
var M;
|
|
4348
|
-
|
|
4349
|
-
},
|
|
4354
|
+
c.value = "", e("update:modelValue", ""), e("clear"), l.value = !1, (M = T.value) == null || M.focus();
|
|
4355
|
+
}, E = (M) => {
|
|
4350
4356
|
M.target.closest(`.${t.b()}`) || (l.value = !1);
|
|
4351
4357
|
};
|
|
4352
4358
|
return ie(l, (M) => {
|
|
4353
|
-
M ? document.addEventListener("click",
|
|
4359
|
+
M ? document.addEventListener("click", E) : (document.removeEventListener("click", E), b.value = -1);
|
|
4354
4360
|
}), ie(() => a.modelValue, (M) => {
|
|
4355
|
-
|
|
4361
|
+
c.value = M;
|
|
4356
4362
|
}), (M, h) => (i(), d("div", {
|
|
4357
4363
|
class: u([n(t).b(), n(t).m(s.size)]),
|
|
4358
4364
|
onClick: h[0] || (h[0] = ue(() => {
|
|
@@ -4364,15 +4370,15 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4364
4370
|
r("input", {
|
|
4365
4371
|
ref_key: "inputRef",
|
|
4366
4372
|
ref: T,
|
|
4367
|
-
value:
|
|
4373
|
+
value: c.value,
|
|
4368
4374
|
placeholder: s.placeholder,
|
|
4369
4375
|
disabled: s.disabled,
|
|
4370
4376
|
class: u(n(t).e("inner")),
|
|
4371
|
-
onInput:
|
|
4377
|
+
onInput: S,
|
|
4372
4378
|
onFocus: I,
|
|
4373
4379
|
onKeydown: L
|
|
4374
|
-
}, null, 42,
|
|
4375
|
-
s.clearable &&
|
|
4380
|
+
}, null, 42, Ua),
|
|
4381
|
+
s.clearable && c.value ? (i(), d("span", {
|
|
4376
4382
|
key: 0,
|
|
4377
4383
|
class: u(n(t).e("clear")),
|
|
4378
4384
|
onClick: H
|
|
@@ -4382,7 +4388,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4382
4388
|
size: 14
|
|
4383
4389
|
})
|
|
4384
4390
|
], 2)) : N("", !0),
|
|
4385
|
-
|
|
4391
|
+
z.value ? (i(), d("span", {
|
|
4386
4392
|
key: 1,
|
|
4387
4393
|
class: u(n(t).e("loading"))
|
|
4388
4394
|
}, [
|
|
@@ -4398,25 +4404,25 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4398
4404
|
r("ul", {
|
|
4399
4405
|
class: u(n(t).e("list"))
|
|
4400
4406
|
}, [
|
|
4401
|
-
(i(!0), d(J, null, _(m.value, (
|
|
4407
|
+
(i(!0), d(J, null, _(m.value, (v, x) => (i(), d("li", {
|
|
4402
4408
|
key: x,
|
|
4403
4409
|
class: u([
|
|
4404
4410
|
n(t).e("item"),
|
|
4405
4411
|
n(t).is("highlighted", x === b.value)
|
|
4406
4412
|
]),
|
|
4407
|
-
onClick: (B) => y(
|
|
4413
|
+
onClick: (B) => y(v)
|
|
4408
4414
|
}, [
|
|
4409
|
-
se(M.$slots, "default", { item:
|
|
4410
|
-
de(U(
|
|
4415
|
+
se(M.$slots, "default", { item: v }, () => [
|
|
4416
|
+
de(U(v[s.valueKey]), 1)
|
|
4411
4417
|
])
|
|
4412
|
-
], 10,
|
|
4418
|
+
], 10, Na))), 128))
|
|
4413
4419
|
], 2)
|
|
4414
4420
|
], 2), [
|
|
4415
|
-
[
|
|
4421
|
+
[be, l.value && m.value.length]
|
|
4416
4422
|
])
|
|
4417
4423
|
], 2));
|
|
4418
4424
|
}
|
|
4419
|
-
}),
|
|
4425
|
+
}), Xa = ["onClick"], kt = /* @__PURE__ */ le({
|
|
4420
4426
|
name: "XSegmented",
|
|
4421
4427
|
__name: "index",
|
|
4422
4428
|
props: {
|
|
@@ -4428,17 +4434,17 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4428
4434
|
},
|
|
4429
4435
|
emits: ["update:modelValue", "change"],
|
|
4430
4436
|
setup(s, { emit: k }) {
|
|
4431
|
-
const a = s, e = k, t = ae("segmented"), l = R(),
|
|
4437
|
+
const a = s, e = k, t = ae("segmented"), l = R(), c = V(() => a.options.map((z) => typeof z == "string" || typeof z == "number" ? { label: String(z), value: z } : z)), m = V(() => c.value.findIndex((z) => z.value === a.modelValue)), b = V(() => {
|
|
4432
4438
|
if (!l.value || m.value < 0) return {};
|
|
4433
4439
|
const D = l.value.querySelectorAll(`.${t.e("item")}`)[m.value];
|
|
4434
4440
|
return D ? {
|
|
4435
4441
|
width: `${D.offsetWidth}px`,
|
|
4436
4442
|
transform: `translateX(${D.offsetLeft}px)`
|
|
4437
4443
|
} : {};
|
|
4438
|
-
}), T = (
|
|
4439
|
-
a.disabled ||
|
|
4444
|
+
}), T = (z) => {
|
|
4445
|
+
a.disabled || z.disabled || (e("update:modelValue", z.value), e("change", z.value));
|
|
4440
4446
|
};
|
|
4441
|
-
return (
|
|
4447
|
+
return (z, D) => (i(), d("div", {
|
|
4442
4448
|
ref_key: "containerRef",
|
|
4443
4449
|
ref: l,
|
|
4444
4450
|
class: u([
|
|
@@ -4452,22 +4458,22 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4452
4458
|
class: u(n(t).e("thumb")),
|
|
4453
4459
|
style: te(b.value)
|
|
4454
4460
|
}, null, 6),
|
|
4455
|
-
(i(!0), d(J, null, _(
|
|
4456
|
-
key:
|
|
4461
|
+
(i(!0), d(J, null, _(c.value, ($, S) => (i(), d("div", {
|
|
4462
|
+
key: S,
|
|
4457
4463
|
class: u([
|
|
4458
4464
|
n(t).e("item"),
|
|
4459
|
-
n(t).is("selected",
|
|
4465
|
+
n(t).is("selected", S === m.value),
|
|
4460
4466
|
n(t).is("disabled", $.disabled)
|
|
4461
4467
|
]),
|
|
4462
4468
|
onClick: (I) => T($)
|
|
4463
4469
|
}, [
|
|
4464
|
-
se(
|
|
4470
|
+
se(z.$slots, "default", { option: $ }, () => [
|
|
4465
4471
|
de(U($.label), 1)
|
|
4466
4472
|
])
|
|
4467
|
-
], 10,
|
|
4473
|
+
], 10, Xa))), 128))
|
|
4468
4474
|
], 2));
|
|
4469
4475
|
}
|
|
4470
|
-
}),
|
|
4476
|
+
}), Ka = ["value", "placeholder", "disabled"], Wa = ["onClick"], qa = ["src"], Mt = /* @__PURE__ */ le({
|
|
4471
4477
|
name: "XMention",
|
|
4472
4478
|
__name: "index",
|
|
4473
4479
|
props: {
|
|
@@ -4482,26 +4488,26 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4482
4488
|
},
|
|
4483
4489
|
emits: ["update:modelValue", "select", "change"],
|
|
4484
4490
|
setup(s, { emit: k }) {
|
|
4485
|
-
const a = s, e = k, t = ae("mention"), l = R(a.modelValue),
|
|
4486
|
-
m.value = a.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(M.toLowerCase())),
|
|
4491
|
+
const a = s, e = k, t = ae("mention"), l = R(a.modelValue), c = R(!1), m = R([]), b = R(-1), T = R(), z = R(), D = R(0), $ = R(-1), S = (M) => {
|
|
4492
|
+
m.value = a.options.filter((h) => h.disabled ? !1 : (h.label || h.value).toLowerCase().includes(M.toLowerCase())), c.value = m.value.length > 0, b.value = -1;
|
|
4487
4493
|
}, I = (M) => {
|
|
4488
4494
|
const h = M.target;
|
|
4489
4495
|
l.value = h.value, D.value = h.selectionStart || 0;
|
|
4490
|
-
const
|
|
4496
|
+
const v = l.value.slice(0, D.value), x = v.lastIndexOf(a.prefix);
|
|
4491
4497
|
if (x >= 0) {
|
|
4492
|
-
const B =
|
|
4493
|
-
$.value = x,
|
|
4498
|
+
const B = v.slice(x + a.prefix.length);
|
|
4499
|
+
$.value = x, S(B);
|
|
4494
4500
|
} else
|
|
4495
|
-
|
|
4501
|
+
c.value = !1;
|
|
4496
4502
|
e("update:modelValue", l.value), e("change", l.value);
|
|
4497
4503
|
}, y = (M) => {
|
|
4498
|
-
const h = l.value.slice(0, $.value),
|
|
4499
|
-
l.value = h + x +
|
|
4504
|
+
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), c.value = !1, ze(() => {
|
|
4500
4506
|
const B = h.length + x.length;
|
|
4501
|
-
T.value && (T.value.setSelectionRange(B, B), T.value.focus()),
|
|
4507
|
+
T.value && (T.value.setSelectionRange(B, B), T.value.focus()), z.value && (z.value.setSelectionRange(B, B), z.value.focus());
|
|
4502
4508
|
});
|
|
4503
4509
|
}, L = (M) => {
|
|
4504
|
-
if (
|
|
4510
|
+
if (c.value)
|
|
4505
4511
|
switch (M.key) {
|
|
4506
4512
|
case "ArrowDown":
|
|
4507
4513
|
M.preventDefault(), b.value = Math.min(
|
|
@@ -4516,16 +4522,16 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4516
4522
|
M.preventDefault(), b.value >= 0 && y(m.value[b.value]);
|
|
4517
4523
|
break;
|
|
4518
4524
|
case "Escape":
|
|
4519
|
-
|
|
4525
|
+
c.value = !1;
|
|
4520
4526
|
break;
|
|
4521
4527
|
}
|
|
4522
4528
|
}, H = () => {
|
|
4523
4529
|
l.value = "", e("update:modelValue", ""), e("change", "");
|
|
4524
|
-
},
|
|
4525
|
-
M.target.closest(`.${t.b()}`) || (
|
|
4530
|
+
}, E = (M) => {
|
|
4531
|
+
M.target.closest(`.${t.b()}`) || (c.value = !1);
|
|
4526
4532
|
};
|
|
4527
|
-
return ie(
|
|
4528
|
-
M ? document.addEventListener("click",
|
|
4533
|
+
return ie(c, (M) => {
|
|
4534
|
+
M ? document.addEventListener("click", E) : document.removeEventListener("click", E);
|
|
4529
4535
|
}), ie(() => a.modelValue, (M) => {
|
|
4530
4536
|
l.value = M;
|
|
4531
4537
|
}), (M, h) => (i(), d("div", {
|
|
@@ -4534,7 +4540,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4534
4540
|
}, ["stop"]))
|
|
4535
4541
|
}, [
|
|
4536
4542
|
r("div", {
|
|
4537
|
-
class: u([n(t).e("input"), n(t).is("focus",
|
|
4543
|
+
class: u([n(t).e("input"), n(t).is("focus", c.value)])
|
|
4538
4544
|
}, [
|
|
4539
4545
|
r("input", {
|
|
4540
4546
|
ref_key: "inputRef",
|
|
@@ -4545,7 +4551,7 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4545
4551
|
class: u(n(t).e("inner")),
|
|
4546
4552
|
onInput: I,
|
|
4547
4553
|
onKeydown: L
|
|
4548
|
-
}, null, 42,
|
|
4554
|
+
}, null, 42, Ka),
|
|
4549
4555
|
s.clearable && l.value ? (i(), d("span", {
|
|
4550
4556
|
key: 0,
|
|
4551
4557
|
class: u(n(t).e("clear")),
|
|
@@ -4563,59 +4569,59 @@ const Ol = ["onClick"], El = ["placeholder", "disabled", "readonly", "value"], Y
|
|
|
4563
4569
|
r("ul", {
|
|
4564
4570
|
class: u(n(t).e("list"))
|
|
4565
4571
|
}, [
|
|
4566
|
-
(i(!0), d(J, null, _(m.value, (
|
|
4567
|
-
key:
|
|
4572
|
+
(i(!0), d(J, null, _(m.value, (v, x) => (i(), d("li", {
|
|
4573
|
+
key: v.value,
|
|
4568
4574
|
class: u([
|
|
4569
4575
|
n(t).e("item"),
|
|
4570
4576
|
n(t).is("highlighted", x === b.value),
|
|
4571
|
-
n(t).is("disabled",
|
|
4577
|
+
n(t).is("disabled", v.disabled)
|
|
4572
4578
|
]),
|
|
4573
|
-
onClick: (B) => y(
|
|
4579
|
+
onClick: (B) => y(v)
|
|
4574
4580
|
}, [
|
|
4575
|
-
|
|
4581
|
+
v.avatar ? (i(), d("img", {
|
|
4576
4582
|
key: 0,
|
|
4577
|
-
src:
|
|
4583
|
+
src: v.avatar,
|
|
4578
4584
|
class: u(n(t).e("avatar"))
|
|
4579
|
-
}, null, 10,
|
|
4585
|
+
}, null, 10, qa)) : N("", !0),
|
|
4580
4586
|
r("span", {
|
|
4581
4587
|
class: u(n(t).e("label"))
|
|
4582
|
-
}, U(
|
|
4588
|
+
}, U(v.label || v.value), 3),
|
|
4583
4589
|
r("span", {
|
|
4584
4590
|
class: u(n(t).e("value"))
|
|
4585
|
-
}, U(
|
|
4586
|
-
], 10,
|
|
4591
|
+
}, U(v.value), 3)
|
|
4592
|
+
], 10, Wa))), 128))
|
|
4587
4593
|
], 2)
|
|
4588
4594
|
], 2), [
|
|
4589
|
-
[
|
|
4595
|
+
[be, c.value]
|
|
4590
4596
|
])
|
|
4591
4597
|
], 2));
|
|
4592
4598
|
}
|
|
4593
4599
|
});
|
|
4594
4600
|
export {
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
|
|
4620
|
-
|
|
4601
|
+
yt as AutoComplete,
|
|
4602
|
+
gt as Cascader,
|
|
4603
|
+
tt as Checkbox,
|
|
4604
|
+
nt as CheckboxGroup,
|
|
4605
|
+
bt as ColorPicker,
|
|
4606
|
+
ot as DatePicker,
|
|
4607
|
+
ht as DynamicFields,
|
|
4608
|
+
st as Form,
|
|
4609
|
+
ut as FormItem,
|
|
4610
|
+
Ja as Input,
|
|
4611
|
+
Za as InputNumber,
|
|
4612
|
+
Mt as Mention,
|
|
4613
|
+
et as Radio,
|
|
4614
|
+
at as RadioButton,
|
|
4615
|
+
lt as RadioGroup,
|
|
4616
|
+
mt as Rate,
|
|
4617
|
+
pt as RichEditor,
|
|
4618
|
+
kt as Segmented,
|
|
4619
|
+
rt as Select,
|
|
4620
|
+
dt as SelectOption,
|
|
4621
|
+
vt as Slider,
|
|
4622
|
+
_a as Switch,
|
|
4623
|
+
Qa as Textarea,
|
|
4624
|
+
it as TimePicker,
|
|
4625
|
+
ct as Transfer,
|
|
4626
|
+
ft as Upload
|
|
4621
4627
|
};
|