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