@xto/data 1.6.3 → 1.7.1
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/Card/types.d.ts +2 -2
- package/es/Carousel/types.d.ts +1 -1
- package/es/Descriptions/types.d.ts +1 -1
- package/es/DynamicTable/index.vue.d.ts +1 -1
- package/es/Image/index.vue.d.ts +2 -0
- package/es/QRCode/index.vue.d.ts +1 -1
- package/es/Table/index.vue.d.ts +1 -1
- package/es/Timeline/types.d.ts +1 -1
- package/es/Tree/index.d.ts +26 -1
- package/es/Tree/index.vue.d.ts +1 -1
- package/es/Tree/src/useTree.d.ts +2 -75
- package/es/TreeTable/index.vue.d.ts +2 -2
- package/es/index.d.ts +7 -2
- package/es/index.mjs +1620 -1600
- package/es/style.css +1 -1
- package/lib/index.cjs +3 -3
- package/lib/style.css +1 -1
- package/package.json +5 -3
package/es/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Z, computed as $, openBlock as M, createElementBlock as
|
|
1
|
+
import { defineComponent as Z, computed as $, openBlock as M, createElementBlock as w, normalizeStyle as U, normalizeClass as p, createElementVNode as A, renderSlot as F, createTextVNode as oe, toDisplayString as X, unref as u, createVNode as le, createCommentVNode as j, ref as O, watch as se, Fragment as te, renderList as re, withDirectives as ze, withKeys as Ve, vModelText as Re, useSlots as be, withModifiers as ue, mergeProps as Ae, inject as ye, resolveComponent as Pe, createBlock as ce, withCtx as Ie, vShow as $e, reactive as Se, provide as me, toRef as je, nextTick as Ee, onMounted as pe, onUnmounted as Me, resolveDynamicComponent as xe, Teleport as Oe, onBeforeUnmount as _e } from "vue";
|
|
2
2
|
import { useNamespace as J } from "@xto/core";
|
|
3
3
|
const Ne = {
|
|
4
4
|
// 箭头类
|
|
@@ -204,7 +204,7 @@ const Ne = {
|
|
|
204
204
|
function We(s) {
|
|
205
205
|
return s in Ne;
|
|
206
206
|
}
|
|
207
|
-
const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"],
|
|
207
|
+
const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], ne = /* @__PURE__ */ Z({
|
|
208
208
|
name: "XIcon",
|
|
209
209
|
__name: "index",
|
|
210
210
|
props: {
|
|
@@ -215,28 +215,28 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
215
215
|
strokeWidth: { default: 2 }
|
|
216
216
|
},
|
|
217
217
|
setup(s, { expose: r }) {
|
|
218
|
-
const
|
|
218
|
+
const n = s, e = J("icon"), o = $(() => typeof n.size == "number" ? `${n.size}px` : n.size), a = $(() => ({
|
|
219
219
|
width: o.value,
|
|
220
220
|
height: o.value,
|
|
221
|
-
color:
|
|
221
|
+
color: n.color
|
|
222
222
|
})), t = $(() => ({
|
|
223
|
-
strokeWidth:
|
|
223
|
+
strokeWidth: n.strokeWidth
|
|
224
224
|
})), l = $(() => [
|
|
225
225
|
e.b(),
|
|
226
|
-
e.is("spin",
|
|
227
|
-
]),
|
|
226
|
+
e.is("spin", n.spin)
|
|
227
|
+
]), c = $(() => n.name && We(n.name) ? Ne[n.name] : "");
|
|
228
228
|
return r({
|
|
229
229
|
iconSize: o,
|
|
230
|
-
iconStyle:
|
|
231
|
-
iconPath:
|
|
232
|
-
}), (
|
|
230
|
+
iconStyle: a,
|
|
231
|
+
iconPath: c
|
|
232
|
+
}), (z, k) => (M(), w("span", {
|
|
233
233
|
class: p(l.value),
|
|
234
|
-
style:
|
|
234
|
+
style: U(a.value),
|
|
235
235
|
"aria-hidden": !s.name,
|
|
236
236
|
"aria-label": s.name,
|
|
237
237
|
role: "img"
|
|
238
238
|
}, [
|
|
239
|
-
|
|
239
|
+
c.value ? (M(), w("svg", {
|
|
240
240
|
key: 0,
|
|
241
241
|
viewBox: "0 0 24 24",
|
|
242
242
|
fill: "none",
|
|
@@ -244,16 +244,16 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
244
244
|
"stroke-width": s.strokeWidth,
|
|
245
245
|
"stroke-linecap": "round",
|
|
246
246
|
"stroke-linejoin": "round",
|
|
247
|
-
style:
|
|
247
|
+
style: U(t.value),
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
}, [
|
|
250
|
-
A("path", { d:
|
|
251
|
-
], 12, Xe)) :
|
|
252
|
-
|
|
250
|
+
A("path", { d: c.value }, null, 8, Qe)
|
|
251
|
+
], 12, Xe)) : F(z.$slots, "default", { key: 1 }, () => [
|
|
252
|
+
oe(X(s.name), 1)
|
|
253
253
|
])
|
|
254
254
|
], 14, Ye));
|
|
255
255
|
}
|
|
256
|
-
}),
|
|
256
|
+
}), nn = /* @__PURE__ */ Z({
|
|
257
257
|
name: "XTag",
|
|
258
258
|
__name: "index",
|
|
259
259
|
props: {
|
|
@@ -266,69 +266,69 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
266
266
|
},
|
|
267
267
|
emits: ["close"],
|
|
268
268
|
setup(s, { emit: r }) {
|
|
269
|
-
const
|
|
269
|
+
const n = s, e = r, o = J("tag"), a = $(() => [
|
|
270
270
|
o.b(),
|
|
271
|
-
o.m(
|
|
272
|
-
|
|
273
|
-
o.m(
|
|
274
|
-
o.is("hit",
|
|
275
|
-
]), t = $(() =>
|
|
276
|
-
backgroundColor:
|
|
277
|
-
borderColor:
|
|
278
|
-
color:
|
|
279
|
-
} : {}), l = (
|
|
280
|
-
e("close",
|
|
271
|
+
o.m(n.type || "primary"),
|
|
272
|
+
n.size !== "default" ? o.m(n.size) : "",
|
|
273
|
+
o.m(n.effect),
|
|
274
|
+
o.is("hit", n.hit)
|
|
275
|
+
]), t = $(() => n.color ? {
|
|
276
|
+
backgroundColor: n.effect === "dark" ? n.color : "",
|
|
277
|
+
borderColor: n.color,
|
|
278
|
+
color: n.effect === "dark" ? "#fff" : n.color
|
|
279
|
+
} : {}), l = (c) => {
|
|
280
|
+
e("close", c);
|
|
281
281
|
};
|
|
282
|
-
return (
|
|
283
|
-
class: p(
|
|
284
|
-
style:
|
|
282
|
+
return (c, z) => (M(), w("span", {
|
|
283
|
+
class: p(a.value),
|
|
284
|
+
style: U(t.value)
|
|
285
285
|
}, [
|
|
286
|
-
|
|
287
|
-
s.closable ? (M(),
|
|
286
|
+
F(c.$slots, "default"),
|
|
287
|
+
s.closable ? (M(), w("i", {
|
|
288
288
|
key: 0,
|
|
289
|
-
class: p(
|
|
289
|
+
class: p(u(o).e("close")),
|
|
290
290
|
onClick: l
|
|
291
291
|
}, [
|
|
292
|
-
|
|
292
|
+
le(u(ne), {
|
|
293
293
|
name: "close",
|
|
294
294
|
size: 10
|
|
295
295
|
})
|
|
296
296
|
], 2)) : j("", !0)
|
|
297
297
|
], 6));
|
|
298
298
|
}
|
|
299
|
-
}),
|
|
299
|
+
}), an = /* @__PURE__ */ Z({
|
|
300
300
|
name: "XCard",
|
|
301
301
|
__name: "index",
|
|
302
302
|
props: {
|
|
303
303
|
header: {},
|
|
304
|
-
bodyStyle: { default: () => ({
|
|
305
|
-
shadow: { default: "
|
|
304
|
+
bodyStyle: { default: () => ({}) },
|
|
305
|
+
shadow: { default: "never" }
|
|
306
306
|
},
|
|
307
307
|
setup(s) {
|
|
308
|
-
const r = s,
|
|
309
|
-
|
|
310
|
-
|
|
308
|
+
const r = s, n = J("card"), e = $(() => [
|
|
309
|
+
n.b(),
|
|
310
|
+
n.is(`shadow-${r.shadow}`)
|
|
311
311
|
]);
|
|
312
|
-
return (o,
|
|
312
|
+
return (o, a) => (M(), w("div", {
|
|
313
313
|
class: p(e.value)
|
|
314
314
|
}, [
|
|
315
|
-
s.header || o.$slots.header ? (M(),
|
|
315
|
+
s.header || o.$slots.header ? (M(), w("div", {
|
|
316
316
|
key: 0,
|
|
317
|
-
class: p(
|
|
317
|
+
class: p(u(n).e("header"))
|
|
318
318
|
}, [
|
|
319
|
-
|
|
320
|
-
|
|
319
|
+
F(o.$slots, "header", {}, () => [
|
|
320
|
+
oe(X(s.header), 1)
|
|
321
321
|
])
|
|
322
322
|
], 2)) : j("", !0),
|
|
323
323
|
A("div", {
|
|
324
|
-
class: p(
|
|
325
|
-
style:
|
|
324
|
+
class: p(u(n).e("body")),
|
|
325
|
+
style: U(s.bodyStyle)
|
|
326
326
|
}, [
|
|
327
|
-
|
|
327
|
+
F(o.$slots, "default")
|
|
328
328
|
], 6)
|
|
329
329
|
], 2));
|
|
330
330
|
}
|
|
331
|
-
}), Ue = ["viewBox"], Fe = ["cx", "cy", "r", "stroke-width"], Ge = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"],
|
|
331
|
+
}), Ue = ["viewBox"], Fe = ["cx", "cy", "r", "stroke-width"], Ge = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], ln = /* @__PURE__ */ Z({
|
|
332
332
|
name: "XProgress",
|
|
333
333
|
__name: "index",
|
|
334
334
|
props: {
|
|
@@ -341,45 +341,52 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
341
341
|
showText: { type: Boolean, default: !0 }
|
|
342
342
|
},
|
|
343
343
|
setup(s) {
|
|
344
|
-
const r = s,
|
|
344
|
+
const r = s, n = J("progress"), e = $(() => Math.min(100, Math.max(0, r.percentage))), o = $(() => {
|
|
345
|
+
if (typeof r.color == "function") return r.color(e.value);
|
|
346
|
+
if (Array.isArray(r.color)) {
|
|
347
|
+
const l = Math.min(r.color.length - 1, Math.floor(e.value / 100 * r.color.length));
|
|
348
|
+
return r.color[l] || "var(--xto-color-primary, #4F46E5)";
|
|
349
|
+
}
|
|
350
|
+
return r.color;
|
|
351
|
+
}), a = $(() => ({
|
|
345
352
|
width: `${e.value}%`,
|
|
346
|
-
backgroundColor:
|
|
347
|
-
})),
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
353
|
+
backgroundColor: o.value
|
|
354
|
+
})), t = $(() => [
|
|
355
|
+
n.b(),
|
|
356
|
+
n.m(r.type),
|
|
357
|
+
n.is("show-text", r.showText),
|
|
358
|
+
n.is(`status-${r.status || ""}`, !!r.status)
|
|
352
359
|
]);
|
|
353
|
-
return $(() => r.status === "success" ? "100%" : r.status === "warning" ? "Warning" : r.status === "exception" ? "Exception" : `${e.value}%`), (
|
|
354
|
-
class: p(
|
|
360
|
+
return $(() => r.status === "success" ? "100%" : r.status === "warning" ? "Warning" : r.status === "exception" ? "Exception" : `${e.value}%`), (l, c) => (M(), w("div", {
|
|
361
|
+
class: p(t.value)
|
|
355
362
|
}, [
|
|
356
|
-
s.type === "line" ? (M(),
|
|
363
|
+
s.type === "line" ? (M(), w("div", {
|
|
357
364
|
key: 0,
|
|
358
|
-
class: p(
|
|
365
|
+
class: p(u(n).e("line"))
|
|
359
366
|
}, [
|
|
360
367
|
A("div", {
|
|
361
|
-
class: p(
|
|
368
|
+
class: p(u(n).e("outer"))
|
|
362
369
|
}, [
|
|
363
370
|
A("div", {
|
|
364
|
-
class: p(
|
|
371
|
+
class: p(u(n).e("inner"))
|
|
365
372
|
}, [
|
|
366
373
|
A("div", {
|
|
367
|
-
class: p(
|
|
368
|
-
style:
|
|
374
|
+
class: p(u(n).e("bar")),
|
|
375
|
+
style: U(a.value)
|
|
369
376
|
}, null, 6)
|
|
370
377
|
], 2)
|
|
371
378
|
], 2),
|
|
372
|
-
s.showText ? (M(),
|
|
379
|
+
s.showText ? (M(), w("div", {
|
|
373
380
|
key: 0,
|
|
374
|
-
class: p(
|
|
375
|
-
},
|
|
376
|
-
], 2)) : (M(),
|
|
381
|
+
class: p(u(n).e("text"))
|
|
382
|
+
}, X(e.value) + "% ", 3)) : j("", !0)
|
|
383
|
+
], 2)) : (M(), w("div", {
|
|
377
384
|
key: 1,
|
|
378
|
-
class: p(
|
|
385
|
+
class: p(u(n).e("circle"))
|
|
379
386
|
}, [
|
|
380
|
-
(M(),
|
|
387
|
+
(M(), w("svg", {
|
|
381
388
|
viewBox: `0 0 ${s.width} ${s.width}`,
|
|
382
|
-
style:
|
|
389
|
+
style: U({ width: `${s.width}px`, height: `${s.width}px` })
|
|
383
390
|
}, [
|
|
384
391
|
A("circle", {
|
|
385
392
|
cx: s.width / 2,
|
|
@@ -396,15 +403,15 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
396
403
|
fill: "none",
|
|
397
404
|
"stroke-width": s.strokeWidth,
|
|
398
405
|
"stroke-dasharray": `${e.value / 100 * Math.PI * (s.width - s.strokeWidth)} ${Math.PI * (s.width - s.strokeWidth)}`,
|
|
399
|
-
stroke:
|
|
406
|
+
stroke: o.value,
|
|
400
407
|
"stroke-linecap": "round",
|
|
401
408
|
style: { transform: "rotate(-90deg)", "transform-origin": "center" }
|
|
402
409
|
}, null, 8, Ge)
|
|
403
410
|
], 12, Ue)),
|
|
404
|
-
s.showText ? (M(),
|
|
411
|
+
s.showText ? (M(), w("div", {
|
|
405
412
|
key: 0,
|
|
406
|
-
class: p(
|
|
407
|
-
},
|
|
413
|
+
class: p(u(n).e("circle-text"))
|
|
414
|
+
}, X(e.value) + "% ", 3)) : j("", !0)
|
|
408
415
|
], 2))
|
|
409
416
|
], 2));
|
|
410
417
|
}
|
|
@@ -420,50 +427,50 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
420
427
|
},
|
|
421
428
|
emits: ["update:currentPage", "update:pageSize", "current-change", "size-change"],
|
|
422
429
|
setup(s, { emit: r }) {
|
|
423
|
-
const
|
|
424
|
-
se(() =>
|
|
425
|
-
|
|
426
|
-
}), se(() =>
|
|
430
|
+
const n = s, e = r, o = J("pagination"), a = O(n.currentPage), t = O(n.pageSize);
|
|
431
|
+
se(() => n.currentPage, (E) => {
|
|
432
|
+
a.value = E;
|
|
433
|
+
}), se(() => n.pageSize, (E) => {
|
|
427
434
|
t.value = E;
|
|
428
435
|
});
|
|
429
|
-
const l = $(() =>
|
|
430
|
-
() =>
|
|
431
|
-
),
|
|
432
|
-
const E = [], B =
|
|
436
|
+
const l = $(() => a.value), c = $(() => t.value), z = $(() => Math.max(1, Math.ceil(n.total / c.value))), k = $(
|
|
437
|
+
() => n.layout.split(",").map((E) => E.trim()).filter(Boolean)
|
|
438
|
+
), x = (E) => k.value.includes(E), C = $(() => {
|
|
439
|
+
const E = [], B = z.value, N = l.value;
|
|
433
440
|
if (B <= 7)
|
|
434
|
-
for (let
|
|
435
|
-
else if (
|
|
436
|
-
for (let
|
|
441
|
+
for (let K = 1; K <= B; K++) E.push(K);
|
|
442
|
+
else if (N <= 4) {
|
|
443
|
+
for (let K = 1; K <= 5; K++) E.push(K);
|
|
437
444
|
E.push(-1), E.push(B);
|
|
438
|
-
} else if (
|
|
445
|
+
} else if (N >= B - 3) {
|
|
439
446
|
E.push(1), E.push(-1);
|
|
440
|
-
for (let
|
|
447
|
+
for (let K = B - 4; K <= B; K++) E.push(K);
|
|
441
448
|
} else {
|
|
442
449
|
E.push(1), E.push(-1);
|
|
443
|
-
for (let
|
|
450
|
+
for (let K = N - 1; K <= N + 1; K++) E.push(K);
|
|
444
451
|
E.push(-1), E.push(B);
|
|
445
452
|
}
|
|
446
453
|
return E;
|
|
447
454
|
}), S = (E) => {
|
|
448
|
-
E < 1 || E >
|
|
449
|
-
},
|
|
450
|
-
E !==
|
|
451
|
-
},
|
|
452
|
-
const E = parseInt(
|
|
453
|
-
isFinite(E) && (S(Math.min(Math.max(1, E),
|
|
455
|
+
E < 1 || E > z.value || E === l.value || (a.value = E, e("update:currentPage", E), e("current-change", E));
|
|
456
|
+
}, R = (E) => {
|
|
457
|
+
E !== c.value && (t.value = E, e("update:pageSize", E), e("size-change", E), a.value = 1, e("update:currentPage", 1), e("current-change", 1));
|
|
458
|
+
}, V = O(""), _ = () => {
|
|
459
|
+
const E = parseInt(V.value, 10);
|
|
460
|
+
isFinite(E) && (S(Math.min(Math.max(1, E), z.value)), V.value = "");
|
|
454
461
|
};
|
|
455
|
-
return (E, B) => (M(),
|
|
456
|
-
class: p(
|
|
462
|
+
return (E, B) => (M(), w("div", {
|
|
463
|
+
class: p(u(o).b())
|
|
457
464
|
}, [
|
|
458
|
-
|
|
465
|
+
x("total") ? (M(), w("span", {
|
|
459
466
|
key: 0,
|
|
460
|
-
class: p(
|
|
461
|
-
}, "共 " +
|
|
462
|
-
|
|
467
|
+
class: p(u(o).e("total"))
|
|
468
|
+
}, "共 " + X(s.total) + " 条", 3)) : j("", !0),
|
|
469
|
+
x("prev") ? (M(), w("button", {
|
|
463
470
|
key: 1,
|
|
464
|
-
class: p(
|
|
471
|
+
class: p(u(o).e("btn")),
|
|
465
472
|
disabled: l.value <= 1,
|
|
466
|
-
onClick: B[0] || (B[0] = (
|
|
473
|
+
onClick: B[0] || (B[0] = (N) => S(l.value - 1))
|
|
467
474
|
}, [...B[4] || (B[4] = [
|
|
468
475
|
A("svg", {
|
|
469
476
|
viewBox: "0 0 24 24",
|
|
@@ -480,21 +487,21 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
480
487
|
})
|
|
481
488
|
], -1)
|
|
482
489
|
])], 10, Ze)) : j("", !0),
|
|
483
|
-
|
|
484
|
-
|
|
490
|
+
x("pager") ? (M(!0), w(te, { key: 2 }, re(C.value, (N) => (M(), w(te, { key: N }, [
|
|
491
|
+
N === -1 ? (M(), w("span", {
|
|
485
492
|
key: 0,
|
|
486
|
-
class: p(
|
|
487
|
-
}, "...", 2)) : (M(),
|
|
493
|
+
class: p(u(o).e("ellipsis"))
|
|
494
|
+
}, "...", 2)) : (M(), w("button", {
|
|
488
495
|
key: 1,
|
|
489
|
-
class: p([
|
|
490
|
-
onClick: (
|
|
491
|
-
},
|
|
496
|
+
class: p([u(o).e("btn"), u(o).is("active", N === l.value)]),
|
|
497
|
+
onClick: (K) => S(N)
|
|
498
|
+
}, X(N), 11, Je))
|
|
492
499
|
], 64))), 128)) : j("", !0),
|
|
493
|
-
|
|
500
|
+
x("next") ? (M(), w("button", {
|
|
494
501
|
key: 3,
|
|
495
|
-
class: p(
|
|
496
|
-
disabled: l.value >=
|
|
497
|
-
onClick: B[1] || (B[1] = (
|
|
502
|
+
class: p(u(o).e("btn")),
|
|
503
|
+
disabled: l.value >= z.value,
|
|
504
|
+
onClick: B[1] || (B[1] = (N) => S(l.value + 1))
|
|
498
505
|
}, [...B[5] || (B[5] = [
|
|
499
506
|
A("svg", {
|
|
500
507
|
viewBox: "0 0 24 24",
|
|
@@ -511,37 +518,37 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
511
518
|
})
|
|
512
519
|
], -1)
|
|
513
520
|
])], 10, qe)) : j("", !0),
|
|
514
|
-
|
|
521
|
+
x("sizes") ? (M(), w("select", {
|
|
515
522
|
key: 4,
|
|
516
|
-
class: p(
|
|
517
|
-
value:
|
|
518
|
-
onChange: B[2] || (B[2] = (
|
|
523
|
+
class: p(u(o).e("sizes")),
|
|
524
|
+
value: c.value,
|
|
525
|
+
onChange: B[2] || (B[2] = (N) => R(Number(N.target.value)))
|
|
519
526
|
}, [
|
|
520
|
-
(M(!0),
|
|
521
|
-
key:
|
|
522
|
-
value:
|
|
523
|
-
},
|
|
527
|
+
(M(!0), w(te, null, re(s.pageSizes, (N) => (M(), w("option", {
|
|
528
|
+
key: N,
|
|
529
|
+
value: N
|
|
530
|
+
}, X(N) + " 条/页", 9, tt))), 128))
|
|
524
531
|
], 42, et)) : j("", !0),
|
|
525
|
-
|
|
532
|
+
x("jumper") ? (M(), w("span", {
|
|
526
533
|
key: 5,
|
|
527
|
-
class: p(
|
|
534
|
+
class: p(u(o).e("jumper"))
|
|
528
535
|
}, [
|
|
529
|
-
B[6] || (B[6] =
|
|
536
|
+
B[6] || (B[6] = oe(" 前往 ", -1)),
|
|
530
537
|
ze(A("input", {
|
|
531
|
-
class: p(
|
|
538
|
+
class: p(u(o).e("jumper-input")),
|
|
532
539
|
type: "text",
|
|
533
540
|
inputmode: "numeric",
|
|
534
|
-
"onUpdate:modelValue": B[3] || (B[3] = (
|
|
541
|
+
"onUpdate:modelValue": B[3] || (B[3] = (N) => V.value = N),
|
|
535
542
|
onKeyup: Ve(_, ["enter"]),
|
|
536
543
|
onBlur: _
|
|
537
544
|
}, null, 34), [
|
|
538
|
-
[
|
|
545
|
+
[Re, V.value]
|
|
539
546
|
]),
|
|
540
|
-
B[7] || (B[7] =
|
|
547
|
+
B[7] || (B[7] = oe(" 页 ", -1))
|
|
541
548
|
], 2)) : j("", !0)
|
|
542
549
|
], 2));
|
|
543
550
|
}
|
|
544
|
-
}), at = { key: 0 }, lt = ["checked", "indeterminate"], ot = ["onClick"], st = { class: "sort-arrow up" }, rt = { class: "sort-arrow down" }, it = ["onClick"], ct = ["checked", "onChange"], ut = ["onClick"], dt = ["onClick"], ht = { key: 1 }, ft = ["colspan"],
|
|
551
|
+
}), at = { key: 0 }, lt = ["checked", "indeterminate"], ot = ["onClick"], st = { class: "sort-arrow up" }, rt = { class: "sort-arrow down" }, it = ["onClick"], ct = ["checked", "onChange"], ut = ["onClick"], dt = ["onClick"], ht = { key: 1 }, ft = ["colspan"], on = /* @__PURE__ */ Z({
|
|
545
552
|
name: "XDynamicTable",
|
|
546
553
|
__name: "index",
|
|
547
554
|
props: {
|
|
@@ -563,214 +570,214 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
563
570
|
defaultSort: {}
|
|
564
571
|
},
|
|
565
572
|
emits: ["sort-change", "row-click", "row-dblclick", "selection-change", "select-all", "cell-click", "add-row", "delete-row", "update:data"],
|
|
566
|
-
setup(s, { expose: r, emit:
|
|
567
|
-
var L,
|
|
568
|
-
const e = s, o =
|
|
573
|
+
setup(s, { expose: r, emit: n }) {
|
|
574
|
+
var L, f;
|
|
575
|
+
const e = s, o = n, a = J("dynamic-table");
|
|
569
576
|
be();
|
|
570
577
|
const t = $({
|
|
571
578
|
get: () => e.data,
|
|
572
|
-
set: (
|
|
573
|
-
}), l =
|
|
579
|
+
set: (i) => o("update:data", i)
|
|
580
|
+
}), l = O({
|
|
574
581
|
prop: ((L = e.defaultSort) == null ? void 0 : L.prop) || "",
|
|
575
|
-
order: ((
|
|
576
|
-
}),
|
|
582
|
+
order: ((f = e.defaultSort) == null ? void 0 : f.order) || null
|
|
583
|
+
}), c = O([]), z = O(!1), k = O(!1), x = $(() => {
|
|
577
584
|
if (!l.value.prop || !l.value.order)
|
|
578
585
|
return t.value;
|
|
579
|
-
const { prop:
|
|
580
|
-
return [...t.value].sort((
|
|
581
|
-
const T =
|
|
586
|
+
const { prop: i, order: d } = l.value;
|
|
587
|
+
return [...t.value].sort((g, h) => {
|
|
588
|
+
const T = g[i], H = h[i];
|
|
582
589
|
if (T === H) return 0;
|
|
583
|
-
const
|
|
584
|
-
return
|
|
590
|
+
const P = T > H ? 1 : -1;
|
|
591
|
+
return d === "ascending" ? P : -P;
|
|
585
592
|
});
|
|
586
|
-
}),
|
|
587
|
-
const
|
|
588
|
-
return e.height && (
|
|
593
|
+
}), C = $(() => {
|
|
594
|
+
const i = {};
|
|
595
|
+
return e.height && (i.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (i.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), i;
|
|
589
596
|
}), S = $(() => {
|
|
590
|
-
const
|
|
591
|
-
return { width:
|
|
592
|
-
}),
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
]),
|
|
598
|
-
|
|
599
|
-
}, _ = (
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
] : "", E = (
|
|
603
|
-
const h =
|
|
604
|
-
return
|
|
605
|
-
}, B = (
|
|
606
|
-
o("row-click",
|
|
607
|
-
},
|
|
608
|
-
const h =
|
|
609
|
-
o("cell-click",
|
|
610
|
-
},
|
|
611
|
-
|
|
612
|
-
}, Y = (
|
|
613
|
-
const
|
|
614
|
-
|
|
615
|
-
},
|
|
616
|
-
const
|
|
617
|
-
return
|
|
618
|
-
}, b = (
|
|
619
|
-
const
|
|
620
|
-
e.columns.forEach((
|
|
621
|
-
|
|
622
|
-
}), t.value = [...t.value,
|
|
623
|
-
}, y = (
|
|
624
|
-
const
|
|
625
|
-
t.value = t.value.filter((
|
|
597
|
+
const i = typeof e.operationWidth == "number" ? `${e.operationWidth}px` : e.operationWidth;
|
|
598
|
+
return { width: i, minWidth: i };
|
|
599
|
+
}), R = $(() => [
|
|
600
|
+
a.b(),
|
|
601
|
+
a.is("border", e.border),
|
|
602
|
+
a.is("stripe", e.stripe),
|
|
603
|
+
a.is("loading", e.loading)
|
|
604
|
+
]), V = (i) => {
|
|
605
|
+
i.sortable && (l.value.prop === i.prop ? l.value.order === "ascending" ? l.value.order = "descending" : l.value.order === "descending" && (l.value.order = null, l.value.prop = "") : (l.value.prop = i.prop, l.value.order = "ascending"), o("sort-change", { ...l.value }));
|
|
606
|
+
}, _ = (i) => i.sortable ? l.value.prop !== i.prop ? a.is("sortable") : [
|
|
607
|
+
a.is("sortable"),
|
|
608
|
+
a.is(`sort-${l.value.order}`)
|
|
609
|
+
] : "", E = (i, d, g) => {
|
|
610
|
+
const h = i[d.prop];
|
|
611
|
+
return d.formatter ? d.formatter(i, d, h, g) : h ?? "";
|
|
612
|
+
}, B = (i, d, g) => {
|
|
613
|
+
o("row-click", i, d, g);
|
|
614
|
+
}, N = (i, d, g) => {
|
|
615
|
+
const h = g.target;
|
|
616
|
+
o("cell-click", i, d, h, g);
|
|
617
|
+
}, K = () => {
|
|
618
|
+
z.value || k.value ? (c.value = [], z.value = !1, k.value = !1) : (c.value = [...t.value], z.value = !0, k.value = !1), o("select-all", c.value), o("selection-change", c.value);
|
|
619
|
+
}, Y = (i) => {
|
|
620
|
+
const d = c.value.findIndex((g) => typeof e.rowKey == "function" ? e.rowKey(g) === e.rowKey(i) : e.rowKey ? g[e.rowKey] === i[e.rowKey] : g === i);
|
|
621
|
+
d > -1 ? c.value.splice(d, 1) : c.value.push(i), z.value = c.value.length === t.value.length, k.value = c.value.length > 0 && c.value.length < t.value.length, o("selection-change", c.value);
|
|
622
|
+
}, q = (i) => c.value.some((d) => typeof e.rowKey == "function" ? e.rowKey(d) === e.rowKey(i) : e.rowKey ? d[e.rowKey] === i[e.rowKey] : d === i), v = (i) => {
|
|
623
|
+
const d = {};
|
|
624
|
+
return i.width && (d.width = typeof i.width == "number" ? `${i.width}px` : i.width), i.minWidth && (d.minWidth = typeof i.minWidth == "number" ? `${i.minWidth}px` : i.minWidth), i.align && (d.textAlign = i.align), d;
|
|
625
|
+
}, b = (i) => {
|
|
626
|
+
const d = i || {};
|
|
627
|
+
e.columns.forEach((g) => {
|
|
628
|
+
d[g.prop] === void 0 && (d[g.prop] = "");
|
|
629
|
+
}), t.value = [...t.value, d], o("add-row", d);
|
|
630
|
+
}, y = (i) => {
|
|
631
|
+
const d = t.value[i];
|
|
632
|
+
t.value = t.value.filter((g, h) => h !== i), o("delete-row", d, i);
|
|
626
633
|
};
|
|
627
634
|
return r({
|
|
628
635
|
clearSelection: () => {
|
|
629
|
-
|
|
636
|
+
c.value = [], z.value = !1, k.value = !1;
|
|
630
637
|
},
|
|
631
|
-
getSelection: () => [...
|
|
638
|
+
getSelection: () => [...c.value],
|
|
632
639
|
sortState: l,
|
|
633
640
|
addRow: b,
|
|
634
641
|
deleteRow: y,
|
|
635
642
|
getData: () => [...t.value]
|
|
636
|
-
}), (
|
|
637
|
-
class: p(
|
|
643
|
+
}), (i, d) => (M(), w("div", {
|
|
644
|
+
class: p(R.value)
|
|
638
645
|
}, [
|
|
639
|
-
s.showAddButton ? (M(),
|
|
646
|
+
s.showAddButton ? (M(), w("div", {
|
|
640
647
|
key: 0,
|
|
641
|
-
class: p(
|
|
648
|
+
class: p(u(a).e("toolbar"))
|
|
642
649
|
}, [
|
|
643
|
-
|
|
650
|
+
F(i.$slots, "toolbar", {}, () => [
|
|
644
651
|
A("button", {
|
|
645
|
-
class: p(
|
|
646
|
-
onClick:
|
|
647
|
-
}, [...
|
|
652
|
+
class: p(u(a).e("add-btn")),
|
|
653
|
+
onClick: d[0] || (d[0] = (g) => b())
|
|
654
|
+
}, [...d[2] || (d[2] = [
|
|
648
655
|
A("span", { class: "add-icon" }, "+", -1),
|
|
649
|
-
|
|
656
|
+
oe(" 新增一行 ", -1)
|
|
650
657
|
])], 2)
|
|
651
658
|
])
|
|
652
659
|
], 2)) : j("", !0),
|
|
653
|
-
s.loading ? (M(),
|
|
660
|
+
s.loading ? (M(), w("div", {
|
|
654
661
|
key: 1,
|
|
655
|
-
class: p(
|
|
656
|
-
}, [...
|
|
662
|
+
class: p(u(a).e("loading"))
|
|
663
|
+
}, [...d[3] || (d[3] = [
|
|
657
664
|
A("span", { class: "loading-spinner" }, null, -1),
|
|
658
665
|
A("span", { class: "loading-text" }, "加载中...", -1)
|
|
659
666
|
])], 2)) : j("", !0),
|
|
660
667
|
A("div", {
|
|
661
|
-
class: p(
|
|
662
|
-
style:
|
|
668
|
+
class: p(u(a).e("wrapper")),
|
|
669
|
+
style: U(C.value)
|
|
663
670
|
}, [
|
|
664
671
|
A("table", null, [
|
|
665
|
-
s.showHeader ? (M(),
|
|
672
|
+
s.showHeader ? (M(), w("thead", at, [
|
|
666
673
|
A("tr", null, [
|
|
667
|
-
s.rowKey ? (M(),
|
|
674
|
+
s.rowKey ? (M(), w("th", {
|
|
668
675
|
key: 0,
|
|
669
|
-
class: p([
|
|
676
|
+
class: p([u(a).e("header-cell"), u(a).e("selection-cell")])
|
|
670
677
|
}, [
|
|
671
678
|
A("input", {
|
|
672
679
|
type: "checkbox",
|
|
673
|
-
checked:
|
|
674
|
-
indeterminate:
|
|
675
|
-
onChange:
|
|
680
|
+
checked: z.value,
|
|
681
|
+
indeterminate: k.value,
|
|
682
|
+
onChange: K
|
|
676
683
|
}, null, 40, lt)
|
|
677
684
|
], 2)) : j("", !0),
|
|
678
|
-
s.showIndex ? (M(),
|
|
685
|
+
s.showIndex ? (M(), w("th", {
|
|
679
686
|
key: 1,
|
|
680
|
-
class: p(
|
|
687
|
+
class: p(u(a).e("header-cell")),
|
|
681
688
|
style: { width: "60px" }
|
|
682
689
|
}, " 序号 ", 2)) : j("", !0),
|
|
683
|
-
(M(!0),
|
|
684
|
-
key:
|
|
685
|
-
class: p([
|
|
686
|
-
style:
|
|
687
|
-
onClick: (h) =>
|
|
690
|
+
(M(!0), w(te, null, re(s.columns, (g) => (M(), w("th", {
|
|
691
|
+
key: g.prop,
|
|
692
|
+
class: p([u(a).e("header-cell"), _(g)]),
|
|
693
|
+
style: U(v(g)),
|
|
694
|
+
onClick: (h) => V(g)
|
|
688
695
|
}, [
|
|
689
|
-
A("span", null,
|
|
690
|
-
|
|
696
|
+
A("span", null, X(g.label), 1),
|
|
697
|
+
g.sortable ? (M(), w("span", {
|
|
691
698
|
key: 0,
|
|
692
|
-
class: p(
|
|
699
|
+
class: p(u(a).e("sort-icon"))
|
|
693
700
|
}, [
|
|
694
701
|
A("span", st, [
|
|
695
|
-
|
|
702
|
+
le(u(ne), {
|
|
696
703
|
name: "sort-up",
|
|
697
704
|
size: 12
|
|
698
705
|
})
|
|
699
706
|
]),
|
|
700
707
|
A("span", rt, [
|
|
701
|
-
|
|
708
|
+
le(u(ne), {
|
|
702
709
|
name: "sort-down",
|
|
703
710
|
size: 12
|
|
704
711
|
})
|
|
705
712
|
])
|
|
706
713
|
], 2)) : j("", !0)
|
|
707
714
|
], 14, ot))), 128)),
|
|
708
|
-
s.showOperation ? (M(),
|
|
715
|
+
s.showOperation ? (M(), w("th", {
|
|
709
716
|
key: 2,
|
|
710
|
-
class: p(
|
|
711
|
-
style:
|
|
712
|
-
},
|
|
717
|
+
class: p(u(a).e("header-cell")),
|
|
718
|
+
style: U(S.value)
|
|
719
|
+
}, X(s.operationLabel), 7)) : j("", !0)
|
|
713
720
|
])
|
|
714
721
|
])) : j("", !0),
|
|
715
722
|
A("tbody", null, [
|
|
716
|
-
(M(!0),
|
|
717
|
-
key: s.rowKey ? typeof s.rowKey == "function" ? s.rowKey(
|
|
718
|
-
class: p([
|
|
719
|
-
onClick: (T) => B(
|
|
723
|
+
(M(!0), w(te, null, re(x.value, (g, h) => (M(), w("tr", {
|
|
724
|
+
key: s.rowKey ? typeof s.rowKey == "function" ? s.rowKey(g) : g[s.rowKey] : h,
|
|
725
|
+
class: p([u(a).e("row"), u(a).is("selected", q(g))]),
|
|
726
|
+
onClick: (T) => B(g, s.columns[0], T)
|
|
720
727
|
}, [
|
|
721
|
-
s.rowKey ? (M(),
|
|
728
|
+
s.rowKey ? (M(), w("td", {
|
|
722
729
|
key: 0,
|
|
723
|
-
class: p(
|
|
730
|
+
class: p(u(a).e("cell"))
|
|
724
731
|
}, [
|
|
725
732
|
A("input", {
|
|
726
733
|
type: "checkbox",
|
|
727
|
-
checked:
|
|
728
|
-
onClick:
|
|
734
|
+
checked: q(g),
|
|
735
|
+
onClick: d[1] || (d[1] = ue(() => {
|
|
729
736
|
}, ["stop"])),
|
|
730
|
-
onChange: (T) => Y(
|
|
737
|
+
onChange: (T) => Y(g)
|
|
731
738
|
}, null, 40, ct)
|
|
732
739
|
], 2)) : j("", !0),
|
|
733
|
-
s.showIndex ? (M(),
|
|
740
|
+
s.showIndex ? (M(), w("td", {
|
|
734
741
|
key: 1,
|
|
735
|
-
class: p(
|
|
736
|
-
},
|
|
737
|
-
(M(!0),
|
|
742
|
+
class: p(u(a).e("cell"))
|
|
743
|
+
}, X(h + 1), 3)) : j("", !0),
|
|
744
|
+
(M(!0), w(te, null, re(s.columns, (T) => (M(), w("td", {
|
|
738
745
|
key: T.prop,
|
|
739
|
-
class: p(
|
|
740
|
-
style:
|
|
741
|
-
onClick: (H) =>
|
|
746
|
+
class: p(u(a).e("cell")),
|
|
747
|
+
style: U(v(T)),
|
|
748
|
+
onClick: (H) => N(g, T, H)
|
|
742
749
|
}, [
|
|
743
|
-
|
|
744
|
-
row:
|
|
750
|
+
F(i.$slots, `column-${T.prop}`, Ae({
|
|
751
|
+
row: g,
|
|
745
752
|
column: T
|
|
746
753
|
}, { ref_for: !0 }, { $index: h }), () => [
|
|
747
|
-
|
|
754
|
+
oe(X(E(g, T, h)), 1)
|
|
748
755
|
])
|
|
749
756
|
], 14, ut))), 128)),
|
|
750
|
-
s.showOperation ? (M(),
|
|
757
|
+
s.showOperation ? (M(), w("td", {
|
|
751
758
|
key: 2,
|
|
752
|
-
class: p([
|
|
759
|
+
class: p([u(a).e("cell"), u(a).e("operation-cell")])
|
|
753
760
|
}, [
|
|
754
|
-
|
|
755
|
-
row:
|
|
761
|
+
F(i.$slots, "operation", Ae({
|
|
762
|
+
row: g,
|
|
756
763
|
deleteRow: () => y(h)
|
|
757
764
|
}, { ref_for: !0 }, { $index: h }), () => [
|
|
758
765
|
A("button", {
|
|
759
|
-
class: p(
|
|
760
|
-
onClick:
|
|
766
|
+
class: p(u(a).e("operation-btn")),
|
|
767
|
+
onClick: ue((T) => y(h), ["stop"])
|
|
761
768
|
}, " 删除 ", 10, dt)
|
|
762
769
|
])
|
|
763
770
|
], 2)) : j("", !0)
|
|
764
771
|
], 10, it))), 128))
|
|
765
772
|
]),
|
|
766
|
-
|
|
773
|
+
x.value.length === 0 && !s.loading ? (M(), w("tbody", ht, [
|
|
767
774
|
A("tr", null, [
|
|
768
775
|
A("td", {
|
|
769
776
|
colspan: s.columns.length + (s.rowKey ? 1 : 0) + (s.showIndex ? 1 : 0) + (s.showOperation ? 1 : 0),
|
|
770
|
-
class: p(
|
|
777
|
+
class: p(u(a).e("empty"))
|
|
771
778
|
}, [
|
|
772
|
-
|
|
773
|
-
|
|
779
|
+
F(i.$slots, "empty", {}, () => [
|
|
780
|
+
oe(X(s.emptyText), 1)
|
|
774
781
|
])
|
|
775
782
|
], 10, ft)
|
|
776
783
|
])
|
|
@@ -795,114 +802,117 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
795
802
|
node: {}
|
|
796
803
|
},
|
|
797
804
|
setup(s) {
|
|
798
|
-
const r = s,
|
|
805
|
+
const r = s, n = ye("tree"), { props: e, store: o, toggleExpand: a, toggleCheck: t, handleNodeClick: l, handleNodeContextmenu: c } = n, z = O(), k = O(null), x = $(() => {
|
|
806
|
+
var i;
|
|
807
|
+
return e.highlightCurrent && ((i = n.store) == null ? void 0 : i.currentKey) === r.node.key;
|
|
808
|
+
}), C = $(() => r.node.expanded), S = $(() => r.node.checked), R = $(() => r.node.indeterminate), V = $(() => r.node.disabled), _ = $(() => r.node.loading), E = $(() => r.node.isLeaf), B = $(() => e.showCheckbox || e.checkable), N = $(() => r.node.selected), K = $(() => ({
|
|
799
809
|
paddingLeft: `${r.node.level * (e.indent || 16)}px`
|
|
800
|
-
})),
|
|
801
|
-
l(r.node,
|
|
802
|
-
},
|
|
803
|
-
|
|
804
|
-
},
|
|
805
|
-
|
|
806
|
-
},
|
|
807
|
-
|
|
808
|
-
},
|
|
809
|
-
var
|
|
810
|
+
})), Y = (i) => {
|
|
811
|
+
l(r.node, i);
|
|
812
|
+
}, q = (i) => {
|
|
813
|
+
c(r.node, i);
|
|
814
|
+
}, v = (i) => {
|
|
815
|
+
i.stopPropagation(), V.value || a(r.node);
|
|
816
|
+
}, b = (i) => {
|
|
817
|
+
i.stopPropagation(), V.value || t(r.node);
|
|
818
|
+
}, y = (i) => {
|
|
819
|
+
var d;
|
|
810
820
|
if (!(!e.draggable || V.value)) {
|
|
811
821
|
if (e.allowDrag && !e.allowDrag(r.node)) {
|
|
812
|
-
|
|
822
|
+
i.preventDefault();
|
|
813
823
|
return;
|
|
814
824
|
}
|
|
815
|
-
|
|
825
|
+
i.dataTransfer.effectAllowed = "move", i.dataTransfer.setData("nodeKey", String(r.node.key)), (d = n.emit) == null || d.call(n, "node-drag-start", r.node, i);
|
|
816
826
|
}
|
|
817
|
-
},
|
|
818
|
-
var
|
|
819
|
-
|
|
820
|
-
},
|
|
821
|
-
var
|
|
822
|
-
|
|
823
|
-
},
|
|
824
|
-
var
|
|
825
|
-
if (
|
|
826
|
-
const
|
|
827
|
-
if (!
|
|
828
|
-
const
|
|
829
|
-
|
|
830
|
-
},
|
|
831
|
-
var
|
|
832
|
-
if (
|
|
833
|
-
const
|
|
834
|
-
if (
|
|
835
|
-
const
|
|
836
|
-
if (
|
|
837
|
-
if (e.allowDrop && !e.allowDrop(
|
|
838
|
-
|
|
827
|
+
}, D = (i) => {
|
|
828
|
+
var d;
|
|
829
|
+
i.preventDefault(), e.draggable && (k.value = "inner", (d = n.emit) == null || d.call(n, "node-drag-enter", r.node, i));
|
|
830
|
+
}, I = (i) => {
|
|
831
|
+
var d;
|
|
832
|
+
k.value = null, (d = n.emit) == null || d.call(n, "node-drag-leave", r.node, i);
|
|
833
|
+
}, m = (i) => {
|
|
834
|
+
var T, H;
|
|
835
|
+
if (i.preventDefault(), !e.draggable || V.value) return;
|
|
836
|
+
const d = (T = z.value) == null ? void 0 : T.getBoundingClientRect();
|
|
837
|
+
if (!d) return;
|
|
838
|
+
const g = i.clientY - d.top, h = d.height;
|
|
839
|
+
g < h * 0.25 ? k.value = "prev" : g > h * 0.75 ? k.value = "next" : k.value = "inner", (H = n.emit) == null || H.call(n, "node-drag-over", r.node, i);
|
|
840
|
+
}, L = (i) => {
|
|
841
|
+
var g, h;
|
|
842
|
+
if (i.preventDefault(), !e.draggable) return;
|
|
843
|
+
const d = (g = i.dataTransfer) == null ? void 0 : g.getData("nodeKey");
|
|
844
|
+
if (d) {
|
|
845
|
+
const T = o.nodesMap.get(d);
|
|
846
|
+
if (T && k.value) {
|
|
847
|
+
if (e.allowDrop && !e.allowDrop(T, r.node, k.value)) {
|
|
848
|
+
k.value = null;
|
|
839
849
|
return;
|
|
840
850
|
}
|
|
841
|
-
(
|
|
851
|
+
(h = n.emit) == null || h.call(n, "node-drop", T, r.node, k.value, i);
|
|
842
852
|
}
|
|
843
853
|
}
|
|
844
|
-
|
|
845
|
-
},
|
|
846
|
-
var
|
|
847
|
-
|
|
854
|
+
k.value = null;
|
|
855
|
+
}, f = (i) => {
|
|
856
|
+
var d;
|
|
857
|
+
k.value = null, (d = n.emit) == null || d.call(n, "node-drag-end", r.node, i);
|
|
848
858
|
};
|
|
849
|
-
return (
|
|
850
|
-
var
|
|
851
|
-
const
|
|
852
|
-
return ze((M(),
|
|
859
|
+
return (i, d) => {
|
|
860
|
+
var h;
|
|
861
|
+
const g = Pe("TreeNode", !0);
|
|
862
|
+
return ze((M(), w("div", {
|
|
853
863
|
ref_key: "nodeRef",
|
|
854
|
-
ref:
|
|
864
|
+
ref: z,
|
|
855
865
|
class: p(["x-tree-node", {
|
|
856
|
-
"is-expanded":
|
|
857
|
-
"is-current":
|
|
858
|
-
"is-selected":
|
|
866
|
+
"is-expanded": C.value,
|
|
867
|
+
"is-current": x.value,
|
|
868
|
+
"is-selected": N.value,
|
|
859
869
|
"is-disabled": V.value,
|
|
860
|
-
"is-drop-inner":
|
|
861
|
-
"is-drop-prev":
|
|
862
|
-
"is-drop-next":
|
|
870
|
+
"is-drop-inner": k.value === "inner",
|
|
871
|
+
"is-drop-prev": k.value === "prev",
|
|
872
|
+
"is-drop-next": k.value === "next"
|
|
863
873
|
}]),
|
|
864
|
-
draggable:
|
|
865
|
-
onDragstart:
|
|
866
|
-
onDragenter:
|
|
867
|
-
onDragleave:
|
|
868
|
-
onDragover:
|
|
869
|
-
onDrop:
|
|
870
|
-
onDragend:
|
|
874
|
+
draggable: u(e).draggable && !V.value,
|
|
875
|
+
onDragstart: y,
|
|
876
|
+
onDragenter: D,
|
|
877
|
+
onDragleave: I,
|
|
878
|
+
onDragover: m,
|
|
879
|
+
onDrop: L,
|
|
880
|
+
onDragend: f
|
|
871
881
|
}, [
|
|
872
882
|
A("div", {
|
|
873
883
|
class: "x-tree-node__content",
|
|
874
|
-
style:
|
|
875
|
-
onClick:
|
|
876
|
-
onContextmenu:
|
|
884
|
+
style: U(K.value),
|
|
885
|
+
onClick: Y,
|
|
886
|
+
onContextmenu: q
|
|
877
887
|
}, [
|
|
878
888
|
A("span", {
|
|
879
889
|
class: p(["x-tree-node__expand-icon", {
|
|
880
|
-
"is-expanded":
|
|
881
|
-
"is-leaf":
|
|
882
|
-
"is-loading":
|
|
890
|
+
"is-expanded": C.value,
|
|
891
|
+
"is-leaf": E.value,
|
|
892
|
+
"is-loading": _.value
|
|
883
893
|
}]),
|
|
884
|
-
onClick:
|
|
894
|
+
onClick: v
|
|
885
895
|
}, [
|
|
886
|
-
|
|
887
|
-
|
|
896
|
+
_.value ? (M(), w("span", pt)) : (M(), w(te, { key: 1 }, [
|
|
897
|
+
E.value ? j("", !0) : (M(), w("span", gt))
|
|
888
898
|
], 64))
|
|
889
899
|
], 2),
|
|
890
|
-
s.node.icon ||
|
|
891
|
-
|
|
900
|
+
s.node.data.icon || u(e).icon ? (M(), w("span", mt, X(s.node.data.icon || u(e).icon), 1)) : j("", !0),
|
|
901
|
+
B.value ? (M(), w("span", {
|
|
892
902
|
key: 1,
|
|
893
903
|
class: p(["x-tree-node__checkbox", {
|
|
894
|
-
"is-checked":
|
|
895
|
-
"is-indeterminate":
|
|
904
|
+
"is-checked": S.value,
|
|
905
|
+
"is-indeterminate": R.value,
|
|
896
906
|
"is-disabled": V.value
|
|
897
907
|
}]),
|
|
898
|
-
onClick:
|
|
908
|
+
onClick: ue(b, ["stop"])
|
|
899
909
|
}, [
|
|
900
|
-
|
|
910
|
+
S.value ? (M(), ce(u(ne), {
|
|
901
911
|
key: 0,
|
|
902
912
|
name: "check",
|
|
903
913
|
size: 12,
|
|
904
914
|
class: "x-tree-node__checkbox-icon"
|
|
905
|
-
})) :
|
|
915
|
+
})) : R.value ? (M(), ce(u(ne), {
|
|
906
916
|
key: 1,
|
|
907
917
|
name: "minus",
|
|
908
918
|
size: 12,
|
|
@@ -910,49 +920,49 @@ const Ye = ["aria-hidden", "aria-label"], Xe = ["stroke-width"], Qe = ["d"], te
|
|
|
910
920
|
})) : j("", !0)
|
|
911
921
|
], 2)) : j("", !0),
|
|
912
922
|
A("span", yt, [
|
|
913
|
-
|
|
923
|
+
F(i.$slots, "default", {
|
|
914
924
|
node: s.node,
|
|
915
925
|
data: s.node.data
|
|
916
926
|
}, () => [
|
|
917
|
-
|
|
927
|
+
oe(X(s.node.label), 1)
|
|
918
928
|
])
|
|
919
929
|
])
|
|
920
930
|
], 36),
|
|
921
|
-
!
|
|
931
|
+
!E.value && C.value ? (M(), w("div", {
|
|
922
932
|
key: 0,
|
|
923
|
-
class: p(["x-tree-node__children", { "x-tree-node__children--show-line":
|
|
933
|
+
class: p(["x-tree-node__children", { "x-tree-node__children--show-line": u(e).showLine }])
|
|
924
934
|
}, [
|
|
925
|
-
!
|
|
926
|
-
key:
|
|
927
|
-
node:
|
|
935
|
+
!u(e).renderAfterExpand || C.value ? (M(!0), w(te, { key: 0 }, re(s.node.children, (T) => (M(), ce(g, {
|
|
936
|
+
key: T.key,
|
|
937
|
+
node: T
|
|
928
938
|
}, {
|
|
929
|
-
default: Ie((
|
|
930
|
-
|
|
931
|
-
node:
|
|
932
|
-
data:
|
|
939
|
+
default: Ie((H) => [
|
|
940
|
+
F(i.$slots, "default", {
|
|
941
|
+
node: H.node,
|
|
942
|
+
data: H.data
|
|
933
943
|
})
|
|
934
944
|
]),
|
|
935
945
|
_: 3
|
|
936
946
|
}, 8, ["node"]))), 128)) : j("", !0)
|
|
937
947
|
], 2)) : j("", !0)
|
|
938
948
|
], 42, vt)), [
|
|
939
|
-
[$e, s.node.visible && (((
|
|
949
|
+
[$e, s.node.visible && (((h = s.node.parent) == null ? void 0 : h.expanded) ?? !0)]
|
|
940
950
|
]);
|
|
941
951
|
};
|
|
942
952
|
}
|
|
943
953
|
});
|
|
944
|
-
class
|
|
945
|
-
constructor(r,
|
|
946
|
-
this.data = r, this.store =
|
|
947
|
-
const
|
|
948
|
-
this.key = r[t] ?? r.value ?? r.id ?? Math.random().toString(), this.label = r[l] ?? r.label ?? "", this.disabled = r[
|
|
949
|
-
const
|
|
950
|
-
|
|
951
|
-
(
|
|
954
|
+
class ve {
|
|
955
|
+
constructor(r, n, e = 0, o = null) {
|
|
956
|
+
this.data = r, this.store = n, this.level = e, this.parent = o, this.children = [], this.expanded = !1, this.selected = !1, this.checked = !1, this.indeterminate = !1, this.loading = !1, this.visible = !0, this.loaded = !1;
|
|
957
|
+
const a = n.props || {}, t = a.value || "value", l = a.label || "label", c = a.disabled || "disabled", z = a.isLeaf || "isLeaf";
|
|
958
|
+
this.key = r[t] ?? r.value ?? r.id ?? Math.random().toString(), this.label = r[l] ?? r.label ?? "", this.disabled = r[c] ?? r.disabled ?? !1, this.isLeaf = r[z] ?? r.isLeaf ?? !1;
|
|
959
|
+
const k = a.children || "children", x = r[k] ?? r.children ?? [];
|
|
960
|
+
x.length > 0 ? this.children = x.map(
|
|
961
|
+
(C) => new ve(C, n, e + 1, this)
|
|
952
962
|
) : this.isLeaf = !0;
|
|
953
963
|
}
|
|
954
964
|
/** 设置展开状态 */
|
|
955
|
-
setExpanded(r,
|
|
965
|
+
setExpanded(r, n = !0) {
|
|
956
966
|
this.expanded = r, r ? this.store.expandedKeys.add(this.key) : this.store.expandedKeys.delete(this.key);
|
|
957
967
|
}
|
|
958
968
|
/** 设置选中状态 */
|
|
@@ -960,28 +970,28 @@ class he {
|
|
|
960
970
|
this.selected = r, r ? this.store.selectedKeys.add(this.key) : this.store.selectedKeys.delete(this.key);
|
|
961
971
|
}
|
|
962
972
|
/** 设置勾选状态 */
|
|
963
|
-
setChecked(r,
|
|
964
|
-
this.checked = r, this.indeterminate = !1, r ? (this.store.checkedKeys.add(this.key), this.store.indeterminateKeys.delete(this.key)) : (this.store.checkedKeys.delete(this.key), this.store.indeterminateKeys.delete(this.key)),
|
|
973
|
+
setChecked(r, n = !0, e = !0) {
|
|
974
|
+
this.checked = r, this.indeterminate = !1, r ? (this.store.checkedKeys.add(this.key), this.store.indeterminateKeys.delete(this.key)) : (this.store.checkedKeys.delete(this.key), this.store.indeterminateKeys.delete(this.key)), n && (this.updateChildrenChecked(r), this.updateParentChecked());
|
|
965
975
|
}
|
|
966
976
|
/** 更新子节点勾选状态 */
|
|
967
977
|
updateChildrenChecked(r) {
|
|
968
|
-
const
|
|
978
|
+
const n = (e) => {
|
|
969
979
|
e.children.forEach((o) => {
|
|
970
|
-
o.disabled || (o.checked = r, o.indeterminate = !1, r ? (this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) : (this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.delete(o.key)),
|
|
980
|
+
o.disabled || (o.checked = r, o.indeterminate = !1, r ? (this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) : (this.store.checkedKeys.delete(o.key), this.store.indeterminateKeys.delete(o.key)), n(o));
|
|
971
981
|
});
|
|
972
982
|
};
|
|
973
|
-
|
|
983
|
+
n(this);
|
|
974
984
|
}
|
|
975
985
|
/** 更新父节点勾选状态 */
|
|
976
986
|
updateParentChecked() {
|
|
977
987
|
let r = this.parent;
|
|
978
988
|
for (; r; ) {
|
|
979
|
-
const
|
|
980
|
-
if (
|
|
989
|
+
const n = r.children.filter((a) => !a.disabled);
|
|
990
|
+
if (n.length === 0) {
|
|
981
991
|
r = r.parent;
|
|
982
992
|
continue;
|
|
983
993
|
}
|
|
984
|
-
const e =
|
|
994
|
+
const e = n.every((a) => a.checked), o = n.some((a) => a.checked || a.indeterminate);
|
|
985
995
|
e ? (r.checked = !0, r.indeterminate = !1, this.store.checkedKeys.add(r.key), this.store.indeterminateKeys.delete(r.key)) : o ? (r.checked = !1, r.indeterminate = !0, this.store.checkedKeys.delete(r.key), this.store.indeterminateKeys.add(r.key)) : (r.checked = !1, r.indeterminate = !1, this.store.checkedKeys.delete(r.key), this.store.indeterminateKeys.delete(r.key)), r = r.parent;
|
|
986
996
|
}
|
|
987
997
|
}
|
|
@@ -1000,25 +1010,26 @@ class he {
|
|
|
1000
1010
|
/** 获取所有父节点的 key */
|
|
1001
1011
|
getParentKeys() {
|
|
1002
1012
|
const r = [];
|
|
1003
|
-
let
|
|
1004
|
-
for (;
|
|
1005
|
-
r.push(
|
|
1013
|
+
let n = this.parent;
|
|
1014
|
+
for (; n; )
|
|
1015
|
+
r.push(n.key), n = n.parent;
|
|
1006
1016
|
return r;
|
|
1007
1017
|
}
|
|
1008
1018
|
/** 获取所有子节点的 key */
|
|
1009
1019
|
getChildrenKeys() {
|
|
1010
|
-
const r = [],
|
|
1020
|
+
const r = [], n = (e) => {
|
|
1011
1021
|
e.forEach((o) => {
|
|
1012
|
-
r.push(o.key), o.children.length &&
|
|
1022
|
+
r.push(o.key), o.children.length && n(o.children);
|
|
1013
1023
|
});
|
|
1014
1024
|
};
|
|
1015
|
-
return
|
|
1025
|
+
return n(this.children), r;
|
|
1016
1026
|
}
|
|
1017
1027
|
}
|
|
1018
|
-
const
|
|
1028
|
+
const sn = /* @__PURE__ */ Z({
|
|
1019
1029
|
name: "XTree",
|
|
1020
1030
|
__name: "index",
|
|
1021
1031
|
props: {
|
|
1032
|
+
filterNodeMethod: {},
|
|
1022
1033
|
data: { default: () => [] },
|
|
1023
1034
|
treeData: {},
|
|
1024
1035
|
emptyText: { default: "暂无数据" },
|
|
@@ -1056,8 +1067,8 @@ const on = /* @__PURE__ */ Z({
|
|
|
1056
1067
|
checkable: { type: Boolean }
|
|
1057
1068
|
},
|
|
1058
1069
|
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"],
|
|
1059
|
-
setup(s, { expose: r, emit:
|
|
1060
|
-
const e = s, o =
|
|
1070
|
+
setup(s, { expose: r, emit: n }) {
|
|
1071
|
+
const e = s, o = n, a = J("tree"), t = Se({
|
|
1061
1072
|
nodesMap: /* @__PURE__ */ new Map(),
|
|
1062
1073
|
rootNodes: [],
|
|
1063
1074
|
expandedKeys: /* @__PURE__ */ new Set(),
|
|
@@ -1066,258 +1077,258 @@ const on = /* @__PURE__ */ Z({
|
|
|
1066
1077
|
indeterminateKeys: /* @__PURE__ */ new Set(),
|
|
1067
1078
|
currentKey: null,
|
|
1068
1079
|
filterValue: ""
|
|
1069
|
-
}), l =
|
|
1080
|
+
}), l = O(""), c = () => e.fieldNames ? {
|
|
1070
1081
|
value: e.fieldNames.key || "value",
|
|
1071
1082
|
label: e.fieldNames.title || e.fieldNames.key || "label",
|
|
1072
1083
|
children: e.fieldNames.children || "children",
|
|
1073
1084
|
disabled: e.fieldNames.disabled || "disabled",
|
|
1074
1085
|
isLeaf: e.fieldNames.isLeaf || "isLeaf"
|
|
1075
|
-
} : e.props,
|
|
1076
|
-
t.props =
|
|
1077
|
-
const
|
|
1078
|
-
if (t.nodesMap.clear(), t.rootNodes = [], t.checkedKeys.clear(), t.indeterminateKeys.clear(), !
|
|
1079
|
-
const
|
|
1080
|
-
const H = new
|
|
1086
|
+
} : e.props, z = () => e.treeData || e.data || [];
|
|
1087
|
+
t.props = c();
|
|
1088
|
+
const k = (f) => {
|
|
1089
|
+
if (t.nodesMap.clear(), t.rootNodes = [], t.checkedKeys.clear(), t.indeterminateKeys.clear(), !f || !f.length) return;
|
|
1090
|
+
const i = c(), d = (g, h, T) => {
|
|
1091
|
+
const H = new ve(g, t, h, T);
|
|
1081
1092
|
t.nodesMap.set(H.key, H);
|
|
1082
|
-
const
|
|
1083
|
-
return
|
|
1084
|
-
(
|
|
1093
|
+
const P = (i == null ? void 0 : i.children) || "children", W = g[P] ?? g.children ?? [];
|
|
1094
|
+
return W.length > 0 && (H.children = W.map(
|
|
1095
|
+
(ee) => d(ee, h + 1, H)
|
|
1085
1096
|
), H.isLeaf = !1), H;
|
|
1086
1097
|
};
|
|
1087
|
-
t.rootNodes =
|
|
1088
|
-
},
|
|
1089
|
-
var
|
|
1090
|
-
e.defaultExpandAll ?
|
|
1091
|
-
const h = t.nodesMap.get(
|
|
1092
|
-
h && (h.expanded = !0, t.expandedKeys.add(
|
|
1093
|
-
}), (
|
|
1094
|
-
const h = t.nodesMap.get(
|
|
1098
|
+
t.rootNodes = f.map((g) => d(g, 0, null)), x();
|
|
1099
|
+
}, x = () => {
|
|
1100
|
+
var f, i, d;
|
|
1101
|
+
e.defaultExpandAll ? C() : (f = e.defaultExpandedKeys) != null && f.length && e.defaultExpandedKeys.forEach((g) => {
|
|
1102
|
+
const h = t.nodesMap.get(g);
|
|
1103
|
+
h && (h.expanded = !0, t.expandedKeys.add(g));
|
|
1104
|
+
}), (i = e.defaultCheckedKeys) != null && i.length && e.defaultCheckedKeys.forEach((g) => {
|
|
1105
|
+
const h = t.nodesMap.get(g);
|
|
1095
1106
|
h && h.setChecked(!0, !e.checkStrictly);
|
|
1096
|
-
}), (
|
|
1097
|
-
const h = t.nodesMap.get(
|
|
1107
|
+
}), (d = e.checkedKeys) != null && d.length && e.checkedKeys.forEach((g) => {
|
|
1108
|
+
const h = t.nodesMap.get(g);
|
|
1098
1109
|
h && h.setChecked(!0, !e.checkStrictly);
|
|
1099
1110
|
});
|
|
1100
|
-
},
|
|
1101
|
-
t.nodesMap.forEach((
|
|
1102
|
-
|
|
1111
|
+
}, C = () => {
|
|
1112
|
+
t.nodesMap.forEach((f) => {
|
|
1113
|
+
f.children.length > 0 && (f.expanded = !0, t.expandedKeys.add(f.key));
|
|
1103
1114
|
});
|
|
1104
1115
|
}, S = () => {
|
|
1105
|
-
t.nodesMap.forEach((
|
|
1106
|
-
|
|
1116
|
+
t.nodesMap.forEach((f) => {
|
|
1117
|
+
f.expanded = !1;
|
|
1107
1118
|
}), t.expandedKeys.clear();
|
|
1108
|
-
},
|
|
1109
|
-
if (
|
|
1110
|
-
!
|
|
1111
|
-
},
|
|
1112
|
-
if (
|
|
1113
|
-
const
|
|
1114
|
-
|
|
1115
|
-
const
|
|
1116
|
-
t.nodesMap.forEach((
|
|
1117
|
-
|
|
1118
|
-
}), o("check",
|
|
1119
|
-
checkedNodes:
|
|
1119
|
+
}, R = (f) => {
|
|
1120
|
+
if (f.disabled) return;
|
|
1121
|
+
!f.expanded ? (f.expanded = !0, t.expandedKeys.add(f.key), o("node-expand", f.data, f, null)) : (f.expanded = !1, t.expandedKeys.delete(f.key), o("node-collapse", f.data, f, null));
|
|
1122
|
+
}, V = (f, i) => {
|
|
1123
|
+
if (f.disabled) return;
|
|
1124
|
+
const d = i ?? !f.checked;
|
|
1125
|
+
f.setChecked(d, !e.checkStrictly), o("check-change", f.data, f.checked, f.indeterminate);
|
|
1126
|
+
const g = [], h = [], T = [], H = [];
|
|
1127
|
+
t.nodesMap.forEach((P) => {
|
|
1128
|
+
P.checked && (g.push(P.data), h.push(P.key)), P.indeterminate && (T.push(P.data), H.push(P.key));
|
|
1129
|
+
}), o("check", f.data, {
|
|
1130
|
+
checkedNodes: g,
|
|
1120
1131
|
checkedKeys: h,
|
|
1121
1132
|
halfCheckedNodes: T,
|
|
1122
1133
|
halfCheckedKeys: H
|
|
1123
1134
|
});
|
|
1124
|
-
}, _ = (
|
|
1125
|
-
|
|
1126
|
-
}, E = (
|
|
1127
|
-
if (l.value =
|
|
1128
|
-
t.nodesMap.forEach((
|
|
1129
|
-
|
|
1135
|
+
}, _ = (f, i) => {
|
|
1136
|
+
f.disabled || (o("node-click", f.data, f, null), e.expandOnClickNode && f.children.length > 0 && R(f), e.highlightCurrent && (t.currentKey = f.key, o("current-change", f.data, f)));
|
|
1137
|
+
}, E = (f) => {
|
|
1138
|
+
if (l.value = f, t.filterValue = f, !f) {
|
|
1139
|
+
t.nodesMap.forEach((i) => {
|
|
1140
|
+
i.visible = !0;
|
|
1130
1141
|
});
|
|
1131
1142
|
return;
|
|
1132
1143
|
}
|
|
1133
|
-
t.nodesMap.forEach((
|
|
1134
|
-
const
|
|
1135
|
-
|
|
1136
|
-
}), t.nodesMap.forEach((
|
|
1137
|
-
if (
|
|
1138
|
-
let
|
|
1139
|
-
for (;
|
|
1140
|
-
|
|
1144
|
+
t.nodesMap.forEach((i) => {
|
|
1145
|
+
const d = i.label || "";
|
|
1146
|
+
i.visible = String(d).toLowerCase().includes(f.toLowerCase());
|
|
1147
|
+
}), t.nodesMap.forEach((i) => {
|
|
1148
|
+
if (i.visible && i.parent) {
|
|
1149
|
+
let d = i.parent;
|
|
1150
|
+
for (; d; )
|
|
1151
|
+
d.visible = !0, d.expanded = !0, t.expandedKeys.add(d.key), d = d.parent;
|
|
1141
1152
|
}
|
|
1142
1153
|
});
|
|
1143
|
-
}, B = (
|
|
1144
|
-
t.currentKey =
|
|
1145
|
-
},
|
|
1154
|
+
}, B = (f) => t.nodesMap.get(f), N = (f) => {
|
|
1155
|
+
t.currentKey = f;
|
|
1156
|
+
}, K = () => {
|
|
1146
1157
|
if (t.currentKey)
|
|
1147
1158
|
return t.nodesMap.get(t.currentKey);
|
|
1148
|
-
}, Y = (
|
|
1149
|
-
const
|
|
1150
|
-
return t.nodesMap.forEach((
|
|
1151
|
-
|
|
1152
|
-
}),
|
|
1153
|
-
},
|
|
1154
|
-
const
|
|
1155
|
-
return t.nodesMap.forEach((
|
|
1156
|
-
|
|
1157
|
-
}),
|
|
1158
|
-
}, v = (
|
|
1159
|
-
t.nodesMap.forEach((
|
|
1160
|
-
|
|
1161
|
-
}), t.checkedKeys.clear(), t.indeterminateKeys.clear(),
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1159
|
+
}, Y = (f = !1) => {
|
|
1160
|
+
const i = [];
|
|
1161
|
+
return t.nodesMap.forEach((d) => {
|
|
1162
|
+
d.checked && (!f || d.isLeaf) && i.push(d.data);
|
|
1163
|
+
}), i;
|
|
1164
|
+
}, q = (f = !1) => {
|
|
1165
|
+
const i = [];
|
|
1166
|
+
return t.nodesMap.forEach((d) => {
|
|
1167
|
+
d.checked && (!f || d.isLeaf) && i.push(d.key);
|
|
1168
|
+
}), i;
|
|
1169
|
+
}, v = (f) => {
|
|
1170
|
+
t.nodesMap.forEach((i) => {
|
|
1171
|
+
i.checked = !1, i.indeterminate = !1;
|
|
1172
|
+
}), t.checkedKeys.clear(), t.indeterminateKeys.clear(), f.forEach((i) => {
|
|
1173
|
+
const d = t.nodesMap.get(i);
|
|
1174
|
+
d && d.setChecked(!0, !e.checkStrictly);
|
|
1164
1175
|
});
|
|
1165
1176
|
}, b = () => {
|
|
1166
|
-
const
|
|
1167
|
-
return t.nodesMap.forEach((
|
|
1168
|
-
|
|
1169
|
-
}),
|
|
1177
|
+
const f = [];
|
|
1178
|
+
return t.nodesMap.forEach((i) => {
|
|
1179
|
+
i.indeterminate && f.push(i.data);
|
|
1180
|
+
}), f;
|
|
1170
1181
|
}, y = () => {
|
|
1171
|
-
const
|
|
1172
|
-
return t.nodesMap.forEach((
|
|
1173
|
-
|
|
1174
|
-
}),
|
|
1175
|
-
}, D = (
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1182
|
+
const f = [];
|
|
1183
|
+
return t.nodesMap.forEach((i) => {
|
|
1184
|
+
i.indeterminate && f.push(i.key);
|
|
1185
|
+
}), f;
|
|
1186
|
+
}, D = (f, i, d = !0) => {
|
|
1187
|
+
const g = t.nodesMap.get(f);
|
|
1188
|
+
g && g.setChecked(i, d && !e.checkStrictly);
|
|
1178
1189
|
}, I = () => {
|
|
1179
|
-
const
|
|
1180
|
-
return t.nodesMap.forEach((
|
|
1181
|
-
|
|
1182
|
-
}),
|
|
1183
|
-
},
|
|
1184
|
-
t.nodesMap.forEach((
|
|
1185
|
-
|
|
1186
|
-
}), t.selectedKeys.clear(),
|
|
1187
|
-
const
|
|
1188
|
-
|
|
1190
|
+
const f = [];
|
|
1191
|
+
return t.nodesMap.forEach((i) => {
|
|
1192
|
+
i.selected && f.push(i.data);
|
|
1193
|
+
}), f;
|
|
1194
|
+
}, m = (f) => {
|
|
1195
|
+
t.nodesMap.forEach((i) => {
|
|
1196
|
+
i.selected = !1;
|
|
1197
|
+
}), t.selectedKeys.clear(), f.forEach((i) => {
|
|
1198
|
+
const d = t.nodesMap.get(i);
|
|
1199
|
+
d && (d.selected = !0, t.selectedKeys.add(i));
|
|
1189
1200
|
});
|
|
1190
1201
|
}, L = $(() => e.showCheckbox || e.checkable);
|
|
1191
|
-
return
|
|
1202
|
+
return me("tree", {
|
|
1192
1203
|
props: e,
|
|
1193
1204
|
store: t,
|
|
1194
1205
|
emit: o,
|
|
1195
|
-
toggleExpand:
|
|
1196
|
-
toggleCheck:
|
|
1206
|
+
toggleExpand: R,
|
|
1207
|
+
toggleCheck: V,
|
|
1197
1208
|
handleNodeClick: _,
|
|
1198
1209
|
filterValue: je(l),
|
|
1199
1210
|
showCheckboxComputed: L
|
|
1200
1211
|
}), r({
|
|
1201
1212
|
filter: E,
|
|
1202
1213
|
getNode: B,
|
|
1203
|
-
setCurrentKey:
|
|
1214
|
+
setCurrentKey: N,
|
|
1204
1215
|
getCurrentKey: () => t.currentKey,
|
|
1205
|
-
getCurrentNode:
|
|
1216
|
+
getCurrentNode: K,
|
|
1206
1217
|
getCheckedNodes: Y,
|
|
1207
|
-
getCheckedKeys:
|
|
1218
|
+
getCheckedKeys: q,
|
|
1208
1219
|
setCheckedKeys: v,
|
|
1209
1220
|
getHalfCheckedNodes: b,
|
|
1210
1221
|
getHalfCheckedKeys: y,
|
|
1211
1222
|
setChecked: D,
|
|
1212
1223
|
getSelectedNodes: I,
|
|
1213
|
-
setSelectedKeys:
|
|
1214
|
-
expandAll:
|
|
1224
|
+
setSelectedKeys: m,
|
|
1225
|
+
expandAll: C,
|
|
1215
1226
|
collapseAll: S,
|
|
1216
1227
|
// 额外方法
|
|
1217
|
-
updateKeyChildren: (
|
|
1218
|
-
const
|
|
1219
|
-
|
|
1220
|
-
t.nodesMap.delete(
|
|
1221
|
-
}),
|
|
1222
|
-
const h = new
|
|
1228
|
+
updateKeyChildren: (f, i) => {
|
|
1229
|
+
const d = t.nodesMap.get(f);
|
|
1230
|
+
d && (d.children.forEach((g) => {
|
|
1231
|
+
t.nodesMap.delete(g.key);
|
|
1232
|
+
}), d.children = i.map((g) => {
|
|
1233
|
+
const h = new ve(g, t, d.level + 1, d);
|
|
1223
1234
|
return t.nodesMap.set(h.key, h), h;
|
|
1224
|
-
}),
|
|
1235
|
+
}), d.isLeaf = d.children.length === 0);
|
|
1225
1236
|
},
|
|
1226
|
-
remove: (
|
|
1227
|
-
const
|
|
1228
|
-
if (
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1231
|
-
const h =
|
|
1232
|
-
h > -1 &&
|
|
1237
|
+
remove: (f) => {
|
|
1238
|
+
const i = t.nodesMap.get(f);
|
|
1239
|
+
if (i) {
|
|
1240
|
+
const d = i.parent;
|
|
1241
|
+
if (d) {
|
|
1242
|
+
const h = d.children.indexOf(i);
|
|
1243
|
+
h > -1 && d.children.splice(h, 1), d.children.length === 0 && (d.isLeaf = !0);
|
|
1233
1244
|
} else {
|
|
1234
|
-
const h = t.rootNodes.indexOf(
|
|
1245
|
+
const h = t.rootNodes.indexOf(i);
|
|
1235
1246
|
h > -1 && t.rootNodes.splice(h, 1);
|
|
1236
1247
|
}
|
|
1237
|
-
const
|
|
1238
|
-
t.nodesMap.delete(h.key), h.children.forEach(
|
|
1248
|
+
const g = (h) => {
|
|
1249
|
+
t.nodesMap.delete(h.key), h.children.forEach(g);
|
|
1239
1250
|
};
|
|
1240
|
-
|
|
1251
|
+
g(i);
|
|
1241
1252
|
}
|
|
1242
1253
|
},
|
|
1243
|
-
append: (
|
|
1244
|
-
if (
|
|
1245
|
-
const
|
|
1246
|
-
if (
|
|
1247
|
-
const
|
|
1248
|
-
t.nodesMap.set(
|
|
1254
|
+
append: (f, i) => {
|
|
1255
|
+
if (i) {
|
|
1256
|
+
const d = t.nodesMap.get(i);
|
|
1257
|
+
if (d) {
|
|
1258
|
+
const g = new ve(f, t, d.level + 1, d);
|
|
1259
|
+
t.nodesMap.set(g.key, g), d.children.push(g), d.isLeaf = !1;
|
|
1249
1260
|
}
|
|
1250
1261
|
} else {
|
|
1251
|
-
const
|
|
1252
|
-
t.nodesMap.set(
|
|
1262
|
+
const d = new ve(f, t, 0, null);
|
|
1263
|
+
t.nodesMap.set(d.key, d), t.rootNodes.push(d);
|
|
1253
1264
|
}
|
|
1254
1265
|
},
|
|
1255
|
-
insertBefore: (
|
|
1256
|
-
var
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
-
const h = new
|
|
1266
|
+
insertBefore: (f, i) => {
|
|
1267
|
+
var g;
|
|
1268
|
+
const d = t.nodesMap.get(i);
|
|
1269
|
+
if (d) {
|
|
1270
|
+
const h = new ve(f, t, d.level, d.parent);
|
|
1260
1271
|
t.nodesMap.set(h.key, h);
|
|
1261
|
-
const T = ((
|
|
1272
|
+
const T = ((g = d.parent) == null ? void 0 : g.children) || t.rootNodes, H = T.indexOf(d);
|
|
1262
1273
|
T.splice(H, 0, h);
|
|
1263
1274
|
}
|
|
1264
1275
|
},
|
|
1265
|
-
insertAfter: (
|
|
1266
|
-
var
|
|
1267
|
-
const
|
|
1268
|
-
if (
|
|
1269
|
-
const h = new
|
|
1276
|
+
insertAfter: (f, i) => {
|
|
1277
|
+
var g;
|
|
1278
|
+
const d = t.nodesMap.get(i);
|
|
1279
|
+
if (d) {
|
|
1280
|
+
const h = new ve(f, t, d.level, d.parent);
|
|
1270
1281
|
t.nodesMap.set(h.key, h);
|
|
1271
|
-
const T = ((
|
|
1282
|
+
const T = ((g = d.parent) == null ? void 0 : g.children) || t.rootNodes, H = T.indexOf(d);
|
|
1272
1283
|
T.splice(H + 1, 0, h);
|
|
1273
1284
|
}
|
|
1274
1285
|
}
|
|
1275
1286
|
}), se(
|
|
1276
1287
|
() => [e.treeData, e.data],
|
|
1277
1288
|
() => {
|
|
1278
|
-
|
|
1289
|
+
k(z());
|
|
1279
1290
|
},
|
|
1280
1291
|
{ immediate: !0, deep: !0 }
|
|
1281
1292
|
), se(
|
|
1282
1293
|
() => e.checkedKeys,
|
|
1283
|
-
(
|
|
1284
|
-
|
|
1294
|
+
(f) => {
|
|
1295
|
+
f && v(f);
|
|
1285
1296
|
},
|
|
1286
1297
|
{ immediate: !0, deep: !0 }
|
|
1287
1298
|
), se(
|
|
1288
1299
|
() => e.defaultCheckedKeys,
|
|
1289
|
-
(
|
|
1290
|
-
|
|
1300
|
+
(f) => {
|
|
1301
|
+
f && f.length > 0 && !e.checkedKeys && v(f);
|
|
1291
1302
|
},
|
|
1292
1303
|
{ immediate: !0, deep: !0 }
|
|
1293
|
-
), (
|
|
1294
|
-
class: p([
|
|
1304
|
+
), (f, i) => (M(), w("div", {
|
|
1305
|
+
class: p([u(a).b(), u(a).m(s.size)])
|
|
1295
1306
|
}, [
|
|
1296
|
-
(M(!0),
|
|
1297
|
-
key:
|
|
1298
|
-
node:
|
|
1307
|
+
(M(!0), w(te, null, re(t.rootNodes, (d) => (M(), ce(Mt, {
|
|
1308
|
+
key: d.key,
|
|
1309
|
+
node: d
|
|
1299
1310
|
}, {
|
|
1300
|
-
default: Ie((
|
|
1301
|
-
|
|
1302
|
-
node:
|
|
1303
|
-
data:
|
|
1311
|
+
default: Ie((g) => [
|
|
1312
|
+
F(f.$slots, "default", {
|
|
1313
|
+
node: g.node,
|
|
1314
|
+
data: g.data
|
|
1304
1315
|
}, () => [
|
|
1305
|
-
|
|
1316
|
+
oe(X(g.node.label), 1)
|
|
1306
1317
|
])
|
|
1307
1318
|
]),
|
|
1308
1319
|
_: 2
|
|
1309
1320
|
}, 1032, ["node"]))), 128)),
|
|
1310
|
-
t.rootNodes.length ? j("", !0) : (M(),
|
|
1321
|
+
t.rootNodes.length ? j("", !0) : (M(), w("div", {
|
|
1311
1322
|
key: 0,
|
|
1312
|
-
class: p(
|
|
1323
|
+
class: p(u(a).e("empty"))
|
|
1313
1324
|
}, [
|
|
1314
|
-
|
|
1315
|
-
|
|
1325
|
+
F(f.$slots, "empty", {}, () => [
|
|
1326
|
+
oe(X(s.emptyText), 1)
|
|
1316
1327
|
])
|
|
1317
1328
|
], 2))
|
|
1318
1329
|
], 2));
|
|
1319
1330
|
}
|
|
1320
|
-
}), kt = ["src"], wt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==",
|
|
1331
|
+
}), kt = ["src"], wt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", rn = /* @__PURE__ */ Z({
|
|
1321
1332
|
name: "XEmpty",
|
|
1322
1333
|
__name: "index",
|
|
1323
1334
|
props: {
|
|
@@ -1327,69 +1338,69 @@ const on = /* @__PURE__ */ Z({
|
|
|
1327
1338
|
size: { default: "default" }
|
|
1328
1339
|
},
|
|
1329
1340
|
setup(s) {
|
|
1330
|
-
const r = s,
|
|
1331
|
-
const
|
|
1332
|
-
return r.imageSize && (
|
|
1341
|
+
const r = s, n = J("empty"), e = $(() => {
|
|
1342
|
+
const a = {};
|
|
1343
|
+
return r.imageSize && (a.height = `${r.imageSize}px`, a.width = `${r.imageSize}px`), a;
|
|
1333
1344
|
}), o = $(() => r.description || "暂无数据");
|
|
1334
|
-
return (
|
|
1335
|
-
class: p([
|
|
1345
|
+
return (a, t) => (M(), w("div", {
|
|
1346
|
+
class: p([u(n).b(), u(n).m(s.size)])
|
|
1336
1347
|
}, [
|
|
1337
1348
|
A("div", {
|
|
1338
|
-
class: p(
|
|
1339
|
-
style:
|
|
1349
|
+
class: p(u(n).e("image")),
|
|
1350
|
+
style: U(e.value)
|
|
1340
1351
|
}, [
|
|
1341
|
-
|
|
1342
|
-
s.image ? (M(),
|
|
1352
|
+
F(a.$slots, "image", {}, () => [
|
|
1353
|
+
s.image ? (M(), w("img", {
|
|
1343
1354
|
key: 0,
|
|
1344
1355
|
src: s.image,
|
|
1345
|
-
style:
|
|
1356
|
+
style: U(e.value),
|
|
1346
1357
|
draggable: "false"
|
|
1347
|
-
}, null, 12, kt)) : (M(),
|
|
1358
|
+
}, null, 12, kt)) : (M(), w("img", {
|
|
1348
1359
|
key: 1,
|
|
1349
1360
|
src: wt,
|
|
1350
|
-
style:
|
|
1361
|
+
style: U(e.value),
|
|
1351
1362
|
draggable: "false"
|
|
1352
1363
|
}, null, 4))
|
|
1353
1364
|
])
|
|
1354
1365
|
], 6),
|
|
1355
1366
|
A("div", {
|
|
1356
|
-
class: p(
|
|
1367
|
+
class: p(u(n).e("description"))
|
|
1357
1368
|
}, [
|
|
1358
|
-
|
|
1359
|
-
A("p", null,
|
|
1369
|
+
F(a.$slots, "description", {}, () => [
|
|
1370
|
+
A("p", null, X(o.value), 1)
|
|
1360
1371
|
])
|
|
1361
1372
|
], 2),
|
|
1362
|
-
|
|
1373
|
+
a.$slots.default ? (M(), w("div", {
|
|
1363
1374
|
key: 0,
|
|
1364
|
-
class: p(
|
|
1375
|
+
class: p(u(n).e("bottom"))
|
|
1365
1376
|
}, [
|
|
1366
|
-
|
|
1377
|
+
F(a.$slots, "default")
|
|
1367
1378
|
], 2)) : j("", !0)
|
|
1368
1379
|
], 2));
|
|
1369
1380
|
}
|
|
1370
|
-
}),
|
|
1381
|
+
}), cn = /* @__PURE__ */ Z({
|
|
1371
1382
|
name: "XTimeline",
|
|
1372
1383
|
__name: "index",
|
|
1373
1384
|
props: {
|
|
1374
1385
|
direction: { default: "vertical" }
|
|
1375
1386
|
},
|
|
1376
1387
|
setup(s) {
|
|
1377
|
-
const r = s,
|
|
1378
|
-
|
|
1388
|
+
const r = s, n = J("timeline");
|
|
1389
|
+
me("timeline", {
|
|
1379
1390
|
props: r
|
|
1380
1391
|
});
|
|
1381
1392
|
const e = $(() => [
|
|
1382
|
-
|
|
1383
|
-
|
|
1393
|
+
n.b(),
|
|
1394
|
+
n.m(r.direction)
|
|
1384
1395
|
]);
|
|
1385
|
-
return (o,
|
|
1396
|
+
return (o, a) => (M(), w("ul", {
|
|
1386
1397
|
class: p(e.value),
|
|
1387
1398
|
role: "timeline"
|
|
1388
1399
|
}, [
|
|
1389
|
-
|
|
1400
|
+
F(o.$slots, "default")
|
|
1390
1401
|
], 2));
|
|
1391
1402
|
}
|
|
1392
|
-
}),
|
|
1403
|
+
}), un = /* @__PURE__ */ Z({
|
|
1393
1404
|
name: "XTimelineItem",
|
|
1394
1405
|
__name: "TimelineItem",
|
|
1395
1406
|
props: {
|
|
@@ -1401,7 +1412,7 @@ const on = /* @__PURE__ */ Z({
|
|
|
1401
1412
|
placement: { default: "bottom" }
|
|
1402
1413
|
},
|
|
1403
1414
|
setup(s) {
|
|
1404
|
-
const r = s,
|
|
1415
|
+
const r = s, n = J("timeline-item"), e = {
|
|
1405
1416
|
primary: "#4F46E5",
|
|
1406
1417
|
success: "#00A870",
|
|
1407
1418
|
warning: "#FF7D00",
|
|
@@ -1410,42 +1421,42 @@ const on = /* @__PURE__ */ Z({
|
|
|
1410
1421
|
}, o = $(() => {
|
|
1411
1422
|
const t = {};
|
|
1412
1423
|
return r.color ? t.backgroundColor = r.color : r.type && e[r.type] && (t.backgroundColor = e[r.type]), t;
|
|
1413
|
-
}),
|
|
1414
|
-
|
|
1415
|
-
|
|
1424
|
+
}), a = $(() => [
|
|
1425
|
+
n.b(),
|
|
1426
|
+
n.m(r.size)
|
|
1416
1427
|
]);
|
|
1417
|
-
return (t, l) => (M(),
|
|
1418
|
-
class: p(
|
|
1428
|
+
return (t, l) => (M(), w("li", {
|
|
1429
|
+
class: p(a.value)
|
|
1419
1430
|
}, [
|
|
1420
1431
|
A("div", {
|
|
1421
|
-
class: p(
|
|
1422
|
-
style:
|
|
1432
|
+
class: p(u(n).e("node")),
|
|
1433
|
+
style: U(o.value)
|
|
1423
1434
|
}, [
|
|
1424
|
-
|
|
1435
|
+
F(t.$slots, "dot")
|
|
1425
1436
|
], 6),
|
|
1426
1437
|
A("div", {
|
|
1427
|
-
class: p(
|
|
1438
|
+
class: p(u(n).e("tail"))
|
|
1428
1439
|
}, null, 2),
|
|
1429
1440
|
A("div", {
|
|
1430
|
-
class: p(
|
|
1441
|
+
class: p(u(n).e("wrapper"))
|
|
1431
1442
|
}, [
|
|
1432
|
-
!s.hideTimestamp && s.timestamp && s.placement === "top" ? (M(),
|
|
1443
|
+
!s.hideTimestamp && s.timestamp && s.placement === "top" ? (M(), w("div", {
|
|
1433
1444
|
key: 0,
|
|
1434
|
-
class: p(
|
|
1435
|
-
},
|
|
1445
|
+
class: p(u(n).e("timestamp"))
|
|
1446
|
+
}, X(s.timestamp), 3)) : j("", !0),
|
|
1436
1447
|
A("div", {
|
|
1437
|
-
class: p(
|
|
1448
|
+
class: p(u(n).e("content"))
|
|
1438
1449
|
}, [
|
|
1439
|
-
|
|
1450
|
+
F(t.$slots, "default")
|
|
1440
1451
|
], 2),
|
|
1441
|
-
!s.hideTimestamp && s.timestamp && s.placement === "bottom" ? (M(),
|
|
1452
|
+
!s.hideTimestamp && s.timestamp && s.placement === "bottom" ? (M(), w("div", {
|
|
1442
1453
|
key: 1,
|
|
1443
|
-
class: p(
|
|
1444
|
-
},
|
|
1454
|
+
class: p(u(n).e("timestamp"))
|
|
1455
|
+
}, X(s.timestamp), 3)) : j("", !0)
|
|
1445
1456
|
], 2)
|
|
1446
1457
|
], 2));
|
|
1447
1458
|
}
|
|
1448
|
-
}), xt = ["onMouseenter", "onClick"],
|
|
1459
|
+
}), xt = ["onMouseenter", "onClick"], dn = /* @__PURE__ */ Z({
|
|
1449
1460
|
name: "XCarousel",
|
|
1450
1461
|
__name: "index",
|
|
1451
1462
|
props: {
|
|
@@ -1459,39 +1470,39 @@ const on = /* @__PURE__ */ Z({
|
|
|
1459
1470
|
height: { default: 300 }
|
|
1460
1471
|
},
|
|
1461
1472
|
emits: ["update:activeIndex", "change"],
|
|
1462
|
-
setup(s, { expose: r, emit:
|
|
1463
|
-
const e = s, o =
|
|
1464
|
-
|
|
1473
|
+
setup(s, { expose: r, emit: n }) {
|
|
1474
|
+
const e = s, o = n, a = J("carousel"), t = O(e.activeIndex), l = O(0), c = O(null), z = O(!1);
|
|
1475
|
+
me("carousel", {
|
|
1465
1476
|
currentIndex: t,
|
|
1466
1477
|
itemCount: l
|
|
1467
1478
|
});
|
|
1468
|
-
const
|
|
1469
|
-
const
|
|
1470
|
-
e.loop ? t.value = (Y + l.value) % l.value : t.value = Math.max(0, Math.min(Y, l.value - 1)), o("update:activeIndex", t.value), o("change", t.value,
|
|
1471
|
-
},
|
|
1472
|
-
|
|
1473
|
-
},
|
|
1474
|
-
|
|
1479
|
+
const k = (Y) => {
|
|
1480
|
+
const q = t.value;
|
|
1481
|
+
e.loop ? t.value = (Y + l.value) % l.value : t.value = Math.max(0, Math.min(Y, l.value - 1)), o("update:activeIndex", t.value), o("change", t.value, q);
|
|
1482
|
+
}, x = () => {
|
|
1483
|
+
k(t.value - 1);
|
|
1484
|
+
}, C = () => {
|
|
1485
|
+
k(t.value + 1);
|
|
1475
1486
|
}, S = () => {
|
|
1476
|
-
e.autoplay && l.value > 1 && (
|
|
1477
|
-
|
|
1487
|
+
e.autoplay && l.value > 1 && (R(), c.value = setInterval(() => {
|
|
1488
|
+
z.value || C();
|
|
1478
1489
|
}, e.interval));
|
|
1490
|
+
}, R = () => {
|
|
1491
|
+
c.value && (clearInterval(c.value), c.value = null);
|
|
1479
1492
|
}, V = () => {
|
|
1480
|
-
|
|
1481
|
-
}, P = () => {
|
|
1482
|
-
C.value = !0, e.arrow;
|
|
1493
|
+
z.value = !0, e.arrow;
|
|
1483
1494
|
}, _ = () => {
|
|
1484
|
-
|
|
1495
|
+
z.value = !1;
|
|
1485
1496
|
}, E = (Y) => {
|
|
1486
|
-
e.trigger === "hover" &&
|
|
1497
|
+
e.trigger === "hover" && k(Y);
|
|
1487
1498
|
}, B = (Y) => {
|
|
1488
|
-
e.trigger === "click" &&
|
|
1489
|
-
},
|
|
1499
|
+
e.trigger === "click" && k(Y);
|
|
1500
|
+
}, N = $(() => ({
|
|
1490
1501
|
height: typeof e.height == "number" ? `${e.height}px` : e.height
|
|
1491
|
-
})),
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1502
|
+
})), K = $(() => [
|
|
1503
|
+
a.b(),
|
|
1504
|
+
a.m(`arrow-${e.arrow}`),
|
|
1505
|
+
a.m(`indicator-${e.indicatorPosition}`)
|
|
1495
1506
|
]);
|
|
1496
1507
|
return se(() => e.activeIndex, (Y) => {
|
|
1497
1508
|
t.value = Y;
|
|
@@ -1503,71 +1514,71 @@ const on = /* @__PURE__ */ Z({
|
|
|
1503
1514
|
});
|
|
1504
1515
|
}), pe(() => {
|
|
1505
1516
|
S();
|
|
1506
|
-
}),
|
|
1507
|
-
|
|
1517
|
+
}), Me(() => {
|
|
1518
|
+
R();
|
|
1508
1519
|
}), r({
|
|
1509
|
-
prev:
|
|
1510
|
-
next:
|
|
1511
|
-
setActiveItem:
|
|
1512
|
-
}), (Y,
|
|
1513
|
-
class: p(
|
|
1514
|
-
style:
|
|
1515
|
-
onMouseenter:
|
|
1520
|
+
prev: x,
|
|
1521
|
+
next: C,
|
|
1522
|
+
setActiveItem: k
|
|
1523
|
+
}), (Y, q) => (M(), w("div", {
|
|
1524
|
+
class: p(K.value),
|
|
1525
|
+
style: U(N.value),
|
|
1526
|
+
onMouseenter: V,
|
|
1516
1527
|
onMouseleave: _
|
|
1517
1528
|
}, [
|
|
1518
1529
|
A("div", {
|
|
1519
|
-
class: p(
|
|
1530
|
+
class: p(u(a).e("container"))
|
|
1520
1531
|
}, [
|
|
1521
|
-
|
|
1532
|
+
F(Y.$slots, "default")
|
|
1522
1533
|
], 2),
|
|
1523
|
-
s.arrow !== "never" ? (M(),
|
|
1534
|
+
s.arrow !== "never" ? (M(), w("button", {
|
|
1524
1535
|
key: 0,
|
|
1525
|
-
class: p([
|
|
1526
|
-
onClick:
|
|
1536
|
+
class: p([u(a).e("arrow"), u(a).e("arrow-left")]),
|
|
1537
|
+
onClick: x
|
|
1527
1538
|
}, " ‹ ", 2)) : j("", !0),
|
|
1528
|
-
s.arrow !== "never" ? (M(),
|
|
1539
|
+
s.arrow !== "never" ? (M(), w("button", {
|
|
1529
1540
|
key: 1,
|
|
1530
|
-
class: p([
|
|
1531
|
-
onClick:
|
|
1541
|
+
class: p([u(a).e("arrow"), u(a).e("arrow-right")]),
|
|
1542
|
+
onClick: C
|
|
1532
1543
|
}, " › ", 2)) : j("", !0),
|
|
1533
|
-
s.indicatorPosition !== "none" ? (M(),
|
|
1544
|
+
s.indicatorPosition !== "none" ? (M(), w("ul", {
|
|
1534
1545
|
key: 2,
|
|
1535
|
-
class: p(
|
|
1546
|
+
class: p(u(a).e("indicators"))
|
|
1536
1547
|
}, [
|
|
1537
|
-
(M(!0),
|
|
1548
|
+
(M(!0), w(te, null, re(l.value, (v) => (M(), w("li", {
|
|
1538
1549
|
key: v,
|
|
1539
|
-
class: p([
|
|
1550
|
+
class: p([u(a).e("indicator"), u(a).is("active", v - 1 === t.value)]),
|
|
1540
1551
|
onMouseenter: (b) => E(v - 1),
|
|
1541
1552
|
onClick: (b) => B(v - 1)
|
|
1542
1553
|
}, [
|
|
1543
1554
|
A("button", {
|
|
1544
|
-
class: p(
|
|
1555
|
+
class: p(u(a).e("indicator-btn"))
|
|
1545
1556
|
}, null, 2)
|
|
1546
1557
|
], 42, xt))), 128))
|
|
1547
1558
|
], 2)) : j("", !0)
|
|
1548
1559
|
], 38));
|
|
1549
1560
|
}
|
|
1550
|
-
}),
|
|
1561
|
+
}), hn = /* @__PURE__ */ Z({
|
|
1551
1562
|
name: "XCarouselItem",
|
|
1552
1563
|
__name: "CarouselItem",
|
|
1553
1564
|
setup(s) {
|
|
1554
|
-
const r = J("carousel-item"),
|
|
1565
|
+
const r = J("carousel-item"), n = ye("carousel"), e = O(-1);
|
|
1555
1566
|
pe(() => {
|
|
1556
|
-
|
|
1557
|
-
}),
|
|
1558
|
-
|
|
1567
|
+
n && (e.value = n.itemCount.value, n.itemCount.value++);
|
|
1568
|
+
}), Me(() => {
|
|
1569
|
+
n && n.itemCount.value--;
|
|
1559
1570
|
});
|
|
1560
|
-
const o = $(() =>
|
|
1571
|
+
const o = $(() => n && e.value === n.currentIndex.value), a = $(() => [
|
|
1561
1572
|
r.b(),
|
|
1562
1573
|
r.is("active", o.value)
|
|
1563
1574
|
]);
|
|
1564
|
-
return (t, l) => (M(),
|
|
1565
|
-
class: p(
|
|
1575
|
+
return (t, l) => (M(), w("div", {
|
|
1576
|
+
class: p(a.value)
|
|
1566
1577
|
}, [
|
|
1567
|
-
|
|
1578
|
+
F(t.$slots, "default")
|
|
1568
1579
|
], 2));
|
|
1569
1580
|
}
|
|
1570
|
-
}), bt = { key: 0 }, Ct = ["onClick"], zt = { class: "sort-arrow up" }, It = { class: "sort-arrow down" }, At = ["onClick"], Dt = ["onClick"], Lt = { key: 1 }, Tt = ["colspan"], Bt = { style: { display: "none" } },
|
|
1581
|
+
}), bt = { key: 0 }, Ct = ["onClick"], zt = { class: "sort-arrow up" }, It = { class: "sort-arrow down" }, At = ["onClick"], Dt = ["onClick"], Lt = { key: 1 }, Tt = ["colspan"], Bt = { style: { display: "none" } }, fn = /* @__PURE__ */ Z({
|
|
1571
1582
|
name: "XTable",
|
|
1572
1583
|
__name: "index",
|
|
1573
1584
|
props: {
|
|
@@ -1584,33 +1595,33 @@ const on = /* @__PURE__ */ Z({
|
|
|
1584
1595
|
pagination: {}
|
|
1585
1596
|
},
|
|
1586
1597
|
emits: ["sort-change", "row-click", "row-dblclick", "cell-click", "selection-change", "select-all", "page-change", "size-change"],
|
|
1587
|
-
setup(s, { expose: r, emit:
|
|
1588
|
-
var
|
|
1589
|
-
const e = s, o =
|
|
1598
|
+
setup(s, { expose: r, emit: n }) {
|
|
1599
|
+
var d, g;
|
|
1600
|
+
const e = s, o = n, a = J("table");
|
|
1590
1601
|
be();
|
|
1591
1602
|
const t = Se([]);
|
|
1592
|
-
|
|
1603
|
+
me("x-table", {
|
|
1593
1604
|
registerColumn: (h, T) => {
|
|
1594
|
-
t.findIndex((
|
|
1605
|
+
t.findIndex((P) => P.config.prop === h.prop) === -1 && t.push({ config: h, slot: T });
|
|
1595
1606
|
},
|
|
1596
1607
|
unregisterColumn: (h) => {
|
|
1597
1608
|
const T = t.findIndex((H) => H.config.prop === h);
|
|
1598
1609
|
T !== -1 && t.splice(T, 1);
|
|
1599
1610
|
},
|
|
1600
1611
|
updateColumnSlot: (h, T) => {
|
|
1601
|
-
const H = t.find((
|
|
1612
|
+
const H = t.find((P) => P.config.prop === h);
|
|
1602
1613
|
H && (H.slot = T);
|
|
1603
1614
|
},
|
|
1604
1615
|
props: e
|
|
1605
1616
|
});
|
|
1606
|
-
const
|
|
1607
|
-
const h = t.map((
|
|
1608
|
-
return [...T, ...H, ...
|
|
1609
|
-
}),
|
|
1610
|
-
$(() =>
|
|
1617
|
+
const k = $(() => {
|
|
1618
|
+
const h = t.map((W) => W.config), T = h.filter((W) => W.fixed === "left" || W.fixed === !0), H = h.filter((W) => !W.fixed), P = h.filter((W) => W.fixed === "right");
|
|
1619
|
+
return [...T, ...H, ...P];
|
|
1620
|
+
}), x = $(() => k.value.filter((h) => h.fixed === "left" || h.fixed === !0)), C = $(() => k.value.filter((h) => h.fixed === "right"));
|
|
1621
|
+
$(() => k.value.filter((h) => !h.fixed)), $(() => x.value.reduce((h, T) => {
|
|
1611
1622
|
const H = T.width ? typeof T.width == "number" ? T.width : parseInt(T.width) : 100;
|
|
1612
1623
|
return h + H;
|
|
1613
|
-
}, 0)), $(() =>
|
|
1624
|
+
}, 0)), $(() => C.value.reduce((h, T) => {
|
|
1614
1625
|
const H = T.width ? typeof T.width == "number" ? T.width : parseInt(T.width) : 100;
|
|
1615
1626
|
return h + H;
|
|
1616
1627
|
}, 0));
|
|
@@ -1619,118 +1630,118 @@ const on = /* @__PURE__ */ Z({
|
|
|
1619
1630
|
return t.forEach((T) => {
|
|
1620
1631
|
T.slot && (h[T.config.prop] = T.slot);
|
|
1621
1632
|
}), h;
|
|
1622
|
-
}),
|
|
1623
|
-
prop: ((
|
|
1624
|
-
order: ((
|
|
1625
|
-
}),
|
|
1626
|
-
if (!
|
|
1633
|
+
}), R = O({
|
|
1634
|
+
prop: ((d = e.defaultSort) == null ? void 0 : d.prop) || "",
|
|
1635
|
+
order: ((g = e.defaultSort) == null ? void 0 : g.order) || null
|
|
1636
|
+
}), V = $(() => {
|
|
1637
|
+
if (!R.value.prop || !R.value.order)
|
|
1627
1638
|
return e.data;
|
|
1628
|
-
const { prop: h, order: T } =
|
|
1629
|
-
return [...e.data].sort((H,
|
|
1630
|
-
const
|
|
1631
|
-
if (
|
|
1632
|
-
const
|
|
1633
|
-
return T === "ascending" ?
|
|
1639
|
+
const { prop: h, order: T } = R.value;
|
|
1640
|
+
return [...e.data].sort((H, P) => {
|
|
1641
|
+
const W = H[h], ee = P[h];
|
|
1642
|
+
if (W === ee) return 0;
|
|
1643
|
+
const ae = W > ee ? 1 : -1;
|
|
1644
|
+
return T === "ascending" ? ae : -ae;
|
|
1634
1645
|
});
|
|
1635
1646
|
}), _ = $(() => {
|
|
1636
1647
|
const h = {};
|
|
1637
1648
|
return e.height && (h.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (h.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), h;
|
|
1638
1649
|
}), E = $(() => [
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1650
|
+
a.b(),
|
|
1651
|
+
a.is("border", e.border),
|
|
1652
|
+
a.is("stripe", e.stripe),
|
|
1653
|
+
a.is("loading", e.loading),
|
|
1654
|
+
a.is("has-fixed", x.value.length > 0 || C.value.length > 0)
|
|
1644
1655
|
]), B = (h) => {
|
|
1645
|
-
h.sortable && (
|
|
1646
|
-
},
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
] : "",
|
|
1650
|
-
const
|
|
1651
|
-
return T.formatter ? T.formatter(h, T,
|
|
1656
|
+
h.sortable && (R.value.prop === h.prop ? R.value.order === "ascending" ? R.value.order = "descending" : R.value.order === "descending" && (R.value.order = null, R.value.prop = "") : (R.value.prop = h.prop, R.value.order = "ascending"), o("sort-change", { ...R.value }));
|
|
1657
|
+
}, N = (h) => h.sortable ? R.value.prop !== h.prop ? a.is("sortable") : [
|
|
1658
|
+
a.is("sortable"),
|
|
1659
|
+
a.is(`sort-${R.value.order}`)
|
|
1660
|
+
] : "", K = (h, T, H) => {
|
|
1661
|
+
const P = h[T.prop];
|
|
1662
|
+
return T.formatter ? T.formatter(h, T, P, H) : P ?? "";
|
|
1652
1663
|
}, Y = (h, T) => {
|
|
1653
|
-
o("row-click", h,
|
|
1654
|
-
},
|
|
1655
|
-
const
|
|
1656
|
-
o("cell-click", h, T,
|
|
1664
|
+
o("row-click", h, k.value[0], T);
|
|
1665
|
+
}, q = (h, T, H) => {
|
|
1666
|
+
const P = H.target;
|
|
1667
|
+
o("cell-click", h, T, P, H);
|
|
1657
1668
|
}, v = (h) => {
|
|
1658
1669
|
o("page-change", h);
|
|
1659
1670
|
}, b = (h) => {
|
|
1660
1671
|
o("size-change", h);
|
|
1661
1672
|
}, y = (h, T, H) => {
|
|
1662
|
-
const
|
|
1663
|
-
if (h.width && (
|
|
1664
|
-
let
|
|
1665
|
-
for (let
|
|
1666
|
-
const
|
|
1667
|
-
|
|
1673
|
+
const P = {};
|
|
1674
|
+
if (h.width && (P.width = typeof h.width == "number" ? `${h.width}px` : h.width), h.minWidth && (P.minWidth = typeof h.minWidth == "number" ? `${h.minWidth}px` : h.minWidth), h.align && (P.textAlign = h.align), (h.fixed === "left" || h.fixed === !0) && (P.position = "sticky", P.left = "0px", P.zIndex = "2", T !== void 0 && T > 0)) {
|
|
1675
|
+
let W = 0;
|
|
1676
|
+
for (let ee = 0; ee < T; ee++) {
|
|
1677
|
+
const ae = x.value[ee], Q = ae.width ? typeof ae.width == "number" ? ae.width : parseInt(ae.width) : 100;
|
|
1678
|
+
W += Q;
|
|
1668
1679
|
}
|
|
1669
|
-
|
|
1680
|
+
P.left = `${W}px`;
|
|
1670
1681
|
}
|
|
1671
|
-
if (h.fixed === "right" && (
|
|
1672
|
-
const
|
|
1673
|
-
if (
|
|
1674
|
-
let
|
|
1675
|
-
for (let
|
|
1676
|
-
const
|
|
1677
|
-
|
|
1682
|
+
if (h.fixed === "right" && (P.position = "sticky", P.right = "0px", P.zIndex = "2", T !== void 0)) {
|
|
1683
|
+
const W = C.value, ee = W.length - 1 - T;
|
|
1684
|
+
if (ee > 0) {
|
|
1685
|
+
let ae = 0;
|
|
1686
|
+
for (let Q = 0; Q < ee; Q++) {
|
|
1687
|
+
const G = W[W.length - 1 - Q], He = G.width ? typeof G.width == "number" ? G.width : parseInt(G.width) : 100;
|
|
1688
|
+
ae += He;
|
|
1678
1689
|
}
|
|
1679
|
-
|
|
1690
|
+
P.right = `${ae}px`;
|
|
1680
1691
|
}
|
|
1681
1692
|
}
|
|
1682
|
-
return
|
|
1693
|
+
return P;
|
|
1683
1694
|
}, D = (h) => {
|
|
1684
1695
|
const T = [];
|
|
1685
|
-
return (h.fixed === "left" || h.fixed === !0) && T.push(
|
|
1686
|
-
}, I =
|
|
1696
|
+
return (h.fixed === "left" || h.fixed === !0) && T.push(a.is("fixed-left")), h.fixed === "right" && T.push(a.is("fixed-right")), T;
|
|
1697
|
+
}, I = O([]), m = (h) => e.rowKey ? typeof e.rowKey == "function" ? e.rowKey(h) : String(h[e.rowKey]) : String(e.data.indexOf(h));
|
|
1687
1698
|
return r({
|
|
1688
1699
|
clearSelection: () => {
|
|
1689
1700
|
I.value = [], o("selection-change", []);
|
|
1690
1701
|
},
|
|
1691
1702
|
getSelection: () => [...I.value],
|
|
1692
1703
|
toggleRowSelection: (h, T) => {
|
|
1693
|
-
const H =
|
|
1694
|
-
T === void 0 ?
|
|
1704
|
+
const H = m(h), P = I.value.findIndex((W) => m(W) === H);
|
|
1705
|
+
T === void 0 ? P > -1 ? I.value.splice(P, 1) : I.value.push(h) : T && P === -1 ? I.value.push(h) : !T && P > -1 && I.value.splice(P, 1), o("selection-change", [...I.value]);
|
|
1695
1706
|
},
|
|
1696
|
-
sortState:
|
|
1697
|
-
columns:
|
|
1698
|
-
}), (h, T) => (M(),
|
|
1707
|
+
sortState: R,
|
|
1708
|
+
columns: k
|
|
1709
|
+
}), (h, T) => (M(), w("div", {
|
|
1699
1710
|
class: p(E.value)
|
|
1700
1711
|
}, [
|
|
1701
|
-
s.loading ? (M(),
|
|
1712
|
+
s.loading ? (M(), w("div", {
|
|
1702
1713
|
key: 0,
|
|
1703
|
-
class: p(
|
|
1714
|
+
class: p(u(a).e("loading"))
|
|
1704
1715
|
}, [...T[0] || (T[0] = [
|
|
1705
1716
|
A("span", { class: "loading-spinner" }, null, -1),
|
|
1706
1717
|
A("span", { class: "loading-text" }, "加载中...", -1)
|
|
1707
1718
|
])], 2)) : j("", !0),
|
|
1708
1719
|
A("div", {
|
|
1709
|
-
class: p(
|
|
1710
|
-
style:
|
|
1720
|
+
class: p(u(a).e("wrapper")),
|
|
1721
|
+
style: U(_.value)
|
|
1711
1722
|
}, [
|
|
1712
1723
|
A("table", null, [
|
|
1713
|
-
s.showHeader ? (M(),
|
|
1724
|
+
s.showHeader ? (M(), w("thead", bt, [
|
|
1714
1725
|
A("tr", null, [
|
|
1715
|
-
(M(!0),
|
|
1726
|
+
(M(!0), w(te, null, re(k.value, (H, P) => (M(), w("th", {
|
|
1716
1727
|
key: H.prop,
|
|
1717
|
-
class: p([
|
|
1718
|
-
style:
|
|
1719
|
-
onClick: (
|
|
1728
|
+
class: p([u(a).e("header-cell"), N(H), ...D(H)]),
|
|
1729
|
+
style: U(y(H, H.fixed === "right" ? C.value.indexOf(H) : P)),
|
|
1730
|
+
onClick: (W) => B(H)
|
|
1720
1731
|
}, [
|
|
1721
|
-
A("span", null,
|
|
1722
|
-
H.sortable ? (M(),
|
|
1732
|
+
A("span", null, X(H.label), 1),
|
|
1733
|
+
H.sortable ? (M(), w("span", {
|
|
1723
1734
|
key: 0,
|
|
1724
|
-
class: p(
|
|
1735
|
+
class: p(u(a).e("sort-icon"))
|
|
1725
1736
|
}, [
|
|
1726
1737
|
A("span", zt, [
|
|
1727
|
-
|
|
1738
|
+
le(u(ne), {
|
|
1728
1739
|
name: "sort-up",
|
|
1729
1740
|
size: 12
|
|
1730
1741
|
})
|
|
1731
1742
|
]),
|
|
1732
1743
|
A("span", It, [
|
|
1733
|
-
|
|
1744
|
+
le(u(ne), {
|
|
1734
1745
|
name: "sort-down",
|
|
1735
1746
|
size: 12
|
|
1736
1747
|
})
|
|
@@ -1740,42 +1751,42 @@ const on = /* @__PURE__ */ Z({
|
|
|
1740
1751
|
])
|
|
1741
1752
|
])) : j("", !0),
|
|
1742
1753
|
A("tbody", null, [
|
|
1743
|
-
(M(!0),
|
|
1744
|
-
key: s.rowKey ? typeof s.rowKey == "function" ? s.rowKey(H) : H[s.rowKey] :
|
|
1745
|
-
class: p([
|
|
1746
|
-
onClick: (
|
|
1754
|
+
(M(!0), w(te, null, re(V.value, (H, P) => (M(), w("tr", {
|
|
1755
|
+
key: s.rowKey ? typeof s.rowKey == "function" ? s.rowKey(H) : H[s.rowKey] : P,
|
|
1756
|
+
class: p([u(a).e("row")]),
|
|
1757
|
+
onClick: (W) => Y(H, W)
|
|
1747
1758
|
}, [
|
|
1748
|
-
(M(!0),
|
|
1749
|
-
key:
|
|
1750
|
-
class: p([
|
|
1751
|
-
style:
|
|
1752
|
-
onClick: (
|
|
1759
|
+
(M(!0), w(te, null, re(k.value, (W, ee) => (M(), w("td", {
|
|
1760
|
+
key: W.prop,
|
|
1761
|
+
class: p([u(a).e("cell"), ...D(W)]),
|
|
1762
|
+
style: U(y(W, W.fixed === "right" ? C.value.indexOf(W) : ee)),
|
|
1763
|
+
onClick: (ae) => q(H, W, ae)
|
|
1753
1764
|
}, [
|
|
1754
|
-
S.value[
|
|
1755
|
-
|
|
1765
|
+
S.value[W.prop] ? (M(), ce(xe(() => S.value[W.prop]({ row: H, column: W, $index: P })), { key: 0 })) : (M(), w(te, { key: 1 }, [
|
|
1766
|
+
oe(X(K(H, W, P)), 1)
|
|
1756
1767
|
], 64))
|
|
1757
1768
|
], 14, Dt))), 128))
|
|
1758
1769
|
], 10, At))), 128))
|
|
1759
1770
|
]),
|
|
1760
|
-
|
|
1771
|
+
V.value.length === 0 && !s.loading ? (M(), w("tbody", Lt, [
|
|
1761
1772
|
A("tr", null, [
|
|
1762
1773
|
A("td", {
|
|
1763
|
-
colspan:
|
|
1764
|
-
class: p(
|
|
1774
|
+
colspan: k.value.length || 1,
|
|
1775
|
+
class: p(u(a).e("empty"))
|
|
1765
1776
|
}, [
|
|
1766
|
-
|
|
1767
|
-
|
|
1777
|
+
F(h.$slots, "empty", {}, () => [
|
|
1778
|
+
oe(X(s.emptyText), 1)
|
|
1768
1779
|
])
|
|
1769
1780
|
], 10, Tt)
|
|
1770
1781
|
])
|
|
1771
1782
|
])) : j("", !0)
|
|
1772
1783
|
])
|
|
1773
1784
|
], 6),
|
|
1774
|
-
s.pagination ? (M(),
|
|
1785
|
+
s.pagination ? (M(), w("div", {
|
|
1775
1786
|
key: 1,
|
|
1776
|
-
class: p(
|
|
1787
|
+
class: p(u(a).e("pagination"))
|
|
1777
1788
|
}, [
|
|
1778
|
-
|
|
1789
|
+
le(nt, {
|
|
1779
1790
|
total: s.pagination.total,
|
|
1780
1791
|
"current-page": s.pagination.current,
|
|
1781
1792
|
"page-size": s.pagination.pageSize,
|
|
@@ -1784,11 +1795,11 @@ const on = /* @__PURE__ */ Z({
|
|
|
1784
1795
|
}, null, 8, ["total", "current-page", "page-size"])
|
|
1785
1796
|
], 2)) : j("", !0),
|
|
1786
1797
|
A("div", Bt, [
|
|
1787
|
-
|
|
1798
|
+
F(h.$slots, "default")
|
|
1788
1799
|
])
|
|
1789
1800
|
], 2));
|
|
1790
1801
|
}
|
|
1791
|
-
}),
|
|
1802
|
+
}), $t = /* @__PURE__ */ Z({
|
|
1792
1803
|
name: "XTableColumn",
|
|
1793
1804
|
__name: "TableColumn",
|
|
1794
1805
|
props: {
|
|
@@ -1804,7 +1815,7 @@ const on = /* @__PURE__ */ Z({
|
|
|
1804
1815
|
setup(s) {
|
|
1805
1816
|
const r = s;
|
|
1806
1817
|
J("table-column");
|
|
1807
|
-
const
|
|
1818
|
+
const n = be(), e = O(`column_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`), o = ye("x-table"), a = $(() => ({
|
|
1808
1819
|
prop: r.prop || e.value,
|
|
1809
1820
|
label: r.label,
|
|
1810
1821
|
width: r.width,
|
|
@@ -1815,14 +1826,14 @@ const on = /* @__PURE__ */ Z({
|
|
|
1815
1826
|
formatter: r.formatter
|
|
1816
1827
|
}));
|
|
1817
1828
|
return pe(() => {
|
|
1818
|
-
o != null && o.registerColumn && o.registerColumn(
|
|
1819
|
-
}), se(() =>
|
|
1829
|
+
o != null && o.registerColumn && o.registerColumn(a.value, n.default);
|
|
1830
|
+
}), se(() => n.default, (t) => {
|
|
1820
1831
|
o != null && o.updateColumnSlot && t && o.updateColumnSlot(r.prop || e.value, t);
|
|
1821
|
-
}, { immediate: !0 }),
|
|
1832
|
+
}, { immediate: !0 }), Me(() => {
|
|
1822
1833
|
o != null && o.unregisterColumn && o.unregisterColumn(r.prop || e.value);
|
|
1823
1834
|
}), (t, l) => null;
|
|
1824
1835
|
}
|
|
1825
|
-
}),
|
|
1836
|
+
}), St = { key: 0 }, Et = ["onClick"], Nt = { class: "sort-arrow up" }, Kt = { class: "sort-arrow down" }, Ht = ["onClick"], Vt = { key: 0 }, Rt = ["colspan"], Pt = { style: { display: "none" } }, vn = /* @__PURE__ */ Z({
|
|
1826
1837
|
name: "XTreeTable",
|
|
1827
1838
|
__name: "index",
|
|
1828
1839
|
props: {
|
|
@@ -1841,95 +1852,95 @@ const on = /* @__PURE__ */ Z({
|
|
|
1841
1852
|
collapseIcon: {}
|
|
1842
1853
|
},
|
|
1843
1854
|
emits: ["row-click", "cell-click", "expand-change", "sort-change"],
|
|
1844
|
-
setup(s, { expose: r, emit:
|
|
1845
|
-
const e = s, o =
|
|
1846
|
-
|
|
1847
|
-
registerColumn: (
|
|
1848
|
-
const
|
|
1849
|
-
|
|
1855
|
+
setup(s, { expose: r, emit: n }) {
|
|
1856
|
+
const e = s, o = n, a = J("tree-table"), t = O(/* @__PURE__ */ new Set()), l = O([]), c = O({});
|
|
1857
|
+
me("x-tree-table", {
|
|
1858
|
+
registerColumn: (m, L) => {
|
|
1859
|
+
const f = l.value.findIndex((i) => i.prop === m.prop);
|
|
1860
|
+
f === -1 ? l.value.push(m) : l.value[f] = m, L && (c.value[m.prop] = L);
|
|
1850
1861
|
},
|
|
1851
|
-
unregisterColumn: (
|
|
1852
|
-
const L = l.value.findIndex((
|
|
1853
|
-
L > -1 && l.value.splice(L, 1), delete
|
|
1862
|
+
unregisterColumn: (m) => {
|
|
1863
|
+
const L = l.value.findIndex((f) => f.prop === m);
|
|
1864
|
+
L > -1 && l.value.splice(L, 1), delete c.value[m];
|
|
1854
1865
|
},
|
|
1855
|
-
updateColumnSlot: (
|
|
1856
|
-
|
|
1866
|
+
updateColumnSlot: (m, L) => {
|
|
1867
|
+
c.value[m] = L;
|
|
1857
1868
|
},
|
|
1858
1869
|
props: e
|
|
1859
1870
|
});
|
|
1860
|
-
const
|
|
1861
|
-
var
|
|
1862
|
-
const L = ((
|
|
1863
|
-
return
|
|
1864
|
-
},
|
|
1865
|
-
var
|
|
1866
|
-
if (S(
|
|
1867
|
-
const
|
|
1868
|
-
return
|
|
1869
|
-
},
|
|
1870
|
-
const L =
|
|
1871
|
+
const C = (m) => typeof e.rowKey == "function" ? e.rowKey(m) : m[e.rowKey || "id"], S = (m) => {
|
|
1872
|
+
var f;
|
|
1873
|
+
const L = ((f = e.treeProps) == null ? void 0 : f.children) || "children";
|
|
1874
|
+
return m[L] || [];
|
|
1875
|
+
}, R = (m) => {
|
|
1876
|
+
var i;
|
|
1877
|
+
if (S(m).length > 0) return !0;
|
|
1878
|
+
const f = ((i = e.treeProps) == null ? void 0 : i.hasChildren) || "hasChildren";
|
|
1879
|
+
return m[f] === !0;
|
|
1880
|
+
}, V = (m) => {
|
|
1881
|
+
const L = C(m);
|
|
1871
1882
|
return t.value.has(L);
|
|
1872
|
-
}, _ = (
|
|
1873
|
-
const L =
|
|
1874
|
-
|
|
1883
|
+
}, _ = (m) => {
|
|
1884
|
+
const L = C(m), f = !t.value.has(L);
|
|
1885
|
+
f ? t.value.add(L) : t.value.delete(L), o("expand-change", m, f);
|
|
1875
1886
|
}, E = () => {
|
|
1876
|
-
const
|
|
1877
|
-
L.forEach((
|
|
1878
|
-
|
|
1887
|
+
const m = (L) => {
|
|
1888
|
+
L.forEach((f) => {
|
|
1889
|
+
R(f) && (t.value.add(C(f)), m(S(f)));
|
|
1879
1890
|
});
|
|
1880
1891
|
};
|
|
1881
|
-
|
|
1892
|
+
m(e.data);
|
|
1882
1893
|
}, B = () => {
|
|
1883
1894
|
t.value.clear();
|
|
1884
|
-
},
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
const h =
|
|
1888
|
-
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1895
|
+
}, N = $(() => {
|
|
1896
|
+
const m = [], L = (f, i = 0, d = !0) => {
|
|
1897
|
+
f.forEach((g) => {
|
|
1898
|
+
const h = C(g), T = t.value.has(h), H = d;
|
|
1899
|
+
m.push({ row: g, level: i, visible: H });
|
|
1900
|
+
const P = S(g);
|
|
1901
|
+
P.length > 0 && T && L(P, i + 1, H);
|
|
1891
1902
|
});
|
|
1892
1903
|
};
|
|
1893
|
-
return L(e.data),
|
|
1894
|
-
}),
|
|
1904
|
+
return L(e.data), m;
|
|
1905
|
+
}), K = O({
|
|
1895
1906
|
prop: "",
|
|
1896
1907
|
order: null
|
|
1897
1908
|
}), Y = $(() => {
|
|
1898
|
-
if (!
|
|
1899
|
-
return
|
|
1900
|
-
const { prop:
|
|
1901
|
-
return [...
|
|
1902
|
-
const
|
|
1903
|
-
if (
|
|
1904
|
-
const h =
|
|
1909
|
+
if (!K.value.prop || !K.value.order)
|
|
1910
|
+
return N.value;
|
|
1911
|
+
const { prop: m, order: L } = K.value;
|
|
1912
|
+
return [...N.value].sort((f, i) => {
|
|
1913
|
+
const d = f.row[m], g = i.row[m];
|
|
1914
|
+
if (d === g) return 0;
|
|
1915
|
+
const h = d > g ? 1 : -1;
|
|
1905
1916
|
return L === "ascending" ? h : -h;
|
|
1906
1917
|
});
|
|
1907
|
-
}),
|
|
1908
|
-
|
|
1909
|
-
}, v = (
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
] : "", b = (
|
|
1913
|
-
const
|
|
1914
|
-
return L.formatter ? L.formatter(
|
|
1915
|
-
}, y = (
|
|
1918
|
+
}), q = (m) => {
|
|
1919
|
+
m.sortable && (K.value.prop === m.prop ? K.value.order === "ascending" ? K.value.order = "descending" : K.value.order === "descending" && (K.value.order = null, K.value.prop = "") : (K.value.prop = m.prop, K.value.order = "ascending"), o("sort-change", { ...K.value }));
|
|
1920
|
+
}, v = (m) => m.sortable ? K.value.prop !== m.prop ? a.is("sortable") : [
|
|
1921
|
+
a.is("sortable"),
|
|
1922
|
+
a.is(`sort-${K.value.order}`)
|
|
1923
|
+
] : "", b = (m, L, f) => {
|
|
1924
|
+
const i = m[L.prop];
|
|
1925
|
+
return L.formatter ? L.formatter(m, L, i, f) : i ?? "";
|
|
1926
|
+
}, y = (m) => {
|
|
1916
1927
|
const L = {};
|
|
1917
|
-
return
|
|
1928
|
+
return m.width && (L.width = typeof m.width == "number" ? `${m.width}px` : m.width), m.minWidth && (L.minWidth = typeof m.minWidth == "number" ? `${m.minWidth}px` : m.minWidth), m.align && (L.textAlign = m.align), L;
|
|
1918
1929
|
}, D = $(() => [
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1930
|
+
a.b(),
|
|
1931
|
+
a.is("border", e.border),
|
|
1932
|
+
a.is("stripe", e.stripe),
|
|
1933
|
+
a.is("loading", e.loading)
|
|
1923
1934
|
]), I = () => {
|
|
1924
|
-
var
|
|
1925
|
-
e.defaultExpandAll ? E() : (
|
|
1935
|
+
var m;
|
|
1936
|
+
e.defaultExpandAll ? E() : (m = e.defaultExpandedKeys) != null && m.length && e.defaultExpandedKeys.forEach((L) => {
|
|
1926
1937
|
t.value.add(L);
|
|
1927
1938
|
});
|
|
1928
1939
|
};
|
|
1929
1940
|
return se(() => e.data, () => {
|
|
1930
1941
|
I();
|
|
1931
|
-
}, { immediate: !0 }), se(() => e.defaultExpandedKeys, (
|
|
1932
|
-
|
|
1942
|
+
}, { immediate: !0 }), se(() => e.defaultExpandedKeys, (m) => {
|
|
1943
|
+
m != null && m.length && !e.defaultExpandAll && (t.value.clear(), m.forEach((L) => {
|
|
1933
1944
|
t.value.add(L);
|
|
1934
1945
|
}));
|
|
1935
1946
|
}, { immediate: !0 }), r({
|
|
@@ -1938,114 +1949,114 @@ const on = /* @__PURE__ */ Z({
|
|
|
1938
1949
|
toggleExpand: _,
|
|
1939
1950
|
expandedKeys: t,
|
|
1940
1951
|
columns: l
|
|
1941
|
-
}), (
|
|
1952
|
+
}), (m, L) => (M(), w("div", {
|
|
1942
1953
|
class: p(D.value)
|
|
1943
1954
|
}, [
|
|
1944
|
-
s.loading ? (M(),
|
|
1955
|
+
s.loading ? (M(), w("div", {
|
|
1945
1956
|
key: 0,
|
|
1946
|
-
class: p(
|
|
1957
|
+
class: p(u(a).e("loading"))
|
|
1947
1958
|
}, [...L[0] || (L[0] = [
|
|
1948
1959
|
A("span", { class: "loading-spinner" }, null, -1),
|
|
1949
1960
|
A("span", { class: "loading-text" }, "加载中...", -1)
|
|
1950
1961
|
])], 2)) : j("", !0),
|
|
1951
1962
|
A("div", {
|
|
1952
|
-
class: p(
|
|
1963
|
+
class: p(u(a).e("wrapper"))
|
|
1953
1964
|
}, [
|
|
1954
1965
|
A("table", null, [
|
|
1955
|
-
s.showHeader ? (M(),
|
|
1966
|
+
s.showHeader ? (M(), w("thead", St, [
|
|
1956
1967
|
A("tr", null, [
|
|
1957
|
-
(M(!0),
|
|
1958
|
-
key:
|
|
1959
|
-
class: p([
|
|
1960
|
-
style:
|
|
1961
|
-
onClick: (
|
|
1968
|
+
(M(!0), w(te, null, re(l.value, (f) => (M(), w("th", {
|
|
1969
|
+
key: f.prop,
|
|
1970
|
+
class: p([u(a).e("header-cell"), v(f)]),
|
|
1971
|
+
style: U(y(f)),
|
|
1972
|
+
onClick: (i) => q(f)
|
|
1962
1973
|
}, [
|
|
1963
|
-
A("span", null,
|
|
1964
|
-
|
|
1974
|
+
A("span", null, X(f.label), 1),
|
|
1975
|
+
f.sortable ? (M(), w("span", {
|
|
1965
1976
|
key: 0,
|
|
1966
|
-
class: p(
|
|
1977
|
+
class: p(u(a).e("sort-icon"))
|
|
1967
1978
|
}, [
|
|
1968
|
-
A("span",
|
|
1969
|
-
|
|
1979
|
+
A("span", Nt, [
|
|
1980
|
+
le(u(ne), {
|
|
1970
1981
|
name: "sort-up",
|
|
1971
1982
|
size: 12
|
|
1972
1983
|
})
|
|
1973
1984
|
]),
|
|
1974
|
-
A("span",
|
|
1975
|
-
|
|
1985
|
+
A("span", Kt, [
|
|
1986
|
+
le(u(ne), {
|
|
1976
1987
|
name: "sort-down",
|
|
1977
1988
|
size: 12
|
|
1978
1989
|
})
|
|
1979
1990
|
])
|
|
1980
1991
|
], 2)) : j("", !0)
|
|
1981
|
-
], 14,
|
|
1992
|
+
], 14, Et))), 128))
|
|
1982
1993
|
])
|
|
1983
1994
|
])) : j("", !0),
|
|
1984
1995
|
A("tbody", null, [
|
|
1985
|
-
(M(!0),
|
|
1986
|
-
key:
|
|
1996
|
+
(M(!0), w(te, null, re(Y.value, (f, i) => (M(), w(te, {
|
|
1997
|
+
key: C(f.row)
|
|
1987
1998
|
}, [
|
|
1988
|
-
|
|
1999
|
+
f.visible ? (M(), w("tr", {
|
|
1989
2000
|
key: 0,
|
|
1990
|
-
class: p([
|
|
2001
|
+
class: p([u(a).e("row"), u(a).is("level-" + f.level)])
|
|
1991
2002
|
}, [
|
|
1992
|
-
(M(!0),
|
|
1993
|
-
key:
|
|
1994
|
-
class: p(
|
|
1995
|
-
style:
|
|
2003
|
+
(M(!0), w(te, null, re(l.value, (d, g) => (M(), w("td", {
|
|
2004
|
+
key: d.prop,
|
|
2005
|
+
class: p(u(a).e("cell")),
|
|
2006
|
+
style: U(y(d))
|
|
1996
2007
|
}, [
|
|
1997
|
-
|
|
2008
|
+
g === 0 ? (M(), w("div", {
|
|
1998
2009
|
key: 0,
|
|
1999
|
-
class: p(
|
|
2010
|
+
class: p(u(a).e("cell-content"))
|
|
2000
2011
|
}, [
|
|
2001
2012
|
A("span", {
|
|
2002
|
-
class: p(
|
|
2003
|
-
style:
|
|
2013
|
+
class: p(u(a).e("indent")),
|
|
2014
|
+
style: U({ width: `${f.level * s.indent}px` })
|
|
2004
2015
|
}, null, 6),
|
|
2005
|
-
|
|
2016
|
+
R(f.row) ? (M(), w("span", {
|
|
2006
2017
|
key: 0,
|
|
2007
|
-
class: p([
|
|
2008
|
-
onClick:
|
|
2018
|
+
class: p([u(a).e("expand-icon"), u(a).is("expanded", V(f.row))]),
|
|
2019
|
+
onClick: ue((h) => _(f.row), ["stop"])
|
|
2009
2020
|
}, [
|
|
2010
|
-
|
|
2021
|
+
V(f.row) ? (M(), ce(u(ne), {
|
|
2011
2022
|
key: 0,
|
|
2012
2023
|
name: "chevron-down",
|
|
2013
2024
|
size: 14
|
|
2014
|
-
})) : (M(),
|
|
2025
|
+
})) : (M(), ce(u(ne), {
|
|
2015
2026
|
key: 1,
|
|
2016
2027
|
name: "chevron-right",
|
|
2017
2028
|
size: 14
|
|
2018
2029
|
}))
|
|
2019
|
-
], 10,
|
|
2030
|
+
], 10, Ht)) : (M(), w("span", {
|
|
2020
2031
|
key: 1,
|
|
2021
|
-
class: p(
|
|
2032
|
+
class: p(u(a).e("expand-placeholder"))
|
|
2022
2033
|
}, null, 2)),
|
|
2023
2034
|
A("span", null, [
|
|
2024
|
-
|
|
2025
|
-
|
|
2035
|
+
c.value[d.prop] ? (M(), ce(xe(() => c.value[d.prop]({ row: f.row, column: d, $index: i })), { key: 0 })) : (M(), w(te, { key: 1 }, [
|
|
2036
|
+
oe(X(b(f.row, d, i)), 1)
|
|
2026
2037
|
], 64))
|
|
2027
2038
|
])
|
|
2028
|
-
], 2)) :
|
|
2029
|
-
|
|
2039
|
+
], 2)) : c.value[d.prop] ? (M(), ce(xe(() => c.value[d.prop]({ row: f.row, column: d, $index: i })), { key: 1 })) : (M(), w(te, { key: 2 }, [
|
|
2040
|
+
oe(X(b(f.row, d, i)), 1)
|
|
2030
2041
|
], 64))
|
|
2031
2042
|
], 6))), 128))
|
|
2032
2043
|
], 2)) : j("", !0)
|
|
2033
2044
|
], 64))), 128)),
|
|
2034
|
-
Y.value.length === 0 && !s.loading ? (M(),
|
|
2045
|
+
Y.value.length === 0 && !s.loading ? (M(), w("tr", Vt, [
|
|
2035
2046
|
A("td", {
|
|
2036
2047
|
colspan: l.value.length || 1,
|
|
2037
|
-
class: p(
|
|
2048
|
+
class: p(u(a).e("empty"))
|
|
2038
2049
|
}, [
|
|
2039
|
-
|
|
2040
|
-
|
|
2050
|
+
F(m.$slots, "empty", {}, () => [
|
|
2051
|
+
oe(X(s.emptyText), 1)
|
|
2041
2052
|
])
|
|
2042
|
-
], 10,
|
|
2053
|
+
], 10, Rt)
|
|
2043
2054
|
])) : j("", !0)
|
|
2044
2055
|
])
|
|
2045
2056
|
])
|
|
2046
2057
|
], 2),
|
|
2047
2058
|
A("div", Pt, [
|
|
2048
|
-
|
|
2059
|
+
F(m.$slots, "default")
|
|
2049
2060
|
])
|
|
2050
2061
|
], 2));
|
|
2051
2062
|
}
|
|
@@ -2065,7 +2076,7 @@ const on = /* @__PURE__ */ Z({
|
|
|
2065
2076
|
setup(s) {
|
|
2066
2077
|
const r = s;
|
|
2067
2078
|
J("tree-table-column");
|
|
2068
|
-
const
|
|
2079
|
+
const n = be(), e = ye("x-tree-table"), o = $(() => ({
|
|
2069
2080
|
prop: r.prop,
|
|
2070
2081
|
label: r.label,
|
|
2071
2082
|
width: r.width,
|
|
@@ -2076,14 +2087,14 @@ const on = /* @__PURE__ */ Z({
|
|
|
2076
2087
|
formatter: r.formatter
|
|
2077
2088
|
}));
|
|
2078
2089
|
return pe(() => {
|
|
2079
|
-
e != null && e.registerColumn && e.registerColumn(o.value,
|
|
2080
|
-
}), se(() =>
|
|
2081
|
-
e != null && e.updateColumnSlot &&
|
|
2082
|
-
}, { immediate: !0 }),
|
|
2090
|
+
e != null && e.registerColumn && e.registerColumn(o.value, n.default);
|
|
2091
|
+
}), se(() => n.default, (a) => {
|
|
2092
|
+
e != null && e.updateColumnSlot && a && e.updateColumnSlot(r.prop, a);
|
|
2093
|
+
}, { immediate: !0 }), Me(() => {
|
|
2083
2094
|
e != null && e.unregisterColumn && e.unregisterColumn(r.prop);
|
|
2084
|
-
}), (
|
|
2095
|
+
}), (a, t) => null;
|
|
2085
2096
|
}
|
|
2086
|
-
}),
|
|
2097
|
+
}), jt = ["src", "alt"], gn = /* @__PURE__ */ Z({
|
|
2087
2098
|
name: "XAvatar",
|
|
2088
2099
|
__name: "index",
|
|
2089
2100
|
props: {
|
|
@@ -2096,34 +2107,34 @@ const on = /* @__PURE__ */ Z({
|
|
|
2096
2107
|
},
|
|
2097
2108
|
emits: ["error"],
|
|
2098
2109
|
setup(s, { emit: r }) {
|
|
2099
|
-
const
|
|
2110
|
+
const n = s, e = r, o = J("avatar"), a = $(() => [
|
|
2100
2111
|
o.b(),
|
|
2101
|
-
o.m(
|
|
2102
|
-
typeof
|
|
2112
|
+
o.m(n.shape),
|
|
2113
|
+
typeof n.size == "string" ? o.m(n.size) : ""
|
|
2103
2114
|
]), t = $(() => {
|
|
2104
|
-
const
|
|
2105
|
-
return typeof
|
|
2106
|
-
}), l = (
|
|
2107
|
-
e("error",
|
|
2115
|
+
const c = {};
|
|
2116
|
+
return typeof n.size == "number" && (c.width = `${n.size}px`, c.height = `${n.size}px`, c.lineHeight = `${n.size}px`), c;
|
|
2117
|
+
}), l = (c) => {
|
|
2118
|
+
e("error", c);
|
|
2108
2119
|
};
|
|
2109
|
-
return (
|
|
2110
|
-
class: p(
|
|
2111
|
-
style:
|
|
2120
|
+
return (c, z) => (M(), w("span", {
|
|
2121
|
+
class: p(a.value),
|
|
2122
|
+
style: U(t.value)
|
|
2112
2123
|
}, [
|
|
2113
|
-
s.src ? (M(),
|
|
2124
|
+
s.src ? (M(), w("img", {
|
|
2114
2125
|
key: 0,
|
|
2115
2126
|
src: s.src,
|
|
2116
2127
|
alt: s.alt,
|
|
2117
|
-
style:
|
|
2128
|
+
style: U({ objectFit: s.fit }),
|
|
2118
2129
|
onError: l
|
|
2119
|
-
}, null, 44,
|
|
2130
|
+
}, null, 44, jt)) : s.icon ? (M(), w("span", {
|
|
2120
2131
|
key: 1,
|
|
2121
|
-
class: p(
|
|
2122
|
-
},
|
|
2132
|
+
class: p(u(o).e("icon"))
|
|
2133
|
+
}, X(s.icon), 3)) : (M(), w("span", {
|
|
2123
2134
|
key: 2,
|
|
2124
|
-
class: p(
|
|
2135
|
+
class: p(u(o).e("default"))
|
|
2125
2136
|
}, [
|
|
2126
|
-
|
|
2137
|
+
F(c.$slots, "default")
|
|
2127
2138
|
], 2))
|
|
2128
2139
|
], 6));
|
|
2129
2140
|
}
|
|
@@ -2141,35 +2152,35 @@ const on = /* @__PURE__ */ Z({
|
|
|
2141
2152
|
colon: { type: Boolean, default: !0 }
|
|
2142
2153
|
},
|
|
2143
2154
|
setup(s) {
|
|
2144
|
-
const r = s,
|
|
2145
|
-
|
|
2155
|
+
const r = s, n = J("descriptions");
|
|
2156
|
+
me("x-descriptions", {
|
|
2146
2157
|
props: r,
|
|
2147
2158
|
column: $(() => r.column)
|
|
2148
2159
|
});
|
|
2149
2160
|
const e = $(() => [
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2161
|
+
n.b(),
|
|
2162
|
+
n.m(r.size),
|
|
2163
|
+
n.is("bordered", r.border)
|
|
2153
2164
|
]);
|
|
2154
|
-
return (o,
|
|
2165
|
+
return (o, a) => (M(), w("div", {
|
|
2155
2166
|
class: p(e.value)
|
|
2156
2167
|
}, [
|
|
2157
|
-
s.title ? (M(),
|
|
2168
|
+
s.title ? (M(), w("div", {
|
|
2158
2169
|
key: 0,
|
|
2159
|
-
class: p(
|
|
2160
|
-
},
|
|
2170
|
+
class: p(u(n).e("title"))
|
|
2171
|
+
}, X(s.title), 3)) : j("", !0),
|
|
2161
2172
|
A("div", {
|
|
2162
|
-
class: p(
|
|
2173
|
+
class: p(u(n).e("body"))
|
|
2163
2174
|
}, [
|
|
2164
2175
|
A("table", null, [
|
|
2165
2176
|
A("tbody", null, [
|
|
2166
|
-
|
|
2177
|
+
F(o.$slots, "default")
|
|
2167
2178
|
])
|
|
2168
2179
|
])
|
|
2169
2180
|
], 2)
|
|
2170
2181
|
], 2));
|
|
2171
2182
|
}
|
|
2172
|
-
}),
|
|
2183
|
+
}), Ot = ["colspan"], yn = /* @__PURE__ */ Z({
|
|
2173
2184
|
name: "XDescriptionsItem",
|
|
2174
2185
|
__name: "DescriptionsItem",
|
|
2175
2186
|
props: {
|
|
@@ -2179,36 +2190,36 @@ const on = /* @__PURE__ */ Z({
|
|
|
2179
2190
|
contentAlign: {}
|
|
2180
2191
|
},
|
|
2181
2192
|
setup(s) {
|
|
2182
|
-
const r = s,
|
|
2183
|
-
var
|
|
2184
|
-
const
|
|
2185
|
-
return
|
|
2186
|
-
}),
|
|
2187
|
-
var
|
|
2188
|
-
return r.labelAlign || ((
|
|
2193
|
+
const r = s, n = J("descriptions-item"), e = ye("x-descriptions"), o = $(() => {
|
|
2194
|
+
var k;
|
|
2195
|
+
const c = {}, z = (k = e == null ? void 0 : e.props) == null ? void 0 : k.labelWidth;
|
|
2196
|
+
return z && (c.width = typeof z == "number" ? `${z}px` : z), c;
|
|
2197
|
+
}), a = $(() => {
|
|
2198
|
+
var c;
|
|
2199
|
+
return r.labelAlign || ((c = e == null ? void 0 : e.props) == null ? void 0 : c.labelAlign) || "right";
|
|
2189
2200
|
}), t = $(() => {
|
|
2190
|
-
var
|
|
2191
|
-
return r.contentAlign || ((
|
|
2201
|
+
var c;
|
|
2202
|
+
return r.contentAlign || ((c = e == null ? void 0 : e.props) == null ? void 0 : c.contentAlign) || "left";
|
|
2192
2203
|
}), l = $(() => {
|
|
2193
|
-
var
|
|
2194
|
-
return ((
|
|
2204
|
+
var c;
|
|
2205
|
+
return ((c = e == null ? void 0 : e.props) == null ? void 0 : c.colon) ?? !0;
|
|
2195
2206
|
});
|
|
2196
2207
|
return $(() => {
|
|
2197
|
-
var
|
|
2198
|
-
return ((
|
|
2199
|
-
}), (
|
|
2200
|
-
class: p(
|
|
2208
|
+
var c;
|
|
2209
|
+
return ((c = e == null ? void 0 : e.props) == null ? void 0 : c.border) ?? !1;
|
|
2210
|
+
}), (c, z) => (M(), w("tr", {
|
|
2211
|
+
class: p(u(n).b())
|
|
2201
2212
|
}, [
|
|
2202
2213
|
A("th", {
|
|
2203
|
-
class: p([
|
|
2204
|
-
style:
|
|
2205
|
-
},
|
|
2214
|
+
class: p([u(n).e("label"), `is-${a.value}`]),
|
|
2215
|
+
style: U(o.value)
|
|
2216
|
+
}, X(s.label) + X(l.value ? ":" : ""), 7),
|
|
2206
2217
|
A("td", {
|
|
2207
|
-
class: p([
|
|
2218
|
+
class: p([u(n).e("content"), `is-${t.value}`]),
|
|
2208
2219
|
colspan: s.span * 2 - 1
|
|
2209
2220
|
}, [
|
|
2210
|
-
|
|
2211
|
-
], 10,
|
|
2221
|
+
F(c.$slots, "default")
|
|
2222
|
+
], 10, Ot)
|
|
2212
2223
|
], 2));
|
|
2213
2224
|
}
|
|
2214
2225
|
}), Mn = /* @__PURE__ */ Z({
|
|
@@ -2228,67 +2239,67 @@ const on = /* @__PURE__ */ Z({
|
|
|
2228
2239
|
minSize: { default: 20 }
|
|
2229
2240
|
},
|
|
2230
2241
|
emits: ["scroll"],
|
|
2231
|
-
setup(s, { expose: r, emit:
|
|
2232
|
-
const e = s, o =
|
|
2233
|
-
const
|
|
2234
|
-
return e.height && (
|
|
2242
|
+
setup(s, { expose: r, emit: n }) {
|
|
2243
|
+
const e = s, o = n, a = J("scrollbar"), t = O(), l = O(), c = O("0"), z = O("0"), k = O(0), x = O(0), C = $(() => {
|
|
2244
|
+
const N = {};
|
|
2245
|
+
return e.height && (N.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (N.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), N;
|
|
2235
2246
|
}), S = () => {
|
|
2236
2247
|
if (!t.value) return;
|
|
2237
|
-
const
|
|
2238
|
-
|
|
2239
|
-
},
|
|
2248
|
+
const N = t.value.offsetHeight - 4, K = t.value.offsetWidth - 4, Y = t.value.scrollHeight, q = t.value.scrollWidth, v = N / Y, b = K / q;
|
|
2249
|
+
z.value = v >= 1 ? "0" : `${N * v}px`, c.value = b >= 1 ? "0" : `${K * b}px`;
|
|
2250
|
+
}, R = (N) => {
|
|
2240
2251
|
if (!t.value) return;
|
|
2241
|
-
const
|
|
2242
|
-
|
|
2243
|
-
},
|
|
2244
|
-
var
|
|
2245
|
-
(
|
|
2246
|
-
}, _ = (
|
|
2247
|
-
t.value && (t.value.scrollTop =
|
|
2248
|
-
}, E = (
|
|
2249
|
-
t.value && (t.value.scrollLeft =
|
|
2252
|
+
const K = t.value.offsetHeight, Y = t.value.offsetWidth;
|
|
2253
|
+
x.value = t.value.scrollTop * 100 / K, k.value = t.value.scrollLeft * 100 / Y, o("scroll", N);
|
|
2254
|
+
}, V = (N) => {
|
|
2255
|
+
var K;
|
|
2256
|
+
(K = t.value) == null || K.scrollTo(N);
|
|
2257
|
+
}, _ = (N) => {
|
|
2258
|
+
t.value && (t.value.scrollTop = N);
|
|
2259
|
+
}, E = (N) => {
|
|
2260
|
+
t.value && (t.value.scrollLeft = N);
|
|
2250
2261
|
};
|
|
2251
2262
|
let B = null;
|
|
2252
2263
|
return pe(() => {
|
|
2253
2264
|
e.native || (Ee(S), e.noresize || (B = new ResizeObserver(S), l.value && B.observe(l.value), window.addEventListener("resize", S)));
|
|
2254
|
-
}),
|
|
2265
|
+
}), Me(() => {
|
|
2255
2266
|
B && B.disconnect(), window.removeEventListener("resize", S);
|
|
2256
2267
|
}), r({
|
|
2257
|
-
scrollTo:
|
|
2268
|
+
scrollTo: V,
|
|
2258
2269
|
setScrollTop: _,
|
|
2259
2270
|
setScrollLeft: E,
|
|
2260
2271
|
update: S
|
|
2261
|
-
}), (
|
|
2262
|
-
class: p(
|
|
2272
|
+
}), (N, K) => (M(), w("div", {
|
|
2273
|
+
class: p(u(a).b())
|
|
2263
2274
|
}, [
|
|
2264
2275
|
A("div", {
|
|
2265
2276
|
ref_key: "wrapRef",
|
|
2266
2277
|
ref: t,
|
|
2267
|
-
class: p([
|
|
2268
|
-
style:
|
|
2269
|
-
onScroll:
|
|
2278
|
+
class: p([u(a).e("wrap"), s.wrapClass, { [u(a).em("wrap", "hidden-default")]: !s.native }]),
|
|
2279
|
+
style: U([C.value, { overflow: s.native ? "auto" : "hidden" }]),
|
|
2280
|
+
onScroll: R
|
|
2270
2281
|
}, [
|
|
2271
|
-
(M(),
|
|
2282
|
+
(M(), ce(xe(s.tag), {
|
|
2272
2283
|
ref_key: "resizeRef",
|
|
2273
2284
|
ref: l,
|
|
2274
|
-
class: p([
|
|
2275
|
-
style:
|
|
2285
|
+
class: p([u(a).e("view"), s.viewClass]),
|
|
2286
|
+
style: U(s.viewStyle)
|
|
2276
2287
|
}, {
|
|
2277
2288
|
default: Ie(() => [
|
|
2278
|
-
|
|
2289
|
+
F(N.$slots, "default")
|
|
2279
2290
|
]),
|
|
2280
2291
|
_: 3
|
|
2281
2292
|
}, 8, ["class", "style"]))
|
|
2282
2293
|
], 38),
|
|
2283
|
-
!s.native &&
|
|
2294
|
+
!s.native && z.value ? (M(), w("div", {
|
|
2284
2295
|
key: 0,
|
|
2285
|
-
class: p([
|
|
2286
|
-
style:
|
|
2296
|
+
class: p([u(a).e("bar"), u(a).is("vertical")]),
|
|
2297
|
+
style: U({ height: z.value, top: `${x.value}%` })
|
|
2287
2298
|
}, null, 6)) : j("", !0),
|
|
2288
|
-
!s.native &&
|
|
2299
|
+
!s.native && c.value ? (M(), w("div", {
|
|
2289
2300
|
key: 1,
|
|
2290
|
-
class: p([
|
|
2291
|
-
style:
|
|
2301
|
+
class: p([u(a).e("bar"), u(a).is("horizontal")]),
|
|
2302
|
+
style: U({ width: c.value, left: `${k.value}%` })
|
|
2292
2303
|
}, null, 6)) : j("", !0)
|
|
2293
2304
|
], 2));
|
|
2294
2305
|
}
|
|
@@ -2301,24 +2312,24 @@ const on = /* @__PURE__ */ Z({
|
|
|
2301
2312
|
},
|
|
2302
2313
|
emits: ["update:modelValue", "change"],
|
|
2303
2314
|
setup(s, { emit: r }) {
|
|
2304
|
-
const
|
|
2305
|
-
return se(() =>
|
|
2306
|
-
Array.isArray(l) ?
|
|
2307
|
-
}, { immediate: !0 }),
|
|
2308
|
-
activeNames:
|
|
2315
|
+
const n = s, e = r, o = J("collapse"), a = O([]);
|
|
2316
|
+
return se(() => n.modelValue, (l) => {
|
|
2317
|
+
Array.isArray(l) ? a.value = l : l ? a.value = [l] : a.value = [];
|
|
2318
|
+
}, { immediate: !0 }), me("collapse", {
|
|
2319
|
+
activeNames: a,
|
|
2309
2320
|
handleItemClick: (l) => {
|
|
2310
|
-
if (
|
|
2311
|
-
const
|
|
2312
|
-
|
|
2321
|
+
if (n.accordion) {
|
|
2322
|
+
const c = a.value.includes(l) ? "" : l;
|
|
2323
|
+
a.value = c ? [c] : [], e("update:modelValue", c), e("change", c);
|
|
2313
2324
|
} else {
|
|
2314
|
-
const
|
|
2315
|
-
|
|
2325
|
+
const c = a.value.indexOf(l);
|
|
2326
|
+
c > -1 ? a.value.splice(c, 1) : a.value.push(l), e("update:modelValue", a.value), e("change", a.value);
|
|
2316
2327
|
}
|
|
2317
2328
|
}
|
|
2318
|
-
}), (l,
|
|
2319
|
-
class: p(
|
|
2329
|
+
}), (l, c) => (M(), w("div", {
|
|
2330
|
+
class: p(u(o).b())
|
|
2320
2331
|
}, [
|
|
2321
|
-
|
|
2332
|
+
F(l.$slots, "default")
|
|
2322
2333
|
], 2));
|
|
2323
2334
|
}
|
|
2324
2335
|
}), wn = /* @__PURE__ */ Z({
|
|
@@ -2330,42 +2341,42 @@ const on = /* @__PURE__ */ Z({
|
|
|
2330
2341
|
disabled: { type: Boolean }
|
|
2331
2342
|
},
|
|
2332
2343
|
setup(s) {
|
|
2333
|
-
const r = s,
|
|
2334
|
-
r.disabled ||
|
|
2344
|
+
const r = s, n = J("collapse-item"), e = ye("collapse"), { activeNames: o, handleItemClick: a } = e, t = $(() => o.value.includes(r.name)), l = () => {
|
|
2345
|
+
r.disabled || a(r.name);
|
|
2335
2346
|
};
|
|
2336
|
-
return (
|
|
2337
|
-
class: p([
|
|
2347
|
+
return (c, z) => (M(), w("div", {
|
|
2348
|
+
class: p([u(n).b(), u(n).is("active", t.value), u(n).is("disabled", s.disabled)])
|
|
2338
2349
|
}, [
|
|
2339
2350
|
A("div", {
|
|
2340
|
-
class: p(
|
|
2351
|
+
class: p(u(n).e("header")),
|
|
2341
2352
|
onClick: l
|
|
2342
2353
|
}, [
|
|
2343
2354
|
A("span", {
|
|
2344
|
-
class: p(
|
|
2355
|
+
class: p(u(n).e("arrow"))
|
|
2345
2356
|
}, [
|
|
2346
|
-
|
|
2357
|
+
le(u(ne), {
|
|
2347
2358
|
name: "right",
|
|
2348
2359
|
size: 12
|
|
2349
2360
|
})
|
|
2350
2361
|
], 2),
|
|
2351
|
-
|
|
2352
|
-
|
|
2362
|
+
F(c.$slots, "title", {}, () => [
|
|
2363
|
+
oe(X(s.title), 1)
|
|
2353
2364
|
])
|
|
2354
2365
|
], 2),
|
|
2355
2366
|
ze(A("div", {
|
|
2356
|
-
class: p(
|
|
2367
|
+
class: p(u(n).e("content"))
|
|
2357
2368
|
}, [
|
|
2358
2369
|
A("div", {
|
|
2359
|
-
class: p(
|
|
2370
|
+
class: p(u(n).e("content-box"))
|
|
2360
2371
|
}, [
|
|
2361
|
-
|
|
2372
|
+
F(c.$slots, "default")
|
|
2362
2373
|
], 2)
|
|
2363
2374
|
], 2), [
|
|
2364
2375
|
[$e, t.value]
|
|
2365
2376
|
])
|
|
2366
2377
|
], 2));
|
|
2367
2378
|
}
|
|
2368
|
-
}),
|
|
2379
|
+
}), _t = ["src", "loading"], Wt = ["src"], De = 0.2, Le = 8, xn = /* @__PURE__ */ Z({
|
|
2369
2380
|
name: "XImage",
|
|
2370
2381
|
__name: "index",
|
|
2371
2382
|
props: {
|
|
@@ -2382,130 +2393,139 @@ const on = /* @__PURE__ */ Z({
|
|
|
2382
2393
|
},
|
|
2383
2394
|
emits: ["load", "error"],
|
|
2384
2395
|
setup(s, { emit: r }) {
|
|
2385
|
-
const
|
|
2386
|
-
width: typeof
|
|
2387
|
-
height: typeof
|
|
2388
|
-
objectFit:
|
|
2389
|
-
})),
|
|
2390
|
-
() => `translate(${
|
|
2391
|
-
),
|
|
2392
|
-
|
|
2393
|
-
},
|
|
2394
|
-
|
|
2395
|
-
},
|
|
2396
|
-
|
|
2397
|
-
}, b = () => {
|
|
2398
|
-
a.preview && (i.value = a.initialIndex, Y(), l.value = !0);
|
|
2396
|
+
const n = s, e = r, o = J("image"), a = O(null), t = O(!0), l = O(!1), c = O(!1), z = O(0), k = O(1), x = O(0), C = O(0), S = O(0), R = O(!1), V = O({ x: 0, y: 0 }), _ = O({ x: 0, y: 0 }), E = O(null), B = $(() => ({
|
|
2397
|
+
width: typeof n.width == "number" ? `${n.width}px` : n.width,
|
|
2398
|
+
height: typeof n.height == "number" ? `${n.height}px` : n.height,
|
|
2399
|
+
objectFit: n.fit
|
|
2400
|
+
})), N = $(() => n.previewList.length > 0 ? n.previewList : [n.src]), K = $(() => N.value[z.value]), Y = $(
|
|
2401
|
+
() => `translate(${C.value}px, ${S.value}px) scale(${k.value}) rotate(${x.value}deg)`
|
|
2402
|
+
), q = () => {
|
|
2403
|
+
k.value = 1, x.value = 0, C.value = 0, S.value = 0, R.value = !1;
|
|
2404
|
+
}, v = (Q) => {
|
|
2405
|
+
t.value = !1, l.value = !1, e("load", Q);
|
|
2406
|
+
}, b = (Q) => {
|
|
2407
|
+
t.value = !1, l.value = !0, e("error", Q);
|
|
2399
2408
|
}, y = () => {
|
|
2400
|
-
|
|
2409
|
+
n.preview && (z.value = n.initialIndex, q(), c.value = !0);
|
|
2401
2410
|
}, D = () => {
|
|
2402
|
-
|
|
2411
|
+
c.value = !1, q();
|
|
2403
2412
|
}, I = () => {
|
|
2404
|
-
|
|
2405
|
-
},
|
|
2406
|
-
|
|
2413
|
+
N.value.length <= 1 || (z.value = z.value > 0 ? z.value - 1 : N.value.length - 1);
|
|
2414
|
+
}, m = () => {
|
|
2415
|
+
N.value.length <= 1 || (z.value = z.value < N.value.length - 1 ? z.value + 1 : 0);
|
|
2407
2416
|
}, L = () => {
|
|
2408
|
-
|
|
2409
|
-
}, c = () => Y(), u = () => {
|
|
2410
|
-
const O = _.value;
|
|
2411
|
-
if (!O || !O.naturalWidth) return;
|
|
2412
|
-
const Q = O.getBoundingClientRect();
|
|
2413
|
-
Q.width <= 0 || (C.value = Math.min(Le, Math.max(De, C.value * (O.naturalWidth / Q.width))));
|
|
2417
|
+
k.value = Math.min(Le, k.value * 1.25);
|
|
2414
2418
|
}, f = () => {
|
|
2415
|
-
|
|
2416
|
-
},
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
},
|
|
2422
|
-
|
|
2423
|
-
},
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2419
|
+
k.value = Math.max(De, k.value / 1.25), k.value <= 1 && (C.value = 0, S.value = 0);
|
|
2420
|
+
}, i = () => q(), d = () => {
|
|
2421
|
+
const Q = E.value;
|
|
2422
|
+
if (!Q || !Q.naturalWidth) return;
|
|
2423
|
+
const G = Q.getBoundingClientRect();
|
|
2424
|
+
G.width <= 0 || (k.value = Math.min(Le, Math.max(De, k.value * (Q.naturalWidth / G.width))));
|
|
2425
|
+
}, g = () => {
|
|
2426
|
+
x.value = (x.value + 90) % 360;
|
|
2427
|
+
}, h = () => {
|
|
2428
|
+
const Q = document.createElement("a");
|
|
2429
|
+
Q.href = K.value, Q.download = "", Q.target = "_blank", Q.rel = "noopener", Q.click();
|
|
2430
|
+
}, T = (Q) => {
|
|
2431
|
+
Q.preventDefault(), Q.deltaY < 0 ? L() : f();
|
|
2432
|
+
}, H = (Q) => {
|
|
2433
|
+
k.value <= 1 || (R.value = !0, V.value = { x: Q.clientX, y: Q.clientY }, _.value = { x: C.value, y: S.value });
|
|
2434
|
+
}, P = (Q) => {
|
|
2435
|
+
R.value && (C.value = _.value.x + (Q.clientX - V.value.x), S.value = _.value.y + (Q.clientY - V.value.y));
|
|
2436
|
+
}, W = () => {
|
|
2437
|
+
R.value = !1;
|
|
2438
|
+
}, ee = (Q) => {
|
|
2439
|
+
if (c.value)
|
|
2440
|
+
switch (Q.key) {
|
|
2430
2441
|
case "ArrowLeft":
|
|
2431
|
-
|
|
2442
|
+
I();
|
|
2432
2443
|
break;
|
|
2433
2444
|
case "ArrowRight":
|
|
2434
|
-
|
|
2445
|
+
m();
|
|
2435
2446
|
break;
|
|
2436
2447
|
case "Escape":
|
|
2437
|
-
|
|
2448
|
+
D();
|
|
2438
2449
|
break;
|
|
2439
2450
|
case "+":
|
|
2440
2451
|
case "=":
|
|
2441
|
-
|
|
2452
|
+
L();
|
|
2442
2453
|
break;
|
|
2443
2454
|
case "-":
|
|
2444
|
-
|
|
2455
|
+
f();
|
|
2445
2456
|
break;
|
|
2446
2457
|
case "r":
|
|
2447
2458
|
case "R":
|
|
2448
|
-
|
|
2459
|
+
g();
|
|
2449
2460
|
break;
|
|
2450
2461
|
case "0":
|
|
2451
|
-
|
|
2462
|
+
q();
|
|
2452
2463
|
break;
|
|
2453
2464
|
}
|
|
2454
2465
|
};
|
|
2455
|
-
|
|
2456
|
-
typeof window < "u" && window.removeEventListener("keydown",
|
|
2457
|
-
})
|
|
2458
|
-
|
|
2459
|
-
|
|
2466
|
+
typeof window < "u" && window.addEventListener("keydown", ee), Me(() => {
|
|
2467
|
+
typeof window < "u" && window.removeEventListener("keydown", ee);
|
|
2468
|
+
});
|
|
2469
|
+
const ae = () => {
|
|
2470
|
+
const Q = a.value;
|
|
2471
|
+
!Q || !n.src || !Q.complete || (t.value = !1, l.value = Q.naturalWidth === 0);
|
|
2472
|
+
};
|
|
2473
|
+
return pe(ae), se(() => n.src, () => {
|
|
2474
|
+
t.value = !0, l.value = !1, D(), ae();
|
|
2475
|
+
}, { flush: "post" }), se(z, () => q()), (Q, G) => (M(), w("div", {
|
|
2476
|
+
class: p(u(o).b()),
|
|
2477
|
+
style: U({ width: B.value.width, height: B.value.height })
|
|
2460
2478
|
}, [
|
|
2461
2479
|
A("img", {
|
|
2480
|
+
ref_key: "imageRef",
|
|
2481
|
+
ref: a,
|
|
2462
2482
|
src: s.src,
|
|
2463
|
-
class: p(
|
|
2464
|
-
style:
|
|
2483
|
+
class: p(u(o).e("inner")),
|
|
2484
|
+
style: U(B.value),
|
|
2465
2485
|
loading: s.lazy ? "lazy" : "eager",
|
|
2466
|
-
onLoad:
|
|
2467
|
-
onError:
|
|
2468
|
-
onClick:
|
|
2469
|
-
}, null, 46,
|
|
2470
|
-
|
|
2486
|
+
onLoad: v,
|
|
2487
|
+
onError: b,
|
|
2488
|
+
onClick: y
|
|
2489
|
+
}, null, 46, _t),
|
|
2490
|
+
t.value ? (M(), w("div", {
|
|
2471
2491
|
key: 0,
|
|
2472
|
-
class: p(
|
|
2492
|
+
class: p(u(o).e("placeholder"))
|
|
2473
2493
|
}, [
|
|
2474
|
-
|
|
2475
|
-
|
|
2494
|
+
F(Q.$slots, "placeholder", {}, () => [
|
|
2495
|
+
le(u(ne), {
|
|
2476
2496
|
name: "loading",
|
|
2477
2497
|
size: 24
|
|
2478
2498
|
})
|
|
2479
2499
|
])
|
|
2480
2500
|
], 2)) : j("", !0),
|
|
2481
|
-
|
|
2501
|
+
l.value ? (M(), w("div", {
|
|
2482
2502
|
key: 1,
|
|
2483
|
-
class: p(
|
|
2503
|
+
class: p(u(o).e("error"))
|
|
2484
2504
|
}, [
|
|
2485
|
-
|
|
2486
|
-
|
|
2505
|
+
F(Q.$slots, "error", {}, () => [
|
|
2506
|
+
le(u(ne), {
|
|
2487
2507
|
name: "image",
|
|
2488
2508
|
size: 24
|
|
2489
2509
|
}),
|
|
2490
|
-
|
|
2510
|
+
G[2] || (G[2] = A("span", null, "加载失败", -1))
|
|
2491
2511
|
])
|
|
2492
2512
|
], 2)) : j("", !0),
|
|
2493
|
-
(M(),
|
|
2494
|
-
|
|
2513
|
+
(M(), ce(Oe, { to: "body" }, [
|
|
2514
|
+
c.value ? (M(), w("div", {
|
|
2495
2515
|
key: 0,
|
|
2496
|
-
class: p(
|
|
2497
|
-
onClick:
|
|
2516
|
+
class: p(u(o).e("preview")),
|
|
2517
|
+
onClick: D
|
|
2498
2518
|
}, [
|
|
2499
2519
|
A("div", {
|
|
2500
|
-
class: p(
|
|
2501
|
-
onClick:
|
|
2520
|
+
class: p(u(o).e("preview-toolbar")),
|
|
2521
|
+
onClick: G[0] || (G[0] = ue(() => {
|
|
2502
2522
|
}, ["stop"]))
|
|
2503
2523
|
}, [
|
|
2504
2524
|
A("span", {
|
|
2505
|
-
class: p(
|
|
2525
|
+
class: p(u(o).e("preview-tool")),
|
|
2506
2526
|
title: "放大",
|
|
2507
|
-
onClick:
|
|
2508
|
-
}, [...
|
|
2527
|
+
onClick: L
|
|
2528
|
+
}, [...G[3] || (G[3] = [
|
|
2509
2529
|
A("svg", {
|
|
2510
2530
|
viewBox: "0 0 24 24",
|
|
2511
2531
|
fill: "none",
|
|
@@ -2527,10 +2547,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2527
2547
|
], -1)
|
|
2528
2548
|
])], 2),
|
|
2529
2549
|
A("span", {
|
|
2530
|
-
class: p(
|
|
2550
|
+
class: p(u(o).e("preview-tool")),
|
|
2531
2551
|
title: "缩小",
|
|
2532
|
-
onClick:
|
|
2533
|
-
}, [...
|
|
2552
|
+
onClick: f
|
|
2553
|
+
}, [...G[4] || (G[4] = [
|
|
2534
2554
|
A("svg", {
|
|
2535
2555
|
viewBox: "0 0 24 24",
|
|
2536
2556
|
fill: "none",
|
|
@@ -2552,10 +2572,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2552
2572
|
], -1)
|
|
2553
2573
|
])], 2),
|
|
2554
2574
|
A("span", {
|
|
2555
|
-
class: p(
|
|
2575
|
+
class: p(u(o).e("preview-tool")),
|
|
2556
2576
|
title: "1:1 实际大小",
|
|
2557
|
-
onClick:
|
|
2558
|
-
}, [...
|
|
2577
|
+
onClick: d
|
|
2578
|
+
}, [...G[5] || (G[5] = [
|
|
2559
2579
|
A("svg", {
|
|
2560
2580
|
viewBox: "0 0 24 24",
|
|
2561
2581
|
fill: "none",
|
|
@@ -2572,10 +2592,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2572
2592
|
], -1)
|
|
2573
2593
|
])], 2),
|
|
2574
2594
|
A("span", {
|
|
2575
|
-
class: p(
|
|
2595
|
+
class: p(u(o).e("preview-tool")),
|
|
2576
2596
|
title: "适应窗口",
|
|
2577
|
-
onClick:
|
|
2578
|
-
}, [...
|
|
2597
|
+
onClick: i
|
|
2598
|
+
}, [...G[6] || (G[6] = [
|
|
2579
2599
|
A("svg", {
|
|
2580
2600
|
viewBox: "0 0 24 24",
|
|
2581
2601
|
fill: "none",
|
|
@@ -2592,10 +2612,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2592
2612
|
], -1)
|
|
2593
2613
|
])], 2),
|
|
2594
2614
|
A("span", {
|
|
2595
|
-
class: p(
|
|
2615
|
+
class: p(u(o).e("preview-tool")),
|
|
2596
2616
|
title: "旋转",
|
|
2597
|
-
onClick:
|
|
2598
|
-
}, [...
|
|
2617
|
+
onClick: g
|
|
2618
|
+
}, [...G[7] || (G[7] = [
|
|
2599
2619
|
A("svg", {
|
|
2600
2620
|
viewBox: "0 0 24 24",
|
|
2601
2621
|
fill: "none",
|
|
@@ -2612,10 +2632,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2612
2632
|
], -1)
|
|
2613
2633
|
])], 2),
|
|
2614
2634
|
A("span", {
|
|
2615
|
-
class: p(
|
|
2635
|
+
class: p(u(o).e("preview-tool")),
|
|
2616
2636
|
title: "下载",
|
|
2617
|
-
onClick:
|
|
2618
|
-
}, [...
|
|
2637
|
+
onClick: h
|
|
2638
|
+
}, [...G[8] || (G[8] = [
|
|
2619
2639
|
A("svg", {
|
|
2620
2640
|
viewBox: "0 0 24 24",
|
|
2621
2641
|
fill: "none",
|
|
@@ -2632,10 +2652,10 @@ const on = /* @__PURE__ */ Z({
|
|
|
2632
2652
|
], -1)
|
|
2633
2653
|
])], 2),
|
|
2634
2654
|
A("span", {
|
|
2635
|
-
class: p(
|
|
2655
|
+
class: p(u(o).e("preview-close")),
|
|
2636
2656
|
title: "关闭",
|
|
2637
|
-
onClick:
|
|
2638
|
-
}, [...
|
|
2657
|
+
onClick: ue(D, ["stop"])
|
|
2658
|
+
}, [...G[9] || (G[9] = [
|
|
2639
2659
|
A("svg", {
|
|
2640
2660
|
viewBox: "0 0 24 24",
|
|
2641
2661
|
fill: "none",
|
|
@@ -2654,48 +2674,48 @@ const on = /* @__PURE__ */ Z({
|
|
|
2654
2674
|
], 2),
|
|
2655
2675
|
A("img", {
|
|
2656
2676
|
ref_key: "previewImgRef",
|
|
2657
|
-
ref:
|
|
2677
|
+
ref: E,
|
|
2658
2678
|
src: K.value,
|
|
2659
|
-
class: p([
|
|
2660
|
-
style:
|
|
2679
|
+
class: p([u(o).e("preview-image"), { "is-zoomable": k.value > 1 }]),
|
|
2680
|
+
style: U({ transform: Y.value }),
|
|
2661
2681
|
draggable: !1,
|
|
2662
|
-
onClick:
|
|
2682
|
+
onClick: G[1] || (G[1] = ue(() => {
|
|
2663
2683
|
}, ["stop"])),
|
|
2664
|
-
onWheel:
|
|
2665
|
-
onMousedown:
|
|
2666
|
-
onMousemove:
|
|
2667
|
-
onMouseup:
|
|
2668
|
-
onMouseleave:
|
|
2669
|
-
}, null, 46,
|
|
2670
|
-
|
|
2684
|
+
onWheel: ue(T, ["prevent"]),
|
|
2685
|
+
onMousedown: H,
|
|
2686
|
+
onMousemove: P,
|
|
2687
|
+
onMouseup: W,
|
|
2688
|
+
onMouseleave: W
|
|
2689
|
+
}, null, 46, Wt),
|
|
2690
|
+
N.value.length > 1 ? (M(), w("span", {
|
|
2671
2691
|
key: 0,
|
|
2672
|
-
class: p([
|
|
2673
|
-
onClick:
|
|
2692
|
+
class: p([u(o).e("preview-arrow"), u(o).em("preview-arrow", "left")]),
|
|
2693
|
+
onClick: ue(I, ["stop"])
|
|
2674
2694
|
}, [
|
|
2675
|
-
|
|
2695
|
+
le(u(ne), {
|
|
2676
2696
|
name: "left",
|
|
2677
2697
|
size: 24
|
|
2678
2698
|
})
|
|
2679
2699
|
], 2)) : j("", !0),
|
|
2680
|
-
|
|
2700
|
+
N.value.length > 1 ? (M(), w("span", {
|
|
2681
2701
|
key: 1,
|
|
2682
|
-
class: p([
|
|
2683
|
-
onClick:
|
|
2702
|
+
class: p([u(o).e("preview-arrow"), u(o).em("preview-arrow", "right")]),
|
|
2703
|
+
onClick: ue(m, ["stop"])
|
|
2684
2704
|
}, [
|
|
2685
|
-
|
|
2705
|
+
le(u(ne), {
|
|
2686
2706
|
name: "right",
|
|
2687
2707
|
size: 24
|
|
2688
2708
|
})
|
|
2689
2709
|
], 2)) : j("", !0),
|
|
2690
|
-
|
|
2710
|
+
N.value.length > 1 ? (M(), w("div", {
|
|
2691
2711
|
key: 2,
|
|
2692
|
-
class: p(
|
|
2693
|
-
},
|
|
2712
|
+
class: p(u(o).e("preview-counter"))
|
|
2713
|
+
}, X(z.value + 1) + " / " + X(N.value.length), 3)) : j("", !0)
|
|
2694
2714
|
], 2)) : j("", !0)
|
|
2695
2715
|
]))
|
|
2696
2716
|
], 6));
|
|
2697
2717
|
}
|
|
2698
|
-
}),
|
|
2718
|
+
}), Yt = ["onClick"], bn = /* @__PURE__ */ Z({
|
|
2699
2719
|
name: "XCalendar",
|
|
2700
2720
|
__name: "index",
|
|
2701
2721
|
props: {
|
|
@@ -2704,100 +2724,100 @@ const on = /* @__PURE__ */ Z({
|
|
|
2704
2724
|
},
|
|
2705
2725
|
emits: ["update:modelValue", "select", "change"],
|
|
2706
2726
|
setup(s, { emit: r }) {
|
|
2707
|
-
const
|
|
2708
|
-
const B = [],
|
|
2727
|
+
const n = s, e = r, o = J("calendar"), a = O(n.modelValue.getFullYear()), t = O(n.modelValue.getMonth()), l = ["日", "一", "二", "三", "四", "五", "六"], c = ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"], z = /* @__PURE__ */ new Date(), k = $(() => {
|
|
2728
|
+
const B = [], N = new Date(a.value, t.value, 1), K = new Date(a.value, t.value + 1, 0), Y = N.getDay();
|
|
2709
2729
|
for (let v = Y - 1; v >= 0; v--) {
|
|
2710
|
-
const b = new Date(
|
|
2730
|
+
const b = new Date(a.value, t.value, -v);
|
|
2711
2731
|
B.push({
|
|
2712
2732
|
date: b,
|
|
2713
2733
|
isCurrentMonth: !1,
|
|
2714
|
-
isToday:
|
|
2715
|
-
isSelected:
|
|
2734
|
+
isToday: x(b, z),
|
|
2735
|
+
isSelected: x(b, n.modelValue)
|
|
2716
2736
|
});
|
|
2717
2737
|
}
|
|
2718
|
-
for (let v = 1; v <=
|
|
2719
|
-
const b = new Date(
|
|
2738
|
+
for (let v = 1; v <= K.getDate(); v++) {
|
|
2739
|
+
const b = new Date(a.value, t.value, v);
|
|
2720
2740
|
B.push({
|
|
2721
2741
|
date: b,
|
|
2722
2742
|
isCurrentMonth: !0,
|
|
2723
|
-
isToday:
|
|
2724
|
-
isSelected:
|
|
2743
|
+
isToday: x(b, z),
|
|
2744
|
+
isSelected: x(b, n.modelValue)
|
|
2725
2745
|
});
|
|
2726
2746
|
}
|
|
2727
|
-
const
|
|
2728
|
-
for (let v = 1; v <=
|
|
2729
|
-
const b = new Date(
|
|
2747
|
+
const q = 42 - B.length;
|
|
2748
|
+
for (let v = 1; v <= q; v++) {
|
|
2749
|
+
const b = new Date(a.value, t.value + 1, v);
|
|
2730
2750
|
B.push({
|
|
2731
2751
|
date: b,
|
|
2732
2752
|
isCurrentMonth: !1,
|
|
2733
|
-
isToday:
|
|
2734
|
-
isSelected:
|
|
2753
|
+
isToday: x(b, z),
|
|
2754
|
+
isSelected: x(b, n.modelValue)
|
|
2735
2755
|
});
|
|
2736
2756
|
}
|
|
2737
2757
|
return B;
|
|
2738
|
-
}),
|
|
2758
|
+
}), x = (B, N) => B.getFullYear() === N.getFullYear() && B.getMonth() === N.getMonth() && B.getDate() === N.getDate(), C = (B) => {
|
|
2739
2759
|
e("update:modelValue", B.date), e("select", B.date), e("change", B.date);
|
|
2740
2760
|
}, S = () => {
|
|
2741
|
-
|
|
2761
|
+
a.value--;
|
|
2762
|
+
}, R = () => {
|
|
2763
|
+
a.value++;
|
|
2742
2764
|
}, V = () => {
|
|
2743
|
-
|
|
2744
|
-
}, P = () => {
|
|
2745
|
-
t.value === 0 ? (t.value = 11, n.value--) : t.value--;
|
|
2765
|
+
t.value === 0 ? (t.value = 11, a.value--) : t.value--;
|
|
2746
2766
|
}, _ = () => {
|
|
2747
|
-
t.value === 11 ? (t.value = 0,
|
|
2767
|
+
t.value === 11 ? (t.value = 0, a.value++) : t.value++;
|
|
2748
2768
|
}, E = () => {
|
|
2749
|
-
|
|
2769
|
+
a.value = z.getFullYear(), t.value = z.getMonth(), e("update:modelValue", z), e("select", z);
|
|
2750
2770
|
};
|
|
2751
|
-
return se(() =>
|
|
2752
|
-
|
|
2753
|
-
}), (B,
|
|
2754
|
-
class: p(
|
|
2771
|
+
return se(() => n.modelValue, (B) => {
|
|
2772
|
+
a.value = B.getFullYear(), t.value = B.getMonth();
|
|
2773
|
+
}), (B, N) => (M(), w("div", {
|
|
2774
|
+
class: p(u(o).b())
|
|
2755
2775
|
}, [
|
|
2756
2776
|
A("div", {
|
|
2757
|
-
class: p(
|
|
2777
|
+
class: p(u(o).e("header"))
|
|
2758
2778
|
}, [
|
|
2759
2779
|
A("div", {
|
|
2760
|
-
class: p(
|
|
2761
|
-
},
|
|
2780
|
+
class: p(u(o).e("title"))
|
|
2781
|
+
}, X(a.value) + " 年 " + X(c[t.value]), 3),
|
|
2762
2782
|
A("div", {
|
|
2763
|
-
class: p(
|
|
2783
|
+
class: p(u(o).e("actions"))
|
|
2764
2784
|
}, [
|
|
2765
2785
|
A("button", {
|
|
2766
|
-
class: p(
|
|
2786
|
+
class: p(u(o).e("btn")),
|
|
2767
2787
|
onClick: S
|
|
2768
2788
|
}, [
|
|
2769
|
-
|
|
2789
|
+
le(u(ne), {
|
|
2770
2790
|
name: "d-arrow-left",
|
|
2771
2791
|
size: 12
|
|
2772
2792
|
})
|
|
2773
2793
|
], 2),
|
|
2774
2794
|
A("button", {
|
|
2775
|
-
class: p(
|
|
2776
|
-
onClick:
|
|
2795
|
+
class: p(u(o).e("btn")),
|
|
2796
|
+
onClick: V
|
|
2777
2797
|
}, [
|
|
2778
|
-
|
|
2798
|
+
le(u(ne), {
|
|
2779
2799
|
name: "arrow-left",
|
|
2780
2800
|
size: 12
|
|
2781
2801
|
})
|
|
2782
2802
|
], 2),
|
|
2783
2803
|
A("button", {
|
|
2784
|
-
class: p(
|
|
2804
|
+
class: p(u(o).e("btn")),
|
|
2785
2805
|
onClick: E
|
|
2786
2806
|
}, "今天", 2),
|
|
2787
2807
|
A("button", {
|
|
2788
|
-
class: p(
|
|
2808
|
+
class: p(u(o).e("btn")),
|
|
2789
2809
|
onClick: _
|
|
2790
2810
|
}, [
|
|
2791
|
-
|
|
2811
|
+
le(u(ne), {
|
|
2792
2812
|
name: "arrow-right",
|
|
2793
2813
|
size: 12
|
|
2794
2814
|
})
|
|
2795
2815
|
], 2),
|
|
2796
2816
|
A("button", {
|
|
2797
|
-
class: p(
|
|
2798
|
-
onClick:
|
|
2817
|
+
class: p(u(o).e("btn")),
|
|
2818
|
+
onClick: R
|
|
2799
2819
|
}, [
|
|
2800
|
-
|
|
2820
|
+
le(u(ne), {
|
|
2801
2821
|
name: "d-arrow-right",
|
|
2802
2822
|
size: 12
|
|
2803
2823
|
})
|
|
@@ -2805,51 +2825,51 @@ const on = /* @__PURE__ */ Z({
|
|
|
2805
2825
|
], 2)
|
|
2806
2826
|
], 2),
|
|
2807
2827
|
A("div", {
|
|
2808
|
-
class: p(
|
|
2828
|
+
class: p(u(o).e("weekdays"))
|
|
2809
2829
|
}, [
|
|
2810
|
-
(M(),
|
|
2811
|
-
key:
|
|
2812
|
-
class: p(
|
|
2813
|
-
},
|
|
2830
|
+
(M(), w(te, null, re(l, (K) => A("div", {
|
|
2831
|
+
key: K,
|
|
2832
|
+
class: p(u(o).e("weekday"))
|
|
2833
|
+
}, X(K), 3)), 64))
|
|
2814
2834
|
], 2),
|
|
2815
2835
|
A("div", {
|
|
2816
|
-
class: p(
|
|
2836
|
+
class: p(u(o).e("body"))
|
|
2817
2837
|
}, [
|
|
2818
|
-
(M(!0),
|
|
2838
|
+
(M(!0), w(te, null, re(k.value, (K, Y) => (M(), w("div", {
|
|
2819
2839
|
key: Y,
|
|
2820
2840
|
class: p([
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2841
|
+
u(o).e("day"),
|
|
2842
|
+
u(o).is("current-month", K.isCurrentMonth),
|
|
2843
|
+
u(o).is("today", K.isToday),
|
|
2844
|
+
u(o).is("selected", K.isSelected)
|
|
2825
2845
|
]),
|
|
2826
|
-
onClick: (
|
|
2846
|
+
onClick: (q) => C(K)
|
|
2827
2847
|
}, [
|
|
2828
|
-
|
|
2829
|
-
date:
|
|
2830
|
-
isCurrentMonth:
|
|
2848
|
+
F(B.$slots, "default", {
|
|
2849
|
+
date: K.date,
|
|
2850
|
+
isCurrentMonth: K.isCurrentMonth
|
|
2831
2851
|
}, () => [
|
|
2832
|
-
|
|
2852
|
+
oe(X(K.date.getDate()), 1)
|
|
2833
2853
|
])
|
|
2834
|
-
], 10,
|
|
2854
|
+
], 10, Yt))), 128))
|
|
2835
2855
|
], 2)
|
|
2836
2856
|
], 2));
|
|
2837
2857
|
}
|
|
2838
|
-
}),
|
|
2858
|
+
}), ge = function(s, r) {
|
|
2839
2859
|
let o = s;
|
|
2840
|
-
const
|
|
2841
|
-
let t = null, l = 0,
|
|
2842
|
-
const
|
|
2860
|
+
const a = ke[r];
|
|
2861
|
+
let t = null, l = 0, c = null;
|
|
2862
|
+
const z = [], k = {}, x = function(v, b) {
|
|
2843
2863
|
l = o * 4 + 17, t = function(y) {
|
|
2844
2864
|
const D = new Array(y);
|
|
2845
2865
|
for (let I = 0; I < y; I += 1) {
|
|
2846
2866
|
D[I] = new Array(y);
|
|
2847
|
-
for (let
|
|
2848
|
-
D[I][
|
|
2867
|
+
for (let m = 0; m < y; m += 1)
|
|
2868
|
+
D[I][m] = null;
|
|
2849
2869
|
}
|
|
2850
2870
|
return D;
|
|
2851
|
-
}(l),
|
|
2852
|
-
},
|
|
2871
|
+
}(l), C(0, 0), C(l - 7, 0), C(0, l - 7), V(), R(), E(v, b), o >= 7 && _(v), c == null && (c = K(o, a, z)), B(c, b);
|
|
2872
|
+
}, C = function(v, b) {
|
|
2853
2873
|
for (let y = -1; y <= 7; y += 1)
|
|
2854
2874
|
if (!(v + y <= -1 || l <= v + y))
|
|
2855
2875
|
for (let D = -1; D <= 7; D += 1)
|
|
@@ -2857,28 +2877,28 @@ const on = /* @__PURE__ */ Z({
|
|
|
2857
2877
|
}, S = function() {
|
|
2858
2878
|
let v = 0, b = 0;
|
|
2859
2879
|
for (let y = 0; y < 8; y += 1) {
|
|
2860
|
-
|
|
2861
|
-
const D =
|
|
2880
|
+
x(!0, y);
|
|
2881
|
+
const D = he.getLostPoint(k);
|
|
2862
2882
|
(y == 0 || v > D) && (v = D, b = y);
|
|
2863
2883
|
}
|
|
2864
2884
|
return b;
|
|
2865
|
-
},
|
|
2885
|
+
}, R = function() {
|
|
2866
2886
|
for (let v = 8; v < l - 8; v += 1)
|
|
2867
2887
|
t[v][6] == null && (t[v][6] = v % 2 == 0);
|
|
2868
2888
|
for (let v = 8; v < l - 8; v += 1)
|
|
2869
2889
|
t[6][v] == null && (t[6][v] = v % 2 == 0);
|
|
2870
|
-
},
|
|
2871
|
-
const v =
|
|
2890
|
+
}, V = function() {
|
|
2891
|
+
const v = he.getPatternPosition(o);
|
|
2872
2892
|
for (let b = 0; b < v.length; b += 1)
|
|
2873
2893
|
for (let y = 0; y < v.length; y += 1) {
|
|
2874
2894
|
const D = v[b], I = v[y];
|
|
2875
2895
|
if (t[D][I] == null)
|
|
2876
|
-
for (let
|
|
2896
|
+
for (let m = -2; m <= 2; m += 1)
|
|
2877
2897
|
for (let L = -2; L <= 2; L += 1)
|
|
2878
|
-
|
|
2898
|
+
m == -2 || m == 2 || L == -2 || L == 2 || m == 0 && L == 0 ? t[D + m][I + L] = !0 : t[D + m][I + L] = !1;
|
|
2879
2899
|
}
|
|
2880
2900
|
}, _ = function(v) {
|
|
2881
|
-
const b =
|
|
2901
|
+
const b = he.getBCHTypeNumber(o);
|
|
2882
2902
|
for (let y = 0; y < 18; y += 1) {
|
|
2883
2903
|
const D = !v && (b >> y & 1) == 1;
|
|
2884
2904
|
t[Math.floor(y / 3)][y % 3 + l - 8 - 3] = D;
|
|
@@ -2888,110 +2908,110 @@ const on = /* @__PURE__ */ Z({
|
|
|
2888
2908
|
t[y % 3 + l - 8 - 3][Math.floor(y / 3)] = D;
|
|
2889
2909
|
}
|
|
2890
2910
|
}, E = function(v, b) {
|
|
2891
|
-
const y =
|
|
2911
|
+
const y = a << 3 | b, D = he.getBCHTypeInfo(y);
|
|
2892
2912
|
for (let I = 0; I < 15; I += 1) {
|
|
2893
|
-
const
|
|
2894
|
-
I < 6 ? t[I][8] =
|
|
2913
|
+
const m = !v && (D >> I & 1) == 1;
|
|
2914
|
+
I < 6 ? t[I][8] = m : I < 8 ? t[I + 1][8] = m : t[l - 15 + I][8] = m;
|
|
2895
2915
|
}
|
|
2896
2916
|
for (let I = 0; I < 15; I += 1) {
|
|
2897
|
-
const
|
|
2898
|
-
I < 8 ? t[8][l - I - 1] =
|
|
2917
|
+
const m = !v && (D >> I & 1) == 1;
|
|
2918
|
+
I < 8 ? t[8][l - I - 1] = m : I < 9 ? t[8][15 - I - 1 + 1] = m : t[8][15 - I - 1] = m;
|
|
2899
2919
|
}
|
|
2900
2920
|
t[l - 8][8] = !v;
|
|
2901
2921
|
}, B = function(v, b) {
|
|
2902
|
-
let y = -1, D = l - 1, I = 7,
|
|
2903
|
-
const L =
|
|
2904
|
-
for (let
|
|
2905
|
-
for (
|
|
2906
|
-
for (let
|
|
2907
|
-
if (t[D][
|
|
2908
|
-
let
|
|
2909
|
-
|
|
2922
|
+
let y = -1, D = l - 1, I = 7, m = 0;
|
|
2923
|
+
const L = he.getMaskFunction(b);
|
|
2924
|
+
for (let f = l - 1; f > 0; f -= 2)
|
|
2925
|
+
for (f == 6 && (f -= 1); ; ) {
|
|
2926
|
+
for (let i = 0; i < 2; i += 1)
|
|
2927
|
+
if (t[D][f - i] == null) {
|
|
2928
|
+
let d = !1;
|
|
2929
|
+
m < v.length && (d = (v[m] >>> I & 1) == 1), L(D, f - i) && (d = !d), t[D][f - i] = d, I -= 1, I == -1 && (m += 1, I = 7);
|
|
2910
2930
|
}
|
|
2911
2931
|
if (D += y, D < 0 || l <= D) {
|
|
2912
2932
|
D -= y, y = -y;
|
|
2913
2933
|
break;
|
|
2914
2934
|
}
|
|
2915
2935
|
}
|
|
2916
|
-
},
|
|
2936
|
+
}, N = function(v, b) {
|
|
2917
2937
|
let y = 0, D = 0, I = 0;
|
|
2918
|
-
const
|
|
2919
|
-
for (let
|
|
2920
|
-
const h = b[
|
|
2921
|
-
D = Math.max(D, h), I = Math.max(I, T), g
|
|
2922
|
-
for (let
|
|
2923
|
-
g
|
|
2938
|
+
const m = new Array(b.length), L = new Array(b.length);
|
|
2939
|
+
for (let g = 0; g < b.length; g += 1) {
|
|
2940
|
+
const h = b[g].dataCount, T = b[g].totalCount - h;
|
|
2941
|
+
D = Math.max(D, h), I = Math.max(I, T), m[g] = new Array(h);
|
|
2942
|
+
for (let ee = 0; ee < m[g].length; ee += 1)
|
|
2943
|
+
m[g][ee] = 255 & v.getBuffer()[ee + y];
|
|
2924
2944
|
y += h;
|
|
2925
|
-
const H =
|
|
2926
|
-
L[
|
|
2927
|
-
for (let
|
|
2928
|
-
const
|
|
2929
|
-
L[
|
|
2945
|
+
const H = he.getErrorCorrectPolynomial(T), W = we(m[g], H.getLength() - 1).mod(H);
|
|
2946
|
+
L[g] = new Array(H.getLength() - 1);
|
|
2947
|
+
for (let ee = 0; ee < L[g].length; ee += 1) {
|
|
2948
|
+
const ae = ee + W.getLength() - L[g].length;
|
|
2949
|
+
L[g][ee] = ae >= 0 ? W.getAt(ae) : 0;
|
|
2930
2950
|
}
|
|
2931
2951
|
}
|
|
2932
|
-
let c = 0;
|
|
2933
|
-
for (let m = 0; m < b.length; m += 1)
|
|
2934
|
-
c += b[m].totalCount;
|
|
2935
|
-
const u = new Array(c);
|
|
2936
2952
|
let f = 0;
|
|
2937
|
-
for (let
|
|
2953
|
+
for (let g = 0; g < b.length; g += 1)
|
|
2954
|
+
f += b[g].totalCount;
|
|
2955
|
+
const i = new Array(f);
|
|
2956
|
+
let d = 0;
|
|
2957
|
+
for (let g = 0; g < D; g += 1)
|
|
2938
2958
|
for (let h = 0; h < b.length; h += 1)
|
|
2939
|
-
|
|
2940
|
-
for (let
|
|
2959
|
+
g < m[h].length && (i[d] = m[h][g], d += 1);
|
|
2960
|
+
for (let g = 0; g < I; g += 1)
|
|
2941
2961
|
for (let h = 0; h < b.length; h += 1)
|
|
2942
|
-
|
|
2943
|
-
return
|
|
2944
|
-
},
|
|
2962
|
+
g < L[h].length && (i[d] = L[h][g], d += 1);
|
|
2963
|
+
return i;
|
|
2964
|
+
}, K = function(v, b, y) {
|
|
2945
2965
|
const D = Te.getRSBlocks(v, b), I = Be();
|
|
2946
2966
|
for (let L = 0; L < y.length; L += 1) {
|
|
2947
|
-
const
|
|
2948
|
-
I.put(
|
|
2967
|
+
const f = y[L];
|
|
2968
|
+
I.put(f.getMode(), 4), I.put(f.getLength(), he.getLengthInBits(f.getMode(), v)), f.write(I);
|
|
2949
2969
|
}
|
|
2950
|
-
let
|
|
2970
|
+
let m = 0;
|
|
2951
2971
|
for (let L = 0; L < D.length; L += 1)
|
|
2952
|
-
|
|
2953
|
-
if (I.getLengthInBits() >
|
|
2954
|
-
throw "code length overflow. (" + I.getLengthInBits() + ">" +
|
|
2955
|
-
for (I.getLengthInBits() + 4 <=
|
|
2972
|
+
m += D[L].dataCount;
|
|
2973
|
+
if (I.getLengthInBits() > m * 8)
|
|
2974
|
+
throw "code length overflow. (" + I.getLengthInBits() + ">" + m * 8 + ")";
|
|
2975
|
+
for (I.getLengthInBits() + 4 <= m * 8 && I.put(0, 4); I.getLengthInBits() % 8 != 0; )
|
|
2956
2976
|
I.putBit(!1);
|
|
2957
|
-
for (; !(I.getLengthInBits() >=
|
|
2977
|
+
for (; !(I.getLengthInBits() >= m * 8 || (I.put(236, 8), I.getLengthInBits() >= m * 8)); )
|
|
2958
2978
|
I.put(17, 8);
|
|
2959
|
-
return
|
|
2979
|
+
return N(I, D);
|
|
2960
2980
|
};
|
|
2961
|
-
|
|
2981
|
+
k.addData = function(v, b) {
|
|
2962
2982
|
b = b || "Byte";
|
|
2963
2983
|
let y = null;
|
|
2964
2984
|
switch (b) {
|
|
2965
2985
|
case "Numeric":
|
|
2966
|
-
y =
|
|
2986
|
+
y = Xt(v);
|
|
2967
2987
|
break;
|
|
2968
2988
|
case "Alphanumeric":
|
|
2969
|
-
y =
|
|
2989
|
+
y = Qt(v);
|
|
2970
2990
|
break;
|
|
2971
2991
|
case "Byte":
|
|
2972
|
-
y =
|
|
2992
|
+
y = Ut(v);
|
|
2973
2993
|
break;
|
|
2974
2994
|
case "Kanji":
|
|
2975
|
-
y =
|
|
2995
|
+
y = Ft(v);
|
|
2976
2996
|
break;
|
|
2977
2997
|
default:
|
|
2978
2998
|
throw "mode:" + b;
|
|
2979
2999
|
}
|
|
2980
|
-
|
|
2981
|
-
},
|
|
3000
|
+
z.push(y), c = null;
|
|
3001
|
+
}, k.isDark = function(v, b) {
|
|
2982
3002
|
if (v < 0 || l <= v || b < 0 || l <= b)
|
|
2983
3003
|
throw v + "," + b;
|
|
2984
3004
|
return t[v][b];
|
|
2985
|
-
},
|
|
3005
|
+
}, k.getModuleCount = function() {
|
|
2986
3006
|
return l;
|
|
2987
|
-
},
|
|
3007
|
+
}, k.make = function() {
|
|
2988
3008
|
if (o < 1) {
|
|
2989
3009
|
let v = 1;
|
|
2990
3010
|
for (; v < 40; v++) {
|
|
2991
|
-
const b = Te.getRSBlocks(v,
|
|
2992
|
-
for (let I = 0; I <
|
|
2993
|
-
const
|
|
2994
|
-
y.put(
|
|
3011
|
+
const b = Te.getRSBlocks(v, a), y = Be();
|
|
3012
|
+
for (let I = 0; I < z.length; I++) {
|
|
3013
|
+
const m = z[I];
|
|
3014
|
+
y.put(m.getMode(), 4), y.put(m.getLength(), he.getLengthInBits(m.getMode(), v)), m.write(y);
|
|
2995
3015
|
}
|
|
2996
3016
|
let D = 0;
|
|
2997
3017
|
for (let I = 0; I < b.length; I++)
|
|
@@ -3001,42 +3021,42 @@ const on = /* @__PURE__ */ Z({
|
|
|
3001
3021
|
}
|
|
3002
3022
|
o = v;
|
|
3003
3023
|
}
|
|
3004
|
-
|
|
3005
|
-
},
|
|
3024
|
+
x(!1, S());
|
|
3025
|
+
}, k.createTableTag = function(v, b) {
|
|
3006
3026
|
v = v || 2, b = typeof b > "u" ? v * 4 : b;
|
|
3007
3027
|
let y = "";
|
|
3008
3028
|
y += '<table style="', y += " border-width: 0px; border-style: none;", y += " border-collapse: collapse;", y += " padding: 0px; margin: " + b + "px;", y += '">', y += "<tbody>";
|
|
3009
|
-
for (let D = 0; D <
|
|
3029
|
+
for (let D = 0; D < k.getModuleCount(); D += 1) {
|
|
3010
3030
|
y += "<tr>";
|
|
3011
|
-
for (let I = 0; I <
|
|
3012
|
-
y += '<td style="', y += " border-width: 0px; border-style: none;", y += " border-collapse: collapse;", y += " padding: 0px; margin: 0px;", y += " width: " + v + "px;", y += " height: " + v + "px;", y += " background-color: ", y +=
|
|
3031
|
+
for (let I = 0; I < k.getModuleCount(); I += 1)
|
|
3032
|
+
y += '<td style="', y += " border-width: 0px; border-style: none;", y += " border-collapse: collapse;", y += " padding: 0px; margin: 0px;", y += " width: " + v + "px;", y += " height: " + v + "px;", y += " background-color: ", y += k.isDark(D, I) ? "#000000" : "#ffffff", y += ";", y += '"/>';
|
|
3013
3033
|
y += "</tr>";
|
|
3014
3034
|
}
|
|
3015
3035
|
return y += "</tbody>", y += "</table>", y;
|
|
3016
|
-
},
|
|
3036
|
+
}, k.createSvgTag = function(v, b, y, D) {
|
|
3017
3037
|
let I = {};
|
|
3018
3038
|
typeof arguments[0] == "object" && (I = arguments[0], v = I.cellSize, b = I.margin, y = I.alt, D = I.title), v = v || 2, b = typeof b > "u" ? v * 4 : b, y = typeof y == "string" ? { text: y } : y || {}, y.text = y.text || null, y.id = y.text ? y.id || "qrcode-description" : null, D = typeof D == "string" ? { text: D } : D || {}, D.text = D.text || null, D.id = D.text ? D.id || "qrcode-title" : null;
|
|
3019
|
-
const
|
|
3020
|
-
let L,
|
|
3021
|
-
for (h = "l" + v + ",0 0," + v + " -" + v + ",0 0,-" + v + "z ",
|
|
3022
|
-
for (
|
|
3023
|
-
|
|
3024
|
-
return
|
|
3025
|
-
},
|
|
3039
|
+
const m = k.getModuleCount() * v + b * 2;
|
|
3040
|
+
let L, f, i, d, g = "", h;
|
|
3041
|
+
for (h = "l" + v + ",0 0," + v + " -" + v + ",0 0,-" + v + "z ", g += '<svg version="1.1" xmlns="http://www.w3.org/2000/svg"', g += I.scalable ? "" : ' width="' + m + 'px" height="' + m + 'px"', g += ' viewBox="0 0 ' + m + " " + m + '" ', g += ' preserveAspectRatio="xMinYMin meet"', g += D.text || y.text ? ' role="img" aria-labelledby="' + Y([D.id, y.id].join(" ").trim()) + '"' : "", g += ">", g += D.text ? '<title id="' + Y(D.id) + '">' + Y(D.text) + "</title>" : "", g += y.text ? '<description id="' + Y(y.id) + '">' + Y(y.text) + "</description>" : "", g += '<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>', g += '<path d="', i = 0; i < k.getModuleCount(); i += 1)
|
|
3042
|
+
for (d = i * v + b, L = 0; L < k.getModuleCount(); L += 1)
|
|
3043
|
+
k.isDark(i, L) && (f = L * v + b, g += "M" + f + "," + d + h);
|
|
3044
|
+
return g += '" stroke="transparent" fill="black"/>', g += "</svg>", g;
|
|
3045
|
+
}, k.createDataURL = function(v, b) {
|
|
3026
3046
|
v = v || 2, b = typeof b > "u" ? v * 4 : b;
|
|
3027
|
-
const y =
|
|
3028
|
-
return
|
|
3029
|
-
if (D <=
|
|
3030
|
-
const
|
|
3031
|
-
return
|
|
3047
|
+
const y = k.getModuleCount() * v + b * 2, D = b, I = y - b;
|
|
3048
|
+
return qt(y, y, function(m, L) {
|
|
3049
|
+
if (D <= m && m < I && D <= L && L < I) {
|
|
3050
|
+
const f = Math.floor((m - D) / v), i = Math.floor((L - D) / v);
|
|
3051
|
+
return k.isDark(i, f) ? 0 : 1;
|
|
3032
3052
|
} else
|
|
3033
3053
|
return 1;
|
|
3034
3054
|
});
|
|
3035
|
-
},
|
|
3055
|
+
}, k.createImgTag = function(v, b, y) {
|
|
3036
3056
|
v = v || 2, b = typeof b > "u" ? v * 4 : b;
|
|
3037
|
-
const D =
|
|
3057
|
+
const D = k.getModuleCount() * v + b * 2;
|
|
3038
3058
|
let I = "";
|
|
3039
|
-
return I += "<img", I += ' src="', I +=
|
|
3059
|
+
return I += "<img", I += ' src="', I += k.createDataURL(v, b), I += '"', I += ' width="', I += D, I += '"', I += ' height="', I += D, I += '"', y && (I += ' alt="', I += Y(y), I += '"'), I += "/>", I;
|
|
3040
3060
|
};
|
|
3041
3061
|
const Y = function(v) {
|
|
3042
3062
|
let b = "";
|
|
@@ -3061,11 +3081,11 @@ const on = /* @__PURE__ */ Z({
|
|
|
3061
3081
|
}
|
|
3062
3082
|
}
|
|
3063
3083
|
return b;
|
|
3064
|
-
},
|
|
3084
|
+
}, q = function(v) {
|
|
3065
3085
|
v = typeof v > "u" ? 1 * 2 : v;
|
|
3066
|
-
const y =
|
|
3067
|
-
let
|
|
3068
|
-
const
|
|
3086
|
+
const y = k.getModuleCount() * 1 + v * 2, D = v, I = y - v;
|
|
3087
|
+
let m, L, f, i, d;
|
|
3088
|
+
const g = {
|
|
3069
3089
|
"██": "█",
|
|
3070
3090
|
"█ ": "▀",
|
|
3071
3091
|
" █": "▄",
|
|
@@ -3077,90 +3097,90 @@ const on = /* @__PURE__ */ Z({
|
|
|
3077
3097
|
" ": " "
|
|
3078
3098
|
};
|
|
3079
3099
|
let T = "";
|
|
3080
|
-
for (
|
|
3081
|
-
for (
|
|
3082
|
-
|
|
3100
|
+
for (m = 0; m < y; m += 2) {
|
|
3101
|
+
for (f = Math.floor((m - D) / 1), i = Math.floor((m + 1 - D) / 1), L = 0; L < y; L += 1)
|
|
3102
|
+
d = "█", D <= L && L < I && D <= m && m < I && k.isDark(f, Math.floor((L - D) / 1)) && (d = " "), D <= L && L < I && D <= m + 1 && m + 1 < I && k.isDark(i, Math.floor((L - D) / 1)) ? d += " " : d += "█", T += v < 1 && m + 1 >= I ? h[d] : g[d];
|
|
3083
3103
|
T += `
|
|
3084
3104
|
`;
|
|
3085
3105
|
}
|
|
3086
3106
|
return y % 2 && v > 0 ? T.substring(0, T.length - y - 1) + Array(y + 1).join("▀") : T.substring(0, T.length - 1);
|
|
3087
3107
|
};
|
|
3088
|
-
return
|
|
3108
|
+
return k.createASCII = function(v, b) {
|
|
3089
3109
|
if (v = v || 1, v < 2)
|
|
3090
|
-
return
|
|
3110
|
+
return q(b);
|
|
3091
3111
|
v -= 1, b = typeof b > "u" ? v * 2 : b;
|
|
3092
|
-
const y =
|
|
3093
|
-
let
|
|
3094
|
-
const
|
|
3112
|
+
const y = k.getModuleCount() * v + b * 2, D = b, I = y - b;
|
|
3113
|
+
let m, L, f, i;
|
|
3114
|
+
const d = Array(v + 1).join("██"), g = Array(v + 1).join(" ");
|
|
3095
3115
|
let h = "", T = "";
|
|
3096
|
-
for (
|
|
3097
|
-
for (
|
|
3098
|
-
|
|
3099
|
-
for (
|
|
3116
|
+
for (m = 0; m < y; m += 1) {
|
|
3117
|
+
for (f = Math.floor((m - D) / v), T = "", L = 0; L < y; L += 1)
|
|
3118
|
+
i = 1, D <= L && L < I && D <= m && m < I && k.isDark(f, Math.floor((L - D) / v)) && (i = 0), T += i ? d : g;
|
|
3119
|
+
for (f = 0; f < v; f += 1)
|
|
3100
3120
|
h += T + `
|
|
3101
3121
|
`;
|
|
3102
3122
|
}
|
|
3103
3123
|
return h.substring(0, h.length - 1);
|
|
3104
|
-
},
|
|
3124
|
+
}, k.renderTo2dContext = function(v, b) {
|
|
3105
3125
|
b = b || 2;
|
|
3106
|
-
const y =
|
|
3126
|
+
const y = k.getModuleCount();
|
|
3107
3127
|
for (let D = 0; D < y; D++)
|
|
3108
3128
|
for (let I = 0; I < y; I++)
|
|
3109
|
-
v.fillStyle =
|
|
3110
|
-
},
|
|
3129
|
+
v.fillStyle = k.isDark(D, I) ? "black" : "white", v.fillRect(I * b, D * b, b, b);
|
|
3130
|
+
}, k;
|
|
3111
3131
|
};
|
|
3112
|
-
|
|
3132
|
+
ge.stringToBytes = function(s) {
|
|
3113
3133
|
const r = [];
|
|
3114
|
-
for (let
|
|
3115
|
-
const e = s.charCodeAt(
|
|
3134
|
+
for (let n = 0; n < s.length; n += 1) {
|
|
3135
|
+
const e = s.charCodeAt(n);
|
|
3116
3136
|
r.push(e & 255);
|
|
3117
3137
|
}
|
|
3118
3138
|
return r;
|
|
3119
3139
|
};
|
|
3120
|
-
|
|
3121
|
-
const
|
|
3122
|
-
const o =
|
|
3123
|
-
const
|
|
3124
|
-
if (
|
|
3125
|
-
return
|
|
3140
|
+
ge.createStringToBytes = function(s, r) {
|
|
3141
|
+
const n = function() {
|
|
3142
|
+
const o = Zt(s), a = function() {
|
|
3143
|
+
const c = o.read();
|
|
3144
|
+
if (c == -1) throw "eof";
|
|
3145
|
+
return c;
|
|
3126
3146
|
};
|
|
3127
3147
|
let t = 0;
|
|
3128
3148
|
const l = {};
|
|
3129
3149
|
for (; ; ) {
|
|
3130
|
-
const
|
|
3131
|
-
if (
|
|
3132
|
-
const
|
|
3133
|
-
l[
|
|
3150
|
+
const c = o.read();
|
|
3151
|
+
if (c == -1) break;
|
|
3152
|
+
const z = a(), k = a(), x = a(), C = String.fromCharCode(c << 8 | z), S = k << 8 | x;
|
|
3153
|
+
l[C] = S, t += 1;
|
|
3134
3154
|
}
|
|
3135
3155
|
if (t != r)
|
|
3136
3156
|
throw t + " != " + r;
|
|
3137
3157
|
return l;
|
|
3138
3158
|
}(), e = 63;
|
|
3139
3159
|
return function(o) {
|
|
3140
|
-
const
|
|
3160
|
+
const a = [];
|
|
3141
3161
|
for (let t = 0; t < o.length; t += 1) {
|
|
3142
3162
|
const l = o.charCodeAt(t);
|
|
3143
3163
|
if (l < 128)
|
|
3144
|
-
|
|
3164
|
+
a.push(l);
|
|
3145
3165
|
else {
|
|
3146
|
-
const
|
|
3147
|
-
typeof
|
|
3166
|
+
const c = n[o.charAt(t)];
|
|
3167
|
+
typeof c == "number" ? (c & 255) == c ? a.push(c) : (a.push(c >>> 8), a.push(c & 255)) : a.push(e);
|
|
3148
3168
|
}
|
|
3149
3169
|
}
|
|
3150
|
-
return
|
|
3170
|
+
return a;
|
|
3151
3171
|
};
|
|
3152
3172
|
};
|
|
3153
|
-
const
|
|
3173
|
+
const ie = {
|
|
3154
3174
|
MODE_NUMBER: 1,
|
|
3155
3175
|
MODE_ALPHA_NUM: 2,
|
|
3156
3176
|
MODE_8BIT_BYTE: 4,
|
|
3157
3177
|
MODE_KANJI: 8
|
|
3158
|
-
},
|
|
3178
|
+
}, ke = {
|
|
3159
3179
|
L: 1,
|
|
3160
3180
|
M: 0,
|
|
3161
3181
|
Q: 3,
|
|
3162
3182
|
H: 2
|
|
3163
|
-
},
|
|
3183
|
+
}, de = {
|
|
3164
3184
|
PATTERN000: 0,
|
|
3165
3185
|
PATTERN001: 1,
|
|
3166
3186
|
PATTERN010: 2,
|
|
@@ -3169,7 +3189,7 @@ const oe = {
|
|
|
3169
3189
|
PATTERN101: 5,
|
|
3170
3190
|
PATTERN110: 6,
|
|
3171
3191
|
PATTERN111: 7
|
|
3172
|
-
},
|
|
3192
|
+
}, he = function() {
|
|
3173
3193
|
const s = [
|
|
3174
3194
|
[],
|
|
3175
3195
|
[6, 18],
|
|
@@ -3211,7 +3231,7 @@ const oe = {
|
|
|
3211
3231
|
[6, 32, 58, 84, 110, 136, 162],
|
|
3212
3232
|
[6, 26, 54, 82, 110, 138, 166],
|
|
3213
3233
|
[6, 30, 58, 86, 114, 142, 170]
|
|
3214
|
-
], r = 1335,
|
|
3234
|
+
], r = 1335, n = 7973, e = 21522, o = {}, a = function(t) {
|
|
3215
3235
|
let l = 0;
|
|
3216
3236
|
for (; t != 0; )
|
|
3217
3237
|
l += 1, t >>>= 1;
|
|
@@ -3219,94 +3239,94 @@ const oe = {
|
|
|
3219
3239
|
};
|
|
3220
3240
|
return o.getBCHTypeInfo = function(t) {
|
|
3221
3241
|
let l = t << 10;
|
|
3222
|
-
for (;
|
|
3223
|
-
l ^= r <<
|
|
3242
|
+
for (; a(l) - a(r) >= 0; )
|
|
3243
|
+
l ^= r << a(l) - a(r);
|
|
3224
3244
|
return (t << 10 | l) ^ e;
|
|
3225
3245
|
}, o.getBCHTypeNumber = function(t) {
|
|
3226
3246
|
let l = t << 12;
|
|
3227
|
-
for (;
|
|
3228
|
-
l ^=
|
|
3247
|
+
for (; a(l) - a(n) >= 0; )
|
|
3248
|
+
l ^= n << a(l) - a(n);
|
|
3229
3249
|
return t << 12 | l;
|
|
3230
3250
|
}, o.getPatternPosition = function(t) {
|
|
3231
3251
|
return s[t - 1];
|
|
3232
3252
|
}, o.getMaskFunction = function(t) {
|
|
3233
3253
|
switch (t) {
|
|
3234
|
-
case
|
|
3235
|
-
return function(l,
|
|
3236
|
-
return (l +
|
|
3254
|
+
case de.PATTERN000:
|
|
3255
|
+
return function(l, c) {
|
|
3256
|
+
return (l + c) % 2 == 0;
|
|
3237
3257
|
};
|
|
3238
|
-
case
|
|
3239
|
-
return function(l,
|
|
3258
|
+
case de.PATTERN001:
|
|
3259
|
+
return function(l, c) {
|
|
3240
3260
|
return l % 2 == 0;
|
|
3241
3261
|
};
|
|
3242
|
-
case
|
|
3243
|
-
return function(l,
|
|
3244
|
-
return
|
|
3262
|
+
case de.PATTERN010:
|
|
3263
|
+
return function(l, c) {
|
|
3264
|
+
return c % 3 == 0;
|
|
3245
3265
|
};
|
|
3246
|
-
case
|
|
3247
|
-
return function(l,
|
|
3248
|
-
return (l +
|
|
3266
|
+
case de.PATTERN011:
|
|
3267
|
+
return function(l, c) {
|
|
3268
|
+
return (l + c) % 3 == 0;
|
|
3249
3269
|
};
|
|
3250
|
-
case
|
|
3251
|
-
return function(l,
|
|
3252
|
-
return (Math.floor(l / 2) + Math.floor(
|
|
3270
|
+
case de.PATTERN100:
|
|
3271
|
+
return function(l, c) {
|
|
3272
|
+
return (Math.floor(l / 2) + Math.floor(c / 3)) % 2 == 0;
|
|
3253
3273
|
};
|
|
3254
|
-
case
|
|
3255
|
-
return function(l,
|
|
3256
|
-
return l *
|
|
3274
|
+
case de.PATTERN101:
|
|
3275
|
+
return function(l, c) {
|
|
3276
|
+
return l * c % 2 + l * c % 3 == 0;
|
|
3257
3277
|
};
|
|
3258
|
-
case
|
|
3259
|
-
return function(l,
|
|
3260
|
-
return (l *
|
|
3278
|
+
case de.PATTERN110:
|
|
3279
|
+
return function(l, c) {
|
|
3280
|
+
return (l * c % 2 + l * c % 3) % 2 == 0;
|
|
3261
3281
|
};
|
|
3262
|
-
case
|
|
3263
|
-
return function(l,
|
|
3264
|
-
return (l *
|
|
3282
|
+
case de.PATTERN111:
|
|
3283
|
+
return function(l, c) {
|
|
3284
|
+
return (l * c % 3 + (l + c) % 2) % 2 == 0;
|
|
3265
3285
|
};
|
|
3266
3286
|
default:
|
|
3267
3287
|
throw "bad maskPattern:" + t;
|
|
3268
3288
|
}
|
|
3269
3289
|
}, o.getErrorCorrectPolynomial = function(t) {
|
|
3270
|
-
let l =
|
|
3271
|
-
for (let
|
|
3272
|
-
l = l.multiply(
|
|
3290
|
+
let l = we([1], 0);
|
|
3291
|
+
for (let c = 0; c < t; c += 1)
|
|
3292
|
+
l = l.multiply(we([1, fe.gexp(c)], 0));
|
|
3273
3293
|
return l;
|
|
3274
3294
|
}, o.getLengthInBits = function(t, l) {
|
|
3275
3295
|
if (1 <= l && l < 10)
|
|
3276
3296
|
switch (t) {
|
|
3277
|
-
case
|
|
3297
|
+
case ie.MODE_NUMBER:
|
|
3278
3298
|
return 10;
|
|
3279
|
-
case
|
|
3299
|
+
case ie.MODE_ALPHA_NUM:
|
|
3280
3300
|
return 9;
|
|
3281
|
-
case
|
|
3301
|
+
case ie.MODE_8BIT_BYTE:
|
|
3282
3302
|
return 8;
|
|
3283
|
-
case
|
|
3303
|
+
case ie.MODE_KANJI:
|
|
3284
3304
|
return 8;
|
|
3285
3305
|
default:
|
|
3286
3306
|
throw "mode:" + t;
|
|
3287
3307
|
}
|
|
3288
3308
|
else if (l < 27)
|
|
3289
3309
|
switch (t) {
|
|
3290
|
-
case
|
|
3310
|
+
case ie.MODE_NUMBER:
|
|
3291
3311
|
return 12;
|
|
3292
|
-
case
|
|
3312
|
+
case ie.MODE_ALPHA_NUM:
|
|
3293
3313
|
return 11;
|
|
3294
|
-
case
|
|
3314
|
+
case ie.MODE_8BIT_BYTE:
|
|
3295
3315
|
return 16;
|
|
3296
|
-
case
|
|
3316
|
+
case ie.MODE_KANJI:
|
|
3297
3317
|
return 10;
|
|
3298
3318
|
default:
|
|
3299
3319
|
throw "mode:" + t;
|
|
3300
3320
|
}
|
|
3301
3321
|
else if (l < 41)
|
|
3302
3322
|
switch (t) {
|
|
3303
|
-
case
|
|
3323
|
+
case ie.MODE_NUMBER:
|
|
3304
3324
|
return 14;
|
|
3305
|
-
case
|
|
3325
|
+
case ie.MODE_ALPHA_NUM:
|
|
3306
3326
|
return 13;
|
|
3307
|
-
case
|
|
3327
|
+
case ie.MODE_8BIT_BYTE:
|
|
3308
3328
|
return 16;
|
|
3309
|
-
case
|
|
3329
|
+
case ie.MODE_KANJI:
|
|
3310
3330
|
return 12;
|
|
3311
3331
|
default:
|
|
3312
3332
|
throw "mode:" + t;
|
|
@@ -3315,36 +3335,36 @@ const oe = {
|
|
|
3315
3335
|
throw "type:" + l;
|
|
3316
3336
|
}, o.getLostPoint = function(t) {
|
|
3317
3337
|
const l = t.getModuleCount();
|
|
3318
|
-
let
|
|
3319
|
-
for (let
|
|
3320
|
-
for (let
|
|
3338
|
+
let c = 0;
|
|
3339
|
+
for (let x = 0; x < l; x += 1)
|
|
3340
|
+
for (let C = 0; C < l; C += 1) {
|
|
3321
3341
|
let S = 0;
|
|
3322
|
-
const
|
|
3323
|
-
for (let
|
|
3324
|
-
if (!(
|
|
3342
|
+
const R = t.isDark(x, C);
|
|
3343
|
+
for (let V = -1; V <= 1; V += 1)
|
|
3344
|
+
if (!(x + V < 0 || l <= x + V))
|
|
3325
3345
|
for (let _ = -1; _ <= 1; _ += 1)
|
|
3326
|
-
|
|
3327
|
-
S > 5 && (
|
|
3346
|
+
C + _ < 0 || l <= C + _ || V == 0 && _ == 0 || R == t.isDark(x + V, C + _) && (S += 1);
|
|
3347
|
+
S > 5 && (c += 3 + S - 5);
|
|
3328
3348
|
}
|
|
3329
|
-
for (let
|
|
3330
|
-
for (let
|
|
3349
|
+
for (let x = 0; x < l - 1; x += 1)
|
|
3350
|
+
for (let C = 0; C < l - 1; C += 1) {
|
|
3331
3351
|
let S = 0;
|
|
3332
|
-
t.isDark(
|
|
3352
|
+
t.isDark(x, C) && (S += 1), t.isDark(x + 1, C) && (S += 1), t.isDark(x, C + 1) && (S += 1), t.isDark(x + 1, C + 1) && (S += 1), (S == 0 || S == 4) && (c += 3);
|
|
3333
3353
|
}
|
|
3334
|
-
for (let
|
|
3335
|
-
for (let
|
|
3336
|
-
t.isDark(
|
|
3337
|
-
for (let
|
|
3338
|
-
for (let
|
|
3339
|
-
t.isDark(
|
|
3340
|
-
let
|
|
3341
|
-
for (let
|
|
3342
|
-
for (let
|
|
3343
|
-
t.isDark(
|
|
3344
|
-
const
|
|
3345
|
-
return
|
|
3354
|
+
for (let x = 0; x < l; x += 1)
|
|
3355
|
+
for (let C = 0; C < l - 6; C += 1)
|
|
3356
|
+
t.isDark(x, C) && !t.isDark(x, C + 1) && t.isDark(x, C + 2) && t.isDark(x, C + 3) && t.isDark(x, C + 4) && !t.isDark(x, C + 5) && t.isDark(x, C + 6) && (c += 40);
|
|
3357
|
+
for (let x = 0; x < l; x += 1)
|
|
3358
|
+
for (let C = 0; C < l - 6; C += 1)
|
|
3359
|
+
t.isDark(C, x) && !t.isDark(C + 1, x) && t.isDark(C + 2, x) && t.isDark(C + 3, x) && t.isDark(C + 4, x) && !t.isDark(C + 5, x) && t.isDark(C + 6, x) && (c += 40);
|
|
3360
|
+
let z = 0;
|
|
3361
|
+
for (let x = 0; x < l; x += 1)
|
|
3362
|
+
for (let C = 0; C < l; C += 1)
|
|
3363
|
+
t.isDark(C, x) && (z += 1);
|
|
3364
|
+
const k = Math.abs(100 * z / l / l - 50) / 5;
|
|
3365
|
+
return c += k * 10, c;
|
|
3346
3366
|
}, o;
|
|
3347
|
-
}(),
|
|
3367
|
+
}(), fe = function() {
|
|
3348
3368
|
const s = new Array(256), r = new Array(256);
|
|
3349
3369
|
for (let e = 0; e < 8; e += 1)
|
|
3350
3370
|
s[e] = 1 << e;
|
|
@@ -3352,49 +3372,49 @@ const oe = {
|
|
|
3352
3372
|
s[e] = s[e - 4] ^ s[e - 5] ^ s[e - 6] ^ s[e - 8];
|
|
3353
3373
|
for (let e = 0; e < 255; e += 1)
|
|
3354
3374
|
r[s[e]] = e;
|
|
3355
|
-
const
|
|
3356
|
-
return
|
|
3375
|
+
const n = {};
|
|
3376
|
+
return n.glog = function(e) {
|
|
3357
3377
|
if (e < 1)
|
|
3358
3378
|
throw "glog(" + e + ")";
|
|
3359
3379
|
return r[e];
|
|
3360
|
-
},
|
|
3380
|
+
}, n.gexp = function(e) {
|
|
3361
3381
|
for (; e < 0; )
|
|
3362
3382
|
e += 255;
|
|
3363
3383
|
for (; e >= 256; )
|
|
3364
3384
|
e -= 255;
|
|
3365
3385
|
return s[e];
|
|
3366
|
-
},
|
|
3367
|
-
}(),
|
|
3386
|
+
}, n;
|
|
3387
|
+
}(), we = function(s, r) {
|
|
3368
3388
|
if (typeof s.length > "u")
|
|
3369
3389
|
throw s.length + "/" + r;
|
|
3370
|
-
const
|
|
3390
|
+
const n = function() {
|
|
3371
3391
|
let o = 0;
|
|
3372
3392
|
for (; o < s.length && s[o] == 0; )
|
|
3373
3393
|
o += 1;
|
|
3374
|
-
const
|
|
3394
|
+
const a = new Array(s.length - o + r);
|
|
3375
3395
|
for (let t = 0; t < s.length - o; t += 1)
|
|
3376
|
-
|
|
3377
|
-
return
|
|
3396
|
+
a[t] = s[t + o];
|
|
3397
|
+
return a;
|
|
3378
3398
|
}(), e = {};
|
|
3379
3399
|
return e.getAt = function(o) {
|
|
3380
|
-
return
|
|
3400
|
+
return n[o];
|
|
3381
3401
|
}, e.getLength = function() {
|
|
3382
|
-
return
|
|
3402
|
+
return n.length;
|
|
3383
3403
|
}, e.multiply = function(o) {
|
|
3384
|
-
const
|
|
3404
|
+
const a = new Array(e.getLength() + o.getLength() - 1);
|
|
3385
3405
|
for (let t = 0; t < e.getLength(); t += 1)
|
|
3386
3406
|
for (let l = 0; l < o.getLength(); l += 1)
|
|
3387
|
-
|
|
3388
|
-
return
|
|
3407
|
+
a[t + l] ^= fe.gexp(fe.glog(e.getAt(t)) + fe.glog(o.getAt(l)));
|
|
3408
|
+
return we(a, 0);
|
|
3389
3409
|
}, e.mod = function(o) {
|
|
3390
3410
|
if (e.getLength() - o.getLength() < 0)
|
|
3391
3411
|
return e;
|
|
3392
|
-
const
|
|
3412
|
+
const a = fe.glog(e.getAt(0)) - fe.glog(o.getAt(0)), t = new Array(e.getLength());
|
|
3393
3413
|
for (let l = 0; l < e.getLength(); l += 1)
|
|
3394
3414
|
t[l] = e.getAt(l);
|
|
3395
3415
|
for (let l = 0; l < o.getLength(); l += 1)
|
|
3396
|
-
t[l] ^=
|
|
3397
|
-
return
|
|
3416
|
+
t[l] ^= fe.gexp(fe.glog(o.getAt(l)) + a);
|
|
3417
|
+
return we(t, 0).mod(o);
|
|
3398
3418
|
}, e;
|
|
3399
3419
|
}, Te = function() {
|
|
3400
3420
|
const s = [
|
|
@@ -3602,99 +3622,99 @@ const oe = {
|
|
|
3602
3622
|
[18, 75, 47, 31, 76, 48],
|
|
3603
3623
|
[34, 54, 24, 34, 55, 25],
|
|
3604
3624
|
[20, 45, 15, 61, 46, 16]
|
|
3605
|
-
], r = function(o,
|
|
3625
|
+
], r = function(o, a) {
|
|
3606
3626
|
const t = {};
|
|
3607
|
-
return t.totalCount = o, t.dataCount =
|
|
3608
|
-
},
|
|
3609
|
-
switch (
|
|
3610
|
-
case
|
|
3627
|
+
return t.totalCount = o, t.dataCount = a, t;
|
|
3628
|
+
}, n = {}, e = function(o, a) {
|
|
3629
|
+
switch (a) {
|
|
3630
|
+
case ke.L:
|
|
3611
3631
|
return s[(o - 1) * 4 + 0];
|
|
3612
|
-
case
|
|
3632
|
+
case ke.M:
|
|
3613
3633
|
return s[(o - 1) * 4 + 1];
|
|
3614
|
-
case
|
|
3634
|
+
case ke.Q:
|
|
3615
3635
|
return s[(o - 1) * 4 + 2];
|
|
3616
|
-
case
|
|
3636
|
+
case ke.H:
|
|
3617
3637
|
return s[(o - 1) * 4 + 3];
|
|
3618
3638
|
default:
|
|
3619
3639
|
return;
|
|
3620
3640
|
}
|
|
3621
3641
|
};
|
|
3622
|
-
return
|
|
3623
|
-
const t = e(o,
|
|
3642
|
+
return n.getRSBlocks = function(o, a) {
|
|
3643
|
+
const t = e(o, a);
|
|
3624
3644
|
if (typeof t > "u")
|
|
3625
|
-
throw "bad rs block @ typeNumber:" + o + "/errorCorrectionLevel:" +
|
|
3626
|
-
const l = t.length / 3,
|
|
3627
|
-
for (let
|
|
3628
|
-
const
|
|
3629
|
-
for (let S = 0; S <
|
|
3630
|
-
|
|
3645
|
+
throw "bad rs block @ typeNumber:" + o + "/errorCorrectionLevel:" + a;
|
|
3646
|
+
const l = t.length / 3, c = [];
|
|
3647
|
+
for (let z = 0; z < l; z += 1) {
|
|
3648
|
+
const k = t[z * 3 + 0], x = t[z * 3 + 1], C = t[z * 3 + 2];
|
|
3649
|
+
for (let S = 0; S < k; S += 1)
|
|
3650
|
+
c.push(r(x, C));
|
|
3631
3651
|
}
|
|
3632
|
-
return
|
|
3633
|
-
},
|
|
3652
|
+
return c;
|
|
3653
|
+
}, n;
|
|
3634
3654
|
}(), Be = function() {
|
|
3635
3655
|
const s = [];
|
|
3636
3656
|
let r = 0;
|
|
3637
|
-
const
|
|
3638
|
-
return
|
|
3657
|
+
const n = {};
|
|
3658
|
+
return n.getBuffer = function() {
|
|
3639
3659
|
return s;
|
|
3640
|
-
},
|
|
3660
|
+
}, n.getAt = function(e) {
|
|
3641
3661
|
const o = Math.floor(e / 8);
|
|
3642
3662
|
return (s[o] >>> 7 - e % 8 & 1) == 1;
|
|
3643
|
-
},
|
|
3644
|
-
for (let
|
|
3645
|
-
|
|
3646
|
-
},
|
|
3663
|
+
}, n.put = function(e, o) {
|
|
3664
|
+
for (let a = 0; a < o; a += 1)
|
|
3665
|
+
n.putBit((e >>> o - a - 1 & 1) == 1);
|
|
3666
|
+
}, n.getLengthInBits = function() {
|
|
3647
3667
|
return r;
|
|
3648
|
-
},
|
|
3668
|
+
}, n.putBit = function(e) {
|
|
3649
3669
|
const o = Math.floor(r / 8);
|
|
3650
3670
|
s.length <= o && s.push(0), e && (s[o] |= 128 >>> r % 8), r += 1;
|
|
3651
|
-
},
|
|
3652
|
-
},
|
|
3653
|
-
const r =
|
|
3671
|
+
}, n;
|
|
3672
|
+
}, Xt = function(s) {
|
|
3673
|
+
const r = ie.MODE_NUMBER, n = s, e = {};
|
|
3654
3674
|
e.getMode = function() {
|
|
3655
3675
|
return r;
|
|
3656
3676
|
}, e.getLength = function(t) {
|
|
3657
|
-
return
|
|
3677
|
+
return n.length;
|
|
3658
3678
|
}, e.write = function(t) {
|
|
3659
|
-
const l =
|
|
3660
|
-
let
|
|
3661
|
-
for (;
|
|
3662
|
-
t.put(o(l.substring(
|
|
3663
|
-
|
|
3679
|
+
const l = n;
|
|
3680
|
+
let c = 0;
|
|
3681
|
+
for (; c + 2 < l.length; )
|
|
3682
|
+
t.put(o(l.substring(c, c + 3)), 10), c += 3;
|
|
3683
|
+
c < l.length && (l.length - c == 1 ? t.put(o(l.substring(c, c + 1)), 4) : l.length - c == 2 && t.put(o(l.substring(c, c + 2)), 7));
|
|
3664
3684
|
};
|
|
3665
3685
|
const o = function(t) {
|
|
3666
3686
|
let l = 0;
|
|
3667
|
-
for (let
|
|
3668
|
-
l = l * 10 +
|
|
3687
|
+
for (let c = 0; c < t.length; c += 1)
|
|
3688
|
+
l = l * 10 + a(t.charAt(c));
|
|
3669
3689
|
return l;
|
|
3670
|
-
},
|
|
3690
|
+
}, a = function(t) {
|
|
3671
3691
|
if ("0" <= t && t <= "9")
|
|
3672
3692
|
return t.charCodeAt(0) - 48;
|
|
3673
3693
|
throw "illegal char :" + t;
|
|
3674
3694
|
};
|
|
3675
3695
|
return e;
|
|
3676
|
-
},
|
|
3677
|
-
const r =
|
|
3696
|
+
}, Qt = function(s) {
|
|
3697
|
+
const r = ie.MODE_ALPHA_NUM, n = s, e = {};
|
|
3678
3698
|
e.getMode = function() {
|
|
3679
3699
|
return r;
|
|
3680
|
-
}, e.getLength = function(
|
|
3681
|
-
return
|
|
3682
|
-
}, e.write = function(
|
|
3683
|
-
const t =
|
|
3700
|
+
}, e.getLength = function(a) {
|
|
3701
|
+
return n.length;
|
|
3702
|
+
}, e.write = function(a) {
|
|
3703
|
+
const t = n;
|
|
3684
3704
|
let l = 0;
|
|
3685
3705
|
for (; l + 1 < t.length; )
|
|
3686
|
-
|
|
3706
|
+
a.put(
|
|
3687
3707
|
o(t.charAt(l)) * 45 + o(t.charAt(l + 1)),
|
|
3688
3708
|
11
|
|
3689
3709
|
), l += 2;
|
|
3690
|
-
l < t.length &&
|
|
3710
|
+
l < t.length && a.put(o(t.charAt(l)), 6);
|
|
3691
3711
|
};
|
|
3692
|
-
const o = function(
|
|
3693
|
-
if ("0" <=
|
|
3694
|
-
return
|
|
3695
|
-
if ("A" <=
|
|
3696
|
-
return
|
|
3697
|
-
switch (
|
|
3712
|
+
const o = function(a) {
|
|
3713
|
+
if ("0" <= a && a <= "9")
|
|
3714
|
+
return a.charCodeAt(0) - 48;
|
|
3715
|
+
if ("A" <= a && a <= "Z")
|
|
3716
|
+
return a.charCodeAt(0) - 65 + 10;
|
|
3717
|
+
switch (a) {
|
|
3698
3718
|
case " ":
|
|
3699
3719
|
return 36;
|
|
3700
3720
|
case "$":
|
|
@@ -3714,73 +3734,73 @@ const oe = {
|
|
|
3714
3734
|
case ":":
|
|
3715
3735
|
return 44;
|
|
3716
3736
|
default:
|
|
3717
|
-
throw "illegal char :" +
|
|
3737
|
+
throw "illegal char :" + a;
|
|
3718
3738
|
}
|
|
3719
3739
|
};
|
|
3720
3740
|
return e;
|
|
3721
|
-
},
|
|
3722
|
-
const r =
|
|
3741
|
+
}, Ut = function(s) {
|
|
3742
|
+
const r = ie.MODE_8BIT_BYTE, n = ge.stringToBytes(s), e = {};
|
|
3723
3743
|
return e.getMode = function() {
|
|
3724
3744
|
return r;
|
|
3725
3745
|
}, e.getLength = function(o) {
|
|
3726
|
-
return
|
|
3746
|
+
return n.length;
|
|
3727
3747
|
}, e.write = function(o) {
|
|
3728
|
-
for (let
|
|
3729
|
-
o.put(a
|
|
3748
|
+
for (let a = 0; a < n.length; a += 1)
|
|
3749
|
+
o.put(n[a], 8);
|
|
3730
3750
|
}, e;
|
|
3731
|
-
},
|
|
3732
|
-
const r =
|
|
3733
|
-
(function(
|
|
3734
|
-
const l = a
|
|
3751
|
+
}, Ft = function(s) {
|
|
3752
|
+
const r = ie.MODE_KANJI, n = ge.stringToBytes;
|
|
3753
|
+
(function(a, t) {
|
|
3754
|
+
const l = n(a);
|
|
3735
3755
|
if (l.length != 2 || (l[0] << 8 | l[1]) != t)
|
|
3736
3756
|
throw "sjis not supported.";
|
|
3737
3757
|
})("友", 38726);
|
|
3738
|
-
const e =
|
|
3758
|
+
const e = n(s), o = {};
|
|
3739
3759
|
return o.getMode = function() {
|
|
3740
3760
|
return r;
|
|
3741
|
-
}, o.getLength = function(
|
|
3761
|
+
}, o.getLength = function(a) {
|
|
3742
3762
|
return ~~(e.length / 2);
|
|
3743
|
-
}, o.write = function(
|
|
3763
|
+
}, o.write = function(a) {
|
|
3744
3764
|
const t = e;
|
|
3745
3765
|
let l = 0;
|
|
3746
3766
|
for (; l + 1 < t.length; ) {
|
|
3747
|
-
let
|
|
3748
|
-
if (33088 <=
|
|
3749
|
-
|
|
3750
|
-
else if (57408 <=
|
|
3751
|
-
|
|
3767
|
+
let c = (255 & t[l]) << 8 | 255 & t[l + 1];
|
|
3768
|
+
if (33088 <= c && c <= 40956)
|
|
3769
|
+
c -= 33088;
|
|
3770
|
+
else if (57408 <= c && c <= 60351)
|
|
3771
|
+
c -= 49472;
|
|
3752
3772
|
else
|
|
3753
|
-
throw "illegal char at " + (l + 1) + "/" +
|
|
3754
|
-
|
|
3773
|
+
throw "illegal char at " + (l + 1) + "/" + c;
|
|
3774
|
+
c = (c >>> 8 & 255) * 192 + (c & 255), a.put(c, 13), l += 2;
|
|
3755
3775
|
}
|
|
3756
3776
|
if (l < t.length)
|
|
3757
3777
|
throw "illegal char at " + (l + 1);
|
|
3758
3778
|
}, o;
|
|
3759
3779
|
}, Ke = function() {
|
|
3760
3780
|
const s = [], r = {};
|
|
3761
|
-
return r.writeByte = function(
|
|
3762
|
-
s.push(
|
|
3763
|
-
}, r.writeShort = function(
|
|
3764
|
-
r.writeByte(
|
|
3765
|
-
}, r.writeBytes = function(
|
|
3766
|
-
e = e || 0, o = o ||
|
|
3767
|
-
for (let
|
|
3768
|
-
r.writeByte(a
|
|
3769
|
-
}, r.writeString = function(
|
|
3770
|
-
for (let e = 0; e <
|
|
3771
|
-
r.writeByte(
|
|
3781
|
+
return r.writeByte = function(n) {
|
|
3782
|
+
s.push(n & 255);
|
|
3783
|
+
}, r.writeShort = function(n) {
|
|
3784
|
+
r.writeByte(n), r.writeByte(n >>> 8);
|
|
3785
|
+
}, r.writeBytes = function(n, e, o) {
|
|
3786
|
+
e = e || 0, o = o || n.length;
|
|
3787
|
+
for (let a = 0; a < o; a += 1)
|
|
3788
|
+
r.writeByte(n[a + e]);
|
|
3789
|
+
}, r.writeString = function(n) {
|
|
3790
|
+
for (let e = 0; e < n.length; e += 1)
|
|
3791
|
+
r.writeByte(n.charCodeAt(e));
|
|
3772
3792
|
}, r.toByteArray = function() {
|
|
3773
3793
|
return s;
|
|
3774
3794
|
}, r.toString = function() {
|
|
3775
|
-
let
|
|
3776
|
-
|
|
3795
|
+
let n = "";
|
|
3796
|
+
n += "[";
|
|
3777
3797
|
for (let e = 0; e < s.length; e += 1)
|
|
3778
|
-
e > 0 && (
|
|
3779
|
-
return
|
|
3798
|
+
e > 0 && (n += ","), n += s[e];
|
|
3799
|
+
return n += "]", n;
|
|
3780
3800
|
}, r;
|
|
3781
|
-
},
|
|
3782
|
-
let s = 0, r = 0,
|
|
3783
|
-
const o = {},
|
|
3801
|
+
}, Gt = function() {
|
|
3802
|
+
let s = 0, r = 0, n = 0, e = "";
|
|
3803
|
+
const o = {}, a = function(l) {
|
|
3784
3804
|
e += String.fromCharCode(t(l & 63));
|
|
3785
3805
|
}, t = function(l) {
|
|
3786
3806
|
if (l < 0)
|
|
@@ -3798,34 +3818,34 @@ const oe = {
|
|
|
3798
3818
|
throw "n:" + l;
|
|
3799
3819
|
};
|
|
3800
3820
|
return o.writeByte = function(l) {
|
|
3801
|
-
for (s = s << 8 | l & 255, r += 8,
|
|
3802
|
-
|
|
3821
|
+
for (s = s << 8 | l & 255, r += 8, n += 1; r >= 6; )
|
|
3822
|
+
a(s >>> r - 6), r -= 6;
|
|
3803
3823
|
}, o.flush = function() {
|
|
3804
|
-
if (r > 0 && (
|
|
3805
|
-
const l = 3 -
|
|
3806
|
-
for (let
|
|
3824
|
+
if (r > 0 && (a(s << 6 - r), s = 0, r = 0), n % 3 != 0) {
|
|
3825
|
+
const l = 3 - n % 3;
|
|
3826
|
+
for (let c = 0; c < l; c += 1)
|
|
3807
3827
|
e += "=";
|
|
3808
3828
|
}
|
|
3809
3829
|
}, o.toString = function() {
|
|
3810
3830
|
return e;
|
|
3811
3831
|
}, o;
|
|
3812
|
-
},
|
|
3832
|
+
}, Zt = function(s) {
|
|
3813
3833
|
const r = s;
|
|
3814
|
-
let
|
|
3815
|
-
const
|
|
3816
|
-
|
|
3834
|
+
let n = 0, e = 0, o = 0;
|
|
3835
|
+
const a = {};
|
|
3836
|
+
a.read = function() {
|
|
3817
3837
|
for (; o < 8; ) {
|
|
3818
|
-
if (
|
|
3838
|
+
if (n >= r.length) {
|
|
3819
3839
|
if (o == 0)
|
|
3820
3840
|
return -1;
|
|
3821
3841
|
throw "unexpected end of file./" + o;
|
|
3822
3842
|
}
|
|
3823
|
-
const
|
|
3824
|
-
if (
|
|
3843
|
+
const c = r.charAt(n);
|
|
3844
|
+
if (n += 1, c == "=")
|
|
3825
3845
|
return o = 0, -1;
|
|
3826
|
-
if (
|
|
3846
|
+
if (c.match(/^\s$/))
|
|
3827
3847
|
continue;
|
|
3828
|
-
e = e << 6 | t(
|
|
3848
|
+
e = e << 6 | t(c.charCodeAt(0)), o += 6;
|
|
3829
3849
|
}
|
|
3830
3850
|
const l = e >>> o - 8 & 255;
|
|
3831
3851
|
return o -= 8, l;
|
|
@@ -3843,78 +3863,78 @@ const oe = {
|
|
|
3843
3863
|
return 63;
|
|
3844
3864
|
throw "c:" + l;
|
|
3845
3865
|
};
|
|
3846
|
-
return
|
|
3847
|
-
},
|
|
3848
|
-
const
|
|
3849
|
-
|
|
3850
|
-
o[
|
|
3851
|
-
},
|
|
3852
|
-
|
|
3853
|
-
const
|
|
3854
|
-
|
|
3855
|
-
let
|
|
3856
|
-
for (;
|
|
3857
|
-
|
|
3858
|
-
|
|
3866
|
+
return a;
|
|
3867
|
+
}, Jt = function(s, r) {
|
|
3868
|
+
const n = s, e = r, o = new Array(s * r), a = {};
|
|
3869
|
+
a.setPixel = function(z, k, x) {
|
|
3870
|
+
o[k * n + z] = x;
|
|
3871
|
+
}, a.write = function(z) {
|
|
3872
|
+
z.writeString("GIF87a"), z.writeShort(n), z.writeShort(e), z.writeByte(128), z.writeByte(0), z.writeByte(0), z.writeByte(0), z.writeByte(0), z.writeByte(0), z.writeByte(255), z.writeByte(255), z.writeByte(255), z.writeString(","), z.writeShort(0), z.writeShort(0), z.writeShort(n), z.writeShort(e), z.writeByte(0);
|
|
3873
|
+
const k = 2, x = l(k);
|
|
3874
|
+
z.writeByte(k);
|
|
3875
|
+
let C = 0;
|
|
3876
|
+
for (; x.length - C > 255; )
|
|
3877
|
+
z.writeByte(255), z.writeBytes(x, C, 255), C += 255;
|
|
3878
|
+
z.writeByte(x.length - C), z.writeBytes(x, C, x.length - C), z.writeByte(0), z.writeString(";");
|
|
3859
3879
|
};
|
|
3860
|
-
const t = function(
|
|
3861
|
-
const
|
|
3862
|
-
let
|
|
3880
|
+
const t = function(z) {
|
|
3881
|
+
const k = z;
|
|
3882
|
+
let x = 0, C = 0;
|
|
3863
3883
|
const S = {};
|
|
3864
|
-
return S.write = function(
|
|
3865
|
-
if (
|
|
3884
|
+
return S.write = function(R, V) {
|
|
3885
|
+
if (R >>> V)
|
|
3866
3886
|
throw "length over";
|
|
3867
|
-
for (;
|
|
3868
|
-
|
|
3869
|
-
|
|
3887
|
+
for (; x + V >= 8; )
|
|
3888
|
+
k.writeByte(255 & (R << x | C)), V -= 8 - x, R >>>= 8 - x, C = 0, x = 0;
|
|
3889
|
+
C = R << x | C, x = x + V;
|
|
3870
3890
|
}, S.flush = function() {
|
|
3871
|
-
|
|
3891
|
+
x > 0 && k.writeByte(C);
|
|
3872
3892
|
}, S;
|
|
3873
|
-
}, l = function(
|
|
3874
|
-
const
|
|
3875
|
-
let
|
|
3876
|
-
const S =
|
|
3877
|
-
for (let B = 0; B <
|
|
3893
|
+
}, l = function(z) {
|
|
3894
|
+
const k = 1 << z, x = (1 << z) + 1;
|
|
3895
|
+
let C = z + 1;
|
|
3896
|
+
const S = c();
|
|
3897
|
+
for (let B = 0; B < k; B += 1)
|
|
3878
3898
|
S.add(String.fromCharCode(B));
|
|
3879
|
-
S.add(String.fromCharCode(
|
|
3880
|
-
const
|
|
3881
|
-
|
|
3899
|
+
S.add(String.fromCharCode(k)), S.add(String.fromCharCode(x));
|
|
3900
|
+
const R = Ke(), V = t(R);
|
|
3901
|
+
V.write(k, C);
|
|
3882
3902
|
let _ = 0, E = String.fromCharCode(o[_]);
|
|
3883
3903
|
for (_ += 1; _ < o.length; ) {
|
|
3884
3904
|
const B = String.fromCharCode(o[_]);
|
|
3885
|
-
_ += 1, S.contains(E + B) ? E = E + B : (
|
|
3905
|
+
_ += 1, S.contains(E + B) ? E = E + B : (V.write(S.indexOf(E), C), S.size() < 4095 && (S.size() == 1 << C && (C += 1), S.add(E + B)), E = B);
|
|
3886
3906
|
}
|
|
3887
|
-
return
|
|
3888
|
-
},
|
|
3889
|
-
const
|
|
3890
|
-
let
|
|
3891
|
-
const
|
|
3892
|
-
return
|
|
3893
|
-
if (
|
|
3894
|
-
throw "dup key:" +
|
|
3895
|
-
C
|
|
3896
|
-
},
|
|
3897
|
-
return
|
|
3898
|
-
},
|
|
3899
|
-
return C
|
|
3900
|
-
},
|
|
3901
|
-
return typeof C
|
|
3902
|
-
},
|
|
3907
|
+
return V.write(S.indexOf(E), C), V.write(x, C), V.flush(), R.toByteArray();
|
|
3908
|
+
}, c = function() {
|
|
3909
|
+
const z = {};
|
|
3910
|
+
let k = 0;
|
|
3911
|
+
const x = {};
|
|
3912
|
+
return x.add = function(C) {
|
|
3913
|
+
if (x.contains(C))
|
|
3914
|
+
throw "dup key:" + C;
|
|
3915
|
+
z[C] = k, k += 1;
|
|
3916
|
+
}, x.size = function() {
|
|
3917
|
+
return k;
|
|
3918
|
+
}, x.indexOf = function(C) {
|
|
3919
|
+
return z[C];
|
|
3920
|
+
}, x.contains = function(C) {
|
|
3921
|
+
return typeof z[C] < "u";
|
|
3922
|
+
}, x;
|
|
3903
3923
|
};
|
|
3904
|
-
return
|
|
3905
|
-
},
|
|
3906
|
-
const e =
|
|
3924
|
+
return a;
|
|
3925
|
+
}, qt = function(s, r, n) {
|
|
3926
|
+
const e = Jt(s, r);
|
|
3907
3927
|
for (let l = 0; l < r; l += 1)
|
|
3908
|
-
for (let
|
|
3909
|
-
e.setPixel(
|
|
3928
|
+
for (let c = 0; c < s; c += 1)
|
|
3929
|
+
e.setPixel(c, l, n(c, l));
|
|
3910
3930
|
const o = Ke();
|
|
3911
3931
|
e.write(o);
|
|
3912
|
-
const
|
|
3932
|
+
const a = Gt(), t = o.toByteArray();
|
|
3913
3933
|
for (let l = 0; l < t.length; l += 1)
|
|
3914
|
-
|
|
3915
|
-
return
|
|
3934
|
+
a.writeByte(t[l]);
|
|
3935
|
+
return a.flush(), "data:image/gif;base64," + a;
|
|
3916
3936
|
};
|
|
3917
|
-
|
|
3937
|
+
ge.stringToBytes;
|
|
3918
3938
|
const Ce = 4, Cn = /* @__PURE__ */ Z({
|
|
3919
3939
|
name: "XQRCode",
|
|
3920
3940
|
__name: "index",
|
|
@@ -3928,66 +3948,66 @@ const Ce = 4, Cn = /* @__PURE__ */ Z({
|
|
|
3928
3948
|
},
|
|
3929
3949
|
emits: ["ready", "error"],
|
|
3930
3950
|
setup(s, { emit: r }) {
|
|
3931
|
-
const
|
|
3932
|
-
|
|
3933
|
-
const t = (
|
|
3934
|
-
const
|
|
3935
|
-
|
|
3936
|
-
const S =
|
|
3937
|
-
for (let
|
|
3951
|
+
const n = s, e = r, o = J("qrcode"), a = O();
|
|
3952
|
+
ge.stringToBytes = (k) => Array.from(new TextEncoder().encode(k));
|
|
3953
|
+
const t = (k, x) => {
|
|
3954
|
+
const C = ge(0, x);
|
|
3955
|
+
C.addData(k), C.make();
|
|
3956
|
+
const S = C.getModuleCount(), R = [];
|
|
3957
|
+
for (let V = 0; V < S; V++) {
|
|
3938
3958
|
const _ = [];
|
|
3939
3959
|
for (let E = 0; E < S; E++)
|
|
3940
|
-
_.push(
|
|
3941
|
-
|
|
3960
|
+
_.push(C.isDark(V, E));
|
|
3961
|
+
R.push(_);
|
|
3942
3962
|
}
|
|
3943
|
-
return
|
|
3944
|
-
}, l = (
|
|
3945
|
-
if (!
|
|
3946
|
-
const
|
|
3947
|
-
if (!
|
|
3948
|
-
const
|
|
3949
|
-
|
|
3950
|
-
const
|
|
3951
|
-
for (let
|
|
3952
|
-
for (let _ = 0; _ <
|
|
3953
|
-
|
|
3963
|
+
return R;
|
|
3964
|
+
}, l = (k) => {
|
|
3965
|
+
if (!a.value) return;
|
|
3966
|
+
const x = a.value.getContext("2d");
|
|
3967
|
+
if (!x) return;
|
|
3968
|
+
const C = k.length, S = n.size / (C + Ce * 2);
|
|
3969
|
+
a.value.width = n.size, a.value.height = n.size, x.fillStyle = n.bgColor, x.fillRect(0, 0, n.size, n.size), x.fillStyle = n.fgColor;
|
|
3970
|
+
const R = Math.ceil(S);
|
|
3971
|
+
for (let V = 0; V < C; V++)
|
|
3972
|
+
for (let _ = 0; _ < C; _++)
|
|
3973
|
+
k[V][_] && x.fillRect(
|
|
3954
3974
|
Math.round((_ + Ce) * S),
|
|
3955
|
-
Math.round((
|
|
3956
|
-
|
|
3957
|
-
|
|
3975
|
+
Math.round((V + Ce) * S),
|
|
3976
|
+
R,
|
|
3977
|
+
R
|
|
3958
3978
|
);
|
|
3959
|
-
},
|
|
3960
|
-
if (!(!
|
|
3979
|
+
}, c = () => {
|
|
3980
|
+
if (!(!a.value || !n.value))
|
|
3961
3981
|
try {
|
|
3962
|
-
const
|
|
3963
|
-
l(
|
|
3964
|
-
} catch (
|
|
3965
|
-
e("error",
|
|
3982
|
+
const k = t(n.value, n.level);
|
|
3983
|
+
l(k), e("ready", a.value);
|
|
3984
|
+
} catch (k) {
|
|
3985
|
+
e("error", k);
|
|
3966
3986
|
}
|
|
3967
|
-
},
|
|
3968
|
-
if (!
|
|
3969
|
-
const
|
|
3970
|
-
|
|
3987
|
+
}, z = () => {
|
|
3988
|
+
if (!a.value) return;
|
|
3989
|
+
const k = document.createElement("a");
|
|
3990
|
+
k.download = "qrcode.png", k.href = a.value.toDataURL("image/png"), k.click();
|
|
3971
3991
|
};
|
|
3972
|
-
return se(() => [
|
|
3973
|
-
|
|
3992
|
+
return se(() => [n.value, n.size, n.bgColor, n.fgColor, n.level], () => {
|
|
3993
|
+
c();
|
|
3974
3994
|
}), pe(() => {
|
|
3975
|
-
|
|
3976
|
-
}), (
|
|
3977
|
-
class: p(
|
|
3995
|
+
c();
|
|
3996
|
+
}), (k, x) => (M(), w("div", {
|
|
3997
|
+
class: p(u(o).b())
|
|
3978
3998
|
}, [
|
|
3979
3999
|
A("canvas", {
|
|
3980
4000
|
ref_key: "canvasRef",
|
|
3981
|
-
ref:
|
|
3982
|
-
class: p(
|
|
4001
|
+
ref: a,
|
|
4002
|
+
class: p(u(o).e("canvas"))
|
|
3983
4003
|
}, null, 2),
|
|
3984
|
-
s.showDownload ? (M(),
|
|
4004
|
+
s.showDownload ? (M(), w("div", {
|
|
3985
4005
|
key: 0,
|
|
3986
|
-
class: p(
|
|
4006
|
+
class: p(u(o).e("actions"))
|
|
3987
4007
|
}, [
|
|
3988
4008
|
A("button", {
|
|
3989
|
-
class: p(
|
|
3990
|
-
onClick:
|
|
4009
|
+
class: p(u(o).e("download")),
|
|
4010
|
+
onClick: z
|
|
3991
4011
|
}, " 下载二维码 ", 2)
|
|
3992
4012
|
], 2)) : j("", !0)
|
|
3993
4013
|
], 2));
|
|
@@ -4003,51 +4023,51 @@ const Ce = 4, Cn = /* @__PURE__ */ Z({
|
|
|
4003
4023
|
virtual: { type: Boolean, default: !0 }
|
|
4004
4024
|
},
|
|
4005
4025
|
emits: ["scroll"],
|
|
4006
|
-
setup(s, { expose: r, emit:
|
|
4007
|
-
const e = s, o =
|
|
4026
|
+
setup(s, { expose: r, emit: n }) {
|
|
4027
|
+
const e = s, o = n, a = J("virtual-scroll"), t = O(), l = O(0), c = $(() => typeof e.height == "number" ? `${e.height}px` : e.height), z = $(() => e.items.length * e.itemSize), k = $(() => {
|
|
4008
4028
|
const B = typeof e.height == "number" ? e.height : parseInt(e.height) || 400;
|
|
4009
4029
|
return Math.ceil(B / e.itemSize) + e.buffer * 2;
|
|
4010
|
-
}),
|
|
4030
|
+
}), x = $(() => {
|
|
4011
4031
|
if (!e.virtual) return 0;
|
|
4012
4032
|
const B = Math.floor(l.value / e.itemSize) - e.buffer;
|
|
4013
4033
|
return Math.max(0, B);
|
|
4014
|
-
}),
|
|
4034
|
+
}), C = $(() => e.virtual ? Math.min(e.items.length, x.value + k.value) : e.items.length), S = $(() => e.virtual ? e.items.slice(x.value, C.value).map((B, N) => ({
|
|
4015
4035
|
...B,
|
|
4016
|
-
index:
|
|
4017
|
-
})) : e.items),
|
|
4018
|
-
const
|
|
4019
|
-
l.value =
|
|
4036
|
+
index: x.value + N
|
|
4037
|
+
})) : e.items), R = $(() => x.value * e.itemSize), V = (B) => {
|
|
4038
|
+
const N = B.target;
|
|
4039
|
+
l.value = N.scrollTop, o("scroll", l.value);
|
|
4020
4040
|
};
|
|
4021
4041
|
return r({
|
|
4022
4042
|
scrollToIndex: (B) => {
|
|
4023
4043
|
t.value && (t.value.scrollTop = B * e.itemSize);
|
|
4024
4044
|
},
|
|
4025
4045
|
scrollToBottom: () => {
|
|
4026
|
-
t.value && (t.value.scrollTop =
|
|
4046
|
+
t.value && (t.value.scrollTop = z.value);
|
|
4027
4047
|
}
|
|
4028
|
-
}), (B,
|
|
4048
|
+
}), (B, N) => (M(), w("div", {
|
|
4029
4049
|
ref_key: "containerRef",
|
|
4030
4050
|
ref: t,
|
|
4031
|
-
class: p(
|
|
4032
|
-
style:
|
|
4033
|
-
onScroll:
|
|
4051
|
+
class: p(u(a).b()),
|
|
4052
|
+
style: U({ height: c.value }),
|
|
4053
|
+
onScroll: V
|
|
4034
4054
|
}, [
|
|
4035
4055
|
A("div", {
|
|
4036
|
-
class: p(
|
|
4037
|
-
style:
|
|
4056
|
+
class: p(u(a).e("wrapper")),
|
|
4057
|
+
style: U({ height: `${z.value}px` })
|
|
4038
4058
|
}, [
|
|
4039
4059
|
A("div", {
|
|
4040
|
-
class: p(
|
|
4041
|
-
style:
|
|
4060
|
+
class: p(u(a).e("content")),
|
|
4061
|
+
style: U({ transform: `translateY(${R.value}px)` })
|
|
4042
4062
|
}, [
|
|
4043
|
-
(M(!0),
|
|
4044
|
-
key:
|
|
4045
|
-
class: p(
|
|
4046
|
-
style:
|
|
4063
|
+
(M(!0), w(te, null, re(S.value, (K, Y) => (M(), w("div", {
|
|
4064
|
+
key: K.id ?? Y,
|
|
4065
|
+
class: p(u(a).e("item")),
|
|
4066
|
+
style: U({ height: `${s.itemSize}px` })
|
|
4047
4067
|
}, [
|
|
4048
|
-
|
|
4049
|
-
item:
|
|
4050
|
-
index:
|
|
4068
|
+
F(B.$slots, "default", {
|
|
4069
|
+
item: K,
|
|
4070
|
+
index: K.index
|
|
4051
4071
|
})
|
|
4052
4072
|
], 6))), 128))
|
|
4053
4073
|
], 6)
|
|
@@ -4067,75 +4087,75 @@ const Ce = 4, Cn = /* @__PURE__ */ Z({
|
|
|
4067
4087
|
},
|
|
4068
4088
|
emits: ["load"],
|
|
4069
4089
|
setup(s, { emit: r }) {
|
|
4070
|
-
const
|
|
4090
|
+
const n = s, e = r, o = J("infinite-scroll"), a = O(), t = O();
|
|
4071
4091
|
let l = null;
|
|
4072
|
-
const
|
|
4092
|
+
const c = () => {
|
|
4073
4093
|
l && l.disconnect(), l = new IntersectionObserver(
|
|
4074
|
-
(
|
|
4075
|
-
|
|
4094
|
+
(z) => {
|
|
4095
|
+
z[0].isIntersecting && !n.loading && !n.finished && e("load");
|
|
4076
4096
|
},
|
|
4077
4097
|
{
|
|
4078
|
-
rootMargin: `${
|
|
4098
|
+
rootMargin: `${n.distance}px`
|
|
4079
4099
|
}
|
|
4080
4100
|
), t.value && l.observe(t.value);
|
|
4081
4101
|
};
|
|
4082
4102
|
return pe(() => {
|
|
4083
|
-
|
|
4103
|
+
c(), n.immediate && !n.finished && e("load");
|
|
4084
4104
|
}), _e(() => {
|
|
4085
4105
|
l && l.disconnect();
|
|
4086
|
-
}), (
|
|
4106
|
+
}), (z, k) => (M(), w("div", {
|
|
4087
4107
|
ref_key: "containerRef",
|
|
4088
|
-
ref:
|
|
4089
|
-
class: p(
|
|
4108
|
+
ref: a,
|
|
4109
|
+
class: p(u(o).b())
|
|
4090
4110
|
}, [
|
|
4091
|
-
|
|
4111
|
+
F(z.$slots, "default"),
|
|
4092
4112
|
A("div", {
|
|
4093
4113
|
ref_key: "observerRef",
|
|
4094
4114
|
ref: t,
|
|
4095
|
-
class: p(
|
|
4115
|
+
class: p(u(o).e("footer"))
|
|
4096
4116
|
}, [
|
|
4097
|
-
s.loading ? (M(),
|
|
4117
|
+
s.loading ? (M(), w("span", {
|
|
4098
4118
|
key: 0,
|
|
4099
|
-
class: p(
|
|
4119
|
+
class: p(u(o).e("loading"))
|
|
4100
4120
|
}, [
|
|
4101
|
-
|
|
4121
|
+
le(u(ne), {
|
|
4102
4122
|
name: "loading",
|
|
4103
4123
|
size: 16
|
|
4104
4124
|
}),
|
|
4105
|
-
A("span", null,
|
|
4106
|
-
], 2)) : s.finished ? (M(),
|
|
4125
|
+
A("span", null, X(s.loadingText), 1)
|
|
4126
|
+
], 2)) : s.finished ? (M(), w("span", {
|
|
4107
4127
|
key: 1,
|
|
4108
|
-
class: p(
|
|
4109
|
-
},
|
|
4128
|
+
class: p(u(o).e("finished"))
|
|
4129
|
+
}, X(s.finishedText), 3)) : j("", !0)
|
|
4110
4130
|
], 2)
|
|
4111
4131
|
], 2));
|
|
4112
4132
|
}
|
|
4113
|
-
});
|
|
4133
|
+
}), An = $t;
|
|
4114
4134
|
export {
|
|
4115
4135
|
gn as Avatar,
|
|
4116
4136
|
bn as Calendar,
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4137
|
+
an as Card,
|
|
4138
|
+
dn as Carousel,
|
|
4139
|
+
hn as CarouselItem,
|
|
4120
4140
|
kn as Collapse,
|
|
4121
4141
|
wn as CollapseItem,
|
|
4122
4142
|
mn as Descriptions,
|
|
4123
4143
|
yn as DescriptionsItem,
|
|
4124
|
-
|
|
4125
|
-
|
|
4144
|
+
on as DynamicTable,
|
|
4145
|
+
rn as Empty,
|
|
4126
4146
|
xn as Image,
|
|
4127
4147
|
In as InfiniteScroll,
|
|
4128
4148
|
nt as Pagination,
|
|
4129
|
-
|
|
4149
|
+
ln as Progress,
|
|
4130
4150
|
Cn as QRCode,
|
|
4131
4151
|
Mn as Scrollbar,
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4138
|
-
|
|
4152
|
+
fn as Table,
|
|
4153
|
+
An as TableColumn,
|
|
4154
|
+
nn as Tag,
|
|
4155
|
+
cn as Timeline,
|
|
4156
|
+
un as TimelineItem,
|
|
4157
|
+
sn as Tree,
|
|
4158
|
+
ve as TreeNode,
|
|
4139
4159
|
vn as TreeTable,
|
|
4140
4160
|
pn as TreeTableColumn,
|
|
4141
4161
|
zn as VirtualScroll
|