datatables.net 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/dataTables.js +85 -27
- package/js/dataTables.min.js +2 -2
- package/js/dataTables.min.mjs +2 -2
- package/js/dataTables.mjs +84 -26
- package/package.json +1 -1
package/js/dataTables.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/*! DataTables 2.1.
|
|
1
|
+
/*! DataTables 2.1.5
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @summary DataTables
|
|
7
7
|
* @description Paginate, search and order HTML tables
|
|
8
|
-
* @version 2.1.
|
|
8
|
+
* @version 2.1.5
|
|
9
9
|
* @author SpryMedia Ltd
|
|
10
10
|
* @contact www.datatables.net
|
|
11
11
|
* @copyright SpryMedia Ltd.
|
|
@@ -1053,7 +1053,8 @@
|
|
|
1053
1053
|
active: 'current',
|
|
1054
1054
|
button: 'dt-paging-button',
|
|
1055
1055
|
container: 'dt-paging',
|
|
1056
|
-
disabled: 'disabled'
|
|
1056
|
+
disabled: 'disabled',
|
|
1057
|
+
nav: ''
|
|
1057
1058
|
}
|
|
1058
1059
|
} );
|
|
1059
1060
|
|
|
@@ -2155,7 +2156,11 @@
|
|
|
2155
2156
|
for (var i=0 ; i<cols.length ; i++) {
|
|
2156
2157
|
var width = _fnColumnsSumWidth(settings, [i], false, false);
|
|
2157
2158
|
|
|
2158
|
-
|
|
2159
|
+
// Need to set the min-width, otherwise the browser might try to collapse
|
|
2160
|
+
// it further
|
|
2161
|
+
cols[i].colEl
|
|
2162
|
+
.css('width', width)
|
|
2163
|
+
.css('min-width', width);
|
|
2159
2164
|
}
|
|
2160
2165
|
}
|
|
2161
2166
|
|
|
@@ -3121,6 +3126,9 @@
|
|
|
3121
3126
|
_fnWriteCell(nTd, display[i]);
|
|
3122
3127
|
}
|
|
3123
3128
|
|
|
3129
|
+
// column class
|
|
3130
|
+
_addClass(nTd, oCol.sClass);
|
|
3131
|
+
|
|
3124
3132
|
// Visibility - add or remove as required
|
|
3125
3133
|
if ( oCol.bVisible && create )
|
|
3126
3134
|
{
|
|
@@ -3452,7 +3460,6 @@
|
|
|
3452
3460
|
var td = aoData.anCells[i];
|
|
3453
3461
|
|
|
3454
3462
|
_addClass(td, _ext.type.className[col.sType]); // auto class
|
|
3455
|
-
_addClass(td, col.sClass); // column class
|
|
3456
3463
|
_addClass(td, oSettings.oClasses.tbody.cell); // all cells
|
|
3457
3464
|
}
|
|
3458
3465
|
|
|
@@ -5226,21 +5233,37 @@
|
|
|
5226
5233
|
// is because of Responsive which might remove `col` elements, knocking the alignment
|
|
5227
5234
|
// of the indexes out.
|
|
5228
5235
|
if (settings.aiDisplay.length) {
|
|
5229
|
-
// Get the column sizes from the first row in the table
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5233
|
-
|
|
5236
|
+
// Get the column sizes from the first row in the table. This should really be a
|
|
5237
|
+
// [].find, but it wasn't supported in Chrome until Sept 2015, and DT has 10 year
|
|
5238
|
+
// browser support
|
|
5239
|
+
var firstTr = null;
|
|
5240
|
+
|
|
5241
|
+
for (i=0 ; i<settings.aiDisplay.length ; i++) {
|
|
5242
|
+
var idx = settings.aiDisplay[i];
|
|
5243
|
+
var tr = settings.aoData[idx].nTr;
|
|
5244
|
+
|
|
5245
|
+
if (tr) {
|
|
5246
|
+
firstTr = tr;
|
|
5247
|
+
break;
|
|
5234
5248
|
}
|
|
5235
|
-
}
|
|
5249
|
+
}
|
|
5250
|
+
|
|
5251
|
+
if (firstTr) {
|
|
5252
|
+
var colSizes = $(firstTr).children('th, td').map(function (vis) {
|
|
5253
|
+
return {
|
|
5254
|
+
idx: _fnVisibleToColumnIndex(settings, vis),
|
|
5255
|
+
width: $(this).outerWidth()
|
|
5256
|
+
}
|
|
5257
|
+
});
|
|
5236
5258
|
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5259
|
+
// Check against what the colgroup > col is set to and correct if needed
|
|
5260
|
+
for (var i=0 ; i<colSizes.length ; i++) {
|
|
5261
|
+
var colEl = settings.aoColumns[ colSizes[i].idx ].colEl[0];
|
|
5262
|
+
var colWidth = colEl.style.width.replace('px', '');
|
|
5241
5263
|
|
|
5242
|
-
|
|
5243
|
-
|
|
5264
|
+
if (colWidth !== colSizes[i].width) {
|
|
5265
|
+
colEl.style.width = colSizes[i].width + 'px';
|
|
5266
|
+
}
|
|
5244
5267
|
}
|
|
5245
5268
|
}
|
|
5246
5269
|
}
|
|
@@ -5383,7 +5406,11 @@
|
|
|
5383
5406
|
var width = _fnColumnsSumWidth( settings, this, true, false );
|
|
5384
5407
|
|
|
5385
5408
|
if ( width ) {
|
|
5409
|
+
// Need to set the width and min-width, otherwise the browser
|
|
5410
|
+
// will attempt to collapse the table beyond want might have
|
|
5411
|
+
// been specified
|
|
5386
5412
|
this.style.width = width;
|
|
5413
|
+
this.style.minWidth = width;
|
|
5387
5414
|
|
|
5388
5415
|
// For scrollX we need to force the column width otherwise the
|
|
5389
5416
|
// browser will collapse it. If this width is smaller than the
|
|
@@ -6768,6 +6795,7 @@
|
|
|
6768
6795
|
return new _Api( context, data );
|
|
6769
6796
|
}
|
|
6770
6797
|
|
|
6798
|
+
var i;
|
|
6771
6799
|
var settings = [];
|
|
6772
6800
|
var ctxSettings = function ( o ) {
|
|
6773
6801
|
var a = _toSettings( o );
|
|
@@ -6777,7 +6805,7 @@
|
|
|
6777
6805
|
};
|
|
6778
6806
|
|
|
6779
6807
|
if ( Array.isArray( context ) ) {
|
|
6780
|
-
for (
|
|
6808
|
+
for ( i=0 ; i<context.length ; i++ ) {
|
|
6781
6809
|
ctxSettings( context[i] );
|
|
6782
6810
|
}
|
|
6783
6811
|
}
|
|
@@ -6792,7 +6820,16 @@
|
|
|
6792
6820
|
|
|
6793
6821
|
// Initial data
|
|
6794
6822
|
if ( data ) {
|
|
6795
|
-
|
|
6823
|
+
// Chrome can throw a max stack error if apply is called with
|
|
6824
|
+
// too large an array, but apply is faster.
|
|
6825
|
+
if (data.length < 10000) {
|
|
6826
|
+
this.push.apply(this, data);
|
|
6827
|
+
}
|
|
6828
|
+
else {
|
|
6829
|
+
for (i=0 ; i<data.length ; i++) {
|
|
6830
|
+
this.push(data[i]);
|
|
6831
|
+
}
|
|
6832
|
+
}
|
|
6796
6833
|
}
|
|
6797
6834
|
|
|
6798
6835
|
// selector
|
|
@@ -8482,8 +8519,10 @@
|
|
|
8482
8519
|
switch( match[2] ) {
|
|
8483
8520
|
case 'visIdx':
|
|
8484
8521
|
case 'visible':
|
|
8485
|
-
|
|
8522
|
+
// Selector is a column index
|
|
8523
|
+
if (match[1] && match[1].match(/^\d+$/)) {
|
|
8486
8524
|
var idx = parseInt( match[1], 10 );
|
|
8525
|
+
|
|
8487
8526
|
// Visible index given, convert to column index
|
|
8488
8527
|
if ( idx < 0 ) {
|
|
8489
8528
|
// Counting from the right
|
|
@@ -8496,9 +8535,19 @@
|
|
|
8496
8535
|
return [ _fnVisibleToColumnIndex( settings, idx ) ];
|
|
8497
8536
|
}
|
|
8498
8537
|
|
|
8499
|
-
|
|
8500
|
-
|
|
8501
|
-
|
|
8538
|
+
return columns.map( function (col, idx) {
|
|
8539
|
+
// Not visible, can't match
|
|
8540
|
+
if (! col.bVisible) {
|
|
8541
|
+
return null;
|
|
8542
|
+
}
|
|
8543
|
+
|
|
8544
|
+
// Selector
|
|
8545
|
+
if (match[1]) {
|
|
8546
|
+
return $(nodes[idx]).filter(match[1]).length > 0 ? idx : null;
|
|
8547
|
+
}
|
|
8548
|
+
|
|
8549
|
+
// `:visible` on its own
|
|
8550
|
+
return idx;
|
|
8502
8551
|
} );
|
|
8503
8552
|
|
|
8504
8553
|
case 'name':
|
|
@@ -9811,7 +9860,7 @@
|
|
|
9811
9860
|
* @type string
|
|
9812
9861
|
* @default Version number
|
|
9813
9862
|
*/
|
|
9814
|
-
DataTable.version = "2.1.
|
|
9863
|
+
DataTable.version = "2.1.5";
|
|
9815
9864
|
|
|
9816
9865
|
/**
|
|
9817
9866
|
* Private data store, containing all of the settings objects that are
|
|
@@ -12485,7 +12534,7 @@
|
|
|
12485
12534
|
pre: function ( a ) {
|
|
12486
12535
|
// This is a little complex, but faster than always calling toString,
|
|
12487
12536
|
// http://jsperf.com/tostring-v-check
|
|
12488
|
-
return _empty(a) ?
|
|
12537
|
+
return _empty(a) && typeof a !== 'boolean' ?
|
|
12489
12538
|
'' :
|
|
12490
12539
|
typeof a === 'string' ?
|
|
12491
12540
|
a.toLowerCase() :
|
|
@@ -12738,6 +12787,12 @@
|
|
|
12738
12787
|
return; // table, not a nested one
|
|
12739
12788
|
}
|
|
12740
12789
|
|
|
12790
|
+
var sorting = ctx.sortDetails;
|
|
12791
|
+
|
|
12792
|
+
if (! sorting) {
|
|
12793
|
+
return;
|
|
12794
|
+
}
|
|
12795
|
+
|
|
12741
12796
|
var i;
|
|
12742
12797
|
var orderClasses = classes.order;
|
|
12743
12798
|
var columns = ctx.api.columns( cell );
|
|
@@ -12746,7 +12801,6 @@
|
|
|
12746
12801
|
var ariaType = '';
|
|
12747
12802
|
var indexes = columns.indexes();
|
|
12748
12803
|
var sortDirs = columns.orderable(true).flatten();
|
|
12749
|
-
var sorting = ctx.sortDetails;
|
|
12750
12804
|
var orderedColumns = _pluck(sorting, 'col');
|
|
12751
12805
|
|
|
12752
12806
|
cell
|
|
@@ -13114,7 +13168,11 @@
|
|
|
13114
13168
|
|
|
13115
13169
|
var host = $('<div/>')
|
|
13116
13170
|
.addClass(settings.oClasses.paging.container + (opts.type ? ' paging_' + opts.type : ''))
|
|
13117
|
-
.append(
|
|
13171
|
+
.append(
|
|
13172
|
+
$('<nav>')
|
|
13173
|
+
.attr('aria-label', 'pagination')
|
|
13174
|
+
.addClass(settings.oClasses.paging.nav)
|
|
13175
|
+
);
|
|
13118
13176
|
var draw = function () {
|
|
13119
13177
|
_pagingDraw(settings, host.children(), opts);
|
|
13120
13178
|
};
|