1
0
Fork 0
mirror of https://github.com/koalyptus/TableFilter.git synced 2024-05-17 22:06:41 +02:00
TableFilter/dist/tablefilter/1-926cf2bd1a254bbaafde.js
2015-06-06 20:06:15 +10:00

3 lines
42 KiB
JavaScript

webpackJsonp([1],[,function(t,e,s){function i(t){return s(l(t))}function l(t){return a[t]||function(){throw new Error("Cannot find module '"+t+"'.")}()}var a={"./array":7,"./array.js":7,"./cookie":5,"./cookie.js":5,"./date":8,"./date.js":8,"./dom":3,"./dom.js":3,"./event":2,"./event.js":2,"./extensions/advancedGrid/adapterEzEditTable":25,"./extensions/advancedGrid/adapterEzEditTable.js":25,"./extensions/advancedGrid/advancedGrid":26,"./extensions/advancedGrid/advancedGrid.js":26,"./extensions/colsVisibility/colsVisibility":27,"./extensions/colsVisibility/colsVisibility.js":27,"./extensions/filtersVisibility/filtersVisibility":28,"./extensions/filtersVisibility/filtersVisibility.js":28,"./extensions/sort/adapterSortabletable":29,"./extensions/sort/adapterSortabletable.js":29,"./extensions/sort/sort":30,"./extensions/sort/sort.js":30,"./helpers":9,"./helpers.js":9,"./modules/alternateRows":22,"./modules/alternateRows.js":22,"./modules/checkList":16,"./modules/checkList.js":16,"./modules/clearButton":20,"./modules/clearButton.js":20,"./modules/colOps":23,"./modules/colOps.js":23,"./modules/dropdown":15,"./modules/dropdown.js":15,"./modules/gridLayout":11,"./modules/gridLayout.js":11,"./modules/help":21,"./modules/help.js":21,"./modules/highlightKeywords":13,"./modules/highlightKeywords.js":13,"./modules/loader":12,"./modules/loader.js":12,"./modules/paging":19,"./modules/paging.js":19,"./modules/popupFilter":14,"./modules/popupFilter.js":14,"./modules/rowsCounter":17,"./modules/rowsCounter.js":17,"./modules/statusBar":18,"./modules/statusBar.js":18,"./modules/store":10,"./modules/store.js":10,"./sort":24,"./sort.js":24,"./string":4,"./string.js":4,"./types":6,"./types.js":6};i.keys=function(){return Object.keys(a)},i.resolve=l,t.exports=i,i.id=1},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,s,i){return s&&t(e.prototype,s),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var n=s(3),r=i(n),o=s(7),h=i(o),d=function(){function t(e,s){l(this,t),this.cfg=s,this.name="ezEditTable.js",this.vendorPath=this.cfg.vendor_path||e.extensionsPath+"ezEditTable/",this.loadStylesheet=Boolean(this.cfg.loadStylesheet),this.stylesheet=this.cfg.stylesheet||this.vendorPath+"ezEditTable.css",this.stylesheetName=this.cfg.stylesheetName||"ezEditTableCss",this.err='Failed to instantiate EditTable object.\n"ezEditTable" dependency not found.',this._ezEditTable=null,this.tf=e}return a(t,[{key:"init",value:function(){var t=this,e=this.tf;if(window.EditTable)this._setAdvancedGrid();else{var s=this.vendorPath+this.name;e["import"](this.name,s,function(){t._setAdvancedGrid()})}this.loadStylesheet&&!e.isImported(this.stylesheet,"link")&&e["import"](this.stylesheetName,this.stylesheet,null,"link")}},{key:"_setAdvancedGrid",value:function(){var t,e=this.tf,s=this.cfg,i=r["default"].tag(e.tbl,"thead");t=i.length>0&&!s.startRow?void 0:s.startRow||e.refRow,s.base_path=s.base_path||e.basePath+"ezEditTable/";var l=s.editable,a=s.selectable;s.selection=a,a&&(s.default_selection=s.default_selection||"row"),s.active_cell_css=s.active_cell_css||"ezETSelectedCell";var n=0,o=0;if(a){var d=function(t,s,i){var l=t.Selection,a=function(i){if("row"===t.defaultSelection)l.SelectRowByIndex(i);else{t.ClearSelections();var a=s.cellIndex,n=e.tbl.rows[i];"both"===t.defaultSelection&&l.SelectRowByIndex(i),n&&l.SelectCell(n.cells[a])}if(e.validRowsIndex.length!==e.getRowsNb()){var r=e.tbl.rows[i];r&&r.scrollIntoView(!1),f&&(f.cellIndex===e.getCellsNb()-1&&e.gridLayout?e.tblCont.scrollLeft=1e8:0===f.cellIndex&&e.gridLayout?e.tblCont.scrollLeft=0:f.scrollIntoView(!1))}};if(e.validRowsIndex){var r,d=e.validRowsIndex,u=d.length,c="row"!==t.defaultSelection?s.parentNode:s,f="TD"===s.nodeName?s:null,p=void 0!==i?t.Event.GetKey(i):0,g=h["default"].has(d,c.rowIndex),v=34===p||33===p?e.Cpt.paging.pagingLength||t.nbRowsPerPage:1;if(g)34!==p&&33!==p?(n=h["default"].indexByValue(d,c.rowIndex),o=c.rowIndex):(r=34===p?u-1>=n+v?d[n+v]:[u-1]:n-v<=d[0]?d[0]:d[n-v],o=r,n=h["default"].indexByValue(d,r),a(r));else{if(c.rowIndex>o)if(c.rowIndex>=d[u-1])r=d[u-1];else{var b=n+v;r=b>u-1?d[u-1]:d[b]}else if(c.rowIndex<=d[0])r=d[0];else{var m=d[n-v];r=m?m:d[0]}o=c.rowIndex,a(r)}}},u=function(t,s){var i="row"!==t.defaultSelection?s.parentNode:s;if(e.paging&&e.Cpt.paging.nbPages>1){var l=e.Cpt.paging;t.nbRowsPerPage=l.pagingLength;var a=e.validRowsIndex,n=a.length,r=parseInt(l.startPagingRow,10)+parseInt(l.pagingLength,10),o=i.rowIndex;o===a[n-1]&&l.currentPageNb!==l.nbPages?l.setPage("last"):o==a[0]&&1!==l.currentPageNb?l.setPage("first"):o>a[r-1]&&o<a[n-1]?l.setPage("next"):o<a[l.startPagingRow]&&o>a[0]&&l.setPage("previous")}};if(e.paging&&(e.Cpt.paging.onAfterChangePage=function(t){var e=t.tf.ExtRegistry.advancedGrid,s=e._ezEditTable,i=s.Selection,l=i.GetActiveRow();l&&l.scrollIntoView(!1);var a=i.GetActiveCell();a&&a.scrollIntoView(!1)}),"row"===s.default_selection){var c=s.on_before_selected_row;s.on_before_selected_row=function(){u(arguments[0],arguments[1],arguments[2]),c&&c.call(null,arguments[0],arguments[1],arguments[2])};var f=s.on_after_selected_row;s.on_after_selected_row=function(){d(arguments[0],arguments[1],arguments[2]),f&&f.call(null,arguments[0],arguments[1],arguments[2])}}else{var p=s.on_before_selected_cell;s.on_before_selected_cell=function(){u(arguments[0],arguments[1],arguments[2]),p&&p.call(null,arguments[0],arguments[1],arguments[2])};var g=s.on_after_selected_cell;s.on_after_selected_cell=function(){d(arguments[0],arguments[1],arguments[2]),g&&g.call(null,arguments[0],arguments[1],arguments[2])}}}if(l){var v=s.on_added_dom_row;if(s.on_added_dom_row=function(){e.nbFilterableRows++,e.paging?(e.nbRows++,e.nbVisibleRows++,e.nbFilterableRows++,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging()):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),v&&v.call(null,arguments[0],arguments[1],arguments[2])},s.actions&&s.actions["delete"]){var b=s.actions["delete"].on_after_submit;s.actions["delete"].on_after_submit=function(){e.nbFilterableRows--,e.paging?(e.nbRows--,e.nbVisibleRows--,e.nbFilterableRows--,e.paging=!1,e.Cpt.paging.destroy(),e.Cpt.paging.addPaging(!1)):e.Cpt.rowsCounter.refresh(),e.alternateBgs&&e.Cpt.alternateRows.init(),b&&b.call(null,arguments[0],arguments[1])}}}try{this._ezEditTable=new EditTable(e.id,s,t),this._ezEditTable.Init()}catch(m){throw new Error(this.err)}}},{key:"reset",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&t.Selection.Set(),this.cfg.editable&&t.Editable.Set())}},{key:"destroy",value:function(){var t=this._ezEditTable;t&&(this.cfg.selectable&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove())}}]),t}();e["default"]=d,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(25),a=i(l);e["default"]=a["default"],t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,s,i){return s&&t(e.prototype,s),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var n=s(3),r=i(n),o=s(6),h=i(o),d=s(2),u=i(d),c=s(9),f=i(c),p=s(7),g=i(p),v=function(){function t(e){var s=void 0===arguments[1]?{name:"colsVisibility",description:"Columns visibility manager"}:arguments[1];l(this,t);var i=e.config();this.initialized=!1,this.name=s.name,this.desc=s.description,this.spanEl=null,this.btnEl=null,this.contEl=null,this.tickToHide=s.tick_to_hide===!1?!1:!0,this.manager=s.manager===!1?!1:!0,this.headersTbl=s.headers_table||!1,this.headersIndex=s.headers_index||1,this.contElTgtId=s.container_target_id||null,this.headersText=s.headers_text||null,this.btnTgtId=s.btn_target_id||null,this.btnText=s.btn_text||"Columns&#9660;",this.btnHtml=s.btn_html||null,this.btnCssClass=s.btn_css_class||"colVis",this.btnCloseText=s.btn_close_text||"Close",this.btnCloseHtml=s.btn_close_html||null,this.btnCloseCssClass=s.btn_close_css_class||this.btnCssClass,this.stylesheet=s.stylesheet||"colsVisibility.css",this.prfx="colVis_",this.spanCssClass=s.span_css_class||"colVisSpan",this.prfxCont=this.prfx+"Cont_",this.contCssClass=s.cont_css_class||"colVisCont",this.listCssClass=i.list_css_class||"cols_checklist",this.listItemCssClass=i.checklist_item_css_class||"cols_checklist_item",this.listSlcItemCssClass=i.checklist_selected_item_css_class||"cols_checklist_slc_item",this.text=s.text||(this.tickToHide?"Hide: ":"Show: "),this.atStart=s.at_start||null,this.enableHover=Boolean(s.enable_hover),this.enableTickAll=Boolean(s.enable_tick_all),this.tickAllText=s.tick_all_text||"Select all:",this.hiddenCols=[],this.tblHasColTag=r["default"].tag(e.tbl,"col").length>0,this.onLoaded=h["default"].isFn(s.on_loaded)?s.on_loaded:null,this.onBeforeOpen=h["default"].isFn(s.on_before_open)?s.on_before_open:null,this.onAfterOpen=h["default"].isFn(s.on_after_open)?s.on_after_open:null,this.onBeforeClose=h["default"].isFn(s.on_before_close)?s.on_before_close:null,this.onAfterClose=h["default"].isFn(s.on_after_close)?s.on_after_close:null,this.onBeforeColHidden=h["default"].isFn(s.on_before_col_hidden)?s.on_before_col_hidden:null,this.onAfterColHidden=h["default"].isFn(s.on_after_col_hidden)?s.on_after_col_hidden:null,this.onBeforeColDisplayed=h["default"].isFn(s.on_before_col_displayed)?s.on_before_col_displayed:null,this.onAfterColDisplayed=h["default"].isFn(s.on_after_col_displayed)?s.on_after_col_displayed:null,e.gridLayout&&(this.headersTbl=e.Cpt.gridLayout.headTbl,this.headersIndex=0,this.onAfterColDisplayed=function(){},this.onAfterColHidden=function(){}),e["import"](s.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"toggle",value:function(){var t=this.contEl.style.display,e=this.onBeforeOpen,s=this.onBeforeClose,i=this.onAfterOpen,l=this.onAfterClose;e&&"inline"!==t&&e.call(null,this),s&&"inline"===t&&s.call(null,this),this.contEl.style.display="inline"===t?"none":"inline",i&&"inline"!==t&&i.call(null,this),l&&"inline"===t&&l.call(null,this)}},{key:"checkItem",value:function(t){var e=t.parentNode;if(e&&t){var s=t.firstChild.checked,i=t.firstChild.getAttribute("id").split("_")[1];i=parseInt(i,10),s?r["default"].addClass(e,this.listSlcItemCssClass):r["default"].removeClass(e,this.listSlcItemCssClass);var l=!1;(this.tickToHide&&s||!this.tickToHide&&!s)&&(l=!0),this.setHidden(i,l)}}},{key:"init",value:function(){this.manager&&(this.buildBtn(),this.buildManager(),this.initialized=!0)}},{key:"buildBtn",value:function(){var t=this;if(!this.btnEl){var e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.spanCssClass,this.btnTgtId||e.setToolbar();var i=this.btnTgtId?r["default"].id(this.btnTgtId):e.rDiv;if(this.btnTgtId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}if(this.btnHtml){s.innerHTML=this.btnHtml;var a=s.firstChild;this.enableHover?u["default"].add(a,"mouseover",function(e){t.toggle(e)}):u["default"].add(a,"click",function(e){t.toggle(e)})}else{var n=r["default"].create("a",["href","javascript:;"]);n.className=this.btnCssClass,n.title=this.desc,n.innerHTML=this.btnText,s.appendChild(n),this.enableHover?u["default"].add(n,"mouseover",function(e){t.toggle(e)}):u["default"].add(n,"click",function(e){t.toggle(e)})}this.spanEl=s,this.btnEl=this.spanEl.firstChild,this.onLoaded&&this.onLoaded.call(null,this)}}},{key:"buildManager",value:function(){var t=this,e=this.tf,s=this.contElTgtId?r["default"].id(this.contElTgtId):r["default"].create("div",["id",this.prfxCont+e.id]);s.className=this.contCssClass;var i=r["default"].create("p");i.innerHTML=this.text,s.appendChild(i);var l=r["default"].create("ul",["id","ul"+this.name+"_"+e.id]);l.className=this.listCssClass;var a=this.headersTbl?this.headersTbl:e.tbl,n=this.headersTbl?this.headersIndex:e.getHeadersRowIndex(),o=a.rows[n];if(this.enableTickAll){var h=r["default"].createCheckItem("col__"+e.id,this.tickAllText,this.tickAllText);r["default"].addClass(h,this.listItemCssClass),l.appendChild(h),h.check.checked=!this.tickToHide,u["default"].add(h.check,"click",function(){for(var t=0;t<o.cells.length;t++){var s=r["default"].id("col_"+t+"_"+e.id);s&&h.check.checked!==s.checked&&(s.click(),s.checked=h.check.checked)}})}for(var d=0;d<o.cells.length;d++){var c=o.cells[d],f=this.headersText&&this.headersText[d]?this.headersText[d]:this._getHeaderText(c),p=r["default"].createCheckItem("col_"+d+"_"+e.id,f,f);r["default"].addClass(p,this.listItemCssClass),this.tickToHide||r["default"].addClass(p,this.listSlcItemCssClass),l.appendChild(p),this.tickToHide||(p.check.checked=!0),u["default"].add(p.check,"click",function(e){var s=u["default"].target(e),i=s.parentNode;t.checkItem(i)})}var g,v=r["default"].create("p",["align","center"]);if(this.btnCloseHtml?(v.innerHTML=this.btnCloseHtml,g=v.firstChild,u["default"].add(g,"click",function(e){t.toggle(e)})):(g=r["default"].create("a",["href","javascript:;"]),g.className=this.btnCloseCssClass,g.innerHTML=this.btnCloseText,u["default"].add(g,"click",function(e){t.toggle(e)}),v.appendChild(g)),s.appendChild(l),s.appendChild(v),this.btnEl.parentNode.insertBefore(s,this.btnEl),this.contEl=s,this.atStart)for(var b=this.atStart,m=0;m<b.length;m++){var C=r["default"].id("col_"+b[m]+"_"+e.id);C&&C.click()}}},{key:"setHidden",value:function(t,e){var s=this.tf,i=s.tbl;this.onBeforeColHidden&&e&&this.onBeforeColHidden.call(null,this,t),this.onBeforeColDisplayed&&!e&&this.onBeforeColDisplayed.call(null,this,t),this._hideCells(i,t,e),this.headersTbl&&this._hideCells(this.headersTbl,t,e);var l=this.hiddenCols;if(e)-1===l.indexOf(t)&&this.hiddenCols.push(t);else{var a=g["default"].indexByValue(l,t,!0);-1!==l.indexOf(t)&&this.hiddenCols.splice(a,1)}var n,r,o;if(this.onAfterColHidden&&e){if(s.gridLayout)if(n=s.Cpt.gridLayout,r=n.headTbl,o=n.gridColElms,f["default"].isIE())i.style.width=r.clientWidth+"px";else{for(var h=r.rows[this.headersIndex].cells,d=0,u=0;u<s.nbCells;u++)if("none"===h[u].style.display){var c=parseInt(h[u].style.width,10);h[u].style.width=0,d+=c}var p=parseInt(r.style.width,10);r.style.width=p-d+"px",i.style.width=r.style.width,o[t].style.display="none"}this.onAfterColHidden.call(null,this,t)}if(this.onAfterColDisplayed&&!e){if(s.gridLayout){n=s.Cpt.gridLayout,r=n.headTbl,o=n.gridColElms,o[t].style.display="";var v=parseInt(o[t].style.width,10),b=s.getHeaderElement(t);b.style.width=v+"px",r.style.width=parseInt(r.style.width,10)+v+"px",s.tbl.style.width=r.style.width}this.onAfterColDisplayed.call(null,this,t)}}},{key:"showCol",value:function(t){if(void 0!==t&&this.isColHidden(t))if(this.manager&&this.contEl){var e=r["default"].id("col_"+t+"_"+this.tf.id);e&&e.click()}else this.setHidden(t,!1)}},{key:"hideCol",value:function(t){if(void 0!==t&&!this.isColHidden(t))if(this.manager&&this.contEl){var e=r["default"].id("col_"+t+"_"+this.tf.id);e&&e.click()}else this.setHidden(t,!0)}},{key:"isColHidden",value:function(t){return-1!==this.hiddenCols.indexOf(t)?!0:!1}},{key:"toggleCol",value:function(t){void 0===t||this.isColHidden(t)?this.showCol(t):this.hideCol(t)}},{key:"getHiddenCols",value:function(){return this.hiddenCols}},{key:"destroy",value:function(){(this.btnEl||this.contEl)&&(r["default"].id(this.contElTgtId)?r["default"].id(this.contElTgtId).innerHTML="":(this.contEl.innerHTML="",this.contEl.parentNode.removeChild(this.contEl),this.contEl=null),this.btnEl.innerHTML="",this.btnEl.parentNode.removeChild(this.btnEl),this.btnEl=null,this.initialized=!1)}},{key:"_getHeaderText",value:function(t){if(!t.hasChildNodes)return"";for(var e=0;e<t.childNodes.length;e++){var s=t.childNodes[e];if(3===s.nodeType)return s.nodeValue;if(1===s.nodeType){if(s.id&&-1!==s.id.indexOf("popUp"))continue;return r["default"].getText(s)}}return""}},{key:"_hideCells",value:function(t,e,s){for(var i=0;i<t.rows.length;i++){var l=t.rows[i],a=l.cells[e];a&&(a.style.display=s?"none":"")}}}]),t}();e["default"]=v,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}},l=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},a=function(){function t(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,s,i){return s&&t(e.prototype,s),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var n=s(3),r=i(n),o=s(6),h=i(o),d=s(2),u=i(d),c=function(){function t(e,s){l(this,t),this.initialized=!1,this.name=s.name,this.desc=s.description||"Filters row visibility manager",this.path=s.path||e.basePath,this.stylesheet=s.stylesheet||"filtersVisibility.css",this.icnExpand=s.expand_icon_name||"icn_exp.png",this.icnCollapse=s.collapse_icon_name||"icn_clp.png",this.contEl=null,this.btnEl=null,this.icnExpandHtml='<img src="'+this.path+this.icnExpand+'" alt="Expand filters" >',this.icnCollapseHtml='<img src="'+this.path+this.icnCollapse+'" alt="Collapse filters" >',this.defaultText="Expand/Collapse filters",this.tgtId=s.target_id||null,this.enableIcon=s.enable_icon===!1?!1:!0,this.btnText=s.btn_text||this.defaultText,this.collapseBtnHtml=this.enableIcon?this.icnCollapseHtml:this.btnText,this.expandBtnHtml=this.enableIcon?this.icnExpandHtml:this.btnText,this.btnHtml=s.btn_html||null,this.btnCssClass=s.btn_css_class||"btnExpClpFlt",this.contCssClass=s.cont_css_class||"expClpFlt",this.externalTblId=s.external_table_id,this.externalTbl=h["default"].isUndef(this.externalTblId)?null:r["default"].id(this.externalTblId),this.externalFiltersRowIndex=h["default"].isUndef(s.external_filters_row_index)?1:s.external_filters_row_index,this.visibleAtStart=h["default"].isUndef(s.visible_at_start)?!0:Boolean(s.visible_at_start),this.prfx="fltsVis_",this.onBeforeShow=h["default"].isFn(s.on_before_show)?s.on_before_show:null,this.onAfterShow=h["default"].isFn(s.on_after_show)?s.on_after_show:null,this.onBeforeHide=h["default"].isFn(s.on_before_hide)?s.on_before_hide:null,this.onAfterHide=h["default"].isFn(s.on_after_hide)?s.on_after_hide:null,e["import"](s.name+"Style",e.basePath+this.stylesheet,null,"link"),this.tf=e}return a(t,[{key:"init",value:function(){this.initialized||(this.buildUI(),this.initialized=!0)}},{key:"buildUI",value:function(){var t=this,e=this.tf,s=r["default"].create("span",["id",this.prfx+e.id]);s.className=this.contCssClass,this.tgtId&&e.setToolbar();var i=this.tgtId?r["default"].id(this.tgtId):e.rDiv;if(this.tgtId)i.appendChild(s);else{var l=i.firstChild;l.parentNode.insertBefore(s,l)}var a=void 0;this.btnHtml?(s.innerHTML=this.btnHtml,a=s.firstChild,u["default"].add(a,"click",function(){t.toggle()})):(a=r["default"].create("a",["href","javascript:void(0);"]),a.className=this.btnCssClass,a.title=this.defaultText,a.innerHTML=this.collapseBtnHtml,s.appendChild(a),u["default"].add(a,"click",function(){t.toggle()})),this.cont=s,this.btnEl=a,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function(){var t=this.tf,e=this.externalTbl||t.tbl,s=this.externalFiltersRowIndex||t.getFiltersRowIndex(),i=e.rows[s],l=i.style.display;this.onBeforeShow&&""!=l&&this.onBeforeShow.call(this,this),this.onBeforeHide&&""===l&&this.onBeforeHide.call(null,this),i.style.display=""===l?"none":"",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=""===l?this.expandBtnHtml:this.collapseBtnHtml),this.onAfterShow&&""!=l&&this.onAfterShow.call(null,this),this.onAfterHide&&""===l&&this.onAfterHide.call(null,this)}},{key:"destroy",value:function(){(this.btnEl||this.contEl)&&(this.contEl.innerHTML="",this.contEl.parentNode.removeChild(this.contEl),this.contEl=null,this.btnEl.innerHTML="",this.btnEl.parentNode.removeChild(this.btnEl),this.btnEl=null,this.initialized=!1)}}]),t}();e["default"]=c,t.exports=e["default"]},function(t,e,s){"use strict";function i(t){return I["default"].removeNbFormat(t,"us")}function l(t){return I["default"].removeNbFormat(t,"eu")}function a(t,e){return x["default"].format(t,e)}function n(t){return a(t,"DMY")}function r(t){return a(t,"MDY")}function o(t){return a(t,"YMD")}function h(t){return a(t,"DDMMMYYYY")}function d(t){var e=t.split(".");for(var s in e){for(var i=e[s];3>i.length;)i="0"+i;e[s]=i}return e.join(".")}function u(t,e){var s=d(t.value.toLowerCase()),i=d(e.value.toLowerCase());return s==i?0:i>s?-1:1}var c=function(t){return t&&t.__esModule?t:{"default":t}},f=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},p=function(){function t(t,e){for(var s=0;s<e.length;s++){var i=e[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,s,i){return s&&t(e.prototype,s),i&&t(e,i),e}}();Object.defineProperty(e,"__esModule",{value:!0});var g=s(6),v=c(g),b=s(3),m=c(b),C=s(7),_=c(C),y=s(2),w=c(y),T=s(8),x=c(T),k=s(9),I=c(k),S=function(){function t(e){f(this,t);var s=e.config();this.isPaged=!1,this.sorted=!1,this.sortImgPath=s.sort_images_path||e.themesPath,this.sortImgBlank=s.sort_image_blank||"blank.png",this.sortImgClassName=s.sort_image_class_name||"sort-arrow",this.sortImgAscClassName=s.sort_image_asc_class_name||"ascending",this.sortImgDescClassName=s.sort_image_desc_class_name||"descending",this.sortCustomKey=s.sort_custom_key||"data-tf-sortKey",this.onSortLoaded=v["default"].isFn(s.on_sort_loaded)?s.on_sort_loaded:null,this.onBeforeSort=v["default"].isFn(s.on_before_sort)?s.on_before_sort:null,this.onAfterSort=v["default"].isFn(s.on_after_sort)?s.on_after_sort:null,this.tf=e}return p(t,[{key:"init",value:function(){var t=this.tf,e=t.sortConfig,s=this;if(v["default"].isUndef(SortableTable))throw new Error("SortableTable class not found.");this.overrideSortableTable(),this.setSortTypes(),e.sortCol&&this.stt.sort(e.sortCol[0],e.sortCol[1]),t.isSortEnabled=!0,this.onSortLoaded&&this.onSortLoaded.call(null,t,this),this.stt.onbeforesort=function(){this.onBeforeSort&&this.onBeforeSort.call(null,t,this.stt.sortColumn),t.performSort(),t.paging&&(s.isPaged=!0,t.paging=!1,t.Cpt.paging.destroy())},this.stt.onsort=function(){if(s.sorted=!0,t.alternateBgs)for(var e=t.tbl.rows,i=0,l=function(e,s,i){v["default"].isUndef(i)&&(i=!1);var l=t.Cpt.alternateRows,a=l.oddCss,n=l.evenCss;m["default"].removeClass(e,a),m["default"].removeClass(e,n),i||m["default"].addClass(e,s%2?a:n)},a=t.refRow;a<t.nbRows;a++){var n=e[a].getAttribute("validRow");t.paging&&""===e[a].style.display?(l(e[a],i),i++):"true"!==n&&null!==n||""!==e[a].style.display?l(e[a],i,!0):(l(e[a],i),i++)}if(s.isPaged){var r=t.Cpt.paging,o=t.config();if(r.hasResultsPerPage){var h=r.resultsPerPageSlc;o.paging_length=h.options[h.selectedIndex].value}r.addPaging(!1),r.setPage(r.currentPageNb),s.isPaged=!1}s.onAfterSort&&s.onAfterSort.call(null,t,t.stt.sortColumn)}}},{key:"sortByColumnIndex",value:function(t){this.stt.sort(t)}},{key:"overrideSortableTable",value:function(){var t=this,e=this.tf;SortableTable.prototype.headerOnclick=function(t){if(e.sort){for(var s=t.target||t.srcElement;"TD"!==s.tagName&&"TH"!==s.tagName;)s=s.parentNode;this.sort(SortableTable.msie?SortableTable.getCellIndex(s):s.cellIndex)}},SortableTable.getCellIndex=function(t){var e,s=t.parentNode.cells,i=s.length;for(e=0;s[e]!=t&&i>e;e++);return e},SortableTable.prototype.initHeader=function(s){var i=this;if(i.tHead){i.headersRow=e.headersRow;var l=i.tHead.rows[i.headersRow].cells;i.sortTypes=s||[];for(var a,n,r=l.length,o=0;r>o;o++)n=l[o],null!==i.sortTypes[o]&&"None"!==i.sortTypes[o]?(n.style.cursor="pointer",a=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),n.appendChild(a),null!==i.sortTypes[o]&&n.setAttribute("_sortType",i.sortTypes[o]),w["default"].add(n,"click",i._headerOnclick)):(n.setAttribute("_sortType",s[o]),n._sortType="None");i.updateHeaderArrows()}},SortableTable.prototype.updateHeaderArrows=function(){var s,i,l,a=this;if(e.sortConfig.asyncSort&&null!==e.sortConfig.triggerIds){var n=e.sortConfig.triggerIds;s=[],i=n.length;for(var r=0;r<n.length;r++)s.push(m["default"].id(n[r]))}else{if(!this.tHead)return;s=a.tHead.rows[a.headersRow].cells,i=s.length}for(var o=0;i>o;o++){var h=s[o].getAttribute("_sortType");null!==h&&"None"!==h&&(l=s[o].lastChild||s[o],"img"!==l.nodeName.toLowerCase()&&(l=m["default"].create("img",["src",t.sortImgPath+t.sortImgBlank]),s[o].appendChild(l)),o===a.sortColumn?l.className=t.sortImgClassName+" "+(this.descending?t.sortImgDescClassName:t.sortImgAscClassName):l.className=t.sortImgClassName)}},SortableTable.prototype.getRowValue=function(t,e,s){var i=this,l=i._sortTypeInfo[e];if(l&&l.getRowValue)return l.getRowValue(t,s);var a=t.cells[s],n=SortableTable.getInnerText(a);return i.getValueFromString(n,e)},SortableTable.getInnerText=function(e){return e?e.getAttribute(t.sortCustomKey)?e.getAttribute(t.sortCustomKey):m["default"].getText(e):void 0}}},{key:"addSortType",value:function(){SortableTable.prototype.addSortType(arguments[0],arguments[1],arguments[2],arguments[3])}},{key:"setSortTypes",value:function(){for(var t=this,e=this.tf,s=e.sortConfig,a=s.sortTypes,c=[],f=0;f<e.nbCells;f++){var p;null!==a&&null!=a[f]?(p=a[f].toLowerCase(),"none"===p&&(p="None")):p=e.hasColNbFormat&&null!==e.colNbFormat[f]?e.colNbFormat[f].toLowerCase():e.hasColDateType&&null!==e.colDateType[f]?e.colDateType[f].toLowerCase()+"date":"String",c.push(p)}if(this.addSortType("number",Number),this.addSortType("caseinsensitivestring",SortableTable.toUpperCase),this.addSortType("date",SortableTable.toDate),this.addSortType("string"),this.addSortType("us",i),this.addSortType("eu",l),this.addSortType("dmydate",n),this.addSortType("ymddate",o),this.addSortType("mdydate",r),this.addSortType("ddmmmyyyydate",h),this.addSortType("ipaddress",d,u),this.stt=new SortableTable(e.tbl,c),s.asyncSort&&null!==s.triggerIds)for(var g=s.triggerIds,v=0;v<g.length;v++)if(null!==g[v]){var b=m["default"].id(g[v]);b&&(b.style.cursor="pointer",w["default"].add(b,"click",function(e){var s=e.target;t.tf.sort&&t.stt.asyncSort(_["default"].indexByValue(g,s.id,!0))}),b.setAttribute("_sortType",c[v]))}}},{key:"destroy",value:function(){var t=this.tf;t.sort=!1,this.sorted=!1,this.stt.destroy();for(var e=t.getFiltersId(),s=0;s<e.length;s++){var i=t.getHeaderElement(s),l=m["default"].tag(i,"img");1===l.length&&i.removeChild(l[0])}}}]),t}();e["default"]=S,t.exports=e["default"]},function(t,e,s){"use strict";var i=function(t){return t&&t.__esModule?t:{"default":t}};Object.defineProperty(e,"__esModule",{value:!0});var l=s(29),a=i(l);window.SortableTable||s(31),e["default"]=a["default"],t.exports=e["default"]},function(t,e,s){s(32)(s(33))},function(t,e,s){t.exports=function(t){"function"==typeof execScript?execScript(t):eval.call(null,t)}},function(t,e,s){t.exports='/*----------------------------------------------------------------------------\\\r\n| Sortable Table 1.12 |\r\n|-----------------------------------------------------------------------------|\r\n| Created by Erik Arvidsson |\r\n| (http://webfx.eae.net/contact.html#erik) |\r\n| For WebFX (http://webfx.eae.net/) |\r\n|-----------------------------------------------------------------------------|\r\n| A DOM 1 based script that allows an ordinary HTML table to be sortable. |\r\n|-----------------------------------------------------------------------------|\r\n| Copyright (c) 1998 - 2006 Erik Arvidsson |\r\n|-----------------------------------------------------------------------------|\r\n| Licensed under the Apache License, Version 2.0 (the "License"); you may not |\r\n| use this file except in compliance with the License. You may obtain a copy |\r\n| of the License at http://www.apache.org/licenses/LICENSE-2.0 |\r\n| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |\r\n| Unless required by applicable law or agreed to in writing, software |\r\n| distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |\r\n| WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |\r\n| License for the specific language governing permissions and limitations |\r\n| under the License. |\r\n|-----------------------------------------------------------------------------|\r\n| 2003-01-10 | First version |\r\n| 2003-01-19 | Minor changes to the date parsing |\r\n| 2003-01-28 | JScript 5.0 fixes (no support for \'in\' operator) |\r\n| 2003-02-01 | Sloppy typo like error fixed in getInnerText |\r\n| 2003-07-04 | Added workaround for IE cellIndex bug. |\r\n| 2003-11-09 | The bDescending argument to sort was not correctly working |\r\n| | Using onclick DOM0 event if no support for addEventListener |\r\n| | or attachEvent |\r\n| 2004-01-13 | Adding addSortType and removeSortType which makes it a lot |\r\n| | easier to add new, custom sort types. |\r\n| 2004-01-27 | Switch to use descending = false as the default sort order. |\r\n| | Change defaultDescending to suit your needs. |\r\n| 2004-03-14 | Improved sort type None look and feel a bit |\r\n| 2004-08-26 | Made the handling of tBody and tHead more flexible. Now you |\r\n| | can use another tHead or no tHead, and you can chose some |\r\n| | other tBody. |\r\n| 2006-04-25 | Changed license to Apache Software License 2.0 |\r\n|-----------------------------------------------------------------------------|\r\n| Created 2003-01-10 | All changes are in the log above. | Updated 2006-04-25 |\r\n\\----------------------------------------------------------------------------*/\r\n\r\n\r\nfunction SortableTable(oTable, oSortTypes) {\r\n\r\n this.sortTypes = oSortTypes || [];\r\n\r\n this.sortColumn = null;\r\n this.descending = null;\r\n\r\n var oThis = this;\r\n this._headerOnclick = function (e) {\r\n oThis.headerOnclick(e);\r\n };\r\n\r\n if (oTable) {\r\n this.setTable( oTable );\r\n this.document = oTable.ownerDocument || oTable.document;\r\n }\r\n else {\r\n this.document = document;\r\n }\r\n\r\n\r\n // only IE needs this\r\n var win = this.document.defaultView || this.document.parentWindow;\r\n this._onunload = function () {\r\n oThis.destroy();\r\n };\r\n if (win && typeof win.attachEvent != "undefined") {\r\n win.attachEvent("onunload", this._onunload);\r\n }\r\n}\r\n\r\nSortableTable.gecko = navigator.product == "Gecko";\r\nSortableTable.msie = /msie/i.test(navigator.userAgent);\r\n// Mozilla is faster when doing the DOM manipulations on\r\n// an orphaned element. MSIE is not\r\nSortableTable.removeBeforeSort = SortableTable.gecko;\r\n\r\nSortableTable.prototype.onsort = function () {};\r\n\r\n// default sort order. true -> 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';
}]);