@xiaou66/u-web-ui 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,55 +1,64 @@
1
- import { Aside as e, Avatar as t, Button as n, Content as r, Divider as i, HeadMenu as a, Header as o, Icon as s, Layout as c, Menu as l, MenuItem as u, Submenu as d } from "tdesign-vue-next";
2
- import { Fragment as f, Teleport as p, computed as m, createBlock as h, createCommentVNode as g, createElementBlock as _, createElementVNode as v, createSlots as y, createTextVNode as b, createVNode as x, defineComponent as S, getCurrentInstance as C, getCurrentScope as w, inject as T, mergeModels as E, mergeProps as D, nextTick as O, normalizeClass as k, normalizeStyle as A, onMounted as j, onScopeDispose as M, onUnmounted as N, openBlock as P, provide as F, reactive as I, ref as L, renderList as R, renderSlot as z, resolveComponent as B, resolveDynamicComponent as ee, toDisplayString as V, toHandlers as H, toRefs as U, toValue as W, unref as G, useAttrs as K, useModel as te, useTemplateRef as ne, watch as re, withCtx as q, withModifiers as J } from "vue";
3
- import { useRoute as ie, useRouter as ae } from "vue-router";
4
- const oe = "u-web";
5
- function Y(...e) {
6
- return oe + "-" + e.join("-");
7
- }
1
+ import { Aside as e, Avatar as t, Button as n, Content as r, Divider as i, HeadMenu as a, Header as o, Icon as s, Layout as c, Menu as l, MenuItem as u, Submenu as d, Switch as f } from "tdesign-vue-next";
2
+ import { Fragment as p, Teleport as m, computed as h, createBlock as g, createCommentVNode as _, createElementBlock as v, createElementVNode as y, createSlots as b, createTextVNode as x, createVNode as S, defineComponent as C, getCurrentInstance as w, getCurrentScope as T, inject as E, mergeModels as D, mergeProps as O, nextTick as k, normalizeClass as A, normalizeStyle as j, onMounted as M, onScopeDispose as N, onUnmounted as P, openBlock as F, provide as I, reactive as L, ref as R, renderList as z, renderSlot as B, resolveComponent as V, resolveDynamicComponent as ee, toDisplayString as H, toHandlers as U, toRefs as W, toValue as G, unref as K, useAttrs as te, useModel as q, useSlots as ne, useTemplateRef as re, watch as ie, withCtx as J, withModifiers as Y } from "vue";
3
+ import { useRoute as ae, useRouter as oe } from "vue-router";
4
+ const se = "u-web";
8
5
  function X(...e) {
6
+ return se + "-" + e.join("-");
7
+ }
8
+ function Z(...e) {
9
9
  let t = e.join("-");
10
- return (...e) => Y(t, ...e);
10
+ return (...e) => X(t, ...e);
11
11
  }
