diff --git a/.eslintrc b/.eslintrc index 98fe1a12..26a5f40d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -3,8 +3,8 @@ "rules": { "max-len": [2, 80, 2, {"ignoreUrls": true}], "max-depth": [2, 7], - "max-statements": [2, 172], - "complexity": [2, 88], + "max-statements": [2, 166], + "complexity": [2, 86], "no-unused-vars": 2, "no-eval": 2, "no-underscore-dangle": 0, @@ -27,5 +27,8 @@ "es6": true, "browser": true, "node": false + }, + "globals": { + "__webpack_public_path__": false } } diff --git a/README.md b/README.md index fef42f7a..bb2e9438 100644 --- a/README.md +++ b/README.md @@ -122,12 +122,14 @@ Find exhaustive documentation on the configuration options in the [WIKI](https:/ Autogenerated documentation of the ES6 modules is available on the website: [docs](http://koalyptus.github.io/TableFilter/docs) +If you previously used the HTML Table Filter Generator plugin, verify the configuration +options you are using are still supported: [Obsolete](https://github.com/koalyptus/TableFilter/wiki/--Obsolete) + Run this task to generate the documentation in the ``docs/docs`` directory: ```shell grunt esdoc ``` - ## Support * GitHub for reporting bugs and feature requests. diff --git a/dist/starter.html b/dist/starter.html index b9440342..ac274fe4 100644 --- a/dist/starter.html +++ b/dist/starter.html @@ -1,10 +1,10 @@ - tablefilter v0.2.13 - Starter + tablefilter v0.2.17 - Starter -

tablefilter v0.2.13

+

tablefilter v0.2.17

diff --git a/dist/tablefilter/style/colsVisibility.css b/dist/tablefilter/style/colsVisibility.css index 0d9961ef..44fead44 100644 --- a/dist/tablefilter/style/colsVisibility.css +++ b/dist/tablefilter/style/colsVisibility.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * 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 2a354267..a7fdd693 100644 --- a/dist/tablefilter/style/filtersVisibility.css +++ b/dist/tablefilter/style/filtersVisibility.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * 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 706a2d77..e6d1940e 100644 --- a/dist/tablefilter/style/tablefilter.css +++ b/dist/tablefilter/style/tablefilter.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * 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 1164694f..ded0fa30 100644 --- a/dist/tablefilter/style/themes/default/default.css +++ b/dist/tablefilter/style/themes/default/default.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * MIT License */ table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.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}.activeHeader{background:#999 !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 0bcb85e1..e9f89918 100644 --- a/dist/tablefilter/style/themes/mytheme/mytheme.css +++ b/dist/tablefilter/style/themes/mytheme/mytheme.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * MIT License */ table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.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}.activeHeader{background:#81963b !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 1bac9513..4684a76c 100644 --- a/dist/tablefilter/style/themes/skyblue/skyblue.css +++ b/dist/tablefilter/style/themes/skyblue/skyblue.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.967Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.351Z * 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 bdd04112..87df117b 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,10 +1,10 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.904Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.281Z * MIT License */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,function(){return function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i=window.webpackJsonp;window.webpackJsonp=function(s,r){for(var l,a,o=0,h=[];ol;l++)s[l]=arguments[l];if(0!==s.length){if(this.id=null,this.version="0.2.13",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":r(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=h["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 o=this.cfg;this.emitter=new m.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(f){this.nbCells=this.getCellsNb(0)}this.basePath=o.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=o.grid!==!1,this.gridLayout=Boolean(o.grid_layout),this.filtersRowIndex=isNaN(o.filters_row_index)?0:o.filters_row_index,this.headersRow=isNaN(o.headers_row_index)?0===this.filtersRowIndex?1:0:o.headers_row_index,this.fltCellTag="th"!==o.filters_cell_tag||"td"!==o.filters_cell_tag?"td":o.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.validRowsIndex=[],this.fltGridEl=null,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.infDivCssClass=o.inf_div_css_class||"inf",this.lDivCssClass=o.left_div_css_class||"ldiv",this.rDivCssClass=o.right_div_css_class||"rdiv",this.mDivCssClass=o.middle_div_css_class||"mdiv",this.contDivCssClass=o.content_div_css_class||"cont",this.stylePath=o.style_path||this.basePath+"style/",this.stylesheet=o.stylesheet||this.stylePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=o.flts_row_css_class||"fltrow",this.enableIcons=o.enable_icons!==!1,this.alternateRows=Boolean(o.alternate_rows),this.hasColWidths=p["default"].isArray(o.col_widths),this.colWidths=this.hasColWidths?o.col_widths:null,this.fltCssClass=o.flt_css_class||"flt",this.fltMultiCssClass=o.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=o.flt_small_css_class||"flt_s",this.singleFltCssClass=o.single_flt_css_class||"single_flt",this.enterKey=o.enter_key!==!1,this.onBeforeFilter=p["default"].isFn(o.on_before_filter)?o.on_before_filter:null,this.onAfterFilter=p["default"].isFn(o.on_after_filter)?o.on_after_filter:null,this.caseSensitive=Boolean(o.case_sensitive),this.hasExactMatchByCol=p["default"].isArray(o.columns_exact_match),this.exactMatchByCol=this.hasExactMatchByCol?o.columns_exact_match:[],this.exactMatch=Boolean(o.exact_match),this.linkedFilters=Boolean(o.linked_filters),this.disableExcludedOptions=Boolean(o.disable_excluded_options),this.activeFilterId=null,this.hasVisibleRows=Boolean(o.rows_always_visible),this.visibleRows=this.hasVisibleRows?o.rows_always_visible:[],this.isExternalFlt=Boolean(o.external_flt_grid),this.externalFltTgtIds=o.external_flt_grid_ids||[],this.externalFltEls=[],this.execDelay=isNaN(o.exec_delay)?100:parseInt(o.exec_delay,10),this.onFiltersLoaded=p["default"].isFn(o.on_filters_loaded)?o.on_filters_loaded:null,this.singleSearchFlt=Boolean(o.single_filter),this.onRowValidated=p["default"].isFn(o.on_row_validated)?o.on_row_validated:null,this.customCellDataCols=o.custom_cell_data_cols?o.custom_cell_data_cols:[],this.customCellData=p["default"].isFn(o.custom_cell_data)?o.custom_cell_data:null,this.watermark=o.watermark||"",this.isWatermarkArray=p["default"].isArray(this.watermark),this.toolBarTgtId=o.toolbar_target_id||null,this.help=p["default"].isUndef(o.help_instructions)?void 0:Boolean(o.help_instructions),this.popupFilters=Boolean(o.popup_filters),this.markActiveColumns=Boolean(o.mark_active_columns),this.activeColumnsCssClass=o.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=p["default"].isFn(o.on_before_active_column)?o.on_before_active_column:null,this.onAfterActiveColumn=p["default"].isFn(o.on_after_active_column)?o.on_after_active_column:null,this.displayAllText=o.display_all_text||"Clear",this.enableEmptyOption=Boolean(o.enable_empty_option),this.emptyText=o.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(o.enable_non_empty_option),this.nonEmptyText=o.non_empty_text||"(Non empty)",this.onSlcChange=o.on_change!==!1,this.sortSlc=o.sort_select!==!1,this.isSortNumAsc=Boolean(o.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?o.sort_num_asc:[],this.isSortNumDesc=Boolean(o.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?o.sort_num_desc:[],this.loadFltOnDemand=Boolean(o.load_filters_on_demand),this.hasCustomOptions=p["default"].isObj(o.custom_options),this.customOptions=o.custom_options,this.rgxOperator=o.regexp_operator||"rgx:",this.emOperator=o.empty_operator||"[empty]",this.nmOperator=o.nonempty_operator||"[nonempty]",this.orOperator=o.or_operator||"||",this.anOperator=o.and_operator||"&&",this.grOperator=o.greater_operator||">",this.lwOperator=o.lower_operator||"<",this.leOperator=o.lower_equal_operator||"<=",this.geOperator=o.greater_equal_operator||">=",this.dfOperator=o.different_operator||"!",this.lkOperator=o.like_operator||"*",this.eqOperator=o.equal_operator||"=",this.stOperator=o.start_with_operator||"{",this.enOperator=o.end_with_operator||"}",this.curExp=o.cur_exp||"^[¥£€$]",this.separator=o.separator||",",this.rowsCounter=Boolean(o.rows_counter),this.statusBar=Boolean(o.status_bar),this.loader=Boolean(o.loader),this.displayBtn=Boolean(o.btn),this.btnText=o.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=o.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(o.btn_reset),this.btnResetCssClass=o.btn_reset_css_class||"reset",this.onBeforeReset=p["default"].isFn(o.on_before_reset)?o.on_before_reset:null,this.onAfterReset=p["default"].isFn(o.on_after_reset)?o.on_after_reset:null,this.paging=Boolean(o.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.autoFilter=Boolean(o.auto_filter),this.autoFilterDelay=isNaN(o.auto_filter_delay)?900:o.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(o.highlight_keywords),this.noResults=p["default"].isObj(o.no_results_message)||Boolean(o.no_results_message),this.state=p["default"].isObj(o.state)||Boolean(o.state),this.defaultDateType=o.default_date_type||"DMY",this.thousandsSeparator=o.thousands_separator||",",this.decimalSeparator=o.decimal_separator||".",this.hasColNbFormat=p["default"].isArray(o.col_number_format),this.colNbFormat=this.hasColNbFormat?o.col_number_format:null,this.hasColDateType=p["default"].isArray(o.col_date_type),this.colDateType=this.hasColDateType?o.col_date_type:null,this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.prfxResponsive="resp",this.rememberGridValues=Boolean(o.remember_grid_values),this.rememberPageNb=this.paging&&o.remember_page_number,this.rememberPageLen=this.paging&&o.remember_page_length,this.hasPersistence=this.rememberGridValues||this.rememberPageNb||this.rememberPageLen,this.extensions=o.extensions,this.hasExtensions=p["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(o.enable_default_theme),this.hasThemes=this.enableDefaultTheme||p["default"].isArray(o.themes),this.themes=o.themes||[],this.themesPath=o.themes_path||this.stylePath+"themes/",this.responsive=Boolean(o.responsive),this.Mod={},this.ExtRegistry={},this.Evt={detectKey:function(t){if(this.enterKey&&t){var e=a["default"].keyCode(t);13===e?(this.filter(),a["default"].cancel(t),a["default"].stop(t)):(this.isUserTyping=!0,N.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyUp:function(t){function e(){N.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=a["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=N.setInterval(e.bind(this),this.autoFilterDelay)):(N.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,N.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},onInpFocus:function(t){var e=a["default"].target(t);this.emitter.emit("filter-focus",this,e)}}}}return t.prototype.init=function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),e.help||(e.help=new O.Help(this)),this.help&&e.help.init(),this.state&&(e.state||(e.state=new L.State(this)),e.state.init()),this.hasPersistence&&(e.store||(e.store=new y.Store(this)),e.store.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new _.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new C.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new w.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new x.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var r=0;i>r;r++){this.emitter.emit("before-filter-init",this,r);var l=h["default"].create(this.fltCellTag),a=this.getFilterType(r);this.singleSearchFlt&&(l.colSpan=this.nbCells),this.gridLayout||n.appendChild(l),s=r==i-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(a=this.fltTypeInp,s=this.singleFltCssClass),a===this.fltTypeSlc||a===this.fltTypeMulti?(e.dropdown||(e.dropdown=new T.Dropdown(this)),e.dropdown.init(r,this.isExternalFlt,l)):a===this.fltTypeCheckList?(e.checkList||(e.checkList=new F.CheckList(this)),e.checkList.init(r,this.isExternalFlt,l)):this._buildInputFilter(r,s,l),r==i-1&&this.displayBtn&&this._buildSubmitButton(r,l),this.emitter.emit("after-filter-init",this,r)}this.emitter.on(["filter-focus"],function(e,i){return t.setActiveFilterId(i.id)})}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new P.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new R.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new S.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new I.ClearButton(this),e.clearButton.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new E.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new k.NoResults(this)),e.noResults.init()),this._hasGrid=!0,this.hasPersistence&&this.resetFilterValues(),this.gridLayout||(h["default"].addClass(this.tbl,this.prfxTf),this.responsive&&h["default"].addClass(this.tbl,this.prfxResponsive)),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.initialized=!0,this.emitter.emit("initialized",this)}},t.prototype._insertFiltersRow=function(){if(!this.gridLayout){var t=void 0,e=h["default"].tag(this.tbl,"thead");return t=e.length>0?e[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}},t.prototype._initNoFilters=function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)},t.prototype._buildInputFilter=function(t,e,i){var s=this.getFilterType(t),n=this.isExternalFlt?this.externalFltTgtIds[t]:null,r=s===this.fltTypeInp?"text":"hidden",l=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",r],["ct",t]);"hidden"!==r&&this.watermark&&l.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),l.className=e||this.fltCssClass,a["default"].add(l,"focus",this.Evt.onInpFocus.bind(this)),n?(h["default"].id(n).appendChild(l),this.externalFltEls.push(l)):i.appendChild(l),this.fltIds.push(l.id),a["default"].add(l,"keypress",this.Evt.detectKey.bind(this)),a["default"].add(l,"keydown",this.Evt.onKeyDown.bind(this)),a["default"].add(l,"keyup",this.Evt.onKeyUp.bind(this)),a["default"].add(l,"blur",this.Evt.onInpBlur.bind(this))},t.prototype._buildSubmitButton=function(t,e){var i=this,s=this.isExternalFlt?this.externalFltTgtIds[t]:null,n=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+t+"_"+this.id],["type","button"],["value",this.btnText]);n.className=this.btnCssClass,s?h["default"].id(s).appendChild(n):e.appendChild(n),a["default"].add(n,"click",function(){return i.filter()})},t.prototype.feature=function(t){return this.Mod[t]},t.prototype.initExtensions=function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)},t.prototype.loadExtension=function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,r=void 0;s&&n?r=t.path+s:(s=s.replace(".js",""),r="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(29)("./"+r)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}},t.prototype.extension=function(t){return this.ExtRegistry[t]},t.prototype.hasExtension=function(t){return!p["default"].isEmpty(this.ExtRegistry[t])},t.prototype.destroyExtensions=function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}},t.prototype.loadThemes=function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(p["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],r=n.name,l=n.path,a=this.prfxTf+r;r&&!l?l=this.themesPath+r+"/"+r+".css":!r&&n.path&&(r="theme{0}".replace("{0}",i)),this.isImported(l,"link")||this["import"](a,l,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)},t.prototype.getStylesheet=function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return h["default"].id(this.prfxTf+t)},t.prototype.destroy=function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod,s=this.emitter;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.markActiveColumns&&(this.clearActiveColumns(),s.off(["before-filtering"],function(){return t.clearActiveColumns()}),s.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions(),this.validateAllRows(),this.fltGrid&&!this.gridLayout&&(this.fltGridEl=e[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),s.emit("destroy",this),Object.keys(i).forEach(function(t){var e=i[t];e&&p["default"].isFn(e.destroy)&&e.destroy()}),this.hasVisibleRows&&s.off(["after-filtering"],function(){return t.enforceVisibility()}),this.linkedFilters&&s.off(["after-filtering"],function(){return t.linkFilters()}),this.emitter.off(["filter-focus"],function(e,i){return t.setActiveFilterId(i.id)}),h["default"].removeClass(this.tbl,this.prfxTf),h["default"].removeClass(this.tbl,this.prfxResponsive),this.nbHiddenRows=0,this.validRowsIndex=[],this.fltIds=[],this._hasGrid=!1,this.initialized=!1}},t.prototype.setToolbar=function(){if(!this.infDiv){var t=h["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)h["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.Mod.gridLayout;e.tblMainCont.appendChild(t),t.className=e.gridInfDivCssClass}else{var i=h["default"].create("caption");i.appendChild(t),this.tbl.insertBefore(i,this.tbl.firstChild)}this.infDiv=h["default"].id(this.prfxInfDiv+this.id);var s=h["default"].create("div",["id",this.prfxLDiv+this.id]);s.className=this.lDivCssClass,t.appendChild(s),this.lDiv=h["default"].id(this.prfxLDiv+this.id);var n=h["default"].create("div",["id",this.prfxRDiv+this.id]);n.className=this.rDivCssClass,t.appendChild(n),this.rDiv=h["default"].id(this.prfxRDiv+this.id);var r=h["default"].create("div",["id",this.prfxMDiv+this.id]);r.className=this.mDivCssClass,t.appendChild(r),this.mDiv=h["default"].id(this.prfxMDiv+this.id),p["default"].isUndef(this.help)&&(this.Mod.help.enabled=!0,this.emitter.emit("init-help",this))}},t.prototype.removeToolbar=function(){if(this.infDiv){h["default"].remove(this.infDiv),this.infDiv=null;var t=this.tbl,e=h["default"].tag(t,"caption");e.length>0&&[].forEach.call(e,function(e){return t.removeChild(e)})}},t.prototype.removeExternalFlts=function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=h["default"].id(s);n&&(n.innerHTML="")}},t.prototype.isCustomOptions=function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)},t.prototype.getCustomOptions=function(t){if(!p["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],r=i.indexOf(t),l=e.values[r],a=e.texts[r],o=e.sorts[r],h=0,f=l.length;f>h;h++)n.push(l[h]),a[h]?s.push(a[h]):s.push(l[h]);return o&&(n.sort(),s.sort()),[n,s]}},t.prototype.resetFilterValues=function(){var t=this;if(this.rememberGridValues){var e=this.Mod.store.getFilterValues();e.forEach(function(e,i){" "!==e&&t.setFilterValue(i,e)}),this.filter()}},t.prototype.filter=function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(b,""),t=t.replace(m,""),t=t.replace(y,""),t=t.replace(_,"");var s=t;(a.test(t)||o.test(t)||f.test(t)||d.test(t)||c.test(t))&&(s=h["default"].getText(i)),""!==s&&this.emitter.emit("highlight-keyword",this,i,s)}}function e(t,e,i){t=u["default"].matchCase(t,this.caseSensitive);var s=void 0,l=v["default"].removeNbFormat,h=f.test(t),p=a.test(t),T=d.test(t),F=o.test(t),P=c.test(t),R=m.test(t),S=b.test(t),I=y.test(t),O=_.test(t),E=C===t,L=w===t,N=x.test(t),B=h&&g["default"].isValid(t.replace(f,""),k),D=p&&g["default"].isValid(t.replace(a,""),k),M=T&&g["default"].isValid(t.replace(d,""),k),A=F&&g["default"].isValid(t.replace(o,""),k),H=P&&g["default"].isValid(t.replace(c,""),k),j=R&&g["default"].isValid(t.replace(m,""),k),V=void 0,U=void 0;if(g["default"].isValid(e,k))V=g["default"].format(e,k),B?(U=g["default"].format(t.replace(f,""),k),s=U>V):D?(U=g["default"].format(t.replace(a,""),k),s=U>=V):A?(U=g["default"].format(t.replace(o,""),k),s=V>=U):M?(U=g["default"].format(t.replace(d,""),k),s=V>U):H?(U=g["default"].format(t.replace(c,""),k),s=V.toString()!=U.toString()):j?(U=g["default"].format(t.replace(m,""),k),s=V.toString()==U.toString()):b.test(t)?s=u["default"].contains(t.replace(b,""),e,!1,this.caseSensitive):g["default"].isValid(t,k)?(U=g["default"].format(t,k),s=V.toString()===U.toString()):s=E?u["default"].isEmpty(e):L?!u["default"].isEmpty(e):u["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(n=l(e,this.colNbFormat[i]),r=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(n=l(e,"us"),r="us"):(n=l(e,"eu"),r="eu"),p)s=n<=l(t.replace(a,""),r);else if(F)s=n>=l(t.replace(o,""),r);else if(h)s=nl(t.replace(d,""),r);else if(P)s=!u["default"].contains(t.replace(c,""),e,!1,this.caseSensitive);else if(S)s=u["default"].contains(t.replace(b,""),e,!1,this.caseSensitive);else if(R)s=u["default"].contains(t.replace(m,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(y,""));else if(O){var z=t.replace(_,"");s=e.lastIndexOf(z,e.length-1)===e.length-1-(z.length-1)&&e.lastIndexOf(z,e.length-1)>-1}else if(E)s=u["default"].isEmpty(e);else if(L)s=!u["default"].isEmpty(e);else if(N)try{var W=t.replace(x,""),G=new RegExp(W);s=G.test(e)}catch(K){s=!1}else s=u["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&this._hasGrid){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=0;this.validRowsIndex=[];for(var n,r,l=this.getFiltersValue(),a=new RegExp(this.leOperator),o=new RegExp(this.geOperator),f=new RegExp(this.lwOperator),d=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),b=new RegExp(u["default"].rgxEsc(this.lkOperator)),m=new RegExp(this.eqOperator),y=new RegExp(this.stOperator),_=new RegExp(this.enOperator),C=this.emOperator,w=this.nmOperator,x=new RegExp(u["default"].rgxEsc(this.rgxOperator)),T=this.refRow;TO;O++){var E=l[this.singleSearchFlt?0:O],k=this.hasColDateType?this.colDateType[O]:this.defaultDateType;if(""!==E){var L=u["default"].matchCase(this.getCellData(F[O]),this.caseSensitive),N=E.toString().split(this.orOperator),B=N.length>1,D=E.toString().split(this.anOperator),M=D.length>1;if(p["default"].isArray(E)||B||M){var A=void 0,H=void 0,j=!1;H=p["default"].isArray(E)?E:B?N:D;for(var V=0,U=H.length;U>V&&(A=u["default"].trim(H[V]),j=e.call(this,A,L,O),t.call(this,A,j,F[O]),!(B&&j||M&&!j))&&(!p["default"].isArray(E)||!j);V++);R[O]=j}else R[O]=e.call(this,u["default"].trim(E),L,O),t.call(this,E,R[O],F[O]);R[O]||(S=!1),this.singleSearchFlt&&R[O]&&(I=!0),this.emitter.emit("cell-processed",this,O,F[O])}}this.singleSearchFlt&&I&&(S=!0),S?this.validateRow(T,!0):(this.validateRow(T,!1),s++),this.emitter.emit("row-processed",this,T,this.validRowsIndex.length,S)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=s,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this,l)}},t.prototype.getColValues=function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,r=[];e&&r.push(this.getHeadersText()[t]);for(var l=this.refRow;l0&&(a=-1!=s.indexOf(l));var o=n[l].cells,h=o.length;if(h===this.nbCells&&!a)for(var f=0;h>f;f++)if(f==t&&""===n[l].style.display){var u=this.getCellData(o[f]),d=this.colNbFormat?this.colNbFormat[t]:null,p=i?v["default"].removeNbFormat(u,d):u;r.push(p)}}return r}},t.prototype.getFilterValue=function(t){if(this.fltGrid){var e="",i=[],s=this.getFilterElement(t);if(!s)return"";var n=this.getFilterType(t);if(n!==this.fltTypeMulti&&n!==this.fltTypeCheckList)e=s.value;else if(n===this.fltTypeMulti){for(var r=0,l=s.options.length;l>r;r++)s.options[r].selected&&i.push(s.options[r].value);e=i.length>0?i:""}else n===this.fltTypeCheckList&&(null!==s.getAttribute("value")&&(i=s.getAttribute("value"),i=i.substr(0,i.length-3),i=i.split(" "+this.orOperator+" ")),e=i.length>0?i:"");return p["default"].isArray(e)&&1===e.length&&""===e[0]&&(e=""),e}},t.prototype.getFiltersValue=function(){if(this.fltGrid){for(var t=[],e=0,i=this.fltIds.length;i>e;e++){var s=this.getFilterValue(e);p["default"].isArray(s)?t.push(s):t.push(u["default"].trim(s))}return t}},t.prototype.getFilterId=function(t){return this.fltGrid?this.fltIds[t]:void 0},t.prototype.getFiltersByType=function(t,e){if(this.fltGrid){for(var i=[],s=0,n=this.fltIds.length;n>s;s++){var r=this.getFilterType(s);if(r===u["default"].lower(t)){var l=e?s:this.fltIds[s];i.push(l)}}return i}},t.prototype.getFilterElement=function(t){var e=this.fltIds[t];return h["default"].id(e)},t.prototype.getCellsNb=function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length},t.prototype.getRowsNb=function(t){var e=p["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)},t.prototype.getCellData=function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):h["default"].getText(t)},t.prototype.getTableData=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var r=this.refRow;ro;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var f=this.getCellData(a[o]);l[1].push(f)}s.push(l)}return s},t.prototype.getFilteredData=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var r=this.getValidRows(!0),l=0;ln;n++){var l=i[n],a=l[1],o=a[t];s.push(o)}return s},t.prototype.getRowDisplay=function(t){return p["default"].isObj(t)?t.style.display:null},t.prototype.validateRow=function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}},t.prototype.validateAllRows=function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;t0,r=n?null:B.createDocumentFragment(),l=0;e>l;l++){var a=void 0;n?a=s[l]:(a=h["default"].create("col",["id",this.id+"_col_"+l]),r.appendChild(a)),a.style.width=i[l]}n||t.insertBefore(r,t.firstChild)}this.hasColWidths&&(t=t||this.tbl,e.call(this))},t.prototype.enforceVisibility=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)}},t.prototype.clearFilters=function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.filter(),this.onAfterReset&&this.onAfterReset.call(null,this),this.emitter.emit("after-clearing-filters",this)}},t.prototype.clearActiveColumns=function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)},t.prototype.markActiveColumn=function(t){var e=this.getHeaderElement(t);h["default"].hasClass(e,this.activeColumnsCssClass)||(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,t),h["default"].addClass(e,this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,t))},t.prototype.getActiveFilterId=function(){return this.activeFilterId},t.prototype.setActiveFilterId=function(t){this.activeFilterId=t},t.prototype.getColumnIndexFromFilterId=function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=t.split("_")[0];return e=e.split(this.prfxFlt)[1],parseInt(e,10)},t.prototype.activateFilter=function(t){p["default"].isUndef(t)||this.setActiveFilterId(this.getFilterId(t)); -},t.prototype.linkFilters=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);for(var n=this.getColumnIndexFromFilterId(this.activeFilterId),r=0,l=s.length;l>r;r++){var a=h["default"].id(this.fltIds[s[r]]),o=this.getFilterValue(s[r]);if(n!==s[r]||this.paging&&-1!=t.indexOf(s[r])&&n===s[r]||!this.paging&&(-1!=i.indexOf(s[r])||-1!=e.indexOf(s[r]))||o===this.displayAllText){if(this.loadFltOnDemand){var f=h["default"].createOpt(this.displayAllText,"");a.innerHTML="",a.appendChild(f)}-1!=i.indexOf(s[r])?this.emitter.emit("build-checklist-filter",this,s[r]):this.emitter.emit("build-select-filter",this,s[r],!0),this.setFilterValue(s[r],o)}}}},t.prototype.isExactMatch=function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp},t.prototype.isImported=function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",r=h["default"].tag(B,s),l=0,a=r.length;a>l;l++)if(void 0!==r[l][n]&&r[l][n].match(t)){i=!0;break}return i},t.prototype["import"]=function(t,e,i,s){var n=s?s:"script",r=this.isImported(e,n);if(!r){var l=this,a=!1,o=void 0,f=h["default"].tag(B,"head")[0];o="link"===u["default"].lower(n)?h["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):h["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){a||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(a=!0,"function"==typeof i&&i.call(null,l))},o.onerror=function(){throw new Error("TF script could not load: "+e)},f.appendChild(o)}},t.prototype.hasGrid=function(){return this._hasGrid},t.prototype.getFiltersId=function(){return this.fltIds||[]},t.prototype.getValidRows=function(t){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e1)for(var s=0;s2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}-1!==e.indexOf("M")&&-1!==e.indexOf("D")&&-1!==e.indexOf("Y")||(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var r=t.split(RegExp.$1),l=void 0,a=void 0,o=void 0;l="M"===e.substring(0,1)?r[0]:"M"===e.substring(1,2)?r[1]:r[2],a="D"===e.substring(0,1)?r[0]:"D"===e.substring(1,2)?r[1]:r[2],o="Y"===e.substring(0,1)?r[0]:"Y"===e.substring(1,2)?r[1]:r[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(l,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=h.getDate()?!1:parseInt(l,10)-1==h.getMonth()},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,r=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":r=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(r[2]),s(r[1])-1,r[0]);break;case"DMY":r=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[1]-1,r[0]);break;case"MDY":r=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[0]-1,r[1]);break;case"YMD":r=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(r[0]),r[1]-1,r[2]);break;default:r=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[1]-1,r[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(4),r=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===r["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")}Object.defineProperty(e,"__esModule",{value:!0});e.Emitter=function(){function t(){i(this,t),this.events={}}return t.prototype.on=function(t,e){var i=this;t.forEach(function(t){i.events[t]=i.events[t]||[],i.events[t].push(e)})},t.prototype.off=function(t,e){var i=this;t.forEach(function(t){t in i.events&&i.events[t].splice(i.events[t].indexOf(e),1)})},t.prototype.emit=function(t){if(t in this.events)for(var e=0;e0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var r=s.indexOf(";",n);-1===r&&(r=s.length),e=unescape(s.substring(n,r))}}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,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.GridLayout=void 0;var a=i(11),o=i(2),h=s(o),f=i(3),u=s(f),d=i(1),p=s(d),c=i(4),g=s(c);e.GridLayout=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"gridLayout")),l=s.config;return s.gridWidth=l.grid_width||null,s.gridHeight=l.grid_height||null,s.gridMainContCssClass=l.grid_cont_css_class||"grd_Cont",s.gridContCssClass=l.grid_tbl_cont_css_class||"grd_tblCont",s.gridHeadContCssClass=l.grid_tblHead_cont_css_class||"grd_headTblCont",s.gridInfDivCssClass=l.grid_inf_grid_css_class||"grd_inf",s.gridHeadRowIndex=l.grid_headers_row_index||0,s.gridHeadRows=l.grid_headers_rows||[0],s.gridEnableFilters=void 0!==l.grid_enable_default_filters?l.grid_enable_default_filters:!0,s.noHeaders=Boolean(l.grid_no_headers),s.gridDefaultColWidth=l.grid_default_col_width||"100px",s.gridColElms=[],s.prfxMainTblCont="gridCont_",s.prfxTblCont="tblCont_",s.prfxHeadTblCont="tblHeadCont_",s.prfxHeadTbl="tblHead_",s.prfxGridFltTd="_td_",s.prfxGridTh="tblHeadTh_",s.sourceTblHtml=i.tbl.outerHTML,i.fltGrid=s.gridEnableFilters,s}return l(e,t),e.prototype.init=function(){var t=this,e=this.tf,i=this.config,s=e.tbl;if(!this.initialized){if(e.refRow=u["default"].isNull(e.startRow)?0:e.startRow,e.headersRow=0,e.filtersRowIndex=1,e.isExternalFlt=!0,!e.hasColWidths){e.colWidths=[];for(var n=0;n0&&s.removeChild(P[0]),this.headTbl.style.tableLayout="fixed",s.style.tableLayout="fixed",this.headTbl.cellPadding=s.cellPadding,this.headTbl.cellSpacing=s.cellSpacing,e.setColWidths(this.headTbl),s.style.width="",this.headTbl.style.width=s.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var i=p["default"].target(e),s=i.scrollLeft;t.headTblCont.scrollLeft=s});var R=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=b),this.tblHasColTag=h["default"].tag(s,"col").length>0;var S=function(){for(var t=e.nbCells-1;t>=0;t--){var i=h["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=h["default"].tag(s,"col"),O=0;O',s.popUpDivCssClass=l.popup_div_css_class||"popUpFilter",s.onBeforePopUpOpen=h["default"].isFn(l.on_before_popup_filter_open)?l.on_before_popup_filter_open:null,s.onAfterPopUpOpen=h["default"].isFn(l.on_after_popup_filter_open)?l.on_after_popup_filter_open:null,s.onBeforePopUpClose=h["default"].isFn(l.on_before_popup_filter_close)?l.on_before_popup_filter_close:null,s.onAfterPopUpClose=h["default"].isFn(l.on_after_popup_filter_close)?l.on_after_popup_filter_close:null,s.popUpFltSpans=[],s.popUpFltImgs=[],s.popUpFltElms=s.popUpFltElmCache||[],s.popUpFltAdjustToContainer=!0,s.prfxPopUpSpan="popUpSpan_",s.prfxPopUpDiv="popUpDiv_",s}return l(i,e),i.prototype.onClick=function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var r=this.popUpFltElms[n],l=this.tf.getHeaderElement(n),a=.95*l.clientWidth;r.style.width=parseInt(a,10)+"px"}p["default"].cancel(i),p["default"].stop(i)},i.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;iy;y++)if(t===y&&(!e||e&&i.disableExcludedOptions)||t===y&&e&&(""===r[c].style.display&&!i.paging||i.paging&&(!i.validRowsIndex||i.validRowsIndex&&-1!=i.validRowsIndex.indexOf(c))&&(void 0===a||a===t||a!=t&&-1!=i.validRowsIndex.indexOf(c)))){var _=i.getCellData(b[y]),C=p["default"].matchCase(_,l);if(u["default"].has(this.opts,C,l)||this.opts.push(_),e&&i.disableExcludedOptions){var w=d[y];w||(w=i.getFilteredDataCol(y)),u["default"].has(w,C,l)||u["default"].has(f,C,l)||f.push(_)}}}if(this.isCustom){var x=i.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(i.sortSlc&&!this.isCustom&&(l?(this.opts.sort(),f&&f.sort()):(this.opts.sort(g["default"].ignoreCase),f&&f.sort(g["default"].ignoreCase))),-1!=i.sortNumAsc.indexOf(t))try{this.opts.sort(g["default"].numSortAsc),f&&f.sort(g["default"].numSortAsc),this.isCustom&&this.optsTxt.sort(g["default"].numSortAsc)}catch(T){throw new Error(m.replace("{0}",t).replace("{1}","ascending"))}if(-1!=i.sortNumDesc.indexOf(t))try{this.opts.sort(g["default"].numSortDesc),f&&f.sort(g["default"].numSortDesc),this.isCustom&&this.optsTxt.sort(g["default"].numSortDesc)}catch(T){throw new Error(m.replace("{0}",t).replace("{1}","ascending"))}this.addOptions(t,n,e,f),this.emitter.emit("after-populating-filter",i,t,n)},e.prototype.addOptions=function(t,e,i,s){var n=this.tf,r=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var l=0;li?-1:i>s?1:0},numSortAsc:function(t,e){return t-e},numSortDesc:function(t,e){return e-t}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.CheckList=void 0;var a=i(11),o=i(2),h=s(o),f=i(16),u=s(f),d=i(4),p=s(d),c=i(17),g=s(c),b=i(1),v=s(b),m="Filter options for column {0} cannot be sorted in {1} manner.";e.CheckList=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"checkList")),l=i.config();return s.checkListDiv=[],s.checkListDivCssClass=l.div_checklist_css_class||"div_checklist",s.checkListCssClass=l.checklist_css_class||"flt_checklist",s.checkListItemCssClass=l.checklist_item_css_class||"flt_checklist_item",s.checkListSlcItemCssClass=l.checklist_selected_item_css_class||"flt_checklist_slc_item",s.activateCheckListTxt=l.activate_checklist_text||"Click to load filter data",s.checkListItemDisabledCssClass=l.checklist_item_disabled_css_class||"flt_checklist_item_disabled",s.enableCheckListResetFilter=l.enable_checklist_reset_filter!==!1,s.prfxCheckListDiv="chkdiv_",s.isCustom=null,s.opts=null,s.optsTxt=null,s.excludedOpts=null,s}return l(e,t),e.prototype.onChange=function(t){var e=v["default"].target(t),i=this.tf;this.emitter.emit("filter-focus",i,e),i.filter()},e.prototype.optionClick=function(t){this.setCheckListValues(t.target),this.onChange(t)},e.prototype.onCheckListClick=function(t){var e=this,i=v["default"].target(t);if(this.tf.loadFltOnDemand&&"0"===i.getAttribute("filled")){var s=i.getAttribute("ct"),n=this.checkListDiv[s];this.build(s),v["default"].remove(n,"click",function(t){return e.onCheckListClick(t)})}},e.prototype.init=function(t,e,i){var s=this,n=this.tf,r=e?n.externalFltTgtIds[t]:null,l=h["default"].create("div",["id",this.prfxCheckListDiv+t+"_"+n.id],["ct",t],["filled","0"]);l.className=this.checkListDivCssClass,r?(h["default"].id(r).appendChild(l),n.externalFltEls.push(l)):i.appendChild(l),this.checkListDiv[t]=l,n.fltIds.push(n.prfxFlt+t+"_"+n.id),n.loadFltOnDemand?(v["default"].add(l,"click",function(t){return s.onCheckListClick(t)}),l.appendChild(h["default"].text(this.activateCheckListTxt))):this.build(t),this.emitter.on(["build-checklist-filter"],function(t,e,i){return s.build(e,i)}),this.emitter.on(["select-checklist-options"],function(t,e,i){return s.selectOptions(e,i)}),this.initialized=!0},e.prototype.build=function(t){var e=this,i=this.tf;t=parseInt(t,10),this.emitter.emit("before-populating-filter",i,t),this.opts=[],this.optsTxt=[];var s=this.checkListDiv[t],n=h["default"].create("ul",["id",i.fltIds[t]],["colIndex",t]);n.className=this.checkListCssClass,v["default"].add(n,"change",function(t){return e.onChange(t)});var r=i.tbl.rows;this.isCustom=i.isCustomOptions(t);var l=void 0,a=i.getActiveFilterId();i.linkedFilters&&a&&(l=i.getColumnIndexFromFilterId(a));var o=[];i.linkedFilters&&i.disableExcludedOptions&&(this.excludedOpts=[]),s.innerHTML="";for(var f=i.refRow;fb;b++)if(t===b&&(!i.linkedFilters||i.linkedFilters&&i.disableExcludedOptions)||t===b&&i.linkedFilters&&(""===r[f].style.display&&!i.paging||i.paging&&(!l||l===t||l!=t&&-1!=i.validRowsIndex.indexOf(f)))){var y=i.getCellData(d[b]),_=p["default"].matchCase(y,i.matchCase);u["default"].has(this.opts,_,i.matchCase)||this.opts.push(y);var C=o[b];i.linkedFilters&&i.disableExcludedOptions&&(C||(C=i.getFilteredDataCol(b)),u["default"].has(C,_,i.matchCase)||u["default"].has(this.excludedOpts,_,i.matchCase)||this.excludedOpts.push(y))}}if(this.isCustom){var w=i.getCustomOptions(t);this.opts=w[0],this.optsTxt=w[1]}if(i.sortSlc&&!this.isCustom&&(i.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(g["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(g["default"].ignoreCase))),-1!=i.sortNumAsc.indexOf(t))try{this.opts.sort(g["default"].numSortAsc),this.excludedOpts&&this.excludedOpts.sort(g["default"].numSortAsc),this.isCustom&&this.optsTxt.sort(g["default"].numSortAsc)}catch(x){throw new Error(m.replace("{0}",t).replace("{1}","ascending"))}if(-1!=i.sortNumDesc.indexOf(t))try{this.opts.sort(g["default"].numSortDesc),this.excludedOpts&&this.excludedOpts.sort(g["default"].numSortDesc),this.isCustom&&this.optsTxt.sort(g["default"].numSortDesc)}catch(x){throw new Error(m.replace("{0}",t).replace("{1}","descending"))}this.addChecks(t,n),i.loadFltOnDemand&&(s.innerHTML=""),s.appendChild(n),s.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",i,t,s)},e.prototype.addChecks=function(t,e){for(var i=this,s=this.tf,n=this.addTChecks(t,e),r=0;rr;r++){var l=h["default"].tag(s,"li")[r],a=h["default"].tag(l,"label")[0],o=h["default"].tag(l,"input")[0],f=p["default"].matchCase(h["default"].getText(a),i.caseSensitive);""!==f&&u["default"].has(e,f,i.caseSensitive)?(o.checked=!0,this.setCheckListValues(o)):(o.checked=!1,this.setCheckListValues(o))}}},e.prototype.destroy=function(){var t=this;this.emitter.off(["build-checklist-filter"],function(e,i,s){return t.build(i,s)}),this.emitter.off(["select-checklist-options"],function(e,i,s){return t.selectOptions(i,s)})},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.RowsCounter=void 0;var a=i(11),o=i(2),h=s(o),f=i(3),u=s(f);e.RowsCounter=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"rowsCounter")),l=s.config;return s.rowsCounterTgtId=l.rows_counter_target_id||null,s.rowsCounterDiv=null,s.rowsCounterSpan=null,s.rowsCounterText=l.rows_counter_text||"Rows: ",s.fromToTextSeparator=l.from_to_text_separator||"-",s.overText=l.over_text||" / ",s.totRowsCssClass=l.tot_rows_css_class||"tot",s.prfxCounter="counter_",s.prfxTotRows="totrows_span_",s.prfxTotRowsTxt="totRowsTextSpan_",s.onBeforeRefreshCounter=u["default"].isFn(l.on_before_refresh_counter)?l.on_before_refresh_counter:null,s.onAfterRefreshCounter=u["default"].isFn(l.on_after_refresh_counter)?l.on_after_refresh_counter:null,s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=h["default"].create("div",["id",this.prfxCounter+e.id]);i.className=this.totRowsCssClass;var s=h["default"].create("span",["id",this.prfxTotRows+e.id]),n=h["default"].create("span",["id",this.prfxTotRowsTxt+e.id]);n.appendChild(h["default"].text(this.rowsCounterText)),this.rowsCounterTgtId||e.setToolbar();var r=this.rowsCounterTgtId?h["default"].id(this.rowsCounterTgtId):e.lDiv;this.rowsCounterTgtId?(r.appendChild(n),r.appendChild(s)):(i.appendChild(n),i.appendChild(s),r.appendChild(i)),this.rowsCounterDiv=i,this.rowsCounterSpan=s,this.emitter.on(["after-filtering","grouped-by-page"],function(){return t.refresh(e.nbVisibleRows)}),this.emitter.on(["rows-changed"],function(){return t.refresh()}),this.initialized=!0,this.refresh()}},e.prototype.refresh=function(t){if(this.initialized&&this.isEnabled()){var e=this.tf;this.onBeforeRefreshCounter&&this.onBeforeRefreshCounter.call(null,e,this.rowsCounterSpan);var i;if(e.paging){var s=e.feature("paging");if(s){var n=parseInt(s.startPagingRow,10)+(e.nbVisibleRows>0?1:0),r=n+s.pagingLength-1<=e.nbVisibleRows?n+s.pagingLength-1:e.nbVisibleRows;i=n+this.fromToTextSeparator+r+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)}},e.prototype.destroy=function(){var t=this;this.initialized&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?h["default"].remove(this.rowsCounterDiv):h["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null,this.emitter.off(["after-filtering","grouped-by-page"],function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off(["rows-changed"],function(){return t.refresh()}),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.StatusBar=void 0;var a=i(11),o=i(2),h=s(o),f=i(3),u=s(f),d=window;e.StatusBar=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"statusBar")),l=s.config;return s.statusBarTgtId=l.status_bar_target_id||null,s.statusBarDiv=null,s.statusBarSpan=null,s.statusBarSpanText=null,s.statusBarText=l.status_bar_text||"",s.statusBarCssClass=l.status_bar_css_class||"status",s.statusBarCloseDelay=250,s.onBeforeShowMsg=u["default"].isFn(l.on_before_show_msg)?l.on_before_show_msg:null,s.onAfterShowMsg=u["default"].isFn(l.on_after_show_msg)?l.on_after_show_msg:null,s.msgFilter=l.msg_filter||"Filtering data...",s.msgPopulate=l.msg_populate||"Populating filter...",s.msgPopulateCheckList=l.msg_populate_checklist||"Populating list...",s.msgChangePage=l.msg_change_page||"Collecting paging data...",s.msgClear=l.msg_clear||"Clearing filters...",s.msgChangeResults=l.msg_change_results||"Changing results per page...",s.msgResetPage=l.msg_reset_page||"Re-setting page...",s.msgResetPageLength=l.msg_reset_page_length||"Re-setting page length...",s.msgSort=l.msg_sort||"Sorting data...",s.msgLoadExtensions=l.msg_load_extensions||"Loading extensions...",s.msgLoadThemes=l.msg_load_themes||"Loading theme(s)...",s.prfxStatus="status_",s.prfxStatusSpan="statusSpan_",s.prfxStatusTxt="statusText_",s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=this.emitter,s=h["default"].create("div",["id",this.prfxStatus+e.id]);s.className=this.statusBarCssClass;var n=h["default"].create("span",["id",this.prfxStatusSpan+e.id]),r=h["default"].create("span",["id",this.prfxStatusTxt+e.id]);r.appendChild(h["default"].text(this.statusBarText)),this.statusBarTgtId||e.setToolbar();var l=this.statusBarTgtId?h["default"].id(this.statusBarTgtId):e.lDiv;this.statusBarTgtId?(l.appendChild(r),l.appendChild(n)):(s.appendChild(r),s.appendChild(n),l.appendChild(s)),this.statusBarDiv=s,this.statusBarSpan=n,this.statusBarSpanText=r,i.on(["before-filtering"],function(){return t.message(t.msgFilter)}),i.on(["before-populating-filter"],function(){return t.message(t.msgPopulate)}),i.on(["before-page-change"],function(){return t.message(t.msgChangePage)}),i.on(["before-clearing-filters"],function(){return t.message(t.msgClear)}),i.on(["before-page-length-change"],function(){return t.message(t.msgChangeResults)}),i.on(["before-reset-page"],function(){return t.message(t.msgResetPage)}),i.on(["before-reset-page-length"],function(){return t.message(t.msgResetPageLength)}),i.on(["before-loading-extensions"],function(){return t.message(t.msgLoadExtensions)}),i.on(["before-loading-themes"],function(){return t.message(t.msgLoadThemes)}),i.on(["after-filtering","after-populating-filter","after-page-change","after-clearing-filters","after-page-length-change","after-reset-page","after-reset-page-length","after-loading-extensions","after-loading-themes"],function(){return t.message("")}),this.initialized=!0}},e.prototype.message=function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];if(this.isEnabled()){this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,e);var i=""===e?this.statusBarCloseDelay:1;d.setTimeout(function(){t.initialized&&(t.statusBarSpan.innerHTML=e,t.onAfterShowMsg&&t.onAfterShowMsg.call(null,t.tf,e))},i)}},e.prototype.destroy=function(){var t=this;if(this.initialized){var e=this.emitter;this.statusBarDiv.innerHTML="",this.statusBarTgtId||h["default"].remove(this.statusBarDiv),this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarDiv=null,e.off(["before-filtering"],function(){return t.message(t.msgFilter)}),e.off(["before-populating-filter"],function(){return t.message(t.msgPopulate)}),e.off(["before-page-change"],function(){return t.message(t.msgChangePage)}),e.off(["before-clearing-filters"],function(){return t.message(t.msgClear)}),e.off(["before-page-length-change"],function(){return t.message(t.msgChangeResults)}),e.off(["before-reset-page"],function(){return t.message(t.msgResetPage)}),e.off(["before-reset-page-length"],function(){return t.message(t.msgResetPageLength)}),e.off(["before-loading-extensions"],function(){return t.message(t.msgLoadExtensions)}),e.off(["before-loading-themes"],function(){return t.message(t.msgLoadThemes)}),e.off(["after-filtering","after-populating-filter","after-page-change","after-clearing-filters","after-page-length-change","after-reset-page","after-reset-page-length","after-loading-extensions","after-loading-themes"],function(){return t.message("")}),this.initialized=!1}},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.Paging=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=i(11),h=i(2),f=s(h),u=i(3),d=s(u),p=i(4),c=s(p),g=i(1),b=s(g);e.Paging=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"paging")),l=s.config;s.btnPageCssClass=l.paging_btn_css_class||"pgInp",s.pagingSlc=null,s.resultsPerPageSlc=null,s.pagingTgtId=l.paging_target_id||null,s.pagingLength=isNaN(l.paging_length)?10:l.paging_length,s.resultsPerPageTgtId=l.results_per_page_target_id||null,s.pgSlcCssClass=l.paging_slc_css_class||"pgSlc",s.pgInpCssClass=l.paging_inp_css_class||"pgNbInp",s.resultsPerPage=l.results_per_page||null,s.hasResultsPerPage=d["default"].isArray(s.resultsPerPage),s.resultsSlcCssClass=l.results_slc_css_class||"rspg",s.resultsSpanCssClass=l.results_span_css_class||"rspgSpan",s.startPagingRow=0,s.nbPages=0,s.currentPageNb=1,s.btnNextPageText=l.btn_next_page_text||">",s.btnPrevPageText=l.btn_prev_page_text||"<",s.btnLastPageText=l.btn_last_page_text||">|",s.btnFirstPageText=l.btn_first_page_text||"|<",s.btnNextPageHtml=l.btn_next_page_html||(i.enableIcons?'':null),s.btnPrevPageHtml=l.btn_prev_page_html||(i.enableIcons?'':null),s.btnFirstPageHtml=l.btn_first_page_html||(i.enableIcons?'':null),s.btnLastPageHtml=l.btn_last_page_html||(i.enableIcons?'':null),s.pageText=l.page_text||" Page ",s.ofText=l.of_text||" of ",s.nbPgSpanCssClass=l.nb_pages_css_class||"nbpg",s.hasPagingBtns=l.paging_btns!==!1,s.pageSelectorType=l.page_selector_type||i.fltTypeSlc,s.onBeforeChangePage=d["default"].isFn(l.on_before_change_page)?l.on_before_change_page:null,s.onAfterChangePage=d["default"].isFn(l.on_after_change_page)?l.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=i.refRow,o=i.nbRows;s.nbPages=Math.ceil((o-a)/s.pagingLength);var h=s;return s.evt={slcIndex:function(){return h.pageSelectorType===i.fltTypeSlc?h.pagingSlc.options.selectedIndex:parseInt(h.pagingSlc.value,10)-1},nbOpts:function(){return h.pageSelectorType===i.fltTypeSlc?parseInt(h.pagingSlc.options.length,10)-1:h.nbPages-1},next:function(){var t=h.evt.slcIndex()0?h.evt.slcIndex()-1:h.evt.nbOpts();h.changePage(t)},last:function(){h.changePage(h.evt.nbOpts())},first:function(){h.changePage(0)},_detectKey:function(t){var e=b["default"].keyCode(t);13===e&&(i.sorted?(i.filter(),h.changePage(h.evt.slcIndex())):h.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},s}return l(e,t),e.prototype.init=function(){var t,e=this,i=this.tf,s=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),s.slcPagesChange=function(t){var i=t.target;e.changePage(i.selectedIndex)},this.pageSelectorType===i.fltTypeSlc&&(t=f["default"].create(i.fltTypeSlc,["id",this.prfxSlcPages+i.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",s.slcPagesChange)),this.pageSelectorType===i.fltTypeInp&&(t=f["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var n=f["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),r=f["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),l=f["default"].create("span",["id",this.prfxBtnLastSpan+i.id]),a=f["default"].create("span",["id",this.prfxBtnFirstSpan+i.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)n.innerHTML=this.btnNextPageHtml,b["default"].add(n,"click",s.next);else{var o=f["default"].create(i.fltTypeInp,["id",this.prfxBtnNext+i.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);o.className=this.btnPageCssClass,b["default"].add(o,"click",s.next),n.appendChild(o)}if(this.btnPrevPageHtml)r.innerHTML=this.btnPrevPageHtml,b["default"].add(r,"click",s.prev);else{var h=f["default"].create(i.fltTypeInp,["id",this.prfxBtnPrev+i.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",s.prev),r.appendChild(h)}if(this.btnLastPageHtml)l.innerHTML=this.btnLastPageHtml,b["default"].add(l,"click",s.last);else{var u=f["default"].create(i.fltTypeInp,["id",this.prfxBtnLast+i.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,b["default"].add(u,"click",s.last),l.appendChild(u)}if(this.btnFirstPageHtml)a.innerHTML=this.btnFirstPageHtml,b["default"].add(a,"click",s.first);else{var d=f["default"].create(i.fltTypeInp,["id",this.prfxBtnFirst+i.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);d.className=this.btnPageCssClass,b["default"].add(d,"click",s.first),a.appendChild(d)}}this.pagingTgtId||i.setToolbar();var p=this.pagingTgtId?f["default"].id(this.pagingTgtId):i.mDiv;p.appendChild(a),p.appendChild(r);var c=f["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);c.appendChild(f["default"].text(this.pageText)),c.className=this.nbPgSpanCssClass,p.appendChild(c),p.appendChild(t);var g=f["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(f["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,p.appendChild(g);var v=f["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(f["default"].text(" "+this.nbPages+" ")),p.appendChild(v),p.appendChild(n),p.appendChild(l),this.pagingSlc=f["default"].id(this.prfxSlcPages+i.id),i.rememberGridValues||this.setPagingInfo(),i.fltGrid||(i.validateAllRows(),this.setPagingInfo(i.validRowsIndex)),this.emitter.on(["after-filtering"],function(){return e.resetPagingInfo()}),this.emitter.on(["initialized"],function(){return e.resetValues()}),this.emitter.on(["change-page"],function(t,i){return e.setPage(i)}),this.emitter.on(["change-page-results"],function(t,i){return e.changeResultsPerPage(i)}),this.initialized=!0}},e.prototype.reset=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;this.isEnabled()||(this.enable(),this.init(),t&&e.filter())},e.prototype.resetPagingInfo=function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)},e.prototype.setPagingInfo=function(t){var e=this.tf,i=this.pagingTgtId?f["default"].id(this.pagingTgtId):e.mDiv,s=f["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t||e.getValidRows(!0),this.nbPages=Math.ceil(e.validRowsIndex.length/this.pagingLength),s.innerHTML=this.nbPages,this.pageSelectorType===e.fltTypeSlc&&(this.pagingSlc.innerHTML=""),this.nbPages>0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var n=0;nr;r++){var a=e.validRowsIndex[r],o=i[a],h=o.getAttribute("validRow"),f=!1;r>=s&&n>r?(d["default"].isNull(h)||Boolean("true"===h))&&(o.style.display="",f=!0):o.style.display="none",this.emitter.emit("row-paged",e,a,r,f)}e.nbVisibleRows=e.validRowsIndex.length,this.emitter.emit("grouped-by-page",e,this)},e.prototype.getPage=function(){return this.currentPageNb; -},e.prototype.setPage=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(c["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)}},e.prototype.setResultsPerPage=function(){var t=this,e=this.tf,i=this.evt;if(!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.onChangeResultsPerPage(),e.target.blur()};var s=f["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var n=this.resultsPerPage[0],r=this.resultsPerPage[1],l=f["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);l.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var a=this.resultsPerPageTgtId?f["default"].id(this.resultsPerPageTgtId):e.rDiv;l.appendChild(f["default"].text(n));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(l,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(a.appendChild(l),a.appendChild(s));for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t+1),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t+1)),this.emitter.emit("after-page-change",e,t+1))},e.prototype.changeResultsPerPage=function(t){this.isEnabled()&&!isNaN(t)&&(this.resultsPerPageSlc.value=t,this.onChangeResultsPerPage())},e.prototype.onChangeResultsPerPage=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-page-length-change",t);var e=this.resultsPerPageSlc,i=e.selectedIndex,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[i].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)&&(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc)){var n=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[n].selected=!0}this.emitter.emit("after-page-length-change",t,this.pagingLength)}},e.prototype.resetValues=function(){var t=this.tf;t.rememberPageLen&&this.resetPageLength(),t.rememberPageNb&&this.resetPage()},e.prototype.resetPage=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page",t);var e=t.feature("store").getPageNb();""!==e&&this.changePage(e-1),this.emitter.emit("after-reset-page",t,e)}},e.prototype.resetPageLength=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page-length",t);var e=t.feature("store").getPageLength();""!==e&&(this.resultsPerPageSlc.options[e].selected=!0,this.changeResultsPerPage()),this.emitter.emit("after-reset-page-length",t,e)}},e.prototype.destroy=function(){var t=this,e=this.tf;if(this.initialized){var i=f["default"].id(this.prfxBtnNextSpan+e.id),s=f["default"].id(this.prfxBtnPrevSpan+e.id),n=f["default"].id(this.prfxBtnLastSpan+e.id),r=f["default"].id(this.prfxBtnFirstSpan+e.id),l=f["default"].id(this.prfxPgBeforeSpan+e.id),a=f["default"].id(this.prfxPgAfterSpan+e.id),o=f["default"].id(this.prfxPgSpan+e.id),h=this.evt;this.pagingSlc&&(this.pageSelectorType===e.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===e.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",h._detectKey),f["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",h.next),f["default"].remove(i)),s&&(b["default"].remove(s,"click",h.prev),f["default"].remove(s)),n&&(b["default"].remove(n,"click",h.last),f["default"].remove(n)),r&&(b["default"].remove(r,"click",h.first),f["default"].remove(r)),l&&f["default"].remove(l),a&&f["default"].remove(a),o&&f["default"].remove(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.emitter.off(["after-filtering"],function(){return t.resetPagingInfo()}),this.emitter.off(["initialized"],function(){return t.resetValues()}),this.emitter.off(["change-page"],function(e,i){return t.setPage(i)}),this.emitter.off(["change-page-results"],function(e,i){return t.changeResultsPerPage(i)}),this.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}},e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.ClearButton=void 0;var a=i(11),o=i(2),h=s(o),f=i(1),u=s(f);e.ClearButton=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"btnReset")),l=s.config;return s.btnResetTgtId=l.btn_reset_target_id||null,s.btnResetEl=null,s.btnResetText=l.btn_reset_text||"Reset",s.btnResetTooltip=l.btn_reset_tooltip||"Clear filters",s.btnResetHtml=l.btn_reset_html||(i.enableIcons?'':null),s.prfxResetSpan="resetspan_",s}return l(e,t),e.prototype.onClick=function(){this.isEnabled()&&this.tf.clearFilters()},e.prototype.init=function(){var t=this,e=this.tf;if(!this.initialized){var i=h["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var s=this.btnResetTgtId?h["default"].id(this.btnResetTgtId):e.rDiv;if(s.appendChild(i),this.btnResetHtml){i.innerHTML=this.btnResetHtml;var n=i.firstChild;u["default"].add(n,"click",function(){t.onClick()})}else{var r=h["default"].create("a",["href","javascript:void(0);"]);r.className=e.btnResetCssClass,r.appendChild(h["default"].text(this.btnResetText)),i.appendChild(r),u["default"].add(r,"click",function(){t.onClick()})}this.btnResetEl=i.firstChild,this.initialized=!0}},e.prototype.destroy=function(){var t=this.tf;if(this.initialized){var e=h["default"].id(this.prfxResetSpan+t.id);e&&h["default"].remove(e),this.btnResetEl=null,this.initialized=!1}},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.Help=void 0;var a=i(11),o=i(2),h=s(o),f=i(1),u=s(f),d="https://github.com/koalyptus/TableFilter/wiki/4.-Filter-operators",p="http://koalyptus.github.io/TableFilter/";e.Help=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"help")),l=s.config;return s.tgtId=l.help_instructions_target_id||null,s.contTgtId=l.help_instructions_container_target_id||null,s.instrText=l.help_instructions_text?l.help_instructions_text:'Use the filters above each column to filter and limit table data. Advanced searches can be performed by using the following operators:
<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',s.instrHtml=l.help_instructions_html||null,s.btnText=l.help_instructions_btn_text||"?",s.btnHtml=l.help_instructions_btn_html||null,s.btnCssClass=l.help_instructions_btn_css_class||"helpBtn",s.contCssClass=l.help_instructions_container_css_class||"helpCont",s.btn=null,s.cont=null,s.defaultHtml='

TableFilter v'+i.version+'

'+p+"
©2015-"+i.year+' Max Guglielmi
',s.prfxHelpSpan="helpSpan_",s.prfxHelpDiv="helpDiv_",s.emitter.on(["init-help"],function(){return s.init()}),s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=h["default"].create("span",["id",this.prfxHelpSpan+e.id]),s=h["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var n=this.tgtId?h["default"].id(this.tgtId):e.rDiv;n.appendChild(i);var r=this.contTgtId?h["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var l=i.firstChild;u["default"].add(l,"click",function(){t.toggle()}),r.appendChild(s)}else{r.appendChild(s);var a=h["default"].create("a",["href","javascript:void(0);"]);a.className=this.btnCssClass,a.appendChild(h["default"].text(this.btnText)),i.appendChild(a),u["default"].add(a,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&r.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,u["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,u["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,u["default"].add(s,"click",function(){t.toggle()}),this.cont=s,this.btn=i,this.initialized=!0}},e.prototype.toggle=function(){if(this.enabled!==!1){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}},e.prototype.destroy=function(){this.initialized&&(h["default"].remove(this.btn),this.btn=null,this.cont&&(h["default"].remove(this.cont),this.cont=null,this.initialized=!1))},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.AlternateRows=void 0;var a=i(11),o=i(2),h=s(o);e.AlternateRows=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"alternateRows")),l=s.config;return s.evenCss=l.even_row_css_class||"even",s.oddCss=l.odd_row_css_class||"odd",s}return l(e,t),e.prototype.init=function(){var t=this;this.initialized||(this.processAll(),this.emitter.on(["row-processed","row-paged"],function(e,i,s,n){return t.processRow(i,s,n)}),this.emitter.on(["column-sorted"],function(){return t.processAll()}),this.initialized=!0)},e.prototype.processAll=function(){if(this.isEnabled())for(var t=this.tf,e=t.getValidRows(!0),i=0===e.length,s=i?t.refRow:0,n=i?t.nbFilterableRows+s:e.length,r=0,l=s;n>l;l++){var a=i?l:e[l];this.setRowBg(a,r),r++}},e.prototype.processRow=function(t,e,i){i?this.setRowBg(t,e):this.removeRowBg(t)},e.prototype.setRowBg=function(t,e){if(this.isEnabled()&&!isNaN(t)){var i=this.tf.tbl.rows,s=isNaN(e)?t:e;this.removeRowBg(t),h["default"].addClass(i[t],s%2?this.evenCss:this.oddCss)}},e.prototype.removeRowBg=function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;h["default"].removeClass(e[t],this.oddCss),h["default"].removeClass(e[t],this.evenCss)}},e.prototype.destroy=function(){var t=this;if(this.initialized){for(var e=0;e0?this.hide():this.show()},e.prototype.show=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))},e.prototype.hide=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))},e.prototype.setWidth=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"},e.prototype.destroy=function(){var t=this;this.initialized&&(h["default"].remove(this.cont),this.cont=null,this.emitter.off(["after-filtering"],function(){return t.toggle()}),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var a=i(11),o=i(27),h=i(28),f=i(4),u=s(f),d=i(3),p=s(d);e.State=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"state")),l=s.config.state;return s.enableHash=l===!0||p["default"].isObj(l.types)&&-1!==l.types.indexOf("hash"),s.enableLocalStorage=p["default"].isObj(l.types)&&-1!==l.types.indexOf("local_storage"),s.enableCookie=p["default"].isObj(l.types)&&-1!==l.types.indexOf("cookie"),s.persistFilters=l.filters!==!1,s.persistPageNumber=Boolean(l.page_number),s.persistPageLength=Boolean(l.page_length),s.persistSort=Boolean(l.sort),s.persistColsVisibility=Boolean(l.columns_visibility),s.persistFiltersVisibility=Boolean(l.filters_visibility),s.cookieDuration=isNaN(l.cookie_duration)?87600:parseInt(l.cookie_duration,10),s.enableStorage=s.enableLocalStorage||s.enableCookie,s.hash=null,s.pageNb=null,s.pageLength=null,s.sort=null,s.hiddenCols=null,s.filtersVisibility=null,s.state={},s.prfxCol="col_",s.pageNbKey="page",s.pageLengthKey="page_length",s.filtersVisKey="filters_visibility",s}return l(e,t),e.prototype.init=function(){var t=this;this.initialized||(this.emitter.on(["after-filtering"],function(){return t.update()}),this.emitter.on(["after-page-change","after-clearing-filters"],function(e,i){return t.updatePage(i)}),this.emitter.on(["after-page-length-change"],function(e,i){return t.updatePageLength(i)}),this.emitter.on(["column-sorted"],function(e,i,s){return t.updateSort(i,s)}),this.emitter.on(["sort-initialized"],function(){return t._syncSort()}),this.emitter.on(["columns-visibility-initialized"],function(){return t._syncColsVisibility()}),this.emitter.on(["column-shown","column-hidden"],function(e,i,s,n){return t.updateColsVisibility(n)}),this.emitter.on(["filters-visibility-initialized"],function(){return t._syncFiltersVisibility()}),this.emitter.on(["filters-toggled"],function(e,i,s){return t.updateFiltersVisibility(s)}),this.enableHash&&(this.hash=new o.Hash(this),this.hash.init()),this.enableStorage&&(this.storage=new h.Storage(this),this.storage.init()),this.initialized=!0)},e.prototype.update=function(){var t=this;if(this.isEnabled()){var e=this.state,i=this.tf;if(this.persistFilters){var s=i.getFiltersValue();s.forEach(function(i,s){var n=""+t.prfxCol+s;p["default"].isString(i)&&u["default"].isEmpty(i)?e.hasOwnProperty(n)&&(e[n].flt=void 0):(e[n]=e[n]||{},e[n].flt=i)})}if(this.persistPageNumber&&(p["default"].isNull(this.pageNb)?e[this.pageNbKey]=void 0:e[this.pageNbKey]=this.pageNb),this.persistPageLength&&(p["default"].isNull(this.pageLength)?e[this.pageLengthKey]=void 0:e[this.pageLengthKey]=this.pageLength),this.persistSort&&!p["default"].isNull(this.sort)){Object.keys(e).forEach(function(i){-1!==i.indexOf(t.prfxCol)&&e[i]&&(e[i].sort=void 0)});var n=""+this.prfxCol+this.sort.column;e[n]=e[n]||{},e[n].sort={descending:this.sort.descending}}this.persistColsVisibility&&(p["default"].isNull(this.hiddenCols)||(Object.keys(e).forEach(function(i){-1!==i.indexOf(t.prfxCol)&&e[i]&&(e[i].hidden=void 0)}),this.hiddenCols.forEach(function(i){var s=""+t.prfxCol+i;e[s]=e[s]||{},e[s].hidden=!0}))),this.persistFiltersVisibility&&(p["default"].isNull(this.filtersVisibility)?e[this.filtersVisKey]=void 0:e[this.filtersVisKey]=this.filtersVisibility),this.emitter.emit("state-changed",i,e)}},e.prototype.updatePage=function(t){this.pageNb=t,this.update()},e.prototype.updatePageLength=function(t){this.pageLength=t,this.update()},e.prototype.updateSort=function(t,e){this.sort={column:t,descending:e},this.update()},e.prototype.updateColsVisibility=function(t){this.hiddenCols=t,this.update()},e.prototype.updateFiltersVisibility=function(t){this.filtersVisibility=t,this.update()},e.prototype.override=function(t){this.state=t},e.prototype.sync=function(){var t=this.state,e=this.tf;if(this._syncFilters(),this.persistPageNumber){var i=t[this.pageNbKey];this.emitter.emit("change-page",e,i)}if(this.persistPageLength){var s=t[this.pageLengthKey];this.emitter.emit("change-page-results",e,s)}this._syncSort(),this._syncColsVisibility(),this._syncFiltersVisibility()},e.prototype.overrideAndSync=function(t){this.disable(),this.override(t),this.sync(),this.enable()},e.prototype._syncFilters=function(){var t=this;if(this.persistFilters){var e=this.state,i=this.tf;Object.keys(e).forEach(function(s){if(-1!==s.indexOf(t.prfxCol)){var n=parseInt(s.replace(t.prfxCol,""),10),r=e[s].flt;i.setFilterValue(n,r)}}),i.filter()}},e.prototype._syncSort=function(){var t=this;if(this.persistSort){var e=this.state,i=this.tf;Object.keys(e).forEach(function(s){if(-1!==s.indexOf(t.prfxCol)){var n=parseInt(s.replace(t.prfxCol,""),10);if(!p["default"].isUndef(e[s].sort)){var r=e[s].sort;t.emitter.emit("sort",i,n,r.descending)}}})}},e.prototype._syncColsVisibility=function(){var t=this;if(this.persistColsVisibility){var e=this.state,i=this.tf,s=[];Object.keys(e).forEach(function(i){if(-1!==i.indexOf(t.prfxCol)){var n=parseInt(i.replace(t.prfxCol,""),10);p["default"].isUndef(e[i].hidden)||s.push(n)}}),s.forEach(function(e){t.emitter.emit("hide-column",i,e)})}},e.prototype._syncFiltersVisibility=function(){if(this.persistFiltersVisibility){var t=this.state,e=this.tf,i=t[this.filtersVisKey];this.emitter.emit("show-filters",e,i)}},e.prototype.destroy=function(){var t=this;this.initialized&&(this.state={},this.emitter.off(["after-filtering"],function(){return t.update()}),this.emitter.off(["after-page-change","after-clearing-filters"],function(e,i){return t.updatePage(i)}),this.emitter.off(["after-page-length-change"],function(e,i){return t.updatePageLength(i)}),this.emitter.off(["column-sorted"],function(e,i,s){return t.updateSort(i,s)}),this.emitter.off(["sort-initialized"],function(){return t._syncSort()}),this.emitter.off(["columns-visibility-initialized"],function(){return t._syncColsVisibility()}),this.emitter.off(["column-shown","column-hidden"],function(e,i,s,n){return t.updateColsVisibility(n)}),this.emitter.off(["filters-visibility-initialized"],function(){return t._syncFiltersVisibility()}),this.emitter.off(["filters-toggled"],function(e,i,s){return t.updateFiltersVisibility(s)}),this.enableHash&&(this.hash.destroy(),this.hash=null),this.enableStorage&&(this.storage.destroy(),this.storage=null),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.hasHashChange=void 0;var r=i(1),l=s(r),a=window,o=a.JSON,h=a.location,f=a.decodeURIComponent,u=e.hasHashChange=function(){var t=a.documentMode;return"onhashchange"in a&&(void 0===t||t>7)};e.Hash=function(){function t(e){n(this,t),this.state=e,this.lastHash=null,this.emitter=e.emitter}return t.prototype.init=function(){var t=this;u()&&(this.lastHash=h.hash,this.emitter.on(["state-changed"],function(e,i){return t.update(i)}),this.emitter.on(["initialized"],function(){return t.sync()}),l["default"].add(a,"hashchange",function(){return t.sync()}))},t.prototype.update=function(t){var e="#"+o.stringify(t);this.lastHash!==e&&(h.hash=e,this.lastHash=e)},t.prototype.parse=function(t){return-1===t.indexOf("#")?null:(t=t.substr(1),o.parse(f(t)))},t.prototype.sync=function(){var t=this.parse(h.hash);t&&this.state.overrideAndSync(t)},t.prototype.destroy=function(){var t=this;this.emitter.off(["state-changed"],function(e,i){return t.update(i)}),this.emitter.off(["initialized"],function(){return t.sync()}),l["default"].remove(a,"hashchange",function(){return t.sync()}),this.state=null,this.lastHash=null,this.emitter=null},t}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.hasStorage=void 0;var r=i(9),l=s(r),a=window,o=a.JSON,h=a.localStorage,f=a.location,u=e.hasStorage=function(){return"Storage"in a};e.Storage=function(){function t(e){n(this,t),this.state=e,this.tf=e.tf,this.enableLocalStorage=e.enableLocalStorage&&u(),this.enableCookie=e.enableCookie&&!this.enableLocalStorage,this.emitter=e.emitter,this.duration=e.cookieDuration}return t.prototype.init=function(){var t=this;this.emitter.on(["state-changed"],function(e,i){return t.save(i)}),this.emitter.on(["initialized"],function(){return t.sync()})},t.prototype.save=function(t){this.enableLocalStorage?h[this.getKey()]=o.stringify(t):l["default"].write(this.getKey(),o.stringify(t),this.duration)},t.prototype.retrieve=function(){var t=null;return t=this.enableLocalStorage?h[this.getKey()]:l["default"].read(this.getKey()),t?o.parse(t):null},t.prototype.remove=function(){this.enableLocalStorage?h.removeItem(this.getKey()):l["default"].remove(this.getKey())},t.prototype.sync=function(){var t=this.retrieve();t&&this.state.overrideAndSync(t)},t.prototype.getKey=function(){return o.stringify({key:this.tf.prfxTf+"_"+this.tf.id,path:f.pathname})},t.prototype.destroy=function(){var t=this;this.emitter.off(["state-changed"],function(e,i){return t.save(i)}),this.emitter.off(["initialized"],function(){return t.sync()}),this.remove(),this.state=null,this.emitter=null},t}()}])}); \ No newline at end of file +!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,function(){return function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i=window.webpackJsonp;window.webpackJsonp=function(s,r){for(var l,a,o=0,h=[];ol;l++)s[l]=arguments[l];if(0!==s.length){if(this.id=null,this.version="0.2.17",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":r(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=h["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 a=this.cfg;this.emitter=new m.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(o){this.nbCells=this.getCellsNb(0)}this.basePath=a.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=a.grid!==!1,this.gridLayout=Boolean(a.grid_layout),this.filtersRowIndex=isNaN(a.filters_row_index)?0:a.filters_row_index,this.headersRow=isNaN(a.headers_row_index)?0===this.filtersRowIndex?1:0:a.headers_row_index,this.fltCellTag="th"!==a.filters_cell_tag||"td"!==a.filters_cell_tag?"td":a.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.validRowsIndex=[],this.fltGridEl=null,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.infDivCssClass=a.inf_div_css_class||"inf",this.lDivCssClass=a.left_div_css_class||"ldiv",this.rDivCssClass=a.right_div_css_class||"rdiv",this.mDivCssClass=a.middle_div_css_class||"mdiv",this.contDivCssClass=a.content_div_css_class||"cont",this.stylePath=a.style_path||this.basePath+"style/",this.stylesheet=a.stylesheet||this.stylePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=a.flts_row_css_class||"fltrow",this.enableIcons=a.enable_icons!==!1,this.alternateRows=Boolean(a.alternate_rows),this.hasColWidths=p["default"].isArray(a.col_widths),this.colWidths=this.hasColWidths?a.col_widths:null,this.fltCssClass=a.flt_css_class||"flt",this.fltMultiCssClass=a.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=a.flt_small_css_class||"flt_s",this.singleFltCssClass=a.single_flt_css_class||"single_flt",this.enterKey=a.enter_key!==!1,this.onBeforeFilter=p["default"].isFn(a.on_before_filter)?a.on_before_filter:null,this.onAfterFilter=p["default"].isFn(a.on_after_filter)?a.on_after_filter:null,this.caseSensitive=Boolean(a.case_sensitive),this.hasExactMatchByCol=p["default"].isArray(a.columns_exact_match),this.exactMatchByCol=this.hasExactMatchByCol?a.columns_exact_match:[],this.exactMatch=Boolean(a.exact_match),this.linkedFilters=Boolean(a.linked_filters),this.disableExcludedOptions=Boolean(a.disable_excluded_options),this.activeFilterId=null,this.hasVisibleRows=Boolean(a.rows_always_visible),this.visibleRows=this.hasVisibleRows?a.rows_always_visible:[],this.isExternalFlt=Boolean(a.external_flt_grid),this.externalFltTgtIds=a.external_flt_grid_ids||[],this.externalFltEls=[],this.execDelay=isNaN(a.exec_delay)?100:parseInt(a.exec_delay,10),this.onFiltersLoaded=p["default"].isFn(a.on_filters_loaded)?a.on_filters_loaded:null,this.singleSearchFlt=Boolean(a.single_filter),this.onRowValidated=p["default"].isFn(a.on_row_validated)?a.on_row_validated:null,this.customCellDataCols=a.custom_cell_data_cols?a.custom_cell_data_cols:[],this.customCellData=p["default"].isFn(a.custom_cell_data)?a.custom_cell_data:null,this.watermark=a.watermark||"",this.isWatermarkArray=p["default"].isArray(this.watermark),this.toolBarTgtId=a.toolbar_target_id||null,this.help=p["default"].isUndef(a.help_instructions)?void 0:Boolean(a.help_instructions),this.popupFilters=Boolean(a.popup_filters),this.markActiveColumns=Boolean(a.mark_active_columns),this.activeColumnsCssClass=a.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=p["default"].isFn(a.on_before_active_column)?a.on_before_active_column:null,this.onAfterActiveColumn=p["default"].isFn(a.on_after_active_column)?a.on_after_active_column:null,this.displayAllText=a.display_all_text||"Clear",this.enableEmptyOption=Boolean(a.enable_empty_option),this.emptyText=a.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(a.enable_non_empty_option),this.nonEmptyText=a.non_empty_text||"(Non empty)",this.onSlcChange=a.on_change!==!1,this.sortSlc=a.sort_select!==!1,this.isSortNumAsc=Boolean(a.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?a.sort_num_asc:[],this.isSortNumDesc=Boolean(a.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?a.sort_num_desc:[],this.loadFltOnDemand=Boolean(a.load_filters_on_demand),this.hasCustomOptions=p["default"].isObj(a.custom_options),this.customOptions=a.custom_options,this.rgxOperator=a.regexp_operator||"rgx:",this.emOperator=a.empty_operator||"[empty]",this.nmOperator=a.nonempty_operator||"[nonempty]",this.orOperator=a.or_operator||"||",this.anOperator=a.and_operator||"&&",this.grOperator=a.greater_operator||">",this.lwOperator=a.lower_operator||"<",this.leOperator=a.lower_equal_operator||"<=",this.geOperator=a.greater_equal_operator||">=",this.dfOperator=a.different_operator||"!",this.lkOperator=a.like_operator||"*",this.eqOperator=a.equal_operator||"=",this.stOperator=a.start_with_operator||"{",this.enOperator=a.end_with_operator||"}",this.curExp=a.cur_exp||"^[¥£€$]",this.separator=a.separator||",",this.rowsCounter=Boolean(a.rows_counter),this.statusBar=Boolean(a.status_bar),this.loader=Boolean(a.loader),this.displayBtn=Boolean(a.btn),this.btnText=a.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=a.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(a.btn_reset),this.btnResetCssClass=a.btn_reset_css_class||"reset",this.onBeforeReset=p["default"].isFn(a.on_before_reset)?a.on_before_reset:null,this.onAfterReset=p["default"].isFn(a.on_after_reset)?a.on_after_reset:null,this.paging=Boolean(a.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.autoFilter=Boolean(a.auto_filter),this.autoFilterDelay=isNaN(a.auto_filter_delay)?900:a.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(a.highlight_keywords),this.noResults=p["default"].isObj(a.no_results_message)||Boolean(a.no_results_message),this.state=p["default"].isObj(a.state)||Boolean(a.state),this.defaultDateType=a.default_date_type||"DMY",this.thousandsSeparator=a.thousands_separator||",",this.decimalSeparator=a.decimal_separator||".",this.hasColNbFormat=p["default"].isArray(a.col_number_format),this.colNbFormat=this.hasColNbFormat?a.col_number_format:null,this.hasColDateType=p["default"].isArray(a.col_date_type),this.colDateType=this.hasColDateType?a.col_date_type:null,this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.prfxResponsive="resp",this.extensions=a.extensions,this.hasExtensions=p["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(a.enable_default_theme),this.hasThemes=this.enableDefaultTheme||p["default"].isArray(a.themes),this.themes=a.themes||[],this.themesPath=a.themes_path||this.stylePath+"themes/",this.responsive=Boolean(a.responsive),this.Mod={},this.ExtRegistry={}}}return t.prototype.init=function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),e.help||(e.help=new I.Help(this)),this.help&&e.help.init(),this.state&&(e.state||(e.state=new k.State(this)),e.state.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new y.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new _.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new C.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new w.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var r=0;i>r;r++){this.emitter.emit("before-filter-init",this,r);var l=h["default"].create(this.fltCellTag),a=this.getFilterType(r);this.singleSearchFlt&&(l.colSpan=this.nbCells),this.gridLayout||n.appendChild(l),s=r==i-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,this.singleSearchFlt&&(a=this.fltTypeInp,s=this.singleFltCssClass),a===this.fltTypeSlc||a===this.fltTypeMulti?(e.dropdown||(e.dropdown=new x.Dropdown(this)),e.dropdown.init(r,this.isExternalFlt,l)):a===this.fltTypeCheckList?(e.checkList||(e.checkList=new T.CheckList(this)),e.checkList.init(r,this.isExternalFlt,l)):this._buildInputFilter(r,s,l),r==i-1&&this.displayBtn&&this._buildSubmitButton(r,l),this.emitter.emit("after-filter-init",this,r)}this.emitter.on(["filter-focus"],function(e,i){return t.setActiveFilterId(i.id)})}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new F.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new R.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new P.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new S.ClearButton(this),e.clearButton.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateRows&&(e.alternateRows=new O.AlternateRows(this),e.alternateRows.init()),this.noResults&&(e.noResults||(e.noResults=new E.NoResults(this)),e.noResults.init()),this._hasGrid=!0,this.gridLayout||(h["default"].addClass(this.tbl,this.prfxTf),this.responsive&&h["default"].addClass(this.tbl,this.prfxResponsive)),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.initialized=!0,this.emitter.emit("initialized",this)}},t.prototype.detectKey=function(t){if(this.enterKey&&t){var e=a["default"].keyCode(t);13===e?(this.filter(),a["default"].cancel(t),a["default"].stop(t)):(this.isUserTyping=!0,L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},t.prototype.onKeyUp=function(t){function e(){L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=a["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=L.setInterval(e.bind(this),this.autoFilterDelay)):(L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},t.prototype.onKeyDown=function(){this.autoFilter&&(this.isUserTyping=!0)},t.prototype.onInpFocus=function(t){var e=a["default"].target(t);this.emitter.emit("filter-focus",this,e)},t.prototype.onInpBlur=function(){this.autoFilter&&(this.isUserTyping=!1,L.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},t.prototype._insertFiltersRow=function(){if(!this.gridLayout){var t=void 0,e=h["default"].tag(this.tbl,"thead");return t=e.length>0?e[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}},t.prototype._initNoFilters=function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)},t.prototype._buildInputFilter=function(t,e,i){var s=this,n=this.getFilterType(t),r=this.isExternalFlt?this.externalFltTgtIds[t]:null,l=n===this.fltTypeInp?"text":"hidden",o=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",l],["ct",t]);"hidden"!==l&&this.watermark&&o.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),o.className=e||this.fltCssClass,a["default"].add(o,"focus",function(t){return s.onInpFocus(t)}),r?(h["default"].id(r).appendChild(o),this.externalFltEls.push(o)):i.appendChild(o),this.fltIds.push(o.id),a["default"].add(o,"keypress",function(t){return s.detectKey(t)}),a["default"].add(o,"keydown",function(){return s.onKeyDown()}),a["default"].add(o,"keyup",function(t){return s.onKeyUp(t)}),a["default"].add(o,"blur",function(){return s.onInpBlur()})},t.prototype._buildSubmitButton=function(t,e){var i=this,s=this.isExternalFlt?this.externalFltTgtIds[t]:null,n=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+t+"_"+this.id],["type","button"],["value",this.btnText]);n.className=this.btnCssClass,s?h["default"].id(s).appendChild(n):e.appendChild(n),a["default"].add(n,"click",function(){return i.filter()})},t.prototype.feature=function(t){return this.Mod[t]},t.prototype.initExtensions=function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)},t.prototype.loadExtension=function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,r=void 0;s&&n?r=t.path+s:(s=s.replace(".js",""),r="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(28)("./"+r)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}},t.prototype.extension=function(t){return this.ExtRegistry[t]},t.prototype.hasExtension=function(t){return!p["default"].isEmpty(this.ExtRegistry[t])},t.prototype.destroyExtensions=function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}},t.prototype.loadThemes=function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(p["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],r=n.name,l=n.path,a=this.prfxTf+r;r&&!l?l=this.themesPath+r+"/"+r+".css":!r&&n.path&&(r="theme{0}".replace("{0}",i)),this.isImported(l,"link")||this["import"](a,l,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)},t.prototype.getStylesheet=function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return h["default"].id(this.prfxTf+t)},t.prototype.destroy=function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod,s=this.emitter;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.markActiveColumns&&(this.clearActiveColumns(),s.off(["before-filtering"],function(){return t.clearActiveColumns()}),s.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions(),this.validateAllRows(),this.fltGrid&&!this.gridLayout&&(this.fltGridEl=e[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),s.emit("destroy",this),Object.keys(i).forEach(function(t){var e=i[t];e&&p["default"].isFn(e.destroy)&&e.destroy()}),this.hasVisibleRows&&s.off(["after-filtering"],function(){return t.enforceVisibility()}),this.linkedFilters&&s.off(["after-filtering"],function(){return t.linkFilters()}),this.emitter.off(["filter-focus"],function(e,i){return t.setActiveFilterId(i.id)}),h["default"].removeClass(this.tbl,this.prfxTf),h["default"].removeClass(this.tbl,this.prfxResponsive),this.nbHiddenRows=0,this.validRowsIndex=[],this.fltIds=[],this._hasGrid=!1,this.initialized=!1}},t.prototype.setToolbar=function(){if(!this.infDiv){var t=h["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)h["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.Mod.gridLayout;e.tblMainCont.appendChild(t),t.className=e.gridInfDivCssClass}else{var i=h["default"].create("caption");i.appendChild(t),this.tbl.insertBefore(i,this.tbl.firstChild)}this.infDiv=h["default"].id(this.prfxInfDiv+this.id);var s=h["default"].create("div",["id",this.prfxLDiv+this.id]);s.className=this.lDivCssClass,t.appendChild(s),this.lDiv=h["default"].id(this.prfxLDiv+this.id);var n=h["default"].create("div",["id",this.prfxRDiv+this.id]);n.className=this.rDivCssClass,t.appendChild(n),this.rDiv=h["default"].id(this.prfxRDiv+this.id);var r=h["default"].create("div",["id",this.prfxMDiv+this.id]);r.className=this.mDivCssClass,t.appendChild(r),this.mDiv=h["default"].id(this.prfxMDiv+this.id),p["default"].isUndef(this.help)&&(this.Mod.help.enabled=!0,this.emitter.emit("init-help",this))}},t.prototype.removeToolbar=function(){if(this.infDiv){h["default"].remove(this.infDiv),this.infDiv=null;var t=this.tbl,e=h["default"].tag(t,"caption");e.length>0&&[].forEach.call(e,function(e){return t.removeChild(e)})}},t.prototype.removeExternalFlts=function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=h["default"].id(s);n&&(n.innerHTML="")}},t.prototype.isCustomOptions=function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)},t.prototype.getCustomOptions=function(t){if(!p["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],r=i.indexOf(t),l=e.values[r],a=e.texts[r],o=e.sorts[r],h=0,f=l.length;f>h;h++)n.push(l[h]),a[h]?s.push(a[h]):s.push(l[h]);return o&&(n.sort(),s.sort()),[n,s]}},t.prototype.filter=function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(b,""),t=t.replace(m,""),t=t.replace(y,""),t=t.replace(_,"");var s=t;(a.test(t)||o.test(t)||f.test(t)||d.test(t)||c.test(t))&&(s=h["default"].getText(i)),""!==s&&this.emitter.emit("highlight-keyword",this,i,s)}}function e(t,e,i){t=u["default"].matchCase(t,this.caseSensitive);var s=void 0,l=v["default"].removeNbFormat,h=f.test(t),p=a.test(t),T=d.test(t),F=o.test(t),R=c.test(t),P=m.test(t),S=b.test(t),I=y.test(t),O=_.test(t),E=C===t,L=w===t,N=x.test(t),B=h&&g["default"].isValid(t.replace(f,""),k),D=p&&g["default"].isValid(t.replace(a,""),k),M=T&&g["default"].isValid(t.replace(d,""),k),A=F&&g["default"].isValid(t.replace(o,""),k),H=R&&g["default"].isValid(t.replace(c,""),k),j=P&&g["default"].isValid(t.replace(m,""),k),V=void 0,U=void 0;if(g["default"].isValid(e,k))V=g["default"].format(e,k),B?(U=g["default"].format(t.replace(f,""),k),s=U>V):D?(U=g["default"].format(t.replace(a,""),k),s=U>=V):A?(U=g["default"].format(t.replace(o,""),k),s=V>=U):M?(U=g["default"].format(t.replace(d,""),k),s=V>U):H?(U=g["default"].format(t.replace(c,""),k),s=V.toString()!=U.toString()):j?(U=g["default"].format(t.replace(m,""),k),s=V.toString()==U.toString()):b.test(t)?s=u["default"].contains(t.replace(b,""),e,!1,this.caseSensitive):g["default"].isValid(t,k)?(U=g["default"].format(t,k),s=V.toString()===U.toString()):s=E?u["default"].isEmpty(e):L?!u["default"].isEmpty(e):u["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(n=l(e,this.colNbFormat[i]),r=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(n=l(e,"us"),r="us"):(n=l(e,"eu"),r="eu"),p)s=n<=l(t.replace(a,""),r);else if(F)s=n>=l(t.replace(o,""),r);else if(h)s=nl(t.replace(d,""),r);else if(R)s=!u["default"].contains(t.replace(c,""),e,!1,this.caseSensitive);else if(S)s=u["default"].contains(t.replace(b,""),e,!1,this.caseSensitive);else if(P)s=u["default"].contains(t.replace(m,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(y,""));else if(O){var z=t.replace(_,"");s=e.lastIndexOf(z,e.length-1)===e.length-1-(z.length-1)&&e.lastIndexOf(z,e.length-1)>-1}else if(E)s=u["default"].isEmpty(e);else if(L)s=!u["default"].isEmpty(e);else if(N)try{var W=t.replace(x,""),K=new RegExp(W);s=K.test(e)}catch(G){s=!1}else s=u["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&this._hasGrid){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=0;this.validRowsIndex=[];for(var n,r,l=this.getFiltersValue(),a=new RegExp(this.leOperator),o=new RegExp(this.geOperator),f=new RegExp(this.lwOperator),d=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),b=new RegExp(u["default"].rgxEsc(this.lkOperator)),m=new RegExp(this.eqOperator),y=new RegExp(this.stOperator),_=new RegExp(this.enOperator),C=this.emOperator,w=this.nmOperator,x=new RegExp(u["default"].rgxEsc(this.rgxOperator)),T=this.refRow;TO;O++){var E=l[this.singleSearchFlt?0:O],k=this.hasColDateType?this.colDateType[O]:this.defaultDateType;if(""!==E){var L=u["default"].matchCase(this.getCellData(F[O]),this.caseSensitive),N=E.toString().split(this.orOperator),B=N.length>1,D=E.toString().split(this.anOperator),M=D.length>1;if(p["default"].isArray(E)||B||M){var A=void 0,H=void 0,j=!1;H=p["default"].isArray(E)?E:B?N:D;for(var V=0,U=H.length;U>V&&(A=u["default"].trim(H[V]),j=e.call(this,A,L,O),t.call(this,A,j,F[O]),!(B&&j||M&&!j))&&(!p["default"].isArray(E)||!j);V++);P[O]=j}else P[O]=e.call(this,u["default"].trim(E),L,O),t.call(this,E,P[O],F[O]);P[O]||(S=!1),this.singleSearchFlt&&P[O]&&(I=!0),this.emitter.emit("cell-processed",this,O,F[O])}}this.singleSearchFlt&&I&&(S=!0),S?this.validateRow(T,!0):(this.validateRow(T,!1),s++),this.emitter.emit("row-processed",this,T,this.validRowsIndex.length,S)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=s,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this,l)}},t.prototype.getColValues=function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,r=[];e&&r.push(this.getHeadersText()[t]);for(var l=this.refRow;l0&&(a=-1!=s.indexOf(l));var o=n[l].cells,h=o.length;if(h===this.nbCells&&!a)for(var f=0;h>f;f++)if(f==t&&""===n[l].style.display){var u=this.getCellData(o[f]),d=this.colNbFormat?this.colNbFormat[t]:null,p=i?v["default"].removeNbFormat(u,d):u;r.push(p)}}return r}},t.prototype.getFilterValue=function(t){if(this.fltGrid){var e="",i=[],s=this.getFilterElement(t);if(!s)return"";var n=this.getFilterType(t);if(n!==this.fltTypeMulti&&n!==this.fltTypeCheckList)e=s.value;else if(n===this.fltTypeMulti){for(var r=0,l=s.options.length;l>r;r++)s.options[r].selected&&i.push(s.options[r].value);e=i.length>0?i:""}else n===this.fltTypeCheckList&&(null!==s.getAttribute("value")&&(i=s.getAttribute("value"),i=i.substr(0,i.length-3),i=i.split(" "+this.orOperator+" ")),e=i.length>0?i:"");return p["default"].isArray(e)&&1===e.length&&""===e[0]&&(e=""),e}},t.prototype.getFiltersValue=function(){if(this.fltGrid){for(var t=[],e=0,i=this.fltIds.length;i>e;e++){var s=this.getFilterValue(e);p["default"].isArray(s)?t.push(s):t.push(u["default"].trim(s))}return t}},t.prototype.getFilterId=function(t){return this.fltGrid?this.fltIds[t]:void 0},t.prototype.getFiltersByType=function(t,e){if(this.fltGrid){for(var i=[],s=0,n=this.fltIds.length;n>s;s++){var r=this.getFilterType(s);if(r===u["default"].lower(t)){var l=e?s:this.fltIds[s];i.push(l)}}return i}},t.prototype.getFilterElement=function(t){var e=this.fltIds[t];return h["default"].id(e)},t.prototype.getCellsNb=function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length},t.prototype.getRowsNb=function(t){var e=p["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)},t.prototype.getCellData=function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):h["default"].getText(t)},t.prototype.getTableData=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var r=this.refRow;ro;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var f=this.getCellData(a[o]);l[1].push(f)}s.push(l)}return s},t.prototype.getFilteredData=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var r=this.getValidRows(!0),l=0;ln;n++){var l=i[n],a=l[1],o=a[t];s.push(o)}return s},t.prototype.getRowDisplay=function(t){return p["default"].isObj(t)?t.style.display:null},t.prototype.validateRow=function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}},t.prototype.validateAllRows=function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;t0,r=n?null:N.createDocumentFragment(),l=0;e>l;l++){var a=void 0;n?a=s[l]:(a=h["default"].create("col",["id",this.id+"_col_"+l]),r.appendChild(a)),a.style.width=i[l]}n||t.insertBefore(r,t.firstChild)}this.hasColWidths&&(t=t||this.tbl,e.call(this))},t.prototype.enforceVisibility=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)}},t.prototype.clearFilters=function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.filter(),this.onAfterReset&&this.onAfterReset.call(null,this),this.emitter.emit("after-clearing-filters",this)}},t.prototype.clearActiveColumns=function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)},t.prototype.markActiveColumn=function(t){var e=this.getHeaderElement(t);h["default"].hasClass(e,this.activeColumnsCssClass)||(this.onBeforeActiveColumn&&this.onBeforeActiveColumn.call(null,this,t),h["default"].addClass(e,this.activeColumnsCssClass),this.onAfterActiveColumn&&this.onAfterActiveColumn.call(null,this,t))},t.prototype.getActiveFilterId=function(){return this.activeFilterId},t.prototype.setActiveFilterId=function(t){this.activeFilterId=t},t.prototype.getColumnIndexFromFilterId=function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=t.split("_")[0];return e=e.split(this.prfxFlt)[1],parseInt(e,10)},t.prototype.activateFilter=function(t){p["default"].isUndef(t)||this.setActiveFilterId(this.getFilterId(t))},t.prototype.linkFilters=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);for(var n=this.getColumnIndexFromFilterId(this.activeFilterId),r=0,l=s.length;l>r;r++){var a=h["default"].id(this.fltIds[s[r]]),o=this.getFilterValue(s[r]);if(n!==s[r]||this.paging&&-1!=t.indexOf(s[r])&&n===s[r]||!this.paging&&(-1!=i.indexOf(s[r])||-1!=e.indexOf(s[r]))||o===this.displayAllText){ +if(this.loadFltOnDemand){var f=h["default"].createOpt(this.displayAllText,"");a.innerHTML="",a.appendChild(f)}-1!=i.indexOf(s[r])?this.emitter.emit("build-checklist-filter",this,s[r]):this.emitter.emit("build-select-filter",this,s[r],!0),this.setFilterValue(s[r],o)}}}},t.prototype.isExactMatch=function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp},t.prototype.isImported=function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",r=h["default"].tag(N,s),l=0,a=r.length;a>l;l++)if(void 0!==r[l][n]&&r[l][n].match(t)){i=!0;break}return i},t.prototype["import"]=function(t,e,i,s){var n=s?s:"script",r=this.isImported(e,n);if(!r){var l=this,a=!1,o=void 0,f=h["default"].tag(N,"head")[0];o="link"===u["default"].lower(n)?h["default"].create("link",["id",t],["type","text/css"],["rel","stylesheet"],["href",e]):h["default"].create("script",["id",t],["type","text/javascript"],["src",e]),o.onload=o.onreadystatechange=function(){a||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(a=!0,"function"==typeof i&&i.call(null,l))},o.onerror=function(){throw new Error("TableFilter could not load: "+e)},f.appendChild(o)}},t.prototype.hasGrid=function(){return this._hasGrid},t.prototype.getFiltersId=function(){return this.fltIds||[]},t.prototype.getValidRows=function(t){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e1)for(var s=0;s2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}-1!==e.indexOf("M")&&-1!==e.indexOf("D")&&-1!==e.indexOf("Y")||(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var r=t.split(RegExp.$1),l=void 0,a=void 0,o=void 0;l="M"===e.substring(0,1)?r[0]:"M"===e.substring(1,2)?r[1]:r[2],a="D"===e.substring(0,1)?r[0]:"D"===e.substring(1,2)?r[1]:r[2],o="Y"===e.substring(0,1)?r[0]:"Y"===e.substring(1,2)?r[1]:r[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(l,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=h.getDate()?!1:parseInt(l,10)-1==h.getMonth()},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,r=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":r=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(r[2]),s(r[1])-1,r[0]);break;case"DMY":r=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[1]-1,r[0]);break;case"MDY":r=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[0]-1,r[1]);break;case"YMD":r=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(r[0]),r[1]-1,r[2]);break;default:r=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(r[2]),r[1]-1,r[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(4),r=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===r["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")}Object.defineProperty(e,"__esModule",{value:!0});e.Emitter=function(){function t(){i(this,t),this.events={}}return t.prototype.on=function(t,e){var i=this;t.forEach(function(t){i.events[t]=i.events[t]||[],i.events[t].push(e)})},t.prototype.off=function(t,e){var i=this;t.forEach(function(t){t in i.events&&i.events[t].splice(i.events[t].indexOf(e),1)})},t.prototype.emit=function(t){if(t in this.events)for(var e=0;e0&&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(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=b),this.tblHasColTag=h["default"].tag(s,"col").length>0;var S=function(){for(var t=e.nbCells-1;t>=0;t--){var i=h["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=h["default"].tag(s,"col"),O=0;O',s.popUpDivCssClass=l.popup_div_css_class||"popUpFilter",s.onBeforePopUpOpen=h["default"].isFn(l.on_before_popup_filter_open)?l.on_before_popup_filter_open:null,s.onAfterPopUpOpen=h["default"].isFn(l.on_after_popup_filter_open)?l.on_after_popup_filter_open:null,s.onBeforePopUpClose=h["default"].isFn(l.on_before_popup_filter_close)?l.on_before_popup_filter_close:null,s.onAfterPopUpClose=h["default"].isFn(l.on_after_popup_filter_close)?l.on_after_popup_filter_close:null,s.popUpFltSpans=[],s.popUpFltImgs=[],s.popUpFltElms=s.popUpFltElmCache||[],s.popUpFltAdjustToContainer=!0,s.prfxPopUpSpan="popUpSpan_",s.prfxPopUpDiv="popUpDiv_",s}return l(i,e),i.prototype.onClick=function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var r=this.popUpFltElms[n],l=this.tf.getHeaderElement(n),a=.95*l.clientWidth;r.style.width=parseInt(a,10)+"px"}p["default"].cancel(i),p["default"].stop(i)},i.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;iy;y++)if(t===y&&(!e||e&&i.disableExcludedOptions)||t===y&&e&&(""===r[c].style.display&&!i.paging||i.paging&&(!i.validRowsIndex||i.validRowsIndex&&-1!=i.validRowsIndex.indexOf(c))&&(void 0===a||a===t||a!=t&&-1!=i.validRowsIndex.indexOf(c)))){var _=i.getCellData(b[y]),C=p["default"].matchCase(_,l);if(u["default"].has(this.opts,C,l)||this.opts.push(_),e&&i.disableExcludedOptions){var w=d[y];w||(w=i.getFilteredDataCol(y)),u["default"].has(w,C,l)||u["default"].has(f,C,l)||f.push(_)}}}if(this.isCustom){var x=i.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(i.sortSlc&&!this.isCustom&&(l?(this.opts.sort(),f&&f.sort()):(this.opts.sort(g["default"].ignoreCase),f&&f.sort(g["default"].ignoreCase))),-1!=i.sortNumAsc.indexOf(t))try{this.opts.sort(g["default"].numSortAsc),f&&f.sort(g["default"].numSortAsc),this.isCustom&&this.optsTxt.sort(g["default"].numSortAsc)}catch(T){throw new Error(m.replace("{0}",t).replace("{1}","ascending"))}if(-1!=i.sortNumDesc.indexOf(t))try{this.opts.sort(g["default"].numSortDesc),f&&f.sort(g["default"].numSortDesc),this.isCustom&&this.optsTxt.sort(g["default"].numSortDesc)}catch(T){throw new Error(m.replace("{0}",t).replace("{1}","ascending")); +}this.addOptions(t,n,e,f),this.emitter.emit("after-populating-filter",i,t,n)},e.prototype.addOptions=function(t,e,i,s){var n=this.tf,r=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var l=0;li?-1:i>s?1:0},numSortAsc:function(t,e){return t-e},numSortDesc:function(t,e){return e-t}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.CheckList=void 0;var a=i(9),o=i(2),h=s(o),f=i(14),u=s(f),d=i(4),p=s(d),c=i(15),g=s(c),b=i(1),v=s(b),m="Filter options for column {0} cannot be sorted in {1} manner.";e.CheckList=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"checkList")),l=i.config();return s.checkListDiv=[],s.checkListDivCssClass=l.div_checklist_css_class||"div_checklist",s.checkListCssClass=l.checklist_css_class||"flt_checklist",s.checkListItemCssClass=l.checklist_item_css_class||"flt_checklist_item",s.checkListSlcItemCssClass=l.checklist_selected_item_css_class||"flt_checklist_slc_item",s.activateCheckListTxt=l.activate_checklist_text||"Click to load filter data",s.checkListItemDisabledCssClass=l.checklist_item_disabled_css_class||"flt_checklist_item_disabled",s.enableCheckListResetFilter=l.enable_checklist_reset_filter!==!1,s.prfxCheckListDiv="chkdiv_",s.isCustom=null,s.opts=null,s.optsTxt=null,s.excludedOpts=null,s}return l(e,t),e.prototype.onChange=function(t){var e=v["default"].target(t),i=this.tf;this.emitter.emit("filter-focus",i,e),i.filter()},e.prototype.optionClick=function(t){this.setCheckListValues(t.target),this.onChange(t)},e.prototype.onCheckListClick=function(t){var e=this,i=v["default"].target(t);if(this.tf.loadFltOnDemand&&"0"===i.getAttribute("filled")){var s=i.getAttribute("ct"),n=this.checkListDiv[s];this.build(s),v["default"].remove(n,"click",function(t){return e.onCheckListClick(t)})}},e.prototype.init=function(t,e,i){var s=this,n=this.tf,r=e?n.externalFltTgtIds[t]:null,l=h["default"].create("div",["id",this.prfxCheckListDiv+t+"_"+n.id],["ct",t],["filled","0"]);l.className=this.checkListDivCssClass,r?(h["default"].id(r).appendChild(l),n.externalFltEls.push(l)):i.appendChild(l),this.checkListDiv[t]=l,n.fltIds.push(n.prfxFlt+t+"_"+n.id),n.loadFltOnDemand?(v["default"].add(l,"click",function(t){return s.onCheckListClick(t)}),l.appendChild(h["default"].text(this.activateCheckListTxt))):this.build(t),this.emitter.on(["build-checklist-filter"],function(t,e,i){return s.build(e,i)}),this.emitter.on(["select-checklist-options"],function(t,e,i){return s.selectOptions(e,i)}),this.initialized=!0},e.prototype.build=function(t){var e=this,i=this.tf;t=parseInt(t,10),this.emitter.emit("before-populating-filter",i,t),this.opts=[],this.optsTxt=[];var s=this.checkListDiv[t],n=h["default"].create("ul",["id",i.fltIds[t]],["colIndex",t]);n.className=this.checkListCssClass,v["default"].add(n,"change",function(t){return e.onChange(t)});var r=i.tbl.rows;this.isCustom=i.isCustomOptions(t);var l=void 0,a=i.getActiveFilterId();i.linkedFilters&&a&&(l=i.getColumnIndexFromFilterId(a));var o=[];i.linkedFilters&&i.disableExcludedOptions&&(this.excludedOpts=[]),s.innerHTML="";for(var f=i.refRow;fb;b++)if(t===b&&(!i.linkedFilters||i.linkedFilters&&i.disableExcludedOptions)||t===b&&i.linkedFilters&&(""===r[f].style.display&&!i.paging||i.paging&&(!l||l===t||l!=t&&-1!=i.validRowsIndex.indexOf(f)))){var y=i.getCellData(d[b]),_=p["default"].matchCase(y,i.matchCase);u["default"].has(this.opts,_,i.matchCase)||this.opts.push(y);var C=o[b];i.linkedFilters&&i.disableExcludedOptions&&(C||(C=i.getFilteredDataCol(b)),u["default"].has(C,_,i.matchCase)||u["default"].has(this.excludedOpts,_,i.matchCase)||this.excludedOpts.push(y))}}if(this.isCustom){var w=i.getCustomOptions(t);this.opts=w[0],this.optsTxt=w[1]}if(i.sortSlc&&!this.isCustom&&(i.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(g["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(g["default"].ignoreCase))),-1!=i.sortNumAsc.indexOf(t))try{this.opts.sort(g["default"].numSortAsc),this.excludedOpts&&this.excludedOpts.sort(g["default"].numSortAsc),this.isCustom&&this.optsTxt.sort(g["default"].numSortAsc)}catch(x){throw new Error(m.replace("{0}",t).replace("{1}","ascending"))}if(-1!=i.sortNumDesc.indexOf(t))try{this.opts.sort(g["default"].numSortDesc),this.excludedOpts&&this.excludedOpts.sort(g["default"].numSortDesc),this.isCustom&&this.optsTxt.sort(g["default"].numSortDesc)}catch(x){throw new Error(m.replace("{0}",t).replace("{1}","descending"))}this.addChecks(t,n),i.loadFltOnDemand&&(s.innerHTML=""),s.appendChild(n),s.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",i,t,s)},e.prototype.addChecks=function(t,e){for(var i=this,s=this.tf,n=this.addTChecks(t,e),r=0;rr;r++){var l=h["default"].tag(s,"li")[r],a=h["default"].tag(l,"label")[0],o=h["default"].tag(l,"input")[0],f=p["default"].matchCase(h["default"].getText(a),i.caseSensitive);""!==f&&u["default"].has(e,f,i.caseSensitive)?(o.checked=!0,this.setCheckListValues(o)):(o.checked=!1,this.setCheckListValues(o))}}},e.prototype.destroy=function(){var t=this;this.emitter.off(["build-checklist-filter"],function(e,i,s){return t.build(i,s)}),this.emitter.off(["select-checklist-options"],function(e,i,s){return t.selectOptions(i,s)})},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.RowsCounter=void 0;var a=i(9),o=i(2),h=s(o),f=i(3),u=s(f);e.RowsCounter=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"rowsCounter")),l=s.config;return s.rowsCounterTgtId=l.rows_counter_target_id||null,s.rowsCounterDiv=null,s.rowsCounterSpan=null,s.rowsCounterText=l.rows_counter_text||"Rows: ",s.fromToTextSeparator=l.from_to_text_separator||"-",s.overText=l.over_text||" / ",s.totRowsCssClass=l.tot_rows_css_class||"tot",s.prfxCounter="counter_",s.prfxTotRows="totrows_span_",s.prfxTotRowsTxt="totRowsTextSpan_",s.onBeforeRefreshCounter=u["default"].isFn(l.on_before_refresh_counter)?l.on_before_refresh_counter:null,s.onAfterRefreshCounter=u["default"].isFn(l.on_after_refresh_counter)?l.on_after_refresh_counter:null,s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=h["default"].create("div",["id",this.prfxCounter+e.id]);i.className=this.totRowsCssClass;var s=h["default"].create("span",["id",this.prfxTotRows+e.id]),n=h["default"].create("span",["id",this.prfxTotRowsTxt+e.id]);n.appendChild(h["default"].text(this.rowsCounterText)),this.rowsCounterTgtId||e.setToolbar();var r=this.rowsCounterTgtId?h["default"].id(this.rowsCounterTgtId):e.lDiv;this.rowsCounterTgtId?(r.appendChild(n),r.appendChild(s)):(i.appendChild(n),i.appendChild(s),r.appendChild(i)),this.rowsCounterDiv=i,this.rowsCounterSpan=s,this.emitter.on(["after-filtering","grouped-by-page"],function(){return t.refresh(e.nbVisibleRows)}),this.emitter.on(["rows-changed"],function(){return t.refresh()}),this.initialized=!0,this.refresh()}},e.prototype.refresh=function(t){if(this.initialized&&this.isEnabled()){var e=this.tf;this.onBeforeRefreshCounter&&this.onBeforeRefreshCounter.call(null,e,this.rowsCounterSpan);var i;if(e.paging){var s=e.feature("paging");if(s){var n=parseInt(s.startPagingRow,10)+(e.nbVisibleRows>0?1:0),r=n+s.pagingLength-1<=e.nbVisibleRows?n+s.pagingLength-1:e.nbVisibleRows;i=n+this.fromToTextSeparator+r+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)}},e.prototype.destroy=function(){var t=this;this.initialized&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?h["default"].remove(this.rowsCounterDiv):h["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null,this.emitter.off(["after-filtering","grouped-by-page"],function(){return t.refresh(tf.nbVisibleRows)}),this.emitter.off(["rows-changed"],function(){return t.refresh()}),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.StatusBar=void 0;var a=i(9),o=i(2),h=s(o),f=i(3),u=s(f),d=window;e.StatusBar=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"statusBar")),l=s.config;return s.statusBarTgtId=l.status_bar_target_id||null,s.statusBarDiv=null,s.statusBarSpan=null,s.statusBarSpanText=null,s.statusBarText=l.status_bar_text||"",s.statusBarCssClass=l.status_bar_css_class||"status",s.statusBarCloseDelay=250,s.onBeforeShowMsg=u["default"].isFn(l.on_before_show_msg)?l.on_before_show_msg:null,s.onAfterShowMsg=u["default"].isFn(l.on_after_show_msg)?l.on_after_show_msg:null,s.msgFilter=l.msg_filter||"Filtering data...",s.msgPopulate=l.msg_populate||"Populating filter...",s.msgPopulateCheckList=l.msg_populate_checklist||"Populating list...",s.msgChangePage=l.msg_change_page||"Collecting paging data...",s.msgClear=l.msg_clear||"Clearing filters...",s.msgChangeResults=l.msg_change_results||"Changing results per page...",s.msgResetPage=l.msg_reset_page||"Re-setting page...",s.msgResetPageLength=l.msg_reset_page_length||"Re-setting page length...",s.msgSort=l.msg_sort||"Sorting data...",s.msgLoadExtensions=l.msg_load_extensions||"Loading extensions...",s.msgLoadThemes=l.msg_load_themes||"Loading theme(s)...",s.prfxStatus="status_",s.prfxStatusSpan="statusSpan_",s.prfxStatusTxt="statusText_",s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=this.emitter,s=h["default"].create("div",["id",this.prfxStatus+e.id]);s.className=this.statusBarCssClass;var n=h["default"].create("span",["id",this.prfxStatusSpan+e.id]),r=h["default"].create("span",["id",this.prfxStatusTxt+e.id]);r.appendChild(h["default"].text(this.statusBarText)),this.statusBarTgtId||e.setToolbar();var l=this.statusBarTgtId?h["default"].id(this.statusBarTgtId):e.lDiv;this.statusBarTgtId?(l.appendChild(r),l.appendChild(n)):(s.appendChild(r),s.appendChild(n),l.appendChild(s)),this.statusBarDiv=s,this.statusBarSpan=n,this.statusBarSpanText=r,i.on(["before-filtering"],function(){return t.message(t.msgFilter)}),i.on(["before-populating-filter"],function(){return t.message(t.msgPopulate)}),i.on(["before-page-change"],function(){return t.message(t.msgChangePage)}),i.on(["before-clearing-filters"],function(){return t.message(t.msgClear)}),i.on(["before-page-length-change"],function(){return t.message(t.msgChangeResults)}),i.on(["before-reset-page"],function(){return t.message(t.msgResetPage)}),i.on(["before-reset-page-length"],function(){return t.message(t.msgResetPageLength)}),i.on(["before-loading-extensions"],function(){return t.message(t.msgLoadExtensions)}),i.on(["before-loading-themes"],function(){return t.message(t.msgLoadThemes)}),i.on(["after-filtering","after-populating-filter","after-page-change","after-clearing-filters","after-page-length-change","after-reset-page","after-reset-page-length","after-loading-extensions","after-loading-themes"],function(){return t.message("")}),this.initialized=!0}},e.prototype.message=function(){var t=this,e=arguments.length<=0||void 0===arguments[0]?"":arguments[0];if(this.isEnabled()){this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,e);var i=""===e?this.statusBarCloseDelay:1;d.setTimeout(function(){t.initialized&&(t.statusBarSpan.innerHTML=e,t.onAfterShowMsg&&t.onAfterShowMsg.call(null,t.tf,e))},i)}},e.prototype.destroy=function(){var t=this;if(this.initialized){var e=this.emitter;this.statusBarDiv.innerHTML="",this.statusBarTgtId||h["default"].remove(this.statusBarDiv),this.statusBarSpan=null,this.statusBarSpanText=null,this.statusBarDiv=null,e.off(["before-filtering"],function(){return t.message(t.msgFilter)}),e.off(["before-populating-filter"],function(){return t.message(t.msgPopulate)}),e.off(["before-page-change"],function(){return t.message(t.msgChangePage)}),e.off(["before-clearing-filters"],function(){return t.message(t.msgClear)}),e.off(["before-page-length-change"],function(){return t.message(t.msgChangeResults)}),e.off(["before-reset-page"],function(){return t.message(t.msgResetPage)}),e.off(["before-reset-page-length"],function(){return t.message(t.msgResetPageLength)}),e.off(["before-loading-extensions"],function(){return t.message(t.msgLoadExtensions)}),e.off(["before-loading-themes"],function(){return t.message(t.msgLoadThemes)}),e.off(["after-filtering","after-populating-filter","after-page-change","after-clearing-filters","after-page-length-change","after-reset-page","after-reset-page-length","after-loading-extensions","after-loading-themes"],function(){return t.message("")}),this.initialized=!1}},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.Paging=void 0;var a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol?"symbol":typeof t},o=i(9),h=i(2),f=s(h),u=i(3),d=s(u),p=i(4),c=s(p),g=i(1),b=s(g);e.Paging=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"paging")),l=s.config;s.btnPageCssClass=l.paging_btn_css_class||"pgInp",s.pagingSlc=null,s.resultsPerPageSlc=null,s.pagingTgtId=l.paging_target_id||null,s.pagingLength=isNaN(l.paging_length)?10:l.paging_length,s.resultsPerPageTgtId=l.results_per_page_target_id||null,s.pgSlcCssClass=l.paging_slc_css_class||"pgSlc",s.pgInpCssClass=l.paging_inp_css_class||"pgNbInp",s.resultsPerPage=l.results_per_page||null,s.hasResultsPerPage=d["default"].isArray(s.resultsPerPage),s.resultsSlcCssClass=l.results_slc_css_class||"rspg",s.resultsSpanCssClass=l.results_span_css_class||"rspgSpan",s.startPagingRow=0,s.nbPages=0,s.currentPageNb=1,s.btnNextPageText=l.btn_next_page_text||">",s.btnPrevPageText=l.btn_prev_page_text||"<",s.btnLastPageText=l.btn_last_page_text||">|",s.btnFirstPageText=l.btn_first_page_text||"|<",s.btnNextPageHtml=l.btn_next_page_html||(i.enableIcons?'':null),s.btnPrevPageHtml=l.btn_prev_page_html||(i.enableIcons?'':null),s.btnFirstPageHtml=l.btn_first_page_html||(i.enableIcons?'':null),s.btnLastPageHtml=l.btn_last_page_html||(i.enableIcons?'':null),s.pageText=l.page_text||" Page ",s.ofText=l.of_text||" of ",s.nbPgSpanCssClass=l.nb_pages_css_class||"nbpg",s.hasPagingBtns=l.paging_btns!==!1,s.pageSelectorType=l.page_selector_type||i.fltTypeSlc,s.onBeforeChangePage=d["default"].isFn(l.on_before_change_page)?l.on_before_change_page:null,s.onAfterChangePage=d["default"].isFn(l.on_after_change_page)?l.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=i.refRow,o=i.nbRows;s.nbPages=Math.ceil((o-a)/s.pagingLength);var h=s;return s.evt={slcIndex:function(){return h.pageSelectorType===i.fltTypeSlc?h.pagingSlc.options.selectedIndex:parseInt(h.pagingSlc.value,10)-1},nbOpts:function(){return h.pageSelectorType===i.fltTypeSlc?parseInt(h.pagingSlc.options.length,10)-1:h.nbPages-1},next:function(){var t=h.evt.slcIndex()0?h.evt.slcIndex()-1:h.evt.nbOpts();h.changePage(t)},last:function(){h.changePage(h.evt.nbOpts())},first:function(){h.changePage(0)},_detectKey:function(t){var e=b["default"].keyCode(t);13===e&&(i.sorted?(i.filter(),h.changePage(h.evt.slcIndex())):h.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},s}return l(e,t),e.prototype.init=function(){var t,e=this,i=this.tf,s=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),s.slcPagesChange=function(t){var i=t.target;e.changePage(i.selectedIndex)},this.pageSelectorType===i.fltTypeSlc&&(t=f["default"].create(i.fltTypeSlc,["id",this.prfxSlcPages+i.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",s.slcPagesChange)),this.pageSelectorType===i.fltTypeInp&&(t=f["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var n=f["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),r=f["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),l=f["default"].create("span",["id",this.prfxBtnLastSpan+i.id]),a=f["default"].create("span",["id",this.prfxBtnFirstSpan+i.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)n.innerHTML=this.btnNextPageHtml,b["default"].add(n,"click",s.next);else{var o=f["default"].create(i.fltTypeInp,["id",this.prfxBtnNext+i.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);o.className=this.btnPageCssClass,b["default"].add(o,"click",s.next),n.appendChild(o)}if(this.btnPrevPageHtml)r.innerHTML=this.btnPrevPageHtml,b["default"].add(r,"click",s.prev);else{var h=f["default"].create(i.fltTypeInp,["id",this.prfxBtnPrev+i.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",s.prev),r.appendChild(h)}if(this.btnLastPageHtml)l.innerHTML=this.btnLastPageHtml,b["default"].add(l,"click",s.last);else{var u=f["default"].create(i.fltTypeInp,["id",this.prfxBtnLast+i.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,b["default"].add(u,"click",s.last),l.appendChild(u)}if(this.btnFirstPageHtml)a.innerHTML=this.btnFirstPageHtml,b["default"].add(a,"click",s.first);else{var d=f["default"].create(i.fltTypeInp,["id",this.prfxBtnFirst+i.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);d.className=this.btnPageCssClass,b["default"].add(d,"click",s.first),a.appendChild(d)}}this.pagingTgtId||i.setToolbar();var p=this.pagingTgtId?f["default"].id(this.pagingTgtId):i.mDiv;p.appendChild(a),p.appendChild(r);var c=f["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);c.appendChild(f["default"].text(this.pageText)),c.className=this.nbPgSpanCssClass,p.appendChild(c),p.appendChild(t);var g=f["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(f["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,p.appendChild(g);var v=f["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(f["default"].text(" "+this.nbPages+" ")),p.appendChild(v),p.appendChild(n),p.appendChild(l),this.pagingSlc=f["default"].id(this.prfxSlcPages+i.id),this.setPagingInfo(),i.fltGrid||(i.validateAllRows(),this.setPagingInfo(i.validRowsIndex)),this.emitter.on(["after-filtering"],function(){return e.resetPagingInfo()}),this.emitter.on(["change-page"],function(t,i){return e.setPage(i)}),this.emitter.on(["change-page-results"],function(t,i){return e.changeResultsPerPage(i)}),this.initialized=!0}},e.prototype.reset=function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;this.isEnabled()||(this.enable(),this.init(),t&&e.filter())},e.prototype.resetPagingInfo=function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)},e.prototype.setPagingInfo=function(t){var e=this.tf,i=this.pagingTgtId?f["default"].id(this.pagingTgtId):e.mDiv,s=f["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t||e.getValidRows(!0),this.nbPages=Math.ceil(e.validRowsIndex.length/this.pagingLength),s.innerHTML=this.nbPages,this.pageSelectorType===e.fltTypeSlc&&(this.pagingSlc.innerHTML=""),this.nbPages>0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var n=0;nr;r++){var a=e.validRowsIndex[r],o=i[a],h=o.getAttribute("validRow"),f=!1;r>=s&&n>r?(d["default"].isNull(h)||Boolean("true"===h))&&(o.style.display="",f=!0):o.style.display="none",this.emitter.emit("row-paged",e,a,r,f)}e.nbVisibleRows=e.validRowsIndex.length,this.emitter.emit("grouped-by-page",e,this)},e.prototype.getPage=function(){return this.currentPageNb},e.prototype.setPage=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(c["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)}},e.prototype.setResultsPerPage=function(){var t=this,e=this.tf,i=this.evt;if(!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.onChangeResultsPerPage(),e.target.blur()};var s=f["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var n=this.resultsPerPage[0],r=this.resultsPerPage[1],l=f["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);l.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var a=this.resultsPerPageTgtId?f["default"].id(this.resultsPerPageTgtId):e.rDiv;l.appendChild(f["default"].text(n));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(l,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(a.appendChild(l),a.appendChild(s));for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t+1),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t+1)),this.emitter.emit("after-page-change",e,t+1))},e.prototype.changeResultsPerPage=function(t){this.isEnabled()&&!isNaN(t)&&(this.resultsPerPageSlc.value=t,this.onChangeResultsPerPage())},e.prototype.onChangeResultsPerPage=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-page-length-change",t);var e=this.resultsPerPageSlc,i=e.selectedIndex,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[i].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)&&(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc)){var n=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[n].selected=!0}this.emitter.emit("after-page-length-change",t,this.pagingLength)}},e.prototype.resetPage=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page",t);var e=t.feature("store").getPageNb();""!==e&&this.changePage(e-1),this.emitter.emit("after-reset-page",t,e)}},e.prototype.resetPageLength=function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page-length",t);var e=t.feature("store").getPageLength();""!==e&&(this.resultsPerPageSlc.options[e].selected=!0,this.changeResultsPerPage()),this.emitter.emit("after-reset-page-length",t,e)}},e.prototype.destroy=function(){ +var t=this,e=this.tf;if(this.initialized){var i=f["default"].id(this.prfxBtnNextSpan+e.id),s=f["default"].id(this.prfxBtnPrevSpan+e.id),n=f["default"].id(this.prfxBtnLastSpan+e.id),r=f["default"].id(this.prfxBtnFirstSpan+e.id),l=f["default"].id(this.prfxPgBeforeSpan+e.id),a=f["default"].id(this.prfxPgAfterSpan+e.id),o=f["default"].id(this.prfxPgSpan+e.id),h=this.evt;this.pagingSlc&&(this.pageSelectorType===e.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===e.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",h._detectKey),f["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",h.next),f["default"].remove(i)),s&&(b["default"].remove(s,"click",h.prev),f["default"].remove(s)),n&&(b["default"].remove(n,"click",h.last),f["default"].remove(n)),r&&(b["default"].remove(r,"click",h.first),f["default"].remove(r)),l&&f["default"].remove(l),a&&f["default"].remove(a),o&&f["default"].remove(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.emitter.off(["after-filtering"],function(){return t.resetPagingInfo()}),this.emitter.off(["change-page"],function(e,i){return t.setPage(i)}),this.emitter.off(["change-page-results"],function(e,i){return t.changeResultsPerPage(i)}),this.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}},e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.ClearButton=void 0;var a=i(9),o=i(2),h=s(o),f=i(1),u=s(f);e.ClearButton=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"btnReset")),l=s.config;return s.btnResetTgtId=l.btn_reset_target_id||null,s.btnResetEl=null,s.btnResetText=l.btn_reset_text||"Reset",s.btnResetTooltip=l.btn_reset_tooltip||"Clear filters",s.btnResetHtml=l.btn_reset_html||(i.enableIcons?'':null),s.prfxResetSpan="resetspan_",s}return l(e,t),e.prototype.onClick=function(){this.isEnabled()&&this.tf.clearFilters()},e.prototype.init=function(){var t=this,e=this.tf;if(!this.initialized){var i=h["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var s=this.btnResetTgtId?h["default"].id(this.btnResetTgtId):e.rDiv;if(s.appendChild(i),this.btnResetHtml){i.innerHTML=this.btnResetHtml;var n=i.firstChild;u["default"].add(n,"click",function(){t.onClick()})}else{var r=h["default"].create("a",["href","javascript:void(0);"]);r.className=e.btnResetCssClass,r.appendChild(h["default"].text(this.btnResetText)),i.appendChild(r),u["default"].add(r,"click",function(){t.onClick()})}this.btnResetEl=i.firstChild,this.initialized=!0}},e.prototype.destroy=function(){var t=this.tf;if(this.initialized){var e=h["default"].id(this.prfxResetSpan+t.id);e&&h["default"].remove(e),this.btnResetEl=null,this.initialized=!1}},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.Help=void 0;var a=i(9),o=i(2),h=s(o),f=i(1),u=s(f),d="https://github.com/koalyptus/TableFilter/wiki/4.-Filter-operators",p="http://koalyptus.github.io/TableFilter/";e.Help=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"help")),l=s.config;return s.tgtId=l.help_instructions_target_id||null,s.contTgtId=l.help_instructions_container_target_id||null,s.instrText=l.help_instructions_text?l.help_instructions_text:'Use the filters above each column to filter and limit table data. Advanced searches can be performed by using the following operators:
<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',s.instrHtml=l.help_instructions_html||null,s.btnText=l.help_instructions_btn_text||"?",s.btnHtml=l.help_instructions_btn_html||null,s.btnCssClass=l.help_instructions_btn_css_class||"helpBtn",s.contCssClass=l.help_instructions_container_css_class||"helpCont",s.btn=null,s.cont=null,s.defaultHtml='

TableFilter v'+i.version+'

'+p+"
©2015-"+i.year+' Max Guglielmi
',s.prfxHelpSpan="helpSpan_",s.prfxHelpDiv="helpDiv_",s.emitter.on(["init-help"],function(){return s.init()}),s}return l(e,t),e.prototype.init=function(){var t=this;if(!this.initialized){var e=this.tf,i=h["default"].create("span",["id",this.prfxHelpSpan+e.id]),s=h["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.tgtId||e.setToolbar();var n=this.tgtId?h["default"].id(this.tgtId):e.rDiv;n.appendChild(i);var r=this.contTgtId?h["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var l=i.firstChild;u["default"].add(l,"click",function(){t.toggle()}),r.appendChild(s)}else{r.appendChild(s);var a=h["default"].create("a",["href","javascript:void(0);"]);a.className=this.btnCssClass,a.appendChild(h["default"].text(this.btnText)),i.appendChild(a),u["default"].add(a,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&r.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,u["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,u["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,u["default"].add(s,"click",function(){t.toggle()}),this.cont=s,this.btn=i,this.initialized=!0}},e.prototype.toggle=function(){if(this.enabled!==!1){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}},e.prototype.destroy=function(){this.initialized&&(h["default"].remove(this.btn),this.btn=null,this.cont&&(h["default"].remove(this.cont),this.cont=null,this.initialized=!1))},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.AlternateRows=void 0;var a=i(9),o=i(2),h=s(o);e.AlternateRows=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"alternateRows")),l=s.config;return s.evenCss=l.even_row_css_class||"even",s.oddCss=l.odd_row_css_class||"odd",s}return l(e,t),e.prototype.init=function(){var t=this;this.initialized||(this.processAll(),this.emitter.on(["row-processed","row-paged"],function(e,i,s,n){return t.processRow(i,s,n)}),this.emitter.on(["column-sorted"],function(){return t.processAll()}),this.initialized=!0)},e.prototype.processAll=function(){if(this.isEnabled())for(var t=this.tf,e=t.getValidRows(!0),i=0===e.length,s=i?t.refRow:0,n=i?t.nbFilterableRows+s:e.length,r=0,l=s;n>l;l++){var a=i?l:e[l];this.setRowBg(a,r),r++}},e.prototype.processRow=function(t,e,i){i?this.setRowBg(t,e):this.removeRowBg(t)},e.prototype.setRowBg=function(t,e){if(this.isEnabled()&&!isNaN(t)){var i=this.tf.tbl.rows,s=isNaN(e)?t:e;this.removeRowBg(t),h["default"].addClass(i[t],s%2?this.evenCss:this.oddCss)}},e.prototype.removeRowBg=function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;h["default"].removeClass(e[t],this.oddCss),h["default"].removeClass(e[t],this.evenCss)}},e.prototype.destroy=function(){var t=this;if(this.initialized){for(var e=0;e0?this.hide():this.show()},e.prototype.show=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))},e.prototype.hide=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))},e.prototype.setWidth=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"},e.prototype.destroy=function(){var t=this;this.initialized&&(h["default"].remove(this.cont),this.cont=null,this.emitter.off(["after-filtering"],function(){return t.toggle()}),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function r(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 l(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)}Object.defineProperty(e,"__esModule",{value:!0}),e.State=void 0;var a=i(9),o=i(25),h=i(26),f=i(4),u=s(f),d=i(3),p=s(d);e.State=function(t){function e(i){n(this,e);var s=r(this,t.call(this,i,"state")),l=s.config.state;return s.enableHash=l===!0||p["default"].isObj(l.types)&&-1!==l.types.indexOf("hash"),s.enableLocalStorage=p["default"].isObj(l.types)&&-1!==l.types.indexOf("local_storage"),s.enableCookie=p["default"].isObj(l.types)&&-1!==l.types.indexOf("cookie"),s.persistFilters=l.filters!==!1,s.persistPageNumber=Boolean(l.page_number),s.persistPageLength=Boolean(l.page_length),s.persistSort=Boolean(l.sort),s.persistColsVisibility=Boolean(l.columns_visibility),s.persistFiltersVisibility=Boolean(l.filters_visibility),s.cookieDuration=isNaN(l.cookie_duration)?87600:parseInt(l.cookie_duration,10),s.enableStorage=s.enableLocalStorage||s.enableCookie,s.hash=null,s.pageNb=null,s.pageLength=null,s.sort=null,s.hiddenCols=null,s.filtersVisibility=null,s.state={},s.prfxCol="col_",s.pageNbKey="page",s.pageLengthKey="page_length",s.filtersVisKey="filters_visibility",s}return l(e,t),e.prototype.init=function(){var t=this;this.initialized||(this.emitter.on(["after-filtering"],function(){return t.update()}),this.emitter.on(["after-page-change","after-clearing-filters"],function(e,i){return t.updatePage(i)}),this.emitter.on(["after-page-length-change"],function(e,i){return t.updatePageLength(i)}),this.emitter.on(["column-sorted"],function(e,i,s){return t.updateSort(i,s)}),this.emitter.on(["sort-initialized"],function(){return t._syncSort()}),this.emitter.on(["columns-visibility-initialized"],function(){return t._syncColsVisibility()}),this.emitter.on(["column-shown","column-hidden"],function(e,i,s,n){return t.updateColsVisibility(n)}),this.emitter.on(["filters-visibility-initialized"],function(){return t._syncFiltersVisibility()}),this.emitter.on(["filters-toggled"],function(e,i,s){return t.updateFiltersVisibility(s)}),this.enableHash&&(this.hash=new o.Hash(this),this.hash.init()),this.enableStorage&&(this.storage=new h.Storage(this),this.storage.init()),this.initialized=!0)},e.prototype.update=function(){var t=this;if(this.isEnabled()){var e=this.state,i=this.tf;if(this.persistFilters){var s=i.getFiltersValue();s.forEach(function(i,s){var n=""+t.prfxCol+s;p["default"].isString(i)&&u["default"].isEmpty(i)?e.hasOwnProperty(n)&&(e[n].flt=void 0):(e[n]=e[n]||{},e[n].flt=i)})}if(this.persistPageNumber&&(p["default"].isNull(this.pageNb)?e[this.pageNbKey]=void 0:e[this.pageNbKey]=this.pageNb),this.persistPageLength&&(p["default"].isNull(this.pageLength)?e[this.pageLengthKey]=void 0:e[this.pageLengthKey]=this.pageLength),this.persistSort&&!p["default"].isNull(this.sort)){Object.keys(e).forEach(function(i){-1!==i.indexOf(t.prfxCol)&&e[i]&&(e[i].sort=void 0)});var n=""+this.prfxCol+this.sort.column;e[n]=e[n]||{},e[n].sort={descending:this.sort.descending}}this.persistColsVisibility&&(p["default"].isNull(this.hiddenCols)||(Object.keys(e).forEach(function(i){-1!==i.indexOf(t.prfxCol)&&e[i]&&(e[i].hidden=void 0)}),this.hiddenCols.forEach(function(i){var s=""+t.prfxCol+i;e[s]=e[s]||{},e[s].hidden=!0}))),this.persistFiltersVisibility&&(p["default"].isNull(this.filtersVisibility)?e[this.filtersVisKey]=void 0:e[this.filtersVisKey]=this.filtersVisibility),this.emitter.emit("state-changed",i,e)}},e.prototype.updatePage=function(t){this.pageNb=t,this.update()},e.prototype.updatePageLength=function(t){this.pageLength=t,this.update()},e.prototype.updateSort=function(t,e){this.sort={column:t,descending:e},this.update()},e.prototype.updateColsVisibility=function(t){this.hiddenCols=t,this.update()},e.prototype.updateFiltersVisibility=function(t){this.filtersVisibility=t,this.update()},e.prototype.override=function(t){this.state=t},e.prototype.sync=function(){var t=this.state,e=this.tf;if(this._syncFilters(),this.persistPageNumber){var i=t[this.pageNbKey];this.emitter.emit("change-page",e,i)}if(this.persistPageLength){var s=t[this.pageLengthKey];this.emitter.emit("change-page-results",e,s)}this._syncSort(),this._syncColsVisibility(),this._syncFiltersVisibility()},e.prototype.overrideAndSync=function(t){this.disable(),this.override(t),this.sync(),this.enable()},e.prototype._syncFilters=function(){var t=this;if(this.persistFilters){var e=this.state,i=this.tf;Object.keys(e).forEach(function(s){if(-1!==s.indexOf(t.prfxCol)){var n=parseInt(s.replace(t.prfxCol,""),10),r=e[s].flt;i.setFilterValue(n,r)}}),i.filter()}},e.prototype._syncSort=function(){var t=this;if(this.persistSort){var e=this.state,i=this.tf;Object.keys(e).forEach(function(s){if(-1!==s.indexOf(t.prfxCol)){var n=parseInt(s.replace(t.prfxCol,""),10);if(!p["default"].isUndef(e[s].sort)){var r=e[s].sort;t.emitter.emit("sort",i,n,r.descending)}}})}},e.prototype._syncColsVisibility=function(){var t=this;if(this.persistColsVisibility){var e=this.state,i=this.tf,s=[];Object.keys(e).forEach(function(i){if(-1!==i.indexOf(t.prfxCol)){var n=parseInt(i.replace(t.prfxCol,""),10);p["default"].isUndef(e[i].hidden)||s.push(n)}}),s.forEach(function(e){t.emitter.emit("hide-column",i,e)})}},e.prototype._syncFiltersVisibility=function(){if(this.persistFiltersVisibility){var t=this.state,e=this.tf,i=t[this.filtersVisKey];this.filtersVisibility=i,this.emitter.emit("show-filters",e,i)}},e.prototype.destroy=function(){var t=this;this.initialized&&(this.state={},this.emitter.off(["after-filtering"],function(){return t.update()}),this.emitter.off(["after-page-change","after-clearing-filters"],function(e,i){return t.updatePage(i)}),this.emitter.off(["after-page-length-change"],function(e,i){return t.updatePageLength(i)}),this.emitter.off(["column-sorted"],function(e,i,s){return t.updateSort(i,s)}),this.emitter.off(["sort-initialized"],function(){return t._syncSort()}),this.emitter.off(["columns-visibility-initialized"],function(){return t._syncColsVisibility()}),this.emitter.off(["column-shown","column-hidden"],function(e,i,s,n){return t.updateColsVisibility(n)}),this.emitter.off(["filters-visibility-initialized"],function(){return t._syncFiltersVisibility()}),this.emitter.off(["filters-toggled"],function(e,i,s){return t.updateFiltersVisibility(s)}),this.enableHash&&(this.hash.destroy(),this.hash=null),this.enableStorage&&(this.storage.destroy(),this.storage=null),this.initialized=!1)},e}(a.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Hash=e.hasHashChange=void 0;var r=i(1),l=s(r),a=window,o=a.JSON,h=a.location,f=a.decodeURIComponent,u=e.hasHashChange=function(){var t=a.documentMode;return"onhashchange"in a&&(void 0===t||t>7)};e.Hash=function(){function t(e){n(this,t),this.state=e,this.lastHash=null,this.emitter=e.emitter}return t.prototype.init=function(){var t=this;u()&&(this.lastHash=h.hash,this.emitter.on(["state-changed"],function(e,i){return t.update(i)}),this.emitter.on(["initialized"],function(){return t.sync()}),l["default"].add(a,"hashchange",function(){return t.sync()}))},t.prototype.update=function(t){var e="#"+o.stringify(t);this.lastHash!==e&&(h.hash=e,this.lastHash=e)},t.prototype.parse=function(t){return-1===t.indexOf("#")?null:(t=t.substr(1),o.parse(f(t)))},t.prototype.sync=function(){var t=this.parse(h.hash);t&&this.state.overrideAndSync(t)},t.prototype.destroy=function(){var t=this;this.emitter.off(["state-changed"],function(e,i){return t.update(i)}),this.emitter.off(["initialized"],function(){return t.sync()}),l["default"].remove(a,"hashchange",function(){return t.sync()}),this.state=null,this.lastHash=null,this.emitter=null},t}()},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0}),e.Storage=e.hasStorage=void 0;var r=i(27),l=s(r),a=window,o=a.JSON,h=a.localStorage,f=a.location,u=e.hasStorage=function(){return"Storage"in a};e.Storage=function(){function t(e){n(this,t),this.state=e,this.tf=e.tf,this.enableLocalStorage=e.enableLocalStorage&&u(),this.enableCookie=e.enableCookie&&!this.enableLocalStorage,this.emitter=e.emitter,this.duration=e.cookieDuration}return t.prototype.init=function(){var t=this;this.emitter.on(["state-changed"],function(e,i){return t.save(i)}),this.emitter.on(["initialized"],function(){return t.sync()})},t.prototype.save=function(t){this.enableLocalStorage?h[this.getKey()]=o.stringify(t):l["default"].write(this.getKey(),o.stringify(t),this.duration)},t.prototype.retrieve=function(){var t=null;return t=this.enableLocalStorage?h[this.getKey()]:l["default"].read(this.getKey()),t?o.parse(t):null},t.prototype.remove=function(){this.enableLocalStorage?h.removeItem(this.getKey()):l["default"].remove(this.getKey())},t.prototype.sync=function(){var t=this.retrieve();t&&this.state.overrideAndSync(t)},t.prototype.getKey=function(){return o.stringify({key:this.tf.prfxTf+"_"+this.tf.id,path:f.pathname})},t.prototype.destroy=function(){var t=this;this.emitter.off(["state-changed"],function(e,i){return t.save(i)}),this.emitter.off(["initialized"],function(){return t.sync()}),this.remove(),this.state=null,this.emitter=null},t}()},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={write:function(t,e,i){var s="";i&&(s=new Date((new Date).getTime()+36e5*i),s="; expires="+s.toGMTString()),document.cookie=t+"="+escape(e)+s},read:function(t){var e="",i=t+"=";if(document.cookie.length>0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var r=s.indexOf(";",n);-1===r&&(r=s.length),e=unescape(s.substring(n,r))}}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]}}}])}); \ No newline at end of file diff --git a/dist/tablefilter/tf-1.js b/dist/tablefilter/tf-1.js index 27934c2f..58121f55 100644 --- a/dist/tablefilter/tf-1.js +++ b/dist/tablefilter/tf-1.js @@ -1,8 +1,8 @@ /** - * tablefilter v0.2.13 by Max Guglielmi - * build date: 2016-04-24T17:01:50.904Z + * tablefilter v0.2.17 by Max Guglielmi + * build date: 2016-05-01T09:47:23.281Z * MIT License */ -webpackJsonp([1],{29:function(e,t,n){function r(e){return n(i(e))}function i(e){return s[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var s={"./array":16,"./array.js":16,"./cookie":9,"./cookie.js":9,"./date":5,"./date.js":5,"./dom":2,"./dom.js":2,"./emitter":7,"./emitter.js":7,"./event":1,"./event.js":1,"./extensions/advancedGrid/adapterEzEditTable":30,"./extensions/advancedGrid/adapterEzEditTable.js":30,"./extensions/advancedGrid/advancedGrid":31,"./extensions/advancedGrid/advancedGrid.js":31,"./extensions/colOps/colOps":32,"./extensions/colOps/colOps.js":32,"./extensions/colsVisibility/colsVisibility":33,"./extensions/colsVisibility/colsVisibility.js":33,"./extensions/filtersVisibility/filtersVisibility":34,"./extensions/filtersVisibility/filtersVisibility.js":34,"./extensions/sort/adapterSortabletable":35,"./extensions/sort/adapterSortabletable.js":35,"./extensions/sort/sort":36,"./extensions/sort/sort.js":36,"./helpers":6,"./helpers.js":6,"./modules/alternateRows":24,"./modules/alternateRows.js":24,"./modules/checkList":18,"./modules/checkList.js":18,"./modules/clearButton":22,"./modules/clearButton.js":22,"./modules/dropdown":15,"./modules/dropdown.js":15,"./modules/feature":11,"./modules/feature.js":11,"./modules/gridLayout":10,"./modules/gridLayout.js":10,"./modules/hash":27,"./modules/hash.js":27,"./modules/help":23,"./modules/help.js":23,"./modules/highlightKeywords":13,"./modules/highlightKeywords.js":13,"./modules/loader":12,"./modules/loader.js":12,"./modules/noResults":25,"./modules/noResults.js":25,"./modules/paging":21,"./modules/paging.js":21,"./modules/popupFilter":14,"./modules/popupFilter.js":14,"./modules/rowsCounter":19,"./modules/rowsCounter.js":19,"./modules/state":26,"./modules/state.js":26,"./modules/statusBar":20,"./modules/statusBar.js":20,"./modules/storage":28,"./modules/storage.js":28,"./modules/store":8,"./modules/store.js":8,"./sort":17,"./sort.js":17,"./string":4,"./string.js":4,"./types":3,"./types.js":3};r.keys=function(){return Object.keys(s)},r.resolve=i,e.exports=r,r.id=29},30:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2),o=r(s),l=function(){function e(t,n){i(this,e),this.initialized=!1,this.desc=n.description||"ezEditTable adapter",this.filename=n.filename||"ezEditTable.js",this.vendorPath=n.vendor_path,this.loadStylesheet=Boolean(n.load_stylesheet),this.stylesheet=n.stylesheet||this.vendorPath+"ezEditTable.css",this.stylesheetName=n.stylesheet_name||"ezEditTableCss",this.err='Failed to instantiate EditTable object.\n"ezEditTable" dependency not found.',n.scroll_into_view=n.scroll_into_view===!1?!1:t.gridLayout,this._ezEditTable=null,this.cfg=n,this.tf=t,this.emitter=t.emitter}return e.prototype.init=function(){var e=this,t=this.tf;if(window.EditTable)this._setAdvancedGrid();else{var n=this.vendorPath+this.filename;t["import"](this.filename,n,function(){e._setAdvancedGrid()})}this.loadStylesheet&&!t.isImported(this.stylesheet,"link")&&t["import"](this.stylesheetName,this.stylesheet,null,"link"),this.emitter.on(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()})},e.prototype._setAdvancedGrid=function(){var e,t=this.tf,n=this.cfg,r=o["default"].tag(t.tbl,"thead");e=r.length>0&&!n.startRow?void 0:n.startRow||t.refRow,n.base_path=n.base_path||t.basePath+"ezEditTable/";var i=n.editable,s=n.selection;s&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var l=0,a=0;if(s){var d=function(e,n,r){var i=e.Selection,s=function(r){if("row"===e.defaultSelection)i.SelectRowByIndex(r);else{e.ClearSelections();var s=n.cellIndex,o=t.tbl.rows[r];"both"===e.defaultSelection&&i.SelectRowByIndex(r),o&&i.SelectCell(o.cells[s])}if(t.validRowsIndex.length!==t.getRowsNb()){var l=t.tbl.rows[r];l&&l.scrollIntoView(!1),h&&(h.cellIndex===t.getCellsNb()-1&&t.gridLayout?t.tblCont.scrollLeft=1e8:0===h.cellIndex&&t.gridLayout?t.tblCont.scrollLeft=0:h.scrollIntoView(!1))}};if(t.validRowsIndex){var o,d=t.validRowsIndex,u=d.length,c="row"!==e.defaultSelection?n.parentNode:n,h="TD"===n.nodeName?n:null,f=void 0!==r?e.Event.GetKey(r):0,p=-1!==d.indexOf(c.rowIndex),b=t.feature("paging"),m=34===f||33===f?b&&b.pagingLength||e.nbRowsPerPage:1;if(p)34!==f&&33!==f?(l=d.indexOf(c.rowIndex),a=c.rowIndex):(o=34===f?u-1>=l+m?d[l+m]:[u-1]:l-m<=d[0]?d[0]:d[l-m],a=o,l=d.indexOf(o),s(o));else{if(c.rowIndex>a)if(c.rowIndex>=d[u-1])o=d[u-1];else{var y=l+m;o=y>u-1?d[u-1]:d[y]}else if(c.rowIndex<=d[0])o=d[0];else{var g=d[l-m];o=g?g:d[0]}a=c.rowIndex,s(o)}}},u=function(e,n){var r="row"!==e.defaultSelection?n.parentNode:n;if(t.paging&&t.feature("paging").nbPages>1){var i=t.feature("paging");e.nbRowsPerPage=i.pagingLength;var s=t.validRowsIndex,o=s.length,l=parseInt(i.startPagingRow,10)+parseInt(i.pagingLength,10),a=r.rowIndex;a===s[o-1]&&i.currentPageNb!==i.nbPages?i.setPage("last"):a==s[0]&&1!==i.currentPageNb?i.setPage("first"):a>s[l-1]&&as[0]&&i.setPage("previous")}};if(t.paging&&(t.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid"),n=t._ezEditTable,r=n.Selection,i=r.GetActiveRow();i&&i.scrollIntoView(!1);var s=r.GetActiveCell();s&&s.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(i){var b=n.on_added_dom_row;if(n.on_added_dom_row=function(){t.nbFilterableRows++,t.paging?(t.nbRows++,t.nbVisibleRows++,t.nbFilterableRows++,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset()):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),b&&b.call(null,arguments[0],arguments[1],arguments[2])},n.actions&&n.actions["delete"]){var m=n.actions["delete"].on_after_submit;n.actions["delete"].on_after_submit=function(){t.nbFilterableRows--,t.paging?(t.nbRows--,t.nbVisibleRows--,t.nbFilterableRows--,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset(!1)):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(y){throw new Error(this.err)}this.initialized=!0},e.prototype.reset=function(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())},e.prototype.toggle=function(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()},e.prototype._toggleForInputFilter=function(){var e=this.tf;if(e.getActiveFilterId()){var t=e.getColumnIndexFromFilterId(e.getActiveFilterId()),n=e.getFilterType(t);n===e.fltTypeInp&&this.toggle()}},e.prototype.destroy=function(){var e=this,t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!1},e}();t["default"]=l},31:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(30),s=r(i);t["default"]=s["default"]},32:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_dom=__webpack_require__(2),_dom2=_interopRequireDefault(_dom),_string=__webpack_require__(4),_string2=_interopRequireDefault(_string),_types=__webpack_require__(3),_types2=_interopRequireDefault(_types),ColOps=function(){function ColOps(e,t){_classCallCheck(this,ColOps),this.onBeforeOperation=_types2["default"].isFn(t.on_before_operation)?t.on_before_operation:null,this.onAfterOperation=_types2["default"].isFn(t.on_after_operation)?t.on_after_operation:null,this.opts=t,this.tf=e}return ColOps.prototype.init=function(){var e=this;this.tf.emitter.on(["after-filtering"],function(){return e.calc()}),this.calc()},ColOps.prototype.calc=function calc(){var tf=this.tf;if(tf.hasGrid()){this.onBeforeOperation&&this.onBeforeOperation.call(null,tf);var opts=this.opts,labelId=opts.id,colIndex=opts.col,operation=opts.operation,outputType=opts.write_method,totRowIndex=opts.tot_row_index,excludeRow=opts.exclude_row,decimalPrecision=_types2["default"].isUndef(opts.decimal_precision)?2:opts.decimal_precision,ucolIndex=[],ucolMax=0;ucolIndex[ucolMax]=colIndex[0];for(var ii=1;ii=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)}},ColOps.prototype.destroy=function(){var e=this;this.tf.emitter.off(["after-filtering"],function(){return e.calc()})},ColOps}();exports["default"]=ColOps},33:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2),o=r(s),l=n(3),a=r(l),d=n(1),u=r(d),c=function(){function e(t,n){i(this,e);var r=t.config();this.initialized=!1,this.name=n.name,this.desc=n.description||"Columns visibility manager",this.spanEl=null,this.btnEl=null,this.contEl=null,this.tickToHide=n.tick_to_hide!==!1,this.manager=n.manager!==!1,this.headersTbl=n.headers_table||!1,this.headersIndex=n.headers_index||1,this.contElTgtId=n.container_target_id||null,this.headersText=n.headers_text||null,this.btnTgtId=n.btn_target_id||null,this.btnText=n.btn_text||"Columns▼",this.btnHtml=n.btn_html||null,this.btnCssClass=n.btn_css_class||"colVis",this.btnCloseText=n.btn_close_text||"Close",this.btnCloseHtml=n.btn_close_html||null,this.btnCloseCssClass=n.btn_close_css_class||this.btnCssClass,this.stylesheet=n.stylesheet||"colsVisibility.css",this.prfx="colVis_",this.spanCssClass=n.span_css_class||"colVisSpan",this.prfxCont=this.prfx+"Cont_",this.contCssClass=n.cont_css_class||"colVisCont",this.listCssClass=r.list_css_class||"cols_checklist",this.listItemCssClass=r.checklist_item_css_class||"cols_checklist_item",this.listSlcItemCssClass=r.checklist_selected_item_css_class||"cols_checklist_slc_item",this.text=n.text||(this.tickToHide?"Hide: ":"Show: "),this.atStart=n.at_start||null,this.enableHover=Boolean(n.enable_hover),this.enableTickAll=Boolean(n.enable_tick_all),this.tickAllText=n.tick_all_text||"Select all:",this.hiddenCols=[],this.tblHasColTag=o["default"].tag(t.tbl,"col").length>0,this.onLoaded=a["default"].isFn(n.on_loaded)?n.on_loaded:null,this.onBeforeOpen=a["default"].isFn(n.on_before_open)?n.on_before_open:null,this.onAfterOpen=a["default"].isFn(n.on_after_open)?n.on_after_open:null,this.onBeforeClose=a["default"].isFn(n.on_before_close)?n.on_before_close:null,this.onAfterClose=a["default"].isFn(n.on_after_close)?n.on_after_close:null,this.onBeforeColHidden=a["default"].isFn(n.on_before_col_hidden)?n.on_before_col_hidden:null,this.onAfterColHidden=a["default"].isFn(n.on_after_col_hidden)?n.on_after_col_hidden:null,this.onBeforeColDisplayed=a["default"].isFn(n.on_before_col_displayed)?n.on_before_col_displayed:null,this.onAfterColDisplayed=a["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,this.emitter=t.emitter}return e.prototype.toggle=function(){var e=this.contEl.style.display,t=this.onBeforeOpen,n=this.onBeforeClose,r=this.onAfterOpen,i=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),i&&"inline"===e&&i.call(null,this)},e.prototype.checkItem=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 i=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(i=!0),this.setHidden(r,i)}},e.prototype.init=function(){var e=this;this.manager&&(this.emitter.on(["hide-column"],function(t,n){return e.hideCol(n)}),this.buildBtn(),this.buildManager(),this.initialized=!0,this.emitter.emit("columns-visibility-initialized",tf,this),this._hideAtStart())},e.prototype.buildBtn=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 i=r.firstChild;i.parentNode.insertBefore(n,i)}if(this.btnHtml){n.innerHTML=this.btnHtml;var s=n.firstChild;this.enableHover?u["default"].add(s,"mouseover",function(t){return e.toggle(t)}):u["default"].add(s,"click",function(t){return 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?u["default"].add(l,"mouseover",function(t){return e.toggle(t)}):u["default"].add(l,"click",function(t){return e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}},e.prototype.buildManager=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 i=o["default"].create("ul",["id","ul"+this.name+"_"+t.id]);i.className=this.listCssClass;var s=this.headersTbl?this.headersTbl:t.tbl,l=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),a=s.rows[l];this.enableTickAll&&!function(){var n=o["default"].createCheckItem("col__"+t.id,e.tickAllText,e.tickAllText);o["default"].addClass(n,e.listItemCssClass),i.appendChild(n),n.check.checked=!e.tickToHide,u["default"].add(n.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,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=a["default"].isUndef(n.filters_row_index)?t.getFiltersRowIndex():n.filters_row_index,this.visibleAtStart=a["default"].isUndef(n.visible_at_start)?!0:Boolean(n.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=a["default"].isFn(n.on_before_show)?n.on_before_show:null,this.onAfterShow=a["default"].isFn(n.on_after_show)?n.on_after_show:null,this.onBeforeHide=a["default"].isFn(n.on_before_hide)?n.on_before_hide:null,this.onAfterHide=a["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,this.emitter=t.emitter}return e.prototype.init=function(){var e=this;this.initialized||(this.buildUI(),this.initialized=!0,this.emitter.on(["show-filters"],function(t,n){return e.show(n)}),this.emitter.emit("filters-visibility-initialized",tf,this))},e.prototype.buildUI=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 i=r.firstChild;i.parentNode.insertBefore(n,i)}var s=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,s=n.firstChild):(s=o["default"].create("a",["href","javascript:void(0);"]),s.className=this.btnCssClass,s.title=this.btnText||this.defaultText,s.innerHTML=this.collapseBtnHtml,n.appendChild(s)),u["default"].add(s,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=s,this.visibleAtStart||this.toggle()},e.prototype.toggle=function(){var e=this.tf,t=e.gridLayout?e.feature("gridLayout").headTbl:e.tbl,n=t.rows[this.filtersRowIndex],r=""===n.style.display;this.show(!r),this.emitter.emit("filters-toggled",e,this,!r)},e.prototype.show=function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],t=this.tf,n=t.gridLayout?t.feature("gridLayout").headTbl:t.tbl,r=n.rows[this.filtersRowIndex];this.onBeforeShow&&e&&this.onBeforeShow.call(this,this),this.onBeforeHide&&!e&&this.onBeforeHide.call(null,this),r.style.display=e?"":"none",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=e?this.collapseBtnHtml:this.expandBtnHtml),this.onAfterShow&&e&&this.onAfterShow.call(null,this),this.onAfterHide&&!e&&this.onAfterHide.call(null,this)},e.prototype.destroy=function(){var e=this;(this.btnEl||this.contEl)&&(this.emitter.off(["show-filters"],function(t,n){return e.show(n)}),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"]=c},35:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return w["default"].removeNbFormat(e,"us")}function o(e){return w["default"].removeNbFormat(e,"eu")}function l(e,t){return v["default"].format(e,t)}function a(e){return l(e,"DMY")}function d(e){return l(e,"MDY")}function u(e){return l(e,"YMD")}function c(e){return l(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}Object.defineProperty(t,"__esModule",{value:!0});var p=n(3),b=r(p),m=n(2),y=r(m),g=n(1),T=r(g),_=n(5),v=r(_),C=n(6),w=r(C),S=function(){function e(t,n){i(this,e),this.initialized=!1,this.name=n.name,this.desc=n.description||"Sortable table",this.sorted=!1,this.sortTypes=b["default"].isArray(n.types)?n.types:[],this.sortColAtStart=b["default"].isArray(n.sort_col_at_start)?n.sort_col_at_start:null,this.asyncSort=Boolean(n.async_sort),this.triggerIds=b["default"].isArray(n.trigger_ids)?n.trigger_ids:[],this.imgPath=n.images_path||t.themesPath,this.imgBlank=n.image_blank||"blank.png",this.imgClassName=n.image_class_name||"sort-arrow",this.imgAscClassName=n.image_asc_class_name||"ascending",this.imgDescClassName=n.image_desc_class_name||"descending",this.customKey=n.custom_key||"data-tf-sortKey",this.onSortLoaded=b["default"].isFn(n.on_sort_loaded)?n.on_sort_loaded:null,this.onBeforeSort=b["default"].isFn(n.on_before_sort)?n.on_before_sort:null,this.onAfterSort=b["default"].isFn(n.on_after_sort)?n.on_after_sort:null,this.tf=t,this.emitter=t.emitter}return e.prototype.init=function(){var e=this,t=this.tf,n=this;if(b["default"].isUndef(SortableTable))throw new Error("SortableTable class not found.");this.overrideSortableTable(),this.setSortTypes();var r=n.sortColAtStart;r&&this.stt.sort(r[0],r[1]),this.onSortLoaded&&this.onSortLoaded.call(null,t,this),this.stt.onbeforesort=function(){n.onBeforeSort&&n.onBeforeSort.call(null,t,n.stt.sortColumn),t.paging&&t.feature("paging").disable()},this.stt.onsort=function(){if(n.sorted=!0,t.paging){var e=t.feature("paging");t.getValidRows(!0),e.enable(),e.setPage(e.getPage())}n.onAfterSort&&n.onAfterSort.call(null,t,n.stt.sortColumn,n.stt.descending),n.emitter.emit("column-sorted",t,n.stt.sortColumn,n.stt.descending)},this.emitter.on(["sort"],function(t,n,r){return e.sortByColumnIndex(n,r)}),this.initialized=!0,this.emitter.emit("sort-initialized",t,this)},e.prototype.sortByColumnIndex=function(e,t){this.stt.sort(e,t)},e.prototype.overrideSortableTable=function(){var e=this,t=this.tf;SortableTable.prototype.headerOnclick=function(t){if(e.initialized){for(var n=t.target||t.srcElement;"TD"!==n.tagName&&"TH"!==n.tagName;)n=n.parentNode;this.sort(SortableTable.msie?SortableTable.getCellIndex(n):n.cellIndex)}},SortableTable.getCellIndex=function(e){var t=e.parentNode.cells,n=t.length,r=void 0;for(r=0;t[r]!=e&&n>r;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 i=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var s=i.length,o=void 0,l=void 0,a=0;s>a;a++)l=i[a],null!==r.sortTypes[a]&&"None"!==r.sortTypes[a]?(l.style.cursor="pointer",o=y["default"].create("img",["src",e.imgPath+e.imgBlank]),l.appendChild(o),null!==r.sortTypes[a]&&l.setAttribute("_sortType",r.sortTypes[a]),T["default"].add(l,"click",r._headerOnclick)):(l.setAttribute("_sortType",n[a]),l._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=this,n=void 0,r=void 0,i=void 0;if(e.asyncSort&&e.triggerIds.length>0){var s=e.triggerIds;n=[],r=s.length;for(var o=0;ol;l++){var a=n[l].getAttribute("_sortType");null!==a&&"None"!==a&&(i=n[l].lastChild||n[l],"img"!==i.nodeName.toLowerCase()&&(i=y["default"].create("img",["src",e.imgPath+e.imgBlank]),n[l].appendChild(i)),l===t.sortColumn?i.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):i.className=e.imgClassName)}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this,i=r._sortTypeInfo[t];if(i&&i.getRowValue)return i.getRowValue(e,n);var s=e.cells[n],o=SortableTable.getInnerText(s);return r.getValueFromString(o,t)},SortableTable.getInnerText=function(t){return t?t.getAttribute(e.customKey)?t.getAttribute(e.customKey):y["default"].getText(t):void 0}},e.prototype.addSortType=function(){var e=arguments;SortableTable.prototype.addSortType(e[0],e[1],e[2],e[3])},e.prototype.setSortTypes=function(){for(var e=this,t=this.tf,n=this.sortTypes,r=[],i=0;i0&&!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],{28:function(e,t,n){function r(e){return n(i(e))}function i(e){return s[e]||function(){throw new Error("Cannot find module '"+e+"'.")}()}var s={"./array":14,"./array.js":14,"./cookie":27,"./cookie.js":27,"./date":5,"./date.js":5,"./dom":2,"./dom.js":2,"./emitter":7,"./emitter.js":7,"./event":1,"./event.js":1,"./extensions/advancedGrid/adapterEzEditTable":29,"./extensions/advancedGrid/adapterEzEditTable.js":29,"./extensions/advancedGrid/advancedGrid":30,"./extensions/advancedGrid/advancedGrid.js":30,"./extensions/colOps/colOps":31,"./extensions/colOps/colOps.js":31,"./extensions/colsVisibility/colsVisibility":32,"./extensions/colsVisibility/colsVisibility.js":32,"./extensions/filtersVisibility/filtersVisibility":33,"./extensions/filtersVisibility/filtersVisibility.js":33,"./extensions/sort/adapterSortabletable":34,"./extensions/sort/adapterSortabletable.js":34,"./extensions/sort/sort":35,"./extensions/sort/sort.js":35,"./helpers":6,"./helpers.js":6,"./modules/alternateRows":22,"./modules/alternateRows.js":22,"./modules/checkList":16,"./modules/checkList.js":16,"./modules/clearButton":20,"./modules/clearButton.js":20,"./modules/dropdown":13,"./modules/dropdown.js":13,"./modules/feature":9,"./modules/feature.js":9,"./modules/gridLayout":8,"./modules/gridLayout.js":8,"./modules/hash":25,"./modules/hash.js":25,"./modules/help":21,"./modules/help.js":21,"./modules/highlightKeywords":11,"./modules/highlightKeywords.js":11,"./modules/loader":10,"./modules/loader.js":10,"./modules/noResults":23,"./modules/noResults.js":23,"./modules/paging":19,"./modules/paging.js":19,"./modules/popupFilter":12,"./modules/popupFilter.js":12,"./modules/rowsCounter":17,"./modules/rowsCounter.js":17,"./modules/state":24,"./modules/state.js":24,"./modules/statusBar":18,"./modules/statusBar.js":18,"./modules/storage":26,"./modules/storage.js":26,"./sort":15,"./sort.js":15,"./string":4,"./string.js":4,"./types":3,"./types.js":3};r.keys=function(){return Object.keys(s)},r.resolve=i,e.exports=r,r.id=28},29:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2),o=r(s),l=function(){function e(t,n){i(this,e),this.initialized=!1,this.desc=n.description||"ezEditTable adapter",this.filename=n.filename||"ezEditTable.js",this.vendorPath=n.vendor_path,this.loadStylesheet=Boolean(n.load_stylesheet),this.stylesheet=n.stylesheet||this.vendorPath+"ezEditTable.css",this.stylesheetName=n.stylesheet_name||"ezEditTableCss",this.err='Failed to instantiate EditTable object.\n"ezEditTable" dependency not found.',n.scroll_into_view=n.scroll_into_view===!1?!1:t.gridLayout,this._ezEditTable=null,this.cfg=n,this.tf=t,this.emitter=t.emitter}return e.prototype.init=function(){var e=this,t=this.tf;if(window.EditTable)this._setAdvancedGrid();else{var n=this.vendorPath+this.filename;t["import"](this.filename,n,function(){e._setAdvancedGrid()})}this.loadStylesheet&&!t.isImported(this.stylesheet,"link")&&t["import"](this.stylesheetName,this.stylesheet,null,"link"),this.emitter.on(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()})},e.prototype._setAdvancedGrid=function(){var e,t=this.tf,n=this.cfg,r=o["default"].tag(t.tbl,"thead");e=r.length>0&&!n.startRow?void 0:n.startRow||t.refRow,n.base_path=n.base_path||t.basePath+"ezEditTable/";var i=n.editable,s=n.selection;s&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var l=0,a=0;if(s){var d=function(e,n,r){var i=e.Selection,s=function(r){if("row"===e.defaultSelection)i.SelectRowByIndex(r);else{e.ClearSelections();var s=n.cellIndex,o=t.tbl.rows[r];"both"===e.defaultSelection&&i.SelectRowByIndex(r),o&&i.SelectCell(o.cells[s])}if(t.validRowsIndex.length!==t.getRowsNb()){var l=t.tbl.rows[r];l&&l.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,c=d.length,u="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(u.rowIndex),b=t.feature("paging"),m=34===f||33===f?b&&b.pagingLength||e.nbRowsPerPage:1;if(p)34!==f&&33!==f?(l=d.indexOf(u.rowIndex),a=u.rowIndex):(o=34===f?c-1>=l+m?d[l+m]:[c-1]:l-m<=d[0]?d[0]:d[l-m],a=o,l=d.indexOf(o),s(o));else{if(u.rowIndex>a)if(u.rowIndex>=d[c-1])o=d[c-1];else{var y=l+m;o=y>c-1?d[c-1]:d[y]}else if(u.rowIndex<=d[0])o=d[0];else{var g=d[l-m];o=g?g:d[0]}a=u.rowIndex,s(o)}}},c=function(e,n){var r="row"!==e.defaultSelection?n.parentNode:n;if(t.paging&&t.feature("paging").nbPages>1){var i=t.feature("paging");e.nbRowsPerPage=i.pagingLength;var s=t.validRowsIndex,o=s.length,l=parseInt(i.startPagingRow,10)+parseInt(i.pagingLength,10),a=r.rowIndex;a===s[o-1]&&i.currentPageNb!==i.nbPages?i.setPage("last"):a==s[0]&&1!==i.currentPageNb?i.setPage("first"):a>s[l-1]&&as[0]&&i.setPage("previous")}};if(t.paging&&(t.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid"),n=t._ezEditTable,r=n.Selection,i=r.GetActiveRow();i&&i.scrollIntoView(!1);var s=r.GetActiveCell();s&&s.scrollIntoView(!1)}),"row"===n.default_selection){var u=n.on_before_selected_row;n.on_before_selected_row=function(){c(arguments[0],arguments[1],arguments[2]),u&&u.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(){c(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(i){var b=n.on_added_dom_row;if(n.on_added_dom_row=function(){t.nbFilterableRows++,t.paging?(t.nbRows++,t.nbVisibleRows++,t.nbFilterableRows++,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset()):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),b&&b.call(null,arguments[0],arguments[1],arguments[2])},n.actions&&n.actions["delete"]){var m=n.actions["delete"].on_after_submit;n.actions["delete"].on_after_submit=function(){t.nbFilterableRows--,t.paging?(t.nbRows--,t.nbVisibleRows--,t.nbFilterableRows--,t.paging=!1,t.feature("paging").destroy(),t.feature("paging").reset(!1)):t.emitter.emit("rows-changed",t,this),t.alternateRows&&t.feature("alternateRows").init(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(t.id,n,e),this._ezEditTable.Init()}catch(y){throw new Error(this.err)}this.initialized=!0},e.prototype.reset=function(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())},e.prototype.toggle=function(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()},e.prototype._toggleForInputFilter=function(){var e=this.tf;if(e.getActiveFilterId()){var t=e.getColumnIndexFromFilterId(e.getActiveFilterId()),n=e.getFilterType(t);n===e.fltTypeInp&&this.toggle()}},e.prototype.destroy=function(){var e=this,t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!1},e}();t["default"]=l},30:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(29),s=r(i);t["default"]=s["default"]},31:function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e},_dom=__webpack_require__(2),_dom2=_interopRequireDefault(_dom),_string=__webpack_require__(4),_string2=_interopRequireDefault(_string),_types=__webpack_require__(3),_types2=_interopRequireDefault(_types),ColOps=function(){function ColOps(e,t){_classCallCheck(this,ColOps),this.onBeforeOperation=_types2["default"].isFn(t.on_before_operation)?t.on_before_operation:null,this.onAfterOperation=_types2["default"].isFn(t.on_after_operation)?t.on_after_operation:null,this.opts=t,this.tf=e}return ColOps.prototype.init=function(){var e=this;this.tf.emitter.on(["after-filtering"],function(){return e.calc()}),this.calc()},ColOps.prototype.calc=function calc(){var tf=this.tf;if(tf.hasGrid()){this.onBeforeOperation&&this.onBeforeOperation.call(null,tf);var opts=this.opts,labelId=opts.id,colIndex=opts.col,operation=opts.operation,outputType=opts.write_method,totRowIndex=opts.tot_row_index,excludeRow=opts.exclude_row,decimalPrecision=_types2["default"].isUndef(opts.decimal_precision)?2:opts.decimal_precision,ucolIndex=[],ucolMax=0;ucolIndex[ucolMax]=colIndex[0];for(var ii=1;ii=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)}},ColOps.prototype.destroy=function(){var e=this;this.tf.emitter.off(["after-filtering"],function(){return e.calc()})},ColOps}();exports["default"]=ColOps},32:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2),o=r(s),l=n(3),a=r(l),d=n(1),c=r(d),u=function(){function e(t,n){i(this,e);var r=t.config();this.initialized=!1,this.name=n.name,this.desc=n.description||"Columns visibility manager",this.spanEl=null,this.btnEl=null,this.contEl=null,this.tickToHide=n.tick_to_hide!==!1,this.manager=n.manager!==!1,this.headersTbl=n.headers_table||!1,this.headersIndex=n.headers_index||1,this.contElTgtId=n.container_target_id||null,this.headersText=n.headers_text||null,this.btnTgtId=n.btn_target_id||null,this.btnText=n.btn_text||"Columns▼",this.btnHtml=n.btn_html||null,this.btnCssClass=n.btn_css_class||"colVis",this.btnCloseText=n.btn_close_text||"Close",this.btnCloseHtml=n.btn_close_html||null,this.btnCloseCssClass=n.btn_close_css_class||this.btnCssClass,this.stylesheet=n.stylesheet||"colsVisibility.css",this.prfx="colVis_",this.spanCssClass=n.span_css_class||"colVisSpan",this.prfxCont=this.prfx+"Cont_",this.contCssClass=n.cont_css_class||"colVisCont",this.listCssClass=r.list_css_class||"cols_checklist",this.listItemCssClass=r.checklist_item_css_class||"cols_checklist_item",this.listSlcItemCssClass=r.checklist_selected_item_css_class||"cols_checklist_slc_item",this.text=n.text||(this.tickToHide?"Hide: ":"Show: "),this.atStart=n.at_start||null,this.enableHover=Boolean(n.enable_hover),this.enableTickAll=Boolean(n.enable_tick_all),this.tickAllText=n.tick_all_text||"Select all:",this.hiddenCols=[],this.tblHasColTag=o["default"].tag(t.tbl,"col").length>0,this.onLoaded=a["default"].isFn(n.on_loaded)?n.on_loaded:null,this.onBeforeOpen=a["default"].isFn(n.on_before_open)?n.on_before_open:null,this.onAfterOpen=a["default"].isFn(n.on_after_open)?n.on_after_open:null,this.onBeforeClose=a["default"].isFn(n.on_before_close)?n.on_before_close:null,this.onAfterClose=a["default"].isFn(n.on_after_close)?n.on_after_close:null,this.onBeforeColHidden=a["default"].isFn(n.on_before_col_hidden)?n.on_before_col_hidden:null,this.onAfterColHidden=a["default"].isFn(n.on_after_col_hidden)?n.on_after_col_hidden:null,this.onBeforeColDisplayed=a["default"].isFn(n.on_before_col_displayed)?n.on_before_col_displayed:null,this.onAfterColDisplayed=a["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,this.emitter=t.emitter}return e.prototype.toggle=function(){var e=this.contEl.style.display,t=this.onBeforeOpen,n=this.onBeforeClose,r=this.onAfterOpen,i=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),i&&"inline"===e&&i.call(null,this)},e.prototype.checkItem=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 i=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(i=!0),this.setHidden(r,i)}},e.prototype.init=function(){var e=this;this.manager&&(this.emitter.on(["hide-column"],function(t,n){return e.hideCol(n)}),this.buildBtn(),this.buildManager(),this.initialized=!0,this.emitter.emit("columns-visibility-initialized",this.tf,this),this._hideAtStart())},e.prototype.buildBtn=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 i=r.firstChild;i.parentNode.insertBefore(n,i)}if(this.btnHtml){n.innerHTML=this.btnHtml;var s=n.firstChild;this.enableHover?c["default"].add(s,"mouseover",function(t){return e.toggle(t)}):c["default"].add(s,"click",function(t){return 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){return e.toggle(t)}):c["default"].add(l,"click",function(t){return e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}},e.prototype.buildManager=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 i=o["default"].create("ul",["id","ul"+this.name+"_"+t.id]);i.className=this.listCssClass;var s=this.headersTbl?this.headersTbl:t.tbl,l=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),a=s.rows[l];this.enableTickAll&&!function(){var n=o["default"].createCheckItem("col__"+t.id,e.tickAllText,e.tickAllText);o["default"].addClass(n,e.listItemCssClass),i.appendChild(n),n.check.checked=!e.tickToHide,c["default"].add(n.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,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=a["default"].isUndef(n.filters_row_index)?t.getFiltersRowIndex():n.filters_row_index,this.visibleAtStart=a["default"].isUndef(n.visible_at_start)?!0:Boolean(n.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=a["default"].isFn(n.on_before_show)?n.on_before_show:null,this.onAfterShow=a["default"].isFn(n.on_after_show)?n.on_after_show:null,this.onBeforeHide=a["default"].isFn(n.on_before_hide)?n.on_before_hide:null,this.onAfterHide=a["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,this.emitter=t.emitter}return e.prototype.init=function(){var e=this;this.initialized||(this.buildUI(),this.initialized=!0,this.emitter.on(["show-filters"],function(t,n){return e.show(n)}),this.emitter.emit("filters-visibility-initialized",this.tf,this))},e.prototype.buildUI=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 i=r.firstChild;i.parentNode.insertBefore(n,i)}var s=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,s=n.firstChild):(s=o["default"].create("a",["href","javascript:void(0);"]),s.className=this.btnCssClass,s.title=this.btnText||this.defaultText,s.innerHTML=this.collapseBtnHtml,n.appendChild(s)),c["default"].add(s,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=s,this.visibleAtStart||this.toggle()},e.prototype.toggle=function(){var e=this.tf,t=e.gridLayout?e.feature("gridLayout").headTbl:e.tbl,n=t.rows[this.filtersRowIndex],r=""===n.style.display;this.show(!r)},e.prototype.show=function(){var e=arguments.length<=0||void 0===arguments[0]?!0:arguments[0],t=this.tf,n=t.gridLayout?t.feature("gridLayout").headTbl:t.tbl,r=n.rows[this.filtersRowIndex];this.onBeforeShow&&e&&this.onBeforeShow.call(this,this),this.onBeforeHide&&!e&&this.onBeforeHide.call(null,this),r.style.display=e?"":"none",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=e?this.collapseBtnHtml:this.expandBtnHtml),this.onAfterShow&&e&&this.onAfterShow.call(null,this),this.onAfterHide&&!e&&this.onAfterHide.call(null,this),this.emitter.emit("filters-toggled",t,this,e)},e.prototype.destroy=function(){var e=this;(this.btnEl||this.contEl)&&(this.emitter.off(["show-filters"],function(t,n){return e.show(n)}),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"]=u},34:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e){return w["default"].removeNbFormat(e,"us")}function o(e){return w["default"].removeNbFormat(e,"eu")}function l(e,t){return v["default"].format(e,t)}function a(e){return l(e,"DMY")}function d(e){return l(e,"MDY")}function c(e){return l(e,"YMD")}function u(e){return l(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}Object.defineProperty(t,"__esModule",{value:!0});var p=n(3),b=r(p),m=n(2),y=r(m),g=n(1),T=r(g),_=n(5),v=r(_),C=n(6),w=r(C),S=function(){function e(t,n){i(this,e),this.initialized=!1,this.name=n.name,this.desc=n.description||"Sortable table",this.sorted=!1,this.sortTypes=b["default"].isArray(n.types)?n.types:[],this.sortColAtStart=b["default"].isArray(n.sort_col_at_start)?n.sort_col_at_start:null,this.asyncSort=Boolean(n.async_sort),this.triggerIds=b["default"].isArray(n.trigger_ids)?n.trigger_ids:[],this.imgPath=n.images_path||t.themesPath,this.imgBlank=n.image_blank||"blank.png",this.imgClassName=n.image_class_name||"sort-arrow",this.imgAscClassName=n.image_asc_class_name||"ascending",this.imgDescClassName=n.image_desc_class_name||"descending",this.customKey=n.custom_key||"data-tf-sortKey",this.onSortLoaded=b["default"].isFn(n.on_sort_loaded)?n.on_sort_loaded:null,this.onBeforeSort=b["default"].isFn(n.on_before_sort)?n.on_before_sort:null,this.onAfterSort=b["default"].isFn(n.on_after_sort)?n.on_after_sort:null,this.tf=t,this.emitter=t.emitter}return e.prototype.init=function(){var e=this,t=this.tf,n=this;if(b["default"].isUndef(SortableTable))throw new Error("SortableTable class not found.");this.overrideSortableTable(),this.setSortTypes();var r=n.sortColAtStart;r&&this.stt.sort(r[0],r[1]),this.onSortLoaded&&this.onSortLoaded.call(null,t,this),this.stt.onbeforesort=function(){n.onBeforeSort&&n.onBeforeSort.call(null,t,n.stt.sortColumn),t.paging&&t.feature("paging").disable()},this.stt.onsort=function(){if(n.sorted=!0,t.paging){var e=t.feature("paging");t.getValidRows(!0),e.enable(),e.setPage(e.getPage())}n.onAfterSort&&n.onAfterSort.call(null,t,n.stt.sortColumn,n.stt.descending),n.emitter.emit("column-sorted",t,n.stt.sortColumn,n.stt.descending)},this.emitter.on(["sort"],function(t,n,r){return e.sortByColumnIndex(n,r)}),this.initialized=!0,this.emitter.emit("sort-initialized",t,this)},e.prototype.sortByColumnIndex=function(e,t){this.stt.sort(e,t)},e.prototype.overrideSortableTable=function(){var e=this,t=this.tf;SortableTable.prototype.headerOnclick=function(t){if(e.initialized){for(var n=t.target||t.srcElement;"TD"!==n.tagName&&"TH"!==n.tagName;)n=n.parentNode;this.sort(SortableTable.msie?SortableTable.getCellIndex(n):n.cellIndex)}},SortableTable.getCellIndex=function(e){var t=e.parentNode.cells,n=t.length,r=void 0;for(r=0;t[r]!=e&&n>r;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 i=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var s=i.length,o=void 0,l=void 0,a=0;s>a;a++)l=i[a],null!==r.sortTypes[a]&&"None"!==r.sortTypes[a]?(l.style.cursor="pointer",o=y["default"].create("img",["src",e.imgPath+e.imgBlank]),l.appendChild(o),null!==r.sortTypes[a]&&l.setAttribute("_sortType",r.sortTypes[a]),T["default"].add(l,"click",r._headerOnclick)):(l.setAttribute("_sortType",n[a]),l._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=this,n=void 0,r=void 0,i=void 0;if(e.asyncSort&&e.triggerIds.length>0){var s=e.triggerIds;n=[],r=s.length;for(var o=0;ol;l++){var a=n[l].getAttribute("_sortType");null!==a&&"None"!==a&&(i=n[l].lastChild||n[l],"img"!==i.nodeName.toLowerCase()&&(i=y["default"].create("img",["src",e.imgPath+e.imgBlank]),n[l].appendChild(i)),l===t.sortColumn?i.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):i.className=e.imgClassName)}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this,i=r._sortTypeInfo[t];if(i&&i.getRowValue)return i.getRowValue(e,n);var s=e.cells[n],o=SortableTable.getInnerText(s);return r.getValueFromString(o,t)},SortableTable.getInnerText=function(t){return t?t.getAttribute(e.customKey)?t.getAttribute(e.customKey):y["default"].getText(t):void 0}},e.prototype.addSortType=function(){var e=arguments;SortableTable.prototype.addSortType(e[0],e[1],e[2],e[3])},e.prototype.setSortTypes=function(){for(var e=this,t=this.tf,n=this.sortTypes,r=[],i=0;i0&&!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/package.json b/package.json index 9c2e120b..3f7a406d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tablefilter", - "version": "0.2.13", + "version": "0.2.17", "description": "A Javascript library making HTML tables filterable and a bit more", "license": "MIT", "author": { @@ -32,12 +32,12 @@ "babel-eslint": "6.0.4", "babel-loader": "^6.0.1", "babel-preset-es2015": "^6.5.0", - "babel-plugin-transform-es2015-classes": "^6.6.5", - "clean-webpack-plugin": "^0.1.3", + "babel-plugin-transform-es2015-classes": "^6.7.7", + "clean-webpack-plugin": "^0.1.9", "grunt": "^1.0.1", "grunt-babel": "^6.0.0", "grunt-contrib-clean": "^1.0.0", - "grunt-contrib-connect": "^1.0.1", + "grunt-contrib-connect": "^1.0.2", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-qunit": "^1.1.0", "grunt-contrib-stylus": "^1.2.0", diff --git a/src/extensions/colsVisibility/colsVisibility.js b/src/extensions/colsVisibility/colsVisibility.js index e35ffdc4..3fe6a200 100644 --- a/src/extensions/colsVisibility/colsVisibility.js +++ b/src/extensions/colsVisibility/colsVisibility.js @@ -182,7 +182,7 @@ export default class ColsVisibility { this.buildManager(); this.initialized = true; - this.emitter.emit('columns-visibility-initialized', tf, this); + this.emitter.emit('columns-visibility-initialized', this.tf, this); // Hide columns at start at very end of initialization this._hideAtStart(); diff --git a/src/extensions/filtersVisibility/filtersVisibility.js b/src/extensions/filtersVisibility/filtersVisibility.js index f8c15695..8637da3f 100644 --- a/src/extensions/filtersVisibility/filtersVisibility.js +++ b/src/extensions/filtersVisibility/filtersVisibility.js @@ -91,7 +91,7 @@ export default class FiltersVisibility { this.buildUI(); this.initialized = true; this.emitter.on(['show-filters'], (tf, visible) => this.show(visible)); - this.emitter.emit('filters-visibility-initialized', tf, this); + this.emitter.emit('filters-visibility-initialized', this.tf, this); } /** @@ -147,7 +147,6 @@ export default class FiltersVisibility { let isDisplayed = fltRow.style.display === ''; this.show(!isDisplayed); - this.emitter.emit('filters-toggled', tf, this, !isDisplayed); } /** @@ -179,6 +178,8 @@ export default class FiltersVisibility { if (this.onAfterHide && !visible) { this.onAfterHide.call(null, this); } + + this.emitter.emit('filters-toggled', tf, this, visible); } /** diff --git a/src/modules/paging.js b/src/modules/paging.js index 67349377..e8811200 100644 --- a/src/modules/paging.js +++ b/src/modules/paging.js @@ -4,13 +4,13 @@ import Types from '../types'; import Str from '../string'; import Event from '../event'; -export class Paging extends Feature{ +export class Paging extends Feature { /** * Pagination component * @param {Object} tf TableFilter instance */ - constructor(tf){ + constructor(tf) { super(tf, 'paging'); // Configuration object @@ -57,23 +57,23 @@ export class Paging extends Feature{ //defines next page button html this.btnNextPageHtml = f.btn_next_page_html || (!tf.enableIcons ? null : - ''); + ''); //defines previous page button html this.btnPrevPageHtml = f.btn_prev_page_html || (!tf.enableIcons ? null : - ''); + ''); //defines last page button html this.btnFirstPageHtml = f.btn_first_page_html || (!tf.enableIcons ? null : - ''); + ''); //defines previous page button html this.btnLastPageHtml = f.btn_last_page_html || (!tf.enableIcons ? null : - ''); + ''); //defines text preceeding page selector drop-down this.pageText = f.page_text || ' Page '; //defines text after page selector drop-down @@ -81,7 +81,7 @@ export class Paging extends Feature{ //css class for span containing tot nb of pages this.nbPgSpanCssClass = f.nb_pages_css_class || 'nbpg'; //enables/disables paging buttons - this.hasPagingBtns = f.paging_btns===false ? false : true; + this.hasPagingBtns = f.paging_btns === false ? false : true; //defines previous page button html this.pageSelectorType = f.page_selector_type || tf.fltTypeSlc; //calls function before page is changed @@ -123,45 +123,45 @@ export class Paging extends Feature{ var start_row = tf.refRow; var nrows = tf.nbRows; //calculates page nb - this.nbPages = Math.ceil((nrows-start_row)/this.pagingLength); + this.nbPages = Math.ceil((nrows - start_row) / this.pagingLength); //Paging elements events var o = this; // Paging DOM events this.evt = { - slcIndex(){ - return (o.pageSelectorType===tf.fltTypeSlc) ? + slcIndex() { + return (o.pageSelectorType === tf.fltTypeSlc) ? o.pagingSlc.options.selectedIndex : - parseInt(o.pagingSlc.value, 10)-1; + parseInt(o.pagingSlc.value, 10) - 1; }, - nbOpts(){ - return (o.pageSelectorType===tf.fltTypeSlc) ? - parseInt(o.pagingSlc.options.length, 10)-1 : - (o.nbPages-1); + nbOpts() { + return (o.pageSelectorType === tf.fltTypeSlc) ? + parseInt(o.pagingSlc.options.length, 10) - 1 : + (o.nbPages - 1); }, - next(){ + next() { var nextIndex = o.evt.slcIndex() < o.evt.nbOpts() ? - o.evt.slcIndex()+1 : 0; + o.evt.slcIndex() + 1 : 0; o.changePage(nextIndex); }, - prev(){ - var prevIndex = o.evt.slcIndex()>0 ? - o.evt.slcIndex()-1 : o.evt.nbOpts(); + prev() { + var prevIndex = o.evt.slcIndex() > 0 ? + o.evt.slcIndex() - 1 : o.evt.nbOpts(); o.changePage(prevIndex); }, - last(){ + last() { o.changePage(o.evt.nbOpts()); }, - first(){ + first() { o.changePage(0); }, - _detectKey(e){ + _detectKey(e) { var key = Event.keyCode(e); - if(key===13){ - if(tf.sorted){ + if (key === 13) { + if (tf.sorted) { tf.filter(); o.changePage(o.evt.slcIndex()); - } else{ + } else { o.changePage(); } this.blur(); @@ -178,19 +178,19 @@ export class Paging extends Feature{ /** * Initialize DOM elements */ - init(){ + init() { var slcPages; var tf = this.tf; var evt = this.evt; - if(this.initialized){ + if (this.initialized) { return; } // Check resultsPerPage is in expected format and initialise the // results per page component - if(this.hasResultsPerPage){ - if(this.resultsPerPage.length<2){ + if (this.hasResultsPerPage) { + if (this.resultsPerPage.length < 2) { this.hasResultsPerPage = false; } else { this.pagingLength = this.resultsPerPage[1][0]; @@ -204,18 +204,18 @@ export class Paging extends Feature{ }; // Paging drop-down list selector - if(this.pageSelectorType === tf.fltTypeSlc){ + if (this.pageSelectorType === tf.fltTypeSlc) { slcPages = Dom.create( - tf.fltTypeSlc, ['id', this.prfxSlcPages+tf.id]); + tf.fltTypeSlc, ['id', this.prfxSlcPages + tf.id]); slcPages.className = this.pgSlcCssClass; Event.add(slcPages, 'change', evt.slcPagesChange); } // Paging input selector - if(this.pageSelectorType === tf.fltTypeInp){ + if (this.pageSelectorType === tf.fltTypeInp) { slcPages = Dom.create( tf.fltTypeInp, - ['id', this.prfxSlcPages+tf.id], + ['id', this.prfxSlcPages + tf.id], ['value', this.currentPageNb] ); slcPages.className = this.pgInpCssClass; @@ -224,20 +224,20 @@ export class Paging extends Feature{ // btns containers var btnNextSpan = Dom.create( - 'span',['id', this.prfxBtnNextSpan+tf.id]); + 'span', ['id', this.prfxBtnNextSpan + tf.id]); var btnPrevSpan = Dom.create( - 'span',['id', this.prfxBtnPrevSpan+tf.id]); + 'span', ['id', this.prfxBtnPrevSpan + tf.id]); var btnLastSpan = Dom.create( - 'span',['id', this.prfxBtnLastSpan+tf.id]); + 'span', ['id', this.prfxBtnLastSpan + tf.id]); var btnFirstSpan = Dom.create( - 'span',['id', this.prfxBtnFirstSpan+tf.id]); + 'span', ['id', this.prfxBtnFirstSpan + tf.id]); - if(this.hasPagingBtns){ + if (this.hasPagingBtns) { // Next button - if(!this.btnNextPageHtml){ + if (!this.btnNextPageHtml) { var btn_next = Dom.create( tf.fltTypeInp, - ['id', this.prfxBtnNext+tf.id], + ['id', this.prfxBtnNext + tf.id], ['type', 'button'], ['value', this.btnNextPageText], ['title', 'Next'] @@ -250,10 +250,10 @@ export class Paging extends Feature{ Event.add(btnNextSpan, 'click', evt.next); } // Previous button - if(!this.btnPrevPageHtml){ + if (!this.btnPrevPageHtml) { var btn_prev = Dom.create( tf.fltTypeInp, - ['id', this.prfxBtnPrev+tf.id], + ['id', this.prfxBtnPrev + tf.id], ['type', 'button'], ['value', this.btnPrevPageText], ['title', 'Previous'] @@ -266,10 +266,10 @@ export class Paging extends Feature{ Event.add(btnPrevSpan, 'click', evt.prev); } // Last button - if(!this.btnLastPageHtml){ + if (!this.btnLastPageHtml) { var btn_last = Dom.create( tf.fltTypeInp, - ['id', this.prfxBtnLast+tf.id], + ['id', this.prfxBtnLast + tf.id], ['type', 'button'], ['value', this.btnLastPageText], ['title', 'Last'] @@ -282,10 +282,10 @@ export class Paging extends Feature{ Event.add(btnLastSpan, 'click', evt.last); } // First button - if(!this.btnFirstPageHtml){ + if (!this.btnFirstPageHtml) { var btn_first = Dom.create( tf.fltTypeInp, - ['id', this.prfxBtnFirst+tf.id], + ['id', this.prfxBtnFirst + tf.id], ['type', 'button'], ['value', this.btnFirstPageText], ['title', 'First'] @@ -300,7 +300,7 @@ export class Paging extends Feature{ } // paging elements (buttons+drop-down list) are added to defined element - if(!this.pagingTgtId){ + if (!this.pagingTgtId) { tf.setToolbar(); } var targetEl = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId); @@ -308,34 +308,32 @@ export class Paging extends Feature{ targetEl.appendChild(btnPrevSpan); var pgBeforeSpan = Dom.create( - 'span',['id', this.prfxPgBeforeSpan+tf.id] ); - pgBeforeSpan.appendChild( Dom.text(this.pageText) ); + 'span', ['id', this.prfxPgBeforeSpan + tf.id]); + pgBeforeSpan.appendChild(Dom.text(this.pageText)); pgBeforeSpan.className = this.nbPgSpanCssClass; targetEl.appendChild(pgBeforeSpan); targetEl.appendChild(slcPages); var pgAfterSpan = Dom.create( - 'span',['id', this.prfxPgAfterSpan+tf.id]); - pgAfterSpan.appendChild( Dom.text(this.ofText) ); + 'span', ['id', this.prfxPgAfterSpan + tf.id]); + pgAfterSpan.appendChild(Dom.text(this.ofText)); pgAfterSpan.className = this.nbPgSpanCssClass; targetEl.appendChild(pgAfterSpan); - var pgspan = Dom.create( 'span',['id', this.prfxPgSpan+tf.id] ); + var pgspan = Dom.create('span', ['id', this.prfxPgSpan + tf.id]); pgspan.className = this.nbPgSpanCssClass; - pgspan.appendChild( Dom.text(' '+this.nbPages+' ') ); + pgspan.appendChild(Dom.text(' ' + this.nbPages + ' ')); targetEl.appendChild(pgspan); targetEl.appendChild(btnNextSpan); targetEl.appendChild(btnLastSpan); - this.pagingSlc = Dom.id(this.prfxSlcPages+tf.id); + this.pagingSlc = Dom.id(this.prfxSlcPages + tf.id); - if(!tf.rememberGridValues){ - this.setPagingInfo(); - } - if(!tf.fltGrid){ + this.setPagingInfo(); + + if (!tf.fltGrid) { tf.validateAllRows(); this.setPagingInfo(tf.validRowsIndex); } - this.emitter.on(['after-filtering'], ()=> this.resetPagingInfo()); - this.emitter.on(['initialized'], ()=> this.resetValues()); + this.emitter.on(['after-filtering'], () => this.resetPagingInfo()); this.emitter.on(['change-page'], (tf, pageNumber) => this.setPage(pageNumber)); this.emitter.on(['change-page-results'], @@ -348,15 +346,15 @@ export class Paging extends Feature{ * Reset paging when filters are already instantiated * @param {Boolean} filterTable Execute filtering once paging instanciated */ - reset(filterTable=false){ + reset(filterTable = false) { var tf = this.tf; - if(this.isEnabled()){ + if (this.isEnabled()) { return; } this.enable(); this.init(); - if(filterTable){ + if (filterTable) { tf.filter(); } } @@ -364,7 +362,7 @@ export class Paging extends Feature{ /** * Reset paging info from scratch after a filtering process */ - resetPagingInfo(){ + resetPagingInfo() { this.startPagingRow = 0; this.currentPageNb = 1; this.setPagingInfo(this.tf.validRowsIndex); @@ -375,31 +373,32 @@ export class Paging extends Feature{ * Refresh paging select according to number of pages * @param {Array} validRows Collection of valid rows */ - setPagingInfo(validRows){ + setPagingInfo(validRows) { var tf = this.tf; var mdiv = !this.pagingTgtId ? tf.mDiv : Dom.id(this.pagingTgtId); - var pgspan = Dom.id(this.prfxPgSpan+tf.id); + var pgspan = Dom.id(this.prfxPgSpan + tf.id); //store valid rows indexes tf.validRowsIndex = validRows || tf.getValidRows(true); //calculate nb of pages - this.nbPages = Math.ceil(tf.validRowsIndex.length/this.pagingLength); + this.nbPages = Math.ceil(tf.validRowsIndex.length / this.pagingLength); //refresh page nb span pgspan.innerHTML = this.nbPages; //select clearing shortcut - if(this.pageSelectorType === tf.fltTypeSlc){ + if (this.pageSelectorType === tf.fltTypeSlc) { this.pagingSlc.innerHTML = ''; } - if(this.nbPages>0){ + if (this.nbPages > 0) { mdiv.style.visibility = 'visible'; - if(this.pageSelectorType === tf.fltTypeSlc){ - for(var z=0; z=startPagingRow && h= startPagingRow && h < endPagingRow) { + if (Types.isNull(isRowValid) || + Boolean(isRowValid === 'true')) { r.style.display = ''; rowDisplayed = true; } @@ -454,24 +454,24 @@ export class Paging extends Feature{ * Return the current page number * @return {Number} Page number */ - getPage(){ + getPage() { return this.currentPageNb; } /** - * Show page based on passed param value (string or number): + * Show page defined by passed argument (string or number): * @param {String}/{Number} cmd possible string values: 'next', * 'previous', 'last', 'first' or page number as per param */ - setPage(cmd){ + setPage(cmd) { var tf = this.tf; - if(!tf.hasGrid() || !this.isEnabled()){ + if (!tf.hasGrid() || !this.isEnabled()) { return; } var btnEvt = this.evt, cmdtype = typeof cmd; - if(cmdtype === 'string'){ - switch(Str.lower(cmd)){ + if (cmdtype === 'string') { + switch (Str.lower(cmd)) { case 'next': btnEvt.next(); break; @@ -489,19 +489,19 @@ export class Paging extends Feature{ break; } } - else if(cmdtype === 'number'){ - this.changePage(cmd-1); + else if (cmdtype === 'number') { + this.changePage(cmd - 1); } } /** * Generates UI elements for the number of results per page drop-down */ - setResultsPerPage(){ + setResultsPerPage() { var tf = this.tf; var evt = this.evt; - if(this.resultsPerPageSlc || !this.resultsPerPage){ + if (this.resultsPerPageSlc || !this.resultsPerPage) { return; } @@ -511,16 +511,16 @@ export class Paging extends Feature{ }; var slcR = Dom.create( - tf.fltTypeSlc, ['id', this.prfxSlcResults+tf.id]); + tf.fltTypeSlc, ['id', this.prfxSlcResults + tf.id]); slcR.className = this.resultsSlcCssClass; var slcRText = this.resultsPerPage[0], slcROpts = this.resultsPerPage[1]; var slcRSpan = Dom.create( - 'span',['id', this.prfxSlcResultsTxt+tf.id]); + 'span', ['id', this.prfxSlcResultsTxt + tf.id]); slcRSpan.className = this.resultsSpanCssClass; // results per page select is added to external element - if(!this.resultsPerPageTgtId){ + if (!this.resultsPerPageTgtId) { tf.setToolbar(); } var targetEl = !this.resultsPerPageTgtId ? @@ -528,7 +528,7 @@ export class Paging extends Feature{ slcRSpan.appendChild(Dom.text(slcRText)); var help = tf.feature('help'); - if(help && help.btn){ + if (help && help.btn) { help.btn.parentNode.insertBefore(slcRSpan, help.btn); help.btn.parentNode.insertBefore(slcR, help.btn); } else { @@ -536,7 +536,7 @@ export class Paging extends Feature{ targetEl.appendChild(slcR); } - for(var r=0; r=0 && index<=(this.nbPages-1) ){ - if(this.onBeforeChangePage){ + if (index >= 0 && index <= (this.nbPages - 1)) { + if (this.onBeforeChangePage) { this.onBeforeChangePage.call(null, this, (index + 1)); } - this.currentPageNb = parseInt(index, 10)+1; - if(this.pageSelectorType===tf.fltTypeSlc){ + this.currentPageNb = parseInt(index, 10) + 1; + if (this.pageSelectorType === tf.fltTypeSlc) { this.pagingSlc.options[index].selected = true; } else { this.pagingSlc.value = this.currentPageNb; } this.startPagingRow = (this.pageSelectorType === tf.fltTypeSlc) ? - this.pagingSlc.value : (index*this.pagingLength); + this.pagingSlc.value : (index * this.pagingLength); this.groupByPage(); - if(this.onAfterChangePage){ + if (this.onAfterChangePage) { this.onAfterChangePage.call(null, this, (index + 1)); } } @@ -604,8 +604,8 @@ export class Paging extends Feature{ this.emitter.emit('after-page-change', tf, (index + 1)); } - changeResultsPerPage(val){ - if(!this.isEnabled() || isNaN(val)){ + changeResultsPerPage(val) { + if (!this.isEnabled() || isNaN(val)) { return; } @@ -616,10 +616,10 @@ export class Paging extends Feature{ /** * Change rows according to page results drop-down */ - onChangeResultsPerPage(){ + onChangeResultsPerPage() { var tf = this.tf; - if(!this.isEnabled()){ + if (!this.isEnabled()) { return; } @@ -628,21 +628,21 @@ export class Paging extends Feature{ var slcR = this.resultsPerPageSlc; var slcIndex = slcR.selectedIndex; var slcPagesSelIndex = (this.pageSelectorType === tf.fltTypeSlc) ? - this.pagingSlc.selectedIndex : - parseInt(this.pagingSlc.value-1, 10); + this.pagingSlc.selectedIndex : + parseInt(this.pagingSlc.value - 1, 10); this.pagingLength = parseInt(slcR.options[slcIndex].value, 10); - this.startPagingRow = this.pagingLength*slcPagesSelIndex; + this.startPagingRow = this.pagingLength * slcPagesSelIndex; - if(!isNaN(this.pagingLength)){ - if(this.startPagingRow >= tf.nbFilterableRows){ - this.startPagingRow = (tf.nbFilterableRows-this.pagingLength); + if (!isNaN(this.pagingLength)) { + if (this.startPagingRow >= tf.nbFilterableRows) { + this.startPagingRow = (tf.nbFilterableRows - this.pagingLength); } this.setPagingInfo(); - if(this.pageSelectorType === tf.fltTypeSlc){ + if (this.pageSelectorType === tf.fltTypeSlc) { var slcIdx = - (this.pagingSlc.options.length-1<=slcPagesSelIndex) ? - (this.pagingSlc.options.length-1) : slcPagesSelIndex; + (this.pagingSlc.options.length - 1 <= slcPagesSelIndex) ? + (this.pagingSlc.options.length - 1) : slcPagesSelIndex; this.pagingSlc.options[slcIdx].selected = true; } } @@ -650,31 +650,18 @@ export class Paging extends Feature{ this.emitter.emit('after-page-length-change', tf, this.pagingLength); } - /** - * Re-set persisted pagination info - */ - resetValues(){ - var tf = this.tf; - if(tf.rememberPageLen){ - this.resetPageLength(); - } - if(tf.rememberPageNb){ - this.resetPage(); - } - } - /** * Re-set page nb at page re-load */ - resetPage(){ + resetPage() { var tf = this.tf; - if(!this.isEnabled()){ + if (!this.isEnabled()) { return; } this.emitter.emit('before-reset-page', tf); var pgNb = tf.feature('store').getPageNb(); - if(pgNb !== ''){ - this.changePage((pgNb-1)); + if (pgNb !== '') { + this.changePage((pgNb - 1)); } this.emitter.emit('after-reset-page', tf, pgNb); } @@ -682,15 +669,15 @@ export class Paging extends Feature{ /** * Re-set page length value at page re-load */ - resetPageLength(){ + resetPageLength() { var tf = this.tf; - if(!this.isEnabled()){ + if (!this.isEnabled()) { return; } this.emitter.emit('before-reset-page-length', tf); var pglenIndex = tf.feature('store').getPageLength(); - if(pglenIndex!==''){ + if (pglenIndex !== '') { this.resultsPerPageSlc.options[pglenIndex].selected = true; this.changeResultsPerPage(); } @@ -700,74 +687,73 @@ export class Paging extends Feature{ /** * Remove paging feature */ - destroy(){ + destroy() { var tf = this.tf; - if(!this.initialized){ + if (!this.initialized) { return; } // btns containers - var btnNextSpan = Dom.id(this.prfxBtnNextSpan+tf.id); - var btnPrevSpan = Dom.id(this.prfxBtnPrevSpan+tf.id); - var btnLastSpan = Dom.id(this.prfxBtnLastSpan+tf.id); - var btnFirstSpan = Dom.id(this.prfxBtnFirstSpan+tf.id); + var btnNextSpan = Dom.id(this.prfxBtnNextSpan + tf.id); + var btnPrevSpan = Dom.id(this.prfxBtnPrevSpan + tf.id); + var btnLastSpan = Dom.id(this.prfxBtnLastSpan + tf.id); + var btnFirstSpan = Dom.id(this.prfxBtnFirstSpan + tf.id); //span containing 'Page' text - var pgBeforeSpan = Dom.id(this.prfxPgBeforeSpan+tf.id); + var pgBeforeSpan = Dom.id(this.prfxPgBeforeSpan + tf.id); //span containing 'of' text - var pgAfterSpan = Dom.id(this.prfxPgAfterSpan+tf.id); + var pgAfterSpan = Dom.id(this.prfxPgAfterSpan + tf.id); //span containing nb of pages - var pgspan = Dom.id(this.prfxPgSpan+tf.id); + var pgspan = Dom.id(this.prfxPgSpan + tf.id); var evt = this.evt; - if(this.pagingSlc){ - if(this.pageSelectorType === tf.fltTypeSlc){ + if (this.pagingSlc) { + if (this.pageSelectorType === tf.fltTypeSlc) { Event.remove(this.pagingSlc, 'change', evt.slcPagesChange); } - else if(this.pageSelectorType === tf.fltTypeInp){ + else if (this.pageSelectorType === tf.fltTypeInp) { Event.remove(this.pagingSlc, 'keypress', evt._detectKey); } Dom.remove(this.pagingSlc); } - if(btnNextSpan){ + if (btnNextSpan) { Event.remove(btnNextSpan, 'click', evt.next); Dom.remove(btnNextSpan); } - if(btnPrevSpan){ + if (btnPrevSpan) { Event.remove(btnPrevSpan, 'click', evt.prev); Dom.remove(btnPrevSpan); } - if(btnLastSpan){ + if (btnLastSpan) { Event.remove(btnLastSpan, 'click', evt.last); Dom.remove(btnLastSpan); } - if(btnFirstSpan){ + if (btnFirstSpan) { Event.remove(btnFirstSpan, 'click', evt.first); Dom.remove(btnFirstSpan); } - if(pgBeforeSpan){ + if (pgBeforeSpan) { Dom.remove(pgBeforeSpan); } - if(pgAfterSpan){ + if (pgAfterSpan) { Dom.remove(pgAfterSpan); } - if(pgspan){ + if (pgspan) { Dom.remove(pgspan); } - if(this.hasResultsPerPage){ + if (this.hasResultsPerPage) { this.removeResultsPerPage(); } - this.emitter.off(['after-filtering'], ()=> this.resetPagingInfo()); - this.emitter.off(['initialized'], ()=> this.resetValues()); + this.emitter.off(['after-filtering'], () => this.resetPagingInfo()); this.emitter.off(['change-page'], (tf, pageNumber) => this.setPage(pageNumber)); this.emitter.off(['change-page-results'], diff --git a/src/modules/state.js b/src/modules/state.js index f3c26395..824c4a88 100644 --- a/src/modules/state.js +++ b/src/modules/state.js @@ -359,7 +359,7 @@ export class State extends Feature { * * @private */ - _syncFiltersVisibility(){ + _syncFiltersVisibility() { if (!this.persistFiltersVisibility) { return; } @@ -367,6 +367,7 @@ export class State extends Feature { let tf = this.tf; let filtersVisibility = state[this.filtersVisKey]; + this.filtersVisibility = filtersVisibility; this.emitter.emit('show-filters', tf, filtersVisibility); } diff --git a/src/modules/store.js b/src/modules/store.js deleted file mode 100644 index 9accd29b..00000000 --- a/src/modules/store.js +++ /dev/null @@ -1,146 +0,0 @@ -import Cookie from '../cookie'; -import Types from '../types'; - -export class Store{ - - /** - * Store, persistence manager - * @param {Object} tf TableFilter instance - * - * TODO: use localStorage and fallback to cookie persistence - */ - constructor(tf){ - let f = tf.config(); - - //cookie storing filter values - this.fltsValuesCookie = tf.prfxCookieFltsValues + tf.id; - //cookie storing page nb - this.pgNbCookie = tf.prfxCookiePageNb + tf.id; - //cookie storing page length - this.pgLenCookie = tf.prfxCookiePageLen + tf.id; - - 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.emitter.on(['after-clearing-filters'], ()=> this.clearCookies()); - this.emitter.on(['after-page-change'], - (tf, index)=> this.savePageNb(index)); - this.emitter.on(['after-page-length-change'], - (tf, index)=> this.savePageLength(index)); - } - - /** - * Store filters' values in cookie - */ - saveFilterValues(){ - let tf = this.tf; - let fltValues = []; - - if(!tf.rememberGridValues){ - return; - } - - //store filters' values - for(let i=0; i this.saveFilterValues()); - this.emitter.off(['after-clearing-filters'], ()=> this.clearCookies()); - this.emitter.off(['after-page-change'], - (tf, index)=> this.savePageNb(index)); - this.emitter.off(['after-page-length-change'], - (tf, index)=> this.savePageLength(index)); - } -} diff --git a/src/tablefilter.js b/src/tablefilter.js index 8dfb6c5f..e0084e34 100644 --- a/src/tablefilter.js +++ b/src/tablefilter.js @@ -4,10 +4,8 @@ import Str from './string'; import Types from './types'; import DateHelper from './date'; import Helpers from './helpers'; -import {Emitter} from './emitter'; -// Features -import {Store} from './modules/store'; +import {Emitter} from './emitter'; import {GridLayout} from './modules/gridLayout'; import {Loader} from './modules/loader'; import {HighlightKeyword} from './modules/highlightKeywords'; @@ -37,7 +35,7 @@ export class TableFilter { * @param {Object} configuration object */ constructor(...args) { - if(args.length === 0){ return; } + if (args.length === 0) { return; } this.id = null; this.version = '{VERSION}'; @@ -53,24 +51,25 @@ export class TableFilter { this._hasGrid = false; // TODO: use for-of with babel plug-in - args.forEach((arg)=> { - // for (let arg of args) { + args.forEach((arg) => { + // for (let arg of args) { let argtype = typeof arg; - if(argtype === 'object' && arg && arg.nodeName === 'TABLE'){ + if (argtype === 'object' && arg && arg.nodeName === 'TABLE') { this.tbl = arg; this.id = arg.id || `tf_${new Date().getTime()}_`; - } else if(argtype === 'string'){ + } else if (argtype === 'string') { this.id = arg; this.tbl = Dom.id(arg); - } else if(argtype === 'number'){ + } else if (argtype === 'number') { this.startRow = arg; - } else if(argtype === 'object'){ + } else if (argtype === 'object') { this.cfg = arg; } - // } + // } }); - if(!this.tbl || this.tbl.nodeName != 'TABLE' || this.getRowsNb() === 0){ + if (!this.tbl || this.tbl.nodeName != 'TABLE' || + this.getRowsNb() === 0) { throw new Error( 'Could not instantiate TableFilter: HTML table not found.'); } @@ -81,9 +80,9 @@ export class TableFilter { this.emitter = new Emitter(); //Start row et cols nb - this.refRow = this.startRow === null ? 2 : (this.startRow+1); - try{ this.nbCells = this.getCellsNb(this.refRow); } - catch(e){ this.nbCells = this.getCellsNb(0); } + this.refRow = this.startRow === null ? 2 : (this.startRow + 1); + try { this.nbCells = this.getCellsNb(this.refRow); } + catch (e) { this.nbCells = this.getCellsNb(0); } //default script base path this.basePath = f.base_path || 'tablefilter/'; @@ -109,8 +108,8 @@ export class TableFilter { (this.filtersRowIndex === 0 ? 1 : 0) : f.headers_row_index; //defines tag of the cells containing filters (td/th) - this.fltCellTag = f.filters_cell_tag!=='th' || - f.filters_cell_tag!=='td' ? 'td' : f.filters_cell_tag; + this.fltCellTag = f.filters_cell_tag !== 'th' || + f.filters_cell_tag !== 'td' ? 'td' : f.filters_cell_tag; //stores filters ids this.fltIds = []; @@ -143,12 +142,12 @@ export class TableFilter { /*** filters' grid appearance ***/ //stylesheet file this.stylePath = f.style_path || this.basePath + 'style/'; - this.stylesheet = f.stylesheet || this.stylePath+'tablefilter.css'; + this.stylesheet = f.stylesheet || this.stylePath + 'tablefilter.css'; this.stylesheetId = this.id + '_style'; //defines css class for filters row this.fltsRowCssClass = f.flts_row_css_class || 'fltrow'; - //enables/disables icons (paging, reset button) - this.enableIcons = f.enable_icons===false ? false : true; + //enables/disables icons (paging, reset button) + this.enableIcons = f.enable_icons === false ? false : true; //enables/disbles rows alternating bg colors this.alternateRows = Boolean(f.alternate_rows); //defines widths of columns @@ -165,7 +164,7 @@ export class TableFilter { /*** filters' grid behaviours ***/ //enables/disables enter key - this.enterKey = f.enter_key===false ? false : true; + this.enterKey = f.enter_key === false ? false : true; //calls function before filtering starts this.onBeforeFilter = Types.isFn(f.on_before_filter) ? f.on_before_filter : null; @@ -197,7 +196,8 @@ export class TableFilter { //stores filters elements if isExternalFlt is true this.externalFltEls = []; //delays any filtering process if loader true - this.execDelay = !isNaN(f.exec_delay) ? parseInt(f.exec_delay,10) : 100; + this.execDelay = !isNaN(f.exec_delay) ? parseInt(f.exec_delay, 10) : + 100; //calls function when filters grid loaded this.onFiltersLoaded = Types.isFn(f.on_filters_loaded) ? f.on_filters_loaded : null; @@ -246,9 +246,9 @@ export class TableFilter { //defines empty option text this.nonEmptyText = f.non_empty_text || '(Non empty)'; //enables/disables onChange event on combo-box - this.onSlcChange = f.on_change===false ? false : true; + this.onSlcChange = f.on_change === false ? false : true; //enables/disables select options sorting - this.sortSlc = f.sort_select===false ? false : true; + this.sortSlc = f.sort_select === false ? false : true; //enables/disables ascending numeric options sorting this.isSortNumAsc = Boolean(f.sort_num_asc); this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : []; @@ -316,8 +316,7 @@ export class TableFilter { this.nbHiddenRows = 0; //nb hidden rows /*** autofilter on typing ***/ - //enables/disables auto filtering, table is filtered when user stops - //typing + //Auto filtering, table is filtered when user stops typing this.autoFilter = Boolean(f.auto_filter); //onkeyup delay timer (msecs) this.autoFilterDelay = !isNaN(f.auto_filter_delay) ? @@ -378,16 +377,6 @@ export class TableFilter { this.prfxCookiePageLen = 'tf_pglen_'; this.prfxResponsive = 'resp'; - /*** cookies ***/ - //remembers filters values on page load - this.rememberGridValues = Boolean(f.remember_grid_values); - //remembers page nb on page load - this.rememberPageNb = this.paging && f.remember_page_number; - //remembers page length on page load - this.rememberPageLen = this.paging && f.remember_page_length; - this.hasPersistence = this.rememberGridValues || this.rememberPageNb || - this.rememberPageLen; - /*** extensions ***/ //imports external script this.extensions = f.extensions; @@ -409,143 +398,71 @@ export class TableFilter { // Extensions registry this.ExtRegistry = {}; - - /*** TF events ***/ - this.Evt = { - // Detect key - detectKey(e) { - if(!this.enterKey){ return; } - if(e){ - let key = Event.keyCode(e); - if(key===13){ - this.filter(); - Event.cancel(e); - Event.stop(e); - } else { - this.isUserTyping = true; - global.clearInterval(this.autoFilterTimer); - this.autoFilterTimer = null; - } - } - }, - // if auto-filter on, detect user is typing and filter columns - onKeyUp(e) { - if(!this.autoFilter){ - return; - } - let key = Event.keyCode(e); - this.isUserTyping = false; - - function filter() { - global.clearInterval(this.autoFilterTimer); - this.autoFilterTimer = null; - if(!this.isUserTyping){ - this.filter(); - this.isUserTyping = null; - } - } - - if(key!==13 && key!==9 && key!==27 && key!==38 && key!==40) { - if(this.autoFilterTimer === null){ - this.autoFilterTimer = global.setInterval( - filter.bind(this), this.autoFilterDelay); - } - } else { - global.clearInterval(this.autoFilterTimer); - this.autoFilterTimer = null; - } - }, - // if auto-filter on, detect user is typing - onKeyDown() { - if(!this.autoFilter) { return; } - this.isUserTyping = true; - }, - // if auto-filter on, clear interval on filter blur - onInpBlur() { - if(this.autoFilter){ - this.isUserTyping = false; - global.clearInterval(this.autoFilterTimer); - } - this.emitter.emit('filter-blur', this); - }, - // set focused text-box filter as active - onInpFocus(e) { - let elm = Event.target(e); - this.emitter.emit('filter-focus', this, elm); - } - }; } /** * Initialise features and layout */ - init(){ - if(this._hasGrid){ + init() { + if (this._hasGrid) { return; } let Mod = this.Mod; - let n = this.singleSearchFlt ? 1 : this.nbCells, - inpclass; + let n = this.singleSearchFlt ? 1 : this.nbCells; + let inpclass; //loads stylesheet if not imported this.import(this.stylesheetId, this.stylesheet, null, 'link'); //loads theme - if(this.hasThemes){ + if (this.hasThemes) { this.loadThemes(); } // Instantiate help feature and initialise only if set true - if(!Mod.help){ + if (!Mod.help) { Mod.help = new Help(this); } - if(this.help){ + if (this.help) { Mod.help.init(); } - if(this.state){ - if(!Mod.state){ + if (this.state) { + if (!Mod.state) { Mod.state = new State(this); } Mod.state.init(); } - if(this.hasPersistence){ - if(!Mod.store){ - Mod.store = new Store(this); - } - Mod.store.init(); - } - - if(this.gridLayout){ - if(!Mod.gridLayout){ + if (this.gridLayout) { + if (!Mod.gridLayout) { Mod.gridLayout = new GridLayout(this); } Mod.gridLayout.init(); } - if(this.loader){ - if(!Mod.loader){ + if (this.loader) { + if (!Mod.loader) { Mod.loader = new Loader(this); } Mod.loader.init(); } - if(this.highlightKeywords){ + if (this.highlightKeywords) { Mod.highlightKeyword = new HighlightKeyword(this); Mod.highlightKeyword.init(); } - if(this.popupFilters){ - if(!Mod.popupFilter){ + if (this.popupFilters) { + if (!Mod.popupFilter) { Mod.popupFilter = new PopupFilter(this); } Mod.popupFilter.init(); } //filters grid is not generated - if(!this.fltGrid){ + if (!this.fltGrid) { this._initNoFilters(); } else { let fltrow = this._insertFiltersRow(); @@ -555,37 +472,37 @@ export class TableFilter { this.nbRows = this.tbl.rows.length; // Generate filters - for(let i=0; i this.setActiveFilterId(filter.id)); + (tf, filter) => this.setActiveFilterId(filter.id)); }//if this.fltGrid /* Features */ - if(this.hasVisibleRows){ - this.emitter.on(['after-filtering'], ()=> this.enforceVisibility()); + if (this.hasVisibleRows) { + this.emitter.on(['after-filtering'], + () => this.enforceVisibility()); this.enforceVisibility(); } - if(this.rowsCounter){ + if (this.rowsCounter) { Mod.rowsCounter = new RowsCounter(this); Mod.rowsCounter.init(); } - if(this.statusBar){ + if (this.statusBar) { Mod.statusBar = new StatusBar(this); Mod.statusBar.init(); } - if(this.paging){ - if(!Mod.paging){ + if (this.paging) { + if (!Mod.paging) { Mod.paging = new Paging(this); Mod.paging.init(); - } else{ + } else { Mod.paging.reset(); } } - if(this.btnReset){ + if (this.btnReset) { Mod.clearButton = new ClearButton(this); Mod.clearButton.init(); } - if(this.hasColWidths && !this.gridLayout){ + if (this.hasColWidths && !this.gridLayout) { this.setColWidths(); } - if(this.alternateRows){ + if (this.alternateRows) { Mod.alternateRows = new AlternateRows(this); Mod.alternateRows.init(); } - if(this.noResults){ - if(!Mod.noResults){ + if (this.noResults) { + if (!Mod.noResults) { Mod.noResults = new NoResults(this); } Mod.noResults.init(); @@ -648,35 +566,31 @@ export class TableFilter { this._hasGrid = true; - if(this.hasPersistence){ - this.resetFilterValues(); - } - //TF css class is added to table - if(!this.gridLayout){ + if (!this.gridLayout) { Dom.addClass(this.tbl, this.prfxTf); - if(this.responsive){ + if (this.responsive) { Dom.addClass(this.tbl, this.prfxResponsive); } } /* Loads extensions */ - if(this.hasExtensions){ + if (this.hasExtensions) { this.initExtensions(); } // Subscribe to events - if(this.markActiveColumns){ + if (this.markActiveColumns) { this.emitter.on(['before-filtering'], - ()=> this.clearActiveColumns()); + () => this.clearActiveColumns()); this.emitter.on(['cell-processed'], - (tf, colIndex)=> this.markActiveColumn(colIndex)); + (tf, colIndex) => this.markActiveColumn(colIndex)); } - if(this.linkedFilters){ - this.emitter.on(['after-filtering'], ()=> this.linkFilters()); + if (this.linkedFilters) { + this.emitter.on(['after-filtering'], () => this.linkFilters()); } - if(this.onFiltersLoaded){ + if (this.onFiltersLoaded) { this.onFiltersLoaded.call(null, this); } @@ -684,17 +598,100 @@ export class TableFilter { this.emitter.emit('initialized', this); } + /** + * Detect key + * @param {Event} evt + */ + detectKey(evt) { + if (!this.enterKey) { + return; + } + if (evt) { + let key = Event.keyCode(evt); + if (key === 13) { + this.filter(); + Event.cancel(evt); + Event.stop(evt); + } else { + this.isUserTyping = true; + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + } + } + } + + /** + * Filter's keyup event: if auto-filter on, detect user is typing and filter + * columns + * @param {Event} evt + */ + onKeyUp(evt) { + if (!this.autoFilter) { + return; + } + let key = Event.keyCode(evt); + this.isUserTyping = false; + + function filter() { + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + if (!this.isUserTyping) { + this.filter(); + this.isUserTyping = null; + } + } + // TODO: define constants for keys + if (key !== 13 && key !== 9 && key !== 27 && key !== 38 && key !== 40) { + if (this.autoFilterTimer === null) { + this.autoFilterTimer = global.setInterval(filter.bind(this), + this.autoFilterDelay); + } + } else { + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + } + } + + /** + * Filter's keydown event: if auto-filter on, detect user is typing + */ + onKeyDown() { + if (this.autoFilter) { + this.isUserTyping = true; + } + } + + /** + * Filter's focus event + * @param {Event} evt + */ + onInpFocus(evt) { + let elm = Event.target(evt); + this.emitter.emit('filter-focus', this, elm); + } + + /** + * Filter's blur event: if auto-filter on, clear interval on filter blur + */ + onInpBlur() { + if (this.autoFilter) { + this.isUserTyping = false; + global.clearInterval(this.autoFilterTimer); + } + this.emitter.emit('filter-blur', this); + } + /** * Insert filters row at initialization */ _insertFiltersRow() { - if(this.gridLayout){ + if (this.gridLayout) { return; } let fltrow; let thead = Dom.tag(this.tbl, 'thead'); - if(thead.length > 0){ + if (thead.length > 0) { fltrow = thead[0].insertRow(this.filtersRowIndex); } else { fltrow = this.tbl.insertRow(this.filtersRowIndex); @@ -702,7 +699,7 @@ export class TableFilter { fltrow.className = this.fltsRowCssClass; - if(this.isExternalFlt){ + if (this.isExternalFlt) { fltrow.style.display = 'none'; } @@ -713,11 +710,11 @@ export class TableFilter { /** * Initialize filtersless table */ - _initNoFilters(){ - if(this.fltGrid){ + _initNoFilters() { + if (this.fltGrid) { return; } - this.refRow = this.refRow > 0 ? this.refRow-1 : 0; + this.refRow = this.refRow > 0 ? this.refRow - 1 : 0; this.nbFilterableRows = this.getRowsNb(); this.nbVisibleRows = this.nbFilterableRows; this.nbRows = this.nbFilterableRows + this.refRow; @@ -729,26 +726,26 @@ export class TableFilter { * @param {String} cssClass Css class applied to filter * @param {DOMElement} container Container DOM element */ - _buildInputFilter(colIndex, cssClass, container){ + _buildInputFilter(colIndex, cssClass, container) { let col = this.getFilterType(colIndex); let externalFltTgtId = this.isExternalFlt ? this.externalFltTgtIds[colIndex] : null; - let inptype = col===this.fltTypeInp ? 'text' : 'hidden'; + let inptype = col === this.fltTypeInp ? 'text' : 'hidden'; let inp = Dom.create(this.fltTypeInp, - ['id', this.prfxFlt+colIndex+'_'+this.id], + ['id', this.prfxFlt + colIndex + '_' + this.id], ['type', inptype], ['ct', colIndex]); - if(inptype !== 'hidden' && this.watermark){ + if (inptype !== 'hidden' && this.watermark) { inp.setAttribute('placeholder', this.isWatermarkArray ? (this.watermark[colIndex] || '') : this.watermark ); } inp.className = cssClass || this.fltCssClass; - Event.add(inp, 'focus', this.Evt.onInpFocus.bind(this)); + Event.add(inp, 'focus', (evt) => this.onInpFocus(evt)); //filter is appended in custom element - if(externalFltTgtId){ + if (externalFltTgtId) { Dom.id(externalFltTgtId).appendChild(inp); this.externalFltEls.push(inp); } else { @@ -757,10 +754,10 @@ export class TableFilter { this.fltIds.push(inp.id); - Event.add(inp, 'keypress', this.Evt.detectKey.bind(this)); - Event.add(inp, 'keydown', this.Evt.onKeyDown.bind(this)); - Event.add(inp, 'keyup', this.Evt.onKeyUp.bind(this)); - Event.add(inp, 'blur', this.Evt.onInpBlur.bind(this)); + Event.add(inp, 'keypress', (evt) => this.detectKey(evt)); + Event.add(inp, 'keydown', () => this.onKeyDown()); + Event.add(inp, 'keyup', (evt) => this.onKeyUp(evt)); + Event.add(inp, 'blur', () => this.onInpBlur()); } /** @@ -768,22 +765,22 @@ export class TableFilter { * @param {Number} colIndex Column index * @param {DOMElement} container Container DOM element */ - _buildSubmitButton(colIndex, container){ + _buildSubmitButton(colIndex, container) { let externalFltTgtId = this.isExternalFlt ? this.externalFltTgtIds[colIndex] : null; let btn = Dom.create(this.fltTypeInp, - ['id', this.prfxValButton+colIndex+'_'+this.id], + ['id', this.prfxValButton + colIndex + '_' + this.id], ['type', 'button'], ['value', this.btnText]); btn.className = this.btnCssClass; //filter is appended in custom element - if(externalFltTgtId){ + if (externalFltTgtId) { Dom.id(externalFltTgtId).appendChild(btn); } else { container.appendChild(btn); } - Event.add(btn, 'click', ()=> this.filter()); + Event.add(btn, 'click', () => this.filter()); } /** @@ -791,22 +788,22 @@ export class TableFilter { * @param {String} name Name of the feature * @return {Object} */ - feature(name){ + feature(name) { return this.Mod[name]; } /** * Initialise all the extensions defined in the configuration object */ - initExtensions(){ + initExtensions() { let exts = this.extensions; // Set config's publicPath dynamically for Webpack... __webpack_public_path__ = this.basePath; this.emitter.emit('before-loading-extensions', this); - for(let i=0, len=exts.length; i { + require(['./' + modulePath], (mod) => { /* eslint-disable */ let inst = new mod.default(this, ext); /* eslint-enable */ @@ -848,7 +845,7 @@ export class TableFilter { * @param {String} name Name of the extension * @return {Object} Extension instance */ - extension(name){ + extension(name) { return this.ExtRegistry[name]; } @@ -857,20 +854,20 @@ export class TableFilter { * @param {String} name Name of the extension * @return {Boolean} */ - hasExtension(name){ + hasExtension(name) { return !Types.isEmpty(this.ExtRegistry[name]); } /** * Destroy all the extensions defined in the configuration object */ - destroyExtensions(){ + destroyExtensions() { let exts = this.extensions; - for(let i=0, len=exts.length; i'; + this.btnResetCssClass + '" title="Clear filters" />'; //Paging buttons this.btnPrevPageHtml = ''; + this.btnPageCssClass + ' previousPage" title="Previous page" />'; this.btnNextPageHtml = ''; + this.btnPageCssClass + ' nextPage" title="Next page" />'; this.btnFirstPageHtml = ''; + this.btnPageCssClass + ' firstPage" title="First page" />'; this.btnLastPageHtml = ''; + this.btnPageCssClass + ' lastPage" title="Last page" />'; //Loader this.loader = true; @@ -936,40 +933,40 @@ export class TableFilter { * Return stylesheet DOM element for a given theme name * @return {DOMElement} stylesheet element */ - getStylesheet(name='default'){ + getStylesheet(name = 'default') { return Dom.id(this.prfxTf + name); } /** * Destroy filter grid */ - destroy(){ - if(!this._hasGrid){ + destroy() { + if (!this._hasGrid) { return; } let rows = this.tbl.rows, Mod = this.Mod, emitter = this.emitter; - if(this.isExternalFlt && !this.popupFilters){ + if (this.isExternalFlt && !this.popupFilters) { this.removeExternalFlts(); } - if(this.infDiv){ + if (this.infDiv) { this.removeToolbar(); } - if(this.markActiveColumns){ + if (this.markActiveColumns) { this.clearActiveColumns(); - emitter.off(['before-filtering'], ()=> this.clearActiveColumns()); + emitter.off(['before-filtering'], () => this.clearActiveColumns()); emitter.off(['cell-processed'], - (tf, colIndex)=> this.markActiveColumn(colIndex)); + (tf, colIndex) => this.markActiveColumn(colIndex)); } - if(this.hasExtensions){ + if (this.hasExtensions) { this.destroyExtensions(); } this.validateAllRows(); - if(this.fltGrid && !this.gridLayout){ + if (this.fltGrid && !this.gridLayout) { this.fltGridEl = rows[this.filtersRowIndex]; this.tbl.deleteRow(this.filtersRowIndex); } @@ -979,22 +976,22 @@ export class TableFilter { // Destroy modules // TODO: subcribe modules to destroy event instead - Object.keys(Mod).forEach(function(key){ + Object.keys(Mod).forEach(function (key) { var feature = Mod[key]; - if(feature && Types.isFn(feature.destroy)){ + if (feature && Types.isFn(feature.destroy)) { feature.destroy(); } }); // unsubscribe to events - if(this.hasVisibleRows){ - emitter.off(['after-filtering'], ()=> this.enforceVisibility()); + if (this.hasVisibleRows) { + emitter.off(['after-filtering'], () => this.enforceVisibility()); } - if(this.linkedFilters){ - emitter.off(['after-filtering'], ()=> this.linkFilters()); + if (this.linkedFilters) { + emitter.off(['after-filtering'], () => this.linkFilters()); } this.emitter.off(['filter-focus'], - (tf, filter)=> this.setActiveFilterId(filter.id)); + (tf, filter) => this.setActiveFilterId(filter.id)); Dom.removeClass(this.tbl, this.prfxTf); Dom.removeClass(this.tbl, this.prfxResponsive); @@ -1009,54 +1006,54 @@ export class TableFilter { /** * Generate container element for paging, reset button, rows counter etc. */ - setToolbar(){ - if(this.infDiv){ + setToolbar() { + if (this.infDiv) { return; } /*** container div ***/ - let infdiv = Dom.create('div', ['id', this.prfxInfDiv+this.id]); + let infdiv = Dom.create('div', ['id', this.prfxInfDiv + this.id]); infdiv.className = this.infDivCssClass; //custom container - if(this.toolBarTgtId){ + if (this.toolBarTgtId) { Dom.id(this.toolBarTgtId).appendChild(infdiv); } //grid-layout - else if(this.gridLayout){ + else if (this.gridLayout) { let gridLayout = this.Mod.gridLayout; gridLayout.tblMainCont.appendChild(infdiv); infdiv.className = gridLayout.gridInfDivCssClass; } //default location: just above the table - else{ + else { var cont = Dom.create('caption'); cont.appendChild(infdiv); this.tbl.insertBefore(cont, this.tbl.firstChild); } - this.infDiv = Dom.id(this.prfxInfDiv+this.id); + this.infDiv = Dom.id(this.prfxInfDiv + this.id); /*** left div containing rows # displayer ***/ - let ldiv = Dom.create('div', ['id', this.prfxLDiv+this.id]); + let ldiv = Dom.create('div', ['id', this.prfxLDiv + this.id]); ldiv.className = this.lDivCssClass; infdiv.appendChild(ldiv); - this.lDiv = Dom.id(this.prfxLDiv+this.id); + this.lDiv = Dom.id(this.prfxLDiv + this.id); /*** right div containing reset button + nb results per page select ***/ - let rdiv = Dom.create('div', ['id', this.prfxRDiv+this.id]); + let rdiv = Dom.create('div', ['id', this.prfxRDiv + this.id]); rdiv.className = this.rDivCssClass; infdiv.appendChild(rdiv); - this.rDiv = Dom.id(this.prfxRDiv+this.id); + this.rDiv = Dom.id(this.prfxRDiv + this.id); /*** mid div containing paging elements ***/ - let mdiv = Dom.create('div', ['id', this.prfxMDiv+this.id]); + let mdiv = Dom.create('div', ['id', this.prfxMDiv + this.id]); mdiv.className = this.mDivCssClass; infdiv.appendChild(mdiv); - this.mDiv = Dom.id(this.prfxMDiv+this.id); + this.mDiv = Dom.id(this.prfxMDiv + this.id); // emit help initialisation only if undefined - if(Types.isUndef(this.help)){ + if (Types.isUndef(this.help)) { // explicitily set enabled field to true to initialise help by // default, only if setting is undefined this.Mod.help.enabled = true; @@ -1067,8 +1064,8 @@ export class TableFilter { /** * Remove toolbar container element */ - removeToolbar(){ - if(!this.infDiv){ + removeToolbar() { + if (!this.infDiv) { return; } Dom.remove(this.infDiv); @@ -1076,24 +1073,24 @@ export class TableFilter { let tbl = this.tbl; let captions = Dom.tag(tbl, 'caption'); - if(captions.length > 0){ - [].forEach.call(captions, (elm)=> tbl.removeChild(elm)); + if (captions.length > 0) { + [].forEach.call(captions, (elm) => tbl.removeChild(elm)); } } /** * Remove all the external column filters */ - removeExternalFlts(){ - if(!this.isExternalFlt){ + removeExternalFlts() { + if (!this.isExternalFlt) { return; } let ids = this.externalFltTgtIds, len = ids.length; - for(let ct=0; ct { - if(val !== ' '){ - this.setFilterValue(idx, val); - } - }); - this.filter(); - } - /** * Filter the table by retrieving the data from each cell in every single * row and comparing it to the search term for current column. A row is * hidden when all the search terms are not found in inspected row. */ - filter(){ - if(!this.fltGrid || !this._hasGrid){ + filter() { + if (!this.fltGrid || !this._hasGrid) { return; } //invoke onbefore callback - if(this.onBeforeFilter){ + if (this.onBeforeFilter) { this.onBeforeFilter.call(null, this); } this.emitter.emit('before-filtering', this); @@ -1199,26 +1179,26 @@ export class TableFilter { re_re = new RegExp(Str.rgxEsc(this.rgxOperator)); //keyword highlighting - function highlight(str, ok, cell){ + function highlight(str, ok, cell) { /*jshint validthis:true */ - if(this.highlightKeywords && ok){ + if (this.highlightKeywords && ok) { str = str.replace(re_lk, ''); str = str.replace(re_eq, ''); str = str.replace(re_st, ''); str = str.replace(re_en, ''); let w = str; - if(re_le.test(str) || re_ge.test(str) || re_l.test(str) || - re_g.test(str) || re_d.test(str)){ + if (re_le.test(str) || re_ge.test(str) || re_l.test(str) || + re_g.test(str) || re_d.test(str)) { w = Dom.getText(cell); } - if(w !== ''){ + if (w !== '') { this.emitter.emit('highlight-keyword', this, cell, w); } } } //looks for search argument in current row - function hasArg(sA, cellData, j){ + function hasArg(sA, cellData, j) { /*jshint validthis:true */ sA = Str.matchCase(sA, this.caseSensitive); @@ -1242,67 +1222,67 @@ export class TableFilter { //Search arg dates tests let isLDate = hasLO && - DateHelper.isValid(sA.replace(re_l,''), dtType); + DateHelper.isValid(sA.replace(re_l, ''), dtType); let isLEDate = hasLE && - DateHelper.isValid(sA.replace(re_le,''), dtType); + DateHelper.isValid(sA.replace(re_le, ''), dtType); let isGDate = hasGR && - DateHelper.isValid(sA.replace(re_g,''), dtType); + DateHelper.isValid(sA.replace(re_g, ''), dtType); let isGEDate = hasGE && - DateHelper.isValid(sA.replace(re_ge,''), dtType); + DateHelper.isValid(sA.replace(re_ge, ''), dtType); let isDFDate = hasDF && - DateHelper.isValid(sA.replace(re_d,''), dtType); + DateHelper.isValid(sA.replace(re_d, ''), dtType); let isEQDate = hasEQ && - DateHelper.isValid(sA.replace(re_eq,''), dtType); + DateHelper.isValid(sA.replace(re_eq, ''), dtType); let dte1, dte2; //dates - if(DateHelper.isValid(cellData, dtType)){ + if (DateHelper.isValid(cellData, dtType)) { dte1 = DateHelper.format(cellData, dtType); // lower date - if(isLDate){ - dte2 = DateHelper.format(sA.replace(re_l,''), dtType); + if (isLDate) { + dte2 = DateHelper.format(sA.replace(re_l, ''), dtType); occurence = dte1 < dte2; } // lower equal date - else if(isLEDate){ - dte2 = DateHelper.format(sA.replace(re_le,''), dtType); + else if (isLEDate) { + dte2 = DateHelper.format(sA.replace(re_le, ''), dtType); occurence = dte1 <= dte2; } // greater equal date - else if(isGEDate){ - dte2 = DateHelper.format(sA.replace(re_ge,''), dtType); + else if (isGEDate) { + dte2 = DateHelper.format(sA.replace(re_ge, ''), dtType); occurence = dte1 >= dte2; } // greater date - else if(isGDate){ - dte2 = DateHelper.format(sA.replace(re_g,''), dtType); + else if (isGDate) { + dte2 = DateHelper.format(sA.replace(re_g, ''), dtType); occurence = dte1 > dte2; } // different date - else if(isDFDate){ - dte2 = DateHelper.format(sA.replace(re_d,''), dtType); + else if (isDFDate) { + dte2 = DateHelper.format(sA.replace(re_d, ''), dtType); occurence = dte1.toString() != dte2.toString(); } // equal date - else if(isEQDate){ - dte2 = DateHelper.format(sA.replace(re_eq,''), dtType); + else if (isEQDate) { + dte2 = DateHelper.format(sA.replace(re_eq, ''), dtType); occurence = dte1.toString() == dte2.toString(); } // searched keyword with * operator doesn't have to be a date - else if(re_lk.test(sA)){// like date - occurence = Str.contains(sA.replace(re_lk,''), cellData, + else if (re_lk.test(sA)) {// like date + occurence = Str.contains(sA.replace(re_lk, ''), cellData, false, this.caseSensitive); } - else if(DateHelper.isValid(sA,dtType)){ - dte2 = DateHelper.format(sA,dtType); + else if (DateHelper.isValid(sA, dtType)) { + dte2 = DateHelper.format(sA, dtType); occurence = dte1.toString() === dte2.toString(); } //empty - else if(hasEM){ + else if (hasEM) { occurence = Str.isEmpty(cellData); } //non-empty - else if(hasNM){ + else if (hasNM) { occurence = !Str.isEmpty(cellData); } else { occurence = Str.contains(sA, cellData, this.isExactMatch(j), @@ -1310,15 +1290,15 @@ export class TableFilter { } } - else{ + else { //first numbers need to be formated - if(this.hasColNbFormat && this.colNbFormat[j]){ + if (this.hasColNbFormat && this.colNbFormat[j]) { numCellData = removeNbFormat( cellData, this.colNbFormat[j]); nbFormat = this.colNbFormat[j]; } else { - if(this.thousandsSeparator === ',' && - this.decimalSeparator === '.'){ + if (this.thousandsSeparator === ',' && + this.decimalSeparator === '.') { numCellData = removeNbFormat(cellData, 'us'); nbFormat = 'us'; } else { @@ -1330,71 +1310,71 @@ export class TableFilter { // first checks if there is any operator (<,>,<=,>=,!,*,=,{,}, // rgx:) // lower equal - if(hasLE){ + if (hasLE) { occurence = numCellData <= removeNbFormat( sA.replace(re_le, ''), nbFormat); } //greater equal - else if(hasGE){ + else if (hasGE) { occurence = numCellData >= removeNbFormat( sA.replace(re_ge, ''), nbFormat); } //lower - else if(hasLO){ + else if (hasLO) { occurence = numCellData < removeNbFormat( sA.replace(re_l, ''), nbFormat); } //greater - else if(hasGR){ + else if (hasGR) { occurence = numCellData > removeNbFormat( sA.replace(re_g, ''), nbFormat); } //different - else if(hasDF){ + else if (hasDF) { occurence = Str.contains(sA.replace(re_d, ''), cellData, false, this.caseSensitive) ? false : true; } //like - else if(hasLK){ + else if (hasLK) { occurence = Str.contains(sA.replace(re_lk, ''), cellData, false, this.caseSensitive); } //equal - else if(hasEQ){ + else if (hasEQ) { occurence = Str.contains(sA.replace(re_eq, ''), cellData, true, this.caseSensitive); } //starts with - else if(hasST){ + else if (hasST) { occurence = cellData.indexOf(sA.replace(re_st, '')) === 0 ? true : false; } //ends with - else if(hasEN){ + else if (hasEN) { let searchArg = sA.replace(re_en, ''); occurence = - cellData.lastIndexOf(searchArg, cellData.length-1) === - (cellData.length-1)-(searchArg.length-1) && - cellData.lastIndexOf( - searchArg, cellData.length-1) > -1 ? true : false; + cellData.lastIndexOf(searchArg, cellData.length - 1) === + (cellData.length - 1) - (searchArg.length - 1) && + cellData.lastIndexOf(searchArg, cellData.length - 1) + > -1 ? true : false; } //empty - else if(hasEM){ + else if (hasEM) { occurence = Str.isEmpty(cellData); } //non-empty - else if(hasNM){ + else if (hasNM) { occurence = !Str.isEmpty(cellData); } //regexp - else if(hasRE){ + else if (hasRE) { //in case regexp fires an exception - try{ + try { //operator is removed - let srchArg = sA.replace(re_re,''); + let srchArg = sA.replace(re_re, ''); let rgx = new RegExp(srchArg); occurence = rgx.test(cellData); - } catch(e) { occurence = false; } + } catch (e) { occurence = false; } } else { occurence = Str.contains(sA, cellData, this.isExactMatch(j), this.caseSensitive); @@ -1404,7 +1384,7 @@ export class TableFilter { return occurence; }//fn - for(let k=this.refRow; k 1; //detect operators or array query - if(Types.isArray(sA) || hasMultiOrSA || hasMultiAndSA){ + if (Types.isArray(sA) || hasMultiOrSA || hasMultiAndSA) { let cS, s, occur = false; - if(Types.isArray(sA)){ + if (Types.isArray(sA)) { s = sA; } else { s = hasMultiOrSA ? sAOrSplit : sAAndSplit; } // TODO: improve clarity/readability of this block - for(let w=0, len=s.length; w 0){ + if (exclude.length > 0) { isExludedRow = exclude.indexOf(i) != -1; } let cell = row[i].cells, nchilds = cell.length; // checks if row has exact cell # and is not excluded - if(nchilds === this.nbCells && !isExludedRow){ + if (nchilds === this.nbCells && !isExludedRow) { // this loop retrieves cell data - for(let j=0; j 0 ? fltValues : ''; } //checklist - else if(fltColType === this.fltTypeCheckList){ + else if (fltColType === this.fltTypeCheckList) { // TODO: extract a method in checklist module from below - if(flt.getAttribute('value') !== null){ + if (flt.getAttribute('value') !== null) { fltValues = flt.getAttribute('value'); //removes last operator || - fltValues = fltValues.substr(0, fltValues.length-3); + fltValues = fltValues.substr(0, fltValues.length - 3); //convert || separated values into array fltValues = fltValues.split(' ' + this.orOperator + ' '); } @@ -1606,8 +1586,8 @@ export class TableFilter { fltValue = fltValues.length > 0 ? fltValues : ''; } //return an empty string if collection contains a single empty string - if(Types.isArray(fltValue) && fltValue.length === 1 && - fltValue[0] === ''){ + if (Types.isArray(fltValue) && fltValue.length === 1 && + fltValue[0] === '') { fltValue = ''; } return fltValue; @@ -1617,14 +1597,14 @@ export class TableFilter { * Return the filters' values * @return {Array} List of filters' values */ - getFiltersValue(){ - if(!this.fltGrid){ + getFiltersValue() { + if (!this.fltGrid) { return; } let searchArgs = []; - for(let i=0, len=this.fltIds.length; i 0; let frag = !tblHasColTag ? doc.createDocumentFragment() : null; - for(let k=0; k nrows - if(row <= this.nbRows){ + if (row <= this.nbRows) { this.validateRow(row, true); } } @@ -1987,23 +1967,23 @@ export class TableFilter { /** * Clear all the filters' values */ - clearFilters(){ - if(!this.fltGrid){ + clearFilters() { + if (!this.fltGrid) { return; } this.emitter.emit('before-clearing-filters', this); - if(this.onBeforeReset){ + if (this.onBeforeReset) { this.onBeforeReset.call(null, this, this.getFiltersValue()); } - for(let i=0, len=this.fltIds.length; i IE onload event works only for scripts, not for stylesheets - file.onload = file.onreadystatechange = function(){ - if(!isLoaded && + file.onload = file.onreadystatechange = function () { + if (!isLoaded && (!this.readyState || this.readyState === 'loaded' || - this.readyState === 'complete')){ + this.readyState === 'complete')) { isLoaded = true; - if(typeof callback === 'function'){ + if (typeof callback === 'function') { callback.call(null, o); } } }; - file.onerror = function(){ - throw new Error('TF script could not load: ' + filePath); + file.onerror = function () { + throw new Error('TableFilter could not load: ' + filePath); }; head.appendChild(file); } @@ -2210,7 +2189,7 @@ export class TableFilter { * Check if table has filters grid * @return {Boolean} */ - hasGrid(){ + hasGrid() { return this._hasGrid; } @@ -2218,7 +2197,7 @@ export class TableFilter { * Get list of filter IDs * @return {[type]} [description] */ - getFiltersId(){ + getFiltersId() { return this.fltIds || []; } @@ -2227,21 +2206,21 @@ export class TableFilter { * @param {Boolean} reCalc Force calculation of filtered rows list * @return {Array} List of row indexes */ - getValidRows(reCalc){ - if(!reCalc){ + getValidRows(reCalc) { + if (!reCalc) { return this.validRowsIndex; } this.validRowsIndex = []; - for(let k=this.refRow; k