epic-designer-gold 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/attributeView-CPrGnVQ8.js +106 -0
  2. package/dist/attributeView-DEg9mFCt.cjs +1 -0
  3. package/dist/axios-BAhOY32t.cjs +6 -0
  4. package/dist/{js.cookie-oHpRFPCO.js → axios-BFVeUxau.js} +942 -737
  5. package/dist/col-BNNn9Yx8.cjs +1 -0
  6. package/dist/{col-Dy6oYMf5.js → col-u5YiB-UK.js} +8 -8
  7. package/dist/index-B8V7odtp.cjs +1 -0
  8. package/dist/index-BEXliJtJ.cjs +1 -0
  9. package/dist/index-BN_dXDiO.cjs +1 -0
  10. package/dist/index-BPRzjSrH.cjs +10 -0
  11. package/dist/index-BPmq8lmK.js +72 -0
  12. package/dist/index-BY9j66Gp.js +4 -0
  13. package/dist/{index-DNeYX6HK.js → index-BiXYEiWV.js} +1 -1
  14. package/dist/index-BoVrWUpL.js +271 -0
  15. package/dist/{index-DLMH0OSJ.js → index-BstMY1Nn.js} +1 -1
  16. package/dist/index-Bsv8EECz.js +71 -0
  17. package/dist/index-C2Sx6r6b.cjs +1 -0
  18. package/dist/index-C5-ZZLug.cjs +1 -0
  19. package/dist/index-C6C5D9M8.js +602 -0
  20. package/dist/index-CIwV58Ko.js +1359 -0
  21. package/dist/index-CgisEnmm.cjs +1 -0
  22. package/dist/index-CtkdvWFN.cjs +1 -0
  23. package/dist/{index-DkyxbMHi.js → index-Cwgv4MbW.js} +24 -24
  24. package/dist/{index-CYDtBJTI.cjs → index-D3Uft3bJ.cjs} +1 -1
  25. package/dist/{index-BKDRMrcc.js → index-D7z34DMU.js} +28 -47
  26. package/dist/index-DAhVvQNH.cjs +1 -0
  27. package/dist/index-DO5DuUPL.js +581 -0
  28. package/dist/index-DddOVmF6.cjs +1 -0
  29. package/dist/index-DdsHIglg.js +104 -0
  30. package/dist/index-Dru9G2MF.js +195 -0
  31. package/dist/index-KGGnmoAO.cjs +1 -0
  32. package/dist/{index-XUQ1VGQg.js → index-Sin3ac_7.js} +1 -1
  33. package/dist/{index-DJxuHxdI.js → index-dUOJH8fj.js} +24 -24
  34. package/dist/index-dcjty1Ho.cjs +1 -0
  35. package/dist/{index-Dyo12Kua.cjs → index-g1W7IHK_.cjs} +1 -1
  36. package/dist/index-ykB9CsYG.cjs +1 -0
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +35 -35
  39. package/dist/locale/index.d.ts +4 -0
  40. package/dist/locale/lang/en-US.d.ts +246 -0
  41. package/dist/locale/lang/zh-cn.d.ts +246 -0
  42. package/dist/modal-BLOgN3us.cjs +1 -0
  43. package/dist/modal-UFu4bD6x.js +57 -0
  44. package/dist/{outline-CNayBNNC.js → outline-CG-aHThT.js} +2 -2
  45. package/dist/outline-Coy4TGIa.cjs +1 -0
  46. package/dist/row-BWnbt6dh.cjs +1 -0
  47. package/dist/{row-qOviQw5w.js → row-DAy14ve9.js} +4 -4
  48. package/dist/sign-BlMhTkWG.cjs +1 -0
  49. package/dist/sign-C0z0Ygs4.js +219 -0
  50. package/dist/style.css +1 -1
  51. package/dist/{styleView-BLVqzqPV.js → styleView-CkbdwQhA.js} +34 -33
  52. package/dist/styleView-D0W-N4vW.cjs +1 -0
  53. package/dist/tree.vue_vue_type_script_setup_true_lang-KKt_Qgqv.cjs +1 -0
  54. package/dist/{tree.vue_vue_type_script_setup_true_lang-BntCm43E.js → tree.vue_vue_type_script_setup_true_lang-RWHCYpkY.js} +1 -1
  55. package/dist/ui/antd/date-picker/datePicker.d.ts +2 -2
  56. package/dist/ui/elementPlus/index.cjs +1 -1
  57. package/dist/ui/elementPlus/index.js +553 -542
  58. package/dist/ui/naiveUi/index.cjs +1 -1
  59. package/dist/ui/naiveUi/index.js +1 -1
  60. package/dist/uploadFile-Bh5GyGFd.js +77 -0
  61. package/dist/uploadFile-CmKFRZMw.cjs +1 -0
  62. package/dist/{uploadImage-742IA7ei.js → uploadImage-CbVsUivh.js} +34 -33
  63. package/dist/uploadImage-CcMA6CyX.cjs +1 -0
  64. package/dist/uploadImage-DENhzttU.cjs +1 -0
  65. package/dist/{uploadImage-CnNnAISs.js → uploadImage-qHq6JX83.js} +17 -20
  66. package/package.json +1 -1
  67. package/dist/attributeView-B-IswSw7.js +0 -105
  68. package/dist/attributeView-CQBVIMGW.cjs +0 -1
  69. package/dist/col-RWuL5Zuz.cjs +0 -1
  70. package/dist/index-0GtpyUBx.js +0 -64
  71. package/dist/index-B4ido7VJ.cjs +0 -1
  72. package/dist/index-BGvqo4s7.js +0 -104
  73. package/dist/index-BMtRXkSh.cjs +0 -1
  74. package/dist/index-BSLudrcT.cjs +0 -1
  75. package/dist/index-BXO8Zj1H.cjs +0 -1
  76. package/dist/index-B_9x_cPH.js +0 -1633
  77. package/dist/index-B_TFfRwe.js +0 -194
  78. package/dist/index-C3_E7xcD.js +0 -270
  79. package/dist/index-C3a1hfUC.cjs +0 -10
  80. package/dist/index-CucdgcqX.cjs +0 -1
  81. package/dist/index-CvEzOhT_.cjs +0 -1
  82. package/dist/index-DEPx91yu.cjs +0 -1
  83. package/dist/index-DKVv0PbJ.js +0 -56
  84. package/dist/index-DSzJgAzW.cjs +0 -1
  85. package/dist/index-Dz1OM1dD.cjs +0 -1
  86. package/dist/index-HNPgHrkl.cjs +0 -1
  87. package/dist/index-JhxJizMR.js +0 -601
  88. package/dist/index-aBofZ4Mk.js +0 -4
  89. package/dist/index-sKJ91s0r.cjs +0 -1
  90. package/dist/js.cookie-BH1G_HRi.cjs +0 -6
  91. package/dist/modal-BPJM1Muh.js +0 -59
  92. package/dist/modal-_fid8E1T.cjs +0 -1
  93. package/dist/outline-6Qt3qlWm.cjs +0 -1
  94. package/dist/row-Bm8OjIsU.cjs +0 -1
  95. package/dist/sign--js815Se.cjs +0 -1
  96. package/dist/sign-CO47QOTw.js +0 -218
  97. package/dist/styleView-C1zTBeyd.cjs +0 -1
  98. package/dist/tree.vue_vue_type_script_setup_true_lang-BjjL_VlR.cjs +0 -1
  99. package/dist/uploadFile-CYDDVa_x.js +0 -76
  100. package/dist/uploadFile-eWBMdZ9d.cjs +0 -1
  101. package/dist/uploadImage-BQhv5ymq.cjs +0 -1
  102. package/dist/uploadImage-BXcN2FA_.cjs +0 -1