12
- function se(e) {
12
+ function ce(e) {
13
13
  return e.substring(0, 1).toUpperCase() + e.substring(1);
14
14
  }
15
- const Z = "on", ce = [
15
+ const Q = "on", le = [
16
16
  "Capture",
17
17
  "Passive",
18
18
  "Once"
19
- ], le = /* @__PURE__ */ RegExp(`^(${ce.join("|")})*$`);
20
- function ue(...e) {
19
+ ], ue = /* @__PURE__ */ RegExp(`^(${le.join("|")})*$`);
20
+ function de(...e) {
21
21
  if (!e.length) return !1;
22
- let t = C();
22
+ let t = w();
23
23
  if (!t) return !1;
24
24
  let { attrs: n = {}, vnode: r } = t;
25
25
  if (!r) return !1;
26
- let i = r.props || {}, a = [...Object.keys(n).filter((e) => e.startsWith(Z)), ...Object.keys(i).filter((e) => e.startsWith(Z))];
26
+ let i = r.props || {}, a = [...Object.keys(n).filter((e) => e.startsWith(Q)), ...Object.keys(i).filter((e) => e.startsWith(Q))];
27
27
  for (let t of e) {
28
- let e = t.startsWith(Z) ? t : `${Z}${se(t)}`;
28
+ let e = t.startsWith(Q) ? t : `${Q}${ce(t)}`;
29
29
  if (a.includes(e)) return !0;
30
30
  for (let t of a) if (t.startsWith(e)) {
31
31
  let n = t.slice(e.length);
32
- if (n && le.test(n)) return !0;
32
+ if (n && ue.test(n)) return !0;
33
33
  }
34
34
  }
35
35
  return !1;
36
36
  }
37
- var de = /* @__PURE__ */ S({
37
+ function fe(e) {
38
+ return typeof e == "function";
39
+ }
40
+ function pe(e) {
41
+ return e === null;
42
+ }
43
+ function me(e) {
44
+ return e === void 0;
45
+ }
46
+ var he = /* @__PURE__ */ C({
38
47
  __name: "WebBaseLayout",
39
48
  setup(t) {
40
49
  return (t, n) => {
41
50
  let i = o, a = e, s = r, l = c;
42
- return P(), h(l, { class: "h-screen" }, {
43
- default: q(() => [t.$slots.header ? (P(), h(i, { key: 0 }, {
44
- default: q(() => [z(t.$slots, "header")]),
51
+ return F(), g(l, { class: "h-screen" }, {
52
+ default: J(() => [t.$slots.header ? (F(), g(i, { key: 0 }, {
53
+ default: J(() => [B(t.$slots, "header")]),
45
54
  _: 3
46
- })) : g("", !0), x(l, { class: "min-h-0" }, {
47
- default: q(() => [x(a, { width: "auto" }, {
48
- default: q(() => [z(t.$slots, "left")]),
55
+ })) : _("", !0), S(l, { class: "min-h-0" }, {
56
+ default: J(() => [S(a, { width: "auto" }, {
57
+ default: J(() => [B(t.$slots, "left")]),
49
58
  _: 3
50
- }), x(l, { class: k(["min-h-0", [G(Y)("main-content")]]) }, {
51
- default: q(() => [x(s, { class: "xl:p-4 ut:p-2 p-1 h-full overflow-hidden" }, {
52
- default: q(() => [z(t.$slots, "default")]),
59
+ }), S(l, { class: A(["min-h-0", [K(X)("main-content")]]) }, {
60
+ default: J(() => [S(s, { class: "xl:p-4 ut:p-2 p-1 h-full overflow-hidden" }, {
61
+ default: J(() => [B(t.$slots, "default")]),
53
62
  _: 3
54
63
  })]),
55
64
  _: 3
@@ -60,73 +69,73 @@ var de = /* @__PURE__ */ S({
60
69
  });
61
70
  };
62
71
  }
63
- }), fe = de;
64
- let Q = /* @__PURE__ */ function(e) {
72
+ }), ge = he;
73
+ let _e = /* @__PURE__ */ function(e) {
65
74
  return e.Refresh = "u:leftMenu:refresh", e;
66
75
  }({});
67
- const pe = { refresh: () => {
68
- window.dispatchEvent(new CustomEvent(Q.Refresh));
76
+ const ve = { refresh: () => {
77
+ window.dispatchEvent(new CustomEvent(_e.Refresh));
69
78
  } };
70
- function me(e) {
71
- return w() ? (M(e), !0) : !1;
79
+ function ye(e) {
80
+ return T() ? (N(e), !0) : !1;
72
81
  }
73
82
  const $ = typeof window < "u" && typeof document < "u";
74
83
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
75
- const he = Object.prototype.toString, ge = (e) => he.call(e) === "[object Object]";
76
- function _e(e) {
84
+ const be = Object.prototype.toString, xe = (e) => be.call(e) === "[object Object]";
85
+ function Se(e) {
77
86
  return Array.isArray(e) ? e : [e];
78
87
  }
79
- function ve(e) {
88
+ function Ce(e) {
80
89
  let t = /* @__PURE__ */ Object.create(null);
81
90
  return (n) => {
82
91
  let r = t[n];
83
92
  return r || (t[n] = e(n));
84
93
  };
85
94
  }
86
- const ye = /\B([A-Z])/g;
87
- ve((e) => e.replace(ye, "-$1").toLowerCase());
88
- const be = /-(\w)/g;
89
- ve((e) => e.replace(be, (e, t) => t ? t.toUpperCase() : ""));
90
- function xe(e, t, n) {
91
- return re(e, t, {
95
+ const we = /\B([A-Z])/g;
96
+ Ce((e) => e.replace(we, "-$1").toLowerCase());
97
+ const Te = /-(\w)/g;
98
+ Ce((e) => e.replace(Te, (e, t) => t ? t.toUpperCase() : ""));
99
+ function Ee(e, t, n) {
100
+ return ie(e, t, {
92
101
  ...n,
93
102
  immediate: !0
94
103
  });
95
104
  }
96
- const Se = $ ? window : void 0;
105
+ const De = $ ? window : void 0;
97
106
  $ && window.document, $ && window.navigator, $ && window.location;
98
- function Ce(e) {
107
+ function Oe(e) {
99
108
  var t;
100
- let n = W(e);
109
+ let n = G(e);
101
110
  return (t = n?.$el) ?? n;
102
111
  }
103
- function we(...e) {
112
+ function ke(...e) {
104
113
  let t = [], n = () => {
105
114
  t.forEach((e) => e()), t.length = 0;
106
- }, r = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), i = m(() => {
107
- let t = _e(W(e[0])).filter((e) => e != null);
115
+ }, r = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), i = h(() => {
116
+ let t = Se(G(e[0])).filter((e) => e != null);
108
117
  return t.every((e) => typeof e != "string") ? t : void 0;
109
- }), a = xe(() => {
118
+ }), a = Ee(() => {
110
119
  var t, n;
111
120
  return [
112
- (n = (t = i.value)?.map((e) => Ce(e))) ?? [Se].filter((e) => e != null),
113
- _e(W(i.value ? e[1] : e[0])),
114
- _e(G(i.value ? e[2] : e[1])),
115
- W(i.value ? e[3] : e[2])
121
+ (n = (t = i.value)?.map((e) => Oe(e))) ?? [De].filter((e) => e != null),
122
+ Se(G(i.value ? e[1] : e[0])),
123
+ Se(K(i.value ? e[2] : e[1])),
124
+ G(i.value ? e[3] : e[2])
116
125
  ];
117
126
  }, ([e, i, a, o]) => {
118
127
  if (n(), !e?.length || !i?.length || !a?.length) return;
119
- let s = ge(o) ? { ...o } : o;
128
+ let s = xe(o) ? { ...o } : o;
120
129
  t.push(...e.flatMap((e) => i.flatMap((t) => a.map((n) => r(e, t, n, s)))));
121
130
  }, { flush: "post" }), o = () => {
122
131
  a(), n();
123
132
  };
124
- return me(n), o;
133
+ return ye(n), o;
125
134
  }
126
135
  Symbol("vueuse-ssr-width");
127
- var Te = /* @__PURE__ */ S({
136
+ var Ae = /* @__PURE__ */ C({
128
137
  __name: "LeftMenu",
129
- props: /* @__PURE__ */ E({
138
+ props: /* @__PURE__ */ D({
130
139
  hideOperations: {
131
140
  type: Boolean,
132
141
  default: !1
@@ -145,82 +154,82 @@ var Te = /* @__PURE__ */ S({
145
154
  }),
146
155
  emits: ["update:collapsed"],
147
156
  setup(e, { expose: t }) {
148
- let r = e, i = te(e, "collapsed");
157
+ let r = e, i = q(e, "collapsed");
149
158
  function a() {
150
159
  i.value = !i.value;
151
160
  }
152
- let o = ae(), c = ie(), p = L([]);
161
+ let o = oe(), c = ae(), f = R([]);
153
162
  function m() {
154
- p.value = o.getRoutes().filter((e) => e.meta).filter((e) => e.path.split("/").length <= 2).filter((e) => e.meta.menu);
163
+ f.value = o.getRoutes().filter((e) => e.meta).filter((e) => e.path.split("/").length <= 2).filter((e) => e.meta.menu);
155
164
  }
156
- function g() {
157
- r.loadRouter ? p.value = r.loadRouter() : m();
165
+ function h() {
166
+ r.loadRouter ? f.value = r.loadRouter() : m();
158
167
  }
159
- j(() => {
160
- g();
168
+ M(() => {
169
+ h();
161
170
  });
162
- function v(e) {
171
+ function _(e) {
163
172
  o.push({ name: e.name });
164
173
  }
165
- function S(e) {
174
+ function y(e) {
166
175
  return e.children ? e.children.filter((e) => e.meta?.menu) : [];
167
176
  }
168
- return r.refreshEventListener && we(document, Q.Refresh, g), t({
177
+ return r.refreshEventListener && ke(document, _e.Refresh, h), t({
169
178
  changeCollapsed: a,
170
- refreshRouter: g
179
+ refreshRouter: h
171
180
  }), (e, t) => {
172
- let r = s, o = n, m = u, g = d, C = l;
173
- return P(), h(C, {
174
- value: G(c).name,
181
+ let r = s, o = n, m = u, h = d, C = l;
182
+ return F(), g(C, {
183
+ value: K(c).name,
175
184
  collapsed: i.value,
176
185
  "onUpdate:collapsed": t[0] ||= (e) => i.value = e,
177
186
  width: ["180px", "52px"]
178
- }, y({
179
- default: q(() => [(P(!0), _(f, null, R(p.value, (e) => (P(), _(f, { key: String(e.name) }, [S(e).length > 0 ? (P(), h(g, {
187
+ }, b({
188
+ default: J(() => [(F(!0), v(p, null, z(f.value, (e) => (F(), v(p, { key: String(e.name) }, [y(e).length > 0 ? (F(), g(h, {
180
189
  key: 0,
181
190
  value: String(e.name)
182
191
  }, {
183
- icon: q(() => [x(r, { class: k(e.meta.icon) }, null, 8, ["class"])]),
184
- title: q(() => [b(V(e.meta.title), 1)]),
185
- default: q(() => [(P(!0), _(f, null, R(S(e), (e) => (P(), h(m, {
192
+ icon: J(() => [S(r, { class: A(e.meta.icon) }, null, 8, ["class"])]),
193
+ title: J(() => [x(H(e.meta.title), 1)]),
194
+ default: J(() => [(F(!0), v(p, null, z(y(e), (e) => (F(), g(m, {
186
195
  key: String(e.name),
187
196
  value: String(e.name),
188
- onClick: (t) => v(e)
197
+ onClick: (t) => _(e)
189
198
  }, {
190
- icon: q(() => [x(r, { class: k(e.meta.icon) }, null, 8, ["class"])]),
191
- default: q(() => [b(" " + V(e.meta.title), 1)]),
199
+ icon: J(() => [S(r, { class: A(e.meta.icon) }, null, 8, ["class"])]),
200
+ default: J(() => [x(" " + H(e.meta.title), 1)]),
192
201
  _: 2
193
202
  }, 1032, ["value", "onClick"]))), 128))]),
194
203
  _: 2
195
- }, 1032, ["value"])) : (P(), h(m, {
204
+ }, 1032, ["value"])) : (F(), g(m, {
196
205
  key: 1,
197
206
  value: String(e.name),
198
- onClick: (t) => v(e)
207
+ onClick: (t) => _(e)
199
208
  }, {
200
- icon: q(() => [x(r, { class: k(e.meta.icon) }, null, 8, ["class"])]),
201
- default: q(() => [b(" " + V(e.meta.title), 1)]),
209
+ icon: J(() => [S(r, { class: A(e.meta.icon) }, null, 8, ["class"])]),
210
+ default: J(() => [x(" " + H(e.meta.title), 1)]),
202
211
  _: 2
203
212
  }, 1032, ["value", "onClick"]))], 64))), 128))]),
204
213
  _: 2
205
214
  }, [e.hideOperations ? void 0 : {
206
215
  name: "operations",
207
- fn: q(() => [x(o, {
216
+ fn: J(() => [S(o, {
208
217
  variant: "text",
209
218
  shape: "square",
210
219
  onClick: a
211
220
  }, {
212
- icon: q(() => [x(r, { name: "view-list" })]),
221
+ icon: J(() => [S(r, { name: "view-list" })]),
213
222
  _: 1
214
223
  })]),
215
224
  key: "0"
216
225
  }, e.$slots.logo ? {
217
226
  name: "logo",
218
- fn: q(() => [z(e.$slots, "logo")]),
227
+ fn: J(() => [B(e.$slots, "logo")]),
219
228
  key: "1"
220
229
  } : void 0]), 1032, ["value", "collapsed"]);
221
230
  };
222
231
  }
223
- }), Ee = Te, De = /* @__PURE__ */ S({
232
+ }), je = Ae, Me = /* @__PURE__ */ C({
224
233
  __name: "ContextMenu",
225
234
  props: { hideOnSelect: {
226
235
  type: Boolean,
@@ -228,11 +237,11 @@ var Te = /* @__PURE__ */ S({
228
237
  } },
229
238
  emits: ["select"],
230
239
  setup(e, { emit: t }) {
231
- let n = e, r = t, i = X("context-menu"), a = L(), o = L(), s = L(!1), c = I({
240
+ let n = e, r = t, i = Z("context-menu"), a = R(), o = R(), s = R(!1), c = L({
232
241
  left: "0px",
233
242
  top: "0px"
234
243
  }), l = (e) => {
235
- e.preventDefault(), e.stopPropagation(), c.left = e.clientX + "px", c.top = e.clientY + "px", s.value = !0, O(() => {
244
+ e.preventDefault(), e.stopPropagation(), c.left = e.clientX + "px", c.top = e.clientY + "px", s.value = !0, k(() => {
236
245
  u(e.clientX, e.clientY);
237
246
  });
238
247
  }, u = (e, t) => {
@@ -241,9 +250,9 @@ var Te = /* @__PURE__ */ S({
241
250
  e + r.width > i && (s = i - r.width - 4), t + r.height > a && (l = a - r.height - 4), s = Math.max(4, s), l = Math.max(4, l), c.left = s + "px", c.top = l + "px";
242
251
  }, d = () => {
243
252
  s.value = !1;
244
- }, m = (e, t) => {
253
+ }, f = (e, t) => {
245
254
  r("select", e, t), n.hideOnSelect && (s.value = !1);
246
- }, y = (e) => {
255
+ }, h = (e) => {
247
256
  if (!s.value) return;
248
257
  let t = e.target, n = o.value, r = a.value;
249
258
  if (e.button === 2 || e.which === 3) return;
@@ -256,34 +265,34 @@ var Te = /* @__PURE__ */ S({
256
265
  }, S = () => {
257
266
  s.value = !1;
258
267
  };
259
- return F("handleSelect", m), F("closeMenu", S), j(() => {
260
- document.addEventListener("click", y), document.addEventListener("mousedown", y), document.addEventListener("keydown", b), document.addEventListener("contextmenu", x);
261
- }), N(() => {
262
- document.removeEventListener("click", y), document.removeEventListener("mousedown", y), document.removeEventListener("keydown", b), document.removeEventListener("contextmenu", x);
263
- }), (e, t) => (P(), _(f, null, [
264
- v("div", {
268
+ return I("handleSelect", f), I("closeMenu", S), M(() => {
269
+ document.addEventListener("click", h), document.addEventListener("mousedown", h), document.addEventListener("keydown", b), document.addEventListener("contextmenu", x);
270
+ }), P(() => {
271
+ document.removeEventListener("click", h), document.removeEventListener("mousedown", h), document.removeEventListener("keydown", b), document.removeEventListener("contextmenu", x);
272
+ }), (e, t) => (F(), v(p, null, [
273
+ y("div", {
265
274
  ref_key: "triggerRef",
266
275
  ref: a,
267
- class: k(G(i)("trigger")),
268
- onContextmenu: J(l, ["prevent"])
269
- }, [z(e.$slots, "default")], 34),
270
- (P(), h(p, { to: "body" }, [s.value ? (P(), _("div", {
276
+ class: A(K(i)("trigger")),
277
+ onContextmenu: Y(l, ["prevent"])
278
+ }, [B(e.$slots, "default")], 34),
279
+ (F(), g(m, { to: "body" }, [s.value ? (F(), v("div", {
271
280
  key: 0,
272
281
  ref_key: "menuRef",
273
282
  ref: o,
274
- class: k(G(i)("menu")),
275
- style: A(c),
276
- onContextmenu: t[0] ||= J(() => {}, ["prevent"])
277
- }, [z(e.$slots, "content")], 38)) : g("", !0)])),
278
- (P(), h(p, { to: "body" }, [s.value ? (P(), _("div", {
283
+ class: A(K(i)("menu")),
284
+ style: j(c),
285
+ onContextmenu: t[0] ||= Y(() => {}, ["prevent"])
286
+ }, [B(e.$slots, "content")], 38)) : _("", !0)])),
287
+ (F(), g(m, { to: "body" }, [s.value ? (F(), v("div", {
279
288
  key: 0,
280
- class: k(G(i)("mask")),
289
+ class: A(K(i)("mask")),
281
290
  onClick: d,
282
- onContextmenu: J(d, ["prevent"])
283
- }, null, 34)) : g("", !0)]))
291
+ onContextmenu: Y(d, ["prevent"])
292
+ }, null, 34)) : _("", !0)]))
284
293
  ], 64));
285
294
  }
286
- }), Oe = De, ke = /* @__PURE__ */ S({
295
+ }), Ne = Me, Pe = /* @__PURE__ */ C({
287
296
  __name: "ContextMenuItem",
288
297
  props: {
289
298
  label: {},
@@ -300,7 +309,7 @@ var Te = /* @__PURE__ */ S({
300
309
  },
301
310
  emits: ["click"],
302
311
  setup(e, { emit: t }) {
303
- let n = e, r = t, i = X("context-menu", "item"), a = T("handleSelect", null), o = (e) => {
312
+ let n = e, r = t, i = Z("context-menu", "item"), a = E("handleSelect", null), o = (e) => {
304
313
  if (!n.disabled) if (e.stopPropagation(), r("click", n.value, e), a) a(n.value, e);
305
314
  else {
306
315
  let t = new CustomEvent("context-menu-select", {
@@ -315,34 +324,34 @@ var Te = /* @__PURE__ */ S({
315
324
  }, s = (e) => {
316
325
  e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
317
326
  };
318
- return (e, t) => (P(), _("div", {
319
- class: k([G(i)(), {
320
- [G(i)("disabled")]: e.disabled,
321
- [G(i)("danger")]: e.danger
327
+ return (e, t) => (F(), v("div", {
328
+ class: A([K(i)(), {
329
+ [K(i)("disabled")]: e.disabled,
330
+ [K(i)("danger")]: e.danger
322
331
  }]),
323
332
  onClick: o,
324
- onContextmenu: J(s, ["prevent", "stop"])
325
- }, [e.icon ? (P(), _("span", {
333
+ onContextmenu: Y(s, ["prevent", "stop"])
334
+ }, [e.icon ? (F(), v("span", {
326
335
  key: 0,
327
- class: k([G(i)("icon"), e.icon])
328
- }, V(e.icon), 3)) : g("", !0), v("span", { class: k(G(i)("label")) }, V(e.label), 3)], 34));
336
+ class: A([K(i)("icon"), e.icon])
337
+ }, H(e.icon), 3)) : _("", !0), y("span", { class: A(K(i)("label")) }, H(e.label), 3)], 34));
329
338
  }
330
- }), Ae = ke, je = /* @__PURE__ */ S({
339
+ }), Fe = Pe, Ie = /* @__PURE__ */ C({
331
340
  __name: "ContextMenuGroup",
332
341
  props: { title: {} },
333
342
  setup(e) {
334
- let t = X("context-menu", "group");
335
- return (e, n) => (P(), _("div", { class: k(G(t)()) }, [e.title ? (P(), _("div", {
343
+ let t = Z("context-menu", "group");
344
+ return (e, n) => (F(), v("div", { class: A(K(t)()) }, [e.title ? (F(), v("div", {
336
345
  key: 0,
337
- class: k(G(t)("title"))
338
- }, V(e.title), 3)) : g("", !0), z(e.$slots, "default")], 2));
346
+ class: A(K(t)("title"))
347
+ }, H(e.title), 3)) : _("", !0), B(e.$slots, "default")], 2));
339
348
  }
340
- }), Me = je, Ne = /* @__PURE__ */ S({
349
+ }), Le = Ie, Re = /* @__PURE__ */ C({
341
350
  __name: "ContextMenuDivider",
342
351
  setup(e) {
343
- return (e, t) => (P(), _("div", { class: k(G(Y)("context-menu-divider")) }, null, 2));
352
+ return (e, t) => (F(), v("div", { class: A(K(X)("context-menu-divider")) }, null, 2));
344
353
  }
345
- }), Pe = Ne, Fe = /* @__PURE__ */ S({
354
+ }), ze = Re, Be = /* @__PURE__ */ C({
346
355
  __name: "ContextMenuSubmenu",
347
356
  props: {
348
357
  label: {},
@@ -354,17 +363,17 @@ var Te = /* @__PURE__ */ S({
354
363
  },
355
364
  emits: ["select"],
356
365
  setup(e, { emit: t }) {
357
- let n = e, r = t, i = X("context-menu", "item"), a = X("context-menu", "submenu"), o = X("context-menu", "menu"), s = L(), c = L(), l = L(!1), u = I({
366
+ let n = e, r = t, i = Z("context-menu", "item"), a = Z("context-menu", "submenu"), o = Z("context-menu", "menu"), s = R(), c = R(), l = R(!1), u = L({
358
367
  left: "0px",
359
368
  top: "0px"
360
- }), d = T("handleSelect", null), f = null, p = null, m = !1, h = !1, y = () => {
369
+ }), d = E("handleSelect", null), f = null, p = null, m = !1, h = !1, g = () => {
361
370
  f && (clearTimeout(f), f = null), p && (clearTimeout(p), p = null);
362
371
  }, b = () => {
363
- n.disabled || !s.value || (y(), u.left = "100%", u.top = "0px", l.value = !0, O(() => {
372
+ n.disabled || !s.value || (g(), u.left = "100%", u.top = "0px", l.value = !0, k(() => {
364
373
  S();
365
374
  }));
366
375
  }, x = () => {
367
- !m && !h && (y(), p = setTimeout(() => {
376
+ !m && !h && (g(), p = setTimeout(() => {
368
377
  !m && !h && (l.value = !1);
369
378
  }, 100));
370
379
  }, S = () => {
@@ -375,34 +384,34 @@ var Te = /* @__PURE__ */ S({
375
384
  u.top = e + "px";
376
385
  } else r.top < 4 ? u.top = 4 - r.top + "px" : u.top = "0px";
377
386
  }, C = () => {
378
- n.disabled || (m = !0, y(), f = setTimeout(() => {
387
+ n.disabled || (m = !0, g(), f = setTimeout(() => {
379
388
  b();
380
389
  }, 150));
381
390
  }, w = () => {
382
391
  m = !1, x();
383
- }, E = () => {
384
- h = !0, y();
392
+ }, T = () => {
393
+ h = !0, g();
385
394
  }, D = () => {
386
395
  h = !1, x();
387
- }, M = (e, t) => {
396
+ }, O = (e, t) => {
388
397
  l.value = !1, r("select", e, t), d && d(e, t);
389
- }, R = (e) => {
398
+ }, N = (e) => {
390
399
  let { value: t, originalEvent: n } = e.detail;
391
- M(t, n);
392
- }, B = (e) => {
400
+ O(t, n);
401
+ }, z = (e) => {
393
402
  e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
394
- }, ee = (e) => {
403
+ }, V = (e) => {
395
404
  e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
396
- }, H = (e) => {
397
- if (!n.disabled) if (e.stopPropagation(), e.preventDefault(), y(), l.value) l.value = !1;
405
+ }, ee = (e) => {
406
+ if (!n.disabled) if (e.stopPropagation(), e.preventDefault(), g(), l.value) l.value = !1;
398
407
  else {
399
408
  if (!s.value) return;
400
- u.left = "100%", u.top = "0px", l.value = !0, O(() => {
409
+ u.left = "100%", u.top = "0px", l.value = !0, k(() => {
401
410
  S();
402
411
  });
403
412
  }
404
413
  };
405
- F("handleSelect", M), F("closeMenu", () => {
414
+ I("handleSelect", O), I("closeMenu", () => {
406
415
  l.value = !1;
407
416
  });
408
417
  let U = (e) => {
@@ -413,73 +422,73 @@ var Te = /* @__PURE__ */ S({
413
422
  !i && !a && (l.value = !1);
414
423
  }, W = (e) => {
415
424
  e.key === "Escape" && l.value && (l.value = !1);
416
- }, K = (e) => {
425
+ }, G = (e) => {
417
426
  l.value && (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
418
427
  };
419
- return j(() => {
420
- document.addEventListener("click", U), document.addEventListener("mousedown", U), document.addEventListener("keydown", W), document.addEventListener("contextmenu", K);
421
- }), N(() => {
422
- y(), document.removeEventListener("click", U), document.removeEventListener("mousedown", U), document.removeEventListener("keydown", W), document.removeEventListener("contextmenu", K);
423
- }), (e, t) => (P(), _("div", {
428
+ return M(() => {
429
+ document.addEventListener("click", U), document.addEventListener("mousedown", U), document.addEventListener("keydown", W), document.addEventListener("contextmenu", G);
430
+ }), P(() => {
431
+ g(), document.removeEventListener("click", U), document.removeEventListener("mousedown", U), document.removeEventListener("keydown", W), document.removeEventListener("contextmenu", G);
432
+ }), (e, t) => (F(), v("div", {
424
433
  ref_key: "triggerRef",
425
434
  ref: s,
426
- class: k([
427
- G(i)(),
428
- G(a)(),
435
+ class: A([
436
+ K(i)(),
437
+ K(a)(),
429
438
  {
430
- [G(i)("disabled")]: e.disabled,
431
- [G(a)("active")]: l.value
439
+ [K(i)("disabled")]: e.disabled,
440
+ [K(a)("active")]: l.value
432
441
  }
433
442
  ]),
434
- onContextmenu: J(B, ["prevent", "stop"]),
443
+ onContextmenu: Y(z, ["prevent", "stop"]),
435
444
  onMouseenter: C,
436
445
  onMouseleave: w,
437
- onClick: H
446
+ onClick: ee
438
447
  }, [
439
- e.icon ? (P(), _("span", {
448
+ e.icon ? (F(), v("span", {
440
449
  key: 0,
441
- class: k([G(i)("icon"), e.icon])
442
- }, V(e.icon), 3)) : g("", !0),
443
- v("span", { class: k(G(i)("label")) }, V(e.label), 3),
444
- v("span", { class: k(G(a)("arrow")) }, "▶", 2),
445
- l.value ? (P(), _("div", {
450
+ class: A([K(i)("icon"), e.icon])
451
+ }, H(e.icon), 3)) : _("", !0),
452
+ y("span", { class: A(K(i)("label")) }, H(e.label), 3),
453
+ y("span", { class: A(K(a)("arrow")) }, "▶", 2),
454
+ l.value ? (F(), v("div", {
446
455
  key: 1,
447
456
  ref_key: "submenuRef",
448
457
  ref: c,
449
- class: k([G(o)(), G(a)("popup")]),
450
- style: A(u),
451
- onContextmenu: J(ee, ["prevent", "stop"]),
452
- onMouseenter: E,
458
+ class: A([K(o)(), K(a)("popup")]),
459
+ style: j(u),
460
+ onContextmenu: Y(V, ["prevent", "stop"]),
461
+ onMouseenter: T,
453
462
  onMouseleave: D,
454
- onContextMenuSelect: R
455
- }, [z(e.$slots, "default")], 38)) : g("", !0)
463
+ onContextMenuSelect: N
464
+ }, [B(e.$slots, "default")], 38)) : _("", !0)
456
465
  ], 34));
457
466
  }
458
- }), Ie = Fe, Le = /* @__PURE__ */ S({
467
+ }), Ve = Be, He = /* @__PURE__ */ C({
459
468
  __name: "WebLayout",
460
469
  setup(e) {
461
470
  return (e, t) => {
462
- let n = a, r = B("router-view");
463
- return P(), h(fe, null, {
464
- header: q(() => [x(n, {
471
+ let n = a, r = V("router-view");
472
+ return F(), g(ge, null, {
473
+ header: J(() => [S(n, {
465
474
  value: "item1",
466
475
  height: "60px"
467
- }, y({ _: 2 }, [e.$slots.logo ? {
476
+ }, b({ _: 2 }, [e.$slots.logo ? {
468
477
  name: "logo",
469
- fn: q(() => [z(e.$slots, "logo")]),
478
+ fn: J(() => [B(e.$slots, "logo")]),
470
479
  key: "0"
471
480
  } : void 0, e.$slots.operations ? {
472
481
  name: "operations",
473
- fn: q(() => [z(e.$slots, "operations")]),
482
+ fn: J(() => [B(e.$slots, "operations")]),
474
483
  key: "1"
475
484
  } : void 0]), 1024)]),
476
- left: q(() => [z(e.$slots, "left", {}, () => [x(G(Ee))])]),
477
- default: q(() => [z(e.$slots, "default", {}, () => [v("div", { class: k([G(Y)("main-content-inner")]) }, [x(r)], 2)])]),
485
+ left: J(() => [B(e.$slots, "left", {}, () => [S(K(je))])]),
486
+ default: J(() => [B(e.$slots, "default", {}, () => [y("div", { class: A([K(X)("main-content-inner")]) }, [S(r)], 2)])]),
478
487
  _: 3
479
488
  });
480
489
  };
481
490
  }
482
- }), Re = Le, ze = /* @__PURE__ */ S({
491
+ }), Ue = He, We = /* @__PURE__ */ C({
483
492
  __name: "SplitPanel",
484
493
  props: {
485
494
  component: { default: "div" },
@@ -500,9 +509,9 @@ var Te = /* @__PURE__ */ S({
500
509
  "update:size"
501
510
  ],
502
511
  setup(e, { emit: t }) {
503
- let n = e, r = t, { direction: i, size: a, defaultSize: o, min: s, max: c } = U(n), l = L(0), u = L(), d = L(), f = Y("split-panel"), p = Y("split-trigger"), y = L(o.value);
504
- re(a, (e) => {
505
- e !== void 0 && (y.value = e);
512
+ let n = e, r = t, { direction: i, size: a, defaultSize: o, min: s, max: c } = W(n), l = R(0), u = R(), d = R(), f = X("split-panel"), p = X("split-trigger"), m = R(o.value);
513
+ ie(a, (e) => {
514
+ e !== void 0 && (m.value = e);
506
515
  }, { immediate: !0 });
507
516
  function b(e) {
508
517
  let t = typeof e == "string" ? parseFloat(e) : e, n = "";
@@ -512,14 +521,14 @@ var Te = /* @__PURE__ */ S({
512
521
  isPx: n === "px"
513
522
  };
514
523
  }
515
- let x = m(() => b(y.value)), S = m(() => i.value === "horizontal"), C = m(() => [f, {
524
+ let x = h(() => b(m.value)), S = h(() => i.value === "horizontal"), C = h(() => [f, {
516
525
  [`${f}-horizontal`]: S.value,
517
526
  [`${f}-vertical`]: !S.value
518
- }]), w = m(() => [p, {
527
+ }]), w = h(() => [p, {
519
528
  [`${p}-horizontal`]: S.value,
520
529
  [`${p}-vertical`]: !S.value,
521
530
  [`${p}-disabled`]: n.disabled
522
- }]), T = m(() => {
531
+ }]), T = h(() => {
523
532
  let { size: e, unit: t, isPx: n } = x.value, r = n ? e : e * 100;
524
533
  return { flex: `0 0 calc(${r}${t} - ${l.value / 2}px)` };
525
534
  });
@@ -530,7 +539,7 @@ var Te = /* @__PURE__ */ S({
530
539
  function D(e, t) {
531
540
  return parseFloat(e) / parseFloat(t);
532
541
  }
533
- let M = {
542
+ let O = {
534
543
  startPageX: 0,
535
544
  startPageY: 0,
536
545
  startContainerSize: 0,
@@ -538,12 +547,12 @@ var Te = /* @__PURE__ */ S({
538
547
  };
539
548
  async function N() {
540
549
  let e = () => S.value ? u.value?.clientWidth || 0 : u.value?.clientHeight || 0;
541
- return (!u.value || !e()) && await O(), e();
550
+ return (!u.value || !e()) && await k(), e();
542
551
  }
543
- function F(e, t) {
552
+ function P(e, t) {
544
553
  if (!t) return;
545
554
  let n = x.value.isPx ? `${e}px` : D(e, t);
546
- y.value !== n && (y.value = n, r("update:size", n));
555
+ m.value !== n && (m.value = n, r("update:size", n));
547
556
  }
548
557
  function I(e, t) {
549
558
  let n = E({
@@ -560,89 +569,89 @@ var Te = /* @__PURE__ */ S({
560
569
  }), a = n;
561
570
  return a = Math.max(a, r), a = Math.min(a, i), a;
562
571
  }
563
- function R({ startContainerSize: e, startSize: t, startPosition: n, endPosition: r }) {
572
+ function L({ startContainerSize: e, startSize: t, startPosition: n, endPosition: r }) {
564
573
  let i = E({
565
574
  size: t,
566
575
  containerSize: e
567
576
  });
568
577
  return I(`${i + (r - n)}px`, e);
569
578
  }
570
- function B(e) {
579
+ function z(e) {
571
580
  r("moving", e);
572
- let t = S.value ? R({
573
- startContainerSize: M.startContainerSize,
574
- startSize: M.startSize,
575
- startPosition: M.startPageX,
581
+ let t = S.value ? L({
582
+ startContainerSize: O.startContainerSize,
583
+ startSize: O.startSize,
584
+ startPosition: O.startPageX,
576
585
  endPosition: e.pageX
577
- }) : R({
578
- startContainerSize: M.startContainerSize,
579
- startSize: M.startSize,
580
- startPosition: M.startPageY,
586
+ }) : L({
587
+ startContainerSize: O.startContainerSize,
588
+ startSize: O.startSize,
589
+ startPosition: O.startPageY,
581
590
  endPosition: e.pageY
582
591
  });
583
- F(t, M.startContainerSize);
592
+ P(t, O.startContainerSize);
584
593
  }
585
594
  function V(e) {
586
- window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", V), window.removeEventListener("contextmenu", V), document.body.style.cursor = "default", r("moveEnd", e);
595
+ window.removeEventListener("mousemove", z), window.removeEventListener("mouseup", V), window.removeEventListener("contextmenu", V), document.body.style.cursor = "default", r("moveEnd", e);
587
596
  }
588
597
  async function H(e) {
589
- n.disabled || (r("moveStart", e), M.startPageX = e.pageX, M.startPageY = e.pageY, M.startContainerSize = await N(), M.startSize = y.value, window.addEventListener("mousemove", B), window.addEventListener("mouseup", V), window.addEventListener("contextmenu", V), document.body.style.cursor = S.value ? "col-resize" : "row-resize");
598
+ n.disabled || (r("moveStart", e), O.startPageX = e.pageX, O.startPageY = e.pageY, O.startContainerSize = await N(), O.startSize = m.value, window.addEventListener("mousemove", z), window.addEventListener("mouseup", V), window.addEventListener("contextmenu", V), document.body.style.cursor = S.value ? "col-resize" : "row-resize");
590
599
  }
591
- function W() {
600
+ function U() {
592
601
  if (d.value) {
593
602
  let { width: e, height: t } = d.value.getBoundingClientRect();
594
603
  l.value = S.value ? e || 0 : t || 0;
595
604
  }
596
605
  }
597
- return j(async () => {
598
- let e = await N(), t = I(y.value, e);
599
- F(t, e), W();
606
+ return M(async () => {
607
+ let e = await N(), t = I(m.value, e);
608
+ P(t, e), U();
600
609
  let n = new ResizeObserver(() => {
601
- W();
610
+ U();
602
611
  });
603
612
  d.value && n.observe(d.value);
604
613
  let r = () => {
605
614
  n.disconnect();
606
615
  };
607
616
  return r;
608
- }), (e, t) => (P(), h(ee(e.component), {
617
+ }), (e, t) => (F(), g(ee(e.component), {
609
618
  ref_key: "wrapperRef",
610
619
  ref: u,
611
- class: k(C.value)
620
+ class: A(C.value)
612
621
  }, {
613
- default: q(() => [
614
- v("div", {
615
- class: k([`${G(f)}-pane`, `${G(f)}-pane-first`]),
616
- style: A(T.value)
617
- }, [z(e.$slots, "first")], 6),
618
- e.disabled ? g("", !0) : (P(), _("div", {
622
+ default: J(() => [
623
+ y("div", {
624
+ class: A([`${K(f)}-pane`, `${K(f)}-pane-first`]),
625
+ style: j(T.value)
626
+ }, [B(e.$slots, "first")], 6),
627
+ e.disabled ? _("", !0) : (F(), v("div", {
619
628
  key: 0,
620
629
  ref_key: "triggerRef",
621
630
  ref: d,
622
- class: k(w.value),
631
+ class: A(w.value),
623
632
  onMousedown: H
624
- }, [z(e.$slots, "resize-trigger", {}, () => [v("div", { class: k(`${G(p)}-icon`) }, [z(e.$slots, "resize-trigger-icon", {}, () => [
625
- v("div", { class: k(`${G(p)}-line`) }, null, 2),
626
- v("div", { class: k(`${G(p)}-line`) }, null, 2),
627
- v("div", { class: k(`${G(p)}-line`) }, null, 2)
633
+ }, [B(e.$slots, "resize-trigger", {}, () => [y("div", { class: A(`${K(p)}-icon`) }, [B(e.$slots, "resize-trigger-icon", {}, () => [
634
+ y("div", { class: A(`${K(p)}-line`) }, null, 2),
635
+ y("div", { class: A(`${K(p)}-line`) }, null, 2),
636
+ y("div", { class: A(`${K(p)}-line`) }, null, 2)
628
637
  ])], 2)])], 34)),
629
- v("div", { class: k([`${G(f)}-pane`, `${G(f)}-pane-second`]) }, [z(e.$slots, "second")], 2)
638
+ y("div", { class: A([`${K(f)}-pane`, `${K(f)}-pane-second`]) }, [B(e.$slots, "second")], 2)
630
639
  ]),
631
640
  _: 3
632
641
  }, 8, ["class"]));
633
642
  }
634
- }), Be = ze, Ve = /* @__PURE__ */ S({
643
+ }), Ge = We, Ke = /* @__PURE__ */ C({
635
644
  __name: "UtoolsBaseLayout",
636
645
  setup(t) {
637
646
  return (t, n) => {
638
647
  let i = e, a = r, o = c;
639
- return P(), h(o, { class: "h-screen min-h-0" }, {
640
- default: q(() => [x(i, { width: "auto" }, {
641
- default: q(() => [z(t.$slots, "left")]),
648
+ return F(), g(o, { class: "h-screen min-h-0" }, {
649
+ default: J(() => [S(i, { width: "auto" }, {
650
+ default: J(() => [B(t.$slots, "left")]),
642
651
  _: 3
643
- }), x(o, { class: k(["min-h-0", [G(Y)("utools", "main-content")]]) }, {
644
- default: q(() => [x(a, { class: "h-full" }, {
645
- default: q(() => [z(t.$slots, "default")]),
652
+ }), S(o, { class: A(["min-h-0", [K(X)("utools", "main-content")]]) }, {
653
+ default: J(() => [S(a, { class: "h-full" }, {
654
+ default: J(() => [B(t.$slots, "default")]),
646
655
  _: 3
647
656
  })]),
648
657
  _: 3
@@ -651,12 +660,12 @@ var Te = /* @__PURE__ */ S({
651
660
  });
652
661
  };
653
662
  }
654
- }), He = Ve;
655
- const Ue = { class: "utools" }, We = { class: "title" }, Ge = { class: "flex justify-end h-full pr-3" }, Ke = { class: "content" }, qe = { class: "content-inner" }, Je = {
663
+ }), qe = Ke;
664
+ const Je = { class: "utools" }, Ye = { class: "title" }, Xe = { class: "flex justify-end h-full pr-3" }, Ze = { class: "content" }, Qe = { class: "content-inner" }, $e = {
656
665
  class: "flex items-center justify-center",
657
666
  style: { "font-size": "10px" }
658
667
  };
659
- var Ye = /* @__PURE__ */ S({
668
+ var et = /* @__PURE__ */ C({
660
669
  __name: "UtoolsLayout",
661
670
  props: {
662
671
  avatar: { default: "https://www.u-tools.cn/assets/favicon.png" },
@@ -665,14 +674,14 @@ var Ye = /* @__PURE__ */ S({
665
674
  title: { default: "utools demo" }
666
675
  },
667
676
  setup(e) {
668
- let n = ne("leftMenuRef"), r = L(!0);
677
+ let n = re("leftMenuRef"), r = R(!0);
669
678
  return (e, i) => {
670
- let a = t, o = B("router-view");
671
- return P(), _("div", Ue, [x(He, null, {
672
- left: q(() => [v("div", { class: k(G(Y)("utools", "left-menu")) }, [v("div", {
673
- class: k(["flex items-center justify-center", G(Y)("utools", "left-menu", "collapse")]),
679
+ let a = t, o = V("router-view");
680
+ return F(), v("div", Je, [S(qe, null, {
681
+ left: J(() => [y("div", { class: A(K(X)("utools", "left-menu")) }, [y("div", {
682
+ class: A(["flex items-center justify-center", K(X)("utools", "left-menu", "collapse")]),
674
683
  onClick: i[0] ||= (e) => n.value?.changeCollapsed()
675
- }, [v("div", { class: k(["text-lg font-bold", r.value ? "i-u-expandLeft" : "i-u-expandRight"]) }, null, 2)], 2), x(G(Ee), D({
684
+ }, [y("div", { class: A(["text-lg font-bold", r.value ? "i-u-expandLeft" : "i-u-expandRight"]) }, null, 2)], 2), S(K(je), O({
676
685
  ref_key: "leftMenuRef",
677
686
  ref: n
678
687
  }, {
@@ -683,19 +692,19 @@ var Ye = /* @__PURE__ */ S({
683
692
  "onUpdate:collapsed": i[1] ||= (e) => r.value = e,
684
693
  hideOperations: ""
685
694
  }), {
686
- logo: q(() => [x(a, { image: e.avatar }, null, 8, ["image"]), v("div", We, V(e.title), 1)]),
695
+ logo: J(() => [S(a, { image: e.avatar }, null, 8, ["image"]), y("div", Ye, H(e.title), 1)]),
687
696
  _: 1
688
697
  }, 16, ["collapsed"])], 2)]),
689
- default: q(() => [v("div", { class: k(G(Y)("utools", "content-wrapper")) }, [
690
- v("div", Ge, [z(e.$slots, "header-tips")]),
691
- v("div", Ke, [v("div", qe, [x(o)])]),
692
- z(e.$slots, "footer", {}, () => [v("div", Je, " © " + V((/* @__PURE__ */ new Date()).getFullYear()) + " [xiaou]。保留所有权利 ", 1)])
698
+ default: J(() => [y("div", { class: A(K(X)("utools", "content-wrapper")) }, [
699
+ y("div", Xe, [B(e.$slots, "header-tips")]),
700
+ y("div", Ze, [y("div", Qe, [S(o)])]),
701
+ B(e.$slots, "footer", {}, () => [y("div", $e, " © " + H((/* @__PURE__ */ new Date()).getFullYear()) + " [xiaou]。保留所有权利 ", 1)])
693
702
  ], 2)]),
694
703
  _: 3
695
704
  })]);
696
705
  };
697
706
  }
698
- }), Xe = Ye, Ze = /* @__PURE__ */ S({
707
+ }), tt = et, nt = /* @__PURE__ */ C({
699
708
  __name: "PageHeader",
700
709
  props: {
701
710
  title: { default: "" },
@@ -704,37 +713,37 @@ var Ye = /* @__PURE__ */ S({
704
713
  },
705
714
  emits: ["back"],
706
715
  setup(e) {
707
- let t = e, r = X("page-header"), a = m(() => {
716
+ let t = e, r = Z("page-header"), a = h(() => {
708
717
  let e = [r()];
709
718
  return t.size !== "default" && e.push(r(t.size)), e;
710
- }), o = m(() => ue("onBack"));
719
+ }), o = h(() => de("onBack"));
711
720
  return (e, t) => {
712
721
  let c = s, l = n, u = i;
713
- return P(), _("div", { class: k(a.value) }, [v("div", { class: k(["flex items-center", G(r)("header")]) }, [
714
- o.value || e.$slots.prefix ? z(e.$slots, "prefix", { key: 0 }, () => [x(l, {
715
- class: k(G(r)("header", "back")),
722
+ return F(), v("div", { class: A(a.value) }, [y("div", { class: A(["flex items-center", K(r)("header")]) }, [
723
+ o.value || e.$slots.prefix ? B(e.$slots, "prefix", { key: 0 }, () => [S(l, {
724
+ class: A(K(r)("header", "back")),
716
725
  shape: "square",
717
726
  variant: "text",
718
727
  onClick: t[0] ||= (t) => e.$emit("back")
719
728
  }, {
720
- icon: q(() => [x(c, { class: "i-u-left" })]),
729
+ icon: J(() => [S(c, { class: "i-u-left" })]),
721
730
  _: 1
722
- }, 8, ["class"])]) : g("", !0),
723
- v("div", { class: k(G(r)("title")) }, [z(e.$slots, "title", {}, () => [b(V(e.title), 1)])], 2),
724
- x(u, {
725
- class: k(G(r)("divider")),
731
+ }, 8, ["class"])]) : _("", !0),
732
+ y("div", { class: A(K(r)("title")) }, [B(e.$slots, "title", {}, () => [x(H(e.title), 1)])], 2),
733
+ S(u, {
734
+ class: A(K(r)("divider")),
726
735
  layout: "vertical"
727
736
  }, null, 8, ["class"]),
728
- v("div", { class: k(G(r)("subtitle")) }, [z(e.$slots, "subtitle", {}, () => [b(V(e.subtitle), 1)])], 2)
729
- ], 2), e.$slots.extra ? (P(), _("div", {
737
+ y("div", { class: A(K(r)("subtitle")) }, [B(e.$slots, "subtitle", {}, () => [x(H(e.subtitle), 1)])], 2)
738
+ ], 2), e.$slots.extra ? (F(), v("div", {
730
739
  key: 0,
731
- class: k(G(r)("extra"))
732
- }, [z(e.$slots, "extra")], 2)) : g("", !0)], 2);
740
+ class: A(K(r)("extra"))
741
+ }, [B(e.$slots, "extra")], 2)) : _("", !0)], 2);
733
742
  };
734
743
  }
735
- }), Qe = Ze;
736
- const $e = { class: "flex justify-between items-center" };
737
- var et = /* @__PURE__ */ S({
744
+ }), rt = nt;
745
+ const it = { class: "flex justify-between items-center" };
746
+ var at = /* @__PURE__ */ C({
738
747
  __name: "SettingItem",
739
748
  props: {
740
749
  title: {},
@@ -745,24 +754,264 @@ var et = /* @__PURE__ */ S({
745
754
  background: { default: "var(--u-bg-color-3)" }
746
755
  },
747
756
  setup(e) {
748
- let t = K(), n = m(() => "onClick" in t || "onClickCapture" in t), r = m(() => {
757
+ let t = te(), n = h(() => "onClick" in t || "onClickCapture" in t), r = h(() => {
749
758
  let e = [];
750
- return e.push(Y("setting-item")), n.value && e.push("cursor-pointer"), e;
759
+ return e.push(X("setting-item")), n.value && e.push("cursor-pointer"), e;
751
760
  });
752
- return (e, t) => (P(), _("div", D({ class: r.value }, H({ ...n.value && { click: e.$attrs.onClick || e.$attrs.onClickCapture } }, !0)), [v("div", $e, [v("div", null, [v("div", { class: k(["u-fx u-gap5 u-fac", G(Y)("setting-item-title")]) }, [z(e.$slots, "title", {}, () => [b(V(e.title), 1)])], 2), z(e.$slots, "desc", {}, () => [v("div", { class: k(G(Y)("setting-item-desc")) }, V(e.desc), 3)])]), v("div", null, [z(e.$slots, "default")])]), v("div", null, [z(e.$slots, "extra")])], 16));
761
+ return (e, t) => (F(), v("div", O({ class: r.value }, U({ ...n.value && { click: e.$attrs.onClick || e.$attrs.onClickCapture } }, !0)), [y("div", it, [y("div", null, [y("div", { class: A(["u-fx u-gap5 u-fac", K(X)("setting-item-title")]) }, [B(e.$slots, "title", {}, () => [x(H(e.title), 1)])], 2), B(e.$slots, "desc", {}, () => [y("div", { class: A(K(X)("setting-item-desc")) }, H(e.desc), 3)])]), y("div", null, [B(e.$slots, "default")])]), y("div", null, [B(e.$slots, "extra")])], 16));
753
762
  }
754
- }), tt = et, nt = /* @__PURE__ */ S({
763
+ }), ot = at, st = /* @__PURE__ */ C({
755
764
  __name: "SettingDivision",
756
765
  setup(e) {
757
- return (e, t) => (P(), _("div", { class: k(G(Y)("setting-division")) }, null, 2));
766
+ return (e, t) => (F(), v("div", { class: A(K(X)("setting-division")) }, null, 2));
758
767
  }
759
- }), rt = nt;
760
- const it = { key: 0 };
761
- var at = /* @__PURE__ */ S({
768
+ }), ct = st;
769
+ const lt = { key: 0 };
770
+ var ut = /* @__PURE__ */ C({
762
771
  __name: "SettingGroup",
763
772
  props: { title: {} },
764
773
  setup(e) {
765
- return (e, t) => (P(), _("div", { class: k([G(Y)("setting-group")]) }, [v("div", { class: k(G(Y)("setting-group-header")) }, [v("div", { class: k(G(Y)("setting-group-title")) }, V(e.title), 3), e.$slots.desc ? (P(), _("div", it, [z(e.$slots, "desc")])) : g("", !0)], 2), v("div", null, [z(e.$slots, "default")])], 2));
774
+ return (e, t) => (F(), v("div", { class: A([K(X)("setting-group")]) }, [y("div", { class: A(K(X)("setting-group-header")) }, [y("div", { class: A(K(X)("setting-group-title")) }, H(e.title), 3), e.$slots.desc ? (F(), v("div", lt, [B(e.$slots, "desc")])) : _("", !0)], 2), y("div", null, [B(e.$slots, "default")])], 2));
775
+ }
776
+ }), dt = ut, ft = /* @__PURE__ */ C({
777
+ name: "SwitchEnable",
778
+ inheritAttrs: !1,
779
+ __name: "SwitchEnable",
780
+ props: /* @__PURE__ */ D({
781
+ value: { type: Boolean },
782
+ color: { default: "green" },
783
+ beforeChange: {},
784
+ customValue: {},
785
+ disabled: { type: Boolean },
786
+ label: {},
787
+ loading: { type: Boolean },
788
+ size: { default: "large" },
789
+ defaultValue: {},
790
+ modelValue: {},
791
+ onChange: {}
792
+ }, {
793
+ value: {
794
+ type: Boolean,
795
+ default: !1
796
+ },
797
+ valueModifiers: {}
798
+ }),
799
+ emits: /* @__PURE__ */ D(["change"], ["update:value"]),
800
+ setup(e, { emit: t }) {
801
+ let n = e, r = t, i = q(e, "value"), a = (e, t) => {
802
+ r("change", e, t);
803
+ }, o = (e, t) => t.value ? S("span", {
804
+ class: "i-u-check",
805
+ style: "width: 10px; height: 10px;"
806
+ }, null) : S("span", {
807
+ class: "i-u-close",
808
+ style: "width: 10px; height: 10px;"
809
+ }, null);
810
+ return (e, t) => {
811
+ let r = f;
812
+ return F(), g(r, O({ class: ["u-web-switch", { "u-web-switch-green": n.color === "green" }] }, {
813
+ ...n,
814
+ value: void 0
815
+ }, {
816
+ modelValue: i.value,
817
+ "onUpdate:modelValue": t[0] ||= (e) => i.value = e,
818
+ onChange: a,
819
+ label: o
820
+ }), null, 16, ["class", "modelValue"]);
821
+ };
822
+ }
823
+ }), pt = ft;
824
+ const mt = ["aria-checked", "disabled"];
825
+ var ht = /* @__PURE__ */ C({
826
+ name: "SwitchPlus",
827
+ __name: "SwitchPlus",
828
+ props: /* @__PURE__ */ D({
829
+ defaultChecked: {
830
+ type: Boolean,
831
+ default: !1
832
+ },
833
+ disabled: {
834
+ type: Boolean,
835
+ default: !1
836
+ },
837
+ loading: {
838
+ type: Boolean,
839
+ default: !1
840
+ },
841
+ type: { default: "circle" },
842
+ size: { default: "medium" },
843
+ checkedValue: {
844
+ type: [
845
+ String,
846
+ Number,
847
+ Boolean
848
+ ],
849
+ default: !0
850
+ },
851
+ uncheckedValue: {
852
+ type: [
853
+ String,
854
+ Number,
855
+ Boolean
856
+ ],
857
+ default: !1
858
+ },
859
+ checkedColor: {},
860
+ uncheckedColor: {},
861
+ beforeChange: {},
862
+ checkedText: {},
863
+ uncheckedText: {}
864
+ }, {
865
+ value: {
866
+ type: [
867
+ String,
868
+ Number,
869
+ Boolean
870
+ ],
871
+ default: !1
872
+ },
873
+ valueModifiers: {}
874
+ }),
875
+ emits: /* @__PURE__ */ D([
876
+ "change",
877
+ "focus",
878
+ "blur"
879
+ ], ["update:value"]),
880
+ setup(e, { emit: t }) {
881
+ let n = q(e, "value"), r = e, i = t, a = ne(), { size: o } = W(r), s = Z("switch-plus"), c = s(), l = h(() => r.disabled), u = h(() => r.size);
882
+ n.value === !1 && r.defaultChecked && (n.value = r.checkedValue);
883
+ let d = h(() => n.value === r.checkedValue), f = R(!1), m = h(() => f.value || r.loading), g = (e, t) => {
884
+ let a = e ? r.checkedValue : r.uncheckedValue;
885
+ n.value = a, i("change", a, t);
886
+ }, b = async (e) => {
887
+ if (m.value || l.value) return;
888
+ let t = !d.value, n = t ? r.checkedValue : r.uncheckedValue, i = r.beforeChange;
889
+ if (fe(i)) {
890
+ f.value = !0;
891
+ try {
892
+ let r = await i(n);
893
+ (r ?? !0) && g(t, e);
894
+ } finally {
895
+ f.value = !1;
896
+ }
897
+ } else g(t, e);
898
+ }, S = (e) => {
899
+ i("focus", e);
900
+ }, C = (e) => {
901
+ i("blur", e);
902
+ };
903
+ ie(n, (e) => {
904
+ (me(e) || pe(e)) && (e.value = r.uncheckedValue);
905
+ });
906
+ let w = h(() => [
907
+ c,
908
+ `${c}-type-${r.type}`,
909
+ {
910
+ [`${c}-small`]: u.value === "small",
911
+ [`${c}-checked`]: d.value,
912
+ [`${c}-disabled`]: l.value,
913
+ [`${c}-loading`]: m.value,
914
+ [`${c}-custom-color`]: r.type === "line" && (r.checkedColor || r.uncheckedColor)
915
+ }
916
+ ]), T = h(() => {
917
+ if (d.value && r.checkedColor) return r.type === "line" ? { "--custom-color": r.checkedColor } : { backgroundColor: r.checkedColor };
918
+ if (!d.value && r.uncheckedColor) return r.type === "line" ? { "--custom-color": r.uncheckedColor } : { backgroundColor: r.uncheckedColor };
919
+ }), E = h(() => {
920
+ if (!m.value) {
921
+ if (d.value && r.checkedColor) return { color: r.checkedColor };
922
+ if (!d.value && r.uncheckedColor) return { color: r.uncheckedColor };
923
+ }
924
+ });
925
+ return (e, t) => (F(), v("button", {
926
+ type: "button",
927
+ role: "switch",
928
+ "aria-checked": d.value,
929
+ class: A(w.value),
930
+ style: j(T.value),
931
+ disabled: l.value || m.value,
932
+ onClick: b,
933
+ onFocus: S,
934
+ onBlur: C
935
+ }, [y("span", {
936
+ class: A(`${K(c)}-handle`),
937
+ style: j(E.value)
938
+ }, [y("span", { class: A(`${K(c)}-handle-icon`) }, [m.value ? (F(), v("span", {
939
+ key: 0,
940
+ class: A(["i-u-loading", `${K(c)}-loading-icon`])
941
+ }, null, 2)) : (F(), v(p, { key: 1 }, [d.value ? B(e.$slots, "checked-icon", { key: 0 }) : B(e.$slots, "unchecked-icon", { key: 1 })], 64))], 2)], 6), e.type !== "line" && K(o) !== "small" && (K(a).checked || e.checkedText || K(a).unchecked || e.uncheckedText) ? (F(), v(p, { key: 0 }, [y("span", { class: A(`${K(c)}-text-holder`) }, [d.value ? B(e.$slots, "checked", { key: 0 }, () => [x(H(e.checkedText), 1)]) : B(e.$slots, "unchecked", { key: 1 }, () => [x(H(e.uncheckedText), 1)])], 2), y("span", { class: A(`${K(c)}-text`) }, [d.value ? B(e.$slots, "checked", { key: 0 }, () => [x(H(e.checkedText), 1)]) : B(e.$slots, "unchecked", { key: 1 }, () => [x(H(e.uncheckedText), 1)])], 2)], 64)) : _("", !0)], 46, mt));
942
+ }
943
+ }), gt = ht, _t = /* @__PURE__ */ C({
944
+ __name: "SwitchPlusEnable",
945
+ props: /* @__PURE__ */ D({
946
+ defaultChecked: {
947
+ type: Boolean,
948
+ default: !1
949
+ },
950
+ disabled: {
951
+ type: Boolean,
952
+ default: !1
953
+ },
954
+ loading: {
955
+ type: Boolean,
956
+ default: !1
957
+ },
958
+ type: { default: "circle" },
959
+ size: { default: "medium" },
960
+ checkedValue: {
961
+ type: [
962
+ String,
963
+ Number,
964
+ Boolean
965
+ ],
966
+ default: !0
967
+ },
968
+ uncheckedValue: {
969
+ type: [
970
+ String,
971
+ Number,
972
+ Boolean
973
+ ],
974
+ default: !1
975
+ },
976
+ checkedColor: { default: "#10b981" },
977
+ uncheckedColor: {},
978
+ beforeChange: {},
979
+ checkedText: {},
980
+ uncheckedText: {}
981
+ }, {
982
+ value: {
983
+ type: [
984
+ String,
985
+ Number,
986
+ Boolean
987
+ ],
988
+ default: !1
989
+ },
990
+ valueModifiers: {}
991
+ }),
992
+ emits: ["update:value"],
993
+ setup(e) {
994
+ let t = q(e, "value");
995
+ return (e, n) => (F(), g(gt, O({
996
+ value: t.value,
997
+ "onUpdate:value": n[0] ||= (e) => t.value = e
998
+ }, e.$props), {
999
+ "checked-icon": J(() => n[1] ||= [y("span", {
1000
+ style: {
1001
+ width: "14px",
1002
+ height: "14px"
1003
+ },
1004
+ class: "i-u-checkSmall"
1005
+ }, null, -1)]),
1006
+ "unchecked-icon": J(() => n[2] ||= [y("span", {
1007
+ style: {
1008
+ width: "14px",
1009
+ height: "14px"
1010
+ },
1011
+ class: "i-u-closeSmall"
1012
+ }, null, -1)]),
1013
+ _: 1
1014
+ }, 16, ["value"]));
766
1015
  }
767
- }), ot = at;
768
- export { Oe as ContextMenu, Pe as ContextMenuDivider, Me as ContextMenuGroup, Ae as ContextMenuItem, Ie as ContextMenuSubmenu, Ee as LeftMenu, pe as LeftMenuEventDispatch, Q as LeftMenuEvents, Qe as PageHeader, rt as SettingDivision, ot as SettingGroup, tt as SettingItem, Be as SplitPanel, He as UtoolsBaseLayout, Xe as UtoolsLayout, fe as WebBaseLayout, Re as WebLayout, X as getBuildCurrentClassPrefix, Y as getClassPrefix, ue as isEventExist };
1016
+ }), vt = _t;
1017
+ export { Ne as ContextMenu, ze as ContextMenuDivider, Le as ContextMenuGroup, Fe as ContextMenuItem, Ve as ContextMenuSubmenu, je as LeftMenu, ve as LeftMenuEventDispatch, _e as LeftMenuEvents, rt as PageHeader, ct as SettingDivision, dt as SettingGroup, ot as SettingItem, Ge as SplitPanel, pt as SwitchEnable, gt as SwitchPlus, vt as SwitchPlusEnable, qe as UtoolsBaseLayout, tt as UtoolsLayout, ge as WebBaseLayout, Ue as WebLayout, Z as getBuildCurrentClassPrefix, X as getClassPrefix, de as isEventExist, fe as isFunction, pe as isNull, me as isUndefined };