@ntlab/ntjs-assets 2.52.0 → 2.54.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.
- package/assets/js/DataTables/Extensions/ColReorder/js/dataTables.colReorder.js +61 -20
- package/assets/js/DataTables/Extensions/ColReorder/js/dataTables.colReorder.min.js +4 -4
- package/assets/js/bootstrap/css/bootstrap-grid.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.min.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.rtl.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.rtl.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.rtl.min.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-grid.rtl.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.min.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.rtl.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.rtl.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.rtl.min.css +1 -1
- package/assets/js/bootstrap/css/bootstrap-reboot.rtl.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.css +5 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.min.css +2 -2
- package/assets/js/bootstrap/css/bootstrap-utilities.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.rtl.css +5 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.rtl.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap-utilities.rtl.min.css +2 -2
- package/assets/js/bootstrap/css/bootstrap-utilities.rtl.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap.css +13 -9
- package/assets/js/bootstrap/css/bootstrap.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap.min.css +2 -2
- package/assets/js/bootstrap/css/bootstrap.min.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap.rtl.css +13 -9
- package/assets/js/bootstrap/css/bootstrap.rtl.css.map +1 -1
- package/assets/js/bootstrap/css/bootstrap.rtl.min.css +2 -2
- package/assets/js/bootstrap/css/bootstrap.rtl.min.css.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.bundle.js +9 -5
- package/assets/js/bootstrap/js/bootstrap.bundle.js.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.bundle.min.js +2 -2
- package/assets/js/bootstrap/js/bootstrap.bundle.min.js.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.esm.js +9 -5
- package/assets/js/bootstrap/js/bootstrap.esm.js.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.esm.min.js +2 -2
- package/assets/js/bootstrap/js/bootstrap.esm.min.js.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.js +9 -5
- package/assets/js/bootstrap/js/bootstrap.js.map +1 -1
- package/assets/js/bootstrap/js/bootstrap.min.js +2 -2
- package/assets/js/bootstrap/js/bootstrap.min.js.map +1 -1
- package/assets/js/cdn.json +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ColReorder 2.0
|
|
1
|
+
/*! ColReorder 2.1.0
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -453,6 +453,7 @@ var ColReorder = /** @class */ (function () {
|
|
|
453
453
|
this.c = {
|
|
454
454
|
columns: null,
|
|
455
455
|
enable: null,
|
|
456
|
+
headerRows: null,
|
|
456
457
|
order: null
|
|
457
458
|
};
|
|
458
459
|
this.s = {
|
|
@@ -503,10 +504,13 @@ var ColReorder = /** @class */ (function () {
|
|
|
503
504
|
}
|
|
504
505
|
dt.table()
|
|
505
506
|
.header.structure()
|
|
506
|
-
.forEach(function (row) {
|
|
507
|
+
.forEach(function (row, rowIdx) {
|
|
508
|
+
var headerRows = opts.headerRows;
|
|
507
509
|
for (var i = 0; i < row.length; i++) {
|
|
508
|
-
if (
|
|
509
|
-
|
|
510
|
+
if (!headerRows || headerRows.includes(rowIdx)) {
|
|
511
|
+
if (row[i] && row[i].cell) {
|
|
512
|
+
that._addListener(row[i].cell);
|
|
513
|
+
}
|
|
510
514
|
}
|
|
511
515
|
}
|
|
512
516
|
});
|
|
@@ -543,6 +547,12 @@ var ColReorder = /** @class */ (function () {
|
|
|
543
547
|
if (!that.c.enable) {
|
|
544
548
|
return;
|
|
545
549
|
}
|
|
550
|
+
// ColumnControl integration - if there is a CC reorder button in the header
|
|
551
|
+
// then the mousedown is limited to that
|
|
552
|
+
var btn = $('button.dtcc-button_reorder', this);
|
|
553
|
+
if (btn.length && e.target !== btn[0] && btn.find(e.target).length === 0) {
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
546
556
|
that._mouseDown(e, this);
|
|
547
557
|
});
|
|
548
558
|
};
|
|
@@ -655,10 +665,19 @@ var ColReorder = /** @class */ (function () {
|
|
|
655
665
|
top: this._cursorPosition(e, 'pageY') - this.s.mouse.offset.y
|
|
656
666
|
});
|
|
657
667
|
// Find cursor's left position relative to the table
|
|
658
|
-
var
|
|
668
|
+
var tableNode = this.dt.table().node();
|
|
669
|
+
var tableOffset = $(tableNode).offset().left;
|
|
659
670
|
var cursorMouseLeft = this._cursorPosition(e, 'pageX') - tableOffset;
|
|
671
|
+
var cursorInlineStart;
|
|
672
|
+
if (this._isRtl()) {
|
|
673
|
+
var tableWidth = tableNode.clientWidth;
|
|
674
|
+
cursorInlineStart = tableWidth - cursorMouseLeft;
|
|
675
|
+
}
|
|
676
|
+
else {
|
|
677
|
+
cursorInlineStart = cursorMouseLeft;
|
|
678
|
+
}
|
|
660
679
|
var dropZone = this.s.dropZones.find(function (zone) {
|
|
661
|
-
if (zone.
|
|
680
|
+
if (zone.inlineStart <= cursorInlineStart && cursorInlineStart <= zone.inlineStart + zone.width) {
|
|
662
681
|
return true;
|
|
663
682
|
}
|
|
664
683
|
return false;
|
|
@@ -668,15 +687,29 @@ var ColReorder = /** @class */ (function () {
|
|
|
668
687
|
return;
|
|
669
688
|
}
|
|
670
689
|
if (!dropZone.self) {
|
|
671
|
-
this._move(dropZone,
|
|
690
|
+
this._move(dropZone, cursorInlineStart);
|
|
672
691
|
}
|
|
673
692
|
};
|
|
674
693
|
ColReorder.prototype._mouseUp = function (e) {
|
|
694
|
+
var _this = this;
|
|
675
695
|
$(document).off('.colReorder');
|
|
676
696
|
$(document.body).removeClass('dtcr-dragging');
|
|
677
697
|
if (this.dom.drag) {
|
|
678
698
|
this.dom.drag.remove();
|
|
679
699
|
this.dom.drag = null;
|
|
700
|
+
// Once the element is removed, Firefox will then complete the mouse event
|
|
701
|
+
// sequence by firing a click event on the element that the mouse is now
|
|
702
|
+
// over. This means that a click event happens on the header cell triggering
|
|
703
|
+
// a sort. A setTimeout on the remove doesn't appear to work around this.
|
|
704
|
+
//
|
|
705
|
+
// Therefore, we need to add a click event listener that will kill the
|
|
706
|
+
// bubbling of the event, and then _almost_ immediately remove it.
|
|
707
|
+
this.s.mouse.target.on('click.dtcr', function (e) {
|
|
708
|
+
return false;
|
|
709
|
+
});
|
|
710
|
+
setTimeout(function () {
|
|
711
|
+
_this.s.mouse.target.off('.dtcr');
|
|
712
|
+
}, 10);
|
|
680
713
|
}
|
|
681
714
|
if (this.s.scrollInterval) {
|
|
682
715
|
clearInterval(this.s.scrollInterval);
|
|
@@ -687,9 +720,9 @@ var ColReorder = /** @class */ (function () {
|
|
|
687
720
|
* Shift columns around
|
|
688
721
|
*
|
|
689
722
|
* @param dropZone Where to move to
|
|
690
|
-
* @param
|
|
723
|
+
* @param cursorInlineStart Cursor position, relative to the inline start (left or right) of the table
|
|
691
724
|
*/
|
|
692
|
-
ColReorder.prototype._move = function (dropZone,
|
|
725
|
+
ColReorder.prototype._move = function (dropZone, cursorInlineStart) {
|
|
693
726
|
var that = this;
|
|
694
727
|
this.dt.colReorder.move(this.s.mouse.targets, dropZone.colIdx);
|
|
695
728
|
// Update the targets
|
|
@@ -712,10 +745,10 @@ var ColReorder = /** @class */ (function () {
|
|
|
712
745
|
return zone.colIdx === visibleTargets[0];
|
|
713
746
|
});
|
|
714
747
|
var dzIdx = this.s.dropZones.indexOf(dz);
|
|
715
|
-
if (dz.
|
|
716
|
-
var previousDiff = dz.
|
|
748
|
+
if (dz.inlineStart > cursorInlineStart) {
|
|
749
|
+
var previousDiff = dz.inlineStart - cursorInlineStart;
|
|
717
750
|
var previousDz = this.s.dropZones[dzIdx - 1];
|
|
718
|
-
dz.
|
|
751
|
+
dz.inlineStart -= previousDiff;
|
|
719
752
|
dz.width += previousDiff;
|
|
720
753
|
if (previousDz) {
|
|
721
754
|
previousDz.width -= previousDiff;
|
|
@@ -725,12 +758,12 @@ var ColReorder = /** @class */ (function () {
|
|
|
725
758
|
dz = this.s.dropZones.find(function (zone) {
|
|
726
759
|
return zone.colIdx === visibleTargets[visibleTargets.length - 1];
|
|
727
760
|
});
|
|
728
|
-
if (dz.
|
|
729
|
-
var nextDiff =
|
|
761
|
+
if (dz.inlineStart + dz.width < cursorInlineStart) {
|
|
762
|
+
var nextDiff = cursorInlineStart - (dz.inlineStart + dz.width);
|
|
730
763
|
var nextDz = this.s.dropZones[dzIdx + 1];
|
|
731
764
|
dz.width += nextDiff;
|
|
732
765
|
if (nextDz) {
|
|
733
|
-
nextDz.
|
|
766
|
+
nextDz.inlineStart += nextDiff;
|
|
734
767
|
nextDz.width -= nextDiff;
|
|
735
768
|
}
|
|
736
769
|
}
|
|
@@ -764,7 +797,7 @@ var ColReorder = /** @class */ (function () {
|
|
|
764
797
|
// by the final condition in this logic set
|
|
765
798
|
dropZones.push({
|
|
766
799
|
colIdx: colIdx,
|
|
767
|
-
|
|
800
|
+
inlineStart: totalWidth - negativeCorrect,
|
|
768
801
|
self: moveColumns[0] <= colIdx && colIdx <= moveColumns[moveColumns.length - 1],
|
|
769
802
|
width: columnWidth + negativeCorrect
|
|
770
803
|
});
|
|
@@ -805,12 +838,16 @@ var ColReorder = /** @class */ (function () {
|
|
|
805
838
|
return;
|
|
806
839
|
}
|
|
807
840
|
var that = this;
|
|
808
|
-
var tableLeft = $(this.dt.table().container()).
|
|
841
|
+
var tableLeft = $(this.dt.table().container()).offset().left;
|
|
809
842
|
var tableWidth = $(this.dt.table().container()).outerWidth();
|
|
810
843
|
var mouseBuffer = 75;
|
|
811
844
|
var scrollContainer = this.dt.table().body().parentElement.parentElement;
|
|
812
845
|
this.s.scrollInterval = setInterval(function () {
|
|
813
846
|
var mouseLeft = that.s.mouse.absLeft;
|
|
847
|
+
// On initial mouse down the mouse position can be -1, which we want to ignore
|
|
848
|
+
if (mouseLeft === -1) {
|
|
849
|
+
return;
|
|
850
|
+
}
|
|
814
851
|
if (mouseLeft < tableLeft + mouseBuffer && scrollContainer.scrollLeft) {
|
|
815
852
|
scrollContainer.scrollLeft -= 5;
|
|
816
853
|
}
|
|
@@ -840,22 +877,26 @@ var ColReorder = /** @class */ (function () {
|
|
|
840
877
|
// );
|
|
841
878
|
// }
|
|
842
879
|
// }
|
|
880
|
+
ColReorder.prototype._isRtl = function () {
|
|
881
|
+
return $(this.dt.table()).css('direction') === 'rtl';
|
|
882
|
+
};
|
|
843
883
|
ColReorder.defaults = {
|
|
844
884
|
columns: '',
|
|
845
885
|
enable: true,
|
|
886
|
+
headerRows: null,
|
|
846
887
|
order: null
|
|
847
888
|
};
|
|
848
|
-
ColReorder.version = '2.0
|
|
889
|
+
ColReorder.version = '2.1.0';
|
|
849
890
|
return ColReorder;
|
|
850
891
|
}());
|
|
851
892
|
|
|
852
|
-
/*! ColReorder 2.0
|
|
893
|
+
/*! ColReorder 2.1.0
|
|
853
894
|
* © SpryMedia Ltd - datatables.net/license
|
|
854
895
|
*/
|
|
855
896
|
/**
|
|
856
897
|
* @summary ColReorder
|
|
857
898
|
* @description Provide the ability to reorder columns in a DataTable
|
|
858
|
-
* @version 2.0
|
|
899
|
+
* @version 2.1.0
|
|
859
900
|
* @author SpryMedia Ltd
|
|
860
901
|
* @contact datatables.net
|
|
861
902
|
* @copyright SpryMedia Ltd.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! ColReorder 2.0
|
|
1
|
+
/*! ColReorder 2.1.0
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
|
-
!function(
|
|
5
|
-
/*! ColReorder 2.0
|
|
4
|
+
!function(r){var o,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return r(t,window,document)}):"object"==typeof exports?(o=require("jquery"),n=function(t,e){e.fn.dataTable||require("datatables.net")(t,e)},"undefined"==typeof window?module.exports=function(t,e){return t=t||window,e=e||o(t),n(t,e),r(e,0,t.document)}:(n(window,o),module.exports=r(o,window,window.document))):r(jQuery,window,document)}(function(d,t,h){"use strict";var n=d.fn.dataTable;function f(t,e,r,o){var n=t.splice(e,r);n.unshift(0),n.unshift(o<e?o:o-r+1),t.splice.apply(t,n)}function a(t){t.rows().invalidate("data"),t.column(0).visible(t.column(0).visible()),t.columns.adjust();var e=t.colReorder.order();t.trigger("columns-reordered",[{order:e,mapping:p(e)}])}function s(t){return t.settings()[0].aoColumns.map(function(t){return t._crOriginalIdx})}function g(t,e,r,o){for(var n=[],i=0;i<t.length;i++){var s=t[i];f(s,r[0],r.length,o);for(var a=0;a<s.length;a++){var l,c=s[a].cell;n.includes(c)||(l=c.getAttribute("data-dt-column").split(",").map(function(t){return e[t]}).join(","),c.setAttribute("data-dt-column",l),n.push(c))}}}function r(t){t.columns().iterator("column",function(t,e){t=t.aoColumns;void 0===t[e]._crOriginalIdx&&(t[e]._crOriginalIdx=e)})}function p(t){for(var e=[],r=0;r<t.length;r++)e[t[r]]=r;return e}function l(t,e,r){var o,n=t.settings()[0],i=n.aoColumns,s=i.map(function(t,e){return e});if(!e.includes(r)){f(s,e[0],e.length,r);var a=p(s);for(f(i,e[0],e.length,r),o=0;o<n.aoData.length;o++){var l=n.aoData[o];if(l){var c=l.anCells;if(c)for(f(c,e[0],e.length,r),d=0;d<c.length;d++)l.nTr&&c[d]&&i[d].bVisible&&l.nTr.appendChild(c[d]),c[d]&&c[d]._DT_CellIndex&&(c[d]._DT_CellIndex.column=d)}}for(o=0;o<i.length;o++){for(var u=i[o],d=0;d<u.aDataSort.length;d++)u.aDataSort[d]=a[u.aDataSort[d]];u.idx=a[u.idx],u.bVisible&&n.colgroup.append(u.colEl)}g(n.aoHeader,a,e,r),g(n.aoFooter,a,e,r),f(n.aoPreSearchCols,e[0],e.length,r),m(a,n.aaSorting),Array.isArray(n.aaSortingFixed)?m(a,n.aaSortingFixed):(n.aaSortingFixed.pre||n.aaSortingFixed.post)&&m(a,n.aaSortingFixed.pre),n.aLastSort.forEach(function(t){t.src=a[t.src]}),t.trigger("column-reorder",[t.settings()[0],{from:e,to:r,mapping:a}])}}function m(t,e){if(e)for(var r=0;r<e.length;r++){var o=e[r];"number"==typeof o?e[r]=t[o]:d.isPlainObject(o)&&void 0!==o.idx?o.idx=t[o.idx]:Array.isArray(o)&&"number"==typeof o[0]&&(o[0]=t[o[0]])}}function c(t,e,r){var o=!1;if(e.length!==t.columns().count())t.error("ColReorder - column count mismatch");else{for(var n=p(e=r?u(t,e,"toCurrent"):e),i=0;i<n.length;i++){var s=n.indexOf(i);i!==s&&(f(n,s,1,i),l(t,[s],i),o=!0)}o&&a(t)}}function u(t,e,r){var o=t.colReorder.order(),n=t.settings()[0].aoColumns;return"toCurrent"===r||"fromOriginal"===r?Array.isArray(e)?e.map(function(t){return o.indexOf(t)}):o.indexOf(e):Array.isArray(e)?e.map(function(t){return n[t]._crOriginalIdx}):n[e]._crOriginalIdx}function v(t,e,r){var o=t.columns().count();return!(e[0]<r&&r<e[e.length]||e[0]<0&&e[e.length-1]>o||r<0&&o<r||!e.includes(r)&&(!i(t.table().header.structure(),e,r)||!i(t.table().footer.structure(),e,r)))}function i(t,e,r){for(var o=function(t){for(var e=[],r=0;r<t.length;r++){e.push([]);for(var o=0;o<t[r].length;o++){var n=t[r][o];if(n)for(var i=0;i<n.rowspan;i++){e[r+i]||(e[r+i]=[]);for(var s=0;s<n.colspan;s++)e[r+i][o+s]=n.cell}}}return e}(t),n=0;n<o.length;n++)f(o[n],e[0],e.length,r);for(n=0;n<o.length;n++)for(var i=[],s=0;s<o[n].length;s++){var a=o[n][s];if(i.includes(a)){if(i[i.length-1]!==a)return}else i.push(a)}return 1}y.prototype.disable=function(){return this.c.enable=!1,this},y.prototype.enable=function(t){return!1===(t=void 0===t?!0:t)?this.disable():(this.c.enable=!0,this)},y.prototype._addListener=function(t){var r=this;d(t).on("selectstart.colReorder",function(){return!1}).on("mousedown.colReorder touchstart.colReorder",function(t){var e;"mousedown"===t.type&&1!==t.which||!r.c.enable||(e=d("button.dtcc-button_reorder",this)).length&&t.target!==e[0]&&0===e.find(t.target).length||r._mouseDown(t,this)})},y.prototype._createDragNode=function(){var t=this.s.mouse.target,e=t.parent(),r=e.parent(),o=r.parent(),n=t.clone();this.dom.drag=d(o[0].cloneNode(!1)).addClass("dtcr-cloned").append(d(r[0].cloneNode(!1)).append(d(e[0].cloneNode(!1)).append(n[0]))).css({position:"absolute",top:0,left:0,width:d(t).outerWidth(),height:d(t).outerHeight()}).appendTo("body")},y.prototype._cursorPosition=function(t,e){return(-1!==t.type.indexOf("touch")?t.originalEvent.touches[0]:t)[e]},y.prototype._mouseDown=function(t,e){for(var r=this,o=d(t.target).closest("th, td"),n=o.offset(),i=this.dt.columns(this.c.columns).indexes().toArray(),s=d(e).attr("data-dt-column").split(",").map(function(t){return parseInt(t,10)}),a=0;a<s.length;a++)if(!i.includes(s[a]))return!1;this.s.mouse.start.x=this._cursorPosition(t,"pageX"),this.s.mouse.start.y=this._cursorPosition(t,"pageY"),this.s.mouse.offset.x=this._cursorPosition(t,"pageX")-n.left,this.s.mouse.offset.y=this._cursorPosition(t,"pageY")-n.top,this.s.mouse.target=o,this.s.mouse.targets=s;for(var l=0;l<s.length;l++){var c=this.dt.cells(null,s[l],{page:"current"}).nodes().to$(),u="dtcr-moving";0===l&&(u+=" dtcr-moving-first"),l===s.length-1&&(u+=" dtcr-moving-last"),c.addClass(u)}this._regions(s),this._scrollRegions(),d(h).on("mousemove.colReorder touchmove.colReorder",function(t){r._mouseMove(t)}).on("mouseup.colReorder touchend.colReorder",function(t){r._mouseUp(t)})},y.prototype._mouseMove=function(t){if(null===this.dom.drag){if(Math.pow(Math.pow(this._cursorPosition(t,"pageX")-this.s.mouse.start.x,2)+Math.pow(this._cursorPosition(t,"pageY")-this.s.mouse.start.y,2),.5)<5)return;d(h.body).addClass("dtcr-dragging"),this._createDragNode()}this.dom.drag.css({left:this._cursorPosition(t,"pageX")-this.s.mouse.offset.x,top:this._cursorPosition(t,"pageY")-this.s.mouse.offset.y});var e,r=this.dt.table().node(),o=d(r).offset().left,o=this._cursorPosition(t,"pageX")-o,r=(e=this._isRtl()?r.clientWidth-o:o,this.s.dropZones.find(function(t){return t.inlineStart<=e&&e<=t.inlineStart+t.width}));this.s.mouse.absLeft=this._cursorPosition(t,"pageX"),r&&!r.self&&this._move(r,e)},y.prototype._mouseUp=function(t){var e=this;d(h).off(".colReorder"),d(h.body).removeClass("dtcr-dragging"),this.dom.drag&&(this.dom.drag.remove(),this.dom.drag=null,this.s.mouse.target.on("click.dtcr",function(t){return!1}),setTimeout(function(){e.s.mouse.target.off(".dtcr")},10)),this.s.scrollInterval&&clearInterval(this.s.scrollInterval),this.dt.cells(".dtcr-moving").nodes().to$().removeClass("dtcr-moving dtcr-moving-first dtcr-moving-last")},y.prototype._move=function(t,e){var r,o,n=this,i=(this.dt.colReorder.move(this.s.mouse.targets,t.colIdx),this.s.mouse.targets=d(this.s.mouse.target).attr("data-dt-column").split(",").map(function(t){return parseInt(t,10)}),this._regions(this.s.mouse.targets),this.s.mouse.targets.filter(function(t){return n.dt.column(t).visible()})),t=this.s.dropZones.find(function(t){return t.colIdx===i[0]}),s=this.s.dropZones.indexOf(t);t.inlineStart>e&&(o=t.inlineStart-e,r=this.s.dropZones[s-1],t.inlineStart-=o,t.width+=o,r)&&(r.width-=o),(t=this.s.dropZones.find(function(t){return t.colIdx===i[i.length-1]})).inlineStart+t.width<e&&(r=e-(t.inlineStart+t.width),o=this.s.dropZones[s+1],t.width+=r,o)&&(o.inlineStart+=r,o.width-=r)},y.prototype._regions=function(n){var i=this,s=[],a=0,l=0,c=this.dt.columns(this.c.columns).indexes().toArray(),u=this.dt.columns().widths();this.dt.columns().every(function(t,e,r){var o;this.visible()&&(o=u[t],c.includes(t)&&(v(i.dt,n,t)?s.push({colIdx:t,inlineStart:a-l,self:n[0]<=t&&t<=n[n.length-1],width:o+l}):t<n[0]?s.length&&(s[s.length-1].width+=o):t>n[n.length-1]&&(l+=o)),a+=o)}),this.s.dropZones=s},y.prototype._isScrolling=function(){return this.dt.table().body().parentNode!==this.dt.table().header().parentNode},y.prototype._scrollRegions=function(){var e,r,o,n;this._isScrolling()&&(r=d((e=this).dt.table().container()).offset().left,o=d(this.dt.table().container()).outerWidth(),n=this.dt.table().body().parentElement.parentElement,this.s.scrollInterval=setInterval(function(){var t=e.s.mouse.absLeft;-1!==t&&(t<r+75&&n.scrollLeft?n.scrollLeft-=5:r+o-75<t&&n.scrollLeft<n.scrollWidth&&(n.scrollLeft+=5))},25))},y.prototype._isRtl=function(){return"rtl"===d(this.dt.table()).css("direction")},y.defaults={columns:"",enable:!0,headerRows:null,order:null},y.version="2.1.0";
|
|
5
|
+
/*! ColReorder 2.1.0
|
|
6
6
|
* © SpryMedia Ltd - datatables.net/license
|
|
7
|
-
*/var b=
|
|
7
|
+
*/var b=y;function y(o,n){this.dom={drag:null},this.c={columns:null,enable:null,headerRows:null,order:null},this.s={dropZones:[],mouse:{absLeft:-1,offset:{x:-1,y:-1},start:{x:-1,y:-1},target:null,targets:[]},scrollInterval:null};var t,e,i=this;o.settings()[0]._colReorder||((o.settings()[0]._colReorder=this).dt=o,d.extend(this.c,y.defaults,n),r(o),o.on("stateSaveParams",function(t,e,r){r.colReorder=s(o)}),o.on("destroy",function(){o.off(".colReorder"),o.colReorder.reset()}),t=o.state.loaded(),e=this.c.order,(e=t&&t.colReorder?t.colReorder:e)&&o.ready(function(){c(o,e,!0)}),o.table().header.structure().forEach(function(t,e){for(var r=n.headerRows,o=0;o<t.length;o++)r&&!r.includes(e)||t[o]&&t[o].cell&&i._addListener(t[o].cell)}))}return n.Api.register("colReorder.enable()",function(e){return this.iterator("table",function(t){t._colReorder&&t._colReorder.enable(e)})}),n.Api.register("colReorder.disable()",function(){return this.iterator("table",function(t){t._colReorder&&t._colReorder.disable()})}),n.Api.register("colReorder.move()",function(t,e){return r(this),v(this,t=Array.isArray(t)?t:[t],e)?this.tables().every(function(){l(this,t,e),a(this)}):(this.error("ColReorder - invalid move"),this)}),n.Api.register("colReorder.order()",function(t,e){return r(this),t?this.tables().every(function(){c(this,t,e)}):this.context.length?s(this):null}),n.Api.register("colReorder.reset()",function(){return r(this),this.tables().every(function(){var t=this.columns().every(function(t){return t}).flatten().toArray();c(this,t,!0)})}),n.Api.register("colReorder.transpose()",function(t,e){return r(this),u(this,t,e=e||"toCurrent")}),n.ColReorder=b,d(h).on("stateLoadInit.dt",function(t,e,r){if("dt"===t.namespace){t=new n.Api(e);if(r.colReorder)if(t.ready())c(t,r.colReorder,!0);else if(m(r.colReorder,r.order),r.columns){for(var o=0;o<r.columns.length;o++)r.columns[o]._cr_sort=r.colReorder[o];r.columns.sort(function(t,e){return t._cr_sort-e._cr_sort})}}}),d(h).on("preInit.dt",function(t,e){var r,o;"dt"===t.namespace&&(t=e.oInit.colReorder,o=n.defaults.colReorder,t||o)&&(r=d.extend({},o,t),!1!==t)&&(o=new n.Api(e),new b(o,r))}),n});
|