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