import { ObjectDirective } from '@vue/runtime-core' ; import { VNLineEdit } from 'widgets/LineEdit/VNLineEdit' ; type ModelDirective < T > = ObjectDirective < T & { _assign : Function ; } > ; export const vModelText = { beforeMount : ( el , { value } , vnode ) => { el . setText ( value ) ; el . _assign = vnode . props ! [ 'onUpdate:modelValue' ] as Function ; el . addEventListener ( 'textChanged' , ( text ) => { el . _assign ( text ) ; } ) ; } , beforeUpdate : ( el , { value , oldValue } ) => { if ( value === oldValue ) { return ; } el . setText ( value ) ; } , } ;