@xto/data 1.4.1 → 1.4.3

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