@gx-design-vue/pro-layout-components 0.1.0-alpha.4 → 0.1.0-alpha.5
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/RightContent/Search/Panel.js +5 -2
- package/dist/RightContent/Search/index.js +10 -6
- package/dist/RightContent/index.js +12 -8
- package/dist/RightContent/themeOptions.js +5 -3
- package/dist/pro-layout-components.esm.js +229 -699
- package/dist/pro-layout-components.js +1 -1
- package/package.json +10 -11
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createTextVNode as n, createVNode as r,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { Avatar as
|
|
7
|
-
import { useBaseConfig as
|
|
8
|
-
import
|
|
9
|
-
import { GProModal as
|
|
10
|
-
import { proGenStyleHooks as
|
|
11
|
-
import { useRouter as
|
|
1
|
+
import { Fragment as e, computed as t, createTextVNode as n, createVNode as r, defineComponent as i, h as a, mergeProps as o, nextTick as s, onMounted as c, ref as l, unref as u, watch as d } from "vue";
|
|
2
|
+
import { useThemeContext as f } from "@gx-design-vue/context";
|
|
3
|
+
import { GIcon as p } from "@gx-design-vue/icon";
|
|
4
|
+
import { useInjectLayoutContext as m } from "@gx-design-vue/pro-layout";
|
|
5
|
+
import { onKeyStroke as h, useElementSize as g, useFullscreen as _, useLocalStorage as v, useMagicKeys as y, useThrottleFn as b, whenever as x } from "@vueuse/core";
|
|
6
|
+
import { Avatar as S, Dropdown as C, Empty as w, Input as T } from "antdv-next";
|
|
7
|
+
import { useBaseConfig as E } from "antdv-next/config-provider/context";
|
|
8
|
+
import D from "antdv-next/config-provider/hooks/useCSSVarCls";
|
|
9
|
+
import { GProModal as O } from "@gx-design-vue/pro-modal";
|
|
10
|
+
import { proGenStyleHooks as k, useProConfigContext as A } from "@gx-design-vue/pro-provider";
|
|
11
|
+
import { useRouter as j } from "vue-router";
|
|
12
12
|
//#region ../pro-utils/dist/is/device.js
|
|
13
|
-
function
|
|
13
|
+
function M() {
|
|
14
14
|
return typeof navigator > "u" ? !1 : /windows|win32/i.test(navigator.userAgent);
|
|
15
15
|
}
|
|
16
16
|
//#endregion
|
|
17
17
|
//#region ../pro-utils/dist/is/type.js
|
|
18
|
-
function
|
|
18
|
+
function N(e, t) {
|
|
19
19
|
return Object.prototype.toString.call(e) === `[object ${t}]`;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function P(e) {
|
|
22
22
|
return Array.isArray === void 0 ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return e !== null &&
|
|
24
|
+
function F(e) {
|
|
25
|
+
return e !== null && N(e, "Object");
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function I(e) {
|
|
28
28
|
return typeof e == "string";
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region ../pro-utils/dist/is/url.js
|
|
32
|
-
function
|
|
32
|
+
function L(e) {
|
|
33
33
|
if (!e || !e.startsWith("http")) return !1;
|
|
34
34
|
try {
|
|
35
35
|
return !!new URL(e);
|
|
@@ -39,524 +39,38 @@ function ge(e) {
|
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region ../pro-utils/dist/array/tree.js
|
|
42
|
-
function
|
|
42
|
+
function R(e, t = "children") {
|
|
43
43
|
let n = [];
|
|
44
44
|
return e.forEach((e) => {
|
|
45
|
-
n.push(e),
|
|
45
|
+
n.push(e), P(e[t]) && e[t].length > 0 && (n = n.concat(R(e[t], t)));
|
|
46
46
|
}), n;
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region ../pro-utils/dist/class/prefix.js
|
|
50
|
-
function
|
|
50
|
+
function z({ suffixCls: e, customizePrefixCls: t, isPro: n, className: r }) {
|
|
51
51
|
let i = r || (n ? "gx-pro" : "gx");
|
|
52
52
|
return t || (e ? `${i}-${e}` : i);
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region ../pro-utils/dist/object/classNames.js
|
|
56
|
-
function
|
|
56
|
+
function B(...e) {
|
|
57
57
|
let t = [];
|
|
58
58
|
for (let n = 0; n < e.length; n++) {
|
|
59
59
|
let r = e[n];
|
|
60
60
|
if (r) {
|
|
61
|
-
if (
|
|
62
|
-
else if (
|
|
63
|
-
let n =
|
|
61
|
+
if (I(r)) t.push(r);
|
|
62
|
+
else if (P(r)) for (let e = 0; e < r.length; e++) {
|
|
63
|
+
let n = B(r[e]);
|
|
64
64
|
n && t.push(n);
|
|
65
65
|
}
|
|
66
|
-
else if (
|
|
66
|
+
else if (F(r)) for (let e in r) r[e] && t.push(e);
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
return t.filter((e) => e).join(" ");
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
|
-
//#region ../../node_modules/.pnpm/@vueuse+shared@14.3.0_vue@3.5.27_typescript@6.0.3_/node_modules/@vueuse/shared/dist/index.js
|
|
73
|
-
function ye(e, t) {
|
|
74
|
-
return s() ? (p(e, t), !0) : !1;
|
|
75
|
-
}
|
|
76
|
-
var L = typeof window < "u" && typeof document < "u";
|
|
77
|
-
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
|
|
78
|
-
var be = Object.prototype.toString, xe = (e) => be.call(e) === "[object Object]", R = () => {};
|
|
79
|
-
function Se(...e) {
|
|
80
|
-
if (e.length !== 1) return y(...e);
|
|
81
|
-
let t = e[0];
|
|
82
|
-
return typeof t == "function" ? h(i(() => ({
|
|
83
|
-
get: t,
|
|
84
|
-
set: R
|
|
85
|
-
}))) : g(t);
|
|
86
|
-
}
|
|
87
|
-
function Ce(e, t) {
|
|
88
|
-
function n(...n) {
|
|
89
|
-
return new Promise((r, i) => {
|
|
90
|
-
Promise.resolve(e(() => t.apply(this, n), {
|
|
91
|
-
fn: t,
|
|
92
|
-
thisArg: this,
|
|
93
|
-
args: n
|
|
94
|
-
})).then(r).catch(i);
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
return n;
|
|
98
|
-
}
|
|
99
|
-
var z = (e) => e();
|
|
100
|
-
function we(...e) {
|
|
101
|
-
let t = 0, n, r = !0, i = R, a, o, s, c, u;
|
|
102
|
-
!l(e[0]) && typeof e[0] == "object" ? {delay: o, trailing: s = !0, leading: c = !0, rejectOnCancel: u = !1} = e[0] : [o, s = !0, c = !0, u = !1] = e;
|
|
103
|
-
let d = () => {
|
|
104
|
-
n && (clearTimeout(n), n = void 0, i(), i = R);
|
|
105
|
-
};
|
|
106
|
-
return (e) => {
|
|
107
|
-
let l = b(o), f = Date.now() - t, p = () => a = e();
|
|
108
|
-
return d(), l <= 0 ? (t = Date.now(), p()) : (f > l ? (t = Date.now(), (c || !r) && p()) : s && (a = new Promise((e, a) => {
|
|
109
|
-
i = u ? a : e, n = setTimeout(() => {
|
|
110
|
-
t = Date.now(), r = !0, e(p()), d();
|
|
111
|
-
}, Math.max(0, l - f));
|
|
112
|
-
})), !c && !n && (n = setTimeout(() => r = !0, l)), r = !1, a);
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
function Te(e = z, t = {}) {
|
|
116
|
-
let { initialState: n = "active" } = t, r = Se(n === "active");
|
|
117
|
-
function i() {
|
|
118
|
-
r.value = !1;
|
|
119
|
-
}
|
|
120
|
-
function a() {
|
|
121
|
-
r.value = !0;
|
|
122
|
-
}
|
|
123
|
-
return {
|
|
124
|
-
isActive: _(r),
|
|
125
|
-
pause: i,
|
|
126
|
-
resume: a,
|
|
127
|
-
eventFilter: (...t) => {
|
|
128
|
-
r.value && e(...t);
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
function B(e) {
|
|
133
|
-
return Array.isArray(e) ? e : [e];
|
|
134
|
-
}
|
|
135
|
-
function Ee(e) {
|
|
136
|
-
return e || o();
|
|
137
|
-
}
|
|
138
|
-
function De(e, t = 200, n = !1, r = !0, i = !1) {
|
|
139
|
-
return Ce(we(t, n, r, i), e);
|
|
140
|
-
}
|
|
141
|
-
function Oe(e, t, n = {}) {
|
|
142
|
-
let { eventFilter: r = z, ...i } = n;
|
|
143
|
-
return S(e, Ce(r, t), i);
|
|
144
|
-
}
|
|
145
|
-
function ke(e, t, n = {}) {
|
|
146
|
-
let { eventFilter: r, initialState: i = "active", ...a } = n, { eventFilter: o, pause: s, resume: c, isActive: l } = Te(r, { initialState: i });
|
|
147
|
-
return {
|
|
148
|
-
stop: Oe(e, t, {
|
|
149
|
-
...a,
|
|
150
|
-
eventFilter: o
|
|
151
|
-
}),
|
|
152
|
-
pause: s,
|
|
153
|
-
resume: c,
|
|
154
|
-
isActive: l
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
function V(e, t = !0, n) {
|
|
158
|
-
Ee(n) ? f(e, n) : t ? e() : d(e);
|
|
159
|
-
}
|
|
160
|
-
function Ae(e, t, n) {
|
|
161
|
-
return S(e, t, {
|
|
162
|
-
...n,
|
|
163
|
-
immediate: !0
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
function H(e, t, n) {
|
|
167
|
-
let r = S(e, (e, i, a) => {
|
|
168
|
-
e && (n?.once && d(() => r()), t(e, i, a));
|
|
169
|
-
}, {
|
|
170
|
-
...n,
|
|
171
|
-
once: !1
|
|
172
|
-
});
|
|
173
|
-
return r;
|
|
174
|
-
}
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region ../../node_modules/.pnpm/@vueuse+core@14.3.0_vue@3.5.27_typescript@6.0.3_/node_modules/@vueuse/core/dist/index.js
|
|
177
|
-
var U = L ? window : void 0, je = L ? window.document : void 0;
|
|
178
|
-
L && window.navigator, L && window.location;
|
|
179
|
-
function W(e) {
|
|
180
|
-
let t = b(e);
|
|
181
|
-
return t?.$el ?? t;
|
|
182
|
-
}
|
|
183
|
-
function G(...e) {
|
|
184
|
-
let n = (e, t, n, r) => (e.addEventListener(t, n, r), () => e.removeEventListener(t, n, r)), r = t(() => {
|
|
185
|
-
let t = B(b(e[0])).filter((e) => e != null);
|
|
186
|
-
return t.every((e) => typeof e != "string") ? t : void 0;
|
|
187
|
-
});
|
|
188
|
-
return Ae(() => [
|
|
189
|
-
r.value?.map((e) => W(e)) ?? [U].filter((e) => e != null),
|
|
190
|
-
B(b(r.value ? e[1] : e[0])),
|
|
191
|
-
B(x(r.value ? e[2] : e[1])),
|
|
192
|
-
b(r.value ? e[3] : e[2])
|
|
193
|
-
], ([e, t, r, i], a, o) => {
|
|
194
|
-
if (!e?.length || !t?.length || !r?.length) return;
|
|
195
|
-
let s = xe(i) ? { ...i } : i, c = e.flatMap((e) => t.flatMap((t) => r.map((r) => n(e, t, r, s))));
|
|
196
|
-
o(() => {
|
|
197
|
-
c.forEach((e) => e());
|
|
198
|
-
});
|
|
199
|
-
}, { flush: "post" });
|
|
200
|
-
}
|
|
201
|
-
function Me() {
|
|
202
|
-
let e = v(!1), t = o();
|
|
203
|
-
return t && f(() => {
|
|
204
|
-
e.value = !0;
|
|
205
|
-
}, t), e;
|
|
206
|
-
}
|
|
207
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
208
|
-
function Ne(e) {
|
|
209
|
-
let n = Me();
|
|
210
|
-
return t(() => (n.value, !!e()));
|
|
211
|
-
}
|
|
212
|
-
function Pe(e) {
|
|
213
|
-
return typeof e == "function" ? e : typeof e == "string" ? (t) => t.key === e : Array.isArray(e) ? (t) => e.includes(t.key) : () => !0;
|
|
214
|
-
}
|
|
215
|
-
function K(...e) {
|
|
216
|
-
let t, n, r = {};
|
|
217
|
-
e.length === 3 ? (t = e[0], n = e[1], r = e[2]) : e.length === 2 ? typeof e[1] == "object" ? (t = !0, n = e[0], r = e[1]) : (t = e[0], n = e[1]) : (t = !0, n = e[0]);
|
|
218
|
-
let { target: i = U, eventName: a = "keydown", passive: o = !1, dedupe: s = !1 } = r, c = Pe(t);
|
|
219
|
-
return G(i, a, (e) => {
|
|
220
|
-
e.repeat && b(s) || c(e) && n(e);
|
|
221
|
-
}, o);
|
|
222
|
-
}
|
|
223
|
-
var q = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, J = "__vueuse_ssr_handlers__", Fe = /* @__PURE__ */ Ie();
|
|
224
|
-
function Ie() {
|
|
225
|
-
return J in q || (q[J] = q[J] || {}), q[J];
|
|
226
|
-
}
|
|
227
|
-
function Le(e, t) {
|
|
228
|
-
return Fe[e] || t;
|
|
229
|
-
}
|
|
230
|
-
function Re(e) {
|
|
231
|
-
return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
|
|
232
|
-
}
|
|
233
|
-
var ze = {
|
|
234
|
-
boolean: {
|
|
235
|
-
read: (e) => e === "true",
|
|
236
|
-
write: (e) => String(e)
|
|
237
|
-
},
|
|
238
|
-
object: {
|
|
239
|
-
read: (e) => JSON.parse(e),
|
|
240
|
-
write: (e) => JSON.stringify(e)
|
|
241
|
-
},
|
|
242
|
-
number: {
|
|
243
|
-
read: (e) => Number.parseFloat(e),
|
|
244
|
-
write: (e) => String(e)
|
|
245
|
-
},
|
|
246
|
-
any: {
|
|
247
|
-
read: (e) => e,
|
|
248
|
-
write: (e) => String(e)
|
|
249
|
-
},
|
|
250
|
-
string: {
|
|
251
|
-
read: (e) => e,
|
|
252
|
-
write: (e) => String(e)
|
|
253
|
-
},
|
|
254
|
-
map: {
|
|
255
|
-
read: (e) => new Map(JSON.parse(e)),
|
|
256
|
-
write: (e) => JSON.stringify(Array.from(e.entries()))
|
|
257
|
-
},
|
|
258
|
-
set: {
|
|
259
|
-
read: (e) => new Set(JSON.parse(e)),
|
|
260
|
-
write: (e) => JSON.stringify(Array.from(e))
|
|
261
|
-
},
|
|
262
|
-
date: {
|
|
263
|
-
read: (e) => new Date(e),
|
|
264
|
-
write: (e) => e.toISOString()
|
|
265
|
-
}
|
|
266
|
-
}, Be = "vueuse-storage";
|
|
267
|
-
function Ve(e, n, r, i = {}) {
|
|
268
|
-
let { flush: a = "pre", deep: o = !0, listenToStorageChanges: s = !0, writeDefaults: c = !0, mergeDefaults: l = !1, shallow: u, window: f = U, eventFilter: p, onError: m = (e) => {
|
|
269
|
-
console.error(e);
|
|
270
|
-
}, initOnMounted: h } = i, _ = (u ? v : g)(typeof n == "function" ? n() : n), y = t(() => b(e));
|
|
271
|
-
if (!r) try {
|
|
272
|
-
r = Le("getDefaultStorage", () => U?.localStorage)();
|
|
273
|
-
} catch (e) {
|
|
274
|
-
m(e);
|
|
275
|
-
}
|
|
276
|
-
if (!r) return _;
|
|
277
|
-
let x = b(n), C = Re(x), w = i.serializer ?? ze[C], { pause: ee, resume: T } = ke(_, (e) => te(e), {
|
|
278
|
-
flush: a,
|
|
279
|
-
deep: o,
|
|
280
|
-
eventFilter: p
|
|
281
|
-
});
|
|
282
|
-
S(y, () => k(), { flush: a });
|
|
283
|
-
let E = !1;
|
|
284
|
-
f && s && (r instanceof Storage ? G(f, "storage", (e) => {
|
|
285
|
-
h && !E || k(e);
|
|
286
|
-
}, { passive: !0 }) : G(f, Be, (e) => {
|
|
287
|
-
h && !E || ne(e);
|
|
288
|
-
})), h ? V(() => {
|
|
289
|
-
E = !0, k();
|
|
290
|
-
}) : k();
|
|
291
|
-
function D(e, t) {
|
|
292
|
-
if (f) {
|
|
293
|
-
let n = {
|
|
294
|
-
key: y.value,
|
|
295
|
-
oldValue: e,
|
|
296
|
-
newValue: t,
|
|
297
|
-
storageArea: r
|
|
298
|
-
};
|
|
299
|
-
f.dispatchEvent(r instanceof Storage ? new StorageEvent("storage", n) : new CustomEvent(Be, { detail: n }));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
302
|
-
function te(e) {
|
|
303
|
-
try {
|
|
304
|
-
let t = r.getItem(y.value);
|
|
305
|
-
if (e == null) D(t, null), r.removeItem(y.value);
|
|
306
|
-
else {
|
|
307
|
-
let n = w.write(e);
|
|
308
|
-
t !== n && (r.setItem(y.value, n), D(t, n));
|
|
309
|
-
}
|
|
310
|
-
} catch (e) {
|
|
311
|
-
m(e);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
function O(e) {
|
|
315
|
-
let t = e ? e.newValue : r.getItem(y.value);
|
|
316
|
-
if (t == null) return c && x != null && r.setItem(y.value, w.write(x)), x;
|
|
317
|
-
if (!e && l) {
|
|
318
|
-
let e = w.read(t);
|
|
319
|
-
return typeof l == "function" ? l(e, x) : C === "object" && !Array.isArray(e) ? {
|
|
320
|
-
...x,
|
|
321
|
-
...e
|
|
322
|
-
} : e;
|
|
323
|
-
} else if (typeof t != "string") return t;
|
|
324
|
-
else return w.read(t);
|
|
325
|
-
}
|
|
326
|
-
function k(e) {
|
|
327
|
-
if (!(e && e.storageArea !== r)) {
|
|
328
|
-
if (e && e.key == null) {
|
|
329
|
-
_.value = x;
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
if (!(e && e.key !== y.value)) {
|
|
333
|
-
ee();
|
|
334
|
-
try {
|
|
335
|
-
let t = w.write(_.value);
|
|
336
|
-
(e === void 0 || e?.newValue !== t) && (_.value = O(e));
|
|
337
|
-
} catch (e) {
|
|
338
|
-
m(e);
|
|
339
|
-
} finally {
|
|
340
|
-
e ? d(T) : T();
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
function ne(e) {
|
|
346
|
-
k(e.detail);
|
|
347
|
-
}
|
|
348
|
-
return _;
|
|
349
|
-
}
|
|
350
|
-
function He(e, n, r = {}) {
|
|
351
|
-
let { window: i = U, ...a } = r, o, s = /* @__PURE__ */ Ne(() => i && "ResizeObserver" in i), c = () => {
|
|
352
|
-
o &&= (o.disconnect(), void 0);
|
|
353
|
-
}, l = S(t(() => {
|
|
354
|
-
let t = b(e);
|
|
355
|
-
return Array.isArray(t) ? t.map((e) => W(e)) : [W(t)];
|
|
356
|
-
}), (e) => {
|
|
357
|
-
if (c(), s.value && i) {
|
|
358
|
-
o = new ResizeObserver(n);
|
|
359
|
-
for (let t of e) t && o.observe(t, a);
|
|
360
|
-
}
|
|
361
|
-
}, {
|
|
362
|
-
immediate: !0,
|
|
363
|
-
flush: "post"
|
|
364
|
-
}), u = () => {
|
|
365
|
-
c(), l();
|
|
366
|
-
};
|
|
367
|
-
return ye(u), {
|
|
368
|
-
isSupported: s,
|
|
369
|
-
stop: u
|
|
370
|
-
};
|
|
371
|
-
}
|
|
372
|
-
function Ue(e, n = {
|
|
373
|
-
width: 0,
|
|
374
|
-
height: 0
|
|
375
|
-
}, r = {}) {
|
|
376
|
-
let { window: i = U, box: a = "content-box" } = r, o = t(() => {
|
|
377
|
-
var t;
|
|
378
|
-
return (t = W(e)) == null || (t = t.namespaceURI) == null ? void 0 : t.includes("svg");
|
|
379
|
-
}), s = v(n.width), c = v(n.height), { stop: l } = He(e, ([t]) => {
|
|
380
|
-
let n = a === "border-box" ? t.borderBoxSize : a === "content-box" ? t.contentBoxSize : t.devicePixelContentBoxSize;
|
|
381
|
-
if (i && o.value) {
|
|
382
|
-
let t = W(e);
|
|
383
|
-
if (t) {
|
|
384
|
-
let e = t.getBoundingClientRect();
|
|
385
|
-
s.value = e.width, c.value = e.height;
|
|
386
|
-
}
|
|
387
|
-
} else if (n) {
|
|
388
|
-
let e = B(n);
|
|
389
|
-
s.value = e.reduce((e, { inlineSize: t }) => e + t, 0), c.value = e.reduce((e, { blockSize: t }) => e + t, 0);
|
|
390
|
-
} else s.value = t.contentRect.width, c.value = t.contentRect.height;
|
|
391
|
-
}, r);
|
|
392
|
-
V(() => {
|
|
393
|
-
let t = W(e);
|
|
394
|
-
t && (s.value = "offsetWidth" in t ? t.offsetWidth : n.width, c.value = "offsetHeight" in t ? t.offsetHeight : n.height);
|
|
395
|
-
});
|
|
396
|
-
let u = S(() => W(e), (e) => {
|
|
397
|
-
s.value = e ? n.width : 0, c.value = e ? n.height : 0;
|
|
398
|
-
});
|
|
399
|
-
function d() {
|
|
400
|
-
l(), u();
|
|
401
|
-
}
|
|
402
|
-
return {
|
|
403
|
-
width: s,
|
|
404
|
-
height: c,
|
|
405
|
-
stop: d
|
|
406
|
-
};
|
|
407
|
-
}
|
|
408
|
-
var We = [
|
|
409
|
-
"fullscreenchange",
|
|
410
|
-
"webkitfullscreenchange",
|
|
411
|
-
"webkitendfullscreen",
|
|
412
|
-
"mozfullscreenchange",
|
|
413
|
-
"MSFullscreenChange"
|
|
414
|
-
];
|
|
415
|
-
function Ge(e, n = {}) {
|
|
416
|
-
let { document: r = je, autoExit: i = !1 } = n, a = t(() => W(e) ?? r?.documentElement), o = v(!1), s = t(() => [
|
|
417
|
-
"requestFullscreen",
|
|
418
|
-
"webkitRequestFullscreen",
|
|
419
|
-
"webkitEnterFullscreen",
|
|
420
|
-
"webkitEnterFullScreen",
|
|
421
|
-
"webkitRequestFullScreen",
|
|
422
|
-
"mozRequestFullScreen",
|
|
423
|
-
"msRequestFullscreen"
|
|
424
|
-
].find((e) => r && e in r || a.value && e in a.value)), c = t(() => [
|
|
425
|
-
"exitFullscreen",
|
|
426
|
-
"webkitExitFullscreen",
|
|
427
|
-
"webkitExitFullScreen",
|
|
428
|
-
"webkitCancelFullScreen",
|
|
429
|
-
"mozCancelFullScreen",
|
|
430
|
-
"msExitFullscreen"
|
|
431
|
-
].find((e) => r && e in r || a.value && e in a.value)), l = t(() => [
|
|
432
|
-
"fullScreen",
|
|
433
|
-
"webkitIsFullScreen",
|
|
434
|
-
"webkitDisplayingFullscreen",
|
|
435
|
-
"mozFullScreen",
|
|
436
|
-
"msFullscreenElement"
|
|
437
|
-
].find((e) => r && e in r || a.value && e in a.value)), u = [
|
|
438
|
-
"fullscreenElement",
|
|
439
|
-
"webkitFullscreenElement",
|
|
440
|
-
"mozFullScreenElement",
|
|
441
|
-
"msFullscreenElement"
|
|
442
|
-
].find((e) => r && e in r), d = /* @__PURE__ */ Ne(() => a.value && r && s.value !== void 0 && c.value !== void 0 && l.value !== void 0), f = () => u ? r?.[u] === a.value : !1, p = () => {
|
|
443
|
-
if (l.value) {
|
|
444
|
-
if (r && r[l.value] != null) return r[l.value];
|
|
445
|
-
{
|
|
446
|
-
let e = a.value;
|
|
447
|
-
if (e?.[l.value] != null) return !!e[l.value];
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
return !1;
|
|
451
|
-
};
|
|
452
|
-
async function m() {
|
|
453
|
-
if (!(!d.value || !o.value)) {
|
|
454
|
-
if (c.value) if (r?.[c.value] != null) await r[c.value]();
|
|
455
|
-
else {
|
|
456
|
-
let e = a.value;
|
|
457
|
-
e?.[c.value] != null && await e[c.value]();
|
|
458
|
-
}
|
|
459
|
-
o.value = !1;
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
async function h() {
|
|
463
|
-
if (!d.value || o.value) return;
|
|
464
|
-
p() && await m();
|
|
465
|
-
let e = a.value;
|
|
466
|
-
s.value && e?.[s.value] != null && (await e[s.value](), o.value = !0);
|
|
467
|
-
}
|
|
468
|
-
async function g() {
|
|
469
|
-
await (o.value ? m() : h());
|
|
470
|
-
}
|
|
471
|
-
let _ = () => {
|
|
472
|
-
let e = p();
|
|
473
|
-
(!e || e && f()) && (o.value = e);
|
|
474
|
-
}, y = {
|
|
475
|
-
capture: !1,
|
|
476
|
-
passive: !0
|
|
477
|
-
};
|
|
478
|
-
return G(r, We, _, y), G(() => W(a), We, _, y), V(_, !1), i && ye(m), {
|
|
479
|
-
isSupported: d,
|
|
480
|
-
isFullscreen: o,
|
|
481
|
-
enter: h,
|
|
482
|
-
exit: m,
|
|
483
|
-
toggle: g
|
|
484
|
-
};
|
|
485
|
-
}
|
|
486
|
-
function Ke(e, t, n = {}) {
|
|
487
|
-
let { window: r = U } = n;
|
|
488
|
-
return Ve(e, t, r?.localStorage, n);
|
|
489
|
-
}
|
|
490
|
-
var qe = {
|
|
491
|
-
ctrl: "control",
|
|
492
|
-
command: "meta",
|
|
493
|
-
cmd: "meta",
|
|
494
|
-
option: "alt",
|
|
495
|
-
up: "arrowup",
|
|
496
|
-
down: "arrowdown",
|
|
497
|
-
left: "arrowleft",
|
|
498
|
-
right: "arrowright"
|
|
499
|
-
};
|
|
500
|
-
function Je(e = {}) {
|
|
501
|
-
let { reactive: n = !1, target: r = U, aliasMap: i = qe, passive: a = !0, onEventFired: o = R } = e, s = m(/* @__PURE__ */ new Set()), c = {
|
|
502
|
-
toJSON() {
|
|
503
|
-
return {};
|
|
504
|
-
},
|
|
505
|
-
current: s
|
|
506
|
-
}, l = n ? m(c) : c, u = /* @__PURE__ */ new Set(), d = new Map([
|
|
507
|
-
["Meta", u],
|
|
508
|
-
["Shift", /* @__PURE__ */ new Set()],
|
|
509
|
-
["Alt", /* @__PURE__ */ new Set()]
|
|
510
|
-
]), f = /* @__PURE__ */ new Set();
|
|
511
|
-
function p(e, t) {
|
|
512
|
-
e in l && (n ? l[e] = t : l[e].value = t);
|
|
513
|
-
}
|
|
514
|
-
function h() {
|
|
515
|
-
s.clear();
|
|
516
|
-
for (let e of f) p(e, !1);
|
|
517
|
-
}
|
|
518
|
-
function g(e, t, n) {
|
|
519
|
-
if (!(!e || typeof t.getModifierState != "function")) {
|
|
520
|
-
for (let [e, r] of d) if (t.getModifierState(e)) {
|
|
521
|
-
n.forEach((e) => r.add(e));
|
|
522
|
-
break;
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
function _(e, t) {
|
|
527
|
-
if (e) return;
|
|
528
|
-
let n = `${t[0].toUpperCase()}${t.slice(1)}`, r = d.get(n);
|
|
529
|
-
if (!["shift", "alt"].includes(t) || !r) return;
|
|
530
|
-
let i = Array.from(r), a = i.indexOf(t);
|
|
531
|
-
i.forEach((e, t) => {
|
|
532
|
-
t >= a && (s.delete(e), p(e, !1));
|
|
533
|
-
}), r.clear();
|
|
534
|
-
}
|
|
535
|
-
function y(e, t) {
|
|
536
|
-
let n = e.key?.toLowerCase(), r = [e.code?.toLowerCase(), n].filter(Boolean);
|
|
537
|
-
if (n) {
|
|
538
|
-
n && (t ? s.add(n) : s.delete(n));
|
|
539
|
-
for (let e of r) f.add(e), p(e, t);
|
|
540
|
-
g(t, e, [...s, ...r]), _(t, n), n === "meta" && !t && (u.forEach((e) => {
|
|
541
|
-
s.delete(e), p(e, !1);
|
|
542
|
-
}), u.clear());
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
G(r, "keydown", (e) => (y(e, !0), o(e)), { passive: a }), G(r, "keyup", (e) => (y(e, !1), o(e)), { passive: a }), G("blur", h, { passive: a }), G("focus", h, { passive: a });
|
|
546
|
-
let x = new Proxy(l, { get(e, r, a) {
|
|
547
|
-
if (typeof r != "string") return Reflect.get(e, r, a);
|
|
548
|
-
if (r = r.toLowerCase(), r in i && (r = i[r]), !(r in l)) if (/[+_-]/.test(r)) {
|
|
549
|
-
let e = r.split(/[+_-]/g).map((e) => e.trim());
|
|
550
|
-
l[r] = t(() => e.map((e) => b(x[e])).every(Boolean));
|
|
551
|
-
} else l[r] = v(!1);
|
|
552
|
-
let o = Reflect.get(e, r, a);
|
|
553
|
-
return n ? b(o) : o;
|
|
554
|
-
} });
|
|
555
|
-
return x;
|
|
556
|
-
}
|
|
557
|
-
//#endregion
|
|
558
72
|
//#region src/RightContent/locale.ts
|
|
559
|
-
var
|
|
73
|
+
var ee = {
|
|
560
74
|
searchPlaceholder: "搜索导航菜单",
|
|
561
75
|
searchLabel: "搜索",
|
|
562
76
|
searchShortcutLabel: "⌘ K",
|
|
@@ -573,38 +87,38 @@ var Ye = {
|
|
|
573
87
|
};
|
|
574
88
|
//#endregion
|
|
575
89
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
576
|
-
function
|
|
90
|
+
function V(e) {
|
|
577
91
|
return e == null || typeof e != "object" && typeof e != "function";
|
|
578
92
|
}
|
|
579
93
|
//#endregion
|
|
580
94
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
581
|
-
function
|
|
95
|
+
function H(e) {
|
|
582
96
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
583
97
|
}
|
|
584
98
|
//#endregion
|
|
585
99
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
586
|
-
function
|
|
100
|
+
function te(e) {
|
|
587
101
|
return Object.getOwnPropertySymbols(e).filter((t) => Object.prototype.propertyIsEnumerable.call(e, t));
|
|
588
102
|
}
|
|
589
103
|
//#endregion
|
|
590
104
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
591
|
-
function
|
|
105
|
+
function ne(e) {
|
|
592
106
|
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
593
107
|
}
|
|
594
108
|
//#endregion
|
|
595
109
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
596
|
-
var
|
|
110
|
+
var re = "[object RegExp]", ie = "[object String]", ae = "[object Number]", oe = "[object Boolean]", U = "[object Arguments]", W = "[object Symbol]", G = "[object Date]", K = "[object Map]", q = "[object Set]", se = "[object Array]", ce = "[object ArrayBuffer]", le = "[object Object]", ue = "[object DataView]", de = "[object Uint8Array]", fe = "[object Uint8ClampedArray]", pe = "[object Uint16Array]", me = "[object Uint32Array]", he = "[object Int8Array]", ge = "[object Int16Array]", _e = "[object Int32Array]", ve = "[object Float32Array]", ye = "[object Float64Array]";
|
|
597
111
|
//#endregion
|
|
598
112
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/object/cloneDeepWith.mjs
|
|
599
|
-
function
|
|
113
|
+
function J(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
600
114
|
let a = i?.(e, t, n, r);
|
|
601
115
|
if (a !== void 0) return a;
|
|
602
|
-
if (
|
|
116
|
+
if (V(e)) return e;
|
|
603
117
|
if (r.has(e)) return r.get(e);
|
|
604
118
|
if (Array.isArray(e)) {
|
|
605
119
|
let t = Array(e.length);
|
|
606
120
|
r.set(e, t);
|
|
607
|
-
for (let a = 0; a < e.length; a++) t[a] =
|
|
121
|
+
for (let a = 0; a < e.length; a++) t[a] = J(e[a], a, n, r, i);
|
|
608
122
|
return Object.hasOwn(e, "index") && (t.index = e.index), Object.hasOwn(e, "input") && (t.input = e.input), t;
|
|
609
123
|
}
|
|
610
124
|
if (e instanceof Date) return new Date(e.getTime());
|
|
@@ -615,187 +129,190 @@ function Y(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
|
615
129
|
if (e instanceof Map) {
|
|
616
130
|
let t = /* @__PURE__ */ new Map();
|
|
617
131
|
r.set(e, t);
|
|
618
|
-
for (let [a, o] of e) t.set(a,
|
|
132
|
+
for (let [a, o] of e) t.set(a, J(o, a, n, r, i));
|
|
619
133
|
return t;
|
|
620
134
|
}
|
|
621
135
|
if (e instanceof Set) {
|
|
622
136
|
let t = /* @__PURE__ */ new Set();
|
|
623
137
|
r.set(e, t);
|
|
624
|
-
for (let a of e) t.add(
|
|
138
|
+
for (let a of e) t.add(J(a, void 0, n, r, i));
|
|
625
139
|
return t;
|
|
626
140
|
}
|
|
627
141
|
if (typeof Buffer < "u" && Buffer.isBuffer(e)) return e.subarray();
|
|
628
|
-
if (
|
|
142
|
+
if (H(e)) {
|
|
629
143
|
let t = new (Object.getPrototypeOf(e)).constructor(e.length);
|
|
630
144
|
r.set(e, t);
|
|
631
|
-
for (let a = 0; a < e.length; a++) t[a] =
|
|
145
|
+
for (let a = 0; a < e.length; a++) t[a] = J(e[a], a, n, r, i);
|
|
632
146
|
return t;
|
|
633
147
|
}
|
|
634
148
|
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return e.slice(0);
|
|
635
149
|
if (e instanceof DataView) {
|
|
636
150
|
let t = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
|
|
637
|
-
return r.set(e, t),
|
|
151
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
638
152
|
}
|
|
639
153
|
if (typeof File < "u" && e instanceof File) {
|
|
640
154
|
let t = new File([e], e.name, { type: e.type });
|
|
641
|
-
return r.set(e, t),
|
|
155
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
642
156
|
}
|
|
643
157
|
if (typeof Blob < "u" && e instanceof Blob) {
|
|
644
158
|
let t = new Blob([e], { type: e.type });
|
|
645
|
-
return r.set(e, t),
|
|
159
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
646
160
|
}
|
|
647
161
|
if (e instanceof Error) {
|
|
648
162
|
let t = new e.constructor();
|
|
649
|
-
return r.set(e, t), t.message = e.message, t.name = e.name, t.stack = e.stack, t.cause = e.cause,
|
|
163
|
+
return r.set(e, t), t.message = e.message, t.name = e.name, t.stack = e.stack, t.cause = e.cause, Y(t, e, n, r, i), t;
|
|
650
164
|
}
|
|
651
165
|
if (e instanceof Boolean) {
|
|
652
166
|
let t = new Boolean(e.valueOf());
|
|
653
|
-
return r.set(e, t),
|
|
167
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
654
168
|
}
|
|
655
169
|
if (e instanceof Number) {
|
|
656
170
|
let t = new Number(e.valueOf());
|
|
657
|
-
return r.set(e, t),
|
|
171
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
658
172
|
}
|
|
659
173
|
if (e instanceof String) {
|
|
660
174
|
let t = new String(e.valueOf());
|
|
661
|
-
return r.set(e, t),
|
|
175
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
662
176
|
}
|
|
663
|
-
if (typeof e == "object" &&
|
|
177
|
+
if (typeof e == "object" && be(e)) {
|
|
664
178
|
let t = Object.create(Object.getPrototypeOf(e));
|
|
665
|
-
return r.set(e, t),
|
|
179
|
+
return r.set(e, t), Y(t, e, n, r, i), t;
|
|
666
180
|
}
|
|
667
181
|
return e;
|
|
668
182
|
}
|
|
669
|
-
function
|
|
670
|
-
let a = [...Object.keys(t), ...
|
|
183
|
+
function Y(e, t, n = e, r, i) {
|
|
184
|
+
let a = [...Object.keys(t), ...te(t)];
|
|
671
185
|
for (let o = 0; o < a.length; o++) {
|
|
672
186
|
let s = a[o], c = Object.getOwnPropertyDescriptor(e, s);
|
|
673
|
-
(c == null || c.writable) && (e[s] =
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
function
|
|
677
|
-
switch (
|
|
678
|
-
case
|
|
679
|
-
case
|
|
680
|
-
case
|
|
681
|
-
case
|
|
682
|
-
case
|
|
683
|
-
case
|
|
684
|
-
case
|
|
685
|
-
case
|
|
686
|
-
case
|
|
687
|
-
case
|
|
688
|
-
case
|
|
689
|
-
case
|
|
690
|
-
case
|
|
691
|
-
case
|
|
692
|
-
case
|
|
693
|
-
case
|
|
694
|
-
case
|
|
695
|
-
case
|
|
696
|
-
case
|
|
697
|
-
case
|
|
698
|
-
case
|
|
699
|
-
case
|
|
187
|
+
(c == null || c.writable) && (e[s] = J(t[s], s, n, r, i));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
function be(e) {
|
|
191
|
+
switch (ne(e)) {
|
|
192
|
+
case U:
|
|
193
|
+
case se:
|
|
194
|
+
case ce:
|
|
195
|
+
case ue:
|
|
196
|
+
case oe:
|
|
197
|
+
case G:
|
|
198
|
+
case ve:
|
|
199
|
+
case ye:
|
|
200
|
+
case he:
|
|
201
|
+
case ge:
|
|
202
|
+
case _e:
|
|
203
|
+
case K:
|
|
204
|
+
case ae:
|
|
205
|
+
case le:
|
|
206
|
+
case re:
|
|
207
|
+
case q:
|
|
208
|
+
case ie:
|
|
209
|
+
case W:
|
|
210
|
+
case de:
|
|
211
|
+
case fe:
|
|
212
|
+
case pe:
|
|
213
|
+
case me: return !0;
|
|
700
214
|
default: return !1;
|
|
701
215
|
}
|
|
702
216
|
}
|
|
703
217
|
//#endregion
|
|
704
218
|
//#region ../../node_modules/.pnpm/es-toolkit@1.44.0/node_modules/es-toolkit/dist/object/cloneDeep.mjs
|
|
705
|
-
function
|
|
706
|
-
return
|
|
219
|
+
function X(e) {
|
|
220
|
+
return J(e, void 0, e, /* @__PURE__ */ new Map(), void 0);
|
|
707
221
|
}
|
|
708
222
|
//#endregion
|
|
709
223
|
//#region src/RightContent/utils.ts
|
|
710
|
-
function
|
|
224
|
+
function xe(e, t) {
|
|
711
225
|
let n = /* @__PURE__ */ new Map();
|
|
712
226
|
return e.filter((e) => {
|
|
713
227
|
let r = e[t];
|
|
714
228
|
return n.has(r) ? !1 : (n.set(r, e), !0);
|
|
715
229
|
});
|
|
716
230
|
}
|
|
717
|
-
var
|
|
718
|
-
function
|
|
231
|
+
var Se = "ABCDEFGHJKLMNOPQRSTWXYZ", Ce = "阿八嚓哒鹅发旮哈讥咔垃妈拿噢啪七日撒他挖昔压匝";
|
|
232
|
+
function we(e) {
|
|
719
233
|
let t = e.codePointAt(0);
|
|
720
234
|
if (t >= 65 && t <= 90) return e;
|
|
721
235
|
if (t >= 97 && t <= 122) return e.toUpperCase();
|
|
722
236
|
if (t < 19968 || t > 40959) return "";
|
|
723
|
-
for (let t = 22; t >= 0; t--) if (e.localeCompare(
|
|
237
|
+
for (let t = 22; t >= 0; t--) if (e.localeCompare(Ce[t], "zh-CN") >= 0) return Se[t];
|
|
724
238
|
return "";
|
|
725
239
|
}
|
|
726
|
-
function
|
|
240
|
+
function Te(e) {
|
|
727
241
|
let t = "";
|
|
728
|
-
for (let n of e) t +=
|
|
242
|
+
for (let n of e) t += we(n);
|
|
729
243
|
return t;
|
|
730
244
|
}
|
|
731
|
-
function
|
|
245
|
+
function Ee(e, t) {
|
|
732
246
|
if (!t) return !1;
|
|
733
247
|
let n = t.trim().toLowerCase();
|
|
734
|
-
return !!(e.toLowerCase().includes(n) ||
|
|
248
|
+
return !!(e.toLowerCase().includes(n) || Te(e).toLowerCase().includes(n));
|
|
735
249
|
}
|
|
736
|
-
function
|
|
250
|
+
function De(e, t) {
|
|
737
251
|
let n = t.trim();
|
|
738
252
|
if (!n) return [];
|
|
739
253
|
let r = [];
|
|
740
|
-
for (let t of e) t.meta?.hideInMenu ||
|
|
254
|
+
for (let t of e) t.meta?.hideInMenu || Ee(t.meta?.title || (typeof t.name == "string" ? t.name : "") || "", n) && r.push(t);
|
|
741
255
|
return r;
|
|
742
256
|
}
|
|
743
257
|
//#endregion
|
|
744
258
|
//#region src/RightContent/Search/Panel.tsx
|
|
745
|
-
var
|
|
746
|
-
image:
|
|
259
|
+
var Oe = ({ className: e, value: t, locale: n }) => t ? r(w, {
|
|
260
|
+
image: w.PRESENTED_IMAGE_SIMPLE,
|
|
747
261
|
description: n.noResult?.(t)
|
|
748
|
-
}, null) : r("div", { class: e }, [n.noHistory]),
|
|
749
|
-
let n =
|
|
262
|
+
}, null) : r("div", { class: e }, [n.noHistory]), ke = /* @__PURE__ */ i((t) => {
|
|
263
|
+
let n = j(), { renderEmpty: i } = A(), a = v(t.historyKey || z({
|
|
750
264
|
suffixCls: "search-history",
|
|
751
265
|
isPro: !0
|
|
752
|
-
}), []), o =
|
|
266
|
+
}), []), o = l(0), f = l(X(u(a))), m = b((e) => {
|
|
753
267
|
let n = e.trim();
|
|
754
268
|
if (!n) {
|
|
755
|
-
|
|
269
|
+
f.value = [];
|
|
756
270
|
return;
|
|
757
271
|
}
|
|
758
|
-
|
|
272
|
+
f.value = De(t.dataSource ?? [], n), o.value = 0;
|
|
759
273
|
}, 200);
|
|
760
|
-
|
|
761
|
-
e ?
|
|
274
|
+
d(() => t.keyword, (e) => {
|
|
275
|
+
e ? m(e) : f.value = X(u(a));
|
|
762
276
|
});
|
|
763
|
-
function
|
|
277
|
+
function g() {
|
|
764
278
|
document.querySelector(`[data-search-item="${o.value}"]`)?.scrollIntoView({ block: "nearest" });
|
|
765
279
|
}
|
|
766
|
-
async function
|
|
767
|
-
if (
|
|
280
|
+
async function _() {
|
|
281
|
+
if (f.value.length === 0) return;
|
|
768
282
|
let e = o.value;
|
|
769
283
|
if (e < 0) return;
|
|
770
|
-
let r =
|
|
284
|
+
let r = f.value[e];
|
|
771
285
|
if (!r) return;
|
|
772
|
-
let i =
|
|
773
|
-
a.value.every((e) => e.name !== r.name) && a.value.push(
|
|
286
|
+
let i = I(r.redirect) ? r.redirect : r.path || "", c = r.meta?.link || "", l = L(c);
|
|
287
|
+
a.value.every((e) => e.name !== r.name) && a.value.push(X(r)), t.onClose?.(!0), await s(), l && c && r.meta?.linkStatus === 1 ? window.open(c, "_blank") : n.push({ path: i });
|
|
774
288
|
}
|
|
775
|
-
function
|
|
776
|
-
|
|
289
|
+
function y() {
|
|
290
|
+
f.value.length !== 0 && (t.onBlur?.(), o.value--, o.value < 0 && (o.value = f.value.length - 1), g());
|
|
777
291
|
}
|
|
778
|
-
function
|
|
779
|
-
|
|
292
|
+
function x() {
|
|
293
|
+
f.value.length !== 0 && (t.onBlur?.(), o.value++, o.value > f.value.length - 1 && (o.value = 0), g());
|
|
780
294
|
}
|
|
781
|
-
|
|
782
|
-
|
|
295
|
+
c(() => {
|
|
296
|
+
h("Enter", _), h("ArrowUp", y), h("ArrowDown", x);
|
|
783
297
|
});
|
|
784
|
-
function
|
|
298
|
+
function S(e) {
|
|
785
299
|
o.value = e;
|
|
786
300
|
}
|
|
787
|
-
function
|
|
788
|
-
e.stopPropagation(),
|
|
301
|
+
function C(e, t) {
|
|
302
|
+
e.stopPropagation(), f.value = f.value.filter((e) => e.name !== t.name), a.value = a.value.filter((e) => e.name !== t.name), o.value = o.value - 1 >= 0 ? o.value - 1 : 0, g();
|
|
789
303
|
}
|
|
790
|
-
let
|
|
791
|
-
return () => r(e, null, [
|
|
304
|
+
let w = (e) => B(`${t.className}${e ? `-${e}` : ""}`, t.hashId);
|
|
305
|
+
return () => r(e, null, [f.value.length > 0 ? r(e, null, [a.value.length > 0 && !t.keyword && r("div", { class: w("panel-title") }, [t.locale.searchHistory]), r("div", { class: w("panel-list") }, [xe(f.value, "name").map((e, n) => r("div", {
|
|
792
306
|
key: e.name,
|
|
793
|
-
class:
|
|
307
|
+
class: w(B("panel-item", n === o.value && "active")),
|
|
794
308
|
"data-search-item": n,
|
|
795
|
-
onClick: () =>
|
|
796
|
-
onMouseenter: () =>
|
|
797
|
-
}, [r("div", { class:
|
|
798
|
-
|
|
309
|
+
onClick: () => _(),
|
|
310
|
+
onMouseenter: () => S(n)
|
|
311
|
+
}, [r("div", { class: w("panel-item-left") }, [e.meta?.title]), a.value.length > 0 && !t.keyword && r(p, {
|
|
312
|
+
type: "CloseOutlined",
|
|
313
|
+
onClick: (t) => C(t, e)
|
|
314
|
+
}, null)]))])]) : i.value?.() || r(Oe, {
|
|
315
|
+
className: w("result"),
|
|
799
316
|
value: t.keyword,
|
|
800
317
|
locale: t.locale
|
|
801
318
|
}, null)]);
|
|
@@ -840,7 +357,7 @@ var At = ({ className: e, value: t, locale: n }) => t ? r(j, {
|
|
|
840
357
|
},
|
|
841
358
|
name: "GSearchPanel",
|
|
842
359
|
inheritAttrs: !1
|
|
843
|
-
}),
|
|
360
|
+
}), Z = k("ProRightSearch", (e) => {
|
|
844
361
|
let t = e.menuItemIconSize || e.fontSize, n = e.calc(e.borderRadiusLG).mul(2).equal(), r = e.calc(e.paddingXXS).div(2).equal();
|
|
845
362
|
return { [e.componentCls]: {
|
|
846
363
|
display: "flex",
|
|
@@ -928,42 +445,45 @@ var At = ({ className: e, value: t, locale: n }) => t ? r(j, {
|
|
|
928
445
|
color: e.colorTextQuaternary
|
|
929
446
|
}
|
|
930
447
|
} };
|
|
931
|
-
}),
|
|
932
|
-
r(
|
|
933
|
-
r(
|
|
448
|
+
}), Ae = ({ className: e, hashId: t, locale: n }) => r("div", { class: B(`${e}-footer`, t) }, [r("div", { class: B(`${e}-footer-icon`, t) }, [r(p, { type: "EnterOutlined" }, null), n.selectLabel]), r("div", { class: B(`${e}-footer-icon`, t) }, [
|
|
449
|
+
r(p, { type: "ArrowUpOutlined" }, null),
|
|
450
|
+
r(p, {
|
|
451
|
+
type: "ArrowUpOutlined",
|
|
452
|
+
rotate: 180
|
|
453
|
+
}, null),
|
|
934
454
|
n.navigateLabel
|
|
935
|
-
])]),
|
|
936
|
-
let a =
|
|
937
|
-
|
|
938
|
-
i.disabledShortKey || (
|
|
939
|
-
}),
|
|
940
|
-
|
|
941
|
-
|
|
455
|
+
])]), je = /* @__PURE__ */ i((i) => {
|
|
456
|
+
let a = m(), { prefixCls: c } = E("pro-right-search"), u = D(c), [d, f] = Z(c, u), h = l(""), g = l(!1), _ = y(), v = M() ? _["ctrl+k"] : _["cmd+k"], b = l(), S = t(() => i.dataSource?.length ? R(i.dataSource) : a?.menuState?.flatMenus ? a.menuState.flatMenus.value : []);
|
|
457
|
+
x(v, () => {
|
|
458
|
+
i.disabledShortKey || (g.value = !0);
|
|
459
|
+
}), x(() => g.value, () => {
|
|
460
|
+
s(() => {
|
|
461
|
+
b.value?.focus?.();
|
|
942
462
|
});
|
|
943
463
|
});
|
|
944
|
-
function
|
|
945
|
-
|
|
464
|
+
function C(e) {
|
|
465
|
+
g.value = !1, e && (h.value = "");
|
|
946
466
|
}
|
|
947
467
|
return () => {
|
|
948
468
|
let t = {
|
|
949
|
-
className:
|
|
950
|
-
hashId:
|
|
951
|
-
}, a = `${
|
|
469
|
+
className: c.value,
|
|
470
|
+
hashId: d.value
|
|
471
|
+
}, a = `${c.value}-modal`;
|
|
952
472
|
return r(e, null, [r("div", {
|
|
953
|
-
class:
|
|
473
|
+
class: B(c.value, d.value, f.value, u.value),
|
|
954
474
|
onClick: () => {
|
|
955
|
-
|
|
475
|
+
g.value = !0;
|
|
956
476
|
}
|
|
957
477
|
}, [
|
|
958
|
-
r(
|
|
959
|
-
r("span", { class:
|
|
960
|
-
r("span", { class:
|
|
478
|
+
r(p, { type: "SearchOutlined" }, null),
|
|
479
|
+
r("span", { class: B(`${c.value}-word`, d.value) }, [i.locale.searchLabel]),
|
|
480
|
+
r("span", { class: B(`${c.value}-word-icon`, d.value) }, [
|
|
961
481
|
n("⌘"),
|
|
962
482
|
" ",
|
|
963
483
|
r("kbd", null, [n("K")])
|
|
964
484
|
])
|
|
965
|
-
]), r(
|
|
966
|
-
wrapClassName:
|
|
485
|
+
]), r(O, {
|
|
486
|
+
wrapClassName: B(a, d.value),
|
|
967
487
|
width: 600,
|
|
968
488
|
scrollProps: {
|
|
969
489
|
maxHeight: 400,
|
|
@@ -971,34 +491,35 @@ var At = ({ className: e, value: t, locale: n }) => t ? r(j, {
|
|
|
971
491
|
},
|
|
972
492
|
centered: !1,
|
|
973
493
|
destroyOnHidden: !1,
|
|
974
|
-
title: r(
|
|
494
|
+
title: r(T, {
|
|
975
495
|
style: {
|
|
976
496
|
width: `${600 * .8}px`,
|
|
977
497
|
padding: 0
|
|
978
498
|
},
|
|
979
|
-
ref:
|
|
499
|
+
ref: b,
|
|
980
500
|
bordered: !1,
|
|
981
501
|
size: "large",
|
|
982
502
|
placeholder: i.locale.searchPlaceholder,
|
|
983
|
-
value:
|
|
503
|
+
value: h.value,
|
|
504
|
+
prefix: r(p, { type: "SearchOutlined" }, null),
|
|
984
505
|
"onUpdate:value": (e) => {
|
|
985
|
-
|
|
506
|
+
h.value = e;
|
|
986
507
|
}
|
|
987
|
-
},
|
|
988
|
-
open:
|
|
989
|
-
footer: r(
|
|
508
|
+
}, null),
|
|
509
|
+
open: g.value,
|
|
510
|
+
footer: r(Ae, {
|
|
990
511
|
className: a,
|
|
991
|
-
hashId:
|
|
512
|
+
hashId: d.value,
|
|
992
513
|
locale: i.locale
|
|
993
514
|
}, null),
|
|
994
|
-
onCancel: () =>
|
|
995
|
-
}, { default: () => [r(
|
|
515
|
+
onCancel: () => C()
|
|
516
|
+
}, { default: () => [r(ke, o(t, {
|
|
996
517
|
emptyProps: i.emptyProps,
|
|
997
|
-
keyword:
|
|
998
|
-
dataSource:
|
|
518
|
+
keyword: h.value,
|
|
519
|
+
dataSource: S.value,
|
|
999
520
|
historyKey: i.searchHistoryKey,
|
|
1000
521
|
locale: i.locale,
|
|
1001
|
-
onClose:
|
|
522
|
+
onClose: C
|
|
1002
523
|
}), null)] })]);
|
|
1003
524
|
};
|
|
1004
525
|
}, {
|
|
@@ -1030,10 +551,10 @@ var At = ({ className: e, value: t, locale: n }) => t ? r(j, {
|
|
|
1030
551
|
});
|
|
1031
552
|
//#endregion
|
|
1032
553
|
//#region src/RightContent/style.ts
|
|
1033
|
-
function
|
|
554
|
+
function Me(e, t) {
|
|
1034
555
|
return `color-mix(in srgb, ${e} ${t * 100}%, transparent)`;
|
|
1035
556
|
}
|
|
1036
|
-
var
|
|
557
|
+
var Ne = k("ProRightContent", (e) => ({ [e.componentCls]: {
|
|
1037
558
|
height: "100%",
|
|
1038
559
|
"&-header-actions": {
|
|
1039
560
|
display: "flex",
|
|
@@ -1082,7 +603,7 @@ var It = P("ProRightContent", (e) => ({ [e.componentCls]: {
|
|
|
1082
603
|
height: 44,
|
|
1083
604
|
lineHeight: "44px",
|
|
1084
605
|
borderRadius: e.borderRadius,
|
|
1085
|
-
"&:hover": { backgroundColor:
|
|
606
|
+
"&:hover": { backgroundColor: Me(e.colorTextBase, .03) }
|
|
1086
607
|
},
|
|
1087
608
|
"&-avatar": {
|
|
1088
609
|
display: "inline-flex",
|
|
@@ -1104,113 +625,122 @@ function $(e, t) {
|
|
|
1104
625
|
gap: "6px"
|
|
1105
626
|
} }, [typeof e == "function" ? e() : e, t]);
|
|
1106
627
|
}
|
|
1107
|
-
var
|
|
628
|
+
var Pe = [
|
|
1108
629
|
{
|
|
1109
630
|
value: "light",
|
|
1110
|
-
label: $(
|
|
631
|
+
label: $(a(p, {
|
|
1111
632
|
type: "Moon",
|
|
1112
633
|
style: Q
|
|
1113
634
|
}), "亮色")
|
|
1114
635
|
},
|
|
1115
636
|
{
|
|
1116
637
|
value: "dark",
|
|
1117
|
-
label: $(
|
|
1118
|
-
type: "
|
|
638
|
+
label: $(a(p, {
|
|
639
|
+
type: "Sun",
|
|
1119
640
|
style: Q
|
|
1120
641
|
}), "深色")
|
|
1121
642
|
},
|
|
1122
643
|
{
|
|
1123
644
|
value: "system",
|
|
1124
|
-
label: $(
|
|
645
|
+
label: $(a(p, {
|
|
646
|
+
type: "DesktopOutlined",
|
|
647
|
+
style: Q
|
|
648
|
+
}), "自动")
|
|
1125
649
|
}
|
|
1126
|
-
],
|
|
1127
|
-
let { isFullscreen:
|
|
1128
|
-
|
|
1129
|
-
|
|
650
|
+
], Fe = /* @__PURE__ */ i((n, { emit: i, slots: a }) => {
|
|
651
|
+
let { isFullscreen: s, toggle: c } = _(), u = m(), { setTheme: h, isDark: v, theme: y } = f(), { prefixCls: b } = E("pro-right-content"), x = D(b), [w, T] = Ne(b, x), O = t(() => u?.isMobile.value ?? !1), k = l(), { width: A } = g(k), j = l("auto"), M = l();
|
|
652
|
+
d(A, (e) => {
|
|
653
|
+
j.value = e > 0 ? e : "auto";
|
|
1130
654
|
});
|
|
1131
|
-
let
|
|
1132
|
-
...
|
|
655
|
+
let N = l(!1), P = t(() => ({
|
|
656
|
+
...ee,
|
|
1133
657
|
...n.locale
|
|
1134
|
-
})),
|
|
658
|
+
})), F = t(() => n.actions === !1 ? {} : {
|
|
1135
659
|
lock: !0,
|
|
1136
660
|
theme: !0,
|
|
1137
661
|
search: !0,
|
|
1138
662
|
themeEditor: !0,
|
|
1139
663
|
fullScreen: !0,
|
|
1140
664
|
...n.actions
|
|
1141
|
-
}),
|
|
665
|
+
}), I = t(() => (n.themeOptions || Pe).map((e) => ({
|
|
1142
666
|
key: e.value,
|
|
1143
667
|
label: e.label()
|
|
1144
668
|
})));
|
|
1145
|
-
function
|
|
669
|
+
function L(e) {
|
|
1146
670
|
let t = e.key;
|
|
1147
|
-
|
|
671
|
+
h(t);
|
|
1148
672
|
}
|
|
1149
|
-
let
|
|
673
|
+
let R = t(() => {
|
|
1150
674
|
let e = [];
|
|
1151
|
-
return
|
|
675
|
+
return F.value.lock && a.lock && (e.push({
|
|
1152
676
|
key: "lock",
|
|
1153
|
-
icon: () => r(
|
|
1154
|
-
label:
|
|
677
|
+
icon: () => r(p, { type: "LockOutlined" }, null),
|
|
678
|
+
label: P.value.lockScreen
|
|
1155
679
|
}), e.push({ type: "divider" })), e.push({
|
|
1156
680
|
key: "logout",
|
|
1157
|
-
icon: () => r(
|
|
1158
|
-
label:
|
|
681
|
+
icon: () => r(p, { type: "LogoutOutlined" }, null),
|
|
682
|
+
label: P.value.logout
|
|
1159
683
|
}), e;
|
|
1160
684
|
});
|
|
1161
|
-
function
|
|
1162
|
-
e.key === "lock" ?
|
|
685
|
+
function z(e) {
|
|
686
|
+
e.key === "lock" ? N.value = !0 : e.key === "logout" && i("logout");
|
|
1163
687
|
}
|
|
1164
|
-
function
|
|
688
|
+
function V(e) {
|
|
1165
689
|
i("actionClick", e);
|
|
1166
690
|
}
|
|
1167
|
-
function
|
|
1168
|
-
|
|
691
|
+
function H(e) {
|
|
692
|
+
N.value = e;
|
|
1169
693
|
}
|
|
1170
694
|
return () => {
|
|
1171
|
-
let t = [`${
|
|
695
|
+
let t = [`${b.value}-header-actions-item`, w.value];
|
|
1172
696
|
return r("div", {
|
|
1173
|
-
ref:
|
|
1174
|
-
class:
|
|
697
|
+
ref: k,
|
|
698
|
+
class: B(b.value, w.value, T.value, x.value),
|
|
1175
699
|
style: {
|
|
1176
|
-
minWidth:
|
|
700
|
+
minWidth: j.value,
|
|
1177
701
|
height: "100%"
|
|
1178
702
|
}
|
|
1179
|
-
}, [r("div", { style: { height: "100%" } }, [r("div", { class:
|
|
1180
|
-
|
|
703
|
+
}, [r("div", { style: { height: "100%" } }, [r("div", { class: B(`${b.value}-header-actions`, w.value) }, [a.default ? a.default() : r(e, null, [
|
|
704
|
+
F.value.search && !O.value && r(je, {
|
|
1181
705
|
dataSource: n.searchConfig?.dataSource,
|
|
1182
706
|
disabledShortKey: n.searchConfig?.disabledShortKey,
|
|
1183
707
|
searchHistoryKey: n.searchConfig?.historyKey,
|
|
1184
708
|
emptyProps: n.searchConfig?.emptyProps,
|
|
1185
|
-
locale:
|
|
709
|
+
locale: P.value
|
|
1186
710
|
}, null),
|
|
1187
|
-
|
|
1188
|
-
ref:
|
|
1189
|
-
class:
|
|
1190
|
-
}, [r(
|
|
711
|
+
F.value.theme && r("div", {
|
|
712
|
+
ref: M,
|
|
713
|
+
class: B(`${b.value}-header-actions-item`, `${b.value}-header-actions-theme`, w.value)
|
|
714
|
+
}, [r(C, {
|
|
1191
715
|
trigger: ["click"],
|
|
1192
716
|
placement: "bottomRight",
|
|
1193
717
|
menu: {
|
|
1194
|
-
items:
|
|
1195
|
-
onClick:
|
|
1196
|
-
selectedKeys: [
|
|
718
|
+
items: I.value,
|
|
719
|
+
onClick: L,
|
|
720
|
+
selectedKeys: [y.value]
|
|
1197
721
|
}
|
|
1198
|
-
}, { default: () => [r(
|
|
1199
|
-
class:
|
|
1200
|
-
type:
|
|
722
|
+
}, { default: () => [r(p, {
|
|
723
|
+
class: B(`${b.value}-header-actions-icon`, w.value),
|
|
724
|
+
type: v.value ? "Moon" : "Sun"
|
|
1201
725
|
}, null)] })]),
|
|
1202
|
-
|
|
1203
|
-
|
|
726
|
+
F.value.themeEditor && !O.value && r("div", { class: B(t) }, [r(p, {
|
|
727
|
+
type: "SettingOutlined",
|
|
728
|
+
onClick: () => V("themeEditor")
|
|
729
|
+
}, null)]),
|
|
730
|
+
F.value.fullScreen && !O.value && r("div", { class: B(t) }, [r(p, {
|
|
731
|
+
type: s.value ? "CompressOutlined" : "ExpandOutlined",
|
|
732
|
+
onClick: () => c()
|
|
733
|
+
}, null)]),
|
|
1204
734
|
a.actionsRender?.(t)
|
|
1205
|
-
]), r(
|
|
1206
|
-
items:
|
|
1207
|
-
onClick:
|
|
1208
|
-
} }), { default: () => [a.dropdownTrigger ? a.dropdownTrigger() : r("div", { class:
|
|
735
|
+
]), r(C, o({ placement: "bottomRight" }, n.dropdownProps, { menu: a.dropdownMenu ? void 0 : {
|
|
736
|
+
items: R.value,
|
|
737
|
+
onClick: z
|
|
738
|
+
} }), { default: () => [a.dropdownTrigger ? a.dropdownTrigger() : r("div", { class: B(`${b.value}-header-actions-avatar`, w.value) }, [r(S, {
|
|
1209
739
|
size: 28,
|
|
1210
|
-
icon: r(
|
|
1211
|
-
}, null), n.name && r("span", { class:
|
|
1212
|
-
open:
|
|
1213
|
-
onOpenChange:
|
|
740
|
+
icon: r(p, { type: "UserOutlined" }, null)
|
|
741
|
+
}, null), n.name && r("span", { class: B(`${b.value}-header-actions-name`, w.value) }, [n.name])])] })])]), a.lock?.({
|
|
742
|
+
open: N.value,
|
|
743
|
+
onOpenChange: H
|
|
1214
744
|
})]);
|
|
1215
745
|
};
|
|
1216
746
|
}, {
|
|
@@ -1250,4 +780,4 @@ var Lt = [
|
|
|
1250
780
|
inheritAttrs: !1
|
|
1251
781
|
});
|
|
1252
782
|
//#endregion
|
|
1253
|
-
export {
|
|
783
|
+
export { Fe as RightContent };
|