datatables.net 2.3.5 → 2.3.6
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 +50 -26
- package/js/dataTables.min.js +2 -2
- package/js/dataTables.min.mjs +2 -2
- package/js/dataTables.mjs +50 -26
- package/package.json +1 -1
- package/types/types.d.ts +5 -0
package/js/dataTables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! DataTables 2.3.
|
|
1
|
+
/*! DataTables 2.3.6
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -174,7 +174,7 @@
|
|
|
174
174
|
"sDestroyWidth": $this[0].style.width,
|
|
175
175
|
"sInstance": sId,
|
|
176
176
|
"sTableId": sId,
|
|
177
|
-
colgroup: $('<colgroup>')
|
|
177
|
+
colgroup: $('<colgroup>'),
|
|
178
178
|
fastData: function (row, column, type) {
|
|
179
179
|
return _fnGetCellData(oSettings, row, column, type);
|
|
180
180
|
}
|
|
@@ -247,6 +247,7 @@
|
|
|
247
247
|
"orderHandler",
|
|
248
248
|
"titleRow",
|
|
249
249
|
"typeDetect",
|
|
250
|
+
"columnTitleTag",
|
|
250
251
|
[ "iCookieDuration", "iStateDuration" ], // backwards compat
|
|
251
252
|
[ "oSearch", "oPreviousSearch" ],
|
|
252
253
|
[ "aoSearchCols", "aoPreSearchCols" ],
|
|
@@ -411,7 +412,7 @@
|
|
|
411
412
|
|
|
412
413
|
if ( oSettings.caption ) {
|
|
413
414
|
if ( caption.length === 0 ) {
|
|
414
|
-
caption = $('<caption/>').
|
|
415
|
+
caption = $('<caption/>').prependTo( $this );
|
|
415
416
|
}
|
|
416
417
|
|
|
417
418
|
caption.html( oSettings.caption );
|
|
@@ -424,6 +425,14 @@
|
|
|
424
425
|
oSettings.captionNode = caption[0];
|
|
425
426
|
}
|
|
426
427
|
|
|
428
|
+
// Place the colgroup element in the correct location for the HTML structure
|
|
429
|
+
if (caption.length) {
|
|
430
|
+
oSettings.colgroup.insertAfter(caption);
|
|
431
|
+
}
|
|
432
|
+
else {
|
|
433
|
+
oSettings.colgroup.prependTo(oSettings.nTable);
|
|
434
|
+
}
|
|
435
|
+
|
|
427
436
|
if ( thead.length === 0 ) {
|
|
428
437
|
thead = $('<thead/>').appendTo($this);
|
|
429
438
|
}
|
|
@@ -439,7 +448,7 @@
|
|
|
439
448
|
if ( tfoot.length === 0 ) {
|
|
440
449
|
// If we are a scrolling table, and no footer has been given, then we need to create
|
|
441
450
|
// a tfoot element for the caption element to be appended to
|
|
442
|
-
tfoot = $('<tfoot/>').
|
|
451
|
+
tfoot = $('<tfoot/>').insertAfter(thead);
|
|
443
452
|
}
|
|
444
453
|
oSettings.nTFoot = tfoot[0];
|
|
445
454
|
|
|
@@ -1280,7 +1289,7 @@
|
|
|
1280
1289
|
};
|
|
1281
1290
|
|
|
1282
1291
|
// Replaceable function in api.util
|
|
1283
|
-
var _stripHtml = function (input) {
|
|
1292
|
+
var _stripHtml = function (input, replacement) {
|
|
1284
1293
|
if (! input || typeof input !== 'string') {
|
|
1285
1294
|
return input;
|
|
1286
1295
|
}
|
|
@@ -1292,7 +1301,7 @@
|
|
|
1292
1301
|
|
|
1293
1302
|
var previous;
|
|
1294
1303
|
|
|
1295
|
-
input = input.replace(_re_html, ''); // Complete tags
|
|
1304
|
+
input = input.replace(_re_html, replacement || ''); // Complete tags
|
|
1296
1305
|
|
|
1297
1306
|
// Safety for incomplete script tag - use do / while to ensure that
|
|
1298
1307
|
// we get all instances
|
|
@@ -1757,7 +1766,7 @@
|
|
|
1757
1766
|
}
|
|
1758
1767
|
},
|
|
1759
1768
|
|
|
1760
|
-
stripHtml: function (mixed) {
|
|
1769
|
+
stripHtml: function (mixed, replacement) {
|
|
1761
1770
|
var type = typeof mixed;
|
|
1762
1771
|
|
|
1763
1772
|
if (type === 'function') {
|
|
@@ -1765,7 +1774,7 @@
|
|
|
1765
1774
|
return;
|
|
1766
1775
|
}
|
|
1767
1776
|
else if (type === 'string') {
|
|
1768
|
-
return _stripHtml(mixed);
|
|
1777
|
+
return _stripHtml(mixed, replacement);
|
|
1769
1778
|
}
|
|
1770
1779
|
return mixed;
|
|
1771
1780
|
},
|
|
@@ -3367,7 +3376,7 @@
|
|
|
3367
3376
|
colspan++;
|
|
3368
3377
|
}
|
|
3369
3378
|
|
|
3370
|
-
var titleSpan = $('
|
|
3379
|
+
var titleSpan = $('.dt-column-title', cell);
|
|
3371
3380
|
|
|
3372
3381
|
structure[row][column] = {
|
|
3373
3382
|
cell: cell,
|
|
@@ -4081,8 +4090,8 @@
|
|
|
4081
4090
|
}
|
|
4082
4091
|
|
|
4083
4092
|
// Wrap the column title so we can write to it in future
|
|
4084
|
-
if ( $('
|
|
4085
|
-
$(
|
|
4093
|
+
if ( $('.dt-column-title', cell).length === 0) {
|
|
4094
|
+
$(document.createElement(settings.columnTitleTag))
|
|
4086
4095
|
.addClass('dt-column-title')
|
|
4087
4096
|
.append(cell.childNodes)
|
|
4088
4097
|
.appendTo(cell);
|
|
@@ -4093,9 +4102,9 @@
|
|
|
4093
4102
|
isHeader &&
|
|
4094
4103
|
jqCell.filter(':not([data-dt-order=disable])').length !== 0 &&
|
|
4095
4104
|
jqCell.parent(':not([data-dt-order=disable])').length !== 0 &&
|
|
4096
|
-
$('
|
|
4105
|
+
$('.dt-column-order', cell).length === 0
|
|
4097
4106
|
) {
|
|
4098
|
-
$(
|
|
4107
|
+
$(document.createElement(settings.columnTitleTag))
|
|
4099
4108
|
.addClass('dt-column-order')
|
|
4100
4109
|
.appendTo(cell);
|
|
4101
4110
|
}
|
|
@@ -4104,7 +4113,7 @@
|
|
|
4104
4113
|
// layout for those elements
|
|
4105
4114
|
var headerFooter = isHeader ? 'header' : 'footer';
|
|
4106
4115
|
|
|
4107
|
-
if ( $('
|
|
4116
|
+
if ( $('div.dt-column-' + headerFooter, cell).length === 0) {
|
|
4108
4117
|
$('<div>')
|
|
4109
4118
|
.addClass('dt-column-' + headerFooter)
|
|
4110
4119
|
.append(cell.childNodes)
|
|
@@ -4261,6 +4270,10 @@
|
|
|
4261
4270
|
// Custom Ajax option to submit the parameters as a JSON string
|
|
4262
4271
|
if (baseAjax.submitAs === 'json' && typeof data === 'object') {
|
|
4263
4272
|
baseAjax.data = JSON.stringify(data);
|
|
4273
|
+
|
|
4274
|
+
if (!baseAjax.contentType) {
|
|
4275
|
+
baseAjax.contentType = 'application/json; charset=utf-8';
|
|
4276
|
+
}
|
|
4264
4277
|
}
|
|
4265
4278
|
|
|
4266
4279
|
if (typeof ajax === 'function') {
|
|
@@ -5519,7 +5532,7 @@
|
|
|
5519
5532
|
var autoClass = _ext.type.className[column.sType];
|
|
5520
5533
|
var padding = column.sContentPadding || (scrollX ? '-' : '');
|
|
5521
5534
|
var text = longest + padding;
|
|
5522
|
-
var insert = longest.indexOf('<') === -1
|
|
5535
|
+
var insert = longest.indexOf('<') === -1 && longest.indexOf('&') === -1
|
|
5523
5536
|
? document.createTextNode(text)
|
|
5524
5537
|
: text
|
|
5525
5538
|
|
|
@@ -5707,15 +5720,20 @@
|
|
|
5707
5720
|
.replace(/id=".*?"/g, '')
|
|
5708
5721
|
.replace(/name=".*?"/g, '');
|
|
5709
5722
|
|
|
5710
|
-
|
|
5723
|
+
// Don't want Javascript at all in these calculation cells.
|
|
5724
|
+
cellString = cellString.replace(/<script.*?<\/script>/gi, ' ');
|
|
5725
|
+
|
|
5726
|
+
var noHtml = _stripHtml(cellString, ' ')
|
|
5711
5727
|
.replace( / /g, ' ' );
|
|
5712
5728
|
|
|
5729
|
+
// The length is calculated on the text only, but we keep the HTML
|
|
5730
|
+
// in the string so it can be used in the calculation table
|
|
5713
5731
|
collection.push({
|
|
5714
|
-
str:
|
|
5715
|
-
len:
|
|
5732
|
+
str: cellString,
|
|
5733
|
+
len: noHtml.length
|
|
5716
5734
|
});
|
|
5717
5735
|
|
|
5718
|
-
allStrings.push(
|
|
5736
|
+
allStrings.push(noHtml);
|
|
5719
5737
|
}
|
|
5720
5738
|
|
|
5721
5739
|
// Order and then cut down to the size we need
|
|
@@ -8770,7 +8788,7 @@
|
|
|
8770
8788
|
// Automatic - find the _last_ unique cell from the top that is not empty (last for
|
|
8771
8789
|
// backwards compatibility)
|
|
8772
8790
|
for (var i=0 ; i<header.length ; i++) {
|
|
8773
|
-
if (header[i][column].unique && $('
|
|
8791
|
+
if (header[i][column].unique && $('.dt-column-title', header[i][column].cell).text()) {
|
|
8774
8792
|
target = i;
|
|
8775
8793
|
}
|
|
8776
8794
|
}
|
|
@@ -9077,7 +9095,7 @@
|
|
|
9077
9095
|
title = undefined;
|
|
9078
9096
|
}
|
|
9079
9097
|
|
|
9080
|
-
var span = $('
|
|
9098
|
+
var span = $('.dt-column-title', this.column(column).header(row));
|
|
9081
9099
|
|
|
9082
9100
|
if (title !== undefined) {
|
|
9083
9101
|
span.html(title);
|
|
@@ -10251,8 +10269,8 @@
|
|
|
10251
10269
|
|
|
10252
10270
|
// Needed for header and footer, so pulled into its own function
|
|
10253
10271
|
function cleanHeader(node, className) {
|
|
10254
|
-
$(node).find('
|
|
10255
|
-
$(node).find('
|
|
10272
|
+
$(node).find('.dt-column-order').remove();
|
|
10273
|
+
$(node).find('.dt-column-title').each(function () {
|
|
10256
10274
|
var title = $(this).html();
|
|
10257
10275
|
$(this).parent().parent().append(title);
|
|
10258
10276
|
$(this).remove();
|
|
@@ -10270,7 +10288,7 @@
|
|
|
10270
10288
|
* @type string
|
|
10271
10289
|
* @default Version number
|
|
10272
10290
|
*/
|
|
10273
|
-
DataTable.version = "2.3.
|
|
10291
|
+
DataTable.version = "2.3.6";
|
|
10274
10292
|
|
|
10275
10293
|
/**
|
|
10276
10294
|
* Private data store, containing all of the settings objects that are
|
|
@@ -11438,7 +11456,10 @@
|
|
|
11438
11456
|
iDeferLoading: null,
|
|
11439
11457
|
|
|
11440
11458
|
/** Event listeners */
|
|
11441
|
-
on: null
|
|
11459
|
+
on: null,
|
|
11460
|
+
|
|
11461
|
+
/** Title wrapper element type */
|
|
11462
|
+
columnTitleTag: 'span'
|
|
11442
11463
|
};
|
|
11443
11464
|
|
|
11444
11465
|
_fnHungarianMap( DataTable.defaults );
|
|
@@ -12402,7 +12423,10 @@
|
|
|
12402
12423
|
orderHandler: true,
|
|
12403
12424
|
|
|
12404
12425
|
/** Title row indicator */
|
|
12405
|
-
titleRow: null
|
|
12426
|
+
titleRow: null,
|
|
12427
|
+
|
|
12428
|
+
/** Title wrapper element type */
|
|
12429
|
+
columnTitleTag: 'span'
|
|
12406
12430
|
};
|
|
12407
12431
|
|
|
12408
12432
|
/**
|