@nhdropshipping/y-components 1.0.59 → 1.0.60
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/dist/components/ytable.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +513 -516
- package/dist/index.esm.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as ke, computed as j, createElementBlock as r, openBlock as s, normalizeClass as B, createElementVNode as l, renderSlot as
|
|
1
|
+
import { defineComponent as ke, computed as j, createElementBlock as r, openBlock as s, normalizeClass as B, createElementVNode as l, renderSlot as ce, Fragment as pe, renderList as me, createCommentVNode as W, toDisplayString as le, ref as K, watch as re, normalizeStyle as fe, withKeys as Ce, nextTick as de, onMounted as Me, onUnmounted as He, resolveComponent as Ve, createVNode as ve, Transition as _e, withCtx as ye, createTextVNode as Se, createBlock as Te, withModifiers as G, withDirectives as Le, vModelText as ut, Teleport as Fe, vShow as Be, provide as dt, reactive as ct, onBeforeUnmount as lt, TransitionGroup as ft, resolveDynamicComponent as vt, mergeProps as ht, toHandlers as pt, render as ot } from "vue";
|
|
2
2
|
const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "content" }, mt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -37,7 +37,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
37
37
|
}
|
|
38
38
|
n("click", x);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const v = j(() => {
|
|
41
41
|
switch (e.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,7 +48,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
51
|
+
}), f = j(() => Array.isArray(e.groupItems) && e.groupItems.length > 0);
|
|
52
52
|
function S(x, H) {
|
|
53
53
|
if (e.disabled || e.loading || x.disabled || x.loading) {
|
|
54
54
|
H.preventDefault(), H.stopPropagation();
|
|
@@ -56,7 +56,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
56
56
|
}
|
|
57
57
|
n("group-click", x.value, H);
|
|
58
58
|
}
|
|
59
|
-
return (x, H) =>
|
|
59
|
+
return (x, H) => f.value ? (s(), r("div", mt, [
|
|
60
60
|
(s(!0), r(pe, null, me(t.groupItems, ($, b) => {
|
|
61
61
|
var c;
|
|
62
62
|
return s(), r("button", {
|
|
@@ -89,7 +89,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : W("", !0),
|
|
92
|
-
$.label && !$.onlyIcon ? (s(), r("span", $t,
|
|
92
|
+
$.label && !$.onlyIcon ? (s(), r("span", $t, le($.label), 1)) : W("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, wt);
|
|
95
95
|
}), 128))
|
|
@@ -100,7 +100,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
100
100
|
`y-btn--${t.size}`,
|
|
101
101
|
{ "is-block": t.block, "is-loading": t.loading },
|
|
102
102
|
t.groupPosition !== "single" ? "is-grouped" : "",
|
|
103
|
-
|
|
103
|
+
v.value
|
|
104
104
|
]]),
|
|
105
105
|
type: t.htmlType,
|
|
106
106
|
disabled: t.disabled || t.loading,
|
|
@@ -109,7 +109,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
109
109
|
onClick: m
|
|
110
110
|
}, [
|
|
111
111
|
l("span", gt, [
|
|
112
|
-
|
|
112
|
+
ce(x.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, yt));
|
|
115
115
|
}
|
|
@@ -139,19 +139,19 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
139
139
|
},
|
|
140
140
|
emits: ["update:modelValue", "enter", "paste"],
|
|
141
141
|
setup(t, { emit: w }) {
|
|
142
|
-
const e = t, n = w, m = K(null),
|
|
142
|
+
const e = t, n = w, m = K(null), v = K(""), f = K(!1), S = K(!1), x = K(e.placeholder || "");
|
|
143
143
|
re(() => e.placeholder, (A) => {
|
|
144
144
|
S.value || (x.value = A || "");
|
|
145
145
|
});
|
|
146
146
|
function H(A) {
|
|
147
147
|
const P = A.target;
|
|
148
|
-
|
|
148
|
+
f.value = !0, n("update:modelValue", P.value);
|
|
149
149
|
}
|
|
150
150
|
function $() {
|
|
151
|
-
S.value = !0, e.clearOnFocus && (
|
|
151
|
+
S.value = !0, e.clearOnFocus && (v.value = e.modelValue || "", f.value = !1, x.value = v.value || e.placeholder || "", n("update:modelValue", ""));
|
|
152
152
|
}
|
|
153
153
|
function b() {
|
|
154
|
-
if (S.value = !1, e.clearOnFocus && !
|
|
154
|
+
if (S.value = !1, e.clearOnFocus && !f.value && (!e.modelValue || e.modelValue === "") && n("update:modelValue", v.value), e.min !== void 0 && e.modelValue !== void 0 && e.modelValue !== "") {
|
|
155
155
|
const A = Number(e.modelValue), P = Number(e.min);
|
|
156
156
|
!Number.isNaN(A) && !Number.isNaN(P) && A < P && n("update:modelValue", String(P));
|
|
157
157
|
}
|
|
@@ -169,7 +169,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
169
169
|
}
|
|
170
170
|
return (A, P) => (s(), r("div", {
|
|
171
171
|
class: B(["y-input-wrap", { "is-block": t.block }]),
|
|
172
|
-
style:
|
|
172
|
+
style: fe({ width: t.width })
|
|
173
173
|
}, [
|
|
174
174
|
l("input", {
|
|
175
175
|
ref_key: "inputRef",
|
|
@@ -209,22 +209,25 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
209
209
|
}, zt = {
|
|
210
210
|
key: 1,
|
|
211
211
|
class: "col-select"
|
|
212
|
-
}, Ht = ["checked", "disabled"],
|
|
212
|
+
}, Ht = { class: "select-header" }, Rt = ["checked", "disabled"], At = {
|
|
213
|
+
key: 0,
|
|
214
|
+
class: "select-count"
|
|
215
|
+
}, Wt = {
|
|
213
216
|
key: 0,
|
|
214
217
|
class: "loading-overlay"
|
|
215
|
-
},
|
|
218
|
+
}, Vt = {
|
|
216
219
|
key: 1,
|
|
217
220
|
class: "empty-overlay"
|
|
218
|
-
},
|
|
221
|
+
}, Ft = {
|
|
219
222
|
key: 0,
|
|
220
223
|
style: { width: "34px", "min-width": "34px" }
|
|
221
|
-
},
|
|
224
|
+
}, Pt = {
|
|
222
225
|
key: 1,
|
|
223
226
|
style: { width: "60px", "min-width": "60px" }
|
|
224
|
-
},
|
|
227
|
+
}, Nt = ["onClick"], Yt = {
|
|
225
228
|
key: 0,
|
|
226
229
|
class: "col-expand"
|
|
227
|
-
},
|
|
230
|
+
}, Ot = ["onClick"], jt = ["value", "checked", "disabled", "onChange"], qt = ["colspan"], Ut = /* @__PURE__ */ ke({
|
|
228
231
|
__name: "ytable",
|
|
229
232
|
props: {
|
|
230
233
|
data: {},
|
|
@@ -255,7 +258,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
255
258
|
},
|
|
256
259
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change", "row-click"],
|
|
257
260
|
setup(t, { emit: w }) {
|
|
258
|
-
const e = t, n = w, m = K(e.currentPage || 1),
|
|
261
|
+
const e = t, n = w, m = K(e.currentPage || 1), v = K(e.pageSize), f = K(e.selectedItems || []), S = K([]), x = K(/* @__PURE__ */ new Set()), H = K("none"), $ = K(), b = K(), c = K(), D = K(), A = K([]), P = K({}), O = j(
|
|
259
262
|
() => e.columns.filter((u) => !F(u.width)).map((u) => u.key)
|
|
260
263
|
);
|
|
261
264
|
function V() {
|
|
@@ -296,12 +299,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
296
299
|
}), q = j(() => (e.pagination, se.value)), ge = j(() => {
|
|
297
300
|
if (!e.selectable) return !1;
|
|
298
301
|
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !d(g, _)).map(({ key: g }) => g);
|
|
299
|
-
return u.length > 0 && u.every((g) =>
|
|
302
|
+
return u.length > 0 && u.every((g) => f.value.includes(g));
|
|
300
303
|
}), U = j(() => {
|
|
301
304
|
if (!e.selectable) return !1;
|
|
302
305
|
const u = q.value.map((g, _) => ({ item: g, index: _ }));
|
|
303
306
|
return u.length > 0 && u.every(({ item: g, index: _ }) => d(g, _));
|
|
304
|
-
}), te = j(() => e.pagination ? q.value.length <
|
|
307
|
+
}), te = j(() => e.pagination ? q.value.length < v.value : !1), p = j(() => {
|
|
305
308
|
const u = [];
|
|
306
309
|
let g = e.selectable ? 60 : 0;
|
|
307
310
|
for (let _ = 0; _ < e.columns.length; _++) {
|
|
@@ -384,63 +387,55 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
384
387
|
}
|
|
385
388
|
function Ke(u) {
|
|
386
389
|
const g = q.value.find((L, C) => a(L, C) === u), _ = q.value.findIndex((L, C) => a(L, C) === u);
|
|
387
|
-
g && _ >= 0 && d(g, _) || (
|
|
390
|
+
g && _ >= 0 && d(g, _) || (f.value.includes(u) ? f.value = f.value.filter((L) => L !== u) : f.value = [...f.value, u], n("select", f.value), n("update:selectedItems", f.value));
|
|
388
391
|
}
|
|
389
392
|
function We() {
|
|
390
393
|
const u = q.value.map((g, _) => ({ key: a(g, _), item: g, index: _ })).filter(({ item: g, index: _ }) => !d(g, _)).map(({ key: g }) => g);
|
|
391
394
|
if (u.length !== 0) {
|
|
392
|
-
if (u.every((g) =>
|
|
393
|
-
|
|
395
|
+
if (u.every((g) => f.value.includes(g)))
|
|
396
|
+
f.value = f.value.filter((g) => !u.includes(g));
|
|
394
397
|
else {
|
|
395
|
-
const g = /* @__PURE__ */ new Set([...
|
|
396
|
-
|
|
398
|
+
const g = /* @__PURE__ */ new Set([...f.value, ...u]);
|
|
399
|
+
f.value = Array.from(g);
|
|
397
400
|
}
|
|
398
|
-
n("select",
|
|
401
|
+
n("select", f.value), n("update:selectedItems", f.value);
|
|
399
402
|
}
|
|
400
403
|
}
|
|
401
404
|
function Pe() {
|
|
402
|
-
|
|
405
|
+
f.value = [], n("select", f.value), n("update:selectedItems", f.value);
|
|
403
406
|
}
|
|
404
407
|
function Ze(u, g) {
|
|
405
408
|
if (!e.rowSelectable) return;
|
|
406
409
|
const _ = a(u, g);
|
|
407
|
-
|
|
408
|
-
if (S.value === _)
|
|
409
|
-
S.value = null, n("row-click", u, null);
|
|
410
|
-
else if (e.requireDeselectBeforeSelect) {
|
|
411
|
-
if (S.value !== null)
|
|
412
|
-
return;
|
|
413
|
-
S.value = _, n("row-click", u, _);
|
|
414
|
-
} else
|
|
415
|
-
S.value = _, n("row-click", u, _);
|
|
410
|
+
d(u, g) || (e.requireDeselectBeforeSelect ? S.value.includes(_) ? (S.value = S.value.filter((L) => L !== _), n("row-click", u, null)) : (S.value = [...S.value, _], n("row-click", u, _)) : S.value.includes(_) ? (S.value = [], n("row-click", u, null)) : (S.value = [_], n("row-click", u, _)));
|
|
416
411
|
}
|
|
417
412
|
function Qe(u, g) {
|
|
418
413
|
if (!e.rowSelectable) return !1;
|
|
419
414
|
const _ = a(u, g);
|
|
420
|
-
return S.value
|
|
415
|
+
return S.value.includes(_);
|
|
421
416
|
}
|
|
422
417
|
re(() => e.selectedItems, (u) => {
|
|
423
418
|
if (u !== void 0 && Array.isArray(u)) {
|
|
424
|
-
const g = new Set(
|
|
425
|
-
(g.size !== _.size || ![...g].every((L) => _.has(L))) && (
|
|
426
|
-
} else u === void 0 &&
|
|
419
|
+
const g = new Set(f.value), _ = new Set(u);
|
|
420
|
+
(g.size !== _.size || ![...g].every((L) => _.has(L))) && (f.value = [...u]);
|
|
421
|
+
} else u === void 0 && f.value.length > 0 && (f.value = []);
|
|
427
422
|
}, { deep: !0, immediate: !0 }), re(() => e.searchKeyword, () => {
|
|
428
423
|
m.value = 1;
|
|
429
424
|
}), re(() => e.data, () => {
|
|
430
|
-
e.total || (m.value = 1), e.rowSelectable && (S.value =
|
|
425
|
+
e.total || (m.value = 1), e.rowSelectable && (S.value = []);
|
|
431
426
|
}, { deep: !0 });
|
|
432
427
|
function Je(u) {
|
|
433
|
-
m.value = u, e.rowSelectable && (S.value =
|
|
428
|
+
m.value = u, e.rowSelectable && (S.value = []), n("page-change", u);
|
|
434
429
|
}
|
|
435
430
|
function Ne(u) {
|
|
436
|
-
|
|
431
|
+
v.value = u, m.value = 1, e.rowSelectable && (S.value = []), n("page-size-change", u);
|
|
437
432
|
}
|
|
438
433
|
re(() => e.currentPage, (u) => {
|
|
439
434
|
const g = typeof u == "number" && u > 0 ? u : 1;
|
|
440
435
|
m.value !== g && (m.value = g);
|
|
441
436
|
}), re(() => e.pageSize, (u) => {
|
|
442
437
|
const g = typeof u == "number" && u > 0 ? u : 10;
|
|
443
|
-
|
|
438
|
+
v.value !== g && (v.value = g);
|
|
444
439
|
});
|
|
445
440
|
function Re() {
|
|
446
441
|
$.value && de(() => {
|
|
@@ -525,15 +520,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
525
520
|
});
|
|
526
521
|
}
|
|
527
522
|
function ie() {
|
|
528
|
-
Re(),
|
|
523
|
+
Re(), oe();
|
|
529
524
|
}
|
|
530
525
|
re(() => e.data, () => {
|
|
531
526
|
de(() => {
|
|
532
|
-
Re(), ze(),
|
|
527
|
+
Re(), ze(), oe(), x.value.clear();
|
|
533
528
|
});
|
|
534
|
-
}, { deep: !0 }), re([m,
|
|
529
|
+
}, { deep: !0 }), re([m, v], () => {
|
|
535
530
|
de(() => {
|
|
536
|
-
Re(), ze(),
|
|
531
|
+
Re(), ze(), oe();
|
|
537
532
|
});
|
|
538
533
|
}), re(() => e.columns, () => {
|
|
539
534
|
const u = [], g = { ...P.value };
|
|
@@ -545,33 +540,33 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
545
540
|
Object.keys(g).forEach((L) => {
|
|
546
541
|
_.has(L) || delete g[L];
|
|
547
542
|
}), P.value = g, A.value = u, de(() => {
|
|
548
|
-
Z(), ze(),
|
|
543
|
+
Z(), ze(), oe();
|
|
549
544
|
});
|
|
550
|
-
}, { deep: !0 }), re(() =>
|
|
545
|
+
}, { deep: !0 }), re(() => f.value, () => {
|
|
551
546
|
de(() => {
|
|
552
|
-
Re(),
|
|
547
|
+
Re(), oe();
|
|
553
548
|
});
|
|
554
549
|
}, { deep: !0 }), re(() => e.loading, () => {
|
|
555
550
|
de(() => {
|
|
556
|
-
|
|
551
|
+
oe();
|
|
557
552
|
});
|
|
558
553
|
}), Me(() => {
|
|
559
554
|
var u, g;
|
|
560
555
|
de(() => {
|
|
561
|
-
Re(), Z(),
|
|
556
|
+
Re(), Z(), oe(), i();
|
|
562
557
|
}), window.addEventListener("resize", ie), window.addEventListener("scroll", ie, !0), (u = c.value) == null || u.addEventListener("scroll", () => {
|
|
563
|
-
ze(), i(),
|
|
558
|
+
ze(), i(), oe();
|
|
564
559
|
}, { passive: !0 }), (g = b.value) == null || g.addEventListener("scroll", () => {
|
|
565
560
|
Ae();
|
|
566
561
|
}, { passive: !0 }), de(() => ze()), c.value && typeof ResizeObserver < "u" && (we = new ResizeObserver(() => {
|
|
567
|
-
|
|
562
|
+
oe();
|
|
568
563
|
}), we.observe(c.value));
|
|
569
564
|
}), He(() => {
|
|
570
565
|
var u, g;
|
|
571
566
|
window.removeEventListener("resize", ie), window.removeEventListener("scroll", ie, !0), (u = c.value) == null || u.removeEventListener("scroll", ze), (g = b.value) == null || g.removeEventListener("scroll", Ae), window.removeEventListener("mousemove", y), window.removeEventListener("mouseup", I), we && (we.disconnect(), we = null);
|
|
572
567
|
});
|
|
573
568
|
let ue = -1;
|
|
574
|
-
function
|
|
569
|
+
function oe() {
|
|
575
570
|
!b.value || !c.value || requestAnimationFrame(() => {
|
|
576
571
|
if (!b.value || !c.value) return;
|
|
577
572
|
const u = c.value, g = Math.ceil(u.offsetWidth - u.clientWidth);
|
|
@@ -592,11 +587,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
592
587
|
}, [
|
|
593
588
|
ve(_e, { name: "bulk-slide" }, {
|
|
594
589
|
default: ye(() => [
|
|
595
|
-
|
|
596
|
-
l("div", Mt, "已选择 " +
|
|
590
|
+
f.value.length && t.showBulkActions ? (s(), r("div", St, [
|
|
591
|
+
l("div", Mt, "已选择 " + le(f.value.length) + " 项", 1),
|
|
597
592
|
l("div", Lt, [
|
|
598
|
-
|
|
599
|
-
selectedItems:
|
|
593
|
+
ce(u.$slots, "bulk-actions", {
|
|
594
|
+
selectedItems: f.value,
|
|
600
595
|
clearSelection: Pe
|
|
601
596
|
}, () => [
|
|
602
597
|
ve(_, {
|
|
@@ -627,25 +622,28 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
627
622
|
t.selectable ? (s(), r("col", Tt)) : W("", !0),
|
|
628
623
|
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("col", {
|
|
629
624
|
key: C.key,
|
|
630
|
-
style:
|
|
625
|
+
style: fe({ width: A.value[R] || void 0, minWidth: A.value[R] || "80px" })
|
|
631
626
|
}, null, 4))), 128))
|
|
632
627
|
]),
|
|
633
628
|
l("thead", null, [
|
|
634
629
|
l("tr", null, [
|
|
635
630
|
e.expandable ? (s(), r("th", Kt)) : W("", !0),
|
|
636
631
|
t.selectable ? (s(), r("th", zt, [
|
|
637
|
-
l("
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
632
|
+
l("div", Ht, [
|
|
633
|
+
l("input", {
|
|
634
|
+
type: "checkbox",
|
|
635
|
+
checked: ge.value,
|
|
636
|
+
disabled: U.value,
|
|
637
|
+
onChange: We
|
|
638
|
+
}, null, 40, Rt),
|
|
639
|
+
f.value.length > 0 ? (s(), r("span", At, le(f.value.length), 1)) : W("", !0)
|
|
640
|
+
])
|
|
643
641
|
])) : W("", !0),
|
|
644
642
|
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("th", {
|
|
645
643
|
key: C.key,
|
|
646
644
|
class: B(Y(C, !0)),
|
|
647
|
-
style:
|
|
648
|
-
},
|
|
645
|
+
style: fe(ne(C, R, !0))
|
|
646
|
+
}, le(C.title), 7))), 128))
|
|
649
647
|
])
|
|
650
648
|
])
|
|
651
649
|
])
|
|
@@ -654,15 +652,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
654
652
|
class: B(["table-body-wrap", { "is-loading": t.loading, "is-empty": !q.value.length && !t.loading }]),
|
|
655
653
|
ref_key: "bodyWrapRef",
|
|
656
654
|
ref: c,
|
|
657
|
-
style:
|
|
655
|
+
style: fe({ maxHeight: H.value })
|
|
658
656
|
}, [
|
|
659
|
-
t.loading ? (s(), r("div",
|
|
657
|
+
t.loading ? (s(), r("div", Wt, [...g[4] || (g[4] = [
|
|
660
658
|
l("div", { class: "loading-spinner" }, null, -1),
|
|
661
659
|
l("div", { class: "loading-text" }, "加载中...", -1)
|
|
662
660
|
])])) : W("", !0),
|
|
663
|
-
!q.value.length && !t.loading ? (s(), r("div",
|
|
664
|
-
|
|
665
|
-
Se(
|
|
661
|
+
!q.value.length && !t.loading ? (s(), r("div", Vt, [
|
|
662
|
+
ce(u.$slots, "empty", {}, () => [
|
|
663
|
+
Se(le(t.emptyText), 1)
|
|
666
664
|
], !0)
|
|
667
665
|
])) : W("", !0),
|
|
668
666
|
l("table", {
|
|
@@ -671,11 +669,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
671
669
|
ref: D
|
|
672
670
|
}, [
|
|
673
671
|
l("colgroup", null, [
|
|
674
|
-
e.expandable ? (s(), r("col",
|
|
675
|
-
t.selectable ? (s(), r("col",
|
|
672
|
+
e.expandable ? (s(), r("col", Ft)) : W("", !0),
|
|
673
|
+
t.selectable ? (s(), r("col", Pt)) : W("", !0),
|
|
676
674
|
(s(!0), r(pe, null, me(t.columns, (C, R) => (s(), r("col", {
|
|
677
675
|
key: C.key,
|
|
678
|
-
style:
|
|
676
|
+
style: fe({ width: A.value[R] || void 0, minWidth: A.value[R] || "80px" })
|
|
679
677
|
}, null, 4))), 128))
|
|
680
678
|
]),
|
|
681
679
|
l("tbody", null, [
|
|
@@ -684,10 +682,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
684
682
|
}, [
|
|
685
683
|
l("tr", {
|
|
686
684
|
class: B({ "row-selected": Qe(C, R) }),
|
|
687
|
-
style: ce(t.rowSelectable ? { cursor: "pointer" } : {}),
|
|
688
685
|
onClick: (X) => Ze(C, R)
|
|
689
686
|
}, [
|
|
690
|
-
e.expandable ? (s(), r("td",
|
|
687
|
+
e.expandable ? (s(), r("td", Yt, [
|
|
691
688
|
l("button", {
|
|
692
689
|
class: "expand-btn",
|
|
693
690
|
type: "button",
|
|
@@ -696,7 +693,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
696
693
|
l("span", {
|
|
697
694
|
class: B(["expand-icon", { "is-open": k(a(C, R)) }])
|
|
698
695
|
}, null, 2)
|
|
699
|
-
], 8,
|
|
696
|
+
], 8, Ot)
|
|
700
697
|
])) : W("", !0),
|
|
701
698
|
t.selectable ? (s(), r("td", {
|
|
702
699
|
key: 1,
|
|
@@ -707,25 +704,25 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
707
704
|
l("input", {
|
|
708
705
|
type: "checkbox",
|
|
709
706
|
value: a(C, R),
|
|
710
|
-
checked:
|
|
707
|
+
checked: f.value.includes(a(C, R)),
|
|
711
708
|
disabled: d(C, R),
|
|
712
709
|
onChange: G((X) => Ke(a(C, R)), ["stop"])
|
|
713
|
-
}, null, 40,
|
|
710
|
+
}, null, 40, jt)
|
|
714
711
|
])) : W("", !0),
|
|
715
712
|
(s(!0), r(pe, null, me(t.columns, (X, be) => (s(), r("td", {
|
|
716
713
|
key: X.key,
|
|
717
714
|
class: B(Y(X)),
|
|
718
|
-
style:
|
|
715
|
+
style: fe(ne(X, be, !1))
|
|
719
716
|
}, [
|
|
720
|
-
|
|
717
|
+
ce(u.$slots, `cell-${X.key}`, {
|
|
721
718
|
item: C,
|
|
722
719
|
value: z(C, X.key),
|
|
723
720
|
index: R
|
|
724
721
|
}, () => [
|
|
725
|
-
Se(
|
|
722
|
+
Se(le($e(C, X)), 1)
|
|
726
723
|
], !0)
|
|
727
724
|
], 6))), 128))
|
|
728
|
-
],
|
|
725
|
+
], 10, Nt),
|
|
729
726
|
e.expandable && k(a(C, R)) ? (s(), r("tr", {
|
|
730
727
|
key: `${a(C, R)}-expand`,
|
|
731
728
|
class: "expand-row"
|
|
@@ -734,11 +731,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
734
731
|
colspan: N.value,
|
|
735
732
|
class: "expand-cell"
|
|
736
733
|
}, [
|
|
737
|
-
|
|
734
|
+
ce(u.$slots, "expand", {
|
|
738
735
|
item: C,
|
|
739
736
|
index: R
|
|
740
737
|
}, void 0, !0)
|
|
741
|
-
], 8,
|
|
738
|
+
], 8, qt)
|
|
742
739
|
])) : W("", !0)
|
|
743
740
|
], 64))), 128))
|
|
744
741
|
])
|
|
@@ -749,8 +746,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
749
746
|
class: "align-right",
|
|
750
747
|
"current-page": m.value,
|
|
751
748
|
"onUpdate:currentPage": g[1] || (g[1] = (C) => m.value = C),
|
|
752
|
-
"page-size":
|
|
753
|
-
"onUpdate:pageSize": g[2] || (g[2] = (C) =>
|
|
749
|
+
"page-size": v.value,
|
|
750
|
+
"onUpdate:pageSize": g[2] || (g[2] = (C) => v.value = C),
|
|
754
751
|
loading: e.loading,
|
|
755
752
|
"disable-next": te.value,
|
|
756
753
|
"page-size-options": t.pageSizeOptions,
|
|
@@ -761,7 +758,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
761
758
|
], 512);
|
|
762
759
|
};
|
|
763
760
|
}
|
|
764
|
-
}),
|
|
761
|
+
}), Zt = /* @__PURE__ */ xe(Ut, [["__scopeId", "data-v-e777d365"]]), Qt = ["onKeydown", "aria-expanded"], Jt = ["src"], Xt = ["placeholder", "onKeydown"], Gt = ["onClick", "onMouseenter"], en = ["src"], tn = /* @__PURE__ */ ke({
|
|
765
762
|
__name: "yselect",
|
|
766
763
|
props: {
|
|
767
764
|
modelValue: {},
|
|
@@ -780,7 +777,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
780
777
|
},
|
|
781
778
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
782
779
|
setup(t, { emit: w }) {
|
|
783
|
-
const e = t, n = w, m = K(!1),
|
|
780
|
+
const e = t, n = w, m = K(!1), v = K(-1), f = K(), S = K(), x = K(), H = K(), $ = K(!1), b = K(), c = K(""), D = j(() => e.options.find((o) => Q(o) === e.modelValue) || null), A = j(() => D.value ? J(D.value) : ""), P = j(() => {
|
|
784
781
|
if (!e.filterable) return e.options;
|
|
785
782
|
const o = c.value.trim().toLowerCase();
|
|
786
783
|
return o ? e.options.filter((a) => {
|
|
@@ -826,7 +823,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
826
823
|
}));
|
|
827
824
|
}
|
|
828
825
|
function T() {
|
|
829
|
-
m.value = !1,
|
|
826
|
+
m.value = !1, v.value = -1, $.value = !1, e.filterable && (c.value = "");
|
|
830
827
|
}
|
|
831
828
|
function N(o, a) {
|
|
832
829
|
if (he(o)) return;
|
|
@@ -840,30 +837,30 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
840
837
|
}
|
|
841
838
|
function q(o) {
|
|
842
839
|
if (!P.value || P.value.length === 0) {
|
|
843
|
-
|
|
840
|
+
v.value = -1;
|
|
844
841
|
return;
|
|
845
842
|
}
|
|
846
|
-
let a =
|
|
843
|
+
let a = v.value;
|
|
847
844
|
const d = P.value.length;
|
|
848
845
|
a === -1 ? a = o > 0 ? 0 : d - 1 : a = (a + o + d) % d;
|
|
849
846
|
let k = 0;
|
|
850
847
|
for (; k < d && he(P.value[a]); )
|
|
851
848
|
a = (a + o + d) % d, k++;
|
|
852
|
-
|
|
849
|
+
v.value = k >= d ? -1 : a, te();
|
|
853
850
|
}
|
|
854
851
|
function ge() {
|
|
855
|
-
if (
|
|
856
|
-
const o = P.value[
|
|
857
|
-
!o || he(o) || N(o,
|
|
852
|
+
if (v.value < 0) return;
|
|
853
|
+
const o = P.value[v.value];
|
|
854
|
+
!o || he(o) || N(o, v.value);
|
|
858
855
|
}
|
|
859
856
|
function U() {
|
|
860
|
-
if (!
|
|
861
|
-
const o =
|
|
857
|
+
if (!f.value) return;
|
|
858
|
+
const o = f.value.querySelector(".yselect__option--selected");
|
|
862
859
|
o && o.scrollIntoView({ block: "nearest" });
|
|
863
860
|
}
|
|
864
861
|
function te() {
|
|
865
|
-
if (!
|
|
866
|
-
const a =
|
|
862
|
+
if (!f.value || v.value < 0) return;
|
|
863
|
+
const a = f.value.querySelectorAll(".yselect__option")[v.value];
|
|
867
864
|
a && a.scrollIntoView({ block: "nearest" });
|
|
868
865
|
}
|
|
869
866
|
function p(o) {
|
|
@@ -871,7 +868,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
871
868
|
(!x.value || !x.value.contains(a)) && T();
|
|
872
869
|
}
|
|
873
870
|
re(() => e.modelValue, () => {
|
|
874
|
-
|
|
871
|
+
v.value = -1;
|
|
875
872
|
});
|
|
876
873
|
function h() {
|
|
877
874
|
m.value && V();
|
|
@@ -882,7 +879,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
882
879
|
document.removeEventListener("click", p), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
883
880
|
}), (o, a) => (s(), r("div", {
|
|
884
881
|
class: B(["yselect", { "yselect--disabled": t.disabled, [`yselect--${t.size}`]: !0 }]),
|
|
885
|
-
style:
|
|
882
|
+
style: fe({ width: t.width }),
|
|
886
883
|
ref_key: "selectContainer",
|
|
887
884
|
ref: x
|
|
888
885
|
}, [
|
|
@@ -911,7 +908,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
911
908
|
key: 0,
|
|
912
909
|
class: B(["yselect__value", { yselect__placeholder: !A.value }])
|
|
913
910
|
}, [
|
|
914
|
-
|
|
911
|
+
ce(o.$slots, "value", {
|
|
915
912
|
value: D.value,
|
|
916
913
|
label: A.value
|
|
917
914
|
}, () => {
|
|
@@ -923,10 +920,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
923
920
|
class: "yselect__flag",
|
|
924
921
|
src: D.value.flagImg,
|
|
925
922
|
alt: "flag"
|
|
926
|
-
}, null, 8,
|
|
927
|
-
Se(" " +
|
|
923
|
+
}, null, 8, Jt)) : W("", !0),
|
|
924
|
+
Se(" " + le(A.value), 1)
|
|
928
925
|
], 64)) : (s(), r(pe, { key: 1 }, [
|
|
929
|
-
Se(
|
|
926
|
+
Se(le(t.placeholder), 1)
|
|
930
927
|
], 64))
|
|
931
928
|
];
|
|
932
929
|
}, !0)
|
|
@@ -947,7 +944,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
947
944
|
Ce(G(T, ["prevent"]), ["esc"]),
|
|
948
945
|
Ce(G(se, ["prevent"]), ["delete"])
|
|
949
946
|
]
|
|
950
|
-
}, null, 40,
|
|
947
|
+
}, null, 40, Xt)), [
|
|
951
948
|
[ut, c.value]
|
|
952
949
|
]),
|
|
953
950
|
t.clearable && !t.disabled && D.value ? (s(), r("span", {
|
|
@@ -988,7 +985,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
988
985
|
})
|
|
989
986
|
], -1)
|
|
990
987
|
])], 2)
|
|
991
|
-
], 42,
|
|
988
|
+
], 42, Qt),
|
|
992
989
|
ve(_e, { name: "yselect-dropdown" }, {
|
|
993
990
|
default: ye(() => [
|
|
994
991
|
(s(), Te(Fe, { to: "body" }, [
|
|
@@ -997,7 +994,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
997
994
|
ref_key: "dropdownEl",
|
|
998
995
|
ref: H,
|
|
999
996
|
class: B(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": $.value }]),
|
|
1000
|
-
style:
|
|
997
|
+
style: fe(O.value),
|
|
1001
998
|
onMousedown: a[6] || (a[6] = G(() => {
|
|
1002
999
|
}, ["stop"])),
|
|
1003
1000
|
onClick: a[7] || (a[7] = G(() => {
|
|
@@ -1006,20 +1003,20 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1006
1003
|
l("div", {
|
|
1007
1004
|
class: "yselect__options",
|
|
1008
1005
|
ref_key: "optionsContainer",
|
|
1009
|
-
ref:
|
|
1006
|
+
ref: f
|
|
1010
1007
|
}, [
|
|
1011
1008
|
(s(!0), r(pe, null, me(P.value, (d, k) => (s(), r("div", {
|
|
1012
1009
|
key: ae(d, k),
|
|
1013
1010
|
class: B(["yselect__option", {
|
|
1014
1011
|
"yselect__option--selected": ee(d),
|
|
1015
1012
|
"yselect__option--disabled": he(d),
|
|
1016
|
-
"yselect__option--hover":
|
|
1013
|
+
"yselect__option--hover": v.value === k
|
|
1017
1014
|
}]),
|
|
1018
1015
|
onClick: (M) => N(d),
|
|
1019
|
-
onMouseenter: (M) =>
|
|
1020
|
-
onMouseleave: a[5] || (a[5] = (M) =>
|
|
1016
|
+
onMouseenter: (M) => v.value = k,
|
|
1017
|
+
onMouseleave: a[5] || (a[5] = (M) => v.value = -1)
|
|
1021
1018
|
}, [
|
|
1022
|
-
|
|
1019
|
+
ce(o.$slots, "option", {
|
|
1023
1020
|
option: d,
|
|
1024
1021
|
index: k,
|
|
1025
1022
|
selected: ee(d)
|
|
@@ -1029,10 +1026,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1029
1026
|
class: "yselect__flag",
|
|
1030
1027
|
src: d.flagImg,
|
|
1031
1028
|
alt: "flag"
|
|
1032
|
-
}, null, 8,
|
|
1033
|
-
Se(" " +
|
|
1029
|
+
}, null, 8, en)) : W("", !0),
|
|
1030
|
+
Se(" " + le(J(d)), 1)
|
|
1034
1031
|
], !0)
|
|
1035
|
-
], 42,
|
|
1032
|
+
], 42, Gt))), 128))
|
|
1036
1033
|
], 512)
|
|
1037
1034
|
], 38)) : W("", !0)
|
|
1038
1035
|
]))
|
|
@@ -1041,7 +1038,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1041
1038
|
})
|
|
1042
1039
|
], 6));
|
|
1043
1040
|
}
|
|
1044
|
-
}), st = /* @__PURE__ */ xe(
|
|
1041
|
+
}), st = /* @__PURE__ */ xe(tn, [["__scopeId", "data-v-6cd47cb7"]]), nn = { class: "ypagination" }, ln = { class: "page-actions" }, on = { class: "page-size-select" }, an = /* @__PURE__ */ ke({
|
|
1045
1042
|
__name: "ypagination",
|
|
1046
1043
|
props: {
|
|
1047
1044
|
currentPage: {},
|
|
@@ -1057,20 +1054,20 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1057
1054
|
},
|
|
1058
1055
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1059
1056
|
setup(t, { emit: w }) {
|
|
1060
|
-
const e = t, n = w, m = K(e.pageSize),
|
|
1057
|
+
const e = t, n = w, m = K(e.pageSize), v = j(() => e.pageSizeOptions), f = j({
|
|
1061
1058
|
get: () => e.currentPage,
|
|
1062
1059
|
set: ($) => {
|
|
1063
1060
|
n("update:currentPage", $), n("page-change", $);
|
|
1064
1061
|
}
|
|
1065
1062
|
});
|
|
1066
1063
|
function S($) {
|
|
1067
|
-
e.loading || $ >= 1 && $ !== e.currentPage && (
|
|
1064
|
+
e.loading || $ >= 1 && $ !== e.currentPage && (f.value = $);
|
|
1068
1065
|
}
|
|
1069
1066
|
function x($) {
|
|
1070
|
-
e.loading || (m.value = $, n("update:pageSize", $), n("page-size-change", $),
|
|
1067
|
+
e.loading || (m.value = $, n("update:pageSize", $), n("page-size-change", $), f.value = 1);
|
|
1071
1068
|
}
|
|
1072
1069
|
function H($) {
|
|
1073
|
-
e.loading || ($ === "prev" ? S(
|
|
1070
|
+
e.loading || ($ === "prev" ? S(f.value - 1) : $ === "next" && S(f.value + 1));
|
|
1074
1071
|
}
|
|
1075
1072
|
return m.value = e.pageSize, re(
|
|
1076
1073
|
() => e.pageSize,
|
|
@@ -1079,12 +1076,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1079
1076
|
}
|
|
1080
1077
|
), ($, b) => {
|
|
1081
1078
|
const c = Ve("YButton"), D = Ve("YSelect");
|
|
1082
|
-
return s(), r("div",
|
|
1083
|
-
l("div",
|
|
1079
|
+
return s(), r("div", nn, [
|
|
1080
|
+
l("div", ln, [
|
|
1084
1081
|
ve(c, {
|
|
1085
1082
|
size: "small",
|
|
1086
1083
|
variant: "secondary",
|
|
1087
|
-
disabled:
|
|
1084
|
+
disabled: f.value === 1 || t.loading,
|
|
1088
1085
|
onClick: b[0] || (b[0] = (A) => S(1))
|
|
1089
1086
|
}, {
|
|
1090
1087
|
default: ye(() => [...b[2] || (b[2] = [
|
|
@@ -1097,16 +1094,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1097
1094
|
variant: "secondary",
|
|
1098
1095
|
size: "small",
|
|
1099
1096
|
groupItems: [
|
|
1100
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1097
|
+
{ label: "上一页", value: "prev", disabled: f.value === 1 || t.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1101
1098
|
{ label: "下一页", value: "next", disabled: t.loading || t.disableNext, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1102
1099
|
],
|
|
1103
1100
|
onGroupClick: H
|
|
1104
1101
|
}, null, 8, ["groupItems"]),
|
|
1105
|
-
l("div",
|
|
1102
|
+
l("div", on, [
|
|
1106
1103
|
ve(D, {
|
|
1107
1104
|
modelValue: m.value,
|
|
1108
1105
|
"onUpdate:modelValue": b[1] || (b[1] = (A) => m.value = A),
|
|
1109
|
-
options:
|
|
1106
|
+
options: v.value,
|
|
1110
1107
|
size: "small",
|
|
1111
1108
|
width: "105px",
|
|
1112
1109
|
clearable: !1,
|
|
@@ -1118,50 +1115,50 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1118
1115
|
]);
|
|
1119
1116
|
};
|
|
1120
1117
|
}
|
|
1121
|
-
}),
|
|
1118
|
+
}), sn = /* @__PURE__ */ xe(an, [["__scopeId", "data-v-5a512f0f"]]), rn = ["aria-label"], un = { class: "y-badge__inner" }, dn = {
|
|
1122
1119
|
key: 0,
|
|
1123
1120
|
class: "y-badge__progress",
|
|
1124
1121
|
"aria-hidden": "true"
|
|
1125
|
-
},
|
|
1122
|
+
}, cn = {
|
|
1126
1123
|
key: 0,
|
|
1127
1124
|
class: "icon",
|
|
1128
1125
|
viewBox: "0 0 20 20",
|
|
1129
1126
|
fill: "currentColor"
|
|
1130
|
-
},
|
|
1127
|
+
}, fn = {
|
|
1131
1128
|
key: 1,
|
|
1132
1129
|
class: "icon",
|
|
1133
1130
|
viewBox: "0 0 20 20",
|
|
1134
1131
|
fill: "currentColor"
|
|
1135
|
-
},
|
|
1132
|
+
}, vn = {
|
|
1136
1133
|
key: 2,
|
|
1137
1134
|
class: "icon",
|
|
1138
1135
|
viewBox: "0 0 20 20",
|
|
1139
1136
|
fill: "currentColor"
|
|
1140
|
-
},
|
|
1137
|
+
}, hn = {
|
|
1141
1138
|
key: 1,
|
|
1142
1139
|
class: "y-badge__icon",
|
|
1143
1140
|
"aria-hidden": "true"
|
|
1144
|
-
},
|
|
1141
|
+
}, pn = {
|
|
1145
1142
|
key: 0,
|
|
1146
1143
|
class: "icon",
|
|
1147
1144
|
viewBox: "0 0 20 20",
|
|
1148
1145
|
fill: "currentColor"
|
|
1149
|
-
},
|
|
1146
|
+
}, yn = {
|
|
1150
1147
|
key: 1,
|
|
1151
1148
|
class: "icon",
|
|
1152
1149
|
viewBox: "0 0 20 20",
|
|
1153
1150
|
fill: "currentColor"
|
|
1154
|
-
},
|
|
1151
|
+
}, gn = {
|
|
1155
1152
|
key: 2,
|
|
1156
1153
|
class: "icon",
|
|
1157
1154
|
viewBox: "0 0 20 20",
|
|
1158
1155
|
fill: "currentColor"
|
|
1159
|
-
},
|
|
1156
|
+
}, mn = {
|
|
1160
1157
|
key: 3,
|
|
1161
1158
|
class: "icon",
|
|
1162
1159
|
viewBox: "0 0 20 20",
|
|
1163
1160
|
fill: "currentColor"
|
|
1164
|
-
},
|
|
1161
|
+
}, wn = { class: "y-badge__label" }, bn = /* @__PURE__ */ ke({
|
|
1165
1162
|
__name: "ybadge",
|
|
1166
1163
|
props: {
|
|
1167
1164
|
tone: { default: "default" },
|
|
@@ -1174,16 +1171,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1174
1171
|
},
|
|
1175
1172
|
setup(t) {
|
|
1176
1173
|
const w = t, e = j(() => w.tone || "default"), n = j(() => {
|
|
1177
|
-
const m = (w.label || "").trim(),
|
|
1178
|
-
if (
|
|
1174
|
+
const m = (w.label || "").trim(), v = w.tone, f = w.progress;
|
|
1175
|
+
if (f) {
|
|
1179
1176
|
const S = {
|
|
1180
1177
|
incomplete: "未完成",
|
|
1181
1178
|
partiallyComplete: "部分完成",
|
|
1182
1179
|
complete: "已完成"
|
|
1183
1180
|
};
|
|
1184
|
-
return m ? `${m},进度:${S[
|
|
1181
|
+
return m ? `${m},进度:${S[f] || f}` : `进度:${S[f] || f}`;
|
|
1185
1182
|
}
|
|
1186
|
-
if (
|
|
1183
|
+
if (v && v !== "default") {
|
|
1187
1184
|
const S = {
|
|
1188
1185
|
informational: "信息",
|
|
1189
1186
|
success: "成功",
|
|
@@ -1192,11 +1189,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1192
1189
|
critical: "严重",
|
|
1193
1190
|
default: "默认"
|
|
1194
1191
|
};
|
|
1195
|
-
return m ? `${m},语气:${S[
|
|
1192
|
+
return m ? `${m},语气:${S[v] || v}` : `语气:${S[v] || v}`;
|
|
1196
1193
|
}
|
|
1197
1194
|
return m || "标记";
|
|
1198
1195
|
});
|
|
1199
|
-
return (m,
|
|
1196
|
+
return (m, v) => (s(), r("span", {
|
|
1200
1197
|
class: B(["y-badge", [
|
|
1201
1198
|
`y-badge--${e.value}`,
|
|
1202
1199
|
`y-badge--${t.size}`,
|
|
@@ -1206,15 +1203,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1206
1203
|
role: "status",
|
|
1207
1204
|
"aria-label": n.value
|
|
1208
1205
|
}, [
|
|
1209
|
-
l("span",
|
|
1210
|
-
t.progress ? (s(), r("span",
|
|
1211
|
-
t.progress === "incomplete" ? (s(), r("svg",
|
|
1206
|
+
l("span", un, [
|
|
1207
|
+
t.progress ? (s(), r("span", dn, [
|
|
1208
|
+
t.progress === "incomplete" ? (s(), r("svg", cn, [...v[0] || (v[0] = [
|
|
1212
1209
|
l("circle", {
|
|
1213
1210
|
cx: "10",
|
|
1214
1211
|
cy: "10",
|
|
1215
1212
|
r: "5"
|
|
1216
1213
|
}, null, -1)
|
|
1217
|
-
])])) : t.progress === "partiallyComplete" ? (s(), r("svg",
|
|
1214
|
+
])])) : t.progress === "partiallyComplete" ? (s(), r("svg", fn, [...v[1] || (v[1] = [
|
|
1218
1215
|
l("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1219
1216
|
l("circle", {
|
|
1220
1217
|
cx: "10",
|
|
@@ -1224,33 +1221,33 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1224
1221
|
stroke: "currentColor",
|
|
1225
1222
|
"stroke-width": "2"
|
|
1226
1223
|
}, null, -1)
|
|
1227
|
-
])])) : t.progress === "complete" ? (s(), r("svg",
|
|
1224
|
+
])])) : t.progress === "complete" ? (s(), r("svg", vn, [...v[2] || (v[2] = [
|
|
1228
1225
|
l("path", {
|
|
1229
1226
|
"fill-rule": "evenodd",
|
|
1230
1227
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1231
1228
|
"clip-rule": "evenodd"
|
|
1232
1229
|
}, null, -1)
|
|
1233
1230
|
])])) : W("", !0)
|
|
1234
|
-
])) : t.icon ? (s(), r("span",
|
|
1235
|
-
t.icon === "dot" ? (s(), r("svg",
|
|
1231
|
+
])) : t.icon ? (s(), r("span", hn, [
|
|
1232
|
+
t.icon === "dot" ? (s(), r("svg", pn, [...v[3] || (v[3] = [
|
|
1236
1233
|
l("circle", {
|
|
1237
1234
|
cx: "10",
|
|
1238
1235
|
cy: "10",
|
|
1239
1236
|
r: "4"
|
|
1240
1237
|
}, null, -1)
|
|
1241
|
-
])])) : t.icon === "check" ? (s(), r("svg",
|
|
1238
|
+
])])) : t.icon === "check" ? (s(), r("svg", yn, [...v[4] || (v[4] = [
|
|
1242
1239
|
l("path", {
|
|
1243
1240
|
"fill-rule": "evenodd",
|
|
1244
1241
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1245
1242
|
"clip-rule": "evenodd"
|
|
1246
1243
|
}, null, -1)
|
|
1247
|
-
])])) : t.icon === "alert" ? (s(), r("svg",
|
|
1244
|
+
])])) : t.icon === "alert" ? (s(), r("svg", gn, [...v[5] || (v[5] = [
|
|
1248
1245
|
l("path", {
|
|
1249
1246
|
"fill-rule": "evenodd",
|
|
1250
1247
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1251
1248
|
"clip-rule": "evenodd"
|
|
1252
1249
|
}, null, -1)
|
|
1253
|
-
])])) : (s(), r("svg",
|
|
1250
|
+
])])) : (s(), r("svg", mn, [...v[6] || (v[6] = [
|
|
1254
1251
|
l("circle", {
|
|
1255
1252
|
cx: "10",
|
|
1256
1253
|
cy: "10",
|
|
@@ -1258,21 +1255,21 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1258
1255
|
}, null, -1)
|
|
1259
1256
|
])]))
|
|
1260
1257
|
])) : W("", !0),
|
|
1261
|
-
l("span",
|
|
1262
|
-
|
|
1263
|
-
Se(
|
|
1258
|
+
l("span", wn, [
|
|
1259
|
+
ce(m.$slots, "default", {}, () => [
|
|
1260
|
+
Se(le(t.label), 1)
|
|
1264
1261
|
], !0)
|
|
1265
1262
|
])
|
|
1266
1263
|
])
|
|
1267
|
-
], 10,
|
|
1264
|
+
], 10, rn));
|
|
1268
1265
|
}
|
|
1269
|
-
}),
|
|
1266
|
+
}), kn = /* @__PURE__ */ xe(bn, [["__scopeId", "data-v-ce819797"]]), xn = ["aria-hidden"], $n = ["onKeydown"], Dn = {
|
|
1270
1267
|
key: 0,
|
|
1271
1268
|
class: "y-dialog-header"
|
|
1272
|
-
},
|
|
1269
|
+
}, Cn = { class: "y-dialog-title" }, _n = { class: "y-dialog-body" }, Sn = {
|
|
1273
1270
|
key: 1,
|
|
1274
1271
|
class: "y-dialog-footer"
|
|
1275
|
-
},
|
|
1272
|
+
}, Mn = /* @__PURE__ */ ke({
|
|
1276
1273
|
__name: "ydialog",
|
|
1277
1274
|
props: {
|
|
1278
1275
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1290,7 +1287,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1290
1287
|
const e = t, n = w, m = j({
|
|
1291
1288
|
get: () => e.modelValue,
|
|
1292
1289
|
set: (b) => n("update:modelValue", b)
|
|
1293
|
-
}),
|
|
1290
|
+
}), v = K(null), f = j(() => {
|
|
1294
1291
|
const b = {};
|
|
1295
1292
|
return b.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), b.margin = "0 auto", b.top = e.top, b;
|
|
1296
1293
|
});
|
|
@@ -1309,7 +1306,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1309
1306
|
return re(() => e.modelValue, (b) => {
|
|
1310
1307
|
b ? (n("open"), requestAnimationFrame(() => {
|
|
1311
1308
|
var c;
|
|
1312
|
-
return (c =
|
|
1309
|
+
return (c = v.value) == null ? void 0 : c.focus();
|
|
1313
1310
|
}), document.addEventListener("keydown", $), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", $), document.body.style.overflow = "");
|
|
1314
1311
|
}), Me(() => {
|
|
1315
1312
|
e.modelValue && (document.addEventListener("keydown", $), document.body.style.overflow = "hidden");
|
|
@@ -1321,7 +1318,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1321
1318
|
role: "dialog",
|
|
1322
1319
|
"aria-modal": !0,
|
|
1323
1320
|
"aria-hidden": !m.value,
|
|
1324
|
-
style:
|
|
1321
|
+
style: fe({ zIndex: String(t.zIndex) })
|
|
1325
1322
|
}, [
|
|
1326
1323
|
l("div", {
|
|
1327
1324
|
class: "y-dialog-mask",
|
|
@@ -1331,15 +1328,15 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1331
1328
|
default: ye(() => [
|
|
1332
1329
|
Le(l("div", {
|
|
1333
1330
|
ref_key: "panelRef",
|
|
1334
|
-
ref:
|
|
1331
|
+
ref: v,
|
|
1335
1332
|
class: B(["y-dialog-panel", [t.center ? "is-center" : ""]]),
|
|
1336
|
-
style:
|
|
1333
|
+
style: fe(f.value),
|
|
1337
1334
|
onKeydown: Ce(G(H, ["prevent", "stop"]), ["esc"]),
|
|
1338
1335
|
tabindex: "-1"
|
|
1339
1336
|
}, [
|
|
1340
|
-
t.showHeader ? (s(), r("div",
|
|
1341
|
-
|
|
1342
|
-
l("div",
|
|
1337
|
+
t.showHeader ? (s(), r("div", Dn, [
|
|
1338
|
+
ce(b.$slots, "header", {}, () => [
|
|
1339
|
+
l("div", Cn, le(t.title), 1)
|
|
1343
1340
|
], !0),
|
|
1344
1341
|
t.closable ? (s(), r("button", {
|
|
1345
1342
|
key: 0,
|
|
@@ -1349,24 +1346,24 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1349
1346
|
onClick: x
|
|
1350
1347
|
}, " ✕ ")) : W("", !0)
|
|
1351
1348
|
])) : W("", !0),
|
|
1352
|
-
l("div",
|
|
1353
|
-
|
|
1349
|
+
l("div", _n, [
|
|
1350
|
+
ce(b.$slots, "default", {}, void 0, !0)
|
|
1354
1351
|
]),
|
|
1355
|
-
b.$slots.footer ? (s(), r("div",
|
|
1356
|
-
|
|
1352
|
+
b.$slots.footer ? (s(), r("div", Sn, [
|
|
1353
|
+
ce(b.$slots, "footer", {}, void 0, !0)
|
|
1357
1354
|
])) : W("", !0)
|
|
1358
|
-
], 46,
|
|
1355
|
+
], 46, $n), [
|
|
1359
1356
|
[Be, m.value]
|
|
1360
1357
|
])
|
|
1361
1358
|
]),
|
|
1362
1359
|
_: 3
|
|
1363
1360
|
})
|
|
1364
|
-
], 12,
|
|
1361
|
+
], 12, xn), [
|
|
1365
1362
|
[Be, m.value]
|
|
1366
1363
|
])
|
|
1367
1364
|
]));
|
|
1368
1365
|
}
|
|
1369
|
-
}),
|
|
1366
|
+
}), Ln = /* @__PURE__ */ xe(Mn, [["__scopeId", "data-v-a7acc6dc"]]), In = { class: "ypopover__inner" }, En = /* @__PURE__ */ ke({
|
|
1370
1367
|
__name: "ypopover",
|
|
1371
1368
|
props: {
|
|
1372
1369
|
trigger: { default: "click" },
|
|
@@ -1386,7 +1383,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1386
1383
|
},
|
|
1387
1384
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1388
1385
|
setup(t, { expose: w, emit: e }) {
|
|
1389
|
-
const n = t, m = e,
|
|
1386
|
+
const n = t, m = e, v = K(), f = K(), S = K(), x = K(!1), H = K(), $ = K(), b = K({});
|
|
1390
1387
|
let c = null, D = null;
|
|
1391
1388
|
const A = j(() => {
|
|
1392
1389
|
if (!x.value || !H.value) return {};
|
|
@@ -1502,7 +1499,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1502
1499
|
b.value = p;
|
|
1503
1500
|
}
|
|
1504
1501
|
function E() {
|
|
1505
|
-
|
|
1502
|
+
f.value && (H.value = f.value.getBoundingClientRect(), S.value && ($.value = S.value.getBoundingClientRect(), he(), x.value && requestAnimationFrame(() => {
|
|
1506
1503
|
S.value && ($.value = S.value.getBoundingClientRect(), he());
|
|
1507
1504
|
})));
|
|
1508
1505
|
}
|
|
@@ -1524,7 +1521,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1524
1521
|
function ge(U) {
|
|
1525
1522
|
if (!n.closeOnClickOutside || !x.value) return;
|
|
1526
1523
|
const te = U.target;
|
|
1527
|
-
|
|
1524
|
+
v.value && !v.value.contains(te) && S.value && !S.value.contains(te) && J();
|
|
1528
1525
|
}
|
|
1529
1526
|
return re(() => n.modelValue, (U) => {
|
|
1530
1527
|
U !== x.value && (U ? V() : J());
|
|
@@ -1547,16 +1544,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1547
1544
|
}), (U, te) => (s(), r("div", {
|
|
1548
1545
|
class: "ypopover",
|
|
1549
1546
|
ref_key: "popoverRef",
|
|
1550
|
-
ref:
|
|
1547
|
+
ref: v
|
|
1551
1548
|
}, [
|
|
1552
1549
|
l("div", {
|
|
1553
1550
|
ref_key: "triggerRef",
|
|
1554
|
-
ref:
|
|
1551
|
+
ref: f,
|
|
1555
1552
|
onClick: F,
|
|
1556
1553
|
onMouseenter: T,
|
|
1557
1554
|
onMouseleave: N
|
|
1558
1555
|
}, [
|
|
1559
|
-
|
|
1556
|
+
ce(U.$slots, "reference", {}, void 0, !0)
|
|
1560
1557
|
], 544),
|
|
1561
1558
|
(s(), Te(Fe, { to: "body" }, [
|
|
1562
1559
|
ve(_e, { name: "ypopover-fade" }, {
|
|
@@ -1572,7 +1569,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1572
1569
|
"ypopover__content--no-padding": !t.showPadding
|
|
1573
1570
|
}
|
|
1574
1571
|
]]),
|
|
1575
|
-
style:
|
|
1572
|
+
style: fe(A.value),
|
|
1576
1573
|
onClick: te[0] || (te[0] = G(() => {
|
|
1577
1574
|
}, ["stop"])),
|
|
1578
1575
|
onMouseenter: se,
|
|
@@ -1581,10 +1578,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1581
1578
|
t.showArrow ? (s(), r("div", {
|
|
1582
1579
|
key: 0,
|
|
1583
1580
|
class: B(["ypopover__arrow", `ypopover__arrow--${t.placement}`]),
|
|
1584
|
-
style:
|
|
1581
|
+
style: fe(P.value)
|
|
1585
1582
|
}, null, 6)) : W("", !0),
|
|
1586
|
-
l("div",
|
|
1587
|
-
|
|
1583
|
+
l("div", In, [
|
|
1584
|
+
ce(U.$slots, "default", {}, void 0, !0)
|
|
1588
1585
|
])
|
|
1589
1586
|
], 38)) : W("", !0)
|
|
1590
1587
|
]),
|
|
@@ -1593,16 +1590,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1593
1590
|
]))
|
|
1594
1591
|
], 512));
|
|
1595
1592
|
}
|
|
1596
|
-
}),
|
|
1593
|
+
}), Bn = /* @__PURE__ */ xe(En, [["__scopeId", "data-v-be755399"]]), Tn = { class: "relative" }, Kn = ["value", "placeholder"], zn = { class: "nh-time-suffix" }, Hn = { class: "nh-time-shortcuts" }, Rn = { class: "nh-time-shortcuts-list" }, An = ["onClick", "onKeydown", "onMouseenter"], Wn = { class: "nh-time-custom" }, Vn = { class: "nh-time-custom-header" }, Fn = { class: "nh-time-selection-status" }, Pn = {
|
|
1597
1594
|
key: 0,
|
|
1598
1595
|
class: "status-text"
|
|
1599
|
-
},
|
|
1596
|
+
}, Nn = {
|
|
1600
1597
|
key: 1,
|
|
1601
1598
|
class: "status-text"
|
|
1602
|
-
},
|
|
1599
|
+
}, Yn = {
|
|
1603
1600
|
key: 2,
|
|
1604
1601
|
class: "status-text status-complete"
|
|
1605
|
-
},
|
|
1602
|
+
}, On = { class: "nh-time-pickers" }, jn = { class: "nh-time-picker" }, qn = { class: "nh-date-picker" }, Un = { class: "nh-date-picker-header" }, Zn = { class: "nh-date-picker-header-label" }, Qn = { class: "nh-date-picker-content" }, Jn = { class: "nh-date-table" }, Xn = ["onClick"], Gn = { class: "nh-date-table-cell" }, el = { key: 0 }, tl = { class: "nh-time-picker" }, nl = { class: "nh-date-picker" }, ll = { class: "nh-date-picker-header" }, ol = { class: "nh-date-picker-header-label" }, al = { class: "nh-date-picker-content" }, sl = { class: "nh-date-table" }, il = ["onClick"], rl = { class: "nh-date-table-cell" }, ul = { key: 0 }, dl = { class: "nh-time-actions" }, cl = /* @__PURE__ */ ke({
|
|
1606
1603
|
__name: "ytime",
|
|
1607
1604
|
props: {
|
|
1608
1605
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1653,7 +1650,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1653
1650
|
},
|
|
1654
1651
|
emits: ["update:modelValue", "change"],
|
|
1655
1652
|
setup(t, { emit: w }) {
|
|
1656
|
-
const e = t, n = w, m = K(!1),
|
|
1653
|
+
const e = t, n = w, m = K(!1), v = K(-1), f = K(-1), S = K(null), x = K(), H = K(), $ = K({
|
|
1657
1654
|
top: !0,
|
|
1658
1655
|
left: !0
|
|
1659
1656
|
}), b = K({
|
|
@@ -1688,8 +1685,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1688
1685
|
if (!i) return null;
|
|
1689
1686
|
const y = i.getFullYear(), I = String(i.getMonth() + 1).padStart(2, "0"), Z = String(i.getDate()).padStart(2, "0");
|
|
1690
1687
|
if (e.includeTime) {
|
|
1691
|
-
const ie = String(i.getHours()).padStart(2, "0"), ue = String(i.getMinutes()).padStart(2, "0"),
|
|
1692
|
-
return `${y}-${I}-${Z} ${ie}:${ue}:${
|
|
1688
|
+
const ie = String(i.getHours()).padStart(2, "0"), ue = String(i.getMinutes()).padStart(2, "0"), oe = String(i.getSeconds()).padStart(2, "0");
|
|
1689
|
+
return `${y}-${I}-${Z} ${ie}:${ue}:${oe}`;
|
|
1693
1690
|
} else
|
|
1694
1691
|
return `${y}-${I}-${Z}`;
|
|
1695
1692
|
}, ae = (i) => i ? i.getTime() : null, ee = (i) => i ? {
|
|
@@ -1716,7 +1713,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1716
1713
|
y.endDate.getFullYear(),
|
|
1717
1714
|
y.endDate.getMonth(),
|
|
1718
1715
|
y.endDate.getDate()
|
|
1719
|
-
),
|
|
1716
|
+
), oe = new Date(
|
|
1720
1717
|
Z.startDate.getFullYear(),
|
|
1721
1718
|
Z.startDate.getMonth(),
|
|
1722
1719
|
Z.startDate.getDate()
|
|
@@ -1725,16 +1722,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1725
1722
|
Z.endDate.getMonth(),
|
|
1726
1723
|
Z.endDate.getDate()
|
|
1727
1724
|
);
|
|
1728
|
-
if (ie.getTime() ===
|
|
1725
|
+
if (ie.getTime() === oe.getTime() && ue.getTime() === we.getTime())
|
|
1729
1726
|
return I;
|
|
1730
1727
|
}
|
|
1731
1728
|
}
|
|
1732
1729
|
return -1;
|
|
1733
1730
|
}, se = (i, y) => {
|
|
1734
|
-
const I = new Date(i, y, 1), Z = new Date(i, y + 1, 0), ie = I.getDay(), ue = Z.getDate(),
|
|
1731
|
+
const I = new Date(i, y, 1), Z = new Date(i, y + 1, 0), ie = I.getDay(), ue = Z.getDate(), oe = [], we = /* @__PURE__ */ new Date(), u = ie === 0 ? 6 : ie - 1, g = new Date(i, y, 0);
|
|
1735
1732
|
for (let C = u - 1; C >= 0; C--) {
|
|
1736
1733
|
const R = new Date(i, y - 1, g.getDate() - C);
|
|
1737
|
-
|
|
1734
|
+
oe.push({
|
|
1738
1735
|
date: R,
|
|
1739
1736
|
day: R.getDate(),
|
|
1740
1737
|
isCurrentMonth: !1,
|
|
@@ -1747,7 +1744,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1747
1744
|
}
|
|
1748
1745
|
for (let C = 1; C <= ue; C++) {
|
|
1749
1746
|
const R = new Date(i, y, C);
|
|
1750
|
-
|
|
1747
|
+
oe.push({
|
|
1751
1748
|
date: R,
|
|
1752
1749
|
day: C,
|
|
1753
1750
|
isCurrentMonth: !0,
|
|
@@ -1757,10 +1754,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1757
1754
|
isDisabled: !1
|
|
1758
1755
|
});
|
|
1759
1756
|
}
|
|
1760
|
-
const _ = 42 -
|
|
1757
|
+
const _ = 42 - oe.length;
|
|
1761
1758
|
for (let C = 1; C <= _; C++) {
|
|
1762
1759
|
const R = new Date(i, y + 1, C);
|
|
1763
|
-
|
|
1760
|
+
oe.push({
|
|
1764
1761
|
date: R,
|
|
1765
1762
|
day: C,
|
|
1766
1763
|
isCurrentMonth: !1,
|
|
@@ -1772,22 +1769,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1772
1769
|
});
|
|
1773
1770
|
}
|
|
1774
1771
|
const L = [];
|
|
1775
|
-
for (let C = 0; C <
|
|
1776
|
-
L.push(
|
|
1772
|
+
for (let C = 0; C < oe.length; C += 7)
|
|
1773
|
+
L.push(oe.slice(C, C + 7));
|
|
1777
1774
|
return L;
|
|
1778
1775
|
}, q = (i) => {
|
|
1779
1776
|
const y = he(i);
|
|
1780
1777
|
n("update:modelValue", y), n("change", y);
|
|
1781
1778
|
}, ge = () => {
|
|
1782
1779
|
if (!x.value || !H.value) return;
|
|
1783
|
-
const i = x.value.getBoundingClientRect(), y = H.value.getBoundingClientRect(), I = window.innerWidth, ie = window.innerHeight - i.bottom, ue = i.top,
|
|
1784
|
-
ie <
|
|
1780
|
+
const i = x.value.getBoundingClientRect(), y = H.value.getBoundingClientRect(), I = window.innerWidth, ie = window.innerHeight - i.bottom, ue = i.top, oe = y.height || 400;
|
|
1781
|
+
ie < oe && ue > oe ? $.value.top = !1 : $.value.top = !0;
|
|
1785
1782
|
const we = I - i.left, u = y.width || 640;
|
|
1786
1783
|
we < u ? $.value.left = !1 : $.value.left = !0;
|
|
1787
1784
|
}, U = () => {
|
|
1788
1785
|
if (m.value = !m.value, m.value) {
|
|
1789
1786
|
const i = ee(e.modelValue);
|
|
1790
|
-
if (O.value = (i == null ? void 0 : i.startDate) || null, V.value = (i == null ? void 0 : i.endDate) || null,
|
|
1787
|
+
if (O.value = (i == null ? void 0 : i.startDate) || null, V.value = (i == null ? void 0 : i.endDate) || null, f.value = N(e.modelValue), v.value = -1, i != null && i.startDate && (b.value.year = i.startDate.getFullYear(), b.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
1791
1788
|
c.value.year = i.endDate.getFullYear(), c.value.month = i.endDate.getMonth();
|
|
1792
1789
|
else {
|
|
1793
1790
|
const y = new Date(b.value.year, b.value.month + 1);
|
|
@@ -1799,22 +1796,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1799
1796
|
}
|
|
1800
1797
|
}, te = (i) => {
|
|
1801
1798
|
const y = i.target, I = x.value, Z = H.value;
|
|
1802
|
-
I && Z && !I.contains(y) && !Z.contains(y) && (m.value = !1,
|
|
1799
|
+
I && Z && !I.contains(y) && !Z.contains(y) && (m.value = !1, v.value = -1);
|
|
1803
1800
|
}, p = (i) => {
|
|
1804
1801
|
i.key === "Enter" || i.key === " " ? (i.preventDefault(), U()) : i.key === "ArrowDown" && (i.preventDefault(), m.value = !0, de(() => {
|
|
1805
1802
|
ge(), k();
|
|
1806
1803
|
}));
|
|
1807
1804
|
}, h = (i) => {
|
|
1808
1805
|
var y;
|
|
1809
|
-
i.key === "Escape" && (m.value = !1,
|
|
1806
|
+
i.key === "Escape" && (m.value = !1, v.value = -1, (y = x.value) == null || y.focus());
|
|
1810
1807
|
}, o = (i, y) => {
|
|
1811
|
-
i.key === "ArrowDown" ? (i.preventDefault(),
|
|
1808
|
+
i.key === "ArrowDown" ? (i.preventDefault(), v.value = Math.min(y + 1, e.shortcuts.length - 1), M(v.value)) : i.key === "ArrowUp" ? (i.preventDefault(), v.value = Math.max(y - 1, 0), M(v.value)) : (i.key === "Enter" || i.key === " ") && (i.preventDefault(), z(e.shortcuts[y]));
|
|
1812
1809
|
}, a = (i) => {
|
|
1813
|
-
|
|
1810
|
+
v.value = i;
|
|
1814
1811
|
}, d = () => {
|
|
1815
|
-
|
|
1812
|
+
v.value = -1;
|
|
1816
1813
|
}, k = () => {
|
|
1817
|
-
|
|
1814
|
+
v.value = 0, M(0);
|
|
1818
1815
|
}, M = (i) => {
|
|
1819
1816
|
if (H.value) {
|
|
1820
1817
|
const I = H.value.querySelectorAll(".nh-time-shortcut")[i];
|
|
@@ -1822,7 +1819,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1822
1819
|
}
|
|
1823
1820
|
}, z = (i) => {
|
|
1824
1821
|
const y = i.getValue();
|
|
1825
|
-
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y),
|
|
1822
|
+
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y), f.value = e.shortcuts.findIndex((I) => I.label === i.label), v.value = -1, m.value = !1;
|
|
1826
1823
|
}, Y = (i, y) => {
|
|
1827
1824
|
if (!i || i.isDisabled) return;
|
|
1828
1825
|
let I;
|
|
@@ -1837,7 +1834,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1837
1834
|
}
|
|
1838
1835
|
else
|
|
1839
1836
|
O.value = I, V.value = null;
|
|
1840
|
-
if (
|
|
1837
|
+
if (f.value = -1, O.value && V.value) {
|
|
1841
1838
|
const Z = new Date(V.value);
|
|
1842
1839
|
e.includeTime && Z.setHours(23, 59, 59, 999), S.value = {
|
|
1843
1840
|
startDate: O.value,
|
|
@@ -1850,9 +1847,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1850
1847
|
const I = ["nh-date-table-td"];
|
|
1851
1848
|
return i.isCurrentMonth || I.push("is-prev-month"), i.isToday && I.push("is-today"), i.isDisabled && I.push("is-disabled"), O.value && F(i.date, O.value) && I.push("is-selected", "is-start"), V.value && F(i.date, V.value) && I.push("is-selected", "is-end"), O.value && V.value && T(i.date, O.value, V.value) && I.push("is-in-range"), I;
|
|
1852
1849
|
}, $e = () => {
|
|
1853
|
-
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value),
|
|
1850
|
+
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value), f.value = N(S.value), m.value = !1);
|
|
1854
1851
|
}, Ke = () => {
|
|
1855
|
-
q({ startDate: null, endDate: null }), Ie(),
|
|
1852
|
+
q({ startDate: null, endDate: null }), Ie(), v.value = -1, m.value = !1;
|
|
1856
1853
|
}, We = () => {
|
|
1857
1854
|
m.value && de(() => {
|
|
1858
1855
|
ge();
|
|
@@ -1862,8 +1859,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1862
1859
|
if (!i || !i.startDate || !i.endDate)
|
|
1863
1860
|
return "";
|
|
1864
1861
|
const y = (ie) => {
|
|
1865
|
-
const ue = String(ie.getFullYear()),
|
|
1866
|
-
return `${ue}/${
|
|
1862
|
+
const ue = String(ie.getFullYear()), oe = String(ie.getMonth() + 1).padStart(2, "0"), we = String(ie.getDate()).padStart(2, "0");
|
|
1863
|
+
return `${ue}/${oe}/${we}`;
|
|
1867
1864
|
}, I = y(i.startDate), Z = y(i.endDate);
|
|
1868
1865
|
return !e.includeTime && I === Z ? I : `${I} - ${Z}`;
|
|
1869
1866
|
}), Je = j(() => [
|
|
@@ -1876,7 +1873,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1876
1873
|
const i = ee(e.modelValue);
|
|
1877
1874
|
return !!(i != null && i.startDate && (i != null && i.endDate));
|
|
1878
1875
|
}), Re = j(() => !!(O.value && V.value)), Ie = () => {
|
|
1879
|
-
O.value = null, V.value = null, S.value = null,
|
|
1876
|
+
O.value = null, V.value = null, S.value = null, f.value = -1;
|
|
1880
1877
|
};
|
|
1881
1878
|
re(() => e.modelValue, (i) => {
|
|
1882
1879
|
const y = ee(i);
|
|
@@ -1891,7 +1888,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1891
1888
|
const I = new Date(b.value.year, b.value.month + 1);
|
|
1892
1889
|
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1893
1890
|
}
|
|
1894
|
-
(y != null && y.startDate || y != null && y.endDate) && D(), m.value || (
|
|
1891
|
+
(y != null && y.startDate || y != null && y.endDate) && D(), m.value || (f.value = N(i));
|
|
1895
1892
|
}, { immediate: !0, deep: !0 }), re([b, c], () => {
|
|
1896
1893
|
const i = new Date(b.value.year, b.value.month).getTime(), y = new Date(c.value.year, c.value.month).getTime();
|
|
1897
1894
|
if (i === y) {
|
|
@@ -1899,7 +1896,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1899
1896
|
c.value.year = I.getFullYear(), c.value.month = I.getMonth();
|
|
1900
1897
|
}
|
|
1901
1898
|
}, { deep: !0 }), Me(() => {
|
|
1902
|
-
document.addEventListener("click", te), window.addEventListener("resize", We), window.addEventListener("scroll", We),
|
|
1899
|
+
document.addEventListener("click", te), window.addEventListener("resize", We), window.addEventListener("scroll", We), f.value = N(e.modelValue);
|
|
1903
1900
|
const i = ee(e.modelValue);
|
|
1904
1901
|
if (i != null && i.startDate && (b.value.year = i.startDate.getFullYear(), b.value.month = i.startDate.getMonth()), i != null && i.endDate)
|
|
1905
1902
|
c.value.year = i.endDate.getFullYear(), c.value.month = i.endDate.getMonth();
|
|
@@ -1912,7 +1909,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1912
1909
|
document.removeEventListener("click", te), window.removeEventListener("resize", We), window.removeEventListener("scroll", We);
|
|
1913
1910
|
});
|
|
1914
1911
|
const ze = () => {
|
|
1915
|
-
e.clearable && (q({ startDate: null, endDate: null }), Ie(),
|
|
1912
|
+
e.clearable && (q({ startDate: null, endDate: null }), Ie(), v.value = -1);
|
|
1916
1913
|
}, Ae = (i, y) => {
|
|
1917
1914
|
if (i === "start") {
|
|
1918
1915
|
const I = new Date(b.value.year, b.value.month + y, 1);
|
|
@@ -1927,7 +1924,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1927
1924
|
return s(), r("div", {
|
|
1928
1925
|
class: B(["nh-time-search", [`nh-time--${t.size}`]])
|
|
1929
1926
|
}, [
|
|
1930
|
-
l("div",
|
|
1927
|
+
l("div", Tn, [
|
|
1931
1928
|
l("div", {
|
|
1932
1929
|
ref_key: "trigger",
|
|
1933
1930
|
ref: x,
|
|
@@ -1941,8 +1938,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1941
1938
|
value: Qe.value,
|
|
1942
1939
|
placeholder: t.placeholder,
|
|
1943
1940
|
class: "nh-time-input"
|
|
1944
|
-
}, null, 8,
|
|
1945
|
-
l("span",
|
|
1941
|
+
}, null, 8, Kn),
|
|
1942
|
+
l("span", zn, [
|
|
1946
1943
|
t.clearable && Ne.value ? (s(), r("i", {
|
|
1947
1944
|
key: 0,
|
|
1948
1945
|
onClick: G(ze, ["stop"]),
|
|
@@ -1996,9 +1993,9 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
1996
1993
|
class: B(Je.value),
|
|
1997
1994
|
onKeydown: h
|
|
1998
1995
|
}, [
|
|
1999
|
-
l("div",
|
|
1996
|
+
l("div", Hn, [
|
|
2000
1997
|
y[7] || (y[7] = l("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
2001
|
-
l("ul",
|
|
1998
|
+
l("ul", Rn, [
|
|
2002
1999
|
(s(!0), r(pe, null, me(t.shortcuts, (Z, ie) => (s(), r("li", {
|
|
2003
2000
|
key: Z.label,
|
|
2004
2001
|
onClick: (ue) => z(Z),
|
|
@@ -2008,25 +2005,25 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2008
2005
|
class: B([
|
|
2009
2006
|
"nh-time-shortcut",
|
|
2010
2007
|
{
|
|
2011
|
-
"is-active":
|
|
2012
|
-
"is-selected":
|
|
2008
|
+
"is-active": v.value === ie,
|
|
2009
|
+
"is-selected": f.value === ie
|
|
2013
2010
|
}
|
|
2014
2011
|
]),
|
|
2015
2012
|
tabindex: "0"
|
|
2016
|
-
},
|
|
2013
|
+
}, le(Z.label), 43, An))), 128))
|
|
2017
2014
|
])
|
|
2018
2015
|
]),
|
|
2019
|
-
l("div",
|
|
2020
|
-
l("div",
|
|
2016
|
+
l("div", Wn, [
|
|
2017
|
+
l("div", Vn, [
|
|
2021
2018
|
y[8] || (y[8] = l("span", null, "自定义时间", -1)),
|
|
2022
|
-
l("div",
|
|
2023
|
-
!O.value && !V.value ? (s(), r("span",
|
|
2019
|
+
l("div", Fn, [
|
|
2020
|
+
!O.value && !V.value ? (s(), r("span", Pn, " 请选择开始日期 ")) : O.value && !V.value ? (s(), r("span", Nn, " 请选择结束日期 ")) : O.value && V.value ? (s(), r("span", Yn, " 已选择完整范围 ")) : W("", !0)
|
|
2024
2021
|
])
|
|
2025
2022
|
]),
|
|
2026
|
-
l("div",
|
|
2027
|
-
l("div",
|
|
2028
|
-
l("div",
|
|
2029
|
-
l("div",
|
|
2023
|
+
l("div", On, [
|
|
2024
|
+
l("div", jn, [
|
|
2025
|
+
l("div", qn, [
|
|
2026
|
+
l("div", Un, [
|
|
2030
2027
|
l("button", {
|
|
2031
2028
|
onClick: y[0] || (y[0] = (Z) => Ae("start", -1)),
|
|
2032
2029
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
@@ -2043,7 +2040,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2043
2040
|
})
|
|
2044
2041
|
], -1)
|
|
2045
2042
|
])]),
|
|
2046
|
-
l("span",
|
|
2043
|
+
l("span", Zn, le(E(b.value.year, b.value.month)), 1),
|
|
2047
2044
|
l("button", {
|
|
2048
2045
|
onClick: y[1] || (y[1] = (Z) => Ae("start", 1)),
|
|
2049
2046
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2061,38 +2058,38 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2061
2058
|
], -1)
|
|
2062
2059
|
])])
|
|
2063
2060
|
]),
|
|
2064
|
-
l("div",
|
|
2065
|
-
l("table",
|
|
2061
|
+
l("div", Qn, [
|
|
2062
|
+
l("table", Jn, [
|
|
2066
2063
|
l("thead", null, [
|
|
2067
2064
|
l("tr", null, [
|
|
2068
2065
|
(s(), r(pe, null, me(P, (Z) => l("th", {
|
|
2069
2066
|
key: Z,
|
|
2070
2067
|
class: "nh-date-table-th"
|
|
2071
|
-
},
|
|
2068
|
+
}, le(Z), 1)), 64))
|
|
2072
2069
|
])
|
|
2073
2070
|
]),
|
|
2074
2071
|
l("tbody", null, [
|
|
2075
2072
|
(s(!0), r(pe, null, me(Pe.value, (Z, ie) => (s(), r("tr", {
|
|
2076
2073
|
key: `start-week-${ie}`
|
|
2077
2074
|
}, [
|
|
2078
|
-
(s(!0), r(pe, null, me(Z, (ue,
|
|
2079
|
-
key: `start-day-${ie}-${
|
|
2075
|
+
(s(!0), r(pe, null, me(Z, (ue, oe) => (s(), r("td", {
|
|
2076
|
+
key: `start-day-${ie}-${oe}`,
|
|
2080
2077
|
class: B(ne(ue)),
|
|
2081
2078
|
onClick: (we) => Y(ue, "start")
|
|
2082
2079
|
}, [
|
|
2083
|
-
l("div",
|
|
2084
|
-
ue ? (s(), r("span",
|
|
2080
|
+
l("div", Gn, [
|
|
2081
|
+
ue ? (s(), r("span", el, le(ue.day), 1)) : W("", !0)
|
|
2085
2082
|
])
|
|
2086
|
-
], 10,
|
|
2083
|
+
], 10, Xn))), 128))
|
|
2087
2084
|
]))), 128))
|
|
2088
2085
|
])
|
|
2089
2086
|
])
|
|
2090
2087
|
])
|
|
2091
2088
|
])
|
|
2092
2089
|
]),
|
|
2093
|
-
l("div",
|
|
2094
|
-
l("div",
|
|
2095
|
-
l("div",
|
|
2090
|
+
l("div", tl, [
|
|
2091
|
+
l("div", nl, [
|
|
2092
|
+
l("div", ll, [
|
|
2096
2093
|
l("button", {
|
|
2097
2094
|
onClick: y[2] || (y[2] = (Z) => Ae("end", -1)),
|
|
2098
2095
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
@@ -2109,7 +2106,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2109
2106
|
})
|
|
2110
2107
|
], -1)
|
|
2111
2108
|
])]),
|
|
2112
|
-
l("span",
|
|
2109
|
+
l("span", ol, le(E(c.value.year, c.value.month)), 1),
|
|
2113
2110
|
l("button", {
|
|
2114
2111
|
onClick: y[3] || (y[3] = (Z) => Ae("end", 1)),
|
|
2115
2112
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2127,29 +2124,29 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2127
2124
|
], -1)
|
|
2128
2125
|
])])
|
|
2129
2126
|
]),
|
|
2130
|
-
l("div",
|
|
2131
|
-
l("table",
|
|
2127
|
+
l("div", al, [
|
|
2128
|
+
l("table", sl, [
|
|
2132
2129
|
l("thead", null, [
|
|
2133
2130
|
l("tr", null, [
|
|
2134
2131
|
(s(), r(pe, null, me(P, (Z) => l("th", {
|
|
2135
2132
|
key: Z,
|
|
2136
2133
|
class: "nh-date-table-th"
|
|
2137
|
-
},
|
|
2134
|
+
}, le(Z), 1)), 64))
|
|
2138
2135
|
])
|
|
2139
2136
|
]),
|
|
2140
2137
|
l("tbody", null, [
|
|
2141
2138
|
(s(!0), r(pe, null, me(Ze.value, (Z, ie) => (s(), r("tr", {
|
|
2142
2139
|
key: `end-week-${ie}`
|
|
2143
2140
|
}, [
|
|
2144
|
-
(s(!0), r(pe, null, me(Z, (ue,
|
|
2145
|
-
key: `end-day-${ie}-${
|
|
2141
|
+
(s(!0), r(pe, null, me(Z, (ue, oe) => (s(), r("td", {
|
|
2142
|
+
key: `end-day-${ie}-${oe}`,
|
|
2146
2143
|
class: B(ne(ue)),
|
|
2147
2144
|
onClick: (we) => Y(ue, "end")
|
|
2148
2145
|
}, [
|
|
2149
|
-
l("div",
|
|
2150
|
-
ue ? (s(), r("span",
|
|
2146
|
+
l("div", rl, [
|
|
2147
|
+
ue ? (s(), r("span", ul, le(ue.day), 1)) : W("", !0)
|
|
2151
2148
|
])
|
|
2152
|
-
], 10,
|
|
2149
|
+
], 10, il))), 128))
|
|
2153
2150
|
]))), 128))
|
|
2154
2151
|
])
|
|
2155
2152
|
])
|
|
@@ -2157,7 +2154,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2157
2154
|
])
|
|
2158
2155
|
])
|
|
2159
2156
|
]),
|
|
2160
|
-
l("div",
|
|
2157
|
+
l("div", dl, [
|
|
2161
2158
|
t.clearable ? (s(), Te(I, {
|
|
2162
2159
|
key: 0,
|
|
2163
2160
|
onClick: Ke,
|
|
@@ -2176,7 +2173,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2176
2173
|
size: t.size
|
|
2177
2174
|
}, {
|
|
2178
2175
|
default: ye(() => [
|
|
2179
|
-
Se(
|
|
2176
|
+
Se(le(O.value && !V.value ? "继续选择结束日期" : "确认"), 1)
|
|
2180
2177
|
]),
|
|
2181
2178
|
_: 1
|
|
2182
2179
|
}, 8, ["disabled", "size"])
|
|
@@ -2190,11 +2187,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2190
2187
|
], 2);
|
|
2191
2188
|
};
|
|
2192
2189
|
}
|
|
2193
|
-
}), it = /* @__PURE__ */ xe(
|
|
2190
|
+
}), it = /* @__PURE__ */ xe(cl, [["__scopeId", "data-v-e5ef63b1"]]), fl = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], vl = { class: "yswitch__thumb" }, hl = {
|
|
2194
2191
|
key: 0,
|
|
2195
2192
|
class: "yswitch__spinner",
|
|
2196
2193
|
"aria-hidden": "true"
|
|
2197
|
-
},
|
|
2194
|
+
}, pl = /* @__PURE__ */ ke({
|
|
2198
2195
|
__name: "yswitch",
|
|
2199
2196
|
props: {
|
|
2200
2197
|
modelValue: { default: !1 },
|
|
@@ -2211,13 +2208,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2211
2208
|
},
|
|
2212
2209
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2213
2210
|
setup(t, { emit: w }) {
|
|
2214
|
-
const e = t, n = w, m = K(),
|
|
2211
|
+
const e = t, n = w, m = K(), v = j(() => e.modelValue === e.trueValue), f = j(() => {
|
|
2215
2212
|
const x = {};
|
|
2216
|
-
return x.background =
|
|
2213
|
+
return x.background = v.value ? e.activeColor : e.inactiveColor, x;
|
|
2217
2214
|
});
|
|
2218
2215
|
function S() {
|
|
2219
2216
|
if (e.disabled || e.loading) return;
|
|
2220
|
-
const x =
|
|
2217
|
+
const x = v.value ? e.falseValue : e.trueValue;
|
|
2221
2218
|
n("update:modelValue", x), n("change", x);
|
|
2222
2219
|
}
|
|
2223
2220
|
return Me(() => {
|
|
@@ -2228,11 +2225,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2228
2225
|
ref: m,
|
|
2229
2226
|
class: B(["yswitch", [
|
|
2230
2227
|
`yswitch--${t.size}`,
|
|
2231
|
-
{ "yswitch--checked":
|
|
2228
|
+
{ "yswitch--checked": v.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
2232
2229
|
]]),
|
|
2233
|
-
style:
|
|
2230
|
+
style: fe(f.value),
|
|
2234
2231
|
role: "switch",
|
|
2235
|
-
"aria-checked":
|
|
2232
|
+
"aria-checked": v.value,
|
|
2236
2233
|
"aria-disabled": t.disabled,
|
|
2237
2234
|
disabled: t.disabled || t.loading,
|
|
2238
2235
|
onClick: S,
|
|
@@ -2242,16 +2239,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2242
2239
|
]
|
|
2243
2240
|
}, [
|
|
2244
2241
|
H[0] || (H[0] = l("span", { class: "yswitch__track" }, null, -1)),
|
|
2245
|
-
l("span",
|
|
2246
|
-
t.loading ? (s(), r("span",
|
|
2242
|
+
l("span", vl, [
|
|
2243
|
+
t.loading ? (s(), r("span", hl)) : W("", !0)
|
|
2247
2244
|
]),
|
|
2248
2245
|
t.showText ? (s(), r("span", {
|
|
2249
2246
|
key: 0,
|
|
2250
|
-
class: B(["yswitch__label", { "yswitch__label--left": !
|
|
2251
|
-
},
|
|
2252
|
-
], 46,
|
|
2247
|
+
class: B(["yswitch__label", { "yswitch__label--left": !v.value, "yswitch__label--right": v.value }])
|
|
2248
|
+
}, le(v.value ? t.activeText : t.inactiveText), 3)) : W("", !0)
|
|
2249
|
+
], 46, fl));
|
|
2253
2250
|
}
|
|
2254
|
-
}),
|
|
2251
|
+
}), yl = /* @__PURE__ */ xe(pl, [["__scopeId", "data-v-0b157fc4"]]), gl = ["src", "alt"], ml = ["src", "alt"], wl = /* @__PURE__ */ ke({
|
|
2255
2252
|
__name: "yimage",
|
|
2256
2253
|
props: {
|
|
2257
2254
|
src: {},
|
|
@@ -2267,7 +2264,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2267
2264
|
},
|
|
2268
2265
|
emits: ["load", "error", "preview"],
|
|
2269
2266
|
setup(t, { expose: w, emit: e }) {
|
|
2270
|
-
const n = t, m = e,
|
|
2267
|
+
const n = t, m = e, v = K(), f = K(), S = K(), x = K(!1), H = K(!1), $ = K(!1), b = K(!1), c = K(!1), D = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), A = K(""), P = K(1), O = K(!1), V = K({
|
|
2271
2268
|
overflow: "",
|
|
2272
2269
|
paddingRight: ""
|
|
2273
2270
|
}), Q = {
|
|
@@ -2318,7 +2315,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2318
2315
|
};
|
|
2319
2316
|
let q = null;
|
|
2320
2317
|
const ge = () => {
|
|
2321
|
-
!n.lazy || !
|
|
2318
|
+
!n.lazy || !v.value || (q = new IntersectionObserver(
|
|
2322
2319
|
(z) => {
|
|
2323
2320
|
z.forEach((Y) => {
|
|
2324
2321
|
Y.isIntersecting && (b.value = !0, D.value = n.src, q == null || q.unobserve(Y.target));
|
|
@@ -2327,14 +2324,14 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2327
2324
|
{
|
|
2328
2325
|
rootMargin: "50px"
|
|
2329
2326
|
}
|
|
2330
|
-
), q.observe(
|
|
2327
|
+
), q.observe(v.value));
|
|
2331
2328
|
}, U = (z) => {
|
|
2332
2329
|
x.value = !0, H.value = !1, $.value = !1, m("load", z);
|
|
2333
2330
|
}, te = (z) => {
|
|
2334
2331
|
$.value = !0, H.value = !1, x.value = !1, m("error", z);
|
|
2335
2332
|
}, p = () => {
|
|
2336
2333
|
$.value = !1, H.value = !0, x.value = !1, de(() => {
|
|
2337
|
-
|
|
2334
|
+
f.value && (f.value.src = n.src);
|
|
2338
2335
|
});
|
|
2339
2336
|
}, h = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, o = () => {
|
|
2340
2337
|
n.preview && (n.previewSrcList || n.src) ? a() : p();
|
|
@@ -2342,7 +2339,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2342
2339
|
if (!n.preview) return;
|
|
2343
2340
|
P.value = 1;
|
|
2344
2341
|
const z = h();
|
|
2345
|
-
if (
|
|
2342
|
+
if (f.value && f.value.complete && f.value.naturalWidth > 0) {
|
|
2346
2343
|
A.value = z, de(() => {
|
|
2347
2344
|
c.value = !0, N(), m("preview", z);
|
|
2348
2345
|
});
|
|
@@ -2384,13 +2381,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2384
2381
|
closePreview: d
|
|
2385
2382
|
}), (z, Y) => (s(), r("div", {
|
|
2386
2383
|
ref_key: "containerRef",
|
|
2387
|
-
ref:
|
|
2384
|
+
ref: v,
|
|
2388
2385
|
class: B(["yimage-container", J.value])
|
|
2389
2386
|
}, [
|
|
2390
2387
|
!x.value && !$.value && !b.value ? (s(), r("div", {
|
|
2391
2388
|
key: 0,
|
|
2392
2389
|
class: "yimage-placeholder",
|
|
2393
|
-
style:
|
|
2390
|
+
style: fe(ee.value)
|
|
2394
2391
|
}, [...Y[1] || (Y[1] = [
|
|
2395
2392
|
l("div", { class: "yimage-placeholder-content" }, [
|
|
2396
2393
|
l("svg", {
|
|
@@ -2411,7 +2408,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2411
2408
|
H.value && !$.value ? (s(), r("div", {
|
|
2412
2409
|
key: 1,
|
|
2413
2410
|
class: "yimage-loading",
|
|
2414
|
-
style:
|
|
2411
|
+
style: fe(ee.value)
|
|
2415
2412
|
}, [...Y[2] || (Y[2] = [
|
|
2416
2413
|
l("div", { class: "yimage-loading-content" }, [
|
|
2417
2414
|
l("div", { class: "yimage-spinner" })
|
|
@@ -2420,27 +2417,27 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2420
2417
|
$.value ? (s(), r("div", {
|
|
2421
2418
|
key: 2,
|
|
2422
2419
|
class: "yimage-error",
|
|
2423
|
-
style:
|
|
2420
|
+
style: fe(ee.value),
|
|
2424
2421
|
onClick: o
|
|
2425
2422
|
}, [
|
|
2426
2423
|
l("img", {
|
|
2427
2424
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2428
2425
|
alt: "Error Image",
|
|
2429
2426
|
class: "yimage-error-image",
|
|
2430
|
-
style:
|
|
2427
|
+
style: fe(ee.value)
|
|
2431
2428
|
}, null, 4)
|
|
2432
2429
|
], 4)) : W("", !0),
|
|
2433
2430
|
Le(l("img", {
|
|
2434
2431
|
ref_key: "imageRef",
|
|
2435
|
-
ref:
|
|
2432
|
+
ref: f,
|
|
2436
2433
|
src: D.value,
|
|
2437
2434
|
alt: t.alt,
|
|
2438
2435
|
class: B(he.value),
|
|
2439
2436
|
onLoad: U,
|
|
2440
2437
|
onError: te,
|
|
2441
2438
|
onClick: G(a, ["stop"]),
|
|
2442
|
-
style:
|
|
2443
|
-
}, null, 46,
|
|
2439
|
+
style: fe(E.value)
|
|
2440
|
+
}, null, 46, gl), [
|
|
2444
2441
|
[Be, x.value && !$.value]
|
|
2445
2442
|
]),
|
|
2446
2443
|
n.preview && (!x.value || H.value || $.value || !b.value) ? (s(), r("div", {
|
|
@@ -2469,10 +2466,10 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2469
2466
|
src: F.value,
|
|
2470
2467
|
alt: t.alt,
|
|
2471
2468
|
class: "yimage-preview-image",
|
|
2472
|
-
style:
|
|
2469
|
+
style: fe({ transform: `scale(${P.value})` }),
|
|
2473
2470
|
onClick: Y[0] || (Y[0] = G(() => {
|
|
2474
2471
|
}, ["stop"]))
|
|
2475
|
-
}, null, 12,
|
|
2472
|
+
}, null, 12, ml)
|
|
2476
2473
|
], 2)
|
|
2477
2474
|
], 32)) : W("", !0)
|
|
2478
2475
|
]),
|
|
@@ -2481,7 +2478,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2481
2478
|
])) : W("", !0)
|
|
2482
2479
|
], 2));
|
|
2483
2480
|
}
|
|
2484
|
-
}),
|
|
2481
|
+
}), bl = /* @__PURE__ */ xe(wl, [["__scopeId", "data-v-00c771d6"]]), kl = /* @__PURE__ */ ke({
|
|
2485
2482
|
__name: "ydropdown",
|
|
2486
2483
|
props: {
|
|
2487
2484
|
trigger: { default: "hover" },
|
|
@@ -2492,7 +2489,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2492
2489
|
setup(t) {
|
|
2493
2490
|
const w = t, e = K(!1), n = K();
|
|
2494
2491
|
let m = null;
|
|
2495
|
-
const
|
|
2492
|
+
const v = j(() => `y-dropdown__menu--${w.placement}`), f = j(() => {
|
|
2496
2493
|
if (!w.menuWidth) return {};
|
|
2497
2494
|
const c = typeof w.menuWidth == "number" ? `${w.menuWidth}px` : w.menuWidth;
|
|
2498
2495
|
return {
|
|
@@ -2565,7 +2562,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2565
2562
|
onMouseenter: S,
|
|
2566
2563
|
onMouseleave: x
|
|
2567
2564
|
}, [
|
|
2568
|
-
|
|
2565
|
+
ce(c.$slots, "trigger", {}, () => [
|
|
2569
2566
|
D[0] || (D[0] = l("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2570
2567
|
], !0)
|
|
2571
2568
|
], 32),
|
|
@@ -2575,12 +2572,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2575
2572
|
}, {
|
|
2576
2573
|
default: ye(() => [
|
|
2577
2574
|
Le(l("div", {
|
|
2578
|
-
class: B(["y-dropdown__menu",
|
|
2579
|
-
style:
|
|
2575
|
+
class: B(["y-dropdown__menu", v.value]),
|
|
2576
|
+
style: fe(f.value),
|
|
2580
2577
|
onMouseenter: S,
|
|
2581
2578
|
onMouseleave: x
|
|
2582
2579
|
}, [
|
|
2583
|
-
|
|
2580
|
+
ce(c.$slots, "default", {}, () => [
|
|
2584
2581
|
D[1] || (D[1] = l("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2585
2582
|
D[2] || (D[2] = l("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2586
2583
|
D[3] || (D[3] = l("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
@@ -2593,13 +2590,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2593
2590
|
})
|
|
2594
2591
|
], 512));
|
|
2595
2592
|
}
|
|
2596
|
-
}),
|
|
2593
|
+
}), xl = /* @__PURE__ */ xe(kl, [["__scopeId", "data-v-ada3172a"]]), $l = ["aria-hidden"], Dl = ["onKeydown"], Cl = {
|
|
2597
2594
|
key: 0,
|
|
2598
2595
|
class: "y-drawer-header"
|
|
2599
|
-
},
|
|
2596
|
+
}, _l = { class: "y-drawer-title" }, Sl = { class: "y-drawer-body" }, Ml = {
|
|
2600
2597
|
key: 1,
|
|
2601
2598
|
class: "y-drawer-footer"
|
|
2602
|
-
},
|
|
2599
|
+
}, Ll = /* @__PURE__ */ ke({
|
|
2603
2600
|
__name: "ydrawer",
|
|
2604
2601
|
props: {
|
|
2605
2602
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2617,7 +2614,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2617
2614
|
const e = t, n = w, m = j({
|
|
2618
2615
|
get: () => e.modelValue,
|
|
2619
2616
|
set: (D) => n("update:modelValue", D)
|
|
2620
|
-
}),
|
|
2617
|
+
}), v = K(null), f = j(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), S = j(() => e.placement === "right" ? "rounded-left" : "rounded-top"), x = j(() => {
|
|
2621
2618
|
const D = {};
|
|
2622
2619
|
return e.placement === "right" ? (D.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), D.height = "100%", D.right = "0", D.top = "0") : (D.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), D.width = "100%", D.bottom = "0", D.left = "0"), D;
|
|
2623
2620
|
});
|
|
@@ -2636,7 +2633,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2636
2633
|
return re(() => e.modelValue, (D) => {
|
|
2637
2634
|
D ? (n("open"), requestAnimationFrame(() => {
|
|
2638
2635
|
var A;
|
|
2639
|
-
return (A =
|
|
2636
|
+
return (A = v.value) == null ? void 0 : A.focus();
|
|
2640
2637
|
}), document.addEventListener("keydown", c), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", c), document.body.style.overflow = "");
|
|
2641
2638
|
}), Me(() => {
|
|
2642
2639
|
e.modelValue && (document.addEventListener("keydown", c), document.body.style.overflow = "hidden");
|
|
@@ -2648,27 +2645,27 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2648
2645
|
role: "dialog",
|
|
2649
2646
|
"aria-modal": !0,
|
|
2650
2647
|
"aria-hidden": !m.value,
|
|
2651
|
-
style:
|
|
2648
|
+
style: fe({ zIndex: String(t.zIndex) })
|
|
2652
2649
|
}, [
|
|
2653
2650
|
l("div", {
|
|
2654
2651
|
class: "y-drawer-mask",
|
|
2655
2652
|
onClick: H
|
|
2656
2653
|
}),
|
|
2657
|
-
ve(_e, { name:
|
|
2654
|
+
ve(_e, { name: f.value }, {
|
|
2658
2655
|
default: ye(() => [
|
|
2659
2656
|
Le(l("div", {
|
|
2660
2657
|
ref_key: "panelRef",
|
|
2661
|
-
ref:
|
|
2658
|
+
ref: v,
|
|
2662
2659
|
class: B(["y-drawer-panel", [
|
|
2663
2660
|
`is-${t.placement}`,
|
|
2664
2661
|
S.value
|
|
2665
2662
|
]]),
|
|
2666
|
-
style:
|
|
2663
|
+
style: fe(x.value),
|
|
2667
2664
|
onKeydown: Ce(G(b, ["prevent", "stop"]), ["esc"]),
|
|
2668
2665
|
tabindex: "-1"
|
|
2669
2666
|
}, [
|
|
2670
|
-
t.showHeader ? (s(), r("div",
|
|
2671
|
-
l("div",
|
|
2667
|
+
t.showHeader ? (s(), r("div", Cl, [
|
|
2668
|
+
l("div", _l, le(t.title), 1),
|
|
2672
2669
|
t.closable ? (s(), r("button", {
|
|
2673
2670
|
key: 0,
|
|
2674
2671
|
type: "button",
|
|
@@ -2677,111 +2674,111 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2677
2674
|
onClick: $
|
|
2678
2675
|
}, " ✕ ")) : W("", !0)
|
|
2679
2676
|
])) : W("", !0),
|
|
2680
|
-
l("div",
|
|
2681
|
-
|
|
2677
|
+
l("div", Sl, [
|
|
2678
|
+
ce(D.$slots, "default", {}, void 0, !0)
|
|
2682
2679
|
]),
|
|
2683
|
-
D.$slots.footer ? (s(), r("div",
|
|
2684
|
-
|
|
2680
|
+
D.$slots.footer ? (s(), r("div", Ml, [
|
|
2681
|
+
ce(D.$slots, "footer", {}, void 0, !0)
|
|
2685
2682
|
])) : W("", !0)
|
|
2686
|
-
], 46,
|
|
2683
|
+
], 46, Dl), [
|
|
2687
2684
|
[Be, m.value]
|
|
2688
2685
|
])
|
|
2689
2686
|
]),
|
|
2690
2687
|
_: 3
|
|
2691
2688
|
}, 8, ["name"])
|
|
2692
|
-
], 12,
|
|
2689
|
+
], 12, $l), [
|
|
2693
2690
|
[Be, m.value]
|
|
2694
2691
|
])
|
|
2695
2692
|
]));
|
|
2696
2693
|
}
|
|
2697
|
-
}),
|
|
2694
|
+
}), Il = /* @__PURE__ */ xe(Ll, [["__scopeId", "data-v-b2797950"]]), El = { class: "ytree__container" }, Bl = ["data-level", "onClick", "onContextmenu"], Tl = ["onClick"], Kl = {
|
|
2698
2695
|
key: 1,
|
|
2699
2696
|
class: "w-[16px]"
|
|
2700
|
-
},
|
|
2697
|
+
}, zl = ["onClick"], Hl = {
|
|
2701
2698
|
key: 0,
|
|
2702
2699
|
width: "12",
|
|
2703
2700
|
height: "12",
|
|
2704
2701
|
viewBox: "0 0 12 12",
|
|
2705
2702
|
fill: "none"
|
|
2706
|
-
},
|
|
2703
|
+
}, Rl = {
|
|
2707
2704
|
key: 1,
|
|
2708
2705
|
width: "12",
|
|
2709
2706
|
height: "12",
|
|
2710
2707
|
viewBox: "0 0 12 12",
|
|
2711
2708
|
fill: "none"
|
|
2712
|
-
},
|
|
2709
|
+
}, Al = ["src", "alt"], Wl = { class: "ytree-node__custom-content" }, Vl = {
|
|
2713
2710
|
key: 0,
|
|
2714
2711
|
class: "ytree-node__children"
|
|
2715
|
-
},
|
|
2712
|
+
}, Fl = ["data-level", "onClick", "onContextmenu"], Pl = ["onClick"], Nl = {
|
|
2716
2713
|
key: 1,
|
|
2717
2714
|
class: "w-[16px]"
|
|
2718
|
-
},
|
|
2715
|
+
}, Yl = ["onClick"], Ol = {
|
|
2719
2716
|
key: 0,
|
|
2720
2717
|
width: "12",
|
|
2721
2718
|
height: "12",
|
|
2722
2719
|
viewBox: "0 0 12 12",
|
|
2723
2720
|
fill: "none"
|
|
2724
|
-
},
|
|
2721
|
+
}, jl = {
|
|
2725
2722
|
key: 1,
|
|
2726
2723
|
width: "12",
|
|
2727
2724
|
height: "12",
|
|
2728
2725
|
viewBox: "0 0 12 12",
|
|
2729
2726
|
fill: "none"
|
|
2730
|
-
},
|
|
2727
|
+
}, ql = ["src", "alt"], Ul = { class: "ytree-node__custom-content" }, Zl = {
|
|
2731
2728
|
key: 0,
|
|
2732
2729
|
class: "ytree-node__children"
|
|
2733
|
-
},
|
|
2730
|
+
}, Ql = ["data-level", "onClick", "onContextmenu"], Jl = ["onClick"], Xl = {
|
|
2734
2731
|
key: 1,
|
|
2735
2732
|
class: "w-[16px]"
|
|
2736
|
-
},
|
|
2733
|
+
}, Gl = ["onClick"], eo = {
|
|
2737
2734
|
key: 0,
|
|
2738
2735
|
width: "12",
|
|
2739
2736
|
height: "12",
|
|
2740
2737
|
viewBox: "0 0 12 12",
|
|
2741
2738
|
fill: "none"
|
|
2742
|
-
},
|
|
2739
|
+
}, to = {
|
|
2743
2740
|
key: 1,
|
|
2744
2741
|
width: "12",
|
|
2745
2742
|
height: "12",
|
|
2746
2743
|
viewBox: "0 0 12 12",
|
|
2747
2744
|
fill: "none"
|
|
2748
|
-
},
|
|
2745
|
+
}, no = ["src", "alt"], lo = { class: "ytree-node__custom-content" }, oo = {
|
|
2749
2746
|
key: 0,
|
|
2750
2747
|
class: "ytree-node__children"
|
|
2751
|
-
},
|
|
2748
|
+
}, ao = ["data-level", "onClick", "onContextmenu"], so = ["onClick"], io = {
|
|
2752
2749
|
key: 1,
|
|
2753
2750
|
class: "w-[16px]"
|
|
2754
|
-
},
|
|
2751
|
+
}, ro = ["onClick"], uo = {
|
|
2755
2752
|
key: 0,
|
|
2756
2753
|
width: "12",
|
|
2757
2754
|
height: "12",
|
|
2758
2755
|
viewBox: "0 0 12 12",
|
|
2759
2756
|
fill: "none"
|
|
2760
|
-
},
|
|
2757
|
+
}, co = {
|
|
2761
2758
|
key: 1,
|
|
2762
2759
|
width: "12",
|
|
2763
2760
|
height: "12",
|
|
2764
2761
|
viewBox: "0 0 12 12",
|
|
2765
2762
|
fill: "none"
|
|
2766
|
-
},
|
|
2763
|
+
}, fo = ["src", "alt"], vo = { class: "ytree-node__custom-content" }, ho = {
|
|
2767
2764
|
key: 0,
|
|
2768
2765
|
class: "ytree-node__children"
|
|
2769
|
-
},
|
|
2766
|
+
}, po = ["data-level", "onClick", "onContextmenu"], yo = ["onClick"], go = {
|
|
2770
2767
|
key: 1,
|
|
2771
2768
|
class: "w-[16px]"
|
|
2772
|
-
},
|
|
2769
|
+
}, mo = ["onClick"], wo = {
|
|
2773
2770
|
key: 0,
|
|
2774
2771
|
width: "12",
|
|
2775
2772
|
height: "12",
|
|
2776
2773
|
viewBox: "0 0 12 12",
|
|
2777
2774
|
fill: "none"
|
|
2778
|
-
},
|
|
2775
|
+
}, bo = {
|
|
2779
2776
|
key: 1,
|
|
2780
2777
|
width: "12",
|
|
2781
2778
|
height: "12",
|
|
2782
2779
|
viewBox: "0 0 12 12",
|
|
2783
2780
|
fill: "none"
|
|
2784
|
-
},
|
|
2781
|
+
}, ko = ["src", "alt"], xo = { class: "ytree-node__custom-content" }, $o = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", Do = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", Co = /* @__PURE__ */ ke({
|
|
2785
2782
|
__name: "ytree",
|
|
2786
2783
|
props: {
|
|
2787
2784
|
data: { default: () => [] },
|
|
@@ -2830,7 +2827,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2830
2827
|
},
|
|
2831
2828
|
emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop", "checked-keys-change", "child-node-click"],
|
|
2832
2829
|
setup(t, { expose: w, emit: e }) {
|
|
2833
|
-
const n = t, m = e,
|
|
2830
|
+
const n = t, m = e, v = j(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), f = K({
|
|
2834
2831
|
currentNode: null,
|
|
2835
2832
|
currentKey: null,
|
|
2836
2833
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2838,7 +2835,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2838
2835
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2839
2836
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2840
2837
|
});
|
|
2841
|
-
dt("treeStore",
|
|
2838
|
+
dt("treeStore", f);
|
|
2842
2839
|
const S = j(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2843
2840
|
function x(p) {
|
|
2844
2841
|
return p[n.nodeKey] || p.id || Math.random();
|
|
@@ -2853,7 +2850,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2853
2850
|
}
|
|
2854
2851
|
function b(p, h) {
|
|
2855
2852
|
var M;
|
|
2856
|
-
const o = n.deptIconUrl ||
|
|
2853
|
+
const o = n.deptIconUrl || $o, a = n.personIconUrl || Do, d = n.buttonIconUrl || "", k = n.childStyleIconUrl || "";
|
|
2857
2854
|
return h && k && P(p, h) ? k : (M = p == null ? void 0 : p.data) != null && M.isButton && d ? d : $(p) ? a : o;
|
|
2858
2855
|
}
|
|
2859
2856
|
function c(p) {
|
|
@@ -2881,11 +2878,11 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2881
2878
|
}
|
|
2882
2879
|
function O(p) {
|
|
2883
2880
|
const h = x(p);
|
|
2884
|
-
return
|
|
2881
|
+
return f.value.expandedKeys.has(h);
|
|
2885
2882
|
}
|
|
2886
2883
|
function V(p) {
|
|
2887
2884
|
const h = x(p);
|
|
2888
|
-
if (
|
|
2885
|
+
if (f.value.checkedKeys.has(h)) {
|
|
2889
2886
|
if (c(p)) {
|
|
2890
2887
|
const a = D(p), d = a.filter((M) => V(M)), k = a.filter(
|
|
2891
2888
|
(M) => Q(M)
|
|
@@ -2911,23 +2908,23 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2911
2908
|
}
|
|
2912
2909
|
function J(p) {
|
|
2913
2910
|
const h = x(p);
|
|
2914
|
-
return
|
|
2911
|
+
return f.value.currentKey === h;
|
|
2915
2912
|
}
|
|
2916
2913
|
function ae(p) {
|
|
2917
2914
|
const h = x(p);
|
|
2918
|
-
return
|
|
2915
|
+
return f.value.highlightedKeys.has(h);
|
|
2919
2916
|
}
|
|
2920
2917
|
function ee(p) {
|
|
2921
2918
|
if (n.disabled) return;
|
|
2922
|
-
const h = x(p), a = !
|
|
2923
|
-
a ?
|
|
2919
|
+
const h = x(p), a = !f.value.checkedKeys.has(h), d = new Set(f.value.expandedKeys);
|
|
2920
|
+
a ? f.value.checkedKeys.add(h) : f.value.checkedKeys.delete(h);
|
|
2924
2921
|
function k(M, z) {
|
|
2925
2922
|
M.forEach((Y) => {
|
|
2926
2923
|
const ne = x(Y);
|
|
2927
|
-
z ?
|
|
2924
|
+
z ? f.value.checkedKeys.add(ne) : f.value.checkedKeys.delete(ne), c(Y) && k(D(Y), z);
|
|
2928
2925
|
});
|
|
2929
2926
|
}
|
|
2930
|
-
k(D(p), a), a && he(), F(),
|
|
2927
|
+
k(D(p), a), a && he(), F(), f.value.expandedKeys = d, m("check-change", p, a, !1), m("check", p, a, !1), m("checked-keys-change", Array.from(f.value.checkedKeys));
|
|
2931
2928
|
}
|
|
2932
2929
|
function he(p) {
|
|
2933
2930
|
S.value && console.log(
|
|
@@ -2936,7 +2933,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2936
2933
|
}
|
|
2937
2934
|
function E(p) {
|
|
2938
2935
|
const h = x(p);
|
|
2939
|
-
|
|
2936
|
+
f.value.expandedKeys.has(h) ? (f.value.expandedKeys.delete(h), m("node-collapse", p, p, null)) : (f.value.expandedKeys.add(h), m("node-expand", p, p, null));
|
|
2940
2937
|
}
|
|
2941
2938
|
function F() {
|
|
2942
2939
|
const p = [];
|
|
@@ -2945,13 +2942,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2945
2942
|
p.push(d), c(d) && h(D(d));
|
|
2946
2943
|
});
|
|
2947
2944
|
}
|
|
2948
|
-
h(
|
|
2945
|
+
h(v.value);
|
|
2949
2946
|
function o(a) {
|
|
2950
2947
|
if (c(a)) {
|
|
2951
2948
|
const d = D(a), k = x(a), M = d.filter((Y) => V(Y)), z = d.filter(
|
|
2952
2949
|
(Y) => Q(Y)
|
|
2953
2950
|
);
|
|
2954
|
-
M.length === d.length && z.length === 0 || M.length > 0 || z.length > 0 ?
|
|
2951
|
+
M.length === d.length && z.length === 0 || M.length > 0 || z.length > 0 ? f.value.checkedKeys.add(k) : f.value.checkedKeys.delete(k);
|
|
2955
2952
|
}
|
|
2956
2953
|
}
|
|
2957
2954
|
for (let a = p.length - 1; a >= 0; a--)
|
|
@@ -2968,7 +2965,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2968
2965
|
E(p);
|
|
2969
2966
|
return;
|
|
2970
2967
|
}
|
|
2971
|
-
|
|
2968
|
+
f.value.currentNode = p, f.value.currentKey = x(p), n.showCheckbox && ee(p), m("node-click", p, h, o);
|
|
2972
2969
|
}
|
|
2973
2970
|
function N(p, h, o, a) {
|
|
2974
2971
|
n.disabled || m("node-contextmenu", p, h, o, a);
|
|
@@ -2994,14 +2991,14 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
2994
2991
|
});
|
|
2995
2992
|
};
|
|
2996
2993
|
const d = (p || []).filter((M) => {
|
|
2997
|
-
const z = o(M,
|
|
2994
|
+
const z = o(M, v.value, 1);
|
|
2998
2995
|
return z > 0 && z < h;
|
|
2999
2996
|
}), k = new Set(d);
|
|
3000
|
-
a(
|
|
3001
|
-
o(M,
|
|
3002
|
-
}),
|
|
2997
|
+
a(v.value, 1, h), f.value.expandedKeys.forEach((M) => {
|
|
2998
|
+
o(M, v.value, 1) >= h && k.add(M);
|
|
2999
|
+
}), f.value.expandedKeys = k;
|
|
3003
3000
|
} else
|
|
3004
|
-
|
|
3001
|
+
f.value.expandedKeys = new Set(p);
|
|
3005
3002
|
}
|
|
3006
3003
|
},
|
|
3007
3004
|
{ immediate: !0 }
|
|
@@ -3020,7 +3017,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3020
3017
|
});
|
|
3021
3018
|
};
|
|
3022
3019
|
const h = /* @__PURE__ */ new Set(), o = S.value;
|
|
3023
|
-
p(
|
|
3020
|
+
p(v.value, 1), f.value.expandedKeys = h;
|
|
3024
3021
|
}
|
|
3025
3022
|
}
|
|
3026
3023
|
function q() {
|
|
@@ -3032,7 +3029,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3032
3029
|
});
|
|
3033
3030
|
};
|
|
3034
3031
|
const h = new Set(n.defaultCheckedKeys), o = /* @__PURE__ */ new Set();
|
|
3035
|
-
p(
|
|
3032
|
+
p(v.value);
|
|
3036
3033
|
const a = S.value;
|
|
3037
3034
|
if (a) {
|
|
3038
3035
|
console.log(
|
|
@@ -3040,13 +3037,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3040
3037
|
);
|
|
3041
3038
|
return;
|
|
3042
3039
|
}
|
|
3043
|
-
|
|
3040
|
+
f.value.expandedKeys = o;
|
|
3044
3041
|
}
|
|
3045
3042
|
}
|
|
3046
|
-
re(() => n.defaultExpandAll, se, { immediate: !0 }), re(() =>
|
|
3043
|
+
re(() => n.defaultExpandAll, se, { immediate: !0 }), re(() => v.value, se, { deep: !0 }), re(
|
|
3047
3044
|
() => n.defaultCheckedKeys,
|
|
3048
3045
|
(p) => {
|
|
3049
|
-
p ? (
|
|
3046
|
+
p ? (f.value.checkedKeys = new Set(p), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : q()) : f.value.checkedKeys.clear();
|
|
3050
3047
|
},
|
|
3051
3048
|
{ immediate: !0 }
|
|
3052
3049
|
);
|
|
@@ -3065,33 +3062,33 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3065
3062
|
};
|
|
3066
3063
|
const o = Array.isArray(p) ? p : [];
|
|
3067
3064
|
if (o.length === 0) return;
|
|
3068
|
-
|
|
3069
|
-
const a = new Set(
|
|
3065
|
+
f.value.highlightedKeys.clear();
|
|
3066
|
+
const a = new Set(f.value.expandedKeys);
|
|
3070
3067
|
o.forEach((d) => {
|
|
3071
|
-
const k = h(
|
|
3072
|
-
k && k.length > 0 && (k.slice(0, -1).forEach((M) => a.add(M)),
|
|
3073
|
-
}),
|
|
3068
|
+
const k = h(v.value, d);
|
|
3069
|
+
k && k.length > 0 && (k.slice(0, -1).forEach((M) => a.add(M)), f.value.highlightedKeys.add(k[k.length - 1]));
|
|
3070
|
+
}), f.value.expandedKeys = a;
|
|
3074
3071
|
} catch (h) {
|
|
3075
3072
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
3076
3073
|
}
|
|
3077
3074
|
}
|
|
3078
3075
|
function U() {
|
|
3079
|
-
|
|
3076
|
+
f.value.highlightedKeys.clear();
|
|
3080
3077
|
}
|
|
3081
3078
|
function te() {
|
|
3082
|
-
|
|
3079
|
+
f.value.currentNode = null, f.value.currentKey = null;
|
|
3083
3080
|
}
|
|
3084
3081
|
return w({ highlightAndExpandByIds: ge, clearHighlights: U, clearCurrentNode: te }), re(
|
|
3085
3082
|
() => n.defaultSelectedKeys,
|
|
3086
3083
|
(p) => {
|
|
3087
|
-
p && (
|
|
3084
|
+
p && (f.value.selectedKeys = new Set(p));
|
|
3088
3085
|
},
|
|
3089
3086
|
{ immediate: !0 }
|
|
3090
3087
|
), (p, h) => (s(), r("div", {
|
|
3091
3088
|
class: B(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
3092
3089
|
}, [
|
|
3093
|
-
l("div",
|
|
3094
|
-
(s(!0), r(pe, null, me(
|
|
3090
|
+
l("div", El, [
|
|
3091
|
+
(s(!0), r(pe, null, me(v.value, (o) => (s(), r("div", {
|
|
3095
3092
|
key: x(o),
|
|
3096
3093
|
class: B(["ytree-node", { "ytree-node--current": J(o), "ytree-node--highlight": ae(o) }])
|
|
3097
3094
|
}, [
|
|
@@ -3121,7 +3118,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3121
3118
|
"stroke-linejoin": "round"
|
|
3122
3119
|
})
|
|
3123
3120
|
], -1)
|
|
3124
|
-
])], 10,
|
|
3121
|
+
])], 10, Tl)) : (s(), r("span", Kl)),
|
|
3125
3122
|
t.showCheckbox ? (s(), r("span", {
|
|
3126
3123
|
key: 2,
|
|
3127
3124
|
class: B(["ytree-node__checkbox", {
|
|
@@ -3130,7 +3127,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3130
3127
|
}]),
|
|
3131
3128
|
onClick: G((a) => ee(o), ["stop"])
|
|
3132
3129
|
}, [
|
|
3133
|
-
V(o) ? (s(), r("svg",
|
|
3130
|
+
V(o) ? (s(), r("svg", Hl, [...h[1] || (h[1] = [
|
|
3134
3131
|
l("path", {
|
|
3135
3132
|
d: "M2 6L4.5 8.5L10 3",
|
|
3136
3133
|
stroke: "currentColor",
|
|
@@ -3138,7 +3135,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3138
3135
|
"stroke-linecap": "round",
|
|
3139
3136
|
"stroke-linejoin": "round"
|
|
3140
3137
|
}, null, -1)
|
|
3141
|
-
])])) : Q(o) ? (s(), r("svg",
|
|
3138
|
+
])])) : Q(o) ? (s(), r("svg", Rl, [...h[2] || (h[2] = [
|
|
3142
3139
|
l("path", {
|
|
3143
3140
|
d: "M2 6L10 6",
|
|
3144
3141
|
stroke: "currentColor",
|
|
@@ -3146,7 +3143,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3146
3143
|
"stroke-linecap": "round"
|
|
3147
3144
|
}, null, -1)
|
|
3148
3145
|
])])) : W("", !0)
|
|
3149
|
-
], 10,
|
|
3146
|
+
], 10, zl)) : W("", !0),
|
|
3150
3147
|
t.iconClass ? (s(), r("span", {
|
|
3151
3148
|
key: 3,
|
|
3152
3149
|
class: B(["ytree-node__icon", t.iconClass])
|
|
@@ -3155,22 +3152,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3155
3152
|
class: "ytree-node__avatar",
|
|
3156
3153
|
src: b(o, o),
|
|
3157
3154
|
alt: $(o) ? "person" : "dept"
|
|
3158
|
-
}, null, 8,
|
|
3155
|
+
}, null, 8, Al),
|
|
3159
3156
|
l("span", {
|
|
3160
3157
|
class: B(["ytree-node__label", { "is-employee": $(o) }])
|
|
3161
|
-
},
|
|
3162
|
-
l("div",
|
|
3163
|
-
|
|
3158
|
+
}, le(H(o)), 3),
|
|
3159
|
+
l("div", Wl, [
|
|
3160
|
+
ce(p.$slots, "node-content", {
|
|
3164
3161
|
node: o,
|
|
3165
3162
|
isCurrent: J(o),
|
|
3166
3163
|
isExpanded: O(o),
|
|
3167
3164
|
hasChildren: c(o)
|
|
3168
3165
|
}, void 0, !0)
|
|
3169
3166
|
])
|
|
3170
|
-
], 42,
|
|
3167
|
+
], 42, Bl),
|
|
3171
3168
|
ve(_e, { name: "ytree-node" }, {
|
|
3172
3169
|
default: ye(() => [
|
|
3173
|
-
c(o) && O(o) ? (s(), r("div",
|
|
3170
|
+
c(o) && O(o) ? (s(), r("div", Vl, [
|
|
3174
3171
|
(s(!0), r(pe, null, me(D(o), (a) => (s(), r("div", {
|
|
3175
3172
|
key: x(a),
|
|
3176
3173
|
class: B(["ytree-node", { "ytree-node--current": J(a), "ytree-node--highlight": ae(a) }])
|
|
@@ -3201,7 +3198,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3201
3198
|
"stroke-linejoin": "round"
|
|
3202
3199
|
})
|
|
3203
3200
|
], -1)
|
|
3204
|
-
])], 10,
|
|
3201
|
+
])], 10, Pl)) : (s(), r("span", Nl)),
|
|
3205
3202
|
t.showCheckbox ? (s(), r("span", {
|
|
3206
3203
|
key: 2,
|
|
3207
3204
|
class: B(["ytree-node__checkbox", {
|
|
@@ -3210,7 +3207,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3210
3207
|
}]),
|
|
3211
3208
|
onClick: G((d) => ee(a), ["stop"])
|
|
3212
3209
|
}, [
|
|
3213
|
-
V(a) ? (s(), r("svg",
|
|
3210
|
+
V(a) ? (s(), r("svg", Ol, [...h[4] || (h[4] = [
|
|
3214
3211
|
l("path", {
|
|
3215
3212
|
d: "M2 6L4.5 8.5L10 3",
|
|
3216
3213
|
stroke: "currentColor",
|
|
@@ -3218,7 +3215,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3218
3215
|
"stroke-linecap": "round",
|
|
3219
3216
|
"stroke-linejoin": "round"
|
|
3220
3217
|
}, null, -1)
|
|
3221
|
-
])])) : Q(a) ? (s(), r("svg",
|
|
3218
|
+
])])) : Q(a) ? (s(), r("svg", jl, [...h[5] || (h[5] = [
|
|
3222
3219
|
l("path", {
|
|
3223
3220
|
d: "M2 6L10 6",
|
|
3224
3221
|
stroke: "currentColor",
|
|
@@ -3226,7 +3223,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3226
3223
|
"stroke-linecap": "round"
|
|
3227
3224
|
}, null, -1)
|
|
3228
3225
|
])])) : W("", !0)
|
|
3229
|
-
], 10,
|
|
3226
|
+
], 10, Yl)) : W("", !0),
|
|
3230
3227
|
t.iconClass ? (s(), r("span", {
|
|
3231
3228
|
key: 3,
|
|
3232
3229
|
class: B(["ytree-node__icon", t.iconClass])
|
|
@@ -3235,22 +3232,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3235
3232
|
class: "ytree-node__avatar",
|
|
3236
3233
|
src: b(a, o),
|
|
3237
3234
|
alt: $(a) ? "person" : "dept"
|
|
3238
|
-
}, null, 8,
|
|
3235
|
+
}, null, 8, ql),
|
|
3239
3236
|
l("span", {
|
|
3240
3237
|
class: B(["ytree-node__label", { "is-employee": $(a) }])
|
|
3241
|
-
},
|
|
3242
|
-
l("div",
|
|
3243
|
-
|
|
3238
|
+
}, le(H(a)), 3),
|
|
3239
|
+
l("div", Ul, [
|
|
3240
|
+
ce(p.$slots, "node-content", {
|
|
3244
3241
|
node: a,
|
|
3245
3242
|
isCurrent: J(a),
|
|
3246
3243
|
isExpanded: O(a),
|
|
3247
3244
|
hasChildren: c(a)
|
|
3248
3245
|
}, void 0, !0)
|
|
3249
3246
|
])
|
|
3250
|
-
], 42,
|
|
3247
|
+
], 42, Fl),
|
|
3251
3248
|
ve(_e, { name: "ytree-node" }, {
|
|
3252
3249
|
default: ye(() => [
|
|
3253
|
-
c(a) && O(a) ? (s(), r("div",
|
|
3250
|
+
c(a) && O(a) ? (s(), r("div", Zl, [
|
|
3254
3251
|
(s(!0), r(pe, null, me(D(a), (d) => (s(), r("div", {
|
|
3255
3252
|
key: x(d),
|
|
3256
3253
|
class: B(["ytree-node", {
|
|
@@ -3289,7 +3286,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3289
3286
|
"stroke-linejoin": "round"
|
|
3290
3287
|
})
|
|
3291
3288
|
], -1)
|
|
3292
|
-
])], 10,
|
|
3289
|
+
])], 10, Jl)) : (s(), r("span", Xl)),
|
|
3293
3290
|
t.showCheckbox ? (s(), r("span", {
|
|
3294
3291
|
key: 2,
|
|
3295
3292
|
class: B(["ytree-node__checkbox", {
|
|
@@ -3298,7 +3295,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3298
3295
|
}]),
|
|
3299
3296
|
onClick: G((k) => ee(d), ["stop"])
|
|
3300
3297
|
}, [
|
|
3301
|
-
V(d) ? (s(), r("svg",
|
|
3298
|
+
V(d) ? (s(), r("svg", eo, [...h[7] || (h[7] = [
|
|
3302
3299
|
l("path", {
|
|
3303
3300
|
d: "M2 6L4.5 8.5L10 3",
|
|
3304
3301
|
stroke: "currentColor",
|
|
@@ -3306,7 +3303,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3306
3303
|
"stroke-linecap": "round",
|
|
3307
3304
|
"stroke-linejoin": "round"
|
|
3308
3305
|
}, null, -1)
|
|
3309
|
-
])])) : Q(d) ? (s(), r("svg",
|
|
3306
|
+
])])) : Q(d) ? (s(), r("svg", to, [...h[8] || (h[8] = [
|
|
3310
3307
|
l("path", {
|
|
3311
3308
|
d: "M2 6L10 6",
|
|
3312
3309
|
stroke: "currentColor",
|
|
@@ -3314,7 +3311,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3314
3311
|
"stroke-linecap": "round"
|
|
3315
3312
|
}, null, -1)
|
|
3316
3313
|
])])) : W("", !0)
|
|
3317
|
-
], 10,
|
|
3314
|
+
], 10, Gl)) : W("", !0),
|
|
3318
3315
|
t.iconClass ? (s(), r("span", {
|
|
3319
3316
|
key: 3,
|
|
3320
3317
|
class: B(["ytree-node__icon", t.iconClass])
|
|
@@ -3323,22 +3320,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3323
3320
|
class: "ytree-node__avatar",
|
|
3324
3321
|
src: b(d, o),
|
|
3325
3322
|
alt: $(d) ? "person" : "dept"
|
|
3326
|
-
}, null, 8,
|
|
3323
|
+
}, null, 8, no),
|
|
3327
3324
|
l("span", {
|
|
3328
3325
|
class: B(["ytree-node__label", { "is-employee": $(d) }])
|
|
3329
|
-
},
|
|
3330
|
-
l("div",
|
|
3331
|
-
|
|
3326
|
+
}, le(H(d)), 3),
|
|
3327
|
+
l("div", lo, [
|
|
3328
|
+
ce(p.$slots, "node-content", {
|
|
3332
3329
|
node: d,
|
|
3333
3330
|
isCurrent: J(d),
|
|
3334
3331
|
isExpanded: O(d),
|
|
3335
3332
|
hasChildren: c(d)
|
|
3336
3333
|
}, void 0, !0)
|
|
3337
3334
|
])
|
|
3338
|
-
], 42,
|
|
3335
|
+
], 42, Ql),
|
|
3339
3336
|
ve(_e, { name: "ytree-node" }, {
|
|
3340
3337
|
default: ye(() => [
|
|
3341
|
-
c(d) && O(d) ? (s(), r("div",
|
|
3338
|
+
c(d) && O(d) ? (s(), r("div", oo, [
|
|
3342
3339
|
(s(!0), r(pe, null, me(D(d), (k) => (s(), r("div", {
|
|
3343
3340
|
key: x(k),
|
|
3344
3341
|
class: B(["ytree-node", {
|
|
@@ -3386,7 +3383,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3386
3383
|
"stroke-linejoin": "round"
|
|
3387
3384
|
})
|
|
3388
3385
|
], -1)
|
|
3389
|
-
])], 10,
|
|
3386
|
+
])], 10, so)) : (s(), r("span", io)),
|
|
3390
3387
|
t.showCheckbox ? (s(), r("span", {
|
|
3391
3388
|
key: 2,
|
|
3392
3389
|
class: B(["ytree-node__checkbox", {
|
|
@@ -3395,7 +3392,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3395
3392
|
}]),
|
|
3396
3393
|
onClick: G((M) => ee(k), ["stop"])
|
|
3397
3394
|
}, [
|
|
3398
|
-
V(k) ? (s(), r("svg",
|
|
3395
|
+
V(k) ? (s(), r("svg", uo, [...h[10] || (h[10] = [
|
|
3399
3396
|
l("path", {
|
|
3400
3397
|
d: "M2 6L4.5 8.5L10 3",
|
|
3401
3398
|
stroke: "currentColor",
|
|
@@ -3403,7 +3400,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3403
3400
|
"stroke-linecap": "round",
|
|
3404
3401
|
"stroke-linejoin": "round"
|
|
3405
3402
|
}, null, -1)
|
|
3406
|
-
])])) : Q(k) ? (s(), r("svg",
|
|
3403
|
+
])])) : Q(k) ? (s(), r("svg", co, [...h[11] || (h[11] = [
|
|
3407
3404
|
l("path", {
|
|
3408
3405
|
d: "M2 6L10 6",
|
|
3409
3406
|
stroke: "currentColor",
|
|
@@ -3411,7 +3408,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3411
3408
|
"stroke-linecap": "round"
|
|
3412
3409
|
}, null, -1)
|
|
3413
3410
|
])])) : W("", !0)
|
|
3414
|
-
], 10,
|
|
3411
|
+
], 10, ro)) : W("", !0),
|
|
3415
3412
|
t.iconClass ? (s(), r("span", {
|
|
3416
3413
|
key: 3,
|
|
3417
3414
|
class: B(["ytree-node__icon", t.iconClass])
|
|
@@ -3420,24 +3417,24 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3420
3417
|
class: "ytree-node__avatar",
|
|
3421
3418
|
src: b(k, o),
|
|
3422
3419
|
alt: $(k) ? "person" : "dept"
|
|
3423
|
-
}, null, 8,
|
|
3420
|
+
}, null, 8, fo),
|
|
3424
3421
|
l("span", {
|
|
3425
3422
|
class: B(["ytree-node__label", {
|
|
3426
3423
|
"is-employee": $(k)
|
|
3427
3424
|
}])
|
|
3428
|
-
},
|
|
3429
|
-
l("div",
|
|
3430
|
-
|
|
3425
|
+
}, le(H(k)), 3),
|
|
3426
|
+
l("div", vo, [
|
|
3427
|
+
ce(p.$slots, "node-content", {
|
|
3431
3428
|
node: k,
|
|
3432
3429
|
isCurrent: J(k),
|
|
3433
3430
|
isExpanded: O(k),
|
|
3434
3431
|
hasChildren: c(k)
|
|
3435
3432
|
}, void 0, !0)
|
|
3436
3433
|
])
|
|
3437
|
-
], 42,
|
|
3434
|
+
], 42, ao),
|
|
3438
3435
|
ve(_e, { name: "ytree-node" }, {
|
|
3439
3436
|
default: ye(() => [
|
|
3440
|
-
c(k) && O(k) ? (s(), r("div",
|
|
3437
|
+
c(k) && O(k) ? (s(), r("div", ho, [
|
|
3441
3438
|
(s(!0), r(pe, null, me(D(
|
|
3442
3439
|
k
|
|
3443
3440
|
), (M) => (s(), r("div", {
|
|
@@ -3486,7 +3483,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3486
3483
|
"stroke-linejoin": "round"
|
|
3487
3484
|
})
|
|
3488
3485
|
], -1)
|
|
3489
|
-
])], 10,
|
|
3486
|
+
])], 10, yo)) : (s(), r("span", go)),
|
|
3490
3487
|
t.showCheckbox ? (s(), r("span", {
|
|
3491
3488
|
key: 2,
|
|
3492
3489
|
class: B(["ytree-node__checkbox", {
|
|
@@ -3497,7 +3494,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3497
3494
|
}]),
|
|
3498
3495
|
onClick: G((z) => ee(M), ["stop"])
|
|
3499
3496
|
}, [
|
|
3500
|
-
V(M) ? (s(), r("svg",
|
|
3497
|
+
V(M) ? (s(), r("svg", wo, [...h[13] || (h[13] = [
|
|
3501
3498
|
l("path", {
|
|
3502
3499
|
d: "M2 6L4.5 8.5L10 3",
|
|
3503
3500
|
stroke: "currentColor",
|
|
@@ -3507,7 +3504,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3507
3504
|
}, null, -1)
|
|
3508
3505
|
])])) : Q(
|
|
3509
3506
|
M
|
|
3510
|
-
) ? (s(), r("svg",
|
|
3507
|
+
) ? (s(), r("svg", bo, [...h[14] || (h[14] = [
|
|
3511
3508
|
l("path", {
|
|
3512
3509
|
d: "M2 6L10 6",
|
|
3513
3510
|
stroke: "currentColor",
|
|
@@ -3515,7 +3512,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3515
3512
|
"stroke-linecap": "round"
|
|
3516
3513
|
}, null, -1)
|
|
3517
3514
|
])])) : W("", !0)
|
|
3518
|
-
], 10,
|
|
3515
|
+
], 10, mo)) : W("", !0),
|
|
3519
3516
|
t.iconClass ? (s(), r("span", {
|
|
3520
3517
|
key: 3,
|
|
3521
3518
|
class: B(["ytree-node__icon", t.iconClass])
|
|
@@ -3524,21 +3521,21 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3524
3521
|
class: "ytree-node__avatar",
|
|
3525
3522
|
src: b(M, o),
|
|
3526
3523
|
alt: $(M) ? "person" : "dept"
|
|
3527
|
-
}, null, 8,
|
|
3524
|
+
}, null, 8, ko),
|
|
3528
3525
|
l("span", {
|
|
3529
3526
|
class: B(["ytree-node__label", {
|
|
3530
3527
|
"is-employee": $(M)
|
|
3531
3528
|
}])
|
|
3532
|
-
},
|
|
3533
|
-
l("div",
|
|
3534
|
-
|
|
3529
|
+
}, le(H(M)), 3),
|
|
3530
|
+
l("div", xo, [
|
|
3531
|
+
ce(p.$slots, "node-content", {
|
|
3535
3532
|
node: M,
|
|
3536
3533
|
isCurrent: J(M),
|
|
3537
3534
|
isExpanded: O(M),
|
|
3538
3535
|
hasChildren: c(M)
|
|
3539
3536
|
}, void 0, !0)
|
|
3540
3537
|
])
|
|
3541
|
-
], 42,
|
|
3538
|
+
], 42, po)
|
|
3542
3539
|
], 2))), 128))
|
|
3543
3540
|
])) : W("", !0)
|
|
3544
3541
|
]),
|
|
@@ -3563,13 +3560,13 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3563
3560
|
])
|
|
3564
3561
|
], 2));
|
|
3565
3562
|
}
|
|
3566
|
-
}),
|
|
3563
|
+
}), _o = /* @__PURE__ */ xe(Co, [["__scopeId", "data-v-6ab410ed"]]), So = { class: "query-encapsulation" }, Mo = { class: "query-encapsulation__container" }, Lo = { class: "query-encapsulation__content" }, Io = { class: "query-encapsulation__fields" }, Eo = { class: "query-encapsulation__field-wrapper" }, Bo = {
|
|
3567
3564
|
key: 0,
|
|
3568
3565
|
class: "query-encapsulation__field-label"
|
|
3569
|
-
},
|
|
3566
|
+
}, To = {
|
|
3570
3567
|
key: 0,
|
|
3571
3568
|
class: "query-encapsulation__toggle"
|
|
3572
|
-
},
|
|
3569
|
+
}, Ko = { class: "query-encapsulation__actions" }, zo = { class: "query-encapsulation__actions-group" }, Ho = /* @__PURE__ */ ke({
|
|
3573
3570
|
__name: "QueryEncapsulation",
|
|
3574
3571
|
props: {
|
|
3575
3572
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3580,7 +3577,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3580
3577
|
},
|
|
3581
3578
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3582
3579
|
setup(t, { emit: w }) {
|
|
3583
|
-
const e = t, n = w, m = K(!1),
|
|
3580
|
+
const e = t, n = w, m = K(!1), v = ct({}), f = ["select", "date", "daterange"];
|
|
3584
3581
|
let S;
|
|
3585
3582
|
const x = j(() => e.fields.filter((E) => !E.hidden)), H = j(() => m.value ? x.value : x.value.slice(0, e.maxVisibleFields)), $ = j(() => x.value.length > e.maxVisibleFields);
|
|
3586
3583
|
function b(E) {
|
|
@@ -3596,22 +3593,22 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3596
3593
|
}
|
|
3597
3594
|
}
|
|
3598
3595
|
function c(E, F) {
|
|
3599
|
-
|
|
3596
|
+
v[E] = F;
|
|
3600
3597
|
const T = e.fields.find((N) => N.key === E);
|
|
3601
3598
|
T && D(T);
|
|
3602
3599
|
}
|
|
3603
3600
|
function D(E) {
|
|
3604
|
-
n("field-change", E,
|
|
3601
|
+
n("field-change", E, v[E.key]), n("update:modelValue", { ...v }), f.includes(E.type) && J();
|
|
3605
3602
|
}
|
|
3606
3603
|
function A() {
|
|
3607
|
-
const E = ae(
|
|
3604
|
+
const E = ae(v), F = ee(E), T = { ...v };
|
|
3608
3605
|
n("search", { data: F, raw: T });
|
|
3609
3606
|
}
|
|
3610
3607
|
function P() {
|
|
3611
|
-
Object.keys(
|
|
3608
|
+
Object.keys(v).forEach((E) => {
|
|
3612
3609
|
const F = e.fields.find((T) => T.key === E);
|
|
3613
|
-
(F == null ? void 0 : F.type) === "daterange" ?
|
|
3614
|
-
}), n("reset"), n("update:modelValue", { ...
|
|
3610
|
+
(F == null ? void 0 : F.type) === "daterange" ? v[E] = { startDate: null, endDate: null } : (F == null ? void 0 : F.type) === "date" ? v[E] = null : v[E] = "";
|
|
3611
|
+
}), n("reset"), n("update:modelValue", { ...v });
|
|
3615
3612
|
}
|
|
3616
3613
|
function O() {
|
|
3617
3614
|
m.value = !m.value;
|
|
@@ -3663,26 +3660,26 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3663
3660
|
function he() {
|
|
3664
3661
|
e.fields.forEach((E) => {
|
|
3665
3662
|
var F, T, N;
|
|
3666
|
-
|
|
3663
|
+
v[E.key] === void 0 && (E.type === "daterange" ? v[E.key] = ((F = e.modelValue) == null ? void 0 : F[E.key]) || {
|
|
3667
3664
|
startDate: null,
|
|
3668
3665
|
endDate: null
|
|
3669
|
-
} : E.type === "date" ?
|
|
3666
|
+
} : E.type === "date" ? v[E.key] = ((T = e.modelValue) == null ? void 0 : T[E.key]) || null : v[E.key] = ((N = e.modelValue) == null ? void 0 : N[E.key]) || "");
|
|
3670
3667
|
});
|
|
3671
3668
|
}
|
|
3672
3669
|
return re(
|
|
3673
3670
|
() => e.modelValue,
|
|
3674
3671
|
(E) => {
|
|
3675
|
-
E && Object.assign(
|
|
3672
|
+
E && Object.assign(v, E);
|
|
3676
3673
|
},
|
|
3677
3674
|
{ deep: !0, immediate: !0 }
|
|
3678
3675
|
), Me(() => {
|
|
3679
3676
|
he();
|
|
3680
3677
|
}), lt(() => {
|
|
3681
3678
|
S && (clearTimeout(S), S = void 0);
|
|
3682
|
-
}), (E, F) => (s(), r("div",
|
|
3683
|
-
l("div",
|
|
3684
|
-
l("div",
|
|
3685
|
-
l("div",
|
|
3679
|
+
}), (E, F) => (s(), r("div", So, [
|
|
3680
|
+
l("div", Mo, [
|
|
3681
|
+
l("div", Lo, [
|
|
3682
|
+
l("div", Io, [
|
|
3686
3683
|
ve(ft, {
|
|
3687
3684
|
name: "qf",
|
|
3688
3685
|
tag: "div",
|
|
@@ -3693,16 +3690,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3693
3690
|
key: T.key,
|
|
3694
3691
|
class: "query-encapsulation__field-item"
|
|
3695
3692
|
}, [
|
|
3696
|
-
|
|
3693
|
+
ce(E.$slots, `field-${T.key}`, {
|
|
3697
3694
|
field: T,
|
|
3698
|
-
value:
|
|
3695
|
+
value: v[T.key],
|
|
3699
3696
|
updateValue: (N) => c(T.key, N)
|
|
3700
3697
|
}, () => [
|
|
3701
|
-
l("div",
|
|
3702
|
-
t.Iflabel ? (s(), r("label",
|
|
3698
|
+
l("div", Eo, [
|
|
3699
|
+
t.Iflabel ? (s(), r("label", Bo, le(T.label), 1)) : W("", !0),
|
|
3703
3700
|
(s(), Te(vt(b(T.type)), ht({
|
|
3704
|
-
modelValue:
|
|
3705
|
-
"onUpdate:modelValue": (N) =>
|
|
3701
|
+
modelValue: v[T.key],
|
|
3702
|
+
"onUpdate:modelValue": (N) => v[T.key] = N,
|
|
3706
3703
|
placeholder: T.placeholder || `请输入${T.label}`,
|
|
3707
3704
|
options: T.options,
|
|
3708
3705
|
clearable: T.clearable !== !1,
|
|
@@ -3721,14 +3718,14 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3721
3718
|
]),
|
|
3722
3719
|
_: 3
|
|
3723
3720
|
}),
|
|
3724
|
-
$.value ? (s(), r("div",
|
|
3721
|
+
$.value ? (s(), r("div", To, [
|
|
3725
3722
|
ve(je, {
|
|
3726
3723
|
variant: "secondary",
|
|
3727
3724
|
size: "small",
|
|
3728
3725
|
onClick: O
|
|
3729
3726
|
}, {
|
|
3730
3727
|
default: ye(() => [
|
|
3731
|
-
Se(
|
|
3728
|
+
Se(le(m.value ? "收起" : "展开") + " ", 1),
|
|
3732
3729
|
l("span", {
|
|
3733
3730
|
class: B(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3734
3731
|
}, "▼", 2)
|
|
@@ -3736,8 +3733,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3736
3733
|
_: 1
|
|
3737
3734
|
})
|
|
3738
3735
|
])) : W("", !0),
|
|
3739
|
-
l("div",
|
|
3740
|
-
l("div",
|
|
3736
|
+
l("div", Ko, [
|
|
3737
|
+
l("div", zo, [
|
|
3741
3738
|
ve(je, {
|
|
3742
3739
|
variant: "primary",
|
|
3743
3740
|
size: "small",
|
|
@@ -3760,7 +3757,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3760
3757
|
])]),
|
|
3761
3758
|
_: 1
|
|
3762
3759
|
}, 8, ["loading"]),
|
|
3763
|
-
|
|
3760
|
+
ce(E.$slots, "extra-actions", {}, void 0, !0)
|
|
3764
3761
|
])
|
|
3765
3762
|
])
|
|
3766
3763
|
])
|
|
@@ -3768,25 +3765,25 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3768
3765
|
])
|
|
3769
3766
|
]));
|
|
3770
3767
|
}
|
|
3771
|
-
}),
|
|
3768
|
+
}), Ro = /* @__PURE__ */ xe(Ho, [["__scopeId", "data-v-73456475"]]), Ao = {
|
|
3772
3769
|
key: 0,
|
|
3773
3770
|
width: "16",
|
|
3774
3771
|
height: "16",
|
|
3775
3772
|
viewBox: "0 0 24 24",
|
|
3776
3773
|
fill: "none"
|
|
3777
|
-
},
|
|
3774
|
+
}, Wo = {
|
|
3778
3775
|
key: 1,
|
|
3779
3776
|
width: "16",
|
|
3780
3777
|
height: "16",
|
|
3781
3778
|
viewBox: "0 0 24 24",
|
|
3782
3779
|
fill: "none"
|
|
3783
|
-
},
|
|
3780
|
+
}, Vo = {
|
|
3784
3781
|
key: 2,
|
|
3785
3782
|
width: "16",
|
|
3786
3783
|
height: "16",
|
|
3787
3784
|
viewBox: "0 0 24 24",
|
|
3788
3785
|
fill: "none"
|
|
3789
|
-
},
|
|
3786
|
+
}, Fo = ["textContent"], Po = /* @__PURE__ */ ke({
|
|
3790
3787
|
__name: "ymessageToast",
|
|
3791
3788
|
props: {
|
|
3792
3789
|
id: {},
|
|
@@ -3800,16 +3797,16 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3800
3797
|
},
|
|
3801
3798
|
setup(t) {
|
|
3802
3799
|
const w = t, e = K(!1);
|
|
3803
|
-
let n, m = 0,
|
|
3800
|
+
let n, m = 0, v = 0;
|
|
3804
3801
|
Me(() => {
|
|
3805
3802
|
requestAnimationFrame(() => {
|
|
3806
|
-
e.value = !0, w.duration && w.duration > 0 &&
|
|
3803
|
+
e.value = !0, w.duration && w.duration > 0 && f(w.duration);
|
|
3807
3804
|
});
|
|
3808
3805
|
}), lt(() => {
|
|
3809
3806
|
S();
|
|
3810
3807
|
});
|
|
3811
|
-
function
|
|
3812
|
-
m = c,
|
|
3808
|
+
function f(c) {
|
|
3809
|
+
m = c, v = Date.now(), n = window.setTimeout(() => $(), c);
|
|
3813
3810
|
}
|
|
3814
3811
|
function S() {
|
|
3815
3812
|
n && (window.clearTimeout(n), n = void 0);
|
|
@@ -3817,12 +3814,12 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3817
3814
|
function x() {
|
|
3818
3815
|
if (n && w.duration && w.duration > 0) {
|
|
3819
3816
|
S();
|
|
3820
|
-
const c = Date.now() -
|
|
3817
|
+
const c = Date.now() - v;
|
|
3821
3818
|
m = Math.max(0, m - c);
|
|
3822
3819
|
}
|
|
3823
3820
|
}
|
|
3824
3821
|
function H() {
|
|
3825
|
-
w.duration && w.duration > 0 && m > 0 &&
|
|
3822
|
+
w.duration && w.duration > 0 && m > 0 && f(m);
|
|
3826
3823
|
}
|
|
3827
3824
|
function $() {
|
|
3828
3825
|
e.value = !1;
|
|
@@ -3838,7 +3835,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3838
3835
|
default: ye(() => [
|
|
3839
3836
|
Le(l("div", {
|
|
3840
3837
|
class: B(["y-msg", [`y-msg--${t.type}`]]),
|
|
3841
|
-
style:
|
|
3838
|
+
style: fe({ zIndex: t.zIndex }),
|
|
3842
3839
|
role: "status",
|
|
3843
3840
|
"aria-live": "polite",
|
|
3844
3841
|
onMouseenter: x,
|
|
@@ -3848,7 +3845,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3848
3845
|
class: B(["y-msg__icon", `y-msg__icon--${t.type}`]),
|
|
3849
3846
|
"aria-hidden": "true"
|
|
3850
3847
|
}, [
|
|
3851
|
-
t.type === "success" ? (s(), r("svg",
|
|
3848
|
+
t.type === "success" ? (s(), r("svg", Ao, [...D[0] || (D[0] = [
|
|
3852
3849
|
l("path", {
|
|
3853
3850
|
d: "M20 6L9 17l-5-5",
|
|
3854
3851
|
stroke: "currentColor",
|
|
@@ -3856,7 +3853,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3856
3853
|
"stroke-linecap": "round",
|
|
3857
3854
|
"stroke-linejoin": "round"
|
|
3858
3855
|
}, null, -1)
|
|
3859
|
-
])])) : t.type === "warning" ? (s(), r("svg",
|
|
3856
|
+
])])) : t.type === "warning" ? (s(), r("svg", Wo, [...D[1] || (D[1] = [
|
|
3860
3857
|
l("path", {
|
|
3861
3858
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
3862
3859
|
stroke: "currentColor",
|
|
@@ -3864,7 +3861,7 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3864
3861
|
"stroke-linecap": "round",
|
|
3865
3862
|
"stroke-linejoin": "round"
|
|
3866
3863
|
}, null, -1)
|
|
3867
|
-
])])) : (s(), r("svg",
|
|
3864
|
+
])])) : (s(), r("svg", Vo, [...D[2] || (D[2] = [
|
|
3868
3865
|
l("path", {
|
|
3869
3866
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3870
3867
|
stroke: "currentColor",
|
|
@@ -3876,8 +3873,8 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3876
3873
|
], 2),
|
|
3877
3874
|
l("div", {
|
|
3878
3875
|
class: "y-msg__content",
|
|
3879
|
-
textContent:
|
|
3880
|
-
}, null, 8,
|
|
3876
|
+
textContent: le(t.message)
|
|
3877
|
+
}, null, 8, Fo),
|
|
3881
3878
|
t.closable ? (s(), r("button", {
|
|
3882
3879
|
key: 0,
|
|
3883
3880
|
class: "y-msg__close",
|
|
@@ -3891,49 +3888,49 @@ const yt = ["type", "disabled", "aria-busy", "aria-disabled"], gt = { class: "co
|
|
|
3891
3888
|
_: 1
|
|
3892
3889
|
}));
|
|
3893
3890
|
}
|
|
3894
|
-
}),
|
|
3895
|
-
let
|
|
3891
|
+
}), No = /* @__PURE__ */ xe(Po, [["__scopeId", "data-v-db173617"]]);
|
|
3892
|
+
let Yo = 1;
|
|
3896
3893
|
const Ge = 12, Ee = [];
|
|
3897
|
-
function
|
|
3894
|
+
function Oo() {
|
|
3898
3895
|
let t = 20;
|
|
3899
3896
|
return Ee.forEach((w) => {
|
|
3900
3897
|
t += w.height + Ge;
|
|
3901
3898
|
}), t;
|
|
3902
3899
|
}
|
|
3903
3900
|
function tt(t) {
|
|
3904
|
-
const w = Ee.findIndex((
|
|
3901
|
+
const w = Ee.findIndex((v) => v.id === t);
|
|
3905
3902
|
if (w === -1) return;
|
|
3906
3903
|
const { el: e } = Ee[w], n = e.firstElementChild;
|
|
3907
3904
|
if (n) {
|
|
3908
|
-
const
|
|
3909
|
-
n.style.top =
|
|
3905
|
+
const v = window.getComputedStyle(n).top;
|
|
3906
|
+
n.style.top = v, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3910
3907
|
}
|
|
3911
3908
|
Ee[w].leaving = !0, Ue(), setTimeout(() => {
|
|
3912
3909
|
ot(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
3913
|
-
const
|
|
3914
|
-
|
|
3910
|
+
const v = Ee.findIndex((f) => f.id === t);
|
|
3911
|
+
v !== -1 && Ee.splice(v, 1), Ue();
|
|
3915
3912
|
}, 260);
|
|
3916
3913
|
}
|
|
3917
3914
|
function Xe(t) {
|
|
3918
|
-
var
|
|
3919
|
-
const w =
|
|
3915
|
+
var v;
|
|
3916
|
+
const w = Yo++, e = document.createElement("div");
|
|
3920
3917
|
document.body.appendChild(e);
|
|
3921
|
-
const n = ve(
|
|
3918
|
+
const n = ve(No, {
|
|
3922
3919
|
id: w,
|
|
3923
3920
|
type: t.type || "success",
|
|
3924
3921
|
message: t.message,
|
|
3925
3922
|
duration: t.duration ?? 2500,
|
|
3926
|
-
offset:
|
|
3923
|
+
offset: Oo(),
|
|
3927
3924
|
zIndex: 3e3 + w,
|
|
3928
3925
|
closable: t.closable ?? !1,
|
|
3929
|
-
onClose: (
|
|
3926
|
+
onClose: (f) => tt(f)
|
|
3930
3927
|
});
|
|
3931
3928
|
ot(n, e);
|
|
3932
|
-
const m = ((
|
|
3929
|
+
const m = ((v = e.firstElementChild) == null ? void 0 : v.offsetHeight) || 0;
|
|
3933
3930
|
return Ee.push({ id: w, el: e, vm: n, height: m, leaving: !1 }), Ue(), requestAnimationFrame(() => {
|
|
3934
|
-
const
|
|
3935
|
-
if (!
|
|
3936
|
-
const S =
|
|
3931
|
+
const f = e.firstElementChild;
|
|
3932
|
+
if (!f) return;
|
|
3933
|
+
const S = f.offsetHeight || m || 0, x = Ee.find((H) => H.id === w);
|
|
3937
3934
|
x && (x.height = S, Ue());
|
|
3938
3935
|
}), { close: () => tt(w) };
|
|
3939
3936
|
}
|
|
@@ -3963,7 +3960,7 @@ function Ue() {
|
|
|
3963
3960
|
}
|
|
3964
3961
|
});
|
|
3965
3962
|
}
|
|
3966
|
-
const
|
|
3963
|
+
const jo = { class: "hint-tag-content" }, qo = ["title"], Uo = /* @__PURE__ */ ke({
|
|
3967
3964
|
__name: "hintTag",
|
|
3968
3965
|
props: {
|
|
3969
3966
|
content: { default: "" },
|
|
@@ -3979,24 +3976,24 @@ const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ k
|
|
|
3979
3976
|
return w({
|
|
3980
3977
|
toggle: m,
|
|
3981
3978
|
isExpanded: n
|
|
3982
|
-
}), (
|
|
3979
|
+
}), (v, f) => (s(), r("div", {
|
|
3983
3980
|
class: B(["hint-tag-wrapper", `hint-tag-wrapper-${t.position}`])
|
|
3984
3981
|
}, [
|
|
3985
3982
|
ve(_e, { name: "hint-slide" }, {
|
|
3986
3983
|
default: ye(() => [
|
|
3987
3984
|
Le(l("div", {
|
|
3988
3985
|
class: B(["hint-tag", `hint-tag-${t.position}`]),
|
|
3989
|
-
style:
|
|
3986
|
+
style: fe({ width: t.position === "top" || t.position === "bottom" ? "auto" : t.width })
|
|
3990
3987
|
}, [
|
|
3991
|
-
l("div",
|
|
3992
|
-
|
|
3993
|
-
Se(
|
|
3988
|
+
l("div", jo, [
|
|
3989
|
+
ce(v.$slots, "default", {}, () => [
|
|
3990
|
+
Se(le(t.content), 1)
|
|
3994
3991
|
], !0)
|
|
3995
3992
|
]),
|
|
3996
3993
|
l("div", {
|
|
3997
3994
|
class: "hint-tag-toggle",
|
|
3998
3995
|
onClick: m
|
|
3999
|
-
}, [...
|
|
3996
|
+
}, [...f[0] || (f[0] = [
|
|
4000
3997
|
l("svg", {
|
|
4001
3998
|
class: "hint-tag-icon",
|
|
4002
3999
|
viewBox: "0 0 24 24",
|
|
@@ -4024,7 +4021,7 @@ const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ k
|
|
|
4024
4021
|
class: B(["hint-tag-button", `hint-tag-button-${t.position}`]),
|
|
4025
4022
|
onClick: m,
|
|
4026
4023
|
title: t.tooltip || t.content
|
|
4027
|
-
}, [...
|
|
4024
|
+
}, [...f[1] || (f[1] = [
|
|
4028
4025
|
l("svg", {
|
|
4029
4026
|
class: "hint-tag-button-icon",
|
|
4030
4027
|
viewBox: "0 0 24 24",
|
|
@@ -4039,7 +4036,7 @@ const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ k
|
|
|
4039
4036
|
"stroke-linejoin": "round"
|
|
4040
4037
|
})
|
|
4041
4038
|
], -1)
|
|
4042
|
-
])], 10,
|
|
4039
|
+
])], 10, qo), [
|
|
4043
4040
|
[Be, !n.value]
|
|
4044
4041
|
])
|
|
4045
4042
|
]),
|
|
@@ -4047,24 +4044,24 @@ const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ k
|
|
|
4047
4044
|
})
|
|
4048
4045
|
], 2));
|
|
4049
4046
|
}
|
|
4050
|
-
}),
|
|
4047
|
+
}), Zo = /* @__PURE__ */ xe(Uo, [["__scopeId", "data-v-e8b90c37"]]), nt = {
|
|
4051
4048
|
YButton: je,
|
|
4052
4049
|
YInput: at,
|
|
4053
|
-
YTable:
|
|
4050
|
+
YTable: Zt,
|
|
4054
4051
|
YSelect: st,
|
|
4055
|
-
YPagination:
|
|
4056
|
-
YBadge:
|
|
4057
|
-
YDialog:
|
|
4058
|
-
YPopover:
|
|
4052
|
+
YPagination: sn,
|
|
4053
|
+
YBadge: kn,
|
|
4054
|
+
YDialog: Ln,
|
|
4055
|
+
YPopover: Bn,
|
|
4059
4056
|
YTime: it,
|
|
4060
|
-
YSwitch:
|
|
4061
|
-
YImage:
|
|
4062
|
-
YDropdown:
|
|
4063
|
-
YDrawer:
|
|
4064
|
-
YTree:
|
|
4065
|
-
QueryEncapsulation:
|
|
4066
|
-
HintTag:
|
|
4067
|
-
},
|
|
4057
|
+
YSwitch: yl,
|
|
4058
|
+
YImage: bl,
|
|
4059
|
+
YDropdown: xl,
|
|
4060
|
+
YDrawer: Il,
|
|
4061
|
+
YTree: _o,
|
|
4062
|
+
QueryEncapsulation: Ro,
|
|
4063
|
+
HintTag: Zo
|
|
4064
|
+
}, Go = {
|
|
4068
4065
|
install(t) {
|
|
4069
4066
|
Object.keys(nt).forEach((w) => {
|
|
4070
4067
|
t.component(w, nt[w]);
|
|
@@ -4072,22 +4069,22 @@ const Yo = { class: "hint-tag-content" }, Oo = ["title"], jo = /* @__PURE__ */ k
|
|
|
4072
4069
|
}
|
|
4073
4070
|
};
|
|
4074
4071
|
export {
|
|
4075
|
-
|
|
4076
|
-
|
|
4072
|
+
Ro as QueryEncapsulation,
|
|
4073
|
+
kn as YBadge,
|
|
4077
4074
|
je as YButton,
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4075
|
+
Ln as YDialog,
|
|
4076
|
+
Il as YDrawer,
|
|
4077
|
+
xl as YDropdown,
|
|
4078
|
+
bl as YImage,
|
|
4082
4079
|
at as YInput,
|
|
4083
4080
|
qe as YMessage,
|
|
4084
|
-
|
|
4085
|
-
|
|
4081
|
+
sn as YPagination,
|
|
4082
|
+
Bn as YPopover,
|
|
4086
4083
|
st as YSelect,
|
|
4087
|
-
|
|
4088
|
-
|
|
4084
|
+
yl as YSwitch,
|
|
4085
|
+
Zt as YTable,
|
|
4089
4086
|
it as YTime,
|
|
4090
|
-
|
|
4091
|
-
|
|
4087
|
+
_o as YTree,
|
|
4088
|
+
Go as default
|
|
4092
4089
|
};
|
|
4093
4090
|
//# sourceMappingURL=index.esm.js.map
|