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