From 0c49b1234195e73931cfa2fee8a742911476e4a0 Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Tue, 29 Oct 2019 15:17:12 +0000 Subject: [PATCH] Build update --- build/css/index.css | 2 +- build/css/index.css.map | 2 +- build/index.js | 4 ++-- build/index.js.map | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/css/index.css b/build/css/index.css index ceb24dac..d5fc8bc0 100644 --- a/build/css/index.css +++ b/build/css/index.css @@ -1,6 +1,6 @@ /*! * - * simple-keyboard v2.26.16 + * simple-keyboard v2.26.17 * https://github.com/hodgef/simple-keyboard * * Copyright (c) Francisco Hodge (https://github.com/hodgef) diff --git a/build/css/index.css.map b/build/css/index.css.map index e5f84ef6..e439d9df 100644 --- a/build/css/index.css.map +++ b/build/css/index.css.map @@ -1 +1 @@ -{"version":3,"sources":["index.css","Keyboard.css"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE,CCVF,UAEE,QAAS,CACT,SACF,CAEA,iBACE,4GAC+C,CAC/C,UAAW,CACX,wBAAiB,CAAjB,qBAAiB,CAAjB,oBAAiB,CAAjB,gBAAiB,CACjB,qBAAsB,CACtB,eAAgB,CAChB,yBACF,CAEA,yBACE,YACF,CAEA,0CACE,iBACF,CAMA,mGACE,gBACF,CAEA,wCACE,cACF,CAEA,8CACE,YACF,CAEA,4BACE,oBAAqB,CACrB,WAAY,CACZ,cACF,CAEA,iCACE,mBACF,CAKA,kCACE,+BAAoC,CACpC,WAAY,CACZ,iBACF,CAEA,6CACE,sCAA+C,CAC/C,WAAY,CACZ,iBAAkB,CAClB,qBAAsB,CACtB,WAAY,CACZ,eAAiB,CACjB,+BAAgC,CAChC,cAAe,CACf,YAAa,CACb,kBAAmB,CACnB,sBACF,CAGA,kCACE,cAAe,CACf,SAAU,CACV,iBACF,CAEA,+DACE,WAAY,CACZ,WAAY,CACZ,kBAAmB,CACnB,YAAa,CACb,sBACF,CAMA,oIACE,WACF,CAEA,+DACE,WACF,CAEA,2DACE,cACF,CAEA,yEACE,cACF,CAEA,+DACE,4BAAiC,CACjC,UACF,CAEA,+EACE,cACF,CAEA,4EACE,cACF","file":"index.css","sourcesContent":["/*!\n * \n * simple-keyboard v2.26.16\n * https://github.com/hodgef/simple-keyboard\n * \n * Copyright (c) Francisco Hodge (https://github.com/hodgef)\n * \n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n * \n */\nbody,\nhtml {\n margin: 0;\n padding: 0;\n}\n\n.simple-keyboard {\n font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\",\n Helvetica, Arial, \"Lucida Grande\", sans-serif;\n width: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-sizing: border-box;\n overflow: hidden;\n touch-action: manipulation;\n}\n\n.simple-keyboard .hg-row {\n display: flex;\n}\n\n.simple-keyboard .hg-row:not(:last-child) {\n margin-bottom: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button:not(:last-child) {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row > div:last-child {\n margin-right: 0;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n display: flex;\n}\n\n.simple-keyboard .hg-button {\n display: inline-block;\n flex-grow: 1;\n cursor: pointer;\n}\n\n.simple-keyboard .hg-button span {\n pointer-events: none;\n}\n\n/**\n * hg-theme-default theme\n */\n.simple-keyboard.hg-theme-default {\n background-color: rgba(0, 0, 0, 0.1);\n padding: 5px;\n border-radius: 5px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button {\n box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.3);\n height: 40px;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 5px;\n background: white;\n border-bottom: 1px solid #b5b5b5;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* When using option \"useButtonTag\" */\n.simple-keyboard button.hg-button {\n border-width: 0;\n outline: 0;\n font-size: inherit;\n}\n\n.simple-keyboard.hg-theme-default.hg-layout-numeric .hg-button {\n width: 33.3%;\n height: 60px;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadadd {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadenter {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpad0 {\n width: 105px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-com {\n max-width: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {\n max-width: 45px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-selectedButton {\n background: rgba(5, 25, 70, 0.53);\n color: white;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\".com\"] {\n max-width: 82px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\"@\"] {\n max-width: 60px;\n}\n\n","body,\nhtml {\n margin: 0;\n padding: 0;\n}\n\n.simple-keyboard {\n font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\",\n Helvetica, Arial, \"Lucida Grande\", sans-serif;\n width: 100%;\n user-select: none;\n box-sizing: border-box;\n overflow: hidden;\n touch-action: manipulation;\n}\n\n.simple-keyboard .hg-row {\n display: flex;\n}\n\n.simple-keyboard .hg-row:not(:last-child) {\n margin-bottom: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button:not(:last-child) {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row > div:last-child {\n margin-right: 0;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n display: flex;\n}\n\n.simple-keyboard .hg-button {\n display: inline-block;\n flex-grow: 1;\n cursor: pointer;\n}\n\n.simple-keyboard .hg-button span {\n pointer-events: none;\n}\n\n/**\n * hg-theme-default theme\n */\n.simple-keyboard.hg-theme-default {\n background-color: rgba(0, 0, 0, 0.1);\n padding: 5px;\n border-radius: 5px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button {\n box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.3);\n height: 40px;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 5px;\n background: white;\n border-bottom: 1px solid #b5b5b5;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* When using option \"useButtonTag\" */\n.simple-keyboard button.hg-button {\n border-width: 0;\n outline: 0;\n font-size: inherit;\n}\n\n.simple-keyboard.hg-theme-default.hg-layout-numeric .hg-button {\n width: 33.3%;\n height: 60px;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadadd {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadenter {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpad0 {\n width: 105px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-com {\n max-width: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {\n max-width: 45px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-selectedButton {\n background: rgba(5, 25, 70, 0.53);\n color: white;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\".com\"] {\n max-width: 82px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\"@\"] {\n max-width: 60px;\n}\n"]} \ No newline at end of file +{"version":3,"sources":["index.css","Keyboard.css"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE,CCVF,UAEE,QAAS,CACT,SACF,CAEA,iBACE,4GAC+C,CAC/C,UAAW,CACX,wBAAiB,CAAjB,qBAAiB,CAAjB,oBAAiB,CAAjB,gBAAiB,CACjB,qBAAsB,CACtB,eAAgB,CAChB,yBACF,CAEA,yBACE,YACF,CAEA,0CACE,iBACF,CAMA,mGACE,gBACF,CAEA,wCACE,cACF,CAEA,8CACE,YACF,CAEA,4BACE,oBAAqB,CACrB,WAAY,CACZ,cACF,CAEA,iCACE,mBACF,CAKA,kCACE,+BAAoC,CACpC,WAAY,CACZ,iBACF,CAEA,6CACE,sCAA+C,CAC/C,WAAY,CACZ,iBAAkB,CAClB,qBAAsB,CACtB,WAAY,CACZ,eAAiB,CACjB,+BAAgC,CAChC,cAAe,CACf,YAAa,CACb,kBAAmB,CACnB,sBACF,CAGA,kCACE,cAAe,CACf,SAAU,CACV,iBACF,CAEA,+DACE,WAAY,CACZ,WAAY,CACZ,kBAAmB,CACnB,YAAa,CACb,sBACF,CAMA,oIACE,WACF,CAEA,+DACE,WACF,CAEA,2DACE,cACF,CAEA,yEACE,cACF,CAEA,+DACE,4BAAiC,CACjC,UACF,CAEA,+EACE,cACF,CAEA,4EACE,cACF","file":"index.css","sourcesContent":["/*!\n * \n * simple-keyboard v2.26.17\n * https://github.com/hodgef/simple-keyboard\n * \n * Copyright (c) Francisco Hodge (https://github.com/hodgef)\n * \n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n * \n */\nbody,\nhtml {\n margin: 0;\n padding: 0;\n}\n\n.simple-keyboard {\n font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\",\n Helvetica, Arial, \"Lucida Grande\", sans-serif;\n width: 100%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n box-sizing: border-box;\n overflow: hidden;\n touch-action: manipulation;\n}\n\n.simple-keyboard .hg-row {\n display: flex;\n}\n\n.simple-keyboard .hg-row:not(:last-child) {\n margin-bottom: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button:not(:last-child) {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row > div:last-child {\n margin-right: 0;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n display: flex;\n}\n\n.simple-keyboard .hg-button {\n display: inline-block;\n flex-grow: 1;\n cursor: pointer;\n}\n\n.simple-keyboard .hg-button span {\n pointer-events: none;\n}\n\n/**\n * hg-theme-default theme\n */\n.simple-keyboard.hg-theme-default {\n background-color: rgba(0, 0, 0, 0.1);\n padding: 5px;\n border-radius: 5px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button {\n box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.3);\n height: 40px;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 5px;\n background: white;\n border-bottom: 1px solid #b5b5b5;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* When using option \"useButtonTag\" */\n.simple-keyboard button.hg-button {\n border-width: 0;\n outline: 0;\n font-size: inherit;\n}\n\n.simple-keyboard.hg-theme-default.hg-layout-numeric .hg-button {\n width: 33.3%;\n height: 60px;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadadd {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadenter {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpad0 {\n width: 105px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-com {\n max-width: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {\n max-width: 45px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-selectedButton {\n background: rgba(5, 25, 70, 0.53);\n color: white;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\".com\"] {\n max-width: 82px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\"@\"] {\n max-width: 60px;\n}\n\n","body,\nhtml {\n margin: 0;\n padding: 0;\n}\n\n.simple-keyboard {\n font-family: \"HelveticaNeue-Light\", \"Helvetica Neue Light\", \"Helvetica Neue\",\n Helvetica, Arial, \"Lucida Grande\", sans-serif;\n width: 100%;\n user-select: none;\n box-sizing: border-box;\n overflow: hidden;\n touch-action: manipulation;\n}\n\n.simple-keyboard .hg-row {\n display: flex;\n}\n\n.simple-keyboard .hg-row:not(:last-child) {\n margin-bottom: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button:not(:last-child) {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n margin-right: 5px;\n}\n\n.simple-keyboard .hg-row > div:last-child {\n margin-right: 0;\n}\n\n.simple-keyboard .hg-row .hg-button-container {\n display: flex;\n}\n\n.simple-keyboard .hg-button {\n display: inline-block;\n flex-grow: 1;\n cursor: pointer;\n}\n\n.simple-keyboard .hg-button span {\n pointer-events: none;\n}\n\n/**\n * hg-theme-default theme\n */\n.simple-keyboard.hg-theme-default {\n background-color: rgba(0, 0, 0, 0.1);\n padding: 5px;\n border-radius: 5px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button {\n box-shadow: 0px 0px 3px -1px rgba(0, 0, 0, 0.3);\n height: 40px;\n border-radius: 5px;\n box-sizing: border-box;\n padding: 5px;\n background: white;\n border-bottom: 1px solid #b5b5b5;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n/* When using option \"useButtonTag\" */\n.simple-keyboard button.hg-button {\n border-width: 0;\n outline: 0;\n font-size: inherit;\n}\n\n.simple-keyboard.hg-theme-default.hg-layout-numeric .hg-button {\n width: 33.3%;\n height: 60px;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadadd {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpadenter {\n height: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-numpad0 {\n width: 105px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-button-com {\n max-width: 85px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn.hg-button-at {\n max-width: 45px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-selectedButton {\n background: rgba(5, 25, 70, 0.53);\n color: white;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\".com\"] {\n max-width: 82px;\n}\n\n.simple-keyboard.hg-theme-default .hg-button.hg-standardBtn[data-skbtn=\"@\"] {\n max-width: 60px;\n}\n"]} \ No newline at end of file diff --git a/build/index.js b/build/index.js index 288f0588..0f3a933e 100644 --- a/build/index.js +++ b/build/index.js @@ -1,6 +1,6 @@ /*! * - * simple-keyboard v2.26.16 + * simple-keyboard v2.26.17 * https://github.com/hodgef/simple-keyboard * * Copyright (c) Francisco Hodge (https://github.com/hodgef) @@ -9,5 +9,5 @@ * LICENSE file in the root directory of this source tree. * */ -!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("SimpleKeyboard",[],e):"object"===typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(window,(function(){return function(t){var e={};function __webpack_require__(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)__webpack_require__.d(n,o,function(e){return t[e]}.bind(null,o));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0)}([function(t,e,n){t.exports=n(2)},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(1);function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(t,e){for(var n=0;n0?s=this.removeAt(s,n,o):"{space}"===t?s=this.addStringAt(s," ",n,o):"{tab}"!==t||"boolean"===typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt(s,t[t.length-2],n,o):"{numpaddivide}"===t?s=this.addStringAt(s,"/",n,o):"{numpadmultiply}"===t?s=this.addStringAt(s,"*",n,o):"{numpadsubtract}"===t?s=this.addStringAt(s,"-",n,o):"{numpadadd}"===t?s=this.addStringAt(s,"+",n,o):"{numpaddecimal}"===t?s=this.addStringAt(s,".",n,o):"{"===t||"}"===t?s=this.addStringAt(s,t,n,o):t.includes("{")||t.includes("}")||(s=this.addStringAt(s,t,n,o)):s=this.addStringAt(s,"\n",n,o):s=this.addStringAt(s,"\t",n,o),s}},{key:"updateCaretPos",value:function(t,e){var n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.caretPosition=n}))}},{key:"updateCaretPosAction",value:function(t,e){var n=this.getOptions(),o=this.getCaretPosition();return e?o>0&&(o-=t):o+=t,n.debug&&console.log("Caret at:",o,"(".concat(this.keyboardDOMClass,")")),o}},{key:"addStringAt",value:function(t,e,n,o){var i;return n||0===n?(i=[t.slice(0,n),e,t.slice(n)].join(""),this.isMaxLengthReached()||o&&this.updateCaretPos(e.length)):i=t+e,i}},{key:"removeAt",value:function(t,e,n){var o;if(0===this.getCaretPosition())return t;var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;return e&&e>=0?t.substring(e-2,e).match(i)?(o=t.substr(0,e-2)+t.substr(e),n&&this.updateCaretPos(2,!0)):(o=t.substr(0,e-1)+t.substr(e),n&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(o=t.slice(0,-2),n&&this.updateCaretPos(2,!0)):(o=t.slice(0,-1),n&&this.updateCaretPos(1,!0)),o}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,i=t[n.inputName],s=i.length===o;if(e.length<=i.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===_typeof(o)){var a=i.length===o[n.inputName];return n.debug&&console.log("maxLength (obj) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return window.PointerEvent}},{key:"camelCase",value:function(t){return!!t&&t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t}))}}])&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Utilities}();function PhysicalKeyboard_defineProperties(t,e){for(var n=0;n ? {shift}",".com @ {space}"]}}}],(e=null)&&KeyboardLayout_defineProperties(t.prototype,e),n&&KeyboardLayout_defineProperties(t,n),KeyboardLayout}();function _toConsumableArray(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){!this.isFirstKeyboardInstance&&this.allKeyboardInstances||(this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")")),document.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd))}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(n){n.isMouseHold&&(n.isMouseHold=!1),"textarea"!==e&&"input"!==e||n.options.disableCaretPositioning?n.options.disableCaretPositioning&&(n.caretPosition=null):(n.caretPosition=t.target.selectionStart,n.options.debug&&console.log("Caret at: ",t.target.selectionStart,t.target.tagName.toLowerCase(),"(".concat(n.keyboardDOMClass,")")))}))}},{key:"destroy",value:function(){document.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),this.clear()}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e.class&&"string"===typeof e.class&&e.buttons&&"string"===typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"===typeof n.attribute&&n.value&&"string"===typeof n.value&&n.buttons&&"string"===typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"===typeof this.options.onInit&&this.options.onInit()}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"===typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"===typeof this.options.beforeRender&&this.options.beforeRender()}},{key:"onRender",value:function(){"function"===typeof this.options.onRender&&this.options.onRender()}},{key:"onModulesLoaded",value:function(){"function"===typeof this.options.onModulesLoaded&&this.options.onModulesLoaded()}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e;if(n.constructor.name&&"Function"!==n.constructor.name){var o="module-".concat(t.utilities.camelCase(n.constructor.name));t.keyboardPluginClasses=t.keyboardPluginClasses+" ".concat(o)}n.init(t)})),this.keyboardPluginClasses=this.keyboardPluginClasses+" modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var i=this,s=Array.from(t.children),a=0;return s.length&&n.forEach((function(n,r){var u=o[r];if(!u||!(u>n))return!1;var c=n-a,l=u-a,h=document.createElement("div");h.className+="hg-button-container";var d="".concat(i.options.layoutName,"-r").concat(e,"c").concat(r);h.setAttribute("data-skUID",d);var p=s.splice(c,l-c+1);a=l-c,p.forEach((function(t){return h.appendChild(t)})),s.splice(c,0,h),t.innerHTML="",s.forEach((function(e){return t.appendChild(e)})),i.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)})),t}},{key:"render",value:function(){var t=this;this.clear(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||s.getDefaultLayout(),o=this.options.useTouchEvents||!1,i=o?"hg-touch-events":"",a=this.options.useMouseEvents||!1,r=this.options.disableRowButtonContainers;this.keyboardDOM.className+=" ".concat(this.options.theme," ").concat(e," ").concat(this.keyboardPluginClasses," ").concat(i),n[this.options.layoutName].forEach((function(e,n){var i=e.split(" "),s=document.createElement("div");s.className+="hg-row";var u=[],c=[];i.forEach((function(e,i){var l,h=!r&&e.includes("[")&&e.length>1,d=!r&&e.includes("]")&&e.length>1;h&&(u.push(i),e=e.replace(/\[/g,"")),d&&(c.push(i),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),f=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),y=t.options.useButtonTag?"button":"div",b=document.createElement(y);b.className+="hg-button ".concat(p),(l=b.classList).add.apply(l,_toConsumableArray(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){b.setAttribute(t,e)})),!t.utilities.pointerEventsSupported()||o||a?o?(b.ontouchstart=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.ontouchend=function(){return t.handleButtonMouseUp(e)},b.ontouchcancel=function(){return t.handleButtonMouseUp(e)}):(b.onclick=function(){t.isMouseHold=!1,t.handleButtonClicked(e)},b.onmousedown=function(n){return t.handleButtonMouseDown(e,n)},b.onmouseup=function(){return t.handleButtonMouseUp(e)}):(b.onpointerdown=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.onpointerup=function(){return t.handleButtonMouseUp(e)},b.onpointercancel=function(){return t.handleButtonMouseUp(e)}),b.setAttribute("data-skBtn",e);var m="".concat(t.options.layoutName,"-r").concat(n,"b").concat(i);b.setAttribute("data-skBtnUID",m);var g=document.createElement("span");g.innerHTML=f,b.appendChild(g),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(b),s.appendChild(b)})),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardDOM.appendChild(s)})),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||a?o?(document.ontouchend=function(){return t.handleButtonMouseUp()},document.ontouchcancel=function(){return t.handleButtonMouseUp()},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}])&&Keyboard_defineProperties(t.prototype,e),n&&Keyboard_defineProperties(t,n),SimpleKeyboard}();e.default=a}])})); +!function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define("SimpleKeyboard",[],e):"object"===typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(window,(function(){return function(t){var e={};function __webpack_require__(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,__webpack_require__),o.l=!0,o.exports}return __webpack_require__.m=t,__webpack_require__.c=e,__webpack_require__.d=function(t,e,n){__webpack_require__.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},__webpack_require__.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},__webpack_require__.t=function(t,e){if(1&e&&(t=__webpack_require__(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)__webpack_require__.d(n,o,function(e){return t[e]}.bind(null,o));return n},__webpack_require__.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return __webpack_require__.d(e,"a",e),e},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.p="",__webpack_require__(__webpack_require__.s=0)}([function(t,e,n){t.exports=n(2)},function(t,e,n){},function(t,e,n){"use strict";n.r(e);n(1);function _typeof(t){return(_typeof="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _defineProperties(t,e){for(var n=0;n0?s=this.removeAt(s,n,o):"{space}"===t?s=this.addStringAt(s," ",n,o):"{tab}"!==t||"boolean"===typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt(s,t[t.length-2],n,o):"{numpaddivide}"===t?s=this.addStringAt(s,"/",n,o):"{numpadmultiply}"===t?s=this.addStringAt(s,"*",n,o):"{numpadsubtract}"===t?s=this.addStringAt(s,"-",n,o):"{numpadadd}"===t?s=this.addStringAt(s,"+",n,o):"{numpaddecimal}"===t?s=this.addStringAt(s,".",n,o):"{"===t||"}"===t?s=this.addStringAt(s,t,n,o):t.includes("{")||t.includes("}")||(s=this.addStringAt(s,t,n,o)):s=this.addStringAt(s,"\n",n,o):s=this.addStringAt(s,"\t",n,o),s}},{key:"updateCaretPos",value:function(t,e){var n=this.updateCaretPosAction(t,e);this.dispatch((function(t){t.caretPosition=n}))}},{key:"updateCaretPosAction",value:function(t,e){var n=this.getOptions(),o=this.getCaretPosition();return e?o>0&&(o-=t):o+=t,n.debug&&console.log("Caret at:",o,"(".concat(this.keyboardDOMClass,")")),o}},{key:"addStringAt",value:function(t,e,n,o){var i;return n||0===n?(i=[t.slice(0,n),e,t.slice(n)].join(""),this.isMaxLengthReached()||o&&this.updateCaretPos(e.length)):i=t+e,i}},{key:"removeAt",value:function(t,e,n){var o;if(0===this.getCaretPosition())return t;var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;return e&&e>=0?t.substring(e-2,e).match(i)?(o=t.substr(0,e-2)+t.substr(e),n&&this.updateCaretPos(2,!0)):(o=t.substr(0,e-1)+t.substr(e),n&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(o=t.slice(0,-2),n&&this.updateCaretPos(2,!0)):(o=t.slice(0,-1),n&&this.updateCaretPos(1,!0)),o}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,i=t[n.inputName],s=e.length-1>=o;if(e.length<=i.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===_typeof(o)){var a=i.length===o[n.inputName];return n.debug&&console.log("maxLength (obj) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return window.PointerEvent}},{key:"camelCase",value:function(t){return!!t&&t.toLowerCase().trim().split(/[.\-_\s]/g).reduce((function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t}))}}])&&_defineProperties(t.prototype,e),n&&_defineProperties(t,n),Utilities}();function PhysicalKeyboard_defineProperties(t,e){for(var n=0;n ? {shift}",".com @ {space}"]}}}],(e=null)&&KeyboardLayout_defineProperties(t.prototype,e),n&&KeyboardLayout_defineProperties(t,n),KeyboardLayout}();function _toConsumableArray(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){!this.isFirstKeyboardInstance&&this.allKeyboardInstances||(this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")")),document.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd))}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch((function(n){n.isMouseHold&&(n.isMouseHold=!1),"textarea"!==e&&"input"!==e||n.options.disableCaretPositioning?n.options.disableCaretPositioning&&(n.caretPosition=null):(n.caretPosition=t.target.selectionStart,n.options.debug&&console.log("Caret at: ",t.target.selectionStart,t.target.tagName.toLowerCase(),"(".concat(n.keyboardDOMClass,")")))}))}},{key:"destroy",value:function(){document.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),this.clear()}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach((function(e){if(e.class&&"string"===typeof e.class&&e.buttons&&"string"===typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(_toConsumableArray(n),_toConsumableArray(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)})),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach((function(n){n.attribute&&"string"===typeof n.attribute&&n.value&&"string"===typeof n.value&&n.buttons&&"string"===typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)}))}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"===typeof this.options.onInit&&this.options.onInit()}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"===typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"===typeof this.options.beforeRender&&this.options.beforeRender()}},{key:"onRender",value:function(){"function"===typeof this.options.onRender&&this.options.onRender()}},{key:"onModulesLoaded",value:function(){"function"===typeof this.options.onModulesLoaded&&this.options.onModulesLoaded()}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach((function(e){var n=new e;if(n.constructor.name&&"Function"!==n.constructor.name){var o="module-".concat(t.utilities.camelCase(n.constructor.name));t.keyboardPluginClasses=t.keyboardPluginClasses+" ".concat(o)}n.init(t)})),this.keyboardPluginClasses=this.keyboardPluginClasses+" modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var i=this,s=Array.from(t.children),a=0;return s.length&&n.forEach((function(n,r){var u=o[r];if(!u||!(u>n))return!1;var c=n-a,l=u-a,h=document.createElement("div");h.className+="hg-button-container";var d="".concat(i.options.layoutName,"-r").concat(e,"c").concat(r);h.setAttribute("data-skUID",d);var p=s.splice(c,l-c+1);a=l-c,p.forEach((function(t){return h.appendChild(t)})),s.splice(c,0,h),t.innerHTML="",s.forEach((function(e){return t.appendChild(e)})),i.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)})),t}},{key:"render",value:function(){var t=this;this.clear(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||s.getDefaultLayout(),o=this.options.useTouchEvents||!1,i=o?"hg-touch-events":"",a=this.options.useMouseEvents||!1,r=this.options.disableRowButtonContainers;this.keyboardDOM.className+=" ".concat(this.options.theme," ").concat(e," ").concat(this.keyboardPluginClasses," ").concat(i),n[this.options.layoutName].forEach((function(e,n){var i=e.split(" "),s=document.createElement("div");s.className+="hg-row";var u=[],c=[];i.forEach((function(e,i){var l,h=!r&&e.includes("[")&&e.length>1,d=!r&&e.includes("]")&&e.length>1;h&&(u.push(i),e=e.replace(/\[/g,"")),d&&(c.push(i),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),f=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),y=t.options.useButtonTag?"button":"div",b=document.createElement(y);b.className+="hg-button ".concat(p),(l=b.classList).add.apply(l,_toConsumableArray(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,(function(t,e){b.setAttribute(t,e)})),!t.utilities.pointerEventsSupported()||o||a?o?(b.ontouchstart=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.ontouchend=function(){return t.handleButtonMouseUp(e)},b.ontouchcancel=function(){return t.handleButtonMouseUp(e)}):(b.onclick=function(){t.isMouseHold=!1,t.handleButtonClicked(e)},b.onmousedown=function(n){return t.handleButtonMouseDown(e,n)},b.onmouseup=function(){return t.handleButtonMouseUp(e)}):(b.onpointerdown=function(n){t.handleButtonClicked(e),t.handleButtonMouseDown(e,n)},b.onpointerup=function(){return t.handleButtonMouseUp(e)},b.onpointercancel=function(){return t.handleButtonMouseUp(e)}),b.setAttribute("data-skBtn",e);var m="".concat(t.options.layoutName,"-r").concat(n,"b").concat(i);b.setAttribute("data-skBtnUID",m);var g=document.createElement("span");g.innerHTML=f,b.appendChild(g),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(b),s.appendChild(b)})),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardDOM.appendChild(s)})),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||a?o?(document.ontouchend=function(){return t.handleButtonMouseUp()},document.ontouchcancel=function(){return t.handleButtonMouseUp()},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(){return t.handleButtonMouseUp()},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}])&&Keyboard_defineProperties(t.prototype,e),n&&Keyboard_defineProperties(t,n),SimpleKeyboard}();e.default=a}])})); //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/build/index.js.map b/build/index.js.map index 12751d52..b3386136 100644 --- a/build/index.js.map +++ b/build/index.js.map @@ -1 +1 @@ -{"version":3,"sources":["../../webpack/universalModuleDefinition","../../webpack/bootstrap","services/Utilities.js","services/PhysicalKeyboard.js","services/KeyboardLayout.js","components/Keyboard.js","index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Utilities","getOptions","getCaretPosition","dispatch","this","bindMethods","myClass","instance","getOwnPropertyNames","myMethod","button","buttonTypeClass","includes","buttonWithoutBraces","replace","buttonNormalized","display","mergeDisplay","assign","getDefaultDiplay","input","caretPos","moveCaret","options","output","length","removeAt","addStringAt","tabCharOnTab","newLineOnEnter","Number","isInteger","minus","newCaretPos","updateCaretPosAction","caretPosition","debug","console","log","keyboardDOMClass","source","string","position","slice","join","isMaxLengthReached","updateCaretPos","emojiMatchedReg","substring","match","substr","inputObj","updatedInput","maxLength","currentInput","inputName","condition","maxLengthReached","Boolean","navigator","maxTouchPoints","PointerEvent","toLowerCase","trim","split","reduce","word","toUpperCase","PhysicalKeyboard","event","buttonPressed","getSimpleKeyboardLayoutKey","buttonDOM","getButtonElement","style","backgroundColor","physicalKeyboardHighlightBgColor","color","physicalKeyboardHighlightTextColor","removeAttribute","code","KeyboardLayout","default","shift","SimpleKeyboard","initCallback","keyboardDOMQuery","utilities","keyboardDOM","document","querySelector","layoutName","theme","preventMouseDownDefault","keyboardPluginClasses","buttonElements","camelCase","allKeyboardInstances","currentInstanceName","keyboardInstanceNames","keys","isFirstKeyboardInstance","physicalKeyboard","warn","Error","render","loadModules","onKeyPress","getUpdatedInput","inputPattern","inputPatternIsValid","handleMaxLength","syncInstanceInputs","onChange","onChangeAll","e","preventDefault","stopMouseDownPropagation","stopPropagation","isMouseHold","holdInteractionTimeout","clearTimeout","holdTimeout","disableButtonHold","setTimeout","handleButtonHold","onKeyReleased","handleButtonClicked","replaceInput","onSetOptions","innerHTML","className","callback","forEach","buttons","classNameItem","buttonTheme","classNameFound","map","class","buttonThemeArray","push","Array","isArray","index","filteredButtonArray","filter","item","splice","buttonArr","inputVal","inputPatternRaw","RegExp","didInputMatch","test","addEventListener","handleKeyUp","handleKeyDown","handleMouseUp","handleTouchEnd","caretEventHandler","physicalKeyboardHighlight","handleHighlightKeyUp","handleHighlightKeyDown","targetTagName","target","tagName","disableCaretPositioning","selectionStart","removeEventListener","clear","buttonClasses","themeObj","themeObjClasses","buttonAttributes","attrObj","attribute","processAutoTouchEvents","disableContextualWindow","oncontextmenu","classList","contains","autoUseTouchEvents","useTouchEvents","setEventListeners","onInit","isTouchDevice","onTouchDeviceDetected","beforeFirstRender","pointerEventsSupported","useMouseEvents","beforeRender","onRender","onModulesLoaded","Module","constructor","classStr","init","prop","rowDOM","rowIndex","containerStartIndexes","containerEndIndexes","rowDOMArray","from","children","removedElements","startIndex","arrIndex","endIndex","updated_startIndex","updated_endIndex","containerDOM","createElement","containerUID","setAttribute","containedElements","element","appendChild","initialized","layoutClass","layout","getDefaultLayout","useTouchEventsClass","disableRowButtonContainers","row","rIndex","rowArray","bIndex","buttonHasContainerStart","buttonHasContainerEnd","fctBtnClass","getButtonClass","buttonDisplayName","getButtonDisplayName","buttonType","useButtonTag","add","getButtonThemeClasses","setDOMButtonAttributes","ontouchstart","handleButtonMouseDown","ontouchend","handleButtonMouseUp","ontouchcancel","onclick","onmousedown","onmouseup","onpointerdown","onpointerup","onpointercancel","buttonUID","buttonSpanDOM","parseRowDOMContainers","handleKeyboardContainerMouseDown"],"mappings":";;;;;;;;;;;CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,IACQ,oBAAXG,QAAyBA,OAAOC,IAC9CD,OAAO,iBAAkB,GAAIH,GACH,kBAAZC,QACdA,QAAwB,eAA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zD5J,EAAU+I,aAAa,gBAAiBoC,GAKxC,IAAIC,EAAgBnK,SAAS4H,cAAc,QAC3CuC,EAAc1H,UAAYuG,EAC1BjK,EAAUkJ,YAAYkC,GAKjB,EAAK7J,eAAerF,KAAS,EAAKqF,eAAerF,GAAU,IAEhE,EAAKqF,eAAerF,GAAQmI,KAAKrE,GAKjC+H,EAAOmB,YAAYlJ,MAMrB+H,EAAS,EAAKsD,sBACZtD,EACA2B,EACAzB,EACAC,GAMF,EAAKlH,YAAYkI,YAAYnB,MAM/BnM,KAAK4L,WAEA5L,KAAKuN,cAIRvN,KAAKuN,aAAc,GAOjBvN,KAAKmF,UAAUsG,0BACdN,GACAO,EAKQP,GAIT9F,SAASyJ,WAAa,kBAAM,EAAKC,uBACjC1J,SAAS2J,cAAgB,kBAAM,EAAKD,uBAEpC/O,KAAKoF,YAAYwJ,aAAe,SAAA7H,GAAC,OAC/B,EAAK2I,iCAAiC3I,KAC9BoE,IAIV9F,SAAS8J,UAAY,kBAAM,EAAKJ,uBAChC/O,KAAKoF,YAAY8J,YAAc,SAAAnI,GAAC,OAC9B,EAAK2I,iCAAiC3I,MAlBxC1B,SAASgK,YAAc,kBAAM,EAAKN,uBAClC/O,KAAKoF,YAAYgK,cAAgB,SAAArI,GAAC,OAChC,EAAK2I,iCAAiC3I,KAsB1C/G,KAAKqL,e,6FClyCIrG","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"SimpleKeyboard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SimpleKeyboard\"] = factory();\n\telse\n\t\troot[\"SimpleKeyboard\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Utility Service\n */\nclass Utilities {\n /**\n * Creates an instance of the Utility service\n */\n constructor({ getOptions, getCaretPosition, dispatch }) {\n this.getOptions = getOptions;\n this.getCaretPosition = getCaretPosition;\n this.dispatch = dispatch;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(Utilities, this);\n }\n\n /**\n * Adds default classes to a given button\n *\n * @param {string} button The button's layout name\n * @return {string} The classes to be added to the button\n */\n getButtonClass(button) {\n let buttonTypeClass =\n button.includes(\"{\") && button.includes(\"}\") && button !== \"{//}\"\n ? \"functionBtn\"\n : \"standardBtn\";\n let buttonWithoutBraces = button.replace(\"{\", \"\").replace(\"}\", \"\");\n let buttonNormalized = \"\";\n\n if (buttonTypeClass !== \"standardBtn\")\n buttonNormalized = ` hg-button-${buttonWithoutBraces}`;\n\n return `hg-${buttonTypeClass}${buttonNormalized}`;\n }\n\n /**\n * Default button display labels\n */\n getDefaultDiplay() {\n return {\n \"{bksp}\": \"backspace\",\n \"{backspace}\": \"backspace\",\n \"{enter}\": \"< enter\",\n \"{shift}\": \"shift\",\n \"{shiftleft}\": \"shift\",\n \"{shiftright}\": \"shift\",\n \"{alt}\": \"alt\",\n \"{s}\": \"shift\",\n \"{tab}\": \"tab\",\n \"{lock}\": \"caps\",\n \"{capslock}\": \"caps\",\n \"{accept}\": \"Submit\",\n \"{space}\": \" \",\n \"{//}\": \" \",\n \"{esc}\": \"esc\",\n \"{escape}\": \"esc\",\n \"{f1}\": \"f1\",\n \"{f2}\": \"f2\",\n \"{f3}\": \"f3\",\n \"{f4}\": \"f4\",\n \"{f5}\": \"f5\",\n \"{f6}\": \"f6\",\n \"{f7}\": \"f7\",\n \"{f8}\": \"f8\",\n \"{f9}\": \"f9\",\n \"{f10}\": \"f10\",\n \"{f11}\": \"f11\",\n \"{f12}\": \"f12\",\n \"{numpaddivide}\": \"/\",\n \"{numlock}\": \"lock\",\n \"{arrowup}\": \"↑\",\n \"{arrowleft}\": \"←\",\n \"{arrowdown}\": \"↓\",\n \"{arrowright}\": \"→\",\n \"{prtscr}\": \"print\",\n \"{scrolllock}\": \"scroll\",\n \"{pause}\": \"pause\",\n \"{insert}\": \"ins\",\n \"{home}\": \"home\",\n \"{pageup}\": \"up\",\n \"{delete}\": \"del\",\n \"{end}\": \"end\",\n \"{pagedown}\": \"down\",\n \"{numpadmultiply}\": \"*\",\n \"{numpadsubtract}\": \"-\",\n \"{numpadadd}\": \"+\",\n \"{numpadenter}\": \"enter\",\n \"{period}\": \".\",\n \"{numpaddecimal}\": \".\",\n \"{numpad0}\": \"0\",\n \"{numpad1}\": \"1\",\n \"{numpad2}\": \"2\",\n \"{numpad3}\": \"3\",\n \"{numpad4}\": \"4\",\n \"{numpad5}\": \"5\",\n \"{numpad6}\": \"6\",\n \"{numpad7}\": \"7\",\n \"{numpad8}\": \"8\",\n \"{numpad9}\": \"9\"\n };\n }\n /**\n * Returns the display (label) name for a given button\n *\n * @param {string} button The button's layout name\n * @param {object} display The provided display option\n * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.\n */\n getButtonDisplayName(button, display, mergeDisplay) {\n if (mergeDisplay) {\n display = Object.assign({}, this.getDefaultDiplay(), display);\n } else {\n display = display || this.getDefaultDiplay();\n }\n\n return display[button] || button;\n }\n\n /**\n * Returns the updated input resulting from clicking a given button\n *\n * @param {string} button The button's layout name\n * @param {string} input The input string\n * @param {number} caretPos The cursor's current position\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n getUpdatedInput(button, input, caretPos, moveCaret) {\n let options = this.getOptions();\n let output = input;\n\n if (\n (button === \"{bksp}\" || button === \"{backspace}\") &&\n output.length > 0\n ) {\n output = this.removeAt(output, caretPos, moveCaret);\n } else if (button === \"{space}\")\n output = this.addStringAt(output, \" \", caretPos, moveCaret);\n else if (\n button === \"{tab}\" &&\n !(\n typeof options.tabCharOnTab === \"boolean\" &&\n options.tabCharOnTab === false\n )\n ) {\n output = this.addStringAt(output, \"\\t\", caretPos, moveCaret);\n } else if (\n (button === \"{enter}\" || button === \"{numpadenter}\") &&\n options.newLineOnEnter\n )\n output = this.addStringAt(output, \"\\n\", caretPos, moveCaret);\n else if (\n button.includes(\"numpad\") &&\n Number.isInteger(Number(button[button.length - 2]))\n ) {\n output = this.addStringAt(\n output,\n button[button.length - 2],\n caretPos,\n moveCaret\n );\n } else if (button === \"{numpaddivide}\")\n output = this.addStringAt(output, \"/\", caretPos, moveCaret);\n else if (button === \"{numpadmultiply}\")\n output = this.addStringAt(output, \"*\", caretPos, moveCaret);\n else if (button === \"{numpadsubtract}\")\n output = this.addStringAt(output, \"-\", caretPos, moveCaret);\n else if (button === \"{numpadadd}\")\n output = this.addStringAt(output, \"+\", caretPos, moveCaret);\n else if (button === \"{numpaddecimal}\")\n output = this.addStringAt(output, \".\", caretPos, moveCaret);\n else if (button === \"{\" || button === \"}\")\n output = this.addStringAt(output, button, caretPos, moveCaret);\n else if (!button.includes(\"{\") && !button.includes(\"}\"))\n output = this.addStringAt(output, button, caretPos, moveCaret);\n\n return output;\n }\n\n /**\n * Moves the cursor position by a given amount\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPos(length, minus) {\n let newCaretPos = this.updateCaretPosAction(length, minus);\n\n this.dispatch(instance => {\n instance.caretPosition = newCaretPos;\n });\n }\n\n /**\n * Action method of updateCaretPos\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPosAction(length, minus) {\n let options = this.getOptions();\n let caretPosition = this.getCaretPosition();\n\n if (minus) {\n if (caretPosition > 0) caretPosition = caretPosition - length;\n } else {\n caretPosition = caretPosition + length;\n }\n\n if (options.debug) {\n console.log(\"Caret at:\", caretPosition, `(${this.keyboardDOMClass})`);\n }\n\n return caretPosition;\n }\n\n /**\n * Adds a string to the input at a given position\n *\n * @param {string} source The source input\n * @param {string} string The string to add\n * @param {number} position The (cursor) position where the string should be added\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n addStringAt(source, string, position, moveCaret) {\n let output;\n\n if (!position && position !== 0) {\n output = source + string;\n } else {\n output = [source.slice(0, position), string, source.slice(position)].join(\n \"\"\n );\n\n /**\n * Avoid caret position change when maxLength is set\n */\n if (!this.isMaxLengthReached()) {\n if (moveCaret) this.updateCaretPos(string.length);\n }\n }\n\n return output;\n }\n\n /**\n * Removes an amount of characters at a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n removeAt(source, position, moveCaret) {\n let caretPosition = this.getCaretPosition();\n\n if (caretPosition === 0) {\n return source;\n }\n\n let output;\n let prevTwoChars;\n let emojiMatched;\n let emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n if (position && position >= 0) {\n prevTwoChars = source.substring(position - 2, position);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position - 2) + source.substr(position);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.substr(0, position - 1) + source.substr(position);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n } else {\n prevTwoChars = source.slice(-2);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.slice(0, -2);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.slice(0, -1);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n }\n\n return output;\n }\n /**\n * Determines whether the maxLength has been reached. This function is called when the maxLength option it set.\n *\n * @param {object} inputObj\n * @param {string} updatedInput\n */\n handleMaxLength(inputObj, updatedInput) {\n let options = this.getOptions();\n let maxLength = options.maxLength;\n let currentInput = inputObj[options.inputName];\n let condition = currentInput.length === maxLength;\n\n if (\n /**\n * If pressing this button won't add more characters\n * We exit out of this limiter function\n */\n updatedInput.length <= currentInput.length\n ) {\n return false;\n }\n\n if (Number.isInteger(maxLength)) {\n if (options.debug) {\n console.log(\"maxLength (num) reached:\", condition);\n }\n\n if (condition) {\n /**\n * @type {boolean} Boolean value that shows whether maxLength has been reached\n */\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n\n if (typeof maxLength === \"object\") {\n let condition = currentInput.length === maxLength[options.inputName];\n\n if (options.debug) {\n console.log(\"maxLength (obj) reached:\", condition);\n }\n\n if (condition) {\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n }\n\n /**\n * Gets the current value of maxLengthReached\n */\n isMaxLengthReached() {\n return Boolean(this.maxLengthReached);\n }\n\n /**\n * Determines whether a touch device is being used\n */\n isTouchDevice() {\n return \"ontouchstart\" in window || navigator.maxTouchPoints;\n }\n\n /**\n * Determines whether pointer events are supported\n */\n pointerEventsSupported() {\n return window.PointerEvent;\n }\n\n /**\n * Bind all methods in a given class\n */\n\n static bindMethods(myClass, instance) {\n // eslint-disable-next-line no-unused-vars\n for (let myMethod of Object.getOwnPropertyNames(myClass.prototype)) {\n let excludeMethod =\n myMethod === \"constructor\" || myMethod === \"bindMethods\";\n if (!excludeMethod) {\n instance[myMethod] = instance[myMethod].bind(instance);\n }\n }\n }\n\n /**\n * Transforms an arbitrary string to camelCase\n *\n * @param {string} string The string to transform.\n */\n camelCase(string) {\n if (!string) return false;\n\n return string\n .toLowerCase()\n .trim()\n .split(/[.\\-_\\s]/g)\n .reduce((string, word) =>\n word.length ? string + word[0].toUpperCase() + word.slice(1) : string\n );\n }\n}\n\nexport default Utilities;\n","import Utilities from \"../services/Utilities\";\n\n/**\n * Physical Keyboard Service\n */\nclass PhysicalKeyboard {\n /**\n * Creates an instance of the PhysicalKeyboard service\n */\n constructor({ dispatch, getOptions }) {\n /**\n * @type {object} A simple-keyboard instance\n */\n this.dispatch = dispatch;\n this.getOptions = getOptions;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(PhysicalKeyboard, this);\n }\n\n handleHighlightKeyDown(event) {\n let options = this.getOptions();\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\n\n this.dispatch(instance => {\n let buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n if (buttonDOM) {\n buttonDOM.style.backgroundColor =\n options.physicalKeyboardHighlightBgColor || \"#9ab4d0\";\n buttonDOM.style.color =\n options.physicalKeyboardHighlightTextColor || \"white\";\n }\n });\n }\n\n handleHighlightKeyUp(event) {\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\n\n this.dispatch(instance => {\n let buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n if (buttonDOM && buttonDOM.removeAttribute) {\n buttonDOM.removeAttribute(\"style\");\n }\n });\n }\n\n /**\n * Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format\n * @param {object} event The KeyboardEvent\n */\n getSimpleKeyboardLayoutKey(event) {\n let output;\n\n if (\n event.code.includes(\"Numpad\") ||\n event.code.includes(\"Shift\") ||\n event.code.includes(\"Space\") ||\n event.code.includes(\"Backspace\") ||\n event.code.includes(\"Control\") ||\n event.code.includes(\"Alt\") ||\n event.code.includes(\"Meta\")\n ) {\n output = event.code;\n } else {\n output = event.key;\n }\n\n /**\n * If button is not uppercase, casting to lowercase\n */\n if (\n output !== output.toUpperCase() ||\n (event.code[0] === \"F\" &&\n Number.isInteger(Number(event.code[1])) &&\n event.code.length <= 3)\n ) {\n output = output.toLowerCase();\n }\n\n return output;\n }\n}\n\nexport default PhysicalKeyboard;\n","/**\n * Keyboard Layout Service\n */\nclass KeyboardLayout {\n /**\n * Get default simple-keyboard layout\n * @return {object} The default layout (US-QWERTY)\n */\n static getDefaultLayout() {\n return {\n default: [\n \"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}\",\n \"{tab} q w e r t y u i o p [ ] \\\\\",\n \"{lock} a s d f g h j k l ; ' {enter}\",\n \"{shift} z x c v b n m , . / {shift}\",\n \".com @ {space}\"\n ],\n shift: [\n \"~ ! @ # $ % ^ & * ( ) _ + {bksp}\",\n \"{tab} Q W E R T Y U I O P { } |\",\n '{lock} A S D F G H J K L : \" {enter}',\n \"{shift} Z X C V B N M < > ? {shift}\",\n \".com @ {space}\"\n ]\n };\n }\n}\n\nexport default KeyboardLayout;\n","import \"./Keyboard.css\";\n\n// Services\nimport PhysicalKeyboard from \"../services/PhysicalKeyboard\";\nimport KeyboardLayout from \"../services/KeyboardLayout\";\nimport Utilities from \"../services/Utilities\";\n\n/**\n * Root class for simple-keyboard\n * This class:\n * - Parses the options\n * - Renders the rows and buttons\n * - Handles button functionality\n */\nclass SimpleKeyboard {\n /**\n * Creates an instance of SimpleKeyboard\n * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.\n */\n constructor(...params) {\n let keyboardDOMQuery =\n typeof params[0] === \"string\" ? params[0] : \".simple-keyboard\";\n let options = typeof params[0] === \"object\" ? params[0] : params[1];\n\n if (!options) options = {};\n\n /**\n * Initializing Utilities\n */\n this.utilities = new Utilities({\n getOptions: this.getOptions,\n getCaretPosition: this.getCaretPosition,\n dispatch: this.dispatch\n });\n\n /**\n * Caret position\n */\n this.caretPosition = null;\n\n /**\n * Processing options\n */\n this.keyboardDOM = document.querySelector(keyboardDOMQuery);\n\n /**\n * @type {object}\n * @property {object} layout Modify the keyboard layout.\n * @property {string} layoutName Specifies which layout should be used.\n * @property {object} display Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: “backspace”).\n * @property {boolean} mergeDisplay By default, when you set the display property, you replace the default one. This setting merges them instead.\n * @property {string} theme A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.\n * @property {Array} buttonTheme A prop to add your own css classes to one or several buttons.\n * @property {Array} buttonAttributes A prop to add your own attributes to one or several buttons.\n * @property {boolean} debug Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.\n * @property {boolean} newLineOnEnter Specifies whether clicking the “ENTER” button will input a newline (\\n) or not.\n * @property {boolean} tabCharOnTab Specifies whether clicking the “TAB” button will input a tab character (\\t) or not.\n * @property {string} inputName Allows you to use a single simple-keyboard instance for several inputs.\n * @property {number} maxLength Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {object} maxLength Restrains simple-keyboard’s individual inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.\n * @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.\n * @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.\n * @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.\n * @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.\n * @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: “{shift}”).\n * @property {function(input: string):string} onChange Executes the callback function on input change. Returns the current input’s string.\n * @property {function} onRender Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n * @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n * @property {function(inputs: object):object} onChangeAll Executes the callback function on input change. Returns the input object with all defined inputs.\n * @property {boolean} useButtonTag Render buttons as a button element instead of a div element.\n * @property {boolean} disableCaretPositioning A prop to ensure characters are always be added/removed at the end of the string.\n * @property {object} inputPattern Restrains input(s) change to the defined regular expression pattern.\n * @property {boolean} useTouchEvents Instructs simple-keyboard to use touch events instead of click events.\n * @property {boolean} autoUseTouchEvents Enable useTouchEvents automatically when touch device is detected.\n * @property {boolean} useMouseEvents Opt out of PointerEvents handling, falling back to the prior mouse event logic.\n * @property {function} destroy Clears keyboard listeners and DOM elements.\n * @property {boolean} disableButtonHold Disable button hold action.\n * @property {function} onKeyReleased Executes the callback function on key release.\n */\n this.options = options;\n this.options.layoutName = this.options.layoutName || \"default\";\n this.options.theme = this.options.theme || \"hg-theme-default\";\n this.options.inputName = this.options.inputName || \"default\";\n this.options.preventMouseDownDefault =\n this.options.preventMouseDownDefault || false;\n\n /**\n * @type {object} Classes identifying loaded plugins\n */\n this.keyboardPluginClasses = \"\";\n\n /**\n * Bindings\n */\n Utilities.bindMethods(SimpleKeyboard, this);\n\n /**\n * simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).\n * This removes any dependency to input DOM elements. You can type and directly display the value in a div element, for example.\n * @example\n * // To get entered input\n * let input = keyboard.getInput();\n *\n * // To clear entered input.\n * keyboard.clearInput();\n *\n * @type {object}\n * @property {object} default Default SimpleKeyboard internal input.\n * @property {object} myInputName Example input that can be set through `options.inputName:\"myInputName\"`.\n */\n this.input = {};\n this.input[this.options.inputName] = \"\";\n\n /**\n * @type {string} DOM class of the keyboard wrapper, normally \"simple-keyboard\" by default.\n */\n this.keyboardDOMClass = keyboardDOMQuery.split(\".\").join(\"\");\n\n /**\n * @type {object} Contains the DOM elements of every rendered button, the key being the button's layout name (e.g.: \"{enter}\").\n */\n this.buttonElements = {};\n\n /**\n * Simple-keyboard Instances\n * This enables multiple simple-keyboard support with easier management\n */\n if (!window[\"SimpleKeyboardInstances\"])\n window[\"SimpleKeyboardInstances\"] = {};\n\n window[\"SimpleKeyboardInstances\"][\n this.utilities.camelCase(this.keyboardDOMClass)\n ] = this;\n\n /**\n * Instance vars\n */\n this.allKeyboardInstances = window[\"SimpleKeyboardInstances\"];\n this.currentInstanceName = this.utilities.camelCase(this.keyboardDOMClass);\n this.keyboardInstanceNames = Object.keys(window[\"SimpleKeyboardInstances\"]);\n this.isFirstKeyboardInstance =\n this.keyboardInstanceNames[0] === this.currentInstanceName;\n\n /**\n * Physical Keyboard support\n */\n this.physicalKeyboard = new PhysicalKeyboard({\n dispatch: this.dispatch,\n getOptions: this.getOptions\n });\n\n /**\n * Rendering keyboard\n */\n if (this.keyboardDOM) this.render();\n else {\n console.warn(`\"${keyboardDOMQuery}\" was not found in the DOM.`);\n throw new Error(\"KEYBOARD_DOM_ERROR\");\n }\n\n /**\n * Modules\n */\n this.modules = {};\n this.loadModules();\n }\n\n /**\n * Getters\n */\n getOptions = () => this.options;\n getCaretPosition = () => this.caretPosition;\n\n /**\n * Handles clicks made to keyboard buttons\n * @param {string} button The button's layout name.\n */\n handleButtonClicked(button) {\n let debug = this.options.debug;\n\n /**\n * Ignoring placeholder buttons\n */\n if (button === \"{//}\") return false;\n\n /**\n * Calling onKeyPress\n */\n if (typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(button);\n\n if (!this.input[this.options.inputName])\n this.input[this.options.inputName] = \"\";\n\n let updatedInput = this.utilities.getUpdatedInput(\n button,\n this.input[this.options.inputName],\n this.caretPosition\n );\n\n if (\n // If input will change as a result of this button press\n this.input[this.options.inputName] !== updatedInput &&\n // This pertains to the \"inputPattern\" option:\n // If inputPattern isn't set\n (!this.options.inputPattern ||\n // Or, if it is set and if the pattern is valid - we proceed.\n (this.options.inputPattern && this.inputPatternIsValid(updatedInput)))\n ) {\n /**\n * If maxLength and handleMaxLength yield true, halting\n */\n if (\n this.options.maxLength &&\n this.utilities.handleMaxLength(this.input, updatedInput)\n ) {\n return false;\n }\n\n this.input[this.options.inputName] = this.utilities.getUpdatedInput(\n button,\n this.input[this.options.inputName],\n this.caretPosition,\n true\n );\n\n if (debug) console.log(\"Input changed:\", this.input);\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n /**\n * Calling onChange\n */\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(this.input[this.options.inputName]);\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.input);\n }\n\n if (debug) {\n console.log(\"Key pressed:\", button);\n }\n }\n\n /**\n * Handles button mousedown\n */\n /* istanbul ignore next */\n handleButtonMouseDown(button, e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n if (this.options.stopMouseDownPropagation) e.stopPropagation();\n\n /**\n * @type {boolean} Whether the mouse is being held onKeyPress\n */\n this.isMouseHold = true;\n\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n if (this.holdTimeout) clearTimeout(this.holdTimeout);\n\n /**\n * @type {object} Time to wait until a key hold is detected\n */\n if (!this.options.disableButtonHold) {\n this.holdTimeout = setTimeout(() => {\n if (\n this.isMouseHold &&\n ((!button.includes(\"{\") && !button.includes(\"}\")) ||\n button === \"{delete}\" ||\n button === \"{backspace}\" ||\n button === \"{bksp}\" ||\n button === \"{space}\" ||\n button === \"{tab}\")\n ) {\n if (this.options.debug) console.log(\"Button held:\", button);\n\n this.handleButtonHold(button, e);\n }\n clearTimeout(this.holdTimeout);\n }, 500);\n }\n }\n\n /**\n * Handles button mouseup\n */\n handleButtonMouseUp(button) {\n this.isMouseHold = false;\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * Calling onKeyReleased\n */\n if (button && typeof this.options.onKeyReleased === \"function\")\n this.options.onKeyReleased(button);\n }\n\n /**\n * Handles container mousedown\n */\n handleKeyboardContainerMouseDown(e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n }\n\n /**\n * Handles button hold\n */\n /* istanbul ignore next */\n handleButtonHold(button) {\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * @type {object} Timeout dictating the speed of key hold iterations\n */\n this.holdInteractionTimeout = setTimeout(() => {\n if (this.isMouseHold) {\n this.handleButtonClicked(button);\n this.handleButtonHold(button);\n } else {\n clearTimeout(this.holdInteractionTimeout);\n }\n }, 100);\n }\n\n /**\n * Send a command to all simple-keyboard instances (if you have several instances).\n */\n syncInstanceInputs() {\n this.dispatch(instance => {\n instance.replaceInput(this.input);\n instance.caretPosition = this.caretPosition;\n });\n }\n\n /**\n * Clear the keyboard’s input.\n * @param {string} [inputName] optional - the internal input to select\n */\n clearInput(inputName) {\n inputName = inputName || this.options.inputName;\n this.input[inputName] = \"\";\n\n /**\n * Reset caretPosition\n */\n this.caretPosition = 0;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Get the keyboard’s input (You can also get it from the onChange prop).\n * @param {string} [inputName] optional - the internal input to select\n */\n getInput(inputName) {\n inputName = inputName || this.options.inputName;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n return this.input[inputName];\n }\n\n /**\n * Set the keyboard’s input.\n * @param {string} input the input value\n * @param {string} inputName optional - the internal input to select\n */\n setInput(input, inputName) {\n inputName = inputName || this.options.inputName;\n this.input[inputName] = input;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Replace the input object (`keyboard.input`)\n * @param {object} inputObj The input object\n */\n replaceInput(inputObj) {\n this.input = inputObj;\n }\n\n /**\n * Set new option or modify existing ones after initialization.\n * @param {object} options The options to set\n */\n setOptions(options) {\n options = options || {};\n this.options = Object.assign(this.options, options);\n\n /**\n * Some option changes require adjustments before re-render\n */\n this.onSetOptions(options);\n\n /**\n * Rendering\n */\n this.render();\n }\n\n /**\n * Executing actions depending on changed options\n * @param {object} options The options to set\n */\n onSetOptions(options) {\n if (options.inputName) {\n /**\n * inputName changed. This requires a caretPosition reset\n */\n if (this.options.debug) {\n console.log(\"inputName changed. caretPosition reset.\");\n }\n\n this.caretPosition = null;\n }\n }\n\n /**\n * Remove all keyboard rows and reset keyboard values.\n * Used interally between re-renders.\n */\n clear() {\n this.keyboardDOM.innerHTML = \"\";\n this.keyboardDOM.className = this.keyboardDOMClass;\n this.buttonElements = {};\n }\n\n /**\n * Send a command to all simple-keyboard instances at once (if you have multiple instances).\n * @param {function(instance: object, key: string)} callback Function to run on every instance\n */\n dispatch(callback) {\n if (!window[\"SimpleKeyboardInstances\"]) {\n console.warn(\n `SimpleKeyboardInstances is not defined. Dispatch cannot be called.`\n );\n throw new Error(\"INSTANCES_VAR_ERROR\");\n }\n\n return Object.keys(window[\"SimpleKeyboardInstances\"]).forEach(key => {\n callback(window[\"SimpleKeyboardInstances\"][key], key);\n });\n }\n\n /**\n * Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n addButtonTheme(buttons, className) {\n if (!className || !buttons) return false;\n\n buttons.split(\" \").forEach(button => {\n className.split(\" \").forEach(classNameItem => {\n if (!this.options.buttonTheme) this.options.buttonTheme = [];\n\n let classNameFound = false;\n\n /**\n * If class is already defined, we add button to class definition\n */\n this.options.buttonTheme.map(buttonTheme => {\n if (buttonTheme.class.split(\" \").includes(classNameItem)) {\n classNameFound = true;\n\n let buttonThemeArray = buttonTheme.buttons.split(\" \");\n if (!buttonThemeArray.includes(button)) {\n classNameFound = true;\n buttonThemeArray.push(button);\n buttonTheme.buttons = buttonThemeArray.join(\" \");\n }\n }\n return buttonTheme;\n });\n\n /**\n * If class is not defined, we create a new entry\n */\n if (!classNameFound) {\n this.options.buttonTheme.push({\n class: classNameItem,\n buttons: buttons\n });\n }\n });\n });\n\n this.render();\n }\n\n /**\n * Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n removeButtonTheme(buttons, className) {\n /**\n * When called with empty parameters, remove all button themes\n */\n if (!buttons && !className) {\n this.options.buttonTheme = [];\n this.render();\n return false;\n }\n\n /**\n * If buttons are passed and buttonTheme has items\n */\n if (\n buttons &&\n Array.isArray(this.options.buttonTheme) &&\n this.options.buttonTheme.length\n ) {\n let buttonArray = buttons.split(\" \");\n buttonArray.forEach((button, key) => {\n this.options.buttonTheme.map((buttonTheme, index) => {\n /**\n * If className is set, we affect the buttons only for that class\n * Otherwise, we afect all classes\n */\n if (\n (className && className.includes(buttonTheme.class)) ||\n !className\n ) {\n let filteredButtonArray = buttonTheme.buttons\n .split(\" \")\n .filter(item => item !== button);\n\n /**\n * If buttons left, return them, otherwise, remove button Theme\n */\n if (filteredButtonArray.length) {\n buttonTheme.buttons = filteredButtonArray.join(\" \");\n } else {\n this.options.buttonTheme.splice(index, 1);\n buttonTheme = null;\n }\n }\n\n return buttonTheme;\n });\n });\n\n this.render();\n }\n }\n\n /**\n * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.\n * @param {string} button The button layout name to select\n */\n getButtonElement(button) {\n let output;\n\n let buttonArr = this.buttonElements[button];\n if (buttonArr) {\n if (buttonArr.length > 1) {\n output = buttonArr;\n } else {\n output = buttonArr[0];\n }\n }\n\n return output;\n }\n\n /**\n * This handles the \"inputPattern\" option\n * by checking if the provided inputPattern passes\n */\n inputPatternIsValid(inputVal) {\n let inputPatternRaw = this.options.inputPattern;\n let inputPattern;\n\n /**\n * Check if input pattern is global or targeted to individual inputs\n */\n if (inputPatternRaw instanceof RegExp) {\n inputPattern = inputPatternRaw;\n } else {\n inputPattern = inputPatternRaw[this.options.inputName];\n }\n\n if (inputPattern && inputVal) {\n let didInputMatch = inputPattern.test(inputVal);\n\n if (this.options.debug) {\n console.log(\n `inputPattern (\"${inputPattern}\"): ${\n didInputMatch ? \"passed\" : \"did not pass!\"\n }`\n );\n }\n\n return didInputMatch;\n } else {\n /**\n * inputPattern doesn't seem to be set for the current input, or input is empty. Pass.\n */\n return true;\n }\n }\n\n /**\n * Handles simple-keyboard event listeners\n */\n setEventListeners() {\n /**\n * Only first instance should set the event listeners\n */\n if (this.isFirstKeyboardInstance || !this.allKeyboardInstances) {\n if (this.options.debug) {\n console.log(`Caret handling started (${this.keyboardDOMClass})`);\n }\n\n /**\n * Event Listeners\n */\n document.addEventListener(\"keyup\", this.handleKeyUp);\n document.addEventListener(\"keydown\", this.handleKeyDown);\n document.addEventListener(\"mouseup\", this.handleMouseUp);\n document.addEventListener(\"touchend\", this.handleTouchEnd);\n }\n }\n\n /**\n * Event Handler: KeyUp\n */\n handleKeyUp(event) {\n this.caretEventHandler(event);\n\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyUp(event);\n }\n }\n\n /**\n * Event Handler: KeyDown\n */\n handleKeyDown(event) {\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyDown(event);\n }\n }\n\n /**\n * Event Handler: MouseUp\n */\n handleMouseUp(event) {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: TouchEnd\n */\n handleTouchEnd(event) {\n this.caretEventHandler(event);\n }\n\n /**\n * Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered\n */\n caretEventHandler(event) {\n let targetTagName;\n if (event.target.tagName) {\n targetTagName = event.target.tagName.toLowerCase();\n }\n\n this.dispatch(instance => {\n if (instance.isMouseHold) {\n instance.isMouseHold = false;\n }\n\n if (\n (targetTagName === \"textarea\" || targetTagName === \"input\") &&\n !instance.options.disableCaretPositioning\n ) {\n /**\n * Tracks current cursor position\n * As keys are pressed, text will be added/removed at that position within the input.\n */\n instance.caretPosition = event.target.selectionStart;\n\n if (instance.options.debug) {\n console.log(\n \"Caret at: \",\n event.target.selectionStart,\n event.target.tagName.toLowerCase(),\n `(${instance.keyboardDOMClass})`\n );\n }\n } else if (instance.options.disableCaretPositioning) {\n /**\n * If we toggled off disableCaretPositioning, we must ensure caretPosition doesn't persist once reactivated.\n */\n instance.caretPosition = null;\n }\n });\n }\n\n /**\n * Destroy keyboard listeners and DOM elements\n */\n destroy() {\n /**\n * Remove listeners\n */\n document.removeEventListener(\"keyup\", this.handleKeyUp);\n document.removeEventListener(\"keydown\", this.handleKeyDown);\n document.removeEventListener(\"mouseup\", this.handleMouseUp);\n document.removeEventListener(\"touchend\", this.handleTouchEnd);\n\n /**\n * Clear DOM\n */\n this.clear();\n }\n\n /**\n * Process buttonTheme option\n */\n getButtonThemeClasses(button) {\n let buttonTheme = this.options.buttonTheme;\n let buttonClasses = [];\n\n if (Array.isArray(buttonTheme)) {\n buttonTheme.forEach(themeObj => {\n if (\n themeObj.class &&\n typeof themeObj.class === \"string\" &&\n (themeObj.buttons && typeof themeObj.buttons === \"string\")\n ) {\n let themeObjClasses = themeObj.class.split(\" \");\n let themeObjButtons = themeObj.buttons.split(\" \");\n\n if (themeObjButtons.includes(button)) {\n buttonClasses = [...buttonClasses, ...themeObjClasses];\n }\n } else {\n console.warn(\n `Incorrect \"buttonTheme\". Please check the documentation.`,\n themeObj\n );\n }\n });\n }\n\n return buttonClasses;\n }\n\n /**\n * Process buttonAttributes option\n */\n setDOMButtonAttributes(button, callback) {\n let buttonAttributes = this.options.buttonAttributes;\n\n if (Array.isArray(buttonAttributes)) {\n buttonAttributes.forEach(attrObj => {\n if (\n attrObj.attribute &&\n typeof attrObj.attribute === \"string\" &&\n (attrObj.value && typeof attrObj.value === \"string\") &&\n (attrObj.buttons && typeof attrObj.buttons === \"string\")\n ) {\n let attrObjButtons = attrObj.buttons.split(\" \");\n\n if (attrObjButtons.includes(button)) {\n callback(attrObj.attribute, attrObj.value);\n }\n } else {\n console.warn(\n `Incorrect \"buttonAttributes\". Please check the documentation.`,\n attrObj\n );\n }\n });\n }\n }\n\n onTouchDeviceDetected() {\n /**\n * Processing autoTouchEvents\n */\n this.processAutoTouchEvents();\n\n /**\n * Disabling contextual window on touch devices\n */\n this.disableContextualWindow();\n }\n\n /**\n * Disabling contextual window for hg-button\n */\n /* istanbul ignore next */\n disableContextualWindow() {\n window.oncontextmenu = event => {\n if (event.target.classList.contains(\"hg-button\")) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n };\n }\n\n /**\n * Process autoTouchEvents option\n */\n processAutoTouchEvents() {\n if (this.options.autoUseTouchEvents) {\n this.options.useTouchEvents = true;\n\n if (this.options.debug) {\n console.log(\n `autoUseTouchEvents: Touch device detected, useTouchEvents enabled.`\n );\n }\n }\n }\n\n /**\n * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n */\n onInit() {\n if (this.options.debug) {\n console.log(`${this.keyboardDOMClass} Initialized`);\n }\n\n /**\n * setEventListeners\n */\n this.setEventListeners();\n\n if (typeof this.options.onInit === \"function\") this.options.onInit();\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeFirstRender() {\n /**\n * Performing actions when touch device detected\n */\n if (this.utilities.isTouchDevice()) {\n this.onTouchDeviceDetected();\n }\n\n if (typeof this.options.beforeFirstRender === \"function\")\n this.options.beforeFirstRender();\n\n /**\n * Notify about PointerEvents usage\n */\n if (\n this.isFirstKeyboardInstance &&\n this.utilities.pointerEventsSupported() &&\n !this.options.useTouchEvents &&\n !this.options.useMouseEvents\n ) {\n if (this.options.debug) {\n console.log(\"Using PointerEvents as it is supported by this browser\");\n }\n }\n\n /**\n * Notify about touch events usage\n */\n if (this.options.useTouchEvents) {\n if (this.options.debug) {\n console.log(\n \"useTouchEvents has been enabled. Only touch events will be used.\"\n );\n }\n }\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeRender() {\n if (typeof this.options.beforeRender === \"function\")\n this.options.beforeRender();\n }\n\n /**\n * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n */\n onRender() {\n if (typeof this.options.onRender === \"function\") this.options.onRender();\n }\n\n /**\n * Executes the callback function once all modules have been loaded\n */\n onModulesLoaded() {\n if (typeof this.options.onModulesLoaded === \"function\")\n this.options.onModulesLoaded();\n }\n\n /**\n * Register module\n */\n registerModule = (name, initCallback) => {\n if (!this.modules[name]) this.modules[name] = {};\n\n initCallback(this.modules[name]);\n };\n\n /**\n * Load modules\n */\n loadModules() {\n if (Array.isArray(this.options.modules)) {\n this.options.modules.forEach(Module => {\n let module = new Module();\n\n /* istanbul ignore next */\n if (module.constructor.name && module.constructor.name !== \"Function\") {\n let classStr = `module-${this.utilities.camelCase(\n module.constructor.name\n )}`;\n this.keyboardPluginClasses =\n this.keyboardPluginClasses + ` ${classStr}`;\n }\n\n module.init(this);\n });\n\n this.keyboardPluginClasses =\n this.keyboardPluginClasses + \" modules-loaded\";\n\n this.render();\n this.onModulesLoaded();\n }\n }\n\n /**\n * Get module prop\n */\n getModuleProp(name, prop) {\n if (!this.modules[name]) return false;\n\n return this.modules[name][prop];\n }\n\n /**\n * getModulesList\n */\n getModulesList() {\n return Object.keys(this.modules);\n }\n\n /**\n * Parse Row DOM containers\n */\n parseRowDOMContainers(\n rowDOM,\n rowIndex,\n containerStartIndexes,\n containerEndIndexes\n ) {\n let rowDOMArray = Array.from(rowDOM.children);\n let removedElements = 0;\n\n if (rowDOMArray.length) {\n containerStartIndexes.forEach((startIndex, arrIndex) => {\n let endIndex = containerEndIndexes[arrIndex];\n\n /**\n * If there exists a respective end index\n * if end index comes after start index\n */\n if (!endIndex || !(endIndex > startIndex)) {\n return false;\n }\n\n /**\n * Updated startIndex, endIndex\n * This is since the removal of buttons to place a single button container\n * results in a modified array size\n */\n let updated_startIndex = startIndex - removedElements;\n let updated_endIndex = endIndex - removedElements;\n\n /**\n * Create button container\n */\n let containerDOM = document.createElement(\"div\");\n containerDOM.className += \"hg-button-container\";\n let containerUID = `${this.options.layoutName}-r${rowIndex}c${arrIndex}`;\n containerDOM.setAttribute(\"data-skUID\", containerUID);\n\n /**\n * Taking elements due to be inserted into container\n */\n let containedElements = rowDOMArray.splice(\n updated_startIndex,\n updated_endIndex - updated_startIndex + 1\n );\n removedElements = updated_endIndex - updated_startIndex;\n\n /**\n * Inserting elements to container\n */\n containedElements.forEach(element => containerDOM.appendChild(element));\n\n /**\n * Adding container at correct position within rowDOMArray\n */\n rowDOMArray.splice(updated_startIndex, 0, containerDOM);\n\n /**\n * Clearing old rowDOM children structure\n */\n rowDOM.innerHTML = \"\";\n\n /**\n * Appending rowDOM new children list\n */\n rowDOMArray.forEach(element => rowDOM.appendChild(element));\n\n if (this.options.debug) {\n console.log(\n \"rowDOMContainer\",\n containedElements,\n updated_startIndex,\n updated_endIndex,\n removedElements + 1\n );\n }\n });\n }\n\n return rowDOM;\n }\n\n /**\n * Renders rows and buttons as per options\n */\n render() {\n /**\n * Clear keyboard\n */\n this.clear();\n\n /**\n * Calling beforeFirstRender\n */\n if (!this.initialized) {\n this.beforeFirstRender();\n }\n\n /**\n * Calling beforeRender\n */\n this.beforeRender();\n\n let layoutClass = `hg-layout-${this.options.layoutName}`;\n let layout = this.options.layout || KeyboardLayout.getDefaultLayout();\n let useTouchEvents = this.options.useTouchEvents || false;\n let useTouchEventsClass = useTouchEvents ? \"hg-touch-events\" : \"\";\n let useMouseEvents = this.options.useMouseEvents || false;\n let disableRowButtonContainers = this.options.disableRowButtonContainers;\n\n /**\n * Adding themeClass, layoutClass to keyboardDOM\n */\n this.keyboardDOM.className += ` ${this.options.theme} ${layoutClass} ${this.keyboardPluginClasses} ${useTouchEventsClass}`;\n\n /**\n * Iterating through each row\n */\n layout[this.options.layoutName].forEach((row, rIndex) => {\n let rowArray = row.split(\" \");\n\n /**\n * Creating empty row\n */\n let rowDOM = document.createElement(\"div\");\n rowDOM.className += \"hg-row\";\n\n /**\n * Tracking container indicators in rows\n */\n let containerStartIndexes = [];\n let containerEndIndexes = [];\n\n /**\n * Iterating through each button in row\n */\n rowArray.forEach((button, bIndex) => {\n /**\n * Check if button has a container indicator\n */\n let buttonHasContainerStart =\n !disableRowButtonContainers &&\n button.includes(\"[\") &&\n button.length > 1;\n let buttonHasContainerEnd =\n !disableRowButtonContainers &&\n button.includes(\"]\") &&\n button.length > 1;\n\n /**\n * Save container start index, if applicable\n */\n if (buttonHasContainerStart) {\n containerStartIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\[/g, \"\");\n }\n\n if (buttonHasContainerEnd) {\n containerEndIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\]/g, \"\");\n }\n\n /**\n * Processing button options\n */\n let fctBtnClass = this.utilities.getButtonClass(button);\n let buttonDisplayName = this.utilities.getButtonDisplayName(\n button,\n this.options.display,\n this.options.mergeDisplay\n );\n\n /**\n * Creating button\n */\n let buttonType = this.options.useButtonTag ? \"button\" : \"div\";\n let buttonDOM = document.createElement(buttonType);\n buttonDOM.className += `hg-button ${fctBtnClass}`;\n\n /**\n * Adding buttonTheme\n */\n buttonDOM.classList.add(...this.getButtonThemeClasses(button));\n\n /**\n * Adding buttonAttributes\n */\n this.setDOMButtonAttributes(button, (attribute, value) => {\n buttonDOM.setAttribute(attribute, value);\n });\n\n /**\n * Handle button click event\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n /**\n * Handle PointerEvents\n */\n buttonDOM.onpointerdown = e => {\n this.handleButtonClicked(button);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onpointerup = () => this.handleButtonMouseUp(button);\n buttonDOM.onpointercancel = () => this.handleButtonMouseUp(button);\n } else {\n /**\n * Fallback for browsers not supporting PointerEvents\n */\n if (useTouchEvents) {\n /**\n * Handle touch events\n */\n buttonDOM.ontouchstart = e => {\n this.handleButtonClicked(button);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.ontouchend = () => this.handleButtonMouseUp(button);\n buttonDOM.ontouchcancel = () => this.handleButtonMouseUp(button);\n } else {\n /**\n * Handle mouse events\n */\n buttonDOM.onclick = () => {\n this.isMouseHold = false;\n this.handleButtonClicked(button);\n };\n buttonDOM.onmousedown = e => this.handleButtonMouseDown(button, e);\n buttonDOM.onmouseup = () => this.handleButtonMouseUp(button);\n }\n }\n\n /**\n * Adding identifier\n */\n buttonDOM.setAttribute(\"data-skBtn\", button);\n\n /**\n * Adding unique id\n * Since there's no limit on spawning same buttons, the unique id ensures you can style every button\n */\n let buttonUID = `${this.options.layoutName}-r${rIndex}b${bIndex}`;\n buttonDOM.setAttribute(\"data-skBtnUID\", buttonUID);\n\n /**\n * Adding button label to button\n */\n let buttonSpanDOM = document.createElement(\"span\");\n buttonSpanDOM.innerHTML = buttonDisplayName;\n buttonDOM.appendChild(buttonSpanDOM);\n\n /**\n * Adding to buttonElements\n */\n if (!this.buttonElements[button]) this.buttonElements[button] = [];\n\n this.buttonElements[button].push(buttonDOM);\n\n /**\n * Appending button to row\n */\n rowDOM.appendChild(buttonDOM);\n });\n\n /**\n * Parse containers in row\n */\n rowDOM = this.parseRowDOMContainers(\n rowDOM,\n rIndex,\n containerStartIndexes,\n containerEndIndexes\n );\n\n /**\n * Appending row to keyboard\n */\n this.keyboardDOM.appendChild(rowDOM);\n });\n\n /**\n * Calling onRender\n */\n this.onRender();\n\n if (!this.initialized) {\n /**\n * Ensures that onInit and beforeFirstRender are only called once per instantiation\n */\n this.initialized = true;\n\n /**\n * Handling parent events\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n document.onpointerup = () => this.handleButtonMouseUp();\n this.keyboardDOM.onpointerdown = e =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (useTouchEvents) {\n /**\n * Handling ontouchend, ontouchcancel\n */\n document.ontouchend = () => this.handleButtonMouseUp();\n document.ontouchcancel = () => this.handleButtonMouseUp();\n\n this.keyboardDOM.ontouchstart = e =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (!useTouchEvents) {\n /**\n * Handling mouseup\n */\n document.onmouseup = () => this.handleButtonMouseUp();\n this.keyboardDOM.onmousedown = e =>\n this.handleKeyboardContainerMouseDown(e);\n }\n\n /**\n * Calling onInit\n */\n this.onInit();\n }\n }\n}\n\nexport default SimpleKeyboard;\n","import SimpleKeyboard from \"./components/Keyboard\";\nexport default SimpleKeyboard;\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["../../webpack/universalModuleDefinition","../../webpack/bootstrap","services/Utilities.js","services/PhysicalKeyboard.js","services/KeyboardLayout.js","components/Keyboard.js","index.js"],"names":["root","factory","exports","module","define","amd","window","installedModules","__webpack_require__","moduleId","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","Utilities","getOptions","getCaretPosition","dispatch","this","bindMethods","myClass","instance","getOwnPropertyNames","myMethod","button","buttonTypeClass","includes","buttonWithoutBraces","replace","buttonNormalized","display","mergeDisplay","assign","getDefaultDiplay","input","caretPos","moveCaret","options","output","length","removeAt","addStringAt","tabCharOnTab","newLineOnEnter","Number","isInteger","minus","newCaretPos","updateCaretPosAction","caretPosition","debug","console","log","keyboardDOMClass","source","string","position","slice","join","isMaxLengthReached","updateCaretPos","emojiMatchedReg","substring","match","substr","inputObj","updatedInput","maxLength","currentInput","inputName","condition","maxLengthReached","Boolean","navigator","maxTouchPoints","PointerEvent","toLowerCase","trim","split","reduce","word","toUpperCase","PhysicalKeyboard","event","buttonPressed","getSimpleKeyboardLayoutKey","buttonDOM","getButtonElement","style","backgroundColor","physicalKeyboardHighlightBgColor","color","physicalKeyboardHighlightTextColor","removeAttribute","code","KeyboardLayout","default","shift","SimpleKeyboard","initCallback","keyboardDOMQuery","utilities","keyboardDOM","document","querySelector","layoutName","theme","preventMouseDownDefault","keyboardPluginClasses","buttonElements","camelCase","allKeyboardInstances","currentInstanceName","keyboardInstanceNames","keys","isFirstKeyboardInstance","physicalKeyboard","warn","Error","render","loadModules","onKeyPress","getUpdatedInput","inputPattern","inputPatternIsValid","handleMaxLength","syncInstanceInputs","onChange","onChangeAll","e","preventDefault","stopMouseDownPropagation","stopPropagation","isMouseHold","holdInteractionTimeout","clearTimeout","holdTimeout","disableButtonHold","setTimeout","handleButtonHold","onKeyReleased","handleButtonClicked","replaceInput","onSetOptions","innerHTML","className","callback","forEach","buttons","classNameItem","buttonTheme","classNameFound","map","class","buttonThemeArray","push","Array","isArray","index","filteredButtonArray","filter","item","splice","buttonArr","inputVal","inputPatternRaw","RegExp","didInputMatch","test","addEventListener","handleKeyUp","handleKeyDown","handleMouseUp","handleTouchEnd","caretEventHandler","physicalKeyboardHighlight","handleHighlightKeyUp","handleHighlightKeyDown","targetTagName","target","tagName","disableCaretPositioning","selectionStart","removeEventListener","clear","buttonClasses","themeObj","themeObjClasses","buttonAttributes","attrObj","attribute","processAutoTouchEvents","disableContextualWindow","oncontextmenu","classList","contains","autoUseTouchEvents","useTouchEvents","setEventListeners","onInit","isTouchDevice","onTouchDeviceDetected","beforeFirstRender","pointerEventsSupported","useMouseEvents","beforeRender","onRender","onModulesLoaded","Module","constructor","classStr","init","prop","rowDOM","rowIndex","containerStartIndexes","containerEndIndexes","rowDOMArray","from","children","removedElements","startIndex","arrIndex","endIndex","updated_startIndex","updated_endIndex","containerDOM","createElement","containerUID","setAttribute","containedElements","element","appendChild","initialized","layoutClass","layout","getDefaultLayout","useTouchEventsClass","disableRowButtonContainers","row","rIndex","rowArray","bIndex","buttonHasContainerStart","buttonHasContainerEnd","fctBtnClass","getButtonClass","buttonDisplayName","getButtonDisplayName","buttonType","useButtonTag","add","getButtonThemeClasses","setDOMButtonAttributes","ontouchstart","handleButtonMouseDown","ontouchend","handleButtonMouseUp","ontouchcancel","onclick","onmousedown","onmouseup","onpointerdown","onpointerup","onpointercancel","buttonUID","buttonSpanDOM","parseRowDOMContainers","handleKeyboardContainerMouseDown"],"mappings":";;;;;;;;;;;CAAA,SAA2CA,EAAMC,GAC1B,kBAAZC,SAA0C,kBAAXC,OACxCA,OAAOD,QAAUD,IACQ,oBAAXG,QAAyBA,OAAOC,IAC9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EAAS,UAAM,EAAKpO,QAAQoE,WAAnB,aAAkCuI,EAAlC,YAA4CE,GACzD5J,EAAU+I,aAAa,gBAAiBoC,GAKxC,IAAIC,EAAgBnK,SAAS4H,cAAc,QAC3CuC,EAAc1H,UAAYuG,EAC1BjK,EAAUkJ,YAAYkC,GAKjB,EAAK7J,eAAerF,KAAS,EAAKqF,eAAerF,GAAU,IAEhE,EAAKqF,eAAerF,GAAQmI,KAAKrE,GAKjC+H,EAAOmB,YAAYlJ,MAMrB+H,EAAS,EAAKsD,sBACZtD,EACA2B,EACAzB,EACAC,GAMF,EAAKlH,YAAYkI,YAAYnB,MAM/BnM,KAAK4L,WAEA5L,KAAKuN,cAIRvN,KAAKuN,aAAc,GAOjBvN,KAAKmF,UAAUsG,0BACdN,GACAO,EAKQP,GAIT9F,SAASyJ,WAAa,kBAAM,EAAKC,uBACjC1J,SAAS2J,cAAgB,kBAAM,EAAKD,uBAEpC/O,KAAKoF,YAAYwJ,aAAe,SAAA7H,GAAC,OAC/B,EAAK2I,iCAAiC3I,KAC9BoE,IAIV9F,SAAS8J,UAAY,kBAAM,EAAKJ,uBAChC/O,KAAKoF,YAAY8J,YAAc,SAAAnI,GAAC,OAC9B,EAAK2I,iCAAiC3I,MAlBxC1B,SAASgK,YAAc,kBAAM,EAAKN,uBAClC/O,KAAKoF,YAAYgK,cAAgB,SAAArI,GAAC,OAChC,EAAK2I,iCAAiC3I,KAsB1C/G,KAAKqL,e,6FClyCIrG","file":"index.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"SimpleKeyboard\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"SimpleKeyboard\"] = factory();\n\telse\n\t\troot[\"SimpleKeyboard\"] = factory();\n})(window, function() {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","/**\n * Utility Service\n */\nclass Utilities {\n /**\n * Creates an instance of the Utility service\n */\n constructor({ getOptions, getCaretPosition, dispatch }) {\n this.getOptions = getOptions;\n this.getCaretPosition = getCaretPosition;\n this.dispatch = dispatch;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(Utilities, this);\n }\n\n /**\n * Adds default classes to a given button\n *\n * @param {string} button The button's layout name\n * @return {string} The classes to be added to the button\n */\n getButtonClass(button) {\n let buttonTypeClass =\n button.includes(\"{\") && button.includes(\"}\") && button !== \"{//}\"\n ? \"functionBtn\"\n : \"standardBtn\";\n let buttonWithoutBraces = button.replace(\"{\", \"\").replace(\"}\", \"\");\n let buttonNormalized = \"\";\n\n if (buttonTypeClass !== \"standardBtn\")\n buttonNormalized = ` hg-button-${buttonWithoutBraces}`;\n\n return `hg-${buttonTypeClass}${buttonNormalized}`;\n }\n\n /**\n * Default button display labels\n */\n getDefaultDiplay() {\n return {\n \"{bksp}\": \"backspace\",\n \"{backspace}\": \"backspace\",\n \"{enter}\": \"< enter\",\n \"{shift}\": \"shift\",\n \"{shiftleft}\": \"shift\",\n \"{shiftright}\": \"shift\",\n \"{alt}\": \"alt\",\n \"{s}\": \"shift\",\n \"{tab}\": \"tab\",\n \"{lock}\": \"caps\",\n \"{capslock}\": \"caps\",\n \"{accept}\": \"Submit\",\n \"{space}\": \" \",\n \"{//}\": \" \",\n \"{esc}\": \"esc\",\n \"{escape}\": \"esc\",\n \"{f1}\": \"f1\",\n \"{f2}\": \"f2\",\n \"{f3}\": \"f3\",\n \"{f4}\": \"f4\",\n \"{f5}\": \"f5\",\n \"{f6}\": \"f6\",\n \"{f7}\": \"f7\",\n \"{f8}\": \"f8\",\n \"{f9}\": \"f9\",\n \"{f10}\": \"f10\",\n \"{f11}\": \"f11\",\n \"{f12}\": \"f12\",\n \"{numpaddivide}\": \"/\",\n \"{numlock}\": \"lock\",\n \"{arrowup}\": \"↑\",\n \"{arrowleft}\": \"←\",\n \"{arrowdown}\": \"↓\",\n \"{arrowright}\": \"→\",\n \"{prtscr}\": \"print\",\n \"{scrolllock}\": \"scroll\",\n \"{pause}\": \"pause\",\n \"{insert}\": \"ins\",\n \"{home}\": \"home\",\n \"{pageup}\": \"up\",\n \"{delete}\": \"del\",\n \"{end}\": \"end\",\n \"{pagedown}\": \"down\",\n \"{numpadmultiply}\": \"*\",\n \"{numpadsubtract}\": \"-\",\n \"{numpadadd}\": \"+\",\n \"{numpadenter}\": \"enter\",\n \"{period}\": \".\",\n \"{numpaddecimal}\": \".\",\n \"{numpad0}\": \"0\",\n \"{numpad1}\": \"1\",\n \"{numpad2}\": \"2\",\n \"{numpad3}\": \"3\",\n \"{numpad4}\": \"4\",\n \"{numpad5}\": \"5\",\n \"{numpad6}\": \"6\",\n \"{numpad7}\": \"7\",\n \"{numpad8}\": \"8\",\n \"{numpad9}\": \"9\"\n };\n }\n /**\n * Returns the display (label) name for a given button\n *\n * @param {string} button The button's layout name\n * @param {object} display The provided display option\n * @param {boolean} mergeDisplay Whether the provided param value should be merged with the default one.\n */\n getButtonDisplayName(button, display, mergeDisplay) {\n if (mergeDisplay) {\n display = Object.assign({}, this.getDefaultDiplay(), display);\n } else {\n display = display || this.getDefaultDiplay();\n }\n\n return display[button] || button;\n }\n\n /**\n * Returns the updated input resulting from clicking a given button\n *\n * @param {string} button The button's layout name\n * @param {string} input The input string\n * @param {number} caretPos The cursor's current position\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n getUpdatedInput(button, input, caretPos, moveCaret) {\n let options = this.getOptions();\n let output = input;\n\n if (\n (button === \"{bksp}\" || button === \"{backspace}\") &&\n output.length > 0\n ) {\n output = this.removeAt(output, caretPos, moveCaret);\n } else if (button === \"{space}\")\n output = this.addStringAt(output, \" \", caretPos, moveCaret);\n else if (\n button === \"{tab}\" &&\n !(\n typeof options.tabCharOnTab === \"boolean\" &&\n options.tabCharOnTab === false\n )\n ) {\n output = this.addStringAt(output, \"\\t\", caretPos, moveCaret);\n } else if (\n (button === \"{enter}\" || button === \"{numpadenter}\") &&\n options.newLineOnEnter\n )\n output = this.addStringAt(output, \"\\n\", caretPos, moveCaret);\n else if (\n button.includes(\"numpad\") &&\n Number.isInteger(Number(button[button.length - 2]))\n ) {\n output = this.addStringAt(\n output,\n button[button.length - 2],\n caretPos,\n moveCaret\n );\n } else if (button === \"{numpaddivide}\")\n output = this.addStringAt(output, \"/\", caretPos, moveCaret);\n else if (button === \"{numpadmultiply}\")\n output = this.addStringAt(output, \"*\", caretPos, moveCaret);\n else if (button === \"{numpadsubtract}\")\n output = this.addStringAt(output, \"-\", caretPos, moveCaret);\n else if (button === \"{numpadadd}\")\n output = this.addStringAt(output, \"+\", caretPos, moveCaret);\n else if (button === \"{numpaddecimal}\")\n output = this.addStringAt(output, \".\", caretPos, moveCaret);\n else if (button === \"{\" || button === \"}\")\n output = this.addStringAt(output, button, caretPos, moveCaret);\n else if (!button.includes(\"{\") && !button.includes(\"}\"))\n output = this.addStringAt(output, button, caretPos, moveCaret);\n\n return output;\n }\n\n /**\n * Moves the cursor position by a given amount\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPos(length, minus) {\n let newCaretPos = this.updateCaretPosAction(length, minus);\n\n this.dispatch(instance => {\n instance.caretPosition = newCaretPos;\n });\n }\n\n /**\n * Action method of updateCaretPos\n *\n * @param {number} length Represents by how many characters the input should be moved\n * @param {boolean} minus Whether the cursor should be moved to the left or not.\n */\n updateCaretPosAction(length, minus) {\n let options = this.getOptions();\n let caretPosition = this.getCaretPosition();\n\n if (minus) {\n if (caretPosition > 0) caretPosition = caretPosition - length;\n } else {\n caretPosition = caretPosition + length;\n }\n\n if (options.debug) {\n console.log(\"Caret at:\", caretPosition, `(${this.keyboardDOMClass})`);\n }\n\n return caretPosition;\n }\n\n /**\n * Adds a string to the input at a given position\n *\n * @param {string} source The source input\n * @param {string} string The string to add\n * @param {number} position The (cursor) position where the string should be added\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n addStringAt(source, string, position, moveCaret) {\n let output;\n\n if (!position && position !== 0) {\n output = source + string;\n } else {\n output = [source.slice(0, position), string, source.slice(position)].join(\n \"\"\n );\n\n /**\n * Avoid caret position change when maxLength is set\n */\n if (!this.isMaxLengthReached()) {\n if (moveCaret) this.updateCaretPos(string.length);\n }\n }\n\n return output;\n }\n\n /**\n * Removes an amount of characters at a given position\n *\n * @param {string} source The source input\n * @param {number} position The (cursor) position from where the characters should be removed\n * @param {boolean} moveCaret Whether to update simple-keyboard's cursor\n */\n removeAt(source, position, moveCaret) {\n let caretPosition = this.getCaretPosition();\n\n if (caretPosition === 0) {\n return source;\n }\n\n let output;\n let prevTwoChars;\n let emojiMatched;\n let emojiMatchedReg = /([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])/g;\n\n /**\n * Emojis are made out of two characters, so we must take a custom approach to trim them.\n * For more info: https://mathiasbynens.be/notes/javascript-unicode\n */\n if (position && position >= 0) {\n prevTwoChars = source.substring(position - 2, position);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.substr(0, position - 2) + source.substr(position);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.substr(0, position - 1) + source.substr(position);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n } else {\n prevTwoChars = source.slice(-2);\n emojiMatched = prevTwoChars.match(emojiMatchedReg);\n\n if (emojiMatched) {\n output = source.slice(0, -2);\n if (moveCaret) this.updateCaretPos(2, true);\n } else {\n output = source.slice(0, -1);\n if (moveCaret) this.updateCaretPos(1, true);\n }\n }\n\n return output;\n }\n /**\n * Determines whether the maxLength has been reached. This function is called when the maxLength option it set.\n *\n * @param {object} inputObj\n * @param {string} updatedInput\n */\n handleMaxLength(inputObj, updatedInput) {\n let options = this.getOptions();\n let maxLength = options.maxLength;\n let currentInput = inputObj[options.inputName];\n let condition = updatedInput.length - 1 >= maxLength;\n\n if (\n /**\n * If pressing this button won't add more characters\n * We exit out of this limiter function\n */\n updatedInput.length <= currentInput.length\n ) {\n return false;\n }\n\n if (Number.isInteger(maxLength)) {\n if (options.debug) {\n console.log(\"maxLength (num) reached:\", condition);\n }\n\n if (condition) {\n /**\n * @type {boolean} Boolean value that shows whether maxLength has been reached\n */\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n\n if (typeof maxLength === \"object\") {\n let condition = currentInput.length === maxLength[options.inputName];\n\n if (options.debug) {\n console.log(\"maxLength (obj) reached:\", condition);\n }\n\n if (condition) {\n this.maxLengthReached = true;\n return true;\n } else {\n this.maxLengthReached = false;\n return false;\n }\n }\n }\n\n /**\n * Gets the current value of maxLengthReached\n */\n isMaxLengthReached() {\n return Boolean(this.maxLengthReached);\n }\n\n /**\n * Determines whether a touch device is being used\n */\n isTouchDevice() {\n return \"ontouchstart\" in window || navigator.maxTouchPoints;\n }\n\n /**\n * Determines whether pointer events are supported\n */\n pointerEventsSupported() {\n return window.PointerEvent;\n }\n\n /**\n * Bind all methods in a given class\n */\n\n static bindMethods(myClass, instance) {\n // eslint-disable-next-line no-unused-vars\n for (let myMethod of Object.getOwnPropertyNames(myClass.prototype)) {\n let excludeMethod =\n myMethod === \"constructor\" || myMethod === \"bindMethods\";\n if (!excludeMethod) {\n instance[myMethod] = instance[myMethod].bind(instance);\n }\n }\n }\n\n /**\n * Transforms an arbitrary string to camelCase\n *\n * @param {string} string The string to transform.\n */\n camelCase(string) {\n if (!string) return false;\n\n return string\n .toLowerCase()\n .trim()\n .split(/[.\\-_\\s]/g)\n .reduce((string, word) =>\n word.length ? string + word[0].toUpperCase() + word.slice(1) : string\n );\n }\n}\n\nexport default Utilities;\n","import Utilities from \"../services/Utilities\";\n\n/**\n * Physical Keyboard Service\n */\nclass PhysicalKeyboard {\n /**\n * Creates an instance of the PhysicalKeyboard service\n */\n constructor({ dispatch, getOptions }) {\n /**\n * @type {object} A simple-keyboard instance\n */\n this.dispatch = dispatch;\n this.getOptions = getOptions;\n\n /**\n * Bindings\n */\n Utilities.bindMethods(PhysicalKeyboard, this);\n }\n\n handleHighlightKeyDown(event) {\n let options = this.getOptions();\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\n\n this.dispatch(instance => {\n let buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n if (buttonDOM) {\n buttonDOM.style.backgroundColor =\n options.physicalKeyboardHighlightBgColor || \"#9ab4d0\";\n buttonDOM.style.color =\n options.physicalKeyboardHighlightTextColor || \"white\";\n }\n });\n }\n\n handleHighlightKeyUp(event) {\n let buttonPressed = this.getSimpleKeyboardLayoutKey(event);\n\n this.dispatch(instance => {\n let buttonDOM =\n instance.getButtonElement(buttonPressed) ||\n instance.getButtonElement(`{${buttonPressed}}`);\n\n if (buttonDOM && buttonDOM.removeAttribute) {\n buttonDOM.removeAttribute(\"style\");\n }\n });\n }\n\n /**\n * Transforms a KeyboardEvent's \"key.code\" string into a simple-keyboard layout format\n * @param {object} event The KeyboardEvent\n */\n getSimpleKeyboardLayoutKey(event) {\n let output;\n\n if (\n event.code.includes(\"Numpad\") ||\n event.code.includes(\"Shift\") ||\n event.code.includes(\"Space\") ||\n event.code.includes(\"Backspace\") ||\n event.code.includes(\"Control\") ||\n event.code.includes(\"Alt\") ||\n event.code.includes(\"Meta\")\n ) {\n output = event.code;\n } else {\n output = event.key;\n }\n\n /**\n * If button is not uppercase, casting to lowercase\n */\n if (\n output !== output.toUpperCase() ||\n (event.code[0] === \"F\" &&\n Number.isInteger(Number(event.code[1])) &&\n event.code.length <= 3)\n ) {\n output = output.toLowerCase();\n }\n\n return output;\n }\n}\n\nexport default PhysicalKeyboard;\n","/**\n * Keyboard Layout Service\n */\nclass KeyboardLayout {\n /**\n * Get default simple-keyboard layout\n * @return {object} The default layout (US-QWERTY)\n */\n static getDefaultLayout() {\n return {\n default: [\n \"` 1 2 3 4 5 6 7 8 9 0 - = {bksp}\",\n \"{tab} q w e r t y u i o p [ ] \\\\\",\n \"{lock} a s d f g h j k l ; ' {enter}\",\n \"{shift} z x c v b n m , . / {shift}\",\n \".com @ {space}\"\n ],\n shift: [\n \"~ ! @ # $ % ^ & * ( ) _ + {bksp}\",\n \"{tab} Q W E R T Y U I O P { } |\",\n '{lock} A S D F G H J K L : \" {enter}',\n \"{shift} Z X C V B N M < > ? {shift}\",\n \".com @ {space}\"\n ]\n };\n }\n}\n\nexport default KeyboardLayout;\n","import \"./Keyboard.css\";\n\n// Services\nimport PhysicalKeyboard from \"../services/PhysicalKeyboard\";\nimport KeyboardLayout from \"../services/KeyboardLayout\";\nimport Utilities from \"../services/Utilities\";\n\n/**\n * Root class for simple-keyboard\n * This class:\n * - Parses the options\n * - Renders the rows and buttons\n * - Handles button functionality\n */\nclass SimpleKeyboard {\n /**\n * Creates an instance of SimpleKeyboard\n * @param {Array} params If first parameter is a string, it is considered the container class. The second parameter is then considered the options object. If first parameter is an object, it is considered the options object.\n */\n constructor(...params) {\n let keyboardDOMQuery =\n typeof params[0] === \"string\" ? params[0] : \".simple-keyboard\";\n let options = typeof params[0] === \"object\" ? params[0] : params[1];\n\n if (!options) options = {};\n\n /**\n * Initializing Utilities\n */\n this.utilities = new Utilities({\n getOptions: this.getOptions,\n getCaretPosition: this.getCaretPosition,\n dispatch: this.dispatch\n });\n\n /**\n * Caret position\n */\n this.caretPosition = null;\n\n /**\n * Processing options\n */\n this.keyboardDOM = document.querySelector(keyboardDOMQuery);\n\n /**\n * @type {object}\n * @property {object} layout Modify the keyboard layout.\n * @property {string} layoutName Specifies which layout should be used.\n * @property {object} display Replaces variable buttons (such as {bksp}) with a human-friendly name (e.g.: “backspace”).\n * @property {boolean} mergeDisplay By default, when you set the display property, you replace the default one. This setting merges them instead.\n * @property {string} theme A prop to add your own css classes to the keyboard wrapper. You can add multiple classes separated by a space.\n * @property {Array} buttonTheme A prop to add your own css classes to one or several buttons.\n * @property {Array} buttonAttributes A prop to add your own attributes to one or several buttons.\n * @property {boolean} debug Runs a console.log every time a key is pressed. Displays the buttons pressed and the current input.\n * @property {boolean} newLineOnEnter Specifies whether clicking the “ENTER” button will input a newline (\\n) or not.\n * @property {boolean} tabCharOnTab Specifies whether clicking the “TAB” button will input a tab character (\\t) or not.\n * @property {string} inputName Allows you to use a single simple-keyboard instance for several inputs.\n * @property {number} maxLength Restrains all of simple-keyboard inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {object} maxLength Restrains simple-keyboard’s individual inputs to a certain length. This should be used in addition to the input element’s maxlengthattribute.\n * @property {boolean} syncInstanceInputs When set to true, this option synchronizes the internal input of every simple-keyboard instance.\n * @property {boolean} physicalKeyboardHighlight Enable highlighting of keys pressed on physical keyboard.\n * @property {boolean} preventMouseDownDefault Calling preventDefault for the mousedown events keeps the focus on the input.\n * @property {string} physicalKeyboardHighlightTextColor Define the text color that the physical keyboard highlighted key should have.\n * @property {string} physicalKeyboardHighlightBgColor Define the background color that the physical keyboard highlighted key should have.\n * @property {function(button: string):string} onKeyPress Executes the callback function on key press. Returns button layout name (i.e.: “{shift}”).\n * @property {function(input: string):string} onChange Executes the callback function on input change. Returns the current input’s string.\n * @property {function} onRender Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n * @property {function} onInit Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n * @property {function(inputs: object):object} onChangeAll Executes the callback function on input change. Returns the input object with all defined inputs.\n * @property {boolean} useButtonTag Render buttons as a button element instead of a div element.\n * @property {boolean} disableCaretPositioning A prop to ensure characters are always be added/removed at the end of the string.\n * @property {object} inputPattern Restrains input(s) change to the defined regular expression pattern.\n * @property {boolean} useTouchEvents Instructs simple-keyboard to use touch events instead of click events.\n * @property {boolean} autoUseTouchEvents Enable useTouchEvents automatically when touch device is detected.\n * @property {boolean} useMouseEvents Opt out of PointerEvents handling, falling back to the prior mouse event logic.\n * @property {function} destroy Clears keyboard listeners and DOM elements.\n * @property {boolean} disableButtonHold Disable button hold action.\n * @property {function} onKeyReleased Executes the callback function on key release.\n */\n this.options = options;\n this.options.layoutName = this.options.layoutName || \"default\";\n this.options.theme = this.options.theme || \"hg-theme-default\";\n this.options.inputName = this.options.inputName || \"default\";\n this.options.preventMouseDownDefault =\n this.options.preventMouseDownDefault || false;\n\n /**\n * @type {object} Classes identifying loaded plugins\n */\n this.keyboardPluginClasses = \"\";\n\n /**\n * Bindings\n */\n Utilities.bindMethods(SimpleKeyboard, this);\n\n /**\n * simple-keyboard uses a non-persistent internal input to keep track of the entered string (the variable `keyboard.input`).\n * This removes any dependency to input DOM elements. You can type and directly display the value in a div element, for example.\n * @example\n * // To get entered input\n * let input = keyboard.getInput();\n *\n * // To clear entered input.\n * keyboard.clearInput();\n *\n * @type {object}\n * @property {object} default Default SimpleKeyboard internal input.\n * @property {object} myInputName Example input that can be set through `options.inputName:\"myInputName\"`.\n */\n this.input = {};\n this.input[this.options.inputName] = \"\";\n\n /**\n * @type {string} DOM class of the keyboard wrapper, normally \"simple-keyboard\" by default.\n */\n this.keyboardDOMClass = keyboardDOMQuery.split(\".\").join(\"\");\n\n /**\n * @type {object} Contains the DOM elements of every rendered button, the key being the button's layout name (e.g.: \"{enter}\").\n */\n this.buttonElements = {};\n\n /**\n * Simple-keyboard Instances\n * This enables multiple simple-keyboard support with easier management\n */\n if (!window[\"SimpleKeyboardInstances\"])\n window[\"SimpleKeyboardInstances\"] = {};\n\n window[\"SimpleKeyboardInstances\"][\n this.utilities.camelCase(this.keyboardDOMClass)\n ] = this;\n\n /**\n * Instance vars\n */\n this.allKeyboardInstances = window[\"SimpleKeyboardInstances\"];\n this.currentInstanceName = this.utilities.camelCase(this.keyboardDOMClass);\n this.keyboardInstanceNames = Object.keys(window[\"SimpleKeyboardInstances\"]);\n this.isFirstKeyboardInstance =\n this.keyboardInstanceNames[0] === this.currentInstanceName;\n\n /**\n * Physical Keyboard support\n */\n this.physicalKeyboard = new PhysicalKeyboard({\n dispatch: this.dispatch,\n getOptions: this.getOptions\n });\n\n /**\n * Rendering keyboard\n */\n if (this.keyboardDOM) this.render();\n else {\n console.warn(`\"${keyboardDOMQuery}\" was not found in the DOM.`);\n throw new Error(\"KEYBOARD_DOM_ERROR\");\n }\n\n /**\n * Modules\n */\n this.modules = {};\n this.loadModules();\n }\n\n /**\n * Getters\n */\n getOptions = () => this.options;\n getCaretPosition = () => this.caretPosition;\n\n /**\n * Handles clicks made to keyboard buttons\n * @param {string} button The button's layout name.\n */\n handleButtonClicked(button) {\n let debug = this.options.debug;\n\n /**\n * Ignoring placeholder buttons\n */\n if (button === \"{//}\") return false;\n\n /**\n * Calling onKeyPress\n */\n if (typeof this.options.onKeyPress === \"function\")\n this.options.onKeyPress(button);\n\n if (!this.input[this.options.inputName])\n this.input[this.options.inputName] = \"\";\n\n let updatedInput = this.utilities.getUpdatedInput(\n button,\n this.input[this.options.inputName],\n this.caretPosition\n );\n\n if (\n // If input will change as a result of this button press\n this.input[this.options.inputName] !== updatedInput &&\n // This pertains to the \"inputPattern\" option:\n // If inputPattern isn't set\n (!this.options.inputPattern ||\n // Or, if it is set and if the pattern is valid - we proceed.\n (this.options.inputPattern && this.inputPatternIsValid(updatedInput)))\n ) {\n /**\n * If maxLength and handleMaxLength yield true, halting\n */\n if (\n this.options.maxLength &&\n this.utilities.handleMaxLength(this.input, updatedInput)\n ) {\n return false;\n }\n\n this.input[this.options.inputName] = this.utilities.getUpdatedInput(\n button,\n this.input[this.options.inputName],\n this.caretPosition,\n true\n );\n\n if (debug) console.log(\"Input changed:\", this.input);\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n /**\n * Calling onChange\n */\n if (typeof this.options.onChange === \"function\")\n this.options.onChange(this.input[this.options.inputName]);\n\n /**\n * Calling onChangeAll\n */\n if (typeof this.options.onChangeAll === \"function\")\n this.options.onChangeAll(this.input);\n }\n\n if (debug) {\n console.log(\"Key pressed:\", button);\n }\n }\n\n /**\n * Handles button mousedown\n */\n /* istanbul ignore next */\n handleButtonMouseDown(button, e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n if (this.options.stopMouseDownPropagation) e.stopPropagation();\n\n /**\n * @type {boolean} Whether the mouse is being held onKeyPress\n */\n this.isMouseHold = true;\n\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n if (this.holdTimeout) clearTimeout(this.holdTimeout);\n\n /**\n * @type {object} Time to wait until a key hold is detected\n */\n if (!this.options.disableButtonHold) {\n this.holdTimeout = setTimeout(() => {\n if (\n this.isMouseHold &&\n ((!button.includes(\"{\") && !button.includes(\"}\")) ||\n button === \"{delete}\" ||\n button === \"{backspace}\" ||\n button === \"{bksp}\" ||\n button === \"{space}\" ||\n button === \"{tab}\")\n ) {\n if (this.options.debug) console.log(\"Button held:\", button);\n\n this.handleButtonHold(button, e);\n }\n clearTimeout(this.holdTimeout);\n }, 500);\n }\n }\n\n /**\n * Handles button mouseup\n */\n handleButtonMouseUp(button) {\n this.isMouseHold = false;\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * Calling onKeyReleased\n */\n if (button && typeof this.options.onKeyReleased === \"function\")\n this.options.onKeyReleased(button);\n }\n\n /**\n * Handles container mousedown\n */\n handleKeyboardContainerMouseDown(e) {\n /**\n * Handle event options\n */\n if (this.options.preventMouseDownDefault) e.preventDefault();\n }\n\n /**\n * Handles button hold\n */\n /* istanbul ignore next */\n handleButtonHold(button) {\n if (this.holdInteractionTimeout) clearTimeout(this.holdInteractionTimeout);\n\n /**\n * @type {object} Timeout dictating the speed of key hold iterations\n */\n this.holdInteractionTimeout = setTimeout(() => {\n if (this.isMouseHold) {\n this.handleButtonClicked(button);\n this.handleButtonHold(button);\n } else {\n clearTimeout(this.holdInteractionTimeout);\n }\n }, 100);\n }\n\n /**\n * Send a command to all simple-keyboard instances (if you have several instances).\n */\n syncInstanceInputs() {\n this.dispatch(instance => {\n instance.replaceInput(this.input);\n instance.caretPosition = this.caretPosition;\n });\n }\n\n /**\n * Clear the keyboard’s input.\n * @param {string} [inputName] optional - the internal input to select\n */\n clearInput(inputName) {\n inputName = inputName || this.options.inputName;\n this.input[inputName] = \"\";\n\n /**\n * Reset caretPosition\n */\n this.caretPosition = 0;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Get the keyboard’s input (You can also get it from the onChange prop).\n * @param {string} [inputName] optional - the internal input to select\n */\n getInput(inputName) {\n inputName = inputName || this.options.inputName;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n\n return this.input[inputName];\n }\n\n /**\n * Set the keyboard’s input.\n * @param {string} input the input value\n * @param {string} inputName optional - the internal input to select\n */\n setInput(input, inputName) {\n inputName = inputName || this.options.inputName;\n this.input[inputName] = input;\n\n /**\n * Enforce syncInstanceInputs, if set\n */\n if (this.options.syncInstanceInputs) this.syncInstanceInputs();\n }\n\n /**\n * Replace the input object (`keyboard.input`)\n * @param {object} inputObj The input object\n */\n replaceInput(inputObj) {\n this.input = inputObj;\n }\n\n /**\n * Set new option or modify existing ones after initialization.\n * @param {object} options The options to set\n */\n setOptions(options) {\n options = options || {};\n this.options = Object.assign(this.options, options);\n\n /**\n * Some option changes require adjustments before re-render\n */\n this.onSetOptions(options);\n\n /**\n * Rendering\n */\n this.render();\n }\n\n /**\n * Executing actions depending on changed options\n * @param {object} options The options to set\n */\n onSetOptions(options) {\n if (options.inputName) {\n /**\n * inputName changed. This requires a caretPosition reset\n */\n if (this.options.debug) {\n console.log(\"inputName changed. caretPosition reset.\");\n }\n\n this.caretPosition = null;\n }\n }\n\n /**\n * Remove all keyboard rows and reset keyboard values.\n * Used interally between re-renders.\n */\n clear() {\n this.keyboardDOM.innerHTML = \"\";\n this.keyboardDOM.className = this.keyboardDOMClass;\n this.buttonElements = {};\n }\n\n /**\n * Send a command to all simple-keyboard instances at once (if you have multiple instances).\n * @param {function(instance: object, key: string)} callback Function to run on every instance\n */\n dispatch(callback) {\n if (!window[\"SimpleKeyboardInstances\"]) {\n console.warn(\n `SimpleKeyboardInstances is not defined. Dispatch cannot be called.`\n );\n throw new Error(\"INSTANCES_VAR_ERROR\");\n }\n\n return Object.keys(window[\"SimpleKeyboardInstances\"]).forEach(key => {\n callback(window[\"SimpleKeyboardInstances\"][key], key);\n });\n }\n\n /**\n * Adds/Modifies an entry to the `buttonTheme`. Basically a way to add a class to a button.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n addButtonTheme(buttons, className) {\n if (!className || !buttons) return false;\n\n buttons.split(\" \").forEach(button => {\n className.split(\" \").forEach(classNameItem => {\n if (!this.options.buttonTheme) this.options.buttonTheme = [];\n\n let classNameFound = false;\n\n /**\n * If class is already defined, we add button to class definition\n */\n this.options.buttonTheme.map(buttonTheme => {\n if (buttonTheme.class.split(\" \").includes(classNameItem)) {\n classNameFound = true;\n\n let buttonThemeArray = buttonTheme.buttons.split(\" \");\n if (!buttonThemeArray.includes(button)) {\n classNameFound = true;\n buttonThemeArray.push(button);\n buttonTheme.buttons = buttonThemeArray.join(\" \");\n }\n }\n return buttonTheme;\n });\n\n /**\n * If class is not defined, we create a new entry\n */\n if (!classNameFound) {\n this.options.buttonTheme.push({\n class: classNameItem,\n buttons: buttons\n });\n }\n });\n });\n\n this.render();\n }\n\n /**\n * Removes/Amends an entry to the `buttonTheme`. Basically a way to remove a class previously added to a button through buttonTheme or addButtonTheme.\n * @param {string} buttons List of buttons to select (separated by a space).\n * @param {string} className Classes to give to the selected buttons (separated by space).\n */\n removeButtonTheme(buttons, className) {\n /**\n * When called with empty parameters, remove all button themes\n */\n if (!buttons && !className) {\n this.options.buttonTheme = [];\n this.render();\n return false;\n }\n\n /**\n * If buttons are passed and buttonTheme has items\n */\n if (\n buttons &&\n Array.isArray(this.options.buttonTheme) &&\n this.options.buttonTheme.length\n ) {\n let buttonArray = buttons.split(\" \");\n buttonArray.forEach((button, key) => {\n this.options.buttonTheme.map((buttonTheme, index) => {\n /**\n * If className is set, we affect the buttons only for that class\n * Otherwise, we afect all classes\n */\n if (\n (className && className.includes(buttonTheme.class)) ||\n !className\n ) {\n let filteredButtonArray = buttonTheme.buttons\n .split(\" \")\n .filter(item => item !== button);\n\n /**\n * If buttons left, return them, otherwise, remove button Theme\n */\n if (filteredButtonArray.length) {\n buttonTheme.buttons = filteredButtonArray.join(\" \");\n } else {\n this.options.buttonTheme.splice(index, 1);\n buttonTheme = null;\n }\n }\n\n return buttonTheme;\n });\n });\n\n this.render();\n }\n }\n\n /**\n * Get the DOM Element of a button. If there are several buttons with the same name, an array of the DOM Elements is returned.\n * @param {string} button The button layout name to select\n */\n getButtonElement(button) {\n let output;\n\n let buttonArr = this.buttonElements[button];\n if (buttonArr) {\n if (buttonArr.length > 1) {\n output = buttonArr;\n } else {\n output = buttonArr[0];\n }\n }\n\n return output;\n }\n\n /**\n * This handles the \"inputPattern\" option\n * by checking if the provided inputPattern passes\n */\n inputPatternIsValid(inputVal) {\n let inputPatternRaw = this.options.inputPattern;\n let inputPattern;\n\n /**\n * Check if input pattern is global or targeted to individual inputs\n */\n if (inputPatternRaw instanceof RegExp) {\n inputPattern = inputPatternRaw;\n } else {\n inputPattern = inputPatternRaw[this.options.inputName];\n }\n\n if (inputPattern && inputVal) {\n let didInputMatch = inputPattern.test(inputVal);\n\n if (this.options.debug) {\n console.log(\n `inputPattern (\"${inputPattern}\"): ${\n didInputMatch ? \"passed\" : \"did not pass!\"\n }`\n );\n }\n\n return didInputMatch;\n } else {\n /**\n * inputPattern doesn't seem to be set for the current input, or input is empty. Pass.\n */\n return true;\n }\n }\n\n /**\n * Handles simple-keyboard event listeners\n */\n setEventListeners() {\n /**\n * Only first instance should set the event listeners\n */\n if (this.isFirstKeyboardInstance || !this.allKeyboardInstances) {\n if (this.options.debug) {\n console.log(`Caret handling started (${this.keyboardDOMClass})`);\n }\n\n /**\n * Event Listeners\n */\n document.addEventListener(\"keyup\", this.handleKeyUp);\n document.addEventListener(\"keydown\", this.handleKeyDown);\n document.addEventListener(\"mouseup\", this.handleMouseUp);\n document.addEventListener(\"touchend\", this.handleTouchEnd);\n }\n }\n\n /**\n * Event Handler: KeyUp\n */\n handleKeyUp(event) {\n this.caretEventHandler(event);\n\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyUp(event);\n }\n }\n\n /**\n * Event Handler: KeyDown\n */\n handleKeyDown(event) {\n if (this.options.physicalKeyboardHighlight) {\n this.physicalKeyboard.handleHighlightKeyDown(event);\n }\n }\n\n /**\n * Event Handler: MouseUp\n */\n handleMouseUp(event) {\n this.caretEventHandler(event);\n }\n\n /**\n * Event Handler: TouchEnd\n */\n handleTouchEnd(event) {\n this.caretEventHandler(event);\n }\n\n /**\n * Called by {@link setEventListeners} when an event that warrants a cursor position update is triggered\n */\n caretEventHandler(event) {\n let targetTagName;\n if (event.target.tagName) {\n targetTagName = event.target.tagName.toLowerCase();\n }\n\n this.dispatch(instance => {\n if (instance.isMouseHold) {\n instance.isMouseHold = false;\n }\n\n if (\n (targetTagName === \"textarea\" || targetTagName === \"input\") &&\n !instance.options.disableCaretPositioning\n ) {\n /**\n * Tracks current cursor position\n * As keys are pressed, text will be added/removed at that position within the input.\n */\n instance.caretPosition = event.target.selectionStart;\n\n if (instance.options.debug) {\n console.log(\n \"Caret at: \",\n event.target.selectionStart,\n event.target.tagName.toLowerCase(),\n `(${instance.keyboardDOMClass})`\n );\n }\n } else if (instance.options.disableCaretPositioning) {\n /**\n * If we toggled off disableCaretPositioning, we must ensure caretPosition doesn't persist once reactivated.\n */\n instance.caretPosition = null;\n }\n });\n }\n\n /**\n * Destroy keyboard listeners and DOM elements\n */\n destroy() {\n /**\n * Remove listeners\n */\n document.removeEventListener(\"keyup\", this.handleKeyUp);\n document.removeEventListener(\"keydown\", this.handleKeyDown);\n document.removeEventListener(\"mouseup\", this.handleMouseUp);\n document.removeEventListener(\"touchend\", this.handleTouchEnd);\n\n /**\n * Clear DOM\n */\n this.clear();\n }\n\n /**\n * Process buttonTheme option\n */\n getButtonThemeClasses(button) {\n let buttonTheme = this.options.buttonTheme;\n let buttonClasses = [];\n\n if (Array.isArray(buttonTheme)) {\n buttonTheme.forEach(themeObj => {\n if (\n themeObj.class &&\n typeof themeObj.class === \"string\" &&\n (themeObj.buttons && typeof themeObj.buttons === \"string\")\n ) {\n let themeObjClasses = themeObj.class.split(\" \");\n let themeObjButtons = themeObj.buttons.split(\" \");\n\n if (themeObjButtons.includes(button)) {\n buttonClasses = [...buttonClasses, ...themeObjClasses];\n }\n } else {\n console.warn(\n `Incorrect \"buttonTheme\". Please check the documentation.`,\n themeObj\n );\n }\n });\n }\n\n return buttonClasses;\n }\n\n /**\n * Process buttonAttributes option\n */\n setDOMButtonAttributes(button, callback) {\n let buttonAttributes = this.options.buttonAttributes;\n\n if (Array.isArray(buttonAttributes)) {\n buttonAttributes.forEach(attrObj => {\n if (\n attrObj.attribute &&\n typeof attrObj.attribute === \"string\" &&\n (attrObj.value && typeof attrObj.value === \"string\") &&\n (attrObj.buttons && typeof attrObj.buttons === \"string\")\n ) {\n let attrObjButtons = attrObj.buttons.split(\" \");\n\n if (attrObjButtons.includes(button)) {\n callback(attrObj.attribute, attrObj.value);\n }\n } else {\n console.warn(\n `Incorrect \"buttonAttributes\". Please check the documentation.`,\n attrObj\n );\n }\n });\n }\n }\n\n onTouchDeviceDetected() {\n /**\n * Processing autoTouchEvents\n */\n this.processAutoTouchEvents();\n\n /**\n * Disabling contextual window on touch devices\n */\n this.disableContextualWindow();\n }\n\n /**\n * Disabling contextual window for hg-button\n */\n /* istanbul ignore next */\n disableContextualWindow() {\n window.oncontextmenu = event => {\n if (event.target.classList.contains(\"hg-button\")) {\n event.preventDefault();\n event.stopPropagation();\n return false;\n }\n };\n }\n\n /**\n * Process autoTouchEvents option\n */\n processAutoTouchEvents() {\n if (this.options.autoUseTouchEvents) {\n this.options.useTouchEvents = true;\n\n if (this.options.debug) {\n console.log(\n `autoUseTouchEvents: Touch device detected, useTouchEvents enabled.`\n );\n }\n }\n }\n\n /**\n * Executes the callback function once simple-keyboard is rendered for the first time (on initialization).\n */\n onInit() {\n if (this.options.debug) {\n console.log(`${this.keyboardDOMClass} Initialized`);\n }\n\n /**\n * setEventListeners\n */\n this.setEventListeners();\n\n if (typeof this.options.onInit === \"function\") this.options.onInit();\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeFirstRender() {\n /**\n * Performing actions when touch device detected\n */\n if (this.utilities.isTouchDevice()) {\n this.onTouchDeviceDetected();\n }\n\n if (typeof this.options.beforeFirstRender === \"function\")\n this.options.beforeFirstRender();\n\n /**\n * Notify about PointerEvents usage\n */\n if (\n this.isFirstKeyboardInstance &&\n this.utilities.pointerEventsSupported() &&\n !this.options.useTouchEvents &&\n !this.options.useMouseEvents\n ) {\n if (this.options.debug) {\n console.log(\"Using PointerEvents as it is supported by this browser\");\n }\n }\n\n /**\n * Notify about touch events usage\n */\n if (this.options.useTouchEvents) {\n if (this.options.debug) {\n console.log(\n \"useTouchEvents has been enabled. Only touch events will be used.\"\n );\n }\n }\n }\n\n /**\n * Executes the callback function before a simple-keyboard render.\n */\n beforeRender() {\n if (typeof this.options.beforeRender === \"function\")\n this.options.beforeRender();\n }\n\n /**\n * Executes the callback function every time simple-keyboard is rendered (e.g: when you change layouts).\n */\n onRender() {\n if (typeof this.options.onRender === \"function\") this.options.onRender();\n }\n\n /**\n * Executes the callback function once all modules have been loaded\n */\n onModulesLoaded() {\n if (typeof this.options.onModulesLoaded === \"function\")\n this.options.onModulesLoaded();\n }\n\n /**\n * Register module\n */\n registerModule = (name, initCallback) => {\n if (!this.modules[name]) this.modules[name] = {};\n\n initCallback(this.modules[name]);\n };\n\n /**\n * Load modules\n */\n loadModules() {\n if (Array.isArray(this.options.modules)) {\n this.options.modules.forEach(Module => {\n let module = new Module();\n\n /* istanbul ignore next */\n if (module.constructor.name && module.constructor.name !== \"Function\") {\n let classStr = `module-${this.utilities.camelCase(\n module.constructor.name\n )}`;\n this.keyboardPluginClasses =\n this.keyboardPluginClasses + ` ${classStr}`;\n }\n\n module.init(this);\n });\n\n this.keyboardPluginClasses =\n this.keyboardPluginClasses + \" modules-loaded\";\n\n this.render();\n this.onModulesLoaded();\n }\n }\n\n /**\n * Get module prop\n */\n getModuleProp(name, prop) {\n if (!this.modules[name]) return false;\n\n return this.modules[name][prop];\n }\n\n /**\n * getModulesList\n */\n getModulesList() {\n return Object.keys(this.modules);\n }\n\n /**\n * Parse Row DOM containers\n */\n parseRowDOMContainers(\n rowDOM,\n rowIndex,\n containerStartIndexes,\n containerEndIndexes\n ) {\n let rowDOMArray = Array.from(rowDOM.children);\n let removedElements = 0;\n\n if (rowDOMArray.length) {\n containerStartIndexes.forEach((startIndex, arrIndex) => {\n let endIndex = containerEndIndexes[arrIndex];\n\n /**\n * If there exists a respective end index\n * if end index comes after start index\n */\n if (!endIndex || !(endIndex > startIndex)) {\n return false;\n }\n\n /**\n * Updated startIndex, endIndex\n * This is since the removal of buttons to place a single button container\n * results in a modified array size\n */\n let updated_startIndex = startIndex - removedElements;\n let updated_endIndex = endIndex - removedElements;\n\n /**\n * Create button container\n */\n let containerDOM = document.createElement(\"div\");\n containerDOM.className += \"hg-button-container\";\n let containerUID = `${this.options.layoutName}-r${rowIndex}c${arrIndex}`;\n containerDOM.setAttribute(\"data-skUID\", containerUID);\n\n /**\n * Taking elements due to be inserted into container\n */\n let containedElements = rowDOMArray.splice(\n updated_startIndex,\n updated_endIndex - updated_startIndex + 1\n );\n removedElements = updated_endIndex - updated_startIndex;\n\n /**\n * Inserting elements to container\n */\n containedElements.forEach(element => containerDOM.appendChild(element));\n\n /**\n * Adding container at correct position within rowDOMArray\n */\n rowDOMArray.splice(updated_startIndex, 0, containerDOM);\n\n /**\n * Clearing old rowDOM children structure\n */\n rowDOM.innerHTML = \"\";\n\n /**\n * Appending rowDOM new children list\n */\n rowDOMArray.forEach(element => rowDOM.appendChild(element));\n\n if (this.options.debug) {\n console.log(\n \"rowDOMContainer\",\n containedElements,\n updated_startIndex,\n updated_endIndex,\n removedElements + 1\n );\n }\n });\n }\n\n return rowDOM;\n }\n\n /**\n * Renders rows and buttons as per options\n */\n render() {\n /**\n * Clear keyboard\n */\n this.clear();\n\n /**\n * Calling beforeFirstRender\n */\n if (!this.initialized) {\n this.beforeFirstRender();\n }\n\n /**\n * Calling beforeRender\n */\n this.beforeRender();\n\n let layoutClass = `hg-layout-${this.options.layoutName}`;\n let layout = this.options.layout || KeyboardLayout.getDefaultLayout();\n let useTouchEvents = this.options.useTouchEvents || false;\n let useTouchEventsClass = useTouchEvents ? \"hg-touch-events\" : \"\";\n let useMouseEvents = this.options.useMouseEvents || false;\n let disableRowButtonContainers = this.options.disableRowButtonContainers;\n\n /**\n * Adding themeClass, layoutClass to keyboardDOM\n */\n this.keyboardDOM.className += ` ${this.options.theme} ${layoutClass} ${this.keyboardPluginClasses} ${useTouchEventsClass}`;\n\n /**\n * Iterating through each row\n */\n layout[this.options.layoutName].forEach((row, rIndex) => {\n let rowArray = row.split(\" \");\n\n /**\n * Creating empty row\n */\n let rowDOM = document.createElement(\"div\");\n rowDOM.className += \"hg-row\";\n\n /**\n * Tracking container indicators in rows\n */\n let containerStartIndexes = [];\n let containerEndIndexes = [];\n\n /**\n * Iterating through each button in row\n */\n rowArray.forEach((button, bIndex) => {\n /**\n * Check if button has a container indicator\n */\n let buttonHasContainerStart =\n !disableRowButtonContainers &&\n button.includes(\"[\") &&\n button.length > 1;\n let buttonHasContainerEnd =\n !disableRowButtonContainers &&\n button.includes(\"]\") &&\n button.length > 1;\n\n /**\n * Save container start index, if applicable\n */\n if (buttonHasContainerStart) {\n containerStartIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\[/g, \"\");\n }\n\n if (buttonHasContainerEnd) {\n containerEndIndexes.push(bIndex);\n\n /**\n * Removing indicator\n */\n button = button.replace(/\\]/g, \"\");\n }\n\n /**\n * Processing button options\n */\n let fctBtnClass = this.utilities.getButtonClass(button);\n let buttonDisplayName = this.utilities.getButtonDisplayName(\n button,\n this.options.display,\n this.options.mergeDisplay\n );\n\n /**\n * Creating button\n */\n let buttonType = this.options.useButtonTag ? \"button\" : \"div\";\n let buttonDOM = document.createElement(buttonType);\n buttonDOM.className += `hg-button ${fctBtnClass}`;\n\n /**\n * Adding buttonTheme\n */\n buttonDOM.classList.add(...this.getButtonThemeClasses(button));\n\n /**\n * Adding buttonAttributes\n */\n this.setDOMButtonAttributes(button, (attribute, value) => {\n buttonDOM.setAttribute(attribute, value);\n });\n\n /**\n * Handle button click event\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n /**\n * Handle PointerEvents\n */\n buttonDOM.onpointerdown = e => {\n this.handleButtonClicked(button);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.onpointerup = () => this.handleButtonMouseUp(button);\n buttonDOM.onpointercancel = () => this.handleButtonMouseUp(button);\n } else {\n /**\n * Fallback for browsers not supporting PointerEvents\n */\n if (useTouchEvents) {\n /**\n * Handle touch events\n */\n buttonDOM.ontouchstart = e => {\n this.handleButtonClicked(button);\n this.handleButtonMouseDown(button, e);\n };\n buttonDOM.ontouchend = () => this.handleButtonMouseUp(button);\n buttonDOM.ontouchcancel = () => this.handleButtonMouseUp(button);\n } else {\n /**\n * Handle mouse events\n */\n buttonDOM.onclick = () => {\n this.isMouseHold = false;\n this.handleButtonClicked(button);\n };\n buttonDOM.onmousedown = e => this.handleButtonMouseDown(button, e);\n buttonDOM.onmouseup = () => this.handleButtonMouseUp(button);\n }\n }\n\n /**\n * Adding identifier\n */\n buttonDOM.setAttribute(\"data-skBtn\", button);\n\n /**\n * Adding unique id\n * Since there's no limit on spawning same buttons, the unique id ensures you can style every button\n */\n let buttonUID = `${this.options.layoutName}-r${rIndex}b${bIndex}`;\n buttonDOM.setAttribute(\"data-skBtnUID\", buttonUID);\n\n /**\n * Adding button label to button\n */\n let buttonSpanDOM = document.createElement(\"span\");\n buttonSpanDOM.innerHTML = buttonDisplayName;\n buttonDOM.appendChild(buttonSpanDOM);\n\n /**\n * Adding to buttonElements\n */\n if (!this.buttonElements[button]) this.buttonElements[button] = [];\n\n this.buttonElements[button].push(buttonDOM);\n\n /**\n * Appending button to row\n */\n rowDOM.appendChild(buttonDOM);\n });\n\n /**\n * Parse containers in row\n */\n rowDOM = this.parseRowDOMContainers(\n rowDOM,\n rIndex,\n containerStartIndexes,\n containerEndIndexes\n );\n\n /**\n * Appending row to keyboard\n */\n this.keyboardDOM.appendChild(rowDOM);\n });\n\n /**\n * Calling onRender\n */\n this.onRender();\n\n if (!this.initialized) {\n /**\n * Ensures that onInit and beforeFirstRender are only called once per instantiation\n */\n this.initialized = true;\n\n /**\n * Handling parent events\n */\n /* istanbul ignore next */\n if (\n this.utilities.pointerEventsSupported() &&\n !useTouchEvents &&\n !useMouseEvents\n ) {\n document.onpointerup = () => this.handleButtonMouseUp();\n this.keyboardDOM.onpointerdown = e =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (useTouchEvents) {\n /**\n * Handling ontouchend, ontouchcancel\n */\n document.ontouchend = () => this.handleButtonMouseUp();\n document.ontouchcancel = () => this.handleButtonMouseUp();\n\n this.keyboardDOM.ontouchstart = e =>\n this.handleKeyboardContainerMouseDown(e);\n } else if (!useTouchEvents) {\n /**\n * Handling mouseup\n */\n document.onmouseup = () => this.handleButtonMouseUp();\n this.keyboardDOM.onmousedown = e =>\n this.handleKeyboardContainerMouseDown(e);\n }\n\n /**\n * Calling onInit\n */\n this.onInit();\n }\n }\n}\n\nexport default SimpleKeyboard;\n","import SimpleKeyboard from \"./components/Keyboard\";\nexport default SimpleKeyboard;\n"],"sourceRoot":""} \ No newline at end of file