jquery-datatables 1.10.13 → 1.10.15

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/Rakefile +1 -1
  4. data/app/assets/javascripts/datatables/dataTables.bootstrap2.js +162 -0
  5. data/app/assets/javascripts/datatables/dataTables.bootstrap4.js +7 -7
  6. data/app/assets/javascripts/datatables/dataTables.semanticui.js +2 -2
  7. data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +104 -13
  8. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +17 -9
  9. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +41 -15
  10. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +48 -18
  11. data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +29 -13
  12. data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +46 -5
  13. data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +37 -19
  14. data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +65 -37
  15. data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +386 -0
  16. data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +24 -14
  17. data/app/assets/javascripts/datatables/jquery.dataTables.js +48 -10
  18. data/app/assets/stylesheets/datatables/dataTables.bootstrap.css +7 -7
  19. data/app/assets/stylesheets/datatables/dataTables.bootstrap2.css +178 -0
  20. data/app/assets/stylesheets/datatables/dataTables.bootstrap4.css +1 -0
  21. data/app/assets/stylesheets/datatables/dataTables.foundation.css +8 -6
  22. data/app/assets/stylesheets/datatables/dataTables.jqueryui.css +6 -5
  23. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap.css +56 -0
  24. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.bootstrap4.css +56 -0
  25. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.css +56 -0
  26. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.foundation.css +60 -0
  27. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.css +56 -0
  28. data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.semanticui.css +57 -0
  29. data/app/assets/stylesheets/datatables/extensions/Buttons/mixins.scss +47 -0
  30. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap.css +4 -0
  31. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.bootstrap4.css +4 -0
  32. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.dataTables.css +4 -0
  33. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.foundation.css +4 -0
  34. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.jqueryui.css +4 -0
  35. data/app/assets/stylesheets/datatables/extensions/RowGroup/rowGroup.semanticui.css +4 -0
  36. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap.css +7 -7
  37. data/app/assets/stylesheets/datatables/extensions/Select/select.bootstrap4.css +7 -7
  38. data/app/assets/stylesheets/datatables/extensions/Select/select.dataTables.css +7 -7
  39. data/app/assets/stylesheets/datatables/extensions/Select/select.foundation.css +7 -7
  40. data/app/assets/stylesheets/datatables/extensions/Select/select.jqueryui.css +7 -7
  41. data/app/assets/stylesheets/datatables/extensions/Select/select.semanticui.css +7 -7
  42. data/app/assets/stylesheets/datatables/jquery.dataTables.css +14 -11
  43. data/lib/generators/jquery/datatables/templates/bootstrap2.css.tt +15 -0
  44. data/lib/generators/jquery/datatables/templates/bootstrap2.js.tt +22 -0
  45. data/lib/jquery-datatables/version.rb +1 -1
  46. metadata +14 -3
@@ -1,4 +1,4 @@
1
- /*! Select for DataTables 1.2.1
1
+ /*! Select for DataTables 1.2.2
2
2
  * 2015-2016 SpryMedia Ltd - datatables.net/license/mit
3
3
  */
4
4
 
@@ -6,7 +6,7 @@
6
6
  * @summary Select for DataTables
7
7
  * @description A collection of API methods, events and buttons for DataTables
8
8
  * that provides selection options of the items in a DataTable
9
- * @version 1.2.1
9
+ * @version 1.2.2
10
10
  * @file dataTables.select.js
11
11
  * @author SpryMedia Ltd (www.sprymedia.co.uk)
12
12
  * @contact datatables.net/forums
@@ -54,7 +54,7 @@ var DataTable = $.fn.dataTable;
54
54
  // Version information for debugger
55
55
  DataTable.select = {};
56
56
 
57
- DataTable.select.version = '1.2.1';
57
+ DataTable.select.version = '1.2.2';
58
58
 
59
59
  DataTable.select.init = function ( dt ) {
60
60
  var ctx = dt.settings()[0];
@@ -310,7 +310,7 @@ function disableMouseSelection( dt )
310
310
  .off( 'mouseup.dtSelect', selector )
311
311
  .off( 'click.dtSelect', selector );
312
312
 
313
- $('body').off( 'click.dtSelect' );
313
+ $('body').off( 'click.dtSelect' + dt.table().node().id );
314
314
  }
