import { ObjectDirective } from '@vue/runtime-core' ; import { VNDial } from 'widgets/Dial/VNDial' ; import { VNSlider } from 'widgets/Slider/VNSlider' ; type ModelDirective < T > = ObjectDirective < T & { _assign : Function ; } > ; export const vModelSlider = { beforeMount : ( el , { value } , vnode ) => { el . setValue ( value ) ; el . _assign = vnode . props ! [ 'onUpdate:modelValue' ] as Function ; el . addEventListener ( 'valueChanged' , ( sliderValue ) => { el . _assign ( sliderValue ) ; } ) ; } , beforeUpdate : ( el , { value , oldValue } ) => { if ( value === oldValue ) { return ; } el . setValue ( value ) ; } , } ;