@vtj/ui 0.5.2 → 0.6.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 (69) hide show
  1. package/cdn/index.js +1 -1
  2. package/cdn/style.css +1 -1
  3. package/lib/index.js +2739 -246
  4. package/lib/style.css +1 -1
  5. package/package.json +11 -11
  6. package/types/components/action/Action.d.ts +363 -0
  7. package/types/components/action/Trigger.d.ts +187 -0
  8. package/types/components/action/hooks.d.ts +43 -0
  9. package/types/components/action/index.d.ts +3 -0
  10. package/types/components/action/types.d.ts +151 -0
  11. package/types/components/action-bar/ActionBar.d.ts +684 -0
  12. package/types/components/action-bar/index.d.ts +3 -0
  13. package/types/components/action-bar/types.d.ts +124 -0
  14. package/types/components/container/Container.d.ts +147 -0
  15. package/types/components/container/index.d.ts +3 -0
  16. package/types/components/container/types.d.ts +120 -0
  17. package/types/components/dialog/Dialog.d.ts +334 -0
  18. package/types/components/dialog/create.d.ts +11 -0
  19. package/types/components/dialog/hooks.d.ts +58 -0
  20. package/types/components/dialog/index.d.ts +4 -0
  21. package/types/components/dialog/types.d.ts +124 -0
  22. package/types/components/header/Header.d.ts +61 -0
  23. package/types/components/header/index.d.ts +3 -0
  24. package/types/components/header/types.d.ts +29 -0
  25. package/types/components/icon/Icon.d.ts +1 -1
  26. package/types/components/index.d.ts +7 -0
  27. package/types/components/mask/Mask.d.ts +469 -0
  28. package/types/components/mask/components/Avatar.d.ts +21 -0
  29. package/types/components/mask/components/Brand.d.ts +47 -0
  30. package/types/components/mask/components/Content.d.ts +33 -0
  31. package/types/components/mask/components/Menu.d.ts +65 -0
  32. package/types/components/mask/components/Sidebar.d.ts +22 -0
  33. package/types/components/mask/components/SwitchBar.d.ts +39 -0
  34. package/types/components/mask/components/Tabs.d.ts +62 -0
  35. package/types/components/mask/components/ThemeSwitch.d.ts +3 -0
  36. package/types/components/mask/components/Toolbar.d.ts +50 -0
  37. package/types/components/mask/defineTab.d.ts +6 -0
  38. package/types/components/mask/hooks/index.d.ts +5 -0
  39. package/types/components/mask/hooks/useContent.d.ts +20 -0
  40. package/types/components/mask/hooks/useHome.d.ts +3 -0
  41. package/types/components/mask/hooks/useMenus.d.ts +28 -0
  42. package/types/components/mask/hooks/useSidebar.d.ts +7 -0
  43. package/types/components/mask/hooks/useTabs.d.ts +22 -0
  44. package/types/components/mask/index.d.ts +4 -0
  45. package/types/components/mask/types.d.ts +112 -0
  46. package/types/components/menu/Menu.d.ts +9 -75
  47. package/types/components/menu/MenuItem.d.ts +17 -2
  48. package/types/components/menu/types.d.ts +16 -5
  49. package/types/components/panel/Panel.d.ts +401 -0
  50. package/types/components/panel/index.d.ts +3 -0
  51. package/types/components/panel/types.d.ts +223 -0
  52. package/types/components/shared.d.ts +12 -0
  53. package/types/components/startup/Startup.d.ts +10 -0
  54. package/types/constants.d.ts +0 -3
  55. package/types/directives/index.d.ts +2 -0
  56. package/types/directives/vDraggable.d.ts +45 -0
  57. package/types/directives/vResizable.d.ts +37 -0
  58. package/types/hooks/index.d.ts +1 -2
  59. package/types/hooks/useDisabled.d.ts +3 -0
  60. package/types/hooks/useIcon.d.ts +3 -3
  61. package/types/index.d.ts +3 -0
  62. package/types/utils/index.d.ts +0 -2
  63. package/types/utils/install.d.ts +3 -8
  64. package/types/utils/util.d.ts +0 -3
  65. package/types/version.d.ts +1 -0
  66. package/types/hooks/useDraggable.d.ts +0 -13
  67. package/types/hooks/useResizable.d.ts +0 -25
  68. package/types/utils/emits.d.ts +0 -6
  69. package/types/utils/make-install.d.ts +0 -4
