jquery-datatables 1.10.19 → 1.10.20

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.
Files changed (88) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/README.md +28 -1
  4. data/app/assets/javascripts/datatables/dataTables.uikit.js +2 -2
  5. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +42 -29
  6. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap.js +1 -1
  7. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap4.js +8 -2
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +6 -3
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.foundation.js +5 -4
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +58 -6
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +16 -5
  12. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.semanticui.js +1 -1
  13. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +267 -152
  14. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.foundation.js +1 -1
  15. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +121 -52
  16. data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +32 -5
  17. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +166 -63
  18. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.foundation.js +1 -1
  19. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +105 -53
  20. data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.foundation.js +1 -1
  21. data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +10 -9
  22. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.foundation.js +1 -1
  23. data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +519 -636
  24. data/app/assets/javascripts/datatables/extensions/Scroller/scroller.foundation.js +1 -1
  25. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +49 -18
  26. data/app/assets/javascripts/datatables/extensions/Select/select.foundation.js +1 -1
  27. data/app/assets/javascripts/datatables/jquery.dataTables.js +97 -60
  28. data/app/assets/javascripts/datatables/plugins/api/average.js +7 -6
  29. data/app/assets/javascripts/datatables/plugins/api/sum.js +7 -6
  30. data/app/assets/javascripts/datatables/plugins/pagination/ellipses.js +160 -0
  31. data/app/assets/javascripts/datatables/plugins/pagination/extjs.js +137 -0
  32. data/app/assets/javascripts/datatables/plugins/pagination/four_button.js +110 -0
  33. data/app/assets/javascripts/datatables/plugins/pagination/full_numbers_no_ellipses.js +59 -0
  34. data/app/assets/javascripts/datatables/plugins/pagination/input.js +22 -19
  35. data/app/assets/javascripts/datatables/plugins/pagination/scrolling.js +130 -0
  36. data/app/assets/javascripts/datatables/plugins/pagination/select.js +97 -0
  37. data/app/assets/javascripts/datatables/plugins/pagination/simple_incremental_bootstrap.js +154 -0
  38. data/app/assets/javascripts/datatables/plugins/pagination/simple_numbers_no_ellipses.js +59 -0
  39. data/app/assets/javascripts/datatables/plugins/search/dataTables.alphabetSearch.js +440 -399
  40. data/app/assets/javascripts/datatables/plugins/sorting/enum.js +51 -0
  41. data/app/assets/javascripts/datatables/plugins/type-detection/date-dd-MMM-yyyy.js +63 -0
  42. data/app/assets/javascripts/datatables/plugins/type-detection/date-de.js +125 -0
  43. data/app/assets/javascripts/datatables/plugins/type-detection/date-eu.js +64 -0
  44. data/app/assets/javascripts/datatables/plugins/type-detection/date-euro.js +48 -0
  45. data/app/assets/javascripts/datatables/plugins/type-detection/date-uk.js +35 -12
  46. data/app/assets/javascripts/datatables/plugins/type-detection/datetime-moment.js +74 -0
  47. data/app/assets/javascripts/datatables/plugins/type-detection/datetime-us.js +86 -0
  48. data/app/assets/javascripts/datatables/plugins/type-detection/file-size.js +37 -13
  49. data/app/assets/javascripts/datatables/plugins/type-detection/ip-address.js +113 -11
  50. data/app/assets/javascripts/datatables/plugins/type-detection/numString.js +63 -0
  51. data/app/assets/javascripts/datatables/plugins/type-detection/percent.js +34 -0
  52. data/app/assets/javascripts/datatables/plugins/type-detection/time-elapsed-dhms.js +42 -0
  53. data/app/assets/javascripts/datatables/plugins/type-detection/time.js +56 -0
  54. data/app/assets/javascripts/datatables/plugins/type-detection/title-numeric.js +40 -0
  55. data/app/assets/javascripts/datatables/plugins/type-detection/title-string.js +36 -0
  56. data/app/assets/stylesheets/datatables/dataTables.foundation.scss +5 -5
  57. data/app/assets/stylesheets/datatables/dataTables.material.scss +1 -1
  58. data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.dataTables.scss +10 -3
  59. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.scss +12 -3
  60. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.scss +13 -6
  61. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +2 -0
  62. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.scss +5 -1
  63. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +1 -0
  64. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.scss +2 -1
  65. data/app/assets/stylesheets/datatables/extensions/Buttons/common.scss +10 -0
  66. data/app/assets/stylesheets/datatables/extensions/Buttons/mixins.scss +42 -30
  67. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap.scss +11 -7
  68. data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.foundation.scss +1 -0
  69. data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +13 -5
  70. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.scss +20 -2
  71. data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.dataTables.scss +15 -2
  72. data/app/assets/stylesheets/datatables/jquery.dataTables.scss +5 -5
  73. data/jquery-datatables.gemspec +0 -3
  74. data/lib/generators/jquery/datatables/templates/stylesheets/foundation.scss.tt +0 -18
  75. data/lib/generators/jquery/datatables/templates/stylesheets/regular.scss.tt +0 -18
  76. data/lib/generators/jquery/datatables/templates/views/index.json.jbuilder +2 -2
  77. data/lib/jquery-datatables/engine.rb +0 -2
  78. data/lib/jquery-datatables/version.rb +1 -1
  79. data/lib/jquery-datatables.rb +3 -8
  80. metadata +26 -40
  81. data/app/assets/javascripts/datatables/dataTables.bootstrap2.js +0 -162
  82. data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.semanicui.js +0 -38
  83. data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.semanicui.js +0 -38
  84. data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.semanicui.js +0 -38
  85. data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.semanicui.js +0 -38
  86. data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.semanicui.js +0 -38
  87. data/app/assets/stylesheets/datatables/dataTables.bootstrap2.scss +0 -178
  88. /data/app/assets/javascripts/datatables/extensions/RowGroup/{rowGroup.semanicui.js → rowGroup.semanticui.js} +0 -0
