ace-component-lib 0.0.53 → 0.0.55
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(ct,Le){typeof exports=="object"&&typeof module<"u"?module.exports=Le(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue"],Le):(ct=typeof globalThis<"u"?globalThis:ct||self,ct["ace-component-lib"]=Le(ct.pinia,ct.editor,ct.Vue,ct.elementPlus,ct.vueDraggablePlus,ct.dayjs,ct.core,ct.editorForVue))})(this,function(ct,Le,e,C,Xt,On,Gu,Yi){"use strict";const Hu="0.0.53",uD="";let Yu=class{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let c=a[l].cssRules||a[l].rules;for(let i=0;i<c.length;i++)o+=c[i].cssText}}catch(c){console.log(a[l].href+c)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),c=new Image;c.className="canvasImg",c.style.display="none",c.src=l,a.appendChild(c)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let c=0;c<a.length;c++){let i=a[c].parentNode,s=a[c];s.tagName.toLowerCase()==="canvas"?i.removeChild(s):s.style.display="block"}for(let c=0;c<o.length;c++){let i=o[c],s=i.getAttribute("type"),d=o[c];if(s||(s=i.tagName==="SELECT"?"select":i.tagName==="TEXTAREA"?"textarea":""),i.tagName==="INPUT")s==="radio"||s==="checkbox"?i.checked&&d.setAttribute("checked",i.checked):(d.value=i.value,d.setAttribute("value",i.value));else if(s==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let u=n.querySelectorAll("select")[l].selectedIndex;i.options[u].setAttribute("selected",!0)}}}else d.innerHTML=i.value,d.setAttribute("html",i.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let c=document.createElement("div"),i=document.createElement("div");c.setAttribute("class","closeBefore"),c.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),i.setAttribute("class","closeAfter"),i.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(c),l.appendChild(i),a.appendChild(l),this.previewBody=document.createElement("div");let s=this.previewBody;s.setAttribute("class",r),s.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(s);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),s.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),c=l.previewBody,i=l.close;c.appendChild(a),this.addEvent(i,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var qi={directiveName:"print",mounted(t,n,r){let o=n.instance,a="";var l,c,i;c="click",i=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}s()},(l=t).addEventListener?l.addEventListener(c,i,!1):l.attachEvent?l.attachEvent("on"+c,i):l["on"+c]=i;const s=()=>{new Yu({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",qi)}},Ye=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Ye||{});let qr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const ke=ct.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,n){this.sketchRuleLine.h=t,this.sketchRuleLine.v=n},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(n=>!t.includes(n.id))),this.setTargetWidget(this.getTargetWidget.filter(n=>!t.includes(n.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(n=>{const r=this.getWidgetList.find(o=>o.id==n);r&&this.pasteWidget.push(r)})},pasteWidgetItem(){this.pasteWidget.forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?l=this.stageHeight-o.h-40:l+=40,this.widgetConfg.list.unshift({...o,id:qr(),x:a,y:l,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,n)=>n.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setStageWidth(t){this.stageWidth=t,this.widgetConfg.config.stageWidth=t},setStageHeight(t){this.stageHeight=t,this.widgetConfg.config.stageHeight=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
|
|
1
|
+
(function(ct,Le){typeof exports=="object"&&typeof module<"u"?module.exports=Le(require("pinia"),require("@wangeditor/editor"),require("vue"),require("element-plus"),require("vue-draggable-plus"),require("dayjs"),require("echarts/core"),require("@wangeditor/editor-for-vue")):typeof define=="function"&&define.amd?define(["pinia","@wangeditor/editor","vue","element-plus","vue-draggable-plus","dayjs","echarts/core","@wangeditor/editor-for-vue"],Le):(ct=typeof globalThis<"u"?globalThis:ct||self,ct["ace-component-lib"]=Le(ct.pinia,ct.editor,ct.Vue,ct.elementPlus,ct.vueDraggablePlus,ct.dayjs,ct.core,ct.editorForVue))})(this,function(ct,Le,e,C,Xt,On,Gu,Yi){"use strict";const Hu="0.0.55",uD="";let Yu=class{constructor(n){this.standards={strict:"strict",loose:"loose",html5:"html5"},this.previewBody=null,this.close=null,this.previewBodyUtilPrintBtn=null,this.selectArray=[],this.counter=0,this.settings={standard:this.standards.html5},Object.assign(this.settings,n),this.init()}init(){this.counter++,this.settings.id=`printArea_${this.counter}`;let n="";this.settings.url&&!this.settings.asyncUrl&&(n=this.settings.url);let r=this;if(this.settings.asyncUrl)return void r.settings.asyncUrl(function(a){let l=r.getPrintWindow(a);r.settings.preview?r.previewIfrmaeLoad():r.print(l)},r.settings.vue);let o=this.getPrintWindow(n);this.settings.url||this.write(o.doc),this.settings.preview?this.previewIfrmaeLoad():this.print(o)}addEvent(n,r,o){n.addEventListener?n.addEventListener(r,o,!1):n.attachEvent?n.attachEvent("on"+r,o):n["on"+r]=o}previewIfrmaeLoad(){let n=document.getElementById("vue-pirnt-nb-previewBox");if(n){let r=this,o=n.querySelector("iframe");this.settings.previewBeforeOpenCallback(),this.addEvent(o,"load",function(){r.previewBoxShow(),r.removeCanvasImg(),r.settings.previewOpenCallback()}),this.addEvent(n.querySelector(".previewBodyUtilPrintBtn"),"click",function(){r.settings.beforeOpenCallback(),r.settings.openCallback(),o.contentWindow.print(),r.settings.closeCallback()})}}removeCanvasImg(){let n=this;try{if(n.elsdom){let r=n.elsdom.querySelectorAll(".canvasImg");for(let o=0;o<r.length;o++)r[o].remove()}}catch(r){console.log(r)}}print(n){var r=this;let o=document.getElementById(this.settings.id)||n.f,a=document.getElementById(this.settings.id).contentWindow||n.f.contentWindow;r.settings.beforeOpenCallback(),r.addEvent(o,"load",function(){a.focus(),r.settings.openCallback(),a.print(),o.remove(),r.settings.closeCallback(),r.removeCanvasImg()})}write(n){n.open(),n.write(`${this.docType()}<html>${this.getHead()}${this.getBody()}</html>`),n.close()}docType(){return this.settings.standard===this.standards.html5?"<!DOCTYPE html>":`<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01${this.settings.standard===this.standards.loose?" Transitional":""}//EN" "http://www.w3.org/TR/html4/${this.settings.standard===this.standards.loose?"loose":"strict"}.dtd">`}getHead(){let n="",r="",o="";this.settings.extraHead&&this.settings.extraHead.replace(/([^,]+)/g,l=>{n+=l}),[].forEach.call(document.querySelectorAll("link"),function(l){l.href.indexOf(".css")>=0&&(r+=`<link type="text/css" rel="stylesheet" href="${l.href}" >`)});let a=document.styleSheets;if(a&&a.length>0)for(let l=0;l<a.length;l++)try{if(a[l].cssRules||a[l].rules){let c=a[l].cssRules||a[l].rules;for(let i=0;i<c.length;i++)o+=c[i].cssText}}catch(c){console.log(a[l].href+c)}return this.settings.extraCss&&this.settings.extraCss.replace(/([^,\s]+)/g,l=>{r+=`<link type="text/css" rel="stylesheet" href="${l}">`}),`<head><title>${this.settings.popTitle}</title>${n}${r}<style type="text/css">${o}</style></head>`}getBody(){let n=this.settings.ids;return n=n.replace(new RegExp("#","g"),""),this.elsdom=this.beforeHanler(document.getElementById(n)),"<body>"+this.getFormData(this.elsdom).outerHTML+"</body>"}beforeHanler(n){let r=n.querySelectorAll("canvas");for(let o=0;o<r.length;o++)if(!r[o].style.display){let a=r[o].parentNode,l=r[o].toDataURL("image/png"),c=new Image;c.className="canvasImg",c.style.display="none",c.src=l,a.appendChild(c)}return n}getFormData(n){let r=n.cloneNode(!0),o=r.querySelectorAll("input,select,textarea"),a=r.querySelectorAll(".canvasImg,canvas"),l=-1;for(let c=0;c<a.length;c++){let i=a[c].parentNode,s=a[c];s.tagName.toLowerCase()==="canvas"?i.removeChild(s):s.style.display="block"}for(let c=0;c<o.length;c++){let i=o[c],s=i.getAttribute("type"),d=o[c];if(s||(s=i.tagName==="SELECT"?"select":i.tagName==="TEXTAREA"?"textarea":""),i.tagName==="INPUT")s==="radio"||s==="checkbox"?i.checked&&d.setAttribute("checked",i.checked):(d.value=i.value,d.setAttribute("value",i.value));else if(s==="select"){l++;for(let f=0;f<n.querySelectorAll("select").length;f++){let p=n.querySelectorAll("select")[f];if(!p.getAttribute("newbs")&&p.setAttribute("newbs",f),p.getAttribute("newbs")==l){let u=n.querySelectorAll("select")[l].selectedIndex;i.options[u].setAttribute("selected",!0)}}}else d.innerHTML=i.value,d.setAttribute("html",i.value)}return r}getPrintWindow(n){var r=this.Iframe(n);return{f:r,win:r.contentWindow||r,doc:r.doc}}previewBoxShow(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: hidden"),n.style.display="block")}previewBoxHide(){let n=document.getElementById("vue-pirnt-nb-previewBox");n&&(document.querySelector("html").setAttribute("style","overflow: visible;"),n.querySelector("iframe")&&n.querySelector("iframe").remove(),n.style.display="none")}previewBox(){let n=document.getElementById("vue-pirnt-nb-previewBox"),r="previewBody";if(n)return n.querySelector("iframe")&&n.querySelector("iframe").remove(),{close:n.querySelector(".previewClose"),previewBody:n.querySelector(".previewBody")};let o=document.createElement("div");o.setAttribute("id","vue-pirnt-nb-previewBox"),o.setAttribute("style","position: fixed;top: 0px;left: 0px;width: 100%;height: 100%;background: white;display:none"),o.style.zIndex=this.settings.zIndex;let a=document.createElement("div");a.setAttribute("class","previewHeader"),a.setAttribute("style","padding: 5px 20px;"),a.innerHTML=this.settings.previewTitle,o.appendChild(a),this.close=document.createElement("div");let l=this.close;l.setAttribute("class","previewClose"),l.setAttribute("style","position: absolute;top: 5px;right: 20px;width: 25px;height: 20px;cursor: pointer;");let c=document.createElement("div"),i=document.createElement("div");c.setAttribute("class","closeBefore"),c.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(45deg); top: 0px;left: 50%;"),i.setAttribute("class","closeAfter"),i.setAttribute("style","position: absolute;width: 3px;height: 100%;background: #040404;transform: rotate(-45deg); top: 0px;left: 50%;"),l.appendChild(c),l.appendChild(i),a.appendChild(l),this.previewBody=document.createElement("div");let s=this.previewBody;s.setAttribute("class",r),s.setAttribute("style","display: flex;flex-direction: column; height: 100%;"),o.appendChild(s);let d=document.createElement("div");d.setAttribute("class","previewBodyUtil"),d.setAttribute("style","height: 32px;background: #474747;position: relative;"),s.appendChild(d),this.previewBodyUtilPrintBtn=document.createElement("div");let f=this.previewBodyUtilPrintBtn;return f.setAttribute("class","previewBodyUtilPrintBtn"),f.innerHTML=this.settings.previewPrintBtnLabel,f.setAttribute("style","position: absolute;padding: 2px 10px;margin-top: 3px;left: 24px;font-size: 14px;color: white;cursor: pointer;background-color: rgba(0,0,0,.12);background-image: linear-gradient(hsla(0,0%,100%,.05),hsla(0,0%,100%,0));background-clip: padding-box;border: 1px solid rgba(0,0,0,.35);border-color: rgba(0,0,0,.32) rgba(0,0,0,.38) rgba(0,0,0,.42);box-shadow: inset 0 1px 0 hsla(0,0%,100%,.05), inset 0 0 1px hsla(0,0%,100%,.15), 0 1px 0 hsla(0,0%,100%,.05);"),d.appendChild(f),document.body.appendChild(o),{close:this.close,previewBody:this.previewBody}}iframeBox(n,r){let o=document.createElement("iframe");return o.style.border="0px",o.style.position="absolute",o.style.width="0px",o.style.height="0px",o.style.right="0px",o.style.top="0px",o.setAttribute("id",n),o.setAttribute("src",r),o}Iframe(n){let r=this.settings.id;n=n||new Date().getTime();let o=this,a=this.iframeBox(r,n);try{if(this.settings.preview){a.setAttribute("style","border: 0px;flex: 1;");let l=this.previewBox(),c=l.previewBody,i=l.close;c.appendChild(a),this.addEvent(i,"click",function(){o.previewBoxHide()})}else document.body.appendChild(a);a.doc=null,a.doc=a.contentDocument?a.contentDocument:a.contentWindow?a.contentWindow.document:a.document}catch(l){throw new Error(l+". iframes may not be supported in this browser.")}if(a.doc==null)throw new Error("Cannot find document.");return a}};var qi={directiveName:"print",mounted(t,n,r){let o=n.instance,a="";var l,c,i;c="click",i=()=>{if(typeof n.value=="string")a=n.value;else{if(typeof n.value!="object"||!n.value.id)return void window.print();{a=n.value.id;let d=a.replace(new RegExp("#","g"),"");document.getElementById(d)||(console.log("id in Error"),a="")}}s()},(l=t).addEventListener?l.addEventListener(c,i,!1):l.attachEvent?l.attachEvent("on"+c,i):l["on"+c]=i;const s=()=>{new Yu({ids:a,vue:o,url:n.value.url,standard:"",extraHead:n.value.extraHead,extraCss:n.value.extraCss,zIndex:n.value.zIndex||20002,previewTitle:n.value.previewTitle||"打印预览",previewPrintBtnLabel:n.value.previewPrintBtnLabel||"打印",popTitle:n.value.popTitle,preview:n.value.preview||!1,asyncUrl:n.value.asyncUrl,previewBeforeOpenCallback(){n.value.previewBeforeOpenCallback&&n.value.previewBeforeOpenCallback(o)},previewOpenCallback(){n.value.previewOpenCallback&&n.value.previewOpenCallback(o)},openCallback(){n.value.openCallback&&n.value.openCallback(o)},closeCallback(){n.value.closeCallback&&n.value.closeCallback(o)},beforeOpenCallback(){n.value.beforeOpenCallback&&n.value.beforeOpenCallback(o)}})}},install:function(t){t.directive("print",qi)}},Ye=(t=>(t.Text="text",t.Select="select",t.Date="date",t.DateTime="datetime",t.CheckBox="checkbox",t.Switch="switch",t.Radio="radio",t.Textarea="textarea",t.Nnumber="number",t.NumberRange="numberRange",t.Cascader="cascader",t.Daterange="daterange",t.DateTimeRange="datetimerange",t.File="file",t.TreeSelect="treeSelect",t.Year="year",t.Hr="hr",t.Slot="slot",t.Editor="editor",t.Password="password",t.Json="json",t.Markdown="markdown",t.Rate="rate",t))(Ye||{});let qr=(t=21)=>crypto.getRandomValues(new Uint8Array(t)).reduce((n,r)=>(r&=63,r<36?n+=r.toString(36):r<62?n+=(r-26).toString(36).toUpperCase():r>62?n+="-":n+="_",n),"");const ke=ct.defineStore({id:"design",state:()=>({theme:localStorage.getItem("design-theme")||"",stageWidth:1920,stageHeight:1080,scale:.2,targetsWidget:[],sketchRuleLine:{h:[],v:[]},widgetConfg:{config:{backgroundColor:"transparent",backgroundImage:""},list:[]},widgetHoverIds:[],pasteWidget:[],createLoading:!1,showRightPannel:!1,tempChartData:{},chartData:{}}),getters:{getScale(){return this.scale},getStage(){return{stageWidth:this.stageWidth,stageHeight:this.stageHeight}},getSketchRuleLine(){return this.sketchRuleLine},getTargetWidget(){return this.targetsWidget},getWidgetConfig(){return this.widgetConfg.config},getWidgetList(){return this.widgetConfg.list},getWidgetHoverIds(){return this.widgetHoverIds},getPasteWidget(){return this.pasteWidget},getCreateLoading(){return this.createLoading},getRightPannel(){return this.showRightPannel},getTheme(){return this.theme},getChartData(){return this.chartData}},actions:{setSacle(t){this.scale=t/100},setSketchRuleLine(t,n){this.sketchRuleLine.h=t,this.sketchRuleLine.v=n},clearSketchRuleLine(){this.sketchRuleLine={h:[],v:[]}},setTargetWidget(t){this.targetsWidget=t},setWidgetList(t){this.widgetConfg.list=t},setWidgetHoverIds(t){this.widgetHoverIds=t},delWidgetItem(t){this.setWidgetList(this.getWidgetList.filter(n=>!t.includes(n.id))),this.setTargetWidget(this.getTargetWidget.filter(n=>!t.includes(n.id)))},copyWidgetItem(t){this.pasteWidget=[],t.forEach(n=>{const r=this.getWidgetList.find(o=>o.id==n);r&&this.pasteWidget.push(r)})},pasteWidgetItem(){this.pasteWidget.forEach(r=>{const o=JSON.parse(JSON.stringify(r));let a=o.x,l=o.y;o.x+40>this.stageWidth-o.w?a=this.stageWidth-o.w-40:a+=40,o.y+40>this.stageHeight-o.h?l=this.stageHeight-o.h-40:l+=40,this.widgetConfg.list.unshift({...o,id:qr(),x:a,y:l,z:this.widgetConfg.list.length+1,locked:!1})})},sortWidgetList(){this.widgetConfg.list.sort((t,n)=>n.z-t.z)},setCreateLoading(t){this.createLoading=t,t&&(this.targetsWidget=[],this.clearSketchRuleLine())},setRightPannel(t){this.showRightPannel=t},setStageWidth(t){this.stageWidth=t,this.widgetConfg.config.stageWidth=t},setStageHeight(t){this.stageHeight=t,this.widgetConfg.config.stageHeight=t},setTheme(){this.theme=this.theme=="dark"?"":"dark",document.getElementsByTagName("html")[0].className=this.theme,localStorage.setItem("design-theme",this.theme)},setChartData(t){this.chartData=t}}});/*!
|
|
2
2
|
* Compressor.js v1.2.1
|
|
3
3
|
* https://fengyuanchen.github.io/compressorjs
|
|
4
4
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ace-component-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.55",
|
|
4
4
|
"main": "./dist/ace-component-lib.umd.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist/*"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"json-editor-vue3": "^1.1.1",
|
|
30
30
|
"mitt": "^3.0.1",
|
|
31
31
|
"nanoid": "^4.0.2",
|
|
32
|
-
"pinia": "
|
|
32
|
+
"pinia": "2.1.4",
|
|
33
33
|
"pinia-plugin-persist": "^1.0.0",
|
|
34
34
|
"selecto": "^1.26.3",
|
|
35
35
|
"snabbdom": "^3.6.2",
|