@lumal/core 0.0.1-beta → 0.0.2-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/LICENSE +21 -21
- package/README.md +13 -13
- package/dist/components-CYwpPqgm.cjs +2 -0
- package/dist/components-DVnNb4-n.js +2254 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/{composables-C9EuCUjj.js → composables-DrGkFGvy.js} +39 -32
- package/dist/composables-edipbw70.cjs +1 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +18 -17
- package/dist/core.css +1 -1
- package/dist/{dictionary-ClEWtQCU.cjs → dictionary-BtPCmrLY.cjs} +1 -1
- package/dist/{dictionary-B7tsaVqB.js → dictionary-CKEqfCLG.js} +1 -1
- package/dist/dictionary.cjs +1 -1
- package/dist/dictionary.js +3 -3
- package/dist/index.cjs +1 -1
- package/dist/index.js +42 -42
- package/dist/layout-7345ntRV.cjs +1 -0
- package/dist/{layout-C8H9wuQa.js → layout-CuuRkGBF.js} +211 -201
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/request.cjs +1 -1
- package/dist/request.js +22 -19
- package/dist/router.cjs +1 -1
- package/dist/router.js +24 -21
- package/dist/src/app/createLumalAdmin.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/layout/LumalTabs.vue.d.ts.map +1 -1
- package/dist/src/request/client.d.ts.map +1 -1
- package/dist/src/router/index.d.ts.map +1 -1
- package/package.json +3 -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
|
@@ -1,40 +1,40 @@
|
|
|
1
1
|
import { t as e } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
2
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 re, watch as M, withCtx as N, withDirectives as ie, withModifiers as ae } from "vue";
|
|
3
3
|
import { LumalIcon as P } from "@lumal/icons-vue";
|
|
4
|
-
import { ElAside as F, ElButton as I, ElContainer as L, ElHeader as oe, ElMain as se, ElMenu as
|
|
5
|
-
import { RouterView as
|
|
6
|
-
import
|
|
4
|
+
import { ElAside as F, ElButton as I, ElContainer as L, ElHeader as oe, ElMain as se, ElMenu as R, ElMenuItem as z, ElScrollbar as ce, ElSubMenu as B } from "element-plus";
|
|
5
|
+
import { RouterView as V, routeLocationKey as le, routerKey as ue } from "vue-router";
|
|
6
|
+
import de from "sortablejs";
|
|
7
7
|
//#region src/layout/state/menu-layout.ts
|
|
8
|
-
function V(e, t) {
|
|
9
|
-
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => V(e, t)) ?? !1;
|
|
10
|
-
}
|
|
11
8
|
function H(e, t) {
|
|
9
|
+
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => H(e, t)) ?? !1;
|
|
10
|
+
}
|
|
11
|
+
function U(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 = U(n.children ?? [], t);
|
|
16
16
|
if (e) return e;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function W(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 = W(n.children ?? [], t);
|
|
24
24
|
if (e.length > 0) return [n, ...e];
|
|
25
25
|
}
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function fe(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 : fe(t[0]);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
35
|
-
return e.find((e) =>
|
|
34
|
+
function pe(e, t) {
|
|
35
|
+
return e.find((e) => H(e, t))?.path ?? "";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function G(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) => H(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 K = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "lumal-breadcrumb",
|
|
55
55
|
"aria-label": "面包屑"
|
|
56
|
-
},
|
|
56
|
+
}, me = { class: "lumal-breadcrumb__list" }, q = {
|
|
57
57
|
key: 1,
|
|
58
58
|
class: "lumal-breadcrumb__current",
|
|
59
59
|
"aria-current": "page"
|
|
60
|
-
},
|
|
60
|
+
}, he = ["onClick"], ge = /*#__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(le, 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 = W(r.menus, r.activePath), t = (e.length > 0 ? e : W(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 ? W(r.menus, r.homePath).at(-1) : void 0, t = r.menus.find((e) => !e.hidden), n = r.homePath || fe(t);
|
|
112
112
|
if (n) return {
|
|
113
113
|
icon: e?.icon ?? t?.icon,
|
|
114
114
|
path: n,
|
|
@@ -118,7 +118,7 @@ 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", K, [u("ol", me, [(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
124
|
}, [n > 0 ? (b(), s(O(P), {
|
|
@@ -126,7 +126,7 @@ var W = {
|
|
|
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", q, [e.showIcon && t.icon ? (b(), s(O(P), {
|
|
130
130
|
key: 0,
|
|
131
131
|
name: t.icon,
|
|
132
132
|
size: 15
|
|
@@ -139,9 +139,9 @@ var W = {
|
|
|
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, he))]))), 128))])])) : c("", !0);
|
|
143
143
|
}
|
|
144
|
-
}), [["__scopeId", "data-v-53a036d9"]]),
|
|
144
|
+
}), [["__scopeId", "data-v-53a036d9"]]), _e = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
145
145
|
__name: "LumalContent",
|
|
146
146
|
setup(e, { expose: t }) {
|
|
147
147
|
let n = A("contentRef");
|
|
@@ -157,11 +157,11 @@ var W = {
|
|
|
157
157
|
_: 3
|
|
158
158
|
}, 512));
|
|
159
159
|
}
|
|
160
|
-
}), [["__scopeId", "data-v-
|
|
160
|
+
}), [["__scopeId", "data-v-a0d6361c"]]), ve = { class: "lumal-global-search" }, ye = { key: 0 }, J = ["aria-labelledby"], be = { class: "lumal-global-search__header" }, xe = ["id"], Se = { class: "lumal-global-search__input-wrap" }, Y = [
|
|
161
161
|
"aria-activedescendant",
|
|
162
162
|
"aria-controls",
|
|
163
163
|
"placeholder"
|
|
164
|
-
],
|
|
164
|
+
], X = ["id"], Z = ["id", "aria-selected"], Ce = ["onMouseenter", "onClick"], we = {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: "lumal-global-search__empty",
|
|
167
167
|
role: "status"
|
|
@@ -229,7 +229,7 @@ var W = {
|
|
|
229
229
|
}), n({
|
|
230
230
|
close: N,
|
|
231
231
|
open: re
|
|
232
|
-
}), (n, i) => (b(), l("div",
|
|
232
|
+
}), (n, i) => (b(), l("div", ve, [u("button", {
|
|
233
233
|
ref_key: "triggerRef",
|
|
234
234
|
ref: h,
|
|
235
235
|
class: "lumal-global-search__trigger",
|
|
@@ -243,7 +243,7 @@ var W = {
|
|
|
243
243
|
size: 17
|
|
244
244
|
}),
|
|
245
245
|
i[3] ||= u("span", { class: "lumal-global-search__trigger-label" }, "搜索", -1),
|
|
246
|
-
e.shortcut ? (b(), l("kbd",
|
|
246
|
+
e.shortcut ? (b(), l("kbd", ye, "Ctrl K")) : c("", !0)
|
|
247
247
|
], 512), (b(), s(r, { to: "body" }, [g.value ? (b(), l("div", {
|
|
248
248
|
key: 0,
|
|
249
249
|
class: "lumal-global-search__backdrop",
|
|
@@ -254,7 +254,7 @@ var W = {
|
|
|
254
254
|
"aria-modal": "true",
|
|
255
255
|
"aria-labelledby": `${p}-title`
|
|
256
256
|
}, [
|
|
257
|
-
u("header", be, [u("h2", { id: `${p}-title` }, " 全局搜索 ", 8,
|
|
257
|
+
u("header", be, [u("h2", { id: `${p}-title` }, " 全局搜索 ", 8, xe), u("button", {
|
|
258
258
|
type: "button",
|
|
259
259
|
"aria-label": "关闭全局搜索",
|
|
260
260
|
title: "关闭",
|
|
@@ -263,7 +263,7 @@ var W = {
|
|
|
263
263
|
name: "lumal:close",
|
|
264
264
|
size: 17
|
|
265
265
|
})])]),
|
|
266
|
-
u("label",
|
|
266
|
+
u("label", Se, [
|
|
267
267
|
i[4] ||= u("span", { class: "lumal-global-search__sr-only" }, "搜索菜单", -1),
|
|
268
268
|
f(O(P), {
|
|
269
269
|
icon: Te,
|
|
@@ -281,7 +281,7 @@ var W = {
|
|
|
281
281
|
"aria-expanded": "true",
|
|
282
282
|
placeholder: e.placeholder,
|
|
283
283
|
onKeydown: I
|
|
284
|
-
}, null, 40,
|
|
284
|
+
}, null, 40, Y), [[j, y.value]])
|
|
285
285
|
]),
|
|
286
286
|
u("ul", {
|
|
287
287
|
id: `${p}-results`,
|
|
@@ -305,7 +305,7 @@ var W = {
|
|
|
305
305
|
}, null, 8, ["name"])) : c("", !0),
|
|
306
306
|
u("span", null, [u("strong", null, D(e.item.title), 1), u("small", null, D(e.trail.join(" / ")), 1)]),
|
|
307
307
|
u("code", null, D(e.item.path), 1)
|
|
308
|
-
], 42, Ce)], 8,
|
|
308
|
+
], 42, Ce)], 8, Z))), 128))], 8, X),
|
|
309
309
|
E.value.length === 0 ? (b(), l("p", we, " 未找到匹配菜单,请尝试其他关键词 ")) : c("", !0)
|
|
310
310
|
], 8, J)], 32)) : c("", !0)]))]));
|
|
311
311
|
}
|
|
@@ -505,7 +505,7 @@ var W = {
|
|
|
505
505
|
class: "lumal-sidebar-menu-item__external",
|
|
506
506
|
"aria-hidden": "true"
|
|
507
507
|
}, "↗", -1)
|
|
508
|
-
], 8, Re)) : (b(), s(O(
|
|
508
|
+
], 8, Re)) : (b(), s(O(z), {
|
|
509
509
|
key: 2,
|
|
510
510
|
class: "lumal-sidebar-menu-item",
|
|
511
511
|
index: e.item.path,
|
|
@@ -563,8 +563,8 @@ var W = {
|
|
|
563
563
|
width: u.value,
|
|
564
564
|
"aria-label": e.ariaLabel
|
|
565
565
|
}, {
|
|
566
|
-
default: N(() => [f(O(
|
|
567
|
-
default: N(() => [f(O(
|
|
566
|
+
default: N(() => [f(O(ce), { class: "lumal-sidebar__scrollbar" }, {
|
|
567
|
+
default: N(() => [f(O(R), {
|
|
568
568
|
class: "lumal-sidebar__menu",
|
|
569
569
|
collapse: e.collapsed,
|
|
570
570
|
"default-active": e.activePath
|
|
@@ -588,7 +588,7 @@ var W = {
|
|
|
588
588
|
_: 1
|
|
589
589
|
}, 8, ["width", "aria-label"]));
|
|
590
590
|
}
|
|
591
|
-
}), [["__scopeId", "data-v-
|
|
591
|
+
}), [["__scopeId", "data-v-d9c4d4bc"]]), Je = ["disabled"], Ye = ["onContextmenu"], Xe = [
|
|
592
592
|
"aria-selected",
|
|
593
593
|
"tabindex",
|
|
594
594
|
"onClick",
|
|
@@ -663,51 +663,61 @@ var W = {
|
|
|
663
663
|
path: "",
|
|
664
664
|
style: {},
|
|
665
665
|
visible: !1
|
|
666
|
-
}), C = E(!1), w = E(!1), T = E(!0), k = E(!1), j, F, I = null, L = o(() => g.value.visible ? g.value : x.value), oe = o(() => L.value.path), se =
|
|
667
|
-
function z(
|
|
666
|
+
}), C = E(!1), w = E(!1), T = E(!0), k = E(!1), j, F, I = null, L = o(() => g.value.visible ? g.value : x.value), oe = o(() => L.value.path), se = E(!0), R;
|
|
667
|
+
function z() {
|
|
668
|
+
se.value = !R || !R.matches;
|
|
669
|
+
}
|
|
670
|
+
function ce() {
|
|
671
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (R = window.matchMedia("(max-width: 768px)"), z(), typeof R.addEventListener == "function" ? R.addEventListener("change", z) : R.addListener?.(z));
|
|
672
|
+
}
|
|
673
|
+
function B() {
|
|
674
|
+
typeof R?.removeEventListener == "function" ? R.removeEventListener("change", z) : R?.removeListener?.(z), R = void 0;
|
|
675
|
+
}
|
|
676
|
+
let V = o(() => d.draggable && se.value), le = o(() => d.tabs.some((e) => e.closable !== !1 && e.pinned !== !0));
|
|
677
|
+
function ue(e) {
|
|
668
678
|
return d.tabs.length > 1 && d.tabs.some((t) => t.path === e && t.closable !== !1 && t.pinned !== !0);
|
|
669
679
|
}
|
|
670
|
-
function
|
|
680
|
+
function H(e, t) {
|
|
671
681
|
let n = d.tabs.findIndex((t) => t.path === e);
|
|
672
682
|
return (t === "left" ? d.tabs.slice(0, n) : d.tabs.slice(n + 1)).some((e) => e.closable !== !1 && e.pinned !== !0);
|
|
673
683
|
}
|
|
674
|
-
function
|
|
684
|
+
function U(e) {
|
|
675
685
|
return d.tabs.some((t) => t.path !== e && t.closable !== !1 && t.pinned !== !0);
|
|
676
686
|
}
|
|
677
|
-
function
|
|
687
|
+
function W(e) {
|
|
678
688
|
return e === m.value;
|
|
679
689
|
}
|
|
680
|
-
function
|
|
690
|
+
function fe(e) {
|
|
681
691
|
let t = d.tabs.find((t) => t.path === e);
|
|
682
692
|
return !!t && t.pinned !== !0 && t.closable !== !1;
|
|
683
693
|
}
|
|
684
|
-
function
|
|
694
|
+
function pe(e) {
|
|
685
695
|
let t = d.tabs.find((t) => t.path === e);
|
|
686
696
|
return !!t && t.pinned === !0 && t.closable !== !1;
|
|
687
697
|
}
|
|
688
|
-
function
|
|
698
|
+
function G(e) {
|
|
689
699
|
let t = oe.value;
|
|
690
|
-
return e === "close" ? !
|
|
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;
|
|
691
701
|
}
|
|
692
|
-
function
|
|
693
|
-
return
|
|
702
|
+
function K(e) {
|
|
703
|
+
return pe(e) ? "取消固定" : "固定";
|
|
694
704
|
}
|
|
695
|
-
function
|
|
705
|
+
function me() {
|
|
696
706
|
return C.value ? "还原" : "内容最大化";
|
|
697
707
|
}
|
|
698
|
-
function
|
|
708
|
+
function q(e) {
|
|
699
709
|
e !== m.value && (m.value = e, p("change", e));
|
|
700
710
|
}
|
|
701
711
|
function he(e) {
|
|
702
|
-
|
|
712
|
+
ue(e) && p("remove", e);
|
|
703
713
|
}
|
|
704
|
-
function
|
|
705
|
-
e &&
|
|
714
|
+
function ge(e) {
|
|
715
|
+
e && W(e) && p("refresh", e);
|
|
706
716
|
}
|
|
707
|
-
function
|
|
708
|
-
e.button !== 1 || !d.middleClickToClose || !
|
|
717
|
+
function _e(e, t) {
|
|
718
|
+
e.button !== 1 || !d.middleClickToClose || !ue(t.path) || (e.preventDefault(), p("remove", t.path));
|
|
709
719
|
}
|
|
710
|
-
function
|
|
720
|
+
function ve(e, t) {
|
|
711
721
|
if (![
|
|
712
722
|
"ArrowLeft",
|
|
713
723
|
"ArrowRight",
|
|
@@ -716,17 +726,17 @@ var W = {
|
|
|
716
726
|
].includes(e.key) || d.tabs.length === 0) return;
|
|
717
727
|
e.preventDefault();
|
|
718
728
|
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 && (
|
|
729
|
+
r && (q(r.path), _(() => {
|
|
720
730
|
h.value?.querySelectorAll("[role=\"tab\"]").item(n).focus();
|
|
721
731
|
}));
|
|
722
732
|
}
|
|
723
|
-
function
|
|
733
|
+
function ye(e, t) {
|
|
724
734
|
return {
|
|
725
735
|
left: `${Math.max(8, Math.min(e, window.innerWidth - ft - 8))}px`,
|
|
726
736
|
top: `${Math.max(8, Math.min(t, window.innerHeight - pt - 8))}px`
|
|
727
737
|
};
|
|
728
738
|
}
|
|
729
|
-
function
|
|
739
|
+
function J() {
|
|
730
740
|
g.value = {
|
|
731
741
|
...g.value,
|
|
732
742
|
visible: !1
|
|
@@ -735,39 +745,39 @@ var W = {
|
|
|
735
745
|
visible: !1
|
|
736
746
|
};
|
|
737
747
|
}
|
|
738
|
-
function
|
|
748
|
+
function be(e, t) {
|
|
739
749
|
e.preventDefault(), e.stopPropagation(), I = e.currentTarget, g.value = {
|
|
740
750
|
path: t,
|
|
741
|
-
style:
|
|
751
|
+
style: ye(e.clientX, e.clientY),
|
|
742
752
|
visible: !0
|
|
743
753
|
}, x.value = {
|
|
744
754
|
...x.value,
|
|
745
755
|
visible: !1
|
|
746
756
|
};
|
|
747
757
|
}
|
|
748
|
-
function
|
|
758
|
+
function xe(e) {
|
|
749
759
|
e.preventDefault(), e.stopPropagation();
|
|
750
760
|
let t = m.value || d.tabs[0]?.path || "";
|
|
751
761
|
I = e.currentTarget, x.value = {
|
|
752
762
|
path: t,
|
|
753
|
-
style:
|
|
763
|
+
style: ye(e.clientX, e.clientY),
|
|
754
764
|
visible: !0
|
|
755
765
|
}, g.value = {
|
|
756
766
|
...g.value,
|
|
757
767
|
visible: !1
|
|
758
768
|
};
|
|
759
769
|
}
|
|
760
|
-
function
|
|
770
|
+
function Se() {
|
|
761
771
|
I && document.body.contains(I) && (I.focus(), I = null);
|
|
762
772
|
}
|
|
763
|
-
function
|
|
764
|
-
if (
|
|
773
|
+
function Y(e) {
|
|
774
|
+
if (G(e)) return;
|
|
765
775
|
let t = oe.value;
|
|
766
|
-
|
|
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);
|
|
767
777
|
}
|
|
768
|
-
function
|
|
778
|
+
function X(e) {
|
|
769
779
|
if (e.key === "Escape") {
|
|
770
|
-
e.preventDefault(),
|
|
780
|
+
e.preventDefault(), J(), _(Se);
|
|
771
781
|
return;
|
|
772
782
|
}
|
|
773
783
|
let t = Array.from(document.querySelectorAll("[data-menu-active=\"true\"] [role=\"menuitem\"]:not(:disabled)"));
|
|
@@ -777,39 +787,39 @@ var W = {
|
|
|
777
787
|
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
788
|
}
|
|
779
789
|
}
|
|
780
|
-
function
|
|
790
|
+
function Z() {
|
|
781
791
|
let e = h.value;
|
|
782
792
|
e && (w.value = e.scrollWidth > e.clientWidth + 1, T.value = e.scrollLeft <= 1, k.value = e.scrollLeft + e.clientWidth >= e.scrollWidth - 1);
|
|
783
793
|
}
|
|
784
|
-
function
|
|
794
|
+
function Ce() {
|
|
785
795
|
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
786
796
|
}
|
|
787
|
-
function
|
|
797
|
+
function we(e) {
|
|
788
798
|
let t = h.value;
|
|
789
799
|
t && t.scrollBy({
|
|
790
|
-
behavior:
|
|
800
|
+
behavior: Ce(),
|
|
791
801
|
left: (e === "left" ? -1 : 1) * Math.max(160, t.clientWidth - 120)
|
|
792
802
|
});
|
|
793
803
|
}
|
|
794
|
-
function
|
|
804
|
+
function Te(e) {
|
|
795
805
|
if (!d.wheelable) return;
|
|
796
806
|
let t = h.value;
|
|
797
807
|
!t || !w.value || (e.preventDefault(), t.scrollBy({ left: Math.abs(e.deltaY) > Math.abs(e.deltaX) ? e.deltaY : e.deltaX }));
|
|
798
808
|
}
|
|
799
|
-
async function
|
|
809
|
+
async function Ee() {
|
|
800
810
|
await _(), (h.value?.querySelector("[role=\"tab\"][aria-selected=\"true\"]"))?.scrollIntoView({
|
|
801
|
-
behavior:
|
|
811
|
+
behavior: Ce(),
|
|
802
812
|
block: "nearest",
|
|
803
813
|
inline: "nearest"
|
|
804
|
-
}),
|
|
814
|
+
}), Z();
|
|
805
815
|
}
|
|
806
|
-
function
|
|
816
|
+
function De() {
|
|
807
817
|
let e = h.value?.querySelector(".lumal-tabs__list");
|
|
808
|
-
if (!e || !
|
|
809
|
-
|
|
818
|
+
if (!e || !V.value) {
|
|
819
|
+
Oe();
|
|
810
820
|
return;
|
|
811
821
|
}
|
|
812
|
-
F && F.el === e || (
|
|
822
|
+
F && F.el === e || (Oe(), F = de.create(e, {
|
|
813
823
|
animation: 160,
|
|
814
824
|
draggable: ".lumal-tabs__item",
|
|
815
825
|
filter: ".is-not-draggable",
|
|
@@ -822,47 +832,47 @@ var W = {
|
|
|
822
832
|
}
|
|
823
833
|
}));
|
|
824
834
|
}
|
|
825
|
-
function
|
|
835
|
+
function Oe() {
|
|
826
836
|
F?.destroy(), F = void 0;
|
|
827
837
|
}
|
|
828
|
-
M(
|
|
829
|
-
e ? _(
|
|
838
|
+
M(V, (e) => {
|
|
839
|
+
e ? _(De) : Oe();
|
|
830
840
|
});
|
|
831
|
-
function
|
|
841
|
+
function ke() {
|
|
832
842
|
if (d.standaloneMaximize) {
|
|
833
|
-
|
|
843
|
+
Q();
|
|
834
844
|
return;
|
|
835
845
|
}
|
|
836
846
|
C.value = !C.value, p("maximize", C.value);
|
|
837
847
|
}
|
|
838
|
-
async function
|
|
848
|
+
async function Q() {
|
|
839
849
|
let e = document.querySelector(d.fullscreenTarget);
|
|
840
850
|
e instanceof HTMLElement && (document.fullscreenElement ? await document.exitFullscreen?.() : await e.requestFullscreen?.());
|
|
841
851
|
}
|
|
842
|
-
function
|
|
852
|
+
function Ae() {
|
|
843
853
|
C.value = !!document.fullscreenElement && d.standaloneMaximize, d.standaloneMaximize && p("maximize", C.value);
|
|
844
854
|
}
|
|
845
|
-
function
|
|
855
|
+
function je(e) {
|
|
846
856
|
d.standaloneMaximize || (C.value = e);
|
|
847
857
|
}
|
|
848
858
|
n({
|
|
849
859
|
getTabsElement: () => h.value,
|
|
850
|
-
refreshCurrent: () =>
|
|
851
|
-
scrollTabs:
|
|
852
|
-
toggleFullscreen:
|
|
853
|
-
setMaximized:
|
|
854
|
-
}), M(() => [d.activePath, d.tabs.length], () => void
|
|
855
|
-
function
|
|
860
|
+
refreshCurrent: () => ge(m.value),
|
|
861
|
+
scrollTabs: we,
|
|
862
|
+
toggleFullscreen: ke,
|
|
863
|
+
setMaximized: je
|
|
864
|
+
}), M(() => [d.activePath, d.tabs.length], () => void Ee(), { flush: "post" }), M(() => d.tabs, () => void _(Z), { flush: "post" });
|
|
865
|
+
function Me(e) {
|
|
856
866
|
let t = e.target;
|
|
857
|
-
t && (t.closest?.(".lumal-tabs-context-menu") || t.closest?.("[data-tab-menu-trigger]") ||
|
|
867
|
+
t && (t.closest?.(".lumal-tabs-context-menu") || t.closest?.("[data-tab-menu-trigger]") || J());
|
|
858
868
|
}
|
|
859
|
-
function
|
|
860
|
-
e.key === "Escape" && L.value.visible && (e.preventDefault(),
|
|
869
|
+
function Ne(e) {
|
|
870
|
+
e.key === "Escape" && L.value.visible && (e.preventDefault(), J(), _(Se));
|
|
861
871
|
}
|
|
862
872
|
return te(() => {
|
|
863
|
-
document.addEventListener("click",
|
|
873
|
+
ce(), document.addEventListener("click", Me), document.addEventListener("fullscreenchange", Ae), document.addEventListener("keydown", Ne), Z(), typeof ResizeObserver < "u" && h.value && (j = new ResizeObserver(Z), j.observe(h.value)), V.value && _(De);
|
|
864
874
|
}), ee(() => {
|
|
865
|
-
document.removeEventListener("click",
|
|
875
|
+
B(), document.removeEventListener("click", Me), document.removeEventListener("fullscreenchange", Ae), document.removeEventListener("keydown", Ne), j?.disconnect(), Oe();
|
|
866
876
|
}), (n, i) => e.visible && e.tabs.length ? (b(), l("div", {
|
|
867
877
|
key: 0,
|
|
868
878
|
class: v(["lumal-tabs", [`is-style-${e.styleType}`]])
|
|
@@ -872,7 +882,7 @@ var W = {
|
|
|
872
882
|
type: "button",
|
|
873
883
|
"aria-label": "向左滚动标签",
|
|
874
884
|
disabled: T.value,
|
|
875
|
-
onClick: i[0] ||= (e) =>
|
|
885
|
+
onClick: i[0] ||= (e) => we("left")
|
|
876
886
|
}, [f(O(P), {
|
|
877
887
|
name: "lumal:chevron-left",
|
|
878
888
|
size: 16
|
|
@@ -881,8 +891,8 @@ var W = {
|
|
|
881
891
|
ref_key: "tabsViewportRef",
|
|
882
892
|
ref: h,
|
|
883
893
|
class: "lumal-tabs__viewport",
|
|
884
|
-
onScroll:
|
|
885
|
-
onWheel:
|
|
894
|
+
onScroll: Z,
|
|
895
|
+
onWheel: Te
|
|
886
896
|
}, [f(a, {
|
|
887
897
|
name: "lumal-tab",
|
|
888
898
|
tag: "div",
|
|
@@ -895,18 +905,18 @@ var W = {
|
|
|
895
905
|
class: v(["lumal-tabs__item", {
|
|
896
906
|
"is-active": t.path === m.value,
|
|
897
907
|
"is-pinned": t.pinned === !0,
|
|
898
|
-
"is-not-draggable": t.pinned === !0 || !
|
|
908
|
+
"is-not-draggable": t.pinned === !0 || !V.value
|
|
899
909
|
}]),
|
|
900
|
-
onContextmenu: (e) =>
|
|
910
|
+
onContextmenu: (e) => be(e, t.path)
|
|
901
911
|
}, [u("button", {
|
|
902
912
|
class: "lumal-tabs__tab",
|
|
903
913
|
type: "button",
|
|
904
914
|
role: "tab",
|
|
905
915
|
"aria-selected": t.path === m.value,
|
|
906
916
|
tabindex: t.path === m.value ? 0 : -1,
|
|
907
|
-
onClick: (e) =>
|
|
908
|
-
onKeydown: (e) =>
|
|
909
|
-
onMousedown: (e) =>
|
|
917
|
+
onClick: (e) => q(t.path),
|
|
918
|
+
onKeydown: (e) => ve(e, n),
|
|
919
|
+
onMousedown: (e) => _e(e, t)
|
|
910
920
|
}, [t.pinned === !0 ? (b(), s(O(P), {
|
|
911
921
|
key: 0,
|
|
912
922
|
class: "lumal-tabs__pin",
|
|
@@ -919,7 +929,7 @@ var W = {
|
|
|
919
929
|
}, null, 8, ["name"])) : c("", !0), u("span", {
|
|
920
930
|
class: "lumal-tabs__label",
|
|
921
931
|
title: t.title
|
|
922
|
-
}, D(t.title), 9, Ze)], 40, Xe),
|
|
932
|
+
}, D(t.title), 9, Ze)], 40, Xe), ue(t.path) ? (b(), l("button", {
|
|
923
933
|
key: 0,
|
|
924
934
|
class: "lumal-tabs__close",
|
|
925
935
|
type: "button",
|
|
@@ -936,7 +946,7 @@ var W = {
|
|
|
936
946
|
type: "button",
|
|
937
947
|
"aria-label": "向右滚动标签",
|
|
938
948
|
disabled: k.value,
|
|
939
|
-
onClick: i[1] ||= (e) =>
|
|
949
|
+
onClick: i[1] ||= (e) => we("right")
|
|
940
950
|
}, [f(O(P), {
|
|
941
951
|
name: "lumal:chevron-right",
|
|
942
952
|
size: 16
|
|
@@ -948,7 +958,7 @@ var W = {
|
|
|
948
958
|
"aria-label": "刷新当前页面",
|
|
949
959
|
"data-action": "refresh-current-tab",
|
|
950
960
|
disabled: !m.value,
|
|
951
|
-
onClick: i[2] ||= (e) =>
|
|
961
|
+
onClick: i[2] ||= (e) => ge(m.value)
|
|
952
962
|
}, [f(O(P), {
|
|
953
963
|
name: "lumal:refresh",
|
|
954
964
|
size: 16
|
|
@@ -961,7 +971,7 @@ var W = {
|
|
|
961
971
|
"aria-haspopup": "menu",
|
|
962
972
|
"aria-expanded": x.value.visible,
|
|
963
973
|
"data-tab-menu-trigger": "",
|
|
964
|
-
onClick: i[3] ||= (e) =>
|
|
974
|
+
onClick: i[3] ||= (e) => xe(e)
|
|
965
975
|
}, [f(O(P), {
|
|
966
976
|
name: "lumal:more",
|
|
967
977
|
size: 16
|
|
@@ -972,7 +982,7 @@ var W = {
|
|
|
972
982
|
type: "button",
|
|
973
983
|
"aria-label": C.value ? "退出内容最大化" : "内容最大化",
|
|
974
984
|
"data-action": "maximize-content",
|
|
975
|
-
onClick:
|
|
985
|
+
onClick: ke
|
|
976
986
|
}, [f(O(P), {
|
|
977
987
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
978
988
|
size: 16
|
|
@@ -984,13 +994,13 @@ var W = {
|
|
|
984
994
|
"data-menu-active": !0,
|
|
985
995
|
style: y(L.value.style),
|
|
986
996
|
onClick: i[13] ||= ae(() => {}, ["stop"]),
|
|
987
|
-
onKeydown:
|
|
997
|
+
onKeydown: X
|
|
988
998
|
}, [
|
|
989
999
|
u("button", {
|
|
990
1000
|
type: "button",
|
|
991
1001
|
role: "menuitem",
|
|
992
|
-
disabled:
|
|
993
|
-
onClick: i[4] ||= (e) =>
|
|
1002
|
+
disabled: G("refresh"),
|
|
1003
|
+
onClick: i[4] ||= (e) => Y("refresh")
|
|
994
1004
|
}, [f(O(P), {
|
|
995
1005
|
name: "lumal:refresh",
|
|
996
1006
|
size: 14
|
|
@@ -998,26 +1008,26 @@ var W = {
|
|
|
998
1008
|
u("button", {
|
|
999
1009
|
type: "button",
|
|
1000
1010
|
role: "menuitem",
|
|
1001
|
-
disabled:
|
|
1002
|
-
onClick: i[5] ||= (e) =>
|
|
1011
|
+
disabled: G("pin"),
|
|
1012
|
+
onClick: i[5] ||= (e) => Y("pin")
|
|
1003
1013
|
}, [f(O(P), {
|
|
1004
|
-
name:
|
|
1014
|
+
name: pe(oe.value) ? "lumal:pin-off" : "lumal:pin",
|
|
1005
1015
|
size: 14
|
|
1006
|
-
}, null, 8, ["name"]), u("span", null, D(
|
|
1016
|
+
}, null, 8, ["name"]), u("span", null, D(K(oe.value)), 1)], 8, it),
|
|
1007
1017
|
u("button", {
|
|
1008
1018
|
type: "button",
|
|
1009
1019
|
role: "menuitem",
|
|
1010
|
-
disabled:
|
|
1011
|
-
onClick: i[6] ||= (e) =>
|
|
1020
|
+
disabled: G("maximize"),
|
|
1021
|
+
onClick: i[6] ||= (e) => Y("maximize")
|
|
1012
1022
|
}, [f(O(P), {
|
|
1013
1023
|
name: C.value ? "lumal:restore" : "lumal:maximize",
|
|
1014
1024
|
size: 14
|
|
1015
|
-
}, null, 8, ["name"]), u("span", null, D(
|
|
1025
|
+
}, null, 8, ["name"]), u("span", null, D(me()), 1)], 8, at),
|
|
1016
1026
|
u("button", {
|
|
1017
1027
|
type: "button",
|
|
1018
1028
|
role: "menuitem",
|
|
1019
|
-
disabled:
|
|
1020
|
-
onClick: i[7] ||= (e) =>
|
|
1029
|
+
disabled: G("new-window"),
|
|
1030
|
+
onClick: i[7] ||= (e) => Y("new-window")
|
|
1021
1031
|
}, [f(O(P), {
|
|
1022
1032
|
name: "lumal:external-link",
|
|
1023
1033
|
size: 14
|
|
@@ -1026,8 +1036,8 @@ var W = {
|
|
|
1026
1036
|
u("button", {
|
|
1027
1037
|
type: "button",
|
|
1028
1038
|
role: "menuitem",
|
|
1029
|
-
disabled:
|
|
1030
|
-
onClick: i[8] ||= (e) =>
|
|
1039
|
+
disabled: G("close"),
|
|
1040
|
+
onClick: i[8] ||= (e) => Y("close")
|
|
1031
1041
|
}, [f(O(P), {
|
|
1032
1042
|
name: "lumal:close",
|
|
1033
1043
|
size: 14
|
|
@@ -1035,8 +1045,8 @@ var W = {
|
|
|
1035
1045
|
u("button", {
|
|
1036
1046
|
type: "button",
|
|
1037
1047
|
role: "menuitem",
|
|
1038
|
-
disabled:
|
|
1039
|
-
onClick: i[9] ||= (e) =>
|
|
1048
|
+
disabled: G("close-left"),
|
|
1049
|
+
onClick: i[9] ||= (e) => Y("close-left")
|
|
1040
1050
|
}, [f(O(P), {
|
|
1041
1051
|
name: "lumal:chevron-left",
|
|
1042
1052
|
size: 14
|
|
@@ -1044,8 +1054,8 @@ var W = {
|
|
|
1044
1054
|
u("button", {
|
|
1045
1055
|
type: "button",
|
|
1046
1056
|
role: "menuitem",
|
|
1047
|
-
disabled:
|
|
1048
|
-
onClick: i[10] ||= (e) =>
|
|
1057
|
+
disabled: G("close-right"),
|
|
1058
|
+
onClick: i[10] ||= (e) => Y("close-right")
|
|
1049
1059
|
}, [f(O(P), {
|
|
1050
1060
|
name: "lumal:chevron-right",
|
|
1051
1061
|
size: 14
|
|
@@ -1053,8 +1063,8 @@ var W = {
|
|
|
1053
1063
|
u("button", {
|
|
1054
1064
|
type: "button",
|
|
1055
1065
|
role: "menuitem",
|
|
1056
|
-
disabled:
|
|
1057
|
-
onClick: i[11] ||= (e) =>
|
|
1066
|
+
disabled: G("close-others"),
|
|
1067
|
+
onClick: i[11] ||= (e) => Y("close-others")
|
|
1058
1068
|
}, [f(O(P), {
|
|
1059
1069
|
name: "lumal:close",
|
|
1060
1070
|
size: 14
|
|
@@ -1062,8 +1072,8 @@ var W = {
|
|
|
1062
1072
|
u("button", {
|
|
1063
1073
|
type: "button",
|
|
1064
1074
|
role: "menuitem",
|
|
1065
|
-
disabled:
|
|
1066
|
-
onClick: i[12] ||= (e) =>
|
|
1075
|
+
disabled: G("close-all"),
|
|
1076
|
+
onClick: i[12] ||= (e) => Y("close-all")
|
|
1067
1077
|
}, [f(O(P), {
|
|
1068
1078
|
name: "lumal:close",
|
|
1069
1079
|
size: 14
|
|
@@ -1071,7 +1081,7 @@ var W = {
|
|
|
1071
1081
|
], 36)) : c("", !0)]))
|
|
1072
1082
|
], 2)) : c("", !0);
|
|
1073
1083
|
}
|
|
1074
|
-
}), [["__scopeId", "data-v-
|
|
1084
|
+
}), [["__scopeId", "data-v-5ebf2b13"]]), ht = { class: "lumal-top-nav-menu-item__label" }, gt = {
|
|
1075
1085
|
key: 1,
|
|
1076
1086
|
class: "lumal-top-nav-menu-item__external",
|
|
1077
1087
|
"aria-hidden": "true"
|
|
@@ -1087,7 +1097,7 @@ var W = {
|
|
|
1087
1097
|
},
|
|
1088
1098
|
emits: ["select"],
|
|
1089
1099
|
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 &&
|
|
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 && H(r.item, r.activePath));
|
|
1091
1101
|
function m(e) {
|
|
1092
1102
|
i("select", e);
|
|
1093
1103
|
}
|
|
@@ -1151,7 +1161,7 @@ var W = {
|
|
|
1151
1161
|
class: "lumal-top-nav-menu-item__external",
|
|
1152
1162
|
"aria-hidden": "true"
|
|
1153
1163
|
}, "↗", -1)
|
|
1154
|
-
], 2)) : (b(), s(O(
|
|
1164
|
+
], 2)) : (b(), s(O(z), {
|
|
1155
1165
|
key: 2,
|
|
1156
1166
|
index: e.item.path,
|
|
1157
1167
|
class: v({ "is-active": p.value }),
|
|
@@ -1200,7 +1210,7 @@ var W = {
|
|
|
1200
1210
|
return !!e.externalLink && e.externalTarget !== "_self";
|
|
1201
1211
|
}
|
|
1202
1212
|
function h(e) {
|
|
1203
|
-
return i.activePath ? i.mode === "flat" ? e.path === i.activePath :
|
|
1213
|
+
return i.activePath ? i.mode === "flat" ? e.path === i.activePath : H(e, i.activePath) : !1;
|
|
1204
1214
|
}
|
|
1205
1215
|
function _(e) {
|
|
1206
1216
|
let t = h(e);
|
|
@@ -1224,7 +1234,7 @@ var W = {
|
|
|
1224
1234
|
return n({
|
|
1225
1235
|
getMenuElement: () => d.value?.$el,
|
|
1226
1236
|
getMenuInstance: () => d.value
|
|
1227
|
-
}), (n, r) => (b(), s(O(
|
|
1237
|
+
}), (n, r) => (b(), s(O(R), {
|
|
1228
1238
|
key: `top-nav:${e.mode}:${e.activePath}`,
|
|
1229
1239
|
ref_key: "menuRef",
|
|
1230
1240
|
ref: d,
|
|
@@ -1239,7 +1249,7 @@ var W = {
|
|
|
1239
1249
|
item: t,
|
|
1240
1250
|
"active-path": e.activePath,
|
|
1241
1251
|
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(
|
|
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(z)), g({ key: `flat:${e.path}` }, { ref_for: !0 }, _(e), { onClick: (t) => te(e.path) }), {
|
|
1243
1253
|
default: N(() => [
|
|
1244
1254
|
e.icon ? (b(), s(O(P), {
|
|
1245
1255
|
key: 0,
|
|
@@ -1522,7 +1532,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1522
1532
|
"tabNewWindow"
|
|
1523
1533
|
], ["update:activeTabPath"]),
|
|
1524
1534
|
setup(e, { expose: t, emit: n }) {
|
|
1525
|
-
let r = e, a = n, u = ne(e, "activeTabPath"), p = m(
|
|
1535
|
+
let r = e, a = n, u = ne(e, "activeTabPath"), p = m(le, void 0), h = m(ue, 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;
|
|
1526
1536
|
function ae(e) {
|
|
1527
1537
|
return e.meta.layout !== "public" && e.meta.hideInTab !== !0 && !!e.meta.title;
|
|
1528
1538
|
}
|
|
@@ -1573,34 +1583,34 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1573
1583
|
return;
|
|
1574
1584
|
}
|
|
1575
1585
|
}
|
|
1576
|
-
function
|
|
1586
|
+
function R(e) {
|
|
1577
1587
|
if (!r.routeDriven || !(r.routeTabFilter ?? ae)(e)) return;
|
|
1578
1588
|
let t = (r.routeTabResolver ?? P)(e);
|
|
1579
1589
|
if (!t) return;
|
|
1580
1590
|
let n = F(), 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
1591
|
w.value = o, r.preferences.tabbar.visitHistory && (D.value = Jt(D.value, e.path)), Q();
|
|
1582
1592
|
}
|
|
1583
|
-
function
|
|
1593
|
+
function z(e) {
|
|
1584
1594
|
r.routeDriven && h && e && e !== p?.path && h.push(e);
|
|
1585
1595
|
}
|
|
1586
|
-
function
|
|
1596
|
+
function ce(e) {
|
|
1587
1597
|
return r.tabFallbackPath ? r.tabFallbackPath : e[0]?.path ?? "";
|
|
1588
1598
|
}
|
|
1589
1599
|
let B = o({
|
|
1590
1600
|
get: () => r.routeDriven ? p?.path ?? r.activeTabPath : u.value ?? r.activeTabPath,
|
|
1591
1601
|
set: (e) => {
|
|
1592
|
-
r.routeDriven ?
|
|
1602
|
+
r.routeDriven ? z(e) : u.value = e;
|
|
1593
1603
|
}
|
|
1594
|
-
}),
|
|
1595
|
-
let e = p?.path || B.value, t =
|
|
1596
|
-
return t &&
|
|
1597
|
-
}),
|
|
1604
|
+
}), V = o(() => r.routeDriven ? w.value : r.tabs), de = o(() => V.value.length > 0), H = o(() => r.preferences.sidebar.collapsed), W = o(() => typeof p?.meta.activeMenu == "string" ? p.meta.activeMenu : ""), K = o(() => {
|
|
1605
|
+
let e = p?.path || B.value, t = W.value;
|
|
1606
|
+
return t && U(r.menus, t) ? t : e && U(r.menus, e) ? e : r.activeMenuPath && U(r.menus, r.activeMenuPath) ? r.activeMenuPath : r.activeMenuPath || e;
|
|
1607
|
+
}), me = o(() => p?.path || B.value || K.value), q = o(() => ({
|
|
1598
1608
|
enable: r.preferences.breadcrumb?.enable ?? !0,
|
|
1599
1609
|
hideOnlyOne: r.preferences.breadcrumb?.hideOnlyOne ?? !1,
|
|
1600
1610
|
showHome: r.preferences.breadcrumb?.showHome ?? !0,
|
|
1601
1611
|
showIcon: r.preferences.breadcrumb?.showIcon ?? !0
|
|
1602
|
-
})),
|
|
1603
|
-
let e =
|
|
1612
|
+
})), he = o(() => r.preferences.header.globalSearch ?? !0), ve = o(() => r.preferences.shortcutKeys?.globalSearch ?? !0), ye = o(() => pe(r.menus, K.value)), J = o(() => r.preferences.app.layout === "mixed-nav" && r.preferences.sidebar.enable), be = o(() => J.value ? r.menus.find((e) => !e.hidden && e.path === T.value)?.path ?? ye.value : ye.value), xe = o(() => {
|
|
1613
|
+
let e = G({
|
|
1604
1614
|
activeTopMenuPath: be.value,
|
|
1605
1615
|
layout: r.preferences.app.layout,
|
|
1606
1616
|
menus: r.menus
|
|
@@ -1609,15 +1619,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1609
1619
|
...e,
|
|
1610
1620
|
sidebarMenus: r.preferences.sidebar.enable ? e.sidebarMenus : []
|
|
1611
1621
|
};
|
|
1612
|
-
}),
|
|
1622
|
+
}), Se = o(() => xe.value.sidebarMenus), Y = o(() => xe.value.topMenus), X = o(() => Se.value.length > 0), Z = o(() => Y.value.length > 0), Ce = o(() => q.value.enable && X.value && !Z.value), we = o(() => J.value ? "flat" : "tree"), Te = o(() => we.value === "tree" ? K.value : be.value), De = o(() => Z.value ? Y.value : Se.value), Oe = o(() => De.value.some((e) => !e.hidden));
|
|
1613
1623
|
M(() => [
|
|
1614
1624
|
p?.fullPath,
|
|
1615
|
-
|
|
1625
|
+
K.value,
|
|
1616
1626
|
r.menus,
|
|
1617
1627
|
r.preferences.app.layout,
|
|
1618
1628
|
r.preferences.sidebar.enable
|
|
1619
1629
|
], () => {
|
|
1620
|
-
T.value =
|
|
1630
|
+
T.value = ye.value;
|
|
1621
1631
|
}, { immediate: !0 }), M(() => [
|
|
1622
1632
|
r.preferences.app.dynamicTitle ?? !0,
|
|
1623
1633
|
p?.meta.title,
|
|
@@ -1687,7 +1697,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1687
1697
|
deep: !0,
|
|
1688
1698
|
immediate: !0
|
|
1689
1699
|
}), M(() => p?.fullPath, () => {
|
|
1690
|
-
p &&
|
|
1700
|
+
p && R(p);
|
|
1691
1701
|
}, { immediate: !0 }), M(() => [
|
|
1692
1702
|
r.routeDriven,
|
|
1693
1703
|
r.tabStorageKey,
|
|
@@ -1709,11 +1719,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1709
1719
|
x.value = !1, a("menuSelect", e);
|
|
1710
1720
|
}
|
|
1711
1721
|
function Fe(e) {
|
|
1712
|
-
let t =
|
|
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(
|
|
1722
|
+
let t = U(r.menus, e), n = t?.children?.filter((e) => !e.hidden) ?? [], i = !!t?.externalLink && t?.externalTarget !== "_self";
|
|
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);
|
|
1714
1724
|
}
|
|
1715
1725
|
function Ie(e) {
|
|
1716
|
-
Pe(
|
|
1726
|
+
Pe(fe(U(r.menus, e)) || e);
|
|
1717
1727
|
}
|
|
1718
1728
|
function Le(e) {
|
|
1719
1729
|
a("tabChange", e);
|
|
@@ -1723,26 +1733,26 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1723
1733
|
let t = w.value.findIndex((t) => t.path === e), n = Lt(w.value, e);
|
|
1724
1734
|
if (w.value = n, B.value === e) {
|
|
1725
1735
|
let i = r.preferences.tabbar.visitHistory;
|
|
1726
|
-
|
|
1736
|
+
z(Yt(n, e, D.value, {
|
|
1727
1737
|
useHistory: i,
|
|
1728
1738
|
priorClosedIndex: t
|
|
1729
|
-
}) ||
|
|
1739
|
+
}) || ce(n));
|
|
1730
1740
|
}
|
|
1731
1741
|
Q();
|
|
1732
1742
|
}
|
|
1733
1743
|
a("tabRemove", e);
|
|
1734
1744
|
}
|
|
1735
1745
|
function ze(e) {
|
|
1736
|
-
r.routeDriven && (w.value = Rt(w.value, e),
|
|
1746
|
+
r.routeDriven && (w.value = Rt(w.value, e), z(e), Q()), a("tabCloseLeft", e);
|
|
1737
1747
|
}
|
|
1738
1748
|
function Be(e) {
|
|
1739
|
-
r.routeDriven && (w.value = zt(w.value, e),
|
|
1749
|
+
r.routeDriven && (w.value = zt(w.value, e), z(e), Q()), a("tabCloseRight", e);
|
|
1740
1750
|
}
|
|
1741
1751
|
function Ve(e) {
|
|
1742
|
-
r.routeDriven && (w.value = Bt(w.value, e),
|
|
1752
|
+
r.routeDriven && (w.value = Bt(w.value, e), z(e), Q()), a("tabCloseOthers", e);
|
|
1743
1753
|
}
|
|
1744
1754
|
function He() {
|
|
1745
|
-
r.routeDriven && (w.value = Vt(w.value),
|
|
1755
|
+
r.routeDriven && (w.value = Vt(w.value), z(ce(w.value)), Q()), a("tabCloseAll");
|
|
1746
1756
|
}
|
|
1747
1757
|
function Ue(e, t) {
|
|
1748
1758
|
r.routeDriven && (w.value = t ? Ht(w.value, e) : Ut(w.value, e), Q()), a("tabPin", e, t);
|
|
@@ -1774,10 +1784,10 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1774
1784
|
}), t({
|
|
1775
1785
|
getLayoutElement: () => g.value?.$el,
|
|
1776
1786
|
getLayoutInstance: () => g.value,
|
|
1777
|
-
getTabs: () => [...
|
|
1787
|
+
getTabs: () => [...V.value],
|
|
1778
1788
|
getVisitHistory: () => [...D.value],
|
|
1779
1789
|
resetTabs: () => {
|
|
1780
|
-
w.value = Vt(w.value), D.value = [],
|
|
1790
|
+
w.value = Vt(w.value), D.value = [], z(ce(w.value)), Q();
|
|
1781
1791
|
},
|
|
1782
1792
|
resetTabSnapshot: () => {
|
|
1783
1793
|
Ae();
|
|
@@ -1786,8 +1796,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1786
1796
|
ref_key: "layoutRef",
|
|
1787
1797
|
ref: g,
|
|
1788
1798
|
class: v(["lumal-layout", {
|
|
1789
|
-
"is-sidebar-collapsed":
|
|
1790
|
-
"is-sidebar-hidden": !
|
|
1799
|
+
"is-sidebar-collapsed": H.value,
|
|
1800
|
+
"is-sidebar-hidden": !X.value,
|
|
1791
1801
|
"is-mobile-menu-hidden": !x.value,
|
|
1792
1802
|
"is-content-maximized": S.value
|
|
1793
1803
|
}]),
|
|
@@ -1797,11 +1807,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1797
1807
|
default: N(() => [e.showHeader ? ie((b(), s(je, {
|
|
1798
1808
|
key: 0,
|
|
1799
1809
|
title: e.title,
|
|
1800
|
-
collapsed: y.value ? !x.value :
|
|
1810
|
+
collapsed: y.value ? !x.value : H.value,
|
|
1801
1811
|
height: e.headerHeight,
|
|
1802
|
-
"mobile-only-toggle": !
|
|
1803
|
-
"sidebar-enabled":
|
|
1804
|
-
"toggle-after-title":
|
|
1812
|
+
"mobile-only-toggle": !X.value && Z.value,
|
|
1813
|
+
"sidebar-enabled": X.value || Z.value,
|
|
1814
|
+
"toggle-after-title": X.value && !y.value,
|
|
1805
1815
|
onToggleCollapse: $
|
|
1806
1816
|
}, d({ _: 2 }, [
|
|
1807
1817
|
t.$slots.logo ? {
|
|
@@ -1809,10 +1819,10 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1809
1819
|
fn: N(() => [C(t.$slots, "logo", {}, void 0, !0)]),
|
|
1810
1820
|
key: "0"
|
|
1811
1821
|
} : void 0,
|
|
1812
|
-
|
|
1822
|
+
Z.value ? {
|
|
1813
1823
|
name: "navigation",
|
|
1814
1824
|
fn: N(() => [f(Ct, {
|
|
1815
|
-
menus:
|
|
1825
|
+
menus: Y.value,
|
|
1816
1826
|
"active-path": Te.value,
|
|
1817
1827
|
align: e.preferences.header.menuAlign,
|
|
1818
1828
|
"max-width": e.preferences.header.menuMaxWidth,
|
|
@@ -1829,14 +1839,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1829
1839
|
} : void 0,
|
|
1830
1840
|
Ce.value ? {
|
|
1831
1841
|
name: "breadcrumb",
|
|
1832
|
-
fn: N(() => [f(
|
|
1842
|
+
fn: N(() => [f(ge, {
|
|
1833
1843
|
class: "lumal-layout__header-breadcrumb",
|
|
1834
|
-
"active-menu-path":
|
|
1835
|
-
"active-path":
|
|
1836
|
-
"hide-only-one":
|
|
1844
|
+
"active-menu-path": K.value,
|
|
1845
|
+
"active-path": me.value,
|
|
1846
|
+
"hide-only-one": q.value.hideOnlyOne,
|
|
1837
1847
|
menus: e.menus,
|
|
1838
|
-
"show-home":
|
|
1839
|
-
"show-icon":
|
|
1848
|
+
"show-home": q.value.showHome,
|
|
1849
|
+
"show-icon": q.value.showIcon,
|
|
1840
1850
|
onSelect: Ie
|
|
1841
1851
|
}, null, 8, [
|
|
1842
1852
|
"active-menu-path",
|
|
@@ -1848,12 +1858,12 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1848
1858
|
])]),
|
|
1849
1859
|
key: "2"
|
|
1850
1860
|
} : void 0,
|
|
1851
|
-
|
|
1861
|
+
he.value || t.$slots.headerActions ? {
|
|
1852
1862
|
name: "actions",
|
|
1853
|
-
fn: N(() => [
|
|
1863
|
+
fn: N(() => [he.value ? (b(), s(Ee, {
|
|
1854
1864
|
key: 0,
|
|
1855
1865
|
menus: e.menus,
|
|
1856
|
-
shortcut:
|
|
1866
|
+
shortcut: ve.value,
|
|
1857
1867
|
onSelect: Ie
|
|
1858
1868
|
}, null, 8, ["menus", "shortcut"])) : c("", !0), C(t.$slots, "headerActions", {}, void 0, !0)]),
|
|
1859
1869
|
key: "3"
|
|
@@ -1879,13 +1889,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1879
1889
|
name: "lumal-layout-sidebar",
|
|
1880
1890
|
appear: ""
|
|
1881
1891
|
}, {
|
|
1882
|
-
default: N(() => [
|
|
1892
|
+
default: N(() => [X.value ? (b(), s(qe, {
|
|
1883
1893
|
key: 0,
|
|
1884
1894
|
class: "lumal-layout__desktop-sidebar",
|
|
1885
1895
|
"aria-label": "主菜单",
|
|
1886
|
-
menus:
|
|
1887
|
-
"active-path":
|
|
1888
|
-
collapsed:
|
|
1896
|
+
menus: Se.value,
|
|
1897
|
+
"active-path": K.value,
|
|
1898
|
+
collapsed: H.value,
|
|
1889
1899
|
width: `${e.preferences.sidebar.width}px`,
|
|
1890
1900
|
"collapsed-width": "64px",
|
|
1891
1901
|
onSelect: Pe
|
|
@@ -1904,7 +1914,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1904
1914
|
"aria-hidden": !x.value,
|
|
1905
1915
|
inert: !x.value || void 0,
|
|
1906
1916
|
menus: De.value,
|
|
1907
|
-
"active-path":
|
|
1917
|
+
"active-path": K.value,
|
|
1908
1918
|
collapsed: !1,
|
|
1909
1919
|
width: `${e.preferences.sidebar.width}px`,
|
|
1910
1920
|
"collapsed-width": "64px",
|
|
@@ -1922,14 +1932,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1922
1932
|
"data-layout-fullscreen-target": ""
|
|
1923
1933
|
}, {
|
|
1924
1934
|
default: N(() => [
|
|
1925
|
-
|
|
1935
|
+
q.value.enable && !Ce.value && !S.value ? (b(), s(ge, {
|
|
1926
1936
|
key: 0,
|
|
1927
|
-
"active-menu-path":
|
|
1928
|
-
"active-path":
|
|
1929
|
-
"hide-only-one":
|
|
1937
|
+
"active-menu-path": K.value,
|
|
1938
|
+
"active-path": me.value,
|
|
1939
|
+
"hide-only-one": q.value.hideOnlyOne,
|
|
1930
1940
|
menus: e.menus,
|
|
1931
|
-
"show-home":
|
|
1932
|
-
"show-icon":
|
|
1941
|
+
"show-home": q.value.showHome,
|
|
1942
|
+
"show-icon": q.value.showIcon,
|
|
1933
1943
|
onSelect: Ie
|
|
1934
1944
|
}, null, 8, [
|
|
1935
1945
|
"active-menu-path",
|
|
@@ -1939,13 +1949,13 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1939
1949
|
"show-home",
|
|
1940
1950
|
"show-icon"
|
|
1941
1951
|
])) : c("", !0),
|
|
1942
|
-
|
|
1952
|
+
de.value && e.preferences.tabbar.enable ? (b(), s(mt, {
|
|
1943
1953
|
key: 1,
|
|
1944
1954
|
ref_key: "tabsRef",
|
|
1945
1955
|
ref: _,
|
|
1946
1956
|
"active-path": B.value,
|
|
1947
1957
|
"onUpdate:activePath": n[1] ||= (e) => B.value = e,
|
|
1948
|
-
tabs:
|
|
1958
|
+
tabs: V.value,
|
|
1949
1959
|
"show-icon": e.preferences.tabbar.showIcon,
|
|
1950
1960
|
"show-maximize": e.preferences.tabbar.showMaximize,
|
|
1951
1961
|
"show-more": e.preferences.tabbar.showMore,
|
|
@@ -1977,7 +1987,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1977
1987
|
"middle-click-to-close",
|
|
1978
1988
|
"style-type"
|
|
1979
1989
|
])) : c("", !0),
|
|
1980
|
-
f(
|
|
1990
|
+
f(_e, null, {
|
|
1981
1991
|
default: N(() => [C(t.$slots, "default", {}, void 0, !0)]),
|
|
1982
1992
|
_: 3
|
|
1983
1993
|
})
|
|
@@ -2049,7 +2059,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2049
2059
|
class: "lumal-router-view"
|
|
2050
2060
|
}, [
|
|
2051
2061
|
d.value ? (b(), l("div", $t, [...r[0] ||= [u("span", { class: "lumal-router-view__progress-bar" }, null, -1)]])) : c("", !0),
|
|
2052
|
-
f(O(
|
|
2062
|
+
f(O(V), null, {
|
|
2053
2063
|
default: N(({ Component: t }) => [g.value ? (b(), s(i, {
|
|
2054
2064
|
key: 0,
|
|
2055
2065
|
appear: "",
|
|
@@ -2070,6 +2080,6 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2070
2080
|
p.value ? (b(), l("div", en, [...r[1] ||= [u("span", { class: "lumal-router-view__loading-dot" }, null, -1)]])) : c("", !0)
|
|
2071
2081
|
], 512));
|
|
2072
2082
|
}
|
|
2073
|
-
}), [["__scopeId", "data-v-
|
|
2083
|
+
}), [["__scopeId", "data-v-1d1d75ee"]]);
|
|
2074
2084
|
//#endregion
|
|
2075
|
-
export { qe as A,
|
|
2085
|
+
export { qe as A, G as B, kt as C, At as D, Ot as E, U as F, W as I, H as L, Ee as M, _e as N, Ct as O, ge as P, pe 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, fe as z };
|