"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),n=require("lodash"),v=require("./hooks/useCommonChart.js"),D=require("../../../../../commons/plugins/datasource/index.js"),E=require("../../hooks/useChart.js"),_=require("../../../../../commons/utils/parseDataset.js"),f=require("../../../../../commons/utils/cloneSeries.js"),u=require("../../../../../commons/plugins/event/index.js"),S={class:"zerov-widget"},q=["id"],C=r.defineComponent({__name:"index",props:{option:{},sources:{},useEvents:{},uuid:{},isMultiSeries:{type:Boolean},customRenderData:{type:Function}},emits:["dataListener","chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(l,{expose:d,emit:h}){const e=l,a=h,{id:m,setOption:o,chart:p,renderChart:c,renderData:i}=E.useChart({basicOption:n.cloneDeep(e.option),useEvents:n.cloneDeep(e.useEvents),customRenderData:t=>{t=n.cloneDeep(t),D.SHJDatasourceV2.parse({tId:e.uuid,sources:e.sources,callback:({data:s})=>{try{if(a("dataListener",s),u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",s),e.customRenderData){e.customRenderData(t,s,o);return}t.dataset=_.parseDataset(n.cloneDeep(s)),e.isMultiSeries&&(t.series=f.cloneSeries(s,t.series)),o(t)}catch{a("dataListener",null),u.SHJParseEvent.parseEvents(e.useEvents,"dataListener",null),o(t)}}})},emits:a});return v.useCommonChart(e,i,c),d({getEchartsInstance:()=>p.value,refresh:()=>{i(e.option),c(e.option)},refreshView:()=>{c(e.option)},refreshData:()=>{i(e.option)}}),(t,s)=>(r.openBlock(),r.createElementBlock("div",S,[r.createElementVNode("div",{id:r.unref(m),class:"widget"},null,8,q)]))}});exports.default=C;