315
315
 
316
316
  /**
@@ -348,7 +348,7 @@ function enableMouseSelection ( dt )
348
348
 
349
349
  // If text was selected (click and drag), then we shouldn't change
350
350
  // the row's selected state
351
- if ( window.getSelection && window.getSelection().toString() ) {
351
+ if ( window.getSelection && $.trim( window.getSelection().toString() ) ) {
352
352
  return;
353
353
  }
354
354
 
@@ -392,13 +392,19 @@ function enableMouseSelection ( dt )
392
392
  } );
393
393
 
394
394
  // Blurable
395
- $('body').on( 'click.dtSelect', function ( e ) {
395
+ $('body').on( 'click.dtSelect' + dt.table().node().id, function ( e ) {
396
396
  if ( ctx._select.blurable ) {
397
397
  // If the click was inside the DataTables container, don't blur
398
398
  if ( $(e.target).parents().filter( dt.table().container() ).length ) {
399
399
  return;
400
400
  }
401
401
 
402
+ // Ignore elements which have been removed from the DOM (i.e. paging
403
+ // buttons)
404
+ if ( e.target.getRootNode() !== document ) {
405
+ return;
406
+ }
407
+
402
408
  // Don't blur in Editor form
403
409
  if ( $(e.target).parents('div.DTE').length ) {
404
410
  return;
@@ -431,7 +437,7 @@ function eventTrigger ( api, type, args, any )
431
437
 
432
438
  args.unshift( api );
433
439
 
434
- $(api.table().node()).triggerHandler( type, args );
440
+ $(api.table().node()).trigger( type, args );
435
441
  }
436
442
 
437
443
  /**
@@ -449,23 +455,27 @@ function info ( api )
449
455
  return;
450
456
  }
451
457
 
452
- var output = $('<span class="select-info"/>');
453
- var add = function ( name, num ) {
454
- output.append( $('<span class="select-item"/>').append( api.i18n(
458
+ var rows = api.rows( { selected: true } ).flatten().length;
459
+ var columns = api.columns( { selected: true } ).flatten().length;
460
+ var cells = api.cells( { selected: true } ).flatten().length;
461
+
462
+ var add = function ( el, name, num ) {
463
+ el.append( $('<span class="select-item"/>').append( api.i18n(
455
464
  'select.'+name+'s',
456
465
  { _: '%d '+name+'s selected', 0: '', 1: '1 '+name+' selected' },
457
466
  num
458
467
  ) ) );
459
468
  };
460
469
 
461
- add( 'row', api.rows( { selected: true } ).flatten().length );
462
- add( 'column', api.columns( { selected: true } ).flatten().length );
463
- add( 'cell', api.cells( { selected: true } ).flatten().length );
464
-
465
470
  // Internal knowledge of DataTables to loop over all information elements
466
471
  $.each( ctx.aanFeatures.i, function ( i, el ) {
467
472
  el = $(el);
468
473
 
474
+ var output = $('<span class="select-info"/>');
475
+ add( output, 'row', rows );
476
+ add( output, 'column', columns );
477
+ add( output, 'cell', cells );
478
+
469
479
  var exisiting = el.children('span.select-info');
470
480
  if ( exisiting.length ) {
471
481
  exisiting.remove();
@@ -1,15 +1,15 @@
1
- /*! DataTables 1.10.13
2
- * ©2008-2016 SpryMedia Ltd - datatables.net/license
1
+ /*! DataTables 1.10.15
2
+ * ©2008-2017 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.10.13
8
+ * @version 1.10.15
9
9
  * @file jquery.dataTables.js
10
10
  * @author SpryMedia Ltd
11
11
  * @contact www.datatables.net
12
- * @copyright Copyright 2008-2016 SpryMedia Ltd.
12
+ * @copyright Copyright 2008-2017 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
@@ -1540,6 +1540,35 @@
1540
1540
  };
1541
1541
 
1542
1542
 
1543
+ /**
1544
+ * Determine if all values in the array are unique. This means we can short
1545
+ * cut the _unique method at the cost of a single loop. A sorted array is used
1546
+ * to easily check the values.
1547
+ *
1548
+ * @param {array} src Source array
1549
+ * @return {boolean} true if all unique, false otherwise
1550
+ * @ignore
1551
+ */
1552
+ var _areAllUnique = function ( src ) {
1553
+ if ( src.length < 2 ) {
1554
+ return true;
1555
+ }
1556
+
1557
+ var sorted = src.slice().sort();
1558
+ var last = sorted[0];
1559
+
1560
+ for ( var i=1, ien=sorted.length ; i<ien ; i++ ) {
1561
+ if ( sorted[i] === last ) {
1562
+ return false;
1563
+ }
1564
+
1565
+ last = sorted[i];
1566
+ }
1567
+
1568
+ return true;
1569
+ };
1570
+
1571
+
1543
1572
  /**
1544
1573
  * Find the unique elements in a source array.
1545
1574
  *
@@ -1549,6 +1578,10 @@
1549
1578
  */
