Comparing version 0.7.0 to 0.7.1
@@ -24,3 +24,3 @@ import Component from "@egjs/component"; | ||
clear: () => this; | ||
destory(): void; | ||
destroy(): void; | ||
keydown(comb: string | string[], callback: (e: KeyControllerEvent) => void): this; | ||
@@ -27,0 +27,0 @@ keydown(callback: (e: KeyControllerEvent) => void): this; |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/keycon.git | ||
version: 0.7.0 | ||
version: 0.7.1 | ||
*/ | ||
@@ -245,3 +245,3 @@ import Component from '@egjs/component'; | ||
repository: https://github.com/daybrush/utils | ||
@version 0.10.0 | ||
@version 0.10.1 | ||
*/ | ||
@@ -458,3 +458,3 @@ /** | ||
__proto.destory = function () { | ||
__proto.destroy = function () { | ||
var container = this.container; | ||
@@ -461,0 +461,0 @@ this.clear(); |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/keycon.git | ||
version: 0.7.0 | ||
version: 0.7.1 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@egjs/component"),require("@daybrush/utils")):"function"==typeof define&&define.amd?define(["@egjs/component","@daybrush/utils"],t):(e=e||self).keycon=t(e.eg.Component,e.utils)}(this,function(e,r){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var t,i,n=(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var s in i)o[s]=i[s]}(t={exports:{}},t.exports),t.exports),a=(n.code,n.codes,n.aliases,n.names),s=(n.title,{"+":"plus","left command":"meta","right command":"meta"}),u={shift:1,ctrl:2,alt:3,meta:4};function c(e){var t=a[e]||"";for(var n in s)t=t.replace(n,s[n]);return t.replace(/\s/g,"")}function f(e,t){void 0===t&&(t=c(e.keyCode));var n=[e.shiftKey&&"shift",e.ctrlKey&&"ctrl",e.altKey&&"alt",e.metaKey&&"meta"];return-1===n.indexOf(t)&&n.push(t),n.filter(Boolean)}function y(e){var t=e.slice();return t.sort(function(e,t){return(u[e]||5)-(u[t]||5)}),t}var l=function(n){function e(e){void 0===e&&(e=window);var t=n.call(this)||this;return t.container=e,t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t.clear=function(){return t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t},t.keydownEvent=function(e){t.triggerEvent("keydown",e)},t.keyupEvent=function(e){t.triggerEvent("keyup",e)},r.addEvent(e,"blur",t.clear),r.addEvent(e,"keydown",t.keydownEvent),r.addEvent(e,"keyup",t.keyupEvent),t}!function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(e,n);var t=e.prototype;return Object.defineProperty(e,"global",{get:function(){return i=i||new e},enumerable:!0,configurable:!0}),e.setGlobal=function(){return this.global},t.destory=function(){var e=this.container;this.clear(),this.off(),r.removeEvent(e,"blur",this.clear),r.removeEvent(e,"keydown",this.keydownEvent),r.removeEvent(e,"keyup",this.keyupEvent)},t.keydown=function(e,t){return this.addEvent("keydown",e,t)},t.offKeydown=function(e,t){return this.removeEvent("keydown",e,t)},t.offKeyup=function(e,t){return this.removeEvent("keyup",e,t)},t.keyup=function(e,t){return this.addEvent("keyup",e,t)},t.addEvent=function(e,t,n){return r.isArray(t)?this.on(e+"."+y(t).join("."),n):r.isString(t)?this.on(e+"."+t,n):this.on(e,t),this},t.removeEvent=function(e,t,n){return r.isArray(t)?this.off(e+"."+y(t).join("."),n):r.isString(t)?this.off(e+"."+t,n):this.off(e,t),this},t.triggerEvent=function(e,t){this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey;var n=c(t.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:t,keyCode:t.keyCode,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey};this.trigger(e,r),this.trigger(e+"."+n,r);var o=f(t,n);1<o.length&&this.trigger(e+"."+o.join("."),r)},e}(e);return l.getKey=c,l.getCombi=f,l}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("@egjs/component"),require("@daybrush/utils")):"function"==typeof define&&define.amd?define(["@egjs/component","@daybrush/utils"],t):(e=e||self).keycon=t(e.eg.Component,e.utils)}(this,function(e,r){"use strict";var o=function(e,t){return(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};var t,i,n=(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var s in i)o[s]=i[s]}(t={exports:{}},t.exports),t.exports),a=(n.code,n.codes,n.aliases,n.names),s=(n.title,{"+":"plus","left command":"meta","right command":"meta"}),u={shift:1,ctrl:2,alt:3,meta:4};function c(e){var t=a[e]||"";for(var n in s)t=t.replace(n,s[n]);return t.replace(/\s/g,"")}function f(e,t){void 0===t&&(t=c(e.keyCode));var n=[e.shiftKey&&"shift",e.ctrlKey&&"ctrl",e.altKey&&"alt",e.metaKey&&"meta"];return-1===n.indexOf(t)&&n.push(t),n.filter(Boolean)}function y(e){var t=e.slice();return t.sort(function(e,t){return(u[e]||5)-(u[t]||5)}),t}var l=function(n){function e(e){void 0===e&&(e=window);var t=n.call(this)||this;return t.container=e,t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t.clear=function(){return t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t},t.keydownEvent=function(e){t.triggerEvent("keydown",e)},t.keyupEvent=function(e){t.triggerEvent("keyup",e)},r.addEvent(e,"blur",t.clear),r.addEvent(e,"keydown",t.keydownEvent),r.addEvent(e,"keyup",t.keyupEvent),t}!function(e,t){function n(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(e,n);var t=e.prototype;return Object.defineProperty(e,"global",{get:function(){return i=i||new e},enumerable:!0,configurable:!0}),e.setGlobal=function(){return this.global},t.destroy=function(){var e=this.container;this.clear(),this.off(),r.removeEvent(e,"blur",this.clear),r.removeEvent(e,"keydown",this.keydownEvent),r.removeEvent(e,"keyup",this.keyupEvent)},t.keydown=function(e,t){return this.addEvent("keydown",e,t)},t.offKeydown=function(e,t){return this.removeEvent("keydown",e,t)},t.offKeyup=function(e,t){return this.removeEvent("keyup",e,t)},t.keyup=function(e,t){return this.addEvent("keyup",e,t)},t.addEvent=function(e,t,n){return r.isArray(t)?this.on(e+"."+y(t).join("."),n):r.isString(t)?this.on(e+"."+t,n):this.on(e,t),this},t.removeEvent=function(e,t,n){return r.isArray(t)?this.off(e+"."+y(t).join("."),n):r.isString(t)?this.off(e+"."+t,n):this.off(e,t),this},t.triggerEvent=function(e,t){this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey;var n=c(t.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:t,keyCode:t.keyCode,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey};this.trigger(e,r),this.trigger(e+"."+n,r);var o=f(t,n);1<o.length&&this.trigger(e+"."+o.join("."),r)},e}(e);return l.getKey=c,l.getCombi=f,l}); | ||
//# sourceMappingURL=keycon.js.map |
@@ -7,3 +7,3 @@ /* | ||
repository: git+https://github.com/daybrush/keycon.git | ||
version: 0.7.0 | ||
version: 0.7.1 | ||
*/ | ||
@@ -539,3 +539,3 @@ (function (global, factory) { | ||
repository: https://github.com/daybrush/utils | ||
@version 0.10.0 | ||
@version 0.10.1 | ||
*/ | ||
@@ -752,3 +752,3 @@ /** | ||
__proto.destory = function () { | ||
__proto.destroy = function () { | ||
var container = this.container; | ||
@@ -755,0 +755,0 @@ this.clear(); |
@@ -7,5 +7,5 @@ /* | ||
repository: git+https://github.com/daybrush/keycon.git | ||
version: 0.7.0 | ||
version: 0.7.1 | ||
*/ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).keycon=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function f(e){return void 0===e}var e=function(){var e=function(){function e(){this._eventHandler={},this.options={}}var t=e.prototype;return t.trigger=function(e,t){void 0===t&&(t={});var n=this._eventHandler[e]||[];if(!(0<n.length))return!0;n=n.concat(),t.eventType=e;var r=!1,o=[t],i=0;t.stop=function(){r=!0},t.currentTarget=this;for(var a=arguments.length,f=new Array(2<a?a-2:0),u=2;u<a;u++)f[u-2]=arguments[u];for(1<=f.length&&(o=o.concat(f)),i=0;n[i];i++)n[i].apply(this,o);return!r},t.once=function(o,i){if("object"==typeof o&&f(i)){var e,t=o;for(e in t)this.once(e,t[e]);return this}if("string"==typeof o&&"function"==typeof i){var a=this;this.on(o,function e(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.apply(a,n),a.off(o,e)})}return this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&f(t)){var n,r=e;for(n in r)this.on(n,r[n]);return this}if("string"==typeof e&&"function"==typeof t){var o=this._eventHandler[e];f(o)&&(this._eventHandler[e]=[],o=this._eventHandler[e]),o.push(t)}return this},t.off=function(e,t){if(f(e))return this._eventHandler={},this;if(f(t)){if("string"==typeof e)return this._eventHandler[e]=void 0,this;var n,r=e;for(n in r)this.off(n,r[n]);return this}var o,i,a=this._eventHandler[e];if(a)for(o=0;void 0!==(i=a[o]);o++)if(i===t){a=a.splice(o,1);break}return this},e}();return e.VERSION="2.1.2",e}();var t,n=(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var f in i)o[f]=i[f]}(t={exports:{}},t.exports),t.exports),o=(n.code,n.codes,n.aliases,n.names);n.title;function i(e){return Array.isArray(e)}function a(e){return"string"==typeof e}function u(e,t,n,r){e.addEventListener(t,n,r)}function s(e,t,n){e.removeEventListener(t,n)}var c,y={"+":"plus","left command":"meta","right command":"meta"},l={shift:1,ctrl:2,alt:3,meta:4};function h(e){var t=o[e]||"";for(var n in y)t=t.replace(n,y[n]);return t.replace(/\s/g,"")}function p(e,t){void 0===t&&(t=h(e.keyCode));var n=[e.shiftKey&&"shift",e.ctrlKey&&"ctrl",e.altKey&&"alt",e.metaKey&&"meta"];return-1===n.indexOf(t)&&n.push(t),n.filter(Boolean)}function d(e){var t=e.slice();return t.sort(function(e,t){return(l[e]||5)-(l[t]||5)}),t}var v=function(n){function e(e){void 0===e&&(e=window);var t=n.call(this)||this;return t.container=e,t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t.clear=function(){return t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t},t.keydownEvent=function(e){t.triggerEvent("keydown",e)},t.keyupEvent=function(e){t.triggerEvent("keyup",e)},u(e,"blur",t.clear),u(e,"keydown",t.keydownEvent),u(e,"keyup",t.keyupEvent),t}!function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(e,n);var t=e.prototype;return Object.defineProperty(e,"global",{get:function(){return c=c||new e},enumerable:!0,configurable:!0}),e.setGlobal=function(){return this.global},t.destory=function(){var e=this.container;this.clear(),this.off(),s(e,"blur",this.clear),s(e,"keydown",this.keydownEvent),s(e,"keyup",this.keyupEvent)},t.keydown=function(e,t){return this.addEvent("keydown",e,t)},t.offKeydown=function(e,t){return this.removeEvent("keydown",e,t)},t.offKeyup=function(e,t){return this.removeEvent("keyup",e,t)},t.keyup=function(e,t){return this.addEvent("keyup",e,t)},t.addEvent=function(e,t,n){return i(t)?this.on(e+"."+d(t).join("."),n):a(t)?this.on(e+"."+t,n):this.on(e,t),this},t.removeEvent=function(e,t,n){return i(t)?this.off(e+"."+d(t).join("."),n):a(t)?this.off(e+"."+t,n):this.off(e,t),this},t.triggerEvent=function(e,t){this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey;var n=h(t.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:t,keyCode:t.keyCode,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey};this.trigger(e,r),this.trigger(e+"."+n,r);var o=p(t,n);1<o.length&&this.trigger(e+"."+o.join("."),r)},e}(e);return v.getKey=h,v.getCombi=p,v}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).keycon=t()}(this,function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)};function f(e){return void 0===e}var e=function(){var e=function(){function e(){this._eventHandler={},this.options={}}var t=e.prototype;return t.trigger=function(e,t){void 0===t&&(t={});var n=this._eventHandler[e]||[];if(!(0<n.length))return!0;n=n.concat(),t.eventType=e;var r=!1,o=[t],i=0;t.stop=function(){r=!0},t.currentTarget=this;for(var a=arguments.length,f=new Array(2<a?a-2:0),u=2;u<a;u++)f[u-2]=arguments[u];for(1<=f.length&&(o=o.concat(f)),i=0;n[i];i++)n[i].apply(this,o);return!r},t.once=function(o,i){if("object"==typeof o&&f(i)){var e,t=o;for(e in t)this.once(e,t[e]);return this}if("string"==typeof o&&"function"==typeof i){var a=this;this.on(o,function e(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];i.apply(a,n),a.off(o,e)})}return this},t.hasOn=function(e){return!!this._eventHandler[e]},t.on=function(e,t){if("object"==typeof e&&f(t)){var n,r=e;for(n in r)this.on(n,r[n]);return this}if("string"==typeof e&&"function"==typeof t){var o=this._eventHandler[e];f(o)&&(this._eventHandler[e]=[],o=this._eventHandler[e]),o.push(t)}return this},t.off=function(e,t){if(f(e))return this._eventHandler={},this;if(f(t)){if("string"==typeof e)return this._eventHandler[e]=void 0,this;var n,r=e;for(n in r)this.off(n,r[n]);return this}var o,i,a=this._eventHandler[e];if(a)for(o=0;void 0!==(i=a[o]);o++)if(i===t){a=a.splice(o,1);break}return this},e}();return e.VERSION="2.1.2",e}();var t,n=(function(e,t){function n(e){if(e&&"object"==typeof e){var t=e.which||e.keyCode||e.charCode;t&&(e=t)}if("number"==typeof e)return a[e];var n,r=String(e);return(n=o[r.toLowerCase()])?n:(n=i[r.toLowerCase()])||(1===r.length?r.charCodeAt(0):void 0)}n.isEventKey=function(e,t){if(e&&"object"==typeof e){var n=e.which||e.keyCode||e.charCode;if(null==n)return!1;if("string"==typeof t){var r;if(r=o[t.toLowerCase()])return r===n;if(r=i[t.toLowerCase()])return r===n}else if("number"==typeof t)return t===n;return!1}};var o=(t=e.exports=n).code=t.codes={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,"pause/break":19,"caps lock":20,esc:27,space:32,"page up":33,"page down":34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,command:91,"left command":91,"right command":93,"numpad *":106,"numpad +":107,"numpad -":109,"numpad .":110,"numpad /":111,"num lock":144,"scroll lock":145,"my computer":182,"my calculator":183,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222},i=t.aliases={windows:91,"⇧":16,"⌥":18,"⌃":17,"⌘":91,ctl:17,control:17,option:18,pause:19,break:19,caps:20,return:13,escape:27,spc:32,spacebar:32,pgup:33,pgdn:34,ins:45,del:46,cmd:91};for(r=97;r<123;r++)o[String.fromCharCode(r)]=r-32;for(var r=48;r<58;r++)o[r-48]=r;for(r=1;r<13;r++)o["f"+r]=r+111;for(r=0;r<10;r++)o["numpad "+r]=r+96;var a=t.names=t.title={};for(r in o)a[o[r]]=r;for(var f in i)o[f]=i[f]}(t={exports:{}},t.exports),t.exports),o=(n.code,n.codes,n.aliases,n.names);n.title;function i(e){return Array.isArray(e)}function a(e){return"string"==typeof e}function u(e,t,n,r){e.addEventListener(t,n,r)}function s(e,t,n){e.removeEventListener(t,n)}var c,y={"+":"plus","left command":"meta","right command":"meta"},l={shift:1,ctrl:2,alt:3,meta:4};function h(e){var t=o[e]||"";for(var n in y)t=t.replace(n,y[n]);return t.replace(/\s/g,"")}function p(e,t){void 0===t&&(t=h(e.keyCode));var n=[e.shiftKey&&"shift",e.ctrlKey&&"ctrl",e.altKey&&"alt",e.metaKey&&"meta"];return-1===n.indexOf(t)&&n.push(t),n.filter(Boolean)}function d(e){var t=e.slice();return t.sort(function(e,t){return(l[e]||5)-(l[t]||5)}),t}var v=function(n){function e(e){void 0===e&&(e=window);var t=n.call(this)||this;return t.container=e,t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t.clear=function(){return t.ctrlKey=!1,t.altKey=!1,t.shiftKey=!1,t.metaKey=!1,t},t.keydownEvent=function(e){t.triggerEvent("keydown",e)},t.keyupEvent=function(e){t.triggerEvent("keyup",e)},u(e,"blur",t.clear),u(e,"keydown",t.keydownEvent),u(e,"keyup",t.keyupEvent),t}!function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(e,n);var t=e.prototype;return Object.defineProperty(e,"global",{get:function(){return c=c||new e},enumerable:!0,configurable:!0}),e.setGlobal=function(){return this.global},t.destroy=function(){var e=this.container;this.clear(),this.off(),s(e,"blur",this.clear),s(e,"keydown",this.keydownEvent),s(e,"keyup",this.keyupEvent)},t.keydown=function(e,t){return this.addEvent("keydown",e,t)},t.offKeydown=function(e,t){return this.removeEvent("keydown",e,t)},t.offKeyup=function(e,t){return this.removeEvent("keyup",e,t)},t.keyup=function(e,t){return this.addEvent("keyup",e,t)},t.addEvent=function(e,t,n){return i(t)?this.on(e+"."+d(t).join("."),n):a(t)?this.on(e+"."+t,n):this.on(e,t),this},t.removeEvent=function(e,t,n){return i(t)?this.off(e+"."+d(t).join("."),n):a(t)?this.off(e+"."+t,n):this.off(e,t),this},t.triggerEvent=function(e,t){this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey;var n=h(t.keyCode),r={key:n,isToggle:"ctrl"===n||"shift"===n||"meta"===n||"alt"===n,inputEvent:t,keyCode:t.keyCode,ctrlKey:t.ctrlKey,altKey:t.altKey,shiftKey:t.shiftKey,metaKey:t.metaKey};this.trigger(e,r),this.trigger(e+"."+n,r);var o=p(t,n);1<o.length&&this.trigger(e+"."+o.join("."),r)},e}(e);return v.getKey=h,v.getCombi=p,v}); | ||
//# sourceMappingURL=keycon.pkgd.min.js.map |
{ | ||
"name": "keycon", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Keyboard Controller", | ||
@@ -21,4 +21,4 @@ "main": "./dist/keycon.js", | ||
"doc": "rm -rf ./doc && jsdoc -c jsdoc.json", | ||
"release": "npm run build && release --dirs dist,doc", | ||
"release:init": "npm run build && release -i --dirs dist,doc" | ||
"release": "npm run build && npm run doc && release --dirs dist,doc", | ||
"release:init": "npm run build && npm run doc && release -i --dirs dist,doc" | ||
}, | ||
@@ -36,3 +36,3 @@ "repository": { | ||
"dependencies": { | ||
"@daybrush/utils": "^0.10.0", | ||
"@daybrush/utils": "^0.10.1", | ||
"@egjs/component": "^2.1.2", | ||
@@ -39,0 +39,0 @@ "keycode": "^2.2.0" |
@@ -110,3 +110,3 @@ import Component from "@egjs/component"; | ||
*/ | ||
public destory() { | ||
public destroy() { | ||
const container = this.container as any; | ||
@@ -113,0 +113,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
106153
Updated@daybrush/utils@^0.10.1