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