@@ -1,15 +1,15 @@
1
- /*! RowGroup 1.0.3
2
- * ©2017-2018 SpryMedia Ltd - datatables.net/license
1
+ /*! RowGroup 1.1.1
2
+ * ©2017-2019 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary RowGroup
7
7
  * @description RowGrouping for DataTables
8
- * @version 1.0.3
8
+ * @version 1.1.1
9
9
  * @file dataTables.rowGroup.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact datatables.net
12
- * @copyright Copyright 2017-2018 SpryMedia Ltd.
12
+ * @copyright Copyright 2017-2019 SpryMedia Ltd.
13
13
  *
14
14
  * This source file is free software, available under the following license:
15
15
  * MIT license - http://datatables.net/license/mit
@@ -66,9 +66,7 @@ var RowGroup = function ( dt, opts ) {
66
66
 
67
67
  // Internal settings
68
68
  this.s = {
69
- dt: new DataTable.Api( dt ),
70
-
71
- dataFn: DataTable.ext.oApi._fnGetObjectDataFn( this.c.dataSrc )
69
+ dt: new DataTable.Api( dt )
72
70
  };
73
71
 
74
72
  // DOM items
@@ -107,7 +105,6 @@ $.extend( RowGroup.prototype, {
107
105
  var dt = this.s.dt;
108
106
 
109
107
  this.c.dataSrc = val;
110
- this.s.dataFn = DataTable.ext.oApi._fnGetObjectDataFn( this.c.dataSrc );
111
108
 
112
109
  $(dt.table().node()).triggerHandler( 'rowgroup-datasrc.dt', [ dt, val ] );
113
110
 
@@ -146,17 +143,6 @@ $.extend( RowGroup.prototype, {
146
143
  {
147
144
  var that = this;
148
145
  var dt = this.s.dt;
149
- var rows = dt.rows();
150
- var groups = [];
151
-
152
- rows.every( function () {
153
- var d = this.data();
154
- var group = that.s.dataFn( d );
155
-
156
- if ( groups.indexOf(group) == -1 ) {
157
- groups.push( group );
158
- }
159
- } );
160
146
 
161
147
  dt.on( 'draw.dtrg', function () {
162
148
  if ( that.c.enable ) {
@@ -171,6 +157,10 @@ $.extend( RowGroup.prototype, {
171
157
  dt.on( 'destroy', function () {
172
158
  dt.off( '.dtrg' );
173
159
  } );
160
+
161
+ dt.on('responsive-resize.dt', function () {
162
+ that._adjustColspan();
163
+ })
174
164
  },
175
165
 
176
166
 
@@ -184,7 +174,7 @@ $.extend( RowGroup.prototype, {
184
174
  */
