diff --git a/dist/starter.html b/dist/starter.html index 593664dd..9fde2988 100644 --- a/dist/starter.html +++ b/dist/starter.html @@ -1,10 +1,10 @@ - tablefilter v0.1.9 - Starter + tablefilter v0.1.10 - Starter -

tablefilter v0.1.9

+

tablefilter v0.1.10

diff --git a/dist/tablefilter/style/colsVisibility.css b/dist/tablefilter/style/colsVisibility.css index 75e36c5a..72d50c0f 100644 --- a/dist/tablefilter/style/colsVisibility.css +++ b/dist/tablefilter/style/colsVisibility.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * 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 ca44aa46..e9783ddf 100644 --- a/dist/tablefilter/style/filtersVisibility.css +++ b/dist/tablefilter/style/filtersVisibility.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * 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 001de758..a1195aa3 100644 --- a/dist/tablefilter/style/tablefilter.css +++ b/dist/tablefilter/style/tablefilter.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * 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 86d8a500..9f0c508e 100644 --- a/dist/tablefilter/style/themes/default/default.css +++ b/dist/tablefilter/style/themes/default/default.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * MIT License */ table.TF{border-left:1px solid #ccc !important;border-top:none !important;border-right:none !important;border-bottom:none !important;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important;color:#333 !important}table.TF td{border-bottom:1px dotted #999 !important;padding:5px !important}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important} \ No newline at end of file diff --git a/dist/tablefilter/style/themes/mytheme/mytheme.css b/dist/tablefilter/style/themes/mytheme/mytheme.css index d666fc81..4d84da9b 100644 --- a/dist/tablefilter/style/themes/mytheme/mytheme.css +++ b/dist/tablefilter/style/themes/mytheme/mytheme.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * MIT License */ table.TF{border-left:1px dotted #81963b !important;border-top:none !important;border-right:0 !important;border-bottom:none !important;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;color:#fff !important}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px !important}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important} \ No newline at end of file diff --git a/dist/tablefilter/style/themes/skyblue/skyblue.css b/dist/tablefilter/style/themes/skyblue/skyblue.css index a001f9f7..7835c66d 100644 --- a/dist/tablefilter/style/themes/skyblue/skyblue.css +++ b/dist/tablefilter/style/themes/skyblue/skyblue.css @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.388Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.361Z * 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 bd54c2a1..9f8cbe2f 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,10 +1,10 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.304Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.275Z * MIT License */ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,function(){return function(t){function e(i){if(s[i])return s[i].exports;var n=s[i]={exports:{},id:i,loaded:!1};return t[i].call(n.exports,n,n.exports,e),n.loaded=!0,n.exports}var i=window.webpackJsonp;window.webpackJsonp=function(s,l){for(var r,a,o=0,u=[];or;r++)s[r]=arguments[r];if(0!==s.length){if(this.id=null,this.version="0.1.9",this.year=(new Date).getFullYear(),this.tbl=null,this.startRow=null,this.refRow=null,this.headersRow=null,this.cfg={},this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this._hasGrid=!1,s.forEach(function(t){var i="undefined"==typeof t?"undefined":n(t);"object"===i&&t&&"TABLE"===t.nodeName?(e.tbl=t,e.id=t.id||"tf_"+(new Date).getTime()+"_"):"string"===i?(e.id=t,e.tbl=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 y.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(u){this.nbCells=this.getCellsNb(0)}this.basePath=a.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=a.grid===!1?!1:!0,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.searchArgs=null,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?!1:!0,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?!1:!0,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.activeFlt=null,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?!1:!0,this.sortSlc=a.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(a.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?a.sort_num_asc:null,this.isSortNumDesc=Boolean(a.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?a.sort_num_desc:null,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.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.rememberGridValues=Boolean(a.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&a.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&a.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,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.Mod={},this.ExtRegistry={},this.Evt={detectKey:function(t){if(this.enterKey&&t){var e=o["default"].keyCode(t);13===e?(this.filter(),o["default"].cancel(t),o["default"].stop(t)):(this.isUserTyping=!0,L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyUp:function(t){function e(){L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=o["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=L.setInterval(e.bind(this),this.autoFilterDelay)):(L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,L.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},onInpFocus:function(t){var e=o["default"].target(t);this.activeFilterId=e.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.emitter.emit("filter-focus",this)}}}}return r(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),e.help||(e.help=new S.Help(this)),this.help&&e.help.init(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(e.store||(e.store=new _.Store(this)),e.store.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new C.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new w.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new x.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new k.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;i>l;l++){this.emitter.emit("before-filter-init",this,l);var r=h["default"].create(this.fltCellTag),a=this.getFilterType(l);this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||n.appendChild(r),s=l==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(l,this.isExternalFlt,r)):a===this.fltTypeCheckList?(e.checkList||(e.checkList=new P.CheckList(this)),e.checkList.init(l,this.isExternalFlt,r)):this._buildInputFilter(l,s,r),l==i-1&&this.displayBtn&&this._buildSubmitButton(l,r),this.emitter.emit("after-filter-init",this,l)}}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new R.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new F.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new I.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new O.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 N.NoResults(this)),e.noResults.init()),this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.initialized=!0,this.emitter.emit("initialized",this)}}},{key:"_insertFiltersRow",value: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),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&this.headersRow++,t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}}},{key:"_initNoFilters",value:function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)}},{key:"_buildInputFilter",value:function(t,e,i){var s=this.getFilterType(t),n=this.isExternalFlt?this.externalFltTgtIds[t]:null,l=s===this.fltTypeInp?"text":"hidden",r=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",l],["ct",t]);"hidden"!==l&&this.watermark&&r.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),r.className=e||this.fltCssClass,o["default"].add(r,"focus",this.Evt.onInpFocus.bind(this)),n?(h["default"].id(n).appendChild(r),this.externalFltEls.push(r)):i.appendChild(r),this.fltIds.push(r.id),o["default"].add(r,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(r,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(r,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(r,"blur",this.Evt.onInpBlur.bind(this))}},{key:"_buildSubmitButton",value: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),o["default"].add(n,"click",function(){return i.filter()})}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,l=void 0;s&&n?l=t.path+s:(s=s.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(26)("./"+l)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}}},{key:"extension",value:function(t){return this.ExtRegistry[t]}},{key:"hasExtension",value:function(t){return!p["default"].isEmpty(this.ExtRegistry[t])}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}}},{key:"loadThemes",value:function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(p["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],l=n.name,r=n.path,a=this.prfxTf+l;l&&!r?r=this.themesPath+l+"/"+l+".css":!l&&n.path&&(l="theme{0}".replace("{0}",i)),this.isImported(r,"link")||this["import"](a,r,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)}},{key:"getStylesheet",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return h["default"].id(this.prfxTf+t)}},{key:"destroy",value:function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod,s=this.emitter;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.markActiveColumns&&(this.clearActiveColumns(),s.off(["before-filtering"],function(){return t.clearActiveColumns()}),s.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions(),this.validateAllRows(),this.fltGrid&&!this.gridLayout&&(this.fltGridEl=e[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),s.emit("destroy",this),Object.keys(i).forEach(function(t){var e=i[t];e&&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()}),h["default"].removeClass(this.tbl,this.prfxTf),this.nbHiddenRows=0,this.validRowsIndex=[],this.fltIds=[],this.activeFlt=null,this._hasGrid=!1,this.initialized=!1}}},{key:"setToolbar",value:function(){if(!this.infDiv){var t=h["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)h["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.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 l=h["default"].create("div",["id",this.prfxMDiv+this.id]);l.className=this.mDivCssClass,t.appendChild(l),this.mDiv=h["default"].id(this.prfxMDiv+this.id),p["default"].isUndef(this.help)&&this.emitter.emit("init-help",this)}}},{key:"removeToolbar",value: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)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=h["default"].id(s);n&&(n.innerHTML="")}}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(!p["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],l=i.indexOf(t),r=e.values[l],a=e.texts[l],o=e.sorts[l],u=0,h=r.length;h>u;u++)n.push(r[u]),a[u]?s.push(a[u]):s.push(r[u]);return o&&(n.sort(),s.sort()),[n,s]}}},{key:"resetValues",value:function(){var t=this;if(this.rememberGridValues){var e=this.Mod.store.getFilterValues(this.fltsValuesCookie);e.forEach(function(e,i){" "!==e&&t.setFilterValue(i,e)}),this.filter()}}},{key:"filter",value:function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(c,""),t=t.replace(g,""),t=t.replace(b,""),t=t.replace(y,"");var s=t;(r.test(t)||a.test(t)||o.test(t)||u.test(t)||f.test(t))&&(s=h["default"].getText(i)),""!==s&&this.emitter.emit("highlight-keyword",this,i,s)}}function e(t,e,i){t=d["default"].matchCase(t,this.caseSensitive);var s=void 0,h=m["default"].removeNbFormat,p=o.test(t),x=r.test(t),k=u.test(t),T=a.test(t),P=f.test(t),R=g.test(t),F=c.test(t),I=b.test(t),O=y.test(t),E=_===t,N=C===t,L=w.test(t),D=p&&v["default"].isValid(t.replace(o,""),S),B=x&&v["default"].isValid(t.replace(r,""),S),M=k&&v["default"].isValid(t.replace(u,""),S),A=T&&v["default"].isValid(t.replace(a,""),S),H=P&&v["default"].isValid(t.replace(f,""),S),j=R&&v["default"].isValid(t.replace(g,""),S),V=void 0,U=void 0;if(v["default"].isValid(e,S))V=v["default"].format(e,S),D?(U=v["default"].format(t.replace(o,""),S),s=U>V):B?(U=v["default"].format(t.replace(r,""),S),s=U>=V):A?(U=v["default"].format(t.replace(a,""),S),s=V>=U):M?(U=v["default"].format(t.replace(u,""),S),s=V>U):H?(U=v["default"].format(t.replace(f,""),S),s=V.toString()!=U.toString()):j?(U=v["default"].format(t.replace(g,""),S),s=V.toString()==U.toString()):c.test(t)?s=d["default"].contains(t.replace(c,""),e,!1,this.caseSensitive):v["default"].isValid(t,S)?(U=v["default"].format(t,S),s=V.toString()===U.toString()):s=E?d["default"].isEmpty(e):N?!d["default"].isEmpty(e):d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(n=h(e,this.colNbFormat[i]),l=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(n=h(e,"us"),l="us"):(n=h(e,"eu"),l="eu"),x)s=n<=h(t.replace(r,""),l);else if(T)s=n>=h(t.replace(a,""),l);else if(p)s=nh(t.replace(u,""),l);else if(P)s=d["default"].contains(t.replace(f,""),e,!1,this.caseSensitive)?!1:!0;else if(F)s=d["default"].contains(t.replace(c,""),e,!1,this.caseSensitive);else if(R)s=d["default"].contains(t.replace(g,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(b,""))?!0:!1;else if(O){var z=t.replace(y,"");s=e.lastIndexOf(z,e.length-1)===e.length-1-(z.length-1)&&e.lastIndexOf(z,e.length-1)>-1?!0:!1}else if(E)s=d["default"].isEmpty(e);else if(N)s=!d["default"].isEmpty(e);else if(L)try{var W=t.replace(w,""),G=new RegExp(W);s=G.test(e)}catch($){s=!1}else s=d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&this._hasGrid){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=0;this.validRowsIndex=[],this.searchArgs=this.getFiltersValue();for(var n,l,r=new RegExp(this.leOperator),a=new RegExp(this.geOperator),o=new RegExp(this.lwOperator),u=new RegExp(this.grOperator),f=new RegExp(this.dfOperator),c=new RegExp(d["default"].rgxEsc(this.lkOperator)),g=new RegExp(this.eqOperator),b=new RegExp(this.stOperator),y=new RegExp(this.enOperator),_=this.emOperator,C=this.nmOperator,w=new RegExp(d["default"].rgxEsc(this.rgxOperator)),x=this.refRow;xI;I++){var O=this.searchArgs[this.singleSearchFlt?0:I],S=this.hasColDateType?this.colDateType[I]:this.defaultDateType;if(""!==O){var E=d["default"].matchCase(this.getCellData(k[I]),this.caseSensitive),N=O.toString().split(this.orOperator),L=N.length>1,D=O.toString().split(this.anOperator),B=D.length>1;if(p["default"].isArray(O)||L||B){var M=void 0,A=void 0,H=!1;A=p["default"].isArray(O)?O:L?N:D;for(var j=0,V=A.length;V>j&&(M=d["default"].trim(A[j]),H=e.call(this,M,E,I),t.call(this,M,H,k[I]),!(L&&H||B&&!H))&&(!p["default"].isArray(O)||!H);j++);P[I]=H}else P[I]=e.call(this,d["default"].trim(O),E,I),t.call(this,O,P[I],k[I]);P[I]||(R=!1),this.singleSearchFlt&&P[I]&&(F=!0),this.emitter.emit("cell-processed",this,I,k[I])}}this.singleSearchFlt&&F&&(R=!0),R?this.validateRow(x,!0):(this.validateRow(x,!1),s++),this.emitter.emit("row-processed",this,x,this.validRowsIndex.length,R)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=s,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this)}}},{key:"getColValues",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var r=this.refRow;r0&&(a=-1!=s.indexOf(r));var o=n[r].cells,u=o.length;if(u===this.nbCells&&!a)for(var h=0;u>h;h++)if(h==t&&""===n[r].style.display){var f=this.getCellData(o[h]),d=this.colNbFormat?this.colNbFormat[t]:null,c=i?m["default"].removeNbFormat(f,d):f;l.push(c)}}return l}}},{key:"getFilterValue",value: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 l=0,r=s.options.length;r>l;l++)s.options[l].selected&&i.push(s.options[l].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}}},{key:"getFiltersValue",value: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(d["default"].trim(s))}return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var i=[],s=0,n=this.fltIds.length;n>s;s++){var l=this.getFilterType(s);if(l===d["default"].lower(t)){var r=e?s:this.fltIds[s];i.push(r)}}return i}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return h["default"].id(e)}},{key:"getCellsNb",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=p["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)}},{key:"getCellData",value:function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):h["default"].getText(t)}},{key:"getTableData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.refRow;lo;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var h=this.getCellData(a[o]);r[1].push(h)}s.push(r)}return s}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.getValidRows(!0),r=0;rn;n++){var r=i[n],a=r[1],o=a[t];s.push(o)}return s}},{key:"getRowDisplay",value:function(t){return p["default"].isObj(t)?t.style.display:null}},{key:"validateRow",value:function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;t0,l=n?null:D.createDocumentFragment(),r=0;t>r;r++){var a=void 0;n?a=s[r]:(a=h["default"].create("col",["id",this.id+"_col_"+r]),l.appendChild(a)),a.style.width=i[r]}n||e.insertBefore(l,e.firstChild)}if(this.hasColWidths){e=e||this.tbl;var s=void 0;s=void 0===t?"none"!=e.rows[0].style.display?0:1:t,i.call(this)}}},{key:"enforceVisibility",value:function(){if(this.hasVisibleRows)for(var t=0,e=this.visibleRows.length;e>t;t++){var i=this.visibleRows[t];i<=this.nbRows&&this.validateRow(i,!0)}}},{key:"clearFilters",value:function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.filter(),this.onAfterReset&&this.onAfterReset.call(null,this),this.emitter.emit("after-clearing-filters",this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"markActiveColumn",value: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))}},{key:"linkFilters",value:function(){if(this.linkedFilters&&this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),i=this.getFiltersByType(this.fltTypeCheckList,!0),s=t.concat(e); -s=s.concat(i);var n=this.activeFilterId.split("_")[0];n=n.split(this.prfxFlt)[1];for(var l=void 0,r=0,a=s.length;a>r;r++){var o=h["default"].id(this.fltIds[s[r]]);if(l=this.getFilterValue(s[r]),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]))||l===this.displayAllText){if(-1!=i.indexOf(s[r])?this.Mod.checkList.checkListDiv[s[r]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var u=h["default"].createOpt(this.displayAllText,"");o&&o.appendChild(u)}-1!=i.indexOf(s[r])?this.emitter.emit("build-checklist-filter",this,s[r],this.isExternalFlt):this.emitter.emit("build-select-filter",this,s[r],!0,this.isExternalFlt),this.setFilterValue(s[r],l)}}}}},{key:"isExactMatch",value:function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp}},{key:"isImported",value:function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",l=h["default"].tag(D,s),r=0,a=l.length;a>r;r++)if(void 0!==l[r][n]&&l[r][n].match(t)){i=!0;break}return i}},{key:"import",value:function(t,e,i,s){var n=s?s:"script",l=this.isImported(e,n);if(!l){var r=this,a=!1,o=void 0,u=h["default"].tag(D,"head")[0];o="link"===d["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,r))},o.onerror=function(){throw new Error("TF script could not load: "+e)},u.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},getFirstTextNode:function(t){for(var e=0;e1)for(var n=0;n2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var l=t.split(RegExp.$1),r=void 0,a=void 0,o=void 0;r="M"===e.substring(0,1)?l[0]:"M"===e.substring(1,2)?l[1]:l[2],a="D"===e.substring(0,1)?l[0]:"D"===e.substring(1,2)?l[1]:l[2],o="Y"===e.substring(0,1)?l[0]:"Y"===e.substring(1,2)?l[1]:l[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var u=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=u.getDate()?!1:parseInt(r,10)-1!=u.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(l[2]),s(l[1])-1,l[0]);break;case"DMY":l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0]);break;case"MDY":l=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[0]-1,l[1]);break;case"YMD":l=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(l[0]),l[1]-1,l[2]);break;default:l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===l["default"].lower(e)?+i.replace(/[^\d\.-]/g,""):+i.replace(/[^\d\,-]/g,"").replace(",",".")}}}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(t,e){for(var i=0;i0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var l=s.indexOf(";",n);-1===l&&(l=s.length),e=unescape(s.substring(n,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var i=this.read(t),s=i.split(e);return s},getValueByIndex:function(t,e,i){i||(i=",");var s=this.valueToArray(t,i);return s[e]}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i0&&s.removeChild(P[0]),this.headTbl.style.tableLayout="fixed",s.style.tableLayout="fixed",this.headTbl.cellPadding=s.cellPadding,this.headTbl.cellSpacing=s.cellSpacing,e.setColWidths(0,this.headTbl),s.style.width="",this.headTbl.style.width=s.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var i=p["default"].target(e),s=i.scrollLeft;t.headTblCont.scrollLeft=s});var R=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=g),this.tblHasColTag=h["default"].tag(s,"col").length>0?!0:!1;var F=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',e.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",e.onBeforePopUpOpen=h["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,e.onAfterPopUpOpen=h["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,e.onBeforePopUpClose=h["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,e.onAfterPopUpClose=h["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,e.popUpFltSpans=[],e.popUpFltImgs=[],e.popUpFltElms=e.popUpFltElmCache||[],e.popUpFltAdjustToContainer=!0,e.prfxPopUpSpan="popUpSpan_",e.prfxPopUpDiv="popUpDiv_",e}return r(i,e),a(i,[{key:"onClick",value:function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[n],r=this.tf.getHeaderElement(n),a=.95*r.clientWidth;l.style.width=parseInt(a,10)+"px"}p["default"].cancel(i),p["default"].stop(i)}},{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;ir;r++)s[r]=arguments[r];if(0!==s.length){if(this.id=null,this.version="0.1.10",this.year=(new Date).getFullYear(),this.tbl=null,this.startRow=null,this.refRow=null,this.headersRow=null,this.cfg={},this.nbFilterableRows=null,this.nbRows=null,this.nbCells=null,this._hasGrid=!1,s.forEach(function(t){var i="undefined"==typeof t?"undefined":n(t);"object"===i&&t&&"TABLE"===t.nodeName?(e.tbl=t,e.id=t.id||"tf_"+(new Date).getTime()+"_"):"string"===i?(e.id=t,e.tbl=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 y.Emitter,this.refRow=null===this.startRow?2:this.startRow+1;try{this.nbCells=this.getCellsNb(this.refRow)}catch(u){this.nbCells=this.getCellsNb(0)}this.basePath=a.base_path||"tablefilter/",this.fltTypeInp="input",this.fltTypeSlc="select",this.fltTypeMulti="multiple",this.fltTypeCheckList="checklist",this.fltTypeNone="none",this.fltGrid=a.grid===!1?!1:!0,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?!1:!0,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?!1:!0,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.activeFlt=null,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?!1:!0,this.sortSlc=a.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(a.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?a.sort_num_asc:null,this.isSortNumDesc=Boolean(a.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?a.sort_num_desc:null,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.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.rememberGridValues=Boolean(a.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&a.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&a.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,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.Mod={},this.ExtRegistry={},this.Evt={detectKey:function(t){if(this.enterKey&&t){var e=o["default"].keyCode(t);13===e?(this.filter(),o["default"].cancel(t),o["default"].stop(t)):(this.isUserTyping=!0,L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyUp:function(t){function e(){L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var i=o["default"].keyCode(t);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=L.setInterval(e.bind(this),this.autoFilterDelay)):(L.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,L.clearInterval(this.autoFilterTimer)),this.emitter.emit("filter-blur",this)},onInpFocus:function(t){var e=o["default"].target(t);this.activeFilterId=e.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.emitter.emit("filter-focus",this)}}}}return r(t,[{key:"init",value:function(){var t=this;if(!this._hasGrid){var e=this.Mod,i=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this.loadThemes(),e.help||(e.help=new S.Help(this)),this.help&&e.help.init(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(e.store||(e.store=new _.Store(this)),e.store.init()),this.gridLayout&&(e.gridLayout||(e.gridLayout=new C.GridLayout(this)),e.gridLayout.init()),this.loader&&(e.loader||(e.loader=new w.Loader(this)),e.loader.init()),this.highlightKeywords&&(e.highlightKeyword=new x.HighlightKeyword(this),e.highlightKeyword.init()),this.popupFilters&&(e.popupFilter||(e.popupFilter=new k.PopupFilter(this)),e.popupFilter.init()),this.fltGrid){var n=this._insertFiltersRow();this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var l=0;i>l;l++){this.emitter.emit("before-filter-init",this,l);var r=h["default"].create(this.fltCellTag),a=this.getFilterType(l);this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||n.appendChild(r),s=l==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(l,this.isExternalFlt,r)):a===this.fltTypeCheckList?(e.checkList||(e.checkList=new P.CheckList(this)),e.checkList.init(l,this.isExternalFlt,r)):this._buildInputFilter(l,s,r),l==i-1&&this.displayBtn&&this._buildSubmitButton(l,r),this.emitter.emit("after-filter-init",this,l)}}else this._initNoFilters();this.hasVisibleRows&&(this.emitter.on(["after-filtering"],function(){return t.enforceVisibility()}),this.enforceVisibility()),this.rowsCounter&&(e.rowsCounter=new R.RowsCounter(this),e.rowsCounter.init()),this.statusBar&&(e.statusBar=new F.StatusBar(this),e.statusBar.init()),this.paging&&(e.paging?e.paging.reset():(e.paging=new I.Paging(this),e.paging.init())),this.btnReset&&(e.clearButton=new O.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 N.NoResults(this)),e.noResults.init()),this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.hasExtensions&&this.initExtensions(),this.markActiveColumns&&(this.emitter.on(["before-filtering"],function(){return t.clearActiveColumns()}),this.emitter.on(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.linkedFilters&&this.emitter.on(["after-filtering"],function(){return t.linkFilters()}),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this),this.initialized=!0,this.emitter.emit("initialized",this)}}},{key:"_insertFiltersRow",value: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),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&this.headersRow++,t.className=this.fltsRowCssClass,this.isExternalFlt&&(t.style.display="none"),this.emitter.emit("filters-row-inserted",this,t),t}}},{key:"_initNoFilters",value:function(){this.fltGrid||(this.refRow=this.refRow>0?this.refRow-1:0,this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow)}},{key:"_buildInputFilter",value:function(t,e,i){var s=this.getFilterType(t),n=this.isExternalFlt?this.externalFltTgtIds[t]:null,l=s===this.fltTypeInp?"text":"hidden",r=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+t+"_"+this.id],["type",l],["ct",t]);"hidden"!==l&&this.watermark&&r.setAttribute("placeholder",this.isWatermarkArray?this.watermark[t]||"":this.watermark),r.className=e||this.fltCssClass,o["default"].add(r,"focus",this.Evt.onInpFocus.bind(this)),n?(h["default"].id(n).appendChild(r),this.externalFltEls.push(r)):i.appendChild(r),this.fltIds.push(r.id),o["default"].add(r,"keypress",this.Evt.detectKey.bind(this)),o["default"].add(r,"keydown",this.Evt.onKeyDown.bind(this)),o["default"].add(r,"keyup",this.Evt.onKeyUp.bind(this)),o["default"].add(r,"blur",this.Evt.onInpBlur.bind(this))}},{key:"_buildSubmitButton",value: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),o["default"].add(n,"click",function(){return i.filter()})}},{key:"feature",value:function(t){return this.Mod[t]}},{key:"initExtensions",value:function(){var t=this.extensions;i.p=this.basePath,this.emitter.emit("before-loading-extensions",this);for(var e=0,s=t.length;s>e;e++){var n=t[e];this.ExtRegistry[n.name]||this.loadExtension(n)}this.emitter.emit("after-loading-extensions",this)}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var s=t.name,n=t.path,l=void 0;s&&n?l=t.path+s:(s=s.replace(".js",""),l="extensions/{}/{}".replace(/{}/g,s)),i.e(1,function(i){var n=[i(26)("./"+l)];(function(i){var n=new i["default"](e,t);n.init(),e.ExtRegistry[s]=n}).apply(null,n)})}}},{key:"extension",value:function(t){return this.ExtRegistry[t]}},{key:"hasExtension",value:function(t){return!p["default"].isEmpty(this.ExtRegistry[t])}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,i=t.length;i>e;e++){var s=t[e],n=this.ExtRegistry[s.name];n&&(n.destroy(),this.ExtRegistry[s.name]=null)}}},{key:"loadThemes",value:function(){var t=this.themes;if(this.emitter.emit("before-loading-themes",this),this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(p["default"].isArray(t))for(var i=0,s=t.length;s>i;i++){var n=t[i],l=n.name,r=n.path,a=this.prfxTf+l;l&&!r?r=this.themesPath+l+"/"+l+".css":!l&&n.path&&(l="theme{0}".replace("{0}",i)),this.isImported(r,"link")||this["import"](a,r,null,"link")}this.btnResetText=null,this.btnResetHtml='',this.btnPrevPageHtml='',this.btnNextPageHtml='',this.btnFirstPageHtml='',this.btnLastPageHtml='',this.loader=!0,this.loaderHtml='
',this.loaderText=null,this.emitter.emit("after-loading-themes",this)}},{key:"getStylesheet",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"default":arguments[0];return h["default"].id(this.prfxTf+t)}},{key:"destroy",value:function(){var t=this;if(this._hasGrid){var e=this.tbl.rows,i=this.Mod,s=this.emitter;this.isExternalFlt&&!this.popupFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.markActiveColumns&&(this.clearActiveColumns(),s.off(["before-filtering"],function(){return t.clearActiveColumns()}),s.off(["cell-processed"],function(e,i){return t.markActiveColumn(i)})),this.hasExtensions&&this.destroyExtensions(),this.validateAllRows(),this.fltGrid&&!this.gridLayout&&(this.fltGridEl=e[this.filtersRowIndex],this.tbl.deleteRow(this.filtersRowIndex)),s.emit("destroy",this),Object.keys(i).forEach(function(t){var e=i[t];e&&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()}),h["default"].removeClass(this.tbl,this.prfxTf),this.nbHiddenRows=0,this.validRowsIndex=[],this.fltIds=[],this.activeFlt=null,this._hasGrid=!1,this.initialized=!1}}},{key:"setToolbar",value:function(){if(!this.infDiv){var t=h["default"].create("div",["id",this.prfxInfDiv+this.id]);if(t.className=this.infDivCssClass,this.toolBarTgtId)h["default"].id(this.toolBarTgtId).appendChild(t);else if(this.gridLayout){var e=this.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 l=h["default"].create("div",["id",this.prfxMDiv+this.id]);l.className=this.mDivCssClass,t.appendChild(l),this.mDiv=h["default"].id(this.prfxMDiv+this.id),p["default"].isUndef(this.help)&&this.emitter.emit("init-help",this)}}},{key:"removeToolbar",value: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)})}}},{key:"removeExternalFlts",value:function(){if(this.isExternalFlt)for(var t=this.externalFltTgtIds,e=t.length,i=0;e>i;i++){var s=t[i],n=h["default"].id(s);n&&(n.innerHTML="")}}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(!p["default"].isEmpty(t)&&this.isCustomOptions(t)){for(var e=this.customOptions,i=e.cols,s=[],n=[],l=i.indexOf(t),r=e.values[l],a=e.texts[l],o=e.sorts[l],u=0,h=r.length;h>u;u++)n.push(r[u]),a[u]?s.push(a[u]):s.push(r[u]);return o&&(n.sort(),s.sort()),[n,s]}}},{key:"resetValues",value:function(){var t=this;if(this.rememberGridValues){var e=this.Mod.store.getFilterValues(this.fltsValuesCookie);e.forEach(function(e,i){" "!==e&&t.setFilterValue(i,e)}),this.filter()}}},{key:"filter",value:function(){function t(t,e,i){if(this.highlightKeywords&&e){t=t.replace(g,""),t=t.replace(b,""),t=t.replace(y,""),t=t.replace(_,"");var s=t;(a.test(t)||o.test(t)||u.test(t)||f.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=d["default"].matchCase(t,this.caseSensitive);var s=void 0,r=m["default"].removeNbFormat,h=u.test(t),p=a.test(t),k=f.test(t),T=o.test(t),P=c.test(t),R=b.test(t),F=g.test(t),I=y.test(t),O=_.test(t),S=C===t,N=w===t,L=x.test(t),D=h&&v["default"].isValid(t.replace(u,""),E),B=p&&v["default"].isValid(t.replace(a,""),E),M=k&&v["default"].isValid(t.replace(f,""),E),A=T&&v["default"].isValid(t.replace(o,""),E),H=P&&v["default"].isValid(t.replace(c,""),E),j=R&&v["default"].isValid(t.replace(b,""),E),V=void 0,U=void 0;if(v["default"].isValid(e,E))V=v["default"].format(e,E),D?(U=v["default"].format(t.replace(u,""),E),s=U>V):B?(U=v["default"].format(t.replace(a,""),E),s=U>=V):A?(U=v["default"].format(t.replace(o,""),E),s=V>=U):M?(U=v["default"].format(t.replace(f,""),E),s=V>U):H?(U=v["default"].format(t.replace(c,""),E),s=V.toString()!=U.toString()):j?(U=v["default"].format(t.replace(b,""),E),s=V.toString()==U.toString()):g.test(t)?s=d["default"].contains(t.replace(g,""),e,!1,this.caseSensitive):v["default"].isValid(t,E)?(U=v["default"].format(t,E),s=V.toString()===U.toString()):s=S?d["default"].isEmpty(e):N?!d["default"].isEmpty(e):d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);else if(this.hasColNbFormat&&this.colNbFormat[i]?(n=r(e,this.colNbFormat[i]),l=this.colNbFormat[i]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(n=r(e,"us"),l="us"):(n=r(e,"eu"),l="eu"),p)s=n<=r(t.replace(a,""),l);else if(T)s=n>=r(t.replace(o,""),l);else if(h)s=nr(t.replace(f,""),l);else if(P)s=d["default"].contains(t.replace(c,""),e,!1,this.caseSensitive)?!1:!0;else if(F)s=d["default"].contains(t.replace(g,""),e,!1,this.caseSensitive);else if(R)s=d["default"].contains(t.replace(b,""),e,!0,this.caseSensitive);else if(I)s=0===e.indexOf(t.replace(y,""))?!0:!1;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?!0:!1}else if(S)s=d["default"].isEmpty(e);else if(N)s=!d["default"].isEmpty(e);else if(L)try{var W=t.replace(x,""),G=new RegExp(W);s=G.test(e)}catch($){s=!1}else s=d["default"].contains(t,e,this.isExactMatch(i),this.caseSensitive);return s}if(this.fltGrid&&this._hasGrid){this.onBeforeFilter&&this.onBeforeFilter.call(null,this),this.emitter.emit("before-filtering",this);var i=this.tbl.rows,s=0;this.validRowsIndex=[];for(var n,l,r=this.getFiltersValue(),a=new RegExp(this.leOperator),o=new RegExp(this.geOperator),u=new RegExp(this.lwOperator),f=new RegExp(this.grOperator),c=new RegExp(this.dfOperator),g=new RegExp(d["default"].rgxEsc(this.lkOperator)),b=new RegExp(this.eqOperator),y=new RegExp(this.stOperator),_=new RegExp(this.enOperator),C=this.emOperator,w=this.nmOperator,x=new RegExp(d["default"].rgxEsc(this.rgxOperator)),k=this.refRow;kO;O++){var S=r[this.singleSearchFlt?0:O],E=this.hasColDateType?this.colDateType[O]:this.defaultDateType;if(""!==S){var N=d["default"].matchCase(this.getCellData(T[O]),this.caseSensitive),L=S.toString().split(this.orOperator),D=L.length>1,B=S.toString().split(this.anOperator),M=B.length>1;if(p["default"].isArray(S)||D||M){var A=void 0,H=void 0,j=!1;H=p["default"].isArray(S)?S:D?L:B;for(var V=0,U=H.length;U>V&&(A=d["default"].trim(H[V]),j=e.call(this,A,N,O),t.call(this,A,j,T[O]),!(D&&j||M&&!j))&&(!p["default"].isArray(S)||!j);V++);R[O]=j}else R[O]=e.call(this,d["default"].trim(S),N,O),t.call(this,S,R[O],T[O]);R[O]||(F=!1),this.singleSearchFlt&&R[O]&&(I=!0),this.emitter.emit("cell-processed",this,O,T[O])}}this.singleSearchFlt&&I&&(F=!0),F?this.validateRow(k,!0):(this.validateRow(k,!1),s++),this.emitter.emit("row-processed",this,k,this.validRowsIndex.length,F)}}this.nbVisibleRows=this.validRowsIndex.length,this.nbHiddenRows=s,this.onAfterFilter&&this.onAfterFilter.call(null,this),this.emitter.emit("after-filtering",this)}}},{key:"getColValues",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=arguments.length<=2||void 0===arguments[2]?!1:arguments[2],s=arguments.length<=3||void 0===arguments[3]?[]:arguments[3];if(this.fltGrid){var n=this.tbl.rows,l=[];e&&l.push(this.getHeadersText()[t]);for(var r=this.refRow;r0&&(a=-1!=s.indexOf(r));var o=n[r].cells,u=o.length;if(u===this.nbCells&&!a)for(var h=0;u>h;h++)if(h==t&&""===n[r].style.display){var f=this.getCellData(o[h]),d=this.colNbFormat?this.colNbFormat[t]:null,c=i?m["default"].removeNbFormat(f,d):f;l.push(c)}}return l}}},{key:"getFilterValue",value: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 l=0,r=s.options.length;r>l;l++)s.options[l].selected&&i.push(s.options[l].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}}},{key:"getFiltersValue",value: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(d["default"].trim(s))}return t}}},{key:"getFilterId",value:function(t){return this.fltGrid?this.fltIds[t]:void 0}},{key:"getFiltersByType",value:function(t,e){if(this.fltGrid){for(var i=[],s=0,n=this.fltIds.length;n>s;s++){var l=this.getFilterType(s);if(l===d["default"].lower(t)){var r=e?s:this.fltIds[s];i.push(r)}}return i}}},{key:"getFilterElement",value:function(t){var e=this.fltIds[t];return h["default"].id(e)}},{key:"getCellsNb",value:function(){var t=arguments.length<=0||void 0===arguments[0]?0:arguments[0],e=this.tbl.rows[t];return e.cells.length}},{key:"getRowsNb",value:function(t){var e=p["default"].isUndef(this.refRow)?0:this.refRow,i=this.tbl.rows.length;return t&&(e=0),parseInt(i-e,10)}},{key:"getCellData",value:function(t){var e=t.cellIndex;return this.customCellData&&-1!=this.customCellDataCols.indexOf(e)?this.customCellData.call(null,this,t,e):h["default"].getText(t)}},{key:"getTableData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.refRow;lo;o++)if(!(e&&this.hasExtension("colsVisibility")&&this.extension("colsVisibility").isColHidden(o))){var h=this.getCellData(a[o]);r[1].push(h)}s.push(r)}return s}},{key:"getFilteredData",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=arguments.length<=1||void 0===arguments[1]?!1:arguments[1];if(!this.validRowsIndex)return[];var i=this.tbl.rows,s=[];if(t){var n=this.getHeadersText(e);s.push([this.getHeadersRowIndex(),n])}for(var l=this.getValidRows(!0),r=0;rn;n++){var r=i[n],a=r[1],o=a[t];s.push(o)}return s}},{key:"getRowDisplay",value:function(t){return p["default"].isObj(t)?t.style.display:null}},{key:"validateRow",value:function(t,e){var i=this.tbl.rows[t];if(i&&"boolean"==typeof e){this.hasVisibleRows&&-1!==this.visibleRows.indexOf(t)&&(e=!0);var s=e?"":"none",n=e?"true":"false";i.style.display=s,this.paging&&i.setAttribute("validRow",n),e&&(-1===this.validRowsIndex.indexOf(t)&&this.validRowsIndex.push(t),this.onRowValidated&&this.onRowValidated.call(null,this,t),this.emitter.emit("row-validated",this,t))}}},{key:"validateAllRows",value:function(){if(this._hasGrid){this.validRowsIndex=[];for(var t=this.refRow;t0,l=n?null:D.createDocumentFragment(),r=0;t>r;r++){var a=void 0;n?a=s[r]:(a=h["default"].create("col",["id",this.id+"_col_"+r]),l.appendChild(a)),a.style.width=i[r]}n||e.insertBefore(l,e.firstChild)}if(this.hasColWidths){e=e||this.tbl;var s=void 0;s=void 0===t?"none"!=e.rows[0].style.display?0:1:t,i.call(this)}}},{key:"enforceVisibility",value:function(){if(this.hasVisibleRows)for(var t=0,e=this.visibleRows.length;e>t;t++){var i=this.visibleRows[t];i<=this.nbRows&&this.validateRow(i,!0)}}},{key:"clearFilters",value:function(){if(this.fltGrid){this.emitter.emit("before-clearing-filters",this),this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0,e=this.fltIds.length;e>t;t++)this.setFilterValue(t,"");this.filter(),this.onAfterReset&&this.onAfterReset.call(null,this),this.emitter.emit("after-clearing-filters",this)}}},{key:"clearActiveColumns",value:function(){for(var t=0,e=this.getCellsNb(this.headersRow);e>t;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"markActiveColumn",value: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))}},{key:"linkFilters",value:function(){if(this.linkedFilters&&this.activeFilterId){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),i=this.getFiltersByType(this.fltTypeCheckList,!0),s=t.concat(e); +s=s.concat(i);var n=this.activeFilterId.split("_")[0];n=n.split(this.prfxFlt)[1];for(var l=void 0,r=0,a=s.length;a>r;r++){var o=h["default"].id(this.fltIds[s[r]]);if(l=this.getFilterValue(s[r]),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]))||l===this.displayAllText){if(-1!=i.indexOf(s[r])?this.Mod.checkList.checkListDiv[s[r]].innerHTML="":o.innerHTML="",this.loadFltOnDemand){var u=h["default"].createOpt(this.displayAllText,"");o&&o.appendChild(u)}-1!=i.indexOf(s[r])?this.emitter.emit("build-checklist-filter",this,s[r],this.isExternalFlt):this.emitter.emit("build-select-filter",this,s[r],!0,this.isExternalFlt),this.setFilterValue(s[r],l)}}}}},{key:"isExactMatch",value:function(t){var e=this.getFilterType(t);return this.exactMatchByCol[t]||this.exactMatch||e!==this.fltTypeInp}},{key:"isImported",value:function(t,e){for(var i=!1,s=e?e:"script",n="script"==s?"src":"href",l=h["default"].tag(D,s),r=0,a=l.length;a>r;r++)if(void 0!==l[r][n]&&l[r][n].match(t)){i=!0;break}return i}},{key:"import",value:function(t,e,i,s){var n=s?s:"script",l=this.isImported(e,n);if(!l){var r=this,a=!1,o=void 0,u=h["default"].tag(D,"head")[0];o="link"===d["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,r))},o.onerror=function(){throw new Error("TF script could not load: "+e)},u.appendChild(o)}}},{key:"hasGrid",value:function(){return this._hasGrid}},{key:"getFiltersId",value:function(){return this.fltIds||[]}},{key:"getValidRows",value:function(t){if(!t)return this.validRowsIndex;this.validRowsIndex=[];for(var e=this.refRow;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},getFirstTextNode:function(t){for(var e=0;e1)for(var n=0;n2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function s(t){if(void 0===t)return 0;for(var e=void 0,i=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],s=0;s11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var i=this.format(t,e);t=i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var s=void 0,n=void 0;if("Y"===e.substring(0,1)?(s=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,n=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"===e.substring(1,2)?(s=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,n=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(s=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,n=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),s.test(t)===!1&&n.test(t)===!1)return!1;var l=t.split(RegExp.$1),r=void 0,a=void 0,o=void 0;r="M"===e.substring(0,1)?l[0]:"M"===e.substring(1,2)?l[1]:l[2],a="D"===e.substring(0,1)?l[0]:"D"===e.substring(1,2)?l[1]:l[2],o="Y"===e.substring(0,1)?l[0]:"Y"===e.substring(1,2)?l[1]:l[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var u=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=u.getDate()?!1:parseInt(r,10)-1!=u.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var n=void 0,l=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":l=t.replace(/[- \/.]/g," ").split(" "),n=new Date(i(l[2]),s(l[1])-1,l[0]);break;case"DMY":l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0]);break;case"MDY":l=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[0]-1,l[1]);break;case"YMD":l=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),n=new Date(i(l[0]),l[1]-1,l[2]);break;default:l=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),n=new Date(i(l[2]),l[1]-1,l[0])}return n}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={removeNbFormat:function(t,e){if(t){e||(e="us");var i=t;return i="us"===l["default"].lower(e)?+i.replace(/[^\d\.-]/g,""):+i.replace(/[^\d\,-]/g,"").replace(",",".")}}}},function(t,e){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var s=function(){function t(t,e){for(var i=0;i0){var s=document.cookie,n=s.indexOf(i);if(-1!==n){n+=i.length;var l=s.indexOf(";",n);-1===l&&(l=s.length),e=unescape(s.substring(n,l))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var i=this.read(t),s=i.split(e);return s},getValueByIndex:function(t,e,i){i||(i=",");var s=this.valueToArray(t,i);return s[e]}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i0&&s.removeChild(P[0]),this.headTbl.style.tableLayout="fixed",s.style.tableLayout="fixed",this.headTbl.cellPadding=s.cellPadding,this.headTbl.cellSpacing=s.cellSpacing,e.setColWidths(0,this.headTbl),s.style.width="",this.headTbl.style.width=s.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var i=p["default"].target(e),s=i.scrollLeft;t.headTblCont.scrollLeft=s});var R=(i.extensions||[]).filter(function(t){return"sort"===t.name});1===R.length&&(R[0].async_sort=!0,R[0].trigger_ids=g),this.tblHasColTag=h["default"].tag(s,"col").length>0?!0:!1;var F=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',e.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",e.onBeforePopUpOpen=h["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,e.onAfterPopUpOpen=h["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,e.onBeforePopUpClose=h["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,e.onAfterPopUpClose=h["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,e.popUpFltSpans=[],e.popUpFltImgs=[],e.popUpFltElms=e.popUpFltElmCache||[],e.popUpFltAdjustToContainer=!0,e.prfxPopUpSpan="popUpSpan_",e.prfxPopUpDiv="popUpDiv_",e}return r(i,e),a(i,[{key:"onClick",value:function(e){var i=e||t.event,s=i.target.parentNode,n=parseInt(s.getAttribute("ci"),10);if(this.closeAll(n),this.toggle(n),this.popUpFltAdjustToContainer){var l=this.popUpFltElms[n],r=this.tf.getHeaderElement(n),a=.95*r.clientWidth;l.style.width=parseInt(a,10)+"px"}p["default"].cancel(i),p["default"].stop(i)}},{key:"init",value:function(){var t=this;if(!this.initialized){var e=this.tf;e.headersRow<=1&&(e.headersRow=0);for(var i=0;iy;y++)if(t===y&&(!e||e&&n.disableExcludedOptions)||t==y&&e&&(""===a[g].style.display&&!n.paging||n.paging&&(!n.validRowsIndex||n.validRowsIndex&&-1!=n.validRowsIndex.indexOf(g))&&(void 0===u||u==t||u!=t&&-1!=n.validRowsIndex.indexOf(g)))){var _=n.getCellData(b[y]),C=p["default"].matchCase(_,o);if(d["default"].has(this.opts,C,o)||this.opts.push(_),e&&n.disableExcludedOptions){var w=c[y];w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,o)||d["default"].has(f,C,o)||f.push(_)}}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(o?(this.opts.sort(),f&&f.sort()):(this.opts.sort(v["default"].ignoreCase),f&&f.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),f&&f.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),f&&f.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),f&&f.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,r,e,f),this.emitter.emit("after-populating-filter",n,t,r)}}},{key:"addOptions",value:function(t,e,i,s){var n=this.tf,l=p["default"].lower(this.slcFillingMethod),r=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var a=0;a"+u+""}else{var g=void 0;g=n.loadFltOnDemand&&r===this.opts[a]&&n.getFilterType(t)===n.fltTypeSlc?h["default"].createOpt(u,o,!0):h["default"].createOpt(u,o,!1),f&&(g.disabled=!0),e.appendChild(g)}}"innerhtml"===l&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,i=p["default"].lower(this.slcFillingMethod);if("innerhtml"===i)this.slcInnerHtml+='";else{var s=h["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(s.style.display="none"),t.appendChild(s),e.enableEmptyOption){var n=h["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(n)}if(e.enableNonEmptyOption){var l=h["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(l)}}return t}},{key:"selectOptions",value:function(t){var e=arguments.length<=1||void 0===arguments[1]?[]:arguments[1],i=this.tf;if(i.getFilterType(t)===i.fltTypeMulti&&0!==e.length){var s=i.getFilterElement(t);[].forEach.call(s.options,function(t){(""===e[0]||""===t.value)&&(t.selected=!1),""!==t.value&&d["default"].has(e,t.value,!0)&&(t.selected=!0)})}}},{key:"destroy",value:function(){var t=this;this.emitter.off(["build-select-filter"],function(e,i,s){return t.build(e,i,s)}),this.emitter.off(["select-options"],function(e,i,s){return t.selectOptions(i,s)})}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var n=i(3),l=s(n);e["default"]={has:function(t,e,i){for(var s=void 0===i?!1:i,n=0;ni?-1:i>s?1:0}}},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;iy;y++)if(t===y&&(!n.linkedFilters||n.linkedFilters&&n.disableExcludedOptions)||t===y&&n.linkedFilters&&(""===o[c].style.display&&!n.paging||n.paging&&(!u||u===t||u!=t&&-1!=n.validRowsIndex.indexOf(c)))){var _=n.getCellData(g[y]),C=p["default"].matchCase(_,n.matchCase);d["default"].has(this.opts,C,n.matchCase)||this.opts.push(_);var w=f[y];n.linkedFilters&&n.disableExcludedOptions&&(w||(w=n.getFilteredDataCol(y)),d["default"].has(w,C,n.matchCase)||d["default"].has(this.excludedOpts,C,n.matchCase)||this.excludedOpts.push(_))}}if(this.isCustom){var x=n.getCustomOptions(t);this.opts=x[0],this.optsTxt=x[1]}if(n.sortSlc&&!this.isCustom&&(n.matchCase?(this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort()):(this.opts.sort(v["default"].ignoreCase),this.excludedOpts&&this.excludedOpts.sort(v["default"].ignoreCase))),n.sortNumAsc&&-1!=n.sortNumAsc.indexOf(t))try{this.opts.sort(numSortAsc),this.excludedOpts&&this.excludedOpts.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}if(n.sortNumDesc&&-1!=n.sortNumDesc.indexOf(t))try{this.opts.sort(numSortDesc),this.excludedOpts&&this.excludedOpts.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),this.excludedOpts&&this.excludedOpts.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,a),n.loadFltOnDemand&&(r.innerHTML=""),r.appendChild(a),r.setAttribute("filled","1"),this.emitter.emit("after-populating-filter",n,t,r)}}},{key:"addChecks",value:function(t,e){for(var i=this,s=this.tf,n=this.addTChecks(t,e),l=0;ll;l++){var r=h["default"].tag(s,"li")[l],a=h["default"].tag(r,"label")[0],o=h["default"].tag(r,"input")[0],u=p["default"].matchCase(h["default"].getText(a),i.caseSensitive);""!==u&&d["default"].has(e,u,i.caseSensitive)?(o.checked=!0,this.setCheckListValues(o)):(o.checked=!1,this.setCheckListValues(o))}}}},{key:"destroy",value: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}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i0?1:0),l=n+s.pagingLength-1<=e.nbVisibleRows?n+s.pagingLength-1:e.nbVisibleRows;i=n+this.fromToTextSeparator+l+this.overText+e.nbVisibleRows}}else i=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows;this.rowsCounterSpan.innerHTML=i,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,i)}}},{key:"destroy",value:function(){var t=this;this.initialized&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?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}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i",i.btnPrevPageText=s.btn_prev_page_text||"<",i.btnLastPageText=s.btn_last_page_text||">|",i.btnFirstPageText=s.btn_first_page_text||"|<",i.btnNextPageHtml=s.btn_next_page_html||(t.enableIcons?'':null),i.btnPrevPageHtml=s.btn_prev_page_html||(t.enableIcons?'':null),i.btnFirstPageHtml=s.btn_first_page_html||(t.enableIcons?'':null),i.btnLastPageHtml=s.btn_last_page_html||(t.enableIcons?'':null),i.pageText=s.page_text||" Page ",i.ofText=s.of_text||" of ",i.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",i.hasPagingBtns=s.paging_btns===!1?!1:!0,i.pageSelectorType=s.page_selector_type||t.fltTypeSlc,i.onBeforeChangePage=c["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,i.onAfterChangePage=c["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,i.prfxSlcPages="slcPages_",i.prfxSlcResults="slcResults_",i.prfxSlcResultsTxt="slcResultsTxt_",i.prfxBtnNextSpan="btnNextSpan_",i.prfxBtnPrevSpan="btnPrevSpan_",i.prfxBtnLastSpan="btnLastSpan_",i.prfxBtnFirstSpan="btnFirstSpan_",i.prfxBtnNext="btnNext_",i.prfxBtnPrev="btnPrev_",i.prfxBtnLast="btnLast_",i.prfxBtnFirst="btnFirst_",i.prfxPgSpan="pgspan_",i.prfxPgBeforeSpan="pgbeforespan_",i.prfxPgAfterSpan="pgafterspan_";var n=t.refRow,a=t.nbRows;i.nbPages=Math.ceil((a-n)/i.pagingLength);var o=i;return i.evt={slcIndex:function(){return o.pageSelectorType===t.fltTypeSlc?o.pagingSlc.options.selectedIndex:parseInt(o.pagingSlc.value,10)-1},nbOpts:function(){return o.pageSelectorType===t.fltTypeSlc?parseInt(o.pagingSlc.options.length,10)-1:o.nbPages-1},next:function(){var t=o.evt.slcIndex()0?o.evt.slcIndex()-1:o.evt.nbOpts();o.changePage(t)},last:function(){o.changePage(o.evt.nbOpts())},first:function(){o.changePage(0)},_detectKey:function(e){var i=b["default"].keyCode(e);13===i&&(t.sorted?(t.filter(),o.changePage(o.evt.slcIndex())):o.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},i}return a(e,t),o(e,[{key:"init",value:function(){var t,e=this,i=this.tf,s=this.evt;if(!this.initialized){this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),s.slcPagesChange=function(t){var i=t.target;e.changePage(i.selectedIndex)},this.pageSelectorType===i.fltTypeSlc&&(t=f["default"].create(i.fltTypeSlc,["id",this.prfxSlcPages+i.id]),t.className=this.pgSlcCssClass,b["default"].add(t,"change",s.slcPagesChange)),this.pageSelectorType===i.fltTypeInp&&(t=f["default"].create(i.fltTypeInp,["id",this.prfxSlcPages+i.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,b["default"].add(t,"keypress",s._detectKey));var n=f["default"].create("span",["id",this.prfxBtnNextSpan+i.id]),l=f["default"].create("span",["id",this.prfxBtnPrevSpan+i.id]),r=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)l.innerHTML=this.btnPrevPageHtml, b["default"].add(l,"click",s.prev);else{var u=f["default"].create(i.fltTypeInp,["id",this.prfxBtnPrev+i.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);u.className=this.btnPageCssClass,b["default"].add(u,"click",s.prev),l.appendChild(u)}if(this.btnLastPageHtml)r.innerHTML=this.btnLastPageHtml,b["default"].add(r,"click",s.last);else{var h=f["default"].create(i.fltTypeInp,["id",this.prfxBtnLast+i.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);h.className=this.btnPageCssClass,b["default"].add(h,"click",s.last),r.appendChild(h)}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 c=this.pagingTgtId?f["default"].id(this.pagingTgtId):i.mDiv;c.appendChild(a),c.appendChild(l);var p=f["default"].create("span",["id",this.prfxPgBeforeSpan+i.id]);p.appendChild(f["default"].text(this.pageText)),p.className=this.nbPgSpanCssClass,c.appendChild(p),c.appendChild(t);var g=f["default"].create("span",["id",this.prfxPgAfterSpan+i.id]);g.appendChild(f["default"].text(this.ofText)),g.className=this.nbPgSpanCssClass,c.appendChild(g);var v=f["default"].create("span",["id",this.prfxPgSpan+i.id]);v.className=this.nbPgSpanCssClass,v.appendChild(f["default"].text(" "+this.nbPages+" ")),c.appendChild(v),c.appendChild(n),c.appendChild(r),this.pagingSlc=f["default"].id(this.prfxSlcPages+i.id),i.rememberGridValues||this.setPagingInfo(),i.fltGrid||(i.validateAllRows(),this.setPagingInfo(i.validRowsIndex)),this.emitter.on(["after-filtering"],function(){return e.resetPagingInfo()}),this.emitter.on(["initialized"],function(){return e.resetValues()}),this.initialized=!0}}},{key:"reset",value:function(){var t=arguments.length<=0||void 0===arguments[0]?!1:arguments[0],e=this.tf;this.isEnabled()||(this.enable(),this.init(),t&&e.filter())}},{key:"resetPagingInfo",value:function(){this.startPagingRow=0,this.currentPageNb=1,this.setPagingInfo(this.tf.validRowsIndex)}},{key:"setPagingInfo",value:function(t){var e=this.tf,i=this.pagingTgtId?f["default"].id(this.pagingTgtId):e.mDiv,s=f["default"].id(this.prfxPgSpan+e.id);if(e.validRowsIndex=t||e.getValidRows(!0),this.nbPages=Math.ceil(e.validRowsIndex.length/this.pagingLength),s.innerHTML=this.nbPages,this.pageSelectorType===e.fltTypeSlc&&(this.pagingSlc.innerHTML=""),this.nbPages>0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var n=0;nl;l++){var a=e.validRowsIndex[l],o=i[a],u=o.getAttribute("validRow"),h=!1;l>=s&&n>l?(c["default"].isNull(u)||Boolean("true"===u))&&(o.style.display="",h=!0):o.style.display="none",this.emitter.emit("row-paged",e,a,l,h)}e.nbVisibleRows=e.validRowsIndex.length,this.emitter.emit("grouped-by-page",e,this)}},{key:"getPage",value:function(){return this.currentPageNb}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&this.isEnabled()){var i=this.evt,s="undefined"==typeof t?"undefined":n(t);if("string"===s)switch(g["default"].lower(t)){case"next":i.next();break;case"previous":i.prev();break;case"last":i.last();break;case"first":i.first();break;default:i.next()}else"number"===s&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,i=this.evt;if(!this.resultsPerPageSlc&&this.resultsPerPage){i.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var s=f["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);s.className=this.resultsSlcCssClass;var n=this.resultsPerPage[0],l=this.resultsPerPage[1],r=f["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);r.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var a=this.resultsPerPageTgtId?f["default"].id(this.resultsPerPageTgtId):e.rDiv;r.appendChild(f["default"].text(n));var o=e.feature("help");o&&o.btn?(o.btn.parentNode.insertBefore(r,o.btn),o.btn.parentNode.insertBefore(s,o.btn)):(a.appendChild(r),a.appendChild(s));for(var u=0;u=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.feature("store").savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)),this.emitter.emit("after-changing-page",e,t))}},{key:"changeResultsPerPage",value:function(){var t=this.tf;if(this.isEnabled()){this.emitter.emit("before-changing-results-per-page",t);var e=this.resultsPerPageSlc,i=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*i,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var s=this.pagingSlc.options.length-1<=i?this.pagingSlc.options.length-1:i;this.pagingSlc.options[s].selected=!0}t.rememberPageLen&&t.feature("store").savePageLength(t.pgLenCookie)}this.emitter.emit("after-changing-results-per-page",t)}}},{key:"resetValues",value:function(){var t=this.tf;t.rememberPageLen&&this.resetPageLength(t.pgLenCookie),t.rememberPageNb&&this.resetPage(t.pgNbCookie)}},{key:"resetPage",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page",e);var i=e.feature("store").getPageNb(t);""!==i&&this.changePage(i-1),this.emitter.emit("after-reset-page",e,i)}}},{key:"resetPageLength",value:function(t){var e=this.tf;if(this.isEnabled()){this.emitter.emit("before-reset-page-length",e);var i=e.feature("store").getPageLength(t);""!==i&&(this.resultsPerPageSlc.options[i].selected=!0,this.changeResultsPerPage()),this.emitter.emit("after-reset-page-length",e,i)}}},{key:"destroy",value:function(){var t=this,e=this.tf;if(this.initialized){var i=f["default"].id(this.prfxBtnNextSpan+e.id),s=f["default"].id(this.prfxBtnPrevSpan+e.id),n=f["default"].id(this.prfxBtnLastSpan+e.id),l=f["default"].id(this.prfxBtnFirstSpan+e.id),r=f["default"].id(this.prfxPgBeforeSpan+e.id),a=f["default"].id(this.prfxPgAfterSpan+e.id),o=f["default"].id(this.prfxPgSpan+e.id),u=this.evt;this.pagingSlc&&(this.pageSelectorType===e.fltTypeSlc?b["default"].remove(this.pagingSlc,"change",u.slcPagesChange):this.pageSelectorType===e.fltTypeInp&&b["default"].remove(this.pagingSlc,"keypress",u._detectKey),f["default"].remove(this.pagingSlc)),i&&(b["default"].remove(i,"click",u.next),f["default"].remove(i)),s&&(b["default"].remove(s,"click",u.prev),f["default"].remove(s)),n&&(b["default"].remove(n,"click",u.last),f["default"].remove(n)),l&&(b["default"].remove(l,"click",u.first),f["default"].remove(l)),r&&f["default"].remove(r),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.pagingSlc=null,this.nbPages=0,this.disable(),this.initialized=!1}}}]),e}(u.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i':null),i.prfxResetSpan="resetspan_",i}return r(e,t),a(e,[{key:"onClick",value:function(){this.isEnabled()&&this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(!this.initialized){var i=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;d["default"].add(n,"click",function(){t.onClick()})}else{var l=h["default"].create("a",["href","javascript:void(0);"]);l.className=e.btnResetCssClass,l.appendChild(h["default"].text(this.btnResetText)),i.appendChild(l),d["default"].add(l,"click",function(){t.onClick()})}this.btnResetEl=i.firstChild,this.initialized=!0}}},{key:"destroy",value:function(){var t=this.tf;if(this.initialized){var e=h["default"].id(this.prfxResetSpan+t.id);e&&h["default"].remove(e),this.btnResetEl=null,this.initialized=!1}}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;i<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
Learn more
',i.instrHtml=s.help_instructions_html||null,i.btnText=s.help_instructions_btn_text||"?",i.btnHtml=s.help_instructions_btn_html||null,i.btnCssClass=s.help_instructions_btn_css_class||"helpBtn",i.contCssClass=s.help_instructions_container_css_class||"helpCont",i.btn=null,i.cont=null,i.defaultHtml='

TableFilter v'+t.version+'

'+p+"
©2015-"+t.year+' Max Guglielmi
',i.prfxHelpSpan="helpSpan_",i.prfxHelpDiv="helpDiv_",i.emitter.on(["init-help"],function(){return i.init()}),i}return r(e,t),a(e,[{key:"init",value: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 l=this.contTgtId?h["default"].id(this.contTgtId):i;if(this.btnHtml){i.innerHTML=this.btnHtml;var r=i.firstChild;d["default"].add(r,"click",function(){t.toggle()}),l.appendChild(s)}else{l.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),d["default"].add(a,"click",function(){t.toggle()})}this.instrHtml?(this.contTgtId&&l.appendChild(s),s.innerHTML=this.instrHtml,this.contTgtId||(s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()}))):(s.innerHTML=this.instrText,s.className=this.contCssClass,d["default"].add(s,"dblclick",function(){t.toggle()})),s.innerHTML+=this.defaultHtml,d["default"].add(s,"click",function(){t.toggle()}),this.cont=s,this.btn=i,this.initialized=!0}}},{key:"toggle",value:function(){if(this.enabled!==!1){var t=this.cont.style.display;""===t||"none"===t?this.cont.style.display="inline":this.cont.style.display="none"}}},{key:"destroy",value:function(){this.initialized&&(h["default"].remove(this.btn),this.btn=null,this.cont&&(h["default"].remove(this.cont),this.cont=null,this.initialized=!1))}}]),e}(o.Feature)},function(t,e,i){"use strict";function s(t){return t&&t.__esModule?t:{"default":t}}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function l(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function r(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var i=0;ir;r++){var a=i?r:e[r];this.setRowBg(a,l),l++}}},{key:"processRow",value:function(t,e,i){i?this.setRowBg(t,e):this.removeRowBg(t)}},{key:"setRowBg",value:function(t,e){if(this.isEnabled()&&!isNaN(t)){var i=this.tf.tbl.rows,s=isNaN(e)?t:e;this.removeRowBg(t),h["default"].addClass(i[t],s%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value: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)}}},{key:"destroy",value:function(){var t=this;if(this.initialized){for(var e=0;e0?this.hide():this.show()}},{key:"show",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeShowMsg&&this.onBeforeShowMsg.call(null,this.tf,this),this.setWidth(),this.cont.style.display="block",this.onAfterShowMsg&&this.onAfterShowMsg.call(null,this.tf,this))}},{key:"hide",value:function(){this.initialized&&this.isEnabled()&&(this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this),this.cont.style.display="none",this.onBeforeHideMsg&&this.onBeforeHideMsg.call(null,this.tf,this))}},{key:"setWidth",value:function(){if(this.initialized&&!this.isExternal&&this.isEnabled())if(this.tf.gridLayout){var t=this.tf.feature("gridLayout");this.cont.style.width=t.tblCont.clientWidth+"px"}else this.cont.style.width=this.tf.tbl.clientWidth+"px"}},{key:"destroy",value:function(){var t=this;this.initialized&&(h["default"].remove(this.cont),this.cont=null,this.emitter.off(["after-filtering"],function(){return t.toggle()}),this.initialized=!1)}}]),e}(o.Feature)}])}); \ No newline at end of file diff --git a/dist/tablefilter/tf-1.js b/dist/tablefilter/tf-1.js index d27a3d86..7fa3af26 100644 --- a/dist/tablefilter/tf-1.js +++ b/dist/tablefilter/tf-1.js @@ -1,6 +1,6 @@ /** - * tablefilter v0.1.9 by Max Guglielmi - * build date: 2016-01-27T10:49:29.304Z + * tablefilter v0.1.10 by Max Guglielmi + * build date: 2016-02-01T07:07:05.275Z * MIT License */ diff --git a/package.json b/package.json index 58ea68e7..3be7d5df 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "tablefilter", - "version": "0.1.9", + "version": "0.1.10", "description": "A Javascript library making HTML tables filterable and a bit more", "license": "MIT", "author": { diff --git a/src/tablefilter.js b/src/tablefilter.js index a08a850d..82f824dd 100644 --- a/src/tablefilter.js +++ b/src/tablefilter.js @@ -115,8 +115,6 @@ export class TableFilter { this.fltIds = []; //stores filters DOM elements this.fltElms = []; - //stores filters values - this.searchArgs = null; //stores valid rows indexes (rows visible upon filtering) this.validRowsIndex = []; //stores filters row element @@ -1166,7 +1164,7 @@ export class TableFilter { this.validRowsIndex = []; // search args re-init - this.searchArgs = this.getFiltersValue(); + let searchArgs = this.getFiltersValue(); var numCellData, nbFormat; var re_le = new RegExp(this.leOperator), @@ -1410,7 +1408,7 @@ export class TableFilter { // this loop retrieves cell data for(let j=0; j + + + + TableFilter no headers tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
+ + + + +
+
+ + diff --git a/test/test-no-headers.js b/test/test-no-headers.js new file mode 100644 index 00000000..61c21d45 --- /dev/null +++ b/test/test-no-headers.js @@ -0,0 +1,93 @@ +(function(win, TableFilter){ + + var tf = new TableFilter('demo', 0, { + base_path: '../dist/tablefilter/' + }); + tf.init(); + + module('Sanity checks'); + test('No headers', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index'); + deepEqual(tf.refRow, 1, 'Reference row index'); + notEqual(tf.getFilterElement(0), null, 'Filter element for column 0'); + }); + + test('Can perform a search', function() { + tf.setFilterValue(1, 'Ade'); + tf.filter(); + + deepEqual(tf.getValidRows(), [1], 'Filtered row'); + }); + + test('Paging with no headers', function() { + tf.clearFilters(); + tf.destroy(); + tf = new TableFilter('demo', 0, { + base_path: '../dist/tablefilter/', + paging: true, + paging_length: 3 + }); + tf.init(); + + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index'); + deepEqual(tf.refRow, 1, 'Reference row index'); + notEqual(tf.getFilterElement(0), null, 'Filter element for column 0'); + }); + + test('Can perform a search', function() { + tf.setFilterValue(1, 'Ade'); + tf.filter(); + + deepEqual(tf.getValidRows(), [1], 'Filtered row'); + }); + + // Grid layout currently does not handle a table with no headers... + // Raised in issue 110 (https://github.com/koalyptus/TableFilter/issues/110) + test('Grid layout with no header', function() { + tf.clearFilters(); + tf.destroy(); + tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + grid_layout: true + }); + tf.init(); + + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.getFiltersRowIndex(), 1, 'Filters row index'); + deepEqual(tf.refRow, 0, 'Reference row index'); + notEqual(tf.getFilterElement(0), null, 'Filter element for column 0'); + }); + + // With no toolbar cannot clear filters :) + test('Popup filters with no header', function() { + tf.clearFilters(); + tf.destroy(); + tf = new TableFilter('demo', 0, { + base_path: '../dist/tablefilter/', + popup_filters: true + }); + tf.init(); + + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.getFiltersRowIndex(), 0, 'Filters row index'); + deepEqual(tf.refRow, 1, 'Reference row index'); + notEqual(tf.getFilterElement(0), null, 'Filter element for column 0'); + }); + + test('Can perform a search', function() { + tf.setFilterValue(1, 'Melbourne'); + tf.filter(); + + deepEqual(tf.getValidRows(), [4], 'Filtered row'); + }); + + module('Tear-down'); + test('TableFilter removed', function() { + tf.clearFilters(); + tf.destroy(); + deepEqual(tf.hasGrid(), false, 'Filters removed'); + }); + +})(window, TableFilter);