vlite3 0.6.10 → 0.6.11
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/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/Navbar/Navbar.vue.d.ts +0 -6
- package/components/Navbar/Navbar.vue.js +288 -351
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -0
- package/components/SidebarMenu/SidebarMenu.vue.js +67 -65
- package/components/SidebarMenu/types.d.ts +5 -0
- package/package.json +1 -1
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -5,8 +5,8 @@ import O from "../Input.vue.js";
|
|
|
5
5
|
/* empty css */
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
import y from "../Button.vue.js";
|
|
8
|
-
import E from "./ColorIro.
|
|
9
|
-
/* empty css
|
|
8
|
+
import E from "./ColorIro.vue2.js";
|
|
9
|
+
/* empty css */
|
|
10
10
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
11
11
|
const I = {
|
|
12
12
|
key: 0,
|
|
@@ -29,12 +29,6 @@ declare function __VLS_template(): {
|
|
|
29
29
|
logo?(_: {}): any;
|
|
30
30
|
logo?(_: {}): any;
|
|
31
31
|
logo?(_: {}): any;
|
|
32
|
-
logo?(_: {}): any;
|
|
33
|
-
logo?(_: {}): any;
|
|
34
|
-
logo?(_: {}): any;
|
|
35
|
-
logo?(_: {}): any;
|
|
36
|
-
logo?(_: {}): any;
|
|
37
|
-
logo?(_: {}): any;
|
|
38
32
|
'mobile-trigger'?(_: {
|
|
39
33
|
isOpen: any;
|
|
40
34
|
toggle: () => boolean;
|
|
@@ -1,60 +1,59 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useLocalStorage as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import X from "./NavbarTabs.vue.js";
|
|
1
|
+
import { defineComponent as _, computed as m, ref as w, provide as ee, useSlots as le, onMounted as se, onUnmounted as oe, watch as A, openBlock as r, createElementBlock as i, createVNode as b, Transition as W, withCtx as g, withDirectives as Y, createElementVNode as t, normalizeClass as n, renderSlot as s, createCommentVNode as u, vShow as q, unref as c, createTextVNode as L, normalizeStyle as te, Fragment as x, createBlock as G } from "vue";
|
|
2
|
+
import { useRoute as ae } from "vue-router";
|
|
3
|
+
import { useLocalStorage as re, onClickOutside as ie, useBreakpoints as ne, breakpointsTailwind as de } from "@vueuse/core";
|
|
4
|
+
import z from "../Icon.vue.js";
|
|
5
|
+
import P from "../SidePanel.vue.js";
|
|
6
|
+
import J from "./NavbarTabs.vue.js";
|
|
8
7
|
/* empty css */
|
|
9
|
-
import
|
|
8
|
+
import K from "../Breadcrumb/Breadcrumb.vue.js";
|
|
10
9
|
/* empty css */
|
|
11
|
-
import { useBreadcrumb as
|
|
12
|
-
const
|
|
10
|
+
import { useBreadcrumb as ue } from "../../composables/useBreadcrumb.js";
|
|
11
|
+
const fe = {
|
|
13
12
|
key: 0,
|
|
14
13
|
class: "vlite-app-layout flex flex-row w-full h-full bg-body overflow-hidden"
|
|
15
|
-
},
|
|
14
|
+
}, be = { class: "flex flex-col flex-1 min-w-0 h-full overflow-hidden" }, me = {
|
|
16
15
|
key: 0,
|
|
17
16
|
class: "w-full shrink-0 z-20 bg-background"
|
|
18
|
-
},
|
|
17
|
+
}, ce = {
|
|
19
18
|
key: 1,
|
|
20
19
|
class: "flex-1 overflow-y-auto w-full relative h-full flex flex-col min-h-0"
|
|
21
|
-
},
|
|
20
|
+
}, ve = {
|
|
22
21
|
key: 0,
|
|
23
22
|
class: "shrink-0 w-full"
|
|
24
|
-
},
|
|
23
|
+
}, ge = { class: "flex-1 overflow-y-auto w-full relative h-full" }, pe = { class: "flex flex-col h-full" }, he = { class: "flex-1 overflow-y-auto px-3.5 pt-4" }, ye = {
|
|
25
24
|
key: 0,
|
|
26
25
|
class: "mt-auto pt-2 border-t border-border px-3 py-2"
|
|
27
|
-
},
|
|
26
|
+
}, ke = {
|
|
28
27
|
key: 1,
|
|
29
28
|
class: "vlite-app-layout flex flex-col w-full h-full bg-body overflow-hidden"
|
|
30
|
-
},
|
|
29
|
+
}, we = {
|
|
31
30
|
key: 0,
|
|
32
31
|
class: "w-full shrink-0 z-50 flex flex-col relative"
|
|
33
|
-
},
|
|
32
|
+
}, xe = { class: "flex flex-1 w-full overflow-hidden relative" }, $e = { class: "flex items-center gap-4 shrink-0 z-10" }, Ce = {
|
|
34
33
|
key: 0,
|
|
35
34
|
class: "flex-1 overflow-y-auto w-full relative h-full flex flex-col"
|
|
36
|
-
},
|
|
35
|
+
}, Te = {
|
|
37
36
|
key: 0,
|
|
38
37
|
class: "shrink-0 w-full"
|
|
39
|
-
},
|
|
38
|
+
}, ze = { class: "flex-1 overflow-y-auto w-full relative h-full" }, Se = { class: "flex flex-col max-h-[80vh] overflow-y-auto" }, Be = { class: "space-y-1 p-2" }, Ve = { class: "space-y-1 p-2" }, Me = { class: "flex flex-col space-y-6 pt-4 h-full" }, Oe = {
|
|
40
39
|
key: 0,
|
|
41
40
|
class: "flex flex-col space-y-1"
|
|
42
|
-
},
|
|
41
|
+
}, Ne = {
|
|
43
42
|
key: 1,
|
|
44
43
|
class: "flex flex-col space-y-4 flex-1 overflow-y-auto px-3.5!"
|
|
45
|
-
},
|
|
44
|
+
}, Le = {
|
|
46
45
|
key: 2,
|
|
47
46
|
class: "mt-auto pt-2 border-t border-border px-3! py-2!"
|
|
48
|
-
},
|
|
47
|
+
}, Pe = { class: "flex items-center gap-4 shrink-0 z-10" }, Re = { class: "flex flex-col max-h-[80vh] overflow-y-auto" }, He = { class: "space-y-1 p-2" }, je = { class: "space-y-1 p-2" }, Ie = { class: "flex flex-col space-y-6 pt-4 h-full" }, Ue = {
|
|
49
48
|
key: 0,
|
|
50
49
|
class: "flex flex-col space-y-1"
|
|
51
|
-
},
|
|
50
|
+
}, Ee = {
|
|
52
51
|
key: 1,
|
|
53
52
|
class: "flex flex-col space-y-4 flex-1 overflow-y-auto px-3.5!"
|
|
54
|
-
},
|
|
53
|
+
}, De = {
|
|
55
54
|
key: 2,
|
|
56
55
|
class: "mt-auto pt-2 border-t border-border px-3! py-2!"
|
|
57
|
-
},
|
|
56
|
+
}, el = /* @__PURE__ */ _({
|
|
58
57
|
__name: "Navbar",
|
|
59
58
|
props: {
|
|
60
59
|
variant: { default: "header" },
|
|
@@ -88,118 +87,118 @@ const ve = {
|
|
|
88
87
|
layoutMode: { default: "sidebar-first" }
|
|
89
88
|
},
|
|
90
89
|
emits: ["toggle-mobile"],
|
|
91
|
-
setup(
|
|
92
|
-
const l =
|
|
90
|
+
setup(v, { emit: Fe }) {
|
|
91
|
+
const l = v, h = l.breadcrumb ? ue({
|
|
93
92
|
homeIcon: l.breadcrumbHomeIcon,
|
|
94
93
|
labelMap: l.breadcrumbLabels || {}
|
|
95
|
-
}) : { items:
|
|
96
|
-
|
|
97
|
-
compact:
|
|
98
|
-
renderNestedTabs:
|
|
99
|
-
setNestedTabs: (e,
|
|
100
|
-
y.value = e, k.value =
|
|
94
|
+
}) : { items: m(() => []) }, y = w([]), k = w("");
|
|
95
|
+
ee("navbar-context", {
|
|
96
|
+
compact: m(() => l.compact),
|
|
97
|
+
renderNestedTabs: m(() => l.renderNestedTabs),
|
|
98
|
+
setNestedTabs: (e, o) => {
|
|
99
|
+
y.value = e, k.value = o;
|
|
101
100
|
}
|
|
102
101
|
});
|
|
103
|
-
const
|
|
104
|
-
y.value.find((
|
|
105
|
-
|
|
102
|
+
const a = w(!1), S = w(!1), R = le(), B = w(null), $ = w(null), C = re("vlite-navbar-sidebar-visible", !0), H = (e) => {
|
|
103
|
+
y.value.find((d) => d.value === e) && (typeof e == "string" && e.startsWith("/") ? import("vue-router").then(({ useRouter: d }) => {
|
|
104
|
+
d().push(e).catch(() => {
|
|
106
105
|
});
|
|
107
106
|
}) : k.value = e);
|
|
108
|
-
}, p =
|
|
109
|
-
|
|
107
|
+
}, p = m(() => !!(R.header || R.main)), j = m(() => l.sidebarToggle && p.value), I = () => {
|
|
108
|
+
C.value = !C.value;
|
|
110
109
|
};
|
|
111
|
-
|
|
112
|
-
|
|
110
|
+
ie(
|
|
111
|
+
B,
|
|
113
112
|
() => {
|
|
114
|
-
|
|
113
|
+
a.value = !1;
|
|
115
114
|
},
|
|
116
|
-
{ ignore: [
|
|
115
|
+
{ ignore: [$] }
|
|
117
116
|
);
|
|
118
|
-
const
|
|
117
|
+
const U = () => {
|
|
119
118
|
S.value = window.scrollY > 10;
|
|
120
119
|
};
|
|
121
|
-
|
|
122
|
-
window.addEventListener("scroll",
|
|
123
|
-
}),
|
|
124
|
-
window.removeEventListener("scroll",
|
|
120
|
+
se(() => {
|
|
121
|
+
window.addEventListener("scroll", U, { passive: !0 });
|
|
122
|
+
}), oe(() => {
|
|
123
|
+
window.removeEventListener("scroll", U);
|
|
125
124
|
});
|
|
126
|
-
const
|
|
127
|
-
const e = l.variant === "sidebar",
|
|
125
|
+
const E = m(() => {
|
|
126
|
+
const e = l.variant === "sidebar", o = {
|
|
128
127
|
fixed: p.value ? "relative z-40" : "fixed top-0 left-0 z-40",
|
|
129
128
|
sticky: p.value ? "relative z-40" : "sticky top-0 z-40",
|
|
130
129
|
relative: "relative z-10",
|
|
131
130
|
absolute: p.value ? "relative z-40" : "absolute top-0 left-0 w-full z-40"
|
|
132
|
-
},
|
|
131
|
+
}, d = "bg-body", T = [
|
|
133
132
|
l.glass && (S.value || e || l.floating) ? "backdrop-blur-md bg-background/80 supports-[backdrop-filter]:bg-background/60" : "bg-background",
|
|
134
133
|
l.border && !l.floating ? e ? "border-r border-border" : "border-b border-border" : "",
|
|
135
134
|
l.floating ? "m-4 rounded shadow-lg border border-border/50" : "",
|
|
136
135
|
S.value && !l.floating && !e && l.position === "sticky" ? "shadow-sm" : ""
|
|
137
|
-
],
|
|
136
|
+
], V = l.mobileBreakpoint || "md", M = {
|
|
138
137
|
sm: "max-sm:hidden",
|
|
139
138
|
md: "max-md:hidden",
|
|
140
139
|
lg: "max-lg:hidden",
|
|
141
140
|
xl: "max-xl:hidden"
|
|
142
|
-
},
|
|
143
|
-
let
|
|
144
|
-
return e ?
|
|
145
|
-
}), f =
|
|
146
|
-
const e = l.mobileBreakpoint || "md",
|
|
141
|
+
}, O = p.value && e ? M[V] : "";
|
|
142
|
+
let N = "";
|
|
143
|
+
return e ? N = f.value.sidebarLayout : N = `flex items-center gap-4 w-full px-4 sm:px-6 lg:px-8 ${l.height}`, [d, o[l.position], ...T, N, O, l.class].filter(Boolean).join(" ");
|
|
144
|
+
}), f = m(() => {
|
|
145
|
+
const e = l.mobileBreakpoint || "md", o = {
|
|
147
146
|
sm: "sm:hidden",
|
|
148
147
|
md: "md:hidden",
|
|
149
148
|
lg: "lg:hidden",
|
|
150
149
|
xl: "xl:hidden"
|
|
151
|
-
},
|
|
150
|
+
}, d = {
|
|
152
151
|
sm: "hidden sm:flex",
|
|
153
152
|
md: "hidden md:flex",
|
|
154
153
|
lg: "hidden lg:flex",
|
|
155
154
|
xl: "hidden xl:flex"
|
|
156
|
-
},
|
|
155
|
+
}, T = {
|
|
157
156
|
sm: `flex flex-col max-sm:w-full ${l.compact ? "w-20" : ""} h-auto sm:h-full sm:max-h-screen shrink-0`,
|
|
158
157
|
md: `flex flex-col max-md:w-full ${l.compact ? "w-20" : ""} h-auto md:h-full md:max-h-screen shrink-0`,
|
|
159
158
|
lg: `flex flex-col max-lg:w-full ${l.compact ? "w-20" : ""} h-auto lg:h-full lg:max-h-screen shrink-0`,
|
|
160
159
|
xl: `flex flex-col max-xl:w-full ${l.compact ? "w-20" : ""} h-auto xl:h-full xl:max-h-screen shrink-0`
|
|
161
|
-
},
|
|
160
|
+
}, V = {
|
|
162
161
|
sm: "sm:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background",
|
|
163
162
|
md: "md:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background",
|
|
164
163
|
lg: "lg:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background",
|
|
165
164
|
xl: "xl:hidden flex items-center justify-between px-4 py-3 shrink-0 bg-background"
|
|
166
|
-
},
|
|
165
|
+
}, M = {
|
|
167
166
|
sm: "hidden sm:flex flex-col h-full w-full overflow-hidden",
|
|
168
167
|
md: "hidden md:flex flex-col h-full w-full overflow-hidden",
|
|
169
168
|
lg: "hidden lg:flex flex-col h-full w-full overflow-hidden",
|
|
170
169
|
xl: "hidden xl:flex flex-col h-full w-full overflow-hidden"
|
|
171
|
-
},
|
|
170
|
+
}, O = {
|
|
172
171
|
sm: "hidden sm:flex",
|
|
173
172
|
md: "hidden md:flex",
|
|
174
173
|
lg: "hidden lg:flex",
|
|
175
174
|
xl: "hidden xl:flex"
|
|
176
175
|
};
|
|
177
176
|
return {
|
|
178
|
-
mobileTrigger:
|
|
179
|
-
desktopContent:
|
|
180
|
-
sidebarLayout:
|
|
181
|
-
mobileHeader:
|
|
182
|
-
desktopSidebar:
|
|
183
|
-
desktopOnly:
|
|
177
|
+
mobileTrigger: o[e],
|
|
178
|
+
desktopContent: d[e],
|
|
179
|
+
sidebarLayout: T[e],
|
|
180
|
+
mobileHeader: V[e],
|
|
181
|
+
desktopSidebar: M[e],
|
|
182
|
+
desktopOnly: O[e]
|
|
184
183
|
};
|
|
185
|
-
}),
|
|
184
|
+
}), D = m(() => {
|
|
186
185
|
if (l.variant === "sidebar") return "flex-1 py-4 overflow-y-auto";
|
|
187
186
|
if (l.centerPosition === "left")
|
|
188
187
|
return "flex items-center justify-start";
|
|
189
|
-
}),
|
|
190
|
-
|
|
191
|
-
() =>
|
|
188
|
+
}), Q = ae();
|
|
189
|
+
A(
|
|
190
|
+
() => Q.path,
|
|
192
191
|
() => {
|
|
193
|
-
|
|
192
|
+
a.value = !1;
|
|
194
193
|
}
|
|
195
194
|
);
|
|
196
|
-
const
|
|
197
|
-
|
|
198
|
-
e && (
|
|
195
|
+
const X = ne(de).greater(l.mobileBreakpoint);
|
|
196
|
+
A(X, (e) => {
|
|
197
|
+
e && (a.value = !1);
|
|
199
198
|
});
|
|
200
|
-
const F =
|
|
201
|
-
return (e,
|
|
202
|
-
|
|
199
|
+
const F = m(() => j.value && !C.value), Z = m(() => p.value && l.variant === "sidebar" && l.layoutMode === "sidebar-first");
|
|
200
|
+
return (e, o) => Z.value ? (r(), i("div", fe, [
|
|
201
|
+
b(W, {
|
|
203
202
|
"enter-active-class": "transition-all duration-300 ease-in-out",
|
|
204
203
|
"leave-active-class": "transition-all duration-300 ease-in-out",
|
|
205
204
|
"enter-from-class": "opacity-0 -translate-x-2",
|
|
@@ -207,8 +206,8 @@ const ve = {
|
|
|
207
206
|
"leave-from-class": "opacity-100 translate-x-0",
|
|
208
207
|
"leave-to-class": "opacity-0 -translate-x-2"
|
|
209
208
|
}, {
|
|
210
|
-
default:
|
|
211
|
-
|
|
209
|
+
default: g(() => [
|
|
210
|
+
Y(t("nav", {
|
|
212
211
|
class: n([
|
|
213
212
|
"shrink-0 h-full flex flex-col bg-background border-r border-border overflow-hidden z-30",
|
|
214
213
|
f.value.mobileTrigger === "md:hidden" ? "max-md:hidden" : "",
|
|
@@ -217,61 +216,61 @@ const ve = {
|
|
|
217
216
|
role: "navigation",
|
|
218
217
|
"aria-label": "Sidebar"
|
|
219
218
|
}, [
|
|
220
|
-
|
|
219
|
+
t("div", {
|
|
221
220
|
class: n(["flex-1 overflow-y-auto overflow-x-hidden scrollbar-thin", l.contentClass])
|
|
222
221
|
}, [
|
|
223
|
-
|
|
222
|
+
s(e.$slots, "default")
|
|
224
223
|
], 2),
|
|
225
|
-
e.$slots.right ? (
|
|
224
|
+
e.$slots.right ? (r(), i("div", {
|
|
226
225
|
key: 0,
|
|
227
226
|
class: n(["shrink-0 border-t border-border bg-background", l.rightClass])
|
|
228
227
|
}, [
|
|
229
|
-
|
|
230
|
-
], 2)) :
|
|
228
|
+
s(e.$slots, "right")
|
|
229
|
+
], 2)) : u("", !0)
|
|
231
230
|
], 2), [
|
|
232
|
-
[
|
|
231
|
+
[q, !F.value]
|
|
233
232
|
])
|
|
234
233
|
]),
|
|
235
234
|
_: 3
|
|
236
235
|
}),
|
|
237
|
-
|
|
238
|
-
e.$slots.header ? (
|
|
239
|
-
|
|
240
|
-
isOpen:
|
|
241
|
-
toggle: () =>
|
|
242
|
-
sidebarVisible: c(
|
|
243
|
-
toggleSidebar:
|
|
236
|
+
t("div", be, [
|
|
237
|
+
e.$slots.header ? (r(), i("header", me, [
|
|
238
|
+
s(e.$slots, "header", {
|
|
239
|
+
isOpen: a.value,
|
|
240
|
+
toggle: () => a.value = !a.value,
|
|
241
|
+
sidebarVisible: c(C),
|
|
242
|
+
toggleSidebar: I,
|
|
244
243
|
breadcrumbItems: c(h).items.value
|
|
245
244
|
})
|
|
246
|
-
])) :
|
|
247
|
-
e.$slots.main ? (
|
|
248
|
-
l.renderNestedTabs && y.value.length > 0 ? (
|
|
249
|
-
|
|
245
|
+
])) : u("", !0),
|
|
246
|
+
e.$slots.main ? (r(), i("main", ce, [
|
|
247
|
+
l.renderNestedTabs && y.value.length > 0 ? (r(), i("div", ve, [
|
|
248
|
+
b(J, {
|
|
250
249
|
modelValue: k.value,
|
|
251
|
-
"onUpdate:modelValue":
|
|
252
|
-
onChange:
|
|
250
|
+
"onUpdate:modelValue": o[0] || (o[0] = (d) => k.value = d),
|
|
251
|
+
onChange: H,
|
|
253
252
|
items: y.value
|
|
254
253
|
}, null, 8, ["modelValue", "items"])
|
|
255
|
-
])) :
|
|
256
|
-
l.breadcrumb && l.breadcrumbPosition === "main" && c(h).items.value.length > 1 ? (
|
|
254
|
+
])) : u("", !0),
|
|
255
|
+
l.breadcrumb && l.breadcrumbPosition === "main" && c(h).items.value.length > 1 ? (r(), i("div", {
|
|
257
256
|
key: 1,
|
|
258
257
|
class: n(["shrink-0 w-full border-b border-border px-6 py-2", l.breadcrumbClass])
|
|
259
258
|
}, [
|
|
260
|
-
|
|
259
|
+
b(c(K), {
|
|
261
260
|
items: c(h).items.value,
|
|
262
261
|
variant: l.breadcrumbVariant,
|
|
263
262
|
separator: l.breadcrumbSeparator,
|
|
264
263
|
size: l.breadcrumbSize
|
|
265
264
|
}, null, 8, ["items", "variant", "separator", "size"])
|
|
266
|
-
], 2)) :
|
|
267
|
-
|
|
268
|
-
|
|
265
|
+
], 2)) : u("", !0),
|
|
266
|
+
t("div", ge, [
|
|
267
|
+
s(e.$slots, "main")
|
|
269
268
|
])
|
|
270
|
-
])) :
|
|
269
|
+
])) : u("", !0)
|
|
271
270
|
]),
|
|
272
|
-
|
|
273
|
-
show:
|
|
274
|
-
"onUpdate:show":
|
|
271
|
+
b(P, {
|
|
272
|
+
show: a.value,
|
|
273
|
+
"onUpdate:show": o[1] || (o[1] = (d) => a.value = d),
|
|
275
274
|
position: "left",
|
|
276
275
|
size: "sm",
|
|
277
276
|
triggerClass: f.value.mobileTrigger,
|
|
@@ -279,35 +278,35 @@ const ve = {
|
|
|
279
278
|
headerClass: "pl-3! pr-4.5! py-3!",
|
|
280
279
|
bodyClass: "p-0!"
|
|
281
280
|
}, {
|
|
282
|
-
header:
|
|
283
|
-
|
|
284
|
-
|
|
281
|
+
header: g(() => [
|
|
282
|
+
s(e.$slots, "logo", {}, () => [
|
|
283
|
+
o[9] || (o[9] = L("Brand", -1))
|
|
285
284
|
])
|
|
286
285
|
]),
|
|
287
|
-
default:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
286
|
+
default: g(() => [
|
|
287
|
+
t("div", pe, [
|
|
288
|
+
t("div", he, [
|
|
289
|
+
s(e.$slots, "default")
|
|
291
290
|
]),
|
|
292
|
-
e.$slots.right ? (
|
|
293
|
-
|
|
294
|
-
])) :
|
|
291
|
+
e.$slots.right ? (r(), i("div", ye, [
|
|
292
|
+
s(e.$slots, "right")
|
|
293
|
+
])) : u("", !0)
|
|
295
294
|
])
|
|
296
295
|
]),
|
|
297
296
|
_: 3
|
|
298
297
|
}, 8, ["show", "triggerClass", "class"])
|
|
299
|
-
])) : p.value ? (
|
|
300
|
-
e.$slots.header ? (
|
|
301
|
-
|
|
302
|
-
isOpen:
|
|
303
|
-
toggle: () =>
|
|
304
|
-
sidebarVisible: c(
|
|
305
|
-
toggleSidebar:
|
|
298
|
+
])) : p.value ? (r(), i("div", ke, [
|
|
299
|
+
e.$slots.header ? (r(), i("header", we, [
|
|
300
|
+
s(e.$slots, "header", {
|
|
301
|
+
isOpen: a.value,
|
|
302
|
+
toggle: () => a.value = !a.value,
|
|
303
|
+
sidebarVisible: c(C),
|
|
304
|
+
toggleSidebar: I,
|
|
306
305
|
breadcrumbItems: c(h).items.value
|
|
307
306
|
})
|
|
308
|
-
])) :
|
|
309
|
-
|
|
310
|
-
|
|
307
|
+
])) : u("", !0),
|
|
308
|
+
t("div", xe, [
|
|
309
|
+
b(W, {
|
|
311
310
|
"enter-active-class": "transition-all duration-300 ease-in-out overflow-hidden",
|
|
312
311
|
"leave-active-class": "transition-all duration-300 ease-in-out overflow-hidden",
|
|
313
312
|
"enter-from-class": "opacity-0",
|
|
@@ -315,179 +314,148 @@ const ve = {
|
|
|
315
314
|
"leave-from-class": "opacity-100",
|
|
316
315
|
"leave-to-class": "opacity-0"
|
|
317
316
|
}, {
|
|
318
|
-
default:
|
|
319
|
-
|
|
320
|
-
class: n(
|
|
317
|
+
default: g(() => [
|
|
318
|
+
Y(t("nav", {
|
|
319
|
+
class: n(E.value),
|
|
321
320
|
role: "navigation",
|
|
322
|
-
style:
|
|
321
|
+
style: te(j.value ? "transition: width 0.3s ease, opacity 0.3s ease;" : "")
|
|
323
322
|
}, [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
isOpen:
|
|
328
|
-
toggle: () =>
|
|
323
|
+
v.variant === "header" ? (r(), i(x, { key: 0 }, [
|
|
324
|
+
t("div", $e, [
|
|
325
|
+
s(e.$slots, "mobile-trigger", {
|
|
326
|
+
isOpen: a.value,
|
|
327
|
+
toggle: () => a.value = !a.value
|
|
329
328
|
}, () => [
|
|
330
|
-
|
|
329
|
+
t("button", {
|
|
331
330
|
type: "button",
|
|
332
331
|
ref_key: "mobileTriggerRef",
|
|
333
|
-
ref:
|
|
332
|
+
ref: $,
|
|
334
333
|
class: n(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", [f.value.mobileTrigger, l.mobileTriggerClass]]),
|
|
335
|
-
onClick:
|
|
334
|
+
onClick: o[2] || (o[2] = (d) => a.value = !a.value)
|
|
336
335
|
}, [
|
|
337
|
-
|
|
336
|
+
b(z, {
|
|
338
337
|
icon: "lucide:menu",
|
|
339
338
|
class: "w-5 h-5"
|
|
340
339
|
}),
|
|
341
|
-
|
|
340
|
+
o[10] || (o[10] = t("span", { class: "sr-only" }, "Open Menu", -1))
|
|
342
341
|
], 2)
|
|
343
342
|
]),
|
|
344
|
-
e.$slots?.
|
|
343
|
+
e.$slots?.left ? (r(), i("div", {
|
|
345
344
|
key: 0,
|
|
346
|
-
class: n(["shrink-0", l.logoClass])
|
|
347
|
-
}, [
|
|
348
|
-
o(e.$slots, "logo", {}, () => [
|
|
349
|
-
(t(), $(J(l.logo ? "img" : "div"), {
|
|
350
|
-
src: l.logo,
|
|
351
|
-
class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
|
|
352
|
-
}, {
|
|
353
|
-
default: v(() => [
|
|
354
|
-
l.logo ? d("", !0) : (t(), $(Q, {
|
|
355
|
-
key: 0,
|
|
356
|
-
class: "h-6 w-6"
|
|
357
|
-
})),
|
|
358
|
-
!l.logo && l.logoAlt ? (t(), a("span", Be, K(l.logoAlt), 1)) : l.logo ? d("", !0) : (t(), a("span", Se, "Brand"))
|
|
359
|
-
]),
|
|
360
|
-
_: 1
|
|
361
|
-
}, 8, ["src"]))
|
|
362
|
-
])
|
|
363
|
-
], 2)) : d("", !0),
|
|
364
|
-
e.$slots?.left ? (t(), a("div", {
|
|
365
|
-
key: 1,
|
|
366
345
|
class: n(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", f.value.desktopContent])
|
|
367
346
|
}, [
|
|
368
|
-
|
|
369
|
-
], 2)) :
|
|
347
|
+
s(e.$slots, "left")
|
|
348
|
+
], 2)) : u("", !0)
|
|
370
349
|
]),
|
|
371
|
-
e.$slots?.center ? (
|
|
350
|
+
e.$slots?.center ? (r(), i("div", {
|
|
372
351
|
key: 0,
|
|
373
|
-
class: n([
|
|
352
|
+
class: n([D.value, "max-w-full", l.contentClass])
|
|
374
353
|
}, [
|
|
375
|
-
|
|
376
|
-
], 2)) :
|
|
377
|
-
|
|
354
|
+
s(e.$slots, "center")
|
|
355
|
+
], 2)) : u("", !0),
|
|
356
|
+
t("div", {
|
|
378
357
|
class: n(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", [
|
|
379
|
-
{ "ml-auto":
|
|
358
|
+
{ "ml-auto": v.centerPosition === "left" || v.centerPosition === "center" },
|
|
380
359
|
l.rightClass
|
|
381
360
|
]])
|
|
382
361
|
}, [
|
|
383
|
-
|
|
362
|
+
s(e.$slots, "right")
|
|
384
363
|
], 2)
|
|
385
|
-
], 64)) : (
|
|
386
|
-
e.$slots.header ?
|
|
364
|
+
], 64)) : (r(), i(x, { key: 1 }, [
|
|
365
|
+
e.$slots.header ? u("", !0) : (r(), i("div", {
|
|
387
366
|
key: 0,
|
|
388
367
|
class: n(f.value.mobileHeader)
|
|
389
368
|
}, [
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
o(e.$slots, "mobile-trigger", {
|
|
394
|
-
isOpen: i.value,
|
|
395
|
-
toggle: () => i.value = !i.value
|
|
369
|
+
s(e.$slots, "mobile-trigger", {
|
|
370
|
+
isOpen: a.value,
|
|
371
|
+
toggle: () => a.value = !a.value
|
|
396
372
|
}, () => [
|
|
397
|
-
|
|
373
|
+
t("button", {
|
|
398
374
|
type: "button",
|
|
399
375
|
ref_key: "mobileTriggerRef",
|
|
400
|
-
ref:
|
|
376
|
+
ref: $,
|
|
401
377
|
class: n(["p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md", l.mobileTriggerClass]),
|
|
402
|
-
onClick:
|
|
378
|
+
onClick: o[3] || (o[3] = (d) => a.value = !a.value)
|
|
403
379
|
}, [
|
|
404
|
-
|
|
380
|
+
b(z, {
|
|
405
381
|
icon: "lucide:menu",
|
|
406
382
|
class: "w-5 h-5"
|
|
407
383
|
}),
|
|
408
|
-
|
|
384
|
+
o[11] || (o[11] = t("span", { class: "sr-only" }, "Open Menu", -1))
|
|
409
385
|
], 2)
|
|
410
386
|
])
|
|
411
387
|
], 2)),
|
|
412
|
-
|
|
388
|
+
t("div", {
|
|
413
389
|
class: n(f.value.desktopSidebar)
|
|
414
390
|
}, [
|
|
415
|
-
|
|
416
|
-
key: 0,
|
|
417
|
-
class: n(["py-4.5 flex items-center px-4.5 z-10", l.logoClass])
|
|
418
|
-
}, [
|
|
419
|
-
o(e.$slots, "logo", {}, () => [
|
|
420
|
-
s[13] || (s[13] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
421
|
-
])
|
|
422
|
-
], 2)) : d("", !0),
|
|
423
|
-
r("div", {
|
|
391
|
+
t("div", {
|
|
424
392
|
class: n(["flex-1 px-2.5 pt-0 pb-4 overflow-y-auto space-y-4 scrollbar-thin", l.contentClass])
|
|
425
393
|
}, [
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
394
|
+
s(e.$slots, "left"),
|
|
395
|
+
s(e.$slots, "default"),
|
|
396
|
+
s(e.$slots, "center")
|
|
429
397
|
], 2),
|
|
430
|
-
e.$slots?.right ? (
|
|
431
|
-
key:
|
|
398
|
+
e.$slots?.right ? (r(), i("div", {
|
|
399
|
+
key: 0,
|
|
432
400
|
class: n(["p-2 border-t border-border shrink-0 bg-background mt-auto", l.rightClass])
|
|
433
401
|
}, [
|
|
434
|
-
|
|
435
|
-
], 2)) :
|
|
402
|
+
s(e.$slots, "right")
|
|
403
|
+
], 2)) : u("", !0)
|
|
436
404
|
], 2)
|
|
437
405
|
], 64))
|
|
438
406
|
], 6), [
|
|
439
|
-
[
|
|
407
|
+
[q, !F.value]
|
|
440
408
|
])
|
|
441
409
|
]),
|
|
442
410
|
_: 3
|
|
443
411
|
}),
|
|
444
|
-
e.$slots.main ? (
|
|
445
|
-
l.renderNestedTabs && y.value.length > 0 ? (
|
|
446
|
-
|
|
412
|
+
e.$slots.main ? (r(), i("main", Ce, [
|
|
413
|
+
l.renderNestedTabs && y.value.length > 0 ? (r(), i("div", Te, [
|
|
414
|
+
b(J, {
|
|
447
415
|
modelValue: k.value,
|
|
448
|
-
"onUpdate:modelValue":
|
|
449
|
-
onChange:
|
|
416
|
+
"onUpdate:modelValue": o[4] || (o[4] = (d) => k.value = d),
|
|
417
|
+
onChange: H,
|
|
450
418
|
items: y.value
|
|
451
419
|
}, null, 8, ["modelValue", "items"])
|
|
452
|
-
])) :
|
|
453
|
-
l.breadcrumb && l.breadcrumbPosition === "main" && c(h).items.value.length > 1 ? (
|
|
420
|
+
])) : u("", !0),
|
|
421
|
+
l.breadcrumb && l.breadcrumbPosition === "main" && c(h).items.value.length > 1 ? (r(), i("div", {
|
|
454
422
|
key: 1,
|
|
455
423
|
class: n(["shrink-0 w-full border-b border-border px-6 py-2", l.breadcrumbClass])
|
|
456
424
|
}, [
|
|
457
|
-
|
|
425
|
+
b(c(K), {
|
|
458
426
|
items: c(h).items.value,
|
|
459
427
|
variant: l.breadcrumbVariant,
|
|
460
428
|
separator: l.breadcrumbSeparator,
|
|
461
429
|
size: l.breadcrumbSize
|
|
462
430
|
}, null, 8, ["items", "variant", "separator", "size"])
|
|
463
|
-
], 2)) :
|
|
464
|
-
|
|
465
|
-
|
|
431
|
+
], 2)) : u("", !0),
|
|
432
|
+
t("div", ze, [
|
|
433
|
+
s(e.$slots, "main")
|
|
466
434
|
])
|
|
467
|
-
])) :
|
|
468
|
-
l.mobileMenuVariant === "dropdown" ? (
|
|
469
|
-
|
|
435
|
+
])) : u("", !0),
|
|
436
|
+
l.mobileMenuVariant === "dropdown" ? (r(), i(x, { key: 1 }, [
|
|
437
|
+
a.value ? (r(), i("div", {
|
|
470
438
|
key: 0,
|
|
471
439
|
ref_key: "mobileMenuRef",
|
|
472
|
-
ref:
|
|
440
|
+
ref: B,
|
|
473
441
|
class: n(["absolute top-[calc(100%_+_1px)] left-0 w-full bg-body border border-border/50 shadow-xl z-50 flex flex-col transition-all duration-300 origin-top overflow-hidden will-change-transform", l.menuClass])
|
|
474
442
|
}, [
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
443
|
+
t("div", Se, [
|
|
444
|
+
s(e.$slots, "mobile-menu", {}, () => [
|
|
445
|
+
t("div", Be, [
|
|
446
|
+
s(e.$slots, "left")
|
|
479
447
|
]),
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
448
|
+
o[12] || (o[12] = t("div", { class: "h-px bg-border/50 my-1 mx-2" }, null, -1)),
|
|
449
|
+
t("div", Ve, [
|
|
450
|
+
s(e.$slots, "center")
|
|
483
451
|
])
|
|
484
452
|
])
|
|
485
453
|
])
|
|
486
|
-
], 2)) :
|
|
487
|
-
], 64)) : (
|
|
454
|
+
], 2)) : u("", !0)
|
|
455
|
+
], 64)) : (r(), G(P, {
|
|
488
456
|
key: 2,
|
|
489
|
-
show:
|
|
490
|
-
"onUpdate:show":
|
|
457
|
+
show: a.value,
|
|
458
|
+
"onUpdate:show": o[5] || (o[5] = (d) => a.value = d),
|
|
491
459
|
position: "left",
|
|
492
460
|
size: "sm",
|
|
493
461
|
triggerClass: f.value.mobileTrigger,
|
|
@@ -495,173 +463,142 @@ const ve = {
|
|
|
495
463
|
headerClass: "pl-3! pr-4.5! py-3!",
|
|
496
464
|
bodyClass: "p-0!"
|
|
497
465
|
}, {
|
|
498
|
-
header:
|
|
499
|
-
|
|
500
|
-
|
|
466
|
+
header: g(() => [
|
|
467
|
+
s(e.$slots, "logo", {}, () => [
|
|
468
|
+
o[13] || (o[13] = L("Brand", -1))
|
|
501
469
|
])
|
|
502
470
|
]),
|
|
503
|
-
default:
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
471
|
+
default: g(() => [
|
|
472
|
+
t("div", Me, [
|
|
473
|
+
v.variant === "header" ? (r(), i("div", Oe, [
|
|
474
|
+
s(e.$slots, "mobile-menu", {}, () => [
|
|
475
|
+
s(e.$slots, "left"),
|
|
476
|
+
o[14] || (o[14] = t("div", { class: "h-px bg-border my-2" }, null, -1)),
|
|
477
|
+
s(e.$slots, "center")
|
|
510
478
|
])
|
|
511
|
-
])) : (
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
479
|
+
])) : (r(), i("div", Ne, [
|
|
480
|
+
s(e.$slots, "left"),
|
|
481
|
+
s(e.$slots, "default"),
|
|
482
|
+
s(e.$slots, "center")
|
|
515
483
|
])),
|
|
516
|
-
e.$slots?.right ? (
|
|
517
|
-
|
|
518
|
-
])) :
|
|
484
|
+
e.$slots?.right ? (r(), i("div", Le, [
|
|
485
|
+
s(e.$slots, "right")
|
|
486
|
+
])) : u("", !0)
|
|
519
487
|
])
|
|
520
488
|
]),
|
|
521
489
|
_: 3
|
|
522
490
|
}, 8, ["show", "triggerClass", "class"]))
|
|
523
491
|
])
|
|
524
|
-
])) : (
|
|
492
|
+
])) : (r(), i("nav", {
|
|
525
493
|
key: 2,
|
|
526
|
-
class: n(
|
|
494
|
+
class: n(E.value),
|
|
527
495
|
role: "navigation"
|
|
528
496
|
}, [
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
isOpen:
|
|
533
|
-
toggle: () =>
|
|
497
|
+
v.variant === "header" ? (r(), i(x, { key: 0 }, [
|
|
498
|
+
t("div", Pe, [
|
|
499
|
+
s(e.$slots, "mobile-trigger", {
|
|
500
|
+
isOpen: a.value,
|
|
501
|
+
toggle: () => a.value = !a.value
|
|
534
502
|
}, () => [
|
|
535
|
-
|
|
503
|
+
t("button", {
|
|
536
504
|
type: "button",
|
|
537
505
|
ref_key: "mobileTriggerRef",
|
|
538
|
-
ref:
|
|
506
|
+
ref: $,
|
|
539
507
|
class: n(["p-2 -ml-2 text-muted-foreground hover:bg-accent rounded-md shrink-0", [f.value.mobileTrigger, l.mobileTriggerClass]]),
|
|
540
|
-
onClick:
|
|
508
|
+
onClick: o[6] || (o[6] = (d) => a.value = !a.value)
|
|
541
509
|
}, [
|
|
542
|
-
|
|
510
|
+
b(z, {
|
|
543
511
|
icon: "lucide:menu",
|
|
544
512
|
class: "w-5 h-5"
|
|
545
513
|
}),
|
|
546
|
-
|
|
514
|
+
o[15] || (o[15] = t("span", { class: "sr-only" }, "Open Menu", -1))
|
|
547
515
|
], 2)
|
|
548
516
|
]),
|
|
549
|
-
e.$slots?.
|
|
517
|
+
e.$slots?.left ? (r(), i("div", {
|
|
550
518
|
key: 0,
|
|
551
|
-
class: n(["shrink-0", l.logoClass])
|
|
552
|
-
}, [
|
|
553
|
-
o(e.$slots, "logo", {}, () => [
|
|
554
|
-
(t(), $(J(l.logo ? "img" : "div"), {
|
|
555
|
-
src: l.logo,
|
|
556
|
-
class: "h-8 w-auto font-bold text-xl flex items-center gap-2"
|
|
557
|
-
}, {
|
|
558
|
-
default: v(() => [
|
|
559
|
-
l.logo ? d("", !0) : (t(), $(Q, {
|
|
560
|
-
key: 0,
|
|
561
|
-
class: "h-6 w-6"
|
|
562
|
-
})),
|
|
563
|
-
!l.logo && l.logoAlt ? (t(), a("span", Ae, K(l.logoAlt), 1)) : l.logo ? d("", !0) : (t(), a("span", De, "Brand"))
|
|
564
|
-
]),
|
|
565
|
-
_: 1
|
|
566
|
-
}, 8, ["src"]))
|
|
567
|
-
])
|
|
568
|
-
], 2)) : d("", !0),
|
|
569
|
-
e.$slots?.left ? (t(), a("div", {
|
|
570
|
-
key: 1,
|
|
571
519
|
class: n(["items-center gap-1 overflow-x-auto no-scrollbar mask-gradient", f.value.desktopContent])
|
|
572
520
|
}, [
|
|
573
|
-
|
|
574
|
-
], 2)) :
|
|
521
|
+
s(e.$slots, "left")
|
|
522
|
+
], 2)) : u("", !0)
|
|
575
523
|
]),
|
|
576
|
-
e.$slots?.center ? (
|
|
524
|
+
e.$slots?.center ? (r(), i("div", {
|
|
577
525
|
key: 0,
|
|
578
|
-
class: n([
|
|
526
|
+
class: n([D.value, "max-w-full", l.contentClass])
|
|
579
527
|
}, [
|
|
580
|
-
|
|
581
|
-
], 2)) :
|
|
582
|
-
|
|
528
|
+
s(e.$slots, "center")
|
|
529
|
+
], 2)) : u("", !0),
|
|
530
|
+
t("div", {
|
|
583
531
|
class: n(["flex items-center gap-2 shrink-0 max-w-[40%] z-10", [
|
|
584
|
-
{ "ml-auto":
|
|
532
|
+
{ "ml-auto": v.centerPosition === "left" || v.centerPosition === "center" },
|
|
585
533
|
l.rightClass
|
|
586
534
|
]])
|
|
587
535
|
}, [
|
|
588
|
-
|
|
536
|
+
s(e.$slots, "right")
|
|
589
537
|
], 2)
|
|
590
|
-
], 64)) : (
|
|
591
|
-
|
|
538
|
+
], 64)) : (r(), i(x, { key: 1 }, [
|
|
539
|
+
t("div", {
|
|
592
540
|
class: n(f.value.mobileHeader)
|
|
593
541
|
}, [
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
o(e.$slots, "mobile-trigger", {
|
|
598
|
-
isOpen: i.value,
|
|
599
|
-
toggle: () => i.value = !i.value
|
|
542
|
+
s(e.$slots, "mobile-trigger", {
|
|
543
|
+
isOpen: a.value,
|
|
544
|
+
toggle: () => a.value = !a.value
|
|
600
545
|
}, () => [
|
|
601
|
-
|
|
546
|
+
t("button", {
|
|
602
547
|
type: "button",
|
|
603
548
|
ref_key: "mobileTriggerRef",
|
|
604
|
-
ref:
|
|
549
|
+
ref: $,
|
|
605
550
|
class: n(["p-2 -mr-2 text-muted-foreground hover:bg-accent rounded-md", l.mobileTriggerClass]),
|
|
606
|
-
onClick:
|
|
551
|
+
onClick: o[7] || (o[7] = (d) => a.value = !a.value)
|
|
607
552
|
}, [
|
|
608
|
-
|
|
553
|
+
b(z, {
|
|
609
554
|
icon: "lucide:menu",
|
|
610
555
|
class: "w-5 h-5"
|
|
611
556
|
}),
|
|
612
|
-
|
|
557
|
+
o[16] || (o[16] = t("span", { class: "sr-only" }, "Open Menu", -1))
|
|
613
558
|
], 2)
|
|
614
559
|
])
|
|
615
560
|
], 2),
|
|
616
|
-
|
|
561
|
+
t("div", {
|
|
617
562
|
class: n(f.value.desktopSidebar)
|
|
618
563
|
}, [
|
|
619
|
-
|
|
620
|
-
key: 0,
|
|
621
|
-
class: n(["py-4.5 flex items-center px-4.5 z-10", l.logoClass])
|
|
622
|
-
}, [
|
|
623
|
-
o(e.$slots, "logo", {}, () => [
|
|
624
|
-
s[20] || (s[20] = r("div", { class: "font-bold text-xl truncate" }, "Brand", -1))
|
|
625
|
-
])
|
|
626
|
-
], 2)) : d("", !0),
|
|
627
|
-
r("div", {
|
|
564
|
+
t("div", {
|
|
628
565
|
class: n(["flex-1 px-2.5 pt-0 pb-4 overflow-y-auto space-y-4 scrollbar-thin", l.contentClass])
|
|
629
566
|
}, [
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
567
|
+
s(e.$slots, "left"),
|
|
568
|
+
s(e.$slots, "default"),
|
|
569
|
+
s(e.$slots, "center")
|
|
633
570
|
], 2),
|
|
634
|
-
e.$slots?.right ? (
|
|
635
|
-
key:
|
|
571
|
+
e.$slots?.right ? (r(), i("div", {
|
|
572
|
+
key: 0,
|
|
636
573
|
class: n(["p-2 border-t border-border shrink-0 bg-background mt-auto", l.rightClass])
|
|
637
574
|
}, [
|
|
638
|
-
|
|
639
|
-
], 2)) :
|
|
575
|
+
s(e.$slots, "right")
|
|
576
|
+
], 2)) : u("", !0)
|
|
640
577
|
], 2)
|
|
641
578
|
], 64)),
|
|
642
|
-
l.mobileMenuVariant === "dropdown" ? (
|
|
643
|
-
|
|
579
|
+
l.mobileMenuVariant === "dropdown" ? (r(), i(x, { key: 2 }, [
|
|
580
|
+
a.value ? (r(), i("div", {
|
|
644
581
|
key: 0,
|
|
645
582
|
ref_key: "mobileMenuRef",
|
|
646
|
-
ref:
|
|
583
|
+
ref: B,
|
|
647
584
|
class: n(["absolute top-[calc(100%_+_1px)] left-0 w-full bg-body border border-border/50 shadow-xl z-50 flex flex-col transition-all duration-300 origin-top overflow-hidden will-change-transform", l.menuClass])
|
|
648
585
|
}, [
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
586
|
+
t("div", Re, [
|
|
587
|
+
s(e.$slots, "mobile-menu", {}, () => [
|
|
588
|
+
t("div", He, [
|
|
589
|
+
s(e.$slots, "left")
|
|
653
590
|
]),
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
591
|
+
o[17] || (o[17] = t("div", { class: "h-px bg-border/50 my-1 mx-2" }, null, -1)),
|
|
592
|
+
t("div", je, [
|
|
593
|
+
s(e.$slots, "center")
|
|
657
594
|
])
|
|
658
595
|
])
|
|
659
596
|
])
|
|
660
|
-
], 2)) :
|
|
661
|
-
], 64)) : (
|
|
597
|
+
], 2)) : u("", !0)
|
|
598
|
+
], 64)) : (r(), G(P, {
|
|
662
599
|
key: 3,
|
|
663
|
-
show:
|
|
664
|
-
"onUpdate:show":
|
|
600
|
+
show: a.value,
|
|
601
|
+
"onUpdate:show": o[8] || (o[8] = (d) => a.value = d),
|
|
665
602
|
position: "left",
|
|
666
603
|
size: "sm",
|
|
667
604
|
triggerClass: f.value.mobileTrigger,
|
|
@@ -669,27 +606,27 @@ const ve = {
|
|
|
669
606
|
headerClass: "pl-3! pr-4.5! py-3!",
|
|
670
607
|
bodyClass: "p-0!"
|
|
671
608
|
}, {
|
|
672
|
-
header:
|
|
673
|
-
|
|
674
|
-
|
|
609
|
+
header: g(() => [
|
|
610
|
+
s(e.$slots, "logo", {}, () => [
|
|
611
|
+
o[18] || (o[18] = L("Brand", -1))
|
|
675
612
|
])
|
|
676
613
|
]),
|
|
677
|
-
default:
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
614
|
+
default: g(() => [
|
|
615
|
+
t("div", Ie, [
|
|
616
|
+
v.variant === "header" ? (r(), i("div", Ue, [
|
|
617
|
+
s(e.$slots, "mobile-menu", {}, () => [
|
|
618
|
+
s(e.$slots, "left"),
|
|
619
|
+
o[19] || (o[19] = t("div", { class: "h-px bg-border my-2" }, null, -1)),
|
|
620
|
+
s(e.$slots, "center")
|
|
684
621
|
])
|
|
685
|
-
])) : (
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
622
|
+
])) : (r(), i("div", Ee, [
|
|
623
|
+
s(e.$slots, "left"),
|
|
624
|
+
s(e.$slots, "default"),
|
|
625
|
+
s(e.$slots, "center")
|
|
689
626
|
])),
|
|
690
|
-
e.$slots?.right ? (
|
|
691
|
-
|
|
692
|
-
])) :
|
|
627
|
+
e.$slots?.right ? (r(), i("div", De, [
|
|
628
|
+
s(e.$slots, "right")
|
|
629
|
+
])) : u("", !0)
|
|
693
630
|
])
|
|
694
631
|
]),
|
|
695
632
|
_: 3
|
|
@@ -698,5 +635,5 @@ const ve = {
|
|
|
698
635
|
}
|
|
699
636
|
});
|
|
700
637
|
export {
|
|
701
|
-
|
|
638
|
+
el as default
|
|
702
639
|
};
|
|
@@ -20,5 +20,6 @@ declare const _default: import('vue').DefineComponent<SidebarMenuProps, {}, {},
|
|
|
20
20
|
nestedMenuWidth: string;
|
|
21
21
|
nestedMenuMaxHeight: string;
|
|
22
22
|
showTooltip: boolean;
|
|
23
|
+
forceTreeView: boolean;
|
|
23
24
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
24
25
|
export default _default;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as P, inject as N, ref as T, computed as l, watch as B, reactive as L, provide as O, openBlock as g, createElementBlock as k, normalizeClass as W, Fragment as H, renderList as R, createBlock as A } from "vue";
|
|
2
2
|
import { useRoute as F } from "vue-router";
|
|
3
|
-
import { useBreakpoints as
|
|
3
|
+
import { useBreakpoints as V, breakpointsTailwind as _ } from "@vueuse/core";
|
|
4
4
|
import j from "./SidebarMenuItem.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
const U = /* @__PURE__ */
|
|
6
|
+
const U = /* @__PURE__ */ P({
|
|
7
7
|
__name: "SidebarMenu",
|
|
8
8
|
props: {
|
|
9
9
|
items: { default: () => [] },
|
|
@@ -26,121 +26,123 @@ const U = /* @__PURE__ */ E({
|
|
|
26
26
|
menuOffset: { default: () => [0, 10] },
|
|
27
27
|
orientation: { default: "vertical" },
|
|
28
28
|
mobileBreakpoint: { default: "none" },
|
|
29
|
-
showTooltip: { type: Boolean, default: !0 }
|
|
29
|
+
showTooltip: { type: Boolean, default: !0 },
|
|
30
|
+
forceTreeView: { type: Boolean, default: !1 }
|
|
30
31
|
},
|
|
31
32
|
setup(m) {
|
|
32
|
-
const
|
|
33
|
+
const d = N("navbar-context", null), t = m, f = F(), y = V(_), s = T([...t.defaultExpanded]), v = T(null), z = l(() => !t.mobileBreakpoint || t.mobileBreakpoint === "none" ? !0 : y.greaterOrEqual(t.mobileBreakpoint).value), h = l(() => z.value && t.orientation || "vertical"), x = l(() => t.forceTreeView ? !1 : !!d?.renderNestedTabs?.value), p = (e) => e.id || (typeof e.to == "string" ? e.to : null) || e.label, b = (e, n) => {
|
|
33
34
|
if (!e.to) return !1;
|
|
34
|
-
const
|
|
35
|
-
if (!
|
|
36
|
-
if (n ===
|
|
37
|
-
if (
|
|
38
|
-
const i = n[
|
|
35
|
+
const a = typeof e.to == "string" ? e.to : e.to.path;
|
|
36
|
+
if (!a) return !1;
|
|
37
|
+
if (n === a) return !0;
|
|
38
|
+
if (a !== "/" && a.length > 1 && n.startsWith(a)) {
|
|
39
|
+
const i = n[a.length];
|
|
39
40
|
return !i || i === "/" || i === "?";
|
|
40
41
|
}
|
|
41
42
|
return !1;
|
|
42
|
-
},
|
|
43
|
+
}, w = (e, n, a = []) => {
|
|
43
44
|
for (const i of e) {
|
|
44
45
|
const u = p(i);
|
|
45
46
|
if (i.children?.length) {
|
|
46
|
-
const r =
|
|
47
|
+
const r = w(i.children, n, [...a, u]);
|
|
47
48
|
if (r !== null)
|
|
48
|
-
return
|
|
49
|
+
return s.value.includes(u) || s.value.push(u), r;
|
|
49
50
|
}
|
|
50
51
|
if (b(i, n))
|
|
51
|
-
return
|
|
52
|
-
|
|
52
|
+
return a.forEach((r) => {
|
|
53
|
+
s.value.includes(r) || s.value.push(r);
|
|
53
54
|
}), u;
|
|
54
55
|
}
|
|
55
56
|
return null;
|
|
56
57
|
}, C = (e, n) => {
|
|
57
|
-
for (const
|
|
58
|
-
if (!
|
|
59
|
-
(
|
|
58
|
+
for (const a of t.items) {
|
|
59
|
+
if (!a.children?.length || !(b(a, e) || a.children.some(
|
|
60
|
+
(o) => b(o, e) || o.children?.some((c) => b(c, e))
|
|
60
61
|
))) continue;
|
|
61
|
-
const u =
|
|
62
|
-
label:
|
|
63
|
-
labelI18n:
|
|
64
|
-
value: p(
|
|
65
|
-
icon:
|
|
66
|
-
disabled:
|
|
67
|
-
to:
|
|
68
|
-
href:
|
|
62
|
+
const u = a.children.map((o) => ({
|
|
63
|
+
label: o.label,
|
|
64
|
+
labelI18n: o.labelI18n,
|
|
65
|
+
value: p(o),
|
|
66
|
+
icon: o.icon,
|
|
67
|
+
disabled: o.disabled,
|
|
68
|
+
to: o.to,
|
|
69
|
+
href: o.href
|
|
69
70
|
}));
|
|
70
71
|
let r = u[0]?.value ?? "";
|
|
71
72
|
if (n) {
|
|
72
|
-
const
|
|
73
|
-
if (
|
|
74
|
-
r =
|
|
73
|
+
const o = u.find((c) => c.value === n);
|
|
74
|
+
if (o)
|
|
75
|
+
r = o.value;
|
|
75
76
|
else {
|
|
76
|
-
const
|
|
77
|
-
(
|
|
77
|
+
const c = a.children.find(
|
|
78
|
+
(I) => I.children?.some((E) => p(E) === n)
|
|
78
79
|
);
|
|
79
|
-
|
|
80
|
+
c && (r = p(c));
|
|
80
81
|
}
|
|
81
82
|
}
|
|
82
83
|
return { tabs: u, activeTab: r };
|
|
83
84
|
}
|
|
84
85
|
return null;
|
|
85
86
|
}, M = (e) => {
|
|
86
|
-
const n =
|
|
87
|
-
if (v.value = n, !
|
|
88
|
-
const
|
|
89
|
-
|
|
87
|
+
const n = w(t.items, e);
|
|
88
|
+
if (v.value = n, !x.value) return;
|
|
89
|
+
const a = C(e, n);
|
|
90
|
+
a ? d.setNestedTabs(a.tabs, a.activeTab) : d.setNestedTabs([], "");
|
|
90
91
|
};
|
|
91
|
-
|
|
92
|
+
B(
|
|
92
93
|
() => f?.path,
|
|
93
94
|
(e) => {
|
|
94
95
|
e && M(e);
|
|
95
96
|
},
|
|
96
97
|
{ immediate: !0 }
|
|
97
|
-
),
|
|
98
|
-
() =>
|
|
98
|
+
), B(
|
|
99
|
+
() => t.items,
|
|
99
100
|
() => {
|
|
100
101
|
f?.path && M(f.path);
|
|
101
102
|
},
|
|
102
103
|
{ deep: !0 }
|
|
103
104
|
);
|
|
104
|
-
const
|
|
105
|
+
const S = L({
|
|
105
106
|
activeItem: v,
|
|
106
|
-
expandedItems:
|
|
107
|
+
expandedItems: s,
|
|
107
108
|
toggleExpand: (e) => {
|
|
108
|
-
|
|
109
|
+
s.value.includes(e) ? s.value = s.value.filter((a) => a !== e) : t.allowMultiple ? s.value.push(e) : s.value = [e];
|
|
109
110
|
},
|
|
110
111
|
setActive: (e) => {
|
|
111
|
-
if (v.value = e,
|
|
112
|
+
if (v.value = e, x.value && f?.path) {
|
|
112
113
|
const n = C(f.path, e);
|
|
113
|
-
n ?
|
|
114
|
+
n ? d.setNestedTabs(n.tabs, n.activeTab) : d.setNestedTabs([], "");
|
|
114
115
|
}
|
|
115
116
|
},
|
|
116
|
-
indentSize: l(() =>
|
|
117
|
-
variant: l(() =>
|
|
118
|
-
renderMode: l(() =>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
117
|
+
indentSize: l(() => t.indentSize),
|
|
118
|
+
variant: l(() => t.variant),
|
|
119
|
+
renderMode: l(() => t.renderMode || "tree"),
|
|
120
|
+
// Expose the effective value so SidebarMenuItem respects forceTreeView
|
|
121
|
+
renderNestedTabs: x,
|
|
122
|
+
compact: l(() => t.compact),
|
|
123
|
+
showCompactLabels: l(() => t.showCompactLabels),
|
|
124
|
+
iconSize: l(() => t.iconSize),
|
|
125
|
+
compactIconSize: l(() => t.compactIconSize),
|
|
126
|
+
labelClass: l(() => t.labelClass),
|
|
127
|
+
compactLabelClass: l(() => t.compactLabelClass),
|
|
128
|
+
itemPadding: l(() => t.itemPadding),
|
|
129
|
+
compactItemPadding: l(() => t.compactItemPadding),
|
|
130
|
+
nestedMenuWidth: l(() => t.nestedMenuWidth),
|
|
131
|
+
nestedMenuMaxHeight: l(() => t.nestedMenuMaxHeight),
|
|
130
132
|
currentOrientation: h,
|
|
131
|
-
showTooltip: l(() =>
|
|
133
|
+
showTooltip: l(() => t.showTooltip)
|
|
132
134
|
});
|
|
133
|
-
return
|
|
134
|
-
class:
|
|
135
|
+
return O("sidebar-menu-ctx", S), (e, n) => (g(), k("nav", {
|
|
136
|
+
class: W(["flex w-full transition-all duration-300", [
|
|
135
137
|
h.value === "horizontal" ? "flex-row flex-wrap gap-2 items-center" : "flex-col",
|
|
136
|
-
h.value === "vertical" && !
|
|
138
|
+
h.value === "vertical" && !t.compact ? "space-y-1" : ""
|
|
137
139
|
]]),
|
|
138
140
|
role: "tree",
|
|
139
141
|
"aria-label": "Sidebar Menu"
|
|
140
142
|
}, [
|
|
141
|
-
(
|
|
142
|
-
key:
|
|
143
|
-
item:
|
|
143
|
+
(g(!0), k(H, null, R(m.items, (a) => (g(), A(j, {
|
|
144
|
+
key: a.id || a.label,
|
|
145
|
+
item: a,
|
|
144
146
|
itemClass: m.itemClass,
|
|
145
147
|
menuOffset: m.menuOffset
|
|
146
148
|
}, null, 8, ["item", "itemClass", "menuOffset"]))), 128))
|
|
@@ -38,6 +38,11 @@ export interface SidebarMenuProps {
|
|
|
38
38
|
orientation?: 'vertical' | 'horizontal';
|
|
39
39
|
mobileBreakpoint?: 'sm' | 'md' | 'lg' | 'xl' | 'none';
|
|
40
40
|
showTooltip?: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* When true, forces tree view rendering regardless of the navbar's renderNestedTabs context.
|
|
43
|
+
* Useful for showing the full tree on small screens even when renderNestedTabs is active.
|
|
44
|
+
*/
|
|
45
|
+
forceTreeView?: boolean;
|
|
41
46
|
}
|
|
42
47
|
export interface SidebarMenuContext {
|
|
43
48
|
activeItem: string | null;
|
package/package.json
CHANGED
|
File without changes
|