"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const s=require("vue"),t=require("lodash"),b=require("@vueform/slider"),O=require("../../commons/core/datasource/index.js");require("@vueform/slider/themes/default.css");const f={class:"zerov-widget-slider"},m=s.defineComponent({name:"zv-interaction-slider"}),h=s.defineComponent({...m,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["on-change"],setup(l,{expose:r,emit:d}){s.useCssVars(e=>({b6a7cf50:e.basicOption.css.sliderBg,"231eb75c":e.basicOption.css.sliderConnectBg,"5d420793":e.basicOption.css.sliderHeight+"px",a164e470:e.basicOption.css.sliderRadius+"px","2ba8fe60":e.basicOption.css.sliderHandleBg,"0965473c":e.basicOption.css.sliderHandleWidth+"px","8e32e6ea":e.basicOption.css.sliderHandleHeight+"px","0af212c0":e.basicOption.css.sliderHandleRadius+"px","428cad32":e.basicOption.css.sliderHandleRingWidth+"px","6e2786d0":e.basicOption.css.sliderHandleRingColor,b47740a6:e.basicOption.css.sliderTooltipFontSize+"px","3b910d16":e.basicOption.css.sliderTooltipFontWeight+"px","2dfcac35":e.basicOption.css.sliderTooltipBg,e2416d1a:e.basicOption.css.sliderTooltipColor,"4b62446a":e.basicOption.css.sliderTooltipRadius+"px","7bd98074":e.basicOption.css.sliderTooltipPy+"px","13f85395":e.basicOption.css.sliderTooltipPx+"px",c4f214da:e.basicOption.css.sliderTooltipArrowSize+"px","319615f0":e.basicOption.css.sliderTooltipDistance+"px"}));const i=l,p=d,a=s.ref(20),n=()=>{O.SHJDatasourceV2.parse({tId:i.uuid,sources:i.sources,callback:({data:e})=>{try{window.SHJParseEvent(i.useEvents,"dataListener",e),a.value=e[0].data[0].value}catch{window.SHJParseEvent(i.useEvents,"dataListener",null)}}})};s.onMounted(()=>n());const c=e=>{p("on-change",{data:e,event:e}),window.SHJParseEvent(i.useEvents,"on-change",{data:e,event:e})};return s.watch(()=>t.cloneDeep(i.basicOption),(e,o)=>{t.isEqual(e,o)||n()},{deep:!0}),s.watch(()=>t.cloneDeep(i.sources),(e,o)=>{t.isEqual(e,o)||n()},{deep:!0}),r({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(e,o)=>(s.openBlock(),s.createElementBlock("div",f,[s.createVNode(s.unref(b),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=u=>a.value=u),class:"slider",min:e.basicOption.slider.min,max:e.basicOption.slider.max,step:e.basicOption.slider.step,tooltips:e.basicOption.slider.tooltips,"show-tooltip":e.basicOption.slider.showTooltip,"tooltip-position":e.basicOption.slider.tooltipPosition,format:{prefix:e.basicOption.slider.prefix,suffix:e.basicOption.slider.suffix,decimals:e.basicOption.slider.decimals},onChange:c},null,8,["modelValue","min","max","step","tooltips","show-tooltip","tooltip-position","format"])]))}});exports.default=h;
