@lumal/core 0.0.1-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/LICENSE +21 -21
- package/README.md +22 -13
- package/dist/auth.cjs +1 -1
- package/dist/auth.js +13 -29
- package/dist/components-DCp2KGvo.js +2254 -0
- package/dist/components-oqKxhgFp.cjs +2 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +3 -3
- package/dist/{composables-C9EuCUjj.js → composables-BxZG0_RZ.js} +53 -40
- package/dist/composables-Dsl-todB.cjs +1 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +18 -17
- 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-B7tsaVqB.js → dictionary-DnRiNaKi.js} +1 -1
- package/dist/{dictionary-ClEWtQCU.cjs → dictionary-Dt70z10M.cjs} +1 -1
- package/dist/dictionary.cjs +1 -1
- package/dist/dictionary.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +15 -58
- package/dist/{layout-C8H9wuQa.js → layout-B7yJhQXN.js} +473 -429
- 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 +103 -80
- package/dist/router.cjs +1 -1
- package/dist/router.js +24 -21
- 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/components/crud-table/LumalCrudTable.vue.d.ts.map +1 -1
- package/dist/src/components/crud-table/useCrudData.d.ts.map +1 -1
- package/dist/src/components/crud-table/useCrudDialog.d.ts +1 -1
- package/dist/src/components/crud-table/useCrudDialog.d.ts.map +1 -1
- package/dist/src/components/schema-form/LumalSchemaForm.vue.d.ts.map +1 -1
- package/dist/src/components/schema-table/LumalSchemaTable.vue.d.ts.map +1 -1
- package/dist/src/components/schema-table/cell.d.ts +1 -1
- package/dist/src/components/schema-table/cell.d.ts.map +1 -1
- package/dist/src/composables/usePagination.d.ts.map +1 -1
- package/dist/src/dictionary/index.d.ts +1 -1
- package/dist/src/dictionary/index.d.ts.map +1 -1
- package/dist/src/dictionary/normalize.d.ts +3 -1
- package/dist/src/dictionary/normalize.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/layout/LumalTabs.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/router/index.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/theme-chalk/index.scss +2 -2
- package/dist/components-DJiHYQQB.cjs +0 -2
- package/dist/components-DYmKh-eF.js +0 -2206
- package/dist/composables-C4twj5Ov.cjs +0 -1
- package/dist/layout-ZnyG9X3N.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
|
|
9
|
-
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) =>
|
|
8
|
+
function U(e, t) {
|
|
9
|
+
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => U(e, t)) ?? !1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
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 he(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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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-
|
|
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 W = {
|
|
|
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());
|
|
204
211
|
}
|
|
205
|
-
function
|
|
212
|
+
function oe(e) {
|
|
213
|
+
e && (d("select", e.item.path, e.item), L());
|
|
214
|
+
}
|
|
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
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, X), [[j,
|
|
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,
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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 W = {
|
|
|
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,
|
|
@@ -588,7 +603,7 @@ var W = {
|
|
|
588
603
|
_: 1
|
|
589
604
|
}, 8, ["width", "aria-label"]));
|
|
590
605
|
}
|
|
591
|
-
}), [["__scopeId", "data-v-
|
|
606
|
+
}), [["__scopeId", "data-v-d9c4d4bc"]]), Je = ["disabled"], Ye = ["onContextmenu"], Xe = [
|
|
592
607
|
"aria-selected",
|
|
593
608
|
"tabindex",
|
|
594
609
|
"onClick",
|
|
@@ -663,51 +678,61 @@ var W = {
|
|
|
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
|
|
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;
|
|
684
|
+
}
|
|
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));
|
|
687
|
+
}
|
|
688
|
+
function V() {
|
|
689
|
+
typeof z?.removeEventListener == "function" ? z.removeEventListener("change", B) : z?.removeListener?.(B), z = void 0;
|
|
690
|
+
}
|
|
691
|
+
let H = o(() => d.draggable && oe.value), ce = o(() => d.tabs.some((e) => e.closable !== !1 && e.pinned !== !0));
|
|
692
|
+
function le(e) {
|
|
668
693
|
return d.tabs.length > 1 && d.tabs.some((t) => t.path === e && t.closable !== !1 && t.pinned !== !0);
|
|
669
694
|
}
|
|
670
|
-
function
|
|
695
|
+
function U(e, t) {
|
|
671
696
|
let n = d.tabs.findIndex((t) => t.path === e);
|
|
672
697
|
return (t === "left" ? d.tabs.slice(0, n) : d.tabs.slice(n + 1)).some((e) => e.closable !== !1 && e.pinned !== !0);
|
|
673
698
|
}
|
|
674
|
-
function
|
|
699
|
+
function W(e) {
|
|
675
700
|
return d.tabs.some((t) => t.path !== e && t.closable !== !1 && t.pinned !== !0);
|
|
676
701
|
}
|
|
677
|
-
function
|
|
702
|
+
function G(e) {
|
|
678
703
|
return e === m.value;
|
|
679
704
|
}
|
|
680
705
|
function de(e) {
|
|
681
706
|
let t = d.tabs.find((t) => t.path === e);
|
|
682
707
|
return !!t && t.pinned !== !0 && t.closable !== !1;
|
|
683
708
|
}
|
|
684
|
-
function
|
|
709
|
+
function fe(e) {
|
|
685
710
|
let t = d.tabs.find((t) => t.path === e);
|
|
686
711
|
return !!t && t.pinned === !0 && t.closable !== !1;
|
|
687
712
|
}
|
|
688
|
-
function
|
|
689
|
-
let t =
|
|
690
|
-
return e === "close" ? !
|
|
713
|
+
function K(e) {
|
|
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;
|
|
691
716
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
717
|
+
function q(e) {
|
|
718
|
+
return fe(e) ? "取消固定" : "固定";
|
|
694
719
|
}
|
|
695
720
|
function pe() {
|
|
696
721
|
return C.value ? "还原" : "内容最大化";
|
|
697
722
|
}
|
|
698
|
-
function
|
|
723
|
+
function J(e) {
|
|
699
724
|
e !== m.value && (m.value = e, p("change", e));
|
|
700
725
|
}
|
|
701
|
-
function
|
|
702
|
-
|
|
726
|
+
function me(e) {
|
|
727
|
+
le(e) && p("remove", e);
|
|
703
728
|
}
|
|
704
|
-
function
|
|
705
|
-
e &&
|
|
729
|
+
function he(e) {
|
|
730
|
+
e && G(e) && p("refresh", e);
|
|
706
731
|
}
|
|
707
732
|
function ge(e, t) {
|
|
708
|
-
e.button !== 1 || !d.middleClickToClose || !
|
|
733
|
+
e.button !== 1 || !d.middleClickToClose || !le(t.path) || (e.preventDefault(), p("remove", t.path));
|
|
709
734
|
}
|
|
710
|
-
function
|
|
735
|
+
function _e(e, t) {
|
|
711
736
|
if (![
|
|
712
737
|
"ArrowLeft",
|
|
713
738
|
"ArrowRight",
|
|
@@ -716,17 +741,17 @@ var W = {
|
|
|
716
741
|
].includes(e.key) || d.tabs.length === 0) return;
|
|
717
742
|
e.preventDefault();
|
|
718
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];
|
|
719
|
-
r && (
|
|
744
|
+
r && (J(r.path), _(() => {
|
|
720
745
|
h.value?.querySelectorAll("[role=\"tab\"]").item(n).focus();
|
|
721
746
|
}));
|
|
722
747
|
}
|
|
723
|
-
function
|
|
748
|
+
function ve(e, t) {
|
|
724
749
|
return {
|
|
725
750
|
left: `${Math.max(8, Math.min(e, window.innerWidth - ft - 8))}px`,
|
|
726
751
|
top: `${Math.max(8, Math.min(t, window.innerHeight - pt - 8))}px`
|
|
727
752
|
};
|
|
728
753
|
}
|
|
729
|
-
function
|
|
754
|
+
function Y() {
|
|
730
755
|
g.value = {
|
|
731
756
|
...g.value,
|
|
732
757
|
visible: !1
|
|
@@ -735,39 +760,39 @@ var W = {
|
|
|
735
760
|
visible: !1
|
|
736
761
|
};
|
|
737
762
|
}
|
|
738
|
-
function
|
|
739
|
-
e.preventDefault(), e.stopPropagation(),
|
|
763
|
+
function ye(e, t) {
|
|
764
|
+
e.preventDefault(), e.stopPropagation(), L = e.currentTarget, g.value = {
|
|
740
765
|
path: t,
|
|
741
|
-
style:
|
|
766
|
+
style: ve(e.clientX, e.clientY),
|
|
742
767
|
visible: !0
|
|
743
768
|
}, x.value = {
|
|
744
769
|
...x.value,
|
|
745
770
|
visible: !1
|
|
746
771
|
};
|
|
747
772
|
}
|
|
748
|
-
function
|
|
773
|
+
function be(e) {
|
|
749
774
|
e.preventDefault(), e.stopPropagation();
|
|
750
775
|
let t = m.value || d.tabs[0]?.path || "";
|
|
751
|
-
|
|
776
|
+
L = e.currentTarget, x.value = {
|
|
752
777
|
path: t,
|
|
753
|
-
style:
|
|
778
|
+
style: ve(e.clientX, e.clientY),
|
|
754
779
|
visible: !0
|
|
755
780
|
}, g.value = {
|
|
756
781
|
...g.value,
|
|
757
782
|
visible: !1
|
|
758
783
|
};
|
|
759
784
|
}
|
|
760
|
-
function
|
|
761
|
-
|
|
785
|
+
function xe() {
|
|
786
|
+
L && document.body.contains(L) && (L.focus(), L = null);
|
|
762
787
|
}
|
|
763
|
-
function
|
|
764
|
-
if (
|
|
765
|
-
let t =
|
|
766
|
-
|
|
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);
|
|
767
792
|
}
|
|
768
|
-
function
|
|
793
|
+
function Se(e) {
|
|
769
794
|
if (e.key === "Escape") {
|
|
770
|
-
e.preventDefault(),
|
|
795
|
+
e.preventDefault(), Y(), _(xe);
|
|
771
796
|
return;
|
|
772
797
|
}
|
|
773
798
|
let t = Array.from(document.querySelectorAll("[data-menu-active=\"true\"] [role=\"menuitem\"]:not(:disabled)"));
|
|
@@ -777,39 +802,39 @@ var W = {
|
|
|
777
802
|
r = e.key === "ArrowDown" ? n === -1 ? 0 : (n + 1) % t.length : e.key === "ArrowUp" ? n === -1 ? t.length - 1 : (n - 1 + t.length) % t.length : e.key === "Home" ? 0 : t.length - 1, t[r]?.focus();
|
|
778
803
|
}
|
|
779
804
|
}
|
|
780
|
-
function
|
|
805
|
+
function Z() {
|
|
781
806
|
let e = h.value;
|
|
782
807
|
e && (w.value = e.scrollWidth > e.clientWidth + 1, T.value = e.scrollLeft <= 1, k.value = e.scrollLeft + e.clientWidth >= e.scrollWidth - 1);
|
|
783
808
|
}
|
|
784
|
-
function
|
|
809
|
+
function Ce() {
|
|
785
810
|
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
786
811
|
}
|
|
787
|
-
function
|
|
812
|
+
function we(e) {
|
|
788
813
|
let t = h.value;
|
|
789
814
|
t && t.scrollBy({
|
|
790
|
-
behavior:
|
|
815
|
+
behavior: Ce(),
|
|
791
816
|
left: (e === "left" ? -1 : 1) * Math.max(160, t.clientWidth - 120)
|
|
792
817
|
});
|
|
793
818
|
}
|
|
794
|
-
function
|
|
819
|
+
function Te(e) {
|
|
795
820
|
if (!d.wheelable) return;
|
|
796
821
|
let t = h.value;
|
|
797
822
|
!t || !w.value || (e.preventDefault(), t.scrollBy({ left: Math.abs(e.deltaY) > Math.abs(e.deltaX) ? e.deltaY : e.deltaX }));
|
|
798
823
|
}
|
|
799
|
-
async function
|
|
824
|
+
async function Ee() {
|
|
800
825
|
await _(), (h.value?.querySelector("[role=\"tab\"][aria-selected=\"true\"]"))?.scrollIntoView({
|
|
801
|
-
behavior:
|
|
826
|
+
behavior: Ce(),
|
|
802
827
|
block: "nearest",
|
|
803
828
|
inline: "nearest"
|
|
804
|
-
}),
|
|
829
|
+
}), Z();
|
|
805
830
|
}
|
|
806
|
-
function
|
|
831
|
+
function De() {
|
|
807
832
|
let e = h.value?.querySelector(".lumal-tabs__list");
|
|
808
|
-
if (!e || !
|
|
809
|
-
|
|
833
|
+
if (!e || !H.value) {
|
|
834
|
+
Oe();
|
|
810
835
|
return;
|
|
811
836
|
}
|
|
812
|
-
|
|
837
|
+
I && I.el === e || (Oe(), I = ue.create(e, {
|
|
813
838
|
animation: 160,
|
|
814
839
|
draggable: ".lumal-tabs__item",
|
|
815
840
|
filter: ".is-not-draggable",
|
|
@@ -822,67 +847,67 @@ var W = {
|
|
|
822
847
|
}
|
|
823
848
|
}));
|
|
824
849
|
}
|
|
825
|
-
function
|
|
826
|
-
|
|
850
|
+
function Oe() {
|
|
851
|
+
I?.destroy(), I = void 0;
|
|
827
852
|
}
|
|
828
|
-
|
|
829
|
-
e ? _(
|
|
853
|
+
N(H, (e) => {
|
|
854
|
+
e ? _(De) : Oe();
|
|
830
855
|
});
|
|
831
|
-
function
|
|
856
|
+
function ke() {
|
|
832
857
|
if (d.standaloneMaximize) {
|
|
833
|
-
|
|
858
|
+
Ae();
|
|
834
859
|
return;
|
|
835
860
|
}
|
|
836
861
|
C.value = !C.value, p("maximize", C.value);
|
|
837
862
|
}
|
|
838
|
-
async function
|
|
863
|
+
async function Ae() {
|
|
839
864
|
let e = document.querySelector(d.fullscreenTarget);
|
|
840
865
|
e instanceof HTMLElement && (document.fullscreenElement ? await document.exitFullscreen?.() : await e.requestFullscreen?.());
|
|
841
866
|
}
|
|
842
|
-
function
|
|
867
|
+
function Q() {
|
|
843
868
|
C.value = !!document.fullscreenElement && d.standaloneMaximize, d.standaloneMaximize && p("maximize", C.value);
|
|
844
869
|
}
|
|
845
|
-
function
|
|
870
|
+
function je(e) {
|
|
846
871
|
d.standaloneMaximize || (C.value = e);
|
|
847
872
|
}
|
|
848
873
|
n({
|
|
849
874
|
getTabsElement: () => h.value,
|
|
850
|
-
refreshCurrent: () =>
|
|
851
|
-
scrollTabs:
|
|
852
|
-
toggleFullscreen:
|
|
853
|
-
setMaximized:
|
|
854
|
-
}),
|
|
855
|
-
function
|
|
875
|
+
refreshCurrent: () => he(m.value),
|
|
876
|
+
scrollTabs: we,
|
|
877
|
+
toggleFullscreen: ke,
|
|
878
|
+
setMaximized: je
|
|
879
|
+
}), N(() => [d.activePath, d.tabs.length], () => void Ee(), { flush: "post" }), N(() => d.tabs, () => void _(Z), { flush: "post" });
|
|
880
|
+
function Me(e) {
|
|
856
881
|
let t = e.target;
|
|
857
|
-
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());
|
|
858
883
|
}
|
|
859
|
-
function
|
|
860
|
-
e.key === "Escape" &&
|
|
884
|
+
function Ne(e) {
|
|
885
|
+
e.key === "Escape" && R.value.visible && (e.preventDefault(), Y(), _(xe));
|
|
861
886
|
}
|
|
862
887
|
return te(() => {
|
|
863
|
-
document.addEventListener("click",
|
|
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);
|
|
864
889
|
}), ee(() => {
|
|
865
|
-
document.removeEventListener("click",
|
|
890
|
+
V(), document.removeEventListener("click", Me), document.removeEventListener("fullscreenchange", Q), document.removeEventListener("keydown", Ne), j?.disconnect(), Oe();
|
|
866
891
|
}), (n, i) => e.visible && e.tabs.length ? (b(), l("div", {
|
|
867
892
|
key: 0,
|
|
868
893
|
class: v(["lumal-tabs", [`is-style-${e.styleType}`]])
|
|
869
894
|
}, [
|
|
870
|
-
|
|
895
|
+
re(u("button", {
|
|
871
896
|
class: "lumal-tabs__tool",
|
|
872
897
|
type: "button",
|
|
873
898
|
"aria-label": "向左滚动标签",
|
|
874
899
|
disabled: T.value,
|
|
875
|
-
onClick: i[0] ||= (e) =>
|
|
876
|
-
}, [f(O(
|
|
900
|
+
onClick: i[0] ||= (e) => we("left")
|
|
901
|
+
}, [f(O(F), {
|
|
877
902
|
name: "lumal:chevron-left",
|
|
878
903
|
size: 16
|
|
879
|
-
})], 8, Je), [[
|
|
904
|
+
})], 8, Je), [[M, w.value]]),
|
|
880
905
|
u("div", {
|
|
881
906
|
ref_key: "tabsViewportRef",
|
|
882
907
|
ref: h,
|
|
883
908
|
class: "lumal-tabs__viewport",
|
|
884
|
-
onScroll:
|
|
885
|
-
onWheel:
|
|
909
|
+
onScroll: Z,
|
|
910
|
+
onWheel: Te
|
|
886
911
|
}, [f(a, {
|
|
887
912
|
name: "lumal-tab",
|
|
888
913
|
tag: "div",
|
|
@@ -890,57 +915,57 @@ var W = {
|
|
|
890
915
|
role: "tablist",
|
|
891
916
|
"aria-label": "页面标签"
|
|
892
917
|
}, {
|
|
893
|
-
default:
|
|
918
|
+
default: P(() => [(b(!0), l(t, null, S(e.tabs, (t, n) => (b(), l("div", {
|
|
894
919
|
key: t.path,
|
|
895
920
|
class: v(["lumal-tabs__item", {
|
|
896
921
|
"is-active": t.path === m.value,
|
|
897
922
|
"is-pinned": t.pinned === !0,
|
|
898
|
-
"is-not-draggable": t.pinned === !0 || !
|
|
923
|
+
"is-not-draggable": t.pinned === !0 || !H.value
|
|
899
924
|
}]),
|
|
900
|
-
onContextmenu: (e) =>
|
|
925
|
+
onContextmenu: (e) => ye(e, t.path)
|
|
901
926
|
}, [u("button", {
|
|
902
927
|
class: "lumal-tabs__tab",
|
|
903
928
|
type: "button",
|
|
904
929
|
role: "tab",
|
|
905
930
|
"aria-selected": t.path === m.value,
|
|
906
931
|
tabindex: t.path === m.value ? 0 : -1,
|
|
907
|
-
onClick: (e) =>
|
|
908
|
-
onKeydown: (e) =>
|
|
932
|
+
onClick: (e) => J(t.path),
|
|
933
|
+
onKeydown: (e) => _e(e, n),
|
|
909
934
|
onMousedown: (e) => ge(e, t)
|
|
910
|
-
}, [t.pinned === !0 ? (b(), s(O(
|
|
935
|
+
}, [t.pinned === !0 ? (b(), s(O(F), {
|
|
911
936
|
key: 0,
|
|
912
937
|
class: "lumal-tabs__pin",
|
|
913
938
|
name: "lumal:pin",
|
|
914
939
|
size: 14
|
|
915
|
-
})) : e.showIcon && t.icon ? (b(), s(O(
|
|
940
|
+
})) : e.showIcon && t.icon ? (b(), s(O(F), {
|
|
916
941
|
key: 1,
|
|
917
942
|
name: t.icon,
|
|
918
943
|
size: 14
|
|
919
944
|
}, null, 8, ["name"])) : c("", !0), u("span", {
|
|
920
945
|
class: "lumal-tabs__label",
|
|
921
946
|
title: t.title
|
|
922
|
-
}, D(t.title), 9, Ze)], 40, Xe),
|
|
947
|
+
}, D(t.title), 9, Ze)], 40, Xe), le(t.path) ? (b(), l("button", {
|
|
923
948
|
key: 0,
|
|
924
949
|
class: "lumal-tabs__close",
|
|
925
950
|
type: "button",
|
|
926
951
|
"aria-label": `关闭${t.title}`,
|
|
927
|
-
onClick: (e) =>
|
|
928
|
-
}, [f(O(
|
|
952
|
+
onClick: (e) => me(t.path)
|
|
953
|
+
}, [f(O(F), {
|
|
929
954
|
name: "lumal:close",
|
|
930
955
|
size: 14
|
|
931
956
|
})], 8, Qe)) : c("", !0)], 42, Ye))), 128))]),
|
|
932
957
|
_: 1
|
|
933
958
|
})], 544),
|
|
934
|
-
|
|
959
|
+
re(u("button", {
|
|
935
960
|
class: "lumal-tabs__tool",
|
|
936
961
|
type: "button",
|
|
937
962
|
"aria-label": "向右滚动标签",
|
|
938
963
|
disabled: k.value,
|
|
939
|
-
onClick: i[1] ||= (e) =>
|
|
940
|
-
}, [f(O(
|
|
964
|
+
onClick: i[1] ||= (e) => we("right")
|
|
965
|
+
}, [f(O(F), {
|
|
941
966
|
name: "lumal:chevron-right",
|
|
942
967
|
size: 16
|
|
943
|
-
})], 8, $e), [[
|
|
968
|
+
})], 8, $e), [[M, w.value]]),
|
|
944
969
|
e.showRefresh ? (b(), l("button", {
|
|
945
970
|
key: 0,
|
|
946
971
|
class: "lumal-tabs__tool lumal-tabs__tool--refresh",
|
|
@@ -948,8 +973,8 @@ var W = {
|
|
|
948
973
|
"aria-label": "刷新当前页面",
|
|
949
974
|
"data-action": "refresh-current-tab",
|
|
950
975
|
disabled: !m.value,
|
|
951
|
-
onClick: i[2] ||= (e) =>
|
|
952
|
-
}, [f(O(
|
|
976
|
+
onClick: i[2] ||= (e) => he(m.value)
|
|
977
|
+
}, [f(O(F), {
|
|
953
978
|
name: "lumal:refresh",
|
|
954
979
|
size: 16
|
|
955
980
|
})], 8, et)) : c("", !0),
|
|
@@ -961,8 +986,8 @@ var W = {
|
|
|
961
986
|
"aria-haspopup": "menu",
|
|
962
987
|
"aria-expanded": x.value.visible,
|
|
963
988
|
"data-tab-menu-trigger": "",
|
|
964
|
-
onClick: i[3] ||= (e) =>
|
|
965
|
-
}, [f(O(
|
|
989
|
+
onClick: i[3] ||= (e) => be(e)
|
|
990
|
+
}, [f(O(F), {
|
|
966
991
|
name: "lumal:more",
|
|
967
992
|
size: 16
|
|
968
993
|
})], 8, tt)) : c("", !0),
|
|
@@ -972,8 +997,8 @@ var W = {
|
|
|
972
997
|
type: "button",
|
|
973
998
|
"aria-label": C.value ? "退出内容最大化" : "内容最大化",
|
|
974
999
|
"data-action": "maximize-content",
|
|
975
|
-
onClick:
|
|
976
|
-
}, [f(O(
|
|
1000
|
+
onClick: ke
|
|
1001
|
+
}, [f(O(F), {
|
|
977
1002
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
978
1003
|
size: 16
|
|
979
1004
|
}, null, 8, ["name"])], 8, nt)) : c("", !0),
|
|
@@ -982,43 +1007,43 @@ var W = {
|
|
|
982
1007
|
class: "lumal-tabs-context-menu",
|
|
983
1008
|
role: "menu",
|
|
984
1009
|
"data-menu-active": !0,
|
|
985
|
-
style: y(
|
|
986
|
-
onClick: i[13] ||=
|
|
987
|
-
onKeydown:
|
|
1010
|
+
style: y(R.value.style),
|
|
1011
|
+
onClick: i[13] ||= ie(() => {}, ["stop"]),
|
|
1012
|
+
onKeydown: Se
|
|
988
1013
|
}, [
|
|
989
1014
|
u("button", {
|
|
990
1015
|
type: "button",
|
|
991
1016
|
role: "menuitem",
|
|
992
|
-
disabled:
|
|
993
|
-
onClick: i[4] ||= (e) =>
|
|
994
|
-
}, [f(O(
|
|
1017
|
+
disabled: K("refresh"),
|
|
1018
|
+
onClick: i[4] ||= (e) => X("refresh")
|
|
1019
|
+
}, [f(O(F), {
|
|
995
1020
|
name: "lumal:refresh",
|
|
996
1021
|
size: 14
|
|
997
1022
|
}), i[14] ||= u("span", null, "重新加载", -1)], 8, rt),
|
|
998
1023
|
u("button", {
|
|
999
1024
|
type: "button",
|
|
1000
1025
|
role: "menuitem",
|
|
1001
|
-
disabled:
|
|
1002
|
-
onClick: i[5] ||= (e) =>
|
|
1003
|
-
}, [f(O(
|
|
1004
|
-
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",
|
|
1005
1030
|
size: 14
|
|
1006
|
-
}, null, 8, ["name"]), u("span", null, D(
|
|
1031
|
+
}, null, 8, ["name"]), u("span", null, D(q(ae.value)), 1)], 8, it),
|
|
1007
1032
|
u("button", {
|
|
1008
1033
|
type: "button",
|
|
1009
1034
|
role: "menuitem",
|
|
1010
|
-
disabled:
|
|
1011
|
-
onClick: i[6] ||= (e) =>
|
|
1012
|
-
}, [f(O(
|
|
1035
|
+
disabled: K("maximize"),
|
|
1036
|
+
onClick: i[6] ||= (e) => X("maximize")
|
|
1037
|
+
}, [f(O(F), {
|
|
1013
1038
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
1014
1039
|
size: 14
|
|
1015
1040
|
}, null, 8, ["name"]), u("span", null, D(pe()), 1)], 8, at),
|
|
1016
1041
|
u("button", {
|
|
1017
1042
|
type: "button",
|
|
1018
1043
|
role: "menuitem",
|
|
1019
|
-
disabled:
|
|
1020
|
-
onClick: i[7] ||= (e) =>
|
|
1021
|
-
}, [f(O(
|
|
1044
|
+
disabled: K("new-window"),
|
|
1045
|
+
onClick: i[7] ||= (e) => X("new-window")
|
|
1046
|
+
}, [f(O(F), {
|
|
1022
1047
|
name: "lumal:external-link",
|
|
1023
1048
|
size: 14
|
|
1024
1049
|
}), i[15] ||= u("span", null, "在新窗口打开", -1)], 8, ot),
|
|
@@ -1026,52 +1051,52 @@ var W = {
|
|
|
1026
1051
|
u("button", {
|
|
1027
1052
|
type: "button",
|
|
1028
1053
|
role: "menuitem",
|
|
1029
|
-
disabled:
|
|
1030
|
-
onClick: i[8] ||= (e) =>
|
|
1031
|
-
}, [f(O(
|
|
1054
|
+
disabled: K("close"),
|
|
1055
|
+
onClick: i[8] ||= (e) => X("close")
|
|
1056
|
+
}, [f(O(F), {
|
|
1032
1057
|
name: "lumal:close",
|
|
1033
1058
|
size: 14
|
|
1034
1059
|
}), i[16] ||= u("span", null, "关闭", -1)], 8, st),
|
|
1035
1060
|
u("button", {
|
|
1036
1061
|
type: "button",
|
|
1037
1062
|
role: "menuitem",
|
|
1038
|
-
disabled:
|
|
1039
|
-
onClick: i[9] ||= (e) =>
|
|
1040
|
-
}, [f(O(
|
|
1063
|
+
disabled: K("close-left"),
|
|
1064
|
+
onClick: i[9] ||= (e) => X("close-left")
|
|
1065
|
+
}, [f(O(F), {
|
|
1041
1066
|
name: "lumal:chevron-left",
|
|
1042
1067
|
size: 14
|
|
1043
1068
|
}), i[17] ||= u("span", null, "关闭左侧", -1)], 8, ct),
|
|
1044
1069
|
u("button", {
|
|
1045
1070
|
type: "button",
|
|
1046
1071
|
role: "menuitem",
|
|
1047
|
-
disabled:
|
|
1048
|
-
onClick: i[10] ||= (e) =>
|
|
1049
|
-
}, [f(O(
|
|
1072
|
+
disabled: K("close-right"),
|
|
1073
|
+
onClick: i[10] ||= (e) => X("close-right")
|
|
1074
|
+
}, [f(O(F), {
|
|
1050
1075
|
name: "lumal:chevron-right",
|
|
1051
1076
|
size: 14
|
|
1052
1077
|
}), i[18] ||= u("span", null, "关闭右侧", -1)], 8, lt),
|
|
1053
1078
|
u("button", {
|
|
1054
1079
|
type: "button",
|
|
1055
1080
|
role: "menuitem",
|
|
1056
|
-
disabled:
|
|
1057
|
-
onClick: i[11] ||= (e) =>
|
|
1058
|
-
}, [f(O(
|
|
1081
|
+
disabled: K("close-others"),
|
|
1082
|
+
onClick: i[11] ||= (e) => X("close-others")
|
|
1083
|
+
}, [f(O(F), {
|
|
1059
1084
|
name: "lumal:close",
|
|
1060
1085
|
size: 14
|
|
1061
1086
|
}), i[19] ||= u("span", null, "关闭其他", -1)], 8, ut),
|
|
1062
1087
|
u("button", {
|
|
1063
1088
|
type: "button",
|
|
1064
1089
|
role: "menuitem",
|
|
1065
|
-
disabled:
|
|
1066
|
-
onClick: i[12] ||= (e) =>
|
|
1067
|
-
}, [f(O(
|
|
1090
|
+
disabled: K("close-all"),
|
|
1091
|
+
onClick: i[12] ||= (e) => X("close-all")
|
|
1092
|
+
}, [f(O(F), {
|
|
1068
1093
|
name: "lumal:close",
|
|
1069
1094
|
size: 14
|
|
1070
1095
|
}), i[20] ||= u("span", null, "关闭全部", -1)], 8, dt)
|
|
1071
1096
|
], 36)) : c("", !0)]))
|
|
1072
1097
|
], 2)) : c("", !0);
|
|
1073
1098
|
}
|
|
1074
|
-
}), [["__scopeId", "data-v-
|
|
1099
|
+
}), [["__scopeId", "data-v-5ebf2b13"]]), ht = { class: "lumal-top-nav-menu-item__label" }, gt = {
|
|
1075
1100
|
key: 1,
|
|
1076
1101
|
class: "lumal-top-nav-menu-item__external",
|
|
1077
1102
|
"aria-hidden": "true"
|
|
@@ -1087,19 +1112,19 @@ var W = {
|
|
|
1087
1112
|
},
|
|
1088
1113
|
emits: ["select"],
|
|
1089
1114
|
setup(e, { emit: n }) {
|
|
1090
|
-
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));
|
|
1091
1116
|
function m(e) {
|
|
1092
1117
|
i("select", e);
|
|
1093
1118
|
}
|
|
1094
1119
|
return (n, r) => {
|
|
1095
1120
|
let i = w("LumalTopNavMenuItem", !0);
|
|
1096
|
-
return a.value.length ? (b(), s(O(
|
|
1121
|
+
return a.value.length ? (b(), s(O(V), {
|
|
1097
1122
|
key: 0,
|
|
1098
1123
|
index: e.item.path,
|
|
1099
1124
|
class: v({ "is-active": p.value })
|
|
1100
1125
|
}, {
|
|
1101
|
-
title:
|
|
1102
|
-
e.item.icon ? (b(), s(O(
|
|
1126
|
+
title: P(() => [
|
|
1127
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1103
1128
|
key: 0,
|
|
1104
1129
|
name: e.item.icon,
|
|
1105
1130
|
size: 16
|
|
@@ -1117,7 +1142,7 @@ var W = {
|
|
|
1117
1142
|
])]),
|
|
1118
1143
|
e.item.externalLink ? (b(), l("span", gt, "↗")) : c("", !0)
|
|
1119
1144
|
]),
|
|
1120
|
-
default:
|
|
1145
|
+
default: P(() => [(b(!0), l(t, null, S(a.value, (t) => (b(), s(i, {
|
|
1121
1146
|
key: t.path,
|
|
1122
1147
|
item: t,
|
|
1123
1148
|
"active-path": e.activePath,
|
|
@@ -1131,7 +1156,7 @@ var W = {
|
|
|
1131
1156
|
tabindex: "-1",
|
|
1132
1157
|
onClick: r[0] ||= (t) => m(e.item.path)
|
|
1133
1158
|
}, [
|
|
1134
|
-
e.item.icon ? (b(), s(O(
|
|
1159
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1135
1160
|
key: 0,
|
|
1136
1161
|
name: e.item.icon,
|
|
1137
1162
|
size: 16
|
|
@@ -1151,14 +1176,14 @@ var W = {
|
|
|
1151
1176
|
class: "lumal-top-nav-menu-item__external",
|
|
1152
1177
|
"aria-hidden": "true"
|
|
1153
1178
|
}, "↗", -1)
|
|
1154
|
-
], 2)) : (b(), s(O(
|
|
1179
|
+
], 2)) : (b(), s(O(B), {
|
|
1155
1180
|
key: 2,
|
|
1156
1181
|
index: e.item.path,
|
|
1157
1182
|
class: v({ "is-active": p.value }),
|
|
1158
1183
|
onClick: r[1] ||= (t) => m(e.item.path)
|
|
1159
1184
|
}, {
|
|
1160
|
-
default:
|
|
1161
|
-
e.item.icon ? (b(), s(O(
|
|
1185
|
+
default: P(() => [
|
|
1186
|
+
e.item.icon ? (b(), s(O(F), {
|
|
1162
1187
|
key: 0,
|
|
1163
1188
|
name: e.item.icon,
|
|
1164
1189
|
size: 16
|
|
@@ -1200,7 +1225,7 @@ var W = {
|
|
|
1200
1225
|
return !!e.externalLink && e.externalTarget !== "_self";
|
|
1201
1226
|
}
|
|
1202
1227
|
function h(e) {
|
|
1203
|
-
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;
|
|
1204
1229
|
}
|
|
1205
1230
|
function _(e) {
|
|
1206
1231
|
let t = h(e);
|
|
@@ -1224,7 +1249,7 @@ var W = {
|
|
|
1224
1249
|
return n({
|
|
1225
1250
|
getMenuElement: () => d.value?.$el,
|
|
1226
1251
|
getMenuInstance: () => d.value
|
|
1227
|
-
}), (n, r) => (b(), s(O(
|
|
1252
|
+
}), (n, r) => (b(), s(O(z), {
|
|
1228
1253
|
key: `top-nav:${e.mode}:${e.activePath}`,
|
|
1229
1254
|
ref_key: "menuRef",
|
|
1230
1255
|
ref: d,
|
|
@@ -1234,14 +1259,14 @@ var W = {
|
|
|
1234
1259
|
ellipsis: !0,
|
|
1235
1260
|
style: y(ee.value)
|
|
1236
1261
|
}, {
|
|
1237
|
-
default:
|
|
1262
|
+
default: P(() => [(b(!0), l(t, null, S(e.mode === "tree" ? p.value : [], (t) => (b(), s(bt, {
|
|
1238
1263
|
key: `tree:${t.path}`,
|
|
1239
1264
|
item: t,
|
|
1240
1265
|
"active-path": e.activePath,
|
|
1241
1266
|
onSelect: te
|
|
1242
|
-
}, 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(
|
|
1243
|
-
default:
|
|
1244
|
-
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), {
|
|
1245
1270
|
key: 0,
|
|
1246
1271
|
name: e.icon,
|
|
1247
1272
|
size: 16
|
|
@@ -1519,14 +1544,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1519
1544
|
"tabPin",
|
|
1520
1545
|
"tabReorder",
|
|
1521
1546
|
"tabMaximize",
|
|
1522
|
-
"tabNewWindow"
|
|
1547
|
+
"tabNewWindow",
|
|
1548
|
+
"tabsChange"
|
|
1523
1549
|
], ["update:activeTabPath"]),
|
|
1524
1550
|
setup(e, { expose: t, emit: n }) {
|
|
1525
|
-
let r = e, a = n, u = ne(e, "activeTabPath"), p = m(
|
|
1526
|
-
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) {
|
|
1527
1553
|
return e.meta.layout !== "public" && e.meta.hideInTab !== !0 && !!e.meta.title;
|
|
1528
1554
|
}
|
|
1529
|
-
function
|
|
1555
|
+
function F(e) {
|
|
1530
1556
|
let t = typeof e.meta.title == "string" ? e.meta.title : void 0;
|
|
1531
1557
|
if (t) return {
|
|
1532
1558
|
closable: e.meta.affixTab !== !0,
|
|
@@ -1535,14 +1561,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1535
1561
|
title: t
|
|
1536
1562
|
};
|
|
1537
1563
|
}
|
|
1538
|
-
function
|
|
1564
|
+
function I() {
|
|
1539
1565
|
return r.fixedTabs.map((e) => ({
|
|
1540
1566
|
...e,
|
|
1541
1567
|
closable: !1,
|
|
1542
1568
|
pinned: !0
|
|
1543
1569
|
}));
|
|
1544
1570
|
}
|
|
1545
|
-
function
|
|
1571
|
+
function L(e) {
|
|
1546
1572
|
return {
|
|
1547
1573
|
closable: e.closable !== !1,
|
|
1548
1574
|
icon: e.icon,
|
|
@@ -1551,7 +1577,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1551
1577
|
title: e.title
|
|
1552
1578
|
};
|
|
1553
1579
|
}
|
|
1554
|
-
function
|
|
1580
|
+
function ae() {
|
|
1555
1581
|
if (r.isValidTabPath) return r.isValidTabPath;
|
|
1556
1582
|
if (!(!h || !r.routeDriven)) return (e) => {
|
|
1557
1583
|
try {
|
|
@@ -1562,7 +1588,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1562
1588
|
}
|
|
1563
1589
|
};
|
|
1564
1590
|
}
|
|
1565
|
-
function
|
|
1591
|
+
function oe(e) {
|
|
1566
1592
|
if (!(!h || !r.routeDriven)) try {
|
|
1567
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;
|
|
1568
1594
|
return !r && !i ? void 0 : {
|
|
@@ -1573,35 +1599,37 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1573
1599
|
return;
|
|
1574
1600
|
}
|
|
1575
1601
|
}
|
|
1576
|
-
function
|
|
1577
|
-
if (!r.routeDriven || !(r.routeTabFilter ??
|
|
1578
|
-
let t = (r.routeTabResolver ??
|
|
1602
|
+
function z(e) {
|
|
1603
|
+
if (!r.routeDriven || !(r.routeTabFilter ?? ie)(e)) return;
|
|
1604
|
+
let t = (r.routeTabResolver ?? F)(e);
|
|
1579
1605
|
if (!t) return;
|
|
1580
|
-
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 });
|
|
1581
1607
|
w.value = o, r.preferences.tabbar.visitHistory && (D.value = Jt(D.value, e.path)), Q();
|
|
1582
1608
|
}
|
|
1583
|
-
function
|
|
1609
|
+
function B(e) {
|
|
1584
1610
|
r.routeDriven && h && e && e !== p?.path && h.push(e);
|
|
1585
1611
|
}
|
|
1586
|
-
function
|
|
1612
|
+
function se(e) {
|
|
1587
1613
|
return r.tabFallbackPath ? r.tabFallbackPath : e[0]?.path ?? "";
|
|
1588
1614
|
}
|
|
1589
|
-
let
|
|
1615
|
+
let V = o({
|
|
1590
1616
|
get: () => r.routeDriven ? p?.path ?? r.activeTabPath : u.value ?? r.activeTabPath,
|
|
1591
1617
|
set: (e) => {
|
|
1592
|
-
r.routeDriven ?
|
|
1618
|
+
r.routeDriven ? B(e) : u.value = e;
|
|
1593
1619
|
}
|
|
1594
|
-
}),
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
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(() => ({
|
|
1598
1626
|
enable: r.preferences.breadcrumb?.enable ?? !0,
|
|
1599
1627
|
hideOnlyOne: r.preferences.breadcrumb?.hideOnlyOne ?? !1,
|
|
1600
1628
|
showHome: r.preferences.breadcrumb?.showHome ?? !0,
|
|
1601
1629
|
showIcon: r.preferences.breadcrumb?.showIcon ?? !0
|
|
1602
|
-
})),
|
|
1603
|
-
let e =
|
|
1604
|
-
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,
|
|
1605
1633
|
layout: r.preferences.app.layout,
|
|
1606
1634
|
menus: r.menus
|
|
1607
1635
|
});
|
|
@@ -1609,16 +1637,16 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1609
1637
|
...e,
|
|
1610
1638
|
sidebarMenus: r.preferences.sidebar.enable ? e.sidebarMenus : []
|
|
1611
1639
|
};
|
|
1612
|
-
}), xe = o(() =>
|
|
1613
|
-
|
|
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(() => [
|
|
1614
1642
|
p?.fullPath,
|
|
1615
|
-
|
|
1643
|
+
q.value,
|
|
1616
1644
|
r.menus,
|
|
1617
1645
|
r.preferences.app.layout,
|
|
1618
1646
|
r.preferences.sidebar.enable
|
|
1619
1647
|
], () => {
|
|
1620
|
-
T.value =
|
|
1621
|
-
}, { immediate: !0 }),
|
|
1648
|
+
T.value = ve.value;
|
|
1649
|
+
}, { immediate: !0 }), N(() => [
|
|
1622
1650
|
r.preferences.app.dynamicTitle ?? !0,
|
|
1623
1651
|
p?.meta.title,
|
|
1624
1652
|
r.title
|
|
@@ -1631,47 +1659,48 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1631
1659
|
}
|
|
1632
1660
|
!r && !i || (document.title = r && i && r !== i ? `${r} - ${i}` : r || i);
|
|
1633
1661
|
}, { immediate: !0 });
|
|
1634
|
-
|
|
1635
|
-
|
|
1662
|
+
let ke = !1;
|
|
1663
|
+
function Ae() {
|
|
1664
|
+
if (r.tabStorageKey && !(typeof sessionStorage > "u")) return {
|
|
1636
1665
|
getItem: sessionStorage.getItem.bind(sessionStorage),
|
|
1637
1666
|
removeItem: sessionStorage.removeItem.bind(sessionStorage),
|
|
1638
1667
|
setItem: sessionStorage.setItem.bind(sessionStorage)
|
|
1639
1668
|
};
|
|
1640
1669
|
}
|
|
1641
1670
|
function Q() {
|
|
1642
|
-
let e =
|
|
1643
|
-
if (!e || !r.tabStorageKey || !r.routeDriven) return;
|
|
1671
|
+
let e = Ae();
|
|
1672
|
+
if (!ke || !r.preferences.tabbar.persist || !e || !r.tabStorageKey || !r.routeDriven) return;
|
|
1644
1673
|
let t = Ot({
|
|
1645
|
-
tabs: w.value.map(
|
|
1674
|
+
tabs: w.value.map(L),
|
|
1646
1675
|
history: D.value
|
|
1647
1676
|
});
|
|
1648
1677
|
At(e, r.tabStorageKey, t);
|
|
1649
1678
|
}
|
|
1650
|
-
function
|
|
1651
|
-
let e =
|
|
1679
|
+
function Me() {
|
|
1680
|
+
let e = Ae();
|
|
1652
1681
|
!e || !r.tabStorageKey || Mt(e, r.tabStorageKey);
|
|
1653
1682
|
}
|
|
1654
|
-
function
|
|
1683
|
+
function Ne() {
|
|
1655
1684
|
if (!r.routeDriven) return;
|
|
1656
|
-
let e =
|
|
1685
|
+
let e = Ae();
|
|
1657
1686
|
if (!e || !r.tabStorageKey) return;
|
|
1658
1687
|
let t = jt(e, r.tabStorageKey), n = p?.path ?? "", i = Nt(t, {
|
|
1659
1688
|
currentPath: n,
|
|
1660
|
-
currentTab: p ? (r.routeTabResolver ??
|
|
1661
|
-
fixedTabs:
|
|
1662
|
-
isValidPath:
|
|
1663
|
-
resolveTab:
|
|
1689
|
+
currentTab: p ? (r.routeTabResolver ?? F)(p) : void 0,
|
|
1690
|
+
fixedTabs: I(),
|
|
1691
|
+
isValidPath: ae(),
|
|
1692
|
+
resolveTab: oe
|
|
1664
1693
|
});
|
|
1665
|
-
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 = [];
|
|
1666
1695
|
}
|
|
1667
|
-
function
|
|
1696
|
+
function $(e) {
|
|
1668
1697
|
y.value = e?.matches ?? j?.matches ?? !1, y.value && (x.value = !1);
|
|
1669
1698
|
}
|
|
1670
1699
|
te(() => {
|
|
1671
|
-
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", $));
|
|
1672
1701
|
}), ee(() => {
|
|
1673
|
-
j?.removeEventListener?.("change",
|
|
1674
|
-
}),
|
|
1702
|
+
j?.removeEventListener?.("change", $);
|
|
1703
|
+
}), N(() => [
|
|
1675
1704
|
r.routeDriven,
|
|
1676
1705
|
k.value,
|
|
1677
1706
|
r.fixedTabs
|
|
@@ -1680,80 +1709,78 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1680
1709
|
w.value = [];
|
|
1681
1710
|
return;
|
|
1682
1711
|
}
|
|
1683
|
-
let e =
|
|
1712
|
+
let e = I(), t = new Set(e.map((e) => e.path)), n = [...e];
|
|
1684
1713
|
for (let e of w.value.filter((e) => !t.has(e.path))) n = Ft(n, e, { maxCount: k.value });
|
|
1685
|
-
w.value = It(Pt(n), k.value,
|
|
1714
|
+
w.value = It(Pt(n), k.value, V.value), Q();
|
|
1686
1715
|
}, {
|
|
1687
1716
|
deep: !0,
|
|
1688
1717
|
immediate: !0
|
|
1689
|
-
}),
|
|
1690
|
-
p &&
|
|
1691
|
-
}, { immediate: !0 }),
|
|
1718
|
+
}), N(() => p?.fullPath, () => {
|
|
1719
|
+
p && z(p);
|
|
1720
|
+
}, { immediate: !0 }), r.preferences.tabbar.persist && Ne(), ke = !0, Q(), N(() => [
|
|
1692
1721
|
r.routeDriven,
|
|
1693
1722
|
r.tabStorageKey,
|
|
1694
1723
|
r.preferences.tabbar.persist
|
|
1695
1724
|
], (e, t) => {
|
|
1696
|
-
let n = e[0], r = e[2], i = t?.[
|
|
1697
|
-
n && r && !i &&
|
|
1698
|
-
}, { immediate: !1 })
|
|
1699
|
-
|
|
1700
|
-
});
|
|
1701
|
-
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() {
|
|
1702
1729
|
if (y.value) {
|
|
1703
1730
|
x.value = !x.value;
|
|
1704
1731
|
return;
|
|
1705
1732
|
}
|
|
1706
1733
|
a("toggleSidebar");
|
|
1707
1734
|
}
|
|
1708
|
-
function Pe(e) {
|
|
1709
|
-
x.value = !1, a("menuSelect", e);
|
|
1710
|
-
}
|
|
1711
1735
|
function Fe(e) {
|
|
1712
|
-
|
|
1713
|
-
J.value && t && (n.length > 0 || !i) && (T.value = t.path), a("topMenuSelect", e), !(J.value && n.length > 0 && !r.preferences.sidebar.autoActivateChild) && Pe(pe(t) || e);
|
|
1736
|
+
x.value = !1, a("menuSelect", e);
|
|
1714
1737
|
}
|
|
1715
1738
|
function Ie(e) {
|
|
1716
|
-
|
|
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);
|
|
1717
1741
|
}
|
|
1718
1742
|
function Le(e) {
|
|
1719
|
-
|
|
1743
|
+
Fe(de(W(r.menus, e)) || e);
|
|
1720
1744
|
}
|
|
1721
1745
|
function Re(e) {
|
|
1746
|
+
a("tabChange", e);
|
|
1747
|
+
}
|
|
1748
|
+
function ze(e) {
|
|
1722
1749
|
if (r.routeDriven) {
|
|
1723
1750
|
let t = w.value.findIndex((t) => t.path === e), n = Lt(w.value, e);
|
|
1724
|
-
if (w.value = n,
|
|
1751
|
+
if (w.value = n, V.value === e) {
|
|
1725
1752
|
let i = r.preferences.tabbar.visitHistory;
|
|
1726
|
-
|
|
1753
|
+
B(Yt(n, e, D.value, {
|
|
1727
1754
|
useHistory: i,
|
|
1728
1755
|
priorClosedIndex: t
|
|
1729
|
-
}) ||
|
|
1756
|
+
}) || se(n));
|
|
1730
1757
|
}
|
|
1731
1758
|
Q();
|
|
1732
1759
|
}
|
|
1733
1760
|
a("tabRemove", e);
|
|
1734
1761
|
}
|
|
1735
|
-
function ze(e) {
|
|
1736
|
-
r.routeDriven && (w.value = Rt(w.value, e), R(e), Q()), a("tabCloseLeft", e);
|
|
1737
|
-
}
|
|
1738
1762
|
function Be(e) {
|
|
1739
|
-
r.routeDriven && (w.value =
|
|
1763
|
+
r.routeDriven && (w.value = Rt(w.value, e), B(e), Q()), a("tabCloseLeft", e);
|
|
1740
1764
|
}
|
|
1741
1765
|
function Ve(e) {
|
|
1742
|
-
r.routeDriven && (w.value =
|
|
1766
|
+
r.routeDriven && (w.value = zt(w.value, e), B(e), Q()), a("tabCloseRight", e);
|
|
1743
1767
|
}
|
|
1744
|
-
function He() {
|
|
1745
|
-
r.routeDriven && (w.value =
|
|
1768
|
+
function He(e) {
|
|
1769
|
+
r.routeDriven && (w.value = Bt(w.value, e), B(e), Q()), a("tabCloseOthers", e);
|
|
1746
1770
|
}
|
|
1747
|
-
function Ue(
|
|
1748
|
-
r.routeDriven && (w.value =
|
|
1771
|
+
function Ue() {
|
|
1772
|
+
r.routeDriven && (w.value = Vt(w.value), B(se(w.value)), Q()), a("tabCloseAll");
|
|
1749
1773
|
}
|
|
1750
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) {
|
|
1751
1778
|
r.routeDriven && (w.value = Xt(w.value, e, t), Q()), a("tabReorder", e, t);
|
|
1752
1779
|
}
|
|
1753
|
-
function
|
|
1780
|
+
function Ke(e) {
|
|
1754
1781
|
let t = r.resolveTabUrl ? r.resolveTabUrl(e) : (() => {
|
|
1755
1782
|
if (h) try {
|
|
1756
|
-
return h.resolve(e)?.
|
|
1783
|
+
return h.resolve(e)?.href ?? e;
|
|
1757
1784
|
} catch {
|
|
1758
1785
|
return e;
|
|
1759
1786
|
}
|
|
@@ -1761,63 +1788,63 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1761
1788
|
})();
|
|
1762
1789
|
window.open(t, "_blank", "noopener,noreferrer"), a("tabNewWindow", e);
|
|
1763
1790
|
}
|
|
1764
|
-
function
|
|
1791
|
+
function Je(e) {
|
|
1765
1792
|
S.value = e, a("tabMaximize", e);
|
|
1766
1793
|
}
|
|
1767
|
-
function
|
|
1768
|
-
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));
|
|
1769
1796
|
}
|
|
1770
|
-
return
|
|
1771
|
-
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));
|
|
1772
1799
|
}), ee(() => {
|
|
1773
|
-
typeof document < "u" && document.removeEventListener("keydown",
|
|
1800
|
+
typeof document < "u" && document.removeEventListener("keydown", Ye);
|
|
1774
1801
|
}), t({
|
|
1775
1802
|
getLayoutElement: () => g.value?.$el,
|
|
1776
1803
|
getLayoutInstance: () => g.value,
|
|
1777
|
-
getTabs: () => [...
|
|
1804
|
+
getTabs: () => [...H.value],
|
|
1778
1805
|
getVisitHistory: () => [...D.value],
|
|
1779
1806
|
resetTabs: () => {
|
|
1780
|
-
w.value = Vt(w.value), D.value = [],
|
|
1807
|
+
w.value = Vt(w.value), D.value = [], B(se(w.value)), Q();
|
|
1781
1808
|
},
|
|
1782
1809
|
resetTabSnapshot: () => {
|
|
1783
|
-
|
|
1810
|
+
Me();
|
|
1784
1811
|
}
|
|
1785
|
-
}), (t, n) => (b(), s(O(
|
|
1812
|
+
}), (t, n) => (b(), s(O(R), {
|
|
1786
1813
|
ref_key: "layoutRef",
|
|
1787
1814
|
ref: g,
|
|
1788
1815
|
class: v(["lumal-layout", {
|
|
1789
|
-
"is-sidebar-collapsed":
|
|
1790
|
-
"is-sidebar-hidden": !
|
|
1816
|
+
"is-sidebar-collapsed": U.value,
|
|
1817
|
+
"is-sidebar-hidden": !Se.value,
|
|
1791
1818
|
"is-mobile-menu-hidden": !x.value,
|
|
1792
1819
|
"is-content-maximized": S.value
|
|
1793
1820
|
}]),
|
|
1794
1821
|
"data-layout": e.preferences.app.layout,
|
|
1795
1822
|
direction: "vertical"
|
|
1796
1823
|
}, {
|
|
1797
|
-
default:
|
|
1824
|
+
default: P(() => [e.showHeader ? re((b(), s(je, {
|
|
1798
1825
|
key: 0,
|
|
1799
1826
|
title: e.title,
|
|
1800
|
-
collapsed: y.value ? !x.value :
|
|
1827
|
+
collapsed: y.value ? !x.value : U.value,
|
|
1801
1828
|
height: e.headerHeight,
|
|
1802
|
-
"mobile-only-toggle": !
|
|
1803
|
-
"sidebar-enabled":
|
|
1804
|
-
"toggle-after-title":
|
|
1805
|
-
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
|
|
1806
1833
|
}, d({ _: 2 }, [
|
|
1807
1834
|
t.$slots.logo ? {
|
|
1808
1835
|
name: "logo",
|
|
1809
|
-
fn:
|
|
1836
|
+
fn: P(() => [C(t.$slots, "logo", {}, void 0, !0)]),
|
|
1810
1837
|
key: "0"
|
|
1811
1838
|
} : void 0,
|
|
1812
|
-
|
|
1839
|
+
Z.value ? {
|
|
1813
1840
|
name: "navigation",
|
|
1814
|
-
fn:
|
|
1841
|
+
fn: P(() => [f(Ct, {
|
|
1815
1842
|
menus: X.value,
|
|
1816
1843
|
"active-path": Te.value,
|
|
1817
1844
|
align: e.preferences.header.menuAlign,
|
|
1818
1845
|
"max-width": e.preferences.header.menuMaxWidth,
|
|
1819
1846
|
mode: we.value,
|
|
1820
|
-
onSelect:
|
|
1847
|
+
onSelect: Ie
|
|
1821
1848
|
}, null, 8, [
|
|
1822
1849
|
"menus",
|
|
1823
1850
|
"active-path",
|
|
@@ -1829,15 +1856,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1829
1856
|
} : void 0,
|
|
1830
1857
|
Ce.value ? {
|
|
1831
1858
|
name: "breadcrumb",
|
|
1832
|
-
fn:
|
|
1859
|
+
fn: P(() => [f(he, {
|
|
1833
1860
|
class: "lumal-layout__header-breadcrumb",
|
|
1834
|
-
"active-menu-path":
|
|
1835
|
-
"active-path":
|
|
1836
|
-
"hide-only-one":
|
|
1861
|
+
"active-menu-path": q.value,
|
|
1862
|
+
"active-path": pe.value,
|
|
1863
|
+
"hide-only-one": J.value.hideOnlyOne,
|
|
1837
1864
|
menus: e.menus,
|
|
1838
|
-
"show-home":
|
|
1839
|
-
"show-icon":
|
|
1840
|
-
onSelect:
|
|
1865
|
+
"show-home": J.value.showHome,
|
|
1866
|
+
"show-icon": J.value.showIcon,
|
|
1867
|
+
onSelect: Le
|
|
1841
1868
|
}, null, 8, [
|
|
1842
1869
|
"active-menu-path",
|
|
1843
1870
|
"active-path",
|
|
@@ -1848,13 +1875,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1848
1875
|
])]),
|
|
1849
1876
|
key: "2"
|
|
1850
1877
|
} : void 0,
|
|
1851
|
-
|
|
1878
|
+
me.value || t.$slots.headerActions ? {
|
|
1852
1879
|
name: "actions",
|
|
1853
|
-
fn:
|
|
1880
|
+
fn: P(() => [me.value ? (b(), s(Ee, {
|
|
1854
1881
|
key: 0,
|
|
1855
1882
|
menus: e.menus,
|
|
1856
|
-
shortcut:
|
|
1857
|
-
onSelect:
|
|
1883
|
+
shortcut: _e.value,
|
|
1884
|
+
onSelect: Le
|
|
1858
1885
|
}, null, 8, ["menus", "shortcut"])) : c("", !0), C(t.$slots, "headerActions", {}, void 0, !0)]),
|
|
1859
1886
|
key: "3"
|
|
1860
1887
|
} : void 0
|
|
@@ -1865,8 +1892,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1865
1892
|
"mobile-only-toggle",
|
|
1866
1893
|
"sidebar-enabled",
|
|
1867
1894
|
"toggle-after-title"
|
|
1868
|
-
])), [[
|
|
1869
|
-
default:
|
|
1895
|
+
])), [[M, !S.value]]) : c("", !0), f(O(R), { class: "lumal-layout__body" }, {
|
|
1896
|
+
default: P(() => [
|
|
1870
1897
|
Oe.value && !S.value ? (b(), l("button", {
|
|
1871
1898
|
key: 0,
|
|
1872
1899
|
class: "lumal-layout__sidebar-scrim",
|
|
@@ -1879,16 +1906,16 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1879
1906
|
name: "lumal-layout-sidebar",
|
|
1880
1907
|
appear: ""
|
|
1881
1908
|
}, {
|
|
1882
|
-
default:
|
|
1909
|
+
default: P(() => [Se.value ? (b(), s(qe, {
|
|
1883
1910
|
key: 0,
|
|
1884
1911
|
class: "lumal-layout__desktop-sidebar",
|
|
1885
1912
|
"aria-label": "主菜单",
|
|
1886
1913
|
menus: xe.value,
|
|
1887
|
-
"active-path":
|
|
1888
|
-
collapsed:
|
|
1914
|
+
"active-path": q.value,
|
|
1915
|
+
collapsed: U.value,
|
|
1889
1916
|
width: `${e.preferences.sidebar.width}px`,
|
|
1890
1917
|
"collapsed-width": "64px",
|
|
1891
|
-
onSelect:
|
|
1918
|
+
onSelect: Fe
|
|
1892
1919
|
}, null, 8, [
|
|
1893
1920
|
"menus",
|
|
1894
1921
|
"active-path",
|
|
@@ -1904,11 +1931,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1904
1931
|
"aria-hidden": !x.value,
|
|
1905
1932
|
inert: !x.value || void 0,
|
|
1906
1933
|
menus: De.value,
|
|
1907
|
-
"active-path":
|
|
1934
|
+
"active-path": q.value,
|
|
1908
1935
|
collapsed: !1,
|
|
1909
1936
|
width: `${e.preferences.sidebar.width}px`,
|
|
1910
1937
|
"collapsed-width": "64px",
|
|
1911
|
-
onSelect:
|
|
1938
|
+
onSelect: Fe
|
|
1912
1939
|
}, null, 8, [
|
|
1913
1940
|
"aria-hidden",
|
|
1914
1941
|
"inert",
|
|
@@ -1916,21 +1943,21 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1916
1943
|
"active-path",
|
|
1917
1944
|
"width"
|
|
1918
1945
|
])) : c("", !0),
|
|
1919
|
-
f(O(
|
|
1946
|
+
f(O(R), {
|
|
1920
1947
|
class: "lumal-layout__main",
|
|
1921
1948
|
direction: "vertical",
|
|
1922
1949
|
"data-layout-fullscreen-target": ""
|
|
1923
1950
|
}, {
|
|
1924
|
-
default:
|
|
1925
|
-
|
|
1951
|
+
default: P(() => [
|
|
1952
|
+
J.value.enable && !Ce.value && !S.value ? (b(), s(he, {
|
|
1926
1953
|
key: 0,
|
|
1927
|
-
"active-menu-path":
|
|
1928
|
-
"active-path":
|
|
1929
|
-
"hide-only-one":
|
|
1954
|
+
"active-menu-path": q.value,
|
|
1955
|
+
"active-path": pe.value,
|
|
1956
|
+
"hide-only-one": J.value.hideOnlyOne,
|
|
1930
1957
|
menus: e.menus,
|
|
1931
|
-
"show-home":
|
|
1932
|
-
"show-icon":
|
|
1933
|
-
onSelect:
|
|
1958
|
+
"show-home": J.value.showHome,
|
|
1959
|
+
"show-icon": J.value.showIcon,
|
|
1960
|
+
onSelect: Le
|
|
1934
1961
|
}, null, 8, [
|
|
1935
1962
|
"active-menu-path",
|
|
1936
1963
|
"active-path",
|
|
@@ -1939,13 +1966,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1939
1966
|
"show-home",
|
|
1940
1967
|
"show-icon"
|
|
1941
1968
|
])) : c("", !0),
|
|
1942
|
-
|
|
1969
|
+
ue.value && e.preferences.tabbar.enable ? (b(), s(mt, {
|
|
1943
1970
|
key: 1,
|
|
1944
1971
|
ref_key: "tabsRef",
|
|
1945
1972
|
ref: _,
|
|
1946
|
-
"active-path":
|
|
1947
|
-
"onUpdate:activePath": n[1] ||= (e) =>
|
|
1948
|
-
tabs:
|
|
1973
|
+
"active-path": V.value,
|
|
1974
|
+
"onUpdate:activePath": n[1] ||= (e) => V.value = e,
|
|
1975
|
+
tabs: H.value,
|
|
1949
1976
|
"show-icon": e.preferences.tabbar.showIcon,
|
|
1950
1977
|
"show-maximize": e.preferences.tabbar.showMaximize,
|
|
1951
1978
|
"show-more": e.preferences.tabbar.showMore,
|
|
@@ -1954,17 +1981,17 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1954
1981
|
wheelable: e.preferences.tabbar.wheelable,
|
|
1955
1982
|
"middle-click-to-close": e.preferences.tabbar.middleClickToClose,
|
|
1956
1983
|
"style-type": e.preferences.tabbar.styleType,
|
|
1957
|
-
onChange:
|
|
1958
|
-
onCloseAll:
|
|
1959
|
-
onCloseLeft:
|
|
1960
|
-
onCloseOthers:
|
|
1961
|
-
onCloseRight:
|
|
1962
|
-
onMaximize:
|
|
1963
|
-
onNewWindow:
|
|
1964
|
-
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,
|
|
1965
1992
|
onRefresh: n[2] ||= (e) => a("tabRefresh", e),
|
|
1966
|
-
onRemove:
|
|
1967
|
-
onReorder:
|
|
1993
|
+
onRemove: ze,
|
|
1994
|
+
onReorder: Ge
|
|
1968
1995
|
}, null, 8, [
|
|
1969
1996
|
"active-path",
|
|
1970
1997
|
"tabs",
|
|
@@ -1977,8 +2004,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1977
2004
|
"middle-click-to-close",
|
|
1978
2005
|
"style-type"
|
|
1979
2006
|
])) : c("", !0),
|
|
1980
|
-
f(
|
|
1981
|
-
default:
|
|
2007
|
+
f(ge, null, {
|
|
2008
|
+
default: P(() => [C(t.$slots, "default", { tabs: H.value }, void 0, !0)]),
|
|
1982
2009
|
_: 3
|
|
1983
2010
|
})
|
|
1984
2011
|
]),
|
|
@@ -1990,7 +2017,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1990
2017
|
_: 3
|
|
1991
2018
|
}, 8, ["data-layout", "class"]));
|
|
1992
2019
|
}
|
|
1993
|
-
}), [["__scopeId", "data-v-
|
|
2020
|
+
}), [["__scopeId", "data-v-bac59663"]]), $t = {
|
|
1994
2021
|
key: 0,
|
|
1995
2022
|
class: "lumal-router-view__progress",
|
|
1996
2023
|
"aria-hidden": "true"
|
|
@@ -2019,57 +2046,74 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2019
2046
|
type: Boolean,
|
|
2020
2047
|
default: !1
|
|
2021
2048
|
},
|
|
2022
|
-
cacheMax: { default:
|
|
2049
|
+
cacheMax: { default: 20 },
|
|
2050
|
+
cacheKeys: {}
|
|
2023
2051
|
},
|
|
2024
2052
|
setup(e, { expose: t }) {
|
|
2025
|
-
let r = e, a = A("routerViewRef"), d =
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
if (
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
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();
|
|
2046
2089
|
}), t({ getRouterViewElement: () => a.value }), (t, r) => (b(), l("div", {
|
|
2047
2090
|
ref_key: "routerViewRef",
|
|
2048
2091
|
ref: a,
|
|
2049
2092
|
class: "lumal-router-view"
|
|
2050
2093
|
}, [
|
|
2051
|
-
|
|
2052
|
-
f(O(
|
|
2053
|
-
default:
|
|
2054
|
-
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, {
|
|
2055
2097
|
appear: "",
|
|
2056
2098
|
mode: "out-in",
|
|
2057
|
-
name:
|
|
2099
|
+
name: te.value,
|
|
2100
|
+
css: e.transition
|
|
2058
2101
|
}, {
|
|
2059
|
-
default:
|
|
2102
|
+
default: P(() => [e.cache ? (b(), s(n, {
|
|
2060
2103
|
key: 0,
|
|
2061
|
-
|
|
2062
|
-
|
|
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 }))]),
|
|
2063
2110
|
_: 2
|
|
2064
|
-
}, 1032, ["name"]))
|
|
2065
|
-
key: 1,
|
|
2066
|
-
max: h.value
|
|
2067
|
-
}, [(b(), s(T(t), { key: e.viewKey }))], 1032, ["max"])) : (b(), s(T(t), { key: e.viewKey }))]),
|
|
2111
|
+
}, 1032, ["name", "css"])]),
|
|
2068
2112
|
_: 1
|
|
2069
2113
|
}),
|
|
2070
|
-
|
|
2114
|
+
v.value ? (b(), l("div", en, [...r[1] ||= [u("span", { class: "lumal-router-view__loading-dot" }, null, -1)]])) : c("", !0)
|
|
2071
2115
|
], 512));
|
|
2072
2116
|
}
|
|
2073
|
-
}), [["__scopeId", "data-v-
|
|
2117
|
+
}), [["__scopeId", "data-v-f438a089"]]);
|
|
2074
2118
|
//#endregion
|
|
2075
|
-
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 };
|