2 lines
4.4 KiB
JavaScript
2 lines
4.4 KiB
JavaScript
import{V as P}from"./vue-demi.ebc8116b.js";import{a as W,r as Z}from"./resize-detector.4e96b72b.js";import{i as $,t as G}from"./echarts.8d7a50ae.js";import{d as J,s as U,B as L,a2 as K,b,f as Q,w as z,k as R,i as X,F as Y,h as ee,n as te,u as C}from"./@vue.108c970a.js";var d=function(){return d=Object.assign||function(e){for(var o,i=1,c=arguments.length;i<c;i++)for(var t in o=arguments[i])Object.prototype.hasOwnProperty.call(o,t)&&(e[t]=o[t]);return e},d.apply(this,arguments)},ne=["getWidth","getHeight","getDom","getOption","resize","dispatchAction","convertToPixel","convertFromPixel","containPixel","getDataURL","getConnectedDataURL","appendData","clear","isDisposed","dispose"];function re(e){return o=Object.create(null),ne.forEach(function(i){o[i]=function(c){return function(){for(var t=[],l=0;l<arguments.length;l++)t[l]=arguments[l];if(!e.value)throw new Error("ECharts is not initialized yet.");return e.value[c].apply(e.value,t)}}(i)}),o;var o}var ae={autoresize:Boolean},oe={loading:Boolean,loadingOptions:Object},ue=/^on[^a-z]/,ie=function(e){return ue.test(e)},F=[],y=[];(function(e,o){if(e&&typeof document<"u"){var i,c=o.prepend===!0?"prepend":"append",t=o.singleTag===!0,l=typeof o.container=="string"?document.querySelector(o.container):document.getElementsByTagName("head")[0];if(t){var p=F.indexOf(l);p===-1&&(p=F.push(l)-1,y[p]={}),i=y[p]&&y[p][c]?y[p][c]:y[p][c]=x()}else i=x();e.charCodeAt(0)===65279&&(e=e.substring(1)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(document.createTextNode(e))}function x(){var O=document.createElement("style");if(O.setAttribute("type","text/css"),o.attributes)for(var g=Object.keys(o.attributes),m=0;m<g.length;m++)O.setAttribute(g[m],o.attributes[g[m]]);var T=c==="prepend"?"afterbegin":"beforeend";return l.insertAdjacentElement(T,O),O}})("x-vue-echarts{display:block;width:100%;height:100%}",{});P&&P.config.ignoredElements.push("x-vue-echarts");var pe=J({name:"echarts",props:d(d({option:Object,theme:{type:[Object,String]},initOptions:Object,updateOptions:Object,group:String,manualUpdate:Boolean},ae),oe),inheritAttrs:!1,setup:function(e,o){var i=o.attrs,c=U(),t=U(),l=U(),p=L("ecTheme",null),x=L("ecInitOptions",null),O=L("ecUpdateOptions",null),g=K(e),m=g.autoresize,T=g.manualUpdate,I=g.loading,N=g.loadingOptions,q=b(function(){return l.value||e.option||null}),k=b(function(){return e.theme||C(p)||{}}),D=b(function(){return e.initOptions||C(x)||{}}),B=b(function(){return e.updateOptions||C(O)||{}}),M=b(function(){return function(s){var n={};for(var u in s)ie(u)||(n[u]=s[u]);return n}(i)}),V=Q().proxy.$listeners;function j(s){if(c.value){var n=t.value=$(c.value,k.value,D.value);e.group&&(n.group=e.group);var u=V;u||(u={},Object.keys(i).filter(function(a){return a.indexOf("on")===0&&a.length>2}).forEach(function(a){var r=a.charAt(2).toLowerCase()+a.slice(3);r.substring(r.length-4)==="Once"&&(r="~".concat(r.substring(0,r.length-4))),u[r]=i[a]})),Object.keys(u).forEach(function(a){var r=u[a];if(r){var f=a.toLowerCase();f.charAt(0)==="~"&&(f=f.substring(1),r.__once__=!0);var h=n;if(f.indexOf("zr:")===0&&(h=n.getZr(),f=f.substring(3)),r.__once__){delete r.__once__;var _=r;r=function(){for(var w=[],A=0;A<arguments.length;A++)w[A]=arguments[A];_.apply(void 0,w),h.off(f,r)}}h.on(f,r)}}),m.value?te(function(){n&&!n.isDisposed()&&n.resize(),v()}):v()}function v(){var a=s||q.value;a&&n.setOption(a,B.value)}}function S(){t.value&&(t.value.dispose(),t.value=void 0)}var E=null;z(T,function(s){typeof E=="function"&&(E(),E=null),s||(E=z(function(){return e.option},function(n,u){n&&(t.value?t.value.setOption(n,d({notMerge:n.value!==(u==null?void 0:u.value)},B.value)):j())},{deep:!0}))},{immediate:!0}),z([k,D],function(){S(),j()},{deep:!0}),R(function(){e.group&&t.value&&(t.value.group=e.group)});var H=re(t);return function(s,n,u){var v=L("ecLoadingOptions",{}),a=b(function(){return d(d({},C(v)),u==null?void 0:u.value)});R(function(){var r=s.value;r&&(n.value?r.showLoading(a.value):r.hideLoading())})}(t,I,N),function(s,n,u){var v=null;z([u,s,n],function(a,r,f){var h=a[0],_=a[1],w=a[2];h&&_&&w&&(v=G(function(){_.resize()},100),W(h,v)),f(function(){v&&h&&Z(h,v)})})}(t,m,c),X(function(){j()}),Y(S),d({chart:t,root:c,setOption:function(s,n){e.manualUpdate&&(l.value=s),t.value?t.value.setOption(s,n||{}):j(s)},nonEventAttrs:M},H)},render:function(){var e=d({},this.nonEventAttrs);return e.ref="root",e.class=e.class?["echarts"].concat(e.class):"echarts",ee("x-vue-echarts",e)}});export{pe as C};
|