@weaveui/web 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/LICENSE +35 -0
  2. package/README.md +119 -0
  3. package/THIRD_PARTY_NOTICES +29 -0
  4. package/dist/apm-log.es.js +996 -0
  5. package/dist/apm-log.umd.cjs +1 -0
  6. package/dist/business/apm-log/behavior-directive.d.ts +9 -0
  7. package/dist/business/apm-log/behavior-log.d.ts +6 -0
  8. package/dist/business/apm-log/behavior-types.d.ts +121 -0
  9. package/dist/business/apm-log/browser.d.ts +3 -0
  10. package/dist/business/apm-log/directive.d.ts +13 -0
  11. package/dist/business/apm-log/index.d.ts +8 -0
  12. package/dist/business/apm-log/legacy-apm-log.d.ts +6 -0
  13. package/dist/business/apm-log/types.d.ts +147 -0
  14. package/dist/business/apm-log/vue.d.ts +5 -0
  15. package/dist/business/monitor/index.d.ts +81 -0
  16. package/dist/business/monitor/monitor-plugin.d.ts +9 -0
  17. package/dist/business/monitor/runtime-types.d.ts +166 -0
  18. package/dist/business/monitor/runtime.d.ts +6 -0
  19. package/dist/business/monitor/types.d.ts +221 -0
  20. package/dist/business/permission/Permission.d.ts +18 -0
  21. package/dist/business/permission/PermissionPluginClass.d.ts +40 -0
  22. package/dist/business/permission/directive.d.ts +7 -0
  23. package/dist/business/permission/index.d.ts +35 -0
  24. package/dist/business/permission/permission-plugin.d.ts +16 -0
  25. package/dist/business/permission/storage.d.ts +30 -0
  26. package/dist/business/permission/tree.d.ts +19 -0
  27. package/dist/business/permission/types.d.ts +115 -0
  28. package/dist/business/upload-cos/index.d.ts +117 -0
  29. package/dist/business/upload-cos/src/UploadCos.vue.d.ts +70 -0
  30. package/dist/business/upload-cos/src/types.d.ts +72 -0
  31. package/dist/business/upload-cos/src/utils.d.ts +9 -0
  32. package/dist/index.d.ts +1894 -0
  33. package/dist/index.es.js +4315 -0
  34. package/dist/index.umd.cjs +6 -0
  35. package/dist/monitor.es.js +1217 -0
  36. package/dist/monitor.umd.cjs +1 -0
  37. package/dist/permission.es.js +631 -0
  38. package/dist/permission.umd.cjs +1 -0
  39. package/dist/style.css +1 -0
  40. package/dist/upload-cos.es.js +426 -0
  41. package/dist/upload-cos.style.css +1 -0
  42. package/dist/upload-cos.umd.cjs +1 -0
  43. package/dist/utils/index.d.ts +3 -0
  44. package/dist/utils/is.d.ts +2 -0
  45. package/dist/utils/withInstall.d.ts +7 -0
  46. package/package.json +105 -0
