1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-06-08 00:42:28 +02:00

Created constants file, added filter types constants

This commit is contained in:
Max Guglielmi 2016-05-07 21:59:42 +10:00
parent cf34009205
commit 8a2a7c7ba7
22 changed files with 10718 additions and 208 deletions

4
dist/starter.html vendored
View file

@ -1,10 +1,10 @@
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<title>tablefilter v0.2.19 - Starter</title> <title>tablefilter v0.2.20 - Starter</title>
</head> </head>
<body> <body>
<h1>tablefilter v0.2.19</h1> <h1>tablefilter v0.2.20</h1>

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * 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} 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}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * 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} 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}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * MIT License
*/ */
.activeHeader{background-color:#66afe9 !important;color:#fff !important} .activeHeader{background-color:#66afe9 !important;color:#fff !important}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * MIT License
*/ */
table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important} table.TF{border-left:1px solid #ccc;border-top:none;border-right:none;border-bottom:none;}table.TF th{background:#ebecee url("images/bg_th.jpg") left top repeat-x;border-bottom:1px solid #d0d0d0;border-right:1px solid #d0d0d0;border-left:1px solid #fff;border-top:1px solid #fff;color:#333}table.TF td{border-bottom:1px dotted #999;padding:5px}.fltrow{background-color:#ebecee !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #666 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #999 !important}input.flt{width:99% !important}.inf{height:$min-height;background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important}input.reset{background:transparent url("images/btn_eraser.gif") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important;}.nextPage:hover{background:transparent url("images/btn_over_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important;}.previousPage:hover{background:transparent url("images/btn_over_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important;}.firstPage:hover{background:transparent url("images/btn_over_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important;}.lastPage:hover{background:transparent url("images/btn_over_last_page.gif") center center no-repeat !important}div.grd_Cont{background-color:#ebecee !important;border:1px solid #ccc !important;padding:0 !important;}div.grd_Cont .even{background-color:#fff}div.grd_Cont .odd{background-color:#d5d5d5}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important;}div.grd_headTblCont table{border-right:none !important}div.grd_tblCont table th,div.grd_headTblCont table th,div.grd_headTblCont table td{background:#ebecee url("images/bg_th.jpg") left top repeat-x !important;border-bottom:1px solid #d0d0d0 !important;border-right:1px solid #d0d0d0 !important;border-left:1px solid #fff !important;border-top:1px solid #fff !important}div.grd_tblCont table td{border-bottom:1px solid #999 !important}.grd_inf{background:#d7d7d7 url("images/bg_infDiv.jpg") 0 0 repeat-x !important;border-top:1px solid #d0d0d0 !important}.loader{border:1px solid #999}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#fff}.odd{background-color:#d5d5d5}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#999 !important}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * MIT License
*/ */
table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important} table.TF{border-left:1px dotted #81963b;border-top:none;border-right:0;border-bottom:none;}table.TF th{background:#39424b url("images/bg_headers.jpg") left top repeat-x;border-bottom:0;border-right:1px dotted #d0d0d0;border-left:0;border-top:0;color:#fff}table.TF td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b;padding:5px}.fltrow{background-color:#81963b !important;}.fltrow th,.fltrow td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;padding:1px 3px 1px 3px !important}.flt,select.flt,select.flt_multi,.flt_s,.single_flt,.div_checklist{border:1px solid #687830 !important}input.flt{width:99% !important}.inf{background:#d8d8d8;height:$min-height}input.reset{width:53px;background:transparent url("images/btn_filter.png") center center no-repeat !important}.helpBtn:hover{background-color:transparent}.nextPage{background:transparent url("images/btn_next_page.gif") center center no-repeat !important}.previousPage{background:transparent url("images/btn_previous_page.gif") center center no-repeat !important}.firstPage{background:transparent url("images/btn_first_page.gif") center center no-repeat !important}.lastPage{background:transparent url("images/btn_last_page.gif") center center no-repeat !important}div.grd_Cont{background:#81963b url("images/bg_headers.jpg") left top repeat-x !important;border:1px solid #ccc !important;padding:0 1px 1px 1px !important;}div.grd_Cont .even{background-color:#bccd83}div.grd_Cont .odd{background-color:#fff}div.grd_headTblCont{background-color:#ebecee !important;border-bottom:none !important}div.grd_tblCont table{border-right:none !important;}div.grd_tblCont table td{border-bottom:1px dotted #81963b;border-right:1px dotted #81963b}div.grd_tblCont table th,div.grd_headTblCont table th{background:transparent url("images/bg_headers.jpg") 0 0 repeat-x !important;border-bottom:0 !important;border-right:1px dotted #d0d0d0 !important;border-left:0 !important;border-top:0 !important;padding:0 4px 0 4px !important;color:#fff !important;height:35px !important}div.grd_headTblCont table td{border-bottom:1px dotted #39424b !important;border-right:1px dotted #fff !important;border-left:0 !important;border-top:0 !important;background-color:#81963b !important;padding:1px 3px 1px 3px !important}.grd_inf{background-color:#d8d8d8;border-top:1px solid #d0d0d0 !important}.loader{border:0 !important;background:#81963b !important}.defaultLoader{width:32px;height:32px;background:transparent url("images/img_loading.gif") 0 0 no-repeat !important}.even{background-color:#bccd83}.odd{background-color:#fff}span.expClpFlt a.btnExpClpFlt:hover{background-color:transparent !important}.activeHeader{background:#81963b !important}

View file

@ -1,6 +1,6 @@
/** /**
* tablefilter v0.2.19 by Max Guglielmi * tablefilter v0.2.20 by Max Guglielmi
* build date: 2016-05-07T09:50:22.795Z * build date: 2016-05-07T10:31:02.804Z
* MIT License * 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} 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}

File diff suppressed because one or more lines are too long

2306
dist/tablefilter/tf-1.js vendored

File diff suppressed because one or more lines are too long

View file

@ -1,6 +1,6 @@
{ {
"name": "tablefilter", "name": "tablefilter",
"version": "0.2.19", "version": "0.2.20",
"description": "A Javascript library making HTML tables filterable and a bit more", "description": "A Javascript library making HTML tables filterable and a bit more",
"license": "MIT", "license": "MIT",
"author": { "author": {

View file

@ -1,4 +1,5 @@
import Dom from '../../dom'; import Dom from '../../dom';
import {INPUT} from '../../const';
export default class AdapterEzEditTable { export default class AdapterEzEditTable {
/** /**
@ -416,7 +417,7 @@ export default class AdapterEzEditTable {
} }
var colIndex = tf.getColumnIndexFromFilterId(tf.getActiveFilterId()); var colIndex = tf.getColumnIndexFromFilterId(tf.getActiveFilterId());
var filterType = tf.getFilterType(colIndex); var filterType = tf.getFilterType(colIndex);
if(filterType === tf.fltTypeInp){ if(filterType === INPUT){
this.toggle(); this.toggle();
} }
} }

View file

@ -3,14 +3,15 @@ import Dom from '../../dom';
import Event from '../../event'; import Event from '../../event';
import DateHelper from '../../date'; import DateHelper from '../../date';
import Helpers from '../../helpers'; import Helpers from '../../helpers';
import {NONE} from '../../const';
export default class AdapterSortableTable{ export default class AdapterSortableTable {
/** /**
* SortableTable Adapter module * SortableTable Adapter module
* @param {Object} tf TableFilter instance * @param {Object} tf TableFilter instance
*/ */
constructor(tf, opts){ constructor(tf, opts) {
this.initialized = false; this.initialized = false;
this.name = opts.name; this.name = opts.name;
this.desc = opts.description || 'Sortable table'; this.desc = opts.description || 'Sortable table';
@ -31,7 +32,7 @@ export default class AdapterSortableTable{
this.imgBlank = opts.image_blank || 'blank.png'; this.imgBlank = opts.image_blank || 'blank.png';
this.imgClassName = opts.image_class_name || 'sort-arrow'; this.imgClassName = opts.image_class_name || 'sort-arrow';
this.imgAscClassName = opts.image_asc_class_name || 'ascending'; this.imgAscClassName = opts.image_asc_class_name || 'ascending';
this.imgDescClassName = opts.image_desc_class_name ||'descending'; this.imgDescClassName = opts.image_desc_class_name || 'descending';
//cell attribute storing custom key //cell attribute storing custom key
this.customKey = opts.custom_key || 'data-tf-sortKey'; this.customKey = opts.custom_key || 'data-tf-sortKey';
@ -49,12 +50,12 @@ export default class AdapterSortableTable{
this.emitter = tf.emitter; this.emitter = tf.emitter;
} }
init(){ init() {
let tf = this.tf; let tf = this.tf;
let adpt = this; let adpt = this;
// SortableTable class sanity check (sortabletable.js) // SortableTable class sanity check (sortabletable.js)
if(Types.isUndef(SortableTable)){ if (Types.isUndef(SortableTable)) {
throw new Error('SortableTable class not found.'); throw new Error('SortableTable class not found.');
} }
@ -63,31 +64,31 @@ export default class AdapterSortableTable{
//Column sort at start //Column sort at start
let sortColAtStart = adpt.sortColAtStart; let sortColAtStart = adpt.sortColAtStart;
if(sortColAtStart){ if (sortColAtStart) {
this.stt.sort(sortColAtStart[0], sortColAtStart[1]); this.stt.sort(sortColAtStart[0], sortColAtStart[1]);
} }
if(this.onSortLoaded){ if (this.onSortLoaded) {
this.onSortLoaded.call(null, tf, this); this.onSortLoaded.call(null, tf, this);
} }
/*** SortableTable callbacks ***/ /*** SortableTable callbacks ***/
this.stt.onbeforesort = function(){ this.stt.onbeforesort = function () {
if(adpt.onBeforeSort){ if (adpt.onBeforeSort) {
adpt.onBeforeSort.call(null, tf, adpt.stt.sortColumn); adpt.onBeforeSort.call(null, tf, adpt.stt.sortColumn);
} }
/*** sort behaviour for paging ***/ /*** sort behaviour for paging ***/
if(tf.paging){ if (tf.paging) {
tf.feature('paging').disable(); tf.feature('paging').disable();
} }
}; };
this.stt.onsort = function(){ this.stt.onsort = function () {
adpt.sorted = true; adpt.sorted = true;
//sort behaviour for paging //sort behaviour for paging
if(tf.paging){ if (tf.paging) {
let paginator = tf.feature('paging'); let paginator = tf.feature('paging');
// recalculate valid rows index as sorting may have change it // recalculate valid rows index as sorting may have change it
tf.getValidRows(true); tf.getValidRows(true);
@ -95,9 +96,9 @@ export default class AdapterSortableTable{
paginator.setPage(paginator.getPage()); paginator.setPage(paginator.getPage());
} }
if(adpt.onAfterSort){ if (adpt.onAfterSort) {
adpt.onAfterSort.call(null, tf, adpt.stt.sortColumn, adpt.onAfterSort.call(null, tf, adpt.stt.sortColumn,
adpt.stt.descending); adpt.stt.descending);
} }
adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn, adpt.emitter.emit('column-sorted', tf, adpt.stt.sortColumn,
@ -105,7 +106,7 @@ export default class AdapterSortableTable{
}; };
this.emitter.on(['sort'], this.emitter.on(['sort'],
(tf, colIdx, desc)=> this.sortByColumnIndex(colIdx, desc)); (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));
this.initialized = true; this.initialized = true;
this.emitter.emit('sort-initialized', tf, this); this.emitter.emit('sort-initialized', tf, this);
@ -116,11 +117,11 @@ export default class AdapterSortableTable{
* @param {Number} colIdx Column index * @param {Number} colIdx Column index
* @param {Boolean} desc Optional: descending manner * @param {Boolean} desc Optional: descending manner
*/ */
sortByColumnIndex(colIdx, desc){ sortByColumnIndex(colIdx, desc) {
this.stt.sort(colIdx, desc); this.stt.sort(colIdx, desc);
} }
overrideSortableTable(){ overrideSortableTable() {
let adpt = this, let adpt = this,
tf = this.tf; tf = this.tf;
@ -128,15 +129,15 @@ export default class AdapterSortableTable{
* Overrides headerOnclick method in order to handle th event * Overrides headerOnclick method in order to handle th event
* @param {Object} e [description] * @param {Object} e [description]
*/ */
SortableTable.prototype.headerOnclick = function(evt){ SortableTable.prototype.headerOnclick = function (evt) {
if(!adpt.initialized){ if (!adpt.initialized) {
return; return;
} }
// find Header element // find Header element
let el = evt.target || evt.srcElement; let el = evt.target || evt.srcElement;
while(el.tagName !== 'TD' && el.tagName !== 'TH'){ while (el.tagName !== 'TD' && el.tagName !== 'TH') {
el = el.parentNode; el = el.parentNode;
} }
@ -152,10 +153,10 @@ export default class AdapterSortableTable{
* @param {Object} oTd TD element * @param {Object} oTd TD element
* @return {Number} Cell index * @return {Number} Cell index
*/ */
SortableTable.getCellIndex = function(oTd){ SortableTable.getCellIndex = function (oTd) {
let cells = oTd.parentNode.cells, let cells = oTd.parentNode.cells,
l = cells.length, i; l = cells.length, i;
for (i = 0; cells[i] != oTd && i < l; i++){} for (i = 0; cells[i] != oTd && i < l; i++) { }
return i; return i;
}; };
@ -163,10 +164,10 @@ export default class AdapterSortableTable{
* Overrides initHeader in order to handle filters row position * Overrides initHeader in order to handle filters row position
* @param {Array} oSortTypes * @param {Array} oSortTypes
*/ */
SortableTable.prototype.initHeader = function(oSortTypes){ SortableTable.prototype.initHeader = function (oSortTypes) {
let stt = this; let stt = this;
if (!stt.tHead){ if (!stt.tHead) {
if(tf.gridLayout){ if (tf.gridLayout) {
stt.tHead = tf.feature('gridLayout').headTbl.tHead; stt.tHead = tf.feature('gridLayout').headTbl.tHead;
} else { } else {
return; return;
@ -181,13 +182,13 @@ export default class AdapterSortableTable{
for (let i = 0; i < l; i++) { for (let i = 0; i < l; i++) {
c = cells[i]; c = cells[i];
if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None'){ if (stt.sortTypes[i] !== null && stt.sortTypes[i] !== 'None') {
c.style.cursor = 'pointer'; c.style.cursor = 'pointer';
img = Dom.create('img', img = Dom.create('img',
['src', adpt.imgPath + adpt.imgBlank]); ['src', adpt.imgPath + adpt.imgBlank]);
c.appendChild(img); c.appendChild(img);
if (stt.sortTypes[i] !== null){ if (stt.sortTypes[i] !== null) {
c.setAttribute( '_sortType', stt.sortTypes[i]); c.setAttribute('_sortType', stt.sortTypes[i]);
} }
Event.add(c, 'click', stt._headerOnclick); Event.add(c, 'click', stt._headerOnclick);
} else { } else {
@ -201,40 +202,40 @@ export default class AdapterSortableTable{
/** /**
* Overrides updateHeaderArrows in order to handle arrows indicators * Overrides updateHeaderArrows in order to handle arrows indicators
*/ */
SortableTable.prototype.updateHeaderArrows = function(){ SortableTable.prototype.updateHeaderArrows = function () {
let stt = this; let stt = this;
let cells, l, img; let cells, l, img;
// external headers // external headers
if(adpt.asyncSort && adpt.triggerIds.length > 0){ if (adpt.asyncSort && adpt.triggerIds.length > 0) {
let triggers = adpt.triggerIds; let triggers = adpt.triggerIds;
cells = []; cells = [];
l = triggers.length; l = triggers.length;
for(let j=0; j<triggers.length; j++){ for (let j = 0; j < triggers.length; j++) {
cells.push(Dom.id(triggers[j])); cells.push(Dom.id(triggers[j]));
} }
} else { } else {
if(!this.tHead){ if (!this.tHead) {
return; return;
} }
cells = stt.tHead.rows[stt.headersRow].cells; cells = stt.tHead.rows[stt.headersRow].cells;
l = cells.length; l = cells.length;
} }
for(let i = 0; i < l; i++){ for (let i = 0; i < l; i++) {
let cellAttr = cells[i].getAttribute('_sortType'); let cellAttr = cells[i].getAttribute('_sortType');
if(cellAttr !== null && cellAttr !== 'None'){ if (cellAttr !== null && cellAttr !== 'None') {
img = cells[i].lastChild || cells[i]; img = cells[i].lastChild || cells[i];
if(img.nodeName.toLowerCase() !== 'img'){ if (img.nodeName.toLowerCase() !== 'img') {
img = Dom.create('img', img = Dom.create('img',
['src', adpt.imgPath + adpt.imgBlank]); ['src', adpt.imgPath + adpt.imgBlank]);
cells[i].appendChild(img); cells[i].appendChild(img);
} }
if (i === stt.sortColumn){ if (i === stt.sortColumn) {
img.className = adpt.imgClassName +' '+ img.className = adpt.imgClassName + ' ' +
(this.descending ? (this.descending ?
adpt.imgDescClassName : adpt.imgDescClassName :
adpt.imgAscClassName); adpt.imgAscClassName);
} else{ } else {
img.className = adpt.imgClassName; img.className = adpt.imgClassName;
} }
} }
@ -248,11 +249,11 @@ export default class AdapterSortableTable{
* @param {Number} nColumn * @param {Number} nColumn
* @return {String} * @return {String}
*/ */
SortableTable.prototype.getRowValue = function(oRow, sType, nColumn){ SortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {
let stt = this; let stt = this;
// if we have defined a custom getRowValue use that // if we have defined a custom getRowValue use that
let sortTypeInfo = stt._sortTypeInfo[sType]; let sortTypeInfo = stt._sortTypeInfo[sType];
if (sortTypeInfo && sortTypeInfo.getRowValue){ if (sortTypeInfo && sortTypeInfo.getRowValue) {
return sortTypeInfo.getRowValue(oRow, nColumn); return sortTypeInfo.getRowValue(oRow, nColumn);
} }
let c = oRow.cells[nColumn]; let c = oRow.cells[nColumn];
@ -266,11 +267,11 @@ export default class AdapterSortableTable{
* @param {Object} oNode DOM element * @param {Object} oNode DOM element
* @return {String} DOM element inner text * @return {String} DOM element inner text
*/ */
SortableTable.getInnerText = function(oNode){ SortableTable.getInnerText = function (oNode) {
if(!oNode){ if (!oNode) {
return; return;
} }
if(oNode.getAttribute(adpt.customKey)){ if (oNode.getAttribute(adpt.customKey)) {
return oNode.getAttribute(adpt.customKey); return oNode.getAttribute(adpt.customKey);
} else { } else {
return Dom.getText(oNode); return Dom.getText(oNode);
@ -278,29 +279,29 @@ export default class AdapterSortableTable{
}; };
} }
addSortType(){ addSortType() {
var args = arguments; var args = arguments;
SortableTable.prototype.addSortType(args[0], args[1], args[2], args[3]); SortableTable.prototype.addSortType(args[0], args[1], args[2], args[3]);
} }
setSortTypes(){ setSortTypes() {
let tf = this.tf, let tf = this.tf,
sortTypes = this.sortTypes, sortTypes = this.sortTypes,
_sortTypes = []; _sortTypes = [];
for(let i=0; i<tf.nbCells; i++){ for (let i = 0; i < tf.nbCells; i++) {
let colType; let colType;
if(sortTypes[i]){ if (sortTypes[i]) {
colType = sortTypes[i].toLowerCase(); colType = sortTypes[i].toLowerCase();
if(colType === 'none'){ if (colType === NONE) {
colType = 'None'; colType = 'None';
} }
} else { // resolve column types } else { // resolve column types
if(tf.hasColNbFormat && tf.colNbFormat[i] !== null){ if (tf.hasColNbFormat && tf.colNbFormat[i] !== null) {
colType = tf.colNbFormat[i].toLowerCase(); colType = tf.colNbFormat[i].toLowerCase();
} else if(tf.hasColDateType && tf.colDateType[i] !== null){ } else if (tf.hasColDateType && tf.colDateType[i] !== null) {
colType = tf.colDateType[i].toLowerCase()+'date'; colType = tf.colDateType[i].toLowerCase() + 'date';
} else { } else {
colType = 'String'; colType = 'String';
} }
@ -317,7 +318,7 @@ export default class AdapterSortableTable{
this.addSortType('string'); this.addSortType('string');
this.addSortType('us', usNumberConverter); this.addSortType('us', usNumberConverter);
this.addSortType('eu', euNumberConverter); this.addSortType('eu', euNumberConverter);
this.addSortType('dmydate', dmyDateConverter ); this.addSortType('dmydate', dmyDateConverter);
this.addSortType('ymddate', ymdDateConverter); this.addSortType('ymddate', ymdDateConverter);
this.addSortType('mdydate', mdyDateConverter); this.addSortType('mdydate', mdyDateConverter);
this.addSortType('ddmmmyyyydate', ddmmmyyyyDateConverter); this.addSortType('ddmmmyyyydate', ddmmmyyyyDateConverter);
@ -326,19 +327,19 @@ export default class AdapterSortableTable{
this.stt = new SortableTable(tf.tbl, _sortTypes); this.stt = new SortableTable(tf.tbl, _sortTypes);
/*** external table headers adapter ***/ /*** external table headers adapter ***/
if(this.asyncSort && this.triggerIds.length > 0){ if (this.asyncSort && this.triggerIds.length > 0) {
let triggers = this.triggerIds; let triggers = this.triggerIds;
for(let j=0; j<triggers.length; j++){ for (let j = 0; j < triggers.length; j++) {
if(triggers[j] === null){ if (triggers[j] === null) {
continue; continue;
} }
let trigger = Dom.id(triggers[j]); let trigger = Dom.id(triggers[j]);
if(trigger){ if (trigger) {
trigger.style.cursor = 'pointer'; trigger.style.cursor = 'pointer';
Event.add(trigger, 'click', (evt) => { Event.add(trigger, 'click', (evt) => {
let elm = evt.target; let elm = evt.target;
if(!this.tf.sort){ if (!this.tf.sort) {
return; return;
} }
this.stt.asyncSort(triggers.indexOf(elm.id)); this.stt.asyncSort(triggers.indexOf(elm.id));
@ -352,20 +353,20 @@ export default class AdapterSortableTable{
/** /**
* Destroy sort * Destroy sort
*/ */
destroy(){ destroy() {
let tf = this.tf; let tf = this.tf;
this.emitter.off(['sort'], this.emitter.off(['sort'],
(tf, colIdx, desc)=> this.sortByColumnIndex(colIdx, desc)); (tf, colIdx, desc) => this.sortByColumnIndex(colIdx, desc));
this.sorted = false; this.sorted = false;
this.initialized = false; this.initialized = false;
this.stt.destroy(); this.stt.destroy();
let ids = tf.getFiltersId(); let ids = tf.getFiltersId();
for (let idx = 0; idx < ids.length; idx++){ for (let idx = 0; idx < ids.length; idx++) {
let header = tf.getHeaderElement(idx); let header = tf.getHeaderElement(idx);
let img = Dom.tag(header, 'img'); let img = Dom.tag(header, 'img');
if(img.length === 1){ if (img.length === 1) {
header.removeChild(img[0]); header.removeChild(img[0]);
} }
} }
@ -374,46 +375,46 @@ export default class AdapterSortableTable{
} }
//Converters //Converters
function usNumberConverter(s){ function usNumberConverter(s) {
return Helpers.removeNbFormat(s, 'us'); return Helpers.removeNbFormat(s, 'us');
} }
function euNumberConverter(s){ function euNumberConverter(s) {
return Helpers.removeNbFormat(s, 'eu'); return Helpers.removeNbFormat(s, 'eu');
} }
function dateConverter(s, format){ function dateConverter(s, format) {
return DateHelper.format(s, format); return DateHelper.format(s, format);
} }
function dmyDateConverter(s){ function dmyDateConverter(s) {
return dateConverter(s, 'DMY'); return dateConverter(s, 'DMY');
} }
function mdyDateConverter(s){ function mdyDateConverter(s) {
return dateConverter(s, 'MDY'); return dateConverter(s, 'MDY');
} }
function ymdDateConverter(s){ function ymdDateConverter(s) {
return dateConverter(s, 'YMD'); return dateConverter(s, 'YMD');
} }
function ddmmmyyyyDateConverter(s){ function ddmmmyyyyDateConverter(s) {
return dateConverter(s, 'DDMMMYYYY'); return dateConverter(s, 'DDMMMYYYY');
} }
function ipAddress(value){ function ipAddress(value) {
let vals = value.split('.'); let vals = value.split('.');
for (let x in vals) { for (let x in vals) {
let val = vals[x]; let val = vals[x];
while (3 > val.length){ while (3 > val.length) {
val = '0'+val; val = '0' + val;
} }
vals[x] = val; vals[x] = val;
} }
return vals.join('.'); return vals.join('.');
} }
function sortIP(a,b){ function sortIP(a, b) {
let aa = ipAddress(a.value.toLowerCase()); let aa = ipAddress(a.value.toLowerCase());
let bb = ipAddress(b.value.toLowerCase()); let bb = ipAddress(b.value.toLowerCase());
if (aa==bb){ if (aa == bb) {
return 0; return 0;
} else if (aa<bb){ } else if (aa < bb) {
return -1; return -1;
} else { } else {
return 1; return 1;

View file

@ -5,6 +5,7 @@ import Str from '../string';
import Sort from '../sort'; import Sort from '../sort';
import Event from '../event'; import Event from '../event';
import Types from '../types'; import Types from '../types';
import {CHECKLIST, NONE} from '../const';
const SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' + const SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +
'{1} manner.'; '{1} manner.';
@ -294,7 +295,7 @@ export class CheckList extends Feature {
if (val === '') { if (val === '') {
//item is hidden //item is hidden
li.style.display = 'none'; li.style.display = NONE;
} }
} }
} }
@ -315,7 +316,7 @@ export class CheckList extends Feature {
Event.add(li0.check, 'click', (evt) => this.optionClick(evt)); Event.add(li0.check, 'click', (evt) => this.optionClick(evt));
if (!this.enableCheckListResetFilter) { if (!this.enableCheckListResetFilter) {
li0.style.display = 'none'; li0.style.display = NONE;
} }
if (tf.enableEmptyOption) { if (tf.enableEmptyOption) {
@ -429,8 +430,7 @@ export class CheckList extends Feature {
*/ */
selectOptions(colIndex, values = []) { selectOptions(colIndex, values = []) {
let tf = this.tf; let tf = this.tf;
if (tf.getFilterType(colIndex) !== tf.fltTypeCheckList || if (tf.getFilterType(colIndex) !== CHECKLIST || values.length === 0) {
values.length === 0) {
return; return;
} }
let flt = tf.getFilterElement(colIndex); let flt = tf.getFilterElement(colIndex);

View file

@ -4,6 +4,7 @@ import Arr from '../array';
import Str from '../string'; import Str from '../string';
import Sort from '../sort'; import Sort from '../sort';
import Event from '../event'; import Event from '../event';
import {SELECT, MULTIPLE, NONE} from '../const';
const SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' + const SORT_ERROR = 'Filter options for column {0} cannot be sorted in ' +
'{1} manner.'; '{1} manner.';
@ -66,16 +67,16 @@ export class Dropdown extends Feature {
let externalFltTgtId = isExternal ? let externalFltTgtId = isExternal ?
tf.externalFltTgtIds[colIndex] : null; tf.externalFltTgtIds[colIndex] : null;
let slc = Dom.create(tf.fltTypeSlc, let slc = Dom.create(SELECT,
['id', tf.prfxFlt + colIndex + '_' + tf.id], ['id', tf.prfxFlt + colIndex + '_' + tf.id],
['ct', colIndex], ['filled', '0'] ['ct', colIndex], ['filled', '0']
); );
if (col === tf.fltTypeMulti) { if (col === MULTIPLE) {
slc.multiple = tf.fltTypeMulti; slc.multiple = MULTIPLE;
slc.title = this.multipleSlcTooltip; slc.title = this.multipleSlcTooltip;
} }
slc.className = Str.lower(col) === tf.fltTypeSlc ? slc.className = Str.lower(col) === SELECT ?
tf.fltCssClass : tf.fltMultiCssClass; tf.fltCssClass : tf.fltMultiCssClass;
//filter is appended in container element //filter is appended in container element
@ -292,7 +293,7 @@ export class Dropdown extends Feature {
let opt; let opt;
//fill select on demand //fill select on demand
if (tf.loadFltOnDemand && slcValue === this.opts[y] && if (tf.loadFltOnDemand && slcValue === this.opts[y] &&
tf.getFilterType(colIndex) === tf.fltTypeSlc) { tf.getFilterType(colIndex) === SELECT) {
opt = Dom.createOpt(lbl, val, true); opt = Dom.createOpt(lbl, val, true);
} else { } else {
opt = Dom.createOpt(lbl, val, false); opt = Dom.createOpt(lbl, val, false);
@ -316,7 +317,7 @@ export class Dropdown extends Feature {
let opt0 = Dom.createOpt( let opt0 = Dom.createOpt(
(!this.enableSlcResetFilter ? '' : tf.displayAllText), ''); (!this.enableSlcResetFilter ? '' : tf.displayAllText), '');
if (!this.enableSlcResetFilter) { if (!this.enableSlcResetFilter) {
opt0.style.display = 'none'; opt0.style.display = NONE;
} }
slc.appendChild(opt0); slc.appendChild(opt0);
if (tf.enableEmptyOption) { if (tf.enableEmptyOption) {
@ -337,8 +338,7 @@ export class Dropdown extends Feature {
*/ */
selectOptions(colIndex, values = []) { selectOptions(colIndex, values = []) {
let tf = this.tf; let tf = this.tf;
if (tf.getFilterType(colIndex) !== tf.fltTypeMulti || if (tf.getFilterType(colIndex) !== MULTIPLE || values.length === 0) {
values.length === 0) {
return; return;
} }
let slc = tf.getFilterElement(colIndex); let slc = tf.getFilterElement(colIndex);

View file

@ -3,6 +3,7 @@ import Dom from '../dom';
import Types from '../types'; import Types from '../types';
import Event from '../event'; import Event from '../event';
import Str from '../string'; import Str from '../string';
import {NONE} from '../const';
export class GridLayout extends Feature{ export class GridLayout extends Feature{
@ -311,7 +312,7 @@ export class GridLayout extends Feature{
}; };
if(tf.popupFilters){ if(tf.popupFilters){
filtersRow.style.display = 'none'; filtersRow.style.display = NONE;
} }
if(tbl.clientWidth !== this.headTbl.clientWidth){ if(tbl.clientWidth !== this.headTbl.clientWidth){

View file

@ -1,7 +1,7 @@
import {Feature} from './feature'; import {Feature} from './feature';
import Dom from '../dom'; import Dom from '../dom';
import Event from '../event'; import Event from '../event';
import {NONE} from '../const';
const WIKI_URL = 'https://github.com/koalyptus/TableFilter/wiki/' + const WIKI_URL = 'https://github.com/koalyptus/TableFilter/wiki/' +
'4.-Filter-operators'; '4.-Filter-operators';
@ -128,10 +128,10 @@ export class Help extends Feature{
return; return;
} }
var divDisplay = this.cont.style.display; var divDisplay = this.cont.style.display;
if(divDisplay === '' || divDisplay === 'none'){ if(divDisplay === '' || divDisplay === NONE){
this.cont.style.display = 'inline'; this.cont.style.display = 'inline';
} else { } else {
this.cont.style.display = 'none'; this.cont.style.display = NONE;
} }
} }

View file

@ -1,10 +1,11 @@
import {Feature} from './feature'; import {Feature} from './feature';
import Dom from '../dom'; import Dom from '../dom';
import Types from '../types'; import Types from '../types';
import {NONE} from '../const';
let global = window; let global = window;
export class Loader extends Feature{ export class Loader extends Feature {
/** /**
* Loading message/spinner * Loading message/spinner
@ -39,31 +40,31 @@ export class Loader extends Feature{
} }
init() { init() {
if(this.initialized){ if (this.initialized) {
return; return;
} }
let tf = this.tf; let tf = this.tf;
let emitter = this.emitter; let emitter = this.emitter;
let containerDiv = Dom.create('div', ['id', this.prfxLoader+tf.id]); let containerDiv = Dom.create('div', ['id', this.prfxLoader + tf.id]);
containerDiv.className = this.loaderCssClass; containerDiv.className = this.loaderCssClass;
let targetEl = !this.loaderTgtId ? let targetEl = !this.loaderTgtId ?
tf.tbl.parentNode : Dom.id(this.loaderTgtId); tf.tbl.parentNode : Dom.id(this.loaderTgtId);
if(!this.loaderTgtId){ if (!this.loaderTgtId) {
targetEl.insertBefore(containerDiv, tf.tbl); targetEl.insertBefore(containerDiv, tf.tbl);
} else { } else {
targetEl.appendChild(containerDiv); targetEl.appendChild(containerDiv);
} }
this.loaderDiv = containerDiv; this.loaderDiv = containerDiv;
if(!this.loaderHtml){ if (!this.loaderHtml) {
this.loaderDiv.appendChild(Dom.text(this.loaderText)); this.loaderDiv.appendChild(Dom.text(this.loaderText));
} else { } else {
this.loaderDiv.innerHTML = this.loaderHtml; this.loaderDiv.innerHTML = this.loaderHtml;
} }
this.show('none'); this.show(NONE);
// Subscribe to events // Subscribe to events
emitter.on([ emitter.on([
@ -76,7 +77,7 @@ export class Loader extends Feature{
'before-reset-page-length', 'before-reset-page-length',
'before-loading-extensions', 'before-loading-extensions',
'before-loading-themes'], 'before-loading-themes'],
()=> this.show('') () => this.show('')
); );
emitter.on([ emitter.on([
'after-filtering', 'after-filtering',
@ -88,36 +89,36 @@ export class Loader extends Feature{
'after-reset-page-length', 'after-reset-page-length',
'after-loading-extensions', 'after-loading-extensions',
'after-loading-themes'], 'after-loading-themes'],
()=> this.show('none') () => this.show(NONE)
); );
this.initialized = true; this.initialized = true;
} }
show(p) { show(p) {
if(!this.isEnabled() /*|| this.loaderDiv.style.display === p*/){ if (!this.isEnabled()) {
return; return;
} }
let displayLoader = () => { let displayLoader = () => {
if(!this.loaderDiv){ if (!this.loaderDiv) {
return; return;
} }
if(this.onShowLoader && p !== 'none'){ if (this.onShowLoader && p !== NONE) {
this.onShowLoader.call(null, this); this.onShowLoader.call(null, this);
} }
this.loaderDiv.style.display = p; this.loaderDiv.style.display = p;
if(this.onHideLoader && p === 'none'){ if (this.onHideLoader && p === NONE) {
this.onHideLoader.call(null, this); this.onHideLoader.call(null, this);
} }
}; };
let t = p === 'none' ? this.loaderCloseDelay : 1; let t = p === NONE ? this.loaderCloseDelay : 1;
global.setTimeout(displayLoader, t); global.setTimeout(displayLoader, t);
} }
destroy() { destroy() {
if(!this.initialized){ if (!this.initialized) {
return; return;
} }
@ -137,7 +138,7 @@ export class Loader extends Feature{
'before-reset-page-length', 'before-reset-page-length',
'before-loading-extensions', 'before-loading-extensions',
'before-loading-themes'], 'before-loading-themes'],
()=> this.show('') () => this.show('')
); );
emitter.off([ emitter.off([
'after-filtering', 'after-filtering',
@ -149,7 +150,7 @@ export class Loader extends Feature{
'after-reset-page-length', 'after-reset-page-length',
'after-loading-extensions', 'after-loading-extensions',
'after-loading-themes'], 'after-loading-themes'],
()=> this.show('none') () => this.show(NONE)
); );
this.initialized = false; this.initialized = false;

View file

@ -1,6 +1,7 @@
import {Feature} from './feature'; import {Feature} from './feature';
import Dom from '../dom'; import Dom from '../dom';
import Types from '../types'; import Types from '../types';
import {NONE} from '../const';
export class NoResults extends Feature{ export class NoResults extends Feature{
@ -101,7 +102,7 @@ export class NoResults extends Feature{
this.onBeforeHideMsg.call(null, this.tf, this); this.onBeforeHideMsg.call(null, this.tf, this);
} }
this.cont.style.display = 'none'; this.cont.style.display = NONE;
if(this.onBeforeHideMsg){ if(this.onBeforeHideMsg){
this.onBeforeHideMsg.call(null, this.tf, this); this.onBeforeHideMsg.call(null, this.tf, this);

View file

@ -3,6 +3,7 @@ import Dom from '../dom';
import Types from '../types'; import Types from '../types';
import Str from '../string'; import Str from '../string';
import Event from '../event'; import Event from '../event';
import {INPUT, SELECT, NONE} from '../const';
export class Paging extends Feature { export class Paging extends Feature {
@ -83,7 +84,7 @@ export class Paging extends Feature {
//enables/disables paging buttons //enables/disables paging buttons
this.hasPagingBtns = f.paging_btns === false ? false : true; this.hasPagingBtns = f.paging_btns === false ? false : true;
//defines previous page button html //defines previous page button html
this.pageSelectorType = f.page_selector_type || tf.fltTypeSlc; this.pageSelectorType = f.page_selector_type || SELECT;
//calls function before page is changed //calls function before page is changed
this.onBeforeChangePage = Types.isFn(f.on_before_change_page) ? this.onBeforeChangePage = Types.isFn(f.on_before_change_page) ?
f.on_before_change_page : null; f.on_before_change_page : null;
@ -130,12 +131,12 @@ export class Paging extends Feature {
// Paging DOM events // Paging DOM events
this.evt = { this.evt = {
slcIndex() { slcIndex() {
return (o.pageSelectorType === tf.fltTypeSlc) ? return (o.pageSelectorType === SELECT) ?
o.pagingSlc.options.selectedIndex : o.pagingSlc.options.selectedIndex :
parseInt(o.pagingSlc.value, 10) - 1; parseInt(o.pagingSlc.value, 10) - 1;
}, },
nbOpts() { nbOpts() {
return (o.pageSelectorType === tf.fltTypeSlc) ? return (o.pageSelectorType === SELECT) ?
parseInt(o.pagingSlc.options.length, 10) - 1 : parseInt(o.pagingSlc.options.length, 10) - 1 :
(o.nbPages - 1); (o.nbPages - 1);
}, },
@ -204,17 +205,15 @@ export class Paging extends Feature {
}; };
// Paging drop-down list selector // Paging drop-down list selector
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
slcPages = Dom.create( slcPages = Dom.create(SELECT, ['id', this.prfxSlcPages + tf.id]);
tf.fltTypeSlc, ['id', this.prfxSlcPages + tf.id]);
slcPages.className = this.pgSlcCssClass; slcPages.className = this.pgSlcCssClass;
Event.add(slcPages, 'change', evt.slcPagesChange); Event.add(slcPages, 'change', evt.slcPagesChange);
} }
// Paging input selector // Paging input selector
if (this.pageSelectorType === tf.fltTypeInp) { if (this.pageSelectorType === INPUT) {
slcPages = Dom.create( slcPages = Dom.create(INPUT,
tf.fltTypeInp,
['id', this.prfxSlcPages + tf.id], ['id', this.prfxSlcPages + tf.id],
['value', this.currentPageNb] ['value', this.currentPageNb]
); );
@ -235,8 +234,7 @@ export class Paging extends Feature {
if (this.hasPagingBtns) { if (this.hasPagingBtns) {
// Next button // Next button
if (!this.btnNextPageHtml) { if (!this.btnNextPageHtml) {
var btn_next = Dom.create( var btn_next = Dom.create(INPUT,
tf.fltTypeInp,
['id', this.prfxBtnNext + tf.id], ['id', this.prfxBtnNext + tf.id],
['type', 'button'], ['type', 'button'],
['value', this.btnNextPageText], ['value', this.btnNextPageText],
@ -251,8 +249,7 @@ export class Paging extends Feature {
} }
// Previous button // Previous button
if (!this.btnPrevPageHtml) { if (!this.btnPrevPageHtml) {
var btn_prev = Dom.create( var btn_prev = Dom.create(INPUT,
tf.fltTypeInp,
['id', this.prfxBtnPrev + tf.id], ['id', this.prfxBtnPrev + tf.id],
['type', 'button'], ['type', 'button'],
['value', this.btnPrevPageText], ['value', this.btnPrevPageText],
@ -267,8 +264,7 @@ export class Paging extends Feature {
} }
// Last button // Last button
if (!this.btnLastPageHtml) { if (!this.btnLastPageHtml) {
var btn_last = Dom.create( var btn_last = Dom.create(INPUT,
tf.fltTypeInp,
['id', this.prfxBtnLast + tf.id], ['id', this.prfxBtnLast + tf.id],
['type', 'button'], ['type', 'button'],
['value', this.btnLastPageText], ['value', this.btnLastPageText],
@ -283,8 +279,7 @@ export class Paging extends Feature {
} }
// First button // First button
if (!this.btnFirstPageHtml) { if (!this.btnFirstPageHtml) {
var btn_first = Dom.create( var btn_first = Dom.create(INPUT,
tf.fltTypeInp,
['id', this.prfxBtnFirst + tf.id], ['id', this.prfxBtnFirst + tf.id],
['type', 'button'], ['type', 'button'],
['value', this.btnFirstPageText], ['value', this.btnFirstPageText],
@ -386,13 +381,13 @@ export class Paging extends Feature {
//refresh page nb span //refresh page nb span
pgspan.innerHTML = this.nbPages; pgspan.innerHTML = this.nbPages;
//select clearing shortcut //select clearing shortcut
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
this.pagingSlc.innerHTML = ''; this.pagingSlc.innerHTML = '';
} }
if (this.nbPages > 0) { if (this.nbPages > 0) {
mdiv.style.visibility = 'visible'; mdiv.style.visibility = 'visible';
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
for (var z = 0; z < this.nbPages; z++) { for (var z = 0; z < this.nbPages; z++) {
var opt = Dom.createOpt(z + 1, z * this.pagingLength, var opt = Dom.createOpt(z + 1, z * this.pagingLength,
false); false);
@ -439,7 +434,7 @@ export class Paging extends Feature {
rowDisplayed = true; rowDisplayed = true;
} }
} else { } else {
r.style.display = 'none'; r.style.display = NONE;
} }
this.emitter.emit('row-paged', tf, validRowIdx, h, rowDisplayed); this.emitter.emit('row-paged', tf, validRowIdx, h, rowDisplayed);
} }
@ -510,8 +505,7 @@ export class Paging extends Feature {
ev.target.blur(); ev.target.blur();
}; };
var slcR = Dom.create( var slcR = Dom.create( SELECT, ['id', this.prfxSlcResults + tf.id]);
tf.fltTypeSlc, ['id', this.prfxSlcResults + tf.id]);
slcR.className = this.resultsSlcCssClass; slcR.className = this.resultsSlcCssClass;
var slcRText = this.resultsPerPage[0], var slcRText = this.resultsPerPage[0],
slcROpts = this.resultsPerPage[1]; slcROpts = this.resultsPerPage[1];
@ -577,7 +571,7 @@ export class Paging extends Feature {
this.emitter.emit('before-page-change', tf, (index + 1)); this.emitter.emit('before-page-change', tf, (index + 1));
if (index === null) { if (index === null) {
index = this.pageSelectorType === tf.fltTypeSlc ? index = this.pageSelectorType === SELECT ?
this.pagingSlc.options.selectedIndex : this.pagingSlc.value - 1; this.pagingSlc.options.selectedIndex : this.pagingSlc.value - 1;
} }
if (index >= 0 && index <= (this.nbPages - 1)) { if (index >= 0 && index <= (this.nbPages - 1)) {
@ -585,13 +579,13 @@ export class Paging extends Feature {
this.onBeforeChangePage.call(null, this, (index + 1)); this.onBeforeChangePage.call(null, this, (index + 1));
} }
this.currentPageNb = parseInt(index, 10) + 1; this.currentPageNb = parseInt(index, 10) + 1;
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
this.pagingSlc.options[index].selected = true; this.pagingSlc.options[index].selected = true;
} else { } else {
this.pagingSlc.value = this.currentPageNb; this.pagingSlc.value = this.currentPageNb;
} }
this.startPagingRow = (this.pageSelectorType === tf.fltTypeSlc) ? this.startPagingRow = (this.pageSelectorType === SELECT) ?
this.pagingSlc.value : (index * this.pagingLength); this.pagingSlc.value : (index * this.pagingLength);
this.groupByPage(); this.groupByPage();
@ -627,7 +621,7 @@ export class Paging extends Feature {
var slcR = this.resultsPerPageSlc; var slcR = this.resultsPerPageSlc;
var slcIndex = slcR.selectedIndex; var slcIndex = slcR.selectedIndex;
var slcPagesSelIndex = (this.pageSelectorType === tf.fltTypeSlc) ? var slcPagesSelIndex = (this.pageSelectorType === SELECT) ?
this.pagingSlc.selectedIndex : this.pagingSlc.selectedIndex :
parseInt(this.pagingSlc.value - 1, 10); parseInt(this.pagingSlc.value - 1, 10);
this.pagingLength = parseInt(slcR.options[slcIndex].value, 10); this.pagingLength = parseInt(slcR.options[slcIndex].value, 10);
@ -639,7 +633,7 @@ export class Paging extends Feature {
} }
this.setPagingInfo(); this.setPagingInfo();
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
var slcIdx = var slcIdx =
(this.pagingSlc.options.length - 1 <= slcPagesSelIndex) ? (this.pagingSlc.options.length - 1 <= slcPagesSelIndex) ?
(this.pagingSlc.options.length - 1) : slcPagesSelIndex; (this.pagingSlc.options.length - 1) : slcPagesSelIndex;
@ -708,10 +702,10 @@ export class Paging extends Feature {
var evt = this.evt; var evt = this.evt;
if (this.pagingSlc) { if (this.pagingSlc) {
if (this.pageSelectorType === tf.fltTypeSlc) { if (this.pageSelectorType === SELECT) {
Event.remove(this.pagingSlc, 'change', evt.slcPagesChange); Event.remove(this.pagingSlc, 'change', evt.slcPagesChange);
} }
else if (this.pageSelectorType === tf.fltTypeInp) { else if (this.pageSelectorType === INPUT) {
Event.remove(this.pagingSlc, 'keypress', evt._detectKey); Event.remove(this.pagingSlc, 'keypress', evt._detectKey);
} }
Dom.remove(this.pagingSlc); Dom.remove(this.pagingSlc);

View file

@ -2,6 +2,7 @@ import {Feature} from './feature';
import Types from '../types'; import Types from '../types';
import Dom from '../dom'; import Dom from '../dom';
import Event from '../event'; import Event from '../event';
import {INPUT, NONE} from '../const';
export class PopupFilter extends Feature{ export class PopupFilter extends Feature{
@ -91,7 +92,7 @@ export class PopupFilter extends Feature{
} }
for(var i=0; i<tf.nbCells; i++){ for(var i=0; i<tf.nbCells; i++){
if(tf.getFilterType(i) === tf.fltTypeNone){ if(tf.getFilterType(i) === NONE){
continue; continue;
} }
var popUpSpan = Dom.create( var popUpSpan = Dom.create(
@ -163,14 +164,14 @@ export class PopupFilter extends Feature{
var tf = this.tf, var tf = this.tf,
popUpFltElm = this.popUpFltElms[colIndex]; popUpFltElm = this.popUpFltElms[colIndex];
if(popUpFltElm.style.display === 'none' || if(popUpFltElm.style.display === NONE ||
popUpFltElm.style.display === ''){ popUpFltElm.style.display === ''){
if(this.onBeforePopUpOpen){ if(this.onBeforePopUpOpen){
this.onBeforePopUpOpen.call( this.onBeforePopUpOpen.call(
null, this, this.popUpFltElms[colIndex], colIndex); null, this, this.popUpFltElms[colIndex], colIndex);
} }
popUpFltElm.style.display = 'block'; popUpFltElm.style.display = 'block';
if(tf.getFilterType(colIndex) === tf.fltTypeInp){ if(tf.getFilterType(colIndex) === INPUT){
var flt = tf.getFilterElement(colIndex); var flt = tf.getFilterElement(colIndex);
if(flt){ if(flt){
flt.focus(); flt.focus();
@ -185,7 +186,7 @@ export class PopupFilter extends Feature{
this.onBeforePopUpClose.call( this.onBeforePopUpClose.call(
null, this, this.popUpFltElms[colIndex], colIndex); null, this, this.popUpFltElms[colIndex], colIndex);
} }
popUpFltElm.style.display = 'none'; popUpFltElm.style.display = NONE;
if(this.onAfterPopUpClose){ if(this.onAfterPopUpClose){
this.onAfterPopUpClose.call( this.onAfterPopUpClose.call(
null, this, this.popUpFltElms[colIndex], colIndex); null, this, this.popUpFltElms[colIndex], colIndex);
@ -204,7 +205,7 @@ export class PopupFilter extends Feature{
} }
var popUpFltElm = this.popUpFltElms[i]; var popUpFltElm = this.popUpFltElms[i];
if(popUpFltElm){ if(popUpFltElm){
popUpFltElm.style.display = 'none'; popUpFltElm.style.display = NONE;
} }
} }
} }

View file

@ -21,6 +21,8 @@ import {AlternateRows} from './modules/alternateRows';
import {NoResults} from './modules/noResults'; import {NoResults} from './modules/noResults';
import {State} from './modules/state'; import {State} from './modules/state';
import {INPUT, SELECT, MULTIPLE, CHECKLIST, NONE} from './const';
let global = window, let global = window,
doc = global.document; doc = global.document;
@ -35,8 +37,6 @@ export class TableFilter {
* @param {Object} configuration object * @param {Object} configuration object
*/ */
constructor(...args) { constructor(...args) {
if (args.length === 0) { return; }
this.id = null; this.id = null;
this.version = '{VERSION}'; this.version = '{VERSION}';
this.year = new Date().getFullYear(); this.year = new Date().getFullYear();
@ -52,7 +52,7 @@ export class TableFilter {
// TODO: use for-of with babel plug-in // TODO: use for-of with babel plug-in
args.forEach((arg) => { args.forEach((arg) => {
// for (let arg of args) { // for (let arg of args) {
let argtype = typeof arg; let argtype = typeof arg;
if (argtype === 'object' && arg && arg.nodeName === 'TABLE') { if (argtype === 'object' && arg && arg.nodeName === 'TABLE') {
this.tbl = arg; this.tbl = arg;
@ -65,13 +65,13 @@ export class TableFilter {
} else if (argtype === 'object') { } else if (argtype === 'object') {
this.cfg = arg; this.cfg = arg;
} }
// } // }
}); });
if (!this.tbl || this.tbl.nodeName != 'TABLE' || if (!this.tbl || this.tbl.nodeName !== 'TABLE' ||
this.getRowsNb() === 0) { this.getRowsNb() === 0) {
throw new Error( throw new Error('Could not instantiate TableFilter: HTML table ' +
'Could not instantiate TableFilter: HTML table not found.'); 'DOMElement not found.');
} }
// configuration object // configuration object
@ -88,11 +88,8 @@ export class TableFilter {
this.basePath = f.base_path || 'tablefilter/'; this.basePath = f.base_path || 'tablefilter/';
/*** filter types ***/ /*** filter types ***/
this.fltTypeInp = 'input'; // this.fltTypeCheckList = 'checklist';
this.fltTypeSlc = 'select'; // this.fltTypeNone = 'none';
this.fltTypeMulti = 'multiple';
this.fltTypeCheckList = 'checklist';
this.fltTypeNone = 'none';
/*** filters' grid properties ***/ /*** filters' grid properties ***/
@ -488,19 +485,19 @@ export class TableFilter {
//only 1 input for single search //only 1 input for single search
if (this.singleSearchFlt) { if (this.singleSearchFlt) {
col = this.fltTypeInp; col = INPUT;
inpclass = this.singleFltCssClass; inpclass = this.singleFltCssClass;
} }
//drop-down filters //drop-down filters
if (col === this.fltTypeSlc || col === this.fltTypeMulti) { if (col === SELECT || col === MULTIPLE) {
if (!Mod.dropdown) { if (!Mod.dropdown) {
Mod.dropdown = new Dropdown(this); Mod.dropdown = new Dropdown(this);
} }
Mod.dropdown.init(i, this.isExternalFlt, fltcell); Mod.dropdown.init(i, this.isExternalFlt, fltcell);
} }
// checklist // checklist
else if (col === this.fltTypeCheckList) { else if (col === CHECKLIST) {
if (!Mod.checkList) { if (!Mod.checkList) {
Mod.checkList = new CheckList(this); Mod.checkList = new CheckList(this);
} }
@ -699,7 +696,7 @@ export class TableFilter {
fltrow.className = this.fltsRowCssClass; fltrow.className = this.fltsRowCssClass;
if (this.isExternalFlt) { if (this.isExternalFlt) {
fltrow.style.display = 'none'; fltrow.style.display = NONE;
} }
this.emitter.emit('filters-row-inserted', this, fltrow); this.emitter.emit('filters-row-inserted', this, fltrow);
@ -729,8 +726,8 @@ export class TableFilter {
let col = this.getFilterType(colIndex); let col = this.getFilterType(colIndex);
let externalFltTgtId = this.isExternalFlt ? let externalFltTgtId = this.isExternalFlt ?
this.externalFltTgtIds[colIndex] : null; this.externalFltTgtIds[colIndex] : null;
let inptype = col === this.fltTypeInp ? 'text' : 'hidden'; let inptype = col === INPUT ? 'text' : 'hidden';
let inp = Dom.create(this.fltTypeInp, let inp = Dom.create(INPUT,
['id', this.prfxFlt + colIndex + '_' + this.id], ['id', this.prfxFlt + colIndex + '_' + this.id],
['type', inptype], ['ct', colIndex]); ['type', inptype], ['ct', colIndex]);
@ -767,7 +764,7 @@ export class TableFilter {
_buildSubmitButton(colIndex, container) { _buildSubmitButton(colIndex, container) {
let externalFltTgtId = this.isExternalFlt ? let externalFltTgtId = this.isExternalFlt ?
this.externalFltTgtIds[colIndex] : null; this.externalFltTgtIds[colIndex] : null;
let btn = Dom.create(this.fltTypeInp, let btn = Dom.create(INPUT,
['id', this.prfxValButton + colIndex + '_' + this.id], ['id', this.prfxValButton + colIndex + '_' + this.id],
['type', 'button'], ['value', this.btnText]); ['type', 'button'], ['value', this.btnText]);
btn.className = this.btnCssClass; btn.className = this.btnCssClass;
@ -1566,16 +1563,15 @@ export class TableFilter {
} }
let fltColType = this.getFilterType(index); let fltColType = this.getFilterType(index);
if (fltColType !== this.fltTypeMulti && if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {
fltColType !== this.fltTypeCheckList) {
fltValue = flt.value; fltValue = flt.value;
} }
//mutiple select //mutiple select
else if (fltColType === this.fltTypeMulti) { else if (fltColType === MULTIPLE) {
fltValue = this.feature('dropdown').getValues(index); fltValue = this.feature('dropdown').getValues(index);
} }
//checklist //checklist
else if (fltColType === this.fltTypeCheckList) { else if (fltColType === CHECKLIST) {
fltValue = this.feature('checkList').getValues(index); fltValue = this.feature('checkList').getValues(index);
} }
//return an empty string if collection is empty or contains a single //return an empty string if collection is empty or contains a single
@ -1825,7 +1821,7 @@ export class TableFilter {
isValid = true; isValid = true;
} }
let displayFlag = isValid ? '' : 'none', let displayFlag = isValid ? '' : NONE,
validFlag = isValid ? 'true' : 'false'; validFlag = isValid ? 'true' : 'false';
row.style.display = displayFlag; row.style.display = displayFlag;
@ -1871,8 +1867,7 @@ export class TableFilter {
let slc = this.getFilterElement(index), let slc = this.getFilterElement(index),
fltColType = this.getFilterType(index); fltColType = this.getFilterType(index);
if (fltColType !== this.fltTypeMulti && if (fltColType !== MULTIPLE && fltColType !== CHECKLIST) {
fltColType != this.fltTypeCheckList) {
if (this.loadFltOnDemand && !this.initialized) { if (this.loadFltOnDemand && !this.initialized) {
this.emitter.emit('build-select-filter', this, index, this.emitter.emit('build-select-filter', this, index,
this.linkedFilters, this.isExternalFlt); this.linkedFilters, this.isExternalFlt);
@ -1880,7 +1875,7 @@ export class TableFilter {
slc.value = query; slc.value = query;
} }
//multiple selects //multiple selects
else if (fltColType === this.fltTypeMulti) { else if (fltColType === MULTIPLE) {
let values = Types.isArray(query) ? query : let values = Types.isArray(query) ? query :
query.split(' ' + this.orOperator + ' '); query.split(' ' + this.orOperator + ' ');
@ -1892,7 +1887,7 @@ export class TableFilter {
this.emitter.emit('select-options', this, index, values); this.emitter.emit('select-options', this, index, values);
} }
//checklist //checklist
else if (fltColType === this.fltTypeCheckList) { else if (fltColType === CHECKLIST) {
let values = []; let values = [];
if (this.loadFltOnDemand && !this.initialized) { if (this.loadFltOnDemand && !this.initialized) {
this.emitter.emit('build-checklist-filter', this, index, this.emitter.emit('build-checklist-filter', this, index,
@ -2058,9 +2053,9 @@ export class TableFilter {
if (!this.linkedFilters || !this.activeFilterId) { if (!this.linkedFilters || !this.activeFilterId) {
return; return;
} }
let slcA1 = this.getFiltersByType(this.fltTypeSlc, true), let slcA1 = this.getFiltersByType(SELECT, true),
slcA2 = this.getFiltersByType(this.fltTypeMulti, true), slcA2 = this.getFiltersByType(MULTIPLE, true),
slcA3 = this.getFiltersByType(this.fltTypeCheckList, true), slcA3 = this.getFiltersByType(CHECKLIST, true),
slcIndex = slcA1.concat(slcA2); slcIndex = slcA1.concat(slcA2);
slcIndex = slcIndex.concat(slcA3); slcIndex = slcIndex.concat(slcA3);
@ -2107,7 +2102,7 @@ export class TableFilter {
isExactMatch(colIndex) { isExactMatch(colIndex) {
let fltType = this.getFilterType(colIndex); let fltType = this.getFilterType(colIndex);
return this.exactMatchByCol[colIndex] || this.exactMatch || return this.exactMatchByCol[colIndex] || this.exactMatch ||
(fltType !== this.fltTypeInp); fltType !== INPUT;
} }
/** /**
@ -2210,7 +2205,7 @@ export class TableFilter {
for (let k = this.refRow; k < this.getRowsNb(true); k++) { for (let k = this.refRow; k < this.getRowsNb(true); k++) {
let r = this.tbl.rows[k]; let r = this.tbl.rows[k];
if (!this.paging) { if (!this.paging) {
if (this.getRowDisplay(r) !== 'none') { if (this.getRowDisplay(r) !== NONE) {
this.validRowsIndex.push(r.rowIndex); this.validRowsIndex.push(r.rowIndex);
} }
} else { } else {
@ -2308,7 +2303,7 @@ export class TableFilter {
*/ */
getFilterType(colIndex) { getFilterType(colIndex) {
let colType = this.cfg['col_' + colIndex]; let colType = this.cfg['col_' + colIndex];
return !colType ? this.fltTypeInp : Str.lower(colType); return !colType ? INPUT : Str.lower(colType);
} }
/** /**

View file

@ -20,7 +20,7 @@
var filtersConfig = { var filtersConfig = {
base_path: '../dist/tablefilter/', base_path: '../dist/tablefilter/',
auto_filter: true, auto_filter: true,
auto_filter_delay: 1100, //milliseconds auto_filter_delay: 750, //milliseconds
filters_row_index: 1, filters_row_index: 1,
state: true, state: true,
alternate_rows: true, alternate_rows: true,