@scalar/api-client
Version:
the open source API testing client
59 lines (58 loc) • 1.92 kB
JavaScript
import { defineComponent as p, ref as u, createBlock as f, openBlock as v, withCtx as n, createElementVNode as m, createVNode as l, unref as s } from "vue";
import { ScalarButton as x, ScalarTextInput as V } from "@scalar/components";
import { LibraryIcon as _ } from "@scalar/icons/library";
import b from "../../IconSelector.vue.js";
import S from "./SidebarListElementForm.vue.js";
const C = { class: "grid grid-cols-[auto_1fr] gap-2" }, g = { class: "flex aspect-square" }, $ = /* @__PURE__ */ p({
__name: "EditSidebarListCollection",
props: {
name: {},
icon: {}
},
emits: ["close", "edit"],
setup(d, { emit: c }) {
const r = d, i = c, a = u(r.name), o = u(r.icon);
return (w, e) => (v(), f(S, {
onCancel: e[2] || (e[2] = (t) => i("close")),
onSubmit: e[3] || (e[3] = (t) => i("edit", a.value, o.value))
}, {
default: n(() => [
m("div", C, [
m("div", g, [
l(b, {
modelValue: o.value,
"onUpdate:modelValue": e[0] || (e[0] = (t) => o.value = t),
placement: "bottom-start"
}, {
default: n(() => [
l(s(x), {
class: "aspect-square h-auto px-0",
variant: "outlined"
}, {
default: n(() => [
l(s(_), {
class: "text-c-2 size-4",
src: o.value
}, null, 8, ["src"])
]),
_: 1
})
]),
_: 1
}, 8, ["modelValue"])
]),
l(s(V), {
modelValue: a.value,
"onUpdate:modelValue": e[1] || (e[1] = (t) => a.value = t),
autofocus: "",
class: "flex-1"
}, null, 8, ["modelValue"])
])
]),
_: 1
}));
}
});
export {
$ as default
};