@xto/data 1.1.4 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs CHANGED
@@ -1,6 +1,259 @@
1
- import { defineComponent as G, computed as x, openBlock as c, createElementBlock as h, normalizeStyle as j, normalizeClass as g, renderSlot as B, unref as f, createCommentVNode as S, createTextVNode as J, toDisplayString as A, createElementVNode as y, ref as P, watch as q, Fragment as R, renderList as U, useSlots as ue, withModifiers as de, inject as oe, resolveComponent as ye, withDirectives as ve, createBlock as se, withCtx as he, vShow as me, reactive as fe, provide as le, toRef as ke, nextTick as pe, onMounted as ie, onUnmounted as re, resolveDynamicComponent as ce, createVNode as xe } from "vue";
2
- import { useNamespace as Y } from "@xto/core";
3
- const pt = /* @__PURE__ */ G({
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 F, createCommentVNode as H, ref as V, watch as _, Fragment as G, renderList as J, useSlots as fe, withModifiers as se, inject as de, 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 = {
4
+ // 箭头类
5
+ "arrow-up": "M12 19V5m0 0l-7 7m7-7l7 7",
6
+ "arrow-down": "M12 5v14m0 0l7-7m-7 7l-7-7",
7
+ "arrow-left": "M19 12H5m0 0l7 7m-7-7l7-7",
8
+ "arrow-right": "M5 12h14m0 0l-7-7m7 7l-7 7",
9
+ "arrow-up-bold": "M12 5l-7 7h4v7h6v-7h4l-7-7z",
10
+ "arrow-down-bold": "M12 19l7-7h-4V5H9v7H5l7 7z",
11
+ "arrow-left-bold": "M5 12l7-7v4h7v6h-7v4l-7-7z",
12
+ "arrow-right-bold": "M19 12l-7 7v-4H5v-6h7V5l7 7z",
13
+ // 树形结构类
14
+ "caret-down": "M6 9l6 6 6-6",
15
+ "caret-right": "M9 18l6-6-6-6",
16
+ // 操作类
17
+ plus: "M12 5v14m-7-7h14",
18
+ minus: "M5 12h14",
19
+ close: "M6 18L18 6M6 6l12 12",
20
+ check: "M5 13l4 4L19 7",
21
+ "check-bold": "M4 12l5 5L20 6",
22
+ edit: "M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",
23
+ delete: "M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",
24
+ copy: "M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",
25
+ download: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",
26
+ upload: "M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",
27
+ refresh: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",
28
+ search: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",
29
+ filter: "M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",
30
+ more: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z",
31
+ "more-h": "M5 12h.01M12 12h.01M19 12h.01M6 12a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0zm7 0a1 1 0 11-2 0 1 1 0 012 0z",
32
+ setting: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M15 12a3 3 0 11-6 0 3 3 0 016 0z",
33
+ share: "M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",
34
+ // 状态类
35
+ loading: "M12 2v4m0 12v4M4.93 4.93l2.83 2.83m8.48 8.48l2.83 2.83M2 12h4m12 0h4M4.93 19.07l2.83-2.83m8.48-8.48l2.83-2.83",
36
+ info: "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
37
+ success: "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
38
+ warning: "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",
39
+ error: "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",
40
+ question: "M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
41
+ // 用户类
42
+ user: "M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",
43
+ "user-add": "M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",
44
+ "user-group": "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",
45
+ logout: "M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1",
46
+ login: "M11 16l-4-4m0 0l4-4m-4 4h14m-5 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h7a3 3 0 013 3v1",
47
+ // 文件类
48
+ file: "M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z",
49
+ folder: "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",
50
+ "folder-open": "M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",
51
+ document: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",
52
+ // 媒体类
53
+ image: "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",
54
+ video: "M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",
55
+ music: "M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",
56
+ camera: "M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",
57
+ // 通信类
58
+ mail: "M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",
59
+ phone: "M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",
60
+ chat: "M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",
61
+ bell: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
62
+ message: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z",
63
+ // 视图类
64
+ eye: "M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",
65
+ "eye-off": "M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",
66
+ // 时间类
67
+ calendar: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",
68
+ clock: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
69
+ history: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
70
+ timer: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",
71
+ // 位置类
72
+ location: "M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",
73
+ map: "M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",
74
+ globe: "M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",
75
+ // 其他
76
+ star: "M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",
77
+ heart: "M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",
78
+ "thumb-up": "M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",
79
+ link: "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",
80
+ "external-link": "M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",
81
+ lock: "M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",
82
+ unlock: "M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",
83
+ key: "M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z",
84
+ home: "M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",
85
+ menu: "M4 6h16M4 12h16M4 18h16",
86
+ "menu-fold": "M4 6h16M4 12h10M4 18h16",
87
+ "menu-unfold": "M4 6h16M10 12h10M4 18h16",
88
+ "menu-collapse": "M4 6h16M4 12h10M4 18h16",
89
+ "menu-expand": "M4 6h16M10 12h10M4 18h16",
90
+ "sidebar-fold": "M11 19l-7-7 7-7m8 14l-7-7 7-7",
91
+ "sidebar-expand": "M13 5l7 7-7 7M5 5l7 7-7 7",
92
+ "sidebar-left": "M11 19l-7-7 7-7m8 14l-7-7 7-7",
93
+ // 菜单导航类
94
+ dashboard: "M4 5a1 1 0 011-1h4a1 1 0 011 1v5a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM14 5a1 1 0 011-1h4a1 1 0 011 1v2a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zM14 12a1 1 0 011-1h4a1 1 0 011 1v7a1 1 0 01-1 1h-4a1 1 0 01-1-1v-7z",
95
+ chart: "M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z",
96
+ "chart-pie": "M11 3.055A9.001 9.001 0 1020.945 13H11V3.055z M20.488 9H15V3.512A9.025 9.025 0 0120.488 9z",
97
+ "chart-line": "M7 12l3-3 3 3 4-4M8 21l4-4 4 4M3 4h18M4 4v16",
98
+ report: "M9 17v-2m3 2v-4m3 4v-6m2 10H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",
99
+ analytics: "M16 8v8m-4-5v5m-4-2v2m-2 4h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",
100
+ system: "M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z M12 15a3 3 0 100-6 3 3 0 000 6z",
101
+ permission: "M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",
102
+ role: "M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",
103
+ "user-manage": "M12 4.354a4 4 0 110 5.292M15 21H3v-1a6 6 0 0112 0v1zm0 0h6v-1a6 6 0 00-9-5.197M13 7a4 4 0 11-8 0 4 4 0 018 0z",
104
+ log: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",
105
+ notification: "M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",
106
+ app: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",
107
+ list: "M4 6h16M4 10h16M4 14h16M4 18h16",
108
+ grid: "M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zM14 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zM14 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z",
109
+ fullscreen: "M4 8V4m0 0h4M4 4l5 5m11-1V4m0 0h-4m4 0l-5 5M4 16v4m0 0h4m-4 0l5-5m11 5l-5-5m5 5v-4m0 4h-4",
110
+ "fullscreen-exit": "M9 4V9H4m11-5v5h5M4 15h5v5m11-5h-5v5",
111
+ "zoom-in": "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM10 7v6m3-3H7",
112
+ "zoom-out": "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0zM13 10H7",
113
+ print: "M17 17h2a2 2 0 002-2v-4a2 2 0 00-2-2H5a2 2 0 00-2 2v4a2 2 0 002 2h2m2 4h6a2 2 0 002-2v-4a2 2 0 00-2-2H9a2 2 0 00-2 2v4a2 2 0 002 2zm8-12V5a2 2 0 00-2-2H9a2 2 0 00-2 2v4h10z",
114
+ bookmark: "M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",
115
+ tag: "M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",
116
+ code: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",
117
+ terminal: "M8 9l3 3-3 3m5 0h3M5 20h14a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",
118
+ database: "M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",
119
+ server: "M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",
120
+ cloud: "M3 15a4 4 0 004 4h9a5 5 0 10-.1-9.999 5.002 5.002 0 10-9.78 2.096A4.001 4.001 0 003 15z",
121
+ gift: "M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7",
122
+ // 主题类
123
+ moon: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",
124
+ sun: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",
125
+ theme: "M7 21a4 4 0 01-4-4V5a2 2 0 012-2h4a2 2 0 012 2v12a4 4 0 01-4 4zm0 0h12a2 2 0 002-2v-4a2 2 0 00-2-2h-2.343M11 7.343l1.657-1.657a2 2 0 012.828 0l2.829 2.829a2 2 0 010 2.828l-8.486 8.485M7 17h.01",
126
+ skin: "M7 4h2v1c0 1.66 1.34 3 3 3s3-1.34 3-3V4h2l3 3v6h-4l1 3v5H7v-5l1-3H4V7l3-3z",
127
+ // Markdown 编辑器类
128
+ heading: "M4 6h16M4 12h8m-8 6h16",
129
+ // 标题
130
+ bold: "M6 4h8a4 4 0 014 4 4 4 0 01-4 4H6z M6 12h9a4 4 0 014 4 4 4 0 01-4 4H6z",
131
+ // 粗体
132
+ italic: "M10 4h4m-2 0v16m-4 0h8",
133
+ // 斜体
134
+ strikethrough: "M16 4H8a4 4 0 00-4 4v4h16V8a4 4 0 00-4-4zM4 12h16m-4 4H8a4 4 0 00-4 4v0a4 4 0 004 4h8a4 4 0 004-4v0a4 4 0 00-4-4z",
135
+ // 删除线
136
+ "list-bullet": "M4 6h.01M4 12h.01M4 18h.01M8 6h12M8 12h12M8 18h12",
137
+ // 无序列表
138
+ "list-number": "M4 6h2M4 12h2M4 18h2M8 6h12M8 12h12M8 18h12",
139
+ // 有序列表
140
+ "link-text": "M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",
141
+ // 链接
142
+ "image-insert": "M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",
143
+ // 图片
144
+ "code-inline": "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",
145
+ // 代码
146
+ "divider-h": "M4 12h16",
147
+ // 分割线
148
+ quote: "M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z",
149
+ // 引用
150
+ "code-block": "M4 4h16v16H4z M8 8h8M8 12h8M8 16h4",
151
+ // 代码块
152
+ // 排序和展开类
153
+ "sort-up": "M12 5v14m-7-7l7-7 7 7",
154
+ // 向上排序
155
+ "sort-down": "M12 19V5m7 7l-7 7-7-7",
156
+ // 向下排序
157
+ "chevron-down": "M6 9l6 6 6-6",
158
+ // 向下展开
159
+ "chevron-right": "M9 18l6-6-6-6",
160
+ // 向右展开
161
+ "chevron-up": "M18 15l-6-6-6 6",
162
+ // 向上收起
163
+ "chevron-left": "M15 18l-6-6 6-6",
164
+ // 向左收起
165
+ // 移动类
166
+ "move-up": "M5 15l7-7 7 7",
167
+ // 上移
168
+ "move-down": "M19 9l-7 7-7-7",
169
+ // 下移
170
+ "back-top": "M12 19V5m-7 7l7-7 7 7",
171
+ // 回到顶部
172
+ // 下拉箭头
173
+ "dropdown-arrow": "M6 9l6 6 6-6",
174
+ // 关闭/错误类
175
+ "close-circle": "M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",
176
+ // 圆形关闭
177
+ "close-bold": "M6 18L18 6M6 6l12 12",
178
+ // 加粗关闭
179
+ // 圆形状态类
180
+ "check-circle": "M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",
181
+ // 圆形勾选
182
+ "info-circle": "M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",
183
+ // 圆形信息
184
+ "warning-circle": "M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",
185
+ // 圆形警告
186
+ // 返回类
187
+ "back-arrow": "M19 12H5m0 0l7 7m-7-7l7-7",
188
+ // 返回箭头
189
+ // 日历导航类
190
+ "d-arrow-left": "M11 17l-5-5 5-5M18 17l-5-5 5-5",
191
+ // 双左箭头
192
+ "d-arrow-right": "M6 7l5 5-5 5M13 7l5 5-5 5",
193
+ // 双右箭头
194
+ // 方向箭头类
195
+ left: "M15 19l-7-7 7-7",
196
+ // 左箭头
197
+ right: "M9 5l7 7-7 7",
198
+ // 右箭头
199
+ down: "M19 9l-7 7-7-7",
200
+ // 下箭头
201
+ up: "M5 15l7-7 7 7"
202
+ // 上箭头
203
+ };
204
+ function ze(s) {
205
+ return s in Me;
206
+ }
207
+ const Ie = ["aria-hidden", "aria-label"], $e = ["stroke-width"], Se = ["d"], Z = /* @__PURE__ */ Y({
208
+ name: "XIcon",
209
+ __name: "index",
210
+ props: {
211
+ name: {},
212
+ size: { default: 24 },
213
+ color: {},
214
+ spin: { type: Boolean, default: !1 },
215
+ strokeWidth: { default: 2 }
216
+ },
217
+ setup(s, { expose: r }) {
218
+ const a = s, e = Q("icon"), d = M(() => typeof a.size == "number" ? `${a.size}px` : a.size), n = M(() => ({
219
+ width: d.value,
220
+ height: d.value,
221
+ color: a.color
222
+ })), l = M(() => ({
223
+ strokeWidth: a.strokeWidth
224
+ })), m = M(() => [
225
+ e.b(),
226
+ e.is("spin", a.spin)
227
+ ]), y = M(() => a.name && ze(a.name) ? Me[a.name] : "");
228
+ return r({
229
+ iconSize: d,
230
+ iconStyle: n,
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,
237
+ role: "img"
238
+ }, [
239
+ y.value ? (h(), v("svg", {
240
+ key: 0,
241
+ viewBox: "0 0 24 24",
242
+ fill: "none",
243
+ stroke: "currentColor",
244
+ "stroke-width": s.strokeWidth,
245
+ "stroke-linecap": "round",
246
+ "stroke-linejoin": "round",
247
+ style: j(l.value),
248
+ "aria-hidden": "true"
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)
253
+ ])
254
+ ], 14, Ie));
255
+ }
256
+ }), Lt = /* @__PURE__ */ Y({
4
257
  name: "XTag",
5
258
  __name: "index",
6
259
  props: {
@@ -12,33 +265,38 @@ const pt = /* @__PURE__ */ G({
12
265
  color: {}
13
266
  },
14
267
  emits: ["close"],
15
- setup(l, { emit: o }) {
16
- const r = l, t = o, u = Y("tag"), i = x(() => [
17
- u.b(),
18
- u.m(r.type || "primary"),
19
- r.size !== "default" ? u.m(r.size) : "",
20
- u.m(r.effect),
21
- u.is("hit", r.hit)
22
- ]), s = x(() => r.color ? {
23
- backgroundColor: r.effect === "dark" ? r.color : "",
24
- borderColor: r.color,
25
- color: r.effect === "dark" ? "#fff" : r.color
26
- } : {}), k = (b) => {
27
- t("close", b);
268
+ setup(s, { emit: r }) {
269
+ const a = s, e = r, d = Q("tag"), n = M(() => [
270
+ d.b(),
271
+ d.m(a.type || "primary"),
272
+ a.size !== "default" ? d.m(a.size) : "",
273
+ d.m(a.effect),
274
+ d.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) => {
280
+ e("close", y);
28
281
  };
29
- return (b, M) => (c(), h("span", {
30
- class: g(i.value),
31
- style: j(s.value)
282
+ return (y, w) => (h(), v("span", {
283
+ class: u(n.value),
284
+ style: j(l.value)
32
285
  }, [
33
- B(b.$slots, "default"),
34
- l.closable ? (c(), h("i", {
286
+ E(y.$slots, "default"),
287
+ s.closable ? (h(), v("i", {
35
288
  key: 0,
36
- class: g(f(u).e("close")),
37
- onClick: k
38
- }, "✕", 2)) : S("", !0)
289
+ class: u(i(d).e("close")),
290
+ onClick: m
291
+ }, [
292
+ F(i(Z), {
293
+ name: "close",
294
+ size: 10
295
+ })
296
+ ], 2)) : H("", !0)
39
297
  ], 6));
40
298
  }
41
- }), gt = /* @__PURE__ */ G({
299
+ }), At = /* @__PURE__ */ Y({
42
300
  name: "XCard",
43
301
  __name: "index",
44
302
  props: {
@@ -46,31 +304,31 @@ const pt = /* @__PURE__ */ G({
46
304
  bodyStyle: { default: () => ({ padding: "20px" }) },
47
305
  shadow: { default: "always" }
48
306
  },
49
- setup(l) {
50
- const o = l, r = Y("card"), t = x(() => [
51
- r.b(),
52
- r.is(`shadow-${o.shadow}`)
307
+ setup(s) {
308
+ const r = s, a = Q("card"), e = M(() => [
309
+ a.b(),
310
+ a.is(`shadow-${r.shadow}`)
53
311
  ]);
54
- return (u, i) => (c(), h("div", {
55
- class: g(t.value)
312
+ return (d, n) => (h(), v("div", {
313
+ class: u(e.value)
56
314
  }, [
57
- l.header || u.$slots.header ? (c(), h("div", {
315
+ s.header || d.$slots.header ? (h(), v("div", {
58
316
  key: 0,
59
- class: g(f(r).e("header"))
317
+ class: u(i(a).e("header"))
60
318
  }, [
61
- B(u.$slots, "header", {}, () => [
62
- J(A(l.header), 1)
319
+ E(d.$slots, "header", {}, () => [
320
+ q(T(s.header), 1)
63
321
  ])
64
- ], 2)) : S("", !0),
65
- y("div", {
66
- class: g(f(r).e("body")),
67
- style: j(l.bodyStyle)
322
+ ], 2)) : H("", !0),
323
+ g("div", {
324
+ class: u(i(a).e("body")),
325
+ style: j(s.bodyStyle)
68
326
  }, [
69
- B(u.$slots, "default")
327
+ E(d.$slots, "default")
70
328
  ], 6)
71
329
  ], 2));
72
330
  }
73
- }), be = ["viewBox"], Ce = ["cx", "cy", "r", "stroke-width"], we = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], yt = /* @__PURE__ */ G({
331
+ }), Le = ["viewBox"], Ae = ["cx", "cy", "r", "stroke-width"], De = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], Dt = /* @__PURE__ */ Y({
74
332
  name: "XProgress",
75
333
  __name: "index",
76
334
  props: {
@@ -82,75 +340,75 @@ const pt = /* @__PURE__ */ G({
82
340
  width: { default: 126 },
83
341
  showText: { type: Boolean, default: !0 }
84
342
  },
85
- setup(l) {
86
- const o = l, r = Y("progress"), t = x(() => Math.min(100, Math.max(0, o.percentage))), u = x(() => ({
87
- width: `${t.value}%`,
88
- backgroundColor: typeof o.color == "function" ? o.color(t.value) : o.color
89
- })), i = x(() => [
90
- r.b(),
91
- r.m(o.type),
92
- r.is("show-text", o.showText),
93
- r.is(`status-${o.status || ""}`, o.status)
343
+ setup(s) {
344
+ const r = s, a = Q("progress"), e = M(() => Math.min(100, Math.max(0, r.percentage))), d = M(() => ({
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)
94
352
  ]);
95
- return x(() => o.status === "success" ? "100%" : o.status === "warning" ? "Warning" : o.status === "exception" ? "Exception" : `${t.value}%`), (s, k) => (c(), h("div", {
96
- class: g(i.value)
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)
97
355
  }, [
98
- l.type === "line" ? (c(), h("div", {
356
+ s.type === "line" ? (h(), v("div", {
99
357
  key: 0,
100
- class: g(f(r).e("line"))
358
+ class: u(i(a).e("line"))
101
359
  }, [
102
- y("div", {
103
- class: g(f(r).e("outer"))
360
+ g("div", {
361
+ class: u(i(a).e("outer"))
104
362
  }, [
105
- y("div", {
106
- class: g(f(r).e("inner"))
363
+ g("div", {
364
+ class: u(i(a).e("inner"))
107
365
  }, [
108
- y("div", {
109
- class: g(f(r).e("bar")),
110
- style: j(u.value)
366
+ g("div", {
367
+ class: u(i(a).e("bar")),
368
+ style: j(d.value)
111
369
  }, null, 6)
112
370
  ], 2)
113
371
  ], 2),
114
- l.showText ? (c(), h("div", {
372
+ s.showText ? (h(), v("div", {
115
373
  key: 0,
116
- class: g(f(r).e("text"))
117
- }, A(t.value) + "% ", 3)) : S("", !0)
118
- ], 2)) : (c(), h("div", {
374
+ class: u(i(a).e("text"))
375
+ }, T(e.value) + "% ", 3)) : H("", !0)
376
+ ], 2)) : (h(), v("div", {
119
377
  key: 1,
120
- class: g(f(r).e("circle"))
378
+ class: u(i(a).e("circle"))
121
379
  }, [
122
- (c(), h("svg", {
123
- viewBox: `0 0 ${l.width} ${l.width}`,
124
- style: j({ width: `${l.width}px`, height: `${l.width}px` })
380
+ (h(), v("svg", {
381
+ viewBox: `0 0 ${s.width} ${s.width}`,
382
+ style: j({ width: `${s.width}px`, height: `${s.width}px` })
125
383
  }, [
126
- y("circle", {
127
- cx: l.width / 2,
128
- cy: l.width / 2,
129
- r: (l.width - l.strokeWidth) / 2,
384
+ g("circle", {
385
+ cx: s.width / 2,
386
+ cy: s.width / 2,
387
+ r: (s.width - s.strokeWidth) / 2,
130
388
  fill: "none",
131
- "stroke-width": l.strokeWidth,
389
+ "stroke-width": s.strokeWidth,
132
390
  stroke: "#ebeef5"
133
- }, null, 8, Ce),
134
- y("circle", {
135
- cx: l.width / 2,
136
- cy: l.width / 2,
137
- r: (l.width - l.strokeWidth) / 2,
391
+ }, null, 8, Ae),
392
+ g("circle", {
393
+ cx: s.width / 2,
394
+ cy: s.width / 2,
395
+ r: (s.width - s.strokeWidth) / 2,
138
396
  fill: "none",
139
- "stroke-width": l.strokeWidth,
140
- "stroke-dasharray": `${t.value / 100 * Math.PI * (l.width - l.strokeWidth)} ${Math.PI * (l.width - l.strokeWidth)}`,
141
- stroke: typeof l.color == "function" ? l.color(t.value) : l.color,
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,
142
400
  "stroke-linecap": "round",
143
401
  style: { transform: "rotate(-90deg)", "transform-origin": "center" }
144
- }, null, 8, we)
145
- ], 12, be)),
146
- l.showText ? (c(), h("div", {
402
+ }, null, 8, De)
403
+ ], 12, Le)),
404
+ s.showText ? (h(), v("div", {
147
405
  key: 0,
148
- class: g(f(r).e("circle-text"))
149
- }, A(t.value) + "% ", 3)) : S("", !0)
406
+ class: u(i(a).e("circle-text"))
407
+ }, T(e.value) + "% ", 3)) : H("", !0)
150
408
  ], 2))
151
409
  ], 2));
152
410
  }
153
- }), Ie = ["disabled"], $e = ["onClick"], Me = ["disabled"], Se = ["value"], Ke = ["value"], Ne = /* @__PURE__ */ G({
411
+ }), Ke = ["disabled"], He = ["onClick"], Ne = ["disabled"], Te = ["value"], Ve = ["value"], Ee = /* @__PURE__ */ Y({
154
412
  name: "XPagination",
155
413
  __name: "index",
156
414
  props: {
@@ -161,73 +419,73 @@ const pt = /* @__PURE__ */ G({
161
419
  layout: { default: "total, sizes, prev, pager, next, jumper" }
162
420
  },
163
421
  emits: ["update:currentPage", "update:pageSize", "current-change", "size-change"],
164
- setup(l, { emit: o }) {
165
- const r = l, t = o, u = Y("pagination"), i = P(r.currentPage), s = P(r.pageSize);
166
- q(() => r.currentPage, (w) => {
167
- i.value = w;
168
- }), q(() => r.pageSize, (w) => {
169
- s.value = w;
422
+ setup(s, { emit: r }) {
423
+ const a = s, e = r, d = 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;
170
428
  });
171
- const k = x(() => i.value), b = x(() => s.value), M = x(() => Math.max(1, Math.ceil(r.total / b.value))), C = x(() => {
172
- const w = [], $ = M.value, K = k.value;
173
- if ($ <= 7)
174
- for (let N = 1; N <= $; N++) w.push(N);
175
- else if (K <= 4) {
176
- for (let N = 1; N <= 5; N++) w.push(N);
177
- w.push(-1), w.push($);
178
- } else if (K >= $ - 3) {
179
- w.push(1), w.push(-1);
180
- for (let N = $ - 4; N <= $; N++) w.push(N);
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 D = 1; D <= C; D++) k.push(D);
433
+ else if (z <= 4) {
434
+ for (let D = 1; D <= 5; D++) k.push(D);
435
+ k.push(-1), k.push(C);
436
+ } else if (z >= C - 3) {
437
+ k.push(1), k.push(-1);
438
+ for (let D = C - 4; D <= C; D++) k.push(D);
181
439
  } else {
182
- w.push(1), w.push(-1);
183
- for (let N = K - 1; N <= K + 1; N++) w.push(N);
184
- w.push(-1), w.push($);
440
+ k.push(1), k.push(-1);
441
+ for (let D = z - 1; D <= z + 1; D++) k.push(D);
442
+ k.push(-1), k.push(C);
185
443
  }
186
- return w;
187
- }), T = (w) => {
188
- w < 1 || w > M.value || w === k.value || (i.value = w, t("update:currentPage", w), t("current-change", w));
189
- }, L = (w) => {
190
- s.value = w, t("update:pageSize", w), t("size-change", w), i.value = 1, t("update:currentPage", 1), t("current-change", 1);
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
+ }, A = (k) => {
448
+ l.value = k, e("update:pageSize", k), e("size-change", k), n.value = 1, e("update:currentPage", 1), e("current-change", 1);
191
449
  };
192
- return (w, $) => (c(), h("div", {
193
- class: g(f(u).b())
450
+ return (k, C) => (h(), v("div", {
451
+ class: u(i(d).b())
194
452
  }, [
195
- y("span", {
196
- class: g(f(u).e("total"))
197
- }, "共 " + A(l.total) + " 条", 3),
198
- y("button", {
199
- class: g(f(u).e("btn")),
200
- disabled: k.value <= 1,
201
- onClick: $[0] || ($[0] = (K) => T(k.value - 1))
202
- }, " ‹ ", 10, Ie),
203
- (c(!0), h(R, null, U(C.value, (K) => (c(), h(R, { key: K }, [
204
- K === -1 ? (c(), h("span", {
453
+ g("span", {
454
+ class: u(i(d).e("total"))
455
+ }, "共 " + T(s.total) + " 条", 3),
456
+ g("button", {
457
+ class: u(i(d).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", {
205
463
  key: 0,
206
- class: g(f(u).e("ellipsis"))
207
- }, "...", 2)) : (c(), h("button", {
464
+ class: u(i(d).e("ellipsis"))
465
+ }, "...", 2)) : (h(), v("button", {
208
466
  key: 1,
209
- class: g([f(u).e("btn"), f(u).is("active", K === k.value)]),
210
- onClick: (N) => T(K)
211
- }, A(K), 11, $e))
467
+ class: u([i(d).e("btn"), i(d).is("active", z === m.value)]),
468
+ onClick: (D) => N(z)
469
+ }, T(z), 11, He))
212
470
  ], 64))), 128)),
213
- y("button", {
214
- class: g(f(u).e("btn")),
215
- disabled: k.value >= M.value,
216
- onClick: $[1] || ($[1] = (K) => T(k.value + 1))
217
- }, " › ", 10, Me),
218
- y("select", {
219
- class: g(f(u).e("sizes")),
220
- value: b.value,
221
- onChange: $[2] || ($[2] = (K) => L(Number(K.target.value)))
471
+ g("button", {
472
+ class: u(i(d).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(d).e("sizes")),
478
+ value: y.value,
479
+ onChange: C[2] || (C[2] = (z) => A(Number(z.target.value)))
222
480
  }, [
223
- (c(!0), h(R, null, U(l.pageSizes, (K) => (c(), h("option", {
224
- key: K,
225
- value: K
226
- }, A(K) + " 条/页", 9, Ke))), 128))
227
- ], 42, Se)
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)
228
486
  ], 2));
229
487
  }
230
- }), ze = { key: 0 }, De = ["checked", "indeterminate"], Ae = ["onClick"], Te = ["onClick"], Ee = ["checked", "onChange"], Le = ["onClick"], je = ["onClick"], Be = { key: 1 }, He = ["colspan"], vt = /* @__PURE__ */ G({
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({
231
489
  name: "XDynamicTable",
232
490
  __name: "index",
233
491
  props: {
@@ -249,408 +507,428 @@ const pt = /* @__PURE__ */ G({
249
507
  defaultSort: {}
250
508
  },
251
509
  emits: ["sort-change", "row-click", "row-dblclick", "selection-change", "select-all", "cell-click", "add-row", "delete-row", "update:data"],
252
- setup(l, { expose: o, emit: r }) {
253
- var I, n;
254
- const t = l, u = r, i = Y("dynamic-table");
255
- ue();
256
- const s = x({
257
- get: () => t.data,
258
- set: (e) => u("update:data", e)
259
- }), k = P({
260
- prop: ((I = t.defaultSort) == null ? void 0 : I.prop) || "",
261
- order: ((n = t.defaultSort) == null ? void 0 : n.order) || null
262
- }), b = P([]), M = P(!1), C = P(!1), T = x(() => {
263
- if (!k.value.prop || !k.value.order)
264
- return s.value;
265
- const { prop: e, order: a } = k.value;
266
- return [...s.value].sort((d, p) => {
267
- const m = d[e], D = p[e];
268
- if (m === D) return 0;
269
- const H = m > D ? 1 : -1;
270
- return a === "ascending" ? H : -H;
510
+ setup(s, { expose: r, emit: a }) {
511
+ var K, c;
512
+ const e = s, d = a, n = Q("dynamic-table");
513
+ fe();
514
+ const l = M({
515
+ get: () => e.data,
516
+ set: (t) => d("update:data", t)
517
+ }), m = V({
518
+ prop: ((K = e.defaultSort) == null ? void 0 : K.prop) || "",
519
+ order: ((c = e.defaultSort) == null ? void 0 : c.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;
271
529
  });
272
- }), L = x(() => {
273
- const e = {};
274
- return t.height && (e.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (e.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), e;
275
- }), w = x(() => {
276
- const e = typeof t.operationWidth == "number" ? `${t.operationWidth}px` : t.operationWidth;
277
- return { width: e, minWidth: e };
278
- }), $ = x(() => [
279
- i.b(),
280
- i.is("border", t.border),
281
- i.is("stripe", t.stripe),
282
- i.is("loading", t.loading)
283
- ]), K = (e) => {
284
- e.sortable && (k.value.prop === e.prop ? k.value.order === "ascending" ? k.value.order = "descending" : k.value.order === "descending" && (k.value.order = null, k.value.prop = "") : (k.value.prop = e.prop, k.value.order = "ascending"), u("sort-change", { ...k.value }));
285
- }, N = (e) => e.sortable ? k.value.prop !== e.prop ? i.is("sortable") : [
286
- i.is("sortable"),
287
- i.is(`sort-${k.value.order}`)
288
- ] : "", V = (e, a, d) => {
289
- const p = e[a.prop];
290
- return a.formatter ? a.formatter(e, a, p, d) : p ?? "";
291
- }, X = (e, a, d) => {
292
- u("row-click", e, a, d);
293
- }, E = (e, a, d) => {
294
- const p = d.target;
295
- u("cell-click", e, a, p, d);
296
- }, z = () => {
297
- M.value || C.value ? (b.value = [], M.value = !1, C.value = !1) : (b.value = [...s.value], M.value = !0, C.value = !1), u("select-all", b.value), u("selection-change", b.value);
298
- }, W = (e) => {
299
- const a = b.value.findIndex((d) => typeof t.rowKey == "function" ? t.rowKey(d) === t.rowKey(e) : t.rowKey ? d[t.rowKey] === e[t.rowKey] : d === e);
300
- a > -1 ? b.value.splice(a, 1) : b.value.push(e), M.value = b.value.length === s.value.length, C.value = b.value.length > 0 && b.value.length < s.value.length, u("selection-change", b.value);
301
- }, Z = (e) => b.value.some((a) => typeof t.rowKey == "function" ? t.rowKey(a) === t.rowKey(e) : t.rowKey ? a[t.rowKey] === e[t.rowKey] : a === e), O = (e) => {
302
- const a = {};
303
- return e.width && (a.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.minWidth && (a.minWidth = typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth), e.align && (a.textAlign = e.align), a;
304
- }, Q = (e) => {
305
- const a = e || {};
306
- t.columns.forEach((d) => {
307
- a[d.prop] === void 0 && (a[d.prop] = "");
308
- }), s.value = [...s.value, a], u("add-row", a);
309
- }, F = (e) => {
310
- const a = s.value[e];
311
- s.value = s.value.filter((d, p) => p !== e), u("delete-row", a, e);
530
+ }), A = 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"), d("sort-change", { ...m.value }));
543
+ }, D = (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
+ d("row-click", t, o, f);
551
+ }, S = (t, o, f) => {
552
+ const p = f.target;
553
+ d("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), d("select-all", y.value), d("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, d("selection-change", y.value);
559
+ }, U = (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], d("add-row", o);
567
+ }, ee = (t) => {
568
+ const o = l.value[t];
569
+ l.value = l.value.filter((f, p) => p !== t), d("delete-row", o, t);
312
570
  };
313
- return o({
571
+ return r({
314
572
  clearSelection: () => {
315
- b.value = [], M.value = !1, C.value = !1;
573
+ y.value = [], w.value = !1, x.value = !1;
316
574
  },
317
- getSelection: () => [...b.value],
318
- sortState: k,
319
- addRow: Q,
320
- deleteRow: F,
321
- getData: () => [...s.value]
322
- }), (e, a) => (c(), h("div", {
323
- class: g($.value)
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)
324
582
  }, [
325
- l.showAddButton ? (c(), h("div", {
583
+ s.showAddButton ? (h(), v("div", {
326
584
  key: 0,
327
- class: g(f(i).e("toolbar"))
585
+ class: u(i(n).e("toolbar"))
328
586
  }, [
329
- B(e.$slots, "toolbar", {}, () => [
330
- y("button", {
331
- class: g(f(i).e("add-btn")),
332
- onClick: a[0] || (a[0] = (d) => Q())
333
- }, [...a[2] || (a[2] = [
334
- y("span", { class: "add-icon" }, "+", -1),
335
- J(" 新增一行 ", -1)
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)
336
594
  ])], 2)
337
595
  ])
338
- ], 2)) : S("", !0),
339
- l.loading ? (c(), h("div", {
596
+ ], 2)) : H("", !0),
597
+ s.loading ? (h(), v("div", {
340
598
  key: 1,
341
- class: g(f(i).e("loading"))
342
- }, [...a[3] || (a[3] = [
343
- y("span", { class: "loading-spinner" }, null, -1),
344
- y("span", { class: "loading-text" }, "加载中...", -1)
345
- ])], 2)) : S("", !0),
346
- y("div", {
347
- class: g(f(i).e("wrapper")),
348
- style: j(L.value)
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(A.value)
349
607
  }, [
350
- y("table", null, [
351
- l.showHeader ? (c(), h("thead", ze, [
352
- y("tr", null, [
353
- l.rowKey ? (c(), h("th", {
608
+ g("table", null, [
609
+ s.showHeader ? (h(), v("thead", Be, [
610
+ g("tr", null, [
611
+ s.rowKey ? (h(), v("th", {
354
612
  key: 0,
355
- class: g([f(i).e("header-cell"), f(i).e("selection-cell")])
613
+ class: u([i(n).e("header-cell"), i(n).e("selection-cell")])
356
614
  }, [
357
- y("input", {
615
+ g("input", {
358
616
  type: "checkbox",
359
- checked: M.value,
360
- indeterminate: C.value,
361
- onChange: z
362
- }, null, 40, De)
363
- ], 2)) : S("", !0),
364
- l.showIndex ? (c(), h("th", {
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", {
365
623
  key: 1,
366
- class: g(f(i).e("header-cell")),
624
+ class: u(i(n).e("header-cell")),
367
625
  style: { width: "60px" }
368
- }, " 序号 ", 2)) : S("", !0),
369
- (c(!0), h(R, null, U(l.columns, (d) => (c(), h("th", {
370
- key: d.prop,
371
- class: g([f(i).e("header-cell"), N(d)]),
372
- style: j(O(d)),
373
- onClick: (p) => K(d)
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"), D(f)]),
630
+ style: j(B(f)),
631
+ onClick: (p) => z(f)
374
632
  }, [
375
- y("span", null, A(d.label), 1),
376
- d.sortable ? (c(), h("span", {
633
+ g("span", null, T(f.label), 1),
634
+ f.sortable ? (h(), v("span", {
377
635
  key: 0,
378
- class: g(f(i).e("sort-icon"))
379
- }, [...a[4] || (a[4] = [
380
- y("span", { class: "sort-arrow up" }, "▲", -1),
381
- y("span", { class: "sort-arrow down" }, "▼", -1)
382
- ])], 2)) : S("", !0)
383
- ], 14, Ae))), 128)),
384
- l.showOperation ? (c(), h("th", {
636
+ class: u(i(n).e("sort-icon"))
637
+ }, [
638
+ g("span", Pe, [
639
+ F(i(Z), {
640
+ name: "sort-up",
641
+ size: 12
642
+ })
643
+ ]),
644
+ g("span", We, [
645
+ F(i(Z), {
646
+ name: "sort-down",
647
+ size: 12
648
+ })
649
+ ])
650
+ ], 2)) : H("", !0)
651
+ ], 14, Re))), 128)),
652
+ s.showOperation ? (h(), v("th", {
385
653
  key: 2,
386
- class: g(f(i).e("header-cell")),
387
- style: j(w.value)
388
- }, A(l.operationLabel), 7)) : S("", !0)
654
+ class: u(i(n).e("header-cell")),
655
+ style: j(k.value)
656
+ }, T(s.operationLabel), 7)) : H("", !0)
389
657
  ])
390
- ])) : S("", !0),
391
- y("tbody", null, [
392
- (c(!0), h(R, null, U(T.value, (d, p) => (c(), h("tr", {
393
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(d) : d[l.rowKey] : p,
394
- class: g([f(i).e("row"), f(i).is("selected", Z(d))]),
395
- onClick: (m) => X(d, l.columns[0], m)
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", U(f))]),
663
+ onClick: ($) => I(f, s.columns[0], $)
396
664
  }, [
397
- l.rowKey ? (c(), h("td", {
665
+ s.rowKey ? (h(), v("td", {
398
666
  key: 0,
399
- class: g(f(i).e("cell"))
667
+ class: u(i(n).e("cell"))
400
668
  }, [
401
- y("input", {
669
+ g("input", {
402
670
  type: "checkbox",
403
- checked: Z(d),
404
- onClick: a[1] || (a[1] = de(() => {
671
+ checked: U(f),
672
+ onClick: o[1] || (o[1] = se(() => {
405
673
  }, ["stop"])),
406
- onChange: (m) => W(d)
407
- }, null, 40, Ee)
408
- ], 2)) : S("", !0),
409
- l.showIndex ? (c(), h("td", {
674
+ onChange: ($) => R(f)
675
+ }, null, 40, Ye)
676
+ ], 2)) : H("", !0),
677
+ s.showIndex ? (h(), v("td", {
410
678
  key: 1,
411
- class: g(f(i).e("cell"))
412
- }, A(p + 1), 3)) : S("", !0),
413
- (c(!0), h(R, null, U(l.columns, (m) => (c(), h("td", {
414
- key: m.prop,
415
- class: g(f(i).e("cell")),
416
- style: j(O(m)),
417
- onClick: (D) => E(d, m, D)
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)
418
686
  }, [
419
- B(e.$slots, `column-${m.prop}`, {
420
- row: d,
421
- column: m,
687
+ E(t.$slots, `column-${$.prop}`, {
688
+ row: f,
689
+ column: $,
422
690
  $index: p
423
691
  }, () => [
424
- J(A(V(d, m, p)), 1)
692
+ q(T(W(f, $, p)), 1)
425
693
  ])
426
- ], 14, Le))), 128)),
427
- l.showOperation ? (c(), h("td", {
694
+ ], 14, Xe))), 128)),
695
+ s.showOperation ? (h(), v("td", {
428
696
  key: 2,
429
- class: g([f(i).e("cell"), f(i).e("operation-cell")])
697
+ class: u([i(n).e("cell"), i(n).e("operation-cell")])
430
698
  }, [
431
- B(e.$slots, "operation", {
432
- row: d,
699
+ E(t.$slots, "operation", {
700
+ row: f,
433
701
  $index: p,
434
- deleteRow: () => F(p)
702
+ deleteRow: () => ee(p)
435
703
  }, () => [
436
- y("button", {
437
- class: g(f(i).e("operation-btn")),
438
- onClick: de((m) => F(p), ["stop"])
439
- }, " 删除 ", 10, je)
704
+ g("button", {
705
+ class: u(i(n).e("operation-btn")),
706
+ onClick: se(($) => ee(p), ["stop"])
707
+ }, " 删除 ", 10, Qe)
440
708
  ])
441
- ], 2)) : S("", !0)
442
- ], 10, Te))), 128))
709
+ ], 2)) : H("", !0)
710
+ ], 10, Oe))), 128))
443
711
  ]),
444
- T.value.length === 0 && !l.loading ? (c(), h("tbody", Be, [
445
- y("tr", null, [
446
- y("td", {
447
- colspan: l.columns.length + (l.rowKey ? 1 : 0) + (l.showIndex ? 1 : 0) + (l.showOperation ? 1 : 0),
448
- class: g(f(i).e("empty"))
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"))
449
717
  }, [
450
- B(e.$slots, "empty", {}, () => [
451
- J(A(l.emptyText), 1)
718
+ E(t.$slots, "empty", {}, () => [
719
+ q(T(s.emptyText), 1)
452
720
  ])
453
- ], 10, He)
721
+ ], 10, Ze)
454
722
  ])
455
- ])) : S("", !0)
723
+ ])) : H("", !0)
456
724
  ])
457
725
  ], 6)
458
726
  ], 2));
459
727
  }
460
- }), Pe = ["draggable"], We = {
728
+ }), Ue = ["draggable"], Fe = {
461
729
  key: 0,
462
730
  class: "x-tree-node__loading-icon"
463
- }, Re = {
731
+ }, Je = {
464
732
  key: 0,
465
733
  class: "x-tree-node__expand-arrow"
466
- }, Oe = {
734
+ }, qe = {
467
735
  key: 0,
468
736
  class: "x-tree-node__icon"
469
- }, Ge = { class: "x-tree-node__label" }, Ye = /* @__PURE__ */ G({
737
+ }, _e = { class: "x-tree-node__label" }, et = /* @__PURE__ */ Y({
470
738
  name: "XTreeNode",
471
739
  __name: "tree-node",
472
740
  props: {
473
741
  node: {}
474
742
  },
475
- setup(l) {
476
- const o = l, r = oe("tree"), { props: t, store: u, toggleExpand: i, toggleCheck: s, handleNodeClick: k, handleNodeContextmenu: b } = r, M = P(), C = P(null), T = x(() => o.node.expanded), L = x(() => o.node.checked), w = x(() => o.node.indeterminate), $ = x(() => o.node.disabled), K = x(() => o.node.loading), N = x(() => o.node.isLeaf), V = x(() => t.showCheckbox || t.checkable), X = x(() => o.node.selected), E = x(() => ({
477
- paddingLeft: `${o.node.level * (t.indent || 16)}px`
478
- })), z = (n) => {
479
- k(o.node, n);
480
- }, W = (n) => {
481
- b(o.node, n);
482
- }, Z = (n) => {
483
- n.stopPropagation(), $.value || i(o.node);
484
- }, O = (n) => {
485
- n.stopPropagation(), $.value || s(o.node);
486
- }, Q = (n) => {
487
- var e;
488
- if (!(!t.draggable || $.value)) {
489
- if (t.allowDrag && !t.allowDrag(o.node)) {
490
- n.preventDefault();
743
+ setup(s) {
744
+ const r = s, a = de("tree"), { props: e, store: d, toggleExpand: n, toggleCheck: l, handleNodeClick: m, handleNodeContextmenu: y } = a, w = V(), x = V(null), N = M(() => r.node.expanded), A = M(() => r.node.checked), k = M(() => r.node.indeterminate), C = M(() => r.node.disabled), z = M(() => r.node.loading), D = 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 = (c) => {
747
+ m(r.node, c);
748
+ }, R = (c) => {
749
+ y(r.node, c);
750
+ }, U = (c) => {
751
+ c.stopPropagation(), C.value || n(r.node);
752
+ }, B = (c) => {
753
+ c.stopPropagation(), C.value || l(r.node);
754
+ }, O = (c) => {
755
+ var t;
756
+ if (!(!e.draggable || C.value)) {
757
+ if (e.allowDrag && !e.allowDrag(r.node)) {
758
+ c.preventDefault();
491
759
  return;
492
760
  }
493
- n.dataTransfer.effectAllowed = "move", n.dataTransfer.setData("nodeKey", String(o.node.key)), (e = r.emit) == null || e.call(r, "node-drag-start", o.node, n);
761
+ c.dataTransfer.effectAllowed = "move", c.dataTransfer.setData("nodeKey", String(r.node.key)), (t = a.emit) == null || t.call(a, "node-drag-start", r.node, c);
494
762
  }
495
- }, F = (n) => {
496
- var e;
497
- n.preventDefault(), t.draggable && (C.value = "inner", (e = r.emit) == null || e.call(r, "node-drag-enter", o.node, n));
498
- }, _ = (n) => {
499
- var e;
500
- C.value = null, (e = r.emit) == null || e.call(r, "node-drag-leave", o.node, n);
501
- }, ae = (n) => {
502
- var p, m;
503
- if (n.preventDefault(), !t.draggable || $.value) return;
504
- const e = (p = M.value) == null ? void 0 : p.getBoundingClientRect();
505
- if (!e) return;
506
- const a = n.clientY - e.top, d = e.height;
507
- a < d * 0.25 ? C.value = "prev" : a > d * 0.75 ? C.value = "next" : C.value = "inner", (m = r.emit) == null || m.call(r, "node-drag-over", o.node, n);
508
- }, v = (n) => {
509
- var a, d;
510
- if (n.preventDefault(), !t.draggable) return;
511
- const e = (a = n.dataTransfer) == null ? void 0 : a.getData("nodeKey");
512
- if (e) {
513
- const p = u.nodesMap.get(e);
514
- if (p && C.value) {
515
- if (t.allowDrop && !t.allowDrop(p, o.node, C.value)) {
516
- C.value = null;
763
+ }, ee = (c) => {
764
+ var t;
765
+ c.preventDefault(), e.draggable && (x.value = "inner", (t = a.emit) == null || t.call(a, "node-drag-enter", r.node, c));
766
+ }, ae = (c) => {
767
+ var t;
768
+ x.value = null, (t = a.emit) == null || t.call(a, "node-drag-leave", r.node, c);
769
+ }, oe = (c) => {
770
+ var p, $;
771
+ if (c.preventDefault(), !e.draggable || C.value) return;
772
+ const t = (p = w.value) == null ? void 0 : p.getBoundingClientRect();
773
+ if (!t) return;
774
+ const o = c.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, c);
776
+ }, b = (c) => {
777
+ var o, f;
778
+ if (c.preventDefault(), !e.draggable) return;
779
+ const t = (o = c.dataTransfer) == null ? void 0 : o.getData("nodeKey");
780
+ if (t) {
781
+ const p = d.nodesMap.get(t);
782
+ if (p && x.value) {
783
+ if (e.allowDrop && !e.allowDrop(p, r.node, x.value)) {
784
+ x.value = null;
517
785
  return;
518
786
  }
519
- (d = r.emit) == null || d.call(r, "node-drop", p, o.node, C.value, n);
787
+ (f = a.emit) == null || f.call(a, "node-drop", p, r.node, x.value, c);
520
788
  }
521
789
  }
522
- C.value = null;
523
- }, I = (n) => {
524
- var e;
525
- C.value = null, (e = r.emit) == null || e.call(r, "node-drag-end", o.node, n);
790
+ x.value = null;
791
+ }, K = (c) => {
792
+ var t;
793
+ x.value = null, (t = a.emit) == null || t.call(a, "node-drag-end", r.node, c);
526
794
  };
527
- return (n, e) => {
528
- var d;
529
- const a = ye("TreeNode", !0);
530
- return ve((c(), h("div", {
795
+ return (c, t) => {
796
+ var f;
797
+ const o = we("TreeNode", !0);
798
+ return pe((h(), v("div", {
531
799
  ref_key: "nodeRef",
532
- ref: M,
533
- class: g(["x-tree-node", {
534
- "is-expanded": T.value,
535
- "is-current": n.isCurrent,
536
- "is-selected": X.value,
537
- "is-disabled": $.value,
538
- "is-drop-inner": C.value === "inner",
539
- "is-drop-prev": C.value === "prev",
540
- "is-drop-next": C.value === "next"
800
+ ref: w,
801
+ class: u(["x-tree-node", {
802
+ "is-expanded": N.value,
803
+ "is-current": c.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"
541
809
  }]),
542
- draggable: f(t).draggable && !$.value,
543
- onDragstart: Q,
544
- onDragenter: F,
545
- onDragleave: _,
546
- onDragover: ae,
547
- onDrop: v,
548
- onDragend: I
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
549
817
  }, [
550
- y("div", {
818
+ g("div", {
551
819
  class: "x-tree-node__content",
552
- style: j(E.value),
553
- onClick: z,
554
- onContextmenu: W
820
+ style: j(S.value),
821
+ onClick: L,
822
+ onContextmenu: R
555
823
  }, [
556
- y("span", {
557
- class: g(["x-tree-node__expand-icon", {
558
- "is-expanded": T.value,
559
- "is-leaf": N.value,
560
- "is-loading": K.value
824
+ g("span", {
825
+ class: u(["x-tree-node__expand-icon", {
826
+ "is-expanded": N.value,
827
+ "is-leaf": D.value,
828
+ "is-loading": z.value
561
829
  }]),
562
- onClick: Z
830
+ onClick: U
563
831
  }, [
564
- K.value ? (c(), h("span", We)) : (c(), h(R, { key: 1 }, [
565
- N.value ? S("", !0) : (c(), h("span", Re))
832
+ z.value ? (h(), v("span", Fe)) : (h(), v(G, { key: 1 }, [
833
+ D.value ? H("", !0) : (h(), v("span", Je))
566
834
  ], 64))
567
835
  ], 2),
568
- l.node.icon || f(t).icon ? (c(), h("span", Oe, A(l.node.icon || f(t).icon), 1)) : S("", !0),
569
- V.value ? (c(), h("span", {
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", {
570
838
  key: 1,
571
- class: g(["x-tree-node__checkbox", {
572
- "is-checked": L.value,
573
- "is-indeterminate": w.value,
574
- "is-disabled": $.value
839
+ class: u(["x-tree-node__checkbox", {
840
+ "is-checked": A.value,
841
+ "is-indeterminate": k.value,
842
+ "is-disabled": C.value
575
843
  }]),
576
- onClick: de(O, ["stop"])
577
- }, [...e[0] || (e[0] = [
578
- y("span", { class: "x-tree-node__checkbox-inner" }, null, -1)
579
- ])], 2)) : S("", !0),
580
- y("span", Ge, [
581
- B(n.$slots, "default", {
582
- node: l.node,
583
- data: l.node.data
844
+ onClick: se(B, ["stop"])
845
+ }, [
846
+ A.value ? (h(), te(i(Z), {
847
+ key: 0,
848
+ name: "check",
849
+ size: 12,
850
+ class: "x-tree-node__checkbox-icon"
851
+ })) : k.value ? (h(), te(i(Z), {
852
+ key: 1,
853
+ name: "minus",
854
+ size: 12,
855
+ class: "x-tree-node__checkbox-icon"
856
+ })) : H("", !0)
857
+ ], 2)) : H("", !0),
858
+ g("span", _e, [
859
+ E(c.$slots, "default", {
860
+ node: s.node,
861
+ data: s.node.data
584
862
  }, () => [
585
- J(A(l.node.label), 1)
863
+ q(T(s.node.label), 1)
586
864
  ])
587
865
  ])
588
866
  ], 36),
589
- !N.value && T.value ? (c(), h("div", {
867
+ !D.value && N.value ? (h(), v("div", {
590
868
  key: 0,
591
- class: g(["x-tree-node__children", { "x-tree-node__children--show-line": f(t).showLine }])
869
+ class: u(["x-tree-node__children", { "x-tree-node__children--show-line": i(e).showLine }])
592
870
  }, [
593
- !f(t).renderAfterExpand || T.value ? (c(!0), h(R, { key: 0 }, U(l.node.children, (p) => (c(), se(a, {
871
+ !i(e).renderAfterExpand || N.value ? (h(!0), v(G, { key: 0 }, J(s.node.children, (p) => (h(), te(o, {
594
872
  key: p.key,
595
873
  node: p
596
874
  }, {
597
- default: he((m) => [
598
- B(n.$slots, "default", {
599
- node: m.node,
600
- data: m.data
875
+ default: ve(($) => [
876
+ E(c.$slots, "default", {
877
+ node: $.node,
878
+ data: $.data
601
879
  })
602
880
  ]),
603
881
  _: 3
604
- }, 8, ["node"]))), 128)) : S("", !0)
605
- ], 2)) : S("", !0)
606
- ], 42, Pe)), [
607
- [me, l.node.visible && (((d = l.node.parent) == null ? void 0 : d.expanded) ?? !0)]
882
+ }, 8, ["node"]))), 128)) : H("", !0)
883
+ ], 2)) : H("", !0)
884
+ ], 42, Ue)), [
885
+ [me, s.node.visible && (((f = s.node.parent) == null ? void 0 : f.expanded) ?? !0)]
608
886
  ]);
609
887
  };
610
888
  }
611
889
  });
612
- class te {
613
- constructor(o, r, t = 0, u = null) {
614
- this.data = o, this.store = r, this.level = t, this.parent = u, this.children = [], this.expanded = !1, this.selected = !1, this.checked = !1, this.indeterminate = !1, this.loading = !1, this.visible = !0, this.loaded = !1;
615
- const i = r.props || {}, s = i.value || "value", k = i.label || "label", b = i.disabled || "disabled", M = i.isLeaf || "isLeaf";
616
- this.key = o[s] ?? o.value ?? o.id ?? Math.random().toString(), this.label = o[k] ?? o.label ?? "", this.disabled = o[b] ?? o.disabled ?? !1, this.isLeaf = o[M] ?? o.isLeaf ?? !1;
617
- const C = i.children || "children", T = o[C] ?? o.children ?? [];
618
- T.length > 0 ? this.children = T.map(
619
- (L) => new te(L, r, t + 1, this)
890
+ class ne {
891
+ constructor(r, a, e = 0, d = null) {
892
+ this.data = r, this.store = a, this.level = e, this.parent = d, 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
+ (A) => new ne(A, a, e + 1, this)
620
898
  ) : this.isLeaf = !0;
621
899
  }
622
900
  /** 设置展开状态 */
623
- setExpanded(o, r = !0) {
624
- this.expanded = o, o ? this.store.expandedKeys.add(this.key) : this.store.expandedKeys.delete(this.key);
901
+ setExpanded(r, a = !0) {
902
+ this.expanded = r, r ? this.store.expandedKeys.add(this.key) : this.store.expandedKeys.delete(this.key);
625
903
  }
626
904
  /** 设置选中状态 */
627
- setSelected(o) {
628
- this.selected = o, o ? this.store.selectedKeys.add(this.key) : this.store.selectedKeys.delete(this.key);
905
+ setSelected(r) {
906
+ this.selected = r, r ? this.store.selectedKeys.add(this.key) : this.store.selectedKeys.delete(this.key);
629
907
  }
630
908
  /** 设置勾选状态 */
631
- setChecked(o, r = !0, t = !0) {
632
- 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)), r && (this.updateChildrenChecked(o), this.updateParentChecked());
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());
633
911
  }
634
912
  /** 更新子节点勾选状态 */
635
- updateChildrenChecked(o) {
636
- const r = (t) => {
637
- t.children.forEach((u) => {
638
- u.disabled || (u.checked = o, u.indeterminate = !1, o ? (this.store.checkedKeys.add(u.key), this.store.indeterminateKeys.delete(u.key)) : (this.store.checkedKeys.delete(u.key), this.store.indeterminateKeys.delete(u.key)), r(u));
913
+ updateChildrenChecked(r) {
914
+ const a = (e) => {
915
+ e.children.forEach((d) => {
916
+ d.disabled || (d.checked = r, d.indeterminate = !1, r ? (this.store.checkedKeys.add(d.key), this.store.indeterminateKeys.delete(d.key)) : (this.store.checkedKeys.delete(d.key), this.store.indeterminateKeys.delete(d.key)), a(d));
639
917
  });
640
918
  };
641
- r(this);
919
+ a(this);
642
920
  }
643
921
  /** 更新父节点勾选状态 */
644
922
  updateParentChecked() {
645
- let o = this.parent;
646
- for (; o; ) {
647
- const r = o.children.filter((i) => !i.disabled);
648
- if (r.length === 0) {
649
- o = o.parent;
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;
650
928
  continue;
651
929
  }
652
- const t = r.every((i) => i.checked), u = r.some((i) => i.checked || i.indeterminate);
653
- t ? (o.checked = !0, o.indeterminate = !1, this.store.checkedKeys.add(o.key), this.store.indeterminateKeys.delete(o.key)) : u ? (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;
930
+ const e = a.every((n) => n.checked), d = 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)) : d ? (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;
654
932
  }
655
933
  }
656
934
  /** 展开/收起 */
@@ -667,23 +945,23 @@ class te {
667
945
  }
668
946
  /** 获取所有父节点的 key */
669
947
  getParentKeys() {
670
- const o = [];
671
- let r = this.parent;
672
- for (; r; )
673
- o.push(r.key), r = r.parent;
674
- return o;
948
+ const r = [];
949
+ let a = this.parent;
950
+ for (; a; )
951
+ r.push(a.key), a = a.parent;
952
+ return r;
675
953
  }
676
954
  /** 获取所有子节点的 key */
677
955
  getChildrenKeys() {
678
- const o = [], r = (t) => {
679
- t.forEach((u) => {
680
- o.push(u.key), u.children.length && r(u.children);
956
+ const r = [], a = (e) => {
957
+ e.forEach((d) => {
958
+ r.push(d.key), d.children.length && a(d.children);
681
959
  });
682
960
  };
683
- return r(this.children), o;
961
+ return a(this.children), r;
684
962
  }
685
963
  }
686
- const mt = /* @__PURE__ */ G({
964
+ const Ht = /* @__PURE__ */ Y({
687
965
  name: "XTree",
688
966
  __name: "index",
689
967
  props: {
@@ -724,8 +1002,8 @@ const mt = /* @__PURE__ */ G({
724
1002
  checkable: { type: Boolean }
725
1003
  },
726
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"],
727
- setup(l, { expose: o, emit: r }) {
728
- const t = l, u = r, i = Y("tree"), s = fe({
1005
+ setup(s, { expose: r, emit: a }) {
1006
+ const e = s, d = a, n = Q("tree"), l = ge({
729
1007
  nodesMap: /* @__PURE__ */ new Map(),
730
1008
  rootNodes: [],
731
1009
  expandedKeys: /* @__PURE__ */ new Set(),
@@ -734,258 +1012,258 @@ const mt = /* @__PURE__ */ G({
734
1012
  indeterminateKeys: /* @__PURE__ */ new Set(),
735
1013
  currentKey: null,
736
1014
  filterValue: ""
737
- }), k = P(""), b = () => t.fieldNames ? {
738
- value: t.fieldNames.key || "value",
739
- label: t.fieldNames.title || t.fieldNames.key || "label",
740
- children: t.fieldNames.children || "children",
741
- disabled: t.fieldNames.disabled || "disabled",
742
- isLeaf: t.fieldNames.isLeaf || "isLeaf"
743
- } : t.props, M = () => t.treeData || t.data || [];
744
- s.props = b();
745
- const C = (n) => {
746
- if (s.nodesMap.clear(), s.rootNodes = [], s.checkedKeys.clear(), s.indeterminateKeys.clear(), !n || !n.length) return;
747
- const e = b(), a = (d, p, m) => {
748
- const D = new te(d, s, p, m);
749
- s.nodesMap.set(D.key, D);
750
- const H = (e == null ? void 0 : e.children) || "children", ee = d[H] ?? d.children ?? [];
751
- return ee.length > 0 && (D.children = ee.map(
752
- (ne) => a(ne, p + 1, D)
753
- ), D.isLeaf = !1), D;
1015
+ }), m = V(""), y = () => e.fieldNames ? {
1016
+ value: e.fieldNames.key || "value",
1017
+ label: e.fieldNames.title || e.fieldNames.key || "label",
1018
+ children: e.fieldNames.children || "children",
1019
+ disabled: e.fieldNames.disabled || "disabled",
1020
+ isLeaf: e.fieldNames.isLeaf || "isLeaf"
1021
+ } : e.props, w = () => e.treeData || e.data || [];
1022
+ l.props = y();
1023
+ const x = (c) => {
1024
+ if (l.nodesMap.clear(), l.rootNodes = [], l.checkedKeys.clear(), l.indeterminateKeys.clear(), !c || !c.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
+ (ce) => o(ce, p + 1, P)
1031
+ ), P.isLeaf = !1), P;
754
1032
  };
755
- s.rootNodes = n.map((d) => a(d, 0, null)), T();
756
- }, T = () => {
757
- var n, e, a;
758
- t.defaultExpandAll ? L() : (n = t.defaultExpandedKeys) != null && n.length && t.defaultExpandedKeys.forEach((d) => {
759
- const p = s.nodesMap.get(d);
760
- p && (p.expanded = !0, s.expandedKeys.add(d));
761
- }), (e = t.defaultCheckedKeys) != null && e.length && t.defaultCheckedKeys.forEach((d) => {
762
- const p = s.nodesMap.get(d);
763
- p && p.setChecked(!0, !t.checkStrictly);
764
- }), (a = t.checkedKeys) != null && a.length && t.checkedKeys.forEach((d) => {
765
- const p = s.nodesMap.get(d);
766
- p && p.setChecked(!0, !t.checkStrictly);
1033
+ l.rootNodes = c.map((f) => o(f, 0, null)), N();
1034
+ }, N = () => {
1035
+ var c, t, o;
1036
+ e.defaultExpandAll ? A() : (c = e.defaultExpandedKeys) != null && c.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);
767
1045
  });
768
- }, L = () => {
769
- s.nodesMap.forEach((n) => {
770
- n.children.length > 0 && (n.expanded = !0, s.expandedKeys.add(n.key));
1046
+ }, A = () => {
1047
+ l.nodesMap.forEach((c) => {
1048
+ c.children.length > 0 && (c.expanded = !0, l.expandedKeys.add(c.key));
771
1049
  });
772
- }, w = () => {
773
- s.nodesMap.forEach((n) => {
774
- n.expanded = !1;
775
- }), s.expandedKeys.clear();
776
- }, $ = (n) => {
777
- if (n.disabled) return;
778
- !n.expanded ? (n.expanded = !0, s.expandedKeys.add(n.key), u("node-expand", n.data, n, null)) : (n.expanded = !1, s.expandedKeys.delete(n.key), u("node-collapse", n.data, n, null));
779
- }, K = (n, e) => {
780
- if (n.disabled) return;
781
- const a = e ?? !n.checked;
782
- n.setChecked(a, !t.checkStrictly), u("check-change", n.data, n.checked, n.indeterminate);
783
- const d = [], p = [], m = [], D = [];
784
- s.nodesMap.forEach((H) => {
785
- H.checked && (d.push(H.data), p.push(H.key)), H.indeterminate && (m.push(H.data), D.push(H.key));
786
- }), u("check", n.data, {
787
- checkedNodes: d,
1050
+ }, k = () => {
1051
+ l.nodesMap.forEach((c) => {
1052
+ c.expanded = !1;
1053
+ }), l.expandedKeys.clear();
1054
+ }, C = (c) => {
1055
+ if (c.disabled) return;
1056
+ !c.expanded ? (c.expanded = !0, l.expandedKeys.add(c.key), d("node-expand", c.data, c, null)) : (c.expanded = !1, l.expandedKeys.delete(c.key), d("node-collapse", c.data, c, null));
1057
+ }, z = (c, t) => {
1058
+ if (c.disabled) return;
1059
+ const o = t ?? !c.checked;
1060
+ c.setChecked(o, !e.checkStrictly), d("check-change", c.data, c.checked, c.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
+ }), d("check", c.data, {
1065
+ checkedNodes: f,
788
1066
  checkedKeys: p,
789
- halfCheckedNodes: m,
790
- halfCheckedKeys: D
1067
+ halfCheckedNodes: $,
1068
+ halfCheckedKeys: P
791
1069
  });
792
- }, N = (n, e) => {
793
- n.disabled || (u("node-click", n.data, n, null), t.expandOnClickNode && n.children.length > 0 && $(n), t.highlightCurrent && (s.currentKey = n.key, u("current-change", n.data, n)));
794
- }, V = (n) => {
795
- if (k.value = n, s.filterValue = n, !n) {
796
- s.nodesMap.forEach((e) => {
797
- e.visible = !0;
1070
+ }, D = (c, t) => {
1071
+ c.disabled || (d("node-click", c.data, c, null), e.expandOnClickNode && c.children.length > 0 && C(c), e.highlightCurrent && (l.currentKey = c.key, d("current-change", c.data, c)));
1072
+ }, W = (c) => {
1073
+ if (m.value = c, l.filterValue = c, !c) {
1074
+ l.nodesMap.forEach((t) => {
1075
+ t.visible = !0;
798
1076
  });
799
1077
  return;
800
1078
  }
801
- s.nodesMap.forEach((e) => {
802
- const a = e.label || "";
803
- e.visible = String(a).toLowerCase().includes(n.toLowerCase());
804
- }), s.nodesMap.forEach((e) => {
805
- if (e.visible && e.parent) {
806
- let a = e.parent;
807
- for (; a; )
808
- a.visible = !0, a.expanded = !0, s.expandedKeys.add(a.key), a = a.parent;
1079
+ l.nodesMap.forEach((t) => {
1080
+ const o = t.label || "";
1081
+ t.visible = String(o).toLowerCase().includes(c.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;
809
1087
  }
810
1088
  });
811
- }, X = (n) => s.nodesMap.get(n), E = (n) => {
812
- s.currentKey = n;
813
- }, z = () => {
814
- if (s.currentKey)
815
- return s.nodesMap.get(s.currentKey);
816
- }, W = (n = !1) => {
817
- const e = [];
818
- return s.nodesMap.forEach((a) => {
819
- a.checked && (!n || a.isLeaf) && e.push(a.data);
820
- }), e;
821
- }, Z = (n = !1) => {
822
- const e = [];
823
- return s.nodesMap.forEach((a) => {
824
- a.checked && (!n || a.isLeaf) && e.push(a.key);
825
- }), e;
826
- }, O = (n) => {
827
- s.nodesMap.forEach((e) => {
828
- e.checked = !1, e.indeterminate = !1;
829
- }), s.checkedKeys.clear(), s.indeterminateKeys.clear(), n.forEach((e) => {
830
- const a = s.nodesMap.get(e);
831
- a && a.setChecked(!0, !t.checkStrictly);
1089
+ }, I = (c) => l.nodesMap.get(c), S = (c) => {
1090
+ l.currentKey = c;
1091
+ }, L = () => {
1092
+ if (l.currentKey)
1093
+ return l.nodesMap.get(l.currentKey);
1094
+ }, R = (c = !1) => {
1095
+ const t = [];
1096
+ return l.nodesMap.forEach((o) => {
1097
+ o.checked && (!c || o.isLeaf) && t.push(o.data);
1098
+ }), t;
1099
+ }, U = (c = !1) => {
1100
+ const t = [];
1101
+ return l.nodesMap.forEach((o) => {
1102
+ o.checked && (!c || o.isLeaf) && t.push(o.key);
1103
+ }), t;
1104
+ }, B = (c) => {
1105
+ l.nodesMap.forEach((t) => {
1106
+ t.checked = !1, t.indeterminate = !1;
1107
+ }), l.checkedKeys.clear(), l.indeterminateKeys.clear(), c.forEach((t) => {
1108
+ const o = l.nodesMap.get(t);
1109
+ o && o.setChecked(!0, !e.checkStrictly);
832
1110
  });
833
- }, Q = () => {
834
- const n = [];
835
- return s.nodesMap.forEach((e) => {
836
- e.indeterminate && n.push(e.data);
837
- }), n;
838
- }, F = () => {
839
- const n = [];
840
- return s.nodesMap.forEach((e) => {
841
- e.indeterminate && n.push(e.key);
842
- }), n;
843
- }, _ = (n, e, a = !0) => {
844
- const d = s.nodesMap.get(n);
845
- d && d.setChecked(e, a && !t.checkStrictly);
846
- }, ae = () => {
847
- const n = [];
848
- return s.nodesMap.forEach((e) => {
849
- e.selected && n.push(e.data);
850
- }), n;
851
- }, v = (n) => {
852
- s.nodesMap.forEach((e) => {
853
- e.selected = !1;
854
- }), s.selectedKeys.clear(), n.forEach((e) => {
855
- const a = s.nodesMap.get(e);
856
- a && (a.selected = !0, s.selectedKeys.add(e));
1111
+ }, O = () => {
1112
+ const c = [];
1113
+ return l.nodesMap.forEach((t) => {
1114
+ t.indeterminate && c.push(t.data);
1115
+ }), c;
1116
+ }, ee = () => {
1117
+ const c = [];
1118
+ return l.nodesMap.forEach((t) => {
1119
+ t.indeterminate && c.push(t.key);
1120
+ }), c;
1121
+ }, ae = (c, t, o = !0) => {
1122
+ const f = l.nodesMap.get(c);
1123
+ f && f.setChecked(t, o && !e.checkStrictly);
1124
+ }, oe = () => {
1125
+ const c = [];
1126
+ return l.nodesMap.forEach((t) => {
1127
+ t.selected && c.push(t.data);
1128
+ }), c;
1129
+ }, b = (c) => {
1130
+ l.nodesMap.forEach((t) => {
1131
+ t.selected = !1;
1132
+ }), l.selectedKeys.clear(), c.forEach((t) => {
1133
+ const o = l.nodesMap.get(t);
1134
+ o && (o.selected = !0, l.selectedKeys.add(t));
857
1135
  });
858
- }, I = x(() => t.showCheckbox || t.checkable);
859
- return le("tree", {
860
- props: t,
861
- store: s,
862
- emit: u,
863
- toggleExpand: $,
864
- toggleCheck: K,
865
- handleNodeClick: N,
866
- filterValue: ke(k),
867
- showCheckboxComputed: I
868
- }), o({
869
- filter: V,
870
- getNode: X,
871
- setCurrentKey: E,
872
- getCurrentKey: () => s.currentKey,
873
- getCurrentNode: z,
874
- getCheckedNodes: W,
875
- getCheckedKeys: Z,
876
- setCheckedKeys: O,
877
- getHalfCheckedNodes: Q,
878
- getHalfCheckedKeys: F,
879
- setChecked: _,
880
- getSelectedNodes: ae,
881
- setSelectedKeys: v,
882
- expandAll: L,
883
- collapseAll: w,
1136
+ }, K = M(() => e.showCheckbox || e.checkable);
1137
+ return ie("tree", {
1138
+ props: e,
1139
+ store: l,
1140
+ emit: d,
1141
+ toggleExpand: C,
1142
+ toggleCheck: z,
1143
+ handleNodeClick: D,
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: U,
1154
+ setCheckedKeys: B,
1155
+ getHalfCheckedNodes: O,
1156
+ getHalfCheckedKeys: ee,
1157
+ setChecked: ae,
1158
+ getSelectedNodes: oe,
1159
+ setSelectedKeys: b,
1160
+ expandAll: A,
1161
+ collapseAll: k,
884
1162
  // 额外方法
885
- updateKeyChildren: (n, e) => {
886
- const a = s.nodesMap.get(n);
887
- a && (a.children.forEach((d) => {
888
- s.nodesMap.delete(d.key);
889
- }), a.children = e.map((d) => {
890
- const p = new te(d, s, a.level + 1, a);
891
- return s.nodesMap.set(p.key, p), p;
892
- }), a.isLeaf = a.children.length === 0);
1163
+ updateKeyChildren: (c, t) => {
1164
+ const o = l.nodesMap.get(c);
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);
893
1171
  },
894
- remove: (n) => {
895
- const e = s.nodesMap.get(n);
896
- if (e) {
897
- const a = e.parent;
898
- if (a) {
899
- const p = a.children.indexOf(e);
900
- p > -1 && a.children.splice(p, 1), a.children.length === 0 && (a.isLeaf = !0);
1172
+ remove: (c) => {
1173
+ const t = l.nodesMap.get(c);
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);
901
1179
  } else {
902
- const p = s.rootNodes.indexOf(e);
903
- p > -1 && s.rootNodes.splice(p, 1);
1180
+ const p = l.rootNodes.indexOf(t);
1181
+ p > -1 && l.rootNodes.splice(p, 1);
904
1182
  }
905
- const d = (p) => {
906
- s.nodesMap.delete(p.key), p.children.forEach(d);
1183
+ const f = (p) => {
1184
+ l.nodesMap.delete(p.key), p.children.forEach(f);
907
1185
  };
908
- d(e);
1186
+ f(t);
909
1187
  }
910
1188
  },
911
- append: (n, e) => {
912
- if (e) {
913
- const a = s.nodesMap.get(e);
914
- if (a) {
915
- const d = new te(n, s, a.level + 1, a);
916
- s.nodesMap.set(d.key, d), a.children.push(d), a.isLeaf = !1;
1189
+ append: (c, t) => {
1190
+ if (t) {
1191
+ const o = l.nodesMap.get(t);
1192
+ if (o) {
1193
+ const f = new ne(c, l, o.level + 1, o);
1194
+ l.nodesMap.set(f.key, f), o.children.push(f), o.isLeaf = !1;
917
1195
  }
918
1196
  } else {
919
- const a = new te(n, s, 0, null);
920
- s.nodesMap.set(a.key, a), s.rootNodes.push(a);
1197
+ const o = new ne(c, l, 0, null);
1198
+ l.nodesMap.set(o.key, o), l.rootNodes.push(o);
921
1199
  }
922
1200
  },
923
- insertBefore: (n, e) => {
924
- var d;
925
- const a = s.nodesMap.get(e);
926
- if (a) {
927
- const p = new te(n, s, a.level, a.parent);
928
- s.nodesMap.set(p.key, p);
929
- const m = ((d = a.parent) == null ? void 0 : d.children) || s.rootNodes, D = m.indexOf(a);
930
- m.splice(D, 0, p);
1201
+ insertBefore: (c, t) => {
1202
+ var f;
1203
+ const o = l.nodesMap.get(t);
1204
+ if (o) {
1205
+ const p = new ne(c, 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);
931
1209
  }
932
1210
  },
933
- insertAfter: (n, e) => {
934
- var d;
935
- const a = s.nodesMap.get(e);
936
- if (a) {
937
- const p = new te(n, s, a.level, a.parent);
938
- s.nodesMap.set(p.key, p);
939
- const m = ((d = a.parent) == null ? void 0 : d.children) || s.rootNodes, D = m.indexOf(a);
940
- m.splice(D + 1, 0, p);
1211
+ insertAfter: (c, t) => {
1212
+ var f;
1213
+ const o = l.nodesMap.get(t);
1214
+ if (o) {
1215
+ const p = new ne(c, 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);
941
1219
  }
942
1220
  }
943
- }), q(
944
- () => [t.treeData, t.data],
1221
+ }), _(
1222
+ () => [e.treeData, e.data],
945
1223
  () => {
946
- C(M());
1224
+ x(w());
947
1225
  },
948
1226
  { immediate: !0, deep: !0 }
949
- ), q(
950
- () => t.checkedKeys,
951
- (n) => {
952
- n && O(n);
1227
+ ), _(
1228
+ () => e.checkedKeys,
1229
+ (c) => {
1230
+ c && B(c);
953
1231
  },
954
1232
  { immediate: !0, deep: !0 }
955
- ), q(
956
- () => t.defaultCheckedKeys,
957
- (n) => {
958
- n && n.length > 0 && !t.checkedKeys && O(n);
1233
+ ), _(
1234
+ () => e.defaultCheckedKeys,
1235
+ (c) => {
1236
+ c && c.length > 0 && !e.checkedKeys && B(c);
959
1237
  },
960
1238
  { immediate: !0, deep: !0 }
961
- ), (n, e) => (c(), h("div", {
962
- class: g([f(i).b(), f(i).m(l.size)])
1239
+ ), (c, t) => (h(), v("div", {
1240
+ class: u([i(n).b(), i(n).m(s.size)])
963
1241
  }, [
964
- (c(!0), h(R, null, U(s.rootNodes, (a) => (c(), se(Ye, {
965
- key: a.key,
966
- node: a
1242
+ (h(!0), v(G, null, J(l.rootNodes, (o) => (h(), te(et, {
1243
+ key: o.key,
1244
+ node: o
967
1245
  }, {
968
- default: he((d) => [
969
- B(n.$slots, "default", {
970
- node: d.node,
971
- data: d.data
1246
+ default: ve((f) => [
1247
+ E(c.$slots, "default", {
1248
+ node: f.node,
1249
+ data: f.data
972
1250
  }, () => [
973
- J(A(d.node.label), 1)
1251
+ q(T(f.node.label), 1)
974
1252
  ])
975
1253
  ]),
976
1254
  _: 2
977
1255
  }, 1032, ["node"]))), 128)),
978
- s.rootNodes.length ? S("", !0) : (c(), h("div", {
1256
+ l.rootNodes.length ? H("", !0) : (h(), v("div", {
979
1257
  key: 0,
980
- class: g(f(i).e("empty"))
1258
+ class: u(i(n).e("empty"))
981
1259
  }, [
982
- B(n.$slots, "empty", {}, () => [
983
- J(A(l.emptyText), 1)
1260
+ E(c.$slots, "empty", {}, () => [
1261
+ q(T(s.emptyText), 1)
984
1262
  ])
985
1263
  ], 2))
986
1264
  ], 2));
987
1265
  }
988
- }), Xe = ["src"], Qe = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", kt = /* @__PURE__ */ G({
1266
+ }), tt = ["src"], at = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", Nt = /* @__PURE__ */ Y({
989
1267
  name: "XEmpty",
990
1268
  __name: "index",
991
1269
  props: {
@@ -994,70 +1272,70 @@ const mt = /* @__PURE__ */ G({
994
1272
  description: { default: "" },
995
1273
  size: { default: "default" }
996
1274
  },
997
- setup(l) {
998
- const o = l, r = Y("empty"), t = x(() => {
999
- const i = {};
1000
- return o.imageSize && (i.height = `${o.imageSize}px`, i.width = `${o.imageSize}px`), i;
1001
- }), u = x(() => o.description || "暂无数据");
1002
- return (i, s) => (c(), h("div", {
1003
- class: g([f(r).b(), f(r).m(l.size)])
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
+ }), d = M(() => r.description || "暂无数据");
1280
+ return (n, l) => (h(), v("div", {
1281
+ class: u([i(a).b(), i(a).m(s.size)])
1004
1282
  }, [
1005
- y("div", {
1006
- class: g(f(r).e("image")),
1007
- style: j(t.value)
1283
+ g("div", {
1284
+ class: u(i(a).e("image")),
1285
+ style: j(e.value)
1008
1286
  }, [
1009
- B(i.$slots, "image", {}, () => [
1010
- l.image ? (c(), h("img", {
1287
+ E(n.$slots, "image", {}, () => [
1288
+ s.image ? (h(), v("img", {
1011
1289
  key: 0,
1012
- src: l.image,
1013
- style: j(t.value),
1290
+ src: s.image,
1291
+ style: j(e.value),
1014
1292
  draggable: "false"
1015
- }, null, 12, Xe)) : (c(), h("img", {
1293
+ }, null, 12, tt)) : (h(), v("img", {
1016
1294
  key: 1,
1017
- src: Qe,
1018
- style: j(t.value),
1295
+ src: at,
1296
+ style: j(e.value),
1019
1297
  draggable: "false"
1020
1298
  }, null, 4))
1021
1299
  ])
1022
1300
  ], 6),
1023
- y("div", {
1024
- class: g(f(r).e("description"))
1301
+ g("div", {
1302
+ class: u(i(a).e("description"))
1025
1303
  }, [
1026
- B(i.$slots, "description", {}, () => [
1027
- y("p", null, A(u.value), 1)
1304
+ E(n.$slots, "description", {}, () => [
1305
+ g("p", null, T(d.value), 1)
1028
1306
  ])
1029
1307
  ], 2),
1030
- i.$slots.default ? (c(), h("div", {
1308
+ n.$slots.default ? (h(), v("div", {
1031
1309
  key: 0,
1032
- class: g(f(r).e("bottom"))
1310
+ class: u(i(a).e("bottom"))
1033
1311
  }, [
1034
- B(i.$slots, "default")
1035
- ], 2)) : S("", !0)
1312
+ E(n.$slots, "default")
1313
+ ], 2)) : H("", !0)
1036
1314
  ], 2));
1037
1315
  }
1038
- }), xt = /* @__PURE__ */ G({
1316
+ }), Tt = /* @__PURE__ */ Y({
1039
1317
  name: "XTimeline",
1040
1318
  __name: "index",
1041
1319
  props: {
1042
1320
  direction: { default: "vertical" }
1043
1321
  },
1044
- setup(l) {
1045
- const o = l, r = Y("timeline");
1046
- le("timeline", {
1047
- props: o
1322
+ setup(s) {
1323
+ const r = s, a = Q("timeline");
1324
+ ie("timeline", {
1325
+ props: r
1048
1326
  });
1049
- const t = x(() => [
1050
- r.b(),
1051
- r.m(o.direction)
1327
+ const e = M(() => [
1328
+ a.b(),
1329
+ a.m(r.direction)
1052
1330
  ]);
1053
- return (u, i) => (c(), h("ul", {
1054
- class: g(t.value),
1331
+ return (d, n) => (h(), v("ul", {
1332
+ class: u(e.value),
1055
1333
  role: "timeline"
1056
1334
  }, [
1057
- B(u.$slots, "default")
1335
+ E(d.$slots, "default")
1058
1336
  ], 2));
1059
1337
  }
1060
- }), bt = /* @__PURE__ */ G({
1338
+ }), Vt = /* @__PURE__ */ Y({
1061
1339
  name: "XTimelineItem",
1062
1340
  __name: "TimelineItem",
1063
1341
  props: {
@@ -1068,52 +1346,52 @@ const mt = /* @__PURE__ */ G({
1068
1346
  hideTimestamp: { type: Boolean, default: !1 },
1069
1347
  placement: { default: "bottom" }
1070
1348
  },
1071
- setup(l) {
1072
- const o = l, r = Y("timeline-item"), t = {
1349
+ setup(s) {
1350
+ const r = s, a = Q("timeline-item"), e = {
1073
1351
  primary: "#409eff",
1074
1352
  success: "#67c23a",
1075
1353
  warning: "#e6a23c",
1076
1354
  danger: "#f56c6c",
1077
1355
  info: "#909399"
1078
- }, u = x(() => {
1079
- const s = {};
1080
- return o.color ? s.backgroundColor = o.color : o.type && t[o.type] && (s.backgroundColor = t[o.type]), s;
1081
- }), i = x(() => [
1082
- r.b(),
1083
- r.m(o.size)
1356
+ }, d = 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)
1084
1362
  ]);
1085
- return (s, k) => (c(), h("li", {
1086
- class: g(i.value)
1363
+ return (l, m) => (h(), v("li", {
1364
+ class: u(n.value)
1087
1365
  }, [
1088
- y("div", {
1089
- class: g(f(r).e("node")),
1090
- style: j(u.value)
1366
+ g("div", {
1367
+ class: u(i(a).e("node")),
1368
+ style: j(d.value)
1091
1369
  }, [
1092
- B(s.$slots, "dot")
1370
+ E(l.$slots, "dot")
1093
1371
  ], 6),
1094
- y("div", {
1095
- class: g(f(r).e("tail"))
1372
+ g("div", {
1373
+ class: u(i(a).e("tail"))
1096
1374
  }, null, 2),
1097
- y("div", {
1098
- class: g(f(r).e("wrapper"))
1375
+ g("div", {
1376
+ class: u(i(a).e("wrapper"))
1099
1377
  }, [
1100
- !l.hideTimestamp && l.timestamp && l.placement === "top" ? (c(), h("div", {
1378
+ !s.hideTimestamp && s.timestamp && s.placement === "top" ? (h(), v("div", {
1101
1379
  key: 0,
1102
- class: g(f(r).e("timestamp"))
1103
- }, A(l.timestamp), 3)) : S("", !0),
1104
- y("div", {
1105
- class: g(f(r).e("content"))
1380
+ class: u(i(a).e("timestamp"))
1381
+ }, T(s.timestamp), 3)) : H("", !0),
1382
+ g("div", {
1383
+ class: u(i(a).e("content"))
1106
1384
  }, [
1107
- B(s.$slots, "default")
1385
+ E(l.$slots, "default")
1108
1386
  ], 2),
1109
- !l.hideTimestamp && l.timestamp && l.placement === "bottom" ? (c(), h("div", {
1387
+ !s.hideTimestamp && s.timestamp && s.placement === "bottom" ? (h(), v("div", {
1110
1388
  key: 1,
1111
- class: g(f(r).e("timestamp"))
1112
- }, A(l.timestamp), 3)) : S("", !0)
1389
+ class: u(i(a).e("timestamp"))
1390
+ }, T(s.timestamp), 3)) : H("", !0)
1113
1391
  ], 2)
1114
1392
  ], 2));
1115
1393
  }
1116
- }), Ze = ["onMouseenter", "onClick"], Ct = /* @__PURE__ */ G({
1394
+ }), lt = ["onMouseenter", "onClick"], Et = /* @__PURE__ */ Y({
1117
1395
  name: "XCarousel",
1118
1396
  __name: "index",
1119
1397
  props: {
@@ -1127,115 +1405,115 @@ const mt = /* @__PURE__ */ G({
1127
1405
  height: { default: 300 }
1128
1406
  },
1129
1407
  emits: ["update:activeIndex", "change"],
1130
- setup(l, { expose: o, emit: r }) {
1131
- const t = l, u = r, i = Y("carousel"), s = P(t.activeIndex), k = P(0), b = P(null), M = P(!1);
1132
- le("carousel", {
1133
- currentIndex: s,
1134
- itemCount: k
1408
+ setup(s, { expose: r, emit: a }) {
1409
+ const e = s, d = 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
1135
1413
  });
1136
- const C = (W) => {
1137
- const Z = s.value;
1138
- t.loop ? s.value = (W + k.value) % k.value : s.value = Math.max(0, Math.min(W, k.value - 1)), u("update:activeIndex", s.value), u("change", s.value, Z);
1139
- }, T = () => {
1140
- C(s.value - 1);
1141
- }, L = () => {
1142
- C(s.value + 1);
1143
- }, w = () => {
1144
- t.autoplay && k.value > 1 && ($(), b.value = setInterval(() => {
1145
- M.value || L();
1146
- }, t.interval));
1147
- }, $ = () => {
1148
- b.value && (clearInterval(b.value), b.value = null);
1149
- }, K = () => {
1150
- M.value = !0, t.arrow;
1414
+ const x = (R) => {
1415
+ const U = l.value;
1416
+ e.loop ? l.value = (R + m.value) % m.value : l.value = Math.max(0, Math.min(R, m.value - 1)), d("update:activeIndex", l.value), d("change", l.value, U);
1151
1417
  }, N = () => {
1152
- M.value = !1;
1153
- }, V = (W) => {
1154
- t.trigger === "hover" && C(W);
1155
- }, X = (W) => {
1156
- t.trigger === "click" && C(W);
1157
- }, E = x(() => ({
1158
- height: typeof t.height == "number" ? `${t.height}px` : t.height
1159
- })), z = x(() => [
1160
- i.b(),
1161
- i.m(`arrow-${t.arrow}`),
1162
- i.m(`indicator-${t.indicatorPosition}`)
1418
+ x(l.value - 1);
1419
+ }, A = () => {
1420
+ x(l.value + 1);
1421
+ }, k = () => {
1422
+ e.autoplay && m.value > 1 && (C(), y.value = setInterval(() => {
1423
+ w.value || A();
1424
+ }, e.interval));
1425
+ }, C = () => {
1426
+ y.value && (clearInterval(y.value), y.value = null);
1427
+ }, z = () => {
1428
+ w.value = !0, e.arrow;
1429
+ }, D = () => {
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(() => ({
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}`)
1163
1441
  ]);
1164
- return q(() => t.activeIndex, (W) => {
1165
- s.value = W;
1166
- }), q(() => t.autoplay, () => {
1167
- w();
1168
- }), q(k, () => {
1169
- pe(() => {
1170
- w();
1442
+ return _(() => e.activeIndex, (R) => {
1443
+ l.value = R;
1444
+ }), _(() => e.autoplay, () => {
1445
+ k();
1446
+ }), _(m, () => {
1447
+ ye(() => {
1448
+ k();
1171
1449
  });
1172
- }), ie(() => {
1173
- w();
1174
1450
  }), re(() => {
1175
- $();
1176
- }), o({
1177
- prev: T,
1178
- next: L,
1179
- setActiveItem: C
1180
- }), (W, Z) => (c(), h("div", {
1181
- class: g(z.value),
1182
- style: j(E.value),
1183
- onMouseenter: K,
1184
- onMouseleave: N
1451
+ k();
1452
+ }), ue(() => {
1453
+ C();
1454
+ }), r({
1455
+ prev: N,
1456
+ next: A,
1457
+ setActiveItem: x
1458
+ }), (R, U) => (h(), v("div", {
1459
+ class: u(L.value),
1460
+ style: j(S.value),
1461
+ onMouseenter: z,
1462
+ onMouseleave: D
1185
1463
  }, [
1186
- y("div", {
1187
- class: g(f(i).e("container"))
1464
+ g("div", {
1465
+ class: u(i(n).e("container"))
1188
1466
  }, [
1189
- B(W.$slots, "default")
1467
+ E(R.$slots, "default")
1190
1468
  ], 2),
1191
- l.arrow !== "never" ? (c(), h("button", {
1469
+ s.arrow !== "never" ? (h(), v("button", {
1192
1470
  key: 0,
1193
- class: g([f(i).e("arrow"), f(i).e("arrow-left")]),
1194
- onClick: T
1195
- }, " ‹ ", 2)) : S("", !0),
1196
- l.arrow !== "never" ? (c(), h("button", {
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", {
1197
1475
  key: 1,
1198
- class: g([f(i).e("arrow"), f(i).e("arrow-right")]),
1199
- onClick: L
1200
- }, " › ", 2)) : S("", !0),
1201
- l.indicatorPosition !== "none" ? (c(), h("ul", {
1476
+ class: u([i(n).e("arrow"), i(n).e("arrow-right")]),
1477
+ onClick: A
1478
+ }, " › ", 2)) : H("", !0),
1479
+ s.indicatorPosition !== "none" ? (h(), v("ul", {
1202
1480
  key: 2,
1203
- class: g(f(i).e("indicators"))
1481
+ class: u(i(n).e("indicators"))
1204
1482
  }, [
1205
- (c(!0), h(R, null, U(k.value, (O) => (c(), h("li", {
1206
- key: O,
1207
- class: g([f(i).e("indicator"), f(i).is("active", O - 1 === s.value)]),
1208
- onMouseenter: (Q) => V(O - 1),
1209
- onClick: (Q) => X(O - 1)
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)
1210
1488
  }, [
1211
- y("button", {
1212
- class: g(f(i).e("indicator-btn"))
1489
+ g("button", {
1490
+ class: u(i(n).e("indicator-btn"))
1213
1491
  }, null, 2)
1214
- ], 42, Ze))), 128))
1215
- ], 2)) : S("", !0)
1492
+ ], 42, lt))), 128))
1493
+ ], 2)) : H("", !0)
1216
1494
  ], 38));
1217
1495
  }
1218
- }), wt = /* @__PURE__ */ G({
1496
+ }), Bt = /* @__PURE__ */ Y({
1219
1497
  name: "XCarouselItem",
1220
1498
  __name: "CarouselItem",
1221
- setup(l) {
1222
- const o = Y("carousel-item"), r = oe("carousel"), t = P(-1);
1223
- ie(() => {
1224
- r && (t.value = r.itemCount.value, r.itemCount.value++);
1225
- }), re(() => {
1226
- r && r.itemCount.value--;
1499
+ setup(s) {
1500
+ const r = Q("carousel-item"), a = de("carousel"), e = V(-1);
1501
+ re(() => {
1502
+ a && (e.value = a.itemCount.value, a.itemCount.value++);
1503
+ }), ue(() => {
1504
+ a && a.itemCount.value--;
1227
1505
  });
1228
- const u = x(() => r && t.value === r.currentIndex.value), i = x(() => [
1229
- o.b(),
1230
- o.is("active", u.value)
1506
+ const d = M(() => a && e.value === a.currentIndex.value), n = M(() => [
1507
+ r.b(),
1508
+ r.is("active", d.value)
1231
1509
  ]);
1232
- return (s, k) => (c(), h("div", {
1233
- class: g(i.value)
1510
+ return (l, m) => (h(), v("div", {
1511
+ class: u(n.value)
1234
1512
  }, [
1235
- B(s.$slots, "default")
1513
+ E(l.$slots, "default")
1236
1514
  ], 2));
1237
1515
  }
1238
- }), Ve = { key: 0 }, Ue = ["onClick"], Fe = ["onClick"], Je = ["onClick"], qe = { key: 1 }, _e = ["colspan"], et = { style: { display: "none" } }, It = /* @__PURE__ */ G({
1516
+ }), nt = { key: 0 }, st = ["onClick"], ot = { class: "sort-arrow up" }, it = { class: "sort-arrow down" }, rt = ["onClick"], ct = ["onClick"], dt = { key: 1 }, ut = ["colspan"], ht = { style: { display: "none" } }, jt = /* @__PURE__ */ Y({
1239
1517
  name: "XTable",
1240
1518
  __name: "index",
1241
1519
  props: {
@@ -1252,196 +1530,206 @@ const mt = /* @__PURE__ */ G({
1252
1530
  pagination: {}
1253
1531
  },
1254
1532
  emits: ["sort-change", "row-click", "row-dblclick", "cell-click", "selection-change", "select-all", "page-change", "size-change"],
1255
- setup(l, { expose: o, emit: r }) {
1256
- var I, n;
1257
- const t = l, u = r, i = Y("table");
1258
- ue();
1259
- const s = fe([]);
1260
- le("x-table", {
1261
- registerColumn: (e, a) => {
1262
- s.findIndex((p) => p.config.prop === e.prop) === -1 && s.push({ config: e, slot: a });
1533
+ setup(s, { expose: r, emit: a }) {
1534
+ var K, c;
1535
+ const e = s, d = 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 });
1263
1541
  },
1264
- unregisterColumn: (e) => {
1265
- const a = s.findIndex((d) => d.config.prop === e);
1266
- a !== -1 && s.splice(a, 1);
1542
+ unregisterColumn: (t) => {
1543
+ const o = l.findIndex((f) => f.config.prop === t);
1544
+ o !== -1 && l.splice(o, 1);
1267
1545
  },
1268
- updateColumnSlot: (e, a) => {
1269
- const d = s.find((p) => p.config.prop === e);
1270
- d && (d.slot = a);
1546
+ updateColumnSlot: (t, o) => {
1547
+ const f = l.find((p) => p.config.prop === t);
1548
+ f && (f.slot = o);
1271
1549
  },
1272
- props: t
1550
+ props: e
1273
1551
  });
1274
- const C = x(() => {
1275
- const e = s.map((m) => m.config), a = e.filter((m) => m.fixed === "left" || m.fixed === !0), d = e.filter((m) => !m.fixed), p = e.filter((m) => m.fixed === "right");
1276
- return [...a, ...d, ...p];
1277
- }), T = x(() => C.value.filter((e) => e.fixed === "left" || e.fixed === !0)), L = x(() => C.value.filter((e) => e.fixed === "right"));
1278
- x(() => C.value.filter((e) => !e.fixed)), x(() => T.value.reduce((e, a) => {
1279
- const d = a.width ? typeof a.width == "number" ? a.width : parseInt(a.width) : 100;
1280
- return e + d;
1281
- }, 0)), x(() => L.value.reduce((e, a) => {
1282
- const d = a.width ? typeof a.width == "number" ? a.width : parseInt(a.width) : 100;
1283
- return e + d;
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)), A = 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(() => A.value.reduce((t, o) => {
1560
+ const f = o.width ? typeof o.width == "number" ? o.width : parseInt(o.width) : 100;
1561
+ return t + f;
1284
1562
  }, 0));
1285
- const w = x(() => {
1286
- const e = {};
1287
- return s.forEach((a) => {
1288
- a.slot && (e[a.config.prop] = a.slot);
1289
- }), e;
1290
- }), $ = P({
1291
- prop: ((I = t.defaultSort) == null ? void 0 : I.prop) || "",
1292
- order: ((n = t.defaultSort) == null ? void 0 : n.order) || null
1293
- }), K = x(() => {
1294
- if (!$.value.prop || !$.value.order)
1295
- return t.data;
1296
- const { prop: e, order: a } = $.value;
1297
- return [...t.data].sort((d, p) => {
1298
- const m = d[e], D = p[e];
1299
- if (m === D) return 0;
1300
- const H = m > D ? 1 : -1;
1301
- return a === "ascending" ? H : -H;
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: ((c = e.defaultSort) == null ? void 0 : c.order) || null
1571
+ }), z = M(() => {
1572
+ if (!C.value.prop || !C.value.order)
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;
1302
1580
  });
1303
- }), N = x(() => {
1304
- const e = {};
1305
- return t.height && (e.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (e.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), e;
1306
- }), V = x(() => [
1307
- i.b(),
1308
- i.is("border", t.border),
1309
- i.is("stripe", t.stripe),
1310
- i.is("loading", t.loading),
1311
- i.is("has-fixed", T.value.length > 0 || L.value.length > 0)
1312
- ]), X = (e) => {
1313
- e.sortable && ($.value.prop === e.prop ? $.value.order === "ascending" ? $.value.order = "descending" : $.value.order === "descending" && ($.value.order = null, $.value.prop = "") : ($.value.prop = e.prop, $.value.order = "ascending"), u("sort-change", { ...$.value }));
1314
- }, E = (e) => e.sortable ? $.value.prop !== e.prop ? i.is("sortable") : [
1315
- i.is("sortable"),
1316
- i.is(`sort-${$.value.order}`)
1317
- ] : "", z = (e, a, d) => {
1318
- const p = e[a.prop];
1319
- return a.formatter ? a.formatter(e, a, p, d) : p ?? "";
1320
- }, W = (e, a) => {
1321
- u("row-click", e, C.value[0], a);
1322
- }, Z = (e, a, d) => {
1323
- const p = d.target;
1324
- u("cell-click", e, a, p, d);
1325
- }, O = (e) => {
1326
- u("page-change", e);
1327
- }, Q = (e) => {
1328
- u("size-change", e);
1329
- }, F = (e, a, d) => {
1581
+ }), D = 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 || A.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"), d("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
+ d("row-click", t, x.value[0], o);
1600
+ }, U = (t, o, f) => {
1601
+ const p = f.target;
1602
+ d("cell-click", t, o, p, f);
1603
+ }, B = (t) => {
1604
+ d("page-change", t);
1605
+ }, O = (t) => {
1606
+ d("size-change", t);
1607
+ }, ee = (t, o, f) => {
1330
1608
  const p = {};
1331
- if (e.width && (p.width = typeof e.width == "number" ? `${e.width}px` : e.width), e.minWidth && (p.minWidth = typeof e.minWidth == "number" ? `${e.minWidth}px` : e.minWidth), e.align && (p.textAlign = e.align), (e.fixed === "left" || e.fixed === !0) && (p.position = "sticky", p.left = "0px", p.zIndex = "2", a !== void 0 && a > 0)) {
1332
- let m = 0;
1333
- for (let D = 0; D < a; D++) {
1334
- const H = T.value[D], ee = H.width ? typeof H.width == "number" ? H.width : parseInt(H.width) : 100;
1335
- m += ee;
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;
1336
1614
  }
1337
- p.left = `${m}px`;
1615
+ p.left = `${$}px`;
1338
1616
  }
1339
- if (e.fixed === "right" && (p.position = "sticky", p.right = "0px", p.zIndex = "2", a !== void 0)) {
1340
- const m = L.value, D = m.length - 1 - a;
1341
- if (D > 0) {
1342
- let H = 0;
1343
- for (let ee = 0; ee < D; ee++) {
1344
- const ne = m[m.length - 1 - ee], ge = ne.width ? typeof ne.width == "number" ? ne.width : parseInt(ne.width) : 100;
1345
- H += ge;
1617
+ if (t.fixed === "right" && (p.position = "sticky", p.right = "0px", p.zIndex = "2", o !== void 0)) {
1618
+ const $ = A.value, P = $.length - 1 - o;
1619
+ if (P > 0) {
1620
+ let X = 0;
1621
+ for (let le = 0; le < P; le++) {
1622
+ const ce = $[$.length - 1 - le], ke = ce.width ? typeof ce.width == "number" ? ce.width : parseInt(ce.width) : 100;
1623
+ X += ke;
1346
1624
  }
1347
- p.right = `${H}px`;
1625
+ p.right = `${X}px`;
1348
1626
  }
1349
1627
  }
1350
1628
  return p;
1351
- }, _ = (e) => {
1352
- const a = [];
1353
- return (e.fixed === "left" || e.fixed === !0) && a.push(i.is("fixed-left")), e.fixed === "right" && a.push(i.is("fixed-right")), a;
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;
1354
1632
  };
1355
- return o({
1633
+ return r({
1356
1634
  clearSelection: () => {
1357
1635
  },
1358
1636
  getSelection: () => [],
1359
- sortState: $,
1360
- columns: C
1361
- }), (e, a) => (c(), h("div", {
1362
- class: g(V.value)
1637
+ sortState: C,
1638
+ columns: x
1639
+ }), (t, o) => (h(), v("div", {
1640
+ class: u(W.value)
1363
1641
  }, [
1364
- l.loading ? (c(), h("div", {
1642
+ s.loading ? (h(), v("div", {
1365
1643
  key: 0,
1366
- class: g(f(i).e("loading"))
1367
- }, [...a[0] || (a[0] = [
1368
- y("span", { class: "loading-spinner" }, null, -1),
1369
- y("span", { class: "loading-text" }, "加载中...", -1)
1370
- ])], 2)) : S("", !0),
1371
- y("div", {
1372
- class: g(f(i).e("wrapper")),
1373
- style: j(N.value)
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(D.value)
1374
1652
  }, [
1375
- y("table", null, [
1376
- l.showHeader ? (c(), h("thead", Ve, [
1377
- y("tr", null, [
1378
- (c(!0), h(R, null, U(C.value, (d, p) => (c(), h("th", {
1379
- key: d.prop,
1380
- class: g([f(i).e("header-cell"), E(d), ..._(d)]),
1381
- style: j(F(d, d.fixed === "right" ? L.value.indexOf(d) : p)),
1382
- onClick: (m) => X(d)
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" ? A.value.indexOf(f) : p)),
1660
+ onClick: ($) => I(f)
1383
1661
  }, [
1384
- y("span", null, A(d.label), 1),
1385
- d.sortable ? (c(), h("span", {
1662
+ g("span", null, T(f.label), 1),
1663
+ f.sortable ? (h(), v("span", {
1386
1664
  key: 0,
1387
- class: g(f(i).e("sort-icon"))
1388
- }, [...a[1] || (a[1] = [
1389
- y("span", { class: "sort-arrow up" }, "▲", -1),
1390
- y("span", { class: "sort-arrow down" }, "▼", -1)
1391
- ])], 2)) : S("", !0)
1392
- ], 14, Ue))), 128))
1665
+ class: u(i(n).e("sort-icon"))
1666
+ }, [
1667
+ g("span", ot, [
1668
+ F(i(Z), {
1669
+ name: "sort-up",
1670
+ size: 12
1671
+ })
1672
+ ]),
1673
+ g("span", it, [
1674
+ F(i(Z), {
1675
+ name: "sort-down",
1676
+ size: 12
1677
+ })
1678
+ ])
1679
+ ], 2)) : H("", !0)
1680
+ ], 14, st))), 128))
1393
1681
  ])
1394
- ])) : S("", !0),
1395
- y("tbody", null, [
1396
- (c(!0), h(R, null, U(K.value, (d, p) => (c(), h("tr", {
1397
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(d) : d[l.rowKey] : p,
1398
- class: g([f(i).e("row")]),
1399
- onClick: (m) => W(d, m)
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, $)
1400
1688
  }, [
1401
- (c(!0), h(R, null, U(C.value, (m, D) => (c(), h("td", {
1402
- key: m.prop,
1403
- class: g([f(i).e("cell"), ..._(m)]),
1404
- style: j(F(m, m.fixed === "right" ? L.value.indexOf(m) : D)),
1405
- onClick: (H) => Z(d, m, H)
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" ? A.value.indexOf($) : P)),
1693
+ onClick: (X) => U(f, $, X)
1406
1694
  }, [
1407
- w.value[m.prop] ? (c(), se(ce(() => w.value[m.prop]({ row: d, column: m, $index: p })), { key: 0 })) : (c(), h(R, { key: 1 }, [
1408
- J(A(z(d, m, p)), 1)
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)
1409
1697
  ], 64))
1410
- ], 14, Je))), 128))
1411
- ], 10, Fe))), 128))
1698
+ ], 14, ct))), 128))
1699
+ ], 10, rt))), 128))
1412
1700
  ]),
1413
- K.value.length === 0 && !l.loading ? (c(), h("tbody", qe, [
1414
- y("tr", null, [
1415
- y("td", {
1416
- colspan: C.value.length || 1,
1417
- class: g(f(i).e("empty"))
1701
+ z.value.length === 0 && !s.loading ? (h(), v("tbody", dt, [
1702
+ g("tr", null, [
1703
+ g("td", {
1704
+ colspan: x.value.length || 1,
1705
+ class: u(i(n).e("empty"))
1418
1706
  }, [
1419
- B(e.$slots, "empty", {}, () => [
1420
- J(A(l.emptyText), 1)
1707
+ E(t.$slots, "empty", {}, () => [
1708
+ q(T(s.emptyText), 1)
1421
1709
  ])
1422
- ], 10, _e)
1710
+ ], 10, ut)
1423
1711
  ])
1424
- ])) : S("", !0)
1712
+ ])) : H("", !0)
1425
1713
  ])
1426
1714
  ], 6),
1427
- l.pagination ? (c(), h("div", {
1715
+ s.pagination ? (h(), v("div", {
1428
1716
  key: 1,
1429
- class: g(f(i).e("pagination"))
1717
+ class: u(i(n).e("pagination"))
1430
1718
  }, [
1431
- xe(Ne, {
1432
- total: l.pagination.total,
1433
- "current-page": l.pagination.current,
1434
- "page-size": l.pagination.pageSize,
1435
- onCurrentChange: O,
1436
- onSizeChange: Q
1719
+ F(Ee, {
1720
+ total: s.pagination.total,
1721
+ "current-page": s.pagination.current,
1722
+ "page-size": s.pagination.pageSize,
1723
+ onCurrentChange: B,
1724
+ onSizeChange: O
1437
1725
  }, null, 8, ["total", "current-page", "page-size"])
1438
- ], 2)) : S("", !0),
1439
- y("div", et, [
1440
- B(e.$slots, "default")
1726
+ ], 2)) : H("", !0),
1727
+ g("div", ht, [
1728
+ E(t.$slots, "default")
1441
1729
  ])
1442
1730
  ], 2));
1443
1731
  }
1444
- }), $t = /* @__PURE__ */ G({
1732
+ }), Rt = /* @__PURE__ */ Y({
1445
1733
  name: "XTableColumn",
1446
1734
  __name: "TableColumn",
1447
1735
  props: {
@@ -1454,28 +1742,28 @@ const mt = /* @__PURE__ */ G({
1454
1742
  fixed: { type: [String, Boolean] },
1455
1743
  formatter: {}
1456
1744
  },
1457
- setup(l) {
1458
- const o = l;
1459
- Y("table-column");
1460
- const r = ue(), t = P(`column_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`), u = oe("x-table"), i = x(() => ({
1461
- prop: o.prop || t.value,
1462
- label: o.label,
1463
- width: o.width,
1464
- minWidth: o.minWidth,
1465
- align: o.align,
1466
- sortable: o.sortable,
1467
- fixed: o.fixed,
1468
- formatter: o.formatter
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)}`), d = de("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
1469
1757
  }));
1470
- return ie(() => {
1471
- u != null && u.registerColumn && u.registerColumn(i.value, r.default);
1472
- }), q(() => r.default, (s) => {
1473
- u != null && u.updateColumnSlot && s && u.updateColumnSlot(o.prop || t.value, s);
1474
- }, { immediate: !0 }), re(() => {
1475
- u != null && u.unregisterColumn && u.unregisterColumn(o.prop || t.value);
1476
- }), (s, k) => null;
1758
+ return re(() => {
1759
+ d != null && d.registerColumn && d.registerColumn(n.value, a.default);
1760
+ }), _(() => a.default, (l) => {
1761
+ d != null && d.updateColumnSlot && l && d.updateColumnSlot(r.prop || e.value, l);
1762
+ }, { immediate: !0 }), ue(() => {
1763
+ d != null && d.unregisterColumn && d.unregisterColumn(r.prop || e.value);
1764
+ }), (l, m) => null;
1477
1765
  }
1478
- }), tt = { key: 0 }, at = ["onClick"], nt = ["onClick"], st = { key: 0 }, lt = { key: 1 }, ot = { key: 0 }, it = ["colspan"], rt = { style: { display: "none" } }, Mt = /* @__PURE__ */ G({
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({
1479
1767
  name: "XTreeTable",
1480
1768
  __name: "index",
1481
1769
  props: {
@@ -1494,197 +1782,215 @@ const mt = /* @__PURE__ */ G({
1494
1782
  collapseIcon: {}
1495
1783
  },
1496
1784
  emits: ["row-click", "cell-click", "expand-change", "sort-change"],
1497
- setup(l, { expose: o, emit: r }) {
1498
- const t = l, u = r, i = Y("tree-table"), s = P(/* @__PURE__ */ new Set()), k = P([]), b = P({});
1499
- le("x-tree-table", {
1500
- registerColumn: (v, I) => {
1501
- const n = k.value.findIndex((e) => e.prop === v.prop);
1502
- n === -1 ? k.value.push(v) : k.value[n] = v, I && (b.value[v.prop] = I);
1785
+ setup(s, { expose: r, emit: a }) {
1786
+ const e = s, d = 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 c = m.value.findIndex((t) => t.prop === b.prop);
1790
+ c === -1 ? m.value.push(b) : m.value[c] = b, K && (y.value[b.prop] = K);
1503
1791
  },
1504
- unregisterColumn: (v) => {
1505
- const I = k.value.findIndex((n) => n.prop === v);
1506
- I > -1 && k.value.splice(I, 1), delete b.value[v];
1792
+ unregisterColumn: (b) => {
1793
+ const K = m.value.findIndex((c) => c.prop === b);
1794
+ K > -1 && m.value.splice(K, 1), delete y.value[b];
1507
1795
  },
1508
- updateColumnSlot: (v, I) => {
1509
- b.value[v] = I;
1796
+ updateColumnSlot: (b, K) => {
1797
+ y.value[b] = K;
1510
1798
  },
1511
- props: t
1799
+ props: e
1512
1800
  });
1513
- const L = (v) => typeof t.rowKey == "function" ? t.rowKey(v) : v[t.rowKey || "id"], w = (v) => {
1514
- var n;
1515
- const I = ((n = t.treeProps) == null ? void 0 : n.children) || "children";
1516
- return v[I] || [];
1517
- }, $ = (v) => {
1518
- var e;
1519
- if (w(v).length > 0) return !0;
1520
- const n = ((e = t.treeProps) == null ? void 0 : e.hasChildren) || "hasChildren";
1521
- return v[n] === !0;
1522
- }, K = (v) => {
1523
- const I = L(v);
1524
- return s.value.has(I);
1525
- }, N = (v) => {
1526
- const I = L(v), n = !s.value.has(I);
1527
- n ? s.value.add(I) : s.value.delete(I), u("expand-change", v, n);
1528
- }, V = () => {
1529
- const v = (I) => {
1530
- I.forEach((n) => {
1531
- $(n) && (s.value.add(L(n)), v(w(n)));
1801
+ const A = (b) => typeof e.rowKey == "function" ? e.rowKey(b) : b[e.rowKey || "id"], k = (b) => {
1802
+ var c;
1803
+ const K = ((c = e.treeProps) == null ? void 0 : c.children) || "children";
1804
+ return b[K] || [];
1805
+ }, C = (b) => {
1806
+ var t;
1807
+ if (k(b).length > 0) return !0;
1808
+ const c = ((t = e.treeProps) == null ? void 0 : t.hasChildren) || "hasChildren";
1809
+ return b[c] === !0;
1810
+ }, z = (b) => {
1811
+ const K = A(b);
1812
+ return l.value.has(K);
1813
+ }, D = (b) => {
1814
+ const K = A(b), c = !l.value.has(K);
1815
+ c ? l.value.add(K) : l.value.delete(K), d("expand-change", b, c);
1816
+ }, W = () => {
1817
+ const b = (K) => {
1818
+ K.forEach((c) => {
1819
+ C(c) && (l.value.add(A(c)), b(k(c)));
1532
1820
  });
1533
1821
  };
1534
- v(t.data);
1535
- }, X = () => {
1536
- s.value.clear();
1537
- }, E = x(() => {
1538
- const v = [], I = (n, e = 0, a = !0) => {
1539
- n.forEach((d) => {
1540
- const p = L(d), m = s.value.has(p), D = a;
1541
- v.push({ row: d, level: e, visible: D });
1542
- const H = w(d);
1543
- H.length > 0 && m && I(H, e + 1, D);
1822
+ b(e.data);
1823
+ }, I = () => {
1824
+ l.value.clear();
1825
+ }, S = M(() => {
1826
+ const b = [], K = (c, t = 0, o = !0) => {
1827
+ c.forEach((f) => {
1828
+ const p = A(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);
1544
1832
  });
1545
1833
  };
1546
- return I(t.data), v;
1547
- }), z = P({
1834
+ return K(e.data), b;
1835
+ }), L = V({
1548
1836
  prop: "",
1549
1837
  order: null
1550
- }), W = x(() => {
1551
- if (!z.value.prop || !z.value.order)
1552
- return E.value;
1553
- const { prop: v, order: I } = z.value;
1554
- return [...E.value].sort((n, e) => {
1555
- const a = n.row[v], d = e.row[v];
1556
- if (a === d) return 0;
1557
- const p = a > d ? 1 : -1;
1558
- return I === "ascending" ? p : -p;
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((c, t) => {
1843
+ const o = c.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;
1559
1847
  });
1560
- }), Z = (v) => {
1561
- v.sortable && (z.value.prop === v.prop ? z.value.order === "ascending" ? z.value.order = "descending" : z.value.order === "descending" && (z.value.order = null, z.value.prop = "") : (z.value.prop = v.prop, z.value.order = "ascending"), u("sort-change", { ...z.value }));
1562
- }, O = (v) => v.sortable ? z.value.prop !== v.prop ? i.is("sortable") : [
1563
- i.is("sortable"),
1564
- i.is(`sort-${z.value.order}`)
1565
- ] : "", Q = (v, I, n) => {
1566
- const e = v[I.prop];
1567
- return I.formatter ? I.formatter(v, I, e, n) : e ?? "";
1568
- }, F = (v) => {
1569
- const I = {};
1570
- return v.width && (I.width = typeof v.width == "number" ? `${v.width}px` : v.width), v.minWidth && (I.minWidth = typeof v.minWidth == "number" ? `${v.minWidth}px` : v.minWidth), v.align && (I.textAlign = v.align), I;
1571
- }, _ = x(() => [
1572
- i.b(),
1573
- i.is("border", t.border),
1574
- i.is("stripe", t.stripe),
1575
- i.is("loading", t.loading)
1576
- ]), ae = () => {
1577
- var v;
1578
- t.defaultExpandAll ? V() : (v = t.defaultExpandedKeys) != null && v.length && t.defaultExpandedKeys.forEach((I) => {
1579
- s.value.add(I);
1848
+ }), U = (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"), d("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, c) => {
1854
+ const t = b[K.prop];
1855
+ return K.formatter ? K.formatter(b, K, t, c) : 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);
1580
1868
  });
1581
1869
  };
1582
- return q(() => t.data, () => {
1583
- ae();
1584
- }, { immediate: !0 }), q(() => t.defaultExpandedKeys, (v) => {
1585
- v != null && v.length && !t.defaultExpandAll && (s.value.clear(), v.forEach((I) => {
1586
- s.value.add(I);
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);
1587
1875
  }));
1588
- }, { immediate: !0 }), o({
1589
- expandAll: V,
1590
- collapseAll: X,
1591
- toggleExpand: N,
1592
- expandedKeys: s,
1593
- columns: k
1594
- }), (v, I) => (c(), h("div", {
1595
- class: g(_.value)
1876
+ }, { immediate: !0 }), r({
1877
+ expandAll: W,
1878
+ collapseAll: I,
1879
+ toggleExpand: D,
1880
+ expandedKeys: l,
1881
+ columns: m
1882
+ }), (b, K) => (h(), v("div", {
1883
+ class: u(ae.value)
1596
1884
  }, [
1597
- l.loading ? (c(), h("div", {
1885
+ s.loading ? (h(), v("div", {
1598
1886
  key: 0,
1599
- class: g(f(i).e("loading"))
1600
- }, [...I[0] || (I[0] = [
1601
- y("span", { class: "loading-spinner" }, null, -1),
1602
- y("span", { class: "loading-text" }, "加载中...", -1)
1603
- ])], 2)) : S("", !0),
1604
- y("div", {
1605
- class: g(f(i).e("wrapper"))
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"))
1606
1894
  }, [
1607
- y("table", null, [
1608
- l.showHeader ? (c(), h("thead", tt, [
1609
- y("tr", null, [
1610
- (c(!0), h(R, null, U(k.value, (n) => (c(), h("th", {
1611
- key: n.prop,
1612
- class: g([f(i).e("header-cell"), O(n)]),
1613
- style: j(F(n)),
1614
- onClick: (e) => Z(n)
1895
+ g("table", null, [
1896
+ s.showHeader ? (h(), v("thead", ft, [
1897
+ g("tr", null, [
1898
+ (h(!0), v(G, null, J(m.value, (c) => (h(), v("th", {
1899
+ key: c.prop,
1900
+ class: u([i(n).e("header-cell"), B(c)]),
1901
+ style: j(ee(c)),
1902
+ onClick: (t) => U(c)
1615
1903
  }, [
1616
- y("span", null, A(n.label), 1),
1617
- n.sortable ? (c(), h("span", {
1904
+ g("span", null, T(c.label), 1),
1905
+ c.sortable ? (h(), v("span", {
1618
1906
  key: 0,
1619
- class: g(f(i).e("sort-icon"))
1620
- }, [...I[1] || (I[1] = [
1621
- y("span", { class: "sort-arrow up" }, "▲", -1),
1622
- y("span", { class: "sort-arrow down" }, "▼", -1)
1623
- ])], 2)) : S("", !0)
1624
- ], 14, at))), 128))
1907
+ class: u(i(n).e("sort-icon"))
1908
+ }, [
1909
+ g("span", pt, [
1910
+ F(i(Z), {
1911
+ name: "sort-up",
1912
+ size: 12
1913
+ })
1914
+ ]),
1915
+ g("span", mt, [
1916
+ F(i(Z), {
1917
+ name: "sort-down",
1918
+ size: 12
1919
+ })
1920
+ ])
1921
+ ], 2)) : H("", !0)
1922
+ ], 14, vt))), 128))
1625
1923
  ])
1626
- ])) : S("", !0),
1627
- y("tbody", null, [
1628
- (c(!0), h(R, null, U(W.value, (n, e) => (c(), h(R, {
1629
- key: L(n.row)
1924
+ ])) : H("", !0),
1925
+ g("tbody", null, [
1926
+ (h(!0), v(G, null, J(R.value, (c, t) => (h(), v(G, {
1927
+ key: A(c.row)
1630
1928
  }, [
1631
- n.visible ? (c(), h("tr", {
1929
+ c.visible ? (h(), v("tr", {
1632
1930
  key: 0,
1633
- class: g([f(i).e("row"), f(i).is("level-" + n.level)])
1931
+ class: u([i(n).e("row"), i(n).is("level-" + c.level)])
1634
1932
  }, [
1635
- (c(!0), h(R, null, U(k.value, (a, d) => (c(), h("td", {
1636
- key: a.prop,
1637
- class: g(f(i).e("cell")),
1638
- style: j(F(a))
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))
1639
1937
  }, [
1640
- d === 0 ? (c(), h("div", {
1938
+ f === 0 ? (h(), v("div", {
1641
1939
  key: 0,
1642
- class: g(f(i).e("cell-content"))
1940
+ class: u(i(n).e("cell-content"))
1643
1941
  }, [
1644
- y("span", {
1645
- class: g(f(i).e("indent")),
1646
- style: j({ width: `${n.level * l.indent}px` })
1942
+ g("span", {
1943
+ class: u(i(n).e("indent")),
1944
+ style: j({ width: `${c.level * s.indent}px` })
1647
1945
  }, null, 6),
1648
- $(n.row) ? (c(), h("span", {
1946
+ C(c.row) ? (h(), v("span", {
1649
1947
  key: 0,
1650
- class: g([f(i).e("expand-icon"), f(i).is("expanded", K(n.row))]),
1651
- onClick: de((p) => N(n.row), ["stop"])
1948
+ class: u([i(n).e("expand-icon"), i(n).is("expanded", z(c.row))]),
1949
+ onClick: se((p) => D(c.row), ["stop"])
1652
1950
  }, [
1653
- K(n.row) ? (c(), h("span", st, "▼")) : (c(), h("span", lt, "▶"))
1654
- ], 10, nt)) : (c(), h("span", {
1951
+ z(c.row) ? (h(), te(i(Z), {
1952
+ key: 0,
1953
+ name: "chevron-down",
1954
+ size: 14
1955
+ })) : (h(), te(i(Z), {
1956
+ key: 1,
1957
+ name: "chevron-right",
1958
+ size: 14
1959
+ }))
1960
+ ], 10, gt)) : (h(), v("span", {
1655
1961
  key: 1,
1656
- class: g(f(i).e("expand-placeholder"))
1962
+ class: u(i(n).e("expand-placeholder"))
1657
1963
  }, null, 2)),
1658
- y("span", null, [
1659
- b.value[a.prop] ? (c(), se(ce(() => b.value[a.prop]({ row: n.row, column: a, $index: e })), { key: 0 })) : (c(), h(R, { key: 1 }, [
1660
- J(A(Q(n.row, a, e)), 1)
1964
+ g("span", null, [
1965
+ y.value[o.prop] ? (h(), te(he(() => y.value[o.prop]({ row: c.row, column: o, $index: t })), { key: 0 })) : (h(), v(G, { key: 1 }, [
1966
+ q(T(O(c.row, o, t)), 1)
1661
1967
  ], 64))
1662
1968
  ])
1663
- ], 2)) : b.value[a.prop] ? (c(), se(ce(() => b.value[a.prop]({ row: n.row, column: a, $index: e })), { key: 1 })) : (c(), h(R, { key: 2 }, [
1664
- J(A(Q(n.row, a, e)), 1)
1969
+ ], 2)) : y.value[o.prop] ? (h(), te(he(() => y.value[o.prop]({ row: c.row, column: o, $index: t })), { key: 1 })) : (h(), v(G, { key: 2 }, [
1970
+ q(T(O(c.row, o, t)), 1)
1665
1971
  ], 64))
1666
1972
  ], 6))), 128))
1667
- ], 2)) : S("", !0)
1973
+ ], 2)) : H("", !0)
1668
1974
  ], 64))), 128)),
1669
- W.value.length === 0 && !l.loading ? (c(), h("tr", ot, [
1670
- y("td", {
1671
- colspan: k.value.length || 1,
1672
- class: g(f(i).e("empty"))
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"))
1673
1979
  }, [
1674
- B(v.$slots, "empty", {}, () => [
1675
- J(A(l.emptyText), 1)
1980
+ E(b.$slots, "empty", {}, () => [
1981
+ q(T(s.emptyText), 1)
1676
1982
  ])
1677
- ], 10, it)
1678
- ])) : S("", !0)
1983
+ ], 10, Mt)
1984
+ ])) : H("", !0)
1679
1985
  ])
1680
1986
  ])
1681
1987
  ], 2),
1682
- y("div", rt, [
1683
- B(v.$slots, "default")
1988
+ g("div", kt, [
1989
+ E(b.$slots, "default")
1684
1990
  ])
1685
1991
  ], 2));
1686
1992
  }
1687
- }), St = /* @__PURE__ */ G({
1993
+ }), Wt = /* @__PURE__ */ Y({
1688
1994
  name: "XTreeTableColumn",
1689
1995
  __name: "TreeTableColumn",
1690
1996
  props: {
@@ -1697,28 +2003,28 @@ const mt = /* @__PURE__ */ G({
1697
2003
  fixed: { type: [String, Boolean] },
1698
2004
  formatter: {}
1699
2005
  },
1700
- setup(l) {
1701
- const o = l;
1702
- Y("tree-table-column");
1703
- const r = ue(), t = oe("x-tree-table"), u = x(() => ({
1704
- prop: o.prop,
1705
- label: o.label,
1706
- width: o.width,
1707
- minWidth: o.minWidth,
1708
- align: o.align,
1709
- sortable: o.sortable,
1710
- fixed: o.fixed,
1711
- formatter: o.formatter
2006
+ setup(s) {
2007
+ const r = s;
2008
+ Q("tree-table-column");
2009
+ const a = fe(), e = de("x-tree-table"), d = 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
1712
2018
  }));
1713
- return ie(() => {
1714
- t != null && t.registerColumn && t.registerColumn(u.value, r.default);
1715
- }), q(() => r.default, (i) => {
1716
- t != null && t.updateColumnSlot && i && t.updateColumnSlot(o.prop, i);
1717
- }, { immediate: !0 }), re(() => {
1718
- t != null && t.unregisterColumn && t.unregisterColumn(o.prop);
1719
- }), (i, s) => null;
2019
+ return re(() => {
2020
+ e != null && e.registerColumn && e.registerColumn(d.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;
1720
2026
  }
1721
- }), dt = ["src", "alt"], Kt = /* @__PURE__ */ G({
2027
+ }), wt = ["src", "alt"], Ot = /* @__PURE__ */ Y({
1722
2028
  name: "XAvatar",
1723
2029
  __name: "index",
1724
2030
  props: {
@@ -1730,39 +2036,39 @@ const mt = /* @__PURE__ */ G({
1730
2036
  alt: {}
1731
2037
  },
1732
2038
  emits: ["error"],
1733
- setup(l, { emit: o }) {
1734
- const r = l, t = o, u = Y("avatar"), i = x(() => [
1735
- u.b(),
1736
- u.m(r.shape),
1737
- typeof r.size == "string" ? u.m(r.size) : ""
1738
- ]), s = x(() => {
1739
- const b = {};
1740
- return typeof r.size == "number" && (b.width = `${r.size}px`, b.height = `${r.size}px`, b.lineHeight = `${r.size}px`), b;
1741
- }), k = (b) => {
1742
- t("error", b);
2039
+ setup(s, { emit: r }) {
2040
+ const a = s, e = r, d = Q("avatar"), n = M(() => [
2041
+ d.b(),
2042
+ d.m(a.shape),
2043
+ typeof a.size == "string" ? d.m(a.size) : ""
2044
+ ]), l = M(() => {
2045
+ 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) => {
2048
+ e("error", y);
1743
2049
  };
1744
- return (b, M) => (c(), h("span", {
1745
- class: g(i.value),
1746
- style: j(s.value)
2050
+ return (y, w) => (h(), v("span", {
2051
+ class: u(n.value),
2052
+ style: j(l.value)
1747
2053
  }, [
1748
- l.src ? (c(), h("img", {
2054
+ s.src ? (h(), v("img", {
1749
2055
  key: 0,
1750
- src: l.src,
1751
- alt: l.alt,
1752
- style: j({ objectFit: l.fit }),
1753
- onError: k
1754
- }, null, 44, dt)) : l.icon ? (c(), h("span", {
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", {
1755
2061
  key: 1,
1756
- class: g(f(u).e("icon"))
1757
- }, A(l.icon), 3)) : (c(), h("span", {
2062
+ class: u(i(d).e("icon"))
2063
+ }, T(s.icon), 3)) : (h(), v("span", {
1758
2064
  key: 2,
1759
- class: g(f(u).e("default"))
2065
+ class: u(i(d).e("default"))
1760
2066
  }, [
1761
- B(b.$slots, "default")
2067
+ E(y.$slots, "default")
1762
2068
  ], 2))
1763
2069
  ], 6));
1764
2070
  }
1765
- }), Nt = /* @__PURE__ */ G({
2071
+ }), Yt = /* @__PURE__ */ Y({
1766
2072
  name: "XDescriptions",
1767
2073
  __name: "index",
1768
2074
  props: {
@@ -1775,36 +2081,36 @@ const mt = /* @__PURE__ */ G({
1775
2081
  contentAlign: { default: "left" },
1776
2082
  colon: { type: Boolean, default: !0 }
1777
2083
  },
1778
- setup(l) {
1779
- const o = l, r = Y("descriptions");
1780
- le("x-descriptions", {
1781
- props: o,
1782
- column: x(() => o.column)
2084
+ setup(s) {
2085
+ const r = s, a = Q("descriptions");
2086
+ ie("x-descriptions", {
2087
+ props: r,
2088
+ column: M(() => r.column)
1783
2089
  });
1784
- const t = x(() => [
1785
- r.b(),
1786
- r.m(o.size),
1787
- r.is("bordered", o.border)
2090
+ const e = M(() => [
2091
+ a.b(),
2092
+ a.m(r.size),
2093
+ a.is("bordered", r.border)
1788
2094
  ]);
1789
- return (u, i) => (c(), h("div", {
1790
- class: g(t.value)
2095
+ return (d, n) => (h(), v("div", {
2096
+ class: u(e.value)
1791
2097
  }, [
1792
- l.title ? (c(), h("div", {
2098
+ s.title ? (h(), v("div", {
1793
2099
  key: 0,
1794
- class: g(f(r).e("title"))
1795
- }, A(l.title), 3)) : S("", !0),
1796
- y("div", {
1797
- class: g(f(r).e("body"))
2100
+ class: u(i(a).e("title"))
2101
+ }, T(s.title), 3)) : H("", !0),
2102
+ g("div", {
2103
+ class: u(i(a).e("body"))
1798
2104
  }, [
1799
- y("table", null, [
1800
- y("tbody", null, [
1801
- B(u.$slots, "default")
2105
+ g("table", null, [
2106
+ g("tbody", null, [
2107
+ E(d.$slots, "default")
1802
2108
  ])
1803
2109
  ])
1804
2110
  ], 2)
1805
2111
  ], 2));
1806
2112
  }
1807
- }), ct = ["colspan"], ut = ["colspan"], zt = /* @__PURE__ */ G({
2113
+ }), bt = ["colspan"], xt = ["colspan"], Xt = /* @__PURE__ */ Y({
1808
2114
  name: "XDescriptionsItem",
1809
2115
  __name: "DescriptionsItem",
1810
2116
  props: {
@@ -1813,52 +2119,52 @@ const mt = /* @__PURE__ */ G({
1813
2119
  labelAlign: {},
1814
2120
  contentAlign: {}
1815
2121
  },
1816
- setup(l) {
1817
- const o = l, r = Y("descriptions-item"), t = oe("x-descriptions"), u = x(() => {
1818
- var T;
1819
- const M = {}, C = (T = t == null ? void 0 : t.props) == null ? void 0 : T.labelWidth;
1820
- return C && (M.width = typeof C == "number" ? `${C}px` : C), M;
1821
- }), i = x(() => {
1822
- var M;
1823
- return o.labelAlign || ((M = t == null ? void 0 : t.props) == null ? void 0 : M.labelAlign) || "right";
1824
- }), s = x(() => {
1825
- var M;
1826
- return o.contentAlign || ((M = t == null ? void 0 : t.props) == null ? void 0 : M.contentAlign) || "left";
1827
- }), k = x(() => {
1828
- var M;
1829
- return ((M = t == null ? void 0 : t.props) == null ? void 0 : M.colon) ?? !0;
1830
- }), b = x(() => {
1831
- var M;
1832
- return ((M = t == null ? void 0 : t.props) == null ? void 0 : M.border) ?? !1;
2122
+ setup(s) {
2123
+ const r = s, a = Q("descriptions-item"), e = de("x-descriptions"), d = 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;
1833
2139
  });
1834
- return (M, C) => b.value ? (c(), h(R, { key: 0 }, [
1835
- y("th", {
1836
- class: g([f(r).b(), f(r).e("label"), `is-${i.value}`]),
1837
- style: j(u.value)
1838
- }, A(l.label) + A(k.value ? ":" : ""), 7),
1839
- y("td", {
1840
- class: g([f(r).e("content"), `is-${s.value}`]),
1841
- colspan: l.span * 2 - 1
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(d.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
1842
2148
  }, [
1843
- B(M.$slots, "default")
1844
- ], 10, ct)
1845
- ], 64)) : (c(), h("tr", {
2149
+ E(w.$slots, "default")
2150
+ ], 10, bt)
2151
+ ], 64)) : (h(), v("tr", {
1846
2152
  key: 1,
1847
- class: g(f(r).b())
2153
+ class: u(i(a).b())
1848
2154
  }, [
1849
- y("th", {
1850
- class: g([f(r).e("label"), `is-${i.value}`]),
1851
- style: j(u.value)
1852
- }, A(l.label) + A(k.value ? ":" : ""), 7),
1853
- y("td", {
1854
- class: g([f(r).e("content"), `is-${s.value}`]),
1855
- colspan: l.span * 2 - 1
2155
+ g("th", {
2156
+ class: u([i(a).e("label"), `is-${n.value}`]),
2157
+ style: j(d.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
1856
2162
  }, [
1857
- B(M.$slots, "default")
1858
- ], 10, ut)
2163
+ E(w.$slots, "default")
2164
+ ], 10, xt)
1859
2165
  ], 2));
1860
2166
  }
1861
- }), Dt = /* @__PURE__ */ G({
2167
+ }), Qt = /* @__PURE__ */ Y({
1862
2168
  name: "XScrollbar",
1863
2169
  __name: "index",
1864
2170
  props: {
@@ -1875,90 +2181,645 @@ const mt = /* @__PURE__ */ G({
1875
2181
  minSize: { default: 20 }
1876
2182
  },
1877
2183
  emits: ["scroll"],
1878
- setup(l, { expose: o, emit: r }) {
1879
- const t = l, u = r, i = Y("scrollbar"), s = P(), k = P(), b = P("0"), M = P("0"), C = P(0), T = P(0), L = x(() => {
1880
- const E = {};
1881
- return t.height && (E.height = typeof t.height == "number" ? `${t.height}px` : t.height), t.maxHeight && (E.maxHeight = typeof t.maxHeight == "number" ? `${t.maxHeight}px` : t.maxHeight), E;
1882
- }), w = () => {
1883
- if (!s.value) return;
1884
- const E = s.value.offsetHeight - 4, z = s.value.offsetWidth - 4, W = s.value.scrollHeight, Z = s.value.scrollWidth, O = E / W, Q = z / Z;
1885
- M.value = O >= 1 ? "0" : `${E * O}px`, b.value = Q >= 1 ? "0" : `${z * Q}px`;
1886
- }, $ = (E) => {
1887
- if (!s.value) return;
1888
- const z = s.value.offsetHeight, W = s.value.offsetWidth;
1889
- T.value = s.value.scrollTop * 100 / z, C.value = s.value.scrollLeft * 100 / W, u("scroll", E);
1890
- }, K = (E) => {
1891
- var z;
1892
- (z = s.value) == null || z.scrollTo(E);
1893
- }, N = (E) => {
1894
- s.value && (s.value.scrollTop = E);
1895
- }, V = (E) => {
1896
- s.value && (s.value.scrollLeft = E);
2184
+ setup(s, { expose: r, emit: a }) {
2185
+ const e = s, d = a, n = Q("scrollbar"), l = V(), m = V(), y = V("0"), w = V("0"), x = V(0), N = V(0), A = 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, U = l.value.scrollWidth, B = S / R, O = L / U;
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, d("scroll", S);
2196
+ }, z = (S) => {
2197
+ var L;
2198
+ (L = l.value) == null || L.scrollTo(S);
2199
+ }, D = (S) => {
2200
+ l.value && (l.value.scrollTop = S);
2201
+ }, W = (S) => {
2202
+ l.value && (l.value.scrollLeft = S);
1897
2203
  };
1898
- let X = null;
1899
- return ie(() => {
1900
- t.native || (pe(w), t.noresize || (X = new ResizeObserver(w), k.value && X.observe(k.value), window.addEventListener("resize", w)));
1901
- }), re(() => {
1902
- X && X.disconnect(), window.removeEventListener("resize", w);
1903
- }), o({
1904
- scrollTo: K,
1905
- setScrollTop: N,
1906
- setScrollLeft: V,
1907
- update: w
1908
- }), (E, z) => (c(), h("div", {
1909
- class: g(f(i).b())
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: D,
2212
+ setScrollLeft: W,
2213
+ update: k
2214
+ }), (S, L) => (h(), v("div", {
2215
+ class: u(i(n).b())
1910
2216
  }, [
1911
- y("div", {
2217
+ g("div", {
1912
2218
  ref_key: "wrapRef",
1913
- ref: s,
1914
- class: g([f(i).e("wrap"), l.wrapClass, { [f(i).em("wrap", "hidden-default")]: !l.native }]),
1915
- style: j([L.value, { overflow: l.native ? "auto" : "hidden" }]),
1916
- onScroll: $
2219
+ ref: l,
2220
+ class: u([i(n).e("wrap"), s.wrapClass, { [i(n).em("wrap", "hidden-default")]: !s.native }]),
2221
+ style: j([A.value, { overflow: s.native ? "auto" : "hidden" }]),
2222
+ onScroll: C
1917
2223
  }, [
1918
- (c(), se(ce(l.tag), {
2224
+ (h(), te(he(s.tag), {
1919
2225
  ref_key: "resizeRef",
1920
- ref: k,
1921
- class: g([f(i).e("view"), l.viewClass]),
1922
- style: j(l.viewStyle)
2226
+ ref: m,
2227
+ class: u([i(n).e("view"), s.viewClass]),
2228
+ style: j(s.viewStyle)
1923
2229
  }, {
1924
- default: he(() => [
1925
- B(E.$slots, "default")
2230
+ default: ve(() => [
2231
+ E(S.$slots, "default")
1926
2232
  ]),
1927
2233
  _: 3
1928
2234
  }, 8, ["class", "style"]))
1929
2235
  ], 38),
1930
- !l.native && M.value ? (c(), h("div", {
2236
+ !s.native && w.value ? (h(), v("div", {
2237
+ 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", {
2242
+ 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)
2246
+ ], 2));
2247
+ }
2248
+ }), Gt = /* @__PURE__ */ Y({
2249
+ name: "XCollapse",
2250
+ __name: "index",
2251
+ props: {
2252
+ modelValue: { default: () => [] },
2253
+ accordion: { type: Boolean, default: !1 }
2254
+ },
2255
+ emits: ["update:modelValue", "change"],
2256
+ setup(s, { emit: r }) {
2257
+ const a = s, e = r, d = 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);
2266
+ } 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);
2269
+ }
2270
+ }
2271
+ }), (m, y) => (h(), v("div", {
2272
+ class: u(i(d).b())
2273
+ }, [
2274
+ E(m.$slots, "default")
2275
+ ], 2));
2276
+ }
2277
+ }), Zt = /* @__PURE__ */ Y({
2278
+ name: "XCollapseItem",
2279
+ __name: "CollapseItem",
2280
+ props: {
2281
+ name: {},
2282
+ title: {},
2283
+ disabled: { type: Boolean }
2284
+ },
2285
+ setup(s) {
2286
+ const r = s, a = Q("collapse-item"), e = de("collapse"), { activeNames: d, handleItemClick: n } = e, l = M(() => d.value.includes(r.name)), m = () => {
2287
+ r.disabled || n(r.name);
2288
+ };
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)])
2291
+ }, [
2292
+ g("div", {
2293
+ class: u(i(a).e("header")),
2294
+ onClick: m
2295
+ }, [
2296
+ g("span", {
2297
+ class: u(i(a).e("arrow"))
2298
+ }, [
2299
+ F(i(Z), {
2300
+ name: "right",
2301
+ size: 12
2302
+ })
2303
+ ], 2),
2304
+ E(y.$slots, "title", {}, () => [
2305
+ q(T(s.title), 1)
2306
+ ])
2307
+ ], 2),
2308
+ pe(g("div", {
2309
+ class: u(i(a).e("content"))
2310
+ }, [
2311
+ g("div", {
2312
+ class: u(i(a).e("content-box"))
2313
+ }, [
2314
+ E(y.$slots, "default")
2315
+ ], 2)
2316
+ ], 2), [
2317
+ [me, l.value]
2318
+ ])
2319
+ ], 2));
2320
+ }
2321
+ }), Ct = ["src", "loading"], zt = ["src"], Ut = /* @__PURE__ */ Y({
2322
+ name: "XImage",
2323
+ __name: "index",
2324
+ props: {
2325
+ src: { default: "" },
2326
+ previewList: { default: () => [] },
2327
+ initialIndex: { default: 0 },
2328
+ preview: { type: Boolean, default: !0 },
2329
+ width: {},
2330
+ height: {},
2331
+ fit: { default: "cover" },
2332
+ error: {},
2333
+ placeholder: {},
2334
+ lazy: { type: Boolean, default: !1 }
2335
+ },
2336
+ emits: ["load", "error"],
2337
+ setup(s, { emit: r }) {
2338
+ const a = s, e = r, d = 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]), A = (S) => {
2343
+ n.value = !1, e("load", S);
2344
+ }, k = (S) => {
2345
+ n.value = !1, l.value = !0, e("error", S);
2346
+ }, C = () => {
2347
+ a.preview && (y.value = a.initialIndex, m.value = !0);
2348
+ }, z = () => {
2349
+ m.value = !1;
2350
+ }, D = () => {
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) {
2357
+ case "ArrowLeft":
2358
+ D();
2359
+ break;
2360
+ case "ArrowRight":
2361
+ W();
2362
+ break;
2363
+ case "Escape":
2364
+ z();
2365
+ break;
2366
+ }
2367
+ };
2368
+ return typeof window < "u" && window.addEventListener("keydown", I), (S, L) => (h(), v("div", {
2369
+ class: u(i(d).b()),
2370
+ style: j({ width: w.value.width, height: w.value.height })
2371
+ }, [
2372
+ g("img", {
2373
+ src: s.src,
2374
+ class: u(i(d).e("inner")),
2375
+ style: j(w.value),
2376
+ loading: s.lazy ? "lazy" : "eager",
2377
+ onLoad: A,
2378
+ onError: k,
2379
+ onClick: C
2380
+ }, null, 46, Ct),
2381
+ n.value ? (h(), v("div", {
1931
2382
  key: 0,
1932
- class: g([f(i).e("bar"), f(i).is("vertical")]),
1933
- style: j({ height: M.value, top: `${T.value}%` })
1934
- }, null, 6)) : S("", !0),
1935
- !l.native && b.value ? (c(), h("div", {
2383
+ class: u(i(d).e("placeholder"))
2384
+ }, [
2385
+ E(S.$slots, "placeholder", {}, () => [
2386
+ F(i(Z), {
2387
+ name: "loading",
2388
+ size: 24
2389
+ })
2390
+ ])
2391
+ ], 2)) : H("", !0),
2392
+ l.value ? (h(), v("div", {
1936
2393
  key: 1,
1937
- class: g([f(i).e("bar"), f(i).is("horizontal")]),
1938
- style: j({ width: b.value, left: `${C.value}%` })
1939
- }, null, 6)) : S("", !0)
2394
+ class: u(i(d).e("error"))
2395
+ }, [
2396
+ E(S.$slots, "error", {}, () => [
2397
+ F(i(Z), {
2398
+ name: "image",
2399
+ size: 24
2400
+ }),
2401
+ L[1] || (L[1] = g("span", null, "加载失败", -1))
2402
+ ])
2403
+ ], 2)) : H("", !0),
2404
+ (h(), te(xe, { to: "body" }, [
2405
+ m.value ? (h(), v("div", {
2406
+ key: 0,
2407
+ class: u(i(d).e("preview")),
2408
+ onClick: z
2409
+ }, [
2410
+ g("span", {
2411
+ class: u(i(d).e("preview-close")),
2412
+ onClick: se(z, ["stop"])
2413
+ }, [
2414
+ F(i(Z), {
2415
+ name: "close",
2416
+ size: 24
2417
+ })
2418
+ ], 2),
2419
+ g("img", {
2420
+ src: N.value,
2421
+ class: u(i(d).e("preview-image")),
2422
+ onClick: L[0] || (L[0] = se(() => {
2423
+ }, ["stop"]))
2424
+ }, null, 10, zt),
2425
+ x.value.length > 1 ? (h(), v("span", {
2426
+ key: 0,
2427
+ class: u([i(d).e("preview-arrow"), i(d).em("preview-arrow", "left")]),
2428
+ onClick: se(D, ["stop"])
2429
+ }, [
2430
+ F(i(Z), {
2431
+ name: "left",
2432
+ size: 24
2433
+ })
2434
+ ], 2)) : H("", !0),
2435
+ x.value.length > 1 ? (h(), v("span", {
2436
+ key: 1,
2437
+ class: u([i(d).e("preview-arrow"), i(d).em("preview-arrow", "right")]),
2438
+ onClick: se(W, ["stop"])
2439
+ }, [
2440
+ F(i(Z), {
2441
+ name: "right",
2442
+ size: 24
2443
+ })
2444
+ ], 2)) : H("", !0),
2445
+ x.value.length > 1 ? (h(), v("div", {
2446
+ key: 2,
2447
+ class: u(i(d).e("preview-counter"))
2448
+ }, T(y.value + 1) + " / " + T(x.value.length), 3)) : H("", !0)
2449
+ ], 2)) : H("", !0)
2450
+ ]))
2451
+ ], 6));
2452
+ }
2453
+ }), It = ["onClick"], Ft = /* @__PURE__ */ Y({
2454
+ name: "XCalendar",
2455
+ __name: "index",
2456
+ props: {
2457
+ modelValue: { default: () => /* @__PURE__ */ new Date() },
2458
+ range: {}
2459
+ },
2460
+ emits: ["update:modelValue", "select", "change"],
2461
+ setup(s, { emit: r }) {
2462
+ const a = s, e = r, d = 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,
2468
+ isCurrentMonth: !1,
2469
+ isToday: N(O, w),
2470
+ isSelected: N(O, a.modelValue)
2471
+ });
2472
+ }
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,
2477
+ isCurrentMonth: !0,
2478
+ isToday: N(O, w),
2479
+ isSelected: N(O, a.modelValue)
2480
+ });
2481
+ }
2482
+ const U = 42 - I.length;
2483
+ for (let B = 1; B <= U; B++) {
2484
+ const O = new Date(n.value, l.value + 1, B);
2485
+ I.push({
2486
+ date: O,
2487
+ isCurrentMonth: !1,
2488
+ isToday: N(O, w),
2489
+ isSelected: N(O, a.modelValue)
2490
+ });
2491
+ }
2492
+ return I;
2493
+ }), N = (I, S) => I.getFullYear() === S.getFullYear() && I.getMonth() === S.getMonth() && I.getDate() === S.getDate(), A = (I) => {
2494
+ e("update:modelValue", I.date), e("select", I.date), e("change", I.date);
2495
+ }, k = () => {
2496
+ n.value--;
2497
+ }, C = () => {
2498
+ n.value++;
2499
+ }, z = () => {
2500
+ l.value === 0 ? (l.value = 11, n.value--) : l.value--;
2501
+ }, D = () => {
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);
2505
+ };
2506
+ return _(() => a.modelValue, (I) => {
2507
+ n.value = I.getFullYear(), l.value = I.getMonth();
2508
+ }), (I, S) => (h(), v("div", {
2509
+ class: u(i(d).b())
2510
+ }, [
2511
+ g("div", {
2512
+ class: u(i(d).e("header"))
2513
+ }, [
2514
+ g("div", {
2515
+ class: u(i(d).e("title"))
2516
+ }, T(n.value) + " 年 " + T(y[l.value]), 3),
2517
+ g("div", {
2518
+ class: u(i(d).e("actions"))
2519
+ }, [
2520
+ g("button", {
2521
+ class: u(i(d).e("btn")),
2522
+ onClick: k
2523
+ }, [
2524
+ F(i(Z), {
2525
+ name: "d-arrow-left",
2526
+ size: 12
2527
+ })
2528
+ ], 2),
2529
+ g("button", {
2530
+ class: u(i(d).e("btn")),
2531
+ onClick: z
2532
+ }, [
2533
+ F(i(Z), {
2534
+ name: "arrow-left",
2535
+ size: 12
2536
+ })
2537
+ ], 2),
2538
+ g("button", {
2539
+ class: u(i(d).e("btn")),
2540
+ onClick: W
2541
+ }, "今天", 2),
2542
+ g("button", {
2543
+ class: u(i(d).e("btn")),
2544
+ onClick: D
2545
+ }, [
2546
+ F(i(Z), {
2547
+ name: "arrow-right",
2548
+ size: 12
2549
+ })
2550
+ ], 2),
2551
+ g("button", {
2552
+ class: u(i(d).e("btn")),
2553
+ onClick: C
2554
+ }, [
2555
+ F(i(Z), {
2556
+ name: "d-arrow-right",
2557
+ size: 12
2558
+ })
2559
+ ], 2)
2560
+ ], 2)
2561
+ ], 2),
2562
+ g("div", {
2563
+ class: u(i(d).e("weekdays"))
2564
+ }, [
2565
+ (h(), v(G, null, J(m, (L) => g("div", {
2566
+ key: L,
2567
+ class: u(i(d).e("weekday"))
2568
+ }, T(L), 3)), 64))
2569
+ ], 2),
2570
+ g("div", {
2571
+ class: u(i(d).e("body"))
2572
+ }, [
2573
+ (h(!0), v(G, null, J(x.value, (L, R) => (h(), v("div", {
2574
+ key: R,
2575
+ class: u([
2576
+ i(d).e("day"),
2577
+ i(d).is("current-month", L.isCurrentMonth),
2578
+ i(d).is("today", L.isToday),
2579
+ i(d).is("selected", L.isSelected)
2580
+ ]),
2581
+ onClick: (U) => A(L)
2582
+ }, [
2583
+ E(I.$slots, "default", {
2584
+ date: L.date,
2585
+ isCurrentMonth: L.isCurrentMonth
2586
+ }, () => [
2587
+ q(T(L.date.getDate()), 1)
2588
+ ])
2589
+ ], 10, It))), 128))
2590
+ ], 2)
2591
+ ], 2));
2592
+ }
2593
+ }), Jt = /* @__PURE__ */ Y({
2594
+ name: "XQRCode",
2595
+ __name: "index",
2596
+ props: {
2597
+ value: { default: "" },
2598
+ size: { default: 128 },
2599
+ bgColor: { default: "#ffffff" },
2600
+ fgColor: { default: "#000000" },
2601
+ level: { default: "M" },
2602
+ showDownload: { type: Boolean, default: !1 }
2603
+ },
2604
+ emits: ["ready", "error"],
2605
+ setup(s, { emit: r }) {
2606
+ const a = s, e = r, d = Q("qrcode"), n = V(), l = async () => {
2607
+ if (!(!n.value || !a.value))
2608
+ try {
2609
+ const A = await m(a.value, a.level);
2610
+ x(A), e("ready", n.value);
2611
+ } catch (A) {
2612
+ e("error", A);
2613
+ }
2614
+ }, m = async (A, 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 D = new TextEncoder().encode(A);
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 < D.length) {
2629
+ const U = D[W];
2630
+ for (let B = 7; B >= 0 && !(S < 21 && !w(R, S, 21) && (z[S][R] = U >> B & 1, S++, S >= 21)); B--)
2631
+ ;
2632
+ W++;
2633
+ }
2634
+ }
2635
+ }
2636
+ return z;
2637
+ }, y = (A, k, C) => {
2638
+ for (let z = 0; z < 7; z++)
2639
+ for (let D = 0; D < 7; D++)
2640
+ (z === 0 || z === 6 || D === 0 || D === 6 || z >= 2 && z <= 4 && D >= 2 && D <= 4) && (A[k + z][C + D] = 1);
2641
+ }, w = (A, k, C) => A < 8 && k < 8 || A < 8 && k >= C - 8 || A >= C - 8 && k < 8 || A === 6 || k === 6, x = (A) => {
2642
+ if (!n.value) return;
2643
+ const k = n.value.getContext("2d");
2644
+ if (!k) return;
2645
+ const C = A.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 D = 0; D < C; D++)
2648
+ for (let W = 0; W < C; W++)
2649
+ A[D][W] && k.fillRect(W * z, D * z, z, z);
2650
+ }, N = () => {
2651
+ if (!n.value) return;
2652
+ const A = document.createElement("a");
2653
+ A.download = "qrcode.png", A.href = n.value.toDataURL("image/png"), A.click();
2654
+ };
2655
+ return _(() => [a.value, a.size, a.bgColor, a.fgColor, a.level], () => {
2656
+ l();
2657
+ }), re(() => {
2658
+ l();
2659
+ }), (A, k) => (h(), v("div", {
2660
+ class: u(i(d).b())
2661
+ }, [
2662
+ g("canvas", {
2663
+ ref_key: "canvasRef",
2664
+ ref: n,
2665
+ class: u(i(d).e("canvas"))
2666
+ }, null, 2),
2667
+ s.showDownload ? (h(), v("div", {
2668
+ key: 0,
2669
+ class: u(i(d).e("actions"))
2670
+ }, [
2671
+ g("button", {
2672
+ class: u(i(d).e("download")),
2673
+ onClick: N
2674
+ }, " 下载二维码 ", 2)
2675
+ ], 2)) : H("", !0)
2676
+ ], 2));
2677
+ }
2678
+ }), qt = /* @__PURE__ */ Y({
2679
+ name: "XVirtualScroll",
2680
+ __name: "index",
2681
+ props: {
2682
+ items: { default: () => [] },
2683
+ itemSize: { default: 50 },
2684
+ height: { default: 400 },
2685
+ buffer: { default: 5 },
2686
+ virtual: { type: Boolean, default: !0 }
2687
+ },
2688
+ emits: ["scroll"],
2689
+ setup(s, { expose: r, emit: a }) {
2690
+ const e = s, d = 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
+ if (!e.virtual) return 0;
2695
+ const I = Math.floor(m.value / e.itemSize) - e.buffer;
2696
+ return Math.max(0, I);
2697
+ }), A = M(() => e.virtual ? Math.min(e.items.length, N.value + x.value) : e.items.length), k = M(() => e.virtual ? e.items.slice(N.value, A.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, d("scroll", m.value);
2703
+ };
2704
+ return r({
2705
+ scrollToIndex: (I) => {
2706
+ l.value && (l.value.scrollTop = I * e.itemSize);
2707
+ },
2708
+ scrollToBottom: () => {
2709
+ l.value && (l.value.scrollTop = w.value);
2710
+ }
2711
+ }), (I, S) => (h(), v("div", {
2712
+ ref_key: "containerRef",
2713
+ ref: l,
2714
+ class: u(i(n).b()),
2715
+ style: j({ height: y.value }),
2716
+ onScroll: z
2717
+ }, [
2718
+ g("div", {
2719
+ class: u(i(n).e("wrapper")),
2720
+ style: j({ height: `${w.value}px` })
2721
+ }, [
2722
+ g("div", {
2723
+ class: u(i(n).e("content")),
2724
+ style: j({ transform: `translateY(${C.value}px)` })
2725
+ }, [
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` })
2730
+ }, [
2731
+ E(I.$slots, "default", {
2732
+ item: L,
2733
+ index: L.index
2734
+ })
2735
+ ], 6))), 128))
2736
+ ], 6)
2737
+ ], 6)
2738
+ ], 38));
2739
+ }
2740
+ }), _t = /* @__PURE__ */ Y({
2741
+ name: "XInfiniteScroll",
2742
+ __name: "index",
2743
+ props: {
2744
+ loading: { type: Boolean, default: !1 },
2745
+ finished: { type: Boolean, default: !1 },
2746
+ immediate: { type: Boolean, default: !0 },
2747
+ distance: { default: 50 },
2748
+ loadingText: { default: "加载中..." },
2749
+ finishedText: { default: "没有更多了" }
2750
+ },
2751
+ emits: ["load"],
2752
+ setup(s, { emit: r }) {
2753
+ const a = s, e = r, d = Q("infinite-scroll"), n = V(), l = V();
2754
+ let m = null;
2755
+ const y = () => {
2756
+ m && m.disconnect(), m = new IntersectionObserver(
2757
+ (w) => {
2758
+ w[0].isIntersecting && !a.loading && !a.finished && e("load");
2759
+ },
2760
+ {
2761
+ rootMargin: `${a.distance}px`
2762
+ }
2763
+ ), l.value && m.observe(l.value);
2764
+ };
2765
+ return re(() => {
2766
+ y(), a.immediate && !a.finished && e("load");
2767
+ }), Ce(() => {
2768
+ m && m.disconnect();
2769
+ }), (w, x) => (h(), v("div", {
2770
+ ref_key: "containerRef",
2771
+ ref: n,
2772
+ class: u(i(d).b())
2773
+ }, [
2774
+ E(w.$slots, "default"),
2775
+ g("div", {
2776
+ ref_key: "observerRef",
2777
+ ref: l,
2778
+ class: u(i(d).e("footer"))
2779
+ }, [
2780
+ s.loading ? (h(), v("span", {
2781
+ key: 0,
2782
+ class: u(i(d).e("loading"))
2783
+ }, [
2784
+ F(i(Z), {
2785
+ name: "loading",
2786
+ size: 16
2787
+ }),
2788
+ g("span", null, T(s.loadingText), 1)
2789
+ ], 2)) : s.finished ? (h(), v("span", {
2790
+ key: 1,
2791
+ class: u(i(d).e("finished"))
2792
+ }, T(s.finishedText), 3)) : H("", !0)
2793
+ ], 2)
1940
2794
  ], 2));
1941
2795
  }
1942
2796
  });
1943
2797
  export {
1944
- Kt as Avatar,
1945
- gt as Card,
1946
- Ct as Carousel,
1947
- wt as CarouselItem,
1948
- Nt as Descriptions,
1949
- zt as DescriptionsItem,
1950
- vt as DynamicTable,
1951
- kt as Empty,
1952
- Ne as Pagination,
1953
- yt as Progress,
1954
- Dt as Scrollbar,
1955
- It as Table,
1956
- $t as TableColumn,
1957
- pt as Tag,
1958
- xt as Timeline,
1959
- bt as TimelineItem,
1960
- mt as Tree,
1961
- te as TreeNode,
1962
- Mt as TreeTable,
1963
- St as TreeTableColumn
2798
+ Ot as Avatar,
2799
+ Ft as Calendar,
2800
+ At 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
+ Ut as Image,
2810
+ _t as InfiniteScroll,
2811
+ Ee as Pagination,
2812
+ Dt 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
1964
2825
  };