"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("lodash"),b=require("@vueform/slider");require("@vueform/slider/themes/default.css");const O={class:"zerov-widget-slider"},f=e.defineComponent({name:"zv-interaction-slider"}),m=e.defineComponent({...f,props:{basicOption:{},sources:{},useEvents:{},uuid:{}},emits:["on-change"],setup(l,{expose:r,emit:d}){e.useCssVars(s=>({"2711d843":s.basicOption.css.sliderBg,71484911:s.basicOption.css.sliderConnectBg,"7431b6c8":s.basicOption.css.sliderHeight+"px",73858606:s.basicOption.css.sliderRadius+"px","38483bea":s.basicOption.css.sliderHandleBg,47783366:s.basicOption.css.sliderHandleWidth+"px","127d8000":s.basicOption.css.sliderHandleHeight+"px","48ccc635":s.basicOption.css.sliderHandleRadius+"px","5006499d":s.basicOption.css.sliderHandleRingWidth+"px","3aa61ae6":s.basicOption.css.sliderHandleRingColor,"998407d0":s.basicOption.css.sliderTooltipFontSize+"px","5dd58a7e":s.basicOption.css.sliderTooltipFontWeight+"px","7c263dea":s.basicOption.css.sliderTooltipBg,"66525f9e":s.basicOption.css.sliderTooltipColor,"57ca98f6":s.basicOption.css.sliderTooltipRadius+"px",cba0edc2:s.basicOption.css.sliderTooltipPy+"px","324e5c40":s.basicOption.css.sliderTooltipPx+"px","3f40e688":s.basicOption.css.sliderTooltipArrowSize+"px","16a2dd1a":s.basicOption.css.sliderTooltipDistance+"px"}));const i=l,p=d,a=e.ref(20),n=()=>{window.SHJDatasourceV2({tId:i.uuid,sources:i.sources,callback:({data:s})=>{try{window.SHJParseEvent(i.useEvents,"dataListener",s),a.value=s[0].data[0].value}catch{window.SHJParseEvent(i.useEvents,"dataListener",null)}}})};e.onMounted(()=>n());const c=s=>{p("on-change",{data:s,event:s}),window.SHJParseEvent(i.useEvents,"on-change",{data:s,event:s})};return e.watch(()=>t.cloneDeep(i.basicOption),(s,o)=>{t.isEqual(s,o)||n()},{deep:!0}),e.watch(()=>t.cloneDeep(i.sources),(s,o)=>{t.isEqual(s,o)||n()},{deep:!0}),r({refresh:()=>n(),refreshView:()=>n(),refreshData:()=>n()}),(s,o)=>(e.openBlock(),e.createElementBlock("div",O,[e.createVNode(e.unref(b),{modelValue:a.value,"onUpdate:modelValue":o[0]||(o[0]=u=>a.value=u),class:"slider",min:s.basicOption.slider.min,max:s.basicOption.slider.max,step:s.basicOption.slider.step,tooltips:s.basicOption.slider.tooltips,"show-tooltip":s.basicOption.slider.showTooltip,"tooltip-position":s.basicOption.slider.tooltipPosition,format:{prefix:s.basicOption.slider.prefix,suffix:s.basicOption.slider.suffix,decimals:s.basicOption.slider.decimals},onChange:c},null,8,["modelValue","min","max","step","tooltips","show-tooltip","tooltip-position","format"])]))}});exports.default=m;
