form-designer-xinyi
Version:
基于vue3的设计器,可视化开发页面表单
3 lines (2 loc) • 2.96 kB
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),f=require("ant-design-vue"),d=require("./QuestionCircleOutlined-BXZZt1vS.cjs");var g={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"}}]},name:"down",theme:"outlined"};function O(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?Object(arguments[n]):{},c=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(e).filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable}))),c.forEach(function(l){S(t,l,e[l])})}return t}function S(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var s=function(n,e){var c=O({},n,e.attrs);return r.createVNode(d.Icon,O({},c,{icon:g}),null)};s.displayName="DownOutlined";s.inheritAttrs=!1;var y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M890.5 755.3L537.9 269.2c-12.8-17.6-39-17.6-51.7 0L133.5 755.3A8 8 0 00140 768h75c5.1 0 9.9-2.5 12.9-6.6L512 369.8l284.1 391.6c3 4.1 7.8 6.6 12.9 6.6h75c6.5 0 10.3-7.4 6.5-12.7z"}}]},name:"up",theme:"outlined"};function v(t){for(var n=1;n<arguments.length;n++){var e=arguments[n]!=null?Object(arguments[n]):{},c=Object.keys(e);typeof Object.getOwnPropertySymbols=="function"&&(c=c.concat(Object.getOwnPropertySymbols(e).filter(function(l){return Object.getOwnPropertyDescriptor(e,l).enumerable}))),c.forEach(function(l){P(t,l,e[l])})}return t}function P(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}var m=function(n,e){var c=v({},n,e.attrs);return r.createVNode(d.Icon,v({},c,{icon:y}),null)};m.displayName="UpOutlined";m.inheritAttrs=!1;const w=r.defineComponent({props:{componentSchema:{type:Object,require:!0,default:()=>({})}},setup(t,{slots:n}){const e=r.ref(!1),c=()=>{e.value=!e.value},l=()=>{var a,u,p,h;const o=r.ref([]);if((a=t.componentSchema)!=null&&a.suffix&&(o.value=t.componentSchema.suffix.split(`
`).filter(i=>i.trim()!=="")),(u=t.componentSchema)!=null&&u.suffix){const i=r.h("div",null,o.value.map(b=>r.h("div",null,b)));return[((p=t.componentSchema)==null?void 0:p.label)??"",r.h(f.Popover,{content:i},()=>r.h(d.QuestionCircleOutlined,{class:"ant-form-item__suffix"}))]}return((h=t.componentSchema)==null?void 0:h.label)??""};return()=>{const o={...t.componentSchema,title:l(),extra:r.h(f.Button,{onClick:c,type:"text"},()=>[r.h(e.value?s:m),e.value?" 展开":" 收起"])},a=o.children??[];return delete o.children,r.h(f.Card,o,{default:()=>e.value?null:r.renderSlot(n,"edit-node",{},()=>a.map(u=>r.renderSlot(n,"node",{componentSchema:u})))})}}});exports.default=w;