@xto/data 1.4.3 → 1.4.4
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/es/index.mjs +1207 -1151
- package/es/style.css +1 -1
- package/lib/index.cjs +1 -1
- package/lib/style.css +1 -1
- package/package.json +7 -7
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Q, computed as
|
|
1
|
+
import { defineComponent as Q, computed as b, openBlock as h, createElementBlock as v, normalizeStyle as O, normalizeClass as u, createElementVNode as m, renderSlot as P, createTextVNode as q, toDisplayString as B, unref as s, createVNode as J, createCommentVNode as D, ref as j, watch as te, Fragment as F, renderList as _, withDirectives as ge, withKeys as Ce, vModelText as ze, useSlots as me, withModifiers as re, inject as ue, resolveComponent as Ie, createBlock as se, withCtx as ye, vShow as Me, reactive as ke, provide as de, toRef as $e, nextTick as we, onMounted as ce, onUnmounted as fe, resolveDynamicComponent as pe, Teleport as Se, onBeforeUnmount as Le } from "vue";
|
|
2
2
|
import { useNamespace as G } from "@xto/core";
|
|
3
3
|
const be = {
|
|
4
4
|
// 箭头类
|
|
@@ -201,10 +201,10 @@ const be = {
|
|
|
201
201
|
up: "M5 15l7-7 7 7"
|
|
202
202
|
// 上箭头
|
|
203
203
|
};
|
|
204
|
-
function
|
|
204
|
+
function De(n) {
|
|
205
205
|
return n in be;
|
|
206
206
|
}
|
|
207
|
-
const
|
|
207
|
+
const Ke = ["aria-hidden", "aria-label"], Ae = ["stroke-width"], He = ["d"], Z = /* @__PURE__ */ Q({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -215,28 +215,28 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
215
215
|
strokeWidth: { default: 2 }
|
|
216
216
|
},
|
|
217
217
|
setup(n, { expose: o }) {
|
|
218
|
-
const t = n, e = G("icon"),
|
|
219
|
-
width:
|
|
220
|
-
height:
|
|
218
|
+
const t = n, e = G("icon"), r = b(() => typeof t.size == "number" ? `${t.size}px` : t.size), l = b(() => ({
|
|
219
|
+
width: r.value,
|
|
220
|
+
height: r.value,
|
|
221
221
|
color: t.color
|
|
222
|
-
})), a =
|
|
222
|
+
})), a = b(() => ({
|
|
223
223
|
strokeWidth: t.strokeWidth
|
|
224
|
-
})), p =
|
|
224
|
+
})), p = b(() => [
|
|
225
225
|
e.b(),
|
|
226
226
|
e.is("spin", t.spin)
|
|
227
|
-
]), y =
|
|
227
|
+
]), y = b(() => t.name && De(t.name) ? be[t.name] : "");
|
|
228
228
|
return o({
|
|
229
|
-
iconSize:
|
|
229
|
+
iconSize: r,
|
|
230
230
|
iconStyle: l,
|
|
231
231
|
iconPath: y
|
|
232
|
-
}), (
|
|
232
|
+
}), (C, I) => (h(), v("span", {
|
|
233
233
|
class: u(p.value),
|
|
234
|
-
style:
|
|
234
|
+
style: O(l.value),
|
|
235
235
|
"aria-hidden": !n.name,
|
|
236
236
|
"aria-label": n.name,
|
|
237
237
|
role: "img"
|
|
238
238
|
}, [
|
|
239
|
-
y.value ? (
|
|
239
|
+
y.value ? (h(), v("svg", {
|
|
240
240
|
key: 0,
|
|
241
241
|
viewBox: "0 0 24 24",
|
|
242
242
|
fill: "none",
|
|
@@ -244,16 +244,16 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
244
244
|
"stroke-width": n.strokeWidth,
|
|
245
245
|
"stroke-linecap": "round",
|
|
246
246
|
"stroke-linejoin": "round",
|
|
247
|
-
style:
|
|
247
|
+
style: O(a.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
|
-
m("path", { d: y.value }, null, 8,
|
|
251
|
-
], 12,
|
|
252
|
-
|
|
250
|
+
m("path", { d: y.value }, null, 8, He)
|
|
251
|
+
], 12, Ae)) : P(C.$slots, "default", { key: 1 }, () => [
|
|
252
|
+
q(B(n.name), 1)
|
|
253
253
|
])
|
|
254
|
-
], 14,
|
|
254
|
+
], 14, Ke));
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
256
|
+
}), Nt = /* @__PURE__ */ Q({
|
|
257
257
|
name: "XTag",
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
@@ -266,37 +266,37 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
266
266
|
},
|
|
267
267
|
emits: ["close"],
|
|
268
268
|
setup(n, { emit: o }) {
|
|
269
|
-
const t = n, e = o,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
t.size !== "default" ?
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
]), a =
|
|
269
|
+
const t = n, e = o, r = G("tag"), l = b(() => [
|
|
270
|
+
r.b(),
|
|
271
|
+
r.m(t.type || "primary"),
|
|
272
|
+
t.size !== "default" ? r.m(t.size) : "",
|
|
273
|
+
r.m(t.effect),
|
|
274
|
+
r.is("hit", t.hit)
|
|
275
|
+
]), a = b(() => t.color ? {
|
|
276
276
|
backgroundColor: t.effect === "dark" ? t.color : "",
|
|
277
277
|
borderColor: t.color,
|
|
278
278
|
color: t.effect === "dark" ? "#fff" : t.color
|
|
279
279
|
} : {}), p = (y) => {
|
|
280
280
|
e("close", y);
|
|
281
281
|
};
|
|
282
|
-
return (y,
|
|
282
|
+
return (y, C) => (h(), v("span", {
|
|
283
283
|
class: u(l.value),
|
|
284
|
-
style:
|
|
284
|
+
style: O(a.value)
|
|
285
285
|
}, [
|
|
286
|
-
|
|
287
|
-
n.closable ? (
|
|
286
|
+
P(y.$slots, "default"),
|
|
287
|
+
n.closable ? (h(), v("i", {
|
|
288
288
|
key: 0,
|
|
289
|
-
class: u(s(
|
|
289
|
+
class: u(s(r).e("close")),
|
|
290
290
|
onClick: p
|
|
291
291
|
}, [
|
|
292
292
|
J(s(Z), {
|
|
293
293
|
name: "close",
|
|
294
294
|
size: 10
|
|
295
295
|
})
|
|
296
|
-
], 2)) :
|
|
296
|
+
], 2)) : D("", !0)
|
|
297
297
|
], 6));
|
|
298
298
|
}
|
|
299
|
-
}),
|
|
299
|
+
}), Tt = /* @__PURE__ */ Q({
|
|
300
300
|
name: "XCard",
|
|
301
301
|
__name: "index",
|
|
302
302
|
props: {
|
|
@@ -305,30 +305,30 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
305
305
|
shadow: { default: "always" }
|
|
306
306
|
},
|
|
307
307
|
setup(n) {
|
|
308
|
-
const o = n, t = G("card"), e =
|
|
308
|
+
const o = n, t = G("card"), e = b(() => [
|
|
309
309
|
t.b(),
|
|
310
310
|
t.is(`shadow-${o.shadow}`)
|
|
311
311
|
]);
|
|
312
|
-
return (
|
|
312
|
+
return (r, l) => (h(), v("div", {
|
|
313
313
|
class: u(e.value)
|
|
314
314
|
}, [
|
|
315
|
-
n.header ||
|
|
315
|
+
n.header || r.$slots.header ? (h(), v("div", {
|
|
316
316
|
key: 0,
|
|
317
317
|
class: u(s(t).e("header"))
|
|
318
318
|
}, [
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
P(r.$slots, "header", {}, () => [
|
|
320
|
+
q(B(n.header), 1)
|
|
321
321
|
])
|
|
322
|
-
], 2)) :
|
|
322
|
+
], 2)) : D("", !0),
|
|
323
323
|
m("div", {
|
|
324
324
|
class: u(s(t).e("body")),
|
|
325
|
-
style:
|
|
325
|
+
style: O(n.bodyStyle)
|
|
326
326
|
}, [
|
|
327
|
-
|
|
327
|
+
P(r.$slots, "default")
|
|
328
328
|
], 6)
|
|
329
329
|
], 2));
|
|
330
330
|
}
|
|
331
|
-
}),
|
|
331
|
+
}), Ne = ["viewBox"], Te = ["cx", "cy", "r", "stroke-width"], Ve = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], Vt = /* @__PURE__ */ Q({
|
|
332
332
|
name: "XProgress",
|
|
333
333
|
__name: "index",
|
|
334
334
|
props: {
|
|
@@ -341,19 +341,19 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
341
341
|
showText: { type: Boolean, default: !0 }
|
|
342
342
|
},
|
|
343
343
|
setup(n) {
|
|
344
|
-
const o = n, t = G("progress"), e =
|
|
344
|
+
const o = n, t = G("progress"), e = b(() => Math.min(100, Math.max(0, o.percentage))), r = b(() => ({
|
|
345
345
|
width: `${e.value}%`,
|
|
346
346
|
backgroundColor: typeof o.color == "function" ? o.color(e.value) : o.color
|
|
347
|
-
})), l =
|
|
347
|
+
})), l = b(() => [
|
|
348
348
|
t.b(),
|
|
349
349
|
t.m(o.type),
|
|
350
350
|
t.is("show-text", o.showText),
|
|
351
351
|
t.is(`status-${o.status || ""}`, o.status)
|
|
352
352
|
]);
|
|
353
|
-
return
|
|
353
|
+
return b(() => o.status === "success" ? "100%" : o.status === "warning" ? "Warning" : o.status === "exception" ? "Exception" : `${e.value}%`), (a, p) => (h(), v("div", {
|
|
354
354
|
class: u(l.value)
|
|
355
355
|
}, [
|
|
356
|
-
n.type === "line" ? (
|
|
356
|
+
n.type === "line" ? (h(), v("div", {
|
|
357
357
|
key: 0,
|
|
358
358
|
class: u(s(t).e("line"))
|
|
359
359
|
}, [
|
|
@@ -365,21 +365,21 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
365
365
|
}, [
|
|
366
366
|
m("div", {
|
|
367
367
|
class: u(s(t).e("bar")),
|
|
368
|
-
style:
|
|
368
|
+
style: O(r.value)
|
|
369
369
|
}, null, 6)
|
|
370
370
|
], 2)
|
|
371
371
|
], 2),
|
|
372
|
-
n.showText ? (
|
|
372
|
+
n.showText ? (h(), v("div", {
|
|
373
373
|
key: 0,
|
|
374
374
|
class: u(s(t).e("text"))
|
|
375
|
-
},
|
|
376
|
-
], 2)) : (
|
|
375
|
+
}, B(e.value) + "% ", 3)) : D("", !0)
|
|
376
|
+
], 2)) : (h(), v("div", {
|
|
377
377
|
key: 1,
|
|
378
378
|
class: u(s(t).e("circle"))
|
|
379
379
|
}, [
|
|
380
|
-
(
|
|
380
|
+
(h(), v("svg", {
|
|
381
381
|
viewBox: `0 0 ${n.width} ${n.width}`,
|
|
382
|
-
style:
|
|
382
|
+
style: O({ width: `${n.width}px`, height: `${n.width}px` })
|
|
383
383
|
}, [
|
|
384
384
|
m("circle", {
|
|
385
385
|
cx: n.width / 2,
|
|
@@ -388,7 +388,7 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
388
388
|
fill: "none",
|
|
389
389
|
"stroke-width": n.strokeWidth,
|
|
390
390
|
stroke: "var(--xto-fill-color, #F1F5F9)"
|
|
391
|
-
}, null, 8,
|
|
391
|
+
}, null, 8, Te),
|
|
392
392
|
m("circle", {
|
|
393
393
|
cx: n.width / 2,
|
|
394
394
|
cy: n.width / 2,
|
|
@@ -399,16 +399,16 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
399
399
|
stroke: typeof n.color == "function" ? n.color(e.value) : n.color,
|
|
400
400
|
"stroke-linecap": "round",
|
|
401
401
|
style: { transform: "rotate(-90deg)", "transform-origin": "center" }
|
|
402
|
-
}, null, 8,
|
|
403
|
-
], 12,
|
|
404
|
-
n.showText ? (
|
|
402
|
+
}, null, 8, Ve)
|
|
403
|
+
], 12, Ne)),
|
|
404
|
+
n.showText ? (h(), v("div", {
|
|
405
405
|
key: 0,
|
|
406
406
|
class: u(s(t).e("circle-text"))
|
|
407
|
-
},
|
|
407
|
+
}, B(e.value) + "% ", 3)) : D("", !0)
|
|
408
408
|
], 2))
|
|
409
409
|
], 2));
|
|
410
410
|
}
|
|
411
|
-
}),
|
|
411
|
+
}), Ee = ["disabled"], Be = ["onClick"], je = ["disabled"], Re = ["value"], Pe = ["value"], We = /* @__PURE__ */ Q({
|
|
412
412
|
name: "XPagination",
|
|
413
413
|
__name: "index",
|
|
414
414
|
props: {
|
|
@@ -420,72 +420,128 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
420
420
|
},
|
|
421
421
|
emits: ["update:currentPage", "update:pageSize", "current-change", "size-change"],
|
|
422
422
|
setup(n, { emit: o }) {
|
|
423
|
-
const t = n, e = o,
|
|
424
|
-
te(() => t.currentPage, (
|
|
425
|
-
l.value =
|
|
426
|
-
}), te(() => t.pageSize, (
|
|
427
|
-
a.value =
|
|
423
|
+
const t = n, e = o, r = G("pagination"), l = j(t.currentPage), a = j(t.pageSize);
|
|
424
|
+
te(() => t.currentPage, ($) => {
|
|
425
|
+
l.value = $;
|
|
426
|
+
}), te(() => t.pageSize, ($) => {
|
|
427
|
+
a.value = $;
|
|
428
428
|
});
|
|
429
|
-
const p =
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
for (let
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
429
|
+
const p = b(() => l.value), y = b(() => a.value), C = b(() => Math.max(1, Math.ceil(t.total / y.value))), I = b(
|
|
430
|
+
() => t.layout.split(",").map(($) => $.trim()).filter(Boolean)
|
|
431
|
+
), N = ($) => I.value.includes($), L = b(() => {
|
|
432
|
+
const $ = [], M = C.value, w = p.value;
|
|
433
|
+
if (M <= 7)
|
|
434
|
+
for (let x = 1; x <= M; x++) $.push(x);
|
|
435
|
+
else if (w <= 4) {
|
|
436
|
+
for (let x = 1; x <= 5; x++) $.push(x);
|
|
437
|
+
$.push(-1), $.push(M);
|
|
438
|
+
} else if (w >= M - 3) {
|
|
439
|
+
$.push(1), $.push(-1);
|
|
440
|
+
for (let x = M - 4; x <= M; x++) $.push(x);
|
|
439
441
|
} else {
|
|
440
|
-
|
|
441
|
-
for (let
|
|
442
|
-
|
|
442
|
+
$.push(1), $.push(-1);
|
|
443
|
+
for (let x = w - 1; x <= w + 1; x++) $.push(x);
|
|
444
|
+
$.push(-1), $.push(M);
|
|
443
445
|
}
|
|
444
|
-
return
|
|
445
|
-
}),
|
|
446
|
-
|
|
447
|
-
},
|
|
448
|
-
a.value =
|
|
446
|
+
return $;
|
|
447
|
+
}), T = ($) => {
|
|
448
|
+
$ < 1 || $ > C.value || $ === p.value || (l.value = $, e("update:currentPage", $), e("current-change", $));
|
|
449
|
+
}, K = ($) => {
|
|
450
|
+
$ !== y.value && (a.value = $, e("update:pageSize", $), e("size-change", $), l.value = 1, e("update:currentPage", 1), e("current-change", 1));
|
|
451
|
+
}, H = j(""), E = () => {
|
|
452
|
+
const $ = parseInt(H.value, 10);
|
|
453
|
+
isFinite($) && (T(Math.min(Math.max(1, $), C.value)), H.value = "");
|
|
449
454
|
};
|
|
450
|
-
return (
|
|
451
|
-
class: u(s(
|
|
455
|
+
return ($, M) => (h(), v("div", {
|
|
456
|
+
class: u(s(r).b())
|
|
452
457
|
}, [
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
+
N("total") ? (h(), v("span", {
|
|
459
|
+
key: 0,
|
|
460
|
+
class: u(s(r).e("total"))
|
|
461
|
+
}, "共 " + B(n.total) + " 条", 3)) : D("", !0),
|
|
462
|
+
N("prev") ? (h(), v("button", {
|
|
463
|
+
key: 1,
|
|
464
|
+
class: u(s(r).e("btn")),
|
|
458
465
|
disabled: p.value <= 1,
|
|
459
|
-
onClick:
|
|
460
|
-
},
|
|
461
|
-
|
|
462
|
-
|
|
466
|
+
onClick: M[0] || (M[0] = (w) => T(p.value - 1))
|
|
467
|
+
}, [...M[4] || (M[4] = [
|
|
468
|
+
m("svg", {
|
|
469
|
+
viewBox: "0 0 24 24",
|
|
470
|
+
fill: "none",
|
|
471
|
+
stroke: "currentColor",
|
|
472
|
+
"stroke-width": "2",
|
|
473
|
+
width: "12",
|
|
474
|
+
height: "12"
|
|
475
|
+
}, [
|
|
476
|
+
m("path", {
|
|
477
|
+
d: "M15 18l-6-6 6-6",
|
|
478
|
+
"stroke-linecap": "round",
|
|
479
|
+
"stroke-linejoin": "round"
|
|
480
|
+
})
|
|
481
|
+
], -1)
|
|
482
|
+
])], 10, Ee)) : D("", !0),
|
|
483
|
+
N("pager") ? (h(!0), v(F, { key: 2 }, _(L.value, (w) => (h(), v(F, { key: w }, [
|
|
484
|
+
w === -1 ? (h(), v("span", {
|
|
463
485
|
key: 0,
|
|
464
|
-
class: u(s(
|
|
465
|
-
}, "...", 2)) : (
|
|
486
|
+
class: u(s(r).e("ellipsis"))
|
|
487
|
+
}, "...", 2)) : (h(), v("button", {
|
|
466
488
|
key: 1,
|
|
467
|
-
class: u([s(
|
|
468
|
-
onClick: (
|
|
469
|
-
},
|
|
470
|
-
], 64))), 128)),
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
489
|
+
class: u([s(r).e("btn"), s(r).is("active", w === p.value)]),
|
|
490
|
+
onClick: (x) => T(w)
|
|
491
|
+
}, B(w), 11, Be))
|
|
492
|
+
], 64))), 128)) : D("", !0),
|
|
493
|
+
N("next") ? (h(), v("button", {
|
|
494
|
+
key: 3,
|
|
495
|
+
class: u(s(r).e("btn")),
|
|
496
|
+
disabled: p.value >= C.value,
|
|
497
|
+
onClick: M[1] || (M[1] = (w) => T(p.value + 1))
|
|
498
|
+
}, [...M[5] || (M[5] = [
|
|
499
|
+
m("svg", {
|
|
500
|
+
viewBox: "0 0 24 24",
|
|
501
|
+
fill: "none",
|
|
502
|
+
stroke: "currentColor",
|
|
503
|
+
"stroke-width": "2",
|
|
504
|
+
width: "12",
|
|
505
|
+
height: "12"
|
|
506
|
+
}, [
|
|
507
|
+
m("path", {
|
|
508
|
+
d: "M9 18l6-6-6-6",
|
|
509
|
+
"stroke-linecap": "round",
|
|
510
|
+
"stroke-linejoin": "round"
|
|
511
|
+
})
|
|
512
|
+
], -1)
|
|
513
|
+
])], 10, je)) : D("", !0),
|
|
514
|
+
N("sizes") ? (h(), v("select", {
|
|
515
|
+
key: 4,
|
|
516
|
+
class: u(s(r).e("sizes")),
|
|
478
517
|
value: y.value,
|
|
479
|
-
onChange:
|
|
518
|
+
onChange: M[2] || (M[2] = (w) => K(Number(w.target.value)))
|
|
519
|
+
}, [
|
|
520
|
+
(h(!0), v(F, null, _(n.pageSizes, (w) => (h(), v("option", {
|
|
521
|
+
key: w,
|
|
522
|
+
value: w
|
|
523
|
+
}, B(w) + " 条/页", 9, Pe))), 128))
|
|
524
|
+
], 42, Re)) : D("", !0),
|
|
525
|
+
N("jumper") ? (h(), v("span", {
|
|
526
|
+
key: 5,
|
|
527
|
+
class: u(s(r).e("jumper"))
|
|
480
528
|
}, [
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
529
|
+
M[6] || (M[6] = q(" 前往 ", -1)),
|
|
530
|
+
ge(m("input", {
|
|
531
|
+
class: u(s(r).e("jumper-input")),
|
|
532
|
+
type: "text",
|
|
533
|
+
inputmode: "numeric",
|
|
534
|
+
"onUpdate:modelValue": M[3] || (M[3] = (w) => H.value = w),
|
|
535
|
+
onKeyup: Ce(E, ["enter"]),
|
|
536
|
+
onBlur: E
|
|
537
|
+
}, null, 34), [
|
|
538
|
+
[ze, H.value]
|
|
539
|
+
]),
|
|
540
|
+
M[7] || (M[7] = q(" 页 ", -1))
|
|
541
|
+
], 2)) : D("", !0)
|
|
486
542
|
], 2));
|
|
487
543
|
}
|
|
488
|
-
}),
|
|
544
|
+
}), Oe = { key: 0 }, Ye = ["checked", "indeterminate"], Xe = ["onClick"], Qe = { class: "sort-arrow up" }, Ge = { class: "sort-arrow down" }, Fe = ["onClick"], Ze = ["checked", "onChange"], Ue = ["onClick"], Je = ["onClick"], qe = { key: 1 }, _e = ["colspan"], Et = /* @__PURE__ */ Q({
|
|
489
545
|
name: "XDynamicTable",
|
|
490
546
|
__name: "index",
|
|
491
547
|
props: {
|
|
@@ -508,393 +564,393 @@ const Le = ["aria-hidden", "aria-label"], De = ["stroke-width"], Ae = ["d"], Z =
|
|
|
508
564
|
},
|
|
509
565
|
emits: ["sort-change", "row-click", "row-dblclick", "selection-change", "select-all", "cell-click", "add-row", "delete-row", "update:data"],
|
|
510
566
|
setup(n, { expose: o, emit: t }) {
|
|
511
|
-
var
|
|
512
|
-
const e = n,
|
|
567
|
+
var V, i;
|
|
568
|
+
const e = n, r = t, l = G("dynamic-table");
|
|
513
569
|
me();
|
|
514
|
-
const a =
|
|
570
|
+
const a = b({
|
|
515
571
|
get: () => e.data,
|
|
516
|
-
set: (
|
|
517
|
-
}), p =
|
|
518
|
-
prop: ((
|
|
572
|
+
set: (d) => r("update:data", d)
|
|
573
|
+
}), p = j({
|
|
574
|
+
prop: ((V = e.defaultSort) == null ? void 0 : V.prop) || "",
|
|
519
575
|
order: ((i = e.defaultSort) == null ? void 0 : i.order) || null
|
|
520
|
-
}), y =
|
|
576
|
+
}), y = j([]), C = j(!1), I = j(!1), N = b(() => {
|
|
521
577
|
if (!p.value.prop || !p.value.order)
|
|
522
578
|
return a.value;
|
|
523
|
-
const { prop:
|
|
524
|
-
return [...a.value].sort((g,
|
|
525
|
-
const
|
|
526
|
-
if (
|
|
527
|
-
const
|
|
528
|
-
return
|
|
579
|
+
const { prop: d, order: f } = p.value;
|
|
580
|
+
return [...a.value].sort((g, c) => {
|
|
581
|
+
const k = g[d], S = c[d];
|
|
582
|
+
if (k === S) return 0;
|
|
583
|
+
const A = k > S ? 1 : -1;
|
|
584
|
+
return f === "ascending" ? A : -A;
|
|
529
585
|
});
|
|
530
|
-
}),
|
|
531
|
-
const
|
|
532
|
-
return e.height && (
|
|
533
|
-
}),
|
|
534
|
-
const
|
|
535
|
-
return { width:
|
|
536
|
-
}),
|
|
586
|
+
}), L = b(() => {
|
|
587
|
+
const d = {};
|
|
588
|
+
return e.height && (d.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (d.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), d;
|
|
589
|
+
}), T = b(() => {
|
|
590
|
+
const d = typeof e.operationWidth == "number" ? `${e.operationWidth}px` : e.operationWidth;
|
|
591
|
+
return { width: d, minWidth: d };
|
|
592
|
+
}), K = b(() => [
|
|
537
593
|
l.b(),
|
|
538
594
|
l.is("border", e.border),
|
|
539
595
|
l.is("stripe", e.stripe),
|
|
540
596
|
l.is("loading", e.loading)
|
|
541
|
-
]),
|
|
542
|
-
|
|
543
|
-
},
|
|
597
|
+
]), H = (d) => {
|
|
598
|
+
d.sortable && (p.value.prop === d.prop ? p.value.order === "ascending" ? p.value.order = "descending" : p.value.order === "descending" && (p.value.order = null, p.value.prop = "") : (p.value.prop = d.prop, p.value.order = "ascending"), r("sort-change", { ...p.value }));
|
|
599
|
+
}, E = (d) => d.sortable ? p.value.prop !== d.prop ? l.is("sortable") : [
|
|
544
600
|
l.is("sortable"),
|
|
545
601
|
l.is(`sort-${p.value.order}`)
|
|
546
|
-
] : "",
|
|
547
|
-
const
|
|
548
|
-
return
|
|
549
|
-
},
|
|
550
|
-
|
|
551
|
-
},
|
|
552
|
-
const
|
|
553
|
-
|
|
554
|
-
},
|
|
555
|
-
|
|
556
|
-
},
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
}, U = (
|
|
560
|
-
const
|
|
561
|
-
return
|
|
562
|
-
}, X = (
|
|
563
|
-
const
|
|
602
|
+
] : "", $ = (d, f, g) => {
|
|
603
|
+
const c = d[f.prop];
|
|
604
|
+
return f.formatter ? f.formatter(d, f, c, g) : c ?? "";
|
|
605
|
+
}, M = (d, f, g) => {
|
|
606
|
+
r("row-click", d, f, g);
|
|
607
|
+
}, w = (d, f, g) => {
|
|
608
|
+
const c = g.target;
|
|
609
|
+
r("cell-click", d, f, c, g);
|
|
610
|
+
}, x = () => {
|
|
611
|
+
C.value || I.value ? (y.value = [], C.value = !1, I.value = !1) : (y.value = [...a.value], C.value = !0, I.value = !1), r("select-all", y.value), r("selection-change", y.value);
|
|
612
|
+
}, Y = (d) => {
|
|
613
|
+
const f = y.value.findIndex((g) => typeof e.rowKey == "function" ? e.rowKey(g) === e.rowKey(d) : e.rowKey ? g[e.rowKey] === d[e.rowKey] : g === d);
|
|
614
|
+
f > -1 ? y.value.splice(f, 1) : y.value.push(d), C.value = y.value.length === a.value.length, I.value = y.value.length > 0 && y.value.length < a.value.length, r("selection-change", y.value);
|
|
615
|
+
}, U = (d) => y.value.some((f) => typeof e.rowKey == "function" ? e.rowKey(f) === e.rowKey(d) : e.rowKey ? f[e.rowKey] === d[e.rowKey] : f === d), W = (d) => {
|
|
616
|
+
const f = {};
|
|
617
|
+
return d.width && (f.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (f.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (f.textAlign = d.align), f;
|
|
618
|
+
}, X = (d) => {
|
|
619
|
+
const f = d || {};
|
|
564
620
|
e.columns.forEach((g) => {
|
|
565
|
-
|
|
566
|
-
}), a.value = [...a.value,
|
|
567
|
-
}, ae = (
|
|
568
|
-
const
|
|
569
|
-
a.value = a.value.filter((g,
|
|
621
|
+
f[g.prop] === void 0 && (f[g.prop] = "");
|
|
622
|
+
}), a.value = [...a.value, f], r("add-row", f);
|
|
623
|
+
}, ae = (d) => {
|
|
624
|
+
const f = a.value[d];
|
|
625
|
+
a.value = a.value.filter((g, c) => c !== d), r("delete-row", f, d);
|
|
570
626
|
};
|
|
571
627
|
return o({
|
|
572
628
|
clearSelection: () => {
|
|
573
|
-
y.value = [],
|
|
629
|
+
y.value = [], C.value = !1, I.value = !1;
|
|
574
630
|
},
|
|
575
631
|
getSelection: () => [...y.value],
|
|
576
632
|
sortState: p,
|
|
577
633
|
addRow: X,
|
|
578
634
|
deleteRow: ae,
|
|
579
635
|
getData: () => [...a.value]
|
|
580
|
-
}), (
|
|
581
|
-
class: u(
|
|
636
|
+
}), (d, f) => (h(), v("div", {
|
|
637
|
+
class: u(K.value)
|
|
582
638
|
}, [
|
|
583
|
-
n.showAddButton ? (
|
|
639
|
+
n.showAddButton ? (h(), v("div", {
|
|
584
640
|
key: 0,
|
|
585
641
|
class: u(s(l).e("toolbar"))
|
|
586
642
|
}, [
|
|
587
|
-
|
|
643
|
+
P(d.$slots, "toolbar", {}, () => [
|
|
588
644
|
m("button", {
|
|
589
645
|
class: u(s(l).e("add-btn")),
|
|
590
|
-
onClick:
|
|
591
|
-
}, [...
|
|
646
|
+
onClick: f[0] || (f[0] = (g) => X())
|
|
647
|
+
}, [...f[2] || (f[2] = [
|
|
592
648
|
m("span", { class: "add-icon" }, "+", -1),
|
|
593
|
-
|
|
649
|
+
q(" 新增一行 ", -1)
|
|
594
650
|
])], 2)
|
|
595
651
|
])
|
|
596
|
-
], 2)) :
|
|
597
|
-
n.loading ? (
|
|
652
|
+
], 2)) : D("", !0),
|
|
653
|
+
n.loading ? (h(), v("div", {
|
|
598
654
|
key: 1,
|
|
599
655
|
class: u(s(l).e("loading"))
|
|
600
|
-
}, [...
|
|
656
|
+
}, [...f[3] || (f[3] = [
|
|
601
657
|
m("span", { class: "loading-spinner" }, null, -1),
|
|
602
658
|
m("span", { class: "loading-text" }, "加载中...", -1)
|
|
603
|
-
])], 2)) :
|
|
659
|
+
])], 2)) : D("", !0),
|
|
604
660
|
m("div", {
|
|
605
661
|
class: u(s(l).e("wrapper")),
|
|
606
|
-
style:
|
|
662
|
+
style: O(L.value)
|
|
607
663
|
}, [
|
|
608
664
|
m("table", null, [
|
|
609
|
-
n.showHeader ? (
|
|
665
|
+
n.showHeader ? (h(), v("thead", Oe, [
|
|
610
666
|
m("tr", null, [
|
|
611
|
-
n.rowKey ? (
|
|
667
|
+
n.rowKey ? (h(), v("th", {
|
|
612
668
|
key: 0,
|
|
613
669
|
class: u([s(l).e("header-cell"), s(l).e("selection-cell")])
|
|
614
670
|
}, [
|
|
615
671
|
m("input", {
|
|
616
672
|
type: "checkbox",
|
|
617
|
-
checked:
|
|
618
|
-
indeterminate:
|
|
619
|
-
onChange:
|
|
620
|
-
}, null, 40,
|
|
621
|
-
], 2)) :
|
|
622
|
-
n.showIndex ? (
|
|
673
|
+
checked: C.value,
|
|
674
|
+
indeterminate: I.value,
|
|
675
|
+
onChange: x
|
|
676
|
+
}, null, 40, Ye)
|
|
677
|
+
], 2)) : D("", !0),
|
|
678
|
+
n.showIndex ? (h(), v("th", {
|
|
623
679
|
key: 1,
|
|
624
680
|
class: u(s(l).e("header-cell")),
|
|
625
681
|
style: { width: "60px" }
|
|
626
|
-
}, " 序号 ", 2)) :
|
|
627
|
-
(
|
|
682
|
+
}, " 序号 ", 2)) : D("", !0),
|
|
683
|
+
(h(!0), v(F, null, _(n.columns, (g) => (h(), v("th", {
|
|
628
684
|
key: g.prop,
|
|
629
|
-
class: u([s(l).e("header-cell"),
|
|
630
|
-
style: W(
|
|
631
|
-
onClick: (
|
|
685
|
+
class: u([s(l).e("header-cell"), E(g)]),
|
|
686
|
+
style: O(W(g)),
|
|
687
|
+
onClick: (c) => H(g)
|
|
632
688
|
}, [
|
|
633
|
-
m("span", null,
|
|
634
|
-
g.sortable ? (
|
|
689
|
+
m("span", null, B(g.label), 1),
|
|
690
|
+
g.sortable ? (h(), v("span", {
|
|
635
691
|
key: 0,
|
|
636
692
|
class: u(s(l).e("sort-icon"))
|
|
637
693
|
}, [
|
|
638
|
-
m("span",
|
|
694
|
+
m("span", Qe, [
|
|
639
695
|
J(s(Z), {
|
|
640
696
|
name: "sort-up",
|
|
641
697
|
size: 12
|
|
642
698
|
})
|
|
643
699
|
]),
|
|
644
|
-
m("span",
|
|
700
|
+
m("span", Ge, [
|
|
645
701
|
J(s(Z), {
|
|
646
702
|
name: "sort-down",
|
|
647
703
|
size: 12
|
|
648
704
|
})
|
|
649
705
|
])
|
|
650
|
-
], 2)) :
|
|
651
|
-
], 14,
|
|
652
|
-
n.showOperation ? (
|
|
706
|
+
], 2)) : D("", !0)
|
|
707
|
+
], 14, Xe))), 128)),
|
|
708
|
+
n.showOperation ? (h(), v("th", {
|
|
653
709
|
key: 2,
|
|
654
710
|
class: u(s(l).e("header-cell")),
|
|
655
|
-
style:
|
|
656
|
-
},
|
|
711
|
+
style: O(T.value)
|
|
712
|
+
}, B(n.operationLabel), 7)) : D("", !0)
|
|
657
713
|
])
|
|
658
|
-
])) :
|
|
714
|
+
])) : D("", !0),
|
|
659
715
|
m("tbody", null, [
|
|
660
|
-
(
|
|
661
|
-
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(g) : g[n.rowKey] :
|
|
716
|
+
(h(!0), v(F, null, _(N.value, (g, c) => (h(), v("tr", {
|
|
717
|
+
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(g) : g[n.rowKey] : c,
|
|
662
718
|
class: u([s(l).e("row"), s(l).is("selected", U(g))]),
|
|
663
|
-
onClick: (
|
|
719
|
+
onClick: (k) => M(g, n.columns[0], k)
|
|
664
720
|
}, [
|
|
665
|
-
n.rowKey ? (
|
|
721
|
+
n.rowKey ? (h(), v("td", {
|
|
666
722
|
key: 0,
|
|
667
723
|
class: u(s(l).e("cell"))
|
|
668
724
|
}, [
|
|
669
725
|
m("input", {
|
|
670
726
|
type: "checkbox",
|
|
671
727
|
checked: U(g),
|
|
672
|
-
onClick:
|
|
728
|
+
onClick: f[1] || (f[1] = re(() => {
|
|
673
729
|
}, ["stop"])),
|
|
674
|
-
onChange: (
|
|
675
|
-
}, null, 40,
|
|
676
|
-
], 2)) :
|
|
677
|
-
n.showIndex ? (
|
|
730
|
+
onChange: (k) => Y(g)
|
|
731
|
+
}, null, 40, Ze)
|
|
732
|
+
], 2)) : D("", !0),
|
|
733
|
+
n.showIndex ? (h(), v("td", {
|
|
678
734
|
key: 1,
|
|
679
735
|
class: u(s(l).e("cell"))
|
|
680
|
-
},
|
|
681
|
-
(
|
|
682
|
-
key:
|
|
736
|
+
}, B(c + 1), 3)) : D("", !0),
|
|
737
|
+
(h(!0), v(F, null, _(n.columns, (k) => (h(), v("td", {
|
|
738
|
+
key: k.prop,
|
|
683
739
|
class: u(s(l).e("cell")),
|
|
684
|
-
style: W(
|
|
685
|
-
onClick: (S) =>
|
|
740
|
+
style: O(W(k)),
|
|
741
|
+
onClick: (S) => w(g, k, S)
|
|
686
742
|
}, [
|
|
687
|
-
|
|
743
|
+
P(d.$slots, `column-${k.prop}`, {
|
|
688
744
|
row: g,
|
|
689
|
-
column:
|
|
690
|
-
$index:
|
|
745
|
+
column: k,
|
|
746
|
+
$index: c
|
|
691
747
|
}, () => [
|
|
692
|
-
|
|
748
|
+
q(B($(g, k, c)), 1)
|
|
693
749
|
])
|
|
694
|
-
], 14,
|
|
695
|
-
n.showOperation ? (
|
|
750
|
+
], 14, Ue))), 128)),
|
|
751
|
+
n.showOperation ? (h(), v("td", {
|
|
696
752
|
key: 2,
|
|
697
753
|
class: u([s(l).e("cell"), s(l).e("operation-cell")])
|
|
698
754
|
}, [
|
|
699
|
-
|
|
755
|
+
P(d.$slots, "operation", {
|
|
700
756
|
row: g,
|
|
701
|
-
$index:
|
|
702
|
-
deleteRow: () => ae(
|
|
757
|
+
$index: c,
|
|
758
|
+
deleteRow: () => ae(c)
|
|
703
759
|
}, () => [
|
|
704
760
|
m("button", {
|
|
705
761
|
class: u(s(l).e("operation-btn")),
|
|
706
|
-
onClick: re((
|
|
707
|
-
}, " 删除 ", 10,
|
|
762
|
+
onClick: re((k) => ae(c), ["stop"])
|
|
763
|
+
}, " 删除 ", 10, Je)
|
|
708
764
|
])
|
|
709
|
-
], 2)) :
|
|
710
|
-
], 10,
|
|
765
|
+
], 2)) : D("", !0)
|
|
766
|
+
], 10, Fe))), 128))
|
|
711
767
|
]),
|
|
712
|
-
|
|
768
|
+
N.value.length === 0 && !n.loading ? (h(), v("tbody", qe, [
|
|
713
769
|
m("tr", null, [
|
|
714
770
|
m("td", {
|
|
715
771
|
colspan: n.columns.length + (n.rowKey ? 1 : 0) + (n.showIndex ? 1 : 0) + (n.showOperation ? 1 : 0),
|
|
716
772
|
class: u(s(l).e("empty"))
|
|
717
773
|
}, [
|
|
718
|
-
|
|
719
|
-
|
|
774
|
+
P(d.$slots, "empty", {}, () => [
|
|
775
|
+
q(B(n.emptyText), 1)
|
|
720
776
|
])
|
|
721
|
-
], 10,
|
|
777
|
+
], 10, _e)
|
|
722
778
|
])
|
|
723
|
-
])) :
|
|
779
|
+
])) : D("", !0)
|
|
724
780
|
])
|
|
725
781
|
], 6)
|
|
726
782
|
], 2));
|
|
727
783
|
}
|
|
728
|
-
}),
|
|
784
|
+
}), et = ["draggable"], tt = {
|
|
729
785
|
key: 0,
|
|
730
786
|
class: "x-tree-node__loading-icon"
|
|
731
|
-
},
|
|
787
|
+
}, at = {
|
|
732
788
|
key: 0,
|
|
733
789
|
class: "x-tree-node__expand-arrow"
|
|
734
|
-
},
|
|
790
|
+
}, lt = {
|
|
735
791
|
key: 0,
|
|
736
792
|
class: "x-tree-node__icon"
|
|
737
|
-
},
|
|
793
|
+
}, nt = { class: "x-tree-node__label" }, st = /* @__PURE__ */ Q({
|
|
738
794
|
name: "XTreeNode",
|
|
739
795
|
__name: "tree-node",
|
|
740
796
|
props: {
|
|
741
797
|
node: {}
|
|
742
798
|
},
|
|
743
799
|
setup(n) {
|
|
744
|
-
const o = n, t = ue("tree"), { props: e, store:
|
|
800
|
+
const o = n, t = ue("tree"), { props: e, store: r, toggleExpand: l, toggleCheck: a, handleNodeClick: p, handleNodeContextmenu: y } = t, C = j(), I = j(null), N = b(() => o.node.expanded), L = b(() => o.node.checked), T = b(() => o.node.indeterminate), K = b(() => o.node.disabled), H = b(() => o.node.loading), E = b(() => o.node.isLeaf), $ = b(() => e.showCheckbox || e.checkable), M = b(() => o.node.selected), w = b(() => ({
|
|
745
801
|
paddingLeft: `${o.node.level * (e.indent || 16)}px`
|
|
746
|
-
})),
|
|
802
|
+
})), x = (i) => {
|
|
747
803
|
p(o.node, i);
|
|
748
|
-
},
|
|
804
|
+
}, Y = (i) => {
|
|
749
805
|
y(o.node, i);
|
|
750
806
|
}, U = (i) => {
|
|
751
|
-
i.stopPropagation(),
|
|
752
|
-
},
|
|
753
|
-
i.stopPropagation(),
|
|
807
|
+
i.stopPropagation(), K.value || l(o.node);
|
|
808
|
+
}, W = (i) => {
|
|
809
|
+
i.stopPropagation(), K.value || a(o.node);
|
|
754
810
|
}, X = (i) => {
|
|
755
|
-
var
|
|
756
|
-
if (!(!e.draggable ||
|
|
811
|
+
var d;
|
|
812
|
+
if (!(!e.draggable || K.value)) {
|
|
757
813
|
if (e.allowDrag && !e.allowDrag(o.node)) {
|
|
758
814
|
i.preventDefault();
|
|
759
815
|
return;
|
|
760
816
|
}
|
|
761
|
-
i.dataTransfer.effectAllowed = "move", i.dataTransfer.setData("nodeKey", String(o.node.key)), (
|
|
817
|
+
i.dataTransfer.effectAllowed = "move", i.dataTransfer.setData("nodeKey", String(o.node.key)), (d = t.emit) == null || d.call(t, "node-drag-start", o.node, i);
|
|
762
818
|
}
|
|
763
819
|
}, ae = (i) => {
|
|
764
|
-
var
|
|
765
|
-
i.preventDefault(), e.draggable && (
|
|
820
|
+
var d;
|
|
821
|
+
i.preventDefault(), e.draggable && (I.value = "inner", (d = t.emit) == null || d.call(t, "node-drag-enter", o.node, i));
|
|
766
822
|
}, oe = (i) => {
|
|
767
|
-
var
|
|
768
|
-
|
|
769
|
-
},
|
|
770
|
-
var
|
|
771
|
-
if (i.preventDefault(), !e.draggable ||
|
|
772
|
-
const
|
|
773
|
-
if (!
|
|
774
|
-
const
|
|
775
|
-
|
|
776
|
-
},
|
|
777
|
-
var
|
|
823
|
+
var d;
|
|
824
|
+
I.value = null, (d = t.emit) == null || d.call(t, "node-drag-leave", o.node, i);
|
|
825
|
+
}, ee = (i) => {
|
|
826
|
+
var c, k;
|
|
827
|
+
if (i.preventDefault(), !e.draggable || K.value) return;
|
|
828
|
+
const d = (c = C.value) == null ? void 0 : c.getBoundingClientRect();
|
|
829
|
+
if (!d) return;
|
|
830
|
+
const f = i.clientY - d.top, g = d.height;
|
|
831
|
+
f < g * 0.25 ? I.value = "prev" : f > g * 0.75 ? I.value = "next" : I.value = "inner", (k = t.emit) == null || k.call(t, "node-drag-over", o.node, i);
|
|
832
|
+
}, z = (i) => {
|
|
833
|
+
var f, g;
|
|
778
834
|
if (i.preventDefault(), !e.draggable) return;
|
|
779
|
-
const
|
|
780
|
-
if (
|
|
781
|
-
const
|
|
782
|
-
if (
|
|
783
|
-
if (e.allowDrop && !e.allowDrop(
|
|
784
|
-
|
|
835
|
+
const d = (f = i.dataTransfer) == null ? void 0 : f.getData("nodeKey");
|
|
836
|
+
if (d) {
|
|
837
|
+
const c = r.nodesMap.get(d);
|
|
838
|
+
if (c && I.value) {
|
|
839
|
+
if (e.allowDrop && !e.allowDrop(c, o.node, I.value)) {
|
|
840
|
+
I.value = null;
|
|
785
841
|
return;
|
|
786
842
|
}
|
|
787
|
-
(g = t.emit) == null || g.call(t, "node-drop",
|
|
843
|
+
(g = t.emit) == null || g.call(t, "node-drop", c, o.node, I.value, i);
|
|
788
844
|
}
|
|
789
845
|
}
|
|
790
|
-
|
|
791
|
-
},
|
|
792
|
-
var
|
|
793
|
-
|
|
846
|
+
I.value = null;
|
|
847
|
+
}, V = (i) => {
|
|
848
|
+
var d;
|
|
849
|
+
I.value = null, (d = t.emit) == null || d.call(t, "node-drag-end", o.node, i);
|
|
794
850
|
};
|
|
795
|
-
return (i,
|
|
851
|
+
return (i, d) => {
|
|
796
852
|
var g;
|
|
797
|
-
const
|
|
798
|
-
return
|
|
853
|
+
const f = Ie("TreeNode", !0);
|
|
854
|
+
return ge((h(), v("div", {
|
|
799
855
|
ref_key: "nodeRef",
|
|
800
|
-
ref:
|
|
856
|
+
ref: C,
|
|
801
857
|
class: u(["x-tree-node", {
|
|
802
|
-
"is-expanded":
|
|
858
|
+
"is-expanded": N.value,
|
|
803
859
|
"is-current": i.isCurrent,
|
|
804
|
-
"is-selected":
|
|
805
|
-
"is-disabled":
|
|
806
|
-
"is-drop-inner":
|
|
807
|
-
"is-drop-prev":
|
|
808
|
-
"is-drop-next":
|
|
860
|
+
"is-selected": M.value,
|
|
861
|
+
"is-disabled": K.value,
|
|
862
|
+
"is-drop-inner": I.value === "inner",
|
|
863
|
+
"is-drop-prev": I.value === "prev",
|
|
864
|
+
"is-drop-next": I.value === "next"
|
|
809
865
|
}]),
|
|
810
|
-
draggable: s(e).draggable && !
|
|
866
|
+
draggable: s(e).draggable && !K.value,
|
|
811
867
|
onDragstart: X,
|
|
812
868
|
onDragenter: ae,
|
|
813
869
|
onDragleave: oe,
|
|
814
|
-
onDragover:
|
|
815
|
-
onDrop:
|
|
816
|
-
onDragend:
|
|
870
|
+
onDragover: ee,
|
|
871
|
+
onDrop: z,
|
|
872
|
+
onDragend: V
|
|
817
873
|
}, [
|
|
818
874
|
m("div", {
|
|
819
875
|
class: "x-tree-node__content",
|
|
820
|
-
style:
|
|
821
|
-
onClick:
|
|
822
|
-
onContextmenu:
|
|
876
|
+
style: O(w.value),
|
|
877
|
+
onClick: x,
|
|
878
|
+
onContextmenu: Y
|
|
823
879
|
}, [
|
|
824
880
|
m("span", {
|
|
825
881
|
class: u(["x-tree-node__expand-icon", {
|
|
826
|
-
"is-expanded":
|
|
827
|
-
"is-leaf":
|
|
828
|
-
"is-loading":
|
|
882
|
+
"is-expanded": N.value,
|
|
883
|
+
"is-leaf": E.value,
|
|
884
|
+
"is-loading": H.value
|
|
829
885
|
}]),
|
|
830
886
|
onClick: U
|
|
831
887
|
}, [
|
|
832
|
-
|
|
833
|
-
|
|
888
|
+
H.value ? (h(), v("span", tt)) : (h(), v(F, { key: 1 }, [
|
|
889
|
+
E.value ? D("", !0) : (h(), v("span", at))
|
|
834
890
|
], 64))
|
|
835
891
|
], 2),
|
|
836
|
-
n.node.icon || s(e).icon ? (
|
|
837
|
-
|
|
892
|
+
n.node.icon || s(e).icon ? (h(), v("span", lt, B(n.node.icon || s(e).icon), 1)) : D("", !0),
|
|
893
|
+
$.value ? (h(), v("span", {
|
|
838
894
|
key: 1,
|
|
839
895
|
class: u(["x-tree-node__checkbox", {
|
|
840
|
-
"is-checked":
|
|
841
|
-
"is-indeterminate":
|
|
842
|
-
"is-disabled":
|
|
896
|
+
"is-checked": L.value,
|
|
897
|
+
"is-indeterminate": T.value,
|
|
898
|
+
"is-disabled": K.value
|
|
843
899
|
}]),
|
|
844
|
-
onClick: re(
|
|
900
|
+
onClick: re(W, ["stop"])
|
|
845
901
|
}, [
|
|
846
|
-
|
|
902
|
+
L.value ? (h(), se(s(Z), {
|
|
847
903
|
key: 0,
|
|
848
904
|
name: "check",
|
|
849
905
|
size: 12,
|
|
850
906
|
class: "x-tree-node__checkbox-icon"
|
|
851
|
-
})) :
|
|
907
|
+
})) : T.value ? (h(), se(s(Z), {
|
|
852
908
|
key: 1,
|
|
853
909
|
name: "minus",
|
|
854
910
|
size: 12,
|
|
855
911
|
class: "x-tree-node__checkbox-icon"
|
|
856
|
-
})) :
|
|
857
|
-
], 2)) :
|
|
858
|
-
m("span",
|
|
859
|
-
|
|
912
|
+
})) : D("", !0)
|
|
913
|
+
], 2)) : D("", !0),
|
|
914
|
+
m("span", nt, [
|
|
915
|
+
P(i.$slots, "default", {
|
|
860
916
|
node: n.node,
|
|
861
917
|
data: n.node.data
|
|
862
918
|
}, () => [
|
|
863
|
-
|
|
919
|
+
q(B(n.node.label), 1)
|
|
864
920
|
])
|
|
865
921
|
])
|
|
866
922
|
], 36),
|
|
867
|
-
!
|
|
923
|
+
!E.value && N.value ? (h(), v("div", {
|
|
868
924
|
key: 0,
|
|
869
925
|
class: u(["x-tree-node__children", { "x-tree-node__children--show-line": s(e).showLine }])
|
|
870
926
|
}, [
|
|
871
|
-
!s(e).renderAfterExpand ||
|
|
872
|
-
key:
|
|
873
|
-
node:
|
|
927
|
+
!s(e).renderAfterExpand || N.value ? (h(!0), v(F, { key: 0 }, _(n.node.children, (c) => (h(), se(f, {
|
|
928
|
+
key: c.key,
|
|
929
|
+
node: c
|
|
874
930
|
}, {
|
|
875
|
-
default:
|
|
876
|
-
|
|
877
|
-
node:
|
|
878
|
-
data:
|
|
931
|
+
default: ye((k) => [
|
|
932
|
+
P(i.$slots, "default", {
|
|
933
|
+
node: k.node,
|
|
934
|
+
data: k.data
|
|
879
935
|
})
|
|
880
936
|
]),
|
|
881
937
|
_: 3
|
|
882
|
-
}, 8, ["node"]))), 128)) :
|
|
883
|
-
], 2)) :
|
|
884
|
-
], 42,
|
|
938
|
+
}, 8, ["node"]))), 128)) : D("", !0)
|
|
939
|
+
], 2)) : D("", !0)
|
|
940
|
+
], 42, et)), [
|
|
885
941
|
[Me, n.node.visible && (((g = n.node.parent) == null ? void 0 : g.expanded) ?? !0)]
|
|
886
942
|
]);
|
|
887
943
|
};
|
|
888
944
|
}
|
|
889
945
|
});
|
|
890
946
|
class ie {
|
|
891
|
-
constructor(o, t, e = 0,
|
|
892
|
-
this.data = o, this.store = t, this.level = e, this.parent =
|
|
893
|
-
const l = t.props || {}, a = l.value || "value", p = l.label || "label", y = l.disabled || "disabled",
|
|
894
|
-
this.key = o[a] ?? o.value ?? o.id ?? Math.random().toString(), this.label = o[p] ?? o.label ?? "", this.disabled = o[y] ?? o.disabled ?? !1, this.isLeaf = o[
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
(
|
|
947
|
+
constructor(o, t, e = 0, r = null) {
|
|
948
|
+
this.data = o, this.store = t, this.level = e, this.parent = r, this.children = [], this.expanded = !1, this.selected = !1, this.checked = !1, this.indeterminate = !1, this.loading = !1, this.visible = !0, this.loaded = !1;
|
|
949
|
+
const l = t.props || {}, a = l.value || "value", p = l.label || "label", y = l.disabled || "disabled", C = l.isLeaf || "isLeaf";
|
|
950
|
+
this.key = o[a] ?? o.value ?? o.id ?? Math.random().toString(), this.label = o[p] ?? o.label ?? "", this.disabled = o[y] ?? o.disabled ?? !1, this.isLeaf = o[C] ?? o.isLeaf ?? !1;
|
|
951
|
+
const I = l.children || "children", N = o[I] ?? o.children ?? [];
|
|
952
|
+
N.length > 0 ? this.children = N.map(
|
|
953
|
+
(L) => new ie(L, t, e + 1, this)
|
|
898
954
|
) : this.isLeaf = !0;
|
|
899
955
|
}
|
|
900
956
|
/** 设置展开状态 */
|
|
@@ -912,8 +968,8 @@ class ie {
|
|
|
912
968
|
/** 更新子节点勾选状态 */
|
|
913
969
|
updateChildrenChecked(o) {
|
|
914
970
|
const t = (e) => {
|
|
915
|
-
e.children.forEach((
|
|
916
|
-
|
|
971
|
+
e.children.forEach((r) => {
|
|
972
|
+
r.disabled || (r.checked = o, r.indeterminate = !1, o ? (this.store.checkedKeys.add(r.key), this.store.indeterminateKeys.delete(r.key)) : (this.store.checkedKeys.delete(r.key), this.store.indeterminateKeys.delete(r.key)), t(r));
|
|
917
973
|
});
|
|
918
974
|
};
|
|
919
975
|
t(this);
|
|
@@ -927,8 +983,8 @@ class ie {
|
|
|
927
983
|
o = o.parent;
|
|
928
984
|
continue;
|
|
929
985
|
}
|
|
930
|
-
const e = t.every((l) => l.checked),
|
|
931
|
-
e ? (o.checked = !0, o.indeterminate = !1, this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) :
|
|
986
|
+
const e = t.every((l) => l.checked), r = t.some((l) => l.checked || l.indeterminate);
|
|
987
|
+
e ? (o.checked = !0, o.indeterminate = !1, this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) : r ? (o.checked = !1, o.indeterminate = !0, this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.add(o.key)) : (o.checked = !1, o.indeterminate = !1, this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.delete(o.key)), o = o.parent;
|
|
932
988
|
}
|
|
933
989
|
}
|
|
934
990
|
/** 展开/收起 */
|
|
@@ -954,14 +1010,14 @@ class ie {
|
|
|
954
1010
|
/** 获取所有子节点的 key */
|
|
955
1011
|
getChildrenKeys() {
|
|
956
1012
|
const o = [], t = (e) => {
|
|
957
|
-
e.forEach((
|
|
958
|
-
o.push(
|
|
1013
|
+
e.forEach((r) => {
|
|
1014
|
+
o.push(r.key), r.children.length && t(r.children);
|
|
959
1015
|
});
|
|
960
1016
|
};
|
|
961
1017
|
return t(this.children), o;
|
|
962
1018
|
}
|
|
963
1019
|
}
|
|
964
|
-
const
|
|
1020
|
+
const Bt = /* @__PURE__ */ Q({
|
|
965
1021
|
name: "XTree",
|
|
966
1022
|
__name: "index",
|
|
967
1023
|
props: {
|
|
@@ -1003,7 +1059,7 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1003
1059
|
},
|
|
1004
1060
|
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"],
|
|
1005
1061
|
setup(n, { expose: o, emit: t }) {
|
|
1006
|
-
const e = n,
|
|
1062
|
+
const e = n, r = t, l = G("tree"), a = ke({
|
|
1007
1063
|
nodesMap: /* @__PURE__ */ new Map(),
|
|
1008
1064
|
rootNodes: [],
|
|
1009
1065
|
expandedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -1012,258 +1068,258 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1012
1068
|
indeterminateKeys: /* @__PURE__ */ new Set(),
|
|
1013
1069
|
currentKey: null,
|
|
1014
1070
|
filterValue: ""
|
|
1015
|
-
}), p =
|
|
1071
|
+
}), p = j(""), y = () => e.fieldNames ? {
|
|
1016
1072
|
value: e.fieldNames.key || "value",
|
|
1017
1073
|
label: e.fieldNames.title || e.fieldNames.key || "label",
|
|
1018
1074
|
children: e.fieldNames.children || "children",
|
|
1019
1075
|
disabled: e.fieldNames.disabled || "disabled",
|
|
1020
1076
|
isLeaf: e.fieldNames.isLeaf || "isLeaf"
|
|
1021
|
-
} : e.props,
|
|
1077
|
+
} : e.props, C = () => e.treeData || e.data || [];
|
|
1022
1078
|
a.props = y();
|
|
1023
|
-
const
|
|
1079
|
+
const I = (i) => {
|
|
1024
1080
|
if (a.nodesMap.clear(), a.rootNodes = [], a.checkedKeys.clear(), a.indeterminateKeys.clear(), !i || !i.length) return;
|
|
1025
|
-
const
|
|
1026
|
-
const S = new ie(g, a,
|
|
1081
|
+
const d = y(), f = (g, c, k) => {
|
|
1082
|
+
const S = new ie(g, a, c, k);
|
|
1027
1083
|
a.nodesMap.set(S.key, S);
|
|
1028
|
-
const
|
|
1029
|
-
return
|
|
1030
|
-
(le) =>
|
|
1084
|
+
const A = (d == null ? void 0 : d.children) || "children", R = g[A] ?? g.children ?? [];
|
|
1085
|
+
return R.length > 0 && (S.children = R.map(
|
|
1086
|
+
(le) => f(le, c + 1, S)
|
|
1031
1087
|
), S.isLeaf = !1), S;
|
|
1032
1088
|
};
|
|
1033
|
-
a.rootNodes = i.map((g) =>
|
|
1034
|
-
},
|
|
1035
|
-
var i,
|
|
1036
|
-
e.defaultExpandAll ?
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
}), (
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
}), (
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1089
|
+
a.rootNodes = i.map((g) => f(g, 0, null)), N();
|
|
1090
|
+
}, N = () => {
|
|
1091
|
+
var i, d, f;
|
|
1092
|
+
e.defaultExpandAll ? L() : (i = e.defaultExpandedKeys) != null && i.length && e.defaultExpandedKeys.forEach((g) => {
|
|
1093
|
+
const c = a.nodesMap.get(g);
|
|
1094
|
+
c && (c.expanded = !0, a.expandedKeys.add(g));
|
|
1095
|
+
}), (d = e.defaultCheckedKeys) != null && d.length && e.defaultCheckedKeys.forEach((g) => {
|
|
1096
|
+
const c = a.nodesMap.get(g);
|
|
1097
|
+
c && c.setChecked(!0, !e.checkStrictly);
|
|
1098
|
+
}), (f = e.checkedKeys) != null && f.length && e.checkedKeys.forEach((g) => {
|
|
1099
|
+
const c = a.nodesMap.get(g);
|
|
1100
|
+
c && c.setChecked(!0, !e.checkStrictly);
|
|
1045
1101
|
});
|
|
1046
|
-
},
|
|
1102
|
+
}, L = () => {
|
|
1047
1103
|
a.nodesMap.forEach((i) => {
|
|
1048
1104
|
i.children.length > 0 && (i.expanded = !0, a.expandedKeys.add(i.key));
|
|
1049
1105
|
});
|
|
1050
|
-
},
|
|
1106
|
+
}, T = () => {
|
|
1051
1107
|
a.nodesMap.forEach((i) => {
|
|
1052
1108
|
i.expanded = !1;
|
|
1053
1109
|
}), a.expandedKeys.clear();
|
|
1054
|
-
},
|
|
1110
|
+
}, K = (i) => {
|
|
1055
1111
|
if (i.disabled) return;
|
|
1056
|
-
!i.expanded ? (i.expanded = !0, a.expandedKeys.add(i.key),
|
|
1057
|
-
},
|
|
1112
|
+
!i.expanded ? (i.expanded = !0, a.expandedKeys.add(i.key), r("node-expand", i.data, i, null)) : (i.expanded = !1, a.expandedKeys.delete(i.key), r("node-collapse", i.data, i, null));
|
|
1113
|
+
}, H = (i, d) => {
|
|
1058
1114
|
if (i.disabled) return;
|
|
1059
|
-
const
|
|
1060
|
-
i.setChecked(
|
|
1061
|
-
const g = [],
|
|
1062
|
-
a.nodesMap.forEach((
|
|
1063
|
-
|
|
1064
|
-
}),
|
|
1115
|
+
const f = d ?? !i.checked;
|
|
1116
|
+
i.setChecked(f, !e.checkStrictly), r("check-change", i.data, i.checked, i.indeterminate);
|
|
1117
|
+
const g = [], c = [], k = [], S = [];
|
|
1118
|
+
a.nodesMap.forEach((A) => {
|
|
1119
|
+
A.checked && (g.push(A.data), c.push(A.key)), A.indeterminate && (k.push(A.data), S.push(A.key));
|
|
1120
|
+
}), r("check", i.data, {
|
|
1065
1121
|
checkedNodes: g,
|
|
1066
|
-
checkedKeys:
|
|
1067
|
-
halfCheckedNodes:
|
|
1122
|
+
checkedKeys: c,
|
|
1123
|
+
halfCheckedNodes: k,
|
|
1068
1124
|
halfCheckedKeys: S
|
|
1069
1125
|
});
|
|
1070
|
-
},
|
|
1071
|
-
i.disabled || (
|
|
1072
|
-
},
|
|
1126
|
+
}, E = (i, d) => {
|
|
1127
|
+
i.disabled || (r("node-click", i.data, i, null), e.expandOnClickNode && i.children.length > 0 && K(i), e.highlightCurrent && (a.currentKey = i.key, r("current-change", i.data, i)));
|
|
1128
|
+
}, $ = (i) => {
|
|
1073
1129
|
if (p.value = i, a.filterValue = i, !i) {
|
|
1074
|
-
a.nodesMap.forEach((
|
|
1075
|
-
|
|
1130
|
+
a.nodesMap.forEach((d) => {
|
|
1131
|
+
d.visible = !0;
|
|
1076
1132
|
});
|
|
1077
1133
|
return;
|
|
1078
1134
|
}
|
|
1079
|
-
a.nodesMap.forEach((
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1082
|
-
}), a.nodesMap.forEach((
|
|
1083
|
-
if (
|
|
1084
|
-
let
|
|
1085
|
-
for (;
|
|
1086
|
-
|
|
1135
|
+
a.nodesMap.forEach((d) => {
|
|
1136
|
+
const f = d.label || "";
|
|
1137
|
+
d.visible = String(f).toLowerCase().includes(i.toLowerCase());
|
|
1138
|
+
}), a.nodesMap.forEach((d) => {
|
|
1139
|
+
if (d.visible && d.parent) {
|
|
1140
|
+
let f = d.parent;
|
|
1141
|
+
for (; f; )
|
|
1142
|
+
f.visible = !0, f.expanded = !0, a.expandedKeys.add(f.key), f = f.parent;
|
|
1087
1143
|
}
|
|
1088
1144
|
});
|
|
1089
|
-
},
|
|
1145
|
+
}, M = (i) => a.nodesMap.get(i), w = (i) => {
|
|
1090
1146
|
a.currentKey = i;
|
|
1091
|
-
},
|
|
1147
|
+
}, x = () => {
|
|
1092
1148
|
if (a.currentKey)
|
|
1093
1149
|
return a.nodesMap.get(a.currentKey);
|
|
1094
|
-
},
|
|
1095
|
-
const
|
|
1096
|
-
return a.nodesMap.forEach((
|
|
1097
|
-
|
|
1098
|
-
}),
|
|
1150
|
+
}, Y = (i = !1) => {
|
|
1151
|
+
const d = [];
|
|
1152
|
+
return a.nodesMap.forEach((f) => {
|
|
1153
|
+
f.checked && (!i || f.isLeaf) && d.push(f.data);
|
|
1154
|
+
}), d;
|
|
1099
1155
|
}, U = (i = !1) => {
|
|
1100
|
-
const
|
|
1101
|
-
return a.nodesMap.forEach((
|
|
1102
|
-
|
|
1103
|
-
}),
|
|
1104
|
-
},
|
|
1105
|
-
a.nodesMap.forEach((
|
|
1106
|
-
|
|
1107
|
-
}), a.checkedKeys.clear(), a.indeterminateKeys.clear(), i.forEach((
|
|
1108
|
-
const
|
|
1109
|
-
|
|
1156
|
+
const d = [];
|
|
1157
|
+
return a.nodesMap.forEach((f) => {
|
|
1158
|
+
f.checked && (!i || f.isLeaf) && d.push(f.key);
|
|
1159
|
+
}), d;
|
|
1160
|
+
}, W = (i) => {
|
|
1161
|
+
a.nodesMap.forEach((d) => {
|
|
1162
|
+
d.checked = !1, d.indeterminate = !1;
|
|
1163
|
+
}), a.checkedKeys.clear(), a.indeterminateKeys.clear(), i.forEach((d) => {
|
|
1164
|
+
const f = a.nodesMap.get(d);
|
|
1165
|
+
f && f.setChecked(!0, !e.checkStrictly);
|
|
1110
1166
|
});
|
|
1111
1167
|
}, X = () => {
|
|
1112
1168
|
const i = [];
|
|
1113
|
-
return a.nodesMap.forEach((
|
|
1114
|
-
|
|
1169
|
+
return a.nodesMap.forEach((d) => {
|
|
1170
|
+
d.indeterminate && i.push(d.data);
|
|
1115
1171
|
}), i;
|
|
1116
1172
|
}, ae = () => {
|
|
1117
1173
|
const i = [];
|
|
1118
|
-
return a.nodesMap.forEach((
|
|
1119
|
-
|
|
1174
|
+
return a.nodesMap.forEach((d) => {
|
|
1175
|
+
d.indeterminate && i.push(d.key);
|
|
1120
1176
|
}), i;
|
|
1121
|
-
}, oe = (i,
|
|
1177
|
+
}, oe = (i, d, f = !0) => {
|
|
1122
1178
|
const g = a.nodesMap.get(i);
|
|
1123
|
-
g && g.setChecked(
|
|
1124
|
-
},
|
|
1179
|
+
g && g.setChecked(d, f && !e.checkStrictly);
|
|
1180
|
+
}, ee = () => {
|
|
1125
1181
|
const i = [];
|
|
1126
|
-
return a.nodesMap.forEach((
|
|
1127
|
-
|
|
1182
|
+
return a.nodesMap.forEach((d) => {
|
|
1183
|
+
d.selected && i.push(d.data);
|
|
1128
1184
|
}), i;
|
|
1129
|
-
},
|
|
1130
|
-
a.nodesMap.forEach((
|
|
1131
|
-
|
|
1132
|
-
}), a.selectedKeys.clear(), i.forEach((
|
|
1133
|
-
const
|
|
1134
|
-
|
|
1185
|
+
}, z = (i) => {
|
|
1186
|
+
a.nodesMap.forEach((d) => {
|
|
1187
|
+
d.selected = !1;
|
|
1188
|
+
}), a.selectedKeys.clear(), i.forEach((d) => {
|
|
1189
|
+
const f = a.nodesMap.get(d);
|
|
1190
|
+
f && (f.selected = !0, a.selectedKeys.add(d));
|
|
1135
1191
|
});
|
|
1136
|
-
},
|
|
1137
|
-
return
|
|
1192
|
+
}, V = b(() => e.showCheckbox || e.checkable);
|
|
1193
|
+
return de("tree", {
|
|
1138
1194
|
props: e,
|
|
1139
1195
|
store: a,
|
|
1140
|
-
emit:
|
|
1141
|
-
toggleExpand:
|
|
1142
|
-
toggleCheck:
|
|
1143
|
-
handleNodeClick:
|
|
1144
|
-
filterValue:
|
|
1145
|
-
showCheckboxComputed:
|
|
1196
|
+
emit: r,
|
|
1197
|
+
toggleExpand: K,
|
|
1198
|
+
toggleCheck: H,
|
|
1199
|
+
handleNodeClick: E,
|
|
1200
|
+
filterValue: $e(p),
|
|
1201
|
+
showCheckboxComputed: V
|
|
1146
1202
|
}), o({
|
|
1147
|
-
filter:
|
|
1148
|
-
getNode:
|
|
1149
|
-
setCurrentKey:
|
|
1203
|
+
filter: $,
|
|
1204
|
+
getNode: M,
|
|
1205
|
+
setCurrentKey: w,
|
|
1150
1206
|
getCurrentKey: () => a.currentKey,
|
|
1151
|
-
getCurrentNode:
|
|
1152
|
-
getCheckedNodes:
|
|
1207
|
+
getCurrentNode: x,
|
|
1208
|
+
getCheckedNodes: Y,
|
|
1153
1209
|
getCheckedKeys: U,
|
|
1154
|
-
setCheckedKeys:
|
|
1210
|
+
setCheckedKeys: W,
|
|
1155
1211
|
getHalfCheckedNodes: X,
|
|
1156
1212
|
getHalfCheckedKeys: ae,
|
|
1157
1213
|
setChecked: oe,
|
|
1158
|
-
getSelectedNodes:
|
|
1159
|
-
setSelectedKeys:
|
|
1160
|
-
expandAll:
|
|
1161
|
-
collapseAll:
|
|
1214
|
+
getSelectedNodes: ee,
|
|
1215
|
+
setSelectedKeys: z,
|
|
1216
|
+
expandAll: L,
|
|
1217
|
+
collapseAll: T,
|
|
1162
1218
|
// 额外方法
|
|
1163
|
-
updateKeyChildren: (i,
|
|
1164
|
-
const
|
|
1165
|
-
|
|
1219
|
+
updateKeyChildren: (i, d) => {
|
|
1220
|
+
const f = a.nodesMap.get(i);
|
|
1221
|
+
f && (f.children.forEach((g) => {
|
|
1166
1222
|
a.nodesMap.delete(g.key);
|
|
1167
|
-
}),
|
|
1168
|
-
const
|
|
1169
|
-
return a.nodesMap.set(
|
|
1170
|
-
}),
|
|
1223
|
+
}), f.children = d.map((g) => {
|
|
1224
|
+
const c = new ie(g, a, f.level + 1, f);
|
|
1225
|
+
return a.nodesMap.set(c.key, c), c;
|
|
1226
|
+
}), f.isLeaf = f.children.length === 0);
|
|
1171
1227
|
},
|
|
1172
1228
|
remove: (i) => {
|
|
1173
|
-
const
|
|
1174
|
-
if (
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1229
|
+
const d = a.nodesMap.get(i);
|
|
1230
|
+
if (d) {
|
|
1231
|
+
const f = d.parent;
|
|
1232
|
+
if (f) {
|
|
1233
|
+
const c = f.children.indexOf(d);
|
|
1234
|
+
c > -1 && f.children.splice(c, 1), f.children.length === 0 && (f.isLeaf = !0);
|
|
1179
1235
|
} else {
|
|
1180
|
-
const
|
|
1181
|
-
|
|
1236
|
+
const c = a.rootNodes.indexOf(d);
|
|
1237
|
+
c > -1 && a.rootNodes.splice(c, 1);
|
|
1182
1238
|
}
|
|
1183
|
-
const g = (
|
|
1184
|
-
a.nodesMap.delete(
|
|
1239
|
+
const g = (c) => {
|
|
1240
|
+
a.nodesMap.delete(c.key), c.children.forEach(g);
|
|
1185
1241
|
};
|
|
1186
|
-
g(
|
|
1242
|
+
g(d);
|
|
1187
1243
|
}
|
|
1188
1244
|
},
|
|
1189
|
-
append: (i,
|
|
1190
|
-
if (
|
|
1191
|
-
const
|
|
1192
|
-
if (
|
|
1193
|
-
const g = new ie(i, a,
|
|
1194
|
-
a.nodesMap.set(g.key, g),
|
|
1245
|
+
append: (i, d) => {
|
|
1246
|
+
if (d) {
|
|
1247
|
+
const f = a.nodesMap.get(d);
|
|
1248
|
+
if (f) {
|
|
1249
|
+
const g = new ie(i, a, f.level + 1, f);
|
|
1250
|
+
a.nodesMap.set(g.key, g), f.children.push(g), f.isLeaf = !1;
|
|
1195
1251
|
}
|
|
1196
1252
|
} else {
|
|
1197
|
-
const
|
|
1198
|
-
a.nodesMap.set(
|
|
1253
|
+
const f = new ie(i, a, 0, null);
|
|
1254
|
+
a.nodesMap.set(f.key, f), a.rootNodes.push(f);
|
|
1199
1255
|
}
|
|
1200
1256
|
},
|
|
1201
|
-
insertBefore: (i,
|
|
1257
|
+
insertBefore: (i, d) => {
|
|
1202
1258
|
var g;
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
const
|
|
1206
|
-
a.nodesMap.set(
|
|
1207
|
-
const
|
|
1208
|
-
|
|
1259
|
+
const f = a.nodesMap.get(d);
|
|
1260
|
+
if (f) {
|
|
1261
|
+
const c = new ie(i, a, f.level, f.parent);
|
|
1262
|
+
a.nodesMap.set(c.key, c);
|
|
1263
|
+
const k = ((g = f.parent) == null ? void 0 : g.children) || a.rootNodes, S = k.indexOf(f);
|
|
1264
|
+
k.splice(S, 0, c);
|
|
1209
1265
|
}
|
|
1210
1266
|
},
|
|
1211
|
-
insertAfter: (i,
|
|
1267
|
+
insertAfter: (i, d) => {
|
|
1212
1268
|
var g;
|
|
1213
|
-
const
|
|
1214
|
-
if (
|
|
1215
|
-
const
|
|
1216
|
-
a.nodesMap.set(
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1269
|
+
const f = a.nodesMap.get(d);
|
|
1270
|
+
if (f) {
|
|
1271
|
+
const c = new ie(i, a, f.level, f.parent);
|
|
1272
|
+
a.nodesMap.set(c.key, c);
|
|
1273
|
+
const k = ((g = f.parent) == null ? void 0 : g.children) || a.rootNodes, S = k.indexOf(f);
|
|
1274
|
+
k.splice(S + 1, 0, c);
|
|
1219
1275
|
}
|
|
1220
1276
|
}
|
|
1221
1277
|
}), te(
|
|
1222
1278
|
() => [e.treeData, e.data],
|
|
1223
1279
|
() => {
|
|
1224
|
-
C(
|
|
1280
|
+
I(C());
|
|
1225
1281
|
},
|
|
1226
1282
|
{ immediate: !0, deep: !0 }
|
|
1227
1283
|
), te(
|
|
1228
1284
|
() => e.checkedKeys,
|
|
1229
1285
|
(i) => {
|
|
1230
|
-
i &&
|
|
1286
|
+
i && W(i);
|
|
1231
1287
|
},
|
|
1232
1288
|
{ immediate: !0, deep: !0 }
|
|
1233
1289
|
), te(
|
|
1234
1290
|
() => e.defaultCheckedKeys,
|
|
1235
1291
|
(i) => {
|
|
1236
|
-
i && i.length > 0 && !e.checkedKeys &&
|
|
1292
|
+
i && i.length > 0 && !e.checkedKeys && W(i);
|
|
1237
1293
|
},
|
|
1238
1294
|
{ immediate: !0, deep: !0 }
|
|
1239
|
-
), (i,
|
|
1295
|
+
), (i, d) => (h(), v("div", {
|
|
1240
1296
|
class: u([s(l).b(), s(l).m(n.size)])
|
|
1241
1297
|
}, [
|
|
1242
|
-
(
|
|
1243
|
-
key:
|
|
1244
|
-
node:
|
|
1298
|
+
(h(!0), v(F, null, _(a.rootNodes, (f) => (h(), se(st, {
|
|
1299
|
+
key: f.key,
|
|
1300
|
+
node: f
|
|
1245
1301
|
}, {
|
|
1246
|
-
default:
|
|
1247
|
-
|
|
1302
|
+
default: ye((g) => [
|
|
1303
|
+
P(i.$slots, "default", {
|
|
1248
1304
|
node: g.node,
|
|
1249
1305
|
data: g.data
|
|
1250
1306
|
}, () => [
|
|
1251
|
-
|
|
1307
|
+
q(B(g.node.label), 1)
|
|
1252
1308
|
])
|
|
1253
1309
|
]),
|
|
1254
1310
|
_: 2
|
|
1255
1311
|
}, 1032, ["node"]))), 128)),
|
|
1256
|
-
a.rootNodes.length ?
|
|
1312
|
+
a.rootNodes.length ? D("", !0) : (h(), v("div", {
|
|
1257
1313
|
key: 0,
|
|
1258
1314
|
class: u(s(l).e("empty"))
|
|
1259
1315
|
}, [
|
|
1260
|
-
|
|
1261
|
-
|
|
1316
|
+
P(i.$slots, "empty", {}, () => [
|
|
1317
|
+
q(B(n.emptyText), 1)
|
|
1262
1318
|
])
|
|
1263
1319
|
], 2))
|
|
1264
1320
|
], 2));
|
|
1265
1321
|
}
|
|
1266
|
-
}),
|
|
1322
|
+
}), ot = ["src"], it = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", jt = /* @__PURE__ */ Q({
|
|
1267
1323
|
name: "XEmpty",
|
|
1268
1324
|
__name: "index",
|
|
1269
1325
|
props: {
|
|
@@ -1273,27 +1329,27 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1273
1329
|
size: { default: "default" }
|
|
1274
1330
|
},
|
|
1275
1331
|
setup(n) {
|
|
1276
|
-
const o = n, t = G("empty"), e =
|
|
1332
|
+
const o = n, t = G("empty"), e = b(() => {
|
|
1277
1333
|
const l = {};
|
|
1278
1334
|
return o.imageSize && (l.height = `${o.imageSize}px`, l.width = `${o.imageSize}px`), l;
|
|
1279
|
-
}),
|
|
1280
|
-
return (l, a) => (
|
|
1335
|
+
}), r = b(() => o.description || "暂无数据");
|
|
1336
|
+
return (l, a) => (h(), v("div", {
|
|
1281
1337
|
class: u([s(t).b(), s(t).m(n.size)])
|
|
1282
1338
|
}, [
|
|
1283
1339
|
m("div", {
|
|
1284
1340
|
class: u(s(t).e("image")),
|
|
1285
|
-
style:
|
|
1341
|
+
style: O(e.value)
|
|
1286
1342
|
}, [
|
|
1287
|
-
|
|
1288
|
-
n.image ? (
|
|
1343
|
+
P(l.$slots, "image", {}, () => [
|
|
1344
|
+
n.image ? (h(), v("img", {
|
|
1289
1345
|
key: 0,
|
|
1290
1346
|
src: n.image,
|
|
1291
|
-
style:
|
|
1347
|
+
style: O(e.value),
|
|
1292
1348
|
draggable: "false"
|
|
1293
|
-
}, null, 12,
|
|
1349
|
+
}, null, 12, ot)) : (h(), v("img", {
|
|
1294
1350
|
key: 1,
|
|
1295
|
-
src:
|
|
1296
|
-
style:
|
|
1351
|
+
src: it,
|
|
1352
|
+
style: O(e.value),
|
|
1297
1353
|
draggable: "false"
|
|
1298
1354
|
}, null, 4))
|
|
1299
1355
|
])
|
|
@@ -1301,19 +1357,19 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1301
1357
|
m("div", {
|
|
1302
1358
|
class: u(s(t).e("description"))
|
|
1303
1359
|
}, [
|
|
1304
|
-
|
|
1305
|
-
m("p", null,
|
|
1360
|
+
P(l.$slots, "description", {}, () => [
|
|
1361
|
+
m("p", null, B(r.value), 1)
|
|
1306
1362
|
])
|
|
1307
1363
|
], 2),
|
|
1308
|
-
l.$slots.default ? (
|
|
1364
|
+
l.$slots.default ? (h(), v("div", {
|
|
1309
1365
|
key: 0,
|
|
1310
1366
|
class: u(s(t).e("bottom"))
|
|
1311
1367
|
}, [
|
|
1312
|
-
|
|
1313
|
-
], 2)) :
|
|
1368
|
+
P(l.$slots, "default")
|
|
1369
|
+
], 2)) : D("", !0)
|
|
1314
1370
|
], 2));
|
|
1315
1371
|
}
|
|
1316
|
-
}),
|
|
1372
|
+
}), Rt = /* @__PURE__ */ Q({
|
|
1317
1373
|
name: "XTimeline",
|
|
1318
1374
|
__name: "index",
|
|
1319
1375
|
props: {
|
|
@@ -1321,21 +1377,21 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1321
1377
|
},
|
|
1322
1378
|
setup(n) {
|
|
1323
1379
|
const o = n, t = G("timeline");
|
|
1324
|
-
|
|
1380
|
+
de("timeline", {
|
|
1325
1381
|
props: o
|
|
1326
1382
|
});
|
|
1327
|
-
const e =
|
|
1383
|
+
const e = b(() => [
|
|
1328
1384
|
t.b(),
|
|
1329
1385
|
t.m(o.direction)
|
|
1330
1386
|
]);
|
|
1331
|
-
return (
|
|
1387
|
+
return (r, l) => (h(), v("ul", {
|
|
1332
1388
|
class: u(e.value),
|
|
1333
1389
|
role: "timeline"
|
|
1334
1390
|
}, [
|
|
1335
|
-
|
|
1391
|
+
P(r.$slots, "default")
|
|
1336
1392
|
], 2));
|
|
1337
1393
|
}
|
|
1338
|
-
}),
|
|
1394
|
+
}), Pt = /* @__PURE__ */ Q({
|
|
1339
1395
|
name: "XTimelineItem",
|
|
1340
1396
|
__name: "TimelineItem",
|
|
1341
1397
|
props: {
|
|
@@ -1353,21 +1409,21 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1353
1409
|
warning: "#F59E0B",
|
|
1354
1410
|
danger: "#EF4444",
|
|
1355
1411
|
info: "#909399"
|
|
1356
|
-
},
|
|
1412
|
+
}, r = b(() => {
|
|
1357
1413
|
const a = {};
|
|
1358
1414
|
return o.color ? a.backgroundColor = o.color : o.type && e[o.type] && (a.backgroundColor = e[o.type]), a;
|
|
1359
|
-
}), l =
|
|
1415
|
+
}), l = b(() => [
|
|
1360
1416
|
t.b(),
|
|
1361
1417
|
t.m(o.size)
|
|
1362
1418
|
]);
|
|
1363
|
-
return (a, p) => (
|
|
1419
|
+
return (a, p) => (h(), v("li", {
|
|
1364
1420
|
class: u(l.value)
|
|
1365
1421
|
}, [
|
|
1366
1422
|
m("div", {
|
|
1367
1423
|
class: u(s(t).e("node")),
|
|
1368
|
-
style:
|
|
1424
|
+
style: O(r.value)
|
|
1369
1425
|
}, [
|
|
1370
|
-
|
|
1426
|
+
P(a.$slots, "dot")
|
|
1371
1427
|
], 6),
|
|
1372
1428
|
m("div", {
|
|
1373
1429
|
class: u(s(t).e("tail"))
|
|
@@ -1375,23 +1431,23 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1375
1431
|
m("div", {
|
|
1376
1432
|
class: u(s(t).e("wrapper"))
|
|
1377
1433
|
}, [
|
|
1378
|
-
!n.hideTimestamp && n.timestamp && n.placement === "top" ? (
|
|
1434
|
+
!n.hideTimestamp && n.timestamp && n.placement === "top" ? (h(), v("div", {
|
|
1379
1435
|
key: 0,
|
|
1380
1436
|
class: u(s(t).e("timestamp"))
|
|
1381
|
-
},
|
|
1437
|
+
}, B(n.timestamp), 3)) : D("", !0),
|
|
1382
1438
|
m("div", {
|
|
1383
1439
|
class: u(s(t).e("content"))
|
|
1384
1440
|
}, [
|
|
1385
|
-
|
|
1441
|
+
P(a.$slots, "default")
|
|
1386
1442
|
], 2),
|
|
1387
|
-
!n.hideTimestamp && n.timestamp && n.placement === "bottom" ? (
|
|
1443
|
+
!n.hideTimestamp && n.timestamp && n.placement === "bottom" ? (h(), v("div", {
|
|
1388
1444
|
key: 1,
|
|
1389
1445
|
class: u(s(t).e("timestamp"))
|
|
1390
|
-
},
|
|
1446
|
+
}, B(n.timestamp), 3)) : D("", !0)
|
|
1391
1447
|
], 2)
|
|
1392
1448
|
], 2));
|
|
1393
1449
|
}
|
|
1394
|
-
}),
|
|
1450
|
+
}), rt = ["onMouseenter", "onClick"], Wt = /* @__PURE__ */ Q({
|
|
1395
1451
|
name: "XCarousel",
|
|
1396
1452
|
__name: "index",
|
|
1397
1453
|
props: {
|
|
@@ -1406,114 +1462,114 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1406
1462
|
},
|
|
1407
1463
|
emits: ["update:activeIndex", "change"],
|
|
1408
1464
|
setup(n, { expose: o, emit: t }) {
|
|
1409
|
-
const e = n,
|
|
1410
|
-
|
|
1465
|
+
const e = n, r = t, l = G("carousel"), a = j(e.activeIndex), p = j(0), y = j(null), C = j(!1);
|
|
1466
|
+
de("carousel", {
|
|
1411
1467
|
currentIndex: a,
|
|
1412
1468
|
itemCount: p
|
|
1413
1469
|
});
|
|
1414
|
-
const
|
|
1470
|
+
const I = (Y) => {
|
|
1415
1471
|
const U = a.value;
|
|
1416
|
-
e.loop ? a.value = (
|
|
1417
|
-
},
|
|
1418
|
-
|
|
1419
|
-
},
|
|
1420
|
-
|
|
1421
|
-
},
|
|
1422
|
-
e.autoplay && p.value > 1 && (
|
|
1423
|
-
|
|
1472
|
+
e.loop ? a.value = (Y + p.value) % p.value : a.value = Math.max(0, Math.min(Y, p.value - 1)), r("update:activeIndex", a.value), r("change", a.value, U);
|
|
1473
|
+
}, N = () => {
|
|
1474
|
+
I(a.value - 1);
|
|
1475
|
+
}, L = () => {
|
|
1476
|
+
I(a.value + 1);
|
|
1477
|
+
}, T = () => {
|
|
1478
|
+
e.autoplay && p.value > 1 && (K(), y.value = setInterval(() => {
|
|
1479
|
+
C.value || L();
|
|
1424
1480
|
}, e.interval));
|
|
1425
|
-
}, z = () => {
|
|
1426
|
-
y.value && (clearInterval(y.value), y.value = null);
|
|
1427
|
-
}, I = () => {
|
|
1428
|
-
b.value = !0, e.arrow;
|
|
1429
1481
|
}, K = () => {
|
|
1430
|
-
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1433
|
-
},
|
|
1434
|
-
|
|
1435
|
-
},
|
|
1482
|
+
y.value && (clearInterval(y.value), y.value = null);
|
|
1483
|
+
}, H = () => {
|
|
1484
|
+
C.value = !0, e.arrow;
|
|
1485
|
+
}, E = () => {
|
|
1486
|
+
C.value = !1;
|
|
1487
|
+
}, $ = (Y) => {
|
|
1488
|
+
e.trigger === "hover" && I(Y);
|
|
1489
|
+
}, M = (Y) => {
|
|
1490
|
+
e.trigger === "click" && I(Y);
|
|
1491
|
+
}, w = b(() => ({
|
|
1436
1492
|
height: typeof e.height == "number" ? `${e.height}px` : e.height
|
|
1437
|
-
})),
|
|
1493
|
+
})), x = b(() => [
|
|
1438
1494
|
l.b(),
|
|
1439
1495
|
l.m(`arrow-${e.arrow}`),
|
|
1440
1496
|
l.m(`indicator-${e.indicatorPosition}`)
|
|
1441
1497
|
]);
|
|
1442
|
-
return te(() => e.activeIndex, (
|
|
1443
|
-
a.value =
|
|
1498
|
+
return te(() => e.activeIndex, (Y) => {
|
|
1499
|
+
a.value = Y;
|
|
1444
1500
|
}), te(() => e.autoplay, () => {
|
|
1445
|
-
|
|
1501
|
+
T();
|
|
1446
1502
|
}), te(p, () => {
|
|
1447
1503
|
we(() => {
|
|
1448
|
-
|
|
1504
|
+
T();
|
|
1449
1505
|
});
|
|
1450
|
-
}),
|
|
1451
|
-
|
|
1506
|
+
}), ce(() => {
|
|
1507
|
+
T();
|
|
1452
1508
|
}), fe(() => {
|
|
1453
|
-
|
|
1509
|
+
K();
|
|
1454
1510
|
}), o({
|
|
1455
|
-
prev:
|
|
1456
|
-
next:
|
|
1457
|
-
setActiveItem:
|
|
1458
|
-
}), (
|
|
1459
|
-
class: u(
|
|
1460
|
-
style:
|
|
1461
|
-
onMouseenter:
|
|
1462
|
-
onMouseleave:
|
|
1511
|
+
prev: N,
|
|
1512
|
+
next: L,
|
|
1513
|
+
setActiveItem: I
|
|
1514
|
+
}), (Y, U) => (h(), v("div", {
|
|
1515
|
+
class: u(x.value),
|
|
1516
|
+
style: O(w.value),
|
|
1517
|
+
onMouseenter: H,
|
|
1518
|
+
onMouseleave: E
|
|
1463
1519
|
}, [
|
|
1464
1520
|
m("div", {
|
|
1465
1521
|
class: u(s(l).e("container"))
|
|
1466
1522
|
}, [
|
|
1467
|
-
|
|
1523
|
+
P(Y.$slots, "default")
|
|
1468
1524
|
], 2),
|
|
1469
|
-
n.arrow !== "never" ? (
|
|
1525
|
+
n.arrow !== "never" ? (h(), v("button", {
|
|
1470
1526
|
key: 0,
|
|
1471
1527
|
class: u([s(l).e("arrow"), s(l).e("arrow-left")]),
|
|
1472
|
-
onClick:
|
|
1473
|
-
}, " ‹ ", 2)) :
|
|
1474
|
-
n.arrow !== "never" ? (
|
|
1528
|
+
onClick: N
|
|
1529
|
+
}, " ‹ ", 2)) : D("", !0),
|
|
1530
|
+
n.arrow !== "never" ? (h(), v("button", {
|
|
1475
1531
|
key: 1,
|
|
1476
1532
|
class: u([s(l).e("arrow"), s(l).e("arrow-right")]),
|
|
1477
|
-
onClick:
|
|
1478
|
-
}, " › ", 2)) :
|
|
1479
|
-
n.indicatorPosition !== "none" ? (
|
|
1533
|
+
onClick: L
|
|
1534
|
+
}, " › ", 2)) : D("", !0),
|
|
1535
|
+
n.indicatorPosition !== "none" ? (h(), v("ul", {
|
|
1480
1536
|
key: 2,
|
|
1481
1537
|
class: u(s(l).e("indicators"))
|
|
1482
1538
|
}, [
|
|
1483
|
-
(
|
|
1484
|
-
key:
|
|
1485
|
-
class: u([s(l).e("indicator"), s(l).is("active",
|
|
1486
|
-
onMouseenter: (X) =>
|
|
1487
|
-
onClick: (X) =>
|
|
1539
|
+
(h(!0), v(F, null, _(p.value, (W) => (h(), v("li", {
|
|
1540
|
+
key: W,
|
|
1541
|
+
class: u([s(l).e("indicator"), s(l).is("active", W - 1 === a.value)]),
|
|
1542
|
+
onMouseenter: (X) => $(W - 1),
|
|
1543
|
+
onClick: (X) => M(W - 1)
|
|
1488
1544
|
}, [
|
|
1489
1545
|
m("button", {
|
|
1490
1546
|
class: u(s(l).e("indicator-btn"))
|
|
1491
1547
|
}, null, 2)
|
|
1492
|
-
], 42,
|
|
1493
|
-
], 2)) :
|
|
1548
|
+
], 42, rt))), 128))
|
|
1549
|
+
], 2)) : D("", !0)
|
|
1494
1550
|
], 38));
|
|
1495
1551
|
}
|
|
1496
|
-
}),
|
|
1552
|
+
}), Ot = /* @__PURE__ */ Q({
|
|
1497
1553
|
name: "XCarouselItem",
|
|
1498
1554
|
__name: "CarouselItem",
|
|
1499
1555
|
setup(n) {
|
|
1500
|
-
const o = G("carousel-item"), t = ue("carousel"), e =
|
|
1501
|
-
|
|
1556
|
+
const o = G("carousel-item"), t = ue("carousel"), e = j(-1);
|
|
1557
|
+
ce(() => {
|
|
1502
1558
|
t && (e.value = t.itemCount.value, t.itemCount.value++);
|
|
1503
1559
|
}), fe(() => {
|
|
1504
1560
|
t && t.itemCount.value--;
|
|
1505
1561
|
});
|
|
1506
|
-
const
|
|
1562
|
+
const r = b(() => t && e.value === t.currentIndex.value), l = b(() => [
|
|
1507
1563
|
o.b(),
|
|
1508
|
-
o.is("active",
|
|
1564
|
+
o.is("active", r.value)
|
|
1509
1565
|
]);
|
|
1510
|
-
return (a, p) => (
|
|
1566
|
+
return (a, p) => (h(), v("div", {
|
|
1511
1567
|
class: u(l.value)
|
|
1512
1568
|
}, [
|
|
1513
|
-
|
|
1569
|
+
P(a.$slots, "default")
|
|
1514
1570
|
], 2));
|
|
1515
1571
|
}
|
|
1516
|
-
}),
|
|
1572
|
+
}), dt = { key: 0 }, ct = ["onClick"], ut = { class: "sort-arrow up" }, ht = { class: "sort-arrow down" }, ft = ["onClick"], vt = ["onClick"], pt = { key: 1 }, mt = ["colspan"], gt = { style: { display: "none" } }, Yt = /* @__PURE__ */ Q({
|
|
1517
1573
|
name: "XTable",
|
|
1518
1574
|
__name: "index",
|
|
1519
1575
|
props: {
|
|
@@ -1531,210 +1587,210 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1531
1587
|
},
|
|
1532
1588
|
emits: ["sort-change", "row-click", "row-dblclick", "cell-click", "selection-change", "select-all", "page-change", "size-change"],
|
|
1533
1589
|
setup(n, { expose: o, emit: t }) {
|
|
1534
|
-
var
|
|
1535
|
-
const e = n,
|
|
1590
|
+
var f, g;
|
|
1591
|
+
const e = n, r = t, l = G("table");
|
|
1536
1592
|
me();
|
|
1537
1593
|
const a = ke([]);
|
|
1538
|
-
|
|
1539
|
-
registerColumn: (
|
|
1540
|
-
a.findIndex((
|
|
1594
|
+
de("x-table", {
|
|
1595
|
+
registerColumn: (c, k) => {
|
|
1596
|
+
a.findIndex((A) => A.config.prop === c.prop) === -1 && a.push({ config: c, slot: k });
|
|
1541
1597
|
},
|
|
1542
|
-
unregisterColumn: (
|
|
1543
|
-
const
|
|
1544
|
-
|
|
1598
|
+
unregisterColumn: (c) => {
|
|
1599
|
+
const k = a.findIndex((S) => S.config.prop === c);
|
|
1600
|
+
k !== -1 && a.splice(k, 1);
|
|
1545
1601
|
},
|
|
1546
|
-
updateColumnSlot: (
|
|
1547
|
-
const S = a.find((
|
|
1548
|
-
S && (S.slot =
|
|
1602
|
+
updateColumnSlot: (c, k) => {
|
|
1603
|
+
const S = a.find((A) => A.config.prop === c);
|
|
1604
|
+
S && (S.slot = k);
|
|
1549
1605
|
},
|
|
1550
1606
|
props: e
|
|
1551
1607
|
});
|
|
1552
|
-
const
|
|
1553
|
-
const
|
|
1554
|
-
return [...
|
|
1555
|
-
}),
|
|
1556
|
-
|
|
1557
|
-
const S =
|
|
1558
|
-
return
|
|
1559
|
-
}, 0)),
|
|
1560
|
-
const S =
|
|
1561
|
-
return
|
|
1608
|
+
const I = b(() => {
|
|
1609
|
+
const c = a.map((R) => R.config), k = c.filter((R) => R.fixed === "left" || R.fixed === !0), S = c.filter((R) => !R.fixed), A = c.filter((R) => R.fixed === "right");
|
|
1610
|
+
return [...k, ...S, ...A];
|
|
1611
|
+
}), N = b(() => I.value.filter((c) => c.fixed === "left" || c.fixed === !0)), L = b(() => I.value.filter((c) => c.fixed === "right"));
|
|
1612
|
+
b(() => I.value.filter((c) => !c.fixed)), b(() => N.value.reduce((c, k) => {
|
|
1613
|
+
const S = k.width ? typeof k.width == "number" ? k.width : parseInt(k.width) : 100;
|
|
1614
|
+
return c + S;
|
|
1615
|
+
}, 0)), b(() => L.value.reduce((c, k) => {
|
|
1616
|
+
const S = k.width ? typeof k.width == "number" ? k.width : parseInt(k.width) : 100;
|
|
1617
|
+
return c + S;
|
|
1562
1618
|
}, 0));
|
|
1563
|
-
const
|
|
1564
|
-
const
|
|
1565
|
-
return a.forEach((
|
|
1566
|
-
|
|
1567
|
-
}),
|
|
1568
|
-
}),
|
|
1569
|
-
prop: ((
|
|
1619
|
+
const T = b(() => {
|
|
1620
|
+
const c = {};
|
|
1621
|
+
return a.forEach((k) => {
|
|
1622
|
+
k.slot && (c[k.config.prop] = k.slot);
|
|
1623
|
+
}), c;
|
|
1624
|
+
}), K = j({
|
|
1625
|
+
prop: ((f = e.defaultSort) == null ? void 0 : f.prop) || "",
|
|
1570
1626
|
order: ((g = e.defaultSort) == null ? void 0 : g.order) || null
|
|
1571
|
-
}),
|
|
1572
|
-
if (!
|
|
1627
|
+
}), H = b(() => {
|
|
1628
|
+
if (!K.value.prop || !K.value.order)
|
|
1573
1629
|
return e.data;
|
|
1574
|
-
const { prop:
|
|
1575
|
-
return [...e.data].sort((S,
|
|
1576
|
-
const
|
|
1577
|
-
if (
|
|
1578
|
-
const ne =
|
|
1579
|
-
return
|
|
1630
|
+
const { prop: c, order: k } = K.value;
|
|
1631
|
+
return [...e.data].sort((S, A) => {
|
|
1632
|
+
const R = S[c], le = A[c];
|
|
1633
|
+
if (R === le) return 0;
|
|
1634
|
+
const ne = R > le ? 1 : -1;
|
|
1635
|
+
return k === "ascending" ? ne : -ne;
|
|
1580
1636
|
});
|
|
1581
|
-
}),
|
|
1582
|
-
const
|
|
1583
|
-
return e.height && (
|
|
1584
|
-
}),
|
|
1637
|
+
}), E = b(() => {
|
|
1638
|
+
const c = {};
|
|
1639
|
+
return e.height && (c.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (c.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), c;
|
|
1640
|
+
}), $ = b(() => [
|
|
1585
1641
|
l.b(),
|
|
1586
1642
|
l.is("border", e.border),
|
|
1587
1643
|
l.is("stripe", e.stripe),
|
|
1588
1644
|
l.is("loading", e.loading),
|
|
1589
|
-
l.is("has-fixed",
|
|
1590
|
-
]),
|
|
1591
|
-
|
|
1592
|
-
},
|
|
1645
|
+
l.is("has-fixed", N.value.length > 0 || L.value.length > 0)
|
|
1646
|
+
]), M = (c) => {
|
|
1647
|
+
c.sortable && (K.value.prop === c.prop ? K.value.order === "ascending" ? K.value.order = "descending" : K.value.order === "descending" && (K.value.order = null, K.value.prop = "") : (K.value.prop = c.prop, K.value.order = "ascending"), r("sort-change", { ...K.value }));
|
|
1648
|
+
}, w = (c) => c.sortable ? K.value.prop !== c.prop ? l.is("sortable") : [
|
|
1593
1649
|
l.is("sortable"),
|
|
1594
|
-
l.is(`sort-${
|
|
1595
|
-
] : "",
|
|
1596
|
-
const
|
|
1597
|
-
return
|
|
1598
|
-
},
|
|
1599
|
-
|
|
1600
|
-
}, U = (
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1604
|
-
|
|
1605
|
-
}, X = (
|
|
1606
|
-
|
|
1607
|
-
}, ae = (
|
|
1608
|
-
const
|
|
1609
|
-
if (
|
|
1610
|
-
let
|
|
1611
|
-
for (let le = 0; le <
|
|
1612
|
-
const ne =
|
|
1613
|
-
|
|
1650
|
+
l.is(`sort-${K.value.order}`)
|
|
1651
|
+
] : "", x = (c, k, S) => {
|
|
1652
|
+
const A = c[k.prop];
|
|
1653
|
+
return k.formatter ? k.formatter(c, k, A, S) : A ?? "";
|
|
1654
|
+
}, Y = (c, k) => {
|
|
1655
|
+
r("row-click", c, I.value[0], k);
|
|
1656
|
+
}, U = (c, k, S) => {
|
|
1657
|
+
const A = S.target;
|
|
1658
|
+
r("cell-click", c, k, A, S);
|
|
1659
|
+
}, W = (c) => {
|
|
1660
|
+
r("page-change", c);
|
|
1661
|
+
}, X = (c) => {
|
|
1662
|
+
r("size-change", c);
|
|
1663
|
+
}, ae = (c, k, S) => {
|
|
1664
|
+
const A = {};
|
|
1665
|
+
if (c.width && (A.width = typeof c.width == "number" ? `${c.width}px` : c.width), c.minWidth && (A.minWidth = typeof c.minWidth == "number" ? `${c.minWidth}px` : c.minWidth), c.align && (A.textAlign = c.align), (c.fixed === "left" || c.fixed === !0) && (A.position = "sticky", A.left = "0px", A.zIndex = "2", k !== void 0 && k > 0)) {
|
|
1666
|
+
let R = 0;
|
|
1667
|
+
for (let le = 0; le < k; le++) {
|
|
1668
|
+
const ne = N.value[le], he = ne.width ? typeof ne.width == "number" ? ne.width : parseInt(ne.width) : 100;
|
|
1669
|
+
R += he;
|
|
1614
1670
|
}
|
|
1615
|
-
|
|
1671
|
+
A.left = `${R}px`;
|
|
1616
1672
|
}
|
|
1617
|
-
if (
|
|
1618
|
-
const
|
|
1673
|
+
if (c.fixed === "right" && (A.position = "sticky", A.right = "0px", A.zIndex = "2", k !== void 0)) {
|
|
1674
|
+
const R = L.value, le = R.length - 1 - k;
|
|
1619
1675
|
if (le > 0) {
|
|
1620
1676
|
let ne = 0;
|
|
1621
1677
|
for (let he = 0; he < le; he++) {
|
|
1622
|
-
const ve =
|
|
1678
|
+
const ve = R[R.length - 1 - he], xe = ve.width ? typeof ve.width == "number" ? ve.width : parseInt(ve.width) : 100;
|
|
1623
1679
|
ne += xe;
|
|
1624
1680
|
}
|
|
1625
|
-
|
|
1681
|
+
A.right = `${ne}px`;
|
|
1626
1682
|
}
|
|
1627
1683
|
}
|
|
1628
|
-
return
|
|
1629
|
-
}, oe = (
|
|
1630
|
-
const
|
|
1631
|
-
return (
|
|
1632
|
-
},
|
|
1684
|
+
return A;
|
|
1685
|
+
}, oe = (c) => {
|
|
1686
|
+
const k = [];
|
|
1687
|
+
return (c.fixed === "left" || c.fixed === !0) && k.push(l.is("fixed-left")), c.fixed === "right" && k.push(l.is("fixed-right")), k;
|
|
1688
|
+
}, ee = j([]), z = (c) => e.rowKey ? typeof e.rowKey == "function" ? e.rowKey(c) : String(c[e.rowKey]) : String(e.data.indexOf(c));
|
|
1633
1689
|
return o({
|
|
1634
1690
|
clearSelection: () => {
|
|
1635
|
-
|
|
1691
|
+
ee.value = [], r("selection-change", []);
|
|
1636
1692
|
},
|
|
1637
|
-
getSelection: () => [...
|
|
1638
|
-
toggleRowSelection: (
|
|
1639
|
-
const S =
|
|
1640
|
-
|
|
1693
|
+
getSelection: () => [...ee.value],
|
|
1694
|
+
toggleRowSelection: (c, k) => {
|
|
1695
|
+
const S = z(c), A = ee.value.findIndex((R) => z(R) === S);
|
|
1696
|
+
k === void 0 ? A > -1 ? ee.value.splice(A, 1) : ee.value.push(c) : k && A === -1 ? ee.value.push(c) : !k && A > -1 && ee.value.splice(A, 1), r("selection-change", [...ee.value]);
|
|
1641
1697
|
},
|
|
1642
|
-
sortState:
|
|
1643
|
-
columns:
|
|
1644
|
-
}), (
|
|
1645
|
-
class: u(
|
|
1698
|
+
sortState: K,
|
|
1699
|
+
columns: I
|
|
1700
|
+
}), (c, k) => (h(), v("div", {
|
|
1701
|
+
class: u($.value)
|
|
1646
1702
|
}, [
|
|
1647
|
-
n.loading ? (
|
|
1703
|
+
n.loading ? (h(), v("div", {
|
|
1648
1704
|
key: 0,
|
|
1649
1705
|
class: u(s(l).e("loading"))
|
|
1650
|
-
}, [...
|
|
1706
|
+
}, [...k[0] || (k[0] = [
|
|
1651
1707
|
m("span", { class: "loading-spinner" }, null, -1),
|
|
1652
1708
|
m("span", { class: "loading-text" }, "加载中...", -1)
|
|
1653
|
-
])], 2)) :
|
|
1709
|
+
])], 2)) : D("", !0),
|
|
1654
1710
|
m("div", {
|
|
1655
1711
|
class: u(s(l).e("wrapper")),
|
|
1656
|
-
style:
|
|
1712
|
+
style: O(E.value)
|
|
1657
1713
|
}, [
|
|
1658
1714
|
m("table", null, [
|
|
1659
|
-
n.showHeader ? (
|
|
1715
|
+
n.showHeader ? (h(), v("thead", dt, [
|
|
1660
1716
|
m("tr", null, [
|
|
1661
|
-
(
|
|
1717
|
+
(h(!0), v(F, null, _(I.value, (S, A) => (h(), v("th", {
|
|
1662
1718
|
key: S.prop,
|
|
1663
|
-
class: u([s(l).e("header-cell"),
|
|
1664
|
-
style:
|
|
1665
|
-
onClick: (
|
|
1719
|
+
class: u([s(l).e("header-cell"), w(S), ...oe(S)]),
|
|
1720
|
+
style: O(ae(S, S.fixed === "right" ? L.value.indexOf(S) : A)),
|
|
1721
|
+
onClick: (R) => M(S)
|
|
1666
1722
|
}, [
|
|
1667
|
-
m("span", null,
|
|
1668
|
-
S.sortable ? (
|
|
1723
|
+
m("span", null, B(S.label), 1),
|
|
1724
|
+
S.sortable ? (h(), v("span", {
|
|
1669
1725
|
key: 0,
|
|
1670
1726
|
class: u(s(l).e("sort-icon"))
|
|
1671
1727
|
}, [
|
|
1672
|
-
m("span",
|
|
1728
|
+
m("span", ut, [
|
|
1673
1729
|
J(s(Z), {
|
|
1674
1730
|
name: "sort-up",
|
|
1675
1731
|
size: 12
|
|
1676
1732
|
})
|
|
1677
1733
|
]),
|
|
1678
|
-
m("span",
|
|
1734
|
+
m("span", ht, [
|
|
1679
1735
|
J(s(Z), {
|
|
1680
1736
|
name: "sort-down",
|
|
1681
1737
|
size: 12
|
|
1682
1738
|
})
|
|
1683
1739
|
])
|
|
1684
|
-
], 2)) :
|
|
1685
|
-
], 14,
|
|
1740
|
+
], 2)) : D("", !0)
|
|
1741
|
+
], 14, ct))), 128))
|
|
1686
1742
|
])
|
|
1687
|
-
])) :
|
|
1743
|
+
])) : D("", !0),
|
|
1688
1744
|
m("tbody", null, [
|
|
1689
|
-
(
|
|
1690
|
-
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(S) : S[n.rowKey] :
|
|
1745
|
+
(h(!0), v(F, null, _(H.value, (S, A) => (h(), v("tr", {
|
|
1746
|
+
key: n.rowKey ? typeof n.rowKey == "function" ? n.rowKey(S) : S[n.rowKey] : A,
|
|
1691
1747
|
class: u([s(l).e("row")]),
|
|
1692
|
-
onClick: (
|
|
1748
|
+
onClick: (R) => Y(S, R)
|
|
1693
1749
|
}, [
|
|
1694
|
-
(
|
|
1695
|
-
key:
|
|
1696
|
-
class: u([s(l).e("cell"), ...oe(
|
|
1697
|
-
style:
|
|
1698
|
-
onClick: (ne) => U(S,
|
|
1750
|
+
(h(!0), v(F, null, _(I.value, (R, le) => (h(), v("td", {
|
|
1751
|
+
key: R.prop,
|
|
1752
|
+
class: u([s(l).e("cell"), ...oe(R)]),
|
|
1753
|
+
style: O(ae(R, R.fixed === "right" ? L.value.indexOf(R) : le)),
|
|
1754
|
+
onClick: (ne) => U(S, R, ne)
|
|
1699
1755
|
}, [
|
|
1700
|
-
|
|
1701
|
-
|
|
1756
|
+
T.value[R.prop] ? (h(), se(pe(() => T.value[R.prop]({ row: S, column: R, $index: A })), { key: 0 })) : (h(), v(F, { key: 1 }, [
|
|
1757
|
+
q(B(x(S, R, A)), 1)
|
|
1702
1758
|
], 64))
|
|
1703
|
-
], 14,
|
|
1704
|
-
], 10,
|
|
1759
|
+
], 14, vt))), 128))
|
|
1760
|
+
], 10, ft))), 128))
|
|
1705
1761
|
]),
|
|
1706
|
-
|
|
1762
|
+
H.value.length === 0 && !n.loading ? (h(), v("tbody", pt, [
|
|
1707
1763
|
m("tr", null, [
|
|
1708
1764
|
m("td", {
|
|
1709
|
-
colspan:
|
|
1765
|
+
colspan: I.value.length || 1,
|
|
1710
1766
|
class: u(s(l).e("empty"))
|
|
1711
1767
|
}, [
|
|
1712
|
-
|
|
1713
|
-
|
|
1768
|
+
P(c.$slots, "empty", {}, () => [
|
|
1769
|
+
q(B(n.emptyText), 1)
|
|
1714
1770
|
])
|
|
1715
|
-
], 10,
|
|
1771
|
+
], 10, mt)
|
|
1716
1772
|
])
|
|
1717
|
-
])) :
|
|
1773
|
+
])) : D("", !0)
|
|
1718
1774
|
])
|
|
1719
1775
|
], 6),
|
|
1720
|
-
n.pagination ? (
|
|
1776
|
+
n.pagination ? (h(), v("div", {
|
|
1721
1777
|
key: 1,
|
|
1722
1778
|
class: u(s(l).e("pagination"))
|
|
1723
1779
|
}, [
|
|
1724
|
-
J(
|
|
1780
|
+
J(We, {
|
|
1725
1781
|
total: n.pagination.total,
|
|
1726
1782
|
"current-page": n.pagination.current,
|
|
1727
1783
|
"page-size": n.pagination.pageSize,
|
|
1728
|
-
onCurrentChange:
|
|
1784
|
+
onCurrentChange: W,
|
|
1729
1785
|
onSizeChange: X
|
|
1730
1786
|
}, null, 8, ["total", "current-page", "page-size"])
|
|
1731
|
-
], 2)) :
|
|
1732
|
-
m("div",
|
|
1733
|
-
|
|
1787
|
+
], 2)) : D("", !0),
|
|
1788
|
+
m("div", gt, [
|
|
1789
|
+
P(c.$slots, "default")
|
|
1734
1790
|
])
|
|
1735
1791
|
], 2));
|
|
1736
1792
|
}
|
|
1737
|
-
}),
|
|
1793
|
+
}), Xt = /* @__PURE__ */ Q({
|
|
1738
1794
|
name: "XTableColumn",
|
|
1739
1795
|
__name: "TableColumn",
|
|
1740
1796
|
props: {
|
|
@@ -1750,7 +1806,7 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1750
1806
|
setup(n) {
|
|
1751
1807
|
const o = n;
|
|
1752
1808
|
G("table-column");
|
|
1753
|
-
const t = me(), e =
|
|
1809
|
+
const t = me(), e = j(`column_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`), r = ue("x-table"), l = b(() => ({
|
|
1754
1810
|
prop: o.prop || e.value,
|
|
1755
1811
|
label: o.label,
|
|
1756
1812
|
width: o.width,
|
|
@@ -1760,15 +1816,15 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1760
1816
|
fixed: o.fixed,
|
|
1761
1817
|
formatter: o.formatter
|
|
1762
1818
|
}));
|
|
1763
|
-
return
|
|
1764
|
-
|
|
1819
|
+
return ce(() => {
|
|
1820
|
+
r != null && r.registerColumn && r.registerColumn(l.value, t.default);
|
|
1765
1821
|
}), te(() => t.default, (a) => {
|
|
1766
|
-
|
|
1822
|
+
r != null && r.updateColumnSlot && a && r.updateColumnSlot(o.prop || e.value, a);
|
|
1767
1823
|
}, { immediate: !0 }), fe(() => {
|
|
1768
|
-
|
|
1824
|
+
r != null && r.unregisterColumn && r.unregisterColumn(o.prop || e.value);
|
|
1769
1825
|
}), (a, p) => null;
|
|
1770
1826
|
}
|
|
1771
|
-
}),
|
|
1827
|
+
}), yt = { key: 0 }, Mt = ["onClick"], kt = { class: "sort-arrow up" }, wt = { class: "sort-arrow down" }, bt = ["onClick"], xt = { key: 0 }, Ct = ["colspan"], zt = { style: { display: "none" } }, Qt = /* @__PURE__ */ Q({
|
|
1772
1828
|
name: "XTreeTable",
|
|
1773
1829
|
__name: "index",
|
|
1774
1830
|
props: {
|
|
@@ -1788,214 +1844,214 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
1788
1844
|
},
|
|
1789
1845
|
emits: ["row-click", "cell-click", "expand-change", "sort-change"],
|
|
1790
1846
|
setup(n, { expose: o, emit: t }) {
|
|
1791
|
-
const e = n,
|
|
1792
|
-
|
|
1793
|
-
registerColumn: (
|
|
1794
|
-
const i = p.value.findIndex((
|
|
1795
|
-
i === -1 ? p.value.push(
|
|
1847
|
+
const e = n, r = t, l = G("tree-table"), a = j(/* @__PURE__ */ new Set()), p = j([]), y = j({});
|
|
1848
|
+
de("x-tree-table", {
|
|
1849
|
+
registerColumn: (z, V) => {
|
|
1850
|
+
const i = p.value.findIndex((d) => d.prop === z.prop);
|
|
1851
|
+
i === -1 ? p.value.push(z) : p.value[i] = z, V && (y.value[z.prop] = V);
|
|
1796
1852
|
},
|
|
1797
|
-
unregisterColumn: (
|
|
1798
|
-
const
|
|
1799
|
-
|
|
1853
|
+
unregisterColumn: (z) => {
|
|
1854
|
+
const V = p.value.findIndex((i) => i.prop === z);
|
|
1855
|
+
V > -1 && p.value.splice(V, 1), delete y.value[z];
|
|
1800
1856
|
},
|
|
1801
|
-
updateColumnSlot: (
|
|
1802
|
-
y.value[
|
|
1857
|
+
updateColumnSlot: (z, V) => {
|
|
1858
|
+
y.value[z] = V;
|
|
1803
1859
|
},
|
|
1804
1860
|
props: e
|
|
1805
1861
|
});
|
|
1806
|
-
const
|
|
1862
|
+
const L = (z) => typeof e.rowKey == "function" ? e.rowKey(z) : z[e.rowKey || "id"], T = (z) => {
|
|
1807
1863
|
var i;
|
|
1808
|
-
const
|
|
1809
|
-
return
|
|
1810
|
-
},
|
|
1811
|
-
var
|
|
1812
|
-
if (
|
|
1813
|
-
const i = ((
|
|
1814
|
-
return
|
|
1815
|
-
},
|
|
1816
|
-
const
|
|
1817
|
-
return a.value.has(
|
|
1818
|
-
},
|
|
1819
|
-
const
|
|
1820
|
-
i ? a.value.add(
|
|
1821
|
-
},
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1824
|
-
|
|
1864
|
+
const V = ((i = e.treeProps) == null ? void 0 : i.children) || "children";
|
|
1865
|
+
return z[V] || [];
|
|
1866
|
+
}, K = (z) => {
|
|
1867
|
+
var d;
|
|
1868
|
+
if (T(z).length > 0) return !0;
|
|
1869
|
+
const i = ((d = e.treeProps) == null ? void 0 : d.hasChildren) || "hasChildren";
|
|
1870
|
+
return z[i] === !0;
|
|
1871
|
+
}, H = (z) => {
|
|
1872
|
+
const V = L(z);
|
|
1873
|
+
return a.value.has(V);
|
|
1874
|
+
}, E = (z) => {
|
|
1875
|
+
const V = L(z), i = !a.value.has(V);
|
|
1876
|
+
i ? a.value.add(V) : a.value.delete(V), r("expand-change", z, i);
|
|
1877
|
+
}, $ = () => {
|
|
1878
|
+
const z = (V) => {
|
|
1879
|
+
V.forEach((i) => {
|
|
1880
|
+
K(i) && (a.value.add(L(i)), z(T(i)));
|
|
1825
1881
|
});
|
|
1826
1882
|
};
|
|
1827
|
-
|
|
1828
|
-
},
|
|
1883
|
+
z(e.data);
|
|
1884
|
+
}, M = () => {
|
|
1829
1885
|
a.value.clear();
|
|
1830
|
-
},
|
|
1831
|
-
const
|
|
1886
|
+
}, w = b(() => {
|
|
1887
|
+
const z = [], V = (i, d = 0, f = !0) => {
|
|
1832
1888
|
i.forEach((g) => {
|
|
1833
|
-
const
|
|
1834
|
-
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1889
|
+
const c = L(g), k = a.value.has(c), S = f;
|
|
1890
|
+
z.push({ row: g, level: d, visible: S });
|
|
1891
|
+
const A = T(g);
|
|
1892
|
+
A.length > 0 && k && V(A, d + 1, S);
|
|
1837
1893
|
});
|
|
1838
1894
|
};
|
|
1839
|
-
return
|
|
1840
|
-
}),
|
|
1895
|
+
return V(e.data), z;
|
|
1896
|
+
}), x = j({
|
|
1841
1897
|
prop: "",
|
|
1842
1898
|
order: null
|
|
1843
|
-
}),
|
|
1844
|
-
if (!
|
|
1845
|
-
return
|
|
1846
|
-
const { prop:
|
|
1847
|
-
return [...
|
|
1848
|
-
const
|
|
1849
|
-
if (
|
|
1850
|
-
const
|
|
1851
|
-
return
|
|
1899
|
+
}), Y = b(() => {
|
|
1900
|
+
if (!x.value.prop || !x.value.order)
|
|
1901
|
+
return w.value;
|
|
1902
|
+
const { prop: z, order: V } = x.value;
|
|
1903
|
+
return [...w.value].sort((i, d) => {
|
|
1904
|
+
const f = i.row[z], g = d.row[z];
|
|
1905
|
+
if (f === g) return 0;
|
|
1906
|
+
const c = f > g ? 1 : -1;
|
|
1907
|
+
return V === "ascending" ? c : -c;
|
|
1852
1908
|
});
|
|
1853
|
-
}), U = (
|
|
1854
|
-
|
|
1855
|
-
},
|
|
1909
|
+
}), U = (z) => {
|
|
1910
|
+
z.sortable && (x.value.prop === z.prop ? x.value.order === "ascending" ? x.value.order = "descending" : x.value.order === "descending" && (x.value.order = null, x.value.prop = "") : (x.value.prop = z.prop, x.value.order = "ascending"), r("sort-change", { ...x.value }));
|
|
1911
|
+
}, W = (z) => z.sortable ? x.value.prop !== z.prop ? l.is("sortable") : [
|
|
1856
1912
|
l.is("sortable"),
|
|
1857
|
-
l.is(`sort-${
|
|
1858
|
-
] : "", X = (
|
|
1859
|
-
const
|
|
1860
|
-
return
|
|
1861
|
-
}, ae = (
|
|
1862
|
-
const
|
|
1863
|
-
return
|
|
1864
|
-
}, oe =
|
|
1913
|
+
l.is(`sort-${x.value.order}`)
|
|
1914
|
+
] : "", X = (z, V, i) => {
|
|
1915
|
+
const d = z[V.prop];
|
|
1916
|
+
return V.formatter ? V.formatter(z, V, d, i) : d ?? "";
|
|
1917
|
+
}, ae = (z) => {
|
|
1918
|
+
const V = {};
|
|
1919
|
+
return z.width && (V.width = typeof z.width == "number" ? `${z.width}px` : z.width), z.minWidth && (V.minWidth = typeof z.minWidth == "number" ? `${z.minWidth}px` : z.minWidth), z.align && (V.textAlign = z.align), V;
|
|
1920
|
+
}, oe = b(() => [
|
|
1865
1921
|
l.b(),
|
|
1866
1922
|
l.is("border", e.border),
|
|
1867
1923
|
l.is("stripe", e.stripe),
|
|
1868
1924
|
l.is("loading", e.loading)
|
|
1869
|
-
]),
|
|
1870
|
-
var
|
|
1871
|
-
e.defaultExpandAll ?
|
|
1872
|
-
a.value.add(
|
|
1925
|
+
]), ee = () => {
|
|
1926
|
+
var z;
|
|
1927
|
+
e.defaultExpandAll ? $() : (z = e.defaultExpandedKeys) != null && z.length && e.defaultExpandedKeys.forEach((V) => {
|
|
1928
|
+
a.value.add(V);
|
|
1873
1929
|
});
|
|
1874
1930
|
};
|
|
1875
1931
|
return te(() => e.data, () => {
|
|
1876
|
-
|
|
1877
|
-
}, { immediate: !0 }), te(() => e.defaultExpandedKeys, (
|
|
1878
|
-
|
|
1879
|
-
a.value.add(
|
|
1932
|
+
ee();
|
|
1933
|
+
}, { immediate: !0 }), te(() => e.defaultExpandedKeys, (z) => {
|
|
1934
|
+
z != null && z.length && !e.defaultExpandAll && (a.value.clear(), z.forEach((V) => {
|
|
1935
|
+
a.value.add(V);
|
|
1880
1936
|
}));
|
|
1881
1937
|
}, { immediate: !0 }), o({
|
|
1882
|
-
expandAll:
|
|
1883
|
-
collapseAll:
|
|
1884
|
-
toggleExpand:
|
|
1938
|
+
expandAll: $,
|
|
1939
|
+
collapseAll: M,
|
|
1940
|
+
toggleExpand: E,
|
|
1885
1941
|
expandedKeys: a,
|
|
1886
1942
|
columns: p
|
|
1887
|
-
}), (
|
|
1943
|
+
}), (z, V) => (h(), v("div", {
|
|
1888
1944
|
class: u(oe.value)
|
|
1889
1945
|
}, [
|
|
1890
|
-
n.loading ? (
|
|
1946
|
+
n.loading ? (h(), v("div", {
|
|
1891
1947
|
key: 0,
|
|
1892
1948
|
class: u(s(l).e("loading"))
|
|
1893
|
-
}, [...
|
|
1949
|
+
}, [...V[0] || (V[0] = [
|
|
1894
1950
|
m("span", { class: "loading-spinner" }, null, -1),
|
|
1895
1951
|
m("span", { class: "loading-text" }, "加载中...", -1)
|
|
1896
|
-
])], 2)) :
|
|
1952
|
+
])], 2)) : D("", !0),
|
|
1897
1953
|
m("div", {
|
|
1898
1954
|
class: u(s(l).e("wrapper"))
|
|
1899
1955
|
}, [
|
|
1900
1956
|
m("table", null, [
|
|
1901
|
-
n.showHeader ? (
|
|
1957
|
+
n.showHeader ? (h(), v("thead", yt, [
|
|
1902
1958
|
m("tr", null, [
|
|
1903
|
-
(
|
|
1959
|
+
(h(!0), v(F, null, _(p.value, (i) => (h(), v("th", {
|
|
1904
1960
|
key: i.prop,
|
|
1905
|
-
class: u([s(l).e("header-cell"),
|
|
1906
|
-
style:
|
|
1907
|
-
onClick: (
|
|
1961
|
+
class: u([s(l).e("header-cell"), W(i)]),
|
|
1962
|
+
style: O(ae(i)),
|
|
1963
|
+
onClick: (d) => U(i)
|
|
1908
1964
|
}, [
|
|
1909
|
-
m("span", null,
|
|
1910
|
-
i.sortable ? (
|
|
1965
|
+
m("span", null, B(i.label), 1),
|
|
1966
|
+
i.sortable ? (h(), v("span", {
|
|
1911
1967
|
key: 0,
|
|
1912
1968
|
class: u(s(l).e("sort-icon"))
|
|
1913
1969
|
}, [
|
|
1914
|
-
m("span",
|
|
1970
|
+
m("span", kt, [
|
|
1915
1971
|
J(s(Z), {
|
|
1916
1972
|
name: "sort-up",
|
|
1917
1973
|
size: 12
|
|
1918
1974
|
})
|
|
1919
1975
|
]),
|
|
1920
|
-
m("span",
|
|
1976
|
+
m("span", wt, [
|
|
1921
1977
|
J(s(Z), {
|
|
1922
1978
|
name: "sort-down",
|
|
1923
1979
|
size: 12
|
|
1924
1980
|
})
|
|
1925
1981
|
])
|
|
1926
|
-
], 2)) :
|
|
1927
|
-
], 14,
|
|
1982
|
+
], 2)) : D("", !0)
|
|
1983
|
+
], 14, Mt))), 128))
|
|
1928
1984
|
])
|
|
1929
|
-
])) :
|
|
1985
|
+
])) : D("", !0),
|
|
1930
1986
|
m("tbody", null, [
|
|
1931
|
-
(
|
|
1932
|
-
key:
|
|
1987
|
+
(h(!0), v(F, null, _(Y.value, (i, d) => (h(), v(F, {
|
|
1988
|
+
key: L(i.row)
|
|
1933
1989
|
}, [
|
|
1934
|
-
i.visible ? (
|
|
1990
|
+
i.visible ? (h(), v("tr", {
|
|
1935
1991
|
key: 0,
|
|
1936
1992
|
class: u([s(l).e("row"), s(l).is("level-" + i.level)])
|
|
1937
1993
|
}, [
|
|
1938
|
-
(
|
|
1939
|
-
key:
|
|
1994
|
+
(h(!0), v(F, null, _(p.value, (f, g) => (h(), v("td", {
|
|
1995
|
+
key: f.prop,
|
|
1940
1996
|
class: u(s(l).e("cell")),
|
|
1941
|
-
style:
|
|
1997
|
+
style: O(ae(f))
|
|
1942
1998
|
}, [
|
|
1943
|
-
g === 0 ? (
|
|
1999
|
+
g === 0 ? (h(), v("div", {
|
|
1944
2000
|
key: 0,
|
|
1945
2001
|
class: u(s(l).e("cell-content"))
|
|
1946
2002
|
}, [
|
|
1947
2003
|
m("span", {
|
|
1948
2004
|
class: u(s(l).e("indent")),
|
|
1949
|
-
style:
|
|
2005
|
+
style: O({ width: `${i.level * n.indent}px` })
|
|
1950
2006
|
}, null, 6),
|
|
1951
|
-
|
|
2007
|
+
K(i.row) ? (h(), v("span", {
|
|
1952
2008
|
key: 0,
|
|
1953
|
-
class: u([s(l).e("expand-icon"), s(l).is("expanded",
|
|
1954
|
-
onClick: re((
|
|
2009
|
+
class: u([s(l).e("expand-icon"), s(l).is("expanded", H(i.row))]),
|
|
2010
|
+
onClick: re((c) => E(i.row), ["stop"])
|
|
1955
2011
|
}, [
|
|
1956
|
-
|
|
2012
|
+
H(i.row) ? (h(), se(s(Z), {
|
|
1957
2013
|
key: 0,
|
|
1958
2014
|
name: "chevron-down",
|
|
1959
2015
|
size: 14
|
|
1960
|
-
})) : (
|
|
2016
|
+
})) : (h(), se(s(Z), {
|
|
1961
2017
|
key: 1,
|
|
1962
2018
|
name: "chevron-right",
|
|
1963
2019
|
size: 14
|
|
1964
2020
|
}))
|
|
1965
|
-
], 10,
|
|
2021
|
+
], 10, bt)) : (h(), v("span", {
|
|
1966
2022
|
key: 1,
|
|
1967
2023
|
class: u(s(l).e("expand-placeholder"))
|
|
1968
2024
|
}, null, 2)),
|
|
1969
2025
|
m("span", null, [
|
|
1970
|
-
y.value[
|
|
1971
|
-
|
|
2026
|
+
y.value[f.prop] ? (h(), se(pe(() => y.value[f.prop]({ row: i.row, column: f, $index: d })), { key: 0 })) : (h(), v(F, { key: 1 }, [
|
|
2027
|
+
q(B(X(i.row, f, d)), 1)
|
|
1972
2028
|
], 64))
|
|
1973
2029
|
])
|
|
1974
|
-
], 2)) : y.value[
|
|
1975
|
-
|
|
2030
|
+
], 2)) : y.value[f.prop] ? (h(), se(pe(() => y.value[f.prop]({ row: i.row, column: f, $index: d })), { key: 1 })) : (h(), v(F, { key: 2 }, [
|
|
2031
|
+
q(B(X(i.row, f, d)), 1)
|
|
1976
2032
|
], 64))
|
|
1977
2033
|
], 6))), 128))
|
|
1978
|
-
], 2)) :
|
|
2034
|
+
], 2)) : D("", !0)
|
|
1979
2035
|
], 64))), 128)),
|
|
1980
|
-
|
|
2036
|
+
Y.value.length === 0 && !n.loading ? (h(), v("tr", xt, [
|
|
1981
2037
|
m("td", {
|
|
1982
2038
|
colspan: p.value.length || 1,
|
|
1983
2039
|
class: u(s(l).e("empty"))
|
|
1984
2040
|
}, [
|
|
1985
|
-
|
|
1986
|
-
|
|
2041
|
+
P(z.$slots, "empty", {}, () => [
|
|
2042
|
+
q(B(n.emptyText), 1)
|
|
1987
2043
|
])
|
|
1988
|
-
], 10,
|
|
1989
|
-
])) :
|
|
2044
|
+
], 10, Ct)
|
|
2045
|
+
])) : D("", !0)
|
|
1990
2046
|
])
|
|
1991
2047
|
])
|
|
1992
2048
|
], 2),
|
|
1993
|
-
m("div",
|
|
1994
|
-
|
|
2049
|
+
m("div", zt, [
|
|
2050
|
+
P(z.$slots, "default")
|
|
1995
2051
|
])
|
|
1996
2052
|
], 2));
|
|
1997
2053
|
}
|
|
1998
|
-
}),
|
|
2054
|
+
}), Gt = /* @__PURE__ */ Q({
|
|
1999
2055
|
name: "XTreeTableColumn",
|
|
2000
2056
|
__name: "TreeTableColumn",
|
|
2001
2057
|
props: {
|
|
@@ -2011,7 +2067,7 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2011
2067
|
setup(n) {
|
|
2012
2068
|
const o = n;
|
|
2013
2069
|
G("tree-table-column");
|
|
2014
|
-
const t = me(), e = ue("x-tree-table"),
|
|
2070
|
+
const t = me(), e = ue("x-tree-table"), r = b(() => ({
|
|
2015
2071
|
prop: o.prop,
|
|
2016
2072
|
label: o.label,
|
|
2017
2073
|
width: o.width,
|
|
@@ -2021,15 +2077,15 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2021
2077
|
fixed: o.fixed,
|
|
2022
2078
|
formatter: o.formatter
|
|
2023
2079
|
}));
|
|
2024
|
-
return
|
|
2025
|
-
e != null && e.registerColumn && e.registerColumn(
|
|
2080
|
+
return ce(() => {
|
|
2081
|
+
e != null && e.registerColumn && e.registerColumn(r.value, t.default);
|
|
2026
2082
|
}), te(() => t.default, (l) => {
|
|
2027
2083
|
e != null && e.updateColumnSlot && l && e.updateColumnSlot(o.prop, l);
|
|
2028
2084
|
}, { immediate: !0 }), fe(() => {
|
|
2029
2085
|
e != null && e.unregisterColumn && e.unregisterColumn(o.prop);
|
|
2030
2086
|
}), (l, a) => null;
|
|
2031
2087
|
}
|
|
2032
|
-
}),
|
|
2088
|
+
}), It = ["src", "alt"], Ft = /* @__PURE__ */ Q({
|
|
2033
2089
|
name: "XAvatar",
|
|
2034
2090
|
__name: "index",
|
|
2035
2091
|
props: {
|
|
@@ -2042,38 +2098,38 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2042
2098
|
},
|
|
2043
2099
|
emits: ["error"],
|
|
2044
2100
|
setup(n, { emit: o }) {
|
|
2045
|
-
const t = n, e = o,
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
typeof t.size == "string" ?
|
|
2049
|
-
]), a =
|
|
2101
|
+
const t = n, e = o, r = G("avatar"), l = b(() => [
|
|
2102
|
+
r.b(),
|
|
2103
|
+
r.m(t.shape),
|
|
2104
|
+
typeof t.size == "string" ? r.m(t.size) : ""
|
|
2105
|
+
]), a = b(() => {
|
|
2050
2106
|
const y = {};
|
|
2051
2107
|
return typeof t.size == "number" && (y.width = `${t.size}px`, y.height = `${t.size}px`, y.lineHeight = `${t.size}px`), y;
|
|
2052
2108
|
}), p = (y) => {
|
|
2053
2109
|
e("error", y);
|
|
2054
2110
|
};
|
|
2055
|
-
return (y,
|
|
2111
|
+
return (y, C) => (h(), v("span", {
|
|
2056
2112
|
class: u(l.value),
|
|
2057
|
-
style:
|
|
2113
|
+
style: O(a.value)
|
|
2058
2114
|
}, [
|
|
2059
|
-
n.src ? (
|
|
2115
|
+
n.src ? (h(), v("img", {
|
|
2060
2116
|
key: 0,
|
|
2061
2117
|
src: n.src,
|
|
2062
2118
|
alt: n.alt,
|
|
2063
|
-
style:
|
|
2119
|
+
style: O({ objectFit: n.fit }),
|
|
2064
2120
|
onError: p
|
|
2065
|
-
}, null, 44,
|
|
2121
|
+
}, null, 44, It)) : n.icon ? (h(), v("span", {
|
|
2066
2122
|
key: 1,
|
|
2067
|
-
class: u(s(
|
|
2068
|
-
},
|
|
2123
|
+
class: u(s(r).e("icon"))
|
|
2124
|
+
}, B(n.icon), 3)) : (h(), v("span", {
|
|
2069
2125
|
key: 2,
|
|
2070
|
-
class: u(s(
|
|
2126
|
+
class: u(s(r).e("default"))
|
|
2071
2127
|
}, [
|
|
2072
|
-
|
|
2128
|
+
P(y.$slots, "default")
|
|
2073
2129
|
], 2))
|
|
2074
2130
|
], 6));
|
|
2075
2131
|
}
|
|
2076
|
-
}),
|
|
2132
|
+
}), Zt = /* @__PURE__ */ Q({
|
|
2077
2133
|
name: "XDescriptions",
|
|
2078
2134
|
__name: "index",
|
|
2079
2135
|
props: {
|
|
@@ -2088,34 +2144,34 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2088
2144
|
},
|
|
2089
2145
|
setup(n) {
|
|
2090
2146
|
const o = n, t = G("descriptions");
|
|
2091
|
-
|
|
2147
|
+
de("x-descriptions", {
|
|
2092
2148
|
props: o,
|
|
2093
|
-
column:
|
|
2149
|
+
column: b(() => o.column)
|
|
2094
2150
|
});
|
|
2095
|
-
const e =
|
|
2151
|
+
const e = b(() => [
|
|
2096
2152
|
t.b(),
|
|
2097
2153
|
t.m(o.size),
|
|
2098
2154
|
t.is("bordered", o.border)
|
|
2099
2155
|
]);
|
|
2100
|
-
return (
|
|
2156
|
+
return (r, l) => (h(), v("div", {
|
|
2101
2157
|
class: u(e.value)
|
|
2102
2158
|
}, [
|
|
2103
|
-
n.title ? (
|
|
2159
|
+
n.title ? (h(), v("div", {
|
|
2104
2160
|
key: 0,
|
|
2105
2161
|
class: u(s(t).e("title"))
|
|
2106
|
-
},
|
|
2162
|
+
}, B(n.title), 3)) : D("", !0),
|
|
2107
2163
|
m("div", {
|
|
2108
2164
|
class: u(s(t).e("body"))
|
|
2109
2165
|
}, [
|
|
2110
2166
|
m("table", null, [
|
|
2111
2167
|
m("tbody", null, [
|
|
2112
|
-
|
|
2168
|
+
P(r.$slots, "default")
|
|
2113
2169
|
])
|
|
2114
2170
|
])
|
|
2115
2171
|
], 2)
|
|
2116
2172
|
], 2));
|
|
2117
2173
|
}
|
|
2118
|
-
}),
|
|
2174
|
+
}), $t = ["colspan"], St = ["colspan"], Ut = /* @__PURE__ */ Q({
|
|
2119
2175
|
name: "XDescriptionsItem",
|
|
2120
2176
|
__name: "DescriptionsItem",
|
|
2121
2177
|
props: {
|
|
@@ -2125,51 +2181,51 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2125
2181
|
contentAlign: {}
|
|
2126
2182
|
},
|
|
2127
2183
|
setup(n) {
|
|
2128
|
-
const o = n, t = G("descriptions-item"), e = ue("x-descriptions"),
|
|
2129
|
-
var
|
|
2130
|
-
const
|
|
2131
|
-
return
|
|
2132
|
-
}), l =
|
|
2133
|
-
var
|
|
2134
|
-
return o.labelAlign || ((
|
|
2135
|
-
}), a =
|
|
2136
|
-
var
|
|
2137
|
-
return o.contentAlign || ((
|
|
2138
|
-
}), p =
|
|
2139
|
-
var
|
|
2140
|
-
return ((
|
|
2141
|
-
}), y =
|
|
2142
|
-
var
|
|
2143
|
-
return ((
|
|
2184
|
+
const o = n, t = G("descriptions-item"), e = ue("x-descriptions"), r = b(() => {
|
|
2185
|
+
var N;
|
|
2186
|
+
const C = {}, I = (N = e == null ? void 0 : e.props) == null ? void 0 : N.labelWidth;
|
|
2187
|
+
return I && (C.width = typeof I == "number" ? `${I}px` : I), C;
|
|
2188
|
+
}), l = b(() => {
|
|
2189
|
+
var C;
|
|
2190
|
+
return o.labelAlign || ((C = e == null ? void 0 : e.props) == null ? void 0 : C.labelAlign) || "right";
|
|
2191
|
+
}), a = b(() => {
|
|
2192
|
+
var C;
|
|
2193
|
+
return o.contentAlign || ((C = e == null ? void 0 : e.props) == null ? void 0 : C.contentAlign) || "left";
|
|
2194
|
+
}), p = b(() => {
|
|
2195
|
+
var C;
|
|
2196
|
+
return ((C = e == null ? void 0 : e.props) == null ? void 0 : C.colon) ?? !0;
|
|
2197
|
+
}), y = b(() => {
|
|
2198
|
+
var C;
|
|
2199
|
+
return ((C = e == null ? void 0 : e.props) == null ? void 0 : C.border) ?? !1;
|
|
2144
2200
|
});
|
|
2145
|
-
return (
|
|
2201
|
+
return (C, I) => y.value ? (h(), v(F, { key: 0 }, [
|
|
2146
2202
|
m("th", {
|
|
2147
2203
|
class: u([s(t).b(), s(t).e("label"), `is-${l.value}`]),
|
|
2148
|
-
style:
|
|
2149
|
-
},
|
|
2204
|
+
style: O(r.value)
|
|
2205
|
+
}, B(n.label) + B(p.value ? ":" : ""), 7),
|
|
2150
2206
|
m("td", {
|
|
2151
2207
|
class: u([s(t).e("content"), `is-${a.value}`]),
|
|
2152
2208
|
colspan: n.span * 2 - 1
|
|
2153
2209
|
}, [
|
|
2154
|
-
|
|
2155
|
-
], 10,
|
|
2156
|
-
], 64)) : (
|
|
2210
|
+
P(C.$slots, "default")
|
|
2211
|
+
], 10, $t)
|
|
2212
|
+
], 64)) : (h(), v("tr", {
|
|
2157
2213
|
key: 1,
|
|
2158
2214
|
class: u(s(t).b())
|
|
2159
2215
|
}, [
|
|
2160
2216
|
m("th", {
|
|
2161
2217
|
class: u([s(t).e("label"), `is-${l.value}`]),
|
|
2162
|
-
style:
|
|
2163
|
-
},
|
|
2218
|
+
style: O(r.value)
|
|
2219
|
+
}, B(n.label) + B(p.value ? ":" : ""), 7),
|
|
2164
2220
|
m("td", {
|
|
2165
2221
|
class: u([s(t).e("content"), `is-${a.value}`]),
|
|
2166
2222
|
colspan: n.span * 2 - 1
|
|
2167
2223
|
}, [
|
|
2168
|
-
|
|
2169
|
-
], 10,
|
|
2224
|
+
P(C.$slots, "default")
|
|
2225
|
+
], 10, St)
|
|
2170
2226
|
], 2));
|
|
2171
2227
|
}
|
|
2172
|
-
}),
|
|
2228
|
+
}), Jt = /* @__PURE__ */ Q({
|
|
2173
2229
|
name: "XScrollbar",
|
|
2174
2230
|
__name: "index",
|
|
2175
2231
|
props: {
|
|
@@ -2187,70 +2243,70 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2187
2243
|
},
|
|
2188
2244
|
emits: ["scroll"],
|
|
2189
2245
|
setup(n, { expose: o, emit: t }) {
|
|
2190
|
-
const e = n,
|
|
2191
|
-
const
|
|
2192
|
-
return e.height && (
|
|
2193
|
-
}),
|
|
2246
|
+
const e = n, r = t, l = G("scrollbar"), a = j(), p = j(), y = j("0"), C = j("0"), I = j(0), N = j(0), L = b(() => {
|
|
2247
|
+
const w = {};
|
|
2248
|
+
return e.height && (w.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (w.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), w;
|
|
2249
|
+
}), T = () => {
|
|
2194
2250
|
if (!a.value) return;
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2197
|
-
},
|
|
2251
|
+
const w = a.value.offsetHeight - 4, x = a.value.offsetWidth - 4, Y = a.value.scrollHeight, U = a.value.scrollWidth, W = w / Y, X = x / U;
|
|
2252
|
+
C.value = W >= 1 ? "0" : `${w * W}px`, y.value = X >= 1 ? "0" : `${x * X}px`;
|
|
2253
|
+
}, K = (w) => {
|
|
2198
2254
|
if (!a.value) return;
|
|
2199
|
-
const
|
|
2200
|
-
|
|
2201
|
-
},
|
|
2202
|
-
var
|
|
2203
|
-
(
|
|
2204
|
-
},
|
|
2205
|
-
a.value && (a.value.scrollTop =
|
|
2206
|
-
},
|
|
2207
|
-
a.value && (a.value.scrollLeft =
|
|
2255
|
+
const x = a.value.offsetHeight, Y = a.value.offsetWidth;
|
|
2256
|
+
N.value = a.value.scrollTop * 100 / x, I.value = a.value.scrollLeft * 100 / Y, r("scroll", w);
|
|
2257
|
+
}, H = (w) => {
|
|
2258
|
+
var x;
|
|
2259
|
+
(x = a.value) == null || x.scrollTo(w);
|
|
2260
|
+
}, E = (w) => {
|
|
2261
|
+
a.value && (a.value.scrollTop = w);
|
|
2262
|
+
}, $ = (w) => {
|
|
2263
|
+
a.value && (a.value.scrollLeft = w);
|
|
2208
2264
|
};
|
|
2209
|
-
let
|
|
2210
|
-
return
|
|
2211
|
-
e.native || (we(
|
|
2265
|
+
let M = null;
|
|
2266
|
+
return ce(() => {
|
|
2267
|
+
e.native || (we(T), e.noresize || (M = new ResizeObserver(T), p.value && M.observe(p.value), window.addEventListener("resize", T)));
|
|
2212
2268
|
}), fe(() => {
|
|
2213
|
-
|
|
2269
|
+
M && M.disconnect(), window.removeEventListener("resize", T);
|
|
2214
2270
|
}), o({
|
|
2215
|
-
scrollTo:
|
|
2216
|
-
setScrollTop:
|
|
2217
|
-
setScrollLeft:
|
|
2218
|
-
update:
|
|
2219
|
-
}), (
|
|
2271
|
+
scrollTo: H,
|
|
2272
|
+
setScrollTop: E,
|
|
2273
|
+
setScrollLeft: $,
|
|
2274
|
+
update: T
|
|
2275
|
+
}), (w, x) => (h(), v("div", {
|
|
2220
2276
|
class: u(s(l).b())
|
|
2221
2277
|
}, [
|
|
2222
2278
|
m("div", {
|
|
2223
2279
|
ref_key: "wrapRef",
|
|
2224
2280
|
ref: a,
|
|
2225
2281
|
class: u([s(l).e("wrap"), n.wrapClass, { [s(l).em("wrap", "hidden-default")]: !n.native }]),
|
|
2226
|
-
style:
|
|
2227
|
-
onScroll:
|
|
2282
|
+
style: O([L.value, { overflow: n.native ? "auto" : "hidden" }]),
|
|
2283
|
+
onScroll: K
|
|
2228
2284
|
}, [
|
|
2229
|
-
(
|
|
2285
|
+
(h(), se(pe(n.tag), {
|
|
2230
2286
|
ref_key: "resizeRef",
|
|
2231
2287
|
ref: p,
|
|
2232
2288
|
class: u([s(l).e("view"), n.viewClass]),
|
|
2233
|
-
style:
|
|
2289
|
+
style: O(n.viewStyle)
|
|
2234
2290
|
}, {
|
|
2235
|
-
default:
|
|
2236
|
-
|
|
2291
|
+
default: ye(() => [
|
|
2292
|
+
P(w.$slots, "default")
|
|
2237
2293
|
]),
|
|
2238
2294
|
_: 3
|
|
2239
2295
|
}, 8, ["class", "style"]))
|
|
2240
2296
|
], 38),
|
|
2241
|
-
!n.native &&
|
|
2297
|
+
!n.native && C.value ? (h(), v("div", {
|
|
2242
2298
|
key: 0,
|
|
2243
2299
|
class: u([s(l).e("bar"), s(l).is("vertical")]),
|
|
2244
|
-
style:
|
|
2245
|
-
}, null, 6)) :
|
|
2246
|
-
!n.native && y.value ? (
|
|
2300
|
+
style: O({ height: C.value, top: `${N.value}%` })
|
|
2301
|
+
}, null, 6)) : D("", !0),
|
|
2302
|
+
!n.native && y.value ? (h(), v("div", {
|
|
2247
2303
|
key: 1,
|
|
2248
2304
|
class: u([s(l).e("bar"), s(l).is("horizontal")]),
|
|
2249
|
-
style:
|
|
2250
|
-
}, null, 6)) :
|
|
2305
|
+
style: O({ width: y.value, left: `${I.value}%` })
|
|
2306
|
+
}, null, 6)) : D("", !0)
|
|
2251
2307
|
], 2));
|
|
2252
2308
|
}
|
|
2253
|
-
}),
|
|
2309
|
+
}), qt = /* @__PURE__ */ Q({
|
|
2254
2310
|
name: "XCollapse",
|
|
2255
2311
|
__name: "index",
|
|
2256
2312
|
props: {
|
|
@@ -2259,10 +2315,10 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2259
2315
|
},
|
|
2260
2316
|
emits: ["update:modelValue", "change"],
|
|
2261
2317
|
setup(n, { emit: o }) {
|
|
2262
|
-
const t = n, e = o,
|
|
2318
|
+
const t = n, e = o, r = G("collapse"), l = j([]);
|
|
2263
2319
|
return te(() => t.modelValue, (p) => {
|
|
2264
2320
|
Array.isArray(p) ? l.value = p : p ? l.value = [p] : l.value = [];
|
|
2265
|
-
}, { immediate: !0 }),
|
|
2321
|
+
}, { immediate: !0 }), de("collapse", {
|
|
2266
2322
|
activeNames: l,
|
|
2267
2323
|
handleItemClick: (p) => {
|
|
2268
2324
|
if (t.accordion) {
|
|
@@ -2273,13 +2329,13 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2273
2329
|
y > -1 ? l.value.splice(y, 1) : l.value.push(p), e("update:modelValue", l.value), e("change", l.value);
|
|
2274
2330
|
}
|
|
2275
2331
|
}
|
|
2276
|
-
}), (p, y) => (
|
|
2277
|
-
class: u(s(
|
|
2332
|
+
}), (p, y) => (h(), v("div", {
|
|
2333
|
+
class: u(s(r).b())
|
|
2278
2334
|
}, [
|
|
2279
|
-
|
|
2335
|
+
P(p.$slots, "default")
|
|
2280
2336
|
], 2));
|
|
2281
2337
|
}
|
|
2282
|
-
}),
|
|
2338
|
+
}), _t = /* @__PURE__ */ Q({
|
|
2283
2339
|
name: "XCollapseItem",
|
|
2284
2340
|
__name: "CollapseItem",
|
|
2285
2341
|
props: {
|
|
@@ -2288,10 +2344,10 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2288
2344
|
disabled: { type: Boolean }
|
|
2289
2345
|
},
|
|
2290
2346
|
setup(n) {
|
|
2291
|
-
const o = n, t = G("collapse-item"), e = ue("collapse"), { activeNames:
|
|
2347
|
+
const o = n, t = G("collapse-item"), e = ue("collapse"), { activeNames: r, handleItemClick: l } = e, a = b(() => r.value.includes(o.name)), p = () => {
|
|
2292
2348
|
o.disabled || l(o.name);
|
|
2293
2349
|
};
|
|
2294
|
-
return (y,
|
|
2350
|
+
return (y, C) => (h(), v("div", {
|
|
2295
2351
|
class: u([s(t).b(), s(t).is("active", a.value), s(t).is("disabled", n.disabled)])
|
|
2296
2352
|
}, [
|
|
2297
2353
|
m("div", {
|
|
@@ -2306,24 +2362,24 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2306
2362
|
size: 12
|
|
2307
2363
|
})
|
|
2308
2364
|
], 2),
|
|
2309
|
-
|
|
2310
|
-
|
|
2365
|
+
P(y.$slots, "title", {}, () => [
|
|
2366
|
+
q(B(n.title), 1)
|
|
2311
2367
|
])
|
|
2312
2368
|
], 2),
|
|
2313
|
-
|
|
2369
|
+
ge(m("div", {
|
|
2314
2370
|
class: u(s(t).e("content"))
|
|
2315
2371
|
}, [
|
|
2316
2372
|
m("div", {
|
|
2317
2373
|
class: u(s(t).e("content-box"))
|
|
2318
2374
|
}, [
|
|
2319
|
-
|
|
2375
|
+
P(y.$slots, "default")
|
|
2320
2376
|
], 2)
|
|
2321
2377
|
], 2), [
|
|
2322
2378
|
[Me, a.value]
|
|
2323
2379
|
])
|
|
2324
2380
|
], 2));
|
|
2325
2381
|
}
|
|
2326
|
-
}),
|
|
2382
|
+
}), Lt = ["src", "loading"], Dt = ["src"], ea = /* @__PURE__ */ Q({
|
|
2327
2383
|
name: "XImage",
|
|
2328
2384
|
__name: "index",
|
|
2329
2385
|
props: {
|
|
@@ -2340,81 +2396,81 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2340
2396
|
},
|
|
2341
2397
|
emits: ["load", "error"],
|
|
2342
2398
|
setup(n, { emit: o }) {
|
|
2343
|
-
const t = n, e = o,
|
|
2399
|
+
const t = n, e = o, r = G("image"), l = j(!0), a = j(!1), p = j(!1), y = j(0), C = b(() => ({
|
|
2344
2400
|
width: typeof t.width == "number" ? `${t.width}px` : t.width,
|
|
2345
2401
|
height: typeof t.height == "number" ? `${t.height}px` : t.height,
|
|
2346
2402
|
objectFit: t.fit
|
|
2347
|
-
})),
|
|
2348
|
-
l.value = !1, e("load",
|
|
2349
|
-
},
|
|
2350
|
-
l.value = !1, a.value = !0, e("error",
|
|
2351
|
-
},
|
|
2403
|
+
})), I = b(() => t.previewList.length > 0 ? t.previewList : [t.src]), N = b(() => I.value[y.value]), L = (w) => {
|
|
2404
|
+
l.value = !1, e("load", w);
|
|
2405
|
+
}, T = (w) => {
|
|
2406
|
+
l.value = !1, a.value = !0, e("error", w);
|
|
2407
|
+
}, K = () => {
|
|
2352
2408
|
t.preview && (y.value = t.initialIndex, p.value = !0);
|
|
2353
|
-
},
|
|
2409
|
+
}, H = () => {
|
|
2354
2410
|
p.value = !1;
|
|
2355
|
-
},
|
|
2356
|
-
y.value > 0 ? y.value-- : y.value =
|
|
2357
|
-
},
|
|
2358
|
-
y.value <
|
|
2359
|
-
},
|
|
2411
|
+
}, E = () => {
|
|
2412
|
+
y.value > 0 ? y.value-- : y.value = I.value.length - 1;
|
|
2413
|
+
}, $ = () => {
|
|
2414
|
+
y.value < I.value.length - 1 ? y.value++ : y.value = 0;
|
|
2415
|
+
}, M = (w) => {
|
|
2360
2416
|
if (p.value)
|
|
2361
|
-
switch (
|
|
2417
|
+
switch (w.key) {
|
|
2362
2418
|
case "ArrowLeft":
|
|
2363
|
-
|
|
2419
|
+
E();
|
|
2364
2420
|
break;
|
|
2365
2421
|
case "ArrowRight":
|
|
2366
|
-
|
|
2422
|
+
$();
|
|
2367
2423
|
break;
|
|
2368
2424
|
case "Escape":
|
|
2369
|
-
|
|
2425
|
+
H();
|
|
2370
2426
|
break;
|
|
2371
2427
|
}
|
|
2372
2428
|
};
|
|
2373
|
-
return typeof window < "u" && window.addEventListener("keydown",
|
|
2374
|
-
class: u(s(
|
|
2375
|
-
style:
|
|
2429
|
+
return typeof window < "u" && window.addEventListener("keydown", M), (w, x) => (h(), v("div", {
|
|
2430
|
+
class: u(s(r).b()),
|
|
2431
|
+
style: O({ width: C.value.width, height: C.value.height })
|
|
2376
2432
|
}, [
|
|
2377
2433
|
m("img", {
|
|
2378
2434
|
src: n.src,
|
|
2379
|
-
class: u(s(
|
|
2380
|
-
style:
|
|
2435
|
+
class: u(s(r).e("inner")),
|
|
2436
|
+
style: O(C.value),
|
|
2381
2437
|
loading: n.lazy ? "lazy" : "eager",
|
|
2382
|
-
onLoad:
|
|
2383
|
-
onError:
|
|
2384
|
-
onClick:
|
|
2385
|
-
}, null, 46,
|
|
2386
|
-
l.value ? (
|
|
2438
|
+
onLoad: L,
|
|
2439
|
+
onError: T,
|
|
2440
|
+
onClick: K
|
|
2441
|
+
}, null, 46, Lt),
|
|
2442
|
+
l.value ? (h(), v("div", {
|
|
2387
2443
|
key: 0,
|
|
2388
|
-
class: u(s(
|
|
2444
|
+
class: u(s(r).e("placeholder"))
|
|
2389
2445
|
}, [
|
|
2390
|
-
|
|
2446
|
+
P(w.$slots, "placeholder", {}, () => [
|
|
2391
2447
|
J(s(Z), {
|
|
2392
2448
|
name: "loading",
|
|
2393
2449
|
size: 24
|
|
2394
2450
|
})
|
|
2395
2451
|
])
|
|
2396
|
-
], 2)) :
|
|
2397
|
-
a.value ? (
|
|
2452
|
+
], 2)) : D("", !0),
|
|
2453
|
+
a.value ? (h(), v("div", {
|
|
2398
2454
|
key: 1,
|
|
2399
|
-
class: u(s(
|
|
2455
|
+
class: u(s(r).e("error"))
|
|
2400
2456
|
}, [
|
|
2401
|
-
|
|
2457
|
+
P(w.$slots, "error", {}, () => [
|
|
2402
2458
|
J(s(Z), {
|
|
2403
2459
|
name: "image",
|
|
2404
2460
|
size: 24
|
|
2405
2461
|
}),
|
|
2406
|
-
|
|
2462
|
+
x[1] || (x[1] = m("span", null, "加载失败", -1))
|
|
2407
2463
|
])
|
|
2408
|
-
], 2)) :
|
|
2409
|
-
(
|
|
2410
|
-
p.value ? (
|
|
2464
|
+
], 2)) : D("", !0),
|
|
2465
|
+
(h(), se(Se, { to: "body" }, [
|
|
2466
|
+
p.value ? (h(), v("div", {
|
|
2411
2467
|
key: 0,
|
|
2412
|
-
class: u(s(
|
|
2413
|
-
onClick:
|
|
2468
|
+
class: u(s(r).e("preview")),
|
|
2469
|
+
onClick: H
|
|
2414
2470
|
}, [
|
|
2415
2471
|
m("span", {
|
|
2416
|
-
class: u(s(
|
|
2417
|
-
onClick: re(
|
|
2472
|
+
class: u(s(r).e("preview-close")),
|
|
2473
|
+
onClick: re(H, ["stop"])
|
|
2418
2474
|
}, [
|
|
2419
2475
|
J(s(Z), {
|
|
2420
2476
|
name: "close",
|
|
@@ -2422,40 +2478,40 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2422
2478
|
})
|
|
2423
2479
|
], 2),
|
|
2424
2480
|
m("img", {
|
|
2425
|
-
src:
|
|
2426
|
-
class: u(s(
|
|
2427
|
-
onClick:
|
|
2481
|
+
src: N.value,
|
|
2482
|
+
class: u(s(r).e("preview-image")),
|
|
2483
|
+
onClick: x[0] || (x[0] = re(() => {
|
|
2428
2484
|
}, ["stop"]))
|
|
2429
|
-
}, null, 10,
|
|
2430
|
-
|
|
2485
|
+
}, null, 10, Dt),
|
|
2486
|
+
I.value.length > 1 ? (h(), v("span", {
|
|
2431
2487
|
key: 0,
|
|
2432
|
-
class: u([s(
|
|
2433
|
-
onClick: re(
|
|
2488
|
+
class: u([s(r).e("preview-arrow"), s(r).em("preview-arrow", "left")]),
|
|
2489
|
+
onClick: re(E, ["stop"])
|
|
2434
2490
|
}, [
|
|
2435
2491
|
J(s(Z), {
|
|
2436
2492
|
name: "left",
|
|
2437
2493
|
size: 24
|
|
2438
2494
|
})
|
|
2439
|
-
], 2)) :
|
|
2440
|
-
|
|
2495
|
+
], 2)) : D("", !0),
|
|
2496
|
+
I.value.length > 1 ? (h(), v("span", {
|
|
2441
2497
|
key: 1,
|
|
2442
|
-
class: u([s(
|
|
2443
|
-
onClick: re(
|
|
2498
|
+
class: u([s(r).e("preview-arrow"), s(r).em("preview-arrow", "right")]),
|
|
2499
|
+
onClick: re($, ["stop"])
|
|
2444
2500
|
}, [
|
|
2445
2501
|
J(s(Z), {
|
|
2446
2502
|
name: "right",
|
|
2447
2503
|
size: 24
|
|
2448
2504
|
})
|
|
2449
|
-
], 2)) :
|
|
2450
|
-
|
|
2505
|
+
], 2)) : D("", !0),
|
|
2506
|
+
I.value.length > 1 ? (h(), v("div", {
|
|
2451
2507
|
key: 2,
|
|
2452
|
-
class: u(s(
|
|
2453
|
-
},
|
|
2454
|
-
], 2)) :
|
|
2508
|
+
class: u(s(r).e("preview-counter"))
|
|
2509
|
+
}, B(y.value + 1) + " / " + B(I.value.length), 3)) : D("", !0)
|
|
2510
|
+
], 2)) : D("", !0)
|
|
2455
2511
|
]))
|
|
2456
2512
|
], 6));
|
|
2457
2513
|
}
|
|
2458
|
-
}),
|
|
2514
|
+
}), Kt = ["onClick"], ta = /* @__PURE__ */ Q({
|
|
2459
2515
|
name: "XCalendar",
|
|
2460
2516
|
__name: "index",
|
|
2461
2517
|
props: {
|
|
@@ -2464,67 +2520,67 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2464
2520
|
},
|
|
2465
2521
|
emits: ["update:modelValue", "select", "change"],
|
|
2466
2522
|
setup(n, { emit: o }) {
|
|
2467
|
-
const t = n, e = o,
|
|
2468
|
-
const
|
|
2469
|
-
for (let
|
|
2470
|
-
const X = new Date(l.value, a.value, -
|
|
2471
|
-
|
|
2523
|
+
const t = n, e = o, r = G("calendar"), l = j(t.modelValue.getFullYear()), a = j(t.modelValue.getMonth()), p = ["日", "一", "二", "三", "四", "五", "六"], y = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], C = /* @__PURE__ */ new Date(), I = b(() => {
|
|
2524
|
+
const M = [], w = new Date(l.value, a.value, 1), x = new Date(l.value, a.value + 1, 0), Y = w.getDay();
|
|
2525
|
+
for (let W = Y - 1; W >= 0; W--) {
|
|
2526
|
+
const X = new Date(l.value, a.value, -W);
|
|
2527
|
+
M.push({
|
|
2472
2528
|
date: X,
|
|
2473
2529
|
isCurrentMonth: !1,
|
|
2474
|
-
isToday:
|
|
2475
|
-
isSelected:
|
|
2530
|
+
isToday: N(X, C),
|
|
2531
|
+
isSelected: N(X, t.modelValue)
|
|
2476
2532
|
});
|
|
2477
2533
|
}
|
|
2478
|
-
for (let
|
|
2479
|
-
const X = new Date(l.value, a.value,
|
|
2480
|
-
|
|
2534
|
+
for (let W = 1; W <= x.getDate(); W++) {
|
|
2535
|
+
const X = new Date(l.value, a.value, W);
|
|
2536
|
+
M.push({
|
|
2481
2537
|
date: X,
|
|
2482
2538
|
isCurrentMonth: !0,
|
|
2483
|
-
isToday:
|
|
2484
|
-
isSelected:
|
|
2539
|
+
isToday: N(X, C),
|
|
2540
|
+
isSelected: N(X, t.modelValue)
|
|
2485
2541
|
});
|
|
2486
2542
|
}
|
|
2487
|
-
const U = 42 -
|
|
2488
|
-
for (let
|
|
2489
|
-
const X = new Date(l.value, a.value + 1,
|
|
2490
|
-
|
|
2543
|
+
const U = 42 - M.length;
|
|
2544
|
+
for (let W = 1; W <= U; W++) {
|
|
2545
|
+
const X = new Date(l.value, a.value + 1, W);
|
|
2546
|
+
M.push({
|
|
2491
2547
|
date: X,
|
|
2492
2548
|
isCurrentMonth: !1,
|
|
2493
|
-
isToday:
|
|
2494
|
-
isSelected:
|
|
2549
|
+
isToday: N(X, C),
|
|
2550
|
+
isSelected: N(X, t.modelValue)
|
|
2495
2551
|
});
|
|
2496
2552
|
}
|
|
2497
|
-
return
|
|
2498
|
-
}),
|
|
2499
|
-
e("update:modelValue",
|
|
2500
|
-
},
|
|
2553
|
+
return M;
|
|
2554
|
+
}), N = (M, w) => M.getFullYear() === w.getFullYear() && M.getMonth() === w.getMonth() && M.getDate() === w.getDate(), L = (M) => {
|
|
2555
|
+
e("update:modelValue", M.date), e("select", M.date), e("change", M.date);
|
|
2556
|
+
}, T = () => {
|
|
2501
2557
|
l.value--;
|
|
2502
|
-
},
|
|
2558
|
+
}, K = () => {
|
|
2503
2559
|
l.value++;
|
|
2504
|
-
},
|
|
2560
|
+
}, H = () => {
|
|
2505
2561
|
a.value === 0 ? (a.value = 11, l.value--) : a.value--;
|
|
2506
|
-
},
|
|
2562
|
+
}, E = () => {
|
|
2507
2563
|
a.value === 11 ? (a.value = 0, l.value++) : a.value++;
|
|
2508
|
-
},
|
|
2509
|
-
l.value =
|
|
2564
|
+
}, $ = () => {
|
|
2565
|
+
l.value = C.getFullYear(), a.value = C.getMonth(), e("update:modelValue", C), e("select", C);
|
|
2510
2566
|
};
|
|
2511
|
-
return te(() => t.modelValue, (
|
|
2512
|
-
l.value =
|
|
2513
|
-
}), (
|
|
2514
|
-
class: u(s(
|
|
2567
|
+
return te(() => t.modelValue, (M) => {
|
|
2568
|
+
l.value = M.getFullYear(), a.value = M.getMonth();
|
|
2569
|
+
}), (M, w) => (h(), v("div", {
|
|
2570
|
+
class: u(s(r).b())
|
|
2515
2571
|
}, [
|
|
2516
2572
|
m("div", {
|
|
2517
|
-
class: u(s(
|
|
2573
|
+
class: u(s(r).e("header"))
|
|
2518
2574
|
}, [
|
|
2519
2575
|
m("div", {
|
|
2520
|
-
class: u(s(
|
|
2521
|
-
},
|
|
2576
|
+
class: u(s(r).e("title"))
|
|
2577
|
+
}, B(l.value) + " 年 " + B(y[a.value]), 3),
|
|
2522
2578
|
m("div", {
|
|
2523
|
-
class: u(s(
|
|
2579
|
+
class: u(s(r).e("actions"))
|
|
2524
2580
|
}, [
|
|
2525
2581
|
m("button", {
|
|
2526
|
-
class: u(s(
|
|
2527
|
-
onClick:
|
|
2582
|
+
class: u(s(r).e("btn")),
|
|
2583
|
+
onClick: T
|
|
2528
2584
|
}, [
|
|
2529
2585
|
J(s(Z), {
|
|
2530
2586
|
name: "d-arrow-left",
|
|
@@ -2532,8 +2588,8 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2532
2588
|
})
|
|
2533
2589
|
], 2),
|
|
2534
2590
|
m("button", {
|
|
2535
|
-
class: u(s(
|
|
2536
|
-
onClick:
|
|
2591
|
+
class: u(s(r).e("btn")),
|
|
2592
|
+
onClick: H
|
|
2537
2593
|
}, [
|
|
2538
2594
|
J(s(Z), {
|
|
2539
2595
|
name: "arrow-left",
|
|
@@ -2541,12 +2597,12 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2541
2597
|
})
|
|
2542
2598
|
], 2),
|
|
2543
2599
|
m("button", {
|
|
2544
|
-
class: u(s(
|
|
2545
|
-
onClick:
|
|
2600
|
+
class: u(s(r).e("btn")),
|
|
2601
|
+
onClick: $
|
|
2546
2602
|
}, "今天", 2),
|
|
2547
2603
|
m("button", {
|
|
2548
|
-
class: u(s(
|
|
2549
|
-
onClick:
|
|
2604
|
+
class: u(s(r).e("btn")),
|
|
2605
|
+
onClick: E
|
|
2550
2606
|
}, [
|
|
2551
2607
|
J(s(Z), {
|
|
2552
2608
|
name: "arrow-right",
|
|
@@ -2554,8 +2610,8 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2554
2610
|
})
|
|
2555
2611
|
], 2),
|
|
2556
2612
|
m("button", {
|
|
2557
|
-
class: u(s(
|
|
2558
|
-
onClick:
|
|
2613
|
+
class: u(s(r).e("btn")),
|
|
2614
|
+
onClick: K
|
|
2559
2615
|
}, [
|
|
2560
2616
|
J(s(Z), {
|
|
2561
2617
|
name: "d-arrow-right",
|
|
@@ -2565,37 +2621,37 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2565
2621
|
], 2)
|
|
2566
2622
|
], 2),
|
|
2567
2623
|
m("div", {
|
|
2568
|
-
class: u(s(
|
|
2624
|
+
class: u(s(r).e("weekdays"))
|
|
2569
2625
|
}, [
|
|
2570
|
-
(
|
|
2571
|
-
key:
|
|
2572
|
-
class: u(s(
|
|
2573
|
-
},
|
|
2626
|
+
(h(), v(F, null, _(p, (x) => m("div", {
|
|
2627
|
+
key: x,
|
|
2628
|
+
class: u(s(r).e("weekday"))
|
|
2629
|
+
}, B(x), 3)), 64))
|
|
2574
2630
|
], 2),
|
|
2575
2631
|
m("div", {
|
|
2576
|
-
class: u(s(
|
|
2632
|
+
class: u(s(r).e("body"))
|
|
2577
2633
|
}, [
|
|
2578
|
-
(
|
|
2579
|
-
key:
|
|
2634
|
+
(h(!0), v(F, null, _(I.value, (x, Y) => (h(), v("div", {
|
|
2635
|
+
key: Y,
|
|
2580
2636
|
class: u([
|
|
2581
|
-
s(
|
|
2582
|
-
s(
|
|
2583
|
-
s(
|
|
2584
|
-
s(
|
|
2637
|
+
s(r).e("day"),
|
|
2638
|
+
s(r).is("current-month", x.isCurrentMonth),
|
|
2639
|
+
s(r).is("today", x.isToday),
|
|
2640
|
+
s(r).is("selected", x.isSelected)
|
|
2585
2641
|
]),
|
|
2586
|
-
onClick: (U) =>
|
|
2642
|
+
onClick: (U) => L(x)
|
|
2587
2643
|
}, [
|
|
2588
|
-
|
|
2589
|
-
date:
|
|
2590
|
-
isCurrentMonth:
|
|
2644
|
+
P(M.$slots, "default", {
|
|
2645
|
+
date: x.date,
|
|
2646
|
+
isCurrentMonth: x.isCurrentMonth
|
|
2591
2647
|
}, () => [
|
|
2592
|
-
|
|
2648
|
+
q(B(x.date.getDate()), 1)
|
|
2593
2649
|
])
|
|
2594
|
-
], 10,
|
|
2650
|
+
], 10, Kt))), 128))
|
|
2595
2651
|
], 2)
|
|
2596
2652
|
], 2));
|
|
2597
2653
|
}
|
|
2598
|
-
}),
|
|
2654
|
+
}), aa = /* @__PURE__ */ Q({
|
|
2599
2655
|
name: "XQRCode",
|
|
2600
2656
|
__name: "index",
|
|
2601
2657
|
props: {
|
|
@@ -2608,79 +2664,79 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2608
2664
|
},
|
|
2609
2665
|
emits: ["ready", "error"],
|
|
2610
2666
|
setup(n, { emit: o }) {
|
|
2611
|
-
const t = n, e = o,
|
|
2667
|
+
const t = n, e = o, r = G("qrcode"), l = j(), a = async () => {
|
|
2612
2668
|
if (!(!l.value || !t.value))
|
|
2613
2669
|
try {
|
|
2614
|
-
const
|
|
2615
|
-
|
|
2616
|
-
} catch (
|
|
2617
|
-
e("error",
|
|
2670
|
+
const L = await p(t.value, t.level);
|
|
2671
|
+
I(L), e("ready", l.value);
|
|
2672
|
+
} catch (L) {
|
|
2673
|
+
e("error", L);
|
|
2618
2674
|
}
|
|
2619
|
-
}, p = async (
|
|
2620
|
-
const
|
|
2621
|
-
for (let
|
|
2622
|
-
|
|
2623
|
-
y(
|
|
2624
|
-
for (let
|
|
2625
|
-
|
|
2626
|
-
const
|
|
2627
|
-
let
|
|
2628
|
-
for (let
|
|
2629
|
-
|
|
2630
|
-
for (let
|
|
2631
|
-
for (let
|
|
2632
|
-
const
|
|
2633
|
-
if (!
|
|
2634
|
-
const U =
|
|
2635
|
-
for (let
|
|
2675
|
+
}, p = async (L, T) => {
|
|
2676
|
+
const H = [];
|
|
2677
|
+
for (let M = 0; M < 21; M++)
|
|
2678
|
+
H.push(new Array(21).fill(0));
|
|
2679
|
+
y(H, 0, 0), y(H, 14, 0), y(H, 0, 14);
|
|
2680
|
+
for (let M = 8; M < 13; M++)
|
|
2681
|
+
H[6][M] = M % 2 === 0 ? 1 : 0, H[M][6] = M % 2 === 0 ? 1 : 0;
|
|
2682
|
+
const E = new TextEncoder().encode(L);
|
|
2683
|
+
let $ = 0;
|
|
2684
|
+
for (let M = 20; M > 0; M -= 2) {
|
|
2685
|
+
M === 6 && M--;
|
|
2686
|
+
for (let w = 0; w < 21; w++)
|
|
2687
|
+
for (let x = 0; x < 2; x++) {
|
|
2688
|
+
const Y = M - x;
|
|
2689
|
+
if (!C(Y, w, 21) && $ < E.length) {
|
|
2690
|
+
const U = E[$];
|
|
2691
|
+
for (let W = 7; W >= 0 && !(w < 21 && !C(Y, w, 21) && (H[w][Y] = U >> W & 1, w++, w >= 21)); W--)
|
|
2636
2692
|
;
|
|
2637
|
-
|
|
2693
|
+
$++;
|
|
2638
2694
|
}
|
|
2639
2695
|
}
|
|
2640
2696
|
}
|
|
2641
|
-
return
|
|
2642
|
-
}, y = (
|
|
2643
|
-
for (let
|
|
2644
|
-
for (let
|
|
2645
|
-
(
|
|
2646
|
-
},
|
|
2697
|
+
return H;
|
|
2698
|
+
}, y = (L, T, K) => {
|
|
2699
|
+
for (let H = 0; H < 7; H++)
|
|
2700
|
+
for (let E = 0; E < 7; E++)
|
|
2701
|
+
(H === 0 || H === 6 || E === 0 || E === 6 || H >= 2 && H <= 4 && E >= 2 && E <= 4) && (L[T + H][K + E] = 1);
|
|
2702
|
+
}, C = (L, T, K) => L < 8 && T < 8 || L < 8 && T >= K - 8 || L >= K - 8 && T < 8 || L === 6 || T === 6, I = (L) => {
|
|
2647
2703
|
if (!l.value) return;
|
|
2648
|
-
const
|
|
2649
|
-
if (!
|
|
2650
|
-
const
|
|
2651
|
-
l.value.width = t.size, l.value.height = t.size,
|
|
2652
|
-
for (let
|
|
2653
|
-
for (let
|
|
2654
|
-
|
|
2655
|
-
},
|
|
2704
|
+
const T = l.value.getContext("2d");
|
|
2705
|
+
if (!T) return;
|
|
2706
|
+
const K = L.length, H = t.size / K;
|
|
2707
|
+
l.value.width = t.size, l.value.height = t.size, T.fillStyle = t.bgColor, T.fillRect(0, 0, t.size, t.size), T.fillStyle = t.fgColor;
|
|
2708
|
+
for (let E = 0; E < K; E++)
|
|
2709
|
+
for (let $ = 0; $ < K; $++)
|
|
2710
|
+
L[E][$] && T.fillRect($ * H, E * H, H, H);
|
|
2711
|
+
}, N = () => {
|
|
2656
2712
|
if (!l.value) return;
|
|
2657
|
-
const
|
|
2658
|
-
|
|
2713
|
+
const L = document.createElement("a");
|
|
2714
|
+
L.download = "qrcode.png", L.href = l.value.toDataURL("image/png"), L.click();
|
|
2659
2715
|
};
|
|
2660
2716
|
return te(() => [t.value, t.size, t.bgColor, t.fgColor, t.level], () => {
|
|
2661
2717
|
a();
|
|
2662
|
-
}),
|
|
2718
|
+
}), ce(() => {
|
|
2663
2719
|
a();
|
|
2664
|
-
}), (
|
|
2665
|
-
class: u(s(
|
|
2720
|
+
}), (L, T) => (h(), v("div", {
|
|
2721
|
+
class: u(s(r).b())
|
|
2666
2722
|
}, [
|
|
2667
2723
|
m("canvas", {
|
|
2668
2724
|
ref_key: "canvasRef",
|
|
2669
2725
|
ref: l,
|
|
2670
|
-
class: u(s(
|
|
2726
|
+
class: u(s(r).e("canvas"))
|
|
2671
2727
|
}, null, 2),
|
|
2672
|
-
n.showDownload ? (
|
|
2728
|
+
n.showDownload ? (h(), v("div", {
|
|
2673
2729
|
key: 0,
|
|
2674
|
-
class: u(s(
|
|
2730
|
+
class: u(s(r).e("actions"))
|
|
2675
2731
|
}, [
|
|
2676
2732
|
m("button", {
|
|
2677
|
-
class: u(s(
|
|
2678
|
-
onClick:
|
|
2733
|
+
class: u(s(r).e("download")),
|
|
2734
|
+
onClick: N
|
|
2679
2735
|
}, " 下载二维码 ", 2)
|
|
2680
|
-
], 2)) :
|
|
2736
|
+
], 2)) : D("", !0)
|
|
2681
2737
|
], 2));
|
|
2682
2738
|
}
|
|
2683
|
-
}),
|
|
2739
|
+
}), la = /* @__PURE__ */ Q({
|
|
2684
2740
|
name: "XVirtualScroll",
|
|
2685
2741
|
__name: "index",
|
|
2686
2742
|
props: {
|
|
@@ -2692,57 +2748,57 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2692
2748
|
},
|
|
2693
2749
|
emits: ["scroll"],
|
|
2694
2750
|
setup(n, { expose: o, emit: t }) {
|
|
2695
|
-
const e = n,
|
|
2696
|
-
const
|
|
2697
|
-
return Math.ceil(
|
|
2698
|
-
}),
|
|
2751
|
+
const e = n, r = t, l = G("virtual-scroll"), a = j(), p = j(0), y = b(() => typeof e.height == "number" ? `${e.height}px` : e.height), C = b(() => e.items.length * e.itemSize), I = b(() => {
|
|
2752
|
+
const M = typeof e.height == "number" ? e.height : parseInt(e.height) || 400;
|
|
2753
|
+
return Math.ceil(M / e.itemSize) + e.buffer * 2;
|
|
2754
|
+
}), N = b(() => {
|
|
2699
2755
|
if (!e.virtual) return 0;
|
|
2700
|
-
const
|
|
2701
|
-
return Math.max(0,
|
|
2702
|
-
}),
|
|
2703
|
-
|
|
2704
|
-
index:
|
|
2705
|
-
})) : e.items),
|
|
2706
|
-
const
|
|
2707
|
-
p.value =
|
|
2756
|
+
const M = Math.floor(p.value / e.itemSize) - e.buffer;
|
|
2757
|
+
return Math.max(0, M);
|
|
2758
|
+
}), L = b(() => e.virtual ? Math.min(e.items.length, N.value + I.value) : e.items.length), T = b(() => e.virtual ? e.items.slice(N.value, L.value).map((M, w) => ({
|
|
2759
|
+
...M,
|
|
2760
|
+
index: N.value + w
|
|
2761
|
+
})) : e.items), K = b(() => N.value * e.itemSize), H = (M) => {
|
|
2762
|
+
const w = M.target;
|
|
2763
|
+
p.value = w.scrollTop, r("scroll", p.value);
|
|
2708
2764
|
};
|
|
2709
2765
|
return o({
|
|
2710
|
-
scrollToIndex: (
|
|
2711
|
-
a.value && (a.value.scrollTop =
|
|
2766
|
+
scrollToIndex: (M) => {
|
|
2767
|
+
a.value && (a.value.scrollTop = M * e.itemSize);
|
|
2712
2768
|
},
|
|
2713
2769
|
scrollToBottom: () => {
|
|
2714
|
-
a.value && (a.value.scrollTop =
|
|
2770
|
+
a.value && (a.value.scrollTop = C.value);
|
|
2715
2771
|
}
|
|
2716
|
-
}), (
|
|
2772
|
+
}), (M, w) => (h(), v("div", {
|
|
2717
2773
|
ref_key: "containerRef",
|
|
2718
2774
|
ref: a,
|
|
2719
2775
|
class: u(s(l).b()),
|
|
2720
|
-
style:
|
|
2721
|
-
onScroll:
|
|
2776
|
+
style: O({ height: y.value }),
|
|
2777
|
+
onScroll: H
|
|
2722
2778
|
}, [
|
|
2723
2779
|
m("div", {
|
|
2724
2780
|
class: u(s(l).e("wrapper")),
|
|
2725
|
-
style:
|
|
2781
|
+
style: O({ height: `${C.value}px` })
|
|
2726
2782
|
}, [
|
|
2727
2783
|
m("div", {
|
|
2728
2784
|
class: u(s(l).e("content")),
|
|
2729
|
-
style:
|
|
2785
|
+
style: O({ transform: `translateY(${K.value}px)` })
|
|
2730
2786
|
}, [
|
|
2731
|
-
(
|
|
2732
|
-
key:
|
|
2787
|
+
(h(!0), v(F, null, _(T.value, (x, Y) => (h(), v("div", {
|
|
2788
|
+
key: x.id ?? Y,
|
|
2733
2789
|
class: u(s(l).e("item")),
|
|
2734
|
-
style:
|
|
2790
|
+
style: O({ height: `${n.itemSize}px` })
|
|
2735
2791
|
}, [
|
|
2736
|
-
|
|
2737
|
-
item:
|
|
2738
|
-
index:
|
|
2792
|
+
P(M.$slots, "default", {
|
|
2793
|
+
item: x,
|
|
2794
|
+
index: x.index
|
|
2739
2795
|
})
|
|
2740
2796
|
], 6))), 128))
|
|
2741
2797
|
], 6)
|
|
2742
2798
|
], 6)
|
|
2743
2799
|
], 38));
|
|
2744
2800
|
}
|
|
2745
|
-
}),
|
|
2801
|
+
}), na = /* @__PURE__ */ Q({
|
|
2746
2802
|
name: "XInfiniteScroll",
|
|
2747
2803
|
__name: "index",
|
|
2748
2804
|
props: {
|
|
@@ -2755,76 +2811,76 @@ const Vt = /* @__PURE__ */ Q({
|
|
|
2755
2811
|
},
|
|
2756
2812
|
emits: ["load"],
|
|
2757
2813
|
setup(n, { emit: o }) {
|
|
2758
|
-
const t = n, e = o,
|
|
2814
|
+
const t = n, e = o, r = G("infinite-scroll"), l = j(), a = j();
|
|
2759
2815
|
let p = null;
|
|
2760
2816
|
const y = () => {
|
|
2761
2817
|
p && p.disconnect(), p = new IntersectionObserver(
|
|
2762
|
-
(
|
|
2763
|
-
|
|
2818
|
+
(C) => {
|
|
2819
|
+
C[0].isIntersecting && !t.loading && !t.finished && e("load");
|
|
2764
2820
|
},
|
|
2765
2821
|
{
|
|
2766
2822
|
rootMargin: `${t.distance}px`
|
|
2767
2823
|
}
|
|
2768
2824
|
), a.value && p.observe(a.value);
|
|
2769
2825
|
};
|
|
2770
|
-
return
|
|
2826
|
+
return ce(() => {
|
|
2771
2827
|
y(), t.immediate && !t.finished && e("load");
|
|
2772
|
-
}),
|
|
2828
|
+
}), Le(() => {
|
|
2773
2829
|
p && p.disconnect();
|
|
2774
|
-
}), (
|
|
2830
|
+
}), (C, I) => (h(), v("div", {
|
|
2775
2831
|
ref_key: "containerRef",
|
|
2776
2832
|
ref: l,
|
|
2777
|
-
class: u(s(
|
|
2833
|
+
class: u(s(r).b())
|
|
2778
2834
|
}, [
|
|
2779
|
-
|
|
2835
|
+
P(C.$slots, "default"),
|
|
2780
2836
|
m("div", {
|
|
2781
2837
|
ref_key: "observerRef",
|
|
2782
2838
|
ref: a,
|
|
2783
|
-
class: u(s(
|
|
2839
|
+
class: u(s(r).e("footer"))
|
|
2784
2840
|
}, [
|
|
2785
|
-
n.loading ? (
|
|
2841
|
+
n.loading ? (h(), v("span", {
|
|
2786
2842
|
key: 0,
|
|
2787
|
-
class: u(s(
|
|
2843
|
+
class: u(s(r).e("loading"))
|
|
2788
2844
|
}, [
|
|
2789
2845
|
J(s(Z), {
|
|
2790
2846
|
name: "loading",
|
|
2791
2847
|
size: 16
|
|
2792
2848
|
}),
|
|
2793
|
-
m("span", null,
|
|
2794
|
-
], 2)) : n.finished ? (
|
|
2849
|
+
m("span", null, B(n.loadingText), 1)
|
|
2850
|
+
], 2)) : n.finished ? (h(), v("span", {
|
|
2795
2851
|
key: 1,
|
|
2796
|
-
class: u(s(
|
|
2797
|
-
},
|
|
2852
|
+
class: u(s(r).e("finished"))
|
|
2853
|
+
}, B(n.finishedText), 3)) : D("", !0)
|
|
2798
2854
|
], 2)
|
|
2799
2855
|
], 2));
|
|
2800
2856
|
}
|
|
2801
2857
|
});
|
|
2802
2858
|
export {
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2859
|
+
Ft as Avatar,
|
|
2860
|
+
ta as Calendar,
|
|
2861
|
+
Tt as Card,
|
|
2862
|
+
Wt as Carousel,
|
|
2863
|
+
Ot as CarouselItem,
|
|
2864
|
+
qt as Collapse,
|
|
2865
|
+
_t as CollapseItem,
|
|
2866
|
+
Zt as Descriptions,
|
|
2867
|
+
Ut as DescriptionsItem,
|
|
2868
|
+
Et as DynamicTable,
|
|
2869
|
+
jt as Empty,
|
|
2870
|
+
ea as Image,
|
|
2871
|
+
na as InfiniteScroll,
|
|
2872
|
+
We as Pagination,
|
|
2873
|
+
Vt as Progress,
|
|
2874
|
+
aa as QRCode,
|
|
2875
|
+
Jt as Scrollbar,
|
|
2876
|
+
Yt as Table,
|
|
2877
|
+
Xt as TableColumn,
|
|
2878
|
+
Nt as Tag,
|
|
2879
|
+
Rt as Timeline,
|
|
2880
|
+
Pt as TimelineItem,
|
|
2881
|
+
Bt as Tree,
|
|
2826
2882
|
ie as TreeNode,
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2883
|
+
Qt as TreeTable,
|
|
2884
|
+
Gt as TreeTableColumn,
|
|
2885
|
+
la as VirtualScroll
|
|
2830
2886
|
};
|