From da9f8ad885a45c50f464617a5188e57b1ed4be30 Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Mon, 28 Dec 2015 17:53:03 +1100 Subject: [PATCH] Finalised unit tests, removed applyProps method in 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 | 8 +- src/modules/noResults.js | 14 ++ src/modules/paging.js | 15 +- src/modules/popupFilter.js | 9 ++ src/modules/store.js | 12 +- src/tablefilter.js | 88 ++++-------- test/test-always-visible-rows.js | 134 +++++++++--------- 15 files changed, 163 insertions(+), 145 deletions(-) diff --git a/dist/tablefilter/style/colsVisibility.css b/dist/tablefilter/style/colsVisibility.css index 4e442dd0..b65b0160 100644 --- a/dist/tablefilter/style/colsVisibility.css +++ b/dist/tablefilter/style/colsVisibility.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 a59ec73a..15eac1cd 100644 --- a/dist/tablefilter/style/filtersVisibility.css +++ b/dist/tablefilter/style/filtersVisibility.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 1d32167a..43d297fe 100644 --- a/dist/tablefilter/style/tablefilter.css +++ b/dist/tablefilter/style/tablefilter.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 f0e0365f..09154d01 100644 --- a/dist/tablefilter/style/themes/default/default.css +++ b/dist/tablefilter/style/themes/default/default.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 9454e65a..b3affa24 100644 --- a/dist/tablefilter/style/themes/mytheme/mytheme.css +++ b/dist/tablefilter/style/themes/mytheme/mytheme.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 1ae35fe4..6a9adbbd 100644 --- a/dist/tablefilter/style/themes/skyblue/skyblue.css +++ b/dist/tablefilter/style/themes/skyblue/skyblue.css @@ -1,6 +1,6 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.892Z + * build date: 2015-12-28T06:48:43.448Z * 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 e4438711..40298dca 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,10 +1,10 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.798Z + * build date: 2015-12-28T06:48:43.385Z * 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 s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var a=i[s]={exports:{},id:s,loaded:!1};return t[s].call(a.exports,a,a.exports,e),a.loaded=!0,a.exports}var s=window.webpackJsonp;window.webpackJsonp=function(i,l){for(var n,r,o=0,h=[];on;n++)i[n]=arguments[n];if(0!==i.length){if(this.id=null,this.version="0.1.0",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,i.forEach(function(t){var s="undefined"==typeof t?"undefined":a(t);"object"===s&&t&&"TABLE"===t.nodeName?(e.tbl=t,e.id=t.id||"tf_"+(new Date).getTime()+"_"):"string"===s?(e.id=t,e.tbl=u["default"].id(t)):"number"===s?e.startRow=t:"object"===s&&(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.gridLayout&&(this.headersRow>1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),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=null,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||null,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.msgFilter=r.msg_filter||"Filtering data...",this.msgPopulate=r.msg_populate||"Populating filter...",this.msgPopulateCheckList=r.msg_populate_checklist||"Populating list...",this.msgChangePage=r.msg_change_page||"Collecting paging data...",this.msgClear=r.msg_clear||"Clearing filters...",this.msgChangeResults=r.msg_change_results||"Changing results per page...",this.msgResetValues=r.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=r.msg_reset_page||"Re-setting page...",this.msgResetPageLength=r.msg_reset_page_length||"Re-setting page length...",this.msgSort=r.msg_sort||"Sorting data...",this.msgLoadExtensions=r.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=r.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(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={name:{filter:"Filter",dropdown:"DropDown",checklist:"CheckList",changepage:"ChangePage",clear:"Clear",changeresultsperpage:"ChangeResults",resetvalues:"ResetValues",resetpage:"ResetPage",resetpagelength:"ResetPageLength",loadextensions:"LoadExtensions",loadthemes:"LoadThemes"},detectKey:function(t){if(this.enterKey){var e=t||A.event;if(e){var s=o["default"].keyCode(e);13===s?(this.filter(),o["default"].cancel(e),o["default"].stop(e)):(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 s=t||A.event,i=o["default"].keyCode(s);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(){if(this.autoFilter&&(this.isUserTyping=!1,A.clearInterval(this.autoFilterTimer)),this.hasExtension("advancedGrid")){var t=this.extension("advancedGrid"),e=t._ezEditTable;t.cfg.editable&&e.Editable.Set(),t.cfg.selection&&e.Selection.Set()}},onInpFocus:function(t){var e=t||A.event,s=o["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.popupFilters&&(o["default"].cancel(e),o["default"].stop(e)),this.hasExtension("advancedGrid")){var i=this.extension("advancedGrid"),a=i._ezEditTable;i.cfg.editable&&a.Editable.Remove(),i.cfg.selection&&a.Selection.Remove()}},onSlcFocus:function(t){var e=t||A.event,s=o["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.loadFltOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Mod.dropdown._build(i)}this.popupFilters&&(o["default"].cancel(e),o["default"].stop(e))},onSlcChange:function(t){if(this.activeFlt){var e=t||A.event;this.popupFilters&&o["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||A.event,s=o["default"].target(e);if(this.loadFltOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Mod.checkList._build(i),this.Mod.checkList.checkListDiv[i].onclick=null,this.Mod.checkList.checkListDiv[i].title=""}}}}}return n(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){this.tbl||(this.tbl=u["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popupFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var e=this.Mod,s=this.singleSearchFlt?1:this.nbCells,i=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(e.store=new k.Store(this)),this.gridLayout&&(e.gridLayout=new T.GridLayout(this),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new R.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new F.HighlightKeyword(this)),this.popupFilters&&(e.popupFilter||(e.popupFilter=new P.PopupFilter(this)),e.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var a=void 0;if(!this.gridLayout){var l=u["default"].tag(this.tbl,"thead");a=l.length>0?l[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popupFilters&&this.headersRow++,this.popupFilters&&this.headersRow++,a.className=this.fltsRowCssClass,(this.isExternalFlt||this.popupFilters)&&(a.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var n=0;s>n;n++){this.popupFilters&&e.popupFilter.build(n);var r=u["default"].create(this.fltCellTag),h=this.getFilterType(n),d=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[n]:null;if(this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||a.appendChild(r),i=n==s-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(h=this.fltTypeInp,i=this.singleFltCssClass),h===this.fltTypeSlc||h===this.fltTypeMulti){e.dropdown||(e.dropdown=new I.Dropdown(this));var c=e.dropdown,p=u["default"].create(this.fltTypeSlc,["id",this.prfxFlt+n+"_"+this.id],["ct",n],["filled","0"]);if(h===this.fltTypeMulti&&(p.multiple=this.fltTypeMulti,p.title=c.multipleSlcTooltip),p.className=f["default"].lower(h)===this.fltTypeSlc?i:this.fltMultiCssClass,d?(u["default"].id(d).appendChild(p),this.externalFltEls.push(p)):r.appendChild(p),this.fltIds.push(this.prfxFlt+n+"_"+this.id),this.loadFltOnDemand||c._build(n),o["default"].add(p,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(p,"change",this.Evt.onSlcChange.bind(this)),o["default"].add(p,"focus",this.Evt.onSlcFocus.bind(this)),this.loadFltOnDemand){var g=u["default"].createOpt(this.displayAllText,"");p.appendChild(g)}}else if(h===this.fltTypeCheckList){var v=void 0;e.checkList=new S.CheckList(this),v=e.checkList;var b=u["default"].create("div",["id",v.prfxCheckListDiv+n+"_"+this.id],["ct",n],["filled","0"]);b.className=v.checkListDivCssClass,d?(u["default"].id(d).appendChild(b),this.externalFltEls.push(b)):r.appendChild(b),v.checkListDiv[n]=b,this.fltIds.push(this.prfxFlt+n+"_"+this.id),this.loadFltOnDemand||v._build(n),this.loadFltOnDemand&&(o["default"].add(b,"click",this.Evt.onCheckListClick.bind(this)),b.appendChild(u["default"].text(v.activateCheckListTxt)))}else{var m=h===this.fltTypeInp?"text":"hidden",_=u["default"].create(this.fltTypeInp,["id",this.prfxFlt+n+"_"+this.id],["type",m],["ct",n]);if("hidden"!==m&&this.watermark&&_.setAttribute("placeholder",this.isWatermarkArray?this.watermark[n]||"":this.watermark),_.className=i,o["default"].add(_,"focus",this.Evt.onInpFocus.bind(this)),d?(u["default"].id(d).appendChild(_),this.externalFltEls.push(_)):r.appendChild(_),this.fltIds.push(this.prfxFlt+n+"_"+this.id),o["default"].add(_,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(_,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(_,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(_,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var y=this.Mod.store.getFilterValues(this.fltsValuesCookie);" "!=y[n]&&this.setFilterValue(n,y[n],!1)}}if(n==s-1&&this.displayBtn){var C=u["default"].create(this.fltTypeInp,["id",this.prfxValButton+n+"_"+this.id],["type","button"],["value",this.btnText]);C.className=this.btnCssClass,d?u["default"].id(d).appendChild(C):r.appendChild(C),o["default"].add(C,"click",function(){return t.filter()})}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.hasVisibleRows&&this.enforceVisibility(),this.rowsCounter&&(e.rowsCounter=new O.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new E.StatusBar(this),e.statusBar.init()),(this.paging||e.paging)&&(e.paging||(e.paging=new L.Paging(this),e.paging.init()),e.paging.reset()),this.btnReset&&(e.clearButton=new M.ClearButton(this),e.clearButton.init()),this.help&&(e.help||(e.help=new N.Help(this)),e.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new D.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new B.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.loader&&e.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.emitter.emit("initialized",this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?r.dropdown._build(i,!0):r.dropdown._build(i,!1,a,l);break;case e.checklist:r.checkList._build(i,a,l);break;case e.changepage:r.paging._changePage(n);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:r.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:r.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:r.paging._resetPageLength(this.pgLenCookie);break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&r.statusBar.message(""),this.loader&&r.loader.show("none")}var s=arguments.length<=1||void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,a=s.slcExternal,l=s.slcId,n=s.pgIndex,r=this.Mod;this.loader||this.statusBar||this.linkedFilters?(this.loader&&r.loader.show(""),this.statusBar&&r.statusBar.message(this["msg"+t]),A.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,a=t.path,l=void 0;i&&a?l=t.path+i:(i=i.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,i)),s.p=this.basePath,s.e(1,function(s){var a=[s(26)("./"+l)];(function(s){var a=new s["default"](e,t);a.init(),e.ExtRegistry[i]=a}).apply(null,a)})}}},{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,s=t.length;s>e;e++){var i=t[e],a=this.ExtRegistry[i.name];a&&(a.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(v["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var a=t[s],l=a.name,n=a.path,r=this.prfxTf+l;l&&!n?n=this.themesPath+l+"/"+l+".css":!l&&a.path&&(l="theme{0}".replace("{0}",s)),this.isImported(n,"link")||this["import"](r,n,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},{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(){if(this._hasGrid){var t=this.tbl.rows,e=this.Mod;this._clearFilters(),this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;s0&&[].forEach.call(e,function(e){t.removeChild(e)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt&&this.externalFltTgtIds)for(var t=this.externalFltTgtIds,e=t.length,s=0;e>s;s++){var i=t[s],a=u["default"].id(i);a&&(a.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,s=e.cols,i=[],a=[],l=s.indexOf(t),n=e.values[l],r=e.texts[l],o=e.sorts[l],h=0,u=n.length;u>h;h++)a.push(n[h]),r[h]?i.push(r[h]):i.push(n[h]);return o&&(a.sort(),i.sort()),[a,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.loadFltOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Mod.paging&&this.Mod.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Mod.paging&&this.Mod.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.loadFltOnDemand){var e=this.Mod.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var a=0;ah;h++)""!==l[h]&&(n=u["default"].createOpt(l[h],l[h],!0),o.appendChild(n),this.hasStoredValues=!0)}}else if(r===this.fltTypeCheckList){var f=this.Mod.checkList,c=f.checkListDiv[a];c.title=c.innerHTML,c.innerHTML="";var p=u["default"].create("ul",["id",this.fltIds[a]],["colIndex",a]);p.className=f.checkListCssClass;var g=u["default"].createCheckItem(this.fltIds[a]+"_0","",this.displayAllText);g.className=f.checkListItemCssClass,p.appendChild(g),c.appendChild(p),l=e[a].split(" "+this.orOperator+" ");for(var h=0,d=l.length;d>h;h++)if(""!==l[h]){var v=u["default"].createCheckItem(this.fltIds[a]+"_"+(h+1),l[h],l[h]);v.className=f.checkListItemCssClass,p.appendChild(v),v.check.checked=!0,f.setCheckListValues(v.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Mod.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{key:"_filter",value:function(){function t(t,e,s){if(this.highlightKeywords&&e){t=t.replace(p,""),t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,"");var a=t;(r.test(t)||o.test(t)||h.test(t)||d.test(t)||c.test(t))&&(a=u["default"].getText(s)),""!==a&&i.highlightKeyword.highlight(s,a,i.highlightKeyword.highlightCssClass)}}function e(t,e,s){var i=void 0,a=w["default"].removeNbFormat,u=h.test(t),x=r.test(t),k=d.test(t),T=o.test(t),R=c.test(t),F=g.test(t),P=p.test(t),I=v.test(t),S=b.test(t),E=m===t,L=_===t,M=C.test(t),N=u&&y["default"].isValid(t.replace(h,""),O),D=x&&y["default"].isValid(t.replace(r,""),O),B=k&&y["default"].isValid(t.replace(d,""),O),A=T&&y["default"].isValid(t.replace(o,""),O),H=R&&y["default"].isValid(t.replace(c,""),O),j=F&&y["default"].isValid(t.replace(g,""),O),V=void 0,U=void 0;if(y["default"].isValid(e,O))V=y["default"].format(e,O),N?(U=y["default"].format(t.replace(h,""),O),i=U>V):D?(U=y["default"].format(t.replace(r,""),O),i=U>=V):A?(U=y["default"].format(t.replace(o,""),O),i=V>=U):B?(U=y["default"].format(t.replace(d,""),O),i=V>U):H?(U=y["default"].format(t.replace(c,""),O),i=V.toString()!=U.toString()):j?(U=y["default"].format(t.replace(g,""),O),i=V.toString()==U.toString()):p.test(t)?i=f["default"].contains(t.replace(p,""),e,!1,this.caseSensitive):y["default"].isValid(t,O)?(U=y["default"].format(t,O),i=V.toString()===U.toString()):i=E?f["default"].isEmpty(e):L?!f["default"].isEmpty(e):f["default"].contains(t,e,this.isExactMatch(s),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[s]?(l=a(e,this.colNbFormat[s]),n=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(l=a(e,"us"),n="us"):(l=a(e,"eu"),n="eu"),x)i=l<=a(t.replace(r,""),n);else if(T)i=l>=a(t.replace(o,""),n);else if(u)i=la(t.replace(d,""),n);else if(R)i=f["default"].contains(t.replace(c,""),e,!1,this.caseSensitive)?!1:!0;else if(P)i=f["default"].contains(t.replace(p,""),e,!1,this.caseSensitive);else if(F)i=f["default"].contains(t.replace(g,""),e,!0,this.caseSensitive);else if(I)i=0===e.indexOf(t.replace(v,""))?!0:!1;else if(S){var G=t.replace(b,"");i=e.lastIndexOf(G,e.length-1)===e.length-1-(G.length-1)&&e.lastIndexOf(G,e.length-1)>-1?!0:!1}else if(E)i=f["default"].isEmpty(e);else if(L)i=!f["default"].isEmpty(e);else if(M)try{var z=t.replace(C,""),W=new RegExp(z);i=W.test(e)}catch($){i=!1}else i=f["default"].contains(t,e,this.isExactMatch(s),this.caseSensitive);return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var s=this.tbl.rows,i=this.Mod,a=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popupFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var l,n,r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),h=new RegExp(this.lwOperator),d=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),p=new RegExp(f["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),b=new RegExp(this.enOperator),m=this.emOperator,_=this.nmOperator,C=new RegExp(f["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var S=this.searchArgs[this.singleSearchFlt?0:I],O=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==S){var E=f["default"].matchCase(this.getCellData(k[I]),this.caseSensitive),L=S.split(this.orOperator),M=L.length>1?!0:!1,N=S.split(this.anOperator),D=N.length>1?!0:!1;if(M||D){for(var B=void 0,A=!1,H=M?L:N,j=0,V=H.length;V>j&&(B=f["default"].trim(H[j]),A=e.call(this,B,E,I),t.call(this,B,A,k[I]),!M||!A)&&(!D||A);j++);R[I]=A}else R[I]=e.call(this,f["default"].trim(S),E,I),t.call(this,S,R[I],k[I]);R[I]||(F=!1),this.singleSearchFlt&&R[I]&&(P=!0),this.popupFilters&&i.popupFilter.buildIcon(I,!0),this.markActiveColumns&&x===this.refRow&&(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,I),u["default"].addClass(this.getHeaderElement(I),this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,I))}}this.singleSearchFlt&&P&&(F=!0),F?(this.validateRow(x,!0),this.validRowsIndex.push(x),this.alternateRows&&i.alternateRows.setRowBg(x,this.validRowsIndex.length),this.onRowValidated&&this.onRowValidated.call(null,this,x)):(this.validateRow(x,!1),i.alternateRows&&i.alternateRows.removeRowBg(x),this.hasVisibleRows&&-1!==this.visibleRows.indexOf(x)?this.validRowsIndex.push(x):a++)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=a,this.rememberGridValues&&i.store.saveFilterValues(this.fltsValuesCookie),this.paging?(i.paging.startPagingRow=0,i.paging.currentPageNb=1,i.paging.setPagingInfo(this.validRowsIndex)):this.applyProps(),this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this)}}},{key:"applyProps",value:function(){var t=this.Mod;this.hasVisibleRows&&this.enforceVisibility(),this.hasExtension("colOps")&&this.extension("colOps").calc(),this.linkedFilters&&this.linkFilters(),this.popupFilters&&t.popupFilter.closeAll(),this.noResults&&(this.nbVisibleRows>0?t.noResults.hide():t.noResults.show())}},{key:"getColValues",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],s=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],i=arguments.length<=3||void 0===arguments[3]?[]:arguments[3]; -if(this.fltGrid){var a=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var n=this.refRow;n0&&(r=-1!=i.indexOf(n));var o=a[n].cells,h=o.length;if(h===this.nbCells&&!r)for(var u=0;h>u;u++)if(u==t&&""===a[n].style.display){var d=this.getCellData(o[u]),f=this.colNbFormat?this.colNbFormat[t]:null,c=s?w["default"].removeNbFormat(d,f):d;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.getFilterType(t);if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var a=0,l=s.options.length;l>a;a++)s.options[a].selected&&(e=e.concat(s.options[a].value+" "+this.orOperator+" "));e=e.substr(0,e.length-4)}else i===this.fltTypeCheckList&&(null!==s.getAttribute("value")?(e=s.getAttribute("value"),e=e.substr(0,e.length-3)):e="");return e}}},{key:"getFiltersValue",value:function(){if(this.fltGrid){for(var t=[],e=0,s=this.fltIds.length;s>e;e++)t.push(f["default"].trim(f["default"].matchCase(this.getFilterValue(e),this.caseSensitive)));return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var s=[],i=0,a=this.fltIds.length;a>i;i++){var l=this.getFilterType(i);if(l===f["default"].lower(t)){var n=e?i:this.fltIds[i];s.push(n)}}return s}}},{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,s=this.tbl.rows.length;return t&&(e=0),parseInt(s-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=this.tbl.rows,s=[];t&&s.push([this.getHeadersRowIndex(),this.getHeadersText()]);for(var i=this.refRow;in;n++){var o=this.getCellData(l[n]);a[1].push(o)}s.push(a)}return s}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(!this.validRowsIndex)return[];var e=this.tbl.rows,s=[];t&&s.push([this.getHeadersRowIndex(),this.getHeadersText()]);for(var i=this.getValidRows(!0),a=0;aa;a++){var n=s[a],r=n[1],o=r[t];i.push(o)}return i}},{key:"getRowDisplay",value:function(t){return v["default"].isObj(t)?t.style.display:null}},{key:"validateRow",value:function(t,e){var s=this.tbl.rows[t];if(s&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var i=e?"":"none",a=e?"true":"false";s.style.display=i,this.paging&&s.setAttribute("validRow",a)}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;tl;l++){var r=s.options[l];(""===a||""===a[0])&&(r.selected=!1),""===r.value&&(r.selected=!1),""!==r.value&&m["default"].has(a,r.value,!0)&&(r.selected=!0)}else if(i===this.fltTypeCheckList){e=f["default"].matchCase(e,this.caseSensitive);var o=e.split(" "+this.orOperator+" "),h=u["default"].tag(s,"li").length;s.setAttribute("value",""),s.setAttribute("indexes","");for(var d=0;h>d;d++){var c=u["default"].tag(s,"li")[d],p=u["default"].tag(c,"label")[0],g=u["default"].tag(c,"input")[0],v=f["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 s(){for(var t=this.nbCells,s=this.colWidths,i=u["default"].tag(e,"col"),a=i.length>0,l=a?null:H.createDocumentFragment(),n=0;t>n;n++){var r=void 0;a?r=i[n]:(r=u["default"].create("col",["id",this.id+"_col_"+n]),l.appendChild(r)),r.style.width=s[n]}a||e.insertBefore(l,e.firstChild)}if(this.fltGrid&&this.hasColWidths){e=e||this.tbl;var i=void 0;i=void 0===t?"none"!=e.rows[0].style.display?0:1:t,s.call(this)}}},{key:"enforceVisibility",value:function(){if(this.hasVisibleRows)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.linkedFilters&&this.linkFilters(),this.rememberPageLen&&p["default"].remove(this.pgLenCookie),this.rememberPageNb&&p["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,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:"linkFilters",value:function(){if(this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);i=i.concat(s);var a=this.activeFilterId.split("_")[0];a=a.split(this.prfxFlt)[1];for(var l=void 0,n=0,r=i.length;r>n;n++){var o=u["default"].id(this.fltIds[i[n]]);if(l=this.getFilterValue(i[n]),a!==i[n]||this.paging&&-1!=t.indexOf(i[n])&&a===i[n]||!this.paging&&(-1!=s.indexOf(i[n])||-1!=e.indexOf(i[n]))||l===this.displayAllText){if(-1!=s.indexOf(i[n])?this.Mod.checkList.checkListDiv[i[n]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var h=u["default"].createOpt(this.displayAllText,"");o&&o.appendChild(h)}-1!=s.indexOf(i[n])?this.Mod.checkList._build(i[n]):this.Mod.dropdown._build(i[n],!0),this.setFilterValue(i[n],l)}}}}},{key:"_resetGrid",value:function(){if(!this.isFirstLoad){var t=this.Mod,e=this.tbl,s=e.rows,i=this.filtersRowIndex,a=s[i];if(!this.gridLayout)if(e.tHead){var l=e.tHead.insertRow(this.filtersRowIndex);e.tHead.replaceChild(this.fltGridEl,l)}else a.parentNode.insertBefore(this.fltGridEl,a);if(this.isExternalFlt)for(var n=this.externalFltTgtIds,r=0,o=n.length;o>r;r++){var h=u["default"].id(n[r]);if(h){var d=this.externalFltEls[r];h.appendChild(d);var f=this.getFilterType(r);this.gridLayout&&""===d.innerHTML&&f!==this.fltTypeInp&&((f===this.fltTypeSlc||f===this.fltTypeMulti)&&t.dropdown.build(r),f===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.popupFilters&&(this.headersRow++,t.popupFilter.reset()),this.gridLayout||u["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{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 s=!1,i=e?e:"script",a="script"==i?"src":"href",l=u["default"].tag(H,i),n=0,r=l.length;r>n;n++)if(void 0!==l[n][a]&&l[n][a].match(t)){s=!0;break}return s}},{key:"import",value:function(t,e,s,i){var a=i?i:"script",l=this.isImported(e,a);if(!l){var n=this,r=!1,o=void 0,h=u["default"].tag(H,"head")[0];o="link"===f["default"].lower(a)?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 s&&s.call(null,n))},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),i=arguments;if(i.length>1)for(var a=0;a0){var i=document.cookie,a=i.indexOf(s);if(-1!==a){a+=s.length;var l=i.indexOf(";",a);-1===l&&(l=i.length),e=unescape(i.substring(a,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}}},function(t,e){"use strict";function s(t){return t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t}Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"===s(window[t])&&(e=!0):t&&"object"===("undefined"==typeof t?"undefined":s(t))&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i},isNull:function(t){return null===t},isEmpty:function(t){return this.isUndef(t)||this.isNull(t)||0===t.length}}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var a=s(3),l=i(a);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,a=0;a2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function i(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,a=void 0;if("Y"===e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,a=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,a=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,a=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&a.test(t)===!1)return!1;var l=t.split(RegExp.$1),n=void 0,r=void 0,o=void 0;n="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(n,10)-1,parseInt(r,10),0,0,0,0);return parseInt(r,10)!=h.getDate()?!1:parseInt(n,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var a=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),a=new Date(s(l[2]),i(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(" "),a=new Date(s(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(" "),a=new Date(s(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(" "),a=new Date(s(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(" "),a=new Date(s(l[2]),l[1]-1,l[0])}return a}}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var a=s(3),l=i(a);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===l["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}}},function(t,e){"use strict";function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var s=0;s0&&i.removeChild(R[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(0,this.headTbl),i.style.width="",this.headTbl.style.width=i.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var s=p["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i});var F=(s.extensions||[]).filter(function(t){return"sort"===t.name});1===F.length&&(F[0].async_sort=!0,F[0].trigger_ids=g),this.tblHasColTag=u["default"].tag(i,"col").length>0?!0:!1;var P=function(){for(var t=e.nbCells-1;t>=0;t--){var s=u["default"].create("col",["id",e.id+"_col_"+t]);i.insertBefore(s,i.firstChild),s.style.width=e.colWidths[t],this.gridColElms[t]=s}this.tblHasColTag=!0};if(this.tblHasColTag)for(var I=u["default"].tag(i,"col"),S=0;S',e.popUpDivCssClass=i.popup_div_css_class||"popUpFilter",e.onBeforePopUpOpen=u["default"].isFn(i.on_before_popup_filter_open)?i.on_before_popup_filter_open:null,e.onAfterPopUpOpen=u["default"].isFn(i.on_after_popup_filter_open)?i.on_after_popup_filter_open:null,e.onBeforePopUpClose=u["default"].isFn(i.on_before_popup_filter_close)?i.on_before_popup_filter_close:null,e.onAfterPopUpClose=u["default"].isFn(i.on_after_popup_filter_close)?i.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 n(s,e),r(s,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,a=parseInt(i.getAttribute("ci"),10);if(this.closeAll(a),this.toggle(a),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[a],n=this.tf.getHeaderElement(a),r=.95*n.clientWidth;l.style.width=parseInt(r,10)+"px"}p["default"].cancel(s),p["default"].stop(s)}},{key:"init",value:function(){var t=this;if(!this.initialized){for(var e=this.tf,s=0;sC;C++)if(t===C&&(!e||e&&a.disableExcludedOptions)||t==C&&e&&(""===o[m].style.display&&!a.paging||a.paging&&(!a.validRowsIndex||a.validRowsIndex&&-1!=a.validRowsIndex.indexOf(m))&&(void 0===f||f==t||f!=t&&-1!=a.validRowsIndex.indexOf(m)))){var w=a.getCellData(_[C]),x=d["default"].matchCase(w,u);if(h["default"].has(this.opts,x,u)||this.opts.push(w),e&&a.disableExcludedOptions){var k=b[C];k||(k=a.getFilteredDataCol(C)),h["default"].has(k,x,u)||h["default"].has(v,x,u)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var T=a.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(a.sortSlc&&!this.isCustom&&(u?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),a.sortNumAsc&&-1!=a.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&-1!=a.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,n,e,v,p,g)}}},{key:"addOptions",value:function(t,e,s,i,a,l){var n=this.tf,o=d["default"].lower(this.slcFillingMethod),u=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var f=0;f"+p+""}else{var b;b=n.loadFltOnDemand&&u===this.opts[f]&&n.getFilterType(t)===n.fltTypeSlc?r["default"].createOpt(p,c,!0):n.getFilterType(t)!==n.fltTypeMulti?r["default"].createOpt(p,c," "!==a[t]&&c===a[t]?!0:!1):r["default"].createOpt(p,c,h["default"].has(l,d["default"].matchCase(this.opts[f],n.matchCase),n.matchCase)||-1!==l.toString().indexOf(c)?!0:!1),g&&(b.disabled=!0),e.appendChild(b)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=d["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=r["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var a=r["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(a)}if(e.enableNonEmptyOption){var l=r["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}}]),t}()},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var a=s(3),l=i(a);e["default"]={ignoreCase:function(t,e){var s=l["default"].lower(t),i=l["default"].lower(e);return i>s?-1:s>i?1:0}}},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!a.linkedFilters||a.linkedFilters&&a.disableExcludedOptions)||t===_&&a.linkedFilters&&(""===u[v].style.display&&!a.paging||a.paging&&(!f||f===t||f!=t&&-1!=a.validRowsIndex.indexOf(v)))){var y=a.getCellData(b[_]),C=d["default"].matchCase(y,a.matchCase);h["default"].has(this.opts,C,a.matchCase)||this.opts.push(y);var w=p[_];a.linkedFilters&&a.disableExcludedOptions&&(w||(w=a.getFilteredDataCol(_)),h["default"].has(w,C,a.matchCase)||h["default"].has(this.excludedOpts,C,a.matchCase)||a.isFirstLoad||this.excludedOpts.push(y))}}if(this.isCustom){var x=a.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(a.sortSlc&&!this.isCustom&&(a.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(c["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(c["default"].ignoreCase))),a.sortNumAsc&&-1!=a.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&-1!=a.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,o,a.separator),a.loadFltOnDemand&&(n.innerHTML=""),n.appendChild(o),n.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,a=this.addTChecks(t,e),l=[],n=i.feature("store"),o=n?n.getFilterValues(i.fltsValuesCookie)[t]:null;o&&d["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&-1!=i.customSlcOptions.cols.indexOf(t)?l.push(o):l=o.split(" "+i.orOperator+" "));for(var u=0;u0?1:0),l=a+i.pagingLength-1<=e.nbVisibleRows?a+i.pagingLength-1:e.nbVisibleRows;s=a+this.fromToTextSeparator+l+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows;this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{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",function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off("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,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(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 n(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 s=0;s",s.btnPrevPageText=i.btn_prev_page_text||"<",s.btnLastPageText=i.btn_last_page_text||">|",s.btnFirstPageText=i.btn_first_page_text||"|<",s.btnNextPageHtml=i.btn_next_page_html||(t.enableIcons?'':null),s.btnPrevPageHtml=i.btn_prev_page_html||(t.enableIcons?'':null),s.btnFirstPageHtml=i.btn_first_page_html||(t.enableIcons?'':null),s.btnLastPageHtml=i.btn_last_page_html||(t.enableIcons?'':null),s.pageText=i.page_text||" Page ",s.ofText=i.of_text||" of ",s.nbPgSpanCssClass=i.nb_pages_css_class||"nbpg",s.hasPagingBtns=i.paging_btns===!1?!1:!0,s.pageSelectorType=i.page_selector_type||t.fltTypeSlc,s.onBeforeChangePage=c["default"].isFn(i.on_before_change_page)?i.on_before_change_page:null,s.onAfterChangePage=c["default"].isFn(i.on_after_change_page)?i.on_after_change_page:null,s.prfxSlcPages="slcPages_",s.prfxSlcResults="slcResults_",s.prfxSlcResultsTxt="slcResultsTxt_",s.prfxBtnNextSpan="btnNextSpan_",s.prfxBtnPrevSpan="btnPrevSpan_",s.prfxBtnLastSpan="btnLastSpan_",s.prfxBtnFirstSpan="btnFirstSpan_",s.prfxBtnNext="btnNext_",s.prfxBtnPrev="btnPrev_",s.prfxBtnLast="btnLast_",s.prfxBtnFirst="btnFirst_",s.prfxPgSpan="pgspan_",s.prfxPgBeforeSpan="pgbeforespan_",s.prfxPgAfterSpan="pgafterspan_";var a=s.refRow,r=s.nbRows;s.nbPages=Math.ceil((r-a)/s.pagingLength);var o=s;return s.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 s=b["default"].keyCode(e);13===s&&(t.sorted?(t.filter(),o.changePage(o.evt.slcIndex())):o.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},s}return r(e,t),o(e,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){var s=t.target;e.changePage(s.selectedIndex)},this.pageSelectorType===s.fltTypeSlc&&(t=d["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=d["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",i._detectKey));var a=d["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),l=d["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),n=d["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),r=d["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)a.innerHTML=this.btnNextPageHtml,b["default"].add(a,"click",i.next);else{var o=d["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);o.className=this.btnPageCssClass,b["default"].add(o,"click",i.next),a.appendChild(o)}if(this.btnPrevPageHtml)l.innerHTML=this.btnPrevPageHtml,b["default"].add(l,"click",i.prev);else{var h=d["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",i.prev),l.appendChild(h)}if(this.btnLastPageHtml)n.innerHTML=this.btnLastPageHtml,b["default"].add(n,"click",i.last);else{var u=d["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,b["default"].add(u,"click",i.last),n.appendChild(u)}if(this.btnFirstPageHtml)r.innerHTML=this.btnFirstPageHtml,b["default"].add(r,"click",i.first);else{var f=d["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);f.className=this.btnPageCssClass,b["default"].add(f,"click",i.first),r.appendChild(f)}}this.pagingTgtId||s.setToolbar();var c=this.pagingTgtId?d["default"].id(this.pagingTgtId):s.mDiv;c.appendChild(r),c.appendChild(l);var p=d["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);p.appendChild(d["default"].text(this.pageText)),p.className=this.nbPgSpanCssClass,c.appendChild(p),c.appendChild(t);var g=d["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);g.appendChild(d["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,c.appendChild(g);var v=d["default"].create("span",["id",this.prfxPgSpan+s.id]);v.className=this.nbPgSpanCssClass,v.appendChild(d["default"].text(" "+this.nbPages+" ")),c.appendChild(v),c.appendChild(a),c.appendChild(n),this.pagingSlc=d["default"].id(this.prfxSlcPages+s.id),s.rememberGridValues||this.setPagingInfo(),s.fltGrid||(s.validateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.initialized=!0}}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!this.isEnabled()&&(this.enable(),this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?d["default"].id(this.pagingTgtId):e.mDiv,a=d["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t,0===t.length)for(var l=e.refRow;l0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var o=0;on;n++){var o=e.validRowsIndex[n],h=i[o],u=h.getAttribute("validRow");n>=a&&l>n?((c["default"].isNull(u)||Boolean("true"===u))&&(h.style.display=""),e.alternateRows&&s&&s.setRowBg(o,n)):(h.style.display="none",e.alternateRows&&s&&s.removeRowBg(o))}e.nbVisibleRows=e.validRowsIndex.length,e.applyProps(),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 s=this.evt,i="undefined"==typeof t?"undefined":a(t);if("string"===i)switch(g["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=d["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=this.resultsSlcCssClass;var a=this.resultsPerPage[0],l=this.resultsPerPage[1],n=d["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);n.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var r=this.resultsPerPageTgtId?d["default"].id(this.resultsPerPageTgtId):e.rDiv;n.appendChild(d["default"].text(a));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(n,o.btn),o.btn.parentNode.insertBefore(i,o.btn)):(r.appendChild(n),r.appendChild(i));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)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(this.isEnabled()){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.feature("store").savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.feature("store").getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(this.isEnabled()){var s=e.feature("store").getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(this.initialized){var e=d["default"].id(this.prfxBtnNextSpan+t.id),s=d["default"].id(this.prfxBtnPrevSpan+t.id),i=d["default"].id(this.prfxBtnLastSpan+t.id),a=d["default"].id(this.prfxBtnFirstSpan+t.id),l=d["default"].id(this.prfxPgBeforeSpan+t.id),n=d["default"].id(this.prfxPgAfterSpan+t.id),r=d["default"].id(this.prfxPgSpan+t.id),o=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",o.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",o._detectKey),d["default"].remove(this.pagingSlc)),e&&(b["default"].remove(e,"click",o.next),d["default"].remove(e)),s&&(b["default"].remove(s,"click",o.prev),d["default"].remove(s)),i&&(b["default"].remove(i,"click",o.last),d["default"].remove(i)),a&&(b["default"].remove(a,"click",o.first),d["default"].remove(a)),l&&d["default"].remove(l),n&&d["default"].remove(n),r&&d["default"].remove(r),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}}}]),e}(h.Feature)},function(t,e,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(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 n(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 s=0;s':null),s.prfxResetSpan="resetspan_",s}return n(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 s=u["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?u["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var a=s.firstChild;f["default"].add(a,"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)),s.appendChild(l),f["default"].add(l,"click",function(){t.onClick()})}this.btnResetEl=s.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,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(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 n(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 s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',s.instrHtml=i.help_instructions_html||null,s.btnText=i.help_instructions_btn_text||"?",s.btnHtml=i.help_instructions_btn_html||null,s.btnCssClass=i.help_instructions_btn_css_class||"helpBtn",s.contCssClass=i.help_instructions_container_css_class||"helpCont",s.btn=null,s.cont=null,s.defaultHtml='

TableFilter v'+t.version+'

'+p+"
©2015-"+t.year+' Max Guglielmi
',s.prfxHelpSpan="helpSpan_",s.prfxHelpDiv="helpDiv_",s}return n(e,t),r(e,[{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf,s=u["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=u["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var a=this.tgtId?u["default"].id(this.tgtId):e.rDiv;a.appendChild(s);var l=this.contTgtId?u["default"].id(this.contTgtId):s;if(this.btnHtml){s.innerHTML=this.btnHtml;var n=s.firstChild;f["default"].add(n,"click",function(){t.toggle()}),l.appendChild(i)}else{l.appendChild(i);var r=u["default"].create("a",["href","javascript:void(0);"]);r.className=this.btnCssClass,r.appendChild(u["default"].text(this.btnText)),s.appendChild(r),f["default"].add(r,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(i),i.innerHTML=this.instrHtml,this.contTgtId||(i.className=this.contCssClass,f["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.instrText,i.className=this.contCssClass,f["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.defaultHtml,f["default"].add(i,"click",function(){t.toggle()}),this.cont=i,this.btn=s,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,s){"use strict";function i(t){return t&&t.__esModule?t:{"default":t}}function a(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 n(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 s=0;sn;n++){var r=s?n:e[n];this.setRowBg(r,l),l++}this.initialized=!0}}},{key:"setRowBg",value:function(t,e){if(this.isEnabled()&&!isNaN(t)){var s=this.tf.tbl.rows,i=isNaN(e)?t:e;this.removeRowBg(t),u["default"].addClass(s[t],i%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(){if(this.initialized){for(var t=this.tf.refRow;tn;n++)s[n]=arguments[n];if(0!==s.length){if(this.id=null,this.version="0.1.0",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":a(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.gridLayout&&(this.headersRow>1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),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=null,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||null,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.msgFilter=r.msg_filter||"Filtering data...",this.msgPopulate=r.msg_populate||"Populating filter...",this.msgPopulateCheckList=r.msg_populate_checklist||"Populating list...",this.msgChangePage=r.msg_change_page||"Collecting paging data...",this.msgClear=r.msg_clear||"Clearing filters...",this.msgChangeResults=r.msg_change_results||"Changing results per page...",this.msgResetValues=r.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=r.msg_reset_page||"Re-setting page...",this.msgResetPageLength=r.msg_reset_page_length||"Re-setting page length...",this.msgSort=r.msg_sort||"Sorting data...",this.msgLoadExtensions=r.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=r.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(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={name:{filter:"Filter",dropdown:"DropDown",checklist:"CheckList",changepage:"ChangePage",clear:"Clear",changeresultsperpage:"ChangeResults",resetvalues:"ResetValues",resetpage:"ResetPage",resetpagelength:"ResetPageLength",loadextensions:"LoadExtensions",loadthemes:"LoadThemes"},detectKey:function(t){if(this.enterKey){var e=t||A.event;if(e){var i=o["default"].keyCode(e);13===i?(this.filter(),o["default"].cancel(e),o["default"].stop(e)):(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=t||A.event,s=o["default"].keyCode(i);this.isUserTyping=!1,13!==s&&9!==s&&27!==s&&38!==s&&40!==s?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(){if(this.autoFilter&&(this.isUserTyping=!1,A.clearInterval(this.autoFilterTimer)),this.hasExtension("advancedGrid")){var t=this.extension("advancedGrid"),e=t._ezEditTable;t.cfg.editable&&e.Editable.Set(),t.cfg.selection&&e.Selection.Set()}},onInpFocus:function(t){var e=t||A.event,i=o["default"].target(e);if(this.activeFilterId=i.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.popupFilters&&(o["default"].cancel(e),o["default"].stop(e)),this.hasExtension("advancedGrid")){var s=this.extension("advancedGrid"),a=s._ezEditTable;s.cfg.editable&&a.Editable.Remove(),s.cfg.selection&&a.Selection.Remove()}},onSlcFocus:function(t){var e=t||A.event,i=o["default"].target(e);if(this.activeFilterId=i.getAttribute("id"),this.activeFlt=u["default"].id(this.activeFilterId),this.loadFltOnDemand&&"0"===i.getAttribute("filled")){var s=i.getAttribute("ct");this.Mod.dropdown._build(s)}this.popupFilters&&(o["default"].cancel(e),o["default"].stop(e))},onSlcChange:function(t){if(this.activeFlt){var e=t||A.event;this.popupFilters&&o["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||A.event,i=o["default"].target(e);if(this.loadFltOnDemand&&"0"===i.getAttribute("filled")){var s=i.getAttribute("ct");this.Mod.checkList._build(s),this.Mod.checkList.checkListDiv[s].onclick=null,this.Mod.checkList.checkListDiv[s].title=""}}}}}return n(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){this.tbl||(this.tbl=u["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popupFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var 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=new k.Store(this),e.store.init()),this.gridLayout&&(e.gridLayout=new T.GridLayout(this),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new R.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new P.HighlightKeyword(this)),this.popupFilters&&(e.popupFilter||(e.popupFilter=new F.PopupFilter(this)),e.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var a=void 0;if(!this.gridLayout){var l=u["default"].tag(this.tbl,"thead");a=l.length>0?l[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popupFilters&&this.headersRow++,this.popupFilters&&this.headersRow++,a.className=this.fltsRowCssClass,(this.isExternalFlt||this.popupFilters)&&(a.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var n=0;i>n;n++){this.popupFilters&&e.popupFilter.build(n);var r=u["default"].create(this.fltCellTag),h=this.getFilterType(n),d=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[n]:null;if(this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||a.appendChild(r),s=n==i-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(h=this.fltTypeInp,s=this.singleFltCssClass),h===this.fltTypeSlc||h===this.fltTypeMulti){e.dropdown||(e.dropdown=new I.Dropdown(this));var c=e.dropdown,p=u["default"].create(this.fltTypeSlc,["id",this.prfxFlt+n+"_"+this.id],["ct",n],["filled","0"]);if(h===this.fltTypeMulti&&(p.multiple=this.fltTypeMulti,p.title=c.multipleSlcTooltip),p.className=f["default"].lower(h)===this.fltTypeSlc?s:this.fltMultiCssClass,d?(u["default"].id(d).appendChild(p),this.externalFltEls.push(p)):r.appendChild(p),this.fltIds.push(this.prfxFlt+n+"_"+this.id),this.loadFltOnDemand||c._build(n),o["default"].add(p,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(p,"change",this.Evt.onSlcChange.bind(this)),o["default"].add(p,"focus",this.Evt.onSlcFocus.bind(this)),this.loadFltOnDemand){var g=u["default"].createOpt(this.displayAllText,"");p.appendChild(g)}}else if(h===this.fltTypeCheckList){var v=void 0;e.checkList=new S.CheckList(this),v=e.checkList;var b=u["default"].create("div",["id",v.prfxCheckListDiv+n+"_"+this.id],["ct",n],["filled","0"]);b.className=v.checkListDivCssClass,d?(u["default"].id(d).appendChild(b),this.externalFltEls.push(b)):r.appendChild(b),v.checkListDiv[n]=b,this.fltIds.push(this.prfxFlt+n+"_"+this.id),this.loadFltOnDemand||v._build(n),this.loadFltOnDemand&&(o["default"].add(b,"click",this.Evt.onCheckListClick.bind(this)),b.appendChild(u["default"].text(v.activateCheckListTxt)))}else{var m=h===this.fltTypeInp?"text":"hidden",_=u["default"].create(this.fltTypeInp,["id",this.prfxFlt+n+"_"+this.id],["type",m],["ct",n]);if("hidden"!==m&&this.watermark&&_.setAttribute("placeholder",this.isWatermarkArray?this.watermark[n]||"":this.watermark),_.className=s,o["default"].add(_,"focus",this.Evt.onInpFocus.bind(this)),d?(u["default"].id(d).appendChild(_),this.externalFltEls.push(_)):r.appendChild(_),this.fltIds.push(this.prfxFlt+n+"_"+this.id),o["default"].add(_,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(_,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(_,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(_,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var y=this.Mod.store.getFilterValues(this.fltsValuesCookie);" "!=y[n]&&this.setFilterValue(n,y[n],!1)}}if(n==i-1&&this.displayBtn){var C=u["default"].create(this.fltTypeInp,["id",this.prfxValButton+n+"_"+this.id],["type","button"],["value",this.btnText]);C.className=this.btnCssClass,d?u["default"].id(d).appendChild(C):r.appendChild(C),o["default"].add(C,"click",function(){return t.filter()})}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.hasVisibleRows&&(this.emitter.on("after-filtering",function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new O.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new E.StatusBar(this),e.statusBar.init()),(this.paging||e.paging)&&(e.paging||(e.paging=new L.Paging(this),e.paging.init()),e.paging.reset()),this.btnReset&&(e.clearButton=new M.ClearButton(this),e.clearButton.init()),this.help&&(e.help||(e.help=new N.Help(this)),e.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new D.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new B.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.loader&&e.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.linkedFilters&&this.emitter.on("after-filtering",function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.emitter.emit("initialized",this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?r.dropdown._build(s,!0):r.dropdown._build(s,!1,a,l);break;case e.checklist:r.checkList._build(s,a,l);break;case e.changepage:r.paging._changePage(n);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:r.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:r.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:r.paging._resetPageLength(this.pgLenCookie);break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&r.statusBar.message(""),this.loader&&r.loader.show("none")}var i=arguments.length<=1||void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],s=i.slcIndex,a=i.slcExternal,l=i.slcId,n=i.pgIndex,r=this.Mod;this.loader||this.statusBar||this.linkedFilters?(this.loader&&r.loader.show(""),this.statusBar&&r.statusBar.message(this["msg"+t]),A.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e];this.ExtRegistry[s.name]||this.loadExtension(s)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var s=t.name,a=t.path,l=void 0;s&&a?l=t.path+s:(s=s.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,s)),i.p=this.basePath,i.e(1,function(i){var a=[i(26)("./"+l)];(function(i){var a=new i["default"](e,t);a.init(),e.ExtRegistry[s]=a}).apply(null,a)})}}},{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],a=this.ExtRegistry[s.name];a&&(a.destroy(),this.ExtRegistry[s.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(v["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var a=t[i],l=a.name,n=a.path,r=this.prfxTf+l;l&&!n?n=this.themesPath+l+"/"+l+".css":!l&&a.path&&(l="theme{0}".replace("{0}",i)),this.isImported(n,"link")||this["import"](r,n,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null}},{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._clearFilters(),this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.markActiveColumns&&this.clearActiveColumns(),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&&this.externalFltTgtIds)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],a=u["default"].id(s);a&&(a.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=[],a=[],l=i.indexOf(t),n=e.values[l],r=e.texts[l],o=e.sorts[l],h=0,u=n.length;u>h;h++)a.push(n[h]),r[h]?s.push(r[h]):s.push(n[h]);return o&&(a.sort(),s.sort()),[a,s]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.loadFltOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Mod.paging&&this.Mod.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Mod.paging&&this.Mod.paging.resetPage(this.pgNbCookie)}},{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 a=0;ah;h++)""!==l[h]&&(n=u["default"].createOpt(l[h],l[h],!0),o.appendChild(n),this.hasStoredValues=!0)}}else if(r===this.fltTypeCheckList){var f=this.Mod.checkList,c=f.checkListDiv[a];c.title=c.innerHTML,c.innerHTML="";var p=u["default"].create("ul",["id",this.fltIds[a]],["colIndex",a]);p.className=f.checkListCssClass;var g=u["default"].createCheckItem(this.fltIds[a]+"_0","",this.displayAllText);g.className=f.checkListItemCssClass,p.appendChild(g),c.appendChild(p),l=e[a].split(" "+this.orOperator+" ");for(var h=0,d=l.length;d>h;h++)if(""!==l[h]){var v=u["default"].createCheckItem(this.fltIds[a]+"_"+(h+1),l[h],l[h]);v.className=f.checkListItemCssClass,p.appendChild(v),v.check.checked=!0,f.setCheckListValues(v.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Mod.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{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 a=t;(r.test(t)||o.test(t)||h.test(t)||d.test(t)||c.test(t))&&(a=u["default"].getText(i)),""!==a&&s.highlightKeyword.highlight(i,a,s.highlightKeyword.highlightCssClass)}}function e(t,e,i){var s=void 0,a=w["default"].removeNbFormat,u=h.test(t),x=r.test(t),k=d.test(t),T=o.test(t),R=c.test(t),P=g.test(t),F=p.test(t),I=v.test(t),S=b.test(t),E=m===t,L=_===t,M=C.test(t),N=u&&y["default"].isValid(t.replace(h,""),O),D=x&&y["default"].isValid(t.replace(r,""),O),B=k&&y["default"].isValid(t.replace(d,""),O),A=T&&y["default"].isValid(t.replace(o,""),O),H=R&&y["default"].isValid(t.replace(c,""),O),j=P&&y["default"].isValid(t.replace(g,""),O),V=void 0,U=void 0;if(y["default"].isValid(e,O))V=y["default"].format(e,O),N?(U=y["default"].format(t.replace(h,""),O),s=U>V):D?(U=y["default"].format(t.replace(r,""),O),s=U>=V):A?(U=y["default"].format(t.replace(o,""),O),s=V>=U):B?(U=y["default"].format(t.replace(d,""),O),s=V>U):H?(U=y["default"].format(t.replace(c,""),O),s=V.toString()!=U.toString()):j?(U=y["default"].format(t.replace(g,""),O),s=V.toString()==U.toString()):p.test(t)?s=f["default"].contains(t.replace(p,""),e,!1,this.caseSensitive):y["default"].isValid(t,O)?(U=y["default"].format(t,O),s=V.toString()===U.toString()):s=E?f["default"].isEmpty(e):L?!f["default"].isEmpty(e):f["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(l=a(e,this.colNbFormat[i]),n=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(l=a(e,"us"),n="us"):(l=a(e,"eu"),n="eu"),x)s=l<=a(t.replace(r,""),n);else if(T)s=l>=a(t.replace(o,""),n);else if(u)s=la(t.replace(d,""),n);else if(R)s=f["default"].contains(t.replace(c,""),e,!1,this.caseSensitive)?!1:!0;else if(F)s=f["default"].contains(t.replace(p,""),e,!1,this.caseSensitive);else if(P)s=f["default"].contains(t.replace(g,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(v,""))?!0:!1;else if(S){var G=t.replace(b,"");s=e.lastIndexOf(G,e.length-1)===e.length-1-(G.length-1)&&e.lastIndexOf(G,e.length-1)>-1?!0:!1}else if(E)s=f["default"].isEmpty(e);else if(L)s=!f["default"].isEmpty(e);else if(M)try{var z=t.replace(C,""),W=new RegExp(z);s=W.test(e)}catch($){s=!1}else s=f["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,a=0;this.validRowsIndex=[],this.highlightKeywords&&s.highlightKeyword.unhighlightAll(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var l,n,r=new RegExp(this.leOperator),o=new RegExp(this.geOperator),h=new RegExp(this.lwOperator),d=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),p=new RegExp(f["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),v=new RegExp(this.stOperator),b=new RegExp(this.enOperator),m=this.emOperator,_=this.nmOperator,C=new RegExp(f["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var S=this.searchArgs[this.singleSearchFlt?0:I],O=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==S){var E=f["default"].matchCase(this.getCellData(k[I]),this.caseSensitive),L=S.split(this.orOperator),M=L.length>1?!0:!1,N=S.split(this.anOperator),D=N.length>1?!0:!1;if(M||D){for(var B=void 0,A=!1,H=M?L:N,j=0,V=H.length;V>j&&(B=f["default"].trim(H[j]),A=e.call(this,B,E,I),t.call(this,B,A,k[I]),!M||!A)&&(!D||A);j++);R[I]=A}else R[I]=e.call(this,f["default"].trim(S),E,I),t.call(this,S,R[I],k[I]);R[I]||(P=!1),this.singleSearchFlt&&R[I]&&(F=!0),this.popupFilters&&s.popupFilter.buildIcon(I,!0),this.markActiveColumns&&x===this.refRow&&(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,I),u["default"].addClass(this.getHeaderElement(I),this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,I))}}this.singleSearchFlt&&F&&(P=!0),P?(this.validateRow(x,!0),this.validRowsIndex.push(x),this.alternateRows&&s.alternateRows.setRowBg(x,this.validRowsIndex.length),this.onRowValidated&&this.onRowValidated.call(null,this,x)):(this.validateRow(x,!1),s.alternateRows&&s.alternateRows.removeRowBg(x),this.hasVisibleRows&&-1!==this.visibleRows.indexOf(x)?this.validRowsIndex.push(x):a++)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=a,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 a=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var n=this.refRow;n0&&(r=-1!=s.indexOf(n)); +var o=a[n].cells,h=o.length;if(h===this.nbCells&&!r)for(var u=0;h>u;u++)if(u==t&&""===a[n].style.display){var d=this.getCellData(o[u]),f=this.colNbFormat?this.colNbFormat[t]:null,c=i?w["default"].removeNbFormat(d,f):d;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 a=0,l=i.options.length;l>a;a++)i.options[a].selected&&(e=e.concat(i.options[a].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(f["default"].trim(f["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,a=this.fltIds.length;a>s;s++){var l=this.getFilterType(s);if(l===f["default"].lower(t)){var n=e?s:this.fltIds[s];i.push(n)}}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=this.tbl.rows,i=[];t&&i.push([this.getHeadersRowIndex(),this.getHeadersText()]);for(var s=this.refRow;sn;n++){var o=this.getCellData(l[n]);a[1].push(o)}i.push(a)}return i}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0];if(!this.validRowsIndex)return[];var e=this.tbl.rows,i=[];t&&i.push([this.getHeadersRowIndex(),this.getHeadersText()]);for(var s=this.getValidRows(!0),a=0;aa;a++){var n=i[a],r=n[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",a=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",a)}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;tl;l++){var r=i.options[l];(""===a||""===a[0])&&(r.selected=!1),""===r.value&&(r.selected=!1),""!==r.value&&m["default"].has(a,r.value,!0)&&(r.selected=!0)}else if(s===this.fltTypeCheckList){e=f["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 d=0;h>d;d++){var c=u["default"].tag(i,"li")[d],p=u["default"].tag(c,"label")[0],g=u["default"].tag(c,"input")[0],v=f["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"),a=s.length>0,l=a?null:H.createDocumentFragment(),n=0;t>n;n++){var r=void 0;a?r=s[n]:(r=u["default"].create("col",["id",this.id+"_col_"+n]),l.appendChild(r)),r.style.width=i[n]}a||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(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.rememberPageLen&&p["default"].remove(this.pgLenCookie),this.rememberPageNb&&p["default"].remove(this.pgNbCookie),this.onAfterReset&&this.onAfterReset.call(null,this),this.emitter.emit("cleared-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:"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 a=this.activeFilterId.split("_")[0];a=a.split(this.prfxFlt)[1];for(var l=void 0,n=0,r=s.length;r>n;n++){var o=u["default"].id(this.fltIds[s[n]]);if(l=this.getFilterValue(s[n]),a!==s[n]||this.paging&&-1!=t.indexOf(s[n])&&a===s[n]||!this.paging&&(-1!=i.indexOf(s[n])||-1!=e.indexOf(s[n]))||l===this.displayAllText){if(-1!=i.indexOf(s[n])?this.Mod.checkList.checkListDiv[s[n]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var h=u["default"].createOpt(this.displayAllText,"");o&&o.appendChild(h)}-1!=i.indexOf(s[n])?this.Mod.checkList._build(s[n]):this.Mod.dropdown._build(s[n],!0),this.setFilterValue(s[n],l)}}}}},{key:"_resetGrid",value:function(){if(!this.isFirstLoad){var t=this.Mod,e=this.tbl,i=e.rows,s=this.filtersRowIndex,a=i[s];if(!this.gridLayout)if(e.tHead){var l=e.tHead.insertRow(this.filtersRowIndex);e.tHead.replaceChild(this.fltGridEl,l)}else a.parentNode.insertBefore(this.fltGridEl,a);if(this.isExternalFlt)for(var n=this.externalFltTgtIds,r=0,o=n.length;o>r;r++){var h=u["default"].id(n[r]);if(h){var d=this.externalFltEls[r];h.appendChild(d);var f=this.getFilterType(r);this.gridLayout&&""===d.innerHTML&&f!==this.fltTypeInp&&((f===this.fltTypeSlc||f===this.fltTypeMulti)&&t.dropdown.build(r),f===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=i.length,this.popupFilters&&(this.headersRow++,t.popupFilter.reset()),this.gridLayout||u["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{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",a="script"==s?"src":"href",l=u["default"].tag(H,s),n=0,r=l.length;r>n;n++)if(void 0!==l[n][a]&&l[n][a].match(t)){i=!0;break}return i}},{key:"import",value:function(t,e,i,s){var a=s?s:"script",l=this.isImported(e,a);if(!l){var n=this,r=!1,o=void 0,h=u["default"].tag(H,"head")[0];o="link"===f["default"].lower(a)?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,n))},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 a=0;a0){var s=document.cookie,a=s.indexOf(i);if(-1!==a){a+=i.length;var l=s.indexOf(";",a);-1===l&&(l=s.length),e=unescape(s.substring(a,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 a=i(3),l=s(a);e["default"]={has:function(t,e,i){for(var s=void 0===i?!1:i,a=0;a2)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,a=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,a=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,a=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,a=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&a.test(t)===!1)return!1;var l=t.split(RegExp.$1),n=void 0,r=void 0,o=void 0;n="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(n,10)-1,parseInt(r,10),0,0,0,0);return parseInt(r,10)!=h.getDate()?!1:parseInt(n,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var a=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),a=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(" "),a=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(" "),a=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(" "),a=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(" "),a=new Date(i(l[2]),l[1]-1,l[0])}return a}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(3),l=s(a);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(R[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 P=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===P.length&&(P[0].async_sort=!0,P[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"),S=0;S',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 n(i,e),r(i,[{key:"onClick",value:function(e){var i=e||t.event,s=i.target.parentNode,a=parseInt(s.getAttribute("ci"),10);if(this.closeAll(a),this.toggle(a),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[a],n=this.tf.getHeaderElement(a),r=.95*n.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){for(var e=this.tf,i=0;iC;C++)if(t===C&&(!e||e&&a.disableExcludedOptions)||t==C&&e&&(""===o[m].style.display&&!a.paging||a.paging&&(!a.validRowsIndex||a.validRowsIndex&&-1!=a.validRowsIndex.indexOf(m))&&(void 0===f||f==t||f!=t&&-1!=a.validRowsIndex.indexOf(m)))){var w=a.getCellData(_[C]),x=d["default"].matchCase(w,u);if(h["default"].has(this.opts,x,u)||this.opts.push(w),e&&a.disableExcludedOptions){var k=b[C];k||(k=a.getFilteredDataCol(C)),h["default"].has(k,x,u)||h["default"].has(v,x,u)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var T=a.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(a.sortSlc&&!this.isCustom&&(u?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),a.sortNumAsc&&-1!=a.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&-1!=a.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(R){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,n,e,v,p,g)}}},{key:"addOptions",value:function(t,e,i,s,a,l){var n=this.tf,o=d["default"].lower(this.slcFillingMethod),u=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var f=0;f"+p+""}else{var b;b=n.loadFltOnDemand&&u===this.opts[f]&&n.getFilterType(t)===n.fltTypeSlc?r["default"].createOpt(p,c,!0):n.getFilterType(t)!==n.fltTypeMulti?r["default"].createOpt(p,c," "!==a[t]&&c===a[t]?!0:!1):r["default"].createOpt(p,c,h["default"].has(l,d["default"].matchCase(this.opts[f],n.matchCase),n.matchCase)||-1!==l.toString().indexOf(c)?!0:!1),g&&(b.disabled=!0),e.appendChild(b)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,i=d["default"].lower(this.slcFillingMethod);if("innerhtml"===i)this.slcInnerHtml+='";else{var s=r["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(s.style.display="none"),t.appendChild(s),e.enableEmptyOption){var a=r["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(a)}if(e.enableNonEmptyOption){var l=r["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}}]),t}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var a=i(3),l=s(a);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 a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var l=function(){function t(t,e){for(var i=0;i_;_++)if(t===_&&(!a.linkedFilters||a.linkedFilters&&a.disableExcludedOptions)||t===_&&a.linkedFilters&&(""===u[v].style.display&&!a.paging||a.paging&&(!f||f===t||f!=t&&-1!=a.validRowsIndex.indexOf(v)))){var y=a.getCellData(b[_]),C=d["default"].matchCase(y,a.matchCase);h["default"].has(this.opts,C,a.matchCase)||this.opts.push(y);var w=p[_];a.linkedFilters&&a.disableExcludedOptions&&(w||(w=a.getFilteredDataCol(_)),h["default"].has(w,C,a.matchCase)||h["default"].has(this.excludedOpts,C,a.matchCase)||a.isFirstLoad||this.excludedOpts.push(y))}}if(this.isCustom){var x=a.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(a.sortSlc&&!this.isCustom&&(a.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(c["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(c["default"].ignoreCase))),a.sortNumAsc&&-1!=a.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(a.sortNumDesc&&-1!=a.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,o,a.separator),a.loadFltOnDemand&&(n.innerHTML=""),n.appendChild(o),n.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var i=this,s=this.tf,a=this.addTChecks(t,e),l=[],n=s.feature("store"),o=n?n.getFilterValues(s.fltsValuesCookie)[t]:null;o&&d["default"].trim(o).length>0&&(s.hasCustomSlcOptions&&-1!=s.customSlcOptions.cols.indexOf(t)?l.push(o):l=o.split(" "+s.orOperator+" "));for(var u=0;u0?1:0),l=a+s.pagingLength-1<=e.nbVisibleRows?a+s.pagingLength-1:e.nbVisibleRows;i=a+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",function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off("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 a(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 n(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 a=i.refRow,r=i.nbRows;i.nbPages=Math.ceil((r-a)/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=d["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=d["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var a=d["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),l=d["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),n=d["default"].create("span",["id",this.prfxBtnLastSpan+i.id]),r=d["default"].create("span",["id",this.prfxBtnFirstSpan+i.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)a.innerHTML=this.btnNextPageHtml,b["default"].add(a,"click",s.next);else{var o=d["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),a.appendChild(o)}if(this.btnPrevPageHtml)l.innerHTML=this.btnPrevPageHtml,b["default"].add(l,"click",s.prev);else{var h=d["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)n.innerHTML=this.btnLastPageHtml,b["default"].add(n,"click",s.last);else{var u=d["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),n.appendChild(u)}if(this.btnFirstPageHtml)r.innerHTML=this.btnFirstPageHtml,b["default"].add(r,"click",s.first);else{var f=d["default"].create(i.fltTypeInp,["id",this.prfxBtnFirst+i.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);f.className=this.btnPageCssClass,b["default"].add(f,"click",s.first),r.appendChild(f)}}this.pagingTgtId||i.setToolbar();var c=this.pagingTgtId?d["default"].id(this.pagingTgtId):i.mDiv;c.appendChild(r),c.appendChild(l);var p=d["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);p.appendChild(d["default"].text(this.pageText)),p.className=this.nbPgSpanCssClass,c.appendChild(p),c.appendChild(t);var g=d["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(d["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,c.appendChild(g);var v=d["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(d["default"].text(" "+this.nbPages+" ")),c.appendChild(v),c.appendChild(a),c.appendChild(n),this.pagingSlc=d["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.initialized=!0}}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!this.isEnabled()&&(this.enable(),this.init(),e.resetValues(),t&&e.filter())}},{key:"resetPagingInfo",value:function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)}},{key:"setPagingInfo",value:function(){var t=arguments.length<=0||void 0===arguments[0]?[]:arguments[0],e=this.tf,i=e.tbl.rows,s=this.pagingTgtId?d["default"].id(this.pagingTgtId):e.mDiv,a=d["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t,0===t.length)for(var l=e.refRow;l0)if(s.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var o=0;on;n++){var o=e.validRowsIndex[n],h=s[o],u=h.getAttribute("validRow");n>=a&&l>n?((c["default"].isNull(u)||Boolean("true"===u))&&(h.style.display=""),e.alternateRows&&i&&i.setRowBg(o,n)):(h.style.display="none",e.alternateRows&&i&&i.removeRowBg(o))}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":a(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((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var s=d["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var a=this.resultsPerPage[0],l=this.resultsPerPage[1],n=d["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);n.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var r=this.resultsPerPageTgtId?d["default"].id(this.resultsPerPageTgtId):e.rDiv;n.appendChild(d["default"].text(a));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(n,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(r.appendChild(n),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)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(this.isEnabled()){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)}}}},{key:"_resetPage",value:function(t){var e=this.tf,i=e.feature("store").getPageNb(t);""!==i&&this.changePage(i-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(this.isEnabled()){var i=e.feature("store").getPageLength(t);""!==i&&(this.resultsPerPageSlc.options[i].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this,e=this.tf;if(this.initialized){var i=d["default"].id(this.prfxBtnNextSpan+e.id),s=d["default"].id(this.prfxBtnPrevSpan+e.id),a=d["default"].id(this.prfxBtnLastSpan+e.id),l=d["default"].id(this.prfxBtnFirstSpan+e.id),n=d["default"].id(this.prfxPgBeforeSpan+e.id),r=d["default"].id(this.prfxPgAfterSpan+e.id),o=d["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),d["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",h.next),d["default"].remove(i)),s&&(b["default"].remove(s,"click",h.prev),d["default"].remove(s)),a&&(b["default"].remove(a,"click",h.last),d["default"].remove(a)),l&&(b["default"].remove(l,"click",h.first),d["default"].remove(l)),n&&d["default"].remove(n),r&&d["default"].remove(r),o&&d["default"].remove(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.emitter.off("after-filtering",function(){return t.resetPagingInfo()}),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 a(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 n(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 n(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 a=i.firstChild;f["default"].add(a,"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),f["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 a(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 n(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 n(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 a=this.tgtId?u["default"].id(this.tgtId):e.rDiv;a.appendChild(i);var l=this.contTgtId?u["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var n=i.firstChild;f["default"].add(n,"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),f["default"].add(r,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,f["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,f["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,f["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 a(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 n(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;in;n++){var r=i?n:e[n];this.setRowBg(r,l),l++}this.initialized=!0}}},{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(){if(this.initialized){for(var t=this.tf.refRow;t0?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 f7f7c341..f7cdac07 100644 --- a/dist/tablefilter/tf-1.js +++ b/dist/tablefilter/tf-1.js @@ -1,8 +1,8 @@ /** * tablefilter v0.1.0 by Max Guglielmi - * build date: 2015-12-28T00:17:35.798Z + * build date: 2015-12-28T06:48:43.385Z * 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"),g=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+g?d[l+g]:[u-1]:l-g<=d[0]?d[0]:d[l-g],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 m=l+g;o=m>u-1?d[u-1]:d[m]}else if(c.rowIndex<=d[0])o=d[0];else{var y=d[l-g];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 g=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(),g&&g.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(m){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:"destroy",value:function(){var e=this._ezEditTable;e&&(this.cfg.selection&&(e.Selection.ClearSelections(),e.Selection.Remove()),this.cfg.editable&&e.Editable.Remove()),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(){}}]),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"),g=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+g?d[l+g]:[u-1]:l-g<=d[0]?d[0]:d[l-g],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 m=l+g;o=m>u-1?d[u-1]:d[m]}else if(c.rowIndex<=d[0])o=d[0];else{var y=d[l-g];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 g=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(),g&&g.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(m){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:"destroy",value:function(){var e=this._ezEditTable;e&&(this.cfg.selection&&(e.Selection.ClearSelections(),e.Selection.Remove()),this.cfg.editable&&e.Editable.Remove()),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 aa9ca668..899345d7 100644 --- a/src/extensions/colOps/colOps.js +++ b/src/extensions/colOps/colOps.js @@ -22,6 +22,9 @@ export default class ColOps{ } init(){ + // subscribe to events + this.tf.emitter.on('after-filtering', ()=> this.calc()); + this.calc(); } @@ -310,6 +313,9 @@ export default class ColOps{ } } - destroy(){} + destroy(){ + // unsubscribe to events + this.tf.emitter.off('after-filtering', ()=> this.calc()); + } } diff --git a/src/modules/noResults.js b/src/modules/noResults.js index 1938b30a..b1e58c33 100644 --- a/src/modules/noResults.js +++ b/src/modules/noResults.js @@ -59,10 +59,22 @@ export class NoResults extends Feature{ } this.cont = cont; + + // subscribe to after-filtering event + this.emitter.on('after-filtering', ()=> this.toggle()); + this.initialized = true; this.hide(); } + toggle(){ + if(this.tf.nbVisibleRows > 0){ + this.hide(); + } else { + this.show(); + } + } + show(){ if(!this.initialized || !this.isEnabled()){ return; @@ -115,6 +127,8 @@ export class NoResults extends Feature{ } Dom.remove(this.cont); this.cont = null; + // unsubscribe to after-filtering event + this.emitter.off('after-filtering', ()=> this.toggle()); this.initialized = false; } } diff --git a/src/modules/paging.js b/src/modules/paging.js index d55fc5ed..83e54ead 100644 --- a/src/modules/paging.js +++ b/src/modules/paging.js @@ -334,6 +334,8 @@ export class Paging extends Feature{ this.setPagingInfo(tf.validRowsIndex); } + this.emitter.on('after-filtering', ()=> this.resetPagingInfo()); + this.initialized = true; } @@ -354,6 +356,15 @@ export class Paging extends Feature{ } } + /** + * Reset paging info from scratch after a filtering process + */ + resetPagingInfo(){ + this.startPagingRow = 0; + this.currentPageNb = 1; + this.setPagingInfo(this.tf.validRowsIndex); + } + /** * Calculate number of pages based on valid rows * Refresh paging select according to number of pages @@ -449,8 +460,6 @@ export class Paging extends Feature{ } tf.nbVisibleRows = tf.validRowsIndex.length; - //re-applies filter behaviours after filtering process - tf.applyProps(); // broadcast grouping by page this.emitter.emit('grouped-by-page', tf, this); @@ -779,6 +788,8 @@ export class Paging extends Feature{ this.removeResultsPerPage(); } + this.emitter.off('after-filtering', ()=> this.resetPagingInfo()); + this.pagingSlc = null; this.nbPages = 0; this.disable(); diff --git a/src/modules/popupFilter.js b/src/modules/popupFilter.js index b4762129..68e1db5a 100644 --- a/src/modules/popupFilter.js +++ b/src/modules/popupFilter.js @@ -101,6 +101,10 @@ export class PopupFilter extends Feature{ this.popUpFltImgs[i] = popUpSpan.firstChild; } + // subscribe to events + this.emitter.on('before-filtering', ()=> this.buildIcons()); + this.emitter.on('after-filtering', ()=> this.closeAll()); + this.initialized = true; } @@ -245,6 +249,11 @@ export class PopupFilter extends Feature{ this.popUpFltElms = []; this.popUpFltSpans = []; this.popUpFltImgs = []; + + // unsubscribe to events + this.emitter.off('before-filtering', ()=> this.buildIcons()); + this.emitter.off('after-filtering', ()=> this.closeAll()); + this.initialized = false; } diff --git a/src/modules/store.js b/src/modules/store.js index d24757dd..dd796de5 100644 --- a/src/modules/store.js +++ b/src/modules/store.js @@ -8,13 +8,19 @@ export class Store{ * * TODO: use localStorage and fallback to cookie persistence */ - constructor(tf) { + constructor(tf){ var f = tf.config(); this.duration = !isNaN(f.set_cookie_duration) ? parseInt(f.set_cookie_duration, 10) : 100000; this.tf = tf; + this.emitter = tf.emitter; + } + + init(){ + this.emitter.on('after-filtering', + ()=> this.saveFilterValues(this.tf.fltsValuesCookie)); } /** @@ -97,4 +103,8 @@ export class Store{ return Cookie.read(name); } + destroy(){ + this.emitter.off('after-filtering', + ()=> this.saveFilterValues(this.tf.fltsValuesCookie)); + } } diff --git a/src/tablefilter.js b/src/tablefilter.js index fa97bb44..4ec7e99a 100644 --- a/src/tablefilter.js +++ b/src/tablefilter.js @@ -635,6 +635,7 @@ export class TableFilter { if(this.rememberGridValues || this.rememberPageNb || this.rememberPageLen){ Mod.store = new Store(this); + Mod.store.init(); } if(this.gridLayout){ @@ -874,6 +875,7 @@ export class TableFilter { /* Features */ if(this.hasVisibleRows){ + this.emitter.on('after-filtering', ()=> this.enforceVisibility()); this.enforceVisibility(); } if(this.rowsCounter){ @@ -937,6 +939,11 @@ export class TableFilter { this.initExtensions(); } + // Subscribe to event + if(this.linkedFilters){ + this.emitter.on('after-filtering', ()=> this.linkFilters()); + } + if(this.onFiltersLoaded){ this.onFiltersLoaded.call(null, this); } @@ -1219,13 +1226,21 @@ export class TableFilter { } // Destroy modules - Object.keys(Mod).forEach(function(key) { + Object.keys(Mod).forEach(function(key){ var feature = Mod[key]; if(feature && Types.isFn(feature.destroy)){ feature.destroy(); } }); + // unsubscribe to events + if(this.hasVisibleRows){ + this.emitter.off('after-filtering', ()=> this.enforceVisibility()); + } + if(this.linkedFilters){ + this.emitter.off('after-filtering', ()=> this.linkFilters()); + } + Dom.removeClass(this.tbl, this.prfxTf); this.nbHiddenRows = 0; this.validRowsIndex = null; @@ -1512,9 +1527,9 @@ export class TableFilter { Mod.highlightKeyword.unhighlightAll(); } //removes popup filters active icons - if(this.popupFilters){ - Mod.popupFilter.buildIcons(); - } + // if(this.popupFilters){ + // Mod.popupFilter.buildIcons(); + // } //removes active column header class if(this.markActiveColumns){ this.clearActiveColumns(); @@ -1862,67 +1877,14 @@ export class TableFilter { this.nbVisibleRows = this.validRowsIndex.length; this.nbHiddenRows = hiddenrows; - if(this.rememberGridValues){ - Mod.store.saveFilterValues(this.fltsValuesCookie); - } - - //applies filter props after filtering process - // TODO remove below if statement when custom events in place - if(!this.paging){ - this.applyProps(); - } else { - // Shouldn't need to care of that here... - // TODO: provide a method in paging module - Mod.paging.startPagingRow = 0; - Mod.paging.currentPageNb = 1; - Mod.paging.setPagingInfo(this.validRowsIndex); - } //invokes onafterfilter callback if(this.onAfterFilter){ this.onAfterFilter.call(null, this); } + this.emitter.emit('after-filtering', this); } - /** - * Re-apply the features/behaviour concerned by filtering/paging operation - * - * NOTE: this will disappear whenever custom events in place - */ - applyProps(){ - let Mod = this.Mod; - - //shows rows always visible - if(this.hasVisibleRows){ - this.enforceVisibility(); - } - //columns operations - if(this.hasExtension('colOps')){ - this.extension('colOps').calc(); - } - - //re-populates drop-down filters - if(this.linkedFilters){ - this.linkFilters(); - } - - // if(this.rowsCounter){ - // Mod.rowsCounter.refresh(this.nbVisibleRows); - // } - - if(this.popupFilters){ - Mod.popupFilter.closeAll(); - } - - if(this.noResults){ - if(this.nbVisibleRows > 0){ - Mod.noResults.hide(); - } else { - Mod.noResults.show(); - } - } - } - /** * Return the data of a specified colum * @param {Number} colIndex Column index @@ -2400,12 +2362,14 @@ export class TableFilter { for(let i=0, len=this.fltIds.length; i