datatables.net 2.1.6 → 2.1.7

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.mjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! DataTables 2.1.6
1
+ /*! DataTables 2.1.7
2
2
  * © SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -1265,8 +1265,11 @@ var _normalize = function (str, both) {
1265
1265
  }
1266
1266
 
1267
1267
  // It is faster to just run `normalize` than it is to check if
1268
- // we need to with a regex!
1269
- var res = str.normalize("NFD");
1268
+ // we need to with a regex! (Check as it isn't available in old
1269
+ // Safari)
1270
+ var res = str.normalize
1271
+ ? str.normalize("NFD")
1272
+ : str;
1270
1273
 
1271
1274
  // Equally, here we check if a regex is needed or not
1272
1275
  return res.length !== str.length
@@ -2104,11 +2107,7 @@ function _fnColumnSizes ( settings )
2104
2107
  for (var i=0 ; i<cols.length ; i++) {
2105
2108
  var width = _fnColumnsSumWidth(settings, [i], false, false);
2106
2109
 
2107
- // Need to set the min-width, otherwise the browser might try to collapse
2108
- // it further
2109
- cols[i].colEl
2110
- .css('width', width)
2111
- .css('min-width', width);
2110
+ cols[i].colEl.css('width', width);
2112
2111
  }
2113
2112
  }
2114
2113
 
@@ -2205,7 +2204,7 @@ function _fnGetColumns( oSettings, sParam )
2205
2204
  */
2206
2205
  function _typeResult (typeDetect, res) {
2207
2206
  return res === true
2208
- ? typeDetect.name
2207
+ ? typeDetect._name
2209
2208
  : res;
2210
2209
  }
2211
2210
 
@@ -2988,8 +2987,8 @@ function _fnGetRowElements( settings, row, colIdx, d )
2988
2987
  * @returns
2989
2988
  */