@@ -1,64 +0,0 @@
1
- import { defineComponent as c, ref as o, watch as p, nextTick as g, openBlock as w, createBlock as U, unref as v, withCtx as y, createVNode as C } from "vue";
2
- import { p as r } from "./js.cookie-oHpRFPCO.js";
3
- const z = /* @__PURE__ */ c({
4
- __name: "index",
5
- props: {
6
- modelValue: {}
7
- },
8
- emits: ["update:modelValue"],
9
- setup(m, { emit: i }) {
10
- const s = r.getComponent("input"), d = r.getComponent("select"), f = m, x = i, e = o(null), a = o("px"), V = [
11
- { label: "px", value: "px" },
12
- { label: "%", value: "%" },
13
- { label: "vw", value: "vw" },
14
- { label: "vh", value: "vh" },
15
- { label: "rem", value: "rem" },
16
- { label: "em", value: "em" },
17
- { label: "pt", value: "pt" }
18
- ];
19
- p(() => f.modelValue, (t) => {
20
- if (!t) return;
21
- if (typeof t == "number") {
22
- e.value = String(t), a.value = "px";
23
- return;
24
- }
25
- const l = parseFloat(t);
26
- if (isNaN(l))
27
- return e.value = null, !1;
28
- const u = /^(\d+(\.\d+)?)(px|%|vw|vh|rem|em|pt){1}$/, n = t.trim().match(u);
29
- e.value = (n == null ? void 0 : n[1]) ?? null, a.value = (n == null ? void 0 : n[3]) ?? "";
30
- }, {
31
- immediate: !0
32
- }), p(() => a.value + e.value, () => {
33
- b();
34
- });
35
- function b() {
36
- g(() => x("update:modelValue", e.value ? e.value + a.value : void 0));
37
- }
38
- return (t, l) => (w(), U(v(s), {
39
- class: "epic-input-size",
40
- modelValue: e.value,
41
- "onUpdate:modelValue": l[2] || (l[2] = (u) => e.value = u),
42
- value: e.value,
43
- "onUpdate:value": l[3] || (l[3] = (u) => e.value = u),
44
- type: "number",
45
- min: "0",
46
- placeholder: "请输入"
47
- }, {
48
- suffix: y(() => [
49
- C(v(d), {
50
- value: a.value,
51
- "onUpdate:value": l[0] || (l[0] = (u) => a.value = u),
52
- modelValue: a.value,
53
- "onUpdate:modelValue": l[1] || (l[1] = (u) => a.value = u),
54
- style: { width: "68px" },
55
- options: V
56
- }, null, 8, ["value", "modelValue"])
57
- ]),
58
- _: 1
59
- }, 8, ["modelValue", "value"]));
60
- }
61
- });
62
- export {
63
- z as default
64
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),I=require("./js.cookie-BH1G_HRi.cjs"),y=require("./index-C3a1hfUC.cjs"),U=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),oe=require("./vuedraggable.umd-BqhSJIAi.cjs"),le={class:"epic-widget-action-item whitespace-nowrap"},ae={key:0,class:"flex items-center"},re=e.defineComponent({__name:"previewWidgets",setup(F,{expose:$}){const p=e.inject("pageManager",{}),g=e.inject("pageSchema"),l=e.inject("designer"),b=e.inject("designerProps"),c=e.inject("revoke"),h=e.ref(null),B=e.ref(null),N=e.ref(null),R=e.ref(!1),a=e.ref(!1),r=e.ref(!0),i=e.ref("top"),{canvasScale:s,disabledZoom:S}=y.useStore();let o=null;const O=e.computed(()=>{const t=l.state.checkedNode;return!(!(t!=null&&t.id)||b.value.lockDefaultSchemaEdit&&p.defaultComponentIds.value.includes(t==null?void 0:t.id)||t.type==="table-col")}),L=e.computed(()=>{const t=l.state.checkedNode;return(t==null?void 0:t.type)==="table-col"}),V=e.computed(()=>{const t=l.state.checkedNode;return(t==null?void 0:t.type)==="table"}),m=e.computed(()=>{var v,C,_,u,M,j;const t=p.componentInstances.value,d=(v=l.state.checkedNode)==null?void 0:v.id;if((_=(C=l.state.checkedNode)==null?void 0:C.componentProps)!=null&&_.hidden)return null;const f=I.pluginManager.getComponentConfingByType((u=l.state.checkedNode)==null?void 0:u.type)??null;if(!d||!(t!=null&&t[d]))return null;if(f!=null&&f.defaultSchema.input&&((M=l.state.checkedNode)==null?void 0:M.noFormItem)!==!0)return(j=t[d+"formItem"])==null?void 0:j.$el;const n=t[d];return!(n!=null&&n.$el)||(n==null?void 0:n.$el.nodeName)==="#text"||!(n!=null&&n.$el.getBoundingClientRect)?null:n==null?void 0:n.$el}),k=e.computed(()=>{var v,C,_,u;const t=p.componentInstances.value,d=(v=l.state.hoverNode)==null?void 0:v.id,f=I.pluginManager.getComponentConfingByType((C=l.state.hoverNode)==null?void 0:C.type)??null;if(!d||!(t!=null&&t[d]))return null;if(f!=null&&f.defaultSchema.input&&((_=l.state.hoverNode)==null?void 0:_.noFormItem)!==!0)return(u=t[d+"formItem"])==null?void 0:u.$el;const n=t[d];return(n==null?void 0:n.$el.nodeName)==="#text"?null:n==null?void 0:n.$el}),{mutationObserver:x,observerConfig:z}=Q(J),{startTimedQuery:W,stopTimedQuery:E}=y.useTimedQuery(J);e.watch(()=>m.value,t=>{if(t){R.value=!0,x.observe(t,z);const d=t.parentNode;d&&(d.ondragstart=()=>{r.value=!1,W()},d.ondragend=()=>{r.value=!0,E()}),J()}else R.value=!1});const{mutationObserver:w,observerConfig:T}=Q(Z);e.watch(()=>k.value,t=>{t&&(w.observe(t,T),Z())});let D=0;e.watch(()=>{var t;return(t=l.state.hoverNode)==null?void 0:t.id},t=>{if(t){a.value=!0,clearTimeout(D);return}D=setTimeout(()=>{a.value=!1},300)});let A=0,H=0;function J(){const t=m.value;if(!t||!o)return;const{top:d,left:f}=o==null?void 0:o.getBoundingClientRect(),{top:n,left:v,width:C,height:_}=t.getBoundingClientRect(),u=S.value?1:s.value,M=n-d+((o==null?void 0:o.scrollTop)??0)*u,j=v-f+((o==null?void 0:o.scrollLeft)??0)*u,P=_/u;h.value&&(h.value.style.width=`${C/u}px`,h.value.style.height=`${P}px`,h.value.style.top=`${M/u}px`,h.value.style.left=`${j/u}px`,X(M,j)),N.value&&(M<45&&P<100?(N.value.style.top="",N.value.style.bottom="-30px",N.value.style["border-radius"]="0px 0px 4px 4px",i.value="bottom"):M<45?(N.value.style.top="0px",N.value.style["border-radius"]="0px 0px 4px 0",i.value="center"):(N.value.style.top="-30px",N.value.style["border-radius"]="4px 4px 0px 0px",i.value="top"))}function X(t,d){const f=m.value;if(!o||!f)return;const n=o.getBoundingClientRect(),{width:v}=f.getBoundingClientRect(),C=S.value?1:s.value,_=t/C-n.top;let u=d/C-n.left+v/C;u<n.width&&(u=0);const M=o.scrollTop-n.height/3+60,j=o.scrollTop+n.height/3*2,P=o.scrollLeft-n.width+200,q=o.scrollLeft+n.width-200;Math.abs(_-A)<10&&Math.abs(u-H)<10||(A=_,H=u,!(_>M&&_<j&&u>P&&u<q)&&(o.scrollTop=_,o.scrollLeft=u))}function Z(){var P,q;const t=k.value;if(!t)return;const{top:d,left:f}=(o==null?void 0:o.getBoundingClientRect())??{top:0,left:0},{top:n,left:v,width:C,height:_}=((P=t.getBoundingClientRect)==null?void 0:P.call(t))??((q=t.nextElementSibling)==null?void 0:q.getBoundingClientRect()),u=S.value?1:s.value,M=n-d+((o==null?void 0:o.scrollTop)??0)*u,j=v-f+((o==null?void 0:o.scrollLeft)??0)*u;B.value&&(B.value.style.width=`${C/u}px`,B.value.style.height=`${_/u}px`,B.value.style.top=`${M/u}px`,B.value.style.left=`${j/u}px`)}function Q(t){const d=window.MutationObserver,f={childList:!0,attributes:!0,subtree:!0};return{mutationObserver:new d(t),observerConfig:f}}function Y(){var n,v;const t=y.findSchemaInfoById(g.schemas,((n=l.state.checkedNode)==null?void 0:n.id)??"root");if(!t||!t.list||!t.list.length||!t.list[0].children||!t.list[0].children.length)return!1;let d=JSON.parse(JSON.stringify((v=t.list[0])==null?void 0:v.children[0]));d.children.forEach((C,_)=>{d.children[_].children=[]});const f=y.generateNewSchema(d);t.list[0].children.push(f),l.setCheckedNode(f),c.push(g.schemas,"表格增加一行")}function G(){var f,n,v,C;const t=y.findSchemaInfoById(g.schemas,((f=l.state.checkedNode)==null?void 0:f.id)??"root");if(!((n=t==null?void 0:t.list)!=null&&n.length)||!((C=(v=t.list[0])==null?void 0:v.children)!=null&&C.length))return!1;t.list[0].children.forEach(_=>{const u=_.children.length+1,M=Math.floor(24/u);_.children.forEach(j=>{j.componentProps.span=M}),_.children.push(y.generateNewSchema({type:"table-col",children:[],componentProps:{span:M}}))}),c.push(g.schemas,"表格增加一列")}function ee(){var C;const t=y.findSchemaInfoById(g.schemas,((C=l.state.checkedNode)==null?void 0:C.id)??"root");if(!t)return!1;const{list:d,schema:f,index:n}=t,v=y.generateNewSchema(f);d.splice(n+1,0,v),l.setCheckedNode(v),c.push(g.schemas,"复制组件")}function te(){var v;const t=y.findSchemaInfoById(g.schemas,((v=l.state.checkedNode)==null?void 0:v.id)??"root");if(!t)return!1;let{list:d,schema:f,index:n}=t;d.splice(n,1),n===d.length&&n--,l.setCheckedNode(d[n]),c.push(g.schemas,"删除组件")}function ne(t){o=t,o==null||o.addEventListener("scroll",()=>{J()}),y.useResizeObserver(m,J),y.useResizeObserver(k,Z)}return $({handleInit:ne}),(t,d)=>{var f,n,v,C,_;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",{ref_key:"selectorRef",ref:h,class:e.normalizeClass(["epic-checked-widget absolute pointer-events-none z-20",i.value+" "+(r.value?"transition-all":"")])},[e.createElementVNode("div",{class:"epic-widget-action-box",ref_key:"actionBoxRef",ref:N},[e.createElementVNode("div",le,e.toDisplayString((n=e.unref(I.pluginManager).getComponentConfingByType(((f=e.unref(l).state.checkedNode)==null?void 0:f.type)??""))==null?void 0:n.defaultSchema.label),1),O.value||V.value||L.value?(e.openBlock(),e.createElementBlock("div",ae,[O.value?(e.openBlock(),e.createElementBlock("div",{key:0,title:"复制",class:"epic-widget-action-item pointer-events-auto",onClick:ee},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--copy-all-outline-rounded"})])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:1,title:"插入新行",class:"epic-widget-action-item pointer-events-auto",onClick:Y},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--account-tree-outline-rounded"})])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:2,title:"插入新列",class:"epic-widget-action-item pointer-events-auto",onClick:G,style:{transform:"rotate(270deg)"}},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--account-tree-outline-rounded"})])):e.createCommentVNode("",!0),O.value?(e.openBlock(),e.createElementBlock("div",{key:3,title:"删除",class:"epic-widget-action-item pointer-events-auto",onClick:te},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--delete-outline-rounded"})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],2),[[e.vShow,R.value&&((v=e.unref(l).state.checkedNode)==null?void 0:v.id)!=="root"]]),e.withDirectives(e.createElementVNode("div",{ref_key:"hoverWidgetRef",ref:B,class:"epic-hover-widget absolute transition-all pointer-events-none z-998"},null,512),[[e.vShow,a.value&&((C=e.unref(l).state.checkedNode)==null?void 0:C.id)!==((_=e.unref(l).state.hoverNode)==null?void 0:_.id)]])],64)}}}),se=e.defineComponent({name:"EditNodeItem",__name:"editNodeItem",props:{schemas:{}},emits:["update:schemas"],setup(F,{emit:$}){const p=e.inject("designer"),g=e.inject("pageSchema"),l=e.inject("revoke"),b=F,c=$,h=e.computed({get(){return b.schemas},set(r){c("update:schemas",r)}});function B(r){p.setCheckedNode(h.value[r]),p.setDisableHover(!0)}function N(){p.setDisableHover(),l.push(g.schemas,"拖拽组件")}function R(){l.push(g.schemas,"插入组件")}function a(r){var i,s,S;return r.id===((i=g.schemas[0])==null?void 0:i.id)||(S=(s=I.pluginManager.getComponentConfingByType(r.type))==null?void 0:s.editConstraints)!=null&&S.immovable?"unmover-item":"draggable-item"}return(r,i)=>(e.openBlock(),e.createBlock(e.unref(oe.draggable),e.mergeProps({modelValue:h.value,"onUpdate:modelValue":i[0]||(i[0]=s=>h.value=s),"item-key":"id","component-data":{type:"transition-group"},class:"epic-draggable-range"},{animation:200,group:"edit-draggable",handle:".draggable-item",ghostClass:"moveing"},{onStart:i[1]||(i[1]=s=>B(s.oldIndex)),onEnd:i[2]||(i[2]=s=>N()),onAdd:i[3]||(i[3]=s=>{B(s.newIndex),R()})}),{item:e.withCtx(({element:s,index:S})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["widget-box",a(s)]),key:S},[e.createVNode(K,{schema:s},null,8,["schema"])],2))]),_:1},16,["modelValue"]))}}),K=e.defineComponent({name:"ENodeItem",__name:"nodeItem",props:{schema:{},name:{}},setup(F){const $=e.useAttrs(),p=e.inject("designer"),g=e.inject("pageManager",{}),l=e.inject("pageSchema",{}),b=e.ref(null);e.provide("nodeAttrs",$);const c=F,h=e.computed(()=>{var S,o,O,L,V;const a=g.componentInstances.value,r=(S=c.schema)==null?void 0:S.id,i=I.pluginManager.getComponentConfingByType((o=c.schema)==null?void 0:o.type)??null;if(!r||!(a!=null&&a[r]))return null;if(i!=null&&i.defaultSchema.input&&((O=c.schema)==null?void 0:O.noFormItem)!==!0)return(L=a[r+"formItem"])==null?void 0:L.$el;const s=a[r];return((V=s==null?void 0:s.$el)==null?void 0:V.nodeName)==="#text"?null:s==null?void 0:s.$el});e.watch(()=>h.value,a=>{a==null||a.addEventListener("click",B,!1),a==null||a.addEventListener("mouseover",N,!1),a==null||a.addEventListener("mouseout",R,!1)}),e.onUnmounted(()=>{var a,r,i;(a=h.value)==null||a.removeEventListener("click",B,!1),(r=h.value)==null||r.removeEventListener("mouseover",N,!1),(i=h.value)==null||i.removeEventListener("mouseout",R,!1)});function B(a){a.stopPropagation(),p.setCheckedNode(c.schema)}function N(a){var r;c.schema.id!==((r=l.schemas[0])==null?void 0:r.id)&&(a.stopPropagation(),p.setHoverNode(c.schema))}function R(a){a.stopPropagation(),p.setHoverNode(null)}return(a,r)=>{var s,S;const i=e.resolveComponent("ENodeItem");return e.openBlock(),e.createBlock(e.unref(y._sfc_main),{ref_key:"nodeRef",ref:b,componentSchema:c.schema},e.createSlots({_:2},[(S=(s=e.unref(I.pluginManager).getComponentConfingByType(c.schema.type))==null?void 0:s.editConstraints)!=null&&S.childImmovable?{name:"edit-node",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.schema.children,o=>(e.openBlock(),e.createBlock(i,{key:o.id,schema:o},null,8,["schema"]))),128))]),key:"0"}:{name:"edit-node",fn:e.withCtx(()=>[c.schema.children?(e.openBlock(),e.createBlock(se,{key:0,schemas:c.schema.children,"onUpdate:schemas":r[0]||(r[0]=o=>c.schema.children=o)},null,8,["schemas"])):e.createCommentVNode("",!0)]),key:"1"}]),1032,["componentSchema"])}}}),ce={class:"min-w-750px rounded h-full"},ie=e.defineComponent({__name:"previewJson",setup(F,{expose:$}){const p=I.pluginManager.getComponent("modal"),g=I.pluginManager.getComponent("monacoEditor"),l={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1},readOnly:!0},b=e.ref(null),c=e.ref(!1),h=e.inject("pageSchema");function B(){c.value=!1}function N(){c.value=!0,b.value?b.value.setValue(JSON.stringify(h,null,2)):setTimeout(()=>{N()},300)}function R(a="epic-data.json"){const r=JSON.stringify(h,null,2);var i=`data:text/json;charset=utf-8,${encodeURIComponent(r)}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",a),s.click()}return $({handleOpen:N}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(p),{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=i=>c.value=i),title:"查看数据",class:"w-900px",width:"900px",onClose:B,onOk:R,okText:"导出数据"},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[e.createVNode(e.unref(g),{ref_key:"monacoEditorRef",ref:b,class:"editor h-full",autoToggleTheme:"",readOnly:"",config:l,language:"json"},null,512)])]),_:1},8,["modelValue"]))}}),de={class:"epic-edit-toolbar flex items-center justify-between px-2"},ue={class:"flex-1 h-full flex items-center"},fe={key:0,class:"epic-divider"},pe=["title","onClick"],he={class:"flex-1 h-full flex items-center justify-end"},me={key:0,class:"flex items-center ml-12px"},ve={class:"pr-8px w-82px cursor-pointer"},ge={class:"epic-device h-28px items-center gap-1 rounded-md border p-2px flex"},ye=["title","onClick"],ke=e.defineComponent({__name:"toolbar",setup(F){const $=I.pluginManager.getComponent("select"),{canvasScale:p,disabledZoom:g}=y.useStore(),l=e.ref("pc"),b=e.inject("pageSchema"),c=e.inject("designer"),h=e.inject("revoke"),B=e.ref(null),N=[{icon:"icon--epic--computer-outline-rounded",title:"pc",key:"pc"},{icon:"icon--epic--tablet-android-outline-rounded",title:"平板",key:"pad"},{icon:"icon--epic--phone-iphone-outline-sharp",title:"手机",key:"mobile"}],R=e.computed(()=>[{icon:"icon--epic--trash",title:"清空",on:o},{icon:"icon--epic--undo",title:"撤销",on:s,disabled:!h.recordList.value.length,divider:!0},{icon:"icon--epic--redo",title:"重做",on:S,disabled:!h.undoList.value.length}]),a=e.ref(null),r=e.computed({get(){return`${(p.value*100).toFixed(0)}%`},set(m){const k=parseFloat(m);p.value=k/100}}),i=[{label:"60%",value:"60%"},{label:"80%",value:"80%"},{label:"100%",value:"100%"},{label:"120%",value:"120%"},{label:"140%",value:"140%"}];function s(){const m=h.undo();m&&(y.deepCompareAndModify(b.schemas,m),c.setCheckedNode(b.schemas[0]))}function S(){const m=h.redo();m&&(y.deepCompareAndModify(b.schemas,m),c.setCheckedNode(b.schemas[0]))}function o(){c.reset()}function O(m){var z;const k=(z=m.target.files)==null?void 0:z[0];if(!k)return;m.target.value=null;const x=new FileReader;x.readAsText(k),x.onload=W=>{var E;L((E=W.target)==null?void 0:E.result)}}function L(m){try{let k=JSON.parse(m??"");k.schemas||(k=y.convertKFormData(k)),y.deepCompareAndModify(b,k)}catch(k){console.error(k)}}function V(m){c.handleToggleDeviceMode(m),l.value=m;const k={pc:{},pad:{width:"780px",mode:m},mobile:{width:"390px",height:"844px",mode:m}};b.canvas=k[m],console.log("%c [ pageSchema ]-248","font-size:13px; background:pink; color:#bf2c9f;",b)}return(m,k)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",de,[e.createElementVNode("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(R.value,(x,z)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:z},[x.divider?(e.openBlock(),e.createElementBlock("div",fe)):e.createCommentVNode("",!0),e.createElementVNode("div",{title:x.title,class:e.normalizeClass(["epic-action-item text-base h-90% px-10px flex items-center cursor-pointer",{disabled:x.disabled}]),onClick:x.on},[e.createVNode(e.unref(U._sfc_main),{name:x.icon},null,8,["name"])],10,pe)],64))),128))]),e.withDirectives(e.createElementVNode("input",{type:"file",ref_key:"fileRef",ref:a,accept:".json,.txt",onChange:O},null,544),[[e.vShow,!1]]),e.createElementVNode("div",he,[e.unref(g)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",ve,[e.createVNode(e.unref($),{value:r.value,"onUpdate:value":k[0]||(k[0]=x=>r.value=x),modelValue:r.value,"onUpdate:modelValue":k[1]||(k[1]=x=>r.value=x),options:i,size:"small"},null,8,["value","modelValue"])])])),e.createElementVNode("div",ge,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(N,x=>e.createElementVNode("div",{key:x.key,title:x.title,class:e.normalizeClass(["epic-device-item h-full px-1 flex items-center cursor-pointer text-base transition-colors rounded-sm",{checked:x.key===l.value}]),onClick:z=>V(x.key)},[e.createVNode(e.unref(U._sfc_main),{name:x.icon},null,8,["name"])],10,ye)),64))])])]),e.createVNode(ie,{ref_key:"previewJson",ref:B},null,512)],64))}}),xe={class:"h-full flex flex-col relative"},_e=["draggable"],be=e.defineComponent({__name:"editScreenContainer",setup(F){const $=e.inject("pageSchema"),p=e.ref(null),g=e.ref(null),l=e.ref(null),{pressSpace:b,disabledZoom:c}=y.useStore(),{handleElementDragStart:h,handleElementDrag:B,handleElementDragEnd:N}=y.useElementDrag(p),{width:R,height:a}=y.useElementSize(p),{canvasScale:r,handleZoom:i}=y.useElementZoom(g);let s=0,S=0;const o=e.ref({}),O=e.ref({}),L=e.ref({}),V=e.shallowRef({width:0,height:0});e.watchEffect(k),e.watch(L,()=>{e.nextTick(m)});function m(){l.value&&(V.value={width:l.value.clientWidth,height:l.value.clientHeight})}function k(){var E,w;L.value={width:((E=$.canvas)==null?void 0:E.width)??"0",height:((w=$.canvas)==null?void 0:w.height)??"0"}}y.watchOnce(R,x),e.watch(V,x);function x(){let E=V.value.width||s,w=V.value.height||S;o.value={width:R.value+E+"px",height:a.value+w+"px"},O.value={width:E+"px",height:w+"px"},z()}function z(){e.nextTick(()=>{var A;let E=V.value.width||s;const T=(V.value.height||S)/2,D=E/2;(A=p.value)==null||A.scrollTo(D,T)})}y.useResizeObserver(p,W),y.useResizeObserver(g,W);function W(){var w;if(!p.value)return;const E=p.value.getBoundingClientRect();if(s=E.width-60,S=E.height-80,!c.value)if(V.value.width===0)r.value=1;else{const T=(s-20)/V.value.width,D=S/(V.value.height||((w=g.value)==null?void 0:w.clientHeight)||1),A=Math.abs(T-1)<Math.abs(D-1);let H=1;A?H=T:H=D,(T<1||D<1)&&(H=Math.min(T,D)),H<1.4&&H>.5&&(r.value=H)}y.debounce(x,50)()}return(E,w)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(ke),e.createElementVNode("div",{ref_key:"editScreenContainerRef",ref:p,class:e.normalizeClass(["flex-1 overflow-auto overflow-y-hidden epic-edit-screen-container",{"cursor-grab":e.unref(b)}]),draggable:e.unref(b),onWheel:w[0]||(w[0]=(...T)=>e.unref(i)&&e.unref(i)(...T)),onDragstart:w[1]||(w[1]=(...T)=>e.unref(h)&&e.unref(h)(...T)),onDragend:w[2]||(w[2]=(...T)=>e.unref(N)&&e.unref(N)(...T)),onDrag:w[3]||(w[3]=(...T)=>e.unref(B)&&e.unref(B)(...T))},[e.createElementVNode("div",{id:"canvasContainer",class:"flex items-center justify-center",style:e.normalizeStyle(o.value)},[e.createElementVNode("div",{ref_key:"draggableElRef",ref:g,class:"transition-all"},[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none":e.unref(b)}),style:e.normalizeStyle(O.value)},[e.renderSlot(E.$slots,"default")],6)],512)],4)],42,_e),e.createElementVNode("div",{ref_key:"sizeBoxRef",ref:l,class:"absolute top-0 pointer-events-none",style:e.normalizeStyle(L.value)},null,4)]))}}),Ce={class:"epic-edit-canvas"},Ne=e.defineComponent({__name:"index",setup(F){const $=e.ref(null),p=e.ref(null),g=e.inject("pageSchema"),l=e.computed(()=>g.schemas[0]),b=e.computed(()=>({width:"100%",height:"100%"}));return e.onMounted(()=>{var c;(c=p.value)==null||c.handleInit($.value)}),(c,h)=>(e.openBlock(),e.createElementBlock("section",Ce,[e.createVNode(be,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"epicEditRangeRef",ref:$,class:"epic-edit-range rounded-md overflow-auto relative",style:e.normalizeStyle(b.value)},[e.createVNode(K,{schema:l.value},null,8,["schema"]),e.createVNode(re,{ref_key:"ePreviewWidgetsRef",ref:p},null,512)],4)]),_:1})]))}});exports.default=Ne;
@@ -1,104 +0,0 @@
1
- import { defineComponent as D, inject as i, ref as S, computed as b, openBlock as m, createElementBlock as h, createElementVNode as n, createVNode as r, unref as a, withCtx as w, Fragment as E, renderList as M, normalizeClass as j, toDisplayString as V, mergeProps as z, withDirectives as A, vShow as F } from "vue";
2
- import { d as G } from "./vuedraggable.umd-D2S7Eo7p.js";
3
- import { p as d } from "./js.cookie-oHpRFPCO.js";
4
- import { g as B, f as q } from "./index-B_9x_cPH.js";
5
- import { _ as I } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
6
- const H = { class: "epic-component-view flex flex-col" }, J = { class: "epic-search-box px-10px py-6px" }, K = { class: "flex flex-1 overflow-auto" }, O = { class: "epic-tabs-box" }, Q = ["title", "onClick"], R = { class: "h-full flex-1 overflow-auto py-2 box-border" }, W = ["onClick"], X = { class: "epic-componet-label flex-1 w-0 truncate" }, Y = { class: "text-center pt-42px text-gray-400" }, ae = /* @__PURE__ */ D({
7
- __name: "index",
8
- setup(Z) {
9
- const L = d.getComponent("input"), v = i("pageSchema"), f = i("designer"), N = i("revoke"), $ = i("designerProps"), g = d.getComponentSchemaGroups(), s = S(""), x = {
10
- title: "全部",
11
- list: []
12
- }, c = S(x), P = b(() => [x, ...g.value]), p = b(() => {
13
- let o = c.value.list;
14
- if (c.value.title === "全部") {
15
- const t = g.value.map((e) => e.list);
16
- o = [].concat(...t);
17
- }
18
- return o.filter(
19
- (t) => {
20
- var e;
21
- return ((e = t.label) == null ? void 0 : e.includes(s.value)) && (!$.value.formMode || t.type !== "form");
22
- }
23
- );
24
- });
25
- function T(o) {
26
- c.value = o;
27
- }
28
- function U(o) {
29
- var C, k, y;
30
- const t = q(v.schemas, ((C = f.state.checkedNode) == null ? void 0 : C.id) ?? "root");
31
- if (!t)
32
- return !1;
33
- let { list: e, schema: l, index: u } = t;
34
- l.children && !((y = (k = d.getComponentConfingByType(l.type)) == null ? void 0 : k.editConstraints) != null && y.childImmovable) && (e = l.children, u = l.children.length - 1);
35
- const _ = B(o);
36
- e.splice(u + 1, 0, _), f.setCheckedNode(_), N.push(v.schemas, "插入组件");
37
- }
38
- return (o, t) => (m(), h("div", H, [
39
- n("div", J, [
40
- r(a(L), {
41
- placeholder: "搜索组件",
42
- modelValue: s.value,
43
- "onUpdate:modelValue": t[0] || (t[0] = (e) => s.value = e),
44
- clearable: "",
45
- allowClear: "",
46
- value: s.value,
47
- "onUpdate:value": t[1] || (t[1] = (e) => s.value = e)
48
- }, {
49
- prefix: w(() => [
50
- r(a(I), {
51
- class: "text-$epic-text-helper",
52
- name: "icon--epic--search-rounded"
53
- })
54
- ]),
55
- _: 1
56
- }, 8, ["modelValue", "value"])
57
- ]),
58
- n("div", K, [
59
- n("div", O, [
60
- (m(!0), h(E, null, M(P.value, (e, l) => (m(), h("div", {
61
- class: j(["epic-tab cursor-pointer truncate", { checked: c.value.title === e.title }]),
62
- key: l,
63
- title: e.title,
64
- onClick: (u) => T(e)
65
- }, V(e.title), 11, Q))), 128))
66
- ]),
67
- n("div", R, [
68
- r(a(G), z({
69
- modelValue: p.value,
70
- "onUpdate:modelValue": t[2] || (t[2] = (e) => p.value = e)
71
- }, {
72
- group: { name: "edit-draggable", pull: "clone", put: !1 },
73
- sort: !1,
74
- animation: 180,
75
- ghostClass: "moving"
76
- }, {
77
- clone: a(B),
78
- "item-key": "id",
79
- class: "grid grid-cols-[auto_auto] px-10px gap-2"
80
- }), {
81
- item: w(({ element: e }) => [
82
- n("div", {
83
- class: "epic-componet-item flex items-center truncate",
84
- onClick: (l) => U(e)
85
- }, [
86
- r(a(I), {
87
- name: a(d).getComponentConfingByType(e.type).icon ?? ""
88
- }, null, 8, ["name"]),
89
- n("div", X, V(e.label), 1)
90
- ], 8, W)
91
- ]),
92
- _: 1
93
- }, 16, ["modelValue", "clone"]),
94
- A(n("div", Y, "没有查询到的组件", 512), [
95
- [F, !p.value.length]
96
- ])
97
- ])
98
- ])
99
- ]));
100
- }
101
- });
102
- export {
103
- ae as default
104
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=require("./vuedraggable.umd-BqhSJIAi.cjs"),i=require("./js.cookie-BH1G_HRi.cjs"),u=require("./index-C3a1hfUC.cjs"),x=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),w={class:"epic-component-view flex flex-col"},E={class:"epic-search-box px-10px py-6px"},B={class:"flex flex-1 overflow-auto"},j={class:"epic-tabs-box"},M=["title","onClick"],q={class:"h-full flex-1 overflow-auto py-2 box-border"},I=["onClick"],L={class:"epic-componet-label flex-1 w-0 truncate"},P={class:"text-center pt-42px text-gray-400"},T=e.defineComponent({__name:"index",setup($){const k=i.pluginManager.getComponent("input"),d=e.inject("pageSchema"),p=e.inject("designer"),y=e.inject("revoke"),C=e.inject("designerProps"),m=i.pluginManager.getComponentSchemaGroups(),c=e.ref(""),g={title:"全部",list:[]},a=e.ref(g),S=e.computed(()=>[g,...m.value]),s=e.computed(()=>{let o=a.value.list;if(a.value.title==="全部"){const n=m.value.map(t=>t.list);o=[].concat(...n)}return o.filter(n=>{var t;return((t=n.label)==null?void 0:t.includes(c.value))&&(!C.value.formMode||n.type!=="form")})});function V(o){a.value=o}function b(o){var v,f,_;const n=u.findSchemaInfoById(d.schemas,((v=p.state.checkedNode)==null?void 0:v.id)??"root");if(!n)return!1;let{list:t,schema:l,index:r}=n;l.children&&!((_=(f=i.pluginManager.getComponentConfingByType(l.type))==null?void 0:f.editConstraints)!=null&&_.childImmovable)&&(t=l.children,r=l.children.length-1);const h=u.generateNewSchema(o);t.splice(r+1,0,h),p.setCheckedNode(h),y.push(d.schemas,"插入组件")}return(o,n)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",E,[e.createVNode(e.unref(k),{placeholder:"搜索组件",modelValue:c.value,"onUpdate:modelValue":n[0]||(n[0]=t=>c.value=t),clearable:"",allowClear:"",value:c.value,"onUpdate:value":n[1]||(n[1]=t=>c.value=t)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(x._sfc_main),{class:"text-$epic-text-helper",name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",B,[e.createElementVNode("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:a.value.title===t.title}]),key:l,title:t.title,onClick:r=>V(t)},e.toDisplayString(t.title),11,M))),128))]),e.createElementVNode("div",q,[e.createVNode(e.unref(N.draggable),e.mergeProps({modelValue:s.value,"onUpdate:modelValue":n[2]||(n[2]=t=>s.value=t)},{group:{name:"edit-draggable",pull:"clone",put:!1},sort:!1,animation:180,ghostClass:"moving"},{clone:e.unref(u.generateNewSchema),"item-key":"id",class:"grid grid-cols-[auto_auto] px-10px gap-2"}),{item:e.withCtx(({element:t})=>[e.createElementVNode("div",{class:"epic-componet-item flex items-center truncate",onClick:l=>b(t)},[e.createVNode(e.unref(x._sfc_main),{name:e.unref(i.pluginManager).getComponentConfingByType(t.type).icon??""},null,8,["name"]),e.createElementVNode("div",L,e.toDisplayString(t.label),1)],8,I)]),_:1},16,["modelValue","clone"]),e.withDirectives(e.createElementVNode("div",P,"没有查询到的组件",512),[[e.vShow,!s.value.length]])])])]))}});exports.default=T;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./js.cookie-BH1G_HRi.cjs"),u=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),v={class:"flex relative"},_={class:"epic-action-bar"},d={class:"epic-actions-container"},p=["title","onClick"],m={class:"text-14px"},k={class:"epic-sidebar-container"},f=e.defineComponent({name:"EActivityBar",__name:"index",setup(h){const i=e.computed(()=>r.pluginManager.viewsContainers.activitybars.value.filter(n=>n.visible)),t=e.ref(0),c=e.shallowRef(null);c.value=i.value[0].component;function s(n,a){if(t.value===a)return t.value=null,!1;c.value=n.component,t.value=a}return(n,a)=>(e.openBlock(),e.createElementBlock("div",v,[e.createElementVNode("div",_,[e.createElementVNode("ul",d,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,(l,o)=>(e.openBlock(),e.createElementBlock("li",{key:o,class:e.normalizeClass(["epic-action-item",{checked:t.value===o}]),title:l.title,onClick:y=>s(l,o)},[e.createVNode(e.unref(u._sfc_main),{class:"relative",name:l.icon},null,8,["name"]),e.createElementVNode("div",m,e.toDisplayString(l.title),1)],10,p))),128))])]),e.createElementVNode("div",{class:e.normalizeClass(["epic-left-sidebar",{hide:t.value===null}])},[e.createElementVNode("div",k,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.value)))])],2)]))}});exports.default=f;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./js.cookie-BH1G_HRi.cjs"),p=require("./index-C3a1hfUC.cjs"),s=e.defineComponent({__name:"index",props:{modelValue:{type:Array,default:()=>[]}},emits:["update:modelValue"],setup(o,{emit:r}){const d=i.pluginManager.getComponent("number"),l=e.ref(0),a=o,m=r;return e.watch(()=>a.modelValue,()=>{l.value=a.modelValue.length},{immediate:!0}),e.watch(()=>l.value,u=>{let t=new Array(u).fill({}).map(n=>({type:"col",children:[],componentProps:{span:24/u},id:p.getUUID()}));m("update:modelValue",t)},{}),(u,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",null,[e.createVNode(e.unref(d),{value:l.value,"onUpdate:value":t[0]||(t[0]=n=>l.value=n),modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=n=>l.value=n),style:{width:"100%"},min:1,max:24},null,8,["value","modelValue"])])]))}});exports.default=s;