UNPKG

@scalar/api-client

Version:

the open source API testing client

102 lines (101 loc) 3.57 kB
import { defineComponent as y, createBlock as f, openBlock as r, withCtx as e, createElementBlock as l, createVNode as a, unref as d, createTextVNode as n, Fragment as i, renderList as b, toDisplayString as c } from "vue"; import g from "../../../components/DataTable/DataTable.vue.js"; import p from "../../../components/DataTable/DataTableRow.vue.js"; import _ from "../../../components/DataTable/DataTableText.vue.js"; import k from "../../../components/HelpfulLink.vue.js"; import w from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js"; import { httpHeaders as h } from "../../../data/httpHeaders.js"; import x from "../../../components/DataTable/DataTableHeader.vue.js"; const H = { key: 0, class: "max-h-[calc(100%-32px)] overflow-y-auto" }, C = { key: 1, class: "text-c-3 bg-b-1 flex min-h-12 items-center justify-center rounded border px-4 text-base" }, D = /* @__PURE__ */ y({ __name: "RequestHeaders", props: { headers: {} }, setup(v) { const m = (s) => h.find( (t) => t.name.toLowerCase() === s.toLowerCase() ); return (s, t) => (r(), f(w, { class: "overflow-auto", defaultOpen: !1, itemCount: s.headers.length }, { title: e(() => t[0] || (t[0] = [ n("Request Headers") ])), default: e(() => [ s.headers.length ? (r(), l("div", H, [ a(g, { columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"], scroll: "" }, { default: e(() => [ a(p, { class: "sr-only !block" }, { default: e(() => [ a(d(x), null, { default: e(() => t[1] || (t[1] = [ n("Header Key") ])), _: 1, __: [1] }), a(d(x), null, { default: e(() => t[2] || (t[2] = [ n("Header Value") ])), _: 1, __: [2] }) ]), _: 1 }), (r(!0), l(i, null, b(s.headers, (o) => (r(), f(p, { key: o.name, class: "group/row text-c-1" }, { default: e(() => [ a(_, { class: "bg-b-1 sticky left-0 z-1 max-w-48 group-first/row:border-t-0" }, { default: e(() => { var u; return [ typeof ((u = m(o.name)) == null ? void 0 : u.url) == "string" ? (r(), f(k, { key: 0, class: "decoration-c-3", href: m(o.name).url }, { default: e(() => [ n(c(o.name), 1) ]), _: 2 }, 1032, ["href"])) : (r(), l(i, { key: 1 }, [ n(c(o.name), 1) ], 64)) ]; }), _: 2 }, 1024), a(_, { class: "z-0 group-first/row:border-t-0", text: o.value }, null, 8, ["text"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ])) : (r(), l("div", C, " No Headers ")) ]), _: 1 }, 8, ["itemCount"])); } }); export { D as default };