@xto/data 1.4.2 → 1.4.4

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