Skip to content

Commit 13c1913

Browse files
committed
update assets
1 parent 38b57f7 commit 13c1913

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1597
-1678
lines changed

app/assets/javascripts/datatables/dataTables.bootstrap2.js

Lines changed: 0 additions & 162 deletions
This file was deleted.

app/assets/javascripts/datatables/dataTables.uikit.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ $.extend( true, DataTable.defaults, {
5050
/* Default class modification */
5151
$.extend( DataTable.ext.classes, {
5252
sWrapper: "dataTables_wrapper uk-form dt-uikit",
53-
sFilterInput: "uk-form-small",
54-
sLengthSelect: "uk-form-small",
53+
sFilterInput: "uk-form-small uk-input",
54+
sLengthSelect: "uk-form-small uk-select",
5555
sProcessing: "dataTables_processing uk-panel"
5656
} );
5757

app/assets/javascripts/datatables/extensions/AutoFill/dataTables.autoFill.js

Lines changed: 42 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
/*! AutoFill 2.3.1
2-
* ©2008-2018 SpryMedia Ltd - datatables.net/license
1+
/*! AutoFill 2.3.4
2+
* ©2008-2019 SpryMedia Ltd - datatables.net/license
33
*/
44

55
/**
66
* @summary AutoFill
77
* @description Add Excel like click and drag auto-fill options to DataTables
8-
* @version 2.3.1
8+
* @version 2.3.4
99
* @file dataTables.autoFill.js
1010
* @author SpryMedia Ltd (www.sprymedia.co.uk)
1111
* @contact www.sprymedia.co.uk/contact
12-
* @copyright Copyright 2010-2018 SpryMedia Ltd.
12+
* @copyright Copyright 2010-2019 SpryMedia Ltd.
1313
*
1414
* This source file is free software, available under the following license:
1515
* MIT license - http://datatables.net/license/mit
@@ -367,7 +367,8 @@ $.extend( AutoFill.prototype, {
367367
start.column
368368
};
369369
var colIndx = dt.column.index( 'toData', end.column );
370-
var endCell = $( dt.cell( ':eq('+end.row+')', colIndx ).node() );
370+
var endRow = dt.row( ':eq('+end.row+')', { page: 'current' } ); // Workaround for M581
371+
var endCell = $( dt.cell( endRow.index(), colIndx ).node() );
371372

372373
// Be sure that is a DataTables controlled cell
373374
if ( ! dt.cell( endCell ).any() ) {
@@ -388,10 +389,10 @@ $.extend( AutoFill.prototype, {
388389
left = start.column < end.column ? startCell : endCell;
389390
right = start.column < end.column ? endCell : startCell;
390391

391-
top = this._getPosition( top ).top;
392-
left = this._getPosition( left ).left;
393-
height = this._getPosition( bottom ).top + bottom.outerHeight() - top;
394-
width = this._getPosition( right ).left + right.outerWidth() - left;
392+
top = this._getPosition( top.get(0) ).top;
393+
left = this._getPosition( left.get(0) ).left;
394+
height = this._getPosition( bottom.get(0) ).top + bottom.outerHeight() - top;
395+
width = this._getPosition( right.get(0) ).left + right.outerWidth() - left;
395396

396397
var select = this.dom.select;
397398
select.top.css( {
@@ -584,9 +585,8 @@ $.extend( AutoFill.prototype, {
584585
_getPosition: function ( node, targetParent )
585586
{
586587
var
587-
currNode = $(node),
588+
currNode = node,
588589
currOffsetParent,
589-
position,
590590
top = 0,
591591
left = 0;
592592

@@ -595,23 +595,23 @@ $.extend( AutoFill.prototype, {
595595
}
596596

597597
do {
598-
position = currNode.position();
598+
// Don't use jQuery().position() the behaviour changes between 1.x and 3.x for
599+
// tables
600+
var positionTop = currNode.offsetTop;
601+
var positionLeft = currNode.offsetLeft;
599602

600603
// jQuery doesn't give a `table` as the offset parent oddly, so use DOM directly
601-
currOffsetParent = $( currNode[0].offsetParent );
604+
currOffsetParent = $( currNode.offsetParent );
602605

603-
top += position.top + currOffsetParent.scrollTop();
604-
left += position.left + currOffsetParent.scrollLeft();
605-
606-
top += parseInt( currOffsetParent.css('margin-top') ) * 1;
607-
top += parseInt( currOffsetParent.css('border-top-width') ) * 1;
606+
top += positionTop + parseInt( currOffsetParent.css('border-top-width') ) * 1;
607+
left += positionLeft + parseInt( currOffsetParent.css('border-left-width') ) * 1;
608608

609609
// Emergency fall back. Shouldn't happen, but just in case!
610-
if ( currNode.get(0).nodeName.toLowerCase() === 'body' ) {
610+
if ( currNode.nodeName.toLowerCase() === 'body' ) {
611611
break;
612612
}
613613

614-
currNode = currOffsetParent; // for next loop
614+
currNode = currOffsetParent.get(0); // for next loop
615615
}
616616
while ( currOffsetParent.get(0) !== targetParent.get(0) )
617617

@@ -731,14 +731,18 @@ $.extend( AutoFill.prototype, {
731731
var editor = dt.editor();
732732

733733
editor
734-
.on( 'submitSuccess.kt', function () {
735-
editor.off( '.kt');
736-
that._mouseup( e );
734+
.on( 'submitSuccess.dtaf close.dtaf', function () {
735+
editor.off( '.dtaf');
736+
737+
setTimeout( function () {
738+
that._mouseup( e );
739+
}, 100 );
737740
} )
738-
.on( 'submitComplete.kt preSubmitCancelled.kt', function () {
739-
editor.off( '.kt');
741+
.on( 'submitComplete.dtaf preSubmitCancelled.dtaf close.dtaf', function () {
742+
editor.off( '.dtaf');
740743
} );
741-
744+
745+
// Make the current input submit
742746
editor.submit();
743747

744748
return;
@@ -750,14 +754,16 @@ $.extend( AutoFill.prototype, {
750754
var selected = [];
751755
var dtSettings = dt.settings()[0];
752756
var dtColumns = dtSettings.aoColumns;
757+
var enabledColumns = dt.columns( this.c.columns ).indexes();
753758

754759
// Can't use Array.prototype.map as IE8 doesn't support it
755760
// Can't use $.map as jQuery flattens 2D arrays
756761
// Need to use a good old fashioned for loop
757762
for ( var rowIdx=0 ; rowIdx<rows.length ; rowIdx++ ) {
758763
selected.push(
759764
$.map( columns, function (column) {
760-
var cell = dt.cell( ':eq('+rows[rowIdx]+')', column+':visible', {page:'current'} );
765+
var row = dt.row( ':eq('+rows[rowIdx]+')', {page:'current'} ); // Workaround for M581
766+
var cell = dt.cell( row.index(), column+':visible' );
761767
var data = cell.data();
762768
var cellIndex = cell.index();
763769
var editField = dtColumns[ cellIndex.column ].editField;
@@ -766,6 +772,10 @@ $.extend( AutoFill.prototype, {
766772
data = dtSettings.oApi._fnGetObjectDataFn( editField )( dt.row( cellIndex.row ).data() );
767773
}
768774

775+
if ( enabledColumns.indexOf(cellIndex.column) === -1 ) {
776+
return;
777+
}
778+
769779
return {
770780
cell: cell,
771781
data: data,
@@ -938,6 +948,7 @@ $.extend( AutoFill.prototype, {
938948

939949
var dt = this.s.dt;
940950
var cell;
951+
var columns = dt.columns( this.c.columns ).indexes();
941952

942953
// Potentially allow modifications to the cells matrix
943954
this._emitEvent( 'preAutoFill', [ dt, cells ] );
@@ -958,7 +969,9 @@ $.extend( AutoFill.prototype, {
958969
for ( var j=0, jen=cells[i].length ; j<jen ; j++ ) {
959970
cell = cells[i][j];
960971

961-
cell.cell.data( cell.set );
972+
if ( columns.indexOf(cell.index.column) !== -1 ) {
973+
cell.cell.data( cell.set );
974+
}
962975
}
963976
}
964977

@@ -1089,7 +1102,7 @@ AutoFill.actions = {
10891102
* @static
10901103
* @type String
10911104
*/
1092-
AutoFill.version = '2.3.1';
1105+
AutoFill.version = '2.3.4';
10931106

10941107

10951108
/**

app/assets/javascripts/datatables/extensions/Buttons/buttons.bootstrap4.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var DataTable = $.fn.dataTable;
3838
$.extend( true, DataTable.Buttons.defaults, {
3939
dom: {
4040
container: {
41-
className: 'dt-buttons btn-group'
41+
className: 'dt-buttons btn-group flex-wrap'
4242
},
4343
button: {
4444
className: 'btn btn-secondary'
@@ -53,10 +53,16 @@ $.extend( true, DataTable.Buttons.defaults, {
5353
disabled: 'disabled'
5454
}
5555
}
56+
},
57+
buttonCreated: function ( config, button ) {
58+
return config.buttons ?
59+
$('<div class="btn-group"/>').append(button) :
60+
button;
5661
}
5762
} );
5863

5964
DataTable.ext.buttons.collection.className += ' dropdown-toggle';
65+
DataTable.ext.buttons.collection.rightAlignClassName = 'dropdown-menu-right';
6066

6167
return DataTable.Buttons;
6268
}));

app/assets/javascripts/datatables/extensions/Buttons/buttons.colVis.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ $.extend( DataTable.ext.buttons, {
108108
},
109109
init: function ( dt, button, conf ) {
110110
var that = this;
111+
button.attr( 'data-cv-idx', conf.columns );
111112

112113
dt
113114
.on( 'column-visibility.dt'+conf.namespace, function (e, settings) {
@@ -116,13 +117,15 @@ $.extend( DataTable.ext.buttons, {
116117
}
117118
} )
118119
.on( 'column-reorder.dt'+conf.namespace, function (e, settings, details) {
119-
// Don't rename buttons based on column name if the button
120-
// controls more than one column!
121120
if ( dt.columns( conf.columns ).count() !== 1 ) {
122121
return;
123122
}
124123

125-
that.text( conf._columnText( dt, conf ) );
124+
// This button controls the same column index but the text for the column has
125+
// changed
126+
button.text( conf._columnText( dt, conf ) );
127+
128+
// Since its a different column, we need to check its visibility
126129
that.active( dt.column( conf.columns ).visible() );
127130
} );
128131

0 commit comments

Comments
 (0)