TableFilter/dist/tablefilter/tf-0-2c8620168298c5a11749.js

2 lines
56 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{440:function(e,t,n){var r={"./array":69,"./array.js":69,"./const":15,"./const.js":15,"./cookie":120,"./cookie.js":120,"./dom":10,"./dom.js":10,"./emitter":127,"./emitter.js":127,"./event":18,"./event.js":18,"./extensions/advancedGrid/adapterEzEditTable":442,"./extensions/advancedGrid/adapterEzEditTable.js":442,"./extensions/advancedGrid/advancedGrid":447,"./extensions/advancedGrid/advancedGrid.js":447,"./extensions/colOps/colOps":446,"./extensions/colOps/colOps.js":446,"./extensions/colsVisibility/colsVisibility":445,"./extensions/colsVisibility/colsVisibility.js":445,"./extensions/filtersVisibility/filtersVisibility":444,"./extensions/filtersVisibility/filtersVisibility.js":444,"./extensions/sort/adapterSortabletable":441,"./extensions/sort/adapterSortabletable.js":441,"./extensions/sort/sort":443,"./extensions/sort/sort.js":443,"./feature":11,"./feature.js":11,"./modules/alternateRows":111,"./modules/alternateRows.js":111,"./modules/baseDropdown":70,"./modules/baseDropdown.js":70,"./modules/checkList":108,"./modules/checkList.js":108,"./modules/clearButton":112,"./modules/clearButton.js":112,"./modules/dateType":125,"./modules/dateType.js":125,"./modules/dropdown":126,"./modules/dropdown.js":126,"./modules/gridLayout":119,"./modules/gridLayout.js":119,"./modules/hash":122,"./modules/hash.js":122,"./modules/help":124,"./modules/help.js":124,"./modules/highlightKeywords":117,"./modules/highlightKeywords.js":117,"./modules/loader":118,"./modules/loader.js":118,"./modules/markActiveColumns":115,"./modules/markActiveColumns.js":115,"./modules/noResults":110,"./modules/noResults.js":110,"./modules/paging":109,"./modules/paging.js":109,"./modules/popupFilter":116,"./modules/popupFilter.js":116,"./modules/rowsCounter":114,"./modules/rowsCounter.js":114,"./modules/state":123,"./modules/state.js":123,"./modules/statusBar":113,"./modules/statusBar.js":113,"./modules/storage":121,"./modules/storage.js":121,"./modules/toolbar":33,"./modules/toolbar.js":33,"./number":68,"./number.js":68,"./root":16,"./root.js":16,"./settings":7,"./settings.js":7,"./sort":107,"./sort.js":107,"./string":21,"./string.js":21,"./tablefilter":128,"./tablefilter.js":128,"./types":3,"./types.js":3};function webpackContext(e){var t=webpackContextResolve(e);return n(t)}function webpackContextResolve(e){var t=r[e];if(!(t+1)){var n=new Error('Cannot find module "'+e+'".');throw n.code="MODULE_NOT_FOUND",n}return t}webpackContext.keys=function webpackContextKeys(){return Object.keys(r)},webpackContext.resolve=webpackContextResolve,e.exports=webpackContext,webpackContext.id=440},441:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),i=n(11),o=n(3),s=n(10),a=n(18),l=n(68),d=n(15),c=n(7);var u=function(e){function AdapterSortableTable(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,AdapterSortableTable);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(AdapterSortableTable.__proto__||Object.getPrototypeOf(AdapterSortableTable)).call(this,e,t.name));return n.name=t.name,n.desc=(0,c.defaultsStr)(t.description,"Sortable table"),n.sorted=!1,n.sortTypes=(0,c.defaultsArr)(t.types,e.colTypes),n.sortColAtStart=(0,c.defaultsArr)(t.sort_col_at_start,null),n.asyncSort=Boolean(t.async_sort),n.triggerIds=(0,c.defaultsArr)(t.trigger_ids,[]),n.imgPath=(0,c.defaultsStr)(t.images_path,e.themesPath),n.imgBlank=(0,c.defaultsStr)(t.image_blank,"blank.png"),n.imgClassName=(0,c.defaultsStr)(t.image_class_name,"sort-arrow"),n.imgAscClassName=(0,c.defaultsStr)(t.image_asc_class_name,"ascending"),n.imgDescClassName=(0,c.defaultsStr)(t.image_desc_class_name,"descending"),n.customKey=(0,c.defaultsStr)(t.custom_key,"data-tf-sortKey"),n.onSortLoaded=(0,c.defaultsFn)(t.on_sort_loaded,o.EMPTY_FN),n.onBeforeSort=(0,c.defaultsFn)(t.on_before_sort,o.EMPTY_FN),n.onAfterSort=(0,c.defaultsFn)(t.on_after_sort,o.EMPTY_FN),n.stt=null,n.enable(),n}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(AdapterSortableTable,i.Feature),r(AdapterSortableTable,[{key:"init",value:function init(){if(!this.initialized){var e=this.tf,t=this;if((0,o.isUndef)(SortableTable))throw new Error("SortableTable class not found.");this.emitter.emit("add-date-type-formats",this.tf,this.sortTypes),this.overrideSortableTable(),this.setSortTypes(),this.onSortLoaded(e,this),this.stt.onbeforesort=function(){t.onBeforeSort(e,t.stt.sortColumn),e.paging&&e.feature("paging").disable()},this.stt.onsort=function(){if(t.sorted=!0,e.paging){var n=e.feature("paging");e.getValidRows(!0),n.enable(),n.setPage(n.getPage())}t.onAfterSort(e,t.stt.sortColumn,t.stt.descending),t.emitter.emit("column-sorted",e,t.stt.sortColumn,t.stt.descending)};var n=t.sortColAtStart;n&&this.stt.sort(n[0],n[1]),this.emitter.on(["sort"],(0,a.bound)(this.sortByColumnIndexHandler,this)),this.initialized=!0,this.emitter.emit("sort-initialized",e,this)}}},{key:"sortByColumnIndex",value:function sortByColumnIndex(e,t){this.stt.sort(e,t)}},{key:"sortByColumnIndexHandler",value:function sortByColumnIndexHandler(e,t,n){this.sortByColumnIndex(t,n)}},{key:"overrideSortableTable",value:function overrideSortableTable(){var e=this,t=this.tf;SortableTable.prototype.headerOnclick=function(t){if(e.initialized){for(var n=t.target||t.srcElement;n.tagName!==d.CELL_TAG&&n.tagName!==d.HEADER_TAG;)n=n.parentNode;this.sort(SortableTable.msie?SortableTable.getCellIndex(n):n.cellIndex)}},SortableTable.getCellIndex=function(e){var t=e.parentNode.cells,n=t.length,r=void 0;for(r=0;t[r]!==e&&r<n;r++);return r},SortableTable.prototype.initHeader=function(n){var r=this;if(!r.tHead){if(!t.gridLayout)return;r.tHead=t.feature("gridLayout").headTbl.tHead}r.headersRow=t.headersRow;var i=r.tHead.rows[r.headersRow].cells;r.sortTypes=n||[];for(var o=i.length,l=void 0,d=void 0,c=0;c<o;c++)d=i[c],null!==r.sortTypes[c]&&"None"!==r.sortTypes[c]?(d.style.cursor="pointer",l=(0,s.createElm)("img",["src",e.imgPath+e.imgBlank]),d.appendChild(l),null!==r.sortTypes[c]&&d.setAttribute("_sortType",r.sortTypes[c]),(0,a.addEvt)(d,"click",r._headerOnclick)):(d.setAttribute("_sortType",n[c]),d._sortType="None");r.updateHeaderArrows()},SortableTable.prototype.updateHeaderArrows=function(){var t=void 0,n=void 0,r=void 0;if(e.asyncSort&&e.triggerIds.length>0){var i=e.triggerIds;t=[],n=i.length;for(var o=0;o<n;o++)t.push((0,s.elm)(i[o]))}else{if(!this.tHead)return;n=(t=this.tHead.rows[this.headersRow].cells).length}for(var a=0;a<n;a++){var l=t[a];if(l){var d=l.getAttribute("_sortType");null!==d&&"None"!==d&&("img"!==(r=l.lastChild||l).nodeName.toLowerCase()&&(r=(0,s.createElm)("img",["src",e.imgPath+e.imgBlank]),l.appendChild(r)),a===this.sortColumn?r.className=e.imgClassName+" "+(this.descending?e.imgDescClassName:e.imgAscClassName):r.className=e.imgClassName)}}},SortableTable.prototype.getRowValue=function(e,t,n){var r=this._sortTypeInfo[t];if(r&&r.getRowValue)return r.getRowValue(e,n);var i=e.cells[n],o=SortableTable.getInnerText(i);return this.getValueFromString(o,t)},SortableTable.getInnerText=function(n){if(n)return n.getAttribute(e.customKey)?n.getAttribute(e.customKey):t.getCellValue(n)}}},{key:"addSortType",value:function addSortType(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];var r=t[0],i=t[1],o=t[2],s=t[3];SortableTable.prototype.addSortType(r,i,o,s)}},{key:"setSortTypes",value:function setSortTypes(){var e=this,t=this.tf,n=this.sortTypes,r=[];t.eachCol(function(i){var s=void 0;if(n[i])if(s=n[i],(0,o.isObj)(s)){if(s.type===d.DATE)s=e._addDateType(i,n);else if(s.type===d.FORMATTED_NUMBER){var a=s.decimal||t.decimalSeparator;s=e._addNumberType(i,a)}}else(s=s.toLowerCase())===d.DATE?s=e._addDateType(i,n):s===d.FORMATTED_NUMBER||s===d.NUMBER?s=e._addNumberType(i,t.decimalSeparator):s===d.NONE&&(s="None");else s=d.STRING;r.push(s)}),this.addSortType("caseinsensitivestring",SortableTable.toUpperCase),this.addSortType(d.STRING),this.addSortType(d.IP_ADDRESS,ipAddress,sortIP),this.stt=new SortableTable(t.dom(),r),this.asyncSort&&this.triggerIds.length>0&&function(){for(var t=e.triggerIds,n=0;n<t.length;n++)if(null!==t[n]){var i=(0,s.elm)(t[n]);i&&(i.style.cursor="pointer",(0,a.addEvt)(i,"click",function(n){var r=n.target;e.tf.sort&&e.stt.asyncSort(t.indexOf(r.id))}),i.setAttribute("_sortType",r[n]))}}()}},{key:"_addDateType",value:function _addDateType(e,t){var n=this.tf,r=n.feature("dateType"),i=r.getOptions(e,t).locale||n.locale,o=d.DATE+"-"+i;return this.addSortType(o,function(e){var t=r.parse(e,i);return isNaN(+t)?new Date(-864e11):t}),o}},{key:"_addNumberType",value:function _addNumberType(e,t){var n=d.FORMATTED_NUMBER+("."===t?"":"-custom");return this.addSortType(n,function(e){return(0,l.parse)(e,t)}),n}},{key:"destroy",value:function destroy(){if(this.initialized){var e=this.tf;this.emitter.off(["sort"],(0,a.bound)(this.sortByColumnIndexHandler,this)),this.sorted=!1,this.stt.destroy();for(var t=e.getFiltersId(),n=0;n<t.length;n++){var r=e.getHeaderElement(n),i=(0,s.tag)(r,"img");1===i.length&&r.removeChild(i[0])}this.initialized=!1}}}]),AdapterSortableTable}();function ipAddress(e){var t=e.split(".");for(var n in t){for(var r=t[n];3>r.length;)r="0"+r;t[n]=r}return t.join(".")}function sortIP(e,t){var n=ipAddress(e.value.toLowerCase()),r=ipAddress(t.value.toLowerCase());return n===r?0:n<r?-1:1}t.default=u},442:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),i=n(11),o=n(10),s=n(15),a=n(7),l=n(16);var d=function(e){function AdapterEzEditTable(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,AdapterEzEditTable);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(AdapterEzEditTable.__proto__||Object.getPrototypeOf(AdapterEzEditTable)).call(this,e,t.name));return n.desc=(0,a.defaultsStr)(t.description,"ezEditTable adapter"),n.filename=(0,a.defaultsStr)(t.filename,"ezEditTable.js"),n.vendorPath=t.vendor_path,n.loadStylesheet=Boolean(t.load_stylesheet),n.stylesheet=(0,a.defaultsStr)(t.stylesheet,n.vendorPath+"ezEditTable.css"),n.stylesheetName=(0,a.defaultsStr)(t.stylesheet_name,"ezEditTableCss"),t.scroll_into_view=!1!==t.scroll_into_view&&e.gridLayout,n._ezEditTable=null,n.cfg=t,n.enable(),n}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(AdapterEzEditTable,i.Feature),r(AdapterEzEditTable,[{key:"init",value:function init(){var e=this;if(!this.initialized){var t=this.tf;if(l.root.EditTable)this._setAdvancedGrid();else{var n=this.vendorPath+this.filename;t.import(this.filename,n,function(){return e._setAdvancedGrid()})}this.loadStylesheet&&!t.isImported(this.stylesheet,"link")&&t.import(this.stylesheetName,this.stylesheet,null,"link"),this.emitter.on(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!0}}},{key:"_setAdvancedGrid",value:function _setAdvancedGrid(){var e=this.tf,t=void 0,n=this.cfg;t=(0,o.tag)(e.dom(),"thead").length>0&&!n.startRow?void 0:n.startRow||e.refRow,n.base_path=n.base_path||e.basePath+"ezEditTable/";var r=n.editable,i=n.selection;i&&(n.default_selection=n.default_selection||"row"),n.active_cell_css=n.active_cell_css||"ezETSelectedCell";var s=0,a=0;if(i){var l=function onAfterSelection(t,n,r){var i=t.Selection,o=function doSelect(r){if("row"===t.defaultSelection)i.SelectRowByIndex(r);else{t.ClearSelections();var o=n.cellIndex,s=e.dom().rows[r];"both"===t.defaultSelection&&i.SelectRowByIndex(r),s&&i.SelectCell(s.cells[o])}if(e.validRowsIndex.length!==e.getRowsNb()){var a=e.dom().rows[r];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 l=e.validRowsIndex,d=l.length,c="row"!==t.defaultSelection?n.parentNode:n,u="TD"===n.nodeName?n:null,f=void 0!==r?t.Event.GetKey(r):0,h=-1!==l.indexOf(c.rowIndex),p=void 0,b=e.feature("paging"),m=34===f||33===f?b&&b.pageLength||t.nbRowsPerPage:1;if(h)34!==f&&33!==f?(s=l.indexOf(c.rowIndex),a=c.rowIndex):(p=34===f?s+m<=d-1?l[s+m]:[d-1]:s-m<=l[0]?l[0]:l[s-m],a=p,s=l.indexOf(p),o(p));else{if(c.rowIndex>a)if(c.rowIndex>=l[d-1])p=l[d-1];else{var g=s+m;p=g>d-1?l[d-1]:l[g]}else if(c.rowIndex<=l[0])p=l[0];else{var y=l[s-m];p=y||l[0]}a=c.rowIndex,o(p)}}},d=function onBeforeSelection(t,n){var r="row"!==t.defaultSelection?n.parentNode:n;if(e.paging&&e.feature("paging").nbPages>1){var i=e.feature("paging");t.nbRowsPerPage=i.pageLength;var o=e.validRowsIndex,s=o.length,a=parseInt(i.startPagingRow,10)+parseInt(i.pageLength,10),l=r.rowIndex;l===o[s-1]&&i.currentPageNb!==i.nbPages?i.setPage("last"):l===o[0]&&1!==i.currentPageNb?i.setPage("first"):l>o[a-1]&&l<o[s-1]?i.setPage("next"):l<o[i.startPagingRow]&&l>o[0]&&i.setPage("previous")}};if(e.paging&&(e.feature("paging").onAfterChangePage=function(e){var t=e.tf.extension("advancedGrid")._ezEditTable.Selection,n=t.GetActiveRow();n&&n.scrollIntoView(!1);var r=t.GetActiveCell();r&&r.scrollIntoView(!1)}),"row"===n.default_selection){var c=n.on_before_selected_row;n.on_before_selected_row=function(){var e=arguments;d(e[0],e[1],e[2]),c&&c.call(null,e[0],e[1],e[2])};var u=n.on_after_selected_row;n.on_after_selected_row=function(){var e=arguments;l(e[0],e[1],e[2]),u&&u.call(null,e[0],e[1],e[2])}}else{var f=n.on_before_selected_cell;n.on_before_selected_cell=function(){var e=arguments;d(e[0],e[1],e[2]),f&&f.call(null,e[0],e[1],e[2])};var h=n.on_after_selected_cell;n.on_after_selected_cell=function(){var e=arguments;l(e[0],e[1],e[2]),h&&h.call(null,e[0],e[1],e[2])}}}if(r){var p=n.on_added_dom_row;if(n.on_added_dom_row=function(){var t=arguments;e.nbFilterableRows++,e.paging?(e.nbFilterableRows++,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset()):e.emitter.emit("rows-changed",e,this),e.alternateRows&&e.feature("alternateRows").init(),p&&p.call(null,t[0],t[1],t[2])},n.actions&&n.actions.delete){var b=n.actions.delete.on_after_submit;n.actions.delete.on_after_submit=function(){var t=arguments;e.nbFilterableRows--,e.paging?(e.nbFilterableRows--,e.paging=!1,e.feature("paging").destroy(),e.feature("paging").reset(!1)):e.emitter.emit("rows-changed",e,this),e.alternateRows&&e.feature("alternateRows").init(),b&&b.call(null,t[0],t[1])}}}try{this._ezEditTable=new EditTable(e.id,n,t),this._ezEditTable.Init()}catch(e){throw new Error('Failed to instantiate EditTable object.\n \n"ezEditTable" dependency not found.')}this.initialized=!0}},{key:"reset",value:function reset(){var e=this._ezEditTable;e&&(this.cfg.selection&&e.Selection.Set(),this.cfg.editable&&e.Editable.Set())}},{key:"toggle",value:function toggle(){var e=this._ezEditTable;e.editable?e.Editable.Remove():e.Editable.Set(),e.selection?e.Selection.Remove():e.Selection.Set()}},{key:"_toggleForInputFilter",value:function _toggleForInputFilter(){var e=this.tf;if(e.getActiveFilterId()){var t=e.getColumnIndexFromFilterId(e.getActiveFilterId());e.getFilterType(t)===s.INPUT&&this.toggle()}}},{key:"destroy",value:function destroy(){var e=this;if(this.initialized){var t=this._ezEditTable;t&&(this.cfg.selection&&(t.Selection.ClearSelections(),t.Selection.Remove()),this.cfg.editable&&t.Editable.Remove()),this.emitter.off(["filter-focus","filter-blur"],function(){return e._toggleForInputFilter()}),this.initialized=!1}}}]),AdapterEzEditTable}();t.default=d},443:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(441));n(16).root.SortableTable||n(450),t.default=r.default},444:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),i=n(11),o=n(10),s=n(3),a=n(18),l=n(7),d=n(33);var c=function(e){function FiltersVisibility(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,FiltersVisibility);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(FiltersVisibility.__proto__||Object.getPrototypeOf(FiltersVisibility)).call(this,e,t.name));return n.name=t.name,n.desc=(0,l.defaultsStr)(t.description,"Filters row visibility manager"),n.stylesheet=(0,l.defaultsStr)(t.stylesheet,"filtersVisibility.css"),n.icnExpand=(0,l.defaultsStr)(t.expand_icon_name,"icn_exp.png"),n.icnCollapse=(0,l.defaultsStr)(t.collapse_icon_name,"icn_clp.png"),n.contEl=null,n.btnEl=null,n.icnExpandHtml='<img src="'+e.themesPath+n.icnExpand+'" alt="Expand filters" >',n.icnCollapseHtml='<img src="'+e.themesPath+n.icnCollapse+'" alt="Collapse filters" >',n.defaultText="Toggle filters",n.targetId=t.target_id||null,n.enableIcon=(0,l.defaultsBool)(t.enable_icon,!0),n.btnText=(0,l.defaultsStr)(t.btn_text,""),n.collapseBtnHtml=n.enableIcon?n.icnCollapseHtml+n.btnText:n.btnText||n.defaultText,n.expandBtnHtml=n.enableIcon?n.icnExpandHtml+n.btnText:n.btnText||n.defaultText,n.btnHtml=(0,l.defaultsStr)(t.btn_html,null),n.btnCssClass=(0,l.defaultsStr)(t.btn_css_class,"btnExpClpFlt"),n.contCssClass=(0,l.defaultsStr)(t.cont_css_class,"expClpFlt"),n.filtersRowIndex=(0,l.defaultsNb)(t.filters_row_index,e.getFiltersRowIndex()),n.visibleAtStart=(0,l.defaultsNb)(t.visible_at_start,!0),n.toolbarPosition=(0,l.defaultsStr)(t.toolbar_position,d.RIGHT),n.onBeforeShow=(0,l.defaultsFn)(t.on_before_show,s.EMPTY_FN),n.onAfterShow=(0,l.defaultsFn)(t.on_after_show,s.EMPTY_FN),n.onBeforeHide=(0,l.defaultsFn)(t.on_before_hide,s.EMPTY_FN),n.onAfterHide=(0,l.defaultsFn)(t.on_after_hide,s.EMPTY_FN),e.import(t.name+"Style",e.getStylePath()+n.stylesheet,null,"link"),n.enable(),n}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(FiltersVisibility,i.Feature),r(FiltersVisibility,[{key:"init",value:function init(){var e=this;this.initialized||(this.emitter.emit("initializing-extension",this,!(0,s.isNull)(this.targetId)),this.buildUI(),this.initialized=!0,this.emitter.on(["show-filters"],function(t,n){return e.show(n)}),this.emitter.emit("filters-visibility-initialized",this.tf,this),this.emitter.emit("extension-initialized",this))}},{key:"buildUI",value:function buildUI(){var e=this,t=this.tf,n=(0,o.createElm)("span");n.className=this.contCssClass;var r=this.targetId?(0,o.elm)(this.targetId):t.feature("toolbar").container(this.toolbarPosition);if(this.targetId)r.appendChild(n);else{var i=r.firstChild;i.parentNode.insertBefore(n,i)}var s=void 0;this.btnHtml?(n.innerHTML=this.btnHtml,s=n.firstChild):((s=(0,o.createElm)("a",["href","javascript:void(0);"])).className=this.btnCssClass,s.title=this.btnText||this.defaultText,s.innerHTML=this.collapseBtnHtml,n.appendChild(s)),(0,a.addEvt)(s,"click",function(){return e.toggle()}),this.contEl=n,this.btnEl=s,this.visibleAtStart||this.toggle()}},{key:"toggle",value:function toggle(){var e=this.tf,t=""===(e.gridLayout?e.feature("gridLayout").headTbl:e.dom()).rows[this.filtersRowIndex].style.display;this.show(!t)}},{key:"show",value:function show(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.tf,n=(t.gridLayout?t.feature("gridLayout").headTbl:t.dom()).rows[this.filtersRowIndex];e&&this.onBeforeShow(this),e||this.onBeforeHide(this),n.style.display=e?"":"none",this.enableIcon&&!this.btnHtml&&(this.btnEl.innerHTML=e?this.collapseBtnHtml:this.expandBtnHtml),e&&this.onAfterShow(this),e||this.onAfterHide(this),this.emitter.emit("filters-toggled",t,this,e)}},{key:"destroy",value:function destroy(){var e=this;this.initialized&&(this.emitter.off(["show-filters"],function(t,n){return e.show(n)}),this.btnEl.innerHTML="",(0,o.removeElm)(this.btnEl),this.btnEl=null,this.contEl.innerHTML="",(0,o.removeElm)(this.contEl),this.contEl=null,this.initialized=!1)}}]),FiltersVisibility}();t.default=c},445:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),i=n(11),o=n(10),s=n(3),a=n(18),l=n(16),d=n(15),c=n(7),u=n(33);var f=function(e){function ColsVisibility(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ColsVisibility);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(ColsVisibility.__proto__||Object.getPrototypeOf(ColsVisibility)).call(this,e,t.name)),r=n.config;return n.name=t.name,n.desc=(0,c.defaultsStr)(t.description,"Columns visibility manager"),n.spanEl=null,n.btnEl=null,n.contEl=null,n.tickToHide=(0,c.defaultsBool)(t.tick_to_hide,!0),n.manager=(0,c.defaultsBool)(t.manager,!0),n.headersTbl=t.headers_table||null,n.headersIndex=(0,c.defaultsNb)(t.headers_index,1),n.contElTgtId=(0,c.defaultsStr)(t.container_target_id,null),n.headersText=(0,c.defaultsArr)(t.headers_text,[]),n.btnTgtId=(0,c.defaultsStr)(t.btn_target_id,null),n.btnText=(0,c.defaultsStr)(t.btn_text,"Columns&#9660;"),n.btnHtml=(0,c.defaultsStr)(t.btn_html,null),n.btnCssClass=(0,c.defaultsStr)(t.btn_css_class,"colVis"),n.btnCloseText=(0,c.defaultsStr)(t.btn_close_text,"Close"),n.btnCloseHtml=(0,c.defaultsStr)(t.btn_close_html,null),n.btnCloseCssClass=(0,c.defaultsStr)(t.btn_close_css_class,n.btnCssClass),n.stylesheet=(0,c.defaultsStr)(t.stylesheet,"colsVisibility.css"),n.spanCssClass=(0,c.defaultsStr)(t.span_css_class,"colVisSpan"),n.contCssClass=(0,c.defaultsStr)(t.cont_css_class,"colVisCont"),n.listCssClass=(0,c.defaultsStr)(r.list_css_class,"cols_checklist"),n.listItemCssClass=(0,c.defaultsStr)(r.checklist_item_css_class,"cols_checklist_item"),n.listSlcItemCssClass=(0,c.defaultsStr)(r.checklist_selected_item_css_class,"cols_checklist_slc_item"),n.text=(0,c.defaultsStr)(t.text,n.tickToHide?"Hide: ":"Show: "),n.atStart=(0,c.defaultsArr)(t.at_start,[]),n.enableHover=Boolean(t.enable_hover),n.enableTickAll=Boolean(t.enable_tick_all),n.tickAllText=(0,c.defaultsStr)(t.tick_all_text,"Select all:"),n.toolbarPosition=(0,c.defaultsStr)(t.toolbar_position,u.RIGHT),n.hiddenCols=[],n.boundMouseup=null,n.onLoaded=(0,c.defaultsFn)(t.on_loaded,s.EMPTY_FN),n.onBeforeOpen=(0,c.defaultsFn)(t.on_before_open,s.EMPTY_FN),n.onAfterOpen=(0,c.defaultsFn)(t.on_after_open,s.EMPTY_FN),n.onBeforeClose=(0,c.defaultsFn)(t.on_before_close,s.EMPTY_FN),n.onAfterClose=(0,c.defaultsFn)(t.on_after_close,s.EMPTY_FN),n.onBeforeColHidden=(0,c.defaultsFn)(t.on_before_col_hidden,s.EMPTY_FN),n.onAfterColHidden=(0,c.defaultsFn)(t.on_after_col_hidden,s.EMPTY_FN),n.onBeforeColDisplayed=(0,c.defaultsFn)(t.on_before_col_displayed,s.EMPTY_FN),n.onAfterColDisplayed=(0,c.defaultsFn)(t.on_after_col_displayed,s.EMPTY_FN),e.gridLayout&&(n.headersTbl=e.feature("gridLayout").headTbl,n.headersIndex=0),e.import(t.name+"Style",e.getStylePath()+n.stylesheet,null,"link"),n.enable(),n}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ColsVisibility,i.Feature),r(ColsVisibility,[{key:"onMouseup",value:function onMouseup(e){for(var t=(0,a.targetEvt)(e);t&&t!==this.contEl&&t!==this.btnEl;)t=t.parentNode;t!==this.contEl&&t!==this.btnEl&&this.toggle()}},{key:"toggle",value:function toggle(){(0,a.removeEvt)(l.root,"mouseup",this.boundMouseup);var e=this.contEl.style.display;"inline"!==e&&this.onBeforeOpen(this),"inline"===e&&this.onBeforeClose(this),this.contEl.style.display="inline"===e?d.NONE:"inline","inline"!==e&&(this.onAfterOpen(this),(0,a.addEvt)(l.root,"mouseup",this.boundMouseup)),"inline"===e&&this.onAfterClose(this)}},{key:"checkItem",value:function checkItem(e){var t=e.parentNode;if(t&&e){var n=e.firstChild.checked,r=e.firstChild.getAttribute("id").split("_")[1];r=parseInt(r,10),n?(0,o.addClass)(t,this.listSlcItemCssClass):(0,o.removeClass)(t,this.listSlcItemCssClass);var i=!1;(this.tickToHide&&n||!this.tickToHide&&!n)&&(i=!0),this.setHidden(r,i)}}},{key:"init",value:function init(){var e=this;!this.initialized&&this.manager&&(this.emitter.emit("initializing-extension",this,!(0,s.isNull)(this.btnTgtId)),this.emitter.on(["hide-column"],function(t,n){return e.hideCol(n)}),this.buildBtn(),this.buildManager(),this.initialized=!0,this.boundMouseup=this.onMouseup.bind(this),this.emitter.emit("columns-visibility-initialized",this.tf,this),this.emitter.emit("extension-initialized",this),this._hideAtStart())}},{key:"buildBtn",value:function buildBtn(){var e=this;if(!this.btnEl){var t=this.tf,n=(0,o.createElm)("span");n.className=this.spanCssClass;var r=this.btnTgtId?(0,o.elm)(this.btnTgtId):t.feature("toolbar").container(this.toolbarPosition);if(this.btnTgtId)r.appendChild(n);else{var i=r.firstChild;i.parentNode.insertBefore(n,i)}if(this.btnHtml){n.innerHTML=this.btnHtml;var s=n.firstChild;this.enableHover?(0,a.addEvt)(s,"mouseover",function(t){return e.toggle(t)}):(0,a.addEvt)(s,"click",function(t){return e.toggle(t)})}else{var l=(0,o.createElm)("a",["href","javascript:;"]);l.className=this.btnCssClass,l.title=this.desc,l.innerHTML=this.btnText,n.appendChild(l),this.enableHover?(0,a.addEvt)(l,"mouseover",function(t){return e.toggle(t)}):(0,a.addEvt)(l,"click",function(t){return e.toggle(t)})}this.spanEl=n,this.btnEl=this.spanEl.firstChild,this.onLoaded(this)}}},{key:"buildManager",value:function buildManager(){var e=this,t=this.tf,n=this.contElTgtId?(0,o.elm)(this.contElTgtId):(0,o.createElm)("div");n.className=this.contCssClass;var r=(0,o.createElm)("p");r.innerHTML=this.text,n.appendChild(r);var i=(0,o.createElm)("ul");i.className=this.listCssClass;var s=this.headersTbl||t.dom(),l=this.headersTbl?this.headersIndex:t.getHeadersRowIndex(),d=s.rows[l];if(this.enableTickAll){var c=(0,o.createCheckItem)("col__"+t.id,this.tickAllText,this.tickAllText);(0,o.addClass)(c,this.listItemCssClass),i.appendChild(c),c.check.checked=!this.tickToHide,(0,a.addEvt)(c.check,"click",function(){for(var e=0;e<d.cells.length;e++){var n=(0,o.elm)("col_"+e+"_"+t.id);n&&c.check.checked!==n.checked&&(n.click(),n.checked=c.check.checked)}})}for(var u=0;u<d.cells.length;u++){var f=d.cells[u],h=this.headersText[u]||this._getHeaderText(f),p=(0,o.createCheckItem)("col_"+u+"_"+t.id,h,h);(0,o.addClass)(p,this.listItemCssClass),this.tickToHide||(0,o.addClass)(p,this.listSlcItemCssClass),i.appendChild(p),this.tickToHide||(p.check.checked=!0),(0,a.addEvt)(p.check,"click",function(t){var n=(0,a.targetEvt)(t).parentNode;e.checkItem(n)})}var b=(0,o.createElm)("p",["align","center"]),m=void 0;this.btnCloseHtml?(b.innerHTML=this.btnCloseHtml,m=b.firstChild,(0,a.addEvt)(m,"click",function(t){return e.toggle(t)})):((m=(0,o.createElm)("a",["href","javascript:;"])).className=this.btnCloseCssClass,m.innerHTML=this.btnCloseText,(0,a.addEvt)(m,"click",function(t){return e.toggle(t)}),b.appendChild(m)),n.appendChild(i),n.appendChild(b),this.btnEl.parentNode.insertBefore(n,this.btnEl),this.contEl=n}},{key:"setHidden",value:function setHidden(e,t){var n=this.tf,r=n.dom();t?this.onBeforeColHidden(this,e):this.onBeforeColDisplayed(this,e),this._hideElements(r,e,t),this.headersTbl&&this._hideElements(this.headersTbl,e,t);var i=this.hiddenCols.indexOf(e);t?-1===i&&this.hiddenCols.push(e):-1!==i&&this.hiddenCols.splice(i,1),t?(this.onAfterColHidden(this,e),this.emitter.emit("column-hidden",n,this,e,this.hiddenCols)):(this.onAfterColDisplayed(this,e),this.emitter.emit("column-shown",n,this,e,this.hiddenCols))}},{key:"showCol",value:function showCol(e){if(!(0,s.isUndef)(e)&&this.isColHidden(e))if(this.manager&&this.contEl){var t=(0,o.elm)("col_"+e+"_"+this.tf.id);t&&t.click()}else this.setHidden(e,!1)}},{key:"hideCol",value:function hideCol(e){if(!(0,s.isUndef)(e)&&!this.isColHidden(e))if(this.manager&&this.contEl){var t=(0,o.elm)("col_"+e+"_"+this.tf.id);t&&t.click()}else this.setHidden(e,!0)}},{key:"isColHidden",value:function isColHidden(e){return-1!==this.hiddenCols.indexOf(e)}},{key:"toggleCol",value:function toggleCol(e){(0,s.isUndef)(e)||this.isColHidden(e)?this.showCol(e):this.hideCol(e)}},{key:"getHiddenCols",value:function getHiddenCols(){return this.hiddenCols}},{key:"destroy",value:function destroy(){var e=this;this.initialized&&((0,o.elm)(this.contElTgtId)?(0,o.elm)(this.contElTgtId).innerHTML="":(this.contEl.innerHTML="",(0,o.removeElm)(this.contEl),this.contEl=null),this.btnEl.innerHTML="",(0,o.removeElm)(this.btnEl),this.btnEl=null,this.emitter.off(["hide-column"],function(t,n){return e.hideCol(n)}),this.boundMouseup=null,this.initialized=!1)}},{key:"_getHeaderText",value:function _getHeaderText(e){if(!e.hasChildNodes)return"";for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(3===n.nodeType)return n.nodeValue;if(1===n.nodeType){if(n.id&&-1!==n.id.indexOf("popUp"))continue;return(0,o.getText)(n)}}return""}},{key:"_hideElements",value:function _hideElements(e,t,n){this._hideCells(e,t,n),this._hideCol(e,t,n)}},{key:"_hideCells",value:function _hideCells(e,t,n){for(var r=0;r<e.rows.length;r++){var i=e.rows[r].cells[t];i&&(i.style.display=n?d.NONE:"")}}},{key:"_hideCol",value:function _hideCol(e,t,n){var r=(0,o.tag)(e,"col");0!==r.length&&(r[t].style.display=n?d.NONE:"")}},{key:"_hideAtStart",value:function _hideAtStart(){var e=this;this.atStart.forEach(function(t){e.hideCol(t)})}}]),ColsVisibility}();t.default=f},446:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(e,t,n){return t&&defineProperties(e.prototype,t),n&&defineProperties(e,n),e}}(),i=n(11),o=n(10),s=n(3),a=n(107),l=n(15),d=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(451)),c=n(7),u=n(18);var f=["after-filtering","after-page-change","after-page-length-change"],h=function(e){function ColOps(e,t){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ColOps);var n=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(ColOps.__proto__||Object.getPrototypeOf(ColOps)).call(this,e,t.name));return n.onBeforeOperation=(0,c.defaultsFn)(t.on_before_operation,s.EMPTY_FN),n.onAfterOperation=(0,c.defaultsFn)(t.on_after_operation,s.EMPTY_FN),n.opts=t,n.labelIds=(0,c.defaultsArr)(t.id,[]),n.colIndexes=(0,c.defaultsArr)(t.col,[]),n.operations=(0,c.defaultsArr)(t.operation,[]),n.outputTypes=(0,c.defaultsArr)(t.write_method,[]),n.formatResults=(0,c.defaultsArr)(t.format_result,[]),n.totRowIndexes=(0,c.defaultsArr)(t.tot_row_index,[]),n.excludeRows=(0,c.defaultsArr)(t.exclude_row,[]),n.decimalPrecisions=(0,c.defaultsArr)(t.decimal_precision,2),n.enable(),n}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ColOps,i.Feature),r(ColOps,[{key:"init",value:function init(){this.initialized||(this.emitter.on(f,(0,u.bound)(this.calcAll,this)),this.calcAll(),this.initialized=!0)}},{key:"calcAll",value:function calcAll(){var e=this.tf;if(e.isInitialized()){this.onBeforeOperation(e,this),this.emitter.emit("before-column-operation",e,this);var t=this.colIndexes,n=this.operations,r=this.outputTypes,i=this.totRowIndexes,o=this.excludeRows,a=this.formatResults,l=this.decimalPrecisions,d=[];t.forEach(function(e){-1===d.indexOf(e)&&d.push(e)});for(var c=d.length,u=e.dom().rows,f=[],h=0;h<c;h++){f.push(e.getVisibleColumnData(d[h],!1,o));for(var p=f[h],b=0,m=[],g=[],y=[],v=void 0,T=[],_=0,S=0;S<t.length;S++)t[S]===d[h]&&(m[_]=(n[S]||"sum").toLowerCase(),g[_]=l[S],y[_]=this.labelIds[S],v=(0,s.isArray)(r)?r[S]:null,T[_]=this.configureFormat(d[h],a[S]),_++);for(var C=0;C<_;C++)this.emitter.emit("before-column-calc",e,this,d[h],p,m[C],g[C]),b=Number(this.calc(p,m[C],null)),this.emitter.emit("column-calc",e,this,d[h],b,m[C],g[C]),this.writeResult(b,y[C],v,g[C],T[C]);var w=i&&i[h]?u[i[h]]:null;w&&(w.style.display="")}this.onAfterOperation(e,this),this.emitter.emit("after-column-operation",e,this)}}},{key:"columnCalc",value:function columnCalc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sum",n=arguments[2],r=this.excludeRows||[],i=tf.getVisibleColumnData(e,!1,r);return Number(this.calc(i,t,n))}},{key:"calc",value:function calc(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"sum",n=arguments[2],r=0;switch("q1"!==t&&"q3"!==t&&"median"!==t||(e=this.sortColumnValues(e,a.numSortAsc)),t){case"mean":r=this.calcMean(e);break;case"sum":r=this.calcSum(e);break;case"min":r=this.calcMin(e);break;case"max":r=this.calcMax(e);break;case"median":r=this.calcMedian(e);break;case"q1":r=this.calcQ1(e);break;case"q3":r=this.calcQ3(e)}return(0,s.isEmpty)(n)?r:r.toFixed(n)}},{key:"calcSum",value:function calcSum(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(0,s.isEmpty)(e)?0:e.reduce(function(e,t){return Number(e)+Number(t)})}},{key:"calcMean",value:function calcMean(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.calcSum(e)/e.length;return Number(t)}},{key:"calcMax",value:function calcMax(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Math.max.apply(null,e)}},{key:"calcMin",value:function calcMin(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return Math.min.apply(null,e)}},{key:"calcMedian",value:function calcMedian(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length,n=0;return t%2==1?(n=Math.floor(t/2),Number(e[n])):(Number(e[t/2])+Number(e[t/2-1]))/2}},{key:"calcQ1",value:function calcQ1(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=t.length;return 4*(e=Math.floor(n/4))===n?(Number(t[e-1])+Number(t[e]))/2:Number(t[e])}},{key:"calcQ3",value:function calcQ3(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=t.length,r=0;return 4*(e=Math.floor(n/4))===n?(r=3*e,(Number(t[r])+Number(t[r-1]))/2):Number(t[n-e-1])}},{key:"sortColumnValues",value:function sortColumnValues(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];return e.sort(t)}},{key:"writeResult",value:function writeResult(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"innerhtml",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},s=(0,o.elm)(t);if(s)switch(e=e.toFixed(r),e=isNaN(e)||!isFinite(e)?"":(0,d.default)(i)(e),n.toLowerCase()){case"innerhtml":s.innerHTML=e;break;case"setvalue":s.value=e;break;case"createtextnode":var a=s.firstChild,l=(0,o.createText)(e);s.replaceChild(l,a)}}},{key:"configureFormat",value:function configureFormat(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.tf;if(n.hasType(e,[l.FORMATTED_NUMBER])){var r=n.colTypes[e];r.decimal&&!t.decimal&&(t.decimal=r.decimal),r.thousands&&!t.integerSeparator&&(t.integerSeparator=r.thousands)}else t.decimal=t.decimal||"",t.integerSeparator=t.integerSeparator||"";return t}},{key:"destroy",value:function destroy(){this.initialized&&(this.emitter.off(f,(0,u.bound)(this.calcAll,this)),this.initialized=!1)}}]),ColOps}();t.default=h},447:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n(442));t.default=r.default},448:function(e,t){e.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\tthis.sortTypes = oSortTypes || [];\r\n\r\n\tthis.sortColumn = null;\r\n\tthis.descending = null;\r\n\r\n\tvar oThis = this;\r\n\tthis._headerOnclick = function (e) {\r\n\t\toThis.headerOnclick(e);\r\n\t};\r\n\r\n\tif (oTable) {\r\n\t\tthis.setTable( oTable );\r\n\t\tthis.document = oTable.ownerDocument || oTable.document;\r\n\t}\r\n\telse {\r\n\t\tthis.document = document;\r\n\t}\r\n\r\n\r\n\t// only IE needs this\r\n\tvar win = this.document.defaultView || this.document.parentWindow;\r\n\tthis._onunload = function () {\r\n\t\toThis.destroy();\r\n\t};\r\n\tif (win && typeof win.attachEvent != "undefined") {\r\n\t\twin.attachEvent("onunload", this._onunload);\r\n\t}\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\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.element = oTable;\r\n\tthis.setTHead( oTable.tHead );\r\n\tthis.setTBody( oTable.tBodies[0] );\r\n};\r\n\r\nSortableTable.prototype.setTHead = function (oTHead) {\r\n\tif (this.tHead && this.tHead != oTHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.tHead = oTHead;\r\n\tthis.initHeader( this.sortTypes );\r\n};\r\n\r\nSortableTable.prototype.setTBody = function (oTBody) {\r\n\tthis.tBody = oTBody;\r\n};\r\n\r\nSortableTable.prototype.setSortTypes = function ( oSortTypes ) {\r\n\tif ( this.tHead )\r\n\t\tthis.uninitHeader();\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tif ( this.tHead )\r\n\t\tthis.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\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar doc = this.tHead.ownerDocument || this.tHead.document;\r\n\tthis.sortTypes = oSortTypes || [];\r\n\tvar l = cells.length;\r\n\tvar img, c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (this.sortTypes[i] != null && this.sortTypes[i] != "None") {\r\n\t\t\timg = doc.createElement("IMG");\r\n\t\t\timg.src = "images/blank.png";\r\n\t\t\tc.appendChild(img);\r\n\t\t\tif (this.sortTypes[i] != null)\r\n\t\t\t\tc._sortType = this.sortTypes[i];\r\n\t\t\tif (typeof c.addEventListener != "undefined")\r\n\t\t\t\tc.addEventListener("click", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.attachEvent != "undefined")\r\n\t\t\t\tc.attachEvent("onclick", this._headerOnclick);\r\n\t\t\telse\r\n\t\t\t\tc.onclick = this._headerOnclick;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tc.setAttribute( "_sortType", oSortTypes[i] );\r\n\t\t\tc._sortType = "None";\r\n\t\t}\r\n\t}\r\n\tthis.updateHeaderArrows();\r\n};\r\n\r\n// remove arrows and events\r\nSortableTable.prototype.uninitHeader = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar c;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tc = cells[i];\r\n\t\tif (c._sortType != null && c._sortType != "None") {\r\n\t\t\tc.removeChild(c.lastChild);\r\n\t\t\tif (typeof c.removeEventListener != "undefined")\r\n\t\t\t\tc.removeEventListener("click", this._headerOnclick, false);\r\n\t\t\telse if (typeof c.detachEvent != "undefined")\r\n\t\t\t\tc.detachEvent("onclick", this._headerOnclick);\r\n\t\t\tc._sortType = null;\r\n\t\t\tc.removeAttribute( "_sortType" );\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.updateHeaderArrows = function () {\r\n\tif (!this.tHead) return;\r\n\tvar cells = this.tHead.rows[0].cells;\r\n\tvar l = cells.length;\r\n\tvar img;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tif (cells[i]._sortType != null && cells[i]._sortType != "None") {\r\n\t\t\timg = cells[i].lastChild;\r\n\t\t\tif (i == this.sortColumn)\r\n\t\t\t\timg.className = "sort-arrow " + (this.descending ? "descending" : "ascending");\r\n\t\t\telse\r\n\t\t\t\timg.className = "sort-arrow";\r\n\t\t}\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.headerOnclick = function (e) {\r\n\t// find TD element\r\n\tvar el = e.target || e.srcElement;\r\n\twhile (el.tagName != "TD")\r\n\t\tel = el.parentNode;\r\n\r\n\tthis.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\tvar cells = oTd.parentNode.childNodes\r\n\tvar l = cells.length;\r\n\tvar i;\r\n\tfor (i = 0; cells[i] != oTd && i < l; i++)\r\n\t\t;\r\n\treturn i;\r\n};\r\n\r\nSortableTable.prototype.getSortType = function (nColumn) {\r\n\treturn 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\tif (!this.tBody) return;\r\n\tif (sSortType == null)\r\n\t\tsSortType = this.getSortType(nColumn);\r\n\r\n\t// exit if None\r\n\tif (sSortType == "None")\r\n\t\treturn;\r\n\r\n\tif (bDescending == null) {\r\n\t\tif (this.sortColumn != nColumn)\r\n\t\t\tthis.descending = this.defaultDescending;\r\n\t\telse\r\n\t\t\tthis.descending = !this.descending;\r\n\t}\r\n\telse\r\n\t\tthis.descending = bDescending;\r\n\r\n\tthis.sortColumn = nColumn;\r\n\r\n\tif (typeof this.onbeforesort == "function")\r\n\t\tthis.onbeforesort();\r\n\r\n\tvar f = this.getSortFunction(sSortType, nColumn);\r\n\tvar a = this.getCache(sSortType, nColumn);\r\n\tvar tBody = this.tBody;\r\n\r\n\ta.sort(f);\r\n\r\n\tif (this.descending)\r\n\t\ta.reverse();\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// remove from doc\r\n\t\tvar nextSibling = tBody.nextSibling;\r\n\t\tvar p = tBody.parentNode;\r\n\t\tp.removeChild(tBody);\r\n\t}\r\n\r\n\t// insert in the new order\r\n\tvar l = a.length;\r\n\tfor (var i = 0; i < l; i++)\r\n\t\ttBody.appendChild(a[i].element);\r\n\r\n\tif (SortableTable.removeBeforeSort) {\r\n\t\t// insert into doc\r\n\t\tp.insertBefore(tBody, nextSibling);\r\n\t}\r\n\r\n\tthis.updateHeaderArrows();\r\n\r\n\tthis.destroyCache(a);\r\n\r\n\tif (typeof this.onsort == "function")\r\n\t\tthis.onsort();\r\n};\r\n\r\nSortableTable.prototype.asyncSort = function (nColumn, bDescending, sSortType) {\r\n\tvar oThis = this;\r\n\tthis._asyncsort = function () {\r\n\t\toThis.sort(nColumn, bDescending, sSortType);\r\n\t};\r\n\twindow.setTimeout(this._asyncsort, 1);\r\n};\r\n\r\nSortableTable.prototype.getCache = function (sType, nColumn) {\r\n\tif (!this.tBody) return [];\r\n\tvar rows = this.tBody.rows;\r\n\tvar l = rows.length;\r\n\tvar a = new Array(l);\r\n\tvar r;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tr = rows[i];\r\n\t\ta[i] = {\r\n\t\t\tvalue:\t\tthis.getRowValue(r, sType, nColumn),\r\n\t\t\telement:\tr\r\n\t\t};\r\n\t};\r\n\treturn a;\r\n};\r\n\r\nSortableTable.prototype.destroyCache = function (oArray) {\r\n\tvar l = oArray.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\toArray[i].value = null;\r\n\t\toArray[i].element = null;\r\n\t\toArray[i] = null;\r\n\t}\r\n};\r\n\r\nSortableTable.prototype.getRowValue = function (oRow, sType, nColumn) {\r\n\t// if we have defined a custom getRowValue use that\r\n\tif (this._sortTypeInfo[sType] && this._sortTypeInfo[sType].getRowValue)\r\n\t\treturn this._sortTypeInfo[sType].getRowValue(oRow, nColumn);\r\n\r\n\tvar s;\r\n\tvar c = oRow.cells[nColumn];\r\n\tif (typeof c.innerText != "undefined")\r\n\t\ts = c.innerText;\r\n\telse\r\n\t\ts = SortableTable.getInnerText(c);\r\n\treturn this.getValueFromString(s, sType);\r\n};\r\n\r\nSortableTable.getInnerText = function (oNode) {\r\n\tvar s = "";\r\n\tvar cs = oNode.childNodes;\r\n\tvar l = cs.length;\r\n\tfor (var i = 0; i < l; i++) {\r\n\t\tswitch (cs[i].nodeType) {\r\n\t\t\tcase 1: //ELEMENT_NODE\r\n\t\t\t\ts += SortableTable.getInnerText(cs[i]);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 3:\t//TEXT_NODE\r\n\t\t\t\ts += cs[i].nodeValue;\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\treturn s;\r\n};\r\n\r\nSortableTable.prototype.getValueFromString = function (sText, sType) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].getValueFromString( sText );\r\n\treturn sText;\r\n\t/*\r\n\tswitch (sType) {\r\n\t\tcase "Number":\r\n\t\t\treturn Number(sText);\r\n\t\tcase "CaseInsensitiveString":\r\n\t\t\treturn sText.toUpperCase();\r\n\t\tcase "Date":\r\n\t\t\tvar parts = sText.split("-");\r\n\t\t\tvar d = new Date(0);\r\n\t\t\td.setFullYear(parts[0]);\r\n\t\t\td.setDate(parts[2]);\r\n\t\t\td.setMonth(parts[1] - 1);\r\n\t\t\treturn d.valueOf();\r\n\t}\r\n\treturn sText;\r\n\t*/\r\n\t};\r\n\r\nSortableTable.prototype.getSortFunction = function (sType, nColumn) {\r\n\tif (this._sortTypeInfo[sType])\r\n\t\treturn this._sortTypeInfo[sType].compare;\r\n\treturn SortableTable.basicCompare;\r\n};\r\n\r\nSortableTable.prototype.destroy = function () {\r\n\tthis.uninitHeader();\r\n\tvar win = this.document.parentWindow;\r\n\tif (win && typeof win.detachEvent != "undefined") {\t// only IE needs this\r\n\t\twin.detachEvent("onunload", this._onunload);\r\n\t}\r\n\tthis._onunload = null;\r\n\tthis.element = null;\r\n\tthis.tHead = null;\r\n\tthis.tBody = null;\r\n\tthis.document = null;\r\n\tthis._headerOnclick = null;\r\n\tthis.sortTypes = null;\r\n\tthis._asyncsort = null;\r\n\tthis.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\tthis._sortTypeInfo[sType] = {\r\n\t\ttype:\t\t\t\tsType,\r\n\t\tgetValueFromString:\tfGetValueFromString || SortableTable.idFunction,\r\n\t\tcompare:\t\t\tfCompareFunction || SortableTable.basicCompare,\r\n\t\tgetRowValue:\t\tfGetRowValue\r\n\t};\r\n};\r\n\r\n// this removes the sort type from all instances of SortableTable\r\nSortableTable.prototype.removeSortType = function (sType) {\r\n\tdelete this._sortTypeInfo[sType];\r\n};\r\n\r\nSortableTable.basicCompare = function compare(n1, n2) {\r\n\tif (n1.value < n2.value)\r\n\t\treturn -1;\r\n\tif (n2.value < n1.value)\r\n\t\treturn 1;\r\n\treturn 0;\r\n};\r\n\r\nSortableTable.idFunction = function (x) {\r\n\treturn x;\r\n};\r\n\r\nSortableTable.toUpperCase = function (s) {\r\n\treturn s.toUpperCase();\r\n};\r\n\r\nSortableTable.toDate = function (s) {\r\n\tvar parts = s.split("-");\r\n\tvar d = new Date(0);\r\n\td.setFullYear(parts[0]);\r\n\td.setDate(parts[2]);\r\n\td.setMonth(parts[1] - 1);\r\n\treturn 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'},449:function(e,t){e.exports=function(e){function log(e){"undefined"!=typeof console&&(console.error||console.log)("[Script Loader]",e)}try{"undefined"!=typeof execScript&&function isIE(){return"undefined"!=typeof attachEvent&&"undefined"==typeof addEventListener}()?execScript(e):"undefined"!=typeof eval?eval.call(null,e):log("EvalError: No eval function available")}catch(e){log(e)}}},450:function(e,t,n){n(449)(n(448))},451:function(e,t){function formatter(e){if((e=e||{}).negativeType=e.negativeType||("R"===e.negative?"right":"left"),"string"!=typeof e.negativeLeftSymbol)switch(e.negativeType){case"left":e.negativeLeftSymbol="-";break;case"brackets":e.negativeLeftSymbol="(";break;default:e.negativeLeftSymbol=""}if("string"!=typeof e.negativeRightSymbol)switch(e.negativeType){case"right":e.negativeRightSymbol="-";break;case"brackets":e.negativeRightSymbol=")";break;default:e.negativeRightSymbol=""}function format(t,n){if(n=n||{},!t&&0!==t)return"";var r=[],i="-"===(t=""+t).charAt(0);return t=t.replace(/^\-/g,""),e.negativeLeftOut||n.noUnits||r.push(e.prefix),i&&r.push(e.negativeLeftSymbol),e.negativeLeftOut&&!n.noUnits&&r.push(e.prefix),t=t.split("."),null!=e.round&&function round(e,t){if(e[1]&&t>=0&&e[1].length>t){var n=e[1].slice(0,t);if(+e[1].substr(t,1)>=5){for(var r="";"0"===n.charAt(0);)r+="0",n=n.substr(1);(n=r+(n=+n+1+"")).length>t&&(e[0]=+e[0]+ +n.charAt(0)+"",n=n.substring(1))}e[1]=n}return e}(t,e.round),null!=e.truncate&&(t[1]=function truncate(e,t){e&&(e+="");return e&&e.length>t?e.substr(0,t):e}(t[1],e.truncate)),e.padLeft>0&&(t[0]=function padLeft(e,t){e+="";var n=[];for(;n.length+e.length<t;)n.push("0");return n.join("")+e}(t[0],e.padLeft)),e.padRight>0&&(t[1]=function padRight(e,t){e?e+="":e="";var n=[];for(;n.length+e.length<t;)n.push("0");return e+n.join("")}(t[1],e.padRight)),!n.noSeparator&&t[1]&&(t[1]=function addDecimalSeparators(e,t){if(e+="",!t)return e;var n=/(\d{3})(\d+)/;for(;n.test(e);)e=e.replace(n,"$1"+t+"$2");return e}(t[1],e.decimalsSeparator)),!n.noSeparator&&t[0]&&(t[0]=function addIntegerSeparators(e,t){if(e+="",!t)return e;var n=/(\d+)(\d{3})/;for(;n.test(e);)e=e.replace(n,"$1"+t+"$2");return e}(t[0],e.integerSeparator)),r.push(t[0]),t[1]&&(r.push(e.decimal),r.push(t[1])),e.negativeRightOut&&!n.noUnits&&r.push(e.suffix),i&&r.push(e.negativeRightSymbol),e.negativeRightOut||n.noUnits||r.push(e.suffix),r.join("")}function unformat(t,n){n=n||[],e.allowedSeparators&&e.allowedSeparators.forEach(function(e){n.push(e)}),n.push(e.integerSeparator),n.push(e.decimalsSeparator);var r=t=(t=t.replace(e.prefix,"")).replace(e.suffix,"");do{t=r;for(var i=0;i<n.length;i++)r=r.replace(n[i],"")}while(r!=t);return t}return"boolean"!=typeof e.negativeLeftOut&&(e.negativeLeftOut=!1!==e.negativeOut),"boolean"!=typeof e.negativeRightOut&&(e.negativeRightOut=!1!==e.negativeOut),e.prefix=e.prefix||"",e.suffix=e.suffix||"","string"!=typeof e.integerSeparator&&(e.integerSeparator="string"==typeof e.separator?e.separator:","),e.decimalsSeparator="string"==typeof e.decimalsSeparator?e.decimalsSeparator:"",e.decimal=e.decimal||".",e.padLeft=e.padLeft||-1,e.padRight=e.padRight||-1,format.negative=e.negative,format.negativeOut=e.negativeOut,format.negativeType=e.negativeType,format.negativeLeftOut=e.negativeLeftOut,format.negativeLeftSymbol=e.negativeLeftSymbol,format.negativeRightOut=e.negativeRightOut,format.negativeRightSymbol=e.negativeRightSymbol,format.prefix=e.prefix,format.suffix=e.suffix,format.separate=e.separate,format.integerSeparator=e.integerSeparator,format.decimalsSeparator=e.decimalsSeparator,format.decimal=e.decimal,format.padLeft=e.padLeft,format.padRight=e.padRight,format.truncate=e.truncate,format.round=e.round,format.unformat=unformat,format}e.exports=formatter,e.exports.default=formatter}}]);
//# sourceMappingURL=tf-0-2c8620168298c5a11749.js.map