1550
1579
  var _unique = function ( src )
1551
1580
  {
1581
+ if ( _areAllUnique( src ) ) {
1582
+ return src.slice();
1583
+ }
1584
+
1552
1585
  // A faster unique method is to use object keys to identify used values,
1553
1586
  // but this doesn't work with arrays or objects, which we must also
1554
1587
  // consider. See jsperf.com/compare-array-unique-versions/4 for more
@@ -1822,7 +1855,7 @@
1822
1855
 
1823
1856
  // orderData can be given as an integer
1824
1857
  var dataSort = init.aDataSort;
1825
- if ( dataSort && ! $.isArray( dataSort ) ) {
1858
+ if ( typeof dataSort === 'number' && ! $.isArray( dataSort ) ) {
1826
1859
  init.aDataSort = [ dataSort ];
1827
1860
  }
1828
1861
  }
@@ -6311,7 +6344,7 @@
6311
6344
 
6312
6345
  // Allow custom and plug-in manipulation functions to alter the saved data set and
6313
6346
  // cancelling of loading by returning false
6314
- var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, state] );
6347
+ var abStateLoad = _fnCallbackFire( settings, 'aoStateLoadParams', 'stateLoadParams', [settings, s] );
6315
6348
  if ( $.inArray( false, abStateLoad ) !== -1 ) {
6316
6349
  callback();
6317
6350
  return;
@@ -6331,7 +6364,7 @@
6331
6364
  }
6332
6365
 
6333
6366
  // Store the saved state so it might be accessed at any time
6334
- settings.oLoadedState = $.extend( true, {}, state );
6367
+ settings.oLoadedState = $.extend( true, {}, s );
6335
6368
 
6336
6369
  // Restore key features - todo - for 1.11 this needs to be done by
6337
6370
  // subscribed events
@@ -6360,7 +6393,7 @@
6360
6393
  }
6361
6394
 
6362
6395
  // Columns
6363
- //
6396
+ //
6364
6397
  if ( s.columns ) {
6365
6398
  for ( i=0, ien=s.columns.length ; i<ien ; i++ ) {
6366
6399
  var col = s.columns[i];
@@ -6377,7 +6410,7 @@
6377
6410
  }
6378
6411
  }
6379
6412
 
6380
- _fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, state] );
6413
+ _fnCallbackFire( settings, 'aoStateLoaded', 'stateLoaded', [settings, s] );
6381
6414
  callback();
6382
6415
  }
6383
6416
 
@@ -7109,6 +7142,11 @@
7109
7142
  shift: __arrayProto.shift,
7110
7143
 
7111
7144
 
7145
+ slice: function () {
7146
+ return new _Api( this.context, this );
7147
+ },
7148
+
7149
+
7112
7150
  sort: __arrayProto.sort, // ? name - order?
7113
7151
 
7114
7152
 
@@ -9396,7 +9434,7 @@
9396
9434
  * @type string
9397
9435
  * @default Version number
