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