diff --git a/build/kioskboard-aio.js b/build/kioskboard-aio.js index 6aba316..8fabd9d 100644 --- a/build/kioskboard-aio.js +++ b/build/kioskboard-aio.js @@ -757,7 +757,7 @@ removeKeyboard(); } if (typeof opt.keysEnterCallback === 'function') { - opt.keysEnterCallback(); + opt.keysEnterCallback(input); } }); } diff --git a/dist/kioskboard-2.3.0.min.js b/dist/kioskboard-2.3.0.min.js index d104b45..37f6ee0 100644 --- a/dist/kioskboard-2.3.0.min.js +++ b/dist/kioskboard-2.3.0.min.js @@ -1,3 +1,3 @@ /* KioskBoard - Virtual Keyboard (https://github.com/furcan/KioskBoard) - Version: 2.3.0 - Author: Furkan (https://github.com/furcan) - Copyright 2022 KioskBoard - Virtual Keyboard, MIT Licence (https://opensource.org/licenses/MIT) */ -(function(a,b){"function"==typeof define&&define.amd?define([],function(){return b(a)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=b(a):a.KioskBoard=b(a)})("undefined"==typeof global?"undefined"==typeof window?this:window:global,function(a){'use strict';if("undefined"!=typeof a||"undefined"!=typeof a.document){var b,c,d=function(){return null},e=function(){if(null!==d()&&!a.document.getElementById("KioskBoardInternalCSS")){var b=a.document.createElement("style");b.id="KioskBoardInternalCSS",b.innerHTML=d(),a.document.head.appendChild(b)}},f={keysArrayOfObjects:null,keysJsonUrl:null,keysSpecialCharsArrayOfStrings:null,keysNumpadArrayOfNumbers:null,language:"en",theme:"light",autoScroll:!0,capsLockActive:!0,allowRealKeyboard:!1,allowMobileKeyboard:!1,cssAnimations:!0,cssAnimationsDuration:360,cssAnimationsStyle:"slide",keysAllowSpacebar:!0,keysSpacebarText:"Space",keysFontFamily:"sans-serif",keysFontSize:"22px",keysFontWeight:"normal",keysIconSize:"25px",keysEnterText:"Enter",keysEnterCallback:void 0,keysEnterCanClose:!0},g="https://github.com/furcan/KioskBoard",h={0:"!",1:"'",2:"^",3:"#",4:"+",5:"$",6:"%",7:"\xBD",8:"&",9:"/",10:"{",11:"}",12:"(",13:")",14:"[",15:"]",16:"=",17:"*",18:"?",19:"\\",20:"-",21:"_",22:"|",23:"@",24:"\u20AC",25:"\u20BA",26:"~",27:"\xE6",28:"\xDF",29:"<",30:">",31:",",32:";",33:".",34:":",35:"`"},i={0:"7",1:"8",2:"9",3:"4",4:"5",5:"6",6:"1",7:"2",8:"3",9:"0"},j={0:"1",1:"2",2:"3",3:"4",4:"5",5:"6",6:"7",7:"8",8:"9",9:"0"},k={All:"all",Keyboard:"keyboard",Numpad:"numpad"},l={Bottom:"bottom",Top:"top"},m=function(){var a={},b=!1,c=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(b=arguments[0],c++);for(var d=function(c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=b&&"[object Object]"===Object.prototype.toString.call(c[d])?m(a[d],c[d]):c[d])};c";return c},r=function(a,b){a||(a=25),b||(b="#707070");var c=" ";return c},s=function(a,b,c){a||(a=50),b||(a=25),c||(c="#707070");var d=" ";return d},t=function(a,b){a||(a=18),b||(b="#707070");var c="";return c};(function(){function b(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=a.document.createEvent("CustomEvent");return d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail),d}return"function"!=typeof a.Event&&void(b.prototype=a.Event.prototype,a.Event=b)})();var u=function(a,b){if(a.target===b)return!0;var c=b.querySelectorAll("*");if(c&&0w.length)return o("You called the KioskBoard with the \""+d+"\" selector, but there is no such element on the document."),!1}if("object"==typeof e&&0"+K+"",N=""+r(H,"#707070")+"",O=""+q(H,"#707070")+"",P=""+L+"",Q="",R="";if(y){var S=parseInt(H)||25;Q=""+s(2*S+"px",S+"px","#707070")+"";var T=A.keysSpecialCharsArrayOfStrings;for(var U in Array.isArray(T)&&0"+V.toString()+"";R+=W}}if(v===k.Numpad){var X=A.keysNumpadArrayOfNumbers;Array.isArray(X)&&10===X.length&&(i=X.reduce(function(a,b,c){return a[c]=b,a},{}));var Y="";for(var Z in i)if(Object.prototype.hasOwnProperty.call(i,Z)){var $=Z,_=i[Z],aa=""+_.toString()+"";Y+=aa}C+="
"+Y+O+P+"
"}if(v===k.Keyboard||v===k.All){if(v===k.All){var ba="";for(var ca in j)if(Object.prototype.hasOwnProperty.call(j,ca)){var da=j[ca],ea=""+da.toString()+"";ba+=ea}C+="
"+ba+"
"}for(var fa=0;fa"+ia.toString()+"";ga+=ja}C+="
"+ga+"
"}if(C+="
"+N+Q+M+P+O+"
",y){var ka=""+t("18px","#707070")+"",la="
"+R+"
";C+="
"+ka+la+"
"}}var ma=function(b){var c=a.document.createElement("div");return c.className="kioskboard-wrapper",c.innerHTML=b.trim(),c}(C),na=!0===A.cssAnimations,oa="no-animation",pa="no-animation",qa=0;na&&(oa="kioskboard-with-animation",pa="kioskboard-fade",qa="number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:360,"slide"===A.cssAnimationsStyle&&(pa="kioskboard-slide"));var ra="string"==typeof A.theme&&0=c)return!1;if(0=d)return!1;b.focus();var f=a.currentTarget.dataset.value||"";f=G?f.toLocaleUpperCase(z):f.toLocaleLowerCase(z);for(var g=f.split(""),h=0;hMath.round(2*(ya/3))){var Ba=a.document.querySelector(".kioskboard-wrapper");Ba.style.maxHeight=Math.round(4*(ya/5))+"px",Ba.style.overflowX="hidden",Ba.style.overflowY="auto",Ba.classList.add("kioskboard-overflow")}var Ca=x===l.Top,Da=(Ca?f.getBoundingClientRect().top:f.getBoundingClientRect().bottom)||0,Ea=a.document.documentElement.scrollTop||0,Fa=Math.round(Da+Ea),Ga=Fa.kioskboard-body-padding {padding-"+(Ga?"top":"bottom")+":"+Aa+"px !important;}",Ja=a.document.createRange();Ja.selectNode(a.document.head);var Ka=Ja.createContextualFragment(Ia);a.document.head.appendChild(Ka),a.document.body.classList.add("kioskboard-body-padding")}var La=!0===A.autoScroll;if(La){var Ma=Ca?20:50,Na=f.getBoundingClientRect().top||0,Oa=Math.round(Na+Ea),Pa=!0===A.cssAnimations?"smooth":"auto",Qa=!0===A.cssAnimations&&"number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:0,Ra=Oa-Ma-(Ca?Aa:0),Sa=a.navigator.userAgent.toLocaleLowerCase("en"),Ta=-1",31:",",32:";",33:".",34:":",35:"`"},i={0:"7",1:"8",2:"9",3:"4",4:"5",5:"6",6:"1",7:"2",8:"3",9:"0"},j={0:"1",1:"2",2:"3",3:"4",4:"5",5:"6",6:"7",7:"8",8:"9",9:"0"},k={All:"all",Keyboard:"keyboard",Numpad:"numpad"},l={Bottom:"bottom",Top:"top"},m=function(){var a={},b=!1,c=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(b=arguments[0],c++);for(var d=function(c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=b&&"[object Object]"===Object.prototype.toString.call(c[d])?m(a[d],c[d]):c[d])};c";return c},r=function(a,b){a||(a=25),b||(b="#707070");var c=" ";return c},s=function(a,b,c){a||(a=50),b||(a=25),c||(c="#707070");var d=" ";return d},t=function(a,b){a||(a=18),b||(b="#707070");var c="";return c};(function(){function b(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=a.document.createEvent("CustomEvent");return d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail),d}return"function"!=typeof a.Event&&void(b.prototype=a.Event.prototype,a.Event=b)})();var u=function(a,b){if(a.target===b)return!0;var c=b.querySelectorAll("*");if(c&&0w.length)return o("You called the KioskBoard with the \""+d+"\" selector, but there is no such element on the document."),!1}if("object"==typeof e&&0"+K+"",N=""+r(H,"#707070")+"",O=""+q(H,"#707070")+"",P=""+L+"",Q="",R="";if(y){var S=parseInt(H)||25;Q=""+s(2*S+"px",S+"px","#707070")+"";var T=A.keysSpecialCharsArrayOfStrings;for(var U in Array.isArray(T)&&0"+V.toString()+"";R+=W}}if(v===k.Numpad){var X=A.keysNumpadArrayOfNumbers;Array.isArray(X)&&10===X.length&&(i=X.reduce(function(a,b,c){return a[c]=b,a},{}));var Y="";for(var Z in i)if(Object.prototype.hasOwnProperty.call(i,Z)){var $=Z,_=i[Z],aa=""+_.toString()+"";Y+=aa}C+="
"+Y+O+P+"
"}if(v===k.Keyboard||v===k.All){if(v===k.All){var ba="";for(var ca in j)if(Object.prototype.hasOwnProperty.call(j,ca)){var da=j[ca],ea=""+da.toString()+"";ba+=ea}C+="
"+ba+"
"}for(var fa=0;fa"+ia.toString()+"";ga+=ja}C+="
"+ga+"
"}if(C+="
"+N+Q+M+P+O+"
",y){var ka=""+t("18px","#707070")+"",la="
"+R+"
";C+="
"+ka+la+"
"}}var ma=function(b){var c=a.document.createElement("div");return c.className="kioskboard-wrapper",c.innerHTML=b.trim(),c}(C),na=!0===A.cssAnimations,oa="no-animation",pa="no-animation",qa=0;na&&(oa="kioskboard-with-animation",pa="kioskboard-fade",qa="number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:360,"slide"===A.cssAnimationsStyle&&(pa="kioskboard-slide"));var ra="string"==typeof A.theme&&0=c)return!1;if(0=d)return!1;b.focus();var f=a.currentTarget.dataset.value||"";f=G?f.toLocaleUpperCase(z):f.toLocaleLowerCase(z);for(var g=f.split(""),h=0;hMath.round(2*(ya/3))){var Ba=a.document.querySelector(".kioskboard-wrapper");Ba.style.maxHeight=Math.round(4*(ya/5))+"px",Ba.style.overflowX="hidden",Ba.style.overflowY="auto",Ba.classList.add("kioskboard-overflow")}var Ca=x===l.Top,Da=(Ca?f.getBoundingClientRect().top:f.getBoundingClientRect().bottom)||0,Ea=a.document.documentElement.scrollTop||0,Fa=Math.round(Da+Ea),Ga=Fa.kioskboard-body-padding {padding-"+(Ga?"top":"bottom")+":"+Aa+"px !important;}",Ja=a.document.createRange();Ja.selectNode(a.document.head);var Ka=Ja.createContextualFragment(Ia);a.document.head.appendChild(Ka),a.document.body.classList.add("kioskboard-body-padding")}var La=!0===A.autoScroll;if(La){var Ma=Ca?20:50,Na=f.getBoundingClientRect().top||0,Oa=Math.round(Na+Ea),Pa=!0===A.cssAnimations?"smooth":"auto",Qa=!0===A.cssAnimations&&"number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:0,Ra=Oa-Ma-(Ca?Aa:0),Sa=a.navigator.userAgent.toLocaleLowerCase("en"),Ta=-1",31:",",32:";",33:".",34:":",35:"`"},i={0:"7",1:"8",2:"9",3:"4",4:"5",5:"6",6:"1",7:"2",8:"3",9:"0"},j={0:"1",1:"2",2:"3",3:"4",4:"5",5:"6",6:"7",7:"8",8:"9",9:"0"},k={All:"all",Keyboard:"keyboard",Numpad:"numpad"},l={Bottom:"bottom",Top:"top"},m=function(){var a={},b=!1,c=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(b=arguments[0],c++);for(var d=function(c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=b&&"[object Object]"===Object.prototype.toString.call(c[d])?m(a[d],c[d]):c[d])};c";return c},r=function(a,b){a||(a=25),b||(b="#707070");var c=" ";return c},s=function(a,b,c){a||(a=50),b||(a=25),c||(c="#707070");var d=" ";return d},t=function(a,b){a||(a=18),b||(b="#707070");var c="";return c};(function(){function b(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=a.document.createEvent("CustomEvent");return d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail),d}return"function"!=typeof a.Event&&void(b.prototype=a.Event.prototype,a.Event=b)})();var u=function(a,b){if(a.target===b)return!0;var c=b.querySelectorAll("*");if(c&&0w.length)return o("You called the KioskBoard with the \""+d+"\" selector, but there is no such element on the document."),!1}if("object"==typeof e&&0"+K+"",N=""+r(H,"#707070")+"",O=""+q(H,"#707070")+"",P=""+L+"",Q="",R="";if(y){var S=parseInt(H)||25;Q=""+s(2*S+"px",S+"px","#707070")+"";var T=A.keysSpecialCharsArrayOfStrings;for(var U in Array.isArray(T)&&0"+V.toString()+"";R+=W}}if(v===k.Numpad){var X=A.keysNumpadArrayOfNumbers;Array.isArray(X)&&10===X.length&&(i=X.reduce(function(a,b,c){return a[c]=b,a},{}));var Y="";for(var Z in i)if(Object.prototype.hasOwnProperty.call(i,Z)){var $=Z,_=i[Z],aa=""+_.toString()+"";Y+=aa}C+="
"+Y+O+P+"
"}if(v===k.Keyboard||v===k.All){if(v===k.All){var ba="";for(var ca in j)if(Object.prototype.hasOwnProperty.call(j,ca)){var da=j[ca],ea=""+da.toString()+"";ba+=ea}C+="
"+ba+"
"}for(var fa=0;fa"+ia.toString()+"";ga+=ja}C+="
"+ga+"
"}if(C+="
"+N+Q+M+P+O+"
",y){var ka=""+t("18px","#707070")+"",la="
"+R+"
";C+="
"+ka+la+"
"}}var ma=function(b){var c=a.document.createElement("div");return c.className="kioskboard-wrapper",c.innerHTML=b.trim(),c}(C),na=!0===A.cssAnimations,oa="no-animation",pa="no-animation",qa=0;na&&(oa="kioskboard-with-animation",pa="kioskboard-fade",qa="number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:360,"slide"===A.cssAnimationsStyle&&(pa="kioskboard-slide"));var ra="string"==typeof A.theme&&0=c)return!1;if(0=d)return!1;b.focus();var f=a.currentTarget.dataset.value||"";f=G?f.toLocaleUpperCase(z):f.toLocaleLowerCase(z);for(var g=f.split(""),h=0;hMath.round(2*(ya/3))){var Ba=a.document.querySelector(".kioskboard-wrapper");Ba.style.maxHeight=Math.round(4*(ya/5))+"px",Ba.style.overflowX="hidden",Ba.style.overflowY="auto",Ba.classList.add("kioskboard-overflow")}var Ca=x===l.Top,Da=(Ca?f.getBoundingClientRect().top:f.getBoundingClientRect().bottom)||0,Ea=a.document.documentElement.scrollTop||0,Fa=Math.round(Da+Ea),Ga=Fa.kioskboard-body-padding {padding-"+(Ga?"top":"bottom")+":"+Aa+"px !important;}",Ja=a.document.createRange();Ja.selectNode(a.document.head);var Ka=Ja.createContextualFragment(Ia);a.document.head.appendChild(Ka),a.document.body.classList.add("kioskboard-body-padding")}var La=!0===A.autoScroll;if(La){var Ma=Ca?20:50,Na=f.getBoundingClientRect().top||0,Oa=Math.round(Na+Ea),Pa=!0===A.cssAnimations?"smooth":"auto",Qa=!0===A.cssAnimations&&"number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:0,Ra=Oa-Ma-(Ca?Aa:0),Sa=a.navigator.userAgent.toLocaleLowerCase("en"),Ta=-1",31:",",32:";",33:".",34:":",35:"`"},i={0:"7",1:"8",2:"9",3:"4",4:"5",5:"6",6:"1",7:"2",8:"3",9:"0"},j={0:"1",1:"2",2:"3",3:"4",4:"5",5:"6",6:"7",7:"8",8:"9",9:"0"},k={All:"all",Keyboard:"keyboard",Numpad:"numpad"},l={Bottom:"bottom",Top:"top"},m=function(){var a={},b=!1,c=0;"[object Boolean]"===Object.prototype.toString.call(arguments[0])&&(b=arguments[0],c++);for(var d=function(c){for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(a[d]=b&&"[object Object]"===Object.prototype.toString.call(c[d])?m(a[d],c[d]):c[d])};c";return c},r=function(a,b){a||(a=25),b||(b="#707070");var c=" ";return c},s=function(a,b,c){a||(a=50),b||(a=25),c||(c="#707070");var d=" ";return d},t=function(a,b){a||(a=18),b||(b="#707070");var c="";return c};(function(){function b(b,c){c=c||{bubbles:!1,cancelable:!1,detail:void 0};var d=a.document.createEvent("CustomEvent");return d.initCustomEvent(b,c.bubbles,c.cancelable,c.detail),d}return"function"!=typeof a.Event&&void(b.prototype=a.Event.prototype,a.Event=b)})();var u=function(a,b){if(a.target===b)return!0;var c=b.querySelectorAll("*");if(c&&0w.length)return o("You called the KioskBoard with the \""+d+"\" selector, but there is no such element on the document."),!1}if("object"==typeof e&&0"+K+"",N=""+r(H,"#707070")+"",O=""+q(H,"#707070")+"",P=""+L+"",Q="",R="";if(y){var S=parseInt(H)||25;Q=""+s(2*S+"px",S+"px","#707070")+"";var T=A.keysSpecialCharsArrayOfStrings;for(var U in Array.isArray(T)&&0"+V.toString()+"";R+=W}}if(v===k.Numpad){var X=A.keysNumpadArrayOfNumbers;Array.isArray(X)&&10===X.length&&(i=X.reduce(function(a,b,c){return a[c]=b,a},{}));var Y="";for(var Z in i)if(Object.prototype.hasOwnProperty.call(i,Z)){var $=Z,_=i[Z],aa=""+_.toString()+"";Y+=aa}C+="
"+Y+O+P+"
"}if(v===k.Keyboard||v===k.All){if(v===k.All){var ba="";for(var ca in j)if(Object.prototype.hasOwnProperty.call(j,ca)){var da=j[ca],ea=""+da.toString()+"";ba+=ea}C+="
"+ba+"
"}for(var fa=0;fa"+ia.toString()+"";ga+=ja}C+="
"+ga+"
"}if(C+="
"+N+Q+M+P+O+"
",y){var ka=""+t("18px","#707070")+"",la="
"+R+"
";C+="
"+ka+la+"
"}}var ma=function(b){var c=a.document.createElement("div");return c.className="kioskboard-wrapper",c.innerHTML=b.trim(),c}(C),na=!0===A.cssAnimations,oa="no-animation",pa="no-animation",qa=0;na&&(oa="kioskboard-with-animation",pa="kioskboard-fade",qa="number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:360,"slide"===A.cssAnimationsStyle&&(pa="kioskboard-slide"));var ra="string"==typeof A.theme&&0=c)return!1;if(0=d)return!1;b.focus();var f=a.currentTarget.dataset.value||"";f=G?f.toLocaleUpperCase(z):f.toLocaleLowerCase(z);for(var g=f.split(""),h=0;hMath.round(2*(ya/3))){var Ba=a.document.querySelector(".kioskboard-wrapper");Ba.style.maxHeight=Math.round(4*(ya/5))+"px",Ba.style.overflowX="hidden",Ba.style.overflowY="auto",Ba.classList.add("kioskboard-overflow")}var Ca=x===l.Top,Da=(Ca?f.getBoundingClientRect().top:f.getBoundingClientRect().bottom)||0,Ea=a.document.documentElement.scrollTop||0,Fa=Math.round(Da+Ea),Ga=Fa.kioskboard-body-padding {padding-"+(Ga?"top":"bottom")+":"+Aa+"px !important;}",Ja=a.document.createRange();Ja.selectNode(a.document.head);var Ka=Ja.createContextualFragment(Ia);a.document.head.appendChild(Ka),a.document.body.classList.add("kioskboard-body-padding")}var La=!0===A.autoScroll;if(La){var Ma=Ca?20:50,Na=f.getBoundingClientRect().top||0,Oa=Math.round(Na+Ea),Pa=!0===A.cssAnimations?"smooth":"auto",Qa=!0===A.cssAnimations&&"number"==typeof A.cssAnimationsDuration?A.cssAnimationsDuration:0,Ra=Oa-Ma-(Ca?Aa:0),Sa=a.navigator.userAgent.toLocaleLowerCase("en"),Ta=-1