@scalar/api-reference
Version:
Generate beautiful API references from OpenAPI documents
91 lines (90 loc) • 3.06 kB
JavaScript
import { defineComponent as h, createBlock as a, createCommentVNode as S, openBlock as r, unref as e, withCtx as o, createElementBlock as n, Fragment as c, renderList as u, createVNode as s, createTextVNode as y } from "vue";
import { getResolvedRef as P } from "@scalar/workspace-store/helpers/get-resolved-ref";
import k from "../../Section/SectionContainerAccordion.vue.js";
import q from "../../Section/SectionAccordion.vue.js";
import f from "../Schema/SchemaProperty.vue.js";
import v from "../../Anchor/Anchor.vue.js";
import B from "../../Section/SectionHeaderTag.vue.js";
import R from "../Schema/SchemaHeading.vue.js";
import g from "../../Section/SectionHeader.vue.js";
const C = {
key: 0,
class: "properties"
}, F = { key: 1 }, M = /* @__PURE__ */ h({
__name: "ClassicLayout",
props: {
options: {},
schemas: {}
},
setup(b) {
return (t, m) => t.schemas.length ? (r(), a(e(k), {
key: 0,
class: "reference-models"
}, {
title: o(() => [
s(e(g), { level: 2 }, {
default: o(() => m[0] || (m[0] = [
y("Models")
])),
_: 1,
__: [0]
})
]),
default: o(() => [
(r(!0), n(c, null, u(t.schemas, ({ id: p, name: l, schema: i }) => (r(), a(e(q), {
id: p,
key: l,
label: l
}, {
title: o(() => [
s(e(v), {
id: p,
class: "reference-models-anchor"
}, {
default: o(() => [
s(e(B), { level: 3 }, {
default: o(() => [
s(e(R), {
class: "reference-models-label",
name: i.title ?? l,
value: i
}, null, 8, ["name", "value"])
]),
_: 2
}, 1024)
]),
_: 2
}, 1032, ["id"])
]),
default: o(() => [
"properties" in i ? (r(), n("div", C, [
(r(!0), n(c, null, u(Object.entries(i.properties ?? {}), ([d, _]) => (r(), a(e(f), {
key: d,
name: d,
options: {
orderRequiredPropertiesFirst: t.options.orderRequiredPropertiesFirst,
orderSchemaPropertiesBy: t.options.orderSchemaPropertiesBy
},
required: i.required?.includes(d),
schema: e(P)(_)
}, null, 8, ["name", "options", "required", "schema"]))), 128))
])) : (r(), n("div", F, [
s(e(f), {
options: {
orderRequiredPropertiesFirst: t.options.orderRequiredPropertiesFirst,
orderSchemaPropertiesBy: t.options.orderSchemaPropertiesBy
},
schema: i
}, null, 8, ["options", "schema"])
]))
]),
_: 2
}, 1032, ["id", "label"]))), 128))
]),
_: 1
})) : S("", !0);
}
});
export {
M as default
};