@scalar/api-client
Version:
the open source API testing client
98 lines (97 loc) • 3.31 kB
JavaScript
import { defineComponent as h, createElementBlock as o, openBlock as r, normalizeClass as f, unref as e, createVNode as t, withCtx as n, createElementVNode as c, Fragment as w, renderList as k, createTextVNode as d, toDisplayString as b, createCommentVNode as y } from "vue";
import { ScalarIcon as C } from "@scalar/components";
import { useRouter as S } from "vue-router";
import { ROUTES as L } from "../../constants.js";
import { PathId as u } from "../../routes.js";
import B from "./DownloadAppButton.vue.js";
import E from "./SideHelp.vue.js";
import _ from "./SideNavGroup.vue.js";
import g from "./SideNavRouterLink.vue.js";
import { useActiveEntities as N } from "../../store/active-entities.js";
import { useLayout as V } from "../../hooks/useLayout.js";
const j = { class: "flex items-center" }, A = { class: "flex items-center" }, R = {
key: 0,
class: "hidden items-center justify-center sm:ml-1.5 sm:flex"
}, J = /* @__PURE__ */ h({
__name: "SideNav",
setup(W) {
const { currentRoute: a } = S(), { layout: s } = V(), { activeWorkspace: l } = N();
return ($, p) => (r(), o("nav", {
"aria-label": "App Navigation",
class: f([
"app-drag-region flex items-center justify-center gap-1.5 pt-2 sm:justify-between",
e(s) === "web" ? "h-header border !pt-0" : "px-2 pb-2 sm:flex-col"
]),
role: "navigation"
}, [
t(_, { class: "app-no-drag-region" }, {
default: n(() => [
c("a", {
class: f(["mr-3 ml-1 hidden items-center", {
"sm:flex": e(s) === "web"
}]),
href: "https://www.scalar.com",
target: "_blank"
}, [
t(e(C), {
icon: "Logo",
size: "xl"
})
], 2),
(r(!0), o(w, null, k(e(L).filter(
(i) => i.to.name !== "settings.default"
), ({ icon: i, to: v, displayName: m }, x) => (r(), o("li", { key: x }, [
t(g, {
active: e(a).name === m.toLowerCase() || m.toLowerCase() === "environment" && e(a).name === "environment.collection",
icon: i,
to: {
...v,
params: {
[e(u).Workspace]: e(l)?.uid ?? "default"
}
}
}, {
default: n(() => [
d(b(m), 1)
]),
_: 2
}, 1032, ["active", "icon", "to"])
]))), 128))
]),
_: 1
}),
t(_, { class: "app-no-drag-region" }, {
default: n(() => [
c("li", j, [
t(g, {
active: e(a).name === "settings",
icon: "Settings",
to: {
name: "settings.default",
params: {
[e(u).Workspace]: e(l)?.uid
}
}
}, {
default: n(() => p[0] || (p[0] = [
d(" Settings ")
])),
_: 1,
__: [0]
}, 8, ["active", "to"])
]),
c("li", A, [
t(E)
]),
e(s) !== "desktop" ? (r(), o("li", R, [
t(B)
])) : y("", !0)
]),
_: 1
})
], 2));
}
});
export {
J as default
};