@nhdropshipping/y-components 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/yimage.vue.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +668 -666
- 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
|
|
1
|
+
import { defineComponent as we, computed as Y, createElementBlock as u, openBlock as i, normalizeClass as E, createElementVNode as o, renderSlot as se, Fragment as ae, renderList as de, createCommentVNode as W, toDisplayString as ee, ref as K, watch as te, normalizeStyle as ve, nextTick as oe, onMounted as De, onUnmounted as Ee, resolveComponent as Ae, createVNode as ie, Transition as $e, withCtx as ue, createTextVNode as Ce, createBlock as Le, withKeys as ke, withModifiers as Q, withDirectives as Be, vModelText as lt, Teleport as Fe, vShow as Ke, provide as ot, reactive as at, TransitionGroup as st, resolveDynamicComponent as it, onBeforeUnmount as rt, render as Xe } from "vue";
|
|
2
2
|
const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "content" }, dt = {
|
|
3
3
|
key: 1,
|
|
4
4
|
class: "y-btn-group",
|
|
@@ -15,7 +15,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
15
15
|
viewBox: "0 0 20 20",
|
|
16
16
|
fill: "currentColor",
|
|
17
17
|
"aria-hidden": "true"
|
|
18
|
-
}, yt = { key: 2 }, gt = /* @__PURE__ */
|
|
18
|
+
}, yt = { key: 2 }, gt = /* @__PURE__ */ we({
|
|
19
19
|
__name: "ybutton",
|
|
20
20
|
props: {
|
|
21
21
|
htmlType: { default: "button" },
|
|
@@ -37,7 +37,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
37
37
|
}
|
|
38
38
|
n("click", C);
|
|
39
39
|
}
|
|
40
|
-
const p =
|
|
40
|
+
const p = Y(() => {
|
|
41
41
|
switch (t.groupPosition) {
|
|
42
42
|
case "start":
|
|
43
43
|
return "group-pos-start";
|
|
@@ -48,7 +48,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
48
48
|
default:
|
|
49
49
|
return "group-pos-single";
|
|
50
50
|
}
|
|
51
|
-
}), y =
|
|
51
|
+
}), y = Y(() => Array.isArray(t.groupItems) && t.groupItems.length > 0);
|
|
52
52
|
function I(C, T) {
|
|
53
53
|
if (t.disabled || t.loading || C.disabled || C.loading) {
|
|
54
54
|
T.preventDefault(), T.stopPropagation();
|
|
@@ -57,7 +57,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
57
57
|
n("group-click", C.value, T);
|
|
58
58
|
}
|
|
59
59
|
return (C, T) => y.value ? (i(), u("div", dt, [
|
|
60
|
-
(i(!0), u(
|
|
60
|
+
(i(!0), u(ae, null, de(e.groupItems, (k, w) => {
|
|
61
61
|
var g;
|
|
62
62
|
return i(), u("button", {
|
|
63
63
|
key: k.value ?? w,
|
|
@@ -89,7 +89,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
89
89
|
"clip-rule": "evenodd"
|
|
90
90
|
}, null, -1)
|
|
91
91
|
])])) : W("", !0),
|
|
92
|
-
k.label && !k.onlyIcon ? (i(), u("span", yt,
|
|
92
|
+
k.label && !k.onlyIcon ? (i(), u("span", yt, ee(k.label), 1)) : W("", !0)
|
|
93
93
|
])
|
|
94
94
|
], 10, ft);
|
|
95
95
|
}), 128))
|
|
@@ -109,16 +109,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
109
109
|
onClick: m
|
|
110
110
|
}, [
|
|
111
111
|
o("span", ct, [
|
|
112
|
-
|
|
112
|
+
se(C.$slots, "default", {}, void 0, !0)
|
|
113
113
|
])
|
|
114
114
|
], 10, ut));
|
|
115
115
|
}
|
|
116
|
-
}),
|
|
116
|
+
}), be = (e, $) => {
|
|
117
117
|
const t = e.__vccOpts || e;
|
|
118
118
|
for (const [n, m] of $)
|
|
119
119
|
t[n] = m;
|
|
120
120
|
return t;
|
|
121
|
-
}, Ne = /* @__PURE__ */
|
|
121
|
+
}, Ne = /* @__PURE__ */ be(gt, [["__scopeId", "data-v-40819241"]]), mt = ["id", "name", "type", "placeholder", "autocomplete", "inputmode", "disabled", "required", "value"], wt = /* @__PURE__ */ we({
|
|
122
122
|
__name: "yinput",
|
|
123
123
|
props: {
|
|
124
124
|
modelValue: { default: "" },
|
|
@@ -138,7 +138,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
138
138
|
emits: ["update:modelValue"],
|
|
139
139
|
setup(e, { emit: $ }) {
|
|
140
140
|
const t = e, n = $, m = K(null), p = K(""), y = K(!1), I = K(!1), C = K(t.placeholder || "");
|
|
141
|
-
|
|
141
|
+
te(() => t.placeholder, (g) => {
|
|
142
142
|
I.value || (C.value = g || "");
|
|
143
143
|
});
|
|
144
144
|
function T(g) {
|
|
@@ -153,7 +153,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
153
153
|
}
|
|
154
154
|
return (g, x) => (i(), u("div", {
|
|
155
155
|
class: E(["y-input-wrap", { "is-block": e.block }]),
|
|
156
|
-
style:
|
|
156
|
+
style: ve({ width: e.width })
|
|
157
157
|
}, [
|
|
158
158
|
o("input", {
|
|
159
159
|
ref_key: "inputRef",
|
|
@@ -174,7 +174,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
174
174
|
}, null, 42, mt)
|
|
175
175
|
], 6));
|
|
176
176
|
}
|
|
177
|
-
}), Ge = /* @__PURE__ */
|
|
177
|
+
}), Ge = /* @__PURE__ */ be(wt, [["__scopeId", "data-v-e4bfe1f3"]]), bt = {
|
|
178
178
|
key: 0,
|
|
179
179
|
class: "bulk-bar"
|
|
180
180
|
}, kt = { class: "bulk-left" }, xt = { class: "bulk-actions" }, $t = { class: "card" }, Ct = { class: "table" }, Dt = {
|
|
@@ -207,7 +207,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
207
207
|
}, Kt = ["onClick"], Ht = {
|
|
208
208
|
key: 1,
|
|
209
209
|
class: "col-select"
|
|
210
|
-
}, Wt = ["value", "checked", "onChange"], Rt = ["colspan"], Vt = /* @__PURE__ */
|
|
210
|
+
}, Wt = ["value", "checked", "onChange"], Rt = ["colspan"], Vt = /* @__PURE__ */ we({
|
|
211
211
|
__name: "ytable",
|
|
212
212
|
props: {
|
|
213
213
|
data: {},
|
|
@@ -234,20 +234,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
234
234
|
},
|
|
235
235
|
emits: ["edit", "select", "update:selectedItems", "page-change", "page-size-change"],
|
|
236
236
|
setup(e, { emit: $ }) {
|
|
237
|
-
const t = e, n = $, m = K(t.currentPage || 1), p = K(t.pageSize), y = K([]), I = K(/* @__PURE__ */ new Set()), C = K("none"), T = K(), k = K(), w = K(), g = K(), x = K([]),
|
|
238
|
-
() => t.columns.filter((l) => !
|
|
237
|
+
const t = e, n = $, m = K(t.currentPage || 1), p = K(t.pageSize), y = K([]), I = K(/* @__PURE__ */ new Set()), C = K("none"), T = K(), k = K(), w = K(), g = K(), x = K([]), P = K({}), J = Y(
|
|
238
|
+
() => t.columns.filter((l) => !U(l.width)).map((l) => l.key)
|
|
239
239
|
);
|
|
240
240
|
function A() {
|
|
241
|
-
return `${(100 / (
|
|
241
|
+
return `${(100 / (J.value.length || 1)).toFixed(6)}%`;
|
|
242
242
|
}
|
|
243
243
|
const D = K(), z = K({
|
|
244
244
|
show: !1,
|
|
245
245
|
thumbHeight: 40,
|
|
246
246
|
thumbTop: 0
|
|
247
247
|
});
|
|
248
|
-
let B = !1, F = 0,
|
|
248
|
+
let B = !1, F = 0, N = 0;
|
|
249
249
|
const q = K(0);
|
|
250
|
-
function
|
|
250
|
+
function U(l) {
|
|
251
251
|
if (l == null) return;
|
|
252
252
|
if (typeof l == "number")
|
|
253
253
|
return Number.isFinite(l) ? `${l}px` : void 0;
|
|
@@ -255,16 +255,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
255
255
|
if (c)
|
|
256
256
|
return /^\d+(\.\d+)?$/.test(c) ? `${c}px` : c;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
const c =
|
|
258
|
+
function re(l) {
|
|
259
|
+
const c = U(l);
|
|
260
260
|
if (!c) return null;
|
|
261
261
|
const _ = parseFloat(c);
|
|
262
262
|
return Number.isFinite(_) ? _ : null;
|
|
263
263
|
}
|
|
264
|
-
const
|
|
264
|
+
const ce = Y(() => {
|
|
265
265
|
let l = t.columns.length;
|
|
266
266
|
return t.selectable && (l += 1), t.expandable && (l += 1), l;
|
|
267
|
-
}),
|
|
267
|
+
}), ne = Y(() => {
|
|
268
268
|
if (!t.searchKeyword || !t.searchFields.length)
|
|
269
269
|
return t.data;
|
|
270
270
|
const l = t.searchKeyword.toLowerCase();
|
|
@@ -272,23 +272,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
272
272
|
const M = r(c, _);
|
|
273
273
|
return String(M).toLowerCase().includes(l);
|
|
274
274
|
}));
|
|
275
|
-
}),
|
|
275
|
+
}), he = Y(() => (t.pagination, ne.value)), ge = Y(() => {
|
|
276
276
|
if (!t.selectable) return !1;
|
|
277
|
-
const l =
|
|
277
|
+
const l = he.value.map((c, _) => d(c, _));
|
|
278
278
|
return l.length > 0 && l.every((c) => y.value.includes(c));
|
|
279
|
-
}),
|
|
279
|
+
}), me = Y(() => {
|
|
280
280
|
const l = [];
|
|
281
281
|
let c = t.selectable ? 40 : 0;
|
|
282
282
|
for (let _ = 0; _ < t.columns.length; _++) {
|
|
283
283
|
const M = t.columns[_];
|
|
284
284
|
if (M.fixed === "left") {
|
|
285
285
|
let S = 80;
|
|
286
|
-
const H =
|
|
287
|
-
H !== null ? S = H : x.value[_] && (S =
|
|
286
|
+
const H = re(M.width);
|
|
287
|
+
H !== null ? S = H : x.value[_] && (S = re(x.value[_]) ?? S), l.push(c), c += S;
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
290
|
return l;
|
|
291
|
-
}), V =
|
|
291
|
+
}), V = Y(() => {
|
|
292
292
|
const l = [];
|
|
293
293
|
let c = 0;
|
|
294
294
|
const _ = [];
|
|
@@ -296,15 +296,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
296
296
|
const S = t.columns[M];
|
|
297
297
|
if (S.fixed === "right") {
|
|
298
298
|
let H = 80;
|
|
299
|
-
const
|
|
300
|
-
|
|
299
|
+
const O = re(S.width);
|
|
300
|
+
O !== null ? H = O : x.value[M] && (H = re(x.value[M]) ?? H), _.push({ index: M, width: H });
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
for (let M = 0; M < _.length; M++)
|
|
304
304
|
l.push(c), c += _[M].width;
|
|
305
305
|
return l;
|
|
306
306
|
});
|
|
307
|
-
function
|
|
307
|
+
function Z(l, c) {
|
|
308
308
|
if (c === "left") {
|
|
309
309
|
let _ = 0;
|
|
310
310
|
for (let M = 0; M < l; M++)
|
|
@@ -334,7 +334,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
334
334
|
return l.align && _.push(`text-${l.align}`), l.fixed === "right" && (_.push("col-fixed-right"), c && _.push("col-fixed-right-header")), l.fixed === "left" && (_.push("col-fixed-left"), c && _.push("col-fixed-left-header")), _.join(" ");
|
|
335
335
|
}
|
|
336
336
|
function b(l, c, _) {
|
|
337
|
-
const M = {}, S =
|
|
337
|
+
const M = {}, S = U(l.width);
|
|
338
338
|
if (S)
|
|
339
339
|
M.width = S, M.minWidth = S, M.maxWidth = S;
|
|
340
340
|
else {
|
|
@@ -342,11 +342,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
342
342
|
M.width = H, M.minWidth = H, M.maxWidth = H;
|
|
343
343
|
}
|
|
344
344
|
if (l.fixed === "left") {
|
|
345
|
-
const H =
|
|
346
|
-
M.left = `${
|
|
345
|
+
const H = Z(c, "left"), O = me.value[H] || 0;
|
|
346
|
+
M.left = `${O}px`, M.zIndex = _ ? `${10 + H}` : `${5 + H}`;
|
|
347
347
|
} else if (l.fixed === "right") {
|
|
348
|
-
const H =
|
|
349
|
-
_ ? M.right = `${
|
|
348
|
+
const H = Z(c, "right"), O = V.value[H] || 0;
|
|
349
|
+
_ ? M.right = `${O - 3}px` : M.right = `${O}px`, M.zIndex = _ ? `${10 + H}` : `${5 + H}`;
|
|
350
350
|
}
|
|
351
351
|
return M;
|
|
352
352
|
}
|
|
@@ -354,11 +354,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
354
354
|
const _ = r(l, c.key);
|
|
355
355
|
return c.formatter ? c.formatter(_, l) : _ || "";
|
|
356
356
|
}
|
|
357
|
-
function
|
|
357
|
+
function j(l) {
|
|
358
358
|
y.value.includes(l) ? y.value = y.value.filter((c) => c !== l) : y.value = [...y.value, l], n("select", y.value), n("update:selectedItems", y.value);
|
|
359
359
|
}
|
|
360
|
-
function
|
|
361
|
-
const l =
|
|
360
|
+
function X() {
|
|
361
|
+
const l = he.value.map((c, _) => d(c, _));
|
|
362
362
|
if (l.every((c) => y.value.includes(c)))
|
|
363
363
|
y.value = y.value.filter((c) => !l.includes(c));
|
|
364
364
|
else {
|
|
@@ -367,149 +367,149 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
367
367
|
}
|
|
368
368
|
n("select", y.value), n("update:selectedItems", y.value);
|
|
369
369
|
}
|
|
370
|
-
function
|
|
370
|
+
function R() {
|
|
371
371
|
y.value = [], n("select", y.value), n("update:selectedItems", y.value);
|
|
372
372
|
}
|
|
373
|
-
|
|
373
|
+
te(() => t.searchKeyword, () => {
|
|
374
374
|
m.value = 1;
|
|
375
|
-
}),
|
|
375
|
+
}), te(() => t.data, () => {
|
|
376
376
|
t.total || (m.value = 1);
|
|
377
377
|
}, { deep: !0 });
|
|
378
|
-
function
|
|
378
|
+
function G(l) {
|
|
379
379
|
m.value = l, n("page-change", l);
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function Se(l) {
|
|
382
382
|
p.value = l, m.value = 1, n("page-size-change", l);
|
|
383
383
|
}
|
|
384
|
-
|
|
384
|
+
te(() => t.currentPage, (l) => {
|
|
385
385
|
const c = typeof l == "number" && l > 0 ? l : 1;
|
|
386
386
|
m.value !== c && (m.value = c);
|
|
387
|
-
}),
|
|
387
|
+
}), te(() => t.pageSize, (l) => {
|
|
388
388
|
const c = typeof l == "number" && l > 0 ? l : 10;
|
|
389
389
|
p.value !== c && (p.value = c);
|
|
390
390
|
});
|
|
391
|
-
function
|
|
392
|
-
T.value &&
|
|
393
|
-
const l = T.value.getBoundingClientRect(), c = window.innerHeight, _ = l.top, M = T.value.querySelector(".table-header"), S = M ? M.offsetHeight : 40, H = T.value.querySelector(".ypagination"),
|
|
394
|
-
Ze && (Ze.offsetHeight >
|
|
391
|
+
function pe() {
|
|
392
|
+
T.value && oe(() => {
|
|
393
|
+
const l = T.value.getBoundingClientRect(), c = window.innerHeight, _ = l.top, M = T.value.querySelector(".table-header"), S = M ? M.offsetHeight : 40, H = T.value.querySelector(".ypagination"), O = H ? H.offsetHeight : 60, fe = T.value.querySelector(".bulk-bar"), ye = fe ? fe.offsetHeight : 0, ze = S + O + ye + 20, le = c - _ - ze, nt = Math.max(200, le), Ze = T.value.querySelector(".table-body-wrap .table");
|
|
394
|
+
Ze && (Ze.offsetHeight > le ? C.value = `${nt}px` : C.value = "none");
|
|
395
395
|
});
|
|
396
396
|
}
|
|
397
|
-
let
|
|
397
|
+
let xe = !1;
|
|
398
398
|
function Ie() {
|
|
399
|
-
!k.value || !w.value ||
|
|
400
|
-
|
|
399
|
+
!k.value || !w.value || xe || k.value.scrollLeft !== w.value.scrollLeft && (xe = !0, k.value.scrollLeft = w.value.scrollLeft, requestAnimationFrame(() => {
|
|
400
|
+
xe = !1;
|
|
401
401
|
}));
|
|
402
402
|
}
|
|
403
403
|
function Pe() {
|
|
404
|
-
!k.value || !w.value ||
|
|
405
|
-
|
|
404
|
+
!k.value || !w.value || xe || w.value.scrollLeft !== k.value.scrollLeft && (xe = !0, w.value.scrollLeft = k.value.scrollLeft, requestAnimationFrame(() => {
|
|
405
|
+
xe = !1;
|
|
406
406
|
}));
|
|
407
407
|
}
|
|
408
408
|
function We() {
|
|
409
|
-
|
|
409
|
+
oe(() => {
|
|
410
410
|
if (!w.value) return;
|
|
411
411
|
const l = w.value, c = l.scrollHeight, _ = l.clientHeight, M = l.scrollTop, S = c > _ + 1;
|
|
412
412
|
if (z.value.show = S, !S) return;
|
|
413
|
-
const H = 24,
|
|
414
|
-
z.value.thumbHeight =
|
|
415
|
-
const ze = Math.max(0,
|
|
416
|
-
z.value.thumbTop = Math.min(ze, Math.floor(M /
|
|
413
|
+
const H = 24, O = _ / c, fe = D.value ? D.value.clientHeight : _, ye = Math.max(H, Math.floor(fe * O));
|
|
414
|
+
z.value.thumbHeight = ye;
|
|
415
|
+
const ze = Math.max(0, fe - ye), le = Math.max(1, c - _);
|
|
416
|
+
z.value.thumbTop = Math.min(ze, Math.floor(M / le * ze));
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
function Re(l) {
|
|
420
420
|
if (!B || !w.value || !D.value) return;
|
|
421
421
|
l.preventDefault();
|
|
422
|
-
const c = D.value.clientHeight, _ = Math.max(0, c - z.value.thumbHeight), M = w.value, S = M.scrollHeight, H = M.clientHeight,
|
|
423
|
-
M.scrollTop = Math.min(
|
|
422
|
+
const c = D.value.clientHeight, _ = Math.max(0, c - z.value.thumbHeight), M = w.value, S = M.scrollHeight, H = M.clientHeight, O = Math.max(1, S - H), ye = (l.clientY - F) / Math.max(1, _) * O;
|
|
423
|
+
M.scrollTop = Math.min(O, Math.max(0, N + ye)), We();
|
|
424
424
|
}
|
|
425
425
|
function Ye() {
|
|
426
426
|
B = !1, window.removeEventListener("mousemove", Re), window.removeEventListener("mouseup", Ye);
|
|
427
427
|
}
|
|
428
428
|
function Ve() {
|
|
429
|
-
|
|
429
|
+
oe(() => {
|
|
430
430
|
var _, M;
|
|
431
431
|
if (x.value.length === t.columns.length && x.value.every((S) => !!S))
|
|
432
432
|
return;
|
|
433
433
|
const l = [];
|
|
434
434
|
t.columns.forEach((S, H) => {
|
|
435
|
-
const
|
|
436
|
-
if (
|
|
437
|
-
l.push(
|
|
438
|
-
else if (
|
|
439
|
-
l.push(
|
|
435
|
+
const O = U(S.width);
|
|
436
|
+
if (O)
|
|
437
|
+
l.push(O), P.value[S.key] = O;
|
|
438
|
+
else if (P.value[S.key])
|
|
439
|
+
l.push(P.value[S.key]);
|
|
440
440
|
else {
|
|
441
|
-
const
|
|
442
|
-
if (
|
|
443
|
-
l.push(
|
|
441
|
+
const fe = x.value[H];
|
|
442
|
+
if (fe)
|
|
443
|
+
l.push(fe), P.value[S.key] = fe;
|
|
444
444
|
else {
|
|
445
|
-
const
|
|
446
|
-
l.push(
|
|
445
|
+
const ye = A();
|
|
446
|
+
l.push(ye), P.value[S.key] = ye;
|
|
447
447
|
}
|
|
448
448
|
}
|
|
449
449
|
});
|
|
450
450
|
const c = (_ = g.value) == null ? void 0 : _.querySelector("tbody tr");
|
|
451
451
|
if (c) {
|
|
452
452
|
const S = t.selectable ? 1 : 0, H = Array.from(c.children);
|
|
453
|
-
for (let
|
|
454
|
-
if (!l[
|
|
455
|
-
const
|
|
456
|
-
if (
|
|
457
|
-
const
|
|
458
|
-
l[
|
|
453
|
+
for (let O = 0; O < t.columns.length; O++)
|
|
454
|
+
if (!l[O]) {
|
|
455
|
+
const fe = H[S + O];
|
|
456
|
+
if (fe && fe.clientWidth > 0) {
|
|
457
|
+
const ye = `${fe.clientWidth}px`;
|
|
458
|
+
l[O] = ye, P.value[t.columns[O].key] = ye;
|
|
459
459
|
} else {
|
|
460
|
-
const
|
|
461
|
-
l[
|
|
460
|
+
const ye = A();
|
|
461
|
+
l[O] = ye, P.value[t.columns[O].key] = ye;
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
} else
|
|
465
465
|
for (let S = 0; S < l.length; S++)
|
|
466
466
|
if (!l[S]) {
|
|
467
|
-
const H =
|
|
468
|
-
l[S] = H || x.value[S] || "80px", t.columns[S] && (
|
|
467
|
+
const H = P.value[((M = t.columns[S]) == null ? void 0 : M.key) || ""];
|
|
468
|
+
l[S] = H || x.value[S] || "80px", t.columns[S] && (P.value[t.columns[S].key] = l[S]);
|
|
469
469
|
}
|
|
470
470
|
x.value = l;
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
function He() {
|
|
474
|
-
|
|
474
|
+
pe(), s();
|
|
475
475
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
476
|
+
te(() => t.data, () => {
|
|
477
|
+
oe(() => {
|
|
478
|
+
pe(), Ie(), s(), I.value.clear();
|
|
479
479
|
});
|
|
480
|
-
}, { deep: !0 }),
|
|
481
|
-
|
|
482
|
-
|
|
480
|
+
}, { deep: !0 }), te([m, p], () => {
|
|
481
|
+
oe(() => {
|
|
482
|
+
pe(), Ie(), s();
|
|
483
483
|
});
|
|
484
|
-
}),
|
|
485
|
-
const l = [], c = { ...
|
|
484
|
+
}), te(() => t.columns, () => {
|
|
485
|
+
const l = [], c = { ...P.value };
|
|
486
486
|
t.columns.forEach((M, S) => {
|
|
487
|
-
const H =
|
|
487
|
+
const H = U(M.width);
|
|
488
488
|
H ? (l.push(H), c[M.key] = H) : c[M.key] ? l.push(c[M.key]) : x.value[S] ? (l.push(x.value[S]), c[M.key] = x.value[S]) : l.push("");
|
|
489
489
|
});
|
|
490
490
|
const _ = new Set(t.columns.map((M) => M.key));
|
|
491
491
|
Object.keys(c).forEach((M) => {
|
|
492
492
|
_.has(M) || delete c[M];
|
|
493
|
-
}),
|
|
493
|
+
}), P.value = c, x.value = l, oe(() => {
|
|
494
494
|
Ve(), Ie(), s();
|
|
495
495
|
});
|
|
496
|
-
}, { deep: !0 }),
|
|
497
|
-
|
|
498
|
-
|
|
496
|
+
}, { deep: !0 }), te(() => y.value, () => {
|
|
497
|
+
oe(() => {
|
|
498
|
+
pe(), s();
|
|
499
499
|
});
|
|
500
|
-
}, { deep: !0 }),
|
|
501
|
-
|
|
500
|
+
}, { deep: !0 }), te(() => t.loading, () => {
|
|
501
|
+
oe(() => {
|
|
502
502
|
s();
|
|
503
503
|
});
|
|
504
|
-
}),
|
|
504
|
+
}), De(() => {
|
|
505
505
|
var l, c;
|
|
506
|
-
|
|
507
|
-
|
|
506
|
+
oe(() => {
|
|
507
|
+
pe(), Ve(), s(), We();
|
|
508
508
|
}), window.addEventListener("resize", He), window.addEventListener("scroll", He, !0), (l = w.value) == null || l.addEventListener("scroll", () => {
|
|
509
509
|
Ie(), We(), s();
|
|
510
510
|
}, { passive: !0 }), (c = k.value) == null || c.addEventListener("scroll", () => {
|
|
511
511
|
Pe();
|
|
512
|
-
}, { passive: !0 }),
|
|
512
|
+
}, { passive: !0 }), oe(() => Ie()), w.value && typeof ResizeObserver < "u" && (v = new ResizeObserver(() => {
|
|
513
513
|
s();
|
|
514
514
|
}), v.observe(w.value));
|
|
515
515
|
}), Ee(() => {
|
|
@@ -536,22 +536,22 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
536
536
|
ref_key: "tableContainer",
|
|
537
537
|
ref: T
|
|
538
538
|
}, [
|
|
539
|
-
|
|
540
|
-
default:
|
|
539
|
+
ie($e, { name: "bulk-slide" }, {
|
|
540
|
+
default: ue(() => [
|
|
541
541
|
y.value.length && e.showBulkActions ? (i(), u("div", bt, [
|
|
542
|
-
o("div", kt, "已选择 " +
|
|
542
|
+
o("div", kt, "已选择 " + ee(y.value.length) + " 项", 1),
|
|
543
543
|
o("div", xt, [
|
|
544
|
-
|
|
544
|
+
se(l.$slots, "bulk-actions", {
|
|
545
545
|
selectedItems: y.value,
|
|
546
|
-
clearSelection:
|
|
546
|
+
clearSelection: R
|
|
547
547
|
}, () => [
|
|
548
|
-
|
|
548
|
+
ie(_, {
|
|
549
549
|
size: "small",
|
|
550
550
|
class: "btn",
|
|
551
|
-
onClick:
|
|
551
|
+
onClick: R
|
|
552
552
|
}, {
|
|
553
|
-
default:
|
|
554
|
-
|
|
553
|
+
default: ue(() => [...c[2] || (c[2] = [
|
|
554
|
+
Ce("清除选择", -1)
|
|
555
555
|
])]),
|
|
556
556
|
_: 1
|
|
557
557
|
})
|
|
@@ -571,9 +571,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
571
571
|
o("colgroup", null, [
|
|
572
572
|
t.expandable ? (i(), u("col", Dt)) : W("", !0),
|
|
573
573
|
e.selectable ? (i(), u("col", _t)) : W("", !0),
|
|
574
|
-
(i(!0), u(
|
|
574
|
+
(i(!0), u(ae, null, de(e.columns, (S, H) => (i(), u("col", {
|
|
575
575
|
key: S.key,
|
|
576
|
-
style:
|
|
576
|
+
style: ve({ width: x.value[H] || void 0, minWidth: x.value[H] || "80px" })
|
|
577
577
|
}, null, 4))), 128))
|
|
578
578
|
]),
|
|
579
579
|
o("thead", null, [
|
|
@@ -582,32 +582,32 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
582
582
|
e.selectable ? (i(), u("th", Mt, [
|
|
583
583
|
o("input", {
|
|
584
584
|
type: "checkbox",
|
|
585
|
-
checked:
|
|
586
|
-
onChange:
|
|
585
|
+
checked: ge.value,
|
|
586
|
+
onChange: X
|
|
587
587
|
}, null, 40, Lt)
|
|
588
588
|
])) : W("", !0),
|
|
589
|
-
(i(!0), u(
|
|
589
|
+
(i(!0), u(ae, null, de(e.columns, (S, H) => (i(), u("th", {
|
|
590
590
|
key: S.key,
|
|
591
591
|
class: E(f(S, !0)),
|
|
592
|
-
style:
|
|
593
|
-
},
|
|
592
|
+
style: ve(b(S, H, !0))
|
|
593
|
+
}, ee(S.title), 7))), 128))
|
|
594
594
|
])
|
|
595
595
|
])
|
|
596
596
|
])
|
|
597
597
|
], 512),
|
|
598
598
|
o("div", {
|
|
599
|
-
class: E(["table-body-wrap", { "is-loading": e.loading, "is-empty": !
|
|
599
|
+
class: E(["table-body-wrap", { "is-loading": e.loading, "is-empty": !he.value.length && !e.loading }]),
|
|
600
600
|
ref_key: "bodyWrapRef",
|
|
601
601
|
ref: w,
|
|
602
|
-
style:
|
|
602
|
+
style: ve({ maxHeight: C.value })
|
|
603
603
|
}, [
|
|
604
604
|
e.loading ? (i(), u("div", It, [...c[3] || (c[3] = [
|
|
605
605
|
o("div", { class: "loading-spinner" }, null, -1),
|
|
606
606
|
o("div", { class: "loading-text" }, "加载中...", -1)
|
|
607
607
|
])])) : W("", !0),
|
|
608
|
-
!
|
|
609
|
-
|
|
610
|
-
|
|
608
|
+
!he.value.length && !e.loading ? (i(), u("div", Bt, [
|
|
609
|
+
se(l.$slots, "empty", {}, () => [
|
|
610
|
+
Ce(ee(e.emptyText), 1)
|
|
611
611
|
], !0)
|
|
612
612
|
])) : W("", !0),
|
|
613
613
|
o("table", {
|
|
@@ -618,13 +618,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
618
618
|
o("colgroup", null, [
|
|
619
619
|
t.expandable ? (i(), u("col", Et)) : W("", !0),
|
|
620
620
|
e.selectable ? (i(), u("col", Tt)) : W("", !0),
|
|
621
|
-
(i(!0), u(
|
|
621
|
+
(i(!0), u(ae, null, de(e.columns, (S, H) => (i(), u("col", {
|
|
622
622
|
key: S.key,
|
|
623
|
-
style:
|
|
623
|
+
style: ve({ width: x.value[H] || void 0, minWidth: x.value[H] || "80px" })
|
|
624
624
|
}, null, 4))), 128))
|
|
625
625
|
]),
|
|
626
626
|
o("tbody", null, [
|
|
627
|
-
(i(!0), u(
|
|
627
|
+
(i(!0), u(ae, null, de(he.value, (S, H) => (i(), u(ae, {
|
|
628
628
|
key: d(S, H)
|
|
629
629
|
}, [
|
|
630
630
|
o("tr", null, [
|
|
@@ -632,7 +632,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
632
632
|
o("button", {
|
|
633
633
|
class: "expand-btn",
|
|
634
634
|
type: "button",
|
|
635
|
-
onClick: (
|
|
635
|
+
onClick: (O) => a(d(S, H))
|
|
636
636
|
}, [
|
|
637
637
|
o("span", {
|
|
638
638
|
class: E(["expand-icon", { "is-open": h(d(S, H)) }])
|
|
@@ -644,20 +644,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
644
644
|
type: "checkbox",
|
|
645
645
|
value: d(S, H),
|
|
646
646
|
checked: y.value.includes(d(S, H)),
|
|
647
|
-
onChange: (
|
|
647
|
+
onChange: (O) => j(d(S, H))
|
|
648
648
|
}, null, 40, Wt)
|
|
649
649
|
])) : W("", !0),
|
|
650
|
-
(i(!0), u(
|
|
651
|
-
key:
|
|
652
|
-
class: E(f(
|
|
653
|
-
style:
|
|
650
|
+
(i(!0), u(ae, null, de(e.columns, (O, fe) => (i(), u("td", {
|
|
651
|
+
key: O.key,
|
|
652
|
+
class: E(f(O)),
|
|
653
|
+
style: ve(b(O, fe, !1))
|
|
654
654
|
}, [
|
|
655
|
-
|
|
655
|
+
se(l.$slots, `cell-${O.key}`, {
|
|
656
656
|
item: S,
|
|
657
|
-
value: r(S,
|
|
657
|
+
value: r(S, O.key),
|
|
658
658
|
index: H
|
|
659
659
|
}, () => [
|
|
660
|
-
|
|
660
|
+
Ce(ee(L(S, O)), 1)
|
|
661
661
|
], !0)
|
|
662
662
|
], 6))), 128))
|
|
663
663
|
]),
|
|
@@ -666,10 +666,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
666
666
|
class: "expand-row"
|
|
667
667
|
}, [
|
|
668
668
|
o("td", {
|
|
669
|
-
colspan:
|
|
669
|
+
colspan: ce.value,
|
|
670
670
|
class: "expand-cell"
|
|
671
671
|
}, [
|
|
672
|
-
|
|
672
|
+
se(l.$slots, "expand", {
|
|
673
673
|
item: S,
|
|
674
674
|
index: H
|
|
675
675
|
}, void 0, !0)
|
|
@@ -679,7 +679,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
679
679
|
])
|
|
680
680
|
], 2)
|
|
681
681
|
], 6),
|
|
682
|
-
e.pagination ? (i(),
|
|
682
|
+
e.pagination ? (i(), Le(M, {
|
|
683
683
|
key: 0,
|
|
684
684
|
class: "align-right",
|
|
685
685
|
"current-page": m.value,
|
|
@@ -688,14 +688,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
688
688
|
"onUpdate:pageSize": c[1] || (c[1] = (S) => p.value = S),
|
|
689
689
|
loading: t.loading,
|
|
690
690
|
"page-size-options": e.pageSizeOptions,
|
|
691
|
-
onPageChange:
|
|
692
|
-
onPageSizeChange:
|
|
691
|
+
onPageChange: G,
|
|
692
|
+
onPageSizeChange: Se
|
|
693
693
|
}, null, 8, ["current-page", "page-size", "loading", "page-size-options"])) : W("", !0)
|
|
694
694
|
])
|
|
695
695
|
], 512);
|
|
696
696
|
};
|
|
697
697
|
}
|
|
698
|
-
}), At = /* @__PURE__ */
|
|
698
|
+
}), At = /* @__PURE__ */ be(Vt, [["__scopeId", "data-v-a2bea873"]]), Ft = ["onKeydown", "aria-expanded"], Pt = ["src"], Yt = ["placeholder", "onKeydown"], Nt = ["onClick", "onMouseenter"], Ot = ["src"], jt = /* @__PURE__ */ we({
|
|
699
699
|
__name: "yselect",
|
|
700
700
|
props: {
|
|
701
701
|
modelValue: {},
|
|
@@ -714,14 +714,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
714
714
|
},
|
|
715
715
|
emits: ["update:modelValue", "change", "focus", "blur", "clear"],
|
|
716
716
|
setup(e, { emit: $ }) {
|
|
717
|
-
const t = e, n = $, m = K(!1), p = K(-1), y = K(), I = K(), C = K(), T = K(), k = K(!1), w = K(), g = K(""), x =
|
|
717
|
+
const t = e, n = $, m = K(!1), p = K(-1), y = K(), I = K(), C = K(), T = K(), k = K(!1), w = K(), g = K(""), x = Y(() => t.options.find((a) => z(a) === t.modelValue) || null), P = Y(() => x.value ? B(x.value) : ""), J = Y(() => {
|
|
718
718
|
if (!t.filterable) return t.options;
|
|
719
719
|
const a = g.value.trim().toLowerCase();
|
|
720
720
|
return a ? t.options.filter((r) => {
|
|
721
721
|
const f = B(r);
|
|
722
722
|
return String(f).toLowerCase().includes(a);
|
|
723
723
|
}) : t.options;
|
|
724
|
-
}), A =
|
|
724
|
+
}), A = Y(() => {
|
|
725
725
|
var L;
|
|
726
726
|
const a = { position: "fixed", zIndex: "4000" }, r = I.value;
|
|
727
727
|
if (!r) return a;
|
|
@@ -729,11 +729,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
729
729
|
return a.left = `${f.left}px`, a.width = `${b}px`, k.value ? (a.bottom = `${window.innerHeight - f.top + 4}px`, a.top = "auto") : a.top = `${f.bottom + 4}px`, a;
|
|
730
730
|
});
|
|
731
731
|
function D() {
|
|
732
|
-
!m.value || !I.value ||
|
|
732
|
+
!m.value || !I.value || oe(() => {
|
|
733
733
|
const a = I.value;
|
|
734
734
|
if (!a) return;
|
|
735
|
-
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200, L = r.bottom + b + 4,
|
|
736
|
-
k.value = !
|
|
735
|
+
const r = a.getBoundingClientRect(), f = window.innerHeight, b = 200, L = r.bottom + b + 4, j = r.top - b - 4, X = L <= f - 20, R = j >= 20;
|
|
736
|
+
k.value = !X && R;
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
function z(a) {
|
|
@@ -745,78 +745,78 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
745
745
|
function F(a, r) {
|
|
746
746
|
return typeof a == "object" && a !== null && a.id !== void 0 ? a.id : z(a) || r;
|
|
747
747
|
}
|
|
748
|
-
function
|
|
748
|
+
function N(a) {
|
|
749
749
|
return z(a) === t.modelValue;
|
|
750
750
|
}
|
|
751
751
|
function q(a) {
|
|
752
752
|
return typeof a == "object" && a !== null ? a[t.disabledKey] === !0 : !1;
|
|
753
753
|
}
|
|
754
|
-
function
|
|
755
|
-
t.disabled || (m.value ?
|
|
754
|
+
function U() {
|
|
755
|
+
t.disabled || (m.value ? ce() : re());
|
|
756
756
|
}
|
|
757
|
-
function
|
|
758
|
-
t.disabled || (m.value = !0,
|
|
757
|
+
function re() {
|
|
758
|
+
t.disabled || (m.value = !0, oe(() => {
|
|
759
759
|
D(), V(), t.filterable && w.value && (w.value.focus(), g.value = "");
|
|
760
760
|
}));
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function ce() {
|
|
763
763
|
m.value = !1, p.value = -1, k.value = !1, t.filterable && (g.value = "");
|
|
764
764
|
}
|
|
765
|
-
function
|
|
765
|
+
function ne(a, r) {
|
|
766
766
|
if (q(a)) return;
|
|
767
767
|
const f = z(a);
|
|
768
|
-
n("update:modelValue", f), n("change", f, a),
|
|
768
|
+
n("update:modelValue", f), n("change", f, a), ce();
|
|
769
769
|
}
|
|
770
|
-
function
|
|
770
|
+
function he() {
|
|
771
771
|
if (!t.clearable || t.disabled) return;
|
|
772
772
|
const a = t.clearTo;
|
|
773
|
-
n("update:modelValue", a), n("change", a, null), n("clear"),
|
|
773
|
+
n("update:modelValue", a), n("change", a, null), n("clear"), ce();
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
if (!
|
|
775
|
+
function ge(a) {
|
|
776
|
+
if (!J.value || J.value.length === 0) {
|
|
777
777
|
p.value = -1;
|
|
778
778
|
return;
|
|
779
779
|
}
|
|
780
780
|
let r = p.value;
|
|
781
|
-
const f =
|
|
781
|
+
const f = J.value.length;
|
|
782
782
|
r === -1 ? r = a > 0 ? 0 : f - 1 : r = (r + a + f) % f;
|
|
783
783
|
let b = 0;
|
|
784
|
-
for (; b < f && q(
|
|
784
|
+
for (; b < f && q(J.value[r]); )
|
|
785
785
|
r = (r + a + f) % f, b++;
|
|
786
|
-
p.value = b >= f ? -1 : r,
|
|
786
|
+
p.value = b >= f ? -1 : r, Z();
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function me() {
|
|
789
789
|
if (p.value < 0) return;
|
|
790
|
-
const a =
|
|
791
|
-
!a || q(a) ||
|
|
790
|
+
const a = J.value[p.value];
|
|
791
|
+
!a || q(a) || ne(a, p.value);
|
|
792
792
|
}
|
|
793
793
|
function V() {
|
|
794
794
|
if (!y.value) return;
|
|
795
795
|
const a = y.value.querySelector(".yselect__option--selected");
|
|
796
796
|
a && a.scrollIntoView({ block: "nearest" });
|
|
797
797
|
}
|
|
798
|
-
function
|
|
798
|
+
function Z() {
|
|
799
799
|
if (!y.value || p.value < 0) return;
|
|
800
800
|
const r = y.value.querySelectorAll(".yselect__option")[p.value];
|
|
801
801
|
r && r.scrollIntoView({ block: "nearest" });
|
|
802
802
|
}
|
|
803
803
|
function d(a) {
|
|
804
804
|
const r = a.target;
|
|
805
|
-
(!C.value || !C.value.contains(r)) &&
|
|
805
|
+
(!C.value || !C.value.contains(r)) && ce();
|
|
806
806
|
}
|
|
807
|
-
|
|
807
|
+
te(() => t.modelValue, () => {
|
|
808
808
|
p.value = -1;
|
|
809
809
|
});
|
|
810
810
|
function h() {
|
|
811
811
|
m.value && D();
|
|
812
812
|
}
|
|
813
|
-
return
|
|
813
|
+
return De(() => {
|
|
814
814
|
document.addEventListener("click", d), window.addEventListener("resize", h), window.addEventListener("scroll", h, !0);
|
|
815
815
|
}), Ee(() => {
|
|
816
816
|
document.removeEventListener("click", d), window.removeEventListener("resize", h), window.removeEventListener("scroll", h, !0);
|
|
817
817
|
}), (a, r) => (i(), u("div", {
|
|
818
818
|
class: E(["yselect", { "yselect--disabled": e.disabled, [`yselect--${e.size}`]: !0 }]),
|
|
819
|
-
style:
|
|
819
|
+
style: ve({ width: e.width }),
|
|
820
820
|
ref_key: "selectContainer",
|
|
821
821
|
ref: C
|
|
822
822
|
}, [
|
|
@@ -828,13 +828,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
828
828
|
"yselect__trigger--disabled": e.disabled,
|
|
829
829
|
"yselect__trigger--error": e.error
|
|
830
830
|
}]),
|
|
831
|
-
onMousedown:
|
|
831
|
+
onMousedown: Q(U, ["prevent", "stop"]),
|
|
832
832
|
onKeydown: [
|
|
833
|
-
ke(
|
|
834
|
-
ke(
|
|
835
|
-
ke(
|
|
836
|
-
ke(
|
|
837
|
-
ke(
|
|
833
|
+
ke(Q(U, ["prevent"]), ["enter"]),
|
|
834
|
+
ke(Q(U, ["prevent"]), ["space"]),
|
|
835
|
+
ke(ce, ["escape"]),
|
|
836
|
+
ke(Q(re, ["prevent"]), ["arrow-down"]),
|
|
837
|
+
ke(Q(re, ["prevent"]), ["arrow-up"])
|
|
838
838
|
],
|
|
839
839
|
tabindex: "0",
|
|
840
840
|
role: "combobox",
|
|
@@ -843,24 +843,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
843
843
|
}, [
|
|
844
844
|
!e.filterable || !m.value ? (i(), u("span", {
|
|
845
845
|
key: 0,
|
|
846
|
-
class: E(["yselect__value", { yselect__placeholder: !
|
|
846
|
+
class: E(["yselect__value", { yselect__placeholder: !P.value }])
|
|
847
847
|
}, [
|
|
848
|
-
|
|
848
|
+
se(a.$slots, "value", {
|
|
849
849
|
value: x.value,
|
|
850
|
-
label:
|
|
850
|
+
label: P.value
|
|
851
851
|
}, () => {
|
|
852
852
|
var f;
|
|
853
853
|
return [
|
|
854
|
-
x.value ? (i(), u(
|
|
854
|
+
x.value ? (i(), u(ae, { key: 0 }, [
|
|
855
855
|
(f = x.value) != null && f.flagImg ? (i(), u("img", {
|
|
856
856
|
key: 0,
|
|
857
857
|
class: "yselect__flag",
|
|
858
858
|
src: x.value.flagImg,
|
|
859
859
|
alt: "flag"
|
|
860
860
|
}, null, 8, Pt)) : W("", !0),
|
|
861
|
-
|
|
862
|
-
], 64)) : (i(), u(
|
|
863
|
-
|
|
861
|
+
Ce(" " + ee(P.value), 1)
|
|
862
|
+
], 64)) : (i(), u(ae, { key: 1 }, [
|
|
863
|
+
Ce(ee(e.placeholder), 1)
|
|
864
864
|
], 64))
|
|
865
865
|
];
|
|
866
866
|
}, !0)
|
|
@@ -870,16 +870,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
870
870
|
ref: w,
|
|
871
871
|
class: "yselect__input",
|
|
872
872
|
type: "text",
|
|
873
|
-
placeholder:
|
|
873
|
+
placeholder: P.value || e.placeholder,
|
|
874
874
|
"onUpdate:modelValue": r[0] || (r[0] = (f) => g.value = f),
|
|
875
875
|
onKeydown: [
|
|
876
|
-
r[1] || (r[1] =
|
|
876
|
+
r[1] || (r[1] = Q(() => {
|
|
877
877
|
}, ["stop"])),
|
|
878
|
-
r[2] || (r[2] = ke(
|
|
879
|
-
r[3] || (r[3] = ke(
|
|
880
|
-
r[4] || (r[4] = ke(
|
|
881
|
-
ke(
|
|
882
|
-
ke(
|
|
878
|
+
r[2] || (r[2] = ke(Q((f) => ge(1), ["prevent"]), ["arrow-down"])),
|
|
879
|
+
r[3] || (r[3] = ke(Q((f) => ge(-1), ["prevent"]), ["arrow-up"])),
|
|
880
|
+
r[4] || (r[4] = ke(Q((f) => me(), ["prevent"]), ["enter"])),
|
|
881
|
+
ke(Q(ce, ["prevent"]), ["esc"]),
|
|
882
|
+
ke(Q(he, ["prevent"]), ["delete"])
|
|
883
883
|
]
|
|
884
884
|
}, null, 40, Yt)), [
|
|
885
885
|
[lt, g.value]
|
|
@@ -888,7 +888,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
888
888
|
key: 2,
|
|
889
889
|
class: "yselect__clear",
|
|
890
890
|
title: "清空",
|
|
891
|
-
onClick:
|
|
891
|
+
onClick: Q(he, ["stop"])
|
|
892
892
|
}, [...r[8] || (r[8] = [
|
|
893
893
|
o("svg", {
|
|
894
894
|
width: "12",
|
|
@@ -923,18 +923,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
923
923
|
], -1)
|
|
924
924
|
])], 2)
|
|
925
925
|
], 42, Ft),
|
|
926
|
-
|
|
927
|
-
default:
|
|
928
|
-
(i(),
|
|
926
|
+
ie($e, { name: "yselect-dropdown" }, {
|
|
927
|
+
default: ue(() => [
|
|
928
|
+
(i(), Le(Fe, { to: "body" }, [
|
|
929
929
|
m.value ? (i(), u("div", {
|
|
930
930
|
key: 0,
|
|
931
931
|
ref_key: "dropdownEl",
|
|
932
932
|
ref: T,
|
|
933
933
|
class: E(["yselect__dropdown yselect__dropdown--portal", { "yselect__dropdown--top": k.value }]),
|
|
934
|
-
style:
|
|
935
|
-
onMousedown: r[6] || (r[6] =
|
|
934
|
+
style: ve(A.value),
|
|
935
|
+
onMousedown: r[6] || (r[6] = Q(() => {
|
|
936
936
|
}, ["stop"])),
|
|
937
|
-
onClick: r[7] || (r[7] =
|
|
937
|
+
onClick: r[7] || (r[7] = Q(() => {
|
|
938
938
|
}, ["stop"]))
|
|
939
939
|
}, [
|
|
940
940
|
o("div", {
|
|
@@ -942,21 +942,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
942
942
|
ref_key: "optionsContainer",
|
|
943
943
|
ref: y
|
|
944
944
|
}, [
|
|
945
|
-
(i(!0), u(
|
|
945
|
+
(i(!0), u(ae, null, de(J.value, (f, b) => (i(), u("div", {
|
|
946
946
|
key: F(f, b),
|
|
947
947
|
class: E(["yselect__option", {
|
|
948
|
-
"yselect__option--selected":
|
|
948
|
+
"yselect__option--selected": N(f),
|
|
949
949
|
"yselect__option--disabled": q(f),
|
|
950
950
|
"yselect__option--hover": p.value === b
|
|
951
951
|
}]),
|
|
952
|
-
onClick: (L) =>
|
|
952
|
+
onClick: (L) => ne(f),
|
|
953
953
|
onMouseenter: (L) => p.value = b,
|
|
954
954
|
onMouseleave: r[5] || (r[5] = (L) => p.value = -1)
|
|
955
955
|
}, [
|
|
956
|
-
|
|
956
|
+
se(a.$slots, "option", {
|
|
957
957
|
option: f,
|
|
958
958
|
index: b,
|
|
959
|
-
selected:
|
|
959
|
+
selected: N(f)
|
|
960
960
|
}, () => [
|
|
961
961
|
f != null && f.flagImg ? (i(), u("img", {
|
|
962
962
|
key: 0,
|
|
@@ -964,7 +964,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
964
964
|
src: f.flagImg,
|
|
965
965
|
alt: "flag"
|
|
966
966
|
}, null, 8, Ot)) : W("", !0),
|
|
967
|
-
|
|
967
|
+
Ce(" " + ee(B(f)), 1)
|
|
968
968
|
], !0)
|
|
969
969
|
], 42, Nt))), 128))
|
|
970
970
|
], 512)
|
|
@@ -975,7 +975,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
975
975
|
})
|
|
976
976
|
], 6));
|
|
977
977
|
}
|
|
978
|
-
}), et = /* @__PURE__ */
|
|
978
|
+
}), et = /* @__PURE__ */ be(jt, [["__scopeId", "data-v-6cd47cb7"]]), qt = { class: "ypagination" }, Ut = { class: "page-actions" }, Zt = { class: "page-size-select" }, Qt = /* @__PURE__ */ we({
|
|
979
979
|
__name: "ypagination",
|
|
980
980
|
props: {
|
|
981
981
|
currentPage: {},
|
|
@@ -990,7 +990,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
990
990
|
},
|
|
991
991
|
emits: ["update:currentPage", "update:pageSize", "page-change", "page-size-change"],
|
|
992
992
|
setup(e, { emit: $ }) {
|
|
993
|
-
const t = e, n = $, m = K(t.pageSize), p =
|
|
993
|
+
const t = e, n = $, m = K(t.pageSize), p = Y(() => t.pageSizeOptions), y = Y({
|
|
994
994
|
get: () => t.currentPage,
|
|
995
995
|
set: (k) => {
|
|
996
996
|
n("update:currentPage", k), n("page-change", k);
|
|
@@ -1005,7 +1005,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1005
1005
|
function T(k) {
|
|
1006
1006
|
t.loading || (k === "prev" ? I(y.value - 1) : k === "next" && I(y.value + 1));
|
|
1007
1007
|
}
|
|
1008
|
-
return m.value = t.pageSize,
|
|
1008
|
+
return m.value = t.pageSize, te(
|
|
1009
1009
|
() => t.pageSize,
|
|
1010
1010
|
(k) => {
|
|
1011
1011
|
typeof k == "number" && m.value !== k && (m.value = k);
|
|
@@ -1014,18 +1014,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1014
1014
|
const g = Ae("YButton"), x = Ae("YSelect");
|
|
1015
1015
|
return i(), u("div", qt, [
|
|
1016
1016
|
o("div", Ut, [
|
|
1017
|
-
|
|
1017
|
+
ie(g, {
|
|
1018
1018
|
size: "small",
|
|
1019
1019
|
variant: "secondary",
|
|
1020
1020
|
disabled: y.value === 1 || e.loading,
|
|
1021
|
-
onClick: w[0] || (w[0] = (
|
|
1021
|
+
onClick: w[0] || (w[0] = (P) => I(1))
|
|
1022
1022
|
}, {
|
|
1023
|
-
default:
|
|
1024
|
-
|
|
1023
|
+
default: ue(() => [...w[2] || (w[2] = [
|
|
1024
|
+
Ce("首页", -1)
|
|
1025
1025
|
])]),
|
|
1026
1026
|
_: 1
|
|
1027
1027
|
}, 8, ["disabled"]),
|
|
1028
|
-
|
|
1028
|
+
ie(g, {
|
|
1029
1029
|
class: "ml-1",
|
|
1030
1030
|
variant: "secondary",
|
|
1031
1031
|
size: "small",
|
|
@@ -1036,9 +1036,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1036
1036
|
onGroupClick: T
|
|
1037
1037
|
}, null, 8, ["groupItems"]),
|
|
1038
1038
|
o("div", Zt, [
|
|
1039
|
-
|
|
1039
|
+
ie(x, {
|
|
1040
1040
|
modelValue: m.value,
|
|
1041
|
-
"onUpdate:modelValue": w[1] || (w[1] = (
|
|
1041
|
+
"onUpdate:modelValue": w[1] || (w[1] = (P) => m.value = P),
|
|
1042
1042
|
options: p.value,
|
|
1043
1043
|
size: "small",
|
|
1044
1044
|
width: "105px",
|
|
@@ -1051,7 +1051,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1051
1051
|
]);
|
|
1052
1052
|
};
|
|
1053
1053
|
}
|
|
1054
|
-
}), Jt = /* @__PURE__ */
|
|
1054
|
+
}), Jt = /* @__PURE__ */ be(Qt, [["__scopeId", "data-v-b8406406"]]), Xt = ["aria-label"], Gt = { class: "y-badge__inner" }, en = {
|
|
1055
1055
|
key: 0,
|
|
1056
1056
|
class: "y-badge__progress",
|
|
1057
1057
|
"aria-hidden": "true"
|
|
@@ -1094,7 +1094,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1094
1094
|
class: "icon",
|
|
1095
1095
|
viewBox: "0 0 20 20",
|
|
1096
1096
|
fill: "currentColor"
|
|
1097
|
-
}, cn = { class: "y-badge__label" }, dn = /* @__PURE__ */
|
|
1097
|
+
}, cn = { class: "y-badge__label" }, dn = /* @__PURE__ */ we({
|
|
1098
1098
|
__name: "ybadge",
|
|
1099
1099
|
props: {
|
|
1100
1100
|
tone: { default: "default" },
|
|
@@ -1106,7 +1106,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1106
1106
|
label: { default: "" }
|
|
1107
1107
|
},
|
|
1108
1108
|
setup(e) {
|
|
1109
|
-
const $ = e, t =
|
|
1109
|
+
const $ = e, t = Y(() => $.tone || "default"), n = Y(() => {
|
|
1110
1110
|
const m = ($.label || "").trim(), p = $.tone, y = $.progress;
|
|
1111
1111
|
if (y) {
|
|
1112
1112
|
const I = {
|
|
@@ -1192,20 +1192,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1192
1192
|
])]))
|
|
1193
1193
|
])) : W("", !0),
|
|
1194
1194
|
o("span", cn, [
|
|
1195
|
-
|
|
1196
|
-
|
|
1195
|
+
se(m.$slots, "default", {}, () => [
|
|
1196
|
+
Ce(ee(e.label), 1)
|
|
1197
1197
|
], !0)
|
|
1198
1198
|
])
|
|
1199
1199
|
])
|
|
1200
1200
|
], 10, Xt));
|
|
1201
1201
|
}
|
|
1202
|
-
}), fn = /* @__PURE__ */
|
|
1202
|
+
}), fn = /* @__PURE__ */ be(dn, [["__scopeId", "data-v-ce819797"]]), vn = ["aria-hidden"], hn = ["onKeydown"], pn = {
|
|
1203
1203
|
key: 0,
|
|
1204
1204
|
class: "y-dialog-header"
|
|
1205
1205
|
}, yn = { class: "y-dialog-title" }, gn = { class: "y-dialog-body" }, mn = {
|
|
1206
1206
|
key: 1,
|
|
1207
1207
|
class: "y-dialog-footer"
|
|
1208
|
-
}, wn = /* @__PURE__ */
|
|
1208
|
+
}, wn = /* @__PURE__ */ we({
|
|
1209
1209
|
__name: "ydialog",
|
|
1210
1210
|
props: {
|
|
1211
1211
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -1220,10 +1220,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1220
1220
|
},
|
|
1221
1221
|
emits: ["update:modelValue", "open", "close"],
|
|
1222
1222
|
setup(e, { emit: $ }) {
|
|
1223
|
-
const t = e, n = $, m =
|
|
1223
|
+
const t = e, n = $, m = Y({
|
|
1224
1224
|
get: () => t.modelValue,
|
|
1225
1225
|
set: (w) => n("update:modelValue", w)
|
|
1226
|
-
}), p = K(null), y =
|
|
1226
|
+
}), p = K(null), y = Y(() => {
|
|
1227
1227
|
const w = {};
|
|
1228
1228
|
return w.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), w.margin = "0 auto", w.top = t.top, w;
|
|
1229
1229
|
});
|
|
@@ -1239,40 +1239,40 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1239
1239
|
function k(w) {
|
|
1240
1240
|
w.key === "Escape" && T();
|
|
1241
1241
|
}
|
|
1242
|
-
return
|
|
1242
|
+
return te(() => t.modelValue, (w) => {
|
|
1243
1243
|
w ? (n("open"), requestAnimationFrame(() => {
|
|
1244
1244
|
var g;
|
|
1245
1245
|
return (g = p.value) == null ? void 0 : g.focus();
|
|
1246
1246
|
}), document.addEventListener("keydown", k), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", k), document.body.style.overflow = "");
|
|
1247
|
-
}),
|
|
1247
|
+
}), De(() => {
|
|
1248
1248
|
t.modelValue && (document.addEventListener("keydown", k), document.body.style.overflow = "hidden");
|
|
1249
1249
|
}), Ee(() => {
|
|
1250
1250
|
document.removeEventListener("keydown", k), document.body.style.overflow = "";
|
|
1251
|
-
}), (w, g) => (i(),
|
|
1251
|
+
}), (w, g) => (i(), Le(Fe, { to: "body" }, [
|
|
1252
1252
|
Be(o("div", {
|
|
1253
1253
|
class: "y-dialog-root",
|
|
1254
1254
|
role: "dialog",
|
|
1255
1255
|
"aria-modal": !0,
|
|
1256
1256
|
"aria-hidden": !m.value,
|
|
1257
|
-
style:
|
|
1257
|
+
style: ve({ zIndex: String(e.zIndex) })
|
|
1258
1258
|
}, [
|
|
1259
1259
|
o("div", {
|
|
1260
1260
|
class: "y-dialog-mask",
|
|
1261
1261
|
onClick: I
|
|
1262
1262
|
}),
|
|
1263
|
-
|
|
1264
|
-
default:
|
|
1263
|
+
ie($e, { name: "dialog-zoom-fade" }, {
|
|
1264
|
+
default: ue(() => [
|
|
1265
1265
|
Be(o("div", {
|
|
1266
1266
|
ref_key: "panelRef",
|
|
1267
1267
|
ref: p,
|
|
1268
1268
|
class: E(["y-dialog-panel", [e.center ? "is-center" : ""]]),
|
|
1269
|
-
style:
|
|
1270
|
-
onKeydown: ke(
|
|
1269
|
+
style: ve(y.value),
|
|
1270
|
+
onKeydown: ke(Q(T, ["prevent", "stop"]), ["esc"]),
|
|
1271
1271
|
tabindex: "-1"
|
|
1272
1272
|
}, [
|
|
1273
1273
|
e.showHeader ? (i(), u("div", pn, [
|
|
1274
|
-
|
|
1275
|
-
o("div", yn,
|
|
1274
|
+
se(w.$slots, "header", {}, () => [
|
|
1275
|
+
o("div", yn, ee(e.title), 1)
|
|
1276
1276
|
], !0),
|
|
1277
1277
|
e.closable ? (i(), u("button", {
|
|
1278
1278
|
key: 0,
|
|
@@ -1283,10 +1283,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1283
1283
|
}, " ✕ ")) : W("", !0)
|
|
1284
1284
|
])) : W("", !0),
|
|
1285
1285
|
o("div", gn, [
|
|
1286
|
-
|
|
1286
|
+
se(w.$slots, "default", {}, void 0, !0)
|
|
1287
1287
|
]),
|
|
1288
1288
|
w.$slots.footer ? (i(), u("div", mn, [
|
|
1289
|
-
|
|
1289
|
+
se(w.$slots, "footer", {}, void 0, !0)
|
|
1290
1290
|
])) : W("", !0)
|
|
1291
1291
|
], 46, hn), [
|
|
1292
1292
|
[Ke, m.value]
|
|
@@ -1299,7 +1299,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1299
1299
|
])
|
|
1300
1300
|
]));
|
|
1301
1301
|
}
|
|
1302
|
-
}), bn = /* @__PURE__ */
|
|
1302
|
+
}), bn = /* @__PURE__ */ be(wn, [["__scopeId", "data-v-a7acc6dc"]]), kn = { class: "ypopover__inner" }, xn = /* @__PURE__ */ we({
|
|
1303
1303
|
__name: "ypopover",
|
|
1304
1304
|
props: {
|
|
1305
1305
|
trigger: { default: "click" },
|
|
@@ -1321,13 +1321,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1321
1321
|
setup(e, { expose: $, emit: t }) {
|
|
1322
1322
|
const n = e, m = t, p = K(), y = K(), I = K(), C = K(!1), T = K(), k = K(), w = K({});
|
|
1323
1323
|
let g = null, x = null;
|
|
1324
|
-
const
|
|
1324
|
+
const P = Y(() => {
|
|
1325
1325
|
if (!C.value || !T.value) return {};
|
|
1326
1326
|
const V = {};
|
|
1327
1327
|
n.width !== "auto" && (V.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.maxWidth && (V.maxWidth = typeof n.maxWidth == "number" ? `${n.maxWidth}px` : n.maxWidth);
|
|
1328
|
-
const { top:
|
|
1329
|
-
return V.top = `${
|
|
1330
|
-
}),
|
|
1328
|
+
const { top: Z, left: d } = A();
|
|
1329
|
+
return V.top = `${Z}px`, V.left = `${d}px`, V;
|
|
1330
|
+
}), J = Y(() => {
|
|
1331
1331
|
if (!n.showArrow) return {};
|
|
1332
1332
|
if (Object.keys(w.value).length > 0)
|
|
1333
1333
|
return w.value;
|
|
@@ -1335,9 +1335,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1335
1335
|
return n.placement.startsWith("top") || n.placement.startsWith("bottom") ? V.left = "50%" : V.top = "50%", V;
|
|
1336
1336
|
});
|
|
1337
1337
|
function A() {
|
|
1338
|
-
var
|
|
1338
|
+
var X, R;
|
|
1339
1339
|
if (!T.value) return { top: 0, left: 0 };
|
|
1340
|
-
const { width: V, height:
|
|
1340
|
+
const { width: V, height: Z, top: d, left: h } = T.value, a = ((X = I.value) == null ? void 0 : X.offsetWidth) || 200, r = ((R = I.value) == null ? void 0 : R.offsetHeight) || 100;
|
|
1341
1341
|
let f = 0, b = 0;
|
|
1342
1342
|
switch (n.placement) {
|
|
1343
1343
|
case "top":
|
|
@@ -1350,57 +1350,57 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1350
1350
|
f = d - r - n.offset, b = h + V - a;
|
|
1351
1351
|
break;
|
|
1352
1352
|
case "bottom":
|
|
1353
|
-
f = d +
|
|
1353
|
+
f = d + Z + n.offset, b = h + (V - a) / 2;
|
|
1354
1354
|
break;
|
|
1355
1355
|
case "bottom-start":
|
|
1356
|
-
f = d +
|
|
1356
|
+
f = d + Z + n.offset, b = h;
|
|
1357
1357
|
break;
|
|
1358
1358
|
case "bottom-end":
|
|
1359
|
-
f = d +
|
|
1359
|
+
f = d + Z + n.offset, b = h + V - a;
|
|
1360
1360
|
break;
|
|
1361
1361
|
case "left":
|
|
1362
|
-
f = d + (
|
|
1362
|
+
f = d + (Z - r) / 2, b = h - a - n.offset;
|
|
1363
1363
|
break;
|
|
1364
1364
|
case "left-start":
|
|
1365
1365
|
f = d, b = h - a - n.offset;
|
|
1366
1366
|
break;
|
|
1367
1367
|
case "left-end":
|
|
1368
|
-
f = d +
|
|
1368
|
+
f = d + Z - r, b = h - a - n.offset;
|
|
1369
1369
|
break;
|
|
1370
1370
|
case "right":
|
|
1371
|
-
f = d + (
|
|
1371
|
+
f = d + (Z - r) / 2, b = h + V + n.offset;
|
|
1372
1372
|
break;
|
|
1373
1373
|
case "right-start":
|
|
1374
1374
|
f = d, b = h + V + n.offset;
|
|
1375
1375
|
break;
|
|
1376
1376
|
case "right-end":
|
|
1377
|
-
f = d +
|
|
1377
|
+
f = d + Z - r, b = h + V + n.offset;
|
|
1378
1378
|
break;
|
|
1379
1379
|
}
|
|
1380
|
-
const L = window.innerWidth,
|
|
1381
|
-
return b < 8 && (b = 8), b + a > L - 8 && (b = L - a - 8), f < 8 && (f = 8), f + r >
|
|
1380
|
+
const L = window.innerWidth, j = window.innerHeight;
|
|
1381
|
+
return b < 8 && (b = 8), b + a > L - 8 && (b = L - a - 8), f < 8 && (f = 8), f + r > j - 8 && (f = j - r - 8), { top: f, left: b };
|
|
1382
1382
|
}
|
|
1383
1383
|
function D() {
|
|
1384
|
-
n.disabled || C.value || (
|
|
1384
|
+
n.disabled || C.value || (N(), n.openDelay > 0 ? g = setTimeout(() => {
|
|
1385
1385
|
z();
|
|
1386
1386
|
}, n.openDelay) : z());
|
|
1387
1387
|
}
|
|
1388
1388
|
function z() {
|
|
1389
|
-
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"),
|
|
1390
|
-
|
|
1391
|
-
|
|
1389
|
+
m("before-show"), C.value = !0, m("update:modelValue", !0), m("show"), oe(() => {
|
|
1390
|
+
oe(() => {
|
|
1391
|
+
U();
|
|
1392
1392
|
});
|
|
1393
1393
|
});
|
|
1394
1394
|
}
|
|
1395
1395
|
function B() {
|
|
1396
|
-
C.value && (
|
|
1396
|
+
C.value && (N(), n.closeDelay > 0 ? x = setTimeout(() => {
|
|
1397
1397
|
F();
|
|
1398
1398
|
}, n.closeDelay) : F());
|
|
1399
1399
|
}
|
|
1400
1400
|
function F() {
|
|
1401
1401
|
m("before-hide"), C.value = !1, m("update:modelValue", !1), m("hide");
|
|
1402
1402
|
}
|
|
1403
|
-
function
|
|
1403
|
+
function N() {
|
|
1404
1404
|
g && (clearTimeout(g), g = null), x && (clearTimeout(x), x = null);
|
|
1405
1405
|
}
|
|
1406
1406
|
function q() {
|
|
@@ -1408,8 +1408,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1408
1408
|
w.value = {};
|
|
1409
1409
|
return;
|
|
1410
1410
|
}
|
|
1411
|
-
const V = T.value,
|
|
1412
|
-
if (
|
|
1411
|
+
const V = T.value, Z = I.value.getBoundingClientRect();
|
|
1412
|
+
if (Z.width === 0 || Z.height === 0) {
|
|
1413
1413
|
const h = {};
|
|
1414
1414
|
n.placement.startsWith("top") || n.placement.startsWith("bottom") ? h.left = "50%" : h.top = "50%", w.value = h;
|
|
1415
1415
|
return;
|
|
@@ -1417,67 +1417,67 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1417
1417
|
const d = {};
|
|
1418
1418
|
if (n.placement.startsWith("top")) {
|
|
1419
1419
|
d.bottom = "-6px";
|
|
1420
|
-
const h = V.left + V.width / 2, a =
|
|
1421
|
-
d.left = `${Math.max(12, Math.min(r,
|
|
1420
|
+
const h = V.left + V.width / 2, a = Z.left, r = h - a;
|
|
1421
|
+
d.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1422
1422
|
} else if (n.placement.startsWith("bottom")) {
|
|
1423
1423
|
d.top = "-6px";
|
|
1424
|
-
const h = V.left + V.width / 2, a =
|
|
1425
|
-
d.left = `${Math.max(12, Math.min(r,
|
|
1424
|
+
const h = V.left + V.width / 2, a = Z.left, r = h - a;
|
|
1425
|
+
d.left = `${Math.max(12, Math.min(r, Z.width - 12))}px`;
|
|
1426
1426
|
} else if (n.placement.startsWith("left")) {
|
|
1427
1427
|
d.right = "-6px";
|
|
1428
|
-
const h = V.top + V.height / 2, a =
|
|
1429
|
-
d.top = `${Math.max(12, Math.min(r,
|
|
1428
|
+
const h = V.top + V.height / 2, a = Z.top, r = h - a;
|
|
1429
|
+
d.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1430
1430
|
} else if (n.placement.startsWith("right")) {
|
|
1431
1431
|
d.left = "-6px";
|
|
1432
|
-
const h = V.top + V.height / 2, a =
|
|
1433
|
-
d.top = `${Math.max(12, Math.min(r,
|
|
1432
|
+
const h = V.top + V.height / 2, a = Z.top, r = h - a;
|
|
1433
|
+
d.top = `${Math.max(12, Math.min(r, Z.height - 12))}px`;
|
|
1434
1434
|
}
|
|
1435
1435
|
w.value = d;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1437
|
+
function U() {
|
|
1438
1438
|
y.value && (T.value = y.value.getBoundingClientRect(), I.value && (k.value = I.value.getBoundingClientRect(), q(), C.value && requestAnimationFrame(() => {
|
|
1439
1439
|
I.value && (k.value = I.value.getBoundingClientRect(), q());
|
|
1440
1440
|
})));
|
|
1441
1441
|
}
|
|
1442
|
-
function
|
|
1442
|
+
function re() {
|
|
1443
1443
|
n.disabled || n.trigger === "click" && (C.value ? B() : D());
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
n.disabled || n.trigger !== "hover" || (
|
|
1445
|
+
function ce() {
|
|
1446
|
+
n.disabled || n.trigger !== "hover" || (N(), D());
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function ne() {
|
|
1449
1449
|
n.disabled || n.trigger !== "hover" || B();
|
|
1450
1450
|
}
|
|
1451
|
-
function
|
|
1452
|
-
n.disabled || n.trigger !== "hover" ||
|
|
1451
|
+
function he() {
|
|
1452
|
+
n.disabled || n.trigger !== "hover" || N();
|
|
1453
1453
|
}
|
|
1454
|
-
function
|
|
1454
|
+
function ge() {
|
|
1455
1455
|
n.disabled || n.trigger !== "hover" || B();
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function me(V) {
|
|
1458
1458
|
if (!n.closeOnClickOutside || !C.value) return;
|
|
1459
|
-
const
|
|
1460
|
-
p.value && !p.value.contains(
|
|
1459
|
+
const Z = V.target;
|
|
1460
|
+
p.value && !p.value.contains(Z) && I.value && !I.value.contains(Z) && B();
|
|
1461
1461
|
}
|
|
1462
|
-
return
|
|
1462
|
+
return te(() => n.modelValue, (V) => {
|
|
1463
1463
|
V !== C.value && (V ? D() : B());
|
|
1464
|
-
}),
|
|
1465
|
-
V ? (document.addEventListener("click",
|
|
1466
|
-
|
|
1467
|
-
|
|
1464
|
+
}), te(C, (V) => {
|
|
1465
|
+
V ? (document.addEventListener("click", me), window.addEventListener("resize", U), window.addEventListener("scroll", U, !0), oe(() => {
|
|
1466
|
+
U(), requestAnimationFrame(() => {
|
|
1467
|
+
U();
|
|
1468
1468
|
}), setTimeout(() => {
|
|
1469
|
-
|
|
1469
|
+
U();
|
|
1470
1470
|
}, 0);
|
|
1471
|
-
})) : (document.removeEventListener("click",
|
|
1472
|
-
}),
|
|
1471
|
+
})) : (document.removeEventListener("click", me), window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0));
|
|
1472
|
+
}), De(() => {
|
|
1473
1473
|
n.modelValue && D();
|
|
1474
1474
|
}), Ee(() => {
|
|
1475
|
-
|
|
1475
|
+
N(), document.removeEventListener("click", me), window.removeEventListener("resize", U), window.removeEventListener("scroll", U, !0);
|
|
1476
1476
|
}), $({
|
|
1477
1477
|
show: D,
|
|
1478
1478
|
hide: B,
|
|
1479
|
-
updatePosition:
|
|
1480
|
-
}), (V,
|
|
1479
|
+
updatePosition: U
|
|
1480
|
+
}), (V, Z) => (i(), u("div", {
|
|
1481
1481
|
class: "ypopover",
|
|
1482
1482
|
ref_key: "popoverRef",
|
|
1483
1483
|
ref: p
|
|
@@ -1485,15 +1485,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1485
1485
|
o("div", {
|
|
1486
1486
|
ref_key: "triggerRef",
|
|
1487
1487
|
ref: y,
|
|
1488
|
-
onClick:
|
|
1489
|
-
onMouseenter:
|
|
1490
|
-
onMouseleave:
|
|
1488
|
+
onClick: re,
|
|
1489
|
+
onMouseenter: ce,
|
|
1490
|
+
onMouseleave: ne
|
|
1491
1491
|
}, [
|
|
1492
|
-
|
|
1492
|
+
se(V.$slots, "reference", {}, void 0, !0)
|
|
1493
1493
|
], 544),
|
|
1494
|
-
(i(),
|
|
1495
|
-
|
|
1496
|
-
default:
|
|
1494
|
+
(i(), Le(Fe, { to: "body" }, [
|
|
1495
|
+
ie($e, { name: "ypopover-fade" }, {
|
|
1496
|
+
default: ue(() => [
|
|
1497
1497
|
C.value ? (i(), u("div", {
|
|
1498
1498
|
key: 0,
|
|
1499
1499
|
ref_key: "contentRef",
|
|
@@ -1505,19 +1505,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1505
1505
|
"ypopover__content--no-padding": !e.showPadding
|
|
1506
1506
|
}
|
|
1507
1507
|
]]),
|
|
1508
|
-
style:
|
|
1509
|
-
onClick:
|
|
1508
|
+
style: ve(P.value),
|
|
1509
|
+
onClick: Z[0] || (Z[0] = Q(() => {
|
|
1510
1510
|
}, ["stop"])),
|
|
1511
|
-
onMouseenter:
|
|
1512
|
-
onMouseleave:
|
|
1511
|
+
onMouseenter: he,
|
|
1512
|
+
onMouseleave: ge
|
|
1513
1513
|
}, [
|
|
1514
1514
|
e.showArrow ? (i(), u("div", {
|
|
1515
1515
|
key: 0,
|
|
1516
1516
|
class: E(["ypopover__arrow", `ypopover__arrow--${e.placement}`]),
|
|
1517
|
-
style:
|
|
1517
|
+
style: ve(J.value)
|
|
1518
1518
|
}, null, 6)) : W("", !0),
|
|
1519
1519
|
o("div", kn, [
|
|
1520
|
-
|
|
1520
|
+
se(V.$slots, "default", {}, void 0, !0)
|
|
1521
1521
|
])
|
|
1522
1522
|
], 38)) : W("", !0)
|
|
1523
1523
|
]),
|
|
@@ -1526,7 +1526,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1526
1526
|
]))
|
|
1527
1527
|
], 512));
|
|
1528
1528
|
}
|
|
1529
|
-
}), $n = /* @__PURE__ */
|
|
1529
|
+
}), $n = /* @__PURE__ */ be(xn, [["__scopeId", "data-v-be755399"]]), Cn = { class: "relative" }, Dn = ["value", "placeholder"], _n = { class: "nh-time-suffix" }, Sn = { class: "nh-time-shortcuts" }, Mn = { class: "nh-time-shortcuts-list" }, Ln = ["onClick", "onKeydown", "onMouseenter"], In = { class: "nh-time-custom" }, Bn = { class: "nh-time-custom-header" }, En = { class: "nh-time-selection-status" }, Tn = {
|
|
1530
1530
|
key: 0,
|
|
1531
1531
|
class: "status-text"
|
|
1532
1532
|
}, zn = {
|
|
@@ -1535,7 +1535,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1535
1535
|
}, Kn = {
|
|
1536
1536
|
key: 2,
|
|
1537
1537
|
class: "status-text status-complete"
|
|
1538
|
-
}, Hn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, Rn = { class: "nh-date-picker" }, Vn = { class: "nh-date-picker-header" }, An = { class: "nh-date-picker-header-label" }, Fn = { class: "nh-date-picker-content" }, Pn = { class: "nh-date-table" }, Yn = ["onClick"], Nn = { class: "nh-date-table-cell" }, On = { key: 0 }, jn = { class: "nh-time-picker" }, qn = { class: "nh-date-picker" }, Un = { class: "nh-date-picker-header" }, Zn = { class: "nh-date-picker-header-label" }, Qn = { class: "nh-date-picker-content" }, Jn = { class: "nh-date-table" }, Xn = ["onClick"], Gn = { class: "nh-date-table-cell" }, el = { key: 0 }, tl = { class: "nh-time-actions" }, nl = /* @__PURE__ */
|
|
1538
|
+
}, Hn = { class: "nh-time-pickers" }, Wn = { class: "nh-time-picker" }, Rn = { class: "nh-date-picker" }, Vn = { class: "nh-date-picker-header" }, An = { class: "nh-date-picker-header-label" }, Fn = { class: "nh-date-picker-content" }, Pn = { class: "nh-date-table" }, Yn = ["onClick"], Nn = { class: "nh-date-table-cell" }, On = { key: 0 }, jn = { class: "nh-time-picker" }, qn = { class: "nh-date-picker" }, Un = { class: "nh-date-picker-header" }, Zn = { class: "nh-date-picker-header-label" }, Qn = { class: "nh-date-picker-content" }, Jn = { class: "nh-date-table" }, Xn = ["onClick"], Gn = { class: "nh-date-table-cell" }, el = { key: 0 }, tl = { class: "nh-time-actions" }, nl = /* @__PURE__ */ we({
|
|
1539
1539
|
__name: "ytime",
|
|
1540
1540
|
props: {
|
|
1541
1541
|
modelValue: { default: () => ({ startDate: null, endDate: null }) },
|
|
@@ -1601,13 +1601,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1601
1601
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1602
1602
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1603
1603
|
}
|
|
1604
|
-
},
|
|
1604
|
+
}, P = () => {
|
|
1605
1605
|
const s = new Date(w.value.year, w.value.month).getTime();
|
|
1606
1606
|
if (new Date(g.value.year, g.value.month).getTime() <= s) {
|
|
1607
1607
|
const l = new Date(g.value.year, g.value.month - 1);
|
|
1608
1608
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
1609
1609
|
}
|
|
1610
|
-
},
|
|
1610
|
+
}, J = ["一", "二", "三", "四", "五", "六", "日"], A = K(null), D = K(null), z = (s) => {
|
|
1611
1611
|
if (!s) return null;
|
|
1612
1612
|
if (s instanceof Date) return s;
|
|
1613
1613
|
if (typeof s == "number")
|
|
@@ -1625,7 +1625,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1625
1625
|
return `${v}-${l}-${c} ${_}:${M}:${S}`;
|
|
1626
1626
|
} else
|
|
1627
1627
|
return `${v}-${l}-${c}`;
|
|
1628
|
-
}, F = (s) => s ? s.getTime() : null,
|
|
1628
|
+
}, F = (s) => s ? s.getTime() : null, N = (s) => s ? {
|
|
1629
1629
|
startDate: z(s.startDate),
|
|
1630
1630
|
endDate: z(s.endDate)
|
|
1631
1631
|
} : { startDate: null, endDate: null }, q = (s) => t.format === "string" ? {
|
|
@@ -1634,8 +1634,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1634
1634
|
} : t.format === "timestamp" ? {
|
|
1635
1635
|
startDate: F(s.startDate),
|
|
1636
1636
|
endDate: F(s.endDate)
|
|
1637
|
-
} : s,
|
|
1638
|
-
const v =
|
|
1637
|
+
} : s, U = (s, v) => `${String(v + 1).padStart(2, "0")}/${s}`, re = (s, v) => s.getFullYear() === v.getFullYear() && s.getMonth() === v.getMonth() && s.getDate() === v.getDate(), ce = (s, v, l) => !v || !l ? !1 : s >= v && s <= l, ne = (s) => {
|
|
1638
|
+
const v = N(s);
|
|
1639
1639
|
if (!(v != null && v.startDate) || !(v != null && v.endDate))
|
|
1640
1640
|
return -1;
|
|
1641
1641
|
for (let l = 0; l < t.shortcuts.length; l++) {
|
|
@@ -1663,41 +1663,41 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1663
1663
|
}
|
|
1664
1664
|
}
|
|
1665
1665
|
return -1;
|
|
1666
|
-
},
|
|
1667
|
-
const l = new Date(s, v, 1), c = new Date(s, v + 1, 0), _ = l.getDay(), M = c.getDate(), S = [], H = /* @__PURE__ */ new Date(),
|
|
1668
|
-
for (let
|
|
1669
|
-
const _e = new Date(s, v - 1,
|
|
1666
|
+
}, he = (s, v) => {
|
|
1667
|
+
const l = new Date(s, v, 1), c = new Date(s, v + 1, 0), _ = l.getDay(), M = c.getDate(), S = [], H = /* @__PURE__ */ new Date(), O = _ === 0 ? 6 : _ - 1, fe = new Date(s, v, 0);
|
|
1668
|
+
for (let le = O - 1; le >= 0; le--) {
|
|
1669
|
+
const _e = new Date(s, v - 1, fe.getDate() - le);
|
|
1670
1670
|
S.push({
|
|
1671
1671
|
date: _e,
|
|
1672
1672
|
day: _e.getDate(),
|
|
1673
1673
|
isCurrentMonth: !1,
|
|
1674
|
-
isToday:
|
|
1674
|
+
isToday: re(_e, H),
|
|
1675
1675
|
isSelected: !1,
|
|
1676
1676
|
isInRange: !1,
|
|
1677
1677
|
isDisabled: !0
|
|
1678
1678
|
// 禁用非当前月的日期
|
|
1679
1679
|
});
|
|
1680
1680
|
}
|
|
1681
|
-
for (let
|
|
1682
|
-
const _e = new Date(s, v,
|
|
1681
|
+
for (let le = 1; le <= M; le++) {
|
|
1682
|
+
const _e = new Date(s, v, le);
|
|
1683
1683
|
S.push({
|
|
1684
1684
|
date: _e,
|
|
1685
|
-
day:
|
|
1685
|
+
day: le,
|
|
1686
1686
|
isCurrentMonth: !0,
|
|
1687
|
-
isToday:
|
|
1687
|
+
isToday: re(_e, H),
|
|
1688
1688
|
isSelected: !1,
|
|
1689
1689
|
isInRange: !1,
|
|
1690
1690
|
isDisabled: !1
|
|
1691
1691
|
});
|
|
1692
1692
|
}
|
|
1693
|
-
const
|
|
1694
|
-
for (let
|
|
1695
|
-
const _e = new Date(s, v + 1,
|
|
1693
|
+
const ye = 42 - S.length;
|
|
1694
|
+
for (let le = 1; le <= ye; le++) {
|
|
1695
|
+
const _e = new Date(s, v + 1, le);
|
|
1696
1696
|
S.push({
|
|
1697
1697
|
date: _e,
|
|
1698
|
-
day:
|
|
1698
|
+
day: le,
|
|
1699
1699
|
isCurrentMonth: !1,
|
|
1700
|
-
isToday:
|
|
1700
|
+
isToday: re(_e, H),
|
|
1701
1701
|
isSelected: !1,
|
|
1702
1702
|
isInRange: !1,
|
|
1703
1703
|
isDisabled: !0
|
|
@@ -1705,43 +1705,43 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1705
1705
|
});
|
|
1706
1706
|
}
|
|
1707
1707
|
const ze = [];
|
|
1708
|
-
for (let
|
|
1709
|
-
ze.push(S.slice(
|
|
1708
|
+
for (let le = 0; le < S.length; le += 7)
|
|
1709
|
+
ze.push(S.slice(le, le + 7));
|
|
1710
1710
|
return ze;
|
|
1711
|
-
},
|
|
1711
|
+
}, ge = (s) => {
|
|
1712
1712
|
const v = q(s);
|
|
1713
1713
|
n("update:modelValue", v), n("change", v);
|
|
1714
|
-
},
|
|
1714
|
+
}, me = () => {
|
|
1715
1715
|
if (!C.value || !T.value) return;
|
|
1716
1716
|
const s = C.value.getBoundingClientRect(), v = T.value.getBoundingClientRect(), l = window.innerWidth, _ = window.innerHeight - s.bottom, M = s.top, S = v.height || 400;
|
|
1717
1717
|
_ < S && M > S ? k.value.top = !1 : k.value.top = !0;
|
|
1718
|
-
const H = l - s.left,
|
|
1719
|
-
H <
|
|
1718
|
+
const H = l - s.left, O = v.width || 640;
|
|
1719
|
+
H < O ? k.value.left = !1 : k.value.left = !0;
|
|
1720
1720
|
}, V = () => {
|
|
1721
1721
|
if (m.value = !m.value, m.value) {
|
|
1722
|
-
const s =
|
|
1723
|
-
if (A.value = (s == null ? void 0 : s.startDate) || null, D.value = (s == null ? void 0 : s.endDate) || null, y.value =
|
|
1722
|
+
const s = N(t.modelValue);
|
|
1723
|
+
if (A.value = (s == null ? void 0 : s.startDate) || null, D.value = (s == null ? void 0 : s.endDate) || null, y.value = ne(t.modelValue), p.value = -1, s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1724
1724
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1725
1725
|
else {
|
|
1726
1726
|
const v = new Date(w.value.year, w.value.month + 1);
|
|
1727
1727
|
g.value.year = v.getFullYear(), g.value.month = v.getMonth();
|
|
1728
1728
|
}
|
|
1729
|
-
x(),
|
|
1730
|
-
|
|
1729
|
+
x(), oe(() => {
|
|
1730
|
+
me();
|
|
1731
1731
|
});
|
|
1732
1732
|
}
|
|
1733
|
-
},
|
|
1733
|
+
}, Z = (s) => {
|
|
1734
1734
|
const v = s.target, l = C.value, c = T.value;
|
|
1735
1735
|
l && c && !l.contains(v) && !c.contains(v) && (m.value = !1, p.value = -1);
|
|
1736
1736
|
}, d = (s) => {
|
|
1737
|
-
s.key === "Enter" || s.key === " " ? (s.preventDefault(), V()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0,
|
|
1738
|
-
|
|
1737
|
+
s.key === "Enter" || s.key === " " ? (s.preventDefault(), V()) : s.key === "ArrowDown" && (s.preventDefault(), m.value = !0, oe(() => {
|
|
1738
|
+
me(), b();
|
|
1739
1739
|
}));
|
|
1740
1740
|
}, h = (s) => {
|
|
1741
1741
|
var v;
|
|
1742
1742
|
s.key === "Escape" && (m.value = !1, p.value = -1, (v = C.value) == null || v.focus());
|
|
1743
1743
|
}, a = (s, v) => {
|
|
1744
|
-
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1), L(p.value)) : s.key === "ArrowUp" ? (s.preventDefault(), p.value = Math.max(v - 1, 0), L(p.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(),
|
|
1744
|
+
s.key === "ArrowDown" ? (s.preventDefault(), p.value = Math.min(v + 1, t.shortcuts.length - 1), L(p.value)) : s.key === "ArrowUp" ? (s.preventDefault(), p.value = Math.max(v - 1, 0), L(p.value)) : (s.key === "Enter" || s.key === " ") && (s.preventDefault(), j(t.shortcuts[v]));
|
|
1745
1745
|
}, r = (s) => {
|
|
1746
1746
|
p.value = s;
|
|
1747
1747
|
}, f = () => {
|
|
@@ -1753,10 +1753,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1753
1753
|
const l = T.value.querySelectorAll(".nh-time-shortcut")[s];
|
|
1754
1754
|
l && l.focus();
|
|
1755
1755
|
}
|
|
1756
|
-
},
|
|
1756
|
+
}, j = (s) => {
|
|
1757
1757
|
const v = s.getValue();
|
|
1758
|
-
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)),
|
|
1759
|
-
},
|
|
1758
|
+
t.includeTime && v.startDate && v.endDate && (v.startDate.setHours(0, 0, 0, 0), v.endDate.setHours(23, 59, 59, 999)), ge(v), y.value = t.shortcuts.findIndex((l) => l.label === s.label), p.value = -1, m.value = !1;
|
|
1759
|
+
}, X = (s, v) => {
|
|
1760
1760
|
if (!s || s.isDisabled) return;
|
|
1761
1761
|
let l;
|
|
1762
1762
|
if (t.includeTime ? (l = new Date(s.date), v === "start" || !A.value ? l.setHours(0, 0, 0, 0) : l.setHours(23, 59, 59, 999)) : l = new Date(s.date.getFullYear(), s.date.getMonth(), s.date.getDate()), !A.value && !D.value)
|
|
@@ -1778,20 +1778,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1778
1778
|
};
|
|
1779
1779
|
} else
|
|
1780
1780
|
I.value = null;
|
|
1781
|
-
},
|
|
1781
|
+
}, R = (s, v) => {
|
|
1782
1782
|
if (!s) return ["nh-date-table-td"];
|
|
1783
1783
|
const l = ["nh-date-table-td"];
|
|
1784
|
-
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), A.value &&
|
|
1785
|
-
},
|
|
1786
|
-
I.value && (t.includeTime && I.value.endDate && I.value.endDate.setHours(23, 59, 59, 999),
|
|
1787
|
-
},
|
|
1788
|
-
|
|
1789
|
-
},
|
|
1790
|
-
m.value &&
|
|
1791
|
-
|
|
1784
|
+
return s.isCurrentMonth || l.push("is-prev-month"), s.isToday && l.push("is-today"), s.isDisabled && l.push("is-disabled"), A.value && re(s.date, A.value) && l.push("is-selected", "is-start"), D.value && re(s.date, D.value) && l.push("is-selected", "is-end"), A.value && D.value && ce(s.date, A.value, D.value) && l.push("is-in-range"), l;
|
|
1785
|
+
}, G = () => {
|
|
1786
|
+
I.value && (t.includeTime && I.value.endDate && I.value.endDate.setHours(23, 59, 59, 999), ge(I.value), y.value = ne(I.value), m.value = !1);
|
|
1787
|
+
}, Se = () => {
|
|
1788
|
+
ge({ startDate: null, endDate: null }), Ve(), p.value = -1, m.value = !1;
|
|
1789
|
+
}, pe = () => {
|
|
1790
|
+
m.value && oe(() => {
|
|
1791
|
+
me();
|
|
1792
1792
|
});
|
|
1793
|
-
},
|
|
1794
|
-
const s =
|
|
1793
|
+
}, xe = Y(() => he(w.value.year, w.value.month)), Ie = Y(() => he(g.value.year, g.value.month)), Pe = Y(() => {
|
|
1794
|
+
const s = N(t.modelValue);
|
|
1795
1795
|
if (!s || !s.startDate || !s.endDate)
|
|
1796
1796
|
return "";
|
|
1797
1797
|
const v = (_) => {
|
|
@@ -1799,20 +1799,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1799
1799
|
return `${M}/${S}/${H}`;
|
|
1800
1800
|
}, l = v(s.startDate), c = v(s.endDate);
|
|
1801
1801
|
return !t.includeTime && l === c ? l : `${l} - ${c}`;
|
|
1802
|
-
}), We =
|
|
1802
|
+
}), We = Y(() => [
|
|
1803
1803
|
"nh-time-dropdown",
|
|
1804
1804
|
{
|
|
1805
1805
|
"nh-time-dropdown-top": !k.value.top,
|
|
1806
1806
|
"nh-time-dropdown-right": !k.value.left
|
|
1807
1807
|
}
|
|
1808
|
-
]), Re =
|
|
1809
|
-
const s =
|
|
1808
|
+
]), Re = Y(() => {
|
|
1809
|
+
const s = N(t.modelValue);
|
|
1810
1810
|
return !!(s != null && s.startDate && (s != null && s.endDate));
|
|
1811
|
-
}), Ye =
|
|
1811
|
+
}), Ye = Y(() => !!(A.value && D.value)), Ve = () => {
|
|
1812
1812
|
A.value = null, D.value = null, I.value = null, y.value = -1;
|
|
1813
1813
|
};
|
|
1814
|
-
|
|
1815
|
-
const v =
|
|
1814
|
+
te(() => t.modelValue, (s) => {
|
|
1815
|
+
const v = N(s);
|
|
1816
1816
|
if (v != null && v.startDate) {
|
|
1817
1817
|
const l = v.startDate;
|
|
1818
1818
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth();
|
|
@@ -1824,16 +1824,16 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1824
1824
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1825
1825
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1826
1826
|
}
|
|
1827
|
-
(v != null && v.startDate || v != null && v.endDate) && x(), m.value || (y.value =
|
|
1828
|
-
}, { immediate: !0, deep: !0 }),
|
|
1827
|
+
(v != null && v.startDate || v != null && v.endDate) && x(), m.value || (y.value = ne(s));
|
|
1828
|
+
}, { immediate: !0, deep: !0 }), te([w, g], () => {
|
|
1829
1829
|
const s = new Date(w.value.year, w.value.month).getTime(), v = new Date(g.value.year, g.value.month).getTime();
|
|
1830
1830
|
if (s === v) {
|
|
1831
1831
|
const l = new Date(w.value.year, w.value.month + 1);
|
|
1832
1832
|
g.value.year = l.getFullYear(), g.value.month = l.getMonth();
|
|
1833
1833
|
}
|
|
1834
|
-
}, { deep: !0 }),
|
|
1835
|
-
document.addEventListener("click",
|
|
1836
|
-
const s =
|
|
1834
|
+
}, { deep: !0 }), De(() => {
|
|
1835
|
+
document.addEventListener("click", Z), window.addEventListener("resize", pe), window.addEventListener("scroll", pe), y.value = ne(t.modelValue);
|
|
1836
|
+
const s = N(t.modelValue);
|
|
1837
1837
|
if (s != null && s.startDate && (w.value.year = s.startDate.getFullYear(), w.value.month = s.startDate.getMonth()), s != null && s.endDate)
|
|
1838
1838
|
g.value.year = s.endDate.getFullYear(), g.value.month = s.endDate.getMonth();
|
|
1839
1839
|
else {
|
|
@@ -1842,17 +1842,17 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1842
1842
|
}
|
|
1843
1843
|
x();
|
|
1844
1844
|
}), Ee(() => {
|
|
1845
|
-
document.removeEventListener("click",
|
|
1845
|
+
document.removeEventListener("click", Z), window.removeEventListener("resize", pe), window.removeEventListener("scroll", pe);
|
|
1846
1846
|
});
|
|
1847
1847
|
const He = () => {
|
|
1848
|
-
t.clearable && (
|
|
1848
|
+
t.clearable && (ge({ startDate: null, endDate: null }), Ve(), p.value = -1);
|
|
1849
1849
|
}, Te = (s, v) => {
|
|
1850
1850
|
if (s === "start") {
|
|
1851
1851
|
const l = new Date(w.value.year, w.value.month + v, 1);
|
|
1852
1852
|
w.value.year = l.getFullYear(), w.value.month = l.getMonth(), x();
|
|
1853
1853
|
} else {
|
|
1854
1854
|
const l = new Date(g.value.year, g.value.month + v, 1);
|
|
1855
|
-
g.value.year = l.getFullYear(), g.value.month = l.getMonth(),
|
|
1855
|
+
g.value.year = l.getFullYear(), g.value.month = l.getMonth(), P();
|
|
1856
1856
|
}
|
|
1857
1857
|
};
|
|
1858
1858
|
return (s, v) => {
|
|
@@ -1878,7 +1878,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1878
1878
|
o("span", _n, [
|
|
1879
1879
|
e.clearable && Re.value ? (i(), u("i", {
|
|
1880
1880
|
key: 0,
|
|
1881
|
-
onClick:
|
|
1881
|
+
onClick: Q(He, ["stop"]),
|
|
1882
1882
|
class: "nh-time-clear"
|
|
1883
1883
|
}, [...v[4] || (v[4] = [
|
|
1884
1884
|
o("svg", {
|
|
@@ -1920,8 +1920,8 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1920
1920
|
])], 2)
|
|
1921
1921
|
])
|
|
1922
1922
|
], 34),
|
|
1923
|
-
|
|
1924
|
-
default:
|
|
1923
|
+
ie($e, { name: "el-zoom-in-top" }, {
|
|
1924
|
+
default: ue(() => [
|
|
1925
1925
|
m.value ? (i(), u("div", {
|
|
1926
1926
|
key: 0,
|
|
1927
1927
|
ref_key: "dropdown",
|
|
@@ -1932,9 +1932,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1932
1932
|
o("div", Sn, [
|
|
1933
1933
|
v[7] || (v[7] = o("div", { class: "nh-time-shortcuts-title" }, "快捷选项", -1)),
|
|
1934
1934
|
o("ul", Mn, [
|
|
1935
|
-
(i(!0), u(
|
|
1935
|
+
(i(!0), u(ae, null, de(e.shortcuts, (c, _) => (i(), u("li", {
|
|
1936
1936
|
key: c.label,
|
|
1937
|
-
onClick: (M) =>
|
|
1937
|
+
onClick: (M) => j(c),
|
|
1938
1938
|
onKeydown: (M) => a(M, _),
|
|
1939
1939
|
onMouseenter: (M) => r(_),
|
|
1940
1940
|
onMouseleave: f,
|
|
@@ -1946,7 +1946,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1946
1946
|
}
|
|
1947
1947
|
]),
|
|
1948
1948
|
tabindex: "0"
|
|
1949
|
-
},
|
|
1949
|
+
}, ee(c.label), 43, Ln))), 128))
|
|
1950
1950
|
])
|
|
1951
1951
|
]),
|
|
1952
1952
|
o("div", In, [
|
|
@@ -1976,7 +1976,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1976
1976
|
})
|
|
1977
1977
|
], -1)
|
|
1978
1978
|
])]),
|
|
1979
|
-
o("span", An,
|
|
1979
|
+
o("span", An, ee(U(w.value.year, w.value.month)), 1),
|
|
1980
1980
|
o("button", {
|
|
1981
1981
|
onClick: v[1] || (v[1] = (c) => Te("start", 1)),
|
|
1982
1982
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -1998,23 +1998,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
1998
1998
|
o("table", Pn, [
|
|
1999
1999
|
o("thead", null, [
|
|
2000
2000
|
o("tr", null, [
|
|
2001
|
-
(i(), u(
|
|
2001
|
+
(i(), u(ae, null, de(J, (c) => o("th", {
|
|
2002
2002
|
key: c,
|
|
2003
2003
|
class: "nh-date-table-th"
|
|
2004
|
-
},
|
|
2004
|
+
}, ee(c), 1)), 64))
|
|
2005
2005
|
])
|
|
2006
2006
|
]),
|
|
2007
2007
|
o("tbody", null, [
|
|
2008
|
-
(i(!0), u(
|
|
2008
|
+
(i(!0), u(ae, null, de(xe.value, (c, _) => (i(), u("tr", {
|
|
2009
2009
|
key: `start-week-${_}`
|
|
2010
2010
|
}, [
|
|
2011
|
-
(i(!0), u(
|
|
2011
|
+
(i(!0), u(ae, null, de(c, (M, S) => (i(), u("td", {
|
|
2012
2012
|
key: `start-day-${_}-${S}`,
|
|
2013
|
-
class: E(
|
|
2014
|
-
onClick: (H) =>
|
|
2013
|
+
class: E(R(M)),
|
|
2014
|
+
onClick: (H) => X(M, "start")
|
|
2015
2015
|
}, [
|
|
2016
2016
|
o("div", Nn, [
|
|
2017
|
-
M ? (i(), u("span", On,
|
|
2017
|
+
M ? (i(), u("span", On, ee(M.day), 1)) : W("", !0)
|
|
2018
2018
|
])
|
|
2019
2019
|
], 10, Yn))), 128))
|
|
2020
2020
|
]))), 128))
|
|
@@ -2042,7 +2042,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2042
2042
|
})
|
|
2043
2043
|
], -1)
|
|
2044
2044
|
])]),
|
|
2045
|
-
o("span", Zn,
|
|
2045
|
+
o("span", Zn, ee(U(g.value.year, g.value.month)), 1),
|
|
2046
2046
|
o("button", {
|
|
2047
2047
|
onClick: v[3] || (v[3] = (c) => Te("end", 1)),
|
|
2048
2048
|
class: "nh-date-picker-btn nh-date-picker-next-btn",
|
|
@@ -2064,23 +2064,23 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2064
2064
|
o("table", Jn, [
|
|
2065
2065
|
o("thead", null, [
|
|
2066
2066
|
o("tr", null, [
|
|
2067
|
-
(i(), u(
|
|
2067
|
+
(i(), u(ae, null, de(J, (c) => o("th", {
|
|
2068
2068
|
key: c,
|
|
2069
2069
|
class: "nh-date-table-th"
|
|
2070
|
-
},
|
|
2070
|
+
}, ee(c), 1)), 64))
|
|
2071
2071
|
])
|
|
2072
2072
|
]),
|
|
2073
2073
|
o("tbody", null, [
|
|
2074
|
-
(i(!0), u(
|
|
2074
|
+
(i(!0), u(ae, null, de(Ie.value, (c, _) => (i(), u("tr", {
|
|
2075
2075
|
key: `end-week-${_}`
|
|
2076
2076
|
}, [
|
|
2077
|
-
(i(!0), u(
|
|
2077
|
+
(i(!0), u(ae, null, de(c, (M, S) => (i(), u("td", {
|
|
2078
2078
|
key: `end-day-${_}-${S}`,
|
|
2079
|
-
class: E(
|
|
2080
|
-
onClick: (H) =>
|
|
2079
|
+
class: E(R(M)),
|
|
2080
|
+
onClick: (H) => X(M, "end")
|
|
2081
2081
|
}, [
|
|
2082
2082
|
o("div", Gn, [
|
|
2083
|
-
M ? (i(), u("span", el,
|
|
2083
|
+
M ? (i(), u("span", el, ee(M.day), 1)) : W("", !0)
|
|
2084
2084
|
])
|
|
2085
2085
|
], 10, Xn))), 128))
|
|
2086
2086
|
]))), 128))
|
|
@@ -2091,25 +2091,25 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2091
2091
|
])
|
|
2092
2092
|
]),
|
|
2093
2093
|
o("div", tl, [
|
|
2094
|
-
e.clearable ? (i(),
|
|
2094
|
+
e.clearable ? (i(), Le(l, {
|
|
2095
2095
|
key: 0,
|
|
2096
|
-
onClick:
|
|
2096
|
+
onClick: Se,
|
|
2097
2097
|
variant: "secondary",
|
|
2098
2098
|
size: e.size
|
|
2099
2099
|
}, {
|
|
2100
|
-
default:
|
|
2101
|
-
|
|
2100
|
+
default: ue(() => [...v[13] || (v[13] = [
|
|
2101
|
+
Ce(" 清空 ", -1)
|
|
2102
2102
|
])]),
|
|
2103
2103
|
_: 1
|
|
2104
2104
|
}, 8, ["size"])) : W("", !0),
|
|
2105
|
-
|
|
2106
|
-
onClick:
|
|
2105
|
+
ie(l, {
|
|
2106
|
+
onClick: G,
|
|
2107
2107
|
disabled: !Ye.value,
|
|
2108
2108
|
variant: "primary",
|
|
2109
2109
|
size: e.size
|
|
2110
2110
|
}, {
|
|
2111
|
-
default:
|
|
2112
|
-
|
|
2111
|
+
default: ue(() => [
|
|
2112
|
+
Ce(ee(A.value && !D.value ? "继续选择结束日期" : "确认"), 1)
|
|
2113
2113
|
]),
|
|
2114
2114
|
_: 1
|
|
2115
2115
|
}, 8, ["disabled", "size"])
|
|
@@ -2123,11 +2123,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2123
2123
|
], 2);
|
|
2124
2124
|
};
|
|
2125
2125
|
}
|
|
2126
|
-
}), tt = /* @__PURE__ */
|
|
2126
|
+
}), tt = /* @__PURE__ */ be(nl, [["__scopeId", "data-v-e5ef63b1"]]), ll = ["aria-checked", "aria-disabled", "disabled", "onKeydown"], ol = { class: "yswitch__thumb" }, al = {
|
|
2127
2127
|
key: 0,
|
|
2128
2128
|
class: "yswitch__spinner",
|
|
2129
2129
|
"aria-hidden": "true"
|
|
2130
|
-
}, sl = /* @__PURE__ */
|
|
2130
|
+
}, sl = /* @__PURE__ */ we({
|
|
2131
2131
|
__name: "yswitch",
|
|
2132
2132
|
props: {
|
|
2133
2133
|
modelValue: { default: !1 },
|
|
@@ -2144,7 +2144,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2144
2144
|
},
|
|
2145
2145
|
emits: ["update:modelValue", "change", "focus", "blur"],
|
|
2146
2146
|
setup(e, { emit: $ }) {
|
|
2147
|
-
const t = e, n = $, m = K(), p =
|
|
2147
|
+
const t = e, n = $, m = K(), p = Y(() => t.modelValue === t.trueValue), y = Y(() => {
|
|
2148
2148
|
const C = {};
|
|
2149
2149
|
return C.background = p.value ? t.activeColor : t.inactiveColor, C;
|
|
2150
2150
|
});
|
|
@@ -2153,7 +2153,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2153
2153
|
const C = p.value ? t.falseValue : t.trueValue;
|
|
2154
2154
|
n("update:modelValue", C), n("change", C);
|
|
2155
2155
|
}
|
|
2156
|
-
return
|
|
2156
|
+
return De(() => {
|
|
2157
2157
|
const C = m.value;
|
|
2158
2158
|
C && (C.addEventListener("focus", (T) => n("focus", T)), C.addEventListener("blur", (T) => n("blur", T)));
|
|
2159
2159
|
}), (C, T) => (i(), u("button", {
|
|
@@ -2163,15 +2163,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2163
2163
|
`yswitch--${e.size}`,
|
|
2164
2164
|
{ "yswitch--checked": p.value, "yswitch--disabled": e.disabled, "yswitch--loading": e.loading }
|
|
2165
2165
|
]]),
|
|
2166
|
-
style:
|
|
2166
|
+
style: ve(y.value),
|
|
2167
2167
|
role: "switch",
|
|
2168
2168
|
"aria-checked": p.value,
|
|
2169
2169
|
"aria-disabled": e.disabled,
|
|
2170
2170
|
disabled: e.disabled || e.loading,
|
|
2171
2171
|
onClick: I,
|
|
2172
2172
|
onKeydown: [
|
|
2173
|
-
ke(
|
|
2174
|
-
ke(
|
|
2173
|
+
ke(Q(I, ["prevent"]), ["enter"]),
|
|
2174
|
+
ke(Q(I, ["prevent"]), ["space"])
|
|
2175
2175
|
]
|
|
2176
2176
|
}, [
|
|
2177
2177
|
T[0] || (T[0] = o("span", { class: "yswitch__track" }, null, -1)),
|
|
@@ -2181,10 +2181,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2181
2181
|
e.showText ? (i(), u("span", {
|
|
2182
2182
|
key: 0,
|
|
2183
2183
|
class: E(["yswitch__label", { "yswitch__label--left": !p.value, "yswitch__label--right": p.value }])
|
|
2184
|
-
},
|
|
2184
|
+
}, ee(p.value ? e.activeText : e.inactiveText), 3)) : W("", !0)
|
|
2185
2185
|
], 46, ll));
|
|
2186
2186
|
}
|
|
2187
|
-
}), il = /* @__PURE__ */
|
|
2187
|
+
}), il = /* @__PURE__ */ be(sl, [["__scopeId", "data-v-0b157fc4"]]), rl = ["src", "alt"], ul = ["src", "alt"], cl = /* @__PURE__ */ we({
|
|
2188
2188
|
__name: "yimage",
|
|
2189
2189
|
props: {
|
|
2190
2190
|
src: {},
|
|
@@ -2200,55 +2200,55 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2200
2200
|
},
|
|
2201
2201
|
emits: ["load", "error", "preview"],
|
|
2202
2202
|
setup(e, { expose: $, emit: t }) {
|
|
2203
|
-
const n = e, m = t, p = K(), y = K(), I = K(), C = K(!1), T = K(!1), k = K(!1), w = K(!1), g = K(!1), x = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="),
|
|
2203
|
+
const n = e, m = t, p = K(), y = K(), I = K(), C = K(!1), T = K(!1), k = K(!1), w = K(!1), g = K(!1), x = K("data:image/svg+xml;charset=utf-8;base64,PHN2ZyB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCIgdmlld0JveD0iMCAwIDIwMCAyMDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPCEtLSDog4zmma8gLS0+CiAgPHJlY3Qgd2lkdGg9IjIwMCIgaGVpZ2h0PSIyMDAiIGZpbGw9IiNGM0Y0RjYiLz4KICAKICA8IS0tIOWbvueJh+WbvuaghyAtLT4KICA8cmVjdCB4PSI1MCIgeT0iNDAiIHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIHJ4PSI0IiBmaWxsPSIjRDFENURCIiBzdHJva2U9IiM5Q0EzQUYiIHN0cm9rZS13aWR0aD0iMiIvPgogIAogIDwhLS0g5Zu+54mH5YaF6YOo6KOF6aWwIC0tPgogIDxjaXJjbGUgY3g9IjgwIiBjeT0iNzAiIHI9IjgiIGZpbGw9IiM5Q0EzQUYiLz4KICA8cGF0aCBkPSJNNjAgMTAwIEw5MCA4NSBMMTIwIDk1IEwxNDAgODAiIHN0cm9rZT0iIzlDQTNBRiIgc3Ryb2tlLXdpZHRoPSIyIiBmaWxsPSJub25lIiBzdHJva2UtbGluZWNhcD0icm91bmQiLz4KICAKICA8IS0tIOaWh+WtlyAtLT4KICA8dGV4dCB4PSIxMDAiIHk9IjE2MCIgdGV4dC1hbmNob3I9Im1pZGRsZSIgZmlsbD0iIzZCNzI4MCIgZm9udC1mYW1pbHk9IkFyaWFsLCBzYW5zLXNlcmlmIiBmb250LXNpemU9IjEyIiBmb250LXdlaWdodD0iNTAwIj4KICAgIEltYWdlIG5vdCBhdmFpbGFibGUKICA8L3RleHQ+Cjwvc3ZnPiA="), P = K(""), J = K(1), A = K(!1), D = K({
|
|
2204
2204
|
overflow: "",
|
|
2205
2205
|
paddingRight: ""
|
|
2206
|
-
}), z =
|
|
2206
|
+
}), z = Y(() => [
|
|
2207
2207
|
n.className,
|
|
2208
2208
|
"overflow-hidden"
|
|
2209
|
-
].filter(Boolean).join(" ")), B =
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
].filter(Boolean).join(" ")), F =
|
|
2209
|
+
].filter(Boolean).join(" ")), B = Y(() => [
|
|
2210
|
+
re(),
|
|
2211
|
+
ne()
|
|
2212
|
+
].filter(Boolean).join(" ")), F = Y(() => [
|
|
2213
2213
|
"w-full h-full bg-white",
|
|
2214
|
-
|
|
2215
|
-
|
|
2214
|
+
ce(),
|
|
2215
|
+
ne(),
|
|
2216
2216
|
n.preview ? "cursor-pointer hover:opacity-90 transition-opacity duration-200" : ""
|
|
2217
|
-
].filter(Boolean).join(" ")),
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
].filter(Boolean).join(" ")), q =
|
|
2217
|
+
].filter(Boolean).join(" ")), N = Y(() => [
|
|
2218
|
+
re(),
|
|
2219
|
+
ne()
|
|
2220
|
+
].filter(Boolean).join(" ")), q = Y(() => {
|
|
2221
2221
|
const R = {};
|
|
2222
2222
|
return n.width && (R.width = typeof n.width == "number" ? `${n.width}px` : n.width), n.height && (R.height = typeof n.height == "number" ? `${n.height}px` : n.height), R;
|
|
2223
|
-
}),
|
|
2223
|
+
}), U = Y(() => P.value ? P.value : Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src), re = () => n.width && n.height ? "" : "w-full h-full", ce = () => ({
|
|
2224
2224
|
cover: "object-cover",
|
|
2225
2225
|
contain: "object-contain",
|
|
2226
2226
|
fill: "object-fill",
|
|
2227
2227
|
none: "object-none",
|
|
2228
2228
|
"scale-down": "object-scale-down"
|
|
2229
|
-
})[n.fit] || "object-cover",
|
|
2229
|
+
})[n.fit] || "object-cover", ne = () => typeof n.radius == "number" ? `rounded-${n.radius}` : typeof n.radius == "string" ? n.radius.includes("px") ? "" : `rounded-${n.radius}` : "", he = () => {
|
|
2230
2230
|
const R = document.createElement("div");
|
|
2231
2231
|
R.style.cssText = "width: 100px; height: 100px; overflow: scroll; position: absolute; top: -9999px;", document.body.appendChild(R);
|
|
2232
|
-
const
|
|
2233
|
-
return document.body.removeChild(R),
|
|
2234
|
-
},
|
|
2232
|
+
const G = R.offsetWidth - R.clientWidth;
|
|
2233
|
+
return document.body.removeChild(R), G;
|
|
2234
|
+
}, ge = () => {
|
|
2235
2235
|
if (D.value = {
|
|
2236
2236
|
overflow: document.body.style.overflow || "",
|
|
2237
2237
|
paddingRight: document.body.style.paddingRight || ""
|
|
2238
2238
|
}, document.body.scrollHeight > window.innerHeight) {
|
|
2239
|
-
const
|
|
2240
|
-
document.body.style.paddingRight = `${
|
|
2239
|
+
const G = he();
|
|
2240
|
+
document.body.style.paddingRight = `${G}px`;
|
|
2241
2241
|
}
|
|
2242
2242
|
document.body.style.overflow = "hidden";
|
|
2243
|
-
},
|
|
2243
|
+
}, me = () => {
|
|
2244
2244
|
document.body.style.overflow = D.value.overflow, document.body.style.paddingRight = D.value.paddingRight;
|
|
2245
2245
|
};
|
|
2246
2246
|
let V = null;
|
|
2247
|
-
const
|
|
2247
|
+
const Z = () => {
|
|
2248
2248
|
!n.lazy || !p.value || (V = new IntersectionObserver(
|
|
2249
2249
|
(R) => {
|
|
2250
|
-
R.forEach((
|
|
2251
|
-
|
|
2250
|
+
R.forEach((G) => {
|
|
2251
|
+
G.isIntersecting && (w.value = !0, x.value = n.src, V == null || V.unobserve(G.target));
|
|
2252
2252
|
});
|
|
2253
2253
|
},
|
|
2254
2254
|
{
|
|
@@ -2260,54 +2260,56 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2260
2260
|
}, h = (R) => {
|
|
2261
2261
|
k.value = !0, T.value = !1, C.value = !1, m("error", R);
|
|
2262
2262
|
}, a = () => {
|
|
2263
|
-
k.value = !1, T.value = !0, C.value = !1,
|
|
2263
|
+
k.value = !1, T.value = !0, C.value = !1, oe(() => {
|
|
2264
2264
|
y.value && (y.value.src = n.src);
|
|
2265
2265
|
});
|
|
2266
2266
|
}, r = () => Array.isArray(n.previewSrcList) ? n.previewSrcList.find(Boolean) || n.src : n.previewSrcList || n.src, f = () => {
|
|
2267
|
-
|
|
2268
|
-
|
|
2267
|
+
n.preview && (n.previewSrcList || n.src) ? b() : a();
|
|
2268
|
+
}, b = () => {
|
|
2269
|
+
if (!n.preview) return;
|
|
2270
|
+
J.value = 1;
|
|
2269
2271
|
const R = r();
|
|
2270
2272
|
if (y.value && y.value.complete && y.value.naturalWidth > 0) {
|
|
2271
|
-
|
|
2272
|
-
g.value = !0,
|
|
2273
|
+
P.value = R, oe(() => {
|
|
2274
|
+
g.value = !0, ge(), m("preview", R);
|
|
2273
2275
|
});
|
|
2274
2276
|
return;
|
|
2275
2277
|
}
|
|
2276
|
-
const
|
|
2277
|
-
let
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2280
|
-
g.value = !0,
|
|
2278
|
+
const G = new Image();
|
|
2279
|
+
let Se = null, pe = !1;
|
|
2280
|
+
const xe = () => {
|
|
2281
|
+
pe || (pe = !0, Se && (clearTimeout(Se), Se = null), P.value = R, oe(() => {
|
|
2282
|
+
g.value = !0, ge(), m("preview", R);
|
|
2281
2283
|
}));
|
|
2282
2284
|
};
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
}, 500),
|
|
2286
|
-
|
|
2287
|
-
},
|
|
2288
|
-
|
|
2289
|
-
},
|
|
2290
|
-
},
|
|
2285
|
+
Se = setTimeout(() => {
|
|
2286
|
+
xe();
|
|
2287
|
+
}, 500), G.onload = () => {
|
|
2288
|
+
xe();
|
|
2289
|
+
}, G.onerror = () => {
|
|
2290
|
+
xe();
|
|
2291
|
+
}, G.src = R, G.complete && xe();
|
|
2292
|
+
}, L = () => {
|
|
2291
2293
|
g.value = !1, setTimeout(() => {
|
|
2292
|
-
|
|
2294
|
+
me();
|
|
2293
2295
|
}, 300);
|
|
2294
|
-
},
|
|
2295
|
-
const
|
|
2296
|
-
let
|
|
2297
|
-
|
|
2296
|
+
}, j = (R) => {
|
|
2297
|
+
const G = R.deltaY < 0 ? 1 : -1;
|
|
2298
|
+
let pe = J.value + G * 0.1;
|
|
2299
|
+
pe = Math.max(0.5, Math.min(2, pe)), J.value = pe;
|
|
2298
2300
|
};
|
|
2299
|
-
return
|
|
2300
|
-
n.lazy ?
|
|
2301
|
+
return De(() => {
|
|
2302
|
+
n.lazy ? Z() : w.value = !0, w.value && (T.value = !0), A.value = !0;
|
|
2301
2303
|
}), Ee(() => {
|
|
2302
|
-
V && V.disconnect(), g.value &&
|
|
2303
|
-
}),
|
|
2304
|
+
V && V.disconnect(), g.value && me();
|
|
2305
|
+
}), te(() => x.value, () => {
|
|
2304
2306
|
n.src && w.value && (T.value = !0, k.value = !1, C.value = !1);
|
|
2305
|
-
}),
|
|
2307
|
+
}), te(() => n.src, (R) => {
|
|
2306
2308
|
x.value = R || "";
|
|
2307
2309
|
}), $({
|
|
2308
2310
|
retryLoad: a,
|
|
2309
|
-
closePreview:
|
|
2310
|
-
}), (R,
|
|
2311
|
+
closePreview: L
|
|
2312
|
+
}), (R, G) => (i(), u("div", {
|
|
2311
2313
|
ref_key: "containerRef",
|
|
2312
2314
|
ref: p,
|
|
2313
2315
|
class: E(["relative inline-block", z.value])
|
|
@@ -2315,7 +2317,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2315
2317
|
!C.value && !k.value && !w.value ? (i(), u("div", {
|
|
2316
2318
|
key: 0,
|
|
2317
2319
|
class: E(["bg-gray-200 animate-pulse rounded", B.value])
|
|
2318
|
-
}, [...
|
|
2320
|
+
}, [...G[1] || (G[1] = [
|
|
2319
2321
|
o("div", { class: "flex items-center justify-center h-full" }, [
|
|
2320
2322
|
o("svg", {
|
|
2321
2323
|
class: "w-6 h-6 text-gray-400",
|
|
@@ -2335,20 +2337,20 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2335
2337
|
T.value && !k.value ? (i(), u("div", {
|
|
2336
2338
|
key: 1,
|
|
2337
2339
|
class: E(["absolute inset-0 flex items-center justify-center bg-gray-100 rounded pointer-events-none", F.value])
|
|
2338
|
-
}, [...
|
|
2340
|
+
}, [...G[2] || (G[2] = [
|
|
2339
2341
|
o("div", { class: "flex flex-col items-center space-y-2" }, [
|
|
2340
2342
|
o("div", { class: "w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin" })
|
|
2341
2343
|
], -1)
|
|
2342
2344
|
])], 2)) : W("", !0),
|
|
2343
2345
|
k.value ? (i(), u("div", {
|
|
2344
2346
|
key: 2,
|
|
2345
|
-
class: E(["bg-gray-100 rounded flex items-center justify-center",
|
|
2346
|
-
onClick:
|
|
2347
|
+
class: E(["bg-gray-100 rounded flex items-center justify-center", N.value]),
|
|
2348
|
+
onClick: f
|
|
2347
2349
|
}, [
|
|
2348
2350
|
o("img", {
|
|
2349
2351
|
src: "https://img.nihaojewelry.com/media/2025/6/27/1938511770352222208.png",
|
|
2350
2352
|
alt: "Error Image",
|
|
2351
|
-
class: E(["w-[70%] h-[70%] object-contain cursor-pointer",
|
|
2353
|
+
class: E(["w-[70%] h-[70%] object-contain cursor-pointer", ne()])
|
|
2352
2354
|
}, null, 2)
|
|
2353
2355
|
], 2)) : W("", !0),
|
|
2354
2356
|
Be(o("img", {
|
|
@@ -2359,28 +2361,28 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2359
2361
|
class: E(F.value),
|
|
2360
2362
|
onLoad: d,
|
|
2361
2363
|
onError: h,
|
|
2362
|
-
onClick:
|
|
2363
|
-
style:
|
|
2364
|
+
onClick: Q(b, ["stop"]),
|
|
2365
|
+
style: ve(q.value)
|
|
2364
2366
|
}, null, 46, rl), [
|
|
2365
2367
|
[Ke, C.value && !k.value]
|
|
2366
2368
|
]),
|
|
2367
|
-
n.preview &&
|
|
2369
|
+
n.preview && (!C.value || T.value || k.value || !w.value) ? (i(), u("div", {
|
|
2368
2370
|
key: 3,
|
|
2369
2371
|
class: "absolute inset-0 cursor-pointer z-10",
|
|
2370
|
-
onClick:
|
|
2372
|
+
onClick: Q(b, ["stop"])
|
|
2371
2373
|
})) : W("", !0),
|
|
2372
|
-
A.value ? (i(),
|
|
2374
|
+
A.value ? (i(), Le(Fe, {
|
|
2373
2375
|
key: 4,
|
|
2374
2376
|
to: "body"
|
|
2375
2377
|
}, [
|
|
2376
|
-
|
|
2377
|
-
default:
|
|
2378
|
+
ie($e, { name: "fade" }, {
|
|
2379
|
+
default: ue(() => [
|
|
2378
2380
|
g.value ? (i(), u("div", {
|
|
2379
2381
|
key: 0,
|
|
2380
2382
|
class: "fixed inset-0 bg-black/75 flex items-center justify-center",
|
|
2381
2383
|
style: { "z-index": "99999" },
|
|
2382
|
-
onClick:
|
|
2383
|
-
onWheel:
|
|
2384
|
+
onClick: Q(L, ["self"]),
|
|
2385
|
+
onWheel: Q(j, ["prevent"])
|
|
2384
2386
|
}, [
|
|
2385
2387
|
o("div", {
|
|
2386
2388
|
class: E(["relative max-w-4xl max-h-full p-4 transform transition-transform duration-300", { "scale-100": g.value, "scale-95": !g.value }])
|
|
@@ -2388,11 +2390,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2388
2390
|
o("img", {
|
|
2389
2391
|
ref_key: "previewImageRef",
|
|
2390
2392
|
ref: I,
|
|
2391
|
-
src:
|
|
2393
|
+
src: U.value,
|
|
2392
2394
|
alt: e.alt,
|
|
2393
2395
|
class: "max-w-full max-h-full object-contain rounded shadow-2xl transition-transform duration-200",
|
|
2394
|
-
style:
|
|
2395
|
-
onClick:
|
|
2396
|
+
style: ve({ transform: `scale(${J.value})` }),
|
|
2397
|
+
onClick: G[0] || (G[0] = Q(() => {
|
|
2396
2398
|
}, ["stop"]))
|
|
2397
2399
|
}, null, 12, ul)
|
|
2398
2400
|
], 2)
|
|
@@ -2403,7 +2405,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2403
2405
|
])) : W("", !0)
|
|
2404
2406
|
], 2));
|
|
2405
2407
|
}
|
|
2406
|
-
}), dl = /* @__PURE__ */
|
|
2408
|
+
}), dl = /* @__PURE__ */ be(cl, [["__scopeId", "data-v-f6462429"]]), fl = /* @__PURE__ */ we({
|
|
2407
2409
|
__name: "ydropdown",
|
|
2408
2410
|
props: {
|
|
2409
2411
|
trigger: { default: "hover" },
|
|
@@ -2414,7 +2416,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2414
2416
|
setup(e) {
|
|
2415
2417
|
const $ = e, t = K(!1), n = K();
|
|
2416
2418
|
let m = null;
|
|
2417
|
-
const p =
|
|
2419
|
+
const p = Y(() => `y-dropdown__menu--${$.placement}`), y = Y(() => {
|
|
2418
2420
|
if (!$.menuWidth) return {};
|
|
2419
2421
|
const g = typeof $.menuWidth == "number" ? `${$.menuWidth}px` : $.menuWidth;
|
|
2420
2422
|
return {
|
|
@@ -2423,7 +2425,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2423
2425
|
maxWidth: g
|
|
2424
2426
|
};
|
|
2425
2427
|
}), I = () => {
|
|
2426
|
-
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value),
|
|
2428
|
+
console.log("显示下拉菜单", t.value), !$.disabled && (m && (clearTimeout(m), m = null), t.value = !0, console.log("设置 visible 为 true", t.value), oe(() => {
|
|
2427
2429
|
T();
|
|
2428
2430
|
}));
|
|
2429
2431
|
}, C = () => {
|
|
@@ -2434,46 +2436,46 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2434
2436
|
if (!n.value) return;
|
|
2435
2437
|
const g = n.value.querySelector(".y-dropdown__trigger"), x = n.value.querySelector(".y-dropdown__menu");
|
|
2436
2438
|
if (!g || !x) return;
|
|
2437
|
-
const
|
|
2439
|
+
const P = g.getBoundingClientRect(), J = x.getBoundingClientRect(), A = window.innerWidth, D = window.innerHeight;
|
|
2438
2440
|
x.style.top = "", x.style.left = "", x.style.right = "", x.style.bottom = "", x.style.transform = "";
|
|
2439
2441
|
let z = 0, B = 0;
|
|
2440
2442
|
switch ($.placement) {
|
|
2441
2443
|
case "bottom":
|
|
2442
|
-
z =
|
|
2444
|
+
z = P.height + 4, B = 0;
|
|
2443
2445
|
break;
|
|
2444
2446
|
case "top":
|
|
2445
|
-
z = -(
|
|
2447
|
+
z = -(J.height + 4), B = 0;
|
|
2446
2448
|
break;
|
|
2447
2449
|
case "right":
|
|
2448
|
-
z = 0, B =
|
|
2450
|
+
z = 0, B = P.width + 4;
|
|
2449
2451
|
break;
|
|
2450
2452
|
case "left":
|
|
2451
|
-
z = 0, B = -(
|
|
2453
|
+
z = 0, B = -(J.width + 4);
|
|
2452
2454
|
break;
|
|
2453
2455
|
}
|
|
2454
|
-
let F =
|
|
2456
|
+
let F = P.top + z, N = P.left + B;
|
|
2455
2457
|
if ($.placement === "bottom" || $.placement === "top") {
|
|
2456
|
-
const q =
|
|
2457
|
-
|
|
2458
|
+
const q = J.width || 260;
|
|
2459
|
+
N + q > A - 10 && (N = A - q - 10), N < 10 && (N = 10);
|
|
2458
2460
|
}
|
|
2459
2461
|
if ($.placement === "left" || $.placement === "right") {
|
|
2460
|
-
const q =
|
|
2462
|
+
const q = J.height || 200;
|
|
2461
2463
|
F + q > D - 10 && (F = D - q - 10), F < 10 && (F = 10);
|
|
2462
2464
|
}
|
|
2463
|
-
x.style.top = `${F}px`, x.style.left = `${
|
|
2465
|
+
x.style.top = `${F}px`, x.style.left = `${N}px`;
|
|
2464
2466
|
}, k = (g) => {
|
|
2465
2467
|
$.trigger === "click" && n.value && !n.value.contains(g.target) && (t.value = !1);
|
|
2466
2468
|
}, w = () => {
|
|
2467
2469
|
t.value && T();
|
|
2468
2470
|
};
|
|
2469
|
-
return
|
|
2471
|
+
return De(() => {
|
|
2470
2472
|
$.trigger === "click" && document.addEventListener("click", k), window.addEventListener("resize", w), window.addEventListener("scroll", w);
|
|
2471
2473
|
}), Ee(() => {
|
|
2472
2474
|
$.trigger === "click" && document.removeEventListener("click", k), m && clearTimeout(m), window.removeEventListener("resize", w), window.removeEventListener("scroll", w);
|
|
2473
|
-
}),
|
|
2475
|
+
}), te(
|
|
2474
2476
|
() => $.menuWidth,
|
|
2475
2477
|
() => {
|
|
2476
|
-
t.value &&
|
|
2478
|
+
t.value && oe(() => {
|
|
2477
2479
|
T();
|
|
2478
2480
|
});
|
|
2479
2481
|
}
|
|
@@ -2487,22 +2489,22 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2487
2489
|
onMouseenter: I,
|
|
2488
2490
|
onMouseleave: C
|
|
2489
2491
|
}, [
|
|
2490
|
-
|
|
2492
|
+
se(g.$slots, "trigger", {}, () => [
|
|
2491
2493
|
x[0] || (x[0] = o("button", { class: "y-dropdown__button" }, " 下拉菜单 ", -1))
|
|
2492
2494
|
], !0)
|
|
2493
2495
|
], 32),
|
|
2494
|
-
|
|
2496
|
+
ie($e, {
|
|
2495
2497
|
name: "dropdown-fade",
|
|
2496
2498
|
appear: ""
|
|
2497
2499
|
}, {
|
|
2498
|
-
default:
|
|
2500
|
+
default: ue(() => [
|
|
2499
2501
|
Be(o("div", {
|
|
2500
2502
|
class: E(["y-dropdown__menu", p.value]),
|
|
2501
|
-
style:
|
|
2503
|
+
style: ve(y.value),
|
|
2502
2504
|
onMouseenter: I,
|
|
2503
2505
|
onMouseleave: C
|
|
2504
2506
|
}, [
|
|
2505
|
-
|
|
2507
|
+
se(g.$slots, "default", {}, () => [
|
|
2506
2508
|
x[1] || (x[1] = o("div", { class: "y-dropdown__item" }, "选项 1", -1)),
|
|
2507
2509
|
x[2] || (x[2] = o("div", { class: "y-dropdown__item" }, "选项 2", -1)),
|
|
2508
2510
|
x[3] || (x[3] = o("div", { class: "y-dropdown__item" }, "选项 3", -1))
|
|
@@ -2515,13 +2517,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2515
2517
|
})
|
|
2516
2518
|
], 512));
|
|
2517
2519
|
}
|
|
2518
|
-
}), vl = /* @__PURE__ */
|
|
2520
|
+
}), vl = /* @__PURE__ */ be(fl, [["__scopeId", "data-v-ada3172a"]]), hl = ["aria-hidden"], pl = ["onKeydown"], yl = {
|
|
2519
2521
|
key: 0,
|
|
2520
2522
|
class: "y-drawer-header"
|
|
2521
2523
|
}, gl = { class: "y-drawer-title" }, ml = { class: "y-drawer-body" }, wl = {
|
|
2522
2524
|
key: 1,
|
|
2523
2525
|
class: "y-drawer-footer"
|
|
2524
|
-
}, bl = /* @__PURE__ */
|
|
2526
|
+
}, bl = /* @__PURE__ */ we({
|
|
2525
2527
|
__name: "ydrawer",
|
|
2526
2528
|
props: {
|
|
2527
2529
|
modelValue: { type: Boolean, default: !1 },
|
|
@@ -2536,10 +2538,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2536
2538
|
},
|
|
2537
2539
|
emits: ["update:modelValue", "open", "close"],
|
|
2538
2540
|
setup(e, { emit: $ }) {
|
|
2539
|
-
const t = e, n = $, m =
|
|
2541
|
+
const t = e, n = $, m = Y({
|
|
2540
2542
|
get: () => t.modelValue,
|
|
2541
2543
|
set: (x) => n("update:modelValue", x)
|
|
2542
|
-
}), p = K(null), y =
|
|
2544
|
+
}), p = K(null), y = Y(() => t.placement === "right" ? "drawer-slide-right" : "drawer-slide-bottom"), I = Y(() => t.placement === "right" ? "rounded-left" : "rounded-top"), C = Y(() => {
|
|
2543
2545
|
const x = {};
|
|
2544
2546
|
return t.placement === "right" ? (x.width = typeof t.width == "number" ? `${t.width}px` : String(t.width), x.height = "100%", x.right = "0", x.top = "0") : (x.height = typeof t.height == "number" ? `${t.height}px` : String(t.height), x.width = "100%", x.bottom = "0", x.left = "0"), x;
|
|
2545
2547
|
});
|
|
@@ -2555,29 +2557,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2555
2557
|
function g(x) {
|
|
2556
2558
|
x.key === "Escape" && w();
|
|
2557
2559
|
}
|
|
2558
|
-
return
|
|
2560
|
+
return te(() => t.modelValue, (x) => {
|
|
2559
2561
|
x ? (n("open"), requestAnimationFrame(() => {
|
|
2560
|
-
var
|
|
2561
|
-
return (
|
|
2562
|
+
var P;
|
|
2563
|
+
return (P = p.value) == null ? void 0 : P.focus();
|
|
2562
2564
|
}), document.addEventListener("keydown", g), document.body.style.overflow = "hidden") : (document.removeEventListener("keydown", g), document.body.style.overflow = "");
|
|
2563
|
-
}),
|
|
2565
|
+
}), De(() => {
|
|
2564
2566
|
t.modelValue && (document.addEventListener("keydown", g), document.body.style.overflow = "hidden");
|
|
2565
2567
|
}), Ee(() => {
|
|
2566
2568
|
document.removeEventListener("keydown", g), document.body.style.overflow = "";
|
|
2567
|
-
}), (x,
|
|
2569
|
+
}), (x, P) => (i(), Le(Fe, { to: "body" }, [
|
|
2568
2570
|
Be(o("div", {
|
|
2569
2571
|
class: "y-drawer-root",
|
|
2570
2572
|
role: "dialog",
|
|
2571
2573
|
"aria-modal": !0,
|
|
2572
2574
|
"aria-hidden": !m.value,
|
|
2573
|
-
style:
|
|
2575
|
+
style: ve({ zIndex: String(e.zIndex) })
|
|
2574
2576
|
}, [
|
|
2575
2577
|
o("div", {
|
|
2576
2578
|
class: "y-drawer-mask",
|
|
2577
2579
|
onClick: T
|
|
2578
2580
|
}),
|
|
2579
|
-
|
|
2580
|
-
default:
|
|
2581
|
+
ie($e, { name: y.value }, {
|
|
2582
|
+
default: ue(() => [
|
|
2581
2583
|
Be(o("div", {
|
|
2582
2584
|
ref_key: "panelRef",
|
|
2583
2585
|
ref: p,
|
|
@@ -2585,12 +2587,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2585
2587
|
`is-${e.placement}`,
|
|
2586
2588
|
I.value
|
|
2587
2589
|
]]),
|
|
2588
|
-
style:
|
|
2589
|
-
onKeydown: ke(
|
|
2590
|
+
style: ve(C.value),
|
|
2591
|
+
onKeydown: ke(Q(w, ["prevent", "stop"]), ["esc"]),
|
|
2590
2592
|
tabindex: "-1"
|
|
2591
2593
|
}, [
|
|
2592
2594
|
e.showHeader ? (i(), u("div", yl, [
|
|
2593
|
-
o("div", gl,
|
|
2595
|
+
o("div", gl, ee(e.title), 1),
|
|
2594
2596
|
e.closable ? (i(), u("button", {
|
|
2595
2597
|
key: 0,
|
|
2596
2598
|
type: "button",
|
|
@@ -2600,10 +2602,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2600
2602
|
}, " ✕ ")) : W("", !0)
|
|
2601
2603
|
])) : W("", !0),
|
|
2602
2604
|
o("div", ml, [
|
|
2603
|
-
|
|
2605
|
+
se(x.$slots, "default", {}, void 0, !0)
|
|
2604
2606
|
]),
|
|
2605
2607
|
x.$slots.footer ? (i(), u("div", wl, [
|
|
2606
|
-
|
|
2608
|
+
se(x.$slots, "footer", {}, void 0, !0)
|
|
2607
2609
|
])) : W("", !0)
|
|
2608
2610
|
], 46, pl), [
|
|
2609
2611
|
[Ke, m.value]
|
|
@@ -2616,7 +2618,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2616
2618
|
])
|
|
2617
2619
|
]));
|
|
2618
2620
|
}
|
|
2619
|
-
}), kl = /* @__PURE__ */
|
|
2621
|
+
}), kl = /* @__PURE__ */ be(bl, [["__scopeId", "data-v-b2797950"]]), xl = { class: "ytree__container" }, $l = ["data-level", "onClick", "onContextmenu"], Cl = ["onClick"], Dl = {
|
|
2620
2622
|
key: 1,
|
|
2621
2623
|
class: "w-[16px]"
|
|
2622
2624
|
}, _l = ["onClick"], Sl = {
|
|
@@ -2703,7 +2705,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2703
2705
|
height: "12",
|
|
2704
2706
|
viewBox: "0 0 12 12",
|
|
2705
2707
|
fill: "none"
|
|
2706
|
-
}, fo = ["src", "alt"], vo = { class: "ytree-node__custom-content" }, ho = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", po = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", yo = /* @__PURE__ */
|
|
2708
|
+
}, fo = ["src", "alt"], vo = { class: "ytree-node__custom-content" }, ho = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979094146203385856/32.png", po = "https://image.nhdropshipping.com/fit-in/500x500/filters:format(webp)/media/2025/10/17/1979095296159907840/32.png", yo = /* @__PURE__ */ we({
|
|
2707
2709
|
__name: "ytree",
|
|
2708
2710
|
props: {
|
|
2709
2711
|
data: { default: () => [] },
|
|
@@ -2752,7 +2754,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2752
2754
|
},
|
|
2753
2755
|
emits: ["node-click", "node-contextmenu", "check-change", "check", "current-change", "node-expand", "node-collapse", "node-drag-start", "node-drag-enter", "node-drag-leave", "node-drag-over", "node-drag-end", "node-drop", "checked-keys-change", "child-node-click"],
|
|
2754
2756
|
setup(e, { expose: $, emit: t }) {
|
|
2755
|
-
const n = e, m = t, p =
|
|
2757
|
+
const n = e, m = t, p = Y(() => (console.log("ytree 组件接收到的数据:", n.data), n.data || [])), y = K({
|
|
2756
2758
|
currentNode: null,
|
|
2757
2759
|
currentKey: null,
|
|
2758
2760
|
checkedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -2761,7 +2763,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2761
2763
|
highlightedKeys: /* @__PURE__ */ new Set()
|
|
2762
2764
|
});
|
|
2763
2765
|
ot("treeStore", y);
|
|
2764
|
-
const I =
|
|
2766
|
+
const I = Y(() => n.restrictAutoExpandFromLevel && n.restrictAutoExpandFromLevel > 0 ? n.restrictAutoExpandFromLevel : void 0);
|
|
2765
2767
|
function C(d) {
|
|
2766
2768
|
return d[n.nodeKey] || d.id || Math.random();
|
|
2767
2769
|
}
|
|
@@ -2776,7 +2778,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2776
2778
|
function w(d, h) {
|
|
2777
2779
|
var L;
|
|
2778
2780
|
const a = n.deptIconUrl || ho, r = n.personIconUrl || po, f = n.buttonIconUrl || "", b = n.childStyleIconUrl || "";
|
|
2779
|
-
return h && b &&
|
|
2781
|
+
return h && b && J(d, h) ? b : (L = d == null ? void 0 : d.data) != null && L.isButton && f ? f : k(d) ? r : a;
|
|
2780
2782
|
}
|
|
2781
2783
|
function g(d) {
|
|
2782
2784
|
var a;
|
|
@@ -2787,19 +2789,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2787
2789
|
var h;
|
|
2788
2790
|
return ((h = n.props) != null && h.children ? d[n.props.children] : void 0) || d.children || [];
|
|
2789
2791
|
}
|
|
2790
|
-
function
|
|
2792
|
+
function P(d, h, a = 1) {
|
|
2791
2793
|
if (d === h)
|
|
2792
2794
|
return a;
|
|
2793
2795
|
const r = x(d);
|
|
2794
2796
|
for (const f of r) {
|
|
2795
|
-
const b =
|
|
2797
|
+
const b = P(f, h, a + 1);
|
|
2796
2798
|
if (b > 0)
|
|
2797
2799
|
return b;
|
|
2798
2800
|
}
|
|
2799
2801
|
return 0;
|
|
2800
2802
|
}
|
|
2801
|
-
function
|
|
2802
|
-
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 :
|
|
2803
|
+
function J(d, h) {
|
|
2804
|
+
return !n.childStyleLevel || n.childStyleLevel < 1 ? !1 : P(h, d) === n.childStyleLevel;
|
|
2803
2805
|
}
|
|
2804
2806
|
function A(d) {
|
|
2805
2807
|
const h = C(d);
|
|
@@ -2839,28 +2841,28 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2839
2841
|
const h = C(d);
|
|
2840
2842
|
return y.value.highlightedKeys.has(h);
|
|
2841
2843
|
}
|
|
2842
|
-
function
|
|
2844
|
+
function N(d) {
|
|
2843
2845
|
if (n.disabled) return;
|
|
2844
2846
|
const h = C(d), r = !y.value.checkedKeys.has(h), f = new Set(y.value.expandedKeys);
|
|
2845
2847
|
r ? y.value.checkedKeys.add(h) : y.value.checkedKeys.delete(h);
|
|
2846
|
-
function b(L,
|
|
2847
|
-
L.forEach((
|
|
2848
|
-
const
|
|
2849
|
-
|
|
2848
|
+
function b(L, j) {
|
|
2849
|
+
L.forEach((X) => {
|
|
2850
|
+
const R = C(X);
|
|
2851
|
+
j ? y.value.checkedKeys.add(R) : y.value.checkedKeys.delete(R), g(X) && b(x(X), j);
|
|
2850
2852
|
});
|
|
2851
2853
|
}
|
|
2852
|
-
b(x(d), r), r && q(),
|
|
2854
|
+
b(x(d), r), r && q(), re(), y.value.expandedKeys = f, m("check-change", d, r, !1), m("check", d, r, !1), m("checked-keys-change", Array.from(y.value.checkedKeys));
|
|
2853
2855
|
}
|
|
2854
2856
|
function q(d) {
|
|
2855
2857
|
I.value && console.log(
|
|
2856
2858
|
`已启用从第${I.value}级开始不默认展开的限制(不主动收起已展开节点)`
|
|
2857
2859
|
);
|
|
2858
2860
|
}
|
|
2859
|
-
function
|
|
2861
|
+
function U(d) {
|
|
2860
2862
|
const h = C(d);
|
|
2861
2863
|
y.value.expandedKeys.has(h) ? (y.value.expandedKeys.delete(h), m("node-collapse", d, d, null)) : (y.value.expandedKeys.add(h), m("node-expand", d, d, null));
|
|
2862
2864
|
}
|
|
2863
|
-
function
|
|
2865
|
+
function re() {
|
|
2864
2866
|
const d = [];
|
|
2865
2867
|
function h(r) {
|
|
2866
2868
|
r.forEach((f) => {
|
|
@@ -2870,54 +2872,54 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2870
2872
|
h(p.value);
|
|
2871
2873
|
function a(r) {
|
|
2872
2874
|
if (g(r)) {
|
|
2873
|
-
const f = x(r), b = C(r), L = f.filter((
|
|
2874
|
-
(
|
|
2875
|
+
const f = x(r), b = C(r), L = f.filter((X) => D(X)), j = f.filter(
|
|
2876
|
+
(X) => z(X)
|
|
2875
2877
|
);
|
|
2876
|
-
L.length === f.length &&
|
|
2878
|
+
L.length === f.length && j.length === 0 || L.length > 0 || j.length > 0 ? y.value.checkedKeys.add(b) : y.value.checkedKeys.delete(b);
|
|
2877
2879
|
}
|
|
2878
2880
|
}
|
|
2879
2881
|
for (let r = d.length - 1; r >= 0; r--)
|
|
2880
2882
|
a(d[r]);
|
|
2881
2883
|
}
|
|
2882
|
-
function
|
|
2884
|
+
function ce(d, h, a, r) {
|
|
2883
2885
|
if (n.disabled) return;
|
|
2884
|
-
const f = r ?
|
|
2886
|
+
const f = r ? J(d, r) : !1;
|
|
2885
2887
|
if (n.enableChildStyleCustomClick && f) {
|
|
2886
2888
|
m("child-node-click", d, h, a);
|
|
2887
2889
|
return;
|
|
2888
2890
|
}
|
|
2889
2891
|
if (n.expandOnClickNode && g(d)) {
|
|
2890
|
-
|
|
2892
|
+
U(d);
|
|
2891
2893
|
return;
|
|
2892
2894
|
}
|
|
2893
|
-
y.value.currentNode = d, y.value.currentKey = C(d), n.showCheckbox &&
|
|
2895
|
+
y.value.currentNode = d, y.value.currentKey = C(d), n.showCheckbox && N(d), m("node-click", d, h, a);
|
|
2894
2896
|
}
|
|
2895
|
-
function
|
|
2897
|
+
function ne(d, h, a, r) {
|
|
2896
2898
|
n.disabled || m("node-contextmenu", d, h, a, r);
|
|
2897
2899
|
}
|
|
2898
|
-
|
|
2900
|
+
te(
|
|
2899
2901
|
() => n.defaultExpandedKeys,
|
|
2900
2902
|
(d) => {
|
|
2901
2903
|
if (d) {
|
|
2902
2904
|
const h = I.value;
|
|
2903
2905
|
if (h) {
|
|
2904
|
-
let a = function(L,
|
|
2905
|
-
for (const
|
|
2906
|
-
if (C(
|
|
2907
|
-
if (g(
|
|
2908
|
-
const
|
|
2909
|
-
if (
|
|
2906
|
+
let a = function(L, j, X = 1) {
|
|
2907
|
+
for (const R of j) {
|
|
2908
|
+
if (C(R) === L) return X;
|
|
2909
|
+
if (g(R)) {
|
|
2910
|
+
const G = a(L, x(R), X + 1);
|
|
2911
|
+
if (G > 0) return G;
|
|
2910
2912
|
}
|
|
2911
2913
|
}
|
|
2912
2914
|
return 0;
|
|
2913
|
-
}, r = function(L,
|
|
2914
|
-
L.forEach((
|
|
2915
|
-
|
|
2915
|
+
}, r = function(L, j, X) {
|
|
2916
|
+
L.forEach((R) => {
|
|
2917
|
+
j < X && g(R) ? (b.add(C(R)), r(x(R), j + 1, X)) : j < X && g(R);
|
|
2916
2918
|
});
|
|
2917
2919
|
};
|
|
2918
2920
|
const f = (d || []).filter((L) => {
|
|
2919
|
-
const
|
|
2920
|
-
return
|
|
2921
|
+
const j = a(L, p.value, 1);
|
|
2922
|
+
return j > 0 && j < h;
|
|
2921
2923
|
}), b = new Set(f);
|
|
2922
2924
|
r(p.value, 1, h), y.value.expandedKeys.forEach((L) => {
|
|
2923
2925
|
a(L, p.value, 1) >= h && b.add(L);
|
|
@@ -2928,7 +2930,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2928
2930
|
},
|
|
2929
2931
|
{ immediate: !0 }
|
|
2930
2932
|
);
|
|
2931
|
-
function
|
|
2933
|
+
function he() {
|
|
2932
2934
|
if (n.defaultExpandAll) {
|
|
2933
2935
|
let d = function(r, f = 1) {
|
|
2934
2936
|
r.forEach((b) => {
|
|
@@ -2945,12 +2947,12 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2945
2947
|
d(p.value, 1), y.value.expandedKeys = h;
|
|
2946
2948
|
}
|
|
2947
2949
|
}
|
|
2948
|
-
function
|
|
2950
|
+
function ge() {
|
|
2949
2951
|
if (n.defaultCheckedKeys && n.defaultCheckedKeys.length > 0) {
|
|
2950
2952
|
let d = function(f, b = []) {
|
|
2951
2953
|
f.forEach((L) => {
|
|
2952
|
-
const
|
|
2953
|
-
h.has(
|
|
2954
|
+
const j = C(L), X = [...b, j];
|
|
2955
|
+
h.has(j) && b.forEach((R) => a.add(R)), g(L) && d(x(L), X);
|
|
2954
2956
|
});
|
|
2955
2957
|
};
|
|
2956
2958
|
const h = new Set(n.defaultCheckedKeys), a = /* @__PURE__ */ new Set();
|
|
@@ -2965,22 +2967,22 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
2965
2967
|
y.value.expandedKeys = a;
|
|
2966
2968
|
}
|
|
2967
2969
|
}
|
|
2968
|
-
|
|
2970
|
+
te(() => n.defaultExpandAll, he, { immediate: !0 }), te(() => p.value, he, { deep: !0 }), te(
|
|
2969
2971
|
() => n.defaultCheckedKeys,
|
|
2970
2972
|
(d) => {
|
|
2971
|
-
d ? (y.value.checkedKeys = new Set(d), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") :
|
|
2973
|
+
d ? (y.value.checkedKeys = new Set(d), n.enableFourthLevelSpecialHandling ? console.log("权限树模式:跳过自动展开逻辑,保持当前展开状态") : ge()) : y.value.checkedKeys.clear();
|
|
2972
2974
|
},
|
|
2973
2975
|
{ immediate: !0 }
|
|
2974
2976
|
);
|
|
2975
|
-
function
|
|
2977
|
+
function me(d) {
|
|
2976
2978
|
try {
|
|
2977
2979
|
let h = function(f, b, L = []) {
|
|
2978
|
-
for (const
|
|
2979
|
-
const
|
|
2980
|
-
if (
|
|
2981
|
-
if (g(
|
|
2982
|
-
const
|
|
2983
|
-
if (
|
|
2980
|
+
for (const j of f) {
|
|
2981
|
+
const X = C(j), R = [...L, X];
|
|
2982
|
+
if (X === b) return R;
|
|
2983
|
+
if (g(j)) {
|
|
2984
|
+
const G = h(x(j), b, R);
|
|
2985
|
+
if (G) return G;
|
|
2984
2986
|
}
|
|
2985
2987
|
}
|
|
2986
2988
|
return null;
|
|
@@ -3000,10 +3002,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3000
3002
|
function V() {
|
|
3001
3003
|
y.value.highlightedKeys.clear();
|
|
3002
3004
|
}
|
|
3003
|
-
function
|
|
3005
|
+
function Z() {
|
|
3004
3006
|
y.value.currentNode = null, y.value.currentKey = null;
|
|
3005
3007
|
}
|
|
3006
|
-
return $({ highlightAndExpandByIds:
|
|
3008
|
+
return $({ highlightAndExpandByIds: me, clearHighlights: V, clearCurrentNode: Z }), te(
|
|
3007
3009
|
() => n.defaultSelectedKeys,
|
|
3008
3010
|
(d) => {
|
|
3009
3011
|
d && (y.value.selectedKeys = new Set(d));
|
|
@@ -3013,21 +3015,21 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3013
3015
|
class: E(["ytree", [`ytree--${e.size}`, { "ytree--disabled": e.disabled }]])
|
|
3014
3016
|
}, [
|
|
3015
3017
|
o("div", xl, [
|
|
3016
|
-
(i(!0), u(
|
|
3018
|
+
(i(!0), u(ae, null, de(p.value, (a) => (i(), u("div", {
|
|
3017
3019
|
key: C(a),
|
|
3018
3020
|
class: E(["ytree-node", { "ytree-node--current": B(a), "ytree-node--highlight": F(a) }])
|
|
3019
3021
|
}, [
|
|
3020
3022
|
o("div", {
|
|
3021
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3023
|
+
class: E(["ytree-node__content", { "is-child-style": J(a, a) }]),
|
|
3022
3024
|
style: { paddingLeft: "8px" },
|
|
3023
|
-
"data-level":
|
|
3024
|
-
onClick: (r) =>
|
|
3025
|
-
onContextmenu: (r) =>
|
|
3025
|
+
"data-level": P(a, a),
|
|
3026
|
+
onClick: (r) => ce(a, a, null, a),
|
|
3027
|
+
onContextmenu: (r) => ne(r, a, a, null)
|
|
3026
3028
|
}, [
|
|
3027
3029
|
g(a) ? (i(), u("span", {
|
|
3028
3030
|
key: 0,
|
|
3029
3031
|
class: E(["ytree-node__expand-icon", { "is-expanded": A(a) }]),
|
|
3030
|
-
onClick:
|
|
3032
|
+
onClick: Q((r) => U(a), ["stop"])
|
|
3031
3033
|
}, [...h[0] || (h[0] = [
|
|
3032
3034
|
o("svg", {
|
|
3033
3035
|
width: "12",
|
|
@@ -3050,7 +3052,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3050
3052
|
"is-checked": D(a),
|
|
3051
3053
|
"is-indeterminate": z(a)
|
|
3052
3054
|
}]),
|
|
3053
|
-
onClick:
|
|
3055
|
+
onClick: Q((r) => N(a), ["stop"])
|
|
3054
3056
|
}, [
|
|
3055
3057
|
D(a) ? (i(), u("svg", Sl, [...h[1] || (h[1] = [
|
|
3056
3058
|
o("path", {
|
|
@@ -3080,9 +3082,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3080
3082
|
}, null, 8, Ll),
|
|
3081
3083
|
o("span", {
|
|
3082
3084
|
class: E(["ytree-node__label", { "is-employee": k(a) }])
|
|
3083
|
-
},
|
|
3085
|
+
}, ee(T(a)), 3),
|
|
3084
3086
|
o("div", Il, [
|
|
3085
|
-
|
|
3087
|
+
se(d.$slots, "node-content", {
|
|
3086
3088
|
node: a,
|
|
3087
3089
|
isCurrent: B(a),
|
|
3088
3090
|
isExpanded: A(a),
|
|
@@ -3090,24 +3092,24 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3090
3092
|
}, void 0, !0)
|
|
3091
3093
|
])
|
|
3092
3094
|
], 42, $l),
|
|
3093
|
-
|
|
3094
|
-
default:
|
|
3095
|
+
ie($e, { name: "ytree-node" }, {
|
|
3096
|
+
default: ue(() => [
|
|
3095
3097
|
g(a) && A(a) ? (i(), u("div", Bl, [
|
|
3096
|
-
(i(!0), u(
|
|
3098
|
+
(i(!0), u(ae, null, de(x(a), (r) => (i(), u("div", {
|
|
3097
3099
|
key: C(r),
|
|
3098
3100
|
class: E(["ytree-node", { "ytree-node--current": B(r), "ytree-node--highlight": F(r) }])
|
|
3099
3101
|
}, [
|
|
3100
3102
|
o("div", {
|
|
3101
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3103
|
+
class: E(["ytree-node__content", { "is-child-style": J(r, a) }]),
|
|
3102
3104
|
style: { paddingLeft: "22px" },
|
|
3103
|
-
"data-level":
|
|
3104
|
-
onClick: (f) =>
|
|
3105
|
-
onContextmenu: (f) =>
|
|
3105
|
+
"data-level": P(a, r),
|
|
3106
|
+
onClick: (f) => ce(r, r, null, a),
|
|
3107
|
+
onContextmenu: (f) => ne(f, r, r, null)
|
|
3106
3108
|
}, [
|
|
3107
3109
|
g(r) ? (i(), u("span", {
|
|
3108
3110
|
key: 0,
|
|
3109
3111
|
class: E(["ytree-node__expand-icon", { "is-expanded": A(r) }]),
|
|
3110
|
-
onClick:
|
|
3112
|
+
onClick: Q((f) => U(r), ["stop"])
|
|
3111
3113
|
}, [...h[3] || (h[3] = [
|
|
3112
3114
|
o("svg", {
|
|
3113
3115
|
width: "12",
|
|
@@ -3130,7 +3132,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3130
3132
|
"is-checked": D(r),
|
|
3131
3133
|
"is-indeterminate": z(r)
|
|
3132
3134
|
}]),
|
|
3133
|
-
onClick:
|
|
3135
|
+
onClick: Q((f) => N(r), ["stop"])
|
|
3134
3136
|
}, [
|
|
3135
3137
|
D(r) ? (i(), u("svg", Hl, [...h[4] || (h[4] = [
|
|
3136
3138
|
o("path", {
|
|
@@ -3160,9 +3162,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3160
3162
|
}, null, 8, Rl),
|
|
3161
3163
|
o("span", {
|
|
3162
3164
|
class: E(["ytree-node__label", { "is-employee": k(r) }])
|
|
3163
|
-
},
|
|
3165
|
+
}, ee(T(r)), 3),
|
|
3164
3166
|
o("div", Vl, [
|
|
3165
|
-
|
|
3167
|
+
se(d.$slots, "node-content", {
|
|
3166
3168
|
node: r,
|
|
3167
3169
|
isCurrent: B(r),
|
|
3168
3170
|
isExpanded: A(r),
|
|
@@ -3170,10 +3172,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3170
3172
|
}, void 0, !0)
|
|
3171
3173
|
])
|
|
3172
3174
|
], 42, El),
|
|
3173
|
-
|
|
3174
|
-
default:
|
|
3175
|
+
ie($e, { name: "ytree-node" }, {
|
|
3176
|
+
default: ue(() => [
|
|
3175
3177
|
g(r) && A(r) ? (i(), u("div", Al, [
|
|
3176
|
-
(i(!0), u(
|
|
3178
|
+
(i(!0), u(ae, null, de(x(r), (f) => (i(), u("div", {
|
|
3177
3179
|
key: C(f),
|
|
3178
3180
|
class: E(["ytree-node", {
|
|
3179
3181
|
"ytree-node--current": B(f),
|
|
@@ -3181,11 +3183,11 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3181
3183
|
}])
|
|
3182
3184
|
}, [
|
|
3183
3185
|
o("div", {
|
|
3184
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3186
|
+
class: E(["ytree-node__content", { "is-child-style": J(f, a) }]),
|
|
3185
3187
|
style: { paddingLeft: "38px" },
|
|
3186
|
-
"data-level":
|
|
3187
|
-
onClick: (b) =>
|
|
3188
|
-
onContextmenu: (b) =>
|
|
3188
|
+
"data-level": P(a, f),
|
|
3189
|
+
onClick: (b) => ce(f, f, null, a),
|
|
3190
|
+
onContextmenu: (b) => ne(
|
|
3189
3191
|
b,
|
|
3190
3192
|
f,
|
|
3191
3193
|
f,
|
|
@@ -3195,7 +3197,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3195
3197
|
g(f) ? (i(), u("span", {
|
|
3196
3198
|
key: 0,
|
|
3197
3199
|
class: E(["ytree-node__expand-icon", { "is-expanded": A(f) }]),
|
|
3198
|
-
onClick:
|
|
3200
|
+
onClick: Q((b) => U(f), ["stop"])
|
|
3199
3201
|
}, [...h[6] || (h[6] = [
|
|
3200
3202
|
o("svg", {
|
|
3201
3203
|
width: "12",
|
|
@@ -3218,7 +3220,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3218
3220
|
"is-checked": D(f),
|
|
3219
3221
|
"is-indeterminate": z(f)
|
|
3220
3222
|
}]),
|
|
3221
|
-
onClick:
|
|
3223
|
+
onClick: Q((b) => N(f), ["stop"])
|
|
3222
3224
|
}, [
|
|
3223
3225
|
D(f) ? (i(), u("svg", Ol, [...h[7] || (h[7] = [
|
|
3224
3226
|
o("path", {
|
|
@@ -3248,9 +3250,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3248
3250
|
}, null, 8, ql),
|
|
3249
3251
|
o("span", {
|
|
3250
3252
|
class: E(["ytree-node__label", { "is-employee": k(f) }])
|
|
3251
|
-
},
|
|
3253
|
+
}, ee(T(f)), 3),
|
|
3252
3254
|
o("div", Ul, [
|
|
3253
|
-
|
|
3255
|
+
se(d.$slots, "node-content", {
|
|
3254
3256
|
node: f,
|
|
3255
3257
|
isCurrent: B(f),
|
|
3256
3258
|
isExpanded: A(f),
|
|
@@ -3258,10 +3260,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3258
3260
|
}, void 0, !0)
|
|
3259
3261
|
])
|
|
3260
3262
|
], 42, Fl),
|
|
3261
|
-
|
|
3262
|
-
default:
|
|
3263
|
+
ie($e, { name: "ytree-node" }, {
|
|
3264
|
+
default: ue(() => [
|
|
3263
3265
|
g(f) && A(f) ? (i(), u("div", Zl, [
|
|
3264
|
-
(i(!0), u(
|
|
3266
|
+
(i(!0), u(ae, null, de(x(f), (b) => (i(), u("div", {
|
|
3265
3267
|
key: C(b),
|
|
3266
3268
|
class: E(["ytree-node", {
|
|
3267
3269
|
"ytree-node--current": B(b),
|
|
@@ -3269,18 +3271,18 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3269
3271
|
}])
|
|
3270
3272
|
}, [
|
|
3271
3273
|
o("div", {
|
|
3272
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3274
|
+
class: E(["ytree-node__content", { "is-child-style": J(b, a) }]),
|
|
3273
3275
|
style: {
|
|
3274
3276
|
paddingLeft: "54px"
|
|
3275
3277
|
},
|
|
3276
|
-
"data-level":
|
|
3277
|
-
onClick: (L) =>
|
|
3278
|
+
"data-level": P(a, b),
|
|
3279
|
+
onClick: (L) => ce(
|
|
3278
3280
|
b,
|
|
3279
3281
|
b,
|
|
3280
3282
|
null,
|
|
3281
3283
|
a
|
|
3282
3284
|
),
|
|
3283
|
-
onContextmenu: (L) =>
|
|
3285
|
+
onContextmenu: (L) => ne(
|
|
3284
3286
|
L,
|
|
3285
3287
|
b,
|
|
3286
3288
|
b,
|
|
@@ -3292,7 +3294,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3292
3294
|
class: E(["ytree-node__expand-icon", {
|
|
3293
3295
|
"is-expanded": A(b)
|
|
3294
3296
|
}]),
|
|
3295
|
-
onClick:
|
|
3297
|
+
onClick: Q((L) => U(b), ["stop"])
|
|
3296
3298
|
}, [...h[9] || (h[9] = [
|
|
3297
3299
|
o("svg", {
|
|
3298
3300
|
width: "12",
|
|
@@ -3315,7 +3317,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3315
3317
|
"is-checked": D(b),
|
|
3316
3318
|
"is-indeterminate": z(b)
|
|
3317
3319
|
}]),
|
|
3318
|
-
onClick:
|
|
3320
|
+
onClick: Q((L) => N(b), ["stop"])
|
|
3319
3321
|
}, [
|
|
3320
3322
|
D(b) ? (i(), u("svg", eo, [...h[10] || (h[10] = [
|
|
3321
3323
|
o("path", {
|
|
@@ -3347,9 +3349,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3347
3349
|
class: E(["ytree-node__label", {
|
|
3348
3350
|
"is-employee": k(b)
|
|
3349
3351
|
}])
|
|
3350
|
-
},
|
|
3352
|
+
}, ee(T(b)), 3),
|
|
3351
3353
|
o("div", lo, [
|
|
3352
|
-
|
|
3354
|
+
se(d.$slots, "node-content", {
|
|
3353
3355
|
node: b,
|
|
3354
3356
|
isCurrent: B(b),
|
|
3355
3357
|
isExpanded: A(b),
|
|
@@ -3357,10 +3359,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3357
3359
|
}, void 0, !0)
|
|
3358
3360
|
])
|
|
3359
3361
|
], 42, Ql),
|
|
3360
|
-
|
|
3361
|
-
default:
|
|
3362
|
+
ie($e, { name: "ytree-node" }, {
|
|
3363
|
+
default: ue(() => [
|
|
3362
3364
|
g(b) && A(b) ? (i(), u("div", oo, [
|
|
3363
|
-
(i(!0), u(
|
|
3365
|
+
(i(!0), u(ae, null, de(x(
|
|
3364
3366
|
b
|
|
3365
3367
|
), (L) => (i(), u("div", {
|
|
3366
3368
|
key: C(L),
|
|
@@ -3369,19 +3371,19 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3369
3371
|
}])
|
|
3370
3372
|
}, [
|
|
3371
3373
|
o("div", {
|
|
3372
|
-
class: E(["ytree-node__content", { "is-child-style":
|
|
3374
|
+
class: E(["ytree-node__content", { "is-child-style": J(L, a) }]),
|
|
3373
3375
|
style: {
|
|
3374
3376
|
paddingLeft: "70px"
|
|
3375
3377
|
},
|
|
3376
|
-
"data-level":
|
|
3377
|
-
onClick: (
|
|
3378
|
+
"data-level": P(a, L),
|
|
3379
|
+
onClick: (j) => ce(
|
|
3378
3380
|
L,
|
|
3379
3381
|
L,
|
|
3380
3382
|
null,
|
|
3381
3383
|
a
|
|
3382
3384
|
),
|
|
3383
|
-
onContextmenu: (
|
|
3384
|
-
|
|
3385
|
+
onContextmenu: (j) => ne(
|
|
3386
|
+
j,
|
|
3385
3387
|
L,
|
|
3386
3388
|
L,
|
|
3387
3389
|
null
|
|
@@ -3392,7 +3394,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3392
3394
|
class: E(["ytree-node__expand-icon", {
|
|
3393
3395
|
"is-expanded": A(L)
|
|
3394
3396
|
}]),
|
|
3395
|
-
onClick:
|
|
3397
|
+
onClick: Q((j) => U(L), ["stop"])
|
|
3396
3398
|
}, [...h[12] || (h[12] = [
|
|
3397
3399
|
o("svg", {
|
|
3398
3400
|
width: "12",
|
|
@@ -3417,7 +3419,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3417
3419
|
L
|
|
3418
3420
|
)
|
|
3419
3421
|
}]),
|
|
3420
|
-
onClick:
|
|
3422
|
+
onClick: Q((j) => N(L), ["stop"])
|
|
3421
3423
|
}, [
|
|
3422
3424
|
D(L) ? (i(), u("svg", uo, [...h[13] || (h[13] = [
|
|
3423
3425
|
o("path", {
|
|
@@ -3451,9 +3453,9 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3451
3453
|
class: E(["ytree-node__label", {
|
|
3452
3454
|
"is-employee": k(L)
|
|
3453
3455
|
}])
|
|
3454
|
-
},
|
|
3456
|
+
}, ee(T(L)), 3),
|
|
3455
3457
|
o("div", vo, [
|
|
3456
|
-
|
|
3458
|
+
se(d.$slots, "node-content", {
|
|
3457
3459
|
node: L,
|
|
3458
3460
|
isCurrent: B(L),
|
|
3459
3461
|
isExpanded: A(L),
|
|
@@ -3485,13 +3487,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3485
3487
|
])
|
|
3486
3488
|
], 2));
|
|
3487
3489
|
}
|
|
3488
|
-
}), go = /* @__PURE__ */
|
|
3490
|
+
}), go = /* @__PURE__ */ be(yo, [["__scopeId", "data-v-6ab410ed"]]), mo = { class: "query-encapsulation" }, wo = { class: "query-encapsulation__container" }, bo = { class: "query-encapsulation__content" }, ko = { class: "query-encapsulation__fields" }, xo = { class: "query-encapsulation__field-wrapper" }, $o = {
|
|
3489
3491
|
key: 0,
|
|
3490
3492
|
class: "query-encapsulation__field-label"
|
|
3491
3493
|
}, Co = {
|
|
3492
3494
|
key: 0,
|
|
3493
3495
|
class: "query-encapsulation__toggle"
|
|
3494
|
-
}, Do = { class: "query-encapsulation__actions" }, _o = { class: "query-encapsulation__actions-group" }, So = /* @__PURE__ */
|
|
3496
|
+
}, Do = { class: "query-encapsulation__actions" }, _o = { class: "query-encapsulation__actions-group" }, So = /* @__PURE__ */ we({
|
|
3495
3497
|
__name: "QueryEncapsulation",
|
|
3496
3498
|
props: {
|
|
3497
3499
|
Iflabel: { type: Boolean, default: !0 },
|
|
@@ -3502,7 +3504,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3502
3504
|
},
|
|
3503
3505
|
emits: ["update:modelValue", "search", "reset", "field-change"],
|
|
3504
3506
|
setup(e, { emit: $ }) {
|
|
3505
|
-
const t = e, n = $, m = K(!1), p = at({}), y =
|
|
3507
|
+
const t = e, n = $, m = K(!1), p = at({}), y = Y(() => t.fields.filter((D) => !D.hidden)), I = Y(() => m.value ? y.value : y.value.slice(0, t.maxVisibleFields)), C = Y(() => y.value.length > t.maxVisibleFields);
|
|
3506
3508
|
function T(D) {
|
|
3507
3509
|
switch (D) {
|
|
3508
3510
|
case "select":
|
|
@@ -3519,7 +3521,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3519
3521
|
n("field-change", D, p[D.key]), n("update:modelValue", { ...p });
|
|
3520
3522
|
}
|
|
3521
3523
|
function w() {
|
|
3522
|
-
const D =
|
|
3524
|
+
const D = P(p), z = J(D), B = { ...p };
|
|
3523
3525
|
n("search", { data: z, raw: B });
|
|
3524
3526
|
}
|
|
3525
3527
|
function g() {
|
|
@@ -3531,10 +3533,10 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3531
3533
|
function x() {
|
|
3532
3534
|
m.value = !m.value;
|
|
3533
3535
|
}
|
|
3534
|
-
function
|
|
3536
|
+
function P(D) {
|
|
3535
3537
|
const z = {};
|
|
3536
3538
|
return Object.keys(D).forEach((B) => {
|
|
3537
|
-
const F = t.fields.find((
|
|
3539
|
+
const F = t.fields.find((U) => U.key === B), N = D[B], q = typeof N == "string" ? N.trim() : N;
|
|
3538
3540
|
if (!(q == null || q === "")) {
|
|
3539
3541
|
if (typeof q == "object" && q.startDate && q.endDate) {
|
|
3540
3542
|
q.startDate && q.endDate && (z[B] = q);
|
|
@@ -3548,15 +3550,15 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3548
3550
|
}
|
|
3549
3551
|
}), z;
|
|
3550
3552
|
}
|
|
3551
|
-
function
|
|
3553
|
+
function J(D) {
|
|
3552
3554
|
const z = {};
|
|
3553
3555
|
return Object.keys(D).forEach((B) => {
|
|
3554
|
-
const F = D[B],
|
|
3555
|
-
if (
|
|
3556
|
-
if (
|
|
3557
|
-
const q =
|
|
3558
|
-
F.startDate && F.endDate && F.startDate !== 0 && F.endDate !== 0 && (
|
|
3559
|
-
} else
|
|
3556
|
+
const F = D[B], N = t.fields.find((q) => q.key === B);
|
|
3557
|
+
if (N)
|
|
3558
|
+
if (N.type === "daterange" && typeof F == "object") {
|
|
3559
|
+
const q = N.startKey || `${B}Start`, U = N.endKey || `${B}End`;
|
|
3560
|
+
F.startDate && F.endDate && F.startDate !== 0 && F.endDate !== 0 && (N.format === "timestamp" ? (z[q] = new Date(F.startDate).getTime(), z[U] = new Date(F.endDate).getTime()) : (z[q] = F.startDate, z[U] = F.endDate));
|
|
3561
|
+
} else N.type === "date" && F && F !== 0 && N.format === "timestamp" ? z[B] = new Date(F).getTime() : z[B] = F;
|
|
3560
3562
|
else
|
|
3561
3563
|
z[B] = F;
|
|
3562
3564
|
}), z;
|
|
@@ -3570,31 +3572,31 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3570
3572
|
} : D.type === "date" ? p[D.key] = ((B = t.modelValue) == null ? void 0 : B[D.key]) || null : p[D.key] = ((F = t.modelValue) == null ? void 0 : F[D.key]) || "");
|
|
3571
3573
|
});
|
|
3572
3574
|
}
|
|
3573
|
-
return
|
|
3575
|
+
return te(
|
|
3574
3576
|
() => t.modelValue,
|
|
3575
3577
|
(D) => {
|
|
3576
3578
|
D && Object.assign(p, D);
|
|
3577
3579
|
},
|
|
3578
3580
|
{ deep: !0, immediate: !0 }
|
|
3579
|
-
),
|
|
3581
|
+
), De(() => {
|
|
3580
3582
|
A();
|
|
3581
3583
|
}), (D, z) => (i(), u("div", mo, [
|
|
3582
3584
|
o("div", wo, [
|
|
3583
3585
|
o("div", bo, [
|
|
3584
3586
|
o("div", ko, [
|
|
3585
|
-
|
|
3587
|
+
ie(st, {
|
|
3586
3588
|
name: "qf",
|
|
3587
3589
|
tag: "div",
|
|
3588
3590
|
class: "query-encapsulation__fields-group"
|
|
3589
3591
|
}, {
|
|
3590
|
-
default:
|
|
3591
|
-
(i(!0), u(
|
|
3592
|
+
default: ue(() => [
|
|
3593
|
+
(i(!0), u(ae, null, de(I.value, (B) => (i(), u("div", {
|
|
3592
3594
|
key: B.key,
|
|
3593
3595
|
class: "query-encapsulation__field-item"
|
|
3594
3596
|
}, [
|
|
3595
3597
|
o("div", xo, [
|
|
3596
|
-
e.Iflabel ? (i(), u("label", $o,
|
|
3597
|
-
(i(),
|
|
3598
|
+
e.Iflabel ? (i(), u("label", $o, ee(B.label), 1)) : W("", !0),
|
|
3599
|
+
(i(), Le(it(T(B.type)), {
|
|
3598
3600
|
modelValue: p[B.key],
|
|
3599
3601
|
"onUpdate:modelValue": (F) => p[B.key] = F,
|
|
3600
3602
|
placeholder: B.placeholder || `请输入${B.label}`,
|
|
@@ -3614,13 +3616,13 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3614
3616
|
_: 1
|
|
3615
3617
|
}),
|
|
3616
3618
|
C.value ? (i(), u("div", Co, [
|
|
3617
|
-
|
|
3619
|
+
ie(Ne, {
|
|
3618
3620
|
variant: "secondary",
|
|
3619
3621
|
size: "small",
|
|
3620
3622
|
onClick: x
|
|
3621
3623
|
}, {
|
|
3622
|
-
default:
|
|
3623
|
-
|
|
3624
|
+
default: ue(() => [
|
|
3625
|
+
Ce(ee(m.value ? "收起" : "展开") + " ", 1),
|
|
3624
3626
|
o("span", {
|
|
3625
3627
|
class: E(["query-encapsulation__toggle-icon", { "is-expanded": m.value }])
|
|
3626
3628
|
}, "▼", 2)
|
|
@@ -3630,29 +3632,29 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3630
3632
|
])) : W("", !0),
|
|
3631
3633
|
o("div", Do, [
|
|
3632
3634
|
o("div", _o, [
|
|
3633
|
-
|
|
3635
|
+
ie(Ne, {
|
|
3634
3636
|
variant: "primary",
|
|
3635
3637
|
size: "small",
|
|
3636
3638
|
onClick: w,
|
|
3637
3639
|
loading: e.loading
|
|
3638
3640
|
}, {
|
|
3639
|
-
default:
|
|
3640
|
-
|
|
3641
|
+
default: ue(() => [...z[0] || (z[0] = [
|
|
3642
|
+
Ce(" 搜索 ", -1)
|
|
3641
3643
|
])]),
|
|
3642
3644
|
_: 1
|
|
3643
3645
|
}, 8, ["loading"]),
|
|
3644
|
-
|
|
3646
|
+
ie(Ne, {
|
|
3645
3647
|
variant: "secondary",
|
|
3646
3648
|
size: "small",
|
|
3647
3649
|
onClick: g,
|
|
3648
3650
|
loading: e.loading
|
|
3649
3651
|
}, {
|
|
3650
|
-
default:
|
|
3651
|
-
|
|
3652
|
+
default: ue(() => [...z[1] || (z[1] = [
|
|
3653
|
+
Ce(" 重置 ", -1)
|
|
3652
3654
|
])]),
|
|
3653
3655
|
_: 1
|
|
3654
3656
|
}, 8, ["loading"]),
|
|
3655
|
-
|
|
3657
|
+
se(D.$slots, "extra-actions", {}, void 0, !0)
|
|
3656
3658
|
])
|
|
3657
3659
|
])
|
|
3658
3660
|
])
|
|
@@ -3660,7 +3662,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3660
3662
|
])
|
|
3661
3663
|
]));
|
|
3662
3664
|
}
|
|
3663
|
-
}), Mo = /* @__PURE__ */
|
|
3665
|
+
}), Mo = /* @__PURE__ */ be(So, [["__scopeId", "data-v-54199f17"]]), Lo = {
|
|
3664
3666
|
key: 0,
|
|
3665
3667
|
width: "16",
|
|
3666
3668
|
height: "16",
|
|
@@ -3678,7 +3680,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3678
3680
|
height: "16",
|
|
3679
3681
|
viewBox: "0 0 24 24",
|
|
3680
3682
|
fill: "none"
|
|
3681
|
-
}, Eo = ["textContent"], To = /* @__PURE__ */
|
|
3683
|
+
}, Eo = ["textContent"], To = /* @__PURE__ */ we({
|
|
3682
3684
|
__name: "ymessageToast",
|
|
3683
3685
|
props: {
|
|
3684
3686
|
id: {},
|
|
@@ -3693,7 +3695,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3693
3695
|
setup(e) {
|
|
3694
3696
|
const $ = e, t = K(!1);
|
|
3695
3697
|
let n;
|
|
3696
|
-
|
|
3698
|
+
De(() => {
|
|
3697
3699
|
requestAnimationFrame(() => {
|
|
3698
3700
|
t.value = !0, $.duration && $.duration > 0 && (n = window.setTimeout(() => m(), $.duration));
|
|
3699
3701
|
});
|
|
@@ -3707,14 +3709,14 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3707
3709
|
var y;
|
|
3708
3710
|
(y = $.onClose) == null || y.call($, $.id);
|
|
3709
3711
|
}
|
|
3710
|
-
return (y, I) => (i(),
|
|
3712
|
+
return (y, I) => (i(), Le($e, {
|
|
3711
3713
|
name: "y-msg-fade",
|
|
3712
3714
|
onAfterLeave: p
|
|
3713
3715
|
}, {
|
|
3714
|
-
default:
|
|
3716
|
+
default: ue(() => [
|
|
3715
3717
|
Be(o("div", {
|
|
3716
3718
|
class: E(["y-msg", [`y-msg--${e.type}`]]),
|
|
3717
|
-
style:
|
|
3719
|
+
style: ve({ zIndex: e.zIndex }),
|
|
3718
3720
|
role: "status",
|
|
3719
3721
|
"aria-live": "polite"
|
|
3720
3722
|
}, [
|
|
@@ -3750,7 +3752,7 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3750
3752
|
], 2),
|
|
3751
3753
|
o("div", {
|
|
3752
3754
|
class: "y-msg__content",
|
|
3753
|
-
textContent:
|
|
3755
|
+
textContent: ee(e.message)
|
|
3754
3756
|
}, null, 8, Eo),
|
|
3755
3757
|
e.closable ? (i(), u("button", {
|
|
3756
3758
|
key: 0,
|
|
@@ -3765,34 +3767,34 @@ const ut = ["type", "disabled", "aria-busy", "aria-disabled"], ct = { class: "co
|
|
|
3765
3767
|
_: 1
|
|
3766
3768
|
}));
|
|
3767
3769
|
}
|
|
3768
|
-
}), zo = /* @__PURE__ */
|
|
3770
|
+
}), zo = /* @__PURE__ */ be(To, [["__scopeId", "data-v-c5dc221c"]]);
|
|
3769
3771
|
let Ko = 1;
|
|
3770
|
-
const Ue = 12,
|
|
3772
|
+
const Ue = 12, Me = [];
|
|
3771
3773
|
function Ho() {
|
|
3772
3774
|
let e = 20;
|
|
3773
|
-
return
|
|
3775
|
+
return Me.forEach(($) => {
|
|
3774
3776
|
e += $.height + Ue;
|
|
3775
3777
|
}), e;
|
|
3776
3778
|
}
|
|
3777
3779
|
function Qe(e) {
|
|
3778
|
-
const $ =
|
|
3780
|
+
const $ = Me.findIndex((p) => p.id === e);
|
|
3779
3781
|
if ($ === -1) return;
|
|
3780
|
-
const { el: t } =
|
|
3782
|
+
const { el: t } = Me[$], n = t.firstElementChild;
|
|
3781
3783
|
if (n) {
|
|
3782
3784
|
const p = window.getComputedStyle(n).top;
|
|
3783
3785
|
n.style.top = p, n.classList.add("is-leaving"), n.style.willChange = "opacity, transform";
|
|
3784
3786
|
}
|
|
3785
|
-
|
|
3787
|
+
Me[$].leaving = !0, je(), setTimeout(() => {
|
|
3786
3788
|
Xe(null, t), t.parentNode && t.parentNode.removeChild(t);
|
|
3787
|
-
const p =
|
|
3788
|
-
p !== -1 &&
|
|
3789
|
+
const p = Me.findIndex((y) => y.id === e);
|
|
3790
|
+
p !== -1 && Me.splice(p, 1), je();
|
|
3789
3791
|
}, 260);
|
|
3790
3792
|
}
|
|
3791
3793
|
function qe(e) {
|
|
3792
3794
|
var p;
|
|
3793
3795
|
const $ = Ko++, t = document.createElement("div");
|
|
3794
3796
|
document.body.appendChild(t);
|
|
3795
|
-
const n =
|
|
3797
|
+
const n = ie(zo, {
|
|
3796
3798
|
id: $,
|
|
3797
3799
|
type: e.type || "success",
|
|
3798
3800
|
message: e.message,
|
|
@@ -3804,10 +3806,10 @@ function qe(e) {
|
|
|
3804
3806
|
});
|
|
3805
3807
|
Xe(n, t);
|
|
3806
3808
|
const m = ((p = t.firstElementChild) == null ? void 0 : p.offsetHeight) || 0;
|
|
3807
|
-
return
|
|
3809
|
+
return Me.push({ id: $, el: t, vm: n, height: m, leaving: !1 }), je(), requestAnimationFrame(() => {
|
|
3808
3810
|
const y = t.firstElementChild;
|
|
3809
3811
|
if (!y) return;
|
|
3810
|
-
const I = y.offsetHeight || m || 0, C =
|
|
3812
|
+
const I = y.offsetHeight || m || 0, C = Me.find((T) => T.id === $);
|
|
3811
3813
|
C && (C.height = I, je());
|
|
3812
3814
|
}), { close: () => Qe($) };
|
|
3813
3815
|
}
|
|
@@ -3825,7 +3827,7 @@ const Oe = {
|
|
|
3825
3827
|
typeof window < "u" && (window.YMessage = Oe, typeof globalThis.YMessage > "u" && (globalThis.YMessage = Oe));
|
|
3826
3828
|
function je() {
|
|
3827
3829
|
let e = 20;
|
|
3828
|
-
|
|
3830
|
+
Me.forEach(($) => {
|
|
3829
3831
|
const t = $.el.firstElementChild;
|
|
3830
3832
|
if (!t) return;
|
|
3831
3833
|
const n = e;
|