UNPKG

@scalar/api-client

Version:

the open source API testing client

97 lines (96 loc) 3.4 kB
import { defineComponent as x, createBlock as f, openBlock as r, withCtx as e, createElementBlock as l, createVNode as a, unref as u, createTextVNode as n, Fragment as d, renderList as y, toDisplayString as i } from "vue"; import b from "../../../components/DataTable/DataTable.vue.js"; import c from "../../../components/DataTable/DataTableRow.vue.js"; import p 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" }, z = /* @__PURE__ */ x({ __name: "RequestHeaders", props: { headers: {} }, setup(C) { const m = (s) => w.find( (t) => t.name.toLowerCase() === s.toLowerCase() ); return (s, t) => (r(), f(k, { class: "overflow-auto", defaultOpen: !1, itemCount: s.headers.length }, { title: e(() => [...t[0] || (t[0] = [ n("Request Headers", -1) ])]), default: e(() => [ s.headers.length ? (r(), l("div", h, [ a(b, { columns: ["minmax(auto, min-content)", "minmax(50%, 1fr)"], scroll: "" }, { default: e(() => [ a(c, { class: "sr-only !block" }, { default: e(() => [ a(u(_), null, { default: e(() => [...t[1] || (t[1] = [ n("Header Key", -1) ])]), _: 1 }), a(u(_), null, { default: e(() => [...t[2] || (t[2] = [ n("Header Value", -1) ])]), _: 1 }) ]), _: 1 }), (r(!0), l(d, null, y(s.headers, (o) => (r(), f(c, { key: o.name, class: "group/row text-c-1" }, { default: e(() => [ a(p, { 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" ? (r(), f(g, { key: 0, class: "decoration-c-3", href: m(o.name).url }, { default: e(() => [ n(i(o.name), 1) ]), _: 2 }, 1032, ["href"])) : (r(), l(d, { key: 1 }, [ n(i(o.name), 1) ], 64)) ]), _: 2 }, 1024), a(p, { class: "z-0 group-first/row:border-t-0", text: o.value }, null, 8, ["text"]) ]), _: 2 }, 1024))), 128)) ]), _: 1 }) ])) : (r(), l("div", H, " No Headers ")) ]), _: 1 }, 8, ["itemCount"])); } }); export { z as default };