META-INF.resources.bower_components.datatables.net-responsive.js.dataTables.responsive.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-data-tables Show documentation
Show all versions of jwebmp-data-tables Show documentation
The JWebSwing implementation for Data Tables
/*! Responsive 2.2.3
* 2014-2018 SpryMedia Ltd - datatables.net/license
*/
(function(a){if(typeof define==="function"&&define.amd){define(["jquery","datatables.net"],function(b){return a(b,window,document)})}else{if(typeof exports==="object"){module.exports=function(b,c){if(!b){b=window}if(!c||!c.fn.dataTable){c=require("datatables.net")(b,c).$}return a(c,b,b.document)}}else{a(jQuery,window,document)}}}(function(f,h,i,c){var d=f.fn.dataTable;var e=function(k,l){if(!d.versionCheck||!d.versionCheck("1.10.10")){throw"DataTables Responsive requires DataTables 1.10.10 or newer"}this.s={dt:new d.Api(k),columns:[],current:[]};if(this.s.dt.settings()[0].responsive){return}if(l&&typeof l.details==="string"){l.details={type:l.details}}else{if(l&&l.details===false){l.details={type:false}}else{if(l&&l.details===true){l.details={type:"inline"}}}}this.c=f.extend(true,{},e.defaults,d.defaults.responsive,l);k.responsive=this;this._constructor()};f.extend(e.prototype,{_constructor:function(){var o=this;var n=this.s.dt;var k=n.settings()[0];var m=f(h).width();n.settings()[0]._responsive=this;f(h).on("resize.dtr orientationchange.dtr",d.util.throttle(function(){var p=f(h).width();if(p!==m){o._resize();m=p}}));k.oApi._fnCallbackReg(k,"aoRowCreatedCallback",function(r,q,p){if(f.inArray(false,o.s.current)!==-1){f(">td, >th",r).each(function(t){var s=n.column.index("toData",t);if(o.s.current[s]===false){f(this).css("display","none")}})}});n.on("destroy.dtr",function(){n.off(".dtr");f(n.table().body()).off(".dtr");f(h).off("resize.dtr orientationchange.dtr");f.each(o.s.current,function(p,q){if(q===false){o._setColumnVis(p,true)}})});this.c.breakpoints.sort(function(q,p){return q.widthp.width?-1:0});this._classLogic();this._resizeAuto();var l=this.c.details;if(l.type!==false){o._detailsInit();n.on("column-visibility.dtr",function(){if(o._timer){clearTimeout(o._timer)}o._timer=setTimeout(function(){o._timer=null;o._classLogic();o._resizeAuto();o._resize();o._redrawChildren()},100)});n.on("draw.dtr",function(){o._redrawChildren()});f(n.table().node()).addClass("dtr-"+l.type)}n.on("column-reorder.dtr",function(r,q,p){o._classLogic();o._resizeAuto();o._resize()});n.on("column-sizing.dtr",function(){o._resizeAuto();o._resize()});n.on("preXhr.dtr",function(){var p=[];n.rows().every(function(){if(this.child.isShown()){p.push(this.id(true))}});n.one("draw.dtr",function(){o._resizeAuto();o._resize();n.rows(p).every(function(){o._detailsDisplay(this,false)})})});n.on("init.dtr",function(r,q,p){o._resizeAuto();o._resize();if(f.inArray(false,o.s.current)){n.columns.adjust()}});this._resize()},_columnsVisiblity:function(w){var k=this.s.dt;var o=this.s.columns;var q,y;var m=o.map(function(A,z){return{columnIdx:z,priority:A.priority}}).sort(function(A,z){if(A.priority!==z.priority){return A.priority-z.priority}return A.columnIdx-z.columnIdx});var v=f.map(o,function(z,A){if(k.column(A).visible()===false){return"not-visible"}return z.auto&&z.minWidth===null?false:z.auto===true?"-":f.inArray(w,z.includeIn)!==-1});var x=0;for(q=0,y=v.length;q=w){q(x,o[v].name)}}}else{if(t==="not-"){for(v=0,s=o.length;v=0;p--){if(k<=q[p].width){s=q[p].name;break}}var w=this._columnsVisiblity(s);this.s.current=w;var v=false;for(p=0,u=n.length;p").append(r).appendTo(s)}f(" ").append(t).appendTo(p);if(this.c.details.type==="inline"){f(v).addClass("dtr-inline collapsed")}f(v).find("[name]").removeAttr("name");f(v).css("position","relative");var o=f("").css({width:1,height:1,overflow:"hidden",clear:"both"}).append(v);o.insertBefore(l.table().node());t.each(function(x){var w=l.column.index("fromVisible",x);n[w].minWidth=this.offsetWidth||0});o.remove()},_setColumnVis:function(k,n){var l=this.s.dt;var m=n?"":"none";f(l.column(k).header()).css("display",m);f(l.column(k).footer()).css("display",m);l.column(k).nodes().to$().css("display",m);if(!f.isEmptyObject(j)){l.cells(null,k).indexes().each(function(o){b(l,o.row,o.column)})}},_tabIndexes:function(){var m=this.s.dt;var l=m.cells({page:"current"}).nodes().to$();var k=m.settings()[0];var n=this.c.details.target;l.filter("[data-dtr-keyboard]").removeData("[data-dtr-keyboard]");if(typeof n==="number"){m.cells(null,n,{page:"current"}).nodes().to$().attr("tabIndex",k.iTabIndex).data("dtr-keyboard",1)}else{if(n==="td:first-child, th:first-child"){n=">td:first-child, >th:first-child"}f(n,m.rows({page:"current"}).nodes()).attr("tabIndex",k.iTabIndex).data("dtr-keyboard",1)}}});e.breakpoints=[{name:"desktop",width:Infinity},{name:"tablet-l",width:1024},{name:"tablet-p",width:768},{name:"mobile-l",width:480},{name:"mobile-p",width:320}];e.display={childRow:function(l,m,k){if(m){if(f(l.node()).hasClass("parent")){l.child(k(),"child").show();return true}}else{if(!l.child.isShown()){l.child(k(),"child").show();f(l.node()).addClass("parent");return true}else{l.child(false);f(l.node()).removeClass("parent");return false}}},childRowImmediate:function(l,m,k){if((!m&&l.child.isShown())||!l.responsive.hasHidden()){l.child(false);f(l.node()).removeClass("parent");return false}else{l.child(k(),"child").show();f(l.node()).addClass("parent");return true}},modal:function(k){return function(o,p,l){if(!p){var n=function(){m.remove();f(i).off("keypress.dtr")};var m=f('').append(f('').append(f('').append(l())).append(f('×').click(function(){n()}))).append(f('').click(function(){n()})).appendTo("body");f(i).on("keyup.dtr",function(q){if(q.keyCode===27){q.stopPropagation();n()}})}else{f("div.dtr-modal-content").empty().append(l())}if(k&&k.header){f("div.dtr-modal-content").prepend(""+k.header(o)+"
")}}}};var j={};function a(q,r,n){var m=r+"-"+n;if(j[m]){return j[m]}var l=[];var p=q.cell(r,n).node().childNodes;for(var o=0,k=p.length;o ');var p=false;var o=f.each(l,function(r,q){if(q.hidden){f(''+q.title+" ").append(f('').append(a(m,q.rowIndex,q.columnIndex))).appendTo(k);p=true}});return p?k:false}},listHidden:function(){return function(l,m,k){var n=f.map(k,function(o){return o.hidden?''+o.title+' '+o.data+" ":""}).join("");return n?f('
').append(n):false}},tableAll:function(k){k=f.extend({tableClass:""},k);return function(m,n,l){var o=f.map(l,function(p){return''+p.title+": "+p.data+" "}).join("");return f('
').append(o)}}};e.defaults={breakpoints:e.breakpoints,auto:true,details:{display:e.display.childRow,renderer:e.renderer.listHidden(),target:0,type:"inline"},orthogonal:"display"};var g=f.fn.dataTable.Api;g.register("responsive()",function(){return this});g.register("responsive.index()",function(k){k=f(k);return{column:k.data("dtr-index"),row:k.parent().data("dtr-index")}});g.register("responsive.rebuild()",function(){return this.iterator("table",function(k){if(k._responsive){k._responsive._classLogic()}})});g.register("responsive.recalc()",function(){return this.iterator("table",function(k){if(k._responsive){k._responsive._resizeAuto();k._responsive._resize()}})});g.register("responsive.hasHidden()",function(){var k=this.context[0];return k._responsive?f.inArray(false,k._responsive.s.current)!==-1:false});g.registerPlural("columns().responsiveHidden()","column().responsiveHidden()",function(){return this.iterator("column",function(l,k){return l._responsive?l._responsive.s.current[k]:false},1)});e.version="2.2.3";f.fn.dataTable.Responsive=e;f.fn.DataTable.Responsive=e;f(i).on("preInit.dt.dtr",function(m,l,k){if(m.namespace!=="dt"){return}if(f(l.nTable).hasClass("responsive")||f(l.nTable).hasClass("dt-responsive")||l.oInit.responsive||d.defaults.responsive){var n=l.oInit.responsive;if(n!==false){new e(l,f.isPlainObject(n)?n:{})}}});return e}));
© 2015 - 2025 Weber Informatics LLC | Privacy Policy