2990
2989
  function _fnGetRowDisplay (settings, rowIdx) {
2991
- let rowModal = settings.aoData[rowIdx];
2992
- let columns = settings.aoColumns;
2990
+ var rowModal = settings.aoData[rowIdx];
2991
+ var columns = settings.aoColumns;
2993
2992
 
2994
2993
  if (! rowModal.displayData) {
2995
2994
  // Need to render and cache
@@ -5355,11 +5354,7 @@ function _fnCalculateColumnWidths ( settings )
5355
5354
  var width = _fnColumnsSumWidth( settings, this, true, false );
5356
5355
 
5357
5356
  if ( width ) {
5358
- // Need to set the width and min-width, otherwise the browser
5359
- // will attempt to collapse the table beyond want might have
5360
- // been specified
5361
5357
  this.style.width = width;
5362
- this.style.minWidth = width;
5363
5358
 
5364
5359
  // For scrollX we need to force the column width otherwise the
5365
5360
  // browser will collapse it. If this width is smaller than the
@@ -7661,7 +7656,7 @@ var _selector_opts = function ( opts )
7661
7656
  // Reduce the API instance to the first item found
7662
7657
  var _selector_first = function ( old )
7663
7658
  {
7664
- let inst = new _Api(old.context[0]);
7659
+ var inst = new _Api(old.context[0]);
7665
7660
 
7666
7661
  // Use a push rather than passing to the constructor, since it will
7667
7662
  // merge arrays down automatically, which isn't what is wanted here
@@ -9656,7 +9651,7 @@ _api_register( 'ready()', function ( fn ) {
9656
9651
  fn.call(this);
9657
9652
  }
9658
9653
  else {
9659
- this.on('init', function () {
9654
+ this.on('init.dt.DT', function () {
9660
9655
  fn.call(this);
9661
9656
  });
9662
9657
  }
@@ -9809,7 +9804,7 @@ _api_register( 'i18n()', function ( token, def, plural ) {
9809
9804
  * @type string
9810
9805
  * @default Version number
9811
9806
  */
9812
- DataTable.version = "2.1.6";
9807
+ DataTable.version = "2.1.7";
9813
9808
 
9814
9809
  /**
9815
9810
  * Private data store, containing all of the settings objects that are
@@ -12373,7 +12368,7 @@ DataTable.type = function (name, prop, val) {
12373
12368
  return {
12374
12369
  className: _extTypes.className[name],
12375
12370
  detect: _extTypes.detect.find(function (fn) {
12376
- return fn.name === name;
12371
+ return fn._name === name;
12377
12372
  }),
12378
12373
  order: {
12379
12374
  pre: _extTypes.order[name + '-pre'],
@@ -12391,10 +12386,10 @@ DataTable.type = function (name, prop, val) {
12391
12386
  var setDetect = function (detect) {
12392
12387
  // `detect` can be a function or an object - we set a name
12393
12388
  // property for either - that is used for the detection
12394
- Object.defineProperty(detect, "name", {value: name});
12389
+ Object.defineProperty(detect, "_name", {value: name});
12395
12390
 
12396
12391
  var idx = _extTypes.detect.findIndex(function (item) {
12397
- return item.name === name;
12392
+ return item._name === name;
12398
12393
  });
12399
12394
 
12400
12395
  if (idx === -1) {
@@ -12457,13 +12452,13 @@ DataTable.type = function (name, prop, val) {
12457
12452
  // Get a list of types
12458
12453
  DataTable.types = function () {
12459
12454
  return _extTypes.detect.map(function (fn) {
12460
- return fn.name;
12455
+ return fn._name;
12461
12456
  });
12462
12457
  };
12463
12458
 
12464
12459
  var __diacriticSort = function (a, b) {
12465
- a = a.toString().toLowerCase();
12466
- b = b.toString().toLowerCase();
12460
+ a = a !== null && a !== undefined ? a.toString().toLowerCase() : '';
12461
+ b = b !== null && b !== undefined ? b.toString().toLowerCase() : '';
12467
12462
 
12468
12463
  // Checked for `navigator.languages` support in `oneOf` so this code can't execute in old
12469
12464
  // Safari and thus can disable this check
@@ -13177,15 +13172,17 @@ function _pagingDraw(settings, host, opts) {
13177
13172
  all = len === -1,
13178
13173
  page = all ? 0 : Math.ceil( start / len ),
13179
13174
  pages = all ? 1 : Math.ceil( visRecords / len ),
13180
- buttons = plugin(opts)
13175
+ buttons = [],
13176
+ buttonEls = [],
13177
+ buttonsNested = plugin(opts)
13181
13178
  .map(function (val) {
13182
13179
  return val === 'numbers'
13183
13180
  ? _pagingNumbers(page, pages, opts.buttons, opts.boundaryNumbers)
13184
13181
  : val;
13185
- })
13186
- .flat();
13182
+ });
13187
13183
 
13188
- var buttonEls = [];
13184
+ // .flat() would be better, but not supported in old Safari
13185
+ buttons = buttons.concat.apply(buttons, buttonsNested);
13189
13186
 
13190
13187
  for (var i=0 ; i<buttons.length ; i++) {
13191
13188
  var button = buttons[i];
@@ -13464,14 +13461,14 @@ DataTable.feature.register( 'pageLength', function ( settings, opts ) {
13464
13461
 
13465
13462
  // Save text node content for macro updating
13466
13463
  var textNodes = [];
13467
- div.find('label')[0].childNodes.forEach(function (el) {
13464
+ Array.from(div.find('label')[0].childNodes).forEach(function (el) {
13468
13465
  if (el.nodeType === Node.TEXT_NODE) {
13469
13466
  textNodes.push({
13470
13467
  el: el,
13471
13468
  text: el.textContent
13472
13469
  });
13473
13470
  }
13474
- })
13471
+ });
13475
13472
 
13476
13473
  // Update the label text in case it has an entries value
13477
13474
  var updateEntries = function (len) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "js/dataTables.js",
5
5
  "module": "js/dataTables.mjs",
6
6
  "types": "./types/types.d.ts",
7
- "version": "2.1.6",
7
+ "version": "2.1.7",
8
8
  "files": [
9
9
  "js/**/*.js",
10
10
  "js/**/*.mjs",