@vtj/ui 0.6.25 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/LICENSE +21 -21
  2. package/dist/index.cjs +7 -0
  3. package/dist/index.iife.js +7 -0
  4. package/dist/index.mjs +4165 -0
  5. package/dist/index.umd.js +7 -0
  6. package/dist/style.css +1 -0
  7. package/package.json +23 -21
  8. package/types/components/action/Action.d.ts +23 -22
  9. package/types/components/action/Trigger.d.ts +15 -14
  10. package/types/components/action/hooks.d.ts +7 -6
  11. package/types/components/action/types.d.ts +14 -10
  12. package/types/components/action-bar/ActionBar.d.ts +41 -40
  13. package/types/components/action-bar/types.d.ts +10 -11
  14. package/types/components/chart/Chart.d.ts +4 -4
  15. package/types/components/chart/types.d.ts +3 -3
  16. package/types/components/chart/useChart.d.ts +5 -5
  17. package/types/components/container/Container.d.ts +7 -7
  18. package/types/components/container/types.d.ts +3 -3
  19. package/types/components/data-item/DataItem.d.ts +23 -22
  20. package/types/components/data-item/types.d.ts +3 -3
  21. package/types/components/dialog/Dialog.d.ts +9 -9
  22. package/types/components/dialog/create.d.ts +2 -2
  23. package/types/components/dialog/hooks.d.ts +5 -5
  24. package/types/components/dialog/types.d.ts +4 -4
  25. package/types/components/dialog-form/DialogForm.d.ts +3 -3
  26. package/types/components/dialog-form/types.d.ts +3 -3
  27. package/types/components/field/Field.d.ts +17 -4
  28. package/types/components/field/editors/CheckboxEditor.d.ts +6 -3
  29. package/types/components/field/editors/RadioEditor.d.ts +6 -3
  30. package/types/components/field/editors/SelectEditor.d.ts +6 -3
  31. package/types/components/field/hooks/useEditor.d.ts +3 -3
  32. package/types/components/field/types.d.ts +16 -4
  33. package/types/components/form/Form.d.ts +13 -3
  34. package/types/components/form/types.d.ts +10 -2
  35. package/types/components/header/Header.d.ts +2 -2
  36. package/types/components/header/types.d.ts +4 -3
  37. package/types/components/icon/Icon.d.ts +2 -2
  38. package/types/components/index.d.ts +2 -2
  39. package/types/components/list/List.d.ts +109 -0
  40. package/types/components/list/index.d.ts +3 -0
  41. package/types/components/list/types.d.ts +58 -0
  42. package/types/components/mask/Mask.d.ts +23 -22
  43. package/types/components/mask/components/Avatar.d.ts +2 -2
  44. package/types/components/mask/components/Brand.d.ts +5 -2
  45. package/types/components/mask/components/Content.d.ts +3 -3
  46. package/types/components/mask/components/Menu.d.ts +6 -3
  47. package/types/components/mask/components/Sidebar.d.ts +2 -2
  48. package/types/components/mask/components/SwitchBar.d.ts +5 -2
  49. package/types/components/mask/components/Tabs.d.ts +4 -4
  50. package/types/components/mask/components/ThemeSwitch.d.ts +2 -2
  51. package/types/components/mask/components/Toolbar.d.ts +7 -4
  52. package/types/components/mask/defineTab.d.ts +1 -1
  53. package/types/components/mask/hooks/useContent.d.ts +2 -2
  54. package/types/components/mask/hooks/useHome.d.ts +1 -1
  55. package/types/components/mask/hooks/useMenus.d.ts +3 -3
  56. package/types/components/mask/hooks/useSidebar.d.ts +1 -2
  57. package/types/components/mask/hooks/useTabs.d.ts +4 -4
  58. package/types/components/mask/types.d.ts +3 -3
  59. package/types/components/menu/Menu.d.ts +6 -3
  60. package/types/components/menu/MenuItem.d.ts +3 -3
  61. package/types/components/menu/types.d.ts +2 -2
  62. package/types/components/panel/Panel.d.ts +6 -24
  63. package/types/components/panel/types.d.ts +9 -11
  64. package/types/components/shared.d.ts +2 -1
  65. package/types/components/tabs/Tabs.d.ts +3 -3
  66. package/types/components/tabs/types.d.ts +3 -3
  67. package/types/components/test/Test.d.ts +244 -0
  68. package/types/components/test/index.d.ts +3 -0
  69. package/types/components/test/types.d.ts +41 -0
  70. package/types/directives/vDraggable.d.ts +2 -2
  71. package/types/directives/vResizable.d.ts +2 -2
  72. package/types/hooks/index.d.ts +1 -0
  73. package/types/hooks/useDisabled.d.ts +1 -1
  74. package/types/hooks/useIcon.d.ts +3 -3
  75. package/types/index.d.ts +1 -4
  76. package/types/install.d.ts +4 -0
  77. package/types/list.d.ts +1 -1
  78. package/types/utils/util.d.ts +1 -3
  79. package/types/version.d.ts +8 -1
  80. package/cdn/index.js +0 -1
  81. package/cdn/style.css +0 -1
  82. package/lib/index.js +0 -3830
  83. package/lib/style.css +0 -1
  84. package/types/components/simple-mask/SimpleMask.d.ts +0 -43
  85. package/types/components/simple-mask/index.d.ts +0 -2
  86. package/types/components/startup/Startup.d.ts +0 -38
  87. package/types/components/startup/index.d.ts +0 -2
