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

package.js.dataTables.min.mjs Maven / Gradle / Ivy

There is a newer version: 2.1.7
Show newest version
/*! DataTables 2.1.4
 * © SpryMedia Ltd - datatables.net/license
 */
import jQuery from"jquery";var _ext,_Api,_api_register,_api_registerPlural,$=jQuery,DataTable=function(e,b){var v,D,y;return DataTable.factory(e,b)?DataTable:this instanceof DataTable?$(e).DataTable(b):(D=void 0===(b=e),y=(v=this).length,D&&(b={}),this.api=function(){return new _Api(this)},this.each(function(){var e=1").prependTo(this),fastData:function(e,t,a){return _fnGetCellData(u,e,t,a)}}),a=(u.nTable=this,u.oInit=e,i.push(u),u.api=new _Api(u),u.oInstance=1===v.length?v:r.dataTable(),_fnCompatOpts(e),e.aLengthMenu&&!e.iDisplayLength&&(e.iDisplayLength=Array.isArray(e.aLengthMenu[0])?e.aLengthMenu[0][0]:$.isPlainObject(e.aLengthMenu[0])?e.aLengthMenu[0].value:e.aLengthMenu[0]),e=_fnExtend($.extend(!0,{},n),e),_fnMap(u.oFeatures,e,["bPaginate","bLengthChange","bFilter","bSort","bSortMulti","bInfo","bProcessing","bAutoWidth","bSortClasses","bServerSide","bDeferRender"]),_fnMap(u,e,["ajax","fnFormatNumber","sServerMethod","aaSorting","aaSortingFixed","aLengthMenu","sPaginationType","iStateDuration","bSortCellsTop","iTabIndex","sDom","fnStateLoadCallback","fnStateSaveCallback","renderer","searchDelay","rowId","caption","layout","orderDescReverse",["iCookieDuration","iStateDuration"],["oSearch","oPreviousSearch"],["aoSearchCols","aoPreSearchCols"],["iDisplayLength","_iDisplayLength"]]),_fnMap(u.oScroll,e,[["sScrollX","sX"],["sScrollXInner","sXInner"],["sScrollY","sY"],["bScrollCollapse","bCollapse"]]),_fnMap(u.oLanguage,e,"fnInfoCallback"),_fnCallbackReg(u,"aoDrawCallback",e.fnDrawCallback),_fnCallbackReg(u,"aoStateSaveParams",e.fnStateSaveParams),_fnCallbackReg(u,"aoStateLoadParams",e.fnStateLoadParams),_fnCallbackReg(u,"aoStateLoaded",e.fnStateLoaded),_fnCallbackReg(u,"aoRowCallback",e.fnRowCallback),_fnCallbackReg(u,"aoRowCreatedCallback",e.fnCreatedRow),_fnCallbackReg(u,"aoHeaderCallback",e.fnHeaderCallback),_fnCallbackReg(u,"aoFooterCallback",e.fnFooterCallback),_fnCallbackReg(u,"aoInitComplete",e.fnInitComplete),_fnCallbackReg(u,"aoPreDrawCallback",e.fnPreDrawCallback),u.rowIdFn=_fnGetObjectDataFn(e.rowId),_fnBrowserDetect(u),u.oClasses),c=($.extend(a,DataTable.ext.classes,e.oClasses),r.addClass(a.table),u.oFeatures.bPaginate||(e.iDisplayStart=0),void 0===u.iInitDisplayStart&&(u.iInitDisplayStart=e.iDisplayStart,u._iDisplayStart=e.iDisplayStart),e.iDeferLoading),f=(null!==c&&(u.deferLoading=!0,d=Array.isArray(c),u._iRecordsDisplay=d?c[0]:c,u._iRecordsTotal=d?c[1]:c),[]),d=this.getElementsByTagName("thead"),c=_fnDetectHeader(u,d[0]);if(e.aoColumns)f=e.aoColumns;else if(c.length)for(g=c[t=0].length;t").appendTo(r):c).html(u.caption),c.length&&(c[0]._captionSide=c.css("caption-side"),u.captionNode=c[0]),0===d.length&&(d=$("").appendTo(r)),u.nTHead=d[0],$("tr",d).addClass(a.thead.row),r.children("tbody")),d=(0===c.length&&(c=$("").insertAfter(d)),u.nTBody=c[0],r.children("tfoot")),m=(0===d.length&&(d=$("").appendTo(r)),u.nTFoot=d[0],$("tr",d).addClass(a.tfoot.row),u.aiDisplay=u.aiDisplayMaster.slice(),u.bInitialised=!0,u.oLanguage);$.extend(!0,m,e.oLanguage),m.sUrl?$.ajax({dataType:"json",url:m.sUrl,success:function(e){_fnCamelToHungarian(n.oLanguage,e),$.extend(!0,m,e,u.oInit.oLanguage),_fnCallbackFire(u,null,"i18n",[u],!0),_fnInitialise(u)},error:function(){_fnLog(u,0,"i18n file loading error",21),_fnInitialise(u)}}):(_fnCallbackFire(u,null,"i18n",[u]),_fnInitialise(u))}}),v=null,this)},_re_dic=(DataTable.ext=_ext={buttons:{},classes:{},builder:"-source-",errMode:"alert",feature:[],features:{},search:[],selector:{cell:[],column:[],row:[]},legacy:{ajax:null},pager:{},renderer:{pageButton:{},header:{}},order:{},type:{className:{},detect:[],render:{},search:{},order:{}},_unique:0,fnVersionCheck:DataTable.fnVersionCheck,iApiIndex:0,sVersion:DataTable.version},$.extend(_ext,{afnFiltering:_ext.search,aTypes:_ext.type.detect,ofnSearch:_ext.type.search,oSort:_ext.type.order,afnSortData:_ext.order,aoFeatures:_ext.feature,oStdClasses:_ext.classes,oPagination:_ext.pager}),$.extend(DataTable.ext.classes,{container:"dt-container",empty:{row:"dt-empty"},info:{container:"dt-info"},layout:{row:"dt-layout-row",cell:"dt-layout-cell",tableRow:"dt-layout-table",tableCell:"",start:"dt-layout-start",end:"dt-layout-end",full:"dt-layout-full"},length:{container:"dt-length",select:"dt-input"},order:{canAsc:"dt-orderable-asc",canDesc:"dt-orderable-desc",isAsc:"dt-ordering-asc",isDesc:"dt-ordering-desc",none:"dt-orderable-none",position:"sorting_"},processing:{container:"dt-processing"},scrolling:{body:"dt-scroll-body",container:"dt-scroll",footer:{self:"dt-scroll-foot",inner:"dt-scroll-footInner"},header:{self:"dt-scroll-head",inner:"dt-scroll-headInner"}},search:{container:"dt-search",input:"dt-input"},table:"dataTable",tbody:{cell:"",row:""},thead:{cell:"",row:""},tfoot:{cell:"",row:""},paging:{active:"current",button:"dt-paging-button",container:"dt-paging",disabled:"disabled"}}),{}),_re_new_lines=/[\r\n\u2028]/g,_re_html=/<([^>]*>)/g,_max_str_len=Math.pow(2,28),_re_date=/^\d{2,4}[./-]\d{1,2}[./-]\d{1,2}([T ]{1}\d{1,2}[:.]\d{2}([.:]\d{2})?)?$/,_re_escape_regex=new RegExp("(\\"+["/",".","*","+","?","|","(",")","[","]","{","}","\\","$","^","-"].join("|\\")+")","g"),_re_formatted_numeric=/['\u00A0,$£€¥%\u2009\u202F\u20BD\u20a9\u20BArfkɃΞ]/gi,_empty=function(e){return!e||!0===e||"-"===e},_intVal=function(e){var t=parseInt(e,10);return!isNaN(t)&&isFinite(e)?t:null},_numToDecimal=function(e,t){return _re_dic[t]||(_re_dic[t]=new RegExp(_fnEscapeRegex(t),"g")),"string"==typeof e&&"."!==t?e.replace(/\./g,"").replace(_re_dic[t],"."):e},_isNumber=function(e,t,a,n){var r=typeof e,i="string"==r;return"number"==r||"bigint"==r||!(!n||!_empty(e))||(t&&i&&(e=_numToDecimal(e,t)),a&&i&&(e=e.replace(_re_formatted_numeric,"")),!isNaN(parseFloat(e))&&isFinite(e))},_isHtml=function(e){return _empty(e)||"string"==typeof e},_htmlNumeric=function(e,t,a,n){return!(!n||!_empty(e))||("string"!=typeof e||!e.match(/<(input|select)/i))&&_isHtml(e)&&!!_isNumber(_stripHtml(e),t,a,n)||null},_pluck=function(e,t,a){var n=[],r=0,i=e.length;if(void 0!==a)for(;r_max_str_len)throw new Error("Exceeded max str len");var t;for(e=e.replace(_re_html,"");(e=(t=e).replace(/