@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/components/index.d.ts +1 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/switch/SwitchEnable/SwitchEnable.d.ts +29 -0
- package/dist/components/switch/SwitchEnable/SwitchEnable.d.ts.map +1 -0
- package/dist/components/switch/SwitchEnable/SwitchEnable.vue.d.ts +22 -0
- package/dist/components/switch/SwitchEnable/SwitchEnable.vue.d.ts.map +1 -0
- package/dist/components/switch/SwitchEnable/index.d.ts +3 -0
- package/dist/components/switch/SwitchEnable/index.d.ts.map +1 -0
- package/dist/components/switch/SwitchPlus/SwitchPlus.d.ts +119 -0
- package/dist/components/switch/SwitchPlus/SwitchPlus.d.ts.map +1 -0
- package/dist/components/switch/SwitchPlus/SwitchPlus.vue.d.ts +40 -0
- package/dist/components/switch/SwitchPlus/SwitchPlus.vue.d.ts.map +1 -0
- package/dist/components/switch/SwitchPlus/SwitchPlusEnable.vue.d.ts +22 -0
- package/dist/components/switch/SwitchPlus/SwitchPlusEnable.vue.d.ts.map +1 -0
- package/dist/components/switch/SwitchPlus/index.d.ts +4 -0
- package/dist/components/switch/SwitchPlus/index.d.ts.map +1 -0
- package/dist/components/switch/index.d.ts +3 -0
- package/dist/components/switch/index.d.ts.map +1 -0
- package/dist/index.es.js +518 -269
- package/dist/u-web-ui.css +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/typeUtils.d.ts +19 -0
- package/dist/utils/typeUtils.d.ts.map +1 -0
- package/package.json +4 -3
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
|
|
3
|
-
import { useRoute as
|
|
4
|
-
const
|
|
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) =>
|
|
10
|
+
return (...e) => X(t, ...e);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
12
|
+
function ce(e) {
|
|
13
13
|
return e.substring(0, 1).toUpperCase() + e.substring(1);
|
|
14
14
|
}
|
|
15
|
-
const
|
|
15
|
+
const Q = "on", le = [
|
|
16
16
|
"Capture",
|
|
17
17
|
"Passive",
|
|
18
18
|
"Once"
|
|
19
|
-
],
|
|
20
|
-
function
|
|
19
|
+
], ue = /* @__PURE__ */ RegExp(`^(${le.join("|")})*$`);
|
|
20
|
+
function de(...e) {
|
|
21
21
|
if (!e.length) return !1;
|
|
22
|
-
let t =
|
|
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(
|
|
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(
|
|
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 &&
|
|
32
|
+
if (n && ue.test(n)) return !0;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
return !1;
|
|
36
36
|
}
|
|
37
|
-
|
|
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
|
|
43
|
-
default:
|
|
44
|
-
default:
|
|
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
|
-
})) :
|
|
47
|
-
default:
|
|
48
|
-
default:
|
|
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
|
-
}),
|
|
51
|
-
default:
|
|
52
|
-
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
|
-
}),
|
|
64
|
-
let
|
|
72
|
+
}), ge = he;
|
|
73
|
+
let _e = /* @__PURE__ */ function(e) {
|
|
65
74
|
return e.Refresh = "u:leftMenu:refresh", e;
|
|
66
75
|
}({});
|
|
67
|
-
const
|
|
68
|
-
window.dispatchEvent(new CustomEvent(
|
|
76
|
+
const ve = { refresh: () => {
|
|
77
|
+
window.dispatchEvent(new CustomEvent(_e.Refresh));
|
|
69
78
|
} };
|
|
70
|
-
function
|
|
71
|
-
return
|
|
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
|
|
76
|
-
function
|
|
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
|
|
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
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
function
|
|
91
|
-
return
|
|
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
|
|
105
|
+
const De = $ ? window : void 0;
|
|
97
106
|
$ && window.document, $ && window.navigator, $ && window.location;
|
|
98
|
-
function
|
|
107
|
+
function Oe(e) {
|
|
99
108
|
var t;
|
|
100
|
-
let n =
|
|
109
|
+
let n = G(e);
|
|
101
110
|
return (t = n?.$el) ?? n;
|
|
102
111
|
}
|
|
103
|
-
function
|
|
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 =
|
|
107
|
-
let t =
|
|
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 =
|
|
118
|
+
}), a = Ee(() => {
|
|
110
119
|
var t, n;
|
|
111
120
|
return [
|
|
112
|
-
(n = (t = i.value)?.map((e) =>
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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 =
|
|
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
|
|
133
|
+
return ye(n), o;
|
|
125
134
|
}
|
|
126
135
|
Symbol("vueuse-ssr-width");
|
|
127
|
-
var
|
|
136
|
+
var Ae = /* @__PURE__ */ C({
|
|
128
137
|
__name: "LeftMenu",
|
|
129
|
-
props: /* @__PURE__ */
|
|
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 =
|
|
157
|
+
let r = e, i = q(e, "collapsed");
|
|
149
158
|
function a() {
|
|
150
159
|
i.value = !i.value;
|
|
151
160
|
}
|
|
152
|
-
let o =
|
|
161
|
+
let o = oe(), c = ae(), f = R([]);
|
|
153
162
|
function m() {
|
|
154
|
-
|
|
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
|
|
157
|
-
r.loadRouter ?
|
|
165
|
+
function h() {
|
|
166
|
+
r.loadRouter ? f.value = r.loadRouter() : m();
|
|
158
167
|
}
|
|
159
|
-
|
|
160
|
-
|
|
168
|
+
M(() => {
|
|
169
|
+
h();
|
|
161
170
|
});
|
|
162
|
-
function
|
|
171
|
+
function _(e) {
|
|
163
172
|
o.push({ name: e.name });
|
|
164
173
|
}
|
|
165
|
-
function
|
|
174
|
+
function y(e) {
|
|
166
175
|
return e.children ? e.children.filter((e) => e.meta?.menu) : [];
|
|
167
176
|
}
|
|
168
|
-
return r.refreshEventListener &&
|
|
177
|
+
return r.refreshEventListener && ke(document, _e.Refresh, h), t({
|
|
169
178
|
changeCollapsed: a,
|
|
170
|
-
refreshRouter:
|
|
179
|
+
refreshRouter: h
|
|
171
180
|
}), (e, t) => {
|
|
172
|
-
let r = s, o = n, m = u,
|
|
173
|
-
return
|
|
174
|
-
value:
|
|
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
|
-
},
|
|
179
|
-
default:
|
|
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:
|
|
184
|
-
title:
|
|
185
|
-
default:
|
|
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) =>
|
|
197
|
+
onClick: (t) => _(e)
|
|
189
198
|
}, {
|
|
190
|
-
icon:
|
|
191
|
-
default:
|
|
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"])) : (
|
|
204
|
+
}, 1032, ["value"])) : (F(), g(m, {
|
|
196
205
|
key: 1,
|
|
197
206
|
value: String(e.name),
|
|
198
|
-
onClick: (t) =>
|
|
207
|
+
onClick: (t) => _(e)
|
|
199
208
|
}, {
|
|
200
|
-
icon:
|
|
201
|
-
default:
|
|
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:
|
|
216
|
+
fn: J(() => [S(o, {
|
|
208
217
|
variant: "text",
|
|
209
218
|
shape: "square",
|
|
210
219
|
onClick: a
|
|
211
220
|
}, {
|
|
212
|
-
icon:
|
|
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:
|
|
227
|
+
fn: J(() => [B(e.$slots, "logo")]),
|
|
219
228
|
key: "1"
|
|
220
229
|
} : void 0]), 1032, ["value", "collapsed"]);
|
|
221
230
|
};
|
|
222
231
|
}
|
|
223
|
-
}),
|
|
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 =
|
|
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,
|
|
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
|
-
},
|
|
253
|
+
}, f = (e, t) => {
|
|
245
254
|
r("select", e, t), n.hideOnSelect && (s.value = !1);
|
|
246
|
-
},
|
|
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
|
|
260
|
-
document.addEventListener("click",
|
|
261
|
-
}),
|
|
262
|
-
document.removeEventListener("click",
|
|
263
|
-
}), (e, t) => (
|
|
264
|
-
|
|
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:
|
|
268
|
-
onContextmenu:
|
|
269
|
-
}, [
|
|
270
|
-
(
|
|
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:
|
|
275
|
-
style:
|
|
276
|
-
onContextmenu: t[0] ||=
|
|
277
|
-
}, [
|
|
278
|
-
(
|
|
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:
|
|
289
|
+
class: A(K(i)("mask")),
|
|
281
290
|
onClick: d,
|
|
282
|
-
onContextmenu:
|
|
283
|
-
}, null, 34)) :
|
|
291
|
+
onContextmenu: Y(d, ["prevent"])
|
|
292
|
+
}, null, 34)) : _("", !0)]))
|
|
284
293
|
], 64));
|
|
285
294
|
}
|
|
286
|
-
}),
|
|
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 =
|
|
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) => (
|
|
319
|
-
class:
|
|
320
|
-
[
|
|
321
|
-
[
|
|
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:
|
|
325
|
-
}, [e.icon ? (
|
|
333
|
+
onContextmenu: Y(s, ["prevent", "stop"])
|
|
334
|
+
}, [e.icon ? (F(), v("span", {
|
|
326
335
|
key: 0,
|
|
327
|
-
class:
|
|
328
|
-
},
|
|
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
|
-
}),
|
|
339
|
+
}), Fe = Pe, Ie = /* @__PURE__ */ C({
|
|
331
340
|
__name: "ContextMenuGroup",
|
|
332
341
|
props: { title: {} },
|
|
333
342
|
setup(e) {
|
|
334
|
-
let t =
|
|
335
|
-
return (e, n) => (
|
|
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:
|
|
338
|
-
},
|
|
346
|
+
class: A(K(t)("title"))
|
|
347
|
+
}, H(e.title), 3)) : _("", !0), B(e.$slots, "default")], 2));
|
|
339
348
|
}
|
|
340
|
-
}),
|
|
349
|
+
}), Le = Ie, Re = /* @__PURE__ */ C({
|
|
341
350
|
__name: "ContextMenuDivider",
|
|
342
351
|
setup(e) {
|
|
343
|
-
return (e, t) => (
|
|
352
|
+
return (e, t) => (F(), v("div", { class: A(K(X)("context-menu-divider")) }, null, 2));
|
|
344
353
|
}
|
|
345
|
-
}),
|
|
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 =
|
|
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 =
|
|
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 || (
|
|
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 && (
|
|
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,
|
|
387
|
+
n.disabled || (m = !0, g(), f = setTimeout(() => {
|
|
379
388
|
b();
|
|
380
389
|
}, 150));
|
|
381
390
|
}, w = () => {
|
|
382
391
|
m = !1, x();
|
|
383
|
-
},
|
|
384
|
-
h = !0,
|
|
392
|
+
}, T = () => {
|
|
393
|
+
h = !0, g();
|
|
385
394
|
}, D = () => {
|
|
386
395
|
h = !1, x();
|
|
387
|
-
},
|
|
396
|
+
}, O = (e, t) => {
|
|
388
397
|
l.value = !1, r("select", e, t), d && d(e, t);
|
|
389
|
-
},
|
|
398
|
+
}, N = (e) => {
|
|
390
399
|
let { value: t, originalEvent: n } = e.detail;
|
|
391
|
-
|
|
392
|
-
},
|
|
400
|
+
O(t, n);
|
|
401
|
+
}, z = (e) => {
|
|
393
402
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
394
|
-
},
|
|
403
|
+
}, V = (e) => {
|
|
395
404
|
e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation();
|
|
396
|
-
},
|
|
397
|
-
if (!n.disabled) if (e.stopPropagation(), e.preventDefault(),
|
|
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,
|
|
409
|
+
u.left = "100%", u.top = "0px", l.value = !0, k(() => {
|
|
401
410
|
S();
|
|
402
411
|
});
|
|
403
412
|
}
|
|
404
413
|
};
|
|
405
|
-
|
|
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
|
-
},
|
|
425
|
+
}, G = (e) => {
|
|
417
426
|
l.value && (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
|
|
418
427
|
};
|
|
419
|
-
return
|
|
420
|
-
document.addEventListener("click", U), document.addEventListener("mousedown", U), document.addEventListener("keydown", W), document.addEventListener("contextmenu",
|
|
421
|
-
}),
|
|
422
|
-
|
|
423
|
-
}), (e, t) => (
|
|
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:
|
|
427
|
-
|
|
428
|
-
|
|
435
|
+
class: A([
|
|
436
|
+
K(i)(),
|
|
437
|
+
K(a)(),
|
|
429
438
|
{
|
|
430
|
-
[
|
|
431
|
-
[
|
|
439
|
+
[K(i)("disabled")]: e.disabled,
|
|
440
|
+
[K(a)("active")]: l.value
|
|
432
441
|
}
|
|
433
442
|
]),
|
|
434
|
-
onContextmenu:
|
|
443
|
+
onContextmenu: Y(z, ["prevent", "stop"]),
|
|
435
444
|
onMouseenter: C,
|
|
436
445
|
onMouseleave: w,
|
|
437
|
-
onClick:
|
|
446
|
+
onClick: ee
|
|
438
447
|
}, [
|
|
439
|
-
e.icon ? (
|
|
448
|
+
e.icon ? (F(), v("span", {
|
|
440
449
|
key: 0,
|
|
441
|
-
class:
|
|
442
|
-
},
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
l.value ? (
|
|
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:
|
|
450
|
-
style:
|
|
451
|
-
onContextmenu:
|
|
452
|
-
onMouseenter:
|
|
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:
|
|
455
|
-
}, [
|
|
463
|
+
onContextMenuSelect: N
|
|
464
|
+
}, [B(e.$slots, "default")], 38)) : _("", !0)
|
|
456
465
|
], 34));
|
|
457
466
|
}
|
|
458
|
-
}),
|
|
467
|
+
}), Ve = Be, He = /* @__PURE__ */ C({
|
|
459
468
|
__name: "WebLayout",
|
|
460
469
|
setup(e) {
|
|
461
470
|
return (e, t) => {
|
|
462
|
-
let n = a, r =
|
|
463
|
-
return
|
|
464
|
-
header:
|
|
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
|
-
},
|
|
476
|
+
}, b({ _: 2 }, [e.$slots.logo ? {
|
|
468
477
|
name: "logo",
|
|
469
|
-
fn:
|
|
478
|
+
fn: J(() => [B(e.$slots, "logo")]),
|
|
470
479
|
key: "0"
|
|
471
480
|
} : void 0, e.$slots.operations ? {
|
|
472
481
|
name: "operations",
|
|
473
|
-
fn:
|
|
482
|
+
fn: J(() => [B(e.$slots, "operations")]),
|
|
474
483
|
key: "1"
|
|
475
484
|
} : void 0]), 1024)]),
|
|
476
|
-
left:
|
|
477
|
-
default:
|
|
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
|
-
}),
|
|
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 } =
|
|
504
|
-
|
|
505
|
-
e !== void 0 && (
|
|
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 =
|
|
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 =
|
|
527
|
+
}]), w = h(() => [p, {
|
|
519
528
|
[`${p}-horizontal`]: S.value,
|
|
520
529
|
[`${p}-vertical`]: !S.value,
|
|
521
530
|
[`${p}-disabled`]: n.disabled
|
|
522
|
-
}]), T =
|
|
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
|
|
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
|
|
550
|
+
return (!u.value || !e()) && await k(), e();
|
|
542
551
|
}
|
|
543
|
-
function
|
|
552
|
+
function P(e, t) {
|
|
544
553
|
if (!t) return;
|
|
545
554
|
let n = x.value.isPx ? `${e}px` : D(e, t);
|
|
546
|
-
|
|
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
|
|
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
|
|
579
|
+
function z(e) {
|
|
571
580
|
r("moving", e);
|
|
572
|
-
let t = S.value ?
|
|
573
|
-
startContainerSize:
|
|
574
|
-
startSize:
|
|
575
|
-
startPosition:
|
|
581
|
+
let t = S.value ? L({
|
|
582
|
+
startContainerSize: O.startContainerSize,
|
|
583
|
+
startSize: O.startSize,
|
|
584
|
+
startPosition: O.startPageX,
|
|
576
585
|
endPosition: e.pageX
|
|
577
|
-
}) :
|
|
578
|
-
startContainerSize:
|
|
579
|
-
startSize:
|
|
580
|
-
startPosition:
|
|
586
|
+
}) : L({
|
|
587
|
+
startContainerSize: O.startContainerSize,
|
|
588
|
+
startSize: O.startSize,
|
|
589
|
+
startPosition: O.startPageY,
|
|
581
590
|
endPosition: e.pageY
|
|
582
591
|
});
|
|
583
|
-
|
|
592
|
+
P(t, O.startContainerSize);
|
|
584
593
|
}
|
|
585
594
|
function V(e) {
|
|
586
|
-
window.removeEventListener("mousemove",
|
|
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),
|
|
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
|
|
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
|
|
598
|
-
let e = await N(), t = I(
|
|
599
|
-
|
|
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
|
-
|
|
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) => (
|
|
617
|
+
}), (e, t) => (F(), g(ee(e.component), {
|
|
609
618
|
ref_key: "wrapperRef",
|
|
610
619
|
ref: u,
|
|
611
|
-
class:
|
|
620
|
+
class: A(C.value)
|
|
612
621
|
}, {
|
|
613
|
-
default:
|
|
614
|
-
|
|
615
|
-
class:
|
|
616
|
-
style:
|
|
617
|
-
}, [
|
|
618
|
-
e.disabled ?
|
|
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:
|
|
631
|
+
class: A(w.value),
|
|
623
632
|
onMousedown: H
|
|
624
|
-
}, [
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
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
|
-
|
|
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
|
-
}),
|
|
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
|
|
640
|
-
default:
|
|
641
|
-
default:
|
|
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
|
-
}),
|
|
644
|
-
default:
|
|
645
|
-
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
|
-
}),
|
|
655
|
-
const
|
|
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
|
|
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 =
|
|
677
|
+
let n = re("leftMenuRef"), r = R(!0);
|
|
669
678
|
return (e, i) => {
|
|
670
|
-
let a = t, o =
|
|
671
|
-
return
|
|
672
|
-
left:
|
|
673
|
-
class:
|
|
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
|
-
}, [
|
|
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:
|
|
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:
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
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
|
-
}),
|
|
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 =
|
|
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 =
|
|
719
|
+
}), o = h(() => de("onBack"));
|
|
711
720
|
return (e, t) => {
|
|
712
721
|
let c = s, l = n, u = i;
|
|
713
|
-
return
|
|
714
|
-
o.value || e.$slots.prefix ?
|
|
715
|
-
class:
|
|
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:
|
|
729
|
+
icon: J(() => [S(c, { class: "i-u-left" })]),
|
|
721
730
|
_: 1
|
|
722
|
-
}, 8, ["class"])]) :
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
class:
|
|
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
|
-
|
|
729
|
-
], 2), e.$slots.extra ? (
|
|
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:
|
|
732
|
-
}, [
|
|
740
|
+
class: A(K(r)("extra"))
|
|
741
|
+
}, [B(e.$slots, "extra")], 2)) : _("", !0)], 2);
|
|
733
742
|
};
|
|
734
743
|
}
|
|
735
|
-
}),
|
|
736
|
-
const
|
|
737
|
-
var
|
|
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 =
|
|
757
|
+
let t = te(), n = h(() => "onClick" in t || "onClickCapture" in t), r = h(() => {
|
|
749
758
|
let e = [];
|
|
750
|
-
return e.push(
|
|
759
|
+
return e.push(X("setting-item")), n.value && e.push("cursor-pointer"), e;
|
|
751
760
|
});
|
|
752
|
-
return (e, t) => (
|
|
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
|
-
}),
|
|
763
|
+
}), ot = at, st = /* @__PURE__ */ C({
|
|
755
764
|
__name: "SettingDivision",
|
|
756
765
|
setup(e) {
|
|
757
|
-
return (e, t) => (
|
|
766
|
+
return (e, t) => (F(), v("div", { class: A(K(X)("setting-division")) }, null, 2));
|
|
758
767
|
}
|
|
759
|
-
}),
|
|
760
|
-
const
|
|
761
|
-
var
|
|
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) => (
|
|
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
|
-
}),
|
|
768
|
-
export {
|
|
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 };
|