@lumal/core 0.0.2-beta → 0.0.3-beta
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/CHANGELOG.md +29 -0
- package/README.md +9 -0
- package/dist/auth.cjs +1 -1
- package/dist/auth.js +13 -29
- package/dist/{components-DVnNb4-n.js → components-DCp2KGvo.js} +1 -1
- package/dist/{components-CYwpPqgm.cjs → components-oqKxhgFp.cjs} +1 -1
- package/dist/components.cjs +1 -1
- package/dist/components.js +3 -3
- package/dist/{composables-DrGkFGvy.js → composables-BxZG0_RZ.js} +15 -9
- package/dist/composables-Dsl-todB.cjs +1 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/context-Bdx-ZJbt.js +13 -0
- package/dist/context-CWQ1OO16.cjs +1 -0
- package/dist/core.css +1 -1
- package/dist/createLumalApp-BxQL77Qt.js +38 -0
- package/dist/createLumalApp-C5o7gAlu.cjs +1 -0
- package/dist/{dictionary-CKEqfCLG.js → dictionary-DnRiNaKi.js} +1 -1
- package/dist/{dictionary-BtPCmrLY.cjs → dictionary-Dt70z10M.cjs} +1 -1
- package/dist/dictionary.cjs +1 -1
- package/dist/dictionary.js +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +37 -80
- package/dist/{layout-CuuRkGBF.js → layout-B7yJhQXN.js} +450 -416
- package/dist/layout-BgyM9WJi.cjs +1 -0
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/minimal.cjs +1 -0
- package/dist/minimal.js +10 -0
- package/dist/{permission-CCkqvnWg.js → permission-CHw9eXd8.js} +24 -34
- package/dist/permission-CoqteYAi.cjs +1 -0
- package/dist/permission.cjs +1 -1
- package/dist/permission.js +4 -3
- package/dist/request.cjs +1 -1
- package/dist/request.js +98 -78
- package/dist/src/app/createLumalAdmin.d.ts +1 -1
- package/dist/src/app/createLumalAdmin.d.ts.map +1 -1
- package/dist/src/app/createLumalApp.d.ts +7 -0
- package/dist/src/app/createLumalApp.d.ts.map +1 -0
- package/dist/src/app/types.d.ts +5 -0
- package/dist/src/app/types.d.ts.map +1 -1
- package/dist/src/auth/createAuthSession.d.ts.map +1 -1
- package/dist/src/dictionary/store.d.ts.map +1 -1
- package/dist/src/layout/LumalGlobalSearch.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalLayout.vue.d.ts +6 -2
- package/dist/src/layout/LumalLayout.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalRouterView.vue.d.ts +2 -0
- package/dist/src/layout/LumalRouterView.vue.d.ts.map +1 -1
- package/dist/src/minimal/index.d.ts +5 -0
- package/dist/src/minimal/index.d.ts.map +1 -0
- package/dist/src/request/client.d.ts.map +1 -1
- package/dist/src/request/types.d.ts +8 -2
- package/dist/src/request/types.d.ts.map +1 -1
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/src/utils/index.d.ts.map +1 -1
- package/dist/src/utils/storage.d.ts +2 -0
- package/dist/src/utils/storage.d.ts.map +1 -1
- package/dist/storage-CCBa7Qh8.cjs +1 -0
- package/dist/storage-CorgkMJU.js +41 -0
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +32 -54
- package/package.json +9 -3
- package/dist/composables-edipbw70.cjs +0 -1
- package/dist/layout-7345ntRV.cjs +0 -1
- package/dist/permission-6sXtjGMS.cjs +0 -1
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
|
-
import { Fragment as t, KeepAlive as n, Teleport as r, Transition as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createVNode as f, defineComponent as p, inject as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as ee, onMounted as te, openBlock as b, ref as x, renderList as S, renderSlot as C, resolveComponent as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as ne, useTemplateRef as A, vModelText as j, vShow as
|
|
3
|
-
import { LumalIcon as
|
|
4
|
-
import { ElAside as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
2
|
+
import { Fragment as t, KeepAlive as n, Teleport as r, Transition as i, TransitionGroup as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createSlots as d, createVNode as f, defineComponent as p, inject as m, mergeModels as h, mergeProps as g, nextTick as _, normalizeClass as v, normalizeStyle as y, onBeforeUnmount as ee, onMounted as te, openBlock as b, ref as x, renderList as S, renderSlot as C, resolveComponent as w, resolveDynamicComponent as T, shallowRef as E, toDisplayString as D, unref as O, useId as k, useModel as ne, useTemplateRef as A, vModelText as j, vShow as M, watch as N, withCtx as P, withDirectives as re, withModifiers as ie } from "vue";
|
|
3
|
+
import { LumalIcon as F } from "@lumal/icons-vue";
|
|
4
|
+
import { ElAside as I, ElButton as L, ElContainer as R, ElHeader as ae, ElMain as oe, ElMenu as z, ElMenuItem as B, ElScrollbar as se, ElSubMenu as V } from "element-plus";
|
|
5
|
+
import { RouterView as H, routeLocationKey as ce, routerKey as le } from "vue-router";
|
|
6
|
+
import ue from "sortablejs";
|
|
7
7
|
//#region src/layout/state/menu-layout.ts
|
|
8
|
-
function H(e, t) {
|
|
9
|
-
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => H(e, t)) ?? !1;
|
|
10
|
-
}
|
|
11
8
|
function U(e, t) {
|
|
9
|
+
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => U(e, t)) ?? !1;
|
|
10
|
+
}
|
|
11
|
+
function W(e, t) {
|
|
12
12
|
for (let n of e) {
|
|
13
13
|
if (n.hidden) continue;
|
|
14
14
|
if (n.path === t) return n;
|
|
15
|
-
let e =
|
|
15
|
+
let e = W(n.children ?? [], t);
|
|
16
16
|
if (e) return e;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function G(e, t) {
|
|
20
20
|
for (let n of e) {
|
|
21
21
|
if (n.hidden) continue;
|
|
22
22
|
if (n.path === t) return [n];
|
|
23
|
-
let e =
|
|
23
|
+
let e = G(n.children ?? [], t);
|
|
24
24
|
if (e.length > 0) return [n, ...e];
|
|
25
25
|
}
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function de(e) {
|
|
29
29
|
if (!e) return "";
|
|
30
30
|
if (e.redirect) return e.redirect;
|
|
31
31
|
let t = e.children?.filter((e) => !e.hidden) ?? [];
|
|
32
|
-
return t.length === 0 ? e.path :
|
|
32
|
+
return t.length === 0 ? e.path : de(t[0]);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return e.find((e) =>
|
|
34
|
+
function fe(e, t) {
|
|
35
|
+
return e.find((e) => U(e, t))?.path ?? "";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function K(e) {
|
|
38
38
|
let { activeTopMenuPath: t = "", layout: n } = e, r = e.menus.filter((e) => !e.hidden);
|
|
39
39
|
return n === "sidebar-nav" ? {
|
|
40
40
|
sidebarMenus: r,
|
|
@@ -43,21 +43,21 @@ function G(e) {
|
|
|
43
43
|
sidebarMenus: [],
|
|
44
44
|
topMenus: r
|
|
45
45
|
} : {
|
|
46
|
-
sidebarMenus: (r.find((e) => e.path === t) ?? r.find((e) =>
|
|
46
|
+
sidebarMenus: (r.find((e) => e.path === t) ?? r.find((e) => U(e, t)))?.children?.filter((e) => !e.hidden) ?? [],
|
|
47
47
|
topMenus: r
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/layout/LumalBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
52
|
-
var
|
|
52
|
+
var q = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "lumal-breadcrumb",
|
|
55
55
|
"aria-label": "面包屑"
|
|
56
|
-
},
|
|
56
|
+
}, pe = { class: "lumal-breadcrumb__list" }, J = {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: "lumal-breadcrumb__current",
|
|
59
59
|
"aria-current": "page"
|
|
60
|
-
},
|
|
60
|
+
}, me = ["onClick"], he = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
61
61
|
__name: "LumalBreadcrumb",
|
|
62
62
|
props: {
|
|
63
63
|
activeMenuPath: { default: "" },
|
|
@@ -80,7 +80,7 @@ var K = {
|
|
|
80
80
|
},
|
|
81
81
|
emits: ["select"],
|
|
82
82
|
setup(e, { emit: n }) {
|
|
83
|
-
let r = e, i = n, a = m(
|
|
83
|
+
let r = e, i = n, a = m(ce, void 0);
|
|
84
84
|
function d(e) {
|
|
85
85
|
return {
|
|
86
86
|
icon: e.icon,
|
|
@@ -101,14 +101,14 @@ var K = {
|
|
|
101
101
|
}];
|
|
102
102
|
});
|
|
103
103
|
}), p = o(() => {
|
|
104
|
-
let e =
|
|
104
|
+
let e = G(r.menus, r.activePath), t = (e.length > 0 ? e : G(r.menus, r.activeMenuPath)).map(d), n = typeof a?.meta.title == "string" ? a.meta.title : "", i = typeof a?.meta.icon == "string" ? a.meta.icon : void 0, o = a?.meta.hideInBreadcrumb === !0;
|
|
105
105
|
return o && t.at(-1)?.path === r.activePath && t.pop(), n && !o && r.activePath && r.activePath === a?.path && !t.some((e) => e.path === r.activePath) && t.push({
|
|
106
106
|
icon: i,
|
|
107
107
|
path: r.activePath,
|
|
108
108
|
title: n
|
|
109
109
|
}), t;
|
|
110
110
|
}), h = o(() => f.value.length > 0 ? f.value : p.value), g = o(() => {
|
|
111
|
-
let e = r.homePath ?
|
|
111
|
+
let e = r.homePath ? G(r.menus, r.homePath).at(-1) : void 0, t = r.menus.find((e) => !e.hidden), n = r.homePath || de(t);
|
|
112
112
|
if (n) return {
|
|
113
113
|
icon: e?.icon ?? t?.icon,
|
|
114
114
|
path: n,
|
|
@@ -118,15 +118,15 @@ var K = {
|
|
|
118
118
|
let e = [...h.value], t = g.value;
|
|
119
119
|
return r.showHome && t && !e.some((e) => e.path === t.path) && e.unshift(t), e;
|
|
120
120
|
}), v = o(() => _.value.length > 0 && !(r.hideOnlyOne && h.value.length <= 1));
|
|
121
|
-
return (n, r) => v.value ? (b(), l("nav",
|
|
121
|
+
return (n, r) => v.value ? (b(), l("nav", q, [u("ol", pe, [(b(!0), l(t, null, S(_.value, (t, n) => (b(), l("li", {
|
|
122
122
|
key: `${t.path}:${n}`,
|
|
123
123
|
class: "lumal-breadcrumb__item"
|
|
124
|
-
}, [n > 0 ? (b(), s(O(
|
|
124
|
+
}, [n > 0 ? (b(), s(O(F), {
|
|
125
125
|
key: 0,
|
|
126
126
|
class: "lumal-breadcrumb__separator",
|
|
127
127
|
name: "lumal:chevron-right",
|
|
128
128
|
size: 14
|
|
129
|
-
})) : c("", !0), n === _.value.length - 1 ? (b(), l("span",
|
|
129
|
+
})) : c("", !0), n === _.value.length - 1 ? (b(), l("span", J, [e.showIcon && t.icon ? (b(), s(O(F), {
|
|
130
130
|
key: 0,
|
|
131
131
|
name: t.icon,
|
|
132
132
|
size: 15
|
|
@@ -135,33 +135,33 @@ var K = {
|
|
|
135
135
|
class: "lumal-breadcrumb__link",
|
|
136
136
|
type: "button",
|
|
137
137
|
onClick: (e) => i("select", t.path)
|
|
138
|
-
}, [e.showIcon && t.icon ? (b(), s(O(
|
|
138
|
+
}, [e.showIcon && t.icon ? (b(), s(O(F), {
|
|
139
139
|
key: 0,
|
|
140
140
|
name: t.icon,
|
|
141
141
|
size: 15
|
|
142
|
-
}, null, 8, ["name"])) : c("", !0), u("span", null, D(t.title), 1)], 8,
|
|
142
|
+
}, null, 8, ["name"])) : c("", !0), u("span", null, D(t.title), 1)], 8, me))]))), 128))])])) : c("", !0);
|
|
143
143
|
}
|
|
144
|
-
}), [["__scopeId", "data-v-53a036d9"]]),
|
|
144
|
+
}), [["__scopeId", "data-v-53a036d9"]]), ge = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
145
145
|
__name: "LumalContent",
|
|
146
146
|
setup(e, { expose: t }) {
|
|
147
147
|
let n = A("contentRef");
|
|
148
148
|
return t({
|
|
149
149
|
getContentElement: () => n.value?.$el,
|
|
150
150
|
getContentInstance: () => n.value
|
|
151
|
-
}), (e, t) => (b(), s(O(
|
|
151
|
+
}), (e, t) => (b(), s(O(oe), {
|
|
152
152
|
ref_key: "contentRef",
|
|
153
153
|
ref: n,
|
|
154
154
|
class: "lumal-content"
|
|
155
155
|
}, {
|
|
156
|
-
default:
|
|
156
|
+
default: P(() => [C(e.$slots, "default", {}, void 0, !0)]),
|
|
157
157
|
_: 3
|
|
158
158
|
}, 512));
|
|
159
159
|
}
|
|
160
|
-
}), [["__scopeId", "data-v-a0d6361c"]]),
|
|
160
|
+
}), [["__scopeId", "data-v-a0d6361c"]]), _e = { class: "lumal-global-search" }, ve = { key: 0 }, Y = ["aria-labelledby"], ye = { class: "lumal-global-search__header" }, be = ["id"], xe = { class: "lumal-global-search__input-wrap" }, X = [
|
|
161
161
|
"aria-activedescendant",
|
|
162
162
|
"aria-controls",
|
|
163
163
|
"placeholder"
|
|
164
|
-
],
|
|
164
|
+
], Se = ["id"], Z = ["id", "aria-selected"], Ce = ["onMouseenter", "onClick"], we = {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: "lumal-global-search__empty",
|
|
167
167
|
role: "status"
|
|
@@ -178,148 +178,163 @@ var K = {
|
|
|
178
178
|
},
|
|
179
179
|
emits: ["select"],
|
|
180
180
|
setup(e, { expose: n, emit: i }) {
|
|
181
|
-
let a = e, d = i, p = `lumal-global-search-${k()}`, m = A("inputRef"), h = A("triggerRef"), g = x(!1),
|
|
182
|
-
function
|
|
181
|
+
let a = e, d = i, p = `lumal-global-search-${k()}`, m = A("inputRef"), h = A("triggerRef"), g = A("dialogRef"), y = x(!1), C = x(""), w = x(0), T;
|
|
182
|
+
function E(e, t = []) {
|
|
183
183
|
return e.flatMap((e) => {
|
|
184
184
|
if (e.hidden) return [];
|
|
185
185
|
let n = [...t, e.title];
|
|
186
186
|
return [{
|
|
187
187
|
item: e,
|
|
188
188
|
trail: n
|
|
189
|
-
}, ...
|
|
189
|
+
}, ...E(e.children ?? [], n)];
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
let
|
|
193
|
-
let e =
|
|
194
|
-
return (e ?
|
|
195
|
-
}),
|
|
196
|
-
function
|
|
197
|
-
|
|
192
|
+
let ne = o(() => E(a.menus)), M = o(() => {
|
|
193
|
+
let e = C.value.trim().toLocaleLowerCase();
|
|
194
|
+
return (e ? ne.value.filter(({ item: t, trail: n }) => `${n.join(" ")} ${t.path}`.toLocaleLowerCase().includes(e)) : ne.value).slice(0, Math.max(1, a.maxResults));
|
|
195
|
+
}), P = o(() => M.value[w.value] ? `${p}-option-${w.value}` : void 0);
|
|
196
|
+
function I() {
|
|
197
|
+
y.value || (T = document.activeElement instanceof HTMLElement ? document.activeElement : void 0, y.value = !0, C.value = "", w.value = 0, _(() => m.value?.focus()));
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
199
|
+
function L(e = !0) {
|
|
200
|
+
y.value = !1, document.removeEventListener("focusin", R), e && _(() => {
|
|
201
|
+
y.value || (T?.isConnected ? T : h.value)?.focus();
|
|
202
|
+
});
|
|
201
203
|
}
|
|
202
|
-
function
|
|
203
|
-
|
|
204
|
+
function R(e) {
|
|
205
|
+
y.value && g.value && !g.value.contains(e.target) && m.value?.focus();
|
|
206
|
+
}
|
|
207
|
+
function ae(e) {
|
|
208
|
+
if (e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), L()), e.key !== "Tab") return;
|
|
209
|
+
let t = [...g.value?.querySelectorAll("button, input, [tabindex]") ?? []].filter((e) => e.tabIndex >= 0 && !e.matches(":disabled") && !e.closest("[hidden], [inert]")), n = t[0], r = t.at(-1);
|
|
210
|
+
(!n || (e.shiftKey ? document.activeElement === n : document.activeElement === r)) && (e.preventDefault(), (e.shiftKey ? r : n)?.focus());
|
|
211
|
+
}
|
|
212
|
+
function oe(e) {
|
|
213
|
+
e && (d("select", e.item.path, e.item), L());
|
|
204
214
|
}
|
|
205
|
-
function
|
|
215
|
+
function z(e) {
|
|
206
216
|
if (e.key === "Escape") {
|
|
207
|
-
e.preventDefault(),
|
|
217
|
+
e.preventDefault(), L();
|
|
208
218
|
return;
|
|
209
219
|
}
|
|
210
|
-
if (
|
|
220
|
+
if (M.value.length !== 0) {
|
|
211
221
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
212
222
|
e.preventDefault();
|
|
213
223
|
let t = e.key === "ArrowDown" ? 1 : -1;
|
|
214
|
-
|
|
224
|
+
w.value = (w.value + t + M.value.length) % M.value.length;
|
|
215
225
|
return;
|
|
216
226
|
}
|
|
217
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
227
|
+
e.key === "Enter" && (e.preventDefault(), oe(M.value[w.value]));
|
|
218
228
|
}
|
|
219
229
|
}
|
|
220
|
-
function
|
|
221
|
-
!a.shortcut || e.altKey || e.shiftKey || e.key.toLocaleLowerCase() !== "k" || !e.ctrlKey && !e.metaKey || (e.preventDefault(),
|
|
230
|
+
function B(e) {
|
|
231
|
+
!a.shortcut || e.altKey || e.shiftKey || e.key.toLocaleLowerCase() !== "k" || !e.ctrlKey && !e.metaKey || (e.preventDefault(), y.value ? L() : I());
|
|
222
232
|
}
|
|
223
|
-
return M
|
|
224
|
-
|
|
233
|
+
return N(M, () => {
|
|
234
|
+
w.value = 0;
|
|
235
|
+
}), N(y, (e) => {
|
|
236
|
+
e ? document.addEventListener("focusin", R) : document.removeEventListener("focusin", R);
|
|
225
237
|
}), te(() => {
|
|
226
|
-
window.addEventListener("keydown",
|
|
238
|
+
window.addEventListener("keydown", B);
|
|
227
239
|
}), ee(() => {
|
|
228
|
-
window.removeEventListener("keydown",
|
|
240
|
+
window.removeEventListener("keydown", B), document.removeEventListener("focusin", R), y.value && T?.isConnected && T.focus();
|
|
229
241
|
}), n({
|
|
230
|
-
close:
|
|
231
|
-
open:
|
|
232
|
-
}), (n, i) => (b(), l("div",
|
|
242
|
+
close: L,
|
|
243
|
+
open: I
|
|
244
|
+
}), (n, i) => (b(), l("div", _e, [u("button", {
|
|
233
245
|
ref_key: "triggerRef",
|
|
234
246
|
ref: h,
|
|
235
247
|
class: "lumal-global-search__trigger",
|
|
236
248
|
type: "button",
|
|
237
249
|
"aria-label": "打开全局搜索",
|
|
238
250
|
title: "全局搜索",
|
|
239
|
-
onClick:
|
|
251
|
+
onClick: I
|
|
240
252
|
}, [
|
|
241
|
-
f(O(
|
|
253
|
+
f(O(F), {
|
|
242
254
|
icon: Te,
|
|
243
255
|
size: 17
|
|
244
256
|
}),
|
|
245
257
|
i[3] ||= u("span", { class: "lumal-global-search__trigger-label" }, "搜索", -1),
|
|
246
|
-
e.shortcut ? (b(), l("kbd",
|
|
247
|
-
], 512), (b(), s(r, { to: "body" }, [
|
|
258
|
+
e.shortcut ? (b(), l("kbd", ve, "Ctrl K")) : c("", !0)
|
|
259
|
+
], 512), (b(), s(r, { to: "body" }, [y.value ? (b(), l("div", {
|
|
248
260
|
key: 0,
|
|
249
261
|
class: "lumal-global-search__backdrop",
|
|
250
|
-
onMousedown: i[2] ||=
|
|
262
|
+
onMousedown: i[2] ||= ie((e) => L(), ["self"])
|
|
251
263
|
}, [u("section", {
|
|
264
|
+
ref_key: "dialogRef",
|
|
265
|
+
ref: g,
|
|
252
266
|
class: "lumal-global-search__dialog",
|
|
253
267
|
role: "dialog",
|
|
254
268
|
"aria-modal": "true",
|
|
255
|
-
"aria-labelledby": `${p}-title
|
|
269
|
+
"aria-labelledby": `${p}-title`,
|
|
270
|
+
onKeydown: ae
|
|
256
271
|
}, [
|
|
257
|
-
u("header",
|
|
272
|
+
u("header", ye, [u("h2", { id: `${p}-title` }, " 全局搜索 ", 8, be), u("button", {
|
|
258
273
|
type: "button",
|
|
259
274
|
"aria-label": "关闭全局搜索",
|
|
260
275
|
title: "关闭",
|
|
261
|
-
onClick: i[0] ||= (e) =>
|
|
262
|
-
}, [f(O(
|
|
276
|
+
onClick: i[0] ||= (e) => L()
|
|
277
|
+
}, [f(O(F), {
|
|
263
278
|
name: "lumal:close",
|
|
264
279
|
size: 17
|
|
265
280
|
})])]),
|
|
266
|
-
u("label",
|
|
281
|
+
u("label", xe, [
|
|
267
282
|
i[4] ||= u("span", { class: "lumal-global-search__sr-only" }, "搜索菜单", -1),
|
|
268
|
-
f(O(
|
|
283
|
+
f(O(F), {
|
|
269
284
|
icon: Te,
|
|
270
285
|
size: 18
|
|
271
286
|
}),
|
|
272
|
-
|
|
287
|
+
re(u("input", {
|
|
273
288
|
ref_key: "inputRef",
|
|
274
289
|
ref: m,
|
|
275
|
-
"onUpdate:modelValue": i[1] ||= (e) =>
|
|
290
|
+
"onUpdate:modelValue": i[1] ||= (e) => C.value = e,
|
|
276
291
|
role: "combobox",
|
|
277
292
|
autocomplete: "off",
|
|
278
|
-
"aria-activedescendant":
|
|
293
|
+
"aria-activedescendant": P.value,
|
|
279
294
|
"aria-autocomplete": "list",
|
|
280
295
|
"aria-controls": `${p}-results`,
|
|
281
296
|
"aria-expanded": "true",
|
|
282
297
|
placeholder: e.placeholder,
|
|
283
|
-
onKeydown:
|
|
284
|
-
}, null, 40,
|
|
298
|
+
onKeydown: z
|
|
299
|
+
}, null, 40, X), [[j, C.value]])
|
|
285
300
|
]),
|
|
286
301
|
u("ul", {
|
|
287
302
|
id: `${p}-results`,
|
|
288
303
|
class: "lumal-global-search__results",
|
|
289
304
|
role: "listbox"
|
|
290
|
-
}, [(b(!0), l(t, null, S(
|
|
305
|
+
}, [(b(!0), l(t, null, S(M.value, (e, t) => (b(), l("li", {
|
|
291
306
|
id: `${p}-option-${t}`,
|
|
292
307
|
key: e.item.path,
|
|
293
308
|
role: "option",
|
|
294
|
-
"aria-selected": t ===
|
|
309
|
+
"aria-selected": t === w.value
|
|
295
310
|
}, [u("button", {
|
|
296
311
|
type: "button",
|
|
297
|
-
class: v({ "is-active": t ===
|
|
298
|
-
onMouseenter: (e) =>
|
|
299
|
-
onClick: (t) =>
|
|
312
|
+
class: v({ "is-active": t === w.value }),
|
|
313
|
+
onMouseenter: (e) => w.value = t,
|
|
314
|
+
onClick: (t) => oe(e)
|
|
300
315
|
}, [
|
|
301
|
-
e.item.icon ? (b(), s(O(
|
|
316
|
+
e.item.icon ? (b(), s(O(F), {
|
|
302
317
|
key: 0,
|
|
303
318
|
name: e.item.icon,
|
|
304
319
|
size: 18
|
|
305
320
|
}, null, 8, ["name"])) : c("", !0),
|
|
306
321
|
u("span", null, [u("strong", null, D(e.item.title), 1), u("small", null, D(e.trail.join(" / ")), 1)]),
|
|
307
322
|
u("code", null, D(e.item.path), 1)
|
|
308
|
-
], 42, Ce)], 8, Z))), 128))], 8,
|
|
309
|
-
|
|
310
|
-
],
|
|
323
|
+
], 42, Ce)], 8, Z))), 128))], 8, Se),
|
|
324
|
+
M.value.length === 0 ? (b(), l("p", we, " 未找到匹配菜单,请尝试其他关键词 ")) : c("", !0)
|
|
325
|
+
], 40, Y)], 32)) : c("", !0)]))]));
|
|
311
326
|
}
|
|
312
|
-
}), [["__scopeId", "data-v-
|
|
327
|
+
}), [["__scopeId", "data-v-d6fd5c73"]]), De = { class: "lumal-header__left" }, Oe = {
|
|
313
328
|
key: 0,
|
|
314
329
|
class: "lumal-header__title"
|
|
315
330
|
}, ke = {
|
|
316
331
|
key: 0,
|
|
317
332
|
class: "lumal-header__breadcrumb"
|
|
318
|
-
},
|
|
333
|
+
}, Ae = {
|
|
319
334
|
key: 1,
|
|
320
335
|
class: "lumal-header__navigation",
|
|
321
336
|
"aria-label": "主导航"
|
|
322
|
-
},
|
|
337
|
+
}, Q = {
|
|
323
338
|
key: 2,
|
|
324
339
|
class: "lumal-header__actions"
|
|
325
340
|
}, je = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
@@ -353,14 +368,14 @@ var K = {
|
|
|
353
368
|
return t({
|
|
354
369
|
getHeaderElement: () => a.value?.$el,
|
|
355
370
|
getHeaderInstance: () => a.value
|
|
356
|
-
}), (t, n) => (b(), s(O(
|
|
371
|
+
}), (t, n) => (b(), s(O(ae), {
|
|
357
372
|
ref_key: "headerRef",
|
|
358
373
|
ref: a,
|
|
359
374
|
class: "lumal-header",
|
|
360
375
|
height: e.height
|
|
361
376
|
}, {
|
|
362
|
-
default:
|
|
363
|
-
u("div", De, [C(t.$slots, "logo", {}, () => [e.title ? (b(), l("span", Oe, D(e.title), 1)) : c("", !0)], !0), e.sidebarEnabled ? (b(), s(O(
|
|
377
|
+
default: P(() => [
|
|
378
|
+
u("div", De, [C(t.$slots, "logo", {}, () => [e.title ? (b(), l("span", Oe, D(e.title), 1)) : c("", !0)], !0), e.sidebarEnabled ? (b(), s(O(L), {
|
|
364
379
|
key: 0,
|
|
365
380
|
class: v(["lumal-header__toggle", {
|
|
366
381
|
"is-after-title": e.toggleAfterTitle,
|
|
@@ -371,15 +386,15 @@ var K = {
|
|
|
371
386
|
"data-action": "toggle-sidebar",
|
|
372
387
|
onClick: f
|
|
373
388
|
}, {
|
|
374
|
-
default:
|
|
389
|
+
default: P(() => [...n[0] ||= [u("svg", {
|
|
375
390
|
"aria-hidden": "true",
|
|
376
391
|
viewBox: "0 0 24 24"
|
|
377
392
|
}, [u("path", { d: "M4 7h16M4 12h16M4 17h16" })], -1)]]),
|
|
378
393
|
_: 1
|
|
379
394
|
}, 8, ["class", "aria-label"])) : c("", !0)]),
|
|
380
395
|
t.$slots.breadcrumb ? (b(), l("div", ke, [C(t.$slots, "breadcrumb", {}, void 0, !0)])) : c("", !0),
|
|
381
|
-
t.$slots.navigation ? (b(), l("nav",
|
|
382
|
-
t.$slots.actions ? (b(), l("div",
|
|
396
|
+
t.$slots.navigation ? (b(), l("nav", Ae, [C(t.$slots, "navigation", {}, void 0, !0)])) : c("", !0),
|
|
397
|
+
t.$slots.actions ? (b(), l("div", Q, [C(t.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
383
398
|
]),
|
|
384
399
|
_: 3
|
|
385
400
|
}, 8, ["height"]));
|
|
@@ -440,14 +455,14 @@ var K = {
|
|
|
440
455
|
}
|
|
441
456
|
return (n, r) => {
|
|
442
457
|
let i = w("LumalSidebarMenuItem", !0);
|
|
443
|
-
return d.value ? (b(), s(O(
|
|
458
|
+
return d.value ? (b(), s(O(V), {
|
|
444
459
|
key: 0,
|
|
445
460
|
class: "lumal-sidebar-menu-item",
|
|
446
461
|
index: e.item.path,
|
|
447
462
|
title: e.collapsed ? e.item.title : void 0
|
|
448
463
|
}, {
|
|
449
|
-
title:
|
|
450
|
-
e.item.icon ? (b(), l("i", Pe, [f(O(
|
|
464
|
+
title: P(() => [
|
|
465
|
+
e.item.icon ? (b(), l("i", Pe, [f(O(F), {
|
|
451
466
|
name: e.item.icon,
|
|
452
467
|
size: 16
|
|
453
468
|
}, null, 8, ["name"])])) : c("", !0),
|
|
@@ -464,7 +479,7 @@ var K = {
|
|
|
464
479
|
])]),
|
|
465
480
|
e.item.externalLink ? (b(), l("span", Le, "↗")) : c("", !0)
|
|
466
481
|
]),
|
|
467
|
-
default:
|
|
482
|
+
default: P(() => [(b(!0), l(t, null, S(a.value, (t) => (b(), s(i, {
|
|
468
483
|
key: t.path,
|
|
469
484
|
item: t,
|
|
470
485
|
"active-path": e.activePath,
|
|
@@ -486,7 +501,7 @@ var K = {
|
|
|
486
501
|
title: e.collapsed ? e.item.title : void 0,
|
|
487
502
|
onClick: r[0] ||= (t) => m(e.item.path)
|
|
488
503
|
}, [
|
|
489
|
-
e.item.icon ? (b(), l("i", ze, [f(O(
|
|
504
|
+
e.item.icon ? (b(), l("i", ze, [f(O(F), {
|
|
490
505
|
name: e.item.icon,
|
|
491
506
|
size: 16
|
|
492
507
|
}, null, 8, ["name"])])) : c("", !0),
|
|
@@ -505,15 +520,15 @@ var K = {
|
|
|
505
520
|
class: "lumal-sidebar-menu-item__external",
|
|
506
521
|
"aria-hidden": "true"
|
|
507
522
|
}, "↗", -1)
|
|
508
|
-
], 8, Re)) : (b(), s(O(
|
|
523
|
+
], 8, Re)) : (b(), s(O(B), {
|
|
509
524
|
key: 2,
|
|
510
525
|
class: "lumal-sidebar-menu-item",
|
|
511
526
|
index: e.item.path,
|
|
512
527
|
title: e.collapsed ? e.item.title : void 0,
|
|
513
528
|
onClick: r[1] ||= (t) => m(e.item.path)
|
|
514
529
|
}, {
|
|
515
|
-
default:
|
|
516
|
-
e.item.icon ? (b(), l("i", He, [f(O(
|
|
530
|
+
default: P(() => [
|
|
531
|
+
e.item.icon ? (b(), l("i", He, [f(O(F), {
|
|
517
532
|
name: e.item.icon,
|
|
518
533
|
size: 16
|
|
519
534
|
}, null, 8, ["name"])])) : c("", !0),
|
|
@@ -556,20 +571,20 @@ var K = {
|
|
|
556
571
|
return n({
|
|
557
572
|
getAsideElement: () => c.value?.$el,
|
|
558
573
|
getAsideInstance: () => c.value
|
|
559
|
-
}), (n, r) => (b(), s(O(
|
|
574
|
+
}), (n, r) => (b(), s(O(I), {
|
|
560
575
|
ref_key: "asideRef",
|
|
561
576
|
ref: c,
|
|
562
577
|
class: "lumal-sidebar",
|
|
563
578
|
width: u.value,
|
|
564
579
|
"aria-label": e.ariaLabel
|
|
565
580
|
}, {
|
|
566
|
-
default:
|
|
567
|
-
default:
|
|
581
|
+
default: P(() => [f(O(se), { class: "lumal-sidebar__scrollbar" }, {
|
|
582
|
+
default: P(() => [f(O(z), {
|
|
568
583
|
class: "lumal-sidebar__menu",
|
|
569
584
|
collapse: e.collapsed,
|
|
570
585
|
"default-active": e.activePath
|
|
571
586
|
}, {
|
|
572
|
-
default:
|
|
587
|
+
default: P(() => [(b(!0), l(t, null, S(e.menus.filter((e) => !e.hidden), (t) => (b(), s(Ke, {
|
|
573
588
|
key: t.path,
|
|
574
589
|
item: t,
|
|
575
590
|
"active-path": e.activePath,
|
|
@@ -663,61 +678,61 @@ var K = {
|
|
|
663
678
|
path: "",
|
|
664
679
|
style: {},
|
|
665
680
|
visible: !1
|
|
666
|
-
}), C = E(!1), w = E(!1), T = E(!0), k = E(!1), j,
|
|
667
|
-
function
|
|
668
|
-
|
|
681
|
+
}), C = E(!1), w = E(!1), T = E(!0), k = E(!1), j, I, L = null, R = o(() => g.value.visible ? g.value : x.value), ae = o(() => R.value.path), oe = E(!0), z;
|
|
682
|
+
function B() {
|
|
683
|
+
oe.value = !z || !z.matches;
|
|
669
684
|
}
|
|
670
|
-
function
|
|
671
|
-
typeof window > "u" || typeof window.matchMedia != "function" || (
|
|
685
|
+
function se() {
|
|
686
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (z = window.matchMedia("(max-width: 768px)"), B(), typeof z.addEventListener == "function" ? z.addEventListener("change", B) : z.addListener?.(B));
|
|
672
687
|
}
|
|
673
|
-
function
|
|
674
|
-
typeof
|
|
688
|
+
function V() {
|
|
689
|
+
typeof z?.removeEventListener == "function" ? z.removeEventListener("change", B) : z?.removeListener?.(B), z = void 0;
|
|
675
690
|
}
|
|
676
|
-
let
|
|
677
|
-
function
|
|
691
|
+
let H = o(() => d.draggable && oe.value), ce = o(() => d.tabs.some((e) => e.closable !== !1 && e.pinned !== !0));
|
|
692
|
+
function le(e) {
|
|
678
693
|
return d.tabs.length > 1 && d.tabs.some((t) => t.path === e && t.closable !== !1 && t.pinned !== !0);
|
|
679
694
|
}
|
|
680
|
-
function
|
|
695
|
+
function U(e, t) {
|
|
681
696
|
let n = d.tabs.findIndex((t) => t.path === e);
|
|
682
697
|
return (t === "left" ? d.tabs.slice(0, n) : d.tabs.slice(n + 1)).some((e) => e.closable !== !1 && e.pinned !== !0);
|
|
683
698
|
}
|
|
684
|
-
function
|
|
699
|
+
function W(e) {
|
|
685
700
|
return d.tabs.some((t) => t.path !== e && t.closable !== !1 && t.pinned !== !0);
|
|
686
701
|
}
|
|
687
|
-
function
|
|
702
|
+
function G(e) {
|
|
688
703
|
return e === m.value;
|
|
689
704
|
}
|
|
690
|
-
function
|
|
705
|
+
function de(e) {
|
|
691
706
|
let t = d.tabs.find((t) => t.path === e);
|
|
692
707
|
return !!t && t.pinned !== !0 && t.closable !== !1;
|
|
693
708
|
}
|
|
694
|
-
function
|
|
709
|
+
function fe(e) {
|
|
695
710
|
let t = d.tabs.find((t) => t.path === e);
|
|
696
711
|
return !!t && t.pinned === !0 && t.closable !== !1;
|
|
697
712
|
}
|
|
698
|
-
function G(e) {
|
|
699
|
-
let t = oe.value;
|
|
700
|
-
return e === "close" ? !ue(t) : e === "close-left" || e === "close-right" ? !t || !W(t) || !H(t, e === "close-left" ? "left" : "right") : e === "close-others" ? !t || !W(t) || !U(t) : e === "close-all" ? !le.value : e === "refresh" ? !t || !W(t) : e === "pin" ? !fe(t) && !pe(t) : e === "new-window" && !t;
|
|
701
|
-
}
|
|
702
713
|
function K(e) {
|
|
703
|
-
|
|
714
|
+
let t = ae.value;
|
|
715
|
+
return e === "close" ? !le(t) : e === "close-left" || e === "close-right" ? !t || !G(t) || !U(t, e === "close-left" ? "left" : "right") : e === "close-others" ? !t || !G(t) || !W(t) : e === "close-all" ? !ce.value : e === "refresh" ? !t || !G(t) : e === "pin" ? !de(t) && !fe(t) : e === "new-window" && !t;
|
|
716
|
+
}
|
|
717
|
+
function q(e) {
|
|
718
|
+
return fe(e) ? "取消固定" : "固定";
|
|
704
719
|
}
|
|
705
|
-
function
|
|
720
|
+
function pe() {
|
|
706
721
|
return C.value ? "还原" : "内容最大化";
|
|
707
722
|
}
|
|
708
|
-
function
|
|
723
|
+
function J(e) {
|
|
709
724
|
e !== m.value && (m.value = e, p("change", e));
|
|
710
725
|
}
|
|
726
|
+
function me(e) {
|
|
727
|
+
le(e) && p("remove", e);
|
|
728
|
+
}
|
|
711
729
|
function he(e) {
|
|
712
|
-
|
|
730
|
+
e && G(e) && p("refresh", e);
|
|
713
731
|
}
|
|
714
|
-
function ge(e) {
|
|
715
|
-
e
|
|
732
|
+
function ge(e, t) {
|
|
733
|
+
e.button !== 1 || !d.middleClickToClose || !le(t.path) || (e.preventDefault(), p("remove", t.path));
|
|
716
734
|
}
|
|
717
735
|
function _e(e, t) {
|
|
718
|
-
e.button !== 1 || !d.middleClickToClose || !ue(t.path) || (e.preventDefault(), p("remove", t.path));
|
|
719
|
-
}
|
|
720
|
-
function ve(e, t) {
|
|
721
736
|
if (![
|
|
722
737
|
"ArrowLeft",
|
|
723
738
|
"ArrowRight",
|
|
@@ -726,17 +741,17 @@ var K = {
|
|
|
726
741
|
].includes(e.key) || d.tabs.length === 0) return;
|
|
727
742
|
e.preventDefault();
|
|
728
743
|
let n = e.key === "Home" ? 0 : e.key === "End" ? d.tabs.length - 1 : e.key === "ArrowLeft" ? (t - 1 + d.tabs.length) % d.tabs.length : (t + 1) % d.tabs.length, r = d.tabs[n];
|
|
729
|
-
r && (
|
|
744
|
+
r && (J(r.path), _(() => {
|
|
730
745
|
h.value?.querySelectorAll("[role=\"tab\"]").item(n).focus();
|
|
731
746
|
}));
|
|
732
747
|
}
|
|
733
|
-
function
|
|
748
|
+
function ve(e, t) {
|
|
734
749
|
return {
|
|
735
750
|
left: `${Math.max(8, Math.min(e, window.innerWidth - ft - 8))}px`,
|
|
736
751
|
top: `${Math.max(8, Math.min(t, window.innerHeight - pt - 8))}px`
|
|
737
752
|
};
|
|
738
753
|
}
|
|
739
|
-
function
|
|
754
|
+
function Y() {
|
|
740
755
|
g.value = {
|
|
741
756
|
...g.value,
|
|
742
757
|
visible: !1
|
|
@@ -745,39 +760,39 @@ var K = {
|
|
|
745
760
|
visible: !1
|
|
746
761
|
};
|
|
747
762
|
}
|
|
748
|
-
function
|
|
749
|
-
e.preventDefault(), e.stopPropagation(),
|
|
763
|
+
function ye(e, t) {
|
|
764
|
+
e.preventDefault(), e.stopPropagation(), L = e.currentTarget, g.value = {
|
|
750
765
|
path: t,
|
|
751
|
-
style:
|
|
766
|
+
style: ve(e.clientX, e.clientY),
|
|
752
767
|
visible: !0
|
|
753
768
|
}, x.value = {
|
|
754
769
|
...x.value,
|
|
755
770
|
visible: !1
|
|
756
771
|
};
|
|
757
772
|
}
|
|
758
|
-
function
|
|
773
|
+
function be(e) {
|
|
759
774
|
e.preventDefault(), e.stopPropagation();
|
|
760
775
|
let t = m.value || d.tabs[0]?.path || "";
|
|
761
|
-
|
|
776
|
+
L = e.currentTarget, x.value = {
|
|
762
777
|
path: t,
|
|
763
|
-
style:
|
|
778
|
+
style: ve(e.clientX, e.clientY),
|
|
764
779
|
visible: !0
|
|
765
780
|
}, g.value = {
|
|
766
781
|
...g.value,
|
|
767
782
|
visible: !1
|
|
768
783
|
};
|
|
769
784
|
}
|
|
770
|
-
function
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
function Y(e) {
|
|
774
|
-
if (G(e)) return;
|
|
775
|
-
let t = oe.value;
|
|
776
|
-
J(), e === "close" ? p("remove", t) : e === "close-left" ? p("closeLeft", t) : e === "close-right" ? p("closeRight", t) : e === "close-others" ? p("closeOthers", t) : e === "close-all" ? p("closeAll") : e === "refresh" ? p("refresh", t) : e === "pin" ? p("pin", t, !pe(t)) : e === "new-window" ? p("newWindow", t) : e === "maximize" && ke(), _(Se);
|
|
785
|
+
function xe() {
|
|
786
|
+
L && document.body.contains(L) && (L.focus(), L = null);
|
|
777
787
|
}
|
|
778
788
|
function X(e) {
|
|
789
|
+
if (K(e)) return;
|
|
790
|
+
let t = ae.value;
|
|
791
|
+
Y(), e === "close" ? p("remove", t) : e === "close-left" ? p("closeLeft", t) : e === "close-right" ? p("closeRight", t) : e === "close-others" ? p("closeOthers", t) : e === "close-all" ? p("closeAll") : e === "refresh" ? p("refresh", t) : e === "pin" ? p("pin", t, !fe(t)) : e === "new-window" ? p("newWindow", t) : e === "maximize" && ke(), _(xe);
|
|
792
|
+
}
|
|
793
|
+
function Se(e) {
|
|
779
794
|
if (e.key === "Escape") {
|
|
780
|
-
e.preventDefault(),
|
|
795
|
+
e.preventDefault(), Y(), _(xe);
|
|
781
796
|
return;
|
|
782
797
|
}
|
|
783
798
|
let t = Array.from(document.querySelectorAll("[data-menu-active=\"true\"] [role=\"menuitem\"]:not(:disabled)"));
|
|
@@ -815,11 +830,11 @@ var K = {
|
|
|
815
830
|
}
|
|
816
831
|
function De() {
|
|
817
832
|
let e = h.value?.querySelector(".lumal-tabs__list");
|
|
818
|
-
if (!e || !
|
|
833
|
+
if (!e || !H.value) {
|
|
819
834
|
Oe();
|
|
820
835
|
return;
|
|
821
836
|
}
|
|
822
|
-
|
|
837
|
+
I && I.el === e || (Oe(), I = ue.create(e, {
|
|
823
838
|
animation: 160,
|
|
824
839
|
draggable: ".lumal-tabs__item",
|
|
825
840
|
filter: ".is-not-draggable",
|
|
@@ -833,23 +848,23 @@ var K = {
|
|
|
833
848
|
}));
|
|
834
849
|
}
|
|
835
850
|
function Oe() {
|
|
836
|
-
|
|
851
|
+
I?.destroy(), I = void 0;
|
|
837
852
|
}
|
|
838
|
-
|
|
853
|
+
N(H, (e) => {
|
|
839
854
|
e ? _(De) : Oe();
|
|
840
855
|
});
|
|
841
856
|
function ke() {
|
|
842
857
|
if (d.standaloneMaximize) {
|
|
843
|
-
|
|
858
|
+
Ae();
|
|
844
859
|
return;
|
|
845
860
|
}
|
|
846
861
|
C.value = !C.value, p("maximize", C.value);
|
|
847
862
|
}
|
|
848
|
-
async function
|
|
863
|
+
async function Ae() {
|
|
849
864
|
let e = document.querySelector(d.fullscreenTarget);
|
|
850
865
|
e instanceof HTMLElement && (document.fullscreenElement ? await document.exitFullscreen?.() : await e.requestFullscreen?.());
|
|
851
866
|
}
|
|
852
|
-
function
|
|
867
|
+
function Q() {
|
|
853
868
|
C.value = !!document.fullscreenElement && d.standaloneMaximize, d.standaloneMaximize && p("maximize", C.value);
|
|
854
869
|
}
|
|
855
870
|
function je(e) {
|
|
@@ -857,36 +872,36 @@ var K = {
|
|
|
857
872
|
}
|
|
858
873
|
n({
|
|
859
874
|
getTabsElement: () => h.value,
|
|
860
|
-
refreshCurrent: () =>
|
|
875
|
+
refreshCurrent: () => he(m.value),
|
|
861
876
|
scrollTabs: we,
|
|
862
877
|
toggleFullscreen: ke,
|
|
863
878
|
setMaximized: je
|
|
864
|
-
}),
|
|
879
|
+
}), N(() => [d.activePath, d.tabs.length], () => void Ee(), { flush: "post" }), N(() => d.tabs, () => void _(Z), { flush: "post" });
|
|
865
880
|
function Me(e) {
|
|
866
881
|
let t = e.target;
|
|
867
|
-
t && (t.closest?.(".lumal-tabs-context-menu") || t.closest?.("[data-tab-menu-trigger]") ||
|
|
882
|
+
t && (t.closest?.(".lumal-tabs-context-menu") || t.closest?.("[data-tab-menu-trigger]") || Y());
|
|
868
883
|
}
|
|
869
884
|
function Ne(e) {
|
|
870
|
-
e.key === "Escape" &&
|
|
885
|
+
e.key === "Escape" && R.value.visible && (e.preventDefault(), Y(), _(xe));
|
|
871
886
|
}
|
|
872
887
|
return te(() => {
|
|
873
|
-
|
|
888
|
+
se(), document.addEventListener("click", Me), document.addEventListener("fullscreenchange", Q), document.addEventListener("keydown", Ne), Z(), typeof ResizeObserver < "u" && h.value && (j = new ResizeObserver(Z), j.observe(h.value)), H.value && _(De);
|
|
874
889
|
}), ee(() => {
|
|
875
|
-
|
|
890
|
+
V(), document.removeEventListener("click", Me), document.removeEventListener("fullscreenchange", Q), document.removeEventListener("keydown", Ne), j?.disconnect(), Oe();
|
|
876
891
|
}), (n, i) => e.visible && e.tabs.length ? (b(), l("div", {
|
|
877
892
|
key: 0,
|
|
878
893
|
class: v(["lumal-tabs", [`is-style-${e.styleType}`]])
|
|
879
894
|
}, [
|
|
880
|
-
|
|
895
|
+
re(u("button", {
|
|
881
896
|
class: "lumal-tabs__tool",
|
|
882
897
|
type: "button",
|
|
883
898
|
"aria-label": "向左滚动标签",
|
|
884
899
|
disabled: T.value,
|
|
885
900
|
onClick: i[0] ||= (e) => we("left")
|
|
886
|
-
}, [f(O(
|
|
901
|
+
}, [f(O(F), {
|
|
887
902
|
name: "lumal:chevron-left",
|
|
888
903
|
size: 16
|
|
889
|
-
})], 8, Je), [[
|
|
904
|
+
})], 8, Je), [[M, w.value]]),
|
|
890
905
|
u("div", {
|
|
891
906
|
ref_key: "tabsViewportRef",
|
|
892
907
|
ref: h,
|
|
@@ -900,57 +915,57 @@ var K = {
|
|
|
900
915
|
role: "tablist",
|
|
901
916
|
"aria-label": "页面标签"
|
|
902
917
|
}, {
|
|
903
|
-
default:
|
|
918
|
+
default: P(() => [(b(!0), l(t, null, S(e.tabs, (t, n) => (b(), l("div", {
|
|
904
919
|
key: t.path,
|
|
905
920
|
class: v(["lumal-tabs__item", {
|
|
906
921
|
"is-active": t.path === m.value,
|
|
907
922
|
"is-pinned": t.pinned === !0,
|
|
908
|
-
"is-not-draggable": t.pinned === !0 || !
|
|
923
|
+
"is-not-draggable": t.pinned === !0 || !H.value
|
|
909
924
|
}]),
|
|
910
|
-
onContextmenu: (e) =>
|
|
925
|
+
onContextmenu: (e) => ye(e, t.path)
|
|
911
926
|
}, [u("button", {
|
|
912
927
|
class: "lumal-tabs__tab",
|
|
913
928
|
type: "button",
|
|
914
929
|
role: "tab",
|
|
915
930
|
"aria-selected": t.path === m.value,
|
|
916
931
|
tabindex: t.path === m.value ? 0 : -1,
|
|
917
|
-
onClick: (e) =>
|
|
918
|
-
onKeydown: (e) =>
|
|
919
|
-
onMousedown: (e) =>
|
|
920
|
-
}, [t.pinned === !0 ? (b(), s(O(
|
|
932
|
+
onClick: (e) => J(t.path),
|
|
933
|
+
onKeydown: (e) => _e(e, n),
|
|
934
|
+
onMousedown: (e) => ge(e, t)
|
|
935
|
+
}, [t.pinned === !0 ? (b(), s(O(F), {
|
|
921
936
|
key: 0,
|
|
922
937
|
class: "lumal-tabs__pin",
|
|
923
938
|
name: "lumal:pin",
|
|
924
939
|
size: 14
|
|
925
|
-
})) : e.showIcon && t.icon ? (b(), s(O(
|
|
940
|
+
})) : e.showIcon && t.icon ? (b(), s(O(F), {
|
|
926
941
|
key: 1,
|
|
927
942
|
name: t.icon,
|
|
928
943
|
size: 14
|
|
929
944
|
}, null, 8, ["name"])) : c("", !0), u("span", {
|
|
930
945
|
class: "lumal-tabs__label",
|
|
931
946
|
title: t.title
|
|
932
|
-
}, D(t.title), 9, Ze)], 40, Xe),
|
|
947
|
+
}, D(t.title), 9, Ze)], 40, Xe), le(t.path) ? (b(), l("button", {
|
|
933
948
|
key: 0,
|
|
934
949
|
class: "lumal-tabs__close",
|
|
935
950
|
type: "button",
|
|
936
951
|
"aria-label": `关闭${t.title}`,
|
|
937
|
-
onClick: (e) =>
|
|
938
|
-
}, [f(O(
|
|
952
|
+
onClick: (e) => me(t.path)
|
|
953
|
+
}, [f(O(F), {
|
|
939
954
|
name: "lumal:close",
|
|
940
955
|
size: 14
|
|
941
956
|
})], 8, Qe)) : c("", !0)], 42, Ye))), 128))]),
|
|
942
957
|
_: 1
|
|
943
958
|
})], 544),
|
|
944
|
-
|
|
959
|
+
re(u("button", {
|
|
945
960
|
class: "lumal-tabs__tool",
|
|
946
961
|
type: "button",
|
|
947
962
|
"aria-label": "向右滚动标签",
|
|
948
963
|
disabled: k.value,
|
|
949
964
|
onClick: i[1] ||= (e) => we("right")
|
|
950
|
-
}, [f(O(
|
|
965
|
+
}, [f(O(F), {
|
|
951
966
|
name: "lumal:chevron-right",
|
|
952
967
|
size: 16
|
|
953
|
-
})], 8, $e), [[
|
|
968
|
+
})], 8, $e), [[M, w.value]]),
|
|
954
969
|
e.showRefresh ? (b(), l("button", {
|
|
955
970
|
key: 0,
|
|
956
971
|
class: "lumal-tabs__tool lumal-tabs__tool--refresh",
|
|
@@ -958,8 +973,8 @@ var K = {
|
|
|
958
973
|
"aria-label": "刷新当前页面",
|
|
959
974
|
"data-action": "refresh-current-tab",
|
|
960
975
|
disabled: !m.value,
|
|
961
|
-
onClick: i[2] ||= (e) =>
|
|
962
|
-
}, [f(O(
|
|
976
|
+
onClick: i[2] ||= (e) => he(m.value)
|
|
977
|
+
}, [f(O(F), {
|
|
963
978
|
name: "lumal:refresh",
|
|
964
979
|
size: 16
|
|
965
980
|
})], 8, et)) : c("", !0),
|
|
@@ -971,8 +986,8 @@ var K = {
|
|
|
971
986
|
"aria-haspopup": "menu",
|
|
972
987
|
"aria-expanded": x.value.visible,
|
|
973
988
|
"data-tab-menu-trigger": "",
|
|
974
|
-
onClick: i[3] ||= (e) =>
|
|
975
|
-
}, [f(O(
|
|
989
|
+
onClick: i[3] ||= (e) => be(e)
|
|
990
|
+
}, [f(O(F), {
|
|
976
991
|
name: "lumal:more",
|
|
977
992
|
size: 16
|
|
978
993
|
})], 8, tt)) : c("", !0),
|
|
@@ -983,7 +998,7 @@ var K = {
|
|
|
983
998
|
"aria-label": C.value ? "退出内容最大化" : "内容最大化",
|
|
984
999
|
"data-action": "maximize-content",
|
|
985
1000
|
onClick: ke
|
|
986
|
-
}, [f(O(
|
|
1001
|
+
}, [f(O(F), {
|
|
987
1002
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
988
1003
|
size: 16
|
|
989
1004
|
}, null, 8, ["name"])], 8, nt)) : c("", !0),
|
|
@@ -992,43 +1007,43 @@ var K = {
|
|
|
992
1007
|
class: "lumal-tabs-context-menu",
|
|
993
1008
|
role: "menu",
|
|
994
1009
|
"data-menu-active": !0,
|
|
995
|
-
style: y(
|
|
996
|
-
onClick: i[13] ||=
|
|
997
|
-
onKeydown:
|
|
1010
|
+
style: y(R.value.style),
|
|
1011
|
+
onClick: i[13] ||= ie(() => {}, ["stop"]),
|
|
1012
|
+
onKeydown: Se
|
|
998
1013
|
}, [
|
|
999
1014
|
u("button", {
|
|
1000
1015
|
type: "button",
|
|
1001
1016
|
role: "menuitem",
|
|
1002
|
-
disabled:
|
|
1003
|
-
onClick: i[4] ||= (e) =>
|
|
1004
|
-
}, [f(O(
|
|
1017
|
+
disabled: K("refresh"),
|
|
1018
|
+
onClick: i[4] ||= (e) => X("refresh")
|
|
1019
|
+
}, [f(O(F), {
|
|
1005
1020
|
name: "lumal:refresh",
|
|
1006
1021
|
size: 14
|
|
1007
1022
|
}), i[14] ||= u("span", null, "重新加载", -1)], 8, rt),
|
|
1008
1023
|
u("button", {
|
|
1009
1024
|
type: "button",
|
|
1010
1025
|
role: "menuitem",
|
|
1011
|
-
disabled:
|
|
1012
|
-
onClick: i[5] ||= (e) =>
|
|
1013
|
-
}, [f(O(
|
|
1014
|
-
name:
|
|
1026
|
+
disabled: K("pin"),
|
|
1027
|
+
onClick: i[5] ||= (e) => X("pin")
|
|
1028
|
+
}, [f(O(F), {
|
|
1029
|
+
name: fe(ae.value) ? "lumal:pin-off" : "lumal:pin",
|
|
1015
1030
|
size: 14
|
|
1016
|
-
}, null, 8, ["name"]), u("span", null, D(
|
|
1031
|
+
}, null, 8, ["name"]), u("span", null, D(q(ae.value)), 1)], 8, it),
|
|
1017
1032
|
u("button", {
|
|
1018
1033
|
type: "button",
|
|
1019
1034
|
role: "menuitem",
|
|
1020
|
-
disabled:
|
|
1021
|
-
onClick: i[6] ||= (e) =>
|
|
1022
|
-
}, [f(O(
|
|
1035
|
+
disabled: K("maximize"),
|
|
1036
|
+
onClick: i[6] ||= (e) => X("maximize")
|
|
1037
|
+
}, [f(O(F), {
|
|
1023
1038
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
1024
1039
|
size: 14
|
|
1025
|
-
}, null, 8, ["name"]), u("span", null, D(
|
|
1040
|
+
}, null, 8, ["name"]), u("span", null, D(pe()), 1)], 8, at),
|
|
1026
1041
|
u("button", {
|
|
1027
1042
|
type: "button",
|
|
1028
1043
|
role: "menuitem",
|
|
1029
|
-
disabled:
|
|
1030
|
-
onClick: i[7] ||= (e) =>
|
|
1031
|
-
}, [f(O(
|
|
1044
|
+
disabled: K("new-window"),
|
|
1045
|
+
onClick: i[7] ||= (e) => X("new-window")
|
|
1046
|
+
}, [f(O(F), {
|
|
1032
1047
|
name: "lumal:external-link",
|
|
1033
1048
|
size: 14
|
|
1034
1049
|
}), i[15] ||= u("span", null, "在新窗口打开", -1)], 8, ot),
|
|
@@ -1036,45 +1051,45 @@ var K = {
|
|
|
1036
1051
|
u("button", {
|
|
1037
1052
|
type: "button",
|
|
1038
1053
|
role: "menuitem",
|
|
1039
|
-
disabled:
|
|
1040
|
-
onClick: i[8] ||= (e) =>
|
|
1041
|
-
}, [f(O(
|
|
1054
|
+
disabled: K("close"),
|
|
1055
|
+
onClick: i[8] ||= (e) => X("close")
|
|
1056
|
+
}, [f(O(F), {
|
|
1042
1057
|
name: "lumal:close",
|
|
1043
1058
|
size: 14
|
|
1044
1059
|
}), i[16] ||= u("span", null, "关闭", -1)], 8, st),
|
|
1045
1060
|
u("button", {
|
|
1046
1061
|
type: "button",
|
|
1047
1062
|
role: "menuitem",
|
|
1048
|
-
disabled:
|
|
1049
|
-
onClick: i[9] ||= (e) =>
|
|
1050
|
-
}, [f(O(
|
|
1063
|
+
disabled: K("close-left"),
|
|
1064
|
+
onClick: i[9] ||= (e) => X("close-left")
|
|
1065
|
+
}, [f(O(F), {
|
|
1051
1066
|
name: "lumal:chevron-left",
|
|
1052
1067
|
size: 14
|
|
1053
1068
|
}), i[17] ||= u("span", null, "关闭左侧", -1)], 8, ct),
|
|
1054
1069
|
u("button", {
|
|
1055
1070
|
type: "button",
|
|
1056
1071
|
role: "menuitem",
|
|
1057
|
-
disabled:
|
|
1058
|
-
onClick: i[10] ||= (e) =>
|
|
1059
|
-
}, [f(O(
|
|
1072
|
+
disabled: K("close-right"),
|
|
1073
|
+
onClick: i[10] ||= (e) => X("close-right")
|
|
1074
|
+
}, [f(O(F), {
|
|
1060
1075
|
name: "lumal:chevron-right",
|
|
1061
1076
|
size: 14
|
|
1062
1077
|
}), i[18] ||= u("span", null, "关闭右侧", -1)], 8, lt),
|
|
1063
1078
|
u("button", {
|
|
1064
1079
|
type: "button",
|
|
1065
1080
|
role: "menuitem",
|
|
1066
|
-
disabled:
|
|
1067
|
-
onClick: i[11] ||= (e) =>
|
|
1068
|
-
}, [f(O(
|
|
1081
|
+
disabled: K("close-others"),
|
|
1082
|
+
onClick: i[11] ||= (e) => X("close-others")
|
|
1083
|
+
}, [f(O(F), {
|
|
1069
1084
|
name: "lumal:close",
|
|
1070
1085
|
size: 14
|
|
1071
1086
|
}), i[19] ||= u("span", null, "关闭其他", -1)], 8, ut),
|
|
1072
1087
|
u("button", {
|
|
1073
1088
|
type: "button",
|
|
1074
1089
|
role: "menuitem",
|
|
1075
|
-
disabled:
|
|
1076
|
-
onClick: i[12] ||= (e) =>
|
|
1077
|
-
}, [f(O(
|
|
1090
|
+
disabled: K("close-all"),
|
|
1091
|
+
onClick: i[12] ||= (e) => X("close-all")
|
|
1092
|
+
}, [f(O(F), {
|
|
1078
1093
|
name: "lumal:close",
|
|
1079
1094
|
size: 14
|
|
1080
1095
|
}), i[20] ||= u("span", null, "关闭全部", -1)], 8, dt)
|
|
@@ -1097,19 +1112,19 @@ var K = {
|
|
|
1097
1112
|
},
|
|
1098
1113
|
emits: ["select"],
|
|
1099
1114
|
setup(e, { emit: n }) {
|
|
1100
|
-
let r = e, i = n, a = o(() => r.item.children?.filter((e) => !e.hidden) ?? []), d = o(() => !!r.item.externalLink && r.item.externalTarget !== "_self"), p = o(() => !!r.activePath &&
|
|
1115
|
+
let r = e, i = n, a = o(() => r.item.children?.filter((e) => !e.hidden) ?? []), d = o(() => !!r.item.externalLink && r.item.externalTarget !== "_self"), p = o(() => !!r.activePath && U(r.item, r.activePath));
|
|
1101
1116
|
function m(e) {
|
|
1102
1117
|
i("select", e);
|
|
1103
1118
|
}
|
|
1104
1119
|
return (n, r) => {
|
|
1105
1120
|
let i = w("LumalTopNavMenuItem", !0);
|
|
1106
|
-
return a.value.length ? (b(), s(O(
|
|
1121
|
+
return a.value.length ? (b(), s(O(V), {
|
|
1107
1122
|
key: 0,
|
|
1108
1123
|
index: e.item.path,
|
|
1109
1124
|
class: v({ "is-active": p.value })
|
|
1110
1125
|
}, {
|
|
1111
|
-
title:
|
|
1112
|
-
e.item.icon ? (b(), s(O(
|
|
1126
|
+
title: P(() => [
|
|
1127
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1113
1128
|
key: 0,
|
|
1114
1129
|
name: e.item.icon,
|
|
1115
1130
|
size: 16
|
|
@@ -1127,7 +1142,7 @@ var K = {
|
|
|
1127
1142
|
])]),
|
|
1128
1143
|
e.item.externalLink ? (b(), l("span", gt, "↗")) : c("", !0)
|
|
1129
1144
|
]),
|
|
1130
|
-
default:
|
|
1145
|
+
default: P(() => [(b(!0), l(t, null, S(a.value, (t) => (b(), s(i, {
|
|
1131
1146
|
key: t.path,
|
|
1132
1147
|
item: t,
|
|
1133
1148
|
"active-path": e.activePath,
|
|
@@ -1141,7 +1156,7 @@ var K = {
|
|
|
1141
1156
|
tabindex: "-1",
|
|
1142
1157
|
onClick: r[0] ||= (t) => m(e.item.path)
|
|
1143
1158
|
}, [
|
|
1144
|
-
e.item.icon ? (b(), s(O(
|
|
1159
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1145
1160
|
key: 0,
|
|
1146
1161
|
name: e.item.icon,
|
|
1147
1162
|
size: 16
|
|
@@ -1161,14 +1176,14 @@ var K = {
|
|
|
1161
1176
|
class: "lumal-top-nav-menu-item__external",
|
|
1162
1177
|
"aria-hidden": "true"
|
|
1163
1178
|
}, "↗", -1)
|
|
1164
|
-
], 2)) : (b(), s(O(
|
|
1179
|
+
], 2)) : (b(), s(O(B), {
|
|
1165
1180
|
key: 2,
|
|
1166
1181
|
index: e.item.path,
|
|
1167
1182
|
class: v({ "is-active": p.value }),
|
|
1168
1183
|
onClick: r[1] ||= (t) => m(e.item.path)
|
|
1169
1184
|
}, {
|
|
1170
|
-
default:
|
|
1171
|
-
e.item.icon ? (b(), s(O(
|
|
1185
|
+
default: P(() => [
|
|
1186
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1172
1187
|
key: 0,
|
|
1173
1188
|
name: e.item.icon,
|
|
1174
1189
|
size: 16
|
|
@@ -1210,7 +1225,7 @@ var K = {
|
|
|
1210
1225
|
return !!e.externalLink && e.externalTarget !== "_self";
|
|
1211
1226
|
}
|
|
1212
1227
|
function h(e) {
|
|
1213
|
-
return i.activePath ? i.mode === "flat" ? e.path === i.activePath :
|
|
1228
|
+
return i.activePath ? i.mode === "flat" ? e.path === i.activePath : U(e, i.activePath) : !1;
|
|
1214
1229
|
}
|
|
1215
1230
|
function _(e) {
|
|
1216
1231
|
let t = h(e);
|
|
@@ -1234,7 +1249,7 @@ var K = {
|
|
|
1234
1249
|
return n({
|
|
1235
1250
|
getMenuElement: () => d.value?.$el,
|
|
1236
1251
|
getMenuInstance: () => d.value
|
|
1237
|
-
}), (n, r) => (b(), s(O(
|
|
1252
|
+
}), (n, r) => (b(), s(O(z), {
|
|
1238
1253
|
key: `top-nav:${e.mode}:${e.activePath}`,
|
|
1239
1254
|
ref_key: "menuRef",
|
|
1240
1255
|
ref: d,
|
|
@@ -1244,14 +1259,14 @@ var K = {
|
|
|
1244
1259
|
ellipsis: !0,
|
|
1245
1260
|
style: y(ee.value)
|
|
1246
1261
|
}, {
|
|
1247
|
-
default:
|
|
1262
|
+
default: P(() => [(b(!0), l(t, null, S(e.mode === "tree" ? p.value : [], (t) => (b(), s(bt, {
|
|
1248
1263
|
key: `tree:${t.path}`,
|
|
1249
1264
|
item: t,
|
|
1250
1265
|
"active-path": e.activePath,
|
|
1251
1266
|
onSelect: te
|
|
1252
|
-
}, null, 8, ["item", "active-path"]))), 128)), (b(!0), l(t, null, S(e.mode === "flat" ? p.value : [], (e) => (b(), s(T(m(e) ? "li" : O(
|
|
1253
|
-
default:
|
|
1254
|
-
e.icon ? (b(), s(O(
|
|
1267
|
+
}, null, 8, ["item", "active-path"]))), 128)), (b(!0), l(t, null, S(e.mode === "flat" ? p.value : [], (e) => (b(), s(T(m(e) ? "li" : O(B)), g({ key: `flat:${e.path}` }, { ref_for: !0 }, _(e), { onClick: (t) => te(e.path) }), {
|
|
1268
|
+
default: P(() => [
|
|
1269
|
+
e.icon ? (b(), s(O(F), {
|
|
1255
1270
|
key: 0,
|
|
1256
1271
|
name: e.icon,
|
|
1257
1272
|
size: 16
|
|
@@ -1529,14 +1544,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1529
1544
|
"tabPin",
|
|
1530
1545
|
"tabReorder",
|
|
1531
1546
|
"tabMaximize",
|
|
1532
|
-
"tabNewWindow"
|
|
1547
|
+
"tabNewWindow",
|
|
1548
|
+
"tabsChange"
|
|
1533
1549
|
], ["update:activeTabPath"]),
|
|
1534
1550
|
setup(e, { expose: t, emit: n }) {
|
|
1535
|
-
let r = e, a = n, u = ne(e, "activeTabPath"), p = m(
|
|
1536
|
-
function
|
|
1551
|
+
let r = e, a = n, u = ne(e, "activeTabPath"), p = m(ce, void 0), h = m(le, void 0), g = A("layoutRef"), _ = A("tabsRef"), y = E(!1), x = E(!1), S = E(!1), w = E([]), T = E(""), D = E([]), k = o(() => r.tabMaxCount ?? r.preferences.tabbar.maxCount), j;
|
|
1552
|
+
function ie(e) {
|
|
1537
1553
|
return e.meta.layout !== "public" && e.meta.hideInTab !== !0 && !!e.meta.title;
|
|
1538
1554
|
}
|
|
1539
|
-
function
|
|
1555
|
+
function F(e) {
|
|
1540
1556
|
let t = typeof e.meta.title == "string" ? e.meta.title : void 0;
|
|
1541
1557
|
if (t) return {
|
|
1542
1558
|
closable: e.meta.affixTab !== !0,
|
|
@@ -1545,14 +1561,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1545
1561
|
title: t
|
|
1546
1562
|
};
|
|
1547
1563
|
}
|
|
1548
|
-
function
|
|
1564
|
+
function I() {
|
|
1549
1565
|
return r.fixedTabs.map((e) => ({
|
|
1550
1566
|
...e,
|
|
1551
1567
|
closable: !1,
|
|
1552
1568
|
pinned: !0
|
|
1553
1569
|
}));
|
|
1554
1570
|
}
|
|
1555
|
-
function
|
|
1571
|
+
function L(e) {
|
|
1556
1572
|
return {
|
|
1557
1573
|
closable: e.closable !== !1,
|
|
1558
1574
|
icon: e.icon,
|
|
@@ -1561,7 +1577,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1561
1577
|
title: e.title
|
|
1562
1578
|
};
|
|
1563
1579
|
}
|
|
1564
|
-
function
|
|
1580
|
+
function ae() {
|
|
1565
1581
|
if (r.isValidTabPath) return r.isValidTabPath;
|
|
1566
1582
|
if (!(!h || !r.routeDriven)) return (e) => {
|
|
1567
1583
|
try {
|
|
@@ -1572,7 +1588,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1572
1588
|
}
|
|
1573
1589
|
};
|
|
1574
1590
|
}
|
|
1575
|
-
function
|
|
1591
|
+
function oe(e) {
|
|
1576
1592
|
if (!(!h || !r.routeDriven)) try {
|
|
1577
1593
|
let t = h.resolve(e)?.matched ?? [], n = t[t.length - 1], r = typeof n?.meta?.title == "string" ? n.meta.title : void 0, i = typeof n?.meta?.icon == "string" ? n.meta.icon : void 0;
|
|
1578
1594
|
return !r && !i ? void 0 : {
|
|
@@ -1583,35 +1599,37 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1583
1599
|
return;
|
|
1584
1600
|
}
|
|
1585
1601
|
}
|
|
1586
|
-
function
|
|
1587
|
-
if (!r.routeDriven || !(r.routeTabFilter ??
|
|
1588
|
-
let t = (r.routeTabResolver ??
|
|
1602
|
+
function z(e) {
|
|
1603
|
+
if (!r.routeDriven || !(r.routeTabFilter ?? ie)(e)) return;
|
|
1604
|
+
let t = (r.routeTabResolver ?? F)(e);
|
|
1589
1605
|
if (!t) return;
|
|
1590
|
-
let n =
|
|
1606
|
+
let n = I(), i = new Set(n.map((e) => e.path)), a = w.value.filter((e) => !i.has(e.path)), o = Ft([...n, ...a], t, { maxCount: k.value });
|
|
1591
1607
|
w.value = o, r.preferences.tabbar.visitHistory && (D.value = Jt(D.value, e.path)), Q();
|
|
1592
1608
|
}
|
|
1593
|
-
function
|
|
1609
|
+
function B(e) {
|
|
1594
1610
|
r.routeDriven && h && e && e !== p?.path && h.push(e);
|
|
1595
1611
|
}
|
|
1596
|
-
function
|
|
1612
|
+
function se(e) {
|
|
1597
1613
|
return r.tabFallbackPath ? r.tabFallbackPath : e[0]?.path ?? "";
|
|
1598
1614
|
}
|
|
1599
|
-
let
|
|
1615
|
+
let V = o({
|
|
1600
1616
|
get: () => r.routeDriven ? p?.path ?? r.activeTabPath : u.value ?? r.activeTabPath,
|
|
1601
1617
|
set: (e) => {
|
|
1602
|
-
r.routeDriven ?
|
|
1618
|
+
r.routeDriven ? B(e) : u.value = e;
|
|
1603
1619
|
}
|
|
1604
|
-
}),
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1620
|
+
}), H = o(() => r.routeDriven ? w.value : r.tabs);
|
|
1621
|
+
N(H, (e) => a("tabsChange", [...e]), { immediate: !0 });
|
|
1622
|
+
let ue = o(() => H.value.length > 0), U = o(() => r.preferences.sidebar.collapsed), G = o(() => typeof p?.meta.activeMenu == "string" ? p.meta.activeMenu : ""), q = o(() => {
|
|
1623
|
+
let e = p?.path || V.value, t = G.value;
|
|
1624
|
+
return t && W(r.menus, t) ? t : e && W(r.menus, e) ? e : r.activeMenuPath && W(r.menus, r.activeMenuPath) ? r.activeMenuPath : r.activeMenuPath || e;
|
|
1625
|
+
}), pe = o(() => p?.path || V.value || q.value), J = o(() => ({
|
|
1608
1626
|
enable: r.preferences.breadcrumb?.enable ?? !0,
|
|
1609
1627
|
hideOnlyOne: r.preferences.breadcrumb?.hideOnlyOne ?? !1,
|
|
1610
1628
|
showHome: r.preferences.breadcrumb?.showHome ?? !0,
|
|
1611
1629
|
showIcon: r.preferences.breadcrumb?.showIcon ?? !0
|
|
1612
|
-
})),
|
|
1613
|
-
let e =
|
|
1614
|
-
activeTopMenuPath:
|
|
1630
|
+
})), me = o(() => r.preferences.header.globalSearch ?? !0), _e = o(() => r.preferences.shortcutKeys?.globalSearch ?? !0), ve = o(() => fe(r.menus, q.value)), Y = o(() => r.preferences.app.layout === "mixed-nav" && r.preferences.sidebar.enable), ye = o(() => Y.value ? r.menus.find((e) => !e.hidden && e.path === T.value)?.path ?? ve.value : ve.value), be = o(() => {
|
|
1631
|
+
let e = K({
|
|
1632
|
+
activeTopMenuPath: ye.value,
|
|
1615
1633
|
layout: r.preferences.app.layout,
|
|
1616
1634
|
menus: r.menus
|
|
1617
1635
|
});
|
|
@@ -1619,16 +1637,16 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1619
1637
|
...e,
|
|
1620
1638
|
sidebarMenus: r.preferences.sidebar.enable ? e.sidebarMenus : []
|
|
1621
1639
|
};
|
|
1622
|
-
}),
|
|
1623
|
-
|
|
1640
|
+
}), xe = o(() => be.value.sidebarMenus), X = o(() => be.value.topMenus), Se = o(() => xe.value.length > 0), Z = o(() => X.value.length > 0), Ce = o(() => J.value.enable && Se.value && !Z.value), we = o(() => Y.value ? "flat" : "tree"), Te = o(() => we.value === "tree" ? q.value : ye.value), De = o(() => Z.value ? X.value : xe.value), Oe = o(() => De.value.some((e) => !e.hidden));
|
|
1641
|
+
N(() => [
|
|
1624
1642
|
p?.fullPath,
|
|
1625
|
-
|
|
1643
|
+
q.value,
|
|
1626
1644
|
r.menus,
|
|
1627
1645
|
r.preferences.app.layout,
|
|
1628
1646
|
r.preferences.sidebar.enable
|
|
1629
1647
|
], () => {
|
|
1630
|
-
T.value =
|
|
1631
|
-
}, { immediate: !0 }),
|
|
1648
|
+
T.value = ve.value;
|
|
1649
|
+
}, { immediate: !0 }), N(() => [
|
|
1632
1650
|
r.preferences.app.dynamicTitle ?? !0,
|
|
1633
1651
|
p?.meta.title,
|
|
1634
1652
|
r.title
|
|
@@ -1641,47 +1659,48 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1641
1659
|
}
|
|
1642
1660
|
!r && !i || (document.title = r && i && r !== i ? `${r} - ${i}` : r || i);
|
|
1643
1661
|
}, { immediate: !0 });
|
|
1644
|
-
|
|
1645
|
-
|
|
1662
|
+
let ke = !1;
|
|
1663
|
+
function Ae() {
|
|
1664
|
+
if (r.tabStorageKey && !(typeof sessionStorage > "u")) return {
|
|
1646
1665
|
getItem: sessionStorage.getItem.bind(sessionStorage),
|
|
1647
1666
|
removeItem: sessionStorage.removeItem.bind(sessionStorage),
|
|
1648
1667
|
setItem: sessionStorage.setItem.bind(sessionStorage)
|
|
1649
1668
|
};
|
|
1650
1669
|
}
|
|
1651
1670
|
function Q() {
|
|
1652
|
-
let e =
|
|
1653
|
-
if (!e || !r.tabStorageKey || !r.routeDriven) return;
|
|
1671
|
+
let e = Ae();
|
|
1672
|
+
if (!ke || !r.preferences.tabbar.persist || !e || !r.tabStorageKey || !r.routeDriven) return;
|
|
1654
1673
|
let t = Ot({
|
|
1655
|
-
tabs: w.value.map(
|
|
1674
|
+
tabs: w.value.map(L),
|
|
1656
1675
|
history: D.value
|
|
1657
1676
|
});
|
|
1658
1677
|
At(e, r.tabStorageKey, t);
|
|
1659
1678
|
}
|
|
1660
|
-
function
|
|
1661
|
-
let e =
|
|
1679
|
+
function Me() {
|
|
1680
|
+
let e = Ae();
|
|
1662
1681
|
!e || !r.tabStorageKey || Mt(e, r.tabStorageKey);
|
|
1663
1682
|
}
|
|
1664
|
-
function
|
|
1683
|
+
function Ne() {
|
|
1665
1684
|
if (!r.routeDriven) return;
|
|
1666
|
-
let e =
|
|
1685
|
+
let e = Ae();
|
|
1667
1686
|
if (!e || !r.tabStorageKey) return;
|
|
1668
1687
|
let t = jt(e, r.tabStorageKey), n = p?.path ?? "", i = Nt(t, {
|
|
1669
1688
|
currentPath: n,
|
|
1670
|
-
currentTab: p ? (r.routeTabResolver ??
|
|
1671
|
-
fixedTabs:
|
|
1672
|
-
isValidPath:
|
|
1673
|
-
resolveTab:
|
|
1689
|
+
currentTab: p ? (r.routeTabResolver ?? F)(p) : void 0,
|
|
1690
|
+
fixedTabs: I(),
|
|
1691
|
+
isValidPath: ae(),
|
|
1692
|
+
resolveTab: oe
|
|
1674
1693
|
});
|
|
1675
|
-
w.value = i.tabs, r.preferences.tabbar.visitHistory ? (n && i.history.unshift(n), D.value = Jt(i.history, n || "")) : D.value = [];
|
|
1694
|
+
w.value = It(i.tabs, k.value, V.value), r.preferences.tabbar.visitHistory ? (n && i.history.unshift(n), D.value = Jt(i.history, n || "")) : D.value = [];
|
|
1676
1695
|
}
|
|
1677
|
-
function
|
|
1696
|
+
function $(e) {
|
|
1678
1697
|
y.value = e?.matches ?? j?.matches ?? !1, y.value && (x.value = !1);
|
|
1679
1698
|
}
|
|
1680
1699
|
te(() => {
|
|
1681
|
-
typeof window > "u" || typeof window.matchMedia != "function" || (j = window.matchMedia("(max-width: 768px)"),
|
|
1700
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (j = window.matchMedia("(max-width: 768px)"), $(), j.addEventListener?.("change", $));
|
|
1682
1701
|
}), ee(() => {
|
|
1683
|
-
j?.removeEventListener?.("change",
|
|
1684
|
-
}),
|
|
1702
|
+
j?.removeEventListener?.("change", $);
|
|
1703
|
+
}), N(() => [
|
|
1685
1704
|
r.routeDriven,
|
|
1686
1705
|
k.value,
|
|
1687
1706
|
r.fixedTabs
|
|
@@ -1690,80 +1709,78 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1690
1709
|
w.value = [];
|
|
1691
1710
|
return;
|
|
1692
1711
|
}
|
|
1693
|
-
let e =
|
|
1712
|
+
let e = I(), t = new Set(e.map((e) => e.path)), n = [...e];
|
|
1694
1713
|
for (let e of w.value.filter((e) => !t.has(e.path))) n = Ft(n, e, { maxCount: k.value });
|
|
1695
|
-
w.value = It(Pt(n), k.value,
|
|
1714
|
+
w.value = It(Pt(n), k.value, V.value), Q();
|
|
1696
1715
|
}, {
|
|
1697
1716
|
deep: !0,
|
|
1698
1717
|
immediate: !0
|
|
1699
|
-
}),
|
|
1700
|
-
p &&
|
|
1701
|
-
}, { immediate: !0 }),
|
|
1718
|
+
}), N(() => p?.fullPath, () => {
|
|
1719
|
+
p && z(p);
|
|
1720
|
+
}, { immediate: !0 }), r.preferences.tabbar.persist && Ne(), ke = !0, Q(), N(() => [
|
|
1702
1721
|
r.routeDriven,
|
|
1703
1722
|
r.tabStorageKey,
|
|
1704
1723
|
r.preferences.tabbar.persist
|
|
1705
1724
|
], (e, t) => {
|
|
1706
|
-
let n = e[0], r = e[2], i = t?.[
|
|
1707
|
-
n && r && !i &&
|
|
1708
|
-
}, { immediate: !1 })
|
|
1709
|
-
|
|
1710
|
-
});
|
|
1711
|
-
function $() {
|
|
1725
|
+
let n = e[0], r = e[2], i = t?.[2];
|
|
1726
|
+
n && r && (e[1] !== t?.[1] || !i || !t?.[0]) && Ne(), !r && i && Me();
|
|
1727
|
+
}, { immediate: !1 });
|
|
1728
|
+
function Pe() {
|
|
1712
1729
|
if (y.value) {
|
|
1713
1730
|
x.value = !x.value;
|
|
1714
1731
|
return;
|
|
1715
1732
|
}
|
|
1716
1733
|
a("toggleSidebar");
|
|
1717
1734
|
}
|
|
1718
|
-
function Pe(e) {
|
|
1719
|
-
x.value = !1, a("menuSelect", e);
|
|
1720
|
-
}
|
|
1721
1735
|
function Fe(e) {
|
|
1722
|
-
|
|
1723
|
-
J.value && t && (n.length > 0 || !i) && (T.value = t.path), a("topMenuSelect", e), !(J.value && n.length > 0 && !r.preferences.sidebar.autoActivateChild) && Pe(fe(t) || e);
|
|
1736
|
+
x.value = !1, a("menuSelect", e);
|
|
1724
1737
|
}
|
|
1725
1738
|
function Ie(e) {
|
|
1726
|
-
|
|
1739
|
+
let t = W(r.menus, e), n = t?.children?.filter((e) => !e.hidden) ?? [], i = !!t?.externalLink && t?.externalTarget !== "_self";
|
|
1740
|
+
Y.value && t && (n.length > 0 || !i) && (T.value = t.path), a("topMenuSelect", e), !(Y.value && n.length > 0 && !r.preferences.sidebar.autoActivateChild) && Fe(de(t) || e);
|
|
1727
1741
|
}
|
|
1728
1742
|
function Le(e) {
|
|
1729
|
-
|
|
1743
|
+
Fe(de(W(r.menus, e)) || e);
|
|
1730
1744
|
}
|
|
1731
1745
|
function Re(e) {
|
|
1746
|
+
a("tabChange", e);
|
|
1747
|
+
}
|
|
1748
|
+
function ze(e) {
|
|
1732
1749
|
if (r.routeDriven) {
|
|
1733
1750
|
let t = w.value.findIndex((t) => t.path === e), n = Lt(w.value, e);
|
|
1734
|
-
if (w.value = n,
|
|
1751
|
+
if (w.value = n, V.value === e) {
|
|
1735
1752
|
let i = r.preferences.tabbar.visitHistory;
|
|
1736
|
-
|
|
1753
|
+
B(Yt(n, e, D.value, {
|
|
1737
1754
|
useHistory: i,
|
|
1738
1755
|
priorClosedIndex: t
|
|
1739
|
-
}) ||
|
|
1756
|
+
}) || se(n));
|
|
1740
1757
|
}
|
|
1741
1758
|
Q();
|
|
1742
1759
|
}
|
|
1743
1760
|
a("tabRemove", e);
|
|
1744
1761
|
}
|
|
1745
|
-
function ze(e) {
|
|
1746
|
-
r.routeDriven && (w.value = Rt(w.value, e), z(e), Q()), a("tabCloseLeft", e);
|
|
1747
|
-
}
|
|
1748
1762
|
function Be(e) {
|
|
1749
|
-
r.routeDriven && (w.value =
|
|
1763
|
+
r.routeDriven && (w.value = Rt(w.value, e), B(e), Q()), a("tabCloseLeft", e);
|
|
1750
1764
|
}
|
|
1751
1765
|
function Ve(e) {
|
|
1752
|
-
r.routeDriven && (w.value =
|
|
1766
|
+
r.routeDriven && (w.value = zt(w.value, e), B(e), Q()), a("tabCloseRight", e);
|
|
1753
1767
|
}
|
|
1754
|
-
function He() {
|
|
1755
|
-
r.routeDriven && (w.value =
|
|
1768
|
+
function He(e) {
|
|
1769
|
+
r.routeDriven && (w.value = Bt(w.value, e), B(e), Q()), a("tabCloseOthers", e);
|
|
1756
1770
|
}
|
|
1757
|
-
function Ue(
|
|
1758
|
-
r.routeDriven && (w.value =
|
|
1771
|
+
function Ue() {
|
|
1772
|
+
r.routeDriven && (w.value = Vt(w.value), B(se(w.value)), Q()), a("tabCloseAll");
|
|
1759
1773
|
}
|
|
1760
1774
|
function We(e, t) {
|
|
1775
|
+
r.routeDriven && (w.value = t ? Ht(w.value, e) : Ut(w.value, e), Q()), a("tabPin", e, t);
|
|
1776
|
+
}
|
|
1777
|
+
function Ge(e, t) {
|
|
1761
1778
|
r.routeDriven && (w.value = Xt(w.value, e, t), Q()), a("tabReorder", e, t);
|
|
1762
1779
|
}
|
|
1763
|
-
function
|
|
1780
|
+
function Ke(e) {
|
|
1764
1781
|
let t = r.resolveTabUrl ? r.resolveTabUrl(e) : (() => {
|
|
1765
1782
|
if (h) try {
|
|
1766
|
-
return h.resolve(e)?.
|
|
1783
|
+
return h.resolve(e)?.href ?? e;
|
|
1767
1784
|
} catch {
|
|
1768
1785
|
return e;
|
|
1769
1786
|
}
|
|
@@ -1771,63 +1788,63 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1771
1788
|
})();
|
|
1772
1789
|
window.open(t, "_blank", "noopener,noreferrer"), a("tabNewWindow", e);
|
|
1773
1790
|
}
|
|
1774
|
-
function
|
|
1791
|
+
function Je(e) {
|
|
1775
1792
|
S.value = e, a("tabMaximize", e);
|
|
1776
1793
|
}
|
|
1777
|
-
function
|
|
1778
|
-
e.key === "Escape" && S.value && (e.preventDefault(), _.value?.setMaximized(!1),
|
|
1794
|
+
function Ye(e) {
|
|
1795
|
+
e.key === "Escape" && S.value && (e.preventDefault(), _.value?.setMaximized(!1), Je(!1));
|
|
1779
1796
|
}
|
|
1780
|
-
return
|
|
1781
|
-
typeof document > "u" || (e ? document.addEventListener("keydown",
|
|
1797
|
+
return N(S, (e) => {
|
|
1798
|
+
typeof document > "u" || (e ? document.addEventListener("keydown", Ye) : document.removeEventListener("keydown", Ye));
|
|
1782
1799
|
}), ee(() => {
|
|
1783
|
-
typeof document < "u" && document.removeEventListener("keydown",
|
|
1800
|
+
typeof document < "u" && document.removeEventListener("keydown", Ye);
|
|
1784
1801
|
}), t({
|
|
1785
1802
|
getLayoutElement: () => g.value?.$el,
|
|
1786
1803
|
getLayoutInstance: () => g.value,
|
|
1787
|
-
getTabs: () => [...
|
|
1804
|
+
getTabs: () => [...H.value],
|
|
1788
1805
|
getVisitHistory: () => [...D.value],
|
|
1789
1806
|
resetTabs: () => {
|
|
1790
|
-
w.value = Vt(w.value), D.value = [],
|
|
1807
|
+
w.value = Vt(w.value), D.value = [], B(se(w.value)), Q();
|
|
1791
1808
|
},
|
|
1792
1809
|
resetTabSnapshot: () => {
|
|
1793
|
-
|
|
1810
|
+
Me();
|
|
1794
1811
|
}
|
|
1795
|
-
}), (t, n) => (b(), s(O(
|
|
1812
|
+
}), (t, n) => (b(), s(O(R), {
|
|
1796
1813
|
ref_key: "layoutRef",
|
|
1797
1814
|
ref: g,
|
|
1798
1815
|
class: v(["lumal-layout", {
|
|
1799
|
-
"is-sidebar-collapsed":
|
|
1800
|
-
"is-sidebar-hidden": !
|
|
1816
|
+
"is-sidebar-collapsed": U.value,
|
|
1817
|
+
"is-sidebar-hidden": !Se.value,
|
|
1801
1818
|
"is-mobile-menu-hidden": !x.value,
|
|
1802
1819
|
"is-content-maximized": S.value
|
|
1803
1820
|
}]),
|
|
1804
1821
|
"data-layout": e.preferences.app.layout,
|
|
1805
1822
|
direction: "vertical"
|
|
1806
1823
|
}, {
|
|
1807
|
-
default:
|
|
1824
|
+
default: P(() => [e.showHeader ? re((b(), s(je, {
|
|
1808
1825
|
key: 0,
|
|
1809
1826
|
title: e.title,
|
|
1810
|
-
collapsed: y.value ? !x.value :
|
|
1827
|
+
collapsed: y.value ? !x.value : U.value,
|
|
1811
1828
|
height: e.headerHeight,
|
|
1812
|
-
"mobile-only-toggle": !
|
|
1813
|
-
"sidebar-enabled":
|
|
1814
|
-
"toggle-after-title":
|
|
1815
|
-
onToggleCollapse:
|
|
1829
|
+
"mobile-only-toggle": !Se.value && Z.value,
|
|
1830
|
+
"sidebar-enabled": Se.value || Z.value,
|
|
1831
|
+
"toggle-after-title": Se.value && !y.value,
|
|
1832
|
+
onToggleCollapse: Pe
|
|
1816
1833
|
}, d({ _: 2 }, [
|
|
1817
1834
|
t.$slots.logo ? {
|
|
1818
1835
|
name: "logo",
|
|
1819
|
-
fn:
|
|
1836
|
+
fn: P(() => [C(t.$slots, "logo", {}, void 0, !0)]),
|
|
1820
1837
|
key: "0"
|
|
1821
1838
|
} : void 0,
|
|
1822
1839
|
Z.value ? {
|
|
1823
1840
|
name: "navigation",
|
|
1824
|
-
fn:
|
|
1825
|
-
menus:
|
|
1841
|
+
fn: P(() => [f(Ct, {
|
|
1842
|
+
menus: X.value,
|
|
1826
1843
|
"active-path": Te.value,
|
|
1827
1844
|
align: e.preferences.header.menuAlign,
|
|
1828
1845
|
"max-width": e.preferences.header.menuMaxWidth,
|
|
1829
1846
|
mode: we.value,
|
|
1830
|
-
onSelect:
|
|
1847
|
+
onSelect: Ie
|
|
1831
1848
|
}, null, 8, [
|
|
1832
1849
|
"menus",
|
|
1833
1850
|
"active-path",
|
|
@@ -1839,15 +1856,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1839
1856
|
} : void 0,
|
|
1840
1857
|
Ce.value ? {
|
|
1841
1858
|
name: "breadcrumb",
|
|
1842
|
-
fn:
|
|
1859
|
+
fn: P(() => [f(he, {
|
|
1843
1860
|
class: "lumal-layout__header-breadcrumb",
|
|
1844
|
-
"active-menu-path":
|
|
1845
|
-
"active-path":
|
|
1846
|
-
"hide-only-one":
|
|
1861
|
+
"active-menu-path": q.value,
|
|
1862
|
+
"active-path": pe.value,
|
|
1863
|
+
"hide-only-one": J.value.hideOnlyOne,
|
|
1847
1864
|
menus: e.menus,
|
|
1848
|
-
"show-home":
|
|
1849
|
-
"show-icon":
|
|
1850
|
-
onSelect:
|
|
1865
|
+
"show-home": J.value.showHome,
|
|
1866
|
+
"show-icon": J.value.showIcon,
|
|
1867
|
+
onSelect: Le
|
|
1851
1868
|
}, null, 8, [
|
|
1852
1869
|
"active-menu-path",
|
|
1853
1870
|
"active-path",
|
|
@@ -1858,13 +1875,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1858
1875
|
])]),
|
|
1859
1876
|
key: "2"
|
|
1860
1877
|
} : void 0,
|
|
1861
|
-
|
|
1878
|
+
me.value || t.$slots.headerActions ? {
|
|
1862
1879
|
name: "actions",
|
|
1863
|
-
fn:
|
|
1880
|
+
fn: P(() => [me.value ? (b(), s(Ee, {
|
|
1864
1881
|
key: 0,
|
|
1865
1882
|
menus: e.menus,
|
|
1866
|
-
shortcut:
|
|
1867
|
-
onSelect:
|
|
1883
|
+
shortcut: _e.value,
|
|
1884
|
+
onSelect: Le
|
|
1868
1885
|
}, null, 8, ["menus", "shortcut"])) : c("", !0), C(t.$slots, "headerActions", {}, void 0, !0)]),
|
|
1869
1886
|
key: "3"
|
|
1870
1887
|
} : void 0
|
|
@@ -1875,8 +1892,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1875
1892
|
"mobile-only-toggle",
|
|
1876
1893
|
"sidebar-enabled",
|
|
1877
1894
|
"toggle-after-title"
|
|
1878
|
-
])), [[
|
|
1879
|
-
default:
|
|
1895
|
+
])), [[M, !S.value]]) : c("", !0), f(O(R), { class: "lumal-layout__body" }, {
|
|
1896
|
+
default: P(() => [
|
|
1880
1897
|
Oe.value && !S.value ? (b(), l("button", {
|
|
1881
1898
|
key: 0,
|
|
1882
1899
|
class: "lumal-layout__sidebar-scrim",
|
|
@@ -1889,16 +1906,16 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1889
1906
|
name: "lumal-layout-sidebar",
|
|
1890
1907
|
appear: ""
|
|
1891
1908
|
}, {
|
|
1892
|
-
default:
|
|
1909
|
+
default: P(() => [Se.value ? (b(), s(qe, {
|
|
1893
1910
|
key: 0,
|
|
1894
1911
|
class: "lumal-layout__desktop-sidebar",
|
|
1895
1912
|
"aria-label": "主菜单",
|
|
1896
|
-
menus:
|
|
1897
|
-
"active-path":
|
|
1898
|
-
collapsed:
|
|
1913
|
+
menus: xe.value,
|
|
1914
|
+
"active-path": q.value,
|
|
1915
|
+
collapsed: U.value,
|
|
1899
1916
|
width: `${e.preferences.sidebar.width}px`,
|
|
1900
1917
|
"collapsed-width": "64px",
|
|
1901
|
-
onSelect:
|
|
1918
|
+
onSelect: Fe
|
|
1902
1919
|
}, null, 8, [
|
|
1903
1920
|
"menus",
|
|
1904
1921
|
"active-path",
|
|
@@ -1914,11 +1931,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1914
1931
|
"aria-hidden": !x.value,
|
|
1915
1932
|
inert: !x.value || void 0,
|
|
1916
1933
|
menus: De.value,
|
|
1917
|
-
"active-path":
|
|
1934
|
+
"active-path": q.value,
|
|
1918
1935
|
collapsed: !1,
|
|
1919
1936
|
width: `${e.preferences.sidebar.width}px`,
|
|
1920
1937
|
"collapsed-width": "64px",
|
|
1921
|
-
onSelect:
|
|
1938
|
+
onSelect: Fe
|
|
1922
1939
|
}, null, 8, [
|
|
1923
1940
|
"aria-hidden",
|
|
1924
1941
|
"inert",
|
|
@@ -1926,21 +1943,21 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1926
1943
|
"active-path",
|
|
1927
1944
|
"width"
|
|
1928
1945
|
])) : c("", !0),
|
|
1929
|
-
f(O(
|
|
1946
|
+
f(O(R), {
|
|
1930
1947
|
class: "lumal-layout__main",
|
|
1931
1948
|
direction: "vertical",
|
|
1932
1949
|
"data-layout-fullscreen-target": ""
|
|
1933
1950
|
}, {
|
|
1934
|
-
default:
|
|
1935
|
-
|
|
1951
|
+
default: P(() => [
|
|
1952
|
+
J.value.enable && !Ce.value && !S.value ? (b(), s(he, {
|
|
1936
1953
|
key: 0,
|
|
1937
|
-
"active-menu-path":
|
|
1938
|
-
"active-path":
|
|
1939
|
-
"hide-only-one":
|
|
1954
|
+
"active-menu-path": q.value,
|
|
1955
|
+
"active-path": pe.value,
|
|
1956
|
+
"hide-only-one": J.value.hideOnlyOne,
|
|
1940
1957
|
menus: e.menus,
|
|
1941
|
-
"show-home":
|
|
1942
|
-
"show-icon":
|
|
1943
|
-
onSelect:
|
|
1958
|
+
"show-home": J.value.showHome,
|
|
1959
|
+
"show-icon": J.value.showIcon,
|
|
1960
|
+
onSelect: Le
|
|
1944
1961
|
}, null, 8, [
|
|
1945
1962
|
"active-menu-path",
|
|
1946
1963
|
"active-path",
|
|
@@ -1949,13 +1966,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1949
1966
|
"show-home",
|
|
1950
1967
|
"show-icon"
|
|
1951
1968
|
])) : c("", !0),
|
|
1952
|
-
|
|
1969
|
+
ue.value && e.preferences.tabbar.enable ? (b(), s(mt, {
|
|
1953
1970
|
key: 1,
|
|
1954
1971
|
ref_key: "tabsRef",
|
|
1955
1972
|
ref: _,
|
|
1956
|
-
"active-path":
|
|
1957
|
-
"onUpdate:activePath": n[1] ||= (e) =>
|
|
1958
|
-
tabs:
|
|
1973
|
+
"active-path": V.value,
|
|
1974
|
+
"onUpdate:activePath": n[1] ||= (e) => V.value = e,
|
|
1975
|
+
tabs: H.value,
|
|
1959
1976
|
"show-icon": e.preferences.tabbar.showIcon,
|
|
1960
1977
|
"show-maximize": e.preferences.tabbar.showMaximize,
|
|
1961
1978
|
"show-more": e.preferences.tabbar.showMore,
|
|
@@ -1964,17 +1981,17 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1964
1981
|
wheelable: e.preferences.tabbar.wheelable,
|
|
1965
1982
|
"middle-click-to-close": e.preferences.tabbar.middleClickToClose,
|
|
1966
1983
|
"style-type": e.preferences.tabbar.styleType,
|
|
1967
|
-
onChange:
|
|
1968
|
-
onCloseAll:
|
|
1969
|
-
onCloseLeft:
|
|
1970
|
-
onCloseOthers:
|
|
1971
|
-
onCloseRight:
|
|
1972
|
-
onMaximize:
|
|
1973
|
-
onNewWindow:
|
|
1974
|
-
onPin:
|
|
1984
|
+
onChange: Re,
|
|
1985
|
+
onCloseAll: Ue,
|
|
1986
|
+
onCloseLeft: Be,
|
|
1987
|
+
onCloseOthers: He,
|
|
1988
|
+
onCloseRight: Ve,
|
|
1989
|
+
onMaximize: Je,
|
|
1990
|
+
onNewWindow: Ke,
|
|
1991
|
+
onPin: We,
|
|
1975
1992
|
onRefresh: n[2] ||= (e) => a("tabRefresh", e),
|
|
1976
|
-
onRemove:
|
|
1977
|
-
onReorder:
|
|
1993
|
+
onRemove: ze,
|
|
1994
|
+
onReorder: Ge
|
|
1978
1995
|
}, null, 8, [
|
|
1979
1996
|
"active-path",
|
|
1980
1997
|
"tabs",
|
|
@@ -1987,8 +2004,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1987
2004
|
"middle-click-to-close",
|
|
1988
2005
|
"style-type"
|
|
1989
2006
|
])) : c("", !0),
|
|
1990
|
-
f(
|
|
1991
|
-
default:
|
|
2007
|
+
f(ge, null, {
|
|
2008
|
+
default: P(() => [C(t.$slots, "default", { tabs: H.value }, void 0, !0)]),
|
|
1992
2009
|
_: 3
|
|
1993
2010
|
})
|
|
1994
2011
|
]),
|
|
@@ -2000,7 +2017,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2000
2017
|
_: 3
|
|
2001
2018
|
}, 8, ["data-layout", "class"]));
|
|
2002
2019
|
}
|
|
2003
|
-
}), [["__scopeId", "data-v-
|
|
2020
|
+
}), [["__scopeId", "data-v-bac59663"]]), $t = {
|
|
2004
2021
|
key: 0,
|
|
2005
2022
|
class: "lumal-router-view__progress",
|
|
2006
2023
|
"aria-hidden": "true"
|
|
@@ -2029,57 +2046,74 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2029
2046
|
type: Boolean,
|
|
2030
2047
|
default: !1
|
|
2031
2048
|
},
|
|
2032
|
-
cacheMax: { default:
|
|
2049
|
+
cacheMax: { default: 20 },
|
|
2050
|
+
cacheKeys: {}
|
|
2033
2051
|
},
|
|
2034
2052
|
setup(e, { expose: t }) {
|
|
2035
|
-
let r = e, a = A("routerViewRef"), d =
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
if (
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2053
|
+
let r = e, a = A("routerViewRef"), d = m(ce, void 0), h = m(le, void 0), g = E(!1), _ = o(() => r.progress && g.value), v = o(() => r.loading && g.value), y = o(() => Number.isFinite(r.cacheMax) && r.cacheMax > 0 ? Math.max(1, Math.floor(r.cacheMax)) : 20), te = o(() => r.transition ? r.transitionName : void 0), x = /* @__PURE__ */ new Map(), S = E(), C = E([]), w = 0;
|
|
2054
|
+
N([
|
|
2055
|
+
() => r.viewKey,
|
|
2056
|
+
() => r.cacheKeys?.slice(),
|
|
2057
|
+
() => r.cache,
|
|
2058
|
+
y,
|
|
2059
|
+
() => d?.meta.keepAlive
|
|
2060
|
+
], () => {
|
|
2061
|
+
let e = r.cacheKeys ? new Set(r.cacheKeys) : void 0;
|
|
2062
|
+
for (let t of x.keys()) (!r.cache || e && !e.has(t) || t === r.viewKey && d?.meta.keepAlive === !1) && x.delete(t);
|
|
2063
|
+
let t = x.get(r.viewKey);
|
|
2064
|
+
if (r.cache && d?.meta.keepAlive !== !1 && (!e || e.has(r.viewKey))) {
|
|
2065
|
+
if (!t) {
|
|
2066
|
+
let e = `LumalCachedView${++w}`;
|
|
2067
|
+
t = {
|
|
2068
|
+
name: e,
|
|
2069
|
+
component: p({
|
|
2070
|
+
name: e,
|
|
2071
|
+
setup: (e, { slots: t }) => () => t.default?.()
|
|
2072
|
+
})
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
x.delete(r.viewKey), x.set(r.viewKey, t);
|
|
2076
|
+
} else t = void 0;
|
|
2077
|
+
for (; x.size > y.value;) x.delete(x.keys().next().value);
|
|
2078
|
+
S.value = t?.component, C.value = [...x.values()].map((e) => e.name);
|
|
2079
|
+
}, { immediate: !0 });
|
|
2080
|
+
let D, k = h?.beforeEach((e) => {
|
|
2081
|
+
D = e, g.value = !0;
|
|
2082
|
+
}), ne = h?.afterEach((e) => {
|
|
2083
|
+
D === e && (g.value = !1);
|
|
2084
|
+
}), j = h?.onError((e, t) => {
|
|
2085
|
+
D === t && (g.value = !1);
|
|
2086
|
+
});
|
|
2087
|
+
return ee(() => {
|
|
2088
|
+
k?.(), ne?.(), j?.(), x.clear();
|
|
2056
2089
|
}), t({ getRouterViewElement: () => a.value }), (t, r) => (b(), l("div", {
|
|
2057
2090
|
ref_key: "routerViewRef",
|
|
2058
2091
|
ref: a,
|
|
2059
2092
|
class: "lumal-router-view"
|
|
2060
2093
|
}, [
|
|
2061
|
-
|
|
2062
|
-
f(O(
|
|
2063
|
-
default:
|
|
2064
|
-
key: 0,
|
|
2094
|
+
_.value ? (b(), l("div", $t, [...r[0] ||= [u("span", { class: "lumal-router-view__progress-bar" }, null, -1)]])) : c("", !0),
|
|
2095
|
+
f(O(H), null, {
|
|
2096
|
+
default: P(({ Component: t }) => [f(i, {
|
|
2065
2097
|
appear: "",
|
|
2066
2098
|
mode: "out-in",
|
|
2067
|
-
name:
|
|
2099
|
+
name: te.value,
|
|
2100
|
+
css: e.transition
|
|
2068
2101
|
}, {
|
|
2069
|
-
default:
|
|
2102
|
+
default: P(() => [e.cache ? (b(), s(n, {
|
|
2070
2103
|
key: 0,
|
|
2071
|
-
|
|
2072
|
-
|
|
2104
|
+
include: C.value,
|
|
2105
|
+
max: y.value
|
|
2106
|
+
}, [S.value ? (b(), s(T(S.value), { key: e.viewKey }, {
|
|
2107
|
+
default: P(() => [(b(), s(T(t)))]),
|
|
2108
|
+
_: 2
|
|
2109
|
+
}, 1024)) : (b(), s(T(t), { key: e.viewKey }))], 1032, ["include", "max"])) : (b(), s(T(t), { key: e.viewKey }))]),
|
|
2073
2110
|
_: 2
|
|
2074
|
-
}, 1032, ["name"]))
|
|
2075
|
-
key: 1,
|
|
2076
|
-
max: h.value
|
|
2077
|
-
}, [(b(), s(T(t), { key: e.viewKey }))], 1032, ["max"])) : (b(), s(T(t), { key: e.viewKey }))]),
|
|
2111
|
+
}, 1032, ["name", "css"])]),
|
|
2078
2112
|
_: 1
|
|
2079
2113
|
}),
|
|
2080
|
-
|
|
2114
|
+
v.value ? (b(), l("div", en, [...r[1] ||= [u("span", { class: "lumal-router-view__loading-dot" }, null, -1)]])) : c("", !0)
|
|
2081
2115
|
], 512));
|
|
2082
2116
|
}
|
|
2083
|
-
}), [["__scopeId", "data-v-
|
|
2117
|
+
}), [["__scopeId", "data-v-f438a089"]]);
|
|
2084
2118
|
//#endregion
|
|
2085
|
-
export { qe as A,
|
|
2119
|
+
export { qe as A, K as B, kt as C, At as D, Ot as E, W as F, G as I, U as L, Ee as M, ge as N, Ct as O, he as P, fe as R, Mt as S, Nt as T, Yt as _, Gt as a, Tt as b, Bt as c, zt as d, Wt as f, Zt as g, Xt as h, Kt as i, je as j, mt as k, Lt as l, Jt as m, Qt as n, It as o, Ht as p, Ft as r, Vt as s, tn as t, Rt as u, Pt as v, jt as w, wt as x, Ut as y, de as z };
|