@scalar/api-client
Version:
the open source API testing client
97 lines (96 loc) • 3.4 kB
JavaScript
import { defineComponent as x, createBlock as f, openBlock as t, withCtx as e, createElementBlock as l, createVNode as a, unref as d, createTextVNode as n, Fragment as u, renderList as y, toDisplayString as i } from "vue";
import b from "../../../components/DataTable/DataTable.vue.js";
import p from "../../../components/DataTable/DataTableRow.vue.js";
import c from "../../../components/DataTable/DataTableText.vue.js";
import g from "../../../components/HelpfulLink.vue.js";
import k from "../../../components/ViewLayout/ViewLayoutCollapse.vue.js";
import { httpHeaders as w } from "../../../data/httpHeaders.js";
import _ from "../../../components/DataTable/DataTableHeader.vue.js";
const h = {
key: 0,
class: "max-h-[calc(100%-32px)] overflow-y-auto"
}, H = {
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__ */ x({
__name: "ResponseHeaders",
props: {
headers: {}
},
setup(C) {
const m = (s) => w.find(
(r) => r.name.toLowerCase() === s.toLowerCase()
);
return (s, r) => (t(), f(k, {
class: "overflow-auto",
defaultOpen: !1,
itemCount: s.headers.length
}, {
title: e(() => [...r[0] || (r[0] = [
n("Response Headers", -1)
])]),
default: e(() => [
s.headers.length ? (t(), l("div", h, [
a(b, {
columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"],
scroll: ""
}, {
default: e(() => [
a(p, { class: "sr-only !block" }, {
default: e(() => [
a(d(_), null, {
default: e(() => [...r[1] || (r[1] = [
n("Header Key", -1)
])]),
_: 1
}),
a(d(_), null, {
default: e(() => [...r[2] || (r[2] = [
n("Header Value", -1)
])]),
_: 1
})
]),
_: 1
}),
(t(!0), l(u, null, y(s.headers, (o) => (t(), f(p, {
key: o.name,
class: "group/row text-c-1"
}, {
default: e(() => [
a(c, { class: "bg-b-1 sticky left-0 z-1 max-w-full group-first/row:border-t-0" }, {
default: e(() => [
typeof m(o.name)?.url == "string" ? (t(), f(g, {
key: 0,
class: "decoration-c-3",
href: m(o.name).url
}, {
default: e(() => [
n(i(o.name), 1)
]),
_: 2
}, 1032, ["href"])) : (t(), l(u, { key: 1 }, [
n(i(o.name), 1)
], 64))
]),
_: 2
}, 1024),
a(c, {
class: "z-0 group-first/row:border-t-0",
text: o.value
}, null, 8, ["text"])
]),
_: 2
}, 1024))), 128))
]),
_: 1
})
])) : (t(), l("div", H, " No Headers "))
]),
_: 1
}, 8, ["itemCount"]));
}
});
export {
D as default
};