@ntlab/ntjs-assets 2.0.12 → 2.0.13
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! ColReorder 2.0.
|
|
1
|
+
/*! ColReorder 2.0.1
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
4
|
|
|
@@ -48,53 +48,6 @@
|
|
|
48
48
|
var DataTable = $.fn.dataTable;
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
(function( factory ){
|
|
53
|
-
if ( typeof define === 'function' && define.amd ) {
|
|
54
|
-
// AMD
|
|
55
|
-
define( ['jquery', 'datatables.net'], function ( $ ) {
|
|
56
|
-
return factory( $, window, document );
|
|
57
|
-
} );
|
|
58
|
-
}
|
|
59
|
-
else if ( typeof exports === 'object' ) {
|
|
60
|
-
// CommonJS
|
|
61
|
-
var jq = require('jquery');
|
|
62
|
-
var cjsRequires = function (root, $) {
|
|
63
|
-
if ( ! $.fn.dataTable ) {
|
|
64
|
-
require('datatables.net')(root, $);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
if (typeof window === 'undefined') {
|
|
69
|
-
module.exports = function (root, $) {
|
|
70
|
-
if ( ! root ) {
|
|
71
|
-
// CommonJS environments without a window global must pass a
|
|
72
|
-
// root. This will give an error otherwise
|
|
73
|
-
root = window;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if ( ! $ ) {
|
|
77
|
-
$ = jq( root );
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
cjsRequires( root, $ );
|
|
81
|
-
return factory( $, root, root.document );
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
else {
|
|
85
|
-
cjsRequires( window, jq );
|
|
86
|
-
module.exports = factory( jq, window, window.document );
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
// Browser
|
|
91
|
-
factory( jQuery, window, document );
|
|
92
|
-
}
|
|
93
|
-
}(function( $, window, document ) {
|
|
94
|
-
'use strict';
|
|
95
|
-
var DataTable = $.fn.dataTable;
|
|
96
|
-
|
|
97
|
-
|
|
98
51
|
/**
|
|
99
52
|
* Mutate an array, moving a set of elements into a new index position
|
|
100
53
|
*
|
|
@@ -876,17 +829,17 @@ var ColReorder = /** @class */ (function () {
|
|
|
876
829
|
enable: true,
|
|
877
830
|
order: null
|
|
878
831
|
};
|
|
879
|
-
ColReorder.version = '2.0.
|
|
832
|
+
ColReorder.version = '2.0.1';
|
|
880
833
|
return ColReorder;
|
|
881
834
|
}());
|
|
882
835
|
|
|
883
|
-
/*! ColReorder 2.0.
|
|
836
|
+
/*! ColReorder 2.0.1
|
|
884
837
|
* © SpryMedia Ltd - datatables.net/license
|
|
885
838
|
*/
|
|
886
839
|
/**
|
|
887
840
|
* @summary ColReorder
|
|
888
841
|
* @description Provide the ability to reorder columns in a DataTable
|
|
889
|
-
* @version 2.0.
|
|
842
|
+
* @version 2.0.1
|
|
890
843
|
* @author SpryMedia Ltd
|
|
891
844
|
* @contact datatables.net
|
|
892
845
|
* @copyright SpryMedia Ltd.
|
|
@@ -1018,9 +971,5 @@ $(document).on('preInit.dt', function (e, settings) {
|
|
|
1018
971
|
});
|
|
1019
972
|
|
|
1020
973
|
|
|
1021
|
-
return DataTable;
|
|
1022
|
-
}));
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
974
|
return DataTable;
|
|
1026
975
|
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/*! ColReorder 2.0.
|
|
1
|
+
/*! ColReorder 2.0.1
|
|
2
2
|
* © SpryMedia Ltd - datatables.net/license
|
|
3
3
|
*/
|
|
4
|
-
!function(o){var r,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return o(t,window,document)}):"object"==typeof exports?(r=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||r(t),n(t,e),o(e,
|
|
5
|
-
/*! ColReorder 2.0.
|
|
4
|
+
!function(o){var r,n;"function"==typeof define&&define.amd?define(["jquery","datatables.net"],function(t){return o(t,window,document)}):"object"==typeof exports?(r=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||r(t),n(t,e),o(e,0,t.document)}:(n(window,r),module.exports=o(r,window,window.document))):o(jQuery,window,document)}(function(c,t,h){"use strict";var n=c.fn.dataTable;function f(t,e,o,r){var n=t.splice(e,o);n.unshift(0),n.unshift(r<e?r:r-o+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:g(e)}])}function s(t){return t.settings()[0].aoColumns.map(function(t){return t._crOriginalIdx})}function p(t,e,o,r){for(var n=[],s=0;s<t.length;s++){var i=t[s];f(i,o[0],o.length,r);for(var a=0;a<i.length;a++){var l,d=i[a].cell;n.includes(d)||(l=d.getAttribute("data-dt-column").split(",").map(function(t){return e[t]}).join(","),d.setAttribute("data-dt-column",l),n.push(d))}}}function i(t){t.columns().iterator("column",function(t,e){t=t.aoColumns;void 0===t[e]._crOriginalIdx&&(t[e]._crOriginalIdx=e)})}function g(t){for(var e=[],o=0;o<t.length;o++)e[t[o]]=o;return e}function l(t,e,o){var r,n=t.settings()[0],s=n.aoColumns,i=s.map(function(t,e){return e});if(!e.includes(o)){f(i,e[0],e.length,o);var a=g(i);for(f(s,e[0],e.length,o),r=0;r<n.aoData.length;r++){var l=n.aoData[r],d=l.anCells;if(d)for(f(d,e[0],e.length,o),c=0;c<d.length;c++)l.nTr&&d[c]&&s[c].bVisible&&l.nTr.appendChild(d[c]),d[c]&&d[c]._DT_CellIndex&&(d[c]._DT_CellIndex.column=c)}for(r=0;r<s.length;r++){for(var u=s[r],c=0;c<u.aDataSort.length;c++)u.aDataSort[c]=a[u.aDataSort[c]];u.idx=a[u.idx],u.bVisible&&n.colgroup.append(u.colEl)}p(n.aoHeader,a,e,o),p(n.aoFooter,a,e,o),f(n.aoPreSearchCols,e[0],e.length,o),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:o,mapping:a}])}}function m(t,e){for(var o=0;o<e.length;o++){var r=e[o];"number"==typeof r?e[o]=t[r]:c.isPlainObject(r)&&void 0!==r.idx?r.idx=t[r.idx]:Array.isArray(r)&&"number"==typeof r[0]&&(r[0]=t[r[0]])}}function d(t,e,o){var r=!1;if(e.length!==t.columns().count())t.error("ColReorder - column count mismatch");else{for(var n=g(e=o?u(t,e,"toCurrent"):e),s=0;s<n.length;s++){var i=n.indexOf(s);s!==i&&(f(n,i,1,s),l(t,[i],s),r=!0)}r&&a(t)}}function u(t,e,o){var r=t.colReorder.order(),n=t.settings()[0].aoColumns;return"toCurrent"===o||"fromOriginal"===o?Array.isArray(e)?e.map(function(t){return r.indexOf(t)}):r.indexOf(e):Array.isArray(e)?e.map(function(t){return n[t]._crOriginalIdx}):n[e]._crOriginalIdx}function v(t,e,o){var r=t.columns().count();return!(e[0]<o&&o<e[e.length]||e[0]<0&&e[e.length-1]>r||o<0&&r<o||!e.includes(o)&&(!y(t.table().header.structure(),e,o)||!y(t.table().footer.structure(),e,o)))}function y(t,e,o){for(var r=function(t){for(var e=[],o=0;o<t.length;o++){e.push([]);for(var r=0;r<t[o].length;r++){var n=t[o][r];if(n)for(var s=0;s<n.rowspan;s++)for(var i=0;i<n.colspan;i++)e[o+s][r+i]=n.cell}}return e}(t),n=0;n<r.length;n++)f(r[n],e[0],e.length,o);for(n=0;n<r.length;n++)for(var s=[],i=0;i<r[n].length;i++){var a=r[n][i];if(s.includes(a)){if(s[s.length-1]!==a)return}else s.push(a)}return 1}_.prototype.disable=function(){return this.c.enable=!1,this},_.prototype.enable=function(t){return!1===(t=void 0===t?!0:t)?this.disable():(this.c.enable=!0,this)},_.prototype._addListener=function(t){var e=this;c(t).on("selectstart.colReorder",function(){return!1}).on("mousedown.colReorder touchstart.colReorder",function(t){"mousedown"===t.type&&1!==t.which||e.c.enable&&e._mouseDown(t,this)})},_.prototype._createDragNode=function(){var t=this.s.mouse.target,e=t.parent(),o=e.parent(),r=o.parent(),n=t.clone();this.dom.drag=c(r[0].cloneNode(!1)).addClass("dtcr-cloned").append(c(o[0].cloneNode(!1)).append(c(e[0].cloneNode(!1)).append(n[0]))).css({position:"absolute",top:0,left:0,width:c(t).outerWidth(),height:c(t).outerHeight()}).appendTo("body")},_.prototype._cursorPosition=function(t,e){return(-1!==t.type.indexOf("touch")?t.originalEvent.touches[0]:t)[e]},_.prototype._mouseDown=function(t,e){for(var o=this,r=c(t.target).closest("th, td"),n=r.offset(),s=this.dt.columns(this.c.columns).indexes().toArray(),i=c(e).attr("data-dt-column").split(",").map(function(t){return parseInt(t,10)}),a=0;a<i.length;a++)if(!s.includes(i[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=r,this.s.mouse.targets=i;for(var l=0;l<i.length;l++){var d=this.dt.cells(null,i[l],{page:"current"}).nodes().to$(),u="dtcr-moving";0===l&&(u+=" dtcr-moving-first"),l===i.length-1&&(u+=" dtcr-moving-last"),d.addClass(u)}this._regions(i),this._scrollRegions(),c(h).on("mousemove.colReorder touchmove.colReorder",function(t){o._mouseMove(t)}).on("mouseup.colReorder touchend.colReorder",function(t){o._mouseUp(t)})},_.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;c(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=c(this.dt.table().node()).offset().left,o=this._cursorPosition(t,"pageX")-e,e=this.s.dropZones.find(function(t){return t.left<=o&&o<=t.left+t.width});this.s.mouse.absLeft=this._cursorPosition(t,"pageX"),e&&!e.self&&this._move(e,o)},_.prototype._mouseUp=function(t){c(h).off(".colReorder"),c(h.body).removeClass("dtcr-dragging"),this.dom.drag&&(this.dom.drag.remove(),this.dom.drag=null),this.s.scrollInterval&&clearInterval(this.s.scrollInterval),this.dt.cells(".dtcr-moving").nodes().to$().removeClass("dtcr-moving dtcr-moving-first dtcr-moving-last")},_.prototype._move=function(t,e){var o,r,n=this,t=(this.dt.colReorder.move(this.s.mouse.targets,t.colIdx),this.s.mouse.targets=c(this.s.mouse.target).attr("data-dt-column").split(",").map(function(t){return parseInt(t,10)}),this._regions(this.s.mouse.targets),this.s.dropZones.find(function(t){return t.colIdx===n.s.mouse.targets[0]})),s=this.s.dropZones.indexOf(t);t.left>e&&(r=t.left-e,o=this.s.dropZones[s-1],t.left-=r,t.width+=r,o)&&(o.width-=r),(t=this.s.dropZones.find(function(t){return t.colIdx===n.s.mouse.targets[n.s.mouse.targets.length-1]})).left+t.width<e&&(o=e-(t.left+t.width),r=this.s.dropZones[s+1],t.width+=o,r)&&(r.left+=o,r.width-=o)},_.prototype._regions=function(n){var s=this,i=[],a=0,l=0,d=this.dt.columns(this.c.columns).indexes().toArray(),u=this.dt.columns().widths();this.dt.columns().every(function(t,e,o){var r;this.visible()&&(r=u[t],d.includes(t)&&(v(s.dt,n,t)?i.push({colIdx:t,left:a-l,self:n[0]<=t&&t<=n[n.length-1],width:r+l}):t<n[0]?i.length&&(i[i.length-1].width+=r):t>n[n.length-1]&&(l+=r)),a+=r)}),this.s.dropZones=i},_.prototype._isScrolling=function(){return this.dt.table().body().parentNode!==this.dt.table().header().parentNode},_.prototype._scrollRegions=function(){var e,o,r,n;this._isScrolling()&&(o=c((e=this).dt.table().container()).position().left,r=c(this.dt.table().container()).outerWidth(),n=this.dt.table().body().parentElement.parentElement,this.s.scrollInterval=setInterval(function(){var t=e.s.mouse.absLeft;t<o+75&&n.scrollLeft?n.scrollLeft-=5:o+r-75<t&&n.scrollLeft<n.scrollWidth&&(n.scrollLeft+=5)},25))},_.defaults={columns:"",enable:!0,order:null},_.version="2.0.1";
|
|
5
|
+
/*! ColReorder 2.0.1
|
|
6
6
|
* © SpryMedia Ltd - datatables.net/license
|
|
7
|
-
*/var b=_;function _(r,t){this.dom={drag:null},this.c={columns:null,enable: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 e,o=this;r.settings()[0]._colReorder||((r.settings()[0]._colReorder=this).dt=r,c.extend(this.c,_.defaults,t),i(r),r.on("stateSaveParams",function(t,e,o){o.colReorder=s(r)}),r.on("destroy",function(){r.off(".colReorder"),r.colReorder.reset()}),t=r.state.loaded(),e=this.c.order,(e=t&&t.colReorder?t.colReorder:e)&&r.ready(function(){
|
|
7
|
+
*/var b=_;function _(r,t){this.dom={drag:null},this.c={columns:null,enable: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 e,o=this;r.settings()[0]._colReorder||((r.settings()[0]._colReorder=this).dt=r,c.extend(this.c,_.defaults,t),i(r),r.on("stateSaveParams",function(t,e,o){o.colReorder=s(r)}),r.on("destroy",function(){r.off(".colReorder"),r.colReorder.reset()}),t=r.state.loaded(),e=this.c.order,(e=t&&t.colReorder?t.colReorder:e)&&r.ready(function(){d(r,e,!0)}),r.table().header.structure().forEach(function(t){for(var e=0;e<t.length;e++)t[e]&&t[e].cell&&o._addListener(t[e].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 i(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 i(this),t?this.tables().every(function(){d(this,t,e)}):this.context.length?s(this):null}),n.Api.register("colReorder.reset()",function(){return i(this),this.tables().every(function(){var t=this.columns().every(function(t){return t}).flatten().toArray();d(this,t,!0)})}),n.Api.register("colReorder.transpose()",function(t,e){return i(this),u(this,t,e=e||"toCurrent")}),n.ColReorder=b,c(h).on("stateLoadInit.dt",function(t,e,o){if("dt"===t.namespace){t=new n.Api(e);if(o.colReorder)if(t.ready())d(t,o.colReorder,!0);else{m(g(o.colReorder),o.order);for(var r=0;r<o.columns.length;r++)o.columns[r]._cr_sort=o.colReorder[r];o.columns.sort(function(t,e){return t._cr_sort-e._cr_sort})}}}),c(h).on("preInit.dt",function(t,e){var o,r;"dt"===t.namespace&&(t=e.oInit.colReorder,r=n.defaults.colReorder,t||r)&&(o=c.extend({},r,t),!1!==t)&&(r=new n.Api(e),new b(r,o))}),n});
|
package/assets/js/cdn.json
CHANGED