datatables.net 1.12.1 → 1.13.0

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,11 +1,11 @@
1
- /*! DataTables 1.12.1
1
+ /*! DataTables 1.13.0
2
2
  * ©2008-2022 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 1.12.1
8
+ * @version 1.13.0
9
9
  * @author SpryMedia Ltd
10
10
  * @contact www.datatables.net
11
11
  * @copyright SpryMedia Ltd.
@@ -1150,6 +1150,10 @@
1150
1150
  $( rowOne[0] ).children('th, td').each( function (i, cell) {
1151
1151
  var col = oSettings.aoColumns[i];
1152
1152
 
1153
+ if (! col) {
1154
+ _fnLog( oSettings, 0, 'Incorrect column count', 18 );
1155
+ }
1156
+
1153
1157
  if ( col.mData === i ) {
1154
1158
  var sort = a( cell, 'sort' ) || a( cell, 'order' );
1155
1159
  var filter = a( cell, 'filter' ) || a( cell, 'search' );
@@ -3154,6 +3158,11 @@
3154
3158
  create = nTrIn ? false : true;
3155
3159
 
3156
3160
  nTd = create ? document.createElement( oCol.sCellType ) : anTds[i];
3161
+
3162
+ if (! nTd) {
3163
+ _fnLog( oSettings, 0, 'Incorrect column count', 18 );
3164
+ }
3165
+
3157
3166
  nTd._DT_CellIndex = {
3158
3167
  row: iRow,
3159
3168
  column: i
@@ -3304,10 +3313,16 @@
3304
3313
 
3305
3314
  for ( i=0, ien=cells.length ; i<ien ; i++ ) {
3306
3315
  column = columns[i];
3307
- column.nTf = cells[i].cell;
3308
3316
 
3309
- if ( column.sClass ) {
3310
- $(column.nTf).addClass( column.sClass );
3317
+ if (column) {
3318
+ column.nTf = cells[i].cell;
3319
+
3320
+ if ( column.sClass ) {
3321
+ $(column.nTf).addClass( column.sClass );
3322
+ }
3323
+ }
3324
+ else {
3325
+ _fnLog( oSettings, 0, 'Incorrect column count', 18 );
3311
3326
  }
3312
3327
  }
3313
3328
  }
@@ -5067,6 +5082,10 @@
5067
5082
  _fnDraw( settings );
5068
5083
  }
5069
5084
  }
5085
+ else {
5086
+ // No change event - paging was called, but no change
5087
+ _fnCallbackFire( settings, null, 'page-nc', [settings] );
5088
+ }
5070
5089
 
5071
5090
  return changed;
5072
5091
  }
@@ -8322,8 +8341,12 @@
8322
8341
 
8323
8342
  $(document).on('plugin-init.dt', function (e, context) {
8324
8343
  var api = new _Api( context );
8344
+
8345
+ const namespace = 'on-plugin-init';
8346
+ const stateSaveParamsEvent = `stateSaveParams.${namespace}`;
8347
+ const destroyEvent = `destroy.${namespace}`;
8325
8348
 
8326
- api.on( 'stateSaveParams', function ( e, settings, d ) {
8349
+ api.on( stateSaveParamsEvent, function ( e, settings, d ) {
8327
8350
  // This could be more compact with the API, but it is a lot faster as a simple
8328
8351
  // internal loop
8329
8352
  var idFn = settings.rowIdFn;
@@ -8337,7 +8360,11 @@
8337
8360
  }
8338
8361
 
8339
8362
  d.childRows = ids;
8340
- })
8363
+ });
8364
+
8365
+ api.on( destroyEvent, function () {
8366
+ api.off(`${stateSaveParamsEvent} ${destroyEvent}`);
8367
+ });
8341
8368
 
8342
8369
  var loaded = api.state.loaded();
8343
8370
 
@@ -9658,7 +9685,7 @@
9658
9685
  * @type string
9659
9686
  * @default Version number
9660
9687
  */
9661
- DataTable.version = "1.12.1";
9688
+ DataTable.version = "1.13.0";
9662
9689
 
9663
9690
  /**
9664
9691
  * Private data store, containing all of the settings objects that are
@@ -14720,7 +14747,7 @@
14720
14747
  var classes = settings.oClasses;
14721
14748
  var lang = settings.oLanguage.oPaginate;
14722
14749
  var aria = settings.oLanguage.oAria.paginate || {};
14723
- var btnDisplay, btnClass, counter=0;
14750
+ var btnDisplay, btnClass;
14724
14751
 
14725
14752
  var attach = function( container, buttons ) {
14726
14753
  var i, ien, node, button, tabIndex;
@@ -14795,7 +14822,7 @@
14795
14822
  'class': classes.sPageButton+' '+btnClass,
14796
14823
  'aria-controls': settings.sTableId,
14797
14824
  'aria-label': aria[ button ],
14798
- 'data-dt-idx': counter,
14825
+ 'data-dt-idx': button,
14799
14826
  'tabindex': tabIndex,
14800
14827
  'id': idx === 0 && typeof button === 'string' ?
14801
14828
  settings.sTableId +'_'+ button :
@@ -14807,8 +14834,6 @@
14807
14834
  _fnBindAction(
14808
14835
  node, {action: button}, clickHandler
14809
14836
  );
14810
-
14811
- counter++;
14812
14837
  }
14813
14838
  }
14814
14839
  }
@@ -15153,7 +15178,7 @@
15153
15178
  }
15154
15179
  }
15155
15180
  else if (window.luxon) {
15156
- dt = format
15181
+ dt = format && typeof d === 'string'
15157
15182
  ? window.luxon.DateTime.fromFormat( d, format )
15158
15183
  : window.luxon.DateTime.fromISO( d );
15159
15184
 
@@ -15575,6 +15600,6 @@
15575
15600
  $.each( DataTable, function ( prop, val ) {
15576
15601
  $.fn.DataTable[ prop ] = val;
15577
15602
  } );
15578
-
15603
+
15579
15604
  return DataTable;
15580
15605
  }));