@nhdropshipping/y-components 1.0.10 → 1.0.11
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/ytree.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 +484 -498
- 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 me, computed as q, createElementBlock as u, openBlock as a, normalizeClass as B, createElementVNode as n, renderSlot as ue, Fragment as re, renderList as he, createCommentVNode as A, toDisplayString as G, normalizeStyle as ge, ref as R, watch as ne, nextTick as ve, onMounted as Se, onUnmounted as Ee, resolveComponent as
|
|
1
|
+
import { defineComponent as me, computed as q, createElementBlock as u, openBlock as a, normalizeClass as B, createElementVNode as n, renderSlot as ue, Fragment as re, renderList as he, createCommentVNode as A, toDisplayString as G, normalizeStyle as ge, ref as R, watch as ne, nextTick as ve, onMounted as Se, onUnmounted as Ee, resolveComponent as Ye, createVNode as fe, Transition as ke, withCtx as pe, createBlock as Ie, createTextVNode as Ce, withKeys as be, withModifiers as J, withDirectives as Be, vModelText as tt, Teleport as Re, vShow as ze, provide as nt, useAttrs as lt, getCurrentInstance as ot, reactive as st, TransitionGroup as at, resolveDynamicComponent as it, onBeforeUnmount as rt, render as Ze } from "vue";
|
|
2
2
|
const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "content" }, dt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -30,7 +30,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
30
30
|
emits: ["click", "group-click"],
|
|
31
31
|
setup(t, { emit: b }) {
|
|
32
32
|
const e = t, l = b;
|
|
33
|
-
function
|
|
33
|
+
function h(_) {
|
|
34
34
|
if (e.disabled || e.loading) {
|
|
35
35
|
_.preventDefault(), _.stopPropagation();
|
|
36
36
|
return;
|
|
@@ -58,14 +58,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
58
58
|
}
|
|
59
59
|
return (_, M) => C.value ? (a(), u("div", dt, [
|
|
60
60
|
(a(!0), u(re, null, he(t.groupItems, (v, w) => {
|
|
61
|
-
var
|
|
61
|
+
var p;
|
|
62
62
|
return a(), u("button", {
|
|
63
63
|
key: v.value ?? w,
|
|
64
64
|
class: B(["y-btn", [
|
|
65
65
|
`y-btn--${v.variant ?? t.variant}`,
|
|
66
66
|
`y-btn--${v.size ?? t.size}`,
|
|
67
67
|
"is-grouped",
|
|
68
|
-
w === 0 ? "group-pos-start" : w === (((
|
|
68
|
+
w === 0 ? "group-pos-start" : w === (((p = t.groupItems) == null ? void 0 : p.length) || 0) - 1 ? "group-pos-end" : "group-pos-middle",
|
|
69
69
|
{ "is-loading": v.loading || t.loading }
|
|
70
70
|
]]),
|
|
71
71
|
type: t.htmlType,
|
|
@@ -73,7 +73,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
73
73
|
"aria-busy": v.loading || t.loading ? "true" : "false",
|
|
74
74
|
"aria-disabled": (v.disabled ?? !1) || t.disabled || t.loading || v.loading ? "true" : "false",
|
|
75
75
|
"aria-label": v.ariaLabel || v.label,
|
|
76
|
-
onClick: (
|
|
76
|
+
onClick: (K) => E(v, K)
|
|
77
77
|
}, [
|
|
78
78
|
n("span", vt, [
|
|
79
79
|
v.icon === "chevron-left" ? (a(), u("svg", ht, [...M[0] || (M[0] = [
|
|
@@ -106,7 +106,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
106
106
|
disabled: t.disabled || t.loading,
|
|
107
107
|
"aria-busy": t.loading ? "true" : "false",
|
|
108
108
|
"aria-disabled": t.disabled || t.loading ? "true" : "false",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: h
|
|
110
110
|
}, [
|
|
111
111
|
n("span", ct, [
|
|
112
112
|
ue(_.$slots, "default", {}, void 0, !0)
|
|
@@ -115,8 +115,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
115
115
|
}
|
|
116
116
|
}), we = (t, b) => {
|
|
117
117
|
const e = t.__vccOpts || t;
|
|
118
|
-
for (const [l,
|
|
119
|
-
e[l] =
|
|
118
|
+
for (const [l, h] of b)
|
|
119
|
+
e[l] = h;
|
|
120
120
|
return e;
|
|
121
121
|
}, Ae = /* @__PURE__ */ we(gt, [["__scopeId", "data-v-0c27d1bc"]]), mt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "disabled", "required", "value"], wt = /* @__PURE__ */ me({
|
|
122
122
|
__name: "yinput",
|
|
@@ -137,11 +137,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
137
137
|
emits: ["update:modelValue"],
|
|
138
138
|
setup(t, { emit: b }) {
|
|
139
139
|
const e = b;
|
|
140
|
-
function l(
|
|
141
|
-
const i =
|
|
140
|
+
function l(h) {
|
|
141
|
+
const i = h.target;
|
|
142
142
|
e("update:modelValue", i.value);
|
|
143
143
|
}
|
|
144
|
-
return (
|
|
144
|
+
return (h, i) => (a(), u("div", {
|
|
145
145
|
class: B(["y-input-wrap", { "is-block": t.block }]),
|
|
146
146
|
style: ge({ width: t.width })
|
|
147
147
|
}, [
|
|
@@ -207,7 +207,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
207
207
|
},
|
|
208
208
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
209
209
|
setup(t, { emit: b }) {
|
|
210
|
-
const e = t, l = b,
|
|
210
|
+
const e = t, l = b, h = R(e.currentPage || 1), i = R(e.pageSize), C = R([]), E = R("none"), _ = R(), M = R(), v = R(), w = R(), p = R([]), K = R(), V = R({
|
|
211
211
|
show: !1,
|
|
212
212
|
thumbHeight: 40,
|
|
213
213
|
thumbTop: 0
|
|
@@ -217,26 +217,26 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
217
217
|
if (!e.searchKeyword || !e.searchFields.length)
|
|
218
218
|
return e.data;
|
|
219
219
|
const k = e.searchKeyword.toLowerCase();
|
|
220
|
-
return e.data.filter((S) => e.searchFields.some((
|
|
221
|
-
const x = ce(S,
|
|
220
|
+
return e.data.filter((S) => e.searchFields.some((z) => {
|
|
221
|
+
const x = ce(S, z);
|
|
222
222
|
return String(x).toLowerCase().includes(k);
|
|
223
223
|
}));
|
|
224
224
|
}), I = q(() => (e.pagination, L.value)), P = q(() => {
|
|
225
225
|
if (!e.selectable) return !1;
|
|
226
|
-
const k = I.value.map((S,
|
|
226
|
+
const k = I.value.map((S, z) => le(S, z));
|
|
227
227
|
return k.length > 0 && k.every((S) => C.value.includes(S));
|
|
228
228
|
}), X = q(() => {
|
|
229
229
|
const k = [];
|
|
230
230
|
let S = e.selectable ? 40 : 0;
|
|
231
|
-
for (let
|
|
232
|
-
const x = e.columns[
|
|
231
|
+
for (let z = 0; z < e.columns.length; z++) {
|
|
232
|
+
const x = e.columns[z];
|
|
233
233
|
if (x.fixed === "left") {
|
|
234
234
|
let O = 80;
|
|
235
235
|
if (x.width) {
|
|
236
236
|
const Q = parseFloat(x.width);
|
|
237
237
|
O = isNaN(Q) ? 80 : Q;
|
|
238
|
-
} else if (
|
|
239
|
-
const Q = parseFloat(
|
|
238
|
+
} else if (p.value[z]) {
|
|
239
|
+
const Q = parseFloat(p.value[z]);
|
|
240
240
|
O = isNaN(Q) ? 80 : Q;
|
|
241
241
|
}
|
|
242
242
|
k.push(S), S += O;
|
|
@@ -246,7 +246,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
246
246
|
}), ee = q(() => {
|
|
247
247
|
const k = [];
|
|
248
248
|
let S = 0;
|
|
249
|
-
const
|
|
249
|
+
const z = [];
|
|
250
250
|
for (let x = e.columns.length - 1; x >= 0; x--) {
|
|
251
251
|
const O = e.columns[x];
|
|
252
252
|
if (O.fixed === "right") {
|
|
@@ -254,60 +254,60 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
254
254
|
if (O.width) {
|
|
255
255
|
const ae = parseFloat(O.width);
|
|
256
256
|
Q = isNaN(ae) ? 80 : ae;
|
|
257
|
-
} else if (
|
|
258
|
-
const ae = parseFloat(
|
|
257
|
+
} else if (p.value[x]) {
|
|
258
|
+
const ae = parseFloat(p.value[x]);
|
|
259
259
|
Q = isNaN(ae) ? 80 : ae;
|
|
260
260
|
}
|
|
261
|
-
|
|
261
|
+
z.push({ index: x, width: Q });
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
for (let x = 0; x <
|
|
265
|
-
k.push(S), S +=
|
|
264
|
+
for (let x = 0; x < z.length; x++)
|
|
265
|
+
k.push(S), S += z[x].width;
|
|
266
266
|
return k;
|
|
267
267
|
});
|
|
268
268
|
function se(k, S) {
|
|
269
269
|
if (S === "left") {
|
|
270
|
-
let
|
|
270
|
+
let z = 0;
|
|
271
271
|
for (let x = 0; x < k; x++)
|
|
272
|
-
e.columns[x].fixed === "left" &&
|
|
273
|
-
return
|
|
272
|
+
e.columns[x].fixed === "left" && z++;
|
|
273
|
+
return z;
|
|
274
274
|
} else {
|
|
275
|
-
let
|
|
275
|
+
let z = 0;
|
|
276
276
|
for (let x = e.columns.length - 1; x > k; x--)
|
|
277
|
-
e.columns[x].fixed === "right" &&
|
|
278
|
-
return
|
|
277
|
+
e.columns[x].fixed === "right" && z++;
|
|
278
|
+
return z;
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
function le(k, S) {
|
|
282
282
|
return typeof e.rowKey == "function" ? e.rowKey(k) : k[e.rowKey] || S;
|
|
283
283
|
}
|
|
284
284
|
function ce(k, S) {
|
|
285
|
-
return S.split(".").reduce((
|
|
285
|
+
return S.split(".").reduce((z, x) => z == null ? void 0 : z[x], k);
|
|
286
286
|
}
|
|
287
287
|
function de(k, S = !1) {
|
|
288
|
-
const
|
|
289
|
-
return k.align &&
|
|
288
|
+
const z = [];
|
|
289
|
+
return k.align && z.push(`text-${k.align}`), k.fixed === "right" && (z.push("col-fixed-right"), S && z.push("col-fixed-right-header")), k.fixed === "left" && (z.push("col-fixed-left"), S && z.push("col-fixed-left-header")), z.join(" ");
|
|
290
290
|
}
|
|
291
|
-
function
|
|
291
|
+
function F(k, S, z) {
|
|
292
292
|
const x = {};
|
|
293
293
|
if (k.width ? (x.width = k.width, x.minWidth = k.width, x.maxWidth = k.width) : (x.width = "auto", x.minWidth = "80px", x.maxWidth = "none"), k.fixed === "left") {
|
|
294
294
|
const O = se(S, "left"), Q = X.value[O] || 0;
|
|
295
|
-
x.left = `${Q}px`, x.zIndex =
|
|
295
|
+
x.left = `${Q}px`, x.zIndex = z ? `${10 + O}` : `${5 + O}`;
|
|
296
296
|
} else if (k.fixed === "right") {
|
|
297
297
|
const O = se(S, "right"), Q = ee.value[O] || 0;
|
|
298
|
-
|
|
298
|
+
z ? x.right = `${Q - 3}px` : x.right = `${Q}px`, x.zIndex = z ? `${10 + O}` : `${5 + O}`;
|
|
299
299
|
}
|
|
300
300
|
return x;
|
|
301
301
|
}
|
|
302
302
|
function W(k, S) {
|
|
303
|
-
const
|
|
304
|
-
return S.formatter ? S.formatter(
|
|
303
|
+
const z = ce(k, S.key);
|
|
304
|
+
return S.formatter ? S.formatter(z, k) : z || "";
|
|
305
305
|
}
|
|
306
306
|
function d(k) {
|
|
307
307
|
C.value.includes(k) ? C.value = C.value.filter((S) => S !== k) : C.value = [...C.value, k], l("select", C.value), l("update:selectedItems", C.value);
|
|
308
308
|
}
|
|
309
309
|
function f() {
|
|
310
|
-
const k = I.value.map((S,
|
|
310
|
+
const k = I.value.map((S, z) => le(S, z));
|
|
311
311
|
if (k.every((S) => C.value.includes(S)))
|
|
312
312
|
C.value = C.value.filter((S) => !k.includes(S));
|
|
313
313
|
else {
|
|
@@ -320,55 +320,55 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
320
320
|
C.value = [], l("select", C.value), l("update:selectedItems", C.value);
|
|
321
321
|
}
|
|
322
322
|
ne(() => e.searchKeyword, () => {
|
|
323
|
-
|
|
323
|
+
h.value = 1;
|
|
324
324
|
}), ne(() => e.data, () => {
|
|
325
|
-
e.total || (
|
|
325
|
+
e.total || (h.value = 1);
|
|
326
326
|
}, { deep: !0 });
|
|
327
327
|
function m(k) {
|
|
328
|
-
|
|
328
|
+
h.value = k, l("page-change", k);
|
|
329
329
|
}
|
|
330
330
|
function o(k) {
|
|
331
|
-
i.value = k,
|
|
331
|
+
i.value = k, h.value = 1, l("page-size-change", k);
|
|
332
332
|
}
|
|
333
333
|
ne(() => e.currentPage, (k) => {
|
|
334
334
|
const S = typeof k == "number" && k > 0 ? k : 1;
|
|
335
|
-
|
|
335
|
+
h.value !== S && (h.value = S);
|
|
336
336
|
}), ne(() => e.pageSize, (k) => {
|
|
337
337
|
const S = typeof k == "number" && k > 0 ? k : 10;
|
|
338
338
|
i.value !== S && (i.value = S);
|
|
339
339
|
});
|
|
340
340
|
function r() {
|
|
341
341
|
_.value && ve(() => {
|
|
342
|
-
const k = _.value.getBoundingClientRect(), S = window.innerHeight,
|
|
343
|
-
ie && (ie.offsetHeight >
|
|
342
|
+
const k = _.value.getBoundingClientRect(), S = window.innerHeight, z = k.top, x = _.value.querySelector(".table-header"), O = x ? x.offsetHeight : 40, Q = _.value.querySelector(".ypagination"), ae = Q ? Q.offsetHeight : 60, s = _.value.querySelector(".bulk-bar"), c = s ? s.offsetHeight : 0, $ = O + ae + c + 20, N = S - z - $, te = Math.max(200, N), ie = _.value.querySelector(".table-body-wrap .table");
|
|
343
|
+
ie && (ie.offsetHeight > N ? E.value = `${te}px` : E.value = "none");
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
|
-
let
|
|
347
|
-
function
|
|
348
|
-
!M.value || !v.value ||
|
|
349
|
-
|
|
346
|
+
let y = !1;
|
|
347
|
+
function Y() {
|
|
348
|
+
!M.value || !v.value || y || M.value.scrollLeft !== v.value.scrollLeft && (y = !0, M.value.scrollLeft = v.value.scrollLeft, requestAnimationFrame(() => {
|
|
349
|
+
y = !1;
|
|
350
350
|
}));
|
|
351
351
|
}
|
|
352
352
|
function H() {
|
|
353
|
-
!M.value || !v.value ||
|
|
354
|
-
|
|
353
|
+
!M.value || !v.value || y || v.value.scrollLeft !== M.value.scrollLeft && (y = !0, v.value.scrollLeft = M.value.scrollLeft, requestAnimationFrame(() => {
|
|
354
|
+
y = !1;
|
|
355
355
|
}));
|
|
356
356
|
}
|
|
357
357
|
function Z() {
|
|
358
358
|
ve(() => {
|
|
359
359
|
if (!v.value) return;
|
|
360
|
-
const k = v.value, S = k.scrollHeight,
|
|
360
|
+
const k = v.value, S = k.scrollHeight, z = k.clientHeight, x = k.scrollTop, O = S > z + 1;
|
|
361
361
|
if (V.value.show = O, !O) return;
|
|
362
|
-
const Q = 24, ae =
|
|
362
|
+
const Q = 24, ae = z / S, s = K.value ? K.value.clientHeight : z, c = Math.max(Q, Math.floor(s * ae));
|
|
363
363
|
V.value.thumbHeight = c;
|
|
364
|
-
const $ = Math.max(0, s - c),
|
|
365
|
-
V.value.thumbTop = Math.min($, Math.floor(x /
|
|
364
|
+
const $ = Math.max(0, s - c), N = Math.max(1, S - z);
|
|
365
|
+
V.value.thumbTop = Math.min($, Math.floor(x / N * $));
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
368
|
function De(k) {
|
|
369
|
-
if (!U || !v.value || !
|
|
369
|
+
if (!U || !v.value || !K.value) return;
|
|
370
370
|
k.preventDefault();
|
|
371
|
-
const S =
|
|
371
|
+
const S = K.value.clientHeight, z = Math.max(0, S - V.value.thumbHeight), x = v.value, O = x.scrollHeight, Q = x.clientHeight, ae = Math.max(1, O - Q), c = (k.clientY - j) / Math.max(1, z) * ae;
|
|
372
372
|
x.scrollTop = Math.min(ae, Math.max(0, D + c)), Z();
|
|
373
373
|
}
|
|
374
374
|
function $e() {
|
|
@@ -376,18 +376,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
376
376
|
}
|
|
377
377
|
function Ve() {
|
|
378
378
|
ve(() => {
|
|
379
|
-
var
|
|
380
|
-
if (
|
|
379
|
+
var z;
|
|
380
|
+
if (p.value.length === e.columns.length && p.value.every((x) => !!x))
|
|
381
381
|
return;
|
|
382
382
|
const k = [];
|
|
383
383
|
for (const x of e.columns)
|
|
384
384
|
if (x.width && typeof x.width == "string" && x.width.trim())
|
|
385
385
|
k.push(x.width);
|
|
386
386
|
else {
|
|
387
|
-
const O =
|
|
387
|
+
const O = p.value[k.length];
|
|
388
388
|
k.push(O || "");
|
|
389
389
|
}
|
|
390
|
-
const S = (
|
|
390
|
+
const S = (z = w.value) == null ? void 0 : z.querySelector("tbody tr");
|
|
391
391
|
if (S) {
|
|
392
392
|
const x = e.selectable ? 1 : 0, O = Array.from(S.children);
|
|
393
393
|
for (let Q = 0; Q < e.columns.length; Q++)
|
|
@@ -401,8 +401,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
401
401
|
}
|
|
402
402
|
} else
|
|
403
403
|
for (let x = 0; x < k.length; x++)
|
|
404
|
-
k[x] || (k[x] =
|
|
405
|
-
|
|
404
|
+
k[x] || (k[x] = p.value[x] || "80px");
|
|
405
|
+
p.value = k;
|
|
406
406
|
});
|
|
407
407
|
}
|
|
408
408
|
function He() {
|
|
@@ -410,15 +410,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
410
410
|
}
|
|
411
411
|
ne(() => e.data, () => {
|
|
412
412
|
ve(() => {
|
|
413
|
-
r(),
|
|
413
|
+
r(), Y(), _e();
|
|
414
414
|
});
|
|
415
|
-
}, { deep: !0 }), ne([
|
|
415
|
+
}, { deep: !0 }), ne([h, i], () => {
|
|
416
416
|
ve(() => {
|
|
417
|
-
r(),
|
|
417
|
+
r(), Y(), _e();
|
|
418
418
|
});
|
|
419
419
|
}), ne(() => e.columns, () => {
|
|
420
|
-
|
|
421
|
-
Ve(),
|
|
420
|
+
p.value = [], ve(() => {
|
|
421
|
+
Ve(), Y(), _e();
|
|
422
422
|
});
|
|
423
423
|
}, { deep: !0 }), ne(() => C.value, () => {
|
|
424
424
|
ve(() => {
|
|
@@ -433,15 +433,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
433
433
|
ve(() => {
|
|
434
434
|
r(), Ve(), _e(), Z();
|
|
435
435
|
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (k = v.value) == null || k.addEventListener("scroll", () => {
|
|
436
|
-
|
|
436
|
+
Y(), Z(), _e();
|
|
437
437
|
}, { passive: !0 }), (S = M.value) == null || S.addEventListener("scroll", () => {
|
|
438
438
|
H();
|
|
439
|
-
}, { passive: !0 }), ve(() =>
|
|
439
|
+
}, { passive: !0 }), ve(() => Y()), v.value && typeof ResizeObserver < "u" && (Ke = new ResizeObserver(() => {
|
|
440
440
|
_e();
|
|
441
|
-
}),
|
|
441
|
+
}), Ke.observe(v.value));
|
|
442
442
|
}), Ee(() => {
|
|
443
443
|
var k, S;
|
|
444
|
-
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (k = v.value) == null || k.removeEventListener("scroll",
|
|
444
|
+
window.removeEventListener("resize", He), window.removeEventListener("scroll", He, !0), (k = v.value) == null || k.removeEventListener("scroll", Y), (S = M.value) == null || S.removeEventListener("scroll", H), window.removeEventListener("mousemove", De), window.removeEventListener("mouseup", $e), Ke && (Ke.disconnect(), Ke = null);
|
|
445
445
|
});
|
|
446
446
|
let Te = -1;
|
|
447
447
|
function _e() {
|
|
@@ -450,14 +450,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
450
450
|
const k = v.value, S = Math.ceil(k.offsetWidth - k.clientWidth);
|
|
451
451
|
if (T.value = S, S !== Te) {
|
|
452
452
|
Te = S;
|
|
453
|
-
const
|
|
454
|
-
|
|
453
|
+
const z = M.value.querySelector(".table"), x = w.value;
|
|
454
|
+
z && x && (M.value.style.paddingRight = "0px", z.style.width = "", z.style.marginRight = "", S > 0 ? (M.value.style.paddingRight = `${S}px`, z.style.width = "100%", z.style.marginRight = `-${S}px`) : (M.value.style.paddingRight = "0px", z.style.width = "100%", z.style.marginRight = "0px"));
|
|
455
455
|
}
|
|
456
456
|
});
|
|
457
457
|
}
|
|
458
|
-
let
|
|
458
|
+
let Ke = null;
|
|
459
459
|
return (k, S) => {
|
|
460
|
-
const
|
|
460
|
+
const z = Ye("YPagination");
|
|
461
461
|
return a(), u("div", {
|
|
462
462
|
class: "ytable-container",
|
|
463
463
|
ref_key: "tableContainer",
|
|
@@ -493,7 +493,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
493
493
|
t.selectable ? (a(), u("col", $t)) : A("", !0),
|
|
494
494
|
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("col", {
|
|
495
495
|
key: x.key,
|
|
496
|
-
style: ge({ width:
|
|
496
|
+
style: ge({ width: p.value[O] || void 0, minWidth: p.value[O] || "80px" })
|
|
497
497
|
}, null, 4))), 128))
|
|
498
498
|
]),
|
|
499
499
|
n("thead", null, [
|
|
@@ -508,7 +508,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
508
508
|
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("th", {
|
|
509
509
|
key: x.key,
|
|
510
510
|
class: B(de(x, !0)),
|
|
511
|
-
style: ge(
|
|
511
|
+
style: ge(F(x, O, !0))
|
|
512
512
|
}, G(x.title), 7))), 128))
|
|
513
513
|
])
|
|
514
514
|
])
|
|
@@ -538,7 +538,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
538
538
|
t.selectable ? (a(), u("col", It)) : A("", !0),
|
|
539
539
|
(a(!0), u(re, null, he(t.columns, (x, O) => (a(), u("col", {
|
|
540
540
|
key: x.key,
|
|
541
|
-
style: ge({ width:
|
|
541
|
+
style: ge({ width: p.value[O] || void 0, minWidth: p.value[O] || "80px" })
|
|
542
542
|
}, null, 4))), 128))
|
|
543
543
|
]),
|
|
544
544
|
n("tbody", null, [
|
|
@@ -556,7 +556,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
556
556
|
(a(!0), u(re, null, he(t.columns, (Q, ae) => (a(), u("td", {
|
|
557
557
|
key: Q.key,
|
|
558
558
|
class: B(de(Q)),
|
|
559
|
-
style: ge(
|
|
559
|
+
style: ge(F(Q, ae, !1))
|
|
560
560
|
}, [
|
|
561
561
|
ue(k.$slots, `cell-${Q.key}`, {
|
|
562
562
|
item: x,
|
|
@@ -570,11 +570,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
570
570
|
])
|
|
571
571
|
], 2)
|
|
572
572
|
], 6),
|
|
573
|
-
t.pagination ? (a(), Ie(
|
|
573
|
+
t.pagination ? (a(), Ie(z, {
|
|
574
574
|
key: 0,
|
|
575
575
|
class: "align-right",
|
|
576
|
-
"current-page":
|
|
577
|
-
"onUpdate:currentPage": S[0] || (S[0] = (x) =>
|
|
576
|
+
"current-page": h.value,
|
|
577
|
+
"onUpdate:currentPage": S[0] || (S[0] = (x) => h.value = x),
|
|
578
578
|
"page-size": i.value,
|
|
579
579
|
"onUpdate:pageSize": S[1] || (S[1] = (x) => i.value = x),
|
|
580
580
|
loading: e.loading,
|
|
@@ -586,7 +586,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
586
586
|
], 512);
|
|
587
587
|
};
|
|
588
588
|
}
|
|
589
|
-
}),
|
|
589
|
+
}), Kt = /* @__PURE__ */ we(Tt, [["__scopeId", "data-v-c75c4929"]]), zt = ["onKeydown", "aria-expanded"], Ht = ["src"], Rt = ["placeholder", "onKeydown"], Vt = ["onClick", "onMouseenter"], At = ["src"], Yt = /* @__PURE__ */ me({
|
|
590
590
|
__name: "yselect",
|
|
591
591
|
props: {
|
|
592
592
|
modelValue: {},
|
|
@@ -605,25 +605,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
605
605
|
},
|
|
606
606
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
607
607
|
setup(t, { emit: b }) {
|
|
608
|
-
const e = t, l = b,
|
|
608
|
+
const e = t, l = b, h = R(!1), i = R(-1), C = R(), E = R(), _ = R(), M = R(), v = R(!1), w = R(), p = R(""), K = q(() => e.options.find((o) => T(o) === e.modelValue) || null), V = q(() => K.value ? L(K.value) : ""), U = q(() => {
|
|
609
609
|
if (!e.filterable) return e.options;
|
|
610
|
-
const o =
|
|
610
|
+
const o = p.value.trim().toLowerCase();
|
|
611
611
|
return o ? e.options.filter((r) => {
|
|
612
|
-
const
|
|
613
|
-
return String(
|
|
612
|
+
const y = L(r);
|
|
613
|
+
return String(y).toLowerCase().includes(o);
|
|
614
614
|
}) : e.options;
|
|
615
615
|
}), j = q(() => {
|
|
616
616
|
var H;
|
|
617
617
|
const o = { position: "fixed", zIndex: "4000" }, r = E.value;
|
|
618
618
|
if (!r) return o;
|
|
619
|
-
const
|
|
620
|
-
return o.left = `${
|
|
619
|
+
const y = r.getBoundingClientRect(), Y = ((H = _.value) == null ? void 0 : H.getBoundingClientRect().width) || y.width;
|
|
620
|
+
return o.left = `${y.left}px`, o.width = `${Y}px`, v.value ? (o.bottom = `${window.innerHeight - y.top + 4}px`, o.top = "auto") : o.top = `${y.bottom + 4}px`, o;
|
|
621
621
|
});
|
|
622
622
|
function D() {
|
|
623
|
-
!
|
|
623
|
+
!h.value || !E.value || ve(() => {
|
|
624
624
|
const o = E.value;
|
|
625
625
|
if (!o) return;
|
|
626
|
-
const r = o.getBoundingClientRect(),
|
|
626
|
+
const r = o.getBoundingClientRect(), y = window.innerHeight, Y = 200, H = r.bottom + Y + 4, Z = r.top - Y - 4, De = H <= y - 20, $e = Z >= 20;
|
|
627
627
|
v.value = !De && $e;
|
|
628
628
|
});
|
|
629
629
|
}
|
|
@@ -643,38 +643,38 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
643
643
|
return typeof o == "object" && o !== null ? o[e.disabledKey] === !0 : !1;
|
|
644
644
|
}
|
|
645
645
|
function ee() {
|
|
646
|
-
e.disabled || (
|
|
646
|
+
e.disabled || (h.value ? le() : se());
|
|
647
647
|
}
|
|
648
648
|
function se() {
|
|
649
|
-
e.disabled || (
|
|
650
|
-
D(), d(), e.filterable && w.value && (w.value.focus(),
|
|
649
|
+
e.disabled || (h.value = !0, ve(() => {
|
|
650
|
+
D(), d(), e.filterable && w.value && (w.value.focus(), p.value = "");
|
|
651
651
|
}));
|
|
652
652
|
}
|
|
653
653
|
function le() {
|
|
654
|
-
|
|
654
|
+
h.value = !1, i.value = -1, v.value = !1, e.filterable && (p.value = "");
|
|
655
655
|
}
|
|
656
656
|
function ce(o, r) {
|
|
657
657
|
if (X(o)) return;
|
|
658
|
-
const
|
|
659
|
-
l("update:modelValue",
|
|
658
|
+
const y = T(o);
|
|
659
|
+
l("update:modelValue", y), l("change", y, o), le();
|
|
660
660
|
}
|
|
661
661
|
function de() {
|
|
662
662
|
if (!e.clearable || e.disabled) return;
|
|
663
663
|
const o = e.clearTo;
|
|
664
664
|
l("update:modelValue", o), l("change", o, null), l("clear"), le();
|
|
665
665
|
}
|
|
666
|
-
function
|
|
666
|
+
function F(o) {
|
|
667
667
|
if (!U.value || U.value.length === 0) {
|
|
668
668
|
i.value = -1;
|
|
669
669
|
return;
|
|
670
670
|
}
|
|
671
671
|
let r = i.value;
|
|
672
|
-
const
|
|
673
|
-
r === -1 ? r = o > 0 ? 0 :
|
|
674
|
-
let
|
|
675
|
-
for (;
|
|
676
|
-
r = (r + o +
|
|
677
|
-
i.value =
|
|
672
|
+
const y = U.value.length;
|
|
673
|
+
r === -1 ? r = o > 0 ? 0 : y - 1 : r = (r + o + y) % y;
|
|
674
|
+
let Y = 0;
|
|
675
|
+
for (; Y < y && X(U.value[r]); )
|
|
676
|
+
r = (r + o + y) % y, Y++;
|
|
677
|
+
i.value = Y >= y ? -1 : r, f();
|
|
678
678
|
}
|
|
679
679
|
function W() {
|
|
680
680
|
if (i.value < 0) return;
|
|
@@ -699,7 +699,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
699
699
|
i.value = -1;
|
|
700
700
|
});
|
|
701
701
|
function m() {
|
|
702
|
-
|
|
702
|
+
h.value && D();
|
|
703
703
|
}
|
|
704
704
|
return Se(() => {
|
|
705
705
|
document.addEventListener("click", g), window.addEventListener("resize", m), window.addEventListener("scroll", m, !0);
|
|
@@ -715,7 +715,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
715
715
|
ref_key: "triggerElement",
|
|
716
716
|
ref: E,
|
|
717
717
|
class: B(["yselect__trigger", {
|
|
718
|
-
"yselect__trigger--open":
|
|
718
|
+
"yselect__trigger--open": h.value,
|
|
719
719
|
"yselect__trigger--disabled": t.disabled,
|
|
720
720
|
"yselect__trigger--error": t.error
|
|
721
721
|
}]),
|
|
@@ -729,24 +729,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
729
729
|
],
|
|
730
730
|
tabindex: "0",
|
|
731
731
|
role: "combobox",
|
|
732
|
-
"aria-expanded":
|
|
732
|
+
"aria-expanded": h.value,
|
|
733
733
|
"aria-haspopup": !0
|
|
734
734
|
}, [
|
|
735
|
-
!t.filterable || !
|
|
735
|
+
!t.filterable || !h.value ? (a(), u("span", {
|
|
736
736
|
key: 0,
|
|
737
737
|
class: B(["yselect__value", { yselect__placeholder: !V.value }])
|
|
738
738
|
}, [
|
|
739
739
|
ue(o.$slots, "value", {
|
|
740
|
-
value:
|
|
740
|
+
value: K.value,
|
|
741
741
|
label: V.value
|
|
742
742
|
}, () => {
|
|
743
|
-
var
|
|
743
|
+
var y;
|
|
744
744
|
return [
|
|
745
|
-
|
|
746
|
-
(
|
|
745
|
+
K.value ? (a(), u(re, { key: 0 }, [
|
|
746
|
+
(y = K.value) != null && y.flagImg ? (a(), u("img", {
|
|
747
747
|
key: 0,
|
|
748
748
|
class: "yselect__flag",
|
|
749
|
-
src:
|
|
749
|
+
src: K.value.flagImg,
|
|
750
750
|
alt: "flag"
|
|
751
751
|
}, null, 8, Ht)) : A("", !0),
|
|
752
752
|
Ce(" " + G(V.value), 1)
|
|
@@ -762,20 +762,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
762
762
|
class: "yselect__input",
|
|
763
763
|
type: "text",
|
|
764
764
|
placeholder: V.value || t.placeholder,
|
|
765
|
-
"onUpdate:modelValue": r[0] || (r[0] = (
|
|
765
|
+
"onUpdate:modelValue": r[0] || (r[0] = (y) => p.value = y),
|
|
766
766
|
onKeydown: [
|
|
767
767
|
r[1] || (r[1] = J(() => {
|
|
768
768
|
}, ["stop"])),
|
|
769
|
-
r[2] || (r[2] = be(J((
|
|
770
|
-
r[3] || (r[3] = be(J((
|
|
771
|
-
r[4] || (r[4] = be(J((
|
|
769
|
+
r[2] || (r[2] = be(J((y) => F(1), ["prevent"]), ["arrow-down"])),
|
|
770
|
+
r[3] || (r[3] = be(J((y) => F(-1), ["prevent"]), ["arrow-up"])),
|
|
771
|
+
r[4] || (r[4] = be(J((y) => W(), ["prevent"]), ["enter"])),
|
|
772
772
|
be(J(le, ["prevent"]), ["esc"]),
|
|
773
773
|
be(J(de, ["prevent"]), ["delete"])
|
|
774
774
|
]
|
|
775
775
|
}, null, 40, Rt)), [
|
|
776
|
-
[tt,
|
|
776
|
+
[tt, p.value]
|
|
777
777
|
]),
|
|
778
|
-
t.clearable && !t.disabled &&
|
|
778
|
+
t.clearable && !t.disabled && K.value ? (a(), u("span", {
|
|
779
779
|
key: 2,
|
|
780
780
|
class: "yselect__clear",
|
|
781
781
|
title: "清空",
|
|
@@ -796,7 +796,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
796
796
|
], -1)
|
|
797
797
|
])])) : A("", !0),
|
|
798
798
|
n("span", {
|
|
799
|
-
class: B(["yselect__arrow", { "yselect__arrow--open":
|
|
799
|
+
class: B(["yselect__arrow", { "yselect__arrow--open": h.value }])
|
|
800
800
|
}, [...r[9] || (r[9] = [
|
|
801
801
|
n("svg", {
|
|
802
802
|
width: "12",
|
|
@@ -813,11 +813,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
813
813
|
})
|
|
814
814
|
], -1)
|
|
815
815
|
])], 2)
|
|
816
|
-
], 42,
|
|
816
|
+
], 42, zt),
|
|
817
817
|
fe(ke, { name: "yselect-dropdown" }, {
|
|
818
818
|
default: pe(() => [
|
|
819
819
|
(a(), Ie(Re, { to: "body" }, [
|
|
820
|
-
|
|
820
|
+
h.value ? (a(), u("div", {
|
|
821
821
|
key: 0,
|
|
822
822
|
ref_key: "dropdownEl",
|
|
823
823
|
ref: M,
|
|
@@ -833,29 +833,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
833
833
|
ref_key: "optionsContainer",
|
|
834
834
|
ref: C
|
|
835
835
|
}, [
|
|
836
|
-
(a(!0), u(re, null, he(U.value, (
|
|
837
|
-
key: I(
|
|
836
|
+
(a(!0), u(re, null, he(U.value, (y, Y) => (a(), u("div", {
|
|
837
|
+
key: I(y, Y),
|
|
838
838
|
class: B(["yselect__option", {
|
|
839
|
-
"yselect__option--selected": P(
|
|
840
|
-
"yselect__option--disabled": X(
|
|
841
|
-
"yselect__option--hover": i.value ===
|
|
839
|
+
"yselect__option--selected": P(y),
|
|
840
|
+
"yselect__option--disabled": X(y),
|
|
841
|
+
"yselect__option--hover": i.value === Y
|
|
842
842
|
}]),
|
|
843
|
-
onClick: (H) => ce(
|
|
844
|
-
onMouseenter: (H) => i.value =
|
|
843
|
+
onClick: (H) => ce(y),
|
|
844
|
+
onMouseenter: (H) => i.value = Y,
|
|
845
845
|
onMouseleave: r[5] || (r[5] = (H) => i.value = -1)
|
|
846
846
|
}, [
|
|
847
847
|
ue(o.$slots, "option", {
|
|
848
|
-
option:
|
|
849
|
-
index:
|
|
850
|
-
selected: P(
|
|
848
|
+
option: y,
|
|
849
|
+
index: Y,
|
|
850
|
+
selected: P(y)
|
|
851
851
|
}, () => [
|
|
852
|
-
|
|
852
|
+
y != null && y.flagImg ? (a(), u("img", {
|
|
853
853
|
key: 0,
|
|
854
854
|
class: "yselect__flag",
|
|
855
|
-
src:
|
|
855
|
+
src: y.flagImg,
|
|
856
856
|
alt: "flag"
|
|
857
857
|
}, null, 8, At)) : A("", !0),
|
|
858
|
-
Ce(" " + G(L(
|
|
858
|
+
Ce(" " + G(L(y)), 1)
|
|
859
859
|
], !0)
|
|
860
860
|
], 42, Vt))), 128))
|
|
861
861
|
], 512)
|
|
@@ -866,7 +866,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
866
866
|
})
|
|
867
867
|
], 6));
|
|
868
868
|
}
|
|
869
|
-
}), Je = /* @__PURE__ */ we(
|
|
869
|
+
}), Je = /* @__PURE__ */ we(Yt, [["__scopeId", "data-v-6cd47cb7"]]), Ft = { class: "ypagination" }, Nt = { class: "page-actions" }, Pt = { class: "page-size-select" }, Wt = /* @__PURE__ */ me({
|
|
870
870
|
__name: "ypagination",
|
|
871
871
|
props: {
|
|
872
872
|
currentPage: {},
|
|
@@ -881,7 +881,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
881
881
|
},
|
|
882
882
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
883
883
|
setup(t, { emit: b }) {
|
|
884
|
-
const e = t, l = b,
|
|
884
|
+
const e = t, l = b, h = R(e.pageSize), i = q(() => e.pageSizeOptions), C = q({
|
|
885
885
|
get: () => e.currentPage,
|
|
886
886
|
set: (v) => {
|
|
887
887
|
l("update:currentPage", v), l("page-change", v);
|
|
@@ -891,21 +891,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
891
891
|
e.loading || v >= 1 && v !== e.currentPage && (C.value = v);
|
|
892
892
|
}
|
|
893
893
|
function _(v) {
|
|
894
|
-
e.loading || (
|
|
894
|
+
e.loading || (h.value = v, l("update:pageSize", v), l("page-size-change", v), C.value = 1);
|
|
895
895
|
}
|
|
896
896
|
function M(v) {
|
|
897
897
|
e.loading || (v === "prev" ? E(C.value - 1) : v === "next" && E(C.value + 1));
|
|
898
898
|
}
|
|
899
|
-
return
|
|
899
|
+
return h.value = e.pageSize, ne(
|
|
900
900
|
() => e.pageSize,
|
|
901
901
|
(v) => {
|
|
902
|
-
typeof v == "number" &&
|
|
902
|
+
typeof v == "number" && h.value !== v && (h.value = v);
|
|
903
903
|
}
|
|
904
904
|
), (v, w) => {
|
|
905
|
-
const
|
|
906
|
-
return a(), u("div",
|
|
907
|
-
n("div",
|
|
908
|
-
fe(
|
|
905
|
+
const p = Ye("YButton"), K = Ye("YSelect");
|
|
906
|
+
return a(), u("div", Ft, [
|
|
907
|
+
n("div", Nt, [
|
|
908
|
+
fe(p, {
|
|
909
909
|
size: "small",
|
|
910
910
|
variant: "secondary",
|
|
911
911
|
disabled: C.value === 1 || t.loading,
|
|
@@ -916,7 +916,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
916
916
|
])]),
|
|
917
917
|
_: 1
|
|
918
918
|
}, 8, ["disabled"]),
|
|
919
|
-
fe(
|
|
919
|
+
fe(p, {
|
|
920
920
|
class: "ml-1",
|
|
921
921
|
variant: "secondary",
|
|
922
922
|
size: "small",
|
|
@@ -927,9 +927,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
927
927
|
onGroupClick: M
|
|
928
928
|
}, null, 8, ["groupItems"]),
|
|
929
929
|
n("div", Pt, [
|
|
930
|
-
fe(
|
|
931
|
-
modelValue:
|
|
932
|
-
"onUpdate:modelValue": w[1] || (w[1] = (V) =>
|
|
930
|
+
fe(K, {
|
|
931
|
+
modelValue: h.value,
|
|
932
|
+
"onUpdate:modelValue": w[1] || (w[1] = (V) => h.value = V),
|
|
933
933
|
options: i.value,
|
|
934
934
|
size: "small",
|
|
935
935
|
width: "105px",
|
|
@@ -998,14 +998,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
998
998
|
},
|
|
999
999
|
setup(t) {
|
|
1000
1000
|
const b = t, e = q(() => b.tone || "default"), l = q(() => {
|
|
1001
|
-
const
|
|
1001
|
+
const h = (b.label || "").trim(), i = b.tone, C = b.progress;
|
|
1002
1002
|
if (C) {
|
|
1003
1003
|
const E = {
|
|
1004
1004
|
incomplete: "未完成",
|
|
1005
1005
|
partiallyComplete: "部分完成",
|
|
1006
1006
|
complete: "已完成"
|
|
1007
1007
|
};
|
|
1008
|
-
return
|
|
1008
|
+
return h ? `${h},进度:${E[C] || C}` : `进度:${E[C] || C}`;
|
|
1009
1009
|
}
|
|
1010
1010
|
if (i && i !== "default") {
|
|
1011
1011
|
const E = {
|
|
@@ -1016,11 +1016,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1016
1016
|
critical: "严重",
|
|
1017
1017
|
default: "默认"
|
|
1018
1018
|
};
|
|
1019
|
-
return
|
|
1019
|
+
return h ? `${h},语气:${E[i] || i}` : `语气:${E[i] || i}`;
|
|
1020
1020
|
}
|
|
1021
|
-
return
|
|
1021
|
+
return h || "标记";
|
|
1022
1022
|
});
|
|
1023
|
-
return (
|
|
1023
|
+
return (h, i) => (a(), u("span", {
|
|
1024
1024
|
class: B(["y-badge", [
|
|
1025
1025
|
`y-badge--${e.value}`,
|
|
1026
1026
|
`y-badge--${t.size}`,
|
|
@@ -1083,7 +1083,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1083
1083
|
])]))
|
|
1084
1084
|
])) : A("", !0),
|
|
1085
1085
|
n("span", ln, [
|
|
1086
|
-
ue(
|
|
1086
|
+
ue(h.$slots, "default", {}, () => [
|
|
1087
1087
|
Ce(G(t.label), 1)
|
|
1088
1088
|
], !0)
|
|
1089
1089
|
])
|
|
@@ -1111,7 +1111,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1111
1111
|
},
|
|
1112
1112
|
emits: ["update:modelValue", "open", "close"],
|
|
1113
1113
|
setup(t, { emit: b }) {
|
|
1114
|
-
const e = t, l = b,
|
|
1114
|
+
const e = t, l = b, h = q({
|
|
1115
1115
|
get: () => e.modelValue,
|
|
1116
1116
|
set: (w) => l("update:modelValue", w)
|
|
1117
1117
|
}), i = R(null), C = q(() => {
|
|
@@ -1122,7 +1122,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1122
1122
|
e.maskClosable && _();
|
|
1123
1123
|
}
|
|
1124
1124
|
function _() {
|
|
1125
|
-
|
|
1125
|
+
h.value && (h.value = !1, l("close"));
|
|
1126
1126
|
}
|
|
1127
1127
|
function M() {
|
|
1128
1128
|
e.closable && _();
|
|
@@ -1132,19 +1132,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1132
1132
|
}
|
|
1133
1133
|
return ne(() => e.modelValue, (w) => {
|
|
1134
1134
|
w ? (l("open"), requestAnimationFrame(() => {
|
|
1135
|
-
var
|
|
1136
|
-
return (
|
|
1135
|
+
var p;
|
|
1136
|
+
return (p = i.value) == null ? void 0 : p.focus();
|
|
1137
1137
|
}), document.addEventListener("keydown", v), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", v), document.body.style.overflow = "");
|
|
1138
1138
|
}), Se(() => {
|
|
1139
1139
|
e.modelValue && (document.addEventListener("keydown", v), document.body.style.overflow = "hidden");
|
|
1140
1140
|
}), Ee(() => {
|
|
1141
1141
|
document.removeEventListener("keydown", v), document.body.style.overflow = "";
|
|
1142
|
-
}), (w,
|
|
1142
|
+
}), (w, p) => (a(), Ie(Re, { to: "body" }, [
|
|
1143
1143
|
Be(n("div", {
|
|
1144
1144
|
class: "y-dialog-root",
|
|
1145
1145
|
role: "dialog",
|
|
1146
1146
|
"aria-modal": !0,
|
|
1147
|
-
"aria-hidden": !
|
|
1147
|
+
"aria-hidden": !h.value,
|
|
1148
1148
|
style: ge({ zIndex: String(t.zIndex) })
|
|
1149
1149
|
}, [
|
|
1150
1150
|
n("div", {
|
|
@@ -1180,13 +1180,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1180
1180
|
ue(w.$slots, "footer", {}, void 0, !0)
|
|
1181
1181
|
])) : A("", !0)
|
|
1182
1182
|
], 46, rn), [
|
|
1183
|
-
[
|
|
1183
|
+
[ze, h.value]
|
|
1184
1184
|
])
|
|
1185
1185
|
]),
|
|
1186
1186
|
_: 3
|
|
1187
1187
|
})
|
|
1188
1188
|
], 12, an), [
|
|
1189
|
-
[
|
|
1189
|
+
[ze, h.value]
|
|
1190
1190
|
])
|
|
1191
1191
|
]));
|
|
1192
1192
|
}
|
|
@@ -1210,44 +1210,44 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1210
1210
|
},
|
|
1211
1211
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1212
1212
|
setup(t, { expose: b, emit: e }) {
|
|
1213
|
-
const l = t,
|
|
1214
|
-
let
|
|
1213
|
+
const l = t, h = e, i = R(), C = R(), E = R(), _ = R(!1), M = R(), v = R(), w = R({});
|
|
1214
|
+
let p = null, K = null;
|
|
1215
1215
|
const V = q(() => {
|
|
1216
1216
|
if (!_.value || !M.value) return {};
|
|
1217
|
-
const
|
|
1218
|
-
l.width !== "auto" && (
|
|
1217
|
+
const F = {};
|
|
1218
|
+
l.width !== "auto" && (F.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.maxWidth && (F.maxWidth = typeof l.maxWidth == "number" ? `${l.maxWidth}px` : l.maxWidth);
|
|
1219
1219
|
const { top: W, left: d } = j();
|
|
1220
|
-
return
|
|
1220
|
+
return F.top = `${W}px`, F.left = `${d}px`, F;
|
|
1221
1221
|
}), U = q(() => {
|
|
1222
1222
|
if (!l.showArrow) return {};
|
|
1223
1223
|
if (Object.keys(w.value).length > 0)
|
|
1224
1224
|
return w.value;
|
|
1225
|
-
const
|
|
1226
|
-
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ?
|
|
1225
|
+
const F = {};
|
|
1226
|
+
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ? F.left = "50%" : F.top = "50%", F;
|
|
1227
1227
|
});
|
|
1228
1228
|
function j() {
|
|
1229
1229
|
var H, Z;
|
|
1230
1230
|
if (!M.value) return { top: 0, left: 0 };
|
|
1231
|
-
const { width:
|
|
1231
|
+
const { width: F, height: W, top: d, left: f } = M.value, g = ((H = E.value) == null ? void 0 : H.offsetWidth) || 200, m = ((Z = E.value) == null ? void 0 : Z.offsetHeight) || 100;
|
|
1232
1232
|
let o = 0, r = 0;
|
|
1233
1233
|
switch (l.placement) {
|
|
1234
1234
|
case "top":
|
|
1235
|
-
o = d - m - l.offset, r = f + (
|
|
1235
|
+
o = d - m - l.offset, r = f + (F - g) / 2;
|
|
1236
1236
|
break;
|
|
1237
1237
|
case "top-start":
|
|
1238
1238
|
o = d - m - l.offset, r = f;
|
|
1239
1239
|
break;
|
|
1240
1240
|
case "top-end":
|
|
1241
|
-
o = d - m - l.offset, r = f +
|
|
1241
|
+
o = d - m - l.offset, r = f + F - g;
|
|
1242
1242
|
break;
|
|
1243
1243
|
case "bottom":
|
|
1244
|
-
o = d + W + l.offset, r = f + (
|
|
1244
|
+
o = d + W + l.offset, r = f + (F - g) / 2;
|
|
1245
1245
|
break;
|
|
1246
1246
|
case "bottom-start":
|
|
1247
1247
|
o = d + W + l.offset, r = f;
|
|
1248
1248
|
break;
|
|
1249
1249
|
case "bottom-end":
|
|
1250
|
-
o = d + W + l.offset, r = f +
|
|
1250
|
+
o = d + W + l.offset, r = f + F - g;
|
|
1251
1251
|
break;
|
|
1252
1252
|
case "left":
|
|
1253
1253
|
o = d + (W - m) / 2, r = f - g - l.offset;
|
|
@@ -1259,47 +1259,47 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1259
1259
|
o = d + W - m, r = f - g - l.offset;
|
|
1260
1260
|
break;
|
|
1261
1261
|
case "right":
|
|
1262
|
-
o = d + (W - m) / 2, r = f +
|
|
1262
|
+
o = d + (W - m) / 2, r = f + F + l.offset;
|
|
1263
1263
|
break;
|
|
1264
1264
|
case "right-start":
|
|
1265
|
-
o = d, r = f +
|
|
1265
|
+
o = d, r = f + F + l.offset;
|
|
1266
1266
|
break;
|
|
1267
1267
|
case "right-end":
|
|
1268
|
-
o = d + W - m, r = f +
|
|
1268
|
+
o = d + W - m, r = f + F + l.offset;
|
|
1269
1269
|
break;
|
|
1270
1270
|
}
|
|
1271
|
-
const
|
|
1272
|
-
return r < 8 && (r = 8), r + g >
|
|
1271
|
+
const y = window.innerWidth, Y = window.innerHeight;
|
|
1272
|
+
return r < 8 && (r = 8), r + g > y - 8 && (r = y - g - 8), o < 8 && (o = 8), o + m > Y - 8 && (o = Y - m - 8), { top: o, left: r };
|
|
1273
1273
|
}
|
|
1274
1274
|
function D() {
|
|
1275
|
-
l.disabled || _.value || (P(), l.openDelay > 0 ?
|
|
1275
|
+
l.disabled || _.value || (P(), l.openDelay > 0 ? p = setTimeout(() => {
|
|
1276
1276
|
T();
|
|
1277
1277
|
}, l.openDelay) : T());
|
|
1278
1278
|
}
|
|
1279
1279
|
function T() {
|
|
1280
|
-
|
|
1280
|
+
h("before-show"), _.value = !0, h("update:modelValue", !0), h("show"), ve(() => {
|
|
1281
1281
|
ve(() => {
|
|
1282
1282
|
ee();
|
|
1283
1283
|
});
|
|
1284
1284
|
});
|
|
1285
1285
|
}
|
|
1286
1286
|
function L() {
|
|
1287
|
-
_.value && (P(), l.closeDelay > 0 ?
|
|
1287
|
+
_.value && (P(), l.closeDelay > 0 ? K = setTimeout(() => {
|
|
1288
1288
|
I();
|
|
1289
1289
|
}, l.closeDelay) : I());
|
|
1290
1290
|
}
|
|
1291
1291
|
function I() {
|
|
1292
|
-
|
|
1292
|
+
h("before-hide"), _.value = !1, h("update:modelValue", !1), h("hide");
|
|
1293
1293
|
}
|
|
1294
1294
|
function P() {
|
|
1295
|
-
|
|
1295
|
+
p && (clearTimeout(p), p = null), K && (clearTimeout(K), K = null);
|
|
1296
1296
|
}
|
|
1297
1297
|
function X() {
|
|
1298
1298
|
if (!l.showArrow || !M.value || !E.value) {
|
|
1299
1299
|
w.value = {};
|
|
1300
1300
|
return;
|
|
1301
1301
|
}
|
|
1302
|
-
const
|
|
1302
|
+
const F = M.value, W = E.value.getBoundingClientRect();
|
|
1303
1303
|
if (W.width === 0 || W.height === 0) {
|
|
1304
1304
|
const f = {};
|
|
1305
1305
|
l.placement.startsWith("top") || l.placement.startsWith("bottom") ? f.left = "50%" : f.top = "50%", w.value = f;
|
|
@@ -1308,19 +1308,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1308
1308
|
const d = {};
|
|
1309
1309
|
if (l.placement.startsWith("top")) {
|
|
1310
1310
|
d.bottom = "-6px";
|
|
1311
|
-
const f =
|
|
1311
|
+
const f = F.left + F.width / 2, g = W.left, m = f - g;
|
|
1312
1312
|
d.left = `${Math.max(12, Math.min(m, W.width - 12))}px`;
|
|
1313
1313
|
} else if (l.placement.startsWith("bottom")) {
|
|
1314
1314
|
d.top = "-6px";
|
|
1315
|
-
const f =
|
|
1315
|
+
const f = F.left + F.width / 2, g = W.left, m = f - g;
|
|
1316
1316
|
d.left = `${Math.max(12, Math.min(m, W.width - 12))}px`;
|
|
1317
1317
|
} else if (l.placement.startsWith("left")) {
|
|
1318
1318
|
d.right = "-6px";
|
|
1319
|
-
const f =
|
|
1319
|
+
const f = F.top + F.height / 2, g = W.top, m = f - g;
|
|
1320
1320
|
d.top = `${Math.max(12, Math.min(m, W.height - 12))}px`;
|
|
1321
1321
|
} else if (l.placement.startsWith("right")) {
|
|
1322
1322
|
d.left = "-6px";
|
|
1323
|
-
const f =
|
|
1323
|
+
const f = F.top + F.height / 2, g = W.top, m = f - g;
|
|
1324
1324
|
d.top = `${Math.max(12, Math.min(m, W.height - 12))}px`;
|
|
1325
1325
|
}
|
|
1326
1326
|
w.value = d;
|
|
@@ -1339,15 +1339,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1339
1339
|
function ce() {
|
|
1340
1340
|
l.disabled || l.trigger !== "hover" || L();
|
|
1341
1341
|
}
|
|
1342
|
-
function de(
|
|
1342
|
+
function de(F) {
|
|
1343
1343
|
if (!l.closeOnClickOutside || !_.value) return;
|
|
1344
|
-
const W =
|
|
1344
|
+
const W = F.target;
|
|
1345
1345
|
i.value && !i.value.contains(W) && E.value && !E.value.contains(W) && L();
|
|
1346
1346
|
}
|
|
1347
|
-
return ne(() => l.modelValue, (
|
|
1348
|
-
|
|
1349
|
-
}), ne(_, (
|
|
1350
|
-
|
|
1347
|
+
return ne(() => l.modelValue, (F) => {
|
|
1348
|
+
F !== _.value && (F ? D() : L());
|
|
1349
|
+
}), ne(_, (F) => {
|
|
1350
|
+
F ? (document.addEventListener("click", de), window.addEventListener("resize", ee), window.addEventListener("scroll", ee, !0)) : (document.removeEventListener("click", de), window.removeEventListener("resize", ee), window.removeEventListener("scroll", ee, !0));
|
|
1351
1351
|
}), Se(() => {
|
|
1352
1352
|
l.modelValue && D();
|
|
1353
1353
|
}), Ee(() => {
|
|
@@ -1356,7 +1356,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1356
1356
|
show: D,
|
|
1357
1357
|
hide: L,
|
|
1358
1358
|
updatePosition: ee
|
|
1359
|
-
}), (
|
|
1359
|
+
}), (F, W) => (a(), u("div", {
|
|
1360
1360
|
class: "ypopover",
|
|
1361
1361
|
ref_key: "popoverRef",
|
|
1362
1362
|
ref: i
|
|
@@ -1368,7 +1368,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1368
1368
|
onMouseenter: le,
|
|
1369
1369
|
onMouseleave: ce
|
|
1370
1370
|
}, [
|
|
1371
|
-
ue(
|
|
1371
|
+
ue(F.$slots, "reference", {}, void 0, !0)
|
|
1372
1372
|
], 544),
|
|
1373
1373
|
(a(), Ie(Re, { to: "body" }, [
|
|
1374
1374
|
fe(ke, { name: "ypopover-fade" }, {
|
|
@@ -1394,7 +1394,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1394
1394
|
style: ge(U.value)
|
|
1395
1395
|
}, null, 6)) : A("", !0),
|
|
1396
1396
|
n("div", pn, [
|
|
1397
|
-
ue(
|
|
1397
|
+
ue(F.$slots, "default", {}, void 0, !0)
|
|
1398
1398
|
])
|
|
1399
1399
|
], 6)) : A("", !0)
|
|
1400
1400
|
]),
|
|
@@ -1412,7 +1412,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1412
1412
|
}, Mn = {
|
|
1413
1413
|
key: 2,
|
|
1414
1414
|
class: "status-text status-complete"
|
|
1415
|
-
}, In = { class: "nh-time-pickers" }, Bn = { class: "nh-time-picker" }, En = { class: "nh-date-picker" }, Tn = { class: "nh-date-picker-header" },
|
|
1415
|
+
}, In = { class: "nh-time-pickers" }, Bn = { class: "nh-time-picker" }, En = { class: "nh-date-picker" }, Tn = { class: "nh-date-picker-header" }, Kn = { class: "nh-date-picker-header-label" }, zn = { class: "nh-date-picker-content" }, Hn = { class: "nh-date-table" }, Rn = ["onClick"], Vn = { class: "nh-date-table-cell" }, An = { key: 0 }, Yn = { class: "nh-time-picker" }, Fn = { class: "nh-date-picker" }, Nn = { class: "nh-date-picker-header" }, Pn = { class: "nh-date-picker-header-label" }, Wn = { class: "nh-date-picker-content" }, jn = { class: "nh-date-table" }, On = ["onClick"], qn = { class: "nh-date-table-cell" }, Un = { key: 0 }, Zn = { class: "nh-time-actions" }, Qn = /* @__PURE__ */ me({
|
|
1416
1416
|
__name: "ytime",
|
|
1417
1417
|
props: {
|
|
1418
1418
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1463,25 +1463,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1463
1463
|
},
|
|
1464
1464
|
emits: ["update:modelValue", "change"],
|
|
1465
1465
|
setup(t, { emit: b }) {
|
|
1466
|
-
const e = t, l = b,
|
|
1466
|
+
const e = t, l = b, h = R(!1), i = R(-1), C = R(-1), E = R(null), _ = R(), M = R(), v = R({
|
|
1467
1467
|
top: !0,
|
|
1468
1468
|
left: !0
|
|
1469
1469
|
}), w = R({
|
|
1470
1470
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1471
1471
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1472
|
-
}),
|
|
1472
|
+
}), p = R({
|
|
1473
1473
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1474
1474
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1475
|
-
}),
|
|
1476
|
-
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(
|
|
1475
|
+
}), K = () => {
|
|
1476
|
+
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(p.value.year, p.value.month).getTime();
|
|
1477
1477
|
if (s >= c) {
|
|
1478
1478
|
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1479
|
-
|
|
1479
|
+
p.value.year = $.getFullYear(), p.value.month = $.getMonth();
|
|
1480
1480
|
}
|
|
1481
1481
|
}, V = () => {
|
|
1482
1482
|
const s = new Date(w.value.year, w.value.month).getTime();
|
|
1483
|
-
if (new Date(
|
|
1484
|
-
const $ = new Date(
|
|
1483
|
+
if (new Date(p.value.year, p.value.month).getTime() <= s) {
|
|
1484
|
+
const $ = new Date(p.value.year, p.value.month - 1);
|
|
1485
1485
|
w.value.year = $.getFullYear(), w.value.month = $.getMonth();
|
|
1486
1486
|
}
|
|
1487
1487
|
}, U = ["一", "二", "三", "四", "五", "六", "日"], j = R(null), D = R(null), T = (s) => {
|
|
@@ -1496,12 +1496,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1496
1496
|
return null;
|
|
1497
1497
|
}, L = (s) => {
|
|
1498
1498
|
if (!s) return null;
|
|
1499
|
-
const c = s.getFullYear(), $ = String(s.getMonth() + 1).padStart(2, "0"),
|
|
1499
|
+
const c = s.getFullYear(), $ = String(s.getMonth() + 1).padStart(2, "0"), N = String(s.getDate()).padStart(2, "0");
|
|
1500
1500
|
if (e.includeTime) {
|
|
1501
1501
|
const oe = String(s.getHours()).padStart(2, "0"), te = String(s.getMinutes()).padStart(2, "0"), ie = String(s.getSeconds()).padStart(2, "0");
|
|
1502
|
-
return `${c}-${$}-${
|
|
1502
|
+
return `${c}-${$}-${N} ${oe}:${te}:${ie}`;
|
|
1503
1503
|
} else
|
|
1504
|
-
return `${c}-${$}-${
|
|
1504
|
+
return `${c}-${$}-${N}`;
|
|
1505
1505
|
}, I = (s) => s ? s.getTime() : null, P = (s) => s ? {
|
|
1506
1506
|
startDate: T(s.startDate),
|
|
1507
1507
|
endDate: T(s.endDate)
|
|
@@ -1516,8 +1516,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1516
1516
|
if (!(c != null && c.startDate) || !(c != null && c.endDate))
|
|
1517
1517
|
return -1;
|
|
1518
1518
|
for (let $ = 0; $ < e.shortcuts.length; $++) {
|
|
1519
|
-
const
|
|
1520
|
-
if (
|
|
1519
|
+
const N = e.shortcuts[$].getValue();
|
|
1520
|
+
if (N.startDate && N.endDate && c.startDate && c.endDate) {
|
|
1521
1521
|
const oe = new Date(
|
|
1522
1522
|
c.startDate.getFullYear(),
|
|
1523
1523
|
c.startDate.getMonth(),
|
|
@@ -1527,13 +1527,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1527
1527
|
c.endDate.getMonth(),
|
|
1528
1528
|
c.endDate.getDate()
|
|
1529
1529
|
), ie = new Date(
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1530
|
+
N.startDate.getFullYear(),
|
|
1531
|
+
N.startDate.getMonth(),
|
|
1532
|
+
N.startDate.getDate()
|
|
1533
1533
|
), xe = new Date(
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1534
|
+
N.endDate.getFullYear(),
|
|
1535
|
+
N.endDate.getMonth(),
|
|
1536
|
+
N.endDate.getDate()
|
|
1537
1537
|
);
|
|
1538
1538
|
if (oe.getTime() === ie.getTime() && te.getTime() === xe.getTime())
|
|
1539
1539
|
return $;
|
|
@@ -1541,7 +1541,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1541
1541
|
}
|
|
1542
1542
|
return -1;
|
|
1543
1543
|
}, de = (s, c) => {
|
|
1544
|
-
const $ = new Date(s, c, 1),
|
|
1544
|
+
const $ = new Date(s, c, 1), N = new Date(s, c + 1, 0), oe = $.getDay(), te = N.getDate(), ie = [], xe = /* @__PURE__ */ new Date(), Pe = oe === 0 ? 6 : oe - 1, Ge = new Date(s, c, 0);
|
|
1545
1545
|
for (let ye = Pe - 1; ye >= 0; ye--) {
|
|
1546
1546
|
const Le = new Date(s, c - 1, Ge.getDate() - ye);
|
|
1547
1547
|
ie.push({
|
|
@@ -1585,7 +1585,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1585
1585
|
for (let ye = 0; ye < ie.length; ye += 7)
|
|
1586
1586
|
Oe.push(ie.slice(ye, ye + 7));
|
|
1587
1587
|
return Oe;
|
|
1588
|
-
},
|
|
1588
|
+
}, F = (s) => {
|
|
1589
1589
|
const c = X(s);
|
|
1590
1590
|
l("update:modelValue", c), l("change", c);
|
|
1591
1591
|
}, W = () => {
|
|
@@ -1595,35 +1595,35 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1595
1595
|
const xe = $ - s.left, Pe = c.width || 640;
|
|
1596
1596
|
xe < Pe ? v.value.left = !1 : v.value.left = !0;
|
|
1597
1597
|
}, d = () => {
|
|
1598
|
-
if (
|
|
1598
|
+
if (h.value = !h.value, h.value) {
|
|
1599
1599
|
const s = P(e.modelValue);
|
|
1600
1600
|
if (j.value = (s == null ? void 0 : s.startDate) || null, D.value = (s == null ? void 0 : s.endDate) || null, C.value = ce(e.modelValue), i.value = -1, s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1601
|
-
|
|
1601
|
+
p.value.year = s.endDate.getFullYear(), p.value.month = s.endDate.getMonth();
|
|
1602
1602
|
else {
|
|
1603
1603
|
const c = new Date(w.value.year, w.value.month + 1);
|
|
1604
|
-
|
|
1604
|
+
p.value.year = c.getFullYear(), p.value.month = c.getMonth();
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1606
|
+
K(), ve(() => {
|
|
1607
1607
|
W();
|
|
1608
1608
|
});
|
|
1609
1609
|
}
|
|
1610
1610
|
}, f = (s) => {
|
|
1611
|
-
const c = s.target, $ = _.value,
|
|
1612
|
-
$ &&
|
|
1611
|
+
const c = s.target, $ = _.value, N = M.value;
|
|
1612
|
+
$ && N && !$.contains(c) && !N.contains(c) && (h.value = !1, i.value = -1);
|
|
1613
1613
|
}, g = (s) => {
|
|
1614
|
-
s.key === "Enter" || s.key === " " ? (s.preventDefault(), d()) : s.key === "ArrowDown" && (s.preventDefault(),
|
|
1615
|
-
W(),
|
|
1614
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), d()) : s.key === "ArrowDown" && (s.preventDefault(), h.value = !0, ve(() => {
|
|
1615
|
+
W(), Y();
|
|
1616
1616
|
}));
|
|
1617
1617
|
}, m = (s) => {
|
|
1618
1618
|
var c;
|
|
1619
|
-
s.key === "Escape" && (
|
|
1619
|
+
s.key === "Escape" && (h.value = !1, i.value = -1, (c = _.value) == null || c.focus());
|
|
1620
1620
|
}, o = (s, c) => {
|
|
1621
1621
|
s.key === "ArrowDown" ? (s.preventDefault(), i.value = Math.min(c + 1, e.shortcuts.length - 1), H(i.value)) : s.key === "ArrowUp" ? (s.preventDefault(), i.value = Math.max(c - 1, 0), H(i.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), Z(e.shortcuts[c]));
|
|
1622
1622
|
}, r = (s) => {
|
|
1623
1623
|
i.value = s;
|
|
1624
|
-
},
|
|
1624
|
+
}, y = () => {
|
|
1625
1625
|
i.value = -1;
|
|
1626
|
-
},
|
|
1626
|
+
}, Y = () => {
|
|
1627
1627
|
i.value = 0, H(0);
|
|
1628
1628
|
}, H = (s) => {
|
|
1629
1629
|
if (M.value) {
|
|
@@ -1632,7 +1632,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1632
1632
|
}
|
|
1633
1633
|
}, Z = (s) => {
|
|
1634
1634
|
const c = s.getValue();
|
|
1635
|
-
e.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)),
|
|
1635
|
+
e.includeTime && c.startDate && c.endDate && (c.startDate.setHours(0, 0, 0, 0), c.endDate.setHours(23, 59, 59, 999)), F(c), C.value = e.shortcuts.findIndex(($) => $.label === s.label), i.value = -1, h.value = !1;
|
|
1636
1636
|
}, De = (s, c) => {
|
|
1637
1637
|
if (!s || s.isDisabled) return;
|
|
1638
1638
|
let $;
|
|
@@ -1642,16 +1642,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1642
1642
|
if ($ >= j.value)
|
|
1643
1643
|
e.includeTime && $.setHours(23, 59, 59, 999), D.value = $;
|
|
1644
1644
|
else {
|
|
1645
|
-
const
|
|
1646
|
-
e.includeTime &&
|
|
1645
|
+
const N = j.value;
|
|
1646
|
+
e.includeTime && N.setHours(23, 59, 59, 999), D.value = N, j.value = $;
|
|
1647
1647
|
}
|
|
1648
1648
|
else
|
|
1649
1649
|
j.value = $, D.value = null;
|
|
1650
1650
|
if (C.value = -1, j.value && D.value) {
|
|
1651
|
-
const
|
|
1652
|
-
e.includeTime &&
|
|
1651
|
+
const N = new Date(D.value);
|
|
1652
|
+
e.includeTime && N.setHours(23, 59, 59, 999), E.value = {
|
|
1653
1653
|
startDate: j.value,
|
|
1654
|
-
endDate:
|
|
1654
|
+
endDate: N
|
|
1655
1655
|
};
|
|
1656
1656
|
} else
|
|
1657
1657
|
E.value = null;
|
|
@@ -1660,29 +1660,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1660
1660
|
const $ = ["nh-date-table-td"];
|
|
1661
1661
|
return s.isCurrentMonth || $.push("is-prev-month"), s.isToday && $.push("is-today"), s.isDisabled && $.push("is-disabled"), j.value && se(s.date, j.value) && $.push("is-selected", "is-start"), D.value && se(s.date, D.value) && $.push("is-selected", "is-end"), j.value && D.value && le(s.date, j.value, D.value) && $.push("is-in-range"), $;
|
|
1662
1662
|
}, Ve = () => {
|
|
1663
|
-
E.value && (e.includeTime && E.value.endDate && E.value.endDate.setHours(23, 59, 59, 999),
|
|
1663
|
+
E.value && (e.includeTime && E.value.endDate && E.value.endDate.setHours(23, 59, 59, 999), F(E.value), C.value = ce(E.value), h.value = !1);
|
|
1664
1664
|
}, He = () => {
|
|
1665
|
-
|
|
1665
|
+
F({ startDate: null, endDate: null }), O(), i.value = -1, h.value = !1;
|
|
1666
1666
|
}, Te = () => {
|
|
1667
|
-
|
|
1667
|
+
h.value && ve(() => {
|
|
1668
1668
|
W();
|
|
1669
1669
|
});
|
|
1670
|
-
}, _e = q(() => de(w.value.year, w.value.month)),
|
|
1670
|
+
}, _e = q(() => de(w.value.year, w.value.month)), Ke = q(() => de(p.value.year, p.value.month)), k = q(() => {
|
|
1671
1671
|
const s = P(e.modelValue);
|
|
1672
1672
|
if (!s || !s.startDate || !s.endDate)
|
|
1673
1673
|
return "";
|
|
1674
1674
|
const c = (oe) => {
|
|
1675
1675
|
const te = String(oe.getFullYear()), ie = String(oe.getMonth() + 1).padStart(2, "0"), xe = String(oe.getDate()).padStart(2, "0");
|
|
1676
1676
|
return `${te}/${ie}/${xe}`;
|
|
1677
|
-
}, $ = c(s.startDate),
|
|
1678
|
-
return !e.includeTime && $ ===
|
|
1677
|
+
}, $ = c(s.startDate), N = c(s.endDate);
|
|
1678
|
+
return !e.includeTime && $ === N ? $ : `${$} - ${N}`;
|
|
1679
1679
|
}), S = q(() => [
|
|
1680
1680
|
"nh-time-dropdown",
|
|
1681
1681
|
{
|
|
1682
1682
|
"nh-time-dropdown-top": !v.value.top,
|
|
1683
1683
|
"nh-time-dropdown-right": !v.value.left
|
|
1684
1684
|
}
|
|
1685
|
-
]),
|
|
1685
|
+
]), z = q(() => {
|
|
1686
1686
|
const s = P(e.modelValue);
|
|
1687
1687
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1688
1688
|
}), x = q(() => !!(j.value && D.value)), O = () => {
|
|
@@ -1696,44 +1696,44 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1696
1696
|
}
|
|
1697
1697
|
if (c != null && c.endDate) {
|
|
1698
1698
|
const $ = c.endDate;
|
|
1699
|
-
|
|
1699
|
+
p.value.year = $.getFullYear(), p.value.month = $.getMonth();
|
|
1700
1700
|
} else if (c != null && c.startDate) {
|
|
1701
1701
|
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1702
|
-
|
|
1702
|
+
p.value.year = $.getFullYear(), p.value.month = $.getMonth();
|
|
1703
1703
|
}
|
|
1704
|
-
(c != null && c.startDate || c != null && c.endDate) &&
|
|
1705
|
-
}, { immediate: !0, deep: !0 }), ne([w,
|
|
1706
|
-
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(
|
|
1704
|
+
(c != null && c.startDate || c != null && c.endDate) && K(), h.value || (C.value = ce(s));
|
|
1705
|
+
}, { immediate: !0, deep: !0 }), ne([w, p], () => {
|
|
1706
|
+
const s = new Date(w.value.year, w.value.month).getTime(), c = new Date(p.value.year, p.value.month).getTime();
|
|
1707
1707
|
if (s === c) {
|
|
1708
1708
|
const $ = new Date(w.value.year, w.value.month + 1);
|
|
1709
|
-
|
|
1709
|
+
p.value.year = $.getFullYear(), p.value.month = $.getMonth();
|
|
1710
1710
|
}
|
|
1711
1711
|
}, { deep: !0 }), Se(() => {
|
|
1712
1712
|
document.addEventListener("click", f), window.addEventListener("resize", Te), window.addEventListener("scroll", Te), C.value = ce(e.modelValue);
|
|
1713
1713
|
const s = P(e.modelValue);
|
|
1714
1714
|
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1715
|
-
|
|
1715
|
+
p.value.year = s.endDate.getFullYear(), p.value.month = s.endDate.getMonth();
|
|
1716
1716
|
else {
|
|
1717
1717
|
const c = new Date(w.value.year, w.value.month + 1);
|
|
1718
|
-
|
|
1718
|
+
p.value.year = c.getFullYear(), p.value.month = c.getMonth();
|
|
1719
1719
|
}
|
|
1720
|
-
|
|
1720
|
+
K();
|
|
1721
1721
|
}), Ee(() => {
|
|
1722
1722
|
document.removeEventListener("click", f), window.removeEventListener("resize", Te), window.removeEventListener("scroll", Te);
|
|
1723
1723
|
});
|
|
1724
1724
|
const Q = () => {
|
|
1725
|
-
e.clearable && (
|
|
1725
|
+
e.clearable && (F({ startDate: null, endDate: null }), O(), i.value = -1);
|
|
1726
1726
|
}, ae = (s, c) => {
|
|
1727
1727
|
if (s === "start") {
|
|
1728
1728
|
const $ = new Date(w.value.year, w.value.month + c, 1);
|
|
1729
|
-
w.value.year = $.getFullYear(), w.value.month = $.getMonth(),
|
|
1729
|
+
w.value.year = $.getFullYear(), w.value.month = $.getMonth(), K();
|
|
1730
1730
|
} else {
|
|
1731
|
-
const $ = new Date(
|
|
1732
|
-
|
|
1731
|
+
const $ = new Date(p.value.year, p.value.month + c, 1);
|
|
1732
|
+
p.value.year = $.getFullYear(), p.value.month = $.getMonth(), V();
|
|
1733
1733
|
}
|
|
1734
1734
|
};
|
|
1735
1735
|
return (s, c) => {
|
|
1736
|
-
const $ =
|
|
1736
|
+
const $ = Ye("YButton");
|
|
1737
1737
|
return a(), u("div", {
|
|
1738
1738
|
class: B(["nh-time-search", [`nh-time--${t.size}`]])
|
|
1739
1739
|
}, [
|
|
@@ -1743,7 +1743,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1743
1743
|
ref: _,
|
|
1744
1744
|
onClick: d,
|
|
1745
1745
|
onKeydown: g,
|
|
1746
|
-
class: B(["nh-time-trigger", { "is-focus":
|
|
1746
|
+
class: B(["nh-time-trigger", { "is-focus": h.value, "has-value": z.value }]),
|
|
1747
1747
|
tabindex: "0"
|
|
1748
1748
|
}, [
|
|
1749
1749
|
n("input", {
|
|
@@ -1753,7 +1753,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1753
1753
|
class: "nh-time-input"
|
|
1754
1754
|
}, null, 8, wn),
|
|
1755
1755
|
n("span", bn, [
|
|
1756
|
-
t.clearable &&
|
|
1756
|
+
t.clearable && z.value ? (a(), u("i", {
|
|
1757
1757
|
key: 0,
|
|
1758
1758
|
onClick: J(Q, ["stop"]),
|
|
1759
1759
|
class: "nh-time-clear"
|
|
@@ -1782,7 +1782,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1782
1782
|
])
|
|
1783
1783
|
], -1)),
|
|
1784
1784
|
n("i", {
|
|
1785
|
-
class: B(["nh-time-arrow", { "is-reverse":
|
|
1785
|
+
class: B(["nh-time-arrow", { "is-reverse": h.value }])
|
|
1786
1786
|
}, [...c[5] || (c[5] = [
|
|
1787
1787
|
n("svg", {
|
|
1788
1788
|
viewBox: "0 0 1024 1024",
|
|
@@ -1799,7 +1799,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1799
1799
|
], 34),
|
|
1800
1800
|
fe(ke, { name: "el-zoom-in-top" }, {
|
|
1801
1801
|
default: pe(() => [
|
|
1802
|
-
|
|
1802
|
+
h.value ? (a(), u("div", {
|
|
1803
1803
|
key: 0,
|
|
1804
1804
|
ref_key: "dropdown",
|
|
1805
1805
|
ref: M,
|
|
@@ -1809,12 +1809,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1809
1809
|
n("div", kn, [
|
|
1810
1810
|
c[7] || (c[7] = n("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1811
1811
|
n("ul", xn, [
|
|
1812
|
-
(a(!0), u(re, null, he(t.shortcuts, (
|
|
1813
|
-
key:
|
|
1814
|
-
onClick: (te) => Z(
|
|
1812
|
+
(a(!0), u(re, null, he(t.shortcuts, (N, oe) => (a(), u("li", {
|
|
1813
|
+
key: N.label,
|
|
1814
|
+
onClick: (te) => Z(N),
|
|
1815
1815
|
onKeydown: (te) => o(te, oe),
|
|
1816
1816
|
onMouseenter: (te) => r(oe),
|
|
1817
|
-
onMouseleave:
|
|
1817
|
+
onMouseleave: y,
|
|
1818
1818
|
class: B([
|
|
1819
1819
|
"nh-time-shortcut",
|
|
1820
1820
|
{
|
|
@@ -1823,7 +1823,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1823
1823
|
}
|
|
1824
1824
|
]),
|
|
1825
1825
|
tabindex: "0"
|
|
1826
|
-
}, G(
|
|
1826
|
+
}, G(N.label), 43, Cn))), 128))
|
|
1827
1827
|
])
|
|
1828
1828
|
]),
|
|
1829
1829
|
n("div", Dn, [
|
|
@@ -1838,7 +1838,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1838
1838
|
n("div", En, [
|
|
1839
1839
|
n("div", Tn, [
|
|
1840
1840
|
n("button", {
|
|
1841
|
-
onClick: c[0] || (c[0] = (
|
|
1841
|
+
onClick: c[0] || (c[0] = (N) => ae("start", -1)),
|
|
1842
1842
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1843
1843
|
type: "button"
|
|
1844
1844
|
}, [...c[9] || (c[9] = [
|
|
@@ -1853,9 +1853,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1853
1853
|
})
|
|
1854
1854
|
], -1)
|
|
1855
1855
|
])]),
|
|
1856
|
-
n("span",
|
|
1856
|
+
n("span", Kn, G(ee(w.value.year, w.value.month)), 1),
|
|
1857
1857
|
n("button", {
|
|
1858
|
-
onClick: c[1] || (c[1] = (
|
|
1858
|
+
onClick: c[1] || (c[1] = (N) => ae("start", 1)),
|
|
1859
1859
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1860
1860
|
type: "button"
|
|
1861
1861
|
}, [...c[10] || (c[10] = [
|
|
@@ -1871,21 +1871,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1871
1871
|
], -1)
|
|
1872
1872
|
])])
|
|
1873
1873
|
]),
|
|
1874
|
-
n("div",
|
|
1874
|
+
n("div", zn, [
|
|
1875
1875
|
n("table", Hn, [
|
|
1876
1876
|
n("thead", null, [
|
|
1877
1877
|
n("tr", null, [
|
|
1878
|
-
(a(), u(re, null, he(U, (
|
|
1879
|
-
key:
|
|
1878
|
+
(a(), u(re, null, he(U, (N) => n("th", {
|
|
1879
|
+
key: N,
|
|
1880
1880
|
class: "nh-date-table-th"
|
|
1881
|
-
}, G(
|
|
1881
|
+
}, G(N), 1)), 64))
|
|
1882
1882
|
])
|
|
1883
1883
|
]),
|
|
1884
1884
|
n("tbody", null, [
|
|
1885
|
-
(a(!0), u(re, null, he(_e.value, (
|
|
1885
|
+
(a(!0), u(re, null, he(_e.value, (N, oe) => (a(), u("tr", {
|
|
1886
1886
|
key: `start-week-${oe}`
|
|
1887
1887
|
}, [
|
|
1888
|
-
(a(!0), u(re, null, he(
|
|
1888
|
+
(a(!0), u(re, null, he(N, (te, ie) => (a(), u("td", {
|
|
1889
1889
|
key: `start-day-${oe}-${ie}`,
|
|
1890
1890
|
class: B($e(te)),
|
|
1891
1891
|
onClick: (xe) => De(te, "start")
|
|
@@ -1900,11 +1900,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1900
1900
|
])
|
|
1901
1901
|
])
|
|
1902
1902
|
]),
|
|
1903
|
-
n("div",
|
|
1904
|
-
n("div",
|
|
1905
|
-
n("div",
|
|
1903
|
+
n("div", Yn, [
|
|
1904
|
+
n("div", Fn, [
|
|
1905
|
+
n("div", Nn, [
|
|
1906
1906
|
n("button", {
|
|
1907
|
-
onClick: c[2] || (c[2] = (
|
|
1907
|
+
onClick: c[2] || (c[2] = (N) => ae("end", -1)),
|
|
1908
1908
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
1909
1909
|
type: "button"
|
|
1910
1910
|
}, [...c[11] || (c[11] = [
|
|
@@ -1919,9 +1919,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1919
1919
|
})
|
|
1920
1920
|
], -1)
|
|
1921
1921
|
])]),
|
|
1922
|
-
n("span", Pn, G(ee(
|
|
1922
|
+
n("span", Pn, G(ee(p.value.year, p.value.month)), 1),
|
|
1923
1923
|
n("button", {
|
|
1924
|
-
onClick: c[3] || (c[3] = (
|
|
1924
|
+
onClick: c[3] || (c[3] = (N) => ae("end", 1)),
|
|
1925
1925
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
1926
1926
|
type: "button"
|
|
1927
1927
|
}, [...c[12] || (c[12] = [
|
|
@@ -1941,17 +1941,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1941
1941
|
n("table", jn, [
|
|
1942
1942
|
n("thead", null, [
|
|
1943
1943
|
n("tr", null, [
|
|
1944
|
-
(a(), u(re, null, he(U, (
|
|
1945
|
-
key:
|
|
1944
|
+
(a(), u(re, null, he(U, (N) => n("th", {
|
|
1945
|
+
key: N,
|
|
1946
1946
|
class: "nh-date-table-th"
|
|
1947
|
-
}, G(
|
|
1947
|
+
}, G(N), 1)), 64))
|
|
1948
1948
|
])
|
|
1949
1949
|
]),
|
|
1950
1950
|
n("tbody", null, [
|
|
1951
|
-
(a(!0), u(re, null, he(
|
|
1951
|
+
(a(!0), u(re, null, he(Ke.value, (N, oe) => (a(), u("tr", {
|
|
1952
1952
|
key: `end-week-${oe}`
|
|
1953
1953
|
}, [
|
|
1954
|
-
(a(!0), u(re, null, he(
|
|
1954
|
+
(a(!0), u(re, null, he(N, (te, ie) => (a(), u("td", {
|
|
1955
1955
|
key: `end-day-${oe}-${ie}`,
|
|
1956
1956
|
class: B($e(te)),
|
|
1957
1957
|
onClick: (xe) => De(te, "end")
|
|
@@ -2021,7 +2021,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2021
2021
|
},
|
|
2022
2022
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2023
2023
|
setup(t, { emit: b }) {
|
|
2024
|
-
const e = t, l = b,
|
|
2024
|
+
const e = t, l = b, h = R(), i = q(() => e.modelValue === e.trueValue), C = q(() => {
|
|
2025
2025
|
const _ = {};
|
|
2026
2026
|
return _.background = i.value ? e.activeColor : e.inactiveColor, _;
|
|
2027
2027
|
});
|
|
@@ -2031,11 +2031,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2031
2031
|
l("update:modelValue", _), l("change", _);
|
|
2032
2032
|
}
|
|
2033
2033
|
return Se(() => {
|
|
2034
|
-
const _ =
|
|
2034
|
+
const _ = h.value;
|
|
2035
2035
|
_ && (_.addEventListener("focus", (M) => l("focus", M)), _.addEventListener("blur", (M) => l("blur", M)));
|
|
2036
2036
|
}), (_, M) => (a(), u("button", {
|
|
2037
2037
|
ref_key: "rootEl",
|
|
2038
|
-
ref:
|
|
2038
|
+
ref: h,
|
|
2039
2039
|
class: B(["yswitch", [
|
|
2040
2040
|
`yswitch--${t.size}`,
|
|
2041
2041
|
{ "yswitch--checked": i.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
@@ -2077,7 +2077,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2077
2077
|
},
|
|
2078
2078
|
emits: ["load", "error", "preview"],
|
|
2079
2079
|
setup(t, { expose: b, emit: e }) {
|
|
2080
|
-
const l = t,
|
|
2080
|
+
const l = t, h = e, i = R(), C = R(), E = R(), _ = R(!1), M = R(!1), v = R(!1), w = R(!1), p = R(!1), K = R("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), V = R(""), U = R(1), j = R(!1), D = R({
|
|
2081
2081
|
overflow: "",
|
|
2082
2082
|
paddingRight: ""
|
|
2083
2083
|
}), T = q(() => [
|
|
@@ -2117,7 +2117,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2117
2117
|
document.body.style.paddingRight = `${Z}px`;
|
|
2118
2118
|
}
|
|
2119
2119
|
document.body.style.overflow = "hidden";
|
|
2120
|
-
},
|
|
2120
|
+
}, F = () => {
|
|
2121
2121
|
document.body.style.overflow = D.value.overflow, document.body.style.paddingRight = D.value.paddingRight;
|
|
2122
2122
|
};
|
|
2123
2123
|
let W = null;
|
|
@@ -2125,7 +2125,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2125
2125
|
!l.lazy || !i.value || (W = new IntersectionObserver(
|
|
2126
2126
|
(H) => {
|
|
2127
2127
|
H.forEach((Z) => {
|
|
2128
|
-
Z.isIntersecting && (w.value = !0,
|
|
2128
|
+
Z.isIntersecting && (w.value = !0, K.value = l.src, W == null || W.unobserve(Z.target));
|
|
2129
2129
|
});
|
|
2130
2130
|
},
|
|
2131
2131
|
{
|
|
@@ -2133,9 +2133,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2133
2133
|
}
|
|
2134
2134
|
), W.observe(i.value));
|
|
2135
2135
|
}, f = (H) => {
|
|
2136
|
-
_.value = !0, M.value = !1, v.value = !1,
|
|
2136
|
+
_.value = !0, M.value = !1, v.value = !1, h("load", H);
|
|
2137
2137
|
}, g = (H) => {
|
|
2138
|
-
v.value = !0, M.value = !1, _.value = !1,
|
|
2138
|
+
v.value = !0, M.value = !1, _.value = !1, h("error", H);
|
|
2139
2139
|
}, m = () => {
|
|
2140
2140
|
v.value = !1, M.value = !0, _.value = !1, ve(() => {
|
|
2141
2141
|
C.value && (C.value.src = l.src);
|
|
@@ -2146,16 +2146,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2146
2146
|
const H = new Image();
|
|
2147
2147
|
H.onload = () => {
|
|
2148
2148
|
V.value = l.src, ve(() => {
|
|
2149
|
-
|
|
2149
|
+
p.value = !0, de(), h("preview", l.src);
|
|
2150
2150
|
});
|
|
2151
2151
|
}, H.onerror = () => {
|
|
2152
|
-
V.value = l.src,
|
|
2152
|
+
V.value = l.src, p.value = !0, de(), h("preview", l.src);
|
|
2153
2153
|
}, H.src = l.src;
|
|
2154
2154
|
}, r = () => {
|
|
2155
|
-
|
|
2156
|
-
|
|
2155
|
+
p.value = !1, setTimeout(() => {
|
|
2156
|
+
F();
|
|
2157
2157
|
}, 300);
|
|
2158
|
-
},
|
|
2158
|
+
}, y = (H) => {
|
|
2159
2159
|
const Z = H.deltaY < 0 ? 1 : -1;
|
|
2160
2160
|
let $e = U.value + Z * 0.1;
|
|
2161
2161
|
$e = Math.max(0.5, Math.min(2, $e)), U.value = $e;
|
|
@@ -2163,11 +2163,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2163
2163
|
return Se(() => {
|
|
2164
2164
|
l.lazy ? d() : w.value = !0, w.value && (M.value = !0), j.value = !0;
|
|
2165
2165
|
}), Ee(() => {
|
|
2166
|
-
W && W.disconnect(),
|
|
2167
|
-
}), ne(() =>
|
|
2166
|
+
W && W.disconnect(), p.value && F();
|
|
2167
|
+
}), ne(() => K.value, () => {
|
|
2168
2168
|
l.src && w.value && (M.value = !0, v.value = !1, _.value = !1);
|
|
2169
2169
|
}), ne(() => l.src, (H) => {
|
|
2170
|
-
|
|
2170
|
+
K.value = H || "";
|
|
2171
2171
|
}), b({
|
|
2172
2172
|
retryLoad: m,
|
|
2173
2173
|
closePreview: r
|
|
@@ -2218,7 +2218,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2218
2218
|
Be(n("img", {
|
|
2219
2219
|
ref_key: "imageRef",
|
|
2220
2220
|
ref: C,
|
|
2221
|
-
src:
|
|
2221
|
+
src: K.value,
|
|
2222
2222
|
alt: t.alt,
|
|
2223
2223
|
class: B(I.value),
|
|
2224
2224
|
onLoad: f,
|
|
@@ -2226,7 +2226,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2226
2226
|
onClick: o,
|
|
2227
2227
|
style: ge(X.value)
|
|
2228
2228
|
}, null, 46, nl), [
|
|
2229
|
-
[
|
|
2229
|
+
[ze, _.value && !v.value]
|
|
2230
2230
|
]),
|
|
2231
2231
|
j.value ? (a(), Ie(Re, {
|
|
2232
2232
|
key: 3,
|
|
@@ -2234,15 +2234,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2234
2234
|
}, [
|
|
2235
2235
|
fe(ke, { name: "fade" }, {
|
|
2236
2236
|
default: pe(() => [
|
|
2237
|
-
|
|
2237
|
+
p.value ? (a(), u("div", {
|
|
2238
2238
|
key: 0,
|
|
2239
2239
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2240
2240
|
style: { "z-index": "99999" },
|
|
2241
2241
|
onClick: J(r, ["self"]),
|
|
2242
|
-
onWheel: J(
|
|
2242
|
+
onWheel: J(y, ["prevent"])
|
|
2243
2243
|
}, [
|
|
2244
2244
|
n("div", {
|
|
2245
|
-
class: B(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100":
|
|
2245
|
+
class: B(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": p.value, "scale-95": !p.value }])
|
|
2246
2246
|
}, [
|
|
2247
2247
|
n("img", {
|
|
2248
2248
|
ref_key: "previewImageRef",
|
|
@@ -2271,37 +2271,37 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2271
2271
|
},
|
|
2272
2272
|
setup(t) {
|
|
2273
2273
|
const b = t, e = R(!1), l = R();
|
|
2274
|
-
let
|
|
2274
|
+
let h = null;
|
|
2275
2275
|
const i = q(() => `y-dropdown__menu--${b.placement}`), C = () => {
|
|
2276
|
-
console.log("显示下拉菜单", e.value), !b.disabled && (
|
|
2276
|
+
console.log("显示下拉菜单", e.value), !b.disabled && (h && (clearTimeout(h), h = null), e.value = !0, console.log("设置 visible 为 true", e.value), ve(() => {
|
|
2277
2277
|
_();
|
|
2278
2278
|
}));
|
|
2279
2279
|
}, E = () => {
|
|
2280
|
-
console.log("隐藏下拉菜单"),
|
|
2280
|
+
console.log("隐藏下拉菜单"), h = setTimeout(() => {
|
|
2281
2281
|
e.value = !1, console.log("设置 visible 为 false", e.value);
|
|
2282
2282
|
}, 150);
|
|
2283
2283
|
}, _ = () => {
|
|
2284
2284
|
if (!l.value) return;
|
|
2285
|
-
const w = l.value.querySelector(".y-dropdown__trigger"),
|
|
2286
|
-
if (!w || !
|
|
2287
|
-
const
|
|
2288
|
-
|
|
2285
|
+
const w = l.value.querySelector(".y-dropdown__trigger"), p = l.value.querySelector(".y-dropdown__menu");
|
|
2286
|
+
if (!w || !p) return;
|
|
2287
|
+
const K = w.getBoundingClientRect(), V = p.getBoundingClientRect(), U = window.innerWidth, j = window.innerHeight;
|
|
2288
|
+
p.style.top = "", p.style.left = "", p.style.right = "", p.style.bottom = "", p.style.transform = "";
|
|
2289
2289
|
let D = 0, T = 0;
|
|
2290
2290
|
switch (b.placement) {
|
|
2291
2291
|
case "bottom":
|
|
2292
|
-
D =
|
|
2292
|
+
D = K.height + 4, T = 0;
|
|
2293
2293
|
break;
|
|
2294
2294
|
case "top":
|
|
2295
2295
|
D = -(V.height + 4), T = 0;
|
|
2296
2296
|
break;
|
|
2297
2297
|
case "right":
|
|
2298
|
-
D = 0, T =
|
|
2298
|
+
D = 0, T = K.width + 4;
|
|
2299
2299
|
break;
|
|
2300
2300
|
case "left":
|
|
2301
2301
|
D = 0, T = -(V.width + 4);
|
|
2302
2302
|
break;
|
|
2303
2303
|
}
|
|
2304
|
-
let L =
|
|
2304
|
+
let L = K.top + D, I = K.left + T;
|
|
2305
2305
|
if (b.placement === "bottom" || b.placement === "top") {
|
|
2306
2306
|
const P = V.width || 260;
|
|
2307
2307
|
I + P > U - 10 && (I = U - P - 10), I < 10 && (I = 10);
|
|
@@ -2310,7 +2310,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2310
2310
|
const P = V.height || 200;
|
|
2311
2311
|
L + P > j - 10 && (L = j - P - 10), L < 10 && (L = 10);
|
|
2312
2312
|
}
|
|
2313
|
-
|
|
2313
|
+
p.style.top = `${L}px`, p.style.left = `${I}px`;
|
|
2314
2314
|
}, M = (w) => {
|
|
2315
2315
|
b.trigger === "click" && l.value && !l.value.contains(w.target) && (e.value = !1);
|
|
2316
2316
|
}, v = () => {
|
|
@@ -2319,8 +2319,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2319
2319
|
return Se(() => {
|
|
2320
2320
|
b.trigger === "click" && document.addEventListener("click", M), window.addEventListener("resize", v), window.addEventListener("scroll", v);
|
|
2321
2321
|
}), Ee(() => {
|
|
2322
|
-
b.trigger === "click" && document.removeEventListener("click", M),
|
|
2323
|
-
}), (w,
|
|
2322
|
+
b.trigger === "click" && document.removeEventListener("click", M), h && clearTimeout(h), window.removeEventListener("resize", v), window.removeEventListener("scroll", v);
|
|
2323
|
+
}), (w, p) => (a(), u("div", {
|
|
2324
2324
|
class: "y-dropdown",
|
|
2325
2325
|
ref_key: "dropdownRef",
|
|
2326
2326
|
ref: l
|
|
@@ -2331,7 +2331,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2331
2331
|
onMouseleave: E
|
|
2332
2332
|
}, [
|
|
2333
2333
|
ue(w.$slots, "trigger", {}, () => [
|
|
2334
|
-
|
|
2334
|
+
p[0] || (p[0] = n("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2335
2335
|
], !0)
|
|
2336
2336
|
], 32),
|
|
2337
2337
|
fe(ke, {
|
|
@@ -2345,12 +2345,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2345
2345
|
onMouseleave: E
|
|
2346
2346
|
}, [
|
|
2347
2347
|
ue(w.$slots, "default", {}, () => [
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2348
|
+
p[1] || (p[1] = n("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2349
|
+
p[2] || (p[2] = n("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2350
|
+
p[3] || (p[3] = n("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2351
2351
|
], !0)
|
|
2352
2352
|
], 34), [
|
|
2353
|
-
[
|
|
2353
|
+
[ze, e.value]
|
|
2354
2354
|
])
|
|
2355
2355
|
]),
|
|
2356
2356
|
_: 3
|
|
@@ -2378,40 +2378,40 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2378
2378
|
},
|
|
2379
2379
|
emits: ["update:modelValue", "open", "close"],
|
|
2380
2380
|
setup(t, { emit: b }) {
|
|
2381
|
-
const e = t, l = b,
|
|
2381
|
+
const e = t, l = b, h = q({
|
|
2382
2382
|
get: () => e.modelValue,
|
|
2383
|
-
set: (
|
|
2383
|
+
set: (K) => l("update:modelValue", K)
|
|
2384
2384
|
}), i = R(null), C = q(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), E = q(() => e.placement === "right" ? "rounded-left" : "rounded-top"), _ = q(() => {
|
|
2385
|
-
const
|
|
2386
|
-
return e.placement === "right" ? (
|
|
2385
|
+
const K = {};
|
|
2386
|
+
return e.placement === "right" ? (K.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), K.height = "100%", K.right = "0", K.top = "0") : (K.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), K.width = "100%", K.bottom = "0", K.left = "0"), K;
|
|
2387
2387
|
});
|
|
2388
2388
|
function M() {
|
|
2389
2389
|
e.maskClosable && v();
|
|
2390
2390
|
}
|
|
2391
2391
|
function v() {
|
|
2392
|
-
|
|
2392
|
+
h.value && (h.value = !1, l("close"));
|
|
2393
2393
|
}
|
|
2394
2394
|
function w() {
|
|
2395
2395
|
e.closable && v();
|
|
2396
2396
|
}
|
|
2397
|
-
function
|
|
2398
|
-
|
|
2397
|
+
function p(K) {
|
|
2398
|
+
K.key === "Escape" && w();
|
|
2399
2399
|
}
|
|
2400
|
-
return ne(() => e.modelValue, (
|
|
2401
|
-
|
|
2400
|
+
return ne(() => e.modelValue, (K) => {
|
|
2401
|
+
K ? (l("open"), requestAnimationFrame(() => {
|
|
2402
2402
|
var V;
|
|
2403
2403
|
return (V = i.value) == null ? void 0 : V.focus();
|
|
2404
|
-
}), document.addEventListener("keydown",
|
|
2404
|
+
}), document.addEventListener("keydown", p), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", p), document.body.style.overflow = "");
|
|
2405
2405
|
}), Se(() => {
|
|
2406
|
-
e.modelValue && (document.addEventListener("keydown",
|
|
2406
|
+
e.modelValue && (document.addEventListener("keydown", p), document.body.style.overflow = "hidden");
|
|
2407
2407
|
}), Ee(() => {
|
|
2408
|
-
document.removeEventListener("keydown",
|
|
2409
|
-
}), (
|
|
2408
|
+
document.removeEventListener("keydown", p), document.body.style.overflow = "";
|
|
2409
|
+
}), (K, V) => (a(), Ie(Re, { to: "body" }, [
|
|
2410
2410
|
Be(n("div", {
|
|
2411
2411
|
class: "y-drawer-root",
|
|
2412
2412
|
role: "dialog",
|
|
2413
2413
|
"aria-modal": !0,
|
|
2414
|
-
"aria-hidden": !
|
|
2414
|
+
"aria-hidden": !h.value,
|
|
2415
2415
|
style: ge({ zIndex: String(t.zIndex) })
|
|
2416
2416
|
}, [
|
|
2417
2417
|
n("div", {
|
|
@@ -2442,19 +2442,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2442
2442
|
}, " ✕ ")) : A("", !0)
|
|
2443
2443
|
])) : A("", !0),
|
|
2444
2444
|
n("div", fl, [
|
|
2445
|
-
ue(
|
|
2445
|
+
ue(K.$slots, "default", {}, void 0, !0)
|
|
2446
2446
|
]),
|
|
2447
|
-
|
|
2448
|
-
ue(
|
|
2447
|
+
K.$slots.footer ? (a(), u("div", vl, [
|
|
2448
|
+
ue(K.$slots, "footer", {}, void 0, !0)
|
|
2449
2449
|
])) : A("", !0)
|
|
2450
2450
|
], 46, ul), [
|
|
2451
|
-
[
|
|
2451
|
+
[ze, h.value]
|
|
2452
2452
|
])
|
|
2453
2453
|
]),
|
|
2454
2454
|
_: 3
|
|
2455
2455
|
}, 8, ["name"])
|
|
2456
2456
|
], 12, rl), [
|
|
2457
|
-
[
|
|
2457
|
+
[ze, h.value]
|
|
2458
2458
|
])
|
|
2459
2459
|
]));
|
|
2460
2460
|
}
|
|
@@ -2491,10 +2491,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2491
2491
|
height: "12",
|
|
2492
2492
|
viewBox: "0 0 12 12",
|
|
2493
2493
|
fill: "none"
|
|
2494
|
-
}, El = ["src", "alt"], Tl = { class: "ytree-node__custom-content" },
|
|
2494
|
+
}, El = ["src", "alt"], Tl = { class: "ytree-node__custom-content" }, Kl = {
|
|
2495
2495
|
key: 0,
|
|
2496
2496
|
class: "ytree-node__children"
|
|
2497
|
-
},
|
|
2497
|
+
}, zl = ["data-level", "onClick", "onContextmenu"], Hl = ["onClick"], Rl = {
|
|
2498
2498
|
key: 1,
|
|
2499
2499
|
class: "w-[16px]"
|
|
2500
2500
|
}, Vl = ["onClick"], Al = {
|
|
@@ -2503,13 +2503,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2503
2503
|
height: "12",
|
|
2504
2504
|
viewBox: "0 0 12 12",
|
|
2505
2505
|
fill: "none"
|
|
2506
|
-
},
|
|
2506
|
+
}, Yl = {
|
|
2507
2507
|
key: 1,
|
|
2508
2508
|
width: "12",
|
|
2509
2509
|
height: "12",
|
|
2510
2510
|
viewBox: "0 0 12 12",
|
|
2511
2511
|
fill: "none"
|
|
2512
|
-
},
|
|
2512
|
+
}, Fl = ["src", "alt"], Nl = { class: "ytree-node__custom-content" }, Pl = {
|
|
2513
2513
|
key: 0,
|
|
2514
2514
|
class: "ytree-node__children"
|
|
2515
2515
|
}, Wl = ["data-level", "onClick", "onContextmenu"], jl = ["onClick"], Ol = {
|
|
@@ -2594,7 +2594,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2594
2594
|
},
|
|
2595
2595
|
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"],
|
|
2596
2596
|
setup(t, { emit: b }) {
|
|
2597
|
-
const e = t, l = b,
|
|
2597
|
+
const e = t, l = b, h = q(() => (console.log("ytree 组件接收到的数据:", e.data), e.data || [])), i = R({
|
|
2598
2598
|
currentNode: null,
|
|
2599
2599
|
currentKey: null,
|
|
2600
2600
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2604,34 +2604,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2604
2604
|
nt("treeStore", i);
|
|
2605
2605
|
const C = lt(), E = ot();
|
|
2606
2606
|
function _() {
|
|
2607
|
-
var
|
|
2608
|
-
if (!E)
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
const r = m.filter((h) => {
|
|
2618
|
-
const N = h.toLowerCase();
|
|
2619
|
-
return N.includes("nodeclick") || N.includes("node-click");
|
|
2620
|
-
});
|
|
2621
|
-
if (r.length > 0)
|
|
2622
|
-
return console.log("找到可能的事件监听器键:", r), !0;
|
|
2623
|
-
}
|
|
2624
|
-
const f = Object.keys(C);
|
|
2625
|
-
if (f.length > 0) {
|
|
2626
|
-
console.log("Attrs 键:", f);
|
|
2627
|
-
const m = f.filter((o) => {
|
|
2628
|
-
const r = o.toLowerCase();
|
|
2629
|
-
return o === "onNodeClick" || o === "onNode-click" || r.includes("nodeclick") || r.includes("node-click");
|
|
2630
|
-
});
|
|
2631
|
-
if (m.length > 0)
|
|
2632
|
-
return console.log("在 attrs 中找到事件监听器键:", m), !0;
|
|
2633
|
-
}
|
|
2634
|
-
return console.log("未找到 node-click 事件监听器"), !1;
|
|
2607
|
+
var m;
|
|
2608
|
+
if (!E) return !1;
|
|
2609
|
+
const d = (m = E.vnode) == null ? void 0 : m.props;
|
|
2610
|
+
return !!(d && ("onNodeClick" in d || "onNode-click" in d || Object.keys(d).filter((y) => {
|
|
2611
|
+
const Y = y.toLowerCase();
|
|
2612
|
+
return Y.includes("nodeclick") || Y.includes("node-click");
|
|
2613
|
+
}).length > 0) || Object.keys(C).filter((o) => {
|
|
2614
|
+
const r = o.toLowerCase();
|
|
2615
|
+
return o === "onNodeClick" || o === "onNode-click" || r.includes("nodeclick") || r.includes("node-click");
|
|
2616
|
+
}).length > 0);
|
|
2635
2617
|
}
|
|
2636
2618
|
const M = q(() => e.restrictAutoExpandFromLevel && e.restrictAutoExpandFromLevel > 0 ? e.restrictAutoExpandFromLevel : void 0);
|
|
2637
2619
|
function v(d) {
|
|
@@ -2641,14 +2623,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2641
2623
|
var f;
|
|
2642
2624
|
return ((f = e.props) != null && f.label ? d[e.props.label] : void 0) || d.label || "";
|
|
2643
2625
|
}
|
|
2644
|
-
function
|
|
2626
|
+
function p(d) {
|
|
2645
2627
|
var f;
|
|
2646
2628
|
return !!((f = d == null ? void 0 : d.data) != null && f.isEmployee);
|
|
2647
2629
|
}
|
|
2648
|
-
function
|
|
2649
|
-
var
|
|
2630
|
+
function K(d, f) {
|
|
2631
|
+
var y;
|
|
2650
2632
|
const g = e.deptIconUrl || io, m = e.personIconUrl || ro, o = e.buttonIconUrl || "", r = e.childStyleIconUrl || "";
|
|
2651
|
-
return f && r && D(d, f) ? r : (
|
|
2633
|
+
return f && r && D(d, f) ? r : (y = d == null ? void 0 : d.data) != null && y.isButton && o ? o : p(d) ? m : g;
|
|
2652
2634
|
}
|
|
2653
2635
|
function V(d) {
|
|
2654
2636
|
var g;
|
|
@@ -2681,8 +2663,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2681
2663
|
const f = v(d);
|
|
2682
2664
|
if (i.value.checkedKeys.has(f)) {
|
|
2683
2665
|
if (V(d)) {
|
|
2684
|
-
const m = U(d), o = m.filter((
|
|
2685
|
-
(
|
|
2666
|
+
const m = U(d), o = m.filter((y) => L(y)), r = m.filter(
|
|
2667
|
+
(y) => I(y)
|
|
2686
2668
|
);
|
|
2687
2669
|
return o.length === m.length && r.length === 0;
|
|
2688
2670
|
}
|
|
@@ -2711,10 +2693,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2711
2693
|
if (e.disabled) return;
|
|
2712
2694
|
const f = v(d), m = !i.value.checkedKeys.has(f), o = new Set(i.value.expandedKeys);
|
|
2713
2695
|
m ? i.value.checkedKeys.add(f) : i.value.checkedKeys.delete(f);
|
|
2714
|
-
function r(
|
|
2715
|
-
|
|
2696
|
+
function r(y, Y) {
|
|
2697
|
+
y.forEach((H) => {
|
|
2716
2698
|
const Z = v(H);
|
|
2717
|
-
|
|
2699
|
+
Y ? i.value.checkedKeys.add(Z) : i.value.checkedKeys.delete(Z), V(H) && r(U(H), Y);
|
|
2718
2700
|
});
|
|
2719
2701
|
}
|
|
2720
2702
|
r(U(d), m), m && ee(), le(), i.value.expandedKeys = o, l("check-change", d, m, !1), l("check", d, m, !1), l("checked-keys-change", Array.from(i.value.checkedKeys));
|
|
@@ -2735,13 +2717,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2735
2717
|
d.push(o), V(o) && f(U(o));
|
|
2736
2718
|
});
|
|
2737
2719
|
}
|
|
2738
|
-
f(
|
|
2720
|
+
f(h.value);
|
|
2739
2721
|
function g(m) {
|
|
2740
2722
|
if (V(m)) {
|
|
2741
|
-
const o = U(m), r = v(m),
|
|
2723
|
+
const o = U(m), r = v(m), y = o.filter((H) => L(H)), Y = o.filter(
|
|
2742
2724
|
(H) => I(H)
|
|
2743
2725
|
);
|
|
2744
|
-
|
|
2726
|
+
y.length === o.length && Y.length === 0 || y.length > 0 || Y.length > 0 ? i.value.checkedKeys.add(r) : i.value.checkedKeys.delete(r);
|
|
2745
2727
|
}
|
|
2746
2728
|
}
|
|
2747
2729
|
for (let m = d.length - 1; m >= 0; m--)
|
|
@@ -2754,15 +2736,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2754
2736
|
l("child-node-click", d, f, g);
|
|
2755
2737
|
return;
|
|
2756
2738
|
}
|
|
2757
|
-
|
|
2758
|
-
|
|
2739
|
+
const r = _();
|
|
2740
|
+
if (V(d)) {
|
|
2741
|
+
if (e.expandOnClickNode) {
|
|
2742
|
+
se(d);
|
|
2743
|
+
return;
|
|
2744
|
+
}
|
|
2759
2745
|
return;
|
|
2760
2746
|
}
|
|
2761
|
-
if (
|
|
2762
|
-
|
|
2747
|
+
if (r) {
|
|
2748
|
+
i.value.currentNode = d, i.value.currentKey = v(d), e.showCheckbox && X(d), l("node-click", d, f, g);
|
|
2763
2749
|
return;
|
|
2764
2750
|
}
|
|
2765
|
-
i.value.currentNode = d, i.value.currentKey = v(d), e.showCheckbox && X(d)
|
|
2751
|
+
i.value.currentNode = d, i.value.currentKey = v(d), e.showCheckbox && X(d);
|
|
2766
2752
|
}
|
|
2767
2753
|
function de(d, f, g, m) {
|
|
2768
2754
|
e.disabled || l("node-contextmenu", d, f, g, m);
|
|
@@ -2773,26 +2759,26 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2773
2759
|
if (d) {
|
|
2774
2760
|
const f = M.value;
|
|
2775
2761
|
if (f) {
|
|
2776
|
-
let g = function(
|
|
2777
|
-
for (const Z of
|
|
2778
|
-
if (v(Z) ===
|
|
2762
|
+
let g = function(y, Y, H = 1) {
|
|
2763
|
+
for (const Z of Y) {
|
|
2764
|
+
if (v(Z) === y) return H;
|
|
2779
2765
|
if (V(Z)) {
|
|
2780
|
-
const De = g(
|
|
2766
|
+
const De = g(y, U(Z), H + 1);
|
|
2781
2767
|
if (De > 0) return De;
|
|
2782
2768
|
}
|
|
2783
2769
|
}
|
|
2784
2770
|
return 0;
|
|
2785
|
-
}, m = function(
|
|
2786
|
-
|
|
2787
|
-
|
|
2771
|
+
}, m = function(y, Y, H) {
|
|
2772
|
+
y.forEach((Z) => {
|
|
2773
|
+
Y < H && V(Z) ? (r.add(v(Z)), m(U(Z), Y + 1, H)) : Y < H && V(Z);
|
|
2788
2774
|
});
|
|
2789
2775
|
};
|
|
2790
|
-
const o = (d || []).filter((
|
|
2791
|
-
const
|
|
2792
|
-
return
|
|
2776
|
+
const o = (d || []).filter((y) => {
|
|
2777
|
+
const Y = g(y, h.value, 1);
|
|
2778
|
+
return Y > 0 && Y < f;
|
|
2793
2779
|
}), r = new Set(o);
|
|
2794
|
-
m(
|
|
2795
|
-
g(
|
|
2780
|
+
m(h.value, 1, f), i.value.expandedKeys.forEach((y) => {
|
|
2781
|
+
g(y, h.value, 1) >= f && r.add(y);
|
|
2796
2782
|
}), i.value.expandedKeys = r;
|
|
2797
2783
|
} else
|
|
2798
2784
|
i.value.expandedKeys = new Set(d);
|
|
@@ -2800,33 +2786,33 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2800
2786
|
},
|
|
2801
2787
|
{ immediate: !0 }
|
|
2802
2788
|
);
|
|
2803
|
-
function
|
|
2789
|
+
function F() {
|
|
2804
2790
|
if (e.defaultExpandAll) {
|
|
2805
2791
|
let d = function(m, o = 1) {
|
|
2806
2792
|
m.forEach((r) => {
|
|
2807
2793
|
if (!V(r)) return;
|
|
2808
|
-
const
|
|
2794
|
+
const y = U(r);
|
|
2809
2795
|
if (g) {
|
|
2810
2796
|
if (o >= g) return;
|
|
2811
|
-
o + 1 === g || f.add(v(r)), d(
|
|
2797
|
+
o + 1 === g || f.add(v(r)), d(y, o + 1);
|
|
2812
2798
|
} else
|
|
2813
|
-
f.add(v(r)), d(
|
|
2799
|
+
f.add(v(r)), d(y, o + 1);
|
|
2814
2800
|
});
|
|
2815
2801
|
};
|
|
2816
2802
|
const f = /* @__PURE__ */ new Set(), g = M.value;
|
|
2817
|
-
d(
|
|
2803
|
+
d(h.value, 1), i.value.expandedKeys = f;
|
|
2818
2804
|
}
|
|
2819
2805
|
}
|
|
2820
2806
|
function W() {
|
|
2821
2807
|
if (e.defaultCheckedKeys && e.defaultCheckedKeys.length > 0) {
|
|
2822
2808
|
let d = function(o, r = []) {
|
|
2823
|
-
o.forEach((
|
|
2824
|
-
const
|
|
2825
|
-
f.has(
|
|
2809
|
+
o.forEach((y) => {
|
|
2810
|
+
const Y = v(y), H = [...r, Y];
|
|
2811
|
+
f.has(Y) && r.forEach((Z) => g.add(Z)), V(y) && d(U(y), H);
|
|
2826
2812
|
});
|
|
2827
2813
|
};
|
|
2828
2814
|
const f = new Set(e.defaultCheckedKeys), g = /* @__PURE__ */ new Set();
|
|
2829
|
-
d(
|
|
2815
|
+
d(h.value);
|
|
2830
2816
|
const m = M.value;
|
|
2831
2817
|
if (m) {
|
|
2832
2818
|
console.log(
|
|
@@ -2837,7 +2823,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2837
2823
|
i.value.expandedKeys = g;
|
|
2838
2824
|
}
|
|
2839
2825
|
}
|
|
2840
|
-
return ne(() => e.defaultExpandAll,
|
|
2826
|
+
return ne(() => e.defaultExpandAll, F, { immediate: !0 }), ne(() => h.value, F, { deep: !0 }), ne(
|
|
2841
2827
|
() => e.defaultCheckedKeys,
|
|
2842
2828
|
(d) => {
|
|
2843
2829
|
d ? (i.value.checkedKeys = new Set(d), e.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : W()) : i.value.checkedKeys.clear();
|
|
@@ -2853,7 +2839,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2853
2839
|
class: B(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
2854
2840
|
}, [
|
|
2855
2841
|
n("div", yl, [
|
|
2856
|
-
(a(!0), u(re, null, he(
|
|
2842
|
+
(a(!0), u(re, null, he(h.value, (g) => (a(), u("div", {
|
|
2857
2843
|
key: v(g),
|
|
2858
2844
|
class: B(["ytree-node", { "ytree-node--current": P(g) }])
|
|
2859
2845
|
}, [
|
|
@@ -2915,11 +2901,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2915
2901
|
}, null, 2)) : A("", !0),
|
|
2916
2902
|
n("img", {
|
|
2917
2903
|
class: "ytree-node__avatar",
|
|
2918
|
-
src:
|
|
2919
|
-
alt:
|
|
2904
|
+
src: K(g, g),
|
|
2905
|
+
alt: p(g) ? "person" : "dept"
|
|
2920
2906
|
}, null, 8, Cl),
|
|
2921
2907
|
n("span", {
|
|
2922
|
-
class: B(["ytree-node__label", { "is-employee":
|
|
2908
|
+
class: B(["ytree-node__label", { "is-employee": p(g) }])
|
|
2923
2909
|
}, G(w(g)), 3),
|
|
2924
2910
|
n("div", Dl, [
|
|
2925
2911
|
ue(d.$slots, "node-content", {
|
|
@@ -2995,11 +2981,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2995
2981
|
}, null, 2)) : A("", !0),
|
|
2996
2982
|
n("img", {
|
|
2997
2983
|
class: "ytree-node__avatar",
|
|
2998
|
-
src:
|
|
2999
|
-
alt:
|
|
2984
|
+
src: K(m, g),
|
|
2985
|
+
alt: p(m) ? "person" : "dept"
|
|
3000
2986
|
}, null, 8, El),
|
|
3001
2987
|
n("span", {
|
|
3002
|
-
class: B(["ytree-node__label", { "is-employee":
|
|
2988
|
+
class: B(["ytree-node__label", { "is-employee": p(m) }])
|
|
3003
2989
|
}, G(w(m)), 3),
|
|
3004
2990
|
n("div", Tl, [
|
|
3005
2991
|
ue(d.$slots, "node-content", {
|
|
@@ -3012,7 +2998,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3012
2998
|
], 42, _l),
|
|
3013
2999
|
fe(ke, { name: "ytree-node" }, {
|
|
3014
3000
|
default: pe(() => [
|
|
3015
|
-
V(m) && T(m) ? (a(), u("div",
|
|
3001
|
+
V(m) && T(m) ? (a(), u("div", Kl, [
|
|
3016
3002
|
(a(!0), u(re, null, he(U(m), (o) => (a(), u("div", {
|
|
3017
3003
|
key: v(o),
|
|
3018
3004
|
class: B(["ytree-node", {
|
|
@@ -3067,7 +3053,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3067
3053
|
"stroke-linecap": "round",
|
|
3068
3054
|
"stroke-linejoin": "round"
|
|
3069
3055
|
}, null, -1)
|
|
3070
|
-
])])) : I(o) ? (a(), u("svg",
|
|
3056
|
+
])])) : I(o) ? (a(), u("svg", Yl, [...f[8] || (f[8] = [
|
|
3071
3057
|
n("path", {
|
|
3072
3058
|
d: "M2 6L10 6",
|
|
3073
3059
|
stroke: "currentColor",
|
|
@@ -3082,13 +3068,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3082
3068
|
}, null, 2)) : A("", !0),
|
|
3083
3069
|
n("img", {
|
|
3084
3070
|
class: "ytree-node__avatar",
|
|
3085
|
-
src:
|
|
3086
|
-
alt:
|
|
3087
|
-
}, null, 8,
|
|
3071
|
+
src: K(o, g),
|
|
3072
|
+
alt: p(o) ? "person" : "dept"
|
|
3073
|
+
}, null, 8, Fl),
|
|
3088
3074
|
n("span", {
|
|
3089
|
-
class: B(["ytree-node__label", { "is-employee":
|
|
3075
|
+
class: B(["ytree-node__label", { "is-employee": p(o) }])
|
|
3090
3076
|
}, G(w(o)), 3),
|
|
3091
|
-
n("div",
|
|
3077
|
+
n("div", Nl, [
|
|
3092
3078
|
ue(d.$slots, "node-content", {
|
|
3093
3079
|
node: o,
|
|
3094
3080
|
isCurrent: P(o),
|
|
@@ -3096,7 +3082,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3096
3082
|
hasChildren: V(o)
|
|
3097
3083
|
}, void 0, !0)
|
|
3098
3084
|
])
|
|
3099
|
-
], 42,
|
|
3085
|
+
], 42, zl),
|
|
3100
3086
|
fe(ke, { name: "ytree-node" }, {
|
|
3101
3087
|
default: pe(() => [
|
|
3102
3088
|
V(o) && T(o) ? (a(), u("div", Pl, [
|
|
@@ -3112,14 +3098,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3112
3098
|
paddingLeft: "54px"
|
|
3113
3099
|
},
|
|
3114
3100
|
"data-level": j(g, r),
|
|
3115
|
-
onClick: (
|
|
3101
|
+
onClick: (y) => ce(
|
|
3116
3102
|
r,
|
|
3117
3103
|
r,
|
|
3118
3104
|
null,
|
|
3119
3105
|
g
|
|
3120
3106
|
),
|
|
3121
|
-
onContextmenu: (
|
|
3122
|
-
|
|
3107
|
+
onContextmenu: (y) => de(
|
|
3108
|
+
y,
|
|
3123
3109
|
r,
|
|
3124
3110
|
r,
|
|
3125
3111
|
null
|
|
@@ -3130,7 +3116,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3130
3116
|
class: B(["ytree-node__expand-icon", {
|
|
3131
3117
|
"is-expanded": T(r)
|
|
3132
3118
|
}]),
|
|
3133
|
-
onClick: J((
|
|
3119
|
+
onClick: J((y) => se(r), ["stop"])
|
|
3134
3120
|
}, [...f[9] || (f[9] = [
|
|
3135
3121
|
n("svg", {
|
|
3136
3122
|
width: "12",
|
|
@@ -3153,7 +3139,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3153
3139
|
"is-checked": L(r),
|
|
3154
3140
|
"is-indeterminate": I(r)
|
|
3155
3141
|
}]),
|
|
3156
|
-
onClick: J((
|
|
3142
|
+
onClick: J((y) => X(r), ["stop"])
|
|
3157
3143
|
}, [
|
|
3158
3144
|
L(r) ? (a(), u("svg", Ul, [...f[10] || (f[10] = [
|
|
3159
3145
|
n("path", {
|
|
@@ -3178,12 +3164,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3178
3164
|
}, null, 2)) : A("", !0),
|
|
3179
3165
|
n("img", {
|
|
3180
3166
|
class: "ytree-node__avatar",
|
|
3181
|
-
src:
|
|
3182
|
-
alt:
|
|
3167
|
+
src: K(r, g),
|
|
3168
|
+
alt: p(r) ? "person" : "dept"
|
|
3183
3169
|
}, null, 8, Ql),
|
|
3184
3170
|
n("span", {
|
|
3185
3171
|
class: B(["ytree-node__label", {
|
|
3186
|
-
"is-employee":
|
|
3172
|
+
"is-employee": p(r)
|
|
3187
3173
|
}])
|
|
3188
3174
|
}, G(w(r)), 3),
|
|
3189
3175
|
n("div", Jl, [
|
|
@@ -3200,37 +3186,37 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3200
3186
|
V(r) && T(r) ? (a(), u("div", Xl, [
|
|
3201
3187
|
(a(!0), u(re, null, he(U(
|
|
3202
3188
|
r
|
|
3203
|
-
), (
|
|
3204
|
-
key: v(
|
|
3189
|
+
), (y) => (a(), u("div", {
|
|
3190
|
+
key: v(y),
|
|
3205
3191
|
class: B(["ytree-node", {
|
|
3206
|
-
"ytree-node--current": P(
|
|
3192
|
+
"ytree-node--current": P(y)
|
|
3207
3193
|
}])
|
|
3208
3194
|
}, [
|
|
3209
3195
|
n("div", {
|
|
3210
|
-
class: B(["ytree-node__content", { "is-child-style": D(
|
|
3196
|
+
class: B(["ytree-node__content", { "is-child-style": D(y, g) }]),
|
|
3211
3197
|
style: {
|
|
3212
3198
|
paddingLeft: "70px"
|
|
3213
3199
|
},
|
|
3214
|
-
"data-level": j(g,
|
|
3215
|
-
onClick: (
|
|
3216
|
-
|
|
3217
|
-
|
|
3200
|
+
"data-level": j(g, y),
|
|
3201
|
+
onClick: (Y) => ce(
|
|
3202
|
+
y,
|
|
3203
|
+
y,
|
|
3218
3204
|
null,
|
|
3219
3205
|
g
|
|
3220
3206
|
),
|
|
3221
|
-
onContextmenu: (
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3207
|
+
onContextmenu: (Y) => de(
|
|
3208
|
+
Y,
|
|
3209
|
+
y,
|
|
3210
|
+
y,
|
|
3225
3211
|
null
|
|
3226
3212
|
)
|
|
3227
3213
|
}, [
|
|
3228
|
-
V(
|
|
3214
|
+
V(y) ? (a(), u("span", {
|
|
3229
3215
|
key: 0,
|
|
3230
3216
|
class: B(["ytree-node__expand-icon", {
|
|
3231
|
-
"is-expanded": T(
|
|
3217
|
+
"is-expanded": T(y)
|
|
3232
3218
|
}]),
|
|
3233
|
-
onClick: J((
|
|
3219
|
+
onClick: J((Y) => se(y), ["stop"])
|
|
3234
3220
|
}, [...f[12] || (f[12] = [
|
|
3235
3221
|
n("svg", {
|
|
3236
3222
|
width: "12",
|
|
@@ -3250,14 +3236,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3250
3236
|
t.showCheckbox ? (a(), u("span", {
|
|
3251
3237
|
key: 2,
|
|
3252
3238
|
class: B(["ytree-node__checkbox", {
|
|
3253
|
-
"is-checked": L(
|
|
3239
|
+
"is-checked": L(y),
|
|
3254
3240
|
"is-indeterminate": I(
|
|
3255
|
-
|
|
3241
|
+
y
|
|
3256
3242
|
)
|
|
3257
3243
|
}]),
|
|
3258
|
-
onClick: J((
|
|
3244
|
+
onClick: J((Y) => X(y), ["stop"])
|
|
3259
3245
|
}, [
|
|
3260
|
-
L(
|
|
3246
|
+
L(y) ? (a(), u("svg", lo, [...f[13] || (f[13] = [
|
|
3261
3247
|
n("path", {
|
|
3262
3248
|
d: "M2 6L4.5 8.5L10 3",
|
|
3263
3249
|
stroke: "currentColor",
|
|
@@ -3266,7 +3252,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3266
3252
|
"stroke-linejoin": "round"
|
|
3267
3253
|
}, null, -1)
|
|
3268
3254
|
])])) : I(
|
|
3269
|
-
|
|
3255
|
+
y
|
|
3270
3256
|
) ? (a(), u("svg", oo, [...f[14] || (f[14] = [
|
|
3271
3257
|
n("path", {
|
|
3272
3258
|
d: "M2 6L10 6",
|
|
@@ -3282,20 +3268,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3282
3268
|
}, null, 2)) : A("", !0),
|
|
3283
3269
|
n("img", {
|
|
3284
3270
|
class: "ytree-node__avatar",
|
|
3285
|
-
src:
|
|
3286
|
-
alt: y
|
|
3271
|
+
src: K(y, g),
|
|
3272
|
+
alt: p(y) ? "person" : "dept"
|
|
3287
3273
|
}, null, 8, so),
|
|
3288
3274
|
n("span", {
|
|
3289
3275
|
class: B(["ytree-node__label", {
|
|
3290
|
-
"is-employee": y
|
|
3276
|
+
"is-employee": p(y)
|
|
3291
3277
|
}])
|
|
3292
|
-
}, G(w(
|
|
3278
|
+
}, G(w(y)), 3),
|
|
3293
3279
|
n("div", ao, [
|
|
3294
3280
|
ue(d.$slots, "node-content", {
|
|
3295
|
-
node:
|
|
3296
|
-
isCurrent: P(
|
|
3297
|
-
isExpanded: T(
|
|
3298
|
-
hasChildren: V(
|
|
3281
|
+
node: y,
|
|
3282
|
+
isCurrent: P(y),
|
|
3283
|
+
isExpanded: T(y),
|
|
3284
|
+
hasChildren: V(y)
|
|
3299
3285
|
}, void 0, !0)
|
|
3300
3286
|
])
|
|
3301
3287
|
], 42, Gl)
|
|
@@ -3323,7 +3309,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3323
3309
|
])
|
|
3324
3310
|
], 2));
|
|
3325
3311
|
}
|
|
3326
|
-
}), co = /* @__PURE__ */ we(uo, [["__scopeId", "data-v-
|
|
3312
|
+
}), co = /* @__PURE__ */ we(uo, [["__scopeId", "data-v-e88ee244"]]), fo = { class: "query-encapsulation" }, vo = { class: "query-encapsulation__container" }, ho = { class: "query-encapsulation__content" }, po = { class: "query-encapsulation__fields" }, yo = { class: "query-encapsulation__field-wrapper" }, go = { class: "query-encapsulation__field-label" }, mo = {
|
|
3327
3313
|
key: 0,
|
|
3328
3314
|
class: "query-encapsulation__toggle"
|
|
3329
3315
|
}, wo = { class: "query-encapsulation__actions" }, bo = { class: "query-encapsulation__actions-group" }, ko = /* @__PURE__ */ me({
|
|
@@ -3336,7 +3322,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3336
3322
|
},
|
|
3337
3323
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3338
3324
|
setup(t, { emit: b }) {
|
|
3339
|
-
const e = t, l = b,
|
|
3325
|
+
const e = t, l = b, h = R(!1), i = st({}), C = q(() => e.fields.filter((D) => !D.hidden)), E = q(() => h.value ? C.value : C.value.slice(0, e.maxVisibleFields)), _ = q(() => C.value.length > e.maxVisibleFields);
|
|
3340
3326
|
function M(D) {
|
|
3341
3327
|
switch (D) {
|
|
3342
3328
|
case "select":
|
|
@@ -3356,14 +3342,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3356
3342
|
const D = V(i), T = U(D);
|
|
3357
3343
|
l("search", { data: T });
|
|
3358
3344
|
}
|
|
3359
|
-
function
|
|
3345
|
+
function p() {
|
|
3360
3346
|
Object.keys(i).forEach((D) => {
|
|
3361
3347
|
const T = e.fields.find((L) => L.key === D);
|
|
3362
3348
|
(T == null ? void 0 : T.type) === "daterange" ? i[D] = { startDate: null, endDate: null } : (T == null ? void 0 : T.type) === "date" ? i[D] = null : i[D] = "";
|
|
3363
3349
|
}), l("reset"), l("update:modelValue", { ...i });
|
|
3364
3350
|
}
|
|
3365
|
-
function
|
|
3366
|
-
|
|
3351
|
+
function K() {
|
|
3352
|
+
h.value = !h.value;
|
|
3367
3353
|
}
|
|
3368
3354
|
function V(D) {
|
|
3369
3355
|
const T = {};
|
|
@@ -3441,12 +3427,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3441
3427
|
fe(Ae, {
|
|
3442
3428
|
variant: "secondary",
|
|
3443
3429
|
size: "small",
|
|
3444
|
-
onClick:
|
|
3430
|
+
onClick: K
|
|
3445
3431
|
}, {
|
|
3446
3432
|
default: pe(() => [
|
|
3447
|
-
Ce(G(
|
|
3433
|
+
Ce(G(h.value ? "收起" : "展开") + " ", 1),
|
|
3448
3434
|
n("span", {
|
|
3449
|
-
class: B(["query-encapsulation__toggle-icon", { "is-expanded":
|
|
3435
|
+
class: B(["query-encapsulation__toggle-icon", { "is-expanded": h.value }])
|
|
3450
3436
|
}, "▼", 2)
|
|
3451
3437
|
]),
|
|
3452
3438
|
_: 1
|
|
@@ -3468,7 +3454,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3468
3454
|
fe(Ae, {
|
|
3469
3455
|
variant: "secondary",
|
|
3470
3456
|
size: "small",
|
|
3471
|
-
onClick:
|
|
3457
|
+
onClick: p,
|
|
3472
3458
|
loading: t.loading
|
|
3473
3459
|
}, {
|
|
3474
3460
|
default: pe(() => [...T[1] || (T[1] = [
|
|
@@ -3522,12 +3508,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3522
3508
|
let l;
|
|
3523
3509
|
Se(() => {
|
|
3524
3510
|
requestAnimationFrame(() => {
|
|
3525
|
-
e.value = !0, b.duration && b.duration > 0 && (l = window.setTimeout(() =>
|
|
3511
|
+
e.value = !0, b.duration && b.duration > 0 && (l = window.setTimeout(() => h(), b.duration));
|
|
3526
3512
|
});
|
|
3527
3513
|
}), rt(() => {
|
|
3528
3514
|
l && window.clearTimeout(l);
|
|
3529
3515
|
});
|
|
3530
|
-
function
|
|
3516
|
+
function h() {
|
|
3531
3517
|
e.value = !1;
|
|
3532
3518
|
}
|
|
3533
3519
|
function i() {
|
|
@@ -3580,10 +3566,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3580
3566
|
key: 0,
|
|
3581
3567
|
class: "y-msg__close",
|
|
3582
3568
|
type: "button",
|
|
3583
|
-
onClick:
|
|
3569
|
+
onClick: h
|
|
3584
3570
|
}, "✕")) : A("", !0)
|
|
3585
3571
|
], 6), [
|
|
3586
|
-
[
|
|
3572
|
+
[ze, e.value]
|
|
3587
3573
|
])
|
|
3588
3574
|
]),
|
|
3589
3575
|
_: 1
|
|
@@ -3606,10 +3592,10 @@ function qe(t) {
|
|
|
3606
3592
|
const i = window.getComputedStyle(l).top;
|
|
3607
3593
|
l.style.top = i, l.classList.add("is-leaving"), l.style.willChange = "opacity, transform";
|
|
3608
3594
|
}
|
|
3609
|
-
Me[b].leaving = !0,
|
|
3595
|
+
Me[b].leaving = !0, Ne(), setTimeout(() => {
|
|
3610
3596
|
Ze(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
3611
3597
|
const i = Me.findIndex((C) => C.id === t);
|
|
3612
|
-
i !== -1 && Me.splice(i, 1),
|
|
3598
|
+
i !== -1 && Me.splice(i, 1), Ne();
|
|
3613
3599
|
}, 260);
|
|
3614
3600
|
}
|
|
3615
3601
|
function We(t) {
|
|
@@ -3627,15 +3613,15 @@ function We(t) {
|
|
|
3627
3613
|
onClose: (C) => qe(C)
|
|
3628
3614
|
});
|
|
3629
3615
|
Ze(l, e);
|
|
3630
|
-
const
|
|
3631
|
-
return Me.push({ id: b, el: e, vm: l, height:
|
|
3616
|
+
const h = ((i = e.firstElementChild) == null ? void 0 : i.offsetHeight) || 0;
|
|
3617
|
+
return Me.push({ id: b, el: e, vm: l, height: h, leaving: !1 }), Ne(), requestAnimationFrame(() => {
|
|
3632
3618
|
const C = e.firstElementChild;
|
|
3633
3619
|
if (!C) return;
|
|
3634
|
-
const E = C.offsetHeight ||
|
|
3635
|
-
_ && (_.height = E,
|
|
3620
|
+
const E = C.offsetHeight || h || 0, _ = Me.find((M) => M.id === b);
|
|
3621
|
+
_ && (_.height = E, Ne());
|
|
3636
3622
|
}), { close: () => qe(b) };
|
|
3637
3623
|
}
|
|
3638
|
-
const
|
|
3624
|
+
const Fe = {
|
|
3639
3625
|
success(t, b = {}) {
|
|
3640
3626
|
return We({ ...b, type: "success", message: t });
|
|
3641
3627
|
},
|
|
@@ -3646,8 +3632,8 @@ const Ye = {
|
|
|
3646
3632
|
return We({ ...b, type: "error", message: t });
|
|
3647
3633
|
}
|
|
3648
3634
|
};
|
|
3649
|
-
typeof window < "u" && (window.YMessage =
|
|
3650
|
-
function
|
|
3635
|
+
typeof window < "u" && (window.YMessage = Fe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Fe));
|
|
3636
|
+
function Ne() {
|
|
3651
3637
|
let t = 20;
|
|
3652
3638
|
Me.forEach((b) => {
|
|
3653
3639
|
const e = b.el.firstElementChild;
|
|
@@ -3656,15 +3642,15 @@ function Fe() {
|
|
|
3656
3642
|
if (e.style.transform = `translate(-50%, ${l}px)`, e.style.top || (e.style.top = "0px"), !b.leaving)
|
|
3657
3643
|
t += (e.offsetHeight || b.height) + je;
|
|
3658
3644
|
else {
|
|
3659
|
-
const
|
|
3660
|
-
t +=
|
|
3645
|
+
const h = e.offsetHeight || b.height;
|
|
3646
|
+
t += h + je;
|
|
3661
3647
|
}
|
|
3662
3648
|
});
|
|
3663
3649
|
}
|
|
3664
3650
|
const Ue = {
|
|
3665
3651
|
YButton: Ae,
|
|
3666
3652
|
YInput: Qe,
|
|
3667
|
-
YTable:
|
|
3653
|
+
YTable: Kt,
|
|
3668
3654
|
YSelect: Je,
|
|
3669
3655
|
YPagination: jt,
|
|
3670
3656
|
YBadge: sn,
|
|
@@ -3681,7 +3667,7 @@ const Ue = {
|
|
|
3681
3667
|
install(t) {
|
|
3682
3668
|
Object.keys(Ue).forEach((b) => {
|
|
3683
3669
|
t.component(b, Ue[b]);
|
|
3684
|
-
}), t.config.globalProperties.$message =
|
|
3670
|
+
}), t.config.globalProperties.$message = Fe, typeof window < "u" && (window.YMessage = Fe);
|
|
3685
3671
|
}
|
|
3686
3672
|
};
|
|
3687
3673
|
export {
|
|
@@ -3693,12 +3679,12 @@ export {
|
|
|
3693
3679
|
il as YDropdown,
|
|
3694
3680
|
sl as YImage,
|
|
3695
3681
|
Qe as YInput,
|
|
3696
|
-
|
|
3682
|
+
Fe as YMessage,
|
|
3697
3683
|
jt as YPagination,
|
|
3698
3684
|
gn as YPopover,
|
|
3699
3685
|
Je as YSelect,
|
|
3700
3686
|
tl as YSwitch,
|
|
3701
|
-
|
|
3687
|
+
Kt as YTable,
|
|
3702
3688
|
Xe as YTime,
|
|
3703
3689
|
co as YTree,
|
|
3704
3690
|
To as default
|