"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),I=require("../vc-util/Dom/css.js"),O=require("./BaseInputInner.js"),u=require("./vue-types/index.js"),k=l.defineComponent({compatConfig:{MODE:3},inheritAttrs:!1,props:{disabled:u.default.looseBool,type:u.default.string,value:u.default.any,lazy:u.default.bool.def(!0),tag:{type:String,default:"input"},size:u.default.string,style:u.default.oneOfType([String,Object]),class:u.default.string},emits:["change","input","blur","keydown","focus","compositionstart","compositionend","keyup","paste","mousedown"],setup(o,{emit:n,attrs:d,expose:f}){const t=l.shallowRef(null),c=l.ref(),s=l.ref(!1);l.watch([()=>o.value,s],()=>{s.value||(c.value=o.value)},{immediate:!0});const i=e=>{n("change",e)},g=e=>{s.value=!0,e.target.composing=!0,n("compositionstart",e)},v=e=>{s.value=!1,e.target.composing=!1,n("compositionend",e);const a=document.createEvent("HTMLEvents");a.initEvent("input",!0,!0),e.target.dispatchEvent(a),i(e)},p=e=>{if(s.value&&o.lazy){c.value=e.target.value;return}n("input",e)},y=e=>{n("blur",e)},h=e=>{n("focus",e)},S=()=>{t.value&&t.value.focus()},m=()=>{t.value&&t.value.blur()},b=e=>{n("keydown",e)},w=e=>{n("keyup",e)},C=(e,a,r)=>{t.value?.setSelectionRange(e,a,r)},E=()=>{t.value?.select()};f({focus:S,blur:m,input:l.computed(()=>t.value?.input),setSelectionRange:C,select:E,getSelectionStart:()=>t.value?.getSelectionStart(),getSelectionEnd:()=>t.value?.getSelectionEnd(),getScrollTop:()=>t.value?.getScrollTop()});const M=e=>{n("mousedown",e)},T=e=>{n("paste",e)},B=l.computed(()=>o.style&&typeof o.style!="string"?I.styleObjectToString(o.style):o.style);return()=>{const{style:e,lazy:a,...r}=o;return l.createVNode(O.default,{...r,...d,style:B.value,onInput:p,onChange:i,onBlur:y,onFocus:h,ref:t,value:c.value,onCompositionstart:g,onCompositionend:v,onKeyup:w,onKeydown:b,onPaste:T,onMousedown:M},null)}}});exports.default=k;
