datatables.net-keytable
Advanced tools
Comparing version 2.5.3 to 2.6.0
@@ -1,3 +0,3 @@ | ||
/*! KeyTable 2.5.3 | ||
* ©2009-2020 SpryMedia Ltd - datatables.net/license | ||
/*! KeyTable 2.6.0 | ||
* ©2009-2021 SpryMedia Ltd - datatables.net/license | ||
*/ | ||
@@ -8,7 +8,7 @@ | ||
* @description Spreadsheet like keyboard navigation for DataTables | ||
* @version 2.5.3 | ||
* @version 2.6.0 | ||
* @file dataTables.keyTable.js | ||
* @author SpryMedia Ltd (www.sprymedia.co.uk) | ||
* @contact www.sprymedia.co.uk/contact | ||
* @copyright Copyright 2009-2020 SpryMedia Ltd. | ||
* @copyright Copyright 2009-2021 SpryMedia Ltd. | ||
* | ||
@@ -136,2 +136,9 @@ * This source file is free software, available under the following license: | ||
/** | ||
* Get enable status | ||
*/ | ||
enabled: function () { | ||
return this.s.enable; | ||
}, | ||
/** | ||
* Focus on a cell | ||
@@ -229,3 +236,6 @@ * @param {integer} row Row index | ||
// Or an Editor date input | ||
if ( $(e.target).parents('div.editor-datetime').length ) { | ||
if ( | ||
$(e.target).parents('div.editor-datetime').length || | ||
$(e.target).parents('div.dt-datetime').length | ||
) { | ||
return; | ||
@@ -519,2 +529,7 @@ } | ||
// DataTables draw event | ||
if (orig.type === 'draw') { | ||
return; | ||
} | ||
var that = this; | ||
@@ -594,2 +609,6 @@ var dt = this.s.dt; | ||
$( dt.table().container() ).removeClass('dtk-focus-alt'); | ||
if (that.s.returnSubmit) { | ||
that._emitEvent( 'key-return-submit', [dt, editCell] ); | ||
} | ||
} ); | ||
@@ -786,2 +805,6 @@ } ) | ||
var enable = this.s.enable; | ||
this.s.returnSubmit = (enable === 'navigation-only' || enable === 'tab-only') && e.keyCode === 13 | ||
? true | ||
: false; | ||
var navEnable = enable === true || enable === 'navigation-only'; | ||
@@ -970,9 +993,13 @@ if ( ! enable ) { | ||
{ | ||
var that = this; | ||
var dt = this.s.dt; | ||
var pageInfo = dt.page.info(); | ||
var rows = pageInfo.recordsDisplay; | ||
var currentCell = this.s.lastFocus.cell; | ||
var columns = this._columns(); | ||
var that = this; | ||
var dt = this.s.dt; | ||
var pageInfo = dt.page.info(); | ||
var rows = pageInfo.recordsDisplay; | ||
var columns = this._columns(); | ||
var last = this.s.lastFocus; | ||
if ( ! last ) { | ||
return; | ||
} | ||
var currentCell = last.cell; | ||
if ( ! currentCell ) { | ||
@@ -1190,3 +1217,3 @@ return; | ||
KeyTable.version = "2.5.3"; | ||
KeyTable.version = "2.6.0"; | ||
@@ -1230,2 +1257,14 @@ | ||
DataTable.Api.register( 'keys.enabled()', function ( opts ) { | ||
let ctx = this.context; | ||
if (ctx.length) { | ||
return ctx[0].keytable | ||
? ctx[0].keytable.enabled() | ||
: false; | ||
} | ||
return false; | ||
} ); | ||
DataTable.Api.register( 'keys.move()', function ( dir ) { | ||
@@ -1232,0 +1271,0 @@ return this.iterator( 'table', function (ctx) { |
{ | ||
"name": "datatables.net-keytable", | ||
"version": "2.5.3", | ||
"version": "2.6.0", | ||
"description": "KeyTable for DataTables ", | ||
@@ -9,2 +9,3 @@ "files": [ | ||
"main": "js/dataTables.keyTable.js", | ||
"type": "types.d.ts", | ||
"keywords": [ | ||
@@ -33,3 +34,6 @@ "spreadsheet", | ||
"url": "https://github.com/DataTables/Dist-DataTables-KeyTable.git" | ||
}, | ||
"devDependencies": { | ||
"@types/jquery": "^3.5.1" | ||
} | ||
} |
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
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
0
35285
1
1089