9398
9436
  */
9399
- DataTable.version = "1.10.13";
9437
+ DataTable.version = "1.10.15";
9400
9438
 
9401
9439
  /**
9402
9440
  * Private data store, containing all of the settings objects that are
@@ -117,22 +117,22 @@ div.dataTables_scrollHead table.dataTable {
117
117
  margin-bottom: 0 !important;
118
118
  }
119
119
 
120
- div.dataTables_scrollBody table {
120
+ div.dataTables_scrollBody > table {
121
121
  border-top: none;
122
122
  margin-top: 0 !important;
123
123
  margin-bottom: 0 !important;
124
124
  }
125
- div.dataTables_scrollBody table thead .sorting:after,
126
- div.dataTables_scrollBody table thead .sorting_asc:after,
127
- div.dataTables_scrollBody table thead .sorting_desc:after {
125
+ div.dataTables_scrollBody > table > thead .sorting:after,
126
+ div.dataTables_scrollBody > table > thead .sorting_asc:after,
127
+ div.dataTables_scrollBody > table > thead .sorting_desc:after {
128
128
  display: none;
129
129
  }
130
- div.dataTables_scrollBody table tbody tr:first-child th,
131
- div.dataTables_scrollBody table tbody tr:first-child td {
130
+ div.dataTables_scrollBody > table > tbody > tr:first-child > th,
131
+ div.dataTables_scrollBody > table > tbody > tr:first-child > td {
132
132
  border-top: none;
133
133
  }
134
134
 
135
- div.dataTables_scrollFoot table {
135
+ div.dataTables_scrollFoot > table {
136
136
  margin-top: 0 !important;
137
137
  border-top: none;
138
138
  }
@@ -0,0 +1,178 @@
1
+
2
+ div.dataTables_length label {
3
+ float: left;
4
+ text-align: left;
5
+ }
6
+
7
+ div.dataTables_length select {
8
+ width: 75px;
9
+ }
10
+
11
+ div.dataTables_filter label {
12
+ float: right;
13
+ }
14
+
15
+ div.dataTables_info {
16
+ padding-top: 8px;
17
+ }
18
+
19
+ div.dataTables_paginate {
20
+ float: right;
21
+ margin: 0;
22
+ }
23
+
24
+ table.table {
25
+ clear: both;
26
+ margin-bottom: 6px !important;
27
+ max-width: none !important;
28
+ }
29
+
30
+ table.table thead .sorting,
31
+ table.table thead .sorting_asc,
32
+ table.table thead .sorting_desc,
33
+ table.table thead .sorting_asc_disabled,
34
+ table.table thead .sorting_desc_disabled {
35
+ cursor: pointer;
36
+ *cursor: hand;
37
+ }
38
+
39
+ table.table thead .sorting { background: url(/assets/datatables/sort_both.png) no-repeat center right; }
40
+ table.table thead .sorting_asc { background: url(/assets/datatables/sort_asc.png) no-repeat center right; }
41
+ table.table thead .sorting_desc { background: url(/assets/datatables/sort_desc.png) no-repeat center right; }
42
+
43
+ table.table thead .sorting_asc_disabled { background: url('/assets/datatables/sort_asc_disabled.png') no-repeat center right; }
44
+ table.table thead .sorting_desc_disabled { background: url('/assets/datatables/sort_desc_disabled.png') no-repeat center right; }
45
+
46
+ table.dataTable th:active {
47
+ outline: none;
48
+ }
49
+
50
+ /* Scrolling */
51
+ div.dataTables_scrollHead table {
52
+ margin-bottom: 0 !important;
53
+ border-bottom-left-radius: 0;
54
+ border-bottom-right-radius: 0;
55
+ }
56
+
57
+ div.dataTables_scrollHead table thead tr:last-child th:first-child,
58
+ div.dataTables_scrollHead table thead tr:last-child td:first-child {
59
+ border-bottom-left-radius: 0 !important;
60
+ border-bottom-right-radius: 0 !important;
61
+ }
62
+
63
+ div.dataTables_scrollBody table {
64
+ border-top: none;
65
+ margin-bottom: 0 !important;
66
+ }
67
+
68
+ div.dataTables_scrollBody tbody tr:first-child th,
69
+ div.dataTables_scrollBody tbody tr:first-child td {
70
+ border-top: none;
71
+ }
72
+
73
+ div.dataTables_scrollFoot table {
74
+ border-top: none;
75
+ }
76
+
77
+
78
+
79
+
80
+ /*
81
+ * TableTools styles
82
+ */
83
+ .table tbody tr.active td,
84
+ .table tbody tr.active th {
85
+ background-color: #08C;
86
+ color: white;
87
+ }
88
+
89
+ .table tbody tr.active:hover td,
90
+ .table tbody tr.active:hover th {
91
+ background-color: #0075b0 !important;
92
+ }
93
+
94
+ .table-striped tbody tr.active:nth-child(odd) td,
95
+ .table-striped tbody tr.active:nth-child(odd) th {
96
+ background-color: #017ebc;
97
+ }
98
+
99
+ table.DTTT_selectable tbody tr {
100
+ cursor: pointer;
101
+ *cursor: hand;
102
+ }
103
+
104
+ div.DTTT .btn {
105
+ color: #333 !important;
106
+ font-size: 12px;
107
+ }
108
+
109
+ div.DTTT .btn:hover {
110
+ text-decoration: none !important;
111
+ }
112
+
113
+
114
+ ul.DTTT_dropdown.dropdown-menu a {
115
+ color: #333 !important; /* needed only when demo_page.css is included */
116
+ }
117
+
118
+ ul.DTTT_dropdown.dropdown-menu li:hover a {
119
+ background-color: #0088cc;
120
+ color: white !important;
121
+ }
122
+
123
+ /* TableTools information display */
124
+ div.DTTT_print_info.modal {
125
+ height: 150px;
126
+ margin-top: -75px;
127
+ text-align: center;
128
+ }
129
+
130
+ div.DTTT_print_info h6 {
131
+ font-weight: normal;
132
+ font-size: 28px;
133
+ line-height: 28px;
134
+ margin: 1em;
135
+ }
136
+
137
+ div.DTTT_print_info p {
138
+ font-size: 14px;
139
+ line-height: 20px;
140
+ }
141
+
142
+
143
+
144
+ /*
145
+ * FixedColumns styles
146
+ */
147
+ div.DTFC_LeftHeadWrapper table,
148
+ div.DTFC_LeftFootWrapper table,
149
+ table.DTFC_Cloned tr.even {
150
+ background-color: white;
151
+ }
152
+
153
+ div.DTFC_LeftHeadWrapper table {
154
+ margin-bottom: 0 !important;
155
+ border-top-right-radius: 0 !important;
156
+ border-bottom-left-radius: 0 !important;
157
+ border-bottom-right-radius: 0 !important;
158
+ }
159
+
160
+ div.DTFC_LeftHeadWrapper table thead tr:last-child th:first-child,
161
+ div.DTFC_LeftHeadWrapper table thead tr:last-child td:first-child {
162
+ border-bottom-left-radius: 0 !important;
163
+ border-bottom-right-radius: 0 !important;
164
+ }
165
+
166
+ div.DTFC_LeftBodyWrapper table {
167
+ border-top: none;
168
+ margin-bottom: 0 !important;
169
+ }
170
+
171
+ div.DTFC_LeftBodyWrapper tbody tr:first-child th,
172
+ div.DTFC_LeftBodyWrapper tbody tr:first-child td {
173
+ border-top: none;
174
+ }
175
+
176
+ div.DTFC_LeftFootWrapper table {
177
+ border-top: none;
178
+ }
@@ -53,6 +53,7 @@ div.dataTables_wrapper div.dataTables_paginate {
53
53
  div.dataTables_wrapper div.dataTables_paginate ul.pagination {
54
54
  margin: 2px 0;
55
55
  white-space: nowrap;
56
+ justify-content: flex-end;
56
57
  }
57
58
  div.dataTables_wrapper div.dataTables_processing {
58
59
  position: absolute;