package/lib/index.js CHANGED
@@ -1,68 +1,90 @@
1
- import { defineComponent as w, openBlock as f, createElementBlock as M, renderSlot as b, createElementVNode as x, toDisplayString as E, useAttrs as H, computed as S, markRaw as G, createBlock as g, unref as m, normalizeClass as Y, withCtx as _, resolveDynamicComponent as F, createCommentVNode as N, getCurrentInstance as W, createVNode as y, Fragment as O, renderList as R, mergeProps as D, createTextVNode as q, isVNode as K, h as J, watch as z, effectScope as U, ref as L, onUnmounted as Z } from "vue";
2
- import { ElIcon as Q, ElSubMenu as ee, ElMenuItem as te, ElMenu as ne, ElContainer as A, ElHeader as se, ElAside as oe, ElMain as le, ElFooter as re } from "element-plus";
3
- import { useRouter as ae, useRoute as ie, RouterView as ue } from "vue-router";
4
- import { useDraggable as ce, useElementBounding as P, useElementSize as me, useEventListener as C } from "@vueuse/core";
5
- function De(e) {
6
- return typeof e == "string" ? e : `${e}px`;
1
+ import { defineComponent as D, openBlock as c, createElementBlock as A, renderSlot as z, createElementVNode as R, unref as o, toDisplayString as O, createVNode as b, withCtx as p, createTextVNode as N, useAttrs as Je, computed as y, markRaw as Ae, createBlock as m, normalizeClass as U, resolveDynamicComponent as Y, createCommentVNode as v, getCurrentInstance as _e, mergeProps as Q, Fragment as q, renderList as we, isVNode as xt, h as K, toRef as he, useSlots as zt, normalizeStyle as Ee, ref as $, normalizeProps as St, guardReactiveProps as Ct, effectScope as Ke, watch as ne, reactive as Ye, onMounted as Tt, onUnmounted as Mt, watchEffect as Ge, nextTick as le, Teleport as qe, withDirectives as L, createSlots as et, render as Fe, vShow as J, isRef as ge, withModifiers as Et, KeepAlive as It, shallowRef as Oe, provide as De, toRaw as Bt, inject as je } from "vue";
2
+ import { ElDivider as ue, ElButton as ve, ElIcon as At, ElSubMenu as Dt, ElBadge as Ie, ElMenuItem as Vt, ElMenu as Pt, ElContainer as Ne, ElHeader as Rt, ElAside as $t, ElMain as Ft, ElFooter as Ot, ElDropdown as jt, ElDropdownMenu as Nt, ElDropdownItem as Ut, ElTooltip as Xt, ElSwitch as tt, ElInput as Ht, ElEmpty as Lt, ElTabs as Wt, ElTabPane as Ue, ElPopover as nt, ElAvatar as Qt, ElMessageBox as Te } from "element-plus";
3
+ import { VideoPlay as Zt, Menu as ot, ArrowRight as Jt, StarFilled as at, Search as Be, Close as st, Expand as Kt, Fold as Yt, Star as lt, Document as se, Refresh as Gt, CopyDocument as qt, Moon as en, Sunny as tn, MoreFilled as nn, UserFilled as on, HomeFilled as an } from "@element-plus/icons-vue";
4
+ import { useRouter as ke, useRoute as Ve, RouterView as it, routeLocationKey as sn } from "vue-router";
5
+ import { Minimize as ln, Popup as rn, Maximize as cn, RawClose as un } from "@vtj/icons";
6
+ import { useDraggable as dn, useMouseInElement as pn, useEventListener as ye, useElementSize as rt, useDark as fn } from "@vueuse/core";
7
+ import { isEqual as ct, isObject as ut, uid as dt, arrayToMap as mn, isUrl as gn, upperFirstCamelCase as pt } from "@vtj/utils";
8
+ function Xe(a) {
9
+ return typeof a == "string" ? a : `${a}px`;
7
10
  }
8
- function Le(e = 0, t) {
9
- if (typeof e == "number")
10
- return e;
11
- if (/(%|vh|vw)$/i.test(e)) {
12
- const s = Number.parseInt(e);
13
- return t * s / 100;
14
- }
15
- return Number.parseInt(e);
11
+ function pe(a = 0, t) {
12
+ if (typeof a == "number")
13
+ return a;
14
+ if (/(%|vh|vw)$/i.test(a)) {
15
+ const n = Number.parseInt(a);
16
+ return Math.floor(t * n / 100);
17
+ }
18
+ return Number.parseInt(a);
16
19
  }
17
- function pe(e, t) {
18
- const n = {};
19
- return Object.keys(e).forEach((s) => {
20
- t.includes(s) || (n[s] = e[s]);
21
- }), n;
20
+ function Ro(a, t) {
21
+ const e = {};
22
+ return Object.keys(a).forEach((n) => {
23
+ t.includes(n) || (e[n] = a[n]);
24
+ }), e;
22
25
  }
23
- function Ae(e, t) {
24
- const n = {};
25
- return Object.keys(e).forEach((s) => {
26
- t.includes(s) && (n[s] = e[s]);
27
- }), n;
26
+ function $o(a, t) {
27
+ const e = {};
28
+ return Object.keys(a).forEach((n) => {
29
+ t.includes(n) && (e[n] = a[n]);
30
+ }), e;
28
31
  }
29
- const de = () => {
30
- }, Be = (e, t) => {
31
- if (e.install = (n) => {
32
- for (const s of [e, ...Object.values(t ?? {})])
33
- typeof s == "function" ? n.use(s) : s.name && n.component(s.name, s);
34
- }, t)
35
- for (const [n, s] of Object.entries(t))
36
- e[n] = s;
37
- return e;
38
- }, Xe = (e, t) => (e.install = (n) => {
39
- e._context = n._context, n.config.globalProperties[t] = e;
40
- }, e), je = (e, t) => (e.install = (n) => {
41
- n.directive(t, e);
42
- }, e), Oe = (e) => (e.install = de, e), B = Symbol("INSTALLED_KEY"), X = "is-dragging", j = "is-resizing", fe = (e = []) => ({
43
- install: (n) => {
44
- n[B] || (n[B] = !0, e.forEach((s) => n.use(s)));
45
- }
46
- }), ve = { class: "x-startup" }, _e = /* @__PURE__ */ w({
32
+ const Fo = () => {
33
+ }, He = Symbol("INSTALLED_KEY"), hn = (a = []) => ({
34
+ install: (e) => {
35
+ e[He] || (e[He] = !0, a.forEach((n) => e.component(n.name, n)));
36
+ }
37
+ }), ft = "data:image/png;base64,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", vn = { class: "x-startup" }, yn = { class: "brand" }, bn = ["src"], _n = /* @__PURE__ */ R("h3", null, [
38
+ /* @__PURE__ */ N("基于 "),
39
+ /* @__PURE__ */ R("span", null, "Vue3 + TypeScript"),
40
+ /* @__PURE__ */ N(" 的低代码设计器引擎")
41
+ ], -1), wn = { class: "btn" }, kn = /* @__PURE__ */ R("div", { class: "ba" }, [
42
+ /* @__PURE__ */ R("a", { href: "http://beian.miit.gov.cn/" }, "粤ICP备2023104074号")
43
+ ], -1), xn = /* @__PURE__ */ D({
47
44
  name: "XStartup",
48
45
  __name: "Startup",
49
46
  props: {
50
- text: { default: "Hello VTJ." }
51
- },
52
- setup(e) {
53
- const t = e;
54
- return (n, s) => (f(), M("div", ve, [
55
- b(n.$slots, "default", {}, () => [
56
- x("span", null, E(t.text), 1)
57
- ])
47
+ text: { default: "VTJ.PRO" },
48
+ link: { default: "/" }
49
+ },
50
+ setup(a) {
51
+ const t = a, e = () => {
52
+ location.href = t.link + "#/?startup";
53
+ };
54
+ return (n, s) => (c(), A("div", vn, [
55
+ z(n.$slots, "default", {}, () => [
56
+ R("div", null, [
57
+ R("div", yn, [
58
+ R("img", { src: o(ft) }, null, 8, bn),
59
+ R("h1", null, O(t.text), 1)
60
+ ]),
61
+ b(o(ue)),
62
+ _n,
63
+ R("div", wn, [
64
+ b(o(ve), {
65
+ onClick: e,
66
+ type: "primary",
67
+ round: "",
68
+ size: "large",
69
+ icon: o(Zt)
70
+ }, {
71
+ default: p(() => [
72
+ N(" 立即开始体验 ")
73
+ ]),
74
+ _: 1
75
+ }, 8, ["icon"])
76
+ ])
77
+ ])
78
+ ]),
79
+ kn
58
80
  ]));
59
81
  }
60
82
  });
61
- const he = {
83
+ const zn = {
62
84
  default: 14,
63
85
  small: 12,
64
86
  large: 18
65
- }, ge = {
87
+ }, Sn = {
66
88
  icon: {
67
89
  type: [String, Object]
68
90
  },
@@ -79,117 +101,153 @@ const he = {
79
101
  disabled: {
80
102
  type: Boolean
81
103
  }
82
- }, ye = ["src"], k = /* @__PURE__ */ w({
104
+ }, Cn = ["src"], oe = /* @__PURE__ */ D({
83
105
  name: "XIcon",
84
106
  __name: "Icon",
85
- props: ge,
86
- setup(e) {
87
- const t = e, n = H(), s = S(() => typeof t.icon == "object" ? G(t.icon) : null), r = S(() => {
88
- const o = {
89
- "is-pointer": !!n.onClick
107
+ props: Sn,
108
+ setup(a) {
109
+ const t = a, e = Je(), n = y(() => typeof t.icon == "object" ? Ae(t.icon) : null), s = y(() => {
110
+ const i = {
111
+ "is-pointer": !!e.onClick
90
112
  };
91
- return !s.value && t.icon && (o[t.icon] = !0), o;
92
- }), l = S(() => typeof t.size == "number" ? t.size : he[t.size] ?? void 0);
93
- return (o, u) => (f(), g(m(Q), {
94
- class: Y(["x-icon", r.value]),
113
+ return !n.value && t.icon && (i[t.icon] = !0), i;
114
+ }), l = y(() => typeof t.size == "number" ? t.size : zn[t.size] ?? void 0);
115
+ return (i, u) => (c(), m(o(At), {
116
+ class: U(["x-icon", s.value]),
95
117
  color: t.color,
96
118
  size: l.value
97
119
  }, {
98
- default: _(() => [
99
- b(o.$slots, "default", {}, () => [
100
- s.value ? (f(), g(F(s.value), { key: 0 })) : N("", !0),
101
- t.src ? (f(), M("img", {
120
+ default: p(() => [
121
+ z(i.$slots, "default", {}, () => [
122
+ n.value ? (c(), m(Y(n.value), { key: 0 })) : v("", !0),
123
+ t.src ? (c(), A("img", {
102
124
  key: 1,
103
125
  src: t.src
104
- }, null, 8, ye)) : N("", !0)
126
+ }, null, 8, Cn)) : v("", !0)
105
127
  ])
106
128
  ]),
107
129
  _: 3
108
130
  }, 8, ["class", "color", "size"]));
109
131
  }
110
- }), V = /* @__PURE__ */ w({
132
+ }), Tn = { class: "x-menu__wrapper" }, Mn = {
133
+ key: 1,
134
+ class: "x-menu__title"
135
+ }, En = /* @__PURE__ */ R("i", null, null, -1), In = {
136
+ key: 0,
137
+ class: "x-menu__title"
138
+ }, Bn = /* @__PURE__ */ R("i", null, null, -1), mt = /* @__PURE__ */ D({
139
+ inheritAttrs: !1,
111
140
  name: "XMenuItem",
112
141
  __name: "MenuItem",
113
142
  props: {
114
- item: {}
143
+ item: {},
144
+ subMenu: {},
145
+ defaultIcon: { type: [Object, Function] }
115
146
  },
116
- setup(e) {
117
- const t = e, n = W(), s = (l = "") => l ? n?.appContext.app?.component(l) || l : void 0, r = (l) => l.filter((o) => !o.hidden);
118
- return (l, o) => t.item.children ? (f(), g(m(ee), {
147
+ setup(a) {
148
+ const t = a, e = _e(), n = (i) => {
149
+ if (i)
150
+ return typeof i == "string" && (e?.appContext.app?.component(i) || t.defaultIcon) || i;
151
+ }, s = (i) => typeof i == "object" ? i : { value: i }, l = (i = []) => i.filter((u) => !u.hidden);
152
+ return (i, u) => t.item.children ? (c(), m(o(Dt), Q({
119
153
  key: 0,
120
- index: t.item.id
121
- }, {
122
- title: _(() => [
123
- x("div", null, [
124
- y(m(k), {
125
- icon: s(t.item.icon)
126
- }, null, 8, ["icon"]),
127
- x("span", null, E(t.item.title), 1)
154
+ disabled: t.item.disabled
155
+ }, t.subMenu, {
156
+ index: String(t.item.id)
157
+ }), {
158
+ title: p(() => [
159
+ R("div", Tn, [
160
+ t.item.icon ? (c(), m(o(oe), {
161
+ key: 0,
162
+ icon: n(t.item.icon)
163
+ }, null, 8, ["icon"])) : v("", !0),
164
+ t.item.title ? (c(), A("span", Mn, O(t.item.title), 1)) : v("", !0),
165
+ t.item.badge ? (c(), m(o(Ie), Q({
166
+ key: 2,
167
+ class: "x-menu__badge"
168
+ }, s(t.item.badge)), {
169
+ default: p(() => [
170
+ En
171
+ ]),
172
+ _: 1
173
+ }, 16)) : v("", !0)
128
174
  ])
129
175
  ]),
130
- default: _(() => [
131
- (f(!0), M(O, null, R(r(t.item.children), (u) => (f(), g(m(V), { item: u }, null, 8, ["item"]))), 256))
176
+ default: p(() => [
177
+ (c(!0), A(q, null, we(l(t.item.children), (r) => (c(), m(o(mt), {
178
+ key: r.id,
179
+ item: r,
180
+ subMenu: t.subMenu,
181
+ defaultIcon: t.defaultIcon
182
+ }, null, 8, ["item", "subMenu", "defaultIcon"]))), 128))
132
183
  ]),
133
184
  _: 1
134
- }, 8, ["index"])) : (f(), g(m(te), D({
185
+ }, 16, ["disabled", "index"])) : (c(), m(o(Vt), {
135
186
  key: 1,
136
- index: t.item.id
137
- }, t.item), {
138
- default: _(() => [
139
- y(m(k), {
140
- icon: s(t.item.icon)
141
- }, null, 8, ["icon"]),
142
- x("span", null, E(t.item.title), 1)
187
+ index: String(t.item.id),
188
+ disabled: t.item.disabled
189
+ }, {
190
+ title: p(() => [
191
+ t.item.title ? (c(), A("span", In, O(t.item.title), 1)) : v("", !0),
192
+ t.item.badge ? (c(), m(o(Ie), Q({
193
+ key: 1,
194
+ class: "x-menu__badge"
195
+ }, s(t.item.badge)), {
196
+ default: p(() => [
197
+ Bn
198
+ ]),
199
+ _: 1
200
+ }, 16)) : v("", !0)
201
+ ]),
202
+ default: p(() => [
203
+ t.item.icon ? (c(), m(o(oe), {
204
+ key: 0,
205
+ icon: n(t.item.icon)
206
+ }, null, 8, ["icon"])) : v("", !0)
143
207
  ]),
144
208
  _: 1
145
- }, 16, ["index"]));
209
+ }, 8, ["index", "disabled"]));
146
210
  }
147
- }), T = /* @__PURE__ */ w({
211
+ }), G = /* @__PURE__ */ D({
212
+ inheritAttrs: !1,
148
213
  name: "XMenu",
149
214
  __name: "Menu",
150
215
  props: {
151
216
  data: { default: () => [] },
152
- mode: {},
153
- defaultActive: {},
154
- defaultOpeneds: {},
155
- uniqueOpened: { type: Boolean },
156
- router: { type: Boolean },
157
- menuTrigger: {},
158
- collapse: { type: Boolean },
159
- backgroundColor: {},
160
- textColor: {},
161
- activeTextColor: {},
162
- collapseTransition: { type: Boolean },
163
- ellipsis: { type: Boolean },
164
- popperEffect: {}
217
+ subMenu: {},
218
+ defaultIcon: {}
165
219
  },
166
220
  emits: ["select"],
167
- setup(e, { emit: t }) {
168
- const n = e, s = S(() => n.data.filter((o) => !o.hidden)), r = (o, u) => {
169
- const i = (a, p = []) => {
170
- for (const c of p) {
171
- if (c.id === a)
172
- return c;
173
- if (c.children?.length) {
174
- const d = i(a, c.children);
175
- if (d)
176
- return d;
221
+ setup(a, { emit: t }) {
222
+ const e = a, n = y(() => e.data.filter((i) => !i.hidden)), s = (i, u) => {
223
+ const r = (d, f = []) => {
224
+ for (const h of f) {
225
+ if (h.id.toString() === d.toString())
226
+ return h;
227
+ if (h.children?.length) {
228
+ const x = r(d, h.children);
229
+ if (x)
230
+ return x;
177
231
  }
178
232
  }
179
233
  };
180
- return i(u, o);
181
- }, l = (o) => {
182
- const u = r(s.value, o);
234
+ return r(u, i);
235
+ }, l = (i) => {
236
+ const u = s(n.value, i);
183
237
  u && t("select", u);
184
238
  };
185
- return (o, u) => (f(), g(m(ne), D({ class: "x-menu" }, n, { onSelect: l }), {
186
- default: _(() => [
187
- (f(!0), M(O, null, R(s.value, (i) => (f(), g(m(V), { item: i }, null, 8, ["item"]))), 256))
239
+ return (i, u) => (c(), m(o(Pt), Q({ class: "x-menu" }, i.$attrs, { onSelect: l }), {
240
+ default: p(() => [
241
+ (c(!0), A(q, null, we(n.value, (r) => (c(), m(o(mt), {
242
+ item: { ...r, icon: r.icon || o(ot) },
243
+ defaultIcon: e.defaultIcon,
244
+ subMenu: e.subMenu
245
+ }, null, 8, ["item", "defaultIcon", "subMenu"]))), 256))
188
246
  ]),
189
247
  _: 1
190
248
  }, 16));
191
249
  }
192
- }), Se = { class: "x-simple-mask__brand" }, xe = { class: "x-simple-mask__aciton" }, be = /* @__PURE__ */ w({
250
+ }), An = { class: "x-simple-mask__brand" }, Dn = { class: "x-simple-mask__aciton" }, Vn = /* @__PURE__ */ D({
193
251
  name: "XSimpleMask",
194
252
  __name: "SimpleMask",
195
253
  props: {
@@ -200,54 +258,54 @@ const he = {
200
258
  }) },
201
259
  menu: {}
202
260
  },
203
- setup(e, { expose: t }) {
204
- const n = e, s = ae(), r = ie(), l = S(() => r.params.id), o = () => {
205
- const i = n.project.home;
206
- i && s.push(i);
207
- }, u = (i) => {
208
- const a = i?.id;
209
- if (a) {
210
- const c = `${n.preview ? "/preview" : n.project.page}/${a}`;
211
- s.push(c);
261
+ setup(a, { expose: t }) {
262
+ const e = a, n = ke(), s = Ve(), l = y(() => s.params.id), i = () => {
263
+ const r = e.project.home;
264
+ r && n.push(r);
265
+ }, u = (r) => {
266
+ const d = r?.id;
267
+ if (d) {
268
+ const h = `${e.preview ? "/preview" : e.project.page}/${d}`;
269
+ n.push(h);
212
270
  }
213
271
  };
214
272
  return t({
215
- goHome: o
216
- }), (i, a) => (f(), g(m(A), { class: "x-simple-mask" }, {
217
- default: _(() => [
218
- y(m(se), { class: "x-simple-mask__header" }, {
219
- default: _(() => [
220
- x("div", Se, [
221
- x("span", {
273
+ goHome: i
274
+ }), (r, d) => (c(), m(o(Ne), { class: "x-simple-mask" }, {
275
+ default: p(() => [
276
+ b(o(Rt), { class: "x-simple-mask__header" }, {
277
+ default: p(() => [
278
+ R("div", An, [
279
+ R("span", {
222
280
  class: "x-simple-mask__logo",
223
- onClick: o
281
+ onClick: i
224
282
  }, [
225
- b(i.$slots, "logo", {}, () => [
226
- q(E(n.project.name), 1)
283
+ z(r.$slots, "logo", {}, () => [
284
+ N(O(e.project.name), 1)
227
285
  ])
228
286
  ])
229
287
  ]),
230
- x("div", xe, [
231
- b(i.$slots, "action")
288
+ R("div", Dn, [
289
+ z(r.$slots, "action")
232
290
  ])
233
291
  ]),
234
292
  _: 3
235
293
  }),
236
- y(m(A), null, {
237
- default: _(() => [
238
- y(m(oe), { class: "x-simple-mask__aside" }, {
239
- default: _(() => [
240
- y(m(T), D(n.menu, {
294
+ b(o(Ne), null, {
295
+ default: p(() => [
296
+ b(o($t), { class: "x-simple-mask__aside" }, {
297
+ default: p(() => [
298
+ b(o(G), Q(e.menu, {
241
299
  "default-active": l.value,
242
300
  onSelect: u
243
301
  }), null, 16, ["default-active"])
244
302
  ]),
245
303
  _: 1
246
304
  }),
247
- y(m(le), { class: "x-simple-mask__main" }, {
248
- default: _(() => [
249
- b(i.$slots, "default", {}, () => [
250
- y(m(ue))
305
+ b(o(Ft), { class: "x-simple-mask__main" }, {
306
+ default: p(() => [
307
+ z(r.$slots, "default", {}, () => [
308
+ b(o(it))
251
309
  ])
252
310
  ]),
253
311
  _: 3
@@ -255,122 +313,2557 @@ const he = {
255
313
  ]),
256
314
  _: 3
257
315
  }),
258
- i.$slots.footer ? (f(), g(m(re), {
316
+ r.$slots.footer ? (c(), m(o(Ot), {
259
317
  key: 0,
260
318
  class: "x-simple-mask__footer",
261
319
  height: "40px"
262
320
  }, {
263
- default: _(() => [
264
- b(i.$slots, "footer")
321
+ default: p(() => [
322
+ z(r.$slots, "footer")
265
323
  ]),
266
324
  _: 3
267
- })) : N("", !0)
325
+ })) : v("", !0)
268
326
  ]),
269
327
  _: 3
270
328
  }));
271
329
  }
272
- }), we = [_e, k, T, be];
273
- function Ie(e) {
274
- return S(() => e ? typeof e == "string" || e.setup || e.render || K(e) ? {
275
- icon: e
276
- } : e : null);
330
+ }), gt = {
331
+ /**
332
+ * 动作名称标识
333
+ */
334
+ name: {
335
+ type: String
336
+ },
337
+ /**
338
+ * 动作标题文本
339
+ */
340
+ label: {
341
+ type: String
342
+ },
343
+ /**
344
+ * 动作值,用来传输数据
345
+ */
346
+ value: {
347
+ type: [String, Number, Object, Array, Boolean]
348
+ },
349
+ /**
350
+ * 图标配置
351
+ */
352
+ icon: {
353
+ type: [String, Object]
354
+ },
355
+ /**
356
+ * 模式
357
+ */
358
+ mode: {
359
+ type: String,
360
+ default: "button"
361
+ },
362
+ /**
363
+ * 下拉菜单配置
364
+ */
365
+ menus: {
366
+ type: Array
367
+ },
368
+ /**
369
+ * tooltip 配置
370
+ */
371
+ tooltip: {
372
+ type: [String, Object]
373
+ },
374
+ /**
375
+ * Badge 配置
376
+ */
377
+ badge: {
378
+ type: [String, Number, Object]
379
+ },
380
+ /**
381
+ * ElDropdown 组件配置
382
+ */
383
+ dropdown: {
384
+ type: Object
385
+ },
386
+ /**
387
+ * ElButton 组件配置,mode为button时有效
388
+ */
389
+ button: {
390
+ type: Object
391
+ },
392
+ /**
393
+ * 禁用
394
+ */
395
+ disabled: {
396
+ type: [Boolean, Function]
397
+ },
398
+ /**
399
+ * 尺寸
400
+ */
401
+ size: {
402
+ type: String,
403
+ default: "default"
404
+ },
405
+ /**
406
+ * 颜色类型
407
+ */
408
+ type: {
409
+ type: String,
410
+ default: "primary"
411
+ },
412
+ /**
413
+ * icon 背景设置,当 mode为 icon 时有效
414
+ */
415
+ background: {
416
+ type: String,
417
+ default: "always"
418
+ },
419
+ /**
420
+ * icon 背景样式圆形,当 mode为 icon 时有效
421
+ */
422
+ circle: {
423
+ type: Boolean
424
+ }
425
+ };
426
+ function Pn(a) {
427
+ return y(() => {
428
+ const t = a.tooltip;
429
+ if (t)
430
+ return typeof t == "string" ? { content: t } : t;
431
+ });
277
432
  }
278
- function Re(e) {
279
- const t = Ie(e);
280
- return t.value ? w({ render: () => J(k, t.value) }) : null;
433
+ function Rn(a) {
434
+ return y(() => {
435
+ const t = a.badge;
436
+ if (t)
437
+ return typeof t == "object" ? t : { value: t };
438
+ });
281
439
  }
282
- function Pe(e, t = {}) {
283
- const n = t.edge || 40, s = S(() => t.selector ? typeof t.selector == "string" ? m(e)?.querySelector(t.selector) : m(e) : null), r = S(() => m(t.wrapper)), { x: l, y: o, isDragging: u } = ce(e, {
284
- preventDefault: !1,
285
- stopPropagation: !1,
286
- handle: t.selector ? s : null,
287
- ...pe(t, ["handle", "edge"])
288
- }), i = (a, p, c, d, h, I) => {
289
- const v = [-c.value + n, d.value - n];
290
- p.value = Math.min(Math.max(p.value, I.value), h.value - n), a.value < v[0] && (a.value = v[0]), a.value > v[1] && (a.value = v[1]);
291
- };
292
- if (t.wrapper) {
293
- const { width: a, height: p, top: c } = P(r), { width: d } = me(e);
294
- z([l, o], () => {
295
- i(l, o, d, a, p, c);
440
+ function $n(a) {
441
+ return y(() => {
442
+ const { dropdown: t, menus: e } = a;
443
+ if (e && e.length > 0)
444
+ return Object.assign(
445
+ { popperClass: "x-action__menus", size: a.size },
446
+ t || {}
447
+ );
448
+ });
449
+ }
450
+ function Fn(a) {
451
+ const t = _e();
452
+ return y(() => {
453
+ const e = o(a);
454
+ if (e)
455
+ if (typeof e == "string" || e.setup || e.render || xt(e)) {
456
+ const n = t?.appContext.app;
457
+ return {
458
+ icon: typeof e == "string" && n?.component(e) || e
459
+ };
460
+ } else
461
+ return e;
462
+ return null;
463
+ });
464
+ }
465
+ function be(a) {
466
+ const t = Fn(a);
467
+ return t.value ? Ae(D({ render: () => K(oe, t.value) })) : null;
468
+ }
469
+ function Pe(a, t) {
470
+ return y(() => {
471
+ const e = o(a);
472
+ return typeof e == "function" ? e(t) : !!e;
473
+ });
474
+ }
475
+ const On = { key: 0 }, jn = /* @__PURE__ */ D({
476
+ __name: "Trigger",
477
+ props: gt,
478
+ emits: ["click"],
479
+ setup(a, { emit: t }) {
480
+ const e = a, n = be(he(e, "icon")), s = Pe(he(e, "disabled")), l = y(() => ({
481
+ [`is-${e.mode}`]: !!e.mode,
482
+ [`is-${e.type}`]: !!e.type,
483
+ [`is-${e.size}`]: !!e.size && e.size !== "default",
484
+ [`is-background-${e.background}`]: e.mode === "icon" && !!e.background,
485
+ "is-disabled": !!e.disabled,
486
+ "is-circle": !!e.circle
487
+ })), i = () => {
488
+ t("click");
489
+ };
490
+ return (u, r) => e.mode === "button" ? (c(), m(o(ve), Q({
491
+ key: 0,
492
+ icon: o(n),
493
+ type: e.type,
494
+ size: e.size,
495
+ disabled: o(s)
496
+ }, e.button, { onClick: i }), {
497
+ default: p(() => [
498
+ N(O(u.label), 1)
499
+ ]),
500
+ _: 1
501
+ }, 16, ["icon", "type", "size", "disabled"])) : (c(), A("div", {
502
+ key: 1,
503
+ class: U(["x-action__inner", l.value]),
504
+ onClick: i
505
+ }, [
506
+ (c(), m(Y(o(n)))),
507
+ u.label ? (c(), A("span", On, O(u.label), 1)) : v("", !0)
508
+ ], 2));
509
+ }
510
+ }), W = /* @__PURE__ */ D({
511
+ name: "XAction",
512
+ __name: "Action",
513
+ props: gt,
514
+ emits: ["click", "command"],
515
+ setup(a, { emit: t }) {
516
+ const e = a, n = zt(), s = Pn(e), l = Rn(e), i = $n(e), u = Pe(he(e, "disabled")), r = y(() => ({
517
+ [`x-action--${e.mode}`]: !!e.mode
518
+ })), d = () => {
519
+ t("click", e);
520
+ }, f = (_) => {
521
+ const E = e.menus?.find((B) => B.command === _);
522
+ E && t("command", E);
523
+ }, h = (_) => K(Ie, l.value, () => [].concat(_)), x = (_) => K(
524
+ jt,
525
+ { ...i.value, disabled: u.value, onCommand: f },
526
+ {
527
+ default: () => [_],
528
+ dropdown: () => [
529
+ K(
530
+ Nt,
531
+ () => (e.menus || []).map((E) => K(
532
+ Ut,
533
+ E,
534
+ () => n.item ? n.item({ item: E }) : E.label
535
+ ))
536
+ )
537
+ ]
538
+ }
539
+ ), V = (_) => K(Xt, { ...s.value, disabled: u.value }, () => [
540
+ _
541
+ ]), k = y(() => {
542
+ let _ = n.default ? n.default()[0] : K(Ae(jn), { ...e, onClick: d });
543
+ return l.value && (_ = h(_)), i.value && (_ = x(_)), s.value && (_ = V(_)), _;
296
544
  });
545
+ return (_, E) => (c(), A("div", {
546
+ class: U(["x-action", r.value])
547
+ }, [
548
+ (c(), m(Y(k.value)))
549
+ ], 2));
297
550
  }
298
- return z(u, (a) => {
299
- a ? document.body.classList.add(X) : document.body.classList.remove(X);
551
+ }), Nn = {
552
+ /**
553
+ * 动作项
554
+ */
555
+ items: {
556
+ type: Array
557
+ },
558
+ /**
559
+ * 模式
560
+ */
561
+ mode: {
562
+ type: String,
563
+ default: "button"
564
+ },
565
+ /**
566
+ * 尺寸
567
+ */
568
+ size: {
569
+ type: String,
570
+ default: "default"
571
+ },
572
+ /**
573
+ * 颜色类型
574
+ */
575
+ type: {
576
+ type: String,
577
+ default: "primary"
578
+ },
579
+ /**
580
+ * icon 背景设置,当 mode为 icon 时有效
581
+ */
582
+ background: {
583
+ type: String,
584
+ default: "always"
585
+ },
586
+ /**
587
+ * icon 背景样式圆形,当 mode为 icon 时有效
588
+ */
589
+ circle: {
590
+ type: Boolean
591
+ },
592
+ /**
593
+ * 禁用
594
+ */
595
+ disabled: {
596
+ type: [Boolean, Function]
597
+ },
598
+ /**
599
+ * tooltip 配置
600
+ */
601
+ tooltip: {
602
+ type: Object
603
+ },
604
+ /**
605
+ * Badge 配置
606
+ */
607
+ badge: {
608
+ type: Object
609
+ },
610
+ /**
611
+ * ElDropdown 组件配置
612
+ */
613
+ dropdown: {
614
+ type: Object
615
+ },
616
+ /**
617
+ * ElButton 组件配置,mode为button时有效
618
+ */
619
+ button: {
620
+ type: Object
621
+ }
622
+ }, Re = /* @__PURE__ */ D({
623
+ name: "XActionBar",
624
+ __name: "ActionBar",
625
+ props: Nn,
626
+ emits: ["click", "command"],
627
+ setup(a, { emit: t }) {
628
+ const e = a, n = y(() => (e.items || []).map((i) => i === "|" ? i : {
629
+ ...i,
630
+ badge: i.badge ? {
631
+ ...e.badge,
632
+ ...typeof i.badge == "object" ? i.badge || {} : { value: i.badge }
633
+ } : void 0,
634
+ tooltip: i.tooltip ? {
635
+ ...e.tooltip,
636
+ ...typeof i.tooltip == "object" ? i.tooltip || {} : { content: i.tooltip }
637
+ } : void 0
638
+ })), s = (i) => {
639
+ t("click", i);
640
+ }, l = (i, u) => {
641
+ t("command", i, u);
642
+ };
643
+ return (i, u) => (c(), m(o(M), {
644
+ class: "x-action-bar",
645
+ align: "center"
646
+ }, {
647
+ default: p(() => [
648
+ (c(!0), A(q, null, we(n.value, (r) => (c(), A(q, null, [
649
+ r === "|" ? (c(), m(o(ue), {
650
+ key: 0,
651
+ direction: "vertical",
652
+ class: "x-action-bar__divider"
653
+ })) : (c(), m(o(W), Q({
654
+ key: 1,
655
+ mode: e.mode,
656
+ size: e.size,
657
+ type: e.type,
658
+ circle: e.circle,
659
+ background: e.background,
660
+ button: e.button,
661
+ dropdown: e.dropdown,
662
+ disabled: o(Pe)(e.disabled, r).value
663
+ }, r, {
664
+ onClick: s,
665
+ onCommand: (d) => l(r, d)
666
+ }), null, 16, ["mode", "size", "type", "circle", "background", "button", "dropdown", "disabled", "onCommand"]))
667
+ ], 64))), 256))
668
+ ]),
669
+ _: 1
670
+ }));
671
+ }
672
+ }), Un = {
673
+ /**
674
+ * 组件渲染html标签
675
+ */
676
+ tag: {
677
+ type: String,
678
+ default: "div"
679
+ },
680
+ /**
681
+ * 宽高自适应
682
+ */
683
+ fit: {
684
+ type: Boolean,
685
+ default: !1
686
+ },
687
+ /**
688
+ * 指定高度,fit 为true 失效
689
+ */
690
+ width: {
691
+ type: [String, Number]
692
+ },
693
+ /**
694
+ * 指定高度,fit 为true失效
695
+ */
696
+ height: {
697
+ type: [String, Number]
698
+ },
699
+ /**
700
+ * 开启flex布局
701
+ */
702
+ flex: {
703
+ type: Boolean,
704
+ default: !0
705
+ },
706
+ /**
707
+ * inline-flex
708
+ */
709
+ inline: {
710
+ type: Boolean
711
+ },
712
+ /**
713
+ * flex主轴方向
714
+ */
715
+ direction: {
716
+ type: String,
717
+ default: "row"
718
+ },
719
+ /**
720
+ * 换行
721
+ */
722
+ wrap: {
723
+ type: String,
724
+ default: "nowrap"
725
+ },
726
+ /**
727
+ * 主轴上的对齐方式。
728
+ */
729
+ justify: {
730
+ type: String,
731
+ default: "flex-start"
732
+ },
733
+ /**
734
+ * 交叉轴上对齐方式
735
+ */
736
+ align: {
737
+ type: String,
738
+ default: "flex-start"
739
+ },
740
+ /**
741
+ * 多根轴线的对齐方式。如果项目只有一根轴线,该属性不起作用
742
+ */
743
+ alignContent: {
744
+ type: String,
745
+ default: "stretch"
746
+ },
747
+ /**
748
+ * 放大
749
+ */
750
+ grow: {
751
+ type: Boolean,
752
+ default: !1
753
+ },
754
+ /**
755
+ * 缩小
756
+ */
757
+ shrink: {
758
+ type: Boolean,
759
+ default: !1
760
+ },
761
+ /**
762
+ * 单个项目有与其他项目不一样的对齐方式。可覆盖容器的align-items属性
763
+ */
764
+ alignSelf: {
765
+ type: String,
766
+ default: "auto"
767
+ },
768
+ /**
769
+ * css overflow
770
+ */
771
+ overflow: {
772
+ type: String
773
+ },
774
+ /**
775
+ * 内边距
776
+ */
777
+ padding: {
778
+ type: Boolean,
779
+ default: !1
780
+ }
781
+ }, M = /* @__PURE__ */ D({
782
+ name: "XContainer",
783
+ __name: "Container",
784
+ props: Un,
785
+ setup(a) {
786
+ const t = a, e = _e(), n = y(() => {
787
+ const i = e?.parent;
788
+ if (!i)
789
+ return !1;
790
+ const u = i.proxy;
791
+ return u.$options.name === "XContainer" || !!u.flex;
792
+ }), s = y(() => ({
793
+ "is-fit": t.fit,
794
+ "is-flex": t.flex && !t.inline,
795
+ "is-inline-flex": t.flex && t.inline,
796
+ [`is-direction-${t.direction}`]: t.flex && t.direction !== "row",
797
+ [`is-wrap-${t.wrap}`]: t.flex && t.wrap !== "nowrap",
798
+ [`is-justify-${t.justify}`]: t.flex && t.justify !== "flex-start",
799
+ [`is-align-${t.align}`]: t.flex && t.align !== "flex-start",
800
+ [`is-align-content-${t.alignContent}`]: t.flex && t.alignContent !== "stretch",
801
+ "is-grow": t.grow ?? n.value,
802
+ "is-shrink": n.value && t.shrink,
803
+ [`is-align-self-${t.alignSelf}`]: n.value && t.alignSelf !== "auto",
804
+ [`is-overflow-${t.overflow}`]: !!t.overflow,
805
+ "is-padding": !!t.padding
806
+ })), l = y(() => {
807
+ const { width: i, height: u, fit: r } = t;
808
+ return r ? null : {
809
+ width: i ? Xe(i) : void 0,
810
+ height: u ? Xe(u) : void 0
811
+ };
812
+ });
813
+ return (i, u) => (c(), m(Y(t.tag), {
814
+ class: U(["x-container", s.value]),
815
+ style: Ee(l.value)
816
+ }, {
817
+ default: p(() => [
818
+ z(i.$slots, "default")
819
+ ]),
820
+ _: 3
821
+ }, 8, ["class", "style"]));
822
+ }
823
+ }), Xn = {
824
+ size: {
825
+ type: String,
826
+ default: "default"
827
+ },
828
+ content: {
829
+ type: String,
830
+ default: ""
831
+ },
832
+ subtitle: {
833
+ type: String
834
+ },
835
+ icon: {
836
+ type: [String, Object]
837
+ },
838
+ border: {
839
+ type: Boolean
840
+ },
841
+ more: {
842
+ type: Boolean
843
+ }
844
+ }, Hn = {
845
+ key: 2,
846
+ class: "x-header__subtitle"
847
+ }, Ln = {
848
+ key: 0,
849
+ class: "x-header__actions"
850
+ }, ht = /* @__PURE__ */ D({
851
+ name: "XHeader",
852
+ inheritAttrs: !1,
853
+ __name: "Header",
854
+ props: Xn,
855
+ setup(a) {
856
+ const t = a, e = Je(), n = be(he(t, "icon")), s = y(() => ({
857
+ [`is-size-${t.size}`]: !!t.size && t.size !== "default",
858
+ "is-border": t.border,
859
+ "is-pointer": !!e.onClick
860
+ }));
861
+ return (l, i) => (c(), m(o(M), {
862
+ class: U(["x-header", s.value]),
863
+ justify: "space-between",
864
+ align: "center"
865
+ }, {
866
+ default: p(() => [
867
+ b(o(M), {
868
+ align: "center",
869
+ class: U(["x-header__wrapper", s.value]),
870
+ grow: ""
871
+ }, {
872
+ default: p(() => [
873
+ o(n) ? (c(), m(Y(o(n)), {
874
+ key: 0,
875
+ class: "x-header__icon"
876
+ })) : v("", !0),
877
+ R("span", Q({ class: "x-header__content" }, l.$attrs), [
878
+ z(l.$slots, "default", {}, () => [
879
+ N(O(t.content), 1)
880
+ ])
881
+ ], 16),
882
+ t.more ? (c(), m(o(oe), {
883
+ key: 1,
884
+ class: "x-header__more",
885
+ icon: o(Jt)
886
+ }, null, 8, ["icon"])) : v("", !0),
887
+ t.subtitle || l.$slots.subtitle ? (c(), A("span", Hn, [
888
+ z(l.$slots, "subtitle", {}, () => [
889
+ N(O(t.subtitle), 1)
890
+ ])
891
+ ])) : v("", !0)
892
+ ]),
893
+ _: 3
894
+ }, 8, ["class"]),
895
+ l.$slots.actions ? (c(), A("div", Ln, [
896
+ z(l.$slots, "actions")
897
+ ])) : v("", !0)
898
+ ]),
899
+ _: 3
900
+ }, 8, ["class"]));
901
+ }
902
+ }), Wn = {
903
+ /**
904
+ * 宽高自适应
905
+ */
906
+ fit: {
907
+ type: Boolean,
908
+ default: !1
909
+ },
910
+ /**
911
+ * 指定高度,fit 为true 失效
912
+ */
913
+ width: {
914
+ type: [String, Number]
915
+ },
916
+ /**
917
+ * 指定高度,fit 为true失效
918
+ */
919
+ height: {
920
+ type: [String, Number]
921
+ },
922
+ /**
923
+ * 显示边框
924
+ */
925
+ border: {
926
+ type: Boolean,
927
+ default: !0
928
+ },
929
+ /**
930
+ * 圆角
931
+ */
932
+ radius: {
933
+ type: Boolean,
934
+ default: !0
935
+ },
936
+ /**
937
+ * 卡片模式
938
+ */
939
+ card: {
940
+ type: Boolean
941
+ },
942
+ /**
943
+ * 尺寸
944
+ */
945
+ size: {
946
+ type: String
947
+ },
948
+ /**
949
+ * 阴影设置
950
+ */
951
+ shadow: {
952
+ type: String
953
+ },
954
+ /**
955
+ * 头部设置
956
+ */
957
+ header: {
958
+ type: [String, Object]
959
+ },
960
+ bodyPadding: {
961
+ type: Boolean,
962
+ default: !0
963
+ },
964
+ footerPadding: {
965
+ type: Boolean,
966
+ default: !0
967
+ },
968
+ body: {
969
+ type: Object
970
+ },
971
+ footer: {
972
+ type: Object
973
+ }
974
+ }, vt = /* @__PURE__ */ D({
975
+ name: "XPanel",
976
+ __name: "Panel",
977
+ props: Wn,
978
+ setup(a, { expose: t }) {
979
+ const e = a, n = $(), s = y(() => ({
980
+ "x-panel--card": !!e.card,
981
+ "x-panel--default": !e.card,
982
+ [`is-${e.size}`]: !!e.size && e.size !== "default",
983
+ "is-border": !!e.border,
984
+ "is-radius": !!e.radius,
985
+ [`is-shadow-${e.shadow}`]: !!e.shadow && e.shadow !== "none"
986
+ })), l = y(() => e.header === null ? null : typeof e.header == "string" ? {
987
+ content: e.header,
988
+ size: e.size
989
+ } : {
990
+ ...e.header,
991
+ size: e.size
992
+ }), i = y(() => e.fit || e.height ? "auto" : void 0);
993
+ return t({
994
+ bodyRef: n
995
+ }), (u, r) => (c(), m(o(M), {
996
+ class: U(["x-panel", s.value]),
997
+ direction: "column",
998
+ fit: e.fit,
999
+ width: e.width,
1000
+ height: e.height
1001
+ }, {
1002
+ default: p(() => [
1003
+ l.value ? (c(), m(o(M), {
1004
+ key: 0,
1005
+ flex: !1,
1006
+ class: "x-panel__header"
1007
+ }, {
1008
+ default: p(() => [
1009
+ z(u.$slots, "header", {}, () => [
1010
+ b(o(ht), St(Ct(l.value)), {
1011
+ default: p(() => [
1012
+ z(u.$slots, "title")
1013
+ ]),
1014
+ actions: p(() => [
1015
+ z(u.$slots, "actions")
1016
+ ]),
1017
+ _: 3
1018
+ }, 16)
1019
+ ])
1020
+ ]),
1021
+ _: 3
1022
+ })) : v("", !0),
1023
+ b(o(M), Q({
1024
+ ref_key: "bodyRef",
1025
+ ref: n,
1026
+ flex: !1,
1027
+ overflow: i.value,
1028
+ grow: "",
1029
+ padding: "",
1030
+ class: "x-panel__body"
1031
+ }, e.body), {
1032
+ default: p(() => [
1033
+ z(u.$slots, "default")
1034
+ ]),
1035
+ _: 3
1036
+ }, 16, ["overflow"]),
1037
+ u.$slots.footer ? (c(), m(o(M), Q({
1038
+ key: 1,
1039
+ flex: !1,
1040
+ padding: "",
1041
+ class: "x-panel__footer"
1042
+ }, e.footer), {
1043
+ default: p(() => [
1044
+ z(u.$slots, "footer")
1045
+ ]),
1046
+ _: 3
1047
+ }, 16)) : v("", !0)
1048
+ ]),
1049
+ _: 3
1050
+ }, 8, ["class", "fit", "width", "height"]));
1051
+ }
1052
+ }), Le = "user-select-none";
1053
+ class We {
1054
+ constructor(t, e = {}) {
1055
+ this.el = t, this.options = e, this.scope = Ke(), this.scope.run(() => {
1056
+ this.init();
1057
+ });
1058
+ }
1059
+ scope;
1060
+ dragging = !1;
1061
+ getHandle() {
1062
+ const { selector: t, handle: e } = this.options;
1063
+ return t ? this.el.querySelector(t) : e;
1064
+ }
1065
+ getTarget() {
1066
+ const { target: t = "body" } = this.options;
1067
+ return typeof t == "string" ? document.querySelector(t) : o(t) || document.body;
1068
+ }
1069
+ init() {
1070
+ const { el: t, options: e } = this, { disabled: n, delay: s = 150, onStart: l, onEnd: i } = e;
1071
+ if (n)
1072
+ return;
1073
+ let u = null;
1074
+ const r = this.getHandle(), d = this.getTarget();
1075
+ let f = t.getBoundingClientRect(), h = null;
1076
+ const { x, y: V } = dn(t, {
1077
+ initialValue: { x: f.x, y: f.y },
1078
+ ...e,
1079
+ handle: r,
1080
+ onStart: (k, _) => {
1081
+ document.body.classList.add(Le), clearTimeout(u), u = setTimeout(() => {
1082
+ this.dragging = !0, f = t.getBoundingClientRect(), h = d?.getBoundingClientRect(), l && l(k, _);
1083
+ }, s);
1084
+ },
1085
+ onEnd: (k, _) => {
1086
+ if (clearTimeout(u), document.body.classList.remove(Le), this.dragging && h) {
1087
+ this.dragging = !1;
1088
+ const { x: E, y: B } = k, g = this.getPosition(h, f, E, B);
1089
+ i && i(g, _), h = null;
1090
+ }
1091
+ }
1092
+ });
1093
+ ne([x, V], () => {
1094
+ if (this.dragging && h) {
1095
+ const k = this.getPosition(h, f, x.value, V.value);
1096
+ t.style.left = `${k.x}px`, t.style.top = `${k.y}px`;
1097
+ }
1098
+ });
1099
+ }
1100
+ getPosition(t, e, n, s) {
1101
+ const { edge: l = 50 } = this.options, i = -e.width + l, u = t.width - l, r = 0, d = t.height - l, f = Math.min(u, Math.max(n, i)), h = Math.min(d, Math.max(s, r));
1102
+ return {
1103
+ x: f,
1104
+ y: h
1105
+ };
1106
+ }
1107
+ destory() {
1108
+ this.scope.stop();
1109
+ }
1110
+ }
1111
+ const Qn = {
1112
+ mounted(a, t) {
1113
+ const e = t.value || {}, n = new We(a, e);
1114
+ a.__draggable__ = n;
1115
+ },
1116
+ updated(a, t) {
1117
+ const e = t.value || {};
1118
+ let n = a.__draggable__;
1119
+ n && !ct(n.options, e) && (n.destory(), a.__draggable__ = new We(a, e));
1120
+ },
1121
+ unmounted(a) {
1122
+ const t = a.__draggable__;
1123
+ t && (t.destory(), a.__draggable__ = null);
1124
+ }
1125
+ }, Me = "user-select-none";
1126
+ class Qe {
1127
+ constructor(t, e = {}) {
1128
+ this.el = t, this.options = e, this.scope = Ke(), this.scope.run(() => {
1129
+ this.init();
1130
+ });
1131
+ }
1132
+ scope;
1133
+ resizing = $(!1);
1134
+ direction = $("");
1135
+ MIE = null;
1136
+ cleanMousedown;
1137
+ cleanMouseup;
1138
+ init() {
1139
+ const { el: t, options: e } = this, { disabled: n, onStart: s, onEnd: l } = e;
1140
+ if (n)
1141
+ return;
1142
+ this.MIE = pn(t), this.cleanMousedown = ye(document, "mousedown", () => {
1143
+ this.direction?.value && this.MIE && (this.resizing.value = !0, t.classList.add("is-resizing", `is-${this.direction.value}-resizing`), s && s(this.direction.value, this.MIE));
1144
+ }), this.cleanMouseup = ye(document, "mouseup", () => {
1145
+ this.resizing.value && this.direction?.value && this.MIE && (t.classList.remove(
1146
+ "is-resizing",
1147
+ `is-${this.direction.value}-resizing`
1148
+ ), l && l(this.direction.value, this.MIE)), this.resizing.value = !1;
1149
+ }), ne(this.direction, (r) => {
1150
+ const d = document.body;
1151
+ d.style.cursor = r ? `${r}-resize` : "", r ? d.classList.add(Me) : d.classList.remove(Me);
1152
+ });
1153
+ const { x: i, y: u } = this.MIE;
1154
+ ne([i, u], () => {
1155
+ this.resizing.value ? this.resize() : this.direction.value = this.getDirection();
1156
+ });
1157
+ }
1158
+ resize() {
1159
+ const { MIE: t, direction: e, resizing: n, options: s, el: l } = this, i = e?.value || "";
1160
+ if (!t || !n.value || !i)
1161
+ return;
1162
+ const { x: u, y: r, elementX: d, elementY: f, elementHeight: h, elementWidth: x } = t, { onResizing: V } = s, {
1163
+ minWidth: k = 0,
1164
+ minHeight: _ = 0,
1165
+ maxWidth: E = 99999,
1166
+ maxHeight: B = 99999
1167
+ } = s;
1168
+ if (i.includes("e")) {
1169
+ const g = Math.min(Math.max(d.value, k), E);
1170
+ l.style.width = `${g}px`;
1171
+ }
1172
+ if (i.includes("s")) {
1173
+ const g = Math.min(Math.max(f.value, _), B);
1174
+ l.style.height = `${g}px`;
1175
+ }
1176
+ if (i.includes("w")) {
1177
+ const g = Math.min(
1178
+ Math.max(x.value - d.value, k),
1179
+ E
1180
+ );
1181
+ l.style.width = `${g}px`, l.style.left = `${u.value}px`;
1182
+ }
1183
+ if (i.includes("n")) {
1184
+ const g = Math.min(
1185
+ Math.max(h.value - f.value, _),
1186
+ B
1187
+ );
1188
+ this.el.style.height = `${g}px`, this.el.style.top = `${r.value}px`;
1189
+ }
1190
+ V && V(i, t);
1191
+ }
1192
+ getDirection() {
1193
+ if (!this.MIE)
1194
+ return "";
1195
+ const { elementX: t, elementY: e, elementHeight: n, elementWidth: s, isOutside: l } = this.MIE;
1196
+ if (l.value)
1197
+ return "";
1198
+ const { dirs: i = ["n", "s", "w", "e"], edge: u = 5 } = this.options;
1199
+ let r = "";
1200
+ return i.includes("n") && e.value <= u ? r += "n" : i.includes("s") && e.value > n.value - u && (r += "s"), i.includes("w") && t.value <= u ? r += "w" : i.includes("e") && t.value > s.value - u && (r += "e"), r;
1201
+ }
1202
+ destory() {
1203
+ const t = document.body;
1204
+ t.style.cursor = "", t.classList.remove(Me), this.cleanMousedown && this.cleanMousedown(), this.cleanMouseup && this.cleanMouseup(), this.MIE?.stop(), this.scope.stop();
1205
+ }
1206
+ }
1207
+ const yt = {
1208
+ mounted(a, t) {
1209
+ const e = t.value || {}, n = new Qe(a, e);
1210
+ a.__resizable__ = n;
1211
+ },
1212
+ updated(a, t) {
1213
+ const e = t.value || {};
1214
+ let n = a.__resizable__;
1215
+ n && !ct(n.options, e) && (n.destory(), a.__resizable__ = new Qe(a, e));
1216
+ },
1217
+ unmounted(a) {
1218
+ const t = a.__resizable__;
1219
+ t && (t.destory(), a.__resizable__ = null);
1220
+ }
1221
+ }, Zn = {
1222
+ modelValue: {
1223
+ type: Boolean,
1224
+ default: !0
1225
+ },
1226
+ title: {
1227
+ type: String
1228
+ },
1229
+ subtitle: {
1230
+ type: String
1231
+ },
1232
+ icon: {
1233
+ type: [String, Object]
1234
+ },
1235
+ size: {
1236
+ type: String,
1237
+ default: "default"
1238
+ },
1239
+ width: {
1240
+ type: [Number, String],
1241
+ default: "70%"
1242
+ },
1243
+ height: {
1244
+ type: [Number, String],
1245
+ default: "70%"
1246
+ },
1247
+ left: {
1248
+ type: [Number, String]
1249
+ },
1250
+ top: {
1251
+ type: [Number, String]
1252
+ },
1253
+ modal: {
1254
+ type: Boolean,
1255
+ default: !0
1256
+ },
1257
+ draggable: {
1258
+ type: [Boolean, Object],
1259
+ default: !0
1260
+ },
1261
+ resizable: {
1262
+ type: [Boolean, Object]
1263
+ },
1264
+ closable: {
1265
+ type: Boolean,
1266
+ default: !0
1267
+ },
1268
+ maximizable: {
1269
+ type: Boolean,
1270
+ default: !0
1271
+ },
1272
+ minimizable: {
1273
+ type: Boolean,
1274
+ default: !0
1275
+ },
1276
+ mode: {
1277
+ type: String,
1278
+ default: "normal"
1279
+ },
1280
+ content: {
1281
+ type: Object
1282
+ },
1283
+ src: {
1284
+ type: String
1285
+ },
1286
+ componentInstance: {
1287
+ type: Object
1288
+ },
1289
+ beforeClose: {
1290
+ type: Function
1291
+ },
1292
+ submit: {
1293
+ type: [Boolean, String]
1294
+ },
1295
+ cancel: {
1296
+ type: [Boolean, String]
1297
+ },
1298
+ bodyPadding: {
1299
+ type: Boolean,
1300
+ default: !0
1301
+ },
1302
+ primary: {
1303
+ type: Boolean
1304
+ }
1305
+ };
1306
+ let ie = 1e3;
1307
+ function Jn(a, t) {
1308
+ const { width: e, height: n } = rt(t), s = Ye({
1309
+ mode: a.mode || "normal",
1310
+ wrapperWidth: 0,
1311
+ wrapperHeight: 0,
1312
+ width: 0,
1313
+ height: 0,
1314
+ top: 0,
1315
+ left: 0,
1316
+ zIndex: ++ie,
1317
+ dragging: !1,
1318
+ resizing: !1
1319
+ });
1320
+ return ne([e, n], ([l, i]) => {
1321
+ s.wrapperWidth = l, s.wrapperHeight = i, s.width = pe(a.width, l), s.height = pe(a.height, i), s.left = a.left ? pe(a.left, l) - s.width / 2 : Math.max(Math.floor((l - s.width) / 2), 0), s.top = a.top ? pe(a.top, i) : Math.max(Math.floor((i - s.height) / 2), 0);
1322
+ }), ne(s, (l) => {
1323
+ ie = Math.max(l.zIndex, ie);
300
1324
  }), {
301
- x: l,
302
- y: o,
303
- isDragging: u
1325
+ state: s,
1326
+ normal: y(() => s.mode === "normal"),
1327
+ maximized: y(() => s.mode === "maximized"),
1328
+ minimized: y(() => s.mode === "minimized")
1329
+ };
1330
+ }
1331
+ function Kn(a, t) {
1332
+ const e = y(() => {
1333
+ const { width: i, height: u, top: r, left: d, zIndex: f } = t;
1334
+ return {
1335
+ width: `${i}px`,
1336
+ height: `${u}px`,
1337
+ top: `${r}px`,
1338
+ left: `${d}px`,
1339
+ zIndex: f
1340
+ };
1341
+ }), n = y(() => ({
1342
+ [`is-${t.mode}`]: !!t.mode,
1343
+ "is-draggable": !!a.draggable,
1344
+ "is-resizable": !!a.resizable,
1345
+ "is-primary": !!a.primary
1346
+ })), s = y(() => ({
1347
+ [`is-${t.mode}`]: !!t.mode,
1348
+ "is-dragging": t.dragging,
1349
+ "is-resizing": t.resizing
1350
+ })), l = y(() => ({
1351
+ zIndex: t.zIndex
1352
+ }));
1353
+ return {
1354
+ styles: e,
1355
+ classes: n,
1356
+ wrapperClass: s,
1357
+ modalStyle: l
1358
+ };
1359
+ }
1360
+ function Yn(a, t, e) {
1361
+ const n = (f) => {
1362
+ t.mode = f, ["maximized", "minimized", "normal"].includes(f) && e(f), e("modeChange", f);
1363
+ }, s = async () => {
1364
+ (!a.beforeClose || await a.beforeClose()) && (e("update:modelValue", !1), e("close"), e("destroy"));
1365
+ };
1366
+ return {
1367
+ close: s,
1368
+ changeMode: n,
1369
+ show: () => n("normal"),
1370
+ hide: () => n("minimized"),
1371
+ active: () => {
1372
+ t.zIndex = Math.max(t.zIndex, ++ie);
1373
+ },
1374
+ submit: () => e("submit"),
1375
+ cancel: () => {
1376
+ e("cancel"), s();
1377
+ }
304
1378
  };
305
1379
  }
306
- function Ee(e, t, n) {
307
- const { dirs: s = ["n", "s", "w", "e"], edge: r = 5 } = e;
308
- let l = "";
309
- const { left: o, top: u, width: i, height: a } = n, { clientX: p, clientY: c } = t;
310
- return s.includes("n") && c > u.value - r && c < u.value + r ? l += "n" : s.includes("s") && c < u.value + a.value + r && c > u.value + a.value - r && (l += "s"), s.includes("w") && p > o.value - r && p < o.value + r ? l += "w" : s.includes("e") && p < o.value + i.value + r && p > o.value + i.value - r && (l += "e"), l;
1380
+ function Gn(a, t, e, n) {
1381
+ return y(() => {
1382
+ const s = typeof a.draggable == "boolean" ? !a.draggable : !!a.draggable?.disabled;
1383
+ return {
1384
+ ...ut(a.draggable) ? a.draggable : {},
1385
+ disabled: s,
1386
+ target: n,
1387
+ selector: ".x-panel__header",
1388
+ onStart(l) {
1389
+ t.dragging = !0, t.zIndex = Math.max(t.zIndex, ++ie), e("dragStart", l);
1390
+ },
1391
+ onMove(l) {
1392
+ e("dragging", l);
1393
+ },
1394
+ onEnd(l) {
1395
+ if (t.mode === "maximized")
1396
+ return;
1397
+ const { x: i, y: u } = l;
1398
+ t.left = i, t.top = u, t.dragging = !1, e("dragEnd", l);
1399
+ }
1400
+ };
1401
+ });
311
1402
  }
312
- function ke(e, t, n, s) {
313
- if (!n)
1403
+ function qn(a, t, e) {
1404
+ return y(() => {
1405
+ const n = typeof a.resizable == "boolean" ? !a.resizable : !!a.resizable?.disabled;
1406
+ return {
1407
+ minWidth: 200,
1408
+ minHeight: 150,
1409
+ ...ut(a.resizable) ? a.resizable : {},
1410
+ disabled: n,
1411
+ dirs: ["e", "s", "w"],
1412
+ onStart(s, l) {
1413
+ t.resizing = !0, t.zIndex = Math.max(t.zIndex, ++ie), e("resizeStart", s, l);
1414
+ },
1415
+ onResizing(s, l) {
1416
+ e("resizing", s, l);
1417
+ },
1418
+ onEnd(s, l) {
1419
+ t.left = l.elementPositionX.value, t.top = l.elementPositionY.value, t.width = l.elementWidth.value, t.height = l.elementHeight.value, t.resizing = !1, e("resizeEnd", s, l);
1420
+ }
1421
+ };
1422
+ });
1423
+ }
1424
+ function eo(a, t) {
1425
+ const e = a.componentInstance;
1426
+ if (!e)
314
1427
  return;
315
- const { minWidth: r = 0, minHeight: l = 0, maxWidth: o, maxHeight: u } = e, { clientX: i, clientY: a } = t, { left: p, top: c, width: d, height: h } = s;
316
- n.includes("e") && (d.value = Math.max(i - p.value, r)), n.includes("w") && (d.value = Math.max(d.value + p.value - i, r), p.value = i), n.includes("s") && (h.value = Math.max(a - c.value, l)), n.includes("n") && (h.value = Math.max(h.value + c.value - a, l), c.value = a), o && (d.value = Math.min(d.value, o)), u && (h.value = Math.min(h.value, u)), e.onResizing && e.onResizing(s);
1428
+ let n = null;
1429
+ return Tt(() => {
1430
+ const s = o(t), l = o(s?.bodyRef);
1431
+ n = e.$el, l && l.$el && l.$el.appendChild(n);
1432
+ }), Mt(() => {
1433
+ n && n.parentNode && n.parentNode.removeChild(n);
1434
+ }), {
1435
+ componentInstance: e
1436
+ };
1437
+ }
1438
+ const to = ["src"], bt = /* @__PURE__ */ D({
1439
+ name: "XDialog",
1440
+ __name: "Dialog",
1441
+ props: Zn,
1442
+ emits: ["update:modelValue", "open", "close", "destroy", "maximized", "minimized", "normal", "modeChange", "dragStart", "dragging", "dragEnd", "resizeStart", "resizeEnd", "resizing", "submit", "cancel"],
1443
+ setup(a, { expose: t, emit: e }) {
1444
+ const n = a, s = _e(), l = $(), i = $(), { state: u, maximized: r, minimized: d, normal: f } = Jn(n, l), { styles: h, classes: x, wrapperClass: V, modalStyle: k } = Kn(n, u), { changeMode: _, active: E, close: B, show: g, hide: I, submit: C, cancel: F } = Yn(
1445
+ n,
1446
+ u,
1447
+ e
1448
+ ), X = Gn(n, u, e, l), ee = qn(n, u, e), te = eo(n, i);
1449
+ return Ge(async () => {
1450
+ n.modelValue && (await le(), s && e("open", s));
1451
+ }), t({
1452
+ panelRef: i,
1453
+ state: u,
1454
+ maximized: r,
1455
+ minimized: d,
1456
+ changeMode: _,
1457
+ show: g,
1458
+ hide: I,
1459
+ submit: C,
1460
+ cancel: F,
1461
+ componentInstance: te
1462
+ }), (j, H) => n.modelValue ? (c(), m(qe, {
1463
+ key: 0,
1464
+ to: "body"
1465
+ }, [
1466
+ R("div", {
1467
+ ref_key: "wrapper",
1468
+ ref: l,
1469
+ class: U(["x-dialog__wrapper", o(V)])
1470
+ }, [
1471
+ n.modal ? (c(), A("div", {
1472
+ key: 0,
1473
+ class: "x-dialog__modal",
1474
+ style: Ee(o(k))
1475
+ }, null, 4)) : v("", !0),
1476
+ L((c(), m(o(vt), {
1477
+ ref_key: "panelRef",
1478
+ ref: i,
1479
+ class: U(["x-dialog", o(x)]),
1480
+ card: "",
1481
+ shadow: "always",
1482
+ header: { icon: n.icon, subtitle: n.subtitle },
1483
+ width: "800px",
1484
+ height: "600px",
1485
+ footer: { justify: "space-between", flex: !0, align: "center" },
1486
+ style: Ee(o(h)),
1487
+ size: n.size,
1488
+ body: { padding: n.bodyPadding },
1489
+ onClick: o(E)
1490
+ }, et({
1491
+ title: p(() => [
1492
+ N(O(n.title), 1)
1493
+ ]),
1494
+ actions: p(() => [
1495
+ z(j.$slots, "actions"),
1496
+ n.minimizable ? (c(), m(o(W), {
1497
+ key: 0,
1498
+ icon: o(ln),
1499
+ size: n.size,
1500
+ mode: "icon",
1501
+ type: "primary",
1502
+ background: "hover",
1503
+ onClick: H[0] || (H[0] = (ae) => o(_)("minimized"))
1504
+ }, null, 8, ["icon", "size"])) : v("", !0),
1505
+ n.maximizable ? (c(), A(q, { key: 1 }, [
1506
+ o(f) ? (c(), m(o(W), {
1507
+ key: 1,
1508
+ icon: o(cn),
1509
+ size: n.size,
1510
+ mode: "icon",
1511
+ type: "primary",
1512
+ background: "hover",
1513
+ onClick: H[2] || (H[2] = (ae) => o(_)("maximized"))
1514
+ }, null, 8, ["icon", "size"])) : (c(), m(o(W), {
1515
+ key: 0,
1516
+ icon: o(rn),
1517
+ size: n.size,
1518
+ mode: "icon",
1519
+ type: "primary",
1520
+ background: "hover",
1521
+ onClick: H[1] || (H[1] = (ae) => o(_)("normal"))
1522
+ }, null, 8, ["icon", "size"]))
1523
+ ], 64)) : v("", !0),
1524
+ n.closable ? (c(), m(o(W), {
1525
+ key: 2,
1526
+ icon: o(un),
1527
+ size: n.size,
1528
+ mode: "icon",
1529
+ type: "danger",
1530
+ background: "hover",
1531
+ onClick: o(B)
1532
+ }, null, 8, ["icon", "size", "onClick"])) : v("", !0)
1533
+ ]),
1534
+ default: p(() => [
1535
+ z(j.$slots, "default", {}, () => [
1536
+ n.content ? (c(), m(Y(n.content), { key: 0 })) : v("", !0),
1537
+ n.src ? (c(), A("iframe", {
1538
+ key: 1,
1539
+ src: n.src,
1540
+ class: "x-dialog__frame"
1541
+ }, null, 8, to)) : v("", !0)
1542
+ ])
1543
+ ]),
1544
+ _: 2
1545
+ }, [
1546
+ n.cancel || n.submit || j.$slots.footer || j.$slots.extra || j.$slots.handle ? {
1547
+ name: "footer",
1548
+ fn: p(() => [
1549
+ z(j.$slots, "footer", {}, () => [
1550
+ b(o(M), null, {
1551
+ default: p(() => [
1552
+ z(j.$slots, "extra")
1553
+ ]),
1554
+ _: 3
1555
+ }),
1556
+ b(o(M), null, {
1557
+ default: p(() => [
1558
+ z(j.$slots, "handle"),
1559
+ n.cancel ? (c(), m(o(ve), {
1560
+ key: 0,
1561
+ type: "default",
1562
+ size: n.size,
1563
+ onClick: o(F)
1564
+ }, {
1565
+ default: p(() => [
1566
+ N(O(typeof n.cancel == "string" ? n.cancel : "取消"), 1)
1567
+ ]),
1568
+ _: 1
1569
+ }, 8, ["size", "onClick"])) : v("", !0),
1570
+ n.submit ? (c(), m(o(ve), {
1571
+ key: 1,
1572
+ type: "primary",
1573
+ size: n.size,
1574
+ onClick: o(C)
1575
+ }, {
1576
+ default: p(() => [
1577
+ N(O(typeof n.submit == "string" ? n.cancel : "确定"), 1)
1578
+ ]),
1579
+ _: 1
1580
+ }, 8, ["size", "onClick"])) : v("", !0)
1581
+ ]),
1582
+ _: 3
1583
+ })
1584
+ ])
1585
+ ]),
1586
+ key: "0"
1587
+ } : void 0
1588
+ ]), 1032, ["header", "class", "style", "size", "body", "onClick"])), [
1589
+ [o(Qn), o(X)],
1590
+ [o(yt), o(ee)]
1591
+ ])
1592
+ ], 2)
1593
+ ])) : v("", !0);
1594
+ }
1595
+ });
1596
+ function $e(a, t) {
1597
+ const e = document.createElement("div"), n = b(bt, a);
1598
+ n.appContext = t ?? $e._context, Fe(n, e);
1599
+ const s = () => {
1600
+ Fe(null, e), e.parentNode?.removeChild(e);
1601
+ };
1602
+ return n.props.onDestroy = () => {
1603
+ s();
1604
+ }, document.body.appendChild(e), {
1605
+ vnode: n,
1606
+ destroy: s
1607
+ };
1608
+ }
1609
+ const no = /* @__PURE__ */ R("div", { class: "x-mask-sidebar__helper" }, null, -1), oo = /* @__PURE__ */ D({
1610
+ __name: "Sidebar",
1611
+ props: {
1612
+ collapsed: { type: Boolean }
1613
+ },
1614
+ setup(a) {
1615
+ const t = a;
1616
+ return (e, n) => L((c(), m(o(M), {
1617
+ class: U(["x-mask-sidebar", { "is-collapsed": t.collapsed }]),
1618
+ grow: !1,
1619
+ flex: "",
1620
+ direction: "column"
1621
+ }, {
1622
+ default: p(() => [
1623
+ z(e.$slots, "brand"),
1624
+ b(o(M), {
1625
+ class: "x-mask-sidebar__wrapper",
1626
+ flex: "",
1627
+ grow: "",
1628
+ direction: "column",
1629
+ justify: "space-between",
1630
+ align: "center"
1631
+ }, {
1632
+ default: p(() => [
1633
+ z(e.$slots, "default"),
1634
+ no
1635
+ ]),
1636
+ _: 3
1637
+ })
1638
+ ]),
1639
+ _: 3
1640
+ }, 8, ["class"])), [
1641
+ [o(yt), {
1642
+ dirs: ["e"],
1643
+ disabled: t.collapsed,
1644
+ maxWidth: 500,
1645
+ minWidth: 200
1646
+ }]
1647
+ ]);
1648
+ }
1649
+ }), ao = /* @__PURE__ */ D({
1650
+ __name: "SwitchBar",
1651
+ props: {
1652
+ collasped: { type: Boolean, default: !1 },
1653
+ favorite: { type: Boolean, default: !1 },
1654
+ keyword: {}
1655
+ },
1656
+ emits: [
1657
+ "update:collasped",
1658
+ "update:keyword",
1659
+ "update:favorite"
1660
+ ],
1661
+ setup(a, { emit: t }) {
1662
+ const e = a, n = $(!1), s = $(""), l = $(!1), i = () => {
1663
+ n.value = !0;
1664
+ }, u = () => {
1665
+ s.value = "", n.value = !1, t("update:keyword", s.value);
1666
+ }, r = () => {
1667
+ t("update:collasped", !e.collasped);
1668
+ }, d = () => {
1669
+ t("update:keyword", s.value);
1670
+ }, f = () => {
1671
+ t("update:favorite", l.value);
1672
+ };
1673
+ return (h, x) => (c(), m(o(M), {
1674
+ class: "x-mask-switch-bar",
1675
+ justify: "space-between",
1676
+ align: "center"
1677
+ }, {
1678
+ default: p(() => [
1679
+ e.collasped ? v("", !0) : (c(), m(o(M), {
1680
+ key: 0,
1681
+ class: "x-mask-switch-bar__left",
1682
+ grow: ""
1683
+ }, {
1684
+ default: p(() => [
1685
+ n.value ? v("", !0) : (c(), m(o(tt), {
1686
+ key: 0,
1687
+ modelValue: l.value,
1688
+ "onUpdate:modelValue": x[0] || (x[0] = (V) => l.value = V),
1689
+ class: "x-mask-switch-bar__switch",
1690
+ "active-icon": o(at),
1691
+ "inactive-icon": o(ot),
1692
+ onChange: f
1693
+ }, null, 8, ["modelValue", "active-icon", "inactive-icon"])),
1694
+ n.value ? (c(), m(o(Ht), {
1695
+ key: 1,
1696
+ modelValue: s.value,
1697
+ "onUpdate:modelValue": x[1] || (x[1] = (V) => s.value = V),
1698
+ class: "x-mask-switch-bar__input",
1699
+ size: "small",
1700
+ placeholder: "请输入查询关键字",
1701
+ onInput: d,
1702
+ "prefix-icon": o(Be)
1703
+ }, {
1704
+ suffix: p(() => [
1705
+ b(o(oe), {
1706
+ icon: o(st),
1707
+ onClick: u
1708
+ }, null, 8, ["icon"])
1709
+ ]),
1710
+ _: 1
1711
+ }, 8, ["modelValue", "prefix-icon"])) : v("", !0)
1712
+ ]),
1713
+ _: 1
1714
+ })),
1715
+ b(o(M), {
1716
+ class: U(["x-mask-switch-bar__right", { "is-collasped": e.collasped }]),
1717
+ flex: "",
1718
+ align: "center",
1719
+ justify: "center"
1720
+ }, {
1721
+ default: p(() => [
1722
+ !n.value && !e.collasped ? (c(), m(o(W), {
1723
+ key: 0,
1724
+ icon: o(Be),
1725
+ mode: "icon",
1726
+ background: "hover",
1727
+ size: "default",
1728
+ circle: "",
1729
+ onClick: i
1730
+ }, null, 8, ["icon"])) : v("", !0),
1731
+ e.collasped ? (c(), m(o(W), {
1732
+ key: 1,
1733
+ icon: o(Kt),
1734
+ mode: "icon",
1735
+ size: "default",
1736
+ background: "hover",
1737
+ onClick: r,
1738
+ circle: ""
1739
+ }, null, 8, ["icon"])) : v("", !0),
1740
+ e.collasped ? v("", !0) : (c(), m(o(W), {
1741
+ key: 2,
1742
+ icon: o(Yt),
1743
+ mode: "icon",
1744
+ size: "default",
1745
+ background: "hover",
1746
+ circle: "",
1747
+ onClick: r
1748
+ }, null, 8, ["icon"]))
1749
+ ]),
1750
+ _: 1
1751
+ }, 8, ["class"])
1752
+ ]),
1753
+ _: 1
1754
+ }));
1755
+ }
1756
+ }), so = ["src"], lo = { key: 0 }, io = /* @__PURE__ */ D({
1757
+ __name: "Brand",
1758
+ props: {
1759
+ collapsed: { type: Boolean, default: !1 },
1760
+ logo: {},
1761
+ title: {},
1762
+ url: {}
1763
+ },
1764
+ setup(a) {
1765
+ const t = a, e = ke(), n = () => {
1766
+ t.url && e.push(t.url);
1767
+ };
1768
+ return (s, l) => (c(), m(o(M), {
1769
+ class: U(["x-mask-brand", { "is-collapsed": t.collapsed }]),
1770
+ align: "center"
1771
+ }, {
1772
+ default: p(() => [
1773
+ b(o(M), {
1774
+ class: "x-mask-brand__logo",
1775
+ flex: "",
1776
+ justify: "center",
1777
+ align: "center",
1778
+ onClick: n
1779
+ }, {
1780
+ default: p(() => [
1781
+ z(s.$slots, "logo", {}, () => [
1782
+ t.logo ? (c(), A("img", {
1783
+ key: 0,
1784
+ src: t.logo
1785
+ }, null, 8, so)) : v("", !0)
1786
+ ])
1787
+ ]),
1788
+ _: 3
1789
+ }),
1790
+ b(o(M), {
1791
+ class: "x-mask-brand__title",
1792
+ flex: "",
1793
+ align: "center"
1794
+ }, {
1795
+ default: p(() => [
1796
+ t.title ? (c(), A("span", lo, [
1797
+ z(s.$slots, "title", {}, () => [
1798
+ N(O(t.title), 1)
1799
+ ])
1800
+ ])) : v("", !0)
1801
+ ]),
1802
+ _: 3
1803
+ })
1804
+ ]),
1805
+ _: 3
1806
+ }, 8, ["class"]));
1807
+ }
1808
+ }), fe = "__favorites__", me = "__search__", ro = /* @__PURE__ */ D({
1809
+ __name: "Menu",
1810
+ props: {
1811
+ collapse: { type: Boolean, default: !1 },
1812
+ keyword: {},
1813
+ favorite: { type: Boolean },
1814
+ favorites: {},
1815
+ flatMenus: {},
1816
+ menus: {},
1817
+ active: {}
1818
+ },
1819
+ emits: ["select"],
1820
+ setup(a, { emit: t }) {
1821
+ const e = a, n = y(() => e.menus || []), s = y(() => String(e.active?.id)), l = y(() => [
1822
+ {
1823
+ id: fe,
1824
+ title: "收藏",
1825
+ icon: lt,
1826
+ children: e.favorites?.length ? e.favorites : [
1827
+ {
1828
+ id: fe + "empty",
1829
+ disabled: !0,
1830
+ title: "暂无收藏菜单"
1831
+ }
1832
+ ]
1833
+ }
1834
+ ]), i = y(() => {
1835
+ const r = (e.keyword || "").trim(), d = r ? (e.flatMenus || []).filter((f) => f.title?.includes(r)) : [];
1836
+ return [
1837
+ {
1838
+ id: me,
1839
+ title: "搜索",
1840
+ icon: Be,
1841
+ children: d?.length ? d : [
1842
+ {
1843
+ id: me + "empty",
1844
+ disabled: !0,
1845
+ title: "查询匹配不到菜单项"
1846
+ }
1847
+ ]
1848
+ }
1849
+ ];
1850
+ }), u = (r) => {
1851
+ t("select", r);
1852
+ };
1853
+ return (r, d) => (c(), A(q, null, [
1854
+ L(b(o(M), {
1855
+ class: "x-mask-menu",
1856
+ grow: "",
1857
+ flex: !1,
1858
+ overflow: "auto"
1859
+ }, {
1860
+ default: p(() => [
1861
+ L(b(o(G), {
1862
+ subMenu: {
1863
+ popperClass: "x-mask-menu-popper",
1864
+ teleported: !0,
1865
+ showTimeout: 200,
1866
+ hideTimeout: 200
1867
+ },
1868
+ data: n.value,
1869
+ "default-icon": o(se),
1870
+ collapse: !0,
1871
+ "collapse-transition": !1,
1872
+ "default-active": s.value,
1873
+ onSelect: u
1874
+ }, null, 8, ["data", "default-icon", "default-active"]), [
1875
+ [J, e.collapse]
1876
+ ]),
1877
+ L(b(o(G), {
1878
+ subMenu: {
1879
+ popperClass: "x-mask-menu-popper",
1880
+ teleported: !0
1881
+ },
1882
+ data: n.value,
1883
+ "default-icon": o(se),
1884
+ collapse: !1,
1885
+ "collapse-transition": !1,
1886
+ "default-active": s.value,
1887
+ onSelect: u
1888
+ }, null, 8, ["data", "default-icon", "default-active"]), [
1889
+ [J, !e.collapse]
1890
+ ]),
1891
+ n.value.length ? v("", !0) : (c(), m(o(Lt), {
1892
+ key: 0,
1893
+ description: "暂无菜单数据"
1894
+ }))
1895
+ ]),
1896
+ _: 1
1897
+ }, 512), [
1898
+ [J, !e.favorite && !e.keyword]
1899
+ ]),
1900
+ L(b(o(M), {
1901
+ class: "x-mask-menu",
1902
+ grow: "",
1903
+ flex: !1,
1904
+ overflow: "auto"
1905
+ }, {
1906
+ default: p(() => [
1907
+ L(b(o(G), {
1908
+ class: "x-mask-menu__favorites",
1909
+ subMenu: {
1910
+ popperClass: "x-mask-menu-popper",
1911
+ teleported: !0,
1912
+ showTimeout: 200,
1913
+ hideTimeout: 200
1914
+ },
1915
+ data: l.value,
1916
+ "default-icon": o(se),
1917
+ collapse: !0,
1918
+ "collapse-transition": !1,
1919
+ "default-active": s.value,
1920
+ "default-openeds": [fe],
1921
+ onSelect: u
1922
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1923
+ [J, e.collapse]
1924
+ ]),
1925
+ L(b(o(G), {
1926
+ class: "x-mask-menu__favorites",
1927
+ subMenu: {
1928
+ popperClass: "x-mask-menu-popper",
1929
+ teleported: !0,
1930
+ showTimeout: 200,
1931
+ hideTimeout: 200
1932
+ },
1933
+ data: l.value,
1934
+ "default-icon": o(se),
1935
+ collapse: !1,
1936
+ "collapse-transition": !1,
1937
+ "default-active": s.value,
1938
+ "default-openeds": [fe],
1939
+ onSelect: u
1940
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1941
+ [J, !e.collapse]
1942
+ ])
1943
+ ]),
1944
+ _: 1
1945
+ }, 512), [
1946
+ [J, e.favorite && !e.keyword]
1947
+ ]),
1948
+ e.keyword ? L((c(), m(o(M), {
1949
+ key: 0,
1950
+ class: "x-mask-menu",
1951
+ grow: "",
1952
+ flex: !1,
1953
+ overflow: "auto"
1954
+ }, {
1955
+ default: p(() => [
1956
+ L(b(o(G), {
1957
+ class: "x-mask-menu__search",
1958
+ subMenu: {
1959
+ popperClass: "x-mask-menu-popper",
1960
+ teleported: !0,
1961
+ showTimeout: 200,
1962
+ hideTimeout: 200
1963
+ },
1964
+ data: i.value,
1965
+ "default-icon": o(se),
1966
+ collapse: !0,
1967
+ "collapse-transition": !1,
1968
+ "default-active": s.value,
1969
+ "default-openeds": [me],
1970
+ onSelect: u
1971
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1972
+ [J, e.collapse]
1973
+ ]),
1974
+ L(b(o(G), {
1975
+ class: "x-mask-menu__search",
1976
+ subMenu: {
1977
+ popperClass: "x-mask-menu-popper",
1978
+ teleported: !0,
1979
+ showTimeout: 200,
1980
+ hideTimeout: 200
1981
+ },
1982
+ data: i.value,
1983
+ "default-icon": o(se),
1984
+ collapse: !1,
1985
+ "collapse-transition": !1,
1986
+ "default-active": s.value,
1987
+ "default-openeds": [me],
1988
+ onSelect: u
1989
+ }, null, 8, ["data", "default-icon", "default-active", "default-openeds"]), [
1990
+ [J, !e.collapse]
1991
+ ])
1992
+ ]),
1993
+ _: 1
1994
+ }, 512)), [
1995
+ [J, !!e.keyword]
1996
+ ]) : v("", !0)
1997
+ ], 64));
1998
+ }
1999
+ }), co = { class: "x-mask-tabs__trigger" }, uo = { key: 1 }, po = ["onDragstart", "onDragend"], fo = { key: 1 }, mo = /* @__PURE__ */ D({
2000
+ __name: "Tabs",
2001
+ props: {
2002
+ tabs: {},
2003
+ home: {},
2004
+ isActiveTab: { type: Function },
2005
+ value: {},
2006
+ favorites: {}
2007
+ },
2008
+ emits: ["click", "remove", "refresh", "toggleFavorite", "dialog"],
2009
+ setup(a, { emit: t }) {
2010
+ const e = a, n = (d) => {
2011
+ const f = !!e.favorites.find(
2012
+ (h) => h === d.menu || h.id === d.menu?.id
2013
+ );
2014
+ return [
2015
+ {
2016
+ icon: Gt,
2017
+ label: "刷新",
2018
+ name: "refresh",
2019
+ value: d
2020
+ },
2021
+ "|",
2022
+ {
2023
+ icon: f ? at : lt,
2024
+ label: "收藏",
2025
+ name: "favorite",
2026
+ value: d.menu,
2027
+ disabled: !d.menu
2028
+ },
2029
+ "|",
2030
+ {
2031
+ icon: qt,
2032
+ label: "弹窗",
2033
+ name: "dialog",
2034
+ value: d
2035
+ }
2036
+ ];
2037
+ }, s = (d) => {
2038
+ const f = d.paneName;
2039
+ if (f === e.home.id) {
2040
+ t("click", e.home);
2041
+ return;
2042
+ }
2043
+ const h = e.tabs.find((x) => x.id === f);
2044
+ h && t("click", h);
2045
+ }, l = (d) => {
2046
+ const f = e.tabs.find((h) => h.id === d);
2047
+ f && t("remove", f);
2048
+ }, i = (d) => {
2049
+ switch (d.name) {
2050
+ case "refresh":
2051
+ t("refresh", d.value);
2052
+ break;
2053
+ case "favorite":
2054
+ t("toggleFavorite", d.value);
2055
+ break;
2056
+ case "dialog":
2057
+ t("dialog", d.value);
2058
+ break;
2059
+ }
2060
+ }, u = (d, f) => {
2061
+ f.dataTransfer && (f.dataTransfer.setData("tab", d.id), f.target && f.target.classList.add("is-dagging"));
2062
+ }, r = (d, f) => {
2063
+ f.target && f.target.classList.remove("is-dagging");
2064
+ };
2065
+ return (d, f) => (c(), m(o(M), {
2066
+ ref: "tabsRef",
2067
+ class: "x-mask-tabs",
2068
+ height: "100%",
2069
+ grow: "",
2070
+ flex: "",
2071
+ justify: "flex-end",
2072
+ direction: "column"
2073
+ }, {
2074
+ default: p(() => [
2075
+ b(o(Wt), {
2076
+ type: "card",
2077
+ "model-value": e.value,
2078
+ onTabRemove: l,
2079
+ onTabClick: s
2080
+ }, {
2081
+ default: p(() => [
2082
+ e.home ? (c(), m(o(Ue), {
2083
+ key: 0,
2084
+ name: e.home.id
2085
+ }, {
2086
+ label: p(() => [
2087
+ R("div", co, [
2088
+ e.home.icon ? (c(), m(Y(o(be)(e.home.icon)), { key: 0 })) : v("", !0),
2089
+ e.home.title ? (c(), A("span", uo, O(e.home.title), 1)) : v("", !0)
2090
+ ])
2091
+ ]),
2092
+ _: 1
2093
+ }, 8, ["name"])) : v("", !0),
2094
+ (c(!0), A(q, null, we(e.tabs, (h) => (c(), m(o(Ue), {
2095
+ key: h.id,
2096
+ name: h.id,
2097
+ lazy: "",
2098
+ closable: ""
2099
+ }, {
2100
+ label: p(() => [
2101
+ b(o(nt), {
2102
+ "open-delay": 500,
2103
+ placement: "bottom",
2104
+ trigger: "hover",
2105
+ width: "200px",
2106
+ disabled: h.id !== e.value
2107
+ }, {
2108
+ reference: p(() => [
2109
+ R("div", {
2110
+ class: "x-mask-tabs__trigger",
2111
+ draggable: "true",
2112
+ onDragstart: (x) => u(h, x),
2113
+ onDragend: (x) => r(h, x)
2114
+ }, [
2115
+ h.icon ? (c(), m(Y(o(be)(h.icon)), { key: 0 })) : v("", !0),
2116
+ h.title ? (c(), A("span", fo, O(h.title), 1)) : v("", !0)
2117
+ ], 40, po)
2118
+ ]),
2119
+ default: p(() => [
2120
+ b(o(Re), {
2121
+ items: n(h),
2122
+ mode: "text",
2123
+ size: "small",
2124
+ type: "info",
2125
+ onClick: i
2126
+ }, null, 8, ["items"])
2127
+ ]),
2128
+ _: 2
2129
+ }, 1032, ["disabled"])
2130
+ ]),
2131
+ _: 2
2132
+ }, 1032, ["name"]))), 128))
2133
+ ]),
2134
+ _: 1
2135
+ }, 8, ["model-value"])
2136
+ ]),
2137
+ _: 1
2138
+ }, 512));
2139
+ }
2140
+ }), go = /* @__PURE__ */ D({
2141
+ __name: "ThemeSwitch",
2142
+ setup(a) {
2143
+ const t = fn();
2144
+ return (e, n) => (c(), m(o(tt), {
2145
+ class: "x-mask-theme-switch",
2146
+ modelValue: o(t),
2147
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => ge(t) ? t.value = s : null),
2148
+ size: "default",
2149
+ "active-action-icon": o(en),
2150
+ "inactive-action-icon": o(tn)
2151
+ }, null, 8, ["modelValue", "active-action-icon", "inactive-action-icon"]));
2152
+ }
2153
+ }), ho = { class: "x-mask-toolbar__menu-item" }, vo = /* @__PURE__ */ D({
2154
+ __name: "Toolbar",
2155
+ props: {
2156
+ tabs: { default: () => [] },
2157
+ actions: {},
2158
+ theme: { type: Boolean }
2159
+ },
2160
+ emits: [
2161
+ "closeOtherTabs",
2162
+ "closeAllTabs",
2163
+ "closeTab",
2164
+ "clickTab",
2165
+ "actionClick",
2166
+ "actionCommand"
2167
+ ],
2168
+ setup(a, { emit: t }) {
2169
+ const e = a, n = y(() => {
2170
+ const r = e.tabs.map((d, f) => ({
2171
+ divided: f === 0,
2172
+ label: d.title,
2173
+ command: d
2174
+ }));
2175
+ return [
2176
+ {
2177
+ label: "关闭其他",
2178
+ command: "other"
2179
+ },
2180
+ {
2181
+ label: "关闭全部",
2182
+ command: "all"
2183
+ },
2184
+ ...r
2185
+ ];
2186
+ }), s = (r) => {
2187
+ t("closeTab", r.command);
2188
+ }, l = (r) => {
2189
+ switch (r.command) {
2190
+ case "all":
2191
+ t("closeAllTabs");
2192
+ break;
2193
+ case "other":
2194
+ t("closeOtherTabs");
2195
+ break;
2196
+ default:
2197
+ t("clickTab", r.command);
2198
+ break;
2199
+ }
2200
+ }, i = (r) => {
2201
+ t("actionClick", r);
2202
+ }, u = (r, d) => {
2203
+ t("actionCommand", r, d);
2204
+ };
2205
+ return (r, d) => (c(), m(o(M), {
2206
+ class: "x-mask-toolbar",
2207
+ align: "center"
2208
+ }, {
2209
+ default: p(() => [
2210
+ b(o(W), {
2211
+ icon: o(nn),
2212
+ menus: n.value,
2213
+ dropdown: { size: "small" },
2214
+ mode: "icon",
2215
+ circle: "",
2216
+ background: "hover",
2217
+ onCommand: l
2218
+ }, {
2219
+ item: p(({ item: f }) => [
2220
+ R("span", ho, [
2221
+ N(O(f.label) + " ", 1),
2222
+ ["other", "all"].includes(f.command) ? v("", !0) : (c(), m(o(oe), {
2223
+ key: 0,
2224
+ onClick: Et((h) => s(f), ["stop"]),
2225
+ icon: o(st)
2226
+ }, null, 8, ["onClick", "icon"]))
2227
+ ])
2228
+ ]),
2229
+ _: 1
2230
+ }, 8, ["icon", "menus"]),
2231
+ b(o(ue), { direction: "vertical" }),
2232
+ e.actions ? (c(), m(o(Re), {
2233
+ key: 0,
2234
+ circle: "",
2235
+ mode: "icon",
2236
+ size: "default",
2237
+ background: "hover",
2238
+ items: r.actions,
2239
+ onClick: i,
2240
+ onCommand: u
2241
+ }, null, 8, ["items"])) : v("", !0),
2242
+ e.actions ? (c(), m(o(ue), {
2243
+ key: 1,
2244
+ direction: "vertical"
2245
+ })) : v("", !0),
2246
+ e.theme ? (c(), m(go, { key: 2 })) : v("", !0),
2247
+ e.theme ? (c(), m(o(ue), {
2248
+ key: 3,
2249
+ direction: "vertical"
2250
+ })) : v("", !0),
2251
+ z(r.$slots, "default")
2252
+ ]),
2253
+ _: 3
2254
+ }));
2255
+ }
2256
+ }), yo = /* @__PURE__ */ D({
2257
+ __name: "Avatar",
2258
+ props: {
2259
+ avatar: {}
2260
+ },
2261
+ setup(a) {
2262
+ const t = a;
2263
+ return (e, n) => (c(), m(o(nt), {
2264
+ width: 200,
2265
+ "popper-class": "x-mask-avatar__popper",
2266
+ disabled: !e.$slots.default
2267
+ }, {
2268
+ reference: p(() => [
2269
+ b(o(Qt), {
2270
+ class: "x-mask-avatar",
2271
+ shape: "circle",
2272
+ icon: o(on),
2273
+ src: t.avatar,
2274
+ size: 26
2275
+ }, null, 8, ["icon", "src"])
2276
+ ]),
2277
+ default: p(() => [
2278
+ e.$slots.default ? z(e.$slots, "default", { key: 0 }) : v("", !0)
2279
+ ]),
2280
+ _: 3
2281
+ }, 8, ["disabled"]));
2282
+ }
2283
+ }), Ze = /* @__PURE__ */ D({
2284
+ __name: "Content",
2285
+ props: {
2286
+ createView: { type: Function },
2287
+ exclude: {}
2288
+ },
2289
+ setup(a) {
2290
+ const t = a;
2291
+ return (e, n) => (c(), m(o(M), {
2292
+ class: "x-mask__content",
2293
+ flex: !1,
2294
+ grow: "",
2295
+ padding: ""
2296
+ }, {
2297
+ default: p(() => [
2298
+ z(e.$slots, "default"),
2299
+ b(o(it), null, {
2300
+ default: p(({ Component: s, route: l }) => [
2301
+ (c(), m(It, {
2302
+ exclude: t.exclude
2303
+ }, [
2304
+ s ? (c(), m(Y(t.createView(s, l)), {
2305
+ key: l.fullPath
2306
+ })) : v("", !0)
2307
+ ], 1032, ["exclude"]))
2308
+ ]),
2309
+ _: 1
2310
+ })
2311
+ ]),
2312
+ _: 3
2313
+ }));
2314
+ }
2315
+ }), bo = 140, _o = {
2316
+ /**
2317
+ * 系统logo
2318
+ */
2319
+ logo: {
2320
+ type: String,
2321
+ default: ft
2322
+ },
2323
+ /**
2324
+ * 系统标题
2325
+ */
2326
+ title: {
2327
+ type: String,
2328
+ default: "VTJ.PRO"
2329
+ },
2330
+ /**
2331
+ * 菜单项数据
2332
+ */
2333
+ menus: {
2334
+ type: [Array, Function],
2335
+ default() {
2336
+ return [];
2337
+ }
2338
+ },
2339
+ /**
2340
+ * 收藏菜单项
2341
+ */
2342
+ favorites: {
2343
+ type: [Array, Function],
2344
+ default() {
2345
+ return [];
2346
+ }
2347
+ },
2348
+ /**
2349
+ * 菜单项数据适配函数,用作转换菜单项数据
2350
+ */
2351
+ menuAdapter: {
2352
+ type: Function
2353
+ },
2354
+ /**
2355
+ * 主页Tab配置
2356
+ */
2357
+ home: {
2358
+ type: [String, Object],
2359
+ default: "/"
2360
+ },
2361
+ /**
2362
+ * 最大tabs数量
2363
+ */
2364
+ tabs: {
2365
+ type: Number,
2366
+ default: 20
2367
+ },
2368
+ /**
2369
+ * 右上角工具条配置
2370
+ */
2371
+ actions: {
2372
+ type: Array
2373
+ },
2374
+ /**
2375
+ * 用户头像图片url
2376
+ */
2377
+ avatar: {
2378
+ type: String
2379
+ },
2380
+ /**
2381
+ * 开启主题切换
2382
+ */
2383
+ theme: {
2384
+ type: Boolean
2385
+ },
2386
+ /**
2387
+ * 禁用框架容器
2388
+ */
2389
+ disabled: {
2390
+ type: Boolean
2391
+ },
2392
+ addFavorite: {
2393
+ type: Function
2394
+ },
2395
+ removeFavorite: {
2396
+ type: Function
2397
+ }
2398
+ }, _t = Symbol(), wt = Symbol();
2399
+ function wo(a) {
2400
+ const t = $(!1), e = $(""), n = $(!1);
2401
+ return {
2402
+ collapsed: t,
2403
+ keyword: e,
2404
+ favorite: n
2405
+ };
317
2406
  }
318
- function Ve(e, t = {}) {
319
- const n = {
320
- edge: 5,
321
- minWidth: 50,
322
- minHeight: 50,
323
- dirs: ["n", "s", "w", "e"],
324
- ...t
325
- }, s = U(), r = L(""), l = L(!1), { onStart: o, onEnd: u, boundingOptions: i } = n, a = P(e, i), { left: p, top: c, width: d, height: h, update: I } = a;
326
- return s.run(() => {
327
- C(document, "mousemove", (v) => {
328
- l.value ? ke(n, v, r.value, a) : r.value = Ee(n, v, a);
329
- }), C(document, "mousedown", () => {
330
- I(), r.value && (l.value = !0, o && o(a));
331
- }), C(document, "mouseup", () => {
332
- l.value = !1, r.value = "", u && u(a), I();
333
- }), z(r, (v) => {
334
- const $ = document.body;
335
- $.style.cursor = v ? `${v}-resize` : "", v ? $.classList.add(j) : $.classList.remove(j);
2407
+ function ko(a) {
2408
+ const t = dt();
2409
+ return y(() => {
2410
+ const e = a.home;
2411
+ return Object.assign(
2412
+ { id: t, url: "/", name: "MaskHome", icon: an, closable: !1 },
2413
+ typeof e == "string" ? { url: e } : e || {}
2414
+ );
2415
+ });
2416
+ }
2417
+ function kt(a, t) {
2418
+ let e = [];
2419
+ return a.forEach((n) => {
2420
+ n = t ? t(n) : n, n.children ? e = e.concat(kt(n.children, t)) : e.push(n);
2421
+ }), e;
2422
+ }
2423
+ function xo(a, t) {
2424
+ const e = ke(), n = Oe([]), s = Oe([]), l = y(() => kt(n.value, a.menuAdapter)), i = y(() => mn(l.value, "id")), u = $(null), r = (k) => {
2425
+ const _ = typeof k == "object" ? k.id : k, E = i.value.get(_);
2426
+ if (!E) {
2427
+ console.warn("找不到菜单", k);
2428
+ return;
2429
+ }
2430
+ const { type: B = "route", url: g, title: I, icon: C } = E;
2431
+ if (!g) {
2432
+ u.value = E, t("select", E);
2433
+ return;
2434
+ }
2435
+ if (B === "route") {
2436
+ gn(g) || g.startsWith("//") ? window.open(g) : (u.value = E, e.push(g).catch((F) => F));
2437
+ return;
2438
+ }
2439
+ if (B === "window") {
2440
+ window.open(g);
2441
+ return;
2442
+ }
2443
+ B === "dialog" && $e({
2444
+ resizable: !0,
2445
+ bodyPadding: !1,
2446
+ width: "80%",
2447
+ height: "80%",
2448
+ title: I,
2449
+ icon: C,
2450
+ src: g
336
2451
  });
337
- }), Z(() => {
338
- s.stop();
339
- }), {
340
- left: p,
341
- top: c,
342
- width: d,
343
- height: h,
344
- direction: r,
345
- resizing: l,
346
- update: I
2452
+ }, d = async () => {
2453
+ n.value = typeof a.menus == "function" ? await a.menus() || [] : a.menus ?? [], s.value = typeof a.favorites == "function" ? await a.favorites() || [] : a.favorites ?? [];
2454
+ }, f = (k) => {
2455
+ s.value = [k, ...s.value], a.addFavorite && a.addFavorite(k);
2456
+ }, h = (k) => {
2457
+ s.value = s.value.filter((_) => _.id !== k.id), a.removeFavorite && a.removeFavorite(k);
2458
+ }, x = (k) => !!s.value.find((_) => _ === k || _.id === k.id), V = (k) => {
2459
+ x(k) ? h(k) : f(k);
2460
+ };
2461
+ return Ge(d), {
2462
+ menus: n,
2463
+ favorites: s,
2464
+ flatMenus: l,
2465
+ active: u,
2466
+ select: r,
2467
+ toggleFavorite: V
2468
+ };
2469
+ }
2470
+ function zo(a, t, e, n, s) {
2471
+ const l = Ve(), i = ke(), u = {}, r = $([]), d = $(), { width: f } = rt(d), h = y(() => Math.floor(f.value / bo)), x = y(
2472
+ () => r.value.slice(0, h.value).filter((w) => !w.dialog)
2473
+ ), V = y(() => r.value.slice(h.value)), k = (w) => e.value.find((S) => S.url === w), _ = (w) => l.fullPath === w.url, E = (w) => s.value.id === w ? s.value : r.value.find((S) => S.id === w), B = $(""), g = y(() => E(B.value)), I = (w) => {
2474
+ i.push(w.url).catch((S) => S);
2475
+ }, C = (w) => {
2476
+ B.value = w.id, l.fullPath !== w.url && I(w);
2477
+ }, F = () => {
2478
+ I(s.value);
2479
+ }, X = (w) => {
2480
+ const S = r.value.find((T) => T.url === w.url || T.id === w.id);
2481
+ S ? C(S) : (r.value.unshift(w), C(w));
2482
+ }, ee = async (w) => {
2483
+ const { url: S = l.fullPath, icon: T, title: ze = "新建标签页" } = w || {}, de = u[S], Se = dt(), Ce = pt(S);
2484
+ return {
2485
+ id: Se,
2486
+ name: Ce,
2487
+ url: S,
2488
+ icon: T,
2489
+ title: ze,
2490
+ closable: !0,
2491
+ menu: w,
2492
+ ...de ? await de() : {}
2493
+ };
2494
+ }, te = async (w) => {
2495
+ if (await Te.confirm("是否关闭页签", "提示", {
2496
+ type: "warning"
2497
+ }).catch((T) => !1)) {
2498
+ if (r.value = r.value.filter((T) => T.id !== w.id), B.value === w.id) {
2499
+ const T = r.value[0];
2500
+ I(T || s.value);
2501
+ }
2502
+ return w;
2503
+ }
2504
+ }, j = (w) => {
2505
+ const S = r.value.findIndex((T) => T.id === w.id);
2506
+ if (S >= 0) {
2507
+ const T = r.value[S];
2508
+ r.value.splice(S, 1, Object.assign(T, w));
2509
+ }
2510
+ }, H = async () => {
2511
+ if (!await Te.confirm("是否关闭全部页签", "提示", {
2512
+ type: "warning"
2513
+ }).catch((T) => !1))
2514
+ return;
2515
+ const S = r.value;
2516
+ return r.value = [], C(s.value), S;
2517
+ }, ae = async () => {
2518
+ if (!await Te.confirm("是否关闭其他页签", "提示", {
2519
+ type: "warning"
2520
+ }).catch((T) => !1))
2521
+ return;
2522
+ const S = r.value.filter((T) => T.id !== B.value);
2523
+ return r.value = r.value.filter((T) => T.id === B.value), S;
2524
+ }, xe = (w) => {
2525
+ const S = r.value.filter((T) => T.id !== w.id);
2526
+ r.value = [w, ...S], C(w);
2527
+ }, re = async () => {
2528
+ await le();
2529
+ const w = s.value.url === l.fullPath, S = k(l.fullPath);
2530
+ if (w)
2531
+ B.value = s.value.id;
2532
+ else {
2533
+ const T = await ee(S);
2534
+ X(T);
2535
+ }
2536
+ await le(), n.value = S || null;
2537
+ };
2538
+ return ne(e, re), ne(l, re, { immediate: !0 }), De(_t, u), {
2539
+ tabRef: d,
2540
+ tabs: r,
2541
+ showTabs: x,
2542
+ currentTab: g,
2543
+ changeTab: I,
2544
+ removeTab: te,
2545
+ updateTab: j,
2546
+ addTab: X,
2547
+ home: s,
2548
+ tabValue: B,
2549
+ isCurrentTab: _,
2550
+ activeHome: F,
2551
+ activeTab: C,
2552
+ dropdownTabs: V,
2553
+ removeAllTabs: H,
2554
+ removeOtherTabs: ae,
2555
+ moveToShow: xe
2556
+ };
2557
+ }
2558
+ function So(a) {
2559
+ const t = /* @__PURE__ */ new Map(), e = $([]), n = Ye({}), s = {}, { updateTab: l, isCurrentTab: i, activeHome: u, tabs: r } = a, d = (g, I) => {
2560
+ const C = I.fullPath;
2561
+ if (t.has(C))
2562
+ return t.get(C);
2563
+ {
2564
+ const F = pt(C), X = {
2565
+ name: F,
2566
+ setup() {
2567
+ const ee = y(() => n[C] || document.body), te = y(() => !n[C]), j = y(() => !e.value.includes(F));
2568
+ return De(
2569
+ sn,
2570
+ Bt({ ...I })
2571
+ ), () => j.value ? K(
2572
+ qe,
2573
+ {
2574
+ to: ee.value,
2575
+ disabled: te.value
2576
+ },
2577
+ [K(g)]
2578
+ ) : null;
2579
+ }
2580
+ };
2581
+ return t.set(C, X), X;
2582
+ }
2583
+ }, f = (g) => {
2584
+ g.dialog = void 0, delete n[g.url];
2585
+ const I = s[g.id];
2586
+ I && (I.destroy(), delete s[g.id], l(g));
2587
+ }, h = (g = []) => {
2588
+ g.forEach((I) => {
2589
+ f(I);
2590
+ });
2591
+ }, x = async (g) => {
2592
+ g.dialog = {
2593
+ ...g.dialog,
2594
+ onMinimized: () => {
2595
+ f(g);
2596
+ },
2597
+ onClose: async () => {
2598
+ f(g), r.value = r.value.filter((C) => C.id !== g.id);
2599
+ }
2600
+ }, l(g);
2601
+ const I = $e({
2602
+ title: g.title,
2603
+ icon: g.icon,
2604
+ modal: !1,
2605
+ resizable: !0,
2606
+ draggable: !0,
2607
+ ...g.dialog,
2608
+ onOpen(C) {
2609
+ n[g.url] = C.refs.panelRef?.bodyRef?.$el;
2610
+ }
2611
+ });
2612
+ return await le(), i(g) && u(), s[g.id] = I, I;
2613
+ }, V = async (g) => {
2614
+ e.value = [g.name], await le(), e.value = [];
2615
+ }, k = async (g) => {
2616
+ e.value = g.map((I) => I.name), await le(), e.value = [];
2617
+ }, _ = (g) => (g.preventDefault(), !1), E = (g) => {
2618
+ if (g.dataTransfer) {
2619
+ const I = g.dataTransfer.getData("tab"), C = r.value.find((F) => F.id === I);
2620
+ if (C) {
2621
+ const { clientX: F, clientY: X } = g;
2622
+ C.dialog = {
2623
+ left: F,
2624
+ top: X
2625
+ }, x(C);
2626
+ }
2627
+ }
2628
+ }, B = (g) => !!n[g];
2629
+ return ye(document, "dragover", _), ye(document, "drop", E), {
2630
+ createView: d,
2631
+ openDialog: x,
2632
+ refresh: V,
2633
+ exclude: e,
2634
+ cleanCache: k,
2635
+ hasDialog: B,
2636
+ closeDialog: f,
2637
+ closeDialogs: h
2638
+ };
2639
+ }
2640
+ const Co = /* @__PURE__ */ D({
2641
+ name: "XMask",
2642
+ __name: "Mask",
2643
+ props: _o,
2644
+ emits: ["select", "actionClick", "actionCommand"],
2645
+ setup(a, { emit: t }) {
2646
+ const e = a, n = ko(e), { collapsed: s, keyword: l, favorite: i } = wo(), { menus: u, favorites: r, flatMenus: d, active: f, select: h, toggleFavorite: x } = xo(e, t), {
2647
+ tabRef: V,
2648
+ showTabs: k,
2649
+ currentTab: _,
2650
+ changeTab: E,
2651
+ removeTab: B,
2652
+ tabs: g,
2653
+ updateTab: I,
2654
+ isCurrentTab: C,
2655
+ activeHome: F,
2656
+ removeAllTabs: X,
2657
+ removeOtherTabs: ee,
2658
+ dropdownTabs: te,
2659
+ moveToShow: j
2660
+ } = zo(e, t, d, f, n), { createView: H, openDialog: ae, refresh: xe, exclude: re, cleanCache: w, closeDialogs: S } = So({
2661
+ tabs: g,
2662
+ updateTab: I,
2663
+ isCurrentTab: C,
2664
+ activeHome: F
2665
+ }), T = async (P) => {
2666
+ await B(P) && await w([P]);
2667
+ }, ze = async () => {
2668
+ const P = await X();
2669
+ P && (S(P), await w(P));
2670
+ }, de = async () => {
2671
+ const P = await ee();
2672
+ P && (S(P), await w(P));
2673
+ }, Se = (P) => {
2674
+ t("actionClick", P);
2675
+ }, Ce = (P, Z) => {
2676
+ t("actionCommand", P, Z);
2677
+ };
2678
+ return De(wt, {
2679
+ tabs: g,
2680
+ flatMenus: d,
2681
+ favorites: r,
2682
+ updateTab: I,
2683
+ active: f,
2684
+ currentTab: _
2685
+ }), (P, Z) => (c(), m(o(M), { class: "x-mask" }, {
2686
+ default: p(() => [
2687
+ e.disabled ? (c(), m(Ze, {
2688
+ key: 1,
2689
+ createView: o(H),
2690
+ exclude: o(re)
2691
+ }, {
2692
+ default: p(() => [
2693
+ P.$slots.default ? z(P.$slots, "default", { key: 0 }) : v("", !0)
2694
+ ]),
2695
+ _: 3
2696
+ }, 8, ["createView", "exclude"])) : (c(), A(q, { key: 0 }, [
2697
+ b(oo, { collapsed: o(s) }, {
2698
+ brand: p(() => [
2699
+ b(io, {
2700
+ logo: e.logo,
2701
+ title: e.title,
2702
+ url: o(n).url,
2703
+ collapsed: o(s)
2704
+ }, null, 8, ["logo", "title", "url", "collapsed"])
2705
+ ]),
2706
+ default: p(() => [
2707
+ b(ao, {
2708
+ collasped: o(s),
2709
+ "onUpdate:collasped": Z[0] || (Z[0] = (ce) => ge(s) ? s.value = ce : null),
2710
+ favorite: o(i),
2711
+ "onUpdate:favorite": Z[1] || (Z[1] = (ce) => ge(i) ? i.value = ce : null),
2712
+ keyword: o(l),
2713
+ "onUpdate:keyword": Z[2] || (Z[2] = (ce) => ge(l) ? l.value = ce : null)
2714
+ }, null, 8, ["collasped", "favorite", "keyword"]),
2715
+ b(ro, {
2716
+ collapse: o(s),
2717
+ keyword: o(l),
2718
+ favorite: o(i),
2719
+ favorites: o(r),
2720
+ flatMenus: o(d),
2721
+ menus: o(u),
2722
+ active: o(f),
2723
+ onSelect: o(h)
2724
+ }, null, 8, ["collapse", "keyword", "favorite", "favorites", "flatMenus", "menus", "active", "onSelect"])
2725
+ ]),
2726
+ _: 1
2727
+ }, 8, ["collapsed"]),
2728
+ b(o(M), {
2729
+ class: "x-mask__main",
2730
+ grow: "",
2731
+ flex: "",
2732
+ direction: "column"
2733
+ }, {
2734
+ default: p(() => [
2735
+ b(o(M), {
2736
+ class: "x-mask-topbar",
2737
+ justify: "space-between",
2738
+ align: "center"
2739
+ }, {
2740
+ default: p(() => [
2741
+ b(mo, {
2742
+ ref_key: "tabRef",
2743
+ ref: V,
2744
+ favorites: o(r),
2745
+ tabs: o(k),
2746
+ home: o(n),
2747
+ value: o(_)?.id,
2748
+ onClick: o(E),
2749
+ onToggleFavorite: o(x),
2750
+ onRemove: T,
2751
+ onDialog: o(ae),
2752
+ onRefresh: o(xe)
2753
+ }, null, 8, ["favorites", "tabs", "home", "value", "onClick", "onToggleFavorite", "onDialog", "onRefresh"]),
2754
+ b(vo, {
2755
+ tabs: o(te),
2756
+ actions: e.actions,
2757
+ theme: e.theme,
2758
+ onCloseOtherTabs: de,
2759
+ onCloseAllTabs: ze,
2760
+ onCloseTab: T,
2761
+ onClickTab: o(j),
2762
+ onActionClick: Se,
2763
+ onActionCommand: Ce
2764
+ }, {
2765
+ default: p(() => [
2766
+ b(yo, {
2767
+ avatar: e.avatar
2768
+ }, et({ _: 2 }, [
2769
+ P.$slots.user ? {
2770
+ name: "default",
2771
+ fn: p(() => [
2772
+ z(P.$slots, "user")
2773
+ ]),
2774
+ key: "0"
2775
+ } : void 0
2776
+ ]), 1032, ["avatar"])
2777
+ ]),
2778
+ _: 3
2779
+ }, 8, ["tabs", "actions", "theme", "onClickTab"])
2780
+ ]),
2781
+ _: 3
2782
+ }),
2783
+ b(Ze, {
2784
+ createView: o(H),
2785
+ exclude: o(re)
2786
+ }, {
2787
+ default: p(() => [
2788
+ P.$slots.default ? z(P.$slots, "default", { key: 0 }) : v("", !0)
2789
+ ]),
2790
+ _: 3
2791
+ }, 8, ["createView", "exclude"])
2792
+ ]),
2793
+ _: 3
2794
+ })
2795
+ ], 64))
2796
+ ]),
2797
+ _: 3
2798
+ }));
2799
+ }
2800
+ });
2801
+ function Oo(a = {}) {
2802
+ const t = Ve(), e = je(_t, null), n = je(wt, null);
2803
+ if (e) {
2804
+ const l = typeof a == "function" ? a : async () => a;
2805
+ e[t.fullPath] = l;
2806
+ }
2807
+ return {
2808
+ tab: y(() => n ? n.tabs.value.find((l) => l.url === t.fullPath) : null),
2809
+ mask: n
347
2810
  };
348
2811
  }
349
- const Me = fe(we), Te = Me.install;
2812
+ const To = [
2813
+ xn,
2814
+ oe,
2815
+ G,
2816
+ Vn,
2817
+ W,
2818
+ Re,
2819
+ M,
2820
+ ht,
2821
+ vt,
2822
+ bt,
2823
+ Co
2824
+ ], jo = "0.6.0", Mo = hn(To), No = Mo.install;
350
2825
  export {
351
- B as INSTALLED_KEY,
352
- X as IS_DRAGGING_CLASS_NAME,
353
- j as IS_RESIZING_CLASS_NAME,
354
- de as NOOP,
355
- k as XIcon,
356
- T as XMenu,
357
- be as XSimpleMask,
358
- _e as XStartup,
359
- we as components,
360
- De as getSizeValue,
361
- ge as iconProps,
362
- he as iconSizeMap,
363
- Te as install,
364
- fe as makeInstaller,
365
- pe as omit,
366
- Le as parseSize,
367
- Ae as pick,
368
- Pe as useDraggable,
369
- Re as useIcon,
370
- Ie as useIconProps,
371
- Ve as useResizable,
372
- Be as withInstall,
373
- je as withInstallDirective,
374
- Xe as withInstallFunction,
375
- Oe as withNoopInstall
2826
+ We as Draggable,
2827
+ He as INSTALLED_KEY,
2828
+ wt as MASK_KEY,
2829
+ Fo as NOOP,
2830
+ Qe as Resizable,
2831
+ _t as TAB_CREATORS_KEY,
2832
+ bo as TAB_ITEM_WIDTH,
2833
+ W as XAction,
2834
+ Re as XActionBar,
2835
+ M as XContainer,
2836
+ bt as XDialog,
2837
+ ht as XHeader,
2838
+ oe as XIcon,
2839
+ Co as XMask,
2840
+ G as XMenu,
2841
+ vt as XPanel,
2842
+ Vn as XSimpleMask,
2843
+ xn as XStartup,
2844
+ Nn as actionBarProps,
2845
+ gt as actionProps,
2846
+ To as components,
2847
+ Un as containerProps,
2848
+ $e as createDialog,
2849
+ No as default,
2850
+ Oo as defineTab,
2851
+ Zn as dialogProps,
2852
+ Xe as getSizeValue,
2853
+ Xn as headerProps,
2854
+ Sn as iconProps,
2855
+ zn as iconSizeMap,
2856
+ No as install,
2857
+ hn as makeInstaller,
2858
+ _o as maskProps,
2859
+ Ro as omit,
2860
+ Wn as panelProps,
2861
+ pe as parseSize,
2862
+ $o as pick,
2863
+ Pe as useDisabled,
2864
+ be as useIcon,
2865
+ Fn as useIconProps,
2866
+ Qn as vDraggable,
2867
+ yt as vResizable,
2868
+ jo as version
376
2869
  };