package/dist/index.mjs ADDED
@@ -0,0 +1,4165 @@
1
+ import { defineComponent as P, useAttrs as Je, getCurrentInstance as pe, computed as y, markRaw as ke, openBlock as u, createBlock as g, unref as n, normalizeClass as Z, normalizeStyle as fe, withCtx as d, renderSlot as x, resolveDynamicComponent as W, createCommentVNode as v, createElementBlock as C, mergeProps as F, createElementVNode as H, toDisplayString as O, Fragment as J, renderList as Y, isVNode as Ut, h as ae, shallowRef as Ve, ref as D, watch as L, toRef as Ae, createTextVNode as R, useSlots as Ht, toRaw as ge, createVNode as _, normalizeProps as le, guardReactiveProps as be, effectScope as mt, reactive as Re, onMounted as gt, onUnmounted as yt, watchEffect as Qe, nextTick as ye, Teleport as vt, withDirectives as G, createSlots as he, render as nt, vShow as ne, isRef as Be, withModifiers as bt, KeepAlive as Kt, provide as ze, inject as xe, withKeys as Lt } from "vue";
2
+ import { ElIcon as Wt, ElSubMenu as Jt, ElBadge as Ke, ElMenuItem as Qt, ElMenu as Zt, ElButton as ie, ElDropdown as Gt, ElDropdownMenu as Yt, ElDropdownItem as qt, ElTooltip as ht, ElDivider as se, ElSwitch as Ze, ElInput as Ce, ElEmpty as _t, ElTabs as kt, ElTabPane as Le, ElPopover as wt, ElAvatar as eo, ElMessageBox as Ne, ElSelect as to, ElOption as oo, ElCheckboxButton as no, ElCheckbox as ao, ElCheckboxGroup as so, ElRadioButton as lo, ElRadio as io, ElRadioGroup as ro, ElInputNumber as co, ElDatePicker as at, ElTimePicker as uo, ElRate as po, ElSlider as fo, ElCascader as mo, formContextKey as go, ElFormItem as yo, ElForm as vo, ElImage as bo, ElInfiniteScroll as st, ElPagination as ho, ElDescriptions as lt, ElDescriptionsItem as Xe, ElMessage as it } from "element-plus";
3
+ import { ArrowRight as _o, Minimize as ko, Popup as wo, Maximize as xo, RawClose as So, StarFilled as xt, Menu as zo, Search as We, Close as St, Expand as Co, Fold as To, Star as zt, Document as me, Refresh as $o, CopyDocument as Mo, Moon as Eo, Sunny as Io, MoreFilled as Bo, UserFilled as Po, HomeFilled as Vo, WarningFilled as Ao } from "@vtj/icons";
4
+ import { useDraggable as Do, useMouseInElement as Ro, useEventListener as De, useElementSize as Ct, useDark as Oo, useResizeObserver as Fo, useVirtualList as jo } from "@vueuse/core";
5
+ import { isEqual as Ge, isObject as Ye, uid as Tt, arrayToMap as No, isUrl as Xo, upperFirstCamelCase as $t, toArray as Uo, get as Pe, merge as Ho, set as Ue, debounce as Ko } from "@vtj/utils";
6
+ import { useRouter as qe, RouterView as Lo, useRoute as Mt, routeLocationKey as Wo } from "vue-router";
7
+ /**!
8
+ * Copyright (c) 2024, VTJ.PRO All rights reserved.
9
+ * @name @vtj/ui
10
+ * @author CHC chenhuachun1549@dingtalk.com
11
+ * @version 0.7.0
12
+ * @license <a href="https://vtj.pro/license.html">MIT License</a>
13
+ */
14
+ const Da = "0.7.0", Jo = {
15
+ default: 14,
16
+ small: 12,
17
+ large: 18
18
+ }, Qo = {
19
+ icon: {
20
+ type: [String, Object]
21
+ },
22
+ color: {
23
+ type: String
24
+ },
25
+ size: {
26
+ type: [Number, String],
27
+ default: "inherit"
28
+ },
29
+ src: {
30
+ type: String
31
+ },
32
+ background: {
33
+ type: String
34
+ },
35
+ padding: {
36
+ type: Number
37
+ },
38
+ radius: {
39
+ type: Number
40
+ }
41
+ };
42
+ function q(a) {
43
+ return typeof a == "string" ? a : `${a}px`;
44
+ }
45
+ function Me(a = 0, o) {
46
+ if (typeof a == "number")
47
+ return a;
48
+ if (/(%|vh|vw)$/i.test(a)) {
49
+ const t = Number.parseInt(a);
50
+ return Math.floor(o * t / 100);
51
+ }
52
+ return Number.parseInt(a);
53
+ }
54
+ function rt(a, o = {}) {
55
+ const e = { ...o };
56
+ return typeof a == "boolean" ? e : Object.assign(e, a || {});
57
+ }
58
+ const ct = Symbol("INSTALLED_KEY"), Ra = (a = []) => ({
59
+ install: (e) => {
60
+ e[ct] || (e[ct] = !0, a.forEach((t) => {
61
+ t.name && e.component(t.name, t);
62
+ }));
63
+ }
64
+ }), Zo = ["src"], re = /* @__PURE__ */ P({
65
+ name: "XIcon",
66
+ __name: "Icon",
67
+ props: Qo,
68
+ setup(a) {
69
+ const o = a, e = Je(), t = pe(), l = y(() => {
70
+ if (!o.icon)
71
+ return null;
72
+ const r = t?.appContext.app;
73
+ return typeof o.icon == "object" ? ke(o.icon) : r?.component(o.icon) || o.icon;
74
+ }), s = y(() => {
75
+ const r = {
76
+ "is-pointer": !!e.onClick
77
+ };
78
+ return !l.value && o.icon && (r[o.icon] = !0), r;
79
+ }), c = y(() => ({
80
+ "background-color": o.background,
81
+ "border-radius": o.radius ? q(o.radius) : void 0,
82
+ padding: o.padding ? q(o.padding) : void 0
83
+ })), i = y(() => typeof o.size == "number" ? o.size : Jo[o.size] ?? void 0);
84
+ return (r, p) => (u(), g(n(Wt), {
85
+ class: Z(["x-icon", s.value]),
86
+ color: o.color,
87
+ size: i.value,
88
+ style: fe(c.value)
89
+ }, {
90
+ default: d(() => [
91
+ x(r.$slots, "default", {}, () => [
92
+ l.value ? (u(), g(W(l.value), { key: 0 })) : v("", !0),
93
+ o.src ? (u(), C("img", {
94
+ key: 1,
95
+ src: o.src
96
+ }, null, 8, Zo)) : v("", !0)
97
+ ])
98
+ ]),
99
+ _: 3
100
+ }, 8, ["class", "color", "size", "style"]));
101
+ }
102
+ }), Go = { class: "x-menu__wrapper" }, Yo = {
103
+ key: 1,
104
+ class: "x-menu__title"
105
+ }, qo = /* @__PURE__ */ H("i", null, null, -1), en = {
106
+ key: 0,
107
+ class: "x-menu__title"
108
+ }, tn = /* @__PURE__ */ H("i", null, null, -1), Et = /* @__PURE__ */ P({
109
+ inheritAttrs: !1,
110
+ name: "XMenuItem",
111
+ __name: "MenuItem",
112
+ props: {
113
+ item: {},
114
+ subMenu: {},
115
+ defaultIcon: {}
116
+ },
117
+ setup(a) {
118
+ const o = a, e = pe(), t = (c) => {
119
+ if (c)
120
+ return typeof c == "string" && (e?.appContext.app?.component(c) || o.defaultIcon) || c;
121
+ }, l = (c) => typeof c == "object" ? c : { value: c }, s = (c = []) => c.filter((i) => !i.hidden);
122
+ return (c, i) => o.item.children ? (u(), g(n(Jt), F({
123
+ key: 0,
124
+ disabled: o.item.disabled
125
+ }, o.subMenu, {
126
+ index: String(o.item.id)
127
+ }), {
128
+ title: d(() => [
129
+ H("div", Go, [
130
+ o.item.icon ? (u(), g(n(re), {
131
+ key: 0,
132
+ icon: t(o.item.icon)
133
+ }, null, 8, ["icon"])) : v("", !0),
134
+ o.item.title ? (u(), C("span", Yo, O(o.item.title), 1)) : v("", !0),
135
+ o.item.badge ? (u(), g(n(Ke), F({
136
+ key: 2,
137
+ class: "x-menu__badge"
138
+ }, l(o.item.badge)), {
139
+ default: d(() => [
140
+ qo
141
+ ]),
142
+ _: 1
143
+ }, 16)) : v("", !0)
144
+ ])
145
+ ]),
146
+ default: d(() => [
147
+ (u(!0), C(J, null, Y(s(o.item.children), (r) => (u(), g(n(Et), {
148
+ key: r.id,
149
+ item: r,
150
+ subMenu: o.subMenu,
151
+ defaultIcon: o.defaultIcon
152
+ }, null, 8, ["item", "subMenu", "defaultIcon"]))), 128))
153
+ ]),
154
+ _: 1
155
+ }, 16, ["disabled", "index"])) : (u(), g(n(Qt), {
156
+ key: 1,
157
+ index: String(o.item.id),
158
+ disabled: o.item.disabled
159
+ }, {
160
+ title: d(() => [
161
+ o.item.title ? (u(), C("span", en, O(o.item.title), 1)) : v("", !0),
162
+ o.item.badge ? (u(), g(n(Ke), F({
163
+ key: 1,
164
+ class: "x-menu__badge"
165
+ }, l(o.item.badge)), {
166
+ default: d(() => [
167
+ tn
168
+ ]),
169
+ _: 1
170
+ }, 16)) : v("", !0)
171
+ ]),
172
+ default: d(() => [
173
+ o.item.icon ? (u(), g(n(re), {
174
+ key: 0,
175
+ icon: t(o.item.icon)
176
+ }, null, 8, ["icon"])) : v("", !0)
177
+ ]),
178
+ _: 1
179
+ }, 8, ["index", "disabled"]));
180
+ }
181
+ }), de = /* @__PURE__ */ P({
182
+ inheritAttrs: !1,
183
+ name: "XMenu",
184
+ __name: "Menu",
185
+ props: {
186
+ data: { default: () => [] },
187
+ subMenu: {},
188
+ defaultIcon: {}
189
+ },
190
+ emits: ["select"],
191
+ setup(a, { emit: o }) {
192
+ const e = a, t = o, l = y(() => e.data.filter((i) => !i.hidden)), s = (i, r) => {
193
+ const p = (f, m = []) => {
194
+ for (const h of m) {
195
+ if (h.id.toString() === f.toString())
196
+ return h;
197
+ if (h.children?.length) {
198
+ const b = p(f, h.children);
199
+ if (b)
200
+ return b;
201
+ }
202
+ }
203
+ };
204
+ return p(r, i);
205
+ }, c = (i) => {
206
+ const r = s(l.value, i);
207
+ r && t("select", r);
208
+ };
209
+ return (i, r) => (u(), g(n(Zt), F({ class: "x-menu" }, i.$attrs, { onSelect: c }), {
210
+ default: d(() => [
211
+ (u(!0), C(J, null, Y(l.value, (p) => (u(), g(n(Et), {
212
+ item: { ...p, icon: p.icon },
213
+ defaultIcon: e.defaultIcon,
214
+ subMenu: e.subMenu
215
+ }, null, 8, ["item", "defaultIcon", "subMenu"]))), 256))
216
+ ]),
217
+ _: 1
218
+ }, 16));
219
+ }
220
+ }), It = {
221
+ /**
222
+ * 动作名称标识
223
+ */
224
+ name: {
225
+ type: String
226
+ },
227
+ /**
228
+ * 动作标题文本
229
+ */
230
+ label: {
231
+ type: String
232
+ },
233
+ /**
234
+ * 动作值,用来传输数据
235
+ */
236
+ value: {
237
+ type: [String, Number, Object, Array, Boolean]
238
+ },
239
+ /**
240
+ * 图标配置
241
+ */
242
+ icon: {
243
+ type: [String, Object]
244
+ },
245
+ /**
246
+ * 模式
247
+ */
248
+ mode: {
249
+ type: String,
250
+ default: "button"
251
+ },
252
+ /**
253
+ * 下拉菜单配置
254
+ */
255
+ menus: {
256
+ type: Array
257
+ },
258
+ /**
259
+ * tooltip 配置
260
+ */
261
+ tooltip: {
262
+ type: [String, Object]
263
+ },
264
+ /**
265
+ * Badge 配置
266
+ */
267
+ badge: {
268
+ type: [String, Number, Object]
269
+ },
270
+ /**
271
+ * ElDropdown 组件配置
272
+ */
273
+ dropdown: {
274
+ type: Object
275
+ },
276
+ /**
277
+ * ElButton 组件配置,mode为button时有效
278
+ */
279
+ button: {
280
+ type: Object
281
+ },
282
+ /**
283
+ * 禁用
284
+ */
285
+ disabled: {
286
+ type: [Boolean, Function]
287
+ },
288
+ /**
289
+ * 尺寸
290
+ */
291
+ size: {
292
+ type: String,
293
+ default: "default"
294
+ },
295
+ /**
296
+ * 颜色类型
297
+ */
298
+ type: {
299
+ type: String,
300
+ default: "primary"
301
+ },
302
+ /**
303
+ * icon 背景设置,当 mode为 icon 时有效
304
+ */
305
+ background: {
306
+ type: String,
307
+ default: "always"
308
+ },
309
+ /**
310
+ * icon 背景样式圆形,当 mode为 icon 时有效
311
+ */
312
+ circle: {
313
+ type: Boolean
314
+ }
315
+ };
316
+ function on(a) {
317
+ return y(() => {
318
+ const o = a.tooltip;
319
+ if (o)
320
+ return typeof o == "string" ? { content: o } : o;
321
+ });
322
+ }
323
+ function nn(a) {
324
+ return y(() => {
325
+ const o = a.badge;
326
+ if (o)
327
+ return typeof o == "object" ? o : { value: o };
328
+ });
329
+ }
330
+ function an(a) {
331
+ return y(() => {
332
+ const { dropdown: o, menus: e } = a;
333
+ if (e && e.length > 0)
334
+ return Object.assign(
335
+ { popperClass: "x-action__menus", size: a.size },
336
+ o || {}
337
+ );
338
+ });
339
+ }
340
+ function sn(a) {
341
+ const o = pe();
342
+ return y(() => {
343
+ const e = n(a);
344
+ if (e)
345
+ if (typeof e == "string" || e.setup || e.render || Ut(e)) {
346
+ const t = o?.appContext.app;
347
+ return {
348
+ icon: typeof e == "string" && t?.component(e) || e
349
+ };
350
+ } else
351
+ return e;
352
+ return null;
353
+ });
354
+ }
355
+ function _e(a) {
356
+ const o = sn(a);
357
+ return o.value ? ke(P({ render: () => ae(re, o.value) })) : void 0;
358
+ }
359
+ function et(a, o) {
360
+ return y(() => {
361
+ const e = n(a);
362
+ return typeof e == "function" ? e(o) : !!e;
363
+ });
364
+ }
365
+ function ln(a, o, e) {
366
+ const t = Ve(o), l = D(!1), s = async (i) => {
367
+ const r = n(a);
368
+ return r ? typeof r == "function" ? await r(i) : r : o;
369
+ }, c = async (i) => (l.value = !0, await s(i).then((r) => (t.value = r || o, l.value = !1, t)));
370
+ return L(
371
+ () => a,
372
+ () => {
373
+ c(e);
374
+ },
375
+ { immediate: !0 }
376
+ ), e && L(e, () => {
377
+ c(e);
378
+ }), {
379
+ data: t,
380
+ loading: l,
381
+ loader: c
382
+ };
383
+ }
384
+ const rn = { key: 0 }, cn = /* @__PURE__ */ P({
385
+ __name: "Trigger",
386
+ props: It,
387
+ emits: ["click"],
388
+ setup(a, { emit: o }) {
389
+ const e = a, t = o, l = _e(Ae(e, "icon")), s = et(Ae(e, "disabled")), c = y(() => ({
390
+ [`is-${e.mode}`]: !!e.mode,
391
+ [`is-${e.type}`]: !!e.type,
392
+ [`is-${e.size}`]: !!e.size && e.size !== "default",
393
+ [`is-background-${e.background}`]: e.mode === "icon" && !!e.background,
394
+ "is-disabled": !!e.disabled,
395
+ "is-circle": !!e.circle
396
+ })), i = (r) => {
397
+ if (r.stopPropagation(), r.preventDefault(), !s.value)
398
+ return t("click"), !1;
399
+ };
400
+ return (r, p) => e.mode === "button" ? (u(), g(n(ie), F({
401
+ key: 0,
402
+ icon: n(l),
403
+ type: e.type,
404
+ size: e.size,
405
+ disabled: n(s)
406
+ }, e.button, { onClick: i }), {
407
+ default: d(() => [
408
+ R(O(r.label), 1)
409
+ ]),
410
+ _: 1
411
+ }, 16, ["icon", "type", "size", "disabled"])) : (u(), C("div", {
412
+ key: 1,
413
+ class: Z(["x-action__inner", c.value]),
414
+ onClick: i
415
+ }, [
416
+ (u(), g(W(n(l)))),
417
+ r.label ? (u(), C("span", rn, O(r.label), 1)) : v("", !0)
418
+ ], 2));
419
+ }
420
+ }), te = /* @__PURE__ */ P({
421
+ name: "XAction",
422
+ __name: "Action",
423
+ props: It,
424
+ emits: ["click", "command"],
425
+ setup(a, { emit: o }) {
426
+ const e = a, t = Ht(), l = o, s = on(e), c = nn(e), i = an(e), r = et(Ae(e, "disabled")), p = y(() => ({
427
+ [`x-action--${e.mode}`]: !!e.mode
428
+ })), f = () => {
429
+ r.value || l("click", ge(e));
430
+ }, m = (z) => {
431
+ if (r.value)
432
+ return;
433
+ const I = e.menus?.find((V) => V.command === z);
434
+ I && l("command", ge(I));
435
+ }, h = (z) => ae(Ke, c.value, () => [].concat(z)), b = (z) => ae(
436
+ Gt,
437
+ { ...i.value, disabled: r.value, onCommand: m },
438
+ {
439
+ default: () => [z],
440
+ dropdown: () => [
441
+ ae(
442
+ Yt,
443
+ () => (e.menus || []).map((I) => ae(
444
+ qt,
445
+ I,
446
+ () => t.item ? t.item({ item: I }) : I.label
447
+ ))
448
+ )
449
+ ]
450
+ }
451
+ ), w = (z) => ae(ht, { ...s.value, disabled: r.value }, () => [
452
+ z
453
+ ]), M = y(() => {
454
+ let z = t.default ? t.default()[0] : ae(ke(cn), { ...e, onClick: f });
455
+ return c.value && (z = h(z)), i.value && (z = b(z)), s.value && (z = w(z)), z;
456
+ });
457
+ return (z, I) => (u(), C("div", {
458
+ class: Z(["x-action", p.value])
459
+ }, [
460
+ (u(), g(W(M.value)))
461
+ ], 2));
462
+ }
463
+ }), un = {
464
+ /**
465
+ * 动作项
466
+ */
467
+ items: {
468
+ type: Array
469
+ },
470
+ /**
471
+ * 模式
472
+ */
473
+ mode: {
474
+ type: String,
475
+ default: "button"
476
+ },
477
+ /**
478
+ * 尺寸
479
+ */
480
+ size: {
481
+ type: String,
482
+ default: "default"
483
+ },
484
+ /**
485
+ * 颜色类型
486
+ */
487
+ type: {
488
+ type: String,
489
+ default: "primary"
490
+ },
491
+ /**
492
+ * icon 背景设置,当 mode为 icon 时有效
493
+ */
494
+ background: {
495
+ type: String,
496
+ default: "always"
497
+ },
498
+ /**
499
+ * icon 背景样式圆形,当 mode为 icon 时有效
500
+ */
501
+ circle: {
502
+ type: Boolean
503
+ },
504
+ /**
505
+ * 禁用
506
+ */
507
+ disabled: {
508
+ type: [Boolean, Function]
509
+ },
510
+ /**
511
+ * tooltip 配置
512
+ */
513
+ tooltip: {
514
+ type: Object
515
+ },
516
+ /**
517
+ * Badge 配置
518
+ */
519
+ badge: {
520
+ type: Object
521
+ },
522
+ /**
523
+ * ElDropdown 组件配置
524
+ */
525
+ dropdown: {
526
+ type: Object
527
+ },
528
+ /**
529
+ * ElButton 组件配置,mode为button时有效
530
+ */
531
+ button: {
532
+ type: Object
533
+ }
534
+ }, Oe = /* @__PURE__ */ P({
535
+ name: "XActionBar",
536
+ __name: "ActionBar",
537
+ props: un,
538
+ emits: ["click", "command"],
539
+ setup(a, { emit: o }) {
540
+ const e = a, t = o, l = y(() => (e.items || []).map((i) => i === "|" ? i : {
541
+ ...i,
542
+ badge: i.badge ? {
543
+ ...e.badge,
544
+ ...typeof i.badge == "object" ? i.badge || {} : { value: i.badge }
545
+ } : void 0,
546
+ tooltip: i.tooltip ? {
547
+ ...e.tooltip,
548
+ ...typeof i.tooltip == "object" ? i.tooltip || {} : { content: i.tooltip }
549
+ } : void 0
550
+ })), s = (i) => {
551
+ t("click", i);
552
+ }, c = (i, r) => {
553
+ t("command", i, r);
554
+ };
555
+ return (i, r) => (u(), g(n(E), {
556
+ class: "x-action-bar",
557
+ align: "center"
558
+ }, {
559
+ default: d(() => [
560
+ (u(!0), C(J, null, Y(l.value, (p) => (u(), C(J, null, [
561
+ p === "|" ? (u(), g(n(se), {
562
+ key: 0,
563
+ direction: "vertical",
564
+ class: "x-action-bar__divider"
565
+ })) : (u(), g(n(te), F({
566
+ key: 1,
567
+ mode: e.mode,
568
+ size: e.size,
569
+ type: e.type,
570
+ circle: e.circle,
571
+ background: e.background,
572
+ button: e.button,
573
+ dropdown: e.dropdown,
574
+ disabled: n(et)(e.disabled, p).value
575
+ }, p, {
576
+ onClick: s,
577
+ onCommand: (f) => c(p, f)
578
+ }), null, 16, ["mode", "size", "type", "circle", "background", "button", "dropdown", "disabled", "onCommand"]))
579
+ ], 64))), 256))
580
+ ]),
581
+ _: 1
582
+ }));
583
+ }
584
+ }), dn = {
585
+ /**
586
+ * 组件渲染html标签
587
+ */
588
+ tag: {
589
+ type: String,
590
+ default: "div"
591
+ },
592
+ /**
593
+ * 宽高自适应
594
+ */
595
+ fit: {
596
+ type: Boolean,
597
+ default: !1
598
+ },
599
+ /**
600
+ * 指定高度,fit 为true 失效
601
+ */
602
+ width: {
603
+ type: [String, Number]
604
+ },
605
+ /**
606
+ * 指定高度,fit 为true失效
607
+ */
608
+ height: {
609
+ type: [String, Number]
610
+ },
611
+ /**
612
+ * 开启flex布局
613
+ */
614
+ flex: {
615
+ type: Boolean,
616
+ default: !0
617
+ },
618
+ /**
619
+ * inline-flex
620
+ */
621
+ inline: {
622
+ type: Boolean
623
+ },
624
+ /**
625
+ * flex主轴方向
626
+ */
627
+ direction: {
628
+ type: String,
629
+ default: "row"
630
+ },
631
+ /**
632
+ * 换行
633
+ */
634
+ wrap: {
635
+ type: String,
636
+ default: "nowrap"
637
+ },
638
+ /**
639
+ * 主轴上的对齐方式。
640
+ */
641
+ justify: {
642
+ type: String,
643
+ default: "flex-start"
644
+ },
645
+ /**
646
+ * 交叉轴上对齐方式
647
+ */
648
+ align: {
649
+ type: String,
650
+ default: "flex-start"
651
+ },
652
+ /**
653
+ * 多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用
654
+ */
655
+ alignContent: {
656
+ type: String,
657
+ default: "stretch"
658
+ },
659
+ /**
660
+ * 放大
661
+ */
662
+ grow: {
663
+ type: Boolean,
664
+ default: !1
665
+ },
666
+ /**
667
+ * 缩小
668
+ */
669
+ shrink: {
670
+ type: Boolean,
671
+ default: !1
672
+ },
673
+ /**
674
+ * 单个项目有与其他项目不一样的对齐方式。可覆盖容器的align-items属性
675
+ */
676
+ alignSelf: {
677
+ type: String,
678
+ default: "auto"
679
+ },
680
+ /**
681
+ * css overflow
682
+ */
683
+ overflow: {
684
+ type: String
685
+ },
686
+ /**
687
+ * 内边距
688
+ */
689
+ padding: {
690
+ type: Boolean,
691
+ default: !1
692
+ },
693
+ // 嵌套子组件加间隔
694
+ gap: {
695
+ type: Boolean
696
+ },
697
+ autoPointer: {
698
+ type: Boolean
699
+ }
700
+ }, E = /* @__PURE__ */ P({
701
+ name: "XContainer",
702
+ __name: "Container",
703
+ props: dn,
704
+ setup(a) {
705
+ const o = a, e = Je(), t = pe(), l = y(() => {
706
+ const i = t?.parent;
707
+ if (!i)
708
+ return !1;
709
+ const r = i.proxy;
710
+ return r.$options.name === "XContainer" || !!r.flex;
711
+ }), s = y(() => ({
712
+ "is-fit": o.fit,
713
+ "is-flex": o.flex && !o.inline,
714
+ "is-inline-flex": o.flex && o.inline,
715
+ [`is-direction-${o.direction}`]: o.flex && o.direction !== "row",
716
+ [`is-wrap-${o.wrap}`]: o.flex && o.wrap !== "nowrap",
717
+ [`is-justify-${o.justify}`]: o.flex && o.justify !== "flex-start",
718
+ [`is-align-${o.align}`]: o.flex && o.align !== "flex-start",
719
+ [`is-align-content-${o.alignContent}`]: o.flex && o.alignContent !== "stretch",
720
+ "is-grow": o.grow ?? l.value,
721
+ "is-shrink": l.value && o.shrink,
722
+ [`is-align-self-${o.alignSelf}`]: l.value && o.alignSelf !== "auto",
723
+ [`is-overflow-${o.overflow}`]: !!o.overflow,
724
+ "is-padding": !!o.padding,
725
+ "is-pointer": o.autoPointer && !!e.onClick,
726
+ "is-gap": !!o.gap
727
+ })), c = y(() => {
728
+ const { width: i, height: r, fit: p } = o;
729
+ return p ? null : {
730
+ width: i ? q(i) : void 0,
731
+ height: r ? q(r) : void 0
732
+ };
733
+ });
734
+ return (i, r) => (u(), g(W(o.tag), {
735
+ class: Z(["x-container", s.value]),
736
+ style: fe(c.value)
737
+ }, {
738
+ default: d(() => [
739
+ x(i.$slots, "default")
740
+ ]),
741
+ _: 3
742
+ }, 8, ["class", "style"]));
743
+ }
744
+ }), pn = {
745
+ size: {
746
+ type: String,
747
+ default: "default"
748
+ },
749
+ content: {
750
+ type: String,
751
+ default: ""
752
+ },
753
+ subtitle: {
754
+ type: String
755
+ },
756
+ icon: {
757
+ type: [String, Object]
758
+ },
759
+ border: {
760
+ type: Boolean
761
+ },
762
+ more: {
763
+ type: Boolean
764
+ }
765
+ }, fn = {
766
+ key: 0,
767
+ class: "x-header__actions"
768
+ }, Bt = /* @__PURE__ */ P({
769
+ name: "XHeader",
770
+ inheritAttrs: !1,
771
+ __name: "Header",
772
+ props: pn,
773
+ setup(a) {
774
+ const o = a, e = _e(Ae(o, "icon")), t = Je(), l = y(() => ({
775
+ [`is-size-${o.size}`]: !!o.size && o.size !== "default",
776
+ "is-border": o.border,
777
+ "is-pointer": !!t.onClick
778
+ }));
779
+ return (s, c) => (u(), g(n(E), {
780
+ class: Z(["x-header", l.value]),
781
+ justify: "space-between",
782
+ align: "center"
783
+ }, {
784
+ default: d(() => [
785
+ _(n(E), {
786
+ align: "center",
787
+ class: Z(["x-header__wrapper", l.value]),
788
+ grow: ""
789
+ }, {
790
+ default: d(() => [
791
+ n(e) ? (u(), g(W(n(e)), {
792
+ key: 0,
793
+ class: "x-header__icon",
794
+ onClick: n(t).onClickIcon || n(t).onClick
795
+ }, null, 8, ["onClick"])) : v("", !0),
796
+ H("span", {
797
+ class: "x-header__content",
798
+ onClick: c[0] || (c[0] = //@ts-ignore
799
+ (...i) => n(t).onClick && n(t).onClick(...i))
800
+ }, [
801
+ x(s.$slots, "default", {}, () => [
802
+ R(O(o.content), 1)
803
+ ])
804
+ ]),
805
+ o.more ? (u(), g(n(re), {
806
+ key: 1,
807
+ class: "x-header__more",
808
+ icon: n(_o)
809
+ }, null, 8, ["icon"])) : v("", !0),
810
+ o.subtitle || s.$slots.subtitle ? (u(), C("span", {
811
+ key: 2,
812
+ class: "x-header__subtitle",
813
+ onClick: c[1] || (c[1] = //@ts-ignore
814
+ (...i) => n(t).onClick && n(t).onClick(...i))
815
+ }, [
816
+ x(s.$slots, "subtitle", {}, () => [
817
+ R(O(o.subtitle), 1)
818
+ ])
819
+ ])) : v("", !0)
820
+ ]),
821
+ _: 3
822
+ }, 8, ["class"]),
823
+ s.$slots.actions ? (u(), C("div", fn, [
824
+ x(s.$slots, "actions")
825
+ ])) : v("", !0)
826
+ ]),
827
+ _: 3
828
+ }, 8, ["class"]));
829
+ }
830
+ }), mn = {
831
+ /**
832
+ * 宽高自适应
833
+ */
834
+ fit: {
835
+ type: Boolean,
836
+ default: !1
837
+ },
838
+ /**
839
+ * 指定高度,fit 为true 失效
840
+ */
841
+ width: {
842
+ type: [String, Number]
843
+ },
844
+ /**
845
+ * 指定高度,fit 为true失效
846
+ */
847
+ height: {
848
+ type: [String, Number]
849
+ },
850
+ /**
851
+ * 显示边框
852
+ */
853
+ border: {
854
+ type: Boolean,
855
+ default: !0
856
+ },
857
+ /**
858
+ * 圆角
859
+ */
860
+ radius: {
861
+ type: Boolean,
862
+ default: !0
863
+ },
864
+ /**
865
+ * 卡片模式
866
+ */
867
+ card: {
868
+ type: Boolean
869
+ },
870
+ /**
871
+ * 尺寸
872
+ */
873
+ size: {
874
+ type: String
875
+ },
876
+ /**
877
+ * 阴影设置
878
+ */
879
+ shadow: {
880
+ type: String
881
+ },
882
+ /**
883
+ * 头部设置
884
+ */
885
+ header: {
886
+ type: [String, Object]
887
+ },
888
+ body: {
889
+ type: Object
890
+ },
891
+ footer: {
892
+ type: Object
893
+ }
894
+ }, Se = /* @__PURE__ */ P({
895
+ name: "XPanel",
896
+ __name: "Panel",
897
+ props: mn,
898
+ setup(a, { expose: o }) {
899
+ const e = a, t = D(), l = y(() => ({
900
+ "x-panel--card": !!e.card,
901
+ "x-panel--default": !e.card,
902
+ [`is-${e.size}`]: !!e.size && e.size !== "default",
903
+ "is-border": !!e.border,
904
+ "is-radius": !!e.radius,
905
+ [`is-shadow-${e.shadow}`]: !!e.shadow && e.shadow !== "none"
906
+ })), s = y(() => e.header === null ? null : typeof e.header == "string" ? {
907
+ content: e.header,
908
+ size: e.size
909
+ } : {
910
+ ...e.header,
911
+ size: e.size
912
+ }), c = y(() => e.fit || e.height ? "auto" : void 0);
913
+ return o({
914
+ bodyRef: t
915
+ }), (i, r) => (u(), g(n(E), {
916
+ class: Z(["x-panel", l.value]),
917
+ direction: "column",
918
+ fit: e.fit,
919
+ width: e.width,
920
+ height: e.height
921
+ }, {
922
+ default: d(() => [
923
+ s.value ? (u(), g(n(E), {
924
+ key: 0,
925
+ flex: !1,
926
+ class: "x-panel__header"
927
+ }, {
928
+ default: d(() => [
929
+ x(i.$slots, "header", {}, () => [
930
+ _(n(Bt), le(be(s.value)), {
931
+ default: d(() => [
932
+ x(i.$slots, "title")
933
+ ]),
934
+ actions: d(() => [
935
+ x(i.$slots, "actions")
936
+ ]),
937
+ _: 3
938
+ }, 16)
939
+ ])
940
+ ]),
941
+ _: 3
942
+ })) : v("", !0),
943
+ _(n(E), F({
944
+ ref_key: "bodyRef",
945
+ ref: t,
946
+ flex: !1,
947
+ overflow: c.value,
948
+ grow: "",
949
+ padding: "",
950
+ class: "x-panel__body"
951
+ }, e.body), {
952
+ default: d(() => [
953
+ x(i.$slots, "default")
954
+ ]),
955
+ _: 3
956
+ }, 16, ["overflow"]),
957
+ i.$slots.footer ? (u(), g(n(E), F({
958
+ key: 1,
959
+ flex: !1,
960
+ padding: "",
961
+ class: "x-panel__footer"
962
+ }, e.footer), {
963
+ default: d(() => [
964
+ x(i.$slots, "footer")
965
+ ]),
966
+ _: 3
967
+ }, 16)) : v("", !0)
968
+ ]),
969
+ _: 3
970
+ }, 8, ["class", "fit", "width", "height"]));
971
+ }
972
+ }), ut = "user-select-none";
973
+ class dt {
974
+ constructor(o, e = {}) {
975
+ this.el = o, this.options = e, this.scope = mt(), this.scope.run(() => {
976
+ this.init();
977
+ });
978
+ }
979
+ scope;
980
+ dragging = !1;
981
+ getHandle() {
982
+ const { selector: o, handle: e } = this.options;
983
+ return o ? this.el.querySelector(o) : e;
984
+ }
985
+ getTarget() {
986
+ const { target: o = "body" } = this.options;
987
+ return typeof o == "string" ? document.querySelector(o) : n(o) || document.body;
988
+ }
989
+ init() {
990
+ const { el: o, options: e } = this, { disabled: t, delay: l = 150, onStart: s, onEnd: c } = e;
991
+ if (t)
992
+ return;
993
+ let i = null;
994
+ const r = this.getHandle(), p = this.getTarget();
995
+ let f = o.getBoundingClientRect(), m = null;
996
+ const { x: h, y: b } = Do(o, {
997
+ initialValue: { x: f.x, y: f.y },
998
+ ...e,
999
+ handle: r,
1000
+ onStart: (w, M) => {
1001
+ document.body.classList.add(ut), clearTimeout(i), i = setTimeout(() => {
1002
+ this.dragging = !0, f = o.getBoundingClientRect(), m = p?.getBoundingClientRect(), s && s(w, M);
1003
+ }, l);
1004
+ },
1005
+ onEnd: (w, M) => {
1006
+ if (clearTimeout(i), document.body.classList.remove(ut), this.dragging && m) {
1007
+ this.dragging = !1;
1008
+ const { x: z, y: I } = w, V = this.getPosition(m, f, z, I);
1009
+ c && c(V, M), m = null;
1010
+ }
1011
+ }
1012
+ });
1013
+ L([h, b], () => {
1014
+ if (this.dragging && m) {
1015
+ const w = this.getPosition(m, f, h.value, b.value);
1016
+ o.style.left = `${w.x}px`, o.style.top = `${w.y}px`;
1017
+ }
1018
+ });
1019
+ }
1020
+ getPosition(o, e, t, l) {
1021
+ const { edge: s = 50 } = this.options, c = -e.width + s, i = o.width - s, r = 0, p = o.height - s, f = Math.min(i, Math.max(t, c)), m = Math.min(p, Math.max(l, r));
1022
+ return {
1023
+ x: f,
1024
+ y: m
1025
+ };
1026
+ }
1027
+ destory() {
1028
+ this.scope.stop();
1029
+ }
1030
+ }
1031
+ const gn = {
1032
+ mounted(a, o) {
1033
+ const e = o.value || {}, t = new dt(a, e);
1034
+ a.__draggable__ = t;
1035
+ },
1036
+ updated(a, o) {
1037
+ const e = o.value || {};
1038
+ let t = a.__draggable__;
1039
+ t && !Ge(t.options, e) && (t.destory(), a.__draggable__ = new dt(a, e));
1040
+ },
1041
+ unmounted(a) {
1042
+ const o = a.__draggable__;
1043
+ o && (o.destory(), a.__draggable__ = null);
1044
+ }
1045
+ }, He = "user-select-none";
1046
+ class pt {
1047
+ constructor(o, e = {}) {
1048
+ this.el = o, this.options = e, this.scope = mt(), this.scope.run(() => {
1049
+ this.init();
1050
+ });
1051
+ }
1052
+ scope;
1053
+ resizing = D(!1);
1054
+ direction = D("");
1055
+ MIE = null;
1056
+ cleanMousedown;
1057
+ cleanMouseup;
1058
+ init() {
1059
+ const { el: o, options: e } = this, { disabled: t, onStart: l, onEnd: s } = e;
1060
+ if (t)
1061
+ return;
1062
+ this.MIE = Ro(o), this.cleanMousedown = De(document, "mousedown", () => {
1063
+ this.direction?.value && this.MIE && (this.resizing.value = !0, o.classList.add("is-resizing", `is-${this.direction.value}-resizing`), l && l(this.direction.value, this.MIE));
1064
+ }), this.cleanMouseup = De(document, "mouseup", () => {
1065
+ this.resizing.value && this.direction?.value && this.MIE && (o.classList.remove(
1066
+ "is-resizing",
1067
+ `is-${this.direction.value}-resizing`
1068
+ ), s && s(this.direction.value, this.MIE)), this.resizing.value = !1;
1069
+ }), L(this.direction, (r) => {
1070
+ const p = document.body;
1071
+ p.style.cursor = r ? `${r}-resize` : "", r ? p.classList.add(He) : p.classList.remove(He);
1072
+ });
1073
+ const { x: c, y: i } = this.MIE;
1074
+ L([c, i], () => {
1075
+ this.resizing.value ? this.resize() : this.direction.value = this.getDirection();
1076
+ });
1077
+ }
1078
+ resize() {
1079
+ const { MIE: o, direction: e, resizing: t, options: l, el: s } = this, c = e?.value || "";
1080
+ if (!o || !t.value || !c)
1081
+ return;
1082
+ const { x: i, y: r, elementX: p, elementY: f, elementHeight: m, elementWidth: h } = o, { onResizing: b } = l, {
1083
+ minWidth: w = 0,
1084
+ minHeight: M = 0,
1085
+ maxWidth: z = 99999,
1086
+ maxHeight: I = 99999
1087
+ } = l;
1088
+ if (c.includes("e")) {
1089
+ const V = Math.min(Math.max(p.value, w), z);
1090
+ s.style.width = `${V}px`;
1091
+ }
1092
+ if (c.includes("s")) {
1093
+ const V = Math.min(Math.max(f.value, M), I);
1094
+ s.style.height = `${V}px`;
1095
+ }
1096
+ if (c.includes("w")) {
1097
+ const V = Math.min(
1098
+ Math.max(h.value - p.value, w),
1099
+ z
1100
+ );
1101
+ s.style.width = `${V}px`, s.style.left = `${i.value}px`;
1102
+ }
1103
+ if (c.includes("n")) {
1104
+ const V = Math.min(
1105
+ Math.max(m.value - f.value, M),
1106
+ I
1107
+ );
1108
+ this.el.style.height = `${V}px`, this.el.style.top = `${r.value}px`;
1109
+ }
1110
+ b && b(c, o);
1111
+ }
1112
+ getDirection() {
1113
+ if (!this.MIE)
1114
+ return "";
1115
+ const { elementX: o, elementY: e, elementHeight: t, elementWidth: l, isOutside: s } = this.MIE;
1116
+ if (s.value)
1117
+ return "";
1118
+ const { dirs: c = ["n", "s", "w", "e"], edge: i = 5 } = this.options;
1119
+ let r = "";
1120
+ return c.includes("n") && e.value <= i ? r += "n" : c.includes("s") && e.value > t.value - i && (r += "s"), c.includes("w") && o.value <= i ? r += "w" : c.includes("e") && o.value > l.value - i && (r += "e"), r;
1121
+ }
1122
+ destory() {
1123
+ const o = document.body;
1124
+ o.style.cursor = "", o.classList.remove(He), this.cleanMousedown && this.cleanMousedown(), this.cleanMouseup && this.cleanMouseup(), this.MIE?.stop(), this.scope.stop();
1125
+ }
1126
+ }
1127
+ const Pt = {
1128
+ mounted(a, o) {
1129
+ const e = o.value || {}, t = new pt(a, e);
1130
+ a.__resizable__ = t;
1131
+ },
1132
+ updated(a, o) {
1133
+ const e = o.value || {};
1134
+ let t = a.__resizable__;
1135
+ t && !Ge(t.options, e) && (t.destory(), a.__resizable__ = new pt(a, e));
1136
+ },
1137
+ unmounted(a) {
1138
+ const o = a.__resizable__;
1139
+ o && (o.destory(), a.__resizable__ = null);
1140
+ }
1141
+ }, yn = {
1142
+ modelValue: {
1143
+ type: Boolean,
1144
+ default: !0
1145
+ },
1146
+ title: {
1147
+ type: String
1148
+ },
1149
+ subtitle: {
1150
+ type: String
1151
+ },
1152
+ icon: {
1153
+ type: [String, Object]
1154
+ },
1155
+ size: {
1156
+ type: String,
1157
+ default: "default"
1158
+ },
1159
+ width: {
1160
+ type: [Number, String],
1161
+ default: "70%"
1162
+ },
1163
+ height: {
1164
+ type: [Number, String],
1165
+ default: "70%"
1166
+ },
1167
+ left: {
1168
+ type: [Number, String]
1169
+ },
1170
+ top: {
1171
+ type: [Number, String]
1172
+ },
1173
+ modal: {
1174
+ type: Boolean,
1175
+ default: !0
1176
+ },
1177
+ draggable: {
1178
+ type: [Boolean, Object],
1179
+ default: !0
1180
+ },
1181
+ resizable: {
1182
+ type: [Boolean, Object]
1183
+ },
1184
+ closable: {
1185
+ type: Boolean,
1186
+ default: !0
1187
+ },
1188
+ maximizable: {
1189
+ type: Boolean,
1190
+ default: !1
1191
+ },
1192
+ minimizable: {
1193
+ type: Boolean,
1194
+ default: !1
1195
+ },
1196
+ mode: {
1197
+ type: String,
1198
+ default: "normal"
1199
+ },
1200
+ content: {
1201
+ type: Object
1202
+ },
1203
+ src: {
1204
+ type: String
1205
+ },
1206
+ componentInstance: {
1207
+ type: Object
1208
+ },
1209
+ beforeClose: {
1210
+ type: Function
1211
+ },
1212
+ submit: {
1213
+ type: [Boolean, String]
1214
+ },
1215
+ cancel: {
1216
+ type: [Boolean, String]
1217
+ },
1218
+ bodyPadding: {
1219
+ type: Boolean,
1220
+ default: !0
1221
+ },
1222
+ primary: {
1223
+ type: Boolean
1224
+ }
1225
+ };
1226
+ let ve = 1e3;
1227
+ function vn(a, o) {
1228
+ const { width: e, height: t } = Ct(o), l = Re({
1229
+ mode: a.mode || "normal",
1230
+ wrapperWidth: 0,
1231
+ wrapperHeight: 0,
1232
+ width: 0,
1233
+ height: 0,
1234
+ top: 0,
1235
+ left: 0,
1236
+ zIndex: ++ve,
1237
+ dragging: !1,
1238
+ resizing: !1
1239
+ });
1240
+ return L([e, t], ([s, c]) => {
1241
+ l.wrapperWidth = s, l.wrapperHeight = c, l.width = Me(a.width, s), l.height = Me(a.height, c), l.left = a.left ? Me(a.left, s) - l.width / 2 : Math.max(Math.floor((s - l.width) / 2), 0), l.top = a.top ? Me(a.top, c) : Math.max(Math.floor((c - l.height) / 2), 0);
1242
+ }), L(l, (s) => {
1243
+ ve = Math.max(s.zIndex, ve);
1244
+ }), {
1245
+ state: l,
1246
+ normal: y(() => l.mode === "normal"),
1247
+ maximized: y(() => l.mode === "maximized"),
1248
+ minimized: y(() => l.mode === "minimized")
1249
+ };
1250
+ }
1251
+ function bn(a, o) {
1252
+ const e = y(() => {
1253
+ const { width: c, height: i, top: r, left: p, zIndex: f } = o;
1254
+ return {
1255
+ width: `${c}px`,
1256
+ height: `${i}px`,
1257
+ top: `${r}px`,
1258
+ left: `${p}px`,
1259
+ zIndex: f
1260
+ };
1261
+ }), t = y(() => ({
1262
+ [`is-${o.mode}`]: !!o.mode,
1263
+ "is-draggable": !!a.draggable,
1264
+ "is-resizable": !!a.resizable,
1265
+ "is-primary": !!a.primary
1266
+ })), l = y(() => ({
1267
+ [`is-${o.mode}`]: !!o.mode,
1268
+ "is-dragging": o.dragging,
1269
+ "is-resizing": o.resizing
1270
+ })), s = y(() => ({
1271
+ zIndex: o.zIndex
1272
+ }));
1273
+ return {
1274
+ styles: e,
1275
+ classes: t,
1276
+ wrapperClass: l,
1277
+ modalStyle: s
1278
+ };
1279
+ }
1280
+ function hn(a, o, e) {
1281
+ const t = (f) => {
1282
+ o.mode = f, ["maximized", "minimized", "normal"].includes(f) && e(f), e("modeChange", f);
1283
+ }, l = async () => {
1284
+ (!a.beforeClose || await a.beforeClose()) && (e("update:modelValue", !1), e("close"), e("destroy"));
1285
+ };
1286
+ return {
1287
+ close: l,
1288
+ changeMode: t,
1289
+ show: () => t("normal"),
1290
+ hide: () => t("minimized"),
1291
+ active: (f) => {
1292
+ const m = f.target.nodeName || "";
1293
+ ["INPUT", "TEXTAREA", "RADIO", "CHECKBOX"].includes(
1294
+ m.toUpperCase()
1295
+ ) || (o.zIndex = Math.max(o.zIndex, ++ve));
1296
+ },
1297
+ submit: () => e("submit"),
1298
+ cancel: () => {
1299
+ e("cancel"), l();
1300
+ }
1301
+ };
1302
+ }
1303
+ function _n(a, o, e, t) {
1304
+ return y(() => {
1305
+ const l = typeof a.draggable == "boolean" ? !a.draggable : !!a.draggable?.disabled;
1306
+ return {
1307
+ ...Ye(a.draggable) ? a.draggable : {},
1308
+ disabled: l,
1309
+ target: t,
1310
+ selector: ".x-panel__header",
1311
+ onStart(s) {
1312
+ o.dragging = !0, o.zIndex = Math.max(o.zIndex, ++ve), e("dragStart", s);
1313
+ },
1314
+ onMove(s) {
1315
+ e("dragging", s);
1316
+ },
1317
+ onEnd(s) {
1318
+ if (o.mode === "maximized")
1319
+ return;
1320
+ const { x: c, y: i } = s;
1321
+ o.left = c, o.top = i, o.dragging = !1, e("dragEnd", s);
1322
+ }
1323
+ };
1324
+ });
1325
+ }
1326
+ function kn(a, o, e) {
1327
+ return y(() => {
1328
+ const t = typeof a.resizable == "boolean" ? !a.resizable : !!a.resizable?.disabled;
1329
+ return {
1330
+ minWidth: 200,
1331
+ minHeight: 150,
1332
+ ...Ye(a.resizable) ? a.resizable : {},
1333
+ disabled: t,
1334
+ dirs: ["e", "s", "w"],
1335
+ onStart(l, s) {
1336
+ o.resizing = !0, o.zIndex = Math.max(o.zIndex, ++ve), e("resizeStart", l, s);
1337
+ },
1338
+ onResizing(l, s) {
1339
+ e("resizing", l, s);
1340
+ },
1341
+ onEnd(l, s) {
1342
+ o.left = s.elementPositionX.value, o.top = s.elementPositionY.value, o.width = s.elementWidth.value, o.height = s.elementHeight.value, o.resizing = !1, e("resizeEnd", l, s);
1343
+ }
1344
+ };
1345
+ });
1346
+ }
1347
+ function wn(a, o) {
1348
+ const e = a.componentInstance;
1349
+ if (!e)
1350
+ return;
1351
+ let t = null;
1352
+ return gt(() => {
1353
+ const l = n(o), s = n(l?.bodyRef);
1354
+ t = e.$el, s && s.$el && s.$el.appendChild(t);
1355
+ }), yt(() => {
1356
+ t && t.parentNode && t.parentNode.removeChild(t);
1357
+ }), {
1358
+ componentInstance: e
1359
+ };
1360
+ }
1361
+ const xn = ["src"], tt = /* @__PURE__ */ P({
1362
+ name: "XDialog",
1363
+ __name: "Dialog",
1364
+ props: yn,
1365
+ emits: ["update:modelValue", "open", "close", "destroy", "maximized", "minimized", "normal", "modeChange", "dragStart", "dragging", "dragEnd", "resizeStart", "resizeEnd", "resizing", "submit", "cancel"],
1366
+ setup(a, { expose: o, emit: e }) {
1367
+ const t = a, l = e, s = pe(), c = D(), i = D(), { state: r, maximized: p, minimized: f, normal: m } = vn(t, c), { styles: h, classes: b, wrapperClass: w, modalStyle: M } = bn(t, r), { changeMode: z, active: I, close: V, show: S, hide: B, submit: T, cancel: j } = hn(
1368
+ t,
1369
+ r,
1370
+ l
1371
+ ), k = _n(t, r, l, c), U = kn(t, r, l), K = wn(t, i);
1372
+ Qe(async () => {
1373
+ t.modelValue && (await ye(), s && l("open", s));
1374
+ });
1375
+ const ce = y(() => i.value?.$el);
1376
+ return o({
1377
+ $vtjEl: ce,
1378
+ panelRef: i,
1379
+ state: r,
1380
+ maximized: p,
1381
+ minimized: f,
1382
+ changeMode: z,
1383
+ show: S,
1384
+ hide: B,
1385
+ submit: T,
1386
+ cancel: j,
1387
+ componentInstance: K
1388
+ }), (Q, ee) => t.modelValue ? (u(), g(vt, {
1389
+ key: 0,
1390
+ to: "body"
1391
+ }, [
1392
+ H("div", {
1393
+ ref_key: "wrapper",
1394
+ ref: c,
1395
+ class: Z(["x-dialog__wrapper", n(w)])
1396
+ }, [
1397
+ t.modal ? (u(), C("div", {
1398
+ key: 0,
1399
+ class: "x-dialog__modal",
1400
+ style: fe(n(M))
1401
+ }, null, 4)) : v("", !0),
1402
+ G((u(), g(n(Se), F({
1403
+ ref_key: "panelRef",
1404
+ ref: i,
1405
+ class: ["x-dialog", n(b)],
1406
+ card: "",
1407
+ shadow: "always",
1408
+ header: { icon: t.icon, subtitle: t.subtitle },
1409
+ width: "800px",
1410
+ height: "600px",
1411
+ footer: { justify: "space-between", flex: !0, align: "center" },
1412
+ style: n(h),
1413
+ size: t.size,
1414
+ body: { padding: t.bodyPadding },
1415
+ onClick: n(I)
1416
+ }, Q.$attrs), he({
1417
+ title: d(() => [
1418
+ R(O(t.title), 1)
1419
+ ]),
1420
+ actions: d(() => [
1421
+ x(Q.$slots, "actions"),
1422
+ t.minimizable ? (u(), g(n(te), {
1423
+ key: 0,
1424
+ icon: n(ko),
1425
+ size: t.size,
1426
+ mode: "icon",
1427
+ type: "primary",
1428
+ background: "hover",
1429
+ onClick: ee[0] || (ee[0] = (ue) => n(z)("minimized"))
1430
+ }, null, 8, ["icon", "size"])) : v("", !0),
1431
+ t.maximizable ? (u(), C(J, { key: 1 }, [
1432
+ n(m) ? (u(), g(n(te), {
1433
+ key: 1,
1434
+ icon: n(xo),
1435
+ size: t.size,
1436
+ mode: "icon",
1437
+ type: "primary",
1438
+ background: "hover",
1439
+ onClick: ee[2] || (ee[2] = (ue) => n(z)("maximized"))
1440
+ }, null, 8, ["icon", "size"])) : (u(), g(n(te), {
1441
+ key: 0,
1442
+ icon: n(wo),
1443
+ size: t.size,
1444
+ mode: "icon",
1445
+ type: "primary",
1446
+ background: "hover",
1447
+ onClick: ee[1] || (ee[1] = (ue) => n(z)("normal"))
1448
+ }, null, 8, ["icon", "size"]))
1449
+ ], 64)) : v("", !0),
1450
+ t.closable ? (u(), g(n(te), {
1451
+ key: 2,
1452
+ icon: n(So),
1453
+ size: t.size,
1454
+ mode: "icon",
1455
+ type: "danger",
1456
+ background: "hover",
1457
+ onClick: n(V)
1458
+ }, null, 8, ["icon", "size", "onClick"])) : v("", !0)
1459
+ ]),
1460
+ default: d(() => [
1461
+ x(Q.$slots, "default", {}, () => [
1462
+ t.content ? (u(), g(W(t.content), { key: 0 })) : v("", !0),
1463
+ t.src ? (u(), C("iframe", {
1464
+ key: 1,
1465
+ src: t.src,
1466
+ class: "x-dialog__frame"
1467
+ }, null, 8, xn)) : v("", !0)
1468
+ ])
1469
+ ]),
1470
+ _: 2
1471
+ }, [
1472
+ t.cancel || t.submit || Q.$slots.footer || Q.$slots.extra || Q.$slots.handle ? {
1473
+ name: "footer",
1474
+ fn: d(() => [
1475
+ x(Q.$slots, "footer", {}, () => [
1476
+ _(n(E), { align: "center" }, {
1477
+ default: d(() => [
1478
+ x(Q.$slots, "extra")
1479
+ ]),
1480
+ _: 3
1481
+ }),
1482
+ _(n(E), { align: "center" }, {
1483
+ default: d(() => [
1484
+ x(Q.$slots, "handle"),
1485
+ t.cancel ? (u(), g(n(ie), {
1486
+ key: 0,
1487
+ type: "default",
1488
+ size: t.size,
1489
+ onClick: n(j)
1490
+ }, {
1491
+ default: d(() => [
1492
+ R(O(typeof t.cancel == "string" ? t.cancel : "取消"), 1)
1493
+ ]),
1494
+ _: 1
1495
+ }, 8, ["size", "onClick"])) : v("", !0),
1496
+ t.submit ? (u(), g(n(ie), {
1497
+ key: 1,
1498
+ type: "primary",
1499
+ size: t.size,
1500
+ onClick: n(T)
1501
+ }, {
1502
+ default: d(() => [
1503
+ R(O(typeof t.submit == "string" ? t.submit : "确定"), 1)
1504
+ ]),
1505
+ _: 1
1506
+ }, 8, ["size", "onClick"])) : v("", !0)
1507
+ ]),
1508
+ _: 3
1509
+ })
1510
+ ])
1511
+ ]),
1512
+ key: "0"
1513
+ } : void 0
1514
+ ]), 1040, ["header", "class", "style", "size", "body", "onClick"])), [
1515
+ [n(gn), n(k)],
1516
+ [n(Pt), n(U)]
1517
+ ])
1518
+ ], 2)
1519
+ ])) : v("", !0);
1520
+ }
1521
+ });
1522
+ function ot(a, o) {
1523
+ const e = document.createElement("div"), t = _(tt, a);
1524
+ t.appContext = o ?? ot._context, nt(t, e);
1525
+ const l = () => {
1526
+ nt(null, e), e.parentNode?.removeChild(e);
1527
+ };
1528
+ return t.props.onDestroy = () => {
1529
+ l();
1530
+ }, document.body.appendChild(e), {
1531
+ vnode: t,
1532
+ destroy: l
1533
+ };
1534
+ }
1535
+ const Sn = /* @__PURE__ */ H("div", { class: "x-mask-sidebar__helper" }, null, -1), zn = /* @__PURE__ */ P({
1536
+ __name: "Sidebar",
1537
+ props: {
1538
+ collapsed: { type: Boolean }
1539
+ },
1540
+ setup(a) {
1541
+ const o = a;
1542
+ return (e, t) => G((u(), g(n(E), {
1543
+ class: Z(["x-mask-sidebar", { "is-collapsed": o.collapsed }]),
1544
+ grow: !1,
1545
+ flex: "",
1546
+ direction: "column"
1547
+ }, {
1548
+ default: d(() => [
1549
+ x(e.$slots, "brand"),
1550
+ _(n(E), {
1551
+ class: "x-mask-sidebar__wrapper",
1552
+ flex: "",
1553
+ grow: "",
1554
+ direction: "column",
1555
+ justify: "space-between",
1556
+ align: "center"
1557
+ }, {
1558
+ default: d(() => [
1559
+ x(e.$slots, "default"),
1560
+ Sn
1561
+ ]),
1562
+ _: 3
1563
+ })
1564
+ ]),
1565
+ _: 3
1566
+ }, 8, ["class"])), [
1567
+ [n(Pt), {
1568
+ dirs: ["e"],
1569
+ disabled: o.collapsed,
1570
+ maxWidth: 500,
1571
+ minWidth: 200
1572
+ }]
1573
+ ]);
1574
+ }
1575
+ }), Cn = /* @__PURE__ */ P({
1576
+ __name: "SwitchBar",
1577
+ props: {
1578
+ collasped: { type: Boolean, default: !1 },
1579
+ favorite: { type: Boolean, default: !1 },
1580
+ keyword: {}
1581
+ },
1582
+ emits: [
1583
+ "update:collasped",
1584
+ "update:keyword",
1585
+ "update:favorite"
1586
+ ],
1587
+ setup(a, { emit: o }) {
1588
+ const e = a, t = o, l = D(!1), s = D(""), c = D(!1), i = () => {
1589
+ l.value = !0;
1590
+ }, r = () => {
1591
+ s.value = "", l.value = !1, t("update:keyword", s.value);
1592
+ }, p = () => {
1593
+ t("update:collasped", !e.collasped);
1594
+ }, f = () => {
1595
+ t("update:keyword", s.value);
1596
+ }, m = () => {
1597
+ t("update:favorite", c.value);
1598
+ };
1599
+ return (h, b) => (u(), g(n(E), {
1600
+ class: "x-mask-switch-bar",
1601
+ justify: "space-between",
1602
+ align: "center"
1603
+ }, {
1604
+ default: d(() => [
1605
+ e.collasped ? v("", !0) : (u(), g(n(E), {
1606
+ key: 0,
1607
+ class: "x-mask-switch-bar__left",
1608
+ grow: ""
1609
+ }, {
1610
+ default: d(() => [
1611
+ l.value ? v("", !0) : (u(), g(n(Ze), {
1612
+ key: 0,
1613
+ modelValue: c.value,
1614
+ "onUpdate:modelValue": b[0] || (b[0] = (w) => c.value = w),
1615
+ class: "x-mask-switch-bar__switch",
1616
+ "active-icon": n(xt),
1617
+ "inactive-icon": n(zo),
1618
+ onChange: m
1619
+ }, null, 8, ["modelValue", "active-icon", "inactive-icon"])),
1620
+ l.value ? (u(), g(n(Ce), {
1621
+ key: 1,
1622
+ modelValue: s.value,
1623
+ "onUpdate:modelValue": b[1] || (b[1] = (w) => s.value = w),
1624
+ class: "x-mask-switch-bar__input",
1625
+ size: "small",
1626
+ placeholder: "请输入查询关键字",
1627
+ onInput: f,
1628
+ "prefix-icon": n(We)
1629
+ }, {
1630
+ suffix: d(() => [
1631
+ _(n(re), {
1632
+ icon: n(St),
1633
+ onClick: r
1634
+ }, null, 8, ["icon"])
1635
+ ]),
1636
+ _: 1
1637
+ }, 8, ["modelValue", "prefix-icon"])) : v("", !0)
1638
+ ]),
1639
+ _: 1
1640
+ })),
1641
+ _(n(E), {
1642
+ class: Z(["x-mask-switch-bar__right", { "is-collasped": e.collasped }]),
1643
+ flex: "",
1644
+ align: "center",
1645
+ justify: "center"
1646
+ }, {
1647
+ default: d(() => [
1648
+ !l.value && !e.collasped ? (u(), g(n(te), {
1649
+ key: 0,
1650
+ icon: n(We),
1651
+ mode: "icon",
1652
+ background: "hover",
1653
+ size: "default",
1654
+ circle: "",
1655
+ onClick: i
1656
+ }, null, 8, ["icon"])) : v("", !0),
1657
+ e.collasped ? (u(), g(n(te), {
1658
+ key: 1,
1659
+ icon: n(Co),
1660
+ mode: "icon",
1661
+ size: "default",
1662
+ background: "hover",
1663
+ onClick: p,
1664
+ circle: ""
1665
+ }, null, 8, ["icon"])) : v("", !0),
1666
+ e.collasped ? v("", !0) : (u(), g(n(te), {
1667
+ key: 2,
1668
+ icon: n(To),
1669
+ mode: "icon",
1670
+ size: "default",
1671
+ background: "hover",
1672
+ circle: "",
1673
+ onClick: p
1674
+ }, null, 8, ["icon"]))
1675
+ ]),
1676
+ _: 1
1677
+ }, 8, ["class"])
1678
+ ]),
1679
+ _: 1
1680
+ }));
1681
+ }
1682
+ }), Tn = ["src"], $n = { key: 0 }, Mn = /* @__PURE__ */ P({
1683
+ __name: "Brand",
1684
+ props: {
1685
+ collapsed: { type: Boolean, default: !1 },
1686
+ logo: {},
1687
+ title: {},
1688
+ url: {}
1689
+ },
1690
+ setup(a) {
1691
+ const o = a, e = qe(), t = () => {
1692
+ o.url && e.push(o.url);
1693
+ };
1694
+ return (l, s) => (u(), g(n(E), {
1695
+ class: Z(["x-mask-brand", { "is-collapsed": o.collapsed }]),
1696
+ align: "center"
1697
+ }, {
1698
+ default: d(() => [
1699
+ _(n(E), {
1700
+ class: "x-mask-brand__logo",
1701
+ flex: "",
1702
+ justify: "center",
1703
+ align: "center",
1704
+ onClick: t
1705
+ }, {
1706
+ default: d(() => [
1707
+ x(l.$slots, "logo", {}, () => [
1708
+ o.logo ? (u(), C("img", {
1709
+ key: 0,
1710
+ src: o.logo
1711
+ }, null, 8, Tn)) : v("", !0)
1712
+ ])
1713
+ ]),
1714
+ _: 3
1715
+ }),
1716
+ _(n(E), {
1717
+ class: "x-mask-brand__title",
1718
+ flex: "",
1719
+ align: "center"
1720
+ }, {
1721
+ default: d(() => [
1722
+ o.title ? (u(), C("span", $n, [
1723
+ x(l.$slots, "title", {}, () => [
1724
+ R(O(o.title), 1)
1725
+ ])
1726
+ ])) : v("", !0)
1727
+ ]),
1728
+ _: 3
1729
+ })
1730
+ ]),
1731
+ _: 3
1732
+ }, 8, ["class"]));
1733
+ }
1734
+ }), Ee = "__favorites__", Ie = "__search__", En = /* @__PURE__ */ P({
1735
+ __name: "Menu",
1736
+ props: {
1737
+ collapse: { type: Boolean, default: !1 },
1738
+ keyword: {},
1739
+ favorite: { type: Boolean },
1740
+ favorites: {},
1741
+ flatMenus: {},
1742
+ menus: {},
1743
+ active: {}
1744
+ },
1745
+ emits: ["select"],
1746
+ setup(a, { emit: o }) {
1747
+ const e = a, t = y(() => e.menus || []), l = o, s = y(() => String(e.active?.id)), c = y(() => [
1748
+ {
1749
+ id: Ee,
1750
+ title: "收藏",
1751
+ icon: zt,
1752
+ children: e.favorites?.length ? e.favorites : [
1753
+ {
1754
+ id: Ee + "empty",
1755
+ disabled: !0,
1756
+ title: "暂无收藏菜单"
1757
+ }
1758
+ ]
1759
+ }
1760
+ ]), i = y(() => {
1761
+ const p = (e.keyword || "").trim(), f = p ? (e.flatMenus || []).filter((m) => m.title?.includes(p)) : [];
1762
+ return [
1763
+ {
1764
+ id: Ie,
1765
+ title: "搜索",
1766
+ icon: We,
1767
+ children: f?.length ? f : [
1768
+ {
1769
+ id: Ie + "empty",
1770
+ disabled: !0,
1771
+ title: "查询匹配不到菜单项"
1772
+ }
1773
+ ]
1774
+ }
1775
+ ];
1776
+ }), r = (p) => {
1777
+ l("select", p);
1778
+ };
1779
+ return (p, f) => (u(), C(J, null, [
1780
+ G(_(n(E), {
1781
+ class: "x-mask-menu",
1782
+ grow: "",
1783
+ flex: !1,
1784
+ overflow: "auto"
1785
+ }, {
1786
+ default: d(() => [
1787
+ G(_(n(de), {
1788
+ subMenu: {
1789
+ popperClass: "x-mask-menu-popper",
1790
+ teleported: !0,
1791
+ showTimeout: 200,
1792
+ hideTimeout: 200
1793
+ },
1794
+ data: t.value,
1795
+ "default-icon": n(me),
1796
+ collapse: !0,
1797
+ "collapse-transition": !1,
1798
+ "default-active": s.value,
1799
+ onSelect: r
1800
+ }, null, 8, ["data", "default-icon", "default-active"]), [
1801
+ [ne, e.collapse]
1802
+ ]),
1803
+ G(_(n(de), {
1804
+ subMenu: {
1805
+ popperClass: "x-mask-menu-popper",
1806
+ teleported: !0
1807
+ },
1808
+ data: t.value,
1809
+ "default-icon": n(me),
1810
+ collapse: !1,
1811
+ "collapse-transition": !1,
1812
+ "default-active": s.value,
1813
+ onSelect: r
1814
+ }, null, 8, ["data", "default-icon", "default-active"]), [
1815
+ [ne, !e.collapse]
1816
+ ]),
1817
+ t.value.length ? v("", !0) : (u(), g(n(_t), {
1818
+ key: 0,
1819
+ description: "暂无菜单数据"
1820
+ }))
1821
+ ]),
1822
+ _: 1
1823
+ }, 512), [
1824
+ [ne, !e.favorite && !e.keyword]
1825
+ ]),
1826
+ G(_(n(E), {
1827
+ class: "x-mask-menu",
1828
+ grow: "",
1829
+ flex: !1,
1830
+ overflow: "auto"
1831
+ }, {
1832
+ default: d(() => [
1833
+ G(_(n(de), {
1834
+ class: "x-mask-menu__favorites",
1835
+ subMenu: {
1836
+ popperClass: "x-mask-menu-popper",
1837
+ teleported: !0,
1838
+ showTimeout: 200,
1839
+ hideTimeout: 200
1840
+ },
1841
+ data: c.value,
1842
+ "default-icon": n(me),
1843
+ collapse: !0,
1844
+ "collapse-transition": !1,
1845
+ "default-active": s.value,
1846
+ "default-openeds": [Ee],
1847
+ onSelect: r
1848
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1849
+ [ne, e.collapse]
1850
+ ]),
1851
+ G(_(n(de), {
1852
+ class: "x-mask-menu__favorites",
1853
+ subMenu: {
1854
+ popperClass: "x-mask-menu-popper",
1855
+ teleported: !0,
1856
+ showTimeout: 200,
1857
+ hideTimeout: 200
1858
+ },
1859
+ data: c.value,
1860
+ "default-icon": n(me),
1861
+ collapse: !1,
1862
+ "collapse-transition": !1,
1863
+ "default-active": s.value,
1864
+ "default-openeds": [Ee],
1865
+ onSelect: r
1866
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1867
+ [ne, !e.collapse]
1868
+ ])
1869
+ ]),
1870
+ _: 1
1871
+ }, 512), [
1872
+ [ne, e.favorite && !e.keyword]
1873
+ ]),
1874
+ e.keyword ? G((u(), g(n(E), {
1875
+ key: 0,
1876
+ class: "x-mask-menu",
1877
+ grow: "",
1878
+ flex: !1,
1879
+ overflow: "auto"
1880
+ }, {
1881
+ default: d(() => [
1882
+ G(_(n(de), {
1883
+ class: "x-mask-menu__search",
1884
+ subMenu: {
1885
+ popperClass: "x-mask-menu-popper",
1886
+ teleported: !0,
1887
+ showTimeout: 200,
1888
+ hideTimeout: 200
1889
+ },
1890
+ data: i.value,
1891
+ "default-icon": n(me),
1892
+ collapse: !0,
1893
+ "collapse-transition": !1,
1894
+ "default-active": s.value,
1895
+ "default-openeds": [Ie],
1896
+ onSelect: r
1897
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1898
+ [ne, e.collapse]
1899
+ ]),
1900
+ G(_(n(de), {
1901
+ class: "x-mask-menu__search",
1902
+ subMenu: {
1903
+ popperClass: "x-mask-menu-popper",
1904
+ teleported: !0,
1905
+ showTimeout: 200,
1906
+ hideTimeout: 200
1907
+ },
1908
+ data: i.value,
1909
+ "default-icon": n(me),
1910
+ collapse: !1,
1911
+ "collapse-transition": !1,
1912
+ "default-active": s.value,
1913
+ "default-openeds": [Ie],
1914
+ onSelect: r
1915
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1916
+ [ne, !e.collapse]
1917
+ ])
1918
+ ]),
1919
+ _: 1
1920
+ }, 512)), [
1921
+ [ne, !!e.keyword]
1922
+ ]) : v("", !0)
1923
+ ], 64));
1924
+ }
1925
+ }), In = "data:image/png;base64,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", Bn = 140, Pn = {
1926
+ /**
1927
+ * 系统logo
1928
+ */
1929
+ logo: {
1930
+ type: String,
1931
+ default: In
1932
+ },
1933
+ /**
1934
+ * 系统标题
1935
+ */
1936
+ title: {
1937
+ type: String,
1938
+ default: "VTJ.PRO"
1939
+ },
1940
+ /**
1941
+ * 菜单项数据
1942
+ */
1943
+ menus: {
1944
+ type: [Array, Function],
1945
+ default() {
1946
+ return [];
1947
+ }
1948
+ },
1949
+ /**
1950
+ * 收藏菜单项
1951
+ */
1952
+ favorites: {
1953
+ type: [Array, Function],
1954
+ default() {
1955
+ return [];
1956
+ }
1957
+ },
1958
+ /**
1959
+ * 菜单项数据适配函数,用作转换菜单项数据
1960
+ */
1961
+ menuAdapter: {
1962
+ type: Function
1963
+ },
1964
+ /**
1965
+ * 主页Tab配置
1966
+ */
1967
+ home: {
1968
+ type: [String, Object],
1969
+ default: "/"
1970
+ },
1971
+ /**
1972
+ * 最大tabs数量
1973
+ */
1974
+ tabs: {
1975
+ type: Number,
1976
+ default: 20
1977
+ },
1978
+ /**
1979
+ * 右上角工具条配置
1980
+ */
1981
+ actions: {
1982
+ type: Array
1983
+ },
1984
+ /**
1985
+ * 用户头像图片url
1986
+ */
1987
+ avatar: {
1988
+ type: String
1989
+ },
1990
+ /**
1991
+ * 开启主题切换
1992
+ */
1993
+ theme: {
1994
+ type: Boolean
1995
+ },
1996
+ /**
1997
+ * 禁用框架容器
1998
+ */
1999
+ disabled: {
2000
+ type: Boolean
2001
+ },
2002
+ addFavorite: {
2003
+ type: Function
2004
+ },
2005
+ removeFavorite: {
2006
+ type: Function
2007
+ }
2008
+ }, Vt = Symbol(), At = Symbol(), Vn = { class: "x-mask-tabs__trigger" }, An = { key: 1 }, Dn = ["onDragstart", "onDragend"], Rn = { key: 1 }, On = /* @__PURE__ */ P({
2009
+ __name: "Tabs",
2010
+ props: {
2011
+ tabs: {},
2012
+ home: {},
2013
+ isActiveTab: { type: Function },
2014
+ value: {},
2015
+ favorites: {}
2016
+ },
2017
+ emits: ["click", "remove", "refresh", "toggleFavorite", "dialog"],
2018
+ setup(a, { emit: o }) {
2019
+ const e = a, t = o, l = (f) => {
2020
+ const m = !!e.favorites.find(
2021
+ (h) => h === f.menu || h.id === f.menu?.id
2022
+ );
2023
+ return [
2024
+ {
2025
+ icon: $o,
2026
+ label: "刷新",
2027
+ name: "refresh",
2028
+ value: f
2029
+ },
2030
+ "|",
2031
+ {
2032
+ icon: m ? xt : zt,
2033
+ label: "收藏",
2034
+ name: "favorite",
2035
+ value: f.menu,
2036
+ disabled: !f.menu
2037
+ },
2038
+ "|",
2039
+ {
2040
+ icon: Mo,
2041
+ label: "弹窗",
2042
+ name: "dialog",
2043
+ value: f
2044
+ }
2045
+ ];
2046
+ }, s = (f) => {
2047
+ const m = f.paneName;
2048
+ if (m === e.home.id) {
2049
+ t("click", e.home);
2050
+ return;
2051
+ }
2052
+ const h = e.tabs.find((b) => b.id === m);
2053
+ h && t("click", h);
2054
+ }, c = (f) => {
2055
+ const m = e.tabs.find((h) => h.id === f);
2056
+ m && t("remove", m);
2057
+ }, i = (f) => {
2058
+ switch (f.name) {
2059
+ case "refresh":
2060
+ t("refresh", f.value);
2061
+ break;
2062
+ case "favorite":
2063
+ t("toggleFavorite", f.value);
2064
+ break;
2065
+ case "dialog":
2066
+ t("dialog", f.value);
2067
+ break;
2068
+ }
2069
+ }, r = (f, m) => {
2070
+ m.dataTransfer && (m.dataTransfer.setData("tab", f.id), m.target && m.target.classList.add("is-dagging"));
2071
+ }, p = (f, m) => {
2072
+ m.target && m.target.classList.remove("is-dagging");
2073
+ };
2074
+ return (f, m) => (u(), g(n(E), {
2075
+ ref: "tabsRef",
2076
+ class: "x-mask-tabs",
2077
+ height: "100%",
2078
+ grow: "",
2079
+ flex: "",
2080
+ justify: "flex-end",
2081
+ direction: "column"
2082
+ }, {
2083
+ default: d(() => [
2084
+ _(n(kt), {
2085
+ type: "card",
2086
+ "model-value": e.value,
2087
+ onTabRemove: c,
2088
+ onTabClick: s
2089
+ }, {
2090
+ default: d(() => [
2091
+ e.home ? (u(), g(n(Le), {
2092
+ key: 0,
2093
+ name: e.home.id
2094
+ }, {
2095
+ label: d(() => [
2096
+ H("div", Vn, [
2097
+ e.home.icon ? (u(), g(W(n(_e)(e.home.icon)), { key: 0 })) : v("", !0),
2098
+ e.home.title ? (u(), C("span", An, O(e.home.title), 1)) : v("", !0)
2099
+ ])
2100
+ ]),
2101
+ _: 1
2102
+ }, 8, ["name"])) : v("", !0),
2103
+ (u(!0), C(J, null, Y(e.tabs, (h) => (u(), g(n(Le), {
2104
+ key: h.id,
2105
+ name: h.id,
2106
+ lazy: "",
2107
+ closable: ""
2108
+ }, {
2109
+ label: d(() => [
2110
+ _(n(wt), {
2111
+ "open-delay": 500,
2112
+ placement: "bottom",
2113
+ trigger: "hover",
2114
+ width: "200px",
2115
+ disabled: h.id !== e.value
2116
+ }, {
2117
+ reference: d(() => [
2118
+ H("div", {
2119
+ class: "x-mask-tabs__trigger",
2120
+ draggable: "true",
2121
+ onDragstart: (b) => r(h, b),
2122
+ onDragend: (b) => p(h, b)
2123
+ }, [
2124
+ h.icon ? (u(), g(W(n(_e)(h.icon)), { key: 0 })) : v("", !0),
2125
+ h.title ? (u(), C("span", Rn, O(h.title), 1)) : v("", !0)
2126
+ ], 40, Dn)
2127
+ ]),
2128
+ default: d(() => [
2129
+ _(n(Oe), {
2130
+ items: l(h),
2131
+ mode: "text",
2132
+ size: "small",
2133
+ type: "info",
2134
+ onClick: i
2135
+ }, null, 8, ["items"])
2136
+ ]),
2137
+ _: 2
2138
+ }, 1032, ["disabled"])
2139
+ ]),
2140
+ _: 2
2141
+ }, 1032, ["name"]))), 128))
2142
+ ]),
2143
+ _: 1
2144
+ }, 8, ["model-value"])
2145
+ ]),
2146
+ _: 1
2147
+ }, 512));
2148
+ }
2149
+ }), Fn = /* @__PURE__ */ P({
2150
+ __name: "ThemeSwitch",
2151
+ setup(a) {
2152
+ const o = Oo();
2153
+ return (e, t) => (u(), g(n(Ze), {
2154
+ class: "x-mask-theme-switch",
2155
+ modelValue: n(o),
2156
+ "onUpdate:modelValue": t[0] || (t[0] = (l) => Be(o) ? o.value = l : null),
2157
+ size: "default",
2158
+ "active-action-icon": n(Eo),
2159
+ "inactive-action-icon": n(Io)
2160
+ }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"]));
2161
+ }
2162
+ }), jn = { class: "x-mask-toolbar__menu-item" }, Nn = /* @__PURE__ */ P({
2163
+ __name: "Toolbar",
2164
+ props: {
2165
+ tabs: { default: () => [] },
2166
+ actions: {},
2167
+ theme: { type: Boolean }
2168
+ },
2169
+ emits: [
2170
+ "closeOtherTabs",
2171
+ "closeAllTabs",
2172
+ "closeTab",
2173
+ "clickTab",
2174
+ "actionClick",
2175
+ "actionCommand"
2176
+ ],
2177
+ setup(a, { emit: o }) {
2178
+ const e = a, t = o, l = y(() => {
2179
+ const p = e.tabs.map((f, m) => ({
2180
+ divided: m === 0,
2181
+ label: f.title,
2182
+ command: f
2183
+ }));
2184
+ return [
2185
+ {
2186
+ label: "关闭其他",
2187
+ command: "other"
2188
+ },
2189
+ {
2190
+ label: "关闭全部",
2191
+ command: "all"
2192
+ },
2193
+ ...p
2194
+ ];
2195
+ }), s = (p) => {
2196
+ t("closeTab", p.command);
2197
+ }, c = (p) => {
2198
+ switch (p.command) {
2199
+ case "all":
2200
+ t("closeAllTabs");
2201
+ break;
2202
+ case "other":
2203
+ t("closeOtherTabs");
2204
+ break;
2205
+ default:
2206
+ t("clickTab", p.command);
2207
+ break;
2208
+ }
2209
+ }, i = (p) => {
2210
+ t("actionClick", p);
2211
+ }, r = (p, f) => {
2212
+ t("actionCommand", p, f);
2213
+ };
2214
+ return (p, f) => (u(), g(n(E), {
2215
+ class: "x-mask-toolbar",
2216
+ align: "center"
2217
+ }, {
2218
+ default: d(() => [
2219
+ _(n(te), {
2220
+ icon: n(Bo),
2221
+ menus: l.value,
2222
+ dropdown: { size: "small" },
2223
+ mode: "icon",
2224
+ circle: "",
2225
+ background: "hover",
2226
+ onCommand: c
2227
+ }, {
2228
+ item: d(({ item: m }) => [
2229
+ H("span", jn, [
2230
+ R(O(m.label) + " ", 1),
2231
+ ["other", "all"].includes(m.command) ? v("", !0) : (u(), g(n(re), {
2232
+ key: 0,
2233
+ onClick: bt((h) => s(m), ["stop"]),
2234
+ icon: n(St)
2235
+ }, null, 8, ["onClick", "icon"]))
2236
+ ])
2237
+ ]),
2238
+ _: 1
2239
+ }, 8, ["icon", "menus"]),
2240
+ _(n(se), { direction: "vertical" }),
2241
+ e.actions ? (u(), g(n(Oe), {
2242
+ key: 0,
2243
+ circle: "",
2244
+ mode: "icon",
2245
+ size: "default",
2246
+ background: "hover",
2247
+ items: p.actions,
2248
+ onClick: i,
2249
+ onCommand: r
2250
+ }, null, 8, ["items"])) : v("", !0),
2251
+ e.actions ? (u(), g(n(se), {
2252
+ key: 1,
2253
+ direction: "vertical"
2254
+ })) : v("", !0),
2255
+ e.theme ? (u(), g(Fn, { key: 2 })) : v("", !0),
2256
+ e.theme ? (u(), g(n(se), {
2257
+ key: 3,
2258
+ direction: "vertical"
2259
+ })) : v("", !0),
2260
+ x(p.$slots, "default")
2261
+ ]),
2262
+ _: 3
2263
+ }));
2264
+ }
2265
+ }), Xn = /* @__PURE__ */ P({
2266
+ __name: "Avatar",
2267
+ props: {
2268
+ avatar: {}
2269
+ },
2270
+ setup(a) {
2271
+ const o = a;
2272
+ return (e, t) => (u(), g(n(wt), {
2273
+ width: 200,
2274
+ "popper-class": "x-mask-avatar__popper",
2275
+ disabled: !e.$slots.default
2276
+ }, {
2277
+ reference: d(() => [
2278
+ _(n(eo), {
2279
+ class: "x-mask-avatar",
2280
+ shape: "circle",
2281
+ icon: n(Po),
2282
+ src: o.avatar,
2283
+ size: 26
2284
+ }, null, 8, ["icon", "src"])
2285
+ ]),
2286
+ default: d(() => [
2287
+ e.$slots.default ? x(e.$slots, "default", { key: 0 }) : v("", !0)
2288
+ ]),
2289
+ _: 3
2290
+ }, 8, ["disabled"]));
2291
+ }
2292
+ }), ft = /* @__PURE__ */ P({
2293
+ __name: "Content",
2294
+ props: {
2295
+ createView: { type: Function },
2296
+ exclude: {}
2297
+ },
2298
+ setup(a) {
2299
+ const o = a;
2300
+ return (e, t) => (u(), g(n(E), {
2301
+ class: "x-mask__content",
2302
+ flex: !1,
2303
+ grow: "",
2304
+ padding: !1
2305
+ }, {
2306
+ default: d(() => [
2307
+ x(e.$slots, "default"),
2308
+ _(n(Lo), null, {
2309
+ default: d(({ Component: l, route: s }) => [
2310
+ (u(), g(Kt, {
2311
+ exclude: o.exclude
2312
+ }, [
2313
+ l ? (u(), g(W(o.createView(l, s)), {
2314
+ key: s.fullPath
2315
+ })) : v("", !0)
2316
+ ], 1032, ["exclude"]))
2317
+ ]),
2318
+ _: 1
2319
+ })
2320
+ ]),
2321
+ _: 3
2322
+ }));
2323
+ }
2324
+ });
2325
+ function Un() {
2326
+ const a = D(!1), o = D(""), e = D(!1);
2327
+ return {
2328
+ collapsed: a,
2329
+ keyword: o,
2330
+ favorite: e
2331
+ };
2332
+ }
2333
+ function Hn(a) {
2334
+ const o = Tt();
2335
+ return y(() => {
2336
+ const e = a.home;
2337
+ return Object.assign(
2338
+ { id: o, url: "/", name: "MaskHome", icon: Vo, closable: !1 },
2339
+ typeof e == "string" ? { url: e } : e || {}
2340
+ );
2341
+ });
2342
+ }
2343
+ function Dt(a, o) {
2344
+ let e = [];
2345
+ return a.forEach((t) => {
2346
+ t = o ? o(t) : t, t.children ? e = e.concat(Dt(t.children, o)) : e.push(t);
2347
+ }), e;
2348
+ }
2349
+ function Kn(a, o) {
2350
+ const e = qe(), t = Ve([]), l = Ve([]), s = y(() => Dt(t.value, a.menuAdapter)), c = y(() => No(s.value, "id")), i = D(null), r = (w) => {
2351
+ const M = typeof w == "object" ? w.id : w, z = c.value.get(M);
2352
+ if (!z) {
2353
+ console.warn("找不到菜单", w);
2354
+ return;
2355
+ }
2356
+ const { type: I = "route", url: V, title: S, icon: B } = z;
2357
+ if (!V) {
2358
+ i.value = z, o("select", z);
2359
+ return;
2360
+ }
2361
+ if (I === "route") {
2362
+ Xo(V) || V.startsWith("//") ? window.open(V) : (i.value = z, e.push(V).catch((T) => T));
2363
+ return;
2364
+ }
2365
+ if (I === "window") {
2366
+ window.open(V);
2367
+ return;
2368
+ }
2369
+ I === "dialog" && ot({
2370
+ resizable: !0,
2371
+ bodyPadding: !1,
2372
+ width: "80%",
2373
+ height: "80%",
2374
+ title: S,
2375
+ icon: B,
2376
+ src: V
2377
+ });
2378
+ }, p = async () => {
2379
+ t.value = typeof a.menus == "function" ? await a.menus() || [] : a.menus ?? [], l.value = typeof a.favorites == "function" ? await a.favorites() || [] : a.favorites ?? [];
2380
+ }, f = (w) => {
2381
+ l.value = [w, ...l.value], a.addFavorite && a.addFavorite(w);
2382
+ }, m = (w) => {
2383
+ l.value = l.value.filter((M) => M.id !== w.id), a.removeFavorite && a.removeFavorite(w);
2384
+ }, h = (w) => !!l.value.find((M) => M === w || M.id === w.id), b = (w) => {
2385
+ h(w) ? m(w) : f(w);
2386
+ };
2387
+ return Qe(p), {
2388
+ menus: t,
2389
+ favorites: l,
2390
+ flatMenus: s,
2391
+ active: i,
2392
+ select: r,
2393
+ toggleFavorite: b
2394
+ };
2395
+ }
2396
+ function Ln(a, o, e, t, l) {
2397
+ const s = Mt(), c = qe(), i = {}, r = D([]), p = D(), { width: f } = Ct(p), m = y(() => Math.floor(f.value / Bn)), h = y(
2398
+ () => r.value.slice(0, m.value).filter(($) => !$.dialog)
2399
+ ), b = y(() => r.value.slice(m.value)), w = ($) => e.value.find((A) => A.url === $), M = ($) => s.fullPath === $.url, z = ($) => l.value.id === $ ? l.value : r.value.find((A) => A.id === $), I = D(""), V = y(() => z(I.value)), S = ($) => {
2400
+ c.push($.url).catch((A) => A);
2401
+ }, B = ($) => {
2402
+ I.value = $.id, s.fullPath !== $.url && S($);
2403
+ }, T = () => {
2404
+ S(l.value);
2405
+ }, j = ($) => {
2406
+ const A = r.value.find((N) => N.url === $.url || N.id === $.id);
2407
+ A ? B(A) : (r.value.unshift($), B($));
2408
+ }, k = async ($) => {
2409
+ const { url: A = s.fullPath, icon: N, title: Te = "新建标签页" } = $ || {}, $e = i[A], Fe = Tt(), je = $t(A);
2410
+ return {
2411
+ id: Fe,
2412
+ name: je,
2413
+ url: A,
2414
+ icon: N,
2415
+ title: Te,
2416
+ closable: !0,
2417
+ menu: $,
2418
+ ...$e ? await $e() : {}
2419
+ };
2420
+ }, U = async ($) => {
2421
+ if (await Ne.confirm("是否关闭页签", "提示", {
2422
+ type: "warning"
2423
+ }).catch(() => !1)) {
2424
+ if (r.value = r.value.filter((N) => N.id !== $.id), I.value === $.id) {
2425
+ const N = r.value[0];
2426
+ S(N || l.value);
2427
+ }
2428
+ return $;
2429
+ }
2430
+ }, K = ($) => {
2431
+ const A = r.value.findIndex((N) => N.id === $.id);
2432
+ if (A >= 0) {
2433
+ const N = r.value[A];
2434
+ r.value.splice(A, 1, Object.assign(N, $));
2435
+ }
2436
+ }, ce = async () => {
2437
+ if (!await Ne.confirm("是否关闭全部页签", "提示", {
2438
+ type: "warning"
2439
+ }).catch(() => !1))
2440
+ return;
2441
+ const A = r.value;
2442
+ return r.value = [], B(l.value), A;
2443
+ }, Q = async () => {
2444
+ if (!await Ne.confirm("是否关闭其他页签", "提示", {
2445
+ type: "warning"
2446
+ }).catch(() => !1))
2447
+ return;
2448
+ const A = r.value.filter((N) => N.id !== I.value);
2449
+ return r.value = r.value.filter((N) => N.id === I.value), A;
2450
+ }, ee = ($) => {
2451
+ const A = r.value.filter((N) => N.id !== $.id);
2452
+ r.value = [$, ...A], B($);
2453
+ }, ue = async () => {
2454
+ await ye();
2455
+ const $ = l.value.url === s.fullPath, A = w(s.fullPath);
2456
+ if ($)
2457
+ I.value = l.value.id;
2458
+ else {
2459
+ const N = await k(A);
2460
+ j(N);
2461
+ }
2462
+ await ye(), t.value = A || null;
2463
+ };
2464
+ return L(e, ue), L(s, ue, { immediate: !0 }), ze(Vt, i), {
2465
+ tabRef: p,
2466
+ tabs: r,
2467
+ showTabs: h,
2468
+ currentTab: V,
2469
+ changeTab: S,
2470
+ removeTab: U,
2471
+ updateTab: K,
2472
+ addTab: j,
2473
+ home: l,
2474
+ tabValue: I,
2475
+ isCurrentTab: M,
2476
+ activeHome: T,
2477
+ activeTab: B,
2478
+ dropdownTabs: b,
2479
+ removeAllTabs: ce,
2480
+ removeOtherTabs: Q,
2481
+ moveToShow: ee
2482
+ };
2483
+ }
2484
+ function Wn(a) {
2485
+ const o = /* @__PURE__ */ new Map(), e = D([]), t = Re({}), l = pe(), s = {}, { updateTab: c, isCurrentTab: i, activeHome: r, tabs: p } = a, f = (S, B) => {
2486
+ const T = B.fullPath;
2487
+ if (o.has(T))
2488
+ return o.get(T);
2489
+ {
2490
+ const j = $t(T), k = {
2491
+ name: j,
2492
+ setup() {
2493
+ const U = y(() => t[T] || document.body), K = y(() => !t[T]), ce = y(() => !e.value.includes(j));
2494
+ return ze(
2495
+ Wo,
2496
+ ge({ ...B })
2497
+ ), () => ce.value ? ae(
2498
+ vt,
2499
+ {
2500
+ to: U.value,
2501
+ disabled: K.value
2502
+ },
2503
+ [ae(S)]
2504
+ ) : null;
2505
+ }
2506
+ };
2507
+ return o.set(T, k), k;
2508
+ }
2509
+ }, m = (S) => {
2510
+ S.dialog = void 0, delete t[S.url];
2511
+ const B = s[S.id];
2512
+ B && (B.destroy(), delete s[S.id], c(S));
2513
+ }, h = (S = []) => {
2514
+ S.forEach((B) => {
2515
+ m(B);
2516
+ });
2517
+ }, b = async (S) => {
2518
+ S.dialog = {
2519
+ ...S.dialog,
2520
+ onMinimized: () => {
2521
+ m(S);
2522
+ },
2523
+ onClose: async () => {
2524
+ m(S), p.value = p.value.filter((T) => T.id !== S.id);
2525
+ }
2526
+ }, c(S);
2527
+ const B = ot(
2528
+ {
2529
+ title: S.title,
2530
+ icon: S.icon,
2531
+ modal: !1,
2532
+ resizable: !0,
2533
+ draggable: !0,
2534
+ maximizable: !0,
2535
+ minimizable: !0,
2536
+ ...S.dialog,
2537
+ onOpen(T) {
2538
+ t[S.url] = T.refs.panelRef?.bodyRef?.$el;
2539
+ }
2540
+ },
2541
+ l?.appContext
2542
+ );
2543
+ return await ye(), i(S) && r(), s[S.id] = B, B;
2544
+ }, w = async (S) => {
2545
+ e.value = [S.name], await ye(), e.value = [];
2546
+ }, M = async (S) => {
2547
+ e.value = S.map((B) => B.name), await ye(), e.value = [];
2548
+ }, z = (S) => (S.preventDefault(), !1), I = (S) => {
2549
+ if (S.dataTransfer) {
2550
+ const B = S.dataTransfer.getData("tab"), T = p.value.find((j) => j.id === B);
2551
+ if (T) {
2552
+ const { clientX: j, clientY: k } = S;
2553
+ T.dialog = {
2554
+ left: j,
2555
+ top: k
2556
+ }, b(T);
2557
+ }
2558
+ }
2559
+ }, V = (S) => !!t[S];
2560
+ return De(document, "dragover", z), De(document, "drop", I), {
2561
+ createView: f,
2562
+ openDialog: b,
2563
+ refresh: w,
2564
+ exclude: e,
2565
+ cleanCache: M,
2566
+ hasDialog: V,
2567
+ closeDialog: m,
2568
+ closeDialogs: h
2569
+ };
2570
+ }
2571
+ const Jn = /* @__PURE__ */ P({
2572
+ name: "XMask",
2573
+ __name: "Mask",
2574
+ props: Pn,
2575
+ emits: ["select", "actionClick", "actionCommand"],
2576
+ setup(a, { emit: o }) {
2577
+ const e = a, t = o, l = Hn(e), { collapsed: s, keyword: c, favorite: i } = Un(), { menus: r, favorites: p, flatMenus: f, active: m, select: h, toggleFavorite: b } = Kn(e, t), {
2578
+ tabRef: w,
2579
+ showTabs: M,
2580
+ currentTab: z,
2581
+ changeTab: I,
2582
+ removeTab: V,
2583
+ tabs: S,
2584
+ updateTab: B,
2585
+ isCurrentTab: T,
2586
+ activeHome: j,
2587
+ removeAllTabs: k,
2588
+ removeOtherTabs: U,
2589
+ dropdownTabs: K,
2590
+ moveToShow: ce
2591
+ } = Ln(e, t, f, m, l), { createView: Q, openDialog: ee, refresh: ue, exclude: $, cleanCache: A, closeDialogs: N } = Wn({
2592
+ tabs: S,
2593
+ updateTab: B,
2594
+ isCurrentTab: T,
2595
+ activeHome: j
2596
+ }), Te = async (X) => {
2597
+ await V(X) && await A([X]);
2598
+ }, $e = async () => {
2599
+ const X = await k();
2600
+ X && (N(X), await A(X));
2601
+ }, Fe = async () => {
2602
+ const X = await U();
2603
+ X && (N(X), await A(X));
2604
+ }, je = (X) => {
2605
+ t("actionClick", X);
2606
+ }, Xt = (X, oe) => {
2607
+ t("actionCommand", X, oe);
2608
+ };
2609
+ return ze(At, {
2610
+ tabs: S,
2611
+ flatMenus: f,
2612
+ favorites: p,
2613
+ updateTab: B,
2614
+ active: m,
2615
+ currentTab: z
2616
+ }), (X, oe) => (u(), g(n(E), {
2617
+ class: Z(["x-mask", { "is-disabled": e.disabled }]),
2618
+ fit: ""
2619
+ }, {
2620
+ default: d(() => [
2621
+ e.disabled ? (u(), g(ft, {
2622
+ key: 1,
2623
+ createView: n(Q),
2624
+ exclude: n($)
2625
+ }, {
2626
+ default: d(() => [
2627
+ X.$slots.default ? x(X.$slots, "default", { key: 0 }) : v("", !0)
2628
+ ]),
2629
+ _: 3
2630
+ }, 8, ["createView", "exclude"])) : (u(), C(J, { key: 0 }, [
2631
+ _(zn, { collapsed: n(s) }, {
2632
+ brand: d(() => [
2633
+ _(Mn, {
2634
+ logo: e.logo,
2635
+ title: e.title,
2636
+ url: n(l).url,
2637
+ collapsed: n(s)
2638
+ }, null, 8, ["logo", "title", "url", "collapsed"])
2639
+ ]),
2640
+ default: d(() => [
2641
+ _(Cn, {
2642
+ collasped: n(s),
2643
+ "onUpdate:collasped": oe[0] || (oe[0] = (we) => Be(s) ? s.value = we : null),
2644
+ favorite: n(i),
2645
+ "onUpdate:favorite": oe[1] || (oe[1] = (we) => Be(i) ? i.value = we : null),
2646
+ keyword: n(c),
2647
+ "onUpdate:keyword": oe[2] || (oe[2] = (we) => Be(c) ? c.value = we : null)
2648
+ }, null, 8, ["collasped", "favorite", "keyword"]),
2649
+ _(En, {
2650
+ collapse: n(s),
2651
+ keyword: n(c),
2652
+ favorite: n(i),
2653
+ favorites: n(p),
2654
+ flatMenus: n(f),
2655
+ menus: n(r),
2656
+ active: n(m),
2657
+ onSelect: n(h)
2658
+ }, null, 8, ["collapse", "keyword", "favorite", "favorites", "flatMenus", "menus", "active", "onSelect"])
2659
+ ]),
2660
+ _: 1
2661
+ }, 8, ["collapsed"]),
2662
+ _(n(E), {
2663
+ class: "x-mask__main",
2664
+ grow: "",
2665
+ shrink: "",
2666
+ flex: "",
2667
+ direction: "column"
2668
+ }, {
2669
+ default: d(() => [
2670
+ _(n(E), {
2671
+ class: "x-mask-topbar",
2672
+ justify: "space-between",
2673
+ align: "center"
2674
+ }, {
2675
+ default: d(() => [
2676
+ _(On, {
2677
+ ref_key: "tabRef",
2678
+ ref: w,
2679
+ favorites: n(p),
2680
+ tabs: n(M),
2681
+ home: n(l),
2682
+ value: n(z)?.id,
2683
+ onClick: n(I),
2684
+ onToggleFavorite: n(b),
2685
+ onRemove: Te,
2686
+ onDialog: n(ee),
2687
+ onRefresh: n(ue)
2688
+ }, null, 8, ["favorites", "tabs", "home", "value", "onClick", "onToggleFavorite", "onDialog", "onRefresh"]),
2689
+ _(Nn, {
2690
+ tabs: n(K),
2691
+ actions: e.actions,
2692
+ theme: e.theme,
2693
+ onCloseOtherTabs: Fe,
2694
+ onCloseAllTabs: $e,
2695
+ onCloseTab: Te,
2696
+ onClickTab: n(ce),
2697
+ onActionClick: je,
2698
+ onActionCommand: Xt
2699
+ }, {
2700
+ default: d(() => [
2701
+ _(Xn, {
2702
+ avatar: e.avatar
2703
+ }, he({ _: 2 }, [
2704
+ X.$slots.user ? {
2705
+ name: "default",
2706
+ fn: d(() => [
2707
+ x(X.$slots, "user")
2708
+ ]),
2709
+ key: "0"
2710
+ } : void 0
2711
+ ]), 1032, ["avatar"])
2712
+ ]),
2713
+ _: 3
2714
+ }, 8, ["tabs", "actions", "theme", "onClickTab"])
2715
+ ]),
2716
+ _: 3
2717
+ }),
2718
+ _(ft, {
2719
+ createView: n(Q),
2720
+ exclude: n($)
2721
+ }, {
2722
+ default: d(() => [
2723
+ X.$slots.default ? x(X.$slots, "default", { key: 0 }) : v("", !0)
2724
+ ]),
2725
+ _: 3
2726
+ }, 8, ["createView", "exclude"])
2727
+ ]),
2728
+ _: 3
2729
+ })
2730
+ ], 64))
2731
+ ]),
2732
+ _: 3
2733
+ }, 8, ["class"]));
2734
+ }
2735
+ });
2736
+ function Oa(a = {}) {
2737
+ const o = Mt(), e = xe(Vt, null), t = xe(At, null);
2738
+ if (e) {
2739
+ const s = typeof a == "function" ? a : async () => a;
2740
+ e[o.fullPath] = s;
2741
+ }
2742
+ return {
2743
+ tab: y(() => t ? t.tabs.value.find((s) => s.url === o.fullPath) : null),
2744
+ mask: t
2745
+ };
2746
+ }
2747
+ const Qn = /* @__PURE__ */ P({
2748
+ __name: "SelectEditor",
2749
+ props: {
2750
+ options: { default: () => [] }
2751
+ },
2752
+ setup(a) {
2753
+ const o = a;
2754
+ return (e, t) => (u(), g(n(to), le(be(e.$attrs)), {
2755
+ default: d(() => [
2756
+ (u(!0), C(J, null, Y(o.options, (l, s) => (u(), g(n(oo), F({
2757
+ key: `item_${s}_${l.value}`
2758
+ }, l), he({ _: 2 }, [
2759
+ e.$slots.option ? {
2760
+ name: "default",
2761
+ fn: d(() => [
2762
+ x(e.$slots, "option", { option: l })
2763
+ ]),
2764
+ key: "0"
2765
+ } : void 0
2766
+ ]), 1040))), 128))
2767
+ ]),
2768
+ _: 3
2769
+ }, 16));
2770
+ }
2771
+ }), Zn = /* @__PURE__ */ P({
2772
+ __name: "CheckboxEditor",
2773
+ props: {
2774
+ options: { default: () => [] },
2775
+ button: { type: Boolean, default: !1 }
2776
+ },
2777
+ setup(a) {
2778
+ const o = a, e = y(
2779
+ () => ke(o.button ? no : ao)
2780
+ );
2781
+ return (t, l) => (u(), g(n(so), le(be(t.$attrs)), {
2782
+ default: d(() => [
2783
+ (u(!0), C(J, null, Y(o.options, (s, c) => (u(), g(W(e.value), {
2784
+ key: `item_${c}_${s.value}`,
2785
+ label: s.value
2786
+ }, {
2787
+ default: d(() => [
2788
+ R(O(s.label), 1)
2789
+ ]),
2790
+ _: 2
2791
+ }, 1032, ["label"]))), 128))
2792
+ ]),
2793
+ _: 1
2794
+ }, 16));
2795
+ }
2796
+ }), Gn = /* @__PURE__ */ P({
2797
+ __name: "RadioEditor",
2798
+ props: {
2799
+ options: { default: () => [] },
2800
+ button: { type: Boolean, default: !1 }
2801
+ },
2802
+ setup(a) {
2803
+ const o = a, e = y(
2804
+ () => ke(o.button ? lo : io)
2805
+ );
2806
+ return (t, l) => (u(), g(n(ro), le(be(t.$attrs)), {
2807
+ default: d(() => [
2808
+ (u(!0), C(J, null, Y(o.options, (s, c) => (u(), g(W(e.value), {
2809
+ key: `item_${c}_${s.value}`,
2810
+ label: s.value
2811
+ }, {
2812
+ default: d(() => [
2813
+ R(O(s.label), 1)
2814
+ ]),
2815
+ _: 2
2816
+ }, 1032, ["label"]))), 128))
2817
+ ]),
2818
+ _: 1
2819
+ }, 16));
2820
+ }
2821
+ }), Rt = {
2822
+ none: {
2823
+ component: "div",
2824
+ props: {
2825
+ class: "x-field-none"
2826
+ }
2827
+ },
2828
+ text: {
2829
+ component: Ce,
2830
+ props: {
2831
+ clearable: !0
2832
+ },
2833
+ defaultValue: ""
2834
+ },
2835
+ textarea: {
2836
+ component: Ce,
2837
+ props: {
2838
+ type: "textarea",
2839
+ rows: 2
2840
+ },
2841
+ defaultValue: ""
2842
+ },
2843
+ select: {
2844
+ component: Qn,
2845
+ props: {
2846
+ clearable: !0
2847
+ }
2848
+ },
2849
+ checkbox: {
2850
+ component: Zn,
2851
+ props: {},
2852
+ defaultValue: []
2853
+ },
2854
+ radio: {
2855
+ component: Gn,
2856
+ props: {}
2857
+ },
2858
+ number: {
2859
+ component: co,
2860
+ props: {}
2861
+ },
2862
+ date: {
2863
+ component: at,
2864
+ props: {}
2865
+ },
2866
+ time: {
2867
+ component: uo,
2868
+ props: {}
2869
+ },
2870
+ datetime: {
2871
+ component: at,
2872
+ props: {
2873
+ type: "datetime"
2874
+ }
2875
+ },
2876
+ switch: {
2877
+ component: Ze,
2878
+ props: {}
2879
+ },
2880
+ rate: {
2881
+ component: po,
2882
+ props: {}
2883
+ },
2884
+ slider: {
2885
+ component: fo,
2886
+ props: {}
2887
+ },
2888
+ cascader: {
2889
+ component: mo,
2890
+ props: {}
2891
+ }
2892
+ }, Yn = {
2893
+ /**
2894
+ * 字段名称
2895
+ */
2896
+ name: {
2897
+ type: String
2898
+ },
2899
+ /**
2900
+ * 字段标题文本
2901
+ */
2902
+ label: {
2903
+ type: String
2904
+ },
2905
+ /**
2906
+ * 编辑器组件
2907
+ */
2908
+ editor: {
2909
+ type: [String, Object],
2910
+ default: "text"
2911
+ },
2912
+ /**
2913
+ * 编辑器组件参数
2914
+ */
2915
+ props: {
2916
+ type: Object
2917
+ },
2918
+ /**
2919
+ * 字段值
2920
+ */
2921
+ modelValue: {
2922
+ type: [String, Number, Boolean, Object, Array],
2923
+ default(a) {
2924
+ return Rt[a.editor]?.defaultValue;
2925
+ }
2926
+ },
2927
+ /**
2928
+ * 输入框尺寸
2929
+ */
2930
+ size: {
2931
+ type: String
2932
+ },
2933
+ width: {
2934
+ type: [String, Number]
2935
+ },
2936
+ /**
2937
+ * 是否在tooltip显示校验信息
2938
+ */
2939
+ tooltipMessage: {
2940
+ type: [Boolean, Object],
2941
+ default: !0
2942
+ },
2943
+ /**
2944
+ * tooltip信息显示相对输入框的位置
2945
+ */
2946
+ tooltipPosition: {
2947
+ type: [String, Number],
2948
+ default: "outer"
2949
+ },
2950
+ /**
2951
+ * null 不显示 placeholder
2952
+ */
2953
+ placeholder: {
2954
+ type: String
2955
+ },
2956
+ /**
2957
+ * 禁用
2958
+ */
2959
+ disabled: {
2960
+ type: Boolean
2961
+ },
2962
+ /**
2963
+ * 只读
2964
+ */
2965
+ readonly: {
2966
+ type: Boolean
2967
+ },
2968
+ /**
2969
+ * 选项数据
2970
+ */
2971
+ options: {
2972
+ type: [Array, Function]
2973
+ },
2974
+ /**
2975
+ * 是否显示控制
2976
+ */
2977
+ visible: {
2978
+ type: [Boolean, Object, Function],
2979
+ default: !0
2980
+ },
2981
+ /**
2982
+ * 级联字段,根据字段值变化刷新options
2983
+ */
2984
+ cascader: {
2985
+ type: [String, Array]
2986
+ },
2987
+ /**
2988
+ * 校验错误信息
2989
+ */
2990
+ error: {
2991
+ type: String
2992
+ },
2993
+ /**
2994
+ * 提示文本
2995
+ */
2996
+ tip: {
2997
+ type: String
2998
+ }
2999
+ };
3000
+ async function qn(a, o) {
3001
+ const e = a.options;
3002
+ return e ? typeof e == "function" ? await e(o) || [] : e : [];
3003
+ }
3004
+ function ea(a, o, e, t, l) {
3005
+ const s = D([]), c = y(() => !t || !l ? {} : Uo(a.cascader).reduce((p, f) => (p[f] = Pe(l, f), p), {}));
3006
+ return L(
3007
+ c,
3008
+ async (r) => {
3009
+ if (e.value) {
3010
+ s.value = await qn(a, r);
3011
+ const p = t?.exposed?.reset;
3012
+ p && a.name && p(a.name);
3013
+ }
3014
+ },
3015
+ {
3016
+ immediate: !0
3017
+ }
3018
+ ), {
3019
+ editor: y(() => {
3020
+ const {
3021
+ editor: r = "text",
3022
+ placeholder: p,
3023
+ label: f = "...",
3024
+ disabled: m,
3025
+ readonly: h
3026
+ } = a, b = {
3027
+ ...a.props,
3028
+ placeholder: p || (p === null ? void 0 : `请输入${f}`),
3029
+ disabled: m,
3030
+ readonly: h,
3031
+ options: s.value,
3032
+ onFocus: () => o("focus"),
3033
+ onBlur: () => o("blur"),
3034
+ onChange: (M) => o("change", M)
3035
+ }, w = typeof r == "string" ? Rt[r] : {
3036
+ component: r,
3037
+ props: {}
3038
+ };
3039
+ return Ho({}, w, {
3040
+ props: b
3041
+ });
3042
+ })
3043
+ };
3044
+ }
3045
+ const ta = {
3046
+ key: 1,
3047
+ class: "el-form-item__error"
3048
+ }, oa = { class: "x-field__editor_wrap" }, na = {
3049
+ key: 0,
3050
+ class: "x-field__tip"
3051
+ }, Ot = /* @__PURE__ */ P({
3052
+ name: "XField",
3053
+ __name: "Field",
3054
+ props: Yn,
3055
+ emits: ["update:modelValue", "change", "focus", "blur"],
3056
+ setup(a, { expose: o, emit: e }) {
3057
+ const t = a, l = e, s = xe(Ft, null), c = xe(go, null), i = xe(jt, null), r = y(() => !s?.proxy || !i ? t.visible : typeof t.visible == "function" ? t.visible(i) : Ye(t.visible) ? Object.entries(t.visible).every(([U, K]) => Pe(i, U) === K) : t.visible), p = () => s?.proxy && i && t.name ? Pe(i, t.name) ?? t.modelValue : t.modelValue, f = D(p()), { editor: m } = ea(
3058
+ t,
3059
+ l,
3060
+ r,
3061
+ s,
3062
+ i
3063
+ ), h = D(), b = D(), w = y(
3064
+ () => t.size || c?.size || "default"
3065
+ ), M = y(() => Object.assign(
3066
+ {},
3067
+ s?.props.tooltipMessage || {},
3068
+ typeof t.tooltipMessage == "boolean" ? {} : t.tooltipMessage
3069
+ )), z = (k = "") => t.error ? t.error : k.includes("is required") ? `${t.label || t.name}是必填项!` : k, I = y(() => {
3070
+ const k = s?.props.tooltipMessage ?? t.tooltipMessage;
3071
+ return {
3072
+ [`is-tooltip-${t.tooltipPosition}`]: !!k && !!t.tooltipPosition
3073
+ };
3074
+ }), V = y(() => {
3075
+ const k = s?.proxy;
3076
+ return {
3077
+ width: t.width ? q(t.width) : k && k.inline && k.inlineColumns ? `${100 / k.inlineColumns}%` : null
3078
+ };
3079
+ }), S = y(() => ({
3080
+ right: typeof t.tooltipPosition == "number" ? `${t.tooltipPosition}px` : void 0
3081
+ })), B = y(() => ({
3082
+ ...m.value.props,
3083
+ modelValue: f.value,
3084
+ "onUpdate:modelValue": (k) => {
3085
+ f.value = k;
3086
+ }
3087
+ }));
3088
+ return L(f, (k, U) => {
3089
+ r.value && !Ge(k, U) && (l("update:modelValue", k), s?.proxy && i && t.name && Ue(i, t.name, k));
3090
+ }), L(
3091
+ () => !s?.proxy || !t.name || !i ? t.modelValue : Pe(i, t.name) ?? t.modelValue,
3092
+ (k) => {
3093
+ r.value && (f.value = k);
3094
+ },
3095
+ {
3096
+ immediate: !0
3097
+ }
3098
+ ), L(
3099
+ r,
3100
+ (k) => {
3101
+ s?.proxy && i && t.name && (k ? (f.value = p(), Ue(i, t.name, f.value)) : (f.value = void 0, Ue(i, t.name, void 0)));
3102
+ },
3103
+ {
3104
+ immediate: !0
3105
+ }
3106
+ ), o({
3107
+ fieldValue: f,
3108
+ itemRef: h,
3109
+ editorRef: b,
3110
+ focus: () => {
3111
+ b.value?.focus && b.value.focus();
3112
+ },
3113
+ blur: () => {
3114
+ b.value?.foucs && b.value.blur();
3115
+ }
3116
+ }), (k, U) => r.value ? (u(), g(n(yo), F({
3117
+ key: 0,
3118
+ class: ["x-field", I.value],
3119
+ ref_key: "itemRef",
3120
+ ref: h,
3121
+ prop: t.name,
3122
+ label: k.label,
3123
+ size: w.value,
3124
+ style: V.value
3125
+ }, k.$attrs), he({
3126
+ error: d(({ error: K }) => [
3127
+ x(k.$slots, "error", { error: K }, () => [
3128
+ n(s)?.props.tooltipMessage ?? t.tooltipMessage ? (u(), C("div", {
3129
+ key: 0,
3130
+ class: "x-field__info",
3131
+ style: fe(S.value)
3132
+ }, [
3133
+ _(n(ht), F({
3134
+ content: z(K)
3135
+ }, M.value), {
3136
+ default: d(() => [
3137
+ _(n(re), {
3138
+ class: "x-field__trigger",
3139
+ icon: n(Ao),
3140
+ size: w.value
3141
+ }, null, 8, ["icon", "size"])
3142
+ ]),
3143
+ _: 2
3144
+ }, 1040, ["content"])
3145
+ ], 4)) : (u(), C("div", ta, O(z(K)), 1))
3146
+ ])
3147
+ ]),
3148
+ default: d(() => [
3149
+ H("div", oa, [
3150
+ x(k.$slots, "editor", { editor: B.value }, () => [
3151
+ n(m).component ? (u(), g(W(n(m).component), F({
3152
+ key: 0,
3153
+ class: "x-field__editor",
3154
+ ref_key: "editorRef",
3155
+ ref: b,
3156
+ modelValue: f.value,
3157
+ "onUpdate:modelValue": U[0] || (U[0] = (K) => f.value = K)
3158
+ }, n(m).props), he({ _: 2 }, [
3159
+ k.$slots.option ? {
3160
+ name: "option",
3161
+ fn: d(({ option: K }) => [
3162
+ x(k.$slots, "option", { option: K })
3163
+ ]),
3164
+ key: "0"
3165
+ } : void 0
3166
+ ]), 1040, ["modelValue"])) : v("", !0)
3167
+ ]),
3168
+ t.tip || k.$slots.tip ? (u(), C("div", na, [
3169
+ x(k.$slots, "tip", {}, () => [
3170
+ R(O(t.tip), 1)
3171
+ ])
3172
+ ])) : v("", !0)
3173
+ ]),
3174
+ x(k.$slots, "default")
3175
+ ]),
3176
+ _: 2
3177
+ }, [
3178
+ k.$slots.label ? {
3179
+ name: "label",
3180
+ fn: d(() => [
3181
+ x(k.$slots, "label")
3182
+ ]),
3183
+ key: "0"
3184
+ } : void 0
3185
+ ]), 1040, ["prop", "label", "size", "class", "style"])) : v("", !0);
3186
+ }
3187
+ }), aa = {
3188
+ /**
3189
+ * 表单模型
3190
+ */
3191
+ model: {
3192
+ type: Object,
3193
+ default() {
3194
+ return /* @__PURE__ */ Object.create(null);
3195
+ }
3196
+ },
3197
+ /**
3198
+ * inline模式
3199
+ */
3200
+ inline: {
3201
+ type: Boolean
3202
+ },
3203
+ /**
3204
+ * inline模式显示列数
3205
+ */
3206
+ inlineColumns: {
3207
+ type: Number
3208
+ },
3209
+ /**
3210
+ * 显示底部操作按钮
3211
+ */
3212
+ footer: {
3213
+ type: Boolean,
3214
+ default: !0
3215
+ },
3216
+ /**
3217
+ * 提交按钮文本
3218
+ */
3219
+ submitText: {
3220
+ type: String,
3221
+ default: "提交"
3222
+ },
3223
+ /**
3224
+ * 重置按钮文本
3225
+ */
3226
+ resetText: {
3227
+ type: String,
3228
+ default: "重置"
3229
+ },
3230
+ /**
3231
+ * 表单提交处理方法
3232
+ */
3233
+ submitMethod: {
3234
+ type: Function
3235
+ },
3236
+ /**
3237
+ * 是否在tooltip显示校验信息
3238
+ */
3239
+ tooltipMessage: {
3240
+ type: [Object, Boolean],
3241
+ default: void 0
3242
+ }
3243
+ }, Ft = Symbol("formInstanceKey"), jt = Symbol("formModelKey"), Nt = /* @__PURE__ */ P({
3244
+ name: "XForm",
3245
+ __name: "Form",
3246
+ props: aa,
3247
+ emits: ["change", "submit", "reset"],
3248
+ setup(a, { expose: o, emit: e }) {
3249
+ const t = a, l = e, s = pe(), c = D(), i = Re(t.model || {}), r = D(!1);
3250
+ ze(Ft, s), ze(jt, i), L(i, () => {
3251
+ l("change", ge(i));
3252
+ }), L(
3253
+ () => t.model,
3254
+ (m) => {
3255
+ Object.assign(i, m);
3256
+ },
3257
+ { deep: !0 }
3258
+ );
3259
+ const p = async () => {
3260
+ await c.value.validate().catch(() => !1) && (l("submit", ge(i)), t.submitMethod && (r.value = !0, await t.submitMethod(ge(i)), r.value = !1));
3261
+ }, f = (m) => {
3262
+ c.value.resetFields(m), l("reset");
3263
+ };
3264
+ return o({
3265
+ formRef: c,
3266
+ model: i,
3267
+ submit: p,
3268
+ reset: f
3269
+ }), (m, h) => (u(), g(n(vo), F({
3270
+ ref_key: "formRef",
3271
+ ref: c,
3272
+ class: "x-form",
3273
+ inline: t.inline,
3274
+ model: i,
3275
+ onKeyup: Lt(p, ["enter"]),
3276
+ onSubmit: h[1] || (h[1] = bt(() => {
3277
+ }, ["stop", "prevent"]))
3278
+ }, m.$attrs), {
3279
+ default: d(() => [
3280
+ x(m.$slots, "default"),
3281
+ t.footer ? (u(), g(n(Ot), {
3282
+ key: 0,
3283
+ editor: "none",
3284
+ class: "x-form__footer",
3285
+ label: " "
3286
+ }, {
3287
+ editor: d(() => [
3288
+ x(m.$slots, "footer", {}, () => [
3289
+ t.submitText ? (u(), g(n(ie), {
3290
+ key: 0,
3291
+ loading: r.value,
3292
+ type: "primary",
3293
+ onClick: p
3294
+ }, {
3295
+ default: d(() => [
3296
+ R(O(t.submitText), 1)
3297
+ ]),
3298
+ _: 1
3299
+ }, 8, ["loading"])) : v("", !0),
3300
+ t.resetText ? (u(), g(n(ie), {
3301
+ key: 1,
3302
+ type: "default",
3303
+ onClick: h[0] || (h[0] = () => f())
3304
+ }, {
3305
+ default: d(() => [
3306
+ R(O(t.resetText), 1)
3307
+ ]),
3308
+ _: 1
3309
+ })) : v("", !0),
3310
+ x(m.$slots, "action")
3311
+ ])
3312
+ ]),
3313
+ _: 3
3314
+ })) : v("", !0)
3315
+ ]),
3316
+ _: 3
3317
+ }, 16, ["inline", "model"]));
3318
+ }
3319
+ }), sa = {
3320
+ modelValue: {
3321
+ type: Boolean,
3322
+ default: !0
3323
+ },
3324
+ size: {
3325
+ type: String
3326
+ },
3327
+ formProps: {
3328
+ type: Object
3329
+ },
3330
+ submit: {
3331
+ type: [Boolean, String],
3332
+ default: "确定"
3333
+ },
3334
+ cancel: {
3335
+ type: [Boolean, String],
3336
+ default: "取消"
3337
+ },
3338
+ /**
3339
+ * 表单模型
3340
+ */
3341
+ model: {
3342
+ type: Object,
3343
+ default() {
3344
+ return /* @__PURE__ */ Object.create(null);
3345
+ }
3346
+ },
3347
+ rules: {
3348
+ type: Object
3349
+ },
3350
+ /**
3351
+ * 表单提交处理方法, return true 关闭弹窗
3352
+ */
3353
+ submitMethod: {
3354
+ type: Function
3355
+ }
3356
+ }, la = /* @__PURE__ */ P({
3357
+ name: "XDialogForm",
3358
+ __name: "DialogForm",
3359
+ props: sa,
3360
+ emits: ["update:modelValue", "submit", "close"],
3361
+ setup(a, { expose: o, emit: e }) {
3362
+ const t = a, l = e, s = D(), c = D(), i = y(() => c.value?.$vtjEl), r = () => {
3363
+ s.value?.submit();
3364
+ }, p = () => {
3365
+ l("update:modelValue", !1), l("close");
3366
+ }, f = async (b) => {
3367
+ l("submit", b), t.submitMethod ? await t.submitMethod(b) && p() : p();
3368
+ }, m = y(
3369
+ () => t.formProps?.disabled ? !1 : t.submit
3370
+ ), h = y(
3371
+ () => t.formProps?.disabled ? !1 : t.cancel
3372
+ );
3373
+ return o({
3374
+ $vtjEl: i,
3375
+ formRef: s,
3376
+ dialogRef: c
3377
+ }), (b, w) => (u(), g(n(tt), F({
3378
+ ref_key: "dialogRef",
3379
+ ref: c,
3380
+ class: "x-dialog-form",
3381
+ "model-value": t.modelValue,
3382
+ submit: m.value,
3383
+ cancel: h.value,
3384
+ size: t.size,
3385
+ onSubmit: r,
3386
+ onClose: p,
3387
+ minimizable: !1,
3388
+ maximizable: !1
3389
+ }, b.$attrs), he({
3390
+ default: d(() => [
3391
+ _(n(Nt), F({
3392
+ ref_key: "formRef",
3393
+ ref: s,
3394
+ class: "x-dialog-form__form",
3395
+ footer: !1,
3396
+ "label-width": "80px",
3397
+ size: t.size,
3398
+ model: t.model,
3399
+ rules: t.rules,
3400
+ "submit-method": f
3401
+ }, t.formProps), {
3402
+ default: d(() => [
3403
+ x(b.$slots, "default")
3404
+ ]),
3405
+ _: 3
3406
+ }, 16, ["size", "model", "rules"])
3407
+ ]),
3408
+ _: 2
3409
+ }, [
3410
+ b.$slots.extra ? {
3411
+ name: "extra",
3412
+ fn: d(() => [
3413
+ x(b.$slots, "extra")
3414
+ ]),
3415
+ key: "0"
3416
+ } : void 0,
3417
+ b.$slots.handle ? {
3418
+ name: "handle",
3419
+ fn: d(() => [
3420
+ x(b.$slots, "handle")
3421
+ ]),
3422
+ key: "1"
3423
+ } : void 0,
3424
+ b.$slots.footer ? {
3425
+ name: "footer",
3426
+ fn: d(() => [
3427
+ x(b.$slots, "footer")
3428
+ ]),
3429
+ key: "2"
3430
+ } : void 0
3431
+ ]), 1040, ["model-value", "submit", "cancel", "size"]));
3432
+ }
3433
+ }), ia = {
3434
+ items: {
3435
+ type: Array,
3436
+ default() {
3437
+ return [];
3438
+ }
3439
+ },
3440
+ border: {
3441
+ type: Boolean
3442
+ }
3443
+ }, ra = /* @__PURE__ */ P({
3444
+ name: "XTabs",
3445
+ __name: "Tabs",
3446
+ props: ia,
3447
+ setup(a) {
3448
+ const o = a, e = (l) => {
3449
+ const { label: s, name: c, value: i, disabled: r, closable: p, lazy: f } = l;
3450
+ return {
3451
+ label: s,
3452
+ name: i ?? c,
3453
+ disabled: r,
3454
+ closable: p,
3455
+ lazy: f
3456
+ };
3457
+ }, t = y(() => ({
3458
+ "is-no-border": !o.border
3459
+ }));
3460
+ return (l, s) => (u(), g(n(kt), F({
3461
+ class: ["x-tabs", t.value]
3462
+ }, l.$attrs), {
3463
+ default: d(() => [
3464
+ (u(!0), C(J, null, Y(o.items, (c) => (u(), g(n(Le), F({
3465
+ key: c.value ?? c.name
3466
+ }, e(c)), {
3467
+ label: d(() => [
3468
+ x(l.$slots, "label", le(be(c)), () => [
3469
+ c.icon ? (u(), g(W(n(_e)(c.icon)), {
3470
+ key: 0,
3471
+ class: "x-tabs__icon"
3472
+ })) : v("", !0),
3473
+ R(" " + O(c.label), 1)
3474
+ ])
3475
+ ]),
3476
+ default: d(() => [
3477
+ x(l.$slots, "default", le(be(c)), () => [
3478
+ c.component ? (u(), g(W(c.component), le(F({ key: 0 }, c.props)), null, 16)) : v("", !0)
3479
+ ])
3480
+ ]),
3481
+ _: 2
3482
+ }, 1040))), 128))
3483
+ ]),
3484
+ _: 3
3485
+ }, 16, ["class"]));
3486
+ }
3487
+ }), ca = {
3488
+ direction: {
3489
+ type: String,
3490
+ default: "column"
3491
+ },
3492
+ imageSrc: {
3493
+ type: String
3494
+ },
3495
+ imageWidth: {
3496
+ type: [Number, String]
3497
+ },
3498
+ imageHeight: {
3499
+ type: [Number, String]
3500
+ },
3501
+ icon: {
3502
+ type: [String, Object]
3503
+ },
3504
+ title: {
3505
+ type: String
3506
+ },
3507
+ description: {
3508
+ type: String
3509
+ },
3510
+ actions: {
3511
+ type: Array
3512
+ },
3513
+ actionBarProps: {
3514
+ type: Object
3515
+ },
3516
+ split: {
3517
+ type: Boolean
3518
+ },
3519
+ onImageClick: {
3520
+ type: Function
3521
+ },
3522
+ onTitleClick: {
3523
+ type: Function
3524
+ }
3525
+ }, ua = { class: "x-data-item__title" }, da = {
3526
+ key: 1,
3527
+ class: "x-data-item__section x-data-item__desc"
3528
+ }, pa = {
3529
+ key: 2,
3530
+ class: "x-data-item__section x-data-item__extra"
3531
+ }, fa = {
3532
+ key: 3,
3533
+ class: "x-data-item__section x-data-item__actions"
3534
+ }, ma = /* @__PURE__ */ P({
3535
+ name: "XDataItem",
3536
+ __name: "DataItem",
3537
+ props: ca,
3538
+ emits: ["imageClick", "titleClick", "actionClick", "actionCommand"],
3539
+ setup(a, { emit: o }) {
3540
+ const e = a, t = o, l = y(() => {
3541
+ const { imageWidth: m, imageHeight: h } = e;
3542
+ return {
3543
+ width: m ? q(m) : void 0,
3544
+ height: h ? q(h) : void 0
3545
+ };
3546
+ }), s = y(() => ({
3547
+ [`is-image-${e.direction}`]: !!e.direction,
3548
+ "is-split": !!e.split
3549
+ })), c = y(() => ({
3550
+ size: "small",
3551
+ mode: "text",
3552
+ justify: "flex-end",
3553
+ type: "info",
3554
+ items: e.actions,
3555
+ ...e.actionBarProps
3556
+ })), i = () => t("imageClick"), r = () => t("titleClick"), p = (m) => t("actionClick", m), f = (m, h) => t("actionCommand", m, h);
3557
+ return (m, h) => (u(), g(n(E), {
3558
+ class: Z(["x-data-item", s.value]),
3559
+ direction: e.direction
3560
+ }, {
3561
+ default: d(() => [
3562
+ e.imageSrc || m.$slots.image ? (u(), g(n(E), {
3563
+ key: 0,
3564
+ class: "x-data-item__img",
3565
+ autoPointer: !0,
3566
+ onClick: e.onImageClick ? i : void 0
3567
+ }, {
3568
+ default: d(() => [
3569
+ x(m.$slots, "image", {}, () => [
3570
+ e.imageSrc ? (u(), g(n(bo), {
3571
+ key: 0,
3572
+ style: fe(l.value),
3573
+ src: e.imageSrc
3574
+ }, null, 8, ["style", "src"])) : v("", !0)
3575
+ ])
3576
+ ]),
3577
+ _: 3
3578
+ }, 8, ["onClick"])) : v("", !0),
3579
+ _(n(E), {
3580
+ class: "x-data-item__content",
3581
+ direction: "column",
3582
+ grow: "",
3583
+ shrink: ""
3584
+ }, {
3585
+ default: d(() => [
3586
+ e.title || m.$slots.title ? (u(), g(n(E), {
3587
+ key: 0,
3588
+ class: "x-data-item__section x-data-item__wrapper",
3589
+ align: "center",
3590
+ autoPointer: !0,
3591
+ onClick: e.onTitleClick ? r : void 0
3592
+ }, {
3593
+ default: d(() => [
3594
+ e.icon ? (u(), g(W(n(_e)(e.icon)), {
3595
+ key: 0,
3596
+ class: "x-data-item__icon"
3597
+ })) : v("", !0),
3598
+ H("span", ua, [
3599
+ x(m.$slots, "title", {}, () => [
3600
+ R(O(e.title), 1)
3601
+ ])
3602
+ ])
3603
+ ]),
3604
+ _: 3
3605
+ }, 8, ["onClick"])) : v("", !0),
3606
+ e.description || m.$slots.description ? (u(), C("div", da, [
3607
+ x(m.$slots, "description", {}, () => [
3608
+ R(O(e.description), 1)
3609
+ ])
3610
+ ])) : v("", !0),
3611
+ m.$slots.default ? (u(), C("div", pa, [
3612
+ x(m.$slots, "default")
3613
+ ])) : v("", !0),
3614
+ e.actions || e.actionBarProps || m.$slots.actions ? (u(), C("div", fa, [
3615
+ x(m.$slots, "actions", {}, () => [
3616
+ _(n(Oe), F(c.value, {
3617
+ onClick: p,
3618
+ onCommand: f
3619
+ }), null, 16)
3620
+ ])
3621
+ ])) : v("", !0)
3622
+ ]),
3623
+ _: 3
3624
+ })
3625
+ ]),
3626
+ _: 3
3627
+ }, 8, ["direction", "class"]));
3628
+ }
3629
+ }), ga = {
3630
+ option: {
3631
+ type: Object
3632
+ },
3633
+ width: {
3634
+ type: [Number, String],
3635
+ default: "100%"
3636
+ },
3637
+ height: {
3638
+ type: [Number, String],
3639
+ default: "400px"
3640
+ }
3641
+ };
3642
+ function ya() {
3643
+ return import("echarts");
3644
+ }
3645
+ function va(a, o) {
3646
+ const e = D(), t = Ve();
3647
+ return gt(async () => {
3648
+ t.value = await ya();
3649
+ const l = n(a);
3650
+ l && (e.value || (e.value = ke(t.value.init(l))), e.value && e.value.setOption(o.option || {}));
3651
+ }), yt(() => {
3652
+ e.value && e.value.dispose();
3653
+ }), L(
3654
+ () => o.option,
3655
+ (l) => {
3656
+ e.value && e.value.setOption(l || {});
3657
+ },
3658
+ { deep: !0 }
3659
+ ), Fo(
3660
+ a,
3661
+ Ko(() => {
3662
+ e.value && e.value.resize();
3663
+ }, 150)
3664
+ ), {
3665
+ echartsInstance: e,
3666
+ echarts: t
3667
+ };
3668
+ }
3669
+ const ba = /* @__PURE__ */ P({
3670
+ name: "XChart",
3671
+ __name: "Chart",
3672
+ props: ga,
3673
+ setup(a, { expose: o }) {
3674
+ const e = a, t = D(), { echartsInstance: l, echarts: s } = va(t, e), c = y(() => ({
3675
+ width: q(e.width),
3676
+ height: q(e.height)
3677
+ }));
3678
+ return o({
3679
+ chartRef: t,
3680
+ echartsInstance: l,
3681
+ echarts: s
3682
+ }), (i, r) => (u(), C("div", {
3683
+ ref_key: "chartRef",
3684
+ ref: t,
3685
+ style: fe(c.value)
3686
+ }, null, 4));
3687
+ }
3688
+ }), ha = {
3689
+ data: {
3690
+ type: [Object, Function],
3691
+ default() {
3692
+ return [];
3693
+ }
3694
+ },
3695
+ /**
3696
+ * 设置 itemHeight 即自动开启虚拟滚动
3697
+ */
3698
+ itemHeight: {
3699
+ type: [Number, Function]
3700
+ },
3701
+ width: {
3702
+ type: [String, Number],
3703
+ default: "100%"
3704
+ },
3705
+ height: {
3706
+ type: [String, Number],
3707
+ default: "100%"
3708
+ },
3709
+ pager: {
3710
+ type: [Boolean, Object]
3711
+ },
3712
+ page: {
3713
+ type: Number,
3714
+ default: 1
3715
+ },
3716
+ pageSize: {
3717
+ type: Number,
3718
+ default: 10
3719
+ },
3720
+ dataKey: {
3721
+ type: String
3722
+ },
3723
+ infiniteScroll: {
3724
+ type: [Boolean, Object]
3725
+ }
3726
+ }, _a = {
3727
+ key: 0,
3728
+ class: "x-list__loading"
3729
+ }, ka = {
3730
+ key: 1,
3731
+ class: "x-list__nomore"
3732
+ }, wa = {
3733
+ key: 0,
3734
+ class: "x-list__loading"
3735
+ }, xa = {
3736
+ key: 1,
3737
+ class: "x-list__nomore"
3738
+ }, Sa = {
3739
+ key: 1,
3740
+ class: "x-list__pager"
3741
+ }, za = /* @__PURE__ */ P({
3742
+ name: "XList",
3743
+ __name: "List",
3744
+ props: ha,
3745
+ emits: ["load"],
3746
+ setup(a, { expose: o, emit: e }) {
3747
+ const t = a, l = e, s = Re({
3748
+ page: t.page,
3749
+ pageSize: t.pageSize
3750
+ });
3751
+ Qe(() => {
3752
+ const { page: T, pageSize: j } = t;
3753
+ Object.assign(s, { page: T, pageSize: j });
3754
+ });
3755
+ const { data: c, loading: i } = ln(
3756
+ t.data,
3757
+ {
3758
+ list: [],
3759
+ total: 0
3760
+ },
3761
+ s
3762
+ ), r = y(() => Math.ceil((c.value.total || 0) / s.pageSize)), p = D(!1), f = D(), m = y(() => ({
3763
+ width: q(t.width),
3764
+ height: q(t.height)
3765
+ })), h = y(() => ({
3766
+ "is-virtual": !!t.itemHeight
3767
+ })), b = y(() => {
3768
+ const T = {};
3769
+ for (let [j, k] of Object.entries(
3770
+ rt(t.infiniteScroll)
3771
+ ))
3772
+ T[`infinite-scroll-${j}`] = k;
3773
+ return (i.value || p.value) && (T["infinite-scroll-disabled"] = !0), T;
3774
+ }), w = y(() => rt(t.pager, {})), { list: M, containerProps: z, wrapperProps: I, scrollTo: V } = jo(
3775
+ y(() => c.value.list),
3776
+ {
3777
+ itemHeight: t.itemHeight || 0
3778
+ }
3779
+ ), S = () => {
3780
+ !t.infiniteScroll || p.value || (s.page < r.value ? (++s.page, l("load", s)) : p.value = !0);
3781
+ }, B = (T) => t.dataKey ? T[t.dataKey] : void 0;
3782
+ return o({
3783
+ list: M,
3784
+ scrollTo: V,
3785
+ wrapperRef: f,
3786
+ loading: i,
3787
+ state: s,
3788
+ pageCount: r,
3789
+ nomore: p,
3790
+ data: c,
3791
+ getKey: B
3792
+ }), (T, j) => (u(), C("div", {
3793
+ class: Z(["x-list", h.value]),
3794
+ style: fe(m.value)
3795
+ }, [
3796
+ !n(c).total && !n(i) ? x(T.$slots, "empty", { key: 0 }, () => [
3797
+ _(n(_t))
3798
+ ]) : v("", !0),
3799
+ H("div", F({ class: "x-list__content" }, n(z)), [
3800
+ t.itemHeight ? G((u(), C("div", F({
3801
+ key: 0,
3802
+ class: "x-list__wrapper",
3803
+ ref_key: "wrapperRef",
3804
+ ref: f
3805
+ }, { ...n(I), ...b.value }), [
3806
+ (u(!0), C(J, null, Y(n(M), (k, U) => x(T.$slots, "default", le(F({
3807
+ key: B(k.data)
3808
+ }, { item: k.data, index: U })), () => [
3809
+ H("div", null, O(k), 1)
3810
+ ])), 128)),
3811
+ n(i) ? (u(), C("div", _a, [
3812
+ x(T.$slots, "loading", {}, () => [
3813
+ R(" 正在加载数据... ")
3814
+ ])
3815
+ ])) : v("", !0),
3816
+ p.value ? (u(), C("div", ka, [
3817
+ x(T.$slots, "nomore", {}, () => [
3818
+ R(" 没有更多数据 ")
3819
+ ])
3820
+ ])) : v("", !0)
3821
+ ], 16)), [
3822
+ [n(st), S]
3823
+ ]) : G((u(), C("div", F({
3824
+ key: 1,
3825
+ class: "x-list__wrapper"
3826
+ }, b.value), [
3827
+ (u(!0), C(J, null, Y(n(c).list, (k, U) => x(T.$slots, "default", le(F({
3828
+ key: B(k)
3829
+ }, { item: k, index: U })), () => [
3830
+ H("div", null, O(k), 1)
3831
+ ])), 128)),
3832
+ n(i) ? (u(), C("div", wa, [
3833
+ x(T.$slots, "loading", {}, () => [
3834
+ R(" 正在加载数据... ")
3835
+ ])
3836
+ ])) : v("", !0),
3837
+ p.value ? (u(), C("div", xa, [
3838
+ x(T.$slots, "nomore", {}, () => [
3839
+ R(" 没有更多数据 ")
3840
+ ])
3841
+ ])) : v("", !0)
3842
+ ], 16)), [
3843
+ [n(st), S]
3844
+ ])
3845
+ ], 16),
3846
+ t.pager ? (u(), C("div", Sa, [
3847
+ _(n(ho), F({
3848
+ small: "",
3849
+ background: "",
3850
+ layout: "prev, pager, next",
3851
+ total: n(c).total,
3852
+ "default-page-size": t.pageSize,
3853
+ "default-current-page": t.page,
3854
+ "current-page": s.page,
3855
+ "onUpdate:currentPage": j[0] || (j[0] = (k) => s.page = k),
3856
+ "page-size": s.pageSize,
3857
+ "onUpdate:pageSize": j[1] || (j[1] = (k) => s.pageSize = k)
3858
+ }, w.value), null, 16, ["total", "default-page-size", "default-current-page", "current-page", "page-size"])
3859
+ ])) : v("", !0)
3860
+ ], 6));
3861
+ }
3862
+ }), Ca = {
3863
+ stringProp: {
3864
+ type: String
3865
+ },
3866
+ booleanProp: {
3867
+ type: Boolean
3868
+ },
3869
+ numberProp: {
3870
+ type: Number
3871
+ },
3872
+ selectProp: {
3873
+ type: String
3874
+ },
3875
+ objectProp: {
3876
+ type: Object
3877
+ },
3878
+ arrayProp: {
3879
+ type: Array
3880
+ },
3881
+ iconProp: {
3882
+ type: String
3883
+ },
3884
+ colorProp: {
3885
+ type: String
3886
+ },
3887
+ modelValue: {
3888
+ type: String
3889
+ },
3890
+ syncProp: {
3891
+ type: String
3892
+ }
3893
+ }, Ta = { class: "x-test__slot" }, $a = { class: "x-test__slot" }, Ma = /* @__PURE__ */ P({
3894
+ name: "XTest",
3895
+ __name: "Test",
3896
+ props: Ca,
3897
+ emits: ["click", "submit", "change", "update:modelValue", "update:syncProp"],
3898
+ setup(a, { expose: o, emit: e }) {
3899
+ const t = a, l = e, s = y(() => Object.entries(t)), c = y({
3900
+ get() {
3901
+ return t.modelValue;
3902
+ },
3903
+ set(b) {
3904
+ l("update:modelValue", b);
3905
+ }
3906
+ }), i = y({
3907
+ get() {
3908
+ return t.syncProp;
3909
+ },
3910
+ set(b) {
3911
+ l("update:syncProp", b);
3912
+ }
3913
+ }), r = D("default inner data"), p = () => {
3914
+ it.info({
3915
+ message: "触发click事件"
3916
+ }), l("click", t);
3917
+ }, f = () => {
3918
+ it.info({
3919
+ message: "触发submit事件"
3920
+ }), l("submit", t);
3921
+ }, m = (b) => {
3922
+ r.value = b, l("change", r.value);
3923
+ }, h = () => {
3924
+ m("user click change:" + Date.now());
3925
+ };
3926
+ return o({
3927
+ click: p,
3928
+ submit: f,
3929
+ data: r,
3930
+ change: m
3931
+ }), (b, w) => (u(), g(n(Se), {
3932
+ class: "x-test",
3933
+ header: "VTJ 低代码测试组件",
3934
+ border: ""
3935
+ }, {
3936
+ default: d(() => [
3937
+ _(n(se), null, {
3938
+ default: d(() => [
3939
+ R("内部数据")
3940
+ ]),
3941
+ _: 1
3942
+ }),
3943
+ _(n(E), null, {
3944
+ default: d(() => [
3945
+ R(O(r.value), 1)
3946
+ ]),
3947
+ _: 1
3948
+ }),
3949
+ _(n(se), null, {
3950
+ default: d(() => [
3951
+ R("属性")
3952
+ ]),
3953
+ _: 1
3954
+ }),
3955
+ _(n(lt), {
3956
+ column: 3,
3957
+ border: ""
3958
+ }, {
3959
+ default: d(() => [
3960
+ (u(!0), C(J, null, Y(s.value, ([M, z]) => (u(), g(n(Xe), { label: M }, {
3961
+ default: d(() => [
3962
+ H("pre", null, O(JSON.stringify(z, null, 2)), 1)
3963
+ ]),
3964
+ _: 2
3965
+ }, 1032, ["label"]))), 256))
3966
+ ]),
3967
+ _: 1
3968
+ }),
3969
+ _(n(se), null, {
3970
+ default: d(() => [
3971
+ R("插槽")
3972
+ ]),
3973
+ _: 1
3974
+ }),
3975
+ _(n(E), {
3976
+ justify: "space-around",
3977
+ flex: "",
3978
+ gap: ""
3979
+ }, {
3980
+ default: d(() => [
3981
+ _(n(Se), {
3982
+ header: "default",
3983
+ grow: "",
3984
+ card: ""
3985
+ }, {
3986
+ default: d(() => [
3987
+ H("div", Ta, [
3988
+ x(b.$slots, "default", {
3989
+ props: t,
3990
+ data: r.value
3991
+ }, () => [
3992
+ H("pre", null, O(JSON.stringify({ props: t, data: r.value }, null, 2)), 1)
3993
+ ])
3994
+ ])
3995
+ ]),
3996
+ _: 3
3997
+ }),
3998
+ _(n(Se), {
3999
+ header: "extra",
4000
+ grow: "",
4001
+ card: ""
4002
+ }, {
4003
+ default: d(() => [
4004
+ H("div", $a, [
4005
+ x(b.$slots, "extra", {
4006
+ props: t,
4007
+ data: r.value
4008
+ }, () => [
4009
+ H("pre", null, O(JSON.stringify({ props: t, data: r.value }, null, 2)), 1)
4010
+ ])
4011
+ ])
4012
+ ]),
4013
+ _: 3
4014
+ })
4015
+ ]),
4016
+ _: 3
4017
+ }),
4018
+ _(n(se), null, {
4019
+ default: d(() => [
4020
+ R("双向绑定")
4021
+ ]),
4022
+ _: 1
4023
+ }),
4024
+ _(n(E), null, {
4025
+ default: d(() => [
4026
+ _(n(lt), {
4027
+ column: 2,
4028
+ border: ""
4029
+ }, {
4030
+ default: d(() => [
4031
+ _(n(Xe), { label: "modelValue" }, {
4032
+ default: d(() => [
4033
+ _(n(Ce), {
4034
+ modelValue: c.value,
4035
+ "onUpdate:modelValue": w[0] || (w[0] = (M) => c.value = M)
4036
+ }, null, 8, ["modelValue"])
4037
+ ]),
4038
+ _: 1
4039
+ }),
4040
+ _(n(Xe), { label: "syncProp" }, {
4041
+ default: d(() => [
4042
+ _(n(Ce), {
4043
+ modelValue: i.value,
4044
+ "onUpdate:modelValue": w[1] || (w[1] = (M) => i.value = M)
4045
+ }, null, 8, ["modelValue"])
4046
+ ]),
4047
+ _: 1
4048
+ })
4049
+ ]),
4050
+ _: 1
4051
+ })
4052
+ ]),
4053
+ _: 1
4054
+ }),
4055
+ _(n(se), null, {
4056
+ default: d(() => [
4057
+ R("事件和方法")
4058
+ ]),
4059
+ _: 1
4060
+ }),
4061
+ _(n(E), null, {
4062
+ default: d(() => [
4063
+ _(n(ie), { onClick: p }, {
4064
+ default: d(() => [
4065
+ R("click")
4066
+ ]),
4067
+ _: 1
4068
+ }),
4069
+ _(n(ie), { onClick: f }, {
4070
+ default: d(() => [
4071
+ R("submit")
4072
+ ]),
4073
+ _: 1
4074
+ }),
4075
+ _(n(ie), { onClick: h }, {
4076
+ default: d(() => [
4077
+ R("change")
4078
+ ]),
4079
+ _: 1
4080
+ })
4081
+ ]),
4082
+ _: 1
4083
+ })
4084
+ ]),
4085
+ _: 3
4086
+ }));
4087
+ }
4088
+ }), Fa = [
4089
+ re,
4090
+ de,
4091
+ te,
4092
+ Oe,
4093
+ E,
4094
+ Bt,
4095
+ Se,
4096
+ tt,
4097
+ Jn,
4098
+ Ot,
4099
+ Nt,
4100
+ la,
4101
+ ra,
4102
+ ma,
4103
+ ba,
4104
+ za,
4105
+ Ma
4106
+ ];
4107
+ export {
4108
+ dt as Draggable,
4109
+ ct as INSTALLED_KEY,
4110
+ At as MASK_KEY,
4111
+ pt as Resizable,
4112
+ Vt as TAB_CREATORS_KEY,
4113
+ Bn as TAB_ITEM_WIDTH,
4114
+ Da as VTJ_UI_VERSION,
4115
+ te as XAction,
4116
+ Oe as XActionBar,
4117
+ ba as XChart,
4118
+ E as XContainer,
4119
+ ma as XDataItem,
4120
+ tt as XDialog,
4121
+ la as XDialogForm,
4122
+ Ot as XField,
4123
+ Nt as XForm,
4124
+ Bt as XHeader,
4125
+ re as XIcon,
4126
+ za as XList,
4127
+ Jn as XMask,
4128
+ de as XMenu,
4129
+ Se as XPanel,
4130
+ ra as XTabs,
4131
+ Ma as XTest,
4132
+ un as actionBarProps,
4133
+ It as actionProps,
4134
+ Rt as builtinFieldEditors,
4135
+ ga as chartProps,
4136
+ Fa as components,
4137
+ dn as containerProps,
4138
+ ot as createDialog,
4139
+ ca as dataItemProps,
4140
+ Oa as defineTab,
4141
+ sa as dialogFormProps,
4142
+ yn as dialogProps,
4143
+ Yn as fieldProps,
4144
+ Ft as formInstanceKey,
4145
+ jt as formModelKey,
4146
+ aa as formProps,
4147
+ q as getSizeValue,
4148
+ pn as headerProps,
4149
+ Qo as iconProps,
4150
+ Jo as iconSizeMap,
4151
+ ha as listProps,
4152
+ Ra as makeInstaller,
4153
+ Pn as maskProps,
4154
+ mn as panelProps,
4155
+ Me as parseSize,
4156
+ ia as tabsProps,
4157
+ Ca as testProps,
4158
+ rt as toObjectProps,
4159
+ et as useDisabled,
4160
+ _e as useIcon,
4161
+ sn as useIconProps,
4162
+ ln as useLoader,
4163
+ gn as vDraggable,
4164
+ Pt as vResizable
4165
+ };