diff --git a/dist/tablefilter/1.js b/dist/tablefilter/1.js index 5f6b8d24..f78c5954 100644 --- a/dist/tablefilter/1.js +++ b/dist/tablefilter/1.js @@ -1,3 +1,3 @@ -webpackJsonp([1],[,function(t,e,s){function i(t){return s(r(t))}function r(t){return n[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var n={"./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(n)},i.resolve=r,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=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 r=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 o=0,h=0;if(a){var d=function(t,s,i){var r=t.Selection,n=function(i){if("row"===t.defaultSelection)r.SelectRowByIndex(i);else{t.ClearSelections();var n=s.cellIndex,l=e.tbl.rows[i];"both"===t.defaultSelection&&r.SelectRowByIndex(i),l&&r.SelectCell(l.cells[n])}if(e.validRowsIndex.length!==e.getRowsNb()){var a=e.tbl.rows[i];a&&a.scrollIntoView(!1),u&&(u.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===u.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:u.scrollIntoView(!1))}};if(e.validRowsIndex){var a,d=e.validRowsIndex,c=d.length,p="row"!==t.defaultSelection?s.parentNode:s,u="TD"===s.nodeName?s:null,f=void 0!==i?t.Event.GetKey(i):0,g=l.Arr.has(d,p.rowIndex),v=34===f||33===f?e.Cpt.paging.pagingLength||t.nbRowsPerPage:1;if(g)34!==f&&33!==f?(o=l.Arr.indexByValue(d,p.rowIndex),h=p.rowIndex):(a=34===f?c-1>=o+v?d[o+v]:[c-1]:o-v<=d[0]?d[0]:d[o-v],h=a,o=l.Arr.indexByValue(d,a),n(a));else{if(p.rowIndex>h)if(p.rowIndex>=d[c-1])a=d[c-1];else{var m=o+v;a=m>c-1?d[c-1]:d[m]}else if(p.rowIndex<=d[0])a=d[0];else{var b=d[o-v];a=b?b:d[0]}h=p.rowIndex,n(a)}}},c=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.Cpt.paging.nbPages>1){var r=e.Cpt.paging;t.nbRowsPerPage=r.pagingLength;var n=e.validRowsIndex,l=n.length,a=parseInt(r.startPagingRow,10)+parseInt(r.pagingLength,10),o=i.rowIndex;o===n[l-1]&&r.currentPageNb!==r.nbPages?r.setPage("last"):o==n[0]&&1!==r.currentPageNb?r.setPage("first"):o>n[a-1]&&on[0]&&r.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 r=s.GetActiveCell();r&&r.scrollIntoView(!1)}),"row"===s.default_selection){var p=s.on_before_selected_row;s.on_before_selected_row=function(){c(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])};var u=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),u&&u.call(null,arguments[0],arguments[1],arguments[2])}}else{var f=s.on_before_selected_cell;s.on_before_selected_cell=function(){c(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(r){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 m=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(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(b){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"]=a,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 r=s(25),n=i(r);e["default"]=n["default"],t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var s=0;s0,this.onLoaded=l.Types.isFn(r.on_loaded)?r.on_loaded:null,this.onBeforeOpen=l.Types.isFn(r.on_before_open)?r.on_before_open:null,this.onAfterOpen=l.Types.isFn(r.on_after_open)?r.on_after_open:null,this.onBeforeClose=l.Types.isFn(r.on_before_close)?r.on_before_close:null,this.onAfterClose=l.Types.isFn(r.on_after_close)?r.on_after_close:null,this.onBeforeColHidden=l.Types.isFn(r.on_before_col_hidden)?r.on_before_col_hidden:null,this.onAfterColHidden=l.Types.isFn(r.on_after_col_hidden)?r.on_after_col_hidden:null,this.onBeforeColDisplayed=l.Types.isFn(r.on_before_col_displayed)?r.on_before_col_displayed:null,this.onAfterColDisplayed=l.Types.isFn(r.on_after_col_displayed)?r.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.Cpt.gridLayout.headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](r.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return r(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,r=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),r&&"inline"===t&&r.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?n.Dom.addClass(e,this.listSlcItemCssClass):n.Dom.removeClass(e,this.listSlcItemCssClass);var r=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(r=!0),this.setHidden(i,r)}}},{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=n.Dom.create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?n.Dom.id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var r=i.firstChild;r.parentNode.insertBefore(s,r)}if(this.btnHtml){s.innerHTML=this.btnHtml;var l=s.firstChild;this.enableHover?a.Event.add(l,"mouseover",function(e){t.toggle(e)}):a.Event.add(l,"click",function(e){t.toggle(e)})}else{var o=n.Dom.create("a",["href","javascript:;"]);o.className=this.btnCssClass,o.title=this.extDesc,o.innerHTML=this.btnText,s.appendChild(o),this.enableHover?a.Event.add(o,"mouseover",function(e){t.toggle(e)}):a.Event.add(o,"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?n.Dom.id(this.contElTgtId):n.Dom.create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=n.Dom.create("p");i.innerHTML=this.text,s.appendChild(i);var r=n.Dom.create("ul",["id","ul"+this.extName+"_"+e.id]);r.className=this.listCssClass;var l=this.headersTbl?this.headersTbl:e.tbl,o=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),h=l.rows[o];if(this.enableTickAll){var d=n.Dom.createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);n.Dom.addClass(d,this.listItemCssClass),r.appendChild(d),d.check.checked=!this.tickToHide,a.Event.add(d.check,"click",function(){for(var t=0;ti.length;)i="0"+i;e[s]=i}return e.join(".")}function c(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=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 r=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var n,l,a=r.length,o=0;a>o;o++)l=r[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(l.style.cursor="pointer",n=g.Dom.create("img",["src",t.sortImgPath+t.sortImgBlank]),l.appendChild(n),null!==i.sortTypes[o]&&l.setAttribute("_sortType",i.sortTypes[o]),m.Event.add(l,"click",i._headerOnclick)):(l.setAttribute("_sortType",s[o]),l._sortType="None");i.updateHeaderArrows()}},SortableTable.prototype.updateHeaderArrows=function(){var s,i,r,n=this;if(e.sortConfig.asyncSort&&null!==e.sortConfig.triggerIds){var l=e.sortConfig.triggerIds;s=[],i=l.length;for(var a=0;ao;o++){var h=s[o].getAttribute("_sortType");null!==h&&"None"!==h&&(r=s[o].lastChild||s[o],"img"!==r.nodeName.toLowerCase()&&(r=g.Dom.create("img",["src",t.sortImgPath+t.sortImgBlank]),s[o].appendChild(r)),o===n.sortColumn?r.className=t.sortImgClassName+" "+(this.descending?t.sortImgDescClassName:t.sortImgAscClassName):r.className=t.sortImgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,r=i._sortTypeInfo[e];if(r&&r.getRowValue)return r.getRowValue(t,s);var n=t.cells[s],l=SortableTable.getInnerText(n);return i.getValueFromString(l,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.sortCustomKey)?e.getAttribute(t.sortCustomKey):g.Dom.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,n=s.sortTypes,p=[],u=0;u 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'; +webpackJsonp([1],[,function(t,e,s){function i(t){return s(r(t))}function r(t){return n[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var n={"./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(n)},i.resolve=r,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=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 r=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 o=0,h=0;if(a){var d=function(t,s,i){var r=t.Selection,n=function(i){if("row"===t.defaultSelection)r.SelectRowByIndex(i);else{t.ClearSelections();var n=s.cellIndex,l=e.tbl.rows[i];"both"===t.defaultSelection&&r.SelectRowByIndex(i),l&&r.SelectCell(l.cells[n])}if(e.validRowsIndex.length!==e.getRowsNb()){var a=e.tbl.rows[i];a&&a.scrollIntoView(!1),u&&(u.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===u.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:u.scrollIntoView(!1))}};if(e.validRowsIndex){var a,d=e.validRowsIndex,c=d.length,p="row"!==t.defaultSelection?s.parentNode:s,u="TD"===s.nodeName?s:null,f=void 0!==i?t.Event.GetKey(i):0,g=l.Arr.has(d,p.rowIndex),v=34===f||33===f?e.Cpt.paging.pagingLength||t.nbRowsPerPage:1;if(g)34!==f&&33!==f?(o=l.Arr.indexByValue(d,p.rowIndex),h=p.rowIndex):(a=34===f?c-1>=o+v?d[o+v]:[c-1]:o-v<=d[0]?d[0]:d[o-v],h=a,o=l.Arr.indexByValue(d,a),n(a));else{if(p.rowIndex>h)if(p.rowIndex>=d[c-1])a=d[c-1];else{var m=o+v;a=m>c-1?d[c-1]:d[m]}else if(p.rowIndex<=d[0])a=d[0];else{var b=d[o-v];a=b?b:d[0]}h=p.rowIndex,n(a)}}},c=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.Cpt.paging.nbPages>1){var r=e.Cpt.paging;t.nbRowsPerPage=r.pagingLength;var n=e.validRowsIndex,l=n.length,a=parseInt(r.startPagingRow,10)+parseInt(r.pagingLength,10),o=i.rowIndex;o===n[l-1]&&r.currentPageNb!==r.nbPages?r.setPage("last"):o==n[0]&&1!==r.currentPageNb?r.setPage("first"):o>n[a-1]&&on[0]&&r.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 r=s.GetActiveCell();r&&r.scrollIntoView(!1)}),"row"===s.default_selection){var p=s.on_before_selected_row;s.on_before_selected_row=function(){c(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])};var u=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),u&&u.call(null,arguments[0],arguments[1],arguments[2])}}else{var f=s.on_before_selected_cell;s.on_before_selected_cell=function(){c(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(r){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 m=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(),m&&m.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(b){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"]=a,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 r=s(25),n=i(r);e["default"]=n["default"],t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},r=function(){function t(t,e){for(var s=0;s0,this.onLoaded=l.Types.isFn(r.on_loaded)?r.on_loaded:null,this.onBeforeOpen=l.Types.isFn(r.on_before_open)?r.on_before_open:null,this.onAfterOpen=l.Types.isFn(r.on_after_open)?r.on_after_open:null,this.onBeforeClose=l.Types.isFn(r.on_before_close)?r.on_before_close:null,this.onAfterClose=l.Types.isFn(r.on_after_close)?r.on_after_close:null,this.onBeforeColHidden=l.Types.isFn(r.on_before_col_hidden)?r.on_before_col_hidden:null,this.onAfterColHidden=l.Types.isFn(r.on_after_col_hidden)?r.on_after_col_hidden:null,this.onBeforeColDisplayed=l.Types.isFn(r.on_before_col_displayed)?r.on_before_col_displayed:null,this.onAfterColDisplayed=l.Types.isFn(r.on_after_col_displayed)?r.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.Cpt.gridLayout.headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](r.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return r(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,r=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),r&&"inline"===t&&r.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?n.Dom.addClass(e,this.listSlcItemCssClass):n.Dom.removeClass(e,this.listSlcItemCssClass);var r=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(r=!0),this.setHidden(i,r)}}},{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=n.Dom.create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?n.Dom.id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var r=i.firstChild;r.parentNode.insertBefore(s,r)}if(this.btnHtml){s.innerHTML=this.btnHtml;var l=s.firstChild;this.enableHover?a.Event.add(l,"mouseover",function(e){t.toggle(e)}):a.Event.add(l,"click",function(e){t.toggle(e)})}else{var o=n.Dom.create("a",["href","javascript:;"]);o.className=this.btnCssClass,o.title=this.extDesc,o.innerHTML=this.btnText,s.appendChild(o),this.enableHover?a.Event.add(o,"mouseover",function(e){t.toggle(e)}):a.Event.add(o,"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?n.Dom.id(this.contElTgtId):n.Dom.create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=n.Dom.create("p");i.innerHTML=this.text,s.appendChild(i);var r=n.Dom.create("ul",["id","ul"+this.extName+"_"+e.id]);r.className=this.listCssClass;var l=this.headersTbl?this.headersTbl:e.tbl,o=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),h=l.rows[o];if(this.enableTickAll){var d=n.Dom.createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);n.Dom.addClass(d,this.listItemCssClass),r.appendChild(d),d.check.checked=!this.tickToHide,a.Event.add(d.check,"click",function(){for(var t=0;ti.length;)i="0"+i;e[s]=i}return e.join(".")}function c(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var p=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},u=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 r=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var n,l,a=r.length,o=0;a>o;o++)l=r[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(l.style.cursor="pointer",n=g.Dom.create("img",["src",t.sortImgPath+t.sortImgBlank]),l.appendChild(n),null!==i.sortTypes[o]&&l.setAttribute("_sortType",i.sortTypes[o]),m.Event.add(l,"click",i._headerOnclick)):(l.setAttribute("_sortType",s[o]),l._sortType="None");i.updateHeaderArrows()}},SortableTable.prototype.updateHeaderArrows=function(){var s,i,r,n=this;if(e.sortConfig.asyncSort&&null!==e.sortConfig.triggerIds){var l=e.sortConfig.triggerIds;s=[],i=l.length;for(var a=0;ao;o++){var h=s[o].getAttribute("_sortType");null!==h&&"None"!==h&&(r=s[o].lastChild||s[o],"img"!==r.nodeName.toLowerCase()&&(r=g.Dom.create("img",["src",t.sortImgPath+t.sortImgBlank]),s[o].appendChild(r)),o===n.sortColumn?r.className=t.sortImgClassName+" "+(this.descending?t.sortImgDescClassName:t.sortImgAscClassName):r.className=t.sortImgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,r=i._sortTypeInfo[e];if(r&&r.getRowValue)return r.getRowValue(t,s);var n=t.cells[s],l=SortableTable.getInnerText(n);return i.getValueFromString(l,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.sortCustomKey)?e.getAttribute(t.sortCustomKey):g.Dom.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,n=s.sortTypes,p=[],u=0;u 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'; -},function(t,e,s){t.exports=function(t){"function"==typeof execScript?execScript(t):eval.call(null,t)}}]); \ No newline at end of file +}]); \ No newline at end of file diff --git a/dist/tablefilter/tablefilter.js b/dist/tablefilter/tablefilter.js index 42af7351..7c1545fd 100644 --- a/dist/tablefilter/tablefilter.js +++ b/dist/tablefilter/tablefilter.js @@ -1,6 +1,4 @@ -!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,r){for(var a,n,o=0,h=[];o1)for(var s=0;s1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==h.filters_cell_tag||"td"!==h.filters_cell_tag?"td":h.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=h.inf_div_css_class||"inf",this.lDivCssClass=h.left_div_css_class||"ldiv",this.rDivCssClass=h.right_div_css_class||"rdiv",this.mDivCssClass=h.middle_div_css_class||"mdiv",this.contDivCssClass=h.content_div_css_class||"cont",this.stylesheet=h.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=h.flts_row_css_class||"fltrow",this.enableIcons=h.enable_icons===!1?!1:!0,this.alternateBgs=h.alternate_rows===!0?!0:!1,this.hasColWidth=h.col_width===!0?!0:!1,this.colWidth=this.hasColWidth?h.col_width:null,this.fixedHeaders=h.fixed_headers===!0?!0:!1,this.tBodyH=isNaN(h.tbody_height)?200:h.tbody_height,this.fltCssClass=h.flt_css_class||"flt",this.fltMultiCssClass=h.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=h.flt_small_css_class||"flt_s",this.singleFltCssClass=h.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=h.enter_key===!1?!1:!0,this.onBeforeFilter=p.Types.isFn(h.on_before_filter)?h.on_before_filter:null,this.onAfterFilter=p.Types.isFn(h.on_after_filter)?h.on_after_filter:null,this.matchCase=h.match_case===!0?!0:!1,this.exactMatch=h.exact_match===!0?!0:!1,this.linkedFilters=h.linked_filters===!0?!0:!1,this.disableExcludedOptions=h.disable_excluded_options===!0?!0:!1,this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=h.col_operation?!0:!1,this.colOperation=null,this.hasVisibleRows=h.rows_always_visible?!0:!1,this.visibleRows=this.hasVisibleRows?h.rows_always_visible:[],this.searchType=h.search_type||"include",this.isExternalFlt=h.external_flt_grid===!0?!0:!1,this.externalFltTgtIds=h.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(h.exec_delay)?100:parseInt(h.exec_delay,10),this.onFiltersLoaded=p.Types.isFn(h.on_filters_loaded)?h.on_filters_loaded:null,this.singleSearchFlt=h.single_search_filter===!0?!0:!1,this.onRowValidated=p.Types.isFn(h.on_row_validated)?h.on_row_validated:null,this.customCellDataCols=h.custom_cell_data_cols?h.custom_cell_data_cols:[],this.customCellData=p.Types.isFn(h.custom_cell_data)?h.custom_cell_data:null,this.watermark=h.watermark||"",this.isWatermarkArray=p.Types.isArray(this.watermark),this.toolBarTgtId=h.toolbar_target_id||null,this.helpInstructions=h.help_instructions||!1,this.popUpFilters=h.popup_filters===!0?!0:!1,this.markActiveColumns=h.mark_active_columns===!0?!0:!1,this.activeColumnsCssClass=h.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=p.Types.isFn(h.on_before_active_column)?h.on_before_active_column:null,this.onAfterActiveColumn=p.Types.isFn(h.on_after_active_column)?h.on_after_active_column:null,this.displayAllText=h.display_all_text||"",this.enableEmptyOption=h.enable_empty_option===!0?!0:!1,this.emptyText=h.empty_text||"(Empty)",this.enableNonEmptyOption=h.enable_non_empty_option===!0?!0:!1,this.nonEmptyText=h.non_empty_text||"(Non empty)",this.onSlcChange=h.on_change===!1?!1:!0,this.sortSlc=h.sort_select===!1?!1:!0,this.isSortNumAsc=h.sort_num_asc===!0?!0:!1,this.sortNumAsc=this.isSortNumAsc?h.sort_num_asc:null,this.isSortNumDesc=h.sort_num_desc===!0?!0:!1,this.sortNumDesc=this.isSortNumDesc?h.sort_num_desc:null,this.fillSlcOnDemand=h.fill_slc_on_demand===!0?!0:!1,this.hasCustomSlcOptions=p.Types.isObj(h.custom_slc_options)?!0:!1,this.customSlcOptions=p.Types.isArray(h.custom_slc_options)?h.custom_slc_options:null,this.rgxOperator=h.regexp_operator||"rgx:",this.emOperator=h.empty_operator||"[empty]",this.nmOperator=h.nonempty_operator||"[nonempty]",this.orOperator=h.or_operator||"||",this.anOperator=h.and_operator||"&&",this.grOperator=h.greater_operator||">",this.lwOperator=h.lower_operator||"<",this.leOperator=h.lower_equal_operator||"<=",this.geOperator=h.greater_equal_operator||">=",this.dfOperator=h.different_operator||"!",this.lkOperator=h.like_operator||"*",this.eqOperator=h.equal_operator||"=",this.stOperator=h.start_with_operator||"{",this.enOperator=h.end_with_operator||"}",this.curExp=h.cur_exp||"^[¥£€$]",this.separator=h.separator||",",this.rowsCounter=h.rows_counter===!0?!0:!1,this.statusBar=h.status_bar===!0?!0:!1,this.loader=h.loader===!0?!0:!1,this.displayBtn=h.btn===!0?!0:!1,this.btnText=h.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=h.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=h.btn_reset===!0?!0:!1,this.btnResetCssClass=h.btn_reset_css_class||"reset",this.onBeforeReset=p.Types.isFn(h.on_before_reset)?h.on_before_reset:null,this.onAfterReset=p.Types.isFn(h.on_after_reset)?h.on_after_reset:null,this.paging=h.paging===!0?!0:!1,this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=h.sort===!0?!0:!1,this.isSortEnabled=!1,this.sortConfig=h.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=p.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===!0?!0:!1,this.sortConfig.triggerIds=p.Types.isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.onKeyUp=h.on_keyup===!0?!0:!1,this.onKeyUpDelay=isNaN(h.on_keyup_delay)?900:h.on_keyup_delay,this.isUserTyping=null,this.onKeyUpTimer=void 0,this.highlightKeywords=h.highlight_keywords===!0?!0:!1,this.defaultDateType=h.default_date_type||"DMY",this.thousandsSeparator=h.thousands_separator||",",this.decimalSeparator=h.decimal_separator||".",this.hasColNbFormat=h.col_number_format===!0?!0:!1,this.colNbFormat=p.Types.isArray(this.hasColNbFormat)?h.col_number_format:null,this.hasColDateType=h.col_date_type===!0?!0:!1,this.colDateType=p.Types.isArray(this.hasColDateType)?h.col_date_type:null,this.msgFilter=h.msg_filter||"Filtering data...",this.msgPopulate=h.msg_populate||"Populating filter...",this.msgPopulateCheckList=h.msg_populate_checklist||"Populating list...",this.msgChangePage=h.msg_change_page||"Collecting paging data...",this.msgClear=h.msg_clear||"Clearing filters...",this.msgChangeResults=h.msg_change_results||"Changing results per page...",this.msgResetValues=h.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=h.msg_reset_page||"Re-setting page...",this.msgResetPageLength=h.msg_reset_page_length||"Re-setting page length...",this.msgSort=h.msg_sort||"Sorting data...",this.msgLoadExtensions=h.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=h.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=h.remember_grid_values===!0?!0:!1,this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&h.remember_page_number?!0:!1,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&h.remember_page_length?!0:!1,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=h.extensions,this.hasExtensions=p.Types.isArray(this.extensions),this.enableDefaultTheme=h.enable_default_theme===!0?!0:!1,this.hasThemes=h.enable_default_theme||p.Types.isArray(h.themes),this.themes=h.themes||[],this.themesPath=h.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,ezEditTable:null};var g=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(g.enterKey){var e=t||D.event;if(e){var s=e.Event.keyCode(e);13===s?(g._filter(),e.Event.cancel(e),e.Event.stop(e)):(g.isUserTyping=!0,D.clearInterval(g.onKeyUpTimer),g.onKeyUpTimer=void 0)}}},onKeyUp:function(t){function e(){D.clearInterval(g.onKeyUpTimer),g.onKeyUpTimer=void 0,g.isUserTyping||(g.filter(),g.isUserTyping=null)}if(g.onKeyUp){var s=t||D.event,i=s.Event.keyCode(s);g.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?void 0===g.onKeyUpTimer&&(g.onKeyUpTimer=D.setInterval(e,g.onKeyUpDelay)):(D.clearInterval(g.onKeyUpTimer),g.onKeyUpTimer=void 0)}},onKeyDown:function(){g.onKeyUp&&(g.isUserTyping=!0)},onInpBlur:function(){g.onKeyUp&&(g.isUserTyping=!1,D.clearInterval(g.onKeyUpTimer))},onInpFocus:function(t){var e=t||D.event;g.activeFilterId=this.getAttribute("id"),g.activeFlt=n.Dom.id(g.activeFilterId),g.popUpFilters&&(e.Event.cancel(e),e.Event.stop(e))},onSlcFocus:function(t){var e=t||D.event;if(g.activeFilterId=this.getAttribute("id"),g.activeFlt=n.Dom.id(g.activeFilterId),g.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var s=this.getAttribute("ct");g.Cpt.dropdown._build(s)}g.popUpFilters&&(e.Event.cancel(e),e.Event.stop(e))},onSlcChange:function(t){if(g.activeFlt){var e=t||D.event;g.popUpFilters&&e.Event.stop(e),g.onSlcChange&&g.filter()}},onCheckListClick:function(){if(g.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var t=this.getAttribute("ct");g.Cpt.checkList._build(t),g.Cpt.checkList.checkListDiv[t].onclick=null,g.Cpt.checkList.checkListDiv[t].title=""}},onCheckListFocus:function(){g.activeFilterId=this.firstChild.getAttribute("id"),g.activeFlt=n.Dom.id(g.activeFilterId)},onBtnClick:function(){g.filter()}}}}return r(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=n.Dom.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,e=this.cfg,s=this.singleSearchFlt?1:this.nbCells;if(void 0===window["tf_"+this.id]&&(window["tf_"+this.id]=this),this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new f.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new g.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new v.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new m.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new C.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var i;if(!this.gridLayout){var l=n.Dom.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 r=0;s>r;r++){this.popUpFilters&&this.Cpt.popupFilter.build(r);var h=n.Dom.create(this.fltCellTag),p=this["col"+r],c=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[r]:null;if(this.singleSearchFlt&&(h.colSpan=this.nbCells),this.gridLayout||i.appendChild(h),t=r==s-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===p&&(p=void 0===e["col_"+r]?this.fltTypeInp:o.Str.lower(e["col_"+r])),this.singleSearchFlt&&(p=this.fltTypeInp,t=this.singleFltCssClass),p===this.fltTypeSlc||p===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new b.Dropdown(this));var d=this.Cpt.dropdown,u=n.Dom.create(this.fltTypeSlc,["id",this.prfxFlt+r+"_"+this.id],["ct",r],["filled","0"]);if(p===this.fltTypeMulti&&(u.multiple=this.fltTypeMulti,u.title=d.multipleSlcTooltip),u.className=o.Str.lower(p)===this.fltTypeSlc?t:this.fltMultiCssClass,c?(n.Dom.id(c).appendChild(u),this.externalFltEls.push(u)):h.appendChild(u),this.fltIds.push(this.prfxFlt+r+"_"+this.id),this.fillSlcOnDemand||d._build(r),a.Event.add(u,"keypress",this.Evt.detectKey),a.Event.add(u,"change",this.Evt.onSlcChange),a.Event.add(u,"focus",this.Evt.onSlcFocus),this.fillSlcOnDemand){var D=n.Dom.createOpt(this.displayAllText,"");u.appendChild(D)}}else if(p===this.fltTypeCheckList){var S;this.Cpt.checkList||(this.Cpt.checkList=new _.CheckList(this),S=this.Cpt.checkList);var F=n.Dom.create("div",["id",S.prfxCheckListDiv+r+"_"+this.id],["ct",r],["filled","0"]);F.className=S.checkListDivCssClass,c?(n.Dom.id(c).appendChild(F),this.externalFltEls.push(F)):h.appendChild(F),S.checkListDiv[r]=F,this.fltIds.push(this.prfxFlt+r+"_"+this.id),this.fillSlcOnDemand||S._build(r),this.fillSlcOnDemand&&(a.Event.add(F,"click",this.Evt.onCheckListClick),F.appendChild(n.Dom.text(S.activateCheckListTxt))),a.Event.add(F,"click",this.Evt.onCheckListFocus)}else{var P=p===this.fltTypeInp?"text":"hidden",E=n.Dom.create(this.fltTypeInp,["id",this.prfxFlt+r+"_"+this.id],["type",P],["ct",r]);if("hidden"!==P&&this.watermark&&E.setAttribute("placeholder",this.isWatermarkArray?this.watermark[r]||"":this.watermark),E.className=t,E.onfocus=this.Evt.onInpFocus,c?(n.Dom.id(c).appendChild(E),this.externalFltEls.push(E)):h.appendChild(E),this.fltIds.push(this.prfxFlt+r+"_"+this.id),E.onkeypress=this.Evt.detectKey,E.onkeydown=this.Evt.onKeyDown,E.onkeyup=this.Evt.onKeyUp,E.onblur=this.Evt.onInpBlur,this.rememberGridValues){var L=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=L[r]&&this.setFilterValue(r,L[r],!1)}}if(r==s-1&&this.displayBtn){var N=n.Dom.create(this.fltTypeInp,["id",this.prfxValButton+r+"_"+this.id],["type","button"],["value",this.btnText]);N.className=this.btnCssClass,c?n.Dom.id(c).appendChild(N):h.appendChild(N),N.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 y.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new w.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new x.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new T.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help=new k.Help(this),this.Cpt.help.init()),this.hasColWidth&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new I.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new R.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||n.Dom.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,r);break;case e.checklist:n.checkList._build(i,l,r);break;case e.changepage:n.paging._changePage(a);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,r=s.slcId,a=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),D.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0;es;s++){var l=t[s],r=l.name,a=l.path;r&&!a?a=this.themesPath+r+"/"+r+".css":!r&&l.path&&(r="theme{0}".replace("{0}",s)),this.isImported(a,"link")||this["import"](r,a,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,s=this.ExtRegistry;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.sort&&s.sort.destroy(),this.loader&&e.loader.destroy(),this.popUpFilters&&e.popupFilter.destroy(),this.markActiveColumns&&this.clearActiveColumns(),s.advancedGrid&&s.advancedGrid.destroy();for(var i=this.refRow;is;s++){var i=t[s],l=n.Dom.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:"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;lr):V?(n=F(t.replace(p,""),N),i=n>=r):j?(n=F(t.replace(d,""),N),i=r>=n):U?(n=F(t.replace(g,""),N),i=r>n):G?(n=F(t.replace(v,""),N),i=r.toString()!=n.toString()):K?(n=F(t.replace(C,""),N),i=r.toString()==n.toString()):m.test(t)?i=this._containsStr(t.replace(m,""),e,null,!1):S(t,N)?(n=F(t,N),i=r.toString()==n.toString()):B?i=o.Str.isEmpty(e):O&&(i=!o.Str.isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(a=c(e,this.colNbFormat[s]),h=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(a=c(e,"us"),h="us"):(a=c(e,"eu"),h="eu"),k)i=a<=c(t.replace(p,""),h);else if(R)i=a>=c(t.replace(d,""),h);else if(T)i=ac(t.replace(g,""),h);else if(D)i=this._containsStr(t.replace(v,""),e)?!1:!0;else if(E)i=this._containsStr(t.replace(m,""),e,null,!1);else if(P)i=this._containsStr(t.replace(C,""),e,null,!0);else if(L)i=0===e.indexOf(t.replace(b,""))?!0:!1;else if(A){var W=t.replace(_,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(B)i=o.Str.isEmpty(e);else if(O)i=!o.Str.isEmpty(e);else if(H)try{var $=t.replace(x,""),q=new RegExp($);i=q.test(e)}catch(z){i=!1}else{var Y=l["col_"+s];i=this._containsStr(t,e,Y?Y: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,r=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var a,h,p=new RegExp(this.leOperator),d=new RegExp(this.geOperator),f=new RegExp(this.lwOperator),g=new RegExp(this.grOperator),v=new RegExp(this.dfOperator),m=new RegExp(o.Str.rgxEsc(this.lkOperator)),C=new RegExp(this.eqOperator),b=new RegExp(this.stOperator),_=new RegExp(this.enOperator),y=this.emOperator,w=this.nmOperator,x=new RegExp(o.Str.rgxEsc(this.rgxOperator)),T=this.refRow;TE;E++){var L=this.searchArgs[this.singleSearchFlt?0:E],N=this.hasColDateType?this.colDateType[E]:this.defaultDateType;if(""!==L){var A=o.Str.matchCase(this.getCellData(E,k[E]),this.matchCase),B=L.split(this.orOperator),O=B.length>1?!0:!1,H=L.split(this.anOperator),M=H.length>1?!0:!1;if(O||M){for(var V,U=!1,j=O?B:H,G=0;Gd;d++)if(d===t&&""===i[r].style.display){var f=o.Str.lower(this.getCellData(d,n[d])),g=this.colNbFormat?this.colNbFormat[t]:null,v=e?u.Helpers.removeNbFormat(f,g):f;l.push(v)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){var e,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;l]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},l.create=function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;i0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var r=i.indexOf(";",l);-1===r&&(r=i.length),e=unescape(i.substring(l,r))}}return e},i.remove=function(t){this.write(t,"",-1)},i.valueToArray=function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},i.getValueByIndex=function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]},e.Cookie=i},function(t,e,s){"use strict";var i={},l=void 0;i.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},i.isFn=function(t){return t&&t.constructor==Function},i.isArray=function(t){return t&&t.constructor==Array},i.isUndef=function(t){return t===l},e.Types=i},function(t,e,s){"use strict";var i=s(4),l={has:function(t,e,s){for(var l=void 0===s?!1:s,r=0;r2)return t;var e;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,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}var r={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,l;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 r,a,n,o=t.split(RegExp.$1);r="M"===e.substring(0,1)?o[0]:"M"===e.substring(1,2)?o[1]:o[2],a="D"===e.substring(0,1)?o[0]:"D"===e.substring(1,2)?o[1]:o[2],n="Y"===e.substring(0,1)?o[0]:"Y"===e.substring(1,2)?o[1]:o[2],parseInt(n,10)<=50&&(n=(parseInt(n,10)+2e3).toString()),parseInt(n,10)<=99&&(n=(parseInt(n,10)+1900).toString());var h=new Date(parseInt(n,10),parseInt(r,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t){function e(e,s){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s;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})};e.DateHelper=r},function(t,e,s){"use strict";var i=s(4),l={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===i.Str.lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}};e.Helpers=l},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=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",n.Event.add(this.tblCont,"scroll",function(e){var s=n.Event.target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.gridEnableColResizer&&(e.hasExtensions?e._containsStr("colsresizer",Str.lower(e.extensions.src.toString()))||(e.extensions.name.push("ColumnsResizer_"+e.id),e.extensions.src.push(e.gridColResizerPath),e.extensions.description.push("Columns Resizing"),e.extensions.initialize.push(function(t){t.SetColsResizer("ColumnsResizer_"+t.id)})):(e.extensions={name:["ColumnsResizer_"+e.id],src:[this.gridColResizerPath],description:["Columns Resizing"],initialize:[function(t){t.SetColsResizer("ColumnsResizer_"+t.id)}]},e.hasExtensions=!0)),s.col_resizer_cols_headers_table=this.headTbl.getAttribute("id"),s.col_resizer_cols_headers_index=this.gridHeadRowIndex,s.col_resizer_width_adjustment=0,s.col_enable_text_ellipsis=!1,this.tblHasColTag=r.Dom.tag(i,"col").length>0?!0:!1;var R=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=r.Dom.create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidth[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var D=r.Dom.tag(i,"col"),S=0;S',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=r.Types.isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=r.Types.isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=r.Types.isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=r.Types.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 l(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 r=this.popUpFltElms[l],h=this.tf.getHeaderElement(l),p=.95*h.clientWidth;if(o.Helpers.isIE()){var c=a.Dom.position(h).left;r.style.left=c+"px"}r.style.width=parseInt(p,10)+"px"}n.Event.cancel(s),n.Event.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&&(""===c[C].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&a.Arr.has(l.validRowsIndex,C))&&(void 0===u||u==t||u!=t&&a.Arr.has(l.validRowsIndex,C)))){var w=l.getCellData(y,b[y]),x=n.Str.matchCase(w,d);if(a.Arr.has(this.opts,x,d)||this.opts.push(w),e&&l.disableExcludedOptions){var T=m[y];T||(T=this.GetFilteredDataCol(y)),a.Arr.has(T,x,d)||a.Arr.has(v,x,d)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.__getCustomValues(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(d?(this.opts.sort(),v&&v.sort()):(this.opts.sort(o.Sort.ignoreCase),v&&v.sort(o.Sort.ignoreCase))),l.sortNumAsc&&a.Arr.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&&a.Arr.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,p,e,v,f,g)}}},{key:"addOptions",value:function(t,e,s,i,l,o){var h=this.tf,p=n.Str.lower(this.slcFillingMethod),c=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var d=0;d"+f+""}else{var m;m=h.fillSlcOnDemand&&c===this.opts[d]&&h["col"+t]===h.fltTypeSlc?r.Dom.createOpt(f,u,!0):h["col"+t]!==h.fltTypeMulti?r.Dom.createOpt(f,u," "!==l[t]&&u===l[t]?!0:!1):r.Dom.createOpt(f,u,a.Arr.has(o,n.Str.matchCase(this.opts[d],h.matchCase),h.matchCase)||-1!==o.toString().indexOf(u)?!0:!1),g&&(m.disabled=!0),e.appendChild(m)}}"innerhtml"===p&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=n.Str.lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=r.Dom.createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=r.Dom.createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=r.Dom.createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=h},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===u[m].style.display&&!l.paging||l.paging&&(!f||f===t||f!=t&&a.Arr.has(l.validRowsIndex,m)))){var y=l.getCellData(_,C[_]),w=n.Str.matchCase(y,l.matchCase);a.Arr.has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),a.Arr.has(x,w,l.matchCase)||a.Arr.has(g,w,l.matchCase)||l.isFirstLoad||g.push(y))}}if(this.isCustom){var T=l.__getCustomValues(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),g&&g.sort()):(this.opts.sort(o.Sort.ignoreCase),g&&g.sort(o.Sort.ignoreCase))),l.sortNumAsc&&a.Arr.has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),g&&g.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),g&&g.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&a.Arr.has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),g&&g.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),g&&g.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,d,l.separator),l.fillSlcOnDemand&&(c.innerHTML=""),c.appendChild(d),c.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),o=[],p=i.Cpt.store,c=p?p.getFilterValues(i.fltsValuesCookie)[t]:null;c&&n.Str.trim(c).length>0&&(i.hasCustomSlcOptions&&a.Arr.has(i.customSlcOptions.cols,t)?o.push(c):o=c.split(" "+i.orOperator+" "));for(var d=0;d0?1:0),r=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+r+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?n.Helpers.isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):r.Dom.id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=o},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=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=a.Types.isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=a.Types.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 l=this.refRow,r=this.nbRows;this.nbPages=Math.ceil((r-l)/this.pagingLength);var n=this;this.evt={slcIndex:function(){return n.pageSelectorType===e.fltTypeSlc?n.pagingSlc.options.selectedIndex:parseInt(n.pagingSlc.value,10)-1},nbOpts:function(){return n.pageSelectorType===e.fltTypeSlc?parseInt(n.pagingSlc.options.length,10)-1:n.nbPages-1},next:function(){var t=n.evt.slcIndex()0?n.evt.slcIndex()-1:n.evt.nbOpts();n.changePage(t)},last:function(){n.changePage(n.evt.nbOpts())},first:function(){n.changePage(0)},_detectKey:function(t){var s=o.Event.keyCode(t);13===s&&(e.sorted?(e.filter(),n.changePage(n.evt.slcIndex())):n.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return l(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=r.Dom.create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,o.Event.add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=r.Dom.create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,o.Event.add(t,"keypress",i._detectKey));var l=r.Dom.create("span",["id",this.prfxBtnNextSpan+s.id]),a=r.Dom.create("span",["id",this.prfxBtnPrevSpan+s.id]),n=r.Dom.create("span",["id",this.prfxBtnLastSpan+s.id]),h=r.Dom.create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,o.Event.add(l,"click",i.next);else{var p=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);p.className=this.btnPageCssClass,o.Event.add(p,"click",i.next),l.appendChild(p)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,o.Event.add(a,"click",i.prev);else{var c=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);c.className=this.btnPageCssClass,o.Event.add(c,"click",i.prev),a.appendChild(c)}if(this.btnLastPageHtml)n.innerHTML=this.btnLastPageHtml,o.Event.add(n,"click",i.last);else{var d=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);d.className=this.btnPageCssClass,o.Event.add(d,"click",i.last),n.appendChild(d)}if(this.btnFirstPageHtml)h.innerHTML=this.btnFirstPageHtml,o.Event.add(h,"click",i.first);else{var u=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);u.className=this.btnPageCssClass,o.Event.add(u,"click",i.first),h.appendChild(u)}}this.pagingTgtId||s.setToolbar();var f=this.pagingTgtId?r.Dom.id(this.pagingTgtId):s.mDiv;f.appendChild(h),f.appendChild(a);var g=r.Dom.create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(r.Dom.text(this.pageText)),g.className=this.nbPgSpanCssClass,f.appendChild(g),f.appendChild(t);var v=r.Dom.create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(r.Dom.text(this.ofText)),v.className=this.nbPgSpanCssClass,f.appendChild(v);var m=r.Dom.create("span",["id",this.prfxPgSpan+s.id]);m.className=this.nbPgSpanCssClass,m.appendChild(r.Dom.text(" "+this.nbPages+" ")),f.appendChild(m),f.appendChild(l),f.appendChild(n),this.pagingSlc=r.Dom.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?r.Dom.id(this.pagingTgtId):e.mDiv,l=r.Dom.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"!==r.getAttribute("validRow")&&r.getAttribute("validRow")||(r.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(r.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(n.Str.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=r.Dom.create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],n=r.Dom.create("span",["id",this.prfxSlcResultsTxt+e.id]);n.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var h=this.resultsPerPageTgtId?r.Dom.id(this.resultsPerPageTgtId):e.rDiv;n.appendChild(r.Dom.text(l)),h.appendChild(n),h.appendChild(i),this.resultsPerPageSlc=r.Dom.id(this.prfxSlcResults+e.id);for(var p=0;p=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,n,h;e=r.Dom.id(this.prfxBtnNextSpan+t.id),s=r.Dom.id(this.prfxBtnPrevSpan+t.id),i=r.Dom.id(this.prfxBtnLastSpan+t.id),l=r.Dom.id(this.prfxBtnFirstSpan+t.id),a=r.Dom.id(this.prfxPgBeforeSpan+t.id),n=r.Dom.id(this.prfxPgAfterSpan+t.id),h=r.Dom.id(this.prfxPgSpan+t.id);var p=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?o.Event.remove(this.pagingSlc,"change",p.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&o.Event.remove(this.pagingSlc,"keypress",p._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(o.Event.remove(e,"click",p.next),e.parentNode.removeChild(e)),s&&(o.Event.remove(s,"click",p.prev),s.parentNode.removeChild(s)),i&&(o.Event.remove(i,"click",p.last),i.parentNode.removeChild(i)),l&&(o.Event.remove(l,"click",p.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),n&&n.parentNode.removeChild(n),h&&h.parentNode.removeChild(h),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=h},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return l(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=r.Dom.create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?r.Dom.id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;a.Event.add(l,"click",function(){t.onClick()})}else{var n=r.Dom.create("a",["href","javascript:void(0);"]);n.className=e.btnResetCssClass,n.appendChild(r.Dom.text(this.btnResetText)),s.appendChild(n),a.Event.add(n,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=r.Dom.id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=n},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s<, <=, >, >=, =, *, !, {, }, ||,&&, [empty], [nonempty], rgx:
These operators are described here:
http://tablefilter.free.fr/#operators
', +!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,r){for(var a,n,o=0,h=[];o1)for(var s=0;s1?this.filtersRowIndex=this.headersRow+1:(this.filtersRowIndex=1,this.headersRow=0)),this.fltCellTag="th"!==c.filters_cell_tag||"td"!==c.filters_cell_tag?"td":c.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=c.inf_div_css_class||"inf",this.lDivCssClass=c.left_div_css_class||"ldiv",this.rDivCssClass=c.right_div_css_class||"rdiv",this.mDivCssClass=c.middle_div_css_class||"mdiv",this.contDivCssClass=c.content_div_css_class||"cont",this.stylesheet=c.stylesheet||this.basePath+"tablefilter.css",this.stylesheetId=this.id+"_style",this.fltsRowCssClass=c.flts_row_css_class||"fltrow",this.enableIcons=c.enable_icons===!1?!1:!0,this.alternateBgs=c.alternate_rows===!0?!0:!1,this.hasColWidth=c.col_width===!0?!0:!1,this.colWidth=this.hasColWidth?c.col_width:null,this.fixedHeaders=c.fixed_headers===!0?!0:!1,this.tBodyH=isNaN(c.tbody_height)?200:c.tbody_height,this.fltCssClass=c.flt_css_class||"flt",this.fltMultiCssClass=c.flt_multi_css_class||"flt_multi",this.fltSmallCssClass=c.flt_small_css_class||"flt_s",this.singleFltCssClass=c.single_flt_css_class||"single_flt",this.isStartBgAlternate=!0,this.enterKey=c.enter_key===!1?!1:!0,this.onBeforeFilter=p.Types.isFn(c.on_before_filter)?c.on_before_filter:null,this.onAfterFilter=p.Types.isFn(c.on_after_filter)?c.on_after_filter:null,this.caseSensitive=c.case_sensitive===!0?!0:!1,this.exactMatch=c.exact_match===!0?!0:!1,this.linkedFilters=c.linked_filters===!0?!0:!1,this.disableExcludedOptions=c.disable_excluded_options===!0?!0:!1,this.activeFlt=null,this.activeFilterId=null,this.hasColOperation=c.col_operation?!0:!1,this.colOperation=null,this.hasVisibleRows=c.rows_always_visible?!0:!1,this.visibleRows=this.hasVisibleRows?c.rows_always_visible:[],this.searchType=c.search_type||"include",this.isExternalFlt=c.external_flt_grid===!0?!0:!1,this.externalFltTgtIds=c.external_flt_grid_ids||null,this.externalFltEls=[],this.execDelay=isNaN(c.exec_delay)?100:parseInt(c.exec_delay,10),this.onFiltersLoaded=p.Types.isFn(c.on_filters_loaded)?c.on_filters_loaded:null,this.singleSearchFlt=c.single_search_filter===!0?!0:!1,this.onRowValidated=p.Types.isFn(c.on_row_validated)?c.on_row_validated:null,this.customCellDataCols=c.custom_cell_data_cols?c.custom_cell_data_cols:[],this.customCellData=p.Types.isFn(c.custom_cell_data)?c.custom_cell_data:null,this.watermark=c.watermark||"",this.isWatermarkArray=p.Types.isArray(this.watermark),this.toolBarTgtId=c.toolbar_target_id||null,this.helpInstructions=c.help_instructions||!1,this.popUpFilters=c.popup_filters===!0?!0:!1,this.markActiveColumns=c.mark_active_columns===!0?!0:!1,this.activeColumnsCssClass=c.active_columns_css_class||"activeHeader",this.onBeforeActiveColumn=p.Types.isFn(c.on_before_active_column)?c.on_before_active_column:null,this.onAfterActiveColumn=p.Types.isFn(c.on_after_active_column)?c.on_after_active_column:null,this.displayAllText=c.display_all_text||"",this.enableEmptyOption=c.enable_empty_option===!0?!0:!1,this.emptyText=c.empty_text||"(Empty)",this.enableNonEmptyOption=c.enable_non_empty_option===!0?!0:!1,this.nonEmptyText=c.non_empty_text||"(Non empty)",this.onSlcChange=c.on_change===!1?!1:!0,this.sortSlc=c.sort_select===!1?!1:!0,this.isSortNumAsc=c.sort_num_asc===!0?!0:!1,this.sortNumAsc=this.isSortNumAsc?c.sort_num_asc:null,this.isSortNumDesc=c.sort_num_desc===!0?!0:!1,this.sortNumDesc=this.isSortNumDesc?c.sort_num_desc:null,this.fillSlcOnDemand=c.fill_slc_on_demand===!0?!0:!1,this.hasCustomSlcOptions=p.Types.isObj(c.custom_slc_options)?!0:!1,this.customSlcOptions=p.Types.isArray(c.custom_slc_options)?c.custom_slc_options:null,this.rgxOperator=c.regexp_operator||"rgx:",this.emOperator=c.empty_operator||"[empty]",this.nmOperator=c.nonempty_operator||"[nonempty]",this.orOperator=c.or_operator||"||",this.anOperator=c.and_operator||"&&",this.grOperator=c.greater_operator||">",this.lwOperator=c.lower_operator||"<",this.leOperator=c.lower_equal_operator||"<=",this.geOperator=c.greater_equal_operator||">=",this.dfOperator=c.different_operator||"!",this.lkOperator=c.like_operator||"*",this.eqOperator=c.equal_operator||"=",this.stOperator=c.start_with_operator||"{",this.enOperator=c.end_with_operator||"}",this.curExp=c.cur_exp||"^[¥£€$]",this.separator=c.separator||",",this.rowsCounter=c.rows_counter===!0?!0:!1,this.statusBar=c.status_bar===!0?!0:!1,this.loader=c.loader===!0?!0:!1,this.displayBtn=c.btn===!0?!0:!1,this.btnText=c.btn_text||(this.enableIcons?"":"Go"),this.btnCssClass=c.btn_css_class||(this.enableIcons?"btnflt_icon":"btnflt"),this.btnReset=c.btn_reset===!0?!0:!1,this.btnResetCssClass=c.btn_reset_css_class||"reset",this.onBeforeReset=p.Types.isFn(c.on_before_reset)?c.on_before_reset:null,this.onAfterReset=p.Types.isFn(c.on_after_reset)?c.on_after_reset:null,this.paging=c.paging===!0?!0:!1,this.nbVisibleRows=0,this.nbHiddenRows=0,this.sort=c.sort===!0?!0:!1,this.isSortEnabled=!1,this.sortConfig=c.sort_config||{},this.sortConfig.name=this.sortConfig.name||"sort",this.sortConfig.path=this.sortConfig.path||null,this.sortConfig.sortTypes=p.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===!0?!0:!1,this.sortConfig.triggerIds=p.Types.isArray(this.sortConfig.sort_trigger_ids)?this.sortConfig.sort_trigger_ids:[],this.onKeyUp=c.on_keyup===!0?!0:!1,this.onKeyUpDelay=isNaN(c.on_keyup_delay)?900:c.on_keyup_delay,this.isUserTyping=null,this.onKeyUpTimer=void 0,this.highlightKeywords=c.highlight_keywords===!0?!0:!1,this.defaultDateType=c.default_date_type||"DMY",this.thousandsSeparator=c.thousands_separator||",",this.decimalSeparator=c.decimal_separator||".",this.hasColNbFormat=c.col_number_format===!0?!0:!1,this.colNbFormat=p.Types.isArray(this.hasColNbFormat)?c.col_number_format:null,this.hasColDateType=c.col_date_type===!0?!0:!1,this.colDateType=p.Types.isArray(this.hasColDateType)?c.col_date_type:null,this.msgFilter=c.msg_filter||"Filtering data...",this.msgPopulate=c.msg_populate||"Populating filter...",this.msgPopulateCheckList=c.msg_populate_checklist||"Populating list...",this.msgChangePage=c.msg_change_page||"Collecting paging data...",this.msgClear=c.msg_clear||"Clearing filters...",this.msgChangeResults=c.msg_change_results||"Changing results per page...",this.msgResetValues=c.msg_reset_grid_values||"Re-setting filters values...",this.msgResetPage=c.msg_reset_page||"Re-setting page...",this.msgResetPageLength=c.msg_reset_page_length||"Re-setting page length...",this.msgSort=c.msg_sort||"Sorting data...",this.msgLoadExtensions=c.msg_load_extensions||"Loading extensions...",this.msgLoadThemes=c.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=c.remember_grid_values===!0?!0:!1,this.fltsValuesCookie=this.prfxCookieFltsValues+this.id,this.rememberPageNb=this.paging&&c.remember_page_number?!0:!1,this.pgNbCookie=this.prfxCookiePageNb+this.id,this.rememberPageLen=this.paging&&c.remember_page_length?!0:!1,this.pgLenCookie=this.prfxCookiePageLen+this.id,this.extensions=c.extensions,this.hasExtensions=p.Types.isArray(this.extensions),this.enableDefaultTheme=c.enable_default_theme===!0?!0:!1,this.hasThemes=c.enable_default_theme||p.Types.isArray(c.themes),this.themes=c.themes||[],this.themesPath=c.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,ezEditTable:null};var v=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(v.enterKey){var e=t||S.event;if(e){var s=a.Event.keyCode(e);13===s?(v._filter(),a.Event.cancel(e),a.Event.stop(e)):(v.isUserTyping=!0,S.clearInterval(v.onKeyUpTimer),v.onKeyUpTimer=void 0)}}},onKeyUp:function(t){function e(){S.clearInterval(v.onKeyUpTimer),v.onKeyUpTimer=void 0,v.isUserTyping||(v.filter(),v.isUserTyping=null)}if(v.onKeyUp){var s=t||S.event,i=a.Event.keyCode(s);v.isUserTyping=!1,13!==i&&9!==i&&27!==i&&38!==i&&40!==i?void 0===v.onKeyUpTimer&&(v.onKeyUpTimer=S.setInterval(e,v.onKeyUpDelay)):(S.clearInterval(v.onKeyUpTimer),v.onKeyUpTimer=void 0)}},onKeyDown:function(){v.onKeyUp&&(v.isUserTyping=!0)},onInpBlur:function(){v.onKeyUp&&(v.isUserTyping=!1,S.clearInterval(v.onKeyUpTimer))},onInpFocus:function(t){var e=t||S.event;v.activeFilterId=this.getAttribute("id"),v.activeFlt=n.Dom.id(v.activeFilterId),v.popUpFilters&&(a.Event.cancel(e),a.Event.stop(e))},onSlcFocus:function(t){var e=t||S.event;if(v.activeFilterId=this.getAttribute("id"),v.activeFlt=n.Dom.id(v.activeFilterId),v.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var s=this.getAttribute("ct");v.Cpt.dropdown._build(s)}v.popUpFilters&&(a.Event.cancel(e),a.Event.stop(e))},onSlcChange:function(t){if(v.activeFlt){var e=t||S.event;v.popUpFilters&&a.Event.stop(e),v.onSlcChange&&v.filter()}},onCheckListClick:function(){if(v.fillSlcOnDemand&&"0"===this.getAttribute("filled")){var t=this.getAttribute("ct");v.Cpt.checkList._build(t),v.Cpt.checkList.checkListDiv[t].onclick=null,v.Cpt.checkList.checkListDiv[t].title=""}},onCheckListFocus:function(){v.activeFilterId=this.firstChild.getAttribute("id"),v.activeFlt=n.Dom.id(v.activeFilterId)},onBtnClick:function(){v.filter()}}}}return r(t,[{key:"init",value:function(){if(!this._hasGrid){this.tbl||(this.tbl=n.Dom.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,e=this.cfg,s=this.singleSearchFlt?1:this.nbCells;if(void 0===window["tf_"+this.id]&&(window["tf_"+this.id]=this),this["import"](this.stylesheetId,this.stylesheet,null,"link"),this.hasThemes&&this._loadThemes(),(this.rememberGridValues||this.rememberPageNb||this.rememberPageLen)&&(this.Cpt.store=new f.Store(this)),this.gridLayout&&(this.Cpt.gridLayout=new g.GridLayout(this),this.Cpt.gridLayout.init()),this.loader&&(this.Cpt.loader||(this.Cpt.loader=new v.Loader(this))),this.highlightKeywords&&(this.Cpt.highlightKeyword=new m.HighlightKeyword(this)),this.popUpFilters&&(this.Cpt.popupFilter||(this.Cpt.popupFilter=new C.PopupFilter(this)),this.Cpt.popupFilter.init()),this.fltGrid)if(this.isFirstLoad){var i;if(!this.gridLayout){var l=n.Dom.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 r=0;s>r;r++){this.popUpFilters&&this.Cpt.popupFilter.build(r);var h=n.Dom.create(this.fltCellTag),p=this["col"+r],c=this.isExternalFlt&&this.externalFltTgtIds?this.externalFltTgtIds[r]:null;if(this.singleSearchFlt&&(h.colSpan=this.nbCells),this.gridLayout||i.appendChild(h),t=r==s-1&&this.displayBtn?this.fltSmallCssClass:this.fltCssClass,void 0===p&&(p=void 0===e["col_"+r]?this.fltTypeInp:o.Str.lower(e["col_"+r])),this.singleSearchFlt&&(p=this.fltTypeInp,t=this.singleFltCssClass),p===this.fltTypeSlc||p===this.fltTypeMulti){this.Cpt.dropdown||(this.Cpt.dropdown=new b.Dropdown(this));var d=this.Cpt.dropdown,u=n.Dom.create(this.fltTypeSlc,["id",this.prfxFlt+r+"_"+this.id],["ct",r],["filled","0"]);if(p===this.fltTypeMulti&&(u.multiple=this.fltTypeMulti,u.title=d.multipleSlcTooltip),u.className=o.Str.lower(p)===this.fltTypeSlc?t:this.fltMultiCssClass,c?(n.Dom.id(c).appendChild(u),this.externalFltEls.push(u)):h.appendChild(u),this.fltIds.push(this.prfxFlt+r+"_"+this.id),this.fillSlcOnDemand||d._build(r),a.Event.add(u,"keypress",this.Evt.detectKey),a.Event.add(u,"change",this.Evt.onSlcChange),a.Event.add(u,"focus",this.Evt.onSlcFocus),this.fillSlcOnDemand){var S=n.Dom.createOpt(this.displayAllText,"");u.appendChild(S)}}else if(p===this.fltTypeCheckList){var D;this.Cpt.checkList||(this.Cpt.checkList=new _.CheckList(this),D=this.Cpt.checkList);var F=n.Dom.create("div",["id",D.prfxCheckListDiv+r+"_"+this.id],["ct",r],["filled","0"]);F.className=D.checkListDivCssClass,c?(n.Dom.id(c).appendChild(F),this.externalFltEls.push(F)):h.appendChild(F),D.checkListDiv[r]=F,this.fltIds.push(this.prfxFlt+r+"_"+this.id),this.fillSlcOnDemand||D._build(r),this.fillSlcOnDemand&&(a.Event.add(F,"click",this.Evt.onCheckListClick),F.appendChild(n.Dom.text(D.activateCheckListTxt))),a.Event.add(F,"click",this.Evt.onCheckListFocus)}else{var P=p===this.fltTypeInp?"text":"hidden",E=n.Dom.create(this.fltTypeInp,["id",this.prfxFlt+r+"_"+this.id],["type",P],["ct",r]);if("hidden"!==P&&this.watermark&&E.setAttribute("placeholder",this.isWatermarkArray?this.watermark[r]||"":this.watermark),E.className=t,E.onfocus=this.Evt.onInpFocus,c?(n.Dom.id(c).appendChild(E),this.externalFltEls.push(E)):h.appendChild(E),this.fltIds.push(this.prfxFlt+r+"_"+this.id),a.Event.add(E,"keypress",this.Evt.detectKey),a.Event.add(E,"keydown",this.Evt.onKeyDown),a.Event.add(E,"keyup",this.Evt.onKeyUp),a.Event.add(E,"blur",this.Evt.onInpBlur),this.rememberGridValues){var L=this.Cpt.store.getFilterValues(this.fltsValuesCookie);" "!=L[r]&&this.setFilterValue(r,L[r],!1)}}if(r==s-1&&this.displayBtn){var N=n.Dom.create(this.fltTypeInp,["id",this.prfxValButton+r+"_"+this.id],["type","button"],["value",this.btnText]);N.className=this.btnCssClass,c?n.Dom.id(c).appendChild(N):h.appendChild(N),N.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 y.RowsCounter(this),this.Cpt.rowsCounter.init()),this.statusBar&&(this.Cpt.statusBar=new w.StatusBar(this),this.Cpt.statusBar.init()),(this.paging||this.Cpt.paging&&this.Cpt.paging.isPagingRemoved)&&(this.Cpt.paging=new x.Paging(this),this.Cpt.paging.init()),this.btnReset&&(this.Cpt.clearButton=new T.ClearButton(this),this.Cpt.clearButton.init()),this.helpInstructions&&(this.Cpt.help=new k.Help(this),this.Cpt.help.init()),this.hasColWidth&&!this.gridLayout&&this.setColWidths(),this.alternateBgs&&(this.Cpt.alternateRows=new I.AlternateRows(this),this.Cpt.alternateRows.init()),this.hasColOperation&&(this.Cpt.colOps=new R.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||n.Dom.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,r);break;case e.checklist:n.checkList._build(i,l,r);break;case e.changepage:n.paging._changePage(a);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,r=s.slcId,a=s.pgIndex,n=this.Cpt;this.loader||this.statusBar?(this.loader&&n.loader.show(""),this.statusBar&&n.statusBar.message(this["msg"+t]),S.setTimeout(e.bind(this),this.execDelay)):e.call(this)}},{key:"initExtensions",value:function(){for(var t=this.extensions,e=0;es;s++){var l=t[s],r=l.name,a=l.path;r&&!a?a=this.themesPath+r+"/"+r+".css":!r&&l.path&&(r="theme{0}".replace("{0}",s)),this.isImported(a,"link")||this["import"](r,a,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,s=this.ExtRegistry;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.sort&&s.sort.destroy(),this.loader&&e.loader.destroy(),this.popUpFilters&&e.popupFilter.destroy(),this.markActiveColumns&&this.clearActiveColumns(),s.advancedGrid&&s.advancedGrid.destroy();for(var i=this.refRow;is;s++){var i=t[s],l=n.Dom.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:"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;lr):V?(n=F(t.replace(p,""),N),i=n>=r):j?(n=F(t.replace(d,""),N),i=r>=n):U?(n=F(t.replace(g,""),N),i=r>n):G?(n=F(t.replace(v,""),N),i=r.toString()!=n.toString()):K?(n=F(t.replace(C,""),N),i=r.toString()==n.toString()):m.test(t)?i=this._containsStr(t.replace(m,""),e,null,!1):D(t,N)?(n=F(t,N),i=r.toString()==n.toString()):O?i=o.Str.isEmpty(e):B&&(i=!o.Str.isEmpty(e));else if(this.hasColNbFormat&&this.colNbFormat[s]?(a=c(e,this.colNbFormat[s]),h=this.colNbFormat[s]):","===this.thousandsSeparator&&"."===this.decimalSeparator?(a=c(e,"us"),h="us"):(a=c(e,"eu"),h="eu"),k)i=a<=c(t.replace(p,""),h);else if(R)i=a>=c(t.replace(d,""),h);else if(T)i=ac(t.replace(g,""),h);else if(S)i=this._containsStr(t.replace(v,""),e)?!1:!0;else if(E)i=this._containsStr(t.replace(m,""),e,null,!1);else if(P)i=this._containsStr(t.replace(C,""),e,null,!0);else if(L)i=0===e.indexOf(t.replace(b,""))?!0:!1;else if(A){var W=t.replace(_,"");i=e.lastIndexOf(W,e.length-1)===e.length-1-(W.length-1)&&e.lastIndexOf(W,e.length-1)>-1?!0:!1}else if(O)i=o.Str.isEmpty(e);else if(B)i=!o.Str.isEmpty(e);else if(M)try{var $=t.replace(x,""),q=new RegExp($);i=q.test(e)}catch(z){i=!1}else{var Y=l["col_"+s];i=this._containsStr(t,e,Y?Y: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,r=0;this.validRowsIndex=[],this.highlightKeywords&&i.highlightKeyword.unhighlightAll(),this.popUpFilters&&i.popupFilter.buildIcons(),this.markActiveColumns&&this.clearActiveColumns(),this.searchArgs=this.getFiltersValue();for(var a,h,p=new RegExp(this.leOperator),d=new RegExp(this.geOperator),f=new RegExp(this.lwOperator),g=new RegExp(this.grOperator),v=new RegExp(this.dfOperator),m=new RegExp(o.Str.rgxEsc(this.lkOperator)),C=new RegExp(this.eqOperator),b=new RegExp(this.stOperator),_=new RegExp(this.enOperator),y=this.emOperator,w=this.nmOperator,x=new RegExp(o.Str.rgxEsc(this.rgxOperator)),T=this.refRow;TE;E++){var L=this.searchArgs[this.singleSearchFlt?0:E],N=this.hasColDateType?this.colDateType[E]:this.defaultDateType;if(""!==L){var A=o.Str.matchCase(this.getCellData(E,k[E]),this.caseSensitive),O=L.split(this.orOperator),B=O.length>1?!0:!1,M=L.split(this.anOperator),H=M.length>1?!0:!1;if(B||H){for(var V,U=!1,j=B?O:M,G=0;Gd;d++)if(d===t&&""===i[r].style.display){var f=o.Str.lower(this.getCellData(d,n[d])),g=this.colNbFormat?this.colNbFormat[t]:null,v=e?u.Helpers.removeNbFormat(f,g):f;l.push(v)}}return l}}},{key:"getFilterValue",value:function(t){if(this.fltGrid){ +var e,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;lp;p++){var d=n.Dom.tag(s,"li")[p],u=n.Dom.tag(d,"label")[0],f=n.Dom.tag(d,"input")[0],g=o.Str.matchCase(n.Dom.getText(u),this.caseSensitive);""!==g&&c.Arr.has(a,g,!0)?(f.checked=!0,this.Cpt.checkList.setCheckListValues(f)):(f.checked=!1,this.Cpt.checkList.setCheckListValues(f))}}}}},{key:"setColWidths",value:function(t){function e(t){if((i||i.nbCells==i.colWidth.length)&&i.nbCells==t.cells.length)for(var e=0;e]+>/g,"");return e=e.replace(/^\s+/,"").replace(/\s+$/,"")},l.create=function(t){if(t&&""!==t){var e=document.createElement(t),s=arguments;if(s.length>1)for(var i=0;i0){var i=document.cookie,l=i.indexOf(s);if(-1!==l){l+=s.length;var r=i.indexOf(";",l);-1===r&&(r=i.length),e=unescape(i.substring(l,r))}}return e},i.remove=function(t){this.write(t,"",-1)},i.valueToArray=function(t,e){e||(e=",");var s=this.read(t),i=s.split(e);return i},i.getValueByIndex=function(t,e,s){s||(s=",");var i=this.valueToArray(t,s);return i[e]},e.Cookie=i},function(t,e,s){"use strict";var i={},l=void 0;i.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},i.isFn=function(t){return t&&t.constructor==Function},i.isArray=function(t){return t&&t.constructor==Array},i.isUndef=function(t){return t===l},e.Types=i},function(t,e,s){"use strict";var i=s(4),l={has:function(t,e,s){for(var l=void 0===s?!1:s,r=0;r2)return t;var e;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,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}var r={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,l;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 r,a,n,o=t.split(RegExp.$1);r="M"===e.substring(0,1)?o[0]:"M"===e.substring(1,2)?o[1]:o[2],a="D"===e.substring(0,1)?o[0]:"D"===e.substring(1,2)?o[1]:o[2],n="Y"===e.substring(0,1)?o[0]:"Y"===e.substring(1,2)?o[1]:o[2],parseInt(n,10)<=50&&(n=(parseInt(n,10)+2e3).toString()),parseInt(n,10)<=99&&(n=(parseInt(n,10)+1900).toString());var h=new Date(parseInt(n,10),parseInt(r,10)-1,parseInt(a,10),0,0,0,0);return parseInt(a,10)!=h.getDate()?!1:parseInt(r,10)-1!=h.getMonth()?!1:!0},format:function(t){function e(e,s){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(t,e){if(e||(e="DMY"),!t||""===t)return new Date(1001,0,1);var s;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})};e.DateHelper=r},function(t,e,s){"use strict";var i=s(4),l={isIE:function(){return/msie|MSIE/.test(navigator.userAgent)},removeNbFormat:function(t,e){if(t){e||(e="us");var s=t;return s="us"===i.Str.lower(e)?+s.replace(/[^\d\.-]/g,""):+s.replace(/[^\d\,-]/g,"").replace(",",".")}}};e.Helpers=l},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=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",n.Event.add(this.tblCont,"scroll",function(e){var s=n.Event.target(e),i=s.scrollLeft;t.headTblCont.scrollLeft=i}),s.sort!==!1&&(e.sort=!0,e.sortConfig.asyncSort=!0,e.sortConfig.triggerIds=v),this.gridEnableColResizer&&(e.hasExtensions?e._containsStr("colsresizer",Str.lower(e.extensions.src.toString()))||(e.extensions.name.push("ColumnsResizer_"+e.id),e.extensions.src.push(e.gridColResizerPath),e.extensions.description.push("Columns Resizing"),e.extensions.initialize.push(function(t){t.SetColsResizer("ColumnsResizer_"+t.id)})):(e.extensions={name:["ColumnsResizer_"+e.id],src:[this.gridColResizerPath],description:["Columns Resizing"],initialize:[function(t){t.SetColsResizer("ColumnsResizer_"+t.id)}]},e.hasExtensions=!0)),s.col_resizer_cols_headers_table=this.headTbl.getAttribute("id"),s.col_resizer_cols_headers_index=this.gridHeadRowIndex,s.col_resizer_width_adjustment=0,s.col_enable_text_ellipsis=!1,this.tblHasColTag=r.Dom.tag(i,"col").length>0?!0:!1;var R=function(t){if(t){for(var s=e.nbCells-1;s>=0;s--){var l=r.Dom.create("col",["id",e.id+"_col_"+s]);i.firstChild.parentNode.insertBefore(l,i.firstChild),l.style.width=e.colWidth[s],t.gridColElms[s]=l}t.tblHasColTag=!0}};if(this.tblHasColTag)for(var S=r.Dom.tag(i,"col"),D=0;D',this.popUpDivCssClass=s.popup_div_css_class||"popUpFilter",this.onBeforePopUpOpen=r.Types.isFn(s.on_before_popup_filter_open)?s.on_before_popup_filter_open:null,this.onAfterPopUpOpen=r.Types.isFn(s.on_after_popup_filter_open)?s.on_after_popup_filter_open:null,this.onBeforePopUpClose=r.Types.isFn(s.on_before_popup_filter_close)?s.on_before_popup_filter_close:null,this.onAfterPopUpClose=r.Types.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 l(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 r=this.popUpFltElms[l],h=this.tf.getHeaderElement(l),p=.95*h.clientWidth;if(o.Helpers.isIE()){var c=a.Dom.position(h).left;r.style.left=c+"px"}r.style.width=parseInt(p,10)+"px"}n.Event.cancel(s),n.Event.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&&(""===c[C].style.display&&!l.paging||l.paging&&(!l.validRowsIndex||l.validRowsIndex&&a.Arr.has(l.validRowsIndex,C))&&(void 0===u||u==t||u!=t&&a.Arr.has(l.validRowsIndex,C)))){var w=l.getCellData(y,b[y]),x=n.Str.matchCase(w,d);if(a.Arr.has(this.opts,x,d)||this.opts.push(w),e&&l.disableExcludedOptions){var T=m[y];T||(T=this.GetFilteredDataCol(y)),a.Arr.has(T,x,d)||a.Arr.has(v,x,d)||this.isFirstLoad||v.push(w)}}}if(this.isCustom){var k=l.__getCustomValues(t);this.opts=k[0],this.optsTxt=k[1]}if(l.sortSlc&&!this.isCustom&&(d?(this.opts.sort(),v&&v.sort()):(this.opts.sort(o.Sort.ignoreCase),v&&v.sort(o.Sort.ignoreCase))),l.sortNumAsc&&a.Arr.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&&a.Arr.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,p,e,v,f,g)}}},{key:"addOptions",value:function(t,e,s,i,l,o){var h=this.tf,p=n.Str.lower(this.slcFillingMethod),c=e.value;e.innerHTML="",e=this.addFirstOption(e);for(var d=0;d"+f+""}else{var m;m=h.fillSlcOnDemand&&c===this.opts[d]&&h["col"+t]===h.fltTypeSlc?r.Dom.createOpt(f,u,!0):h["col"+t]!==h.fltTypeMulti?r.Dom.createOpt(f,u," "!==l[t]&&u===l[t]?!0:!1):r.Dom.createOpt(f,u,a.Arr.has(o,n.Str.matchCase(this.opts[d],h.matchCase),h.matchCase)||-1!==o.toString().indexOf(u)?!0:!1),g&&(m.disabled=!0),e.appendChild(m)}}"innerhtml"===p&&(e.innerHTML+=this.slcInnerHtml),e.setAttribute("filled","1")}},{key:"addFirstOption",value:function(t){var e=this.tf,s=n.Str.lower(this.slcFillingMethod);if("innerhtml"===s)this.slcInnerHtml+='";else{var i=r.Dom.createOpt(this.enableSlcResetFilter?e.displayAllText:"","");if(this.enableSlcResetFilter||(i.style.display="none"),t.appendChild(i),e.enableEmptyOption){var l=r.Dom.createOpt(e.emptyText,e.emOperator);t.appendChild(l)}if(e.enableNonEmptyOption){var a=r.Dom.createOpt(e.nonEmptyText,e.nmOperator);t.appendChild(a)}}return t}}]),t}();e.Dropdown=h},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s_;_++)if(t===_&&(!l.refreshFilters||l.refreshFilters&&l.disableExcludedOptions)||t===_&&l.refreshFilters&&(""===u[m].style.display&&!l.paging||l.paging&&(!f||f===t||f!=t&&a.Arr.has(l.validRowsIndex,m)))){var y=l.getCellData(_,C[_]),w=n.Str.matchCase(y,l.matchCase);a.Arr.has(this.opts,w,l.matchCase)||this.opts.push(y);var x=v[_];l.refreshFilters&&l.disableExcludedOptions&&(x||(v[_]=l.GetFilteredDataCol(_)),a.Arr.has(x,w,l.matchCase)||a.Arr.has(g,w,l.matchCase)||l.isFirstLoad||g.push(y))}}if(this.isCustom){var T=l.__getCustomValues(t);this.opts=T[0],this.optsTxt=T[1]}if(l.sortSlc&&!this.isCustom&&(l.matchCase?(this.opts.sort(),g&&g.sort()):(this.opts.sort(o.Sort.ignoreCase),g&&g.sort(o.Sort.ignoreCase))),l.sortNumAsc&&a.Arr.has(l.sortNumAsc,t))try{this.opts.sort(numSortAsc),g&&g.sort(numSortAsc),this.isCustom&&this.optsTxt.sort(numSortAsc)}catch(k){this.opts.sort(),g&&g.sort(),this.isCustom&&this.optsTxt.sort()}if(l.sortNumDesc&&a.Arr.has(l.sortNumDesc,t))try{this.opts.sort(numSortDesc),g&&g.sort(numSortDesc),this.isCustom&&this.optsTxt.sort(numSortDesc)}catch(k){this.opts.sort(),g&&g.sort(),this.isCustom&&this.optsTxt.sort()}this.addChecks(t,d,l.separator),l.fillSlcOnDemand&&(c.innerHTML=""),c.appendChild(d),c.setAttribute("filled","1")}}},{key:"addChecks",value:function(t,e){var s=this,i=this.tf,l=this.addTChecks(t,e),o=[],p=i.Cpt.store,c=p?p.getFilterValues(i.fltsValuesCookie)[t]:null;c&&n.Str.trim(c).length>0&&(i.hasCustomSlcOptions&&a.Arr.has(i.customSlcOptions.cols,t)?o.push(c):o=c.split(" "+i.orOperator+" "));for(var d=0;d0?1:0),r=l+i.pagingLength-1<=e.nbVisibleRows?l+i.pagingLength-1:e.nbVisibleRows;s=l+this.fromToTextSeparator+r+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?n.Helpers.isIE()?this.rowsCounterDiv.outerHTML="":this.rowsCounterDiv.parentNode.removeChild(this.rowsCounterDiv):r.Dom.id(this.rowsCounterTgtId).innerHTML="",this.rowsCounterSpan=null,this.rowsCounterDiv=null)}}]),t}();e.RowsCounter=o},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=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=a.Types.isFn(s.on_before_change_page)?s.on_before_change_page:null,this.onAfterChangePage=a.Types.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 l=this.refRow,r=this.nbRows;this.nbPages=Math.ceil((r-l)/this.pagingLength);var n=this;this.evt={slcIndex:function(){return n.pageSelectorType===e.fltTypeSlc?n.pagingSlc.options.selectedIndex:parseInt(n.pagingSlc.value,10)-1},nbOpts:function(){return n.pageSelectorType===e.fltTypeSlc?parseInt(n.pagingSlc.options.length,10)-1:n.nbPages-1},next:function(){var t=n.evt.slcIndex()0?n.evt.slcIndex()-1:n.evt.nbOpts();n.changePage(t)},last:function(){n.changePage(n.evt.nbOpts())},first:function(){n.changePage(0)},_detectKey:function(t){var s=o.Event.keyCode(t);13===s&&(e.sorted?(e.filter(),n.changePage(n.evt.slcIndex())):n.changePage(),this.blur())},slcPagesChange:null,nextEvt:null,prevEvt:null,lastEvt:null,firstEvt:null},this.tf=e}return l(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=r.Dom.create(s.fltTypeSlc,["id",this.prfxSlcPages+s.id]),t.className=this.pgSlcCssClass,o.Event.add(t,"change",i.slcPagesChange)),this.pageSelectorType===s.fltTypeInp&&(t=r.Dom.create(s.fltTypeInp,["id",this.prfxSlcPages+s.id],["value",this.currentPageNb]),t.className=this.pgInpCssClass,o.Event.add(t,"keypress",i._detectKey));var l=r.Dom.create("span",["id",this.prfxBtnNextSpan+s.id]),a=r.Dom.create("span",["id",this.prfxBtnPrevSpan+s.id]),n=r.Dom.create("span",["id",this.prfxBtnLastSpan+s.id]),h=r.Dom.create("span",["id",this.prfxBtnFirstSpan+s.id]);if(this.hasPagingBtns){if(this.btnNextPageHtml)l.innerHTML=this.btnNextPageHtml,o.Event.add(l,"click",i.next);else{var p=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnNext+s.id],["type","button"],["value",this.btnNextPageText],["title","Next"]);p.className=this.btnPageCssClass,o.Event.add(p,"click",i.next),l.appendChild(p)}if(this.btnPrevPageHtml)a.innerHTML=this.btnPrevPageHtml,o.Event.add(a,"click",i.prev);else{var c=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnPrev+s.id],["type","button"],["value",this.btnPrevPageText],["title","Previous"]);c.className=this.btnPageCssClass,o.Event.add(c,"click",i.prev),a.appendChild(c)}if(this.btnLastPageHtml)n.innerHTML=this.btnLastPageHtml,o.Event.add(n,"click",i.last);else{var d=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnLast+s.id],["type","button"],["value",this.btnLastPageText],["title","Last"]);d.className=this.btnPageCssClass,o.Event.add(d,"click",i.last),n.appendChild(d)}if(this.btnFirstPageHtml)h.innerHTML=this.btnFirstPageHtml,o.Event.add(h,"click",i.first);else{var u=r.Dom.create(s.fltTypeInp,["id",this.prfxBtnFirst+s.id],["type","button"],["value",this.btnFirstPageText],["title","First"]);u.className=this.btnPageCssClass,o.Event.add(u,"click",i.first),h.appendChild(u)}}this.pagingTgtId||s.setToolbar();var f=this.pagingTgtId?r.Dom.id(this.pagingTgtId):s.mDiv;f.appendChild(h),f.appendChild(a);var g=r.Dom.create("span",["id",this.prfxPgBeforeSpan+s.id]);g.appendChild(r.Dom.text(this.pageText)),g.className=this.nbPgSpanCssClass,f.appendChild(g),f.appendChild(t);var v=r.Dom.create("span",["id",this.prfxPgAfterSpan+s.id]);v.appendChild(r.Dom.text(this.ofText)),v.className=this.nbPgSpanCssClass,f.appendChild(v);var m=r.Dom.create("span",["id",this.prfxPgSpan+s.id]);m.className=this.nbPgSpanCssClass,m.appendChild(r.Dom.text(" "+this.nbPages+" ")),f.appendChild(m),f.appendChild(l),f.appendChild(n),this.pagingSlc=r.Dom.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?r.Dom.id(this.pagingTgtId):e.mDiv,l=r.Dom.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"!==r.getAttribute("validRow")&&r.getAttribute("validRow")||(r.style.display=""),e.alternateBgs&&e.Cpt.alternateRows&&e.Cpt.alternateRows.setRowBg(e.validRowsIndex[l],l)):(r.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(n.Str.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=r.Dom.create(e.fltTypeSlc,["id",this.prfxSlcResults+e.id]);i.className=e.resultsSlcCssClass;var l=this.resultsPerPage[0],a=this.resultsPerPage[1],n=r.Dom.create("span",["id",this.prfxSlcResultsTxt+e.id]);n.className=this.resultsSpanCssClass,this.resultsPerPageTgtId||e.setToolbar();var h=this.resultsPerPageTgtId?r.Dom.id(this.resultsPerPageTgtId):e.rDiv;n.appendChild(r.Dom.text(l)),h.appendChild(n),h.appendChild(i),this.resultsPerPageSlc=r.Dom.id(this.prfxSlcResults+e.id);for(var p=0;p=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,n,h;e=r.Dom.id(this.prfxBtnNextSpan+t.id),s=r.Dom.id(this.prfxBtnPrevSpan+t.id),i=r.Dom.id(this.prfxBtnLastSpan+t.id),l=r.Dom.id(this.prfxBtnFirstSpan+t.id),a=r.Dom.id(this.prfxPgBeforeSpan+t.id),n=r.Dom.id(this.prfxPgAfterSpan+t.id),h=r.Dom.id(this.prfxPgSpan+t.id);var p=this.evt;this.pagingSlc&&(this.pageSelectorType===t.fltTypeSlc?o.Event.remove(this.pagingSlc,"change",p.slcPagesChange):this.pageSelectorType===t.fltTypeInp&&o.Event.remove(this.pagingSlc,"keypress",p._detectKey),this.pagingSlc.parentNode.removeChild(this.pagingSlc)),e&&(o.Event.remove(e,"click",p.next),e.parentNode.removeChild(e)),s&&(o.Event.remove(s,"click",p.prev),s.parentNode.removeChild(s)),i&&(o.Event.remove(i,"click",p.last),i.parentNode.removeChild(i)),l&&(o.Event.remove(l,"click",p.first),l.parentNode.removeChild(l)),a&&a.parentNode.removeChild(a),n&&n.parentNode.removeChild(n),h&&h.parentNode.removeChild(h),this.hasResultsPerPage&&this.removeResultsPerPage(),this.pagingSlc=null,this.nbPages=0,this.isPagingRemoved=!0,t.paging=!1}}}]),t}();e.Paging=h},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;s':null),this.prfxResetSpan="resetspan_",this.tf=e}return l(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=r.Dom.create("span",["id",this.prfxResetSpan+e.id]);this.btnResetTgtId||e.setToolbar();var i=this.btnResetTgtId?r.Dom.id(this.btnResetTgtId):e.rDiv;if(i.appendChild(s),this.btnResetHtml){s.innerHTML=this.btnResetHtml;var l=s.firstChild;a.Event.add(l,"click",function(){t.onClick()})}else{var n=r.Dom.create("a",["href","javascript:void(0);"]);n.className=e.btnResetCssClass,n.appendChild(r.Dom.text(this.btnResetText)),s.appendChild(n),a.Event.add(n,"click",function(){t.onClick()})}this.btnResetEl=s.firstChild}}},{key:"destroy",value:function(){var t=this.tf;if(t.hasGrid()&&this.btnResetEl){var e=r.Dom.id(t.prfxResetSpan+t.id);e&&e.parentNode.removeChild(e),this.btnResetEl=null}}}]),t}();e.ClearButton=n},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=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 l(t,[{key:"init",value:function(){var t=this;if(!this.helpInstrBtnEl){var e=this.tf,s=r.Dom.create("span",["id",this.prfxHelpSpan+e.id]),i=r.Dom.create("div",["id",this.prfxHelpDiv+e.id]);this.helpInstrTgtId||e.setToolbar();var l=this.helpInstrTgtId?r.Dom.id(this.helpInstrTgtId):e.rDiv;l.appendChild(s);var n=this.helpInstrContTgtId?r.Dom.id(this.helpInstrContTgtId):s;if(this.helpInstrBtnHtml){s.innerHTML=this.helpInstrBtnHtml;var o=s.firstChild;a.Event.add(o,"click",function(){t.toggle()}),n.appendChild(i)}else{n.appendChild(i);var h=r.Dom.create("a",["href","javascript:void(0);"]);h.className=this.helpInstrBtnCssClass,h.appendChild(r.Dom.text(this.helpInstrBtnText)),s.appendChild(h),a.Event.add(h,"click",function(){t.toggle()})}this.helpInstrHtml?(this.helpInstrContTgtId&&n.appendChild(i),i.innerHTML=this.helpInstrHtml,this.helpInstrContTgtId||(i.className=this.helpInstrContCssClass,a.Event.add(i,"dblclick",function(){t.toggle()}))):(i.innerHTML=this.helpInstrText,i.className=this.helpInstrContCssClass,a.Event.add(i,"dblclick",function(){t.toggle()})),i.innerHTML+=this.helpInstrDefaultHtml,a.Event.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=r.Dom.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=n},function(t,e,s){"use strict";var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},l=function(){function t(t,e){for(var s=0;sl;l++){var r=t?l:this.tf.validRowsIndex[l];this.setRowBg(r,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),r.Dom.addClass(s[t],i%2?this.evenCss:this.oddCss)}}},{key:"removeRowBg",value:function(t){if(!isNaN(t)){var e=this.tf.tbl.rows;r.Dom.removeClass(e[t],this.oddCss),r.Dom.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"==_Str.Str.lower(typeof labelId)&&"object"==_Str.Str.lower(typeof colIndex)&&"object"==_Str.Str.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),_Dom.Dom.id(labThisCol[i]))switch(_Str.Str.lower(oTypeThisCol)){case"innerhtml":isNaN(result)||!isFinite(result)||0===nbvalues?_Dom.Dom.id(labThisCol[i]).innerHTML=".":_Dom.Dom.id(labThisCol[i]).innerHTML=result;break;case"setvalue":_Dom.Dom.id(labThisCol[i]).value=result;break;case"createtextnode":var oldnode=_Dom.Dom.id(labThisCol[i]).firstChild,txtnode=_Dom.Dom.text(result);_Dom.Dom.id(labThisCol[i]).replaceChild(txtnode,oldnode)}}else try{isNaN(result)||!isFinite(result)||0===nbvalues?_Dom.Dom.id(labThisCol[i]).innerHTML=".":_Dom.Dom.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=s(4),l={ignoreCase:function(t,e){var s=i.Str.lower(t),l=i.Str.lower(e);return l>s?-1:s>l?1:0}};e.Sort=l}])}); \ No newline at end of file diff --git a/src-es6/event.js b/src-es6/event.js index e308a1d1..b11a68cd 100644 --- a/src-es6/event.js +++ b/src-es6/event.js @@ -2,7 +2,7 @@ * DOM event utilities */ -var Event = { +export var Event = { add(obj, type, func, capture){ if(obj.addEventListener){ obj.addEventListener(type, func, capture); @@ -51,5 +51,3 @@ var Event = { (evt.keyCode ? evt.keyCode: (evt.which ? evt.which : 0)); } }; - -exports.Event = Event; diff --git a/src-es6/tablefilter.js b/src-es6/tablefilter.js index eb87e0cf..cf867890 100644 --- a/src-es6/tablefilter.js +++ b/src-es6/tablefilter.js @@ -226,7 +226,7 @@ export class TableFilter{ this.onAfterFilter = types.isFn(f.on_after_filter) ? f.on_after_filter : null; //enables/disables case sensitivity - this.matchCase = f.match_case===true ? true : false; + this.caseSensitive = f.case_sensitive===true ? true : false; //enables/disbles exact match for search this.exactMatch = f.exact_match===true ? true : false; //refreshes drop-down lists upon validation @@ -562,19 +562,19 @@ export class TableFilter{ =====================================================*/ detectKey(e) { if(!o.enterKey){ return; } - var _evt = e || global.event; - if(_evt){ - var key = evt.keyCode(_evt); + var _ev = e || global.event; + if(_ev){ + var key = evt.keyCode(_ev); if(key===13){ o._filter(); - evt.cancel(_evt); - evt.stop(_evt); + evt.cancel(_ev); + evt.stop(_ev); } else { o.isUserTyping = true; global.clearInterval(o.onKeyUpTimer); o.onKeyUpTimer = undefined; } - }//if evt + } }, /*==================================================== - onkeyup event for text filters @@ -583,8 +583,8 @@ export class TableFilter{ if(!o.onKeyUp){ return; } - var _evt = e || global.event; - var key = evt.keyCode(_evt); + var _ev = e || global.event; + var key = evt.keyCode(_ev); o.isUserTyping = false; function filter() { @@ -634,12 +634,12 @@ export class TableFilter{ - onfocus event for input filters =====================================================*/ onInpFocus(e) { - var _evt = e || global.event; + var _ev = e || global.event; o.activeFilterId = this.getAttribute('id'); o.activeFlt = dom.id(o.activeFilterId); if(o.popUpFilters){ - evt.cancel(_evt); - evt.stop(_evt); + evt.cancel(_ev); + evt.stop(_ev); } // if(o.ezEditTable){ // if(o.editable){ @@ -654,7 +654,7 @@ export class TableFilter{ - onfocus event for select filters =====================================================*/ onSlcFocus(e) { - var _evt = e || global.event; + var _ev = e || global.event; o.activeFilterId = this.getAttribute('id'); o.activeFlt = dom.id(o.activeFilterId); // select is populated when element has focus @@ -663,8 +663,8 @@ export class TableFilter{ o.Cpt.dropdown._build(ct); } if(o.popUpFilters){ - evt.cancel(_evt); - evt.stop(_evt); + evt.cancel(_ev); + evt.stop(_ev); } }, /*==================================================== @@ -677,8 +677,8 @@ export class TableFilter{ // if(o.activeFlt && colIndex && // o['col'+colIndex]===o.fltTypeCheckList && // !o.Evt.onSlcChange.caller){ return; } - var _evt = e || global.event; - if(o.popUpFilters){ evt.stop(_evt); } + var _ev = e || global.event; + if(o.popUpFilters){ evt.stop(_ev); } if(o.onSlcChange){ o.filter(); } }, /*==================================================== @@ -879,9 +879,6 @@ export class TableFilter{ //drop-down filters if(col===this.fltTypeSlc || col===this.fltTypeMulti){ if(!this.Cpt.dropdown){ - // var Dropdown = - // require('modules/dropdown').Dropdown; - // import {Dropdown} from 'modules/dropdown'; this.Cpt.dropdown = new Dropdown(this); } var dropdown = this.Cpt.dropdown; @@ -928,9 +925,6 @@ export class TableFilter{ else if(col===this.fltTypeCheckList){ var checkList; if(!this.Cpt.checkList){ - // var CheckList = - // require('modules/checkList').CheckList; - // import {CheckList} from 'modules/checkList'; this.Cpt.checkList = new CheckList(this); checkList = this.Cpt.checkList; } @@ -990,16 +984,16 @@ export class TableFilter{ this.fltIds.push(this.prfxFlt+i+'_'+this.id); - inp.onkeypress = this.Evt.detectKey; - inp.onkeydown = this.Evt.onKeyDown; - inp.onkeyup = this.Evt.onKeyUp; - inp.onblur = this.Evt.onInpBlur; + evt.add(inp, 'keypress', this.Evt.detectKey); + evt.add(inp, 'keydown', this.Evt.onKeyDown); + evt.add(inp, 'keyup', this.Evt.onKeyUp); + evt.add(inp, 'blur', this.Evt.onInpBlur); if(this.rememberGridValues){ var flts_values = this.Cpt.store.getFilterValues( this.fltsValuesCookie); if(flts_values[i]!=' '){ - this.setFilterValue(i,flts_values[i],false); + this.setFilterValue(i, flts_values[i], false); } } } @@ -1164,7 +1158,6 @@ export class TableFilter{ cpt.paging._resetPageLength(this.pgLenCookie); break; case ev.sort: - void(0); break; case ev.loadextensions: this._loadExtensions(); @@ -1678,9 +1671,9 @@ export class TableFilter{ } /** - * Filter the table by retrieving the data from each td in every single tr - * and comparing it to the search term for current column. A tr is hidden - * when all search terms are not found + * Filter the table by retrieving the data from each cell in every single + * row and comparing it to the search term for current column. A row is + * hidden when all the search terms are not found in current row. */ _filter(){ if(!this.fltGrid || (!this._hasGrid && !this.isFirstLoad)){ @@ -1956,7 +1949,7 @@ export class TableFilter{ } var cell_data = str.matchCase( - this.getCellData(j, cell[j]), this.matchCase); + this.getCellData(j, cell[j]), this.caseSensitive); //multiple search parameter operator || var sAOrSplit = sA.split(this.orOperator), @@ -2202,7 +2195,7 @@ export class TableFilter{ for(var i=0; i + + + + TableFilter always visible rows tests + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FromDestinationRoad Distance (km)By Air (hrs)By Rail (hrs)
SydneyAdelaide14121.425.3
SydneyBrisbane9821.516
Always visible row
SydneyCanberra286.64.3
SydneyMelbourne8721.110.5
AdelaidePerth27813.138
AdelaideAlice Springs1533220.25
Always visible row
AdelaideBrisbane20452.1540
+ + + + +
+
+ + \ No newline at end of file diff --git a/test/test-always-visible-rows.js b/test/test-always-visible-rows.js new file mode 100644 index 00000000..8aad5c2a --- /dev/null +++ b/test/test-always-visible-rows.js @@ -0,0 +1,48 @@ +(function(win, TableFilter){ + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + rows_always_visible: [4, 9] + }); + tf.init(); + + module('Sanity checks'); + test('Always visible rows', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter type'); + deepEqual(tf.hasVisibleRows, true, 'Contains always visible rows'); + }); + + module('Behaviour'); + tf.setFilterValue(0, 'Hello'); + tf.filter(); + test('for filtered table', function() { + var alwaysVisibleRow1 = tf.tbl.rows[4]; + var alwaysVisibleRow2 = tf.tbl.rows[9]; + deepEqual( + tf.getRowDisplay(alwaysVisibleRow1), + '', + 'Row display for alwaysVisibleRow1' + ); + deepEqual( + tf.getRowDisplay(alwaysVisibleRow2), + '', + 'Row display for alwaysVisibleRow2' + ); + }); + + tf.clearFilters(); + test('after filters are cleared', function() { + var alwaysVisibleRow1 = tf.tbl.rows[4]; + var alwaysVisibleRow2 = tf.tbl.rows[9]; + deepEqual( + tf.getRowDisplay(alwaysVisibleRow1), + '', + 'Row display for alwaysVisibleRow1' + ); + deepEqual( + tf.getRowDisplay(alwaysVisibleRow2), + '', + 'Row display for alwaysVisibleRow2' + ); + }); + +})(window, TableFilter); diff --git a/test/test-case-sensitive-query.html b/test/test-case-sensitive-query.html new file mode 100644 index 00000000..8827eabc --- /dev/null +++ b/test/test-case-sensitive-query.html @@ -0,0 +1,77 @@ + + + + + TableFilter case sensitive query 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
+ + + + +
+
+ + \ No newline at end of file diff --git a/test/test-case-sensitive-query.js b/test/test-case-sensitive-query.js new file mode 100644 index 00000000..b6db8d7e --- /dev/null +++ b/test/test-case-sensitive-query.js @@ -0,0 +1,39 @@ +(function(win, TableFilter){ + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + case_sensitive: true + }); + tf.init(); + + module('Sanity checks'); + test('Enable case sensitive query match', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter type'); + deepEqual(tf.caseSensitive, true, 'Case sensitive query match enabled'); + }); + + module('Behaviour'); + test('After filtering with `sydney`', function() { + tf.setFilterValue(0, 'sydney'); + tf._filter(); + deepEqual(tf.getValidRows().length, 0, 'No matches'); + }); + + test('After filtering with `Sydney`', function() { + tf.setFilterValue(0, 'Sydney'); + tf._filter(); + deepEqual(tf.getValidRows().length>0, true, 'Matches'); + }); + + test('After filtering with `ade`', function() { + tf.setFilterValue(0, 'ade'); + tf._filter(); + deepEqual(tf.getValidRows().length, 0, 'No matches'); + }); + + test('After filtering with `Ade`', function() { + tf.setFilterValue(0, 'Ade'); + tf._filter(); + deepEqual(tf.getValidRows().length>0, true, 'Matches'); + }); + +})(window, TableFilter); diff --git a/test/test-disable-enter-key.html b/test/test-disable-enter-key.html new file mode 100644 index 00000000..960de5d6 --- /dev/null +++ b/test/test-disable-enter-key.html @@ -0,0 +1,77 @@ + + + + + TableFilter disable enter key 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
+ + + + +
+
+ + \ No newline at end of file diff --git a/test/test-disable-enter-key.js b/test/test-disable-enter-key.js new file mode 100644 index 00000000..4beed10d --- /dev/null +++ b/test/test-disable-enter-key.js @@ -0,0 +1,14 @@ +(function(win, TableFilter){ + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + enter_key: false + }); + tf.init(); + + module('Sanity checks'); + test('Disable enter key on textbox filters', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter type'); + deepEqual(tf.enterKey, false, ' key disabled'); + }); + +})(window, TableFilter); diff --git a/test/test-exact-query-match.html b/test/test-exact-query-match.html new file mode 100644 index 00000000..fa432111 --- /dev/null +++ b/test/test-exact-query-match.html @@ -0,0 +1,77 @@ + + + + + TableFilter enable exact query match 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
+ + + + +
+
+ + \ No newline at end of file diff --git a/test/test-exact-query-match.js b/test/test-exact-query-match.js new file mode 100644 index 00000000..aff8c347 --- /dev/null +++ b/test/test-exact-query-match.js @@ -0,0 +1,27 @@ +(function(win, TableFilter){ + var tf = new TableFilter('demo', { + base_path: '../dist/tablefilter/', + exact_match: true + }); + tf.init(); + + module('Sanity checks'); + test('Enable exact query match', function() { + deepEqual(tf instanceof TableFilter, true, 'TableFilter type'); + deepEqual(tf.exactMatch, true, 'Exact query match enable'); + }); + + module('Behaviour'); + test('After filtering with `syd`', function() { + tf.setFilterValue(0, 'syd'); + tf._filter(); + deepEqual(tf.getValidRows().length, 0, 'No matches'); + }); + + test('After filtering with `sydney`', function() { + tf.setFilterValue(0, 'sydney'); + tf._filter(); + deepEqual(tf.getValidRows().length>0, true, 'Matches'); + }); + +})(window, TableFilter); diff --git a/test/test-sort-custom-sorter.js b/test/test-sort-custom-sorter.js index d516294e..27b8b0c7 100644 --- a/test/test-sort-custom-sorter.js +++ b/test/test-sort-custom-sorter.js @@ -42,7 +42,7 @@ function startTest(tf, sort){ test('Sort UI elements', function() { var th = tf.getHeaderElement(0), indicator = tag(th, 'img'), - validRows = tf.getValidRowsIndex(true); + validRows = tf.getValidRows(true); deepEqual(indicator.length, 1, 'Sort indicator in header element'); deepEqual( @@ -53,7 +53,7 @@ function startTest(tf, sort){ test('Sort behaviour', function() { var th = tf.getHeaderElement(1), - validRows = tf.getValidRowsIndex(); + validRows = tf.getValidRows(); sort.sortByColumnIndex(1); deepEqual(sort.sorted, true, 'Table column sorted'); diff --git a/test/test-sort-key.js b/test/test-sort-key.js index ca804b88..5bdf5f3c 100644 --- a/test/test-sort-key.js +++ b/test/test-sort-key.js @@ -34,7 +34,7 @@ function start(tf, sort){ test('Sort UI elements', function() { var th = tf.getHeaderElement(0), indicator = tag(th, 'img'), - validRows = tf.getValidRowsIndex(true); + validRows = tf.getValidRows(true); deepEqual(indicator.length, 1, 'Sort indicator in header element'); deepEqual( @@ -45,7 +45,7 @@ function start(tf, sort){ test('Sort behaviour', function() { var th = tf.getHeaderElement(1), - validRows = tf.getValidRowsIndex(); + validRows = tf.getValidRows(); sort.sortByColumnIndex(1); deepEqual(sort.sorted, true, 'Table column sorted');