"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const c=require("vue"),s=require("lodash"),w=require("../../core/useChart.js"),_={class:"zerov-widget"},b=["id"],D=c.defineComponent({name:"zv-chart-other-grid-percentage"}),E=c.defineComponent({...D,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["chart-click","chart-dblclick","chart-mousedown","chart-mouseover","chart-mouseout","chart-contextmenu"],setup(i,{expose:l,emit:d}){const e=i,h=d,{id:p,setOption:o,chart:v,renderChart:a,renderData:n}=w.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:r})=>{try{window.SHJParseEvent(e.useEvents,"dataListener",r);const u=[...new Array(s.cloneDeep(r[0].data[0].value)%5/5*20).fill(Math.floor(s.cloneDeep(r[0].data[0].value)/5+1)*5),...new Array(20-s.cloneDeep(r[0].data[0].value)%5/5*20).fill(Math.floor(s.cloneDeep(r[0].data[0].value)/5)*5)];t.title.text=s.cloneDeep(r[0].data[0].value)+"%",t.dataset={source:u.map((f,m)=>[m,f])},o(t)}catch{window.SHJParseEvent(e.useEvents,"dataListener",null),o(t)}}})},emit:h});return c.watch(()=>e.sources,()=>{e.sources&&e.sources.length>0&&n(e.basicOption)},{deep:!0}),c.watch(()=>s.cloneDeep(e.basicOption),(t,r)=>{s.isEqual(t,r)||a(t)},{deep:!0}),l({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)}}),(t,r)=>(c.openBlock(),c.createElementBlock("div",_,[c.createElementVNode("div",{id:c.unref(p),class:"widget"},null,8,b)]))}});exports.default=E;
