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