@ -13,32 +13,6 @@
( global = typeof globalThis !== 'undefined' ? globalThis : global || self , global . hotkeys = factory ( ) ) ;
( global = typeof globalThis !== 'undefined' ? globalThis : global || self , global . hotkeys = factory ( ) ) ;
} ) ( this , ( function ( ) { 'use strict' ;
} ) ( this , ( function ( ) { 'use strict' ;
function _toConsumableArray ( arr ) {
return _arrayWithoutHoles ( arr ) || _iterableToArray ( arr ) || _unsupportedIterableToArray ( arr ) || _nonIterableSpread ( ) ;
}
function _arrayWithoutHoles ( arr ) {
if ( Array . isArray ( arr ) ) return _arrayLikeToArray ( arr ) ;
}
function _iterableToArray ( iter ) {
if ( typeof Symbol !== "undefined" && iter [ Symbol . iterator ] != null || iter [ "@@iterator" ] != null ) return Array . from ( iter ) ;
}
function _unsupportedIterableToArray ( o , minLen ) {
if ( ! o ) return ;
if ( typeof o === "string" ) return _arrayLikeToArray ( o , minLen ) ;
var n = Object . prototype . toString . call ( o ) . slice ( 8 , - 1 ) ;
if ( n === "Object" && o . constructor ) n = o . constructor . name ;
if ( n === "Map" || n === "Set" ) return Array . from ( o ) ;
if ( n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ . test ( n ) ) return _arrayLikeToArray ( o , minLen ) ;
}
function _arrayLikeToArray ( arr , len ) {
if ( len == null || len > arr . length ) len = arr . length ;
for ( var i = 0 , arr2 = new Array ( len ) ; i < len ; i ++ ) arr2 [ i ] = arr [ i ] ;
return arr2 ;
}
function _nonIterableSpread ( ) {
throw new TypeError ( "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
}
var isff = typeof navigator !== 'undefined' ? navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) > 0 : false ;
var isff = typeof navigator !== 'undefined' ? navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) > 0 : false ;
// 绑定事件
// 绑定事件
@ -220,21 +194,24 @@
} ) ;
} ) ;
}
}
function getAllKeyCodes ( ) {
function getAllKeyCodes ( ) {
var _ref ;
var result = [ ] ;
return ( _ref = [ ] ) . concat . apply ( _ref , _toConsumableArray ( Object . values ( _handlers ) ) ) . map ( function ( _ref2 ) {
Object . keys ( _handlers ) . forEach ( function ( k ) {
var key = _ref2 . key ,
_handlers [ k ] . forEach ( function ( _ref ) {
scope = _ref2 . scope ,
var key = _ref . key ,
mods = _ref2 . mods ,
scope = _ref . scope ,
shortcut = _ref2 . shortcut ;
mods = _ref . mods ,
return {
shortcut = _ref . shortcut ;
result . push ( {
scope : scope ,
scope : scope ,
shortcut : shortcut ,
shortcut : shortcut ,
mods : mods ,
mods : mods ,
keys : key . split ( '+' ) . map ( function ( k ) {
keys : key . split ( '+' ) . map ( function ( v ) {
return code ( k ) ;
return code ( v ) ;
} )
} )
} ;
} ) ;
} ) ;
} ) ;
} ) ;
return result ;
}
}
// 表单控件控件判断 返回 Boolean
// 表单控件控件判断 返回 Boolean
@ -338,12 +315,12 @@
}
}
// 解除绑定某个范围的快捷键
// 解除绑定某个范围的快捷键
var eachUnbind = function eachUnbind ( _ref 3 ) {
var eachUnbind = function eachUnbind ( _ref 2 ) {
var key = _ref 3 . key ,
var key = _ref 2 . key ,
scope = _ref 3 . scope ,
scope = _ref 2 . scope ,
method = _ref 3 . method ,
method = _ref 2 . method ,
_ref 3$splitKey = _ref3 . splitKey ,
_ref 2$splitKey = _ref2 . splitKey ,
splitKey = _ref 3$splitKey === void 0 ? '+' : _ref3 $splitKey;
splitKey = _ref 2$splitKey === void 0 ? '+' : _ref2 $splitKey;
var multipleKeys = getKeys ( key ) ;
var multipleKeys = getKeys ( key ) ;
multipleKeys . forEach ( function ( originKey ) {
multipleKeys . forEach ( function ( originKey ) {
var unbindKeys = originKey . split ( splitKey ) ;
var unbindKeys = originKey . split ( splitKey ) ;