@nhdropshipping/y-components 1.0.21 → 1.0.22
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/yimage.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 +756 -738
- 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 be, computed as O, createElementBlock as
|
|
1
|
+
import { defineComponent as be, computed as O, createElementBlock as r, openBlock as i, normalizeClass as E, createElementVNode as l, renderSlot as ue, Fragment as re, renderList as he, createCommentVNode as V, toDisplayString as ne, ref as z, watch as le, normalizeStyle as pe, nextTick as se, onMounted as Me, onUnmounted as Te, resolveComponent as Ve, createVNode as ce, Transition as De, withCtx as ve, createTextVNode as $e, createBlock as Be, withKeys as Ce, withModifiers as Z, withDirectives as Ee, vModelText as tt, Teleport as Ae, vShow as He, provide as nt, reactive as lt, TransitionGroup as ot, resolveDynamicComponent as at, onBeforeUnmount as st, render as Ze } from "vue";
|
|
2
2
|
const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "content" }, ut = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -37,7 +37,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
37
37
|
}
|
|
38
38
|
n("click", k);
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const p = O(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,18 +48,18 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function L(k,
|
|
51
|
+
}), h = O(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
|
+
function L(k, _) {
|
|
53
53
|
if (t.disabled || t.loading || k.disabled || k.loading) {
|
|
54
|
-
|
|
54
|
+
_.preventDefault(), _.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
n("group-click", k.value,
|
|
57
|
+
n("group-click", k.value, _);
|
|
58
58
|
}
|
|
59
|
-
return (k,
|
|
60
|
-
(i(!0),
|
|
59
|
+
return (k, _) => h.value ? (i(), r("div", ut, [
|
|
60
|
+
(i(!0), r(re, null, he(e.groupItems, (m, x) => {
|
|
61
61
|
var f;
|
|
62
|
-
return i(),
|
|
62
|
+
return i(), r("button", {
|
|
63
63
|
key: m.value ?? x,
|
|
64
64
|
class: E(["y-btn", [
|
|
65
65
|
`y-btn--${m.variant ?? e.variant}`,
|
|
@@ -76,31 +76,31 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
76
76
|
onClick: (C) => L(m, C)
|
|
77
77
|
}, [
|
|
78
78
|
l("span", dt, [
|
|
79
|
-
m.icon === "chevron-left" ? (i(),
|
|
79
|
+
m.icon === "chevron-left" ? (i(), r("svg", ft, [..._[0] || (_[0] = [
|
|
80
80
|
l("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) : m.icon === "chevron-right" ? (i(),
|
|
85
|
+
])])) : m.icon === "chevron-right" ? (i(), r("svg", vt, [..._[1] || (_[1] = [
|
|
86
86
|
l("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
|
-
])])) :
|
|
92
|
-
m.label && !m.onlyIcon ? (i(),
|
|
91
|
+
])])) : V("", !0),
|
|
92
|
+
m.label && !m.onlyIcon ? (i(), r("span", ht, ne(m.label), 1)) : V("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ct);
|
|
95
95
|
}), 128))
|
|
96
|
-
])) : (i(),
|
|
96
|
+
])) : (i(), r("button", {
|
|
97
97
|
key: 0,
|
|
98
98
|
class: E(["y-btn", [
|
|
99
99
|
`y-btn--${e.variant}`,
|
|
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,21 +137,21 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
137
137
|
},
|
|
138
138
|
emits: ["update:modelValue"],
|
|
139
139
|
setup(e, { emit: b }) {
|
|
140
|
-
const t = e, n = b, g = z(null),
|
|
140
|
+
const t = e, n = b, g = z(null), p = z(""), h = z(!1), L = z(!1), k = z(t.placeholder || "");
|
|
141
141
|
le(() => t.placeholder, (f) => {
|
|
142
142
|
L.value || (k.value = f || "");
|
|
143
143
|
});
|
|
144
|
-
function
|
|
144
|
+
function _(f) {
|
|
145
145
|
const C = f.target;
|
|
146
|
-
|
|
146
|
+
h.value = !0, n("update:modelValue", C.value);
|
|
147
147
|
}
|
|
148
148
|
function m() {
|
|
149
|
-
L.value = !0, t.clearOnFocus && (
|
|
149
|
+
L.value = !0, t.clearOnFocus && (p.value = t.modelValue || "", h.value = !1, k.value = p.value || t.placeholder || "", n("update:modelValue", ""));
|
|
150
150
|
}
|
|
151
151
|
function x() {
|
|
152
|
-
L.value = !1, t.clearOnFocus && !
|
|
152
|
+
L.value = !1, t.clearOnFocus && !h.value && (!t.modelValue || t.modelValue === "") && n("update:modelValue", p.value), k.value = t.placeholder || "";
|
|
153
153
|
}
|
|
154
|
-
return (f, C) => (i(),
|
|
154
|
+
return (f, C) => (i(), r("div", {
|
|
155
155
|
class: E(["y-input-wrap", { "is-block": e.block }]),
|
|
156
156
|
style: pe({ width: e.width })
|
|
157
157
|
}, [
|
|
@@ -168,7 +168,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
168
168
|
disabled: e.disabled,
|
|
169
169
|
required: e.required,
|
|
170
170
|
value: e.modelValue,
|
|
171
|
-
onInput:
|
|
171
|
+
onInput: _,
|
|
172
172
|
onFocus: m,
|
|
173
173
|
onBlur: x
|
|
174
174
|
}, null, 42, yt)
|
|
@@ -221,27 +221,27 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
221
221
|
},
|
|
222
222
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
223
223
|
setup(e, { emit: b }) {
|
|
224
|
-
const t = e, n = b, g = z(t.currentPage || 1),
|
|
224
|
+
const t = e, n = b, g = z(t.currentPage || 1), p = z(t.pageSize), h = z([]), L = z("none"), k = z(), _ = z(), m = z(), x = z(), f = z([]), C = z(), j = z({
|
|
225
225
|
show: !1,
|
|
226
226
|
thumbHeight: 40,
|
|
227
227
|
thumbTop: 0
|
|
228
228
|
});
|
|
229
|
-
let
|
|
229
|
+
let Q = !1, A = 0, $ = 0;
|
|
230
230
|
const T = z(0), I = O(() => {
|
|
231
231
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
232
232
|
return t.data;
|
|
233
233
|
const D = t.searchKeyword.toLowerCase();
|
|
234
|
-
return t.data.filter((
|
|
235
|
-
const B = de(
|
|
234
|
+
return t.data.filter((S) => t.searchFields.some((K) => {
|
|
235
|
+
const B = de(S, K);
|
|
236
236
|
return String(B).toLowerCase().includes(D);
|
|
237
237
|
}));
|
|
238
238
|
}), H = O(() => (t.pagination, I.value)), P = O(() => {
|
|
239
239
|
if (!t.selectable) return !1;
|
|
240
|
-
const D = H.value.map((
|
|
241
|
-
return D.length > 0 && D.every((
|
|
240
|
+
const D = H.value.map((S, K) => ee(S, K));
|
|
241
|
+
return D.length > 0 && D.every((S) => h.value.includes(S));
|
|
242
242
|
}), G = O(() => {
|
|
243
243
|
const D = [];
|
|
244
|
-
let
|
|
244
|
+
let S = t.selectable ? 40 : 0;
|
|
245
245
|
for (let K = 0; K < t.columns.length; K++) {
|
|
246
246
|
const B = t.columns[K];
|
|
247
247
|
if (B.fixed === "left") {
|
|
@@ -253,13 +253,13 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
253
253
|
const N = parseFloat(f.value[K]);
|
|
254
254
|
F = isNaN(N) ? 80 : N;
|
|
255
255
|
}
|
|
256
|
-
D.push(
|
|
256
|
+
D.push(S), S += F;
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
return D;
|
|
260
|
-
}),
|
|
260
|
+
}), X = O(() => {
|
|
261
261
|
const D = [];
|
|
262
|
-
let
|
|
262
|
+
let S = 0;
|
|
263
263
|
const K = [];
|
|
264
264
|
for (let B = t.columns.length - 1; B >= 0; B--) {
|
|
265
265
|
const F = t.columns[B];
|
|
@@ -276,11 +276,11 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
for (let B = 0; B < K.length; B++)
|
|
279
|
-
D.push(
|
|
279
|
+
D.push(S), S += K[B].width;
|
|
280
280
|
return D;
|
|
281
281
|
});
|
|
282
|
-
function ye(D,
|
|
283
|
-
if (
|
|
282
|
+
function ye(D, S) {
|
|
283
|
+
if (S === "left") {
|
|
284
284
|
let K = 0;
|
|
285
285
|
for (let B = 0; B < D; B++)
|
|
286
286
|
t.columns[B].fixed === "left" && K++;
|
|
@@ -292,46 +292,46 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
292
292
|
return K;
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
function ee(D,
|
|
296
|
-
return typeof t.rowKey == "function" ? t.rowKey(D) : D[t.rowKey] ||
|
|
295
|
+
function ee(D, S) {
|
|
296
|
+
return typeof t.rowKey == "function" ? t.rowKey(D) : D[t.rowKey] || S;
|
|
297
297
|
}
|
|
298
|
-
function de(D,
|
|
299
|
-
return
|
|
298
|
+
function de(D, S) {
|
|
299
|
+
return S.split(".").reduce((K, B) => K == null ? void 0 : K[B], D);
|
|
300
300
|
}
|
|
301
|
-
function we(D,
|
|
301
|
+
function we(D, S = !1) {
|
|
302
302
|
const K = [];
|
|
303
|
-
return D.align && K.push(`text-${D.align}`), D.fixed === "right" && (K.push("col-fixed-right"),
|
|
303
|
+
return D.align && K.push(`text-${D.align}`), D.fixed === "right" && (K.push("col-fixed-right"), S && K.push("col-fixed-right-header")), D.fixed === "left" && (K.push("col-fixed-left"), S && K.push("col-fixed-left-header")), K.join(" ");
|
|
304
304
|
}
|
|
305
|
-
function me(D,
|
|
305
|
+
function me(D, S, K) {
|
|
306
306
|
const B = {};
|
|
307
307
|
if (D.width ? (B.width = D.width, B.minWidth = D.width, B.maxWidth = D.width) : (B.width = "auto", B.minWidth = "80px", B.maxWidth = "none"), D.fixed === "left") {
|
|
308
|
-
const F = ye(
|
|
308
|
+
const F = ye(S, "left"), N = G.value[F] || 0;
|
|
309
309
|
B.left = `${N}px`, B.zIndex = K ? `${10 + F}` : `${5 + F}`;
|
|
310
310
|
} else if (D.fixed === "right") {
|
|
311
|
-
const F = ye(
|
|
311
|
+
const F = ye(S, "right"), N = X.value[F] || 0;
|
|
312
312
|
K ? B.right = `${N - 3}px` : B.right = `${N}px`, B.zIndex = K ? `${10 + F}` : `${5 + F}`;
|
|
313
313
|
}
|
|
314
314
|
return B;
|
|
315
315
|
}
|
|
316
|
-
function fe(D,
|
|
317
|
-
const K = de(D,
|
|
318
|
-
return
|
|
316
|
+
function fe(D, S) {
|
|
317
|
+
const K = de(D, S.key);
|
|
318
|
+
return S.formatter ? S.formatter(K, D) : K || "";
|
|
319
319
|
}
|
|
320
320
|
function Y(D) {
|
|
321
|
-
|
|
321
|
+
h.value.includes(D) ? h.value = h.value.filter((S) => S !== D) : h.value = [...h.value, D], n("select", h.value), n("update:selectedItems", h.value);
|
|
322
322
|
}
|
|
323
323
|
function q() {
|
|
324
|
-
const D = H.value.map((
|
|
325
|
-
if (D.every((
|
|
326
|
-
|
|
324
|
+
const D = H.value.map((S, K) => ee(S, K));
|
|
325
|
+
if (D.every((S) => h.value.includes(S)))
|
|
326
|
+
h.value = h.value.filter((S) => !D.includes(S));
|
|
327
327
|
else {
|
|
328
|
-
const
|
|
329
|
-
|
|
328
|
+
const S = /* @__PURE__ */ new Set([...h.value, ...D]);
|
|
329
|
+
h.value = Array.from(S);
|
|
330
330
|
}
|
|
331
|
-
n("select",
|
|
331
|
+
n("select", h.value), n("update:selectedItems", h.value);
|
|
332
332
|
}
|
|
333
333
|
function v() {
|
|
334
|
-
|
|
334
|
+
h.value = [], n("select", h.value), n("update:selectedItems", h.value);
|
|
335
335
|
}
|
|
336
336
|
le(() => t.searchKeyword, () => {
|
|
337
337
|
g.value = 1;
|
|
@@ -342,54 +342,54 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
342
342
|
g.value = D, n("page-change", D);
|
|
343
343
|
}
|
|
344
344
|
function o(D) {
|
|
345
|
-
|
|
345
|
+
p.value = D, g.value = 1, n("page-size-change", D);
|
|
346
346
|
}
|
|
347
347
|
le(() => t.currentPage, (D) => {
|
|
348
|
-
const
|
|
349
|
-
g.value !==
|
|
348
|
+
const S = typeof D == "number" && D > 0 ? D : 1;
|
|
349
|
+
g.value !== S && (g.value = S);
|
|
350
350
|
}), le(() => t.pageSize, (D) => {
|
|
351
|
-
const
|
|
352
|
-
|
|
351
|
+
const S = typeof D == "number" && D > 0 ? D : 10;
|
|
352
|
+
p.value !== S && (p.value = S);
|
|
353
353
|
});
|
|
354
354
|
function s() {
|
|
355
|
-
k.value &&
|
|
356
|
-
const D = k.value.getBoundingClientRect(),
|
|
357
|
-
|
|
355
|
+
k.value && se(() => {
|
|
356
|
+
const D = k.value.getBoundingClientRect(), S = window.innerHeight, K = D.top, B = k.value.querySelector(".table-header"), F = B ? B.offsetHeight : 40, N = k.value.querySelector(".ypagination"), te = N ? N.offsetHeight : 60, a = k.value.querySelector(".bulk-bar"), c = a ? a.offsetHeight : 0, M = F + te + c + 20, W = S - K - M, oe = Math.max(200, W), ie = k.value.querySelector(".table-body-wrap .table");
|
|
357
|
+
ie && (ie.offsetHeight > W ? L.value = `${oe}px` : L.value = "none");
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
|
-
let
|
|
360
|
+
let u = !1;
|
|
361
361
|
function y() {
|
|
362
|
-
!
|
|
363
|
-
|
|
362
|
+
!_.value || !m.value || u || _.value.scrollLeft !== m.value.scrollLeft && (u = !0, _.value.scrollLeft = m.value.scrollLeft, requestAnimationFrame(() => {
|
|
363
|
+
u = !1;
|
|
364
364
|
}));
|
|
365
365
|
}
|
|
366
366
|
function w() {
|
|
367
|
-
!
|
|
368
|
-
|
|
367
|
+
!_.value || !m.value || u || m.value.scrollLeft !== _.value.scrollLeft && (u = !0, m.value.scrollLeft = _.value.scrollLeft, requestAnimationFrame(() => {
|
|
368
|
+
u = !1;
|
|
369
369
|
}));
|
|
370
370
|
}
|
|
371
|
-
function
|
|
372
|
-
|
|
371
|
+
function R() {
|
|
372
|
+
se(() => {
|
|
373
373
|
if (!m.value) return;
|
|
374
|
-
const D = m.value,
|
|
374
|
+
const D = m.value, S = D.scrollHeight, K = D.clientHeight, B = D.scrollTop, F = S > K + 1;
|
|
375
375
|
if (j.value.show = F, !F) return;
|
|
376
|
-
const N = 24, te = K /
|
|
376
|
+
const N = 24, te = K / S, a = C.value ? C.value.clientHeight : K, c = Math.max(N, Math.floor(a * te));
|
|
377
377
|
j.value.thumbHeight = c;
|
|
378
|
-
const M = Math.max(0, a - c), W = Math.max(1,
|
|
378
|
+
const M = Math.max(0, a - c), W = Math.max(1, S - K);
|
|
379
379
|
j.value.thumbTop = Math.min(M, Math.floor(B / W * M));
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
if (!
|
|
382
|
+
function U(D) {
|
|
383
|
+
if (!Q || !m.value || !C.value) return;
|
|
384
384
|
D.preventDefault();
|
|
385
|
-
const
|
|
386
|
-
B.scrollTop = Math.min(te, Math.max(0, $ + c)),
|
|
385
|
+
const S = C.value.clientHeight, K = Math.max(0, S - j.value.thumbHeight), B = m.value, F = B.scrollHeight, N = B.clientHeight, te = Math.max(1, F - N), c = (D.clientY - A) / Math.max(1, K) * te;
|
|
386
|
+
B.scrollTop = Math.min(te, Math.max(0, $ + c)), R();
|
|
387
387
|
}
|
|
388
|
-
function
|
|
389
|
-
|
|
388
|
+
function J() {
|
|
389
|
+
Q = !1, window.removeEventListener("mousemove", U), window.removeEventListener("mouseup", J);
|
|
390
390
|
}
|
|
391
|
-
function
|
|
392
|
-
|
|
391
|
+
function xe() {
|
|
392
|
+
se(() => {
|
|
393
393
|
var K;
|
|
394
394
|
if (f.value.length === t.columns.length && f.value.every((B) => !!B))
|
|
395
395
|
return;
|
|
@@ -401,9 +401,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
401
401
|
const F = f.value[D.length];
|
|
402
402
|
D.push(F || "");
|
|
403
403
|
}
|
|
404
|
-
const
|
|
405
|
-
if (
|
|
406
|
-
const B = t.selectable ? 1 : 0, F = Array.from(
|
|
404
|
+
const S = (K = x.value) == null ? void 0 : K.querySelector("tbody tr");
|
|
405
|
+
if (S) {
|
|
406
|
+
const B = t.selectable ? 1 : 0, F = Array.from(S.children);
|
|
407
407
|
for (let N = 0; N < t.columns.length; N++)
|
|
408
408
|
if (!D[N]) {
|
|
409
409
|
const te = F[B + N];
|
|
@@ -420,70 +420,70 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
function Re() {
|
|
423
|
-
s(),
|
|
423
|
+
s(), Se();
|
|
424
424
|
}
|
|
425
425
|
le(() => t.data, () => {
|
|
426
|
-
|
|
427
|
-
s(), y(),
|
|
426
|
+
se(() => {
|
|
427
|
+
s(), y(), Se();
|
|
428
428
|
});
|
|
429
|
-
}, { deep: !0 }), le([g,
|
|
430
|
-
|
|
431
|
-
s(), y(),
|
|
429
|
+
}, { deep: !0 }), le([g, p], () => {
|
|
430
|
+
se(() => {
|
|
431
|
+
s(), y(), Se();
|
|
432
432
|
});
|
|
433
433
|
}), le(() => t.columns, () => {
|
|
434
|
-
f.value = [],
|
|
435
|
-
|
|
434
|
+
f.value = [], se(() => {
|
|
435
|
+
xe(), y(), Se();
|
|
436
436
|
});
|
|
437
|
-
}, { deep: !0 }), le(() =>
|
|
438
|
-
|
|
439
|
-
s(),
|
|
437
|
+
}, { deep: !0 }), le(() => h.value, () => {
|
|
438
|
+
se(() => {
|
|
439
|
+
s(), Se();
|
|
440
440
|
});
|
|
441
441
|
}, { deep: !0 }), le(() => t.loading, () => {
|
|
442
|
-
|
|
443
|
-
|
|
442
|
+
se(() => {
|
|
443
|
+
Se();
|
|
444
444
|
});
|
|
445
|
-
}),
|
|
446
|
-
var D,
|
|
447
|
-
|
|
448
|
-
s(),
|
|
445
|
+
}), Me(() => {
|
|
446
|
+
var D, S;
|
|
447
|
+
se(() => {
|
|
448
|
+
s(), xe(), Se(), R();
|
|
449
449
|
}), window.addEventListener("resize", Re), window.addEventListener("scroll", Re, !0), (D = m.value) == null || D.addEventListener("scroll", () => {
|
|
450
|
-
y(),
|
|
451
|
-
}, { passive: !0 }), (
|
|
450
|
+
y(), R(), Se();
|
|
451
|
+
}, { passive: !0 }), (S = _.value) == null || S.addEventListener("scroll", () => {
|
|
452
452
|
w();
|
|
453
|
-
}, { passive: !0 }),
|
|
454
|
-
|
|
453
|
+
}, { passive: !0 }), se(() => y()), m.value && typeof ResizeObserver < "u" && (Ke = new ResizeObserver(() => {
|
|
454
|
+
Se();
|
|
455
455
|
}), Ke.observe(m.value));
|
|
456
456
|
}), Te(() => {
|
|
457
|
-
var D,
|
|
458
|
-
window.removeEventListener("resize", Re), window.removeEventListener("scroll", Re, !0), (D = m.value) == null || D.removeEventListener("scroll", y), (
|
|
457
|
+
var D, S;
|
|
458
|
+
window.removeEventListener("resize", Re), window.removeEventListener("scroll", Re, !0), (D = m.value) == null || D.removeEventListener("scroll", y), (S = _.value) == null || S.removeEventListener("scroll", w), window.removeEventListener("mousemove", U), window.removeEventListener("mouseup", J), Ke && (Ke.disconnect(), Ke = null);
|
|
459
459
|
});
|
|
460
460
|
let ze = -1;
|
|
461
|
-
function
|
|
462
|
-
!
|
|
463
|
-
if (!
|
|
464
|
-
const D = m.value,
|
|
465
|
-
if (T.value =
|
|
466
|
-
ze =
|
|
467
|
-
const K =
|
|
468
|
-
K && B && (
|
|
461
|
+
function Se() {
|
|
462
|
+
!_.value || !m.value || requestAnimationFrame(() => {
|
|
463
|
+
if (!_.value || !m.value) return;
|
|
464
|
+
const D = m.value, S = Math.ceil(D.offsetWidth - D.clientWidth);
|
|
465
|
+
if (T.value = S, S !== ze) {
|
|
466
|
+
ze = S;
|
|
467
|
+
const K = _.value.querySelector(".table"), B = x.value;
|
|
468
|
+
K && B && (_.value.style.paddingRight = "0px", K.style.width = "", K.style.marginRight = "", S > 0 ? (_.value.style.paddingRight = `${S}px`, K.style.width = "100%", K.style.marginRight = `-${S}px`) : (_.value.style.paddingRight = "0px", K.style.width = "100%", K.style.marginRight = "0px"));
|
|
469
469
|
}
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
472
|
let Ke = null;
|
|
473
|
-
return (D,
|
|
473
|
+
return (D, S) => {
|
|
474
474
|
const K = Ve("YButton"), B = Ve("YPagination");
|
|
475
|
-
return i(),
|
|
475
|
+
return i(), r("div", {
|
|
476
476
|
class: "ytable-container",
|
|
477
477
|
ref_key: "tableContainer",
|
|
478
478
|
ref: k
|
|
479
479
|
}, [
|
|
480
|
-
ce(
|
|
480
|
+
ce(De, { name: "bulk-slide" }, {
|
|
481
481
|
default: ve(() => [
|
|
482
|
-
|
|
483
|
-
l("div", wt, "已选择 " + ne(
|
|
482
|
+
h.value.length && e.showBulkActions ? (i(), r("div", mt, [
|
|
483
|
+
l("div", wt, "已选择 " + ne(h.value.length) + " 项", 1),
|
|
484
484
|
l("div", bt, [
|
|
485
485
|
ue(D.$slots, "bulk-actions", {
|
|
486
|
-
selectedItems:
|
|
486
|
+
selectedItems: h.value,
|
|
487
487
|
clearSelection: v
|
|
488
488
|
}, () => [
|
|
489
489
|
ce(K, {
|
|
@@ -491,14 +491,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
491
491
|
class: "btn",
|
|
492
492
|
onClick: v
|
|
493
493
|
}, {
|
|
494
|
-
default: ve(() => [...
|
|
495
|
-
|
|
494
|
+
default: ve(() => [...S[2] || (S[2] = [
|
|
495
|
+
$e("清除选择", -1)
|
|
496
496
|
])]),
|
|
497
497
|
_: 1
|
|
498
498
|
})
|
|
499
499
|
], !0)
|
|
500
500
|
])
|
|
501
|
-
])) :
|
|
501
|
+
])) : V("", !0)
|
|
502
502
|
]),
|
|
503
503
|
_: 3
|
|
504
504
|
}),
|
|
@@ -506,26 +506,26 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
506
506
|
l("div", {
|
|
507
507
|
class: "table-header",
|
|
508
508
|
ref_key: "headerRef",
|
|
509
|
-
ref:
|
|
509
|
+
ref: _
|
|
510
510
|
}, [
|
|
511
511
|
l("table", xt, [
|
|
512
512
|
l("colgroup", null, [
|
|
513
|
-
e.selectable ? (i(),
|
|
514
|
-
(i(!0),
|
|
513
|
+
e.selectable ? (i(), r("col", Ct)) : V("", !0),
|
|
514
|
+
(i(!0), r(re, null, he(e.columns, (F, N) => (i(), r("col", {
|
|
515
515
|
key: F.key,
|
|
516
516
|
style: pe({ width: f.value[N] || void 0, minWidth: f.value[N] || "80px" })
|
|
517
517
|
}, null, 4))), 128))
|
|
518
518
|
]),
|
|
519
519
|
l("thead", null, [
|
|
520
520
|
l("tr", null, [
|
|
521
|
-
e.selectable ? (i(),
|
|
521
|
+
e.selectable ? (i(), r("th", Dt, [
|
|
522
522
|
l("input", {
|
|
523
523
|
type: "checkbox",
|
|
524
524
|
checked: P.value,
|
|
525
525
|
onChange: q
|
|
526
526
|
}, null, 40, $t)
|
|
527
|
-
])) :
|
|
528
|
-
(i(!0),
|
|
527
|
+
])) : V("", !0),
|
|
528
|
+
(i(!0), r(re, null, he(e.columns, (F, N) => (i(), r("th", {
|
|
529
529
|
key: F.key,
|
|
530
530
|
class: E(we(F, !0)),
|
|
531
531
|
style: pe(me(F, N, !0))
|
|
@@ -540,40 +540,40 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
540
540
|
ref: m,
|
|
541
541
|
style: pe({ maxHeight: L.value })
|
|
542
542
|
}, [
|
|
543
|
-
e.loading ? (i(),
|
|
543
|
+
e.loading ? (i(), r("div", _t, [...S[3] || (S[3] = [
|
|
544
544
|
l("div", { class: "loading-spinner" }, null, -1),
|
|
545
545
|
l("div", { class: "loading-text" }, "加载中...", -1)
|
|
546
|
-
])])) :
|
|
547
|
-
!H.value.length && !e.loading ? (i(),
|
|
546
|
+
])])) : V("", !0),
|
|
547
|
+
!H.value.length && !e.loading ? (i(), r("div", St, [
|
|
548
548
|
ue(D.$slots, "empty", {}, () => [
|
|
549
|
-
|
|
549
|
+
$e(ne(e.emptyText), 1)
|
|
550
550
|
], !0)
|
|
551
|
-
])) :
|
|
551
|
+
])) : V("", !0),
|
|
552
552
|
l("table", {
|
|
553
553
|
class: E(["table", { "loading-table": e.loading }]),
|
|
554
554
|
ref_key: "bodyTableRef",
|
|
555
555
|
ref: x
|
|
556
556
|
}, [
|
|
557
557
|
l("colgroup", null, [
|
|
558
|
-
e.selectable ? (i(),
|
|
559
|
-
(i(!0),
|
|
558
|
+
e.selectable ? (i(), r("col", Mt)) : V("", !0),
|
|
559
|
+
(i(!0), r(re, null, he(e.columns, (F, N) => (i(), r("col", {
|
|
560
560
|
key: F.key,
|
|
561
561
|
style: pe({ width: f.value[N] || void 0, minWidth: f.value[N] || "80px" })
|
|
562
562
|
}, null, 4))), 128))
|
|
563
563
|
]),
|
|
564
564
|
l("tbody", null, [
|
|
565
|
-
(i(!0),
|
|
565
|
+
(i(!0), r(re, null, he(H.value, (F, N) => (i(), r("tr", {
|
|
566
566
|
key: ee(F, N)
|
|
567
567
|
}, [
|
|
568
|
-
e.selectable ? (i(),
|
|
568
|
+
e.selectable ? (i(), r("td", Lt, [
|
|
569
569
|
l("input", {
|
|
570
570
|
type: "checkbox",
|
|
571
571
|
value: ee(F, N),
|
|
572
|
-
checked:
|
|
572
|
+
checked: h.value.includes(ee(F, N)),
|
|
573
573
|
onChange: (te) => Y(ee(F, N))
|
|
574
574
|
}, null, 40, It)
|
|
575
|
-
])) :
|
|
576
|
-
(i(!0),
|
|
575
|
+
])) : V("", !0),
|
|
576
|
+
(i(!0), r(re, null, he(e.columns, (te, a) => (i(), r("td", {
|
|
577
577
|
key: te.key,
|
|
578
578
|
class: E(we(te)),
|
|
579
579
|
style: pe(me(te, a, !1))
|
|
@@ -583,7 +583,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
583
583
|
value: de(F, te.key),
|
|
584
584
|
index: N
|
|
585
585
|
}, () => [
|
|
586
|
-
|
|
586
|
+
$e(ne(fe(F, te)), 1)
|
|
587
587
|
], !0)
|
|
588
588
|
], 6))), 128))
|
|
589
589
|
]))), 128))
|
|
@@ -594,14 +594,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
594
594
|
key: 0,
|
|
595
595
|
class: "align-right",
|
|
596
596
|
"current-page": g.value,
|
|
597
|
-
"onUpdate:currentPage":
|
|
598
|
-
"page-size":
|
|
599
|
-
"onUpdate:pageSize":
|
|
597
|
+
"onUpdate:currentPage": S[0] || (S[0] = (F) => g.value = F),
|
|
598
|
+
"page-size": p.value,
|
|
599
|
+
"onUpdate:pageSize": S[1] || (S[1] = (F) => p.value = F),
|
|
600
600
|
loading: t.loading,
|
|
601
601
|
"page-size-options": e.pageSizeOptions,
|
|
602
602
|
onPageChange: d,
|
|
603
603
|
onPageSizeChange: o
|
|
604
|
-
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) :
|
|
604
|
+
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : V("", !0)
|
|
605
605
|
])
|
|
606
606
|
], 512);
|
|
607
607
|
};
|
|
@@ -625,26 +625,26 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
625
625
|
},
|
|
626
626
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
627
627
|
setup(e, { emit: b }) {
|
|
628
|
-
const t = e, n = b, g = z(!1),
|
|
628
|
+
const t = e, n = b, g = z(!1), p = z(-1), h = z(), L = z(), k = z(), _ = z(), m = z(!1), x = z(), f = z(""), C = O(() => t.options.find((o) => T(o) === t.modelValue) || null), j = O(() => C.value ? I(C.value) : ""), Q = O(() => {
|
|
629
629
|
if (!t.filterable) return t.options;
|
|
630
630
|
const o = f.value.trim().toLowerCase();
|
|
631
631
|
return o ? t.options.filter((s) => {
|
|
632
|
-
const
|
|
633
|
-
return String(
|
|
632
|
+
const u = I(s);
|
|
633
|
+
return String(u).toLowerCase().includes(o);
|
|
634
634
|
}) : t.options;
|
|
635
635
|
}), A = O(() => {
|
|
636
636
|
var w;
|
|
637
637
|
const o = { position: "fixed", zIndex: "4000" }, s = L.value;
|
|
638
638
|
if (!s) return o;
|
|
639
|
-
const
|
|
640
|
-
return o.left = `${
|
|
639
|
+
const u = s.getBoundingClientRect(), y = ((w = k.value) == null ? void 0 : w.getBoundingClientRect().width) || u.width;
|
|
640
|
+
return o.left = `${u.left}px`, o.width = `${y}px`, m.value ? (o.bottom = `${window.innerHeight - u.top + 4}px`, o.top = "auto") : o.top = `${u.bottom + 4}px`, o;
|
|
641
641
|
});
|
|
642
642
|
function $() {
|
|
643
|
-
!g.value || !L.value ||
|
|
643
|
+
!g.value || !L.value || se(() => {
|
|
644
644
|
const o = L.value;
|
|
645
645
|
if (!o) return;
|
|
646
|
-
const s = o.getBoundingClientRect(),
|
|
647
|
-
m.value = !
|
|
646
|
+
const s = o.getBoundingClientRect(), u = window.innerHeight, y = 200, w = s.bottom + y + 4, R = s.top - y - 4, U = w <= u - 20, J = R >= 20;
|
|
647
|
+
m.value = !U && J;
|
|
648
648
|
});
|
|
649
649
|
}
|
|
650
650
|
function T(o) {
|
|
@@ -662,21 +662,21 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
662
662
|
function G(o) {
|
|
663
663
|
return typeof o == "object" && o !== null ? o[t.disabledKey] === !0 : !1;
|
|
664
664
|
}
|
|
665
|
-
function
|
|
665
|
+
function X() {
|
|
666
666
|
t.disabled || (g.value ? ee() : ye());
|
|
667
667
|
}
|
|
668
668
|
function ye() {
|
|
669
|
-
t.disabled || (g.value = !0,
|
|
669
|
+
t.disabled || (g.value = !0, se(() => {
|
|
670
670
|
$(), Y(), t.filterable && x.value && (x.value.focus(), f.value = "");
|
|
671
671
|
}));
|
|
672
672
|
}
|
|
673
673
|
function ee() {
|
|
674
|
-
g.value = !1,
|
|
674
|
+
g.value = !1, p.value = -1, m.value = !1, t.filterable && (f.value = "");
|
|
675
675
|
}
|
|
676
676
|
function de(o, s) {
|
|
677
677
|
if (G(o)) return;
|
|
678
|
-
const
|
|
679
|
-
n("update:modelValue",
|
|
678
|
+
const u = T(o);
|
|
679
|
+
n("update:modelValue", u), n("change", u, o), ee();
|
|
680
680
|
}
|
|
681
681
|
function we() {
|
|
682
682
|
if (!t.clearable || t.disabled) return;
|
|
@@ -684,31 +684,31 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
684
684
|
n("update:modelValue", o), n("change", o, null), n("clear"), ee();
|
|
685
685
|
}
|
|
686
686
|
function me(o) {
|
|
687
|
-
if (!
|
|
688
|
-
|
|
687
|
+
if (!Q.value || Q.value.length === 0) {
|
|
688
|
+
p.value = -1;
|
|
689
689
|
return;
|
|
690
690
|
}
|
|
691
|
-
let s =
|
|
692
|
-
const
|
|
693
|
-
s === -1 ? s = o > 0 ? 0 :
|
|
691
|
+
let s = p.value;
|
|
692
|
+
const u = Q.value.length;
|
|
693
|
+
s === -1 ? s = o > 0 ? 0 : u - 1 : s = (s + o + u) % u;
|
|
694
694
|
let y = 0;
|
|
695
|
-
for (; y <
|
|
696
|
-
s = (s + o +
|
|
697
|
-
|
|
695
|
+
for (; y < u && G(Q.value[s]); )
|
|
696
|
+
s = (s + o + u) % u, y++;
|
|
697
|
+
p.value = y >= u ? -1 : s, q();
|
|
698
698
|
}
|
|
699
699
|
function fe() {
|
|
700
|
-
if (
|
|
701
|
-
const o =
|
|
702
|
-
!o || G(o) || de(o,
|
|
700
|
+
if (p.value < 0) return;
|
|
701
|
+
const o = Q.value[p.value];
|
|
702
|
+
!o || G(o) || de(o, p.value);
|
|
703
703
|
}
|
|
704
704
|
function Y() {
|
|
705
|
-
if (!
|
|
706
|
-
const o =
|
|
705
|
+
if (!h.value) return;
|
|
706
|
+
const o = h.value.querySelector(".yselect__option--selected");
|
|
707
707
|
o && o.scrollIntoView({ block: "nearest" });
|
|
708
708
|
}
|
|
709
709
|
function q() {
|
|
710
|
-
if (!
|
|
711
|
-
const s =
|
|
710
|
+
if (!h.value || p.value < 0) return;
|
|
711
|
+
const s = h.value.querySelectorAll(".yselect__option")[p.value];
|
|
712
712
|
s && s.scrollIntoView({ block: "nearest" });
|
|
713
713
|
}
|
|
714
714
|
function v(o) {
|
|
@@ -716,16 +716,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
716
716
|
(!k.value || !k.value.contains(s)) && ee();
|
|
717
717
|
}
|
|
718
718
|
le(() => t.modelValue, () => {
|
|
719
|
-
|
|
719
|
+
p.value = -1;
|
|
720
720
|
});
|
|
721
721
|
function d() {
|
|
722
722
|
g.value && $();
|
|
723
723
|
}
|
|
724
|
-
return
|
|
724
|
+
return Me(() => {
|
|
725
725
|
document.addEventListener("click", v), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
|
|
726
726
|
}), Te(() => {
|
|
727
727
|
document.removeEventListener("click", v), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
|
|
728
|
-
}), (o, s) => (i(),
|
|
728
|
+
}), (o, s) => (i(), r("div", {
|
|
729
729
|
class: E(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
730
730
|
style: pe({ width: e.width }),
|
|
731
731
|
ref_key: "selectContainer",
|
|
@@ -739,20 +739,20 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
739
739
|
"yselect__trigger--disabled": e.disabled,
|
|
740
740
|
"yselect__trigger--error": e.error
|
|
741
741
|
}]),
|
|
742
|
-
onMousedown:
|
|
742
|
+
onMousedown: Z(X, ["prevent", "stop"]),
|
|
743
743
|
onKeydown: [
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
744
|
+
Ce(Z(X, ["prevent"]), ["enter"]),
|
|
745
|
+
Ce(Z(X, ["prevent"]), ["space"]),
|
|
746
|
+
Ce(ee, ["escape"]),
|
|
747
|
+
Ce(Z(ye, ["prevent"]), ["arrow-down"]),
|
|
748
|
+
Ce(Z(ye, ["prevent"]), ["arrow-up"])
|
|
749
749
|
],
|
|
750
750
|
tabindex: "0",
|
|
751
751
|
role: "combobox",
|
|
752
752
|
"aria-expanded": g.value,
|
|
753
753
|
"aria-haspopup": !0
|
|
754
754
|
}, [
|
|
755
|
-
!e.filterable || !g.value ? (i(),
|
|
755
|
+
!e.filterable || !g.value ? (i(), r("span", {
|
|
756
756
|
key: 0,
|
|
757
757
|
class: E(["yselect__value", { yselect__placeholder: !j.value }])
|
|
758
758
|
}, [
|
|
@@ -760,46 +760,46 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
760
760
|
value: C.value,
|
|
761
761
|
label: j.value
|
|
762
762
|
}, () => {
|
|
763
|
-
var
|
|
763
|
+
var u;
|
|
764
764
|
return [
|
|
765
|
-
C.value ? (i(),
|
|
766
|
-
(
|
|
765
|
+
C.value ? (i(), r(re, { key: 0 }, [
|
|
766
|
+
(u = C.value) != null && u.flagImg ? (i(), r("img", {
|
|
767
767
|
key: 0,
|
|
768
768
|
class: "yselect__flag",
|
|
769
769
|
src: C.value.flagImg,
|
|
770
770
|
alt: "flag"
|
|
771
|
-
}, null, 8, zt)) :
|
|
772
|
-
|
|
773
|
-
], 64)) : (i(),
|
|
774
|
-
|
|
771
|
+
}, null, 8, zt)) : V("", !0),
|
|
772
|
+
$e(" " + ne(j.value), 1)
|
|
773
|
+
], 64)) : (i(), r(re, { key: 1 }, [
|
|
774
|
+
$e(ne(e.placeholder), 1)
|
|
775
775
|
], 64))
|
|
776
776
|
];
|
|
777
777
|
}, !0)
|
|
778
|
-
], 2)) : Ee((i(),
|
|
778
|
+
], 2)) : Ee((i(), r("input", {
|
|
779
779
|
key: 1,
|
|
780
780
|
ref_key: "inputElement",
|
|
781
781
|
ref: x,
|
|
782
782
|
class: "yselect__input",
|
|
783
783
|
type: "text",
|
|
784
784
|
placeholder: j.value || e.placeholder,
|
|
785
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
785
|
+
"onUpdate:modelValue": s[0] || (s[0] = (u) => f.value = u),
|
|
786
786
|
onKeydown: [
|
|
787
|
-
s[1] || (s[1] =
|
|
787
|
+
s[1] || (s[1] = Z(() => {
|
|
788
788
|
}, ["stop"])),
|
|
789
|
-
s[2] || (s[2] =
|
|
790
|
-
s[3] || (s[3] =
|
|
791
|
-
s[4] || (s[4] =
|
|
792
|
-
|
|
793
|
-
|
|
789
|
+
s[2] || (s[2] = Ce(Z((u) => me(1), ["prevent"]), ["arrow-down"])),
|
|
790
|
+
s[3] || (s[3] = Ce(Z((u) => me(-1), ["prevent"]), ["arrow-up"])),
|
|
791
|
+
s[4] || (s[4] = Ce(Z((u) => fe(), ["prevent"]), ["enter"])),
|
|
792
|
+
Ce(Z(ee, ["prevent"]), ["esc"]),
|
|
793
|
+
Ce(Z(we, ["prevent"]), ["delete"])
|
|
794
794
|
]
|
|
795
795
|
}, null, 40, Kt)), [
|
|
796
796
|
[tt, f.value]
|
|
797
797
|
]),
|
|
798
|
-
e.clearable && !e.disabled && C.value ? (i(),
|
|
798
|
+
e.clearable && !e.disabled && C.value ? (i(), r("span", {
|
|
799
799
|
key: 2,
|
|
800
800
|
class: "yselect__clear",
|
|
801
801
|
title: "清空",
|
|
802
|
-
onClick:
|
|
802
|
+
onClick: Z(we, ["stop"])
|
|
803
803
|
}, [...s[8] || (s[8] = [
|
|
804
804
|
l("svg", {
|
|
805
805
|
width: "12",
|
|
@@ -814,7 +814,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
814
814
|
"stroke-linecap": "round"
|
|
815
815
|
})
|
|
816
816
|
], -1)
|
|
817
|
-
])])) :
|
|
817
|
+
])])) : V("", !0),
|
|
818
818
|
l("span", {
|
|
819
819
|
class: E(["yselect__arrow", { "yselect__arrow--open": g.value }])
|
|
820
820
|
}, [...s[9] || (s[9] = [
|
|
@@ -834,52 +834,52 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
834
834
|
], -1)
|
|
835
835
|
])], 2)
|
|
836
836
|
], 42, Tt),
|
|
837
|
-
ce(
|
|
837
|
+
ce(De, { name: "yselect-dropdown" }, {
|
|
838
838
|
default: ve(() => [
|
|
839
839
|
(i(), Be(Ae, { to: "body" }, [
|
|
840
|
-
g.value ? (i(),
|
|
840
|
+
g.value ? (i(), r("div", {
|
|
841
841
|
key: 0,
|
|
842
842
|
ref_key: "dropdownEl",
|
|
843
|
-
ref:
|
|
843
|
+
ref: _,
|
|
844
844
|
class: E(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": m.value }]),
|
|
845
845
|
style: pe(A.value),
|
|
846
|
-
onMousedown: s[6] || (s[6] =
|
|
846
|
+
onMousedown: s[6] || (s[6] = Z(() => {
|
|
847
847
|
}, ["stop"])),
|
|
848
|
-
onClick: s[7] || (s[7] =
|
|
848
|
+
onClick: s[7] || (s[7] = Z(() => {
|
|
849
849
|
}, ["stop"]))
|
|
850
850
|
}, [
|
|
851
851
|
l("div", {
|
|
852
852
|
class: "yselect__options",
|
|
853
853
|
ref_key: "optionsContainer",
|
|
854
|
-
ref:
|
|
854
|
+
ref: h
|
|
855
855
|
}, [
|
|
856
|
-
(i(!0),
|
|
857
|
-
key: H(
|
|
856
|
+
(i(!0), r(re, null, he(Q.value, (u, y) => (i(), r("div", {
|
|
857
|
+
key: H(u, y),
|
|
858
858
|
class: E(["yselect__option", {
|
|
859
|
-
"yselect__option--selected": P(
|
|
860
|
-
"yselect__option--disabled": G(
|
|
861
|
-
"yselect__option--hover":
|
|
859
|
+
"yselect__option--selected": P(u),
|
|
860
|
+
"yselect__option--disabled": G(u),
|
|
861
|
+
"yselect__option--hover": p.value === y
|
|
862
862
|
}]),
|
|
863
|
-
onClick: (w) => de(
|
|
864
|
-
onMouseenter: (w) =>
|
|
865
|
-
onMouseleave: s[5] || (s[5] = (w) =>
|
|
863
|
+
onClick: (w) => de(u),
|
|
864
|
+
onMouseenter: (w) => p.value = y,
|
|
865
|
+
onMouseleave: s[5] || (s[5] = (w) => p.value = -1)
|
|
866
866
|
}, [
|
|
867
867
|
ue(o.$slots, "option", {
|
|
868
|
-
option:
|
|
868
|
+
option: u,
|
|
869
869
|
index: y,
|
|
870
|
-
selected: P(
|
|
870
|
+
selected: P(u)
|
|
871
871
|
}, () => [
|
|
872
|
-
|
|
872
|
+
u != null && u.flagImg ? (i(), r("img", {
|
|
873
873
|
key: 0,
|
|
874
874
|
class: "yselect__flag",
|
|
875
|
-
src:
|
|
875
|
+
src: u.flagImg,
|
|
876
876
|
alt: "flag"
|
|
877
|
-
}, null, 8, Rt)) :
|
|
878
|
-
|
|
877
|
+
}, null, 8, Rt)) : V("", !0),
|
|
878
|
+
$e(" " + ne(I(u)), 1)
|
|
879
879
|
], !0)
|
|
880
880
|
], 42, Ht))), 128))
|
|
881
881
|
], 512)
|
|
882
|
-
], 38)) :
|
|
882
|
+
], 38)) : V("", !0)
|
|
883
883
|
]))
|
|
884
884
|
]),
|
|
885
885
|
_: 3
|
|
@@ -901,20 +901,20 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
901
901
|
},
|
|
902
902
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
903
903
|
setup(e, { emit: b }) {
|
|
904
|
-
const t = e, n = b, g = z(t.pageSize),
|
|
904
|
+
const t = e, n = b, g = z(t.pageSize), p = O(() => t.pageSizeOptions), h = O({
|
|
905
905
|
get: () => t.currentPage,
|
|
906
906
|
set: (m) => {
|
|
907
907
|
n("update:currentPage", m), n("page-change", m);
|
|
908
908
|
}
|
|
909
909
|
});
|
|
910
910
|
function L(m) {
|
|
911
|
-
t.loading || m >= 1 && m !== t.currentPage && (
|
|
911
|
+
t.loading || m >= 1 && m !== t.currentPage && (h.value = m);
|
|
912
912
|
}
|
|
913
913
|
function k(m) {
|
|
914
|
-
t.loading || (g.value = m, n("update:pageSize", m), n("page-size-change", m),
|
|
914
|
+
t.loading || (g.value = m, n("update:pageSize", m), n("page-size-change", m), h.value = 1);
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
t.loading || (m === "prev" ? L(
|
|
916
|
+
function _(m) {
|
|
917
|
+
t.loading || (m === "prev" ? L(h.value - 1) : m === "next" && L(h.value + 1));
|
|
918
918
|
}
|
|
919
919
|
return g.value = t.pageSize, le(
|
|
920
920
|
() => t.pageSize,
|
|
@@ -923,16 +923,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
923
923
|
}
|
|
924
924
|
), (m, x) => {
|
|
925
925
|
const f = Ve("YButton"), C = Ve("YSelect");
|
|
926
|
-
return i(),
|
|
926
|
+
return i(), r("div", At, [
|
|
927
927
|
l("div", Ft, [
|
|
928
928
|
ce(f, {
|
|
929
929
|
size: "small",
|
|
930
930
|
variant: "secondary",
|
|
931
|
-
disabled:
|
|
931
|
+
disabled: h.value === 1 || e.loading,
|
|
932
932
|
onClick: x[0] || (x[0] = (j) => L(1))
|
|
933
933
|
}, {
|
|
934
934
|
default: ve(() => [...x[2] || (x[2] = [
|
|
935
|
-
|
|
935
|
+
$e("首页", -1)
|
|
936
936
|
])]),
|
|
937
937
|
_: 1
|
|
938
938
|
}, 8, ["disabled"]),
|
|
@@ -941,16 +941,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
941
941
|
variant: "secondary",
|
|
942
942
|
size: "small",
|
|
943
943
|
groupItems: [
|
|
944
|
-
{ label: "上一页", value: "prev", disabled:
|
|
944
|
+
{ label: "上一页", value: "prev", disabled: h.value === 1 || e.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
945
945
|
{ label: "下一页", value: "next", disabled: e.loading, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
946
946
|
],
|
|
947
|
-
onGroupClick:
|
|
947
|
+
onGroupClick: _
|
|
948
948
|
}, null, 8, ["groupItems"]),
|
|
949
949
|
l("div", Wt, [
|
|
950
950
|
ce(C, {
|
|
951
951
|
modelValue: g.value,
|
|
952
952
|
"onUpdate:modelValue": x[1] || (x[1] = (j) => g.value = j),
|
|
953
|
-
options:
|
|
953
|
+
options: p.value,
|
|
954
954
|
size: "small",
|
|
955
955
|
width: "105px",
|
|
956
956
|
clearable: !1,
|
|
@@ -1018,16 +1018,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1018
1018
|
},
|
|
1019
1019
|
setup(e) {
|
|
1020
1020
|
const b = e, t = O(() => b.tone || "default"), n = O(() => {
|
|
1021
|
-
const g = (b.label || "").trim(),
|
|
1022
|
-
if (
|
|
1021
|
+
const g = (b.label || "").trim(), p = b.tone, h = b.progress;
|
|
1022
|
+
if (h) {
|
|
1023
1023
|
const L = {
|
|
1024
1024
|
incomplete: "未完成",
|
|
1025
1025
|
partiallyComplete: "部分完成",
|
|
1026
1026
|
complete: "已完成"
|
|
1027
1027
|
};
|
|
1028
|
-
return g ? `${g},进度:${L[
|
|
1028
|
+
return g ? `${g},进度:${L[h] || h}` : `进度:${L[h] || h}`;
|
|
1029
1029
|
}
|
|
1030
|
-
if (
|
|
1030
|
+
if (p && p !== "default") {
|
|
1031
1031
|
const L = {
|
|
1032
1032
|
informational: "信息",
|
|
1033
1033
|
success: "成功",
|
|
@@ -1036,11 +1036,11 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1036
1036
|
critical: "严重",
|
|
1037
1037
|
default: "默认"
|
|
1038
1038
|
};
|
|
1039
|
-
return g ? `${g},语气:${L[
|
|
1039
|
+
return g ? `${g},语气:${L[p] || p}` : `语气:${L[p] || p}`;
|
|
1040
1040
|
}
|
|
1041
1041
|
return g || "标记";
|
|
1042
1042
|
});
|
|
1043
|
-
return (g,
|
|
1043
|
+
return (g, p) => (i(), r("span", {
|
|
1044
1044
|
class: E(["y-badge", [
|
|
1045
1045
|
`y-badge--${t.value}`,
|
|
1046
1046
|
`y-badge--${e.size}`,
|
|
@@ -1051,14 +1051,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1051
1051
|
"aria-label": n.value
|
|
1052
1052
|
}, [
|
|
1053
1053
|
l("span", Ot, [
|
|
1054
|
-
e.progress ? (i(),
|
|
1055
|
-
e.progress === "incomplete" ? (i(),
|
|
1054
|
+
e.progress ? (i(), r("span", jt, [
|
|
1055
|
+
e.progress === "incomplete" ? (i(), r("svg", qt, [...p[0] || (p[0] = [
|
|
1056
1056
|
l("circle", {
|
|
1057
1057
|
cx: "10",
|
|
1058
1058
|
cy: "10",
|
|
1059
1059
|
r: "5"
|
|
1060
1060
|
}, null, -1)
|
|
1061
|
-
])])) : e.progress === "partiallyComplete" ? (i(),
|
|
1061
|
+
])])) : e.progress === "partiallyComplete" ? (i(), r("svg", Ut, [...p[1] || (p[1] = [
|
|
1062
1062
|
l("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1063
1063
|
l("circle", {
|
|
1064
1064
|
cx: "10",
|
|
@@ -1068,43 +1068,43 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1068
1068
|
stroke: "currentColor",
|
|
1069
1069
|
"stroke-width": "2"
|
|
1070
1070
|
}, null, -1)
|
|
1071
|
-
])])) : e.progress === "complete" ? (i(),
|
|
1071
|
+
])])) : e.progress === "complete" ? (i(), r("svg", Zt, [...p[2] || (p[2] = [
|
|
1072
1072
|
l("path", {
|
|
1073
1073
|
"fill-rule": "evenodd",
|
|
1074
1074
|
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",
|
|
1075
1075
|
"clip-rule": "evenodd"
|
|
1076
1076
|
}, null, -1)
|
|
1077
|
-
])])) :
|
|
1078
|
-
])) : e.icon ? (i(),
|
|
1079
|
-
e.icon === "dot" ? (i(),
|
|
1077
|
+
])])) : V("", !0)
|
|
1078
|
+
])) : e.icon ? (i(), r("span", Qt, [
|
|
1079
|
+
e.icon === "dot" ? (i(), r("svg", Jt, [...p[3] || (p[3] = [
|
|
1080
1080
|
l("circle", {
|
|
1081
1081
|
cx: "10",
|
|
1082
1082
|
cy: "10",
|
|
1083
1083
|
r: "4"
|
|
1084
1084
|
}, null, -1)
|
|
1085
|
-
])])) : e.icon === "check" ? (i(),
|
|
1085
|
+
])])) : e.icon === "check" ? (i(), r("svg", Xt, [...p[4] || (p[4] = [
|
|
1086
1086
|
l("path", {
|
|
1087
1087
|
"fill-rule": "evenodd",
|
|
1088
1088
|
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",
|
|
1089
1089
|
"clip-rule": "evenodd"
|
|
1090
1090
|
}, null, -1)
|
|
1091
|
-
])])) : e.icon === "alert" ? (i(),
|
|
1091
|
+
])])) : e.icon === "alert" ? (i(), r("svg", Gt, [...p[5] || (p[5] = [
|
|
1092
1092
|
l("path", {
|
|
1093
1093
|
"fill-rule": "evenodd",
|
|
1094
1094
|
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",
|
|
1095
1095
|
"clip-rule": "evenodd"
|
|
1096
1096
|
}, null, -1)
|
|
1097
|
-
])])) : (i(),
|
|
1097
|
+
])])) : (i(), r("svg", en, [...p[6] || (p[6] = [
|
|
1098
1098
|
l("circle", {
|
|
1099
1099
|
cx: "10",
|
|
1100
1100
|
cy: "10",
|
|
1101
1101
|
r: "4"
|
|
1102
1102
|
}, null, -1)
|
|
1103
1103
|
])]))
|
|
1104
|
-
])) :
|
|
1104
|
+
])) : V("", !0),
|
|
1105
1105
|
l("span", tn, [
|
|
1106
1106
|
ue(g.$slots, "default", {}, () => [
|
|
1107
|
-
|
|
1107
|
+
$e(ne(e.label), 1)
|
|
1108
1108
|
], !0)
|
|
1109
1109
|
])
|
|
1110
1110
|
])
|
|
@@ -1134,7 +1134,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1134
1134
|
const t = e, n = b, g = O({
|
|
1135
1135
|
get: () => t.modelValue,
|
|
1136
1136
|
set: (x) => n("update:modelValue", x)
|
|
1137
|
-
}),
|
|
1137
|
+
}), p = z(null), h = O(() => {
|
|
1138
1138
|
const x = {};
|
|
1139
1139
|
return x.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), x.margin = "0 auto", x.top = t.top, x;
|
|
1140
1140
|
});
|
|
@@ -1144,18 +1144,18 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1144
1144
|
function k() {
|
|
1145
1145
|
g.value && (g.value = !1, n("close"));
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function _() {
|
|
1148
1148
|
t.closable && k();
|
|
1149
1149
|
}
|
|
1150
1150
|
function m(x) {
|
|
1151
|
-
x.key === "Escape" &&
|
|
1151
|
+
x.key === "Escape" && _();
|
|
1152
1152
|
}
|
|
1153
1153
|
return le(() => t.modelValue, (x) => {
|
|
1154
1154
|
x ? (n("open"), requestAnimationFrame(() => {
|
|
1155
1155
|
var f;
|
|
1156
|
-
return (f =
|
|
1156
|
+
return (f = p.value) == null ? void 0 : f.focus();
|
|
1157
1157
|
}), document.addEventListener("keydown", m), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", m), document.body.style.overflow = "");
|
|
1158
|
-
}),
|
|
1158
|
+
}), Me(() => {
|
|
1159
1159
|
t.modelValue && (document.addEventListener("keydown", m), document.body.style.overflow = "hidden");
|
|
1160
1160
|
}), Te(() => {
|
|
1161
1161
|
document.removeEventListener("keydown", m), document.body.style.overflow = "";
|
|
@@ -1171,34 +1171,34 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1171
1171
|
class: "y-dialog-mask",
|
|
1172
1172
|
onClick: L
|
|
1173
1173
|
}),
|
|
1174
|
-
ce(
|
|
1174
|
+
ce(De, { name: "dialog-zoom-fade" }, {
|
|
1175
1175
|
default: ve(() => [
|
|
1176
1176
|
Ee(l("div", {
|
|
1177
1177
|
ref_key: "panelRef",
|
|
1178
|
-
ref:
|
|
1178
|
+
ref: p,
|
|
1179
1179
|
class: E(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1180
|
-
style: pe(
|
|
1181
|
-
onKeydown:
|
|
1180
|
+
style: pe(h.value),
|
|
1181
|
+
onKeydown: Ce(Z(_, ["prevent", "stop"]), ["esc"]),
|
|
1182
1182
|
tabindex: "-1"
|
|
1183
1183
|
}, [
|
|
1184
|
-
e.showHeader ? (i(),
|
|
1184
|
+
e.showHeader ? (i(), r("div", sn, [
|
|
1185
1185
|
ue(x.$slots, "header", {}, () => [
|
|
1186
1186
|
l("div", rn, ne(e.title), 1)
|
|
1187
1187
|
], !0),
|
|
1188
|
-
e.closable ? (i(),
|
|
1188
|
+
e.closable ? (i(), r("button", {
|
|
1189
1189
|
key: 0,
|
|
1190
1190
|
type: "button",
|
|
1191
1191
|
class: "y-dialog-close",
|
|
1192
1192
|
"aria-label": "Close",
|
|
1193
1193
|
onClick: k
|
|
1194
|
-
}, " ✕ ")) :
|
|
1195
|
-
])) :
|
|
1194
|
+
}, " ✕ ")) : V("", !0)
|
|
1195
|
+
])) : V("", !0),
|
|
1196
1196
|
l("div", un, [
|
|
1197
1197
|
ue(x.$slots, "default", {}, void 0, !0)
|
|
1198
1198
|
]),
|
|
1199
|
-
x.$slots.footer ? (i(),
|
|
1199
|
+
x.$slots.footer ? (i(), r("div", cn, [
|
|
1200
1200
|
ue(x.$slots, "footer", {}, void 0, !0)
|
|
1201
|
-
])) :
|
|
1201
|
+
])) : V("", !0)
|
|
1202
1202
|
], 46, an), [
|
|
1203
1203
|
[He, g.value]
|
|
1204
1204
|
])
|
|
@@ -1230,15 +1230,15 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1230
1230
|
},
|
|
1231
1231
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1232
1232
|
setup(e, { expose: b, emit: t }) {
|
|
1233
|
-
const n = e, g = t,
|
|
1233
|
+
const n = e, g = t, p = z(), h = z(), L = z(), k = z(!1), _ = z(), m = z(), x = z({});
|
|
1234
1234
|
let f = null, C = null;
|
|
1235
1235
|
const j = O(() => {
|
|
1236
|
-
if (!k.value || !
|
|
1236
|
+
if (!k.value || !_.value) return {};
|
|
1237
1237
|
const Y = {};
|
|
1238
1238
|
n.width !== "auto" && (Y.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (Y.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1239
1239
|
const { top: q, left: v } = A();
|
|
1240
1240
|
return Y.top = `${q}px`, Y.left = `${v}px`, Y;
|
|
1241
|
-
}),
|
|
1241
|
+
}), Q = O(() => {
|
|
1242
1242
|
if (!n.showArrow) return {};
|
|
1243
1243
|
if (Object.keys(x.value).length > 0)
|
|
1244
1244
|
return x.value;
|
|
@@ -1246,50 +1246,50 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1246
1246
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? Y.left = "50%" : Y.top = "50%", Y;
|
|
1247
1247
|
});
|
|
1248
1248
|
function A() {
|
|
1249
|
-
var
|
|
1250
|
-
if (!
|
|
1251
|
-
const { width: Y, height: q, top: v, left: d } =
|
|
1252
|
-
let
|
|
1249
|
+
var U, J;
|
|
1250
|
+
if (!_.value) return { top: 0, left: 0 };
|
|
1251
|
+
const { width: Y, height: q, top: v, left: d } = _.value, o = ((U = L.value) == null ? void 0 : U.offsetWidth) || 200, s = ((J = L.value) == null ? void 0 : J.offsetHeight) || 100;
|
|
1252
|
+
let u = 0, y = 0;
|
|
1253
1253
|
switch (n.placement) {
|
|
1254
1254
|
case "top":
|
|
1255
|
-
|
|
1255
|
+
u = v - s - n.offset, y = d + (Y - o) / 2;
|
|
1256
1256
|
break;
|
|
1257
1257
|
case "top-start":
|
|
1258
|
-
|
|
1258
|
+
u = v - s - n.offset, y = d;
|
|
1259
1259
|
break;
|
|
1260
1260
|
case "top-end":
|
|
1261
|
-
|
|
1261
|
+
u = v - s - n.offset, y = d + Y - o;
|
|
1262
1262
|
break;
|
|
1263
1263
|
case "bottom":
|
|
1264
|
-
|
|
1264
|
+
u = v + q + n.offset, y = d + (Y - o) / 2;
|
|
1265
1265
|
break;
|
|
1266
1266
|
case "bottom-start":
|
|
1267
|
-
|
|
1267
|
+
u = v + q + n.offset, y = d;
|
|
1268
1268
|
break;
|
|
1269
1269
|
case "bottom-end":
|
|
1270
|
-
|
|
1270
|
+
u = v + q + n.offset, y = d + Y - o;
|
|
1271
1271
|
break;
|
|
1272
1272
|
case "left":
|
|
1273
|
-
|
|
1273
|
+
u = v + (q - s) / 2, y = d - o - n.offset;
|
|
1274
1274
|
break;
|
|
1275
1275
|
case "left-start":
|
|
1276
|
-
|
|
1276
|
+
u = v, y = d - o - n.offset;
|
|
1277
1277
|
break;
|
|
1278
1278
|
case "left-end":
|
|
1279
|
-
|
|
1279
|
+
u = v + q - s, y = d - o - n.offset;
|
|
1280
1280
|
break;
|
|
1281
1281
|
case "right":
|
|
1282
|
-
|
|
1282
|
+
u = v + (q - s) / 2, y = d + Y + n.offset;
|
|
1283
1283
|
break;
|
|
1284
1284
|
case "right-start":
|
|
1285
|
-
|
|
1285
|
+
u = v, y = d + Y + n.offset;
|
|
1286
1286
|
break;
|
|
1287
1287
|
case "right-end":
|
|
1288
|
-
|
|
1288
|
+
u = v + q - s, y = d + Y + n.offset;
|
|
1289
1289
|
break;
|
|
1290
1290
|
}
|
|
1291
|
-
const w = window.innerWidth,
|
|
1292
|
-
return y < 8 && (y = 8), y + o > w - 8 && (y = w - o - 8),
|
|
1291
|
+
const w = window.innerWidth, R = window.innerHeight;
|
|
1292
|
+
return y < 8 && (y = 8), y + o > w - 8 && (y = w - o - 8), u < 8 && (u = 8), u + s > R - 8 && (u = R - s - 8), { top: u, left: y };
|
|
1293
1293
|
}
|
|
1294
1294
|
function $() {
|
|
1295
1295
|
n.disabled || k.value || (P(), n.openDelay > 0 ? f = setTimeout(() => {
|
|
@@ -1297,9 +1297,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1297
1297
|
}, n.openDelay) : T());
|
|
1298
1298
|
}
|
|
1299
1299
|
function T() {
|
|
1300
|
-
g("before-show"), k.value = !0, g("update:modelValue", !0), g("show"),
|
|
1301
|
-
|
|
1302
|
-
|
|
1300
|
+
g("before-show"), k.value = !0, g("update:modelValue", !0), g("show"), se(() => {
|
|
1301
|
+
se(() => {
|
|
1302
|
+
X();
|
|
1303
1303
|
});
|
|
1304
1304
|
});
|
|
1305
1305
|
}
|
|
@@ -1315,11 +1315,11 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1315
1315
|
f && (clearTimeout(f), f = null), C && (clearTimeout(C), C = null);
|
|
1316
1316
|
}
|
|
1317
1317
|
function G() {
|
|
1318
|
-
if (!n.showArrow || !
|
|
1318
|
+
if (!n.showArrow || !_.value || !L.value) {
|
|
1319
1319
|
x.value = {};
|
|
1320
1320
|
return;
|
|
1321
1321
|
}
|
|
1322
|
-
const Y =
|
|
1322
|
+
const Y = _.value, q = L.value.getBoundingClientRect();
|
|
1323
1323
|
if (q.width === 0 || q.height === 0) {
|
|
1324
1324
|
const d = {};
|
|
1325
1325
|
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? d.left = "50%" : d.top = "50%", x.value = d;
|
|
@@ -1345,8 +1345,8 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1345
1345
|
}
|
|
1346
1346
|
x.value = v;
|
|
1347
1347
|
}
|
|
1348
|
-
function
|
|
1349
|
-
|
|
1348
|
+
function X() {
|
|
1349
|
+
h.value && (_.value = h.value.getBoundingClientRect(), L.value && (m.value = L.value.getBoundingClientRect(), G(), k.value && requestAnimationFrame(() => {
|
|
1350
1350
|
L.value && (m.value = L.value.getBoundingClientRect(), G());
|
|
1351
1351
|
})));
|
|
1352
1352
|
}
|
|
@@ -1368,34 +1368,34 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1368
1368
|
function fe(Y) {
|
|
1369
1369
|
if (!n.closeOnClickOutside || !k.value) return;
|
|
1370
1370
|
const q = Y.target;
|
|
1371
|
-
|
|
1371
|
+
p.value && !p.value.contains(q) && L.value && !L.value.contains(q) && I();
|
|
1372
1372
|
}
|
|
1373
1373
|
return le(() => n.modelValue, (Y) => {
|
|
1374
1374
|
Y !== k.value && (Y ? $() : I());
|
|
1375
1375
|
}), le(k, (Y) => {
|
|
1376
|
-
Y ? (document.addEventListener("click", fe), window.addEventListener("resize",
|
|
1377
|
-
|
|
1378
|
-
|
|
1376
|
+
Y ? (document.addEventListener("click", fe), window.addEventListener("resize", X), window.addEventListener("scroll", X, !0), se(() => {
|
|
1377
|
+
X(), requestAnimationFrame(() => {
|
|
1378
|
+
X();
|
|
1379
1379
|
}), setTimeout(() => {
|
|
1380
|
-
|
|
1380
|
+
X();
|
|
1381
1381
|
}, 0);
|
|
1382
|
-
})) : (document.removeEventListener("click", fe), window.removeEventListener("resize",
|
|
1383
|
-
}),
|
|
1382
|
+
})) : (document.removeEventListener("click", fe), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0));
|
|
1383
|
+
}), Me(() => {
|
|
1384
1384
|
n.modelValue && $();
|
|
1385
1385
|
}), Te(() => {
|
|
1386
|
-
P(), document.removeEventListener("click", fe), window.removeEventListener("resize",
|
|
1386
|
+
P(), document.removeEventListener("click", fe), window.removeEventListener("resize", X), window.removeEventListener("scroll", X, !0);
|
|
1387
1387
|
}), b({
|
|
1388
1388
|
show: $,
|
|
1389
1389
|
hide: I,
|
|
1390
|
-
updatePosition:
|
|
1391
|
-
}), (Y, q) => (i(),
|
|
1390
|
+
updatePosition: X
|
|
1391
|
+
}), (Y, q) => (i(), r("div", {
|
|
1392
1392
|
class: "ypopover",
|
|
1393
1393
|
ref_key: "popoverRef",
|
|
1394
|
-
ref:
|
|
1394
|
+
ref: p
|
|
1395
1395
|
}, [
|
|
1396
1396
|
l("div", {
|
|
1397
1397
|
ref_key: "triggerRef",
|
|
1398
|
-
ref:
|
|
1398
|
+
ref: h,
|
|
1399
1399
|
onClick: ye,
|
|
1400
1400
|
onMouseenter: ee,
|
|
1401
1401
|
onMouseleave: de
|
|
@@ -1403,9 +1403,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1403
1403
|
ue(Y.$slots, "reference", {}, void 0, !0)
|
|
1404
1404
|
], 544),
|
|
1405
1405
|
(i(), Be(Ae, { to: "body" }, [
|
|
1406
|
-
ce(
|
|
1406
|
+
ce(De, { name: "ypopover-fade" }, {
|
|
1407
1407
|
default: ve(() => [
|
|
1408
|
-
k.value ? (i(),
|
|
1408
|
+
k.value ? (i(), r("div", {
|
|
1409
1409
|
key: 0,
|
|
1410
1410
|
ref_key: "contentRef",
|
|
1411
1411
|
ref: L,
|
|
@@ -1417,20 +1417,20 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1417
1417
|
}
|
|
1418
1418
|
]]),
|
|
1419
1419
|
style: pe(j.value),
|
|
1420
|
-
onClick: q[0] || (q[0] =
|
|
1420
|
+
onClick: q[0] || (q[0] = Z(() => {
|
|
1421
1421
|
}, ["stop"])),
|
|
1422
1422
|
onMouseenter: we,
|
|
1423
1423
|
onMouseleave: me
|
|
1424
1424
|
}, [
|
|
1425
|
-
e.showArrow ? (i(),
|
|
1425
|
+
e.showArrow ? (i(), r("div", {
|
|
1426
1426
|
key: 0,
|
|
1427
1427
|
class: E(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1428
|
-
style: pe(
|
|
1429
|
-
}, null, 6)) :
|
|
1428
|
+
style: pe(Q.value)
|
|
1429
|
+
}, null, 6)) : V("", !0),
|
|
1430
1430
|
l("div", vn, [
|
|
1431
1431
|
ue(Y.$slots, "default", {}, void 0, !0)
|
|
1432
1432
|
])
|
|
1433
|
-
], 38)) :
|
|
1433
|
+
], 38)) : V("", !0)
|
|
1434
1434
|
]),
|
|
1435
1435
|
_: 3
|
|
1436
1436
|
})
|
|
@@ -1497,7 +1497,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1497
1497
|
},
|
|
1498
1498
|
emits: ["update:modelValue", "change"],
|
|
1499
1499
|
setup(e, { emit: b }) {
|
|
1500
|
-
const t = e, n = b, g = z(!1),
|
|
1500
|
+
const t = e, n = b, g = z(!1), p = z(-1), h = z(-1), L = z(null), k = z(), _ = z(), m = z({
|
|
1501
1501
|
top: !0,
|
|
1502
1502
|
left: !0
|
|
1503
1503
|
}), x = z({
|
|
@@ -1518,7 +1518,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1518
1518
|
const M = new Date(f.value.year, f.value.month - 1);
|
|
1519
1519
|
x.value.year = M.getFullYear(), x.value.month = M.getMonth();
|
|
1520
1520
|
}
|
|
1521
|
-
},
|
|
1521
|
+
}, Q = ["一", "二", "三", "四", "五", "六", "日"], A = z(null), $ = z(null), T = (a) => {
|
|
1522
1522
|
if (!a) return null;
|
|
1523
1523
|
if (a instanceof Date) return a;
|
|
1524
1524
|
if (typeof a == "number")
|
|
@@ -1532,8 +1532,8 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1532
1532
|
if (!a) return null;
|
|
1533
1533
|
const c = a.getFullYear(), M = String(a.getMonth() + 1).padStart(2, "0"), W = String(a.getDate()).padStart(2, "0");
|
|
1534
1534
|
if (t.includeTime) {
|
|
1535
|
-
const ae = String(a.getHours()).padStart(2, "0"), oe = String(a.getMinutes()).padStart(2, "0"),
|
|
1536
|
-
return `${c}-${M}-${W} ${ae}:${oe}:${
|
|
1535
|
+
const ae = String(a.getHours()).padStart(2, "0"), oe = String(a.getMinutes()).padStart(2, "0"), ie = String(a.getSeconds()).padStart(2, "0");
|
|
1536
|
+
return `${c}-${M}-${W} ${ae}:${oe}:${ie}`;
|
|
1537
1537
|
} else
|
|
1538
1538
|
return `${c}-${M}-${W}`;
|
|
1539
1539
|
}, H = (a) => a ? a.getTime() : null, P = (a) => a ? {
|
|
@@ -1545,7 +1545,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1545
1545
|
} : t.format === "timestamp" ? {
|
|
1546
1546
|
startDate: H(a.startDate),
|
|
1547
1547
|
endDate: H(a.endDate)
|
|
1548
|
-
} : a,
|
|
1548
|
+
} : a, X = (a, c) => `${String(c + 1).padStart(2, "0")}/${a}`, ye = (a, c) => a.getFullYear() === c.getFullYear() && a.getMonth() === c.getMonth() && a.getDate() === c.getDate(), ee = (a, c, M) => !c || !M ? !1 : a >= c && a <= M, de = (a) => {
|
|
1549
1549
|
const c = P(a);
|
|
1550
1550
|
if (!(c != null && c.startDate) || !(c != null && c.endDate))
|
|
1551
1551
|
return -1;
|
|
@@ -1560,29 +1560,29 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1560
1560
|
c.endDate.getFullYear(),
|
|
1561
1561
|
c.endDate.getMonth(),
|
|
1562
1562
|
c.endDate.getDate()
|
|
1563
|
-
),
|
|
1563
|
+
), ie = new Date(
|
|
1564
1564
|
W.startDate.getFullYear(),
|
|
1565
1565
|
W.startDate.getMonth(),
|
|
1566
1566
|
W.startDate.getDate()
|
|
1567
|
-
),
|
|
1567
|
+
), _e = new Date(
|
|
1568
1568
|
W.endDate.getFullYear(),
|
|
1569
1569
|
W.endDate.getMonth(),
|
|
1570
1570
|
W.endDate.getDate()
|
|
1571
1571
|
);
|
|
1572
|
-
if (ae.getTime() ===
|
|
1572
|
+
if (ae.getTime() === ie.getTime() && oe.getTime() === _e.getTime())
|
|
1573
1573
|
return M;
|
|
1574
1574
|
}
|
|
1575
1575
|
}
|
|
1576
1576
|
return -1;
|
|
1577
1577
|
}, we = (a, c) => {
|
|
1578
|
-
const M = new Date(a, c, 1), W = new Date(a, c + 1, 0), ae = M.getDay(), oe = W.getDate(),
|
|
1578
|
+
const M = new Date(a, c, 1), W = new Date(a, c + 1, 0), ae = M.getDay(), oe = W.getDate(), ie = [], _e = /* @__PURE__ */ new Date(), Pe = ae === 0 ? 6 : ae - 1, Ge = new Date(a, c, 0);
|
|
1579
1579
|
for (let ge = Pe - 1; ge >= 0; ge--) {
|
|
1580
1580
|
const Le = new Date(a, c - 1, Ge.getDate() - ge);
|
|
1581
|
-
|
|
1581
|
+
ie.push({
|
|
1582
1582
|
date: Le,
|
|
1583
1583
|
day: Le.getDate(),
|
|
1584
1584
|
isCurrentMonth: !1,
|
|
1585
|
-
isToday: ye(Le,
|
|
1585
|
+
isToday: ye(Le, _e),
|
|
1586
1586
|
isSelected: !1,
|
|
1587
1587
|
isInRange: !1,
|
|
1588
1588
|
isDisabled: !0
|
|
@@ -1591,24 +1591,24 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1591
1591
|
}
|
|
1592
1592
|
for (let ge = 1; ge <= oe; ge++) {
|
|
1593
1593
|
const Le = new Date(a, c, ge);
|
|
1594
|
-
|
|
1594
|
+
ie.push({
|
|
1595
1595
|
date: Le,
|
|
1596
1596
|
day: ge,
|
|
1597
1597
|
isCurrentMonth: !0,
|
|
1598
|
-
isToday: ye(Le,
|
|
1598
|
+
isToday: ye(Le, _e),
|
|
1599
1599
|
isSelected: !1,
|
|
1600
1600
|
isInRange: !1,
|
|
1601
1601
|
isDisabled: !1
|
|
1602
1602
|
});
|
|
1603
1603
|
}
|
|
1604
|
-
const et = 42 -
|
|
1604
|
+
const et = 42 - ie.length;
|
|
1605
1605
|
for (let ge = 1; ge <= et; ge++) {
|
|
1606
1606
|
const Le = new Date(a, c + 1, ge);
|
|
1607
|
-
|
|
1607
|
+
ie.push({
|
|
1608
1608
|
date: Le,
|
|
1609
1609
|
day: ge,
|
|
1610
1610
|
isCurrentMonth: !1,
|
|
1611
|
-
isToday: ye(Le,
|
|
1611
|
+
isToday: ye(Le, _e),
|
|
1612
1612
|
isSelected: !1,
|
|
1613
1613
|
isInRange: !1,
|
|
1614
1614
|
isDisabled: !0
|
|
@@ -1616,58 +1616,58 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1616
1616
|
});
|
|
1617
1617
|
}
|
|
1618
1618
|
const je = [];
|
|
1619
|
-
for (let ge = 0; ge <
|
|
1620
|
-
je.push(
|
|
1619
|
+
for (let ge = 0; ge < ie.length; ge += 7)
|
|
1620
|
+
je.push(ie.slice(ge, ge + 7));
|
|
1621
1621
|
return je;
|
|
1622
1622
|
}, me = (a) => {
|
|
1623
1623
|
const c = G(a);
|
|
1624
1624
|
n("update:modelValue", c), n("change", c);
|
|
1625
1625
|
}, fe = () => {
|
|
1626
|
-
if (!k.value || !
|
|
1627
|
-
const a = k.value.getBoundingClientRect(), c =
|
|
1628
|
-
ae <
|
|
1629
|
-
const
|
|
1630
|
-
|
|
1626
|
+
if (!k.value || !_.value) return;
|
|
1627
|
+
const a = k.value.getBoundingClientRect(), c = _.value.getBoundingClientRect(), M = window.innerWidth, ae = window.innerHeight - a.bottom, oe = a.top, ie = c.height || 400;
|
|
1628
|
+
ae < ie && oe > ie ? m.value.top = !1 : m.value.top = !0;
|
|
1629
|
+
const _e = M - a.left, Pe = c.width || 640;
|
|
1630
|
+
_e < Pe ? m.value.left = !1 : m.value.left = !0;
|
|
1631
1631
|
}, Y = () => {
|
|
1632
1632
|
if (g.value = !g.value, g.value) {
|
|
1633
1633
|
const a = P(t.modelValue);
|
|
1634
|
-
if (A.value = (a == null ? void 0 : a.startDate) || null, $.value = (a == null ? void 0 : a.endDate) || null,
|
|
1634
|
+
if (A.value = (a == null ? void 0 : a.startDate) || null, $.value = (a == null ? void 0 : a.endDate) || null, h.value = de(t.modelValue), p.value = -1, a != null && a.startDate && (x.value.year = a.startDate.getFullYear(), x.value.month = a.startDate.getMonth()), a != null && a.endDate)
|
|
1635
1635
|
f.value.year = a.endDate.getFullYear(), f.value.month = a.endDate.getMonth();
|
|
1636
1636
|
else {
|
|
1637
1637
|
const c = new Date(x.value.year, x.value.month + 1);
|
|
1638
1638
|
f.value.year = c.getFullYear(), f.value.month = c.getMonth();
|
|
1639
1639
|
}
|
|
1640
|
-
C(),
|
|
1640
|
+
C(), se(() => {
|
|
1641
1641
|
fe();
|
|
1642
1642
|
});
|
|
1643
1643
|
}
|
|
1644
1644
|
}, q = (a) => {
|
|
1645
|
-
const c = a.target, M = k.value, W =
|
|
1646
|
-
M && W && !M.contains(c) && !W.contains(c) && (g.value = !1,
|
|
1645
|
+
const c = a.target, M = k.value, W = _.value;
|
|
1646
|
+
M && W && !M.contains(c) && !W.contains(c) && (g.value = !1, p.value = -1);
|
|
1647
1647
|
}, v = (a) => {
|
|
1648
|
-
a.key === "Enter" || a.key === " " ? (a.preventDefault(), Y()) : a.key === "ArrowDown" && (a.preventDefault(), g.value = !0,
|
|
1648
|
+
a.key === "Enter" || a.key === " " ? (a.preventDefault(), Y()) : a.key === "ArrowDown" && (a.preventDefault(), g.value = !0, se(() => {
|
|
1649
1649
|
fe(), y();
|
|
1650
1650
|
}));
|
|
1651
1651
|
}, d = (a) => {
|
|
1652
1652
|
var c;
|
|
1653
|
-
a.key === "Escape" && (g.value = !1,
|
|
1653
|
+
a.key === "Escape" && (g.value = !1, p.value = -1, (c = k.value) == null || c.focus());
|
|
1654
1654
|
}, o = (a, c) => {
|
|
1655
|
-
a.key === "ArrowDown" ? (a.preventDefault(),
|
|
1655
|
+
a.key === "ArrowDown" ? (a.preventDefault(), p.value = Math.min(c + 1, t.shortcuts.length - 1), w(p.value)) : a.key === "ArrowUp" ? (a.preventDefault(), p.value = Math.max(c - 1, 0), w(p.value)) : (a.key === "Enter" || a.key === " ") && (a.preventDefault(), R(t.shortcuts[c]));
|
|
1656
1656
|
}, s = (a) => {
|
|
1657
|
-
|
|
1658
|
-
},
|
|
1659
|
-
|
|
1657
|
+
p.value = a;
|
|
1658
|
+
}, u = () => {
|
|
1659
|
+
p.value = -1;
|
|
1660
1660
|
}, y = () => {
|
|
1661
|
-
|
|
1661
|
+
p.value = 0, w(0);
|
|
1662
1662
|
}, w = (a) => {
|
|
1663
|
-
if (
|
|
1664
|
-
const M =
|
|
1663
|
+
if (_.value) {
|
|
1664
|
+
const M = _.value.querySelectorAll(".nh-time-shortcut")[a];
|
|
1665
1665
|
M && M.focus();
|
|
1666
1666
|
}
|
|
1667
|
-
},
|
|
1667
|
+
}, R = (a) => {
|
|
1668
1668
|
const c = a.getValue();
|
|
1669
|
-
t.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)), me(c),
|
|
1670
|
-
},
|
|
1669
|
+
t.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)), me(c), h.value = t.shortcuts.findIndex((M) => M.label === a.label), p.value = -1, g.value = !1;
|
|
1670
|
+
}, U = (a, c) => {
|
|
1671
1671
|
if (!a || a.isDisabled) return;
|
|
1672
1672
|
let M;
|
|
1673
1673
|
if (t.includeTime ? (M = new Date(a.date), c === "start" || !A.value ? M.setHours(0, 0, 0, 0) : M.setHours(23, 59, 59, 999)) : M = new Date(a.date.getFullYear(), a.date.getMonth(), a.date.getDate()), !A.value && !$.value)
|
|
@@ -1681,7 +1681,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1681
1681
|
}
|
|
1682
1682
|
else
|
|
1683
1683
|
A.value = M, $.value = null;
|
|
1684
|
-
if (
|
|
1684
|
+
if (h.value = -1, A.value && $.value) {
|
|
1685
1685
|
const W = new Date($.value);
|
|
1686
1686
|
t.includeTime && W.setHours(23, 59, 59, 999), L.value = {
|
|
1687
1687
|
startDate: A.value,
|
|
@@ -1689,28 +1689,28 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1689
1689
|
};
|
|
1690
1690
|
} else
|
|
1691
1691
|
L.value = null;
|
|
1692
|
-
},
|
|
1692
|
+
}, J = (a, c) => {
|
|
1693
1693
|
if (!a) return ["nh-date-table-td"];
|
|
1694
1694
|
const M = ["nh-date-table-td"];
|
|
1695
1695
|
return a.isCurrentMonth || M.push("is-prev-month"), a.isToday && M.push("is-today"), a.isDisabled && M.push("is-disabled"), A.value && ye(a.date, A.value) && M.push("is-selected", "is-start"), $.value && ye(a.date, $.value) && M.push("is-selected", "is-end"), A.value && $.value && ee(a.date, A.value, $.value) && M.push("is-in-range"), M;
|
|
1696
|
-
},
|
|
1697
|
-
L.value && (t.includeTime && L.value.endDate && L.value.endDate.setHours(23, 59, 59, 999), me(L.value),
|
|
1696
|
+
}, xe = () => {
|
|
1697
|
+
L.value && (t.includeTime && L.value.endDate && L.value.endDate.setHours(23, 59, 59, 999), me(L.value), h.value = de(L.value), g.value = !1);
|
|
1698
1698
|
}, Re = () => {
|
|
1699
|
-
me({ startDate: null, endDate: null }), F(),
|
|
1699
|
+
me({ startDate: null, endDate: null }), F(), p.value = -1, g.value = !1;
|
|
1700
1700
|
}, ze = () => {
|
|
1701
|
-
g.value &&
|
|
1701
|
+
g.value && se(() => {
|
|
1702
1702
|
fe();
|
|
1703
1703
|
});
|
|
1704
|
-
},
|
|
1704
|
+
}, Se = O(() => we(x.value.year, x.value.month)), Ke = O(() => we(f.value.year, f.value.month)), D = O(() => {
|
|
1705
1705
|
const a = P(t.modelValue);
|
|
1706
1706
|
if (!a || !a.startDate || !a.endDate)
|
|
1707
1707
|
return "";
|
|
1708
1708
|
const c = (ae) => {
|
|
1709
|
-
const oe = String(ae.getFullYear()),
|
|
1710
|
-
return `${oe}/${
|
|
1709
|
+
const oe = String(ae.getFullYear()), ie = String(ae.getMonth() + 1).padStart(2, "0"), _e = String(ae.getDate()).padStart(2, "0");
|
|
1710
|
+
return `${oe}/${ie}/${_e}`;
|
|
1711
1711
|
}, M = c(a.startDate), W = c(a.endDate);
|
|
1712
1712
|
return !t.includeTime && M === W ? M : `${M} - ${W}`;
|
|
1713
|
-
}),
|
|
1713
|
+
}), S = O(() => [
|
|
1714
1714
|
"nh-time-dropdown",
|
|
1715
1715
|
{
|
|
1716
1716
|
"nh-time-dropdown-top": !m.value.top,
|
|
@@ -1720,7 +1720,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1720
1720
|
const a = P(t.modelValue);
|
|
1721
1721
|
return !!(a != null && a.startDate && (a != null && a.endDate));
|
|
1722
1722
|
}), B = O(() => !!(A.value && $.value)), F = () => {
|
|
1723
|
-
A.value = null, $.value = null, L.value = null,
|
|
1723
|
+
A.value = null, $.value = null, L.value = null, h.value = -1;
|
|
1724
1724
|
};
|
|
1725
1725
|
le(() => t.modelValue, (a) => {
|
|
1726
1726
|
const c = P(a);
|
|
@@ -1735,15 +1735,15 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1735
1735
|
const M = new Date(x.value.year, x.value.month + 1);
|
|
1736
1736
|
f.value.year = M.getFullYear(), f.value.month = M.getMonth();
|
|
1737
1737
|
}
|
|
1738
|
-
(c != null && c.startDate || c != null && c.endDate) && C(), g.value || (
|
|
1738
|
+
(c != null && c.startDate || c != null && c.endDate) && C(), g.value || (h.value = de(a));
|
|
1739
1739
|
}, { immediate: !0, deep: !0 }), le([x, f], () => {
|
|
1740
1740
|
const a = new Date(x.value.year, x.value.month).getTime(), c = new Date(f.value.year, f.value.month).getTime();
|
|
1741
1741
|
if (a === c) {
|
|
1742
1742
|
const M = new Date(x.value.year, x.value.month + 1);
|
|
1743
1743
|
f.value.year = M.getFullYear(), f.value.month = M.getMonth();
|
|
1744
1744
|
}
|
|
1745
|
-
}, { deep: !0 }),
|
|
1746
|
-
document.addEventListener("click", q), window.addEventListener("resize", ze), window.addEventListener("scroll", ze),
|
|
1745
|
+
}, { deep: !0 }), Me(() => {
|
|
1746
|
+
document.addEventListener("click", q), window.addEventListener("resize", ze), window.addEventListener("scroll", ze), h.value = de(t.modelValue);
|
|
1747
1747
|
const a = P(t.modelValue);
|
|
1748
1748
|
if (a != null && a.startDate && (x.value.year = a.startDate.getFullYear(), x.value.month = a.startDate.getMonth()), a != null && a.endDate)
|
|
1749
1749
|
f.value.year = a.endDate.getFullYear(), f.value.month = a.endDate.getMonth();
|
|
@@ -1756,7 +1756,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1756
1756
|
document.removeEventListener("click", q), window.removeEventListener("resize", ze), window.removeEventListener("scroll", ze);
|
|
1757
1757
|
});
|
|
1758
1758
|
const N = () => {
|
|
1759
|
-
t.clearable && (me({ startDate: null, endDate: null }), F(),
|
|
1759
|
+
t.clearable && (me({ startDate: null, endDate: null }), F(), p.value = -1);
|
|
1760
1760
|
}, te = (a, c) => {
|
|
1761
1761
|
if (a === "start") {
|
|
1762
1762
|
const M = new Date(x.value.year, x.value.month + c, 1);
|
|
@@ -1768,7 +1768,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1768
1768
|
};
|
|
1769
1769
|
return (a, c) => {
|
|
1770
1770
|
const M = Ve("YButton");
|
|
1771
|
-
return i(),
|
|
1771
|
+
return i(), r("div", {
|
|
1772
1772
|
class: E(["nh-time-search", [`nh-time--${e.size}`]])
|
|
1773
1773
|
}, [
|
|
1774
1774
|
l("div", yn, [
|
|
@@ -1787,9 +1787,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1787
1787
|
class: "nh-time-input"
|
|
1788
1788
|
}, null, 8, gn),
|
|
1789
1789
|
l("span", mn, [
|
|
1790
|
-
e.clearable && K.value ? (i(),
|
|
1790
|
+
e.clearable && K.value ? (i(), r("i", {
|
|
1791
1791
|
key: 0,
|
|
1792
|
-
onClick:
|
|
1792
|
+
onClick: Z(N, ["stop"]),
|
|
1793
1793
|
class: "nh-time-clear"
|
|
1794
1794
|
}, [...c[4] || (c[4] = [
|
|
1795
1795
|
l("svg", {
|
|
@@ -1802,7 +1802,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1802
1802
|
fill: "currentColor"
|
|
1803
1803
|
})
|
|
1804
1804
|
], -1)
|
|
1805
|
-
])])) :
|
|
1805
|
+
])])) : V("", !0),
|
|
1806
1806
|
c[6] || (c[6] = l("i", { class: "nh-time-icon" }, [
|
|
1807
1807
|
l("svg", {
|
|
1808
1808
|
viewBox: "0 0 1024 1024",
|
|
@@ -1831,29 +1831,29 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1831
1831
|
])], 2)
|
|
1832
1832
|
])
|
|
1833
1833
|
], 34),
|
|
1834
|
-
ce(
|
|
1834
|
+
ce(De, { name: "el-zoom-in-top" }, {
|
|
1835
1835
|
default: ve(() => [
|
|
1836
|
-
g.value ? (i(),
|
|
1836
|
+
g.value ? (i(), r("div", {
|
|
1837
1837
|
key: 0,
|
|
1838
1838
|
ref_key: "dropdown",
|
|
1839
|
-
ref:
|
|
1840
|
-
class: E(
|
|
1839
|
+
ref: _,
|
|
1840
|
+
class: E(S.value),
|
|
1841
1841
|
onKeydown: d
|
|
1842
1842
|
}, [
|
|
1843
1843
|
l("div", wn, [
|
|
1844
1844
|
c[7] || (c[7] = l("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1845
1845
|
l("ul", bn, [
|
|
1846
|
-
(i(!0),
|
|
1846
|
+
(i(!0), r(re, null, he(e.shortcuts, (W, ae) => (i(), r("li", {
|
|
1847
1847
|
key: W.label,
|
|
1848
|
-
onClick: (oe) =>
|
|
1848
|
+
onClick: (oe) => R(W),
|
|
1849
1849
|
onKeydown: (oe) => o(oe, ae),
|
|
1850
1850
|
onMouseenter: (oe) => s(ae),
|
|
1851
|
-
onMouseleave:
|
|
1851
|
+
onMouseleave: u,
|
|
1852
1852
|
class: E([
|
|
1853
1853
|
"nh-time-shortcut",
|
|
1854
1854
|
{
|
|
1855
|
-
"is-active":
|
|
1856
|
-
"is-selected":
|
|
1855
|
+
"is-active": p.value === ae,
|
|
1856
|
+
"is-selected": h.value === ae
|
|
1857
1857
|
}
|
|
1858
1858
|
]),
|
|
1859
1859
|
tabindex: "0"
|
|
@@ -1864,7 +1864,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1864
1864
|
l("div", Cn, [
|
|
1865
1865
|
c[8] || (c[8] = l("span", null, "自定义时间", -1)),
|
|
1866
1866
|
l("div", Dn, [
|
|
1867
|
-
!A.value && !$.value ? (i(),
|
|
1867
|
+
!A.value && !$.value ? (i(), r("span", $n, " 请选择开始日期 ")) : A.value && !$.value ? (i(), r("span", _n, " 请选择结束日期 ")) : A.value && $.value ? (i(), r("span", Sn, " 已选择完整范围 ")) : V("", !0)
|
|
1868
1868
|
])
|
|
1869
1869
|
]),
|
|
1870
1870
|
l("div", Mn, [
|
|
@@ -1887,7 +1887,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1887
1887
|
})
|
|
1888
1888
|
], -1)
|
|
1889
1889
|
])]),
|
|
1890
|
-
l("span", En, ne(
|
|
1890
|
+
l("span", En, ne(X(x.value.year, x.value.month)), 1),
|
|
1891
1891
|
l("button", {
|
|
1892
1892
|
onClick: c[1] || (c[1] = (W) => te("start", 1)),
|
|
1893
1893
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -1909,23 +1909,23 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1909
1909
|
l("table", zn, [
|
|
1910
1910
|
l("thead", null, [
|
|
1911
1911
|
l("tr", null, [
|
|
1912
|
-
(i(),
|
|
1912
|
+
(i(), r(re, null, he(Q, (W) => l("th", {
|
|
1913
1913
|
key: W,
|
|
1914
1914
|
class: "nh-date-table-th"
|
|
1915
1915
|
}, ne(W), 1)), 64))
|
|
1916
1916
|
])
|
|
1917
1917
|
]),
|
|
1918
1918
|
l("tbody", null, [
|
|
1919
|
-
(i(!0),
|
|
1919
|
+
(i(!0), r(re, null, he(Se.value, (W, ae) => (i(), r("tr", {
|
|
1920
1920
|
key: `start-week-${ae}`
|
|
1921
1921
|
}, [
|
|
1922
|
-
(i(!0),
|
|
1923
|
-
key: `start-day-${ae}-${
|
|
1924
|
-
class: E(
|
|
1925
|
-
onClick: (
|
|
1922
|
+
(i(!0), r(re, null, he(W, (oe, ie) => (i(), r("td", {
|
|
1923
|
+
key: `start-day-${ae}-${ie}`,
|
|
1924
|
+
class: E(J(oe)),
|
|
1925
|
+
onClick: (_e) => U(oe, "start")
|
|
1926
1926
|
}, [
|
|
1927
1927
|
l("div", Hn, [
|
|
1928
|
-
oe ? (i(),
|
|
1928
|
+
oe ? (i(), r("span", Rn, ne(oe.day), 1)) : V("", !0)
|
|
1929
1929
|
])
|
|
1930
1930
|
], 10, Kn))), 128))
|
|
1931
1931
|
]))), 128))
|
|
@@ -1953,7 +1953,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1953
1953
|
})
|
|
1954
1954
|
], -1)
|
|
1955
1955
|
])]),
|
|
1956
|
-
l("span", Wn, ne(
|
|
1956
|
+
l("span", Wn, ne(X(f.value.year, f.value.month)), 1),
|
|
1957
1957
|
l("button", {
|
|
1958
1958
|
onClick: c[3] || (c[3] = (W) => te("end", 1)),
|
|
1959
1959
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -1975,23 +1975,23 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
1975
1975
|
l("table", Pn, [
|
|
1976
1976
|
l("thead", null, [
|
|
1977
1977
|
l("tr", null, [
|
|
1978
|
-
(i(),
|
|
1978
|
+
(i(), r(re, null, he(Q, (W) => l("th", {
|
|
1979
1979
|
key: W,
|
|
1980
1980
|
class: "nh-date-table-th"
|
|
1981
1981
|
}, ne(W), 1)), 64))
|
|
1982
1982
|
])
|
|
1983
1983
|
]),
|
|
1984
1984
|
l("tbody", null, [
|
|
1985
|
-
(i(!0),
|
|
1985
|
+
(i(!0), r(re, null, he(Ke.value, (W, ae) => (i(), r("tr", {
|
|
1986
1986
|
key: `end-week-${ae}`
|
|
1987
1987
|
}, [
|
|
1988
|
-
(i(!0),
|
|
1989
|
-
key: `end-day-${ae}-${
|
|
1990
|
-
class: E(
|
|
1991
|
-
onClick: (
|
|
1988
|
+
(i(!0), r(re, null, he(W, (oe, ie) => (i(), r("td", {
|
|
1989
|
+
key: `end-day-${ae}-${ie}`,
|
|
1990
|
+
class: E(J(oe)),
|
|
1991
|
+
onClick: (_e) => U(oe, "end")
|
|
1992
1992
|
}, [
|
|
1993
1993
|
l("div", On, [
|
|
1994
|
-
oe ? (i(),
|
|
1994
|
+
oe ? (i(), r("span", jn, ne(oe.day), 1)) : V("", !0)
|
|
1995
1995
|
])
|
|
1996
1996
|
], 10, Nn))), 128))
|
|
1997
1997
|
]))), 128))
|
|
@@ -2009,24 +2009,24 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2009
2009
|
size: e.size
|
|
2010
2010
|
}, {
|
|
2011
2011
|
default: ve(() => [...c[13] || (c[13] = [
|
|
2012
|
-
|
|
2012
|
+
$e(" 清空 ", -1)
|
|
2013
2013
|
])]),
|
|
2014
2014
|
_: 1
|
|
2015
|
-
}, 8, ["size"])) :
|
|
2015
|
+
}, 8, ["size"])) : V("", !0),
|
|
2016
2016
|
ce(M, {
|
|
2017
|
-
onClick:
|
|
2017
|
+
onClick: xe,
|
|
2018
2018
|
disabled: !B.value,
|
|
2019
2019
|
variant: "primary",
|
|
2020
2020
|
size: e.size
|
|
2021
2021
|
}, {
|
|
2022
2022
|
default: ve(() => [
|
|
2023
|
-
|
|
2023
|
+
$e(ne(A.value && !$.value ? "继续选择结束日期" : "确认"), 1)
|
|
2024
2024
|
]),
|
|
2025
2025
|
_: 1
|
|
2026
2026
|
}, 8, ["disabled", "size"])
|
|
2027
2027
|
])
|
|
2028
2028
|
])
|
|
2029
|
-
], 34)) :
|
|
2029
|
+
], 34)) : V("", !0)
|
|
2030
2030
|
]),
|
|
2031
2031
|
_: 1
|
|
2032
2032
|
})
|
|
@@ -2055,44 +2055,44 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2055
2055
|
},
|
|
2056
2056
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2057
2057
|
setup(e, { emit: b }) {
|
|
2058
|
-
const t = e, n = b, g = z(),
|
|
2058
|
+
const t = e, n = b, g = z(), p = O(() => t.modelValue === t.trueValue), h = O(() => {
|
|
2059
2059
|
const k = {};
|
|
2060
|
-
return k.background =
|
|
2060
|
+
return k.background = p.value ? t.activeColor : t.inactiveColor, k;
|
|
2061
2061
|
});
|
|
2062
2062
|
function L() {
|
|
2063
2063
|
if (t.disabled || t.loading) return;
|
|
2064
|
-
const k =
|
|
2064
|
+
const k = p.value ? t.falseValue : t.trueValue;
|
|
2065
2065
|
n("update:modelValue", k), n("change", k);
|
|
2066
2066
|
}
|
|
2067
|
-
return
|
|
2067
|
+
return Me(() => {
|
|
2068
2068
|
const k = g.value;
|
|
2069
|
-
k && (k.addEventListener("focus", (
|
|
2070
|
-
}), (k,
|
|
2069
|
+
k && (k.addEventListener("focus", (_) => n("focus", _)), k.addEventListener("blur", (_) => n("blur", _)));
|
|
2070
|
+
}), (k, _) => (i(), r("button", {
|
|
2071
2071
|
ref_key: "rootEl",
|
|
2072
2072
|
ref: g,
|
|
2073
2073
|
class: E(["yswitch", [
|
|
2074
2074
|
`yswitch--${e.size}`,
|
|
2075
|
-
{ "yswitch--checked":
|
|
2075
|
+
{ "yswitch--checked": p.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2076
2076
|
]]),
|
|
2077
|
-
style: pe(
|
|
2077
|
+
style: pe(h.value),
|
|
2078
2078
|
role: "switch",
|
|
2079
|
-
"aria-checked":
|
|
2079
|
+
"aria-checked": p.value,
|
|
2080
2080
|
"aria-disabled": e.disabled,
|
|
2081
2081
|
disabled: e.disabled || e.loading,
|
|
2082
2082
|
onClick: L,
|
|
2083
2083
|
onKeydown: [
|
|
2084
|
-
|
|
2085
|
-
|
|
2084
|
+
Ce(Z(L, ["prevent"]), ["enter"]),
|
|
2085
|
+
Ce(Z(L, ["prevent"]), ["space"])
|
|
2086
2086
|
]
|
|
2087
2087
|
}, [
|
|
2088
|
-
|
|
2088
|
+
_[0] || (_[0] = l("span", { class: "yswitch__track" }, null, -1)),
|
|
2089
2089
|
l("span", Qn, [
|
|
2090
|
-
e.loading ? (i(),
|
|
2090
|
+
e.loading ? (i(), r("span", Jn)) : V("", !0)
|
|
2091
2091
|
]),
|
|
2092
|
-
e.showText ? (i(),
|
|
2092
|
+
e.showText ? (i(), r("span", {
|
|
2093
2093
|
key: 0,
|
|
2094
|
-
class: E(["yswitch__label", { "yswitch__label--left": !
|
|
2095
|
-
}, ne(
|
|
2094
|
+
class: E(["yswitch__label", { "yswitch__label--left": !p.value, "yswitch__label--right": p.value }])
|
|
2095
|
+
}, ne(p.value ? e.activeText : e.inactiveText), 3)) : V("", !0)
|
|
2096
2096
|
], 46, Zn));
|
|
2097
2097
|
}
|
|
2098
2098
|
}), Gn = /* @__PURE__ */ ke(Xn, [["__scopeId", "data-v-0b157fc4"]]), el = ["src", "alt"], tl = ["src", "alt"], nl = /* @__PURE__ */ be({
|
|
@@ -2111,14 +2111,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2111
2111
|
},
|
|
2112
2112
|
emits: ["load", "error", "preview"],
|
|
2113
2113
|
setup(e, { expose: b, emit: t }) {
|
|
2114
|
-
const n = e, g = t,
|
|
2114
|
+
const n = e, g = t, p = z(), h = z(), L = z(), k = z(!1), _ = z(!1), m = z(!1), x = z(!1), f = z(!1), C = z("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), j = z(""), Q = z(1), A = z(!1), $ = z({
|
|
2115
2115
|
overflow: "",
|
|
2116
2116
|
paddingRight: ""
|
|
2117
2117
|
}), T = O(() => [
|
|
2118
2118
|
n.className,
|
|
2119
2119
|
"overflow-hidden"
|
|
2120
2120
|
].filter(Boolean).join(" ")), I = O(() => [
|
|
2121
|
-
|
|
2121
|
+
X(),
|
|
2122
2122
|
ee()
|
|
2123
2123
|
].filter(Boolean).join(" ")), H = O(() => [
|
|
2124
2124
|
"w-full h-full bg-white",
|
|
@@ -2126,12 +2126,12 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2126
2126
|
ee(),
|
|
2127
2127
|
n.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2128
2128
|
].filter(Boolean).join(" ")), P = O(() => [
|
|
2129
|
-
|
|
2129
|
+
X(),
|
|
2130
2130
|
ee()
|
|
2131
2131
|
].filter(Boolean).join(" ")), G = O(() => {
|
|
2132
2132
|
const w = {};
|
|
2133
2133
|
return n.width && (w.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (w.height = typeof n.height == "number" ? `${n.height}px` : n.height), w;
|
|
2134
|
-
}),
|
|
2134
|
+
}), X = () => n.width && n.height ? "" : "w-full h-full", ye = () => ({
|
|
2135
2135
|
cover: "object-cover",
|
|
2136
2136
|
contain: "object-contain",
|
|
2137
2137
|
fill: "object-fill",
|
|
@@ -2140,15 +2140,15 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2140
2140
|
})[n.fit] || "object-cover", ee = () => typeof n.radius == "number" ? `rounded-${n.radius}` : typeof n.radius == "string" ? n.radius.includes("px") ? "" : `rounded-${n.radius}` : "", de = () => {
|
|
2141
2141
|
const w = document.createElement("div");
|
|
2142
2142
|
w.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(w);
|
|
2143
|
-
const
|
|
2144
|
-
return document.body.removeChild(w),
|
|
2143
|
+
const R = w.offsetWidth - w.clientWidth;
|
|
2144
|
+
return document.body.removeChild(w), R;
|
|
2145
2145
|
}, we = () => {
|
|
2146
2146
|
if ($.value = {
|
|
2147
2147
|
overflow: document.body.style.overflow || "",
|
|
2148
2148
|
paddingRight: document.body.style.paddingRight || ""
|
|
2149
2149
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2150
|
-
const
|
|
2151
|
-
document.body.style.paddingRight = `${
|
|
2150
|
+
const R = de();
|
|
2151
|
+
document.body.style.paddingRight = `${R}px`;
|
|
2152
2152
|
}
|
|
2153
2153
|
document.body.style.overflow = "hidden";
|
|
2154
2154
|
}, me = () => {
|
|
@@ -2156,64 +2156,77 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2156
2156
|
};
|
|
2157
2157
|
let fe = null;
|
|
2158
2158
|
const Y = () => {
|
|
2159
|
-
!n.lazy || !
|
|
2159
|
+
!n.lazy || !p.value || (fe = new IntersectionObserver(
|
|
2160
2160
|
(w) => {
|
|
2161
|
-
w.forEach((
|
|
2162
|
-
|
|
2161
|
+
w.forEach((R) => {
|
|
2162
|
+
R.isIntersecting && (x.value = !0, C.value = n.src, fe == null || fe.unobserve(R.target));
|
|
2163
2163
|
});
|
|
2164
2164
|
},
|
|
2165
2165
|
{
|
|
2166
2166
|
rootMargin: "50px"
|
|
2167
2167
|
}
|
|
2168
|
-
), fe.observe(
|
|
2168
|
+
), fe.observe(p.value));
|
|
2169
2169
|
}, q = (w) => {
|
|
2170
|
-
k.value = !0,
|
|
2170
|
+
k.value = !0, _.value = !1, m.value = !1, g("load", w);
|
|
2171
2171
|
}, v = (w) => {
|
|
2172
|
-
m.value = !0,
|
|
2172
|
+
m.value = !0, _.value = !1, k.value = !1, g("error", w);
|
|
2173
2173
|
}, d = () => {
|
|
2174
|
-
m.value = !1,
|
|
2175
|
-
|
|
2174
|
+
m.value = !1, _.value = !0, k.value = !1, se(() => {
|
|
2175
|
+
h.value && (h.value.src = n.src);
|
|
2176
2176
|
});
|
|
2177
2177
|
}, o = () => {
|
|
2178
2178
|
if (!n.preview || m.value) return;
|
|
2179
|
-
|
|
2180
|
-
const w =
|
|
2181
|
-
|
|
2182
|
-
j.value =
|
|
2183
|
-
f.value = !0, we(), g("preview",
|
|
2179
|
+
Q.value = 1;
|
|
2180
|
+
const w = n.previewSrcList || n.src;
|
|
2181
|
+
if (h.value && h.value.complete && h.value.naturalWidth > 0) {
|
|
2182
|
+
j.value = w, se(() => {
|
|
2183
|
+
f.value = !0, we(), g("preview", w);
|
|
2184
2184
|
});
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2185
|
+
return;
|
|
2186
|
+
}
|
|
2187
|
+
const R = new Image();
|
|
2188
|
+
let U = null, J = !1;
|
|
2189
|
+
const xe = () => {
|
|
2190
|
+
J || (J = !0, U && (clearTimeout(U), U = null), j.value = w, se(() => {
|
|
2191
|
+
f.value = !0, we(), g("preview", w);
|
|
2192
|
+
}));
|
|
2193
|
+
};
|
|
2194
|
+
U = setTimeout(() => {
|
|
2195
|
+
xe();
|
|
2196
|
+
}, 500), R.onload = () => {
|
|
2197
|
+
xe();
|
|
2198
|
+
}, R.onerror = () => {
|
|
2199
|
+
xe();
|
|
2200
|
+
}, R.src = w, R.complete && xe();
|
|
2188
2201
|
}, s = () => {
|
|
2189
2202
|
f.value = !1, setTimeout(() => {
|
|
2190
2203
|
me();
|
|
2191
2204
|
}, 300);
|
|
2192
|
-
},
|
|
2193
|
-
const
|
|
2194
|
-
let
|
|
2195
|
-
|
|
2205
|
+
}, u = (w) => {
|
|
2206
|
+
const R = w.deltaY < 0 ? 1 : -1;
|
|
2207
|
+
let J = Q.value + R * 0.1;
|
|
2208
|
+
J = Math.max(0.5, Math.min(2, J)), Q.value = J;
|
|
2196
2209
|
};
|
|
2197
|
-
return
|
|
2198
|
-
n.lazy ? Y() : x.value = !0, x.value && (
|
|
2210
|
+
return Me(() => {
|
|
2211
|
+
n.lazy ? Y() : x.value = !0, x.value && (_.value = !0), A.value = !0;
|
|
2199
2212
|
}), Te(() => {
|
|
2200
2213
|
fe && fe.disconnect(), f.value && me();
|
|
2201
2214
|
}), le(() => C.value, () => {
|
|
2202
|
-
n.src && x.value && (
|
|
2215
|
+
n.src && x.value && (_.value = !0, m.value = !1, k.value = !1);
|
|
2203
2216
|
}), le(() => n.src, (w) => {
|
|
2204
2217
|
C.value = w || "";
|
|
2205
2218
|
}), b({
|
|
2206
2219
|
retryLoad: d,
|
|
2207
2220
|
closePreview: s
|
|
2208
|
-
}), (w,
|
|
2221
|
+
}), (w, R) => (i(), r("div", {
|
|
2209
2222
|
ref_key: "containerRef",
|
|
2210
|
-
ref:
|
|
2223
|
+
ref: p,
|
|
2211
2224
|
class: E(["relative inline-block", T.value])
|
|
2212
2225
|
}, [
|
|
2213
|
-
!k.value && !m.value && !x.value ? (i(),
|
|
2226
|
+
!k.value && !m.value && !x.value ? (i(), r("div", {
|
|
2214
2227
|
key: 0,
|
|
2215
2228
|
class: E(["bg-gray-200 animate-pulse rounded", I.value])
|
|
2216
|
-
}, [...
|
|
2229
|
+
}, [...R[1] || (R[1] = [
|
|
2217
2230
|
l("div", { class: "flex items-center justify-center h-full" }, [
|
|
2218
2231
|
l("svg", {
|
|
2219
2232
|
class: "w-6 h-6 text-gray-400",
|
|
@@ -2229,16 +2242,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2229
2242
|
})
|
|
2230
2243
|
])
|
|
2231
2244
|
], -1)
|
|
2232
|
-
])], 2)) :
|
|
2233
|
-
|
|
2245
|
+
])], 2)) : V("", !0),
|
|
2246
|
+
_.value && !m.value ? (i(), r("div", {
|
|
2234
2247
|
key: 1,
|
|
2235
|
-
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded", H.value])
|
|
2236
|
-
}, [...
|
|
2248
|
+
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none", H.value])
|
|
2249
|
+
}, [...R[2] || (R[2] = [
|
|
2237
2250
|
l("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2238
2251
|
l("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
2239
2252
|
], -1)
|
|
2240
|
-
])], 2)) :
|
|
2241
|
-
m.value ? (i(),
|
|
2253
|
+
])], 2)) : V("", !0),
|
|
2254
|
+
m.value ? (i(), r("div", {
|
|
2242
2255
|
key: 2,
|
|
2243
2256
|
class: E(["bg-gray-100 rounded flex items-center justify-center", P.value]),
|
|
2244
2257
|
onClick: d
|
|
@@ -2248,32 +2261,37 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2248
2261
|
alt: "Error Image",
|
|
2249
2262
|
class: E(["w-[70%] h-[70%] object-contain cursor-pointer", ee()])
|
|
2250
2263
|
}, null, 2)
|
|
2251
|
-
], 2)) :
|
|
2264
|
+
], 2)) : V("", !0),
|
|
2252
2265
|
Ee(l("img", {
|
|
2253
2266
|
ref_key: "imageRef",
|
|
2254
|
-
ref:
|
|
2267
|
+
ref: h,
|
|
2255
2268
|
src: C.value,
|
|
2256
2269
|
alt: e.alt,
|
|
2257
2270
|
class: E(H.value),
|
|
2258
2271
|
onLoad: q,
|
|
2259
2272
|
onError: v,
|
|
2260
|
-
onClick: o,
|
|
2273
|
+
onClick: Z(o, ["stop"]),
|
|
2261
2274
|
style: pe(G.value)
|
|
2262
2275
|
}, null, 46, el), [
|
|
2263
2276
|
[He, k.value && !m.value]
|
|
2264
2277
|
]),
|
|
2265
|
-
|
|
2278
|
+
n.preview && x.value && !m.value && (!k.value || _.value) ? (i(), r("div", {
|
|
2266
2279
|
key: 3,
|
|
2280
|
+
class: "absolute inset-0 cursor-pointer z-10",
|
|
2281
|
+
onClick: Z(o, ["stop"])
|
|
2282
|
+
})) : V("", !0),
|
|
2283
|
+
A.value ? (i(), Be(Ae, {
|
|
2284
|
+
key: 4,
|
|
2267
2285
|
to: "body"
|
|
2268
2286
|
}, [
|
|
2269
|
-
ce(
|
|
2287
|
+
ce(De, { name: "fade" }, {
|
|
2270
2288
|
default: ve(() => [
|
|
2271
|
-
f.value ? (i(),
|
|
2289
|
+
f.value ? (i(), r("div", {
|
|
2272
2290
|
key: 0,
|
|
2273
2291
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2274
2292
|
style: { "z-index": "99999" },
|
|
2275
|
-
onClick:
|
|
2276
|
-
onWheel:
|
|
2293
|
+
onClick: Z(s, ["self"]),
|
|
2294
|
+
onWheel: Z(u, ["prevent"])
|
|
2277
2295
|
}, [
|
|
2278
2296
|
l("div", {
|
|
2279
2297
|
class: E(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": f.value, "scale-95": !f.value }])
|
|
@@ -2284,19 +2302,19 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2284
2302
|
src: n.previewSrcList || j.value || n.src,
|
|
2285
2303
|
alt: e.alt,
|
|
2286
2304
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2287
|
-
style: pe({ transform: `scale(${
|
|
2288
|
-
onClick:
|
|
2305
|
+
style: pe({ transform: `scale(${Q.value})` }),
|
|
2306
|
+
onClick: R[0] || (R[0] = Z(() => {
|
|
2289
2307
|
}, ["stop"]))
|
|
2290
2308
|
}, null, 12, tl)
|
|
2291
2309
|
], 2)
|
|
2292
|
-
], 32)) :
|
|
2310
|
+
], 32)) : V("", !0)
|
|
2293
2311
|
]),
|
|
2294
2312
|
_: 1
|
|
2295
2313
|
})
|
|
2296
|
-
])) :
|
|
2314
|
+
])) : V("", !0)
|
|
2297
2315
|
], 2));
|
|
2298
2316
|
}
|
|
2299
|
-
}), ll = /* @__PURE__ */ ke(nl, [["__scopeId", "data-v-
|
|
2317
|
+
}), ll = /* @__PURE__ */ ke(nl, [["__scopeId", "data-v-bc0053ca"]]), ol = /* @__PURE__ */ be({
|
|
2300
2318
|
__name: "ydropdown",
|
|
2301
2319
|
props: {
|
|
2302
2320
|
trigger: { default: "hover" },
|
|
@@ -2307,7 +2325,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2307
2325
|
setup(e) {
|
|
2308
2326
|
const b = e, t = z(!1), n = z();
|
|
2309
2327
|
let g = null;
|
|
2310
|
-
const
|
|
2328
|
+
const p = O(() => `y-dropdown__menu--${b.placement}`), h = O(() => {
|
|
2311
2329
|
if (!b.menuWidth) return {};
|
|
2312
2330
|
const f = typeof b.menuWidth == "number" ? `${b.menuWidth}px` : b.menuWidth;
|
|
2313
2331
|
return {
|
|
@@ -2316,18 +2334,18 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2316
2334
|
maxWidth: f
|
|
2317
2335
|
};
|
|
2318
2336
|
}), L = () => {
|
|
2319
|
-
console.log("显示下拉菜单", t.value), !b.disabled && (g && (clearTimeout(g), g = null), t.value = !0, console.log("设置 visible 为 true", t.value),
|
|
2320
|
-
|
|
2337
|
+
console.log("显示下拉菜单", t.value), !b.disabled && (g && (clearTimeout(g), g = null), t.value = !0, console.log("设置 visible 为 true", t.value), se(() => {
|
|
2338
|
+
_();
|
|
2321
2339
|
}));
|
|
2322
2340
|
}, k = () => {
|
|
2323
2341
|
console.log("隐藏下拉菜单"), g = setTimeout(() => {
|
|
2324
2342
|
t.value = !1, console.log("设置 visible 为 false", t.value);
|
|
2325
2343
|
}, 150);
|
|
2326
|
-
},
|
|
2344
|
+
}, _ = () => {
|
|
2327
2345
|
if (!n.value) return;
|
|
2328
2346
|
const f = n.value.querySelector(".y-dropdown__trigger"), C = n.value.querySelector(".y-dropdown__menu");
|
|
2329
2347
|
if (!f || !C) return;
|
|
2330
|
-
const j = f.getBoundingClientRect(),
|
|
2348
|
+
const j = f.getBoundingClientRect(), Q = C.getBoundingClientRect(), A = window.innerWidth, $ = window.innerHeight;
|
|
2331
2349
|
C.style.top = "", C.style.left = "", C.style.right = "", C.style.bottom = "", C.style.transform = "";
|
|
2332
2350
|
let T = 0, I = 0;
|
|
2333
2351
|
switch (b.placement) {
|
|
@@ -2335,42 +2353,42 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2335
2353
|
T = j.height + 4, I = 0;
|
|
2336
2354
|
break;
|
|
2337
2355
|
case "top":
|
|
2338
|
-
T = -(
|
|
2356
|
+
T = -(Q.height + 4), I = 0;
|
|
2339
2357
|
break;
|
|
2340
2358
|
case "right":
|
|
2341
2359
|
T = 0, I = j.width + 4;
|
|
2342
2360
|
break;
|
|
2343
2361
|
case "left":
|
|
2344
|
-
T = 0, I = -(
|
|
2362
|
+
T = 0, I = -(Q.width + 4);
|
|
2345
2363
|
break;
|
|
2346
2364
|
}
|
|
2347
2365
|
let H = j.top + T, P = j.left + I;
|
|
2348
2366
|
if (b.placement === "bottom" || b.placement === "top") {
|
|
2349
|
-
const G =
|
|
2367
|
+
const G = Q.width || 260;
|
|
2350
2368
|
P + G > A - 10 && (P = A - G - 10), P < 10 && (P = 10);
|
|
2351
2369
|
}
|
|
2352
2370
|
if (b.placement === "left" || b.placement === "right") {
|
|
2353
|
-
const G =
|
|
2371
|
+
const G = Q.height || 200;
|
|
2354
2372
|
H + G > $ - 10 && (H = $ - G - 10), H < 10 && (H = 10);
|
|
2355
2373
|
}
|
|
2356
2374
|
C.style.top = `${H}px`, C.style.left = `${P}px`;
|
|
2357
2375
|
}, m = (f) => {
|
|
2358
2376
|
b.trigger === "click" && n.value && !n.value.contains(f.target) && (t.value = !1);
|
|
2359
2377
|
}, x = () => {
|
|
2360
|
-
t.value &&
|
|
2378
|
+
t.value && _();
|
|
2361
2379
|
};
|
|
2362
|
-
return
|
|
2380
|
+
return Me(() => {
|
|
2363
2381
|
b.trigger === "click" && document.addEventListener("click", m), window.addEventListener("resize", x), window.addEventListener("scroll", x);
|
|
2364
2382
|
}), Te(() => {
|
|
2365
2383
|
b.trigger === "click" && document.removeEventListener("click", m), g && clearTimeout(g), window.removeEventListener("resize", x), window.removeEventListener("scroll", x);
|
|
2366
2384
|
}), le(
|
|
2367
2385
|
() => b.menuWidth,
|
|
2368
2386
|
() => {
|
|
2369
|
-
t.value &&
|
|
2370
|
-
|
|
2387
|
+
t.value && se(() => {
|
|
2388
|
+
_();
|
|
2371
2389
|
});
|
|
2372
2390
|
}
|
|
2373
|
-
), (f, C) => (i(),
|
|
2391
|
+
), (f, C) => (i(), r("div", {
|
|
2374
2392
|
class: "y-dropdown",
|
|
2375
2393
|
ref_key: "dropdownRef",
|
|
2376
2394
|
ref: n
|
|
@@ -2384,14 +2402,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2384
2402
|
C[0] || (C[0] = l("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2385
2403
|
], !0)
|
|
2386
2404
|
], 32),
|
|
2387
|
-
ce(
|
|
2405
|
+
ce(De, {
|
|
2388
2406
|
name: "dropdown-fade",
|
|
2389
2407
|
appear: ""
|
|
2390
2408
|
}, {
|
|
2391
2409
|
default: ve(() => [
|
|
2392
2410
|
Ee(l("div", {
|
|
2393
|
-
class: E(["y-dropdown__menu",
|
|
2394
|
-
style: pe(
|
|
2411
|
+
class: E(["y-dropdown__menu", p.value]),
|
|
2412
|
+
style: pe(h.value),
|
|
2395
2413
|
onMouseenter: L,
|
|
2396
2414
|
onMouseleave: k
|
|
2397
2415
|
}, [
|
|
@@ -2432,11 +2450,11 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2432
2450
|
const t = e, n = b, g = O({
|
|
2433
2451
|
get: () => t.modelValue,
|
|
2434
2452
|
set: (C) => n("update:modelValue", C)
|
|
2435
|
-
}),
|
|
2453
|
+
}), p = z(null), h = O(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), L = O(() => t.placement === "right" ? "rounded-left" : "rounded-top"), k = O(() => {
|
|
2436
2454
|
const C = {};
|
|
2437
2455
|
return t.placement === "right" ? (C.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), C.height = "100%", C.right = "0", C.top = "0") : (C.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), C.width = "100%", C.bottom = "0", C.left = "0"), C;
|
|
2438
2456
|
});
|
|
2439
|
-
function
|
|
2457
|
+
function _() {
|
|
2440
2458
|
t.maskClosable && m();
|
|
2441
2459
|
}
|
|
2442
2460
|
function m() {
|
|
@@ -2451,9 +2469,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2451
2469
|
return le(() => t.modelValue, (C) => {
|
|
2452
2470
|
C ? (n("open"), requestAnimationFrame(() => {
|
|
2453
2471
|
var j;
|
|
2454
|
-
return (j =
|
|
2472
|
+
return (j = p.value) == null ? void 0 : j.focus();
|
|
2455
2473
|
}), document.addEventListener("keydown", f), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", f), document.body.style.overflow = "");
|
|
2456
|
-
}),
|
|
2474
|
+
}), Me(() => {
|
|
2457
2475
|
t.modelValue && (document.addEventListener("keydown", f), document.body.style.overflow = "hidden");
|
|
2458
2476
|
}), Te(() => {
|
|
2459
2477
|
document.removeEventListener("keydown", f), document.body.style.overflow = "";
|
|
@@ -2467,37 +2485,37 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2467
2485
|
}, [
|
|
2468
2486
|
l("div", {
|
|
2469
2487
|
class: "y-drawer-mask",
|
|
2470
|
-
onClick:
|
|
2488
|
+
onClick: _
|
|
2471
2489
|
}),
|
|
2472
|
-
ce(
|
|
2490
|
+
ce(De, { name: h.value }, {
|
|
2473
2491
|
default: ve(() => [
|
|
2474
2492
|
Ee(l("div", {
|
|
2475
2493
|
ref_key: "panelRef",
|
|
2476
|
-
ref:
|
|
2494
|
+
ref: p,
|
|
2477
2495
|
class: E(["y-drawer-panel", [
|
|
2478
2496
|
`is-${e.placement}`,
|
|
2479
2497
|
L.value
|
|
2480
2498
|
]]),
|
|
2481
2499
|
style: pe(k.value),
|
|
2482
|
-
onKeydown:
|
|
2500
|
+
onKeydown: Ce(Z(x, ["prevent", "stop"]), ["esc"]),
|
|
2483
2501
|
tabindex: "-1"
|
|
2484
2502
|
}, [
|
|
2485
|
-
e.showHeader ? (i(),
|
|
2503
|
+
e.showHeader ? (i(), r("div", rl, [
|
|
2486
2504
|
l("div", ul, ne(e.title), 1),
|
|
2487
|
-
e.closable ? (i(),
|
|
2505
|
+
e.closable ? (i(), r("button", {
|
|
2488
2506
|
key: 0,
|
|
2489
2507
|
type: "button",
|
|
2490
2508
|
class: "y-drawer-close",
|
|
2491
2509
|
"aria-label": "Close",
|
|
2492
2510
|
onClick: m
|
|
2493
|
-
}, " ✕ ")) :
|
|
2494
|
-
])) :
|
|
2511
|
+
}, " ✕ ")) : V("", !0)
|
|
2512
|
+
])) : V("", !0),
|
|
2495
2513
|
l("div", cl, [
|
|
2496
2514
|
ue(C.$slots, "default", {}, void 0, !0)
|
|
2497
2515
|
]),
|
|
2498
|
-
C.$slots.footer ? (i(),
|
|
2516
|
+
C.$slots.footer ? (i(), r("div", dl, [
|
|
2499
2517
|
ue(C.$slots, "footer", {}, void 0, !0)
|
|
2500
|
-
])) :
|
|
2518
|
+
])) : V("", !0)
|
|
2501
2519
|
], 46, il), [
|
|
2502
2520
|
[He, g.value]
|
|
2503
2521
|
])
|
|
@@ -2645,7 +2663,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2645
2663
|
},
|
|
2646
2664
|
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"],
|
|
2647
2665
|
setup(e, { expose: b, emit: t }) {
|
|
2648
|
-
const n = e, g = t,
|
|
2666
|
+
const n = e, g = t, p = O(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), h = z({
|
|
2649
2667
|
currentNode: null,
|
|
2650
2668
|
currentKey: null,
|
|
2651
2669
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2653,12 +2671,12 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2653
2671
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
2654
2672
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2655
2673
|
});
|
|
2656
|
-
nt("treeStore",
|
|
2674
|
+
nt("treeStore", h);
|
|
2657
2675
|
const L = O(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2658
2676
|
function k(v) {
|
|
2659
2677
|
return v[n.nodeKey] || v.id || Math.random();
|
|
2660
2678
|
}
|
|
2661
|
-
function
|
|
2679
|
+
function _(v) {
|
|
2662
2680
|
var d;
|
|
2663
2681
|
return ((d = n.props) != null && d.label ? v[n.props.label] : void 0) || v.label || "";
|
|
2664
2682
|
}
|
|
@@ -2668,8 +2686,8 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2668
2686
|
}
|
|
2669
2687
|
function x(v, d) {
|
|
2670
2688
|
var w;
|
|
2671
|
-
const o = n.deptIconUrl || ao, s = n.personIconUrl || so,
|
|
2672
|
-
return d && y &&
|
|
2689
|
+
const o = n.deptIconUrl || ao, s = n.personIconUrl || so, u = n.buttonIconUrl || "", y = n.childStyleIconUrl || "";
|
|
2690
|
+
return d && y && Q(v, d) ? y : (w = v == null ? void 0 : v.data) != null && w.isButton && u ? u : m(v) ? s : o;
|
|
2673
2691
|
}
|
|
2674
2692
|
function f(v) {
|
|
2675
2693
|
var o;
|
|
@@ -2684,28 +2702,28 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2684
2702
|
if (v === d)
|
|
2685
2703
|
return o;
|
|
2686
2704
|
const s = C(v);
|
|
2687
|
-
for (const
|
|
2688
|
-
const y = j(
|
|
2705
|
+
for (const u of s) {
|
|
2706
|
+
const y = j(u, d, o + 1);
|
|
2689
2707
|
if (y > 0)
|
|
2690
2708
|
return y;
|
|
2691
2709
|
}
|
|
2692
2710
|
return 0;
|
|
2693
2711
|
}
|
|
2694
|
-
function
|
|
2712
|
+
function Q(v, d) {
|
|
2695
2713
|
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : j(d, v) === n.childStyleLevel;
|
|
2696
2714
|
}
|
|
2697
2715
|
function A(v) {
|
|
2698
2716
|
const d = k(v);
|
|
2699
|
-
return
|
|
2717
|
+
return h.value.expandedKeys.has(d);
|
|
2700
2718
|
}
|
|
2701
2719
|
function $(v) {
|
|
2702
2720
|
const d = k(v);
|
|
2703
|
-
if (
|
|
2721
|
+
if (h.value.checkedKeys.has(d)) {
|
|
2704
2722
|
if (f(v)) {
|
|
2705
|
-
const s = C(v),
|
|
2723
|
+
const s = C(v), u = s.filter((w) => $(w)), y = s.filter(
|
|
2706
2724
|
(w) => T(w)
|
|
2707
2725
|
);
|
|
2708
|
-
return
|
|
2726
|
+
return u.length === s.length && y.length === 0;
|
|
2709
2727
|
}
|
|
2710
2728
|
return !0;
|
|
2711
2729
|
}
|
|
@@ -2719,54 +2737,54 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2719
2737
|
}
|
|
2720
2738
|
function T(v) {
|
|
2721
2739
|
if (!f(v)) return !1;
|
|
2722
|
-
const d = C(v), o = d.filter((
|
|
2723
|
-
(
|
|
2740
|
+
const d = C(v), o = d.filter((u) => $(u)), s = d.filter(
|
|
2741
|
+
(u) => T(u)
|
|
2724
2742
|
);
|
|
2725
2743
|
return o.length === d.length ? !1 : o.length > 0 || s.length > 0;
|
|
2726
2744
|
}
|
|
2727
2745
|
function I(v) {
|
|
2728
2746
|
const d = k(v);
|
|
2729
|
-
return
|
|
2747
|
+
return h.value.currentKey === d;
|
|
2730
2748
|
}
|
|
2731
2749
|
function H(v) {
|
|
2732
2750
|
const d = k(v);
|
|
2733
|
-
return
|
|
2751
|
+
return h.value.highlightedKeys.has(d);
|
|
2734
2752
|
}
|
|
2735
2753
|
function P(v) {
|
|
2736
2754
|
if (n.disabled) return;
|
|
2737
|
-
const d = k(v), s = !
|
|
2738
|
-
s ?
|
|
2739
|
-
function y(w,
|
|
2740
|
-
w.forEach((
|
|
2741
|
-
const
|
|
2742
|
-
|
|
2755
|
+
const d = k(v), s = !h.value.checkedKeys.has(d), u = new Set(h.value.expandedKeys);
|
|
2756
|
+
s ? h.value.checkedKeys.add(d) : h.value.checkedKeys.delete(d);
|
|
2757
|
+
function y(w, R) {
|
|
2758
|
+
w.forEach((U) => {
|
|
2759
|
+
const J = k(U);
|
|
2760
|
+
R ? h.value.checkedKeys.add(J) : h.value.checkedKeys.delete(J), f(U) && y(C(U), R);
|
|
2743
2761
|
});
|
|
2744
2762
|
}
|
|
2745
|
-
y(C(v), s), s && G(), ye(),
|
|
2763
|
+
y(C(v), s), s && G(), ye(), h.value.expandedKeys = u, g("check-change", v, s, !1), g("check", v, s, !1), g("checked-keys-change", Array.from(h.value.checkedKeys));
|
|
2746
2764
|
}
|
|
2747
2765
|
function G(v) {
|
|
2748
2766
|
L.value && console.log(
|
|
2749
2767
|
`已启用从第${L.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2750
2768
|
);
|
|
2751
2769
|
}
|
|
2752
|
-
function
|
|
2770
|
+
function X(v) {
|
|
2753
2771
|
const d = k(v);
|
|
2754
|
-
|
|
2772
|
+
h.value.expandedKeys.has(d) ? (h.value.expandedKeys.delete(d), g("node-collapse", v, v, null)) : (h.value.expandedKeys.add(d), g("node-expand", v, v, null));
|
|
2755
2773
|
}
|
|
2756
2774
|
function ye() {
|
|
2757
2775
|
const v = [];
|
|
2758
2776
|
function d(s) {
|
|
2759
|
-
s.forEach((
|
|
2760
|
-
v.push(
|
|
2777
|
+
s.forEach((u) => {
|
|
2778
|
+
v.push(u), f(u) && d(C(u));
|
|
2761
2779
|
});
|
|
2762
2780
|
}
|
|
2763
|
-
d(
|
|
2781
|
+
d(p.value);
|
|
2764
2782
|
function o(s) {
|
|
2765
2783
|
if (f(s)) {
|
|
2766
|
-
const
|
|
2767
|
-
(
|
|
2784
|
+
const u = C(s), y = k(s), w = u.filter((U) => $(U)), R = u.filter(
|
|
2785
|
+
(U) => T(U)
|
|
2768
2786
|
);
|
|
2769
|
-
w.length ===
|
|
2787
|
+
w.length === u.length && R.length === 0 || w.length > 0 || R.length > 0 ? h.value.checkedKeys.add(y) : h.value.checkedKeys.delete(y);
|
|
2770
2788
|
}
|
|
2771
2789
|
}
|
|
2772
2790
|
for (let s = v.length - 1; s >= 0; s--)
|
|
@@ -2774,16 +2792,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2774
2792
|
}
|
|
2775
2793
|
function ee(v, d, o, s) {
|
|
2776
2794
|
if (n.disabled) return;
|
|
2777
|
-
const
|
|
2778
|
-
if (n.enableChildStyleCustomClick &&
|
|
2795
|
+
const u = s ? Q(v, s) : !1;
|
|
2796
|
+
if (n.enableChildStyleCustomClick && u) {
|
|
2779
2797
|
g("child-node-click", v, d, o);
|
|
2780
2798
|
return;
|
|
2781
2799
|
}
|
|
2782
2800
|
if (n.expandOnClickNode && f(v)) {
|
|
2783
|
-
|
|
2801
|
+
X(v);
|
|
2784
2802
|
return;
|
|
2785
2803
|
}
|
|
2786
|
-
|
|
2804
|
+
h.value.currentNode = v, h.value.currentKey = k(v), n.showCheckbox && P(v), g("node-click", v, d, o);
|
|
2787
2805
|
}
|
|
2788
2806
|
function de(v, d, o, s) {
|
|
2789
2807
|
n.disabled || g("node-contextmenu", v, d, o, s);
|
|
@@ -2794,60 +2812,60 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2794
2812
|
if (v) {
|
|
2795
2813
|
const d = L.value;
|
|
2796
2814
|
if (d) {
|
|
2797
|
-
let o = function(w,
|
|
2798
|
-
for (const
|
|
2799
|
-
if (k(
|
|
2800
|
-
if (f(
|
|
2801
|
-
const
|
|
2802
|
-
if (
|
|
2815
|
+
let o = function(w, R, U = 1) {
|
|
2816
|
+
for (const J of R) {
|
|
2817
|
+
if (k(J) === w) return U;
|
|
2818
|
+
if (f(J)) {
|
|
2819
|
+
const xe = o(w, C(J), U + 1);
|
|
2820
|
+
if (xe > 0) return xe;
|
|
2803
2821
|
}
|
|
2804
2822
|
}
|
|
2805
2823
|
return 0;
|
|
2806
|
-
}, s = function(w,
|
|
2807
|
-
w.forEach((
|
|
2808
|
-
|
|
2824
|
+
}, s = function(w, R, U) {
|
|
2825
|
+
w.forEach((J) => {
|
|
2826
|
+
R < U && f(J) ? (y.add(k(J)), s(C(J), R + 1, U)) : R < U && f(J);
|
|
2809
2827
|
});
|
|
2810
2828
|
};
|
|
2811
|
-
const
|
|
2812
|
-
const
|
|
2813
|
-
return
|
|
2814
|
-
}), y = new Set(
|
|
2815
|
-
s(
|
|
2816
|
-
o(w,
|
|
2817
|
-
}),
|
|
2829
|
+
const u = (v || []).filter((w) => {
|
|
2830
|
+
const R = o(w, p.value, 1);
|
|
2831
|
+
return R > 0 && R < d;
|
|
2832
|
+
}), y = new Set(u);
|
|
2833
|
+
s(p.value, 1, d), h.value.expandedKeys.forEach((w) => {
|
|
2834
|
+
o(w, p.value, 1) >= d && y.add(w);
|
|
2835
|
+
}), h.value.expandedKeys = y;
|
|
2818
2836
|
} else
|
|
2819
|
-
|
|
2837
|
+
h.value.expandedKeys = new Set(v);
|
|
2820
2838
|
}
|
|
2821
2839
|
},
|
|
2822
2840
|
{ immediate: !0 }
|
|
2823
2841
|
);
|
|
2824
2842
|
function we() {
|
|
2825
2843
|
if (n.defaultExpandAll) {
|
|
2826
|
-
let v = function(s,
|
|
2844
|
+
let v = function(s, u = 1) {
|
|
2827
2845
|
s.forEach((y) => {
|
|
2828
2846
|
if (!f(y)) return;
|
|
2829
2847
|
const w = C(y);
|
|
2830
2848
|
if (o) {
|
|
2831
|
-
if (
|
|
2832
|
-
|
|
2849
|
+
if (u >= o) return;
|
|
2850
|
+
u + 1 === o || d.add(k(y)), v(w, u + 1);
|
|
2833
2851
|
} else
|
|
2834
|
-
d.add(k(y)), v(w,
|
|
2852
|
+
d.add(k(y)), v(w, u + 1);
|
|
2835
2853
|
});
|
|
2836
2854
|
};
|
|
2837
2855
|
const d = /* @__PURE__ */ new Set(), o = L.value;
|
|
2838
|
-
v(
|
|
2856
|
+
v(p.value, 1), h.value.expandedKeys = d;
|
|
2839
2857
|
}
|
|
2840
2858
|
}
|
|
2841
2859
|
function me() {
|
|
2842
2860
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2843
|
-
let v = function(
|
|
2844
|
-
|
|
2845
|
-
const
|
|
2846
|
-
d.has(
|
|
2861
|
+
let v = function(u, y = []) {
|
|
2862
|
+
u.forEach((w) => {
|
|
2863
|
+
const R = k(w), U = [...y, R];
|
|
2864
|
+
d.has(R) && y.forEach((J) => o.add(J)), f(w) && v(C(w), U);
|
|
2847
2865
|
});
|
|
2848
2866
|
};
|
|
2849
2867
|
const d = new Set(n.defaultCheckedKeys), o = /* @__PURE__ */ new Set();
|
|
2850
|
-
v(
|
|
2868
|
+
v(p.value);
|
|
2851
2869
|
const s = L.value;
|
|
2852
2870
|
if (s) {
|
|
2853
2871
|
console.log(
|
|
@@ -2855,72 +2873,72 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2855
2873
|
);
|
|
2856
2874
|
return;
|
|
2857
2875
|
}
|
|
2858
|
-
|
|
2876
|
+
h.value.expandedKeys = o;
|
|
2859
2877
|
}
|
|
2860
2878
|
}
|
|
2861
|
-
le(() => n.defaultExpandAll, we, { immediate: !0 }), le(() =>
|
|
2879
|
+
le(() => n.defaultExpandAll, we, { immediate: !0 }), le(() => p.value, we, { deep: !0 }), le(
|
|
2862
2880
|
() => n.defaultCheckedKeys,
|
|
2863
2881
|
(v) => {
|
|
2864
|
-
v ? (
|
|
2882
|
+
v ? (h.value.checkedKeys = new Set(v), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : me()) : h.value.checkedKeys.clear();
|
|
2865
2883
|
},
|
|
2866
2884
|
{ immediate: !0 }
|
|
2867
2885
|
);
|
|
2868
2886
|
function fe(v) {
|
|
2869
2887
|
try {
|
|
2870
|
-
let d = function(
|
|
2871
|
-
for (const
|
|
2872
|
-
const
|
|
2873
|
-
if (
|
|
2874
|
-
if (f(
|
|
2875
|
-
const
|
|
2876
|
-
if (
|
|
2888
|
+
let d = function(u, y, w = []) {
|
|
2889
|
+
for (const R of u) {
|
|
2890
|
+
const U = k(R), J = [...w, U];
|
|
2891
|
+
if (U === y) return J;
|
|
2892
|
+
if (f(R)) {
|
|
2893
|
+
const xe = d(C(R), y, J);
|
|
2894
|
+
if (xe) return xe;
|
|
2877
2895
|
}
|
|
2878
2896
|
}
|
|
2879
2897
|
return null;
|
|
2880
2898
|
};
|
|
2881
2899
|
const o = Array.isArray(v) ? v : [];
|
|
2882
2900
|
if (o.length === 0) return;
|
|
2883
|
-
|
|
2884
|
-
const s = new Set(
|
|
2885
|
-
o.forEach((
|
|
2886
|
-
const y = d(
|
|
2887
|
-
y && y.length > 0 && (y.slice(0, -1).forEach((w) => s.add(w)),
|
|
2888
|
-
}),
|
|
2901
|
+
h.value.highlightedKeys.clear();
|
|
2902
|
+
const s = new Set(h.value.expandedKeys);
|
|
2903
|
+
o.forEach((u) => {
|
|
2904
|
+
const y = d(p.value, u);
|
|
2905
|
+
y && y.length > 0 && (y.slice(0, -1).forEach((w) => s.add(w)), h.value.highlightedKeys.add(y[y.length - 1]));
|
|
2906
|
+
}), h.value.expandedKeys = s;
|
|
2889
2907
|
} catch (d) {
|
|
2890
2908
|
console.warn("highlightAndExpandByIds 执行失败", d);
|
|
2891
2909
|
}
|
|
2892
2910
|
}
|
|
2893
2911
|
function Y() {
|
|
2894
|
-
|
|
2912
|
+
h.value.highlightedKeys.clear();
|
|
2895
2913
|
}
|
|
2896
2914
|
function q() {
|
|
2897
|
-
|
|
2915
|
+
h.value.currentNode = null, h.value.currentKey = null;
|
|
2898
2916
|
}
|
|
2899
2917
|
return b({ highlightAndExpandByIds: fe, clearHighlights: Y, clearCurrentNode: q }), le(
|
|
2900
2918
|
() => n.defaultSelectedKeys,
|
|
2901
2919
|
(v) => {
|
|
2902
|
-
v && (
|
|
2920
|
+
v && (h.value.selectedKeys = new Set(v));
|
|
2903
2921
|
},
|
|
2904
2922
|
{ immediate: !0 }
|
|
2905
|
-
), (v, d) => (i(),
|
|
2923
|
+
), (v, d) => (i(), r("div", {
|
|
2906
2924
|
class: E(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
2907
2925
|
}, [
|
|
2908
2926
|
l("div", hl, [
|
|
2909
|
-
(i(!0),
|
|
2927
|
+
(i(!0), r(re, null, he(p.value, (o) => (i(), r("div", {
|
|
2910
2928
|
key: k(o),
|
|
2911
2929
|
class: E(["ytree-node", { "ytree-node--current": I(o), "ytree-node--highlight": H(o) }])
|
|
2912
2930
|
}, [
|
|
2913
2931
|
l("div", {
|
|
2914
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
2932
|
+
class: E(["ytree-node__content", { "is-child-style": Q(o, o) }]),
|
|
2915
2933
|
style: { paddingLeft: "8px" },
|
|
2916
2934
|
"data-level": j(o, o),
|
|
2917
2935
|
onClick: (s) => ee(o, o, null, o),
|
|
2918
2936
|
onContextmenu: (s) => de(s, o, o, null)
|
|
2919
2937
|
}, [
|
|
2920
|
-
f(o) ? (i(),
|
|
2938
|
+
f(o) ? (i(), r("span", {
|
|
2921
2939
|
key: 0,
|
|
2922
2940
|
class: E(["ytree-node__expand-icon", { "is-expanded": A(o) }]),
|
|
2923
|
-
onClick:
|
|
2941
|
+
onClick: Z((s) => X(o), ["stop"])
|
|
2924
2942
|
}, [...d[0] || (d[0] = [
|
|
2925
2943
|
l("svg", {
|
|
2926
2944
|
width: "12",
|
|
@@ -2936,16 +2954,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2936
2954
|
"stroke-linejoin": "round"
|
|
2937
2955
|
})
|
|
2938
2956
|
], -1)
|
|
2939
|
-
])], 10, yl)) : (i(),
|
|
2940
|
-
e.showCheckbox ? (i(),
|
|
2957
|
+
])], 10, yl)) : (i(), r("span", gl)),
|
|
2958
|
+
e.showCheckbox ? (i(), r("span", {
|
|
2941
2959
|
key: 2,
|
|
2942
2960
|
class: E(["ytree-node__checkbox", {
|
|
2943
2961
|
"is-checked": $(o),
|
|
2944
2962
|
"is-indeterminate": T(o)
|
|
2945
2963
|
}]),
|
|
2946
|
-
onClick:
|
|
2964
|
+
onClick: Z((s) => P(o), ["stop"])
|
|
2947
2965
|
}, [
|
|
2948
|
-
$(o) ? (i(),
|
|
2966
|
+
$(o) ? (i(), r("svg", wl, [...d[1] || (d[1] = [
|
|
2949
2967
|
l("path", {
|
|
2950
2968
|
d: "M2 6L4.5 8.5L10 3",
|
|
2951
2969
|
stroke: "currentColor",
|
|
@@ -2953,19 +2971,19 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2953
2971
|
"stroke-linecap": "round",
|
|
2954
2972
|
"stroke-linejoin": "round"
|
|
2955
2973
|
}, null, -1)
|
|
2956
|
-
])])) : T(o) ? (i(),
|
|
2974
|
+
])])) : T(o) ? (i(), r("svg", bl, [...d[2] || (d[2] = [
|
|
2957
2975
|
l("path", {
|
|
2958
2976
|
d: "M2 6L10 6",
|
|
2959
2977
|
stroke: "currentColor",
|
|
2960
2978
|
"stroke-width": "1.5",
|
|
2961
2979
|
"stroke-linecap": "round"
|
|
2962
2980
|
}, null, -1)
|
|
2963
|
-
])])) :
|
|
2964
|
-
], 10, ml)) :
|
|
2965
|
-
e.iconClass ? (i(),
|
|
2981
|
+
])])) : V("", !0)
|
|
2982
|
+
], 10, ml)) : V("", !0),
|
|
2983
|
+
e.iconClass ? (i(), r("span", {
|
|
2966
2984
|
key: 3,
|
|
2967
2985
|
class: E(["ytree-node__icon", e.iconClass])
|
|
2968
|
-
}, null, 2)) :
|
|
2986
|
+
}, null, 2)) : V("", !0),
|
|
2969
2987
|
l("img", {
|
|
2970
2988
|
class: "ytree-node__avatar",
|
|
2971
2989
|
src: x(o, o),
|
|
@@ -2973,7 +2991,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2973
2991
|
}, null, 8, kl),
|
|
2974
2992
|
l("span", {
|
|
2975
2993
|
class: E(["ytree-node__label", { "is-employee": m(o) }])
|
|
2976
|
-
}, ne(
|
|
2994
|
+
}, ne(_(o)), 3),
|
|
2977
2995
|
l("div", xl, [
|
|
2978
2996
|
ue(v.$slots, "node-content", {
|
|
2979
2997
|
node: o,
|
|
@@ -2983,24 +3001,24 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
2983
3001
|
}, void 0, !0)
|
|
2984
3002
|
])
|
|
2985
3003
|
], 42, pl),
|
|
2986
|
-
ce(
|
|
3004
|
+
ce(De, { name: "ytree-node" }, {
|
|
2987
3005
|
default: ve(() => [
|
|
2988
|
-
f(o) && A(o) ? (i(),
|
|
2989
|
-
(i(!0),
|
|
3006
|
+
f(o) && A(o) ? (i(), r("div", Cl, [
|
|
3007
|
+
(i(!0), r(re, null, he(C(o), (s) => (i(), r("div", {
|
|
2990
3008
|
key: k(s),
|
|
2991
3009
|
class: E(["ytree-node", { "ytree-node--current": I(s), "ytree-node--highlight": H(s) }])
|
|
2992
3010
|
}, [
|
|
2993
3011
|
l("div", {
|
|
2994
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3012
|
+
class: E(["ytree-node__content", { "is-child-style": Q(s, o) }]),
|
|
2995
3013
|
style: { paddingLeft: "22px" },
|
|
2996
3014
|
"data-level": j(o, s),
|
|
2997
|
-
onClick: (
|
|
2998
|
-
onContextmenu: (
|
|
3015
|
+
onClick: (u) => ee(s, s, null, o),
|
|
3016
|
+
onContextmenu: (u) => de(u, s, s, null)
|
|
2999
3017
|
}, [
|
|
3000
|
-
f(s) ? (i(),
|
|
3018
|
+
f(s) ? (i(), r("span", {
|
|
3001
3019
|
key: 0,
|
|
3002
3020
|
class: E(["ytree-node__expand-icon", { "is-expanded": A(s) }]),
|
|
3003
|
-
onClick:
|
|
3021
|
+
onClick: Z((u) => X(s), ["stop"])
|
|
3004
3022
|
}, [...d[3] || (d[3] = [
|
|
3005
3023
|
l("svg", {
|
|
3006
3024
|
width: "12",
|
|
@@ -3016,16 +3034,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3016
3034
|
"stroke-linejoin": "round"
|
|
3017
3035
|
})
|
|
3018
3036
|
], -1)
|
|
3019
|
-
])], 10, $l)) : (i(),
|
|
3020
|
-
e.showCheckbox ? (i(),
|
|
3037
|
+
])], 10, $l)) : (i(), r("span", _l)),
|
|
3038
|
+
e.showCheckbox ? (i(), r("span", {
|
|
3021
3039
|
key: 2,
|
|
3022
3040
|
class: E(["ytree-node__checkbox", {
|
|
3023
3041
|
"is-checked": $(s),
|
|
3024
3042
|
"is-indeterminate": T(s)
|
|
3025
3043
|
}]),
|
|
3026
|
-
onClick:
|
|
3044
|
+
onClick: Z((u) => P(s), ["stop"])
|
|
3027
3045
|
}, [
|
|
3028
|
-
$(s) ? (i(),
|
|
3046
|
+
$(s) ? (i(), r("svg", Ml, [...d[4] || (d[4] = [
|
|
3029
3047
|
l("path", {
|
|
3030
3048
|
d: "M2 6L4.5 8.5L10 3",
|
|
3031
3049
|
stroke: "currentColor",
|
|
@@ -3033,19 +3051,19 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3033
3051
|
"stroke-linecap": "round",
|
|
3034
3052
|
"stroke-linejoin": "round"
|
|
3035
3053
|
}, null, -1)
|
|
3036
|
-
])])) : T(s) ? (i(),
|
|
3054
|
+
])])) : T(s) ? (i(), r("svg", Ll, [...d[5] || (d[5] = [
|
|
3037
3055
|
l("path", {
|
|
3038
3056
|
d: "M2 6L10 6",
|
|
3039
3057
|
stroke: "currentColor",
|
|
3040
3058
|
"stroke-width": "1.5",
|
|
3041
3059
|
"stroke-linecap": "round"
|
|
3042
3060
|
}, null, -1)
|
|
3043
|
-
])])) :
|
|
3044
|
-
], 10, Sl)) :
|
|
3045
|
-
e.iconClass ? (i(),
|
|
3061
|
+
])])) : V("", !0)
|
|
3062
|
+
], 10, Sl)) : V("", !0),
|
|
3063
|
+
e.iconClass ? (i(), r("span", {
|
|
3046
3064
|
key: 3,
|
|
3047
3065
|
class: E(["ytree-node__icon", e.iconClass])
|
|
3048
|
-
}, null, 2)) :
|
|
3066
|
+
}, null, 2)) : V("", !0),
|
|
3049
3067
|
l("img", {
|
|
3050
3068
|
class: "ytree-node__avatar",
|
|
3051
3069
|
src: x(s, o),
|
|
@@ -3053,7 +3071,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3053
3071
|
}, null, 8, Il),
|
|
3054
3072
|
l("span", {
|
|
3055
3073
|
class: E(["ytree-node__label", { "is-employee": m(s) }])
|
|
3056
|
-
}, ne(
|
|
3074
|
+
}, ne(_(s)), 3),
|
|
3057
3075
|
l("div", Bl, [
|
|
3058
3076
|
ue(v.$slots, "node-content", {
|
|
3059
3077
|
node: s,
|
|
@@ -3063,32 +3081,32 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3063
3081
|
}, void 0, !0)
|
|
3064
3082
|
])
|
|
3065
3083
|
], 42, Dl),
|
|
3066
|
-
ce(
|
|
3084
|
+
ce(De, { name: "ytree-node" }, {
|
|
3067
3085
|
default: ve(() => [
|
|
3068
|
-
f(s) && A(s) ? (i(),
|
|
3069
|
-
(i(!0),
|
|
3070
|
-
key: k(
|
|
3086
|
+
f(s) && A(s) ? (i(), r("div", El, [
|
|
3087
|
+
(i(!0), r(re, null, he(C(s), (u) => (i(), r("div", {
|
|
3088
|
+
key: k(u),
|
|
3071
3089
|
class: E(["ytree-node", {
|
|
3072
|
-
"ytree-node--current": I(
|
|
3073
|
-
"ytree-node--highlight": H(
|
|
3090
|
+
"ytree-node--current": I(u),
|
|
3091
|
+
"ytree-node--highlight": H(u)
|
|
3074
3092
|
}])
|
|
3075
3093
|
}, [
|
|
3076
3094
|
l("div", {
|
|
3077
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3095
|
+
class: E(["ytree-node__content", { "is-child-style": Q(u, o) }]),
|
|
3078
3096
|
style: { paddingLeft: "38px" },
|
|
3079
|
-
"data-level": j(o,
|
|
3080
|
-
onClick: (y) => ee(
|
|
3097
|
+
"data-level": j(o, u),
|
|
3098
|
+
onClick: (y) => ee(u, u, null, o),
|
|
3081
3099
|
onContextmenu: (y) => de(
|
|
3082
3100
|
y,
|
|
3083
|
-
|
|
3084
|
-
|
|
3101
|
+
u,
|
|
3102
|
+
u,
|
|
3085
3103
|
null
|
|
3086
3104
|
)
|
|
3087
3105
|
}, [
|
|
3088
|
-
f(
|
|
3106
|
+
f(u) ? (i(), r("span", {
|
|
3089
3107
|
key: 0,
|
|
3090
|
-
class: E(["ytree-node__expand-icon", { "is-expanded": A(
|
|
3091
|
-
onClick:
|
|
3108
|
+
class: E(["ytree-node__expand-icon", { "is-expanded": A(u) }]),
|
|
3109
|
+
onClick: Z((y) => X(u), ["stop"])
|
|
3092
3110
|
}, [...d[6] || (d[6] = [
|
|
3093
3111
|
l("svg", {
|
|
3094
3112
|
width: "12",
|
|
@@ -3104,16 +3122,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3104
3122
|
"stroke-linejoin": "round"
|
|
3105
3123
|
})
|
|
3106
3124
|
], -1)
|
|
3107
|
-
])], 10, zl)) : (i(),
|
|
3108
|
-
e.showCheckbox ? (i(),
|
|
3125
|
+
])], 10, zl)) : (i(), r("span", Kl)),
|
|
3126
|
+
e.showCheckbox ? (i(), r("span", {
|
|
3109
3127
|
key: 2,
|
|
3110
3128
|
class: E(["ytree-node__checkbox", {
|
|
3111
|
-
"is-checked": $(
|
|
3112
|
-
"is-indeterminate": T(
|
|
3129
|
+
"is-checked": $(u),
|
|
3130
|
+
"is-indeterminate": T(u)
|
|
3113
3131
|
}]),
|
|
3114
|
-
onClick:
|
|
3132
|
+
onClick: Z((y) => P(u), ["stop"])
|
|
3115
3133
|
}, [
|
|
3116
|
-
$(
|
|
3134
|
+
$(u) ? (i(), r("svg", Rl, [...d[7] || (d[7] = [
|
|
3117
3135
|
l("path", {
|
|
3118
3136
|
d: "M2 6L4.5 8.5L10 3",
|
|
3119
3137
|
stroke: "currentColor",
|
|
@@ -3121,40 +3139,40 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3121
3139
|
"stroke-linecap": "round",
|
|
3122
3140
|
"stroke-linejoin": "round"
|
|
3123
3141
|
}, null, -1)
|
|
3124
|
-
])])) : T(
|
|
3142
|
+
])])) : T(u) ? (i(), r("svg", Vl, [...d[8] || (d[8] = [
|
|
3125
3143
|
l("path", {
|
|
3126
3144
|
d: "M2 6L10 6",
|
|
3127
3145
|
stroke: "currentColor",
|
|
3128
3146
|
"stroke-width": "1.5",
|
|
3129
3147
|
"stroke-linecap": "round"
|
|
3130
3148
|
}, null, -1)
|
|
3131
|
-
])])) :
|
|
3132
|
-
], 10, Hl)) :
|
|
3133
|
-
e.iconClass ? (i(),
|
|
3149
|
+
])])) : V("", !0)
|
|
3150
|
+
], 10, Hl)) : V("", !0),
|
|
3151
|
+
e.iconClass ? (i(), r("span", {
|
|
3134
3152
|
key: 3,
|
|
3135
3153
|
class: E(["ytree-node__icon", e.iconClass])
|
|
3136
|
-
}, null, 2)) :
|
|
3154
|
+
}, null, 2)) : V("", !0),
|
|
3137
3155
|
l("img", {
|
|
3138
3156
|
class: "ytree-node__avatar",
|
|
3139
|
-
src: x(
|
|
3140
|
-
alt: m(
|
|
3157
|
+
src: x(u, o),
|
|
3158
|
+
alt: m(u) ? "person" : "dept"
|
|
3141
3159
|
}, null, 8, Al),
|
|
3142
3160
|
l("span", {
|
|
3143
|
-
class: E(["ytree-node__label", { "is-employee": m(
|
|
3144
|
-
}, ne(
|
|
3161
|
+
class: E(["ytree-node__label", { "is-employee": m(u) }])
|
|
3162
|
+
}, ne(_(u)), 3),
|
|
3145
3163
|
l("div", Fl, [
|
|
3146
3164
|
ue(v.$slots, "node-content", {
|
|
3147
|
-
node:
|
|
3148
|
-
isCurrent: I(
|
|
3149
|
-
isExpanded: A(
|
|
3150
|
-
hasChildren: f(
|
|
3165
|
+
node: u,
|
|
3166
|
+
isCurrent: I(u),
|
|
3167
|
+
isExpanded: A(u),
|
|
3168
|
+
hasChildren: f(u)
|
|
3151
3169
|
}, void 0, !0)
|
|
3152
3170
|
])
|
|
3153
3171
|
], 42, Tl),
|
|
3154
|
-
ce(
|
|
3172
|
+
ce(De, { name: "ytree-node" }, {
|
|
3155
3173
|
default: ve(() => [
|
|
3156
|
-
f(
|
|
3157
|
-
(i(!0),
|
|
3174
|
+
f(u) && A(u) ? (i(), r("div", Wl, [
|
|
3175
|
+
(i(!0), r(re, null, he(C(u), (y) => (i(), r("div", {
|
|
3158
3176
|
key: k(y),
|
|
3159
3177
|
class: E(["ytree-node", {
|
|
3160
3178
|
"ytree-node--current": I(y),
|
|
@@ -3162,7 +3180,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3162
3180
|
}])
|
|
3163
3181
|
}, [
|
|
3164
3182
|
l("div", {
|
|
3165
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3183
|
+
class: E(["ytree-node__content", { "is-child-style": Q(y, o) }]),
|
|
3166
3184
|
style: {
|
|
3167
3185
|
paddingLeft: "54px"
|
|
3168
3186
|
},
|
|
@@ -3180,12 +3198,12 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3180
3198
|
null
|
|
3181
3199
|
)
|
|
3182
3200
|
}, [
|
|
3183
|
-
f(y) ? (i(),
|
|
3201
|
+
f(y) ? (i(), r("span", {
|
|
3184
3202
|
key: 0,
|
|
3185
3203
|
class: E(["ytree-node__expand-icon", {
|
|
3186
3204
|
"is-expanded": A(y)
|
|
3187
3205
|
}]),
|
|
3188
|
-
onClick:
|
|
3206
|
+
onClick: Z((w) => X(y), ["stop"])
|
|
3189
3207
|
}, [...d[9] || (d[9] = [
|
|
3190
3208
|
l("svg", {
|
|
3191
3209
|
width: "12",
|
|
@@ -3201,16 +3219,16 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3201
3219
|
"stroke-linejoin": "round"
|
|
3202
3220
|
})
|
|
3203
3221
|
], -1)
|
|
3204
|
-
])], 10, Pl)) : (i(),
|
|
3205
|
-
e.showCheckbox ? (i(),
|
|
3222
|
+
])], 10, Pl)) : (i(), r("span", Nl)),
|
|
3223
|
+
e.showCheckbox ? (i(), r("span", {
|
|
3206
3224
|
key: 2,
|
|
3207
3225
|
class: E(["ytree-node__checkbox", {
|
|
3208
3226
|
"is-checked": $(y),
|
|
3209
3227
|
"is-indeterminate": T(y)
|
|
3210
3228
|
}]),
|
|
3211
|
-
onClick:
|
|
3229
|
+
onClick: Z((w) => P(y), ["stop"])
|
|
3212
3230
|
}, [
|
|
3213
|
-
$(y) ? (i(),
|
|
3231
|
+
$(y) ? (i(), r("svg", jl, [...d[10] || (d[10] = [
|
|
3214
3232
|
l("path", {
|
|
3215
3233
|
d: "M2 6L4.5 8.5L10 3",
|
|
3216
3234
|
stroke: "currentColor",
|
|
@@ -3218,19 +3236,19 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3218
3236
|
"stroke-linecap": "round",
|
|
3219
3237
|
"stroke-linejoin": "round"
|
|
3220
3238
|
}, null, -1)
|
|
3221
|
-
])])) : T(y) ? (i(),
|
|
3239
|
+
])])) : T(y) ? (i(), r("svg", ql, [...d[11] || (d[11] = [
|
|
3222
3240
|
l("path", {
|
|
3223
3241
|
d: "M2 6L10 6",
|
|
3224
3242
|
stroke: "currentColor",
|
|
3225
3243
|
"stroke-width": "1.5",
|
|
3226
3244
|
"stroke-linecap": "round"
|
|
3227
3245
|
}, null, -1)
|
|
3228
|
-
])])) :
|
|
3229
|
-
], 10, Ol)) :
|
|
3230
|
-
e.iconClass ? (i(),
|
|
3246
|
+
])])) : V("", !0)
|
|
3247
|
+
], 10, Ol)) : V("", !0),
|
|
3248
|
+
e.iconClass ? (i(), r("span", {
|
|
3231
3249
|
key: 3,
|
|
3232
3250
|
class: E(["ytree-node__icon", e.iconClass])
|
|
3233
|
-
}, null, 2)) :
|
|
3251
|
+
}, null, 2)) : V("", !0),
|
|
3234
3252
|
l("img", {
|
|
3235
3253
|
class: "ytree-node__avatar",
|
|
3236
3254
|
src: x(y, o),
|
|
@@ -3240,7 +3258,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3240
3258
|
class: E(["ytree-node__label", {
|
|
3241
3259
|
"is-employee": m(y)
|
|
3242
3260
|
}])
|
|
3243
|
-
}, ne(
|
|
3261
|
+
}, ne(_(y)), 3),
|
|
3244
3262
|
l("div", Zl, [
|
|
3245
3263
|
ue(v.$slots, "node-content", {
|
|
3246
3264
|
node: y,
|
|
@@ -3250,42 +3268,42 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3250
3268
|
}, void 0, !0)
|
|
3251
3269
|
])
|
|
3252
3270
|
], 42, Yl),
|
|
3253
|
-
ce(
|
|
3271
|
+
ce(De, { name: "ytree-node" }, {
|
|
3254
3272
|
default: ve(() => [
|
|
3255
|
-
f(y) && A(y) ? (i(),
|
|
3256
|
-
(i(!0),
|
|
3273
|
+
f(y) && A(y) ? (i(), r("div", Ql, [
|
|
3274
|
+
(i(!0), r(re, null, he(C(
|
|
3257
3275
|
y
|
|
3258
|
-
), (w) => (i(),
|
|
3276
|
+
), (w) => (i(), r("div", {
|
|
3259
3277
|
key: k(w),
|
|
3260
3278
|
class: E(["ytree-node", {
|
|
3261
3279
|
"ytree-node--current": I(w)
|
|
3262
3280
|
}])
|
|
3263
3281
|
}, [
|
|
3264
3282
|
l("div", {
|
|
3265
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3283
|
+
class: E(["ytree-node__content", { "is-child-style": Q(w, o) }]),
|
|
3266
3284
|
style: {
|
|
3267
3285
|
paddingLeft: "70px"
|
|
3268
3286
|
},
|
|
3269
3287
|
"data-level": j(o, w),
|
|
3270
|
-
onClick: (
|
|
3288
|
+
onClick: (R) => ee(
|
|
3271
3289
|
w,
|
|
3272
3290
|
w,
|
|
3273
3291
|
null,
|
|
3274
3292
|
o
|
|
3275
3293
|
),
|
|
3276
|
-
onContextmenu: (
|
|
3277
|
-
|
|
3294
|
+
onContextmenu: (R) => de(
|
|
3295
|
+
R,
|
|
3278
3296
|
w,
|
|
3279
3297
|
w,
|
|
3280
3298
|
null
|
|
3281
3299
|
)
|
|
3282
3300
|
}, [
|
|
3283
|
-
f(w) ? (i(),
|
|
3301
|
+
f(w) ? (i(), r("span", {
|
|
3284
3302
|
key: 0,
|
|
3285
3303
|
class: E(["ytree-node__expand-icon", {
|
|
3286
3304
|
"is-expanded": A(w)
|
|
3287
3305
|
}]),
|
|
3288
|
-
onClick:
|
|
3306
|
+
onClick: Z((R) => X(w), ["stop"])
|
|
3289
3307
|
}, [...d[12] || (d[12] = [
|
|
3290
3308
|
l("svg", {
|
|
3291
3309
|
width: "12",
|
|
@@ -3301,8 +3319,8 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3301
3319
|
"stroke-linejoin": "round"
|
|
3302
3320
|
})
|
|
3303
3321
|
], -1)
|
|
3304
|
-
])], 10, Xl)) : (i(),
|
|
3305
|
-
e.showCheckbox ? (i(),
|
|
3322
|
+
])], 10, Xl)) : (i(), r("span", Gl)),
|
|
3323
|
+
e.showCheckbox ? (i(), r("span", {
|
|
3306
3324
|
key: 2,
|
|
3307
3325
|
class: E(["ytree-node__checkbox", {
|
|
3308
3326
|
"is-checked": $(w),
|
|
@@ -3310,9 +3328,9 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3310
3328
|
w
|
|
3311
3329
|
)
|
|
3312
3330
|
}]),
|
|
3313
|
-
onClick:
|
|
3331
|
+
onClick: Z((R) => P(w), ["stop"])
|
|
3314
3332
|
}, [
|
|
3315
|
-
$(w) ? (i(),
|
|
3333
|
+
$(w) ? (i(), r("svg", to, [...d[13] || (d[13] = [
|
|
3316
3334
|
l("path", {
|
|
3317
3335
|
d: "M2 6L4.5 8.5L10 3",
|
|
3318
3336
|
stroke: "currentColor",
|
|
@@ -3322,19 +3340,19 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3322
3340
|
}, null, -1)
|
|
3323
3341
|
])])) : T(
|
|
3324
3342
|
w
|
|
3325
|
-
) ? (i(),
|
|
3343
|
+
) ? (i(), r("svg", no, [...d[14] || (d[14] = [
|
|
3326
3344
|
l("path", {
|
|
3327
3345
|
d: "M2 6L10 6",
|
|
3328
3346
|
stroke: "currentColor",
|
|
3329
3347
|
"stroke-width": "1.5",
|
|
3330
3348
|
"stroke-linecap": "round"
|
|
3331
3349
|
}, null, -1)
|
|
3332
|
-
])])) :
|
|
3333
|
-
], 10, eo)) :
|
|
3334
|
-
e.iconClass ? (i(),
|
|
3350
|
+
])])) : V("", !0)
|
|
3351
|
+
], 10, eo)) : V("", !0),
|
|
3352
|
+
e.iconClass ? (i(), r("span", {
|
|
3335
3353
|
key: 3,
|
|
3336
3354
|
class: E(["ytree-node__icon", e.iconClass])
|
|
3337
|
-
}, null, 2)) :
|
|
3355
|
+
}, null, 2)) : V("", !0),
|
|
3338
3356
|
l("img", {
|
|
3339
3357
|
class: "ytree-node__avatar",
|
|
3340
3358
|
src: x(w, o),
|
|
@@ -3344,7 +3362,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3344
3362
|
class: E(["ytree-node__label", {
|
|
3345
3363
|
"is-employee": m(w)
|
|
3346
3364
|
}])
|
|
3347
|
-
}, ne(
|
|
3365
|
+
}, ne(_(w)), 3),
|
|
3348
3366
|
l("div", oo, [
|
|
3349
3367
|
ue(v.$slots, "node-content", {
|
|
3350
3368
|
node: w,
|
|
@@ -3355,22 +3373,22 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3355
3373
|
])
|
|
3356
3374
|
], 42, Jl)
|
|
3357
3375
|
], 2))), 128))
|
|
3358
|
-
])) :
|
|
3376
|
+
])) : V("", !0)
|
|
3359
3377
|
]),
|
|
3360
3378
|
_: 2
|
|
3361
3379
|
}, 1024)
|
|
3362
3380
|
], 2))), 128))
|
|
3363
|
-
])) :
|
|
3381
|
+
])) : V("", !0)
|
|
3364
3382
|
]),
|
|
3365
3383
|
_: 2
|
|
3366
3384
|
}, 1024)
|
|
3367
3385
|
], 2))), 128))
|
|
3368
|
-
])) :
|
|
3386
|
+
])) : V("", !0)
|
|
3369
3387
|
]),
|
|
3370
3388
|
_: 2
|
|
3371
3389
|
}, 1024)
|
|
3372
3390
|
], 2))), 128))
|
|
3373
|
-
])) :
|
|
3391
|
+
])) : V("", !0)
|
|
3374
3392
|
]),
|
|
3375
3393
|
_: 2
|
|
3376
3394
|
}, 1024)
|
|
@@ -3391,8 +3409,8 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3391
3409
|
},
|
|
3392
3410
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3393
3411
|
setup(e, { emit: b }) {
|
|
3394
|
-
const t = e, n = b, g = z(!1),
|
|
3395
|
-
function
|
|
3412
|
+
const t = e, n = b, g = z(!1), p = lt({}), h = O(() => t.fields.filter(($) => !$.hidden)), L = O(() => g.value ? h.value : h.value.slice(0, t.maxVisibleFields)), k = O(() => h.value.length > t.maxVisibleFields);
|
|
3413
|
+
function _($) {
|
|
3396
3414
|
switch ($) {
|
|
3397
3415
|
case "select":
|
|
3398
3416
|
return Je;
|
|
@@ -3405,17 +3423,17 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3405
3423
|
}
|
|
3406
3424
|
}
|
|
3407
3425
|
function m($) {
|
|
3408
|
-
n("field-change", $,
|
|
3426
|
+
n("field-change", $, p[$.key]), n("update:modelValue", { ...p });
|
|
3409
3427
|
}
|
|
3410
3428
|
function x() {
|
|
3411
|
-
const $ = j(
|
|
3429
|
+
const $ = j(p), T = Q($);
|
|
3412
3430
|
n("search", { data: T });
|
|
3413
3431
|
}
|
|
3414
3432
|
function f() {
|
|
3415
|
-
Object.keys(
|
|
3433
|
+
Object.keys(p).forEach(($) => {
|
|
3416
3434
|
const T = t.fields.find((I) => I.key === $);
|
|
3417
|
-
(T == null ? void 0 : T.type) === "daterange" ?
|
|
3418
|
-
}), n("reset"), n("update:modelValue", { ...
|
|
3435
|
+
(T == null ? void 0 : T.type) === "daterange" ? p[$] = { startDate: null, endDate: null } : (T == null ? void 0 : T.type) === "date" ? p[$] = null : p[$] = "";
|
|
3436
|
+
}), n("reset"), n("update:modelValue", { ...p });
|
|
3419
3437
|
}
|
|
3420
3438
|
function C() {
|
|
3421
3439
|
g.value = !g.value;
|
|
@@ -3427,14 +3445,14 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3427
3445
|
H != null && H !== "" && (typeof H == "object" && H.startDate && H.endDate ? H.startDate && H.endDate && (T[I] = H) : P && (P.type === "date" || P.type === "daterange") ? H !== 0 && (T[I] = H) : T[I] = H);
|
|
3428
3446
|
}), T;
|
|
3429
3447
|
}
|
|
3430
|
-
function
|
|
3448
|
+
function Q($) {
|
|
3431
3449
|
const T = {};
|
|
3432
3450
|
return Object.keys($).forEach((I) => {
|
|
3433
3451
|
const H = $[I], P = t.fields.find((G) => G.key === I);
|
|
3434
3452
|
if (P)
|
|
3435
3453
|
if (P.type === "daterange" && typeof H == "object") {
|
|
3436
|
-
const G = P.startKey || `${I}Start`,
|
|
3437
|
-
H.startDate && H.endDate && H.startDate !== 0 && H.endDate !== 0 && (P.format === "timestamp" ? (T[G] = new Date(H.startDate).getTime(), T[
|
|
3454
|
+
const G = P.startKey || `${I}Start`, X = P.endKey || `${I}End`;
|
|
3455
|
+
H.startDate && H.endDate && H.startDate !== 0 && H.endDate !== 0 && (P.format === "timestamp" ? (T[G] = new Date(H.startDate).getTime(), T[X] = new Date(H.endDate).getTime()) : (T[G] = H.startDate, T[X] = H.endDate));
|
|
3438
3456
|
} else P.type === "date" && H && H !== 0 && P.format === "timestamp" ? T[I] = new Date(H).getTime() : T[I] = H;
|
|
3439
3457
|
else
|
|
3440
3458
|
T[I] = H;
|
|
@@ -3443,21 +3461,21 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3443
3461
|
function A() {
|
|
3444
3462
|
t.fields.forEach(($) => {
|
|
3445
3463
|
var T, I, H;
|
|
3446
|
-
|
|
3464
|
+
p[$.key] === void 0 && ($.type === "daterange" ? p[$.key] = ((T = t.modelValue) == null ? void 0 : T[$.key]) || {
|
|
3447
3465
|
startDate: null,
|
|
3448
3466
|
endDate: null
|
|
3449
|
-
} : $.type === "date" ?
|
|
3467
|
+
} : $.type === "date" ? p[$.key] = ((I = t.modelValue) == null ? void 0 : I[$.key]) || null : p[$.key] = ((H = t.modelValue) == null ? void 0 : H[$.key]) || "");
|
|
3450
3468
|
});
|
|
3451
3469
|
}
|
|
3452
3470
|
return le(
|
|
3453
3471
|
() => t.modelValue,
|
|
3454
3472
|
($) => {
|
|
3455
|
-
$ && Object.assign(
|
|
3473
|
+
$ && Object.assign(p, $);
|
|
3456
3474
|
},
|
|
3457
3475
|
{ deep: !0, immediate: !0 }
|
|
3458
|
-
),
|
|
3476
|
+
), Me(() => {
|
|
3459
3477
|
A();
|
|
3460
|
-
}), ($, T) => (i(),
|
|
3478
|
+
}), ($, T) => (i(), r("div", uo, [
|
|
3461
3479
|
l("div", co, [
|
|
3462
3480
|
l("div", fo, [
|
|
3463
3481
|
l("div", vo, [
|
|
@@ -3467,15 +3485,15 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3467
3485
|
class: "query-encapsulation__fields-group"
|
|
3468
3486
|
}, {
|
|
3469
3487
|
default: ve(() => [
|
|
3470
|
-
(i(!0),
|
|
3488
|
+
(i(!0), r(re, null, he(L.value, (I) => (i(), r("div", {
|
|
3471
3489
|
key: I.key,
|
|
3472
3490
|
class: "query-encapsulation__field-item"
|
|
3473
3491
|
}, [
|
|
3474
3492
|
l("div", ho, [
|
|
3475
3493
|
l("label", po, ne(I.label), 1),
|
|
3476
|
-
(i(), Be(at(
|
|
3477
|
-
modelValue:
|
|
3478
|
-
"onUpdate:modelValue": (H) =>
|
|
3494
|
+
(i(), Be(at(_(I.type)), {
|
|
3495
|
+
modelValue: p[I.key],
|
|
3496
|
+
"onUpdate:modelValue": (H) => p[I.key] = H,
|
|
3479
3497
|
placeholder: I.placeholder || `请输入${I.label}`,
|
|
3480
3498
|
options: I.options,
|
|
3481
3499
|
clearable: I.clearable !== !1,
|
|
@@ -3492,21 +3510,21 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3492
3510
|
]),
|
|
3493
3511
|
_: 1
|
|
3494
3512
|
}),
|
|
3495
|
-
k.value ? (i(),
|
|
3513
|
+
k.value ? (i(), r("div", yo, [
|
|
3496
3514
|
ce(Fe, {
|
|
3497
3515
|
variant: "secondary",
|
|
3498
3516
|
size: "small",
|
|
3499
3517
|
onClick: C
|
|
3500
3518
|
}, {
|
|
3501
3519
|
default: ve(() => [
|
|
3502
|
-
|
|
3520
|
+
$e(ne(g.value ? "收起" : "展开") + " ", 1),
|
|
3503
3521
|
l("span", {
|
|
3504
3522
|
class: E(["query-encapsulation__toggle-icon", { "is-expanded": g.value }])
|
|
3505
3523
|
}, "▼", 2)
|
|
3506
3524
|
]),
|
|
3507
3525
|
_: 1
|
|
3508
3526
|
})
|
|
3509
|
-
])) :
|
|
3527
|
+
])) : V("", !0),
|
|
3510
3528
|
l("div", go, [
|
|
3511
3529
|
l("div", mo, [
|
|
3512
3530
|
ce(Fe, {
|
|
@@ -3516,7 +3534,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3516
3534
|
loading: e.loading
|
|
3517
3535
|
}, {
|
|
3518
3536
|
default: ve(() => [...T[0] || (T[0] = [
|
|
3519
|
-
|
|
3537
|
+
$e(" 搜索 ", -1)
|
|
3520
3538
|
])]),
|
|
3521
3539
|
_: 1
|
|
3522
3540
|
}, 8, ["loading"]),
|
|
@@ -3527,7 +3545,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3527
3545
|
loading: e.loading
|
|
3528
3546
|
}, {
|
|
3529
3547
|
default: ve(() => [...T[1] || (T[1] = [
|
|
3530
|
-
|
|
3548
|
+
$e(" 重置 ", -1)
|
|
3531
3549
|
])]),
|
|
3532
3550
|
_: 1
|
|
3533
3551
|
}, 8, ["loading"]),
|
|
@@ -3575,7 +3593,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3575
3593
|
setup(e) {
|
|
3576
3594
|
const b = e, t = z(!1);
|
|
3577
3595
|
let n;
|
|
3578
|
-
|
|
3596
|
+
Me(() => {
|
|
3579
3597
|
requestAnimationFrame(() => {
|
|
3580
3598
|
t.value = !0, b.duration && b.duration > 0 && (n = window.setTimeout(() => g(), b.duration));
|
|
3581
3599
|
});
|
|
@@ -3585,13 +3603,13 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3585
3603
|
function g() {
|
|
3586
3604
|
t.value = !1;
|
|
3587
3605
|
}
|
|
3588
|
-
function
|
|
3589
|
-
var
|
|
3590
|
-
(
|
|
3606
|
+
function p() {
|
|
3607
|
+
var h;
|
|
3608
|
+
(h = b.onClose) == null || h.call(b, b.id);
|
|
3591
3609
|
}
|
|
3592
|
-
return (
|
|
3610
|
+
return (h, L) => (i(), Be(De, {
|
|
3593
3611
|
name: "y-msg-fade",
|
|
3594
|
-
onAfterLeave:
|
|
3612
|
+
onAfterLeave: p
|
|
3595
3613
|
}, {
|
|
3596
3614
|
default: ve(() => [
|
|
3597
3615
|
Ee(l("div", {
|
|
@@ -3601,7 +3619,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3601
3619
|
"aria-live": "polite"
|
|
3602
3620
|
}, [
|
|
3603
3621
|
l("span", ko, [
|
|
3604
|
-
e.type === "success" ? (i(),
|
|
3622
|
+
e.type === "success" ? (i(), r("svg", xo, [...L[0] || (L[0] = [
|
|
3605
3623
|
l("path", {
|
|
3606
3624
|
d: "M20 6L9 17l-5-5",
|
|
3607
3625
|
stroke: "currentColor",
|
|
@@ -3609,7 +3627,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3609
3627
|
"stroke-linecap": "round",
|
|
3610
3628
|
"stroke-linejoin": "round"
|
|
3611
3629
|
}, null, -1)
|
|
3612
|
-
])])) : e.type === "warning" ? (i(),
|
|
3630
|
+
])])) : e.type === "warning" ? (i(), r("svg", Co, [...L[1] || (L[1] = [
|
|
3613
3631
|
l("path", {
|
|
3614
3632
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
3615
3633
|
stroke: "currentColor",
|
|
@@ -3617,7 +3635,7 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3617
3635
|
"stroke-linecap": "round",
|
|
3618
3636
|
"stroke-linejoin": "round"
|
|
3619
3637
|
}, null, -1)
|
|
3620
|
-
])])) : (i(),
|
|
3638
|
+
])])) : (i(), r("svg", Do, [...L[2] || (L[2] = [
|
|
3621
3639
|
l("path", {
|
|
3622
3640
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
3623
3641
|
stroke: "currentColor",
|
|
@@ -3631,12 +3649,12 @@ const it = ["type", "disabled", "aria-busy", "aria-disabled"], rt = { class: "co
|
|
|
3631
3649
|
class: "y-msg__content",
|
|
3632
3650
|
textContent: ne(e.message)
|
|
3633
3651
|
}, null, 8, $o),
|
|
3634
|
-
e.closable ? (i(),
|
|
3652
|
+
e.closable ? (i(), r("button", {
|
|
3635
3653
|
key: 0,
|
|
3636
3654
|
class: "y-msg__close",
|
|
3637
3655
|
type: "button",
|
|
3638
3656
|
onClick: g
|
|
3639
|
-
}, "✕")) :
|
|
3657
|
+
}, "✕")) : V("", !0)
|
|
3640
3658
|
], 6), [
|
|
3641
3659
|
[He, t.value]
|
|
3642
3660
|
])
|
|
@@ -3654,21 +3672,21 @@ function Lo() {
|
|
|
3654
3672
|
}), e;
|
|
3655
3673
|
}
|
|
3656
3674
|
function qe(e) {
|
|
3657
|
-
const b = Ie.findIndex((
|
|
3675
|
+
const b = Ie.findIndex((p) => p.id === e);
|
|
3658
3676
|
if (b === -1) return;
|
|
3659
3677
|
const { el: t } = Ie[b], n = t.firstElementChild;
|
|
3660
3678
|
if (n) {
|
|
3661
|
-
const
|
|
3662
|
-
n.style.top =
|
|
3679
|
+
const p = window.getComputedStyle(n).top;
|
|
3680
|
+
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3663
3681
|
}
|
|
3664
3682
|
Ie[b].leaving = !0, Ye(), setTimeout(() => {
|
|
3665
3683
|
Ze(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3666
|
-
const
|
|
3667
|
-
|
|
3684
|
+
const p = Ie.findIndex((h) => h.id === e);
|
|
3685
|
+
p !== -1 && Ie.splice(p, 1), Ye();
|
|
3668
3686
|
}, 260);
|
|
3669
3687
|
}
|
|
3670
3688
|
function Ne(e) {
|
|
3671
|
-
var
|
|
3689
|
+
var p;
|
|
3672
3690
|
const b = Mo++, t = document.createElement("div");
|
|
3673
3691
|
document.body.appendChild(t);
|
|
3674
3692
|
const n = ce(So, {
|
|
@@ -3679,14 +3697,14 @@ function Ne(e) {
|
|
|
3679
3697
|
offset: Lo(),
|
|
3680
3698
|
zIndex: 3e3 + b,
|
|
3681
3699
|
closable: e.closable ?? !1,
|
|
3682
|
-
onClose: (
|
|
3700
|
+
onClose: (h) => qe(h)
|
|
3683
3701
|
});
|
|
3684
3702
|
Ze(n, t);
|
|
3685
|
-
const g = ((
|
|
3703
|
+
const g = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3686
3704
|
return Ie.push({ id: b, el: t, vm: n, height: g, leaving: !1 }), Ye(), requestAnimationFrame(() => {
|
|
3687
|
-
const
|
|
3688
|
-
if (!
|
|
3689
|
-
const L =
|
|
3705
|
+
const h = t.firstElementChild;
|
|
3706
|
+
if (!h) return;
|
|
3707
|
+
const L = h.offsetHeight || g || 0, k = Ie.find((_) => _.id === b);
|
|
3690
3708
|
k && (k.height = L, Ye());
|
|
3691
3709
|
}), { close: () => qe(b) };
|
|
3692
3710
|
}
|