UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

58 lines (57 loc) 2.69 kB
import { defineComponent, createElementBlock, openBlock, createElementVNode, createVNode, unref, createTextVNode, toDisplayString } from "vue"; import { ScalarIconCaretRight } from "@scalar/icons"; import { getResolvedRef } from "@scalar/workspace-store/helpers/get-resolved-ref"; import _sfc_main$2 from "../OperationParameters.vue.js"; import _sfc_main$3 from "../OperationResponses.vue.js"; import _sfc_main$1 from "../../../../components/HttpMethod/HttpMethod.vue.js"; const _hoisted_1 = { class: "group callback-list-item" }; const _hoisted_2 = { 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" }; const _hoisted_3 = { class: "text-c-1 min-w-0 flex-1 truncate leading-3 group-open:whitespace-normal" }; const _hoisted_4 = { class: "text-c-2" }; const _hoisted_5 = { class: "callback-operation-container flex flex-col gap-2" }; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "Callback", props: { callback: {}, method: {}, name: {}, url: {}, eventBus: {}, options: {} }, setup(__props) { return (_ctx, _cache) => { return openBlock(), createElementBlock("details", _hoisted_1, [ createElementVNode("summary", _hoisted_2, [ createVNode(unref(ScalarIconCaretRight), { 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" }), createVNode(unref(_sfc_main$1), { as: "span", class: "request-method py-0.75", method: __props.method }, null, 8, ["method"]), createElementVNode("div", _hoisted_3, [ createTextVNode(toDisplayString(__props.name) + " ", 1), createElementVNode("span", _hoisted_4, toDisplayString(__props.url), 1) ]) ]), createElementVNode("div", _hoisted_5, [ createVNode(_sfc_main$2, { eventBus: __props.eventBus, options: __props.options, parameters: __props.callback.parameters?.map((param) => unref(getResolvedRef)(param)) ?? [], requestBody: unref(getResolvedRef)(__props.callback.requestBody) }, null, 8, ["eventBus", "options", "parameters", "requestBody"]), createVNode(_sfc_main$3, { collapsableItems: false, eventBus: __props.eventBus, options: __props.options, responses: __props.callback.responses }, null, 8, ["eventBus", "options", "responses"]) ]) ]); }; } }); export { _sfc_main as default };