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