| 54501 | |
| 54502 | var KeyInput = function () { |
| 54503 | function KeyInput(element, callback) { |
| 54504 | var _this = this; |
| 54505 | |
| 54506 | var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; |
| 54507 | (0, _classCallCheck2.default)(this, KeyInput); |
| 54508 | this.element = element; |
| 54509 | this.callback = callback; |
| 54510 | this.options = Object.assign({ |
| 54511 | enable: true |
| 54512 | }, options); |
| 54513 | this.enableDownEvent = this.options.enable; |
| 54514 | this.enableUpEvent = this.options.enable; |
| 54515 | this.events = KEY_EVENTS.concat(options.events || []); |
| 54516 | this.handleEvent = this.handleEvent.bind(this); |
| 54517 | element.tabIndex = 1; |
| 54518 | element.style.outline = 'none'; |
| 54519 | this.events.forEach(function (event) { |
| 54520 | return element.addEventListener(event, _this.handleEvent); |
| 54521 | }); |
| 54522 | } |
| 54523 | |
| 54524 | (0, _createClass2.default)(KeyInput, [{ |
| 54525 | key: "destroy", |