@nhdropshipping/y-components 1.0.87 → 1.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ytable.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +1020 -1008
- 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 _e, computed as _, createElementBlock as p, openBlock as d, normalizeClass as Z, createElementVNode as
|
|
1
|
+
import { defineComponent as _e, computed as _, createElementBlock as p, openBlock as d, normalizeClass as Z, createElementVNode as s, renderSlot as ke, Fragment as Se, renderList as Be, createCommentVNode as V, toDisplayString as we, ref as I, watch as ge, normalizeStyle as be, withKeys as Ke, provide as Le, nextTick as oe, onMounted as Fe, onUnmounted as Oe, resolveComponent as nt, createVNode as Ie, Transition as Ve, withCtx as $e, createTextVNode as We, createBlock as Pe, withModifiers as me, withDirectives as je, vModelText as Lt, Teleport as Xe, vShow as Ze, inject as Ee, unref as lt, mergeProps as ht, reactive as Et, onActivated as Ht, onBeforeUnmount as Ct, TransitionGroup as Bt, resolveDynamicComponent as _t, toHandlers as zt, render as xt, onUpdated as Nt } from "vue";
|
|
2
2
|
const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "content" }, Rt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -48,16 +48,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}),
|
|
52
|
-
function S($,
|
|
51
|
+
}), i = _(() => Array.isArray(e.groupItems) && e.groupItems.length > 0);
|
|
52
|
+
function S($, M) {
|
|
53
53
|
if (e.disabled || e.loading || $.disabled || $.loading) {
|
|
54
|
-
|
|
54
|
+
M.preventDefault(), M.stopPropagation();
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
l("group-click", $.value,
|
|
57
|
+
l("group-click", $.value, M);
|
|
58
58
|
}
|
|
59
|
-
return ($,
|
|
60
|
-
(d(!0), p(Se, null,
|
|
59
|
+
return ($, M) => i.value ? (d(), p("div", Rt, [
|
|
60
|
+
(d(!0), p(Se, null, Be(t.groupItems, (C, c) => {
|
|
61
61
|
var g;
|
|
62
62
|
return d(), p("button", {
|
|
63
63
|
key: C.value ?? c,
|
|
@@ -75,15 +75,15 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
75
75
|
"aria-label": C.ariaLabel || C.label,
|
|
76
76
|
onClick: (x) => S(C, x)
|
|
77
77
|
}, [
|
|
78
|
-
|
|
79
|
-
C.icon === "chevron-left" ? (d(), p("svg", Pt, [...
|
|
80
|
-
|
|
78
|
+
s("span", At, [
|
|
79
|
+
C.icon === "chevron-left" ? (d(), p("svg", Pt, [...M[0] || (M[0] = [
|
|
80
|
+
s("path", {
|
|
81
81
|
"fill-rule": "evenodd",
|
|
82
82
|
d: "M12.78 15.22a.75.75 0 01-1.06 0l-5-5a.75.75 0 010-1.06l5-5a.75.75 0 111.06 1.06L8.81 10l3.97 3.97a.75.75 0 010 1.06z",
|
|
83
83
|
"clip-rule": "evenodd"
|
|
84
84
|
}, null, -1)
|
|
85
|
-
])])) : C.icon === "chevron-right" ? (d(), p("svg", Yt, [...
|
|
86
|
-
|
|
85
|
+
])])) : C.icon === "chevron-right" ? (d(), p("svg", Yt, [...M[1] || (M[1] = [
|
|
86
|
+
s("path", {
|
|
87
87
|
"fill-rule": "evenodd",
|
|
88
88
|
d: "M7.22 4.78a.75.75 0 011.06 0l5 5a.75.75 0 010 1.06l-5 5a.75.75 0 11-1.06-1.06L11.19 10 7.22 6.03a.75.75 0 010-1.06z",
|
|
89
89
|
"clip-rule": "evenodd"
|
|
@@ -108,8 +108,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
108
108
|
"aria-disabled": t.disabled || t.loading ? "true" : "false",
|
|
109
109
|
onClick: m
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
s("span", Wt, [
|
|
112
|
+
ke($.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, Kt));
|
|
115
115
|
}
|
|
@@ -153,22 +153,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
153
153
|
},
|
|
154
154
|
emits: ["update:modelValue", "enter", "paste"],
|
|
155
155
|
setup(t, { emit: f }) {
|
|
156
|
-
const e = t, l = f, m =
|
|
156
|
+
const e = t, l = f, m = I(null), h = I(""), i = I(!1), S = I(!1), $ = I(e.placeholder || ""), M = I(!1), C = _(() => e.type === "password"), c = _(() => e.type === "password" && M.value ? "text" : e.type);
|
|
157
157
|
function g() {
|
|
158
|
-
|
|
158
|
+
M.value = !M.value;
|
|
159
159
|
}
|
|
160
160
|
ge(() => e.placeholder, (z) => {
|
|
161
161
|
S.value || ($.value = z || "");
|
|
162
162
|
});
|
|
163
163
|
function x(z) {
|
|
164
164
|
const j = z.target;
|
|
165
|
-
|
|
165
|
+
i.value = !0, l("update:modelValue", j.value);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
168
|
-
S.value = !0, e.clearOnFocus && (h.value = e.modelValue || "",
|
|
167
|
+
function H() {
|
|
168
|
+
S.value = !0, e.clearOnFocus && (h.value = e.modelValue || "", i.value = !1, $.value = h.value || e.placeholder || "", l("update:modelValue", ""));
|
|
169
169
|
}
|
|
170
170
|
function W() {
|
|
171
|
-
if (S.value = !1, e.clearOnFocus && !
|
|
171
|
+
if (S.value = !1, e.clearOnFocus && !i.value && (!e.modelValue || e.modelValue === "") && l("update:modelValue", h.value), e.min !== void 0 && e.modelValue !== void 0 && e.modelValue !== "") {
|
|
172
172
|
const z = Number(e.modelValue), j = Number(e.min);
|
|
173
173
|
!Number.isNaN(z) && !Number.isNaN(j) && z < j && l("update:modelValue", String(j));
|
|
174
174
|
}
|
|
@@ -188,7 +188,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
188
188
|
class: Z(["y-input-wrap", { "is-block": t.block, "has-password-toggle": C.value }]),
|
|
189
189
|
style: be({ width: t.width })
|
|
190
190
|
}, [
|
|
191
|
-
|
|
191
|
+
s("input", {
|
|
192
192
|
ref_key: "inputRef",
|
|
193
193
|
ref: m,
|
|
194
194
|
class: Z(["y-input", `y-input--${t.size}`]),
|
|
@@ -204,7 +204,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
204
204
|
required: t.required,
|
|
205
205
|
value: t.modelValue,
|
|
206
206
|
onInput: x,
|
|
207
|
-
onFocus:
|
|
207
|
+
onFocus: H,
|
|
208
208
|
onBlur: W,
|
|
209
209
|
onKeyup: Ke(R, ["enter"]),
|
|
210
210
|
onPaste: D
|
|
@@ -216,16 +216,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
216
216
|
onClick: g,
|
|
217
217
|
tabindex: "-1"
|
|
218
218
|
}, [
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
M.value ? (d(), p("svg", qt, [...j[0] || (j[0] = [
|
|
220
|
+
s("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }, null, -1),
|
|
221
|
+
s("circle", {
|
|
222
222
|
cx: "12",
|
|
223
223
|
cy: "12",
|
|
224
224
|
r: "3"
|
|
225
225
|
}, null, -1)
|
|
226
226
|
])])) : (d(), p("svg", Ut, [...j[1] || (j[1] = [
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
s("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }, null, -1),
|
|
228
|
+
s("line", {
|
|
229
229
|
x1: "1",
|
|
230
230
|
y1: "1",
|
|
231
231
|
x2: "23",
|
|
@@ -271,22 +271,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
271
271
|
}, dl = { class: "select-header" }, cl = ["checked", "indeterminate", "disabled"], fl = {
|
|
272
272
|
key: 0,
|
|
273
273
|
class: "select-count"
|
|
274
|
-
}, vl = {
|
|
274
|
+
}, vl = ["colspan"], hl = { class: "selected-header-wrapper" }, gl = {
|
|
275
275
|
key: 0,
|
|
276
276
|
class: "loading-overlay"
|
|
277
|
-
},
|
|
277
|
+
}, pl = {
|
|
278
278
|
key: 1,
|
|
279
279
|
class: "empty-overlay"
|
|
280
|
-
},
|
|
280
|
+
}, yl = {
|
|
281
281
|
key: 0,
|
|
282
282
|
style: { width: "34px", "min-width": "34px" }
|
|
283
|
-
},
|
|
283
|
+
}, ml = {
|
|
284
284
|
key: 1,
|
|
285
285
|
style: { width: "60px", "min-width": "60px" }
|
|
286
|
-
},
|
|
286
|
+
}, wl = ["onClick"], bl = {
|
|
287
287
|
key: 0,
|
|
288
288
|
class: "col-expand"
|
|
289
|
-
},
|
|
289
|
+
}, kl = ["onClick"], Cl = ["value", "checked", "disabled", "onChange"], xl = ["colspan"], Dl = /* @__PURE__ */ _e({
|
|
290
290
|
__name: "ytable",
|
|
291
291
|
props: {
|
|
292
292
|
data: {},
|
|
@@ -318,239 +318,239 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
318
318
|
},
|
|
319
319
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change", "row-click"],
|
|
320
320
|
setup(t, { emit: f }) {
|
|
321
|
-
const e = t, l = f, m =
|
|
321
|
+
const e = t, l = f, m = I(e.currentPage || 1), h = I(e.pageSize), i = I(e.selectedItems || []), S = I([]), $ = I(/* @__PURE__ */ new Set()), M = I("none"), C = I(), c = I(), g = I(), x = I(), H = I([]), W = I({}), R = I(35), D = I(/* @__PURE__ */ new Set()), z = _(() => D.value.size > 0), j = _(() => {
|
|
322
322
|
if (ve.value, D.value.size === 0) return !1;
|
|
323
|
-
let
|
|
323
|
+
let o = 0;
|
|
324
324
|
return D.value.forEach((v) => {
|
|
325
|
-
v && v.isExpanded &&
|
|
326
|
-
}),
|
|
325
|
+
v && v.isExpanded && o++;
|
|
326
|
+
}), o === D.value.size;
|
|
327
327
|
});
|
|
328
328
|
_(() => {
|
|
329
329
|
if (ve.value, D.value.size === 0) return !0;
|
|
330
|
-
let
|
|
330
|
+
let o = 0;
|
|
331
331
|
return D.value.forEach((v) => {
|
|
332
|
-
v && !v.isExpanded &&
|
|
333
|
-
}),
|
|
332
|
+
v && !v.isExpanded && o++;
|
|
333
|
+
}), o === D.value.size;
|
|
334
334
|
});
|
|
335
|
-
function ye(
|
|
336
|
-
D.value.add(
|
|
335
|
+
function ye(o) {
|
|
336
|
+
D.value.add(o);
|
|
337
337
|
}
|
|
338
|
-
function de(
|
|
339
|
-
D.value.delete(
|
|
338
|
+
function de(o) {
|
|
339
|
+
D.value.delete(o);
|
|
340
340
|
}
|
|
341
341
|
function K() {
|
|
342
|
-
D.value.forEach((
|
|
343
|
-
|
|
342
|
+
D.value.forEach((o) => {
|
|
343
|
+
o && typeof o.collapse == "function" && o.collapse();
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
function P() {
|
|
347
|
-
D.value.forEach((
|
|
348
|
-
|
|
347
|
+
D.value.forEach((o) => {
|
|
348
|
+
o && typeof o.expand == "function" && o.expand();
|
|
349
349
|
});
|
|
350
350
|
}
|
|
351
351
|
function fe() {
|
|
352
352
|
j.value ? K() : P();
|
|
353
353
|
}
|
|
354
|
-
const ve =
|
|
354
|
+
const ve = I(0);
|
|
355
355
|
function ce() {
|
|
356
356
|
ve.value++;
|
|
357
357
|
}
|
|
358
358
|
Le("registerHintTag", ye), Le("unregisterHintTag", de), Le("notifyHintTagStateChange", ce);
|
|
359
359
|
const ie = _(
|
|
360
|
-
() => e.columns.filter((
|
|
360
|
+
() => e.columns.filter((o) => !b(o.width)).map((o) => o.key)
|
|
361
361
|
);
|
|
362
362
|
function q() {
|
|
363
363
|
return `${(100 / (ie.value.length || 1)).toFixed(6)}%`;
|
|
364
364
|
}
|
|
365
|
-
const te =
|
|
365
|
+
const te = I(), Y = I({
|
|
366
366
|
show: !1,
|
|
367
367
|
thumbHeight: 40,
|
|
368
368
|
thumbTop: 0
|
|
369
369
|
});
|
|
370
|
-
let
|
|
371
|
-
const ae =
|
|
372
|
-
function b(
|
|
373
|
-
if (
|
|
374
|
-
if (typeof
|
|
375
|
-
return Number.isFinite(
|
|
376
|
-
const v = String(
|
|
370
|
+
let J = !1, ne = 0, U = 0;
|
|
371
|
+
const ae = I(0);
|
|
372
|
+
function b(o) {
|
|
373
|
+
if (o == null) return;
|
|
374
|
+
if (typeof o == "number")
|
|
375
|
+
return Number.isFinite(o) ? `${o}px` : void 0;
|
|
376
|
+
const v = String(o).trim();
|
|
377
377
|
if (v)
|
|
378
378
|
return /^\d+(\.\d+)?$/.test(v) ? `${v}px` : v;
|
|
379
379
|
}
|
|
380
|
-
function
|
|
381
|
-
const v = b(
|
|
380
|
+
function r(o) {
|
|
381
|
+
const v = b(o);
|
|
382
382
|
if (!v) return null;
|
|
383
383
|
const k = parseFloat(v);
|
|
384
384
|
return Number.isFinite(k) ? k : null;
|
|
385
385
|
}
|
|
386
386
|
const n = _(() => {
|
|
387
|
-
let
|
|
388
|
-
return e.selectable && (
|
|
387
|
+
let o = e.columns.length;
|
|
388
|
+
return e.selectable && (o += 1), e.expandable && (o += 1), o;
|
|
389
389
|
}), a = _(() => {
|
|
390
390
|
if (!e.searchKeyword || !e.searchFields.length)
|
|
391
391
|
return e.data;
|
|
392
|
-
const
|
|
392
|
+
const o = e.searchKeyword.toLowerCase();
|
|
393
393
|
return e.data.filter((v) => e.searchFields.some((k) => {
|
|
394
394
|
const T = he(v, k);
|
|
395
|
-
return String(T).toLowerCase().includes(
|
|
395
|
+
return String(T).toLowerCase().includes(o);
|
|
396
396
|
}));
|
|
397
397
|
}), w = _(() => (e.pagination, a.value)), N = _(() => {
|
|
398
398
|
if (!e.selectable) return !1;
|
|
399
|
-
const
|
|
400
|
-
return
|
|
401
|
-
}),
|
|
399
|
+
const o = w.value.map((v, k) => ({ key: pe(v, k), item: v, index: k })).filter(({ item: v, index: k }) => !O(v, k)).map(({ key: v }) => v);
|
|
400
|
+
return o.length > 0 && o.every((v) => i.value.includes(v));
|
|
401
|
+
}), B = _(() => {
|
|
402
402
|
if (!e.selectable || N.value) return !1;
|
|
403
|
-
const
|
|
404
|
-
if (
|
|
405
|
-
const v =
|
|
406
|
-
return v > 0 && v <
|
|
403
|
+
const o = w.value.map((k, T) => ({ key: pe(k, T), item: k, index: T })).filter(({ item: k, index: T }) => !O(k, T)).map(({ key: k }) => k);
|
|
404
|
+
if (o.length === 0) return !1;
|
|
405
|
+
const v = o.filter((k) => i.value.includes(k)).length;
|
|
406
|
+
return v > 0 && v < o.length;
|
|
407
407
|
}), A = _(() => {
|
|
408
408
|
if (!e.selectable) return !1;
|
|
409
|
-
const
|
|
410
|
-
return
|
|
409
|
+
const o = w.value.map((v, k) => ({ item: v, index: k }));
|
|
410
|
+
return o.length > 0 && o.every(({ item: v, index: k }) => O(v, k));
|
|
411
411
|
}), ee = _(() => e.pagination ? w.value.length < h.value : !1), G = _(() => {
|
|
412
|
-
const
|
|
412
|
+
const o = [];
|
|
413
413
|
let v = e.selectable ? 60 : 0;
|
|
414
414
|
for (let k = 0; k < e.columns.length; k++) {
|
|
415
415
|
const T = e.columns[k];
|
|
416
416
|
if (T.fixed === "left") {
|
|
417
417
|
let L = 80;
|
|
418
|
-
const F =
|
|
419
|
-
F !== null ? L = F :
|
|
418
|
+
const F = r(T.width);
|
|
419
|
+
F !== null ? L = F : H.value[k] && (L = r(H.value[k]) ?? L), o.push(v), v += L;
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
return
|
|
422
|
+
return o;
|
|
423
423
|
}), re = _(() => {
|
|
424
|
-
const
|
|
424
|
+
const o = [];
|
|
425
425
|
let v = 0;
|
|
426
426
|
const k = [];
|
|
427
427
|
for (let T = e.columns.length - 1; T >= 0; T--) {
|
|
428
428
|
const L = e.columns[T];
|
|
429
429
|
if (L.fixed === "right") {
|
|
430
430
|
let F = 80;
|
|
431
|
-
const se =
|
|
432
|
-
se !== null ? F = se :
|
|
431
|
+
const se = r(L.width);
|
|
432
|
+
se !== null ? F = se : H.value[T] && (F = r(H.value[T]) ?? F), k.push({ index: T, width: F });
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
for (let T = 0; T < k.length; T++)
|
|
436
|
-
|
|
437
|
-
return
|
|
436
|
+
o.push(v), v += k[T].width;
|
|
437
|
+
return o;
|
|
438
438
|
});
|
|
439
|
-
function ue(
|
|
439
|
+
function ue(o, v) {
|
|
440
440
|
if (v === "left") {
|
|
441
441
|
let k = 0;
|
|
442
|
-
for (let T = 0; T <
|
|
442
|
+
for (let T = 0; T < o; T++)
|
|
443
443
|
e.columns[T].fixed === "left" && k++;
|
|
444
444
|
return k;
|
|
445
445
|
} else {
|
|
446
446
|
let k = 0;
|
|
447
|
-
for (let T = e.columns.length - 1; T >
|
|
447
|
+
for (let T = e.columns.length - 1; T > o; T--)
|
|
448
448
|
e.columns[T].fixed === "right" && k++;
|
|
449
449
|
return k;
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
function pe(
|
|
453
|
-
return typeof e.rowKey == "function" ? e.rowKey(
|
|
452
|
+
function pe(o, v) {
|
|
453
|
+
return typeof e.rowKey == "function" ? e.rowKey(o) : o[e.rowKey] || v;
|
|
454
454
|
}
|
|
455
|
-
function O(
|
|
456
|
-
return e.rowDisabled && typeof e.rowDisabled == "function" ? e.rowDisabled(
|
|
455
|
+
function O(o, v) {
|
|
456
|
+
return e.rowDisabled && typeof e.rowDisabled == "function" ? e.rowDisabled(o, v) : !1;
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
return $.value.has(
|
|
458
|
+
function X(o) {
|
|
459
|
+
return $.value.has(o);
|
|
460
460
|
}
|
|
461
|
-
function le(
|
|
462
|
-
$.value.has(
|
|
461
|
+
function le(o) {
|
|
462
|
+
$.value.has(o) ? $.value.delete(o) : $.value.add(o);
|
|
463
463
|
}
|
|
464
|
-
function he(
|
|
465
|
-
return v.split(".").reduce((k, T) => k == null ? void 0 : k[T],
|
|
464
|
+
function he(o, v) {
|
|
465
|
+
return v.split(".").reduce((k, T) => k == null ? void 0 : k[T], o);
|
|
466
466
|
}
|
|
467
|
-
function
|
|
467
|
+
function He(o, v = !1) {
|
|
468
468
|
const k = [];
|
|
469
|
-
return
|
|
469
|
+
return o.align && k.push(`text-${o.align}`), o.fixed === "right" && (k.push("col-fixed-right"), v && k.push("col-fixed-right-header")), o.fixed === "left" && (k.push("col-fixed-left"), v && k.push("col-fixed-left-header")), k.join(" ");
|
|
470
470
|
}
|
|
471
|
-
function De(
|
|
472
|
-
const T = {}, L = b(
|
|
471
|
+
function De(o, v, k) {
|
|
472
|
+
const T = {}, L = b(o.width);
|
|
473
473
|
if (L)
|
|
474
474
|
T.width = L, T.minWidth = L, T.maxWidth = L;
|
|
475
475
|
else {
|
|
476
476
|
const F = q();
|
|
477
477
|
T.width = F, T.minWidth = F, T.maxWidth = F;
|
|
478
478
|
}
|
|
479
|
-
if (
|
|
479
|
+
if (o.fixed === "left") {
|
|
480
480
|
const F = ue(v, "left"), se = G.value[F] || 0;
|
|
481
481
|
T.left = `${se}px`, T.zIndex = k ? `${10 + F}` : `${5 + F}`;
|
|
482
|
-
} else if (
|
|
482
|
+
} else if (o.fixed === "right") {
|
|
483
483
|
const F = ue(v, "right"), se = re.value[F] || 0;
|
|
484
484
|
k ? T.right = `${se - 3}px` : T.right = `${se}px`, T.zIndex = k ? `${10 + F}` : `${5 + F}`;
|
|
485
485
|
}
|
|
486
486
|
return T;
|
|
487
487
|
}
|
|
488
|
-
function u(
|
|
489
|
-
const k = he(
|
|
490
|
-
return v.formatter ? v.formatter(k,
|
|
488
|
+
function u(o, v) {
|
|
489
|
+
const k = he(o, v.key);
|
|
490
|
+
return v.formatter ? v.formatter(k, o) : k || "";
|
|
491
491
|
}
|
|
492
|
-
function y(
|
|
493
|
-
const v = w.value.find((T, L) => pe(T, L) ===
|
|
494
|
-
v && k >= 0 && O(v, k) || (
|
|
492
|
+
function y(o) {
|
|
493
|
+
const v = w.value.find((T, L) => pe(T, L) === o), k = w.value.findIndex((T, L) => pe(T, L) === o);
|
|
494
|
+
v && k >= 0 && O(v, k) || (i.value.includes(o) ? i.value = i.value.filter((T) => T !== o) : i.value = [...i.value, o], l("select", i.value), l("update:selectedItems", i.value));
|
|
495
495
|
}
|
|
496
496
|
function E() {
|
|
497
|
-
const
|
|
498
|
-
if (
|
|
499
|
-
if (
|
|
500
|
-
|
|
497
|
+
const o = w.value.map((v, k) => ({ key: pe(v, k), item: v, index: k })).filter(({ item: v, index: k }) => !O(v, k)).map(({ key: v }) => v);
|
|
498
|
+
if (o.length !== 0) {
|
|
499
|
+
if (o.every((v) => i.value.includes(v)))
|
|
500
|
+
i.value = i.value.filter((v) => !o.includes(v));
|
|
501
501
|
else {
|
|
502
|
-
const v = /* @__PURE__ */ new Set([...
|
|
503
|
-
|
|
502
|
+
const v = /* @__PURE__ */ new Set([...i.value, ...o]);
|
|
503
|
+
i.value = Array.from(v);
|
|
504
504
|
}
|
|
505
|
-
l("select",
|
|
505
|
+
l("select", i.value), l("update:selectedItems", i.value);
|
|
506
506
|
}
|
|
507
507
|
}
|
|
508
|
-
function
|
|
509
|
-
|
|
508
|
+
function Q() {
|
|
509
|
+
i.value = [], l("select", i.value), l("update:selectedItems", i.value);
|
|
510
510
|
}
|
|
511
|
-
function
|
|
511
|
+
function Ce(o, v) {
|
|
512
512
|
if (!e.rowSelectable) return;
|
|
513
|
-
const k = pe(
|
|
514
|
-
O(
|
|
513
|
+
const k = pe(o, v);
|
|
514
|
+
O(o, v) || (e.requireDeselectBeforeSelect ? S.value.includes(k) ? (S.value = S.value.filter((T) => T !== k), l("row-click", o, null)) : (S.value = [...S.value, k], l("row-click", o, k)) : S.value.includes(k) ? (S.value = [], l("row-click", o, null)) : (S.value = [k], l("row-click", o, k)));
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function xe(o, v) {
|
|
517
517
|
if (!e.rowSelectable) return !1;
|
|
518
|
-
const k = pe(
|
|
518
|
+
const k = pe(o, v);
|
|
519
519
|
return S.value.includes(k);
|
|
520
520
|
}
|
|
521
|
-
ge(() => e.selectedItems, (
|
|
522
|
-
if (
|
|
523
|
-
const v = new Set(
|
|
524
|
-
(v.size !== k.size || ![...v].every((T) => k.has(T))) && (
|
|
525
|
-
} else
|
|
521
|
+
ge(() => e.selectedItems, (o) => {
|
|
522
|
+
if (o !== void 0 && Array.isArray(o)) {
|
|
523
|
+
const v = new Set(i.value), k = new Set(o);
|
|
524
|
+
(v.size !== k.size || ![...v].every((T) => k.has(T))) && (i.value = [...o]);
|
|
525
|
+
} else o === void 0 && i.value.length > 0 && (i.value = []);
|
|
526
526
|
}, { deep: !0, immediate: !0 }), ge(() => e.searchKeyword, () => {
|
|
527
527
|
m.value = 1;
|
|
528
528
|
}), ge(() => e.data, () => {
|
|
529
529
|
e.total || (m.value = 1), e.rowSelectable && (S.value = []);
|
|
530
530
|
}, { deep: !0 });
|
|
531
|
-
function Te(
|
|
532
|
-
m.value =
|
|
531
|
+
function Te(o) {
|
|
532
|
+
m.value = o, e.rowSelectable && (S.value = []), l("page-change", o);
|
|
533
533
|
}
|
|
534
|
-
function Ae(
|
|
535
|
-
h.value =
|
|
534
|
+
function Ae(o) {
|
|
535
|
+
h.value = o, m.value = 1, e.rowSelectable && (S.value = []), l("page-size-change", o);
|
|
536
536
|
}
|
|
537
|
-
ge(() => e.currentPage, (
|
|
538
|
-
const v = typeof
|
|
537
|
+
ge(() => e.currentPage, (o) => {
|
|
538
|
+
const v = typeof o == "number" && o > 0 ? o : 1;
|
|
539
539
|
m.value !== v && (m.value = v);
|
|
540
|
-
}), ge(() => e.pageSize, (
|
|
541
|
-
const v = typeof
|
|
540
|
+
}), ge(() => e.pageSize, (o) => {
|
|
541
|
+
const v = typeof o == "number" && o > 0 ? o : 10;
|
|
542
542
|
h.value !== v && (h.value = v);
|
|
543
543
|
});
|
|
544
544
|
function qe() {
|
|
545
545
|
C.value && oe(() => {
|
|
546
|
-
const
|
|
546
|
+
const o = C.value.getBoundingClientRect(), v = window.innerHeight, k = o.top, T = C.value.querySelector(".table-header"), L = T ? T.offsetHeight : 40;
|
|
547
547
|
let F = 0;
|
|
548
548
|
if (e.pagination) {
|
|
549
549
|
const ct = C.value.querySelector(".ypagination");
|
|
550
550
|
F = ct ? ct.offsetHeight : 60;
|
|
551
551
|
}
|
|
552
552
|
const se = C.value.querySelector(".bulk-bar"), Ne = se ? se.offsetHeight : 0, st = L + F + Ne + 20, it = v - k - st, Tt = Math.max(200, it), wt = C.value.querySelector(".table-body-wrap .table");
|
|
553
|
-
wt && (wt.offsetHeight > it ?
|
|
553
|
+
wt && (wt.offsetHeight > it ? M.value = `${Tt}px` : M.value = "none");
|
|
554
554
|
});
|
|
555
555
|
}
|
|
556
556
|
let Qe = !1;
|
|
@@ -564,10 +564,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
564
564
|
Qe = !1;
|
|
565
565
|
}));
|
|
566
566
|
}
|
|
567
|
-
function
|
|
567
|
+
function Me() {
|
|
568
568
|
oe(() => {
|
|
569
569
|
if (!g.value) return;
|
|
570
|
-
const
|
|
570
|
+
const o = g.value, v = o.scrollHeight, k = o.clientHeight, T = o.scrollTop, L = v > k + 1;
|
|
571
571
|
if (Y.value.show = L, !L) return;
|
|
572
572
|
const F = 24, se = k / v, Ne = te.value ? te.value.clientHeight : k, Re = Math.max(F, Math.floor(Ne * se));
|
|
573
573
|
Y.value.thumbHeight = Re;
|
|
@@ -575,34 +575,34 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
575
575
|
Y.value.thumbTop = Math.min(st, Math.floor(T / it * st));
|
|
576
576
|
});
|
|
577
577
|
}
|
|
578
|
-
function Ye(
|
|
579
|
-
if (!
|
|
580
|
-
|
|
581
|
-
const v = te.value.clientHeight, k = Math.max(0, v - Y.value.thumbHeight), T = g.value, L = T.scrollHeight, F = T.clientHeight, se = Math.max(1, L - F), Re = (
|
|
582
|
-
T.scrollTop = Math.min(se, Math.max(0, U + Re)),
|
|
578
|
+
function Ye(o) {
|
|
579
|
+
if (!J || !g.value || !te.value) return;
|
|
580
|
+
o.preventDefault();
|
|
581
|
+
const v = te.value.clientHeight, k = Math.max(0, v - Y.value.thumbHeight), T = g.value, L = T.scrollHeight, F = T.clientHeight, se = Math.max(1, L - F), Re = (o.clientY - ne) / Math.max(1, k) * se;
|
|
582
|
+
T.scrollTop = Math.min(se, Math.max(0, U + Re)), Me();
|
|
583
583
|
}
|
|
584
584
|
function gt() {
|
|
585
|
-
|
|
585
|
+
J = !1, window.removeEventListener("mousemove", Ye), window.removeEventListener("mouseup", gt);
|
|
586
586
|
}
|
|
587
587
|
function pt() {
|
|
588
588
|
oe(() => {
|
|
589
589
|
var k, T;
|
|
590
|
-
if (
|
|
590
|
+
if (H.value.length === e.columns.length && H.value.every((L) => !!L))
|
|
591
591
|
return;
|
|
592
|
-
const
|
|
592
|
+
const o = [];
|
|
593
593
|
e.columns.forEach((L, F) => {
|
|
594
594
|
const se = b(L.width);
|
|
595
595
|
if (se)
|
|
596
|
-
|
|
596
|
+
o.push(se), W.value[L.key] = se;
|
|
597
597
|
else if (W.value[L.key])
|
|
598
|
-
|
|
598
|
+
o.push(W.value[L.key]);
|
|
599
599
|
else {
|
|
600
|
-
const Ne =
|
|
600
|
+
const Ne = H.value[F];
|
|
601
601
|
if (Ne)
|
|
602
|
-
|
|
602
|
+
o.push(Ne), W.value[L.key] = Ne;
|
|
603
603
|
else {
|
|
604
604
|
const Re = q();
|
|
605
|
-
|
|
605
|
+
o.push(Re), W.value[L.key] = Re;
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
});
|
|
@@ -610,23 +610,23 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
610
610
|
if (v) {
|
|
611
611
|
const L = e.selectable ? 1 : 0, F = Array.from(v.children);
|
|
612
612
|
for (let se = 0; se < e.columns.length; se++)
|
|
613
|
-
if (!
|
|
613
|
+
if (!o[se]) {
|
|
614
614
|
const Ne = F[L + se];
|
|
615
615
|
if (Ne && Ne.clientWidth > 0) {
|
|
616
616
|
const Re = `${Ne.clientWidth}px`;
|
|
617
|
-
|
|
617
|
+
o[se] = Re, W.value[e.columns[se].key] = Re;
|
|
618
618
|
} else {
|
|
619
619
|
const Re = q();
|
|
620
|
-
|
|
620
|
+
o[se] = Re, W.value[e.columns[se].key] = Re;
|
|
621
621
|
}
|
|
622
622
|
}
|
|
623
623
|
} else
|
|
624
|
-
for (let L = 0; L <
|
|
625
|
-
if (!
|
|
624
|
+
for (let L = 0; L < o.length; L++)
|
|
625
|
+
if (!o[L]) {
|
|
626
626
|
const F = W.value[((T = e.columns[L]) == null ? void 0 : T.key) || ""];
|
|
627
|
-
|
|
627
|
+
o[L] = F || H.value[L] || "80px", e.columns[L] && (W.value[e.columns[L].key] = o[L]);
|
|
628
628
|
}
|
|
629
|
-
|
|
629
|
+
H.value = o;
|
|
630
630
|
});
|
|
631
631
|
}
|
|
632
632
|
function at() {
|
|
@@ -641,24 +641,24 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
641
641
|
qe(), Je(), Ue();
|
|
642
642
|
});
|
|
643
643
|
}), ge(() => e.columns, () => {
|
|
644
|
-
const
|
|
644
|
+
const o = [], v = { ...W.value };
|
|
645
645
|
e.columns.forEach((T, L) => {
|
|
646
646
|
const F = b(T.width);
|
|
647
|
-
F ? (
|
|
647
|
+
F ? (o.push(F), v[T.key] = F) : v[T.key] ? o.push(v[T.key]) : H.value[L] ? (o.push(H.value[L]), v[T.key] = H.value[L]) : o.push("");
|
|
648
648
|
});
|
|
649
649
|
const k = new Set(e.columns.map((T) => T.key));
|
|
650
650
|
Object.keys(v).forEach((T) => {
|
|
651
651
|
k.has(T) || delete v[T];
|
|
652
|
-
}), W.value = v,
|
|
652
|
+
}), W.value = v, H.value = o, oe(() => {
|
|
653
653
|
pt(), Je(), Ue(), ot();
|
|
654
654
|
});
|
|
655
655
|
}, { deep: !0 });
|
|
656
656
|
function yt() {
|
|
657
657
|
oe(() => {
|
|
658
658
|
if (!c.value) return;
|
|
659
|
-
const
|
|
660
|
-
if (
|
|
661
|
-
const v =
|
|
659
|
+
const o = c.value.querySelector(".table");
|
|
660
|
+
if (o && i.value.length === 0) {
|
|
661
|
+
const v = o.querySelector("thead th:not(.col-select):not(.col-expand)");
|
|
662
662
|
v && v.offsetHeight > 0 && (R.value = v.offsetHeight);
|
|
663
663
|
}
|
|
664
664
|
});
|
|
@@ -666,9 +666,9 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
666
666
|
function ot() {
|
|
667
667
|
oe(() => {
|
|
668
668
|
if (!c.value) return;
|
|
669
|
-
const
|
|
670
|
-
if (!
|
|
671
|
-
const v =
|
|
669
|
+
const o = c.value.querySelector(".table");
|
|
670
|
+
if (!o) return;
|
|
671
|
+
const v = o.querySelector(".col-selected-header");
|
|
672
672
|
if (v) {
|
|
673
673
|
const k = v.querySelector(".selected-header-wrapper");
|
|
674
674
|
k && (k.style.height = `${R.value}px`);
|
|
@@ -676,7 +676,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
676
676
|
yt();
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
ge(() =>
|
|
679
|
+
ge(() => i.value, () => {
|
|
680
680
|
oe(() => {
|
|
681
681
|
qe(), Ue(), ot();
|
|
682
682
|
});
|
|
@@ -685,25 +685,25 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
685
685
|
Ue();
|
|
686
686
|
});
|
|
687
687
|
}), Fe(() => {
|
|
688
|
-
var
|
|
688
|
+
var o, v;
|
|
689
689
|
oe(() => {
|
|
690
|
-
qe(), pt(), Ue(),
|
|
691
|
-
}), window.addEventListener("resize", at), window.addEventListener("scroll", at, !0), (
|
|
692
|
-
Je(),
|
|
690
|
+
qe(), pt(), Ue(), Me(), yt(), ot();
|
|
691
|
+
}), window.addEventListener("resize", at), window.addEventListener("scroll", at, !0), (o = g.value) == null || o.addEventListener("scroll", () => {
|
|
692
|
+
Je(), Me(), Ue();
|
|
693
693
|
}, { passive: !0 }), (v = c.value) == null || v.addEventListener("scroll", () => {
|
|
694
694
|
et();
|
|
695
695
|
}, { passive: !0 }), oe(() => Je()), g.value && typeof ResizeObserver < "u" && (tt = new ResizeObserver(() => {
|
|
696
696
|
Ue();
|
|
697
697
|
}), tt.observe(g.value));
|
|
698
698
|
}), Oe(() => {
|
|
699
|
-
var
|
|
700
|
-
window.removeEventListener("resize", at), window.removeEventListener("scroll", at, !0), (
|
|
699
|
+
var o, v;
|
|
700
|
+
window.removeEventListener("resize", at), window.removeEventListener("scroll", at, !0), (o = g.value) == null || o.removeEventListener("scroll", Je), (v = c.value) == null || v.removeEventListener("scroll", et), window.removeEventListener("mousemove", Ye), window.removeEventListener("mouseup", gt), tt && (tt.disconnect(), tt = null);
|
|
701
701
|
});
|
|
702
702
|
let mt = -1;
|
|
703
703
|
function Ue() {
|
|
704
704
|
!c.value || !g.value || requestAnimationFrame(() => {
|
|
705
705
|
if (!c.value || !g.value) return;
|
|
706
|
-
const
|
|
706
|
+
const o = g.value, v = Math.ceil(o.offsetWidth - o.clientWidth);
|
|
707
707
|
if (ae.value = v, v !== mt) {
|
|
708
708
|
mt = v;
|
|
709
709
|
const k = c.value.querySelector(".table"), T = x.value;
|
|
@@ -714,26 +714,26 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
714
714
|
let tt = null;
|
|
715
715
|
return Oe(() => {
|
|
716
716
|
D.value.clear();
|
|
717
|
-
}), (
|
|
717
|
+
}), (o, v) => {
|
|
718
718
|
const k = nt("YButton"), T = nt("YPagination");
|
|
719
719
|
return d(), p("div", {
|
|
720
720
|
class: "ytable-container",
|
|
721
721
|
ref_key: "tableContainer",
|
|
722
722
|
ref: C
|
|
723
723
|
}, [
|
|
724
|
-
|
|
724
|
+
Ie(Ve, { name: "bulk-slide" }, {
|
|
725
725
|
default: $e(() => [
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
selectedItems:
|
|
731
|
-
clearSelection:
|
|
726
|
+
i.value.length && t.showBulkActions ? (d(), p("div", Zt, [
|
|
727
|
+
s("div", Qt, "已选择 " + we(i.value.length) + " 项", 1),
|
|
728
|
+
s("div", Jt, [
|
|
729
|
+
ke(o.$slots, "bulk-actions", {
|
|
730
|
+
selectedItems: i.value,
|
|
731
|
+
clearSelection: Q
|
|
732
732
|
}, () => [
|
|
733
|
-
|
|
733
|
+
Ie(k, {
|
|
734
734
|
size: "small",
|
|
735
735
|
class: "btn",
|
|
736
|
-
onClick:
|
|
736
|
+
onClick: Q
|
|
737
737
|
}, {
|
|
738
738
|
default: $e(() => [...v[3] || (v[3] = [
|
|
739
739
|
We("清除选择", -1)
|
|
@@ -746,15 +746,15 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
746
746
|
]),
|
|
747
747
|
_: 3
|
|
748
748
|
}),
|
|
749
|
-
|
|
749
|
+
s("div", Xt, [
|
|
750
750
|
z.value ? (d(), p("div", el, [
|
|
751
|
-
|
|
751
|
+
s("button", {
|
|
752
752
|
class: Z(["toggle-all-hints-btn", { "is-expanded": j.value }]),
|
|
753
753
|
onClick: fe,
|
|
754
754
|
title: j.value ? "收起所有提示标签" : "展开所有提示标签"
|
|
755
755
|
}, [
|
|
756
756
|
j.value ? (d(), p("svg", ll, [...v[4] || (v[4] = [
|
|
757
|
-
|
|
757
|
+
s("path", {
|
|
758
758
|
d: "M15 18L9 12L15 6",
|
|
759
759
|
stroke: "currentColor",
|
|
760
760
|
"stroke-width": "2",
|
|
@@ -762,7 +762,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
762
762
|
"stroke-linejoin": "round"
|
|
763
763
|
}, null, -1)
|
|
764
764
|
])])) : (d(), p("svg", nl, [...v[5] || (v[5] = [
|
|
765
|
-
|
|
765
|
+
s("path", {
|
|
766
766
|
d: "M9 18L15 12L9 6",
|
|
767
767
|
stroke: "currentColor",
|
|
768
768
|
"stroke-width": "2",
|
|
@@ -772,96 +772,108 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
772
772
|
])]))
|
|
773
773
|
], 10, tl)
|
|
774
774
|
])) : V("", !0),
|
|
775
|
-
t.selectedHeaderFloat &&
|
|
776
|
-
|
|
777
|
-
selectedItems:
|
|
778
|
-
clearSelection:
|
|
775
|
+
t.selectedHeaderFloat && i.value.length > 0 && o.$slots["selected-header"] ? (d(), p("div", al, [
|
|
776
|
+
ke(o.$slots, "selected-header", {
|
|
777
|
+
selectedItems: i.value,
|
|
778
|
+
clearSelection: Q
|
|
779
779
|
}, void 0, !0)
|
|
780
780
|
])) : V("", !0),
|
|
781
|
-
|
|
781
|
+
s("div", {
|
|
782
782
|
class: "table-header",
|
|
783
783
|
ref_key: "headerRef",
|
|
784
784
|
ref: c
|
|
785
785
|
}, [
|
|
786
|
-
|
|
787
|
-
|
|
786
|
+
s("table", ol, [
|
|
787
|
+
s("colgroup", null, [
|
|
788
788
|
e.expandable ? (d(), p("col", sl)) : V("", !0),
|
|
789
789
|
t.selectable ? (d(), p("col", il)) : V("", !0),
|
|
790
|
-
(d(!0), p(Se, null,
|
|
790
|
+
(d(!0), p(Se, null, Be(t.columns, (L, F) => (d(), p("col", {
|
|
791
791
|
key: L.key,
|
|
792
|
-
style: be({ width:
|
|
792
|
+
style: be({ width: H.value[F] || void 0, minWidth: H.value[F] || "80px" })
|
|
793
793
|
}, null, 4))), 128))
|
|
794
794
|
]),
|
|
795
|
-
|
|
796
|
-
|
|
795
|
+
s("thead", null, [
|
|
796
|
+
s("tr", null, [
|
|
797
797
|
e.expandable ? (d(), p("th", rl)) : V("", !0),
|
|
798
798
|
t.selectable ? (d(), p("th", ul, [
|
|
799
|
-
|
|
800
|
-
|
|
799
|
+
s("div", dl, [
|
|
800
|
+
s("input", {
|
|
801
801
|
type: "checkbox",
|
|
802
802
|
checked: N.value,
|
|
803
|
-
indeterminate:
|
|
803
|
+
indeterminate: B.value,
|
|
804
804
|
disabled: A.value,
|
|
805
805
|
onChange: E
|
|
806
806
|
}, null, 40, cl),
|
|
807
|
-
|
|
807
|
+
i.value.length > 0 ? (d(), p("span", fl, we(i.value.length), 1)) : V("", !0)
|
|
808
808
|
])
|
|
809
809
|
])) : V("", !0),
|
|
810
|
-
|
|
810
|
+
!t.selectedHeaderFloat && i.value.length > 0 && o.$slots["selected-header"] ? (d(), p("th", {
|
|
811
|
+
key: 2,
|
|
812
|
+
colspan: t.columns.length,
|
|
813
|
+
class: "col-selected-header",
|
|
814
|
+
style: { width: "100%" }
|
|
815
|
+
}, [
|
|
816
|
+
s("div", hl, [
|
|
817
|
+
ke(o.$slots, "selected-header", {
|
|
818
|
+
selectedItems: i.value,
|
|
819
|
+
clearSelection: Q
|
|
820
|
+
}, void 0, !0)
|
|
821
|
+
])
|
|
822
|
+
], 8, vl)) : (d(!0), p(Se, { key: 3 }, Be(t.columns, (L, F) => (d(), p("th", {
|
|
811
823
|
key: L.key,
|
|
812
|
-
class: Z(
|
|
824
|
+
class: Z(He(L, !0)),
|
|
813
825
|
style: be(De(L, F, !0))
|
|
814
826
|
}, we(L.title), 7))), 128))
|
|
815
827
|
])
|
|
816
828
|
])
|
|
817
829
|
])
|
|
818
830
|
], 512),
|
|
819
|
-
|
|
831
|
+
s("div", {
|
|
820
832
|
class: Z(["table-body-wrap", { "is-loading": t.loading, "is-empty": !w.value.length && !t.loading }]),
|
|
821
833
|
ref_key: "bodyWrapRef",
|
|
822
834
|
ref: g,
|
|
823
|
-
style: be({ maxHeight:
|
|
835
|
+
style: be({ maxHeight: M.value })
|
|
824
836
|
}, [
|
|
825
|
-
t.loading ? (d(), p("div",
|
|
826
|
-
|
|
827
|
-
|
|
837
|
+
t.loading ? (d(), p("div", gl, [...v[6] || (v[6] = [
|
|
838
|
+
s("div", { class: "loading-spinner" }, null, -1),
|
|
839
|
+
s("div", { class: "loading-text" }, "加载中...", -1)
|
|
828
840
|
])])) : V("", !0),
|
|
829
|
-
!w.value.length && !t.loading ? (d(), p("div",
|
|
830
|
-
|
|
841
|
+
!w.value.length && !t.loading ? (d(), p("div", pl, [
|
|
842
|
+
ke(o.$slots, "empty", {}, () => [
|
|
831
843
|
We(we(t.emptyText), 1)
|
|
832
844
|
], !0)
|
|
833
845
|
])) : V("", !0),
|
|
834
|
-
|
|
846
|
+
s("table", {
|
|
835
847
|
class: Z(["table", { "loading-table": t.loading }]),
|
|
836
848
|
ref_key: "bodyTableRef",
|
|
837
849
|
ref: x
|
|
838
850
|
}, [
|
|
839
|
-
|
|
840
|
-
e.expandable ? (d(), p("col",
|
|
841
|
-
t.selectable ? (d(), p("col",
|
|
842
|
-
(d(!0), p(Se, null,
|
|
851
|
+
s("colgroup", null, [
|
|
852
|
+
e.expandable ? (d(), p("col", yl)) : V("", !0),
|
|
853
|
+
t.selectable ? (d(), p("col", ml)) : V("", !0),
|
|
854
|
+
(d(!0), p(Se, null, Be(t.columns, (L, F) => (d(), p("col", {
|
|
843
855
|
key: L.key,
|
|
844
|
-
style: be({ width:
|
|
856
|
+
style: be({ width: H.value[F] || void 0, minWidth: H.value[F] || "80px" })
|
|
845
857
|
}, null, 4))), 128))
|
|
846
858
|
]),
|
|
847
|
-
|
|
848
|
-
(d(!0), p(Se, null,
|
|
859
|
+
s("tbody", null, [
|
|
860
|
+
(d(!0), p(Se, null, Be(w.value, (L, F) => (d(), p(Se, {
|
|
849
861
|
key: pe(L, F)
|
|
850
862
|
}, [
|
|
851
|
-
|
|
852
|
-
class: Z({ "row-selected":
|
|
853
|
-
onClick: (se) =>
|
|
863
|
+
s("tr", {
|
|
864
|
+
class: Z({ "row-selected": xe(L, F) }),
|
|
865
|
+
onClick: (se) => Ce(L, F)
|
|
854
866
|
}, [
|
|
855
|
-
e.expandable ? (d(), p("td",
|
|
856
|
-
|
|
867
|
+
e.expandable ? (d(), p("td", bl, [
|
|
868
|
+
s("button", {
|
|
857
869
|
class: "expand-btn",
|
|
858
870
|
type: "button",
|
|
859
871
|
onClick: me((se) => le(pe(L, F)), ["stop"])
|
|
860
872
|
}, [
|
|
861
|
-
|
|
862
|
-
class: Z(["expand-icon", { "is-open":
|
|
873
|
+
s("span", {
|
|
874
|
+
class: Z(["expand-icon", { "is-open": X(pe(L, F)) }])
|
|
863
875
|
}, null, 2)
|
|
864
|
-
], 8,
|
|
876
|
+
], 8, kl)
|
|
865
877
|
])) : V("", !0),
|
|
866
878
|
t.selectable ? (d(), p("td", {
|
|
867
879
|
key: 1,
|
|
@@ -869,20 +881,20 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
869
881
|
onClick: v[0] || (v[0] = me(() => {
|
|
870
882
|
}, ["stop"]))
|
|
871
883
|
}, [
|
|
872
|
-
|
|
884
|
+
s("input", {
|
|
873
885
|
type: "checkbox",
|
|
874
886
|
value: pe(L, F),
|
|
875
|
-
checked:
|
|
887
|
+
checked: i.value.includes(pe(L, F)),
|
|
876
888
|
disabled: O(L, F),
|
|
877
889
|
onChange: me((se) => y(pe(L, F)), ["stop"])
|
|
878
|
-
}, null, 40,
|
|
890
|
+
}, null, 40, Cl)
|
|
879
891
|
])) : V("", !0),
|
|
880
|
-
(d(!0), p(Se, null,
|
|
892
|
+
(d(!0), p(Se, null, Be(t.columns, (se, Ne) => (d(), p("td", {
|
|
881
893
|
key: se.key,
|
|
882
|
-
class: Z(
|
|
894
|
+
class: Z(He(se)),
|
|
883
895
|
style: be(De(se, Ne, !1))
|
|
884
896
|
}, [
|
|
885
|
-
|
|
897
|
+
ke(o.$slots, `cell-${se.key}`, {
|
|
886
898
|
item: L,
|
|
887
899
|
value: he(L, se.key),
|
|
888
900
|
index: F
|
|
@@ -890,20 +902,20 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
890
902
|
We(we(u(L, se)), 1)
|
|
891
903
|
], !0)
|
|
892
904
|
], 6))), 128))
|
|
893
|
-
], 10,
|
|
894
|
-
e.expandable &&
|
|
905
|
+
], 10, wl),
|
|
906
|
+
e.expandable && X(pe(L, F)) ? (d(), p("tr", {
|
|
895
907
|
key: `${pe(L, F)}-expand`,
|
|
896
908
|
class: "expand-row"
|
|
897
909
|
}, [
|
|
898
|
-
|
|
910
|
+
s("td", {
|
|
899
911
|
colspan: n.value,
|
|
900
912
|
class: "expand-cell"
|
|
901
913
|
}, [
|
|
902
|
-
|
|
914
|
+
ke(o.$slots, "expand", {
|
|
903
915
|
item: L,
|
|
904
916
|
index: F
|
|
905
917
|
}, void 0, !0)
|
|
906
|
-
], 8,
|
|
918
|
+
], 8, xl)
|
|
907
919
|
])) : V("", !0)
|
|
908
920
|
], 64))), 128))
|
|
909
921
|
])
|
|
@@ -926,22 +938,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
926
938
|
], 512);
|
|
927
939
|
};
|
|
928
940
|
}
|
|
929
|
-
}),
|
|
941
|
+
}), $l = /* @__PURE__ */ ze(Dl, [["__scopeId", "data-v-1749b08e"]]), Sl = ["onKeydown", "aria-expanded"], Il = {
|
|
930
942
|
key: 0,
|
|
931
943
|
class: "yselect__tags"
|
|
932
|
-
},
|
|
944
|
+
}, Ml = ["src"], Tl = { class: "yselect__tag-text" }, Ll = ["onClick"], El = {
|
|
933
945
|
key: 1,
|
|
934
946
|
class: "yselect__placeholder-text"
|
|
935
|
-
},
|
|
947
|
+
}, Hl = ["src"], Bl = ["placeholder", "onKeydown"], _l = ["onClick", "onMouseenter"], zl = {
|
|
936
948
|
key: 0,
|
|
937
949
|
class: "yselect__option-check"
|
|
938
|
-
},
|
|
950
|
+
}, Nl = {
|
|
939
951
|
key: 0,
|
|
940
952
|
width: "14",
|
|
941
953
|
height: "14",
|
|
942
954
|
viewBox: "0 0 14 14",
|
|
943
955
|
fill: "none"
|
|
944
|
-
},
|
|
956
|
+
}, Kl = ["src"], Wl = /* @__PURE__ */ _e({
|
|
945
957
|
__name: "yselect",
|
|
946
958
|
props: {
|
|
947
959
|
modelValue: {},
|
|
@@ -961,11 +973,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
961
973
|
},
|
|
962
974
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
963
975
|
setup(t, { emit: f }) {
|
|
964
|
-
const e = t, l = f, m =
|
|
976
|
+
const e = t, l = f, m = I(!1), h = I(-1), i = I(), S = I(), $ = I(), M = I(!1), C = I(), c = I(""), g = _(() => e.multiple ? null : e.options.find((b) => z(b) === e.modelValue) || null), x = _(() => {
|
|
965
977
|
if (!e.multiple) return [];
|
|
966
978
|
const b = Array.isArray(e.modelValue) ? e.modelValue : [];
|
|
967
|
-
return e.options.filter((
|
|
968
|
-
}),
|
|
979
|
+
return e.options.filter((r) => b.includes(z(r)));
|
|
980
|
+
}), H = _(() => {
|
|
969
981
|
if (e.multiple) {
|
|
970
982
|
const b = x.value.length;
|
|
971
983
|
return b === 0 ? "" : `已选择 ${b} 项`;
|
|
@@ -974,23 +986,23 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
974
986
|
}), W = _(() => {
|
|
975
987
|
if (!e.filterable) return e.options;
|
|
976
988
|
const b = c.value.trim().toLowerCase();
|
|
977
|
-
return b ? e.options.filter((
|
|
978
|
-
const n = j(
|
|
989
|
+
return b ? e.options.filter((r) => {
|
|
990
|
+
const n = j(r);
|
|
979
991
|
return String(n).toLowerCase().includes(b);
|
|
980
992
|
}) : e.options;
|
|
981
993
|
}), R = _(() => {
|
|
982
994
|
var w;
|
|
983
|
-
const b = { position: "fixed", zIndex: "100001" },
|
|
984
|
-
if (!
|
|
985
|
-
const n =
|
|
986
|
-
return b.left = `${n.left}px`, b.width = `${a}px`,
|
|
995
|
+
const b = { position: "fixed", zIndex: "100001" }, r = S.value;
|
|
996
|
+
if (!r) return b;
|
|
997
|
+
const n = r.getBoundingClientRect(), a = ((w = $.value) == null ? void 0 : w.getBoundingClientRect().width) || n.width;
|
|
998
|
+
return b.left = `${n.left}px`, b.width = `${a}px`, M.value ? (b.bottom = `${window.innerHeight - n.top + 4}px`, b.top = "auto") : b.top = `${n.bottom + 4}px`, b;
|
|
987
999
|
});
|
|
988
1000
|
function D() {
|
|
989
1001
|
!m.value || !S.value || oe(() => {
|
|
990
1002
|
const b = S.value;
|
|
991
1003
|
if (!b) return;
|
|
992
|
-
const
|
|
993
|
-
|
|
1004
|
+
const r = b.getBoundingClientRect(), n = window.innerHeight, a = 200, w = r.bottom + a + 4, N = r.top - a - 4, B = w <= n - 20, A = N >= 20;
|
|
1005
|
+
M.value = !B && A;
|
|
994
1006
|
});
|
|
995
1007
|
}
|
|
996
1008
|
function z(b) {
|
|
@@ -999,8 +1011,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
999
1011
|
function j(b) {
|
|
1000
1012
|
return typeof b == "object" && b !== null ? b[e.labelKey] || String(b[e.valueKey]) : String(b);
|
|
1001
1013
|
}
|
|
1002
|
-
function ye(b,
|
|
1003
|
-
return typeof b == "object" && b !== null && b.id !== void 0 ? b.id : z(b) ||
|
|
1014
|
+
function ye(b, r) {
|
|
1015
|
+
return typeof b == "object" && b !== null && b.id !== void 0 ? b.id : z(b) || r;
|
|
1004
1016
|
}
|
|
1005
1017
|
function de(b) {
|
|
1006
1018
|
return e.multiple ? (Array.isArray(e.modelValue) ? e.modelValue : []).includes(z(b)) : z(b) === e.modelValue;
|
|
@@ -1013,13 +1025,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1013
1025
|
}
|
|
1014
1026
|
function fe() {
|
|
1015
1027
|
e.disabled || (m.value = !0, oe(() => {
|
|
1016
|
-
D(),
|
|
1028
|
+
D(), J(), e.filterable && C.value && (C.value.focus(), c.value = "");
|
|
1017
1029
|
}));
|
|
1018
1030
|
}
|
|
1019
1031
|
function ve() {
|
|
1020
|
-
m.value = !1, h.value = -1,
|
|
1032
|
+
m.value = !1, h.value = -1, M.value = !1, e.filterable && (c.value = "");
|
|
1021
1033
|
}
|
|
1022
|
-
function ce(b,
|
|
1034
|
+
function ce(b, r) {
|
|
1023
1035
|
if (K(b)) return;
|
|
1024
1036
|
const n = z(b);
|
|
1025
1037
|
if (e.multiple) {
|
|
@@ -1033,8 +1045,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1033
1045
|
const b = e.multiple ? e.clearTo !== void 0 ? e.clearTo : [] : e.clearTo;
|
|
1034
1046
|
l("update:modelValue", b), l("change", b, e.multiple ? [] : null), l("clear"), e.multiple || ve();
|
|
1035
1047
|
}
|
|
1036
|
-
function q(b,
|
|
1037
|
-
if (
|
|
1048
|
+
function q(b, r) {
|
|
1049
|
+
if (r.stopPropagation(), e.disabled || !e.multiple) return;
|
|
1038
1050
|
const n = Array.isArray(e.modelValue) ? [...e.modelValue] : [], a = z(b), w = n.indexOf(a);
|
|
1039
1051
|
w > -1 && (n.splice(w, 1), l("update:modelValue", n), l("change", n, x.value));
|
|
1040
1052
|
}
|
|
@@ -1043,32 +1055,32 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1043
1055
|
h.value = -1;
|
|
1044
1056
|
return;
|
|
1045
1057
|
}
|
|
1046
|
-
let
|
|
1058
|
+
let r = h.value;
|
|
1047
1059
|
const n = W.value.length;
|
|
1048
|
-
|
|
1060
|
+
r === -1 ? r = b > 0 ? 0 : n - 1 : r = (r + b + n) % n;
|
|
1049
1061
|
let a = 0;
|
|
1050
|
-
for (; a < n && K(W.value[
|
|
1051
|
-
|
|
1052
|
-
h.value = a >= n ? -1 :
|
|
1062
|
+
for (; a < n && K(W.value[r]); )
|
|
1063
|
+
r = (r + b + n) % n, a++;
|
|
1064
|
+
h.value = a >= n ? -1 : r, ne();
|
|
1053
1065
|
}
|
|
1054
1066
|
function Y() {
|
|
1055
1067
|
if (h.value < 0) return;
|
|
1056
1068
|
const b = W.value[h.value];
|
|
1057
1069
|
!b || K(b) || ce(b, h.value);
|
|
1058
1070
|
}
|
|
1059
|
-
function
|
|
1060
|
-
if (!
|
|
1061
|
-
const b =
|
|
1071
|
+
function J() {
|
|
1072
|
+
if (!i.value) return;
|
|
1073
|
+
const b = i.value.querySelector(".yselect__option--selected");
|
|
1062
1074
|
b && b.scrollIntoView({ block: "nearest" });
|
|
1063
1075
|
}
|
|
1064
1076
|
function ne() {
|
|
1065
|
-
if (!
|
|
1066
|
-
const
|
|
1067
|
-
|
|
1077
|
+
if (!i.value || h.value < 0) return;
|
|
1078
|
+
const r = i.value.querySelectorAll(".yselect__option")[h.value];
|
|
1079
|
+
r && r.scrollIntoView({ block: "nearest" });
|
|
1068
1080
|
}
|
|
1069
1081
|
function U(b) {
|
|
1070
|
-
const
|
|
1071
|
-
(!$.value || !$.value.contains(
|
|
1082
|
+
const r = b.target;
|
|
1083
|
+
(!$.value || !$.value.contains(r)) && ve();
|
|
1072
1084
|
}
|
|
1073
1085
|
ge(() => e.modelValue, () => {
|
|
1074
1086
|
h.value = -1;
|
|
@@ -1080,13 +1092,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1080
1092
|
document.addEventListener("click", U), window.addEventListener("resize", ae), window.addEventListener("scroll", ae, !0);
|
|
1081
1093
|
}), Oe(() => {
|
|
1082
1094
|
document.removeEventListener("click", U), window.removeEventListener("resize", ae), window.removeEventListener("scroll", ae, !0);
|
|
1083
|
-
}), (b,
|
|
1095
|
+
}), (b, r) => (d(), p("div", {
|
|
1084
1096
|
class: Z(["yselect", { "yselect--disabled": t.disabled, [`yselect--${t.size}`]: !0 }]),
|
|
1085
1097
|
style: be({ width: t.width }),
|
|
1086
1098
|
ref_key: "selectContainer",
|
|
1087
1099
|
ref: $
|
|
1088
1100
|
}, [
|
|
1089
|
-
|
|
1101
|
+
s("div", {
|
|
1090
1102
|
ref_key: "triggerElement",
|
|
1091
1103
|
ref: S,
|
|
1092
1104
|
class: Z(["yselect__trigger", {
|
|
@@ -1109,18 +1121,18 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1109
1121
|
}, [
|
|
1110
1122
|
!t.filterable || !m.value ? (d(), p("span", {
|
|
1111
1123
|
key: 0,
|
|
1112
|
-
class: Z(["yselect__value", { yselect__placeholder: !
|
|
1124
|
+
class: Z(["yselect__value", { yselect__placeholder: !H.value }])
|
|
1113
1125
|
}, [
|
|
1114
|
-
|
|
1126
|
+
ke(b.$slots, "value", {
|
|
1115
1127
|
value: e.multiple ? x.value : g.value,
|
|
1116
|
-
label:
|
|
1128
|
+
label: H.value,
|
|
1117
1129
|
multiple: e.multiple
|
|
1118
1130
|
}, () => {
|
|
1119
1131
|
var n;
|
|
1120
1132
|
return [
|
|
1121
1133
|
e.multiple ? (d(), p(Se, { key: 0 }, [
|
|
1122
|
-
x.value.length > 0 ? (d(), p("div",
|
|
1123
|
-
(d(!0), p(Se, null,
|
|
1134
|
+
x.value.length > 0 ? (d(), p("div", Il, [
|
|
1135
|
+
(d(!0), p(Se, null, Be(x.value, (a, w) => (d(), p("span", {
|
|
1124
1136
|
key: ye(a, w),
|
|
1125
1137
|
class: "yselect__tag"
|
|
1126
1138
|
}, [
|
|
@@ -1129,29 +1141,29 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1129
1141
|
class: "yselect__flag",
|
|
1130
1142
|
src: a.flagImg,
|
|
1131
1143
|
alt: "flag"
|
|
1132
|
-
}, null, 8,
|
|
1133
|
-
|
|
1144
|
+
}, null, 8, Ml)) : V("", !0),
|
|
1145
|
+
s("span", Tl, we(j(a)), 1),
|
|
1134
1146
|
t.clearable && !t.disabled ? (d(), p("span", {
|
|
1135
1147
|
key: 1,
|
|
1136
1148
|
class: "yselect__tag-close",
|
|
1137
1149
|
onClick: me((N) => q(a, N), ["stop"])
|
|
1138
|
-
}, [...
|
|
1139
|
-
|
|
1150
|
+
}, [...r[8] || (r[8] = [
|
|
1151
|
+
s("svg", {
|
|
1140
1152
|
width: "10",
|
|
1141
1153
|
height: "10",
|
|
1142
1154
|
viewBox: "0 0 10 10",
|
|
1143
1155
|
fill: "none"
|
|
1144
1156
|
}, [
|
|
1145
|
-
|
|
1157
|
+
s("path", {
|
|
1146
1158
|
d: "M2.5 2.5l5 5M7.5 2.5l-5 5",
|
|
1147
1159
|
stroke: "currentColor",
|
|
1148
1160
|
"stroke-width": "1.2",
|
|
1149
1161
|
"stroke-linecap": "round"
|
|
1150
1162
|
})
|
|
1151
1163
|
], -1)
|
|
1152
|
-
])], 8,
|
|
1164
|
+
])], 8, Ll)) : V("", !0)
|
|
1153
1165
|
]))), 128))
|
|
1154
|
-
])) : (d(), p("span",
|
|
1166
|
+
])) : (d(), p("span", El, we(t.placeholder), 1))
|
|
1155
1167
|
], 64)) : (d(), p(Se, { key: 1 }, [
|
|
1156
1168
|
g.value ? (d(), p(Se, { key: 0 }, [
|
|
1157
1169
|
(n = g.value) != null && n.flagImg ? (d(), p("img", {
|
|
@@ -1159,8 +1171,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1159
1171
|
class: "yselect__flag",
|
|
1160
1172
|
src: g.value.flagImg,
|
|
1161
1173
|
alt: "flag"
|
|
1162
|
-
}, null, 8,
|
|
1163
|
-
We(" " + we(
|
|
1174
|
+
}, null, 8, Hl)) : V("", !0),
|
|
1175
|
+
We(" " + we(H.value), 1)
|
|
1164
1176
|
], 64)) : (d(), p(Se, { key: 1 }, [
|
|
1165
1177
|
We(we(t.placeholder), 1)
|
|
1166
1178
|
], 64))
|
|
@@ -1173,18 +1185,18 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1173
1185
|
ref: C,
|
|
1174
1186
|
class: "yselect__input",
|
|
1175
1187
|
type: "text",
|
|
1176
|
-
placeholder: e.multiple ? x.value.length > 0 ? `已选择 ${x.value.length} 项` : t.placeholder :
|
|
1177
|
-
"onUpdate:modelValue":
|
|
1188
|
+
placeholder: e.multiple ? x.value.length > 0 ? `已选择 ${x.value.length} 项` : t.placeholder : H.value || t.placeholder,
|
|
1189
|
+
"onUpdate:modelValue": r[0] || (r[0] = (n) => c.value = n),
|
|
1178
1190
|
onKeydown: [
|
|
1179
|
-
|
|
1191
|
+
r[1] || (r[1] = me(() => {
|
|
1180
1192
|
}, ["stop"])),
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1193
|
+
r[2] || (r[2] = Ke(me((n) => te(1), ["prevent"]), ["arrow-down"])),
|
|
1194
|
+
r[3] || (r[3] = Ke(me((n) => te(-1), ["prevent"]), ["arrow-up"])),
|
|
1195
|
+
r[4] || (r[4] = Ke(me((n) => Y(), ["prevent"]), ["enter"])),
|
|
1184
1196
|
Ke(me(ve, ["prevent"]), ["esc"]),
|
|
1185
1197
|
Ke(me(ie, ["prevent"]), ["delete"])
|
|
1186
1198
|
]
|
|
1187
|
-
}, null, 40,
|
|
1199
|
+
}, null, 40, Bl)), [
|
|
1188
1200
|
[Lt, c.value]
|
|
1189
1201
|
]),
|
|
1190
1202
|
t.clearable && !t.disabled && (e.multiple ? x.value.length > 0 : g.value) ? (d(), p("span", {
|
|
@@ -1192,14 +1204,14 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1192
1204
|
class: "yselect__clear",
|
|
1193
1205
|
title: "清空",
|
|
1194
1206
|
onClick: me(ie, ["stop"])
|
|
1195
|
-
}, [...
|
|
1196
|
-
|
|
1207
|
+
}, [...r[9] || (r[9] = [
|
|
1208
|
+
s("svg", {
|
|
1197
1209
|
width: "12",
|
|
1198
1210
|
height: "12",
|
|
1199
1211
|
viewBox: "0 0 12 12",
|
|
1200
1212
|
fill: "none"
|
|
1201
1213
|
}, [
|
|
1202
|
-
|
|
1214
|
+
s("path", {
|
|
1203
1215
|
d: "M3 3l6 6M9 3L3 9",
|
|
1204
1216
|
stroke: "currentColor",
|
|
1205
1217
|
"stroke-width": "1.5",
|
|
@@ -1207,16 +1219,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1207
1219
|
})
|
|
1208
1220
|
], -1)
|
|
1209
1221
|
])])) : V("", !0),
|
|
1210
|
-
|
|
1222
|
+
s("span", {
|
|
1211
1223
|
class: Z(["yselect__arrow", { "yselect__arrow--open": m.value }])
|
|
1212
|
-
}, [...
|
|
1213
|
-
|
|
1224
|
+
}, [...r[10] || (r[10] = [
|
|
1225
|
+
s("svg", {
|
|
1214
1226
|
width: "12",
|
|
1215
1227
|
height: "12",
|
|
1216
1228
|
viewBox: "0 0 12 12",
|
|
1217
1229
|
fill: "none"
|
|
1218
1230
|
}, [
|
|
1219
|
-
|
|
1231
|
+
s("path", {
|
|
1220
1232
|
d: "M3 4.5L6 7.5L9 4.5",
|
|
1221
1233
|
stroke: "currentColor",
|
|
1222
1234
|
"stroke-width": "1.5",
|
|
@@ -1225,25 +1237,25 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1225
1237
|
})
|
|
1226
1238
|
], -1)
|
|
1227
1239
|
])], 2)
|
|
1228
|
-
], 42,
|
|
1229
|
-
|
|
1240
|
+
], 42, Sl),
|
|
1241
|
+
Ie(Ve, { name: "yselect-dropdown" }, {
|
|
1230
1242
|
default: $e(() => [
|
|
1231
1243
|
(d(), Pe(Xe, { to: "body" }, [
|
|
1232
1244
|
m.value ? (d(), p("div", {
|
|
1233
1245
|
key: 0,
|
|
1234
|
-
class: Z(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top":
|
|
1246
|
+
class: Z(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": M.value }]),
|
|
1235
1247
|
style: be(R.value),
|
|
1236
|
-
onMousedown:
|
|
1248
|
+
onMousedown: r[6] || (r[6] = me(() => {
|
|
1237
1249
|
}, ["stop"])),
|
|
1238
|
-
onClick:
|
|
1250
|
+
onClick: r[7] || (r[7] = me(() => {
|
|
1239
1251
|
}, ["stop"]))
|
|
1240
1252
|
}, [
|
|
1241
|
-
|
|
1253
|
+
s("div", {
|
|
1242
1254
|
class: "yselect__options",
|
|
1243
1255
|
ref_key: "optionsContainer",
|
|
1244
|
-
ref:
|
|
1256
|
+
ref: i
|
|
1245
1257
|
}, [
|
|
1246
|
-
(d(!0), p(Se, null,
|
|
1258
|
+
(d(!0), p(Se, null, Be(W.value, (n, a) => (d(), p("div", {
|
|
1247
1259
|
key: ye(n, a),
|
|
1248
1260
|
class: Z(["yselect__option", {
|
|
1249
1261
|
"yselect__option--selected": de(n),
|
|
@@ -1252,16 +1264,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1252
1264
|
}]),
|
|
1253
1265
|
onClick: (w) => ce(n),
|
|
1254
1266
|
onMouseenter: (w) => h.value = a,
|
|
1255
|
-
onMouseleave:
|
|
1267
|
+
onMouseleave: r[5] || (r[5] = (w) => h.value = -1)
|
|
1256
1268
|
}, [
|
|
1257
|
-
|
|
1269
|
+
ke(b.$slots, "option", {
|
|
1258
1270
|
option: n,
|
|
1259
1271
|
index: a,
|
|
1260
1272
|
selected: de(n)
|
|
1261
1273
|
}, () => [
|
|
1262
|
-
e.multiple ? (d(), p("span",
|
|
1263
|
-
de(n) ? (d(), p("svg",
|
|
1264
|
-
|
|
1274
|
+
e.multiple ? (d(), p("span", zl, [
|
|
1275
|
+
de(n) ? (d(), p("svg", Nl, [...r[11] || (r[11] = [
|
|
1276
|
+
s("path", {
|
|
1265
1277
|
d: "M2 7l3 3 7-7",
|
|
1266
1278
|
stroke: "currentColor",
|
|
1267
1279
|
"stroke-width": "2",
|
|
@@ -1275,10 +1287,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1275
1287
|
class: "yselect__flag",
|
|
1276
1288
|
src: n.flagImg,
|
|
1277
1289
|
alt: "flag"
|
|
1278
|
-
}, null, 8,
|
|
1290
|
+
}, null, 8, Kl)) : V("", !0),
|
|
1279
1291
|
We(" " + we(j(n)), 1)
|
|
1280
1292
|
], !0)
|
|
1281
|
-
], 42,
|
|
1293
|
+
], 42, _l))), 128))
|
|
1282
1294
|
], 512)
|
|
1283
1295
|
], 38)) : V("", !0)
|
|
1284
1296
|
]))
|
|
@@ -1287,7 +1299,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1287
1299
|
})
|
|
1288
1300
|
], 6));
|
|
1289
1301
|
}
|
|
1290
|
-
}), $t = /* @__PURE__ */ ze(
|
|
1302
|
+
}), $t = /* @__PURE__ */ ze(Wl, [["__scopeId", "data-v-b08c47e4"]]), Rl = { class: "ypagination" }, Vl = { class: "page-actions" }, Al = { class: "page-size-select" }, Pl = /* @__PURE__ */ _e({
|
|
1291
1303
|
__name: "ypagination",
|
|
1292
1304
|
props: {
|
|
1293
1305
|
currentPage: {},
|
|
@@ -1303,20 +1315,20 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1303
1315
|
},
|
|
1304
1316
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
1305
1317
|
setup(t, { emit: f }) {
|
|
1306
|
-
const e = t, l = f, m =
|
|
1318
|
+
const e = t, l = f, m = I(e.pageSize), h = _(() => e.pageSizeOptions), i = _({
|
|
1307
1319
|
get: () => e.currentPage,
|
|
1308
1320
|
set: (C) => {
|
|
1309
1321
|
l("update:currentPage", C), l("page-change", C);
|
|
1310
1322
|
}
|
|
1311
1323
|
});
|
|
1312
1324
|
function S(C) {
|
|
1313
|
-
e.loading || C >= 1 && C !== e.currentPage && (
|
|
1325
|
+
e.loading || C >= 1 && C !== e.currentPage && (i.value = C);
|
|
1314
1326
|
}
|
|
1315
1327
|
function $(C) {
|
|
1316
|
-
e.loading || (m.value = C, l("update:pageSize", C), l("page-size-change", C),
|
|
1328
|
+
e.loading || (m.value = C, l("update:pageSize", C), l("page-size-change", C), i.value = 1);
|
|
1317
1329
|
}
|
|
1318
|
-
function
|
|
1319
|
-
e.loading || (C === "prev" ? S(
|
|
1330
|
+
function M(C) {
|
|
1331
|
+
e.loading || (C === "prev" ? S(i.value - 1) : C === "next" && S(i.value + 1));
|
|
1320
1332
|
}
|
|
1321
1333
|
return m.value = e.pageSize, ge(
|
|
1322
1334
|
() => e.pageSize,
|
|
@@ -1325,33 +1337,33 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1325
1337
|
}
|
|
1326
1338
|
), (C, c) => {
|
|
1327
1339
|
const g = nt("YButton"), x = nt("YSelect");
|
|
1328
|
-
return d(), p("div",
|
|
1329
|
-
|
|
1330
|
-
|
|
1340
|
+
return d(), p("div", Rl, [
|
|
1341
|
+
s("div", Vl, [
|
|
1342
|
+
Ie(g, {
|
|
1331
1343
|
size: "small",
|
|
1332
1344
|
variant: "secondary",
|
|
1333
|
-
disabled:
|
|
1334
|
-
onClick: c[0] || (c[0] = (
|
|
1345
|
+
disabled: i.value === 1 || t.loading,
|
|
1346
|
+
onClick: c[0] || (c[0] = (H) => S(1))
|
|
1335
1347
|
}, {
|
|
1336
1348
|
default: $e(() => [...c[2] || (c[2] = [
|
|
1337
1349
|
We("首页", -1)
|
|
1338
1350
|
])]),
|
|
1339
1351
|
_: 1
|
|
1340
1352
|
}, 8, ["disabled"]),
|
|
1341
|
-
|
|
1353
|
+
Ie(g, {
|
|
1342
1354
|
class: "ml-1",
|
|
1343
1355
|
variant: "secondary",
|
|
1344
1356
|
size: "small",
|
|
1345
1357
|
groupItems: [
|
|
1346
|
-
{ label: "上一页", value: "prev", disabled:
|
|
1358
|
+
{ label: "上一页", value: "prev", disabled: i.value === 1 || t.loading, icon: "chevron-left", onlyIcon: !0, ariaLabel: "上一页" },
|
|
1347
1359
|
{ label: "下一页", value: "next", disabled: t.loading || t.disableNext, icon: "chevron-right", onlyIcon: !0, ariaLabel: "下一页" }
|
|
1348
1360
|
],
|
|
1349
|
-
onGroupClick:
|
|
1361
|
+
onGroupClick: M
|
|
1350
1362
|
}, null, 8, ["groupItems"]),
|
|
1351
|
-
|
|
1352
|
-
|
|
1363
|
+
s("div", Al, [
|
|
1364
|
+
Ie(x, {
|
|
1353
1365
|
modelValue: m.value,
|
|
1354
|
-
"onUpdate:modelValue": c[1] || (c[1] = (
|
|
1366
|
+
"onUpdate:modelValue": c[1] || (c[1] = (H) => m.value = H),
|
|
1355
1367
|
options: h.value,
|
|
1356
1368
|
size: "small",
|
|
1357
1369
|
width: "105px",
|
|
@@ -1364,50 +1376,50 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1364
1376
|
]);
|
|
1365
1377
|
};
|
|
1366
1378
|
}
|
|
1367
|
-
}),
|
|
1379
|
+
}), Yl = /* @__PURE__ */ ze(Pl, [["__scopeId", "data-v-5a512f0f"]]), Fl = ["aria-label"], Ol = { class: "y-badge__inner" }, jl = {
|
|
1368
1380
|
key: 0,
|
|
1369
1381
|
class: "y-badge__progress",
|
|
1370
1382
|
"aria-hidden": "true"
|
|
1371
|
-
},
|
|
1383
|
+
}, ql = {
|
|
1372
1384
|
key: 0,
|
|
1373
1385
|
class: "icon",
|
|
1374
1386
|
viewBox: "0 0 20 20",
|
|
1375
1387
|
fill: "currentColor"
|
|
1376
|
-
},
|
|
1388
|
+
}, Ul = {
|
|
1377
1389
|
key: 1,
|
|
1378
1390
|
class: "icon",
|
|
1379
1391
|
viewBox: "0 0 20 20",
|
|
1380
1392
|
fill: "currentColor"
|
|
1381
|
-
},
|
|
1393
|
+
}, Gl = {
|
|
1382
1394
|
key: 2,
|
|
1383
1395
|
class: "icon",
|
|
1384
1396
|
viewBox: "0 0 20 20",
|
|
1385
1397
|
fill: "currentColor"
|
|
1386
|
-
},
|
|
1398
|
+
}, Zl = {
|
|
1387
1399
|
key: 1,
|
|
1388
1400
|
class: "y-badge__icon",
|
|
1389
1401
|
"aria-hidden": "true"
|
|
1390
|
-
},
|
|
1402
|
+
}, Ql = {
|
|
1391
1403
|
key: 0,
|
|
1392
1404
|
class: "icon",
|
|
1393
1405
|
viewBox: "0 0 20 20",
|
|
1394
1406
|
fill: "currentColor"
|
|
1395
|
-
},
|
|
1407
|
+
}, Jl = {
|
|
1396
1408
|
key: 1,
|
|
1397
1409
|
class: "icon",
|
|
1398
1410
|
viewBox: "0 0 20 20",
|
|
1399
1411
|
fill: "currentColor"
|
|
1400
|
-
},
|
|
1412
|
+
}, Xl = {
|
|
1401
1413
|
key: 2,
|
|
1402
1414
|
class: "icon",
|
|
1403
1415
|
viewBox: "0 0 20 20",
|
|
1404
1416
|
fill: "currentColor"
|
|
1405
|
-
},
|
|
1417
|
+
}, en = {
|
|
1406
1418
|
key: 3,
|
|
1407
1419
|
class: "icon",
|
|
1408
1420
|
viewBox: "0 0 20 20",
|
|
1409
1421
|
fill: "currentColor"
|
|
1410
|
-
},
|
|
1422
|
+
}, tn = { class: "y-badge__label" }, ln = /* @__PURE__ */ _e({
|
|
1411
1423
|
__name: "ybadge",
|
|
1412
1424
|
props: {
|
|
1413
1425
|
tone: { default: "default" },
|
|
@@ -1420,14 +1432,14 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1420
1432
|
},
|
|
1421
1433
|
setup(t) {
|
|
1422
1434
|
const f = t, e = _(() => f.tone || "default"), l = _(() => {
|
|
1423
|
-
const m = (f.label || "").trim(), h = f.tone,
|
|
1424
|
-
if (
|
|
1435
|
+
const m = (f.label || "").trim(), h = f.tone, i = f.progress;
|
|
1436
|
+
if (i) {
|
|
1425
1437
|
const S = {
|
|
1426
1438
|
incomplete: "未完成",
|
|
1427
1439
|
partiallyComplete: "部分完成",
|
|
1428
1440
|
complete: "已完成"
|
|
1429
1441
|
};
|
|
1430
|
-
return m ? `${m},进度:${S[
|
|
1442
|
+
return m ? `${m},进度:${S[i] || i}` : `进度:${S[i] || i}`;
|
|
1431
1443
|
}
|
|
1432
1444
|
if (h && h !== "default") {
|
|
1433
1445
|
const S = {
|
|
@@ -1452,17 +1464,17 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1452
1464
|
role: "status",
|
|
1453
1465
|
"aria-label": l.value
|
|
1454
1466
|
}, [
|
|
1455
|
-
|
|
1456
|
-
t.progress ? (d(), p("span",
|
|
1457
|
-
t.progress === "incomplete" ? (d(), p("svg",
|
|
1458
|
-
|
|
1467
|
+
s("span", Ol, [
|
|
1468
|
+
t.progress ? (d(), p("span", jl, [
|
|
1469
|
+
t.progress === "incomplete" ? (d(), p("svg", ql, [...h[0] || (h[0] = [
|
|
1470
|
+
s("circle", {
|
|
1459
1471
|
cx: "10",
|
|
1460
1472
|
cy: "10",
|
|
1461
1473
|
r: "5"
|
|
1462
1474
|
}, null, -1)
|
|
1463
|
-
])])) : t.progress === "partiallyComplete" ? (d(), p("svg",
|
|
1464
|
-
|
|
1465
|
-
|
|
1475
|
+
])])) : t.progress === "partiallyComplete" ? (d(), p("svg", Ul, [...h[1] || (h[1] = [
|
|
1476
|
+
s("path", { d: "M10 5a5 5 0 100 10V5z" }, null, -1),
|
|
1477
|
+
s("circle", {
|
|
1466
1478
|
cx: "10",
|
|
1467
1479
|
cy: "10",
|
|
1468
1480
|
r: "5",
|
|
@@ -1470,55 +1482,55 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1470
1482
|
stroke: "currentColor",
|
|
1471
1483
|
"stroke-width": "2"
|
|
1472
1484
|
}, null, -1)
|
|
1473
|
-
])])) : t.progress === "complete" ? (d(), p("svg",
|
|
1474
|
-
|
|
1485
|
+
])])) : t.progress === "complete" ? (d(), p("svg", Gl, [...h[2] || (h[2] = [
|
|
1486
|
+
s("path", {
|
|
1475
1487
|
"fill-rule": "evenodd",
|
|
1476
1488
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1477
1489
|
"clip-rule": "evenodd"
|
|
1478
1490
|
}, null, -1)
|
|
1479
1491
|
])])) : V("", !0)
|
|
1480
|
-
])) : t.icon ? (d(), p("span",
|
|
1481
|
-
t.icon === "dot" ? (d(), p("svg",
|
|
1482
|
-
|
|
1492
|
+
])) : t.icon ? (d(), p("span", Zl, [
|
|
1493
|
+
t.icon === "dot" ? (d(), p("svg", Ql, [...h[3] || (h[3] = [
|
|
1494
|
+
s("circle", {
|
|
1483
1495
|
cx: "10",
|
|
1484
1496
|
cy: "10",
|
|
1485
1497
|
r: "4"
|
|
1486
1498
|
}, null, -1)
|
|
1487
|
-
])])) : t.icon === "check" ? (d(), p("svg",
|
|
1488
|
-
|
|
1499
|
+
])])) : t.icon === "check" ? (d(), p("svg", Jl, [...h[4] || (h[4] = [
|
|
1500
|
+
s("path", {
|
|
1489
1501
|
"fill-rule": "evenodd",
|
|
1490
1502
|
d: "M16.707 5.293a1 1 0 010 1.414l-7.25 7.25a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L8.75 11.086l6.543-6.543a1 1 0 011.414 0z",
|
|
1491
1503
|
"clip-rule": "evenodd"
|
|
1492
1504
|
}, null, -1)
|
|
1493
|
-
])])) : t.icon === "alert" ? (d(), p("svg",
|
|
1494
|
-
|
|
1505
|
+
])])) : t.icon === "alert" ? (d(), p("svg", Xl, [...h[5] || (h[5] = [
|
|
1506
|
+
s("path", {
|
|
1495
1507
|
"fill-rule": "evenodd",
|
|
1496
1508
|
d: "M8.257 3.099c.765-1.36 2.721-1.36 3.486 0l6.518 11.59c.75 1.334-.214 3.011-1.743 3.011H3.482c-1.53 0-2.493-1.677-1.743-3.01L8.257 3.1zM11 14a1 1 0 10-2 0 1 1 0 002 0zm-1-2a1 1 0 01-1-1V8a1 1 0 112 0v3a1 1 0 01-1 1z",
|
|
1497
1509
|
"clip-rule": "evenodd"
|
|
1498
1510
|
}, null, -1)
|
|
1499
|
-
])])) : (d(), p("svg",
|
|
1500
|
-
|
|
1511
|
+
])])) : (d(), p("svg", en, [...h[6] || (h[6] = [
|
|
1512
|
+
s("circle", {
|
|
1501
1513
|
cx: "10",
|
|
1502
1514
|
cy: "10",
|
|
1503
1515
|
r: "4"
|
|
1504
1516
|
}, null, -1)
|
|
1505
1517
|
])]))
|
|
1506
1518
|
])) : V("", !0),
|
|
1507
|
-
|
|
1508
|
-
|
|
1519
|
+
s("span", tn, [
|
|
1520
|
+
ke(m.$slots, "default", {}, () => [
|
|
1509
1521
|
We(we(t.label), 1)
|
|
1510
1522
|
], !0)
|
|
1511
1523
|
])
|
|
1512
1524
|
])
|
|
1513
|
-
], 10,
|
|
1525
|
+
], 10, Fl));
|
|
1514
1526
|
}
|
|
1515
|
-
}),
|
|
1527
|
+
}), nn = /* @__PURE__ */ ze(ln, [["__scopeId", "data-v-ce819797"]]), an = ["aria-hidden"], on = ["onKeydown"], sn = {
|
|
1516
1528
|
key: 0,
|
|
1517
1529
|
class: "y-dialog-header"
|
|
1518
|
-
},
|
|
1530
|
+
}, rn = { class: "y-dialog-title" }, un = { class: "y-dialog-body" }, dn = {
|
|
1519
1531
|
key: 1,
|
|
1520
1532
|
class: "y-dialog-footer"
|
|
1521
|
-
},
|
|
1533
|
+
}, cn = /* @__PURE__ */ _e({
|
|
1522
1534
|
__name: "ydialog",
|
|
1523
1535
|
props: {
|
|
1524
1536
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1536,7 +1548,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1536
1548
|
const e = t, l = f, m = _({
|
|
1537
1549
|
get: () => e.modelValue,
|
|
1538
1550
|
set: (c) => l("update:modelValue", c)
|
|
1539
|
-
}), h =
|
|
1551
|
+
}), h = I(null), i = _(() => {
|
|
1540
1552
|
const c = {};
|
|
1541
1553
|
return c.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), c.margin = "0 auto", c.top = e.top, c;
|
|
1542
1554
|
});
|
|
@@ -1546,11 +1558,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1546
1558
|
function $() {
|
|
1547
1559
|
m.value && (m.value = !1, l("close"));
|
|
1548
1560
|
}
|
|
1549
|
-
function
|
|
1561
|
+
function M() {
|
|
1550
1562
|
e.closable && $();
|
|
1551
1563
|
}
|
|
1552
1564
|
function C(c) {
|
|
1553
|
-
c.key === "Escape" &&
|
|
1565
|
+
c.key === "Escape" && M();
|
|
1554
1566
|
}
|
|
1555
1567
|
return ge(() => e.modelValue, (c) => {
|
|
1556
1568
|
c ? (l("open"), requestAnimationFrame(() => {
|
|
@@ -1562,30 +1574,30 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1562
1574
|
}), Oe(() => {
|
|
1563
1575
|
document.removeEventListener("keydown", C), document.body.style.overflow = "";
|
|
1564
1576
|
}), (c, g) => (d(), Pe(Xe, { to: "body" }, [
|
|
1565
|
-
je(
|
|
1577
|
+
je(s("div", {
|
|
1566
1578
|
class: "y-dialog-root",
|
|
1567
1579
|
role: "dialog",
|
|
1568
1580
|
"aria-modal": !0,
|
|
1569
1581
|
"aria-hidden": !m.value,
|
|
1570
1582
|
style: be({ zIndex: String(t.zIndex) })
|
|
1571
1583
|
}, [
|
|
1572
|
-
|
|
1584
|
+
s("div", {
|
|
1573
1585
|
class: "y-dialog-mask",
|
|
1574
1586
|
onClick: S
|
|
1575
1587
|
}),
|
|
1576
|
-
|
|
1588
|
+
Ie(Ve, { name: "dialog-zoom-fade" }, {
|
|
1577
1589
|
default: $e(() => [
|
|
1578
|
-
je(
|
|
1590
|
+
je(s("div", {
|
|
1579
1591
|
ref_key: "panelRef",
|
|
1580
1592
|
ref: h,
|
|
1581
1593
|
class: Z(["y-dialog-panel", [t.center ? "is-center" : ""]]),
|
|
1582
|
-
style: be(
|
|
1583
|
-
onKeydown: Ke(me(
|
|
1594
|
+
style: be(i.value),
|
|
1595
|
+
onKeydown: Ke(me(M, ["prevent", "stop"]), ["esc"]),
|
|
1584
1596
|
tabindex: "-1"
|
|
1585
1597
|
}, [
|
|
1586
|
-
t.showHeader ? (d(), p("div",
|
|
1587
|
-
|
|
1588
|
-
|
|
1598
|
+
t.showHeader ? (d(), p("div", sn, [
|
|
1599
|
+
ke(c.$slots, "header", {}, () => [
|
|
1600
|
+
s("div", rn, we(t.title), 1)
|
|
1589
1601
|
], !0),
|
|
1590
1602
|
t.closable ? (d(), p("button", {
|
|
1591
1603
|
key: 0,
|
|
@@ -1595,24 +1607,24 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1595
1607
|
onClick: $
|
|
1596
1608
|
}, " ✕ ")) : V("", !0)
|
|
1597
1609
|
])) : V("", !0),
|
|
1598
|
-
|
|
1599
|
-
|
|
1610
|
+
s("div", un, [
|
|
1611
|
+
ke(c.$slots, "default", {}, void 0, !0)
|
|
1600
1612
|
]),
|
|
1601
|
-
c.$slots.footer ? (d(), p("div",
|
|
1602
|
-
|
|
1613
|
+
c.$slots.footer ? (d(), p("div", dn, [
|
|
1614
|
+
ke(c.$slots, "footer", {}, void 0, !0)
|
|
1603
1615
|
])) : V("", !0)
|
|
1604
|
-
], 46,
|
|
1616
|
+
], 46, on), [
|
|
1605
1617
|
[Ze, m.value]
|
|
1606
1618
|
])
|
|
1607
1619
|
]),
|
|
1608
1620
|
_: 3
|
|
1609
1621
|
})
|
|
1610
|
-
], 12,
|
|
1622
|
+
], 12, an), [
|
|
1611
1623
|
[Ze, m.value]
|
|
1612
1624
|
])
|
|
1613
1625
|
]));
|
|
1614
1626
|
}
|
|
1615
|
-
}),
|
|
1627
|
+
}), fn = /* @__PURE__ */ ze(cn, [["__scopeId", "data-v-b4d84def"]]), vn = { class: "ypopover__inner" }, hn = /* @__PURE__ */ _e({
|
|
1616
1628
|
__name: "ypopover",
|
|
1617
1629
|
props: {
|
|
1618
1630
|
trigger: { default: "click" },
|
|
@@ -1632,14 +1644,14 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1632
1644
|
},
|
|
1633
1645
|
emits: ["update:modelValue", "show", "hide", "before-show", "before-hide"],
|
|
1634
1646
|
setup(t, { expose: f, emit: e }) {
|
|
1635
|
-
const l = t, m = e, h =
|
|
1647
|
+
const l = t, m = e, h = I(), i = I(), S = I(), $ = I(!1), M = I(), C = I(), c = I({});
|
|
1636
1648
|
let g = null, x = null;
|
|
1637
|
-
const
|
|
1638
|
-
if (!$.value || !
|
|
1649
|
+
const H = _(() => {
|
|
1650
|
+
if (!$.value || !M.value) return {};
|
|
1639
1651
|
const Y = {};
|
|
1640
1652
|
l.width !== "auto" && (Y.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.maxWidth && (Y.maxWidth = typeof l.maxWidth == "number" ? `${l.maxWidth}px` : l.maxWidth);
|
|
1641
|
-
const { top:
|
|
1642
|
-
return Y.top = `${
|
|
1653
|
+
const { top: J, left: ne } = R();
|
|
1654
|
+
return Y.top = `${J}px`, Y.left = `${ne}px`, Y;
|
|
1643
1655
|
}), W = _(() => {
|
|
1644
1656
|
if (!l.showArrow) return {};
|
|
1645
1657
|
if (Object.keys(c.value).length > 0)
|
|
@@ -1648,50 +1660,50 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1648
1660
|
return l.placement.startsWith("top") || l.placement.startsWith("bottom") ? Y.left = "50%" : Y.top = "50%", Y;
|
|
1649
1661
|
});
|
|
1650
1662
|
function R() {
|
|
1651
|
-
var N,
|
|
1652
|
-
if (!
|
|
1653
|
-
const { width: Y, height:
|
|
1654
|
-
let
|
|
1663
|
+
var N, B;
|
|
1664
|
+
if (!M.value) return { top: 0, left: 0 };
|
|
1665
|
+
const { width: Y, height: J, top: ne, left: U } = M.value, ae = ((N = S.value) == null ? void 0 : N.offsetWidth) || 200, b = ((B = S.value) == null ? void 0 : B.offsetHeight) || 100;
|
|
1666
|
+
let r = 0, n = 0;
|
|
1655
1667
|
switch (l.placement) {
|
|
1656
1668
|
case "top":
|
|
1657
|
-
|
|
1669
|
+
r = ne - b - l.offset, n = U + (Y - ae) / 2;
|
|
1658
1670
|
break;
|
|
1659
1671
|
case "top-start":
|
|
1660
|
-
|
|
1672
|
+
r = ne - b - l.offset, n = U;
|
|
1661
1673
|
break;
|
|
1662
1674
|
case "top-end":
|
|
1663
|
-
|
|
1675
|
+
r = ne - b - l.offset, n = U + Y - ae;
|
|
1664
1676
|
break;
|
|
1665
1677
|
case "bottom":
|
|
1666
|
-
|
|
1678
|
+
r = ne + J + l.offset, n = U + (Y - ae) / 2;
|
|
1667
1679
|
break;
|
|
1668
1680
|
case "bottom-start":
|
|
1669
|
-
|
|
1681
|
+
r = ne + J + l.offset, n = U;
|
|
1670
1682
|
break;
|
|
1671
1683
|
case "bottom-end":
|
|
1672
|
-
|
|
1684
|
+
r = ne + J + l.offset, n = U + Y - ae;
|
|
1673
1685
|
break;
|
|
1674
1686
|
case "left":
|
|
1675
|
-
|
|
1687
|
+
r = ne + (J - b) / 2, n = U - ae - l.offset;
|
|
1676
1688
|
break;
|
|
1677
1689
|
case "left-start":
|
|
1678
|
-
|
|
1690
|
+
r = ne, n = U - ae - l.offset;
|
|
1679
1691
|
break;
|
|
1680
1692
|
case "left-end":
|
|
1681
|
-
|
|
1693
|
+
r = ne + J - b, n = U - ae - l.offset;
|
|
1682
1694
|
break;
|
|
1683
1695
|
case "right":
|
|
1684
|
-
|
|
1696
|
+
r = ne + (J - b) / 2, n = U + Y + l.offset;
|
|
1685
1697
|
break;
|
|
1686
1698
|
case "right-start":
|
|
1687
|
-
|
|
1699
|
+
r = ne, n = U + Y + l.offset;
|
|
1688
1700
|
break;
|
|
1689
1701
|
case "right-end":
|
|
1690
|
-
|
|
1702
|
+
r = ne + J - b, n = U + Y + l.offset;
|
|
1691
1703
|
break;
|
|
1692
1704
|
}
|
|
1693
1705
|
const a = window.innerWidth, w = window.innerHeight;
|
|
1694
|
-
return n < 8 && (n = 8), n + ae > a - 8 && (n = a - ae - 8),
|
|
1706
|
+
return n < 8 && (n = 8), n + ae > a - 8 && (n = a - ae - 8), r < 8 && (r = 8), r + b > w - 8 && (r = w - b - 8), { top: r, left: n };
|
|
1695
1707
|
}
|
|
1696
1708
|
function D() {
|
|
1697
1709
|
l.disabled || $.value || (de(), l.openDelay > 0 ? g = setTimeout(() => {
|
|
@@ -1717,12 +1729,12 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1717
1729
|
g && (clearTimeout(g), g = null), x && (clearTimeout(x), x = null);
|
|
1718
1730
|
}
|
|
1719
1731
|
function K() {
|
|
1720
|
-
if (!l.showArrow || !
|
|
1732
|
+
if (!l.showArrow || !M.value || !S.value) {
|
|
1721
1733
|
c.value = {};
|
|
1722
1734
|
return;
|
|
1723
1735
|
}
|
|
1724
|
-
const Y =
|
|
1725
|
-
if (
|
|
1736
|
+
const Y = M.value, J = S.value.getBoundingClientRect();
|
|
1737
|
+
if (J.width === 0 || J.height === 0) {
|
|
1726
1738
|
const U = {};
|
|
1727
1739
|
l.placement.startsWith("top") || l.placement.startsWith("bottom") ? U.left = "50%" : U.top = "50%", c.value = U;
|
|
1728
1740
|
return;
|
|
@@ -1730,25 +1742,25 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1730
1742
|
const ne = {};
|
|
1731
1743
|
if (l.placement.startsWith("top")) {
|
|
1732
1744
|
ne.bottom = "-6px";
|
|
1733
|
-
const U = Y.left + Y.width / 2, ae =
|
|
1734
|
-
ne.left = `${Math.max(12, Math.min(b,
|
|
1745
|
+
const U = Y.left + Y.width / 2, ae = J.left, b = U - ae;
|
|
1746
|
+
ne.left = `${Math.max(12, Math.min(b, J.width - 12))}px`;
|
|
1735
1747
|
} else if (l.placement.startsWith("bottom")) {
|
|
1736
1748
|
ne.top = "-6px";
|
|
1737
|
-
const U = Y.left + Y.width / 2, ae =
|
|
1738
|
-
ne.left = `${Math.max(12, Math.min(b,
|
|
1749
|
+
const U = Y.left + Y.width / 2, ae = J.left, b = U - ae;
|
|
1750
|
+
ne.left = `${Math.max(12, Math.min(b, J.width - 12))}px`;
|
|
1739
1751
|
} else if (l.placement.startsWith("left")) {
|
|
1740
1752
|
ne.right = "-6px";
|
|
1741
|
-
const U = Y.top + Y.height / 2, ae =
|
|
1742
|
-
ne.top = `${Math.max(12, Math.min(b,
|
|
1753
|
+
const U = Y.top + Y.height / 2, ae = J.top, b = U - ae;
|
|
1754
|
+
ne.top = `${Math.max(12, Math.min(b, J.height - 12))}px`;
|
|
1743
1755
|
} else if (l.placement.startsWith("right")) {
|
|
1744
1756
|
ne.left = "-6px";
|
|
1745
|
-
const U = Y.top + Y.height / 2, ae =
|
|
1746
|
-
ne.top = `${Math.max(12, Math.min(b,
|
|
1757
|
+
const U = Y.top + Y.height / 2, ae = J.top, b = U - ae;
|
|
1758
|
+
ne.top = `${Math.max(12, Math.min(b, J.height - 12))}px`;
|
|
1747
1759
|
}
|
|
1748
1760
|
c.value = ne;
|
|
1749
1761
|
}
|
|
1750
1762
|
function P() {
|
|
1751
|
-
|
|
1763
|
+
i.value && (M.value = i.value.getBoundingClientRect(), S.value && (C.value = S.value.getBoundingClientRect(), K(), $.value && requestAnimationFrame(() => {
|
|
1752
1764
|
S.value && (C.value = S.value.getBoundingClientRect(), K());
|
|
1753
1765
|
})));
|
|
1754
1766
|
}
|
|
@@ -1769,8 +1781,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1769
1781
|
}
|
|
1770
1782
|
function te(Y) {
|
|
1771
1783
|
if (!l.closeOnClickOutside || !$.value) return;
|
|
1772
|
-
const
|
|
1773
|
-
h.value && !h.value.contains(
|
|
1784
|
+
const J = Y.target;
|
|
1785
|
+
h.value && !h.value.contains(J) && S.value && !S.value.contains(J) && j();
|
|
1774
1786
|
}
|
|
1775
1787
|
return ge(() => l.modelValue, (Y) => {
|
|
1776
1788
|
Y !== $.value && (Y ? D() : j());
|
|
@@ -1790,22 +1802,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1790
1802
|
show: D,
|
|
1791
1803
|
hide: j,
|
|
1792
1804
|
updatePosition: P
|
|
1793
|
-
}), (Y,
|
|
1805
|
+
}), (Y, J) => (d(), p("div", {
|
|
1794
1806
|
class: "ypopover",
|
|
1795
1807
|
ref_key: "popoverRef",
|
|
1796
1808
|
ref: h
|
|
1797
1809
|
}, [
|
|
1798
|
-
|
|
1810
|
+
s("div", {
|
|
1799
1811
|
ref_key: "triggerRef",
|
|
1800
|
-
ref:
|
|
1812
|
+
ref: i,
|
|
1801
1813
|
onClick: fe,
|
|
1802
1814
|
onMouseenter: ve,
|
|
1803
1815
|
onMouseleave: ce
|
|
1804
1816
|
}, [
|
|
1805
|
-
|
|
1817
|
+
ke(Y.$slots, "reference", {}, void 0, !0)
|
|
1806
1818
|
], 544),
|
|
1807
1819
|
(d(), Pe(Xe, { to: "body" }, [
|
|
1808
|
-
|
|
1820
|
+
Ie(Ve, { name: "ypopover-fade" }, {
|
|
1809
1821
|
default: $e(() => [
|
|
1810
1822
|
$.value ? (d(), p("div", {
|
|
1811
1823
|
key: 0,
|
|
@@ -1818,8 +1830,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1818
1830
|
"ypopover__content--no-padding": !t.showPadding
|
|
1819
1831
|
}
|
|
1820
1832
|
]]),
|
|
1821
|
-
style: be(
|
|
1822
|
-
onClick:
|
|
1833
|
+
style: be(H.value),
|
|
1834
|
+
onClick: J[0] || (J[0] = me(() => {
|
|
1823
1835
|
}, ["stop"])),
|
|
1824
1836
|
onMouseenter: ie,
|
|
1825
1837
|
onMouseleave: q
|
|
@@ -1829,8 +1841,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1829
1841
|
class: Z(["ypopover__arrow", `ypopover__arrow--${t.placement}`]),
|
|
1830
1842
|
style: be(W.value)
|
|
1831
1843
|
}, null, 6)) : V("", !0),
|
|
1832
|
-
|
|
1833
|
-
|
|
1844
|
+
s("div", vn, [
|
|
1845
|
+
ke(Y.$slots, "default", {}, void 0, !0)
|
|
1834
1846
|
])
|
|
1835
1847
|
], 38)) : V("", !0)
|
|
1836
1848
|
]),
|
|
@@ -1839,16 +1851,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1839
1851
|
]))
|
|
1840
1852
|
], 512));
|
|
1841
1853
|
}
|
|
1842
|
-
}),
|
|
1854
|
+
}), gn = /* @__PURE__ */ ze(hn, [["__scopeId", "data-v-be755399"]]), pn = { class: "relative" }, yn = ["value", "placeholder"], mn = { class: "nh-time-suffix" }, wn = { class: "nh-time-shortcuts" }, bn = { class: "nh-time-shortcuts-list" }, kn = ["onClick", "onKeydown", "onMouseenter"], Cn = { class: "nh-time-custom" }, xn = { class: "nh-time-custom-header" }, Dn = { class: "nh-time-selection-status" }, $n = {
|
|
1843
1855
|
key: 0,
|
|
1844
1856
|
class: "status-text"
|
|
1845
|
-
},
|
|
1857
|
+
}, Sn = {
|
|
1846
1858
|
key: 1,
|
|
1847
1859
|
class: "status-text"
|
|
1848
|
-
},
|
|
1860
|
+
}, In = {
|
|
1849
1861
|
key: 2,
|
|
1850
1862
|
class: "status-text status-complete"
|
|
1851
|
-
},
|
|
1863
|
+
}, Mn = { class: "nh-time-pickers" }, Tn = { class: "nh-time-picker" }, Ln = { class: "nh-date-picker" }, En = { class: "nh-date-picker-header" }, Hn = { class: "nh-date-picker-header-label" }, Bn = { class: "nh-date-picker-content" }, _n = { class: "nh-date-table" }, zn = ["onClick"], Nn = { class: "nh-date-table-cell" }, Kn = { key: 0 }, Wn = { class: "nh-time-picker" }, Rn = { class: "nh-date-picker" }, Vn = { class: "nh-date-picker-header" }, An = { class: "nh-date-picker-header-label" }, Pn = { class: "nh-date-picker-content" }, Yn = { class: "nh-date-table" }, Fn = ["onClick"], On = { class: "nh-date-table-cell" }, jn = { key: 0 }, qn = { class: "nh-time-actions" }, Un = /* @__PURE__ */ _e({
|
|
1852
1864
|
__name: "ytime",
|
|
1853
1865
|
props: {
|
|
1854
1866
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1899,13 +1911,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1899
1911
|
},
|
|
1900
1912
|
emits: ["update:modelValue", "change"],
|
|
1901
1913
|
setup(t, { emit: f }) {
|
|
1902
|
-
const e = t, l = f, m =
|
|
1914
|
+
const e = t, l = f, m = I(!1), h = I(-1), i = I(-1), S = I(null), $ = I(), M = I(), C = I({
|
|
1903
1915
|
top: !0,
|
|
1904
1916
|
left: !0
|
|
1905
|
-
}), c =
|
|
1917
|
+
}), c = I({
|
|
1906
1918
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1907
1919
|
month: (/* @__PURE__ */ new Date()).getMonth()
|
|
1908
|
-
}), g =
|
|
1920
|
+
}), g = I({
|
|
1909
1921
|
year: (/* @__PURE__ */ new Date()).getFullYear(),
|
|
1910
1922
|
month: (/* @__PURE__ */ new Date()).getMonth() + 1
|
|
1911
1923
|
}), x = () => {
|
|
@@ -1914,13 +1926,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1914
1926
|
const E = new Date(c.value.year, c.value.month + 1);
|
|
1915
1927
|
g.value.year = E.getFullYear(), g.value.month = E.getMonth();
|
|
1916
1928
|
}
|
|
1917
|
-
},
|
|
1929
|
+
}, H = () => {
|
|
1918
1930
|
const u = new Date(c.value.year, c.value.month).getTime();
|
|
1919
1931
|
if (new Date(g.value.year, g.value.month).getTime() <= u) {
|
|
1920
1932
|
const E = new Date(g.value.year, g.value.month - 1);
|
|
1921
1933
|
c.value.year = E.getFullYear(), c.value.month = E.getMonth();
|
|
1922
1934
|
}
|
|
1923
|
-
}, W = ["一", "二", "三", "四", "五", "六", "日"], R =
|
|
1935
|
+
}, W = ["一", "二", "三", "四", "五", "六", "日"], R = I(null), D = I(null), z = (u) => {
|
|
1924
1936
|
if (!u) return null;
|
|
1925
1937
|
if (u instanceof Date) return u;
|
|
1926
1938
|
if (typeof u == "number")
|
|
@@ -1932,12 +1944,12 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1932
1944
|
return null;
|
|
1933
1945
|
}, j = (u) => {
|
|
1934
1946
|
if (!u) return null;
|
|
1935
|
-
const y = u.getFullYear(), E = String(u.getMonth() + 1).padStart(2, "0"),
|
|
1947
|
+
const y = u.getFullYear(), E = String(u.getMonth() + 1).padStart(2, "0"), Q = String(u.getDate()).padStart(2, "0");
|
|
1936
1948
|
if (e.includeTime) {
|
|
1937
|
-
const
|
|
1938
|
-
return `${y}-${E}-${
|
|
1949
|
+
const Ce = String(u.getHours()).padStart(2, "0"), xe = String(u.getMinutes()).padStart(2, "0"), Te = String(u.getSeconds()).padStart(2, "0");
|
|
1950
|
+
return `${y}-${E}-${Q} ${Ce}:${xe}:${Te}`;
|
|
1939
1951
|
} else
|
|
1940
|
-
return `${y}-${E}-${
|
|
1952
|
+
return `${y}-${E}-${Q}`;
|
|
1941
1953
|
}, ye = (u) => u ? u.getTime() : null, de = (u) => u ? {
|
|
1942
1954
|
startDate: z(u.startDate),
|
|
1943
1955
|
endDate: z(u.endDate)
|
|
@@ -1952,34 +1964,34 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1952
1964
|
if (!(y != null && y.startDate) || !(y != null && y.endDate))
|
|
1953
1965
|
return -1;
|
|
1954
1966
|
for (let E = 0; E < e.shortcuts.length; E++) {
|
|
1955
|
-
const
|
|
1956
|
-
if (
|
|
1957
|
-
const
|
|
1967
|
+
const Q = e.shortcuts[E].getValue();
|
|
1968
|
+
if (Q.startDate && Q.endDate && y.startDate && y.endDate) {
|
|
1969
|
+
const Ce = new Date(
|
|
1958
1970
|
y.startDate.getFullYear(),
|
|
1959
1971
|
y.startDate.getMonth(),
|
|
1960
1972
|
y.startDate.getDate()
|
|
1961
|
-
),
|
|
1973
|
+
), xe = new Date(
|
|
1962
1974
|
y.endDate.getFullYear(),
|
|
1963
1975
|
y.endDate.getMonth(),
|
|
1964
1976
|
y.endDate.getDate()
|
|
1965
1977
|
), Te = new Date(
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1978
|
+
Q.startDate.getFullYear(),
|
|
1979
|
+
Q.startDate.getMonth(),
|
|
1980
|
+
Q.startDate.getDate()
|
|
1969
1981
|
), Ae = new Date(
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1982
|
+
Q.endDate.getFullYear(),
|
|
1983
|
+
Q.endDate.getMonth(),
|
|
1984
|
+
Q.endDate.getDate()
|
|
1973
1985
|
);
|
|
1974
|
-
if (
|
|
1986
|
+
if (Ce.getTime() === Te.getTime() && xe.getTime() === Ae.getTime())
|
|
1975
1987
|
return E;
|
|
1976
1988
|
}
|
|
1977
1989
|
}
|
|
1978
1990
|
return -1;
|
|
1979
1991
|
}, ie = (u, y) => {
|
|
1980
|
-
const E = new Date(u, y, 1),
|
|
1981
|
-
for (let
|
|
1982
|
-
const Ye = new Date(u, y - 1, Qe.getDate() -
|
|
1992
|
+
const E = new Date(u, y, 1), Q = new Date(u, y + 1, 0), Ce = E.getDay(), xe = Q.getDate(), Te = [], Ae = /* @__PURE__ */ new Date(), qe = Ce === 0 ? 6 : Ce - 1, Qe = new Date(u, y, 0);
|
|
1993
|
+
for (let Me = qe - 1; Me >= 0; Me--) {
|
|
1994
|
+
const Ye = new Date(u, y - 1, Qe.getDate() - Me);
|
|
1983
1995
|
Te.push({
|
|
1984
1996
|
date: Ye,
|
|
1985
1997
|
day: Ye.getDate(),
|
|
@@ -1991,11 +2003,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
1991
2003
|
// 禁用非当前月的日期
|
|
1992
2004
|
});
|
|
1993
2005
|
}
|
|
1994
|
-
for (let
|
|
1995
|
-
const Ye = new Date(u, y,
|
|
2006
|
+
for (let Me = 1; Me <= xe; Me++) {
|
|
2007
|
+
const Ye = new Date(u, y, Me);
|
|
1996
2008
|
Te.push({
|
|
1997
2009
|
date: Ye,
|
|
1998
|
-
day:
|
|
2010
|
+
day: Me,
|
|
1999
2011
|
isCurrentMonth: !0,
|
|
2000
2012
|
isToday: fe(Ye, Ae),
|
|
2001
2013
|
isSelected: !1,
|
|
@@ -2004,11 +2016,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2004
2016
|
});
|
|
2005
2017
|
}
|
|
2006
2018
|
const Je = 42 - Te.length;
|
|
2007
|
-
for (let
|
|
2008
|
-
const Ye = new Date(u, y + 1,
|
|
2019
|
+
for (let Me = 1; Me <= Je; Me++) {
|
|
2020
|
+
const Ye = new Date(u, y + 1, Me);
|
|
2009
2021
|
Te.push({
|
|
2010
2022
|
date: Ye,
|
|
2011
|
-
day:
|
|
2023
|
+
day: Me,
|
|
2012
2024
|
isCurrentMonth: !1,
|
|
2013
2025
|
isToday: fe(Ye, Ae),
|
|
2014
2026
|
isSelected: !1,
|
|
@@ -2018,22 +2030,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2018
2030
|
});
|
|
2019
2031
|
}
|
|
2020
2032
|
const et = [];
|
|
2021
|
-
for (let
|
|
2022
|
-
et.push(Te.slice(
|
|
2033
|
+
for (let Me = 0; Me < Te.length; Me += 7)
|
|
2034
|
+
et.push(Te.slice(Me, Me + 7));
|
|
2023
2035
|
return et;
|
|
2024
2036
|
}, q = (u) => {
|
|
2025
2037
|
const y = K(u);
|
|
2026
2038
|
l("update:modelValue", y), l("change", y);
|
|
2027
2039
|
}, te = () => {
|
|
2028
|
-
if (!$.value || !
|
|
2029
|
-
const u = $.value.getBoundingClientRect(), y =
|
|
2030
|
-
|
|
2040
|
+
if (!$.value || !M.value) return;
|
|
2041
|
+
const u = $.value.getBoundingClientRect(), y = M.value.getBoundingClientRect(), E = window.innerWidth, Ce = window.innerHeight - u.bottom, xe = u.top, Te = y.height || 400;
|
|
2042
|
+
Ce < Te && xe > Te ? C.value.top = !1 : C.value.top = !0;
|
|
2031
2043
|
const Ae = E - u.left, qe = y.width || 640;
|
|
2032
2044
|
Ae < qe ? C.value.left = !1 : C.value.left = !0;
|
|
2033
2045
|
}, Y = () => {
|
|
2034
2046
|
if (m.value = !m.value, m.value) {
|
|
2035
2047
|
const u = de(e.modelValue);
|
|
2036
|
-
if (R.value = (u == null ? void 0 : u.startDate) || null, D.value = (u == null ? void 0 : u.endDate) || null,
|
|
2048
|
+
if (R.value = (u == null ? void 0 : u.startDate) || null, D.value = (u == null ? void 0 : u.endDate) || null, i.value = ce(e.modelValue), h.value = -1, u != null && u.startDate && (c.value.year = u.startDate.getFullYear(), c.value.month = u.startDate.getMonth()), u != null && u.endDate)
|
|
2037
2049
|
g.value.year = u.endDate.getFullYear(), g.value.month = u.endDate.getMonth();
|
|
2038
2050
|
else {
|
|
2039
2051
|
const y = new Date(c.value.year, c.value.month + 1);
|
|
@@ -2043,9 +2055,9 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2043
2055
|
te();
|
|
2044
2056
|
});
|
|
2045
2057
|
}
|
|
2046
|
-
},
|
|
2047
|
-
const y = u.target, E = $.value,
|
|
2048
|
-
E &&
|
|
2058
|
+
}, J = (u) => {
|
|
2059
|
+
const y = u.target, E = $.value, Q = M.value;
|
|
2060
|
+
E && Q && !E.contains(y) && !Q.contains(y) && (m.value = !1, h.value = -1);
|
|
2049
2061
|
}, ne = (u) => {
|
|
2050
2062
|
u.key === "Enter" || u.key === " " ? (u.preventDefault(), Y()) : u.key === "ArrowDown" && (u.preventDefault(), m.value = !0, oe(() => {
|
|
2051
2063
|
te(), n();
|
|
@@ -2057,18 +2069,18 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2057
2069
|
u.key === "ArrowDown" ? (u.preventDefault(), h.value = Math.min(y + 1, e.shortcuts.length - 1), a(h.value)) : u.key === "ArrowUp" ? (u.preventDefault(), h.value = Math.max(y - 1, 0), a(h.value)) : (u.key === "Enter" || u.key === " ") && (u.preventDefault(), w(e.shortcuts[y]));
|
|
2058
2070
|
}, b = (u) => {
|
|
2059
2071
|
h.value = u;
|
|
2060
|
-
},
|
|
2072
|
+
}, r = () => {
|
|
2061
2073
|
h.value = -1;
|
|
2062
2074
|
}, n = () => {
|
|
2063
2075
|
h.value = 0, a(0);
|
|
2064
2076
|
}, a = (u) => {
|
|
2065
|
-
if (
|
|
2066
|
-
const E =
|
|
2077
|
+
if (M.value) {
|
|
2078
|
+
const E = M.value.querySelectorAll(".nh-time-shortcut")[u];
|
|
2067
2079
|
E && E.focus();
|
|
2068
2080
|
}
|
|
2069
2081
|
}, w = (u) => {
|
|
2070
2082
|
const y = u.getValue();
|
|
2071
|
-
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y),
|
|
2083
|
+
e.includeTime && y.startDate && y.endDate && (y.startDate.setHours(0, 0, 0, 0), y.endDate.setHours(23, 59, 59, 999)), q(y), i.value = e.shortcuts.findIndex((E) => E.label === u.label), h.value = -1, m.value = !1;
|
|
2072
2084
|
}, N = (u, y) => {
|
|
2073
2085
|
if (!u || u.isDisabled) return;
|
|
2074
2086
|
let E;
|
|
@@ -2078,25 +2090,25 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2078
2090
|
if (E >= R.value)
|
|
2079
2091
|
e.includeTime && E.setHours(23, 59, 59, 999), D.value = E;
|
|
2080
2092
|
else {
|
|
2081
|
-
const
|
|
2082
|
-
e.includeTime &&
|
|
2093
|
+
const Q = R.value;
|
|
2094
|
+
e.includeTime && Q.setHours(23, 59, 59, 999), D.value = Q, R.value = E;
|
|
2083
2095
|
}
|
|
2084
2096
|
else
|
|
2085
2097
|
R.value = E, D.value = null;
|
|
2086
|
-
if (
|
|
2087
|
-
const
|
|
2088
|
-
e.includeTime &&
|
|
2098
|
+
if (i.value = -1, R.value && D.value) {
|
|
2099
|
+
const Q = new Date(D.value);
|
|
2100
|
+
e.includeTime && Q.setHours(23, 59, 59, 999), S.value = {
|
|
2089
2101
|
startDate: R.value,
|
|
2090
|
-
endDate:
|
|
2102
|
+
endDate: Q
|
|
2091
2103
|
};
|
|
2092
2104
|
} else
|
|
2093
2105
|
S.value = null;
|
|
2094
|
-
},
|
|
2106
|
+
}, B = (u, y) => {
|
|
2095
2107
|
if (!u) return ["nh-date-table-td"];
|
|
2096
2108
|
const E = ["nh-date-table-td"];
|
|
2097
2109
|
return u.isCurrentMonth || E.push("is-prev-month"), u.isToday && E.push("is-today"), u.isDisabled && E.push("is-disabled"), R.value && fe(u.date, R.value) && E.push("is-selected", "is-start"), D.value && fe(u.date, D.value) && E.push("is-selected", "is-end"), R.value && D.value && ve(u.date, R.value, D.value) && E.push("is-in-range"), E;
|
|
2098
2110
|
}, A = () => {
|
|
2099
|
-
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value),
|
|
2111
|
+
S.value && (e.includeTime && S.value.endDate && S.value.endDate.setHours(23, 59, 59, 999), q(S.value), i.value = ce(S.value), m.value = !1);
|
|
2100
2112
|
}, ee = () => {
|
|
2101
2113
|
q({ startDate: null, endDate: null }), he(), h.value = -1, m.value = !1;
|
|
2102
2114
|
}, G = () => {
|
|
@@ -2107,22 +2119,22 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2107
2119
|
const u = de(e.modelValue);
|
|
2108
2120
|
if (!u || !u.startDate || !u.endDate)
|
|
2109
2121
|
return "";
|
|
2110
|
-
const y = (
|
|
2111
|
-
const
|
|
2112
|
-
return `${
|
|
2113
|
-
}, E = y(u.startDate),
|
|
2114
|
-
return !e.includeTime && E ===
|
|
2122
|
+
const y = (Ce) => {
|
|
2123
|
+
const xe = String(Ce.getFullYear()), Te = String(Ce.getMonth() + 1).padStart(2, "0"), Ae = String(Ce.getDate()).padStart(2, "0");
|
|
2124
|
+
return `${xe}/${Te}/${Ae}`;
|
|
2125
|
+
}, E = y(u.startDate), Q = y(u.endDate);
|
|
2126
|
+
return !e.includeTime && E === Q ? E : `${E} - ${Q}`;
|
|
2115
2127
|
}), O = _(() => [
|
|
2116
2128
|
"nh-time-dropdown",
|
|
2117
2129
|
{
|
|
2118
2130
|
"nh-time-dropdown-top": !C.value.top,
|
|
2119
2131
|
"nh-time-dropdown-right": !C.value.left
|
|
2120
2132
|
}
|
|
2121
|
-
]),
|
|
2133
|
+
]), X = _(() => {
|
|
2122
2134
|
const u = de(e.modelValue);
|
|
2123
2135
|
return !!(u != null && u.startDate && (u != null && u.endDate));
|
|
2124
2136
|
}), le = _(() => !!(R.value && D.value)), he = () => {
|
|
2125
|
-
R.value = null, D.value = null, S.value = null,
|
|
2137
|
+
R.value = null, D.value = null, S.value = null, i.value = -1;
|
|
2126
2138
|
};
|
|
2127
2139
|
ge(() => e.modelValue, (u) => {
|
|
2128
2140
|
const y = de(u);
|
|
@@ -2137,7 +2149,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2137
2149
|
const E = new Date(c.value.year, c.value.month + 1);
|
|
2138
2150
|
g.value.year = E.getFullYear(), g.value.month = E.getMonth();
|
|
2139
2151
|
}
|
|
2140
|
-
(y != null && y.startDate || y != null && y.endDate) && x(), m.value || (
|
|
2152
|
+
(y != null && y.startDate || y != null && y.endDate) && x(), m.value || (i.value = ce(u));
|
|
2141
2153
|
}, { immediate: !0, deep: !0 }), ge([c, g], () => {
|
|
2142
2154
|
const u = new Date(c.value.year, c.value.month).getTime(), y = new Date(g.value.year, g.value.month).getTime();
|
|
2143
2155
|
if (u === y) {
|
|
@@ -2145,7 +2157,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2145
2157
|
g.value.year = E.getFullYear(), g.value.month = E.getMonth();
|
|
2146
2158
|
}
|
|
2147
2159
|
}, { deep: !0 }), Fe(() => {
|
|
2148
|
-
document.addEventListener("click",
|
|
2160
|
+
document.addEventListener("click", J), window.addEventListener("resize", G), window.addEventListener("scroll", G), i.value = ce(e.modelValue);
|
|
2149
2161
|
const u = de(e.modelValue);
|
|
2150
2162
|
if (u != null && u.startDate && (c.value.year = u.startDate.getFullYear(), c.value.month = u.startDate.getMonth()), u != null && u.endDate)
|
|
2151
2163
|
g.value.year = u.endDate.getFullYear(), g.value.month = u.endDate.getMonth();
|
|
@@ -2155,9 +2167,9 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2155
2167
|
}
|
|
2156
2168
|
x();
|
|
2157
2169
|
}), Oe(() => {
|
|
2158
|
-
document.removeEventListener("click",
|
|
2170
|
+
document.removeEventListener("click", J), window.removeEventListener("resize", G), window.removeEventListener("scroll", G);
|
|
2159
2171
|
});
|
|
2160
|
-
const
|
|
2172
|
+
const He = () => {
|
|
2161
2173
|
e.clearable && (q({ startDate: null, endDate: null }), he(), h.value = -1);
|
|
2162
2174
|
}, De = (u, y) => {
|
|
2163
2175
|
if (u === "start") {
|
|
@@ -2165,7 +2177,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2165
2177
|
c.value.year = E.getFullYear(), c.value.month = E.getMonth(), x();
|
|
2166
2178
|
} else {
|
|
2167
2179
|
const E = new Date(g.value.year, g.value.month + y, 1);
|
|
2168
|
-
g.value.year = E.getFullYear(), g.value.month = E.getMonth(),
|
|
2180
|
+
g.value.year = E.getFullYear(), g.value.month = E.getMonth(), H();
|
|
2169
2181
|
}
|
|
2170
2182
|
};
|
|
2171
2183
|
return (u, y) => {
|
|
@@ -2173,59 +2185,59 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2173
2185
|
return d(), p("div", {
|
|
2174
2186
|
class: Z(["nh-time-search", [`nh-time--${t.size}`]])
|
|
2175
2187
|
}, [
|
|
2176
|
-
|
|
2177
|
-
|
|
2188
|
+
s("div", pn, [
|
|
2189
|
+
s("div", {
|
|
2178
2190
|
ref_key: "trigger",
|
|
2179
2191
|
ref: $,
|
|
2180
2192
|
onClick: Y,
|
|
2181
2193
|
onKeydown: ne,
|
|
2182
|
-
class: Z(["nh-time-trigger", { "is-focus": m.value, "has-value":
|
|
2194
|
+
class: Z(["nh-time-trigger", { "is-focus": m.value, "has-value": X.value }]),
|
|
2183
2195
|
tabindex: "0"
|
|
2184
2196
|
}, [
|
|
2185
|
-
|
|
2197
|
+
s("input", {
|
|
2186
2198
|
readonly: "",
|
|
2187
2199
|
value: pe.value,
|
|
2188
2200
|
placeholder: t.placeholder,
|
|
2189
2201
|
class: "nh-time-input"
|
|
2190
|
-
}, null, 8,
|
|
2191
|
-
|
|
2192
|
-
t.clearable &&
|
|
2202
|
+
}, null, 8, yn),
|
|
2203
|
+
s("span", mn, [
|
|
2204
|
+
t.clearable && X.value ? (d(), p("i", {
|
|
2193
2205
|
key: 0,
|
|
2194
|
-
onClick: me(
|
|
2206
|
+
onClick: me(He, ["stop"]),
|
|
2195
2207
|
class: "nh-time-clear"
|
|
2196
2208
|
}, [...y[4] || (y[4] = [
|
|
2197
|
-
|
|
2209
|
+
s("svg", {
|
|
2198
2210
|
viewBox: "0 0 1024 1024",
|
|
2199
2211
|
width: "14",
|
|
2200
2212
|
height: "14"
|
|
2201
2213
|
}, [
|
|
2202
|
-
|
|
2214
|
+
s("path", {
|
|
2203
2215
|
d: "M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm165.4 618.2l-66-.3L512 563.4l-99.3 118.4-66.1.3c-4.4 0-8-3.5-8-8 0-1.9.7-3.7 1.9-5.2l130.1-155L340.5 359a8.32 8.32 0 0 1 1.9-11.2c1.5-1.2 3.3-1.9 5.2-1.9l66.1.3L512 464.6l99.3-118.4 66-.3c4.4 0 8 3.5 8 8 0 1.9-.7 3.7-1.9 5.2L553.5 514l130.1 155c1.2 1.5 1.9 3.3 1.9 5.2 0 4.4-3.6 8-8 8z",
|
|
2204
2216
|
fill: "currentColor"
|
|
2205
2217
|
})
|
|
2206
2218
|
], -1)
|
|
2207
2219
|
])])) : V("", !0),
|
|
2208
|
-
y[6] || (y[6] =
|
|
2209
|
-
|
|
2220
|
+
y[6] || (y[6] = s("i", { class: "nh-time-icon" }, [
|
|
2221
|
+
s("svg", {
|
|
2210
2222
|
viewBox: "0 0 1024 1024",
|
|
2211
2223
|
width: "14",
|
|
2212
2224
|
height: "14"
|
|
2213
2225
|
}, [
|
|
2214
|
-
|
|
2226
|
+
s("path", {
|
|
2215
2227
|
d: "M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zM648 248v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h112v120H152V248h112v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h312zm184 584H192V424h640v408z",
|
|
2216
2228
|
fill: "currentColor"
|
|
2217
2229
|
})
|
|
2218
2230
|
])
|
|
2219
2231
|
], -1)),
|
|
2220
|
-
|
|
2232
|
+
s("i", {
|
|
2221
2233
|
class: Z(["nh-time-arrow", { "is-reverse": m.value }])
|
|
2222
2234
|
}, [...y[5] || (y[5] = [
|
|
2223
|
-
|
|
2235
|
+
s("svg", {
|
|
2224
2236
|
viewBox: "0 0 1024 1024",
|
|
2225
2237
|
width: "12",
|
|
2226
2238
|
height: "12"
|
|
2227
2239
|
}, [
|
|
2228
|
-
|
|
2240
|
+
s("path", {
|
|
2229
2241
|
d: "M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3 0.1-12.7-6.4-12.7z",
|
|
2230
2242
|
fill: "currentColor"
|
|
2231
2243
|
})
|
|
@@ -2233,169 +2245,169 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2233
2245
|
])], 2)
|
|
2234
2246
|
])
|
|
2235
2247
|
], 34),
|
|
2236
|
-
|
|
2248
|
+
Ie(Ve, { name: "el-zoom-in-top" }, {
|
|
2237
2249
|
default: $e(() => [
|
|
2238
2250
|
m.value ? (d(), p("div", {
|
|
2239
2251
|
key: 0,
|
|
2240
2252
|
ref_key: "dropdown",
|
|
2241
|
-
ref:
|
|
2253
|
+
ref: M,
|
|
2242
2254
|
class: Z(O.value),
|
|
2243
2255
|
onKeydown: U
|
|
2244
2256
|
}, [
|
|
2245
|
-
|
|
2246
|
-
y[7] || (y[7] =
|
|
2247
|
-
|
|
2248
|
-
(d(!0), p(Se, null,
|
|
2249
|
-
key:
|
|
2250
|
-
onClick: (
|
|
2251
|
-
onKeydown: (
|
|
2252
|
-
onMouseenter: (
|
|
2253
|
-
onMouseleave:
|
|
2257
|
+
s("div", wn, [
|
|
2258
|
+
y[7] || (y[7] = s("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
2259
|
+
s("ul", bn, [
|
|
2260
|
+
(d(!0), p(Se, null, Be(t.shortcuts, (Q, Ce) => (d(), p("li", {
|
|
2261
|
+
key: Q.label,
|
|
2262
|
+
onClick: (xe) => w(Q),
|
|
2263
|
+
onKeydown: (xe) => ae(xe, Ce),
|
|
2264
|
+
onMouseenter: (xe) => b(Ce),
|
|
2265
|
+
onMouseleave: r,
|
|
2254
2266
|
class: Z([
|
|
2255
2267
|
"nh-time-shortcut",
|
|
2256
2268
|
{
|
|
2257
|
-
"is-active": h.value ===
|
|
2258
|
-
"is-selected":
|
|
2269
|
+
"is-active": h.value === Ce,
|
|
2270
|
+
"is-selected": i.value === Ce
|
|
2259
2271
|
}
|
|
2260
2272
|
]),
|
|
2261
2273
|
tabindex: "0"
|
|
2262
|
-
}, we(
|
|
2274
|
+
}, we(Q.label), 43, kn))), 128))
|
|
2263
2275
|
])
|
|
2264
2276
|
]),
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
y[8] || (y[8] =
|
|
2268
|
-
|
|
2269
|
-
!R.value && !D.value ? (d(), p("span",
|
|
2277
|
+
s("div", Cn, [
|
|
2278
|
+
s("div", xn, [
|
|
2279
|
+
y[8] || (y[8] = s("span", null, "自定义时间", -1)),
|
|
2280
|
+
s("div", Dn, [
|
|
2281
|
+
!R.value && !D.value ? (d(), p("span", $n, " 请选择开始日期 ")) : R.value && !D.value ? (d(), p("span", Sn, " 请选择结束日期 ")) : R.value && D.value ? (d(), p("span", In, " 已选择完整范围 ")) : V("", !0)
|
|
2270
2282
|
])
|
|
2271
2283
|
]),
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
onClick: y[0] || (y[0] = (
|
|
2284
|
+
s("div", Mn, [
|
|
2285
|
+
s("div", Tn, [
|
|
2286
|
+
s("div", Ln, [
|
|
2287
|
+
s("div", En, [
|
|
2288
|
+
s("button", {
|
|
2289
|
+
onClick: y[0] || (y[0] = (Q) => De("start", -1)),
|
|
2278
2290
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2279
2291
|
type: "button"
|
|
2280
2292
|
}, [...y[9] || (y[9] = [
|
|
2281
|
-
|
|
2293
|
+
s("svg", {
|
|
2282
2294
|
viewBox: "0 0 1024 1024",
|
|
2283
2295
|
width: "12",
|
|
2284
2296
|
height: "12"
|
|
2285
2297
|
}, [
|
|
2286
|
-
|
|
2298
|
+
s("path", {
|
|
2287
2299
|
d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",
|
|
2288
2300
|
fill: "currentColor"
|
|
2289
2301
|
})
|
|
2290
2302
|
], -1)
|
|
2291
2303
|
])]),
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
onClick: y[1] || (y[1] = (
|
|
2304
|
+
s("span", Hn, we(P(c.value.year, c.value.month)), 1),
|
|
2305
|
+
s("button", {
|
|
2306
|
+
onClick: y[1] || (y[1] = (Q) => De("start", 1)),
|
|
2295
2307
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2296
2308
|
type: "button"
|
|
2297
2309
|
}, [...y[10] || (y[10] = [
|
|
2298
|
-
|
|
2310
|
+
s("svg", {
|
|
2299
2311
|
viewBox: "0 0 1024 1024",
|
|
2300
2312
|
width: "12",
|
|
2301
2313
|
height: "12"
|
|
2302
2314
|
}, [
|
|
2303
|
-
|
|
2315
|
+
s("path", {
|
|
2304
2316
|
d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",
|
|
2305
2317
|
fill: "currentColor"
|
|
2306
2318
|
})
|
|
2307
2319
|
], -1)
|
|
2308
2320
|
])])
|
|
2309
2321
|
]),
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
(d(), p(Se, null,
|
|
2315
|
-
key:
|
|
2322
|
+
s("div", Bn, [
|
|
2323
|
+
s("table", _n, [
|
|
2324
|
+
s("thead", null, [
|
|
2325
|
+
s("tr", null, [
|
|
2326
|
+
(d(), p(Se, null, Be(W, (Q) => s("th", {
|
|
2327
|
+
key: Q,
|
|
2316
2328
|
class: "nh-date-table-th"
|
|
2317
|
-
}, we(
|
|
2329
|
+
}, we(Q), 1)), 64))
|
|
2318
2330
|
])
|
|
2319
2331
|
]),
|
|
2320
|
-
|
|
2321
|
-
(d(!0), p(Se, null,
|
|
2322
|
-
key: `start-week-${
|
|
2332
|
+
s("tbody", null, [
|
|
2333
|
+
(d(!0), p(Se, null, Be(re.value, (Q, Ce) => (d(), p("tr", {
|
|
2334
|
+
key: `start-week-${Ce}`
|
|
2323
2335
|
}, [
|
|
2324
|
-
(d(!0), p(Se, null,
|
|
2325
|
-
key: `start-day-${
|
|
2326
|
-
class: Z(
|
|
2327
|
-
onClick: (Ae) => N(
|
|
2336
|
+
(d(!0), p(Se, null, Be(Q, (xe, Te) => (d(), p("td", {
|
|
2337
|
+
key: `start-day-${Ce}-${Te}`,
|
|
2338
|
+
class: Z(B(xe)),
|
|
2339
|
+
onClick: (Ae) => N(xe, "start")
|
|
2328
2340
|
}, [
|
|
2329
|
-
|
|
2330
|
-
|
|
2341
|
+
s("div", Nn, [
|
|
2342
|
+
xe ? (d(), p("span", Kn, we(xe.day), 1)) : V("", !0)
|
|
2331
2343
|
])
|
|
2332
|
-
], 10,
|
|
2344
|
+
], 10, zn))), 128))
|
|
2333
2345
|
]))), 128))
|
|
2334
2346
|
])
|
|
2335
2347
|
])
|
|
2336
2348
|
])
|
|
2337
2349
|
])
|
|
2338
2350
|
]),
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
onClick: y[2] || (y[2] = (
|
|
2351
|
+
s("div", Wn, [
|
|
2352
|
+
s("div", Rn, [
|
|
2353
|
+
s("div", Vn, [
|
|
2354
|
+
s("button", {
|
|
2355
|
+
onClick: y[2] || (y[2] = (Q) => De("end", -1)),
|
|
2344
2356
|
class: "nh-date-picker-btn nh-date-picker-prev-btn",
|
|
2345
2357
|
type: "button"
|
|
2346
2358
|
}, [...y[11] || (y[11] = [
|
|
2347
|
-
|
|
2359
|
+
s("svg", {
|
|
2348
2360
|
viewBox: "0 0 1024 1024",
|
|
2349
2361
|
width: "12",
|
|
2350
2362
|
height: "12"
|
|
2351
2363
|
}, [
|
|
2352
|
-
|
|
2364
|
+
s("path", {
|
|
2353
2365
|
d: "M724 218.3V141c0-6.7-7.7-10.4-12.9-6.3L260.3 486.8a31.86 31.86 0 0 0 0 50.3l450.8 352.1c5.2 4.1 12.9 0.4 12.9-6.3v-77.3c0-4.9-2.3-9.6-6.1-12.6l-360-281 360-281.1c3.8-3 6.1-7.7 6.1-12.6z",
|
|
2354
2366
|
fill: "currentColor"
|
|
2355
2367
|
})
|
|
2356
2368
|
], -1)
|
|
2357
2369
|
])]),
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
onClick: y[3] || (y[3] = (
|
|
2370
|
+
s("span", An, we(P(g.value.year, g.value.month)), 1),
|
|
2371
|
+
s("button", {
|
|
2372
|
+
onClick: y[3] || (y[3] = (Q) => De("end", 1)),
|
|
2361
2373
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
2362
2374
|
type: "button"
|
|
2363
2375
|
}, [...y[12] || (y[12] = [
|
|
2364
|
-
|
|
2376
|
+
s("svg", {
|
|
2365
2377
|
viewBox: "0 0 1024 1024",
|
|
2366
2378
|
width: "12",
|
|
2367
2379
|
height: "12"
|
|
2368
2380
|
}, [
|
|
2369
|
-
|
|
2381
|
+
s("path", {
|
|
2370
2382
|
d: "M765.7 486.8L314.9 134.7A7.97 7.97 0 0 0 302 141v77.3c0 4.9 2.3 9.6 6.1 12.6l360 281.1-360 281.1c-3.8 3-6.1 7.7-6.1 12.6V883c0 6.7 7.7 10.4 12.9 6.3l450.8-352.1a31.96 31.96 0 0 0 0-50.4z",
|
|
2371
2383
|
fill: "currentColor"
|
|
2372
2384
|
})
|
|
2373
2385
|
], -1)
|
|
2374
2386
|
])])
|
|
2375
2387
|
]),
|
|
2376
|
-
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
(d(), p(Se, null,
|
|
2381
|
-
key:
|
|
2388
|
+
s("div", Pn, [
|
|
2389
|
+
s("table", Yn, [
|
|
2390
|
+
s("thead", null, [
|
|
2391
|
+
s("tr", null, [
|
|
2392
|
+
(d(), p(Se, null, Be(W, (Q) => s("th", {
|
|
2393
|
+
key: Q,
|
|
2382
2394
|
class: "nh-date-table-th"
|
|
2383
|
-
}, we(
|
|
2395
|
+
}, we(Q), 1)), 64))
|
|
2384
2396
|
])
|
|
2385
2397
|
]),
|
|
2386
|
-
|
|
2387
|
-
(d(!0), p(Se, null,
|
|
2388
|
-
key: `end-week-${
|
|
2398
|
+
s("tbody", null, [
|
|
2399
|
+
(d(!0), p(Se, null, Be(ue.value, (Q, Ce) => (d(), p("tr", {
|
|
2400
|
+
key: `end-week-${Ce}`
|
|
2389
2401
|
}, [
|
|
2390
|
-
(d(!0), p(Se, null,
|
|
2391
|
-
key: `end-day-${
|
|
2392
|
-
class: Z(
|
|
2393
|
-
onClick: (Ae) => N(
|
|
2402
|
+
(d(!0), p(Se, null, Be(Q, (xe, Te) => (d(), p("td", {
|
|
2403
|
+
key: `end-day-${Ce}-${Te}`,
|
|
2404
|
+
class: Z(B(xe)),
|
|
2405
|
+
onClick: (Ae) => N(xe, "end")
|
|
2394
2406
|
}, [
|
|
2395
|
-
|
|
2396
|
-
|
|
2407
|
+
s("div", On, [
|
|
2408
|
+
xe ? (d(), p("span", jn, we(xe.day), 1)) : V("", !0)
|
|
2397
2409
|
])
|
|
2398
|
-
], 10,
|
|
2410
|
+
], 10, Fn))), 128))
|
|
2399
2411
|
]))), 128))
|
|
2400
2412
|
])
|
|
2401
2413
|
])
|
|
@@ -2403,7 +2415,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2403
2415
|
])
|
|
2404
2416
|
])
|
|
2405
2417
|
]),
|
|
2406
|
-
|
|
2418
|
+
s("div", qn, [
|
|
2407
2419
|
t.clearable ? (d(), Pe(E, {
|
|
2408
2420
|
key: 0,
|
|
2409
2421
|
onClick: ee,
|
|
@@ -2415,7 +2427,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2415
2427
|
])]),
|
|
2416
2428
|
_: 1
|
|
2417
2429
|
}, 8, ["size"])) : V("", !0),
|
|
2418
|
-
|
|
2430
|
+
Ie(E, {
|
|
2419
2431
|
onClick: A,
|
|
2420
2432
|
disabled: !le.value,
|
|
2421
2433
|
variant: "primary",
|
|
@@ -2436,11 +2448,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2436
2448
|
], 2);
|
|
2437
2449
|
};
|
|
2438
2450
|
}
|
|
2439
|
-
}), St = /* @__PURE__ */ ze(
|
|
2451
|
+
}), St = /* @__PURE__ */ ze(Un, [["__scopeId", "data-v-e9e4d1b1"]]), Gn = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], Zn = { class: "yswitch__thumb" }, Qn = {
|
|
2440
2452
|
key: 0,
|
|
2441
2453
|
class: "yswitch__spinner",
|
|
2442
2454
|
"aria-hidden": "true"
|
|
2443
|
-
},
|
|
2455
|
+
}, Jn = /* @__PURE__ */ _e({
|
|
2444
2456
|
__name: "yswitch",
|
|
2445
2457
|
props: {
|
|
2446
2458
|
modelValue: { default: !1 },
|
|
@@ -2457,7 +2469,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2457
2469
|
},
|
|
2458
2470
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2459
2471
|
setup(t, { emit: f }) {
|
|
2460
|
-
const e = t, l = f, m =
|
|
2472
|
+
const e = t, l = f, m = I(), h = _(() => e.modelValue === e.trueValue), i = _(() => {
|
|
2461
2473
|
const $ = {};
|
|
2462
2474
|
return $.background = h.value ? e.activeColor : e.inactiveColor, $;
|
|
2463
2475
|
});
|
|
@@ -2468,15 +2480,15 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2468
2480
|
}
|
|
2469
2481
|
return Fe(() => {
|
|
2470
2482
|
const $ = m.value;
|
|
2471
|
-
$ && ($.addEventListener("focus", (
|
|
2472
|
-
}), ($,
|
|
2483
|
+
$ && ($.addEventListener("focus", (M) => l("focus", M)), $.addEventListener("blur", (M) => l("blur", M)));
|
|
2484
|
+
}), ($, M) => (d(), p("button", {
|
|
2473
2485
|
ref_key: "rootEl",
|
|
2474
2486
|
ref: m,
|
|
2475
2487
|
class: Z(["yswitch", [
|
|
2476
2488
|
`yswitch--${t.size}`,
|
|
2477
2489
|
{ "yswitch--checked": h.value, "yswitch--disabled": t.disabled, "yswitch--loading": t.loading }
|
|
2478
2490
|
]]),
|
|
2479
|
-
style: be(
|
|
2491
|
+
style: be(i.value),
|
|
2480
2492
|
role: "switch",
|
|
2481
2493
|
"aria-checked": h.value,
|
|
2482
2494
|
"aria-disabled": t.disabled,
|
|
@@ -2487,17 +2499,17 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2487
2499
|
Ke(me(S, ["prevent"]), ["space"])
|
|
2488
2500
|
]
|
|
2489
2501
|
}, [
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
t.loading ? (d(), p("span",
|
|
2502
|
+
M[0] || (M[0] = s("span", { class: "yswitch__track" }, null, -1)),
|
|
2503
|
+
s("span", Zn, [
|
|
2504
|
+
t.loading ? (d(), p("span", Qn)) : V("", !0)
|
|
2493
2505
|
]),
|
|
2494
2506
|
t.showText ? (d(), p("span", {
|
|
2495
2507
|
key: 0,
|
|
2496
2508
|
class: Z(["yswitch__label", { "yswitch__label--left": !h.value, "yswitch__label--right": h.value }])
|
|
2497
2509
|
}, we(h.value ? t.activeText : t.inactiveText), 3)) : V("", !0)
|
|
2498
|
-
], 46,
|
|
2510
|
+
], 46, Gn));
|
|
2499
2511
|
}
|
|
2500
|
-
}),
|
|
2512
|
+
}), It = /* @__PURE__ */ ze(Jn, [["__scopeId", "data-v-0b157fc4"]]), Xn = ["src", "alt"], ea = ["src", "alt"], ta = ["src"], la = /* @__PURE__ */ _e({
|
|
2501
2513
|
__name: "yimage",
|
|
2502
2514
|
props: {
|
|
2503
2515
|
src: {},
|
|
@@ -2516,7 +2528,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2516
2528
|
},
|
|
2517
2529
|
emits: ["load", "error", "preview"],
|
|
2518
2530
|
setup(t, { expose: f, emit: e }) {
|
|
2519
|
-
const l = t, m = e, h =
|
|
2531
|
+
const l = t, m = e, h = I(), i = I(), S = I(), $ = I(!1), M = I(!1), C = I(!1), c = I(!1), g = I(!1), x = I("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), H = I(""), W = I(1), R = I(!1), D = I({
|
|
2520
2532
|
visible: !1,
|
|
2521
2533
|
src: "",
|
|
2522
2534
|
top: 0,
|
|
@@ -2526,7 +2538,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2526
2538
|
isHoveringPreview: !1
|
|
2527
2539
|
});
|
|
2528
2540
|
let z = null;
|
|
2529
|
-
const j =
|
|
2541
|
+
const j = I({
|
|
2530
2542
|
overflow: "",
|
|
2531
2543
|
paddingRight: ""
|
|
2532
2544
|
}), ye = {
|
|
@@ -2558,91 +2570,91 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2558
2570
|
backgroundColor: "#fff"
|
|
2559
2571
|
};
|
|
2560
2572
|
return l.width && (O.width = typeof l.width == "number" ? `${l.width}px` : l.width), l.height && (O.height = typeof l.height == "number" ? `${l.height}px` : l.height), K.value && (O.borderRadius = K.value), O;
|
|
2561
|
-
}), ce = _(() =>
|
|
2573
|
+
}), ce = _(() => H.value ? H.value : Array.isArray(l.previewSrcList) ? l.previewSrcList.find(Boolean) || l.src : l.previewSrcList || l.src), ie = _(() => Array.isArray(l.previewSrcList) ? l.previewSrcList.find(Boolean) || l.src : l.previewSrcList || l.src), q = () => {
|
|
2562
2574
|
const O = document.createElement("div");
|
|
2563
2575
|
O.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(O);
|
|
2564
|
-
const
|
|
2565
|
-
return document.body.removeChild(O),
|
|
2576
|
+
const X = O.offsetWidth - O.clientWidth;
|
|
2577
|
+
return document.body.removeChild(O), X;
|
|
2566
2578
|
}, te = () => {
|
|
2567
2579
|
if (j.value = {
|
|
2568
2580
|
overflow: document.body.style.overflow || "",
|
|
2569
2581
|
paddingRight: document.body.style.paddingRight || ""
|
|
2570
2582
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2571
|
-
const
|
|
2572
|
-
document.body.style.paddingRight = `${
|
|
2583
|
+
const X = q();
|
|
2584
|
+
document.body.style.paddingRight = `${X}px`;
|
|
2573
2585
|
}
|
|
2574
2586
|
document.body.style.overflow = "hidden";
|
|
2575
2587
|
}, Y = () => {
|
|
2576
2588
|
document.body.style.overflow = j.value.overflow, document.body.style.paddingRight = j.value.paddingRight;
|
|
2577
2589
|
};
|
|
2578
|
-
let
|
|
2590
|
+
let J = null;
|
|
2579
2591
|
const ne = () => {
|
|
2580
|
-
!l.lazy || !h.value || (
|
|
2592
|
+
!l.lazy || !h.value || (J = new IntersectionObserver(
|
|
2581
2593
|
(O) => {
|
|
2582
|
-
O.forEach((
|
|
2583
|
-
|
|
2594
|
+
O.forEach((X) => {
|
|
2595
|
+
X.isIntersecting && (c.value = !0, x.value = l.src, J == null || J.unobserve(X.target));
|
|
2584
2596
|
});
|
|
2585
2597
|
},
|
|
2586
2598
|
{
|
|
2587
2599
|
rootMargin: "50px"
|
|
2588
2600
|
}
|
|
2589
|
-
),
|
|
2601
|
+
), J.observe(h.value));
|
|
2590
2602
|
}, U = (O) => {
|
|
2591
|
-
$.value = !0,
|
|
2603
|
+
$.value = !0, M.value = !1, C.value = !1, m("load", O);
|
|
2592
2604
|
}, ae = (O) => {
|
|
2593
|
-
C.value = !0,
|
|
2605
|
+
C.value = !0, M.value = !1, $.value = !1, m("error", O);
|
|
2594
2606
|
}, b = () => {
|
|
2595
|
-
C.value = !1,
|
|
2596
|
-
|
|
2607
|
+
C.value = !1, M.value = !0, $.value = !1, oe(() => {
|
|
2608
|
+
i.value && (i.value.src = l.src);
|
|
2597
2609
|
});
|
|
2598
|
-
},
|
|
2610
|
+
}, r = () => Array.isArray(l.previewSrcList) ? l.previewSrcList.find(Boolean) || l.src : l.previewSrcList || l.src, n = () => {
|
|
2599
2611
|
l.preview && (l.previewSrcList || l.src) ? a() : b();
|
|
2600
2612
|
}, a = () => {
|
|
2601
2613
|
if (!l.preview) return;
|
|
2602
2614
|
W.value = 1;
|
|
2603
|
-
const O =
|
|
2604
|
-
if (
|
|
2605
|
-
|
|
2615
|
+
const O = r();
|
|
2616
|
+
if (i.value && i.value.complete && i.value.naturalWidth > 0) {
|
|
2617
|
+
H.value = O, oe(() => {
|
|
2606
2618
|
g.value = !0, te(), m("preview", O);
|
|
2607
2619
|
});
|
|
2608
2620
|
return;
|
|
2609
2621
|
}
|
|
2610
|
-
const
|
|
2622
|
+
const X = new Image();
|
|
2611
2623
|
let le = null, he = !1;
|
|
2612
|
-
const
|
|
2613
|
-
he || (he = !0, le && (clearTimeout(le), le = null),
|
|
2624
|
+
const He = () => {
|
|
2625
|
+
he || (he = !0, le && (clearTimeout(le), le = null), H.value = O, oe(() => {
|
|
2614
2626
|
g.value = !0, te(), m("preview", O);
|
|
2615
2627
|
}));
|
|
2616
2628
|
};
|
|
2617
2629
|
le = setTimeout(() => {
|
|
2618
|
-
|
|
2619
|
-
}, 500),
|
|
2620
|
-
|
|
2621
|
-
},
|
|
2622
|
-
|
|
2623
|
-
},
|
|
2630
|
+
He();
|
|
2631
|
+
}, 500), X.onload = () => {
|
|
2632
|
+
He();
|
|
2633
|
+
}, X.onerror = () => {
|
|
2634
|
+
He();
|
|
2635
|
+
}, X.src = O, X.complete && He();
|
|
2624
2636
|
}, w = () => {
|
|
2625
2637
|
g.value = !1, setTimeout(() => {
|
|
2626
2638
|
Y();
|
|
2627
2639
|
}, 300);
|
|
2628
2640
|
}, N = (O) => {
|
|
2629
|
-
const
|
|
2630
|
-
let he = W.value +
|
|
2641
|
+
const X = O.deltaY < 0 ? 1 : -1;
|
|
2642
|
+
let he = W.value + X * 0.1;
|
|
2631
2643
|
he = Math.max(0.5, Math.min(2, he)), W.value = he;
|
|
2632
2644
|
};
|
|
2633
|
-
function
|
|
2645
|
+
function B(O) {
|
|
2634
2646
|
if (!(O instanceof HTMLElement)) return;
|
|
2635
|
-
const
|
|
2636
|
-
let De =
|
|
2637
|
-
De + D.value.width > he - le && (De =
|
|
2638
|
-
let u =
|
|
2639
|
-
u + D.value.height >
|
|
2647
|
+
const X = O.getBoundingClientRect(), le = 12, he = window.innerWidth || document.documentElement.clientWidth, He = window.innerHeight || document.documentElement.clientHeight;
|
|
2648
|
+
let De = X.right + le;
|
|
2649
|
+
De + D.value.width > he - le && (De = X.left - D.value.width - le);
|
|
2650
|
+
let u = X.top;
|
|
2651
|
+
u + D.value.height > He - le && (u = He - D.value.height - le), u < le && (u = le), De < le && (De = le), D.value.left = De, D.value.top = u;
|
|
2640
2652
|
}
|
|
2641
2653
|
function A(O) {
|
|
2642
|
-
l.hoverPreview && (z && (clearTimeout(z), z = null), D.value.isHoveringPreview = !1, D.value.src = ie.value, D.value.width = l.hoverPreviewWidth, D.value.height = l.hoverPreviewHeight, D.value.visible = !0,
|
|
2654
|
+
l.hoverPreview && (z && (clearTimeout(z), z = null), D.value.isHoveringPreview = !1, D.value.src = ie.value, D.value.width = l.hoverPreviewWidth, D.value.height = l.hoverPreviewHeight, D.value.visible = !0, B(O.currentTarget));
|
|
2643
2655
|
}
|
|
2644
2656
|
function ee(O) {
|
|
2645
|
-
l.hoverPreview && D.value.visible && (z && (clearTimeout(z), z = null),
|
|
2657
|
+
l.hoverPreview && D.value.visible && (z && (clearTimeout(z), z = null), B(O.currentTarget));
|
|
2646
2658
|
}
|
|
2647
2659
|
function G() {
|
|
2648
2660
|
l.hoverPreview && (D.value.isHoveringPreview || (z && (clearTimeout(z), z = null), z = setTimeout(() => {
|
|
@@ -2656,17 +2668,17 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2656
2668
|
l.hoverPreview && (D.value.isHoveringPreview = !1, D.value.visible = !1, D.value.src = "", z && (clearTimeout(z), z = null));
|
|
2657
2669
|
}
|
|
2658
2670
|
return Fe(() => {
|
|
2659
|
-
l.lazy ? ne() : c.value = !0, c.value && (
|
|
2671
|
+
l.lazy ? ne() : c.value = !0, c.value && (M.value = !0), R.value = !0;
|
|
2660
2672
|
}), Oe(() => {
|
|
2661
|
-
|
|
2673
|
+
J && J.disconnect(), g.value && Y(), z && (clearTimeout(z), z = null);
|
|
2662
2674
|
}), ge(() => x.value, () => {
|
|
2663
|
-
l.src && c.value && (
|
|
2675
|
+
l.src && c.value && (M.value = !0, C.value = !1, $.value = !1);
|
|
2664
2676
|
}), ge(() => l.src, (O) => {
|
|
2665
2677
|
x.value = O || "";
|
|
2666
2678
|
}), f({
|
|
2667
2679
|
retryLoad: b,
|
|
2668
2680
|
closePreview: w
|
|
2669
|
-
}), (O,
|
|
2681
|
+
}), (O, X) => (d(), p("div", {
|
|
2670
2682
|
ref_key: "containerRef",
|
|
2671
2683
|
ref: h,
|
|
2672
2684
|
class: Z(["yimage-container", de.value])
|
|
@@ -2675,15 +2687,15 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2675
2687
|
key: 0,
|
|
2676
2688
|
class: "yimage-placeholder",
|
|
2677
2689
|
style: be(P.value)
|
|
2678
|
-
}, [...
|
|
2679
|
-
|
|
2680
|
-
|
|
2690
|
+
}, [...X[1] || (X[1] = [
|
|
2691
|
+
s("div", { class: "yimage-placeholder-content" }, [
|
|
2692
|
+
s("svg", {
|
|
2681
2693
|
class: "yimage-placeholder-icon",
|
|
2682
2694
|
fill: "none",
|
|
2683
2695
|
stroke: "currentColor",
|
|
2684
2696
|
viewBox: "0 0 24 24"
|
|
2685
2697
|
}, [
|
|
2686
|
-
|
|
2698
|
+
s("path", {
|
|
2687
2699
|
"stroke-linecap": "round",
|
|
2688
2700
|
"stroke-linejoin": "round",
|
|
2689
2701
|
"stroke-width": "2",
|
|
@@ -2692,13 +2704,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2692
2704
|
])
|
|
2693
2705
|
], -1)
|
|
2694
2706
|
])], 4)) : V("", !0),
|
|
2695
|
-
|
|
2707
|
+
M.value && !C.value ? (d(), p("div", {
|
|
2696
2708
|
key: 1,
|
|
2697
2709
|
class: "yimage-loading",
|
|
2698
2710
|
style: be(P.value)
|
|
2699
|
-
}, [...
|
|
2700
|
-
|
|
2701
|
-
|
|
2711
|
+
}, [...X[2] || (X[2] = [
|
|
2712
|
+
s("div", { class: "yimage-loading-content" }, [
|
|
2713
|
+
s("div", { class: "yimage-spinner" })
|
|
2702
2714
|
], -1)
|
|
2703
2715
|
])], 4)) : V("", !0),
|
|
2704
2716
|
C.value ? (d(), p("div", {
|
|
@@ -2707,16 +2719,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2707
2719
|
style: be(P.value),
|
|
2708
2720
|
onClick: n
|
|
2709
2721
|
}, [
|
|
2710
|
-
|
|
2722
|
+
s("img", {
|
|
2711
2723
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2712
2724
|
alt: "Error Image",
|
|
2713
2725
|
class: "yimage-error-image",
|
|
2714
2726
|
style: be(P.value)
|
|
2715
2727
|
}, null, 4)
|
|
2716
2728
|
], 4)) : V("", !0),
|
|
2717
|
-
je(
|
|
2729
|
+
je(s("img", {
|
|
2718
2730
|
ref_key: "imageRef",
|
|
2719
|
-
ref:
|
|
2731
|
+
ref: i,
|
|
2720
2732
|
src: x.value,
|
|
2721
2733
|
alt: t.alt,
|
|
2722
2734
|
class: Z(fe.value),
|
|
@@ -2727,10 +2739,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2727
2739
|
onMouseleave: G,
|
|
2728
2740
|
onMousemove: ee,
|
|
2729
2741
|
style: be(ve.value)
|
|
2730
|
-
}, null, 46,
|
|
2742
|
+
}, null, 46, Xn), [
|
|
2731
2743
|
[Ze, $.value && !C.value]
|
|
2732
2744
|
]),
|
|
2733
|
-
l.preview && (!$.value ||
|
|
2745
|
+
l.preview && (!$.value || M.value || C.value || !c.value) ? (d(), p("div", {
|
|
2734
2746
|
key: 3,
|
|
2735
2747
|
class: "yimage-preview-trigger",
|
|
2736
2748
|
onClick: me(a, ["stop"])
|
|
@@ -2739,7 +2751,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2739
2751
|
key: 4,
|
|
2740
2752
|
to: "body"
|
|
2741
2753
|
}, [
|
|
2742
|
-
|
|
2754
|
+
Ie(Ve, { name: "fade" }, {
|
|
2743
2755
|
default: $e(() => [
|
|
2744
2756
|
g.value ? (d(), p("div", {
|
|
2745
2757
|
key: 0,
|
|
@@ -2747,19 +2759,19 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2747
2759
|
onClick: me(w, ["self"]),
|
|
2748
2760
|
onWheel: me(N, ["prevent"])
|
|
2749
2761
|
}, [
|
|
2750
|
-
|
|
2762
|
+
s("div", {
|
|
2751
2763
|
class: Z(["yimage-preview-content", { "is-active": g.value }])
|
|
2752
2764
|
}, [
|
|
2753
|
-
|
|
2765
|
+
s("img", {
|
|
2754
2766
|
ref_key: "previewImageRef",
|
|
2755
2767
|
ref: S,
|
|
2756
2768
|
src: ce.value,
|
|
2757
2769
|
alt: t.alt,
|
|
2758
2770
|
class: "yimage-preview-image",
|
|
2759
2771
|
style: be({ transform: `scale(${W.value})` }),
|
|
2760
|
-
onClick:
|
|
2772
|
+
onClick: X[0] || (X[0] = me(() => {
|
|
2761
2773
|
}, ["stop"]))
|
|
2762
|
-
}, null, 12,
|
|
2774
|
+
}, null, 12, ea)
|
|
2763
2775
|
], 2)
|
|
2764
2776
|
], 32)) : V("", !0)
|
|
2765
2777
|
]),
|
|
@@ -2770,7 +2782,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2770
2782
|
key: 5,
|
|
2771
2783
|
to: "body"
|
|
2772
2784
|
}, [
|
|
2773
|
-
|
|
2785
|
+
Ie(Ve, {
|
|
2774
2786
|
name: "hover-preview-fade",
|
|
2775
2787
|
appear: ""
|
|
2776
2788
|
}, {
|
|
@@ -2787,10 +2799,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2787
2799
|
onMouseenter: re,
|
|
2788
2800
|
onMouseleave: ue
|
|
2789
2801
|
}, [
|
|
2790
|
-
|
|
2802
|
+
s("img", {
|
|
2791
2803
|
src: D.value.src,
|
|
2792
2804
|
alt: "图片预览"
|
|
2793
|
-
}, null, 8,
|
|
2805
|
+
}, null, 8, ta)
|
|
2794
2806
|
], 36)) : V("", !0)
|
|
2795
2807
|
]),
|
|
2796
2808
|
_: 1
|
|
@@ -2798,7 +2810,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2798
2810
|
])) : V("", !0)
|
|
2799
2811
|
], 2));
|
|
2800
2812
|
}
|
|
2801
|
-
}),
|
|
2813
|
+
}), na = /* @__PURE__ */ ze(la, [["__scopeId", "data-v-f3813dec"]]), aa = /* @__PURE__ */ _e({
|
|
2802
2814
|
__name: "ydropdown",
|
|
2803
2815
|
props: {
|
|
2804
2816
|
trigger: { default: "hover" },
|
|
@@ -2807,9 +2819,9 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2807
2819
|
menuWidth: { default: void 0 }
|
|
2808
2820
|
},
|
|
2809
2821
|
setup(t) {
|
|
2810
|
-
const f = t, e =
|
|
2822
|
+
const f = t, e = I(!1), l = I();
|
|
2811
2823
|
let m = null;
|
|
2812
|
-
const h = _(() => `y-dropdown__menu--${f.placement}`),
|
|
2824
|
+
const h = _(() => `y-dropdown__menu--${f.placement}`), i = _(() => {
|
|
2813
2825
|
if (!f.menuWidth) return {};
|
|
2814
2826
|
const g = typeof f.menuWidth == "number" ? `${f.menuWidth}px` : f.menuWidth;
|
|
2815
2827
|
return {
|
|
@@ -2819,34 +2831,34 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2819
2831
|
};
|
|
2820
2832
|
}), S = () => {
|
|
2821
2833
|
console.log("显示下拉菜单", e.value), !f.disabled && (m && (clearTimeout(m), m = null), e.value = !0, console.log("设置 visible 为 true", e.value), oe(() => {
|
|
2822
|
-
|
|
2834
|
+
M();
|
|
2823
2835
|
}));
|
|
2824
2836
|
}, $ = () => {
|
|
2825
2837
|
console.log("隐藏下拉菜单"), m = setTimeout(() => {
|
|
2826
2838
|
e.value = !1, console.log("设置 visible 为 false", e.value);
|
|
2827
2839
|
}, 150);
|
|
2828
|
-
},
|
|
2840
|
+
}, M = () => {
|
|
2829
2841
|
if (!l.value) return;
|
|
2830
2842
|
const g = l.value.querySelector(".y-dropdown__trigger"), x = l.value.querySelector(".y-dropdown__menu");
|
|
2831
2843
|
if (!g || !x) return;
|
|
2832
|
-
const
|
|
2844
|
+
const H = g.getBoundingClientRect(), W = x.getBoundingClientRect(), R = window.innerWidth, D = window.innerHeight;
|
|
2833
2845
|
x.style.top = "", x.style.left = "", x.style.right = "", x.style.bottom = "", x.style.transform = "";
|
|
2834
2846
|
let z = 0, j = 0;
|
|
2835
2847
|
switch (f.placement) {
|
|
2836
2848
|
case "bottom":
|
|
2837
|
-
z =
|
|
2849
|
+
z = H.height + 4, j = 0;
|
|
2838
2850
|
break;
|
|
2839
2851
|
case "top":
|
|
2840
2852
|
z = -(W.height + 4), j = 0;
|
|
2841
2853
|
break;
|
|
2842
2854
|
case "right":
|
|
2843
|
-
z = 0, j =
|
|
2855
|
+
z = 0, j = H.width + 4;
|
|
2844
2856
|
break;
|
|
2845
2857
|
case "left":
|
|
2846
2858
|
z = 0, j = -(W.width + 4);
|
|
2847
2859
|
break;
|
|
2848
2860
|
}
|
|
2849
|
-
let ye =
|
|
2861
|
+
let ye = H.top + z, de = H.left + j;
|
|
2850
2862
|
if (f.placement === "bottom" || f.placement === "top") {
|
|
2851
2863
|
const K = W.width || 260;
|
|
2852
2864
|
de + K > R - 10 && (de = R - K - 10), de < 10 && (de = 10);
|
|
@@ -2859,7 +2871,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2859
2871
|
}, C = (g) => {
|
|
2860
2872
|
f.trigger === "click" && l.value && !l.value.contains(g.target) && (e.value = !1);
|
|
2861
2873
|
}, c = () => {
|
|
2862
|
-
e.value &&
|
|
2874
|
+
e.value && M();
|
|
2863
2875
|
};
|
|
2864
2876
|
return Fe(() => {
|
|
2865
2877
|
f.trigger === "click" && document.addEventListener("click", C), window.addEventListener("resize", c), window.addEventListener("scroll", c);
|
|
@@ -2869,7 +2881,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2869
2881
|
() => f.menuWidth,
|
|
2870
2882
|
() => {
|
|
2871
2883
|
e.value && oe(() => {
|
|
2872
|
-
|
|
2884
|
+
M();
|
|
2873
2885
|
});
|
|
2874
2886
|
}
|
|
2875
2887
|
), (g, x) => (d(), p("div", {
|
|
@@ -2877,30 +2889,30 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2877
2889
|
ref_key: "dropdownRef",
|
|
2878
2890
|
ref: l
|
|
2879
2891
|
}, [
|
|
2880
|
-
|
|
2892
|
+
s("div", {
|
|
2881
2893
|
class: "y-dropdown__trigger",
|
|
2882
2894
|
onMouseenter: S,
|
|
2883
2895
|
onMouseleave: $
|
|
2884
2896
|
}, [
|
|
2885
|
-
|
|
2886
|
-
x[0] || (x[0] =
|
|
2897
|
+
ke(g.$slots, "trigger", {}, () => [
|
|
2898
|
+
x[0] || (x[0] = s("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2887
2899
|
], !0)
|
|
2888
2900
|
], 32),
|
|
2889
|
-
|
|
2901
|
+
Ie(Ve, {
|
|
2890
2902
|
name: "dropdown-fade",
|
|
2891
2903
|
appear: ""
|
|
2892
2904
|
}, {
|
|
2893
2905
|
default: $e(() => [
|
|
2894
|
-
je(
|
|
2906
|
+
je(s("div", {
|
|
2895
2907
|
class: Z(["y-dropdown__menu", h.value]),
|
|
2896
|
-
style: be(
|
|
2908
|
+
style: be(i.value),
|
|
2897
2909
|
onMouseenter: S,
|
|
2898
2910
|
onMouseleave: $
|
|
2899
2911
|
}, [
|
|
2900
|
-
|
|
2901
|
-
x[1] || (x[1] =
|
|
2902
|
-
x[2] || (x[2] =
|
|
2903
|
-
x[3] || (x[3] =
|
|
2912
|
+
ke(g.$slots, "default", {}, () => [
|
|
2913
|
+
x[1] || (x[1] = s("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2914
|
+
x[2] || (x[2] = s("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2915
|
+
x[3] || (x[3] = s("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
2904
2916
|
], !0)
|
|
2905
2917
|
], 38), [
|
|
2906
2918
|
[Ze, e.value]
|
|
@@ -2910,13 +2922,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2910
2922
|
})
|
|
2911
2923
|
], 512));
|
|
2912
2924
|
}
|
|
2913
|
-
}),
|
|
2925
|
+
}), oa = /* @__PURE__ */ ze(aa, [["__scopeId", "data-v-ada3172a"]]), sa = ["aria-hidden"], ia = ["onKeydown"], ra = {
|
|
2914
2926
|
key: 0,
|
|
2915
2927
|
class: "y-drawer-header"
|
|
2916
|
-
},
|
|
2928
|
+
}, ua = { class: "y-drawer-title" }, da = { class: "y-drawer-body" }, ca = {
|
|
2917
2929
|
key: 1,
|
|
2918
2930
|
class: "y-drawer-footer"
|
|
2919
|
-
},
|
|
2931
|
+
}, fa = /* @__PURE__ */ _e({
|
|
2920
2932
|
__name: "ydrawer",
|
|
2921
2933
|
props: {
|
|
2922
2934
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2934,11 +2946,11 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2934
2946
|
const e = t, l = f, m = _({
|
|
2935
2947
|
get: () => e.modelValue,
|
|
2936
2948
|
set: (x) => l("update:modelValue", x)
|
|
2937
|
-
}), h =
|
|
2949
|
+
}), h = I(null), i = _(() => e.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), S = _(() => e.placement === "right" ? "rounded-left" : "rounded-top"), $ = _(() => {
|
|
2938
2950
|
const x = {};
|
|
2939
2951
|
return e.placement === "right" ? (x.width = typeof e.width == "number" ? `${e.width}px` : String(e.width), x.height = "100%", x.right = "0", x.top = "0") : (x.height = typeof e.height == "number" ? `${e.height}px` : String(e.height), x.width = "100%", x.bottom = "0", x.left = "0"), x;
|
|
2940
2952
|
});
|
|
2941
|
-
function
|
|
2953
|
+
function M() {
|
|
2942
2954
|
e.maskClosable && C();
|
|
2943
2955
|
}
|
|
2944
2956
|
function C() {
|
|
@@ -2952,28 +2964,28 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2952
2964
|
}
|
|
2953
2965
|
return ge(() => e.modelValue, (x) => {
|
|
2954
2966
|
x ? (l("open"), requestAnimationFrame(() => {
|
|
2955
|
-
var
|
|
2956
|
-
return (
|
|
2967
|
+
var H;
|
|
2968
|
+
return (H = h.value) == null ? void 0 : H.focus();
|
|
2957
2969
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2958
2970
|
}), Fe(() => {
|
|
2959
2971
|
e.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2960
2972
|
}), Oe(() => {
|
|
2961
2973
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2962
|
-
}), (x,
|
|
2963
|
-
je(
|
|
2974
|
+
}), (x, H) => (d(), Pe(Xe, { to: "body" }, [
|
|
2975
|
+
je(s("div", {
|
|
2964
2976
|
class: "y-drawer-root",
|
|
2965
2977
|
role: "dialog",
|
|
2966
2978
|
"aria-modal": !0,
|
|
2967
2979
|
"aria-hidden": !m.value,
|
|
2968
2980
|
style: be({ zIndex: String(t.zIndex) })
|
|
2969
2981
|
}, [
|
|
2970
|
-
|
|
2982
|
+
s("div", {
|
|
2971
2983
|
class: "y-drawer-mask",
|
|
2972
|
-
onClick:
|
|
2984
|
+
onClick: M
|
|
2973
2985
|
}),
|
|
2974
|
-
|
|
2986
|
+
Ie(Ve, { name: i.value }, {
|
|
2975
2987
|
default: $e(() => [
|
|
2976
|
-
je(
|
|
2988
|
+
je(s("div", {
|
|
2977
2989
|
ref_key: "panelRef",
|
|
2978
2990
|
ref: h,
|
|
2979
2991
|
class: Z(["y-drawer-panel", [
|
|
@@ -2984,8 +2996,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2984
2996
|
onKeydown: Ke(me(c, ["prevent", "stop"]), ["esc"]),
|
|
2985
2997
|
tabindex: "-1"
|
|
2986
2998
|
}, [
|
|
2987
|
-
t.showHeader ? (d(), p("div",
|
|
2988
|
-
|
|
2999
|
+
t.showHeader ? (d(), p("div", ra, [
|
|
3000
|
+
s("div", ua, we(t.title), 1),
|
|
2989
3001
|
t.closable ? (d(), p("button", {
|
|
2990
3002
|
key: 0,
|
|
2991
3003
|
type: "button",
|
|
@@ -2994,42 +3006,42 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
2994
3006
|
onClick: C
|
|
2995
3007
|
}, " ✕ ")) : V("", !0)
|
|
2996
3008
|
])) : V("", !0),
|
|
2997
|
-
|
|
2998
|
-
|
|
3009
|
+
s("div", da, [
|
|
3010
|
+
ke(x.$slots, "default", {}, void 0, !0)
|
|
2999
3011
|
]),
|
|
3000
|
-
x.$slots.footer ? (d(), p("div",
|
|
3001
|
-
|
|
3012
|
+
x.$slots.footer ? (d(), p("div", ca, [
|
|
3013
|
+
ke(x.$slots, "footer", {}, void 0, !0)
|
|
3002
3014
|
])) : V("", !0)
|
|
3003
|
-
], 46,
|
|
3015
|
+
], 46, ia), [
|
|
3004
3016
|
[Ze, m.value]
|
|
3005
3017
|
])
|
|
3006
3018
|
]),
|
|
3007
3019
|
_: 3
|
|
3008
3020
|
}, 8, ["name"])
|
|
3009
|
-
], 12,
|
|
3021
|
+
], 12, sa), [
|
|
3010
3022
|
[Ze, m.value]
|
|
3011
3023
|
])
|
|
3012
3024
|
]));
|
|
3013
3025
|
}
|
|
3014
|
-
}),
|
|
3026
|
+
}), va = /* @__PURE__ */ ze(fa, [["__scopeId", "data-v-6bf99d52"]]), ha = ["data-level"], ga = {
|
|
3015
3027
|
key: 1,
|
|
3016
3028
|
class: "ytree-node__expand-icon--empty"
|
|
3017
|
-
},
|
|
3029
|
+
}, pa = {
|
|
3018
3030
|
key: 0,
|
|
3019
3031
|
width: "12",
|
|
3020
3032
|
height: "12",
|
|
3021
3033
|
viewBox: "0 0 12 12",
|
|
3022
3034
|
fill: "none"
|
|
3023
|
-
},
|
|
3035
|
+
}, ya = {
|
|
3024
3036
|
key: 1,
|
|
3025
3037
|
width: "12",
|
|
3026
3038
|
height: "12",
|
|
3027
3039
|
viewBox: "0 0 12 12",
|
|
3028
3040
|
fill: "none"
|
|
3029
|
-
},
|
|
3041
|
+
}, ma = ["src", "alt"], wa = { class: "ytree-node__custom-content" }, ba = {
|
|
3030
3042
|
key: 0,
|
|
3031
3043
|
class: "ytree-node__children"
|
|
3032
|
-
},
|
|
3044
|
+
}, ka = /* @__PURE__ */ _e({
|
|
3033
3045
|
__name: "ytree-node",
|
|
3034
3046
|
props: {
|
|
3035
3047
|
node: {},
|
|
@@ -3049,18 +3061,18 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3049
3061
|
setup(t) {
|
|
3050
3062
|
const f = t;
|
|
3051
3063
|
Ee("treeStore");
|
|
3052
|
-
const e = Ee("getNodeKey"), l = Ee("getNodeLabel"), m = Ee("getNodeChildren"), h = Ee("hasChildren"),
|
|
3064
|
+
const e = Ee("getNodeKey"), l = Ee("getNodeLabel"), m = Ee("getNodeChildren"), h = Ee("hasChildren"), i = Ee("isEmployeeNode"), S = Ee("getNodeIcon"), $ = Ee("getNodeDepth"), M = Ee("isChildStyleNode"), C = Ee("isNodeExpanded"), c = Ee("isNodeChecked"), g = Ee("isNodeIndeterminate"), x = Ee("isNodeCurrent"), H = Ee("isNodeHighlighted"), W = Ee("handleExpandClick"), R = Ee("handleCheckClick"), D = Ee("handleNodeClick"), z = Ee("handleNodeContextMenu");
|
|
3053
3065
|
_(() => e(f.node));
|
|
3054
|
-
const j = _(() => l(f.node)), ye = _(() => S(f.node, f.rootNode)), de = _(() => $(f.rootNode, f.node)), K = _(() => C(f.node)), P = _(() => c(f.node)), fe = _(() => g(f.node)), ve = _(() => x(f.node)), ce = _(() =>
|
|
3066
|
+
const j = _(() => l(f.node)), ye = _(() => S(f.node, f.rootNode)), de = _(() => $(f.rootNode, f.node)), K = _(() => C(f.node)), P = _(() => c(f.node)), fe = _(() => g(f.node)), ve = _(() => x(f.node)), ce = _(() => H(f.node)), ie = _(() => h(f.node)), q = _(() => m(f.node)), te = _(() => M(f.node, f.rootNode)), Y = _(() => i(f.node)), J = _(() => f.level === 1 ? 8 : 8 + (f.level - 1) * 16);
|
|
3055
3067
|
return (ne, U) => (d(), p("div", {
|
|
3056
3068
|
class: Z(["ytree-node", {
|
|
3057
3069
|
"ytree-node--current": ve.value,
|
|
3058
3070
|
"ytree-node--highlight": ce.value
|
|
3059
3071
|
}])
|
|
3060
3072
|
}, [
|
|
3061
|
-
|
|
3073
|
+
s("div", {
|
|
3062
3074
|
class: Z(["ytree-node__content", { "is-child-style": te.value }]),
|
|
3063
|
-
style: be({ paddingLeft: `${
|
|
3075
|
+
style: be({ paddingLeft: `${J.value}px` }),
|
|
3064
3076
|
"data-level": de.value,
|
|
3065
3077
|
onClick: U[2] || (U[2] = (ae) => lt(D)(f.node, f.node, null, f.rootNode)),
|
|
3066
3078
|
onContextmenu: U[3] || (U[3] = (ae) => lt(z)(ae, f.node, f.node, null))
|
|
@@ -3070,13 +3082,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3070
3082
|
class: Z(["ytree-node__expand-icon", { "is-expanded": K.value }]),
|
|
3071
3083
|
onClick: U[0] || (U[0] = me((ae) => lt(W)(f.node), ["stop"]))
|
|
3072
3084
|
}, [...U[4] || (U[4] = [
|
|
3073
|
-
|
|
3085
|
+
s("svg", {
|
|
3074
3086
|
width: "12",
|
|
3075
3087
|
height: "12",
|
|
3076
3088
|
viewBox: "0 0 12 12",
|
|
3077
3089
|
fill: "none"
|
|
3078
3090
|
}, [
|
|
3079
|
-
|
|
3091
|
+
s("path", {
|
|
3080
3092
|
d: "M4.5 3L7.5 6L4.5 9",
|
|
3081
3093
|
stroke: "currentColor",
|
|
3082
3094
|
"stroke-width": "1.5",
|
|
@@ -3084,7 +3096,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3084
3096
|
"stroke-linejoin": "round"
|
|
3085
3097
|
})
|
|
3086
3098
|
], -1)
|
|
3087
|
-
])], 2)) : (d(), p("span",
|
|
3099
|
+
])], 2)) : (d(), p("span", ga)),
|
|
3088
3100
|
t.showCheckbox ? (d(), p("span", {
|
|
3089
3101
|
key: 2,
|
|
3090
3102
|
class: Z(["ytree-node__checkbox", {
|
|
@@ -3093,16 +3105,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3093
3105
|
}]),
|
|
3094
3106
|
onClick: U[1] || (U[1] = me((ae) => lt(R)(f.node), ["stop"]))
|
|
3095
3107
|
}, [
|
|
3096
|
-
P.value ? (d(), p("svg",
|
|
3097
|
-
|
|
3108
|
+
P.value ? (d(), p("svg", pa, [...U[5] || (U[5] = [
|
|
3109
|
+
s("path", {
|
|
3098
3110
|
d: "M2 6L4.5 8.5L10 3",
|
|
3099
3111
|
stroke: "currentColor",
|
|
3100
3112
|
"stroke-width": "1.5",
|
|
3101
3113
|
"stroke-linecap": "round",
|
|
3102
3114
|
"stroke-linejoin": "round"
|
|
3103
3115
|
}, null, -1)
|
|
3104
|
-
])])) : fe.value ? (d(), p("svg",
|
|
3105
|
-
|
|
3116
|
+
])])) : fe.value ? (d(), p("svg", ya, [...U[6] || (U[6] = [
|
|
3117
|
+
s("path", {
|
|
3106
3118
|
d: "M2 6L10 6",
|
|
3107
3119
|
stroke: "currentColor",
|
|
3108
3120
|
"stroke-width": "1.5",
|
|
@@ -3114,27 +3126,27 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3114
3126
|
key: 3,
|
|
3115
3127
|
class: Z(["ytree-node__icon", t.iconClass])
|
|
3116
3128
|
}, null, 2)) : V("", !0),
|
|
3117
|
-
|
|
3129
|
+
s("img", {
|
|
3118
3130
|
class: "ytree-node__avatar",
|
|
3119
3131
|
src: ye.value,
|
|
3120
3132
|
alt: Y.value ? "person" : "dept"
|
|
3121
|
-
}, null, 8,
|
|
3122
|
-
|
|
3133
|
+
}, null, 8, ma),
|
|
3134
|
+
s("span", {
|
|
3123
3135
|
class: Z(["ytree-node__label", { "is-employee": Y.value }])
|
|
3124
3136
|
}, we(j.value), 3),
|
|
3125
|
-
|
|
3126
|
-
|
|
3137
|
+
s("div", wa, [
|
|
3138
|
+
ke(ne.$slots, "node-content", {
|
|
3127
3139
|
node: f.node,
|
|
3128
3140
|
isCurrent: ve.value,
|
|
3129
3141
|
isExpanded: K.value,
|
|
3130
3142
|
hasChildren: ie.value
|
|
3131
3143
|
}, void 0, !0)
|
|
3132
3144
|
])
|
|
3133
|
-
], 46,
|
|
3134
|
-
|
|
3145
|
+
], 46, ha),
|
|
3146
|
+
Ie(Ve, { name: "ytree-node" }, {
|
|
3135
3147
|
default: $e(() => [
|
|
3136
|
-
ie.value && K.value ? (d(), p("div",
|
|
3137
|
-
(d(!0), p(Se, null,
|
|
3148
|
+
ie.value && K.value ? (d(), p("div", ba, [
|
|
3149
|
+
(d(!0), p(Se, null, Be(q.value, (ae) => (d(), Pe(Mt, {
|
|
3138
3150
|
key: lt(e)(ae),
|
|
3139
3151
|
node: ae,
|
|
3140
3152
|
"root-node": t.rootNode,
|
|
@@ -3151,7 +3163,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3151
3163
|
"expand-on-click-node": t.expandOnClickNode
|
|
3152
3164
|
}, {
|
|
3153
3165
|
"node-content": $e((b) => [
|
|
3154
|
-
|
|
3166
|
+
ke(ne.$slots, "node-content", ht({ ref_for: !0 }, b), void 0, !0)
|
|
3155
3167
|
]),
|
|
3156
3168
|
_: 3
|
|
3157
3169
|
}, 8, ["node", "root-node", "level", "show-checkbox", "icon-class", "dept-icon-url", "person-icon-url", "button-icon-url", "child-style-level", "child-style-icon-url", "enable-child-style-custom-click", "disabled", "expand-on-click-node"]))), 128))
|
|
@@ -3161,7 +3173,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3161
3173
|
})
|
|
3162
3174
|
], 2));
|
|
3163
3175
|
}
|
|
3164
|
-
}),
|
|
3176
|
+
}), Mt = /* @__PURE__ */ ze(ka, [["__scopeId", "data-v-f424ccf5"]]), Ca = { class: "ytree__container" }, xa = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", Da = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", $a = /* @__PURE__ */ _e({
|
|
3165
3177
|
__name: "ytree",
|
|
3166
3178
|
props: {
|
|
3167
3179
|
data: { default: () => [] },
|
|
@@ -3210,18 +3222,18 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3210
3222
|
},
|
|
3211
3223
|
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"],
|
|
3212
3224
|
setup(t, { expose: f, emit: e }) {
|
|
3213
|
-
const l = t, m = e, h = _(() => l.data || []),
|
|
3225
|
+
const l = t, m = e, h = _(() => l.data || []), i = I({
|
|
3214
3226
|
currentNode: null,
|
|
3215
3227
|
currentKey: null,
|
|
3216
3228
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
3217
3229
|
expandedKeys: /* @__PURE__ */ new Set(),
|
|
3218
3230
|
selectedKeys: /* @__PURE__ */ new Set(),
|
|
3219
3231
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
3220
|
-
}), S =
|
|
3221
|
-
function
|
|
3232
|
+
}), S = I(0), $ = /* @__PURE__ */ new Map();
|
|
3233
|
+
function M() {
|
|
3222
3234
|
$.clear();
|
|
3223
3235
|
}
|
|
3224
|
-
Le("treeStore",
|
|
3236
|
+
Le("treeStore", i), Le("getNodeKey", c), Le("getNodeLabel", g), Le("getNodeChildren", R), Le("hasChildren", W), Le("isEmployeeNode", x), Le("getNodeIcon", H), Le("getNodeDepth", D), Le("isChildStyleNode", z), Le("isNodeExpanded", j), Le("isNodeChecked", de), Le("isNodeIndeterminate", K), Le("isNodeCurrent", P), Le("isNodeHighlighted", fe), Le("handleExpandClick", ce), Le("handleCheckClick", ve), Le("handleNodeClick", q), Le("handleNodeContextMenu", te);
|
|
3225
3237
|
const C = _(() => l.restrictAutoExpandFromLevel && l.restrictAutoExpandFromLevel > 0 ? l.restrictAutoExpandFromLevel : void 0);
|
|
3226
3238
|
function c(n) {
|
|
3227
3239
|
return n[l.nodeKey] || n.id || Math.random();
|
|
@@ -3234,10 +3246,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3234
3246
|
var a;
|
|
3235
3247
|
return !!((a = n == null ? void 0 : n.data) != null && a.isEmployee);
|
|
3236
3248
|
}
|
|
3237
|
-
function
|
|
3249
|
+
function H(n, a) {
|
|
3238
3250
|
var ee;
|
|
3239
|
-
const w = l.deptIconUrl ||
|
|
3240
|
-
return a && A && z(n, a) ? A : (ee = n == null ? void 0 : n.data) != null && ee.isButton &&
|
|
3251
|
+
const w = l.deptIconUrl || xa, N = l.personIconUrl || Da, B = l.buttonIconUrl || "", A = l.childStyleIconUrl || "";
|
|
3252
|
+
return a && A && z(n, a) ? A : (ee = n == null ? void 0 : n.data) != null && ee.isButton && B ? B : x(n) ? N : w;
|
|
3241
3253
|
}
|
|
3242
3254
|
function W(n) {
|
|
3243
3255
|
var w;
|
|
@@ -3252,8 +3264,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3252
3264
|
if (n === a)
|
|
3253
3265
|
return w;
|
|
3254
3266
|
const N = R(n);
|
|
3255
|
-
for (const
|
|
3256
|
-
const A = D(
|
|
3267
|
+
for (const B of N) {
|
|
3268
|
+
const A = D(B, a, w + 1);
|
|
3257
3269
|
if (A > 0)
|
|
3258
3270
|
return A;
|
|
3259
3271
|
}
|
|
@@ -3264,27 +3276,27 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3264
3276
|
}
|
|
3265
3277
|
function j(n) {
|
|
3266
3278
|
const a = c(n);
|
|
3267
|
-
return
|
|
3279
|
+
return i.value.expandedKeys.has(a);
|
|
3268
3280
|
}
|
|
3269
3281
|
function ye(n, a = /* @__PURE__ */ new Set()) {
|
|
3270
3282
|
const w = c(n);
|
|
3271
3283
|
if (a.has(w))
|
|
3272
3284
|
return { checked: !1, indeterminate: !1 };
|
|
3273
3285
|
a.add(w);
|
|
3274
|
-
const
|
|
3286
|
+
const B = i.value.checkedKeys.has(w);
|
|
3275
3287
|
if (!W(n))
|
|
3276
|
-
return { checked:
|
|
3288
|
+
return { checked: B, indeterminate: !1 };
|
|
3277
3289
|
const A = R(n);
|
|
3278
3290
|
if (A.length === 0)
|
|
3279
|
-
return { checked:
|
|
3291
|
+
return { checked: B, indeterminate: !1 };
|
|
3280
3292
|
let ee = 0, G = 0;
|
|
3281
|
-
for (const
|
|
3282
|
-
const le = ye(
|
|
3293
|
+
for (const X of A) {
|
|
3294
|
+
const le = ye(X, a);
|
|
3283
3295
|
le.checked ? ee++ : le.indeterminate && G++;
|
|
3284
3296
|
}
|
|
3285
3297
|
let re, ue;
|
|
3286
3298
|
const pe = ee === A.length && G === 0, O = ee > 0 || G > 0;
|
|
3287
|
-
return
|
|
3299
|
+
return B ? pe ? (re = !0, ue = !1) : O ? (re = !1, ue = !0) : (re = !0, ue = !1) : pe ? (re = !0, ue = !1) : O ? (re = !1, ue = !0) : (re = !1, ue = !1), { checked: re, indeterminate: ue };
|
|
3288
3300
|
}
|
|
3289
3301
|
function de(n) {
|
|
3290
3302
|
return S.value, ye(n).checked;
|
|
@@ -3294,27 +3306,27 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3294
3306
|
}
|
|
3295
3307
|
function P(n) {
|
|
3296
3308
|
const a = c(n);
|
|
3297
|
-
return
|
|
3309
|
+
return i.value.currentKey === a;
|
|
3298
3310
|
}
|
|
3299
3311
|
function fe(n) {
|
|
3300
3312
|
const a = c(n);
|
|
3301
|
-
return
|
|
3313
|
+
return i.value.highlightedKeys.has(a);
|
|
3302
3314
|
}
|
|
3303
3315
|
function ve(n) {
|
|
3304
3316
|
if (l.disabled) return;
|
|
3305
|
-
const a = c(n), N = !
|
|
3306
|
-
|
|
3317
|
+
const a = c(n), N = !i.value.checkedKeys.has(a), B = new Set(i.value.expandedKeys);
|
|
3318
|
+
M(), N ? i.value.checkedKeys.add(a) : i.value.checkedKeys.delete(a);
|
|
3307
3319
|
function A(ee, G) {
|
|
3308
3320
|
ee.forEach((re) => {
|
|
3309
3321
|
const ue = c(re);
|
|
3310
|
-
G ?
|
|
3322
|
+
G ? i.value.checkedKeys.add(ue) : i.value.checkedKeys.delete(ue), W(re) && A(R(re), G);
|
|
3311
3323
|
});
|
|
3312
3324
|
}
|
|
3313
|
-
A(R(n), N), ie(),
|
|
3325
|
+
A(R(n), N), ie(), i.value.expandedKeys = B, M(), m("check-change", n, N, !1), m("check", n, N, !1), m("checked-keys-change", Array.from(i.value.checkedKeys));
|
|
3314
3326
|
}
|
|
3315
3327
|
function ce(n) {
|
|
3316
3328
|
const a = c(n);
|
|
3317
|
-
|
|
3329
|
+
i.value.expandedKeys.has(a) ? (i.value.expandedKeys.delete(a), m("node-collapse", n, n, null)) : (i.value.expandedKeys.add(a), m("node-expand", n, n, null));
|
|
3318
3330
|
}
|
|
3319
3331
|
function ie() {
|
|
3320
3332
|
const n = /* @__PURE__ */ new Map(), a = [], w = /* @__PURE__ */ new Map();
|
|
@@ -3325,7 +3337,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3325
3337
|
});
|
|
3326
3338
|
}
|
|
3327
3339
|
N(h.value);
|
|
3328
|
-
function
|
|
3340
|
+
function B(A) {
|
|
3329
3341
|
if (!W(A)) return;
|
|
3330
3342
|
const ee = R(A), G = c(A);
|
|
3331
3343
|
let re = 0, ue = 0;
|
|
@@ -3333,16 +3345,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3333
3345
|
const O = ye(pe);
|
|
3334
3346
|
O.checked ? re++ : O.indeterminate && ue++;
|
|
3335
3347
|
}
|
|
3336
|
-
re === ee.length && ue === 0 ?
|
|
3348
|
+
re === ee.length && ue === 0 ? i.value.checkedKeys.add(G) : (re > 0 || ue > 0, i.value.checkedKeys.delete(G));
|
|
3337
3349
|
}
|
|
3338
3350
|
for (let A = a.length - 1; A >= 0; A--)
|
|
3339
|
-
|
|
3340
|
-
|
|
3351
|
+
B(a[A]);
|
|
3352
|
+
M();
|
|
3341
3353
|
}
|
|
3342
3354
|
function q(n, a, w, N) {
|
|
3343
3355
|
if (l.disabled) return;
|
|
3344
|
-
const
|
|
3345
|
-
if (l.enableChildStyleCustomClick &&
|
|
3356
|
+
const B = N ? z(n, N) : !1;
|
|
3357
|
+
if (l.enableChildStyleCustomClick && B) {
|
|
3346
3358
|
m("child-node-click", n, a, w);
|
|
3347
3359
|
return;
|
|
3348
3360
|
}
|
|
@@ -3350,7 +3362,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3350
3362
|
ce(n);
|
|
3351
3363
|
return;
|
|
3352
3364
|
}
|
|
3353
|
-
|
|
3365
|
+
i.value.currentNode = n, i.value.currentKey = c(n), l.showCheckbox && ve(n), m("node-click", n, a, w);
|
|
3354
3366
|
}
|
|
3355
3367
|
function te(n, a, w, N) {
|
|
3356
3368
|
l.disabled || m("node-contextmenu", n, a, w, N);
|
|
@@ -3375,40 +3387,40 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3375
3387
|
G < re && W(ue) ? (A.add(c(ue)), N(R(ue), G + 1, re)) : G < re && W(ue);
|
|
3376
3388
|
});
|
|
3377
3389
|
};
|
|
3378
|
-
const
|
|
3390
|
+
const B = (n || []).filter((ee) => {
|
|
3379
3391
|
const G = w(ee, h.value, 1);
|
|
3380
3392
|
return G > 0 && G < a;
|
|
3381
|
-
}), A = new Set(
|
|
3382
|
-
N(h.value, 1, a),
|
|
3393
|
+
}), A = new Set(B);
|
|
3394
|
+
N(h.value, 1, a), i.value.expandedKeys.forEach((ee) => {
|
|
3383
3395
|
w(ee, h.value, 1) >= a && A.add(ee);
|
|
3384
|
-
}),
|
|
3396
|
+
}), i.value.expandedKeys = A;
|
|
3385
3397
|
} else
|
|
3386
|
-
|
|
3398
|
+
i.value.expandedKeys = new Set(n);
|
|
3387
3399
|
}
|
|
3388
3400
|
},
|
|
3389
3401
|
{ immediate: !0 }
|
|
3390
3402
|
);
|
|
3391
3403
|
function Y() {
|
|
3392
3404
|
if (l.defaultExpandAll) {
|
|
3393
|
-
let n = function(N,
|
|
3405
|
+
let n = function(N, B = 1) {
|
|
3394
3406
|
N.forEach((A) => {
|
|
3395
3407
|
if (!W(A)) return;
|
|
3396
3408
|
const ee = R(A);
|
|
3397
3409
|
if (w) {
|
|
3398
|
-
if (
|
|
3399
|
-
|
|
3410
|
+
if (B >= w) return;
|
|
3411
|
+
B + 1 === w || a.add(c(A)), n(ee, B + 1);
|
|
3400
3412
|
} else
|
|
3401
|
-
a.add(c(A)), n(ee,
|
|
3413
|
+
a.add(c(A)), n(ee, B + 1);
|
|
3402
3414
|
});
|
|
3403
3415
|
};
|
|
3404
3416
|
const a = /* @__PURE__ */ new Set(), w = C.value;
|
|
3405
|
-
n(h.value, 1),
|
|
3417
|
+
n(h.value, 1), i.value.expandedKeys = a;
|
|
3406
3418
|
}
|
|
3407
3419
|
}
|
|
3408
|
-
function
|
|
3420
|
+
function J() {
|
|
3409
3421
|
if (l.defaultCheckedKeys && l.defaultCheckedKeys.length > 0) {
|
|
3410
|
-
let n = function(
|
|
3411
|
-
|
|
3422
|
+
let n = function(B, A = []) {
|
|
3423
|
+
B.forEach((ee) => {
|
|
3412
3424
|
const G = c(ee), re = [...A, G];
|
|
3413
3425
|
a.has(G) && A.forEach((ue) => w.add(ue)), W(ee) && n(R(ee), re);
|
|
3414
3426
|
});
|
|
@@ -3416,7 +3428,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3416
3428
|
const a = new Set(l.defaultCheckedKeys), w = /* @__PURE__ */ new Set();
|
|
3417
3429
|
if (n(h.value), C.value)
|
|
3418
3430
|
return;
|
|
3419
|
-
|
|
3431
|
+
i.value.expandedKeys = w;
|
|
3420
3432
|
}
|
|
3421
3433
|
}
|
|
3422
3434
|
let ne = null;
|
|
@@ -3428,14 +3440,14 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3428
3440
|
ge(() => l.defaultExpandAll, Y, { immediate: !0 }), ge(() => h.value, U, { deep: !0 }), ge(
|
|
3429
3441
|
() => l.defaultCheckedKeys,
|
|
3430
3442
|
(n) => {
|
|
3431
|
-
n ? (
|
|
3443
|
+
n ? (i.value.checkedKeys = new Set(n), l.enableFourthLevelSpecialHandling || J()) : i.value.checkedKeys.clear();
|
|
3432
3444
|
},
|
|
3433
3445
|
{ immediate: !0 }
|
|
3434
3446
|
);
|
|
3435
3447
|
function ae(n) {
|
|
3436
3448
|
try {
|
|
3437
|
-
let a = function(
|
|
3438
|
-
for (const G of
|
|
3449
|
+
let a = function(B, A, ee = []) {
|
|
3450
|
+
for (const G of B) {
|
|
3439
3451
|
const re = c(G), ue = [...ee, re];
|
|
3440
3452
|
if (re === A) return ue;
|
|
3441
3453
|
if (W(G)) {
|
|
@@ -3447,33 +3459,33 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3447
3459
|
};
|
|
3448
3460
|
const w = Array.isArray(n) ? n : [];
|
|
3449
3461
|
if (w.length === 0) return;
|
|
3450
|
-
|
|
3451
|
-
const N = new Set(
|
|
3452
|
-
w.forEach((
|
|
3453
|
-
const A = a(h.value,
|
|
3454
|
-
A && A.length > 0 && (A.slice(0, -1).forEach((ee) => N.add(ee)),
|
|
3455
|
-
}),
|
|
3462
|
+
i.value.highlightedKeys.clear();
|
|
3463
|
+
const N = new Set(i.value.expandedKeys);
|
|
3464
|
+
w.forEach((B) => {
|
|
3465
|
+
const A = a(h.value, B);
|
|
3466
|
+
A && A.length > 0 && (A.slice(0, -1).forEach((ee) => N.add(ee)), i.value.highlightedKeys.add(A[A.length - 1]));
|
|
3467
|
+
}), i.value.expandedKeys = N;
|
|
3456
3468
|
} catch (a) {
|
|
3457
3469
|
process.env.NODE_ENV === "development" && console.warn("highlightAndExpandByIds 执行失败", a);
|
|
3458
3470
|
}
|
|
3459
3471
|
}
|
|
3460
3472
|
function b() {
|
|
3461
|
-
|
|
3473
|
+
i.value.highlightedKeys.clear();
|
|
3462
3474
|
}
|
|
3463
|
-
function
|
|
3464
|
-
|
|
3475
|
+
function r() {
|
|
3476
|
+
i.value.currentNode = null, i.value.currentKey = null;
|
|
3465
3477
|
}
|
|
3466
|
-
return f({ highlightAndExpandByIds: ae, clearHighlights: b, clearCurrentNode:
|
|
3478
|
+
return f({ highlightAndExpandByIds: ae, clearHighlights: b, clearCurrentNode: r }), ge(
|
|
3467
3479
|
() => l.defaultSelectedKeys,
|
|
3468
3480
|
(n) => {
|
|
3469
|
-
n && (
|
|
3481
|
+
n && (i.value.selectedKeys = new Set(n));
|
|
3470
3482
|
},
|
|
3471
3483
|
{ immediate: !0 }
|
|
3472
3484
|
), (n, a) => (d(), p("div", {
|
|
3473
3485
|
class: Z(["ytree", [`ytree--${t.size}`, { "ytree--disabled": t.disabled }]])
|
|
3474
3486
|
}, [
|
|
3475
|
-
|
|
3476
|
-
(d(!0), p(Se, null,
|
|
3487
|
+
s("div", Ca, [
|
|
3488
|
+
(d(!0), p(Se, null, Be(h.value, (w) => (d(), Pe(Mt, {
|
|
3477
3489
|
key: c(w),
|
|
3478
3490
|
node: w,
|
|
3479
3491
|
"root-node": w,
|
|
@@ -3490,20 +3502,20 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3490
3502
|
"expand-on-click-node": t.expandOnClickNode
|
|
3491
3503
|
}, {
|
|
3492
3504
|
"node-content": $e((N) => [
|
|
3493
|
-
|
|
3505
|
+
ke(n.$slots, "node-content", ht({ ref_for: !0 }, N), void 0, !0)
|
|
3494
3506
|
]),
|
|
3495
3507
|
_: 3
|
|
3496
3508
|
}, 8, ["node", "root-node", "show-checkbox", "icon-class", "dept-icon-url", "person-icon-url", "button-icon-url", "child-style-level", "child-style-icon-url", "enable-child-style-custom-click", "disabled", "expand-on-click-node"]))), 128))
|
|
3497
3509
|
])
|
|
3498
3510
|
], 2));
|
|
3499
3511
|
}
|
|
3500
|
-
}),
|
|
3512
|
+
}), Sa = /* @__PURE__ */ ze($a, [["__scopeId", "data-v-ad65c979"]]), Ia = { class: "query-encapsulation" }, Ma = { class: "query-encapsulation__container" }, Ta = { class: "query-encapsulation__content" }, La = { class: "query-encapsulation__field-wrapper" }, Ea = {
|
|
3501
3513
|
key: 0,
|
|
3502
3514
|
class: "query-encapsulation__field-label"
|
|
3503
|
-
},
|
|
3515
|
+
}, Ha = {
|
|
3504
3516
|
key: 0,
|
|
3505
3517
|
class: "query-encapsulation__toggle"
|
|
3506
|
-
},
|
|
3518
|
+
}, Ba = { class: "query-encapsulation__actions-group" }, _a = /* @__PURE__ */ _e({
|
|
3507
3519
|
__name: "QueryEncapsulation",
|
|
3508
3520
|
props: {
|
|
3509
3521
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3513,45 +3525,45 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3513
3525
|
},
|
|
3514
3526
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3515
3527
|
setup(t, { expose: f, emit: e }) {
|
|
3516
|
-
const l = t, m = e, h =
|
|
3528
|
+
const l = t, m = e, h = I(!1), i = Et({}), S = ["select", "date", "daterange", "switch"];
|
|
3517
3529
|
let $;
|
|
3518
|
-
const
|
|
3519
|
-
let
|
|
3520
|
-
const D = _(() => l.fields.filter((
|
|
3521
|
-
function ye(
|
|
3522
|
-
switch (
|
|
3530
|
+
const M = I(null), C = I(null), c = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), x = I(1 / 0);
|
|
3531
|
+
let H = null, W, R = 0;
|
|
3532
|
+
const D = _(() => l.fields.filter((r) => !r.hidden)), z = _(() => h.value ? D.value : D.value.slice(0, x.value)), j = _(() => D.value.length > x.value);
|
|
3533
|
+
function ye(r) {
|
|
3534
|
+
switch (r) {
|
|
3523
3535
|
case "select":
|
|
3524
3536
|
return $t;
|
|
3525
3537
|
case "date":
|
|
3526
3538
|
case "daterange":
|
|
3527
3539
|
return St;
|
|
3528
3540
|
case "switch":
|
|
3529
|
-
return
|
|
3541
|
+
return It;
|
|
3530
3542
|
case "input":
|
|
3531
3543
|
default:
|
|
3532
3544
|
return Dt;
|
|
3533
3545
|
}
|
|
3534
3546
|
}
|
|
3535
|
-
function de(
|
|
3536
|
-
r
|
|
3537
|
-
const a = l.fields.find((w) => w.key ===
|
|
3547
|
+
function de(r, n) {
|
|
3548
|
+
i[r] = n;
|
|
3549
|
+
const a = l.fields.find((w) => w.key === r);
|
|
3538
3550
|
a && K(a);
|
|
3539
3551
|
}
|
|
3540
|
-
function K(
|
|
3541
|
-
m("field-change",
|
|
3552
|
+
function K(r) {
|
|
3553
|
+
m("field-change", r, i[r.key]), m("update:modelValue", { ...i }), S.includes(r.type) && J();
|
|
3542
3554
|
}
|
|
3543
|
-
function P(
|
|
3544
|
-
|
|
3555
|
+
function P(r, n) {
|
|
3556
|
+
r.onSwitchChange && typeof r.onSwitchChange == "function" && r.onSwitchChange(n, r), K(r);
|
|
3545
3557
|
}
|
|
3546
3558
|
function fe() {
|
|
3547
|
-
const
|
|
3559
|
+
const r = ne(i), n = U(r), a = { ...i };
|
|
3548
3560
|
m("search", { data: n, raw: a });
|
|
3549
3561
|
}
|
|
3550
3562
|
function ve() {
|
|
3551
|
-
Object.keys(
|
|
3552
|
-
const n = l.fields.find((a) => a.key ===
|
|
3553
|
-
(n == null ? void 0 : n.type) === "daterange" ? r
|
|
3554
|
-
}), m("reset"), m("update:modelValue", { ...
|
|
3563
|
+
Object.keys(i).forEach((r) => {
|
|
3564
|
+
const n = l.fields.find((a) => a.key === r);
|
|
3565
|
+
(n == null ? void 0 : n.type) === "daterange" ? i[r] = { startDate: null, endDate: null } : (n == null ? void 0 : n.type) === "date" ? i[r] = null : (n == null ? void 0 : n.type) === "switch" ? i[r] = n.falseValue !== void 0 ? n.falseValue : !1 : (n == null ? void 0 : n.type) === "select" && n.multiple ? i[r] = [] : i[r] = "";
|
|
3566
|
+
}), m("reset"), m("update:modelValue", { ...i });
|
|
3555
3567
|
}
|
|
3556
3568
|
function ce() {
|
|
3557
3569
|
h.value = !h.value, setTimeout(() => {
|
|
@@ -3560,10 +3572,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3560
3572
|
});
|
|
3561
3573
|
}, 300);
|
|
3562
3574
|
}
|
|
3563
|
-
function ie(
|
|
3564
|
-
|
|
3565
|
-
if (
|
|
3566
|
-
const a =
|
|
3575
|
+
function ie(r, n) {
|
|
3576
|
+
r ? (c.set(n, r), oe(() => {
|
|
3577
|
+
if (r && !g.has(n)) {
|
|
3578
|
+
const a = r.offsetWidth;
|
|
3567
3579
|
a > 0 && g.set(n, a);
|
|
3568
3580
|
}
|
|
3569
3581
|
})) : c.delete(n);
|
|
@@ -3571,58 +3583,58 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3571
3583
|
function q() {
|
|
3572
3584
|
W && clearTimeout(W), W = setTimeout(() => {
|
|
3573
3585
|
oe().then(() => {
|
|
3574
|
-
if (!
|
|
3586
|
+
if (!M.value || !C.value)
|
|
3575
3587
|
return;
|
|
3576
|
-
const
|
|
3577
|
-
if (
|
|
3588
|
+
const r = M.value.offsetWidth;
|
|
3589
|
+
if (r === 0) {
|
|
3578
3590
|
setTimeout(() => q(), 50);
|
|
3579
3591
|
return;
|
|
3580
3592
|
}
|
|
3581
|
-
if (R > 0 && Math.abs(
|
|
3593
|
+
if (R > 0 && Math.abs(r - R) > 10 && (g.clear(), !h.value && D.value.length > 0)) {
|
|
3582
3594
|
h.value = !0, oe(() => {
|
|
3583
3595
|
setTimeout(() => {
|
|
3584
|
-
for (const
|
|
3585
|
-
const le = c.get(
|
|
3596
|
+
for (const X of D.value) {
|
|
3597
|
+
const le = c.get(X.key);
|
|
3586
3598
|
if (le) {
|
|
3587
3599
|
const he = le.offsetWidth;
|
|
3588
|
-
he > 0 && g.set(
|
|
3600
|
+
he > 0 && g.set(X.key, he);
|
|
3589
3601
|
}
|
|
3590
3602
|
}
|
|
3591
|
-
h.value = !1, R =
|
|
3603
|
+
h.value = !1, R = r, setTimeout(() => q(), 50);
|
|
3592
3604
|
}, 150);
|
|
3593
3605
|
});
|
|
3594
3606
|
return;
|
|
3595
3607
|
}
|
|
3596
|
-
R =
|
|
3608
|
+
R = r;
|
|
3597
3609
|
const n = 12, a = 20, w = C.value.querySelector(".query-encapsulation__actions-group");
|
|
3598
3610
|
if (!w) {
|
|
3599
3611
|
setTimeout(() => q(), 50);
|
|
3600
3612
|
return;
|
|
3601
3613
|
}
|
|
3602
|
-
const
|
|
3603
|
-
if (
|
|
3614
|
+
const B = w.getBoundingClientRect().width || w.offsetWidth || 200;
|
|
3615
|
+
if (B < 50) {
|
|
3604
3616
|
setTimeout(() => q(), 50);
|
|
3605
3617
|
return;
|
|
3606
3618
|
}
|
|
3607
|
-
for (const
|
|
3608
|
-
const le = c.get(
|
|
3619
|
+
for (const X of D.value) {
|
|
3620
|
+
const le = c.get(X.key);
|
|
3609
3621
|
if (le) {
|
|
3610
3622
|
const he = le.offsetWidth;
|
|
3611
|
-
he > 0 && g.set(
|
|
3623
|
+
he > 0 && g.set(X.key, he);
|
|
3612
3624
|
}
|
|
3613
3625
|
}
|
|
3614
3626
|
if (!D.value.every(
|
|
3615
|
-
(
|
|
3627
|
+
(X) => g.has(X.key) && g.get(X.key) > 0
|
|
3616
3628
|
)) {
|
|
3617
|
-
const
|
|
3629
|
+
const X = D.value.filter(
|
|
3618
3630
|
(le) => !g.has(le.key) || g.get(le.key) === 0
|
|
3619
3631
|
);
|
|
3620
3632
|
if (h.value) {
|
|
3621
3633
|
let le = !1;
|
|
3622
|
-
for (const he of
|
|
3623
|
-
const
|
|
3624
|
-
if (
|
|
3625
|
-
const De =
|
|
3634
|
+
for (const he of X) {
|
|
3635
|
+
const He = c.get(he.key);
|
|
3636
|
+
if (He) {
|
|
3637
|
+
const De = He.offsetWidth;
|
|
3626
3638
|
De > 0 && (g.set(he.key, De), le = !0);
|
|
3627
3639
|
}
|
|
3628
3640
|
}
|
|
@@ -3631,13 +3643,13 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3631
3643
|
return;
|
|
3632
3644
|
}
|
|
3633
3645
|
} else {
|
|
3634
|
-
const le =
|
|
3635
|
-
(he) => !z.value.some((
|
|
3646
|
+
const le = X.filter(
|
|
3647
|
+
(he) => !z.value.some((He) => He.key === he.key)
|
|
3636
3648
|
);
|
|
3637
3649
|
if (le.length > 0) {
|
|
3638
|
-
const he = Array.from(g.values()).filter((De) => De > 0),
|
|
3650
|
+
const he = Array.from(g.values()).filter((De) => De > 0), He = he.length > 0 ? he.reduce((De, u) => De + u, 0) / he.length : 180;
|
|
3639
3651
|
for (const De of le)
|
|
3640
|
-
(!g.has(De.key) || g.get(De.key) === 0) && g.set(De.key,
|
|
3652
|
+
(!g.has(De.key) || g.get(De.key) === 0) && g.set(De.key, He);
|
|
3641
3653
|
} else {
|
|
3642
3654
|
setTimeout(() => q(), 50);
|
|
3643
3655
|
return;
|
|
@@ -3646,19 +3658,19 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3646
3658
|
}
|
|
3647
3659
|
const ee = 100;
|
|
3648
3660
|
let G = 0;
|
|
3649
|
-
for (const
|
|
3650
|
-
const le = g.get(
|
|
3661
|
+
for (const X of D.value) {
|
|
3662
|
+
const le = g.get(X.key) || 0;
|
|
3651
3663
|
le > 0 && (G += le + (G > 0 ? n : 0));
|
|
3652
3664
|
}
|
|
3653
|
-
const re =
|
|
3665
|
+
const re = r - B - a;
|
|
3654
3666
|
if (G <= re) {
|
|
3655
3667
|
x.value = 1 / 0;
|
|
3656
3668
|
return;
|
|
3657
3669
|
}
|
|
3658
|
-
const ue =
|
|
3670
|
+
const ue = r - B - ee - a;
|
|
3659
3671
|
let pe = 0, O = 0;
|
|
3660
|
-
for (const
|
|
3661
|
-
const le = g.get(
|
|
3672
|
+
for (const X of D.value) {
|
|
3673
|
+
const le = g.get(X.key) || 0;
|
|
3662
3674
|
if (le === 0)
|
|
3663
3675
|
continue;
|
|
3664
3676
|
const he = O > 0 ? le + n : le;
|
|
@@ -3670,8 +3682,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3670
3682
|
});
|
|
3671
3683
|
}, 150);
|
|
3672
3684
|
}
|
|
3673
|
-
function te(
|
|
3674
|
-
return
|
|
3685
|
+
function te(r) {
|
|
3686
|
+
return r.type !== "input" ? {} : {
|
|
3675
3687
|
enter: () => Y(),
|
|
3676
3688
|
paste: () => Y()
|
|
3677
3689
|
};
|
|
@@ -3679,66 +3691,66 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3679
3691
|
async function Y() {
|
|
3680
3692
|
await oe(), fe();
|
|
3681
3693
|
}
|
|
3682
|
-
function
|
|
3694
|
+
function J() {
|
|
3683
3695
|
$ && clearTimeout($), $ = setTimeout(() => {
|
|
3684
3696
|
$ = void 0, oe().then(() => fe());
|
|
3685
3697
|
}, 0);
|
|
3686
3698
|
}
|
|
3687
|
-
function ne(
|
|
3699
|
+
function ne(r) {
|
|
3688
3700
|
const n = {};
|
|
3689
|
-
return Object.keys(
|
|
3690
|
-
const w = l.fields.find((A) => A.key === a), N =
|
|
3691
|
-
if (Array.isArray(
|
|
3692
|
-
|
|
3701
|
+
return Object.keys(r).forEach((a) => {
|
|
3702
|
+
const w = l.fields.find((A) => A.key === a), N = r[a], B = typeof N == "string" ? N.trim() : N;
|
|
3703
|
+
if (Array.isArray(B)) {
|
|
3704
|
+
B.length > 0 && (n[a] = B);
|
|
3693
3705
|
return;
|
|
3694
3706
|
}
|
|
3695
|
-
if (!(
|
|
3696
|
-
if (typeof
|
|
3697
|
-
|
|
3707
|
+
if (!(B == null || B === "")) {
|
|
3708
|
+
if (typeof B == "object" && B.startDate && B.endDate) {
|
|
3709
|
+
B.startDate && B.endDate && (n[a] = B);
|
|
3698
3710
|
return;
|
|
3699
3711
|
}
|
|
3700
3712
|
if (w && (w.type === "date" || w.type === "daterange")) {
|
|
3701
|
-
|
|
3713
|
+
B !== 0 && (n[a] = B);
|
|
3702
3714
|
return;
|
|
3703
3715
|
}
|
|
3704
|
-
n[a] =
|
|
3716
|
+
n[a] = B;
|
|
3705
3717
|
}
|
|
3706
3718
|
}), n;
|
|
3707
3719
|
}
|
|
3708
|
-
function U(
|
|
3720
|
+
function U(r) {
|
|
3709
3721
|
const n = {};
|
|
3710
|
-
return Object.keys(
|
|
3711
|
-
const w =
|
|
3722
|
+
return Object.keys(r).forEach((a) => {
|
|
3723
|
+
const w = r[a], N = l.fields.find((B) => B.key === a);
|
|
3712
3724
|
if (N)
|
|
3713
3725
|
if (N.type === "daterange" && typeof w == "object") {
|
|
3714
|
-
const
|
|
3715
|
-
w.startDate && w.endDate && w.startDate !== 0 && w.endDate !== 0 && (N.format === "timestamp" ? (n[
|
|
3726
|
+
const B = N.startKey || `${a}Start`, A = N.endKey || `${a}End`;
|
|
3727
|
+
w.startDate && w.endDate && w.startDate !== 0 && w.endDate !== 0 && (N.format === "timestamp" ? (n[B] = new Date(w.startDate).getTime(), n[A] = new Date(w.endDate).getTime()) : (n[B] = w.startDate, n[A] = w.endDate));
|
|
3716
3728
|
} else N.type === "date" && w && w !== 0 && N.format === "timestamp" ? n[a] = new Date(w).getTime() : n[a] = w;
|
|
3717
3729
|
else
|
|
3718
3730
|
n[a] = w;
|
|
3719
3731
|
}), n;
|
|
3720
3732
|
}
|
|
3721
3733
|
function ae() {
|
|
3722
|
-
l.fields.forEach((
|
|
3723
|
-
var n, a, w, N,
|
|
3724
|
-
r
|
|
3734
|
+
l.fields.forEach((r) => {
|
|
3735
|
+
var n, a, w, N, B;
|
|
3736
|
+
i[r.key] === void 0 && (r.type === "daterange" ? i[r.key] = ((n = l.modelValue) == null ? void 0 : n[r.key]) || {
|
|
3725
3737
|
startDate: null,
|
|
3726
3738
|
endDate: null
|
|
3727
|
-
} :
|
|
3739
|
+
} : r.type === "date" ? i[r.key] = ((a = l.modelValue) == null ? void 0 : a[r.key]) || null : r.type === "switch" ? i[r.key] = ((w = l.modelValue) == null ? void 0 : w[r.key]) !== void 0 ? l.modelValue[r.key] : r.falseValue !== void 0 ? r.falseValue : !1 : r.type === "select" && r.multiple ? i[r.key] = ((N = l.modelValue) == null ? void 0 : N[r.key]) !== void 0 ? l.modelValue[r.key] : [] : i[r.key] = ((B = l.modelValue) == null ? void 0 : B[r.key]) || "");
|
|
3728
3740
|
});
|
|
3729
3741
|
}
|
|
3730
3742
|
ge(
|
|
3731
3743
|
() => l.modelValue,
|
|
3732
|
-
(
|
|
3733
|
-
|
|
3744
|
+
(r) => {
|
|
3745
|
+
r && Object.assign(i, r);
|
|
3734
3746
|
},
|
|
3735
3747
|
{ deep: !0, immediate: !0 }
|
|
3736
3748
|
), ge(
|
|
3737
3749
|
() => l.fields,
|
|
3738
|
-
(
|
|
3739
|
-
const a = (
|
|
3750
|
+
(r, n) => {
|
|
3751
|
+
const a = (r == null ? void 0 : r.map((N) => N.key).join(",")) || "", w = (n == null ? void 0 : n.map((N) => N.key).join(",")) || "";
|
|
3740
3752
|
a !== w && (c.clear(), g.clear(), R = 0), oe(() => {
|
|
3741
|
-
const
|
|
3753
|
+
const B = (r == null ? void 0 : r.length) !== (n == null ? void 0 : n.length) ? 200 : 100;
|
|
3742
3754
|
setTimeout(() => {
|
|
3743
3755
|
oe(() => {
|
|
3744
3756
|
D.value.length > 3 && !h.value && a !== w ? (h.value = !0, oe(() => {
|
|
@@ -3756,7 +3768,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3756
3768
|
}, 150);
|
|
3757
3769
|
})) : q();
|
|
3758
3770
|
});
|
|
3759
|
-
},
|
|
3771
|
+
}, B);
|
|
3760
3772
|
});
|
|
3761
3773
|
},
|
|
3762
3774
|
{ deep: !0 }
|
|
@@ -3772,65 +3784,65 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3772
3784
|
ae(), oe(() => {
|
|
3773
3785
|
D.value.length > 3 && !h.value ? (h.value = !0, oe(() => {
|
|
3774
3786
|
setTimeout(() => {
|
|
3775
|
-
for (const
|
|
3776
|
-
const n = c.get(
|
|
3787
|
+
for (const r of D.value) {
|
|
3788
|
+
const n = c.get(r.key);
|
|
3777
3789
|
if (n) {
|
|
3778
3790
|
const a = n.offsetWidth;
|
|
3779
|
-
a > 0 && g.set(
|
|
3791
|
+
a > 0 && g.set(r.key, a);
|
|
3780
3792
|
}
|
|
3781
3793
|
}
|
|
3782
3794
|
h.value = !1, oe(() => {
|
|
3783
3795
|
q();
|
|
3784
3796
|
});
|
|
3785
3797
|
}, 150);
|
|
3786
|
-
})) : q(),
|
|
3798
|
+
})) : q(), M.value && window.ResizeObserver && (H && H.disconnect(), H = new ResizeObserver(() => {
|
|
3787
3799
|
q();
|
|
3788
|
-
}),
|
|
3800
|
+
}), H.observe(M.value), C.value && H.observe(C.value)), window.addEventListener("resize", q);
|
|
3789
3801
|
});
|
|
3790
3802
|
}
|
|
3791
3803
|
return Fe(() => {
|
|
3792
3804
|
b();
|
|
3793
|
-
}),
|
|
3805
|
+
}), Ht(() => {
|
|
3794
3806
|
c.clear(), g.clear(), h.value = !1, R = 0, oe(() => {
|
|
3795
3807
|
setTimeout(() => {
|
|
3796
3808
|
b();
|
|
3797
3809
|
}, 150);
|
|
3798
3810
|
});
|
|
3799
3811
|
}), Ct(() => {
|
|
3800
|
-
$ && (clearTimeout($), $ = void 0), W && (clearTimeout(W), W = void 0),
|
|
3812
|
+
$ && (clearTimeout($), $ = void 0), W && (clearTimeout(W), W = void 0), H && (H.disconnect(), H = null), window.removeEventListener("resize", q);
|
|
3801
3813
|
}), f({
|
|
3802
3814
|
search: fe,
|
|
3803
3815
|
reset: ve
|
|
3804
|
-
}), (
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3816
|
+
}), (r, n) => (d(), p("div", Ia, [
|
|
3817
|
+
s("div", Ma, [
|
|
3818
|
+
s("div", Ta, [
|
|
3819
|
+
s("div", {
|
|
3808
3820
|
class: "query-encapsulation__fields",
|
|
3809
3821
|
ref_key: "fieldsContainerRef",
|
|
3810
|
-
ref:
|
|
3822
|
+
ref: M
|
|
3811
3823
|
}, [
|
|
3812
|
-
|
|
3824
|
+
Ie(Bt, {
|
|
3813
3825
|
name: "qf",
|
|
3814
3826
|
tag: "div",
|
|
3815
3827
|
class: "query-encapsulation__fields-group"
|
|
3816
3828
|
}, {
|
|
3817
3829
|
default: $e(() => [
|
|
3818
|
-
(d(!0), p(Se, null,
|
|
3830
|
+
(d(!0), p(Se, null, Be(z.value, (a) => (d(), p("div", {
|
|
3819
3831
|
key: a.key,
|
|
3820
3832
|
class: "query-encapsulation__field-item",
|
|
3821
3833
|
ref_for: !0,
|
|
3822
3834
|
ref: (w) => ie(w, a.key)
|
|
3823
3835
|
}, [
|
|
3824
|
-
|
|
3836
|
+
ke(r.$slots, `field-${a.key}`, {
|
|
3825
3837
|
field: a,
|
|
3826
|
-
value:
|
|
3838
|
+
value: i[a.key],
|
|
3827
3839
|
updateValue: (w) => de(a.key, w)
|
|
3828
3840
|
}, () => [
|
|
3829
|
-
|
|
3830
|
-
t.Iflabel || a.type === "switch" ? (d(), p("label",
|
|
3841
|
+
s("div", La, [
|
|
3842
|
+
t.Iflabel || a.type === "switch" ? (d(), p("label", Ea, we(a.label), 1)) : V("", !0),
|
|
3831
3843
|
(d(), Pe(_t(ye(a.type)), ht({
|
|
3832
|
-
modelValue:
|
|
3833
|
-
"onUpdate:modelValue": (w) =>
|
|
3844
|
+
modelValue: i[a.key],
|
|
3845
|
+
"onUpdate:modelValue": (w) => i[a.key] = w,
|
|
3834
3846
|
placeholder: a.placeholder || `请输入${a.label}`,
|
|
3835
3847
|
options: a.options,
|
|
3836
3848
|
clearable: a.clearable !== !1,
|
|
@@ -3857,28 +3869,28 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3857
3869
|
]),
|
|
3858
3870
|
_: 3
|
|
3859
3871
|
}),
|
|
3860
|
-
j.value ? (d(), p("div",
|
|
3861
|
-
|
|
3872
|
+
j.value ? (d(), p("div", Ha, [
|
|
3873
|
+
Ie(rt, {
|
|
3862
3874
|
variant: "secondary",
|
|
3863
3875
|
size: "small",
|
|
3864
3876
|
onClick: ce
|
|
3865
3877
|
}, {
|
|
3866
3878
|
default: $e(() => [
|
|
3867
3879
|
We(we(h.value ? "收起" : "展开") + " ", 1),
|
|
3868
|
-
|
|
3880
|
+
s("span", {
|
|
3869
3881
|
class: Z(["query-encapsulation__toggle-icon", { "is-expanded": h.value }])
|
|
3870
3882
|
}, "▼", 2)
|
|
3871
3883
|
]),
|
|
3872
3884
|
_: 1
|
|
3873
3885
|
})
|
|
3874
3886
|
])) : V("", !0),
|
|
3875
|
-
|
|
3887
|
+
s("div", {
|
|
3876
3888
|
class: "query-encapsulation__actions",
|
|
3877
3889
|
ref_key: "actionsRef",
|
|
3878
3890
|
ref: C
|
|
3879
3891
|
}, [
|
|
3880
|
-
|
|
3881
|
-
|
|
3892
|
+
s("div", Ba, [
|
|
3893
|
+
Ie(rt, {
|
|
3882
3894
|
variant: "primary",
|
|
3883
3895
|
size: "small",
|
|
3884
3896
|
onClick: fe,
|
|
@@ -3889,7 +3901,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3889
3901
|
])]),
|
|
3890
3902
|
_: 1
|
|
3891
3903
|
}, 8, ["loading"]),
|
|
3892
|
-
|
|
3904
|
+
Ie(rt, {
|
|
3893
3905
|
variant: "secondary",
|
|
3894
3906
|
size: "small",
|
|
3895
3907
|
onClick: ve,
|
|
@@ -3900,7 +3912,7 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3900
3912
|
])]),
|
|
3901
3913
|
_: 1
|
|
3902
3914
|
}, 8, ["loading"]),
|
|
3903
|
-
|
|
3915
|
+
ke(r.$slots, "extra-actions", {}, void 0, !0)
|
|
3904
3916
|
])
|
|
3905
3917
|
], 512)
|
|
3906
3918
|
], 512)
|
|
@@ -3908,25 +3920,25 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3908
3920
|
])
|
|
3909
3921
|
]));
|
|
3910
3922
|
}
|
|
3911
|
-
}),
|
|
3923
|
+
}), za = /* @__PURE__ */ ze(_a, [["__scopeId", "data-v-ff39aeda"]]), Na = {
|
|
3912
3924
|
key: 0,
|
|
3913
3925
|
width: "16",
|
|
3914
3926
|
height: "16",
|
|
3915
3927
|
viewBox: "0 0 24 24",
|
|
3916
3928
|
fill: "none"
|
|
3917
|
-
},
|
|
3929
|
+
}, Ka = {
|
|
3918
3930
|
key: 1,
|
|
3919
3931
|
width: "16",
|
|
3920
3932
|
height: "16",
|
|
3921
3933
|
viewBox: "0 0 24 24",
|
|
3922
3934
|
fill: "none"
|
|
3923
|
-
},
|
|
3935
|
+
}, Wa = {
|
|
3924
3936
|
key: 2,
|
|
3925
3937
|
width: "16",
|
|
3926
3938
|
height: "16",
|
|
3927
3939
|
viewBox: "0 0 24 24",
|
|
3928
3940
|
fill: "none"
|
|
3929
|
-
},
|
|
3941
|
+
}, Ra = ["textContent"], Va = /* @__PURE__ */ _e({
|
|
3930
3942
|
__name: "ymessageToast",
|
|
3931
3943
|
props: {
|
|
3932
3944
|
id: {},
|
|
@@ -3939,16 +3951,16 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3939
3951
|
onClose: {}
|
|
3940
3952
|
},
|
|
3941
3953
|
setup(t) {
|
|
3942
|
-
const f = t, e =
|
|
3954
|
+
const f = t, e = I(!1);
|
|
3943
3955
|
let l, m = 0, h = 0;
|
|
3944
3956
|
Fe(() => {
|
|
3945
3957
|
requestAnimationFrame(() => {
|
|
3946
|
-
e.value = !0, f.duration && f.duration > 0 &&
|
|
3958
|
+
e.value = !0, f.duration && f.duration > 0 && i(f.duration);
|
|
3947
3959
|
});
|
|
3948
3960
|
}), Ct(() => {
|
|
3949
3961
|
S();
|
|
3950
3962
|
});
|
|
3951
|
-
function
|
|
3963
|
+
function i(g) {
|
|
3952
3964
|
m = g, h = Date.now(), l = window.setTimeout(() => C(), g);
|
|
3953
3965
|
}
|
|
3954
3966
|
function S() {
|
|
@@ -3961,8 +3973,8 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3961
3973
|
m = Math.max(0, m - g);
|
|
3962
3974
|
}
|
|
3963
3975
|
}
|
|
3964
|
-
function
|
|
3965
|
-
f.duration && f.duration > 0 && m > 0 &&
|
|
3976
|
+
function M() {
|
|
3977
|
+
f.duration && f.duration > 0 && m > 0 && i(m);
|
|
3966
3978
|
}
|
|
3967
3979
|
function C() {
|
|
3968
3980
|
e.value = !1;
|
|
@@ -3976,36 +3988,36 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
3976
3988
|
onAfterLeave: c
|
|
3977
3989
|
}, {
|
|
3978
3990
|
default: $e(() => [
|
|
3979
|
-
je(
|
|
3991
|
+
je(s("div", {
|
|
3980
3992
|
class: Z(["y-msg", [`y-msg--${t.type}`]]),
|
|
3981
3993
|
style: be({ zIndex: t.zIndex }),
|
|
3982
3994
|
role: "status",
|
|
3983
3995
|
"aria-live": "polite",
|
|
3984
3996
|
onMouseenter: $,
|
|
3985
|
-
onMouseleave:
|
|
3997
|
+
onMouseleave: M
|
|
3986
3998
|
}, [
|
|
3987
|
-
|
|
3999
|
+
s("span", {
|
|
3988
4000
|
class: Z(["y-msg__icon", `y-msg__icon--${t.type}`]),
|
|
3989
4001
|
"aria-hidden": "true"
|
|
3990
4002
|
}, [
|
|
3991
|
-
t.type === "success" ? (d(), p("svg",
|
|
3992
|
-
|
|
4003
|
+
t.type === "success" ? (d(), p("svg", Na, [...x[0] || (x[0] = [
|
|
4004
|
+
s("path", {
|
|
3993
4005
|
d: "M20 6L9 17l-5-5",
|
|
3994
4006
|
stroke: "currentColor",
|
|
3995
4007
|
"stroke-width": "2",
|
|
3996
4008
|
"stroke-linecap": "round",
|
|
3997
4009
|
"stroke-linejoin": "round"
|
|
3998
4010
|
}, null, -1)
|
|
3999
|
-
])])) : t.type === "warning" ? (d(), p("svg",
|
|
4000
|
-
|
|
4011
|
+
])])) : t.type === "warning" ? (d(), p("svg", Ka, [...x[1] || (x[1] = [
|
|
4012
|
+
s("path", {
|
|
4001
4013
|
d: "M12 9v4m0 4h.01M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z",
|
|
4002
4014
|
stroke: "currentColor",
|
|
4003
4015
|
"stroke-width": "2",
|
|
4004
4016
|
"stroke-linecap": "round",
|
|
4005
4017
|
"stroke-linejoin": "round"
|
|
4006
4018
|
}, null, -1)
|
|
4007
|
-
])])) : (d(), p("svg",
|
|
4008
|
-
|
|
4019
|
+
])])) : (d(), p("svg", Wa, [...x[2] || (x[2] = [
|
|
4020
|
+
s("path", {
|
|
4009
4021
|
d: "M12 9v4m0 4h.01M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0z",
|
|
4010
4022
|
stroke: "currentColor",
|
|
4011
4023
|
"stroke-width": "2",
|
|
@@ -4014,10 +4026,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
4014
4026
|
}, null, -1)
|
|
4015
4027
|
])]))
|
|
4016
4028
|
], 2),
|
|
4017
|
-
|
|
4029
|
+
s("div", {
|
|
4018
4030
|
class: "y-msg__content",
|
|
4019
4031
|
textContent: we(t.message)
|
|
4020
|
-
}, null, 8,
|
|
4032
|
+
}, null, 8, Ra),
|
|
4021
4033
|
t.closable ? (d(), p("button", {
|
|
4022
4034
|
key: 0,
|
|
4023
4035
|
class: "y-msg__close",
|
|
@@ -4031,10 +4043,10 @@ const Kt = ["type", "disabled", "aria-busy", "aria-disabled"], Wt = { class: "co
|
|
|
4031
4043
|
_: 1
|
|
4032
4044
|
}));
|
|
4033
4045
|
}
|
|
4034
|
-
}),
|
|
4035
|
-
let
|
|
4046
|
+
}), Aa = /* @__PURE__ */ ze(Va, [["__scopeId", "data-v-db173617"]]);
|
|
4047
|
+
let Pa = 1;
|
|
4036
4048
|
const vt = 12, Ge = [];
|
|
4037
|
-
function
|
|
4049
|
+
function Ya() {
|
|
4038
4050
|
let t = 20;
|
|
4039
4051
|
return Ge.forEach((f) => {
|
|
4040
4052
|
t += f.height + vt;
|
|
@@ -4050,31 +4062,31 @@ function bt(t) {
|
|
|
4050
4062
|
}
|
|
4051
4063
|
Ge[f].leaving = !0, dt(), setTimeout(() => {
|
|
4052
4064
|
xt(null, e), e.parentNode && e.parentNode.removeChild(e);
|
|
4053
|
-
const h = Ge.findIndex((
|
|
4065
|
+
const h = Ge.findIndex((i) => i.id === t);
|
|
4054
4066
|
h !== -1 && Ge.splice(h, 1), dt();
|
|
4055
4067
|
}, 260);
|
|
4056
4068
|
}
|
|
4057
4069
|
function ft(t) {
|
|
4058
4070
|
var h;
|
|
4059
|
-
const f =
|
|
4071
|
+
const f = Pa++, e = document.createElement("div");
|
|
4060
4072
|
document.body.appendChild(e);
|
|
4061
|
-
const l =
|
|
4073
|
+
const l = Ie(Aa, {
|
|
4062
4074
|
id: f,
|
|
4063
4075
|
type: t.type || "success",
|
|
4064
4076
|
message: t.message,
|
|
4065
4077
|
duration: t.duration ?? 2500,
|
|
4066
|
-
offset:
|
|
4078
|
+
offset: Ya(),
|
|
4067
4079
|
// 提升到全局最高层级(高于抽屉、下拉等所有浮层)
|
|
4068
4080
|
zIndex: 2e5 + f,
|
|
4069
4081
|
closable: t.closable ?? !1,
|
|
4070
|
-
onClose: (
|
|
4082
|
+
onClose: (i) => bt(i)
|
|
4071
4083
|
});
|
|
4072
4084
|
xt(l, e);
|
|
4073
4085
|
const m = ((h = e.firstElementChild) == null ? void 0 : h.offsetHeight) || 0;
|
|
4074
4086
|
return Ge.push({ id: f, el: e, vm: l, height: m, leaving: !1 }), dt(), requestAnimationFrame(() => {
|
|
4075
|
-
const
|
|
4076
|
-
if (!
|
|
4077
|
-
const S =
|
|
4087
|
+
const i = e.firstElementChild;
|
|
4088
|
+
if (!i) return;
|
|
4089
|
+
const S = i.offsetHeight || m || 0, $ = Ge.find((M) => M.id === f);
|
|
4078
4090
|
$ && ($.height = S, dt());
|
|
4079
4091
|
}), { close: () => bt(f) };
|
|
4080
4092
|
}
|
|
@@ -4104,7 +4116,7 @@ function dt() {
|
|
|
4104
4116
|
}
|
|
4105
4117
|
});
|
|
4106
4118
|
}
|
|
4107
|
-
const
|
|
4119
|
+
const Fa = { class: "hint-tag-popup-content" }, Oa = ["title"], ja = /* @__PURE__ */ _e({
|
|
4108
4120
|
__name: "hintTag",
|
|
4109
4121
|
props: {
|
|
4110
4122
|
content: { default: "" },
|
|
@@ -4116,7 +4128,7 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4116
4128
|
maxLines: { default: void 0 }
|
|
4117
4129
|
},
|
|
4118
4130
|
setup(t, { expose: f }) {
|
|
4119
|
-
const e = t, l =
|
|
4131
|
+
const e = t, l = I(null), m = I(null), h = I(!1), i = I(!1);
|
|
4120
4132
|
let S = null;
|
|
4121
4133
|
const $ = () => {
|
|
4122
4134
|
if (!e.maxLines || !l.value) {
|
|
@@ -4127,18 +4139,18 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4127
4139
|
K.style.maxHeight = "none", fe && K.classList.remove("hint-tag-content-clamp");
|
|
4128
4140
|
const ve = K.scrollHeight, ce = parseFloat(getComputedStyle(K).lineHeight) || 18, ie = e.maxLines * ce;
|
|
4129
4141
|
K.style.maxHeight = P, fe && K.classList.add("hint-tag-content-clamp"), h.value = ve > ie;
|
|
4130
|
-
},
|
|
4131
|
-
e.maxLines && h.value && (S && (clearTimeout(S), S = null),
|
|
4142
|
+
}, M = () => {
|
|
4143
|
+
e.maxLines && h.value && (S && (clearTimeout(S), S = null), i.value = !0, setTimeout(() => {
|
|
4132
4144
|
x();
|
|
4133
4145
|
}, 0));
|
|
4134
4146
|
}, C = () => {
|
|
4135
4147
|
S = window.setTimeout(() => {
|
|
4136
|
-
|
|
4148
|
+
i.value = !1, S = null;
|
|
4137
4149
|
}, 100);
|
|
4138
4150
|
}, c = () => {
|
|
4139
4151
|
S && (clearTimeout(S), S = null);
|
|
4140
4152
|
}, g = () => {
|
|
4141
|
-
|
|
4153
|
+
i.value = !1;
|
|
4142
4154
|
}, x = () => {
|
|
4143
4155
|
if (!m.value || !l.value) return;
|
|
4144
4156
|
const K = l.value.getBoundingClientRect(), P = m.value.getBoundingClientRect(), fe = window.innerWidth, ve = window.innerHeight, ce = window.scrollX || window.pageXOffset, ie = window.scrollY || window.pageYOffset;
|
|
@@ -4162,16 +4174,16 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4162
4174
|
Nt(() => {
|
|
4163
4175
|
$();
|
|
4164
4176
|
});
|
|
4165
|
-
const
|
|
4166
|
-
|
|
4177
|
+
const H = I(e.defaultExpanded), W = () => {
|
|
4178
|
+
H.value = !H.value;
|
|
4167
4179
|
}, R = () => {
|
|
4168
|
-
|
|
4180
|
+
H.value && (H.value = !1);
|
|
4169
4181
|
}, D = () => {
|
|
4170
|
-
|
|
4182
|
+
H.value || (H.value = !0);
|
|
4171
4183
|
};
|
|
4172
4184
|
f({
|
|
4173
4185
|
toggle: W,
|
|
4174
|
-
isExpanded:
|
|
4186
|
+
isExpanded: H,
|
|
4175
4187
|
collapse: R,
|
|
4176
4188
|
expand: D
|
|
4177
4189
|
});
|
|
@@ -4180,10 +4192,10 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4180
4192
|
expand: D,
|
|
4181
4193
|
toggle: W,
|
|
4182
4194
|
get isExpanded() {
|
|
4183
|
-
return
|
|
4195
|
+
return H.value;
|
|
4184
4196
|
}
|
|
4185
4197
|
};
|
|
4186
|
-
return ge(() =>
|
|
4198
|
+
return ge(() => H.value, () => {
|
|
4187
4199
|
ye && ye(), setTimeout(() => {
|
|
4188
4200
|
$();
|
|
4189
4201
|
}, 0);
|
|
@@ -4191,7 +4203,7 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4191
4203
|
setTimeout(() => {
|
|
4192
4204
|
$();
|
|
4193
4205
|
}, 0);
|
|
4194
|
-
}), ge(
|
|
4206
|
+
}), ge(i, (K) => {
|
|
4195
4207
|
K ? (setTimeout(() => {
|
|
4196
4208
|
x();
|
|
4197
4209
|
}, 0), window.addEventListener("scroll", x, !0), window.addEventListener("resize", x)) : (window.removeEventListener("scroll", x, !0), window.removeEventListener("resize", x));
|
|
@@ -4202,16 +4214,16 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4202
4214
|
}), (K, P) => (d(), p("div", {
|
|
4203
4215
|
class: Z(["hint-tag-wrapper", `hint-tag-wrapper-${t.position}`])
|
|
4204
4216
|
}, [
|
|
4205
|
-
|
|
4217
|
+
Ie(Ve, { name: "hint-slide" }, {
|
|
4206
4218
|
default: $e(() => [
|
|
4207
|
-
je(
|
|
4219
|
+
je(s("div", {
|
|
4208
4220
|
class: Z(["hint-tag", `hint-tag-${t.position}`]),
|
|
4209
4221
|
style: be({
|
|
4210
4222
|
width: t.position === "top" || t.position === "bottom" ? "auto" : t.width,
|
|
4211
4223
|
borderColor: t.borderColor
|
|
4212
4224
|
})
|
|
4213
4225
|
}, [
|
|
4214
|
-
|
|
4226
|
+
s("div", {
|
|
4215
4227
|
ref_key: "contentRef",
|
|
4216
4228
|
ref: l,
|
|
4217
4229
|
class: Z(["hint-tag-content", { "hint-tag-content-clamp": t.maxLines }]),
|
|
@@ -4220,17 +4232,17 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4220
4232
|
lineHeight: "1.5",
|
|
4221
4233
|
maxHeight: `${t.maxLines * 1.5}em`
|
|
4222
4234
|
} : {}),
|
|
4223
|
-
onMouseenter:
|
|
4235
|
+
onMouseenter: M,
|
|
4224
4236
|
onMouseleave: C
|
|
4225
4237
|
}, [
|
|
4226
|
-
|
|
4238
|
+
ke(K.$slots, "default", {}, () => [
|
|
4227
4239
|
We(we(t.content), 1)
|
|
4228
4240
|
], !0)
|
|
4229
4241
|
], 38),
|
|
4230
4242
|
(d(), Pe(Xe, { to: "body" }, [
|
|
4231
|
-
|
|
4243
|
+
Ie(Ve, { name: "popup-fade" }, {
|
|
4232
4244
|
default: $e(() => [
|
|
4233
|
-
|
|
4245
|
+
i.value && h.value ? (d(), p("div", {
|
|
4234
4246
|
key: 0,
|
|
4235
4247
|
ref_key: "popupRef",
|
|
4236
4248
|
ref: m,
|
|
@@ -4238,8 +4250,8 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4238
4250
|
onMouseenter: c,
|
|
4239
4251
|
onMouseleave: g
|
|
4240
4252
|
}, [
|
|
4241
|
-
|
|
4242
|
-
|
|
4253
|
+
s("div", Fa, [
|
|
4254
|
+
ke(K.$slots, "default", {}, () => [
|
|
4243
4255
|
We(we(t.content), 1)
|
|
4244
4256
|
], !0)
|
|
4245
4257
|
])
|
|
@@ -4248,17 +4260,17 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4248
4260
|
_: 3
|
|
4249
4261
|
})
|
|
4250
4262
|
])),
|
|
4251
|
-
|
|
4263
|
+
s("div", {
|
|
4252
4264
|
class: "hint-tag-toggle",
|
|
4253
4265
|
onClick: W
|
|
4254
4266
|
}, [...P[0] || (P[0] = [
|
|
4255
|
-
|
|
4267
|
+
s("svg", {
|
|
4256
4268
|
class: "hint-tag-icon",
|
|
4257
4269
|
viewBox: "0 0 24 24",
|
|
4258
4270
|
fill: "none",
|
|
4259
4271
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4260
4272
|
}, [
|
|
4261
|
-
|
|
4273
|
+
s("path", {
|
|
4262
4274
|
d: "M15 18L9 12L15 6",
|
|
4263
4275
|
stroke: "currentColor",
|
|
4264
4276
|
"stroke-width": "2",
|
|
@@ -4268,25 +4280,25 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4268
4280
|
], -1)
|
|
4269
4281
|
])])
|
|
4270
4282
|
], 6), [
|
|
4271
|
-
[Ze,
|
|
4283
|
+
[Ze, H.value]
|
|
4272
4284
|
])
|
|
4273
4285
|
]),
|
|
4274
4286
|
_: 3
|
|
4275
4287
|
}),
|
|
4276
|
-
|
|
4288
|
+
Ie(Ve, { name: "hint-button-fade" }, {
|
|
4277
4289
|
default: $e(() => [
|
|
4278
|
-
je(
|
|
4290
|
+
je(s("div", {
|
|
4279
4291
|
class: Z(["hint-tag-button", `hint-tag-button-${t.position}`]),
|
|
4280
4292
|
onClick: W,
|
|
4281
4293
|
title: t.tooltip || t.content
|
|
4282
4294
|
}, [...P[1] || (P[1] = [
|
|
4283
|
-
|
|
4295
|
+
s("svg", {
|
|
4284
4296
|
class: "hint-tag-button-icon",
|
|
4285
4297
|
viewBox: "0 0 24 24",
|
|
4286
4298
|
fill: "none",
|
|
4287
4299
|
xmlns: "http://www.w3.org/2000/svg"
|
|
4288
4300
|
}, [
|
|
4289
|
-
|
|
4301
|
+
s("path", {
|
|
4290
4302
|
d: "M9 18L15 12L9 6",
|
|
4291
4303
|
stroke: "currentColor",
|
|
4292
4304
|
"stroke-width": "2",
|
|
@@ -4294,32 +4306,32 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4294
4306
|
"stroke-linejoin": "round"
|
|
4295
4307
|
})
|
|
4296
4308
|
], -1)
|
|
4297
|
-
])], 10,
|
|
4298
|
-
[Ze, !
|
|
4309
|
+
])], 10, Oa), [
|
|
4310
|
+
[Ze, !H.value]
|
|
4299
4311
|
])
|
|
4300
4312
|
]),
|
|
4301
4313
|
_: 1
|
|
4302
4314
|
})
|
|
4303
4315
|
], 2));
|
|
4304
4316
|
}
|
|
4305
|
-
}),
|
|
4317
|
+
}), qa = /* @__PURE__ */ ze(ja, [["__scopeId", "data-v-9bfcff29"]]), kt = {
|
|
4306
4318
|
YButton: rt,
|
|
4307
4319
|
YInput: Dt,
|
|
4308
|
-
YTable:
|
|
4320
|
+
YTable: $l,
|
|
4309
4321
|
YSelect: $t,
|
|
4310
|
-
YPagination:
|
|
4311
|
-
YBadge:
|
|
4312
|
-
YDialog:
|
|
4313
|
-
YPopover:
|
|
4322
|
+
YPagination: Yl,
|
|
4323
|
+
YBadge: nn,
|
|
4324
|
+
YDialog: fn,
|
|
4325
|
+
YPopover: gn,
|
|
4314
4326
|
YTime: St,
|
|
4315
|
-
YSwitch:
|
|
4316
|
-
YImage:
|
|
4317
|
-
YDropdown:
|
|
4318
|
-
YDrawer:
|
|
4319
|
-
YTree:
|
|
4320
|
-
QueryEncapsulation:
|
|
4321
|
-
HintTag:
|
|
4322
|
-
},
|
|
4327
|
+
YSwitch: It,
|
|
4328
|
+
YImage: na,
|
|
4329
|
+
YDropdown: oa,
|
|
4330
|
+
YDrawer: va,
|
|
4331
|
+
YTree: Sa,
|
|
4332
|
+
QueryEncapsulation: za,
|
|
4333
|
+
HintTag: qa
|
|
4334
|
+
}, Za = {
|
|
4323
4335
|
install(t) {
|
|
4324
4336
|
Object.keys(kt).forEach((f) => {
|
|
4325
4337
|
t.component(f, kt[f]);
|
|
@@ -4327,22 +4339,22 @@ const Pa = { class: "hint-tag-popup-content" }, Ya = ["title"], Fa = /* @__PURE_
|
|
|
4327
4339
|
}
|
|
4328
4340
|
};
|
|
4329
4341
|
export {
|
|
4330
|
-
|
|
4331
|
-
|
|
4342
|
+
za as QueryEncapsulation,
|
|
4343
|
+
nn as YBadge,
|
|
4332
4344
|
rt as YButton,
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4345
|
+
fn as YDialog,
|
|
4346
|
+
va as YDrawer,
|
|
4347
|
+
oa as YDropdown,
|
|
4348
|
+
na as YImage,
|
|
4337
4349
|
Dt as YInput,
|
|
4338
4350
|
ut as YMessage,
|
|
4339
|
-
|
|
4340
|
-
|
|
4351
|
+
Yl as YPagination,
|
|
4352
|
+
gn as YPopover,
|
|
4341
4353
|
$t as YSelect,
|
|
4342
|
-
|
|
4343
|
-
|
|
4354
|
+
It as YSwitch,
|
|
4355
|
+
$l as YTable,
|
|
4344
4356
|
St as YTime,
|
|
4345
|
-
|
|
4346
|
-
|
|
4357
|
+
Sa as YTree,
|
|
4358
|
+
Za as default
|
|
4347
4359
|
};
|
|
4348
4360
|
//# sourceMappingURL=index.esm.js.map
|