datatables.net 1.13.4 → 1.13.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.
@@ -1,4 +1,4 @@
1
- /*! DataTables 1.13.4
1
+ /*! DataTables 1.13.5
2
2
  * ©2008-2023 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -1384,7 +1384,7 @@
1384
1384
 
1385
1385
 
1386
1386
  var _isNumber = function ( d, decimalPoint, formatted ) {
1387
- let type = typeof d;
1387
+ var type = typeof d;
1388
1388
  var strType = type === 'string';
1389
1389
 
1390
1390
  if ( type === 'number' || type === 'bigint') {
@@ -1518,7 +1518,9 @@
1518
1518
 
1519
1519
 
1520
1520
  var _stripHtml = function ( d ) {
1521
- return d.replace( _re_html, '' );
1521
+ return d
1522
+ .replace( _re_html, '' ) // Complete tags
1523
+ .replace(/<script/i, ''); // Safety for incomplete script tag
1522
1524
  };
1523
1525
 
1524
1526
 
@@ -1892,7 +1894,10 @@
1892
1894
  continue;
1893
1895
  }
1894
1896
 
1895
- if ( data === null || data[ a[i] ] === undefined ) {
1897
+ if (data === null || data[ a[i] ] === null) {
1898
+ return null;
1899
+ }
1900
+ else if ( data === undefined || data[ a[i] ] === undefined ) {
1896
1901
  return undefined;
1897
1902
  }
1898
1903
 
@@ -4063,11 +4068,16 @@
4063
4068
  settings.iDraw++;
4064
4069
  _fnProcessingDisplay( settings, true );
4065
4070
 
4071
+ // Keep track of drawHold state to handle scrolling after the Ajax call
4072
+ var drawHold = settings._drawHold;
4073
+
4066
4074
  _fnBuildAjax(
4067
4075
  settings,
4068
4076
  _fnAjaxParameters( settings ),
4069
4077
  function(json) {
4078
+ settings._drawHold = drawHold;
4070
4079
  _fnAjaxUpdateDraw( settings, json );
4080
+ settings._drawHold = false;
4071
4081
  }
4072
4082
  );
4073
4083
  }
@@ -4331,7 +4341,7 @@
4331
4341
  _fnThrottle( searchFn, searchDelay ) :
4332
4342
  searchFn
4333
4343
  )
4334
- .on( 'mouseup', function(e) {
4344
+ .on( 'mouseup.DT', function(e) {
4335
4345
  // Edge fix! Edge 17 does not trigger anything other than mouse events when clicking
4336
4346
  // on the clear icon (Edge bug 17584515). This is safe in other browsers as `searchFn`
4337
4347
  // checks the value to see if it has changed. In other browsers it won't have.
@@ -4397,7 +4407,7 @@
4397
4407
  if ( _fnDataSource( oSettings ) != 'ssp' )
4398
4408
  {
4399
4409
  /* Global filter */
4400
- _fnFilter( oSettings, oInput.sSearch, iForce, fnRegex(oInput), oInput.bSmart, oInput.bCaseInsensitive, oInput.return );
4410
+ _fnFilter( oSettings, oInput.sSearch, iForce, fnRegex(oInput), oInput.bSmart, oInput.bCaseInsensitive );
4401
4411
  fnSaveFilter( oInput );
4402
4412
 
4403
4413
  /* Now do the individual column filter */
@@ -4566,11 +4576,15 @@
4566
4576
  *
4567
4577
  * ^(?=.*?\bone\b)(?=.*?\btwo three\b)(?=.*?\bfour\b).*$
4568
4578
  */
4569
- var a = $.map( search.match( /"[^"]+"|[^ ]+/g ) || [''], function ( word ) {
4579
+ var a = $.map( search.match( /["\u201C][^"\u201D]+["\u201D]|[^ ]+/g ) || [''], function ( word ) {
4570
4580
  if ( word.charAt(0) === '"' ) {
4571
4581
  var m = word.match( /^"(.*)"$/ );
4572
4582
  word = m ? m[1] : word;
4573
4583
  }
4584
+ else if ( word.charAt(0) === '\u201C' ) {
4585
+ var m = word.match( /^\u201C(.*)\u201D$/ );
4586
+ word = m ? m[1] : word;
4587
+ }
4574
4588
 
4575
4589
  return word.replace('"', '');
4576
4590
  } );
@@ -9374,7 +9388,8 @@
9374
9388
  * Set the jQuery or window object to be used by DataTables
9375
9389
  *
9376
9390
  * @param {*} module Library / container object
9377
- * @param {string} type Library or container type `lib` or `win`.
9391
+ * @param {string} [type] Library or container type `lib`, `win` or `datetime`.
9392
+ * If not provided, automatic detection is attempted.
9378
9393
  */
9379
9394
  DataTable.use = function (module, type) {
9380
9395
  if (type === 'lib' || module.fn) {
@@ -9384,6 +9399,9 @@
9384
9399
  window = module;
9385
9400
  document = module.document;
9386
9401
  }
9402
+ else if (type === 'datetime' || module.type === 'DateTime') {
9403
+ DataTable.DateTime = module;
9404
+ }
9387
9405
  }
9388
9406
 
9389
9407
  /**
@@ -9743,7 +9761,9 @@
9743
9761
  resolved._;
9744
9762
  }
9745
9763
 
9746
- return resolved.replace( '%d', plural ); // nb: plural might be undefined,
9764
+ return typeof resolved === 'string'
9765
+ ? resolved.replace( '%d', plural ) // nb: plural might be undefined,
9766
+ : resolved;
9747
9767
  } );
9748
9768
  /**
9749
9769
  * Version string for plug-ins to check compatibility. Allowed format is
@@ -9753,7 +9773,7 @@
9753
9773
  * @type string
9754
9774
  * @default Version number
9755
9775
  */
9756
- DataTable.version = "1.13.4";
9776
+ DataTable.version = "1.13.5";
9757
9777
 
9758
9778
  /**
9759
9779
  * Private data store, containing all of the settings objects that are
@@ -14895,7 +14915,7 @@
14895
14915
  'aria-controls': settings.sTableId,
14896
14916
  'aria-disabled': disabled ? 'true' : null,
14897
14917
  'aria-label': aria[ button ],
14898
- 'aria-role': 'link',
14918
+ 'role': 'link',
14899
14919
  'aria-current': btnClass === classes.sPageButtonActive ? 'page' : null,
14900
14920
  'data-dt-idx': button,
14901
14921
  'tabindex': tabIndex,
@@ -15029,7 +15049,7 @@
15029
15049
  return -Infinity;
15030
15050
  }
15031
15051
 
15032
- let type = typeof d;
15052
+ var type = typeof d;
15033
15053
 
15034
15054
  if (type === 'number' || type === 'bigint') {
15035
15055
  return d;
@@ -15403,7 +15423,7 @@
15403
15423
  var __thousands = ',';
15404
15424
  var __decimal = '.';
15405
15425
 
15406
- if (Intl) {
15426
+ if (window.Intl !== undefined) {
15407
15427
  try {
15408
15428
  var num = new Intl.NumberFormat().formatToParts(100000.1);
15409
15429