From b76cc476665a1abde387bc71670c1ca06a5366fb Mon Sep 17 00:00:00 2001 From: Max Guglielmi Date: Thu, 4 Jun 2015 23:04:38 +1000 Subject: [PATCH] Added no filters test --- dist/tablefilter/1-9803ed6151473186f605.js | 3 + dist/tablefilter/1-b6f853f028e3df14c6c9.js | 3 - dist/tablefilter/tablefilter.js | 8 +- examples/dev.html | 7 +- .../advancedGrid/adapterEzEditTable.js | 7 +- src-es6/modules/checkList.js | 5 +- src-es6/modules/dropdown.js | 3 +- src-es6/modules/paging.js | 2 +- src-es6/tablefilter.js | 245 ++++++++---------- test/libs/polyfill.js | 10 + test/test-active-columns.html | 1 + test/test-alternate-rows.html | 1 + test/test-always-visible-rows.html | 1 + test/test-case-sensitive-query.html | 1 + test/test-checklist.html | 1 + test/test-clear-button.html | 1 + test/test-col-ops.html | 1 + test/test-col-widths.html | 1 + test/test-config.js | 13 - test/test-custom-options.html | 1 + test/test-disable-enter-key.html | 1 + test/test-dropdown.html | 1 + test/test-exact-query-match.html | 1 + test/test-grid-layout.html | 1 + test/test-help.html | 1 + test/test-highlight-keywords.html | 1 + test/test-loader.html | 1 + test/test-no-filters.html | 80 ++++++ test/test-no-filters.js | 44 ++++ test/test-paging.html | 1 + test/test-popup-filter.html | 1 + test/test-rows-counter.html | 1 + test/test-sort-custom-sorter.html | 1 + test/test-sort-grid-layout.html | 1 + test/test-sort-key.html | 1 + test/test-sort.html | 1 + test/test-status-bar.html | 1 + test/test-store.html | 1 + test/test.html | 1 + 39 files changed, 289 insertions(+), 167 deletions(-) create mode 100644 dist/tablefilter/1-9803ed6151473186f605.js delete mode 100644 dist/tablefilter/1-b6f853f028e3df14c6c9.js create mode 100644 test/libs/polyfill.js delete mode 100644 test/test-config.js create mode 100644 test/test-no-filters.html create mode 100644 test/test-no-filters.js diff --git a/dist/tablefilter/1-9803ed6151473186f605.js b/dist/tablefilter/1-9803ed6151473186f605.js new file mode 100644 index 00000000..c0e0a214 --- /dev/null +++ b/dist/tablefilter/1-9803ed6151473186f605.js @@ -0,0 +1,3 @@ +webpackJsonp([1],[,function(t,e,s){function i(t){return s(l(t))}function l(t){return a[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var a={"./array":7,"./array.js":7,"./cookie":5,"./cookie.js":5,"./date":8,"./date.js":8,"./dom":3,"./dom.js":3,"./event":2,"./event.js":2,"./extensions/advancedGrid/adapterEzEditTable":25,"./extensions/advancedGrid/adapterEzEditTable.js":25,"./extensions/advancedGrid/advancedGrid":26,"./extensions/advancedGrid/advancedGrid.js":26,"./extensions/colsVisibility/colsVisibility":27,"./extensions/colsVisibility/colsVisibility.js":27,"./extensions/sort/adapterSortabletable":28,"./extensions/sort/adapterSortabletable.js":28,"./extensions/sort/sort":29,"./extensions/sort/sort.js":29,"./helpers":9,"./helpers.js":9,"./modules/alternateRows":22,"./modules/alternateRows.js":22,"./modules/checkList":16,"./modules/checkList.js":16,"./modules/clearButton":20,"./modules/clearButton.js":20,"./modules/colOps":23,"./modules/colOps.js":23,"./modules/dropdown":15,"./modules/dropdown.js":15,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":21,"./modules/help.js":21,"./modules/highlightKeywords":13,"./modules/highlightKeywords.js":13,"./modules/loader":12,"./modules/loader.js":12,"./modules/paging":19,"./modules/paging.js":19,"./modules/popupFilter":14,"./modules/popupFilter.js":14,"./modules/rowsCounter":17,"./modules/rowsCounter.js":17,"./modules/statusBar":18,"./modules/statusBar.js":18,"./modules/store":10,"./modules/store.js":10,"./sort":24,"./sort.js":24,"./string":4,"./string.js":4,"./types":6,"./types.js":6};i.keys=function(){return Object.keys(a)},i.resolve=l,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&!s.startRow?void 0:s.startRow||e.refRow,s.base_path=s.base_path||e.basePath+"ezEditTable/";var l=s.editable,a=s.selectable;s.selection=a,a&&(s.default_selection=s.default_selection||"row"),s.active_cell_css=s.active_cell_css||"ezETSelectedCell";var n=0,o=0;if(a){var d=function(t,s,i){var l=t.Selection,a=function(i){if("row"===t.defaultSelection)l.SelectRowByIndex(i);else{t.ClearSelections();var a=s.cellIndex,n=e.tbl.rows[i];"both"===t.defaultSelection&&l.SelectRowByIndex(i),n&&l.SelectCell(n.cells[a])}if(e.validRowsIndex.length!==e.getRowsNb()){var r=e.tbl.rows[i];r&&r.scrollIntoView(!1),f&&(f.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===f.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:f.scrollIntoView(!1))}};if(e.validRowsIndex){var r,d=e.validRowsIndex,u=d.length,c="row"!==t.defaultSelection?s.parentNode:s,f="TD"===s.nodeName?s:null,p=void 0!==i?t.Event.GetKey(i):0,g=h["default"].has(d,c.rowIndex),v=34===p||33===p?e.Cpt.paging.pagingLength||t.nbRowsPerPage:1;if(g)34!==p&&33!==p?(n=h["default"].indexByValue(d,c.rowIndex),o=c.rowIndex):(r=34===p?u-1>=n+v?d[n+v]:[u-1]:n-v<=d[0]?d[0]:d[n-v],o=r,n=h["default"].indexByValue(d,r),a(r));else{if(c.rowIndex>o)if(c.rowIndex>=d[u-1])r=d[u-1];else{var b=n+v;r=b>u-1?d[u-1]:d[b]}else if(c.rowIndex<=d[0])r=d[0];else{var m=d[n-v];r=m?m:d[0]}o=c.rowIndex,a(r)}}},u=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.Cpt.paging.nbPages>1){var l=e.Cpt.paging;t.nbRowsPerPage=l.pagingLength;var a=e.validRowsIndex,n=a.length,r=parseInt(l.startPagingRow,10)+parseInt(l.pagingLength,10),o=i.rowIndex;o===a[n-1]&&l.currentPageNb!==l.nbPages?l.setPage("last"):o==a[0]&&1!==l.currentPageNb?l.setPage("first"):o>a[r-1]&&oa[0]&&l.setPage("previous")}};if(e.paging&&(e.Cpt.paging.onAfterChangePage=function(t){var e=t.tf.ExtRegistry.advancedGrid,s=e._ezEditTable,i=s.Selection,l=i.GetActiveRow();l&&l.scrollIntoView(!1);var a=i.GetActiveCell();a&&a.scrollIntoView(!1)}),"row"===s.default_selection){var c=s.on_before_selected_row;s.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var f=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])}}else{var p=s.on_before_selected_cell;s.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])};var g=s.on_after_selected_cell;s.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])}}}if(l){var v=s.on_added_dom_row;if(s.on_added_dom_row=function(){e.nbFilterableRows++,e.paging?(e.nbRows++,e.nbVisibleRows++,e.nbFilterableRows++,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging()):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),v&&v.call(null,arguments[0],arguments[1],arguments[2])},s.actions&&s.actions["delete"]){var b=s.actions["delete"].on_after_submit;s.actions["delete"].on_after_submit=function(){e.nbFilterableRows--,e.paging?(e.nbRows--,e.nbVisibleRows--,e.nbFilterableRows--,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging(!1)):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),b&&b.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(m){throw new Error(this.err)}}},{key:"reset",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&t.Selection.Set(),this.cfg.editable&&t.Editable.Set())}},{key:"destroy",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove())}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(25),a=i(l);e["default"]=a["default"],t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0,this.onLoaded=h["default"].isFn(i.on_loaded)?i.on_loaded:null,this.onBeforeOpen=h["default"].isFn(i.on_before_open)?i.on_before_open:null,this.onAfterOpen=h["default"].isFn(i.on_after_open)?i.on_after_open:null,this.onBeforeClose=h["default"].isFn(i.on_before_close)?i.on_before_close:null,this.onAfterClose=h["default"].isFn(i.on_after_close)?i.on_after_close:null,this.onBeforeColHidden=h["default"].isFn(i.on_before_col_hidden)?i.on_before_col_hidden:null,this.onAfterColHidden=h["default"].isFn(i.on_after_col_hidden)?i.on_after_col_hidden:null,this.onBeforeColDisplayed=h["default"].isFn(i.on_before_col_displayed)?i.on_before_col_displayed:null,this.onAfterColDisplayed=h["default"].isFn(i.on_after_col_displayed)?i.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.Cpt.gridLayout.headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](i.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,l=this.onAfterClose;e&&"inline"!==t&&e.call(null,this),s&&"inline"===t&&s.call(null,this),this.contEl.style.display="inline"===t?"none":"inline",i&&"inline"!==t&&i.call(null,this),l&&"inline"===t&&l.call(null,this)}},{key:"checkItem",value:function(t){var e=t.parentNode;if(e&&t){var s=t.firstChild.checked,i=t.firstChild.getAttribute("id").split("_")[1];i=parseInt(i,10),s?r["default"].addClass(e,this.listSlcItemCssClass):r["default"].removeClass(e,this.listSlcItemCssClass);var l=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(l=!0),this.setHidden(i,l)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var t=this;if(!this.btnEl){var e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?r["default"].id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}if(this.btnHtml){s.innerHTML=this.btnHtml;var a=s.firstChild;this.enableHover?u["default"].add(a,"mouseover",function(e){t.toggle(e)}):u["default"].add(a,"click",function(e){t.toggle(e)})}else{var n=r["default"].create("a",["href","javascript:;"]);n.className=this.btnCssClass,n.title=this.extDesc,n.innerHTML=this.btnText,s.appendChild(n),this.enableHover?u["default"].add(n,"mouseover",function(e){t.toggle(e)}):u["default"].add(n,"click",function(e){t.toggle(e)})}this.spanEl=s,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var t=this,e=this.tf,s=this.contElTgtId?r["default"].id(this.contElTgtId):r["default"].create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=r["default"].create("p");i.innerHTML=this.text,s.appendChild(i);var l=r["default"].create("ul",["id","ul"+this.extName+"_"+e.id]);l.className=this.listCssClass;var a=this.headersTbl?this.headersTbl:e.tbl,n=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),o=a.rows[n];if(this.enableTickAll){var h=r["default"].createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);r["default"].addClass(h,this.listItemCssClass),l.appendChild(h),h.check.checked=!this.tickToHide,u["default"].add(h.check,"click",function(){for(var t=0;ti.length;)i="0"+i;e[s]=i}return e.join(".")}function u(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var c=function(t){return t&&t.__esModule?t:{"default":t}},f=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},p=function(){function t(t,e){for(var s=0;se;e++);return e},SortableTable.prototype.initHeader=function(s){var i=this;if(i.tHead){i.headersRow=e.headersRow;var l=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var a,n,r=l.length,o=0;r>o;o++)n=l[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(n.style.cursor="pointer",a=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),n.appendChild(a),null!==i.sortTypes[o]&&n.setAttribute("_sortType",i.sortTypes[o]),w["default"].add(n,"click",i._headerOnclick)):(n.setAttribute("_sortType",s[o]),n._sortType="None");i.updateHeaderArrows()}},SortableTable.prototype.updateHeaderArrows=function(){var s,i,l,a=this;if(e.sortConfig.asyncSort&&null!==e.sortConfig.triggerIds){var n=e.sortConfig.triggerIds;s=[],i=n.length;for(var r=0;ro;o++){var h=s[o].getAttribute("_sortType");null!==h&&"None"!==h&&(l=s[o].lastChild||s[o],"img"!==l.nodeName.toLowerCase()&&(l=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),s[o].appendChild(l)),o===a.sortColumn?l.className=t.sortImgClassName+" "+(this.descending?t.sortImgDescClassName:t.sortImgAscClassName):l.className=t.sortImgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,l=i._sortTypeInfo[e];if(l&&l.getRowValue)return l.getRowValue(t,s);var a=t.cells[s],n=SortableTable.getInnerText(a);return i.getValueFromString(n,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.sortCustomKey)?e.getAttribute(t.sortCustomKey):m["default"].getText(e):void 0}}},{key:"addSortType",value:function(){SortableTable.prototype.addSortType(arguments[0],arguments[1],arguments[2],arguments[3])}},{key:"setSortTypes",value:function(){for(var t=this,e=this.tf,s=e.sortConfig,a=s.sortTypes,c=[],f=0;f descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.element = oTable;\r\n this.setTHead( oTable.tHead );\r\n this.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n if (this.tHead && this.tHead != oTHead )\r\n this.uninitHeader();\r\n this.tHead = oTHead;\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n this.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.sortTypes = oSortTypes || [];\r\n if ( this.tHead )\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var doc = this.tHead.ownerDocument || this.tHead.document;\r\n this.sortTypes = oSortTypes || [];\r\n var l = cells.length;\r\n var img, c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n img = doc.createElement("IMG");\r\n img.src = "images/blank.png";\r\n c.appendChild(img);\r\n if (this.sortTypes[i] != null)\r\n c._sortType = this.sortTypes[i];\r\n if (typeof c.addEventListener != "undefined")\r\n c.addEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.attachEvent != "undefined")\r\n c.attachEvent("onclick", this._headerOnclick);\r\n else\r\n c.onclick = this._headerOnclick;\r\n }\r\n else\r\n {\r\n c.setAttribute( "_sortType", oSortTypes[i] );\r\n c._sortType = "None";\r\n }\r\n }\r\n this.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (c._sortType != null && c._sortType != "None") {\r\n c.removeChild(c.lastChild);\r\n if (typeof c.removeEventListener != "undefined")\r\n c.removeEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.detachEvent != "undefined")\r\n c.detachEvent("onclick", this._headerOnclick);\r\n c._sortType = null;\r\n c.removeAttribute( "_sortType" );\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var img;\r\n for (var i = 0; i < l; i++) {\r\n if (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n img = cells[i].lastChild;\r\n if (i == this.sortColumn)\r\n img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n else\r\n img.className = "sort-arrow";\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n // find TD element\r\n var el = e.target || e.srcElement;\r\n while (el.tagName != "TD")\r\n el = el.parentNode;\r\n\r\n this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n var cells = oTd.parentNode.childNodes\r\n var l = cells.length;\r\n var i;\r\n for (i = 0; cells[i] != oTd && i < l; i++)\r\n ;\r\n return i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n return this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n if (!this.tBody) return;\r\n if (sSortType == null)\r\n sSortType = this.getSortType(nColumn);\r\n\r\n // exit if None\r\n if (sSortType == "None")\r\n return;\r\n\r\n if (bDescending == null) {\r\n if (this.sortColumn != nColumn)\r\n this.descending = this.defaultDescending;\r\n else\r\n this.descending = !this.descending;\r\n }\r\n else\r\n this.descending = bDescending;\r\n\r\n this.sortColumn = nColumn;\r\n\r\n if (typeof this.onbeforesort == "function")\r\n this.onbeforesort();\r\n\r\n var f = this.getSortFunction(sSortType, nColumn);\r\n var a = this.getCache(sSortType, nColumn);\r\n var tBody = this.tBody;\r\n\r\n a.sort(f);\r\n\r\n if (this.descending)\r\n a.reverse();\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // remove from doc\r\n var nextSibling = tBody.nextSibling;\r\n var p = tBody.parentNode;\r\n p.removeChild(tBody);\r\n }\r\n\r\n // insert in the new order\r\n var l = a.length;\r\n for (var i = 0; i < l; i++)\r\n tBody.appendChild(a[i].element);\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // insert into doc\r\n p.insertBefore(tBody, nextSibling);\r\n }\r\n\r\n this.updateHeaderArrows();\r\n\r\n this.destroyCache(a);\r\n\r\n if (typeof this.onsort == "function")\r\n this.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n var oThis = this;\r\n this._asyncsort = function () {\r\n oThis.sort(nColumn, bDescending, sSortType);\r\n };\r\n window.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n if (!this.tBody) return [];\r\n var rows = this.tBody.rows;\r\n var l = rows.length;\r\n var a = new Array(l);\r\n var r;\r\n for (var i = 0; i < l; i++) {\r\n r = rows[i];\r\n a[i] = {\r\n value: this.getRowValue(r, sType, nColumn),\r\n element: r\r\n };\r\n };\r\n return a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n var l = oArray.length;\r\n for (var i = 0; i < l; i++) {\r\n oArray[i].value = null;\r\n oArray[i].element = null;\r\n oArray[i] = null;\r\n }\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n // if we have defined a custom getRowValue use that\r\n if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n return this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n var s;\r\n var c = oRow.cells[nColumn];\r\n if (typeof c.innerText != "undefined")\r\n s = c.innerText;\r\n else\r\n s = SortableTable.getInnerText(c);\r\n return this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n var s = "";\r\n var cs = oNode.childNodes;\r\n var l = cs.length;\r\n for (var i = 0; i < l; i++) {\r\n switch (cs[i].nodeType) {\r\n case 1: //ELEMENT_NODE\r\n s += SortableTable.getInnerText(cs[i]);\r\n break;\r\n case 3: //TEXT_NODE\r\n s += cs[i].nodeValue;\r\n break;\r\n }\r\n }\r\n return s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].getValueFromString( sText );\r\n return sText;\r\n /*\r\n switch (sType) {\r\n case "Number":\r\n return Number(sText);\r\n case "CaseInsensitiveString":\r\n return sText.toUpperCase();\r\n case "Date":\r\n var parts = sText.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n }\r\n return sText;\r\n */\r\n };\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].compare;\r\n return SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n this.uninitHeader();\r\n var win = this.document.parentWindow;\r\n if (win && typeof win.detachEvent != "undefined") { // only IE needs this\r\n win.detachEvent("onunload", this._onunload);\r\n }\r\n this._onunload = null;\r\n this.element = null;\r\n this.tHead = null;\r\n this.tBody = null;\r\n this.document = null;\r\n this._headerOnclick = null;\r\n this.sortTypes = null;\r\n this._asyncsort = null;\r\n this.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n this._sortTypeInfo[sType] = {\r\n type: sType,\r\n getValueFromString: fGetValueFromString || SortableTable.idFunction,\r\n compare: fCompareFunction || SortableTable.basicCompare,\r\n getRowValue: fGetRowValue\r\n };\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n delete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n if (n1.value < n2.value)\r\n return -1;\r\n if (n2.value < n1.value)\r\n return 1;\r\n return 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n return x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n return s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n var parts = s.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'; + +}]); \ No newline at end of file diff --git a/dist/tablefilter/1-b6f853f028e3df14c6c9.js b/dist/tablefilter/1-b6f853f028e3df14c6c9.js deleted file mode 100644 index d6887126..00000000 --- a/dist/tablefilter/1-b6f853f028e3df14c6c9.js +++ /dev/null @@ -1,3 +0,0 @@ -webpackJsonp([1],[,function(t,e,s){function i(t){return s(l(t))}function l(t){return a[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var a={"./array":7,"./array.js":7,"./cookie":5,"./cookie.js":5,"./date":8,"./date.js":8,"./dom":3,"./dom.js":3,"./event":2,"./event.js":2,"./extensions/advancedGrid/adapterEzEditTable":25,"./extensions/advancedGrid/adapterEzEditTable.js":25,"./extensions/advancedGrid/advancedGrid":26,"./extensions/advancedGrid/advancedGrid.js":26,"./extensions/colsVisibility/colsVisibility":27,"./extensions/colsVisibility/colsVisibility.js":27,"./extensions/sort/adapterSortabletable":28,"./extensions/sort/adapterSortabletable.js":28,"./extensions/sort/sort":29,"./extensions/sort/sort.js":29,"./helpers":9,"./helpers.js":9,"./modules/alternateRows":22,"./modules/alternateRows.js":22,"./modules/checkList":16,"./modules/checkList.js":16,"./modules/clearButton":20,"./modules/clearButton.js":20,"./modules/colOps":23,"./modules/colOps.js":23,"./modules/dropdown":15,"./modules/dropdown.js":15,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":21,"./modules/help.js":21,"./modules/highlightKeywords":13,"./modules/highlightKeywords.js":13,"./modules/loader":12,"./modules/loader.js":12,"./modules/paging":19,"./modules/paging.js":19,"./modules/popupFilter":14,"./modules/popupFilter.js":14,"./modules/rowsCounter":17,"./modules/rowsCounter.js":17,"./modules/statusBar":18,"./modules/statusBar.js":18,"./modules/store":10,"./modules/store.js":10,"./sort":24,"./sort.js":24,"./string":4,"./string.js":4,"./types":6,"./types.js":6};i.keys=function(){return Object.keys(a)},i.resolve=l,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&!s.startRow?void 0:s.startRow||e.refRow,s.base_path=s.base_path||e.basePath+"ezEditTable/";var l=s.editable,a=s.selectable;s.selection=a,a&&(s.default_selection=s.default_selection||"row"),s.active_cell_css=s.active_cell_css||"ezETSelectedCell";var n=0,o=0;if(a){var d=function(t,s,i){var l=t.Selection,a=function(i){if("row"===t.defaultSelection)l.SelectRowByIndex(i);else{t.ClearSelections();var a=s.cellIndex,n=e.tbl.rows[i];"both"===t.defaultSelection&&l.SelectRowByIndex(i),n&&l.SelectCell(n.cells[a])}if(e.validRowsIndex.length!==e.getRowsNb()){var r=e.tbl.rows[i];r&&r.scrollIntoView(!1),p&&(p.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===p.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:p.scrollIntoView(!1))}};if(e.validRowsIndex){var r,d=e.validRowsIndex,u=d.length,c="row"!==t.defaultSelection?s.parentNode:s,p="TD"===s.nodeName?s:null,f=void 0!==i?t.Event.GetKey(i):0,g=h["default"].has(d,c.rowIndex),v=34===f||33===f?e.Cpt.paging.pagingLength||t.nbRowsPerPage:1;if(g)34!==f&&33!==f?(n=h["default"].indexByValue(d,c.rowIndex),o=c.rowIndex):(r=34===f?u-1>=n+v?d[n+v]:[u-1]:n-v<=d[0]?d[0]:d[n-v],o=r,n=h["default"].indexByValue(d,r),a(r));else{if(c.rowIndex>o)if(c.rowIndex>=d[u-1])r=d[u-1];else{var b=n+v;r=b>u-1?d[u-1]:d[b]}else if(c.rowIndex<=d[0])r=d[0];else{var m=d[n-v];r=m?m:d[0]}o=c.rowIndex,a(r)}}},u=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.Cpt.paging.nbPages>1){var l=e.Cpt.paging;t.nbRowsPerPage=l.pagingLength;var a=e.validRowsIndex,n=a.length,r=parseInt(l.startPagingRow,10)+parseInt(l.pagingLength,10),o=i.rowIndex;o===a[n-1]&&l.currentPageNb!==l.nbPages?l.setPage("last"):o==a[0]&&1!==l.currentPageNb?l.setPage("first"):o>a[r-1]&&oa[0]&&l.setPage("previous")}};if(e.paging&&(e.Cpt.paging.onAfterChangePage=function(t){var e=t.ExtRegistry.ezEditTable,s=e.Selection,i=s.GetActiveRow();i&&i.scrollIntoView(!1);var l=s.GetActiveCell();l&&l.scrollIntoView(!1)}),"row"===s.default_selection){var c=s.on_before_selected_row;s.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var p=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])}}else{var f=s.on_before_selected_cell;s.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])};var g=s.on_after_selected_cell;s.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])}}}if(l){var v=s.on_added_dom_row;if(s.on_added_dom_row=function(){e.nbFilterableRows++,e.paging?(e.nbRows++,e.nbVisibleRows++,e.nbFilterableRows++,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging()):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),v&&v.call(null,arguments[0],arguments[1],arguments[2])},s.actions&&s.actions["delete"]){var b=s.actions["delete"].on_after_submit;s.actions["delete"].on_after_submit=function(){e.nbFilterableRows--,e.paging?(e.nbRows--,e.nbVisibleRows--,e.nbFilterableRows--,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging(!1)):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),b&&b.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(m){throw new Error(this.err)}}},{key:"reset",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&t.Selection.Set(),this.cfg.editable&&t.Editable.Set())}},{key:"destroy",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove())}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(25),a=i(l);e["default"]=a["default"],t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0,this.onLoaded=h["default"].isFn(i.on_loaded)?i.on_loaded:null,this.onBeforeOpen=h["default"].isFn(i.on_before_open)?i.on_before_open:null,this.onAfterOpen=h["default"].isFn(i.on_after_open)?i.on_after_open:null,this.onBeforeClose=h["default"].isFn(i.on_before_close)?i.on_before_close:null,this.onAfterClose=h["default"].isFn(i.on_after_close)?i.on_after_close:null,this.onBeforeColHidden=h["default"].isFn(i.on_before_col_hidden)?i.on_before_col_hidden:null,this.onAfterColHidden=h["default"].isFn(i.on_after_col_hidden)?i.on_after_col_hidden:null,this.onBeforeColDisplayed=h["default"].isFn(i.on_before_col_displayed)?i.on_before_col_displayed:null,this.onAfterColDisplayed=h["default"].isFn(i.on_after_col_displayed)?i.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.Cpt.gridLayout.headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](i.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,l=this.onAfterClose;e&&"inline"!==t&&e.call(null,this),s&&"inline"===t&&s.call(null,this),this.contEl.style.display="inline"===t?"none":"inline",i&&"inline"!==t&&i.call(null,this),l&&"inline"===t&&l.call(null,this)}},{key:"checkItem",value:function(t){var e=t.parentNode;if(e&&t){var s=t.firstChild.checked,i=t.firstChild.getAttribute("id").split("_")[1];i=parseInt(i,10),s?r["default"].addClass(e,this.listSlcItemCssClass):r["default"].removeClass(e,this.listSlcItemCssClass);var l=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(l=!0),this.setHidden(i,l)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var t=this;if(!this.btnEl){var e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?r["default"].id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}if(this.btnHtml){s.innerHTML=this.btnHtml;var a=s.firstChild;this.enableHover?u["default"].add(a,"mouseover",function(e){t.toggle(e)}):u["default"].add(a,"click",function(e){t.toggle(e)})}else{var n=r["default"].create("a",["href","javascript:;"]);n.className=this.btnCssClass,n.title=this.extDesc,n.innerHTML=this.btnText,s.appendChild(n),this.enableHover?u["default"].add(n,"mouseover",function(e){t.toggle(e)}):u["default"].add(n,"click",function(e){t.toggle(e)})}this.spanEl=s,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var t=this,e=this.tf,s=this.contElTgtId?r["default"].id(this.contElTgtId):r["default"].create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=r["default"].create("p");i.innerHTML=this.text,s.appendChild(i);var l=r["default"].create("ul",["id","ul"+this.extName+"_"+e.id]);l.className=this.listCssClass;var a=this.headersTbl?this.headersTbl:e.tbl,n=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),o=a.rows[n];if(this.enableTickAll){var h=r["default"].createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);r["default"].addClass(h,this.listItemCssClass),l.appendChild(h),h.check.checked=!this.tickToHide,u["default"].add(h.check,"click",function(){for(var t=0;ti.length;)i="0"+i;e[s]=i}return e.join(".")}function u(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var c=function(t){return t&&t.__esModule?t:{"default":t}},p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},f=function(){function t(t,e){for(var s=0;se;e++);return e},SortableTable.prototype.initHeader=function(s){var i=this;if(i.tHead){i.headersRow=e.headersRow;var l=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var a,n,r=l.length,o=0;r>o;o++)n=l[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(n.style.cursor="pointer",a=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),n.appendChild(a),null!==i.sortTypes[o]&&n.setAttribute("_sortType",i.sortTypes[o]),w["default"].add(n,"click",i._headerOnclick)):(n.setAttribute("_sortType",s[o]),n._sortType="None");i.updateHeaderArrows()}},SortableTable.prototype.updateHeaderArrows=function(){var s,i,l,a=this;if(e.sortConfig.asyncSort&&null!==e.sortConfig.triggerIds){var n=e.sortConfig.triggerIds;s=[],i=n.length;for(var r=0;ro;o++){var h=s[o].getAttribute("_sortType");null!==h&&"None"!==h&&(l=s[o].lastChild||s[o],"img"!==l.nodeName.toLowerCase()&&(l=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),s[o].appendChild(l)),o===a.sortColumn?l.className=t.sortImgClassName+" "+(this.descending?t.sortImgDescClassName:t.sortImgAscClassName):l.className=t.sortImgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,l=i._sortTypeInfo[e];if(l&&l.getRowValue)return l.getRowValue(t,s);var a=t.cells[s],n=SortableTable.getInnerText(a);return i.getValueFromString(n,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.sortCustomKey)?e.getAttribute(t.sortCustomKey):m["default"].getText(e):void 0}}},{key:"addSortType",value:function(){SortableTable.prototype.addSortType(arguments[0],arguments[1],arguments[2],arguments[3])}},{key:"setSortTypes",value:function(){for(var t=this,e=this.tf,s=e.sortConfig,a=s.sortTypes,c=[],p=0;p descending, false -> ascending\r\nSortableTable.prototype.defaultDescending = false;\r\n\r\n// shared between all instances. This is intentional to allow external files\r\n// to modify the prototype\r\nSortableTable.prototype._sortTypeInfo = {};\r\n\r\nSortableTable.prototype.setTable = function (oTable) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.element = oTable;\r\n this.setTHead( oTable.tHead );\r\n this.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n if (this.tHead && this.tHead != oTHead )\r\n this.uninitHeader();\r\n this.tHead = oTHead;\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n this.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n if ( this.tHead )\r\n this.uninitHeader();\r\n this.sortTypes = oSortTypes || [];\r\n if ( this.tHead )\r\n this.initHeader( this.sortTypes );\r\n};\r\n\r\n// adds arrow containers and events\r\n// also binds sort type to the header cells so that reordering columns does\r\n// not break the sort types\r\nSortableTable.prototype.initHeader = function (oSortTypes) {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var doc = this.tHead.ownerDocument || this.tHead.document;\r\n this.sortTypes = oSortTypes || [];\r\n var l = cells.length;\r\n var img, c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n img = doc.createElement("IMG");\r\n img.src = "images/blank.png";\r\n c.appendChild(img);\r\n if (this.sortTypes[i] != null)\r\n c._sortType = this.sortTypes[i];\r\n if (typeof c.addEventListener != "undefined")\r\n c.addEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.attachEvent != "undefined")\r\n c.attachEvent("onclick", this._headerOnclick);\r\n else\r\n c.onclick = this._headerOnclick;\r\n }\r\n else\r\n {\r\n c.setAttribute( "_sortType", oSortTypes[i] );\r\n c._sortType = "None";\r\n }\r\n }\r\n this.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var c;\r\n for (var i = 0; i < l; i++) {\r\n c = cells[i];\r\n if (c._sortType != null && c._sortType != "None") {\r\n c.removeChild(c.lastChild);\r\n if (typeof c.removeEventListener != "undefined")\r\n c.removeEventListener("click", this._headerOnclick, false);\r\n else if (typeof c.detachEvent != "undefined")\r\n c.detachEvent("onclick", this._headerOnclick);\r\n c._sortType = null;\r\n c.removeAttribute( "_sortType" );\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n if (!this.tHead) return;\r\n var cells = this.tHead.rows[0].cells;\r\n var l = cells.length;\r\n var img;\r\n for (var i = 0; i < l; i++) {\r\n if (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n img = cells[i].lastChild;\r\n if (i == this.sortColumn)\r\n img.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n else\r\n img.className = "sort-arrow";\r\n }\r\n }\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n // find TD element\r\n var el = e.target || e.srcElement;\r\n while (el.tagName != "TD")\r\n el = el.parentNode;\r\n\r\n this.sort(SortableTable.msie ? SortableTable.getCellIndex(el) : el.cellIndex);\r\n};\r\n\r\n// IE returns wrong cellIndex when columns are hidden\r\nSortableTable.getCellIndex = function (oTd) {\r\n var cells = oTd.parentNode.childNodes\r\n var l = cells.length;\r\n var i;\r\n for (i = 0; cells[i] != oTd && i < l; i++)\r\n ;\r\n return i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n return this.sortTypes[nColumn] || "String";\r\n};\r\n\r\n// only nColumn is required\r\n// if bDescending is left out the old value is taken into account\r\n// if sSortType is left out the sort type is found from the sortTypes array\r\n\r\nSortableTable.prototype.sort = function (nColumn, bDescending, sSortType) {\r\n if (!this.tBody) return;\r\n if (sSortType == null)\r\n sSortType = this.getSortType(nColumn);\r\n\r\n // exit if None\r\n if (sSortType == "None")\r\n return;\r\n\r\n if (bDescending == null) {\r\n if (this.sortColumn != nColumn)\r\n this.descending = this.defaultDescending;\r\n else\r\n this.descending = !this.descending;\r\n }\r\n else\r\n this.descending = bDescending;\r\n\r\n this.sortColumn = nColumn;\r\n\r\n if (typeof this.onbeforesort == "function")\r\n this.onbeforesort();\r\n\r\n var f = this.getSortFunction(sSortType, nColumn);\r\n var a = this.getCache(sSortType, nColumn);\r\n var tBody = this.tBody;\r\n\r\n a.sort(f);\r\n\r\n if (this.descending)\r\n a.reverse();\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // remove from doc\r\n var nextSibling = tBody.nextSibling;\r\n var p = tBody.parentNode;\r\n p.removeChild(tBody);\r\n }\r\n\r\n // insert in the new order\r\n var l = a.length;\r\n for (var i = 0; i < l; i++)\r\n tBody.appendChild(a[i].element);\r\n\r\n if (SortableTable.removeBeforeSort) {\r\n // insert into doc\r\n p.insertBefore(tBody, nextSibling);\r\n }\r\n\r\n this.updateHeaderArrows();\r\n\r\n this.destroyCache(a);\r\n\r\n if (typeof this.onsort == "function")\r\n this.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n var oThis = this;\r\n this._asyncsort = function () {\r\n oThis.sort(nColumn, bDescending, sSortType);\r\n };\r\n window.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n if (!this.tBody) return [];\r\n var rows = this.tBody.rows;\r\n var l = rows.length;\r\n var a = new Array(l);\r\n var r;\r\n for (var i = 0; i < l; i++) {\r\n r = rows[i];\r\n a[i] = {\r\n value: this.getRowValue(r, sType, nColumn),\r\n element: r\r\n };\r\n };\r\n return a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n var l = oArray.length;\r\n for (var i = 0; i < l; i++) {\r\n oArray[i].value = null;\r\n oArray[i].element = null;\r\n oArray[i] = null;\r\n }\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n // if we have defined a custom getRowValue use that\r\n if (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n return this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n var s;\r\n var c = oRow.cells[nColumn];\r\n if (typeof c.innerText != "undefined")\r\n s = c.innerText;\r\n else\r\n s = SortableTable.getInnerText(c);\r\n return this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n var s = "";\r\n var cs = oNode.childNodes;\r\n var l = cs.length;\r\n for (var i = 0; i < l; i++) {\r\n switch (cs[i].nodeType) {\r\n case 1: //ELEMENT_NODE\r\n s += SortableTable.getInnerText(cs[i]);\r\n break;\r\n case 3: //TEXT_NODE\r\n s += cs[i].nodeValue;\r\n break;\r\n }\r\n }\r\n return s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].getValueFromString( sText );\r\n return sText;\r\n /*\r\n switch (sType) {\r\n case "Number":\r\n return Number(sText);\r\n case "CaseInsensitiveString":\r\n return sText.toUpperCase();\r\n case "Date":\r\n var parts = sText.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n }\r\n return sText;\r\n */\r\n };\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n if (this._sortTypeInfo[sType])\r\n return this._sortTypeInfo[sType].compare;\r\n return SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n this.uninitHeader();\r\n var win = this.document.parentWindow;\r\n if (win && typeof win.detachEvent != "undefined") { // only IE needs this\r\n win.detachEvent("onunload", this._onunload);\r\n }\r\n this._onunload = null;\r\n this.element = null;\r\n this.tHead = null;\r\n this.tBody = null;\r\n this.document = null;\r\n this._headerOnclick = null;\r\n this.sortTypes = null;\r\n this._asyncsort = null;\r\n this.onsort = null;\r\n};\r\n\r\n// Adds a sort type to all instance of SortableTable\r\n// sType : String - the identifier of the sort type\r\n// fGetValueFromString : function ( s : string ) : T - A function that takes a\r\n// string and casts it to a desired format. If left out the string is just\r\n// returned\r\n// fCompareFunction : function ( n1 : T, n2 : T ) : Number - A normal JS sort\r\n// compare function. Takes two values and compares them. If left out less than,\r\n// <, compare is used\r\n// fGetRowValue : function( oRow : HTMLTRElement, nColumn : int ) : T - A function\r\n// that takes the row and the column index and returns the value used to compare.\r\n// If left out then the innerText is first taken for the cell and then the\r\n// fGetValueFromString is used to convert that string the desired value and type\r\n\r\nSortableTable.prototype.addSortType = function (sType, fGetValueFromString, fCompareFunction, fGetRowValue) {\r\n this._sortTypeInfo[sType] = {\r\n type: sType,\r\n getValueFromString: fGetValueFromString || SortableTable.idFunction,\r\n compare: fCompareFunction || SortableTable.basicCompare,\r\n getRowValue: fGetRowValue\r\n };\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n delete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n if (n1.value < n2.value)\r\n return -1;\r\n if (n2.value < n1.value)\r\n return 1;\r\n return 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n return x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n return s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n var parts = s.split("-");\r\n var d = new Date(0);\r\n d.setFullYear(parts[0]);\r\n d.setDate(parts[2]);\r\n d.setMonth(parts[1] - 1);\r\n return d.valueOf();\r\n};\r\n\r\n\r\n// add sort types\r\nSortableTable.prototype.addSortType("Number", Number);\r\nSortableTable.prototype.addSortType("CaseInsensitiveString", SortableTable.toUpperCase);\r\nSortableTable.prototype.addSortType("Date", SortableTable.toDate);\r\nSortableTable.prototype.addSortType("String");\r\n// None is a special case\r\n'; - -}]); \ No newline at end of file diff --git a/dist/tablefilter/tablefilter.js b/dist/tablefilter/tablefilter.js index 05b665d9..51bdb1b2 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,5 +1,5 @@ -!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var s=e();for(var i in s)("object"==typeof exports?exports:t)[i]=s[i]}}(this,function(){return function(t){function e(s){if(i[s])return i[s].exports;var l=i[s]={exports:{},id:s,loaded:!1};return t[s].call(l.exports,l,l.exports,e),l.loaded=!0,l.exports}var s=window.webpackJsonp;window.webpackJsonp=function(i,a){for(var r,n,o=0,h=[];o1)for(var s=0;s1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==r.filters_cell_tag||"td"!==r.filters_cell_tag?"td":r.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=r.inf_div_css_class||"inf",this.lDivCssClass=r.left_div_css_class||"ldiv",this.rDivCssClass=r.right_div_css_class||"rdiv",this.mDivCssClass=r.middle_div_css_class||"mdiv",this.contDivCssClass=r.content_div_css_class||"cont",this.stylesheet=r.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=r.flts_row_css_class||"fltrow",this.enableIcons=r.enable_icons===!1?!1:!0,this.alternateBgs=r.alternate_rows===!0?!0:!1,this.hasColWidths=g["default"].isArray(r.col_widths),this.colWidths=this.hasColWidths?r.col_widths:null,this.fixedHeaders=r.fixed_headers===!0?!0:!1,this.tBodyH=isNaN(r.tbody_height)?200:r.tbody_height,this.fltCssClass=r.flt_css_class||"flt",this.fltMultiCssClass=r.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=r.flt_small_css_class||"flt_s",this.singleFltCssClass=r.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=r.enter_key===!1?!1:!0,this.onBeforeFilter=g["default"].isFn(r.on_before_filter)?r.on_before_filter:null,this.onAfterFilter=g["default"].isFn(r.on_after_filter)?r.on_after_filter:null,this.caseSensitive=r.case_sensitive===!0?!0:!1,this.exactMatch=r.exact_match===!0?!0:!1,this.linkedFilters=r.linked_filters===!0?!0:!1,this.disableExcludedOptions=r.disable_excluded_options===!0?!0:!1,this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=r.col_operation?!0:!1,this.colOperation=null,this.hasVisibleRows=r.rows_always_visible?!0:!1,this.visibleRows=this.hasVisibleRows?r.rows_always_visible:[],this.searchType=r.search_type||"include",this.isExternalFlt=r.external_flt_grid===!0?!0:!1,this.externalFltTgtIds=r.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(r.exec_delay)?100:parseInt(r.exec_delay,10),this.onFiltersLoaded=g["default"].isFn(r.on_filters_loaded)?r.on_filters_loaded:null,this.singleSearchFlt=r.single_search_filter===!0?!0:!1,this.onRowValidated=g["default"].isFn(r.on_row_validated)?r.on_row_validated:null,this.customCellDataCols=r.custom_cell_data_cols?r.custom_cell_data_cols:[],this.customCellData=g["default"].isFn(r.custom_cell_data)?r.custom_cell_data:null,this.watermark=r.watermark||"",this.isWatermarkArray=g["default"].isArray(this.watermark),this.toolBarTgtId=r.toolbar_target_id||null,this.helpInstructions=r.help_instructions?!0:!1,this.popUpFilters=r.popup_filters===!0?!0:!1,this.markActiveColumns=r.mark_active_columns===!0?!0:!1,this.activeColumnsCssClass=r.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=g["default"].isFn(r.on_before_active_column)?r.on_before_active_column:null,this.onAfterActiveColumn=g["default"].isFn(r.on_after_active_column)?r.on_after_active_column:null,this.displayAllText=r.display_all_text||"",this.enableEmptyOption=r.enable_empty_option===!0?!0:!1,this.emptyText=r.empty_text||"(Empty)",this.enableNonEmptyOption=r.enable_non_empty_option===!0?!0:!1,this.nonEmptyText=r.non_empty_text||"(Non empty)",this.onSlcChange=r.on_change===!1?!1:!0,this.sortSlc=r.sort_select===!1?!1:!0,this.isSortNumAsc=r.sort_num_asc===!0?!0:!1,this.sortNumAsc=this.isSortNumAsc?r.sort_num_asc:null,this.isSortNumDesc=r.sort_num_desc===!0?!0:!1,this.sortNumDesc=this.isSortNumDesc?r.sort_num_desc:null,this.fillSlcOnDemand=r.fill_slc_on_demand===!0?!0:!1,this.hasCustomOptions=g["default"].isObj(r.custom_options),this.customOptions=r.custom_options,this.rgxOperator=r.regexp_operator||"rgx:",this.emOperator=r.empty_operator||"[empty]",this.nmOperator=r.nonempty_operator||"[nonempty]",this.orOperator=r.or_operator||"||",this.anOperator=r.and_operator||"&&",this.grOperator=r.greater_operator||">",this.lwOperator=r.lower_operator||"<",this.leOperator=r.lower_equal_operator||"<=",this.geOperator=r.greater_equal_operator||">=",this.dfOperator=r.different_operator||"!",this.lkOperator=r.like_operator||"*",this.eqOperator=r.equal_operator||"=",this.stOperator=r.start_with_operator||"{",this.enOperator=r.end_with_operator||"}",this.curExp=r.cur_exp||"^[¥£€$]",this.separator=r.separator||",",this.rowsCounter=r.rows_counter===!0?!0:!1,this.statusBar=r.status_bar===!0?!0:!1,this.loader=r.loader===!0?!0:!1,this.displayBtn=r.btn===!0?!0:!1,this.btnText=r.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=r.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=r.btn_reset===!0?!0:!1,this.btnResetCssClass=r.btn_reset_css_class||"reset",this.onBeforeReset=g["default"].isFn(r.on_before_reset)?r.on_before_reset:null,this.onAfterReset=g["default"].isFn(r.on_after_reset)?r.on_after_reset:null,this.paging=r.paging===!0?!0:!1,this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=r.sort===!0?!0:!1,this.isSortEnabled=!1,this.sortConfig=r.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=g["default"].isArray(this.sortConfig.sort_types)?this.sortConfig.sort_types:[],this.sortConfig.sortCol=this.sortConfig.sort_col||null,this.sortConfig.asyncSort=this.sortConfig.async_sort===!0?!0:!1,this.sortConfig.triggerIds=g["default"].isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.onKeyUp=r.on_keyup===!0?!0:!1,this.onKeyUpDelay=isNaN(r.on_keyup_delay)?900:r.on_keyup_delay,this.isUserTyping=null,this.onKeyUpTimer=void 0,this.highlightKeywords=r.highlight_keywords===!0?!0:!1,this.defaultDateType=r.default_date_type||"DMY",this.thousandsSeparator=r.thousands_separator||",",this.decimalSeparator=r.decimal_separator||".",this.hasColNbFormat=r.col_number_format===!0?!0:!1,this.colNbFormat=g["default"].isArray(this.hasColNbFormat)?r.col_number_format:null,this.hasColDateType=r.col_date_type===!0?!0:!1,this.colDateType=g["default"].isArray(this.hasColDateType)?r.col_date_type:null,this.msgFilter=r.msg_filter||"Filtering data...",this.msgPopulate=r.msg_populate||"Populating filter...",this.msgPopulateCheckList=r.msg_populate_checklist||"Populating list...",this.msgChangePage=r.msg_change_page||"Collecting paging data...",this.msgClear=r.msg_clear||"Clearing filters...",this.msgChangeResults=r.msg_change_results||"Changing results per page...",this.msgResetValues=r.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=r.msg_reset_page||"Re-setting page...",this.msgResetPageLength=r.msg_reset_page_length||"Re-setting page length...",this.msgSort=r.msg_sort||"Sorting data...",this.msgLoadExtensions=r.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=r.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=r.remember_grid_values===!0?!0:!1,this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&r.remember_page_number?!0:!1,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&r.remember_page_length?!0:!1,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=r.extensions,this.hasExtensions=g["default"].isArray(this.extensions),this.enableDefaultTheme=r.enable_default_theme===!0?!0:!1,this.hasThemes=r.enable_default_theme||g["default"].isArray(r.themes),this.themes=r.themes||[],this.themesPath=r.themes_path||this.basePath+"themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null,clearButton:null,help:null,statusBar:null},this.ExtRegistry={sort:null};var f=this;this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"loadThemes"},detectKey:function(t){if(f.enterKey){var e=t||B.event;if(e){var s=n["default"].keyCode(e);13===s?(f._filter(),n["default"].cancel(e),n["default"].stop(e)):(f.isUserTyping=!0,B.clearInterval(f.onKeyUpTimer),f.onKeyUpTimer=void 0)}}},onKeyUp:function(t){function e(){B.clearInterval(f.onKeyUpTimer),f.onKeyUpTimer=void 0,f.isUserTyping||(f.filter(),f.isUserTyping=null)}if(f.onKeyUp){var s=t||B.event,i=n["default"].keyCode(s);f.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?void 0===f.onKeyUpTimer&&(f.onKeyUpTimer=B.setInterval(e,f.onKeyUpDelay)):(B.clearInterval(f.onKeyUpTimer),f.onKeyUpTimer=void 0)}},onKeyDown:function(){f.onKeyUp&&(f.isUserTyping=!0)},onInpBlur:function(){f.onKeyUp&&(f.isUserTyping=!1,B.clearInterval(f.onKeyUpTimer))},onInpFocus:function(t){var e=t||B.event;f.activeFilterId=this.getAttribute("id"),f.activeFlt=h["default"].id(f.activeFilterId),f.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcFocus:function(t){var e=t||B.event;if(f.activeFilterId=this.getAttribute("id"),f.activeFlt=h["default"].id(f.activeFilterId),f.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var s=this.getAttribute("ct");f.Cpt.dropdown._build(s)}f.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcChange:function(t){if(f.activeFlt){var e=t||B.event;f.popUpFilters&&n["default"].stop(e),f.onSlcChange&&f.filter()}},onCheckListClick:function(){if(f.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var t=this.getAttribute("ct");f.Cpt.checkList._build(t),f.Cpt.checkList.checkListDiv[t].onclick=null,f.Cpt.checkList.checkListDiv[t].title=""}},onCheckListFocus:function(){f.activeFilterId=this.firstChild.getAttribute("id"),f.activeFlt=h["default"].id(f.activeFilterId)},onBtnClick:function(){f.filter()}}}}return a(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=h["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popUpFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var t=this.cfg,e=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new w.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new x.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new T.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new k.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new I.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var i=void 0;if(!this.gridLayout){var l=h["default"].tag(this.tbl,"thead");i=l.length>0?l[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,i.className=this.fltsRowCssClass,!this.isExternalFlt||this.gridLayout&&!this.popUpFilters||(i.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var a=0;e>a;a++){this.popUpFilters&&this.Cpt.popupFilter.build(a);var r=h["default"].create(this.fltCellTag),o=this["col"+a],d=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[a]:null;if(this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||i.appendChild(r),s=a==e-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===o&&(o=void 0===t["col_"+a]?this.fltTypeInp:u["default"].lower(t["col_"+a])),this.singleSearchFlt&&(o=this.fltTypeInp,s=this.singleFltCssClass),o===this.fltTypeSlc||o===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new R.Dropdown(this));var p=this.Cpt.dropdown,c=h["default"].create(this.fltTypeSlc,["id",this.prfxFlt+a+"_"+this.id],["ct",a],["filled","0"]);if(o===this.fltTypeMulti&&(c.multiple=this.fltTypeMulti,c.title=p.multipleSlcTooltip),c.className=u["default"].lower(o)===this.fltTypeSlc?s:this.fltMultiCssClass,d?(h["default"].id(d).appendChild(c),this.externalFltEls.push(c)):r.appendChild(c),this.fltIds.push(this.prfxFlt+a+"_"+this.id),this.fillSlcOnDemand||p._build(a),n["default"].add(c,"keypress",this.Evt.detectKey),n["default"].add(c,"change",this.Evt.onSlcChange),n["default"].add(c,"focus",this.Evt.onSlcFocus),this.fillSlcOnDemand){var f=h["default"].createOpt(this.displayAllText,"");c.appendChild(f)}}else if(o===this.fltTypeCheckList){var g=void 0;this.Cpt.checkList=new F.CheckList(this),g=this.Cpt.checkList;var v=h["default"].create("div",["id",g.prfxCheckListDiv+a+"_"+this.id],["ct",a],["filled","0"]);v.className=g.checkListDivCssClass,d?(h["default"].id(d).appendChild(v),this.externalFltEls.push(v)):r.appendChild(v),g.checkListDiv[a]=v,this.fltIds.push(this.prfxFlt+a+"_"+this.id),this.fillSlcOnDemand||g._build(a),this.fillSlcOnDemand&&(n["default"].add(v,"click",this.Evt.onCheckListClick),v.appendChild(h["default"].text(g.activateCheckListTxt))),n["default"].add(v,"click",this.Evt.onCheckListFocus)}else{var C=o===this.fltTypeInp?"text":"hidden",b=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+a+"_"+this.id],["type",C],["ct",a]);if("hidden"!==C&&this.watermark&&b.setAttribute("placeholder",this.isWatermarkArray?this.watermark[a]||"":this.watermark),b.className=s,b.onfocus=this.Evt.onInpFocus,d?(h["default"].id(d).appendChild(b),this.externalFltEls.push(b)):r.appendChild(b),this.fltIds.push(this.prfxFlt+a+"_"+this.id),n["default"].add(b,"keypress",this.Evt.detectKey),n["default"].add(b,"keydown",this.Evt.onKeyDown),n["default"].add(b,"keyup",this.Evt.onKeyUp),n["default"].add(b,"blur",this.Evt.onInpBlur),this.rememberGridValues){var m=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=m[a]&&this.setFilterValue(a,m[a],!1)}}if(a==e-1&&this.displayBtn){var _=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+a+"_"+this.id],["type","button"],["value",this.btnText]);_.className=this.btnCssClass,d?h["default"].id(d).appendChild(_):r.appendChild(_),_.onclick=this.Evt.onBtnClick}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.rowsCounter&&(this.Cpt.rowsCounter=new P.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new S.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new L.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new E.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help=new D.Help(this),this.Cpt.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new N.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new O.ColOps(this),this.Cpt.colOps.calc()),this.sort&&this.importSort(),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?n.dropdown._build(i,!0):n.dropdown._build(i,!1,l,a);break;case e.checklist:n.checkList._build(i,l,a);break;case e.changepage:n.paging._changePage(r);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:n.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:n.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:n.paging._resetPageLength(this.pgLenCookie);break;case e.sort:break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&n.statusBar.message(""),this.loader&&n.loader.show("none")}var s=void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,l=s.slcExternal,a=s.slcId,r=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),B.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,l=t.path,a=void 0;i&&l?a=t.path+i:(i=i.replace(".js",""),a="./extensions/{}/{}".replace(/{}/g,i)),s.e(1,function(s){var l=[s(1)(a)];(function(s){var l=new s(e,t);l.init(),e.ExtRegistry[i]=l}).apply(null,l)})}}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e],l=this.ExtRegistry[i.name];l&&(l.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(g["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var l=t[s],a=l.name,r=l.path;a&&!r?r=this.themesPath+a+"/"+a+".css":!a&&l.path&&(a="theme{0}".replace("{0}",s)),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}},{key:"destroy",value:function(){if(this._hasGrid){var t=this.tbl.rows,e=this.Cpt;this.paging&&e.paging.destroy(),this.statusBar&&e.statusBar.destroy(),this.rowsCounter&&e.rowsCounter.destroy(),this.btnReset&&e.clearButton.destroy(),this.helpInstructions&&e.help.destroy(),this.isExternalFlt&&!this.popUpFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.loader&&e.loader.destroy(),this.popUpFilters&&e.popupFilter.destroy(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;ss;s++){var i=t[s],l=h["default"].id(i);l&&(l.innerHTML="")}}},{key:"importSort",value:function(){this.loadExtension({name:this.sortConfig.name,path:this.sortConfig.path})}},{key:"performSort",value:function(){this.EvtManager(this.Evt.name.sort)}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(t&&this.isCustomOptions(t)){for(var e=this.customOptions,s=e.cols,i=[],l=[],a=C["default"].indexByValue(s,t),r=e.values[a],n=e.texts[a],o=e.sorts[a],h=0,d=r.length;d>h;h++)l.push(r[h]),i.push(n[h]?n[h]:r[h]);return o&&(l.sort(),i.sort()),[l,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.fillSlcOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Cpt.paging&&this.Cpt.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Cpt.paging&&this.Cpt.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.fillSlcOnDemand){var e=this.Cpt.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var l=0;lG):B?(K=A(t.replace(o,""),E),i=K>=G):V?(K=A(t.replace(d,""),E),i=G>=K):H?(K=A(t.replace(c,""),E),i=G>K):U?(K=A(t.replace(f,""),E),i=G.toString()!=K.toString()):j?(K=A(t.replace(v,""),E),i=G.toString()==K.toString()):g.test(t)?i=this._containsStr(t.replace(g,""),e,null,!1):M(t,E)?(K=A(t,E),i=G.toString()==K.toString()):L?i=u["default"].isEmpty(e):D&&(i=!u["default"].isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(r=a(e,this.colNbFormat[s]),n=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(r=a(e,"us"),n="us"):(r=a(e,"eu"),n="eu"),C)i=r<=a(t.replace(o,""),n);else if(k)i=r>=a(t.replace(d,""),n);else if(h)i=ra(t.replace(c,""),n);else if(I)i=this._containsStr(t.replace(f,""),e)?!1:!0;else if(F)i=this._containsStr(t.replace(g,""),e,null,!1);else if(R)i=this._containsStr(t.replace(v,""),e,null,!0);else if(P)i=0===e.indexOf(t.replace(b,""))?!0:!1;else if(S){var W=t.replace(m,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(L)i=u["default"].isEmpty(e);else if(D)i=!u["default"].isEmpty(e);else if(N)try{var q=t.replace(x,""),$=new RegExp(q);i=$.test(e)}catch(Y){i=!1}else{var z=l["col_"+s];i=this._containsStr(t,e,z?z:this.fltTypeInp)}return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this);var s=this.tbl.rows,i=this.Cpt,l=this.cfg,a=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var r,n,o=new RegExp(this.leOperator),d=new RegExp(this.geOperator),p=new RegExp(this.lwOperator),c=new RegExp(this.grOperator),f=new RegExp(this.dfOperator),g=new RegExp(u["default"].rgxEsc(this.lkOperator)),v=new RegExp(this.eqOperator),b=new RegExp(this.stOperator),m=new RegExp(this.enOperator),_=this.emOperator,w=this.nmOperator,x=new RegExp(u["default"].rgxEsc(this.rgxOperator)),T=this.refRow;TS;S++){var L=this.searchArgs[this.singleSearchFlt?0:S],E=this.hasColDateType?this.colDateType[S]:this.defaultDateType;if(""!==L){var D=u["default"].matchCase(this.getCellData(S,k[S]),this.caseSensitive),N=L.split(this.orOperator),O=N.length>1?!0:!1,B=L.split(this.anOperator),H=B.length>1?!0:!1;if(O||H){for(var V=void 0,U=!1,j=O?N:B,G=0;G1)for(var s=0;s1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==r.filters_cell_tag||"td"!==r.filters_cell_tag?"td":r.filters_cell_tag,this.fltIds=[],this.fltElms=[],this.searchArgs=null,this.tblData=[],this.validRowsIndex=null,this.fltGridEl=null,this.isFirstLoad=!0,this.infDiv=null,this.lDiv=null,this.rDiv=null,this.mDiv=null,this.contDiv=null,this.infDivCssClass=r.inf_div_css_class||"inf",this.lDivCssClass=r.left_div_css_class||"ldiv",this.rDivCssClass=r.right_div_css_class||"rdiv",this.mDivCssClass=r.middle_div_css_class||"mdiv",this.contDivCssClass=r.content_div_css_class||"cont",this.stylesheet=r.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=r.flts_row_css_class||"fltrow",this.enableIcons=r.enable_icons===!1?!1:!0,this.alternateBgs=Boolean(r.alternate_rows),this.hasColWidths=g["default"].isArray(r.col_widths),this.colWidths=this.hasColWidths?r.col_widths:null,this.tBodyH=isNaN(r.tbody_height)?200:r.tbody_height,this.fltCssClass=r.flt_css_class||"flt",this.fltMultiCssClass=r.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=r.flt_small_css_class||"flt_s",this.singleFltCssClass=r.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=r.enter_key===!1?!1:!0,this.onBeforeFilter=g["default"].isFn(r.on_before_filter)?r.on_before_filter:null,this.onAfterFilter=g["default"].isFn(r.on_after_filter)?r.on_after_filter:null,this.caseSensitive=Boolean(r.case_sensitive),this.exactMatch=Boolean(r.exact_match),this.linkedFilters=Boolean(r.linked_filters),this.disableExcludedOptions=Boolean(r.disable_excluded_options),this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=Boolean(r.col_operation),this.colOperation=null,this.hasVisibleRows=Boolean(r.rows_always_visible),this.visibleRows=this.hasVisibleRows?r.rows_always_visible:[],this.searchType=r.search_type||"include",this.isExternalFlt=Boolean(r.external_flt_grid),this.externalFltTgtIds=r.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(r.exec_delay)?100:parseInt(r.exec_delay,10),this.onFiltersLoaded=g["default"].isFn(r.on_filters_loaded)?r.on_filters_loaded:null,this.singleSearchFlt=Boolean(r.single_search_filter),this.onRowValidated=g["default"].isFn(r.on_row_validated)?r.on_row_validated:null,this.customCellDataCols=r.custom_cell_data_cols?r.custom_cell_data_cols:[],this.customCellData=g["default"].isFn(r.custom_cell_data)?r.custom_cell_data:null,this.watermark=r.watermark||"",this.isWatermarkArray=g["default"].isArray(this.watermark),this.toolBarTgtId=r.toolbar_target_id||null,this.helpInstructions=r.help_instructions?!0:!1,this.popUpFilters=Boolean(r.popup_filters),this.markActiveColumns=Boolean(r.mark_active_columns),this.activeColumnsCssClass=r.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=g["default"].isFn(r.on_before_active_column)?r.on_before_active_column:null,this.onAfterActiveColumn=g["default"].isFn(r.on_after_active_column)?r.on_after_active_column:null,this.displayAllText=r.display_all_text||"",this.enableEmptyOption=Boolean(r.enable_empty_option),this.emptyText=r.empty_text||"(Empty)",this.enableNonEmptyOption=Boolean(r.enable_non_empty_option),this.nonEmptyText=r.non_empty_text||"(Non empty)",this.onSlcChange=r.on_change===!1?!1:!0,this.sortSlc=r.sort_select===!1?!1:!0,this.isSortNumAsc=Boolean(r.sort_num_asc),this.sortNumAsc=this.isSortNumAsc?r.sort_num_asc:null,this.isSortNumDesc=Boolean(r.sort_num_desc),this.sortNumDesc=this.isSortNumDesc?r.sort_num_desc:null,this.fillSlcOnDemand=Boolean(r.fill_slc_on_demand),this.hasCustomOptions=g["default"].isObj(r.custom_options),this.customOptions=r.custom_options,this.rgxOperator=r.regexp_operator||"rgx:",this.emOperator=r.empty_operator||"[empty]",this.nmOperator=r.nonempty_operator||"[nonempty]",this.orOperator=r.or_operator||"||",this.anOperator=r.and_operator||"&&",this.grOperator=r.greater_operator||">",this.lwOperator=r.lower_operator||"<",this.leOperator=r.lower_equal_operator||"<=",this.geOperator=r.greater_equal_operator||">=",this.dfOperator=r.different_operator||"!",this.lkOperator=r.like_operator||"*",this.eqOperator=r.equal_operator||"=",this.stOperator=r.start_with_operator||"{",this.enOperator=r.end_with_operator||"}",this.curExp=r.cur_exp||"^[¥£€$]",this.separator=r.separator||",",this.rowsCounter=Boolean(r.rows_counter),this.statusBar=Boolean(r.status_bar),this.loader=Boolean(r.loader),this.displayBtn=Boolean(r.btn),this.btnText=r.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=r.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=Boolean(r.btn_reset),this.btnResetCssClass=r.btn_reset_css_class||"reset",this.onBeforeReset=g["default"].isFn(r.on_before_reset)?r.on_before_reset:null,this.onAfterReset=g["default"].isFn(r.on_after_reset)?r.on_after_reset:null,this.paging=Boolean(r.paging),this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=Boolean(r.sort),this.isSortEnabled=!1,this.sortConfig=r.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=g["default"].isArray(this.sortConfig.sort_types)?this.sortConfig.sort_types:[],this.sortConfig.sortCol=this.sortConfig.sort_col||null,this.sortConfig.asyncSort=Boolean(this.sortConfig.async_sort),this.sortConfig.triggerIds=g["default"].isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.autoFilter=Boolean(r.auto_filter),this.autoFilterDelay=isNaN(r.auto_filter_delay)?900:r.auto_filter_delay,this.isUserTyping=null,this.autoFilterTimer=null,this.highlightKeywords=Boolean(r.highlight_keywords),this.defaultDateType=r.default_date_type||"DMY",this.thousandsSeparator=r.thousands_separator||",",this.decimalSeparator=r.decimal_separator||".",this.hasColNbFormat=Boolean(r.col_number_format),this.colNbFormat=g["default"].isArray(this.hasColNbFormat)?r.col_number_format:null,this.hasColDateType=g["default"].isArray(r.col_date_type),this.colDateType=this.hasColDateType?r.col_date_type:null,this.msgFilter=r.msg_filter||"Filtering data...",this.msgPopulate=r.msg_populate||"Populating filter...",this.msgPopulateCheckList=r.msg_populate_checklist||"Populating list...",this.msgChangePage=r.msg_change_page||"Collecting paging data...",this.msgClear=r.msg_clear||"Clearing filters...",this.msgChangeResults=r.msg_change_results||"Changing results per page...",this.msgResetValues=r.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=r.msg_reset_page||"Re-setting page...",this.msgResetPageLength=r.msg_reset_page_length||"Re-setting page length...",this.msgSort=r.msg_sort||"Sorting data...",this.msgLoadExtensions=r.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=r.msg_load_themes||"Loading theme(s)...",this.prfxTf="TF",this.prfxFlt="flt",this.prfxValButton="btn",this.prfxInfDiv="inf_",this.prfxLDiv="ldiv_",this.prfxRDiv="rdiv_",this.prfxMDiv="mdiv_",this.prfxCookieFltsValues="tf_flts_",this.prfxCookiePageNb="tf_pgnb_",this.prfxCookiePageLen="tf_pglen_",this.hasStoredValues=!1,this.rememberGridValues=Boolean(r.remember_grid_values),this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&r.remember_page_number,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&r.remember_page_length,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=r.extensions,this.hasExtensions=g["default"].isArray(this.extensions),this.enableDefaultTheme=Boolean(r.enable_default_theme),this.hasThemes=this.enableDefaultTheme||g["default"].isArray(r.themes),this.themes=r.themes||[],this.themesPath=r.themes_path||this.basePath+"themes/",this.Cpt={loader:null,alternateRows:null,colOps:null,rowsCounter:null,gridLayout:null,store:null,highlightKeywords:null,paging:null,checkList:null,dropdown:null,popupFilter:null,clearButton:null,help:null,statusBar:null},this.ExtRegistry={sort:null},this.Evt={name:{filter:"Filter",dropdown:"dropdown",checklist:"checkList",changepage:"changePage",clear:"Clear",changeresultsperpage:"changeResults",resetvalues:"ResetValues",resetpage:"resetPage",resetpagelength:"resetPageLength",sort:"Sort",loadextensions:"LoadExtensions",loadthemes:"loadThemes"},detectKey:function(t){if(this.enterKey){var e=t||O.event;if(e){var s=n["default"].keyCode(e);13===s?(this.filter(),n["default"].cancel(e),n["default"].stop(e)):(this.isUserTyping=!0,O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}}},onKeyUp:function(t){function e(){O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null,this.isUserTyping||(this.filter(),this.isUserTyping=null)}if(this.autoFilter){var s=t||O.event,i=n["default"].keyCode(s);this.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?null===this.autoFilterTimer&&(this.autoFilterTimer=O.setInterval(e.bind(this),this.autoFilterDelay)):(O.clearInterval(this.autoFilterTimer),this.autoFilterTimer=null)}},onKeyDown:function(){this.autoFilter&&(this.isUserTyping=!0)},onInpBlur:function(){this.autoFilter&&(this.isUserTyping=!1,O.clearInterval(this.autoFilterTimer))},onInpFocus:function(t){var e=t||O.event,s=n["default"].target(e);this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcFocus:function(t){var e=t||O.event,s=n["default"].target(e);if(this.activeFilterId=s.getAttribute("id"),this.activeFlt=h["default"].id(this.activeFilterId),this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.dropdown._build(i)}this.popUpFilters&&(n["default"].cancel(e),n["default"].stop(e))},onSlcChange:function(t){if(console.log("onSlcChange",this.activeFlt),this.activeFlt){var e=t||O.event;this.popUpFilters&&n["default"].stop(e),this.onSlcChange&&this.filter()}},onCheckListClick:function(t){var e=t||O.event,s=n["default"].target(e);if(this.fillSlcOnDemand&&"0"===s.getAttribute("filled")){var i=s.getAttribute("ct");this.Cpt.checkList._build(i),this.Cpt.checkList.checkListDiv[i].onclick=null,this.Cpt.checkList.checkListDiv[i].title=""}},onBtnClick:function(){this.filter()}}}}return a(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=h["default"].id(this.id)),this.gridLayout&&(this.refRow=null===this.startRow?0:this.startRow),this.popUpFilters&&(0===this.filtersRowIndex&&1===this.headersRow||this.gridLayout)&&(this.headersRow=0);var t=this.cfg,e=this.singleSearchFlt?1:this.nbCells,s=void 0;if(this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new w.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new x.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new T.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new k.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new I.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var i=void 0;if(!this.gridLayout){var l=h["default"].tag(this.tbl,"thead");i=l.length>0?l[0].insertRow(this.filtersRowIndex):this.tbl.insertRow(this.filtersRowIndex),this.headersRow>1&&this.filtersRowIndex<=this.headersRow&&!this.popUpFilters&&this.headersRow++,this.popUpFilters&&this.headersRow++,i.className=this.fltsRowCssClass,!this.isExternalFlt||this.gridLayout&&!this.popUpFilters||(i.style.display="none")}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.tbl.rows.length;for(var a=0;e>a;a++){this.popUpFilters&&this.Cpt.popupFilter.build(a);var r=h["default"].create(this.fltCellTag),o=this["col"+a],u=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[a]:null;if(this.singleSearchFlt&&(r.colSpan=this.nbCells),this.gridLayout||i.appendChild(r),s=a==e-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===o&&(o=void 0===t["col_"+a]?this.fltTypeInp:d["default"].lower(t["col_"+a])),this.singleSearchFlt&&(o=this.fltTypeInp,s=this.singleFltCssClass),o===this.fltTypeSlc||o===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new R.Dropdown(this));var p=this.Cpt.dropdown,c=h["default"].create(this.fltTypeSlc,["id",this.prfxFlt+a+"_"+this.id],["ct",a],["filled","0"]);if(o===this.fltTypeMulti&&(c.multiple=this.fltTypeMulti,c.title=p.multipleSlcTooltip),c.className=d["default"].lower(o)===this.fltTypeSlc?s:this.fltMultiCssClass,u?(h["default"].id(u).appendChild(c),this.externalFltEls.push(c)):r.appendChild(c),this.fltIds.push(this.prfxFlt+a+"_"+this.id),this.fillSlcOnDemand||p._build(a),n["default"].add(c,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(c,"change",this.Evt.onSlcChange.bind(this)),n["default"].add(c,"focus",this.Evt.onSlcFocus.bind(this)),this.fillSlcOnDemand){var f=h["default"].createOpt(this.displayAllText,"");c.appendChild(f)}}else if(o===this.fltTypeCheckList){var g=void 0;this.Cpt.checkList=new F.CheckList(this),g=this.Cpt.checkList;var v=h["default"].create("div",["id",g.prfxCheckListDiv+a+"_"+this.id],["ct",a],["filled","0"]);v.className=g.checkListDivCssClass,u?(h["default"].id(u).appendChild(v),this.externalFltEls.push(v)):r.appendChild(v),g.checkListDiv[a]=v,this.fltIds.push(this.prfxFlt+a+"_"+this.id),this.fillSlcOnDemand||g._build(a),this.fillSlcOnDemand&&(n["default"].add(v,"click",this.Evt.onCheckListClick.bind(this)),v.appendChild(h["default"].text(g.activateCheckListTxt)))}else{var C=o===this.fltTypeInp?"text":"hidden",b=h["default"].create(this.fltTypeInp,["id",this.prfxFlt+a+"_"+this.id],["type",C],["ct",a]);"hidden"!==C&&this.watermark&&b.setAttribute("placeholder",this.isWatermarkArray?this.watermark[a]||"":this.watermark),b.className=s;var m=this.Evt.onInpFocus.bind(this);if(n["default"].add(b,"focus",m),u?(h["default"].id(u).appendChild(b),this.externalFltEls.push(b)):r.appendChild(b),this.fltIds.push(this.prfxFlt+a+"_"+this.id),n["default"].add(b,"keypress",this.Evt.detectKey.bind(this)),n["default"].add(b,"keydown",this.Evt.onKeyDown.bind(this)),n["default"].add(b,"keyup",this.Evt.onKeyUp.bind(this)),n["default"].add(b,"blur",this.Evt.onInpBlur.bind(this)),this.rememberGridValues){var _=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=_[a]&&this.setFilterValue(a,_[a],!1)}}if(a==e-1&&this.displayBtn){var y=h["default"].create(this.fltTypeInp,["id",this.prfxValButton+a+"_"+this.id],["type","button"],["value",this.btnText]);y.className=this.btnCssClass,u?h["default"].id(u).appendChild(y):r.appendChild(y),n["default"].add(y,"click",this.Evt.onBtnClick.bind(this))}}}else this._resetGrid();else this.refRow=this.refRow-1,this.gridLayout&&(this.refRow=0),this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=this.nbFilterableRows+this.refRow;this.rowsCounter&&(this.Cpt.rowsCounter=new P.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new S.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new L.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new E.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help=new D.Help(this),this.Cpt.help.init()),this.hasColWidths&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new B.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new N.ColOps(this),this.Cpt.colOps.calc()),this.sort&&this.importSort(),this.isFirstLoad=!1,this._hasGrid=!0,(this.rememberGridValues||this.rememberPageLen||this.rememberPageNb)&&this.resetValues(),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this.loader&&this.Cpt.loader.show("none"),this.hasExtensions&&this.initExtensions(),this.onFiltersLoaded&&this.onFiltersLoaded.call(null,this)}}},{key:"EvtManager",value:function(t){function e(){var e=this.Evt.name;switch(t){case e.filter:this._filter();break;case e.dropdown:this.linkedFilters?n.dropdown._build(i,!0):n.dropdown._build(i,!1,l,a);break;case e.checklist:n.checkList._build(i,l,a);break;case e.changepage:n.paging._changePage(r);break;case e.clear:this._clearFilters(),this._filter();break;case e.changeresultsperpage:n.paging._changeResultsPerPage();break;case e.resetvalues:this._resetValues(),this._filter();break;case e.resetpage:n.paging._resetPage(this.pgNbCookie);break;case e.resetpagelength:n.paging._resetPageLength(this.pgLenCookie);break;case e.sort:break;case e.loadextensions:this._loadExtensions();break;case e.loadthemes:this._loadThemes()}this.statusBar&&n.statusBar.message(""),this.loader&&n.loader.show("none")}var s=void 0===arguments[1]?{slcIndex:null,slcExternal:!1,slcId:null,pgIndex:null}:arguments[1],i=s.slcIndex,l=s.slcExternal,a=s.slcId,r=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),O.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e];this.ExtRegistry[i.name]||this.loadExtension(i)}}},{key:"loadExtension",value:function(t){var e=this;if(t&&t.name){var i=t.name,l=t.path,a=void 0;i&&l?a=t.path+i:(i=i.replace(".js",""),a="./extensions/{}/{}".replace(/{}/g,i)),s.e(1,function(s){var l=[s(1)(a)];(function(s){var l=new s(e,t);l.init(),e.ExtRegistry[i]=l}).apply(null,l)})}}},{key:"destroyExtensions",value:function(){for(var t=this.extensions,e=0,s=t.length;s>e;e++){var i=t[e],l=this.ExtRegistry[i.name];l&&(l.destroy(),this.ExtRegistry[i.name]=null)}}},{key:"loadThemes",value:function(){this.EvtManager(this.Evt.name.loadthemes)}},{key:"_loadThemes",value:function(){var t=this.themes;if(this.enableDefaultTheme){var e={name:"default"};this.themes.push(e)}if(g["default"].isArray(t))for(var s=0,i=t.length;i>s;s++){var l=t[s],a=l.name,r=l.path;a&&!r?r=this.themesPath+a+"/"+a+".css":!a&&l.path&&(a="theme{0}".replace("{0}",s)),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}},{key:"destroy",value:function(){if(this._hasGrid){var t=this.tbl.rows,e=this.Cpt;this.paging&&e.paging.destroy(),this.statusBar&&e.statusBar.destroy(),this.rowsCounter&&e.rowsCounter.destroy(),this.btnReset&&e.clearButton.destroy(),this.helpInstructions&&e.help.destroy(),this.isExternalFlt&&!this.popUpFilters&&this.removeExternalFlts(),this.infDiv&&this.removeToolbar(),this.highlightKeywords&&e.highlightKeyword.unhighlightAll(),this.loader&&e.loader.destroy(),this.popUpFilters&&e.popupFilter.destroy(),this.markActiveColumns&&this.clearActiveColumns(),this.hasExtensions&&this.destroyExtensions();for(var s=this.refRow;ss;s++){var i=t[s],l=h["default"].id(i);l&&(l.innerHTML="")}}},{key:"importSort",value:function(){this.loadExtension({name:this.sortConfig.name,path:this.sortConfig.path})}},{key:"performSort",value:function(){this.EvtManager(this.Evt.name.sort)}},{key:"isCustomOptions",value:function(t){return this.hasCustomOptions&&-1!=this.customOptions.cols.indexOf(t)}},{key:"getCustomOptions",value:function(t){if(t&&this.isCustomOptions(t)){for(var e=this.customOptions,s=e.cols,i=[],l=[],a=C["default"].indexByValue(s,t),r=e.values[a],n=e.texts[a],o=e.sorts[a],h=0,u=r.length;u>h;h++)l.push(r[h]),i.push(n[h]?n[h]:r[h]);return o&&(l.sort(),i.sort()),[l,i]}}},{key:"resetValues",value:function(){this.EvtManager(this.Evt.name.resetvalues)}},{key:"_resetValues",value:function(){this.rememberGridValues&&this.fillSlcOnDemand&&this._resetGridValues(this.fltsValuesCookie),this.rememberPageLen&&this.Cpt.paging&&this.Cpt.paging.resetPageLength(this.pgLenCookie),this.rememberPageNb&&this.Cpt.paging&&this.Cpt.paging.resetPage(this.pgNbCookie)}},{key:"_resetGridValues",value:function(t){if(this.fillSlcOnDemand){var e=this.Cpt.store.getFilterValues(t),s=this.getFiltersByType(this.fltTypeSlc,!0),i=this.getFiltersByType(this.fltTypeMulti,!0);if(Number(e[e.length-1])===this.fltIds.length){for(var l=0;lo;o++)""!==a[o]&&(r=h["default"].createOpt(a[o],a[o],!0),n.appendChild(r),this.hasStoredValues=!0)}}else if(this["col"+l]==this.fltTypeCheckList){var d=this.Cpt.checkList,p=d.checkListDiv[l];p.title=p.innerHTML,p.innerHTML="";var c=h["default"].create("ul",["id",this.fltIds[l]],["colIndex",l]);c.className=d.checkListCssClass;var f=h["default"].createCheckItem(this.fltIds[l]+"_0","",this.displayAllText);f.className=d.checkListItemCssClass,c.appendChild(f),p.appendChild(c),a=e[l].split(" "+this.orOperator+" ");for(var o=0,u=a.length;u>o;o++)if(""!==a[o]){var g=h["default"].createCheckItem(this.fltIds[l]+"_"+(o+1),a[o],a[o]);g.className=d.checkListItemCssClass,c.appendChild(g),g.check.checked=!0,d.setCheckListValues(g.check),this.hasStoredValues=!0}}}!this.hasStoredValues&&this.paging&&this.Cpt.paging.setPagingInfo()}}}},{key:"filter",value:function(){this.EvtManager(this.Evt.name.filter)}},{key:"_filter",value:function(){function t(t,e,s){if(this.highlightKeywords&&e){t=t.replace(g,""),t=t.replace(v,""),t=t.replace(b,""),t=t.replace(m,"");var l=t;(o.test(t)||u.test(t)||p.test(t)||c.test(t)||f.test(t))&&(l=h["default"].getText(s)),""!==l&&i.highlightKeyword.highlight(s,l,i.highlightKeyword.highlightCssClass)}}function e(t,e,s){var i=void 0,a=y["default"].removeNbFormat,h=p.test(t),C=o.test(t),T=c.test(t),k=u.test(t),I=f.test(t),R=v.test(t),F=g.test(t),P=b.test(t),S=m.test(t),L=_===t,D=w===t,B=x.test(t),N=h&&M(t.replace(p,""),E),O=C&&M(t.replace(o,""),E),H=T&&M(t.replace(c,""),E),V=k&&M(t.replace(u,""),E),U=I&&M(t.replace(f,""),E),j=R&&M(t.replace(v,""),E),G=void 0,W=void 0;if(M(e,E))G=A(e,E),N?(W=A(t.replace(p,""),E),i=W>G):O?(W=A(t.replace(o,""),E),i=W>=G):V?(W=A(t.replace(u,""),E),i=G>=W):H?(W=A(t.replace(c,""),E),i=G>W):U?(W=A(t.replace(f,""),E),i=G.toString()!=W.toString()):j?(W=A(t.replace(v,""),E),i=G.toString()==W.toString()):g.test(t)?i=this._containsStr(t.replace(g,""),e,null,!1):M(t,E)?(W=A(t,E),i=G.toString()==W.toString()):L?i=d["default"].isEmpty(e):D&&(i=!d["default"].isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(r=a(e,this.colNbFormat[s]),n=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(r=a(e,"us"),n="us"):(r=a(e,"eu"),n="eu"),C)i=r<=a(t.replace(o,""),n);else if(k)i=r>=a(t.replace(u,""),n);else if(h)i=ra(t.replace(c,""),n);else if(I)i=this._containsStr(t.replace(f,""),e)?!1:!0;else if(F)i=this._containsStr(t.replace(g,""),e,null,!1);else if(R)i=this._containsStr(t.replace(v,""),e,null,!0);else if(P)i=0===e.indexOf(t.replace(b,""))?!0:!1;else if(S){var q=t.replace(m,"");i=e.lastIndexOf(q,e.length-1)===e.length-1-(q.length-1)&&e.lastIndexOf(q,e.length-1)>-1?!0:!1}else if(L)i=d["default"].isEmpty(e);else if(D)i=!d["default"].isEmpty(e);else if(B)try{var $=t.replace(x,""),K=new RegExp($);i=K.test(e)}catch(Y){i=!1}else{var z=l["col_"+s];i=this._containsStr(t,e,z?z:this.fltTypeInp)}return i}if(this.fltGrid&&(this._hasGrid||this.isFirstLoad)){this.onBeforeFilter&&this.onBeforeFilter.call(null,this);var s=this.tbl.rows,i=this.Cpt,l=this.cfg,a=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var r,n,o=new RegExp(this.leOperator),u=new RegExp(this.geOperator),p=new RegExp(this.lwOperator),c=new RegExp(this.grOperator),f=new RegExp(this.dfOperator),g=new RegExp(d["default"].rgxEsc(this.lkOperator)),v=new RegExp(this.eqOperator),b=new RegExp(this.stOperator),m=new RegExp(this.enOperator),_=this.emOperator,w=this.nmOperator,x=new RegExp(d["default"].rgxEsc(this.rgxOperator)),T=this.refRow;TS;S++){var L=this.searchArgs[this.singleSearchFlt?0:S],E=this.hasColDateType?this.colDateType[S]:this.defaultDateType;if(""!==L){var D=d["default"].matchCase(this.getCellData(S,k[S]),this.caseSensitive),B=L.split(this.orOperator),N=B.length>1?!0:!1,O=L.split(this.anOperator),H=O.length>1?!0:!1;if(N||H){for(var V=void 0,U=!1,j=N?B:O,G=0;Gh;h++)if(h==t&&""==i[a].style.display){var u=d["default"].lower(this.getCellData(h,n[h])),p=this.colNbFormat?this.colNbFormat[t]:null,c=e?y["default"].removeNbFormat(u,p):u;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.fltCol[t];if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var l=0;lo;o++){var u=h["default"].tag(s,"li")[o],p=h["default"].tag(u,"label")[0],c=h["default"].tag(u,"input")[0],f=d["default"].matchCase(h["default"].getText(p),this.caseSensitive);""!==f&&C["default"].has(r,f,!0)?(c.checked=!0,this.Cpt.checkList.setCheckListValues(c)):(c.checked=!1,this.Cpt.checkList.setCheckListValues(c))}}}}},{key:"setColWidths",value:function(t){function e(t){var e=this.nbCells,s=this.colWidths;if(e!=s.length||e!=t.cells.length)throw new Error("Columns number mismatch!");for(var i=0;e>i;i++)t.cells[i].style.width=s[i]}if(this.fltGrid&&this.hasColWidths){var s=void 0;s=void 0===t?"none"!=this.tbl.rows[0].style.display?0:1:t,e.call(this,this.tbl.rows[s])}}},{key:"enforceVisibility",value:function(){if(this._hasGrid&&this.hasVisibleRows&&!this.paging)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0;tt;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"linkFilters",value:function(){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);if(i=i.concat(s),this.activeFilterId){var l=this.activeFilterId.split("_")[0];l=l.split(this.prfxFlt)[1];for(var a=void 0,r=0;rr;r++){var o=h["default"].id(a[r]);if(o){var u=this.externalFltEls[r];o.appendChild(u);var d=this["col"+r];this.gridLayout&&""===u.innerHTML&&d!==this.fltTypeInp&&((d===this.fltTypeSlc||d===this.fltTypeMulti)&&t.dropdown.build(r),d===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.isSortEnabled&&(this.sort=!0),this.popUpFilters&&(this.headersRow++,t.popupFilter.buildAll()),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{key:"_containsStr",value:function(t,e,s,i){var l=void 0,a=this.caseSensitive?"g":"gi",r=i?i:this.exactMatch;return l=r||s!==this.fltTypeInp&&s?new RegExp("(^\\s*)"+d["default"].rgxEsc(t)+"(\\s*$)",a):new RegExp(d["default"].rgxEsc(t),a),l.test(e)}},{key:"isImported",value:function(t,e){for(var s=!1,i=e?e:"script",l="script"==i?"src":"href",a=h["default"].tag(H,i),r=0;r]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},create:function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;ii;i++)e(s[i]);return t},matchCase:function(t,e){return e?t:this.lower(t)}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={write:function(t,e,s){var i="";s&&(i=new Date((new Date).getTime()+36e5*s),i="; expires="+i.toGMTString()),document.cookie=t+"="+escape(e)+i},read:function(t){var e="",s=t+"=";if(document.cookie.length>0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var a=i.indexOf(";",l);-1===a&&(a=i.length),e=unescape(i.substring(l,a))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"==typeof window[t]&&(e=!0):t&&"object"==typeof t&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,l=0;l2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function l(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,l=void 0;if("Y"==e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,l=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"==e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,l=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,l=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&l.test(t)===!1)return!1;var a=t.split(RegExp.$1),r=void 0,n=void 0,o=void 0;r="M"===e.substring(0,1)?a[0]:"M"===e.substring(1,2)?a[1]:a[2],n="D"===e.substring(0,1)?a[0]:"D"===e.substring(1,2)?a[1]:a[2],o="Y"===e.substring(0,1)?a[0]:"Y"===e.substring(1,2)?a[1]:a[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var h=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(n,10),0,0,0,0);return parseInt(n,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":parts=t.replace(/[- \/.]/g," ").split(" "),s=new Date(i(parts[2]),l(parts[1])-1,parts[0]);break;case"DMY":parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0]);break;case"MDY":parts=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[0]-1,parts[1]);break;case"YMD":parts=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),s=new Date(i(parts[0]),parts[1]-1,parts[2]);break;default:parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0])}return s}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===a["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&i.removeChild(I[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(),this.headTblCont.style.width=this.tblCont.clientWidth+"px",i.style.width="",this.headTbl.style.width=i.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var s=p["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.tblHasColTag=n["default"].tag(i,"col").length>0?!0:!1;var R=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=n["default"].create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidths[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var F=n["default"].tag(i,"col"),P=0;P',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=n["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=n["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=n["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=n["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.tf=t}return a(e,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,l=parseInt(i.getAttribute("ci"),10);if(this.closeAll(l),this.toggle(l),this.popUpFltAdjustToContainer){var a=this.popUpFltElms[l],r=this.tf.getHeaderElement(l),n=.95*r.clientWidth;if(c["default"].isIE()){var o=h["default"].position(r).left;a.style.left=o+"px"}a.style.width=parseInt(n,10)+"px"}d["default"].cancel(s),d["default"].stop(s)}},{key:"init",value:function(){for(var t=this,e=this.tf,s=0;sh;h++)if(h===t&&""===i[a].style.display){var d=u["default"].lower(this.getCellData(h,n[h])),p=this.colNbFormat?this.colNbFormat[t]:null,c=e?y["default"].removeNbFormat(d,p):d;l.push(c)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e=void 0,s=this.getFilterElement(t);if(!s)return"";var i=this.fltCol[t];if(i!==this.fltTypeMulti&&i!==this.fltTypeCheckList)e=s.value;else if(i===this.fltTypeMulti){e="";for(var l=0;lo;o++){var d=h["default"].tag(s,"li")[o],p=h["default"].tag(d,"label")[0],c=h["default"].tag(d,"input")[0],f=u["default"].matchCase(h["default"].getText(p),this.caseSensitive);""!==f&&C["default"].has(r,f,!0)?(c.checked=!0,this.Cpt.checkList.setCheckListValues(c)):(c.checked=!1,this.Cpt.checkList.setCheckListValues(c))}}}}},{key:"setColWidths",value:function(t){function e(t){var e=this.nbCells,s=this.colWidths;if(e!=s.length||e!=t.cells.length)throw new Error("Columns number mismatch!");for(var i=0;e>i;i++)t.cells[i].style.width=s[i]}if(this.fltGrid&&this.hasColWidths){var s=void 0;s=void 0===t?"none"!=this.tbl.rows[0].style.display?0:1:t,e.call(this,this.tbl.rows[s])}}},{key:"enforceVisibility",value:function(){if(this._hasGrid&&this.hasVisibleRows&&!this.paging)for(var t=0,e=this.visibleRows.length;e>t;t++){var s=this.visibleRows[t];s<=this.nbRows&&this.validateRow(s,!0)}}},{key:"clearFilters",value:function(){this.EvtManager(this.Evt.name.clear)}},{key:"_clearFilters",value:function(){if(this.fltGrid){this.onBeforeReset&&this.onBeforeReset.call(null,this,this.getFiltersValue());for(var t=0;tt;t++)h["default"].removeClass(this.getHeaderElement(t),this.activeColumnsCssClass)}},{key:"linkFilters",value:function(){var t=this.getFiltersByType(this.fltTypeSlc,!0),e=this.getFiltersByType(this.fltTypeMulti,!0),s=this.getFiltersByType(this.fltTypeCheckList,!0),i=t.concat(e);if(i=i.concat(s),this.activeFilterId){var l=this.activeFilterId.split("_")[0];l=l.split(this.prfxFlt)[1];for(var a=void 0,r=0;rr;r++){var o=h["default"].id(a[r]);if(o){var d=this.externalFltEls[r];o.appendChild(d);var u=this["col"+r];this.gridLayout&&""===d.innerHTML&&u!==this.fltTypeInp&&((u===this.fltTypeSlc||u===this.fltTypeMulti)&&t.dropdown.build(r),u===this.fltTypeCheckList&&t.checkList.build(r))}}this.nbFilterableRows=this.getRowsNb(),this.nbVisibleRows=this.nbFilterableRows,this.nbRows=s.length,this.isSortEnabled&&(this.sort=!0),this.popUpFilters&&(this.headersRow++,t.popupFilter.buildAll()),this.gridLayout||h["default"].addClass(this.tbl,this.prfxTf),this._hasGrid=!0}}},{key:"_containsStr",value:function(t,e,s,i){var l=void 0,a=this.caseSensitive?"g":"gi",r=i?i:this.exactMatch;return l=r||s!==this.fltTypeInp&&s?new RegExp("(^\\s*)"+u["default"].rgxEsc(t)+"(\\s*$)",a):new RegExp(u["default"].rgxEsc(t),a),l.test(e)}},{key:"isImported",value:function(t,e){for(var s=!1,i=e?e:"script",l="script"==i?"src":"href",a=h["default"].tag(H,i),r=0;r]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},create:function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;ii;i++)e(s[i]);return t},matchCase:function(t,e){return e?t:this.lower(t)}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={write:function(t,e,s){var i="";s&&(i=new Date((new Date).getTime()+36e5*s),i="; expires="+i.toGMTString()),document.cookie=t+"="+escape(e)+i},read:function(t){var e="",s=t+"=";if(document.cookie.length>0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var a=i.indexOf(";",l);-1===a&&(a=i.length),e=unescape(i.substring(l,a))}}return e},remove:function(t){this.write(t,"",-1)},valueToArray:function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},getValueByIndex:function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]}},t.exports=e["default"]},function(t,e,s){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=void 0;e["default"]={isObj:function(t){var e=!1;return"string"==typeof t?window[t]&&"object"==typeof window[t]&&(e=!0):t&&"object"==typeof t&&(e=!0),e},isFn:function(t){return t&&t.constructor==Function},isArray:function(t){return t&&t.constructor==Array},isUndef:function(t){return t===i}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={has:function(t,e,s){for(var i=void 0===s?!1:s,l=0;l2)return t;var e=void 0;return 99>=t&&t>50&&(e="19"+t),(50>t||"00"===t)&&(e="20"+t),e}function l(t){if(void 0===t)return 0;for(var e=void 0,s=["january","february","march","april","may","june","july","august","september","october","november","december","jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],i=0;i11||23>e)&&(e-=12),1>e||e>12?0:e}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={isValid:function(t,e){if(e||(e="DMY"),e=e.toUpperCase(),3!=e.length&&"DDMMMYYYY"===e){var s=this.format(t,e);t=s.getDate()+"/"+(s.getMonth()+1)+"/"+s.getFullYear(),e="DMY"}(-1===e.indexOf("M")||-1===e.indexOf("D")||-1===e.indexOf("Y"))&&(e="DMY");var i=void 0,l=void 0;if("Y"==e.substring(0,1)?(i=/^\d{2}(\-|\/|\.)\d{1,2}\1\d{1,2}$/,l=/^\d{4}(\-|\/|\.)\d{1,2}\1\d{1,2}$/):"Y"==e.substring(1,2)?(i=/^\d{1,2}(\-|\/|\.)\d{2}\1\d{1,2}$/,l=/^\d{1,2}(\-|\/|\.)\d{4}\1\d{1,2}$/):(i=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/,l=/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/),i.test(t)===!1&&l.test(t)===!1)return!1;var a=t.split(RegExp.$1),r=void 0,n=void 0,o=void 0;r="M"===e.substring(0,1)?a[0]:"M"===e.substring(1,2)?a[1]:a[2],n="D"===e.substring(0,1)?a[0]:"D"===e.substring(1,2)?a[1]:a[2],o="Y"===e.substring(0,1)?a[0]:"Y"===e.substring(1,2)?a[1]:a[2],parseInt(o,10)<=50&&(o=(parseInt(o,10)+2e3).toString()),parseInt(o,10)<=99&&(o=(parseInt(o,10)+1900).toString());var h=new Date(parseInt(o,10),parseInt(r,10)-1,parseInt(n,10),0,0,0,0);return parseInt(n,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s=void 0;switch(e.toUpperCase()){case"DDMMMYYYY":parts=t.replace(/[- \/.]/g," ").split(" "),s=new Date(i(parts[2]),l(parts[1])-1,parts[0]);break;case"DMY":parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0]);break;case"MDY":parts=t.replace(/^(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[0]-1,parts[1]);break;case"YMD":parts=t.replace(/^((\d\d)?\d\d)([- \/.])(0?[1-9]|1[012])([- \/.])(0?[1-9]|[12][0-9]|3[01])$/,"$1 $4 $6").split(" "),s=new Date(i(parts[0]),parts[1]-1,parts[2]);break;default:parts=t.replace(/^(0?[1-9]|[12][0-9]|3[01])([- \/.])(0?[1-9]|1[012])([- \/.])((\d\d)?\d\d)$/,"$1 $3 $5").split(" "),s=new Date(i(parts[2]),parts[1]-1,parts[0])}return s}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===a["default"].lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}},t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s0&&i.removeChild(I[0]),this.headTbl.style.tableLayout="fixed",i.style.tableLayout="fixed",this.headTbl.cellPadding=i.cellPadding,this.headTbl.cellSpacing=i.cellSpacing,e.setColWidths(),this.headTblCont.style.width=this.tblCont.clientWidth+"px",i.style.width="",this.headTbl.style.width=i.clientWidth+"px",p["default"].add(this.tblCont,"scroll",function(e){var s=p["default"].target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.tblHasColTag=n["default"].tag(i,"col").length>0?!0:!1;var R=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=n["default"].create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidths[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var F=n["default"].tag(i,"col"),P=0;P',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=n["default"].isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=n["default"].isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=n["default"].isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=n["default"].isFn(s.on_after_popup_filter_close)?s.on_after_popup_filter_close:null,this.popUpFltSpans=[],this.popUpFltImgs=[],this.popUpFltElms=this.popUpFltElmCache||[],this.popUpFltAdjustToContainer=!0,this.prfxPopUpSpan="popUpSpan_",this.prfxPopUpDiv="popUpDiv_",this.tf=t}return a(e,[{key:"onClick",value:function(e){var s=e||t.event,i=s.target.parentNode,l=parseInt(i.getAttribute("ci"),10);if(this.closeAll(l),this.toggle(l),this.popUpFltAdjustToContainer){var a=this.popUpFltElms[l],r=this.tf.getHeaderElement(l),n=.95*r.clientWidth;if(c["default"].isIE()){var o=h["default"].position(r).left;a.style.left=o+"px"}a.style.width=parseInt(n,10)+"px"}u["default"].cancel(s),u["default"].stop(s)}},{key:"init",value:function(){for(var t=this,e=this.tf,s=0;sy;y++)if(t===y&&(!e||e&&l.disableExcludedOptions)||t==y&&e&&(""===o[b].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&h["default"].has(l.validRowsIndex,b))&&(void 0===p||p==t||p!=t&&h["default"].has(l.validRowsIndex,b)))){var w=l.getCellData(y,m[y]),x=u["default"].matchCase(w,d);if(h["default"].has(this.opts,x,d)||this.opts.push(w),e&&l.disableExcludedOptions){var T=C[y];T||(T=this.GetFilteredDataCol(y)),h["default"].has(T,x,d)||h["default"].has(v,x,d)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.getCustomOptions(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(d?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,r,e,v,f,g)}}},{key:"addOptions",value:function(t,e,s,i,l,a){var r=this.tf,o=u["default"].lower(this.slcFillingMethod),d=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var p=0;p"+f+""}else{var C;C=r.fillSlcOnDemand&&d===this.opts[p]&&r["col"+t]===r.fltTypeSlc?n["default"].createOpt(f,c,!0):r["col"+t]!==r.fltTypeMulti?n["default"].createOpt(f,c," "!==l[t]&&c===l[t]?!0:!1):n["default"].createOpt(f,c,h["default"].has(a,u["default"].matchCase(this.opts[p],r.matchCase),r.matchCase)||-1!==a.toString().indexOf(c)?!0:!1),g&&(C.disabled=!0),e.appendChild(C)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=u["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=n["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=n["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=n["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===d[C].style.display&&!l.paging||l.paging&&(!p||p===t||p!=t&&h["default"].has(l.validRowsIndex,C)))){var y=l.getCellData(_,b[_]),w=u["default"].matchCase(y,l.matchCase);h["default"].has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),h["default"].has(x,w,l.matchCase)||h["default"].has(f,w,l.matchCase)||l.isFirstLoad||f.push(y))}}if(this.isCustom){var T=l.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),f&&f.sort()):(this.opts.sort(c["default"].ignoreCase),f&&f.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,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(l.sortNumDesc&&h["default"].has(l.sortNumDesc,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.addChecks(t,o,l.separator),l.fillSlcOnDemand&&(r.innerHTML=""),r.appendChild(o),r.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),a=[],r=i.Cpt.store,o=r?r.getFilterValues(i.fltsValuesCookie)[t]:null;o&&u["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&h["default"].has(i.customSlcOptions.cols,t)?a.push(o):a=o.split(" "+i.orOperator+" "));for(var d=0;d0?1:0),a=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+a+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows-(e.hasVisibleRows?e.visibleRows.length:0);this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{key:"destroy",value:function(){var t=this.tf;t.hasGrid()&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?u["default"].isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):n["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s",this.btnPrevPageText=s.btn_prev_page_text||"<",this.btnLastPageText=s.btn_last_page_text||">|",this.btnFirstPageText=s.btn_first_page_text||"|<",this.btnNextPageHtml=s.btn_next_page_html||(e.enableIcons?'':null),this.btnPrevPageHtml=s.btn_prev_page_html||(e.enableIcons?'':null),this.btnFirstPageHtml=s.btn_first_page_html||(e.enableIcons?'':null),this.btnLastPageHtml=s.btn_last_page_html||(e.enableIcons?'':null),this.pageText=s.page_text||" Page ",this.ofText=s.of_text||" of ",this.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",this.hasPagingBtns=s.paging_btns===!1?!1:!0,this.pageSelectorType=s.page_selector_type||e.fltTypeSlc,this.onBeforeChangePage=h["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=h["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_";var i=this.refRow,a=this.nbRows;this.nbPages=Math.ceil((a-i)/this.pagingLength);var r=this;this.evt={slcIndex:function(){return r.pageSelectorType===e.fltTypeSlc?r.pagingSlc.options.selectedIndex:parseInt(r.pagingSlc.value,10)-1},nbOpts:function(){return r.pageSelectorType===e.fltTypeSlc?parseInt(r.pagingSlc.options.length,10)-1:r.nbPages-1},next:function(){var t=r.evt.slcIndex()0?r.evt.slcIndex()-1:r.evt.nbOpts();r.changePage(t)},last:function(){r.changePage(r.evt.nbOpts())},first:function(){r.changePage(0)},_detectKey:function(t){var s=c["default"].keyCode(t);13===s&&(e.sorted?(e.filter(),r.changePage(r.evt.slcIndex())):r.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return a(t,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){e.changePage(),t.target.blur()},this.pageSelectorType===s.fltTypeSlc&&(t=n["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,c["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=n["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,c["default"].add(t,"keypress",i._detectKey));var l=n["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),a=n["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),r=n["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),o=n["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,c["default"].add(l,"click",i.next);else{var h=n["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);h.className=this.btnPageCssClass,c["default"].add(h,"click",i.next),l.appendChild(h)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,c["default"].add(a,"click",i.prev);else{var d=n["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);d.className=this.btnPageCssClass,c["default"].add(d,"click",i.prev),a.appendChild(d)}if(this.btnLastPageHtml)r.innerHTML=this.btnLastPageHtml,c["default"].add(r,"click",i.last);else{var u=n["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);u.className=this.btnPageCssClass,c["default"].add(u,"click",i.last),r.appendChild(u)}if(this.btnFirstPageHtml)o.innerHTML=this.btnFirstPageHtml,c["default"].add(o,"click",i.first);else{var p=n["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);p.className=this.btnPageCssClass,c["default"].add(p,"click",i.first),o.appendChild(p)}}this.pagingTgtId||s.setToolbar();var f=this.pagingTgtId?n["default"].id(this.pagingTgtId):s.mDiv;f.appendChild(o),f.appendChild(a);var g=n["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(n["default"].text(this.pageText)),g.className=this.nbPgSpanCssClass,f.appendChild(g),f.appendChild(t);var v=n["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(n["default"].text(this.ofText)),v.className=this.nbPgSpanCssClass,f.appendChild(v);var C=n["default"].create("span",["id",this.prfxPgSpan+s.id]);C.className=this.nbPgSpanCssClass,C.appendChild(n["default"].text(" "+this.nbPages+" ")),f.appendChild(C),f.appendChild(l),f.appendChild(r),this.pagingSlc=n["default"].id(this.prfxSlcPages+s.id),(!s.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),s.fltGrid||(s.ValidateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.isPagingRemoved=!1}},{key:"addPaging",value:function(){var t=void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!e.paging&&(e.paging=!0,this.isPagingRemoved=!0,this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(t){var e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?n["default"].id(this.pagingTgtId):e.mDiv,l=n["default"].id(this.prfxPgSpan+e.id);if(t&&t.length>0)e.validRowsIndex=t;else{e.validRowsIndex=[];for(var a=e.refRow;a0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var h=0;h=this.startPagingRow&&i>l?("true"!==a.getAttribute("validRow")&&a.getAttribute("validRow")||(a.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(a.style.display="none",e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.removeRowBg(e.validRowsIndex[l]))}e.nbVisibleRows=e.validRowsIndex.length,e.isStartBgAlternate=!1,e.applyGridProps()}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&e.paging){var s=this.evt,i=typeof t;if("string"===i)switch(u["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=n["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],r=n["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);r.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var o=this.resultsPerPageTgtId?n["default"].id(this.resultsPerPageTgtId):e.rDiv;r.appendChild(n["default"].text(l)),o.appendChild(r),o.appendChild(i),this.resultsPerPageSlc=n["default"].id(this.prfxSlcResults+e.id);for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.Cpt.store.savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(t.paging){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.Cpt.store.savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.Cpt.store.getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(e.paging){var s=e.Cpt.store.getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()){var e,s,i,l,a,r,o;e=n["default"].id(this.prfxBtnNextSpan+t.id),s=n["default"].id(this.prfxBtnPrevSpan+t.id),i=n["default"].id(this.prfxBtnLastSpan+t.id),l=n["default"].id(this.prfxBtnFirstSpan+t.id),a=n["default"].id(this.prfxPgBeforeSpan+t.id),r=n["default"].id(this.prfxPgAfterSpan+t.id),o=n["default"].id(this.prfxPgSpan+t.id);var h=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?c["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&c["default"].remove(this.pagingSlc,"keypress",h._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(c["default"].remove(e,"click",h.next),e.parentNode.removeChild(e)),s&&(c["default"].remove(s,"click",h.prev),s.parentNode.removeChild(s)),i&&(c["default"].remove(i,"click",h.last),i.parentNode.removeChild(i)),l&&(c["default"].remove(l,"click",h.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),r&&r.parentNode.removeChild(r),o&&o.parentNode.removeChild(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return a(t,[{key:"onClick",value:function(){this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(e.hasGrid()||e.isFirstLoad||!e.btnResetEl){var s=n["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?n["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;h["default"].add(l,"click",function(){t.onClick()})}else{var a=n["default"].create("a",["href","javascript:void(0);"]);a.className=e.btnResetCssClass,a.appendChild(n["default"].text(this.btnResetText)),s.appendChild(a),h["default"].add(a,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=n["default"].id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=d},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=s.help_instructions_html||null,this.helpInstrBtnText=s.help_instructions_btn_text||"?",this.helpInstrBtnHtml=s.help_instructions_btn_html||null,this.helpInstrBtnCssClass=s.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=s.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+e.version+'

http://tablefilter.free.fr
©2009-'+e.year+' Max Guglielmi.
',this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.tf=e}return a(t,[{key:"init",value:function(){var t=this;if(!this.helpInstrBtnEl){var e=this.tf,s=n["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=n["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.helpInstrTgtId||e.setToolbar();var l=this.helpInstrTgtId?n["default"].id(this.helpInstrTgtId):e.rDiv;l.appendChild(s);var a=this.helpInstrContTgtId?n["default"].id(this.helpInstrContTgtId):s;if(this.helpInstrBtnHtml){s.innerHTML=this.helpInstrBtnHtml;var r=s.firstChild;h["default"].add(r,"click",function(){t.toggle()}),a.appendChild(i)}else{a.appendChild(i);var o=n["default"].create("a",["href","javascript:void(0);"]);o.className=this.helpInstrBtnCssClass,o.appendChild(n["default"].text(this.helpInstrBtnText)),s.appendChild(o),h["default"].add(o,"click",function(){t.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&a.appendChild(i),i.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.helpInstrText,i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.helpInstrDefaultHtml,h["default"].add(i,"click",function(){t.toggle()}),this.helpInstrContEl=i,this.helpInstrBtnEl=s}}},{key:"toggle",value:function(){if(this.helpInstrContEl){var t=this.helpInstrContEl.style.display;if(""===t||"none"===t){this.helpInstrContEl.style.display="block";var e=n["default"].position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=e-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}}},{key:"destroy",value:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))}}]),t}();e.Help=d},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;sl;l++){var a=t?l:this.tf.validRowsIndex[l];this.setRowBg(a,i),i++}}},{key:"setRowBg",value:function(t,e){if(this.tf.alternateBgs&&!isNaN(t)){var s=this.tf.tbl.rows,i=e?e:t;this.removeRowBg(t),n["default"].addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;n["default"].removeClass(e[t],this.oddCss),n["default"].removeClass(e[t],this.evenCss)}}},{key:"remove",value:function(){if(this.tf.hasGrid()){for(var t=this.tf.refRow;t=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_Str2["default"].lower(typeof labelId)&&"object"==_Str2["default"].lower(typeof colIndex)&&"object"==_Str2["default"].lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.getColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),_Dom2["default"].id(labThisCol[i]))switch(_Str2["default"].lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom2["default"].id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom2["default"].id(labThisCol[i]).firstChild,txtnode=_Dom2["default"].text(result);_Dom2["default"].id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}]),ColOps}();exports.ColOps=ColOps},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={ignoreCase:function(t,e){var s=a["default"].lower(t),i=a["default"].lower(e);return i>s?-1:s>i?1:0}},t.exports=e["default"]}])}); \ No newline at end of file +}else this.onBeforePopUpClose&&this.onBeforePopUpClose.call(null,this,this.popUpFltElms[t],t),s.style.display="none",this.onAfterPopUpClose&&this.onAfterPopUpClose.call(null,this,this.popUpFltElms[t],t)}},{key:"closeAll",value:function(t){for(var e=0;ey;y++)if(t===y&&(!e||e&&l.disableExcludedOptions)||t==y&&e&&(""===o[b].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&h["default"].has(l.validRowsIndex,b))&&(void 0===p||p==t||p!=t&&h["default"].has(l.validRowsIndex,b)))){var w=l.getCellData(y,m[y]),x=d["default"].matchCase(w,u);if(h["default"].has(this.opts,x,u)||this.opts.push(w),e&&l.disableExcludedOptions){var T=C[y];T||(T=this.GetFilteredDataCol(y)),h["default"].has(T,x,u)||h["default"].has(v,x,u)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.getCustomOptions(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(u?(this.opts.sort(),v&&v.sort()):(this.opts.sort(c["default"].ignoreCase),v&&v.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),v&&v.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&h["default"].has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),v&&v.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(I){this.opts.sort(),v&&v.sort(),this.isCustom&&this.optsTxt.sort()}this.addOptions(t,r,e,v,f,g)}}},{key:"addOptions",value:function(t,e,s,i,l,a){var r=this.tf,o=d["default"].lower(this.slcFillingMethod),u=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var p=0;p"+f+""}else{var C;C=r.fillSlcOnDemand&&u===this.opts[p]&&r["col"+t]===r.fltTypeSlc?n["default"].createOpt(f,c,!0):r["col"+t]!==r.fltTypeMulti?n["default"].createOpt(f,c," "!==l[t]&&c===l[t]?!0:!1):n["default"].createOpt(f,c,h["default"].has(a,d["default"].matchCase(this.opts[p],r.matchCase),r.matchCase)||-1!==a.toString().indexOf(c)?!0:!1),g&&(C.disabled=!0),e.appendChild(C)}}"innerhtml"===o&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=d["default"].lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=n["default"].createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=n["default"].createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=n["default"].createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===u[C].style.display&&!l.paging||l.paging&&(!p||p===t||p!=t&&h["default"].has(l.validRowsIndex,C)))){var y=l.getCellData(_,b[_]),w=d["default"].matchCase(y,l.matchCase);h["default"].has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),h["default"].has(x,w,l.matchCase)||h["default"].has(f,w,l.matchCase)||l.isFirstLoad||f.push(y))}}if(this.isCustom){var T=l.getCustomOptions(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),f&&f.sort()):(this.opts.sort(c["default"].ignoreCase),f&&f.sort(c["default"].ignoreCase))),l.sortNumAsc&&h["default"].has(l.sortNumAsc,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(l.sortNumDesc&&h["default"].has(l.sortNumDesc,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.addChecks(t,o,l.separator),l.fillSlcOnDemand&&(r.innerHTML=""),r.appendChild(o),r.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),a=[],r=i.Cpt.store,o=r?r.getFilterValues(i.fltsValuesCookie)[t]:null;o&&d["default"].trim(o).length>0&&(i.hasCustomSlcOptions&&h["default"].has(i.customSlcOptions.cols,t)?a.push(o):a=o.split(" "+i.orOperator+" "));for(var u=0;u0?1:0),a=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+a+this.overText+e.nbVisibleRows}}else s=t&&""!==t?t:e.nbFilterableRows-e.nbHiddenRows-(e.hasVisibleRows?e.visibleRows.length:0);this.rowsCounterSpan.innerHTML=s,this.onAfterRefreshCounter&&this.onAfterRefreshCounter.call(null,e,this.rowsCounterSpan,s)}}},{key:"destroy",value:function(){var t=this.tf;t.hasGrid()&&this.rowsCounterSpan&&(!this.rowsCounterTgtId&&this.rowsCounterDiv?d["default"].isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):n["default"].id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=p},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s",this.btnPrevPageText=s.btn_prev_page_text||"<",this.btnLastPageText=s.btn_last_page_text||">|",this.btnFirstPageText=s.btn_first_page_text||"|<",this.btnNextPageHtml=s.btn_next_page_html||(e.enableIcons?'':null),this.btnPrevPageHtml=s.btn_prev_page_html||(e.enableIcons?'':null),this.btnFirstPageHtml=s.btn_first_page_html||(e.enableIcons?'':null),this.btnLastPageHtml=s.btn_last_page_html||(e.enableIcons?'':null),this.pageText=s.page_text||" Page ",this.ofText=s.of_text||" of ",this.nbPgSpanCssClass=s.nb_pages_css_class||"nbpg",this.hasPagingBtns=s.paging_btns===!1?!1:!0,this.pageSelectorType=s.page_selector_type||e.fltTypeSlc,this.onBeforeChangePage=h["default"].isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=h["default"].isFn(s.on_after_change_page)?s.on_after_change_page:null,this.prfxSlcPages="slcPages_",this.prfxSlcResults="slcResults_",this.prfxSlcResultsTxt="slcResultsTxt_",this.prfxBtnNextSpan="btnNextSpan_",this.prfxBtnPrevSpan="btnPrevSpan_",this.prfxBtnLastSpan="btnLastSpan_",this.prfxBtnFirstSpan="btnFirstSpan_",this.prfxBtnNext="btnNext_",this.prfxBtnPrev="btnPrev_",this.prfxBtnLast="btnLast_",this.prfxBtnFirst="btnFirst_",this.prfxPgSpan="pgspan_",this.prfxPgBeforeSpan="pgbeforespan_",this.prfxPgAfterSpan="pgafterspan_";var i=this.refRow,a=this.nbRows;this.nbPages=Math.ceil((a-i)/this.pagingLength);var r=this;this.evt={slcIndex:function(){return r.pageSelectorType===e.fltTypeSlc?r.pagingSlc.options.selectedIndex:parseInt(r.pagingSlc.value,10)-1},nbOpts:function(){return r.pageSelectorType===e.fltTypeSlc?parseInt(r.pagingSlc.options.length,10)-1:r.nbPages-1},next:function(){var t=r.evt.slcIndex()0?r.evt.slcIndex()-1:r.evt.nbOpts();r.changePage(t)},last:function(){r.changePage(r.evt.nbOpts())},first:function(){r.changePage(0)},_detectKey:function(t){var s=c["default"].keyCode(t);13===s&&(e.sorted?(e.filter(),r.changePage(r.evt.slcIndex())):r.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return a(t,[{key:"init",value:function(){var t,e=this,s=this.tf,i=this.evt;this.hasResultsPerPage&&(this.resultsPerPage.length<2?this.hasResultsPerPage=!1:(this.pagingLength=this.resultsPerPage[1][0],this.setResultsPerPage())),i.slcPagesChange=function(t){e.changePage(),t.target.blur()},this.pageSelectorType===s.fltTypeSlc&&(t=n["default"].create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,c["default"].add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=n["default"].create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,c["default"].add(t,"keypress",i._detectKey));var l=n["default"].create("span",["id",this.prfxBtnNextSpan+s.id]),a=n["default"].create("span",["id",this.prfxBtnPrevSpan+s.id]),r=n["default"].create("span",["id",this.prfxBtnLastSpan+s.id]),o=n["default"].create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,c["default"].add(l,"click",i.next);else{var h=n["default"].create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);h.className=this.btnPageCssClass,c["default"].add(h,"click",i.next),l.appendChild(h)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,c["default"].add(a,"click",i.prev);else{var u=n["default"].create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);u.className=this.btnPageCssClass,c["default"].add(u,"click",i.prev),a.appendChild(u)}if(this.btnLastPageHtml)r.innerHTML=this.btnLastPageHtml,c["default"].add(r,"click",i.last);else{var d=n["default"].create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);d.className=this.btnPageCssClass,c["default"].add(d,"click",i.last),r.appendChild(d)}if(this.btnFirstPageHtml)o.innerHTML=this.btnFirstPageHtml,c["default"].add(o,"click",i.first);else{var p=n["default"].create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);p.className=this.btnPageCssClass,c["default"].add(p,"click",i.first),o.appendChild(p)}}this.pagingTgtId||s.setToolbar();var f=this.pagingTgtId?n["default"].id(this.pagingTgtId):s.mDiv;f.appendChild(o),f.appendChild(a);var g=n["default"].create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(n["default"].text(this.pageText)),g.className=this.nbPgSpanCssClass,f.appendChild(g),f.appendChild(t);var v=n["default"].create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(n["default"].text(this.ofText)),v.className=this.nbPgSpanCssClass,f.appendChild(v);var C=n["default"].create("span",["id",this.prfxPgSpan+s.id]);C.className=this.nbPgSpanCssClass,C.appendChild(n["default"].text(" "+this.nbPages+" ")),f.appendChild(C),f.appendChild(l),f.appendChild(r),this.pagingSlc=n["default"].id(this.prfxSlcPages+s.id),(!s.rememberGridValues||this.isPagingRemoved)&&this.setPagingInfo(),s.fltGrid||(s.validateAllRows(),this.setPagingInfo(s.validRowsIndex)),this.isPagingRemoved=!1}},{key:"addPaging",value:function(){var t=void 0===arguments[0]?!1:arguments[0],e=this.tf;e.hasGrid()&&!e.paging&&(e.paging=!0,this.isPagingRemoved=!0,this.init(),e.resetValues(),t&&e.filter())}},{key:"setPagingInfo",value:function(t){var e=this.tf,s=e.tbl.rows,i=this.pagingTgtId?n["default"].id(this.pagingTgtId):e.mDiv,l=n["default"].id(this.prfxPgSpan+e.id);if(t&&t.length>0)e.validRowsIndex=t;else{e.validRowsIndex=[];for(var a=e.refRow;a0)if(i.style.visibility="visible",this.pageSelectorType===e.fltTypeSlc)for(var h=0;h=this.startPagingRow&&i>l?("true"!==a.getAttribute("validRow")&&a.getAttribute("validRow")||(a.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(a.style.display="none",e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.removeRowBg(e.validRowsIndex[l]))}e.nbVisibleRows=e.validRowsIndex.length,e.isStartBgAlternate=!1,e.applyGridProps()}},{key:"setPage",value:function(t){var e=this.tf;if(e.hasGrid()&&e.paging){var s=this.evt,i=typeof t;if("string"===i)switch(d["default"].lower(t)){case"next":s.next();break;case"previous":s.prev();break;case"last":s.last();break;case"first":s.first();break;default:s.next()}else"number"===i&&this.changePage(t-1)}}},{key:"setResultsPerPage",value:function(){var t=this,e=this.tf,s=this.evt;if((e.hasGrid()||e.isFirstLoad)&&!this.resultsPerPageSlc&&this.resultsPerPage){s.slcResultsChange=function(e){t.changeResultsPerPage(),e.target.blur()};var i=n["default"].create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],r=n["default"].create("span",["id",this.prfxSlcResultsTxt+e.id]);r.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var o=this.resultsPerPageTgtId?n["default"].id(this.resultsPerPageTgtId):e.rDiv;r.appendChild(n["default"].text(l)),o.appendChild(r),o.appendChild(i),this.resultsPerPageSlc=n["default"].id(this.prfxSlcResults+e.id);for(var h=0;h=0&&t<=this.nbPages-1&&(this.onBeforeChangePage&&this.onBeforeChangePage.call(null,this,t),this.currentPageNb=parseInt(t,10)+1,this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.options[t].selected=!0:this.pagingSlc.value=this.currentPageNb,e.rememberPageNb&&e.Cpt.store.savePageNb(e.pgNbCookie),this.startPagingRow=this.pageSelectorType===e.fltTypeSlc?this.pagingSlc.value:t*this.pagingLength,this.groupByPage(),this.onAfterChangePage&&this.onAfterChangePage.call(null,this,t)))}},{key:"_changeResultsPerPage",value:function(){var t=this.tf;if(t.paging){var e=this.resultsPerPageSlc,s=this.pageSelectorType===t.fltTypeSlc?this.pagingSlc.selectedIndex:parseInt(this.pagingSlc.value-1,10);if(this.pagingLength=parseInt(e.options[e.selectedIndex].value,10),this.startPagingRow=this.pagingLength*s,!isNaN(this.pagingLength)){if(this.startPagingRow>=t.nbFilterableRows&&(this.startPagingRow=t.nbFilterableRows-this.pagingLength),this.setPagingInfo(),this.pageSelectorType===t.fltTypeSlc){var i=this.pagingSlc.options.length-1<=s?this.pagingSlc.options.length-1:s;this.pagingSlc.options[i].selected=!0}t.rememberPageLen&&t.Cpt.store.savePageLength(t.pgLenCookie)}}}},{key:"_resetPage",value:function(t){var e=this.tf,s=e.Cpt.store.getPageNb(t);""!==s&&this.changePage(s-1)}},{key:"_resetPageLength",value:function(t){var e=this.tf;if(e.paging){var s=e.Cpt.store.getPageLength(t);""!==s&&(this.resultsPerPageSlc.options[s].selected=!0,this.changeResultsPerPage())}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()){var e,s,i,l,a,r,o;e=n["default"].id(this.prfxBtnNextSpan+t.id),s=n["default"].id(this.prfxBtnPrevSpan+t.id),i=n["default"].id(this.prfxBtnLastSpan+t.id),l=n["default"].id(this.prfxBtnFirstSpan+t.id),a=n["default"].id(this.prfxPgBeforeSpan+t.id),r=n["default"].id(this.prfxPgAfterSpan+t.id),o=n["default"].id(this.prfxPgSpan+t.id);var h=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?c["default"].remove(this.pagingSlc,"change",h.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&c["default"].remove(this.pagingSlc,"keypress",h._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(c["default"].remove(e,"click",h.next),e.parentNode.removeChild(e)),s&&(c["default"].remove(s,"click",h.prev),s.parentNode.removeChild(s)),i&&(c["default"].remove(i,"click",h.last),i.parentNode.removeChild(i)),l&&(c["default"].remove(l,"click",h.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),r&&r.parentNode.removeChild(r),o&&o.parentNode.removeChild(o),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=f},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return a(t,[{key:"onClick",value:function(){this.tf.clearFilters()}},{key:"init",value:function(){var t=this,e=this.tf;if(e.hasGrid()||e.isFirstLoad||!e.btnResetEl){var s=n["default"].create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?n["default"].id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;h["default"].add(l,"click",function(){t.onClick()})}else{var a=n["default"].create("a",["href","javascript:void(0);"]);a.className=e.btnResetCssClass,a.appendChild(n["default"].text(this.btnResetText)),s.appendChild(a),h["default"].add(a,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=n["default"].id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
',this.helpInstrHtml=s.help_instructions_html||null,this.helpInstrBtnText=s.help_instructions_btn_text||"?",this.helpInstrBtnHtml=s.help_instructions_btn_html||null,this.helpInstrBtnCssClass=s.help_instructions_btn_css_class||"helpBtn",this.helpInstrContCssClass=s.help_instructions_container_css_class||"helpCont",this.helpInstrBtnEl=null,this.helpInstrContEl=null,this.helpInstrDefaultHtml='

HTML Table Filter Generator v. '+e.version+'

http://tablefilter.free.fr
©2009-'+e.year+' Max Guglielmi.
',this.prfxHelpSpan="helpSpan_",this.prfxHelpDiv="helpDiv_",this.tf=e}return a(t,[{key:"init",value:function(){var t=this;if(!this.helpInstrBtnEl){var e=this.tf,s=n["default"].create("span",["id",this.prfxHelpSpan+e.id]),i=n["default"].create("div",["id",this.prfxHelpDiv+e.id]);this.helpInstrTgtId||e.setToolbar();var l=this.helpInstrTgtId?n["default"].id(this.helpInstrTgtId):e.rDiv;l.appendChild(s);var a=this.helpInstrContTgtId?n["default"].id(this.helpInstrContTgtId):s;if(this.helpInstrBtnHtml){s.innerHTML=this.helpInstrBtnHtml;var r=s.firstChild;h["default"].add(r,"click",function(){t.toggle()}),a.appendChild(i)}else{a.appendChild(i);var o=n["default"].create("a",["href","javascript:void(0);"]);o.className=this.helpInstrBtnCssClass,o.appendChild(n["default"].text(this.helpInstrBtnText)),s.appendChild(o),h["default"].add(o,"click",function(){t.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&a.appendChild(i),i.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.helpInstrText,i.className=this.helpInstrContCssClass,h["default"].add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.helpInstrDefaultHtml,h["default"].add(i,"click",function(){t.toggle()}),this.helpInstrContEl=i,this.helpInstrBtnEl=s}}},{key:"toggle",value:function(){if(this.helpInstrContEl){var t=this.helpInstrContEl.style.display;if(""===t||"none"===t){this.helpInstrContEl.style.display="block";var e=n["default"].position(this.helpInstrBtnEl).left;this.helpInstrContTgtId||(this.helpInstrContEl.style.left=e-this.helpInstrContEl.clientWidth+25+"px")}else this.helpInstrContEl.style.display="none"}}},{key:"destroy",value:function(){this.helpInstrBtnEl&&(this.helpInstrBtnEl.parentNode.removeChild(this.helpInstrBtnEl),this.helpInstrBtnEl=null,this.helpInstrContEl&&(this.helpInstrContEl.parentNode.removeChild(this.helpInstrContEl),this.helpInstrContEl=null))}}]),t}();e.Help=u},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;sl;l++){var a=t?l:this.tf.validRowsIndex[l];this.setRowBg(a,i),i++}}},{key:"setRowBg",value:function(t,e){if(this.tf.alternateBgs&&!isNaN(t)){var s=this.tf.tbl.rows,i=e?e:t;this.removeRowBg(t),n["default"].addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;n["default"].removeClass(e[t],this.oddCss),n["default"].removeClass(e[t],this.evenCss)}}},{key:"remove",value:function(){if(this.tf.hasGrid()){for(var t=this.tf.refRow;t=jj;jj++)ucolIndex[jj]===colIndex[ii]&&(saved=1);0===saved&&(ucolMax++,ucolIndex[ucolMax]=colIndex[ii])}if("object"==_Str2["default"].lower(typeof labelId)&&"object"==_Str2["default"].lower(typeof colIndex)&&"object"==_Str2["default"].lower(typeof operation))for(var row=this.tf.tbl.rows,colvalues=[],ucol=0;ucolMax>=ucol;ucol++){colvalues.push(this.tf.getColValues(ucolIndex[ucol],!0,excludeRow));for(var result,nbvalues=0,temp,meanValue=0,sumValue=0,minValue=null,maxValue=null,q1Value=null,medValue=null,q3Value=null,meanFlag=0,sumFlag=0,minFlag=0,maxFlag=0,q1Flag=0,medFlag=0,q3Flag=0,theList=[],opsThisCol=[],decThisCol=[],labThisCol=[],oTypeThisCol=[],mThisCol=-1,k=0;kmaxValue?parseFloat(cvalue):maxValue))}if(1===meanFlag&&(meanValue=sumValue/nbvalues),1===medFlag){var aux=0;nbvalues%2===1?(aux=Math.floor(nbvalues/2),medValue=theList[aux]):medValue=(theList[nbvalues/2]+theList[nbvalues/2-1])/2}var posa;if(1===q1Flag&&(posa=0,posa=Math.floor(nbvalues/4),q1Value=4*posa==nbvalues?(theList[posa-1]+theList[posa])/2:theList[posa]),1===q3Flag){posa=0;var posb=0;posa=Math.floor(nbvalues/4),4*posa===nbvalues?(posb=3*posa,q3Value=(theList[posb]+theList[posb-1])/2):q3Value=theList[nbvalues-posa-1]}for(var i=0;mThisCol>=i;i++){switch(opsThisCol[i]){case"mean":result=meanValue;break;case"sum":result=sumValue;break;case"min":result=minValue;break;case"max":result=maxValue;break;case"median":result=medValue;break;case"q1":result=q1Value;break;case"q3":result=q3Value}var precision=isNaN(decThisCol[i])?2:decThisCol[i];if(oTypeThisCol&&result){if(result=result.toFixed(precision),_Dom2["default"].id(labThisCol[i]))switch(_Str2["default"].lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom2["default"].id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom2["default"].id(labThisCol[i]).firstChild,txtnode=_Dom2["default"].text(result);_Dom2["default"].id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom2["default"].id(labThisCol[i]).innerHTML=".":_Dom2["default"].id(labThisCol[i]).innerHTML=result.toFixed(precision)}catch(e){}}var totRow=totRowIndex&&totRowIndex[ucol]?row[totRowIndex[ucol]]:null;totRow&&(totRow.style.display="")}this.onAfterOperation&&this.onAfterOperation.call(null,this.tf)}}}]),ColOps}();exports.ColOps=ColOps},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(4),a=i(l);e["default"]={ignoreCase:function(t,e){var s=a["default"].lower(t),i=a["default"].lower(e);return i>s?-1:s>i?1:0}},t.exports=e["default"]}])}); \ No newline at end of file diff --git a/examples/dev.html b/examples/dev.html index 4ca8ceb2..74d7d2fd 100644 --- a/examples/dev.html +++ b/examples/dev.html @@ -97,14 +97,17 @@ col_2: 'checklist', col_3: 'select', base_path: '../build/tablefilter/', + // fill_slc_on_demand: true, rows_counter: true, // enable_default_theme: true, - help_instructions: true, + // help_instructions: true, mark_active_columns: true, - on_keyup: false, + // auto_filter: false, + auto_filter_delay: 200, loader: true, themes: [{ name: 'skyblue'}], paging: false, + paging_length: 3, alternate_rows: true, highlight_keywords: true, match_case: false, diff --git a/src-es6/extensions/advancedGrid/adapterEzEditTable.js b/src-es6/extensions/advancedGrid/adapterEzEditTable.js index 1cd7da8a..5bd4485b 100644 --- a/src-es6/extensions/advancedGrid/adapterEzEditTable.js +++ b/src-es6/extensions/advancedGrid/adapterEzEditTable.js @@ -15,7 +15,7 @@ export default class AdapterEzEditTable { this.name = 'ezEditTable.js'; this.vendorPath = this.cfg.vendor_path || tf.extensionsPath + 'ezEditTable/'; - this.loadStylesheet = this.cfg.loadStylesheet===true ? true : false; + this.loadStylesheet = Boolean(this.cfg.loadStylesheet); this.stylesheet = this.cfg.stylesheet || this.vendorPath + 'ezEditTable.css'; this.stylesheetName = this.cfg.stylesheetName || 'ezEditTableCss'; @@ -237,8 +237,9 @@ export default class AdapterEzEditTable { //Selected row needs to be visible when paging is activated if(tf.paging){ - tf.Cpt.paging.onAfterChangePage = function(tf){ - var et = tf.ExtRegistry.ezEditTable; + tf.Cpt.paging.onAfterChangePage = function(paging){ + var advGrid = paging.tf.ExtRegistry.advancedGrid; + var et = advGrid._ezEditTable; var slc = et.Selection; var row = slc.GetActiveRow(); if(row){ diff --git a/src-es6/modules/checkList.js b/src-es6/modules/checkList.js index bccedafe..c24fac95 100644 --- a/src-es6/modules/checkList.js +++ b/src-es6/modules/checkList.js @@ -47,7 +47,10 @@ export class CheckList{ // TODO: move event here onChange(evt){ - this.tf.Evt.onSlcChange(evt); + let elm = evt.target; + this.tf.activeFilterId = elm.getAttribute('id'); + this.tf.activeFlt = Dom.id(this.tf.activeFilterId); + this.tf.Evt.onSlcChange.call(this.tf, evt); } optionClick(evt){ diff --git a/src-es6/modules/dropdown.js b/src-es6/modules/dropdown.js index cdcbc2b1..7598ab4e 100644 --- a/src-es6/modules/dropdown.js +++ b/src-es6/modules/dropdown.js @@ -13,7 +13,8 @@ export class Dropdown{ // Configuration object var f = tf.config(); - this.enableSlcResetFilter = f.enable_slc_reset_filter ? false : true; + this.enableSlcResetFilter = f.enable_slc_reset_filter===false ? + false : true; //defines empty option text this.nonEmptyText = f.non_empty_text || '(Non empty)'; //sets select filling method: 'innerHTML' or 'createElement' diff --git a/src-es6/modules/paging.js b/src-es6/modules/paging.js index 4f49dd81..4e472771 100644 --- a/src-es6/modules/paging.js +++ b/src-es6/modules/paging.js @@ -330,7 +330,7 @@ export class Paging{ this.setPagingInfo(); } if(!tf.fltGrid){ - tf.ValidateAllRows(); + tf.validateAllRows(); this.setPagingInfo(tf.validRowsIndex); } diff --git a/src-es6/tablefilter.js b/src-es6/tablefilter.js index e05383cb..ab125d2a 100644 --- a/src-es6/tablefilter.js +++ b/src-es6/tablefilter.js @@ -116,10 +116,6 @@ export class TableFilter{ this['col'+j] = col; } - /*** Developer's additional methods ***/ - this.publicMethods = f.public_methods!==undefined ? - f.public_methods : false; - /*** filters' grid properties ***/ //enables/disables filter grid @@ -127,7 +123,7 @@ export class TableFilter{ /*** Grid layout ***/ //enables/disables grid layout (fixed headers) - this.gridLayout = f.grid_layout ? true : false; + this.gridLayout = Boolean(f.grid_layout); this.sourceTblHtml = null; if(this.gridLayout){ //Firefox does not support outerHTML property... @@ -198,12 +194,10 @@ export class TableFilter{ //enables/disables icons (paging, reset button) this.enableIcons = f.enable_icons===false ? false : true; //enables/disbles rows alternating bg colors - this.alternateBgs = f.alternate_rows===true ? true : false; + this.alternateBgs = Boolean(f.alternate_rows); //defines widths of columns this.hasColWidths = Types.isArray(f.col_widths); this.colWidths = this.hasColWidths ? f.col_widths : null; - //enables/disables fixed headers - this.fixedHeaders = f.fixed_headers===true ? true : false; //tbody height if fixed headers enabled this.tBodyH = !isNaN(f.tbody_height) ? f.tbody_height : 200; //defines css class for filters @@ -226,29 +220,28 @@ export class TableFilter{ this.onAfterFilter = Types.isFn(f.on_after_filter) ? f.on_after_filter : null; //enables/disables case sensitivity - this.caseSensitive = f.case_sensitive===true ? true : false; + this.caseSensitive = Boolean(f.case_sensitive); //enables/disbles exact match for search - this.exactMatch = f.exact_match===true ? true : false; + this.exactMatch = Boolean(f.exact_match); //refreshes drop-down lists upon validation - this.linkedFilters = f.linked_filters===true ? true : false; + this.linkedFilters = Boolean(f.linked_filters); //wheter excluded options are disabled - this.disableExcludedOptions = f.disable_excluded_options===true ? - true : false; + this.disableExcludedOptions = Boolean(f.disable_excluded_options); //stores active filter element this.activeFlt = null; //id of active filter this.activeFilterId = null; //enables/disbles column operation(sum,mean) - this.hasColOperation = f.col_operation ? true : false; + this.hasColOperation = Boolean(f.col_operation); this.colOperation = null; //enables always visible rows - this.hasVisibleRows = f.rows_always_visible ? true : false; + this.hasVisibleRows = Boolean(f.rows_always_visible); //array containing always visible rows this.visibleRows = this.hasVisibleRows ? f.rows_always_visible : []; //defines search type: include or exclude this.searchType = f.search_type || 'include'; //enables/disables external filters generation - this.isExternalFlt = f.external_flt_grid===true ? true : false; + this.isExternalFlt = Boolean(f.external_flt_grid); //array containing ids of external elements containing filters this.externalFltTgtIds = f.external_flt_grid_ids || null; //stores filters elements if isExternalFlt is true @@ -259,7 +252,7 @@ export class TableFilter{ this.onFiltersLoaded = Types.isFn(f.on_filters_loaded) ? f.on_filters_loaded : null; //enables/disables single filter search - this.singleSearchFlt = f.single_search_filter===true ? true : false; + this.singleSearchFlt = Boolean(f.single_search_filter); //calls function after row is validated this.onRowValidated = Types.isFn(f.on_row_validated) ? f.on_row_validated : null; @@ -277,9 +270,9 @@ export class TableFilter{ //enables/disables help div this.helpInstructions = !f.help_instructions ? false : true; //popup filters - this.popUpFilters = f.popup_filters===true ? true : false; + this.popUpFilters = Boolean(f.popup_filters); //active columns color - this.markActiveColumns = f.mark_active_columns===true ? true : false; + this.markActiveColumns = Boolean(f.mark_active_columns); //defines css class for active column header this.activeColumnsCssClass = f.active_columns_css_class || 'activeHeader'; @@ -294,12 +287,11 @@ export class TableFilter{ //defines 1st option text this.displayAllText = f.display_all_text || ''; //enables/disables empty option in combo-box filters - this.enableEmptyOption = f.enable_empty_option===true ? true : false; + this.enableEmptyOption = Boolean(f.enable_empty_option); //defines empty option text this.emptyText = f.empty_text || '(Empty)'; //enables/disables non empty option in combo-box filters - this.enableNonEmptyOption = f.enable_non_empty_option===true ? - true : false; + this.enableNonEmptyOption = Boolean(f.enable_non_empty_option); //defines empty option text this.nonEmptyText = f.non_empty_text || '(Non empty)'; //enables/disables onChange event on combo-box @@ -307,13 +299,13 @@ export class TableFilter{ //enables/disables select options sorting this.sortSlc = f.sort_select===false ? false : true; //enables/disables ascending numeric options sorting - this.isSortNumAsc = f.sort_num_asc===true ? true : false; + this.isSortNumAsc = Boolean(f.sort_num_asc); this.sortNumAsc = this.isSortNumAsc ? f.sort_num_asc : null; //enables/disables descending numeric options sorting - this.isSortNumDesc = f.sort_num_desc===true ? true : false; + this.isSortNumDesc = Boolean(f.sort_num_desc); this.sortNumDesc = this.isSortNumDesc ? f.sort_num_desc : null; //enabled selects are populated on demand - this.fillSlcOnDemand = f.fill_slc_on_demand===true ? true : false; + this.fillSlcOnDemand = Boolean(f.fill_slc_on_demand); this.hasCustomOptions = Types.isObj(f.custom_options); this.customOptions = f.custom_options; @@ -337,26 +329,26 @@ export class TableFilter{ /*** rows counter ***/ //show/hides rows counter - this.rowsCounter = f.rows_counter===true ? true : false; + this.rowsCounter = Boolean(f.rows_counter); /*** status bar ***/ //show/hides status bar - this.statusBar = f.status_bar===true ? true : false; + this.statusBar = Boolean(f.status_bar); /*** loader ***/ //enables/disables loader/spinner indicator - this.loader = f.loader===true ? true : false; + this.loader = Boolean(f.loader); /*** validation - reset buttons/links ***/ //show/hides filter's validation button - this.displayBtn = f.btn===true ? true : false; + this.displayBtn = Boolean(f.btn); //defines validation button text this.btnText = f.btn_text || (!this.enableIcons ? 'Go' : ''); //defines css class for validation button this.btnCssClass = f.btn_css_class || (!this.enableIcons ? 'btnflt' : 'btnflt_icon'); //show/hides reset link - this.btnReset = f.btn_reset===true ? true : false; + this.btnReset = Boolean(f.btn_reset); //defines css class for reset button this.btnResetCssClass = f.btn_reset_css_class || 'reset'; //callback function before filters are cleared @@ -368,13 +360,13 @@ export class TableFilter{ /*** paging ***/ //enables/disables table paging - this.paging = f.paging===true ? true : false; + this.paging = Boolean(f.paging); this.nbVisibleRows = 0; //nb visible rows this.nbHiddenRows = 0; //nb hidden rows /*** webfx sort adapter ***/ //enables/disables default table sorting - this.sort = f.sort===true ? true : false; + this.sort = Boolean(f.sort); //indicates if sort is set (used in tfAdapter.sortabletable.js) this.isSortEnabled = false; this.sortConfig = f.sort_config || {}; @@ -383,8 +375,7 @@ export class TableFilter{ this.sortConfig.sortTypes = Types.isArray(this.sortConfig.sort_types) ? this.sortConfig.sort_types : []; this.sortConfig.sortCol = this.sortConfig.sort_col || null; - this.sortConfig.asyncSort = this.sortConfig.async_sort===true ? - true : false; + this.sortConfig.asyncSort = Boolean(this.sortConfig.async_sort); this.sortConfig.triggerIds = Types.isArray(this.sortConfig.sort_trigger_ids) ? this.sortConfig.sort_trigger_ids : []; @@ -396,17 +387,19 @@ export class TableFilter{ // this.editable = f.editable===true ? true : false; /*** onkeyup event ***/ - //enables/disables onkeyup event, table is filtered when user stops + //enables/disables auto filtering, table is filtered when user stops //typing - this.onKeyUp = f.on_keyup===true ? true : false; + this.autoFilter = Boolean(f.auto_filter); //onkeyup delay timer (msecs) - this.onKeyUpDelay = !isNaN(f.on_keyup_delay) ? f.on_keyup_delay : 900; - this.isUserTyping = null; //typing indicator - this.onKeyUpTimer = undefined; + this.autoFilterDelay = !isNaN(f.auto_filter_delay) ? + f.auto_filter_delay : 900; + //typing indicator + this.isUserTyping = null; + this.autoFilterTimer = null; /*** keyword highlighting ***/ //enables/disables keyword highlighting - this.highlightKeywords = f.highlight_keywords===true ? true : false; + this.highlightKeywords = Boolean(f.highlight_keywords); /*** data types ***/ //defines default date type (european DMY) @@ -418,15 +411,14 @@ export class TableFilter{ //US & javascript = '.' EU = ',' this.decimalSeparator = f.decimal_separator || '.'; //enables number format per column - this.hasColNbFormat = f.col_number_format===true ? true : false; + this.hasColNbFormat = Boolean(f.col_number_format); //array containing columns nb formats this.colNbFormat = Types.isArray(this.hasColNbFormat) ? f.col_number_format : null; //enables date type per column - this.hasColDateType = f.col_date_type===true ? true : false; + this.hasColDateType = Types.isArray(f.col_date_type); //array containing columns date type - this.colDateType = Types.isArray(this.hasColDateType) ? - f.col_date_type : null; + this.colDateType = this.hasColDateType ? f.col_date_type : null; /*** status messages ***/ //filtering @@ -484,18 +476,15 @@ export class TableFilter{ /*** cookies ***/ this.hasStoredValues = false; //remembers filters values on page load - this.rememberGridValues = f.remember_grid_values===true ? - true : false; + this.rememberGridValues = Boolean(f.remember_grid_values); //cookie storing filter values this.fltsValuesCookie = this.prfxCookieFltsValues + this.id; //remembers page nb on page load - this.rememberPageNb = this.paging && f.remember_page_number ? - true : false; + this.rememberPageNb = this.paging && f.remember_page_number; //cookie storing page nb this.pgNbCookie = this.prfxCookiePageNb + this.id; //remembers page length on page load - this.rememberPageLen = this.paging && f.remember_page_length ? - true : false; + this.rememberPageLen = this.paging && f.remember_page_length; //cookie storing page length this.pgLenCookie = this.prfxCookiePageLen + this.id; @@ -505,10 +494,9 @@ export class TableFilter{ this.hasExtensions = Types.isArray(this.extensions); /*** themes ***/ - this.enableDefaultTheme = f.enable_default_theme===true ? - true : false; + this.enableDefaultTheme = Boolean(f.enable_default_theme); //imports themes - this.hasThemes = (f.enable_default_theme || Types.isArray(f.themes)); + this.hasThemes = (this.enableDefaultTheme || Types.isArray(f.themes)); this.themes = f.themes || []; //themes path this.themesPath = f.themes_path || this.basePath + 'themes/'; @@ -537,7 +525,7 @@ export class TableFilter{ }; /*** TF events ***/ - let o = this; + // let o = this; this.Evt = { name: { filter: 'Filter', @@ -558,65 +546,66 @@ export class TableFilter{ - Detects key for a given element =====================================================*/ detectKey(e) { - if(!o.enterKey){ return; } + if(!this.enterKey){ return; } let _ev = e || global.event; if(_ev){ let key = Event.keyCode(_ev); if(key===13){ - o._filter(); + this.filter(); Event.cancel(_ev); Event.stop(_ev); } else { - o.isUserTyping = true; - global.clearInterval(o.onKeyUpTimer); - o.onKeyUpTimer = undefined; + this.isUserTyping = true; + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; } } }, /*==================================================== - - onkeyup event for text filters + - auto filter for text filters =====================================================*/ onKeyUp(e) { - if(!o.onKeyUp){ + if(!this.autoFilter){ return; } let _ev = e || global.event; let key = Event.keyCode(_ev); - o.isUserTyping = false; + this.isUserTyping = false; function filter() { - global.clearInterval(o.onKeyUpTimer); - o.onKeyUpTimer = undefined; - if(!o.isUserTyping){ - o.filter(); - o.isUserTyping = null; + /*jshint validthis:true */ + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; + if(!this.isUserTyping){ + this.filter(); + this.isUserTyping = null; } } if(key!==13 && key!==9 && key!==27 && key!==38 && key!==40) { - if(o.onKeyUpTimer===undefined){ - o.onKeyUpTimer = global.setInterval( - filter, o.onKeyUpDelay); + if(this.autoFilterTimer === null){ + this.autoFilterTimer = global.setInterval( + filter.bind(this), this.autoFilterDelay); } } else { - global.clearInterval(o.onKeyUpTimer); - o.onKeyUpTimer = undefined; + global.clearInterval(this.autoFilterTimer); + this.autoFilterTimer = null; } }, /*==================================================== - onkeydown event for input filters =====================================================*/ onKeyDown() { - if(!o.onKeyUp) { return; } - o.isUserTyping = true; + if(!this.autoFilter) { return; } + this.isUserTyping = true; }, /*==================================================== - onblur event for input filters =====================================================*/ onInpBlur() { - if(o.onKeyUp){ - o.isUserTyping = false; - global.clearInterval(o.onKeyUpTimer); + if(this.autoFilter){ + this.isUserTyping = false; + global.clearInterval(this.autoFilterTimer); } // if(o.ezEditTable){ // if(o.editable){ @@ -632,9 +621,10 @@ export class TableFilter{ =====================================================*/ onInpFocus(e) { let _ev = e || global.event; - o.activeFilterId = this.getAttribute('id'); - o.activeFlt = Dom.id(o.activeFilterId); - if(o.popUpFilters){ + let elm = Event.target(_ev); + this.activeFilterId = elm.getAttribute('id'); + this.activeFlt = Dom.id(this.activeFilterId); + if(this.popUpFilters){ Event.cancel(_ev); Event.stop(_ev); } @@ -652,14 +642,15 @@ export class TableFilter{ =====================================================*/ onSlcFocus(e) { let _ev = e || global.event; - o.activeFilterId = this.getAttribute('id'); - o.activeFlt = Dom.id(o.activeFilterId); + let elm = Event.target(_ev); + this.activeFilterId = elm.getAttribute('id'); + this.activeFlt = Dom.id(this.activeFilterId); // select is populated when element has focus - if(o.fillSlcOnDemand && this.getAttribute('filled') === '0'){ - let ct = this.getAttribute('ct'); - o.Cpt.dropdown._build(ct); + if(this.fillSlcOnDemand && elm.getAttribute('filled') === '0'){ + let ct = elm.getAttribute('ct'); + this.Cpt.dropdown._build(ct); } - if(o.popUpFilters){ + if(this.popUpFilters){ Event.cancel(_ev); Event.stop(_ev); } @@ -667,64 +658,37 @@ export class TableFilter{ /*==================================================== - onchange event for select filters =====================================================*/ - onSlcChange(e) { - if(!o.activeFlt){ return; } + onSlcChange(e) {console.log('onSlcChange',this.activeFlt); + if(!this.activeFlt){ return; } // let colIndex = o.activeFlt.getAttribute('colIndex'); //Checks filter is a checklist and caller is not null // if(o.activeFlt && colIndex && // o['col'+colIndex]===o.fltTypeCheckList && // !o.Evt.onSlcChange.caller){ return; } let _ev = e || global.event; - if(o.popUpFilters){ Event.stop(_ev); } - if(o.onSlcChange){ o.filter(); } + if(this.popUpFilters){ Event.stop(_ev); } + if(this.onSlcChange){ this.filter(); } }, - /*==================================================== - - onblur event for select filters - =====================================================*/ - // _OnSlcBlur: function(e) {}, /*==================================================== - onclick event for checklist filters =====================================================*/ - onCheckListClick() { - if(o.fillSlcOnDemand && this.getAttribute('filled') === '0'){ - let ct = this.getAttribute('ct'); - o.Cpt.checkList._build(ct); - o.Cpt.checkList.checkListDiv[ct].onclick = null; - o.Cpt.checkList.checkListDiv[ct].title = ''; + onCheckListClick(e) { + let _ev = e || global.event; + let elm = Event.target(_ev); + if(this.fillSlcOnDemand && elm.getAttribute('filled') === '0'){ + let ct = elm.getAttribute('ct'); + this.Cpt.checkList._build(ct); + this.Cpt.checkList.checkListDiv[ct].onclick = null; + this.Cpt.checkList.checkListDiv[ct].title = ''; } }, - /*==================================================== - - onclick event for checklist filter container - =====================================================*/ - onCheckListFocus() { - o.activeFilterId = this.firstChild.getAttribute('id'); - o.activeFlt = Dom.id(o.activeFilterId); - }, /*==================================================== - onclick event for validation button (btn property) =====================================================*/ onBtnClick() { - o.filter(); + this.filter(); } - // , - // _OnSlcPagesChangeEvt: null, //used by sort adapter - /*==================================================== - - onclick event slc parent node (enables filters) - IE only - =====================================================*/ - // _EnableSlc: function() { - // this.firstChild.disabled = false; - // this.firstChild.focus(); - // this.onclick = null; - // }, - - // _Paging: { //used by sort adapter - // nextEvt: null, - // prevEvt: null, - // lastEvt: null, - // firstEvt: null - // } }; } @@ -906,9 +870,11 @@ export class TableFilter{ dropdown._build(i); } - Event.add(slc, 'keypress', this.Evt.detectKey); - Event.add(slc, 'change', this.Evt.onSlcChange); - Event.add(slc, 'focus', this.Evt.onSlcFocus); + Event.add(slc, 'keypress', + this.Evt.detectKey.bind(this)); + Event.add(slc, 'change', + this.Evt.onSlcChange.bind(this)); + Event.add(slc, 'focus', this.Evt.onSlcFocus.bind(this)); // Event.add(slc, 'blur', this.Evt._OnSlcBlur); //1st option is created here since dropdown.build isn't @@ -946,13 +912,11 @@ export class TableFilter{ } if(this.fillSlcOnDemand){ - Event.add( - divCont, 'click', this.Evt.onCheckListClick); + Event.add(divCont, 'click', + this.Evt.onCheckListClick.bind(this)); divCont.appendChild( Dom.text(checkList.activateCheckListTxt)); } - - Event.add(divCont, 'click', this.Evt.onCheckListFocus); } else{ @@ -969,7 +933,7 @@ export class TableFilter{ ); } inp.className = inpclass; - inp.onfocus = this.Evt.onInpFocus; + Event.add(inp, 'focus', this.Evt.onInpFocus.bind(this)); //filter is appended in desired element if(externalFltTgtId){ @@ -981,10 +945,12 @@ export class TableFilter{ this.fltIds.push(this.prfxFlt+i+'_'+this.id); - Event.add(inp, 'keypress', this.Evt.detectKey); - Event.add(inp, 'keydown', this.Evt.onKeyDown); - Event.add(inp, 'keyup', this.Evt.onKeyUp); - Event.add(inp, 'blur', this.Evt.onInpBlur); + Event.add(inp, 'keypress', + this.Evt.detectKey.bind(this)); + Event.add(inp, 'keydown', + this.Evt.onKeyDown.bind(this)); + Event.add(inp, 'keyup', this.Evt.onKeyUp.bind(this)); + Event.add(inp, 'blur', this.Evt.onInpBlur.bind(this)); if(this.rememberGridValues){ let flts_values = this.Cpt.store.getFilterValues( @@ -1008,7 +974,8 @@ export class TableFilter{ fltcell.appendChild(btn); } - btn.onclick = this.Evt.onBtnClick; + // btn.onclick = this.Evt.onBtnClick; + Event.add(btn, 'click', this.Evt.onBtnClick.bind(this)); }//if }// for i diff --git a/test/libs/polyfill.js b/test/libs/polyfill.js new file mode 100644 index 00000000..57014892 --- /dev/null +++ b/test/libs/polyfill.js @@ -0,0 +1,10 @@ + +// PhantomJS doesn't support bind yet +// https://github.com/ariya/phantomjs/issues/10522 + +Function.prototype.bind = Function.prototype.bind || function (thisp) { + var fn = this; + return function () { + return fn.apply(thisp, arguments); + }; +}; diff --git a/test/test-active-columns.html b/test/test-active-columns.html index 3736f91f..45ed3da0 100644 --- a/test/test-active-columns.html +++ b/test/test-active-columns.html @@ -5,6 +5,7 @@ TableFilter active columns tests + diff --git a/test/test-alternate-rows.html b/test/test-alternate-rows.html index 84598168..612fdde0 100644 --- a/test/test-alternate-rows.html +++ b/test/test-alternate-rows.html @@ -5,6 +5,7 @@ TableFilter alternate rows tests +
diff --git a/test/test-always-visible-rows.html b/test/test-always-visible-rows.html index 66389fec..770dde77 100644 --- a/test/test-always-visible-rows.html +++ b/test/test-always-visible-rows.html @@ -5,6 +5,7 @@ TableFilter always visible rows tests +
diff --git a/test/test-case-sensitive-query.html b/test/test-case-sensitive-query.html index 8827eabc..34850174 100644 --- a/test/test-case-sensitive-query.html +++ b/test/test-case-sensitive-query.html @@ -5,6 +5,7 @@ TableFilter case sensitive query tests +
diff --git a/test/test-checklist.html b/test/test-checklist.html index f6a9a54c..9d7c35ff 100644 --- a/test/test-checklist.html +++ b/test/test-checklist.html @@ -5,6 +5,7 @@ TableFilter checklist +
diff --git a/test/test-clear-button.html b/test/test-clear-button.html index 2bbe6737..29a6b8a2 100644 --- a/test/test-clear-button.html +++ b/test/test-clear-button.html @@ -5,6 +5,7 @@ TableFilter clear button +
diff --git a/test/test-col-ops.html b/test/test-col-ops.html index bcb6b89b..efbc2cd9 100644 --- a/test/test-col-ops.html +++ b/test/test-col-ops.html @@ -5,6 +5,7 @@ TableFilter column operations tests +
diff --git a/test/test-col-widths.html b/test/test-col-widths.html index 7fe7bda9..30d2af0a 100644 --- a/test/test-col-widths.html +++ b/test/test-col-widths.html @@ -5,6 +5,7 @@ TableFilter column widths tests +
diff --git a/test/test-config.js b/test/test-config.js deleted file mode 100644 index 66a18ae2..00000000 --- a/test/test-config.js +++ /dev/null @@ -1,13 +0,0 @@ -(function () { - - // Configure RequireJS so it resolves relative module paths from the `src` - // folder. - require.config({ - baseUrl: '../src', - paths: { - extensions: '../src/extensions'/*, - sortabletable: 'extensions/sortabletable/'*/ - } - }); - -}()); \ No newline at end of file diff --git a/test/test-custom-options.html b/test/test-custom-options.html index 233d6cb6..3b84ffa3 100644 --- a/test/test-custom-options.html +++ b/test/test-custom-options.html @@ -5,6 +5,7 @@ TableFilter filter with custom options tests +
diff --git a/test/test-disable-enter-key.html b/test/test-disable-enter-key.html index 960de5d6..af623de8 100644 --- a/test/test-disable-enter-key.html +++ b/test/test-disable-enter-key.html @@ -5,6 +5,7 @@ TableFilter disable enter key tests +
diff --git a/test/test-dropdown.html b/test/test-dropdown.html index d156020e..ab7dea8f 100644 --- a/test/test-dropdown.html +++ b/test/test-dropdown.html @@ -5,6 +5,7 @@ TableFilter drop-down filter +
diff --git a/test/test-exact-query-match.html b/test/test-exact-query-match.html index fa432111..c4bc4f88 100644 --- a/test/test-exact-query-match.html +++ b/test/test-exact-query-match.html @@ -5,6 +5,7 @@ TableFilter enable exact query match tests +
diff --git a/test/test-grid-layout.html b/test/test-grid-layout.html index 5c980dce..8e35da86 100644 --- a/test/test-grid-layout.html +++ b/test/test-grid-layout.html @@ -5,6 +5,7 @@ TableFilter grid layout + diff --git a/test/test-help.html b/test/test-help.html index 18bd71d2..2334ca2c 100644 --- a/test/test-help.html +++ b/test/test-help.html @@ -5,6 +5,7 @@ TableFilter help pop-up +
diff --git a/test/test-highlight-keywords.html b/test/test-highlight-keywords.html index fffaafdb..113faed0 100644 --- a/test/test-highlight-keywords.html +++ b/test/test-highlight-keywords.html @@ -5,6 +5,7 @@ TableFilter basic test +
diff --git a/test/test-loader.html b/test/test-loader.html index d95c3608..d15530fd 100644 --- a/test/test-loader.html +++ b/test/test-loader.html @@ -5,6 +5,7 @@ TableFilter basic test +
diff --git a/test/test-no-filters.html b/test/test-no-filters.html new file mode 100644 index 00000000..6bddc222 --- /dev/null +++ b/test/test-no-filters.html @@ -0,0 +1,80 @@ + + + + + TableFilter no filters tests + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
AdelaideBrisbane20452.1540
+ + + + +
+
+ + diff --git a/test/test-no-filters.js b/test/test-no-filters.js new file mode 100644 index 00000000..6958b10e --- /dev/null +++ b/test/test-no-filters.js @@ -0,0 +1,44 @@ +(function(win, TableFilter){ + + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + grid: false + }); + tf.init(); + + module('Sanity checks'); + test('No filters', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter instanciated'); + deepEqual(tf.getFilterElement(0), null, + 'No filter element for column 0'); + }); + + test('Paging with no filters', function() { + tf.destroy(); + tf = null; + tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + grid: false, + paging: true, + paging_length: 3 + }); + tf.init(); + deepEqual(tf.getFilterElement(4), null, + 'No filter element for column 4'); + }); + + test('Grid layout with no filters', function() { + tf.destroy(); + tf = null; + tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + grid_enable_default_filters: false, + col_width: ['100px','100px','100px','100px','100px'], + grid_layout: true + }); + tf.init(); + deepEqual(tf.getFilterElement(2), null, + 'No filter element for column 2'); + }); + +})(window, TableFilter); diff --git a/test/test-paging.html b/test/test-paging.html index ceda6795..ccd95db0 100644 --- a/test/test-paging.html +++ b/test/test-paging.html @@ -5,6 +5,7 @@ TableFilter paging + diff --git a/test/test-popup-filter.html b/test/test-popup-filter.html index 9776a26d..24f4e65e 100644 --- a/test/test-popup-filter.html +++ b/test/test-popup-filter.html @@ -5,6 +5,7 @@ TableFilter pop-up filter +
diff --git a/test/test-rows-counter.html b/test/test-rows-counter.html index 5f19f128..6eb48970 100644 --- a/test/test-rows-counter.html +++ b/test/test-rows-counter.html @@ -5,6 +5,7 @@ TableFilter alternate rows tests +
diff --git a/test/test-sort-custom-sorter.html b/test/test-sort-custom-sorter.html index 717e40b5..d83c36bf 100644 --- a/test/test-sort-custom-sorter.html +++ b/test/test-sort-custom-sorter.html @@ -5,6 +5,7 @@ TableFilter sort - custom sorter +
diff --git a/test/test-sort-grid-layout.html b/test/test-sort-grid-layout.html index 1cc3a2a3..ecf2b237 100644 --- a/test/test-sort-grid-layout.html +++ b/test/test-sort-grid-layout.html @@ -5,6 +5,7 @@ TableFilter column sort with grid layout mode +
diff --git a/test/test-sort-key.html b/test/test-sort-key.html index 46f4a0f0..3998752e 100644 --- a/test/test-sort-key.html +++ b/test/test-sort-key.html @@ -5,6 +5,7 @@ TableFilter sort by key +
diff --git a/test/test-sort.html b/test/test-sort.html index 8db00a38..1eb24244 100644 --- a/test/test-sort.html +++ b/test/test-sort.html @@ -5,6 +5,7 @@ TableFilter column sort +
diff --git a/test/test-status-bar.html b/test/test-status-bar.html index ec4cd616..736b2941 100644 --- a/test/test-status-bar.html +++ b/test/test-status-bar.html @@ -5,6 +5,7 @@ TableFilter status bar +
diff --git a/test/test-store.html b/test/test-store.html index 9a8dcdca..024fbbb4 100644 --- a/test/test-store.html +++ b/test/test-store.html @@ -5,6 +5,7 @@ TableFilter store +
diff --git a/test/test.html b/test/test.html index b45f9b51..f484f50e 100644 --- a/test/test.html +++ b/test/test.html @@ -5,6 +5,7 @@ TableFilter basic test +