UNPKG

snowy-designer

Version:

基于Epic-Designer-Pro版本的设计器,可视化开发页面表单

62 lines (61 loc) 1.8 kB
import { defineComponent as d, inject as f, computed as r, createElementBlock as g, openBlock as v, createVNode as b, unref as k } from "vue"; /* empty css */ import "radix-vue"; import "clsx"; import "tailwind-merge"; import "lucide-vue-next"; import "../../../../base-ui/src/shadch-ui/button/index.js"; import "@vueuse/core"; import "../../../../base-ui/src/shadch-ui/toast/index.js"; import "vuedraggable"; import "../../../../../hooks/src/store/index.js"; import "lodash"; import { pluginManager as x } from "../../../../../utils/src/manager/pluginManager.js"; import "monaco-editor"; import "../../../../../utils/src/request/index.js"; const V = { class: "bg-gray-50 p-3" }, A = /* @__PURE__ */ d({ __name: "index", props: { modelValue: { default: () => ({}), type: Object } }, emits: ["update:modelValue"], setup(p, { emit: a }) { const i = p, m = a, u = x.getComponent("checkbox"), l = f("designer"), n = r({ get() { return i.modelValue; }, set(t) { m("update:modelValue", t); } }), c = r(() => { var t, e; return (t = l.state.selectedNodeConfig) != null && t.ownSlots ? (e = l.state.selectedNodeConfig) == null ? void 0 : e.ownSlots.map((o) => ({ label: o, value: o })) : []; }), s = r({ get() { return Object.keys(n.value); }, set(t) { const e = {}; t.forEach((o) => { e[o] = n.value[o] ?? []; }), n.value = e; } }); return (t, e) => (v(), g("div", V, [ b(k(u), { value: s.value, "onUpdate:value": e[0] || (e[0] = (o) => s.value = o), options: c.value }, null, 8, ["value", "options"]) ])); } }); export { A as default };