@xto/data 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es/index.mjs CHANGED
@@ -1,6 +1,259 @@
1
- import { defineComponent as O, computed as x, openBlock as c, createElementBlock as u, normalizeStyle as L, normalizeClass as f, renderSlot as j, unref as h, createCommentVNode as M, createTextVNode as J, toDisplayString as A, createElementVNode as m, ref as H, watch as F, Fragment as R, renderList as U, useSlots as de, withModifiers as re, inject as le, resolveComponent as ye, withDirectives as ge, createBlock as ae, withCtx as ce, vShow as ve, reactive as he, provide as ne, toRef as me, nextTick as fe, onMounted as se, onUnmounted as oe, resolveDynamicComponent as ie, createVNode as ke } from "vue";
2
- import { useNamespace as G } from "@xto/core";
3
- const ft = /* @__PURE__ */ O({
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 ft = /* @__PURE__ */ O({
12
265
  color: {}
13
266
  },
14
267
  emits: ["close"],
15
- setup(l, { emit: s }) {
16
- const i = l, e = s, y = G("tag"), r = x(() => [
17
- y.b(),
18
- y.m(i.type || "primary"),
19
- i.size !== "default" ? y.m(i.size) : "",
20
- y.m(i.effect),
21
- y.is("hit", i.hit)
22
- ]), n = x(() => i.color ? {
23
- backgroundColor: i.effect === "dark" ? i.color : "",
24
- borderColor: i.color,
25
- color: i.effect === "dark" ? "#fff" : i.color
26
- } : {}), k = (b) => {
27
- e("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, I) => (c(), u("span", {
30
- class: f(r.value),
31
- style: L(n.value)
282
+ return (y, w) => (h(), v("span", {
283
+ class: u(n.value),
284
+ style: j(l.value)
32
285
  }, [
33
- j(b.$slots, "default"),
34
- l.closable ? (c(), u("i", {
286
+ E(y.$slots, "default"),
287
+ s.closable ? (h(), v("i", {
35
288
  key: 0,
36
- class: f(h(y).e("close")),
37
- onClick: k
38
- }, "✕", 2)) : M("", !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
- }), pt = /* @__PURE__ */ O({
299
+ }), At = /* @__PURE__ */ Y({
42
300
  name: "XCard",
43
301
  __name: "index",
44
302
  props: {
@@ -46,31 +304,31 @@ const ft = /* @__PURE__ */ O({
46
304
  bodyStyle: { default: () => ({ padding: "20px" }) },
47
305
  shadow: { default: "always" }
48
306
  },
49
- setup(l) {
50
- const s = l, i = G("card"), e = x(() => [
51
- i.b(),
52
- i.is(`shadow-${s.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 (y, r) => (c(), u("div", {
55
- class: f(e.value)
312
+ return (d, n) => (h(), v("div", {
313
+ class: u(e.value)
56
314
  }, [
57
- l.header || y.$slots.header ? (c(), u("div", {
315
+ s.header || d.$slots.header ? (h(), v("div", {
58
316
  key: 0,
59
- class: f(h(i).e("header"))
317
+ class: u(i(a).e("header"))
60
318
  }, [
61
- j(y.$slots, "header", {}, () => [
62
- J(A(l.header), 1)
319
+ E(d.$slots, "header", {}, () => [
320
+ q(T(s.header), 1)
63
321
  ])
64
- ], 2)) : M("", !0),
65
- m("div", {
66
- class: f(h(i).e("body")),
67
- style: L(l.bodyStyle)
322
+ ], 2)) : H("", !0),
323
+ g("div", {
324
+ class: u(i(a).e("body")),
325
+ style: j(s.bodyStyle)
68
326
  }, [
69
- j(y.$slots, "default")
327
+ E(d.$slots, "default")
70
328
  ], 6)
71
329
  ], 2));
72
330
  }
73
- }), be = ["viewBox"], xe = ["cx", "cy", "r", "stroke-width"], Ce = ["cx", "cy", "r", "stroke-width", "stroke-dasharray", "stroke"], yt = /* @__PURE__ */ O({
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 ft = /* @__PURE__ */ O({
82
340
  width: { default: 126 },
83
341
  showText: { type: Boolean, default: !0 }
84
342
  },
85
- setup(l) {
86
- const s = l, i = G("progress"), e = x(() => Math.min(100, Math.max(0, s.percentage))), y = x(() => ({
343
+ setup(s) {
344
+ const r = s, a = Q("progress"), e = M(() => Math.min(100, Math.max(0, r.percentage))), d = M(() => ({
87
345
  width: `${e.value}%`,
88
- backgroundColor: typeof s.color == "function" ? s.color(e.value) : s.color
89
- })), r = x(() => [
90
- i.b(),
91
- i.m(s.type),
92
- i.is("show-text", s.showText),
93
- i.is(`status-${s.status || ""}`, s.status)
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(() => s.status === "success" ? "100%" : s.status === "warning" ? "Warning" : s.status === "exception" ? "Exception" : `${e.value}%`), (n, k) => (c(), u("div", {
96
- class: f(r.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(), u("div", {
356
+ s.type === "line" ? (h(), v("div", {
99
357
  key: 0,
100
- class: f(h(i).e("line"))
358
+ class: u(i(a).e("line"))
101
359
  }, [
102
- m("div", {
103
- class: f(h(i).e("outer"))
360
+ g("div", {
361
+ class: u(i(a).e("outer"))
104
362
  }, [
105
- m("div", {
106
- class: f(h(i).e("inner"))
363
+ g("div", {
364
+ class: u(i(a).e("inner"))
107
365
  }, [
108
- m("div", {
109
- class: f(h(i).e("bar")),
110
- style: L(y.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(), u("div", {
372
+ s.showText ? (h(), v("div", {
115
373
  key: 0,
116
- class: f(h(i).e("text"))
117
- }, A(e.value) + "% ", 3)) : M("", !0)
118
- ], 2)) : (c(), u("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: f(h(i).e("circle"))
378
+ class: u(i(a).e("circle"))
121
379
  }, [
122
- (c(), u("svg", {
123
- viewBox: `0 0 ${l.width} ${l.width}`,
124
- style: L({ 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
- m("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, xe),
134
- m("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": `${e.value / 100 * Math.PI * (l.width - l.strokeWidth)} ${Math.PI * (l.width - l.strokeWidth)}`,
141
- stroke: typeof l.color == "function" ? l.color(e.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, Ce)
145
- ], 12, be)),
146
- l.showText ? (c(), u("div", {
402
+ }, null, 8, De)
403
+ ], 12, Le)),
404
+ s.showText ? (h(), v("div", {
147
405
  key: 0,
148
- class: f(h(i).e("circle-text"))
149
- }, A(e.value) + "% ", 3)) : M("", !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
- }), we = ["disabled"], Ie = ["onClick"], Me = ["disabled"], $e = ["value"], Se = ["value"], Ke = /* @__PURE__ */ O({
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 ft = /* @__PURE__ */ O({
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: s }) {
165
- const i = l, e = s, y = G("pagination"), r = H(i.currentPage), n = H(i.pageSize);
166
- F(() => i.currentPage, (C) => {
167
- r.value = C;
168
- }), F(() => i.pageSize, (C) => {
169
- n.value = C;
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(() => r.value), b = x(() => n.value), I = x(() => Math.max(1, Math.ceil(i.total / b.value))), w = x(() => {
172
- const C = [], S = I.value, K = k.value;
173
- if (S <= 7)
174
- for (let N = 1; N <= S; N++) C.push(N);
175
- else if (K <= 4) {
176
- for (let N = 1; N <= 5; N++) C.push(N);
177
- C.push(-1), C.push(S);
178
- } else if (K >= S - 3) {
179
- C.push(1), C.push(-1);
180
- for (let N = S - 4; N <= S; N++) C.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
- C.push(1), C.push(-1);
183
- for (let N = K - 1; N <= K + 1; N++) C.push(N);
184
- C.push(-1), C.push(S);
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 C;
187
- }), T = (C) => {
188
- C < 1 || C > I.value || C === k.value || (r.value = C, e("update:currentPage", C), e("current-change", C));
189
- }, $ = (C) => {
190
- n.value = C, e("update:pageSize", C), e("size-change", C), r.value = 1, e("update:currentPage", 1), e("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 (C, S) => (c(), u("div", {
193
- class: f(h(y).b())
450
+ return (k, C) => (h(), v("div", {
451
+ class: u(i(d).b())
194
452
  }, [
195
- m("span", {
196
- class: f(h(y).e("total"))
197
- }, "共 " + A(l.total) + " 条", 3),
198
- m("button", {
199
- class: f(h(y).e("btn")),
200
- disabled: k.value <= 1,
201
- onClick: S[0] || (S[0] = (K) => T(k.value - 1))
202
- }, " ‹ ", 10, we),
203
- (c(!0), u(R, null, U(w.value, (K) => (c(), u(R, { key: K }, [
204
- K === -1 ? (c(), u("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: f(h(y).e("ellipsis"))
207
- }, "...", 2)) : (c(), u("button", {
464
+ class: u(i(d).e("ellipsis"))
465
+ }, "...", 2)) : (h(), v("button", {
208
466
  key: 1,
209
- class: f([h(y).e("btn"), h(y).is("active", K === k.value)]),
210
- onClick: (N) => T(K)
211
- }, A(K), 11, Ie))
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
- m("button", {
214
- class: f(h(y).e("btn")),
215
- disabled: k.value >= I.value,
216
- onClick: S[1] || (S[1] = (K) => T(k.value + 1))
217
- }, " › ", 10, Me),
218
- m("select", {
219
- class: f(h(y).e("sizes")),
220
- value: b.value,
221
- onChange: S[2] || (S[2] = (K) => $(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), u(R, null, U(l.pageSizes, (K) => (c(), u("option", {
224
- key: K,
225
- value: K
226
- }, A(K) + " 条/页", 9, Se))), 128))
227
- ], 42, $e)
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
- }), Ne = { key: 0 }, De = ["checked", "indeterminate"], ze = ["onClick"], Ae = ["onClick"], Te = ["checked", "onChange"], Ee = ["onClick"], Le = ["onClick"], je = { key: 1 }, Be = ["colspan"], gt = /* @__PURE__ */ O({
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 ft = /* @__PURE__ */ O({
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: s, emit: i }) {
253
- var g, t;
254
- const e = l, y = i, r = G("dynamic-table");
255
- de();
256
- const n = x({
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({
257
515
  get: () => e.data,
258
- set: (a) => y("update:data", a)
259
- }), k = H({
260
- prop: ((g = e.defaultSort) == null ? void 0 : g.prop) || "",
261
- order: ((t = e.defaultSort) == null ? void 0 : t.order) || null
262
- }), b = H([]), I = H(!1), w = H(!1), T = x(() => {
263
- if (!k.value.prop || !k.value.order)
264
- return n.value;
265
- const { prop: a, order: o } = k.value;
266
- return [...n.value].sort((p, v) => {
267
- const z = p[a], W = v[a];
268
- if (z === W) return 0;
269
- const V = z > W ? 1 : -1;
270
- return o === "ascending" ? V : -V;
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
- }), $ = x(() => {
273
- const a = {};
274
- return e.height && (a.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (a.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), a;
275
- }), C = x(() => {
276
- const a = typeof e.operationWidth == "number" ? `${e.operationWidth}px` : e.operationWidth;
277
- return { width: a, minWidth: a };
278
- }), S = x(() => [
279
- r.b(),
280
- r.is("border", e.border),
281
- r.is("stripe", e.stripe),
282
- r.is("loading", e.loading)
283
- ]), K = (a) => {
284
- a.sortable && (k.value.prop === a.prop ? k.value.order === "ascending" ? k.value.order = "descending" : k.value.order === "descending" && (k.value.order = null, k.value.prop = "") : (k.value.prop = a.prop, k.value.order = "ascending"), y("sort-change", { ...k.value }));
285
- }, N = (a) => a.sortable ? k.value.prop !== a.prop ? r.is("sortable") : [
286
- r.is("sortable"),
287
- r.is(`sort-${k.value.order}`)
288
- ] : "", Z = (a, o, p) => {
289
- const v = a[o.prop];
290
- return o.formatter ? o.formatter(a, o, v, p) : v ?? "";
291
- }, Y = (a, o, p) => {
292
- y("row-click", a, o, p);
293
- }, E = (a, o, p) => {
294
- const v = p.target;
295
- y("cell-click", a, o, v, p);
296
- }, D = () => {
297
- I.value || w.value ? (b.value = [], I.value = !1, w.value = !1) : (b.value = [...n.value], I.value = !0, w.value = !1), y("select-all", b.value), y("selection-change", b.value);
298
- }, B = (a) => {
299
- const o = b.value.findIndex((p) => typeof e.rowKey == "function" ? e.rowKey(p) === e.rowKey(a) : e.rowKey ? p[e.rowKey] === a[e.rowKey] : p === a);
300
- o > -1 ? b.value.splice(o, 1) : b.value.push(a), I.value = b.value.length === n.value.length, w.value = b.value.length > 0 && b.value.length < n.value.length, y("selection-change", b.value);
301
- }, X = (a) => b.value.some((o) => typeof e.rowKey == "function" ? e.rowKey(o) === e.rowKey(a) : e.rowKey ? o[e.rowKey] === a[e.rowKey] : o === a), P = (a) => {
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) => {
302
560
  const o = {};
303
- return a.width && (o.width = typeof a.width == "number" ? `${a.width}px` : a.width), a.minWidth && (o.minWidth = typeof a.minWidth == "number" ? `${a.minWidth}px` : a.minWidth), a.align && (o.textAlign = a.align), o;
304
- }, Q = (a) => {
305
- const o = a || {};
306
- e.columns.forEach((p) => {
307
- o[p.prop] === void 0 && (o[p.prop] = "");
308
- }), n.value = [...n.value, o], y("add-row", o);
309
- }, q = (a) => {
310
- const o = n.value[a];
311
- n.value = n.value.filter((p, v) => v !== a), y("delete-row", o, a);
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 s({
571
+ return r({
314
572
  clearSelection: () => {
315
- b.value = [], I.value = !1, w.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: q,
321
- getData: () => [...n.value]
322
- }), (a, o) => (c(), u("div", {
323
- class: f(S.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(), u("div", {
583
+ s.showAddButton ? (h(), v("div", {
326
584
  key: 0,
327
- class: f(h(r).e("toolbar"))
585
+ class: u(i(n).e("toolbar"))
328
586
  }, [
329
- j(a.$slots, "toolbar", {}, () => [
330
- m("button", {
331
- class: f(h(r).e("add-btn")),
332
- onClick: o[0] || (o[0] = (p) => Q())
587
+ E(t.$slots, "toolbar", {}, () => [
588
+ g("button", {
589
+ class: u(i(n).e("add-btn")),
590
+ onClick: o[0] || (o[0] = (f) => O())
333
591
  }, [...o[2] || (o[2] = [
334
- m("span", { class: "add-icon" }, "+", -1),
335
- J(" 新增一行 ", -1)
592
+ g("span", { class: "add-icon" }, "+", -1),
593
+ q(" 新增一行 ", -1)
336
594
  ])], 2)
337
595
  ])
338
- ], 2)) : M("", !0),
339
- l.loading ? (c(), u("div", {
596
+ ], 2)) : H("", !0),
597
+ s.loading ? (h(), v("div", {
340
598
  key: 1,
341
- class: f(h(r).e("loading"))
599
+ class: u(i(n).e("loading"))
342
600
  }, [...o[3] || (o[3] = [
343
- m("span", { class: "loading-spinner" }, null, -1),
344
- m("span", { class: "loading-text" }, "加载中...", -1)
345
- ])], 2)) : M("", !0),
346
- m("div", {
347
- class: f(h(r).e("wrapper")),
348
- style: L($.value)
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
- m("table", null, [
351
- l.showHeader ? (c(), u("thead", Ne, [
352
- m("tr", null, [
353
- l.rowKey ? (c(), u("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: f([h(r).e("header-cell"), h(r).e("selection-cell")])
613
+ class: u([i(n).e("header-cell"), i(n).e("selection-cell")])
356
614
  }, [
357
- m("input", {
615
+ g("input", {
358
616
  type: "checkbox",
359
- checked: I.value,
360
- indeterminate: w.value,
361
- onChange: D
362
- }, null, 40, De)
363
- ], 2)) : M("", !0),
364
- l.showIndex ? (c(), u("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: f(h(r).e("header-cell")),
624
+ class: u(i(n).e("header-cell")),
367
625
  style: { width: "60px" }
368
- }, " 序号 ", 2)) : M("", !0),
369
- (c(!0), u(R, null, U(l.columns, (p) => (c(), u("th", {
370
- key: p.prop,
371
- class: f([h(r).e("header-cell"), N(p)]),
372
- style: L(P(p)),
373
- onClick: (v) => K(p)
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
- m("span", null, A(p.label), 1),
376
- p.sortable ? (c(), u("span", {
633
+ g("span", null, T(f.label), 1),
634
+ f.sortable ? (h(), v("span", {
377
635
  key: 0,
378
- class: f(h(r).e("sort-icon"))
379
- }, [...o[4] || (o[4] = [
380
- m("span", { class: "sort-arrow up" }, "▲", -1),
381
- m("span", { class: "sort-arrow down" }, "▼", -1)
382
- ])], 2)) : M("", !0)
383
- ], 14, ze))), 128)),
384
- l.showOperation ? (c(), u("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: f(h(r).e("header-cell")),
387
- style: L(C.value)
388
- }, A(l.operationLabel), 7)) : M("", !0)
654
+ class: u(i(n).e("header-cell")),
655
+ style: j(k.value)
656
+ }, T(s.operationLabel), 7)) : H("", !0)
389
657
  ])
390
- ])) : M("", !0),
391
- m("tbody", null, [
392
- (c(!0), u(R, null, U(T.value, (p, v) => (c(), u("tr", {
393
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(p) : p[l.rowKey] : v,
394
- class: f([h(r).e("row"), h(r).is("selected", X(p))]),
395
- onClick: (z) => Y(p, l.columns[0], z)
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(), u("td", {
665
+ s.rowKey ? (h(), v("td", {
398
666
  key: 0,
399
- class: f(h(r).e("cell"))
667
+ class: u(i(n).e("cell"))
400
668
  }, [
401
- m("input", {
669
+ g("input", {
402
670
  type: "checkbox",
403
- checked: X(p),
404
- onClick: o[1] || (o[1] = re(() => {
671
+ checked: U(f),
672
+ onClick: o[1] || (o[1] = se(() => {
405
673
  }, ["stop"])),
406
- onChange: (z) => B(p)
407
- }, null, 40, Te)
408
- ], 2)) : M("", !0),
409
- l.showIndex ? (c(), u("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: f(h(r).e("cell"))
412
- }, A(v + 1), 3)) : M("", !0),
413
- (c(!0), u(R, null, U(l.columns, (z) => (c(), u("td", {
414
- key: z.prop,
415
- class: f(h(r).e("cell")),
416
- style: L(P(z)),
417
- onClick: (W) => E(p, z, W)
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
- j(a.$slots, `column-${z.prop}`, {
420
- row: p,
421
- column: z,
422
- $index: v
687
+ E(t.$slots, `column-${$.prop}`, {
688
+ row: f,
689
+ column: $,
690
+ $index: p
423
691
  }, () => [
424
- J(A(Z(p, z, v)), 1)
692
+ q(T(W(f, $, p)), 1)
425
693
  ])
426
- ], 14, Ee))), 128)),
427
- l.showOperation ? (c(), u("td", {
694
+ ], 14, Xe))), 128)),
695
+ s.showOperation ? (h(), v("td", {
428
696
  key: 2,
429
- class: f([h(r).e("cell"), h(r).e("operation-cell")])
697
+ class: u([i(n).e("cell"), i(n).e("operation-cell")])
430
698
  }, [
431
- j(a.$slots, "operation", {
432
- row: p,
433
- $index: v,
434
- deleteRow: () => q(v)
699
+ E(t.$slots, "operation", {
700
+ row: f,
701
+ $index: p,
702
+ deleteRow: () => ee(p)
435
703
  }, () => [
436
- m("button", {
437
- class: f(h(r).e("operation-btn")),
438
- onClick: re((z) => q(v), ["stop"])
439
- }, " 删除 ", 10, Le)
704
+ g("button", {
705
+ class: u(i(n).e("operation-btn")),
706
+ onClick: se(($) => ee(p), ["stop"])
707
+ }, " 删除 ", 10, Qe)
440
708
  ])
441
- ], 2)) : M("", !0)
442
- ], 10, Ae))), 128))
709
+ ], 2)) : H("", !0)
710
+ ], 10, Oe))), 128))
443
711
  ]),
444
- T.value.length === 0 && !l.loading ? (c(), u("tbody", je, [
445
- m("tr", null, [
446
- m("td", {
447
- colspan: l.columns.length + (l.rowKey ? 1 : 0) + (l.showIndex ? 1 : 0) + (l.showOperation ? 1 : 0),
448
- class: f(h(r).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
- j(a.$slots, "empty", {}, () => [
451
- J(A(l.emptyText), 1)
718
+ E(t.$slots, "empty", {}, () => [
719
+ q(T(s.emptyText), 1)
452
720
  ])
453
- ], 10, Be)
721
+ ], 10, Ze)
454
722
  ])
455
- ])) : M("", !0)
723
+ ])) : H("", !0)
456
724
  ])
457
725
  ], 6)
458
726
  ], 2));
459
727
  }
460
- }), He = ["draggable"], Pe = {
728
+ }), Ue = ["draggable"], Fe = {
461
729
  key: 0,
462
730
  class: "x-tree-node__loading-icon"
463
- }, We = {
731
+ }, Je = {
464
732
  key: 0,
465
733
  class: "x-tree-node__expand-arrow"
466
- }, Re = {
734
+ }, qe = {
467
735
  key: 0,
468
736
  class: "x-tree-node__icon"
469
- }, Oe = { class: "x-tree-node__label" }, Ge = /* @__PURE__ */ O({
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 s = l, i = le("tree"), { props: e, store: y, toggleExpand: r, toggleCheck: n, handleNodeClick: k, handleNodeContextmenu: b } = i, I = H(), w = H(null), T = x(() => s.node.expanded), $ = x(() => s.node.checked), C = x(() => s.node.indeterminate), S = x(() => s.node.disabled), K = x(() => s.node.loading), N = x(() => s.node.isLeaf), Z = x(() => e.showCheckbox || e.checkable), Y = x(() => s.node.selected), E = x(() => ({
477
- paddingLeft: `${s.node.level * (e.indent || 16)}px`
478
- })), D = (t) => {
479
- k(s.node, t);
480
- }, B = (t) => {
481
- b(s.node, t);
482
- }, X = (t) => {
483
- t.stopPropagation(), S.value || r(s.node);
484
- }, P = (t) => {
485
- t.stopPropagation(), S.value || n(s.node);
486
- }, Q = (t) => {
487
- var a;
488
- if (!(!e.draggable || S.value)) {
489
- if (e.allowDrag && !e.allowDrag(s.node)) {
490
- t.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
- t.dataTransfer.effectAllowed = "move", t.dataTransfer.setData("nodeKey", String(s.node.key)), (a = i.emit) == null || a.call(i, "node-drag-start", s.node, t);
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
- }, q = (t) => {
496
- var a;
497
- t.preventDefault(), e.draggable && (w.value = "inner", (a = i.emit) == null || a.call(i, "node-drag-enter", s.node, t));
498
- }, _ = (t) => {
499
- var a;
500
- w.value = null, (a = i.emit) == null || a.call(i, "node-drag-leave", s.node, t);
501
- }, ee = (t) => {
502
- var v, z;
503
- if (t.preventDefault(), !e.draggable || S.value) return;
504
- const a = (v = I.value) == null ? void 0 : v.getBoundingClientRect();
505
- if (!a) return;
506
- const o = t.clientY - a.top, p = a.height;
507
- o < p * 0.25 ? w.value = "prev" : o > p * 0.75 ? w.value = "next" : w.value = "inner", (z = i.emit) == null || z.call(i, "node-drag-over", s.node, t);
508
- }, d = (t) => {
509
- var o, p;
510
- if (t.preventDefault(), !e.draggable) return;
511
- const a = (o = t.dataTransfer) == null ? void 0 : o.getData("nodeKey");
512
- if (a) {
513
- const v = y.nodesMap.get(a);
514
- if (v && w.value) {
515
- if (e.allowDrop && !e.allowDrop(v, s.node, w.value)) {
516
- w.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
- (p = i.emit) == null || p.call(i, "node-drop", v, s.node, w.value, t);
787
+ (f = a.emit) == null || f.call(a, "node-drop", p, r.node, x.value, c);
520
788
  }
521
789
  }
522
- w.value = null;
523
- }, g = (t) => {
524
- var a;
525
- w.value = null, (a = i.emit) == null || a.call(i, "node-drag-end", s.node, t);
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 (t, a) => {
528
- var p;
529
- const o = ye("TreeNode", !0);
530
- return ge((c(), u("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: I,
533
- class: f(["x-tree-node", {
534
- "is-expanded": T.value,
535
- "is-current": t.isCurrent,
536
- "is-selected": Y.value,
537
- "is-disabled": S.value,
538
- "is-drop-inner": w.value === "inner",
539
- "is-drop-prev": w.value === "prev",
540
- "is-drop-next": w.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: h(e).draggable && !S.value,
543
- onDragstart: Q,
544
- onDragenter: q,
545
- onDragleave: _,
546
- onDragover: ee,
547
- onDrop: d,
548
- onDragend: g
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
- m("div", {
818
+ g("div", {
551
819
  class: "x-tree-node__content",
552
- style: L(E.value),
553
- onClick: D,
554
- onContextmenu: B
820
+ style: j(S.value),
821
+ onClick: L,
822
+ onContextmenu: R
555
823
  }, [
556
- m("span", {
557
- class: f(["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: X
830
+ onClick: U
563
831
  }, [
564
- K.value ? (c(), u("span", Pe)) : (c(), u(R, { key: 1 }, [
565
- N.value ? M("", !0) : (c(), u("span", We))
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 || h(e).icon ? (c(), u("span", Re, A(l.node.icon || h(e).icon), 1)) : M("", !0),
569
- Z.value ? (c(), u("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: f(["x-tree-node__checkbox", {
572
- "is-checked": $.value,
573
- "is-indeterminate": C.value,
574
- "is-disabled": S.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: re(P, ["stop"])
577
- }, [...a[0] || (a[0] = [
578
- m("span", { class: "x-tree-node__checkbox-inner" }, null, -1)
579
- ])], 2)) : M("", !0),
580
- m("span", Oe, [
581
- j(t.$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(), u("div", {
867
+ !D.value && N.value ? (h(), v("div", {
590
868
  key: 0,
591
- class: f(["x-tree-node__children", { "x-tree-node__children--show-line": h(e).showLine }])
869
+ class: u(["x-tree-node__children", { "x-tree-node__children--show-line": i(e).showLine }])
592
870
  }, [
593
- !h(e).renderAfterExpand || T.value ? (c(!0), u(R, { key: 0 }, U(l.node.children, (v) => (c(), ae(o, {
594
- key: v.key,
595
- node: v
871
+ !i(e).renderAfterExpand || N.value ? (h(!0), v(G, { key: 0 }, J(s.node.children, (p) => (h(), te(o, {
872
+ key: p.key,
873
+ node: p
596
874
  }, {
597
- default: ce((z) => [
598
- j(t.$slots, "default", {
599
- node: z.node,
600
- data: z.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)) : M("", !0)
605
- ], 2)) : M("", !0)
606
- ], 42, He)), [
607
- [ve, l.node.visible && (((p = l.node.parent) == null ? void 0 : p.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(s, i, e = 0, y = null) {
614
- this.data = s, this.store = i, this.level = e, this.parent = y, 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 r = i.props || {}, n = r.value || "value", k = r.label || "label", b = r.disabled || "disabled", I = r.isLeaf || "isLeaf";
616
- this.key = s[n] ?? s.value ?? s.id ?? Math.random().toString(), this.label = s[k] ?? s.label ?? "", this.disabled = s[b] ?? s.disabled ?? !1, this.isLeaf = s[I] ?? s.isLeaf ?? !1;
617
- const w = r.children || "children", T = s[w] ?? s.children ?? [];
618
- T.length > 0 ? this.children = T.map(
619
- ($) => new te($, i, e + 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(s, i = !0) {
624
- this.expanded = s, s ? 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(s) {
628
- this.selected = s, s ? 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(s, i = !0, e = !0) {
632
- this.checked = s, this.indeterminate = !1, s ? (this.store.checkedKeys.add(this.key), this.store.indeterminateKeys.delete(this.key)) : (this.store.checkedKeys.delete(this.key), this.store.indeterminateKeys.delete(this.key)), i && (this.updateChildrenChecked(s), 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(s) {
636
- const i = (e) => {
637
- e.children.forEach((y) => {
638
- y.disabled || (y.checked = s, y.indeterminate = !1, s ? (this.store.checkedKeys.add(y.key), this.store.indeterminateKeys.delete(y.key)) : (this.store.checkedKeys.delete(y.key), this.store.indeterminateKeys.delete(y.key)), i(y));
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
- i(this);
919
+ a(this);
642
920
  }
643
921
  /** 更新父节点勾选状态 */
644
922
  updateParentChecked() {
645
- let s = this.parent;
646
- for (; s; ) {
647
- const i = s.children.filter((r) => !r.disabled);
648
- if (i.length === 0) {
649
- s = s.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 e = i.every((r) => r.checked), y = i.some((r) => r.checked || r.indeterminate);
653
- e ? (s.checked = !0, s.indeterminate = !1, this.store.checkedKeys.add(s.key), this.store.indeterminateKeys.delete(s.key)) : y ? (s.checked = !1, s.indeterminate = !0, this.store.checkedKeys.delete(s.key), this.store.indeterminateKeys.add(s.key)) : (s.checked = !1, s.indeterminate = !1, this.store.checkedKeys.delete(s.key), this.store.indeterminateKeys.delete(s.key)), s = s.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 s = [];
671
- let i = this.parent;
672
- for (; i; )
673
- s.push(i.key), i = i.parent;
674
- return s;
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 s = [], i = (e) => {
679
- e.forEach((y) => {
680
- s.push(y.key), y.children.length && i(y.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 i(this.children), s;
961
+ return a(this.children), r;
684
962
  }
685
963
  }
686
- const vt = /* @__PURE__ */ O({
964
+ const Ht = /* @__PURE__ */ Y({
687
965
  name: "XTree",
688
966
  __name: "index",
689
967
  props: {
@@ -724,8 +1002,8 @@ const vt = /* @__PURE__ */ O({
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: s, emit: i }) {
728
- const e = l, y = i, r = G("tree"), n = he({
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 vt = /* @__PURE__ */ O({
734
1012
  indeterminateKeys: /* @__PURE__ */ new Set(),
735
1013
  currentKey: null,
736
1014
  filterValue: ""
737
- }), k = H(""), b = () => e.fieldNames ? {
1015
+ }), m = V(""), y = () => e.fieldNames ? {
738
1016
  value: e.fieldNames.key || "value",
739
1017
  label: e.fieldNames.title || e.fieldNames.key || "label",
740
1018
  children: e.fieldNames.children || "children",
741
1019
  disabled: e.fieldNames.disabled || "disabled",
742
1020
  isLeaf: e.fieldNames.isLeaf || "isLeaf"
743
- } : e.props, I = () => e.treeData || e.data || [];
744
- n.props = b();
745
- const w = (t) => {
746
- if (n.nodesMap.clear(), n.rootNodes = [], n.checkedKeys.clear(), n.indeterminateKeys.clear(), !t || !t.length) return;
747
- const a = b(), o = (p, v, z) => {
748
- const W = new te(p, n, v, z);
749
- n.nodesMap.set(W.key, W);
750
- const V = (a == null ? void 0 : a.children) || "children", ue = p[V] ?? p.children ?? [];
751
- return ue.length > 0 && (W.children = ue.map(
752
- (pe) => o(pe, v + 1, W)
753
- ), W.isLeaf = !1), W;
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
- n.rootNodes = t.map((p) => o(p, 0, null)), T();
756
- }, T = () => {
757
- var t, a, o;
758
- e.defaultExpandAll ? $() : (t = e.defaultExpandedKeys) != null && t.length && e.defaultExpandedKeys.forEach((p) => {
759
- const v = n.nodesMap.get(p);
760
- v && (v.expanded = !0, n.expandedKeys.add(p));
761
- }), (a = e.defaultCheckedKeys) != null && a.length && e.defaultCheckedKeys.forEach((p) => {
762
- const v = n.nodesMap.get(p);
763
- v && v.setChecked(!0, !e.checkStrictly);
764
- }), (o = e.checkedKeys) != null && o.length && e.checkedKeys.forEach((p) => {
765
- const v = n.nodesMap.get(p);
766
- v && v.setChecked(!0, !e.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
- }, $ = () => {
769
- n.nodesMap.forEach((t) => {
770
- t.children.length > 0 && (t.expanded = !0, n.expandedKeys.add(t.key));
1046
+ }, A = () => {
1047
+ l.nodesMap.forEach((c) => {
1048
+ c.children.length > 0 && (c.expanded = !0, l.expandedKeys.add(c.key));
771
1049
  });
772
- }, C = () => {
773
- n.nodesMap.forEach((t) => {
774
- t.expanded = !1;
775
- }), n.expandedKeys.clear();
776
- }, S = (t) => {
777
- if (t.disabled) return;
778
- !t.expanded ? (t.expanded = !0, n.expandedKeys.add(t.key), y("node-expand", t.data, t, null)) : (t.expanded = !1, n.expandedKeys.delete(t.key), y("node-collapse", t.data, t, null));
779
- }, K = (t, a) => {
780
- if (t.disabled) return;
781
- const o = a ?? !t.checked;
782
- t.setChecked(o, !e.checkStrictly), y("check-change", t.data, t.checked, t.indeterminate);
783
- const p = [], v = [], z = [], W = [];
784
- n.nodesMap.forEach((V) => {
785
- V.checked && (p.push(V.data), v.push(V.key)), V.indeterminate && (z.push(V.data), W.push(V.key));
786
- }), y("check", t.data, {
787
- checkedNodes: p,
788
- checkedKeys: v,
789
- halfCheckedNodes: z,
790
- halfCheckedKeys: W
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,
1066
+ checkedKeys: p,
1067
+ halfCheckedNodes: $,
1068
+ halfCheckedKeys: P
791
1069
  });
792
- }, N = (t, a) => {
793
- t.disabled || (y("node-click", t.data, t, null), e.expandOnClickNode && t.children.length > 0 && S(t), e.highlightCurrent && (n.currentKey = t.key, y("current-change", t.data, t)));
794
- }, Z = (t) => {
795
- if (k.value = t, n.filterValue = t, !t) {
796
- n.nodesMap.forEach((a) => {
797
- a.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
- n.nodesMap.forEach((a) => {
802
- const o = a.label || "";
803
- a.visible = String(o).toLowerCase().includes(t.toLowerCase());
804
- }), n.nodesMap.forEach((a) => {
805
- if (a.visible && a.parent) {
806
- let o = 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;
807
1085
  for (; o; )
808
- o.visible = !0, o.expanded = !0, n.expandedKeys.add(o.key), o = o.parent;
1086
+ o.visible = !0, o.expanded = !0, l.expandedKeys.add(o.key), o = o.parent;
809
1087
  }
810
1088
  });
811
- }, Y = (t) => n.nodesMap.get(t), E = (t) => {
812
- n.currentKey = t;
813
- }, D = () => {
814
- if (n.currentKey)
815
- return n.nodesMap.get(n.currentKey);
816
- }, B = (t = !1) => {
817
- const a = [];
818
- return n.nodesMap.forEach((o) => {
819
- o.checked && (!t || o.isLeaf) && a.push(o.data);
820
- }), a;
821
- }, X = (t = !1) => {
822
- const a = [];
823
- return n.nodesMap.forEach((o) => {
824
- o.checked && (!t || o.isLeaf) && a.push(o.key);
825
- }), a;
826
- }, P = (t) => {
827
- n.nodesMap.forEach((a) => {
828
- a.checked = !1, a.indeterminate = !1;
829
- }), n.checkedKeys.clear(), n.indeterminateKeys.clear(), t.forEach((a) => {
830
- const o = n.nodesMap.get(a);
831
- o && o.setChecked(!0, !e.checkStrictly);
832
- });
833
- }, Q = () => {
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) => {
834
1095
  const t = [];
835
- return n.nodesMap.forEach((a) => {
836
- a.indeterminate && t.push(a.data);
1096
+ return l.nodesMap.forEach((o) => {
1097
+ o.checked && (!c || o.isLeaf) && t.push(o.data);
837
1098
  }), t;
838
- }, q = () => {
1099
+ }, U = (c = !1) => {
839
1100
  const t = [];
840
- return n.nodesMap.forEach((a) => {
841
- a.indeterminate && t.push(a.key);
1101
+ return l.nodesMap.forEach((o) => {
1102
+ o.checked && (!c || o.isLeaf) && t.push(o.key);
842
1103
  }), t;
843
- }, _ = (t, a, o = !0) => {
844
- const p = n.nodesMap.get(t);
845
- p && p.setChecked(a, o && !e.checkStrictly);
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);
1110
+ });
1111
+ }, O = () => {
1112
+ const c = [];
1113
+ return l.nodesMap.forEach((t) => {
1114
+ t.indeterminate && c.push(t.data);
1115
+ }), c;
846
1116
  }, ee = () => {
847
- const t = [];
848
- return n.nodesMap.forEach((a) => {
849
- a.selected && t.push(a.data);
850
- }), t;
851
- }, d = (t) => {
852
- n.nodesMap.forEach((a) => {
853
- a.selected = !1;
854
- }), n.selectedKeys.clear(), t.forEach((a) => {
855
- const o = n.nodesMap.get(a);
856
- o && (o.selected = !0, n.selectedKeys.add(a));
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
- }, g = x(() => e.showCheckbox || e.checkable);
859
- return ne("tree", {
1136
+ }, K = M(() => e.showCheckbox || e.checkable);
1137
+ return ie("tree", {
860
1138
  props: e,
861
- store: n,
862
- emit: y,
863
- toggleExpand: S,
864
- toggleCheck: K,
865
- handleNodeClick: N,
866
- filterValue: me(k),
867
- showCheckboxComputed: g
868
- }), s({
869
- filter: Z,
870
- getNode: Y,
871
- setCurrentKey: E,
872
- getCurrentKey: () => n.currentKey,
873
- getCurrentNode: D,
874
- getCheckedNodes: B,
875
- getCheckedKeys: X,
876
- setCheckedKeys: P,
877
- getHalfCheckedNodes: Q,
878
- getHalfCheckedKeys: q,
879
- setChecked: _,
880
- getSelectedNodes: ee,
881
- setSelectedKeys: d,
882
- expandAll: $,
883
- collapseAll: C,
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: (t, a) => {
886
- const o = n.nodesMap.get(t);
887
- o && (o.children.forEach((p) => {
888
- n.nodesMap.delete(p.key);
889
- }), o.children = a.map((p) => {
890
- const v = new te(p, n, o.level + 1, o);
891
- return n.nodesMap.set(v.key, v), v;
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;
892
1170
  }), o.isLeaf = o.children.length === 0);
893
1171
  },
894
- remove: (t) => {
895
- const a = n.nodesMap.get(t);
896
- if (a) {
897
- const o = a.parent;
1172
+ remove: (c) => {
1173
+ const t = l.nodesMap.get(c);
1174
+ if (t) {
1175
+ const o = t.parent;
898
1176
  if (o) {
899
- const v = o.children.indexOf(a);
900
- v > -1 && o.children.splice(v, 1), o.children.length === 0 && (o.isLeaf = !0);
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 v = n.rootNodes.indexOf(a);
903
- v > -1 && n.rootNodes.splice(v, 1);
1180
+ const p = l.rootNodes.indexOf(t);
1181
+ p > -1 && l.rootNodes.splice(p, 1);
904
1182
  }
905
- const p = (v) => {
906
- n.nodesMap.delete(v.key), v.children.forEach(p);
1183
+ const f = (p) => {
1184
+ l.nodesMap.delete(p.key), p.children.forEach(f);
907
1185
  };
908
- p(a);
1186
+ f(t);
909
1187
  }
910
1188
  },
911
- append: (t, a) => {
912
- if (a) {
913
- const o = n.nodesMap.get(a);
1189
+ append: (c, t) => {
1190
+ if (t) {
1191
+ const o = l.nodesMap.get(t);
914
1192
  if (o) {
915
- const p = new te(t, n, o.level + 1, o);
916
- n.nodesMap.set(p.key, p), o.children.push(p), o.isLeaf = !1;
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 o = new te(t, n, 0, null);
920
- n.nodesMap.set(o.key, o), n.rootNodes.push(o);
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: (t, a) => {
924
- var p;
925
- const o = n.nodesMap.get(a);
1201
+ insertBefore: (c, t) => {
1202
+ var f;
1203
+ const o = l.nodesMap.get(t);
926
1204
  if (o) {
927
- const v = new te(t, n, o.level, o.parent);
928
- n.nodesMap.set(v.key, v);
929
- const z = ((p = o.parent) == null ? void 0 : p.children) || n.rootNodes, W = z.indexOf(o);
930
- z.splice(W, 0, v);
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: (t, a) => {
934
- var p;
935
- const o = n.nodesMap.get(a);
1211
+ insertAfter: (c, t) => {
1212
+ var f;
1213
+ const o = l.nodesMap.get(t);
936
1214
  if (o) {
937
- const v = new te(t, n, o.level, o.parent);
938
- n.nodesMap.set(v.key, v);
939
- const z = ((p = o.parent) == null ? void 0 : p.children) || n.rootNodes, W = z.indexOf(o);
940
- z.splice(W + 1, 0, v);
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
- }), F(
1221
+ }), _(
944
1222
  () => [e.treeData, e.data],
945
1223
  () => {
946
- w(I());
1224
+ x(w());
947
1225
  },
948
1226
  { immediate: !0, deep: !0 }
949
- ), F(
1227
+ ), _(
950
1228
  () => e.checkedKeys,
951
- (t) => {
952
- t && P(t);
1229
+ (c) => {
1230
+ c && B(c);
953
1231
  },
954
1232
  { immediate: !0, deep: !0 }
955
- ), F(
1233
+ ), _(
956
1234
  () => e.defaultCheckedKeys,
957
- (t) => {
958
- t && t.length > 0 && !e.checkedKeys && P(t);
1235
+ (c) => {
1236
+ c && c.length > 0 && !e.checkedKeys && B(c);
959
1237
  },
960
1238
  { immediate: !0, deep: !0 }
961
- ), (t, a) => (c(), u("div", {
962
- class: f([h(r).b(), h(r).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), u(R, null, U(n.rootNodes, (o) => (c(), ae(Ge, {
1242
+ (h(!0), v(G, null, J(l.rootNodes, (o) => (h(), te(et, {
965
1243
  key: o.key,
966
1244
  node: o
967
1245
  }, {
968
- default: ce((p) => [
969
- j(t.$slots, "default", {
970
- node: p.node,
971
- data: p.data
1246
+ default: ve((f) => [
1247
+ E(c.$slots, "default", {
1248
+ node: f.node,
1249
+ data: f.data
972
1250
  }, () => [
973
- J(A(p.node.label), 1)
1251
+ q(T(f.node.label), 1)
974
1252
  ])
975
1253
  ]),
976
1254
  _: 2
977
1255
  }, 1032, ["node"]))), 128)),
978
- n.rootNodes.length ? M("", !0) : (c(), u("div", {
1256
+ l.rootNodes.length ? H("", !0) : (h(), v("div", {
979
1257
  key: 0,
980
- class: f(h(r).e("empty"))
1258
+ class: u(i(n).e("empty"))
981
1259
  }, [
982
- j(t.$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
- }), Ye = ["src"], Xe = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgdmlld0JveD0iMCAwIDE4NCAxNTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgIDxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+CiAgICAgIDxlbGxpcHNlIGZpbGwtb3BhY2l0eT0iLjgiIGZpbGw9IiNGNUY1RjciIGN4PSI2Ny43OTciIGN5PSIxMDYuODkiIHJ4PSI2Ny43OTciIHJ5PSIxMi42NjgiLz4KICAgICAgPHBhdGggZD0iTTEyMi4wMzQgNjkuNjc0TDk5LjM5NCA0OC4xNjJsMCAyMS41MTYgMjIuNjQgMjIuNjQ0IDAtMjIuNjQ0em0tMjIuNjQgMjIuNjQ0TDc2Ljk5OCA3MC43OThsMCAyMS41MTYgMjIuMzk2IDIyLjM5NiAwLTIyLjM5NnoiIGZpbGw9IiNFRkVGRkYiLz4KICAgICAgPHBhdGggZD0iTTk5LjM5NCA0OC4xNjJsLTIyLjM5NiAyMi42MzYgMjIuMzk2IDIxLjUyIDAtNDQuMTU2eiIgZmlsbD0iI0YyRjZGQyIvPgogICAgICA8cGF0aCBkPSJNMTIxLjk3OCA2OS42NzRMOTkuMzk0IDkyLjI1OGwzLjE2OCAzLjE2OCAyMi41ODQtMjIuNTg0LTMuMTY4LTMuMTY4eiIgZmlsbD0iI0M3Q0NEQyIvPgogICAgICA8cGF0aCBkPSJNOTkuMzk0IDkyLjI1OEw3Ni44MSA2OS42NzRsMy4xNjgtMy4xNjggMjIuNTg0IDIyLjU4NC0zLjE2OCAzLjE2OHoiIGZpbGw9IiNDN0NEREMiLz4KICAgIDwvZz4KICAgIDxwYXRoIGQ9Ik0xNDcuODU3IDMxLjY3bC0zLjI5Mi0zLjI5MmEyLjUgMi41IDAgMCAwLTMuNTM2IDBsLTEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDAgMCA0Ljk1bDMuMjkzIDMuMjkyYTMuNSAzLjUgMCAwIDAgNC45NSAwbDEzLjQ2LTEzLjQ2YTIuNSAyLjUgMCAwIDAgMC0zLjUzNnoiIGZpbGw9IiNENkRCRUMiLz4KICAgIDxwYXRoIGQ9Ik0zNi4xNDMgMzEuNjdsMy4yOTItMy4yOTJhMi41IDIuNSAwIDAgMSAzLjUzNiAwbDEzLjQ2IDEzLjQ2YTMuNSAzLjUgMCAwIDEgMCA0Ljk1bC0zLjI5MyAzLjI5MmEzLjUgMy41IDAgMCAxLTQuOTUgMEwzNi4xNDMgMzUuMmEyLjUgMi41IDAgMCAxIDAtMy41MzZ6IiBmaWxsPSIjRDZEQkVDIi8+CiAgICA8Y2lyY2xlIGZpbGw9IiNFQUVFRjQiIGN4PSI5MiIgY3k9IjgiIHI9IjgiLz4KICA8L2c+Cjwvc3ZnPg==", mt = /* @__PURE__ */ O({
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 vt = /* @__PURE__ */ O({
994
1272
  description: { default: "" },
995
1273
  size: { default: "default" }
996
1274
  },
997
- setup(l) {
998
- const s = l, i = G("empty"), e = x(() => {
999
- const r = {};
1000
- return s.imageSize && (r.height = `${s.imageSize}px`, r.width = `${s.imageSize}px`), r;
1001
- }), y = x(() => s.description || "暂无数据");
1002
- return (r, n) => (c(), u("div", {
1003
- class: f([h(i).b(), h(i).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
- m("div", {
1006
- class: f(h(i).e("image")),
1007
- style: L(e.value)
1283
+ g("div", {
1284
+ class: u(i(a).e("image")),
1285
+ style: j(e.value)
1008
1286
  }, [
1009
- j(r.$slots, "image", {}, () => [
1010
- l.image ? (c(), u("img", {
1287
+ E(n.$slots, "image", {}, () => [
1288
+ s.image ? (h(), v("img", {
1011
1289
  key: 0,
1012
- src: l.image,
1013
- style: L(e.value),
1290
+ src: s.image,
1291
+ style: j(e.value),
1014
1292
  draggable: "false"
1015
- }, null, 12, Ye)) : (c(), u("img", {
1293
+ }, null, 12, tt)) : (h(), v("img", {
1016
1294
  key: 1,
1017
- src: Xe,
1018
- style: L(e.value),
1295
+ src: at,
1296
+ style: j(e.value),
1019
1297
  draggable: "false"
1020
1298
  }, null, 4))
1021
1299
  ])
1022
1300
  ], 6),
1023
- m("div", {
1024
- class: f(h(i).e("description"))
1301
+ g("div", {
1302
+ class: u(i(a).e("description"))
1025
1303
  }, [
1026
- j(r.$slots, "description", {}, () => [
1027
- m("p", null, A(y.value), 1)
1304
+ E(n.$slots, "description", {}, () => [
1305
+ g("p", null, T(d.value), 1)
1028
1306
  ])
1029
1307
  ], 2),
1030
- r.$slots.default ? (c(), u("div", {
1308
+ n.$slots.default ? (h(), v("div", {
1031
1309
  key: 0,
1032
- class: f(h(i).e("bottom"))
1310
+ class: u(i(a).e("bottom"))
1033
1311
  }, [
1034
- j(r.$slots, "default")
1035
- ], 2)) : M("", !0)
1312
+ E(n.$slots, "default")
1313
+ ], 2)) : H("", !0)
1036
1314
  ], 2));
1037
1315
  }
1038
- }), kt = /* @__PURE__ */ O({
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 s = l, i = G("timeline");
1046
- ne("timeline", {
1047
- props: s
1322
+ setup(s) {
1323
+ const r = s, a = Q("timeline");
1324
+ ie("timeline", {
1325
+ props: r
1048
1326
  });
1049
- const e = x(() => [
1050
- i.b(),
1051
- i.m(s.direction)
1327
+ const e = M(() => [
1328
+ a.b(),
1329
+ a.m(r.direction)
1052
1330
  ]);
1053
- return (y, r) => (c(), u("ul", {
1054
- class: f(e.value),
1331
+ return (d, n) => (h(), v("ul", {
1332
+ class: u(e.value),
1055
1333
  role: "timeline"
1056
1334
  }, [
1057
- j(y.$slots, "default")
1335
+ E(d.$slots, "default")
1058
1336
  ], 2));
1059
1337
  }
1060
- }), bt = /* @__PURE__ */ O({
1338
+ }), Vt = /* @__PURE__ */ Y({
1061
1339
  name: "XTimelineItem",
1062
1340
  __name: "TimelineItem",
1063
1341
  props: {
@@ -1068,52 +1346,52 @@ const vt = /* @__PURE__ */ O({
1068
1346
  hideTimestamp: { type: Boolean, default: !1 },
1069
1347
  placement: { default: "bottom" }
1070
1348
  },
1071
- setup(l) {
1072
- const s = l, i = G("timeline-item"), e = {
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
- }, y = x(() => {
1079
- const n = {};
1080
- return s.color ? n.backgroundColor = s.color : s.type && e[s.type] && (n.backgroundColor = e[s.type]), n;
1081
- }), r = x(() => [
1082
- i.b(),
1083
- i.m(s.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 (n, k) => (c(), u("li", {
1086
- class: f(r.value)
1363
+ return (l, m) => (h(), v("li", {
1364
+ class: u(n.value)
1087
1365
  }, [
1088
- m("div", {
1089
- class: f(h(i).e("node")),
1090
- style: L(y.value)
1366
+ g("div", {
1367
+ class: u(i(a).e("node")),
1368
+ style: j(d.value)
1091
1369
  }, [
1092
- j(n.$slots, "dot")
1370
+ E(l.$slots, "dot")
1093
1371
  ], 6),
1094
- m("div", {
1095
- class: f(h(i).e("tail"))
1372
+ g("div", {
1373
+ class: u(i(a).e("tail"))
1096
1374
  }, null, 2),
1097
- m("div", {
1098
- class: f(h(i).e("wrapper"))
1375
+ g("div", {
1376
+ class: u(i(a).e("wrapper"))
1099
1377
  }, [
1100
- !l.hideTimestamp && l.timestamp && l.placement === "top" ? (c(), u("div", {
1378
+ !s.hideTimestamp && s.timestamp && s.placement === "top" ? (h(), v("div", {
1101
1379
  key: 0,
1102
- class: f(h(i).e("timestamp"))
1103
- }, A(l.timestamp), 3)) : M("", !0),
1104
- m("div", {
1105
- class: f(h(i).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
- j(n.$slots, "default")
1385
+ E(l.$slots, "default")
1108
1386
  ], 2),
1109
- !l.hideTimestamp && l.timestamp && l.placement === "bottom" ? (c(), u("div", {
1387
+ !s.hideTimestamp && s.timestamp && s.placement === "bottom" ? (h(), v("div", {
1110
1388
  key: 1,
1111
- class: f(h(i).e("timestamp"))
1112
- }, A(l.timestamp), 3)) : M("", !0)
1389
+ class: u(i(a).e("timestamp"))
1390
+ }, T(s.timestamp), 3)) : H("", !0)
1113
1391
  ], 2)
1114
1392
  ], 2));
1115
1393
  }
1116
- }), Qe = ["onMouseenter", "onClick"], xt = /* @__PURE__ */ O({
1394
+ }), lt = ["onMouseenter", "onClick"], Et = /* @__PURE__ */ Y({
1117
1395
  name: "XCarousel",
1118
1396
  __name: "index",
1119
1397
  props: {
@@ -1127,115 +1405,115 @@ const vt = /* @__PURE__ */ O({
1127
1405
  height: { default: 300 }
1128
1406
  },
1129
1407
  emits: ["update:activeIndex", "change"],
1130
- setup(l, { expose: s, emit: i }) {
1131
- const e = l, y = i, r = G("carousel"), n = H(e.activeIndex), k = H(0), b = H(null), I = H(!1);
1132
- ne("carousel", {
1133
- currentIndex: n,
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 w = (B) => {
1137
- const X = n.value;
1138
- e.loop ? n.value = (B + k.value) % k.value : n.value = Math.max(0, Math.min(B, k.value - 1)), y("update:activeIndex", n.value), y("change", n.value, X);
1139
- }, T = () => {
1140
- w(n.value - 1);
1141
- }, $ = () => {
1142
- w(n.value + 1);
1143
- }, C = () => {
1144
- e.autoplay && k.value > 1 && (S(), b.value = setInterval(() => {
1145
- I.value || $();
1146
- }, e.interval));
1147
- }, S = () => {
1148
- b.value && (clearInterval(b.value), b.value = null);
1149
- }, K = () => {
1150
- I.value = !0, e.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
- I.value = !1;
1153
- }, Z = (B) => {
1154
- e.trigger === "hover" && w(B);
1155
- }, Y = (B) => {
1156
- e.trigger === "click" && w(B);
1157
- }, E = x(() => ({
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(() => ({
1158
1436
  height: typeof e.height == "number" ? `${e.height}px` : e.height
1159
- })), D = x(() => [
1160
- r.b(),
1161
- r.m(`arrow-${e.arrow}`),
1162
- r.m(`indicator-${e.indicatorPosition}`)
1437
+ })), L = M(() => [
1438
+ n.b(),
1439
+ n.m(`arrow-${e.arrow}`),
1440
+ n.m(`indicator-${e.indicatorPosition}`)
1163
1441
  ]);
1164
- return F(() => e.activeIndex, (B) => {
1165
- n.value = B;
1166
- }), F(() => e.autoplay, () => {
1167
- C();
1168
- }), F(k, () => {
1169
- fe(() => {
1170
- C();
1442
+ return _(() => e.activeIndex, (R) => {
1443
+ l.value = R;
1444
+ }), _(() => e.autoplay, () => {
1445
+ k();
1446
+ }), _(m, () => {
1447
+ ye(() => {
1448
+ k();
1171
1449
  });
1172
- }), se(() => {
1450
+ }), re(() => {
1451
+ k();
1452
+ }), ue(() => {
1173
1453
  C();
1174
- }), oe(() => {
1175
- S();
1176
- }), s({
1177
- prev: T,
1178
- next: $,
1179
- setActiveItem: w
1180
- }), (B, X) => (c(), u("div", {
1181
- class: f(D.value),
1182
- style: L(E.value),
1183
- onMouseenter: K,
1184
- onMouseleave: N
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
- m("div", {
1187
- class: f(h(r).e("container"))
1464
+ g("div", {
1465
+ class: u(i(n).e("container"))
1188
1466
  }, [
1189
- j(B.$slots, "default")
1467
+ E(R.$slots, "default")
1190
1468
  ], 2),
1191
- l.arrow !== "never" ? (c(), u("button", {
1469
+ s.arrow !== "never" ? (h(), v("button", {
1192
1470
  key: 0,
1193
- class: f([h(r).e("arrow"), h(r).e("arrow-left")]),
1194
- onClick: T
1195
- }, " ‹ ", 2)) : M("", !0),
1196
- l.arrow !== "never" ? (c(), u("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: f([h(r).e("arrow"), h(r).e("arrow-right")]),
1199
- onClick: $
1200
- }, " › ", 2)) : M("", !0),
1201
- l.indicatorPosition !== "none" ? (c(), u("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: f(h(r).e("indicators"))
1481
+ class: u(i(n).e("indicators"))
1204
1482
  }, [
1205
- (c(!0), u(R, null, U(k.value, (P) => (c(), u("li", {
1206
- key: P,
1207
- class: f([h(r).e("indicator"), h(r).is("active", P - 1 === n.value)]),
1208
- onMouseenter: (Q) => Z(P - 1),
1209
- onClick: (Q) => Y(P - 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
- m("button", {
1212
- class: f(h(r).e("indicator-btn"))
1489
+ g("button", {
1490
+ class: u(i(n).e("indicator-btn"))
1213
1491
  }, null, 2)
1214
- ], 42, Qe))), 128))
1215
- ], 2)) : M("", !0)
1492
+ ], 42, lt))), 128))
1493
+ ], 2)) : H("", !0)
1216
1494
  ], 38));
1217
1495
  }
1218
- }), Ct = /* @__PURE__ */ O({
1496
+ }), Bt = /* @__PURE__ */ Y({
1219
1497
  name: "XCarouselItem",
1220
1498
  __name: "CarouselItem",
1221
- setup(l) {
1222
- const s = G("carousel-item"), i = le("carousel"), e = H(-1);
1223
- se(() => {
1224
- i && (e.value = i.itemCount.value, i.itemCount.value++);
1225
- }), oe(() => {
1226
- i && i.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 y = x(() => i && e.value === i.currentIndex.value), r = x(() => [
1229
- s.b(),
1230
- s.is("active", y.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 (n, k) => (c(), u("div", {
1233
- class: f(r.value)
1510
+ return (l, m) => (h(), v("div", {
1511
+ class: u(n.value)
1234
1512
  }, [
1235
- j(n.$slots, "default")
1513
+ E(l.$slots, "default")
1236
1514
  ], 2));
1237
1515
  }
1238
- }), Ze = { key: 0 }, Ve = ["onClick"], Ue = ["onClick"], Je = ["onClick"], Fe = { key: 1 }, qe = ["colspan"], _e = { style: { display: "none" } }, wt = /* @__PURE__ */ O({
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,161 +1530,206 @@ const vt = /* @__PURE__ */ O({
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: s, emit: i }) {
1256
- var _, ee;
1257
- const e = l, y = i, r = G("table");
1258
- de();
1259
- const n = he(/* @__PURE__ */ new Map());
1260
- ne("x-table", {
1261
- registerColumn: (d, g) => {
1262
- n.set(d.prop, { config: d, slot: g });
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: (d) => {
1265
- n.delete(d);
1542
+ unregisterColumn: (t) => {
1543
+ const o = l.findIndex((f) => f.config.prop === t);
1544
+ o !== -1 && l.splice(o, 1);
1266
1545
  },
1267
- updateColumnSlot: (d, g) => {
1268
- const t = n.get(d);
1269
- t && (t.slot = g);
1546
+ updateColumnSlot: (t, o) => {
1547
+ const f = l.find((p) => p.config.prop === t);
1548
+ f && (f.slot = o);
1270
1549
  },
1271
1550
  props: e
1272
1551
  });
1273
- const w = x(() => Array.from(n.values()).map((d) => d.config)), T = x(() => {
1274
- const d = {};
1275
- return n.forEach((g, t) => {
1276
- g.slot && (d[t] = g.slot);
1277
- }), d;
1278
- }), $ = H({
1279
- prop: ((_ = e.defaultSort) == null ? void 0 : _.prop) || "",
1280
- order: ((ee = e.defaultSort) == null ? void 0 : ee.order) || null
1281
- }), C = x(() => {
1282
- if (!$.value.prop || !$.value.order)
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;
1562
+ }, 0));
1563
+ const k = M(() => {
1564
+ const t = {};
1565
+ return l.forEach((o) => {
1566
+ o.slot && (t[o.config.prop] = o.slot);
1567
+ }), t;
1568
+ }), C = V({
1569
+ prop: ((K = e.defaultSort) == null ? void 0 : K.prop) || "",
1570
+ order: ((c = e.defaultSort) == null ? void 0 : c.order) || null
1571
+ }), z = M(() => {
1572
+ if (!C.value.prop || !C.value.order)
1283
1573
  return e.data;
1284
- const { prop: d, order: g } = $.value;
1285
- return [...e.data].sort((t, a) => {
1286
- const o = t[d], p = a[d];
1287
- if (o === p) return 0;
1288
- const v = o > p ? 1 : -1;
1289
- return g === "ascending" ? v : -v;
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;
1290
1580
  });
1291
- }), S = x(() => {
1292
- const d = {};
1293
- return e.height && (d.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (d.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), d;
1294
- }), K = x(() => [
1295
- r.b(),
1296
- r.is("border", e.border),
1297
- r.is("stripe", e.stripe),
1298
- r.is("loading", e.loading)
1299
- ]), N = (d) => {
1300
- d.sortable && ($.value.prop === d.prop ? $.value.order === "ascending" ? $.value.order = "descending" : $.value.order === "descending" && ($.value.order = null, $.value.prop = "") : ($.value.prop = d.prop, $.value.order = "ascending"), y("sort-change", { ...$.value }));
1301
- }, Z = (d) => d.sortable ? $.value.prop !== d.prop ? r.is("sortable") : [
1302
- r.is("sortable"),
1303
- r.is(`sort-${$.value.order}`)
1304
- ] : "", Y = (d, g, t) => {
1305
- const a = d[g.prop];
1306
- return g.formatter ? g.formatter(d, g, a, t) : a ?? "";
1307
- }, E = (d, g) => {
1308
- y("row-click", d, w.value[0], g);
1309
- }, D = (d, g, t) => {
1310
- const a = t.target;
1311
- y("cell-click", d, g, a, t);
1312
- }, B = (d) => {
1313
- y("page-change", d);
1314
- }, X = (d) => {
1315
- y("size-change", d);
1316
- }, P = (d) => {
1317
- const g = {};
1318
- return d.width && (g.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (g.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (g.textAlign = d.align), g;
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) => {
1608
+ const p = {};
1609
+ if (t.width && (p.width = typeof t.width == "number" ? `${t.width}px` : t.width), t.minWidth && (p.minWidth = typeof t.minWidth == "number" ? `${t.minWidth}px` : t.minWidth), t.align && (p.textAlign = t.align), (t.fixed === "left" || t.fixed === !0) && (p.position = "sticky", p.left = "0px", p.zIndex = "2", o !== void 0 && o > 0)) {
1610
+ let $ = 0;
1611
+ for (let P = 0; P < o; P++) {
1612
+ const X = N.value[P], le = X.width ? typeof X.width == "number" ? X.width : parseInt(X.width) : 100;
1613
+ $ += le;
1614
+ }
1615
+ p.left = `${$}px`;
1616
+ }
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;
1624
+ }
1625
+ p.right = `${X}px`;
1626
+ }
1627
+ }
1628
+ return p;
1629
+ }, ae = (t) => {
1630
+ const o = [];
1631
+ return (t.fixed === "left" || t.fixed === !0) && o.push(n.is("fixed-left")), t.fixed === "right" && o.push(n.is("fixed-right")), o;
1319
1632
  };
1320
- return s({
1633
+ return r({
1321
1634
  clearSelection: () => {
1322
1635
  },
1323
1636
  getSelection: () => [],
1324
- sortState: $,
1325
- columns: w
1326
- }), (d, g) => (c(), u("div", {
1327
- class: f(K.value)
1637
+ sortState: C,
1638
+ columns: x
1639
+ }), (t, o) => (h(), v("div", {
1640
+ class: u(W.value)
1328
1641
  }, [
1329
- l.loading ? (c(), u("div", {
1642
+ s.loading ? (h(), v("div", {
1330
1643
  key: 0,
1331
- class: f(h(r).e("loading"))
1332
- }, [...g[0] || (g[0] = [
1333
- m("span", { class: "loading-spinner" }, null, -1),
1334
- m("span", { class: "loading-text" }, "加载中...", -1)
1335
- ])], 2)) : M("", !0),
1336
- m("div", {
1337
- class: f(h(r).e("wrapper")),
1338
- style: L(S.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)
1339
1652
  }, [
1340
- m("table", null, [
1341
- l.showHeader ? (c(), u("thead", Ze, [
1342
- m("tr", null, [
1343
- (c(!0), u(R, null, U(w.value, (t) => (c(), u("th", {
1344
- key: t.prop,
1345
- class: f([h(r).e("header-cell"), Z(t)]),
1346
- style: L(P(t)),
1347
- onClick: (a) => N(t)
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)
1348
1661
  }, [
1349
- m("span", null, A(t.label), 1),
1350
- t.sortable ? (c(), u("span", {
1662
+ g("span", null, T(f.label), 1),
1663
+ f.sortable ? (h(), v("span", {
1351
1664
  key: 0,
1352
- class: f(h(r).e("sort-icon"))
1353
- }, [...g[1] || (g[1] = [
1354
- m("span", { class: "sort-arrow up" }, "▲", -1),
1355
- m("span", { class: "sort-arrow down" }, "▼", -1)
1356
- ])], 2)) : M("", !0)
1357
- ], 14, Ve))), 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))
1358
1681
  ])
1359
- ])) : M("", !0),
1360
- m("tbody", null, [
1361
- (c(!0), u(R, null, U(C.value, (t, a) => (c(), u("tr", {
1362
- key: l.rowKey ? typeof l.rowKey == "function" ? l.rowKey(t) : t[l.rowKey] : a,
1363
- class: f([h(r).e("row")]),
1364
- onClick: (o) => E(t, o)
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, $)
1365
1688
  }, [
1366
- (c(!0), u(R, null, U(w.value, (o) => (c(), u("td", {
1367
- key: o.prop,
1368
- class: f(h(r).e("cell")),
1369
- style: L(P(o)),
1370
- onClick: (p) => D(t, o, p)
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)
1371
1694
  }, [
1372
- T.value[o.prop] ? (c(), ae(ie(() => T.value[o.prop]({ row: t, column: o, $index: a })), { key: 0 })) : (c(), u(R, { key: 1 }, [
1373
- J(A(Y(t, o, a)), 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)
1374
1697
  ], 64))
1375
- ], 14, Je))), 128))
1376
- ], 10, Ue))), 128))
1698
+ ], 14, ct))), 128))
1699
+ ], 10, rt))), 128))
1377
1700
  ]),
1378
- C.value.length === 0 && !l.loading ? (c(), u("tbody", Fe, [
1379
- m("tr", null, [
1380
- m("td", {
1381
- colspan: w.value.length || 1,
1382
- class: f(h(r).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"))
1383
1706
  }, [
1384
- j(d.$slots, "empty", {}, () => [
1385
- J(A(l.emptyText), 1)
1707
+ E(t.$slots, "empty", {}, () => [
1708
+ q(T(s.emptyText), 1)
1386
1709
  ])
1387
- ], 10, qe)
1710
+ ], 10, ut)
1388
1711
  ])
1389
- ])) : M("", !0)
1712
+ ])) : H("", !0)
1390
1713
  ])
1391
1714
  ], 6),
1392
- l.pagination ? (c(), u("div", {
1715
+ s.pagination ? (h(), v("div", {
1393
1716
  key: 1,
1394
- class: f(h(r).e("pagination"))
1717
+ class: u(i(n).e("pagination"))
1395
1718
  }, [
1396
- ke(Ke, {
1397
- total: l.pagination.total,
1398
- "current-page": l.pagination.current,
1399
- "page-size": l.pagination.pageSize,
1719
+ F(Ee, {
1720
+ total: s.pagination.total,
1721
+ "current-page": s.pagination.current,
1722
+ "page-size": s.pagination.pageSize,
1400
1723
  onCurrentChange: B,
1401
- onSizeChange: X
1724
+ onSizeChange: O
1402
1725
  }, null, 8, ["total", "current-page", "page-size"])
1403
- ], 2)) : M("", !0),
1404
- m("div", _e, [
1405
- j(d.$slots, "default")
1726
+ ], 2)) : H("", !0),
1727
+ g("div", ht, [
1728
+ E(t.$slots, "default")
1406
1729
  ])
1407
1730
  ], 2));
1408
1731
  }
1409
- }), It = /* @__PURE__ */ O({
1732
+ }), Rt = /* @__PURE__ */ Y({
1410
1733
  name: "XTableColumn",
1411
1734
  __name: "TableColumn",
1412
1735
  props: {
@@ -1419,28 +1742,28 @@ const vt = /* @__PURE__ */ O({
1419
1742
  fixed: { type: [String, Boolean] },
1420
1743
  formatter: {}
1421
1744
  },
1422
- setup(l) {
1423
- const s = l;
1424
- G("table-column");
1425
- const i = de(), e = le("x-table"), y = x(() => ({
1426
- prop: s.prop,
1427
- label: s.label,
1428
- width: s.width,
1429
- minWidth: s.minWidth,
1430
- align: s.align,
1431
- sortable: s.sortable,
1432
- fixed: s.fixed,
1433
- formatter: s.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
1434
1757
  }));
1435
- return se(() => {
1436
- e != null && e.registerColumn && e.registerColumn(y.value, i.default);
1437
- }), F(() => i.default, (r) => {
1438
- e != null && e.updateColumnSlot && r && e.updateColumnSlot(s.prop, r);
1439
- }, { immediate: !0 }), oe(() => {
1440
- e != null && e.unregisterColumn && e.unregisterColumn(s.prop);
1441
- }), (r, n) => 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;
1442
1765
  }
1443
- }), et = { key: 0 }, tt = ["onClick"], at = ["onClick"], nt = { key: 0 }, lt = { key: 1 }, st = { key: 0 }, ot = ["colspan"], rt = { style: { display: "none" } }, Mt = /* @__PURE__ */ O({
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({
1444
1767
  name: "XTreeTable",
1445
1768
  __name: "index",
1446
1769
  props: {
@@ -1459,197 +1782,215 @@ const vt = /* @__PURE__ */ O({
1459
1782
  collapseIcon: {}
1460
1783
  },
1461
1784
  emits: ["row-click", "cell-click", "expand-change", "sort-change"],
1462
- setup(l, { expose: s, emit: i }) {
1463
- const e = l, y = i, r = G("tree-table"), n = H(/* @__PURE__ */ new Set()), k = H([]), b = H({});
1464
- ne("x-tree-table", {
1465
- registerColumn: (d, g) => {
1466
- const t = k.value.findIndex((a) => a.prop === d.prop);
1467
- t === -1 ? k.value.push(d) : k.value[t] = d, g && (b.value[d.prop] = g);
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);
1468
1791
  },
1469
- unregisterColumn: (d) => {
1470
- const g = k.value.findIndex((t) => t.prop === d);
1471
- g > -1 && k.value.splice(g, 1), delete b.value[d];
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];
1472
1795
  },
1473
- updateColumnSlot: (d, g) => {
1474
- b.value[d] = g;
1796
+ updateColumnSlot: (b, K) => {
1797
+ y.value[b] = K;
1475
1798
  },
1476
1799
  props: e
1477
1800
  });
1478
- const $ = (d) => typeof e.rowKey == "function" ? e.rowKey(d) : d[e.rowKey || "id"], C = (d) => {
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) => {
1479
1806
  var t;
1480
- const g = ((t = e.treeProps) == null ? void 0 : t.children) || "children";
1481
- return d[g] || [];
1482
- }, S = (d) => {
1483
- var a;
1484
- if (C(d).length > 0) return !0;
1485
- const t = ((a = e.treeProps) == null ? void 0 : a.hasChildren) || "hasChildren";
1486
- return d[t] === !0;
1487
- }, K = (d) => {
1488
- const g = $(d);
1489
- return n.value.has(g);
1490
- }, N = (d) => {
1491
- const g = $(d), t = !n.value.has(g);
1492
- t ? n.value.add(g) : n.value.delete(g), y("expand-change", d, t);
1493
- }, Z = () => {
1494
- const d = (g) => {
1495
- g.forEach((t) => {
1496
- S(t) && (n.value.add($(t)), d(C(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)));
1497
1820
  });
1498
1821
  };
1499
- d(e.data);
1500
- }, Y = () => {
1501
- n.value.clear();
1502
- }, E = x(() => {
1503
- const d = [], g = (t, a = 0, o = !0) => {
1504
- t.forEach((p) => {
1505
- const v = $(p), z = n.value.has(v), W = o;
1506
- d.push({ row: p, level: a, visible: W });
1507
- const V = C(p);
1508
- V.length > 0 && z && g(V, a + 1, W);
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);
1509
1832
  });
1510
1833
  };
1511
- return g(e.data), d;
1512
- }), D = H({
1834
+ return K(e.data), b;
1835
+ }), L = V({
1513
1836
  prop: "",
1514
1837
  order: null
1515
- }), B = x(() => {
1516
- if (!D.value.prop || !D.value.order)
1517
- return E.value;
1518
- const { prop: d, order: g } = D.value;
1519
- return [...E.value].sort((t, a) => {
1520
- const o = t.row[d], p = a.row[d];
1521
- if (o === p) return 0;
1522
- const v = o > p ? 1 : -1;
1523
- return g === "ascending" ? v : -v;
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;
1524
1847
  });
1525
- }), X = (d) => {
1526
- d.sortable && (D.value.prop === d.prop ? D.value.order === "ascending" ? D.value.order = "descending" : D.value.order === "descending" && (D.value.order = null, D.value.prop = "") : (D.value.prop = d.prop, D.value.order = "ascending"), y("sort-change", { ...D.value }));
1527
- }, P = (d) => d.sortable ? D.value.prop !== d.prop ? r.is("sortable") : [
1528
- r.is("sortable"),
1529
- r.is(`sort-${D.value.order}`)
1530
- ] : "", Q = (d, g, t) => {
1531
- const a = d[g.prop];
1532
- return g.formatter ? g.formatter(d, g, a, t) : a ?? "";
1533
- }, q = (d) => {
1534
- const g = {};
1535
- return d.width && (g.width = typeof d.width == "number" ? `${d.width}px` : d.width), d.minWidth && (g.minWidth = typeof d.minWidth == "number" ? `${d.minWidth}px` : d.minWidth), d.align && (g.textAlign = d.align), g;
1536
- }, _ = x(() => [
1537
- r.b(),
1538
- r.is("border", e.border),
1539
- r.is("stripe", e.stripe),
1540
- r.is("loading", e.loading)
1541
- ]), ee = () => {
1542
- var d;
1543
- e.defaultExpandAll ? Z() : (d = e.defaultExpandedKeys) != null && d.length && e.defaultExpandedKeys.forEach((g) => {
1544
- n.value.add(g);
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);
1545
1868
  });
1546
1869
  };
1547
- return F(() => e.data, () => {
1548
- ee();
1549
- }, { immediate: !0 }), F(() => e.defaultExpandedKeys, (d) => {
1550
- d != null && d.length && !e.defaultExpandAll && (n.value.clear(), d.forEach((g) => {
1551
- n.value.add(g);
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);
1552
1875
  }));
1553
- }, { immediate: !0 }), s({
1554
- expandAll: Z,
1555
- collapseAll: Y,
1556
- toggleExpand: N,
1557
- expandedKeys: n,
1558
- columns: k
1559
- }), (d, g) => (c(), u("div", {
1560
- class: f(_.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)
1561
1884
  }, [
1562
- l.loading ? (c(), u("div", {
1885
+ s.loading ? (h(), v("div", {
1563
1886
  key: 0,
1564
- class: f(h(r).e("loading"))
1565
- }, [...g[0] || (g[0] = [
1566
- m("span", { class: "loading-spinner" }, null, -1),
1567
- m("span", { class: "loading-text" }, "加载中...", -1)
1568
- ])], 2)) : M("", !0),
1569
- m("div", {
1570
- class: f(h(r).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"))
1571
1894
  }, [
1572
- m("table", null, [
1573
- l.showHeader ? (c(), u("thead", et, [
1574
- m("tr", null, [
1575
- (c(!0), u(R, null, U(k.value, (t) => (c(), u("th", {
1576
- key: t.prop,
1577
- class: f([h(r).e("header-cell"), P(t)]),
1578
- style: L(q(t)),
1579
- onClick: (a) => X(t)
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)
1580
1903
  }, [
1581
- m("span", null, A(t.label), 1),
1582
- t.sortable ? (c(), u("span", {
1904
+ g("span", null, T(c.label), 1),
1905
+ c.sortable ? (h(), v("span", {
1583
1906
  key: 0,
1584
- class: f(h(r).e("sort-icon"))
1585
- }, [...g[1] || (g[1] = [
1586
- m("span", { class: "sort-arrow up" }, "▲", -1),
1587
- m("span", { class: "sort-arrow down" }, "▼", -1)
1588
- ])], 2)) : M("", !0)
1589
- ], 14, tt))), 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))
1590
1923
  ])
1591
- ])) : M("", !0),
1592
- m("tbody", null, [
1593
- (c(!0), u(R, null, U(B.value, (t, a) => (c(), u(R, {
1594
- key: $(t.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)
1595
1928
  }, [
1596
- t.visible ? (c(), u("tr", {
1929
+ c.visible ? (h(), v("tr", {
1597
1930
  key: 0,
1598
- class: f([h(r).e("row"), h(r).is("level-" + t.level)])
1931
+ class: u([i(n).e("row"), i(n).is("level-" + c.level)])
1599
1932
  }, [
1600
- (c(!0), u(R, null, U(k.value, (o, p) => (c(), u("td", {
1933
+ (h(!0), v(G, null, J(m.value, (o, f) => (h(), v("td", {
1601
1934
  key: o.prop,
1602
- class: f(h(r).e("cell")),
1603
- style: L(q(o))
1935
+ class: u(i(n).e("cell")),
1936
+ style: j(ee(o))
1604
1937
  }, [
1605
- p === 0 ? (c(), u("div", {
1938
+ f === 0 ? (h(), v("div", {
1606
1939
  key: 0,
1607
- class: f(h(r).e("cell-content"))
1940
+ class: u(i(n).e("cell-content"))
1608
1941
  }, [
1609
- m("span", {
1610
- class: f(h(r).e("indent")),
1611
- style: L({ width: `${t.level * l.indent}px` })
1942
+ g("span", {
1943
+ class: u(i(n).e("indent")),
1944
+ style: j({ width: `${c.level * s.indent}px` })
1612
1945
  }, null, 6),
1613
- S(t.row) ? (c(), u("span", {
1946
+ C(c.row) ? (h(), v("span", {
1614
1947
  key: 0,
1615
- class: f([h(r).e("expand-icon"), h(r).is("expanded", K(t.row))]),
1616
- onClick: re((v) => N(t.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"])
1617
1950
  }, [
1618
- K(t.row) ? (c(), u("span", nt, "▼")) : (c(), u("span", lt, "▶"))
1619
- ], 10, at)) : (c(), u("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", {
1620
1961
  key: 1,
1621
- class: f(h(r).e("expand-placeholder"))
1962
+ class: u(i(n).e("expand-placeholder"))
1622
1963
  }, null, 2)),
1623
- m("span", null, [
1624
- b.value[o.prop] ? (c(), ae(ie(() => b.value[o.prop]({ row: t.row, column: o, $index: a })), { key: 0 })) : (c(), u(R, { key: 1 }, [
1625
- J(A(Q(t.row, o, a)), 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)
1626
1967
  ], 64))
1627
1968
  ])
1628
- ], 2)) : b.value[o.prop] ? (c(), ae(ie(() => b.value[o.prop]({ row: t.row, column: o, $index: a })), { key: 1 })) : (c(), u(R, { key: 2 }, [
1629
- J(A(Q(t.row, o, a)), 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)
1630
1971
  ], 64))
1631
1972
  ], 6))), 128))
1632
- ], 2)) : M("", !0)
1973
+ ], 2)) : H("", !0)
1633
1974
  ], 64))), 128)),
1634
- B.value.length === 0 && !l.loading ? (c(), u("tr", st, [
1635
- m("td", {
1636
- colspan: k.value.length || 1,
1637
- class: f(h(r).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"))
1638
1979
  }, [
1639
- j(d.$slots, "empty", {}, () => [
1640
- J(A(l.emptyText), 1)
1980
+ E(b.$slots, "empty", {}, () => [
1981
+ q(T(s.emptyText), 1)
1641
1982
  ])
1642
- ], 10, ot)
1643
- ])) : M("", !0)
1983
+ ], 10, Mt)
1984
+ ])) : H("", !0)
1644
1985
  ])
1645
1986
  ])
1646
1987
  ], 2),
1647
- m("div", rt, [
1648
- j(d.$slots, "default")
1988
+ g("div", kt, [
1989
+ E(b.$slots, "default")
1649
1990
  ])
1650
1991
  ], 2));
1651
1992
  }
1652
- }), $t = /* @__PURE__ */ O({
1993
+ }), Wt = /* @__PURE__ */ Y({
1653
1994
  name: "XTreeTableColumn",
1654
1995
  __name: "TreeTableColumn",
1655
1996
  props: {
@@ -1662,28 +2003,28 @@ const vt = /* @__PURE__ */ O({
1662
2003
  fixed: { type: [String, Boolean] },
1663
2004
  formatter: {}
1664
2005
  },
1665
- setup(l) {
1666
- const s = l;
1667
- G("tree-table-column");
1668
- const i = de(), e = le("x-tree-table"), y = x(() => ({
1669
- prop: s.prop,
1670
- label: s.label,
1671
- width: s.width,
1672
- minWidth: s.minWidth,
1673
- align: s.align,
1674
- sortable: s.sortable,
1675
- fixed: s.fixed,
1676
- formatter: s.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
1677
2018
  }));
1678
- return se(() => {
1679
- e != null && e.registerColumn && e.registerColumn(y.value, i.default);
1680
- }), F(() => i.default, (r) => {
1681
- e != null && e.updateColumnSlot && r && e.updateColumnSlot(s.prop, r);
1682
- }, { immediate: !0 }), oe(() => {
1683
- e != null && e.unregisterColumn && e.unregisterColumn(s.prop);
1684
- }), (r, n) => 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;
1685
2026
  }
1686
- }), it = ["src", "alt"], St = /* @__PURE__ */ O({
2027
+ }), wt = ["src", "alt"], Ot = /* @__PURE__ */ Y({
1687
2028
  name: "XAvatar",
1688
2029
  __name: "index",
1689
2030
  props: {
@@ -1695,39 +2036,39 @@ const vt = /* @__PURE__ */ O({
1695
2036
  alt: {}
1696
2037
  },
1697
2038
  emits: ["error"],
1698
- setup(l, { emit: s }) {
1699
- const i = l, e = s, y = G("avatar"), r = x(() => [
1700
- y.b(),
1701
- y.m(i.shape),
1702
- typeof i.size == "string" ? y.m(i.size) : ""
1703
- ]), n = x(() => {
1704
- const b = {};
1705
- return typeof i.size == "number" && (b.width = `${i.size}px`, b.height = `${i.size}px`, b.lineHeight = `${i.size}px`), b;
1706
- }), k = (b) => {
1707
- e("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);
1708
2049
  };
1709
- return (b, I) => (c(), u("span", {
1710
- class: f(r.value),
1711
- style: L(n.value)
2050
+ return (y, w) => (h(), v("span", {
2051
+ class: u(n.value),
2052
+ style: j(l.value)
1712
2053
  }, [
1713
- l.src ? (c(), u("img", {
2054
+ s.src ? (h(), v("img", {
1714
2055
  key: 0,
1715
- src: l.src,
1716
- alt: l.alt,
1717
- style: L({ objectFit: l.fit }),
1718
- onError: k
1719
- }, null, 44, it)) : l.icon ? (c(), u("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", {
1720
2061
  key: 1,
1721
- class: f(h(y).e("icon"))
1722
- }, A(l.icon), 3)) : (c(), u("span", {
2062
+ class: u(i(d).e("icon"))
2063
+ }, T(s.icon), 3)) : (h(), v("span", {
1723
2064
  key: 2,
1724
- class: f(h(y).e("default"))
2065
+ class: u(i(d).e("default"))
1725
2066
  }, [
1726
- j(b.$slots, "default")
2067
+ E(y.$slots, "default")
1727
2068
  ], 2))
1728
2069
  ], 6));
1729
2070
  }
1730
- }), Kt = /* @__PURE__ */ O({
2071
+ }), Yt = /* @__PURE__ */ Y({
1731
2072
  name: "XDescriptions",
1732
2073
  __name: "index",
1733
2074
  props: {
@@ -1740,36 +2081,36 @@ const vt = /* @__PURE__ */ O({
1740
2081
  contentAlign: { default: "left" },
1741
2082
  colon: { type: Boolean, default: !0 }
1742
2083
  },
1743
- setup(l) {
1744
- const s = l, i = G("descriptions");
1745
- ne("x-descriptions", {
1746
- props: s,
1747
- column: x(() => s.column)
2084
+ setup(s) {
2085
+ const r = s, a = Q("descriptions");
2086
+ ie("x-descriptions", {
2087
+ props: r,
2088
+ column: M(() => r.column)
1748
2089
  });
1749
- const e = x(() => [
1750
- i.b(),
1751
- i.m(s.size),
1752
- i.is("bordered", s.border)
2090
+ const e = M(() => [
2091
+ a.b(),
2092
+ a.m(r.size),
2093
+ a.is("bordered", r.border)
1753
2094
  ]);
1754
- return (y, r) => (c(), u("div", {
1755
- class: f(e.value)
2095
+ return (d, n) => (h(), v("div", {
2096
+ class: u(e.value)
1756
2097
  }, [
1757
- l.title ? (c(), u("div", {
2098
+ s.title ? (h(), v("div", {
1758
2099
  key: 0,
1759
- class: f(h(i).e("title"))
1760
- }, A(l.title), 3)) : M("", !0),
1761
- m("div", {
1762
- class: f(h(i).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"))
1763
2104
  }, [
1764
- m("table", null, [
1765
- m("tbody", null, [
1766
- j(y.$slots, "default")
2105
+ g("table", null, [
2106
+ g("tbody", null, [
2107
+ E(d.$slots, "default")
1767
2108
  ])
1768
2109
  ])
1769
2110
  ], 2)
1770
2111
  ], 2));
1771
2112
  }
1772
- }), dt = ["colspan"], ct = ["colspan"], Nt = /* @__PURE__ */ O({
2113
+ }), bt = ["colspan"], xt = ["colspan"], Xt = /* @__PURE__ */ Y({
1773
2114
  name: "XDescriptionsItem",
1774
2115
  __name: "DescriptionsItem",
1775
2116
  props: {
@@ -1778,52 +2119,52 @@ const vt = /* @__PURE__ */ O({
1778
2119
  labelAlign: {},
1779
2120
  contentAlign: {}
1780
2121
  },
1781
- setup(l) {
1782
- const s = l, i = G("descriptions-item"), e = le("x-descriptions"), y = x(() => {
1783
- var T;
1784
- const I = {}, w = (T = e == null ? void 0 : e.props) == null ? void 0 : T.labelWidth;
1785
- return w && (I.width = typeof w == "number" ? `${w}px` : w), I;
1786
- }), r = x(() => {
1787
- var I;
1788
- return s.labelAlign || ((I = e == null ? void 0 : e.props) == null ? void 0 : I.labelAlign) || "right";
1789
- }), n = x(() => {
1790
- var I;
1791
- return s.contentAlign || ((I = e == null ? void 0 : e.props) == null ? void 0 : I.contentAlign) || "left";
1792
- }), k = x(() => {
1793
- var I;
1794
- return ((I = e == null ? void 0 : e.props) == null ? void 0 : I.colon) ?? !0;
1795
- }), b = x(() => {
1796
- var I;
1797
- return ((I = e == null ? void 0 : e.props) == null ? void 0 : I.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;
1798
2139
  });
1799
- return (I, w) => b.value ? (c(), u(R, { key: 0 }, [
1800
- m("th", {
1801
- class: f([h(i).b(), h(i).e("label"), `is-${r.value}`]),
1802
- style: L(y.value)
1803
- }, A(l.label) + A(k.value ? ":" : ""), 7),
1804
- m("td", {
1805
- class: f([h(i).e("content"), `is-${n.value}`]),
1806
- 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
1807
2148
  }, [
1808
- j(I.$slots, "default")
1809
- ], 10, dt)
1810
- ], 64)) : (c(), u("tr", {
2149
+ E(w.$slots, "default")
2150
+ ], 10, bt)
2151
+ ], 64)) : (h(), v("tr", {
1811
2152
  key: 1,
1812
- class: f(h(i).b())
2153
+ class: u(i(a).b())
1813
2154
  }, [
1814
- m("th", {
1815
- class: f([h(i).e("label"), `is-${r.value}`]),
1816
- style: L(y.value)
1817
- }, A(l.label) + A(k.value ? ":" : ""), 7),
1818
- m("td", {
1819
- class: f([h(i).e("content"), `is-${n.value}`]),
1820
- 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
1821
2162
  }, [
1822
- j(I.$slots, "default")
1823
- ], 10, ct)
2163
+ E(w.$slots, "default")
2164
+ ], 10, xt)
1824
2165
  ], 2));
1825
2166
  }
1826
- }), Dt = /* @__PURE__ */ O({
2167
+ }), Qt = /* @__PURE__ */ Y({
1827
2168
  name: "XScrollbar",
1828
2169
  __name: "index",
1829
2170
  props: {
@@ -1840,90 +2181,645 @@ const vt = /* @__PURE__ */ O({
1840
2181
  minSize: { default: 20 }
1841
2182
  },
1842
2183
  emits: ["scroll"],
1843
- setup(l, { expose: s, emit: i }) {
1844
- const e = l, y = i, r = G("scrollbar"), n = H(), k = H(), b = H("0"), I = H("0"), w = H(0), T = H(0), $ = x(() => {
1845
- const E = {};
1846
- return e.height && (E.height = typeof e.height == "number" ? `${e.height}px` : e.height), e.maxHeight && (E.maxHeight = typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight), E;
1847
- }), C = () => {
1848
- if (!n.value) return;
1849
- const E = n.value.offsetHeight - 4, D = n.value.offsetWidth - 4, B = n.value.scrollHeight, X = n.value.scrollWidth, P = E / B, Q = D / X;
1850
- I.value = P >= 1 ? "0" : `${E * P}px`, b.value = Q >= 1 ? "0" : `${D * Q}px`;
1851
- }, S = (E) => {
1852
- if (!n.value) return;
1853
- const D = n.value.offsetHeight, B = n.value.offsetWidth;
1854
- T.value = n.value.scrollTop * 100 / D, w.value = n.value.scrollLeft * 100 / B, y("scroll", E);
1855
- }, K = (E) => {
1856
- var D;
1857
- (D = n.value) == null || D.scrollTo(E);
1858
- }, N = (E) => {
1859
- n.value && (n.value.scrollTop = E);
1860
- }, Z = (E) => {
1861
- n.value && (n.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);
1862
2203
  };
1863
- let Y = null;
1864
- return se(() => {
1865
- e.native || (fe(C), e.noresize || (Y = new ResizeObserver(C), k.value && Y.observe(k.value), window.addEventListener("resize", C)));
1866
- }), oe(() => {
1867
- Y && Y.disconnect(), window.removeEventListener("resize", C);
1868
- }), s({
1869
- scrollTo: K,
1870
- setScrollTop: N,
1871
- setScrollLeft: Z,
1872
- update: C
1873
- }), (E, D) => (c(), u("div", {
1874
- class: f(h(r).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())
1875
2216
  }, [
1876
- m("div", {
2217
+ g("div", {
1877
2218
  ref_key: "wrapRef",
1878
- ref: n,
1879
- class: f([h(r).e("wrap"), l.wrapClass, { [h(r).em("wrap", "hidden-default")]: !l.native }]),
1880
- style: L([$.value, { overflow: l.native ? "auto" : "hidden" }]),
1881
- onScroll: S
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
1882
2223
  }, [
1883
- (c(), ae(ie(l.tag), {
2224
+ (h(), te(he(s.tag), {
1884
2225
  ref_key: "resizeRef",
1885
- ref: k,
1886
- class: f([h(r).e("view"), l.viewClass]),
1887
- style: L(l.viewStyle)
2226
+ ref: m,
2227
+ class: u([i(n).e("view"), s.viewClass]),
2228
+ style: j(s.viewStyle)
1888
2229
  }, {
1889
- default: ce(() => [
1890
- j(E.$slots, "default")
2230
+ default: ve(() => [
2231
+ E(S.$slots, "default")
1891
2232
  ]),
1892
2233
  _: 3
1893
2234
  }, 8, ["class", "style"]))
1894
2235
  ], 38),
1895
- !l.native && I.value ? (c(), u("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", {
1896
2382
  key: 0,
1897
- class: f([h(r).e("bar"), h(r).is("vertical")]),
1898
- style: L({ height: I.value, top: `${T.value}%` })
1899
- }, null, 6)) : M("", !0),
1900
- !l.native && b.value ? (c(), u("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", {
1901
2393
  key: 1,
1902
- class: f([h(r).e("bar"), h(r).is("horizontal")]),
1903
- style: L({ width: b.value, left: `${w.value}%` })
1904
- }, null, 6)) : M("", !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)
1905
2794
  ], 2));
1906
2795
  }
1907
2796
  });
1908
2797
  export {
1909
- St as Avatar,
1910
- pt as Card,
1911
- xt as Carousel,
1912
- Ct as CarouselItem,
1913
- Kt as Descriptions,
1914
- Nt as DescriptionsItem,
1915
- gt as DynamicTable,
1916
- mt as Empty,
1917
- Ke as Pagination,
1918
- yt as Progress,
1919
- Dt as Scrollbar,
1920
- wt as Table,
1921
- It as TableColumn,
1922
- ft as Tag,
1923
- kt as Timeline,
1924
- bt as TimelineItem,
1925
- vt as Tree,
1926
- te as TreeNode,
1927
- Mt as TreeTable,
1928
- $t 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
1929
2825
  };