@xto/data 1.4.3 → 1.4.4

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