import { ObjectDirective } from '@vue/runtime-core' ; import { VNComboBox } from '../../widgets/ComboBox/VNComboBox' ; type ModelDirective < T > = ObjectDirective < T & { _assign : Function ; } > ; export const vModelComboBox = { beforeMount : ( el , { value } , vnode ) => { el . setCurrentIndex ( value ) ; el . _assign = vnode . props ! [ 'onUpdate:modelValue' ] as Function ; el . addEventListener ( 'currentIndexChanged' , ( indexValue ) => { el . _assign ( indexValue ) ; } ) ; } , beforeUpdate : ( el , { value , oldValue } ) => { if ( value === oldValue ) { return ; } el . setCurrentIndex ( value ) ; } , } ;