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