"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),s=require("lodash"),v=require("../../core/useChart.js"),o=require("../../utils/parseDataset.js"),D={class:"zerov-widget"},f=["id"],_=r.defineComponent({name:"zv-chart-pie-index"}),b=r.defineComponent({..._,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:m,renderChart:n,renderData:a}=v.useChart({basicOption:s.cloneDeep(e.basicOption),useEvents:s.cloneDeep(e.useEvents),customRenderData:t=>{t=s.cloneDeep(t),window.SHJDatasourceV2({tId:e.uuid,sources:e.sources,callback:({data:c})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",c),t.dataset=o.parseDataset(s.cloneDeep(c)),t.title.text=(o.parseDataset(s.cloneDeep(c)).source[0][o.parseDataset(s.cloneDeep(c)).dimensions[1]]||0)+t.title.text,i(t)}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),i(t)}}})},emit:p});return r.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&a(e.basicOption)},{deep:!0}),r.watch(()=>s.cloneDeep(e.basicOption),(t,c)=>{s.isEqual(t,c)||n(t)},{deep:!0}),l({getEchartsInstance:()=>m.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)}}),(t,c)=>(r.openBlock(),r.createElementBlock("div",D,[r.createElementVNode("div",{id:r.unref(h),class:"widget"},null,8,f)]))}});exports.default=b;