185
175
  _adjustColspan: function ()
186
176
  {
187
- $( 'tr.'+this.c.className, this.s.dt.table().body() )
177
+ $( 'tr.'+this.c.className, this.s.dt.table().body() ).find('td')
188
178
  .attr( 'colspan', this._colspan() );
189
179
  },
190
180
 
@@ -199,76 +189,137 @@ $.extend( RowGroup.prototype, {
199
189
  }, 0 );
200
190
  },
201
191
 
192
+
202
193
  /**
203
- * Update function that is called whenever we need to draw the grouping rows
194
+ * Update function that is called whenever we need to draw the grouping rows.
195
+ * This is basically a bootstrap for the self iterative _group and _groupDisplay
196
+ * methods
204
197
  * @private
205
198
  */
206
199
  _draw: function ()
207
200
  {
208
- var that = this;
209
201
  var dt = this.s.dt;
210
- var rows = dt.rows( { page: 'current' } );
211
- var groupedRows = [];
212
- var last, display;
202
+ var groupedRows = this._group( 0, dt.rows( { page: 'current' } ).indexes() );
203
+
204
+ this._groupDisplay( 0, groupedRows );
205
+ },
206
+
207
+ /**
208
+ * Get the grouping information from a data set (index) of rows
209
+ * @param {number} level Nesting level
210
+ * @param {DataTables.Api} rows API of the rows to consider for this group
211
+ * @returns {object[]} Nested grouping information - it is structured like this:
212
+ * {
213
+ * dataPoint: 'Edinburgh',
214
+ * rows: [ 1,2,3,4,5,6,7 ],
215
+ * children: [ {
216
+ * dataPoint: 'developer'
217
+ * rows: [ 1, 2, 3 ]
218
+ * },
219
+ * {
220
+ * dataPoint: 'support',
221
+ * rows: [ 4, 5, 6, 7 ]
222
+ * } ]
223
+ * }
224
+ * @private
225
+ */
226
+ _group: function ( level, rows ) {
227
+ var fns = $.isArray( this.c.dataSrc ) ? this.c.dataSrc : [ this.c.dataSrc ];
228
+ var fn = DataTable.ext.oApi._fnGetObjectDataFn( fns[ level ] );
229
+ var dt = this.s.dt;
230
+ var group, last;
231
+ var data = [];
232
+ var that = this;
213
233
 
214
- rows.every( function () {
215
- var d = this.data();
216
- var group = that.s.dataFn( d );
234
+ for ( var i=0, ien=rows.length ; i<ien ; i++ ) {
235
+ var rowIndex = rows[i];
236
+ var rowData = dt.row( rowIndex ).data();
237
+ var group = fn( rowData );
217
238
 
218
239
  if ( group === null || group === undefined ) {
219
240
  group = that.c.emptyDataGroup;
220
241
  }
221
242
 
222
243
  if ( last === undefined || group !== last ) {
223
- groupedRows.push( [] );
244
+ data.push( {
245
+ dataPoint: group,
246
+ rows: []
247
+ } );
248
+
224
249
  last = group;
225
250
  }
226
-
227
- groupedRows[ groupedRows.length - 1 ].push( this.index() );
228
- } );
229
251
 
230
- for ( var i=0, ien=groupedRows.length ; i<ien ; i++ ) {
231
- var group = groupedRows[i];
232
- var firstRow = dt.row(group[0]);
233
- var groupName = this.s.dataFn( firstRow.data() );
252
+ data[ data.length-1 ].rows.push( rowIndex );
253
+ }
254
+
255
+ if ( fns[ level+1 ] !== undefined ) {
256
+ for ( var i=0, ien=data.length ; i<ien ; i++ ) {
257
+ data[i].children = this._group( level+1, data[i].rows );
258
+ }
259
+ }
260
+
261
+ return data;
262
+ },
263
+
264
+ /**
265
+ * Row group display - insert the rows into the document
266
+ * @param {number} level Nesting level
267
+ * @param {object[]} groups Takes the nested array from `_group`
268
+ * @private
269
+ */
270
+ _groupDisplay: function ( level, groups )
271
+ {
272
+ var dt = this.s.dt;
273
+ var display;
274
+
275
+ for ( var i=0, ien=groups.length ; i<ien ; i++ ) {
276
+ var group = groups[i];
277
+ var groupName = group.dataPoint;
234
278
  var row;
279
+ var rows = group.rows;
235
280
 
236
281
  if ( this.c.startRender ) {
237
- display = this.c.startRender.call( this, dt.rows(group), groupName );
238
- row = this._rowWrap( display, this.c.startClassName );
282
+ display = this.c.startRender.call( this, dt.rows(rows), groupName, level );
283
+ row = this._rowWrap( display, this.c.startClassName, level );
239
284
 
240
285
  if ( row ) {
241
- row.insertBefore( firstRow.node() );
286
+ row.insertBefore( dt.row( rows[0] ).node() );
242
287
  }
243
288
  }
244
289
 
245
290
  if ( this.c.endRender ) {
246
- display = this.c.endRender.call( this, dt.rows(group), groupName );
247
- row = this._rowWrap( display, this.c.endClassName );
291
+ display = this.c.endRender.call( this, dt.rows(rows), groupName, level );
292
+ row = this._rowWrap( display, this.c.endClassName, level );
248
293
 
249
294
  if ( row ) {
250
- row.insertAfter( dt.row( group[ group.length-1 ] ).node() );
295
+ row.insertAfter( dt.row( rows[ rows.length-1 ] ).node() );
251
296
  }
252
297
  }
298
+
299
+ if ( group.children ) {
300
+ this._groupDisplay( level+1, group.children );
301
+ }
253
302
  }
254
303
  },
255
304
 
256
305
  /**
257
306
  * Take a rendered value from an end user and make it suitable for display
258
307
  * as a row, by wrapping it in a row, or detecting that it is a row.
259
- * @param [node|jQuery|string] display Display value
260
- * @param [string] className Class to add to the row
308
+ * @param {node|jQuery|string} display Display value
309
+ * @param {string} className Class to add to the row
310
+ * @param {array} group
311
+ * @param {number} group level
261
312
  * @private
262
313
  */
263
- _rowWrap: function ( display, className )
314
+ _rowWrap: function ( display, className, level )
264
315
  {
265
316
  var row;
266
317
 
267
- if ( display === null || display === undefined || display === '' ) {
318
+ if ( display === null || display === '' ) {
268
319
  display = this.c.emptyDataGroup;
269
320
  }
270
321
 
271
- if ( display === null ) {
322
+ if ( display === undefined || display === null ) {
272
323
  return null;
273
324
  }
274
325
 
@@ -289,7 +340,8 @@ $.extend( RowGroup.prototype, {
289
340
 
290
341
  return row
291
342
  .addClass( this.c.className )
292
- .addClass( className );
343
+ .addClass( className )
344
+ .addClass( 'dtrg-level-'+level );
293
345
  }
294
346
  } );
295
347
 
@@ -307,11 +359,11 @@ RowGroup.defaults = {
307
359
  * end grouping rows.
308
360
  * @type string
309
361
  */
310
- className: 'group',
362
+ className: 'dtrg-group',
311
363
 
312
364
  /**
313
365
  * Data property from which to read the grouping information
314
- * @type string|integer
366
+ * @type string|integer|array
315
367
  */
316
368
  dataSrc: 0,
317
369
 
@@ -331,7 +383,7 @@ RowGroup.defaults = {
331
383
  * Class name to give to the end grouping row
332
384
  * @type string
333
385
  */
334
- endClassName: 'group-end',
386
+ endClassName: 'dtrg-end',
335
387
 
336
388
  /**
337
389
  * End grouping label function
@@ -343,7 +395,7 @@ RowGroup.defaults = {
343
395
  * Class name to give to the start grouping row
344
396
  * @type string
345
397
  */
346
- startClassName: 'group-start',
398
+ startClassName: 'dtrg-start',
347
399
 
348
400
  /**
349
401
  * Start grouping label function
@@ -355,7 +407,7 @@ RowGroup.defaults = {
355
407
  };
356
408
 
357
409
 
358
- RowGroup.version = "1.0.3";
410
+ RowGroup.version = "1.1.1";
359
411
 
360
412
 
361
413
  $.fn.dataTable.RowGroup = RowGroup;
@@ -1,4 +1,4 @@
1
- /*! Bootstrap 4 styling wrapper for RowGroup
1
+ /*! Foundation styling wrapper for RowGroup
2
2
  * ©2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
@@ -1,15 +1,15 @@
1
- /*! RowReorder 1.2.5
2
- * 2015-2018 SpryMedia Ltd - datatables.net/license
1
+ /*! RowReorder 1.2.6
2
+ * 2015-2019 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4
 
5
5
  /**
6
6
  * @summary RowReorder
7
7
  * @description Row reordering extension for DataTables
8
- * @version 1.2.5
8
+ * @version 1.2.6
9
9
  * @file dataTables.rowReorder.js
10
10
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
11
11
  * @contact www.sprymedia.co.uk/contact
12
- * @copyright Copyright 2015-2018 SpryMedia Ltd.
12
+ * @copyright Copyright 2015-2019 SpryMedia Ltd.
13
13
  *
14
14
  * This source file is free software, available under the following license:
15
15
  * MIT license - http://datatables.net/license/mit
@@ -528,10 +528,11 @@ $.extend( RowReorder.prototype, {
528
528
 
529
529
  // Create event args
530
530
  var eventArgs = [ fullDiff, {
531
- dataSrc: dataSrc,
532
- nodes: diffNodes,
533
- values: idDiff,
534
- triggerRow: dt.row( this.dom.target )
531
+ dataSrc: dataSrc,
532
+ nodes: diffNodes,
533
+ values: idDiff,
534
+ triggerRow: dt.row( this.dom.target ),
535
+ originalEvent: e
535
536
  } ];
536
537
 
537
538
  // Emit event
@@ -788,7 +789,7 @@ Api.register( 'rowReorder.disable()', function () {
788
789
  * @name RowReorder.version
789
790
  * @static
790
791
  */
791
- RowReorder.version = '1.2.5';
792
+ RowReorder.version = '1.2.6';
792
793
 
793
794
 
794
795
  $.fn.dataTable.RowReorder = RowReorder;
@@ -1,4 +1,4 @@
1
- /*! Bootstrap 4 styling wrapper for RowReorder
1
+ /*! Foundation styling wrapper for RowReorder
2
2
  * ©2018 SpryMedia Ltd - datatables.net/license
3
3
  */
4
4