UNPKG

@scalar/api-client

Version:

the open source API testing client

57 lines (56 loc) 1.61 kB
import { defineComponent as p, ref as f, computed as s, watch as b, createBlock as v, openBlock as k, unref as x, withCtx as l, createVNode as m, createTextVNode as V } from "vue"; import { ScalarModal as w } from "@scalar/components"; import C from "../../../../components/CommandPalette/CommandActionForm.vue.js"; import _ from "../../../../components/CommandPalette/CommandActionInput.vue.js"; const g = /* @__PURE__ */ p({ __name: "CreateWorkspaceModal", props: { state: {} }, emits: ["create:workspace"], setup(a, { emit: d }) { const n = d, e = f(""), o = s(() => e.value.trim()), i = s( () => o.value.length === 0 ); b( () => a.state.open, (r) => { r && (e.value = ""); } ); const u = () => { o.value && (n("create:workspace", { name: o.value }), a.state.hide()); }; return (r, t) => (k(), v(x(w), { bodyClass: "border-t-0 rounded-t-lg", size: "xs", state: a.state }, { default: l(() => [ m(C, { disabled: i.value, onSubmit: u }, { submit: l(() => [...t[1] || (t[1] = [ V("Add Workspace", -1) ])]), default: l(() => [ m(_, { modelValue: e.value, "onUpdate:modelValue": t[0] || (t[0] = (c) => e.value = c), class: "-mt-[.5px] !p-0", placeholder: "Workspace name" }, null, 8, ["modelValue"]) ]), _: 1 }, 8, ["disabled"]) ]), _: 1 }, 8, ["state"])); } }); export { g as default };