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