jquery-datatables 1.10.16 → 1.10.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +2 -0
- data/app/assets/javascripts/datatables/dataTables.foundation.js +2 -2
- data/app/assets/javascripts/datatables/dataTables.uikit.js +1 -1
- data/app/assets/javascripts/datatables/extensions/AutoFill/autoFill.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js +52 -12
- data/app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js +4 -8
- data/app/assets/javascripts/datatables/extensions/Buttons/buttons.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Buttons/buttons.flash.js +17 -7
- data/app/assets/javascripts/datatables/extensions/Buttons/buttons.html5.js +33 -19
- data/app/assets/javascripts/datatables/extensions/Buttons/buttons.print.js +14 -3
- data/app/assets/javascripts/datatables/extensions/Buttons/dataTables.buttons.js +120 -53
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/colReorder.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/ColReorder/dataTables.colReorder.js +76 -13
- data/app/assets/javascripts/datatables/extensions/FixedColumns/dataTables.fixedColumns.js +23 -17
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedColumns/fixedColumns.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/dataTables.fixedHeader.js +26 -11
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/FixedHeader/fixedHeader.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/dataTables.keyTable.js +141 -75
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/KeyTable/keyTable.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Responsive/dataTables.responsive.js +64 -26
- data/app/assets/javascripts/datatables/extensions/Responsive/responsive.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/dataTables.rowGroup.js +45 -13
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowGroup/rowGroup.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/dataTables.rowReorder.js +24 -6
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/RowReorder/rowReorder.semanicui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/dataTables.scroller.js +93 -87
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Scroller/scroller.semanticui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/dataTables.select.js +41 -14
- data/app/assets/javascripts/datatables/extensions/Select/select.bootstrap.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/select.bootstrap4.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/select.dataTables.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/select.foundation.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/select.jqueryui.js +38 -0
- data/app/assets/javascripts/datatables/extensions/Select/select.semanticui.js +38 -0
- data/app/assets/javascripts/datatables/jquery.dataTables.js +125 -72
- data/app/assets/stylesheets/datatables/dataTables.bootstrap4.scss +4 -0
- data/app/assets/stylesheets/datatables/dataTables.foundation.scss +5 -5
- data/app/assets/stylesheets/datatables/dataTables.material.scss +1 -1
- data/app/assets/stylesheets/datatables/dataTables.uikit.scss +33 -22
- data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap.scss +9 -0
- data/app/assets/stylesheets/datatables/extensions/AutoFill/autoFill.bootstrap4.scss +9 -0
- data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.dataTables.scss +3 -2
- data/app/assets/stylesheets/datatables/extensions/Buttons/buttons.jqueryui.scss +2 -4
- data/app/assets/stylesheets/datatables/extensions/Buttons/mixins.scss +5 -0
- data/app/assets/stylesheets/datatables/extensions/FixedColumns/fixedColumns.bootstrap4.scss +3 -6
- data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap.scss +1 -1
- data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.bootstrap4.scss +1 -1
- data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.dataTables.scss +6 -5
- data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.foundation.scss +1 -1
- data/app/assets/stylesheets/datatables/extensions/KeyTable/keyTable.semanticui.scss +1 -1
- data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap.scss +1 -1
- data/app/assets/stylesheets/datatables/extensions/Scroller/scroller.bootstrap4.scss +2 -4
- data/app/assets/stylesheets/datatables/jquery.dataTables.scss +5 -5
- data/jquery-datatables.gemspec +4 -2
- data/lib/generators/jquery/datatables/install_generator.rb +22 -6
- data/lib/generators/jquery/datatables/templates/{bootstrap.js.tt → javascripts/bootstrap.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{bootstrap4.js.tt → javascripts/bootstrap4.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{foundation.js.tt → javascripts/foundation.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/javascripts/initializer.js.tt +30 -0
- data/lib/generators/jquery/datatables/templates/{jqueryui.js.tt → javascripts/jqueryui.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{material.js.tt → javascripts/material.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{regular.js.tt → javascripts/regular.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{semanticui.js.tt → javascripts/semanticui.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{uikit.js.tt → javascripts/uikit.js.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{bootstrap.scss.tt → stylesheets/bootstrap.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{bootstrap4.scss.tt → stylesheets/bootstrap4.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{foundation.scss.tt → stylesheets/foundation.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{jqueryui.scss.tt → stylesheets/jqueryui.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{material.scss.tt → stylesheets/material.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{regular.scss.tt → stylesheets/regular.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{semanticui.scss.tt → stylesheets/semanticui.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/{uikit.scss.tt → stylesheets/uikit.scss.tt} +0 -0
- data/lib/generators/jquery/datatables/templates/views/index.html.erb +17 -0
- data/lib/generators/jquery/datatables/templates/views/index.html.slim +12 -0
- data/lib/generators/jquery/datatables/templates/views/index.json.jbuilder +10 -0
- data/lib/jquery-datatables.rb +53 -5
- data/lib/jquery-datatables/engine.rb +2 -0
- data/lib/jquery-datatables/version.rb +1 -1
- metadata +86 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 681cbce4e90454b5a033b6082241a8cabcfe3872558a5c39ad35eee32944f32b
|
4
|
+
data.tar.gz: c619f8924e5f9b43e1e237379a581fbe17b04cd2f4ff60888504aabafb011140
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 783b181782fd948624f1a29d4f8fa9c72b1e83c8a75ddf385b851404adbb1cf5af85481c14251ecb95051841a4ab40d66a59eb2fe750e9535630192a845fb1d4
|
7
|
+
data.tar.gz: e6f67600ae98753348aaa32cbb785a9ec142d5827f60a0978b0c02a0c10ec83c7cf955b808d423c4d1b66bc0d900ad58ab01a335023491e097feff173f148b43
|
data/README.md
CHANGED
@@ -54,9 +54,9 @@ $.extend( DataTable.ext.classes, {
|
|
54
54
|
/* Set the defaults for DataTables initialisation */
|
55
55
|
$.extend( true, DataTable.defaults, {
|
56
56
|
dom:
|
57
|
-
"<'row'<'small-6 columns'l><'small-6 columns'f>r>"+
|
57
|
+
"<'row grid-x'<'small-6 columns cell'l><'small-6 columns cell'f>r>"+
|
58
58
|
"t"+
|
59
|
-
"<'row'<'small-6 columns'i><'small-6 columns'p>>",
|
59
|
+
"<'row grid-x'<'small-6 columns cell'i><'small-6 columns cell'p>>",
|
60
60
|
renderer: 'foundation'
|
61
61
|
} );
|
62
62
|
|
@@ -162,7 +162,7 @@ DataTable.ext.renderer.pageButton.uikit = function ( settings, host, idx, button
|
|
162
162
|
catch (e) {}
|
163
163
|
|
164
164
|
attach(
|
165
|
-
$(host).empty().html('<ul class="uk-pagination uk-pagination-right"/>').children('ul'),
|
165
|
+
$(host).empty().html('<ul class="uk-pagination uk-pagination-right uk-flex-right"/>').children('ul'),
|
166
166
|
buttons
|
167
167
|
);
|
168
168
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*! DataTables styling wrapper for AutoFill
|
2
|
+
* ©2018 SpryMedia Ltd - datatables.net/license
|
3
|
+
*/
|
4
|
+
|
5
|
+
(function( factory ){
|
6
|
+
if ( typeof define === 'function' && define.amd ) {
|
7
|
+
// AMD
|
8
|
+
define( ['jquery', 'datatables.net-dt', 'datatables.net-autofill'], function ( $ ) {
|
9
|
+
return factory( $, window, document );
|
10
|
+
} );
|
11
|
+
}
|
12
|
+
else if ( typeof exports === 'object' ) {
|
13
|
+
// CommonJS
|
14
|
+
module.exports = function (root, $) {
|
15
|
+
if ( ! root ) {
|
16
|
+
root = window;
|
17
|
+
}
|
18
|
+
|
19
|
+
if ( ! $ || ! $.fn.dataTable ) {
|
20
|
+
$ = require('datatables.net-dt')(root, $).$;
|
21
|
+
}
|
22
|
+
|
23
|
+
if ( ! $.fn.dataTable.AutoFill ) {
|
24
|
+
require('datatables.net-autofill')(root, $);
|
25
|
+
}
|
26
|
+
|
27
|
+
return factory( $, root, root.document );
|
28
|
+
};
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
// Browser
|
32
|
+
factory( jQuery, window, document );
|
33
|
+
}
|
34
|
+
}(function( $, window, document, undefined ) {
|
35
|
+
|
36
|
+
return $.fn.dataTable;
|
37
|
+
|
38
|
+
}));
|
@@ -1,15 +1,15 @@
|
|
1
|
-
/*! AutoFill 2.
|
2
|
-
* ©2008-
|
1
|
+
/*! AutoFill 2.3.0
|
2
|
+
* ©2008-2018 SpryMedia Ltd - datatables.net/license
|
3
3
|
*/
|
4
4
|
|
5
5
|
/**
|
6
6
|
* @summary AutoFill
|
7
7
|
* @description Add Excel like click and drag auto-fill options to DataTables
|
8
|
-
* @version 2.
|
8
|
+
* @version 2.3.0
|
9
9
|
* @file dataTables.autoFill.js
|
10
10
|
* @author SpryMedia Ltd (www.sprymedia.co.uk)
|
11
11
|
* @contact www.sprymedia.co.uk/contact
|
12
|
-
* @copyright Copyright 2010-
|
12
|
+
* @copyright Copyright 2010-2018 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
|
@@ -358,12 +358,16 @@ $.extend( AutoFill.prototype, {
|
|
358
358
|
var dt = this.s.dt;
|
359
359
|
var start = this.s.start;
|
360
360
|
var startCell = $(this.dom.start);
|
361
|
-
var endCell = $(target);
|
362
361
|
var end = {
|
363
|
-
row:
|
364
|
-
|
362
|
+
row: this.c.vertical ?
|
363
|
+
dt.rows( { page: 'current' } ).nodes().indexOf( target.parentNode ) :
|
364
|
+
start.row,
|
365
|
+
column: this.c.horizontal ?
|
366
|
+
$(target).index() :
|
367
|
+
start.column
|
365
368
|
};
|
366
369
|
var colIndx = dt.column.index( 'toData', end.column );
|
370
|
+
var endCell = $( dt.cell( ':eq('+end.row+')', colIndx ).node() );
|
367
371
|
|
368
372
|
// Be sure that is a DataTables controlled cell
|
369
373
|
if ( ! dt.cell( endCell ).any() ) {
|
@@ -587,16 +591,21 @@ $.extend( AutoFill.prototype, {
|
|
587
591
|
left = 0;
|
588
592
|
|
589
593
|
if ( ! targetParent ) {
|
590
|
-
targetParent = $( this.s.dt.table().node() ).offsetParent
|
594
|
+
targetParent = $( $( this.s.dt.table().node() )[0].offsetParent );
|
591
595
|
}
|
592
596
|
|
593
597
|
do {
|
594
598
|
position = currNode.position();
|
595
|
-
|
599
|
+
|
600
|
+
// jQuery doesn't give a `table` as the offset parent oddly, so use DOM directly
|
601
|
+
currOffsetParent = $( currNode[0].offsetParent );
|
596
602
|
|
597
603
|
top += position.top + currOffsetParent.scrollTop();
|
598
604
|
left += position.left + currOffsetParent.scrollLeft();
|
599
605
|
|
606
|
+
top += parseInt( currOffsetParent.css('margin-top') ) * 1;
|
607
|
+
top += parseInt( currOffsetParent.css('border-top-width') ) * 1;
|
608
|
+
|
600
609
|
// Emergency fall back. Shouldn't happen, but just in case!
|
601
610
|
if ( currNode.get(0).nodeName.toLowerCase() === 'body' ) {
|
602
611
|
break;
|
@@ -695,6 +704,7 @@ $.extend( AutoFill.prototype, {
|
|
695
704
|
{
|
696
705
|
$(document.body).off( '.autoFill' );
|
697
706
|
|
707
|
+
var that = this;
|
698
708
|
var dt = this.s.dt;
|
699
709
|
var select = this.dom.select;
|
700
710
|
select.top.remove();
|
@@ -713,6 +723,27 @@ $.extend( AutoFill.prototype, {
|
|
713
723
|
return;
|
714
724
|
}
|
715
725
|
|
726
|
+
var startDt = dt.cell( ':eq('+start.row+')', start.column+':visible', {page:'current'} );
|
727
|
+
|
728
|
+
// If Editor is active inside this cell (inline editing) we need to wait for Editor to
|
729
|
+
// submit and then we can loop back and trigger the fill.
|
730
|
+
if ( $('div.DTE', startDt.node()).length ) {
|
731
|
+
var editor = dt.editor();
|
732
|
+
|
733
|
+
editor
|
734
|
+
.on( 'submitSuccess.kt', function () {
|
735
|
+
editor.off( '.kt');
|
736
|
+
that._mouseup( e );
|
737
|
+
} )
|
738
|
+
.on( 'submitComplete.kt preSubmitCancelled.kt', function () {
|
739
|
+
editor.off( '.kt');
|
740
|
+
} );
|
741
|
+
|
742
|
+
editor.submit();
|
743
|
+
|
744
|
+
return;
|
745
|
+
}
|
746
|
+
|
716
747
|
// Build a matrix representation of the selected rows
|
717
748
|
var rows = this._range( start.row, end.row );
|
718
749
|
var columns = this._range( start.column, end.column );
|
@@ -950,7 +981,10 @@ $.extend( AutoFill.prototype, {
|
|
950
981
|
AutoFill.actions = {
|
951
982
|
increment: {
|
952
983
|
available: function ( dt, cells ) {
|
953
|
-
|
984
|
+
var d = cells[0][0].label;
|
985
|
+
|
986
|
+
// is numeric test based on jQuery's old `isNumeric` function
|
987
|
+
return !isNaN( d - parseFloat( d ) );
|
954
988
|
},
|
955
989
|
|
956
990
|
option: function ( dt, cells ) {
|
@@ -1055,7 +1089,7 @@ AutoFill.actions = {
|
|
1055
1089
|
* @static
|
1056
1090
|
* @type String
|
1057
1091
|
*/
|
1058
|
-
AutoFill.version = '2.
|
1092
|
+
AutoFill.version = '2.3.0';
|
1059
1093
|
|
1060
1094
|
|
1061
1095
|
/**
|
@@ -1080,7 +1114,13 @@ AutoFill.defaults = {
|
|
1080
1114
|
update: null, // false is editor given, true otherwise
|
1081
1115
|
|
1082
1116
|
/** @type {DataTable.Editor} Editor instance for automatic submission */
|
1083
|
-
editor: null
|
1117
|
+
editor: null,
|
1118
|
+
|
1119
|
+
/** @type {boolean} Enable vertical fill */
|
1120
|
+
vertical: true,
|
1121
|
+
|
1122
|
+
/** @type {boolean} Enable horizontal fill */
|
1123
|
+
horizontal: true
|
1084
1124
|
};
|
1085
1125
|
|
1086
1126
|
|
@@ -122,14 +122,8 @@ $.extend( DataTable.ext.buttons, {
|
|
122
122
|
return;
|
123
123
|
}
|
124
124
|
|
125
|
-
if ( typeof conf.columns === 'number' ) {
|
126
|
-
conf.columns = details.mapping[ conf.columns ];
|
127
|
-
}
|
128
|
-
|
129
|
-
var col = dt.column( conf.columns );
|
130
|
-
|
131
125
|
that.text( conf._columnText( dt, conf ) );
|
132
|
-
that.active(
|
126
|
+
that.active( dt.column( conf.columns ).visible() );
|
133
127
|
} );
|
134
128
|
|
135
129
|
this.active( dt.column( conf.columns ).visible() );
|
@@ -149,7 +143,9 @@ $.extend( DataTable.ext.buttons, {
|
|
149
143
|
var title = dt.settings()[0].aoColumns[ idx ].sTitle
|
150
144
|
.replace(/\n/g," ") // remove new lines
|
151
145
|
.replace(/<br\s*\/?>/gi, " ") // replace line breaks with spaces
|
152
|
-
.replace(
|
146
|
+
.replace(/<select(.*?)<\/select>/g, "") // remove select tags, including options text
|
147
|
+
.replace(/<!\-\-.*?\-\->/g, "") // strip HTML comments
|
148
|
+
.replace(/<.*?>/g, "") // strip HTML
|
153
149
|
.replace(/^\s+|\s+$/g,""); // trim
|
154
150
|
|
155
151
|
return conf.columnText ?
|
@@ -0,0 +1,38 @@
|
|
1
|
+
/*! DataTables styling wrapper for Buttons
|
2
|
+
* ©2018 SpryMedia Ltd - datatables.net/license
|
3
|
+
*/
|
4
|
+
|
5
|
+
(function( factory ){
|
6
|
+
if ( typeof define === 'function' && define.amd ) {
|
7
|
+
// AMD
|
8
|
+
define( ['jquery', 'datatables.net-dt', 'datatables.net-buttons'], function ( $ ) {
|
9
|
+
return factory( $, window, document );
|
10
|
+
} );
|
11
|
+
}
|
12
|
+
else if ( typeof exports === 'object' ) {
|
13
|
+
// CommonJS
|
14
|
+
module.exports = function (root, $) {
|
15
|
+
if ( ! root ) {
|
16
|
+
root = window;
|
17
|
+
}
|
18
|
+
|
19
|
+
if ( ! $ || ! $.fn.dataTable ) {
|
20
|
+
$ = require('datatables.net-dt')(root, $).$;
|
21
|
+
}
|
22
|
+
|
23
|
+
if ( ! $.fn.dataTable.Buttons ) {
|
24
|
+
require('datatables.net-buttons')(root, $);
|
25
|
+
}
|
26
|
+
|
27
|
+
return factory( $, root, root.document );
|
28
|
+
};
|
29
|
+
}
|
30
|
+
else {
|
31
|
+
// Browser
|
32
|
+
factory( jQuery, window, document );
|
33
|
+
}
|
34
|
+
}(function( $, window, document, undefined ) {
|
35
|
+
|
36
|
+
return $.fn.dataTable;
|
37
|
+
|
38
|
+
}));
|
@@ -915,7 +915,9 @@ var excelStrings = {
|
|
915
915
|
'<fill>'+
|
916
916
|
'<patternFill patternType="none" />'+
|
917
917
|
'</fill>'+
|
918
|
-
'<fill
|
918
|
+
'<fill>'+ // Excel appears to use this as a dotted background regardless of values but
|
919
|
+
'<patternFill patternType="none" />'+ // to be valid to the schema, use a patternFill
|
920
|
+
'</fill>'+
|
919
921
|
'<fill>'+
|
920
922
|
'<patternFill patternType="solid">'+
|
921
923
|
'<fgColor rgb="FFD9D9D9" />'+
|
@@ -1130,7 +1132,7 @@ DataTable.ext.buttons.copyFlash = $.extend( {}, flashButton, {
|
|
1130
1132
|
}
|
1131
1133
|
|
1132
1134
|
if ( config.customize ) {
|
1133
|
-
output = config.customize( output, config );
|
1135
|
+
output = config.customize( output, config, dt );
|
1134
1136
|
}
|
1135
1137
|
|
1136
1138
|
flash.setAction( 'copy' );
|
@@ -1165,12 +1167,13 @@ DataTable.ext.buttons.csvFlash = $.extend( {}, flashButton, {
|
|
1165
1167
|
// Set the text
|
1166
1168
|
var flash = config._flash;
|
1167
1169
|
var data = _exportData( dt, config );
|
1170
|
+
var info = dt.buttons.exportInfo( config );
|
1168
1171
|
var output = config.customize ?
|
1169
|
-
config.customize( data.str, config ) :
|
1172
|
+
config.customize( data.str, config, dt ) :
|
1170
1173
|
data.str;
|
1171
1174
|
|
1172
1175
|
flash.setAction( 'csv' );
|
1173
|
-
flash.setFileName(
|
1176
|
+
flash.setFileName( info.filename );
|
1174
1177
|
_setText( flash, output );
|
1175
1178
|
},
|
1176
1179
|
|
@@ -1224,7 +1227,12 @@ DataTable.ext.buttons.excelFlash = $.extend( {}, flashButton, {
|
|
1224
1227
|
|
1225
1228
|
// For null, undefined of blank cell, continue so it doesn't create the _createNode
|
1226
1229
|
if ( row[i] === null || row[i] === undefined || row[i] === '' ) {
|
1227
|
-
|
1230
|
+
if ( config.createEmptyCells === true ) {
|
1231
|
+
row[i] = '';
|
1232
|
+
}
|
1233
|
+
else {
|
1234
|
+
continue;
|
1235
|
+
}
|
1228
1236
|
}
|
1229
1237
|
|
1230
1238
|
row[i] = $.trim( row[i] );
|
@@ -1374,7 +1382,7 @@ DataTable.ext.buttons.excelFlash = $.extend( {}, flashButton, {
|
|
1374
1382
|
|
1375
1383
|
// Let the developer customise the document if they want to
|
1376
1384
|
if ( config.customize ) {
|
1377
|
-
config.customize( xlsx );
|
1385
|
+
config.customize( xlsx, config, dt );
|
1378
1386
|
}
|
1379
1387
|
|
1380
1388
|
_xlsxToStrings( xlsx );
|
@@ -1387,7 +1395,9 @@ DataTable.ext.buttons.excelFlash = $.extend( {}, flashButton, {
|
|
1387
1395
|
this.processing( false );
|
1388
1396
|
},
|
1389
1397
|
|
1390
|
-
extension: '.xlsx'
|
1398
|
+
extension: '.xlsx',
|
1399
|
+
|
1400
|
+
createEmptyCells: false
|
1391
1401
|
} );
|
1392
1402
|
|
1393
1403
|
|
@@ -602,7 +602,9 @@ var excelStrings = {
|
|
602
602
|
'<fill>'+
|
603
603
|
'<patternFill patternType="none" />'+
|
604
604
|
'</fill>'+
|
605
|
-
'<fill
|
605
|
+
'<fill>'+ // Excel appears to use this as a dotted background regardless of values but
|
606
|
+
'<patternFill patternType="none" />'+ // to be valid to the schema, use a patternFill
|
607
|
+
'</fill>'+
|
606
608
|
'<fill>'+
|
607
609
|
'<patternFill patternType="solid">'+
|
608
610
|
'<fgColor rgb="FFD9D9D9" />'+
|
@@ -811,7 +813,7 @@ DataTable.ext.buttons.copyHtml5 = {
|
|
811
813
|
}
|
812
814
|
|
813
815
|
if ( config.customize ) {
|
814
|
-
output = config.customize( output, config );
|
816
|
+
output = config.customize( output, config, dt );
|
815
817
|
}
|
816
818
|
|
817
819
|
var textarea = $('<textarea readonly/>')
|
@@ -923,7 +925,7 @@ DataTable.ext.buttons.csvHtml5 = {
|
|
923
925
|
var charset = config.charset;
|
924
926
|
|
925
927
|
if ( config.customize ) {
|
926
|
-
output = config.customize( output, config );
|
928
|
+
output = config.customize( output, config, dt );
|
927
929
|
}
|
928
930
|
|
929
931
|
if ( charset !== false ) {
|
@@ -1031,9 +1033,15 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1031
1033
|
|
1032
1034
|
// For null, undefined of blank cell, continue so it doesn't create the _createNode
|
1033
1035
|
if ( row[i] === null || row[i] === undefined || row[i] === '' ) {
|
1034
|
-
|
1036
|
+
if ( config.createEmptyCells === true ) {
|
1037
|
+
row[i] = '';
|
1038
|
+
}
|
1039
|
+
else {
|
1040
|
+
continue;
|
1041
|
+
}
|
1035
1042
|
}
|
1036
1043
|
|
1044
|
+
var originalContent = row[i];
|
1037
1045
|
row[i] = $.trim( row[i] );
|
1038
1046
|
|
1039
1047
|
// Special number formatting options
|
@@ -1084,9 +1092,9 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1084
1092
|
}
|
1085
1093
|
else {
|
1086
1094
|
// String output - replace non standard characters for text output
|
1087
|
-
var text = !
|
1088
|
-
|
1089
|
-
|
1095
|
+
var text = ! originalContent.replace ?
|
1096
|
+
originalContent :
|
1097
|
+
originalContent.replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F-\x9F]/g, '');
|
1090
1098
|
|
1091
1099
|
cell = _createNode( rels, 'c', {
|
1092
1100
|
attr: {
|
@@ -1097,7 +1105,10 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1097
1105
|
row: _createNode( rels, 'is', {
|
1098
1106
|
children: {
|
1099
1107
|
row: _createNode( rels, 't', {
|
1100
|
-
text: text
|
1108
|
+
text: text,
|
1109
|
+
attr: {
|
1110
|
+
'xml:space': 'preserve'
|
1111
|
+
}
|
1101
1112
|
} )
|
1102
1113
|
}
|
1103
1114
|
} )
|
@@ -1127,7 +1138,7 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1127
1138
|
ref: 'A'+row+':'+createCellPos(colspan)+row
|
1128
1139
|
}
|
1129
1140
|
} ) );
|
1130
|
-
mergeCells.attr( 'count', mergeCells.attr( 'count' )+1 );
|
1141
|
+
mergeCells.attr( 'count', parseFloat(mergeCells.attr( 'count' ))+1 );
|
1131
1142
|
$('row:eq('+(row-1)+') c', rels).attr( 's', '51' ); // centre
|
1132
1143
|
};
|
1133
1144
|
|
@@ -1181,7 +1192,12 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1181
1192
|
|
1182
1193
|
// Let the developer customise the document if they want to
|
1183
1194
|
if ( config.customize ) {
|
1184
|
-
config.customize( xlsx );
|
1195
|
+
config.customize( xlsx, config, dt );
|
1196
|
+
}
|
1197
|
+
|
1198
|
+
// Excel doesn't like an empty mergeCells tag
|
1199
|
+
if ( $('mergeCells', rels).children().length === 0 ) {
|
1200
|
+
$('mergeCells', rels).remove();
|
1185
1201
|
}
|
1186
1202
|
|
1187
1203
|
var jszip = _jsZip();
|
@@ -1226,7 +1242,9 @@ DataTable.ext.buttons.excelHtml5 = {
|
|
1226
1242
|
|
1227
1243
|
messageTop: '*',
|
1228
1244
|
|
1229
|
-
messageBottom: '*'
|
1245
|
+
messageBottom: '*',
|
1246
|
+
|
1247
|
+
createEmptyCells: false
|
1230
1248
|
};
|
1231
1249
|
|
1232
1250
|
//
|
@@ -1344,23 +1362,19 @@ DataTable.ext.buttons.pdfHtml5 = {
|
|
1344
1362
|
}
|
1345
1363
|
|
1346
1364
|
if ( config.customize ) {
|
1347
|
-
config.customize( doc, config );
|
1365
|
+
config.customize( doc, config, dt );
|
1348
1366
|
}
|
1349
1367
|
|
1350
1368
|
var pdf = _pdfMake().createPdf( doc );
|
1351
1369
|
|
1352
1370
|
if ( config.download === 'open' && ! _isDuffSafari() ) {
|
1353
1371
|
pdf.open();
|
1354
|
-
this.processing( false );
|
1355
1372
|
}
|
1356
1373
|
else {
|
1357
|
-
pdf.
|
1358
|
-
var blob = new Blob( [buffer], {type:'application/pdf'} );
|
1359
|
-
|
1360
|
-
_saveAs( blob, info.filename );
|
1361
|
-
that.processing( false );
|
1362
|
-
} );
|
1374
|
+
pdf.download( info.filename );
|
1363
1375
|
}
|
1376
|
+
|
1377
|
+
this.processing( false );
|
1364
1378
|
},
|
1365
1379
|
|
1366
1380
|
title: '*',
|