@nhdropshipping/y-components 1.0.28 → 1.0.30
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/QueryEncapsulation.vue.d.ts +8 -2
- package/dist/components/QueryEncapsulation.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 +552 -553
- 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 ge, computed as
|
|
1
|
+
import { defineComponent as ge, computed as N, createElementBlock as u, openBlock as i, normalizeClass as E, createElementVNode as o, renderSlot as ae, Fragment as oe, renderList as ce, createCommentVNode as W, toDisplayString as G, ref as K, watch as ee, normalizeStyle as fe, nextTick as le, onMounted as Ce, onUnmounted as Ee, resolveComponent as Ae, createVNode as se, Transition as xe, withCtx as re, createTextVNode as $e, createBlock as Me, withKeys as ke, withModifiers as J, withDirectives as Be, vModelText as lt, Teleport as Fe, vShow as Ke, provide as ot, reactive as at, TransitionGroup as st, resolveDynamicComponent as it, onBeforeUnmount as rt, render as Xe } from "vue";
|
|
2
2
|
const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "content" }, dt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -37,7 +37,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
37
37
|
}
|
|
38
38
|
n("click", C);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const p = N(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,7 +48,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
51
|
+
}), y = N(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
52
|
function I(C, T) {
|
|
53
53
|
if (t.disabled || t.loading || C.disabled || C.loading) {
|
|
54
54
|
T.preventDefault(), T.stopPropagation();
|
|
@@ -56,7 +56,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
56
56
|
}
|
|
57
57
|
n("group-click", C.value, T);
|
|
58
58
|
}
|
|
59
|
-
return (C, T) =>
|
|
59
|
+
return (C, T) => y.value ? (i(), u("div", dt, [
|
|
60
60
|
(i(!0), u(oe, null, ce(e.groupItems, (k, w) => {
|
|
61
61
|
var g;
|
|
62
62
|
return i(), u("button", {
|
|
@@ -100,7 +100,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
100
100
|
`y-btn--${e.size}`,
|
|
101
101
|
{ "is-block": e.block, "is-loading": e.loading },
|
|
102
102
|
e.groupPosition !== "single" ? "is-grouped" : "",
|
|
103
|
-
|
|
103
|
+
p.value
|
|
104
104
|
]]),
|
|
105
105
|
type: e.htmlType,
|
|
106
106
|
disabled: e.disabled || e.loading,
|
|
@@ -137,19 +137,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
137
137
|
},
|
|
138
138
|
emits: ["update:modelValue"],
|
|
139
139
|
setup(e, { emit: $ }) {
|
|
140
|
-
const t = e, n = $, m = K(null),
|
|
140
|
+
const t = e, n = $, m = K(null), p = K(""), y = K(!1), I = K(!1), C = K(t.placeholder || "");
|
|
141
141
|
ee(() => t.placeholder, (g) => {
|
|
142
142
|
I.value || (C.value = g || "");
|
|
143
143
|
});
|
|
144
144
|
function T(g) {
|
|
145
145
|
const x = g.target;
|
|
146
|
-
|
|
146
|
+
y.value = !0, n("update:modelValue", x.value);
|
|
147
147
|
}
|
|
148
148
|
function k() {
|
|
149
|
-
I.value = !0, t.clearOnFocus && (
|
|
149
|
+
I.value = !0, t.clearOnFocus && (p.value = t.modelValue || "", y.value = !1, C.value = p.value || t.placeholder || "", n("update:modelValue", ""));
|
|
150
150
|
}
|
|
151
151
|
function w() {
|
|
152
|
-
I.value = !1, t.clearOnFocus && !
|
|
152
|
+
I.value = !1, t.clearOnFocus && !y.value && (!t.modelValue || t.modelValue === "") && n("update:modelValue", p.value), C.value = t.placeholder || "";
|
|
153
153
|
}
|
|
154
154
|
return (g, x) => (i(), u("div", {
|
|
155
155
|
class: E(["y-input-wrap", { "is-block": e.block }]),
|
|
@@ -207,7 +207,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
207
207
|
}, Kt = ["onClick"], Ht = {
|
|
208
208
|
key: 1,
|
|
209
209
|
class: "col-select"
|
|
210
|
-
}, Wt = ["value", "checked", "onChange"], Rt = ["colspan"],
|
|
210
|
+
}, Wt = ["value", "checked", "onChange"], Rt = ["colspan"], Vt = /* @__PURE__ */ ge({
|
|
211
211
|
__name: "ytable",
|
|
212
212
|
props: {
|
|
213
213
|
data: {},
|
|
@@ -234,20 +234,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
234
234
|
},
|
|
235
235
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
236
236
|
setup(e, { emit: $ }) {
|
|
237
|
-
const t = e, n = $, m = K(t.currentPage || 1),
|
|
238
|
-
() => t.columns.filter((l) => !
|
|
237
|
+
const t = e, n = $, m = K(t.currentPage || 1), p = K(t.pageSize), y = K([]), I = K(/* @__PURE__ */ new Set()), C = K("none"), T = K(), k = K(), w = K(), g = K(), x = K([]), Y = K({}), X = N(
|
|
238
|
+
() => t.columns.filter((l) => !Z(l.width)).map((l) => l.key)
|
|
239
239
|
);
|
|
240
|
-
function
|
|
241
|
-
return `${(100 / (
|
|
240
|
+
function A() {
|
|
241
|
+
return `${(100 / (X.value.length || 1)).toFixed(6)}%`;
|
|
242
242
|
}
|
|
243
243
|
const D = K(), z = K({
|
|
244
244
|
show: !1,
|
|
245
245
|
thumbHeight: 40,
|
|
246
246
|
thumbTop: 0
|
|
247
247
|
});
|
|
248
|
-
let B = !1,
|
|
249
|
-
const
|
|
250
|
-
function
|
|
248
|
+
let B = !1, F = 0, O = 0;
|
|
249
|
+
const q = K(0);
|
|
250
|
+
function Z(l) {
|
|
251
251
|
if (l == null) return;
|
|
252
252
|
if (typeof l == "number")
|
|
253
253
|
return Number.isFinite(l) ? `${l}px` : void 0;
|
|
@@ -256,15 +256,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
256
256
|
return /^\d+(\.\d+)?$/.test(c) ? `${c}px` : c;
|
|
257
257
|
}
|
|
258
258
|
function ie(l) {
|
|
259
|
-
const c =
|
|
259
|
+
const c = Z(l);
|
|
260
260
|
if (!c) return null;
|
|
261
261
|
const _ = parseFloat(c);
|
|
262
262
|
return Number.isFinite(_) ? _ : null;
|
|
263
263
|
}
|
|
264
|
-
const ue =
|
|
264
|
+
const ue = N(() => {
|
|
265
265
|
let l = t.columns.length;
|
|
266
266
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
267
|
-
}), te =
|
|
267
|
+
}), te = N(() => {
|
|
268
268
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
269
269
|
return t.data;
|
|
270
270
|
const l = t.searchKeyword.toLowerCase();
|
|
@@ -272,11 +272,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
272
272
|
const M = r(c, _);
|
|
273
273
|
return String(M).toLowerCase().includes(l);
|
|
274
274
|
}));
|
|
275
|
-
}), ve =
|
|
275
|
+
}), ve = N(() => (t.pagination, te.value)), pe = N(() => {
|
|
276
276
|
if (!t.selectable) return !1;
|
|
277
277
|
const l = ve.value.map((c, _) => d(c, _));
|
|
278
|
-
return l.length > 0 && l.every((c) =>
|
|
279
|
-
}), ye =
|
|
278
|
+
return l.length > 0 && l.every((c) => y.value.includes(c));
|
|
279
|
+
}), ye = N(() => {
|
|
280
280
|
const l = [];
|
|
281
281
|
let c = t.selectable ? 40 : 0;
|
|
282
282
|
for (let _ = 0; _ < t.columns.length; _++) {
|
|
@@ -288,7 +288,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
return l;
|
|
291
|
-
}), V =
|
|
291
|
+
}), V = N(() => {
|
|
292
292
|
const l = [];
|
|
293
293
|
let c = 0;
|
|
294
294
|
const _ = [];
|
|
@@ -304,7 +304,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
304
304
|
l.push(c), c += _[M].width;
|
|
305
305
|
return l;
|
|
306
306
|
});
|
|
307
|
-
function
|
|
307
|
+
function Q(l, c) {
|
|
308
308
|
if (c === "left") {
|
|
309
309
|
let _ = 0;
|
|
310
310
|
for (let M = 0; M < l; M++)
|
|
@@ -334,18 +334,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
334
334
|
return l.align && _.push(`text-${l.align}`), l.fixed === "right" && (_.push("col-fixed-right"), c && _.push("col-fixed-right-header")), l.fixed === "left" && (_.push("col-fixed-left"), c && _.push("col-fixed-left-header")), _.join(" ");
|
|
335
335
|
}
|
|
336
336
|
function b(l, c, _) {
|
|
337
|
-
const M = {}, S =
|
|
337
|
+
const M = {}, S = Z(l.width);
|
|
338
338
|
if (S)
|
|
339
339
|
M.width = S, M.minWidth = S, M.maxWidth = S;
|
|
340
340
|
else {
|
|
341
|
-
const H =
|
|
341
|
+
const H = A();
|
|
342
342
|
M.width = H, M.minWidth = H, M.maxWidth = H;
|
|
343
343
|
}
|
|
344
344
|
if (l.fixed === "left") {
|
|
345
|
-
const H =
|
|
345
|
+
const H = Q(c, "left"), j = ye.value[H] || 0;
|
|
346
346
|
M.left = `${j}px`, M.zIndex = _ ? `${10 + H}` : `${5 + H}`;
|
|
347
347
|
} else if (l.fixed === "right") {
|
|
348
|
-
const H =
|
|
348
|
+
const H = Q(c, "right"), j = V.value[H] || 0;
|
|
349
349
|
_ ? M.right = `${j - 3}px` : M.right = `${j}px`, M.zIndex = _ ? `${10 + H}` : `${5 + H}`;
|
|
350
350
|
}
|
|
351
351
|
return M;
|
|
@@ -354,21 +354,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
354
354
|
const _ = r(l, c.key);
|
|
355
355
|
return c.formatter ? c.formatter(_, l) : _ || "";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
358
|
-
|
|
357
|
+
function U(l) {
|
|
358
|
+
y.value.includes(l) ? y.value = y.value.filter((c) => c !== l) : y.value = [...y.value, l], n("select", y.value), n("update:selectedItems", y.value);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
360
|
+
function R() {
|
|
361
361
|
const l = ve.value.map((c, _) => d(c, _));
|
|
362
|
-
if (l.every((c) =>
|
|
363
|
-
|
|
362
|
+
if (l.every((c) => y.value.includes(c)))
|
|
363
|
+
y.value = y.value.filter((c) => !l.includes(c));
|
|
364
364
|
else {
|
|
365
|
-
const c = /* @__PURE__ */ new Set([...
|
|
366
|
-
|
|
365
|
+
const c = /* @__PURE__ */ new Set([...y.value, ...l]);
|
|
366
|
+
y.value = Array.from(c);
|
|
367
367
|
}
|
|
368
|
-
n("select",
|
|
368
|
+
n("select", y.value), n("update:selectedItems", y.value);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
370
|
+
function P() {
|
|
371
|
+
y.value = [], n("select", y.value), n("update:selectedItems", y.value);
|
|
372
372
|
}
|
|
373
373
|
ee(() => t.searchKeyword, () => {
|
|
374
374
|
m.value = 1;
|
|
@@ -379,14 +379,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
379
379
|
m.value = l, n("page-change", l);
|
|
380
380
|
}
|
|
381
381
|
function De(l) {
|
|
382
|
-
|
|
382
|
+
p.value = l, m.value = 1, n("page-size-change", l);
|
|
383
383
|
}
|
|
384
384
|
ee(() => t.currentPage, (l) => {
|
|
385
385
|
const c = typeof l == "number" && l > 0 ? l : 1;
|
|
386
386
|
m.value !== c && (m.value = c);
|
|
387
387
|
}), ee(() => t.pageSize, (l) => {
|
|
388
388
|
const c = typeof l == "number" && l > 0 ? l : 10;
|
|
389
|
-
|
|
389
|
+
p.value !== c && (p.value = c);
|
|
390
390
|
});
|
|
391
391
|
function be() {
|
|
392
392
|
T.value && le(() => {
|
|
@@ -400,7 +400,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
400
400
|
Le = !1;
|
|
401
401
|
}));
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function Pe() {
|
|
404
404
|
!k.value || !w.value || Le || w.value.scrollLeft !== k.value.scrollLeft && (Le = !0, w.value.scrollLeft = k.value.scrollLeft, requestAnimationFrame(() => {
|
|
405
405
|
Le = !1;
|
|
406
406
|
}));
|
|
@@ -419,31 +419,31 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
419
419
|
function Re(l) {
|
|
420
420
|
if (!B || !w.value || !D.value) return;
|
|
421
421
|
l.preventDefault();
|
|
422
|
-
const c = D.value.clientHeight, _ = Math.max(0, c - z.value.thumbHeight), M = w.value, S = M.scrollHeight, H = M.clientHeight, j = Math.max(1, S - H), he = (l.clientY -
|
|
423
|
-
M.scrollTop = Math.min(j, Math.max(0,
|
|
422
|
+
const c = D.value.clientHeight, _ = Math.max(0, c - z.value.thumbHeight), M = w.value, S = M.scrollHeight, H = M.clientHeight, j = Math.max(1, S - H), he = (l.clientY - F) / Math.max(1, _) * j;
|
|
423
|
+
M.scrollTop = Math.min(j, Math.max(0, O + he)), We();
|
|
424
424
|
}
|
|
425
|
-
function
|
|
426
|
-
B = !1, window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup",
|
|
425
|
+
function Ye() {
|
|
426
|
+
B = !1, window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Ye);
|
|
427
427
|
}
|
|
428
|
-
function
|
|
428
|
+
function Ve() {
|
|
429
429
|
le(() => {
|
|
430
430
|
var _, M;
|
|
431
431
|
if (x.value.length === t.columns.length && x.value.every((S) => !!S))
|
|
432
432
|
return;
|
|
433
433
|
const l = [];
|
|
434
434
|
t.columns.forEach((S, H) => {
|
|
435
|
-
const j =
|
|
435
|
+
const j = Z(S.width);
|
|
436
436
|
if (j)
|
|
437
|
-
l.push(j),
|
|
438
|
-
else if (
|
|
439
|
-
l.push(
|
|
437
|
+
l.push(j), Y.value[S.key] = j;
|
|
438
|
+
else if (Y.value[S.key])
|
|
439
|
+
l.push(Y.value[S.key]);
|
|
440
440
|
else {
|
|
441
441
|
const de = x.value[H];
|
|
442
442
|
if (de)
|
|
443
|
-
l.push(de),
|
|
443
|
+
l.push(de), Y.value[S.key] = de;
|
|
444
444
|
else {
|
|
445
|
-
const he =
|
|
446
|
-
l.push(he),
|
|
445
|
+
const he = A();
|
|
446
|
+
l.push(he), Y.value[S.key] = he;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
});
|
|
@@ -455,17 +455,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
455
455
|
const de = H[S + j];
|
|
456
456
|
if (de && de.clientWidth > 0) {
|
|
457
457
|
const he = `${de.clientWidth}px`;
|
|
458
|
-
l[j] = he,
|
|
458
|
+
l[j] = he, Y.value[t.columns[j].key] = he;
|
|
459
459
|
} else {
|
|
460
|
-
const he =
|
|
461
|
-
l[j] = he,
|
|
460
|
+
const he = A();
|
|
461
|
+
l[j] = he, Y.value[t.columns[j].key] = he;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
} else
|
|
465
465
|
for (let S = 0; S < l.length; S++)
|
|
466
466
|
if (!l[S]) {
|
|
467
|
-
const H =
|
|
468
|
-
l[S] = H || x.value[S] || "80px", t.columns[S] && (
|
|
467
|
+
const H = Y.value[((M = t.columns[S]) == null ? void 0 : M.key) || ""];
|
|
468
|
+
l[S] = H || x.value[S] || "80px", t.columns[S] && (Y.value[t.columns[S].key] = l[S]);
|
|
469
469
|
}
|
|
470
470
|
x.value = l;
|
|
471
471
|
});
|
|
@@ -477,23 +477,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
477
477
|
le(() => {
|
|
478
478
|
be(), Ie(), s(), I.value.clear();
|
|
479
479
|
});
|
|
480
|
-
}, { deep: !0 }), ee([m,
|
|
480
|
+
}, { deep: !0 }), ee([m, p], () => {
|
|
481
481
|
le(() => {
|
|
482
482
|
be(), Ie(), s();
|
|
483
483
|
});
|
|
484
484
|
}), ee(() => t.columns, () => {
|
|
485
|
-
const l = [], c = { ...
|
|
485
|
+
const l = [], c = { ...Y.value };
|
|
486
486
|
t.columns.forEach((M, S) => {
|
|
487
|
-
const H =
|
|
487
|
+
const H = Z(M.width);
|
|
488
488
|
H ? (l.push(H), c[M.key] = H) : c[M.key] ? l.push(c[M.key]) : x.value[S] ? (l.push(x.value[S]), c[M.key] = x.value[S]) : l.push("");
|
|
489
489
|
});
|
|
490
490
|
const _ = new Set(t.columns.map((M) => M.key));
|
|
491
491
|
Object.keys(c).forEach((M) => {
|
|
492
492
|
_.has(M) || delete c[M];
|
|
493
|
-
}),
|
|
494
|
-
|
|
493
|
+
}), Y.value = c, x.value = l, le(() => {
|
|
494
|
+
Ve(), Ie(), s();
|
|
495
495
|
});
|
|
496
|
-
}, { deep: !0 }), ee(() =>
|
|
496
|
+
}, { deep: !0 }), ee(() => y.value, () => {
|
|
497
497
|
le(() => {
|
|
498
498
|
be(), s();
|
|
499
499
|
});
|
|
@@ -504,24 +504,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
504
504
|
}), Ce(() => {
|
|
505
505
|
var l, c;
|
|
506
506
|
le(() => {
|
|
507
|
-
be(),
|
|
507
|
+
be(), Ve(), s(), We();
|
|
508
508
|
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l = w.value) == null || l.addEventListener("scroll", () => {
|
|
509
509
|
Ie(), We(), s();
|
|
510
510
|
}, { passive: !0 }), (c = k.value) == null || c.addEventListener("scroll", () => {
|
|
511
|
-
|
|
511
|
+
Pe();
|
|
512
512
|
}, { passive: !0 }), le(() => Ie()), w.value && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
513
513
|
s();
|
|
514
514
|
}), v.observe(w.value));
|
|
515
515
|
}), Ee(() => {
|
|
516
516
|
var l, c;
|
|
517
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = w.value) == null || l.removeEventListener("scroll", Ie), (c = k.value) == null || c.removeEventListener("scroll",
|
|
517
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (l = w.value) == null || l.removeEventListener("scroll", Ie), (c = k.value) == null || c.removeEventListener("scroll", Pe), window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Ye), v && (v.disconnect(), v = null);
|
|
518
518
|
});
|
|
519
519
|
let Te = -1;
|
|
520
520
|
function s() {
|
|
521
521
|
!k.value || !w.value || requestAnimationFrame(() => {
|
|
522
522
|
if (!k.value || !w.value) return;
|
|
523
523
|
const l = w.value, c = Math.ceil(l.offsetWidth - l.clientWidth);
|
|
524
|
-
if (
|
|
524
|
+
if (q.value = c, c !== Te) {
|
|
525
525
|
Te = c;
|
|
526
526
|
const _ = k.value.querySelector(".table"), M = g.value;
|
|
527
527
|
_ && M && (k.value.style.paddingRight = "0px", _.style.width = "", _.style.marginRight = "", c > 0 ? (k.value.style.paddingRight = `${c}px`, _.style.width = "100%", _.style.marginRight = `-${c}px`) : (k.value.style.paddingRight = "0px", _.style.width = "100%", _.style.marginRight = "0px"));
|
|
@@ -530,7 +530,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
530
530
|
}
|
|
531
531
|
let v = null;
|
|
532
532
|
return (l, c) => {
|
|
533
|
-
const _ =
|
|
533
|
+
const _ = Ae("YButton"), M = Ae("YPagination");
|
|
534
534
|
return i(), u("div", {
|
|
535
535
|
class: "ytable-container",
|
|
536
536
|
ref_key: "tableContainer",
|
|
@@ -538,17 +538,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
538
538
|
}, [
|
|
539
539
|
se(xe, { name: "bulk-slide" }, {
|
|
540
540
|
default: re(() => [
|
|
541
|
-
|
|
542
|
-
o("div", kt, "已选择 " + G(
|
|
541
|
+
y.value.length && e.showBulkActions ? (i(), u("div", bt, [
|
|
542
|
+
o("div", kt, "已选择 " + G(y.value.length) + " 项", 1),
|
|
543
543
|
o("div", xt, [
|
|
544
544
|
ae(l.$slots, "bulk-actions", {
|
|
545
|
-
selectedItems:
|
|
546
|
-
clearSelection:
|
|
545
|
+
selectedItems: y.value,
|
|
546
|
+
clearSelection: P
|
|
547
547
|
}, () => [
|
|
548
548
|
se(_, {
|
|
549
549
|
size: "small",
|
|
550
550
|
class: "btn",
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: P
|
|
552
552
|
}, {
|
|
553
553
|
default: re(() => [...c[2] || (c[2] = [
|
|
554
554
|
$e("清除选择", -1)
|
|
@@ -583,7 +583,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
583
583
|
o("input", {
|
|
584
584
|
type: "checkbox",
|
|
585
585
|
checked: pe.value,
|
|
586
|
-
onChange:
|
|
586
|
+
onChange: R
|
|
587
587
|
}, null, 40, Lt)
|
|
588
588
|
])) : W("", !0),
|
|
589
589
|
(i(!0), u(oe, null, ce(e.columns, (S, H) => (i(), u("th", {
|
|
@@ -643,8 +643,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
643
643
|
o("input", {
|
|
644
644
|
type: "checkbox",
|
|
645
645
|
value: d(S, H),
|
|
646
|
-
checked:
|
|
647
|
-
onChange: (j) =>
|
|
646
|
+
checked: y.value.includes(d(S, H)),
|
|
647
|
+
onChange: (j) => U(d(S, H))
|
|
648
648
|
}, null, 40, Wt)
|
|
649
649
|
])) : W("", !0),
|
|
650
650
|
(i(!0), u(oe, null, ce(e.columns, (j, de) => (i(), u("td", {
|
|
@@ -684,8 +684,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
684
684
|
class: "align-right",
|
|
685
685
|
"current-page": m.value,
|
|
686
686
|
"onUpdate:currentPage": c[0] || (c[0] = (S) => m.value = S),
|
|
687
|
-
"page-size":
|
|
688
|
-
"onUpdate:pageSize": c[1] || (c[1] = (S) =>
|
|
687
|
+
"page-size": p.value,
|
|
688
|
+
"onUpdate:pageSize": c[1] || (c[1] = (S) => p.value = S),
|
|
689
689
|
loading: t.loading,
|
|
690
690
|
"page-size-options": e.pageSizeOptions,
|
|
691
691
|
onPageChange: we,
|
|
@@ -695,7 +695,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
695
695
|
], 512);
|
|
696
696
|
};
|
|
697
697
|
}
|
|
698
|
-
}),
|
|
698
|
+
}), At = /* @__PURE__ */ me(Vt, [["__scopeId", "data-v-a2bea873"]]), Ft = ["onKeydown", "aria-expanded"], Pt = ["src"], Yt = ["placeholder", "onKeydown"], Nt = ["onClick", "onMouseenter"], Ot = ["src"], jt = /* @__PURE__ */ ge({
|
|
699
699
|
__name: "yselect",
|
|
700
700
|
props: {
|
|
701
701
|
modelValue: {},
|
|
@@ -714,14 +714,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
714
714
|
},
|
|
715
715
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
716
716
|
setup(e, { emit: $ }) {
|
|
717
|
-
const t = e, n = $, m = K(!1),
|
|
717
|
+
const t = e, n = $, m = K(!1), p = K(-1), y = K(), I = K(), C = K(), T = K(), k = K(!1), w = K(), g = K(""), x = N(() => t.options.find((a) => z(a) === t.modelValue) || null), Y = N(() => x.value ? B(x.value) : ""), X = N(() => {
|
|
718
718
|
if (!t.filterable) return t.options;
|
|
719
719
|
const a = g.value.trim().toLowerCase();
|
|
720
720
|
return a ? t.options.filter((r) => {
|
|
721
721
|
const f = B(r);
|
|
722
722
|
return String(f).toLowerCase().includes(a);
|
|
723
723
|
}) : t.options;
|
|
724
|
-
}),
|
|
724
|
+
}), A = N(() => {
|
|
725
725
|
var L;
|
|
726
726
|
const a = { position: "fixed", zIndex: "4000" }, r = I.value;
|
|
727
727
|
if (!r) return a;
|
|
@@ -732,8 +732,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
732
732
|
!m.value || !I.value || le(() => {
|
|
733
733
|
const a = I.value;
|
|
734
734
|
if (!a) return;
|
|
735
|
-
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200, L = r.bottom + b + 4,
|
|
736
|
-
k.value = !
|
|
735
|
+
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200, L = r.bottom + b + 4, U = r.top - b - 4, R = L <= f - 20, P = U >= 20;
|
|
736
|
+
k.value = !R && P;
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
function z(a) {
|
|
@@ -742,16 +742,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
742
742
|
function B(a) {
|
|
743
743
|
return typeof a == "object" && a !== null ? a[t.labelKey] || String(a[t.valueKey]) : String(a);
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function F(a, r) {
|
|
746
746
|
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id : z(a) || r;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function O(a) {
|
|
749
749
|
return z(a) === t.modelValue;
|
|
750
750
|
}
|
|
751
|
-
function
|
|
751
|
+
function q(a) {
|
|
752
752
|
return typeof a == "object" && a !== null ? a[t.disabledKey] === !0 : !1;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function Z() {
|
|
755
755
|
t.disabled || (m.value ? ue() : ie());
|
|
756
756
|
}
|
|
757
757
|
function ie() {
|
|
@@ -760,10 +760,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
760
760
|
}));
|
|
761
761
|
}
|
|
762
762
|
function ue() {
|
|
763
|
-
m.value = !1,
|
|
763
|
+
m.value = !1, p.value = -1, k.value = !1, t.filterable && (g.value = "");
|
|
764
764
|
}
|
|
765
765
|
function te(a, r) {
|
|
766
|
-
if (
|
|
766
|
+
if (q(a)) return;
|
|
767
767
|
const f = z(a);
|
|
768
768
|
n("update:modelValue", f), n("change", f, a), ue();
|
|
769
769
|
}
|
|
@@ -773,31 +773,31 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
773
773
|
n("update:modelValue", a), n("change", a, null), n("clear"), ue();
|
|
774
774
|
}
|
|
775
775
|
function pe(a) {
|
|
776
|
-
if (!
|
|
777
|
-
|
|
776
|
+
if (!X.value || X.value.length === 0) {
|
|
777
|
+
p.value = -1;
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
|
-
let r =
|
|
781
|
-
const f =
|
|
780
|
+
let r = p.value;
|
|
781
|
+
const f = X.value.length;
|
|
782
782
|
r === -1 ? r = a > 0 ? 0 : f - 1 : r = (r + a + f) % f;
|
|
783
783
|
let b = 0;
|
|
784
|
-
for (; b < f && X
|
|
784
|
+
for (; b < f && q(X.value[r]); )
|
|
785
785
|
r = (r + a + f) % f, b++;
|
|
786
|
-
|
|
786
|
+
p.value = b >= f ? -1 : r, Q();
|
|
787
787
|
}
|
|
788
788
|
function ye() {
|
|
789
|
-
if (
|
|
790
|
-
const a =
|
|
791
|
-
!a ||
|
|
789
|
+
if (p.value < 0) return;
|
|
790
|
+
const a = X.value[p.value];
|
|
791
|
+
!a || q(a) || te(a, p.value);
|
|
792
792
|
}
|
|
793
793
|
function V() {
|
|
794
|
-
if (!
|
|
795
|
-
const a =
|
|
794
|
+
if (!y.value) return;
|
|
795
|
+
const a = y.value.querySelector(".yselect__option--selected");
|
|
796
796
|
a && a.scrollIntoView({ block: "nearest" });
|
|
797
797
|
}
|
|
798
|
-
function
|
|
799
|
-
if (!
|
|
800
|
-
const r =
|
|
798
|
+
function Q() {
|
|
799
|
+
if (!y.value || p.value < 0) return;
|
|
800
|
+
const r = y.value.querySelectorAll(".yselect__option")[p.value];
|
|
801
801
|
r && r.scrollIntoView({ block: "nearest" });
|
|
802
802
|
}
|
|
803
803
|
function d(a) {
|
|
@@ -805,7 +805,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
805
805
|
(!C.value || !C.value.contains(r)) && ue();
|
|
806
806
|
}
|
|
807
807
|
ee(() => t.modelValue, () => {
|
|
808
|
-
|
|
808
|
+
p.value = -1;
|
|
809
809
|
});
|
|
810
810
|
function h() {
|
|
811
811
|
m.value && D();
|
|
@@ -828,13 +828,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
828
828
|
"yselect__trigger--disabled": e.disabled,
|
|
829
829
|
"yselect__trigger--error": e.error
|
|
830
830
|
}]),
|
|
831
|
-
onMousedown:
|
|
831
|
+
onMousedown: J(Z, ["prevent", "stop"]),
|
|
832
832
|
onKeydown: [
|
|
833
|
-
ke(
|
|
834
|
-
ke(
|
|
833
|
+
ke(J(Z, ["prevent"]), ["enter"]),
|
|
834
|
+
ke(J(Z, ["prevent"]), ["space"]),
|
|
835
835
|
ke(ue, ["escape"]),
|
|
836
|
-
ke(
|
|
837
|
-
ke(
|
|
836
|
+
ke(J(ie, ["prevent"]), ["arrow-down"]),
|
|
837
|
+
ke(J(ie, ["prevent"]), ["arrow-up"])
|
|
838
838
|
],
|
|
839
839
|
tabindex: "0",
|
|
840
840
|
role: "combobox",
|
|
@@ -843,11 +843,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
843
843
|
}, [
|
|
844
844
|
!e.filterable || !m.value ? (i(), u("span", {
|
|
845
845
|
key: 0,
|
|
846
|
-
class: E(["yselect__value", { yselect__placeholder: !
|
|
846
|
+
class: E(["yselect__value", { yselect__placeholder: !Y.value }])
|
|
847
847
|
}, [
|
|
848
848
|
ae(a.$slots, "value", {
|
|
849
849
|
value: x.value,
|
|
850
|
-
label:
|
|
850
|
+
label: Y.value
|
|
851
851
|
}, () => {
|
|
852
852
|
var f;
|
|
853
853
|
return [
|
|
@@ -857,8 +857,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
857
857
|
class: "yselect__flag",
|
|
858
858
|
src: x.value.flagImg,
|
|
859
859
|
alt: "flag"
|
|
860
|
-
}, null, 8,
|
|
861
|
-
$e(" " + G(
|
|
860
|
+
}, null, 8, Pt)) : W("", !0),
|
|
861
|
+
$e(" " + G(Y.value), 1)
|
|
862
862
|
], 64)) : (i(), u(oe, { key: 1 }, [
|
|
863
863
|
$e(G(e.placeholder), 1)
|
|
864
864
|
], 64))
|
|
@@ -870,25 +870,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
870
870
|
ref: w,
|
|
871
871
|
class: "yselect__input",
|
|
872
872
|
type: "text",
|
|
873
|
-
placeholder:
|
|
873
|
+
placeholder: Y.value || e.placeholder,
|
|
874
874
|
"onUpdate:modelValue": r[0] || (r[0] = (f) => g.value = f),
|
|
875
875
|
onKeydown: [
|
|
876
|
-
r[1] || (r[1] =
|
|
876
|
+
r[1] || (r[1] = J(() => {
|
|
877
877
|
}, ["stop"])),
|
|
878
|
-
r[2] || (r[2] = ke(
|
|
879
|
-
r[3] || (r[3] = ke(
|
|
880
|
-
r[4] || (r[4] = ke(
|
|
881
|
-
ke(
|
|
882
|
-
ke(
|
|
878
|
+
r[2] || (r[2] = ke(J((f) => pe(1), ["prevent"]), ["arrow-down"])),
|
|
879
|
+
r[3] || (r[3] = ke(J((f) => pe(-1), ["prevent"]), ["arrow-up"])),
|
|
880
|
+
r[4] || (r[4] = ke(J((f) => ye(), ["prevent"]), ["enter"])),
|
|
881
|
+
ke(J(ue, ["prevent"]), ["esc"]),
|
|
882
|
+
ke(J(ve, ["prevent"]), ["delete"])
|
|
883
883
|
]
|
|
884
|
-
}, null, 40,
|
|
884
|
+
}, null, 40, Yt)), [
|
|
885
885
|
[lt, g.value]
|
|
886
886
|
]),
|
|
887
887
|
e.clearable && !e.disabled && x.value ? (i(), u("span", {
|
|
888
888
|
key: 2,
|
|
889
889
|
class: "yselect__clear",
|
|
890
890
|
title: "清空",
|
|
891
|
-
onClick:
|
|
891
|
+
onClick: J(ve, ["stop"])
|
|
892
892
|
}, [...r[8] || (r[8] = [
|
|
893
893
|
o("svg", {
|
|
894
894
|
width: "12",
|
|
@@ -931,32 +931,32 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
931
931
|
ref_key: "dropdownEl",
|
|
932
932
|
ref: T,
|
|
933
933
|
class: E(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": k.value }]),
|
|
934
|
-
style: fe(
|
|
935
|
-
onMousedown: r[6] || (r[6] =
|
|
934
|
+
style: fe(A.value),
|
|
935
|
+
onMousedown: r[6] || (r[6] = J(() => {
|
|
936
936
|
}, ["stop"])),
|
|
937
|
-
onClick: r[7] || (r[7] =
|
|
937
|
+
onClick: r[7] || (r[7] = J(() => {
|
|
938
938
|
}, ["stop"]))
|
|
939
939
|
}, [
|
|
940
940
|
o("div", {
|
|
941
941
|
class: "yselect__options",
|
|
942
942
|
ref_key: "optionsContainer",
|
|
943
|
-
ref:
|
|
943
|
+
ref: y
|
|
944
944
|
}, [
|
|
945
|
-
(i(!0), u(oe, null, ce(
|
|
946
|
-
key:
|
|
945
|
+
(i(!0), u(oe, null, ce(X.value, (f, b) => (i(), u("div", {
|
|
946
|
+
key: F(f, b),
|
|
947
947
|
class: E(["yselect__option", {
|
|
948
|
-
"yselect__option--selected":
|
|
949
|
-
"yselect__option--disabled":
|
|
950
|
-
"yselect__option--hover":
|
|
948
|
+
"yselect__option--selected": O(f),
|
|
949
|
+
"yselect__option--disabled": q(f),
|
|
950
|
+
"yselect__option--hover": p.value === b
|
|
951
951
|
}]),
|
|
952
952
|
onClick: (L) => te(f),
|
|
953
|
-
onMouseenter: (L) =>
|
|
954
|
-
onMouseleave: r[5] || (r[5] = (L) =>
|
|
953
|
+
onMouseenter: (L) => p.value = b,
|
|
954
|
+
onMouseleave: r[5] || (r[5] = (L) => p.value = -1)
|
|
955
955
|
}, [
|
|
956
956
|
ae(a.$slots, "option", {
|
|
957
957
|
option: f,
|
|
958
958
|
index: b,
|
|
959
|
-
selected:
|
|
959
|
+
selected: O(f)
|
|
960
960
|
}, () => [
|
|
961
961
|
f != null && f.flagImg ? (i(), u("img", {
|
|
962
962
|
key: 0,
|
|
@@ -990,20 +990,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
990
990
|
},
|
|
991
991
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
992
992
|
setup(e, { emit: $ }) {
|
|
993
|
-
const t = e, n = $, m = K(t.pageSize),
|
|
993
|
+
const t = e, n = $, m = K(t.pageSize), p = N(() => t.pageSizeOptions), y = N({
|
|
994
994
|
get: () => t.currentPage,
|
|
995
995
|
set: (k) => {
|
|
996
996
|
n("update:currentPage", k), n("page-change", k);
|
|
997
997
|
}
|
|
998
998
|
});
|
|
999
999
|
function I(k) {
|
|
1000
|
-
t.loading || k >= 1 && k !== t.currentPage && (
|
|
1000
|
+
t.loading || k >= 1 && k !== t.currentPage && (y.value = k);
|
|
1001
1001
|
}
|
|
1002
1002
|
function C(k) {
|
|
1003
|
-
t.loading || (m.value = k, n("update:pageSize", k), n("page-size-change", k),
|
|
1003
|
+
t.loading || (m.value = k, n("update:pageSize", k), n("page-size-change", k), y.value = 1);
|
|
1004
1004
|
}
|
|
1005
1005
|
function T(k) {
|
|
1006
|
-
t.loading || (k === "prev" ? I(
|
|
1006
|
+
t.loading || (k === "prev" ? I(y.value - 1) : k === "next" && I(y.value + 1));
|
|
1007
1007
|
}
|
|
1008
1008
|
return m.value = t.pageSize, ee(
|
|
1009
1009
|
() => t.pageSize,
|
|
@@ -1011,14 +1011,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1011
1011
|
typeof k == "number" && m.value !== k && (m.value = k);
|
|
1012
1012
|
}
|
|
1013
1013
|
), (k, w) => {
|
|
1014
|
-
const g =
|
|
1014
|
+
const g = Ae("YButton"), x = Ae("YSelect");
|
|
1015
1015
|
return i(), u("div", qt, [
|
|
1016
1016
|
o("div", Ut, [
|
|
1017
1017
|
se(g, {
|
|
1018
1018
|
size: "small",
|
|
1019
1019
|
variant: "secondary",
|
|
1020
|
-
disabled:
|
|
1021
|
-
onClick: w[0] || (w[0] = (
|
|
1020
|
+
disabled: y.value === 1 || e.loading,
|
|
1021
|
+
onClick: w[0] || (w[0] = (Y) => I(1))
|
|
1022
1022
|
}, {
|
|
1023
1023
|
default: re(() => [...w[2] || (w[2] = [
|
|
1024
1024
|
$e("首页", -1)
|
|
@@ -1030,7 +1030,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1030
1030
|
variant: "secondary",
|
|
1031
1031
|
size: "small",
|
|
1032
1032
|
groupItems: [
|
|
1033
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1033
|
+
{ label: "上一页", value: "prev", disabled: y.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1034
1034
|
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1035
1035
|
],
|
|
1036
1036
|
onGroupClick: T
|
|
@@ -1038,8 +1038,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1038
1038
|
o("div", Zt, [
|
|
1039
1039
|
se(x, {
|
|
1040
1040
|
modelValue: m.value,
|
|
1041
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
1042
|
-
options:
|
|
1041
|
+
"onUpdate:modelValue": w[1] || (w[1] = (Y) => m.value = Y),
|
|
1042
|
+
options: p.value,
|
|
1043
1043
|
size: "small",
|
|
1044
1044
|
width: "105px",
|
|
1045
1045
|
clearable: !1,
|
|
@@ -1106,17 +1106,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1106
1106
|
label: { default: "" }
|
|
1107
1107
|
},
|
|
1108
1108
|
setup(e) {
|
|
1109
|
-
const $ = e, t =
|
|
1110
|
-
const m = ($.label || "").trim(),
|
|
1111
|
-
if (
|
|
1109
|
+
const $ = e, t = N(() => $.tone || "default"), n = N(() => {
|
|
1110
|
+
const m = ($.label || "").trim(), p = $.tone, y = $.progress;
|
|
1111
|
+
if (y) {
|
|
1112
1112
|
const I = {
|
|
1113
1113
|
incomplete: "未完成",
|
|
1114
1114
|
partiallyComplete: "部分完成",
|
|
1115
1115
|
complete: "已完成"
|
|
1116
1116
|
};
|
|
1117
|
-
return m ? `${m},进度:${I[
|
|
1117
|
+
return m ? `${m},进度:${I[y] || y}` : `进度:${I[y] || y}`;
|
|
1118
1118
|
}
|
|
1119
|
-
if (
|
|
1119
|
+
if (p && p !== "default") {
|
|
1120
1120
|
const I = {
|
|
1121
1121
|
informational: "信息",
|
|
1122
1122
|
success: "成功",
|
|
@@ -1125,11 +1125,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1125
1125
|
critical: "严重",
|
|
1126
1126
|
default: "默认"
|
|
1127
1127
|
};
|
|
1128
|
-
return m ? `${m},语气:${I[
|
|
1128
|
+
return m ? `${m},语气:${I[p] || p}` : `语气:${I[p] || p}`;
|
|
1129
1129
|
}
|
|
1130
1130
|
return m || "标记";
|
|
1131
1131
|
});
|
|
1132
|
-
return (m,
|
|
1132
|
+
return (m, p) => (i(), u("span", {
|
|
1133
1133
|
class: E(["y-badge", [
|
|
1134
1134
|
`y-badge--${t.value}`,
|
|
1135
1135
|
`y-badge--${e.size}`,
|
|
@@ -1141,13 +1141,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1141
1141
|
}, [
|
|
1142
1142
|
o("span", Gt, [
|
|
1143
1143
|
e.progress ? (i(), u("span", en, [
|
|
1144
|
-
e.progress === "incomplete" ? (i(), u("svg", tn, [...
|
|
1144
|
+
e.progress === "incomplete" ? (i(), u("svg", tn, [...p[0] || (p[0] = [
|
|
1145
1145
|
o("circle", {
|
|
1146
1146
|
cx: "10",
|
|
1147
1147
|
cy: "10",
|
|
1148
1148
|
r: "5"
|
|
1149
1149
|
}, null, -1)
|
|
1150
|
-
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", nn, [...
|
|
1150
|
+
])])) : e.progress === "partiallyComplete" ? (i(), u("svg", nn, [...p[1] || (p[1] = [
|
|
1151
1151
|
o("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1152
1152
|
o("circle", {
|
|
1153
1153
|
cx: "10",
|
|
@@ -1157,7 +1157,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1157
1157
|
stroke: "currentColor",
|
|
1158
1158
|
"stroke-width": "2"
|
|
1159
1159
|
}, null, -1)
|
|
1160
|
-
])])) : e.progress === "complete" ? (i(), u("svg", ln, [...
|
|
1160
|
+
])])) : e.progress === "complete" ? (i(), u("svg", ln, [...p[2] || (p[2] = [
|
|
1161
1161
|
o("path", {
|
|
1162
1162
|
"fill-rule": "evenodd",
|
|
1163
1163
|
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",
|
|
@@ -1165,25 +1165,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1165
1165
|
}, null, -1)
|
|
1166
1166
|
])])) : W("", !0)
|
|
1167
1167
|
])) : e.icon ? (i(), u("span", on, [
|
|
1168
|
-
e.icon === "dot" ? (i(), u("svg", an, [...
|
|
1168
|
+
e.icon === "dot" ? (i(), u("svg", an, [...p[3] || (p[3] = [
|
|
1169
1169
|
o("circle", {
|
|
1170
1170
|
cx: "10",
|
|
1171
1171
|
cy: "10",
|
|
1172
1172
|
r: "4"
|
|
1173
1173
|
}, null, -1)
|
|
1174
|
-
])])) : e.icon === "check" ? (i(), u("svg", sn, [...
|
|
1174
|
+
])])) : e.icon === "check" ? (i(), u("svg", sn, [...p[4] || (p[4] = [
|
|
1175
1175
|
o("path", {
|
|
1176
1176
|
"fill-rule": "evenodd",
|
|
1177
1177
|
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",
|
|
1178
1178
|
"clip-rule": "evenodd"
|
|
1179
1179
|
}, null, -1)
|
|
1180
|
-
])])) : e.icon === "alert" ? (i(), u("svg", rn, [...
|
|
1180
|
+
])])) : e.icon === "alert" ? (i(), u("svg", rn, [...p[5] || (p[5] = [
|
|
1181
1181
|
o("path", {
|
|
1182
1182
|
"fill-rule": "evenodd",
|
|
1183
1183
|
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",
|
|
1184
1184
|
"clip-rule": "evenodd"
|
|
1185
1185
|
}, null, -1)
|
|
1186
|
-
])])) : (i(), u("svg", un, [...
|
|
1186
|
+
])])) : (i(), u("svg", un, [...p[6] || (p[6] = [
|
|
1187
1187
|
o("circle", {
|
|
1188
1188
|
cx: "10",
|
|
1189
1189
|
cy: "10",
|
|
@@ -1220,10 +1220,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1220
1220
|
},
|
|
1221
1221
|
emits: ["update:modelValue", "open", "close"],
|
|
1222
1222
|
setup(e, { emit: $ }) {
|
|
1223
|
-
const t = e, n = $, m =
|
|
1223
|
+
const t = e, n = $, m = N({
|
|
1224
1224
|
get: () => t.modelValue,
|
|
1225
1225
|
set: (w) => n("update:modelValue", w)
|
|
1226
|
-
}),
|
|
1226
|
+
}), p = K(null), y = N(() => {
|
|
1227
1227
|
const w = {};
|
|
1228
1228
|
return w.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), w.margin = "0 auto", w.top = t.top, w;
|
|
1229
1229
|
});
|
|
@@ -1242,7 +1242,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1242
1242
|
return ee(() => t.modelValue, (w) => {
|
|
1243
1243
|
w ? (n("open"), requestAnimationFrame(() => {
|
|
1244
1244
|
var g;
|
|
1245
|
-
return (g =
|
|
1245
|
+
return (g = p.value) == null ? void 0 : g.focus();
|
|
1246
1246
|
}), document.addEventListener("keydown", k), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", k), document.body.style.overflow = "");
|
|
1247
1247
|
}), Ce(() => {
|
|
1248
1248
|
t.modelValue && (document.addEventListener("keydown", k), document.body.style.overflow = "hidden");
|
|
@@ -1264,10 +1264,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1264
1264
|
default: re(() => [
|
|
1265
1265
|
Be(o("div", {
|
|
1266
1266
|
ref_key: "panelRef",
|
|
1267
|
-
ref:
|
|
1267
|
+
ref: p,
|
|
1268
1268
|
class: E(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1269
|
-
style: fe(
|
|
1270
|
-
onKeydown: ke(
|
|
1269
|
+
style: fe(y.value),
|
|
1270
|
+
onKeydown: ke(J(T, ["prevent", "stop"]), ["esc"]),
|
|
1271
1271
|
tabindex: "-1"
|
|
1272
1272
|
}, [
|
|
1273
1273
|
e.showHeader ? (i(), u("div", pn, [
|
|
@@ -1319,25 +1319,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1319
1319
|
},
|
|
1320
1320
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1321
1321
|
setup(e, { expose: $, emit: t }) {
|
|
1322
|
-
const n = e, m = t,
|
|
1322
|
+
const n = e, m = t, p = K(), y = K(), I = K(), C = K(!1), T = K(), k = K(), w = K({});
|
|
1323
1323
|
let g = null, x = null;
|
|
1324
|
-
const
|
|
1324
|
+
const Y = N(() => {
|
|
1325
1325
|
if (!C.value || !T.value) return {};
|
|
1326
1326
|
const V = {};
|
|
1327
1327
|
n.width !== "auto" && (V.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (V.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1328
|
-
const { top:
|
|
1329
|
-
return V.top = `${
|
|
1330
|
-
}),
|
|
1328
|
+
const { top: Q, left: d } = A();
|
|
1329
|
+
return V.top = `${Q}px`, V.left = `${d}px`, V;
|
|
1330
|
+
}), X = N(() => {
|
|
1331
1331
|
if (!n.showArrow) return {};
|
|
1332
1332
|
if (Object.keys(w.value).length > 0)
|
|
1333
1333
|
return w.value;
|
|
1334
1334
|
const V = {};
|
|
1335
1335
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? V.left = "50%" : V.top = "50%", V;
|
|
1336
1336
|
});
|
|
1337
|
-
function
|
|
1338
|
-
var
|
|
1337
|
+
function A() {
|
|
1338
|
+
var R, P;
|
|
1339
1339
|
if (!T.value) return { top: 0, left: 0 };
|
|
1340
|
-
const { width: V, height:
|
|
1340
|
+
const { width: V, height: Q, top: d, left: h } = T.value, a = ((R = I.value) == null ? void 0 : R.offsetWidth) || 200, r = ((P = I.value) == null ? void 0 : P.offsetHeight) || 100;
|
|
1341
1341
|
let f = 0, b = 0;
|
|
1342
1342
|
switch (n.placement) {
|
|
1343
1343
|
case "top":
|
|
@@ -1350,66 +1350,66 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1350
1350
|
f = d - r - n.offset, b = h + V - a;
|
|
1351
1351
|
break;
|
|
1352
1352
|
case "bottom":
|
|
1353
|
-
f = d +
|
|
1353
|
+
f = d + Q + n.offset, b = h + (V - a) / 2;
|
|
1354
1354
|
break;
|
|
1355
1355
|
case "bottom-start":
|
|
1356
|
-
f = d +
|
|
1356
|
+
f = d + Q + n.offset, b = h;
|
|
1357
1357
|
break;
|
|
1358
1358
|
case "bottom-end":
|
|
1359
|
-
f = d +
|
|
1359
|
+
f = d + Q + n.offset, b = h + V - a;
|
|
1360
1360
|
break;
|
|
1361
1361
|
case "left":
|
|
1362
|
-
f = d + (
|
|
1362
|
+
f = d + (Q - r) / 2, b = h - a - n.offset;
|
|
1363
1363
|
break;
|
|
1364
1364
|
case "left-start":
|
|
1365
1365
|
f = d, b = h - a - n.offset;
|
|
1366
1366
|
break;
|
|
1367
1367
|
case "left-end":
|
|
1368
|
-
f = d +
|
|
1368
|
+
f = d + Q - r, b = h - a - n.offset;
|
|
1369
1369
|
break;
|
|
1370
1370
|
case "right":
|
|
1371
|
-
f = d + (
|
|
1371
|
+
f = d + (Q - r) / 2, b = h + V + n.offset;
|
|
1372
1372
|
break;
|
|
1373
1373
|
case "right-start":
|
|
1374
1374
|
f = d, b = h + V + n.offset;
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "right-end":
|
|
1377
|
-
f = d +
|
|
1377
|
+
f = d + Q - r, b = h + V + n.offset;
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
const L = window.innerWidth,
|
|
1381
|
-
return b < 8 && (b = 8), b + a > L - 8 && (b = L - a - 8), f < 8 && (f = 8), f + r >
|
|
1380
|
+
const L = window.innerWidth, U = window.innerHeight;
|
|
1381
|
+
return b < 8 && (b = 8), b + a > L - 8 && (b = L - a - 8), f < 8 && (f = 8), f + r > U - 8 && (f = U - r - 8), { top: f, left: b };
|
|
1382
1382
|
}
|
|
1383
1383
|
function D() {
|
|
1384
|
-
n.disabled || C.value || (
|
|
1384
|
+
n.disabled || C.value || (O(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1385
1385
|
z();
|
|
1386
1386
|
}, n.openDelay) : z());
|
|
1387
1387
|
}
|
|
1388
1388
|
function z() {
|
|
1389
1389
|
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"), le(() => {
|
|
1390
1390
|
le(() => {
|
|
1391
|
-
|
|
1391
|
+
Z();
|
|
1392
1392
|
});
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
1395
|
function B() {
|
|
1396
|
-
C.value && (
|
|
1397
|
-
|
|
1398
|
-
}, n.closeDelay) :
|
|
1396
|
+
C.value && (O(), n.closeDelay > 0 ? x = setTimeout(() => {
|
|
1397
|
+
F();
|
|
1398
|
+
}, n.closeDelay) : F());
|
|
1399
1399
|
}
|
|
1400
|
-
function
|
|
1400
|
+
function F() {
|
|
1401
1401
|
m("before-hide"), C.value = !1, m("update:modelValue", !1), m("hide");
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function O() {
|
|
1404
1404
|
g && (clearTimeout(g), g = null), x && (clearTimeout(x), x = null);
|
|
1405
1405
|
}
|
|
1406
|
-
function
|
|
1406
|
+
function q() {
|
|
1407
1407
|
if (!n.showArrow || !T.value || !I.value) {
|
|
1408
1408
|
w.value = {};
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
|
-
const V = T.value,
|
|
1412
|
-
if (
|
|
1411
|
+
const V = T.value, Q = I.value.getBoundingClientRect();
|
|
1412
|
+
if (Q.width === 0 || Q.height === 0) {
|
|
1413
1413
|
const h = {};
|
|
1414
1414
|
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", w.value = h;
|
|
1415
1415
|
return;
|
|
@@ -1417,74 +1417,74 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1417
1417
|
const d = {};
|
|
1418
1418
|
if (n.placement.startsWith("top")) {
|
|
1419
1419
|
d.bottom = "-6px";
|
|
1420
|
-
const h = V.left + V.width / 2, a =
|
|
1421
|
-
d.left = `${Math.max(12, Math.min(r,
|
|
1420
|
+
const h = V.left + V.width / 2, a = Q.left, r = h - a;
|
|
1421
|
+
d.left = `${Math.max(12, Math.min(r, Q.width - 12))}px`;
|
|
1422
1422
|
} else if (n.placement.startsWith("bottom")) {
|
|
1423
1423
|
d.top = "-6px";
|
|
1424
|
-
const h = V.left + V.width / 2, a =
|
|
1425
|
-
d.left = `${Math.max(12, Math.min(r,
|
|
1424
|
+
const h = V.left + V.width / 2, a = Q.left, r = h - a;
|
|
1425
|
+
d.left = `${Math.max(12, Math.min(r, Q.width - 12))}px`;
|
|
1426
1426
|
} else if (n.placement.startsWith("left")) {
|
|
1427
1427
|
d.right = "-6px";
|
|
1428
|
-
const h = V.top + V.height / 2, a =
|
|
1429
|
-
d.top = `${Math.max(12, Math.min(r,
|
|
1428
|
+
const h = V.top + V.height / 2, a = Q.top, r = h - a;
|
|
1429
|
+
d.top = `${Math.max(12, Math.min(r, Q.height - 12))}px`;
|
|
1430
1430
|
} else if (n.placement.startsWith("right")) {
|
|
1431
1431
|
d.left = "-6px";
|
|
1432
|
-
const h = V.top + V.height / 2, a =
|
|
1433
|
-
d.top = `${Math.max(12, Math.min(r,
|
|
1432
|
+
const h = V.top + V.height / 2, a = Q.top, r = h - a;
|
|
1433
|
+
d.top = `${Math.max(12, Math.min(r, Q.height - 12))}px`;
|
|
1434
1434
|
}
|
|
1435
1435
|
w.value = d;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1438
|
-
|
|
1439
|
-
I.value && (k.value = I.value.getBoundingClientRect(),
|
|
1437
|
+
function Z() {
|
|
1438
|
+
y.value && (T.value = y.value.getBoundingClientRect(), I.value && (k.value = I.value.getBoundingClientRect(), q(), C.value && requestAnimationFrame(() => {
|
|
1439
|
+
I.value && (k.value = I.value.getBoundingClientRect(), q());
|
|
1440
1440
|
})));
|
|
1441
1441
|
}
|
|
1442
1442
|
function ie() {
|
|
1443
1443
|
n.disabled || n.trigger === "click" && (C.value ? B() : D());
|
|
1444
1444
|
}
|
|
1445
1445
|
function ue() {
|
|
1446
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1446
|
+
n.disabled || n.trigger !== "hover" || (O(), D());
|
|
1447
1447
|
}
|
|
1448
1448
|
function te() {
|
|
1449
1449
|
n.disabled || n.trigger !== "hover" || B();
|
|
1450
1450
|
}
|
|
1451
1451
|
function ve() {
|
|
1452
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1452
|
+
n.disabled || n.trigger !== "hover" || O();
|
|
1453
1453
|
}
|
|
1454
1454
|
function pe() {
|
|
1455
1455
|
n.disabled || n.trigger !== "hover" || B();
|
|
1456
1456
|
}
|
|
1457
1457
|
function ye(V) {
|
|
1458
1458
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1459
|
-
const
|
|
1460
|
-
|
|
1459
|
+
const Q = V.target;
|
|
1460
|
+
p.value && !p.value.contains(Q) && I.value && !I.value.contains(Q) && B();
|
|
1461
1461
|
}
|
|
1462
1462
|
return ee(() => n.modelValue, (V) => {
|
|
1463
1463
|
V !== C.value && (V ? D() : B());
|
|
1464
1464
|
}), ee(C, (V) => {
|
|
1465
|
-
V ? (document.addEventListener("click", ye), window.addEventListener("resize",
|
|
1466
|
-
|
|
1467
|
-
|
|
1465
|
+
V ? (document.addEventListener("click", ye), window.addEventListener("resize", Z), window.addEventListener("scroll", Z, !0), le(() => {
|
|
1466
|
+
Z(), requestAnimationFrame(() => {
|
|
1467
|
+
Z();
|
|
1468
1468
|
}), setTimeout(() => {
|
|
1469
|
-
|
|
1469
|
+
Z();
|
|
1470
1470
|
}, 0);
|
|
1471
|
-
})) : (document.removeEventListener("click", ye), window.removeEventListener("resize",
|
|
1471
|
+
})) : (document.removeEventListener("click", ye), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0));
|
|
1472
1472
|
}), Ce(() => {
|
|
1473
1473
|
n.modelValue && D();
|
|
1474
1474
|
}), Ee(() => {
|
|
1475
|
-
|
|
1475
|
+
O(), document.removeEventListener("click", ye), window.removeEventListener("resize", Z), window.removeEventListener("scroll", Z, !0);
|
|
1476
1476
|
}), $({
|
|
1477
1477
|
show: D,
|
|
1478
1478
|
hide: B,
|
|
1479
|
-
updatePosition:
|
|
1480
|
-
}), (V,
|
|
1479
|
+
updatePosition: Z
|
|
1480
|
+
}), (V, Q) => (i(), u("div", {
|
|
1481
1481
|
class: "ypopover",
|
|
1482
1482
|
ref_key: "popoverRef",
|
|
1483
|
-
ref:
|
|
1483
|
+
ref: p
|
|
1484
1484
|
}, [
|
|
1485
1485
|
o("div", {
|
|
1486
1486
|
ref_key: "triggerRef",
|
|
1487
|
-
ref:
|
|
1487
|
+
ref: y,
|
|
1488
1488
|
onClick: ie,
|
|
1489
1489
|
onMouseenter: ue,
|
|
1490
1490
|
onMouseleave: te
|
|
@@ -1505,8 +1505,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1505
1505
|
"ypopover__content--no-padding": !e.showPadding
|
|
1506
1506
|
}
|
|
1507
1507
|
]]),
|
|
1508
|
-
style: fe(
|
|
1509
|
-
onClick:
|
|
1508
|
+
style: fe(Y.value),
|
|
1509
|
+
onClick: Q[0] || (Q[0] = J(() => {
|
|
1510
1510
|
}, ["stop"])),
|
|
1511
1511
|
onMouseenter: ve,
|
|
1512
1512
|
onMouseleave: pe
|
|
@@ -1514,7 +1514,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1514
1514
|
e.showArrow ? (i(), u("div", {
|
|
1515
1515
|
key: 0,
|
|
1516
1516
|
class: E(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1517
|
-
style: fe(
|
|
1517
|
+
style: fe(X.value)
|
|
1518
1518
|
}, null, 6)) : W("", !0),
|
|
1519
1519
|
o("div", kn, [
|
|
1520
1520
|
ae(V.$slots, "default", {}, void 0, !0)
|
|
@@ -1535,7 +1535,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1535
1535
|
}, Kn = {
|
|
1536
1536
|
key: 2,
|
|
1537
1537
|
class: "status-text status-complete"
|
|
1538
|
-
}, Hn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, Rn = { class: "nh-date-picker" },
|
|
1538
|
+
}, Hn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, Rn = { class: "nh-date-picker" }, Vn = { class: "nh-date-picker-header" }, An = { class: "nh-date-picker-header-label" }, Fn = { class: "nh-date-picker-content" }, Pn = { class: "nh-date-table" }, Yn = ["onClick"], Nn = { class: "nh-date-table-cell" }, On = { key: 0 }, 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-actions" }, nl = /* @__PURE__ */ ge({
|
|
1539
1539
|
__name: "ytime",
|
|
1540
1540
|
props: {
|
|
1541
1541
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1586,7 +1586,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1586
1586
|
},
|
|
1587
1587
|
emits: ["update:modelValue", "change"],
|
|
1588
1588
|
setup(e, { emit: $ }) {
|
|
1589
|
-
const t = e, n = $, m = K(!1),
|
|
1589
|
+
const t = e, n = $, m = K(!1), p = K(-1), y = K(-1), I = K(null), C = K(), T = K(), k = K({
|
|
1590
1590
|
top: !0,
|
|
1591
1591
|
left: !0
|
|
1592
1592
|
}), w = K({
|
|
@@ -1601,13 +1601,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1601
1601
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1602
1602
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1603
1603
|
}
|
|
1604
|
-
},
|
|
1604
|
+
}, Y = () => {
|
|
1605
1605
|
const s = new Date(w.value.year, w.value.month).getTime();
|
|
1606
1606
|
if (new Date(g.value.year, g.value.month).getTime() <= s) {
|
|
1607
1607
|
const l = new Date(g.value.year, g.value.month - 1);
|
|
1608
1608
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1610
|
+
}, X = ["一", "二", "三", "四", "五", "六", "日"], A = K(null), D = K(null), z = (s) => {
|
|
1611
1611
|
if (!s) return null;
|
|
1612
1612
|
if (s instanceof Date) return s;
|
|
1613
1613
|
if (typeof s == "number")
|
|
@@ -1625,17 +1625,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1625
1625
|
return `${v}-${l}-${c} ${_}:${M}:${S}`;
|
|
1626
1626
|
} else
|
|
1627
1627
|
return `${v}-${l}-${c}`;
|
|
1628
|
-
},
|
|
1628
|
+
}, F = (s) => s ? s.getTime() : null, O = (s) => s ? {
|
|
1629
1629
|
startDate: z(s.startDate),
|
|
1630
1630
|
endDate: z(s.endDate)
|
|
1631
|
-
} : { startDate: null, endDate: null },
|
|
1631
|
+
} : { startDate: null, endDate: null }, q = (s) => t.format === "string" ? {
|
|
1632
1632
|
startDate: B(s.startDate),
|
|
1633
1633
|
endDate: B(s.endDate)
|
|
1634
1634
|
} : t.format === "timestamp" ? {
|
|
1635
|
-
startDate:
|
|
1636
|
-
endDate:
|
|
1637
|
-
} : s,
|
|
1638
|
-
const v =
|
|
1635
|
+
startDate: F(s.startDate),
|
|
1636
|
+
endDate: F(s.endDate)
|
|
1637
|
+
} : s, Z = (s, v) => `${String(v + 1).padStart(2, "0")}/${s}`, ie = (s, v) => s.getFullYear() === v.getFullYear() && s.getMonth() === v.getMonth() && s.getDate() === v.getDate(), ue = (s, v, l) => !v || !l ? !1 : s >= v && s <= l, te = (s) => {
|
|
1638
|
+
const v = O(s);
|
|
1639
1639
|
if (!(v != null && v.startDate) || !(v != null && v.endDate))
|
|
1640
1640
|
return -1;
|
|
1641
1641
|
for (let l = 0; l < t.shortcuts.length; l++) {
|
|
@@ -1709,7 +1709,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1709
1709
|
ze.push(S.slice(ne, ne + 7));
|
|
1710
1710
|
return ze;
|
|
1711
1711
|
}, pe = (s) => {
|
|
1712
|
-
const v =
|
|
1712
|
+
const v = q(s);
|
|
1713
1713
|
n("update:modelValue", v), n("change", v);
|
|
1714
1714
|
}, ye = () => {
|
|
1715
1715
|
if (!C.value || !T.value) return;
|
|
@@ -1719,8 +1719,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1719
1719
|
H < j ? k.value.left = !1 : k.value.left = !0;
|
|
1720
1720
|
}, V = () => {
|
|
1721
1721
|
if (m.value = !m.value, m.value) {
|
|
1722
|
-
const s =
|
|
1723
|
-
if (
|
|
1722
|
+
const s = O(t.modelValue);
|
|
1723
|
+
if (A.value = (s == null ? void 0 : s.startDate) || null, D.value = (s == null ? void 0 : s.endDate) || null, y.value = te(t.modelValue), p.value = -1, s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1724
1724
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1725
1725
|
else {
|
|
1726
1726
|
const v = new Date(w.value.year, w.value.month + 1);
|
|
@@ -1730,68 +1730,68 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1730
1730
|
ye();
|
|
1731
1731
|
});
|
|
1732
1732
|
}
|
|
1733
|
-
},
|
|
1733
|
+
}, Q = (s) => {
|
|
1734
1734
|
const v = s.target, l = C.value, c = T.value;
|
|
1735
|
-
l && c && !l.contains(v) && !c.contains(v) && (m.value = !1,
|
|
1735
|
+
l && c && !l.contains(v) && !c.contains(v) && (m.value = !1, p.value = -1);
|
|
1736
1736
|
}, d = (s) => {
|
|
1737
1737
|
s.key === "Enter" || s.key === " " ? (s.preventDefault(), V()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0, le(() => {
|
|
1738
1738
|
ye(), b();
|
|
1739
1739
|
}));
|
|
1740
1740
|
}, h = (s) => {
|
|
1741
1741
|
var v;
|
|
1742
|
-
s.key === "Escape" && (m.value = !1,
|
|
1742
|
+
s.key === "Escape" && (m.value = !1, p.value = -1, (v = C.value) == null || v.focus());
|
|
1743
1743
|
}, a = (s, v) => {
|
|
1744
|
-
s.key === "ArrowDown" ? (s.preventDefault(),
|
|
1744
|
+
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1), L(p.value)) : s.key === "ArrowUp" ? (s.preventDefault(), p.value = Math.max(v - 1, 0), L(p.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), U(t.shortcuts[v]));
|
|
1745
1745
|
}, r = (s) => {
|
|
1746
|
-
|
|
1746
|
+
p.value = s;
|
|
1747
1747
|
}, f = () => {
|
|
1748
|
-
|
|
1748
|
+
p.value = -1;
|
|
1749
1749
|
}, b = () => {
|
|
1750
|
-
|
|
1750
|
+
p.value = 0, L(0);
|
|
1751
1751
|
}, L = (s) => {
|
|
1752
1752
|
if (T.value) {
|
|
1753
1753
|
const l = T.value.querySelectorAll(".nh-time-shortcut")[s];
|
|
1754
1754
|
l && l.focus();
|
|
1755
1755
|
}
|
|
1756
|
-
},
|
|
1756
|
+
}, U = (s) => {
|
|
1757
1757
|
const v = s.getValue();
|
|
1758
|
-
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), pe(v),
|
|
1759
|
-
},
|
|
1758
|
+
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), pe(v), y.value = t.shortcuts.findIndex((l) => l.label === s.label), p.value = -1, m.value = !1;
|
|
1759
|
+
}, R = (s, v) => {
|
|
1760
1760
|
if (!s || s.isDisabled) return;
|
|
1761
1761
|
let l;
|
|
1762
|
-
if (t.includeTime ? (l = new Date(s.date), v === "start" || !
|
|
1763
|
-
|
|
1764
|
-
else if (
|
|
1765
|
-
if (l >=
|
|
1762
|
+
if (t.includeTime ? (l = new Date(s.date), v === "start" || !A.value ? l.setHours(0, 0, 0, 0) : l.setHours(23, 59, 59, 999)) : l = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !A.value && !D.value)
|
|
1763
|
+
A.value = l, D.value = null;
|
|
1764
|
+
else if (A.value && !D.value)
|
|
1765
|
+
if (l >= A.value)
|
|
1766
1766
|
t.includeTime && l.setHours(23, 59, 59, 999), D.value = l;
|
|
1767
1767
|
else {
|
|
1768
|
-
const c =
|
|
1769
|
-
t.includeTime && c.setHours(23, 59, 59, 999), D.value = c,
|
|
1768
|
+
const c = A.value;
|
|
1769
|
+
t.includeTime && c.setHours(23, 59, 59, 999), D.value = c, A.value = l;
|
|
1770
1770
|
}
|
|
1771
1771
|
else
|
|
1772
|
-
|
|
1773
|
-
if (
|
|
1772
|
+
A.value = l, D.value = null;
|
|
1773
|
+
if (y.value = -1, A.value && D.value) {
|
|
1774
1774
|
const c = new Date(D.value);
|
|
1775
1775
|
t.includeTime && c.setHours(23, 59, 59, 999), I.value = {
|
|
1776
|
-
startDate:
|
|
1776
|
+
startDate: A.value,
|
|
1777
1777
|
endDate: c
|
|
1778
1778
|
};
|
|
1779
1779
|
} else
|
|
1780
1780
|
I.value = null;
|
|
1781
|
-
},
|
|
1781
|
+
}, P = (s, v) => {
|
|
1782
1782
|
if (!s) return ["nh-date-table-td"];
|
|
1783
1783
|
const l = ["nh-date-table-td"];
|
|
1784
|
-
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"),
|
|
1784
|
+
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), A.value && ie(s.date, A.value) && l.push("is-selected", "is-start"), D.value && ie(s.date, D.value) && l.push("is-selected", "is-end"), A.value && D.value && ue(s.date, A.value, D.value) && l.push("is-in-range"), l;
|
|
1785
1785
|
}, we = () => {
|
|
1786
|
-
I.value && (t.includeTime && I.value.endDate && I.value.endDate.setHours(23, 59, 59, 999), pe(I.value),
|
|
1786
|
+
I.value && (t.includeTime && I.value.endDate && I.value.endDate.setHours(23, 59, 59, 999), pe(I.value), y.value = te(I.value), m.value = !1);
|
|
1787
1787
|
}, De = () => {
|
|
1788
|
-
pe({ startDate: null, endDate: null }),
|
|
1788
|
+
pe({ startDate: null, endDate: null }), Ve(), p.value = -1, m.value = !1;
|
|
1789
1789
|
}, be = () => {
|
|
1790
1790
|
m.value && le(() => {
|
|
1791
1791
|
ye();
|
|
1792
1792
|
});
|
|
1793
|
-
}, Le =
|
|
1794
|
-
const s =
|
|
1793
|
+
}, Le = N(() => ve(w.value.year, w.value.month)), Ie = N(() => ve(g.value.year, g.value.month)), Pe = N(() => {
|
|
1794
|
+
const s = O(t.modelValue);
|
|
1795
1795
|
if (!s || !s.startDate || !s.endDate)
|
|
1796
1796
|
return "";
|
|
1797
1797
|
const v = (_) => {
|
|
@@ -1799,20 +1799,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1799
1799
|
return `${M}/${S}/${H}`;
|
|
1800
1800
|
}, l = v(s.startDate), c = v(s.endDate);
|
|
1801
1801
|
return !t.includeTime && l === c ? l : `${l} - ${c}`;
|
|
1802
|
-
}), We =
|
|
1802
|
+
}), We = N(() => [
|
|
1803
1803
|
"nh-time-dropdown",
|
|
1804
1804
|
{
|
|
1805
1805
|
"nh-time-dropdown-top": !k.value.top,
|
|
1806
1806
|
"nh-time-dropdown-right": !k.value.left
|
|
1807
1807
|
}
|
|
1808
|
-
]), Re =
|
|
1809
|
-
const s =
|
|
1808
|
+
]), Re = N(() => {
|
|
1809
|
+
const s = O(t.modelValue);
|
|
1810
1810
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1811
|
-
}),
|
|
1812
|
-
|
|
1811
|
+
}), Ye = N(() => !!(A.value && D.value)), Ve = () => {
|
|
1812
|
+
A.value = null, D.value = null, I.value = null, y.value = -1;
|
|
1813
1813
|
};
|
|
1814
1814
|
ee(() => t.modelValue, (s) => {
|
|
1815
|
-
const v =
|
|
1815
|
+
const v = O(s);
|
|
1816
1816
|
if (v != null && v.startDate) {
|
|
1817
1817
|
const l = v.startDate;
|
|
1818
1818
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
@@ -1824,7 +1824,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1824
1824
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1825
1825
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1826
1826
|
}
|
|
1827
|
-
(v != null && v.startDate || v != null && v.endDate) && x(), m.value || (
|
|
1827
|
+
(v != null && v.startDate || v != null && v.endDate) && x(), m.value || (y.value = te(s));
|
|
1828
1828
|
}, { immediate: !0, deep: !0 }), ee([w, g], () => {
|
|
1829
1829
|
const s = new Date(w.value.year, w.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1830
1830
|
if (s === v) {
|
|
@@ -1832,8 +1832,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1832
1832
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1833
1833
|
}
|
|
1834
1834
|
}, { deep: !0 }), Ce(() => {
|
|
1835
|
-
document.addEventListener("click",
|
|
1836
|
-
const s =
|
|
1835
|
+
document.addEventListener("click", Q), window.addEventListener("resize", be), window.addEventListener("scroll", be), y.value = te(t.modelValue);
|
|
1836
|
+
const s = O(t.modelValue);
|
|
1837
1837
|
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1838
1838
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1839
1839
|
else {
|
|
@@ -1842,21 +1842,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1842
1842
|
}
|
|
1843
1843
|
x();
|
|
1844
1844
|
}), Ee(() => {
|
|
1845
|
-
document.removeEventListener("click",
|
|
1845
|
+
document.removeEventListener("click", Q), window.removeEventListener("resize", be), window.removeEventListener("scroll", be);
|
|
1846
1846
|
});
|
|
1847
1847
|
const He = () => {
|
|
1848
|
-
t.clearable && (pe({ startDate: null, endDate: null }),
|
|
1848
|
+
t.clearable && (pe({ startDate: null, endDate: null }), Ve(), p.value = -1);
|
|
1849
1849
|
}, Te = (s, v) => {
|
|
1850
1850
|
if (s === "start") {
|
|
1851
1851
|
const l = new Date(w.value.year, w.value.month + v, 1);
|
|
1852
1852
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth(), x();
|
|
1853
1853
|
} else {
|
|
1854
1854
|
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1855
|
-
g.value.year = l.getFullYear(), g.value.month = l.getMonth(),
|
|
1855
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), Y();
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
1858
1858
|
return (s, v) => {
|
|
1859
|
-
const l =
|
|
1859
|
+
const l = Ae("YButton");
|
|
1860
1860
|
return i(), u("div", {
|
|
1861
1861
|
class: E(["nh-time-search", [`nh-time--${e.size}`]])
|
|
1862
1862
|
}, [
|
|
@@ -1871,14 +1871,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1871
1871
|
}, [
|
|
1872
1872
|
o("input", {
|
|
1873
1873
|
readonly: "",
|
|
1874
|
-
value:
|
|
1874
|
+
value: Pe.value,
|
|
1875
1875
|
placeholder: e.placeholder,
|
|
1876
1876
|
class: "nh-time-input"
|
|
1877
1877
|
}, null, 8, Dn),
|
|
1878
1878
|
o("span", _n, [
|
|
1879
1879
|
e.clearable && Re.value ? (i(), u("i", {
|
|
1880
1880
|
key: 0,
|
|
1881
|
-
onClick:
|
|
1881
|
+
onClick: J(He, ["stop"]),
|
|
1882
1882
|
class: "nh-time-clear"
|
|
1883
1883
|
}, [...v[4] || (v[4] = [
|
|
1884
1884
|
o("svg", {
|
|
@@ -1934,15 +1934,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1934
1934
|
o("ul", Mn, [
|
|
1935
1935
|
(i(!0), u(oe, null, ce(e.shortcuts, (c, _) => (i(), u("li", {
|
|
1936
1936
|
key: c.label,
|
|
1937
|
-
onClick: (M) =>
|
|
1937
|
+
onClick: (M) => U(c),
|
|
1938
1938
|
onKeydown: (M) => a(M, _),
|
|
1939
1939
|
onMouseenter: (M) => r(_),
|
|
1940
1940
|
onMouseleave: f,
|
|
1941
1941
|
class: E([
|
|
1942
1942
|
"nh-time-shortcut",
|
|
1943
1943
|
{
|
|
1944
|
-
"is-active":
|
|
1945
|
-
"is-selected":
|
|
1944
|
+
"is-active": p.value === _,
|
|
1945
|
+
"is-selected": y.value === _
|
|
1946
1946
|
}
|
|
1947
1947
|
]),
|
|
1948
1948
|
tabindex: "0"
|
|
@@ -1953,13 +1953,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1953
1953
|
o("div", Bn, [
|
|
1954
1954
|
v[8] || (v[8] = o("span", null, "自定义时间", -1)),
|
|
1955
1955
|
o("div", En, [
|
|
1956
|
-
!
|
|
1956
|
+
!A.value && !D.value ? (i(), u("span", Tn, " 请选择开始日期 ")) : A.value && !D.value ? (i(), u("span", zn, " 请选择结束日期 ")) : A.value && D.value ? (i(), u("span", Kn, " 已选择完整范围 ")) : W("", !0)
|
|
1957
1957
|
])
|
|
1958
1958
|
]),
|
|
1959
1959
|
o("div", Hn, [
|
|
1960
1960
|
o("div", Wn, [
|
|
1961
1961
|
o("div", Rn, [
|
|
1962
|
-
o("div",
|
|
1962
|
+
o("div", Vn, [
|
|
1963
1963
|
o("button", {
|
|
1964
1964
|
onClick: v[0] || (v[0] = (c) => Te("start", -1)),
|
|
1965
1965
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
@@ -1976,7 +1976,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1976
1976
|
})
|
|
1977
1977
|
], -1)
|
|
1978
1978
|
])]),
|
|
1979
|
-
o("span",
|
|
1979
|
+
o("span", An, G(Z(w.value.year, w.value.month)), 1),
|
|
1980
1980
|
o("button", {
|
|
1981
1981
|
onClick: v[1] || (v[1] = (c) => Te("start", 1)),
|
|
1982
1982
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -1995,10 +1995,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1995
1995
|
])])
|
|
1996
1996
|
]),
|
|
1997
1997
|
o("div", Fn, [
|
|
1998
|
-
o("table",
|
|
1998
|
+
o("table", Pn, [
|
|
1999
1999
|
o("thead", null, [
|
|
2000
2000
|
o("tr", null, [
|
|
2001
|
-
(i(), u(oe, null, ce(
|
|
2001
|
+
(i(), u(oe, null, ce(X, (c) => o("th", {
|
|
2002
2002
|
key: c,
|
|
2003
2003
|
class: "nh-date-table-th"
|
|
2004
2004
|
}, G(c), 1)), 64))
|
|
@@ -2010,13 +2010,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2010
2010
|
}, [
|
|
2011
2011
|
(i(!0), u(oe, null, ce(c, (M, S) => (i(), u("td", {
|
|
2012
2012
|
key: `start-day-${_}-${S}`,
|
|
2013
|
-
class: E(
|
|
2014
|
-
onClick: (H) =>
|
|
2013
|
+
class: E(P(M)),
|
|
2014
|
+
onClick: (H) => R(M, "start")
|
|
2015
2015
|
}, [
|
|
2016
2016
|
o("div", Nn, [
|
|
2017
2017
|
M ? (i(), u("span", On, G(M.day), 1)) : W("", !0)
|
|
2018
2018
|
])
|
|
2019
|
-
], 10,
|
|
2019
|
+
], 10, Yn))), 128))
|
|
2020
2020
|
]))), 128))
|
|
2021
2021
|
])
|
|
2022
2022
|
])
|
|
@@ -2042,7 +2042,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2042
2042
|
})
|
|
2043
2043
|
], -1)
|
|
2044
2044
|
])]),
|
|
2045
|
-
o("span", Zn, G(
|
|
2045
|
+
o("span", Zn, G(Z(g.value.year, g.value.month)), 1),
|
|
2046
2046
|
o("button", {
|
|
2047
2047
|
onClick: v[3] || (v[3] = (c) => Te("end", 1)),
|
|
2048
2048
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2064,7 +2064,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2064
2064
|
o("table", Jn, [
|
|
2065
2065
|
o("thead", null, [
|
|
2066
2066
|
o("tr", null, [
|
|
2067
|
-
(i(), u(oe, null, ce(
|
|
2067
|
+
(i(), u(oe, null, ce(X, (c) => o("th", {
|
|
2068
2068
|
key: c,
|
|
2069
2069
|
class: "nh-date-table-th"
|
|
2070
2070
|
}, G(c), 1)), 64))
|
|
@@ -2076,8 +2076,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2076
2076
|
}, [
|
|
2077
2077
|
(i(!0), u(oe, null, ce(c, (M, S) => (i(), u("td", {
|
|
2078
2078
|
key: `end-day-${_}-${S}`,
|
|
2079
|
-
class: E(
|
|
2080
|
-
onClick: (H) =>
|
|
2079
|
+
class: E(P(M)),
|
|
2080
|
+
onClick: (H) => R(M, "end")
|
|
2081
2081
|
}, [
|
|
2082
2082
|
o("div", Gn, [
|
|
2083
2083
|
M ? (i(), u("span", el, G(M.day), 1)) : W("", !0)
|
|
@@ -2104,12 +2104,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2104
2104
|
}, 8, ["size"])) : W("", !0),
|
|
2105
2105
|
se(l, {
|
|
2106
2106
|
onClick: we,
|
|
2107
|
-
disabled: !
|
|
2107
|
+
disabled: !Ye.value,
|
|
2108
2108
|
variant: "primary",
|
|
2109
2109
|
size: e.size
|
|
2110
2110
|
}, {
|
|
2111
2111
|
default: re(() => [
|
|
2112
|
-
$e(G(
|
|
2112
|
+
$e(G(A.value && !D.value ? "继续选择结束日期" : "确认"), 1)
|
|
2113
2113
|
]),
|
|
2114
2114
|
_: 1
|
|
2115
2115
|
}, 8, ["disabled", "size"])
|
|
@@ -2144,13 +2144,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2144
2144
|
},
|
|
2145
2145
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2146
2146
|
setup(e, { emit: $ }) {
|
|
2147
|
-
const t = e, n = $, m = K(),
|
|
2147
|
+
const t = e, n = $, m = K(), p = N(() => t.modelValue === t.trueValue), y = N(() => {
|
|
2148
2148
|
const C = {};
|
|
2149
|
-
return C.background =
|
|
2149
|
+
return C.background = p.value ? t.activeColor : t.inactiveColor, C;
|
|
2150
2150
|
});
|
|
2151
2151
|
function I() {
|
|
2152
2152
|
if (t.disabled || t.loading) return;
|
|
2153
|
-
const C =
|
|
2153
|
+
const C = p.value ? t.falseValue : t.trueValue;
|
|
2154
2154
|
n("update:modelValue", C), n("change", C);
|
|
2155
2155
|
}
|
|
2156
2156
|
return Ce(() => {
|
|
@@ -2161,17 +2161,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2161
2161
|
ref: m,
|
|
2162
2162
|
class: E(["yswitch", [
|
|
2163
2163
|
`yswitch--${e.size}`,
|
|
2164
|
-
{ "yswitch--checked":
|
|
2164
|
+
{ "yswitch--checked": p.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2165
2165
|
]]),
|
|
2166
|
-
style: fe(
|
|
2166
|
+
style: fe(y.value),
|
|
2167
2167
|
role: "switch",
|
|
2168
|
-
"aria-checked":
|
|
2168
|
+
"aria-checked": p.value,
|
|
2169
2169
|
"aria-disabled": e.disabled,
|
|
2170
2170
|
disabled: e.disabled || e.loading,
|
|
2171
2171
|
onClick: I,
|
|
2172
2172
|
onKeydown: [
|
|
2173
|
-
ke(
|
|
2174
|
-
ke(
|
|
2173
|
+
ke(J(I, ["prevent"]), ["enter"]),
|
|
2174
|
+
ke(J(I, ["prevent"]), ["space"])
|
|
2175
2175
|
]
|
|
2176
2176
|
}, [
|
|
2177
2177
|
T[0] || (T[0] = o("span", { class: "yswitch__track" }, null, -1)),
|
|
@@ -2180,8 +2180,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2180
2180
|
]),
|
|
2181
2181
|
e.showText ? (i(), u("span", {
|
|
2182
2182
|
key: 0,
|
|
2183
|
-
class: E(["yswitch__label", { "yswitch__label--left": !
|
|
2184
|
-
}, G(
|
|
2183
|
+
class: E(["yswitch__label", { "yswitch__label--left": !p.value, "yswitch__label--right": p.value }])
|
|
2184
|
+
}, G(p.value ? e.activeText : e.inactiveText), 3)) : W("", !0)
|
|
2185
2185
|
], 46, ll));
|
|
2186
2186
|
}
|
|
2187
2187
|
}), il = /* @__PURE__ */ me(sl, [["__scopeId", "data-v-0b157fc4"]]), rl = ["src", "alt"], ul = ["src", "alt"], cl = /* @__PURE__ */ ge({
|
|
@@ -2200,122 +2200,122 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2200
2200
|
},
|
|
2201
2201
|
emits: ["load", "error", "preview"],
|
|
2202
2202
|
setup(e, { expose: $, emit: t }) {
|
|
2203
|
-
const n = e, m = t,
|
|
2203
|
+
const n = e, m = t, p = K(), y = K(), I = K(), C = K(!1), T = K(!1), k = K(!1), w = K(!1), g = K(!1), x = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), Y = K(""), X = K(1), A = K(!1), D = K({
|
|
2204
2204
|
overflow: "",
|
|
2205
2205
|
paddingRight: ""
|
|
2206
|
-
}), z =
|
|
2206
|
+
}), z = N(() => [
|
|
2207
2207
|
n.className,
|
|
2208
2208
|
"overflow-hidden"
|
|
2209
|
-
].filter(Boolean).join(" ")), B =
|
|
2209
|
+
].filter(Boolean).join(" ")), B = N(() => [
|
|
2210
2210
|
ie(),
|
|
2211
2211
|
te()
|
|
2212
|
-
].filter(Boolean).join(" ")),
|
|
2212
|
+
].filter(Boolean).join(" ")), F = N(() => [
|
|
2213
2213
|
"w-full h-full bg-white",
|
|
2214
2214
|
ue(),
|
|
2215
2215
|
te(),
|
|
2216
2216
|
n.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2217
|
-
].filter(Boolean).join(" ")),
|
|
2217
|
+
].filter(Boolean).join(" ")), O = N(() => [
|
|
2218
2218
|
ie(),
|
|
2219
2219
|
te()
|
|
2220
|
-
].filter(Boolean).join(" ")),
|
|
2221
|
-
const
|
|
2222
|
-
return n.width && (
|
|
2223
|
-
}),
|
|
2220
|
+
].filter(Boolean).join(" ")), q = N(() => {
|
|
2221
|
+
const R = {};
|
|
2222
|
+
return n.width && (R.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (R.height = typeof n.height == "number" ? `${n.height}px` : n.height), R;
|
|
2223
|
+
}), Z = N(() => Y.value ? Y.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), ie = () => n.width && n.height ? "" : "w-full h-full", ue = () => ({
|
|
2224
2224
|
cover: "object-cover",
|
|
2225
2225
|
contain: "object-contain",
|
|
2226
2226
|
fill: "object-fill",
|
|
2227
2227
|
none: "object-none",
|
|
2228
2228
|
"scale-down": "object-scale-down"
|
|
2229
2229
|
})[n.fit] || "object-cover", te = () => typeof n.radius == "number" ? `rounded-${n.radius}` : typeof n.radius == "string" ? n.radius.includes("px") ? "" : `rounded-${n.radius}` : "", ve = () => {
|
|
2230
|
-
const
|
|
2231
|
-
|
|
2232
|
-
const
|
|
2233
|
-
return document.body.removeChild(
|
|
2230
|
+
const R = document.createElement("div");
|
|
2231
|
+
R.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(R);
|
|
2232
|
+
const P = R.offsetWidth - R.clientWidth;
|
|
2233
|
+
return document.body.removeChild(R), P;
|
|
2234
2234
|
}, pe = () => {
|
|
2235
2235
|
if (D.value = {
|
|
2236
2236
|
overflow: document.body.style.overflow || "",
|
|
2237
2237
|
paddingRight: document.body.style.paddingRight || ""
|
|
2238
2238
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2239
|
-
const
|
|
2240
|
-
document.body.style.paddingRight = `${
|
|
2239
|
+
const P = ve();
|
|
2240
|
+
document.body.style.paddingRight = `${P}px`;
|
|
2241
2241
|
}
|
|
2242
2242
|
document.body.style.overflow = "hidden";
|
|
2243
2243
|
}, ye = () => {
|
|
2244
2244
|
document.body.style.overflow = D.value.overflow, document.body.style.paddingRight = D.value.paddingRight;
|
|
2245
2245
|
};
|
|
2246
2246
|
let V = null;
|
|
2247
|
-
const
|
|
2248
|
-
!n.lazy || !
|
|
2249
|
-
(
|
|
2250
|
-
|
|
2251
|
-
|
|
2247
|
+
const Q = () => {
|
|
2248
|
+
!n.lazy || !p.value || (V = new IntersectionObserver(
|
|
2249
|
+
(R) => {
|
|
2250
|
+
R.forEach((P) => {
|
|
2251
|
+
P.isIntersecting && (w.value = !0, x.value = n.src, V == null || V.unobserve(P.target));
|
|
2252
2252
|
});
|
|
2253
2253
|
},
|
|
2254
2254
|
{
|
|
2255
2255
|
rootMargin: "50px"
|
|
2256
2256
|
}
|
|
2257
|
-
), V.observe(
|
|
2258
|
-
}, d = (
|
|
2259
|
-
C.value = !0, T.value = !1, k.value = !1, m("load",
|
|
2260
|
-
}, h = (
|
|
2261
|
-
k.value = !0, T.value = !1, C.value = !1, m("error",
|
|
2257
|
+
), V.observe(p.value));
|
|
2258
|
+
}, d = (R) => {
|
|
2259
|
+
C.value = !0, T.value = !1, k.value = !1, m("load", R);
|
|
2260
|
+
}, h = (R) => {
|
|
2261
|
+
k.value = !0, T.value = !1, C.value = !1, m("error", R);
|
|
2262
2262
|
}, a = () => {
|
|
2263
2263
|
k.value = !1, T.value = !0, C.value = !1, le(() => {
|
|
2264
|
-
|
|
2264
|
+
y.value && (y.value.src = n.src);
|
|
2265
2265
|
});
|
|
2266
2266
|
}, r = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, f = () => {
|
|
2267
2267
|
if (!n.preview || k.value) return;
|
|
2268
|
-
|
|
2269
|
-
const
|
|
2270
|
-
if (
|
|
2271
|
-
|
|
2272
|
-
g.value = !0, pe(), m("preview",
|
|
2268
|
+
X.value = 1;
|
|
2269
|
+
const R = r();
|
|
2270
|
+
if (y.value && y.value.complete && y.value.naturalWidth > 0) {
|
|
2271
|
+
Y.value = R, le(() => {
|
|
2272
|
+
g.value = !0, pe(), m("preview", R);
|
|
2273
2273
|
});
|
|
2274
2274
|
return;
|
|
2275
2275
|
}
|
|
2276
|
-
const
|
|
2276
|
+
const P = new Image();
|
|
2277
2277
|
let we = null, De = !1;
|
|
2278
2278
|
const be = () => {
|
|
2279
|
-
De || (De = !0, we && (clearTimeout(we), we = null),
|
|
2280
|
-
g.value = !0, pe(), m("preview",
|
|
2279
|
+
De || (De = !0, we && (clearTimeout(we), we = null), Y.value = R, le(() => {
|
|
2280
|
+
g.value = !0, pe(), m("preview", R);
|
|
2281
2281
|
}));
|
|
2282
2282
|
};
|
|
2283
2283
|
we = setTimeout(() => {
|
|
2284
2284
|
be();
|
|
2285
|
-
}, 500),
|
|
2285
|
+
}, 500), P.onload = () => {
|
|
2286
2286
|
be();
|
|
2287
|
-
},
|
|
2287
|
+
}, P.onerror = () => {
|
|
2288
2288
|
be();
|
|
2289
|
-
},
|
|
2289
|
+
}, P.src = R, P.complete && be();
|
|
2290
2290
|
}, b = () => {
|
|
2291
2291
|
g.value = !1, setTimeout(() => {
|
|
2292
2292
|
ye();
|
|
2293
2293
|
}, 300);
|
|
2294
|
-
}, L = (
|
|
2295
|
-
const
|
|
2296
|
-
let De =
|
|
2297
|
-
De = Math.max(0.5, Math.min(2, De)),
|
|
2294
|
+
}, L = (R) => {
|
|
2295
|
+
const P = R.deltaY < 0 ? 1 : -1;
|
|
2296
|
+
let De = X.value + P * 0.1;
|
|
2297
|
+
De = Math.max(0.5, Math.min(2, De)), X.value = De;
|
|
2298
2298
|
};
|
|
2299
2299
|
return Ce(() => {
|
|
2300
|
-
n.lazy ?
|
|
2300
|
+
n.lazy ? Q() : w.value = !0, w.value && (T.value = !0), A.value = !0;
|
|
2301
2301
|
}), Ee(() => {
|
|
2302
2302
|
V && V.disconnect(), g.value && ye();
|
|
2303
2303
|
}), ee(() => x.value, () => {
|
|
2304
2304
|
n.src && w.value && (T.value = !0, k.value = !1, C.value = !1);
|
|
2305
|
-
}), ee(() => n.src, (
|
|
2306
|
-
x.value =
|
|
2305
|
+
}), ee(() => n.src, (R) => {
|
|
2306
|
+
x.value = R || "";
|
|
2307
2307
|
}), $({
|
|
2308
2308
|
retryLoad: a,
|
|
2309
2309
|
closePreview: b
|
|
2310
|
-
}), (
|
|
2310
|
+
}), (R, P) => (i(), u("div", {
|
|
2311
2311
|
ref_key: "containerRef",
|
|
2312
|
-
ref:
|
|
2312
|
+
ref: p,
|
|
2313
2313
|
class: E(["relative inline-block", z.value])
|
|
2314
2314
|
}, [
|
|
2315
2315
|
!C.value && !k.value && !w.value ? (i(), u("div", {
|
|
2316
2316
|
key: 0,
|
|
2317
2317
|
class: E(["bg-gray-200 animate-pulse rounded", B.value])
|
|
2318
|
-
}, [...
|
|
2318
|
+
}, [...P[1] || (P[1] = [
|
|
2319
2319
|
o("div", { class: "flex items-center justify-center h-full" }, [
|
|
2320
2320
|
o("svg", {
|
|
2321
2321
|
class: "w-6 h-6 text-gray-400",
|
|
@@ -2334,15 +2334,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2334
2334
|
])], 2)) : W("", !0),
|
|
2335
2335
|
T.value && !k.value ? (i(), u("div", {
|
|
2336
2336
|
key: 1,
|
|
2337
|
-
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none",
|
|
2338
|
-
}, [...
|
|
2337
|
+
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none", F.value])
|
|
2338
|
+
}, [...P[2] || (P[2] = [
|
|
2339
2339
|
o("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2340
2340
|
o("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
2341
2341
|
], -1)
|
|
2342
2342
|
])], 2)) : W("", !0),
|
|
2343
2343
|
k.value ? (i(), u("div", {
|
|
2344
2344
|
key: 2,
|
|
2345
|
-
class: E(["bg-gray-100 rounded flex items-center justify-center",
|
|
2345
|
+
class: E(["bg-gray-100 rounded flex items-center justify-center", O.value]),
|
|
2346
2346
|
onClick: a
|
|
2347
2347
|
}, [
|
|
2348
2348
|
o("img", {
|
|
@@ -2353,23 +2353,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2353
2353
|
], 2)) : W("", !0),
|
|
2354
2354
|
Be(o("img", {
|
|
2355
2355
|
ref_key: "imageRef",
|
|
2356
|
-
ref:
|
|
2356
|
+
ref: y,
|
|
2357
2357
|
src: x.value,
|
|
2358
2358
|
alt: e.alt,
|
|
2359
|
-
class: E(
|
|
2359
|
+
class: E(F.value),
|
|
2360
2360
|
onLoad: d,
|
|
2361
2361
|
onError: h,
|
|
2362
|
-
onClick:
|
|
2363
|
-
style: fe(
|
|
2362
|
+
onClick: J(f, ["stop"]),
|
|
2363
|
+
style: fe(q.value)
|
|
2364
2364
|
}, null, 46, rl), [
|
|
2365
2365
|
[Ke, C.value && !k.value]
|
|
2366
2366
|
]),
|
|
2367
2367
|
n.preview && w.value && !k.value && (!C.value || T.value) ? (i(), u("div", {
|
|
2368
2368
|
key: 3,
|
|
2369
2369
|
class: "absolute inset-0 cursor-pointer z-10",
|
|
2370
|
-
onClick:
|
|
2370
|
+
onClick: J(f, ["stop"])
|
|
2371
2371
|
})) : W("", !0),
|
|
2372
|
-
|
|
2372
|
+
A.value ? (i(), Me(Fe, {
|
|
2373
2373
|
key: 4,
|
|
2374
2374
|
to: "body"
|
|
2375
2375
|
}, [
|
|
@@ -2379,8 +2379,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2379
2379
|
key: 0,
|
|
2380
2380
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2381
2381
|
style: { "z-index": "99999" },
|
|
2382
|
-
onClick:
|
|
2383
|
-
onWheel:
|
|
2382
|
+
onClick: J(b, ["self"]),
|
|
2383
|
+
onWheel: J(L, ["prevent"])
|
|
2384
2384
|
}, [
|
|
2385
2385
|
o("div", {
|
|
2386
2386
|
class: E(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": g.value, "scale-95": !g.value }])
|
|
@@ -2388,11 +2388,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2388
2388
|
o("img", {
|
|
2389
2389
|
ref_key: "previewImageRef",
|
|
2390
2390
|
ref: I,
|
|
2391
|
-
src:
|
|
2391
|
+
src: Z.value,
|
|
2392
2392
|
alt: e.alt,
|
|
2393
2393
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2394
|
-
style: fe({ transform: `scale(${
|
|
2395
|
-
onClick:
|
|
2394
|
+
style: fe({ transform: `scale(${X.value})` }),
|
|
2395
|
+
onClick: P[0] || (P[0] = J(() => {
|
|
2396
2396
|
}, ["stop"]))
|
|
2397
2397
|
}, null, 12, ul)
|
|
2398
2398
|
], 2)
|
|
@@ -2414,7 +2414,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2414
2414
|
setup(e) {
|
|
2415
2415
|
const $ = e, t = K(!1), n = K();
|
|
2416
2416
|
let m = null;
|
|
2417
|
-
const
|
|
2417
|
+
const p = N(() => `y-dropdown__menu--${$.placement}`), y = N(() => {
|
|
2418
2418
|
if (!$.menuWidth) return {};
|
|
2419
2419
|
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2420
2420
|
return {
|
|
@@ -2434,33 +2434,33 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2434
2434
|
if (!n.value) return;
|
|
2435
2435
|
const g = n.value.querySelector(".y-dropdown__trigger"), x = n.value.querySelector(".y-dropdown__menu");
|
|
2436
2436
|
if (!g || !x) return;
|
|
2437
|
-
const
|
|
2437
|
+
const Y = g.getBoundingClientRect(), X = x.getBoundingClientRect(), A = window.innerWidth, D = window.innerHeight;
|
|
2438
2438
|
x.style.top = "", x.style.left = "", x.style.right = "", x.style.bottom = "", x.style.transform = "";
|
|
2439
2439
|
let z = 0, B = 0;
|
|
2440
2440
|
switch ($.placement) {
|
|
2441
2441
|
case "bottom":
|
|
2442
|
-
z =
|
|
2442
|
+
z = Y.height + 4, B = 0;
|
|
2443
2443
|
break;
|
|
2444
2444
|
case "top":
|
|
2445
|
-
z = -(
|
|
2445
|
+
z = -(X.height + 4), B = 0;
|
|
2446
2446
|
break;
|
|
2447
2447
|
case "right":
|
|
2448
|
-
z = 0, B =
|
|
2448
|
+
z = 0, B = Y.width + 4;
|
|
2449
2449
|
break;
|
|
2450
2450
|
case "left":
|
|
2451
|
-
z = 0, B = -(
|
|
2451
|
+
z = 0, B = -(X.width + 4);
|
|
2452
2452
|
break;
|
|
2453
2453
|
}
|
|
2454
|
-
let
|
|
2454
|
+
let F = Y.top + z, O = Y.left + B;
|
|
2455
2455
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2456
|
-
const
|
|
2457
|
-
|
|
2456
|
+
const q = X.width || 260;
|
|
2457
|
+
O + q > A - 10 && (O = A - q - 10), O < 10 && (O = 10);
|
|
2458
2458
|
}
|
|
2459
2459
|
if ($.placement === "left" || $.placement === "right") {
|
|
2460
|
-
const
|
|
2461
|
-
|
|
2460
|
+
const q = X.height || 200;
|
|
2461
|
+
F + q > D - 10 && (F = D - q - 10), F < 10 && (F = 10);
|
|
2462
2462
|
}
|
|
2463
|
-
x.style.top = `${
|
|
2463
|
+
x.style.top = `${F}px`, x.style.left = `${O}px`;
|
|
2464
2464
|
}, k = (g) => {
|
|
2465
2465
|
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2466
2466
|
}, w = () => {
|
|
@@ -2497,8 +2497,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2497
2497
|
}, {
|
|
2498
2498
|
default: re(() => [
|
|
2499
2499
|
Be(o("div", {
|
|
2500
|
-
class: E(["y-dropdown__menu",
|
|
2501
|
-
style: fe(
|
|
2500
|
+
class: E(["y-dropdown__menu", p.value]),
|
|
2501
|
+
style: fe(y.value),
|
|
2502
2502
|
onMouseenter: I,
|
|
2503
2503
|
onMouseleave: C
|
|
2504
2504
|
}, [
|
|
@@ -2536,10 +2536,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2536
2536
|
},
|
|
2537
2537
|
emits: ["update:modelValue", "open", "close"],
|
|
2538
2538
|
setup(e, { emit: $ }) {
|
|
2539
|
-
const t = e, n = $, m =
|
|
2539
|
+
const t = e, n = $, m = N({
|
|
2540
2540
|
get: () => t.modelValue,
|
|
2541
2541
|
set: (x) => n("update:modelValue", x)
|
|
2542
|
-
}),
|
|
2542
|
+
}), p = K(null), y = N(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), I = N(() => t.placement === "right" ? "rounded-left" : "rounded-top"), C = N(() => {
|
|
2543
2543
|
const x = {};
|
|
2544
2544
|
return t.placement === "right" ? (x.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), x.height = "100%", x.right = "0", x.top = "0") : (x.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), x.width = "100%", x.bottom = "0", x.left = "0"), x;
|
|
2545
2545
|
});
|
|
@@ -2557,14 +2557,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2557
2557
|
}
|
|
2558
2558
|
return ee(() => t.modelValue, (x) => {
|
|
2559
2559
|
x ? (n("open"), requestAnimationFrame(() => {
|
|
2560
|
-
var
|
|
2561
|
-
return (
|
|
2560
|
+
var Y;
|
|
2561
|
+
return (Y = p.value) == null ? void 0 : Y.focus();
|
|
2562
2562
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2563
2563
|
}), Ce(() => {
|
|
2564
2564
|
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2565
2565
|
}), Ee(() => {
|
|
2566
2566
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2567
|
-
}), (x,
|
|
2567
|
+
}), (x, Y) => (i(), Me(Fe, { to: "body" }, [
|
|
2568
2568
|
Be(o("div", {
|
|
2569
2569
|
class: "y-drawer-root",
|
|
2570
2570
|
role: "dialog",
|
|
@@ -2576,17 +2576,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2576
2576
|
class: "y-drawer-mask",
|
|
2577
2577
|
onClick: T
|
|
2578
2578
|
}),
|
|
2579
|
-
se(xe, { name:
|
|
2579
|
+
se(xe, { name: y.value }, {
|
|
2580
2580
|
default: re(() => [
|
|
2581
2581
|
Be(o("div", {
|
|
2582
2582
|
ref_key: "panelRef",
|
|
2583
|
-
ref:
|
|
2583
|
+
ref: p,
|
|
2584
2584
|
class: E(["y-drawer-panel", [
|
|
2585
2585
|
`is-${e.placement}`,
|
|
2586
2586
|
I.value
|
|
2587
2587
|
]]),
|
|
2588
2588
|
style: fe(C.value),
|
|
2589
|
-
onKeydown: ke(
|
|
2589
|
+
onKeydown: ke(J(w, ["prevent", "stop"]), ["esc"]),
|
|
2590
2590
|
tabindex: "-1"
|
|
2591
2591
|
}, [
|
|
2592
2592
|
e.showHeader ? (i(), u("div", yl, [
|
|
@@ -2649,10 +2649,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2649
2649
|
height: "12",
|
|
2650
2650
|
viewBox: "0 0 12 12",
|
|
2651
2651
|
fill: "none"
|
|
2652
|
-
}, Rl = ["src", "alt"],
|
|
2652
|
+
}, Rl = ["src", "alt"], Vl = { class: "ytree-node__custom-content" }, Al = {
|
|
2653
2653
|
key: 0,
|
|
2654
2654
|
class: "ytree-node__children"
|
|
2655
|
-
}, Fl = ["data-level", "onClick", "onContextmenu"],
|
|
2655
|
+
}, Fl = ["data-level", "onClick", "onContextmenu"], Pl = ["onClick"], Yl = {
|
|
2656
2656
|
key: 1,
|
|
2657
2657
|
class: "w-[16px]"
|
|
2658
2658
|
}, Nl = ["onClick"], Ol = {
|
|
@@ -2752,7 +2752,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2752
2752
|
},
|
|
2753
2753
|
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"],
|
|
2754
2754
|
setup(e, { expose: $, emit: t }) {
|
|
2755
|
-
const n = e, m = t,
|
|
2755
|
+
const n = e, m = t, p = N(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y = K({
|
|
2756
2756
|
currentNode: null,
|
|
2757
2757
|
currentKey: null,
|
|
2758
2758
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2760,8 +2760,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2760
2760
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2761
2761
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2762
2762
|
});
|
|
2763
|
-
ot("treeStore",
|
|
2764
|
-
const I =
|
|
2763
|
+
ot("treeStore", y);
|
|
2764
|
+
const I = N(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2765
2765
|
function C(d) {
|
|
2766
2766
|
return d[n.nodeKey] || d.id || Math.random();
|
|
2767
2767
|
}
|
|
@@ -2776,7 +2776,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2776
2776
|
function w(d, h) {
|
|
2777
2777
|
var L;
|
|
2778
2778
|
const a = n.deptIconUrl || ho, r = n.personIconUrl || po, f = n.buttonIconUrl || "", b = n.childStyleIconUrl || "";
|
|
2779
|
-
return h && b &&
|
|
2779
|
+
return h && b && X(d, h) ? b : (L = d == null ? void 0 : d.data) != null && L.isButton && f ? f : k(d) ? r : a;
|
|
2780
2780
|
}
|
|
2781
2781
|
function g(d) {
|
|
2782
2782
|
var a;
|
|
@@ -2787,27 +2787,27 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2787
2787
|
var h;
|
|
2788
2788
|
return ((h = n.props) != null && h.children ? d[n.props.children] : void 0) || d.children || [];
|
|
2789
2789
|
}
|
|
2790
|
-
function
|
|
2790
|
+
function Y(d, h, a = 1) {
|
|
2791
2791
|
if (d === h)
|
|
2792
2792
|
return a;
|
|
2793
2793
|
const r = x(d);
|
|
2794
2794
|
for (const f of r) {
|
|
2795
|
-
const b =
|
|
2795
|
+
const b = Y(f, h, a + 1);
|
|
2796
2796
|
if (b > 0)
|
|
2797
2797
|
return b;
|
|
2798
2798
|
}
|
|
2799
2799
|
return 0;
|
|
2800
2800
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 :
|
|
2801
|
+
function X(d, h) {
|
|
2802
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : Y(h, d) === n.childStyleLevel;
|
|
2803
2803
|
}
|
|
2804
|
-
function
|
|
2804
|
+
function A(d) {
|
|
2805
2805
|
const h = C(d);
|
|
2806
|
-
return
|
|
2806
|
+
return y.value.expandedKeys.has(h);
|
|
2807
2807
|
}
|
|
2808
2808
|
function D(d) {
|
|
2809
2809
|
const h = C(d);
|
|
2810
|
-
if (
|
|
2810
|
+
if (y.value.checkedKeys.has(h)) {
|
|
2811
2811
|
if (g(d)) {
|
|
2812
2812
|
const r = x(d), f = r.filter((L) => D(L)), b = r.filter(
|
|
2813
2813
|
(L) => z(L)
|
|
@@ -2833,32 +2833,32 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2833
2833
|
}
|
|
2834
2834
|
function B(d) {
|
|
2835
2835
|
const h = C(d);
|
|
2836
|
-
return
|
|
2836
|
+
return y.value.currentKey === h;
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function F(d) {
|
|
2839
2839
|
const h = C(d);
|
|
2840
|
-
return
|
|
2840
|
+
return y.value.highlightedKeys.has(h);
|
|
2841
2841
|
}
|
|
2842
|
-
function
|
|
2842
|
+
function O(d) {
|
|
2843
2843
|
if (n.disabled) return;
|
|
2844
|
-
const h = C(d), r = !
|
|
2845
|
-
r ?
|
|
2846
|
-
function b(L,
|
|
2847
|
-
L.forEach((
|
|
2848
|
-
const
|
|
2849
|
-
|
|
2844
|
+
const h = C(d), r = !y.value.checkedKeys.has(h), f = new Set(y.value.expandedKeys);
|
|
2845
|
+
r ? y.value.checkedKeys.add(h) : y.value.checkedKeys.delete(h);
|
|
2846
|
+
function b(L, U) {
|
|
2847
|
+
L.forEach((R) => {
|
|
2848
|
+
const P = C(R);
|
|
2849
|
+
U ? y.value.checkedKeys.add(P) : y.value.checkedKeys.delete(P), g(R) && b(x(R), U);
|
|
2850
2850
|
});
|
|
2851
2851
|
}
|
|
2852
|
-
b(x(d), r), r &&
|
|
2852
|
+
b(x(d), r), r && q(), ie(), y.value.expandedKeys = f, m("check-change", d, r, !1), m("check", d, r, !1), m("checked-keys-change", Array.from(y.value.checkedKeys));
|
|
2853
2853
|
}
|
|
2854
|
-
function
|
|
2854
|
+
function q(d) {
|
|
2855
2855
|
I.value && console.log(
|
|
2856
2856
|
`已启用从第${I.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2857
2857
|
);
|
|
2858
2858
|
}
|
|
2859
|
-
function
|
|
2859
|
+
function Z(d) {
|
|
2860
2860
|
const h = C(d);
|
|
2861
|
-
|
|
2861
|
+
y.value.expandedKeys.has(h) ? (y.value.expandedKeys.delete(h), m("node-collapse", d, d, null)) : (y.value.expandedKeys.add(h), m("node-expand", d, d, null));
|
|
2862
2862
|
}
|
|
2863
2863
|
function ie() {
|
|
2864
2864
|
const d = [];
|
|
@@ -2867,13 +2867,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2867
2867
|
d.push(f), g(f) && h(x(f));
|
|
2868
2868
|
});
|
|
2869
2869
|
}
|
|
2870
|
-
h(
|
|
2870
|
+
h(p.value);
|
|
2871
2871
|
function a(r) {
|
|
2872
2872
|
if (g(r)) {
|
|
2873
|
-
const f = x(r), b = C(r), L = f.filter((
|
|
2874
|
-
(
|
|
2873
|
+
const f = x(r), b = C(r), L = f.filter((R) => D(R)), U = f.filter(
|
|
2874
|
+
(R) => z(R)
|
|
2875
2875
|
);
|
|
2876
|
-
L.length === f.length &&
|
|
2876
|
+
L.length === f.length && U.length === 0 || L.length > 0 || U.length > 0 ? y.value.checkedKeys.add(b) : y.value.checkedKeys.delete(b);
|
|
2877
2877
|
}
|
|
2878
2878
|
}
|
|
2879
2879
|
for (let r = d.length - 1; r >= 0; r--)
|
|
@@ -2881,16 +2881,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2881
2881
|
}
|
|
2882
2882
|
function ue(d, h, a, r) {
|
|
2883
2883
|
if (n.disabled) return;
|
|
2884
|
-
const f = r ?
|
|
2884
|
+
const f = r ? X(d, r) : !1;
|
|
2885
2885
|
if (n.enableChildStyleCustomClick && f) {
|
|
2886
2886
|
m("child-node-click", d, h, a);
|
|
2887
2887
|
return;
|
|
2888
2888
|
}
|
|
2889
2889
|
if (n.expandOnClickNode && g(d)) {
|
|
2890
|
-
|
|
2890
|
+
Z(d);
|
|
2891
2891
|
return;
|
|
2892
2892
|
}
|
|
2893
|
-
|
|
2893
|
+
y.value.currentNode = d, y.value.currentKey = C(d), n.showCheckbox && O(d), m("node-click", d, h, a);
|
|
2894
2894
|
}
|
|
2895
2895
|
function te(d, h, a, r) {
|
|
2896
2896
|
n.disabled || m("node-contextmenu", d, h, a, r);
|
|
@@ -2901,29 +2901,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2901
2901
|
if (d) {
|
|
2902
2902
|
const h = I.value;
|
|
2903
2903
|
if (h) {
|
|
2904
|
-
let a = function(L,
|
|
2905
|
-
for (const
|
|
2906
|
-
if (C(
|
|
2907
|
-
if (g(
|
|
2908
|
-
const we = a(L, x(
|
|
2904
|
+
let a = function(L, U, R = 1) {
|
|
2905
|
+
for (const P of U) {
|
|
2906
|
+
if (C(P) === L) return R;
|
|
2907
|
+
if (g(P)) {
|
|
2908
|
+
const we = a(L, x(P), R + 1);
|
|
2909
2909
|
if (we > 0) return we;
|
|
2910
2910
|
}
|
|
2911
2911
|
}
|
|
2912
2912
|
return 0;
|
|
2913
|
-
}, r = function(L,
|
|
2914
|
-
L.forEach((
|
|
2915
|
-
|
|
2913
|
+
}, r = function(L, U, R) {
|
|
2914
|
+
L.forEach((P) => {
|
|
2915
|
+
U < R && g(P) ? (b.add(C(P)), r(x(P), U + 1, R)) : U < R && g(P);
|
|
2916
2916
|
});
|
|
2917
2917
|
};
|
|
2918
2918
|
const f = (d || []).filter((L) => {
|
|
2919
|
-
const
|
|
2920
|
-
return
|
|
2919
|
+
const U = a(L, p.value, 1);
|
|
2920
|
+
return U > 0 && U < h;
|
|
2921
2921
|
}), b = new Set(f);
|
|
2922
|
-
r(
|
|
2923
|
-
a(L,
|
|
2924
|
-
}),
|
|
2922
|
+
r(p.value, 1, h), y.value.expandedKeys.forEach((L) => {
|
|
2923
|
+
a(L, p.value, 1) >= h && b.add(L);
|
|
2924
|
+
}), y.value.expandedKeys = b;
|
|
2925
2925
|
} else
|
|
2926
|
-
|
|
2926
|
+
y.value.expandedKeys = new Set(d);
|
|
2927
2927
|
}
|
|
2928
2928
|
},
|
|
2929
2929
|
{ immediate: !0 }
|
|
@@ -2942,19 +2942,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2942
2942
|
});
|
|
2943
2943
|
};
|
|
2944
2944
|
const h = /* @__PURE__ */ new Set(), a = I.value;
|
|
2945
|
-
d(
|
|
2945
|
+
d(p.value, 1), y.value.expandedKeys = h;
|
|
2946
2946
|
}
|
|
2947
2947
|
}
|
|
2948
2948
|
function pe() {
|
|
2949
2949
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2950
2950
|
let d = function(f, b = []) {
|
|
2951
2951
|
f.forEach((L) => {
|
|
2952
|
-
const
|
|
2953
|
-
h.has(
|
|
2952
|
+
const U = C(L), R = [...b, U];
|
|
2953
|
+
h.has(U) && b.forEach((P) => a.add(P)), g(L) && d(x(L), R);
|
|
2954
2954
|
});
|
|
2955
2955
|
};
|
|
2956
2956
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
2957
|
-
d(
|
|
2957
|
+
d(p.value);
|
|
2958
2958
|
const r = I.value;
|
|
2959
2959
|
if (r) {
|
|
2960
2960
|
console.log(
|
|
@@ -2962,24 +2962,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2962
2962
|
);
|
|
2963
2963
|
return;
|
|
2964
2964
|
}
|
|
2965
|
-
|
|
2965
|
+
y.value.expandedKeys = a;
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
2968
|
-
ee(() => n.defaultExpandAll, ve, { immediate: !0 }), ee(() =>
|
|
2968
|
+
ee(() => n.defaultExpandAll, ve, { immediate: !0 }), ee(() => p.value, ve, { deep: !0 }), ee(
|
|
2969
2969
|
() => n.defaultCheckedKeys,
|
|
2970
2970
|
(d) => {
|
|
2971
|
-
d ? (
|
|
2971
|
+
d ? (y.value.checkedKeys = new Set(d), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : pe()) : y.value.checkedKeys.clear();
|
|
2972
2972
|
},
|
|
2973
2973
|
{ immediate: !0 }
|
|
2974
2974
|
);
|
|
2975
2975
|
function ye(d) {
|
|
2976
2976
|
try {
|
|
2977
2977
|
let h = function(f, b, L = []) {
|
|
2978
|
-
for (const
|
|
2979
|
-
const
|
|
2980
|
-
if (
|
|
2981
|
-
if (g(
|
|
2982
|
-
const we = h(x(
|
|
2978
|
+
for (const U of f) {
|
|
2979
|
+
const R = C(U), P = [...L, R];
|
|
2980
|
+
if (R === b) return P;
|
|
2981
|
+
if (g(U)) {
|
|
2982
|
+
const we = h(x(U), b, P);
|
|
2983
2983
|
if (we) return we;
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
@@ -2987,47 +2987,47 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2987
2987
|
};
|
|
2988
2988
|
const a = Array.isArray(d) ? d : [];
|
|
2989
2989
|
if (a.length === 0) return;
|
|
2990
|
-
|
|
2991
|
-
const r = new Set(
|
|
2990
|
+
y.value.highlightedKeys.clear();
|
|
2991
|
+
const r = new Set(y.value.expandedKeys);
|
|
2992
2992
|
a.forEach((f) => {
|
|
2993
|
-
const b = h(
|
|
2994
|
-
b && b.length > 0 && (b.slice(0, -1).forEach((L) => r.add(L)),
|
|
2995
|
-
}),
|
|
2993
|
+
const b = h(p.value, f);
|
|
2994
|
+
b && b.length > 0 && (b.slice(0, -1).forEach((L) => r.add(L)), y.value.highlightedKeys.add(b[b.length - 1]));
|
|
2995
|
+
}), y.value.expandedKeys = r;
|
|
2996
2996
|
} catch (h) {
|
|
2997
2997
|
console.warn("highlightAndExpandByIds 执行失败", h);
|
|
2998
2998
|
}
|
|
2999
2999
|
}
|
|
3000
3000
|
function V() {
|
|
3001
|
-
|
|
3001
|
+
y.value.highlightedKeys.clear();
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3004
|
-
|
|
3003
|
+
function Q() {
|
|
3004
|
+
y.value.currentNode = null, y.value.currentKey = null;
|
|
3005
3005
|
}
|
|
3006
|
-
return $({ highlightAndExpandByIds: ye, clearHighlights: V, clearCurrentNode:
|
|
3006
|
+
return $({ highlightAndExpandByIds: ye, clearHighlights: V, clearCurrentNode: Q }), ee(
|
|
3007
3007
|
() => n.defaultSelectedKeys,
|
|
3008
3008
|
(d) => {
|
|
3009
|
-
d && (
|
|
3009
|
+
d && (y.value.selectedKeys = new Set(d));
|
|
3010
3010
|
},
|
|
3011
3011
|
{ immediate: !0 }
|
|
3012
3012
|
), (d, h) => (i(), u("div", {
|
|
3013
3013
|
class: E(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3014
3014
|
}, [
|
|
3015
3015
|
o("div", xl, [
|
|
3016
|
-
(i(!0), u(oe, null, ce(
|
|
3016
|
+
(i(!0), u(oe, null, ce(p.value, (a) => (i(), u("div", {
|
|
3017
3017
|
key: C(a),
|
|
3018
|
-
class: E(["ytree-node", { "ytree-node--current": B(a), "ytree-node--highlight":
|
|
3018
|
+
class: E(["ytree-node", { "ytree-node--current": B(a), "ytree-node--highlight": F(a) }])
|
|
3019
3019
|
}, [
|
|
3020
3020
|
o("div", {
|
|
3021
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3021
|
+
class: E(["ytree-node__content", { "is-child-style": X(a, a) }]),
|
|
3022
3022
|
style: { paddingLeft: "8px" },
|
|
3023
|
-
"data-level":
|
|
3023
|
+
"data-level": Y(a, a),
|
|
3024
3024
|
onClick: (r) => ue(a, a, null, a),
|
|
3025
3025
|
onContextmenu: (r) => te(r, a, a, null)
|
|
3026
3026
|
}, [
|
|
3027
3027
|
g(a) ? (i(), u("span", {
|
|
3028
3028
|
key: 0,
|
|
3029
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3030
|
-
onClick:
|
|
3029
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": A(a) }]),
|
|
3030
|
+
onClick: J((r) => Z(a), ["stop"])
|
|
3031
3031
|
}, [...h[0] || (h[0] = [
|
|
3032
3032
|
o("svg", {
|
|
3033
3033
|
width: "12",
|
|
@@ -3050,7 +3050,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3050
3050
|
"is-checked": D(a),
|
|
3051
3051
|
"is-indeterminate": z(a)
|
|
3052
3052
|
}]),
|
|
3053
|
-
onClick:
|
|
3053
|
+
onClick: J((r) => O(a), ["stop"])
|
|
3054
3054
|
}, [
|
|
3055
3055
|
D(a) ? (i(), u("svg", Sl, [...h[1] || (h[1] = [
|
|
3056
3056
|
o("path", {
|
|
@@ -3085,29 +3085,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3085
3085
|
ae(d.$slots, "node-content", {
|
|
3086
3086
|
node: a,
|
|
3087
3087
|
isCurrent: B(a),
|
|
3088
|
-
isExpanded:
|
|
3088
|
+
isExpanded: A(a),
|
|
3089
3089
|
hasChildren: g(a)
|
|
3090
3090
|
}, void 0, !0)
|
|
3091
3091
|
])
|
|
3092
3092
|
], 42, $l),
|
|
3093
3093
|
se(xe, { name: "ytree-node" }, {
|
|
3094
3094
|
default: re(() => [
|
|
3095
|
-
g(a) &&
|
|
3095
|
+
g(a) && A(a) ? (i(), u("div", Bl, [
|
|
3096
3096
|
(i(!0), u(oe, null, ce(x(a), (r) => (i(), u("div", {
|
|
3097
3097
|
key: C(r),
|
|
3098
|
-
class: E(["ytree-node", { "ytree-node--current": B(r), "ytree-node--highlight":
|
|
3098
|
+
class: E(["ytree-node", { "ytree-node--current": B(r), "ytree-node--highlight": F(r) }])
|
|
3099
3099
|
}, [
|
|
3100
3100
|
o("div", {
|
|
3101
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3101
|
+
class: E(["ytree-node__content", { "is-child-style": X(r, a) }]),
|
|
3102
3102
|
style: { paddingLeft: "22px" },
|
|
3103
|
-
"data-level":
|
|
3103
|
+
"data-level": Y(a, r),
|
|
3104
3104
|
onClick: (f) => ue(r, r, null, a),
|
|
3105
3105
|
onContextmenu: (f) => te(f, r, r, null)
|
|
3106
3106
|
}, [
|
|
3107
3107
|
g(r) ? (i(), u("span", {
|
|
3108
3108
|
key: 0,
|
|
3109
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3110
|
-
onClick:
|
|
3109
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": A(r) }]),
|
|
3110
|
+
onClick: J((f) => Z(r), ["stop"])
|
|
3111
3111
|
}, [...h[3] || (h[3] = [
|
|
3112
3112
|
o("svg", {
|
|
3113
3113
|
width: "12",
|
|
@@ -3130,7 +3130,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3130
3130
|
"is-checked": D(r),
|
|
3131
3131
|
"is-indeterminate": z(r)
|
|
3132
3132
|
}]),
|
|
3133
|
-
onClick:
|
|
3133
|
+
onClick: J((f) => O(r), ["stop"])
|
|
3134
3134
|
}, [
|
|
3135
3135
|
D(r) ? (i(), u("svg", Hl, [...h[4] || (h[4] = [
|
|
3136
3136
|
o("path", {
|
|
@@ -3161,29 +3161,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3161
3161
|
o("span", {
|
|
3162
3162
|
class: E(["ytree-node__label", { "is-employee": k(r) }])
|
|
3163
3163
|
}, G(T(r)), 3),
|
|
3164
|
-
o("div",
|
|
3164
|
+
o("div", Vl, [
|
|
3165
3165
|
ae(d.$slots, "node-content", {
|
|
3166
3166
|
node: r,
|
|
3167
3167
|
isCurrent: B(r),
|
|
3168
|
-
isExpanded:
|
|
3168
|
+
isExpanded: A(r),
|
|
3169
3169
|
hasChildren: g(r)
|
|
3170
3170
|
}, void 0, !0)
|
|
3171
3171
|
])
|
|
3172
3172
|
], 42, El),
|
|
3173
3173
|
se(xe, { name: "ytree-node" }, {
|
|
3174
3174
|
default: re(() => [
|
|
3175
|
-
g(r) &&
|
|
3175
|
+
g(r) && A(r) ? (i(), u("div", Al, [
|
|
3176
3176
|
(i(!0), u(oe, null, ce(x(r), (f) => (i(), u("div", {
|
|
3177
3177
|
key: C(f),
|
|
3178
3178
|
class: E(["ytree-node", {
|
|
3179
3179
|
"ytree-node--current": B(f),
|
|
3180
|
-
"ytree-node--highlight":
|
|
3180
|
+
"ytree-node--highlight": F(f)
|
|
3181
3181
|
}])
|
|
3182
3182
|
}, [
|
|
3183
3183
|
o("div", {
|
|
3184
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3184
|
+
class: E(["ytree-node__content", { "is-child-style": X(f, a) }]),
|
|
3185
3185
|
style: { paddingLeft: "38px" },
|
|
3186
|
-
"data-level":
|
|
3186
|
+
"data-level": Y(a, f),
|
|
3187
3187
|
onClick: (b) => ue(f, f, null, a),
|
|
3188
3188
|
onContextmenu: (b) => te(
|
|
3189
3189
|
b,
|
|
@@ -3194,8 +3194,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3194
3194
|
}, [
|
|
3195
3195
|
g(f) ? (i(), u("span", {
|
|
3196
3196
|
key: 0,
|
|
3197
|
-
class: E(["ytree-node__expand-icon", { "is-expanded":
|
|
3198
|
-
onClick:
|
|
3197
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": A(f) }]),
|
|
3198
|
+
onClick: J((b) => Z(f), ["stop"])
|
|
3199
3199
|
}, [...h[6] || (h[6] = [
|
|
3200
3200
|
o("svg", {
|
|
3201
3201
|
width: "12",
|
|
@@ -3211,14 +3211,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3211
3211
|
"stroke-linejoin": "round"
|
|
3212
3212
|
})
|
|
3213
3213
|
], -1)
|
|
3214
|
-
])], 10,
|
|
3214
|
+
])], 10, Pl)) : (i(), u("span", Yl)),
|
|
3215
3215
|
e.showCheckbox ? (i(), u("span", {
|
|
3216
3216
|
key: 2,
|
|
3217
3217
|
class: E(["ytree-node__checkbox", {
|
|
3218
3218
|
"is-checked": D(f),
|
|
3219
3219
|
"is-indeterminate": z(f)
|
|
3220
3220
|
}]),
|
|
3221
|
-
onClick:
|
|
3221
|
+
onClick: J((b) => O(f), ["stop"])
|
|
3222
3222
|
}, [
|
|
3223
3223
|
D(f) ? (i(), u("svg", Ol, [...h[7] || (h[7] = [
|
|
3224
3224
|
o("path", {
|
|
@@ -3253,27 +3253,27 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3253
3253
|
ae(d.$slots, "node-content", {
|
|
3254
3254
|
node: f,
|
|
3255
3255
|
isCurrent: B(f),
|
|
3256
|
-
isExpanded:
|
|
3256
|
+
isExpanded: A(f),
|
|
3257
3257
|
hasChildren: g(f)
|
|
3258
3258
|
}, void 0, !0)
|
|
3259
3259
|
])
|
|
3260
3260
|
], 42, Fl),
|
|
3261
3261
|
se(xe, { name: "ytree-node" }, {
|
|
3262
3262
|
default: re(() => [
|
|
3263
|
-
g(f) &&
|
|
3263
|
+
g(f) && A(f) ? (i(), u("div", Zl, [
|
|
3264
3264
|
(i(!0), u(oe, null, ce(x(f), (b) => (i(), u("div", {
|
|
3265
3265
|
key: C(b),
|
|
3266
3266
|
class: E(["ytree-node", {
|
|
3267
3267
|
"ytree-node--current": B(b),
|
|
3268
|
-
"ytree-node--highlight":
|
|
3268
|
+
"ytree-node--highlight": F(b)
|
|
3269
3269
|
}])
|
|
3270
3270
|
}, [
|
|
3271
3271
|
o("div", {
|
|
3272
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3272
|
+
class: E(["ytree-node__content", { "is-child-style": X(b, a) }]),
|
|
3273
3273
|
style: {
|
|
3274
3274
|
paddingLeft: "54px"
|
|
3275
3275
|
},
|
|
3276
|
-
"data-level":
|
|
3276
|
+
"data-level": Y(a, b),
|
|
3277
3277
|
onClick: (L) => ue(
|
|
3278
3278
|
b,
|
|
3279
3279
|
b,
|
|
@@ -3290,9 +3290,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3290
3290
|
g(b) ? (i(), u("span", {
|
|
3291
3291
|
key: 0,
|
|
3292
3292
|
class: E(["ytree-node__expand-icon", {
|
|
3293
|
-
"is-expanded":
|
|
3293
|
+
"is-expanded": A(b)
|
|
3294
3294
|
}]),
|
|
3295
|
-
onClick:
|
|
3295
|
+
onClick: J((L) => Z(b), ["stop"])
|
|
3296
3296
|
}, [...h[9] || (h[9] = [
|
|
3297
3297
|
o("svg", {
|
|
3298
3298
|
width: "12",
|
|
@@ -3315,7 +3315,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3315
3315
|
"is-checked": D(b),
|
|
3316
3316
|
"is-indeterminate": z(b)
|
|
3317
3317
|
}]),
|
|
3318
|
-
onClick:
|
|
3318
|
+
onClick: J((L) => O(b), ["stop"])
|
|
3319
3319
|
}, [
|
|
3320
3320
|
D(b) ? (i(), u("svg", eo, [...h[10] || (h[10] = [
|
|
3321
3321
|
o("path", {
|
|
@@ -3352,14 +3352,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3352
3352
|
ae(d.$slots, "node-content", {
|
|
3353
3353
|
node: b,
|
|
3354
3354
|
isCurrent: B(b),
|
|
3355
|
-
isExpanded:
|
|
3355
|
+
isExpanded: A(b),
|
|
3356
3356
|
hasChildren: g(b)
|
|
3357
3357
|
}, void 0, !0)
|
|
3358
3358
|
])
|
|
3359
3359
|
], 42, Ql),
|
|
3360
3360
|
se(xe, { name: "ytree-node" }, {
|
|
3361
3361
|
default: re(() => [
|
|
3362
|
-
g(b) &&
|
|
3362
|
+
g(b) && A(b) ? (i(), u("div", oo, [
|
|
3363
3363
|
(i(!0), u(oe, null, ce(x(
|
|
3364
3364
|
b
|
|
3365
3365
|
), (L) => (i(), u("div", {
|
|
@@ -3369,19 +3369,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3369
3369
|
}])
|
|
3370
3370
|
}, [
|
|
3371
3371
|
o("div", {
|
|
3372
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3372
|
+
class: E(["ytree-node__content", { "is-child-style": X(L, a) }]),
|
|
3373
3373
|
style: {
|
|
3374
3374
|
paddingLeft: "70px"
|
|
3375
3375
|
},
|
|
3376
|
-
"data-level":
|
|
3377
|
-
onClick: (
|
|
3376
|
+
"data-level": Y(a, L),
|
|
3377
|
+
onClick: (U) => ue(
|
|
3378
3378
|
L,
|
|
3379
3379
|
L,
|
|
3380
3380
|
null,
|
|
3381
3381
|
a
|
|
3382
3382
|
),
|
|
3383
|
-
onContextmenu: (
|
|
3384
|
-
|
|
3383
|
+
onContextmenu: (U) => te(
|
|
3384
|
+
U,
|
|
3385
3385
|
L,
|
|
3386
3386
|
L,
|
|
3387
3387
|
null
|
|
@@ -3390,9 +3390,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3390
3390
|
g(L) ? (i(), u("span", {
|
|
3391
3391
|
key: 0,
|
|
3392
3392
|
class: E(["ytree-node__expand-icon", {
|
|
3393
|
-
"is-expanded":
|
|
3393
|
+
"is-expanded": A(L)
|
|
3394
3394
|
}]),
|
|
3395
|
-
onClick:
|
|
3395
|
+
onClick: J((U) => Z(L), ["stop"])
|
|
3396
3396
|
}, [...h[12] || (h[12] = [
|
|
3397
3397
|
o("svg", {
|
|
3398
3398
|
width: "12",
|
|
@@ -3417,7 +3417,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3417
3417
|
L
|
|
3418
3418
|
)
|
|
3419
3419
|
}]),
|
|
3420
|
-
onClick:
|
|
3420
|
+
onClick: J((U) => O(L), ["stop"])
|
|
3421
3421
|
}, [
|
|
3422
3422
|
D(L) ? (i(), u("svg", uo, [...h[13] || (h[13] = [
|
|
3423
3423
|
o("path", {
|
|
@@ -3456,7 +3456,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3456
3456
|
ae(d.$slots, "node-content", {
|
|
3457
3457
|
node: L,
|
|
3458
3458
|
isCurrent: B(L),
|
|
3459
|
-
isExpanded:
|
|
3459
|
+
isExpanded: A(L),
|
|
3460
3460
|
hasChildren: g(L)
|
|
3461
3461
|
}, void 0, !0)
|
|
3462
3462
|
])
|
|
@@ -3502,7 +3502,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3502
3502
|
},
|
|
3503
3503
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3504
3504
|
setup(e, { emit: $ }) {
|
|
3505
|
-
const t = e, n = $, m = K(!1),
|
|
3505
|
+
const t = e, n = $, m = K(!1), p = at({}), y = N(() => t.fields.filter((D) => !D.hidden)), I = N(() => m.value ? y.value : y.value.slice(0, t.maxVisibleFields)), C = N(() => y.value.length > t.maxVisibleFields);
|
|
3506
3506
|
function T(D) {
|
|
3507
3507
|
switch (D) {
|
|
3508
3508
|
case "select":
|
|
@@ -3516,69 +3516,68 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3516
3516
|
}
|
|
3517
3517
|
}
|
|
3518
3518
|
function k(D) {
|
|
3519
|
-
n("field-change", D,
|
|
3519
|
+
n("field-change", D, p[D.key]), n("update:modelValue", { ...p });
|
|
3520
3520
|
}
|
|
3521
3521
|
function w() {
|
|
3522
|
-
const D =
|
|
3523
|
-
n("search", { data: z });
|
|
3522
|
+
const D = Y(p), z = X(D), B = { ...p };
|
|
3523
|
+
n("search", { data: z, raw: B });
|
|
3524
3524
|
}
|
|
3525
3525
|
function g() {
|
|
3526
|
-
Object.keys(
|
|
3526
|
+
Object.keys(p).forEach((D) => {
|
|
3527
3527
|
const z = t.fields.find((B) => B.key === D);
|
|
3528
|
-
(z == null ? void 0 : z.type) === "daterange" ?
|
|
3529
|
-
}), n("reset"), n("update:modelValue", { ...
|
|
3528
|
+
(z == null ? void 0 : z.type) === "daterange" ? p[D] = { startDate: null, endDate: null } : (z == null ? void 0 : z.type) === "date" ? p[D] = null : p[D] = "";
|
|
3529
|
+
}), n("reset"), n("update:modelValue", { ...p });
|
|
3530
3530
|
}
|
|
3531
3531
|
function x() {
|
|
3532
3532
|
m.value = !m.value;
|
|
3533
3533
|
}
|
|
3534
|
-
function
|
|
3534
|
+
function Y(D) {
|
|
3535
3535
|
const z = {};
|
|
3536
3536
|
return Object.keys(D).forEach((B) => {
|
|
3537
|
-
const
|
|
3538
|
-
if (!(
|
|
3539
|
-
if (
|
|
3540
|
-
|
|
3541
|
-
X && U && (z[B] = R);
|
|
3537
|
+
const F = t.fields.find((Z) => Z.key === B), O = D[B], q = typeof O == "string" ? O.trim() : O;
|
|
3538
|
+
if (!(q == null || q === "")) {
|
|
3539
|
+
if (typeof q == "object" && q.startDate && q.endDate) {
|
|
3540
|
+
q.startDate && q.endDate && (z[B] = q);
|
|
3542
3541
|
return;
|
|
3543
3542
|
}
|
|
3544
|
-
if (
|
|
3545
|
-
|
|
3543
|
+
if (F && (F.type === "date" || F.type === "daterange")) {
|
|
3544
|
+
q !== 0 && (z[B] = q);
|
|
3546
3545
|
return;
|
|
3547
3546
|
}
|
|
3548
|
-
z[B] =
|
|
3547
|
+
z[B] = q;
|
|
3549
3548
|
}
|
|
3550
3549
|
}), z;
|
|
3551
3550
|
}
|
|
3552
|
-
function
|
|
3551
|
+
function X(D) {
|
|
3553
3552
|
const z = {};
|
|
3554
3553
|
return Object.keys(D).forEach((B) => {
|
|
3555
|
-
const
|
|
3556
|
-
if (
|
|
3557
|
-
if (
|
|
3558
|
-
const
|
|
3559
|
-
|
|
3560
|
-
} else
|
|
3554
|
+
const F = D[B], O = t.fields.find((q) => q.key === B);
|
|
3555
|
+
if (O)
|
|
3556
|
+
if (O.type === "daterange" && typeof F == "object") {
|
|
3557
|
+
const q = O.startKey || `${B}Start`, Z = O.endKey || `${B}End`;
|
|
3558
|
+
F.startDate && F.endDate && F.startDate !== 0 && F.endDate !== 0 && (O.format === "timestamp" ? (z[q] = new Date(F.startDate).getTime(), z[Z] = new Date(F.endDate).getTime()) : (z[q] = F.startDate, z[Z] = F.endDate));
|
|
3559
|
+
} else O.type === "date" && F && F !== 0 && O.format === "timestamp" ? z[B] = new Date(F).getTime() : z[B] = F;
|
|
3561
3560
|
else
|
|
3562
|
-
z[B] =
|
|
3561
|
+
z[B] = F;
|
|
3563
3562
|
}), z;
|
|
3564
3563
|
}
|
|
3565
|
-
function
|
|
3564
|
+
function A() {
|
|
3566
3565
|
t.fields.forEach((D) => {
|
|
3567
|
-
var z, B,
|
|
3568
|
-
|
|
3566
|
+
var z, B, F;
|
|
3567
|
+
p[D.key] === void 0 && (D.type === "daterange" ? p[D.key] = ((z = t.modelValue) == null ? void 0 : z[D.key]) || {
|
|
3569
3568
|
startDate: null,
|
|
3570
3569
|
endDate: null
|
|
3571
|
-
} : D.type === "date" ?
|
|
3570
|
+
} : D.type === "date" ? p[D.key] = ((B = t.modelValue) == null ? void 0 : B[D.key]) || null : p[D.key] = ((F = t.modelValue) == null ? void 0 : F[D.key]) || "");
|
|
3572
3571
|
});
|
|
3573
3572
|
}
|
|
3574
3573
|
return ee(
|
|
3575
3574
|
() => t.modelValue,
|
|
3576
3575
|
(D) => {
|
|
3577
|
-
D && Object.assign(
|
|
3576
|
+
D && Object.assign(p, D);
|
|
3578
3577
|
},
|
|
3579
3578
|
{ deep: !0, immediate: !0 }
|
|
3580
3579
|
), Ce(() => {
|
|
3581
|
-
|
|
3580
|
+
A();
|
|
3582
3581
|
}), (D, z) => (i(), u("div", mo, [
|
|
3583
3582
|
o("div", wo, [
|
|
3584
3583
|
o("div", bo, [
|
|
@@ -3596,8 +3595,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3596
3595
|
o("div", xo, [
|
|
3597
3596
|
e.Iflabel ? (i(), u("label", $o, G(B.label), 1)) : W("", !0),
|
|
3598
3597
|
(i(), Me(it(T(B.type)), {
|
|
3599
|
-
modelValue:
|
|
3600
|
-
"onUpdate:modelValue": (
|
|
3598
|
+
modelValue: p[B.key],
|
|
3599
|
+
"onUpdate:modelValue": (F) => p[B.key] = F,
|
|
3601
3600
|
placeholder: B.placeholder || `请输入${B.label}`,
|
|
3602
3601
|
options: B.options,
|
|
3603
3602
|
clearable: B.clearable !== !1,
|
|
@@ -3606,8 +3605,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3606
3605
|
format: B.format || "timestamp",
|
|
3607
3606
|
"include-time": B.includeTime || !1,
|
|
3608
3607
|
filterable: B.filterable === !0,
|
|
3609
|
-
onInput: (
|
|
3610
|
-
onChange: (
|
|
3608
|
+
onInput: (F) => k(B),
|
|
3609
|
+
onChange: (F) => k(B)
|
|
3611
3610
|
}, null, 40, ["modelValue", "onUpdate:modelValue", "placeholder", "options", "clearable", "size", "width", "format", "include-time", "filterable", "onInput", "onChange"]))
|
|
3612
3611
|
])
|
|
3613
3612
|
]))), 128))
|
|
@@ -3661,7 +3660,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3661
3660
|
])
|
|
3662
3661
|
]));
|
|
3663
3662
|
}
|
|
3664
|
-
}), Mo = /* @__PURE__ */ me(So, [["__scopeId", "data-v-
|
|
3663
|
+
}), Mo = /* @__PURE__ */ me(So, [["__scopeId", "data-v-54199f17"]]), Lo = {
|
|
3665
3664
|
key: 0,
|
|
3666
3665
|
width: "16",
|
|
3667
3666
|
height: "16",
|
|
@@ -3704,13 +3703,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3704
3703
|
function m() {
|
|
3705
3704
|
t.value = !1;
|
|
3706
3705
|
}
|
|
3707
|
-
function
|
|
3708
|
-
var
|
|
3709
|
-
(
|
|
3706
|
+
function p() {
|
|
3707
|
+
var y;
|
|
3708
|
+
(y = $.onClose) == null || y.call($, $.id);
|
|
3710
3709
|
}
|
|
3711
|
-
return (
|
|
3710
|
+
return (y, I) => (i(), Me(xe, {
|
|
3712
3711
|
name: "y-msg-fade",
|
|
3713
|
-
onAfterLeave:
|
|
3712
|
+
onAfterLeave: p
|
|
3714
3713
|
}, {
|
|
3715
3714
|
default: re(() => [
|
|
3716
3715
|
Be(o("div", {
|
|
@@ -3776,21 +3775,21 @@ function Ho() {
|
|
|
3776
3775
|
}), e;
|
|
3777
3776
|
}
|
|
3778
3777
|
function Qe(e) {
|
|
3779
|
-
const $ = Se.findIndex((
|
|
3778
|
+
const $ = Se.findIndex((p) => p.id === e);
|
|
3780
3779
|
if ($ === -1) return;
|
|
3781
3780
|
const { el: t } = Se[$], n = t.firstElementChild;
|
|
3782
3781
|
if (n) {
|
|
3783
|
-
const
|
|
3784
|
-
n.style.top =
|
|
3782
|
+
const p = window.getComputedStyle(n).top;
|
|
3783
|
+
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3785
3784
|
}
|
|
3786
3785
|
Se[$].leaving = !0, je(), setTimeout(() => {
|
|
3787
3786
|
Xe(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3788
|
-
const
|
|
3789
|
-
|
|
3787
|
+
const p = Se.findIndex((y) => y.id === e);
|
|
3788
|
+
p !== -1 && Se.splice(p, 1), je();
|
|
3790
3789
|
}, 260);
|
|
3791
3790
|
}
|
|
3792
3791
|
function qe(e) {
|
|
3793
|
-
var
|
|
3792
|
+
var p;
|
|
3794
3793
|
const $ = Ko++, t = document.createElement("div");
|
|
3795
3794
|
document.body.appendChild(t);
|
|
3796
3795
|
const n = se(zo, {
|
|
@@ -3801,14 +3800,14 @@ function qe(e) {
|
|
|
3801
3800
|
offset: Ho(),
|
|
3802
3801
|
zIndex: 3e3 + $,
|
|
3803
3802
|
closable: e.closable ?? !1,
|
|
3804
|
-
onClose: (
|
|
3803
|
+
onClose: (y) => Qe(y)
|
|
3805
3804
|
});
|
|
3806
3805
|
Xe(n, t);
|
|
3807
|
-
const m = ((
|
|
3806
|
+
const m = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3808
3807
|
return Se.push({ id: $, el: t, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3809
|
-
const
|
|
3810
|
-
if (!
|
|
3811
|
-
const I =
|
|
3808
|
+
const y = t.firstElementChild;
|
|
3809
|
+
if (!y) return;
|
|
3810
|
+
const I = y.offsetHeight || m || 0, C = Se.find((T) => T.id === $);
|
|
3812
3811
|
C && (C.height = I, je());
|
|
3813
3812
|
}), { close: () => Qe($) };
|
|
3814
3813
|
}
|
|
@@ -3841,7 +3840,7 @@ function je() {
|
|
|
3841
3840
|
const Je = {
|
|
3842
3841
|
YButton: Ne,
|
|
3843
3842
|
YInput: Ge,
|
|
3844
|
-
YTable:
|
|
3843
|
+
YTable: At,
|
|
3845
3844
|
YSelect: et,
|
|
3846
3845
|
YPagination: Jt,
|
|
3847
3846
|
YBadge: fn,
|
|
@@ -3854,7 +3853,7 @@ const Je = {
|
|
|
3854
3853
|
YDrawer: kl,
|
|
3855
3854
|
YTree: go,
|
|
3856
3855
|
QueryEncapsulation: Mo
|
|
3857
|
-
},
|
|
3856
|
+
}, Vo = {
|
|
3858
3857
|
install(e) {
|
|
3859
3858
|
Object.keys(Je).forEach(($) => {
|
|
3860
3859
|
e.component($, Je[$]);
|
|
@@ -3875,9 +3874,9 @@ export {
|
|
|
3875
3874
|
$n as YPopover,
|
|
3876
3875
|
et as YSelect,
|
|
3877
3876
|
il as YSwitch,
|
|
3878
|
-
|
|
3877
|
+
At as YTable,
|
|
3879
3878
|
tt as YTime,
|
|
3880
3879
|
go as YTree,
|
|
3881
|
-
|
|
3880
|
+
Vo as default
|
|
3882
3881
|
};
|
|
3883
3882
|
//# sourceMappingURL=index.esm.js.map
|