UNPKG

@scalar/api-client

Version:

the open source API testing client

82 lines (81 loc) 3.18 kB
import { defineComponent as d, createElementBlock as l, openBlock as n, createElementVNode as o, createVNode as i, unref as r, createBlock as v, createCommentVNode as u } from "vue"; import { ScalarIcon as a } from "@scalar/components"; import f from "../../scalar-address-bar-block/components/AddressBar.vue.js"; import g from "../../../../components/OpenApiClientButton.vue.js"; const y = { class: "lg:min-h-header t-app__top-container flex w-full flex-wrap items-center justify-center p-2 pt-2 lg:p-1 lg:pt-1" }, b = { class: "mb-2 flex w-1/2 flex-row items-center justify-end gap-1 lg:mb-0 lg:flex-1 lg:px-2.5" }, w = /* @__PURE__ */ d({ __name: "Header", props: { path: {}, method: {}, layout: {}, hideClientButton: { type: Boolean, default: !1 }, integration: {}, documentUrl: {}, source: {}, server: {}, servers: {}, history: {}, eventBus: {}, environment: {} }, emits: ["execute", "update:servers"], setup(B, { emit: p }) { const m = p; return (e, t) => (n(), l("div", y, [ t[6] || (t[6] = o("div", { class: "mb-2 flex w-1/2 flex-row items-center gap-1 lg:mb-0 lg:flex-1 lg:px-1" }, [ o("div", { class: "size-8" }) ], -1)), i(r(f), { environment: e.environment, eventBus: e.eventBus, history: e.history, layout: e.layout, method: e.method, path: e.path, server: e.server, servers: e.servers, onExecute: t[0] || (t[0] = (s) => m("execute")), "onUpdate:servers": t[1] || (t[1] = (s) => m("update:servers")) }, null, 8, ["environment", "eventBus", "history", "layout", "method", "path", "server", "servers"]), o("div", b, [ e.layout === "modal" && e.documentUrl && !e.hideClientButton ? (n(), v(r(g), { key: 0, buttonSource: "modal", class: "!w-fit lg:-mr-1", integration: e.integration ?? null, source: e.source ?? "api-reference", url: e.documentUrl }, null, 8, ["integration", "source", "url"])) : u("", !0), e.layout === "modal" && e.source !== "gitbook" ? (n(), l("button", { key: 1, class: "app-exit-button zoomed:static zoomed:p-1 fixed top-2 right-2 rounded-full p-2", type: "button", onClick: t[2] || (t[2] = (s) => e.eventBus.emit("ui:close:client-modal")) }, [ i(r(a), { icon: "Close", size: "lg", thickness: "2" }), t[4] || (t[4] = o("span", { class: "sr-only" }, "Close Client", -1)) ])) : u("", !0), e.layout === "modal" && e.source === "gitbook" ? (n(), l("button", { key: 2, class: "text-c-1 hover:bg-b-2 active:text-c-1 -mr-1.5 rounded p-2", type: "button", onClick: t[3] || (t[3] = (s) => e.eventBus.emit("ui:close:client-modal")) }, [ i(r(a), { icon: "Close", size: "md", thickness: "1.75" }), t[5] || (t[5] = o("span", { class: "sr-only" }, "Close Client", -1)) ])) : u("", !0) ]) ])); } }); export { w as default };