@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
53 lines (52 loc) • 2.23 kB
JavaScript
import { defineComponent as i, createElementBlock as n, openBlock as c, createElementVNode as o, createVNode as t, unref as s, createTextVNode as p, toDisplayString as r } from "vue";
import { ScalarIconCaretRight as m } from "@scalar/icons";
import { getResolvedRef as a } from "@scalar/workspace-store/helpers/get-resolved-ref";
import d from "../OperationParameters.vue.js";
import u from "../OperationResponses.vue.js";
import f from "../../../../components/HttpMethod/HttpMethod.vue.js";
const b = { class: "group callback-list-item" }, h = { class: "font-code bg-b-1 callback-sticky-offset callback-list-item-title sticky flex cursor-pointer flex-row items-start gap-2 border-t py-3 text-sm group-open:flex-wrap" }, _ = { class: "text-c-1 min-w-0 flex-1 truncate leading-3 group-open:whitespace-normal" }, k = { class: "text-c-2" }, g = { class: "callback-operation-container flex flex-col gap-2" }, S = /* @__PURE__ */ i({
__name: "Callback",
props: {
callback: {},
method: {},
name: {},
url: {},
breadcrumb: {},
options: {}
},
setup(y) {
return (e, B) => (c(), n("details", b, [
o("summary", h, [
t(s(m), { class: "callback-list-item-icon text-c-3 group-hover:text-c-1 absolute top-3.5 -left-5 size-4 transition-transform duration-100 group-open:rotate-90" }),
t(s(f), {
as: "span",
class: "request-method py-0.75",
method: e.method
}, null, 8, ["method"]),
o("div", _, [
p(r(e.name) + " ", 1),
o("span", k, r(e.url), 1)
])
]),
o("div", g, [
t(d, {
options: e.options,
parameters: e.callback.parameters?.map((l) => s(a)(l)) ?? [],
requestBody: s(a)(e.callback.requestBody)
}, null, 8, ["options", "parameters", "requestBody"]),
t(u, {
collapsableItems: !1,
options: {
collapsableItems: !0,
orderRequiredPropertiesFirst: e.options.orderRequiredPropertiesFirst,
orderSchemaPropertiesBy: e.options.orderSchemaPropertiesBy
},
responses: e.callback.responses
}, null, 8, ["options", "responses"])
])
]));
}
});
export {
S as default
};