import Vue from 'vue'

import numberKeyboard from './index.vue'

import elementUtil from '../../common/scripts/elementUtil'

class VueKeyboard {
  constructor () {
    this._vm = undefined
  }
  show (option) {
    elementUtil.createElement('vum-show-keyborad')
    this._vm = new Vue(numberKeyboard)
    this._vm.$mount('[vum-show-keyborad]')
    setTimeout(() => {
      this._vm.showNumberKeyboard(option)
    })
  }

  onClose () {
    this._vm.onClose()
  }

  onPressKey () {
    this._vm.onPressKey()
  }
}

export default new VueKeyboard()
