From bd9740c419d8930a4d0f9f6e91d5b9b69cd81f22 Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Thu, 14 Jan 2016 21:13:19 +1100 Subject: [PATCH] Cleaned destroy method of TableFilter class --- dist/tablefilter/style/colsVisibility.css | 2 +- dist/tablefilter/style/filtersVisibility.css | 2 +- dist/tablefilter/style/tablefilter.css | 2 +- .../style/themes/default/default.css | 2 +- .../style/themes/mytheme/mytheme.css | 2 +- .../style/themes/skyblue/skyblue.css | 2 +- dist/tablefilter/tablefilter.js | 10 +- dist/tablefilter/tf-1.js | 6 +- src/extensions/colOps/colOps.js | 2 +- src/modules/alternateRows.js | 2 +- src/modules/checkList.js | 3 +- src/modules/dropdown.js | 3 +- src/modules/highlightKeywords.js | 10 +- src/modules/paging.js | 3 - src/tablefilter.js | 140 +++++++++--------- test/test-highlight-keywords.js | 12 +- 16 files changed, 104 insertions(+), 99 deletions(-) diff --git a/dist/tablefilter/style/colsVisibility.css b/dist/tablefilter/style/colsVisibility.css index 2da7ba1a..9d85ba69 100644 --- a/dist/tablefilter/style/colsVisibility.css +++ b/dist/tablefilter/style/colsVisibility.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ span.colVisSpan{text-align:left;}span.colVisSpan a.colVis{display:inline-block;padding:7px 5px 0;font-size:inherit;font-weight:inherit;vertical-align:top}div.colVisCont{position:relative;background:#fff;-webkit-box-shadow:3px 3px 2px #888;-moz-box-shadow:3px 3px 2px #888;box-shadow:3px 3px 2px #888;position:absolute;display:none;border:1px solid #ccc;height:auto;width:250px;background-color:#fff;margin:35px 0 0 -100px;z-index:10000;padding:10px 10px 10px 10px;text-align:left;font-size:12px;}div.colVisCont:after,div.colVisCont:before{bottom:100%;left:50%;border:solid transparent;content:" ";height:0;width:0;position:absolute;pointer-events:none}div.colVisCont:after{border-color:rgba(255,255,255,0);border-bottom-color:#fff;border-width:10px;margin-left:-10px}div.colVisCont:before{border-color:rgba(255,255,255,0);border-bottom-color:#ccc;border-width:12px;margin-left:-12px}div.colVisCont p{margin:6px auto 6px auto}div.colVisCont a.colVis{display:initial;font-weight:inherit}ul.cols_checklist{padding:0;margin:0;list-style:none;}ul.cols_checklist label{display:block}ul.cols_checklist input{vertical-align:middle;margin:2px 5px 2px 1px}li.cols_checklist_item{padding:4px;margin:0;}li.cols_checklist_item:hover{background-color:#335ea8;color:#fff}.cols_checklist_slc_item{background-color:#335ea8;color:#fff} \ No newline at end of file diff --git a/dist/tablefilter/style/filtersVisibility.css b/dist/tablefilter/style/filtersVisibility.css index 55001878..498606c5 100644 --- a/dist/tablefilter/style/filtersVisibility.css +++ b/dist/tablefilter/style/filtersVisibility.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ span.expClpFlt a.btnExpClpFlt{width:35px;height:35px;display:inline-block;}span.expClpFlt a.btnExpClpFlt:hover{background-color:#f4f4f4}span.expClpFlt img{padding:8px 11px 11px 11px} \ No newline at end of file diff --git a/dist/tablefilter/style/tablefilter.css b/dist/tablefilter/style/tablefilter.css index 3a201200..cf5377e9 100644 --- a/dist/tablefilter/style/tablefilter.css +++ b/dist/tablefilter/style/tablefilter.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ .activeHeader{background-color:#66afe9 !important;color:#fff !important} diff --git a/dist/tablefilter/style/themes/default/default.css b/dist/tablefilter/style/themes/default/default.css index 64278f05..ab9fa4d0 100644 --- a/dist/tablefilter/style/themes/default/default.css +++ b/dist/tablefilter/style/themes/default/default.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ table.TF{border-left:1px solid #ccc !important;border-top:none !important;border-right:none !important;border-bottom:none !important;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important;color:#333 !important}table.TF td{border-bottom:1px dotted #999 !important;padding:5px !important}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important} \ No newline at end of file diff --git a/dist/tablefilter/style/themes/mytheme/mytheme.css b/dist/tablefilter/style/themes/mytheme/mytheme.css index 2a154374..b3fbb029 100644 --- a/dist/tablefilter/style/themes/mytheme/mytheme.css +++ b/dist/tablefilter/style/themes/mytheme/mytheme.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ table.TF{border-left:1px dotted #81963b !important;border-top:none !important;border-right:0 !important;border-bottom:none !important;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;color:#fff !important}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px !important}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important} \ No newline at end of file diff --git a/dist/tablefilter/style/themes/skyblue/skyblue.css b/dist/tablefilter/style/themes/skyblue/skyblue.css index 0560153d..7ea2b7b3 100644 --- a/dist/tablefilter/style/themes/skyblue/skyblue.css +++ b/dist/tablefilter/style/themes/skyblue/skyblue.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.837Z + * build date: 2016-01-14T10:08:13.993Z * MIT License */ table.TF{padding:0;color:#000;border-right:1px solid #a4bed4;border-top:1px solid #a4bed4;border-left:1px solid #a4bed4;border-bottom:0;}table.TF th{margin:0;color:inherit;background:#d1e5fe url("images/bg_skyblue.gif") 0 0 repeat-x;border-color:#fdfdfd #a4bed4 #a4bed4 #fdfdfd;border-width:1px;border-style:solid}table.TF td{margin:0;padding:5px;color:inherit;border-bottom:1px solid #a4bed4;border-left:0;border-top:0;border-right:0}.fltrow{background-color:#d1e5fe !important;}.fltrow th,.fltrow td{padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #a4bed4 !important}input.flt{width:99% !important}.inf{background-color:#e3efff !important;border:1px solid #a4bed4;height:$min-height;color:#004a6f}div.tot,div.status{border-right:0 !important}.helpBtn:hover{background-color:transparent}input.reset{background:transparent url("images/icn_clear_filters.png") center center no-repeat !important}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.nextPage:hover{background:#ffe4ab url("images/btn_next_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.previousPage{background:transparent url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.previousPage:hover{background:#ffe4ab url("images/btn_prev_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.firstPage:hover{background:#ffe4ab url("images/btn_first_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid transparent !important;}.lastPage:hover{background:#ffe4ab url("images/btn_last_page.gif") center center no-repeat !important;border:1px solid #ffb552 !important}.activeHeader{background:#ffe4ab !important;border:1px solid #ffb552 !important;color:inherit !important}div.grd_Cont{background-color:#d9eaed !important;border:1px solid #9cc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#e3efff}div.grd_headTblCont{background-color:#d9eaed !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#d9eaed url("images/bg_skyblue.gif") left top repeat-x;border-bottom:1px solid #a4bed4;border-right:1px solid #a4bed4 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #a4bed4 !important;border-right:0 !important;border-left:0 !important;border-top:0 !important}.grd_inf{background-color:#cce2fe;color:#004a6f;border-top:1px solid #9cc !important;}.grd_inf a{text-decoration:none;font-weight:bold}.loader{background-color:#2d8eef;border:1px solid #cce2fe;border-radius:5px}.even{background-color:#fff}.odd{background-color:#e3efff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.ezActiveRow{background-color:#ffdc61 !important;color:inherit}.ezSelectedRow{background-color:#ffe4ab !important;color:inherit}.ezActiveCell{background-color:#fff !important;color:#000 !important;font-weight:bold}.ezETSelectedCell{background-color:#fff !important;font-weight:bold;color:#000 !important} \ No newline at end of file diff --git a/dist/tablefilter/tablefilter.js b/dist/tablefilter/tablefilter.js index fea33ed3..055e7216 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,10 +1,10 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.759Z + * build date: 2016-01-14T10:08:13.903Z * MIT License */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,function(){return function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i=window.webpackJsonp;window.webpackJsonp=function(s,l){for(var a,r,o=0,h=[];oa;a++)s[a]=arguments[a];if(0!==s.length){if(this.id=null,this.version="0.1.6",this.year=(new Date).getFullYear(),this.tbl=null,this.startRow=null,this.refRow=null,this.headersRow=null,this.cfg={},this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this._hasGrid=!1,s.forEach(function(t){var i="undefined"==typeof t?"undefined":n(t);"object"===i&&t&&"TABLE"===t.nodeName?(e.tbl=t,e.id=t.id||"tf_"+(new Date).getTime()+"_"):"string"===i?(e.id=t,e.tbl=u["default"].id(t)):"number"===i?e.startRow=t:"object"===i&&(e.cfg=t)}),!this.tbl||"TABLE"!=this.tbl.nodeName||0===this.getRowsNb())throw new Error("Could not instantiate TableFilter: HTML table not found.");var r=this.cfg;this.emitter=new x.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(h){this.nbCells=this.getCellsNb(0)}this.basePath=r.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=r.grid===!1?!1:!0,this.gridLayout=Boolean(r.grid_layout),this.filtersRowIndex=isNaN(r.filters_row_index)?0:r.filters_row_index,this.headersRow=isNaN(r.headers_row_index)?0===this.filtersRowIndex?1:0:r.headers_row_index,this.fltCellTag="th"!==r.filters_cell_tag||"td"!==r.filters_cell_tag?"td":r.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.validRowsIndex=[],this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.infDivCssClass=r.inf_div_css_class||"inf",this.lDivCssClass=r.left_div_css_class||"ldiv",this.rDivCssClass=r.right_div_css_class||"rdiv",this.mDivCssClass=r.middle_div_css_class||"mdiv",this.contDivCssClass=r.content_div_css_class||"cont",this.stylePath=r.style_path||this.basePath+"style/",this.stylesheet=r.stylesheet||this.stylePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=r.flts_row_css_class||"fltrow",this.enableIcons=r.enable_icons===!1?!1:!0,this.alternateRows=Boolean(r.alternate_rows),this.hasColWidths=v["default"].isArray(r.col_widths),this.colWidths=this.hasColWidths?r.col_widths:null,this.fltCssClass=r.flt_css_class||"flt",this.fltMultiCssClass=r.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=r.flt_small_css_class||"flt_s",this.singleFltCssClass=r.single_flt_css_class||"single_flt",this.enterKey=r.enter_key===!1?!1:!0,this.onBeforeFilter=v["default"].isFn(r.on_before_filter)?r.on_before_filter:null,this.onAfterFilter=v["default"].isFn(r.on_after_filter)?r.on_after_filter:null,this.caseSensitive=Boolean(r.case_sensitive),this.hasExactMatchByCol=v["default"].isArray(r.columns_exact_match),this.exactMatchByCol=this.hasExactMatchByCol?r.columns_exact_match:[],this.exactMatch=Boolean(r.exact_match),this.linkedFilters=Boolean(r.linked_filters),this.disableExcludedOptions=Boolean(r.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasVisibleRows=Boolean(r.rows_always_visible),this.visibleRows=this.hasVisibleRows?r.rows_always_visible:[],this.isExternalFlt=Boolean(r.external_flt_grid),this.externalFltTgtIds=r.external_flt_grid_ids||[],this.externalFltEls=[],this.execDelay=isNaN(r.exec_delay)?100:parseInt(r.exec_delay,10),this.onFiltersLoaded=v["default"].isFn(r.on_filters_loaded)?r.on_filters_loaded:null,this.singleSearchFlt=Boolean(r.single_filter),this.onRowValidated=v["default"].isFn(r.on_row_validated)?r.on_row_validated:null,this.customCellDataCols=r.custom_cell_data_cols?r.custom_cell_data_cols:[],this.customCellData=v["default"].isFn(r.custom_cell_data)?r.custom_cell_data:null,this.watermark=r.watermark||"",this.isWatermarkArray=v["default"].isArray(this.watermark),this.toolBarTgtId=r.toolbar_target_id||null,this.help=v["default"].isUndef(r.help_instructions)?void 0:Boolean(r.help_instructions),this.popupFilters=Boolean(r.popup_filters),this.markActiveColumns=Boolean(r.mark_active_columns),this.activeColumnsCssClass=r.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=v["default"].isFn(r.on_before_active_column)?r.on_before_active_column:null,this.onAfterActiveColumn=v["default"].isFn(r.on_after_active_column)?r.on_after_active_column:null,this.displayAllText=r.display_all_text||"Clear",this.enableEmptyOption=Boolean(r.enable_empty_option),this.emptyText=r.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(r.enable_non_empty_option),this.nonEmptyText=r.non_empty_text||"(Non empty)",this.onSlcChange=r.on_change===!1?!1:!0,this.sortSlc=r.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(r.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?r.sort_num_asc:null,this.isSortNumDesc=Boolean(r.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?r.sort_num_desc:null,this.loadFltOnDemand=Boolean(r.load_filters_on_demand),this.hasCustomOptions=v["default"].isObj(r.custom_options),this.customOptions=r.custom_options,this.rgxOperator=r.regexp_operator||"rgx:",this.emOperator=r.empty_operator||"[empty]",this.nmOperator=r.nonempty_operator||"[nonempty]",this.orOperator=r.or_operator||"||",this.anOperator=r.and_operator||"&&",this.grOperator=r.greater_operator||">",this.lwOperator=r.lower_operator||"<",this.leOperator=r.lower_equal_operator||"<=",this.geOperator=r.greater_equal_operator||">=",this.dfOperator=r.different_operator||"!",this.lkOperator=r.like_operator||"*",this.eqOperator=r.equal_operator||"=",this.stOperator=r.start_with_operator||"{",this.enOperator=r.end_with_operator||"}",this.curExp=r.cur_exp||"^[¥£€$]",this.separator=r.separator||",",this.rowsCounter=Boolean(r.rows_counter),this.statusBar=Boolean(r.status_bar),this.loader=Boolean(r.loader),this.displayBtn=Boolean(r.btn),this.btnText=r.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=r.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(r.btn_reset),this.btnResetCssClass=r.btn_reset_css_class||"reset",this.onBeforeReset=v["default"].isFn(r.on_before_reset)?r.on_before_reset:null,this.onAfterReset=v["default"].isFn(r.on_after_reset)?r.on_after_reset:null,this.paging=Boolean(r.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.autoFilter=Boolean(r.auto_filter),this.autoFilterDelay=isNaN(r.auto_filter_delay)?900:r.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(r.highlight_keywords),this.noResults=v["default"].isObj(r.no_results_message)||Boolean(r.no_results_message),this.defaultDateType=r.default_date_type||"DMY",this.thousandsSeparator=r.thousands_separator||",",this.decimalSeparator=r.decimal_separator||".",this.hasColNbFormat=v["default"].isArray(r.col_number_format),this.colNbFormat=this.hasColNbFormat?r.col_number_format:null,this.hasColDateType=v["default"].isArray(r.col_date_type),this.colDateType=this.hasColDateType?r.col_date_type:null,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(r.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&r.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&r.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=r.extensions,this.hasExtensions=v["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(r.enable_default_theme),this.hasThemes=this.enableDefaultTheme||v["default"].isArray(r.themes),this.themes=r.themes||[],this.themesPath=r.themes_path||this.stylePath+"themes/",this.Mod={},this.ExtRegistry={},this.Evt={detectKey:function(t){if(this.enterKey&&t){var e=o["default"].keyCode(t);13===e?(this.filter(),o["default"].cancel(t),o["default"].stop(t)):(this.isUserTyping=!0,A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyUp:function(t){function e(){A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=o["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=A.setInterval(e.bind(this),this.autoFilterDelay)):(A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,A.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},onInpFocus:function(t){var e=o["default"].target(t);this.activeFilterId=e.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.emitter.emit("filter-focus",this)}}}}return a(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(e.store||(e.store=new T.Store(this)),e.store.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new k.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new P.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new R.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new F.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;i>l;l++){this.emitter.emit("before-filter-init",this,l);var a=u["default"].create(this.fltCellTag),r=this.getFilterType(l);this.singleSearchFlt&&(a.colSpan=this.nbCells),this.gridLayout||n.appendChild(a),s=l==i-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(r=this.fltTypeInp,s=this.singleFltCssClass),r===this.fltTypeSlc||r===this.fltTypeMulti?(e.dropdown||(e.dropdown=new I.Dropdown(this)),e.dropdown.init(l,this.isExternalFlt,a)):r===this.fltTypeCheckList?(e.checkList||(e.checkList=new O.CheckList(this)),e.checkList.init(l,this.isExternalFlt,a)):this._buildInputFilter(l,s,a),l==i-1&&this.displayBtn&&this._buildSubmitButton(l,a),this.emitter.emit("after-filter-init",this,l)}}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new S.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new E.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new L.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new N.ClearButton(this),e.clearButton.init()),this.help&&(e.help||(e.help=new D.Help(this)),e.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new B.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new M.NoResults(this)),e.noResults.init()),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||u["default"].addClass(this.tbl,this.prfxTf),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.emitter.emit("initialized",this)}}},{key:"_insertFiltersRow",value:function(){if(!this.gridLayout){var t=void 0,e=u["default"].tag(this.tbl,"thead");return t=e.length>0?e[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&this.headersRow++,t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}}},{key:"_initNoFilters",value:function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)}},{key:"_buildInputFilter",value:function(t,e,i){var s=this.getFilterType(t),n=this.isExternalFlt?this.externalFltTgtIds[t]:null,l=s===this.fltTypeInp?"text":"hidden",a=u["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",l],["ct",t]);"hidden"!==l&&this.watermark&&a.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),a.className=e||this.fltCssClass,o["default"].add(a,"focus",this.Evt.onInpFocus.bind(this)),n?(u["default"].id(n).appendChild(a),this.externalFltEls.push(a)):i.appendChild(a),this.fltIds.push(a.id),o["default"].add(a,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(a,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(a,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(a,"blur",this.Evt.onInpBlur.bind(this))}},{key:"_buildSubmitButton",value:function(t,e){var i=this,s=this.isExternalFlt?this.externalFltTgtIds[t]:null,n=u["default"].create(this.fltTypeInp,["id",this.prfxValButton+t+"_"+this.id],["type","button"],["value",this.btnText]);n.className=this.btnCssClass,s?u["default"].id(s).appendChild(n):e.appendChild(n),o["default"].add(n,"click",function(){return i.filter()})}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,l=void 0;s&&n?l=t.path+s:(s=s.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(26)("./"+l)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}}},{key:"extension",value:function(t){return this.ExtRegistry[t]}},{key:"hasExtension",value:function(t){return!v["default"].isEmpty(this.ExtRegistry[t])}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}}},{key:"loadThemes",value:function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(v["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],l=n.name,a=n.path,r=this.prfxTf+l;l&&!a?a=this.themesPath+l+"/"+l+".css":!l&&n.path&&(l="theme{0}".replace("{0}",i)),this.isImported(a,"link")||this["import"](r,a,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)}},{key:"getStylesheet",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return u["default"].id(this.prfxTf+t)}},{key:"destroy",value:function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.markActiveColumns&&(this.clearActiveColumns(),this.emitter.off(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;s0&&[].forEach.call(e,function(e){t.removeChild(e)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=u["default"].id(s);n&&(n.innerHTML="")}}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(!v["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],l=i.indexOf(t),a=e.values[l],r=e.texts[l],o=e.sorts[l],h=0,u=a.length;u>h;h++)n.push(a[h]),r[h]?s.push(r[h]):s.push(a[h]);return o&&(n.sort(),s.sort()),[n,s]}}},{key:"resetValues",value:function(){var t=this;if(this.rememberGridValues)if(this.loadFltOnDemand)this._resetGridValues(this.fltsValuesCookie);else{var e=this.Mod.store.getFilterValues(this.fltsValuesCookie);e.forEach(function(e,i){" "!==e&&t.setFilterValue(i,e)})}this.filter()}},{key:"_resetGridValues",value:function(t){if(this.loadFltOnDemand){var e=this.Mod.store.getFilterValues(t),i=this.getFiltersByType(this.fltTypeSlc,!0),s=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var n=0;nh;h++)""!==l[h]&&(a=u["default"].createOpt(l[h],l[h],!0),o.appendChild(a),this.hasStoredValues=!0)}}else if(r===this.fltTypeCheckList){var d=this.Mod.checkList,c=d.checkListDiv[n];c.title=c.innerHTML,c.innerHTML="";var p=u["default"].create("ul",["id",this.fltIds[n]],["colIndex",n]);p.className=d.checkListCssClass;var g=u["default"].createCheckItem(this.fltIds[n]+"_0","",this.displayAllText);g.className=d.checkListItemCssClass,p.appendChild(g),c.appendChild(p),l=e[n].split(" "+this.orOperator+" ");for(var h=0,f=l.length;f>h;h++)if(""!==l[h]){var v=u["default"].createCheckItem(this.fltIds[n]+"_"+(h+1),l[h],l[h]);v.className=d.checkListItemCssClass,p.appendChild(v),v.check.checked=!0,d.setCheckListValues(v.check),this.hasStoredValues=!0}}else r===this.fltTypeInp&&this.setFilterValue(n,e[n])}!this.hasStoredValues&&this.paging&&this.Mod.paging.setPagingInfo()}}}},{key:"filter",value:function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(p,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,"");var n=t;(r.test(t)||o.test(t)||h.test(t)||f.test(t)||c.test(t))&&(n=u["default"].getText(i)),""!==n&&s.highlightKeyword.highlight(i,n,s.highlightKeyword.highlightCssClass)}}function e(t,e,i){var s=void 0,n=w["default"].removeNbFormat,u=h.test(t),x=r.test(t),T=f.test(t),k=o.test(t),P=c.test(t),R=g.test(t),F=p.test(t),I=v.test(t),O=b.test(t),E=m===t,L=y===t,N=C.test(t),D=u&&_["default"].isValid(t.replace(h,""),S),B=x&&_["default"].isValid(t.replace(r,""),S),M=T&&_["default"].isValid(t.replace(f,""),S),A=k&&_["default"].isValid(t.replace(o,""),S),H=P&&_["default"].isValid(t.replace(c,""),S),j=R&&_["default"].isValid(t.replace(g,""),S),V=void 0,U=void 0;if(_["default"].isValid(e,S))V=_["default"].format(e,S),D?(U=_["default"].format(t.replace(h,""),S),s=U>V):B?(U=_["default"].format(t.replace(r,""),S),s=U>=V):A?(U=_["default"].format(t.replace(o,""),S),s=V>=U):M?(U=_["default"].format(t.replace(f,""),S),s=V>U):H?(U=_["default"].format(t.replace(c,""),S),s=V.toString()!=U.toString()):j?(U=_["default"].format(t.replace(g,""),S),s=V.toString()==U.toString()):p.test(t)?s=d["default"].contains(t.replace(p,""),e,!1,this.caseSensitive):_["default"].isValid(t,S)?(U=_["default"].format(t,S),s=V.toString()===U.toString()):s=E?d["default"].isEmpty(e):L?!d["default"].isEmpty(e):d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(l=n(e,this.colNbFormat[i]),a=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(l=n(e,"us"),a="us"):(l=n(e,"eu"),a="eu"),x)s=l<=n(t.replace(r,""),a);else if(k)s=l>=n(t.replace(o,""),a);else if(u)s=ln(t.replace(f,""),a);else if(P)s=d["default"].contains(t.replace(c,""),e,!1,this.caseSensitive)?!1:!0;else if(F)s=d["default"].contains(t.replace(p,""),e,!1,this.caseSensitive);else if(R)s=d["default"].contains(t.replace(g,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(v,""))?!0:!1;else if(O){var z=t.replace(b,"");s=e.lastIndexOf(z,e.length-1)===e.length-1-(z.length-1)&&e.lastIndexOf(z,e.length-1)>-1?!0:!1}else if(E)s=d["default"].isEmpty(e);else if(L)s=!d["default"].isEmpty(e);else if(N)try{var G=t.replace(C,""),W=new RegExp(G);s=W.test(e)}catch($){s=!1}else s=d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=this.Mod,n=0;this.validRowsIndex=[],this.searchArgs=this.getFiltersValue();for(var l,a,r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),h=new RegExp(this.lwOperator),f=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),p=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,y=this.nmOperator,C=new RegExp(d["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var O=this.searchArgs[this.singleSearchFlt?0:I],S=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==O){var E=d["default"].matchCase(this.getCellData(T[I]),this.caseSensitive),L=O.split(this.orOperator),N=L.length>1?!0:!1,D=O.split(this.anOperator),B=D.length>1?!0:!1;if(N||B){for(var M=void 0,A=!1,H=N?L:D,j=0,V=H.length;V>j&&(M=d["default"].trim(H[j]),A=e.call(this,M,E,I),t.call(this,M,A,T[I]),!N||!A)&&(!B||A);j++);P[I]=A}else P[I]=e.call(this,d["default"].trim(O),E,I),t.call(this,O,P[I],T[I]);P[I]||(R=!1),this.singleSearchFlt&&P[I]&&(F=!0),this.emitter.emit("cell-processed",this,I,T[I])}}this.singleSearchFlt&&F&&(R=!0),R?this.validateRow(x,!0):(this.validateRow(x,!1),n++),this.emitter.emit("row-processed",this,x,this.validRowsIndex.length,R)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=n,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this)}}},{key:"getColValues",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var a=this.refRow;a0&&(r=-1!=s.indexOf(a));var o=n[a].cells,h=o.length;if(h===this.nbCells&&!r)for(var u=0;h>u;u++)if(u==t&&""===n[a].style.display){var f=this.getCellData(o[u]),d=this.colNbFormat?this.colNbFormat[t]:null,c=i?w["default"].removeNbFormat(f,d):f;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,i=this.getFilterElement(t);if(!i)return"";var s=this.getFilterType(t);if(s!==this.fltTypeMulti&&s!==this.fltTypeCheckList)e=i.value;else if(s===this.fltTypeMulti){e="";for(var n=0,l=i.options.length;l>n;n++)i.options[n].selected&&(e=e.concat(i.options[n].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else s===this.fltTypeCheckList&&(null!==i.getAttribute("value")?(e=i.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,i=this.fltIds.length;i>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 i=[],s=0,n=this.fltIds.length;n>s;s++){var l=this.getFilterType(s);if(l===d["default"].lower(t)){var a=e?s:this.fltIds[s];i.push(a)}}return i}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return u["default"].id(e)}},{key:"getCellsNb",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=v["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)}},{key:"getCellData",value:function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):u["default"].getText(t)}},{key:"getTableData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.refRow;lo;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var u=this.getCellData(r[o]);a[1].push(u)}s.push(a)}return s}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.getValidRows(!0),a=0;an;n++){var a=i[n],r=a[1],o=r[t];s.push(o)}return s}},{key:"getRowDisplay",value:function(t){return v["default"].isObj(t)?t.style.display:null}},{key:"validateRow",value:function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;tl;l++){var r=i.options[l];(""===n||""===n[0])&&(r.selected=!1),""===r.value&&(r.selected=!1),""!==r.value&&m["default"].has(n,r.value,!0)&&(r.selected=!0)}else if(s===this.fltTypeCheckList){e=d["default"].matchCase(e,this.caseSensitive);var o=e.split(" "+this.orOperator+" "),h=u["default"].tag(i,"li").length;i.setAttribute("value",""),i.setAttribute("indexes","");for(var f=0;h>f;f++){var c=u["default"].tag(i,"li")[f],p=u["default"].tag(c,"label")[0],g=u["default"].tag(c,"input")[0],v=d["default"].matchCase(u["default"].getText(p),this.caseSensitive); -""!==v&&m["default"].has(o,v,!0)?(g.checked=!0,this.Mod.checkList.setCheckListValues(g)):(g.checked=!1,this.Mod.checkList.setCheckListValues(g))}}}}},{key:"setColWidths",value:function(t,e){function i(){for(var t=this.nbCells,i=this.colWidths,s=u["default"].tag(e,"col"),n=s.length>0,l=n?null:H.createDocumentFragment(),a=0;t>a;a++){var r=void 0;n?r=s[a]:(r=u["default"].create("col",["id",this.id+"_col_"+a]),l.appendChild(r)),r.style.width=i[a]}n||e.insertBefore(l,e.firstChild)}if(this.fltGrid&&this.hasColWidths){e=e||this.tbl;var s=void 0;s=void 0===t?"none"!=e.rows[0].style.display?0:1:t,i.call(this)}}},{key:"enforceVisibility",value:function(){if(this.hasVisibleRows)for(var t=0,e=this.visibleRows.length;e>t;t++){var i=this.visibleRows[t];i<=this.nbRows&&this.validateRow(i,!0)}}},{key:"clearFilters",value:function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.rememberPageLen&&p["default"].remove(this.pgLenCookie),this.rememberPageNb&&p["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this),this.filter(),this.emitter.emit("after-clearing-filters",this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)u["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"markActiveColumn",value:function(t){var e=this.getHeaderElement(t);u["default"].hasClass(e,this.activeColumnsCssClass)||(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,t),u["default"].addClass(e,this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,t))}},{key:"linkFilters",value:function(){if(this.linkedFilters&&this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),i=this.getFiltersByType(this.fltTypeCheckList,!0),s=t.concat(e);s=s.concat(i);var n=this.activeFilterId.split("_")[0];n=n.split(this.prfxFlt)[1];for(var l=void 0,a=0,r=s.length;r>a;a++){var o=u["default"].id(this.fltIds[s[a]]);if(l=this.getFilterValue(s[a]),n!==s[a]||this.paging&&-1!=t.indexOf(s[a])&&n===s[a]||!this.paging&&(-1!=i.indexOf(s[a])||-1!=e.indexOf(s[a]))||l===this.displayAllText){if(-1!=i.indexOf(s[a])?this.Mod.checkList.checkListDiv[s[a]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var h=u["default"].createOpt(this.displayAllText,"");o&&o.appendChild(h)}-1!=i.indexOf(s[a])?this.Mod.checkList.build(s[a]):this.Mod.dropdown.build(s[a],!0),this.setFilterValue(s[a],l)}}}}},{key:"isExactMatch",value:function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp}},{key:"isImported",value:function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",l=u["default"].tag(H,s),a=0,r=l.length;r>a;a++)if(void 0!==l[a][n]&&l[a][n].match(t)){i=!0;break}return i}},{key:"import",value:function(t,e,i,s){var n=s?s:"script",l=this.isImported(e,n);if(!l){var a=this,r=!1,o=void 0,h=u["default"].tag(H,"head")[0];o="link"===d["default"].lower(n)?u["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):u["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,"function"==typeof i&&i.call(null,a))},o.onerror=function(){throw new Error("TF script could not load: "+e)},h.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){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 n=0;n0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var l=s.indexOf(";",n);-1===l&&(l=s.length),e=unescape(s.substring(n,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var i=this.read(t),s=i.split(e);return s},getValueByIndex:function(t,e,i){i||(i=",");var s=this.valueToArray(t,i);return s[e]}}},function(t,e){"use strict";function i(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}Object.defineProperty(e,"__esModule",{value:!0});var s=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"===i(window[t])&&(e=!0):t&&"object"===("undefined"==typeof t?"undefined":i(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===s},isNull:function(t){return null===t},isEmpty:function(t){return this.isUndef(t)||this.isNull(t)||0===t.length}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={has:function(t,e,i){for(var s=void 0===i?!1:i,n=0;n2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||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 i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var l=t.split(RegExp.$1),a=void 0,r=void 0,o=void 0;a="M"===e.substring(0,1)?l[0]:"M"===e.substring(1,2)?l[1]:l[2],r="D"===e.substring(0,1)?l[0]:"D"===e.substring(1,2)?l[1]:l[2],o="Y"===e.substring(0,1)?l[0]:"Y"===e.substring(1,2)?l[1]:l[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(a,10)-1,parseInt(r,10),0,0,0,0);return parseInt(r,10)!=h.getDate()?!1:parseInt(a,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(l[2]),s(l[1])-1,l[0]);break;case"DMY":l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0]);break;case"MDY":l=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[0]-1,l[1]);break;case"YMD":l=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(l[0]),l[1]-1,l[2]);break;default:l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===l["default"].lower(e)?+i.replace(/[^\d\.-]/g,""):+i.replace(/[^\d\,-]/g,"").replace(",",".")}}}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(t,e){for(var i=0;i0&&s.removeChild(P[0]),this.headTbl.style.tableLayout="fixed",s.style.tableLayout="fixed",this.headTbl.cellPadding=s.cellPadding,this.headTbl.cellSpacing=s.cellSpacing,e.setColWidths(0,this.headTbl),s.style.width="",this.headTbl.style.width=s.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var i=p["default"].target(e),s=i.scrollLeft;t.headTblCont.scrollLeft=s});var R=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=g),this.tblHasColTag=u["default"].tag(s,"col").length>0?!0:!1;var F=function(){for(var t=e.nbCells-1;t>=0;t--){var i=u["default"].create("col",["id",e.id+"_col_"+t]);s.insertBefore(i,s.firstChild),i.style.width=e.colWidths[t],this.gridColElms[t]=i}this.tblHasColTag=!0};if(this.tblHasColTag)for(var I=u["default"].tag(s,"col"),O=0;O',e.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",e.onBeforePopUpOpen=u["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,e.onAfterPopUpOpen=u["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,e.onBeforePopUpClose=u["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,e.onAfterPopUpClose=u["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,e.popUpFltSpans=[],e.popUpFltImgs=[],e.popUpFltElms=e.popUpFltElmCache||[],e.popUpFltAdjustToContainer=!0,e.prfxPopUpSpan="popUpSpan_",e.prfxPopUpDiv="popUpDiv_",e}return a(i,e),r(i,[{key:"onClick",value:function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[n],a=this.tf.getHeaderElement(n),r=.95*a.clientWidth;l.style.width=parseInt(r,10)+"px"}p["default"].cancel(i),p["default"].stop(i)}},{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;iy;y++)if(t===y&&(!e||e&&n.disableExcludedOptions)||t==y&&e&&(""===r[g].style.display&&!n.paging||n.paging&&(!n.validRowsIndex||n.validRowsIndex&&-1!=n.validRowsIndex.indexOf(g))&&(void 0===h||h==t||h!=t&&-1!=n.validRowsIndex.indexOf(g)))){var _=n.getCellData(b[y]),C=p["default"].matchCase(_,o);if(d["default"].has(this.opts,C,o)||this.opts.push(_),e&&n.disableExcludedOptions){var w=c[y];w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,o)||d["default"].has(f,C,o)||this.isFirstLoad||f.push(_)}}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(o?(this.opts.sort(),f&&f.sort()):(this.opts.sort(v["default"].ignoreCase),f&&f.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),f&&f.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(T){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),f&&f.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(T){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,a,e,f),this.emitter.emit("after-populating-filter",n,t,a)}}},{key:"addOptions",value:function(t,e,i,s){var n=this.tf,l=p["default"].lower(this.slcFillingMethod),a=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var r=0;r"+h+""}else{var g=void 0;g=n.loadFltOnDemand&&a===this.opts[r]&&n.getFilterType(t)===n.fltTypeSlc?u["default"].createOpt(h,o,!0):u["default"].createOpt(h,o,!1),f&&(g.disabled=!0),e.appendChild(g)}}"innerhtml"===l&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,i=p["default"].lower(this.slcFillingMethod);if("innerhtml"===i)this.slcInnerHtml+='";else{var s=u["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(s.style.display="none"),t.appendChild(s),e.enableEmptyOption){var n=u["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(n)}if(e.enableNonEmptyOption){var l=u["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}},{key:"destroy",value:function(){}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={ignoreCase:function(t,e){var i=l["default"].lower(t),s=l["default"].lower(e);return s>i?-1:i>s?1:0}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;iy;y++)if(t===y&&(!n.linkedFilters||n.linkedFilters&&n.disableExcludedOptions)||t===y&&n.linkedFilters&&(""===o[c].style.display&&!n.paging||n.paging&&(!h||h===t||h!=t&&-1!=n.validRowsIndex.indexOf(c)))){var _=n.getCellData(g[y]),C=p["default"].matchCase(_,n.matchCase);d["default"].has(this.opts,C,n.matchCase)||this.opts.push(_);var w=f[y];n.linkedFilters&&n.disableExcludedOptions&&(w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,n.matchCase)||d["default"].has(this.excludedOpts,C,n.matchCase)||n.isFirstLoad||this.excludedOpts.push(_))}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(n.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(v["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(T){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(T){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,r,n.separator),n.loadFltOnDemand&&(a.innerHTML=""),a.appendChild(r),a.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",n,t,a)}}},{key:"addChecks",value:function(t,e){for(var i=this,s=this.tf,n=this.addTChecks(t,e),l=0;l0?1:0),l=n+s.pagingLength-1<=e.nbVisibleRows?n+s.pagingLength-1:e.nbVisibleRows;i=n+this.fromToTextSeparator+l+this.overText+e.nbVisibleRows}}else i=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows;this.rowsCounterSpan.innerHTML=i,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,i)}}},{key:"destroy",value:function(){var t=this;this.initialized&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?u["default"].remove(this.rowsCounterDiv):u["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null,this.emitter.off(["after-filtering","grouped-by-page"],function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off(["rows-changed"],function(){return t.refresh()}),this.initialized=!1)}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i",i.btnPrevPageText=s.btn_prev_page_text||"<",i.btnLastPageText=s.btn_last_page_text||">|",i.btnFirstPageText=s.btn_first_page_text||"|<",i.btnNextPageHtml=s.btn_next_page_html||(t.enableIcons?'':null),i.btnPrevPageHtml=s.btn_prev_page_html||(t.enableIcons?'':null),i.btnFirstPageHtml=s.btn_first_page_html||(t.enableIcons?'':null),i.btnLastPageHtml=s.btn_last_page_html||(t.enableIcons?'':null),i.pageText=s.page_text||" Page ",i.ofText=s.of_text||" of ",i.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",i.hasPagingBtns=s.paging_btns===!1?!1:!0,i.pageSelectorType=s.page_selector_type||t.fltTypeSlc,i.onBeforeChangePage=c["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,i.onAfterChangePage=c["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,i.prfxSlcPages="slcPages_",i.prfxSlcResults="slcResults_",i.prfxSlcResultsTxt="slcResultsTxt_",i.prfxBtnNextSpan="btnNextSpan_",i.prfxBtnPrevSpan="btnPrevSpan_",i.prfxBtnLastSpan="btnLastSpan_",i.prfxBtnFirstSpan="btnFirstSpan_",i.prfxBtnNext="btnNext_",i.prfxBtnPrev="btnPrev_",i.prfxBtnLast="btnLast_",i.prfxBtnFirst="btnFirst_",i.prfxPgSpan="pgspan_",i.prfxPgBeforeSpan="pgbeforespan_",i.prfxPgAfterSpan="pgafterspan_";var n=t.refRow,r=t.nbRows;i.nbPages=Math.ceil((r-n)/i.pagingLength);var o=i;return i.evt={slcIndex:function(){return o.pageSelectorType===t.fltTypeSlc?o.pagingSlc.options.selectedIndex:parseInt(o.pagingSlc.value,10)-1},nbOpts:function(){return o.pageSelectorType===t.fltTypeSlc?parseInt(o.pagingSlc.options.length,10)-1:o.nbPages-1},next:function(){var t=o.evt.slcIndex()0?o.evt.slcIndex()-1:o.evt.nbOpts();o.changePage(t)},last:function(){o.changePage(o.evt.nbOpts())},first:function(){o.changePage(0)},_detectKey:function(e){var i=b["default"].keyCode(e);13===i&&(t.sorted?(t.filter(),o.changePage(o.evt.slcIndex())):o.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},i}return r(e,t),o(e,[{key:"init",value:function(){var t,e=this,i=this.tf,s=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),s.slcPagesChange=function(t){var i=t.target;e.changePage(i.selectedIndex)},this.pageSelectorType===i.fltTypeSlc&&(t=f["default"].create(i.fltTypeSlc,["id",this.prfxSlcPages+i.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",s.slcPagesChange)),this.pageSelectorType===i.fltTypeInp&&(t=f["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var n=f["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),l=f["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),a=f["default"].create("span",["id",this.prfxBtnLastSpan+i.id]),r=f["default"].create("span",["id",this.prfxBtnFirstSpan+i.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)n.innerHTML=this.btnNextPageHtml,b["default"].add(n,"click",s.next);else{var o=f["default"].create(i.fltTypeInp,["id",this.prfxBtnNext+i.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);o.className=this.btnPageCssClass,b["default"].add(o,"click",s.next),n.appendChild(o)}if(this.btnPrevPageHtml)l.innerHTML=this.btnPrevPageHtml,b["default"].add(l,"click",s.prev);else{var h=f["default"].create(i.fltTypeInp,["id",this.prfxBtnPrev+i.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",s.prev),l.appendChild(h)}if(this.btnLastPageHtml)a.innerHTML=this.btnLastPageHtml,b["default"].add(a,"click",s.last);else{var u=f["default"].create(i.fltTypeInp,["id",this.prfxBtnLast+i.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass, -b["default"].add(u,"click",s.last),a.appendChild(u)}if(this.btnFirstPageHtml)r.innerHTML=this.btnFirstPageHtml,b["default"].add(r,"click",s.first);else{var d=f["default"].create(i.fltTypeInp,["id",this.prfxBtnFirst+i.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);d.className=this.btnPageCssClass,b["default"].add(d,"click",s.first),r.appendChild(d)}}this.pagingTgtId||i.setToolbar();var c=this.pagingTgtId?f["default"].id(this.pagingTgtId):i.mDiv;c.appendChild(r),c.appendChild(l);var p=f["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);p.appendChild(f["default"].text(this.pageText)),p.className=this.nbPgSpanCssClass,c.appendChild(p),c.appendChild(t);var g=f["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(f["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,c.appendChild(g);var v=f["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(f["default"].text(" "+this.nbPages+" ")),c.appendChild(v),c.appendChild(n),c.appendChild(a),this.pagingSlc=f["default"].id(this.prfxSlcPages+i.id),i.rememberGridValues||this.setPagingInfo(),i.fltGrid||(i.validateAllRows(),this.setPagingInfo(i.validRowsIndex)),this.emitter.on(["after-filtering"],function(){return e.resetPagingInfo()}),this.emitter.on(["initialized"],function(){return e.resetValues()}),this.initialized=!0}}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;this.isEnabled()||(this.enable(),this.init(),t&&e.filter())}},{key:"resetPagingInfo",value:function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)}},{key:"setPagingInfo",value:function(t){var e=this.tf,i=this.pagingTgtId?f["default"].id(this.pagingTgtId):e.mDiv,s=f["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t||e.getValidRows(!0),this.nbPages=Math.ceil(e.validRowsIndex.length/this.pagingLength),s.innerHTML=this.nbPages,this.pageSelectorType===e.fltTypeSlc&&(this.pagingSlc.innerHTML=""),this.nbPages>0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var n=0;nl;l++){var r=e.validRowsIndex[l],o=i[r],h=o.getAttribute("validRow"),u=!1;l>=s&&n>l?(c["default"].isNull(h)||Boolean("true"===h))&&(o.style.display="",u=!0):o.style.display="none",this.emitter.emit("row-paged",e,r,l,u)}e.nbVisibleRows=e.validRowsIndex.length,this.emitter.emit("grouped-by-page",e,this)}},{key:"getPage",value:function(){return this.currentPageNb}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&this.isEnabled()){var i=this.evt,s="undefined"==typeof t?"undefined":n(t);if("string"===s)switch(g["default"].lower(t)){case"next":i.next();break;case"previous":i.prev();break;case"last":i.last();break;case"first":i.first();break;default:i.next()}else"number"===s&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,i=this.evt;if(!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var s=f["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var n=this.resultsPerPage[0],l=this.resultsPerPage[1],a=f["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);a.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var r=this.resultsPerPageTgtId?f["default"].id(this.resultsPerPageTgtId):e.rDiv;a.appendChild(f["default"].text(n));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(a,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(r.appendChild(a),r.appendChild(s));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.feature("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)),this.emitter.emit("after-changing-page",e,t))}},{key:"changeResultsPerPage",value:function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-changing-results-per-page",t);var e=this.resultsPerPageSlc,i=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*i,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var s=this.pagingSlc.options.length-1<=i?this.pagingSlc.options.length-1:i;this.pagingSlc.options[s].selected=!0}t.rememberPageLen&&t.feature("store").savePageLength(t.pgLenCookie)}this.emitter.emit("after-changing-results-per-page",t)}}},{key:"resetValues",value:function(){var t=this.tf;t.rememberPageLen&&this.resetPageLength(t.pgLenCookie),t.rememberPageNb&&this.resetPage(t.pgNbCookie)}},{key:"resetPage",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page",e);var i=e.feature("store").getPageNb(t);""!==i&&this.changePage(i-1),this.emitter.emit("after-reset-page",e,i)}}},{key:"resetPageLength",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page-length",e);var i=e.feature("store").getPageLength(t);""!==i&&(this.resultsPerPageSlc.options[i].selected=!0,this.changeResultsPerPage()),this.emitter.emit("after-reset-page-length",e,i)}}},{key:"destroy",value:function(){var t=this,e=this.tf;if(this.initialized){var i=f["default"].id(this.prfxBtnNextSpan+e.id),s=f["default"].id(this.prfxBtnPrevSpan+e.id),n=f["default"].id(this.prfxBtnLastSpan+e.id),l=f["default"].id(this.prfxBtnFirstSpan+e.id),a=f["default"].id(this.prfxPgBeforeSpan+e.id),r=f["default"].id(this.prfxPgAfterSpan+e.id),o=f["default"].id(this.prfxPgSpan+e.id),h=this.evt;this.pagingSlc&&(this.pageSelectorType===e.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===e.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",h._detectKey),f["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",h.next),f["default"].remove(i)),s&&(b["default"].remove(s,"click",h.prev),f["default"].remove(s)),n&&(b["default"].remove(n,"click",h.last),f["default"].remove(n)),l&&(b["default"].remove(l,"click",h.first),f["default"].remove(l)),a&&f["default"].remove(a),r&&f["default"].remove(r),o&&f["default"].remove(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.emitter.off(["after-filtering"],function(){return t.resetPagingInfo()}),this.emitter.off(["initialized"],function(){return t.resetValues()}),this.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}}}]),e}(h.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i':null),i.prfxResetSpan="resetspan_",i}return a(e,t),r(e,[{key:"onClick",value:function(){this.isEnabled()&&this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(!this.initialized){var i=u["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var s=this.btnResetTgtId?u["default"].id(this.btnResetTgtId):e.rDiv;if(s.appendChild(i),this.btnResetHtml){i.innerHTML=this.btnResetHtml;var n=i.firstChild;d["default"].add(n,"click",function(){t.onClick()})}else{var l=u["default"].create("a",["href","javascript:void(0);"]);l.className=e.btnResetCssClass,l.appendChild(u["default"].text(this.btnResetText)),i.appendChild(l),d["default"].add(l,"click",function(){t.onClick()})}this.btnResetEl=i.firstChild,this.initialized=!0}}},{key:"destroy",value:function(){var t=this.tf;if(this.initialized){var e=u["default"].id(this.prfxResetSpan+t.id);e&&u["default"].remove(e),this.btnResetEl=null,this.initialized=!1}}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',i.instrHtml=s.help_instructions_html||null,i.btnText=s.help_instructions_btn_text||"?",i.btnHtml=s.help_instructions_btn_html||null,i.btnCssClass=s.help_instructions_btn_css_class||"helpBtn",i.contCssClass=s.help_instructions_container_css_class||"helpCont",i.btn=null,i.cont=null,i.defaultHtml='

TableFilter v'+t.version+'

'+p+"
©2015-"+t.year+' Max Guglielmi
',i.prfxHelpSpan="helpSpan_",i.prfxHelpDiv="helpDiv_",i}return a(e,t),r(e,[{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf,i=u["default"].create("span",["id",this.prfxHelpSpan+e.id]),s=u["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var n=this.tgtId?u["default"].id(this.tgtId):e.rDiv;n.appendChild(i);var l=this.contTgtId?u["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var a=i.firstChild;d["default"].add(a,"click",function(){t.toggle()}),l.appendChild(s)}else{l.appendChild(s);var r=u["default"].create("a",["href","javascript:void(0);"]);r.className=this.btnCssClass,r.appendChild(u["default"].text(this.btnText)),i.appendChild(r),d["default"].add(r,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,d["default"].add(s,"click",function(){t.toggle()}),this.cont=s,this.btn=i,this.initialized=!0}}},{key:"toggle",value:function(){if(this.enabled!==!1){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}}},{key:"destroy",value:function(){this.initialized&&(u["default"].remove(this.btn),this.btn=null,this.cont&&(u["default"].remove(this.cont),this.cont=null,this.initialized=!1))}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;ia;a++){var r=i?a:e[a];this.setRowBg(r,l),l++}}},{key:"processRow",value:function(t,e,i){i?this.setRowBg(t,e):this.removeRowBg(t)}},{key:"setRowBg",value:function(t,e){if(this.isEnabled()&&!isNaN(t)){var i=this.tf.tbl.rows,s=isNaN(e)?t:e;this.removeRowBg(t),u["default"].addClass(i[t],s%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;u["default"].removeClass(e[t],this.oddCss),u["default"].removeClass(e[t],this.evenCss)}}},{key:"destroy",value:function(){var t=this;if(this.initialized){for(var e=this.tf.refRow;e0?this.hide():this.show()}},{key:"show",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,this),this.setWidth(),this.cont.style.display="block",this.onAfterShowMsg&&this.onAfterShowMsg.call(null,this.tf,this))}},{key:"hide",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this),this.cont.style.display="none",this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this))}},{key:"setWidth",value:function(){if(this.initialized&&!this.isExternal&&this.isEnabled())if(this.tf.gridLayout){var t=this.tf.feature("gridLayout");this.cont.style.width=t.tblCont.clientWidth+"px"}else this.cont.style.width=this.tf.tbl.clientWidth+"px"}},{key:"destroy",value:function(){var t=this;this.initialized&&(u["default"].remove(this.cont),this.cont=null,this.emitter.off(["after-filtering"],function(){return t.toggle()}),this.initialized=!1)}}]),e}(o.Feature)}])}); \ No newline at end of file +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,function(){return function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i=window.webpackJsonp;window.webpackJsonp=function(s,l){for(var a,r,o=0,h=[];oa;a++)s[a]=arguments[a];if(0!==s.length){if(this.id=null,this.version="0.1.6",this.year=(new Date).getFullYear(),this.tbl=null,this.startRow=null,this.refRow=null,this.headersRow=null,this.cfg={},this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this._hasGrid=!1,s.forEach(function(t){var i="undefined"==typeof t?"undefined":n(t);"object"===i&&t&&"TABLE"===t.nodeName?(e.tbl=t,e.id=t.id||"tf_"+(new Date).getTime()+"_"):"string"===i?(e.id=t,e.tbl=u["default"].id(t)):"number"===i?e.startRow=t:"object"===i&&(e.cfg=t)}),!this.tbl||"TABLE"!=this.tbl.nodeName||0===this.getRowsNb())throw new Error("Could not instantiate TableFilter: HTML table not found.");var r=this.cfg;this.emitter=new x.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(h){this.nbCells=this.getCellsNb(0)}this.basePath=r.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=r.grid===!1?!1:!0,this.gridLayout=Boolean(r.grid_layout),this.filtersRowIndex=isNaN(r.filters_row_index)?0:r.filters_row_index,this.headersRow=isNaN(r.headers_row_index)?0===this.filtersRowIndex?1:0:r.headers_row_index,this.fltCellTag="th"!==r.filters_cell_tag||"td"!==r.filters_cell_tag?"td":r.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.validRowsIndex=[],this.fltGridEl=null,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.infDivCssClass=r.inf_div_css_class||"inf",this.lDivCssClass=r.left_div_css_class||"ldiv",this.rDivCssClass=r.right_div_css_class||"rdiv",this.mDivCssClass=r.middle_div_css_class||"mdiv",this.contDivCssClass=r.content_div_css_class||"cont",this.stylePath=r.style_path||this.basePath+"style/",this.stylesheet=r.stylesheet||this.stylePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=r.flts_row_css_class||"fltrow",this.enableIcons=r.enable_icons===!1?!1:!0,this.alternateRows=Boolean(r.alternate_rows),this.hasColWidths=v["default"].isArray(r.col_widths),this.colWidths=this.hasColWidths?r.col_widths:null,this.fltCssClass=r.flt_css_class||"flt",this.fltMultiCssClass=r.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=r.flt_small_css_class||"flt_s",this.singleFltCssClass=r.single_flt_css_class||"single_flt",this.enterKey=r.enter_key===!1?!1:!0,this.onBeforeFilter=v["default"].isFn(r.on_before_filter)?r.on_before_filter:null,this.onAfterFilter=v["default"].isFn(r.on_after_filter)?r.on_after_filter:null,this.caseSensitive=Boolean(r.case_sensitive),this.hasExactMatchByCol=v["default"].isArray(r.columns_exact_match),this.exactMatchByCol=this.hasExactMatchByCol?r.columns_exact_match:[],this.exactMatch=Boolean(r.exact_match),this.linkedFilters=Boolean(r.linked_filters),this.disableExcludedOptions=Boolean(r.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasVisibleRows=Boolean(r.rows_always_visible),this.visibleRows=this.hasVisibleRows?r.rows_always_visible:[],this.isExternalFlt=Boolean(r.external_flt_grid),this.externalFltTgtIds=r.external_flt_grid_ids||[],this.externalFltEls=[],this.execDelay=isNaN(r.exec_delay)?100:parseInt(r.exec_delay,10),this.onFiltersLoaded=v["default"].isFn(r.on_filters_loaded)?r.on_filters_loaded:null,this.singleSearchFlt=Boolean(r.single_filter),this.onRowValidated=v["default"].isFn(r.on_row_validated)?r.on_row_validated:null,this.customCellDataCols=r.custom_cell_data_cols?r.custom_cell_data_cols:[],this.customCellData=v["default"].isFn(r.custom_cell_data)?r.custom_cell_data:null,this.watermark=r.watermark||"",this.isWatermarkArray=v["default"].isArray(this.watermark),this.toolBarTgtId=r.toolbar_target_id||null,this.help=v["default"].isUndef(r.help_instructions)?void 0:Boolean(r.help_instructions),this.popupFilters=Boolean(r.popup_filters),this.markActiveColumns=Boolean(r.mark_active_columns),this.activeColumnsCssClass=r.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=v["default"].isFn(r.on_before_active_column)?r.on_before_active_column:null,this.onAfterActiveColumn=v["default"].isFn(r.on_after_active_column)?r.on_after_active_column:null,this.displayAllText=r.display_all_text||"Clear",this.enableEmptyOption=Boolean(r.enable_empty_option),this.emptyText=r.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(r.enable_non_empty_option),this.nonEmptyText=r.non_empty_text||"(Non empty)",this.onSlcChange=r.on_change===!1?!1:!0,this.sortSlc=r.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(r.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?r.sort_num_asc:null,this.isSortNumDesc=Boolean(r.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?r.sort_num_desc:null,this.loadFltOnDemand=Boolean(r.load_filters_on_demand),this.hasCustomOptions=v["default"].isObj(r.custom_options),this.customOptions=r.custom_options,this.rgxOperator=r.regexp_operator||"rgx:",this.emOperator=r.empty_operator||"[empty]",this.nmOperator=r.nonempty_operator||"[nonempty]",this.orOperator=r.or_operator||"||",this.anOperator=r.and_operator||"&&",this.grOperator=r.greater_operator||">",this.lwOperator=r.lower_operator||"<",this.leOperator=r.lower_equal_operator||"<=",this.geOperator=r.greater_equal_operator||">=",this.dfOperator=r.different_operator||"!",this.lkOperator=r.like_operator||"*",this.eqOperator=r.equal_operator||"=",this.stOperator=r.start_with_operator||"{",this.enOperator=r.end_with_operator||"}",this.curExp=r.cur_exp||"^[¥£€$]",this.separator=r.separator||",",this.rowsCounter=Boolean(r.rows_counter),this.statusBar=Boolean(r.status_bar),this.loader=Boolean(r.loader),this.displayBtn=Boolean(r.btn),this.btnText=r.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=r.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(r.btn_reset),this.btnResetCssClass=r.btn_reset_css_class||"reset",this.onBeforeReset=v["default"].isFn(r.on_before_reset)?r.on_before_reset:null,this.onAfterReset=v["default"].isFn(r.on_after_reset)?r.on_after_reset:null,this.paging=Boolean(r.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.autoFilter=Boolean(r.auto_filter),this.autoFilterDelay=isNaN(r.auto_filter_delay)?900:r.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(r.highlight_keywords),this.noResults=v["default"].isObj(r.no_results_message)||Boolean(r.no_results_message),this.defaultDateType=r.default_date_type||"DMY",this.thousandsSeparator=r.thousands_separator||",",this.decimalSeparator=r.decimal_separator||".",this.hasColNbFormat=v["default"].isArray(r.col_number_format),this.colNbFormat=this.hasColNbFormat?r.col_number_format:null,this.hasColDateType=v["default"].isArray(r.col_date_type),this.colDateType=this.hasColDateType?r.col_date_type:null,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(r.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&r.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&r.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=r.extensions,this.hasExtensions=v["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(r.enable_default_theme),this.hasThemes=this.enableDefaultTheme||v["default"].isArray(r.themes),this.themes=r.themes||[],this.themesPath=r.themes_path||this.stylePath+"themes/",this.Mod={},this.ExtRegistry={},this.Evt={detectKey:function(t){if(this.enterKey&&t){var e=o["default"].keyCode(t);13===e?(this.filter(),o["default"].cancel(t),o["default"].stop(t)):(this.isUserTyping=!0,A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyUp:function(t){function e(){A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=o["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=A.setInterval(e.bind(this),this.autoFilterDelay)):(A.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,A.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},onInpFocus:function(t){var e=o["default"].target(t);this.activeFilterId=e.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.emitter.emit("filter-focus",this)}}}}return a(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(e.store||(e.store=new T.Store(this)),e.store.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new k.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new P.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new R.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new F.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;i>l;l++){this.emitter.emit("before-filter-init",this,l);var a=u["default"].create(this.fltCellTag),r=this.getFilterType(l);this.singleSearchFlt&&(a.colSpan=this.nbCells),this.gridLayout||n.appendChild(a),s=l==i-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(r=this.fltTypeInp,s=this.singleFltCssClass),r===this.fltTypeSlc||r===this.fltTypeMulti?(e.dropdown||(e.dropdown=new I.Dropdown(this)),e.dropdown.init(l,this.isExternalFlt,a)):r===this.fltTypeCheckList?(e.checkList||(e.checkList=new O.CheckList(this)),e.checkList.init(l,this.isExternalFlt,a)):this._buildInputFilter(l,s,a),l==i-1&&this.displayBtn&&this._buildSubmitButton(l,a),this.emitter.emit("after-filter-init",this,l)}}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new S.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new E.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new L.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new N.ClearButton(this),e.clearButton.init()),this.help&&(e.help||(e.help=new D.Help(this)),e.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new B.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new M.NoResults(this)),e.noResults.init()),this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||u["default"].addClass(this.tbl,this.prfxTf),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.emitter.emit("initialized",this)}}},{key:"_insertFiltersRow",value:function(){if(!this.gridLayout){var t=void 0,e=u["default"].tag(this.tbl,"thead");return t=e.length>0?e[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&this.headersRow++,t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}}},{key:"_initNoFilters",value:function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)}},{key:"_buildInputFilter",value:function(t,e,i){var s=this.getFilterType(t),n=this.isExternalFlt?this.externalFltTgtIds[t]:null,l=s===this.fltTypeInp?"text":"hidden",a=u["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",l],["ct",t]);"hidden"!==l&&this.watermark&&a.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),a.className=e||this.fltCssClass,o["default"].add(a,"focus",this.Evt.onInpFocus.bind(this)),n?(u["default"].id(n).appendChild(a),this.externalFltEls.push(a)):i.appendChild(a),this.fltIds.push(a.id),o["default"].add(a,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(a,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(a,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(a,"blur",this.Evt.onInpBlur.bind(this))}},{key:"_buildSubmitButton",value:function(t,e){var i=this,s=this.isExternalFlt?this.externalFltTgtIds[t]:null,n=u["default"].create(this.fltTypeInp,["id",this.prfxValButton+t+"_"+this.id],["type","button"],["value",this.btnText]);n.className=this.btnCssClass,s?u["default"].id(s).appendChild(n):e.appendChild(n),o["default"].add(n,"click",function(){return i.filter()})}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,l=void 0;s&&n?l=t.path+s:(s=s.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(26)("./"+l)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}}},{key:"extension",value:function(t){return this.ExtRegistry[t]}},{key:"hasExtension",value:function(t){return!v["default"].isEmpty(this.ExtRegistry[t])}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}}},{key:"loadThemes",value:function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(v["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],l=n.name,a=n.path,r=this.prfxTf+l;l&&!a?a=this.themesPath+l+"/"+l+".css":!l&&n.path&&(l="theme{0}".replace("{0}",i)),this.isImported(a,"link")||this["import"](r,a,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)}},{key:"getStylesheet",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return u["default"].id(this.prfxTf+t)}},{key:"destroy",value:function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod,s=this.emitter;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.markActiveColumns&&(this.clearActiveColumns(),s.off(["before-filtering"],function(){return t.clearActiveColumns()}),s.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions(),this.validateAllRows(),this.fltGrid&&!this.gridLayout&&(this.fltGridEl=e[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),s.emit("destroy",this),Object.keys(i).forEach(function(t){var e=i[t];e&&v["default"].isFn(e.destroy)&&e.destroy()}),this.hasVisibleRows&&s.off(["after-filtering"],function(){return t.enforceVisibility()}),this.linkedFilters&&s.off(["after-filtering"],function(){return t.linkFilters()}),u["default"].removeClass(this.tbl,this.prfxTf),this.nbHiddenRows=0,this.validRowsIndex=[],this.fltIds=[],this.activeFlt=null,this._hasGrid=!1}}},{key:"setToolbar",value:function(){if(!this.infDiv){var t=u["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)u["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.Mod.gridLayout;e.tblMainCont.appendChild(t),t.className=e.gridInfDivCssClass}else{var i=u["default"].create("caption");i.appendChild(t),this.tbl.insertBefore(i,this.tbl.firstChild)}this.infDiv=u["default"].id(this.prfxInfDiv+this.id);var s=u["default"].create("div",["id",this.prfxLDiv+this.id]);s.className=this.lDivCssClass,t.appendChild(s),this.lDiv=u["default"].id(this.prfxLDiv+this.id);var n=u["default"].create("div",["id",this.prfxRDiv+this.id]);n.className=this.rDivCssClass,t.appendChild(n),this.rDiv=u["default"].id(this.prfxRDiv+this.id);var l=u["default"].create("div",["id",this.prfxMDiv+this.id]);l.className=this.mDivCssClass,t.appendChild(l),this.mDiv=u["default"].id(this.prfxMDiv+this.id),v["default"].isUndef(this.help)&&(this.Mod.help||(this.Mod.help=new D.Help(this)),this.Mod.help.init(),this.help=!0)}}},{key:"removeToolbar",value:function(){if(this.infDiv){u["default"].remove(this.infDiv),this.infDiv=null;var t=this.tbl,e=u["default"].tag(t,"caption");e.length>0&&[].forEach.call(e,function(e){t.removeChild(e)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=u["default"].id(s);n&&(n.innerHTML="")}}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(!v["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],l=i.indexOf(t),a=e.values[l],r=e.texts[l],o=e.sorts[l],h=0,u=a.length;u>h;h++)n.push(a[h]),r[h]?s.push(r[h]):s.push(a[h]);return o&&(n.sort(),s.sort()),[n,s]}}},{key:"resetValues",value:function(){var t=this;if(this.rememberGridValues)if(this.loadFltOnDemand)this._resetGridValues(this.fltsValuesCookie);else{var e=this.Mod.store.getFilterValues(this.fltsValuesCookie);e.forEach(function(e,i){" "!==e&&t.setFilterValue(i,e)})}this.filter()}},{key:"_resetGridValues",value:function(t){if(this.loadFltOnDemand){var e=this.Mod.store.getFilterValues(t),i=this.getFiltersByType(this.fltTypeSlc,!0),s=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var n=0;nh;h++)""!==l[h]&&(a=u["default"].createOpt(l[h],l[h],!0),o.appendChild(a),this.hasStoredValues=!0)}}else if(r===this.fltTypeCheckList){var d=this.Mod.checkList,c=d.checkListDiv[n];c.title=c.innerHTML,c.innerHTML="";var p=u["default"].create("ul",["id",this.fltIds[n]],["colIndex",n]);p.className=d.checkListCssClass;var g=u["default"].createCheckItem(this.fltIds[n]+"_0","",this.displayAllText);g.className=d.checkListItemCssClass,p.appendChild(g),c.appendChild(p),l=e[n].split(" "+this.orOperator+" ");for(var h=0,f=l.length;f>h;h++)if(""!==l[h]){var v=u["default"].createCheckItem(this.fltIds[n]+"_"+(h+1),l[h],l[h]);v.className=d.checkListItemCssClass,p.appendChild(v),v.check.checked=!0,d.setCheckListValues(v.check),this.hasStoredValues=!0}}else r===this.fltTypeInp&&this.setFilterValue(n,e[n])}!this.hasStoredValues&&this.paging&&this.Mod.paging.setPagingInfo()}}}},{key:"filter",value:function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(p,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,"");var n=t;(r.test(t)||o.test(t)||h.test(t)||f.test(t)||c.test(t))&&(n=u["default"].getText(i)),""!==n&&s.highlightKeyword.highlight(i,n,s.highlightKeyword.highlightCssClass)}}function e(t,e,i){var s=void 0,n=w["default"].removeNbFormat,u=h.test(t),x=r.test(t),T=f.test(t),k=o.test(t),P=c.test(t),R=g.test(t),F=p.test(t),I=v.test(t),O=b.test(t),E=m===t,L=y===t,N=C.test(t),D=u&&_["default"].isValid(t.replace(h,""),S),B=x&&_["default"].isValid(t.replace(r,""),S),M=T&&_["default"].isValid(t.replace(f,""),S),A=k&&_["default"].isValid(t.replace(o,""),S),H=P&&_["default"].isValid(t.replace(c,""),S),j=R&&_["default"].isValid(t.replace(g,""),S),V=void 0,U=void 0;if(_["default"].isValid(e,S))V=_["default"].format(e,S),D?(U=_["default"].format(t.replace(h,""),S),s=U>V):B?(U=_["default"].format(t.replace(r,""),S),s=U>=V):A?(U=_["default"].format(t.replace(o,""),S),s=V>=U):M?(U=_["default"].format(t.replace(f,""),S),s=V>U):H?(U=_["default"].format(t.replace(c,""),S),s=V.toString()!=U.toString()):j?(U=_["default"].format(t.replace(g,""),S),s=V.toString()==U.toString()):p.test(t)?s=d["default"].contains(t.replace(p,""),e,!1,this.caseSensitive):_["default"].isValid(t,S)?(U=_["default"].format(t,S),s=V.toString()===U.toString()):s=E?d["default"].isEmpty(e):L?!d["default"].isEmpty(e):d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(l=n(e,this.colNbFormat[i]),a=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(l=n(e,"us"),a="us"):(l=n(e,"eu"),a="eu"),x)s=l<=n(t.replace(r,""),a);else if(k)s=l>=n(t.replace(o,""),a);else if(u)s=ln(t.replace(f,""),a);else if(P)s=d["default"].contains(t.replace(c,""),e,!1,this.caseSensitive)?!1:!0;else if(F)s=d["default"].contains(t.replace(p,""),e,!1,this.caseSensitive);else if(R)s=d["default"].contains(t.replace(g,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(v,""))?!0:!1;else if(O){var z=t.replace(b,"");s=e.lastIndexOf(z,e.length-1)===e.length-1-(z.length-1)&&e.lastIndexOf(z,e.length-1)>-1?!0:!1}else if(E)s=d["default"].isEmpty(e);else if(L)s=!d["default"].isEmpty(e);else if(N)try{var G=t.replace(C,""),W=new RegExp(G);s=W.test(e)}catch($){s=!1}else s=d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&this._hasGrid){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=this.Mod,n=0;this.validRowsIndex=[],this.searchArgs=this.getFiltersValue();for(var l,a,r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),h=new RegExp(this.lwOperator),f=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),p=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,y=this.nmOperator,C=new RegExp(d["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var O=this.searchArgs[this.singleSearchFlt?0:I],S=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==O){var E=d["default"].matchCase(this.getCellData(T[I]),this.caseSensitive),L=O.split(this.orOperator),N=L.length>1?!0:!1,D=O.split(this.anOperator),B=D.length>1?!0:!1;if(N||B){for(var M=void 0,A=!1,H=N?L:D,j=0,V=H.length;V>j&&(M=d["default"].trim(H[j]),A=e.call(this,M,E,I),t.call(this,M,A,T[I]),!N||!A)&&(!B||A);j++);P[I]=A}else P[I]=e.call(this,d["default"].trim(O),E,I),t.call(this,O,P[I],T[I]);P[I]||(R=!1),this.singleSearchFlt&&P[I]&&(F=!0),this.emitter.emit("cell-processed",this,I,T[I])}}this.singleSearchFlt&&F&&(R=!0),R?this.validateRow(x,!0):(this.validateRow(x,!1),n++),this.emitter.emit("row-processed",this,x,this.validRowsIndex.length,R)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=n,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this)}}},{key:"getColValues",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var a=this.refRow;a0&&(r=-1!=s.indexOf(a));var o=n[a].cells,h=o.length;if(h===this.nbCells&&!r)for(var u=0;h>u;u++)if(u==t&&""===n[a].style.display){var f=this.getCellData(o[u]),d=this.colNbFormat?this.colNbFormat[t]:null,c=i?w["default"].removeNbFormat(f,d):f;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,i=this.getFilterElement(t);if(!i)return"";var s=this.getFilterType(t);if(s!==this.fltTypeMulti&&s!==this.fltTypeCheckList)e=i.value;else if(s===this.fltTypeMulti){e="";for(var n=0,l=i.options.length;l>n;n++)i.options[n].selected&&(e=e.concat(i.options[n].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else s===this.fltTypeCheckList&&(null!==i.getAttribute("value")?(e=i.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,i=this.fltIds.length;i>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 i=[],s=0,n=this.fltIds.length;n>s;s++){var l=this.getFilterType(s);if(l===d["default"].lower(t)){var a=e?s:this.fltIds[s];i.push(a)}}return i}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return u["default"].id(e)}},{key:"getCellsNb",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=v["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)}},{key:"getCellData",value:function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):u["default"].getText(t)}},{key:"getTableData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.refRow;lo;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var u=this.getCellData(r[o]);a[1].push(u)}s.push(a)}return s}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.getValidRows(!0),a=0;an;n++){var a=i[n],r=a[1],o=r[t];s.push(o)}return s}},{key:"getRowDisplay",value:function(t){return v["default"].isObj(t)?t.style.display:null}},{key:"validateRow",value:function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;tl;l++){var r=i.options[l];(""===n||""===n[0])&&(r.selected=!1),""===r.value&&(r.selected=!1),""!==r.value&&m["default"].has(n,r.value,!0)&&(r.selected=!0)}else if(s===this.fltTypeCheckList){e=d["default"].matchCase(e,this.caseSensitive);var o=e.split(" "+this.orOperator+" "),h=u["default"].tag(i,"li").length;i.setAttribute("value",""),i.setAttribute("indexes","");for(var f=0;h>f;f++){var c=u["default"].tag(i,"li")[f],p=u["default"].tag(c,"label")[0],g=u["default"].tag(c,"input")[0],v=d["default"].matchCase(u["default"].getText(p),this.caseSensitive);""!==v&&m["default"].has(o,v,!0)?(g.checked=!0,this.Mod.checkList.setCheckListValues(g)):(g.checked=!1,this.Mod.checkList.setCheckListValues(g))}}}}},{key:"setColWidths",value:function(t,e){function i(){ +for(var t=this.nbCells,i=this.colWidths,s=u["default"].tag(e,"col"),n=s.length>0,l=n?null:H.createDocumentFragment(),a=0;t>a;a++){var r=void 0;n?r=s[a]:(r=u["default"].create("col",["id",this.id+"_col_"+a]),l.appendChild(r)),r.style.width=i[a]}n||e.insertBefore(l,e.firstChild)}if(this.fltGrid&&this.hasColWidths){e=e||this.tbl;var s=void 0;s=void 0===t?"none"!=e.rows[0].style.display?0:1:t,i.call(this)}}},{key:"enforceVisibility",value:function(){if(this.hasVisibleRows)for(var t=0,e=this.visibleRows.length;e>t;t++){var i=this.visibleRows[t];i<=this.nbRows&&this.validateRow(i,!0)}}},{key:"clearFilters",value:function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.rememberPageLen&&p["default"].remove(this.pgLenCookie),this.rememberPageNb&&p["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this),this.filter(),this.emitter.emit("after-clearing-filters",this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)u["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"markActiveColumn",value:function(t){var e=this.getHeaderElement(t);u["default"].hasClass(e,this.activeColumnsCssClass)||(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,t),u["default"].addClass(e,this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,t))}},{key:"linkFilters",value:function(){if(this.linkedFilters&&this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),i=this.getFiltersByType(this.fltTypeCheckList,!0),s=t.concat(e);s=s.concat(i);var n=this.activeFilterId.split("_")[0];n=n.split(this.prfxFlt)[1];for(var l=void 0,a=0,r=s.length;r>a;a++){var o=u["default"].id(this.fltIds[s[a]]);if(l=this.getFilterValue(s[a]),n!==s[a]||this.paging&&-1!=t.indexOf(s[a])&&n===s[a]||!this.paging&&(-1!=i.indexOf(s[a])||-1!=e.indexOf(s[a]))||l===this.displayAllText){if(-1!=i.indexOf(s[a])?this.Mod.checkList.checkListDiv[s[a]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var h=u["default"].createOpt(this.displayAllText,"");o&&o.appendChild(h)}-1!=i.indexOf(s[a])?this.Mod.checkList.build(s[a]):this.Mod.dropdown.build(s[a],!0),this.setFilterValue(s[a],l)}}}}},{key:"isExactMatch",value:function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp}},{key:"isImported",value:function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",l=u["default"].tag(H,s),a=0,r=l.length;r>a;a++)if(void 0!==l[a][n]&&l[a][n].match(t)){i=!0;break}return i}},{key:"import",value:function(t,e,i,s){var n=s?s:"script",l=this.isImported(e,n);if(!l){var a=this,r=!1,o=void 0,h=u["default"].tag(H,"head")[0];o="link"===d["default"].lower(n)?u["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):u["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){r||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(r=!0,"function"==typeof i&&i.call(null,a))},o.onerror=function(){throw new Error("TF script could not load: "+e)},h.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){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 n=0;n0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var l=s.indexOf(";",n);-1===l&&(l=s.length),e=unescape(s.substring(n,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var i=this.read(t),s=i.split(e);return s},getValueByIndex:function(t,e,i){i||(i=",");var s=this.valueToArray(t,i);return s[e]}}},function(t,e){"use strict";function i(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}Object.defineProperty(e,"__esModule",{value:!0});var s=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"===i(window[t])&&(e=!0):t&&"object"===("undefined"==typeof t?"undefined":i(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===s},isNull:function(t){return null===t},isEmpty:function(t){return this.isUndef(t)||this.isNull(t)||0===t.length}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={has:function(t,e,i){for(var s=void 0===i?!1:i,n=0;n2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||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 i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var l=t.split(RegExp.$1),a=void 0,r=void 0,o=void 0;a="M"===e.substring(0,1)?l[0]:"M"===e.substring(1,2)?l[1]:l[2],r="D"===e.substring(0,1)?l[0]:"D"===e.substring(1,2)?l[1]:l[2],o="Y"===e.substring(0,1)?l[0]:"Y"===e.substring(1,2)?l[1]:l[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(a,10)-1,parseInt(r,10),0,0,0,0);return parseInt(r,10)!=h.getDate()?!1:parseInt(a,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(l[2]),s(l[1])-1,l[0]);break;case"DMY":l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0]);break;case"MDY":l=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[0]-1,l[1]);break;case"YMD":l=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(l[0]),l[1]-1,l[2]);break;default:l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===l["default"].lower(e)?+i.replace(/[^\d\.-]/g,""):+i.replace(/[^\d\,-]/g,"").replace(",",".")}}}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(t,e){for(var i=0;i0&&s.removeChild(P[0]),this.headTbl.style.tableLayout="fixed",s.style.tableLayout="fixed",this.headTbl.cellPadding=s.cellPadding,this.headTbl.cellSpacing=s.cellSpacing,e.setColWidths(0,this.headTbl),s.style.width="",this.headTbl.style.width=s.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var i=p["default"].target(e),s=i.scrollLeft;t.headTblCont.scrollLeft=s});var R=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=g),this.tblHasColTag=u["default"].tag(s,"col").length>0?!0:!1;var F=function(){for(var t=e.nbCells-1;t>=0;t--){var i=u["default"].create("col",["id",e.id+"_col_"+t]);s.insertBefore(i,s.firstChild),i.style.width=e.colWidths[t],this.gridColElms[t]=i}this.tblHasColTag=!0};if(this.tblHasColTag)for(var I=u["default"].tag(s,"col"),O=0;O',e.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",e.onBeforePopUpOpen=u["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,e.onAfterPopUpOpen=u["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,e.onBeforePopUpClose=u["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,e.onAfterPopUpClose=u["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,e.popUpFltSpans=[],e.popUpFltImgs=[],e.popUpFltElms=e.popUpFltElmCache||[],e.popUpFltAdjustToContainer=!0,e.prfxPopUpSpan="popUpSpan_",e.prfxPopUpDiv="popUpDiv_",e}return a(i,e),r(i,[{key:"onClick",value:function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[n],a=this.tf.getHeaderElement(n),r=.95*a.clientWidth;l.style.width=parseInt(r,10)+"px"}p["default"].cancel(i),p["default"].stop(i)}},{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;iy;y++)if(t===y&&(!e||e&&n.disableExcludedOptions)||t==y&&e&&(""===r[g].style.display&&!n.paging||n.paging&&(!n.validRowsIndex||n.validRowsIndex&&-1!=n.validRowsIndex.indexOf(g))&&(void 0===h||h==t||h!=t&&-1!=n.validRowsIndex.indexOf(g)))){var _=n.getCellData(b[y]),C=p["default"].matchCase(_,o);if(d["default"].has(this.opts,C,o)||this.opts.push(_),e&&n.disableExcludedOptions){var w=c[y];w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,o)||d["default"].has(f,C,o)||f.push(_)}}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(o?(this.opts.sort(),f&&f.sort()):(this.opts.sort(v["default"].ignoreCase),f&&f.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),f&&f.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(T){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),f&&f.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(T){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,a,e,f),this.emitter.emit("after-populating-filter",n,t,a)}}},{key:"addOptions",value:function(t,e,i,s){var n=this.tf,l=p["default"].lower(this.slcFillingMethod),a=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var r=0;r"+h+""}else{var g=void 0;g=n.loadFltOnDemand&&a===this.opts[r]&&n.getFilterType(t)===n.fltTypeSlc?u["default"].createOpt(h,o,!0):u["default"].createOpt(h,o,!1),f&&(g.disabled=!0),e.appendChild(g)}}"innerhtml"===l&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,i=p["default"].lower(this.slcFillingMethod);if("innerhtml"===i)this.slcInnerHtml+='";else{var s=u["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(s.style.display="none"),t.appendChild(s),e.enableEmptyOption){var n=u["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(n)}if(e.enableNonEmptyOption){var l=u["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}},{key:"destroy",value:function(){}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={ignoreCase:function(t,e){var i=l["default"].lower(t),s=l["default"].lower(e);return s>i?-1:i>s?1:0}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;iy;y++)if(t===y&&(!n.linkedFilters||n.linkedFilters&&n.disableExcludedOptions)||t===y&&n.linkedFilters&&(""===o[c].style.display&&!n.paging||n.paging&&(!h||h===t||h!=t&&-1!=n.validRowsIndex.indexOf(c)))){var _=n.getCellData(g[y]),C=p["default"].matchCase(_,n.matchCase);d["default"].has(this.opts,C,n.matchCase)||this.opts.push(_);var w=f[y];n.linkedFilters&&n.disableExcludedOptions&&(w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,n.matchCase)||d["default"].has(this.excludedOpts,C,n.matchCase)||this.excludedOpts.push(_))}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(n.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(v["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(T){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(T){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,r,n.separator),n.loadFltOnDemand&&(a.innerHTML=""),a.appendChild(r),a.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",n,t,a)}}},{key:"addChecks",value:function(t,e){for(var i=this,s=this.tf,n=this.addTChecks(t,e),l=0;l0?1:0),l=n+s.pagingLength-1<=e.nbVisibleRows?n+s.pagingLength-1:e.nbVisibleRows;i=n+this.fromToTextSeparator+l+this.overText+e.nbVisibleRows}}else i=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows;this.rowsCounterSpan.innerHTML=i,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,i)}}},{key:"destroy",value:function(){var t=this;this.initialized&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?u["default"].remove(this.rowsCounterDiv):u["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null,this.emitter.off(["after-filtering","grouped-by-page"],function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off(["rows-changed"],function(){return t.refresh()}),this.initialized=!1)}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i",i.btnPrevPageText=s.btn_prev_page_text||"<",i.btnLastPageText=s.btn_last_page_text||">|",i.btnFirstPageText=s.btn_first_page_text||"|<",i.btnNextPageHtml=s.btn_next_page_html||(t.enableIcons?'':null),i.btnPrevPageHtml=s.btn_prev_page_html||(t.enableIcons?'':null),i.btnFirstPageHtml=s.btn_first_page_html||(t.enableIcons?'':null),i.btnLastPageHtml=s.btn_last_page_html||(t.enableIcons?'':null),i.pageText=s.page_text||" Page ",i.ofText=s.of_text||" of ",i.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",i.hasPagingBtns=s.paging_btns===!1?!1:!0,i.pageSelectorType=s.page_selector_type||t.fltTypeSlc,i.onBeforeChangePage=c["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,i.onAfterChangePage=c["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,i.prfxSlcPages="slcPages_",i.prfxSlcResults="slcResults_",i.prfxSlcResultsTxt="slcResultsTxt_",i.prfxBtnNextSpan="btnNextSpan_",i.prfxBtnPrevSpan="btnPrevSpan_",i.prfxBtnLastSpan="btnLastSpan_",i.prfxBtnFirstSpan="btnFirstSpan_",i.prfxBtnNext="btnNext_",i.prfxBtnPrev="btnPrev_",i.prfxBtnLast="btnLast_",i.prfxBtnFirst="btnFirst_",i.prfxPgSpan="pgspan_",i.prfxPgBeforeSpan="pgbeforespan_",i.prfxPgAfterSpan="pgafterspan_";var n=t.refRow,r=t.nbRows;i.nbPages=Math.ceil((r-n)/i.pagingLength);var o=i;return i.evt={slcIndex:function(){return o.pageSelectorType===t.fltTypeSlc?o.pagingSlc.options.selectedIndex:parseInt(o.pagingSlc.value,10)-1},nbOpts:function(){return o.pageSelectorType===t.fltTypeSlc?parseInt(o.pagingSlc.options.length,10)-1:o.nbPages-1},next:function(){var t=o.evt.slcIndex()0?o.evt.slcIndex()-1:o.evt.nbOpts();o.changePage(t)},last:function(){o.changePage(o.evt.nbOpts())},first:function(){o.changePage(0)},_detectKey:function(e){var i=b["default"].keyCode(e);13===i&&(t.sorted?(t.filter(),o.changePage(o.evt.slcIndex())):o.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},i}return r(e,t),o(e,[{key:"init",value:function(){var t,e=this,i=this.tf,s=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),s.slcPagesChange=function(t){var i=t.target;e.changePage(i.selectedIndex)},this.pageSelectorType===i.fltTypeSlc&&(t=f["default"].create(i.fltTypeSlc,["id",this.prfxSlcPages+i.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",s.slcPagesChange)),this.pageSelectorType===i.fltTypeInp&&(t=f["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var n=f["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),l=f["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),a=f["default"].create("span",["id",this.prfxBtnLastSpan+i.id]),r=f["default"].create("span",["id",this.prfxBtnFirstSpan+i.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)n.innerHTML=this.btnNextPageHtml,b["default"].add(n,"click",s.next);else{var o=f["default"].create(i.fltTypeInp,["id",this.prfxBtnNext+i.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);o.className=this.btnPageCssClass,b["default"].add(o,"click",s.next),n.appendChild(o)}if(this.btnPrevPageHtml)l.innerHTML=this.btnPrevPageHtml,b["default"].add(l,"click",s.prev);else{var h=f["default"].create(i.fltTypeInp,["id",this.prfxBtnPrev+i.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",s.prev),l.appendChild(h)}if(this.btnLastPageHtml)a.innerHTML=this.btnLastPageHtml,b["default"].add(a,"click",s.last);else{var u=f["default"].create(i.fltTypeInp,["id",this.prfxBtnLast+i.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,b["default"].add(u,"click",s.last),a.appendChild(u)}if(this.btnFirstPageHtml)r.innerHTML=this.btnFirstPageHtml,b["default"].add(r,"click",s.first);else{var d=f["default"].create(i.fltTypeInp,["id",this.prfxBtnFirst+i.id],["type","button"],["value",this.btnFirstPageText],["title","First"]); +d.className=this.btnPageCssClass,b["default"].add(d,"click",s.first),r.appendChild(d)}}this.pagingTgtId||i.setToolbar();var c=this.pagingTgtId?f["default"].id(this.pagingTgtId):i.mDiv;c.appendChild(r),c.appendChild(l);var p=f["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);p.appendChild(f["default"].text(this.pageText)),p.className=this.nbPgSpanCssClass,c.appendChild(p),c.appendChild(t);var g=f["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(f["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,c.appendChild(g);var v=f["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(f["default"].text(" "+this.nbPages+" ")),c.appendChild(v),c.appendChild(n),c.appendChild(a),this.pagingSlc=f["default"].id(this.prfxSlcPages+i.id),i.rememberGridValues||this.setPagingInfo(),i.fltGrid||(i.validateAllRows(),this.setPagingInfo(i.validRowsIndex)),this.emitter.on(["after-filtering"],function(){return e.resetPagingInfo()}),this.emitter.on(["initialized"],function(){return e.resetValues()}),this.initialized=!0}}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;this.isEnabled()||(this.enable(),this.init(),t&&e.filter())}},{key:"resetPagingInfo",value:function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)}},{key:"setPagingInfo",value:function(t){var e=this.tf,i=this.pagingTgtId?f["default"].id(this.pagingTgtId):e.mDiv,s=f["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t||e.getValidRows(!0),this.nbPages=Math.ceil(e.validRowsIndex.length/this.pagingLength),s.innerHTML=this.nbPages,this.pageSelectorType===e.fltTypeSlc&&(this.pagingSlc.innerHTML=""),this.nbPages>0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var n=0;nl;l++){var r=e.validRowsIndex[l],o=i[r],h=o.getAttribute("validRow"),u=!1;l>=s&&n>l?(c["default"].isNull(h)||Boolean("true"===h))&&(o.style.display="",u=!0):o.style.display="none",this.emitter.emit("row-paged",e,r,l,u)}e.nbVisibleRows=e.validRowsIndex.length,this.emitter.emit("grouped-by-page",e,this)}},{key:"getPage",value:function(){return this.currentPageNb}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&this.isEnabled()){var i=this.evt,s="undefined"==typeof t?"undefined":n(t);if("string"===s)switch(g["default"].lower(t)){case"next":i.next();break;case"previous":i.prev();break;case"last":i.last();break;case"first":i.first();break;default:i.next()}else"number"===s&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,i=this.evt;if(!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var s=f["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var n=this.resultsPerPage[0],l=this.resultsPerPage[1],a=f["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);a.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var r=this.resultsPerPageTgtId?f["default"].id(this.resultsPerPageTgtId):e.rDiv;a.appendChild(f["default"].text(n));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(a,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(r.appendChild(a),r.appendChild(s));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.feature("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)),this.emitter.emit("after-changing-page",e,t))}},{key:"changeResultsPerPage",value:function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-changing-results-per-page",t);var e=this.resultsPerPageSlc,i=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*i,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var s=this.pagingSlc.options.length-1<=i?this.pagingSlc.options.length-1:i;this.pagingSlc.options[s].selected=!0}t.rememberPageLen&&t.feature("store").savePageLength(t.pgLenCookie)}this.emitter.emit("after-changing-results-per-page",t)}}},{key:"resetValues",value:function(){var t=this.tf;t.rememberPageLen&&this.resetPageLength(t.pgLenCookie),t.rememberPageNb&&this.resetPage(t.pgNbCookie)}},{key:"resetPage",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page",e);var i=e.feature("store").getPageNb(t);""!==i&&this.changePage(i-1),this.emitter.emit("after-reset-page",e,i)}}},{key:"resetPageLength",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page-length",e);var i=e.feature("store").getPageLength(t);""!==i&&(this.resultsPerPageSlc.options[i].selected=!0,this.changeResultsPerPage()),this.emitter.emit("after-reset-page-length",e,i)}}},{key:"destroy",value:function(){var t=this,e=this.tf;if(this.initialized){var i=f["default"].id(this.prfxBtnNextSpan+e.id),s=f["default"].id(this.prfxBtnPrevSpan+e.id),n=f["default"].id(this.prfxBtnLastSpan+e.id),l=f["default"].id(this.prfxBtnFirstSpan+e.id),a=f["default"].id(this.prfxPgBeforeSpan+e.id),r=f["default"].id(this.prfxPgAfterSpan+e.id),o=f["default"].id(this.prfxPgSpan+e.id),h=this.evt;this.pagingSlc&&(this.pageSelectorType===e.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===e.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",h._detectKey),f["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",h.next),f["default"].remove(i)),s&&(b["default"].remove(s,"click",h.prev),f["default"].remove(s)),n&&(b["default"].remove(n,"click",h.last),f["default"].remove(n)),l&&(b["default"].remove(l,"click",h.first),f["default"].remove(l)),a&&f["default"].remove(a),r&&f["default"].remove(r),o&&f["default"].remove(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.emitter.off(["after-filtering"],function(){return t.resetPagingInfo()}),this.emitter.off(["initialized"],function(){return t.resetValues()}),this.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}}}]),e}(h.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i':null),i.prfxResetSpan="resetspan_",i}return a(e,t),r(e,[{key:"onClick",value:function(){this.isEnabled()&&this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(!this.initialized){var i=u["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var s=this.btnResetTgtId?u["default"].id(this.btnResetTgtId):e.rDiv;if(s.appendChild(i),this.btnResetHtml){i.innerHTML=this.btnResetHtml;var n=i.firstChild;d["default"].add(n,"click",function(){t.onClick()})}else{var l=u["default"].create("a",["href","javascript:void(0);"]);l.className=e.btnResetCssClass,l.appendChild(u["default"].text(this.btnResetText)),i.appendChild(l),d["default"].add(l,"click",function(){t.onClick()})}this.btnResetEl=i.firstChild,this.initialized=!0}}},{key:"destroy",value:function(){var t=this.tf;if(this.initialized){var e=u["default"].id(this.prfxResetSpan+t.id);e&&u["default"].remove(e),this.btnResetEl=null,this.initialized=!1}}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;i<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',i.instrHtml=s.help_instructions_html||null,i.btnText=s.help_instructions_btn_text||"?",i.btnHtml=s.help_instructions_btn_html||null,i.btnCssClass=s.help_instructions_btn_css_class||"helpBtn",i.contCssClass=s.help_instructions_container_css_class||"helpCont",i.btn=null,i.cont=null,i.defaultHtml='

TableFilter v'+t.version+'

'+p+"
©2015-"+t.year+' Max Guglielmi
',i.prfxHelpSpan="helpSpan_",i.prfxHelpDiv="helpDiv_",i}return a(e,t),r(e,[{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf,i=u["default"].create("span",["id",this.prfxHelpSpan+e.id]),s=u["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var n=this.tgtId?u["default"].id(this.tgtId):e.rDiv;n.appendChild(i);var l=this.contTgtId?u["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var a=i.firstChild;d["default"].add(a,"click",function(){t.toggle()}),l.appendChild(s)}else{l.appendChild(s);var r=u["default"].create("a",["href","javascript:void(0);"]);r.className=this.btnCssClass,r.appendChild(u["default"].text(this.btnText)),i.appendChild(r),d["default"].add(r,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,d["default"].add(s,"click",function(){t.toggle()}),this.cont=s,this.btn=i,this.initialized=!0}}},{key:"toggle",value:function(){if(this.enabled!==!1){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}}},{key:"destroy",value:function(){this.initialized&&(u["default"].remove(this.btn),this.btn=null,this.cont&&(u["default"].remove(this.cont),this.cont=null,this.initialized=!1))}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var r=function(){function t(t,e){for(var i=0;ia;a++){var r=i?a:e[a];this.setRowBg(r,l),l++}}},{key:"processRow",value:function(t,e,i){i?this.setRowBg(t,e):this.removeRowBg(t)}},{key:"setRowBg",value:function(t,e){if(this.isEnabled()&&!isNaN(t)){var i=this.tf.tbl.rows,s=isNaN(e)?t:e;this.removeRowBg(t),u["default"].addClass(i[t],s%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;u["default"].removeClass(e[t],this.oddCss),u["default"].removeClass(e[t],this.evenCss)}}},{key:"destroy",value:function(){var t=this;if(this.initialized){for(var e=0;e0?this.hide():this.show()}},{key:"show",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,this),this.setWidth(),this.cont.style.display="block",this.onAfterShowMsg&&this.onAfterShowMsg.call(null,this.tf,this))}},{key:"hide",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this),this.cont.style.display="none",this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this))}},{key:"setWidth",value:function(){if(this.initialized&&!this.isExternal&&this.isEnabled())if(this.tf.gridLayout){var t=this.tf.feature("gridLayout");this.cont.style.width=t.tblCont.clientWidth+"px"}else this.cont.style.width=this.tf.tbl.clientWidth+"px"}},{key:"destroy",value:function(){var t=this;this.initialized&&(u["default"].remove(this.cont),this.cont=null,this.emitter.off(["after-filtering"],function(){return t.toggle()}),this.initialized=!1)}}]),e}(o.Feature)}])}); \ No newline at end of file diff --git a/dist/tablefilter/tf-1.js b/dist/tablefilter/tf-1.js index 5942b0e5..693b9f5e 100644 --- a/dist/tablefilter/tf-1.js +++ b/dist/tablefilter/tf-1.js @@ -1,8 +1,8 @@ /** * tablefilter v0.1.6 by Max Guglielmi - * build date: 2016-01-14T08:30:34.759Z + * build date: 2016-01-14T10:08:13.903Z * MIT License */ -webpackJsonp([1],{26:function(e,t,n){function r(e){return n(s(e))}function s(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./array":6,"./array.js":6,"./cookie":4,"./cookie.js":4,"./date":7,"./date.js":7,"./dom":2,"./dom.js":2,"./emitter":9,"./emitter.js":9,"./event":1,"./event.js":1,"./extensions/advancedGrid/adapterEzEditTable":27,"./extensions/advancedGrid/adapterEzEditTable.js":27,"./extensions/advancedGrid/advancedGrid":28,"./extensions/advancedGrid/advancedGrid.js":28,"./extensions/colOps/colOps":29,"./extensions/colOps/colOps.js":29,"./extensions/colsVisibility/colsVisibility":30,"./extensions/colsVisibility/colsVisibility.js":30,"./extensions/filtersVisibility/filtersVisibility":31,"./extensions/filtersVisibility/filtersVisibility.js":31,"./extensions/sort/adapterSortabletable":32,"./extensions/sort/adapterSortabletable.js":32,"./extensions/sort/sort":33,"./extensions/sort/sort.js":33,"./helpers":8,"./helpers.js":8,"./modules/alternateRows":24,"./modules/alternateRows.js":24,"./modules/checkList":18,"./modules/checkList.js":18,"./modules/clearButton":22,"./modules/clearButton.js":22,"./modules/dropdown":16,"./modules/dropdown.js":16,"./modules/feature":12,"./modules/feature.js":12,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":23,"./modules/help.js":23,"./modules/highlightKeywords":14,"./modules/highlightKeywords.js":14,"./modules/loader":13,"./modules/loader.js":13,"./modules/noResults":25,"./modules/noResults.js":25,"./modules/paging":21,"./modules/paging.js":21,"./modules/popupFilter":15,"./modules/popupFilter.js":15,"./modules/rowsCounter":19,"./modules/rowsCounter.js":19,"./modules/statusBar":20,"./modules/statusBar.js":20,"./modules/store":10,"./modules/store.js":10,"./sort":17,"./sort.js":17,"./string":3,"./string.js":3,"./types":5,"./types.js":5};r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id=26},27:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0&&!n.startRow?void 0:n.startRow||t.refRow,n.base_path=n.base_path||t.basePath+"ezEditTable/";var s=n.editable,i=n.selection;i&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var l=0,a=0;if(i){var d=function(e,n,r){var s=e.Selection,i=function(r){if("row"===e.defaultSelection)s.SelectRowByIndex(r);else{e.ClearSelections();var i=n.cellIndex,l=t.tbl.rows[r];"both"===e.defaultSelection&&s.SelectRowByIndex(r),l&&s.SelectCell(l.cells[i])}if(t.validRowsIndex.length!==t.getRowsNb()){var o=t.tbl.rows[r];o&&o.scrollIntoView(!1),h&&(h.cellIndex===t.getCellsNb()-1&&t.gridLayout?t.tblCont.scrollLeft=1e8:0===h.cellIndex&&t.gridLayout?t.tblCont.scrollLeft=0:h.scrollIntoView(!1))}};if(t.validRowsIndex){var o,d=t.validRowsIndex,u=d.length,c="row"!==e.defaultSelection?n.parentNode:n,h="TD"===n.nodeName?n:null,f=void 0!==r?e.Event.GetKey(r):0,p=-1!==d.indexOf(c.rowIndex),b=t.feature("paging"),m=34===f||33===f?b&&b.pagingLength||e.nbRowsPerPage:1;if(p)34!==f&&33!==f?(l=d.indexOf(c.rowIndex),a=c.rowIndex):(o=34===f?u-1>=l+m?d[l+m]:[u-1]:l-m<=d[0]?d[0]:d[l-m],a=o,l=d.indexOf(o),i(o));else{if(c.rowIndex>a)if(c.rowIndex>=d[u-1])o=d[u-1];else{var g=l+m;o=g>u-1?d[u-1]:d[g]}else if(c.rowIndex<=d[0])o=d[0];else{var y=d[l-m];o=y?y:d[0]}a=c.rowIndex,i(o)}}},u=function(e,n){var r="row"!==e.defaultSelection?n.parentNode:n;if(t.paging&&t.feature("paging").nbPages>1){var s=t.feature("paging");e.nbRowsPerPage=s.pagingLength;var i=t.validRowsIndex,l=i.length,o=parseInt(s.startPagingRow,10)+parseInt(s.pagingLength,10),a=r.rowIndex;a===i[l-1]&&s.currentPageNb!==s.nbPages?s.setPage("last"):a==i[0]&&1!==s.currentPageNb?s.setPage("first"):a>i[o-1]&&ai[0]&&s.setPage("previous")}};if(t.paging&&(t.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid"),n=t._ezEditTable,r=n.Selection,s=r.GetActiveRow();s&&s.scrollIntoView(!1);var i=r.GetActiveCell();i&&i.scrollIntoView(!1)}),"row"===n.default_selection){var c=n.on_before_selected_row;n.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var h=n.on_after_selected_row;n.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),h&&h.call(null,arguments[0],arguments[1],arguments[2])}}else{var f=n.on_before_selected_cell;n.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])};var p=n.on_after_selected_cell;n.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])}}}if(s){var b=n.on_added_dom_row;if(n.on_added_dom_row=function(){t.nbFilterableRows++,t.paging?(t.nbRows++,t.nbVisibleRows++,t.nbFilterableRows++,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset()):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),b&&b.call(null,arguments[0],arguments[1],arguments[2])},n.actions&&n.actions["delete"]){var m=n.actions["delete"].on_after_submit;n.actions["delete"].on_after_submit=function(){t.nbFilterableRows--,t.paging?(t.nbRows--,t.nbVisibleRows--,t.nbFilterableRows--,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset(!1)):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(g){throw new Error(this.err)}this.initialized=!0}},{key:"reset",value:function(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())}},{key:"toggle",value:function(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()}},{key:"destroy",value:function(){var e=this,t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e.toggle()}),this.initialized=!1}}]),e}();t["default"]=a},28:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(27),i=r(s);t["default"]=i["default"]},29:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _typeof(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;n=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_string2["default"].lower("undefined"==typeof labelId?"undefined":_typeof(labelId))&&"object"==_string2["default"].lower("undefined"==typeof colIndex?"undefined":_typeof(colIndex))&&"object"==_string2["default"].lower("undefined"==typeof operation?"undefined":_typeof(operation)))for(var rows=tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(tf.getColValues(ucolIndex[ucol],!1,!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(_string2["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]?rows[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,tf)}}},{key:"destroy",value:function(){var e=this;this.tf.emitter.off(["after-filtering"],function(){return e.calc()})}}]),ColOps}();exports["default"]=ColOps},30:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0,this.onLoaded=d["default"].isFn(n.on_loaded)?n.on_loaded:null,this.onBeforeOpen=d["default"].isFn(n.on_before_open)?n.on_before_open:null,this.onAfterOpen=d["default"].isFn(n.on_after_open)?n.on_after_open:null,this.onBeforeClose=d["default"].isFn(n.on_before_close)?n.on_before_close:null,this.onAfterClose=d["default"].isFn(n.on_after_close)?n.on_after_close:null,this.onBeforeColHidden=d["default"].isFn(n.on_before_col_hidden)?n.on_before_col_hidden:null,this.onAfterColHidden=d["default"].isFn(n.on_after_col_hidden)?n.on_after_col_hidden:null,this.onBeforeColDisplayed=d["default"].isFn(n.on_before_col_displayed)?n.on_before_col_displayed:null,this.onAfterColDisplayed=d["default"].isFn(n.on_after_col_displayed)?n.on_after_col_displayed:null,t.gridLayout&&(this.headersTbl=t.feature("gridLayout").headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),t["import"](n.name+"Style",t.stylePath+this.stylesheet,null,"link"),this.tf=t}return i(e,[{key:"toggle",value:function(){var e=this.contEl.style.display,t=this.onBeforeOpen,n=this.onBeforeClose,r=this.onAfterOpen,s=this.onAfterClose;t&&"inline"!==e&&t.call(null,this),n&&"inline"===e&&n.call(null,this),this.contEl.style.display="inline"===e?"none":"inline",r&&"inline"!==e&&r.call(null,this),s&&"inline"===e&&s.call(null,this)}},{key:"checkItem",value:function(e){var t=e.parentNode;if(t&&e){var n=e.firstChild.checked,r=e.firstChild.getAttribute("id").split("_")[1];r=parseInt(r,10),n?o["default"].addClass(t,this.listSlcItemCssClass):o["default"].removeClass(t,this.listSlcItemCssClass);var s=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(s=!0),this.setHidden(r,s)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var e=this;if(!this.btnEl){var t=this.tf,n=o["default"].create("span",["id",this.prfx+t.id]);n.className=this.spanCssClass,this.btnTgtId||t.setToolbar();var r=this.btnTgtId?o["default"].id(this.btnTgtId):t.rDiv;if(this.btnTgtId)r.appendChild(n);else{var s=r.firstChild;s.parentNode.insertBefore(n,s)}if(this.btnHtml){n.innerHTML=this.btnHtml;var i=n.firstChild;this.enableHover?c["default"].add(i,"mouseover",function(t){e.toggle(t)}):c["default"].add(i,"click",function(t){e.toggle(t)})}else{var l=o["default"].create("a",["href","javascript:;"]);l.className=this.btnCssClass,l.title=this.desc,l.innerHTML=this.btnText,n.appendChild(l),this.enableHover?c["default"].add(l,"mouseover",function(t){e.toggle(t)}):c["default"].add(l,"click",function(t){e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var e=this,t=this.tf,n=this.contElTgtId?o["default"].id(this.contElTgtId):o["default"].create("div",["id",this.prfxCont+t.id]);n.className=this.contCssClass;var r=o["default"].create("p");r.innerHTML=this.text,n.appendChild(r);var s=o["default"].create("ul",["id","ul"+this.name+"_"+t.id]);s.className=this.listCssClass;var i=this.headersTbl?this.headersTbl:t.tbl,l=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),a=i.rows[l];if(this.enableTickAll){var d=o["default"].createCheckItem("col__"+t.id,this.tickAllText,this.tickAllText);o["default"].addClass(d,this.listItemCssClass),s.appendChild(d),d.check.checked=!this.tickToHide,c["default"].add(d.check,"click",function(){for(var e=0;e',this.icnCollapseHtml='Collapse filters',this.defaultText="Toggle filters",this.targetId=n.target_id||null,this.enableIcon=n.enable_icon===!1?!1:!0,this.btnText=n.btn_text||"",this.collapseBtnHtml=this.enableIcon?this.icnCollapseHtml+this.btnText:this.btnText||this.defaultText,this.expandBtnHtml=this.enableIcon?this.icnExpandHtml+this.btnText:this.btnText||this.defaultText,this.btnHtml=n.btn_html||null,this.btnCssClass=n.btn_css_class||"btnExpClpFlt",this.contCssClass=n.cont_css_class||"expClpFlt",this.filtersRowIndex=d["default"].isUndef(n.filters_row_index)?t.getFiltersRowIndex():n.filters_row_index,this.visibleAtStart=d["default"].isUndef(n.visible_at_start)?!0:Boolean(n.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=d["default"].isFn(n.on_before_show)?n.on_before_show:null,this.onAfterShow=d["default"].isFn(n.on_after_show)?n.on_after_show:null,this.onBeforeHide=d["default"].isFn(n.on_before_hide)?n.on_before_hide:null,this.onAfterHide=d["default"].isFn(n.on_after_hide)?n.on_after_hide:null,t["import"](n.name+"Style",t.stylePath+this.stylesheet,null,"link"),this.tf=t}return i(e,[{key:"init",value:function(){this.initialized||(this.buildUI(),this.initialized=!0)}},{key:"buildUI",value:function(){var e=this,t=this.tf,n=o["default"].create("span",["id",this.prfx+t.id]);n.className=this.contCssClass,this.targetId||t.setToolbar();var r=this.targetId?o["default"].id(this.targetId):t.rDiv;if(this.targetId)r.appendChild(n);else{var s=r.firstChild;s.parentNode.insertBefore(n,s)}var i=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,i=n.firstChild):(i=o["default"].create("a",["href","javascript:void(0);"]),i.className=this.btnCssClass,i.title=this.btnText||this.defaultText,i.innerHTML=this.collapseBtnHtml,n.appendChild(i)),c["default"].add(i,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=i,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function(){var e=this.tf,t=e.gridLayout?e.feature("gridLayout").headTbl:e.tbl,n=t.rows[this.filtersRowIndex],r=n.style.display;this.onBeforeShow&&""!==r&&this.onBeforeShow.call(this,this),this.onBeforeHide&&""===r&&this.onBeforeHide.call(null,this),n.style.display=""===r?"none":"",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=""===r?this.expandBtnHtml:this.collapseBtnHtml),this.onAfterShow&&""!==r&&this.onAfterShow.call(null,this),this.onAfterHide&&""===r&&this.onAfterHide.call(null,this)}},{key:"destroy",value:function(){(this.btnEl||this.contEl)&&(this.btnEl.innerHTML="",o["default"].remove(this.btnEl),this.btnEl=null,this.contEl.innerHTML="",o["default"].remove(this.contEl),this.contEl=null,this.initialized=!1)}}]),e}();t["default"]=h},32:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return S["default"].removeNbFormat(e,"us")}function l(e){return S["default"].removeNbFormat(e,"eu")}function o(e,t){return C["default"].format(e,t)}function a(e){return o(e,"DMY")}function d(e){return o(e,"MDY")}function u(e){return o(e,"YMD")}function c(e){return o(e,"DDMMMYYYY")}function h(e){var t=e.split(".");for(var n in t){for(var r=t[n];3>r.length;)r="0"+r;t[n]=r}return t.join(".")}function f(e,t){var n=h(e.value.toLowerCase()),r=h(t.value.toLowerCase());return n==r?0:r>n?-1:1}var p=function(){function e(e,t){for(var n=0;nr;r++);return r},SortableTable.prototype.initHeader=function(n){var r=this;if(!r.tHead){if(!t.gridLayout)return;r.tHead=t.feature("gridLayout").headTbl.tHead}r.headersRow=t.headersRow;var s=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var i=s.length,l=void 0,o=void 0,a=0;i>a;a++)o=s[a],null!==r.sortTypes[a]&&"None"!==r.sortTypes[a]?(o.style.cursor="pointer",l=y["default"].create("img",["src",e.imgPath+e.imgBlank]),o.appendChild(l),null!==r.sortTypes[a]&&o.setAttribute("_sortType",r.sortTypes[a]),T["default"].add(o,"click",r._headerOnclick)):(o.setAttribute("_sortType",n[a]),o._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=this,n=void 0,r=void 0,s=void 0;if(e.asyncSort&&e.triggerIds.length>0){var i=e.triggerIds;n=[],r=i.length;for(var l=0;lo;o++){var a=n[o].getAttribute("_sortType");null!==a&&"None"!==a&&(s=n[o].lastChild||n[o],"img"!==s.nodeName.toLowerCase()&&(s=y["default"].create("img",["src",e.imgPath+e.imgBlank]),n[o].appendChild(s)),o===t.sortColumn?s.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):s.className=e.imgClassName)}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this,s=r._sortTypeInfo[t];if(s&&s.getRowValue)return s.getRowValue(e,n);var i=e.cells[n],l=SortableTable.getInnerText(i);return r.getValueFromString(l,t)},SortableTable.getInnerText=function(t){return t?t.getAttribute(e.customKey)?t.getAttribute(e.customKey):y["default"].getText(t):void 0}}},{key:"addSortType",value:function(){var e=arguments;SortableTable.prototype.addSortType(e[0],e[1],e[2],e[3])}},{key:"setSortTypes",value:function(){for(var e=this,t=this.tf,n=this.sortTypes,r=[],s=0;s0&&!function(){for(var t=e.triggerIds,n=0;n descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.element = oTable;\r\n this.setTHead( oTable.tHead );\r\n this.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n if (this.tHead && this.tHead != oTHead )\r\n this.uninitHeader();\r\n this.tHead = oTHead;\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n this.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.sortTypes = oSortTypes || [];\r\n if ( this.tHead )\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var doc = this.tHead.ownerDocument || this.tHead.document;\r\n this.sortTypes = oSortTypes || [];\r\n var l = cells.length;\r\n var img, c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n img = doc.createElement("IMG");\r\n img.src = "images/blank.png";\r\n c.appendChild(img);\r\n if (this.sortTypes[i] != null)\r\n c._sortType = this.sortTypes[i];\r\n if (typeof c.addEventListener != "undefined")\r\n c.addEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.attachEvent != "undefined")\r\n c.attachEvent("onclick", this._headerOnclick);\r\n else\r\n c.onclick = this._headerOnclick;\r\n }\r\n else\r\n {\r\n c.setAttribute( "_sortType", oSortTypes[i] );\r\n c._sortType = "None";\r\n }\r\n }\r\n this.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (c._sortType != null && c._sortType != "None") {\r\n c.removeChild(c.lastChild);\r\n if (typeof c.removeEventListener != "undefined")\r\n c.removeEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.detachEvent != "undefined")\r\n c.detachEvent("onclick", this._headerOnclick);\r\n c._sortType = null;\r\n c.removeAttribute( "_sortType" );\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var img;\r\n for (var i = 0; i < l; i++) {\r\n if (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n img = cells[i].lastChild;\r\n if (i == this.sortColumn)\r\n img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n else\r\n img.className = "sort-arrow";\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n // find TD element\r\n var el = e.target || e.srcElement;\r\n while (el.tagName != "TD")\r\n el = el.parentNode;\r\n\r\n this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n var cells = oTd.parentNode.childNodes\r\n var l = cells.length;\r\n var i;\r\n for (i = 0; cells[i] != oTd && i < l; i++)\r\n ;\r\n return i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n return this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n if (!this.tBody) return;\r\n if (sSortType == null)\r\n sSortType = this.getSortType(nColumn);\r\n\r\n // exit if None\r\n if (sSortType == "None")\r\n return;\r\n\r\n if (bDescending == null) {\r\n if (this.sortColumn != nColumn)\r\n this.descending = this.defaultDescending;\r\n else\r\n this.descending = !this.descending;\r\n }\r\n else\r\n this.descending = bDescending;\r\n\r\n this.sortColumn = nColumn;\r\n\r\n if (typeof this.onbeforesort == "function")\r\n this.onbeforesort();\r\n\r\n var f = this.getSortFunction(sSortType, nColumn);\r\n var a = this.getCache(sSortType, nColumn);\r\n var tBody = this.tBody;\r\n\r\n a.sort(f);\r\n\r\n if (this.descending)\r\n a.reverse();\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // remove from doc\r\n var nextSibling = tBody.nextSibling;\r\n var p = tBody.parentNode;\r\n p.removeChild(tBody);\r\n }\r\n\r\n // insert in the new order\r\n var l = a.length;\r\n for (var i = 0; i < l; i++)\r\n tBody.appendChild(a[i].element);\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // insert into doc\r\n p.insertBefore(tBody, nextSibling);\r\n }\r\n\r\n this.updateHeaderArrows();\r\n\r\n this.destroyCache(a);\r\n\r\n if (typeof this.onsort == "function")\r\n this.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n var oThis = this;\r\n this._asyncsort = function () {\r\n oThis.sort(nColumn, bDescending, sSortType);\r\n };\r\n window.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n if (!this.tBody) return [];\r\n var rows = this.tBody.rows;\r\n var l = rows.length;\r\n var a = new Array(l);\r\n var r;\r\n for (var i = 0; i < l; i++) {\r\n r = rows[i];\r\n a[i] = {\r\n value: this.getRowValue(r, sType, nColumn),\r\n element: r\r\n };\r\n };\r\n return a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n var l = oArray.length;\r\n for (var i = 0; i < l; i++) {\r\n oArray[i].value = null;\r\n oArray[i].element = null;\r\n oArray[i] = null;\r\n }\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n // if we have defined a custom getRowValue use that\r\n if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n return this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n var s;\r\n var c = oRow.cells[nColumn];\r\n if (typeof c.innerText != "undefined")\r\n s = c.innerText;\r\n else\r\n s = SortableTable.getInnerText(c);\r\n return this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n var s = "";\r\n var cs = oNode.childNodes;\r\n var l = cs.length;\r\n for (var i = 0; i < l; i++) {\r\n switch (cs[i].nodeType) {\r\n case 1: //ELEMENT_NODE\r\n s += SortableTable.getInnerText(cs[i]);\r\n break;\r\n case 3: //TEXT_NODE\r\n s += cs[i].nodeValue;\r\n break;\r\n }\r\n }\r\n return s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].getValueFromString( sText );\r\n return sText;\r\n /*\r\n switch (sType) {\r\n case "Number":\r\n return Number(sText);\r\n case "CaseInsensitiveString":\r\n return sText.toUpperCase();\r\n case "Date":\r\n var parts = sText.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n }\r\n return sText;\r\n */\r\n };\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].compare;\r\n return SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n this.uninitHeader();\r\n var win = this.document.parentWindow;\r\n if (win && typeof win.detachEvent != "undefined") { // only IE needs this\r\n win.detachEvent("onunload", this._onunload);\r\n }\r\n this._onunload = null;\r\n this.element = null;\r\n this.tHead = null;\r\n this.tBody = null;\r\n this.document = null;\r\n this._headerOnclick = null;\r\n this.sortTypes = null;\r\n this._asyncsort = null;\r\n this.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n this._sortTypeInfo[sType] = {\r\n type: sType,\r\n getValueFromString: fGetValueFromString || SortableTable.idFunction,\r\n compare: fCompareFunction || SortableTable.basicCompare,\r\n getRowValue: fGetRowValue\r\n };\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n delete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n if (n1.value < n2.value)\r\n return -1;\r\n if (n2.value < n1.value)\r\n return 1;\r\n return 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n return x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n return s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n var parts = s.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'}}); \ No newline at end of file +webpackJsonp([1],{26:function(e,t,n){function r(e){return n(s(e))}function s(e){return i[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var i={"./array":6,"./array.js":6,"./cookie":4,"./cookie.js":4,"./date":7,"./date.js":7,"./dom":2,"./dom.js":2,"./emitter":9,"./emitter.js":9,"./event":1,"./event.js":1,"./extensions/advancedGrid/adapterEzEditTable":27,"./extensions/advancedGrid/adapterEzEditTable.js":27,"./extensions/advancedGrid/advancedGrid":28,"./extensions/advancedGrid/advancedGrid.js":28,"./extensions/colOps/colOps":29,"./extensions/colOps/colOps.js":29,"./extensions/colsVisibility/colsVisibility":30,"./extensions/colsVisibility/colsVisibility.js":30,"./extensions/filtersVisibility/filtersVisibility":31,"./extensions/filtersVisibility/filtersVisibility.js":31,"./extensions/sort/adapterSortabletable":32,"./extensions/sort/adapterSortabletable.js":32,"./extensions/sort/sort":33,"./extensions/sort/sort.js":33,"./helpers":8,"./helpers.js":8,"./modules/alternateRows":24,"./modules/alternateRows.js":24,"./modules/checkList":18,"./modules/checkList.js":18,"./modules/clearButton":22,"./modules/clearButton.js":22,"./modules/dropdown":16,"./modules/dropdown.js":16,"./modules/feature":12,"./modules/feature.js":12,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":23,"./modules/help.js":23,"./modules/highlightKeywords":14,"./modules/highlightKeywords.js":14,"./modules/loader":13,"./modules/loader.js":13,"./modules/noResults":25,"./modules/noResults.js":25,"./modules/paging":21,"./modules/paging.js":21,"./modules/popupFilter":15,"./modules/popupFilter.js":15,"./modules/rowsCounter":19,"./modules/rowsCounter.js":19,"./modules/statusBar":20,"./modules/statusBar.js":20,"./modules/store":10,"./modules/store.js":10,"./sort":17,"./sort.js":17,"./string":3,"./string.js":3,"./types":5,"./types.js":5};r.keys=function(){return Object.keys(i)},r.resolve=s,e.exports=r,r.id=26},27:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0&&!n.startRow?void 0:n.startRow||t.refRow,n.base_path=n.base_path||t.basePath+"ezEditTable/";var s=n.editable,i=n.selection;i&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var l=0,a=0;if(i){var d=function(e,n,r){var s=e.Selection,i=function(r){if("row"===e.defaultSelection)s.SelectRowByIndex(r);else{e.ClearSelections();var i=n.cellIndex,l=t.tbl.rows[r];"both"===e.defaultSelection&&s.SelectRowByIndex(r),l&&s.SelectCell(l.cells[i])}if(t.validRowsIndex.length!==t.getRowsNb()){var o=t.tbl.rows[r];o&&o.scrollIntoView(!1),h&&(h.cellIndex===t.getCellsNb()-1&&t.gridLayout?t.tblCont.scrollLeft=1e8:0===h.cellIndex&&t.gridLayout?t.tblCont.scrollLeft=0:h.scrollIntoView(!1))}};if(t.validRowsIndex){var o,d=t.validRowsIndex,u=d.length,c="row"!==e.defaultSelection?n.parentNode:n,h="TD"===n.nodeName?n:null,f=void 0!==r?e.Event.GetKey(r):0,p=-1!==d.indexOf(c.rowIndex),b=t.feature("paging"),m=34===f||33===f?b&&b.pagingLength||e.nbRowsPerPage:1;if(p)34!==f&&33!==f?(l=d.indexOf(c.rowIndex),a=c.rowIndex):(o=34===f?u-1>=l+m?d[l+m]:[u-1]:l-m<=d[0]?d[0]:d[l-m],a=o,l=d.indexOf(o),i(o));else{if(c.rowIndex>a)if(c.rowIndex>=d[u-1])o=d[u-1];else{var g=l+m;o=g>u-1?d[u-1]:d[g]}else if(c.rowIndex<=d[0])o=d[0];else{var y=d[l-m];o=y?y:d[0]}a=c.rowIndex,i(o)}}},u=function(e,n){var r="row"!==e.defaultSelection?n.parentNode:n;if(t.paging&&t.feature("paging").nbPages>1){var s=t.feature("paging");e.nbRowsPerPage=s.pagingLength;var i=t.validRowsIndex,l=i.length,o=parseInt(s.startPagingRow,10)+parseInt(s.pagingLength,10),a=r.rowIndex;a===i[l-1]&&s.currentPageNb!==s.nbPages?s.setPage("last"):a==i[0]&&1!==s.currentPageNb?s.setPage("first"):a>i[o-1]&&ai[0]&&s.setPage("previous")}};if(t.paging&&(t.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid"),n=t._ezEditTable,r=n.Selection,s=r.GetActiveRow();s&&s.scrollIntoView(!1);var i=r.GetActiveCell();i&&i.scrollIntoView(!1)}),"row"===n.default_selection){var c=n.on_before_selected_row;n.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var h=n.on_after_selected_row;n.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),h&&h.call(null,arguments[0],arguments[1],arguments[2])}}else{var f=n.on_before_selected_cell;n.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])};var p=n.on_after_selected_cell;n.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])}}}if(s){var b=n.on_added_dom_row;if(n.on_added_dom_row=function(){t.nbFilterableRows++,t.paging?(t.nbRows++,t.nbVisibleRows++,t.nbFilterableRows++,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset()):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),b&&b.call(null,arguments[0],arguments[1],arguments[2])},n.actions&&n.actions["delete"]){var m=n.actions["delete"].on_after_submit;n.actions["delete"].on_after_submit=function(){t.nbFilterableRows--,t.paging?(t.nbRows--,t.nbVisibleRows--,t.nbFilterableRows--,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset(!1)):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(g){throw new Error(this.err)}this.initialized=!0}},{key:"reset",value:function(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())}},{key:"toggle",value:function(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()}},{key:"destroy",value:function(){var e=this,t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e.toggle()}),this.initialized=!1}}]),e}();t["default"]=a},28:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var s=n(27),i=r(s);t["default"]=i["default"]},29:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _typeof(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var _createClass=function(){function e(e,t){for(var n=0;n=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_string2["default"].lower("undefined"==typeof labelId?"undefined":_typeof(labelId))&&"object"==_string2["default"].lower("undefined"==typeof colIndex?"undefined":_typeof(colIndex))&&"object"==_string2["default"].lower("undefined"==typeof operation?"undefined":_typeof(operation)))for(var rows=tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(tf.getColValues(ucolIndex[ucol],!1,!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(_string2["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]?rows[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,tf)}}},{key:"destroy",value:function(){var e=this;this.tf.emitter.off(["after-filtering"],function(){return e.calc()})}}]),ColOps}();exports["default"]=ColOps},30:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n0,this.onLoaded=d["default"].isFn(n.on_loaded)?n.on_loaded:null,this.onBeforeOpen=d["default"].isFn(n.on_before_open)?n.on_before_open:null,this.onAfterOpen=d["default"].isFn(n.on_after_open)?n.on_after_open:null,this.onBeforeClose=d["default"].isFn(n.on_before_close)?n.on_before_close:null,this.onAfterClose=d["default"].isFn(n.on_after_close)?n.on_after_close:null,this.onBeforeColHidden=d["default"].isFn(n.on_before_col_hidden)?n.on_before_col_hidden:null,this.onAfterColHidden=d["default"].isFn(n.on_after_col_hidden)?n.on_after_col_hidden:null,this.onBeforeColDisplayed=d["default"].isFn(n.on_before_col_displayed)?n.on_before_col_displayed:null,this.onAfterColDisplayed=d["default"].isFn(n.on_after_col_displayed)?n.on_after_col_displayed:null,t.gridLayout&&(this.headersTbl=t.feature("gridLayout").headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),t["import"](n.name+"Style",t.stylePath+this.stylesheet,null,"link"),this.tf=t}return i(e,[{key:"toggle",value:function(){var e=this.contEl.style.display,t=this.onBeforeOpen,n=this.onBeforeClose,r=this.onAfterOpen,s=this.onAfterClose;t&&"inline"!==e&&t.call(null,this),n&&"inline"===e&&n.call(null,this),this.contEl.style.display="inline"===e?"none":"inline",r&&"inline"!==e&&r.call(null,this),s&&"inline"===e&&s.call(null,this)}},{key:"checkItem",value:function(e){var t=e.parentNode;if(t&&e){var n=e.firstChild.checked,r=e.firstChild.getAttribute("id").split("_")[1];r=parseInt(r,10),n?o["default"].addClass(t,this.listSlcItemCssClass):o["default"].removeClass(t,this.listSlcItemCssClass);var s=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(s=!0),this.setHidden(r,s)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var e=this;if(!this.btnEl){var t=this.tf,n=o["default"].create("span",["id",this.prfx+t.id]);n.className=this.spanCssClass,this.btnTgtId||t.setToolbar();var r=this.btnTgtId?o["default"].id(this.btnTgtId):t.rDiv;if(this.btnTgtId)r.appendChild(n);else{var s=r.firstChild;s.parentNode.insertBefore(n,s)}if(this.btnHtml){n.innerHTML=this.btnHtml;var i=n.firstChild;this.enableHover?c["default"].add(i,"mouseover",function(t){e.toggle(t)}):c["default"].add(i,"click",function(t){e.toggle(t)})}else{var l=o["default"].create("a",["href","javascript:;"]);l.className=this.btnCssClass,l.title=this.desc,l.innerHTML=this.btnText,n.appendChild(l),this.enableHover?c["default"].add(l,"mouseover",function(t){e.toggle(t)}):c["default"].add(l,"click",function(t){e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var e=this,t=this.tf,n=this.contElTgtId?o["default"].id(this.contElTgtId):o["default"].create("div",["id",this.prfxCont+t.id]);n.className=this.contCssClass;var r=o["default"].create("p");r.innerHTML=this.text,n.appendChild(r);var s=o["default"].create("ul",["id","ul"+this.name+"_"+t.id]);s.className=this.listCssClass;var i=this.headersTbl?this.headersTbl:t.tbl,l=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),a=i.rows[l];if(this.enableTickAll){var d=o["default"].createCheckItem("col__"+t.id,this.tickAllText,this.tickAllText);o["default"].addClass(d,this.listItemCssClass),s.appendChild(d),d.check.checked=!this.tickToHide,c["default"].add(d.check,"click",function(){for(var e=0;e',this.icnCollapseHtml='Collapse filters',this.defaultText="Toggle filters",this.targetId=n.target_id||null,this.enableIcon=n.enable_icon===!1?!1:!0,this.btnText=n.btn_text||"",this.collapseBtnHtml=this.enableIcon?this.icnCollapseHtml+this.btnText:this.btnText||this.defaultText,this.expandBtnHtml=this.enableIcon?this.icnExpandHtml+this.btnText:this.btnText||this.defaultText,this.btnHtml=n.btn_html||null,this.btnCssClass=n.btn_css_class||"btnExpClpFlt",this.contCssClass=n.cont_css_class||"expClpFlt",this.filtersRowIndex=d["default"].isUndef(n.filters_row_index)?t.getFiltersRowIndex():n.filters_row_index,this.visibleAtStart=d["default"].isUndef(n.visible_at_start)?!0:Boolean(n.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=d["default"].isFn(n.on_before_show)?n.on_before_show:null,this.onAfterShow=d["default"].isFn(n.on_after_show)?n.on_after_show:null,this.onBeforeHide=d["default"].isFn(n.on_before_hide)?n.on_before_hide:null,this.onAfterHide=d["default"].isFn(n.on_after_hide)?n.on_after_hide:null,t["import"](n.name+"Style",t.stylePath+this.stylesheet,null,"link"),this.tf=t}return i(e,[{key:"init",value:function(){this.initialized||(this.buildUI(),this.initialized=!0)}},{key:"buildUI",value:function(){var e=this,t=this.tf,n=o["default"].create("span",["id",this.prfx+t.id]);n.className=this.contCssClass,this.targetId||t.setToolbar();var r=this.targetId?o["default"].id(this.targetId):t.rDiv;if(this.targetId)r.appendChild(n);else{var s=r.firstChild;s.parentNode.insertBefore(n,s)}var i=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,i=n.firstChild):(i=o["default"].create("a",["href","javascript:void(0);"]),i.className=this.btnCssClass,i.title=this.btnText||this.defaultText,i.innerHTML=this.collapseBtnHtml,n.appendChild(i)),c["default"].add(i,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=i,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function(){var e=this.tf,t=e.gridLayout?e.feature("gridLayout").headTbl:e.tbl,n=t.rows[this.filtersRowIndex],r=n.style.display;this.onBeforeShow&&""!==r&&this.onBeforeShow.call(this,this),this.onBeforeHide&&""===r&&this.onBeforeHide.call(null,this),n.style.display=""===r?"none":"",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=""===r?this.expandBtnHtml:this.collapseBtnHtml),this.onAfterShow&&""!==r&&this.onAfterShow.call(null,this),this.onAfterHide&&""===r&&this.onAfterHide.call(null,this)}},{key:"destroy",value:function(){(this.btnEl||this.contEl)&&(this.btnEl.innerHTML="",o["default"].remove(this.btnEl),this.btnEl=null,this.contEl.innerHTML="",o["default"].remove(this.contEl),this.contEl=null,this.initialized=!1)}}]),e}();t["default"]=h},32:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e){return S["default"].removeNbFormat(e,"us")}function l(e){return S["default"].removeNbFormat(e,"eu")}function o(e,t){return C["default"].format(e,t)}function a(e){return o(e,"DMY")}function d(e){return o(e,"MDY")}function u(e){return o(e,"YMD")}function c(e){return o(e,"DDMMMYYYY")}function h(e){var t=e.split(".");for(var n in t){for(var r=t[n];3>r.length;)r="0"+r;t[n]=r}return t.join(".")}function f(e,t){var n=h(e.value.toLowerCase()),r=h(t.value.toLowerCase());return n==r?0:r>n?-1:1}var p=function(){function e(e,t){for(var n=0;nr;r++);return r},SortableTable.prototype.initHeader=function(n){var r=this;if(!r.tHead){if(!t.gridLayout)return;r.tHead=t.feature("gridLayout").headTbl.tHead}r.headersRow=t.headersRow;var s=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var i=s.length,l=void 0,o=void 0,a=0;i>a;a++)o=s[a],null!==r.sortTypes[a]&&"None"!==r.sortTypes[a]?(o.style.cursor="pointer",l=y["default"].create("img",["src",e.imgPath+e.imgBlank]),o.appendChild(l),null!==r.sortTypes[a]&&o.setAttribute("_sortType",r.sortTypes[a]),T["default"].add(o,"click",r._headerOnclick)):(o.setAttribute("_sortType",n[a]),o._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=this,n=void 0,r=void 0,s=void 0;if(e.asyncSort&&e.triggerIds.length>0){var i=e.triggerIds;n=[],r=i.length;for(var l=0;lo;o++){var a=n[o].getAttribute("_sortType");null!==a&&"None"!==a&&(s=n[o].lastChild||n[o],"img"!==s.nodeName.toLowerCase()&&(s=y["default"].create("img",["src",e.imgPath+e.imgBlank]),n[o].appendChild(s)),o===t.sortColumn?s.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):s.className=e.imgClassName)}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this,s=r._sortTypeInfo[t];if(s&&s.getRowValue)return s.getRowValue(e,n);var i=e.cells[n],l=SortableTable.getInnerText(i);return r.getValueFromString(l,t)},SortableTable.getInnerText=function(t){return t?t.getAttribute(e.customKey)?t.getAttribute(e.customKey):y["default"].getText(t):void 0}}},{key:"addSortType",value:function(){var e=arguments;SortableTable.prototype.addSortType(e[0],e[1],e[2],e[3])}},{key:"setSortTypes",value:function(){for(var e=this,t=this.tf,n=this.sortTypes,r=[],s=0;s0&&!function(){for(var t=e.triggerIds,n=0;n descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.element = oTable;\r\n this.setTHead( oTable.tHead );\r\n this.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n if (this.tHead && this.tHead != oTHead )\r\n this.uninitHeader();\r\n this.tHead = oTHead;\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n this.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.sortTypes = oSortTypes || [];\r\n if ( this.tHead )\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var doc = this.tHead.ownerDocument || this.tHead.document;\r\n this.sortTypes = oSortTypes || [];\r\n var l = cells.length;\r\n var img, c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n img = doc.createElement("IMG");\r\n img.src = "images/blank.png";\r\n c.appendChild(img);\r\n if (this.sortTypes[i] != null)\r\n c._sortType = this.sortTypes[i];\r\n if (typeof c.addEventListener != "undefined")\r\n c.addEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.attachEvent != "undefined")\r\n c.attachEvent("onclick", this._headerOnclick);\r\n else\r\n c.onclick = this._headerOnclick;\r\n }\r\n else\r\n {\r\n c.setAttribute( "_sortType", oSortTypes[i] );\r\n c._sortType = "None";\r\n }\r\n }\r\n this.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (c._sortType != null && c._sortType != "None") {\r\n c.removeChild(c.lastChild);\r\n if (typeof c.removeEventListener != "undefined")\r\n c.removeEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.detachEvent != "undefined")\r\n c.detachEvent("onclick", this._headerOnclick);\r\n c._sortType = null;\r\n c.removeAttribute( "_sortType" );\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var img;\r\n for (var i = 0; i < l; i++) {\r\n if (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n img = cells[i].lastChild;\r\n if (i == this.sortColumn)\r\n img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n else\r\n img.className = "sort-arrow";\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n // find TD element\r\n var el = e.target || e.srcElement;\r\n while (el.tagName != "TD")\r\n el = el.parentNode;\r\n\r\n this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n var cells = oTd.parentNode.childNodes\r\n var l = cells.length;\r\n var i;\r\n for (i = 0; cells[i] != oTd && i < l; i++)\r\n ;\r\n return i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n return this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n if (!this.tBody) return;\r\n if (sSortType == null)\r\n sSortType = this.getSortType(nColumn);\r\n\r\n // exit if None\r\n if (sSortType == "None")\r\n return;\r\n\r\n if (bDescending == null) {\r\n if (this.sortColumn != nColumn)\r\n this.descending = this.defaultDescending;\r\n else\r\n this.descending = !this.descending;\r\n }\r\n else\r\n this.descending = bDescending;\r\n\r\n this.sortColumn = nColumn;\r\n\r\n if (typeof this.onbeforesort == "function")\r\n this.onbeforesort();\r\n\r\n var f = this.getSortFunction(sSortType, nColumn);\r\n var a = this.getCache(sSortType, nColumn);\r\n var tBody = this.tBody;\r\n\r\n a.sort(f);\r\n\r\n if (this.descending)\r\n a.reverse();\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // remove from doc\r\n var nextSibling = tBody.nextSibling;\r\n var p = tBody.parentNode;\r\n p.removeChild(tBody);\r\n }\r\n\r\n // insert in the new order\r\n var l = a.length;\r\n for (var i = 0; i < l; i++)\r\n tBody.appendChild(a[i].element);\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // insert into doc\r\n p.insertBefore(tBody, nextSibling);\r\n }\r\n\r\n this.updateHeaderArrows();\r\n\r\n this.destroyCache(a);\r\n\r\n if (typeof this.onsort == "function")\r\n this.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n var oThis = this;\r\n this._asyncsort = function () {\r\n oThis.sort(nColumn, bDescending, sSortType);\r\n };\r\n window.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n if (!this.tBody) return [];\r\n var rows = this.tBody.rows;\r\n var l = rows.length;\r\n var a = new Array(l);\r\n var r;\r\n for (var i = 0; i < l; i++) {\r\n r = rows[i];\r\n a[i] = {\r\n value: this.getRowValue(r, sType, nColumn),\r\n element: r\r\n };\r\n };\r\n return a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n var l = oArray.length;\r\n for (var i = 0; i < l; i++) {\r\n oArray[i].value = null;\r\n oArray[i].element = null;\r\n oArray[i] = null;\r\n }\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n // if we have defined a custom getRowValue use that\r\n if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n return this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n var s;\r\n var c = oRow.cells[nColumn];\r\n if (typeof c.innerText != "undefined")\r\n s = c.innerText;\r\n else\r\n s = SortableTable.getInnerText(c);\r\n return this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n var s = "";\r\n var cs = oNode.childNodes;\r\n var l = cs.length;\r\n for (var i = 0; i < l; i++) {\r\n switch (cs[i].nodeType) {\r\n case 1: //ELEMENT_NODE\r\n s += SortableTable.getInnerText(cs[i]);\r\n break;\r\n case 3: //TEXT_NODE\r\n s += cs[i].nodeValue;\r\n break;\r\n }\r\n }\r\n return s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].getValueFromString( sText );\r\n return sText;\r\n /*\r\n switch (sType) {\r\n case "Number":\r\n return Number(sText);\r\n case "CaseInsensitiveString":\r\n return sText.toUpperCase();\r\n case "Date":\r\n var parts = sText.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n }\r\n return sText;\r\n */\r\n };\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].compare;\r\n return SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n this.uninitHeader();\r\n var win = this.document.parentWindow;\r\n if (win && typeof win.detachEvent != "undefined") { // only IE needs this\r\n win.detachEvent("onunload", this._onunload);\r\n }\r\n this._onunload = null;\r\n this.element = null;\r\n this.tHead = null;\r\n this.tBody = null;\r\n this.document = null;\r\n this._headerOnclick = null;\r\n this.sortTypes = null;\r\n this._asyncsort = null;\r\n this.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n this._sortTypeInfo[sType] = {\r\n type: sType,\r\n getValueFromString: fGetValueFromString || SortableTable.idFunction,\r\n compare: fCompareFunction || SortableTable.basicCompare,\r\n getRowValue: fGetRowValue\r\n };\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n delete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n if (n1.value < n2.value)\r\n return -1;\r\n if (n2.value < n1.value)\r\n return 1;\r\n return 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n return x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n return s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n var parts = s.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'}}); \ No newline at end of file diff --git a/src/extensions/colOps/colOps.js b/src/extensions/colOps/colOps.js index 17fb63db..fb6badc1 100644 --- a/src/extensions/colOps/colOps.js +++ b/src/extensions/colOps/colOps.js @@ -46,7 +46,7 @@ export default class ColOps{ */ calc() { var tf = this.tf; - if(!tf.isFirstLoad && !tf.hasGrid()){ + if(!tf.hasGrid()){ return; } diff --git a/src/modules/alternateRows.js b/src/modules/alternateRows.js index 7abbeaf0..85e6f616 100644 --- a/src/modules/alternateRows.js +++ b/src/modules/alternateRows.js @@ -112,7 +112,7 @@ export class AlternateRows extends Feature { if(!this.initialized){ return; } - for(var i=this.tf.refRow; i this.unhighlightAll()); + this.emitter.on( + ['before-filtering', 'destroy'], + ()=> this.unhighlightAll() + ); } /** @@ -112,6 +115,9 @@ export class HighlightKeyword{ } destroy(){ - this.emitter.off(['before-filtering'], ()=> this.unhighlightAll()); + this.emitter.off( + ['before-filtering', 'destroy'], + ()=> this.unhighlightAll() + ); } } \ No newline at end of file diff --git a/src/modules/paging.js b/src/modules/paging.js index f6c50905..121219f5 100644 --- a/src/modules/paging.js +++ b/src/modules/paging.js @@ -497,9 +497,6 @@ export class Paging extends Feature{ var tf = this.tf; var evt = this.evt; - // if(!tf.hasGrid() && !tf.isFirstLoad){ - // return; - // } if(this.resultsPerPageSlc || !this.resultsPerPage){ return; } diff --git a/src/tablefilter.js b/src/tablefilter.js index 0d6f028b..aacbdf0a 100644 --- a/src/tablefilter.js +++ b/src/tablefilter.js @@ -123,8 +123,6 @@ export class TableFilter { this.validRowsIndex = []; //stores filters row element this.fltGridEl = null; - //is first load boolean - this.isFirstLoad = true; //container div for paging elements, reset btn etc. this.infDiv = null; //div for rows counter @@ -544,63 +542,58 @@ export class TableFilter { if(!this.fltGrid){ this._initNoFilters(); } else { - // if(this.isFirstLoad){ - let fltrow = this._insertFiltersRow(); + let fltrow = this._insertFiltersRow(); - this.nbFilterableRows = this.getRowsNb(); - this.nbVisibleRows = this.nbFilterableRows; - this.nbRows = this.tbl.rows.length; + this.nbFilterableRows = this.getRowsNb(); + this.nbVisibleRows = this.nbFilterableRows; + this.nbRows = this.tbl.rows.length; - // Generate filters - for(let i=0; i this.clearActiveColumns()); - this.emitter.off(['cell-processed'], + emitter.off(['before-filtering'], ()=> this.clearActiveColumns()); + emitter.off(['cell-processed'], (tf, colIndex)=> this.markActiveColumn(colIndex)); } if(this.hasExtensions){ this.destroyExtensions(); } - for(let j=this.refRow; j this.enforceVisibility()); + emitter.off(['after-filtering'], ()=> this.enforceVisibility()); } if(this.linkedFilters){ - this.emitter.off(['after-filtering'], ()=> this.linkFilters()); + emitter.off(['after-filtering'], ()=> this.linkFilters()); } Dom.removeClass(this.tbl, this.prfxTf); @@ -1272,7 +1267,7 @@ export class TableFilter { * TODO: Reduce complexity of this massive method */ filter(){ - if(!this.fltGrid || (!this._hasGrid && !this.isFirstLoad)){ + if(!this.fltGrid || !this._hasGrid){ return; } //invoke onbefore callback @@ -1981,8 +1976,7 @@ export class TableFilter { * @param {String} searcharg Search term */ setFilterValue(index, searcharg=''){ - if((!this.fltGrid && !this.isFirstLoad) || - !this.getFilterElement(index)){ + if(!this.fltGrid || !this.getFilterElement(index)){ return; } let slc = this.getFilterElement(index), diff --git a/test/test-highlight-keywords.js b/test/test-highlight-keywords.js index 98a9ae0c..b3276590 100644 --- a/test/test-highlight-keywords.js +++ b/test/test-highlight-keywords.js @@ -26,8 +26,18 @@ test('Highlighted keywords', function() { 0, 'Number of highlighted words'); }); +module('Reset feature'); +test('can destroy and init TableFilter', function() { + tf.destroy(); + tf.init(); + deepEqual(typeof highlightKeyword, 'object', 'Instanciated'); + deepEqual(highlightKeyword.highlightedNodes instanceof Array, + true, 'Property check'); +}); + module('Tear-down'); -test('can destroy TableFilter DOM elements', function() { +test('can destroy TableFilter DOM elements and clean highlighted words', + function() { tf.setFilterValue(1, 'Perth'); tf.filter(); tf.destroy();