@@ -0,0 +1,4315 @@
1
+ import { defineComponent as ee, openBlock as l, createElementBlock as u, createElementVNode as d, computed as k, resolveComponent as j, Fragment as ye, renderList as Se, normalizeClass as we, toDisplayString as I, createVNode as T, withCtx as C, unref as q, createCommentVNode as N, renderSlot as Ce, createTextVNode as Ve, ref as K, getCurrentInstance as ot, onBeforeUpdate as ft, watch as he, createBlock as le, withModifiers as ze, normalizeStyle as Qe, onBeforeUnmount as pt, useSlots as Ct, shallowRef as Dt, onMounted as St, resolveDirective as jt, normalizeProps as st, guardReactiveProps as ut, withDirectives as et, mergeProps as Vt, createSlots as Ht, vShow as Qt, nextTick as mt, vModelText as vt, withKeys as qt, resolveDynamicComponent as Gt } from "vue";
2
+ import { ElMessage as At } from "element-plus";
3
+ const Xt = "Element Custom UI", ci = "ElementCustomUI", Wt = "element-custom-ui", wt = /* @__PURE__ */ new WeakMap();
4
+ function xe(e, y) {
5
+ const i = e, t = e, o = y ?? t.name ?? t.__name;
6
+ if (!o)
7
+ throw new Error(`${Xt} component requires an explicit install name.`);
8
+ let a = wt.get(e);
9
+ return a || (a = /* @__PURE__ */ new Set(), wt.set(e, a), i.install = (v) => {
10
+ a == null || a.forEach((S) => {
11
+ v.component(S, e);
12
+ });
13
+ }), a.add(o), i;
14
+ }
15
+ /*! Element Plus Icons Vue v2.3.2 */
16
+ var Jt = /* @__PURE__ */ ee({
17
+ name: "ArrowDown",
18
+ __name: "arrow-down",
19
+ setup(e) {
20
+ return (y, i) => (l(), u("svg", {
21
+ xmlns: "http://www.w3.org/2000/svg",
22
+ viewBox: "0 0 1024 1024"
23
+ }, [
24
+ d("path", {
25
+ fill: "currentColor",
26
+ d: "M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"
27
+ })
28
+ ]));
29
+ }
30
+ }), $t = Jt, Yt = /* @__PURE__ */ ee({
31
+ name: "ArrowLeft",
32
+ __name: "arrow-left",
33
+ setup(e) {
34
+ return (y, i) => (l(), u("svg", {
35
+ xmlns: "http://www.w3.org/2000/svg",
36
+ viewBox: "0 0 1024 1024"
37
+ }, [
38
+ d("path", {
39
+ fill: "currentColor",
40
+ d: "M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"
41
+ })
42
+ ]));
43
+ }
44
+ }), Zt = Yt, el = /* @__PURE__ */ ee({
45
+ name: "ArrowRight",
46
+ __name: "arrow-right",
47
+ setup(e) {
48
+ return (y, i) => (l(), u("svg", {
49
+ xmlns: "http://www.w3.org/2000/svg",
50
+ viewBox: "0 0 1024 1024"
51
+ }, [
52
+ d("path", {
53
+ fill: "currentColor",
54
+ d: "M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"
55
+ })
56
+ ]));
57
+ }
58
+ }), tl = el, ll = /* @__PURE__ */ ee({
59
+ name: "Check",
60
+ __name: "check",
61
+ setup(e) {
62
+ return (y, i) => (l(), u("svg", {
63
+ xmlns: "http://www.w3.org/2000/svg",
64
+ viewBox: "0 0 1024 1024"
65
+ }, [
66
+ d("path", {
67
+ fill: "currentColor",
68
+ d: "M406.656 706.944 195.84 496.256a32 32 0 1 0-45.248 45.248l256 256 512-512a32 32 0 0 0-45.248-45.248L406.592 706.944z"
69
+ })
70
+ ]));
71
+ }
72
+ }), _t = ll, al = /* @__PURE__ */ ee({
73
+ name: "CircleClose",
74
+ __name: "circle-close",
75
+ setup(e) {
76
+ return (y, i) => (l(), u("svg", {
77
+ xmlns: "http://www.w3.org/2000/svg",
78
+ viewBox: "0 0 1024 1024"
79
+ }, [
80
+ d("path", {
81
+ fill: "currentColor",
82
+ d: "m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"
83
+ }),
84
+ d("path", {
85
+ fill: "currentColor",
86
+ d: "M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"
87
+ })
88
+ ]));
89
+ }
90
+ }), nl = al, ol = /* @__PURE__ */ ee({
91
+ name: "Close",
92
+ __name: "close",
93
+ setup(e) {
94
+ return (y, i) => (l(), u("svg", {
95
+ xmlns: "http://www.w3.org/2000/svg",
96
+ viewBox: "0 0 1024 1024"
97
+ }, [
98
+ d("path", {
99
+ fill: "currentColor",
100
+ d: "M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"
101
+ })
102
+ ]));
103
+ }
104
+ }), qe = ol, il = /* @__PURE__ */ ee({
105
+ name: "Document",
106
+ __name: "document",
107
+ setup(e) {
108
+ return (y, i) => (l(), u("svg", {
109
+ xmlns: "http://www.w3.org/2000/svg",
110
+ viewBox: "0 0 1024 1024"
111
+ }, [
112
+ d("path", {
113
+ fill: "currentColor",
114
+ d: "M832 384H576V128H192v768h640zm-26.496-64L640 154.496V320zM160 64h480l256 256v608a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V96a32 32 0 0 1 32-32m160 448h384v64H320zm0-192h160v64H320zm0 384h384v64H320z"
115
+ })
116
+ ]));
117
+ }
118
+ }), Tt = il, sl = /* @__PURE__ */ ee({
119
+ name: "Download",
120
+ __name: "download",
121
+ setup(e) {
122
+ return (y, i) => (l(), u("svg", {
123
+ xmlns: "http://www.w3.org/2000/svg",
124
+ viewBox: "0 0 1024 1024"
125
+ }, [
126
+ d("path", {
127
+ fill: "currentColor",
128
+ d: "M160 832h704a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m384-253.696 236.288-236.352 45.248 45.248L508.8 704 192 387.2l45.248-45.248L480 584.704V128h64z"
129
+ })
130
+ ]));
131
+ }
132
+ }), ul = sl, rl = /* @__PURE__ */ ee({
133
+ name: "FolderOpened",
134
+ __name: "folder-opened",
135
+ setup(e) {
136
+ return (y, i) => (l(), u("svg", {
137
+ xmlns: "http://www.w3.org/2000/svg",
138
+ viewBox: "0 0 1024 1024"
139
+ }, [
140
+ d("path", {
141
+ fill: "currentColor",
142
+ d: "M878.08 448H241.92l-96 384h636.16zM832 384v-64H485.76L357.504 192H128v448l57.92-231.744A32 32 0 0 1 216.96 384zm-24.96 512H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h287.872l128.384 128H864a32 32 0 0 1 32 32v96h23.04a32 32 0 0 1 31.04 39.744l-112 448A32 32 0 0 1 807.04 896"
143
+ })
144
+ ]));
145
+ }
146
+ }), xt = rl, cl = /* @__PURE__ */ ee({
147
+ name: "FullScreen",
148
+ __name: "full-screen",
149
+ setup(e) {
150
+ return (y, i) => (l(), u("svg", {
151
+ xmlns: "http://www.w3.org/2000/svg",
152
+ viewBox: "0 0 1024 1024"
153
+ }, [
154
+ d("path", {
155
+ fill: "currentColor",
156
+ d: "m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"
157
+ })
158
+ ]));
159
+ }
160
+ }), dl = cl, fl = /* @__PURE__ */ ee({
161
+ name: "Minus",
162
+ __name: "minus",
163
+ setup(e) {
164
+ return (y, i) => (l(), u("svg", {
165
+ xmlns: "http://www.w3.org/2000/svg",
166
+ viewBox: "0 0 1024 1024"
167
+ }, [
168
+ d("path", {
169
+ fill: "currentColor",
170
+ d: "M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"
171
+ })
172
+ ]));
173
+ }
174
+ }), pl = fl, ml = /* @__PURE__ */ ee({
175
+ name: "Plus",
176
+ __name: "plus",
177
+ setup(e) {
178
+ return (y, i) => (l(), u("svg", {
179
+ xmlns: "http://www.w3.org/2000/svg",
180
+ viewBox: "0 0 1024 1024"
181
+ }, [
182
+ d("path", {
183
+ fill: "currentColor",
184
+ d: "M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"
185
+ })
186
+ ]));
187
+ }
188
+ }), gt = ml, vl = /* @__PURE__ */ ee({
189
+ name: "RefreshLeft",
190
+ __name: "refresh-left",
191
+ setup(e) {
192
+ return (y, i) => (l(), u("svg", {
193
+ xmlns: "http://www.w3.org/2000/svg",
194
+ viewBox: "0 0 1024 1024"
195
+ }, [
196
+ d("path", {
197
+ fill: "currentColor",
198
+ d: "M289.088 296.704h92.992a32 32 0 0 1 0 64H232.96a32 32 0 0 1-32-32V179.712a32 32 0 0 1 64 0v50.56a384 384 0 0 1 643.84 282.88 384 384 0 0 1-383.936 384 384 384 0 0 1-384-384h64a320 320 0 1 0 640 0 320 320 0 0 0-555.712-216.448z"
199
+ })
200
+ ]));
201
+ }
202
+ }), _l = vl, gl = /* @__PURE__ */ ee({
203
+ name: "RefreshRight",
204
+ __name: "refresh-right",
205
+ setup(e) {
206
+ return (y, i) => (l(), u("svg", {
207
+ xmlns: "http://www.w3.org/2000/svg",
208
+ viewBox: "0 0 1024 1024"
209
+ }, [
210
+ d("path", {
211
+ fill: "currentColor",
212
+ d: "M784.512 230.272v-50.56a32 32 0 1 1 64 0v149.056a32 32 0 0 1-32 32H667.52a32 32 0 1 1 0-64h92.992A320 320 0 1 0 524.8 833.152a320 320 0 0 0 320-320h64a384 384 0 0 1-384 384 384 384 0 0 1-384-384 384 384 0 0 1 643.712-282.88"
213
+ })
214
+ ]));
215
+ }
216
+ }), Et = gl, yl = /* @__PURE__ */ ee({
217
+ name: "Refresh",
218
+ __name: "refresh",
219
+ setup(e) {
220
+ return (y, i) => (l(), u("svg", {
221
+ xmlns: "http://www.w3.org/2000/svg",
222
+ viewBox: "0 0 1024 1024"
223
+ }, [
224
+ d("path", {
225
+ fill: "currentColor",
226
+ d: "M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"
227
+ })
228
+ ]));
229
+ }
230
+ }), hl = yl, bl = /* @__PURE__ */ ee({
231
+ name: "Search",
232
+ __name: "search",
233
+ setup(e) {
234
+ return (y, i) => (l(), u("svg", {
235
+ xmlns: "http://www.w3.org/2000/svg",
236
+ viewBox: "0 0 1024 1024"
237
+ }, [
238
+ d("path", {
239
+ fill: "currentColor",
240
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"
241
+ })
242
+ ]));
243
+ }
244
+ }), Bt = bl, wl = /* @__PURE__ */ ee({
245
+ name: "Select",
246
+ __name: "select",
247
+ setup(e) {
248
+ return (y, i) => (l(), u("svg", {
249
+ xmlns: "http://www.w3.org/2000/svg",
250
+ viewBox: "0 0 1024 1024"
251
+ }, [
252
+ d("path", {
253
+ fill: "currentColor",
254
+ d: "M77.248 415.04a64 64 0 0 1 90.496 0l226.304 226.304L846.528 188.8a64 64 0 1 1 90.56 90.496l-543.04 543.04-316.8-316.8a64 64 0 0 1 0-90.496"
255
+ })
256
+ ]));
257
+ }
258
+ }), xl = wl, kl = /* @__PURE__ */ ee({
259
+ name: "Setting",
260
+ __name: "setting",
261
+ setup(e) {
262
+ return (y, i) => (l(), u("svg", {
263
+ xmlns: "http://www.w3.org/2000/svg",
264
+ viewBox: "0 0 1024 1024"
265
+ }, [
266
+ d("path", {
267
+ fill: "currentColor",
268
+ d: "M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"
269
+ })
270
+ ]));
271
+ }
272
+ }), Cl = kl, Sl = /* @__PURE__ */ ee({
273
+ name: "UploadFilled",
274
+ __name: "upload-filled",
275
+ setup(e) {
276
+ return (y, i) => (l(), u("svg", {
277
+ xmlns: "http://www.w3.org/2000/svg",
278
+ viewBox: "0 0 1024 1024"
279
+ }, [
280
+ d("path", {
281
+ fill: "currentColor",
282
+ d: "M544 864V672h128L512 480 352 672h128v192H320v-1.6c-5.376.32-10.496 1.6-16 1.6A240 240 0 0 1 64 624c0-123.136 93.12-223.488 212.608-237.248A239.81 239.81 0 0 1 512 192a239.87 239.87 0 0 1 235.456 194.752c119.488 13.76 212.48 114.112 212.48 237.248a240 240 0 0 1-240 240c-5.376 0-10.56-1.28-16-1.6v1.6z"
283
+ })
284
+ ]));
285
+ }
286
+ }), Vl = Sl, Al = /* @__PURE__ */ ee({
287
+ name: "User",
288
+ __name: "user",
289
+ setup(e) {
290
+ return (y, i) => (l(), u("svg", {
291
+ xmlns: "http://www.w3.org/2000/svg",
292
+ viewBox: "0 0 1024 1024"
293
+ }, [
294
+ d("path", {
295
+ fill: "currentColor",
296
+ d: "M512 512a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m320 320v-96a96 96 0 0 0-96-96H288a96 96 0 0 0-96 96v96a32 32 0 1 1-64 0v-96a160 160 0 0 1 160-160h448a160 160 0 0 1 160 160v96a32 32 0 1 1-64 0"
297
+ })
298
+ ]));
299
+ }
300
+ }), kt = Al, $l = /* @__PURE__ */ ee({
301
+ name: "ZoomIn",
302
+ __name: "zoom-in",
303
+ setup(e) {
304
+ return (y, i) => (l(), u("svg", {
305
+ xmlns: "http://www.w3.org/2000/svg",
306
+ viewBox: "0 0 1024 1024"
307
+ }, [
308
+ d("path", {
309
+ fill: "currentColor",
310
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704m-32-384v-96a32 32 0 0 1 64 0v96h96a32 32 0 0 1 0 64h-96v96a32 32 0 0 1-64 0v-96h-96a32 32 0 0 1 0-64z"
311
+ })
312
+ ]));
313
+ }
314
+ }), Tl = $l, El = /* @__PURE__ */ ee({
315
+ name: "ZoomOut",
316
+ __name: "zoom-out",
317
+ setup(e) {
318
+ return (y, i) => (l(), u("svg", {
319
+ xmlns: "http://www.w3.org/2000/svg",
320
+ viewBox: "0 0 1024 1024"
321
+ }, [
322
+ d("path", {
323
+ fill: "currentColor",
324
+ d: "m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704M352 448h256a32 32 0 0 1 0 64H352a32 32 0 0 1 0-64"
325
+ })
326
+ ]));
327
+ }
328
+ }), Bl = El;
329
+ const Ll = ["aria-disabled"], Ml = ["disabled", "aria-pressed", "onClick"], Kl = { class: "wui-checkbox__label" }, Nl = {
330
+ class: "wui-checkbox__indicator",
331
+ "aria-hidden": "true"
332
+ }, Pl = /* @__PURE__ */ ee({
333
+ name: "Checkbox",
334
+ __name: "index",
335
+ props: {
336
+ data: { default: () => [] },
337
+ modelValue: { default: () => [] },
338
+ disabled: { type: Boolean, default: !1 }
339
+ },
340
+ emits: ["update:modelValue"],
341
+ setup(e, { emit: y }) {
342
+ const i = e, t = y, o = k(() => i.modelValue);
343
+ function a(v) {
344
+ if (i.disabled)
345
+ return;
346
+ const S = [...i.modelValue], b = S.indexOf(v.value);
347
+ b >= 0 ? S.splice(b, 1) : S.push(v.value), t("update:modelValue", S);
348
+ }
349
+ return (v, S) => {
350
+ const b = j("el-icon");
351
+ return l(), u("div", {
352
+ class: "wui-checkbox",
353
+ "aria-disabled": e.disabled
354
+ }, [
355
+ (l(!0), u(ye, null, Se(e.data, (z) => (l(), u("button", {
356
+ key: z.value,
357
+ type: "button",
358
+ class: we([
359
+ "wui-checkbox__item",
360
+ {
361
+ "is-checked": o.value.includes(z.value),
362
+ "is-disabled": e.disabled
363
+ }
364
+ ]),
365
+ disabled: e.disabled,
366
+ "aria-pressed": o.value.includes(z.value),
367
+ onClick: (G) => a(z)
368
+ }, [
369
+ d("span", Kl, I(z.label), 1),
370
+ d("span", Nl, [
371
+ T(b, { size: 12 }, {
372
+ default: C(() => [
373
+ T(q(_t))
374
+ ]),
375
+ _: 1
376
+ })
377
+ ])
378
+ ], 10, Ml))), 128))
379
+ ], 8, Ll);
380
+ };
381
+ }
382
+ }), Ae = (e, y) => {
383
+ const i = e.__vccOpts || e;
384
+ for (const [t, o] of y)
385
+ i[t] = o;
386
+ return i;
387
+ }, Lt = /* @__PURE__ */ Ae(Pl, [["__scopeId", "data-v-9fb203e3"]]), Il = xe(Lt, "Checkbox"), di = xe(Lt, "YyCheckbox"), zl = ["type", "disabled", "aria-busy"], Rl = {
388
+ key: 0,
389
+ class: "wui-button__spinner",
390
+ "aria-hidden": "true"
391
+ }, Ul = /* @__PURE__ */ ee({
392
+ name: "Button",
393
+ __name: "index",
394
+ props: {
395
+ type: { default: "primary" },
396
+ size: { default: "medium" },
397
+ disabled: { type: Boolean, default: !1 },
398
+ loading: { type: Boolean, default: !1 },
399
+ nativeType: { default: "button" }
400
+ },
401
+ emits: ["click"],
402
+ setup(e, { emit: y }) {
403
+ const i = y;
404
+ function t(o) {
405
+ i("click", o);
406
+ }
407
+ return (o, a) => (l(), u("button", {
408
+ class: we(["wui-button", [`wui-button--${e.type}`, `wui-button--${e.size}`]]),
409
+ type: e.nativeType,
410
+ disabled: e.disabled || e.loading,
411
+ "aria-busy": e.loading,
412
+ onClick: t
413
+ }, [
414
+ e.loading ? (l(), u("span", Rl)) : N("", !0),
415
+ Ce(o.$slots, "default", {}, () => [
416
+ Ve(I(e.loading ? "处理中" : "按钮"), 1)
417
+ ], !0)
418
+ ], 10, zl));
419
+ }
420
+ }), Fl = /* @__PURE__ */ Ae(Ul, [["__scopeId", "data-v-b1dd8b3e"]]), Ol = xe(Fl, "Button"), Dl = { class: "wui-cat-image" }, jl = { class: "wui-cat-image__toolbar" }, Hl = ["src", "alt"], Ql = {
421
+ key: 0,
422
+ class: "wui-cat-image__navigation"
423
+ }, ql = /* @__PURE__ */ ee({
424
+ name: "CatImage",
425
+ __name: "index",
426
+ props: {
427
+ modelValue: { type: Boolean },
428
+ files: { default: () => [] },
429
+ fileImgList: { default: () => [] },
430
+ imgIndex: { default: 0 },
431
+ modal: { type: Boolean },
432
+ visible: { type: Boolean },
433
+ previewUrl: { default: "" },
434
+ previewUrlResolver: {},
435
+ title: { default: "图片预览" },
436
+ showTrigger: { type: Boolean, default: !0 }
437
+ },
438
+ emits: ["update:modelValue", "update:imgIndex", "change", "cancel"],
439
+ setup(e, { expose: y, emit: i }) {
440
+ const t = e, o = i, a = K(null), v = ot(), S = K(!1), b = K(ie("modelValue")), z = K(ie("modal")), G = K(ie("visible")), h = K(0), g = K(!1), L = K(1), P = K(0), B = K(0), J = K(0), ne = K(!1);
441
+ let R, D = 0, A = 0, s = 0, n = 0;
442
+ const f = k(() => t.files.length ? t.files : t.fileImgList), p = k(
443
+ () => b.value ? !!t.modelValue : S.value
444
+ ), x = k(() => z.value ? !!t.modal : G.value ? !!t.visible : !0), W = k(() => f.value[h.value]), Y = k(() => {
445
+ var F;
446
+ return String(((F = W.value) == null ? void 0 : F.name) ?? "");
447
+ }), _ = k(() => Le(W.value, h.value)), H = k(() => ({
448
+ transform: `translate(${B.value}px, ${J.value}px) scale(${L.value}) rotate(${P.value}deg)`
449
+ }));
450
+ function ie(F) {
451
+ const oe = v == null ? void 0 : v.vnode.props;
452
+ if (!oe)
453
+ return !1;
454
+ const ve = F.replace(/[A-Z]/g, ($e) => `-${$e.toLowerCase()}`);
455
+ return Object.prototype.hasOwnProperty.call(oe, F) || Object.prototype.hasOwnProperty.call(oe, ve);
456
+ }
457
+ function ce() {
458
+ b.value = ie("modelValue"), z.value = ie("modal"), G.value = ie("visible");
459
+ }
460
+ function me(F) {
461
+ b.value || (S.value = F), o("update:modelValue", F);
462
+ }
463
+ function be(F) {
464
+ return Math.min(Math.max(0, F), Math.max(0, f.value.length - 1));
465
+ }
466
+ function Le(F, oe) {
467
+ var $e;
468
+ return F ? (($e = t.previewUrlResolver) == null ? void 0 : $e.call(t, F, oe)) || t.previewUrl || (typeof F.url == "string" ? F.url : "") : "";
469
+ }
470
+ function Te() {
471
+ L.value = 1, P.value = 0, B.value = 0, J.value = 0;
472
+ }
473
+ function Ne(F = t.imgIndex) {
474
+ f.value.length && (h.value = be(F), Te(), o("update:imgIndex", h.value), me(!0));
475
+ }
476
+ function Be() {
477
+ g.value = !1, ne.value = !1, me(!1), o("cancel");
478
+ }
479
+ function E(F) {
480
+ F || Be();
481
+ }
482
+ function $(F) {
483
+ const oe = be(F);
484
+ if (oe === h.value)
485
+ return;
486
+ h.value = oe, Te(), o("update:imgIndex", oe);
487
+ const ve = W.value;
488
+ ve && o("change", ve, oe);
489
+ }
490
+ function X() {
491
+ L.value = Math.min(4, Number((L.value + 0.1).toFixed(2)));
492
+ }
493
+ function O() {
494
+ L.value = Math.max(0.1, Number((L.value - 0.1).toFixed(2)));
495
+ }
496
+ function se() {
497
+ P.value -= 90;
498
+ }
499
+ function ue() {
500
+ P.value += 90;
501
+ }
502
+ function Z(F) {
503
+ F.deltaY < 0 ? X() : O();
504
+ }
505
+ function Pe(F) {
506
+ var oe;
507
+ !_.value || F.button !== 0 || (R = F.pointerId, D = F.clientX, A = F.clientY, s = B.value, n = J.value, ne.value = !0, (oe = a.value) == null || oe.setPointerCapture(F.pointerId));
508
+ }
509
+ function Re(F) {
510
+ !ne.value || F.pointerId !== R || (B.value = s + F.clientX - D, J.value = n + F.clientY - A);
511
+ }
512
+ function Ie(F) {
513
+ var oe;
514
+ F.pointerId === R && ((oe = a.value) != null && oe.hasPointerCapture(F.pointerId) && a.value.releasePointerCapture(F.pointerId), ne.value = !1, R = void 0);
515
+ }
516
+ return ft(() => {
517
+ ce();
518
+ }), he(
519
+ p,
520
+ (F) => {
521
+ F && (h.value = be(t.imgIndex), g.value = !1, Te());
522
+ },
523
+ { immediate: !0 }
524
+ ), he(
525
+ () => t.imgIndex,
526
+ (F) => {
527
+ p.value && $(F);
528
+ }
529
+ ), he(
530
+ f,
531
+ () => {
532
+ const F = be(h.value);
533
+ F !== h.value && (h.value = F, o("update:imgIndex", F)), p.value && Te();
534
+ },
535
+ { deep: !0 }
536
+ ), y({ open: Ne, close: Be, reset: Te, changeImage: $ }), (F, oe) => {
537
+ const ve = j("el-button"), $e = j("el-empty"), je = j("el-dialog");
538
+ return l(), u("div", Dl, [
539
+ F.$slots.default ? Ce(F.$slots, "default", {
540
+ key: 0,
541
+ open: Ne,
542
+ files: f.value,
543
+ activeFile: W.value,
544
+ visible: p.value
545
+ }, void 0, !0) : e.showTrigger ? (l(), le(ve, {
546
+ key: 1,
547
+ link: "",
548
+ type: "primary",
549
+ disabled: !f.value.length,
550
+ onClick: oe[0] || (oe[0] = (m) => Ne())
551
+ }, {
552
+ default: C(() => [...oe[4] || (oe[4] = [
553
+ Ve(" 预览图片 ", -1)
554
+ ])]),
555
+ _: 1
556
+ }, 8, ["disabled"])) : N("", !0),
557
+ T(je, {
558
+ "model-value": p.value,
559
+ fullscreen: g.value,
560
+ modal: x.value,
561
+ title: Y.value || e.title,
562
+ width: "min(1080px, 92vw)",
563
+ "append-to-body": "",
564
+ class: "wui-cat-image__dialog",
565
+ "onUpdate:modelValue": E
566
+ }, {
567
+ default: C(() => [
568
+ d("div", jl, [
569
+ T(ve, {
570
+ circle: "",
571
+ text: "",
572
+ "aria-label": "缩小",
573
+ onClick: O
574
+ }, {
575
+ default: C(() => [
576
+ T(q(Bl), { class: "wui-cat-image__tool-icon" })
577
+ ]),
578
+ _: 1
579
+ }),
580
+ T(ve, {
581
+ circle: "",
582
+ text: "",
583
+ "aria-label": "放大",
584
+ onClick: X
585
+ }, {
586
+ default: C(() => [
587
+ T(q(Tl), { class: "wui-cat-image__tool-icon" })
588
+ ]),
589
+ _: 1
590
+ }),
591
+ T(ve, {
592
+ circle: "",
593
+ text: "",
594
+ "aria-label": "向左旋转",
595
+ onClick: se
596
+ }, {
597
+ default: C(() => [
598
+ T(q(_l), { class: "wui-cat-image__tool-icon" })
599
+ ]),
600
+ _: 1
601
+ }),
602
+ T(ve, {
603
+ circle: "",
604
+ text: "",
605
+ "aria-label": "向右旋转",
606
+ onClick: ue
607
+ }, {
608
+ default: C(() => [
609
+ T(q(Et), { class: "wui-cat-image__tool-icon" })
610
+ ]),
611
+ _: 1
612
+ }),
613
+ T(ve, {
614
+ circle: "",
615
+ text: "",
616
+ "aria-label": "恢复原始大小",
617
+ onClick: Te
618
+ }, {
619
+ default: C(() => [
620
+ T(q(hl), { class: "wui-cat-image__tool-icon" })
621
+ ]),
622
+ _: 1
623
+ }),
624
+ T(ve, {
625
+ circle: "",
626
+ text: "",
627
+ "aria-label": g.value ? "退出全屏" : "全屏",
628
+ onClick: oe[1] || (oe[1] = (m) => g.value = !g.value)
629
+ }, {
630
+ default: C(() => [
631
+ T(q(dl), { class: "wui-cat-image__tool-icon" })
632
+ ]),
633
+ _: 1
634
+ }, 8, ["aria-label"])
635
+ ]),
636
+ d("div", {
637
+ ref_key: "viewportRef",
638
+ ref: a,
639
+ class: we(["wui-cat-image__viewport", { "is-dragging": ne.value }]),
640
+ onPointerdown: Pe,
641
+ onPointermove: Re,
642
+ onPointerup: Ie,
643
+ onPointercancel: Ie,
644
+ onWheel: ze(Z, ["prevent"])
645
+ }, [
646
+ _.value ? (l(), u("img", {
647
+ key: 0,
648
+ class: "wui-cat-image__image",
649
+ src: _.value,
650
+ alt: Y.value,
651
+ style: Qe(H.value),
652
+ draggable: "false"
653
+ }, null, 12, Hl)) : (l(), le($e, {
654
+ key: 1,
655
+ description: "暂无可预览的图片"
656
+ }))
657
+ ], 34),
658
+ f.value.length > 1 ? (l(), u("div", Ql, [
659
+ T(ve, {
660
+ disabled: h.value <= 0,
661
+ onClick: oe[2] || (oe[2] = (m) => $(h.value - 1))
662
+ }, {
663
+ default: C(() => [
664
+ T(q(Zt), { class: "wui-cat-image__button-icon" }),
665
+ oe[5] || (oe[5] = Ve("上一张 ", -1))
666
+ ]),
667
+ _: 1
668
+ }, 8, ["disabled"]),
669
+ d("span", null, I(h.value + 1) + " / " + I(f.value.length), 1),
670
+ T(ve, {
671
+ disabled: h.value >= f.value.length - 1,
672
+ onClick: oe[3] || (oe[3] = (m) => $(h.value + 1))
673
+ }, {
674
+ default: C(() => [
675
+ oe[6] || (oe[6] = Ve(" 下一张", -1)),
676
+ T(q(tl), { class: "wui-cat-image__button-icon" })
677
+ ]),
678
+ _: 1
679
+ }, 8, ["disabled"])
680
+ ])) : N("", !0)
681
+ ]),
682
+ _: 1
683
+ }, 8, ["model-value", "fullscreen", "modal", "title"])
684
+ ]);
685
+ };
686
+ }
687
+ }), Gl = /* @__PURE__ */ Ae(ql, [["__scopeId", "data-v-98a1fd7f"]]), Mt = xe(Gl, "CatImage"), Xl = ["disabled", "title"], Wl = {
688
+ key: 0,
689
+ class: "wui-copy-text__icon",
690
+ "aria-hidden": "true"
691
+ }, Jl = {
692
+ key: 1,
693
+ class: "wui-copy-text__label"
694
+ }, Yl = /* @__PURE__ */ ee({
695
+ name: "CopyText",
696
+ __name: "index",
697
+ props: {
698
+ text: { default: "" },
699
+ label: { default: "复制" },
700
+ successText: { default: "已复制" },
701
+ title: { default: "" },
702
+ trigger: { default: "button" },
703
+ disabled: { type: Boolean, default: !1 },
704
+ resetDelay: { default: 1600 }
705
+ },
706
+ emits: ["success", "error"],
707
+ setup(e, { expose: y, emit: i }) {
708
+ const t = e, o = i, a = K(!1);
709
+ let v;
710
+ const S = k(() => String(t.text ?? ""));
711
+ async function b(g) {
712
+ var L;
713
+ if (!((L = navigator.clipboard) != null && L.writeText))
714
+ throw new Error("Clipboard API is unavailable");
715
+ return await navigator.clipboard.writeText(g), "clipboard";
716
+ }
717
+ function z(g) {
718
+ const L = document.createElement("textarea");
719
+ L.value = g, L.setAttribute("readonly", "readonly"), L.style.position = "fixed", L.style.left = "-9999px", L.style.top = "0", document.body.appendChild(L), L.select();
720
+ const P = document.execCommand("copy");
721
+ if (document.body.removeChild(L), !P)
722
+ throw new Error("Fallback copy failed");
723
+ return "fallback";
724
+ }
725
+ function G() {
726
+ a.value = !0, window.clearTimeout(v), v = window.setTimeout(() => {
727
+ a.value = !1;
728
+ }, Math.max(0, t.resetDelay));
729
+ }
730
+ async function h() {
731
+ if (t.disabled)
732
+ return;
733
+ const g = S.value;
734
+ try {
735
+ let L;
736
+ try {
737
+ L = await b(g);
738
+ } catch {
739
+ L = z(g);
740
+ }
741
+ G(), o("success", { text: g, source: L });
742
+ } catch (L) {
743
+ o("error", L);
744
+ }
745
+ }
746
+ return pt(() => {
747
+ window.clearTimeout(v);
748
+ }), y({ copy: h }), (g, L) => (l(), u("button", {
749
+ class: we(["wui-copy-text", [
750
+ `wui-copy-text--${e.trigger}`,
751
+ {
752
+ "is-copied": a.value,
753
+ "is-disabled": e.disabled
754
+ }
755
+ ]]),
756
+ type: "button",
757
+ disabled: e.disabled,
758
+ title: e.title || S.value,
759
+ onClick: h
760
+ }, [
761
+ Ce(g.$slots, "default", {
762
+ copied: a.value,
763
+ copy: h,
764
+ text: S.value
765
+ }, () => [
766
+ e.trigger === "icon" ? (l(), u("span", Wl, I(a.value ? "✓" : "⧉"), 1)) : (l(), u("span", Jl, I(a.value ? e.successText : e.label), 1))
767
+ ], !0)
768
+ ], 10, Xl));
769
+ }
770
+ }), Zl = /* @__PURE__ */ Ae(Yl, [["__scopeId", "data-v-2791f53b"]]), ea = xe(Zl, "CopyText"), ta = { class: "custom-table" }, la = {
771
+ key: 0,
772
+ class: "custom-table__toolbar"
773
+ }, aa = { class: "custom-table__toolbar-start" }, na = { class: "custom-table__toolbar-end" }, oa = {
774
+ key: 1,
775
+ class: "custom-table__error",
776
+ role: "alert"
777
+ }, ia = { class: "custom-table__surface" }, sa = /* @__PURE__ */ ee({
778
+ name: "CustomTable",
779
+ inheritAttrs: !1,
780
+ __name: "index",
781
+ props: {
782
+ columns: {},
783
+ rows: {},
784
+ loader: { type: Function },
785
+ filters: {},
786
+ page: {},
787
+ pageSize: {},
788
+ pagination: { type: Boolean },
789
+ pageSizes: {},
790
+ visibleColumnKeys: {},
791
+ showRefresh: { type: Boolean },
792
+ showColumnSettings: { type: Boolean },
793
+ columnPersistenceKey: {},
794
+ storageAdapter: {},
795
+ autoLoad: { type: Boolean },
796
+ exporter: { type: Function },
797
+ rowKey: { type: [String, Function] },
798
+ emptyText: {}
799
+ },
800
+ emits: ["update:filters", "update:page", "update:pageSize", "update:visibleColumnKeys", "sort-change", "reload", "load-success", "load-error", "export-error", "persistence-error"],
801
+ setup(e, { expose: y, emit: i }) {
802
+ const t = [10, 20, 50, 100], o = e, a = i, v = ot(), S = K(ve("pagination")), b = K(ve("showRefresh")), z = K(ve("showColumnSettings")), G = K(ve("autoLoad")), h = Ct(), g = K(null), L = Dt([]), P = K(0), B = K(!1), J = K(!1), ne = K(null), R = K(o.filters ?? {}), D = K($e(o.page, 1)), A = K($e(o.pageSize, t[0])), s = K([]), n = K({ key: null, order: null });
803
+ let f, p = 0, x = !1, W = !1, Y = /* @__PURE__ */ new Set(), _ = !1, H = Promise.resolve();
804
+ const ie = k(() => {
805
+ const c = /* @__PURE__ */ new Set();
806
+ return o.columns.map((w, Q) => {
807
+ const te = w.key || w.prop || `column-${Q}`, _e = c.has(te) ? `${te}-${Q}` : te;
808
+ return c.add(_e), { ...w, key: _e, sourceIndex: Q };
809
+ });
810
+ }), ce = k(() => o.filters ?? R.value), me = k(
811
+ () => o.page === void 0 ? D.value : $e(o.page, 1)
812
+ ), be = k(
813
+ () => o.pageSize === void 0 ? A.value : $e(o.pageSize, t[0])
814
+ ), Le = k(
815
+ () => S.value ? o.pagination : !0
816
+ ), Te = k(() => {
817
+ const c = (o.pageSizes ?? t).filter((w) => w > 0);
818
+ return c.length ? c : [...t];
819
+ }), Ne = k(() => o.emptyText ?? "暂无数据"), Be = k(() => !!o.loader), E = k(
820
+ () => b.value ? o.showRefresh : !0
821
+ ), $ = k(
822
+ () => z.value ? o.showColumnSettings : !0
823
+ );
824
+ he(
825
+ ie,
826
+ (c) => {
827
+ const w = new Set(c.map((ge) => ge.key)), Q = c.filter((ge) => ge.visible !== !1).map((ge) => ge.key);
828
+ if (!W) {
829
+ s.value = Q, W = !0, Y = w;
830
+ return;
831
+ }
832
+ const te = s.value.filter((ge) => w.has(ge)), _e = new Set(te);
833
+ c.forEach((ge) => {
834
+ !Y.has(ge.key) && ge.visible !== !1 && !_e.has(ge.key) && te.push(ge.key);
835
+ }), s.value = te, Y = w;
836
+ },
837
+ { immediate: !0 }
838
+ );
839
+ const X = k(() => {
840
+ const c = o.visibleColumnKeys ?? s.value;
841
+ return m(c);
842
+ }), O = k(() => {
843
+ const c = new Set(X.value);
844
+ return ie.value.filter((w) => c.has(w.key));
845
+ }), se = k(
846
+ () => ie.value.filter((c) => je(c))
847
+ ), ue = k({
848
+ get: () => {
849
+ const c = new Set(X.value);
850
+ return se.value.filter((w) => c.has(w.key)).map((w) => w.key);
851
+ },
852
+ set: (c) => {
853
+ const w = ie.value.filter((Q) => !je(Q)).filter((Q) => X.value.includes(Q.key)).map((Q) => Q.key);
854
+ Me([...w, ...c]);
855
+ }
856
+ }), Z = k(() => o.rows ?? []), Pe = k(() => {
857
+ const c = Z.value.map((_e, ge) => ({ row: _e, index: ge })), w = n.value;
858
+ if (!w.key || !w.order)
859
+ return c.map(({ row: _e }) => _e);
860
+ const Q = ie.value.find((_e) => _e.key === w.key);
861
+ if (!Q)
862
+ return c.map(({ row: _e }) => _e);
863
+ const te = w.order === "ascending" ? 1 : -1;
864
+ return c.sort((_e, ge) => (Q.sortMethod ? Q.sortMethod(_e.row, ge.row) : r(
865
+ Fe(_e.row, Q, _e.index),
866
+ Fe(ge.row, Q, ge.index)
867
+ )) * te).map(({ row: _e }) => _e);
868
+ }), Re = k(() => {
869
+ if (Be.value)
870
+ return L.value;
871
+ if (!Le.value)
872
+ return Pe.value;
873
+ const c = (me.value - 1) * be.value;
874
+ return Pe.value.slice(c, c + be.value);
875
+ }), Ie = k(
876
+ () => Be.value ? P.value : Z.value.length
877
+ ), F = k(
878
+ () => !!(h.toolbar || h["toolbar-left"] || h["toolbar-right"] || E.value || o.exporter || $.value && se.value.length)
879
+ ), oe = k(() => ({
880
+ filters: ce.value,
881
+ page: me.value,
882
+ pageSize: be.value,
883
+ visibleColumnKeys: X.value,
884
+ loading: B.value,
885
+ exporting: J.value,
886
+ reload: U,
887
+ setFilters: pe,
888
+ setVisibleColumnKeys: Me,
889
+ exportRows: Ee
890
+ }));
891
+ he(
892
+ () => o.filters,
893
+ (c) => {
894
+ c !== void 0 && (R.value = c);
895
+ },
896
+ { deep: !0 }
897
+ ), he(
898
+ () => o.page,
899
+ (c) => {
900
+ c !== void 0 && (D.value = $e(c, 1));
901
+ }
902
+ ), he(
903
+ () => o.pageSize,
904
+ (c) => {
905
+ c !== void 0 && (A.value = $e(c, t[0]));
906
+ }
907
+ ), he(
908
+ ce,
909
+ () => {
910
+ if (!(!x || !Be.value)) {
911
+ if (me.value !== 1) {
912
+ M(1);
913
+ return;
914
+ }
915
+ U();
916
+ }
917
+ },
918
+ { deep: !0 }
919
+ ), he(me, () => {
920
+ x && Be.value && U();
921
+ }), he(be, () => {
922
+ if (!(!x || !Be.value)) {
923
+ if (me.value !== 1) {
924
+ M(1);
925
+ return;
926
+ }
927
+ U();
928
+ }
929
+ }), he(
930
+ () => o.loader,
931
+ (c, w) => {
932
+ if (!c) {
933
+ f == null || f.abort();
934
+ return;
935
+ }
936
+ x && c !== w && U();
937
+ }
938
+ ), he(
939
+ X,
940
+ (c) => {
941
+ Ge(c);
942
+ },
943
+ { deep: !0 }
944
+ ), St(async () => {
945
+ x = !0, await Ke(), Be.value && (!G.value || o.autoLoad) && await U();
946
+ }), ft(() => {
947
+ S.value = ve("pagination"), b.value = ve("showRefresh"), z.value = ve("showColumnSettings"), G.value = ve("autoLoad");
948
+ });
949
+ function ve(c) {
950
+ const w = v == null ? void 0 : v.vnode.props;
951
+ if (!w)
952
+ return !1;
953
+ const Q = c.replace(/[A-Z]/g, (te) => `-${te.toLowerCase()}`);
954
+ return Object.prototype.hasOwnProperty.call(w, c) || Object.prototype.hasOwnProperty.call(w, Q);
955
+ }
956
+ pt(() => {
957
+ p += 1, f == null || f.abort();
958
+ });
959
+ function $e(c, w) {
960
+ return !Number.isFinite(c) || !c || c < 1 ? w : Math.floor(c);
961
+ }
962
+ function je(c) {
963
+ return c.hideable !== void 0 ? c.hideable : c.type === void 0 || c.type === "default";
964
+ }
965
+ function m(c) {
966
+ const w = new Set(ie.value.map((te) => te.key)), Q = [];
967
+ return c.forEach((te) => {
968
+ w.has(te) && !Q.includes(te) && Q.push(te);
969
+ }), Q;
970
+ }
971
+ function M(c) {
972
+ const w = $e(c, 1);
973
+ o.page === void 0 && (D.value = w), a("update:page", w);
974
+ }
975
+ function re(c) {
976
+ const w = $e(c, t[0]);
977
+ o.pageSize === void 0 && (A.value = w), a("update:pageSize", w), M(1);
978
+ }
979
+ function pe(c) {
980
+ o.filters === void 0 && (R.value = c), a("update:filters", c), me.value !== 1 && M(1);
981
+ }
982
+ function Me(c) {
983
+ const w = m(c);
984
+ o.visibleColumnKeys === void 0 && (s.value = w), a("update:visibleColumnKeys", w);
985
+ }
986
+ function Ue(c) {
987
+ return c.cellSlot ?? c.slot ?? `cell:${c.key}`;
988
+ }
989
+ function We(c) {
990
+ return c.headerSlot ?? c.header ?? `header:${c.key}`;
991
+ }
992
+ function Fe(c, w, Q) {
993
+ return w.value ? w.value(c, Q) : w.prop ? Oe(c, w.prop) : void 0;
994
+ }
995
+ function Oe(c, w) {
996
+ return w.split(".").reduce((Q, te) => {
997
+ if (Q !== null && typeof Q == "object" && te in Q)
998
+ return Q[te];
999
+ }, c);
1000
+ }
1001
+ function ke(c, w, Q) {
1002
+ var ge;
1003
+ const te = Fe(c, w, Q), _e = (ge = w.formatter) == null ? void 0 : ge.call(w, { row: c, column: w, index: Q, value: te });
1004
+ return tt(_e ?? te);
1005
+ }
1006
+ function tt(c) {
1007
+ return c == null || c === "" ? "-" : c instanceof Date ? c.toLocaleString() : typeof c == "object" ? JSON.stringify(c) : String(c);
1008
+ }
1009
+ function r(c, w) {
1010
+ return c === w ? 0 : c == null ? -1 : w == null ? 1 : typeof c == "number" && typeof w == "number" ? c - w : String(c).localeCompare(String(w), void 0, {
1011
+ numeric: !0,
1012
+ sensitivity: "base"
1013
+ });
1014
+ }
1015
+ function V(c) {
1016
+ const w = ie.value.find(
1017
+ (Q) => Q.prop === c.prop || Q.key === c.prop
1018
+ );
1019
+ n.value = {
1020
+ key: (w == null ? void 0 : w.key) ?? null,
1021
+ order: c.order
1022
+ }, a("sort-change", { ...n.value }), Be.value && U();
1023
+ }
1024
+ async function U() {
1025
+ a("reload");
1026
+ const c = o.loader;
1027
+ if (!c)
1028
+ return;
1029
+ f == null || f.abort();
1030
+ const w = new AbortController(), Q = ++p;
1031
+ f = w, B.value = !0, ne.value = null;
1032
+ try {
1033
+ const te = await c({
1034
+ filters: ce.value,
1035
+ page: me.value,
1036
+ pageSize: be.value,
1037
+ sort: { ...n.value },
1038
+ signal: w.signal
1039
+ });
1040
+ if (w.signal.aborted || Q !== p)
1041
+ return;
1042
+ const _e = Number.isFinite(te.total) ? Math.max(0, te.total) : te.rows.length, ge = {
1043
+ rows: [...te.rows],
1044
+ total: _e
1045
+ };
1046
+ L.value = [...ge.rows], P.value = ge.total, a("load-success", ge);
1047
+ } catch (te) {
1048
+ if (w.signal.aborted || Q !== p || Je(te))
1049
+ return;
1050
+ ne.value = it(te), a("load-error", te);
1051
+ } finally {
1052
+ Q === p && (B.value = !1, f = void 0);
1053
+ }
1054
+ }
1055
+ function ae() {
1056
+ var c;
1057
+ (c = g.value) == null || c.clearSelection();
1058
+ }
1059
+ function de() {
1060
+ return g.value;
1061
+ }
1062
+ async function Ee() {
1063
+ const c = o.exporter;
1064
+ if (!(!c || J.value)) {
1065
+ J.value = !0;
1066
+ try {
1067
+ const w = {
1068
+ rows: [...Re.value],
1069
+ columns: [...O.value],
1070
+ filters: ce.value,
1071
+ page: me.value,
1072
+ pageSize: be.value,
1073
+ total: Ie.value,
1074
+ sort: { ...n.value }
1075
+ };
1076
+ await c(w);
1077
+ } catch (w) {
1078
+ a("export-error", w);
1079
+ } finally {
1080
+ J.value = !1;
1081
+ }
1082
+ }
1083
+ }
1084
+ async function Ke() {
1085
+ const c = o.storageAdapter, w = o.columnPersistenceKey;
1086
+ if (!c || !w || o.visibleColumnKeys !== void 0) {
1087
+ _ = !0;
1088
+ return;
1089
+ }
1090
+ try {
1091
+ const Q = await c.getItem(w);
1092
+ if (Q) {
1093
+ const te = JSON.parse(Q);
1094
+ Array.isArray(te) && te.every((_e) => typeof _e == "string") && (s.value = m(te), a("update:visibleColumnKeys", s.value));
1095
+ }
1096
+ } catch (Q) {
1097
+ a("persistence-error", Q);
1098
+ } finally {
1099
+ _ = !0;
1100
+ }
1101
+ }
1102
+ function Ge(c) {
1103
+ const w = o.storageAdapter, Q = o.columnPersistenceKey;
1104
+ if (!_ || !w || !Q)
1105
+ return;
1106
+ const te = JSON.stringify(c);
1107
+ H = H.then(() => w.setItem(Q, te)).catch((_e) => {
1108
+ a("persistence-error", _e);
1109
+ });
1110
+ }
1111
+ function Je(c) {
1112
+ return c instanceof Error && c.name === "AbortError";
1113
+ }
1114
+ function it(c) {
1115
+ return c instanceof Error && c.message ? c.message : typeof c == "string" && c ? c : "加载失败,请稍后重试。";
1116
+ }
1117
+ return y({
1118
+ reload: U,
1119
+ clearSelection: ae,
1120
+ setFilters: pe,
1121
+ setVisibleColumnKeys: Me,
1122
+ getTableInstance: de
1123
+ }), (c, w) => {
1124
+ const Q = j("el-button"), te = j("el-tooltip"), _e = j("el-checkbox"), ge = j("el-checkbox-group"), bt = j("el-popover"), zt = j("el-table-column"), Rt = j("el-empty"), Ut = j("el-table"), Ft = j("el-pagination"), Ot = jt("loading");
1125
+ return l(), u("section", ta, [
1126
+ F.value ? (l(), u("div", la, [
1127
+ Ce(c.$slots, "toolbar", st(ut(oe.value)), () => [
1128
+ d("div", aa, [
1129
+ Ce(c.$slots, "toolbar-left", st(ut(oe.value)), void 0, !0)
1130
+ ]),
1131
+ d("div", na, [
1132
+ Ce(c.$slots, "toolbar-right", st(ut(oe.value)), void 0, !0),
1133
+ E.value ? (l(), le(te, {
1134
+ key: 0,
1135
+ content: "刷新",
1136
+ placement: "top"
1137
+ }, {
1138
+ default: C(() => [
1139
+ T(Q, {
1140
+ "aria-label": "刷新",
1141
+ circle: "",
1142
+ disabled: B.value,
1143
+ onClick: U
1144
+ }, {
1145
+ default: C(() => [
1146
+ T(q(Et), { class: "custom-table__tool-icon" })
1147
+ ]),
1148
+ _: 1
1149
+ }, 8, ["disabled"])
1150
+ ]),
1151
+ _: 1
1152
+ })) : N("", !0),
1153
+ o.exporter ? (l(), le(te, {
1154
+ key: 1,
1155
+ content: "导出",
1156
+ placement: "top"
1157
+ }, {
1158
+ default: C(() => [
1159
+ T(Q, {
1160
+ "aria-label": "导出",
1161
+ circle: "",
1162
+ loading: J.value,
1163
+ onClick: Ee
1164
+ }, {
1165
+ default: C(() => [
1166
+ T(q(ul), { class: "custom-table__tool-icon" })
1167
+ ]),
1168
+ _: 1
1169
+ }, 8, ["loading"])
1170
+ ]),
1171
+ _: 1
1172
+ })) : N("", !0),
1173
+ $.value && se.value.length ? (l(), le(bt, {
1174
+ key: 2,
1175
+ placement: "bottom-end",
1176
+ trigger: "click",
1177
+ width: "220"
1178
+ }, {
1179
+ reference: C(() => [
1180
+ T(te, {
1181
+ content: "列设置",
1182
+ placement: "top"
1183
+ }, {
1184
+ default: C(() => [
1185
+ T(Q, {
1186
+ "aria-label": "列设置",
1187
+ circle: ""
1188
+ }, {
1189
+ default: C(() => [
1190
+ T(q(Cl), { class: "custom-table__tool-icon" })
1191
+ ]),
1192
+ _: 1
1193
+ })
1194
+ ]),
1195
+ _: 1
1196
+ })
1197
+ ]),
1198
+ default: C(() => [
1199
+ T(ge, {
1200
+ modelValue: ue.value,
1201
+ "onUpdate:modelValue": w[0] || (w[0] = (fe) => ue.value = fe),
1202
+ class: "custom-table__column-settings"
1203
+ }, {
1204
+ default: C(() => [
1205
+ (l(!0), u(ye, null, Se(se.value, (fe) => (l(), le(_e, {
1206
+ key: fe.key,
1207
+ label: fe.key
1208
+ }, {
1209
+ default: C(() => [
1210
+ Ve(I(fe.label || fe.prop || fe.key), 1)
1211
+ ]),
1212
+ _: 2
1213
+ }, 1032, ["label"]))), 128))
1214
+ ]),
1215
+ _: 1
1216
+ }, 8, ["modelValue"])
1217
+ ]),
1218
+ _: 1
1219
+ })) : N("", !0)
1220
+ ])
1221
+ ], !0)
1222
+ ])) : N("", !0),
1223
+ ne.value ? (l(), u("div", oa, [
1224
+ d("span", null, I(ne.value), 1),
1225
+ T(Q, {
1226
+ link: "",
1227
+ type: "primary",
1228
+ onClick: U
1229
+ }, {
1230
+ default: C(() => [...w[1] || (w[1] = [
1231
+ Ve("重试", -1)
1232
+ ])]),
1233
+ _: 1
1234
+ })
1235
+ ])) : N("", !0),
1236
+ d("div", ia, [
1237
+ et((l(), le(Ut, Vt({
1238
+ ref_key: "tableRef",
1239
+ ref: g,
1240
+ data: Re.value,
1241
+ "row-key": o.rowKey,
1242
+ onSortChange: V
1243
+ }, c.$attrs), {
1244
+ empty: C(() => [
1245
+ T(Rt, {
1246
+ description: Ne.value,
1247
+ "image-size": 80
1248
+ }, null, 8, ["description"])
1249
+ ]),
1250
+ default: C(() => [
1251
+ (l(!0), u(ye, null, Se(O.value, (fe) => (l(), le(zt, {
1252
+ key: fe.key,
1253
+ align: fe.align,
1254
+ "class-name": fe.className,
1255
+ "column-key": fe.key,
1256
+ fixed: fe.fixed,
1257
+ "header-align": fe.headerAlign,
1258
+ label: fe.label,
1259
+ "label-class-name": fe.labelClassName,
1260
+ "min-width": fe.minWidth,
1261
+ prop: fe.prop,
1262
+ "show-overflow-tooltip": fe.showOverflowTooltip,
1263
+ sortable: fe.sortable ? "custom" : !1,
1264
+ type: fe.type,
1265
+ width: fe.width,
1266
+ index: fe.index
1267
+ }, {
1268
+ header: C(() => [
1269
+ Ce(c.$slots, We(fe), {
1270
+ column: fe,
1271
+ index: fe.sourceIndex
1272
+ }, () => [
1273
+ Ve(I(fe.label), 1)
1274
+ ], !0)
1275
+ ]),
1276
+ default: C((Xe) => [
1277
+ Ce(c.$slots, Ue(fe), {
1278
+ column: fe,
1279
+ index: Xe.$index,
1280
+ row: Xe.row,
1281
+ value: Fe(Xe.row, fe, Xe.$index)
1282
+ }, () => [
1283
+ Ve(I(ke(Xe.row, fe, Xe.$index)), 1)
1284
+ ], !0)
1285
+ ]),
1286
+ _: 2
1287
+ }, 1032, ["align", "class-name", "column-key", "fixed", "header-align", "label", "label-class-name", "min-width", "prop", "show-overflow-tooltip", "sortable", "type", "width", "index"]))), 128))
1288
+ ]),
1289
+ _: 3
1290
+ }, 16, ["data", "row-key"])), [
1291
+ [Ot, B.value]
1292
+ ])
1293
+ ]),
1294
+ Le.value ? (l(), le(Ft, {
1295
+ key: 2,
1296
+ class: "custom-table__pagination",
1297
+ background: "",
1298
+ "current-page": me.value,
1299
+ layout: "total, sizes, prev, pager, next, jumper",
1300
+ "page-size": be.value,
1301
+ "page-sizes": Te.value,
1302
+ total: Ie.value,
1303
+ onCurrentChange: M,
1304
+ onSizeChange: re
1305
+ }, null, 8, ["current-page", "page-size", "page-sizes", "total"])) : N("", !0)
1306
+ ]);
1307
+ };
1308
+ }
1309
+ }), ua = /* @__PURE__ */ Ae(sa, [["__scopeId", "data-v-324d7221"]]), ra = xe(ua, "CustomTable"), ca = {
1310
+ id: "id",
1311
+ label: "label",
1312
+ children: "children",
1313
+ type: "type",
1314
+ disabled: "disabled"
1315
+ };
1316
+ function nt(e) {
1317
+ return `${typeof e}:${String(e)}`;
1318
+ }
1319
+ function Kt(e) {
1320
+ return typeof e == "string" || typeof e == "number";
1321
+ }
1322
+ function da(e) {
1323
+ return typeof e == "object" && e !== null && !Array.isArray(e);
1324
+ }
1325
+ function Ye(e, y, i) {
1326
+ const t = y ?? ca[i];
1327
+ return typeof t == "function" ? t(e) : e[t];
1328
+ }
1329
+ function fa(e, y) {
1330
+ const i = Ye(e, y.children, "children");
1331
+ return Array.isArray(i) ? i.filter(da) : [];
1332
+ }
1333
+ function Nt(e, y) {
1334
+ const i = {
1335
+ nodes: [],
1336
+ nodeByToken: /* @__PURE__ */ new Map(),
1337
+ rootKeys: [],
1338
+ maxDepth: 0
1339
+ }, t = /* @__PURE__ */ new WeakSet(), o = (a, v, S) => {
1340
+ if (t.has(a))
1341
+ return;
1342
+ const b = Ye(a, y.id, "id");
1343
+ if (!Kt(b) || i.nodeByToken.has(nt(b)))
1344
+ return;
1345
+ const z = Ye(a, y.label, "label"), G = Ye(a, y.type, "type"), h = Ye(a, y.disabled, "disabled"), g = {
1346
+ key: b,
1347
+ label: z == null ? String(b) : String(z),
1348
+ type: typeof G == "string" ? G : void 0,
1349
+ disabled: h === !0,
1350
+ source: a,
1351
+ parentKey: v,
1352
+ childKeys: [],
1353
+ depth: S
1354
+ };
1355
+ return i.nodes.push(g), i.nodeByToken.set(nt(g.key), g), i.maxDepth = Math.max(i.maxDepth, S), t.add(a), fa(a, y).forEach((L) => {
1356
+ const P = o(L, g.key, S + 1);
1357
+ P && g.childKeys.push(P.key);
1358
+ }), t.delete(a), g;
1359
+ };
1360
+ return e.forEach((a) => {
1361
+ const v = o(a, void 0, 0);
1362
+ v && i.rootKeys.push(v.key);
1363
+ }), i;
1364
+ }
1365
+ const pa = {
1366
+ key: 1,
1367
+ class: "wui-custom-tree__nodes",
1368
+ role: "tree"
1369
+ }, ma = ["title", "onClick"], va = { class: "wui-custom-tree__node-label" }, _a = {
1370
+ key: 2,
1371
+ class: "wui-custom-tree__empty"
1372
+ }, ga = {
1373
+ key: 0,
1374
+ class: "wui-custom-tree__selected"
1375
+ }, ya = {
1376
+ key: 0,
1377
+ class: "wui-custom-tree__selected-list"
1378
+ }, ha = ["aria-label", "onClick"], ba = {
1379
+ key: 1,
1380
+ class: "wui-custom-tree__empty"
1381
+ }, wa = /* @__PURE__ */ ee({
1382
+ name: "CustomTree",
1383
+ __name: "index",
1384
+ props: {
1385
+ data: { default: () => [] },
1386
+ modelValue: { default: () => [] },
1387
+ fields: { default: () => ({}) },
1388
+ maxColumns: { default: 0 },
1389
+ selectionStrategy: { default: "parent" },
1390
+ isSelectable: {},
1391
+ disabled: { type: Boolean, default: !1 },
1392
+ searchable: { type: Boolean, default: !1 },
1393
+ searchColumns: {},
1394
+ showSelected: { type: Boolean, default: !0 },
1395
+ maxHeight: {},
1396
+ emptyText: { default: "暂无数据" }
1397
+ },
1398
+ emits: ["update:modelValue", "change"],
1399
+ setup(e, { expose: y, emit: i }) {
1400
+ const t = e, o = i, a = K(/* @__PURE__ */ new Set()), v = K([]), S = K([]), b = k(() => Nt(t.data, t.fields)), z = k(() => {
1401
+ const E = b.value.maxDepth + 1;
1402
+ return t.maxColumns > 0 ? Math.min(E, t.maxColumns) : E;
1403
+ }), G = k(() => Array.from({ length: Math.max(z.value, 1) }, (E, $) => $)), h = k(() => ({
1404
+ "--wui-custom-tree-max-height": L(t.maxHeight, "420px")
1405
+ })), g = k(() => me(a.value));
1406
+ function L(E, $) {
1407
+ return typeof E == "number" ? `${E}px` : E || $;
1408
+ }
1409
+ function P(E) {
1410
+ return nt(E);
1411
+ }
1412
+ function B(E) {
1413
+ return b.value.nodeByToken.get(P(E));
1414
+ }
1415
+ function J(E) {
1416
+ const $ = b.value.nodes.find((X) => X.source === E);
1417
+ return ($ == null ? void 0 : $.key) ?? "";
1418
+ }
1419
+ function ne(E) {
1420
+ const $ = b.value.nodes.find((X) => X.source === E);
1421
+ return ($ == null ? void 0 : $.label) ?? "";
1422
+ }
1423
+ function R(E) {
1424
+ var se, ue;
1425
+ const $ = E === 0 ? void 0 : v.value[E - 1], X = $ === void 0 ? b.value.rootKeys : ((se = B($)) == null ? void 0 : se.childKeys) ?? [], O = (ue = S.value[E]) == null ? void 0 : ue.trim().toLocaleLowerCase();
1426
+ return X.map(B).filter((Z) => Z !== void 0).filter((Z) => !O || Z.label.toLocaleLowerCase().includes(O));
1427
+ }
1428
+ function D(E) {
1429
+ return t.searchable ? t.searchColumns === void 0 ? !0 : (Array.isArray(t.searchColumns) ? t.searchColumns : [t.searchColumns]).includes(E) : !1;
1430
+ }
1431
+ function A(E, $) {
1432
+ return v.value[E] === $;
1433
+ }
1434
+ function s(E, $) {
1435
+ const X = v.value.slice(0, E);
1436
+ X[E] = $.key, v.value = X, S.value = S.value.slice(0, E + 1);
1437
+ }
1438
+ function n(E) {
1439
+ var $;
1440
+ return !E.disabled && ((($ = t.isSelectable) == null ? void 0 : $.call(t, E.source)) ?? !0);
1441
+ }
1442
+ function f(E) {
1443
+ const $ = [], X = (O) => {
1444
+ n(O) && $.push(P(O.key)), O.childKeys.forEach((se) => {
1445
+ const ue = B(se);
1446
+ ue && X(ue);
1447
+ });
1448
+ };
1449
+ return X(E), $;
1450
+ }
1451
+ function p(E) {
1452
+ return a.value.has(P(E));
1453
+ }
1454
+ function x(E) {
1455
+ const $ = B(E);
1456
+ if (!$)
1457
+ return !1;
1458
+ const X = f($), O = X.filter((se) => a.value.has(se)).length;
1459
+ return O > 0 && O < X.length;
1460
+ }
1461
+ function W(E) {
1462
+ if (t.disabled || !n(E))
1463
+ return;
1464
+ const $ = new Set(a.value), X = f(E), O = !p(E.key);
1465
+ X.forEach((se) => {
1466
+ O ? $.add(se) : $.delete(se);
1467
+ }), be($);
1468
+ }
1469
+ function Y(E) {
1470
+ const $ = b.value.nodes.find((X) => X.source === E);
1471
+ $ && W($);
1472
+ }
1473
+ function _(E) {
1474
+ return b.value.nodes.filter(($) => E.has(P($.key)) && n($)).map(($) => $.key);
1475
+ }
1476
+ function H(E) {
1477
+ return b.value.nodes.filter(($) => !E.has(P($.key)) || !n($) ? !1 : !$.childKeys.some((X) => {
1478
+ const O = B(X);
1479
+ return O ? f(O).length > 0 : !1;
1480
+ })).map(($) => $.key);
1481
+ }
1482
+ function ie(E) {
1483
+ if (t.selectionStrategy === "all")
1484
+ return _(E);
1485
+ if (t.selectionStrategy === "leaf")
1486
+ return H(E);
1487
+ const $ = [], X = (O) => {
1488
+ const se = f(O);
1489
+ if (se.length) {
1490
+ if (n(O) && se.every((ue) => E.has(ue))) {
1491
+ $.push(P(O.key));
1492
+ return;
1493
+ }
1494
+ if (n(O) && E.has(P(O.key)) && O.childKeys.length === 0) {
1495
+ $.push(P(O.key));
1496
+ return;
1497
+ }
1498
+ O.childKeys.forEach((ue) => {
1499
+ const Z = B(ue);
1500
+ Z && X(Z);
1501
+ });
1502
+ }
1503
+ };
1504
+ return b.value.rootKeys.forEach((O) => {
1505
+ const se = B(O);
1506
+ se && X(se);
1507
+ }), $.map((O) => {
1508
+ var se;
1509
+ return (se = b.value.nodeByToken.get(O)) == null ? void 0 : se.key;
1510
+ }).filter((O) => O !== void 0);
1511
+ }
1512
+ function ce(E) {
1513
+ return E.map(B).filter(($) => $ !== void 0).map(($) => $.source);
1514
+ }
1515
+ function me(E) {
1516
+ const $ = _(E), X = ie(E), O = H(E);
1517
+ return {
1518
+ checkedKeys: $,
1519
+ selectedKeys: X,
1520
+ selectedNodes: ce(X),
1521
+ leafNodes: ce(O)
1522
+ };
1523
+ }
1524
+ function be(E) {
1525
+ a.value = E;
1526
+ const $ = me(E);
1527
+ o("update:modelValue", $.selectedKeys), o("change", $);
1528
+ }
1529
+ function Le() {
1530
+ const E = /* @__PURE__ */ new Set();
1531
+ t.modelValue.forEach(($) => {
1532
+ const X = B($);
1533
+ X && f(X).forEach((O) => E.add(O));
1534
+ }), a.value = E, Te();
1535
+ }
1536
+ function Te() {
1537
+ const E = ie(a.value)[0], $ = [];
1538
+ let X = E === void 0 ? void 0 : B(E);
1539
+ for (; (X == null ? void 0 : X.parentKey) !== void 0; ) {
1540
+ const O = B(X.parentKey);
1541
+ if (!O)
1542
+ break;
1543
+ $.unshift(O.key), X = O;
1544
+ }
1545
+ v.value = $;
1546
+ }
1547
+ function Ne() {
1548
+ t.disabled || a.value.size === 0 || be(/* @__PURE__ */ new Set());
1549
+ }
1550
+ return y({
1551
+ clear: Ne,
1552
+ getSelection: () => me(a.value)
1553
+ }), he(
1554
+ [b, () => t.modelValue],
1555
+ () => {
1556
+ Le();
1557
+ },
1558
+ { deep: !0, immediate: !0 }
1559
+ ), (E, $) => {
1560
+ const X = j("el-input"), O = j("el-icon"), se = j("el-checkbox");
1561
+ return l(), u("div", {
1562
+ class: we(["wui-custom-tree", { "is-disabled": e.disabled }])
1563
+ }, [
1564
+ d("div", {
1565
+ class: "wui-custom-tree__columns",
1566
+ style: Qe(h.value)
1567
+ }, [
1568
+ (l(!0), u(ye, null, Se(G.value, (ue) => (l(), u("section", {
1569
+ key: ue,
1570
+ class: "wui-custom-tree__column"
1571
+ }, [
1572
+ D(ue) ? (l(), le(X, {
1573
+ key: 0,
1574
+ modelValue: S.value[ue],
1575
+ "onUpdate:modelValue": (Z) => S.value[ue] = Z,
1576
+ clearable: "",
1577
+ "prefix-icon": q(Bt),
1578
+ placeholder: "搜索",
1579
+ class: "wui-custom-tree__search"
1580
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "prefix-icon"])) : N("", !0),
1581
+ R(ue).length ? (l(), u("div", pa, [
1582
+ (l(!0), u(ye, null, Se(R(ue), (Z) => (l(), u("div", {
1583
+ key: P(Z.key),
1584
+ class: we([
1585
+ "wui-custom-tree__node",
1586
+ {
1587
+ "is-active": A(ue, Z.key),
1588
+ "is-selected": p(Z.key),
1589
+ "is-not-selectable": !n(Z)
1590
+ }
1591
+ ])
1592
+ }, [
1593
+ d("button", {
1594
+ type: "button",
1595
+ class: "wui-custom-tree__node-main",
1596
+ title: Z.label,
1597
+ onClick: (Pe) => s(ue, Z)
1598
+ }, [
1599
+ T(O, { class: "wui-custom-tree__node-icon" }, {
1600
+ default: C(() => [
1601
+ Z.childKeys.length && A(ue, Z.key) ? (l(), le(q(pl), { key: 0 })) : Z.childKeys.length ? (l(), le(q(gt), { key: 1 })) : N("", !0)
1602
+ ]),
1603
+ _: 2
1604
+ }, 1024),
1605
+ d("span", va, I(Z.label), 1)
1606
+ ], 8, ma),
1607
+ n(Z) ? (l(), le(se, {
1608
+ key: 0,
1609
+ "model-value": p(Z.key),
1610
+ indeterminate: x(Z.key),
1611
+ disabled: e.disabled || !n(Z),
1612
+ "aria-label": `选择 ${Z.label}`,
1613
+ onClick: $[0] || ($[0] = ze(() => {
1614
+ }, ["stop"])),
1615
+ onChange: (Pe) => W(Z)
1616
+ }, null, 8, ["model-value", "indeterminate", "disabled", "aria-label", "onChange"])) : N("", !0)
1617
+ ], 2))), 128))
1618
+ ])) : (l(), u("p", _a, I(ue === 0 ? e.emptyText : "请先选择上级节点"), 1))
1619
+ ]))), 128))
1620
+ ], 4),
1621
+ e.showSelected ? (l(), u("aside", ga, [
1622
+ $[1] || ($[1] = d("div", { class: "wui-custom-tree__selected-title" }, "当前选择", -1)),
1623
+ g.value.selectedNodes.length ? (l(), u("div", ya, [
1624
+ (l(!0), u(ye, null, Se(g.value.selectedNodes, (ue) => (l(), u("div", {
1625
+ key: P(J(ue)),
1626
+ class: "wui-custom-tree__selected-item"
1627
+ }, [
1628
+ d("span", null, I(ne(ue)), 1),
1629
+ e.disabled ? N("", !0) : (l(), u("button", {
1630
+ key: 0,
1631
+ type: "button",
1632
+ class: "wui-custom-tree__remove",
1633
+ "aria-label": `移除 ${ne(ue)}`,
1634
+ onClick: (Z) => Y(ue)
1635
+ }, [
1636
+ T(O, null, {
1637
+ default: C(() => [
1638
+ T(q(qe))
1639
+ ]),
1640
+ _: 1
1641
+ })
1642
+ ], 8, ha))
1643
+ ]))), 128))
1644
+ ])) : (l(), u("p", ba, "尚未选择节点"))
1645
+ ])) : N("", !0)
1646
+ ], 2);
1647
+ };
1648
+ }
1649
+ }), xa = /* @__PURE__ */ Ae(wa, [["__scopeId", "data-v-ef3417d1"]]), ka = xe(xa, "CustomTree"), Ca = ["disabled"], rt = "1990-01-01", ct = "2099-12-31", Sa = /* @__PURE__ */ ee({
1650
+ name: "DaterangePicker",
1651
+ __name: "index",
1652
+ props: {
1653
+ modelValue: { default: null },
1654
+ disabled: { type: Boolean, default: !1 },
1655
+ type: { default: "end" }
1656
+ },
1657
+ emits: ["update:modelValue", "change"],
1658
+ setup(e, { emit: y }) {
1659
+ const i = e, t = y, o = K(null), a = K(!1), v = K(null), S = k(() => a.value), b = [
1660
+ {
1661
+ text: "长期",
1662
+ value: () => (a.value = !0, [new Date(rt), new Date(ct)])
1663
+ }
1664
+ ];
1665
+ function z(B) {
1666
+ return Array.isArray(B) && B[0] === rt && B[1] === ct;
1667
+ }
1668
+ function G(B) {
1669
+ if (z(B)) {
1670
+ a.value = !0, o.value = B;
1671
+ return;
1672
+ }
1673
+ a.value = !1, o.value = B;
1674
+ }
1675
+ function h(B) {
1676
+ t("update:modelValue", B), t("change", B);
1677
+ }
1678
+ function g(B) {
1679
+ if (a.value) {
1680
+ const J = [rt, ct];
1681
+ o.value = J, h(J);
1682
+ return;
1683
+ }
1684
+ a.value = !1, h(B);
1685
+ }
1686
+ function L() {
1687
+ var B;
1688
+ i.disabled || (a.value = !1, (B = v.value) == null || B.focus());
1689
+ }
1690
+ function P() {
1691
+ i.disabled || (a.value = !1, o.value = null, h(null));
1692
+ }
1693
+ return he(
1694
+ () => i.modelValue,
1695
+ (B) => G(B),
1696
+ { immediate: !0 }
1697
+ ), (B, J) => {
1698
+ const ne = j("el-date-picker"), R = j("el-icon");
1699
+ return l(), u("div", {
1700
+ class: we(["wui-daterange", { "is-disabled": e.disabled }])
1701
+ }, [
1702
+ T(ne, {
1703
+ ref_key: "datePickerRef",
1704
+ ref: v,
1705
+ modelValue: o.value,
1706
+ "onUpdate:modelValue": J[0] || (J[0] = (D) => o.value = D),
1707
+ class: "wui-daterange__picker",
1708
+ type: "daterange",
1709
+ "value-format": "YYYY-MM-DD",
1710
+ "start-placeholder": "开始时间",
1711
+ "end-placeholder": "结束时间",
1712
+ "range-separator": "至",
1713
+ shortcuts: b,
1714
+ disabled: e.disabled,
1715
+ onChange: g
1716
+ }, null, 8, ["modelValue", "disabled"]),
1717
+ S.value ? (l(), u("button", {
1718
+ key: 0,
1719
+ class: "wui-daterange__long-term",
1720
+ type: "button",
1721
+ disabled: e.disabled,
1722
+ onClick: L
1723
+ }, [
1724
+ J[1] || (J[1] = d("span", null, "长期", -1)),
1725
+ T(R, {
1726
+ class: "wui-daterange__clear",
1727
+ onClick: ze(P, ["stop"])
1728
+ }, {
1729
+ default: C(() => [
1730
+ T(q(nl))
1731
+ ]),
1732
+ _: 1
1733
+ })
1734
+ ], 8, Ca)) : N("", !0)
1735
+ ], 2);
1736
+ };
1737
+ }
1738
+ }), Pt = /* @__PURE__ */ Ae(Sa, [["__scopeId", "data-v-1211364c"]]), Va = xe(Pt, "DaterangePicker"), fi = xe(Pt, "DateRangePicker"), Aa = {
1739
+ key: 0,
1740
+ class: "wui-dialog__navigation"
1741
+ }, $a = ["disabled", "onClick"], Ta = { class: "wui-dialog__content" }, Ea = {
1742
+ key: 2,
1743
+ class: "wui-dialog__sections"
1744
+ }, Ba = ["disabled", "aria-expanded", "onClick"], La = { class: "wui-dialog__section-icon" }, Ma = { class: "wui-dialog__section-body" }, Ka = { class: "wui-dialog__footer" }, Na = {
1745
+ key: 0,
1746
+ class: "wui-dialog__step-actions"
1747
+ }, Pa = /* @__PURE__ */ ee({
1748
+ name: "Dialog",
1749
+ __name: "index",
1750
+ props: {
1751
+ modelValue: { type: Boolean, default: !1 },
1752
+ title: { default: "" },
1753
+ width: { default: "900px" },
1754
+ mode: { default: "default" },
1755
+ items: { default: () => [] },
1756
+ activeKey: {},
1757
+ expandedKeys: { default: () => [] },
1758
+ showClose: { type: Boolean, default: !0 },
1759
+ showNavigation: { type: Boolean, default: !0 },
1760
+ showStepActions: { type: Boolean, default: !0 },
1761
+ destroyOnClose: { type: Boolean, default: !0 }
1762
+ },
1763
+ emits: ["update:modelValue", "update:activeKey", "update:expandedKeys", "change", "close"],
1764
+ setup(e, { emit: y }) {
1765
+ const i = e, t = y, o = Ct(), a = k(() => i.items.filter((p) => !p.hidden)), v = k(() => a.value.filter((p) => !p.disabled)), S = k(() => {
1766
+ const p = a.value.find((x) => x.key === i.activeKey);
1767
+ return p && !p.disabled ? p : v.value[0];
1768
+ }), b = k(() => {
1769
+ var p;
1770
+ return (p = S.value) == null ? void 0 : p.key;
1771
+ }), z = k(
1772
+ () => i.mode === "steps" && i.showNavigation && a.value.length > 0
1773
+ ), G = k(
1774
+ () => i.mode === "steps" && i.showStepActions && v.value.length > 1
1775
+ ), h = k(() => v.value.findIndex((p) => p.key === b.value)), g = k(() => h.value > 0 ? v.value[h.value - 1] : void 0), L = k(() => h.value >= 0 && h.value < v.value.length - 1 ? v.value[h.value + 1] : void 0), P = k(() => i.mode === "steps" && v.value.length > 0 && !L.value), B = k(
1776
+ () => !!o.footer && (i.mode !== "steps" || P.value)
1777
+ ), J = k(() => G.value || B.value);
1778
+ function ne(p) {
1779
+ t("update:modelValue", p);
1780
+ }
1781
+ function R() {
1782
+ t("close");
1783
+ }
1784
+ function D() {
1785
+ t("update:modelValue", !1);
1786
+ }
1787
+ function A(p) {
1788
+ p.disabled || (t("update:activeKey", p.key), t("change", p));
1789
+ }
1790
+ function s(p) {
1791
+ const x = p === 1 ? L.value : g.value;
1792
+ x && A(x);
1793
+ }
1794
+ function n(p) {
1795
+ return i.expandedKeys.includes(p);
1796
+ }
1797
+ function f(p) {
1798
+ if (p.disabled)
1799
+ return;
1800
+ const x = n(p.key) ? i.expandedKeys.filter((W) => W !== p.key) : [...i.expandedKeys, p.key];
1801
+ t("update:expandedKeys", x);
1802
+ }
1803
+ return (p, x) => {
1804
+ const W = j("el-button"), Y = j("el-dialog");
1805
+ return l(), le(Y, Vt(p.$attrs, {
1806
+ "model-value": e.modelValue,
1807
+ title: e.title,
1808
+ width: e.width,
1809
+ "show-close": e.showClose,
1810
+ "destroy-on-close": e.destroyOnClose,
1811
+ class: "wui-dialog",
1812
+ "onUpdate:modelValue": ne,
1813
+ onClose: R
1814
+ }), Ht({
1815
+ default: C(() => [
1816
+ d("div", {
1817
+ class: we(["wui-dialog__layout", { "wui-dialog__layout--with-nav": z.value }])
1818
+ }, [
1819
+ z.value ? (l(), u("aside", Aa, [
1820
+ Ce(p.$slots, "navigation", {
1821
+ items: a.value,
1822
+ activeKey: b.value,
1823
+ select: A
1824
+ }, () => [
1825
+ (l(!0), u(ye, null, Se(a.value, (_) => (l(), u("button", {
1826
+ key: _.key,
1827
+ type: "button",
1828
+ class: we([
1829
+ "wui-dialog__nav-item",
1830
+ {
1831
+ "is-active": _.key === b.value,
1832
+ "is-disabled": _.disabled
1833
+ }
1834
+ ]),
1835
+ disabled: _.disabled,
1836
+ onClick: (H) => A(_)
1837
+ }, I(_.label), 11, $a))), 128))
1838
+ ], !0)
1839
+ ])) : N("", !0),
1840
+ d("main", Ta, [
1841
+ e.mode === "default" ? Ce(p.$slots, "default", { key: 0 }, void 0, !0) : e.mode === "steps" ? Ce(p.$slots, "panel", {
1842
+ key: 1,
1843
+ item: S.value,
1844
+ activeKey: b.value
1845
+ }, void 0, !0) : (l(), u("div", Ea, [
1846
+ (l(!0), u(ye, null, Se(a.value, (_) => (l(), u("section", {
1847
+ key: _.key,
1848
+ class: "wui-dialog__section"
1849
+ }, [
1850
+ d("button", {
1851
+ type: "button",
1852
+ class: "wui-dialog__section-header",
1853
+ disabled: _.disabled,
1854
+ "aria-expanded": n(_.key),
1855
+ onClick: (H) => f(_)
1856
+ }, [
1857
+ d("span", null, I(_.label), 1),
1858
+ d("span", La, I(n(_.key) ? "收起" : "展开"), 1)
1859
+ ], 8, Ba),
1860
+ et(d("div", Ma, [
1861
+ Ce(p.$slots, "section", {
1862
+ item: _,
1863
+ expanded: n(_.key)
1864
+ }, void 0, !0)
1865
+ ], 512), [
1866
+ [Qt, n(_.key)]
1867
+ ])
1868
+ ]))), 128))
1869
+ ]))
1870
+ ])
1871
+ ], 2)
1872
+ ]),
1873
+ _: 2
1874
+ }, [
1875
+ J.value ? {
1876
+ name: "footer",
1877
+ fn: C(() => [
1878
+ d("div", Ka, [
1879
+ G.value ? (l(), u("div", Na, [
1880
+ g.value ? (l(), le(W, {
1881
+ key: 0,
1882
+ onClick: x[0] || (x[0] = (_) => s(-1))
1883
+ }, {
1884
+ default: C(() => [...x[2] || (x[2] = [
1885
+ Ve("上一步", -1)
1886
+ ])]),
1887
+ _: 1
1888
+ })) : N("", !0),
1889
+ L.value ? (l(), le(W, {
1890
+ key: 1,
1891
+ type: "primary",
1892
+ onClick: x[1] || (x[1] = (_) => s(1))
1893
+ }, {
1894
+ default: C(() => [...x[3] || (x[3] = [
1895
+ Ve("下一步", -1)
1896
+ ])]),
1897
+ _: 1
1898
+ })) : N("", !0)
1899
+ ])) : N("", !0),
1900
+ B.value ? Ce(p.$slots, "footer", {
1901
+ key: 1,
1902
+ item: S.value,
1903
+ activeKey: b.value,
1904
+ close: D
1905
+ }, void 0, !0) : N("", !0)
1906
+ ])
1907
+ ]),
1908
+ key: "0"
1909
+ } : void 0
1910
+ ]), 1040, ["model-value", "title", "width", "show-close", "destroy-on-close"]);
1911
+ };
1912
+ }
1913
+ }), Ia = /* @__PURE__ */ Ae(Pa, [["__scopeId", "data-v-1e7710fa"]]), za = xe(Ia, "Dialog"), Ra = ["contenteditable", "data-placeholder", "aria-multiline", "aria-disabled"], Ua = {
1914
+ key: 0,
1915
+ class: "editable-box__counter",
1916
+ "aria-live": "polite"
1917
+ }, Fa = {
1918
+ key: 0,
1919
+ class: "editable-box__module-panel"
1920
+ }, Oa = {
1921
+ key: 0,
1922
+ class: "editable-box__module-group"
1923
+ }, Da = { class: "editable-box__module-list" }, ja = ["disabled", "onClick"], Ha = { class: "editable-box__module-list" }, Qa = ["disabled", "onClick"], lt = "​", qa = /* @__PURE__ */ ee({
1924
+ __name: "EditableBox",
1925
+ props: {
1926
+ modelValue: { default: () => [] },
1927
+ fixedModules: { default: () => [] },
1928
+ moduleGroups: { default: () => [] },
1929
+ fixedGroupTitle: { default: "固定变量" },
1930
+ textLimit: { default: 0 },
1931
+ moduleLimit: { default: 0 },
1932
+ width: { default: "100%" },
1933
+ height: {},
1934
+ textType: { default: "text" },
1935
+ placeholder: { default: "请输入内容" },
1936
+ showCounter: { type: Boolean, default: !0 },
1937
+ draggable: { type: Boolean, default: !0 },
1938
+ disabled: { type: Boolean, default: !1 },
1939
+ required: { type: Boolean, default: !1 },
1940
+ allowLineBreak: { type: Boolean, default: !0 }
1941
+ },
1942
+ emits: ["update:modelValue", "change", "blur", "limit-exceed"],
1943
+ setup(e, { expose: y, emit: i }) {
1944
+ const t = e, o = i, a = K(null), v = K([]), S = K(0), b = K(!1), z = K(!1), G = K(!1);
1945
+ let h = null, g = null, L = null, P = "";
1946
+ const B = new RegExp(lt, "g"), J = k(() => [
1947
+ ...t.fixedModules,
1948
+ ...t.moduleGroups.flatMap((r) => r.modules)
1949
+ ]), ne = k(() => new Map(
1950
+ J.value.map((r) => [String(r.id), r])
1951
+ )), R = k(() => t.fixedModules.length > 0 || t.moduleGroups.some((r) => r.modules.length > 0));
1952
+ function D(r) {
1953
+ if (!(r === void 0 || r === ""))
1954
+ return typeof r == "number" ? `${r}px` : r;
1955
+ }
1956
+ const A = k(() => ({
1957
+ width: D(t.width)
1958
+ })), s = k(() => ({
1959
+ height: D(t.height),
1960
+ minHeight: t.height === void 0 ? void 0 : "0px"
1961
+ })), n = (r) => r > 0 ? r : "不限", f = (r) => String(r), p = (r) => String(r), x = (r) => Array.from(r).length, W = (r) => v.value.includes(f(r));
1962
+ function Y(r) {
1963
+ return !!(a.value && a.value.contains(r.commonAncestorContainer));
1964
+ }
1965
+ function _() {
1966
+ const r = window.getSelection();
1967
+ if (!r || r.rangeCount === 0) return;
1968
+ const V = r.getRangeAt(0);
1969
+ Y(V) && (h = V.cloneRange());
1970
+ }
1971
+ function H() {
1972
+ const r = document.createRange();
1973
+ return a.value && (r.selectNodeContents(a.value), r.collapse(!1)), r;
1974
+ }
1975
+ function ie() {
1976
+ return h && Y(h) ? h.cloneRange() : H();
1977
+ }
1978
+ function ce(r) {
1979
+ const V = window.getSelection();
1980
+ V && (V.removeAllRanges(), V.addRange(r), h = r.cloneRange());
1981
+ }
1982
+ function me() {
1983
+ var V;
1984
+ (V = a.value) == null || V.focus();
1985
+ const r = ie();
1986
+ ce(r);
1987
+ }
1988
+ function be(r) {
1989
+ const V = document.createElement("span");
1990
+ return V.className = "editable-box__tag", V.textContent = r.label, V.contentEditable = "false", V.draggable = t.draggable && !t.disabled && !r.disabled, V.setAttribute("role", "button"), V.setAttribute("aria-label", `变量:${r.label}`), V.dataset.id = f(r.id), V.dataset.type = p(r.type ?? "module"), V.addEventListener("dragstart", Me), V.addEventListener("dragend", Ue), V;
1991
+ }
1992
+ function Le() {
1993
+ return document.createTextNode(lt);
1994
+ }
1995
+ function Te(r) {
1996
+ return !!(r && r.nodeType === Node.TEXT_NODE && r.textContent === lt);
1997
+ }
1998
+ function Ne(r) {
1999
+ return r.replace(B, "");
2000
+ }
2001
+ function Be() {
2002
+ if (!a.value) return [];
2003
+ const r = document.createTreeWalker(a.value, NodeFilter.SHOW_TEXT, {
2004
+ acceptNode(ae) {
2005
+ var de;
2006
+ return (de = ae.parentElement) != null && de.closest(".editable-box__tag") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
2007
+ }
2008
+ }), V = [];
2009
+ let U = r.nextNode();
2010
+ for (; U; )
2011
+ V.push(U), U = r.nextNode();
2012
+ return V;
2013
+ }
2014
+ function E() {
2015
+ if (!a.value) return "";
2016
+ let r = "";
2017
+ function V(U) {
2018
+ if (U.nodeType === Node.TEXT_NODE) {
2019
+ r += Ne(U.textContent || "");
2020
+ return;
2021
+ }
2022
+ if (U.nodeType !== Node.ELEMENT_NODE) return;
2023
+ const ae = U;
2024
+ if (!ae.classList.contains("editable-box__tag")) {
2025
+ if (ae.tagName === "BR") {
2026
+ r += `
2027
+ `;
2028
+ return;
2029
+ }
2030
+ ae.childNodes.forEach(V), (ae.tagName === "DIV" || ae.tagName === "P") && ae.nextSibling && (r += `
2031
+ `);
2032
+ }
2033
+ }
2034
+ return a.value.childNodes.forEach(V), r;
2035
+ }
2036
+ function $() {
2037
+ if (!a.value) return;
2038
+ const r = Array.from(a.value.querySelectorAll(".editable-box__tag")).map((V) => V.dataset.id).filter((V) => !!V);
2039
+ v.value = Array.from(new Set(r));
2040
+ }
2041
+ function X(r, V) {
2042
+ const U = Ne(V);
2043
+ if (!U) return;
2044
+ const ae = r[r.length - 1];
2045
+ if (ae && p(ae.type) === p(t.textType)) {
2046
+ ae.val = `${ae.val}${U}`;
2047
+ return;
2048
+ }
2049
+ r.push({ type: t.textType, val: U });
2050
+ }
2051
+ function O() {
2052
+ var U;
2053
+ const r = [];
2054
+ function V(ae) {
2055
+ if (ae.nodeType === Node.TEXT_NODE) {
2056
+ X(r, ae.textContent || "");
2057
+ return;
2058
+ }
2059
+ if (ae.nodeType !== Node.ELEMENT_NODE) return;
2060
+ const de = ae;
2061
+ if (de.classList.contains("editable-box__tag")) {
2062
+ const Ee = de.dataset.id, Ke = de.dataset.type;
2063
+ Ee && Ke && r.push({ type: Ke, val: Ee });
2064
+ return;
2065
+ }
2066
+ if (de.tagName === "BR") {
2067
+ X(r, `
2068
+ `);
2069
+ return;
2070
+ }
2071
+ de.childNodes.forEach(V), (de.tagName === "DIV" || de.tagName === "P") && de.nextSibling && X(r, `
2072
+ `);
2073
+ }
2074
+ return (U = a.value) == null || U.childNodes.forEach(V), r;
2075
+ }
2076
+ function se(r) {
2077
+ return JSON.stringify(r.map((V) => ({
2078
+ type: p(V.type),
2079
+ val: String(V.val)
2080
+ })));
2081
+ }
2082
+ function ue() {
2083
+ const r = O();
2084
+ return P = se(r), o("update:modelValue", r), o("change", r), r;
2085
+ }
2086
+ function Z({ emitValue: r = !1 } = {}) {
2087
+ return $(), S.value = x(E()), b.value = !1, r ? ue() : O();
2088
+ }
2089
+ function Pe() {
2090
+ if (t.textLimit <= 0) return !1;
2091
+ let r = t.textLimit, V = !1;
2092
+ for (const U of Be()) {
2093
+ if (U.data === lt) continue;
2094
+ const ae = Array.from(Ne(U.data));
2095
+ if (ae.length <= r) {
2096
+ r -= ae.length;
2097
+ continue;
2098
+ }
2099
+ U.data = ae.slice(0, Math.max(r, 0)).join(""), r = 0, V = !0;
2100
+ }
2101
+ return V;
2102
+ }
2103
+ function Re() {
2104
+ if (!a.value) return;
2105
+ const r = H();
2106
+ ce(r);
2107
+ }
2108
+ function Ie() {
2109
+ const r = Pe();
2110
+ return r && (o("limit-exceed", { type: "text", limit: t.textLimit }), Re()), r;
2111
+ }
2112
+ function F(r) {
2113
+ if (!r || t.disabled || !a.value) return;
2114
+ const V = ie();
2115
+ V.deleteContents();
2116
+ const U = document.createTextNode(r);
2117
+ V.insertNode(U);
2118
+ const ae = document.createRange();
2119
+ ae.setStartAfter(U), ae.collapse(!0), ce(ae);
2120
+ }
2121
+ function oe(r) {
2122
+ a.value && (a.value.querySelectorAll(".editable-box__tag").forEach((V) => {
2123
+ if (V.dataset.id === f(r)) {
2124
+ const U = V.nextSibling;
2125
+ Te(U) && U.remove(), V.remove();
2126
+ }
2127
+ }), Re(), Z({ emitValue: !0 }));
2128
+ }
2129
+ function ve(r) {
2130
+ if (!a.value) return;
2131
+ const V = ie();
2132
+ V.deleteContents();
2133
+ const U = be(r), ae = Le();
2134
+ V.insertNode(U), U.after(ae);
2135
+ const de = document.createRange();
2136
+ de.setStartAfter(ae), de.collapse(!0), ce(de), Z({ emitValue: !0 });
2137
+ }
2138
+ function $e(r) {
2139
+ if (!(t.disabled || r.disabled)) {
2140
+ if (me(), W(r.id)) {
2141
+ oe(r.id);
2142
+ return;
2143
+ }
2144
+ if (t.moduleLimit > 0 && v.value.length >= t.moduleLimit) {
2145
+ o("limit-exceed", { type: "module", limit: t.moduleLimit });
2146
+ return;
2147
+ }
2148
+ ve(r);
2149
+ }
2150
+ }
2151
+ function je() {
2152
+ if (_(), G.value) {
2153
+ Z();
2154
+ return;
2155
+ }
2156
+ Ie(), Z({ emitValue: !0 });
2157
+ }
2158
+ function m() {
2159
+ G.value = !1, _(), Ie(), Z({ emitValue: !0 });
2160
+ }
2161
+ function M(r) {
2162
+ if (t.disabled) {
2163
+ r.preventDefault();
2164
+ return;
2165
+ }
2166
+ r.key === "Enter" && (r.preventDefault(), t.allowLineBreak && (F(`
2167
+ `), Z({ emitValue: !0 })));
2168
+ }
2169
+ function re(r) {
2170
+ var Ge;
2171
+ if (t.disabled) return;
2172
+ r.preventDefault();
2173
+ const V = ((Ge = r.clipboardData) == null ? void 0 : Ge.getData("text/plain")) || "", U = t.allowLineBreak ? V : V.replace(/[\r\n]+/g, " ");
2174
+ if (!U) return;
2175
+ const ae = x(E()), de = t.textLimit > 0 ? Math.max(t.textLimit - ae, 0) : 1 / 0, Ee = Array.from(U), Ke = Ee.slice(0, de).join("");
2176
+ Ke && F(Ke), x(Ke) < Ee.length && o("limit-exceed", { type: "text", limit: t.textLimit }), Z({ emitValue: !0 });
2177
+ }
2178
+ function pe() {
2179
+ _();
2180
+ const r = O();
2181
+ o("blur", r);
2182
+ }
2183
+ function Me(r) {
2184
+ var V;
2185
+ if (t.disabled || !t.draggable) {
2186
+ r.preventDefault();
2187
+ return;
2188
+ }
2189
+ g = r.currentTarget, L = Te(g.nextSibling) ? g.nextSibling : Le(), g.classList.add("is-dragging"), (V = r.dataTransfer) == null || V.setData("text/plain", g.dataset.id || ""), r.dataTransfer && (r.dataTransfer.effectAllowed = "move");
2190
+ }
2191
+ function Ue() {
2192
+ g == null || g.classList.remove("is-dragging"), g = null, L = null;
2193
+ }
2194
+ function We(r) {
2195
+ g && r.dataTransfer && (r.dataTransfer.dropEffect = "move");
2196
+ }
2197
+ function Fe(r) {
2198
+ if (!g || !a.value || t.disabled || !t.draggable) return;
2199
+ const V = g, U = L || Le(), ae = () => {
2200
+ const Ke = document.createDocumentFragment();
2201
+ return Ke.append(V, U), Ke;
2202
+ }, de = r.target, Ee = de instanceof Element ? de.closest(".editable-box__tag") : null;
2203
+ if (Ee && Ee !== V) {
2204
+ const Ke = Ee.getBoundingClientRect(), Ge = r.clientX > Ke.left + Ke.width / 2, Je = Ee.nextSibling, it = Te(Je) ? Je.nextSibling : Je;
2205
+ a.value.insertBefore(ae(), Ge ? it : Ee);
2206
+ } else Ee || a.value.appendChild(ae());
2207
+ Ue(), Z({ emitValue: !0 });
2208
+ }
2209
+ function Oe(r) {
2210
+ if (a.value) {
2211
+ a.value.replaceChildren();
2212
+ for (const V of r) {
2213
+ if (p(V.type) === p(t.textType)) {
2214
+ a.value.appendChild(document.createTextNode(String(V.val)));
2215
+ continue;
2216
+ }
2217
+ const U = ne.value.get(String(V.val));
2218
+ if (U) {
2219
+ const Ee = be({ ...U, type: V.type });
2220
+ a.value.appendChild(Ee), a.value.appendChild(Le());
2221
+ continue;
2222
+ }
2223
+ const ae = {
2224
+ id: V.val,
2225
+ label: String(V.val),
2226
+ type: V.type,
2227
+ disabled: !0
2228
+ }, de = be(ae);
2229
+ de.classList.add("is-unavailable"), a.value.appendChild(de), a.value.appendChild(Le());
2230
+ }
2231
+ Ie(), Z(), P = se(O());
2232
+ }
2233
+ }
2234
+ function ke() {
2235
+ Oe([]), ue();
2236
+ }
2237
+ function tt() {
2238
+ const r = !t.required || O().length > 0;
2239
+ return b.value = !r, r;
2240
+ }
2241
+ return St(() => {
2242
+ z.value = !0, Oe(t.modelValue);
2243
+ }), he(
2244
+ () => t.modelValue,
2245
+ (r) => {
2246
+ if (!z.value) return;
2247
+ se(r) !== P && mt(() => Oe(r));
2248
+ },
2249
+ { deep: !0 }
2250
+ ), he(
2251
+ J,
2252
+ () => {
2253
+ z.value && Oe(O());
2254
+ },
2255
+ { deep: !0 }
2256
+ ), he(
2257
+ () => [t.disabled, t.draggable],
2258
+ () => {
2259
+ var r;
2260
+ (r = a.value) == null || r.querySelectorAll(".editable-box__tag").forEach((V) => {
2261
+ V.draggable = t.draggable && !t.disabled && !V.classList.contains("is-unavailable");
2262
+ });
2263
+ }
2264
+ ), y({
2265
+ clear: ke,
2266
+ focus: me,
2267
+ getContent: O,
2268
+ validate: tt
2269
+ }), (r, V) => (l(), u("div", {
2270
+ class: we(["editable-box", { "is-disabled": e.disabled }])
2271
+ }, [
2272
+ d("div", {
2273
+ class: "editable-box__field",
2274
+ style: Qe(A.value)
2275
+ }, [
2276
+ d("div", {
2277
+ ref_key: "editor",
2278
+ ref: a,
2279
+ class: we(["editable-box__editor", { "has-error": b.value }]),
2280
+ style: Qe(s.value),
2281
+ contenteditable: !e.disabled,
2282
+ "data-placeholder": e.placeholder,
2283
+ role: "textbox",
2284
+ "aria-multiline": e.allowLineBreak,
2285
+ "aria-disabled": e.disabled,
2286
+ onClick: _,
2287
+ onFocus: _,
2288
+ onInput: je,
2289
+ onBlur: pe,
2290
+ onKeydown: M,
2291
+ onPaste: re,
2292
+ onCompositionstart: V[0] || (V[0] = (U) => G.value = !0),
2293
+ onCompositionend: m,
2294
+ onDragover: ze(We, ["prevent"]),
2295
+ onDrop: ze(Fe, ["prevent"])
2296
+ }, null, 46, Ra),
2297
+ e.showCounter ? (l(), u("div", Ua, [
2298
+ d("span", null, "变量:" + I(v.value.length) + "/" + I(n(e.moduleLimit)), 1),
2299
+ d("span", null, "文字:" + I(S.value) + "/" + I(n(e.textLimit)), 1)
2300
+ ])) : N("", !0)
2301
+ ], 4),
2302
+ R.value ? (l(), u("div", Fa, [
2303
+ e.fixedModules.length ? (l(), u("section", Oa, [
2304
+ d("h4", null, I(e.fixedGroupTitle), 1),
2305
+ d("div", Da, [
2306
+ (l(!0), u(ye, null, Se(e.fixedModules, (U) => (l(), u("button", {
2307
+ key: String(U.id),
2308
+ class: we(["editable-box__module-button", { "is-selected": W(U.id) }]),
2309
+ type: "button",
2310
+ disabled: e.disabled || U.disabled,
2311
+ onMousedown: V[1] || (V[1] = ze(() => {
2312
+ }, ["prevent"])),
2313
+ onClick: (ae) => $e(U)
2314
+ }, I(U.label), 43, ja))), 128))
2315
+ ])
2316
+ ])) : N("", !0),
2317
+ (l(!0), u(ye, null, Se(e.moduleGroups, (U, ae) => (l(), u("section", {
2318
+ key: U.key || `${U.title}-${ae}`,
2319
+ class: "editable-box__module-group"
2320
+ }, [
2321
+ d("h4", null, I(U.title), 1),
2322
+ d("div", Ha, [
2323
+ (l(!0), u(ye, null, Se(U.modules, (de) => (l(), u("button", {
2324
+ key: String(de.id),
2325
+ class: we(["editable-box__module-button", { "is-selected": W(de.id) }]),
2326
+ type: "button",
2327
+ disabled: e.disabled || de.disabled,
2328
+ onMousedown: V[2] || (V[2] = ze(() => {
2329
+ }, ["prevent"])),
2330
+ onClick: (Ee) => $e(de)
2331
+ }, I(de.label), 43, Qa))), 128))
2332
+ ])
2333
+ ]))), 128))
2334
+ ])) : N("", !0)
2335
+ ], 2));
2336
+ }
2337
+ }), Ga = /* @__PURE__ */ Ae(qa, [["__scopeId", "data-v-6abca841"]]), Xa = xe(Ga, "EditableBox"), Wa = { class: "wui-expand-select" }, Ja = { class: "wui-expand-select__title" }, Ya = { class: "wui-expand-select__content" }, Za = ["aria-pressed", "onClick"], en = ["onClick"], tn = /* @__PURE__ */ ee({
2338
+ name: "ExpandSelect",
2339
+ __name: "index",
2340
+ props: {
2341
+ expandList: { default: () => [] }
2342
+ },
2343
+ emits: ["change"],
2344
+ setup(e, { expose: y, emit: i }) {
2345
+ const t = e, o = i, a = K({}), v = K({}), S = K([]);
2346
+ function b(s) {
2347
+ return typeof s != "object" || s === null || !("setScrollTop" in s) ? !1 : typeof s.setScrollTop == "function";
2348
+ }
2349
+ function z(s, n) {
2350
+ b(s) && (S.value[n] = s);
2351
+ }
2352
+ function G(s) {
2353
+ return (n) => z(n, s);
2354
+ }
2355
+ function h(s) {
2356
+ return s.value === "" || s.value === void 0 || s.label === "全部";
2357
+ }
2358
+ function g(s) {
2359
+ return s.options.find(h);
2360
+ }
2361
+ function L(s) {
2362
+ return a.value[s.key] ?? [];
2363
+ }
2364
+ function P(s, n) {
2365
+ return L(s).some((f) => f.value === n.value);
2366
+ }
2367
+ function B(s) {
2368
+ return v.value[s.key] ?? !!s.expanded;
2369
+ }
2370
+ function J(s) {
2371
+ return s.map((n) => n.value).filter((n) => n !== "" && n !== void 0);
2372
+ }
2373
+ function ne(s, n) {
2374
+ const f = L(s), p = f.some((x) => x.value === n.value);
2375
+ if (!(h(n) && p)) {
2376
+ if (s.multiple === !1) {
2377
+ if (p)
2378
+ return;
2379
+ a.value[s.key] = [n];
2380
+ } else if (h(n))
2381
+ a.value[s.key] = [n];
2382
+ else if (p) {
2383
+ const x = f.filter((W) => W.value !== n.value);
2384
+ a.value[s.key] = x.length ? x : g(s) ? [g(s)] : [];
2385
+ } else
2386
+ a.value[s.key] = [
2387
+ ...f.filter((x) => !h(x)),
2388
+ n
2389
+ ];
2390
+ o("change", s.key, J(L(s)));
2391
+ }
2392
+ }
2393
+ function R(s, n) {
2394
+ v.value[s.key] = !B(s), mt(() => {
2395
+ var f;
2396
+ (f = S.value[n]) == null || f.setScrollTop(0);
2397
+ });
2398
+ }
2399
+ function D(s, n, f) {
2400
+ return `${s.key}-${n.value ?? "all"}-${f}`;
2401
+ }
2402
+ return y({
2403
+ getSelectedValues: (s) => J(a.value[s] ?? []),
2404
+ getSelectedOptions: (s) => a.value[s] ?? []
2405
+ }), he(
2406
+ () => t.expandList,
2407
+ (s) => {
2408
+ s.forEach((n) => {
2409
+ if (n.key in v.value || (v.value[n.key] = !!n.expanded), !(n.key in a.value)) {
2410
+ const f = g(n);
2411
+ f && (a.value[n.key] = [f]);
2412
+ }
2413
+ });
2414
+ },
2415
+ { deep: !0, immediate: !0 }
2416
+ ), (s, n) => {
2417
+ const f = j("el-scrollbar"), p = j("el-icon");
2418
+ return l(), u("div", Wa, [
2419
+ (l(!0), u(ye, null, Se(e.expandList, (x, W) => (l(), u("div", {
2420
+ key: x.key,
2421
+ class: "wui-expand-select__row"
2422
+ }, [
2423
+ d("div", Ja, I(x.title) + ":", 1),
2424
+ d("div", Ya, [
2425
+ T(f, {
2426
+ ref_for: !0,
2427
+ ref: G(W)
2428
+ }, {
2429
+ default: C(() => [
2430
+ d("div", {
2431
+ class: "wui-expand-select__options",
2432
+ style: Qe({ height: B(x) ? "105px" : "33px" })
2433
+ }, [
2434
+ (l(!0), u(ye, null, Se(x.options, (Y, _) => (l(), u("button", {
2435
+ key: D(x, Y, _),
2436
+ type: "button",
2437
+ class: we([
2438
+ "wui-expand-select__option",
2439
+ { "is-active": P(x, Y) }
2440
+ ]),
2441
+ "aria-pressed": P(x, Y),
2442
+ onClick: (H) => ne(x, Y)
2443
+ }, I(Y.label), 11, Za))), 128))
2444
+ ], 4)
2445
+ ]),
2446
+ _: 2
2447
+ }, 1536)
2448
+ ]),
2449
+ x.options.length > 14 ? (l(), u("button", {
2450
+ key: 0,
2451
+ class: "wui-expand-select__toggle",
2452
+ type: "button",
2453
+ onClick: (Y) => R(x, W)
2454
+ }, [
2455
+ d("span", null, I(B(x) ? "收起" : "展开"), 1),
2456
+ T(p, {
2457
+ class: we({ "is-expanded": B(x) })
2458
+ }, {
2459
+ default: C(() => [
2460
+ T(q($t))
2461
+ ]),
2462
+ _: 1
2463
+ }, 8, ["class"])
2464
+ ], 8, en)) : N("", !0)
2465
+ ]))), 128))
2466
+ ]);
2467
+ };
2468
+ }
2469
+ }), ln = /* @__PURE__ */ Ae(tn, [["__scopeId", "data-v-1af516ee"]]), an = xe(ln, "ExpandSelect"), nn = { class: "wui-file-preview" }, on = {
2470
+ key: 0,
2471
+ class: "wui-file-preview__frame-wrap"
2472
+ }, sn = ["src", "title", "sandbox"], un = ["href"], rn = /* @__PURE__ */ ee({
2473
+ name: "FilePreview",
2474
+ __name: "index",
2475
+ props: {
2476
+ modelValue: { type: Boolean },
2477
+ file: {},
2478
+ files: { default: () => [] },
2479
+ allFiles: { default: () => [] },
2480
+ previewUrl: { default: "" },
2481
+ previewUrlResolver: {},
2482
+ iframeSandbox: { default: "allow-downloads allow-forms allow-scripts" },
2483
+ title: { default: "文件预览" },
2484
+ showTrigger: { type: Boolean, default: !0 }
2485
+ },
2486
+ emits: ["update:modelValue", "open", "close", "preview"],
2487
+ setup(e, { expose: y, emit: i }) {
2488
+ const t = e, o = i, a = K(), v = K(0), S = K(!1), b = K(0), z = ot(), G = K(!1), h = K(R("modelValue")), g = k(() => t.files.length ? t.files : t.allFiles.length ? t.allFiles : t.file ? [t.file] : []), L = k(
2489
+ () => h.value ? !!t.modelValue : G.value
2490
+ ), P = k(() => {
2491
+ var _;
2492
+ return String(((_ = a.value) == null ? void 0 : _.name) ?? "");
2493
+ }), B = k(() => n(a.value, v.value)), J = k(() => g.value.filter(s)), ne = k(() => !!(L.value && a.value && !s(a.value)));
2494
+ function R(_) {
2495
+ const H = z == null ? void 0 : z.vnode.props;
2496
+ if (!H)
2497
+ return !1;
2498
+ const ie = _.replace(/[A-Z]/g, (ce) => `-${ce.toLowerCase()}`);
2499
+ return Object.prototype.hasOwnProperty.call(H, _) || Object.prototype.hasOwnProperty.call(H, ie);
2500
+ }
2501
+ function D(_) {
2502
+ h.value || (G.value = _), o("update:modelValue", _);
2503
+ }
2504
+ function A(_) {
2505
+ var ce;
2506
+ const H = _.fileType ?? _.ext;
2507
+ return typeof H == "string" && H ? H.toLowerCase().replace(/^\./, "") : ((ce = (typeof _.name == "string" ? _.name : typeof _.url == "string" ? _.url : "").split("?")[0].split(".").pop()) == null ? void 0 : ce.toLowerCase()) ?? "";
2508
+ }
2509
+ function s(_) {
2510
+ return ["jpg", "jpeg", "png", "gif", "svg", "webp", "bmp", "tiff"].includes(A(_));
2511
+ }
2512
+ function n(_, H) {
2513
+ var me;
2514
+ if (!_)
2515
+ return "";
2516
+ const ce = ((me = t.previewUrlResolver) == null ? void 0 : me.call(t, _, H)) || t.previewUrl || (typeof _.url == "string" ? _.url : "");
2517
+ return f(ce) ? ce.trim() : "";
2518
+ }
2519
+ function f(_) {
2520
+ if (!(_ != null && _.trim()))
2521
+ return !1;
2522
+ try {
2523
+ const H = new URL(_.trim(), `https://${Wt}.invalid`);
2524
+ return ["http:", "https:", "blob:"].includes(H.protocol);
2525
+ } catch {
2526
+ return !1;
2527
+ }
2528
+ }
2529
+ function p(_ = t.file ?? g.value[0], H) {
2530
+ if (!_)
2531
+ return;
2532
+ const ie = H ?? g.value.findIndex((ce) => ce === _);
2533
+ if (a.value = _, v.value = ie >= 0 ? ie : 0, o("open", _, v.value), o("preview", _, v.value), s(_)) {
2534
+ b.value = Math.max(0, J.value.findIndex((ce) => ce === _)), S.value = !0, D(!0);
2535
+ return;
2536
+ }
2537
+ D(!0);
2538
+ }
2539
+ function x() {
2540
+ S.value = !1, D(!1), o("close");
2541
+ }
2542
+ function W(_) {
2543
+ S.value = _, _ || x();
2544
+ }
2545
+ function Y(_) {
2546
+ _ || x();
2547
+ }
2548
+ return he(
2549
+ g,
2550
+ (_) => {
2551
+ (!a.value || !_.includes(a.value)) && (a.value = t.file ?? _[0], v.value = a.value ? Math.max(0, _.indexOf(a.value)) : 0);
2552
+ },
2553
+ { immediate: !0 }
2554
+ ), he(
2555
+ () => t.file,
2556
+ (_) => {
2557
+ if (!_)
2558
+ return;
2559
+ a.value = _;
2560
+ const H = g.value.indexOf(_);
2561
+ v.value = H >= 0 ? H : 0;
2562
+ },
2563
+ { immediate: !0 }
2564
+ ), ft(() => {
2565
+ h.value = R("modelValue");
2566
+ }), he(
2567
+ L,
2568
+ (_) => {
2569
+ if (!_) {
2570
+ S.value = !1;
2571
+ return;
2572
+ }
2573
+ const H = a.value ?? t.file ?? g.value[0];
2574
+ H && s(H) && (b.value = Math.max(0, J.value.findIndex((ie) => ie === H)), S.value = !0);
2575
+ },
2576
+ { immediate: !0 }
2577
+ ), y({ open: p, close: x, resolvePreviewUrl: n }), (_, H) => {
2578
+ const ie = j("el-button"), ce = j("el-empty"), me = j("el-dialog");
2579
+ return l(), u("span", nn, [
2580
+ _.$slots.default ? Ce(_.$slots, "default", {
2581
+ key: 0,
2582
+ open: p,
2583
+ file: a.value,
2584
+ files: g.value,
2585
+ visible: L.value
2586
+ }, void 0, !0) : e.showTrigger ? (l(), le(ie, {
2587
+ key: 1,
2588
+ link: "",
2589
+ type: "primary",
2590
+ disabled: !a.value,
2591
+ onClick: H[0] || (H[0] = (be) => p())
2592
+ }, {
2593
+ default: C(() => [...H[1] || (H[1] = [
2594
+ Ve("预览", -1)
2595
+ ])]),
2596
+ _: 1
2597
+ }, 8, ["disabled"])) : N("", !0),
2598
+ T(q(Mt), {
2599
+ "model-value": S.value,
2600
+ files: J.value,
2601
+ "img-index": b.value,
2602
+ "preview-url-resolver": n,
2603
+ "show-trigger": !1,
2604
+ "onUpdate:modelValue": W
2605
+ }, null, 8, ["model-value", "files", "img-index"]),
2606
+ T(me, {
2607
+ "model-value": ne.value,
2608
+ title: P.value || e.title,
2609
+ width: "min(1000px, 92vw)",
2610
+ "append-to-body": "",
2611
+ class: "wui-file-preview__dialog",
2612
+ "onUpdate:modelValue": Y
2613
+ }, {
2614
+ footer: C(() => [
2615
+ B.value ? (l(), u("a", {
2616
+ key: 0,
2617
+ class: "wui-file-preview__open-link",
2618
+ href: B.value,
2619
+ target: "_blank",
2620
+ rel: "noopener noreferrer"
2621
+ }, " 在新窗口打开 ", 8, un)) : N("", !0)
2622
+ ]),
2623
+ default: C(() => [
2624
+ B.value ? (l(), u("div", on, [
2625
+ d("iframe", {
2626
+ class: "wui-file-preview__frame",
2627
+ src: B.value,
2628
+ title: P.value || e.title,
2629
+ sandbox: e.iframeSandbox
2630
+ }, null, 8, sn)
2631
+ ])) : (l(), le(ce, {
2632
+ key: 1,
2633
+ description: "当前文件没有可用的预览地址"
2634
+ }))
2635
+ ]),
2636
+ _: 1
2637
+ }, 8, ["model-value", "title"])
2638
+ ]);
2639
+ };
2640
+ }
2641
+ }), It = /* @__PURE__ */ Ae(rn, [["__scopeId", "data-v-a6a082d7"]]), cn = xe(It, "FilePreview"), pi = xe(It, "FilePreviewer");
2642
+ function Ze(e) {
2643
+ return typeof e == "string" || typeof e == "number";
2644
+ }
2645
+ function dn(e) {
2646
+ return typeof e != "object" || e === null || Array.isArray(e) ? !1 : Object.values(e).every((y) => Array.isArray(y) && y.every(Ze));
2647
+ }
2648
+ function dt(e) {
2649
+ const y = /* @__PURE__ */ new Set();
2650
+ return e.filter((i) => {
2651
+ const t = `${typeof i}:${String(i)}`;
2652
+ return y.has(t) ? !1 : (y.add(t), !0);
2653
+ });
2654
+ }
2655
+ const fn = {
2656
+ toKeys(e) {
2657
+ return Ze(e) ? [e] : Array.isArray(e) ? dt(e.filter(Ze)) : dn(e) ? dt(Object.values(e).flat().filter(Ze)) : [];
2658
+ },
2659
+ fromSelection(e) {
2660
+ return e.keys;
2661
+ }
2662
+ };
2663
+ function mi(e) {
2664
+ const y = e.getNodeType ?? ((i) => {
2665
+ const t = i.type;
2666
+ return typeof t == "string" ? t : void 0;
2667
+ });
2668
+ return {
2669
+ toKeys(i) {
2670
+ return i ? dt(Object.values(i).flat().filter(Ze)) : [];
2671
+ },
2672
+ fromSelection(i) {
2673
+ const t = {};
2674
+ return Object.values(e.groupKeys).forEach((o) => {
2675
+ t[o] = [];
2676
+ }), i.nodes.forEach((o, a) => {
2677
+ const v = y(o), S = v ? e.groupKeys[v] : void 0, b = i.keys[a];
2678
+ S && b !== void 0 && t[S].push(b);
2679
+ }), t;
2680
+ }
2681
+ };
2682
+ }
2683
+ const pn = {
2684
+ key: 0,
2685
+ class: "wui-member-selector__summary"
2686
+ }, mn = {
2687
+ key: 0,
2688
+ class: "wui-member-selector__summary-list"
2689
+ }, vn = {
2690
+ key: 1,
2691
+ class: "wui-member-selector__summary-empty"
2692
+ }, _n = { class: "wui-member-selector" }, gn = { class: "wui-member-selector__panel" }, yn = { class: "wui-member-selector__search-row" }, hn = { class: "wui-member-selector__node-label" }, bn = { class: "wui-member-selector__panel wui-member-selector__selection-panel" }, wn = { class: "wui-member-selector__selection-title" }, xn = {
2693
+ key: 0,
2694
+ class: "wui-member-selector__selected-list"
2695
+ }, kn = ["aria-label", "onClick"], Cn = {
2696
+ key: 1,
2697
+ class: "wui-member-selector__empty"
2698
+ }, Sn = /* @__PURE__ */ ee({
2699
+ name: "MemberSelector",
2700
+ __name: "index",
2701
+ props: {
2702
+ visible: { type: Boolean, default: !1 },
2703
+ modelValue: {},
2704
+ treeData: {},
2705
+ loadTree: {},
2706
+ valueAdapter: {},
2707
+ fields: { default: () => ({}) },
2708
+ title: { default: "选择成员" },
2709
+ selectedTitle: { default: "已选择的成员" },
2710
+ multiple: { type: Boolean, default: !0 },
2711
+ showUsers: { type: Boolean, default: !0 },
2712
+ allowedTypes: { default: () => [] },
2713
+ isSelectable: {},
2714
+ nodeLabel: {},
2715
+ defaultExpandedKeys: { default: () => [] },
2716
+ showSummary: { type: Boolean, default: !1 },
2717
+ summaryActionText: { default: "修改" },
2718
+ disabled: { type: Boolean, default: !1 },
2719
+ required: { type: Boolean, default: !1 },
2720
+ requiredMessage: { default: "请至少选择一项。" },
2721
+ emptyText: { default: "暂无可选择的数据" }
2722
+ },
2723
+ emits: ["update:visible", "update:modelValue", "selection-change", "confirm", "cancel", "load", "load-error", "invalid"],
2724
+ setup(e, { expose: y, emit: i }) {
2725
+ const t = e, o = i, a = ot(), v = Object.prototype.hasOwnProperty.call(
2726
+ (a == null ? void 0 : a.vnode.props) ?? {},
2727
+ "visible"
2728
+ ), S = K(!1), b = K(), z = K(""), G = K([]), h = K([]), g = K(!1), L = K();
2729
+ let P, B = 0;
2730
+ const J = k(() => t.treeData ?? G.value), ne = k(() => Nt(J.value, t.fields)), R = {
2731
+ children: "children",
2732
+ label: "label"
2733
+ }, D = k(() => ne.value.rootKeys.map((m) => f(m)).filter((m) => m !== void 0).map(_).filter((m) => m !== void 0)), A = k(() => be(h.value)), s = k(() => v ? t.visible : S.value);
2734
+ function n(m) {
2735
+ return nt(m);
2736
+ }
2737
+ function f(m) {
2738
+ return ne.value.nodeByToken.get(n(m));
2739
+ }
2740
+ function p(m) {
2741
+ var M;
2742
+ return (M = ne.value.nodes.find((re) => re.source === m)) == null ? void 0 : M.key;
2743
+ }
2744
+ function x(m) {
2745
+ const M = p(m);
2746
+ return M === void 0 ? `node:${Y(m)}` : n(M);
2747
+ }
2748
+ function W(m) {
2749
+ const M = ne.value.nodes.find((re) => re.source === m);
2750
+ return M == null ? void 0 : M.type;
2751
+ }
2752
+ function Y(m) {
2753
+ var M, re;
2754
+ return ((M = t.nodeLabel) == null ? void 0 : M.call(t, m)) ?? ((re = ne.value.nodes.find((pe) => pe.source === m)) == null ? void 0 : re.label) ?? "";
2755
+ }
2756
+ function _(m) {
2757
+ var re;
2758
+ if (!t.showUsers && m.type === "user")
2759
+ return;
2760
+ const M = m.childKeys.map((pe) => f(pe)).filter((pe) => pe !== void 0).map(_).filter((pe) => pe !== void 0);
2761
+ return {
2762
+ key: m.key,
2763
+ label: ((re = t.nodeLabel) == null ? void 0 : re.call(t, m.source)) ?? m.label,
2764
+ type: m.type,
2765
+ source: m.source,
2766
+ children: M
2767
+ };
2768
+ }
2769
+ function H(m) {
2770
+ if (typeof m != "object" || m === null)
2771
+ return !1;
2772
+ const M = m;
2773
+ return Kt(M.key) && typeof M.label == "string" && typeof M.source == "object" && M.source !== null && Array.isArray(M.children);
2774
+ }
2775
+ function ie(m) {
2776
+ var M, re;
2777
+ return t.disabled || (M = f(m.key)) != null && M.disabled || t.allowedTypes.length && (!m.type || !t.allowedTypes.includes(m.type)) ? !1 : ((re = t.isSelectable) == null ? void 0 : re.call(t, m.source)) ?? !0;
2778
+ }
2779
+ function ce(m) {
2780
+ return h.value.some((M) => n(M) === n(m));
2781
+ }
2782
+ function me(m) {
2783
+ const M = /* @__PURE__ */ new Set(), re = m.filter((pe) => {
2784
+ const Me = n(pe);
2785
+ return M.has(Me) ? !1 : (M.add(Me), !0);
2786
+ });
2787
+ return t.multiple ? re : re.slice(0, 1);
2788
+ }
2789
+ function be(m) {
2790
+ const M = [], re = [];
2791
+ return me(m).forEach((pe) => {
2792
+ const Me = f(pe);
2793
+ Me && (M.push(Me.key), re.push(Me.source));
2794
+ }), { keys: M, nodes: re };
2795
+ }
2796
+ function Le() {
2797
+ return t.valueAdapter ?? fn;
2798
+ }
2799
+ function Te(m) {
2800
+ h.value = me(m);
2801
+ const M = be(h.value);
2802
+ o("update:modelValue", Le().fromSelection(M)), o("selection-change", M);
2803
+ }
2804
+ function Ne(m) {
2805
+ if (!H(m) || !ie(m))
2806
+ return;
2807
+ const M = ce(m.key);
2808
+ let re;
2809
+ t.multiple ? re = M ? h.value.filter((pe) => n(pe) !== n(m.key)) : [...h.value, m.key] : re = M ? [] : [m.key], Te(re);
2810
+ }
2811
+ function Be(m) {
2812
+ if (t.disabled)
2813
+ return;
2814
+ const M = p(m);
2815
+ M !== void 0 && Te(h.value.filter((re) => n(re) !== n(M)));
2816
+ }
2817
+ function E() {
2818
+ h.value.length && Te([]);
2819
+ }
2820
+ function $(m, M) {
2821
+ return m ? H(M) ? M.label.toLocaleLowerCase().includes(m.trim().toLocaleLowerCase()) : !1 : !0;
2822
+ }
2823
+ function X(m) {
2824
+ return typeof m == "object" && m !== null && "filter" in m && typeof m.filter == "function";
2825
+ }
2826
+ function O(m) {
2827
+ X(m) && (b.value = m);
2828
+ }
2829
+ function se() {
2830
+ P == null || P.abort(), P = void 0;
2831
+ }
2832
+ function ue(m) {
2833
+ return typeof m == "object" && m !== null && "name" in m && m.name === "AbortError";
2834
+ }
2835
+ function Z(m) {
2836
+ return m instanceof Error && m.message ? m.message : "成员数据加载失败,请重试。";
2837
+ }
2838
+ async function Pe() {
2839
+ var re;
2840
+ if (se(), L.value = void 0, t.treeData !== void 0 || !t.loadTree)
2841
+ return;
2842
+ const m = new AbortController(), M = ++B;
2843
+ P = m, g.value = !0;
2844
+ try {
2845
+ const pe = await t.loadTree({
2846
+ signal: m.signal,
2847
+ showUsers: t.showUsers
2848
+ });
2849
+ if (m.signal.aborted || M !== B)
2850
+ return;
2851
+ G.value = [...pe], o("load", G.value), await mt(), (re = b.value) == null || re.filter(z.value);
2852
+ } catch (pe) {
2853
+ !m.signal.aborted && M === B && !ue(pe) && (L.value = pe, o("load-error", pe));
2854
+ } finally {
2855
+ M === B && (g.value = !1, P = void 0);
2856
+ }
2857
+ }
2858
+ function Re(m) {
2859
+ v || (S.value = m), o("update:visible", m);
2860
+ }
2861
+ function Ie() {
2862
+ t.disabled || Re(!0);
2863
+ }
2864
+ function F() {
2865
+ Re(!1);
2866
+ }
2867
+ function oe() {
2868
+ o("cancel"), F();
2869
+ }
2870
+ function ve() {
2871
+ const m = be(h.value);
2872
+ if (t.required && !m.keys.length) {
2873
+ o("invalid", t.requiredMessage);
2874
+ return;
2875
+ }
2876
+ o("confirm", m), F();
2877
+ }
2878
+ function $e() {
2879
+ var m;
2880
+ z.value = "", (m = b.value) == null || m.filter("");
2881
+ }
2882
+ return y({
2883
+ clear: E,
2884
+ reload: Pe,
2885
+ getSelection: () => be(h.value),
2886
+ open: Ie,
2887
+ close: F
2888
+ }), he(
2889
+ [() => t.modelValue, () => t.valueAdapter, ne],
2890
+ () => {
2891
+ h.value = me(Le().toKeys(t.modelValue));
2892
+ },
2893
+ { deep: !0, immediate: !0 }
2894
+ ), he(z, (m) => {
2895
+ var M;
2896
+ (M = b.value) == null || M.filter(m);
2897
+ }), he(
2898
+ s,
2899
+ (m) => {
2900
+ m ? Pe() : (se(), g.value = !1);
2901
+ },
2902
+ { immediate: !0 }
2903
+ ), pt(() => {
2904
+ se();
2905
+ }), (m, M) => {
2906
+ const re = j("el-input"), pe = j("el-button"), Me = j("el-alert"), Ue = j("el-icon"), We = j("el-tree"), Fe = j("el-scrollbar"), Oe = j("el-dialog");
2907
+ return l(), u(ye, null, [
2908
+ e.showSummary ? (l(), u("div", pn, [
2909
+ Ce(m.$slots, "summary", {
2910
+ nodes: A.value.nodes,
2911
+ open: Ie,
2912
+ clear: E
2913
+ }, () => [
2914
+ A.value.nodes.length ? (l(), u("div", mn, [
2915
+ (l(!0), u(ye, null, Se(A.value.nodes, (ke) => (l(), u("span", {
2916
+ key: x(ke),
2917
+ class: "wui-member-selector__summary-item"
2918
+ }, I(Y(ke)), 1))), 128))
2919
+ ])) : (l(), u("p", vn, "未选择成员")),
2920
+ e.disabled ? N("", !0) : (l(), u("button", {
2921
+ key: 2,
2922
+ type: "button",
2923
+ class: "wui-member-selector__summary-action",
2924
+ onClick: Ie
2925
+ }, I(e.summaryActionText), 1))
2926
+ ], !0)
2927
+ ])) : N("", !0),
2928
+ T(Oe, {
2929
+ "model-value": s.value,
2930
+ title: e.title,
2931
+ width: "min(760px, calc(100vw - 32px))",
2932
+ class: "wui-member-selector__dialog",
2933
+ "onUpdate:modelValue": Re,
2934
+ onClosed: $e
2935
+ }, {
2936
+ footer: C(() => [
2937
+ T(pe, { onClick: oe }, {
2938
+ default: C(() => [...M[3] || (M[3] = [
2939
+ Ve("取消", -1)
2940
+ ])]),
2941
+ _: 1
2942
+ }),
2943
+ T(pe, {
2944
+ type: "primary",
2945
+ disabled: e.disabled,
2946
+ onClick: ve
2947
+ }, {
2948
+ default: C(() => [...M[4] || (M[4] = [
2949
+ Ve("确定", -1)
2950
+ ])]),
2951
+ _: 1
2952
+ }, 8, ["disabled"])
2953
+ ]),
2954
+ default: C(() => [
2955
+ d("div", _n, [
2956
+ d("div", gn, [
2957
+ d("div", yn, [
2958
+ T(re, {
2959
+ modelValue: z.value,
2960
+ "onUpdate:modelValue": M[0] || (M[0] = (ke) => z.value = ke),
2961
+ clearable: "",
2962
+ "prefix-icon": q(Bt),
2963
+ placeholder: e.showUsers ? "搜索成员或组织" : "搜索组织"
2964
+ }, null, 8, ["modelValue", "prefix-icon", "placeholder"]),
2965
+ e.loadTree ? (l(), le(pe, {
2966
+ key: 0,
2967
+ loading: g.value,
2968
+ disabled: e.disabled,
2969
+ text: "",
2970
+ onClick: Pe
2971
+ }, {
2972
+ default: C(() => [...M[1] || (M[1] = [
2973
+ Ve(" 刷新 ", -1)
2974
+ ])]),
2975
+ _: 1
2976
+ }, 8, ["loading", "disabled"])) : N("", !0)
2977
+ ]),
2978
+ L.value ? (l(), le(Me, {
2979
+ key: 0,
2980
+ type: "error",
2981
+ title: Z(L.value),
2982
+ closable: !1,
2983
+ class: "wui-member-selector__error"
2984
+ }, {
2985
+ default: C(() => [
2986
+ T(pe, {
2987
+ type: "danger",
2988
+ link: "",
2989
+ onClick: Pe
2990
+ }, {
2991
+ default: C(() => [...M[2] || (M[2] = [
2992
+ Ve("重试", -1)
2993
+ ])]),
2994
+ _: 1
2995
+ })
2996
+ ]),
2997
+ _: 1
2998
+ }, 8, ["title"])) : N("", !0),
2999
+ T(Fe, { class: "wui-member-selector__tree-scroll" }, {
3000
+ default: C(() => [
3001
+ T(We, {
3002
+ ref: O,
3003
+ data: D.value,
3004
+ "node-key": "key",
3005
+ props: R,
3006
+ "default-expanded-keys": e.defaultExpandedKeys,
3007
+ "expand-on-click-node": !1,
3008
+ "filter-node-method": $,
3009
+ "empty-text": g.value ? "正在加载..." : e.emptyText,
3010
+ onNodeClick: Ne
3011
+ }, {
3012
+ default: C(({ data: ke }) => [
3013
+ H(ke) ? Ce(m.$slots, "node", {
3014
+ key: 0,
3015
+ node: ke.source,
3016
+ selected: ce(ke.key),
3017
+ selectable: ie(ke)
3018
+ }, () => [
3019
+ T(Ue, { class: "wui-member-selector__node-icon" }, {
3020
+ default: C(() => [
3021
+ ke.type === "user" ? (l(), le(q(kt), { key: 0 })) : (l(), le(q(xt), { key: 1 }))
3022
+ ]),
3023
+ _: 2
3024
+ }, 1024),
3025
+ d("span", hn, I(ke.label), 1),
3026
+ ce(ke.key) ? (l(), le(Ue, {
3027
+ key: 0,
3028
+ class: "wui-member-selector__selected-icon"
3029
+ }, {
3030
+ default: C(() => [
3031
+ T(q(xl))
3032
+ ]),
3033
+ _: 1
3034
+ })) : N("", !0)
3035
+ ], !0) : N("", !0)
3036
+ ]),
3037
+ _: 3
3038
+ }, 8, ["data", "default-expanded-keys", "empty-text"])
3039
+ ]),
3040
+ _: 3
3041
+ })
3042
+ ]),
3043
+ d("div", bn, [
3044
+ d("div", wn, I(e.selectedTitle), 1),
3045
+ T(Fe, { class: "wui-member-selector__selected-scroll" }, {
3046
+ default: C(() => [
3047
+ A.value.nodes.length ? (l(), u("div", xn, [
3048
+ (l(!0), u(ye, null, Se(A.value.nodes, (ke) => (l(), u("div", {
3049
+ key: x(ke),
3050
+ class: "wui-member-selector__selected-item"
3051
+ }, [
3052
+ Ce(m.$slots, "selected-item", {
3053
+ node: ke,
3054
+ remove: Be
3055
+ }, () => [
3056
+ T(Ue, { class: "wui-member-selector__node-icon" }, {
3057
+ default: C(() => [
3058
+ W(ke) === "user" ? (l(), le(q(kt), { key: 0 })) : (l(), le(q(xt), { key: 1 }))
3059
+ ]),
3060
+ _: 2
3061
+ }, 1024),
3062
+ d("span", null, I(Y(ke)), 1),
3063
+ e.disabled ? N("", !0) : (l(), u("button", {
3064
+ key: 0,
3065
+ type: "button",
3066
+ class: "wui-member-selector__remove",
3067
+ "aria-label": `移除 ${Y(ke)}`,
3068
+ onClick: (tt) => Be(ke)
3069
+ }, [
3070
+ T(Ue, null, {
3071
+ default: C(() => [
3072
+ T(q(qe))
3073
+ ]),
3074
+ _: 1
3075
+ })
3076
+ ], 8, kn))
3077
+ ], !0)
3078
+ ]))), 128))
3079
+ ])) : (l(), u("p", Cn, "尚未选择成员"))
3080
+ ]),
3081
+ _: 3
3082
+ })
3083
+ ])
3084
+ ])
3085
+ ]),
3086
+ _: 3
3087
+ }, 8, ["model-value", "title"])
3088
+ ], 64);
3089
+ };
3090
+ }
3091
+ }), Vn = /* @__PURE__ */ Ae(Sn, [["__scopeId", "data-v-d6b57fec"]]), An = xe(Vn, "MemberSelector"), yt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAACtRJREFUeF7NW2tsFNcV/s6d2V3bGCg2IRCTqILyDJgAgdCqDiWYRCJVVSoFUCP1ByVFVaRWiPyhSYSilOZPoqRSIrWyy58qCkGpiFQFKcEIgvOAxBACFAzUVG0hCQ/bmPixr5lTzXjHzNyZ3bPjNajzx49759xzv/O8554h3OaHL6EeGaywgdlsYyYIM5hRB6CWCOOc5ZkxAKAfhB5iXCSFLgbOGykcoenovp0s0u0gzhfRmLewjhhNAOaWuwaRCwacnwVgAIVOZrSbBvbSDJwsl1a588YMAL6KWvsmnrQZG4kxy2HAIc6Fn+6GfP8rl0H/PAYuKIXdagLepCnoHw0N/Z2KAeAuTMznsVkRNjEwcSyYkmgQ0GczdpkmWmkm+qT5pcZHDQAzyOrCes7jWVKuTYcfSeS6iugU9Pe1+Wyjh0zsNGZiD5GrYLGfUQHA/0VDfhBvEPBgqRU9e3Z+uiah2XhovwX7L3v+LZPqMGvwNN2Ly3ERiA0An8OyPKOVgHpxMV1i+gY1HyE6jRJOhYFuk7CZ5uBzkS/fhFgA5M9hIyy8BIVEpMZLEpRUWnhf1ChGDgrbzTnYXS4IZQHADMM+j+fYxlOaVx4RWpTX1yUa2oCuAeVyXWSehy8ptKjZ+D0RLImkCICz+dwZtBJhTaU2LElQHw+FrIg8weMpJADGfmM+NksgiABYZ7GDeVjycZ26oPGx6cUMEo7TbTHm4YVRh8H8GWwE8DLbBS+uAOd3UsN/e79746K6Vfi+RD9qnBSeMecX9wlFNSB7GssUYQ/bSLi2XEZmJ2Z+ggqJJqZlkqH1IpwoCDnDxPpi0SESAD6HhlwW+xRQP5apbFybjivxYgKwge5EEmtpTjhPCAHgZHj5U9iLqCRHytzichzTSUQdlvxOMJRH+PkhdJj3Y52eMYYAyJ/CBma8EncvYzJfAiTuIho9UthmLsTbQVx8fzkHm9wA2mn4vC4/ktFXOh6ymWDiYDOgCHB+Oo/jmx1/XfDRoeMoAz2JcWjyH6ACGpA7gW0AtnpOT0YgOCPEUIE5h0nnkcbF9cZCQxivJh64peEjAPBp1OZtHIV960jroVmIgiH+QogLEvMHftXw2gQ1+bfj/a9Yl7fesK6/NjAiQQkRQcOi+CeFvoTCQ7RguJ4wAoB1EltsG89La5Ya1xfUAfKPG9N2jjem/G5CAIBLv+rh7pahcgGX1ivGq1J40WjEnwMApL/AQYMwy1PTqJdHu6BHKwDAXdtrjXv+ECigWP/5eTf3vpUerRB0E9OjgicQYlxILsaqEQAyp9CoLOyL61Qkmy41rib/pkY1/HGSf7P5iz+5bt/8e6ao5Cr0KQF+TKxNLcRJ1wRyx7ADKnjSi3JaxRD1bFbSED8DRv2mauO+vwSijfXPVde4/1A2SmOivHyc9dz3/QDaaEksxQvDABxHmx2jeusxGCAY4eVLqbIxaX2V8d23A0WV/LnlVzH4ec7zAaV8SBTtOPwooDOxBM3EZ1GfHcKXkXFUWyVkY4LXD23AF7fVhLUp83vvTQ44wbPzvrHSndaIRmlxXtRAPS8QTCZZg0WU78DjFg17xLhPXAn56avah5Pm7A/vCviA0/d+bWcvFQsCoURHCtPSfgzGFsoew1aCmwCFEhWJQGg8Ruanqheb5rzjd/tpZE9M+grWjZHqbkilfdme+56WGMUxATcCEF5xAHidLfzUJSiJNO54CQRVarZhLjg3NQDAMfMybMuXy+o2qCEgZmKlRUiMdynzGfYBaCxL2nEBKKWjiakq+cDX07x12c5w7ljVVwE+pPUkpuX3T1LmKI6AMF2iFaVyUmoeGvfX9IxaSi759p6Rda1eK3u87hs/H1INMVRTE0wwxI/CJUp/htPE+E6ESZU8XpcFWMlJhORy2wFgOB3PXs5nT0y/Ujnd4hQiBHKDskfxL+ZCnV+6yIhTlS2jiJpaNjgNqtqNepw+l8t+Ofdq0SpvBD2xQKJhoSsIEXIBAESVG2PxJJdemwpzsuECMPBFNntqybUAAGN8laaz7wKQOYLTXDCBUMVLKIGJdXzhejy5+N93U+o+02HM/vajTP5M03W9PyBQ8hIkGrtsT7hBmU9xBBh2ghKBEILCBqUSYmLRP6ZQ9Xz3mo1vfDCU63ysx1+E1deTnK40P0IDLjkAFA2D0oISYFJelFzYMZnGLU25GtCzdzB3/me93jtR1ibRG4WATlL6E7wOFBIhXcUEpxeBaKjFpZQKJxccqqfxK6tcAK79dSDf9Qs3DfSqNJJPkkywDJf1LqU/xVbi4VQ4RFCDvJyLiFI2rHttc+57dWrS2mpnbevKn/rzXb/uK33bqm1Jr/rqAhNacpSTCqc/xuNA4TAUV8fKgLjUFKP+iSqqWeg6Qe7/OGv1vj9SC4g0gZgaWQZ7W9zjcKZ7+Dgcu0FB8joSoJWOSyara4CmMal6LHLNLduONpvKb2crA9nypySmKuIsc94NAHfsUYzOZBOaXQAy7djBCJfEQtxIcS1GBwglG1Ry3jt1NH7FcBTo3Z/OdW7ogd3LXrtTybOEazeCkZfObFuqmwolscxhNDK54fCOPcn736+jSY+6DtB77Cu7+nMXfllR25ufnn5971zre/8jxtrUw4WiqPNS+jAOgjCr1P2/ZLI6eiGF8R1PU9/vnwZjXOAOhAc7c5mOeVcD11U+olJeIkrv1voXqpp8ZXHXD3yELVYez8fJxcUFtQn+MJta3jmFqucEmq3svoPp7IlHur1W2ZCPrbSJqkBQGXgx+UPtYoQPojarcJS5eLenZHISIH6NMOp/nDLn/60eKukKnO00508+dt2+eThb1AfETL2j+CVCX8rGQ7RKuxpzmBg8iG2KsNVrVAyptHQcFk5vIYBqFprmlCeq2M7AuvrWENIXrTiJlJQpRmqQwqtVKyMuR10p7MfEoQTaVeF6XFpA1AjBaKXMUqrIiD5JW58VeqpzaKI1t/qLQ/4m8yE22FZ5DRJSQUIal0wmrgZK850GidTKEg0SrhYwaOgQ9hLjQTHsa04ptCFJRNJZQ8jkJA3x5wlM6KheVUaLjAvCJ2jIDGEfl9MPXEKM0v7jaoAk4WKnQwK6U9VYSz8oo0nKWyR7CMtsC3sY0X3BlTJ/p953yl5KYX3yR9FN1MVyDpe/wYPYSDZeHmG24kzkNm87gj9mPFPTPIpGSY/VzAHssAutsnFPi1IU0XP5ivHVbE4BLanVFbTKFpyikT6AVjDWiE5HELAIyNgqyP6q1WPQLD0CQhueA/DUWBYtQ4mK1AorjHsCUgotyUfGqF3ez+RgGzYqGy95jlE8rmo7FL8XkMKGFJdt5NjA9lI2H4okcbVuoA3LDAutTOFPZiQbjjuu+4hQYuXXCEa3aWBzsvk2fjLjgTV4AA3I4Q1Q8KMpKfOTxqU4X9RpMjqQwNM1q+/AR1Mek07GmP0A6y3gWdhFWmu16+mQhhe+PRj53kC67w93RfUYwM7ko3f4szm/pNwDlIXNxNgEYGKgrh/zS1HJxH20+5iwq9pAq/9gE9ecnfklE6E4BJ16QiaHJ9nCRi58OiudDcTToEaACBfIwO5UAm965/k4PEbNHTMA/MQzbWi0c1gHoIm5smozEToBtKsE9qaa/48/ni4mCW5DfSaNFTAwG8BMZswAUGcDtcr5fJ4BmzCgCP1wPoUlXATQBQvnU1U4Qs239/P5/wGEp/UBA3POzQAAAABJRU5ErkJggg==", $n = { class: "wui-input-dialog__header" }, Tn = ["src"], En = { class: "wui-input-dialog__title" }, Bn = { class: "wui-input-dialog__content" }, Ln = ["placeholder"], Mn = /* @__PURE__ */ ee({
3092
+ name: "Reject",
3093
+ __name: "reject",
3094
+ props: {
3095
+ show: { type: Boolean, default: !1 },
3096
+ title: { default: "提示" },
3097
+ content: { default: "当前操作不可恢复,确认拒绝吗?" },
3098
+ reasonPlaceholder: { default: "请输入原因" }
3099
+ },
3100
+ emits: ["cancel", "confirm"],
3101
+ setup(e, { emit: y }) {
3102
+ const i = e, t = y, o = K("");
3103
+ he(
3104
+ () => i.show,
3105
+ (b) => {
3106
+ b && (o.value = "");
3107
+ }
3108
+ );
3109
+ function a(b) {
3110
+ b || v();
3111
+ }
3112
+ function v() {
3113
+ t("cancel");
3114
+ }
3115
+ function S() {
3116
+ if (!o.value.trim()) {
3117
+ At({ type: "info", message: "请输入拒绝原因" });
3118
+ return;
3119
+ }
3120
+ t("confirm", "reject", o.value);
3121
+ }
3122
+ return (b, z) => {
3123
+ const G = j("el-icon"), h = j("el-dialog");
3124
+ return l(), le(h, {
3125
+ "model-value": e.show,
3126
+ width: "520px",
3127
+ "show-close": !1,
3128
+ class: "wui-reject-dialog",
3129
+ "onUpdate:modelValue": a
3130
+ }, {
3131
+ default: C(() => [
3132
+ d("div", $n, [
3133
+ d("img", {
3134
+ class: "wui-input-dialog__icon",
3135
+ src: q(yt),
3136
+ alt: ""
3137
+ }, null, 8, Tn),
3138
+ d("h2", En, I(e.title), 1),
3139
+ d("button", {
3140
+ class: "wui-input-dialog__close",
3141
+ type: "button",
3142
+ "aria-label": "关闭",
3143
+ onClick: v
3144
+ }, [
3145
+ T(G, null, {
3146
+ default: C(() => [
3147
+ T(q(qe))
3148
+ ]),
3149
+ _: 1
3150
+ })
3151
+ ])
3152
+ ]),
3153
+ d("p", Bn, I(e.content), 1),
3154
+ et(d("textarea", {
3155
+ "onUpdate:modelValue": z[0] || (z[0] = (g) => o.value = g),
3156
+ class: "wui-input-dialog__textarea",
3157
+ placeholder: e.reasonPlaceholder,
3158
+ rows: "4"
3159
+ }, null, 8, Ln), [
3160
+ [vt, o.value]
3161
+ ]),
3162
+ d("footer", { class: "wui-input-dialog__actions" }, [
3163
+ d("button", {
3164
+ class: "wui-input-dialog__button wui-input-dialog__button--cancel",
3165
+ type: "button",
3166
+ onClick: v
3167
+ }, "取消"),
3168
+ d("button", {
3169
+ class: "wui-input-dialog__button wui-input-dialog__button--confirm",
3170
+ type: "button",
3171
+ onClick: S
3172
+ }, "确认")
3173
+ ])
3174
+ ]),
3175
+ _: 1
3176
+ }, 8, ["model-value"]);
3177
+ };
3178
+ }
3179
+ }), Kn = /* @__PURE__ */ Ae(Mn, [["__scopeId", "data-v-d7bd1299"]]), Nn = {
3180
+ key: 0,
3181
+ class: "wui-tips__mask",
3182
+ "aria-hidden": "true"
3183
+ }, Pn = ["aria-label"], In = { class: "wui-tips__header" }, zn = ["src"], Rn = { class: "wui-tips__title" }, Un = { class: "wui-tips__content" }, Fn = {
3184
+ key: 0,
3185
+ class: "wui-tips__actions"
3186
+ }, On = /* @__PURE__ */ ee({
3187
+ name: "Tips",
3188
+ __name: "tips",
3189
+ props: {
3190
+ modelValue: { type: Boolean, default: !1 },
3191
+ title: { default: "提示" },
3192
+ content: { default: "" },
3193
+ cancelText: { default: "取消" },
3194
+ confirmText: { default: "确认" },
3195
+ confirmStatus: { type: Boolean, default: !0 },
3196
+ cancelStatus: { type: Boolean, default: !0 }
3197
+ },
3198
+ emits: ["cancel", "confirm"],
3199
+ setup(e, { emit: y }) {
3200
+ const i = y;
3201
+ function t() {
3202
+ i("cancel");
3203
+ }
3204
+ function o() {
3205
+ i("confirm");
3206
+ }
3207
+ return (a, v) => {
3208
+ const S = j("el-icon");
3209
+ return l(), u(ye, null, [
3210
+ e.modelValue ? (l(), u("div", Nn)) : N("", !0),
3211
+ e.modelValue ? (l(), u("section", {
3212
+ key: 1,
3213
+ class: "wui-tips",
3214
+ role: "dialog",
3215
+ "aria-modal": "true",
3216
+ "aria-label": e.title
3217
+ }, [
3218
+ d("header", In, [
3219
+ d("img", {
3220
+ class: "wui-tips__icon",
3221
+ src: q(yt),
3222
+ alt: ""
3223
+ }, null, 8, zn),
3224
+ d("h2", Rn, I(e.title), 1),
3225
+ d("button", {
3226
+ class: "wui-tips__close",
3227
+ type: "button",
3228
+ "aria-label": "关闭",
3229
+ onClick: t
3230
+ }, [
3231
+ T(S, { size: 16 }, {
3232
+ default: C(() => [
3233
+ T(q(qe))
3234
+ ]),
3235
+ _: 1
3236
+ })
3237
+ ])
3238
+ ]),
3239
+ d("p", Un, I(e.content), 1),
3240
+ e.cancelStatus || e.confirmStatus ? (l(), u("footer", Fn, [
3241
+ e.cancelStatus ? (l(), u("button", {
3242
+ key: 0,
3243
+ class: "wui-tips__button wui-tips__button--cancel",
3244
+ type: "button",
3245
+ onClick: t
3246
+ }, I(e.cancelText), 1)) : N("", !0),
3247
+ e.confirmStatus ? (l(), u("button", {
3248
+ key: 1,
3249
+ class: "wui-tips__button wui-tips__button--confirm",
3250
+ type: "button",
3251
+ onClick: o
3252
+ }, I(e.confirmText), 1)) : N("", !0)
3253
+ ])) : N("", !0)
3254
+ ], 8, Pn)) : N("", !0)
3255
+ ], 64);
3256
+ };
3257
+ }
3258
+ }), Dn = /* @__PURE__ */ Ae(On, [["__scopeId", "data-v-cc730103"]]), jn = { class: "wui-input-dialog__header" }, Hn = ["src"], Qn = { class: "wui-input-dialog__title" }, qn = { class: "wui-tips-input-dialog__content-row" }, Gn = { class: "wui-input-dialog__content" }, Xn = ["placeholder"], Wn = /* @__PURE__ */ ee({
3259
+ name: "TipsInput",
3260
+ __name: "tipsInput",
3261
+ props: {
3262
+ show: { type: Boolean, default: !1 },
3263
+ title: { default: "提示" },
3264
+ content: { default: "密码以短信方式发送至" },
3265
+ inputPlaceholder: { default: "请输入" }
3266
+ },
3267
+ emits: ["cancel", "confirm"],
3268
+ setup(e, { emit: y }) {
3269
+ const i = e, t = y, o = K("");
3270
+ he(
3271
+ () => i.show,
3272
+ (b) => {
3273
+ b && (o.value = "");
3274
+ }
3275
+ );
3276
+ function a(b) {
3277
+ b || v();
3278
+ }
3279
+ function v() {
3280
+ t("cancel");
3281
+ }
3282
+ function S() {
3283
+ if (!o.value.trim()) {
3284
+ At({ type: "info", message: "请输入内容" });
3285
+ return;
3286
+ }
3287
+ t("confirm", o.value);
3288
+ }
3289
+ return (b, z) => {
3290
+ const G = j("el-icon"), h = j("el-dialog");
3291
+ return l(), le(h, {
3292
+ "model-value": e.show,
3293
+ width: "520px",
3294
+ "show-close": !1,
3295
+ class: "wui-tips-input-dialog",
3296
+ "onUpdate:modelValue": a
3297
+ }, {
3298
+ default: C(() => [
3299
+ d("div", jn, [
3300
+ d("img", {
3301
+ class: "wui-input-dialog__icon",
3302
+ src: q(yt),
3303
+ alt: ""
3304
+ }, null, 8, Hn),
3305
+ d("h2", Qn, I(e.title), 1),
3306
+ d("button", {
3307
+ class: "wui-input-dialog__close",
3308
+ type: "button",
3309
+ "aria-label": "关闭",
3310
+ onClick: v
3311
+ }, [
3312
+ T(G, null, {
3313
+ default: C(() => [
3314
+ T(q(qe))
3315
+ ]),
3316
+ _: 1
3317
+ })
3318
+ ])
3319
+ ]),
3320
+ d("div", qn, [
3321
+ d("p", Gn, I(e.content), 1),
3322
+ et(d("input", {
3323
+ "onUpdate:modelValue": z[0] || (z[0] = (g) => o.value = g),
3324
+ class: "wui-tips-input-dialog__input",
3325
+ placeholder: e.inputPlaceholder
3326
+ }, null, 8, Xn), [
3327
+ [vt, o.value]
3328
+ ])
3329
+ ]),
3330
+ d("footer", { class: "wui-input-dialog__actions" }, [
3331
+ d("button", {
3332
+ class: "wui-input-dialog__button wui-input-dialog__button--cancel",
3333
+ type: "button",
3334
+ onClick: v
3335
+ }, "取消"),
3336
+ d("button", {
3337
+ class: "wui-input-dialog__button wui-input-dialog__button--confirm",
3338
+ type: "button",
3339
+ onClick: S
3340
+ }, "确认")
3341
+ ])
3342
+ ]),
3343
+ _: 1
3344
+ }, 8, ["model-value"]);
3345
+ };
3346
+ }
3347
+ }), Jn = /* @__PURE__ */ Ae(Wn, [["__scopeId", "data-v-927f2408"]]), Yn = xe(Dn, "Tips"), Zn = xe(Kn, "Reject"), eo = xe(Jn, "TipsInput"), to = ["aria-expanded", "aria-disabled"], lo = { class: "wui-multiple__tags" }, ao = {
3348
+ key: 0,
3349
+ class: "wui-multiple__collapsed-count"
3350
+ }, no = {
3351
+ key: 1,
3352
+ class: "wui-multiple__placeholder"
3353
+ }, oo = {
3354
+ key: 0,
3355
+ class: "wui-multiple-menu__actions"
3356
+ }, io = {
3357
+ key: 1,
3358
+ class: "wui-multiple-menu__empty"
3359
+ }, so = /* @__PURE__ */ ee({
3360
+ name: "Multiple",
3361
+ __name: "multiple",
3362
+ props: {
3363
+ list: { default: () => [] },
3364
+ modelValue: { default: () => [] },
3365
+ disabled: { type: Boolean, default: !1 },
3366
+ props: { default: () => ({ id: "id", name: "name" }) },
3367
+ collapse: { type: Boolean, default: !1 },
3368
+ isHandle: { type: Boolean, default: !1 },
3369
+ size: { default: "default" }
3370
+ },
3371
+ emits: ["update:modelValue", "change", "add", "remove"],
3372
+ setup(e, { emit: y }) {
3373
+ const i = e, t = y, o = K(null), a = K(), v = K(!1);
3374
+ function S(n) {
3375
+ return typeof n == "object" && n !== null && !Array.isArray(n);
3376
+ }
3377
+ function b(n) {
3378
+ return typeof n == "string" || typeof n == "number";
3379
+ }
3380
+ function z(n) {
3381
+ if (!S(n))
3382
+ return { id: n, name: String(n) };
3383
+ const f = n[i.props.id], p = n[i.props.name], x = b(f) ? f : String(f ?? ""), W = b(p) ? String(p) : String(f ?? "");
3384
+ return { id: x, name: W };
3385
+ }
3386
+ const G = k(() => i.list.map(z)), h = k(() => i.modelValue.map((n) => G.value.find((f) => f.id === n) ?? { id: n, name: String(n) })), g = k(() => i.collapse ? h.value.slice(0, 1) : h.value), L = k(() => i.collapse ? Math.max(0, h.value.length - g.value.length) : 0), P = k(() => a.value ? { width: `${a.value}px` } : void 0);
3387
+ function B(n, f) {
3388
+ return n.includes(f);
3389
+ }
3390
+ function J(n) {
3391
+ t("update:modelValue", n), t("change", n);
3392
+ }
3393
+ function ne(n) {
3394
+ if (i.disabled)
3395
+ return;
3396
+ const f = [...i.modelValue], p = f.indexOf(n);
3397
+ p >= 0 ? (f.splice(p, 1), t("remove", n)) : (f.push(n), t("add", n)), J(f);
3398
+ }
3399
+ function R(n) {
3400
+ if (i.disabled)
3401
+ return;
3402
+ const f = i.modelValue.indexOf(n);
3403
+ if (f < 0)
3404
+ return;
3405
+ const p = [...i.modelValue];
3406
+ p.splice(f, 1), t("remove", n), J(p);
3407
+ }
3408
+ function D() {
3409
+ if (i.disabled)
3410
+ return;
3411
+ const n = Array.from(new Set(G.value.map((p) => p.id)));
3412
+ n.filter((p) => !B(i.modelValue, p)).forEach((p) => t("add", p)), J(n);
3413
+ }
3414
+ function A() {
3415
+ if (i.disabled)
3416
+ return;
3417
+ const n = G.value.map((x) => x.id).filter((x) => !B(i.modelValue, x)), f = i.modelValue.filter((x) => !n.includes(x)), p = n.filter((x) => !B(i.modelValue, x));
3418
+ f.forEach((x) => t("remove", x)), p.forEach((x) => t("add", x)), J(n);
3419
+ }
3420
+ function s(n) {
3421
+ var f;
3422
+ v.value = n, n && (a.value = (f = o.value) == null ? void 0 : f.clientWidth);
3423
+ }
3424
+ return (n, f) => {
3425
+ const p = j("el-tag"), x = j("el-icon"), W = j("el-dropdown-item"), Y = j("el-dropdown-menu"), _ = j("el-dropdown");
3426
+ return l(), le(_, {
3427
+ class: "wui-multiple",
3428
+ placement: "bottom-start",
3429
+ trigger: "click",
3430
+ disabled: e.disabled,
3431
+ onCommand: ne,
3432
+ onVisibleChange: s
3433
+ }, {
3434
+ dropdown: C(() => [
3435
+ T(Y, {
3436
+ class: "wui-multiple-menu",
3437
+ style: Qe(P.value)
3438
+ }, {
3439
+ default: C(() => [
3440
+ e.isHandle ? (l(), u("div", oo, [
3441
+ Ce(n.$slots, "handle", {
3442
+ selectAll: D,
3443
+ invertSelection: A
3444
+ }, () => [
3445
+ d("button", {
3446
+ type: "button",
3447
+ onClick: ze(D, ["stop"])
3448
+ }, "全选"),
3449
+ d("button", {
3450
+ type: "button",
3451
+ onClick: ze(A, ["stop"])
3452
+ }, "反选")
3453
+ ], !0)
3454
+ ])) : N("", !0),
3455
+ (l(!0), u(ye, null, Se(G.value, (H) => (l(), le(W, {
3456
+ key: H.id,
3457
+ command: H.id,
3458
+ class: we({ "is-selected": B(e.modelValue, H.id) })
3459
+ }, {
3460
+ default: C(() => [
3461
+ d("span", null, I(H.name), 1),
3462
+ B(e.modelValue, H.id) ? (l(), le(x, {
3463
+ key: 0,
3464
+ class: "wui-multiple-menu__check"
3465
+ }, {
3466
+ default: C(() => [
3467
+ T(q(_t))
3468
+ ]),
3469
+ _: 1
3470
+ })) : N("", !0)
3471
+ ]),
3472
+ _: 2
3473
+ }, 1032, ["command", "class"]))), 128)),
3474
+ G.value.length ? N("", !0) : (l(), u("div", io, "暂无选项"))
3475
+ ]),
3476
+ _: 3
3477
+ }, 8, ["style"])
3478
+ ]),
3479
+ default: C(() => [
3480
+ d("div", {
3481
+ ref_key: "triggerRef",
3482
+ ref: o,
3483
+ class: we(["wui-multiple__trigger", { "is-disabled": e.disabled }]),
3484
+ role: "combobox",
3485
+ "aria-expanded": v.value,
3486
+ "aria-disabled": e.disabled,
3487
+ tabindex: "0"
3488
+ }, [
3489
+ d("div", lo, [
3490
+ h.value.length ? (l(), u(ye, { key: 0 }, [
3491
+ (l(!0), u(ye, null, Se(g.value, (H) => (l(), le(p, {
3492
+ key: H.id,
3493
+ size: "small",
3494
+ "disable-transitions": !0,
3495
+ closable: !e.disabled,
3496
+ onClose: (ie) => R(H.id)
3497
+ }, {
3498
+ default: C(() => [
3499
+ Ve(I(H.name), 1)
3500
+ ]),
3501
+ _: 2
3502
+ }, 1032, ["closable", "onClose"]))), 128)),
3503
+ L.value ? (l(), u("span", ao, " +" + I(L.value), 1)) : N("", !0)
3504
+ ], 64)) : (l(), u("span", no, "请选择"))
3505
+ ]),
3506
+ T(x, {
3507
+ class: we(["wui-multiple__arrow", { "is-open": v.value }])
3508
+ }, {
3509
+ default: C(() => [
3510
+ T(q($t))
3511
+ ]),
3512
+ _: 1
3513
+ }, 8, ["class"])
3514
+ ], 10, to)
3515
+ ]),
3516
+ _: 3
3517
+ }, 8, ["disabled"]);
3518
+ };
3519
+ }
3520
+ }), uo = /* @__PURE__ */ Ae(so, [["__scopeId", "data-v-6027373d"]]), ro = { class: "wui-multiple-create__content" }, co = ["disabled", "placeholder", "onKeydown"], fo = ["disabled"], po = {
3521
+ key: 0,
3522
+ class: "wui-multiple-create-menu__empty"
3523
+ }, mo = /* @__PURE__ */ ee({
3524
+ name: "MultipleCreate",
3525
+ __name: "multipleCreate",
3526
+ props: {
3527
+ list: { default: () => [] },
3528
+ modelValue: { default: () => [] },
3529
+ disabled: { type: Boolean, default: !1 },
3530
+ props: { default: () => ({ id: "id", name: "name" }) },
3531
+ repeat: { type: Boolean, default: !1 },
3532
+ maxlength: { default: 0 },
3533
+ size: { default: "default" }
3534
+ },
3535
+ emits: ["update:modelValue", "change", "add", "remove"],
3536
+ setup(e, { emit: y }) {
3537
+ const i = e, t = y, o = K(null), a = K(), v = K("");
3538
+ function S(A) {
3539
+ return typeof A == "object" && A !== null && !Array.isArray(A);
3540
+ }
3541
+ function b(A) {
3542
+ return typeof A == "string" || typeof A == "number";
3543
+ }
3544
+ function z(A) {
3545
+ if (!S(A))
3546
+ return { id: A, name: String(A) };
3547
+ const s = A[i.props.id], n = A[i.props.name], f = b(s) ? s : String(s ?? ""), p = b(n) ? String(n) : String(s ?? "");
3548
+ return { id: f, name: p };
3549
+ }
3550
+ const G = k(() => i.list.map(z)), h = k(() => {
3551
+ const A = v.value.trim().toLowerCase();
3552
+ return A ? G.value.filter((s) => s.name.toLowerCase().includes(A) || String(s.id).toLowerCase().includes(A)) : G.value;
3553
+ }), g = k(() => i.maxlength > 0 && i.modelValue.length >= i.maxlength), L = k(() => a.value ? { width: `${a.value}px` } : void 0);
3554
+ function P(A) {
3555
+ t("update:modelValue", A), t("change", A);
3556
+ }
3557
+ function B(A) {
3558
+ var s;
3559
+ return ((s = G.value.find((n) => n.id === A)) == null ? void 0 : s.name) ?? String(A);
3560
+ }
3561
+ function J(A) {
3562
+ if (i.disabled)
3563
+ return;
3564
+ const s = [...i.modelValue], n = s.indexOf(A);
3565
+ if (n >= 0)
3566
+ s.splice(n, 1), t("remove", A);
3567
+ else if (!g.value)
3568
+ s.push(A), t("add", A);
3569
+ else
3570
+ return;
3571
+ P(s);
3572
+ }
3573
+ function ne(A) {
3574
+ if (i.disabled)
3575
+ return;
3576
+ const s = i.modelValue.indexOf(A);
3577
+ if (s < 0)
3578
+ return;
3579
+ const n = [...i.modelValue];
3580
+ n.splice(s, 1), t("remove", A), P(n);
3581
+ }
3582
+ function R() {
3583
+ if (i.disabled || g.value)
3584
+ return;
3585
+ const A = v.value.trim();
3586
+ if (!A || !i.repeat && i.modelValue.includes(A)) {
3587
+ v.value = "";
3588
+ return;
3589
+ }
3590
+ const s = [...i.modelValue, A];
3591
+ v.value = "", t("add", A), P(s);
3592
+ }
3593
+ function D(A) {
3594
+ var s;
3595
+ A && (a.value = (s = o.value) == null ? void 0 : s.clientWidth);
3596
+ }
3597
+ return (A, s) => {
3598
+ const n = j("el-tag"), f = j("el-icon"), p = j("el-dropdown-item"), x = j("el-dropdown-menu"), W = j("el-dropdown");
3599
+ return l(), le(W, {
3600
+ class: we(["wui-multiple-create", `wui-multiple-create--${e.size}`]),
3601
+ placement: "bottom-start",
3602
+ trigger: "click",
3603
+ disabled: e.disabled || !G.value.length,
3604
+ onCommand: J,
3605
+ onVisibleChange: D
3606
+ }, {
3607
+ dropdown: C(() => [
3608
+ T(x, {
3609
+ class: "wui-multiple-create-menu",
3610
+ style: Qe(L.value)
3611
+ }, {
3612
+ default: C(() => [
3613
+ (l(!0), u(ye, null, Se(h.value, (Y) => (l(), le(p, {
3614
+ key: Y.id,
3615
+ command: Y.id,
3616
+ class: we({ "is-selected": e.modelValue.includes(Y.id) })
3617
+ }, {
3618
+ default: C(() => [
3619
+ d("span", null, I(Y.name), 1),
3620
+ e.modelValue.includes(Y.id) ? (l(), le(f, {
3621
+ key: 0,
3622
+ class: "wui-multiple-create-menu__check"
3623
+ }, {
3624
+ default: C(() => [
3625
+ T(q(_t))
3626
+ ]),
3627
+ _: 1
3628
+ })) : N("", !0)
3629
+ ]),
3630
+ _: 2
3631
+ }, 1032, ["command", "class"]))), 128)),
3632
+ h.value.length ? N("", !0) : (l(), u("div", po, "暂无匹配选项"))
3633
+ ]),
3634
+ _: 1
3635
+ }, 8, ["style"])
3636
+ ]),
3637
+ default: C(() => [
3638
+ d("div", {
3639
+ ref_key: "triggerRef",
3640
+ ref: o,
3641
+ class: we(["wui-multiple-create__trigger", { "is-disabled": e.disabled }])
3642
+ }, [
3643
+ d("div", ro, [
3644
+ (l(!0), u(ye, null, Se(e.modelValue, (Y) => (l(), le(n, {
3645
+ key: String(Y),
3646
+ size: "small",
3647
+ closable: !e.disabled,
3648
+ "disable-transitions": !0,
3649
+ onClose: (_) => ne(Y)
3650
+ }, {
3651
+ default: C(() => [
3652
+ Ve(I(B(Y)), 1)
3653
+ ]),
3654
+ _: 2
3655
+ }, 1032, ["closable", "onClose"]))), 128)),
3656
+ e.disabled ? N("", !0) : et((l(), u("input", {
3657
+ key: 0,
3658
+ "onUpdate:modelValue": s[0] || (s[0] = (Y) => v.value = Y),
3659
+ class: "wui-multiple-create__input",
3660
+ disabled: g.value,
3661
+ placeholder: e.modelValue.length ? "" : "请输入或选择",
3662
+ onClick: s[1] || (s[1] = ze(() => {
3663
+ }, ["stop"])),
3664
+ onKeydown: qt(ze(R, ["prevent", "stop"]), ["enter"])
3665
+ }, null, 40, co)), [
3666
+ [vt, v.value]
3667
+ ])
3668
+ ]),
3669
+ d("button", {
3670
+ class: "wui-multiple-create__add",
3671
+ type: "button",
3672
+ disabled: e.disabled || g.value,
3673
+ "aria-label": "添加标签",
3674
+ onClick: ze(R, ["stop"])
3675
+ }, [
3676
+ T(f, null, {
3677
+ default: C(() => [
3678
+ T(q(gt))
3679
+ ]),
3680
+ _: 1
3681
+ })
3682
+ ], 8, fo)
3683
+ ], 2)
3684
+ ]),
3685
+ _: 1
3686
+ }, 8, ["class", "disabled"]);
3687
+ };
3688
+ }
3689
+ }), vo = /* @__PURE__ */ Ae(mo, [["__scopeId", "data-v-6f244a71"]]), _o = xe(uo, "Multiple"), go = xe(vo, "MultipleCreate"), yo = {
3690
+ key: 0,
3691
+ class: "wui-timeline-pro__header"
3692
+ }, ho = {
3693
+ key: 1,
3694
+ class: "wui-timeline-pro__list"
3695
+ }, bo = { class: "wui-timeline-pro__axis" }, wo = { class: "wui-timeline-pro__dot" }, xo = {
3696
+ key: 0,
3697
+ class: "wui-timeline-pro__line"
3698
+ }, ko = { class: "wui-timeline-pro__content" }, Co = { class: "wui-timeline-pro__main" }, So = { class: "wui-timeline-pro__title-row" }, Vo = {
3699
+ key: 0,
3700
+ class: "wui-timeline-pro__status"
3701
+ }, Ao = {
3702
+ key: 0,
3703
+ class: "wui-timeline-pro__description"
3704
+ }, $o = {
3705
+ key: 1,
3706
+ class: "wui-timeline-pro__footer"
3707
+ }, To = { key: 0 }, Eo = { key: 1 }, Bo = {
3708
+ key: 2,
3709
+ class: "wui-timeline-pro__meta"
3710
+ }, Lo = {
3711
+ key: 0,
3712
+ class: "wui-timeline-pro__item wui-timeline-pro__item--info is-pending"
3713
+ }, Mo = { class: "wui-timeline-pro__content" }, Ko = { class: "wui-timeline-pro__main" }, No = {
3714
+ key: 2,
3715
+ class: "wui-timeline-pro__empty"
3716
+ }, Po = /* @__PURE__ */ ee({
3717
+ name: "TimelinePro",
3718
+ __name: "index",
3719
+ props: {
3720
+ items: { default: () => [] },
3721
+ title: { default: "" },
3722
+ direction: { default: "vertical" },
3723
+ pending: { type: Boolean, default: !1 },
3724
+ pendingText: { default: "等待下一步操作" },
3725
+ emptyText: { default: "暂无时间线记录" },
3726
+ compact: { type: Boolean, default: !1 }
3727
+ },
3728
+ setup(e) {
3729
+ return (y, i) => (l(), u("div", {
3730
+ class: we([
3731
+ "wui-timeline-pro",
3732
+ `wui-timeline-pro--${e.direction}`,
3733
+ {
3734
+ "wui-timeline-pro--pending": e.pending,
3735
+ "wui-timeline-pro--compact": e.compact
3736
+ }
3737
+ ])
3738
+ }, [
3739
+ e.title || y.$slots.header ? (l(), u("div", yo, [
3740
+ Ce(y.$slots, "header", {}, () => [
3741
+ d("h3", null, I(e.title), 1)
3742
+ ], !0)
3743
+ ])) : N("", !0),
3744
+ e.items.length ? (l(), u("div", ho, [
3745
+ (l(!0), u(ye, null, Se(e.items, (t, o) => (l(), u("div", {
3746
+ key: t.key,
3747
+ class: we([
3748
+ "wui-timeline-pro__item",
3749
+ `wui-timeline-pro__item--${t.type || "primary"}`,
3750
+ {
3751
+ "is-first": o === 0,
3752
+ "is-last": o === e.items.length - 1
3753
+ }
3754
+ ])
3755
+ }, [
3756
+ d("div", bo, [
3757
+ d("span", wo, [
3758
+ t.icon ? (l(), le(Gt(t.icon), { key: 0 })) : N("", !0)
3759
+ ]),
3760
+ o !== e.items.length - 1 || e.pending ? (l(), u("span", xo)) : N("", !0)
3761
+ ]),
3762
+ d("div", ko, [
3763
+ Ce(y.$slots, "item", {
3764
+ item: t,
3765
+ index: o
3766
+ }, () => [
3767
+ d("div", Co, [
3768
+ d("div", So, [
3769
+ d("strong", null, I(t.title), 1),
3770
+ t.status ? (l(), u("span", Vo, I(t.status), 1)) : N("", !0)
3771
+ ]),
3772
+ t.description ? (l(), u("p", Ao, I(t.description), 1)) : N("", !0),
3773
+ t.operator || t.time ? (l(), u("div", $o, [
3774
+ t.operator ? (l(), u("span", To, I(t.operator), 1)) : N("", !0),
3775
+ t.time ? (l(), u("span", Eo, I(t.time), 1)) : N("", !0)
3776
+ ])) : N("", !0),
3777
+ t.meta && Object.keys(t.meta).length ? (l(), u("dl", Bo, [
3778
+ (l(!0), u(ye, null, Se(t.meta, (a, v) => (l(), u(ye, { key: v }, [
3779
+ d("dt", null, I(v), 1),
3780
+ d("dd", null, I(a ?? "-"), 1)
3781
+ ], 64))), 128))
3782
+ ])) : N("", !0)
3783
+ ])
3784
+ ], !0)
3785
+ ])
3786
+ ], 2))), 128)),
3787
+ e.pending ? (l(), u("div", Lo, [
3788
+ i[0] || (i[0] = d("div", { class: "wui-timeline-pro__axis" }, [
3789
+ d("span", { class: "wui-timeline-pro__dot" })
3790
+ ], -1)),
3791
+ d("div", Mo, [
3792
+ Ce(y.$slots, "pending", {}, () => [
3793
+ d("div", Ko, [
3794
+ d("strong", null, I(e.pendingText), 1)
3795
+ ])
3796
+ ], !0)
3797
+ ])
3798
+ ])) : N("", !0)
3799
+ ])) : (l(), u("div", No, [
3800
+ Ce(y.$slots, "empty", {}, () => [
3801
+ Ve(I(e.emptyText), 1)
3802
+ ], !0)
3803
+ ]))
3804
+ ], 2));
3805
+ }
3806
+ }), Io = /* @__PURE__ */ Ae(Po, [["__scopeId", "data-v-50994fb8"]]), zo = xe(Io, "TimelinePro");
3807
+ function De(e) {
3808
+ return e.caption ?? e.name ?? "未命名文件";
3809
+ }
3810
+ function He(e) {
3811
+ return typeof e.url == "string" ? e.url : "";
3812
+ }
3813
+ function at(e) {
3814
+ var o;
3815
+ const y = De(e), i = He(e), t = (o = (y || i).split("?")[0].split(".").pop()) == null ? void 0 : o.toLowerCase();
3816
+ return !!(t && ["jpg", "jpeg", "png", "gif", "webp", "bmp", "svg"].includes(t));
3817
+ }
3818
+ function Ro(e) {
3819
+ return {
3820
+ uid: `${e.name}-${e.lastModified}-${e.size}`,
3821
+ name: e.name,
3822
+ caption: e.name,
3823
+ size: e.size,
3824
+ raw: e,
3825
+ status: "ready"
3826
+ };
3827
+ }
3828
+ async function ht(e, y, i) {
3829
+ const t = Ro(e), o = await y({ file: e, ...i });
3830
+ return (Array.isArray(o) ? o : [o]).map((v) => ({
3831
+ ...t,
3832
+ ...v,
3833
+ name: v.name ?? v.caption ?? t.name,
3834
+ caption: v.caption ?? v.name ?? t.caption,
3835
+ raw: v.raw ?? t.raw,
3836
+ status: v.status ?? "success"
3837
+ }));
3838
+ }
3839
+ const Uo = /* @__PURE__ */ ee({
3840
+ name: "CustomUpload",
3841
+ __name: "CustomUpload",
3842
+ props: {
3843
+ modelValue: {},
3844
+ uploader: {},
3845
+ uploadUrl: { default: "" },
3846
+ data: { default: () => ({}) },
3847
+ headers: { default: () => ({}) },
3848
+ accept: { default: "*" },
3849
+ fileName: { default: "file" },
3850
+ multiple: { type: Boolean, default: !1 },
3851
+ disabled: { type: Boolean, default: !1 }
3852
+ },
3853
+ emits: ["update:modelValue", "change", "success", "error", "select"],
3854
+ setup(e, { expose: y, emit: i }) {
3855
+ const t = e, o = i, a = K(!1), v = K([]), S = k(() => t.modelValue ?? v.value);
3856
+ function b(h) {
3857
+ t.modelValue === void 0 && (v.value = h), o("update:modelValue", h), o("change", h);
3858
+ }
3859
+ async function z(h) {
3860
+ const g = t.uploader;
3861
+ if (!g)
3862
+ return o("select", h), [];
3863
+ const L = await ht(h, g, {
3864
+ fileName: t.fileName,
3865
+ uploadUrl: t.uploadUrl,
3866
+ data: t.data,
3867
+ headers: t.headers
3868
+ }), P = [...S.value, ...L];
3869
+ return b(P), L.forEach((B) => o("success", B)), L;
3870
+ }
3871
+ async function G(h) {
3872
+ a.value = !0;
3873
+ try {
3874
+ const g = await z(h.file);
3875
+ h.onSuccess(g);
3876
+ } catch (g) {
3877
+ const L = g instanceof Error ? g : new Error("文件上传失败"), P = Object.assign(L, {
3878
+ status: 0,
3879
+ method: "POST",
3880
+ url: t.uploadUrl
3881
+ });
3882
+ o("error", g, h.file), h.onError(P);
3883
+ } finally {
3884
+ a.value = !1;
3885
+ }
3886
+ }
3887
+ return y({ uploadFile: z }), (h, g) => {
3888
+ const L = j("el-button"), P = j("el-upload");
3889
+ return l(), le(P, {
3890
+ class: "wui-custom-upload",
3891
+ action: "#",
3892
+ "show-file-list": !1,
3893
+ accept: e.accept,
3894
+ multiple: e.multiple,
3895
+ disabled: e.disabled,
3896
+ "http-request": G
3897
+ }, {
3898
+ default: C(() => [
3899
+ Ce(h.$slots, "default", {
3900
+ disabled: e.disabled,
3901
+ uploading: a.value
3902
+ }, () => [
3903
+ T(L, {
3904
+ type: "primary",
3905
+ loading: a.value,
3906
+ disabled: e.disabled
3907
+ }, {
3908
+ default: C(() => [...g[0] || (g[0] = [
3909
+ Ve("上传文件", -1)
3910
+ ])]),
3911
+ _: 1
3912
+ }, 8, ["loading", "disabled"])
3913
+ ], !0)
3914
+ ]),
3915
+ _: 3
3916
+ }, 8, ["accept", "multiple", "disabled"]);
3917
+ };
3918
+ }
3919
+ }), Fo = /* @__PURE__ */ Ae(Uo, [["__scopeId", "data-v-bcc4e7b9"]]), Oo = {
3920
+ key: 0,
3921
+ class: "wui-upload__tips"
3922
+ }, Do = {
3923
+ key: 2,
3924
+ class: "wui-upload__input-box"
3925
+ }, jo = { class: "wui-upload__summary" }, Ho = {
3926
+ key: 3,
3927
+ class: "wui-upload__file-list"
3928
+ }, Qo = ["onClick"], qo = ["aria-label", "onClick"], Go = /* @__PURE__ */ ee({
3929
+ name: "Upload",
3930
+ __name: "Upload",
3931
+ props: {
3932
+ modelValue: {},
3933
+ uploader: {},
3934
+ uploadUrl: { default: "" },
3935
+ data: { default: () => ({}) },
3936
+ headers: { default: () => ({}) },
3937
+ dragBox: { type: Boolean, default: !0 },
3938
+ inputBox: { type: Boolean, default: !0 },
3939
+ limit: { default: 0 },
3940
+ accept: { default: "*" },
3941
+ tips: { default: "" },
3942
+ disabled: { type: Boolean, default: !1 },
3943
+ fileName: { default: "file" },
3944
+ multiple: { type: Boolean, default: !0 }
3945
+ },
3946
+ emits: ["update:modelValue", "change", "success", "error", "select", "remove", "exceed", "preview"],
3947
+ setup(e, { expose: y, emit: i }) {
3948
+ const t = e, o = i, a = k(() => t.limit > 0 ? t.limit : void 0), v = K([]), S = k(() => t.modelValue ?? v.value), b = k(() => t.limit > 0 && S.value.length >= t.limit), z = k(() => t.multiple && (t.limit === 0 || t.limit > 1)), G = k(() => S.value.length ? S.value.length === 1 ? De(S.value[0]) : `已选择 ${S.value.length} 个文件` : "未选择文件");
3949
+ function h(R, D) {
3950
+ return String(R.uid ?? R.key ?? R.url ?? R.name ?? D);
3951
+ }
3952
+ function g(R) {
3953
+ t.modelValue === void 0 && (v.value = R), o("update:modelValue", R), o("change", R);
3954
+ }
3955
+ async function L(R) {
3956
+ const D = t.uploader;
3957
+ if (!D)
3958
+ return o("select", R), [];
3959
+ const A = await ht(R, D, {
3960
+ fileName: t.fileName,
3961
+ uploadUrl: t.uploadUrl,
3962
+ data: t.data,
3963
+ headers: t.headers
3964
+ }), s = t.limit > 0 ? Math.max(t.limit - S.value.length, 0) : A.length, n = t.limit > 0 ? A.slice(0, s) : A;
3965
+ if (n.length) {
3966
+ const f = [...S.value, ...n];
3967
+ g(f), n.forEach((p) => o("success", p));
3968
+ }
3969
+ return n;
3970
+ }
3971
+ async function P(R) {
3972
+ try {
3973
+ const D = await L(R.file);
3974
+ R.onSuccess(D);
3975
+ } catch (D) {
3976
+ const A = D instanceof Error ? D : new Error("文件上传失败"), s = Object.assign(A, {
3977
+ status: 0,
3978
+ method: "POST",
3979
+ url: t.uploadUrl
3980
+ });
3981
+ o("error", D, R.file), R.onError(s);
3982
+ }
3983
+ }
3984
+ function B(R, D) {
3985
+ o("exceed", R, D);
3986
+ }
3987
+ function J(R) {
3988
+ if (t.disabled || R < 0 || R >= S.value.length)
3989
+ return;
3990
+ const D = S.value[R], A = [...S.value];
3991
+ A.splice(R, 1), o("remove", D, R), g(A);
3992
+ }
3993
+ function ne() {
3994
+ t.disabled || !S.value.length || (S.value.forEach((R, D) => o("remove", R, D)), g([]));
3995
+ }
3996
+ return y({ uploadFile: L, removeFile: J, removeAll: ne }), (R, D) => {
3997
+ const A = j("el-icon"), s = j("el-upload"), n = j("el-button");
3998
+ return l(), u("div", {
3999
+ class: we(["wui-upload", { "is-disabled": e.disabled }])
4000
+ }, [
4001
+ e.tips && !e.disabled ? (l(), u("p", Oo, I(e.tips), 1)) : N("", !0),
4002
+ e.dragBox ? (l(), le(s, {
4003
+ key: 1,
4004
+ class: "wui-upload__dropzone",
4005
+ action: "#",
4006
+ drag: "",
4007
+ "show-file-list": !1,
4008
+ accept: e.accept,
4009
+ limit: a.value,
4010
+ multiple: z.value,
4011
+ disabled: e.disabled || b.value,
4012
+ "http-request": P,
4013
+ onExceed: B
4014
+ }, {
4015
+ default: C(() => [
4016
+ T(A, {
4017
+ size: 30,
4018
+ class: "wui-upload__dropzone-icon"
4019
+ }, {
4020
+ default: C(() => [
4021
+ T(q(Vl))
4022
+ ]),
4023
+ _: 1
4024
+ }),
4025
+ D[0] || (D[0] = d("div", { class: "el-upload__text" }, [
4026
+ Ve("将文件拖到此处,或"),
4027
+ d("em", null, "点击选择")
4028
+ ], -1))
4029
+ ]),
4030
+ _: 1
4031
+ }, 8, ["accept", "limit", "multiple", "disabled"])) : N("", !0),
4032
+ e.inputBox ? (l(), u("div", Do, [
4033
+ d("span", jo, I(G.value), 1),
4034
+ T(s, {
4035
+ action: "#",
4036
+ "show-file-list": !1,
4037
+ accept: e.accept,
4038
+ limit: a.value,
4039
+ multiple: z.value,
4040
+ disabled: e.disabled || b.value,
4041
+ "http-request": P,
4042
+ onExceed: B
4043
+ }, {
4044
+ default: C(() => [
4045
+ T(n, {
4046
+ type: "primary",
4047
+ size: "small",
4048
+ disabled: e.disabled || b.value
4049
+ }, {
4050
+ default: C(() => [...D[1] || (D[1] = [
4051
+ Ve("选择文件", -1)
4052
+ ])]),
4053
+ _: 1
4054
+ }, 8, ["disabled"])
4055
+ ]),
4056
+ _: 1
4057
+ }, 8, ["accept", "limit", "multiple", "disabled"]),
4058
+ S.value.length ? (l(), le(n, {
4059
+ key: 0,
4060
+ text: "",
4061
+ size: "small",
4062
+ disabled: e.disabled,
4063
+ onClick: ne
4064
+ }, {
4065
+ default: C(() => [...D[2] || (D[2] = [
4066
+ Ve(" 移除全部 ", -1)
4067
+ ])]),
4068
+ _: 1
4069
+ }, 8, ["disabled"])) : N("", !0)
4070
+ ])) : N("", !0),
4071
+ S.value.length ? (l(), u("ul", Ho, [
4072
+ (l(!0), u(ye, null, Se(S.value, (f, p) => (l(), u("li", {
4073
+ key: h(f, p),
4074
+ class: "wui-upload__file-item"
4075
+ }, [
4076
+ d("button", {
4077
+ type: "button",
4078
+ class: "wui-upload__file-name",
4079
+ onClick: (x) => o("preview", f, p)
4080
+ }, [
4081
+ T(A, null, {
4082
+ default: C(() => [
4083
+ T(q(Tt))
4084
+ ]),
4085
+ _: 1
4086
+ }),
4087
+ d("span", null, I(q(De)(f)), 1)
4088
+ ], 8, Qo),
4089
+ e.disabled ? N("", !0) : (l(), u("button", {
4090
+ key: 0,
4091
+ type: "button",
4092
+ class: "wui-upload__remove",
4093
+ "aria-label": `移除 ${q(De)(f)}`,
4094
+ onClick: (x) => J(p)
4095
+ }, [
4096
+ T(A, null, {
4097
+ default: C(() => [
4098
+ T(q(qe))
4099
+ ]),
4100
+ _: 1
4101
+ })
4102
+ ], 8, qo))
4103
+ ]))), 128))
4104
+ ])) : N("", !0)
4105
+ ], 2);
4106
+ };
4107
+ }
4108
+ }), Xo = /* @__PURE__ */ Ae(Go, [["__scopeId", "data-v-94986e5c"]]), Wo = {
4109
+ key: 0,
4110
+ class: "wui-upload-list__tips"
4111
+ }, Jo = { class: "wui-upload-list__grid" }, Yo = ["disabled", "onClick"], Zo = ["src", "alt"], ei = ["title"], ti = ["aria-label", "onClick"], li = /* @__PURE__ */ ee({
4112
+ name: "UploadList",
4113
+ __name: "UploadList",
4114
+ props: {
4115
+ preview: { type: Boolean, default: !0 },
4116
+ modelValue: {},
4117
+ uploader: {},
4118
+ uploadUrl: { default: "" },
4119
+ data: { default: () => ({}) },
4120
+ headers: { default: () => ({}) },
4121
+ limit: { default: 0 },
4122
+ accept: { default: "image/*" },
4123
+ tips: { default: "" },
4124
+ disabled: { type: Boolean, default: !1 },
4125
+ fileName: { default: "file" },
4126
+ multiple: { type: Boolean, default: !0 }
4127
+ },
4128
+ emits: ["update:modelValue", "change", "success", "error", "select", "remove", "exceed", "preview"],
4129
+ setup(e, { expose: y, emit: i }) {
4130
+ const t = e, o = i, a = K(!1), v = K(0), S = K([]), b = k(() => t.modelValue ?? S.value), z = k(() => b.value.filter(at).filter((s) => !!He(s))), G = k(() => z.value.map(He)), h = k(() => t.limit > 0 ? t.limit : void 0), g = k(() => t.limit > 0 && b.value.length >= t.limit), L = k(() => t.multiple && (t.limit === 0 || t.limit > 1));
4131
+ function P(s, n) {
4132
+ return String(s.uid ?? s.key ?? s.url ?? s.name ?? n);
4133
+ }
4134
+ function B(s) {
4135
+ t.modelValue === void 0 && (S.value = s), o("update:modelValue", s), o("change", s);
4136
+ }
4137
+ async function J(s) {
4138
+ const n = t.uploader;
4139
+ if (!n)
4140
+ return o("select", s), [];
4141
+ const f = await ht(s, n, {
4142
+ fileName: t.fileName,
4143
+ uploadUrl: t.uploadUrl,
4144
+ data: t.data,
4145
+ headers: t.headers
4146
+ }), p = t.limit > 0 ? Math.max(t.limit - b.value.length, 0) : f.length, x = t.limit > 0 ? f.slice(0, p) : f;
4147
+ return x.length && (B([...b.value, ...x]), x.forEach((W) => o("success", W))), x;
4148
+ }
4149
+ async function ne(s) {
4150
+ try {
4151
+ const n = await J(s.file);
4152
+ s.onSuccess(n);
4153
+ } catch (n) {
4154
+ const f = n instanceof Error ? n : new Error("文件上传失败"), p = Object.assign(f, {
4155
+ status: 0,
4156
+ method: "POST",
4157
+ url: t.uploadUrl
4158
+ });
4159
+ o("error", n, s.file), s.onError(p);
4160
+ }
4161
+ }
4162
+ function R(s, n) {
4163
+ o("exceed", s, n);
4164
+ }
4165
+ function D(s) {
4166
+ if (t.disabled || s < 0 || s >= b.value.length)
4167
+ return;
4168
+ const n = b.value[s], f = [...b.value];
4169
+ f.splice(s, 1), o("remove", n, s), B(f);
4170
+ }
4171
+ function A(s) {
4172
+ const n = b.value[s];
4173
+ !t.preview || !at(n) || !He(n) || (v.value = z.value.findIndex((f) => f === n), a.value = v.value >= 0, o("preview", n, s));
4174
+ }
4175
+ return y({ uploadFile: J, removeFile: D }), (s, n) => {
4176
+ const f = j("el-icon"), p = j("el-upload"), x = j("el-image-viewer");
4177
+ return l(), u("div", {
4178
+ class: we(["wui-upload-list", { "is-disabled": e.disabled }])
4179
+ }, [
4180
+ e.tips && !e.disabled ? (l(), u("p", Wo, I(e.tips), 1)) : N("", !0),
4181
+ d("div", Jo, [
4182
+ (l(!0), u(ye, null, Se(b.value, (W, Y) => (l(), u("article", {
4183
+ key: P(W, Y),
4184
+ class: "wui-upload-list__card"
4185
+ }, [
4186
+ d("button", {
4187
+ type: "button",
4188
+ class: "wui-upload-list__preview",
4189
+ disabled: !e.preview || !q(at)(W) || !q(He)(W),
4190
+ onClick: (_) => A(Y)
4191
+ }, [
4192
+ q(at)(W) && q(He)(W) ? (l(), u("img", {
4193
+ key: 0,
4194
+ src: q(He)(W),
4195
+ alt: q(De)(W)
4196
+ }, null, 8, Zo)) : (l(), le(f, {
4197
+ key: 1,
4198
+ size: 26
4199
+ }, {
4200
+ default: C(() => [
4201
+ T(q(Tt))
4202
+ ]),
4203
+ _: 1
4204
+ }))
4205
+ ], 8, Yo),
4206
+ d("span", {
4207
+ class: "wui-upload-list__name",
4208
+ title: q(De)(W)
4209
+ }, I(q(De)(W)), 9, ei),
4210
+ e.disabled ? N("", !0) : (l(), u("button", {
4211
+ key: 0,
4212
+ type: "button",
4213
+ class: "wui-upload-list__remove",
4214
+ "aria-label": `移除 ${q(De)(W)}`,
4215
+ onClick: (_) => D(Y)
4216
+ }, [
4217
+ T(f, null, {
4218
+ default: C(() => [
4219
+ T(q(qe))
4220
+ ]),
4221
+ _: 1
4222
+ })
4223
+ ], 8, ti))
4224
+ ]))), 128)),
4225
+ !g.value && !e.disabled ? (l(), le(p, {
4226
+ key: 0,
4227
+ class: "wui-upload-list__add",
4228
+ action: "#",
4229
+ "show-file-list": !1,
4230
+ accept: e.accept,
4231
+ limit: h.value,
4232
+ multiple: L.value,
4233
+ "http-request": ne,
4234
+ onExceed: R
4235
+ }, {
4236
+ default: C(() => [
4237
+ T(f, { size: 24 }, {
4238
+ default: C(() => [
4239
+ T(q(gt))
4240
+ ]),
4241
+ _: 1
4242
+ })
4243
+ ]),
4244
+ _: 1
4245
+ }, 8, ["accept", "limit", "multiple"])) : N("", !0)
4246
+ ]),
4247
+ a.value ? (l(), le(x, {
4248
+ key: 1,
4249
+ "url-list": G.value,
4250
+ "initial-index": v.value,
4251
+ "z-index": 3e3,
4252
+ onClose: n[0] || (n[0] = (W) => a.value = !1)
4253
+ }, null, 8, ["url-list", "initial-index"])) : N("", !0)
4254
+ ], 2);
4255
+ };
4256
+ }
4257
+ }), ai = /* @__PURE__ */ Ae(li, [["__scopeId", "data-v-5b306917"]]), ni = xe(Xo, "Upload"), oi = xe(Fo, "CustomUpload"), ii = xe(ai, "UploadList"), si = [
4258
+ Ol,
4259
+ Mt,
4260
+ Il,
4261
+ ea,
4262
+ ra,
4263
+ ka,
4264
+ Va,
4265
+ za,
4266
+ Xa,
4267
+ an,
4268
+ cn,
4269
+ An,
4270
+ _o,
4271
+ go,
4272
+ Zn,
4273
+ Yn,
4274
+ eo,
4275
+ zo,
4276
+ ni,
4277
+ oi,
4278
+ ii
4279
+ ], vi = {
4280
+ install(e) {
4281
+ si.forEach((y) => e.use(y));
4282
+ }
4283
+ };
4284
+ export {
4285
+ Ol as Button,
4286
+ Mt as CatImage,
4287
+ Il as Checkbox,
4288
+ ea as CopyText,
4289
+ ra as CustomTable,
4290
+ ka as CustomTree,
4291
+ oi as CustomUpload,
4292
+ fi as DateRangePicker,
4293
+ Va as DaterangePicker,
4294
+ za as Dialog,
4295
+ Xa as EditableBox,
4296
+ an as ExpandSelect,
4297
+ cn as FilePreview,
4298
+ pi as FilePreviewer,
4299
+ An as MemberSelector,
4300
+ _o as Multiple,
4301
+ go as MultipleCreate,
4302
+ Zn as Reject,
4303
+ zo as TimelinePro,
4304
+ Yn as Tips,
4305
+ eo as TipsInput,
4306
+ ni as Upload,
4307
+ ii as UploadList,
4308
+ Xt as WEB_UI_BRAND_NAME,
4309
+ ci as WEB_UI_PLUGIN_NAME,
4310
+ Wt as WEB_UI_RUNTIME_ID,
4311
+ di as YyCheckbox,
4312
+ mi as createGroupedMemberValueAdapter,
4313
+ vi as default,
4314
+ fn as defaultMemberValueAdapter
4315
+ };