All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.bower_components.datatables.net-autofill.js.dataTables.autoFill.min.js Maven / Gradle / Ivy

There is a newer version: 0.66.0.1
Show newest version
/*!
 AutoFill 2.3.2
 ©2008-2018 SpryMedia Ltd - datatables.net/license
*/
(function(f){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(j){return f(j,window,document)}):"object"===typeof exports?module.exports=function(j,k){j||(j=window);if(!k||!k.fn.dataTable)k=require("datatables.net")(j,k).$;return f(k,j,j.document)}:f(jQuery,window,document)})(function(f,j,k,q){var l=f.fn.dataTable,s=0,i=function(b,c){if(!l.versionCheck||!l.versionCheck("1.10.8"))throw"Warning: AutoFill requires DataTables 1.10.8 or greater";this.c=f.extend(!0,{},l.defaults.autoFill,
i.defaults,c);this.s={dt:new l.Api(b),namespace:".autoFill"+s++,scroll:{},scrollInterval:null,handle:{height:0,width:0},enabled:!1};this.dom={handle:f('
'),select:{top:f('
'),right:f('
'),bottom:f('
'),left:f('
')},background:f('
'),list:f('
'+this.s.dt.i18n("autoFill.info", "")+"
    "),dtScroll:null,offsetParent:null};this._constructor()};f.extend(i.prototype,{enabled:function(){return this.s.enabled},enable:function(b){var c=this;if(!1===b)return this.disable();this.s.enabled=!0;this._focusListener();this.dom.handle.on("mousedown",function(a){c._mousedown(a);return!1});return this},disable:function(){this.s.enabled=!1;this._focusListenerRemove();return this},_constructor:function(){var b=this,c=this.s.dt,a=f("div.dataTables_scrollBody",this.s.dt.table().container()); c.settings()[0].autoFill=this;a.length&&(this.dom.dtScroll=a,"static"===a.css("position")&&a.css("position","relative"));!1!==this.c.enable&&this.enable();c.on("destroy.autoFill",function(){b._focusListenerRemove()})},_attach:function(b){var c=this.s.dt,a=c.cell(b).index(),d=this.dom.handle,e=this.s.handle;if(!a||-1===c.columns(this.c.columns).indexes().indexOf(a.column))this._detach();else{this.dom.offsetParent||(this.dom.offsetParent=f(c.table().node()).offsetParent());if(!e.height||!e.width)d.appendTo("body"), e.height=d.outerHeight(),e.width=d.outerWidth();c=this._getPosition(b,this.dom.offsetParent);this.dom.attachedTo=b;d.css({top:c.top+b.offsetHeight-e.height,left:c.left+b.offsetWidth-e.width}).appendTo(this.dom.offsetParent)}},_actionSelector:function(b){var c=this,a=this.s.dt,d=i.actions,e=[];f.each(d,function(c,d){d.available(a,b)&&e.push(c)});if(1===e.length&&!1===this.c.alwaysAsk){var h=d[e[0]].execute(a,b);this._update(h,b)}else{var g=this.dom.list.children("ul").empty();e.push("cancel");f.each(e, function(e,h){g.append(f("
  • ").append('
    '+d[h].option(a,b)+"
    ").append(f('
    ').append(f('").on("click",function(){var e=d[h].execute(a,b,f(this).closest("li"));c._update(e,b);c.dom.background.remove();c.dom.list.remove()}))))});this.dom.background.appendTo("body");this.dom.list.appendTo("body");this.dom.list.css("margin-top",-1*(this.dom.list.outerHeight()/ 2))}},_detach:function(){this.dom.attachedTo=null;this.dom.handle.detach()},_drawSelection:function(b){var c=this.s.dt,a=this.s.start,d=f(this.dom.start),e={row:this.c.vertical?c.rows({page:"current"}).nodes().indexOf(b.parentNode):a.row,column:this.c.horizontal?f(b).index():a.column},b=c.column.index("toData",e.column),h=c.row(":eq("+e.row+")",{page:"current"}),h=f(c.cell(h.index(),b).node());if(c.cell(h).any()&&-1!==c.columns(this.c.columns).indexes().indexOf(b)){this.s.end=e;var g,c=a.row=c;d--)a.push(d);return a},_shiftScroll:function(b){var c=this,a=this.s.scroll,d=!1,e=b.pageY-k.body.scrollTop,f=b.pageX-k.body.scrollLeft,g,i,j,l;65>e?g=-5:e>a.windowHeight-65&&(g=5);65>f?i=-5:f>a.windowWidth-65&&(i=5);null!==a.dtTop&&b.pageYa.dtTop+a.dtHeight-65&&(j=5);null!==a.dtLeft&&b.pageXa.dtLeft+a.dtWidth-65&&(l=5);g||i||j||l?(a.windowVert=g,a.windowHoriz= i,a.dtVert=j,a.dtHoriz=l,d=!0):this.s.scrollInterval&&(clearInterval(this.s.scrollInterval),this.s.scrollInterval=null);!this.s.scrollInterval&&d&&(this.s.scrollInterval=setInterval(function(){if(a.windowVert)k.body.scrollTop=k.body.scrollTop+a.windowVert;if(a.windowHoriz)k.body.scrollLeft=k.body.scrollLeft+a.windowHoriz;if(a.dtVert||a.dtHoriz){var b=c.dom.dtScroll[0];if(a.dtVert)b.scrollTop=b.scrollTop+a.dtVert;if(a.dtHoriz)b.scrollLeft=b.scrollLeft+a.dtHoriz}},20))},_update:function(b,c){if(!1!== b){var a=this.s.dt,d;this._emitEvent("preAutoFill",[a,c]);this._editor(c);if(null!==this.c.update?this.c.update:!this.c.editor){for(var e=0,f=c.length;e')},execute:function(b, c,a){for(var b=1*c[0][0].data,a=1*f("input",a).val(),d=0,e=c.length;d"+c[0][0].label+"")},execute:function(b,c){for(var a=c[0][0].data,d=0,e=c.length;d




  • © 2015 - 2025 Weber Informatics LLC | Privacy Policy