import{K as e}from"./SimpleKeyboard.vue_vue_type_style_index_0_scoped_f4a16455_lang-CA_wZ3JU.js";import{_ as t,o as s,a,b as n,p as o,n as i,ai as l}from"./index-C1tQD-C0.js";const r={class:"show-keyValue"};const d=t({name:"SimpleKeyboard",props:{keyboardClass:{default:"simple-keyboard",type:String},input:{type:String},hideKeyBoard:{type:Function,default:()=>{}},layout:Object},data:()=>({keyboard:null,currentInput:""}),mounted(){this.currentInput=this.input;let t={onChange:this.onChange,onKeyPress:this.onKeyPress,layout:this.layout};this.layout&&(t.display={"{bksp}":"删除","{enter}":"关闭"}),this.keyboard=new e(this.keyboardClass,t)},methods:{onChange(e){this.currentInput=e,this.$emit("onChange",e)},onKeyPress(e){this.$emit("onKeyPress",e),"{shift}"!==e&&"{lock}"!==e||this.handleShift()},handleShift(){let e="default"===this.keyboard.options.layoutName?"shift":"default";this.keyboard.setOptions({layoutName:e})}},watch:{input(e){this.keyboard.setInput(e)}}},[["render",function(e,t,d,u,h,y){const p=l;return s(),a("div",null,[n("div",r,[o(p,{modelValue:e.currentInput,"onUpdate:modelValue":t[0]||(t[0]=t=>e.currentInput=t),style:{width:"100%",height:"3rem","font-size":"2rem"}},null,8,["modelValue"])]),n("div",{class:i(d.keyboardClass),id:"keyboard"},null,2)])}],["__scopeId","data-v-f4a16455"]]);export{d as _};
