UNPKG

@scalar/api-client

Version:

the open source API testing client

35 lines (34 loc) 1.19 kB
import { defineComponent as s, computed as l, createBlock as r, openBlock as p } from "vue"; import { cookieSchema as d } from "@scalar/oas-utils/entities/cookie"; import u from "../../components/Form/Form.vue.js"; import { useActiveEntities as k } from "../../store/active-entities.js"; import { useWorkspace as _ } from "../../store/store.js"; const x = /* @__PURE__ */ s({ __name: "CookieForm", setup(f) { const { activeCookieId: e } = k(), { cookies: t, cookieMutators: i } = _(), c = [ { label: "Name", key: "name", placeholder: "session_id" }, { label: "Value", key: "value", placeholder: "my-cookie-session-id" }, { label: "Domain", key: "domain", placeholder: "example.com" } // TODO: We don't check the path (yet), so we don't need to show it. // { label: 'Path', key: 'path', placeholder: '/' }, ], m = l( () => t[e.value] || d.parse({ name: "", value: "", domain: "", path: "" }) ), n = (o, a) => { i.edit(e.value, o, a); }; return (o, a) => (p(), r(u, { data: m.value, onUpdate: n, options: c }, null, 8, ["data"])); } }); export { x as default };