@xto/data 1.4.4 → 1.5.0

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