|
@@ -1,15 +1,15 @@
|
|
|
-/*! DataTables 1.10.16
|
|
|
- * ©2008-2017 SpryMedia Ltd - datatables.net/license
|
|
|
+/*! DataTables 1.10.19
|
|
|
+ * ©2008-2018 SpryMedia Ltd - datatables.net/license
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
* @summary DataTables
|
|
|
* @description Paginate, search and order HTML tables
|
|
|
- * @version 1.10.16
|
|
|
+ * @version 1.10.19
|
|
|
* @file jquery.dataTables.js
|
|
|
* @author SpryMedia Ltd
|
|
|
* @contact www.datatables.net
|
|
|
- * @copyright Copyright 2008-2017 SpryMedia Ltd.
|
|
|
+ * @copyright Copyright 2008-2018 SpryMedia Ltd.
|
|
|
*
|
|
|
* This source file is free software, available under the following license:
|
|
|
* MIT license - http://datatables.net/license
|
|
@@ -909,8 +909,11 @@
|
|
|
var s = allSettings[i];
|
|
|
|
|
|
/* Base check on table node */
|
|
|
- if ( s.nTable == this || s.nTHead.parentNode == this || (s.nTFoot && s.nTFoot.parentNode == this) )
|
|
|
- {
|
|
|
+ if (
|
|
|
+ s.nTable == this ||
|
|
|
+ (s.nTHead && s.nTHead.parentNode == this) ||
|
|
|
+ (s.nTFoot && s.nTFoot.parentNode == this)
|
|
|
+ ) {
|
|
|
var bRetrieve = oInit.bRetrieve !== undefined ? oInit.bRetrieve : defaults.bRetrieve;
|
|
|
var bDestroy = oInit.bDestroy !== undefined ? oInit.bDestroy : defaults.bDestroy;
|
|
|
|
|
@@ -967,11 +970,7 @@
|
|
|
|
|
|
// Backwards compatibility, before we apply all the defaults
|
|
|
_fnCompatOpts( oInit );
|
|
|
-
|
|
|
- if ( oInit.oLanguage )
|
|
|
- {
|
|
|
- _fnLanguageCompat( oInit.oLanguage );
|
|
|
- }
|
|
|
+ _fnLanguageCompat( oInit.oLanguage );
|
|
|
|
|
|
// If the length menu is given, but the init display length is not, use the length menu
|
|
|
if ( oInit.aLengthMenu && ! oInit.iDisplayLength )
|
|
@@ -1354,8 +1353,10 @@
|
|
|
// - fr - Swiss Franc
|
|
|
// - kr - Swedish krona, Norwegian krone and Danish krone
|
|
|
// - \u2009 is thin space and \u202F is narrow no-break space, both used in many
|
|
|
+ // - Ƀ - Bitcoin
|
|
|
+ // - Ξ - Ethereum
|
|
|
// standards as thousands separators.
|
|
|
- var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfk]/gi;
|
|
|
+ var _re_formatted_numeric = /[',$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi;
|
|
|
|
|
|
|
|
|
var _empty = function ( d ) {
|
|
@@ -1730,33 +1731,43 @@
|
|
|
*/
|
|
|
function _fnLanguageCompat( lang )
|
|
|
{
|
|
|
+ // Note the use of the Hungarian notation for the parameters in this method as
|
|
|
+ // this is called after the mapping of camelCase to Hungarian
|
|
|
var defaults = DataTable.defaults.oLanguage;
|
|
|
- var zeroRecords = lang.sZeroRecords;
|
|
|
|
|
|
- /* Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
|
|
- * sZeroRecords - assuming that is given.
|
|
|
- */
|
|
|
- if ( ! lang.sEmptyTable && zeroRecords &&
|
|
|
- defaults.sEmptyTable === "No data available in table" )
|
|
|
- {
|
|
|
- _fnMap( lang, lang, 'sZeroRecords', 'sEmptyTable' );
|
|
|
+ // Default mapping
|
|
|
+ var defaultDecimal = defaults.sDecimal;
|
|
|
+ if ( defaultDecimal ) {
|
|
|
+ _addNumericSort( defaultDecimal );
|
|
|
}
|
|
|
|
|
|
- /* Likewise with loading records */
|
|
|
- if ( ! lang.sLoadingRecords && zeroRecords &&
|
|
|
- defaults.sLoadingRecords === "Loading..." )
|
|
|
- {
|
|
|
- _fnMap( lang, lang, 'sZeroRecords', 'sLoadingRecords' );
|
|
|
- }
|
|
|
+ if ( lang ) {
|
|
|
+ var zeroRecords = lang.sZeroRecords;
|
|
|
|
|
|
- // Old parameter name of the thousands separator mapped onto the new
|
|
|
- if ( lang.sInfoThousands ) {
|
|
|
- lang.sThousands = lang.sInfoThousands;
|
|
|
- }
|
|
|
+ // Backwards compatibility - if there is no sEmptyTable given, then use the same as
|
|
|
+ // sZeroRecords - assuming that is given.
|
|
|
+ if ( ! lang.sEmptyTable && zeroRecords &&
|
|
|
+ defaults.sEmptyTable === "No data available in table" )
|
|
|
+ {
|
|
|
+ _fnMap( lang, lang, 'sZeroRecords', 'sEmptyTable' );
|
|
|
+ }
|
|
|
|
|
|
- var decimal = lang.sDecimal;
|
|
|
- if ( decimal ) {
|
|
|
- _addNumericSort( decimal );
|
|
|
+ // Likewise with loading records
|
|
|
+ if ( ! lang.sLoadingRecords && zeroRecords &&
|
|
|
+ defaults.sLoadingRecords === "Loading..." )
|
|
|
+ {
|
|
|
+ _fnMap( lang, lang, 'sZeroRecords', 'sLoadingRecords' );
|
|
|
+ }
|
|
|
+
|
|
|
+ // Old parameter name of the thousands separator mapped onto the new
|
|
|
+ if ( lang.sInfoThousands ) {
|
|
|
+ lang.sThousands = lang.sInfoThousands;
|
|
|
+ }
|
|
|
+
|
|
|
+ var decimal = lang.sDecimal;
|
|
|
+ if ( decimal && defaultDecimal !== decimal ) {
|
|
|
+ _addNumericSort( decimal );
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -3128,7 +3139,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [nTr, rowData, iRow] );
|
|
|
+ _fnCallbackFire( oSettings, 'aoRowCreatedCallback', null, [nTr, rowData, iRow, cells] );
|
|
|
}
|
|
|
|
|
|
// Remove once webkit bug 131819 and Chromium bug 365619 have been resolved
|
|
@@ -3453,7 +3464,7 @@
|
|
|
// iRowCount and j are not currently documented. Are they at all
|
|
|
// useful?
|
|
|
_fnCallbackFire( oSettings, 'aoRowCallback', null,
|
|
|
- [nRow, aoData._aData, iRowCount, j] );
|
|
|
+ [nRow, aoData._aData, iRowCount, j, iDataIndex] );
|
|
|
|
|
|
anRows.push( nRow );
|
|
|
iRowCount++;
|
|
@@ -3857,12 +3868,12 @@
|
|
|
{
|
|
|
ajaxData = ajax.data;
|
|
|
|
|
|
- var newData = $.isFunction( ajaxData ) ?
|
|
|
+ var newData = typeof ajaxData === 'function' ?
|
|
|
ajaxData( data, oSettings ) : // fn can manipulate data or return
|
|
|
ajaxData; // an object object or array to merge
|
|
|
|
|
|
// If the function returned something, use that alone
|
|
|
- data = $.isFunction( ajaxData ) && newData ?
|
|
|
+ data = typeof ajaxData === 'function' && newData ?
|
|
|
newData :
|
|
|
$.extend( true, data, newData );
|
|
|
|
|
@@ -3926,7 +3937,7 @@
|
|
|
url: ajax || oSettings.sAjaxSource
|
|
|
} ) );
|
|
|
}
|
|
|
- else if ( $.isFunction( ajax ) )
|
|
|
+ else if ( typeof ajax === 'function' )
|
|
|
{
|
|
|
// Is a function - let the caller define what needs to be done
|
|
|
oSettings.jqXHR = ajax.call( instance, data, callback, oSettings );
|
|
@@ -5360,14 +5371,18 @@
|
|
|
// both match, but we want to hide it completely. We want to also fix their
|
|
|
// width to what they currently are
|
|
|
_fnApplyToChildren( function(nSizer, i) {
|
|
|
- nSizer.innerHTML = '<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+headerContent[i]+'</div>';
|
|
|
+ nSizer.innerHTML = '<div class="dataTables_sizing">'+headerContent[i]+'</div>';
|
|
|
+ nSizer.childNodes[0].style.height = "0";
|
|
|
+ nSizer.childNodes[0].style.overflow = "hidden";
|
|
|
nSizer.style.width = headerWidths[i];
|
|
|
}, headerSrcEls );
|
|
|
|
|
|
if ( footer )
|
|
|
{
|
|
|
_fnApplyToChildren( function(nSizer, i) {
|
|
|
- nSizer.innerHTML = '<div class="dataTables_sizing" style="height:0;overflow:hidden;">'+footerContent[i]+'</div>';
|
|
|
+ nSizer.innerHTML = '<div class="dataTables_sizing">'+footerContent[i]+'</div>';
|
|
|
+ nSizer.childNodes[0].style.height = "0";
|
|
|
+ nSizer.childNodes[0].style.overflow = "hidden";
|
|
|
nSizer.style.width = footerWidths[i];
|
|
|
}, footerSrcEls );
|
|
|
}
|
|
@@ -6561,7 +6576,7 @@
|
|
|
{
|
|
|
$(n)
|
|
|
.on( 'click.DT', oData, function (e) {
|
|
|
- n.blur(); // Remove focus outline for mouse users
|
|
|
+ $(n).blur(); // Remove focus outline for mouse users
|
|
|
fn(e);
|
|
|
} )
|
|
|
.on( 'keypress.DT', oData, function (e){
|
|
@@ -7801,13 +7816,26 @@
|
|
|
}
|
|
|
}
|
|
|
else if ( order == 'current' || order == 'applied' ) {
|
|
|
- a = search == 'none' ?
|
|
|
- displayMaster.slice() : // no search
|
|
|
- search == 'applied' ?
|
|
|
- displayFiltered.slice() : // applied search
|
|
|
- $.map( displayMaster, function (el, i) { // removed search
|
|
|
- return $.inArray( el, displayFiltered ) === -1 ? el : null;
|
|
|
- } );
|
|
|
+ if ( search == 'none') {
|
|
|
+ a = displayMaster.slice();
|
|
|
+ }
|
|
|
+ else if ( search == 'applied' ) {
|
|
|
+ a = displayFiltered.slice();
|
|
|
+ }
|
|
|
+ else if ( search == 'removed' ) {
|
|
|
+ // O(n+m) solution by creating a hash map
|
|
|
+ var displayFilteredMap = {};
|
|
|
+
|
|
|
+ for ( var i=0, ien=displayFiltered.length ; i<ien ; i++ ) {
|
|
|
+ displayFilteredMap[displayFiltered[i]] = null;
|
|
|
+ }
|
|
|
+
|
|
|
+ a = $.map( displayMaster, function (el) {
|
|
|
+ return ! displayFilteredMap.hasOwnProperty(el) ?
|
|
|
+ el :
|
|
|
+ null;
|
|
|
+ } );
|
|
|
+ }
|
|
|
}
|
|
|
else if ( order == 'index' || order == 'original' ) {
|
|
|
for ( i=0, ien=settings.aoData.length ; i<ien ; i++ ) {
|
|
@@ -7840,14 +7868,13 @@
|
|
|
* {array} - jQuery array of nodes, or simply an array of TR nodes
|
|
|
*
|
|
|
*/
|
|
|
-
|
|
|
-
|
|
|
var __row_selector = function ( settings, selector, opts )
|
|
|
{
|
|
|
var rows;
|
|
|
var run = function ( sel ) {
|
|
|
var selInt = _intVal( sel );
|
|
|
var i, ien;
|
|
|
+ var aoData = settings.aoData;
|
|
|
|
|
|
// Short cut - selector is a number and no options provided (default is
|
|
|
// all records, so no need to check if the index is in there, since it
|
|
@@ -7872,23 +7899,26 @@
|
|
|
// Selector - function
|
|
|
if ( typeof sel === 'function' ) {
|
|
|
return $.map( rows, function (idx) {
|
|
|
- var row = settings.aoData[ idx ];
|
|
|
+ var row = aoData[ idx ];
|
|
|
return sel( idx, row._aData, row.nTr ) ? idx : null;
|
|
|
} );
|
|
|
}
|
|
|
|
|
|
- // Get nodes in the order from the `rows` array with null values removed
|
|
|
- var nodes = _removeEmpty(
|
|
|
- _pluck_order( settings.aoData, rows, 'nTr' )
|
|
|
- );
|
|
|
-
|
|
|
// Selector - node
|
|
|
if ( sel.nodeName ) {
|
|
|
- if ( sel._DT_RowIndex !== undefined ) {
|
|
|
- return [ sel._DT_RowIndex ]; // Property added by DT for fast lookup
|
|
|
+ var rowIdx = sel._DT_RowIndex; // Property added by DT for fast lookup
|
|
|
+ var cellIdx = sel._DT_CellIndex;
|
|
|
+
|
|
|
+ if ( rowIdx !== undefined ) {
|
|
|
+ // Make sure that the row is actually still present in the table
|
|
|
+ return aoData[ rowIdx ] && aoData[ rowIdx ].nTr === sel ?
|
|
|
+ [ rowIdx ] :
|
|
|
+ [];
|
|
|
}
|
|
|
- else if ( sel._DT_CellIndex ) {
|
|
|
- return [ sel._DT_CellIndex.row ];
|
|
|
+ else if ( cellIdx ) {
|
|
|
+ return aoData[ cellIdx.row ] && aoData[ cellIdx.row ].nTr === sel ?
|
|
|
+ [ cellIdx.row ] :
|
|
|
+ [];
|
|
|
}
|
|
|
else {
|
|
|
var host = $(sel).closest('*[data-dt-row]');
|
|
@@ -7917,6 +7947,11 @@
|
|
|
// need to fall through to jQuery in case there is DOM id that
|
|
|
// matches
|
|
|
}
|
|
|
+
|
|
|
+ // Get nodes in the order from the `rows` array with null values removed
|
|
|
+ var nodes = _removeEmpty(
|
|
|
+ _pluck_order( settings.aoData, rows, 'nTr' )
|
|
|
+ );
|
|
|
|
|
|
// Selector - jQuery selector string, array of nodes or jQuery object/
|
|
|
// As jQuery's .filter() allows jQuery objects to be passed in filter,
|
|
@@ -8111,7 +8146,13 @@
|
|
|
}
|
|
|
|
|
|
// Set
|
|
|
- ctx[0].aoData[ this[0] ]._aData = data;
|
|
|
+ var row = ctx[0].aoData[ this[0] ];
|
|
|
+ row._aData = data;
|
|
|
+
|
|
|
+ // If the DOM has an id, and the data source is an array
|
|
|
+ if ( $.isArray( data ) && row.nTr.id ) {
|
|
|
+ _fnSetObjectDataFn( ctx[0].rowId )( data, row.nTr.id );
|
|
|
+ }
|
|
|
|
|
|
// Automatically invalidate
|
|
|
_fnInvalidate( ctx[0], this[0], 'data' );
|
|
@@ -8537,6 +8578,12 @@
|
|
|
_fnDrawHead( settings, settings.aoHeader );
|
|
|
_fnDrawHead( settings, settings.aoFooter );
|
|
|
|
|
|
+ // Update colspan for no records display. Child rows and extensions will use their own
|
|
|
+ // listeners to do this - only need to update the empty table item here
|
|
|
+ if ( ! settings.aiDisplay.length ) {
|
|
|
+ $(settings.nTBody).find('td[colspan]').attr('colspan', _fnVisbleColumns(settings));
|
|
|
+ }
|
|
|
+
|
|
|
_fnSaveState( settings );
|
|
|
};
|
|
|
|
|
@@ -8702,7 +8749,10 @@
|
|
|
|
|
|
// Selector - index
|
|
|
if ( $.isPlainObject( s ) ) {
|
|
|
- return [s];
|
|
|
+ // Valid cell index and its in the array of selectable rows
|
|
|
+ return s.column !== undefined && s.row !== undefined && $.inArray( s.row, rows ) !== -1 ?
|
|
|
+ [s] :
|
|
|
+ [];
|
|
|
}
|
|
|
|
|
|
// Selector - jQuery filtered cells
|
|
@@ -8766,11 +8816,11 @@
|
|
|
}
|
|
|
|
|
|
// Row + column selector
|
|
|
- var columns = this.columns( columnSelector, opts );
|
|
|
- var rows = this.rows( rowSelector, opts );
|
|
|
+ var columns = this.columns( columnSelector );
|
|
|
+ var rows = this.rows( rowSelector );
|
|
|
var a, i, ien, j, jen;
|
|
|
|
|
|
- var cells = this.iterator( 'table', function ( settings, idx ) {
|
|
|
+ this.iterator( 'table', function ( settings, idx ) {
|
|
|
a = [];
|
|
|
|
|
|
for ( i=0, ien=rows[idx].length ; i<ien ; i++ ) {
|
|
@@ -8781,10 +8831,11 @@
|
|
|
} );
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- return a;
|
|
|
}, 1 );
|
|
|
|
|
|
+ // Now pass through the cell selector for options
|
|
|
+ var cells = this.cells( a, opts );
|
|
|
+
|
|
|
$.extend( cells.selector, {
|
|
|
cols: columnSelector,
|
|
|
rows: rowSelector,
|
|
@@ -9412,7 +9463,7 @@
|
|
|
* @type string
|
|
|
* @default Version number
|
|
|
*/
|
|
|
- DataTable.version = "1.10.16";
|
|
|
+ DataTable.version = "1.10.19";
|
|
|
|
|
|
/**
|
|
|
* Private data store, containing all of the settings objects that are
|
|
@@ -12350,8 +12401,8 @@
|
|
|
* { "data": "engine" },
|
|
|
* { "data": "browser" },
|
|
|
* { "data": "platform.inner" },
|
|
|
- * { "data": "platform.details.0" },
|
|
|
- * { "data": "platform.details.1" }
|
|
|
+ * { "data": "details.0" },
|
|
|
+ * { "data": "details.1" }
|
|
|
* ]
|
|
|
* } );
|
|
|
* } );
|
|
@@ -14148,7 +14199,7 @@
|
|
|
* $.fn.dataTable.ext.type.detect.push(
|
|
|
* function ( data, settings ) {
|
|
|
* // Check the numeric part
|
|
|
- * if ( ! $.isNumeric( data.substring(1) ) ) {
|
|
|
+ * if ( ! data.substring(1).match(/[0-9]/) ) {
|
|
|
* return null;
|
|
|
* }
|
|
|
*
|
|
@@ -14731,7 +14782,8 @@
|
|
|
$.extend( _ext.type.order, {
|
|
|
// Dates
|
|
|
"date-pre": function ( d ) {
|
|
|
- return Date.parse( d ) || -Infinity;
|
|
|
+ var ts = Date.parse( d );
|
|
|
+ return isNaN(ts) ? -Infinity : ts;
|
|
|
},
|
|
|
|
|
|
// html
|
|
@@ -14922,7 +14974,8 @@
|
|
|
|
|
|
text: function () {
|
|
|
return {
|
|
|
- display: __htmlEscapeEntities
|
|
|
+ display: __htmlEscapeEntities,
|
|
|
+ filter: __htmlEscapeEntities
|
|
|
};
|
|
|
}
|
|
|
};
|
|
@@ -15047,6 +15100,7 @@
|
|
|
_fnRenderer: _fnRenderer,
|
|
|
_fnDataSource: _fnDataSource,
|
|
|
_fnRowAttributes: _fnRowAttributes,
|
|
|
+ _fnExtend: _fnExtend,
|
|
|
_fnCalculateEnd: function () {} // Used by a lot of plug-ins, but redundant
|
|
|
// in 1.10, so this dead-end function is
|
|
|
// added to prevent errors
|