@lumal/core 0.0.3-beta → 0.0.4-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 +9 -0
- package/dist/{components-DCp2KGvo.js → components-B5Xd-iBK.js} +14 -6
- package/dist/components-CRxtQpsQ.cjs +2 -0
- package/dist/components.cjs +1 -1
- package/dist/components.js +1 -1
- package/dist/core.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{layout-B7yJhQXN.js → layout-DQzFKvly.js} +472 -445
- package/dist/layout-zJLDCf1c.cjs +1 -0
- package/dist/layout.cjs +1 -1
- package/dist/layout.js +1 -1
- package/dist/request.cjs +1 -1
- package/dist/request.js +89 -75
- package/dist/src/components/crud-table/LumalCrudTable.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/LumalSchemaTableCell.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalGlobalSearch.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalHeader.vue.d.ts +4 -4
- package/dist/src/layout/LumalHeader.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalLayout.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalRouterView.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalSidebarMenuItem.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalTabs.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalTopNav.vue.d.ts.map +1 -1
- package/dist/src/layout/LumalTopNavMenuItem.vue.d.ts +1 -0
- package/dist/src/layout/LumalTopNavMenuItem.vue.d.ts.map +1 -1
- package/dist/src/request/client.d.ts.map +1 -1
- package/dist/src/request/types.d.ts +5 -3
- package/dist/src/request/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/theme-chalk/index.scss +1 -0
- package/dist/components-oqKxhgFp.cjs +0 -2
- package/dist/layout-BgyM9WJi.cjs +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
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,
|
|
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, h as m, inject as h, mergeModels as g, mergeProps as _, nextTick as v, normalizeClass as y, normalizeStyle as b, onBeforeUnmount as ee, onMounted as te, openBlock as x, ref as S, renderList as C, renderSlot as w, resolveComponent as T, resolveDynamicComponent as E, shallowRef as D, toDisplayString as O, unref as k, useId as A, useModel as j, useTemplateRef as M, vModelText as N, vShow as ne, watch as P, withCtx as F, withDirectives as re, withModifiers as ie } from "vue";
|
|
3
|
+
import { LumalIcon as I } from "@lumal/icons-vue";
|
|
4
|
+
import { ElAside as L, ElButton as R, ElContainer as ae, ElHeader as oe, ElMain as z, ElMenu as B, ElMenuItem as se, ElScrollbar as V, ElSubMenu as H } from "element-plus";
|
|
5
|
+
import { RouterView as ce, routeLocationKey as le, routerKey as ue } from "vue-router";
|
|
6
|
+
import de from "sortablejs";
|
|
7
7
|
//#region src/layout/state/menu-layout.ts
|
|
8
8
|
function U(e, t) {
|
|
9
9
|
return e.hidden ? !1 : e.path === t ? !0 : e.children?.some((e) => U(e, t)) ?? !1;
|
|
@@ -25,16 +25,16 @@ function G(e, t) {
|
|
|
25
25
|
}
|
|
26
26
|
return [];
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function K(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 : K(t[0]);
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function q(e, t) {
|
|
35
35
|
return e.find((e) => U(e, t))?.path ?? "";
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function fe(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,
|
|
@@ -49,15 +49,15 @@ function K(e) {
|
|
|
49
49
|
}
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/layout/LumalBreadcrumb.vue?vue&type=script&setup=true&lang.ts
|
|
52
|
-
var
|
|
52
|
+
var pe = {
|
|
53
53
|
key: 0,
|
|
54
54
|
class: "lumal-breadcrumb",
|
|
55
55
|
"aria-label": "面包屑"
|
|
56
|
-
},
|
|
56
|
+
}, J = { class: "lumal-breadcrumb__list" }, me = {
|
|
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 q = {
|
|
|
80
80
|
},
|
|
81
81
|
emits: ["select"],
|
|
82
82
|
setup(e, { emit: n }) {
|
|
83
|
-
let r = e, i = n, a =
|
|
83
|
+
let r = e, i = n, a = h(le, void 0);
|
|
84
84
|
function d(e) {
|
|
85
85
|
return {
|
|
86
86
|
icon: e.icon,
|
|
@@ -107,65 +107,65 @@ var q = {
|
|
|
107
107
|
path: r.activePath,
|
|
108
108
|
title: n
|
|
109
109
|
}), t;
|
|
110
|
-
}),
|
|
111
|
-
let e = r.homePath ? G(r.menus, r.homePath).at(-1) : void 0, t = r.menus.find((e) => !e.hidden), n = r.homePath ||
|
|
110
|
+
}), m = o(() => f.value.length > 0 ? f.value : p.value), g = o(() => {
|
|
111
|
+
let e = r.homePath ? G(r.menus, r.homePath).at(-1) : void 0, t = r.menus.find((e) => !e.hidden), n = r.homePath || K(t);
|
|
112
112
|
if (n) return {
|
|
113
113
|
icon: e?.icon ?? t?.icon,
|
|
114
114
|
path: n,
|
|
115
115
|
title: e?.title ?? r.homeTitle
|
|
116
116
|
};
|
|
117
117
|
}), _ = o(() => {
|
|
118
|
-
let e = [...
|
|
118
|
+
let e = [...m.value], t = g.value;
|
|
119
119
|
return r.showHome && t && !e.some((e) => e.path === t.path) && e.unshift(t), e;
|
|
120
|
-
}), v = o(() => _.value.length > 0 && !(r.hideOnlyOne &&
|
|
121
|
-
return (n, r) => v.value ? (
|
|
120
|
+
}), v = o(() => _.value.length > 0 && !(r.hideOnlyOne && m.value.length <= 1));
|
|
121
|
+
return (n, r) => v.value ? (x(), l("nav", pe, [u("ol", J, [(x(!0), l(t, null, C(_.value, (t, n) => (x(), l("li", {
|
|
122
122
|
key: `${t.path}:${n}`,
|
|
123
123
|
class: "lumal-breadcrumb__item"
|
|
124
|
-
}, [n > 0 ? (
|
|
124
|
+
}, [n > 0 ? (x(), s(k(I), {
|
|
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 ? (
|
|
129
|
+
})) : c("", !0), n === _.value.length - 1 ? (x(), l("span", me, [e.showIcon && t.icon ? (x(), s(k(I), {
|
|
130
130
|
key: 0,
|
|
131
131
|
name: t.icon,
|
|
132
132
|
size: 15
|
|
133
|
-
}, null, 8, ["name"])) : c("", !0), u("span", null,
|
|
133
|
+
}, null, 8, ["name"])) : c("", !0), u("span", null, O(t.title), 1)])) : (x(), l("button", {
|
|
134
134
|
key: 2,
|
|
135
135
|
class: "lumal-breadcrumb__link",
|
|
136
136
|
type: "button",
|
|
137
137
|
onClick: (e) => i("select", t.path)
|
|
138
|
-
}, [e.showIcon && t.icon ? (
|
|
138
|
+
}, [e.showIcon && t.icon ? (x(), s(k(I), {
|
|
139
139
|
key: 0,
|
|
140
140
|
name: t.icon,
|
|
141
141
|
size: 15
|
|
142
|
-
}, null, 8, ["name"])) : c("", !0), u("span", null,
|
|
142
|
+
}, null, 8, ["name"])) : c("", !0), u("span", null, O(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
|
-
let n =
|
|
147
|
+
let n = M("contentRef");
|
|
148
148
|
return t({
|
|
149
149
|
getContentElement: () => n.value?.$el,
|
|
150
150
|
getContentInstance: () => n.value
|
|
151
|
-
}), (e, t) => (
|
|
151
|
+
}), (e, t) => (x(), s(k(z), {
|
|
152
152
|
ref_key: "contentRef",
|
|
153
153
|
ref: n,
|
|
154
154
|
class: "lumal-content"
|
|
155
155
|
}, {
|
|
156
|
-
default:
|
|
156
|
+
default: F(() => [w(e.$slots, "default", {}, void 0, !0)]),
|
|
157
157
|
_: 3
|
|
158
158
|
}, 512));
|
|
159
159
|
}
|
|
160
|
-
}), [["__scopeId", "data-v-a0d6361c"]]),
|
|
160
|
+
}), [["__scopeId", "data-v-a0d6361c"]]), ve = { class: "lumal-global-search" }, Y = { key: 0 }, ye = ["aria-labelledby"], be = { class: "lumal-global-search__header" }, xe = ["id"], X = { class: "lumal-global-search__input-wrap" }, Se = [
|
|
161
161
|
"aria-activedescendant",
|
|
162
162
|
"aria-controls",
|
|
163
163
|
"placeholder"
|
|
164
|
-
],
|
|
164
|
+
], Z = ["id"], Ce = ["id", "aria-selected"], we = ["onMouseenter", "onClick"], Te = {
|
|
165
165
|
key: 0,
|
|
166
166
|
class: "lumal-global-search__empty",
|
|
167
167
|
role: "status"
|
|
168
|
-
},
|
|
168
|
+
}, Ee = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
169
169
|
__name: "LumalGlobalSearch",
|
|
170
170
|
props: {
|
|
171
171
|
maxResults: { default: 12 },
|
|
@@ -178,7 +178,7 @@ var q = {
|
|
|
178
178
|
},
|
|
179
179
|
emits: ["select"],
|
|
180
180
|
setup(e, { expose: n, emit: i }) {
|
|
181
|
-
let a = e, d = i, p = `lumal-global-search-${
|
|
181
|
+
let a = e, d = i, p = `lumal-global-search-${A()}`, m = M("inputRef"), h = M("triggerRef"), g = M("dialogRef"), _ = S(!1), b = S(""), w = S(0), T;
|
|
182
182
|
function E(e, t = []) {
|
|
183
183
|
return e.flatMap((e) => {
|
|
184
184
|
if (e.hidden) return [];
|
|
@@ -189,20 +189,20 @@ var q = {
|
|
|
189
189
|
}, ...E(e.children ?? [], n)];
|
|
190
190
|
});
|
|
191
191
|
}
|
|
192
|
-
let
|
|
193
|
-
let e =
|
|
194
|
-
return (e ?
|
|
195
|
-
}),
|
|
196
|
-
function
|
|
197
|
-
|
|
192
|
+
let D = o(() => E(a.menus)), j = o(() => {
|
|
193
|
+
let e = b.value.trim().toLocaleLowerCase();
|
|
194
|
+
return (e ? D.value.filter(({ item: t, trail: n }) => `${n.join(" ")} ${t.path}`.toLocaleLowerCase().includes(e)) : D.value).slice(0, Math.max(1, a.maxResults));
|
|
195
|
+
}), ne = o(() => j.value[w.value] ? `${p}-option-${w.value}` : void 0);
|
|
196
|
+
function F() {
|
|
197
|
+
_.value || (T = document.activeElement instanceof HTMLElement ? document.activeElement : void 0, _.value = !0, b.value = "", w.value = 0, v(() => m.value?.focus()));
|
|
198
198
|
}
|
|
199
199
|
function L(e = !0) {
|
|
200
|
-
|
|
201
|
-
|
|
200
|
+
_.value = !1, document.removeEventListener("focusin", R), e && v(() => {
|
|
201
|
+
_.value || (T?.isConnected ? T : h.value)?.focus();
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
204
|
function R(e) {
|
|
205
|
-
|
|
205
|
+
_.value && g.value && !g.value.contains(e.target) && m.value?.focus();
|
|
206
206
|
}
|
|
207
207
|
function ae(e) {
|
|
208
208
|
if (e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), L()), e.key !== "Tab") return;
|
|
@@ -217,46 +217,46 @@ var q = {
|
|
|
217
217
|
e.preventDefault(), L();
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
|
-
if (
|
|
220
|
+
if (j.value.length !== 0) {
|
|
221
221
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
222
222
|
e.preventDefault();
|
|
223
223
|
let t = e.key === "ArrowDown" ? 1 : -1;
|
|
224
|
-
w.value = (w.value + t +
|
|
224
|
+
w.value = (w.value + t + j.value.length) % j.value.length;
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
|
-
e.key === "Enter" && (e.preventDefault(), oe(
|
|
227
|
+
e.key === "Enter" && (e.preventDefault(), oe(j.value[w.value]));
|
|
228
228
|
}
|
|
229
229
|
}
|
|
230
230
|
function B(e) {
|
|
231
|
-
!a.shortcut || e.altKey || e.shiftKey || e.key.toLocaleLowerCase() !== "k" || !e.ctrlKey && !e.metaKey || (e.preventDefault(),
|
|
231
|
+
!a.shortcut || e.altKey || e.shiftKey || e.key.toLocaleLowerCase() !== "k" || !e.ctrlKey && !e.metaKey || (e.preventDefault(), _.value ? L() : F());
|
|
232
232
|
}
|
|
233
|
-
return
|
|
233
|
+
return P(j, () => {
|
|
234
234
|
w.value = 0;
|
|
235
|
-
}),
|
|
235
|
+
}), P(_, (e) => {
|
|
236
236
|
e ? document.addEventListener("focusin", R) : document.removeEventListener("focusin", R);
|
|
237
237
|
}), te(() => {
|
|
238
238
|
window.addEventListener("keydown", B);
|
|
239
239
|
}), ee(() => {
|
|
240
|
-
window.removeEventListener("keydown", B), document.removeEventListener("focusin", R),
|
|
240
|
+
window.removeEventListener("keydown", B), document.removeEventListener("focusin", R), _.value && T?.isConnected && T.focus();
|
|
241
241
|
}), n({
|
|
242
242
|
close: L,
|
|
243
|
-
open:
|
|
244
|
-
}), (n, i) => (
|
|
243
|
+
open: F
|
|
244
|
+
}), (n, i) => (x(), l("div", ve, [u("button", {
|
|
245
245
|
ref_key: "triggerRef",
|
|
246
246
|
ref: h,
|
|
247
247
|
class: "lumal-global-search__trigger",
|
|
248
248
|
type: "button",
|
|
249
249
|
"aria-label": "打开全局搜索",
|
|
250
250
|
title: "全局搜索",
|
|
251
|
-
onClick:
|
|
251
|
+
onClick: F
|
|
252
252
|
}, [
|
|
253
|
-
f(
|
|
254
|
-
|
|
253
|
+
f(k(I), {
|
|
254
|
+
name: "lumal:search",
|
|
255
255
|
size: 17
|
|
256
256
|
}),
|
|
257
257
|
i[3] ||= u("span", { class: "lumal-global-search__trigger-label" }, "搜索", -1),
|
|
258
|
-
e.shortcut ? (
|
|
259
|
-
], 512), (
|
|
258
|
+
e.shortcut ? (x(), l("kbd", Y, "Ctrl K")) : c("", !0)
|
|
259
|
+
], 512), (x(), s(r, { to: "body" }, [_.value ? (x(), l("div", {
|
|
260
260
|
key: 0,
|
|
261
261
|
class: "lumal-global-search__backdrop",
|
|
262
262
|
onMousedown: i[2] ||= ie((e) => L(), ["self"])
|
|
@@ -269,62 +269,62 @@ var q = {
|
|
|
269
269
|
"aria-labelledby": `${p}-title`,
|
|
270
270
|
onKeydown: ae
|
|
271
271
|
}, [
|
|
272
|
-
u("header",
|
|
272
|
+
u("header", be, [u("h2", { id: `${p}-title` }, " 全局搜索 ", 8, xe), u("button", {
|
|
273
273
|
type: "button",
|
|
274
274
|
"aria-label": "关闭全局搜索",
|
|
275
275
|
title: "关闭",
|
|
276
276
|
onClick: i[0] ||= (e) => L()
|
|
277
|
-
}, [f(
|
|
277
|
+
}, [f(k(I), {
|
|
278
278
|
name: "lumal:close",
|
|
279
279
|
size: 17
|
|
280
280
|
})])]),
|
|
281
|
-
u("label",
|
|
281
|
+
u("label", X, [
|
|
282
282
|
i[4] ||= u("span", { class: "lumal-global-search__sr-only" }, "搜索菜单", -1),
|
|
283
|
-
f(
|
|
284
|
-
|
|
283
|
+
f(k(I), {
|
|
284
|
+
name: "lumal:search",
|
|
285
285
|
size: 18
|
|
286
286
|
}),
|
|
287
287
|
re(u("input", {
|
|
288
288
|
ref_key: "inputRef",
|
|
289
289
|
ref: m,
|
|
290
|
-
"onUpdate:modelValue": i[1] ||= (e) =>
|
|
290
|
+
"onUpdate:modelValue": i[1] ||= (e) => b.value = e,
|
|
291
291
|
role: "combobox",
|
|
292
292
|
autocomplete: "off",
|
|
293
|
-
"aria-activedescendant":
|
|
293
|
+
"aria-activedescendant": ne.value,
|
|
294
294
|
"aria-autocomplete": "list",
|
|
295
295
|
"aria-controls": `${p}-results`,
|
|
296
296
|
"aria-expanded": "true",
|
|
297
297
|
placeholder: e.placeholder,
|
|
298
298
|
onKeydown: z
|
|
299
|
-
}, null, 40,
|
|
299
|
+
}, null, 40, Se), [[N, b.value]])
|
|
300
300
|
]),
|
|
301
301
|
u("ul", {
|
|
302
302
|
id: `${p}-results`,
|
|
303
303
|
class: "lumal-global-search__results",
|
|
304
304
|
role: "listbox"
|
|
305
|
-
}, [(
|
|
305
|
+
}, [(x(!0), l(t, null, C(j.value, (e, t) => (x(), l("li", {
|
|
306
306
|
id: `${p}-option-${t}`,
|
|
307
307
|
key: e.item.path,
|
|
308
308
|
role: "option",
|
|
309
309
|
"aria-selected": t === w.value
|
|
310
310
|
}, [u("button", {
|
|
311
311
|
type: "button",
|
|
312
|
-
class:
|
|
312
|
+
class: y({ "is-active": t === w.value }),
|
|
313
313
|
onMouseenter: (e) => w.value = t,
|
|
314
314
|
onClick: (t) => oe(e)
|
|
315
315
|
}, [
|
|
316
|
-
e.item.icon ? (
|
|
316
|
+
e.item.icon ? (x(), s(k(I), {
|
|
317
317
|
key: 0,
|
|
318
318
|
name: e.item.icon,
|
|
319
319
|
size: 18
|
|
320
320
|
}, null, 8, ["name"])) : c("", !0),
|
|
321
|
-
u("span", null, [u("strong", null,
|
|
322
|
-
u("code", null,
|
|
323
|
-
], 42,
|
|
324
|
-
|
|
325
|
-
], 40,
|
|
321
|
+
u("span", null, [u("strong", null, O(e.item.title), 1), u("small", null, O(e.trail.join(" / ")), 1)]),
|
|
322
|
+
u("code", null, O(e.item.path), 1)
|
|
323
|
+
], 42, we)], 8, Ce))), 128))], 8, Z),
|
|
324
|
+
j.value.length === 0 ? (x(), l("p", Te, " 未找到匹配菜单,请尝试其他关键词 ")) : c("", !0)
|
|
325
|
+
], 40, ye)], 32)) : c("", !0)]))]));
|
|
326
326
|
}
|
|
327
|
-
}), [["__scopeId", "data-v-
|
|
327
|
+
}), [["__scopeId", "data-v-f2b1e55b"]]), De = { class: "lumal-header__left" }, Oe = {
|
|
328
328
|
key: 0,
|
|
329
329
|
class: "lumal-header__title"
|
|
330
330
|
}, ke = {
|
|
@@ -361,45 +361,46 @@ var q = {
|
|
|
361
361
|
},
|
|
362
362
|
emits: ["toggleCollapse"],
|
|
363
363
|
setup(e, { expose: t, emit: n }) {
|
|
364
|
-
let r = e, i = n, a =
|
|
365
|
-
function
|
|
364
|
+
let r = e, i = n, a = M("headerRef"), d = o(() => r.collapsed ? "展开侧边栏" : "收起侧边栏");
|
|
365
|
+
function p() {
|
|
366
366
|
i("toggleCollapse");
|
|
367
367
|
}
|
|
368
368
|
return t({
|
|
369
369
|
getHeaderElement: () => a.value?.$el,
|
|
370
370
|
getHeaderInstance: () => a.value
|
|
371
|
-
}), (t, n) => (
|
|
371
|
+
}), (t, n) => (x(), s(k(oe), {
|
|
372
372
|
ref_key: "headerRef",
|
|
373
373
|
ref: a,
|
|
374
374
|
class: "lumal-header",
|
|
375
375
|
height: e.height
|
|
376
376
|
}, {
|
|
377
|
-
default:
|
|
378
|
-
u("div", De, [
|
|
377
|
+
default: F(() => [
|
|
378
|
+
u("div", De, [w(t.$slots, "logo", {}, () => [e.title ? (x(), l("span", Oe, O(e.title), 1)) : c("", !0)], !0), e.sidebarEnabled ? (x(), s(k(R), {
|
|
379
379
|
key: 0,
|
|
380
|
-
class:
|
|
380
|
+
class: y(["lumal-header__toggle", {
|
|
381
381
|
"is-after-title": e.toggleAfterTitle,
|
|
382
382
|
"is-mobile-only": e.mobileOnlyToggle
|
|
383
383
|
}]),
|
|
384
384
|
text: "",
|
|
385
385
|
"aria-label": d.value,
|
|
386
386
|
"data-action": "toggle-sidebar",
|
|
387
|
-
onClick:
|
|
387
|
+
onClick: p
|
|
388
388
|
}, {
|
|
389
|
-
default:
|
|
390
|
-
"
|
|
391
|
-
|
|
392
|
-
|
|
389
|
+
default: F(() => [f(k(I), {
|
|
390
|
+
name: e.collapsed ? "lumal:sidebar-expand" : "lumal:sidebar-collapse",
|
|
391
|
+
morph: "",
|
|
392
|
+
size: 18
|
|
393
|
+
}, null, 8, ["name"])]),
|
|
393
394
|
_: 1
|
|
394
395
|
}, 8, ["class", "aria-label"])) : c("", !0)]),
|
|
395
|
-
t.$slots.breadcrumb ? (
|
|
396
|
-
t.$slots.navigation ? (
|
|
397
|
-
t.$slots.actions ? (
|
|
396
|
+
t.$slots.breadcrumb ? (x(), l("div", ke, [w(t.$slots, "breadcrumb", {}, void 0, !0)])) : c("", !0),
|
|
397
|
+
t.$slots.navigation ? (x(), l("nav", Ae, [w(t.$slots, "navigation", {}, void 0, !0)])) : c("", !0),
|
|
398
|
+
t.$slots.actions ? (x(), l("div", Q, [w(t.$slots, "actions", {}, void 0, !0)])) : c("", !0)
|
|
398
399
|
]),
|
|
399
400
|
_: 3
|
|
400
401
|
}, 8, ["height"]));
|
|
401
402
|
}
|
|
402
|
-
}), [["__scopeId", "data-v-
|
|
403
|
+
}), [["__scopeId", "data-v-abe2c07a"]]), Me = ["aria-label"], Ne = {
|
|
403
404
|
key: 0,
|
|
404
405
|
"aria-hidden": "true"
|
|
405
406
|
}, $ = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
@@ -412,34 +413,26 @@ var q = {
|
|
|
412
413
|
},
|
|
413
414
|
setup(e) {
|
|
414
415
|
let t = e, n = o(() => t.type === "dot" || t.badge === 0 || !!t.badge), r = o(() => t.type === "dot" ? `${t.label}有新内容` : `${t.label}:${t.badge}`);
|
|
415
|
-
return (t, i) => n.value ? (
|
|
416
|
+
return (t, i) => n.value ? (x(), l("span", {
|
|
416
417
|
key: 0,
|
|
417
|
-
class:
|
|
418
|
+
class: y(["lumal-menu-badge", [`is-${e.tone}`, { "is-dot": e.type === "dot" }]]),
|
|
418
419
|
role: "status",
|
|
419
420
|
"aria-label": r.value
|
|
420
|
-
}, [e.type === "text" ? (
|
|
421
|
+
}, [e.type === "text" ? (x(), l("span", Ne, O(e.badge), 1)) : c("", !0)], 10, Me)) : c("", !0);
|
|
421
422
|
}
|
|
422
423
|
}), [["__scopeId", "data-v-0ca73e4b"]]), Pe = {
|
|
423
424
|
key: 0,
|
|
424
425
|
class: "lumal-sidebar-menu-item__icon",
|
|
425
426
|
"aria-hidden": "true"
|
|
426
|
-
}, Fe = { class: "lumal-sidebar-menu-item__label" }, Ie = { class: "lumal-sidebar-menu-item__title" }, Le = {
|
|
427
|
-
key: 1,
|
|
428
|
-
class: "lumal-sidebar-menu-item__external",
|
|
429
|
-
"aria-hidden": "true"
|
|
430
|
-
}, Re = ["title"], ze = {
|
|
427
|
+
}, Fe = { class: "lumal-sidebar-menu-item__label" }, Ie = { class: "lumal-sidebar-menu-item__title" }, Le = ["title"], Re = {
|
|
431
428
|
key: 0,
|
|
432
429
|
class: "lumal-sidebar-menu-item__icon",
|
|
433
430
|
"aria-hidden": "true"
|
|
434
|
-
},
|
|
431
|
+
}, ze = { class: "lumal-sidebar-menu-item__label" }, Be = { class: "lumal-sidebar-menu-item__title" }, Ve = {
|
|
435
432
|
key: 0,
|
|
436
433
|
class: "lumal-sidebar-menu-item__icon",
|
|
437
434
|
"aria-hidden": "true"
|
|
438
|
-
},
|
|
439
|
-
key: 1,
|
|
440
|
-
class: "lumal-sidebar-menu-item__external",
|
|
441
|
-
"aria-hidden": "true"
|
|
442
|
-
}, Ke = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
435
|
+
}, He = { class: "lumal-sidebar-menu-item__label" }, Ue = { class: "lumal-sidebar-menu-item__title" }, We = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
443
436
|
__name: "LumalSidebarMenuItem",
|
|
444
437
|
props: {
|
|
445
438
|
activePath: {},
|
|
@@ -454,19 +447,19 @@ var q = {
|
|
|
454
447
|
i("select", e);
|
|
455
448
|
}
|
|
456
449
|
return (n, r) => {
|
|
457
|
-
let i =
|
|
458
|
-
return d.value ? (
|
|
450
|
+
let i = T("LumalSidebarMenuItem", !0);
|
|
451
|
+
return d.value ? (x(), s(k(H), {
|
|
459
452
|
key: 0,
|
|
460
453
|
class: "lumal-sidebar-menu-item",
|
|
461
454
|
index: e.item.path,
|
|
462
455
|
title: e.collapsed ? e.item.title : void 0
|
|
463
456
|
}, {
|
|
464
|
-
title:
|
|
465
|
-
e.item.icon ? (
|
|
457
|
+
title: F(() => [
|
|
458
|
+
e.item.icon ? (x(), l("i", Pe, [f(k(I), {
|
|
466
459
|
name: e.item.icon,
|
|
467
460
|
size: 16
|
|
468
461
|
}, null, 8, ["name"])])) : c("", !0),
|
|
469
|
-
u("span", Fe, [u("span", Ie,
|
|
462
|
+
u("span", Fe, [u("span", Ie, O(e.item.title), 1), f($, {
|
|
470
463
|
badge: e.item.badge,
|
|
471
464
|
label: e.item.title,
|
|
472
465
|
tone: e.item.badgeTone,
|
|
@@ -477,9 +470,14 @@ var q = {
|
|
|
477
470
|
"tone",
|
|
478
471
|
"type"
|
|
479
472
|
])]),
|
|
480
|
-
e.item.externalLink ? (
|
|
473
|
+
e.item.externalLink ? (x(), s(k(I), {
|
|
474
|
+
key: 1,
|
|
475
|
+
class: "lumal-sidebar-menu-item__external",
|
|
476
|
+
name: "lumal:external-link",
|
|
477
|
+
size: 12
|
|
478
|
+
})) : c("", !0)
|
|
481
479
|
]),
|
|
482
|
-
default:
|
|
480
|
+
default: F(() => [(x(!0), l(t, null, C(a.value, (t) => (x(), s(i, {
|
|
483
481
|
key: t.path,
|
|
484
482
|
item: t,
|
|
485
483
|
"active-path": e.activePath,
|
|
@@ -493,7 +491,7 @@ var q = {
|
|
|
493
491
|
"depth"
|
|
494
492
|
]))), 128))]),
|
|
495
493
|
_: 1
|
|
496
|
-
}, 8, ["index", "title"])) : p.value ? (
|
|
494
|
+
}, 8, ["index", "title"])) : p.value ? (x(), l("li", {
|
|
497
495
|
key: 1,
|
|
498
496
|
class: "el-menu-item lumal-sidebar-menu-item lumal-sidebar-menu-item--external",
|
|
499
497
|
role: "menuitem",
|
|
@@ -501,11 +499,11 @@ var q = {
|
|
|
501
499
|
title: e.collapsed ? e.item.title : void 0,
|
|
502
500
|
onClick: r[0] ||= (t) => m(e.item.path)
|
|
503
501
|
}, [
|
|
504
|
-
e.item.icon ? (
|
|
502
|
+
e.item.icon ? (x(), l("i", Re, [f(k(I), {
|
|
505
503
|
name: e.item.icon,
|
|
506
504
|
size: 16
|
|
507
505
|
}, null, 8, ["name"])])) : c("", !0),
|
|
508
|
-
u("span",
|
|
506
|
+
u("span", ze, [u("span", Be, O(e.item.title), 1), f($, {
|
|
509
507
|
badge: e.item.badge,
|
|
510
508
|
label: e.item.title,
|
|
511
509
|
tone: e.item.badgeTone,
|
|
@@ -516,23 +514,24 @@ var q = {
|
|
|
516
514
|
"tone",
|
|
517
515
|
"type"
|
|
518
516
|
])]),
|
|
519
|
-
|
|
517
|
+
f(k(I), {
|
|
520
518
|
class: "lumal-sidebar-menu-item__external",
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
519
|
+
name: "lumal:external-link",
|
|
520
|
+
size: 12
|
|
521
|
+
})
|
|
522
|
+
], 8, Le)) : (x(), s(k(se), {
|
|
524
523
|
key: 2,
|
|
525
524
|
class: "lumal-sidebar-menu-item",
|
|
526
525
|
index: e.item.path,
|
|
527
526
|
title: e.collapsed ? e.item.title : void 0,
|
|
528
527
|
onClick: r[1] ||= (t) => m(e.item.path)
|
|
529
528
|
}, {
|
|
530
|
-
default:
|
|
531
|
-
e.item.icon ? (
|
|
529
|
+
default: F(() => [
|
|
530
|
+
e.item.icon ? (x(), l("i", Ve, [f(k(I), {
|
|
532
531
|
name: e.item.icon,
|
|
533
532
|
size: 16
|
|
534
533
|
}, null, 8, ["name"])])) : c("", !0),
|
|
535
|
-
u("span",
|
|
534
|
+
u("span", He, [u("span", Ue, O(e.item.title), 1), f($, {
|
|
536
535
|
badge: e.item.badge,
|
|
537
536
|
label: e.item.title,
|
|
538
537
|
tone: e.item.badgeTone,
|
|
@@ -543,13 +542,18 @@ var q = {
|
|
|
543
542
|
"tone",
|
|
544
543
|
"type"
|
|
545
544
|
])]),
|
|
546
|
-
e.item.externalLink ? (
|
|
545
|
+
e.item.externalLink ? (x(), s(k(I), {
|
|
546
|
+
key: 1,
|
|
547
|
+
class: "lumal-sidebar-menu-item__external",
|
|
548
|
+
name: "lumal:external-link",
|
|
549
|
+
size: 12
|
|
550
|
+
})) : c("", !0)
|
|
547
551
|
]),
|
|
548
552
|
_: 1
|
|
549
553
|
}, 8, ["index", "title"]));
|
|
550
554
|
};
|
|
551
555
|
}
|
|
552
|
-
}), [["__scopeId", "data-v-
|
|
556
|
+
}), [["__scopeId", "data-v-9466482e"]]), Ge = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
553
557
|
__name: "LumalSidebar",
|
|
554
558
|
props: {
|
|
555
559
|
menus: { default: () => [] },
|
|
@@ -564,27 +568,27 @@ var q = {
|
|
|
564
568
|
},
|
|
565
569
|
emits: ["select"],
|
|
566
570
|
setup(e, { expose: n, emit: r }) {
|
|
567
|
-
let i = e, a = r, c =
|
|
571
|
+
let i = e, a = r, c = M("asideRef"), u = o(() => i.collapsed ? i.collapsedWidth : i.width);
|
|
568
572
|
function d(e) {
|
|
569
573
|
a("select", e);
|
|
570
574
|
}
|
|
571
575
|
return n({
|
|
572
576
|
getAsideElement: () => c.value?.$el,
|
|
573
577
|
getAsideInstance: () => c.value
|
|
574
|
-
}), (n, r) => (
|
|
578
|
+
}), (n, r) => (x(), s(k(L), {
|
|
575
579
|
ref_key: "asideRef",
|
|
576
580
|
ref: c,
|
|
577
581
|
class: "lumal-sidebar",
|
|
578
582
|
width: u.value,
|
|
579
583
|
"aria-label": e.ariaLabel
|
|
580
584
|
}, {
|
|
581
|
-
default:
|
|
582
|
-
default:
|
|
585
|
+
default: F(() => [f(k(V), { class: "lumal-sidebar__scrollbar" }, {
|
|
586
|
+
default: F(() => [f(k(B), {
|
|
583
587
|
class: "lumal-sidebar__menu",
|
|
584
588
|
collapse: e.collapsed,
|
|
585
589
|
"default-active": e.activePath
|
|
586
590
|
}, {
|
|
587
|
-
default:
|
|
591
|
+
default: F(() => [(x(!0), l(t, null, C(e.menus.filter((e) => !e.hidden), (t) => (x(), s(We, {
|
|
588
592
|
key: t.path,
|
|
589
593
|
item: t,
|
|
590
594
|
"active-path": e.activePath,
|
|
@@ -603,15 +607,15 @@ var q = {
|
|
|
603
607
|
_: 1
|
|
604
608
|
}, 8, ["width", "aria-label"]));
|
|
605
609
|
}
|
|
606
|
-
}), [["__scopeId", "data-v-d9c4d4bc"]]),
|
|
610
|
+
}), [["__scopeId", "data-v-d9c4d4bc"]]), Ke = ["disabled"], qe = ["onContextmenu"], Je = [
|
|
607
611
|
"aria-selected",
|
|
608
612
|
"tabindex",
|
|
609
613
|
"onClick",
|
|
610
614
|
"onKeydown",
|
|
611
615
|
"onMousedown"
|
|
612
|
-
],
|
|
616
|
+
], Ye = ["title"], Xe = ["aria-label", "onClick"], Ze = ["disabled"], Qe = ["disabled"], $e = ["aria-expanded"], et = ["aria-label"], tt = ["disabled"], nt = ["disabled"], rt = ["disabled"], it = ["disabled"], at = ["disabled"], ot = ["disabled"], st = ["disabled"], ct = ["disabled"], lt = ["disabled"], ut = 192, dt = 220, ft = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
613
617
|
__name: "LumalTabs",
|
|
614
|
-
props: /*@__PURE__*/
|
|
618
|
+
props: /*@__PURE__*/ g({
|
|
615
619
|
activePath: { default: "" },
|
|
616
620
|
draggable: {
|
|
617
621
|
type: Boolean,
|
|
@@ -656,7 +660,7 @@ var q = {
|
|
|
656
660
|
activePath: { default: "" },
|
|
657
661
|
activePathModifiers: {}
|
|
658
662
|
}),
|
|
659
|
-
emits: /*@__PURE__*/
|
|
663
|
+
emits: /*@__PURE__*/ g([
|
|
660
664
|
"change",
|
|
661
665
|
"closeAll",
|
|
662
666
|
"closeLeft",
|
|
@@ -670,15 +674,15 @@ var q = {
|
|
|
670
674
|
"reorder"
|
|
671
675
|
], ["update:activePath"]),
|
|
672
676
|
setup(e, { expose: n, emit: i }) {
|
|
673
|
-
let d = e, p = i, m =
|
|
677
|
+
let d = e, p = i, m = j(e, "activePath"), h = M("tabsViewportRef"), g = D({
|
|
674
678
|
path: "",
|
|
675
679
|
style: {},
|
|
676
680
|
visible: !1
|
|
677
|
-
}),
|
|
681
|
+
}), _ = D({
|
|
678
682
|
path: "",
|
|
679
683
|
style: {},
|
|
680
684
|
visible: !1
|
|
681
|
-
}),
|
|
685
|
+
}), S = D(!1), w = D(!1), T = D(!0), E = D(!1), A, N, L = null, R = o(() => g.value.visible ? g.value : _.value), ae = o(() => R.value.path), oe = D(!0), z;
|
|
682
686
|
function B() {
|
|
683
687
|
oe.value = !z || !z.matches;
|
|
684
688
|
}
|
|
@@ -692,33 +696,33 @@ var q = {
|
|
|
692
696
|
function le(e) {
|
|
693
697
|
return d.tabs.length > 1 && d.tabs.some((t) => t.path === e && t.closable !== !1 && t.pinned !== !0);
|
|
694
698
|
}
|
|
695
|
-
function
|
|
699
|
+
function ue(e, t) {
|
|
696
700
|
let n = d.tabs.findIndex((t) => t.path === e);
|
|
697
701
|
return (t === "left" ? d.tabs.slice(0, n) : d.tabs.slice(n + 1)).some((e) => e.closable !== !1 && e.pinned !== !0);
|
|
698
702
|
}
|
|
699
|
-
function
|
|
703
|
+
function U(e) {
|
|
700
704
|
return d.tabs.some((t) => t.path !== e && t.closable !== !1 && t.pinned !== !0);
|
|
701
705
|
}
|
|
702
|
-
function
|
|
706
|
+
function W(e) {
|
|
703
707
|
return e === m.value;
|
|
704
708
|
}
|
|
705
|
-
function
|
|
709
|
+
function G(e) {
|
|
706
710
|
let t = d.tabs.find((t) => t.path === e);
|
|
707
711
|
return !!t && t.pinned !== !0 && t.closable !== !1;
|
|
708
712
|
}
|
|
709
|
-
function
|
|
713
|
+
function K(e) {
|
|
710
714
|
let t = d.tabs.find((t) => t.path === e);
|
|
711
715
|
return !!t && t.pinned === !0 && t.closable !== !1;
|
|
712
716
|
}
|
|
713
|
-
function
|
|
717
|
+
function q(e) {
|
|
714
718
|
let t = ae.value;
|
|
715
|
-
return e === "close" ? !le(t) : e === "close-left" || e === "close-right" ? !t || !
|
|
719
|
+
return e === "close" ? !le(t) : e === "close-left" || e === "close-right" ? !t || !W(t) || !ue(t, e === "close-left" ? "left" : "right") : e === "close-others" ? !t || !W(t) || !U(t) : e === "close-all" ? !ce.value : e === "refresh" ? !t || !W(t) : e === "pin" ? !G(t) && !K(t) : e === "new-window" && !t;
|
|
716
720
|
}
|
|
717
|
-
function
|
|
718
|
-
return
|
|
721
|
+
function fe(e) {
|
|
722
|
+
return K(e) ? "取消固定" : "固定";
|
|
719
723
|
}
|
|
720
724
|
function pe() {
|
|
721
|
-
return
|
|
725
|
+
return S.value ? "还原" : "内容最大化";
|
|
722
726
|
}
|
|
723
727
|
function J(e) {
|
|
724
728
|
e !== m.value && (m.value = e, p("change", e));
|
|
@@ -727,7 +731,7 @@ var q = {
|
|
|
727
731
|
le(e) && p("remove", e);
|
|
728
732
|
}
|
|
729
733
|
function he(e) {
|
|
730
|
-
e &&
|
|
734
|
+
e && W(e) && p("refresh", e);
|
|
731
735
|
}
|
|
732
736
|
function ge(e, t) {
|
|
733
737
|
e.button !== 1 || !d.middleClickToClose || !le(t.path) || (e.preventDefault(), p("remove", t.path));
|
|
@@ -741,22 +745,22 @@ var q = {
|
|
|
741
745
|
].includes(e.key) || d.tabs.length === 0) return;
|
|
742
746
|
e.preventDefault();
|
|
743
747
|
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];
|
|
744
|
-
r && (J(r.path),
|
|
748
|
+
r && (J(r.path), v(() => {
|
|
745
749
|
h.value?.querySelectorAll("[role=\"tab\"]").item(n).focus();
|
|
746
750
|
}));
|
|
747
751
|
}
|
|
748
752
|
function ve(e, t) {
|
|
749
753
|
return {
|
|
750
|
-
left: `${Math.max(8, Math.min(e, window.innerWidth -
|
|
751
|
-
top: `${Math.max(8, Math.min(t, window.innerHeight -
|
|
754
|
+
left: `${Math.max(8, Math.min(e, window.innerWidth - ut - 8))}px`,
|
|
755
|
+
top: `${Math.max(8, Math.min(t, window.innerHeight - dt - 8))}px`
|
|
752
756
|
};
|
|
753
757
|
}
|
|
754
758
|
function Y() {
|
|
755
759
|
g.value = {
|
|
756
760
|
...g.value,
|
|
757
761
|
visible: !1
|
|
758
|
-
},
|
|
759
|
-
...
|
|
762
|
+
}, _.value = {
|
|
763
|
+
..._.value,
|
|
760
764
|
visible: !1
|
|
761
765
|
};
|
|
762
766
|
}
|
|
@@ -765,15 +769,15 @@ var q = {
|
|
|
765
769
|
path: t,
|
|
766
770
|
style: ve(e.clientX, e.clientY),
|
|
767
771
|
visible: !0
|
|
768
|
-
},
|
|
769
|
-
...
|
|
772
|
+
}, _.value = {
|
|
773
|
+
..._.value,
|
|
770
774
|
visible: !1
|
|
771
775
|
};
|
|
772
776
|
}
|
|
773
777
|
function be(e) {
|
|
774
778
|
e.preventDefault(), e.stopPropagation();
|
|
775
779
|
let t = m.value || d.tabs[0]?.path || "";
|
|
776
|
-
L = e.currentTarget,
|
|
780
|
+
L = e.currentTarget, _.value = {
|
|
777
781
|
path: t,
|
|
778
782
|
style: ve(e.clientX, e.clientY),
|
|
779
783
|
visible: !0
|
|
@@ -786,13 +790,13 @@ var q = {
|
|
|
786
790
|
L && document.body.contains(L) && (L.focus(), L = null);
|
|
787
791
|
}
|
|
788
792
|
function X(e) {
|
|
789
|
-
if (
|
|
793
|
+
if (q(e)) return;
|
|
790
794
|
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, !
|
|
795
|
+
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, !K(t)) : e === "new-window" ? p("newWindow", t) : e === "maximize" && ke(), v(xe);
|
|
792
796
|
}
|
|
793
797
|
function Se(e) {
|
|
794
798
|
if (e.key === "Escape") {
|
|
795
|
-
e.preventDefault(), Y(),
|
|
799
|
+
e.preventDefault(), Y(), v(xe);
|
|
796
800
|
return;
|
|
797
801
|
}
|
|
798
802
|
let t = Array.from(document.querySelectorAll("[data-menu-active=\"true\"] [role=\"menuitem\"]:not(:disabled)"));
|
|
@@ -804,7 +808,7 @@ var q = {
|
|
|
804
808
|
}
|
|
805
809
|
function Z() {
|
|
806
810
|
let e = h.value;
|
|
807
|
-
e && (w.value = e.scrollWidth > e.clientWidth + 1, T.value = e.scrollLeft <= 1,
|
|
811
|
+
e && (w.value = e.scrollWidth > e.clientWidth + 1, T.value = e.scrollLeft <= 1, E.value = e.scrollLeft + e.clientWidth >= e.scrollWidth - 1);
|
|
808
812
|
}
|
|
809
813
|
function Ce() {
|
|
810
814
|
return window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth";
|
|
@@ -822,7 +826,7 @@ var q = {
|
|
|
822
826
|
!t || !w.value || (e.preventDefault(), t.scrollBy({ left: Math.abs(e.deltaY) > Math.abs(e.deltaX) ? e.deltaY : e.deltaX }));
|
|
823
827
|
}
|
|
824
828
|
async function Ee() {
|
|
825
|
-
await
|
|
829
|
+
await v(), (h.value?.querySelector("[role=\"tab\"][aria-selected=\"true\"]"))?.scrollIntoView({
|
|
826
830
|
behavior: Ce(),
|
|
827
831
|
block: "nearest",
|
|
828
832
|
inline: "nearest"
|
|
@@ -834,7 +838,7 @@ var q = {
|
|
|
834
838
|
Oe();
|
|
835
839
|
return;
|
|
836
840
|
}
|
|
837
|
-
|
|
841
|
+
N && N.el === e || (Oe(), N = de.create(e, {
|
|
838
842
|
animation: 160,
|
|
839
843
|
draggable: ".lumal-tabs__item",
|
|
840
844
|
filter: ".is-not-draggable",
|
|
@@ -848,27 +852,27 @@ var q = {
|
|
|
848
852
|
}));
|
|
849
853
|
}
|
|
850
854
|
function Oe() {
|
|
851
|
-
|
|
855
|
+
N?.destroy(), N = void 0;
|
|
852
856
|
}
|
|
853
|
-
|
|
854
|
-
e ?
|
|
857
|
+
P(H, (e) => {
|
|
858
|
+
e ? v(De) : Oe();
|
|
855
859
|
});
|
|
856
860
|
function ke() {
|
|
857
861
|
if (d.standaloneMaximize) {
|
|
858
862
|
Ae();
|
|
859
863
|
return;
|
|
860
864
|
}
|
|
861
|
-
|
|
865
|
+
S.value = !S.value, p("maximize", S.value);
|
|
862
866
|
}
|
|
863
867
|
async function Ae() {
|
|
864
868
|
let e = document.querySelector(d.fullscreenTarget);
|
|
865
869
|
e instanceof HTMLElement && (document.fullscreenElement ? await document.exitFullscreen?.() : await e.requestFullscreen?.());
|
|
866
870
|
}
|
|
867
871
|
function Q() {
|
|
868
|
-
|
|
872
|
+
S.value = !!document.fullscreenElement && d.standaloneMaximize, d.standaloneMaximize && p("maximize", S.value);
|
|
869
873
|
}
|
|
870
874
|
function je(e) {
|
|
871
|
-
d.standaloneMaximize || (
|
|
875
|
+
d.standaloneMaximize || (S.value = e);
|
|
872
876
|
}
|
|
873
877
|
n({
|
|
874
878
|
getTabsElement: () => h.value,
|
|
@@ -876,21 +880,21 @@ var q = {
|
|
|
876
880
|
scrollTabs: we,
|
|
877
881
|
toggleFullscreen: ke,
|
|
878
882
|
setMaximized: je
|
|
879
|
-
}),
|
|
883
|
+
}), P(() => [d.activePath, d.tabs.length], () => void Ee(), { flush: "post" }), P(() => d.tabs, () => void v(Z), { flush: "post" });
|
|
880
884
|
function Me(e) {
|
|
881
885
|
let t = e.target;
|
|
882
886
|
t && (t.closest?.(".lumal-tabs-context-menu") || t.closest?.("[data-tab-menu-trigger]") || Y());
|
|
883
887
|
}
|
|
884
888
|
function Ne(e) {
|
|
885
|
-
e.key === "Escape" && R.value.visible && (e.preventDefault(), Y(),
|
|
889
|
+
e.key === "Escape" && R.value.visible && (e.preventDefault(), Y(), v(xe));
|
|
886
890
|
}
|
|
887
891
|
return te(() => {
|
|
888
|
-
se(), document.addEventListener("click", Me), document.addEventListener("fullscreenchange", Q), document.addEventListener("keydown", Ne), Z(), typeof ResizeObserver < "u" && h.value && (
|
|
892
|
+
se(), document.addEventListener("click", Me), document.addEventListener("fullscreenchange", Q), document.addEventListener("keydown", Ne), Z(), typeof ResizeObserver < "u" && h.value && (A = new ResizeObserver(Z), A.observe(h.value)), H.value && v(De);
|
|
889
893
|
}), ee(() => {
|
|
890
|
-
V(), document.removeEventListener("click", Me), document.removeEventListener("fullscreenchange", Q), document.removeEventListener("keydown", Ne),
|
|
891
|
-
}), (n, i) => e.visible && e.tabs.length ? (
|
|
894
|
+
V(), document.removeEventListener("click", Me), document.removeEventListener("fullscreenchange", Q), document.removeEventListener("keydown", Ne), A?.disconnect(), Oe();
|
|
895
|
+
}), (n, i) => e.visible && e.tabs.length ? (x(), l("div", {
|
|
892
896
|
key: 0,
|
|
893
|
-
class:
|
|
897
|
+
class: y(["lumal-tabs", [`is-style-${e.styleType}`]])
|
|
894
898
|
}, [
|
|
895
899
|
re(u("button", {
|
|
896
900
|
class: "lumal-tabs__tool",
|
|
@@ -898,10 +902,10 @@ var q = {
|
|
|
898
902
|
"aria-label": "向左滚动标签",
|
|
899
903
|
disabled: T.value,
|
|
900
904
|
onClick: i[0] ||= (e) => we("left")
|
|
901
|
-
}, [f(
|
|
905
|
+
}, [f(k(I), {
|
|
902
906
|
name: "lumal:chevron-left",
|
|
903
907
|
size: 16
|
|
904
|
-
})], 8,
|
|
908
|
+
})], 8, Ke), [[ne, w.value]]),
|
|
905
909
|
u("div", {
|
|
906
910
|
ref_key: "tabsViewportRef",
|
|
907
911
|
ref: h,
|
|
@@ -915,9 +919,9 @@ var q = {
|
|
|
915
919
|
role: "tablist",
|
|
916
920
|
"aria-label": "页面标签"
|
|
917
921
|
}, {
|
|
918
|
-
default:
|
|
922
|
+
default: F(() => [(x(!0), l(t, null, C(e.tabs, (t, n) => (x(), l("div", {
|
|
919
923
|
key: t.path,
|
|
920
|
-
class:
|
|
924
|
+
class: y(["lumal-tabs__item", {
|
|
921
925
|
"is-active": t.path === m.value,
|
|
922
926
|
"is-pinned": t.pinned === !0,
|
|
923
927
|
"is-not-draggable": t.pinned === !0 || !H.value
|
|
@@ -932,41 +936,41 @@ var q = {
|
|
|
932
936
|
onClick: (e) => J(t.path),
|
|
933
937
|
onKeydown: (e) => _e(e, n),
|
|
934
938
|
onMousedown: (e) => ge(e, t)
|
|
935
|
-
}, [t.pinned === !0 ? (
|
|
939
|
+
}, [t.pinned === !0 ? (x(), s(k(I), {
|
|
936
940
|
key: 0,
|
|
937
941
|
class: "lumal-tabs__pin",
|
|
938
942
|
name: "lumal:pin",
|
|
939
943
|
size: 14
|
|
940
|
-
})) : e.showIcon && t.icon ? (
|
|
944
|
+
})) : e.showIcon && t.icon ? (x(), s(k(I), {
|
|
941
945
|
key: 1,
|
|
942
946
|
name: t.icon,
|
|
943
947
|
size: 14
|
|
944
948
|
}, null, 8, ["name"])) : c("", !0), u("span", {
|
|
945
949
|
class: "lumal-tabs__label",
|
|
946
950
|
title: t.title
|
|
947
|
-
},
|
|
951
|
+
}, O(t.title), 9, Ye)], 40, Je), le(t.path) ? (x(), l("button", {
|
|
948
952
|
key: 0,
|
|
949
953
|
class: "lumal-tabs__close",
|
|
950
954
|
type: "button",
|
|
951
955
|
"aria-label": `关闭${t.title}`,
|
|
952
956
|
onClick: (e) => me(t.path)
|
|
953
|
-
}, [f(
|
|
957
|
+
}, [f(k(I), {
|
|
954
958
|
name: "lumal:close",
|
|
955
959
|
size: 14
|
|
956
|
-
})], 8,
|
|
960
|
+
})], 8, Xe)) : c("", !0)], 42, qe))), 128))]),
|
|
957
961
|
_: 1
|
|
958
962
|
})], 544),
|
|
959
963
|
re(u("button", {
|
|
960
964
|
class: "lumal-tabs__tool",
|
|
961
965
|
type: "button",
|
|
962
966
|
"aria-label": "向右滚动标签",
|
|
963
|
-
disabled:
|
|
967
|
+
disabled: E.value,
|
|
964
968
|
onClick: i[1] ||= (e) => we("right")
|
|
965
|
-
}, [f(
|
|
969
|
+
}, [f(k(I), {
|
|
966
970
|
name: "lumal:chevron-right",
|
|
967
971
|
size: 16
|
|
968
|
-
})], 8,
|
|
969
|
-
e.showRefresh ? (
|
|
972
|
+
})], 8, Ze), [[ne, w.value]]),
|
|
973
|
+
e.showRefresh ? (x(), l("button", {
|
|
970
974
|
key: 0,
|
|
971
975
|
class: "lumal-tabs__tool lumal-tabs__tool--refresh",
|
|
972
976
|
type: "button",
|
|
@@ -974,137 +978,131 @@ var q = {
|
|
|
974
978
|
"data-action": "refresh-current-tab",
|
|
975
979
|
disabled: !m.value,
|
|
976
980
|
onClick: i[2] ||= (e) => he(m.value)
|
|
977
|
-
}, [f(
|
|
981
|
+
}, [f(k(I), {
|
|
978
982
|
name: "lumal:refresh",
|
|
979
983
|
size: 16
|
|
980
|
-
})], 8,
|
|
981
|
-
e.showMore ? (
|
|
984
|
+
})], 8, Qe)) : c("", !0),
|
|
985
|
+
e.showMore ? (x(), l("button", {
|
|
982
986
|
key: 1,
|
|
983
987
|
class: "lumal-tabs__tool",
|
|
984
988
|
type: "button",
|
|
985
989
|
"aria-label": "更多操作",
|
|
986
990
|
"aria-haspopup": "menu",
|
|
987
|
-
"aria-expanded":
|
|
991
|
+
"aria-expanded": _.value.visible,
|
|
988
992
|
"data-tab-menu-trigger": "",
|
|
989
993
|
onClick: i[3] ||= (e) => be(e)
|
|
990
|
-
}, [f(
|
|
994
|
+
}, [f(k(I), {
|
|
991
995
|
name: "lumal:more",
|
|
992
996
|
size: 16
|
|
993
|
-
})], 8,
|
|
994
|
-
e.showMaximize ? (
|
|
997
|
+
})], 8, $e)) : c("", !0),
|
|
998
|
+
e.showMaximize ? (x(), l("button", {
|
|
995
999
|
key: 2,
|
|
996
1000
|
class: "lumal-tabs__tool lumal-tabs__tool--maximize",
|
|
997
1001
|
type: "button",
|
|
998
|
-
"aria-label":
|
|
1002
|
+
"aria-label": S.value ? "退出内容最大化" : "内容最大化",
|
|
999
1003
|
"data-action": "maximize-content",
|
|
1000
1004
|
onClick: ke
|
|
1001
|
-
}, [f(
|
|
1002
|
-
name:
|
|
1005
|
+
}, [f(k(I), {
|
|
1006
|
+
name: S.value ? "lumal:restore" : "lumal:maximize",
|
|
1007
|
+
morph: "",
|
|
1003
1008
|
size: 16
|
|
1004
|
-
}, null, 8, ["name"])], 8,
|
|
1005
|
-
(
|
|
1009
|
+
}, null, 8, ["name"])], 8, et)) : c("", !0),
|
|
1010
|
+
(x(), s(r, { to: "body" }, [g.value.visible || _.value.visible ? (x(), l("div", {
|
|
1006
1011
|
key: 0,
|
|
1007
1012
|
class: "lumal-tabs-context-menu",
|
|
1008
1013
|
role: "menu",
|
|
1009
1014
|
"data-menu-active": !0,
|
|
1010
|
-
style:
|
|
1015
|
+
style: b(R.value.style),
|
|
1011
1016
|
onClick: i[13] ||= ie(() => {}, ["stop"]),
|
|
1012
1017
|
onKeydown: Se
|
|
1013
1018
|
}, [
|
|
1014
1019
|
u("button", {
|
|
1015
1020
|
type: "button",
|
|
1016
1021
|
role: "menuitem",
|
|
1017
|
-
disabled:
|
|
1022
|
+
disabled: q("refresh"),
|
|
1018
1023
|
onClick: i[4] ||= (e) => X("refresh")
|
|
1019
|
-
}, [f(
|
|
1024
|
+
}, [f(k(I), {
|
|
1020
1025
|
name: "lumal:refresh",
|
|
1021
1026
|
size: 14
|
|
1022
|
-
}), i[14] ||= u("span", null, "重新加载", -1)], 8,
|
|
1027
|
+
}), i[14] ||= u("span", null, "重新加载", -1)], 8, tt),
|
|
1023
1028
|
u("button", {
|
|
1024
1029
|
type: "button",
|
|
1025
1030
|
role: "menuitem",
|
|
1026
|
-
disabled:
|
|
1031
|
+
disabled: q("pin"),
|
|
1027
1032
|
onClick: i[5] ||= (e) => X("pin")
|
|
1028
|
-
}, [f(
|
|
1029
|
-
name:
|
|
1033
|
+
}, [f(k(I), {
|
|
1034
|
+
name: K(ae.value) ? "lumal:pin-off" : "lumal:pin",
|
|
1030
1035
|
size: 14
|
|
1031
|
-
}, null, 8, ["name"]), u("span", null,
|
|
1036
|
+
}, null, 8, ["name"]), u("span", null, O(fe(ae.value)), 1)], 8, nt),
|
|
1032
1037
|
u("button", {
|
|
1033
1038
|
type: "button",
|
|
1034
1039
|
role: "menuitem",
|
|
1035
|
-
disabled:
|
|
1040
|
+
disabled: q("maximize"),
|
|
1036
1041
|
onClick: i[6] ||= (e) => X("maximize")
|
|
1037
|
-
}, [f(
|
|
1038
|
-
name:
|
|
1042
|
+
}, [f(k(I), {
|
|
1043
|
+
name: S.value ? "lumal:restore" : "lumal:maximize",
|
|
1044
|
+
morph: "",
|
|
1039
1045
|
size: 14
|
|
1040
|
-
}, null, 8, ["name"]), u("span", null,
|
|
1046
|
+
}, null, 8, ["name"]), u("span", null, O(pe()), 1)], 8, rt),
|
|
1041
1047
|
u("button", {
|
|
1042
1048
|
type: "button",
|
|
1043
1049
|
role: "menuitem",
|
|
1044
|
-
disabled:
|
|
1050
|
+
disabled: q("new-window"),
|
|
1045
1051
|
onClick: i[7] ||= (e) => X("new-window")
|
|
1046
|
-
}, [f(
|
|
1052
|
+
}, [f(k(I), {
|
|
1047
1053
|
name: "lumal:external-link",
|
|
1048
1054
|
size: 14
|
|
1049
|
-
}), i[15] ||= u("span", null, "在新窗口打开", -1)], 8,
|
|
1055
|
+
}), i[15] ||= u("span", null, "在新窗口打开", -1)], 8, it),
|
|
1050
1056
|
i[21] ||= u("span", { class: "lumal-tabs-context-menu__divider" }, null, -1),
|
|
1051
1057
|
u("button", {
|
|
1052
1058
|
type: "button",
|
|
1053
1059
|
role: "menuitem",
|
|
1054
|
-
disabled:
|
|
1060
|
+
disabled: q("close"),
|
|
1055
1061
|
onClick: i[8] ||= (e) => X("close")
|
|
1056
|
-
}, [f(
|
|
1062
|
+
}, [f(k(I), {
|
|
1057
1063
|
name: "lumal:close",
|
|
1058
1064
|
size: 14
|
|
1059
|
-
}), i[16] ||= u("span", null, "关闭", -1)], 8,
|
|
1065
|
+
}), i[16] ||= u("span", null, "关闭", -1)], 8, at),
|
|
1060
1066
|
u("button", {
|
|
1061
1067
|
type: "button",
|
|
1062
1068
|
role: "menuitem",
|
|
1063
|
-
disabled:
|
|
1069
|
+
disabled: q("close-left"),
|
|
1064
1070
|
onClick: i[9] ||= (e) => X("close-left")
|
|
1065
|
-
}, [f(
|
|
1071
|
+
}, [f(k(I), {
|
|
1066
1072
|
name: "lumal:chevron-left",
|
|
1067
1073
|
size: 14
|
|
1068
|
-
}), i[17] ||= u("span", null, "关闭左侧", -1)], 8,
|
|
1074
|
+
}), i[17] ||= u("span", null, "关闭左侧", -1)], 8, ot),
|
|
1069
1075
|
u("button", {
|
|
1070
1076
|
type: "button",
|
|
1071
1077
|
role: "menuitem",
|
|
1072
|
-
disabled:
|
|
1078
|
+
disabled: q("close-right"),
|
|
1073
1079
|
onClick: i[10] ||= (e) => X("close-right")
|
|
1074
|
-
}, [f(
|
|
1080
|
+
}, [f(k(I), {
|
|
1075
1081
|
name: "lumal:chevron-right",
|
|
1076
1082
|
size: 14
|
|
1077
|
-
}), i[18] ||= u("span", null, "关闭右侧", -1)], 8,
|
|
1083
|
+
}), i[18] ||= u("span", null, "关闭右侧", -1)], 8, st),
|
|
1078
1084
|
u("button", {
|
|
1079
1085
|
type: "button",
|
|
1080
1086
|
role: "menuitem",
|
|
1081
|
-
disabled:
|
|
1087
|
+
disabled: q("close-others"),
|
|
1082
1088
|
onClick: i[11] ||= (e) => X("close-others")
|
|
1083
|
-
}, [f(
|
|
1089
|
+
}, [f(k(I), {
|
|
1084
1090
|
name: "lumal:close",
|
|
1085
1091
|
size: 14
|
|
1086
|
-
}), i[19] ||= u("span", null, "关闭其他", -1)], 8,
|
|
1092
|
+
}), i[19] ||= u("span", null, "关闭其他", -1)], 8, ct),
|
|
1087
1093
|
u("button", {
|
|
1088
1094
|
type: "button",
|
|
1089
1095
|
role: "menuitem",
|
|
1090
|
-
disabled:
|
|
1096
|
+
disabled: q("close-all"),
|
|
1091
1097
|
onClick: i[12] ||= (e) => X("close-all")
|
|
1092
|
-
}, [f(
|
|
1098
|
+
}, [f(k(I), {
|
|
1093
1099
|
name: "lumal:close",
|
|
1094
1100
|
size: 14
|
|
1095
|
-
}), i[20] ||= u("span", null, "关闭全部", -1)], 8,
|
|
1101
|
+
}), i[20] ||= u("span", null, "关闭全部", -1)], 8, lt)
|
|
1096
1102
|
], 36)) : c("", !0)]))
|
|
1097
1103
|
], 2)) : c("", !0);
|
|
1098
1104
|
}
|
|
1099
|
-
}), [["__scopeId", "data-v-
|
|
1100
|
-
key: 1,
|
|
1101
|
-
class: "lumal-top-nav-menu-item__external",
|
|
1102
|
-
"aria-hidden": "true"
|
|
1103
|
-
}, _t = { class: "lumal-top-nav-menu-item__label" }, vt = { class: "lumal-top-nav-menu-item__label" }, yt = {
|
|
1104
|
-
key: 1,
|
|
1105
|
-
class: "lumal-top-nav-menu-item__external",
|
|
1106
|
-
"aria-hidden": "true"
|
|
1107
|
-
}, bt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
1105
|
+
}), [["__scopeId", "data-v-d6a33e63"]]), pt = { class: "lumal-top-nav-menu-item__label" }, mt = { class: "lumal-top-nav-menu-item__label" }, ht = { class: "lumal-top-nav-menu-item__label" }, gt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
1108
1106
|
__name: "LumalTopNavMenuItem",
|
|
1109
1107
|
props: {
|
|
1110
1108
|
activePath: { default: "" },
|
|
@@ -1117,19 +1115,19 @@ var q = {
|
|
|
1117
1115
|
i("select", e);
|
|
1118
1116
|
}
|
|
1119
1117
|
return (n, r) => {
|
|
1120
|
-
let i =
|
|
1121
|
-
return a.value.length ? (
|
|
1118
|
+
let i = T("LumalTopNavMenuItem", !0);
|
|
1119
|
+
return a.value.length ? (x(), s(k(H), {
|
|
1122
1120
|
key: 0,
|
|
1123
1121
|
index: e.item.path,
|
|
1124
|
-
class:
|
|
1122
|
+
class: y({ "is-active": p.value })
|
|
1125
1123
|
}, {
|
|
1126
|
-
title:
|
|
1127
|
-
e.item.icon ? (
|
|
1124
|
+
title: F(() => [
|
|
1125
|
+
e.item.icon ? (x(), s(k(I), {
|
|
1128
1126
|
key: 0,
|
|
1129
1127
|
name: e.item.icon,
|
|
1130
1128
|
size: 16
|
|
1131
1129
|
}, null, 8, ["name"])) : c("", !0),
|
|
1132
|
-
u("span",
|
|
1130
|
+
u("span", pt, [u("span", null, O(e.item.title), 1), f($, {
|
|
1133
1131
|
badge: e.item.badge,
|
|
1134
1132
|
label: e.item.title,
|
|
1135
1133
|
tone: e.item.badgeTone,
|
|
@@ -1140,28 +1138,33 @@ var q = {
|
|
|
1140
1138
|
"tone",
|
|
1141
1139
|
"type"
|
|
1142
1140
|
])]),
|
|
1143
|
-
e.item.externalLink ? (
|
|
1141
|
+
e.item.externalLink ? (x(), s(k(I), {
|
|
1142
|
+
key: 1,
|
|
1143
|
+
class: "lumal-top-nav-menu-item__external",
|
|
1144
|
+
name: "lumal:external-link",
|
|
1145
|
+
size: 12
|
|
1146
|
+
})) : c("", !0)
|
|
1144
1147
|
]),
|
|
1145
|
-
default:
|
|
1148
|
+
default: F(() => [(x(!0), l(t, null, C(a.value, (t) => (x(), s(i, {
|
|
1146
1149
|
key: t.path,
|
|
1147
1150
|
item: t,
|
|
1148
1151
|
"active-path": e.activePath,
|
|
1149
1152
|
onSelect: m
|
|
1150
1153
|
}, null, 8, ["item", "active-path"]))), 128))]),
|
|
1151
1154
|
_: 1
|
|
1152
|
-
}, 8, ["index", "class"])) : d.value ? (
|
|
1155
|
+
}, 8, ["index", "class"])) : d.value ? (x(), l("li", {
|
|
1153
1156
|
key: 1,
|
|
1154
|
-
class:
|
|
1157
|
+
class: y(["el-menu-item lumal-top-nav-menu-item--external", { "is-active": p.value }]),
|
|
1155
1158
|
role: "menuitem",
|
|
1156
1159
|
tabindex: "-1",
|
|
1157
1160
|
onClick: r[0] ||= (t) => m(e.item.path)
|
|
1158
1161
|
}, [
|
|
1159
|
-
e.item.icon ? (
|
|
1162
|
+
e.item.icon ? (x(), s(k(I), {
|
|
1160
1163
|
key: 0,
|
|
1161
1164
|
name: e.item.icon,
|
|
1162
1165
|
size: 16
|
|
1163
1166
|
}, null, 8, ["name"])) : c("", !0),
|
|
1164
|
-
u("span",
|
|
1167
|
+
u("span", mt, [u("span", null, O(e.item.title), 1), f($, {
|
|
1165
1168
|
badge: e.item.badge,
|
|
1166
1169
|
label: e.item.title,
|
|
1167
1170
|
tone: e.item.badgeTone,
|
|
@@ -1172,23 +1175,24 @@ var q = {
|
|
|
1172
1175
|
"tone",
|
|
1173
1176
|
"type"
|
|
1174
1177
|
])]),
|
|
1175
|
-
|
|
1178
|
+
f(k(I), {
|
|
1176
1179
|
class: "lumal-top-nav-menu-item__external",
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
+
name: "lumal:external-link",
|
|
1181
|
+
size: 12
|
|
1182
|
+
})
|
|
1183
|
+
], 2)) : (x(), s(k(se), {
|
|
1180
1184
|
key: 2,
|
|
1181
1185
|
index: e.item.path,
|
|
1182
|
-
class:
|
|
1186
|
+
class: y({ "is-active": p.value }),
|
|
1183
1187
|
onClick: r[1] ||= (t) => m(e.item.path)
|
|
1184
1188
|
}, {
|
|
1185
|
-
default:
|
|
1186
|
-
e.item.icon ? (
|
|
1189
|
+
default: F(() => [
|
|
1190
|
+
e.item.icon ? (x(), s(k(I), {
|
|
1187
1191
|
key: 0,
|
|
1188
1192
|
name: e.item.icon,
|
|
1189
1193
|
size: 16
|
|
1190
1194
|
}, null, 8, ["name"])) : c("", !0),
|
|
1191
|
-
u("span",
|
|
1195
|
+
u("span", ht, [u("span", null, O(e.item.title), 1), f($, {
|
|
1192
1196
|
badge: e.item.badge,
|
|
1193
1197
|
label: e.item.title,
|
|
1194
1198
|
tone: e.item.badgeTone,
|
|
@@ -1199,17 +1203,18 @@ var q = {
|
|
|
1199
1203
|
"tone",
|
|
1200
1204
|
"type"
|
|
1201
1205
|
])]),
|
|
1202
|
-
e.item.externalLink ? (
|
|
1206
|
+
e.item.externalLink ? (x(), s(k(I), {
|
|
1207
|
+
key: 1,
|
|
1208
|
+
class: "lumal-top-nav-menu-item__external",
|
|
1209
|
+
name: "lumal:external-link",
|
|
1210
|
+
size: 12
|
|
1211
|
+
})) : c("", !0)
|
|
1203
1212
|
]),
|
|
1204
1213
|
_: 1
|
|
1205
1214
|
}, 8, ["index", "class"]));
|
|
1206
1215
|
};
|
|
1207
1216
|
}
|
|
1208
|
-
}), [["__scopeId", "data-v-
|
|
1209
|
-
key: 1,
|
|
1210
|
-
class: "lumal-top-nav__external",
|
|
1211
|
-
"aria-hidden": "true"
|
|
1212
|
-
}, Ct = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
1217
|
+
}), [["__scopeId", "data-v-71cabfc8"]]), _t = { class: "lumal-top-nav__label" }, vt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
1213
1218
|
__name: "LumalTopNav",
|
|
1214
1219
|
props: {
|
|
1215
1220
|
activePath: { default: "" },
|
|
@@ -1220,14 +1225,14 @@ var q = {
|
|
|
1220
1225
|
},
|
|
1221
1226
|
emits: ["select"],
|
|
1222
1227
|
setup(e, { expose: n, emit: r }) {
|
|
1223
|
-
let i = e, a = r, d =
|
|
1228
|
+
let i = e, a = r, d = M("menuRef"), p = o(() => i.menus.filter((e) => !e.hidden));
|
|
1224
1229
|
function m(e) {
|
|
1225
1230
|
return !!e.externalLink && e.externalTarget !== "_self";
|
|
1226
1231
|
}
|
|
1227
1232
|
function h(e) {
|
|
1228
1233
|
return i.activePath ? i.mode === "flat" ? e.path === i.activePath : U(e, i.activePath) : !1;
|
|
1229
1234
|
}
|
|
1230
|
-
function
|
|
1235
|
+
function g(e) {
|
|
1231
1236
|
let t = h(e);
|
|
1232
1237
|
return m(e) ? {
|
|
1233
1238
|
class: [
|
|
@@ -1242,36 +1247,36 @@ var q = {
|
|
|
1242
1247
|
index: e.path
|
|
1243
1248
|
};
|
|
1244
1249
|
}
|
|
1245
|
-
let
|
|
1246
|
-
function
|
|
1250
|
+
let v = o(() => ({ "--lumal-top-nav-max-width": typeof i.maxWidth == "number" ? `${i.maxWidth}px` : i.maxWidth }));
|
|
1251
|
+
function ee(e) {
|
|
1247
1252
|
a("select", e);
|
|
1248
1253
|
}
|
|
1249
1254
|
return n({
|
|
1250
1255
|
getMenuElement: () => d.value?.$el,
|
|
1251
1256
|
getMenuInstance: () => d.value
|
|
1252
|
-
}), (n, r) => (
|
|
1257
|
+
}), (n, r) => (x(), s(k(B), {
|
|
1253
1258
|
key: `top-nav:${e.mode}:${e.activePath}`,
|
|
1254
1259
|
ref_key: "menuRef",
|
|
1255
1260
|
ref: d,
|
|
1256
|
-
class:
|
|
1261
|
+
class: y(["lumal-top-nav", `is-align-${e.align}`]),
|
|
1257
1262
|
mode: "horizontal",
|
|
1258
1263
|
"default-active": e.activePath,
|
|
1259
1264
|
ellipsis: !0,
|
|
1260
|
-
style:
|
|
1265
|
+
style: b(v.value)
|
|
1261
1266
|
}, {
|
|
1262
|
-
default:
|
|
1267
|
+
default: F(() => [(x(!0), l(t, null, C(e.mode === "tree" ? p.value : [], (t) => (x(), s(gt, {
|
|
1263
1268
|
key: `tree:${t.path}`,
|
|
1264
1269
|
item: t,
|
|
1265
1270
|
"active-path": e.activePath,
|
|
1266
|
-
onSelect:
|
|
1267
|
-
}, null, 8, ["item", "active-path"]))), 128)), (
|
|
1268
|
-
default:
|
|
1269
|
-
e.icon ? (
|
|
1271
|
+
onSelect: ee
|
|
1272
|
+
}, null, 8, ["item", "active-path"]))), 128)), (x(!0), l(t, null, C(e.mode === "flat" ? p.value : [], (e) => (x(), s(E(m(e) ? "li" : k(se)), _({ key: `flat:${e.path}` }, { ref_for: !0 }, g(e), { onClick: (t) => ee(e.path) }), {
|
|
1273
|
+
default: F(() => [
|
|
1274
|
+
e.icon ? (x(), s(k(I), {
|
|
1270
1275
|
key: 0,
|
|
1271
1276
|
name: e.icon,
|
|
1272
1277
|
size: 16
|
|
1273
1278
|
}, null, 8, ["name"])) : c("", !0),
|
|
1274
|
-
u("span",
|
|
1279
|
+
u("span", _t, [u("span", null, O(e.title), 1), f($, {
|
|
1275
1280
|
badge: e.badge,
|
|
1276
1281
|
label: e.title,
|
|
1277
1282
|
tone: e.badgeTone,
|
|
@@ -1282,7 +1287,12 @@ var q = {
|
|
|
1282
1287
|
"tone",
|
|
1283
1288
|
"type"
|
|
1284
1289
|
])]),
|
|
1285
|
-
e.externalLink ? (
|
|
1290
|
+
e.externalLink ? (x(), s(k(I), {
|
|
1291
|
+
key: 1,
|
|
1292
|
+
class: "lumal-top-nav__external",
|
|
1293
|
+
name: "lumal:external-link",
|
|
1294
|
+
size: 12
|
|
1295
|
+
})) : c("", !0)
|
|
1286
1296
|
]),
|
|
1287
1297
|
_: 2
|
|
1288
1298
|
}, 1040, ["onClick"]))), 128))]),
|
|
@@ -1293,14 +1303,14 @@ var q = {
|
|
|
1293
1303
|
"style"
|
|
1294
1304
|
]));
|
|
1295
1305
|
}
|
|
1296
|
-
}), [["__scopeId", "data-v-
|
|
1297
|
-
function
|
|
1306
|
+
}), [["__scopeId", "data-v-3669f4a6"]]), yt = 1, bt = 50;
|
|
1307
|
+
function xt(e) {
|
|
1298
1308
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1299
1309
|
}
|
|
1300
|
-
function
|
|
1301
|
-
return
|
|
1310
|
+
function St(e) {
|
|
1311
|
+
return xt(e) ? typeof e.path == "string" && typeof e.title == "string" : !1;
|
|
1302
1312
|
}
|
|
1303
|
-
function
|
|
1313
|
+
function Ct(e) {
|
|
1304
1314
|
let t = Math.max(1, e.maxHistory ?? 50), n = e.history.slice(0, t);
|
|
1305
1315
|
return {
|
|
1306
1316
|
v: 1,
|
|
@@ -1314,7 +1324,7 @@ function Ot(e) {
|
|
|
1314
1324
|
history: n
|
|
1315
1325
|
};
|
|
1316
1326
|
}
|
|
1317
|
-
function
|
|
1327
|
+
function wt(e) {
|
|
1318
1328
|
if (!e) return;
|
|
1319
1329
|
let t;
|
|
1320
1330
|
try {
|
|
@@ -1322,27 +1332,27 @@ function kt(e) {
|
|
|
1322
1332
|
} catch {
|
|
1323
1333
|
return;
|
|
1324
1334
|
}
|
|
1325
|
-
return !
|
|
1335
|
+
return !xt(t) || t.v !== 1 || !Array.isArray(t.tabs) || !Array.isArray(t.history) || !t.history.every((e) => typeof e == "string") ? void 0 : {
|
|
1326
1336
|
v: 1,
|
|
1327
|
-
tabs: t.tabs.filter(
|
|
1337
|
+
tabs: t.tabs.filter(St),
|
|
1328
1338
|
history: t.history
|
|
1329
1339
|
};
|
|
1330
1340
|
}
|
|
1331
|
-
function
|
|
1341
|
+
function Tt(e, t, n) {
|
|
1332
1342
|
try {
|
|
1333
1343
|
return e.setItem(t, JSON.stringify(n)), !0;
|
|
1334
1344
|
} catch {
|
|
1335
1345
|
return !1;
|
|
1336
1346
|
}
|
|
1337
1347
|
}
|
|
1338
|
-
function
|
|
1348
|
+
function Et(e, t) {
|
|
1339
1349
|
let n = null;
|
|
1340
1350
|
try {
|
|
1341
1351
|
n = e.getItem(t);
|
|
1342
1352
|
} catch {
|
|
1343
1353
|
return;
|
|
1344
1354
|
}
|
|
1345
|
-
let r =
|
|
1355
|
+
let r = wt(n);
|
|
1346
1356
|
if (n) {
|
|
1347
1357
|
if (!r) {
|
|
1348
1358
|
try {
|
|
@@ -1353,12 +1363,12 @@ function jt(e, t) {
|
|
|
1353
1363
|
return r;
|
|
1354
1364
|
}
|
|
1355
1365
|
}
|
|
1356
|
-
function
|
|
1366
|
+
function Dt(e, t) {
|
|
1357
1367
|
try {
|
|
1358
1368
|
e.removeItem(t);
|
|
1359
1369
|
} catch {}
|
|
1360
1370
|
}
|
|
1361
|
-
function
|
|
1371
|
+
function Ot(e, t) {
|
|
1362
1372
|
let n = t.fixedTabs.map((e) => ({
|
|
1363
1373
|
...e,
|
|
1364
1374
|
pinned: !0,
|
|
@@ -1401,13 +1411,13 @@ function Nt(e, t) {
|
|
|
1401
1411
|
}
|
|
1402
1412
|
//#endregion
|
|
1403
1413
|
//#region src/layout/state/tab-strategy.ts
|
|
1404
|
-
function
|
|
1414
|
+
function kt(e) {
|
|
1405
1415
|
return [...e].sort((e, t) => {
|
|
1406
1416
|
let n = +(e.pinned === !0);
|
|
1407
1417
|
return +(t.pinned === !0) - n;
|
|
1408
1418
|
});
|
|
1409
1419
|
}
|
|
1410
|
-
function
|
|
1420
|
+
function At(e, t, n = {}) {
|
|
1411
1421
|
let r = e.some((e) => e.path === t.path) ? [...e] : [...e, t], i = n.maxCount ?? 0;
|
|
1412
1422
|
if (i <= 0 || r.length <= i) return r;
|
|
1413
1423
|
let a = [...r];
|
|
@@ -1418,7 +1428,7 @@ function Ft(e, t, n = {}) {
|
|
|
1418
1428
|
}
|
|
1419
1429
|
return a;
|
|
1420
1430
|
}
|
|
1421
|
-
function
|
|
1431
|
+
function jt(e, t, n) {
|
|
1422
1432
|
if (t <= 0 || e.length <= t) return [...e];
|
|
1423
1433
|
let r = [...e];
|
|
1424
1434
|
for (; r.length > t;) {
|
|
@@ -1428,53 +1438,53 @@ function It(e, t, n) {
|
|
|
1428
1438
|
}
|
|
1429
1439
|
return r;
|
|
1430
1440
|
}
|
|
1431
|
-
function
|
|
1441
|
+
function Mt(e, t) {
|
|
1432
1442
|
return e.filter((e) => !(e.path === t && e.closable !== !1 && e.pinned !== !0));
|
|
1433
1443
|
}
|
|
1434
|
-
function
|
|
1444
|
+
function Nt(e, t) {
|
|
1435
1445
|
let n = e.findIndex((e) => e.path === t);
|
|
1436
1446
|
return n <= 0 ? [...e] : e.filter((e, t) => t >= n || e.closable === !1 || e.pinned === !0);
|
|
1437
1447
|
}
|
|
1438
|
-
function
|
|
1448
|
+
function Pt(e, t) {
|
|
1439
1449
|
let n = e.findIndex((e) => e.path === t);
|
|
1440
1450
|
return n === -1 || n >= e.length - 1 ? [...e] : e.filter((e, t) => t <= n || e.closable === !1 || e.pinned === !0);
|
|
1441
1451
|
}
|
|
1442
|
-
function
|
|
1452
|
+
function Ft(e, t) {
|
|
1443
1453
|
return e.filter((e) => e.path === t || e.closable === !1 || e.pinned === !0);
|
|
1444
1454
|
}
|
|
1445
|
-
function
|
|
1455
|
+
function It(e) {
|
|
1446
1456
|
let t = e.filter((e) => e.closable === !1 || e.pinned === !0);
|
|
1447
1457
|
return t.length > 0 ? t : e.length > 0 ? [e[0]] : [];
|
|
1448
1458
|
}
|
|
1449
|
-
function
|
|
1459
|
+
function Lt(e, t) {
|
|
1450
1460
|
let n = !1, r = e.map((e) => e.path === t ? (n = !0, {
|
|
1451
1461
|
...e,
|
|
1452
1462
|
pinned: !0
|
|
1453
1463
|
}) : e);
|
|
1454
|
-
return n ?
|
|
1464
|
+
return n ? kt(r) : r;
|
|
1455
1465
|
}
|
|
1456
|
-
function
|
|
1466
|
+
function Rt(e, t) {
|
|
1457
1467
|
return e.map((e) => e.path === t && e.closable !== !1 ? {
|
|
1458
1468
|
...e,
|
|
1459
1469
|
pinned: !1
|
|
1460
1470
|
} : e);
|
|
1461
1471
|
}
|
|
1462
|
-
function
|
|
1472
|
+
function zt(e) {
|
|
1463
1473
|
return e.closable === !1;
|
|
1464
1474
|
}
|
|
1465
|
-
function
|
|
1475
|
+
function Bt(e) {
|
|
1466
1476
|
return e.pinned === !0 && e.closable !== !1;
|
|
1467
1477
|
}
|
|
1468
|
-
function
|
|
1478
|
+
function Vt(e) {
|
|
1469
1479
|
return e.pinned !== !0 && e.closable !== !1;
|
|
1470
1480
|
}
|
|
1471
|
-
var
|
|
1472
|
-
function
|
|
1481
|
+
var Ht = 50;
|
|
1482
|
+
function Ut(e, t, n = {}) {
|
|
1473
1483
|
if (!t) return [...e];
|
|
1474
|
-
let r = n.maxCount ??
|
|
1484
|
+
let r = n.maxCount ?? Ht;
|
|
1475
1485
|
return [t, ...e.filter((e) => e !== t)].slice(0, Math.max(1, r));
|
|
1476
1486
|
}
|
|
1477
|
-
function
|
|
1487
|
+
function Wt(e, t, n = [], r = {}) {
|
|
1478
1488
|
if (e.length === 0) return "";
|
|
1479
1489
|
if (r.useHistory && n.length > 0) {
|
|
1480
1490
|
let r = new Set(e.map((e) => e.path));
|
|
@@ -1489,20 +1499,20 @@ function Yt(e, t, n = [], r = {}) {
|
|
|
1489
1499
|
}
|
|
1490
1500
|
return e[0]?.path ?? "";
|
|
1491
1501
|
}
|
|
1492
|
-
function
|
|
1502
|
+
function Gt(e, t, n) {
|
|
1493
1503
|
let r = e.findIndex((e) => e.path === t), i = e.findIndex((e) => e.path === n);
|
|
1494
1504
|
if (r === -1 || i === -1 || r === i || e[r].pinned === !0 != (e[i].pinned === !0)) return [...e];
|
|
1495
1505
|
let a = [...e], [o] = a.splice(r, 1);
|
|
1496
1506
|
return o && a.splice(i, 0, o), a;
|
|
1497
1507
|
}
|
|
1498
|
-
function
|
|
1508
|
+
function Kt(e, t = {}) {
|
|
1499
1509
|
return t.enable === !1 ? [] : e.map((e) => e.path);
|
|
1500
1510
|
}
|
|
1501
1511
|
//#endregion
|
|
1502
1512
|
//#region src/layout/LumalLayout.vue
|
|
1503
|
-
var
|
|
1513
|
+
var qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
1504
1514
|
__name: "LumalLayout",
|
|
1505
|
-
props: /*@__PURE__*/
|
|
1515
|
+
props: /*@__PURE__*/ g({
|
|
1506
1516
|
title: {},
|
|
1507
1517
|
menus: { default: () => [] },
|
|
1508
1518
|
preferences: {},
|
|
@@ -1530,7 +1540,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1530
1540
|
activeTabPath: {},
|
|
1531
1541
|
activeTabPathModifiers: {}
|
|
1532
1542
|
}),
|
|
1533
|
-
emits: /*@__PURE__*/
|
|
1543
|
+
emits: /*@__PURE__*/ g([
|
|
1534
1544
|
"menuSelect",
|
|
1535
1545
|
"topMenuSelect",
|
|
1536
1546
|
"toggleSidebar",
|
|
@@ -1548,11 +1558,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1548
1558
|
"tabsChange"
|
|
1549
1559
|
], ["update:activeTabPath"]),
|
|
1550
1560
|
setup(e, { expose: t, emit: n }) {
|
|
1551
|
-
let r = e, a = n, u =
|
|
1552
|
-
function
|
|
1561
|
+
let r = e, a = n, u = j(e, "activeTabPath"), p = h(le, void 0), m = h(ue, void 0), g = M("layoutRef"), _ = M("tabsRef"), v = D(!1), b = D(!1), S = D(!1), C = D([]), T = D(""), E = D([]), O = o(() => r.tabMaxCount ?? r.preferences.tabbar.maxCount), A;
|
|
1562
|
+
function N(e) {
|
|
1553
1563
|
return e.meta.layout !== "public" && e.meta.hideInTab !== !0 && !!e.meta.title;
|
|
1554
1564
|
}
|
|
1555
|
-
function
|
|
1565
|
+
function ie(e) {
|
|
1556
1566
|
let t = typeof e.meta.title == "string" ? e.meta.title : void 0;
|
|
1557
1567
|
if (t) return {
|
|
1558
1568
|
closable: e.meta.affixTab !== !0,
|
|
@@ -1577,11 +1587,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1577
1587
|
title: e.title
|
|
1578
1588
|
};
|
|
1579
1589
|
}
|
|
1580
|
-
function
|
|
1590
|
+
function R() {
|
|
1581
1591
|
if (r.isValidTabPath) return r.isValidTabPath;
|
|
1582
|
-
if (!(!
|
|
1592
|
+
if (!(!m || !r.routeDriven)) return (e) => {
|
|
1583
1593
|
try {
|
|
1584
|
-
let t =
|
|
1594
|
+
let t = m.resolve(e)?.matched ?? [], n = t[t.length - 1];
|
|
1585
1595
|
return n ? n.meta?.layout !== "public" && n.meta?.hideInTab !== !0 : !1;
|
|
1586
1596
|
} catch {
|
|
1587
1597
|
return !1;
|
|
@@ -1589,8 +1599,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1589
1599
|
};
|
|
1590
1600
|
}
|
|
1591
1601
|
function oe(e) {
|
|
1592
|
-
if (!(!
|
|
1593
|
-
let t =
|
|
1602
|
+
if (!(!m || !r.routeDriven)) try {
|
|
1603
|
+
let t = m.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;
|
|
1594
1604
|
return !r && !i ? void 0 : {
|
|
1595
1605
|
icon: i,
|
|
1596
1606
|
title: r
|
|
@@ -1600,14 +1610,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1600
1610
|
}
|
|
1601
1611
|
}
|
|
1602
1612
|
function z(e) {
|
|
1603
|
-
if (!r.routeDriven || !(r.routeTabFilter ??
|
|
1604
|
-
let t = (r.routeTabResolver ??
|
|
1613
|
+
if (!r.routeDriven || !(r.routeTabFilter ?? N)(e)) return;
|
|
1614
|
+
let t = (r.routeTabResolver ?? ie)(e);
|
|
1605
1615
|
if (!t) return;
|
|
1606
|
-
let n = I(), i = new Set(n.map((e) => e.path)), a =
|
|
1607
|
-
|
|
1616
|
+
let n = I(), i = new Set(n.map((e) => e.path)), a = C.value.filter((e) => !i.has(e.path)), o = At([...n, ...a], t, { maxCount: O.value });
|
|
1617
|
+
C.value = o, r.preferences.tabbar.visitHistory && (E.value = Ut(E.value, e.path)), Q();
|
|
1608
1618
|
}
|
|
1609
1619
|
function B(e) {
|
|
1610
|
-
r.routeDriven &&
|
|
1620
|
+
r.routeDriven && m && e && e !== p?.path && m.push(e);
|
|
1611
1621
|
}
|
|
1612
1622
|
function se(e) {
|
|
1613
1623
|
return r.tabFallbackPath ? r.tabFallbackPath : e[0]?.path ?? "";
|
|
@@ -1617,18 +1627,18 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1617
1627
|
set: (e) => {
|
|
1618
1628
|
r.routeDriven ? B(e) : u.value = e;
|
|
1619
1629
|
}
|
|
1620
|
-
}), H = o(() => r.routeDriven ?
|
|
1621
|
-
|
|
1622
|
-
let
|
|
1623
|
-
let e = p?.path || V.value, t =
|
|
1630
|
+
}), H = o(() => r.routeDriven ? C.value : r.tabs);
|
|
1631
|
+
P(H, (e) => a("tabsChange", [...e]), { immediate: !0 });
|
|
1632
|
+
let ce = o(() => H.value.length > 0), de = o(() => r.preferences.sidebar.collapsed), U = o(() => typeof p?.meta.activeMenu == "string" ? p.meta.activeMenu : ""), G = o(() => {
|
|
1633
|
+
let e = p?.path || V.value, t = U.value;
|
|
1624
1634
|
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 ||
|
|
1635
|
+
}), pe = o(() => p?.path || V.value || G.value), J = o(() => ({
|
|
1626
1636
|
enable: r.preferences.breadcrumb?.enable ?? !0,
|
|
1627
1637
|
hideOnlyOne: r.preferences.breadcrumb?.hideOnlyOne ?? !1,
|
|
1628
1638
|
showHome: r.preferences.breadcrumb?.showHome ?? !0,
|
|
1629
1639
|
showIcon: r.preferences.breadcrumb?.showIcon ?? !0
|
|
1630
|
-
})), me = o(() => r.preferences.header.globalSearch ?? !0),
|
|
1631
|
-
let e =
|
|
1640
|
+
})), me = o(() => r.preferences.header.globalSearch ?? !0), he = o(() => r.preferences.shortcutKeys?.globalSearch ?? !0), ve = o(() => q(r.menus, G.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(() => {
|
|
1641
|
+
let e = fe({
|
|
1632
1642
|
activeTopMenuPath: ye.value,
|
|
1633
1643
|
layout: r.preferences.app.layout,
|
|
1634
1644
|
menus: r.menus
|
|
@@ -1637,16 +1647,16 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1637
1647
|
...e,
|
|
1638
1648
|
sidebarMenus: r.preferences.sidebar.enable ? e.sidebarMenus : []
|
|
1639
1649
|
};
|
|
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" ?
|
|
1641
|
-
|
|
1650
|
+
}), 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" ? G.value : ye.value), De = o(() => Z.value ? X.value : xe.value), Oe = o(() => De.value.some((e) => !e.hidden));
|
|
1651
|
+
P(() => [
|
|
1642
1652
|
p?.fullPath,
|
|
1643
|
-
|
|
1653
|
+
G.value,
|
|
1644
1654
|
r.menus,
|
|
1645
1655
|
r.preferences.app.layout,
|
|
1646
1656
|
r.preferences.sidebar.enable
|
|
1647
1657
|
], () => {
|
|
1648
1658
|
T.value = ve.value;
|
|
1649
|
-
}, { immediate: !0 }),
|
|
1659
|
+
}, { immediate: !0 }), P(() => [
|
|
1650
1660
|
r.preferences.app.dynamicTitle ?? !0,
|
|
1651
1661
|
p?.meta.title,
|
|
1652
1662
|
r.title
|
|
@@ -1670,54 +1680,54 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1670
1680
|
function Q() {
|
|
1671
1681
|
let e = Ae();
|
|
1672
1682
|
if (!ke || !r.preferences.tabbar.persist || !e || !r.tabStorageKey || !r.routeDriven) return;
|
|
1673
|
-
let t =
|
|
1674
|
-
tabs:
|
|
1675
|
-
history:
|
|
1683
|
+
let t = Ct({
|
|
1684
|
+
tabs: C.value.map(L),
|
|
1685
|
+
history: E.value
|
|
1676
1686
|
});
|
|
1677
|
-
|
|
1687
|
+
Tt(e, r.tabStorageKey, t);
|
|
1678
1688
|
}
|
|
1679
1689
|
function Me() {
|
|
1680
1690
|
let e = Ae();
|
|
1681
|
-
!e || !r.tabStorageKey ||
|
|
1691
|
+
!e || !r.tabStorageKey || Dt(e, r.tabStorageKey);
|
|
1682
1692
|
}
|
|
1683
1693
|
function Ne() {
|
|
1684
1694
|
if (!r.routeDriven) return;
|
|
1685
1695
|
let e = Ae();
|
|
1686
1696
|
if (!e || !r.tabStorageKey) return;
|
|
1687
|
-
let t =
|
|
1697
|
+
let t = Et(e, r.tabStorageKey), n = p?.path ?? "", i = Ot(t, {
|
|
1688
1698
|
currentPath: n,
|
|
1689
|
-
currentTab: p ? (r.routeTabResolver ??
|
|
1699
|
+
currentTab: p ? (r.routeTabResolver ?? ie)(p) : void 0,
|
|
1690
1700
|
fixedTabs: I(),
|
|
1691
|
-
isValidPath:
|
|
1701
|
+
isValidPath: R(),
|
|
1692
1702
|
resolveTab: oe
|
|
1693
1703
|
});
|
|
1694
|
-
|
|
1704
|
+
C.value = jt(i.tabs, O.value, V.value), r.preferences.tabbar.visitHistory ? (n && i.history.unshift(n), E.value = Ut(i.history, n || "")) : E.value = [];
|
|
1695
1705
|
}
|
|
1696
1706
|
function $(e) {
|
|
1697
|
-
|
|
1707
|
+
v.value = e?.matches ?? A?.matches ?? !1, v.value && (b.value = !1);
|
|
1698
1708
|
}
|
|
1699
1709
|
te(() => {
|
|
1700
|
-
typeof window > "u" || typeof window.matchMedia != "function" || (
|
|
1710
|
+
typeof window > "u" || typeof window.matchMedia != "function" || (A = window.matchMedia("(max-width: 768px)"), $(), A.addEventListener?.("change", $));
|
|
1701
1711
|
}), ee(() => {
|
|
1702
|
-
|
|
1703
|
-
}),
|
|
1712
|
+
A?.removeEventListener?.("change", $);
|
|
1713
|
+
}), P(() => [
|
|
1704
1714
|
r.routeDriven,
|
|
1705
|
-
|
|
1715
|
+
O.value,
|
|
1706
1716
|
r.fixedTabs
|
|
1707
1717
|
], () => {
|
|
1708
1718
|
if (!r.routeDriven) {
|
|
1709
|
-
|
|
1719
|
+
C.value = [];
|
|
1710
1720
|
return;
|
|
1711
1721
|
}
|
|
1712
1722
|
let e = I(), t = new Set(e.map((e) => e.path)), n = [...e];
|
|
1713
|
-
for (let e of
|
|
1714
|
-
|
|
1723
|
+
for (let e of C.value.filter((e) => !t.has(e.path))) n = At(n, e, { maxCount: O.value });
|
|
1724
|
+
C.value = jt(kt(n), O.value, V.value), Q();
|
|
1715
1725
|
}, {
|
|
1716
1726
|
deep: !0,
|
|
1717
1727
|
immediate: !0
|
|
1718
|
-
}),
|
|
1728
|
+
}), P(() => p?.fullPath, () => {
|
|
1719
1729
|
p && z(p);
|
|
1720
|
-
}, { immediate: !0 }), r.preferences.tabbar.persist && Ne(), ke = !0, Q(),
|
|
1730
|
+
}, { immediate: !0 }), r.preferences.tabbar.persist && Ne(), ke = !0, Q(), P(() => [
|
|
1721
1731
|
r.routeDriven,
|
|
1722
1732
|
r.tabStorageKey,
|
|
1723
1733
|
r.preferences.tabbar.persist
|
|
@@ -1726,31 +1736,31 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1726
1736
|
n && r && (e[1] !== t?.[1] || !i || !t?.[0]) && Ne(), !r && i && Me();
|
|
1727
1737
|
}, { immediate: !1 });
|
|
1728
1738
|
function Pe() {
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1739
|
+
if (v.value) {
|
|
1740
|
+
b.value = !b.value;
|
|
1731
1741
|
return;
|
|
1732
1742
|
}
|
|
1733
1743
|
a("toggleSidebar");
|
|
1734
1744
|
}
|
|
1735
1745
|
function Fe(e) {
|
|
1736
|
-
|
|
1746
|
+
b.value = !1, a("menuSelect", e);
|
|
1737
1747
|
}
|
|
1738
1748
|
function Ie(e) {
|
|
1739
1749
|
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(
|
|
1750
|
+
Y.value && t && (n.length > 0 || !i) && (T.value = t.path), a("topMenuSelect", e), !(Y.value && n.length > 0 && !r.preferences.sidebar.autoActivateChild) && Fe(K(t) || e);
|
|
1741
1751
|
}
|
|
1742
1752
|
function Le(e) {
|
|
1743
|
-
Fe(
|
|
1753
|
+
Fe(K(W(r.menus, e)) || e);
|
|
1744
1754
|
}
|
|
1745
1755
|
function Re(e) {
|
|
1746
1756
|
a("tabChange", e);
|
|
1747
1757
|
}
|
|
1748
1758
|
function ze(e) {
|
|
1749
1759
|
if (r.routeDriven) {
|
|
1750
|
-
let t =
|
|
1751
|
-
if (
|
|
1760
|
+
let t = C.value.findIndex((t) => t.path === e), n = Mt(C.value, e);
|
|
1761
|
+
if (C.value = n, V.value === e) {
|
|
1752
1762
|
let i = r.preferences.tabbar.visitHistory;
|
|
1753
|
-
B(
|
|
1763
|
+
B(Wt(n, e, E.value, {
|
|
1754
1764
|
useHistory: i,
|
|
1755
1765
|
priorClosedIndex: t
|
|
1756
1766
|
}) || se(n));
|
|
@@ -1760,27 +1770,27 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1760
1770
|
a("tabRemove", e);
|
|
1761
1771
|
}
|
|
1762
1772
|
function Be(e) {
|
|
1763
|
-
r.routeDriven && (
|
|
1773
|
+
r.routeDriven && (C.value = Nt(C.value, e), B(e), Q()), a("tabCloseLeft", e);
|
|
1764
1774
|
}
|
|
1765
1775
|
function Ve(e) {
|
|
1766
|
-
r.routeDriven && (
|
|
1776
|
+
r.routeDriven && (C.value = Pt(C.value, e), B(e), Q()), a("tabCloseRight", e);
|
|
1767
1777
|
}
|
|
1768
1778
|
function He(e) {
|
|
1769
|
-
r.routeDriven && (
|
|
1779
|
+
r.routeDriven && (C.value = Ft(C.value, e), B(e), Q()), a("tabCloseOthers", e);
|
|
1770
1780
|
}
|
|
1771
1781
|
function Ue() {
|
|
1772
|
-
r.routeDriven && (
|
|
1782
|
+
r.routeDriven && (C.value = It(C.value), B(se(C.value)), Q()), a("tabCloseAll");
|
|
1773
1783
|
}
|
|
1774
1784
|
function We(e, t) {
|
|
1775
|
-
r.routeDriven && (
|
|
1785
|
+
r.routeDriven && (C.value = t ? Lt(C.value, e) : Rt(C.value, e), Q()), a("tabPin", e, t);
|
|
1776
1786
|
}
|
|
1777
|
-
function
|
|
1778
|
-
r.routeDriven && (
|
|
1787
|
+
function Ke(e, t) {
|
|
1788
|
+
r.routeDriven && (C.value = Gt(C.value, e, t), Q()), a("tabReorder", e, t);
|
|
1779
1789
|
}
|
|
1780
|
-
function
|
|
1790
|
+
function qe(e) {
|
|
1781
1791
|
let t = r.resolveTabUrl ? r.resolveTabUrl(e) : (() => {
|
|
1782
|
-
if (
|
|
1783
|
-
return
|
|
1792
|
+
if (m) try {
|
|
1793
|
+
return m.resolve(e)?.href ?? e;
|
|
1784
1794
|
} catch {
|
|
1785
1795
|
return e;
|
|
1786
1796
|
}
|
|
@@ -1794,7 +1804,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1794
1804
|
function Ye(e) {
|
|
1795
1805
|
e.key === "Escape" && S.value && (e.preventDefault(), _.value?.setMaximized(!1), Je(!1));
|
|
1796
1806
|
}
|
|
1797
|
-
return
|
|
1807
|
+
return P(S, (e) => {
|
|
1798
1808
|
typeof document > "u" || (e ? document.addEventListener("keydown", Ye) : document.removeEventListener("keydown", Ye));
|
|
1799
1809
|
}), ee(() => {
|
|
1800
1810
|
typeof document < "u" && document.removeEventListener("keydown", Ye);
|
|
@@ -1802,43 +1812,43 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1802
1812
|
getLayoutElement: () => g.value?.$el,
|
|
1803
1813
|
getLayoutInstance: () => g.value,
|
|
1804
1814
|
getTabs: () => [...H.value],
|
|
1805
|
-
getVisitHistory: () => [...
|
|
1815
|
+
getVisitHistory: () => [...E.value],
|
|
1806
1816
|
resetTabs: () => {
|
|
1807
|
-
|
|
1817
|
+
C.value = It(C.value), E.value = [], B(se(C.value)), Q();
|
|
1808
1818
|
},
|
|
1809
1819
|
resetTabSnapshot: () => {
|
|
1810
1820
|
Me();
|
|
1811
1821
|
}
|
|
1812
|
-
}), (t, n) => (
|
|
1822
|
+
}), (t, n) => (x(), s(k(ae), {
|
|
1813
1823
|
ref_key: "layoutRef",
|
|
1814
1824
|
ref: g,
|
|
1815
|
-
class:
|
|
1816
|
-
"is-sidebar-collapsed":
|
|
1825
|
+
class: y(["lumal-layout", {
|
|
1826
|
+
"is-sidebar-collapsed": de.value,
|
|
1817
1827
|
"is-sidebar-hidden": !Se.value,
|
|
1818
|
-
"is-mobile-menu-hidden": !
|
|
1828
|
+
"is-mobile-menu-hidden": !b.value,
|
|
1819
1829
|
"is-content-maximized": S.value
|
|
1820
1830
|
}]),
|
|
1821
1831
|
"data-layout": e.preferences.app.layout,
|
|
1822
1832
|
direction: "vertical"
|
|
1823
1833
|
}, {
|
|
1824
|
-
default:
|
|
1834
|
+
default: F(() => [e.showHeader ? re((x(), s(je, {
|
|
1825
1835
|
key: 0,
|
|
1826
1836
|
title: e.title,
|
|
1827
|
-
collapsed:
|
|
1837
|
+
collapsed: v.value ? !b.value : de.value,
|
|
1828
1838
|
height: e.headerHeight,
|
|
1829
1839
|
"mobile-only-toggle": !Se.value && Z.value,
|
|
1830
1840
|
"sidebar-enabled": Se.value || Z.value,
|
|
1831
|
-
"toggle-after-title": Se.value && !
|
|
1841
|
+
"toggle-after-title": Se.value && !v.value,
|
|
1832
1842
|
onToggleCollapse: Pe
|
|
1833
1843
|
}, d({ _: 2 }, [
|
|
1834
1844
|
t.$slots.logo ? {
|
|
1835
1845
|
name: "logo",
|
|
1836
|
-
fn:
|
|
1846
|
+
fn: F(() => [w(t.$slots, "logo", {}, void 0, !0)]),
|
|
1837
1847
|
key: "0"
|
|
1838
1848
|
} : void 0,
|
|
1839
1849
|
Z.value ? {
|
|
1840
1850
|
name: "navigation",
|
|
1841
|
-
fn:
|
|
1851
|
+
fn: F(() => [f(vt, {
|
|
1842
1852
|
menus: X.value,
|
|
1843
1853
|
"active-path": Te.value,
|
|
1844
1854
|
align: e.preferences.header.menuAlign,
|
|
@@ -1856,9 +1866,9 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1856
1866
|
} : void 0,
|
|
1857
1867
|
Ce.value ? {
|
|
1858
1868
|
name: "breadcrumb",
|
|
1859
|
-
fn:
|
|
1869
|
+
fn: F(() => [f(ge, {
|
|
1860
1870
|
class: "lumal-layout__header-breadcrumb",
|
|
1861
|
-
"active-menu-path":
|
|
1871
|
+
"active-menu-path": G.value,
|
|
1862
1872
|
"active-path": pe.value,
|
|
1863
1873
|
"hide-only-one": J.value.hideOnlyOne,
|
|
1864
1874
|
menus: e.menus,
|
|
@@ -1877,12 +1887,12 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1877
1887
|
} : void 0,
|
|
1878
1888
|
me.value || t.$slots.headerActions ? {
|
|
1879
1889
|
name: "actions",
|
|
1880
|
-
fn:
|
|
1890
|
+
fn: F(() => [me.value ? (x(), s(Ee, {
|
|
1881
1891
|
key: 0,
|
|
1882
1892
|
menus: e.menus,
|
|
1883
|
-
shortcut:
|
|
1893
|
+
shortcut: he.value,
|
|
1884
1894
|
onSelect: Le
|
|
1885
|
-
}, null, 8, ["menus", "shortcut"])) : c("", !0),
|
|
1895
|
+
}, null, 8, ["menus", "shortcut"])) : c("", !0), w(t.$slots, "headerActions", {}, void 0, !0)]),
|
|
1886
1896
|
key: "3"
|
|
1887
1897
|
} : void 0
|
|
1888
1898
|
]), 1032, [
|
|
@@ -1892,27 +1902,27 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1892
1902
|
"mobile-only-toggle",
|
|
1893
1903
|
"sidebar-enabled",
|
|
1894
1904
|
"toggle-after-title"
|
|
1895
|
-
])), [[
|
|
1896
|
-
default:
|
|
1897
|
-
Oe.value && !S.value ? (
|
|
1905
|
+
])), [[ne, !S.value]]) : c("", !0), f(k(ae), { class: "lumal-layout__body" }, {
|
|
1906
|
+
default: F(() => [
|
|
1907
|
+
Oe.value && !S.value ? (x(), l("button", {
|
|
1898
1908
|
key: 0,
|
|
1899
1909
|
class: "lumal-layout__sidebar-scrim",
|
|
1900
1910
|
type: "button",
|
|
1901
1911
|
"aria-label": "关闭侧边栏",
|
|
1902
|
-
onClick: n[0] ||= (e) =>
|
|
1912
|
+
onClick: n[0] ||= (e) => b.value = !1
|
|
1903
1913
|
})) : c("", !0),
|
|
1904
|
-
S.value ? c("", !0) : (
|
|
1914
|
+
S.value ? c("", !0) : (x(), s(i, {
|
|
1905
1915
|
key: 1,
|
|
1906
1916
|
name: "lumal-layout-sidebar",
|
|
1907
1917
|
appear: ""
|
|
1908
1918
|
}, {
|
|
1909
|
-
default:
|
|
1919
|
+
default: F(() => [Se.value ? (x(), s(Ge, {
|
|
1910
1920
|
key: 0,
|
|
1911
1921
|
class: "lumal-layout__desktop-sidebar",
|
|
1912
1922
|
"aria-label": "主菜单",
|
|
1913
1923
|
menus: xe.value,
|
|
1914
|
-
"active-path":
|
|
1915
|
-
collapsed:
|
|
1924
|
+
"active-path": G.value,
|
|
1925
|
+
collapsed: de.value,
|
|
1916
1926
|
width: `${e.preferences.sidebar.width}px`,
|
|
1917
1927
|
"collapsed-width": "64px",
|
|
1918
1928
|
onSelect: Fe
|
|
@@ -1924,14 +1934,14 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1924
1934
|
])) : c("", !0)]),
|
|
1925
1935
|
_: 1
|
|
1926
1936
|
})),
|
|
1927
|
-
Oe.value && !S.value ? (
|
|
1937
|
+
Oe.value && !S.value ? (x(), s(Ge, {
|
|
1928
1938
|
key: 2,
|
|
1929
1939
|
class: "lumal-layout__mobile-sidebar",
|
|
1930
1940
|
"aria-label": "移动菜单",
|
|
1931
|
-
"aria-hidden": !
|
|
1932
|
-
inert: !
|
|
1941
|
+
"aria-hidden": !b.value,
|
|
1942
|
+
inert: !b.value || void 0,
|
|
1933
1943
|
menus: De.value,
|
|
1934
|
-
"active-path":
|
|
1944
|
+
"active-path": G.value,
|
|
1935
1945
|
collapsed: !1,
|
|
1936
1946
|
width: `${e.preferences.sidebar.width}px`,
|
|
1937
1947
|
"collapsed-width": "64px",
|
|
@@ -1943,15 +1953,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1943
1953
|
"active-path",
|
|
1944
1954
|
"width"
|
|
1945
1955
|
])) : c("", !0),
|
|
1946
|
-
f(
|
|
1956
|
+
f(k(ae), {
|
|
1947
1957
|
class: "lumal-layout__main",
|
|
1948
1958
|
direction: "vertical",
|
|
1949
1959
|
"data-layout-fullscreen-target": ""
|
|
1950
1960
|
}, {
|
|
1951
|
-
default:
|
|
1952
|
-
J.value.enable && !Ce.value && !S.value ? (
|
|
1961
|
+
default: F(() => [
|
|
1962
|
+
J.value.enable && !Ce.value && !S.value ? (x(), s(ge, {
|
|
1953
1963
|
key: 0,
|
|
1954
|
-
"active-menu-path":
|
|
1964
|
+
"active-menu-path": G.value,
|
|
1955
1965
|
"active-path": pe.value,
|
|
1956
1966
|
"hide-only-one": J.value.hideOnlyOne,
|
|
1957
1967
|
menus: e.menus,
|
|
@@ -1966,7 +1976,7 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1966
1976
|
"show-home",
|
|
1967
1977
|
"show-icon"
|
|
1968
1978
|
])) : c("", !0),
|
|
1969
|
-
|
|
1979
|
+
ce.value && e.preferences.tabbar.enable ? (x(), s(ft, {
|
|
1970
1980
|
key: 1,
|
|
1971
1981
|
ref_key: "tabsRef",
|
|
1972
1982
|
ref: _,
|
|
@@ -1987,11 +1997,11 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
1987
1997
|
onCloseOthers: He,
|
|
1988
1998
|
onCloseRight: Ve,
|
|
1989
1999
|
onMaximize: Je,
|
|
1990
|
-
onNewWindow:
|
|
2000
|
+
onNewWindow: qe,
|
|
1991
2001
|
onPin: We,
|
|
1992
2002
|
onRefresh: n[2] ||= (e) => a("tabRefresh", e),
|
|
1993
2003
|
onRemove: ze,
|
|
1994
|
-
onReorder:
|
|
2004
|
+
onReorder: Ke
|
|
1995
2005
|
}, null, 8, [
|
|
1996
2006
|
"active-path",
|
|
1997
2007
|
"tabs",
|
|
@@ -2004,8 +2014,8 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2004
2014
|
"middle-click-to-close",
|
|
2005
2015
|
"style-type"
|
|
2006
2016
|
])) : c("", !0),
|
|
2007
|
-
f(
|
|
2008
|
-
default:
|
|
2017
|
+
f(_e, null, {
|
|
2018
|
+
default: F(() => [w(t.$slots, "default", { tabs: H.value }, void 0, !0)]),
|
|
2009
2019
|
_: 3
|
|
2010
2020
|
})
|
|
2011
2021
|
]),
|
|
@@ -2017,15 +2027,15 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2017
2027
|
_: 3
|
|
2018
2028
|
}, 8, ["data-layout", "class"]));
|
|
2019
2029
|
}
|
|
2020
|
-
}), [["__scopeId", "data-v-
|
|
2030
|
+
}), [["__scopeId", "data-v-d4178515"]]), Jt = {
|
|
2021
2031
|
key: 0,
|
|
2022
2032
|
class: "lumal-router-view__progress",
|
|
2023
2033
|
"aria-hidden": "true"
|
|
2024
|
-
},
|
|
2034
|
+
}, Yt = {
|
|
2025
2035
|
key: 1,
|
|
2026
2036
|
class: "lumal-router-view__loading",
|
|
2027
2037
|
"aria-hidden": "true"
|
|
2028
|
-
},
|
|
2038
|
+
}, Xt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
2029
2039
|
__name: "LumalRouterView",
|
|
2030
2040
|
props: {
|
|
2031
2041
|
viewKey: { default: "default" },
|
|
@@ -2050,70 +2060,87 @@ var Qt = /*#__PURE__*/ e(/* @__PURE__ */ p({
|
|
|
2050
2060
|
cacheKeys: {}
|
|
2051
2061
|
},
|
|
2052
2062
|
setup(e, { expose: t }) {
|
|
2053
|
-
let r = e, a =
|
|
2054
|
-
|
|
2063
|
+
let r = e, a = M("routerViewRef"), d = h(le, void 0), g = h(ue, void 0), _ = D(!1), v = o(() => r.progress && _.value), y = o(() => r.loading && _.value), b = o(() => Number.isFinite(r.cacheMax) && r.cacheMax > 0 ? Math.max(1, Math.floor(r.cacheMax)) : 20), te = o(() => r.transition ? r.transitionName : void 0);
|
|
2064
|
+
function S(e) {
|
|
2065
|
+
return p({
|
|
2066
|
+
name: e,
|
|
2067
|
+
setup: (e, { slots: t }) => () => m("div", { class: "lumal-router-view__page" }, t.default?.())
|
|
2068
|
+
});
|
|
2069
|
+
}
|
|
2070
|
+
let C = /* @__PURE__ */ new WeakMap();
|
|
2071
|
+
function w(e) {
|
|
2072
|
+
if (!e) return;
|
|
2073
|
+
let t = e.type, n = C.get(t);
|
|
2074
|
+
return n || (n = S("LumalUncachedView"), C.set(t, n)), n;
|
|
2075
|
+
}
|
|
2076
|
+
let T = /* @__PURE__ */ new Map(), O = D(), A = D([]), j = 0;
|
|
2077
|
+
P([
|
|
2055
2078
|
() => r.viewKey,
|
|
2056
2079
|
() => r.cacheKeys?.slice(),
|
|
2057
2080
|
() => r.cache,
|
|
2058
|
-
|
|
2081
|
+
b,
|
|
2059
2082
|
() => d?.meta.keepAlive
|
|
2060
2083
|
], () => {
|
|
2061
2084
|
let e = r.cacheKeys ? new Set(r.cacheKeys) : void 0;
|
|
2062
|
-
for (let t of
|
|
2063
|
-
let t =
|
|
2085
|
+
for (let t of T.keys()) (!r.cache || e && !e.has(t) || t === r.viewKey && d?.meta.keepAlive === !1) && T.delete(t);
|
|
2086
|
+
let t = T.get(r.viewKey);
|
|
2064
2087
|
if (r.cache && d?.meta.keepAlive !== !1 && (!e || e.has(r.viewKey))) {
|
|
2065
2088
|
if (!t) {
|
|
2066
|
-
let e = `LumalCachedView${++
|
|
2089
|
+
let e = `LumalCachedView${++j}`;
|
|
2067
2090
|
t = {
|
|
2068
2091
|
name: e,
|
|
2069
|
-
component:
|
|
2070
|
-
name: e,
|
|
2071
|
-
setup: (e, { slots: t }) => () => t.default?.()
|
|
2072
|
-
})
|
|
2092
|
+
component: S(e)
|
|
2073
2093
|
};
|
|
2074
2094
|
}
|
|
2075
|
-
|
|
2095
|
+
T.delete(r.viewKey), T.set(r.viewKey, t);
|
|
2076
2096
|
} else t = void 0;
|
|
2077
|
-
for (;
|
|
2078
|
-
|
|
2097
|
+
for (; T.size > b.value;) T.delete(T.keys().next().value);
|
|
2098
|
+
O.value = t?.component, A.value = [...T.values()].map((e) => e.name);
|
|
2079
2099
|
}, { immediate: !0 });
|
|
2080
|
-
let
|
|
2081
|
-
|
|
2082
|
-
}),
|
|
2083
|
-
|
|
2084
|
-
}),
|
|
2085
|
-
|
|
2100
|
+
let N, ne = g?.beforeEach((e) => {
|
|
2101
|
+
N = e, _.value = !0;
|
|
2102
|
+
}), re = g?.afterEach((e) => {
|
|
2103
|
+
N === e && (_.value = !1);
|
|
2104
|
+
}), ie = g?.onError((e, t) => {
|
|
2105
|
+
N === t && (_.value = !1);
|
|
2086
2106
|
});
|
|
2087
2107
|
return ee(() => {
|
|
2088
|
-
|
|
2089
|
-
}), t({ getRouterViewElement: () => a.value }), (t, r) => (
|
|
2108
|
+
ne?.(), re?.(), ie?.(), T.clear();
|
|
2109
|
+
}), t({ getRouterViewElement: () => a.value }), (t, r) => (x(), l("div", {
|
|
2090
2110
|
ref_key: "routerViewRef",
|
|
2091
2111
|
ref: a,
|
|
2092
2112
|
class: "lumal-router-view"
|
|
2093
2113
|
}, [
|
|
2094
|
-
|
|
2095
|
-
f(
|
|
2096
|
-
default:
|
|
2114
|
+
v.value ? (x(), l("div", Jt, [...r[0] ||= [u("span", { class: "lumal-router-view__progress-bar" }, null, -1)]])) : c("", !0),
|
|
2115
|
+
f(k(ce), null, {
|
|
2116
|
+
default: F(({ Component: t }) => [f(i, {
|
|
2097
2117
|
appear: "",
|
|
2098
|
-
mode: "out-in",
|
|
2118
|
+
mode: e.transition ? "out-in" : void 0,
|
|
2099
2119
|
name: te.value,
|
|
2100
2120
|
css: e.transition
|
|
2101
2121
|
}, {
|
|
2102
|
-
default:
|
|
2122
|
+
default: F(() => [e.cache ? (x(), s(n, {
|
|
2103
2123
|
key: 0,
|
|
2104
|
-
include:
|
|
2105
|
-
max:
|
|
2106
|
-
}, [
|
|
2107
|
-
default:
|
|
2124
|
+
include: A.value,
|
|
2125
|
+
max: b.value
|
|
2126
|
+
}, [(x(), s(E(O.value ?? w(t)), { key: e.viewKey }, {
|
|
2127
|
+
default: F(() => [(x(), s(E(t)))]),
|
|
2128
|
+
_: 2
|
|
2129
|
+
}, 1024))], 1032, ["include", "max"])) : (x(), s(E(w(t)), { key: e.viewKey }, {
|
|
2130
|
+
default: F(() => [(x(), s(E(t)))]),
|
|
2108
2131
|
_: 2
|
|
2109
|
-
}, 1024))
|
|
2132
|
+
}, 1024))]),
|
|
2110
2133
|
_: 2
|
|
2111
|
-
}, 1032, [
|
|
2134
|
+
}, 1032, [
|
|
2135
|
+
"mode",
|
|
2136
|
+
"name",
|
|
2137
|
+
"css"
|
|
2138
|
+
])]),
|
|
2112
2139
|
_: 1
|
|
2113
2140
|
}),
|
|
2114
|
-
|
|
2141
|
+
y.value ? (x(), l("div", Yt, [...r[1] ||= [u("span", { class: "lumal-router-view__loading-dot" }, null, -1)]])) : c("", !0)
|
|
2115
2142
|
], 512));
|
|
2116
2143
|
}
|
|
2117
|
-
}), [["__scopeId", "data-v-
|
|
2144
|
+
}), [["__scopeId", "data-v-e4c57039"]]);
|
|
2118
2145
|
//#endregion
|
|
2119
|
-
export {
|
|
2146
|
+
export { Ge as A, fe as B, wt as C, Tt as D, Ct as E, W as F, G as I, U as L, Ee as M, _e as N, vt as O, ge as P, q as R, Dt as S, Ot as T, Wt as _, Bt as a, bt as b, Ft as c, Pt as d, zt as f, Kt as g, Gt as h, Vt as i, je as j, ft as k, Mt as l, Ut as m, qt as n, jt as o, Lt as p, At as r, It as s, Xt as t, Nt as u, kt as v, Et as w, yt as x, Rt as y, K as z };
|