From 1cf087e5bcb1568b9ca76864334a5b3bca3442b2 Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Fri, 5 Jun 2015 23:10:25 +1000 Subject: [PATCH] Added auto filter tests --- Gruntfile.js | 14 +- dist/tablefilter/tablefilter.css | 12 +- dist/tablefilter/tablefilter.js | 9 +- examples/dev.html | 146 ++++++++++--------- package.json | 1 + src-es6/tablefilter.js | 235 ++++++++++++------------------- static/style/tablefilter.css | 12 +- test/test-auto-filter.html | 80 +++++++++++ test/test-auto-filter.js | 30 ++++ test/test.js | 2 +- 10 files changed, 307 insertions(+), 234 deletions(-) create mode 100644 test/test-auto-filter.html create mode 100644 test/test-auto-filter.js diff --git a/Gruntfile.js b/Gruntfile.js index 0eac50a5..c3ed8885 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -101,6 +101,16 @@ module.exports = function (grunt) { // }, }, + watch: { + app: { + files: ["src-es6/**/*"], + tasks: ["dev"], + options: { + spawn: false + } + } + }, + babel: { options: { sourceMap: true, @@ -122,6 +132,7 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-jshint'); grunt.loadNpmTasks('grunt-contrib-qunit'); grunt.loadNpmTasks('grunt-contrib-copy'); + grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-webpack'); grunt.loadNpmTasks('grunt-babel'); @@ -133,7 +144,8 @@ module.exports = function (grunt) { grunt.registerTask('server', ['webpack-dev-server:start']); - grunt.registerTask('dev', ['jshint', 'webpack:build', 'copy:build']); + grunt.registerTask('dev', + ['jshint', 'webpack:build', 'copy:build', 'watch:app']); // Production build grunt.registerTask('dist', diff --git a/dist/tablefilter/tablefilter.css b/dist/tablefilter/tablefilter.css index d179752b..9ee86215 100644 --- a/dist/tablefilter/tablefilter.css +++ b/dist/tablefilter/tablefilter.css @@ -7,7 +7,8 @@ /* TABLE LAYOUT =====================================================*/ table.TF{ - font:normal 12px arial, tahoma, helvetica, sans-serif; + /*font:normal 12px arial, tahoma, helvetica, sans-serif;*/ + font:inherit; border-top:1px solid #D0D0D0; border-left:1px solid #D0D0D0; border-bottom:1px solid #ccc; border-right:1px solid #ccc; } @@ -61,9 +62,9 @@ select.flt_multi{ /* multiple select filter */ border-top:1px solid #ccc; border-bottom:1px solid #999; margin:0; width:120px; vertical-align:middle; } -.fltWatermark{ /* watermark input */ +/*.fltWatermark{ watermark input color:#999; -} +}*/ .div_checklist{ /* div containing checklist */ width:100%; height:100px; border:1px solid #ccc; @@ -108,7 +109,10 @@ input.reset:hover{ background:#CAD1D6 url(themes/btn_clear_filters.png) center c border:1px solid #ccc; overflow:hidden; } .ldiv{ /* left div */ - float:left; width:30%; position:inherit; + float:left; + width:30%; + position:inherit; + text-align:left; } .mdiv{ /* middle div */ float:left; width:38%; position:inherit; text-align:center; diff --git a/dist/tablefilter/tablefilter.js b/dist/tablefilter/tablefilter.js index f0fe3d4b..0daec062 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,6 +1,5 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var l=i[s]={exports:{},id:s,loaded:!1};return t[s].call(l.exports,l,l.exports,e),l.loaded=!0,l.exports}var s=window.webpackJsonp;window.webpackJsonp=function(i,a){for(var r,n,o=0,h=[];o1)for(var s=0,i=arguments.length;i>s;s++){var a=arguments[s],r=typeof a;switch(d["default"].lower(r)){case"number":this.startRow=a;break;case"object":this.cfg=a}}var o=this.cfg;this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(u){this.nbCells=this.getCellsNb(0)}this.basePath=o.base_path||"tablefilter/",this.extensionsPath=o.extensions_path||this.basePath+"extensions/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltCol=[];for(var p=0;p1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==o.filters_cell_tag||"td"!==o.filters_cell_tag?"td":o.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=o.inf_div_css_class||"inf",this.lDivCssClass=o.left_div_css_class||"ldiv",this.rDivCssClass=o.right_div_css_class||"rdiv",this.mDivCssClass=o.middle_div_css_class||"mdiv",this.contDivCssClass=o.content_div_css_class||"cont",this.stylesheet=o.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=o.flts_row_css_class||"fltrow",this.enableIcons=o.enable_icons===!1?!1:!0,this.alternateBgs=Boolean(o.alternate_rows),this.hasColWidths=g["default"].isArray(o.col_widths),this.colWidths=this.hasColWidths?o.col_widths:null,this.tBodyH=isNaN(o.tbody_height)?200:o.tbody_height,this.fltCssClass=o.flt_css_class||"flt",this.fltMultiCssClass=o.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=o.flt_small_css_class||"flt_s",this.singleFltCssClass=o.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=o.enter_key===!1?!1:!0,this.onBeforeFilter=g["default"].isFn(o.on_before_filter)?o.on_before_filter:null,this.onAfterFilter=g["default"].isFn(o.on_after_filter)?o.on_after_filter:null,this.caseSensitive=Boolean(o.case_sensitive),this.exactMatch=Boolean(o.exact_match),this.linkedFilters=Boolean(o.linked_filters),this.disableExcludedOptions=Boolean(o.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=Boolean(o.col_operation),this.colOperation=null,this.hasVisibleRows=Boolean(o.rows_always_visible),this.visibleRows=this.hasVisibleRows?o.rows_always_visible:[],this.searchType=o.search_type||"include",this.isExternalFlt=Boolean(o.external_flt_grid),this.externalFltTgtIds=o.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(o.exec_delay)?100:parseInt(o.exec_delay,10),this.onFiltersLoaded=g["default"].isFn(o.on_filters_loaded)?o.on_filters_loaded:null,this.singleSearchFlt=Boolean(o.single_search_filter),this.onRowValidated=g["default"].isFn(o.on_row_validated)?o.on_row_validated:null,this.customCellDataCols=o.custom_cell_data_cols?o.custom_cell_data_cols:[],this.customCellData=g["default"].isFn(o.custom_cell_data)?o.custom_cell_data:null,this.watermark=o.watermark||"",this.isWatermarkArray=g["default"].isArray(this.watermark),this.toolBarTgtId=o.toolbar_target_id||null,this.helpInstructions=o.help_instructions?!0:!1,this.popUpFilters=Boolean(o.popup_filters),this.markActiveColumns=Boolean(o.mark_active_columns),this.activeColumnsCssClass=o.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=g["default"].isFn(o.on_before_active_column)?o.on_before_active_column:null,this.onAfterActiveColumn=g["default"].isFn(o.on_after_active_column)?o.on_after_active_column:null,this.displayAllText=o.display_all_text||"",this.enableEmptyOption=Boolean(o.enable_empty_option),this.emptyText=o.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(o.enable_non_empty_option),this.nonEmptyText=o.non_empty_text||"(Non empty)",this.onSlcChange=o.on_change===!1?!1:!0,this.sortSlc=o.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(o.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?o.sort_num_asc:null,this.isSortNumDesc=Boolean(o.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?o.sort_num_desc:null,this.fillSlcOnDemand=Boolean(o.fill_slc_on_demand),this.hasCustomOptions=g["default"].isObj(o.custom_options),this.customOptions=o.custom_options,this.rgxOperator=o.regexp_operator||"rgx:",this.emOperator=o.empty_operator||"[empty]",this.nmOperator=o.nonempty_operator||"[nonempty]",this.orOperator=o.or_operator||"||",this.anOperator=o.and_operator||"&&",this.grOperator=o.greater_operator||">",this.lwOperator=o.lower_operator||"<",this.leOperator=o.lower_equal_operator||"<=",this.geOperator=o.greater_equal_operator||">=",this.dfOperator=o.different_operator||"!",this.lkOperator=o.like_operator||"*",this.eqOperator=o.equal_operator||"=",this.stOperator=o.start_with_operator||"{",this.enOperator=o.end_with_operator||"}",this.curExp=o.cur_exp||"^[¥£€$]",this.separator=o.separator||",",this.rowsCounter=Boolean(o.rows_counter),this.statusBar=Boolean(o.status_bar),this.loader=Boolean(o.loader),this.displayBtn=Boolean(o.btn),this.btnText=o.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=o.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(o.btn_reset),this.btnResetCssClass=o.btn_reset_css_class||"reset",this.onBeforeReset=g["default"].isFn(o.on_before_reset)?o.on_before_reset:null,this.onAfterReset=g["default"].isFn(o.on_after_reset)?o.on_after_reset:null,this.paging=Boolean(o.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=Boolean(o.sort),this.isSortEnabled=!1,this.sortConfig=o.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=g["default"].isArray(this.sortConfig.sort_types)?this.sortConfig.sort_types:[],this.sortConfig.sortCol=this.sortConfig.sort_col||null,this.sortConfig.asyncSort=Boolean(this.sortConfig.async_sort),this.sortConfig.triggerIds=g["default"].isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.autoFilter=Boolean(o.auto_filter),this.autoFilterDelay=isNaN(o.auto_filter_delay)?900:o.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(o.highlight_keywords),this.defaultDateType=o.default_date_type||"DMY",this.thousandsSeparator=o.thousands_separator||",",this.decimalSeparator=o.decimal_separator||".",this.hasColNbFormat=Boolean(o.col_number_format),this.colNbFormat=g["default"].isArray(this.hasColNbFormat)?o.col_number_format:null,this.hasColDateType=g["default"].isArray(o.col_date_type),this.colDateType=this.hasColDateType?o.col_date_type:null,this.msgFilter=o.msg_filter||"Filtering data...",this.msgPopulate=o.msg_populate||"Populating filter...",this.msgPopulateCheckList=o.msg_populate_checklist||"Populating list...",this.msgChangePage=o.msg_change_page||"Collecting paging data...",this.msgClear=o.msg_clear||"Clearing filters...",this.msgChangeResults=o.msg_change_results||"Changing results per page...",this.msgResetValues=o.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=o.msg_reset_page||"Re-setting page...",this.msgResetPageLength=o.msg_reset_page_length||"Re-setting page length...",this.msgSort=o.msg_sort||"Sorting data...",this.msgLoadExtensions=o.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=o.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(o.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&o.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&o.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=o.extensions,this.hasExtensions=g["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(o.enable_default_theme),this.hasThemes=this.enableDefaultTheme||g["default"].isArray(o.themes),this.themes=o.themes||[],this.themesPath=o.themes_path||this.basePath+"themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null,clearButton:null,help:null,statusBar:null},this.ExtRegistry={sort:null},this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"loadThemes"},detectKey:function(t){if(this.enterKey){var e=t||O.event;if(e){var s=n["default"].keyCode(e);13===s?(this.filter(),n["default"].cancel(e),n["default"].stop(e)):(this.isUserTyping=!0,O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}}},onKeyUp:function(t){function e(){O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var s=t||O.event,i=n["default"].keyCode(s);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=O.setInterval(e.bind(this),this.autoFilterDelay)):(O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,O.clearInterval(this.autoFilterTimer))},onInpFocus:function(t){var e=t||O.event,s=n["default"].target(e);this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcFocus:function(t){var e=t||O.event,s=n["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.dropdown._build(i)}this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcChange:function(t){if(this.activeFlt){var e=t||O.event;this.popUpFilters&&n["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||O.event,s=n["default"].target(e);if(this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.checkList._build(i),this.Cpt.checkList.checkListDiv[i].onclick=null,this.Cpt.checkList.checkListDiv[i].title=""}},onBtnClick:function(){this.filter()}}}}return a(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=h["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popUpFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var t=this.singleSearchFlt?1:this.nbCells,e=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new w.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new x.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new T.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new k.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new I.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid){this.isFirstLoad||this._resetGrid();var s=void 0;if(!this.gridLayout){var i=h["default"].tag(this.tbl,"thead");s=i.length>0?i[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,s.className=this.fltsRowCssClass,!this.isExternalFlt||this.gridLayout&&!this.popUpFilters||(s.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;t>l;l++){this.popUpFilters&&this.Cpt.popupFilter.build(l);var a=h["default"].create(this.fltCellTag),r=this.getFilterType(l),o=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[l]:null;if(this.singleSearchFlt&&(a.colSpan=this.nbCells),this.gridLayout||s.appendChild(a),e=l==t-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(r=this.fltTypeInp,e=this.singleFltCssClass),r===this.fltTypeSlc||r===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new F.Dropdown(this));var u=this.Cpt.dropdown,p=h["default"].create(this.fltTypeSlc,["id",this.prfxFlt+l+"_"+this.id],["ct",l],["filled","0"]);if(r===this.fltTypeMulti&&(p.multiple=this.fltTypeMulti,p.title=u.multipleSlcTooltip),p.className=d["default"].lower(r)===this.fltTypeSlc?e:this.fltMultiCssClass,o?(h["default"].id(o).appendChild(p),this.externalFltEls.push(p)):a.appendChild(p),this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||u._build(l),n["default"].add(p,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(p,"change",this.Evt.onSlcChange.bind(this)),n["default"].add(p,"focus",this.Evt.onSlcFocus.bind(this)),this.fillSlcOnDemand){var c=h["default"].createOpt(this.displayAllText,"");p.appendChild(c)}}else if(r===this.fltTypeCheckList){var f=void 0;this.Cpt.checkList=new R.CheckList(this),f=this.Cpt.checkList;var g=h["default"].create("div",["id",f.prfxCheckListDiv+l+"_"+this.id],["ct",l],["filled","0"]);g.className=f.checkListDivCssClass,o?(h["default"].id(o).appendChild(g),this.externalFltEls.push(g)):a.appendChild(g),f.checkListDiv[l]=g,this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||f._build(l),this.fillSlcOnDemand&&(n["default"].add(g,"click",this.Evt.onCheckListClick.bind(this)),g.appendChild(h["default"].text(f.activateCheckListTxt)))}else{var v=r===this.fltTypeInp?"text":"hidden",C=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+l+"_"+this.id],["type",v],["ct",l]);if("hidden"!==v&&this.watermark&&C.setAttribute("placeholder",this.isWatermarkArray?this.watermark[l]||"":this.watermark),C.className=e,n["default"].add(C,"focus",this.Evt.onInpFocus.bind(this)),o?(h["default"].id(o).appendChild(C),this.externalFltEls.push(C)):a.appendChild(C),this.fltIds.push(this.prfxFlt+l+"_"+this.id),n["default"].add(C,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(C,"keydown",this.Evt.onKeyDown.bind(this)),n["default"].add(C,"keyup",this.Evt.onKeyUp.bind(this)),n["default"].add(C,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var b=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=b[l]&&this.setFilterValue(l,b[l],!1)}}if(l==t-1&&this.displayBtn){var m=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+l+"_"+this.id],["type","button"],["value",this.btnText]);m.className=this.btnCssClass,o?h["default"].id(o).appendChild(m):a.appendChild(m),n["default"].add(m,"click",this.Evt.onBtnClick.bind(this))}}}else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.rowsCounter&&(this.Cpt.rowsCounter=new P.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new S.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new L.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new E.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help=new D.Help(this),this.Cpt.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new B.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new N.ColOps(this),this.Cpt.colOps.calc()),this.sort&&this.importSort(),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?n.dropdown._build(i,!0):n.dropdown._build(i,!1,l,a);break;case e.checklist:n.checkList._build(i,l,a);break;case e.changepage:n.paging._changePage(r);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:n.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:n.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:n.paging._resetPageLength(this.pgLenCookie);break;case e.sort:break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&n.statusBar.message(""),this.loader&&n.loader.show("none")}var s=void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,l=s.slcExternal,a=s.slcId,r=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),O.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,l=t.path,a=void 0;i&&l?a=t.path+i:(i=i.replace(".js",""),a="./extensions/{}/{}".replace(/{}/g,i)),s.e(1,function(s){var l=[s(1)(a)];(function(s){var l=new s(e,t);l.init(),e.ExtRegistry[i]=l}).apply(null,l)})}}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e],l=this.ExtRegistry[i.name];l&&(l.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(g["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var l=t[s],a=l.name,r=l.path;a&&!r?r=this.themesPath+a+"/"+a+".css":!a&&l.path&&(a="theme{0}".replace("{0}",s)),this.isImported(r,"link")||this["import"](a,r,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},{key:"destroy",value:function(){if(this._hasGrid){var t=this.tbl.rows,e=this.Cpt;this.paging&&e.paging.destroy(),this.statusBar&&e.statusBar.destroy(),this.rowsCounter&&e.rowsCounter.destroy(),this.btnReset&&e.clearButton.destroy(),this.helpInstructions&&e.help.destroy(),this.isExternalFlt&&!this.popUpFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.loader&&e.loader.destroy(),this.popUpFilters&&e.popupFilter.destroy(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;sr;r++)"validrow"===d["default"].lower(a.nodeName)&&l.removeAttribute("validRow")}this.alternateBgs&&e.alternateRows.removeRowBg(s)}this.fltGrid&&!this.gridLayout&&(this.fltGridEl=t[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),this.gridLayout&&e.gridLayout.destroy(),h["default"].removeClass(this.tbl,this.prfxTf),this.activeFlt=null,this.isStartBgAlternate=!0,this._hasGrid=!1,this.tbl=null}}},{key:"setToolbar",value:function(){if(!this.infDiv){var t=h["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)h["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.Cpt.gridLayout;e.tblMainCont.appendChild(t),t.className=e.gridInfDivCssClass}else this.tbl.parentNode.insertBefore(t,this.tbl);this.infDiv=h["default"].id(this.prfxInfDiv+this.id);var s=h["default"].create("div",["id",this.prfxLDiv+this.id]);s.className=this.lDivCssClass,t.appendChild(s),this.lDiv=h["default"].id(this.prfxLDiv+this.id);var i=h["default"].create("div",["id",this.prfxRDiv+this.id]);i.className=this.rDivCssClass,t.appendChild(i),this.rDiv=h["default"].id(this.prfxRDiv+this.id);var l=h["default"].create("div",["id",this.prfxMDiv+this.id]);l.className=this.mDivCssClass,t.appendChild(l),this.mDiv=h["default"].id(this.prfxMDiv+this.id),this.helpInstructions||(this.Cpt.help||(this.Cpt.help=new D.Help(this)),this.Cpt.help.init(),this.helpInstructions=!0)}}},{key:"removeToolbar",value:function(){this.infDiv&&(this.infDiv.parentNode.removeChild(this.infDiv),this.infDiv=null)}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt&&this.externalFltTgtIds)for(var t=this.externalFltTgtIds,e=t.length,s=0;e>s;s++){var i=t[s],l=h["default"].id(i);l&&(l.innerHTML="")}}},{key:"importSort",value:function(){this.loadExtension({name:this.sortConfig.name,path:this.sortConfig.path})}},{key:"performSort",value:function(){this.EvtManager(this.Evt.name.sort)}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(t&&this.isCustomOptions(t)){for(var e=this.customOptions,s=e.cols,i=[],l=[],a=C["default"].indexByValue(s,t),r=e.values[a],n=e.texts[a],o=e.sorts[a],h=0,u=r.length;u>h;h++)l.push(r[h]),i.push(n[h]?n[h]:r[h]);return o&&(l.sort(),i.sort()),[l,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.fillSlcOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Cpt.paging&&this.Cpt.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Cpt.paging&&this.Cpt.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.fillSlcOnDemand){var e=this.Cpt.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var l=0;lo;o++)""!==a[o]&&(r=h["default"].createOpt(a[o],a[o],!0),n.appendChild(r),this.hasStoredValues=!0)}}else if(this["col"+l]==this.fltTypeCheckList){var d=this.Cpt.checkList,p=d.checkListDiv[l];p.title=p.innerHTML,p.innerHTML="";var c=h["default"].create("ul",["id",this.fltIds[l]],["colIndex",l]);c.className=d.checkListCssClass;var f=h["default"].createCheckItem(this.fltIds[l]+"_0","",this.displayAllText);f.className=d.checkListItemCssClass,c.appendChild(f),p.appendChild(c),a=e[l].split(" "+this.orOperator+" ");for(var o=0,u=a.length;u>o;o++)if(""!==a[o]){var g=h["default"].createCheckItem(this.fltIds[l]+"_"+(o+1),a[o],a[o]);g.className=d.checkListItemCssClass,c.appendChild(g),g.check.checked=!0,d.setCheckListValues(g.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Cpt.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{key:"_filter",value:function(){function t(t,e,s){if(this.highlightKeywords&&e){t=t.replace(f,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,"");var l=t;(n.test(t)||o.test(t)||u.test(t)||p.test(t)||c.test(t))&&(l=h["default"].getText(s)),""!==l&&i.highlightKeyword.highlight(s,l,i.highlightKeyword.highlightCssClass)}}function e(t,e,s){var i=void 0,l=y["default"].removeNbFormat,h=u.test(t),C=n.test(t),x=p.test(t),T=o.test(t),k=c.test(t),I=g.test(t),F=f.test(t),R=v.test(t),P=b.test(t),S=m===t,E=_===t,D=w.test(t),B=h&&M(t.replace(u,""),L),N=C&&M(t.replace(n,""),L),O=x&&M(t.replace(p,""),L),H=T&&M(t.replace(o,""),L),V=k&&M(t.replace(c,""),L),U=I&&M(t.replace(g,""),L),j=void 0,G=void 0;if(M(e,L))j=A(e,L),B?(G=A(t.replace(u,""),L),i=G>j):N?(G=A(t.replace(n,""),L),i=G>=j):H?(G=A(t.replace(o,""),L),i=j>=G):O?(G=A(t.replace(p,""),L),i=j>G):V?(G=A(t.replace(c,""),L),i=j.toString()!=G.toString()):U?(G=A(t.replace(g,""),L),i=j.toString()==G.toString()):f.test(t)?i=this._containsStr(t.replace(f,""),e,null,!1):M(t,L)?(G=A(t,L),i=j.toString()==G.toString()):S?i=d["default"].isEmpty(e):E&&(i=!d["default"].isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(a=l(e,this.colNbFormat[s]),r=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(a=l(e,"us"),r="us"):(a=l(e,"eu"),r="eu"),C)i=a<=l(t.replace(n,""),r);else if(T)i=a>=l(t.replace(o,""),r);else if(h)i=al(t.replace(p,""),r);else if(k)i=this._containsStr(t.replace(c,""),e)?!1:!0;else if(F)i=this._containsStr(t.replace(f,""),e,null,!1);else if(I)i=this._containsStr(t.replace(g,""),e,null,!0);else if(R)i=0===e.indexOf(t.replace(v,""))?!0:!1;else if(P){var W=t.replace(b,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(S)i=d["default"].isEmpty(e);else if(E)i=!d["default"].isEmpty(e);else if(D)try{var q=t.replace(w,""),$=new RegExp(q);i=$.test(e)}catch(K){i=!1}else i=this._containsStr(t,e,this.getFilterType(s));return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this);var s=this.tbl.rows,i=this.Cpt,l=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var a,r,n=new RegExp(this.leOperator),o=new RegExp(this.geOperator),u=new RegExp(this.lwOperator),p=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),f=new RegExp(d["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),b=new RegExp(this.enOperator),m=this.emOperator,_=this.nmOperator,w=new RegExp(d["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xP;P++){var S=this.searchArgs[this.singleSearchFlt?0:P],L=this.hasColDateType?this.colDateType[P]:this.defaultDateType;if(""!==S){var E=d["default"].matchCase(this.getCellData(P,T[P]),this.caseSensitive),D=S.split(this.orOperator),B=D.length>1?!0:!1,N=S.split(this.anOperator),O=N.length>1?!0:!1;if(B||O){for(var H=void 0,V=!1,U=B?D:N,j=0,G=U.length;G>j&&(H=d["default"].trim(U[j]),V=e.call(this,H,E,P),t.call(this,H,V,T[P]),!B||!V)&&(!O||V);j++);I[P]=V}else I[P]=e.call(this,d["default"].trim(S),E,P),t.call(this,S,I[P],T[P]);I[P]||(F="include"===this.searchType?!1:!0),this.singleSearchFlt&&I[P]&&(R=!0),this.popUpFilters&&i.popupFilter.buildIcon(P,!0),this.markActiveColumns&&x===this.refRow&&(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,P),h["default"].addClass(this.getHeaderElement(P),this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,P))}}this.singleSearchFlt&&R&&(F=!0),F?(this.validateRow(x,!0),this.validRowsIndex.push(x),this.alternateBgs&&i.alternateRows.setRowBg(x,this.validRowsIndex.length),this.onRowValidated&&this.onRowValidated.call(null,this,x)):(this.validateRow(x,!1),this.hasVisibleRows&&C["default"].has(this.visibleRows,x)&&!this.paging?this.validRowsIndex.push(x):l++)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=l,this.isStartBgAlternate=!1,this.rememberGridValues&&i.store.saveFilterValues(this.fltsValuesCookie),this.paging?(this.startPagingRow=0,this.currentPageNb=1,i.paging.setPagingInfo(this.validRowsIndex)):this.applyGridProps(),this.onAfterFilter&&this.onAfterFilter.call(null,this)}}},{key:"applyGridProps",value:function(){this.activeFlt&&d["default"].lower(this.activeFlt.nodeName)===this.fltTypeSlc&&!this.popUpFilters&&(this.activeFlt.blur(),this.activeFlt.parentNode&&this.activeFlt.parentNode.focus());var t=this.Cpt;this.visibleRows&&this.enforceVisibility(),this.hasColOperation&&t.colOps.calc(),this.linkedFilters&&this.linkFilters();var e=!this.paging&&this.hasVisibleRows?this.nbVisibleRows-this.visibleRows.length:this.nbVisibleRows; +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var l=i[s]={exports:{},id:s,loaded:!1};return t[s].call(l.exports,l,l.exports,e),l.loaded=!0,l.exports}var s=window.webpackJsonp;window.webpackJsonp=function(i,a){for(var r,n,o=0,h=[];o1)for(var s=0,i=arguments.length;i>s;s++){var a=arguments[s],r=typeof a;switch(d["default"].lower(r)){case"number":this.startRow=a;break;case"object":this.cfg=a}}var o=this.cfg;this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(u){this.nbCells=this.getCellsNb(0)}this.basePath=o.base_path||"tablefilter/",this.extensionsPath=o.extensions_path||this.basePath+"extensions/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=o.grid===!1?!1:!0,this.gridLayout=Boolean(o.grid_layout),this.sourceTblHtml=null,this.gridLayout&&(this.sourceTblHtml=this.tbl.outerHTML),this.filtersRowIndex=o.filters_row_index||0,this.headersRow=o.headers_row_index||(0===this.filtersRowIndex?1:0),this.gridLayout&&(this.headersRow>1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==o.filters_cell_tag||"td"!==o.filters_cell_tag?"td":o.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=o.inf_div_css_class||"inf",this.lDivCssClass=o.left_div_css_class||"ldiv",this.rDivCssClass=o.right_div_css_class||"rdiv",this.mDivCssClass=o.middle_div_css_class||"mdiv",this.contDivCssClass=o.content_div_css_class||"cont",this.stylesheet=o.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=o.flts_row_css_class||"fltrow",this.enableIcons=o.enable_icons===!1?!1:!0,this.alternateBgs=Boolean(o.alternate_rows),this.hasColWidths=g["default"].isArray(o.col_widths),this.colWidths=this.hasColWidths?o.col_widths:null,this.tBodyH=isNaN(o.tbody_height)?200:o.tbody_height,this.fltCssClass=o.flt_css_class||"flt",this.fltMultiCssClass=o.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=o.flt_small_css_class||"flt_s",this.singleFltCssClass=o.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=o.enter_key===!1?!1:!0,this.onBeforeFilter=g["default"].isFn(o.on_before_filter)?o.on_before_filter:null,this.onAfterFilter=g["default"].isFn(o.on_after_filter)?o.on_after_filter:null,this.caseSensitive=Boolean(o.case_sensitive),this.exactMatch=Boolean(o.exact_match),this.linkedFilters=Boolean(o.linked_filters),this.disableExcludedOptions=Boolean(o.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=Boolean(o.col_operation),this.colOperation=null,this.hasVisibleRows=Boolean(o.rows_always_visible),this.visibleRows=this.hasVisibleRows?o.rows_always_visible:[],this.searchType=o.search_type||"include",this.isExternalFlt=Boolean(o.external_flt_grid),this.externalFltTgtIds=o.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(o.exec_delay)?100:parseInt(o.exec_delay,10),this.onFiltersLoaded=g["default"].isFn(o.on_filters_loaded)?o.on_filters_loaded:null,this.singleSearchFlt=Boolean(o.single_search_filter),this.onRowValidated=g["default"].isFn(o.on_row_validated)?o.on_row_validated:null,this.customCellDataCols=o.custom_cell_data_cols?o.custom_cell_data_cols:[],this.customCellData=g["default"].isFn(o.custom_cell_data)?o.custom_cell_data:null,this.watermark=o.watermark||"",this.isWatermarkArray=g["default"].isArray(this.watermark),this.toolBarTgtId=o.toolbar_target_id||null,this.helpInstructions=g["default"].isUndef(o.help_instructions)?void 0:Boolean(o.help_instructions),this.popUpFilters=Boolean(o.popup_filters),this.markActiveColumns=Boolean(o.mark_active_columns),this.activeColumnsCssClass=o.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=g["default"].isFn(o.on_before_active_column)?o.on_before_active_column:null,this.onAfterActiveColumn=g["default"].isFn(o.on_after_active_column)?o.on_after_active_column:null,this.displayAllText=o.display_all_text||"",this.enableEmptyOption=Boolean(o.enable_empty_option),this.emptyText=o.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(o.enable_non_empty_option),this.nonEmptyText=o.non_empty_text||"(Non empty)",this.onSlcChange=o.on_change===!1?!1:!0,this.sortSlc=o.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(o.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?o.sort_num_asc:null,this.isSortNumDesc=Boolean(o.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?o.sort_num_desc:null,this.fillSlcOnDemand=Boolean(o.fill_slc_on_demand),this.hasCustomOptions=g["default"].isObj(o.custom_options),this.customOptions=o.custom_options,this.rgxOperator=o.regexp_operator||"rgx:",this.emOperator=o.empty_operator||"[empty]",this.nmOperator=o.nonempty_operator||"[nonempty]",this.orOperator=o.or_operator||"||",this.anOperator=o.and_operator||"&&",this.grOperator=o.greater_operator||">",this.lwOperator=o.lower_operator||"<",this.leOperator=o.lower_equal_operator||"<=",this.geOperator=o.greater_equal_operator||">=",this.dfOperator=o.different_operator||"!",this.lkOperator=o.like_operator||"*",this.eqOperator=o.equal_operator||"=",this.stOperator=o.start_with_operator||"{",this.enOperator=o.end_with_operator||"}",this.curExp=o.cur_exp||"^[¥£€$]",this.separator=o.separator||",",this.rowsCounter=Boolean(o.rows_counter),this.statusBar=Boolean(o.status_bar),this.loader=Boolean(o.loader),this.displayBtn=Boolean(o.btn),this.btnText=o.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=o.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(o.btn_reset),this.btnResetCssClass=o.btn_reset_css_class||"reset",this.onBeforeReset=g["default"].isFn(o.on_before_reset)?o.on_before_reset:null,this.onAfterReset=g["default"].isFn(o.on_after_reset)?o.on_after_reset:null,this.paging=Boolean(o.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=Boolean(o.sort),this.isSortEnabled=!1,this.sortConfig=o.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=g["default"].isArray(this.sortConfig.sort_types)?this.sortConfig.sort_types:[],this.sortConfig.sortCol=this.sortConfig.sort_col||null,this.sortConfig.asyncSort=Boolean(this.sortConfig.async_sort),this.sortConfig.triggerIds=g["default"].isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.autoFilter=Boolean(o.auto_filter),this.autoFilterDelay=isNaN(o.auto_filter_delay)?900:o.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(o.highlight_keywords),this.defaultDateType=o.default_date_type||"DMY",this.thousandsSeparator=o.thousands_separator||",",this.decimalSeparator=o.decimal_separator||".",this.hasColNbFormat=Boolean(o.col_number_format),this.colNbFormat=g["default"].isArray(this.hasColNbFormat)?o.col_number_format:null,this.hasColDateType=g["default"].isArray(o.col_date_type),this.colDateType=this.hasColDateType?o.col_date_type:null,this.msgFilter=o.msg_filter||"Filtering data...",this.msgPopulate=o.msg_populate||"Populating filter...",this.msgPopulateCheckList=o.msg_populate_checklist||"Populating list...",this.msgChangePage=o.msg_change_page||"Collecting paging data...",this.msgClear=o.msg_clear||"Clearing filters...",this.msgChangeResults=o.msg_change_results||"Changing results per page...",this.msgResetValues=o.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=o.msg_reset_page||"Re-setting page...",this.msgResetPageLength=o.msg_reset_page_length||"Re-setting page length...",this.msgSort=o.msg_sort||"Sorting data...",this.msgLoadExtensions=o.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=o.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(o.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&o.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&o.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=o.extensions,this.hasExtensions=g["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(o.enable_default_theme),this.hasThemes=this.enableDefaultTheme||g["default"].isArray(o.themes),this.themes=o.themes||[],this.themesPath=o.themes_path||this.basePath+"themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null,clearButton:null,help:null,statusBar:null},this.ExtRegistry={},this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"loadThemes"},detectKey:function(t){if(this.enterKey){var e=t||O.event;if(e){var s=n["default"].keyCode(e);13===s?(this.filter(),n["default"].cancel(e),n["default"].stop(e)):(this.isUserTyping=!0,O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}}},onKeyUp:function(t){function e(){O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var s=t||O.event,i=n["default"].keyCode(s);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=O.setInterval(e.bind(this),this.autoFilterDelay)):(O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,O.clearInterval(this.autoFilterTimer))},onInpFocus:function(t){var e=t||O.event,s=n["default"].target(e);this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcFocus:function(t){var e=t||O.event,s=n["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.dropdown._build(i)}this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcChange:function(t){if(this.activeFlt){var e=t||O.event;this.popUpFilters&&n["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||O.event,s=n["default"].target(e);if(this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.checkList._build(i),this.Cpt.checkList.checkListDiv[i].onclick=null,this.Cpt.checkList.checkListDiv[i].title=""}},onBtnClick:function(){this.filter()}}}}return a(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=h["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popUpFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var t=this.singleSearchFlt?1:this.nbCells,e=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new w.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new x.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new T.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new k.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new I.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var s=void 0;if(!this.gridLayout){var i=h["default"].tag(this.tbl,"thead");s=i.length>0?i[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,s.className=this.fltsRowCssClass,!this.isExternalFlt||this.gridLayout&&!this.popUpFilters||(s.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;t>l;l++){this.popUpFilters&&this.Cpt.popupFilter.build(l);var a=h["default"].create(this.fltCellTag),r=this.getFilterType(l),o=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[l]:null;if(this.singleSearchFlt&&(a.colSpan=this.nbCells),this.gridLayout||s.appendChild(a),e=l==t-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(r=this.fltTypeInp,e=this.singleFltCssClass),r===this.fltTypeSlc||r===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new F.Dropdown(this));var u=this.Cpt.dropdown,p=h["default"].create(this.fltTypeSlc,["id",this.prfxFlt+l+"_"+this.id],["ct",l],["filled","0"]);if(r===this.fltTypeMulti&&(p.multiple=this.fltTypeMulti,p.title=u.multipleSlcTooltip),p.className=d["default"].lower(r)===this.fltTypeSlc?e:this.fltMultiCssClass,o?(h["default"].id(o).appendChild(p),this.externalFltEls.push(p)):a.appendChild(p),this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||u._build(l),n["default"].add(p,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(p,"change",this.Evt.onSlcChange.bind(this)),n["default"].add(p,"focus",this.Evt.onSlcFocus.bind(this)),this.fillSlcOnDemand){var f=h["default"].createOpt(this.displayAllText,"");p.appendChild(f)}}else if(r===this.fltTypeCheckList){var c=void 0;this.Cpt.checkList=new R.CheckList(this),c=this.Cpt.checkList;var g=h["default"].create("div",["id",c.prfxCheckListDiv+l+"_"+this.id],["ct",l],["filled","0"]);g.className=c.checkListDivCssClass,o?(h["default"].id(o).appendChild(g),this.externalFltEls.push(g)):a.appendChild(g),c.checkListDiv[l]=g,this.fltIds.push(this.prfxFlt+l+"_"+this.id),this.fillSlcOnDemand||c._build(l),this.fillSlcOnDemand&&(n["default"].add(g,"click",this.Evt.onCheckListClick.bind(this)),g.appendChild(h["default"].text(c.activateCheckListTxt)))}else{var v=r===this.fltTypeInp?"text":"hidden",C=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+l+"_"+this.id],["type",v],["ct",l]);if("hidden"!==v&&this.watermark&&C.setAttribute("placeholder",this.isWatermarkArray?this.watermark[l]||"":this.watermark),C.className=e,n["default"].add(C,"focus",this.Evt.onInpFocus.bind(this)),o?(h["default"].id(o).appendChild(C),this.externalFltEls.push(C)):a.appendChild(C),this.fltIds.push(this.prfxFlt+l+"_"+this.id),n["default"].add(C,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(C,"keydown",this.Evt.onKeyDown.bind(this)),n["default"].add(C,"keyup",this.Evt.onKeyUp.bind(this)),n["default"].add(C,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var b=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=b[l]&&this.setFilterValue(l,b[l],!1)}}if(l==t-1&&this.displayBtn){var m=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+l+"_"+this.id],["type","button"],["value",this.btnText]);m.className=this.btnCssClass,o?h["default"].id(o).appendChild(m):a.appendChild(m),n["default"].add(m,"click",this.Evt.onBtnClick.bind(this))}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.rowsCounter&&(this.Cpt.rowsCounter=new P.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new S.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new L.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new E.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help||(this.Cpt.help=new D.Help(this)),this.Cpt.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new B.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new N.ColOps(this),this.Cpt.colOps.calc()),this.sort&&this.importSort(),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?n.dropdown._build(i,!0):n.dropdown._build(i,!1,l,a);break;case e.checklist:n.checkList._build(i,l,a);break;case e.changepage:n.paging._changePage(r);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:n.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:n.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:n.paging._resetPageLength(this.pgLenCookie);break;case e.sort:break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&n.statusBar.message(""),this.loader&&n.loader.show("none")}var s=void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,l=s.slcExternal,a=s.slcId,r=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),O.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,l=t.path,a=void 0;i&&l?a=t.path+i:(i=i.replace(".js",""),a="./extensions/{}/{}".replace(/{}/g,i)),s.e(1,function(s){var l=[s(1)(a)];(function(s){var l=new s(e,t);l.init(),e.ExtRegistry[i]=l}).apply(null,l)})}}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e],l=this.ExtRegistry[i.name];l&&(l.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(g["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var l=t[s],a=l.name,r=l.path;a&&!r?r=this.themesPath+a+"/"+a+".css":!a&&l.path&&(a="theme{0}".replace("{0}",s)),this.isImported(r,"link")||this["import"](a,r,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},{key:"destroy",value:function(){if(this._hasGrid){var t=this.tbl.rows,e=this.Cpt;this.isExternalFlt&&!this.popUpFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;ss;s++){var i=t[s],l=h["default"].id(i);l&&(l.innerHTML="")}}},{key:"importSort",value:function(){this.loadExtension({name:this.sortConfig.name,path:this.sortConfig.path})}},{key:"performSort",value:function(){this.EvtManager(this.Evt.name.sort)}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(t&&this.isCustomOptions(t)){for(var e=this.customOptions,s=e.cols,i=[],l=[],a=C["default"].indexByValue(s,t),r=e.values[a],n=e.texts[a],o=e.sorts[a],h=0,u=r.length;u>h;h++)l.push(r[h]),i.push(n[h]?n[h]:r[h]);return o&&(l.sort(),i.sort()),[l,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.fillSlcOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Cpt.paging&&this.Cpt.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Cpt.paging&&this.Cpt.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.fillSlcOnDemand){var e=this.Cpt.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var l=0;lu;u++)""!==a[u]&&(r=h["default"].createOpt(a[u],a[u],!0),o.appendChild(r),this.hasStoredValues=!0)}}else if(n===this.fltTypeCheckList){var p=this.Cpt.checkList,f=p.checkListDiv[l];f.title=f.innerHTML,f.innerHTML="";var c=h["default"].create("ul",["id",this.fltIds[l]],["colIndex",l]);c.className=p.checkListCssClass;var g=h["default"].createCheckItem(this.fltIds[l]+"_0","",this.displayAllText);g.className=p.checkListItemCssClass,c.appendChild(g),f.appendChild(c),a=e[l].split(" "+this.orOperator+" ");for(var u=0,d=a.length;d>u;u++)if(""!==a[u]){var v=h["default"].createCheckItem(this.fltIds[l]+"_"+(u+1),a[u],a[u]);v.className=p.checkListItemCssClass,c.appendChild(v),v.check.checked=!0,p.setCheckListValues(v.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Cpt.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{key:"_filter",value:function(){function t(t,e,s){if(this.highlightKeywords&&e){t=t.replace(c,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,"");var l=t;(n.test(t)||o.test(t)||u.test(t)||p.test(t)||f.test(t))&&(l=h["default"].getText(s)),""!==l&&i.highlightKeyword.highlight(s,l,i.highlightKeyword.highlightCssClass)}}function e(t,e,s){var i=void 0,l=y["default"].removeNbFormat,h=u.test(t),C=n.test(t),x=p.test(t),T=o.test(t),k=f.test(t),I=g.test(t),F=c.test(t),R=v.test(t),P=b.test(t),S=m===t,E=_===t,D=w.test(t),B=h&&M(t.replace(u,""),L),N=C&&M(t.replace(n,""),L),O=x&&M(t.replace(p,""),L),H=T&&M(t.replace(o,""),L),V=k&&M(t.replace(f,""),L),U=I&&M(t.replace(g,""),L),j=void 0,G=void 0;if(M(e,L))j=A(e,L),B?(G=A(t.replace(u,""),L),i=G>j):N?(G=A(t.replace(n,""),L),i=G>=j):H?(G=A(t.replace(o,""),L),i=j>=G):O?(G=A(t.replace(p,""),L),i=j>G):V?(G=A(t.replace(f,""),L),i=j.toString()!=G.toString()):U?(G=A(t.replace(g,""),L),i=j.toString()==G.toString()):c.test(t)?i=this._containsStr(t.replace(c,""),e,null,!1):M(t,L)?(G=A(t,L),i=j.toString()==G.toString()):S?i=d["default"].isEmpty(e):E&&(i=!d["default"].isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(a=l(e,this.colNbFormat[s]),r=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(a=l(e,"us"),r="us"):(a=l(e,"eu"),r="eu"),C)i=a<=l(t.replace(n,""),r);else if(T)i=a>=l(t.replace(o,""),r);else if(h)i=al(t.replace(p,""),r);else if(k)i=this._containsStr(t.replace(f,""),e)?!1:!0;else if(F)i=this._containsStr(t.replace(c,""),e,null,!1);else if(I)i=this._containsStr(t.replace(g,""),e,null,!0);else if(R)i=0===e.indexOf(t.replace(v,""))?!0:!1;else if(P){var W=t.replace(b,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(S)i=d["default"].isEmpty(e);else if(E)i=!d["default"].isEmpty(e);else if(D)try{var q=t.replace(w,""),$=new RegExp(q);i=$.test(e)}catch(K){i=!1}else i=this._containsStr(t,e,this.getFilterType(s));return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this);var s=this.tbl.rows,i=this.Cpt,l=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var a,r,n=new RegExp(this.leOperator),o=new RegExp(this.geOperator),u=new RegExp(this.lwOperator),p=new RegExp(this.grOperator),f=new RegExp(this.dfOperator),c=new RegExp(d["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),b=new RegExp(this.enOperator),m=this.emOperator,_=this.nmOperator,w=new RegExp(d["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xP;P++){var S=this.searchArgs[this.singleSearchFlt?0:P],L=this.hasColDateType?this.colDateType[P]:this.defaultDateType;if(""!==S){var E=d["default"].matchCase(this.getCellData(P,T[P]),this.caseSensitive),D=S.split(this.orOperator),B=D.length>1?!0:!1,N=S.split(this.anOperator),O=N.length>1?!0:!1;if(B||O){for(var H=void 0,V=!1,U=B?D:N,j=0,G=U.length;G>j&&(H=d["default"].trim(U[j]),V=e.call(this,H,E,P),t.call(this,H,V,T[P]),!B||!V)&&(!O||V);j++);I[P]=V}else I[P]=e.call(this,d["default"].trim(S),E,P),t.call(this,S,I[P],T[P]);I[P]||(F="include"===this.searchType?!1:!0),this.singleSearchFlt&&I[P]&&(R=!0),this.popUpFilters&&i.popupFilter.buildIcon(P,!0),this.markActiveColumns&&x===this.refRow&&(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,P),h["default"].addClass(this.getHeaderElement(P),this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,P))}}this.singleSearchFlt&&R&&(F=!0),F?(this.validateRow(x,!0),this.validRowsIndex.push(x),this.alternateBgs&&i.alternateRows.setRowBg(x,this.validRowsIndex.length),this.onRowValidated&&this.onRowValidated.call(null,this,x)):(this.validateRow(x,!1),this.hasVisibleRows&&C["default"].has(this.visibleRows,x)&&!this.paging?this.validRowsIndex.push(x):l++)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=l,this.isStartBgAlternate=!1,this.rememberGridValues&&i.store.saveFilterValues(this.fltsValuesCookie),this.paging?(this.startPagingRow=0,this.currentPageNb=1,i.paging.setPagingInfo(this.validRowsIndex)):this.applyGridProps(),this.onAfterFilter&&this.onAfterFilter.call(null,this)}}},{key:"applyGridProps",value:function(){this.activeFlt&&d["default"].lower(this.activeFlt.nodeName)===this.fltTypeSlc&&!this.popUpFilters&&(this.activeFlt.blur(),this.activeFlt.parentNode&&this.activeFlt.parentNode.focus());var t=this.Cpt;this.visibleRows&&this.enforceVisibility(),this.hasColOperation&&t.colOps.calc(),this.linkedFilters&&this.linkFilters();var e=!this.paging&&this.hasVisibleRows?this.nbVisibleRows-this.visibleRows.length:this.nbVisibleRows;this.rowsCounter&&t.rowsCounter.refresh(e),this.popUpFilters&&t.popupFilter.closeAll()}},{key:"getColValues",value:function(t,e,s){if(this.fltGrid){for(var i=this.tbl.rows,l=[],a=this.refRow;ah;h++)if(h==t&&""==i[a].style.display){ +var u=d["default"].lower(this.getCellData(h,n[h])),p=this.colNbFormat?this.colNbFormat[t]:null,f=e?y["default"].removeNbFormat(u,p):u;l.push(f)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.getFilterType(t);if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var l=0,a=s.options.length;a>l;l++)s.options[l].selected&&(e=e.concat(s.options[l].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else i===this.fltTypeCheckList&&(null!==s.getAttribute("value")?(e=s.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,s=this.fltIds.length;s>e;e++)t.push(d["default"].trim(d["default"].matchCase(this.getFilterValue(e),this.caseSensitive)));return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var s=[],i=0,l=this.fltIds.length;l>i;i++){var a=this.getFilterType(i);if(a===d["default"].lower(t)){var r=e?i:this.fltIds[i];s.push(r)}}return s}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return h["default"].id(e)}},{key:"getCellsNb",value:function(){var t=void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=g["default"].isUndef(this.refRow)?0:this.refRow,s=this.tbl.rows.length;return t&&(e=0),parseInt(s-e,10)}},{key:"getCellData",value:function(t,e){return void 0!==t&&e?this.customCellData&&C["default"].has(this.customCellDataCols,t)?this.customCellData.call(null,this,e,t):h["default"].getText(e):""}},{key:"getTableData",value:function(){for(var t=this.tbl.rows,e=this.refRow;el;l++){var r=this.getCellData(l,i[l]);s[1].push(r)}this.tblData.push(s)}return this.tblData}},{key:"getFilteredData",value:function(t){if(!this.validRowsIndex)return[];var e=this.tbl.rows,s=[];if(t){for(var i=this.gridLayout?this.Cpt.gridLayout.headTbl:this.tbl,l=i.rows[this.headersRow],a=[l.rowIndex,[]],r=0;ri;i++){var a=e[i],r=a[1],n=r[t];s.push(n)}return s}},{key:"getRowDisplay",value:function(t){return this.fltGrid&&g["default"].isObj(t)?t.style.display:void 0}},{key:"validateRow",value:function(t,e){var s=this.tbl.rows[t];if(s&&"boolean"===d["default"].lower(typeof e)){this.hasVisibleRows&&C["default"].has(this.visibleRows,t)&&!this.paging&&(e=!0);var i=e?"":"none",l=e?"true":"false";s.style.display=i,this.paging&&s.setAttribute("validRow",l)}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;ta;a++){var n=s.options[a];(""===l||""===l[0])&&(n.selected=!1),""===n.value&&(n.selected=!1),""!==n.value&&C["default"].has(l,n.value,!0)&&(n.selected=!0)}else if(i===this.fltTypeCheckList){e=d["default"].matchCase(e,this.caseSensitive);var o=e.split(" "+this.orOperator+" "),u=h["default"].tag(s,"li").length;s.setAttribute("value",""),s.setAttribute("indexes","");for(var p=0;u>p;p++){var f=h["default"].tag(s,"li")[p],c=h["default"].tag(f,"label")[0],g=h["default"].tag(f,"input")[0],v=d["default"].matchCase(h["default"].getText(c),this.caseSensitive);""!==v&&C["default"].has(o,v,!0)?(g.checked=!0,this.Cpt.checkList.setCheckListValues(g)):(g.checked=!1,this.Cpt.checkList.setCheckListValues(g))}}}}},{key:"setColWidths",value:function(t){function e(t){var e=this.nbCells,s=this.colWidths;if(e!=s.length||e!=t.cells.length)throw new Error("Columns number mismatch!");for(var i=0;e>i;i++)t.cells[i].style.width=s[i]}if(this.fltGrid&&this.hasColWidths){var s=void 0;s=void 0===t?"none"!=this.tbl.rows[0].style.display?0:1:t,e.call(this,this.tbl.rows[s])}}},{key:"enforceVisibility",value:function(){if(this._hasGrid&&this.hasVisibleRows&&!this.paging)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.linkedFilters&&(this.activeFilterId="",this.linkFilters()),this.rememberPageLen&&f["default"].remove(this.pgLenCookie),this.rememberPageNb&&f["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.fltIds.length;e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"linkFilters",value:function(){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);if(i=i.concat(s),this.activeFilterId){var l=this.activeFilterId.split("_")[0];l=l.split(this.prfxFlt)[1];for(var a=void 0,r=0,n=i.length;n>r;r++){var o=h["default"].id(this.fltIds[i[r]]);if(a=this.getFilterValue(i[r]),l!==i[r]||this.paging&&C["default"].has(t,i[r])&&l===i[r]||!this.paging&&(C["default"].has(s,i[r])||C["default"].has(e,i[r]))||a===this.displayAllText){if(C["default"].has(s,i[r])?this.Cpt.checkList.checkListDiv[i[r]].innerHTML="":o.innerHTML="",this.fillSlcOnDemand){var u=h["default"].createOpt(this.displayAllText,"");o&&o.appendChild(u)}C["default"].has(s,i[r])?this.Cpt.checkList._build(i[r]):this.Cpt.dropdown._build(i[r],!0),this.setFilterValue(i[r],a)}}}}},{key:"_resetGrid",value:function(){if(!this.isFirstLoad){var t=this.Cpt,e=this.tbl,s=e.rows,i=this.filtersRowIndex,l=s[i];if(this.gridLayout||l.parentNode.insertBefore(this.fltGridEl,l),this.isExternalFlt)for(var a=this.externalFltTgtIds,r=0,n=a.length;n>r;r++){var o=h["default"].id(a[r]);if(o){var u=this.externalFltEls[r];o.appendChild(u);var d=this.getFilterType(r);this.gridLayout&&""===u.innerHTML&&d!==this.fltTypeInp&&((d===this.fltTypeSlc||d===this.fltTypeMulti)&&t.dropdown.build(r),d===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.isSortEnabled&&(this.sort=!0),this.popUpFilters&&(this.headersRow++,t.popupFilter.buildAll()),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{key:"_containsStr",value:function(t,e,s,i){var l=void 0,a=this.caseSensitive?"g":"gi",r=i?i:this.exactMatch;return l=r||s!==this.fltTypeInp&&s?new RegExp("(^\\s*)"+d["default"].rgxEsc(t)+"(\\s*$)",a):new RegExp(d["default"].rgxEsc(t),a),l.test(e)}},{key:"isImported",value:function(t,e){for(var s=!1,i=e?e:"script",l="script"==i?"src":"href",a=h["default"].tag(H,i),r=0,n=a.length;n>r;r++)if(void 0!==a[r][l]&&a[r][l].match(t)){s=!0;break}return s}},{key:"import",value:function(t,e,s,i){var l=i?i:"script",a=this.isImported(e,l);if(!a){var r=this,n=!1,o=void 0,u=h["default"].tag(H,"head")[0];o="link"===d["default"].lower(l)?h["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):h["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){n||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(n=!0,"function"==typeof s&&s.call(null,r))},o.onerror=function(){throw new Error("TF script could not load: "+e)},u.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){if(this._hasGrid){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},create:function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;ii;i++)e(s[i]);return t},matchCase:function(t,e){return e?t:this.lower(t)}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={write:function(t,e,s){var i="";s&&(i=new Date((new Date).getTime()+36e5*s),i="; expires="+i.toGMTString()),document.cookie=t+"="+escape(e)+i},read:function(t){var e="",s=t+"=";if(document.cookie.length>0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var a=i.indexOf(";",l);-1===a&&(a=i.length),e=unescape(i.substring(l,a))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"==typeof window[t]&&(e=!0):t&&"object"==typeof t&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,l=0;l2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function l(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,l=void 0;if("Y"==e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,l=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"==e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,l=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,l=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&l.test(t)===!1)return!1;var a=t.split(RegExp.$1),r=void 0,n=void 0,o=void 0;r="M"===e.substring(0,1)?a[0]:"M"===e.substring(1,2)?a[1]:a[2],n="D"===e.substring(0,1)?a[0]:"D"===e.substring(1,2)?a[1]:a[2],o="Y"===e.substring(0,1)?a[0]:"Y"===e.substring(1,2)?a[1]:a[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var h=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(n,10),0,0,0,0);return parseInt(n,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":parts=t.replace(/[- \/.]/g," ").split(" "),s=new Date(i(parts[2]),l(parts[1])-1,parts[0]);break;case"DMY":parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0]);break;case"MDY":parts=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[0]-1,parts[1]);break;case"YMD":parts=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),s=new Date(i(parts[0]),parts[1]-1,parts[2]);break;default:parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0])}return s}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===a["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&i.removeChild(I[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(),this.headTblCont.style.width=this.tblCont.clientWidth+"px",i.style.width="",this.headTbl.style.width=i.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var s=p["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.tblHasColTag=n["default"].tag(i,"col").length>0?!0:!1;var F=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=n["default"].create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidths[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var R=n["default"].tag(i,"col"),P=0;P',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=n["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=n["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=n["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=n["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.tf=t}return a(e,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,l=parseInt(i.getAttribute("ci"),10);if(this.closeAll(l),this.toggle(l),this.popUpFltAdjustToContainer){var a=this.popUpFltElms[l],r=this.tf.getHeaderElement(l),n=.95*r.clientWidth;if(f["default"].isIE()){var o=h["default"].position(r).left;a.style.left=o+"px"}a.style.width=parseInt(n,10)+"px"}d["default"].cancel(s),d["default"].stop(s)}},{key:"init",value:function(){for(var t=this,e=this.tf,s=0;sh;h++)if(h==t&&""==i[a].style.display){var u=d["default"].lower(this.getCellData(h,n[h])),p=this.colNbFormat?this.colNbFormat[t]:null,c=e?y["default"].removeNbFormat(u,p):u;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.fltCol[t];if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var l=0,a=s.options.length;a>l;l++)s.options[l].selected&&(e=e.concat(s.options[l].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else i===this.fltTypeCheckList&&(null!==s.getAttribute("value")?(e=s.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,s=this.fltIds.length;s>e;e++)t.push(d["default"].trim(d["default"].matchCase(this.getFilterValue(e),this.caseSensitive)));return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var s=[],i=0,l=this.fltIds.length;l>i;i++){var a=this["col"+i];if(a===d["default"].lower(t)){var r=e?i:this.fltIds[i];s.push(r)}}return s}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return h["default"].id(e)}},{key:"getCellsNb",value:function(t){var e=t?this.tbl.rows[t]:this.tbl.rows[0];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=this.refRow?this.refRow:0,s=this.tbl.rows.length;return t&&(e=0),parseInt(s-e,10)}},{key:"getCellData",value:function(t,e){return void 0!==t&&e?this.customCellData&&C["default"].has(this.customCellDataCols,t)?this.customCellData.call(null,this,e,t):h["default"].getText(e):""}},{key:"getTableData",value:function(){for(var t=this.tbl.rows,e=this.refRow;el;l++){var r=this.getCellData(l,i[l]);s[1].push(r)}this.tblData.push(s)}return this.tblData}},{key:"getFilteredData",value:function(t){if(!this.validRowsIndex)return[];var e=this.tbl.rows,s=[];if(t){for(var i=this.gridLayout?this.Cpt.gridLayout.headTbl:this.tbl,l=i.rows[this.headersRow],a=[l.rowIndex,[]],r=0;ri;i++){var a=e[i],r=a[1],n=r[t];s.push(n)}return s}},{key:"getRowDisplay",value:function(t){return this.fltGrid&&g["default"].isObj(t)?t.style.display:void 0}},{key:"validateRow",value:function(t,e){var s=this.tbl.rows[t];if(s&&"boolean"===d["default"].lower(typeof e)){this.hasVisibleRows&&C["default"].has(this.visibleRows,t)&&!this.paging&&(e=!0);var i=e?"":"none",l=e?"true":"false";s.style.display=i,this.paging&&s.setAttribute("validRow",l)}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;ta;a++)(""===l||""===l[0])&&(s.options[a].selected=!1),""===s.options[a].value&&(s.options[a].selected=!1),""!==s.options[a].value&&C["default"].has(l,s.options[a].value,!0)&&(s.options[a].selected=!0);else if(i===this.fltTypeCheckList){e=d["default"].matchCase(e,this.caseSensitive);var n=e.split(" "+this.orOperator+" "),o=h["default"].tag(s,"li").length;s.setAttribute("value",""),s.setAttribute("indexes","");for(var u=0;o>u;u++){var p=h["default"].tag(s,"li")[u],c=h["default"].tag(p,"label")[0],f=h["default"].tag(p,"input")[0],g=d["default"].matchCase(h["default"].getText(c),this.caseSensitive);""!==g&&C["default"].has(n,g,!0)?(f.checked=!0,this.Cpt.checkList.setCheckListValues(f)):(f.checked=!1,this.Cpt.checkList.setCheckListValues(f))}}}}},{key:"setColWidths",value:function(t){function e(t){var e=this.nbCells,s=this.colWidths;if(e!=s.length||e!=t.cells.length)throw new Error("Columns number mismatch!");for(var i=0;e>i;i++)t.cells[i].style.width=s[i]}if(this.fltGrid&&this.hasColWidths){var s=void 0;s=void 0===t?"none"!=this.tbl.rows[0].style.display?0:1:t,e.call(this,this.tbl.rows[s])}}},{key:"enforceVisibility",value:function(){if(this._hasGrid&&this.hasVisibleRows&&!this.paging)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.linkedFilters&&(this.activeFilterId="",this.linkFilters()),this.rememberPageLen&&c["default"].remove(this.pgLenCookie),this.rememberPageNb&&c["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.fltIds.length;e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"linkFilters",value:function(){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);if(i=i.concat(s),this.activeFilterId){var l=this.activeFilterId.split("_")[0];l=l.split(this.prfxFlt)[1];for(var a=void 0,r=0,n=i.length;n>r;r++){var o=h["default"].id(this.fltIds[i[r]]);if(a=this.getFilterValue(i[r]),l!==i[r]||this.paging&&C["default"].has(t,i[r])&&l===i[r]||!this.paging&&(C["default"].has(s,i[r])||C["default"].has(e,i[r]))||a===this.displayAllText){if(C["default"].has(s,i[r])?this.Cpt.checkList.checkListDiv[i[r]].innerHTML="":o.innerHTML="",this.fillSlcOnDemand){var u=h["default"].createOpt(this.displayAllText,"");o&&o.appendChild(u)}C["default"].has(s,i[r])?this.Cpt.checkList._build(i[r]):this.Cpt.dropdown._build(i[r],!0),this.setFilterValue(i[r],a)}}}}},{key:"_resetGrid",value:function(){if(!this.isFirstLoad){var t=this.Cpt,e=this.tbl,s=e.rows,i=this.filtersRowIndex,l=s[i];if(this.gridLayout||l.parentNode.insertBefore(this.fltGridEl,l),this.isExternalFlt)for(var a=this.externalFltTgtIds,r=0,n=a.length;n>r;r++){var o=h["default"].id(a[r]);if(o){var u=this.externalFltEls[r];o.appendChild(u);var d=this["col"+r];this.gridLayout&&""===u.innerHTML&&d!==this.fltTypeInp&&((d===this.fltTypeSlc||d===this.fltTypeMulti)&&t.dropdown.build(r),d===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.isSortEnabled&&(this.sort=!0),this.popUpFilters&&(this.headersRow++,t.popupFilter.buildAll()),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{key:"_containsStr",value:function(t,e,s,i){var l=void 0,a=this.caseSensitive?"g":"gi",r=i?i:this.exactMatch;return l=r||s!==this.fltTypeInp&&s?new RegExp("(^\\s*)"+d["default"].rgxEsc(t)+"(\\s*$)",a):new RegExp(d["default"].rgxEsc(t),a),l.test(e)}},{key:"isImported",value:function(t,e){for(var s=!1,i=e?e:"script",l="script"==i?"src":"href",a=h["default"].tag(H,i),r=0,n=a.length;n>r;r++)if(void 0!==a[r][l]&&a[r][l].match(t)){s=!0;break}return s}},{key:"import",value:function(t,e,s,i){var l=i?i:"script",a=this.isImported(e,l);if(!a){var r=this,n=!1,o=void 0,u=h["default"].tag(H,"head")[0];o="link"===d["default"].lower(l)?h["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):h["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){n||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(n=!0,"function"==typeof s&&s.call(null,r))},o.onerror=function(){throw new Error("TF script could not load: "+e)},u.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){if(this._hasGrid){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},create:function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;ii;i++)e(s[i]);return t},matchCase:function(t,e){return e?t:this.lower(t)}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={write:function(t,e,s){var i="";s&&(i=new Date((new Date).getTime()+36e5*s),i="; expires="+i.toGMTString()),document.cookie=t+"="+escape(e)+i},read:function(t){var e="",s=t+"=";if(document.cookie.length>0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var a=i.indexOf(";",l);-1===a&&(a=i.length),e=unescape(i.substring(l,a))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"==typeof window[t]&&(e=!0):t&&"object"==typeof t&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,l=0;l2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function l(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,l=void 0;if("Y"==e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,l=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"==e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,l=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,l=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&l.test(t)===!1)return!1;var a=t.split(RegExp.$1),r=void 0,n=void 0,o=void 0;r="M"===e.substring(0,1)?a[0]:"M"===e.substring(1,2)?a[1]:a[2],n="D"===e.substring(0,1)?a[0]:"D"===e.substring(1,2)?a[1]:a[2],o="Y"===e.substring(0,1)?a[0]:"Y"===e.substring(1,2)?a[1]:a[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var h=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(n,10),0,0,0,0);return parseInt(n,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":parts=t.replace(/[- \/.]/g," ").split(" "),s=new Date(i(parts[2]),l(parts[1])-1,parts[0]);break;case"DMY":parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0]);break;case"MDY":parts=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[0]-1,parts[1]);break;case"YMD":parts=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),s=new Date(i(parts[0]),parts[1]-1,parts[2]);break;default:parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0])}return s}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===a["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&i.removeChild(I[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(),this.headTblCont.style.width=this.tblCont.clientWidth+"px",i.style.width="",this.headTbl.style.width=i.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var s=p["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.tblHasColTag=n["default"].tag(i,"col").length>0?!0:!1;var F=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=n["default"].create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidths[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var R=n["default"].tag(i,"col"),P=0;P',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=n["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=n["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=n["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=n["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.tf=t}return a(e,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,l=parseInt(i.getAttribute("ci"),10);if(this.closeAll(l),this.toggle(l),this.popUpFltAdjustToContainer){var a=this.popUpFltElms[l],r=this.tf.getHeaderElement(l),n=.95*r.clientWidth;if(c["default"].isIE()){var o=h["default"].position(r).left;a.style.left=o+"px"}a.style.width=parseInt(n,10)+"px"}d["default"].cancel(s),d["default"].stop(s)}},{key:"init",value:function(){for(var t=this,e=this.tf,s=0;sy;y++)if(t===y&&(!e||e&&l.disableExcludedOptions)||t==y&&e&&(""===o[b].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&h["default"].has(l.validRowsIndex,b))&&(void 0===p||p==t||p!=t&&h["default"].has(l.validRowsIndex,b)))){var w=l.getCellData(y,m[y]),x=d["default"].matchCase(w,u);if(h["default"].has(this.opts,x,u)||this.opts.push(w),e&&l.disableExcludedOptions){var T=C[y];T||(T=this.GetFilteredDataCol(y)),h["default"].has(T,x,u)||h["default"].has(v,x,u)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.getCustomOptions(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(u?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,r,e,v,f,g)}}},{key:"addOptions",value:function(t,e,s,i,l,a){var r=this.tf,o=d["default"].lower(this.slcFillingMethod),u=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var p=0;p"+f+""}else{var C;C=r.fillSlcOnDemand&&u===this.opts[p]&&r["col"+t]===r.fltTypeSlc?n["default"].createOpt(f,c,!0):r["col"+t]!==r.fltTypeMulti?n["default"].createOpt(f,c," "!==l[t]&&c===l[t]?!0:!1):n["default"].createOpt(f,c,h["default"].has(a,d["default"].matchCase(this.opts[p],r.matchCase),r.matchCase)||-1!==a.toString().indexOf(c)?!0:!1),g&&(C.disabled=!0),e.appendChild(C)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=d["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=n["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=n["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=n["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===u[C].style.display&&!l.paging||l.paging&&(!p||p===t||p!=t&&h["default"].has(l.validRowsIndex,C)))){var y=l.getCellData(_,b[_]),w=d["default"].matchCase(y,l.matchCase);h["default"].has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),h["default"].has(x,w,l.matchCase)||h["default"].has(f,w,l.matchCase)||l.isFirstLoad||f.push(y))}}if(this.isCustom){var T=l.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),f&&f.sort()):(this.opts.sort(c["default"].ignoreCase),f&&f.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),f&&f.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),f&&f.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,o,l.separator),l.fillSlcOnDemand&&(r.innerHTML=""),r.appendChild(o),r.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),a=[],r=i.Cpt.store,o=r?r.getFilterValues(i.fltsValuesCookie)[t]:null;o&&d["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&h["default"].has(i.customSlcOptions.cols,t)?a.push(o):a=o.split(" "+i.orOperator+" "));for(var u=0;u0?1:0),a=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+a+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows-(e.hasVisibleRows?e.visibleRows.length:0);this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{key:"destroy",value:function(){var t=this.tf;t.hasGrid()&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?d["default"].isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):n["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s",this.btnPrevPageText=s.btn_prev_page_text||"<",this.btnLastPageText=s.btn_last_page_text||">|",this.btnFirstPageText=s.btn_first_page_text||"|<",this.btnNextPageHtml=s.btn_next_page_html||(e.enableIcons?'':null),this.btnPrevPageHtml=s.btn_prev_page_html||(e.enableIcons?'':null),this.btnFirstPageHtml=s.btn_first_page_html||(e.enableIcons?'':null),this.btnLastPageHtml=s.btn_last_page_html||(e.enableIcons?'':null),this.pageText=s.page_text||" Page ",this.ofText=s.of_text||" of ",this.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",this.hasPagingBtns=s.paging_btns===!1?!1:!0,this.pageSelectorType=s.page_selector_type||e.fltTypeSlc,this.onBeforeChangePage=h["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=h["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_";var i=this.refRow,a=this.nbRows;this.nbPages=Math.ceil((a-i)/this.pagingLength);var r=this;this.evt={slcIndex:function(){return r.pageSelectorType===e.fltTypeSlc?r.pagingSlc.options.selectedIndex:parseInt(r.pagingSlc.value,10)-1},nbOpts:function(){return r.pageSelectorType===e.fltTypeSlc?parseInt(r.pagingSlc.options.length,10)-1:r.nbPages-1},next:function(){var t=r.evt.slcIndex()0?r.evt.slcIndex()-1:r.evt.nbOpts();r.changePage(t)},last:function(){r.changePage(r.evt.nbOpts())},first:function(){r.changePage(0)},_detectKey:function(t){var s=c["default"].keyCode(t);13===s&&(e.sorted?(e.filter(),r.changePage(r.evt.slcIndex())):r.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return a(t,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){e.changePage(),t.target.blur()},this.pageSelectorType===s.fltTypeSlc&&(t=n["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,c["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=n["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,c["default"].add(t,"keypress",i._detectKey));var l=n["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),a=n["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),r=n["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),o=n["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,c["default"].add(l,"click",i.next);else{var h=n["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);h.className=this.btnPageCssClass,c["default"].add(h,"click",i.next),l.appendChild(h)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,c["default"].add(a,"click",i.prev);else{var u=n["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);u.className=this.btnPageCssClass,c["default"].add(u,"click",i.prev),a.appendChild(u)}if(this.btnLastPageHtml)r.innerHTML=this.btnLastPageHtml,c["default"].add(r,"click",i.last);else{var d=n["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);d.className=this.btnPageCssClass,c["default"].add(d,"click",i.last),r.appendChild(d)}if(this.btnFirstPageHtml)o.innerHTML=this.btnFirstPageHtml,c["default"].add(o,"click",i.first);else{var p=n["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);p.className=this.btnPageCssClass,c["default"].add(p,"click",i.first),o.appendChild(p)}}this.pagingTgtId||s.setToolbar();var f=this.pagingTgtId?n["default"].id(this.pagingTgtId):s.mDiv;f.appendChild(o),f.appendChild(a);var g=n["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(n["default"].text(this.pageText)),g.className=this.nbPgSpanCssClass,f.appendChild(g),f.appendChild(t);var v=n["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(n["default"].text(this.ofText)),v.className=this.nbPgSpanCssClass,f.appendChild(v);var C=n["default"].create("span",["id",this.prfxPgSpan+s.id]);C.className=this.nbPgSpanCssClass,C.appendChild(n["default"].text(" "+this.nbPages+" ")),f.appendChild(C),f.appendChild(l),f.appendChild(r),this.pagingSlc=n["default"].id(this.prfxSlcPages+s.id),(!s.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),s.fltGrid||(s.validateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.isPagingRemoved=!1}},{key:"addPaging",value:function(){var t=void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!e.paging&&(e.paging=!0,this.isPagingRemoved=!0,this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(t){var e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?n["default"].id(this.pagingTgtId):e.mDiv,l=n["default"].id(this.prfxPgSpan+e.id);if(t&&t.length>0)e.validRowsIndex=t;else{e.validRowsIndex=[];for(var a=e.refRow;a0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var h=0;h=this.startPagingRow&&i>l?("true"!==a.getAttribute("validRow")&&a.getAttribute("validRow")||(a.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(a.style.display="none",e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.removeRowBg(e.validRowsIndex[l]))}e.nbVisibleRows=e.validRowsIndex.length,e.isStartBgAlternate=!1,e.applyGridProps()}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&e.paging){var s=this.evt,i=typeof t;if("string"===i)switch(d["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=n["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],r=n["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);r.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var o=this.resultsPerPageTgtId?n["default"].id(this.resultsPerPageTgtId):e.rDiv;r.appendChild(n["default"].text(l)),o.appendChild(r),o.appendChild(i),this.resultsPerPageSlc=n["default"].id(this.prfxSlcResults+e.id);for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.Cpt.store.savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(t.paging){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.Cpt.store.savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.Cpt.store.getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(e.paging){var s=e.Cpt.store.getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()){var e,s,i,l,a,r,o;e=n["default"].id(this.prfxBtnNextSpan+t.id),s=n["default"].id(this.prfxBtnPrevSpan+t.id),i=n["default"].id(this.prfxBtnLastSpan+t.id),l=n["default"].id(this.prfxBtnFirstSpan+t.id),a=n["default"].id(this.prfxPgBeforeSpan+t.id),r=n["default"].id(this.prfxPgAfterSpan+t.id),o=n["default"].id(this.prfxPgSpan+t.id);var h=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?c["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&c["default"].remove(this.pagingSlc,"keypress",h._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(c["default"].remove(e,"click",h.next),e.parentNode.removeChild(e)),s&&(c["default"].remove(s,"click",h.prev),s.parentNode.removeChild(s)),i&&(c["default"].remove(i,"click",h.last),i.parentNode.removeChild(i)),l&&(c["default"].remove(l,"click",h.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),r&&r.parentNode.removeChild(r),o&&o.parentNode.removeChild(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return a(t,[{key:"onClick",value:function(){this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(e.hasGrid()||e.isFirstLoad||!e.btnResetEl){var s=n["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?n["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;h["default"].add(l,"click",function(){t.onClick()})}else{var a=n["default"].create("a",["href","javascript:void(0);"]);a.className=e.btnResetCssClass,a.appendChild(n["default"].text(this.btnResetText)),s.appendChild(a),h["default"].add(a,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=n["default"].id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=s.help_instructions_html||null,this.helpInstrBtnText=s.help_instructions_btn_text||"?",this.helpInstrBtnHtml=s.help_instructions_btn_html||null,this.helpInstrBtnCssClass=s.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=s.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+e.version+'

http://tablefilter.free.fr
©2009-'+e.year+' Max Guglielmi.
',this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.tf=e}return a(t,[{key:"init",value:function(){var t=this;if(!this.helpInstrBtnEl){var e=this.tf,s=n["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=n["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.helpInstrTgtId||e.setToolbar();var l=this.helpInstrTgtId?n["default"].id(this.helpInstrTgtId):e.rDiv;l.appendChild(s);var a=this.helpInstrContTgtId?n["default"].id(this.helpInstrContTgtId):s;if(this.helpInstrBtnHtml){s.innerHTML=this.helpInstrBtnHtml;var r=s.firstChild;h["default"].add(r,"click",function(){t.toggle()}),a.appendChild(i)}else{a.appendChild(i);var o=n["default"].create("a",["href","javascript:void(0);"]);o.className=this.helpInstrBtnCssClass,o.appendChild(n["default"].text(this.helpInstrBtnText)),s.appendChild(o),h["default"].add(o,"click",function(){t.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&a.appendChild(i),i.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.helpInstrText,i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.helpInstrDefaultHtml,h["default"].add(i,"click",function(){t.toggle()}),this.helpInstrContEl=i,this.helpInstrBtnEl=s}}},{key:"toggle",value:function(){if(this.helpInstrContEl){var t=this.helpInstrContEl.style.display;if(""===t||"none"===t){this.helpInstrContEl.style.display="block";var e=n["default"].position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=e-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}}},{key:"destroy",value:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))}}]),t}();e.Help=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;sl;l++){var a=t?l:this.tf.validRowsIndex[l];this.setRowBg(a,i),i++}}},{key:"setRowBg",value:function(t,e){if(this.tf.alternateBgs&&!isNaN(t)){var s=this.tf.tbl.rows,i=e?e:t;this.removeRowBg(t),n["default"].addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;n["default"].removeClass(e[t],this.oddCss),n["default"].removeClass(e[t],this.evenCss)}}},{key:"remove",value:function(){if(this.tf.hasGrid()){for(var t=this.tf.refRow;t=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_Str2["default"].lower(typeof labelId)&&"object"==_Str2["default"].lower(typeof colIndex)&&"object"==_Str2["default"].lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.getColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),_Dom2["default"].id(labThisCol[i]))switch(_Str2["default"].lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom2["default"].id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom2["default"].id(labThisCol[i]).firstChild,txtnode=_Dom2["default"].text(result);_Dom2["default"].id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}]),ColOps}();exports.ColOps=ColOps},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={ignoreCase:function(t,e){var s=a["default"].lower(t),i=a["default"].lower(e);return i>s?-1:s>i?1:0}},t.exports=e["default"]}])}); \ No newline at end of file +s&&(s.style.display="none")}}},{key:"buildIcons",value:function(){for(var t=0;ty;y++)if(t===y&&(!e||e&&l.disableExcludedOptions)||t==y&&e&&(""===o[b].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&h["default"].has(l.validRowsIndex,b))&&(void 0===p||p==t||p!=t&&h["default"].has(l.validRowsIndex,b)))){var w=l.getCellData(y,m[y]),x=d["default"].matchCase(w,u);if(h["default"].has(this.opts,x,u)||this.opts.push(w),e&&l.disableExcludedOptions){var T=C[y];T||(T=this.GetFilteredDataCol(y)),h["default"].has(T,x,u)||h["default"].has(v,x,u)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.getCustomOptions(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(u?(this.opts.sort(),v&&v.sort()):(this.opts.sort(f["default"].ignoreCase),v&&v.sort(f["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,r,e,v,c,g)}}},{key:"addOptions",value:function(t,e,s,i,l,a){var r=this.tf,o=d["default"].lower(this.slcFillingMethod),u=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var p=0;p"+c+""}else{var C;C=r.fillSlcOnDemand&&u===this.opts[p]&&r["col"+t]===r.fltTypeSlc?n["default"].createOpt(c,f,!0):r["col"+t]!==r.fltTypeMulti?n["default"].createOpt(c,f," "!==l[t]&&f===l[t]?!0:!1):n["default"].createOpt(c,f,h["default"].has(a,d["default"].matchCase(this.opts[p],r.matchCase),r.matchCase)||-1!==a.toString().indexOf(f)?!0:!1),g&&(C.disabled=!0),e.appendChild(C)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=d["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=n["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=n["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=n["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=c},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===u[C].style.display&&!l.paging||l.paging&&(!p||p===t||p!=t&&h["default"].has(l.validRowsIndex,C)))){var y=l.getCellData(_,b[_]),w=d["default"].matchCase(y,l.matchCase);h["default"].has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),h["default"].has(x,w,l.matchCase)||h["default"].has(c,w,l.matchCase)||l.isFirstLoad||c.push(y))}}if(this.isCustom){var T=l.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),c&&c.sort()):(this.opts.sort(f["default"].ignoreCase),c&&c.sort(f["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),c&&c.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),c&&c.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),c&&c.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),c&&c.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,o,l.separator),l.fillSlcOnDemand&&(r.innerHTML=""),r.appendChild(o),r.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),a=[],r=i.Cpt.store,o=r?r.getFilterValues(i.fltsValuesCookie)[t]:null;o&&d["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&h["default"].has(i.customSlcOptions.cols,t)?a.push(o):a=o.split(" "+i.orOperator+" "));for(var u=0;u0?1:0),a=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+a+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows-(e.hasVisibleRows?e.visibleRows.length:0);this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{key:"destroy",value:function(){var t=this.tf;t.hasGrid()&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?d["default"].isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):n["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s",this.btnPrevPageText=s.btn_prev_page_text||"<",this.btnLastPageText=s.btn_last_page_text||">|",this.btnFirstPageText=s.btn_first_page_text||"|<",this.btnNextPageHtml=s.btn_next_page_html||(e.enableIcons?'':null),this.btnPrevPageHtml=s.btn_prev_page_html||(e.enableIcons?'':null),this.btnFirstPageHtml=s.btn_first_page_html||(e.enableIcons?'':null),this.btnLastPageHtml=s.btn_last_page_html||(e.enableIcons?'':null),this.pageText=s.page_text||" Page ",this.ofText=s.of_text||" of ",this.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",this.hasPagingBtns=s.paging_btns===!1?!1:!0,this.pageSelectorType=s.page_selector_type||e.fltTypeSlc,this.onBeforeChangePage=h["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=h["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_";var i=this.refRow,a=this.nbRows;this.nbPages=Math.ceil((a-i)/this.pagingLength);var r=this;this.evt={slcIndex:function(){return r.pageSelectorType===e.fltTypeSlc?r.pagingSlc.options.selectedIndex:parseInt(r.pagingSlc.value,10)-1},nbOpts:function(){return r.pageSelectorType===e.fltTypeSlc?parseInt(r.pagingSlc.options.length,10)-1:r.nbPages-1},next:function(){var t=r.evt.slcIndex()0?r.evt.slcIndex()-1:r.evt.nbOpts();r.changePage(t)},last:function(){r.changePage(r.evt.nbOpts())},first:function(){r.changePage(0)},_detectKey:function(t){var s=f["default"].keyCode(t);13===s&&(e.sorted?(e.filter(),r.changePage(r.evt.slcIndex())):r.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return a(t,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){e.changePage(),t.target.blur()},this.pageSelectorType===s.fltTypeSlc&&(t=n["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,f["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=n["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,f["default"].add(t,"keypress",i._detectKey));var l=n["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),a=n["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),r=n["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),o=n["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,f["default"].add(l,"click",i.next);else{var h=n["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);h.className=this.btnPageCssClass,f["default"].add(h,"click",i.next),l.appendChild(h)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,f["default"].add(a,"click",i.prev);else{var u=n["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);u.className=this.btnPageCssClass,f["default"].add(u,"click",i.prev),a.appendChild(u)}if(this.btnLastPageHtml)r.innerHTML=this.btnLastPageHtml,f["default"].add(r,"click",i.last);else{var d=n["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);d.className=this.btnPageCssClass,f["default"].add(d,"click",i.last),r.appendChild(d)}if(this.btnFirstPageHtml)o.innerHTML=this.btnFirstPageHtml,f["default"].add(o,"click",i.first);else{var p=n["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);p.className=this.btnPageCssClass,f["default"].add(p,"click",i.first),o.appendChild(p)}}this.pagingTgtId||s.setToolbar();var c=this.pagingTgtId?n["default"].id(this.pagingTgtId):s.mDiv;c.appendChild(o),c.appendChild(a);var g=n["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(n["default"].text(this.pageText)),g.className=this.nbPgSpanCssClass,c.appendChild(g),c.appendChild(t);var v=n["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(n["default"].text(this.ofText)),v.className=this.nbPgSpanCssClass,c.appendChild(v);var C=n["default"].create("span",["id",this.prfxPgSpan+s.id]);C.className=this.nbPgSpanCssClass,C.appendChild(n["default"].text(" "+this.nbPages+" ")),c.appendChild(C),c.appendChild(l),c.appendChild(r),this.pagingSlc=n["default"].id(this.prfxSlcPages+s.id),(!s.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),s.fltGrid||(s.validateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.isPagingRemoved=!1}},{key:"addPaging",value:function(){var t=void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!e.paging&&(e.paging=!0,this.isPagingRemoved=!0,this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(t){var e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?n["default"].id(this.pagingTgtId):e.mDiv,l=n["default"].id(this.prfxPgSpan+e.id);if(t&&t.length>0)e.validRowsIndex=t;else{e.validRowsIndex=[];for(var a=e.refRow;a0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var h=0;h=this.startPagingRow&&i>l?("true"!==a.getAttribute("validRow")&&a.getAttribute("validRow")||(a.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(a.style.display="none",e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.removeRowBg(e.validRowsIndex[l]))}e.nbVisibleRows=e.validRowsIndex.length,e.isStartBgAlternate=!1,e.applyGridProps()}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&e.paging){var s=this.evt,i=typeof t;if("string"===i)switch(d["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=n["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],r=n["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);r.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var o=this.resultsPerPageTgtId?n["default"].id(this.resultsPerPageTgtId):e.rDiv;r.appendChild(n["default"].text(l)),o.appendChild(r),o.appendChild(i),this.resultsPerPageSlc=n["default"].id(this.prfxSlcResults+e.id);for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.Cpt.store.savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(t.paging){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.Cpt.store.savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.Cpt.store.getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(e.paging){var s=e.Cpt.store.getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()){var e,s,i,l,a,r,o;e=n["default"].id(this.prfxBtnNextSpan+t.id),s=n["default"].id(this.prfxBtnPrevSpan+t.id),i=n["default"].id(this.prfxBtnLastSpan+t.id),l=n["default"].id(this.prfxBtnFirstSpan+t.id),a=n["default"].id(this.prfxPgBeforeSpan+t.id),r=n["default"].id(this.prfxPgAfterSpan+t.id),o=n["default"].id(this.prfxPgSpan+t.id);var h=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?f["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&f["default"].remove(this.pagingSlc,"keypress",h._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(f["default"].remove(e,"click",h.next),e.parentNode.removeChild(e)),s&&(f["default"].remove(s,"click",h.prev),s.parentNode.removeChild(s)),i&&(f["default"].remove(i,"click",h.last),i.parentNode.removeChild(i)),l&&(f["default"].remove(l,"click",h.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),r&&r.parentNode.removeChild(r),o&&o.parentNode.removeChild(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=c},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return a(t,[{key:"onClick",value:function(){this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(e.hasGrid()||e.isFirstLoad||!e.btnResetEl){var s=n["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?n["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;h["default"].add(l,"click",function(){t.onClick()})}else{var a=n["default"].create("a",["href","javascript:void(0);"]);a.className=e.btnResetCssClass,a.appendChild(n["default"].text(this.btnResetText)),s.appendChild(a),h["default"].add(a,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=n["default"].id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=s.help_instructions_html||null,this.helpInstrBtnText=s.help_instructions_btn_text||"?",this.helpInstrBtnHtml=s.help_instructions_btn_html||null,this.helpInstrBtnCssClass=s.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=s.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+e.version+'

http://tablefilter.free.fr
©2009-'+e.year+' Max Guglielmi.
',this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.tf=e}return a(t,[{key:"init",value:function(){var t=this;if(!this.helpInstrBtnEl){var e=this.tf,s=n["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=n["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.helpInstrTgtId||e.setToolbar();var l=this.helpInstrTgtId?n["default"].id(this.helpInstrTgtId):e.rDiv;l.appendChild(s);var a=this.helpInstrContTgtId?n["default"].id(this.helpInstrContTgtId):s;if(this.helpInstrBtnHtml){s.innerHTML=this.helpInstrBtnHtml;var r=s.firstChild;h["default"].add(r,"click",function(){t.toggle()}),a.appendChild(i)}else{a.appendChild(i);var o=n["default"].create("a",["href","javascript:void(0);"]);o.className=this.helpInstrBtnCssClass,o.appendChild(n["default"].text(this.helpInstrBtnText)),s.appendChild(o),h["default"].add(o,"click",function(){t.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&a.appendChild(i),i.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.helpInstrText,i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.helpInstrDefaultHtml,h["default"].add(i,"click",function(){t.toggle()}),this.helpInstrContEl=i,this.helpInstrBtnEl=s}}},{key:"toggle",value:function(){if(this.helpInstrContEl){var t=this.helpInstrContEl.style.display;if(""===t||"none"===t){this.helpInstrContEl.style.display="block";var e=n["default"].position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=e-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}}},{key:"destroy",value:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))}}]),t}();e.Help=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;sl;l++){var a=t?l:this.tf.validRowsIndex[l];this.setRowBg(a,i),i++}}},{key:"setRowBg",value:function(t,e){if(this.tf.alternateBgs&&!isNaN(t)){var s=this.tf.tbl.rows,i=e?e:t;this.removeRowBg(t),n["default"].addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;n["default"].removeClass(e[t],this.oddCss),n["default"].removeClass(e[t],this.evenCss)}}},{key:"remove",value:function(){if(this.tf.hasGrid()){for(var t=this.tf.refRow;t=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_Str2["default"].lower(typeof labelId)&&"object"==_Str2["default"].lower(typeof colIndex)&&"object"==_Str2["default"].lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.getColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),_Dom2["default"].id(labThisCol[i]))switch(_Str2["default"].lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom2["default"].id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom2["default"].id(labThisCol[i]).firstChild,txtnode=_Dom2["default"].text(result);_Dom2["default"].id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}]),ColOps}();exports.ColOps=ColOps},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={ignoreCase:function(t,e){var s=a["default"].lower(t),i=a["default"].lower(e);return i>s?-1:s>i?1:0}},t.exports=e["default"]}])}); \ No newline at end of file diff --git a/examples/dev.html b/examples/dev.html index 74d7d2fd..0337d7ec 100644 --- a/examples/dev.html +++ b/examples/dev.html @@ -4,79 +4,77 @@ HTML Table Filter Generator -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
Tot:
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
Tot:
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
@@ -100,7 +98,7 @@ // fill_slc_on_demand: true, rows_counter: true, // enable_default_theme: true, - // help_instructions: true, + // help_instructions: false, mark_active_columns: true, // auto_filter: false, auto_filter_delay: 200, diff --git a/package.json b/package.json index ba66c797..453c1636 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "grunt-contrib-copy": "^0.8.0", "grunt-contrib-jshint": "^0.11.2", "grunt-contrib-qunit": "^0.7.0", + "grunt-contrib-watch": "^0.6.1", "grunt-webpack": "^1.0.8", "script-loader": "^0.6.1", "webpack": "^1.8.10", diff --git a/src-es6/tablefilter.js b/src-es6/tablefilter.js index fbdd8a85..0ebc53d6 100644 --- a/src-es6/tablefilter.js +++ b/src-es6/tablefilter.js @@ -107,15 +107,6 @@ export class TableFilter{ this.fltTypeMulti = 'multiple'; this.fltTypeCheckList = 'checklist'; this.fltTypeNone = 'none'; - this.fltCol = []; //filter type of each column - - for(let j=0; j= removeNbFormat( - sA.replace(re_ge,''), nbFormat); + sA.replace(re_ge, ''), nbFormat); } //lower else if(hasLO){ occurence = num_cell_data < removeNbFormat( - sA.replace(re_l,''), nbFormat); + sA.replace(re_l, ''), nbFormat); } //greater else if(hasGR){ occurence = num_cell_data > removeNbFormat( - sA.replace(re_g,''), nbFormat); + sA.replace(re_g, ''), nbFormat); } //different else if(hasDF){ occurence = this._containsStr( - sA.replace(re_d,''),cell_data) ? false : true; + sA.replace(re_d, ''),cell_data) ? false : true; } //like else if(hasLK){ occurence = this._containsStr( - sA.replace(re_lk,''), cell_data, null, false); + sA.replace(re_lk, ''), cell_data, null, false); } //equal else if(hasEQ){ occurence = this._containsStr( - sA.replace(re_eq,''), cell_data, null, true); + sA.replace(re_eq, ''), cell_data, null, true); } //starts with else if(hasST){ - occurence = cell_data.indexOf(sA.replace(re_st,''))===0 ? + occurence = cell_data.indexOf(sA.replace(re_st, ''))===0 ? true : false; } //ends with else if(hasEN){ - let searchArg = sA.replace(re_en,''); + let searchArg = sA.replace(re_en, ''); occurence = cell_data.lastIndexOf(searchArg,cell_data.length-1) === (cell_data.length-1)-(searchArg.length-1) && @@ -1899,9 +1846,6 @@ export class TableFilter{ } catch(e) { occurence = false; } } else{ - // let fCol = f['col_'+j]; - // occurence = this._containsStr( - // sA, cell_data, !fCol ? this.fltTypeInp : fCol); occurence = this._containsStr( sA, cell_data, this.getFilterType(j)); } @@ -2104,7 +2048,7 @@ export class TableFilter{ let isExludedRow = false; // checks if current row index appears in exclude array if(exclude && Types.isArray(exclude)){ - isExludedRow = Arr.has(exclude, i); //boolean + isExludedRow = Arr.has(exclude, i); } let cell = row[i].cells, nchilds = cell.length; @@ -2116,15 +2060,13 @@ export class TableFilter{ if(j != colindex || row[i].style.display != ''){ continue; } - // if(j === colindex && row[i].style.display === ''){ let cell_data = Str.lower(this.getCellData(j, cell[j])), nbFormat = this.colNbFormat ? this.colNbFormat[colindex] : null, data = num ? - Helpers.removeNbFormat(cell_data,nbFormat) : + Helpers.removeNbFormat(cell_data, nbFormat) : cell_data; colValues.push(data); - // } } } } @@ -2145,7 +2087,8 @@ export class TableFilter{ if(!flt){ return ''; } - let fltColType = this.fltCol[index]; + // let fltColType = this.fltCol[index]; + let fltColType = this.getFilterType(index); if(fltColType !== this.fltTypeMulti && fltColType !== this.fltTypeCheckList){ fltValue = flt.value; @@ -2222,7 +2165,7 @@ export class TableFilter{ } let arr = []; for(let i=0, len=this.fltIds.length; i + + + + TableFilter with auto filter feature tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
+ + + + +
+
+ + diff --git a/test/test-auto-filter.js b/test/test-auto-filter.js new file mode 100644 index 00000000..53a9cdb1 --- /dev/null +++ b/test/test-auto-filter.js @@ -0,0 +1,30 @@ +(function(win, TableFilter){ + + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + auto_filter: true, + auto_filter_delay: 1000 + }); + tf.init(); + window.tf = tf; + + module('Sanity checks'); + test('Auto filter feature', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.autoFilter, true, 'Auto filtering enabled'); + deepEqual(tf.autoFilterDelay, 1000, 'Expected filtering delay'); + }); + + module('Remove feature'); + test('Auto filter feature disabled', function() { + tf.destroy(); + tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + auto_filter: false + }); + + deepEqual(tf.autoFilter, false, 'Auto filtering disabled'); + deepEqual(tf.autoFilterDelay, 900, 'Expected filtering delay'); + }); + +})(window, TableFilter); diff --git a/test/test.js b/test/test.js index 27c88045..539937d5 100644 --- a/test/test.js +++ b/test/test.js @@ -9,7 +9,7 @@ test("TableFilter object", function() { equal(tf.id, 'demo', 'id check'); equal(tf.filtersRowIndex, 0, 'Filters row index'); - deepEqual(tf.fltCol.length, 5, 'filters type collection length'); + deepEqual(tf.getCellsNb(), 5, 'filters type collection length'); }); module('DOM tests');