@xto/data 1.4.3 → 1.4.5

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