ag-grid
Version:
Advanced Javascript Datagrid. Supports raw Javascript, AngularJS 1.x, AngularJS 2.0 and Web Components
3 lines (2 loc) • 206 kB
JavaScript
var ag;!function(e){var t;!function(e){var t=function(){function t(e){this.type=e}return t.prototype.toString=function(){var e="ColumnChangeEvent {type: "+this.type;return this.column&&(e+=", column: "+this.column.colId),this.columnGroup&&(e+=", columnGroup: "+this.columnGroup.name),this.fromIndex&&(e+=", fromIndex: "+this.fromIndex),this.toIndex&&(e+=", toIndex: "+this.toIndex),this.pinnedColumnCount&&(e+=", pinnedColumnCount: "+this.pinnedColumnCount),e+="}"},t.prototype.withColumn=function(e){return this.column=e,this},t.prototype.withColumnGroup=function(e){return this.columnGroup=e,this},t.prototype.withFromIndex=function(e){return this.fromIndex=e,this},t.prototype.withPinnedColumnCount=function(e){return this.pinnedColumnCount=e,this},t.prototype.withToIndex=function(e){return this.toIndex=e,this},t.prototype.getFromIndex=function(){return this.fromIndex},t.prototype.getToIndex=function(){return this.toIndex},t.prototype.getPinnedColumnCount=function(){return this.pinnedColumnCount},t.prototype.getType=function(){return this.type},t.prototype.getColumn=function(){return this.column},t.prototype.getColumnGroup=function(){return this.columnGroup},t.prototype.isPivotChanged=function(){return this.type===e.Events.EVENT_COLUMN_PIVOT_CHANGE||this.type===e.Events.EVENT_COLUMN_EVERYTHING_CHANGED},t.prototype.isValueChanged=function(){return this.type===e.Events.EVENT_COLUMN_VALUE_CHANGE||this.type===e.Events.EVENT_COLUMN_EVERYTHING_CHANGED},t.prototype.isIndividualColumnResized=function(){return this.type===e.Events.EVENT_COLUMN_RESIZED&&void 0!==this.column&&null!==this.column},t}();e.ColumnChangeEvent=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/gm,i=/([^\s,]+)/g,o=function(){function e(){}return e.iterateObject=function(e,t){for(var i=Object.keys(e),o=0;o<i.length;o++){var n=i[o],r=e[n];t(n,r)}},e.cloneObject=function(e){for(var t={},i=Object.keys(e),o=0;o<i.length;o++){var n=i[o],r=e[n];t[n]=r}return t},e.map=function(e,t){for(var i=[],o=0;o<e.length;o++){var n=e[o],r=t(n);i.push(r)}return i},e.forEach=function(e,t){if(e)for(var i=0;i<e.length;i++){var o=e[i];t(o,i)}},e.filter=function(e,t){var i=[];return e.forEach(function(e){t(e)&&i.push(e)}),i},e.assign=function(t,i){e.iterateObject(i,function(e,i){t[e]=i})},e.getFunctionParameters=function(e){var o=e.toString().replace(t,""),n=o.slice(o.indexOf("(")+1,o.indexOf(")")).match(i);return null===n?[]:n},e.find=function(e,t,i){if(null===e||void 0===e)return null;for(var o=0;o<e.length;o++)if(e[o][t]===i)return e[o];return null},e.toStrings=function(e){return this.map(e,function(e){return void 0!==e&&null!==e&&e.toString?e.toString():null})},e.iterateArray=function(e,t){for(var i=0;i<e.length;i++){var o=e[i];t(o,i)}},e.isNode=function(e){return"object"==typeof Node?e instanceof Node:e&&"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},e.isElement=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName},e.isNodeOrElement=function(e){return this.isNode(e)||this.isElement(e)},e.addChangeListener=function(e,t){e.addEventListener("changed",t),e.addEventListener("paste",t),e.addEventListener("input",t),e.addEventListener("keydown",t),e.addEventListener("keyup",t)},e.makeNull=function(e){return null===e||void 0===e||""===e?null:e},e.removeAllChildren=function(e){if(e)for(;e.hasChildNodes();)e.removeChild(e.lastChild)},e.removeElement=function(e,t){this.removeFromParent(e.querySelector(t))},e.removeFromParent=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},e.isVisible=function(e){return null!==e.offsetParent},e.loadTemplate=function(e){var t=document.createElement("div");return t.innerHTML=e,t.firstChild},e.querySelectorAll_addCssClass=function(e,t,i){for(var o=e.querySelectorAll(t),n=0;n<o.length;n++)this.addCssClass(o[n],i)},e.querySelectorAll_removeCssClass=function(e,t,i){for(var o=e.querySelectorAll(t),n=0;n<o.length;n++)this.removeCssClass(o[n],i)},e.querySelectorAll_replaceCssClass=function(e,t,i,o){for(var n=e.querySelectorAll(t),r=0;r<n.length;r++)this.removeCssClass(n[r],i),this.addCssClass(n[r],o)},e.addOrRemoveCssClass=function(e,t,i){i?this.addCssClass(e,t):this.removeCssClass(e,t)},e.addCssClass=function(e,t){if(e.className&&e.className.length>0){var i=e.className.split(" ");i.indexOf(t)<0&&(i.push(t),e.className=i.join(" "))}else e.className=t},e.offsetHeight=function(e){return e&&e.clientHeight?e.clientHeight:0},e.offsetWidth=function(e){return e&&e.clientWidth?e.clientWidth:0},e.removeCssClass=function(e,t){if(e.className&&e.className.length>0){var i=e.className.split(" "),o=i.indexOf(t);o>=0&&(i.splice(o,1),e.className=i.join(" "))}},e.removeFromArray=function(e,t){e.indexOf(t)>=0&&e.splice(e.indexOf(t),1)},e.defaultComparator=function(e,t){var i=null===e||void 0===e,o=null===t||void 0===t;return i&&o?0:i?-1:o?1:t>e?-1:e>t?1:0},e.formatWidth=function(e){return"number"==typeof e?e+"px":e},e.useRenderer=function(e,t,i){var o=t(i);if("string"==typeof o){var n=document.createElement("span");n.innerHTML=o,e.appendChild(n)}else this.isNodeOrElement(o)&&e.appendChild(o)},e.createIcon=function(e,t,i,o){var n,r=document.createElement("span");if(i&&i.colDef.icons&&(n=i.colDef.icons[e]),!n&&t.getIcons()&&(n=t.getIcons()[e]),n){var s;if("function"==typeof n)s=n();else{if("string"!=typeof n)throw"icon from grid options needs to be a string or a function";s=n}if("string"==typeof s)r.innerHTML=s;else{if(!this.isNodeOrElement(s))throw"iconRenderer should return back a string or a dom object";r.appendChild(s)}}else r.appendChild(o());return r},e.addStylesToElement=function(e,t){Object.keys(t).forEach(function(i){e.style[i]=t[i]})},e.getScrollbarWidth=function(){var e=document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var i=document.createElement("div");i.style.width="100%",e.appendChild(i);var o=i.offsetWidth;return e.parentNode.removeChild(e),t-o},e.isKeyPressed=function(e,t){var i=e.which||e.keyCode;return i===t},e.setVisible=function(e,t){e.style.display=t?"inline":"none"},e.isBrowserIE=function(){return this.isIE},e.isBrowserSafari=function(){return this.isSafari},e.isSafari=Object.prototype.toString.call(window.HTMLElement).indexOf("Constructor")>0,e.isIE=!1||!!document.documentMode,e}();e.Utils=o}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function e(){}return e.STEP_EVERYTHING=0,e.STEP_FILTER=1,e.STEP_SORT=2,e.STEP_MAP=3,e.ASC="asc",e.DESC="desc",e.ROW_BUFFER_SIZE=20,e.MIN_COL_WIDTH=10,e.SUM="sum",e.MIN="min",e.MAX="max",e.KEY_TAB=9,e.KEY_ENTER=13,e.KEY_BACKSPACE=8,e.KEY_DELETE=46,e.KEY_ESCAPE=27,e.KEY_SPACE=32,e.KEY_DOWN=40,e.KEY_UP=38,e.KEY_LEFT=37,e.KEY_RIGHT=39,e}();e.Constants=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Constants,i=function(){function e(t,i){this.colDef=t,this.actualWidth=i,this.visible=!t.hide,this.sort=t.sort,this.sortedAt=t.sortedAt,this.colId=t.colId?t.colId:t.field?t.field:""+e.colIdSequence++}return e.prototype.isGreaterThanMax=function(e){return this.colDef.maxWidth>=t.MIN_COL_WIDTH?e>this.colDef.maxWidth:!1},e.prototype.getMinimumWidth=function(){return this.colDef.minWidth>t.MIN_COL_WIDTH?this.colDef.minWidth:t.MIN_COL_WIDTH},e.prototype.setMinimum=function(){this.actualWidth=this.getMinimumWidth()},e.colIdSequence=0,e}();e.Column=i}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function e(e,t){this.allColumns=[],this.displayedColumns=[],this.expandable=!1,this.expanded=!1,this.pinned=e,this.name=t}return e.prototype.getMinimumWidth=function(){var e=0;return this.displayedColumns.forEach(function(t){e+=t.getMinimumWidth()}),e},e.prototype.addColumn=function(e){this.allColumns.push(e)},e.prototype.calculateExpandable=function(){for(var e=!1,t=!1,i=!1,o=0,n=this.allColumns.length;n>o;o++){var r=this.allColumns[o];"open"===r.colDef.headerGroupShow?(e=!0,i=!0):"closed"===r.colDef.headerGroupShow?(t=!0,i=!0):(e=!0,t=!0)}this.expandable=e&&t&&i},e.prototype.calculateActualWidth=function(){var e=0;this.displayedColumns.forEach(function(t){e+=t.actualWidth}),this.actualWidth=e},e.prototype.calculateDisplayedColumns=function(){if(this.displayedColumns=[],!this.expandable)return void(this.displayedColumns=this.allColumns);for(var e=0,t=this.allColumns.length;t>e;e++){var i=this.allColumns[e];switch(i.colDef.headerGroupShow){case"open":this.expanded&&this.displayedColumns.push(i);break;case"closed":this.expanded||this.displayedColumns.push(i);break;default:this.displayedColumns.push(i)}}},e.prototype.addToVisibleColumns=function(e){for(var t=0;t<this.displayedColumns.length;t++){var i=this.displayedColumns[t];e.push(i)}},e}();e.ColumnGroup=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){function t(e){return e===!0||"true"===e}var i=25,o=e.Constants,n=function(){function e(){}return e.prototype.init=function(e,t){this.gridOptions=e,this.headerHeight=e.headerHeight,this.groupHeaders=e.groupHeaders,this.rowHeight=e.rowHeight,this.floatingTopRowData=e.floatingTopRowData,this.floatingBottomRowData=e.floatingBottomRowData,t.addGlobalListener(this.globalEventHandler.bind(this)),this.rowHeight||(this.rowHeight=i),this.checkForDeprecated()},e.prototype.isRowSelection=function(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection},e.prototype.isRowDeselection=function(){return t(this.gridOptions.rowDeselection)},e.prototype.isRowSelectionMulti=function(){return"multiple"===this.gridOptions.rowSelection},e.prototype.getContext=function(){return this.gridOptions.context},e.prototype.isVirtualPaging=function(){return t(this.gridOptions.virtualPaging)},e.prototype.isShowToolPanel=function(){return t(this.gridOptions.showToolPanel)},e.prototype.isToolPanelSuppressPivot=function(){return t(this.gridOptions.toolPanelSuppressPivot)},e.prototype.isToolPanelSuppressValues=function(){return t(this.gridOptions.toolPanelSuppressValues)},e.prototype.isRowsAlreadyGrouped=function(){return t(this.gridOptions.rowsAlreadyGrouped)},e.prototype.isGroupSelectsChildren=function(){return t(this.gridOptions.groupSelectsChildren)},e.prototype.isGroupHidePivotColumns=function(){return t(this.gridOptions.groupHidePivotColumns)},e.prototype.isGroupIncludeFooter=function(){return t(this.gridOptions.groupIncludeFooter)},e.prototype.isGroupSuppressBlankHeader=function(){return t(this.gridOptions.groupSuppressBlankHeader)},e.prototype.isSuppressRowClickSelection=function(){return t(this.gridOptions.suppressRowClickSelection)},e.prototype.isSuppressCellSelection=function(){return t(this.gridOptions.suppressCellSelection)},e.prototype.isSuppressMultiSort=function(){return t(this.gridOptions.suppressMultiSort)},e.prototype.isGroupSuppressAutoColumn=function(){return t(this.gridOptions.groupSuppressAutoColumn)},e.prototype.isForPrint=function(){return t(this.gridOptions.forPrint)},e.prototype.isSuppressHorizontalScroll=function(){return t(this.gridOptions.suppressHorizontalScroll)},e.prototype.isUnSortIcon=function(){return t(this.gridOptions.unSortIcon)},e.prototype.isSuppressMenuHide=function(){return t(this.gridOptions.suppressMenuHide)},e.prototype.getRowStyle=function(){return this.gridOptions.rowStyle},e.prototype.getRowClass=function(){return this.gridOptions.rowClass},e.prototype.getRowStyleFunc=function(){return this.gridOptions.getRowStyle},e.prototype.getRowClassFunc=function(){return this.gridOptions.getRowClass},e.prototype.getHeaderCellRenderer=function(){return this.gridOptions.headerCellRenderer},e.prototype.getApi=function(){return this.gridOptions.api},e.prototype.isEnableColResize=function(){return t(this.gridOptions.enableColResize)},e.prototype.isSingleClickEdit=function(){return t(this.gridOptions.singleClickEdit)},e.prototype.getGroupDefaultExpanded=function(){return this.gridOptions.groupDefaultExpanded},e.prototype.getGroupKeys=function(){return this.gridOptions.groupKeys},e.prototype.getGroupAggFunction=function(){return this.gridOptions.groupAggFunction},e.prototype.getGroupAggFields=function(){return this.gridOptions.groupAggFields},e.prototype.getRowData=function(){return this.gridOptions.rowData},e.prototype.isGroupUseEntireRow=function(){return t(this.gridOptions.groupUseEntireRow)},e.prototype.getGroupColumnDef=function(){return this.gridOptions.groupColumnDef},e.prototype.isGroupSuppressRow=function(){return t(this.gridOptions.groupSuppressRow)},e.prototype.isAngularCompileRows=function(){return t(this.gridOptions.angularCompileRows)},e.prototype.isAngularCompileFilters=function(){return t(this.gridOptions.angularCompileFilters)},e.prototype.isAngularCompileHeaders=function(){return t(this.gridOptions.angularCompileHeaders)},e.prototype.isDebug=function(){return t(this.gridOptions.debug)},e.prototype.getColumnDefs=function(){return this.gridOptions.columnDefs},e.prototype.getDatasource=function(){return this.gridOptions.datasource},e.prototype.getRowBuffer=function(){return this.gridOptions.rowBuffer},e.prototype.isEnableSorting=function(){return t(this.gridOptions.enableSorting)||t(this.gridOptions.enableServerSideSorting)},e.prototype.isEnableCellExpressions=function(){return t(this.gridOptions.enableCellExpressions)},e.prototype.isEnableServerSideSorting=function(){return t(this.gridOptions.enableServerSideSorting)},e.prototype.isEnableFilter=function(){return t(this.gridOptions.enableFilter)||t(this.gridOptions.enableServerSideFilter)},e.prototype.isEnableServerSideFilter=function(){return this.gridOptions.enableServerSideFilter},e.prototype.isSuppressScrollLag=function(){return t(this.gridOptions.suppressScrollLag)},e.prototype.getIcons=function(){return this.gridOptions.icons},e.prototype.getIsScrollLag=function(){return this.gridOptions.isScrollLag},e.prototype.getSortingOrder=function(){return this.gridOptions.sortingOrder},e.prototype.getSlaveGrids=function(){return this.gridOptions.slaveGrids},e.prototype.getGroupRowRenderer=function(){return this.gridOptions.groupRowRenderer},e.prototype.getRowHeight=function(){return this.rowHeight},e.prototype.getHeaderHeight=function(){return"number"==typeof this.headerHeight?this.headerHeight:this.groupHeaders?50:25},e.prototype.setHeaderHeight=function(e){this.headerHeight=e},e.prototype.isGroupHeaders=function(){return t(this.groupHeaders)},e.prototype.setGroupHeaders=function(e){this.groupHeaders=e},e.prototype.getFloatingTopRowData=function(){return this.floatingTopRowData},e.prototype.setFloatingTopRowData=function(e){this.floatingTopRowData=e},e.prototype.getFloatingBottomRowData=function(){return this.floatingBottomRowData},e.prototype.setFloatingBottomRowData=function(e){this.floatingBottomRowData=e},e.prototype.isExternalFilterPresent=function(){return"function"==typeof this.gridOptions.isExternalFilterPresent?this.gridOptions.isExternalFilterPresent():!1},e.prototype.doesExternalFilterPass=function(e){return"function"==typeof this.gridOptions.doesExternalFilterPass?this.gridOptions.doesExternalFilterPass(e):!1},e.prototype.getGroupRowInnerRenderer=function(){return this.gridOptions.groupRowInnerRenderer},e.prototype.getColWidth=function(){return"number"!=typeof this.gridOptions.colWidth||this.gridOptions.colWidth<o.MIN_COL_WIDTH?200:this.gridOptions.colWidth},e.prototype.checkForDeprecated=function(){var e=this.gridOptions;e.suppressUnSort&&console.warn("ag-grid: as of v1.12.4 suppressUnSort is not used. Please use sortOrder instead."),e.suppressDescSort&&console.warn("ag-grid: as of v1.12.4 suppressDescSort is not used. Please use sortOrder instead.")},e.prototype.getPinnedColCount=function(){return this.isForPrint()?0:this.gridOptions.pinnedColumnCount?Number(this.gridOptions.pinnedColumnCount):0},e.prototype.getLocaleTextFunc=function(){if(this.gridOptions.localeTextFunc)return this.gridOptions.localeTextFunc;var e=this;return function(t,i){var o=e.gridOptions.localeText;return o&&o[t]?o[t]:i}},e.prototype.globalEventHandler=function(e,t){var i=this.getCallbackForEvent(e);"function"==typeof this.gridOptions[i]&&this.gridOptions[i](t)},e.prototype.getCallbackForEvent=function(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substr(1)},e}();e.GridOptionsWrapper=n}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function e(){}return e.prototype.init=function(e){this.logging=e.isDebug()},e.prototype.create=function(e){return new i(e,this.logging)},e}();e.LoggerFactory=t;var i=function(){function e(e,t){this.name=e,this.logging=t}return e.prototype.log=function(e){this.logging&&console.log(this.name+" "+e)},e}();e.Logger=i}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function e(){}return e.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",e.EVENT_COLUMN_PIVOT_CHANGE="columnPivotChanged",e.EVENT_COLUMN_VALUE_CHANGE="columnValueChanged",e.EVENT_COLUMN_MOVED="columnMoved",e.EVENT_COLUMN_VISIBLE="columnVisible",e.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",e.EVENT_COLUMN_RESIZED="columnResized",e.EVENT_COLUMN_PINNED_COUNT_CHANGED="columnPinnedCountChanged",e.EVENT_MODEL_UPDATED="modelUpdated",e.EVENT_CELL_CLICKED="cellClicked",e.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",e.EVENT_CELL_CONTEXT_MENU="cellContextMenu",e.EVENT_CELL_VALUE_CHANGED="cellValueChanged",e.EVENT_CELL_FOCUSED="cellFocused",e.EVENT_ROW_SELECTED="rowSelected",e.EVENT_SELECTION_CHANGED="selectionChanged",e.EVENT_BEFORE_FILTER_CHANGED="beforeFilterChanged",e.EVENT_AFTER_FILTER_CHANGED="afterFilterChanged",e.EVENT_FILTER_MODIFIED="filterModified",e.EVENT_BEFORE_SORT_CHANGED="beforeSortChanged",e.EVENT_AFTER_SORT_CHANGED="afterSortChanged",e.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",e.EVENT_ROW_CLICKED="rowClicked",e.EVENT_READY="ready",e}();e.Events=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Utils,i=function(){function e(){this.allListeners={},this.globalListeners=[]}return e.prototype.getListenerList=function(e){var t=this.allListeners[e];return t||(t=[],this.allListeners[e]=t),t},e.prototype.addEventListener=function(e,t){var i=this.getListenerList(e);i.indexOf(t)<0&&i.push(t)},e.prototype.addGlobalListener=function(e){this.globalListeners.push(e)},e.prototype.removeEventListener=function(e,i){var o=this.getListenerList(e);t.removeFromArray(o,i)},e.prototype.removeGlobalListener=function(e){t.removeFromArray(this.globalListeners,e)},e.prototype.dispatchEvent=function(e,t){t||(t={});var i=this.getListenerList(e);i.forEach(function(e){e(t)}),this.globalListeners.forEach(function(i){i(e,t)})},e}();e.EventService=i}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function t(){this.consuming=!1}return t.prototype.init=function(t,i,o,n,r){this.gridOptionsWrapper=t,this.columnController=i,this.gridPanel=o,this.eventService=r,this.logger=n.create("MasterSlaveService"),r.addEventListener(e.Events.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),r.addEventListener(e.Events.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),r.addEventListener(e.Events.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),r.addEventListener(e.Events.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),r.addEventListener(e.Events.EVENT_COLUMN_PINNED_COUNT_CHANGED,this.fireColumnEvent.bind(this))},t.prototype.fireEvent=function(e){if(!this.consuming){var t=this.gridOptionsWrapper.getSlaveGrids();t&&t.forEach(function(t){if(t.api){var i=t.api.__getMasterSlaveService();e(i)}})}},t.prototype.onEvent=function(e){this.consuming=!0,e(),this.consuming=!1},t.prototype.fireColumnEvent=function(e){this.fireEvent(function(t){t.onColumnEvent(e)})},t.prototype.fireHorizontalScrollEvent=function(e){this.fireEvent(function(t){t.onScrollEvent(e)})},t.prototype.onScrollEvent=function(e){var t=this;this.onEvent(function(){t.gridPanel.setHorizontalScrollPosition(e)})},t.prototype.onColumnEvent=function(t){var i=this;this.onEvent(function(){var o,n=t.getColumn();if(n&&(o=i.columnController.getColumn(n.colId)),!n||o){var r,s=t.getColumnGroup();if(s&&(r=i.columnController.getColumnGroup(s.name)),!s||r)switch(t.getType()){case e.Events.EVENT_COLUMN_MOVED:i.logger.log("onColumnEvent-> processing "+t+" fromIndex = "+t.getFromIndex()+", toIndex = "+t.getToIndex()),i.columnController.moveColumn(t.getFromIndex(),t.getToIndex());break;case e.Events.EVENT_COLUMN_VISIBLE:i.logger.log("onColumnEvent-> processing "+t+" visible = "+n.visible),i.columnController.setColumnVisible(o,n.visible);break;case e.Events.EVENT_COLUMN_GROUP_OPENED:i.logger.log("onColumnEvent-> processing "+t+" expanded = "+s.expanded),i.columnController.columnGroupOpened(r,s.expanded);break;case e.Events.EVENT_COLUMN_RESIZED:i.logger.log("onColumnEvent-> processing "+t+" actualWidth = "+n.actualWidth),i.columnController.setColumnWidth(o,n.actualWidth);break;case e.Events.EVENT_COLUMN_PINNED_COUNT_CHANGED:i.logger.log("onColumnEvent-> processing "+t),i.columnController.setPinnedColumnCount(t.getPinnedColumnCount())}}})},t}();e.MasterSlaveService=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Utils,i=e.Constants,o=function(){function e(e){this._columnController=e}return e.prototype.sizeColumnsToFit=function(e){this._columnController.sizeColumnsToFit(e)},e.prototype.hideColumns=function(e,t){this._columnController.hideColumns(e,t)},e.prototype.columnGroupOpened=function(e,t){this._columnController.columnGroupOpened(e,t)},e.prototype.getColumnGroup=function(e){return this._columnController.getColumnGroup(e)},e.prototype.getDisplayNameForCol=function(e){return this._columnController.getDisplayNameForCol(e)},e.prototype.getColumn=function(e){return this._columnController.getColumn(e)},e.prototype.setState=function(e){return this._columnController.setState(e)},e.prototype.getState=function(){return this._columnController.getState()},e.prototype.isPinning=function(){return this._columnController.isPinning()},e.prototype.getVisibleColAfter=function(e){return this._columnController.getVisibleColAfter(e)},e.prototype.getVisibleColBefore=function(e){return this._columnController.getVisibleColBefore(e)},e.prototype.setColumnVisible=function(e,t){this._columnController.setColumnVisible(e,t)},e.prototype.getAllColumns=function(){return this._columnController.getAllColumns()},e.prototype.getDisplayedColumns=function(){return this._columnController.getDisplayedColumns()},e.prototype.getPivotedColumns=function(){return this._columnController.getPivotedColumns()},e.prototype.getValueColumns=function(){return this._columnController.getValueColumns()},e.prototype.moveColumn=function(e,t){this._columnController.moveColumn(e,t)},e.prototype.movePivotColumn=function(e,t){this._columnController.movePivotColumn(e,t)},e.prototype.setColumnAggFunction=function(e,t){this._columnController.setColumnAggFunction(e,t)},e.prototype.setColumnWidth=function(e,t){this._columnController.setColumnWidth(e,t)},e.prototype.removeValueColumn=function(e){this._columnController.removeValueColumn(e)},e.prototype.addValueColumn=function(e){this._columnController.addValueColumn(e)},e.prototype.removePivotColumn=function(e){this._columnController.removePivotColumn(e)},e.prototype.setPinnedColumnCount=function(e){this._columnController.setPinnedColumnCount(e)},e.prototype.addPivotColumn=function(e){this._columnController.addPivotColumn(e)},e.prototype.getHeaderGroups=function(){return this._columnController.getHeaderGroups()},e.prototype.hideColumn=function(e,t){this._columnController.hideColumns([e],t)},e}();e.ColumnApi=o;var n=function(){function n(){this.setupComplete=!1}return n.prototype.init=function(e,t,i,o,n,r,s){this.gridOptionsWrapper=i,this.angularGrid=e,this.selectionRendererFactory=t,this.expressionService=o,this.valueService=n,this.masterSlaveController=r,this.eventService=s,this.pinnedColumnCount=i.getPinnedColCount(),this.pinnedColumnCount>0||(this.pinnedColumnCount=0)},n.prototype.getColumnApi=function(){return new o(this)},n.prototype.isSetupComplete=function(){return this.setupComplete},n.prototype.getHeaderGroups=function(){return this.columnGroups},n.prototype.getPinnedContainerWidth=function(){return this.getTotalColWidth(!0)},n.prototype.addPivotColumn=function(t){if(this.allColumns.indexOf(t)<0)return void console.warn("not a valid column: "+t);if(this.pivotColumns.indexOf(t)>=0)return void console.warn("column is already a value column");this.pivotColumns.push(t),this.updateModel();var i=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE,i)},n.prototype.setPinnedColumnCount=function(t){if("number"!=typeof t)return void console.warn("ag-Grid: setPinnedColumnCount: count must be a number");if(0>t)return void console.warn("ag-Grid: setPinnedColumnCount: count must be zero or greater");this.pinnedColumnCount=t,this.updateModel();var i=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_PINNED_COUNT_CHANGED).withPinnedColumnCount(t);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_PINNED_COUNT_CHANGED,i)},n.prototype.removePivotColumn=function(i){if(this.pivotColumns.indexOf(i)<0)return void console.warn("column not a pivot");t.removeFromArray(this.pivotColumns,i),this.updateModel();var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE,o)},n.prototype.addValueColumn=function(t){if(this.allColumns.indexOf(t)<0)return void console.warn("not a valid column: "+t);if(this.valueColumns.indexOf(t)>=0)return void console.warn("column is already a value column");t.aggFunc||(t.aggFunc=i.SUM),this.valueColumns.push(t);var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE,o)},n.prototype.removeValueColumn=function(i){if(this.valueColumns.indexOf(i)<0)return void console.warn("column not a value");t.removeFromArray(this.valueColumns,i);var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE,o)},n.prototype.doesColumnExistInGrid=function(e){var t=this.allColumns.indexOf(e)>=0,i=this.visibleColumns.indexOf(e)>=0;return t||i},n.prototype.setColumnWidth=function(t,i){if(!this.doesColumnExistInGrid(t))return void console.warn("column does not exist");if(i<t.getMinimumWidth()&&(i=t.getMinimumWidth()),t.isGreaterThanMax(i)&&(i=t.colDef.maxWidth),t.actualWidth!==i){t.actualWidth=i,this.updateGroupWidthsAfterColumnResize(t);var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_RESIZED).withColumn(t);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_RESIZED,o)}},n.prototype.updateGroupWidthsAfterColumnResize=function(e){this.columnGroups&&this.columnGroups.forEach(function(t){t.displayedColumns.indexOf(e)>=0&&t.calculateActualWidth()})},n.prototype.setColumnAggFunction=function(t,i){t.aggFunc=i;var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_VALUE_CHANGE,o)},n.prototype.movePivotColumn=function(t,i){var o=this.pivotColumns[t];this.pivotColumns.splice(t,1),this.pivotColumns.splice(i,0,o);var n=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_PIVOT_CHANGE,n)},n.prototype.moveColumn=function(t,i){var o=this.allColumns[t];this.allColumns.splice(t,1),this.allColumns.splice(i,0,o),this.updateModel();var n=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_MOVED).withFromIndex(t).withToIndex(i);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_MOVED,n)},n.prototype.getBodyContainerWidth=function(){return this.getTotalColWidth(!1)},n.prototype.getValueColumns=function(){return this.valueColumns},n.prototype.getPivotedColumns=function(){return this.pivotColumns},n.prototype.getDisplayedColumns=function(){return this.displayedColumns},n.prototype.getAllColumns=function(){return this.allColumns},n.prototype.setColumnVisible=function(t,i){t.visible=i,this.updateModel();var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_VISIBLE).withColumn(t);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_VISIBLE,o)},n.prototype.getVisibleColBefore=function(e){var t=this.visibleColumns.indexOf(e);return t>0?this.visibleColumns[t-1]:null},n.prototype.getVisibleColAfter=function(e){var t=this.visibleColumns.indexOf(e);return t<this.visibleColumns.length-1?this.visibleColumns[t+1]:null},n.prototype.isPinning=function(){return this.visibleColumns&&this.visibleColumns.length>0&&this.visibleColumns[0].pinned},n.prototype.getState=function(){if(!this.allColumns||this.allColumns.length<0)return[];for(var e=[],t=0;t<this.allColumns.length;t++){var i=this.allColumns[t],o=this.pivotColumns.indexOf(i),n={colId:i.colId,hide:!i.visible,aggFunc:i.aggFunc?i.aggFunc:null,width:i.actualWidth,pivotIndex:o>=0?o:null};e.push(n)}return e},n.prototype.setState=function(o){var n=this.allColumns;this.allColumns=[],this.pivotColumns=[],this.valueColumns=[];var r=this;t.forEach(o,function(e){var o=t.find(n,"colId",e.colId);if(!o)return void console.warn("ag-grid: column "+e.colId+" not found");o.visible=e.hide?!1:!0,o.actualWidth=e.width>=i.MIN_COL_WIDTH?e.width:o.actualWidth;var s=[i.MIN,i.MAX,i.SUM].indexOf(e.aggFunc)>=0;s?(o.aggFunc=e.aggFunc,r.valueColumns.push(o)):o.aggFunc=null,"number"==typeof e.pivotIndex&&e.pivotIndex>=0&&r.pivotColumns.push(o),r.allColumns.push(o),n.splice(n.indexOf(o),1)}),t.forEach(n,function(e){e.visible=!1,e.aggFunc=null,r.allColumns.push(e)}),this.pivotColumns.sort(function(e,t){return e.pivotIndex-t.pivotIndex}),this.updateModel();var s=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_EVERYTHING_CHANGED);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_EVERYTHING_CHANGED,s)},n.prototype.getColumns=function(e){var t=this,i=[];return e&&e.forEach(function(e){var o=t.getColumn(e);o&&i.push(o)}),i},n.prototype.getColumn=function(e){if(!e)return null;for(var t=[this.allColumns,this.visibleColumns],i=0;i<t.length;i++){var o=t[i];if(o)for(var n=0;n<o.length;n++){var r=o[n].colDef===e,s=o[n].colId===e;if(r||s)return o[n]}}},n.prototype.getDisplayNameForCol=function(e){var t=e.colDef,i=t.headerValueGetter;if(!i)return t.displayName?(console.warn("ag-grid: Found displayName "+t.displayName+", please use headerName instead, displayName is deprecated."),t.displayName):t.headerName;var o={colDef:t,api:this.gridOptionsWrapper.getApi(),context:this.gridOptionsWrapper.getContext()};return"function"==typeof i?i(o):"string"==typeof i?this.expressionService.evaluate(i,o):void console.warn("ag-grid: headerValueGetter must be a function or a string")},n.prototype.getColumnGroup=function(e){if(!e)return null;if(this.columnGroups)for(var t=0;t<this.columnGroups.length;t++)if(this.columnGroups[t].name===e)return this.columnGroups[t]},n.prototype.onColumnsChanged=function(){var t=this.gridOptionsWrapper.getColumnDefs();this.checkForDeprecatedItems(t),this.createColumns(t),this.createPivotColumns(),this.createValueColumns(),this.updateModel();var i=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_EVERYTHING_CHANGED);this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_EVERYTHING_CHANGED,i),this.setupComplete=!0},n.prototype.checkForDeprecatedItems=function(e){if(e)for(var t=0;t<e.length;t++){var i=e[t];void 0!==i.group&&(console.warn("ag-grid: "+i.field+" colDef.group is deprecated, please use colDef.headerGroup"),i.headerGroup=i.group),void 0!==i.groupShow&&(console.warn("ag-grid: "+i.field+" colDef.groupShow is deprecated, please use colDef.headerGroupShow"),i.headerGroupShow=i.groupShow)}},n.prototype.columnGroupOpened=function(t,i){t.expanded=i,this.updateGroups(),this.updateDisplayedColumns();var o=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_GROUP_OPENED).withColumnGroup(t);
this.eventService.dispatchEvent(e.Events.EVENT_COLUMN_GROUP_OPENED,o)},n.prototype.hideColumns=function(t,i){var o=this,n=[];this.allColumns.forEach(function(e){var o=e.colId,r=t.indexOf(o)>=0,s=!i;r&&e.visible!==s&&(e.visible=s,n.push(e))}),n.length>0&&(this.updateModel(),n.forEach(function(t){var i=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_VISIBLE).withColumn(t);o.eventService.dispatchEvent(e.Events.EVENT_COLUMN_VISIBLE,i)}))},n.prototype.updateModel=function(){this.updateVisibleColumns(),this.updatePinnedColumns(),this.buildGroups(),this.updateGroups(),this.updateDisplayedColumns()},n.prototype.updateDisplayedColumns=function(){if(this.gridOptionsWrapper.isGroupHeaders()){this.displayedColumns=[];for(var e=0;e<this.columnGroups.length;e++){var t=this.columnGroups[e];t.addToVisibleColumns(this.displayedColumns)}}else this.displayedColumns=this.visibleColumns},n.prototype.sizeColumnsToFit=function(i){function o(e){t.removeFromArray(l,e),s.push(e)}function n(e){for(var t=0,i=0;i<e.length;i++)t+=e[i].actualWidth;return t}var r=this;if(!(0>=i||0===this.displayedColumns.length)){for(var s=t.filter(this.displayedColumns,function(e){return e.colDef.suppressSizeToFit===!0}),l=t.filter(this.displayedColumns,function(e){return e.colDef.suppressSizeToFit!==!0}),a=l.slice(0),d=!1;!d;){d=!0;var u=i-n(s);if(0>=u)l.forEach(function(e){e.setMinimum(),r.updateGroupWidthsAfterColumnResize(e)});else for(var h=u/n(l),p=u,c=l.length-1;c>=0;c--){var g=l[c],f=Math.round(g.actualWidth*h);if(f<g.getMinimumWidth())g.setMinimum(),o(g),d=!1;else if(g.isGreaterThanMax(f))g.actualWidth=g.colDef.maxWidth,o(g),d=!1;else{var v=0===c;v?g.actualWidth=p:(p-=f,g.actualWidth=f)}this.updateGroupWidthsAfterColumnResize(g)}}a.forEach(function(t){var i=new e.ColumnChangeEvent(e.Events.EVENT_COLUMN_RESIZED).withColumn(t);r.eventService.dispatchEvent(e.Events.EVENT_COLUMN_RESIZED,i)})}},n.prototype.buildGroups=function(){if(!this.gridOptionsWrapper.isGroupHeaders())return void(this.columnGroups=null);var t=null;this.columnGroups=[];var i=this,o=!0;this.visibleColumns.forEach(function(n){var r=o&&!n.pinned;n.pinned||(o=!1);var s=t&&n.colDef.headerGroup!==t.name,l=t&&!t.name,a=null===t,d=a||r||s||l;if(d){var u=n.pinned;t=new e.ColumnGroup(u,n.colDef.headerGroup),i.columnGroups.push(t)}t.addColumn(n)})},n.prototype.updateGroups=function(){if(this.gridOptionsWrapper.isGroupHeaders())for(var e=0;e<this.columnGroups.length;e++){var t=this.columnGroups[e];t.calculateExpandable(),t.calculateDisplayedColumns(),t.calculateActualWidth()}},n.prototype.updateVisibleColumns=function(){this.visibleColumns=[];var t=this.pivotColumns.length>0&&!this.gridOptionsWrapper.isGroupSuppressAutoColumn()&&!this.gridOptionsWrapper.isGroupUseEntireRow()&&!this.gridOptionsWrapper.isGroupSuppressRow(),i=this.gridOptionsWrapper.getLocaleTextFunc();if(t){var o=this.gridOptionsWrapper.getGroupColumnDef();o||(o={headerName:i("group","Group"),cellRenderer:{renderer:"group"}});var n=this.calculateColInitialWidth(o),r=new e.Column(o,n);this.visibleColumns.push(r)}for(var s=0;s<this.allColumns.length;s++){var l=this.allColumns[s],a=this.pivotColumns.indexOf(l)>=0&&this.gridOptionsWrapper.isGroupHidePivotColumns();l.visible&&!a&&(l.index=this.visibleColumns.length,this.visibleColumns.push(this.allColumns[s]))}},n.prototype.updatePinnedColumns=function(){for(var e=0;e<this.visibleColumns.length;e++){var t=e<this.pinnedColumnCount;this.visibleColumns[e].pinned=t}},n.prototype.createColumns=function(t){if(this.allColumns=[],t)for(var i=0;i<t.length;i++){var o=t[i],n=this.calculateColInitialWidth(o),r=new e.Column(o,n);this.allColumns.push(r)}},n.prototype.createPivotColumns=function(){this.pivotColumns=[];var e=this.gridOptionsWrapper.getGroupKeys();if(e&&!(e.length<=0))for(var t=0;t<e.length;t++){var i=e[t],o=this.getColumn(i);o||(o=this.createDummyColumn(i)),this.pivotColumns.push(o)}},n.prototype.createValueColumns=function(){this.valueColumns=[];for(var e=0;e<this.allColumns.length;e++){var t=this.allColumns[e];t.colDef.aggFunc&&(t.aggFunc=t.colDef.aggFunc,this.valueColumns.push(t))}},n.prototype.createDummyColumn=function(t){var i={field:t,headerName:t,hide:!1},o=this.gridOptionsWrapper.getColWidth(),n=new e.Column(i,o);return n},n.prototype.calculateColInitialWidth=function(e){return e.width?e.width<i.MIN_COL_WIDTH?i.MIN_COL_WIDTH:e.width:this.gridOptionsWrapper.getColWidth()},n.prototype.getTotalColWidth=function(e){var t=0,i="boolean"!=typeof e;return this.displayedColumns.forEach(function(o){var n=i||o.pinned===e;n&&(t+=o.actualWidth)}),t},n}();e.ColumnController=n}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t="\r\n",i=function(){function e(e,t,i,o){this.rowController=e,this.columnController=t,this.grid=i,this.valueService=o}return e.prototype.exportDataAsCsv=function(e){var t=this.getDataAsCsv(e),i=e&&e.fileName&&0!==e.fileName.length,o=i?e.fileName:"export.csv";if(window.navigator.msSaveOrOpenBlob){var n=[t],r=new Blob(n);window.navigator.msSaveOrOpenBlob(r,o)}else{var s="data:text/plain;charset=utf-8,"+encodeURIComponent(t),l=document.createElement("a");l.href=s,l.download=o,document.body.appendChild(l),l.click(),document.body.removeChild(l)}},e.prototype.getDataAsCsv=function(e){var i=this;if(!this.grid.isUsingInMemoryModel())return console.log("ag-Grid: getDataAsCsv not available when doing virtual pagination"),"";var o="",n=e&&e.skipGroups,r=e&&e.skipHeader,s=e&&e.skipFooters,l=this.columnController.getDisplayedColumns();return l&&0!==l.length?(r||(l.forEach(function(e,t){var n=i.columnController.getDisplayNameForCol(e);(null===n||void 0===n)&&(n=""),0!=t&&(o+=","),o+='"'+i.escape(n)+'"'}),o+=t),this.rowController.forEachNodeAfterFilterAndSort(function(e){n&&e.group||s&&e.footer||(l.forEach(function(t,n){var r;r=e.group&&0===n?i.createValueForGroupNode(e):i.valueService.getValue(t.colDef,e.data,e),(null===r||void 0===r)&&(r=""),0!=n&&(o+=","),o+='"'+i.escape(r)+'"'}),o+=t)}),o):""},e.prototype.createValueForGroupNode=function(e){for(var t=[e.key];e.parent;)e=e.parent,t.push(e.key);return t.reverse().join(" -> ")},e.prototype.escape=function(e){if(null===e||void 0===e)return"";var t;return"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("known value type during csv conversio"),t=""),t.replace('"','""')},e}();e.CsvCreator=i}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=function(){function e(){this.expressionToFunctionCache={}}return e.prototype.init=function(e){this.logger=e.create("ExpressionService")},e.prototype.evaluate=function(e,t){try{var i=this.createExpressionFunction(e),o=i(t.value,t.context,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue);return o}catch(n){return this.logger.log("Processing of the expression failed"),this.logger.log("Expression = "+e),this.logger.log("Exception = "+n),null}},e.prototype.createExpressionFunction=function(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];var t=this.createFunctionBody(e),i=new Function("x, ctx, node, data, colDef, rowIndex, api, getValue",t);return this.expressionToFunctionCache[e]=i,i},e.prototype.createFunctionBody=function(e){return e.indexOf("return")>=0?e:"return "+e+";"},e}();e.ExpressionService=t}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Utils,i='<div><div><select class="ag-filter-select" id="filterType"><option value="1">[CONTAINS]</option><option value="2">[EQUALS]</option><option value="3">[STARTS WITH]</option><option value="4">[ENDS WITH]</option></select></div><div><input class="ag-filter-filter" id="filterText" type="text" placeholder="[FILTER...]"/></div><div class="ag-filter-apply-panel" id="applyPanel"><button type="button" id="applyButton">[APPLY FILTER]</button></div></div>',o=1,n=2,r=3,s=4,l=function(){function e(){}return e.prototype.init=function(e){this.filterParams=e.filterParams,this.applyActive=this.filterParams&&1==this.filterParams.apply,this.filterChangedCallback=e.filterChangedCallback,this.filterModifiedCallback=e.filterModifiedCallback,this.localeTextFunc=e.localeTextFunc,this.valueGetter=e.valueGetter,this.createGui(),this.filterText=null,this.filterType=o,this.createApi()},e.prototype.onNewRowsLoaded=function(){var e=this.filterParams&&"keep"===this.filterParams.newRowsAction;e||(this.api.setType(o),this.api.setFilter(null))},e.prototype.afterGuiAttached=function(){this.eFilterTextField.focus()},e.prototype.doesFilterPass=function(e){if(!this.filterText)return!0;var t=this.valueGetter(e);if(!t)return!1;var i=t.toString().toLowerCase();switch(this.filterType){case o:return i.indexOf(this.filterText)>=0;case n:return i===this.filterText;case r:return 0===i.indexOf(this.filterText);case s:var l=i.indexOf(this.filterText);return l>=0&&l===i.length-this.filterText.length;default:return console.warn("invalid filter type "+this.filterType),!1}},e.prototype.getGui=function(){return this.eGui},e.prototype.isFilterActive=function(){return null!==this.filterText},e.prototype.createTemplate=function(){return i.replace("[FILTER...]",this.localeTextFunc("filterOoo","Filter...")).replace("[EQUALS]",this.localeTextFunc("equals","Equals")).replace("[CONTAINS]",this.localeTextFunc("contains","Contains")).replace("[STARTS WITH]",this.localeTextFunc("startsWith","Starts with")).replace("[ENDS WITH]",this.localeTextFunc("endsWith","Ends with")).replace("[APPLY FILTER]",this.localeTextFunc("applyFilter","Apply Filter"))},e.prototype.createGui=function(){this.eGui=t.loadTemplate(this.createTemplate()),this.eFilterTextField=this.eGui.querySelector("#filterText"),this.eTypeSelect=this.eGui.querySelector("#filterType"),t.addChangeListener(this.eFilterTextField,this.onFilterChanged.bind(this)),this.eTypeSelect.addEventListener("change",this.onTypeChanged.bind(this)),this.setupApply()},e.prototype.setupApply=function(){var e=this;this.applyActive?(this.eApplyButton=this.eGui.querySelector("#applyButton"),this.eApplyButton.addEventListener("click",function(){e.filterChangedCallback()})):t.removeElement(this.eGui,"#applyPanel")},e.prototype.onTypeChanged=function(){this.filterType=parseInt(this.eTypeSelect.value),this.filterChanged()},e.prototype.onFilterChanged=function(){var e=t.makeNull(this.eFilterTextField.value);e&&""===e.trim()&&(e=null);var i;i=null!==e&&void 0!==e?e.toLowerCase():null,this.filterText!==i&&(this.filterText=i,this.filterChanged())},e.prototype.filterChanged=function(){this.filterModifiedCallback(),this.applyActive||this.filterChangedCallback()},e.prototype.createApi=function(){var e=this;this.api={EQUALS:n,CONTAINS:o,STARTS_WITH:r,ENDS_WITH:s,setType:function(t){e.filterType=t,e.eTypeSelect.value=t},setFilter:function(i){i=t.makeNull(i),i?(e.filterText=i.toLowerCase(),e.eFilterTextField.value=i):(e.filterText=null,e.eFilterTextField.value=null)},getType:function(){return e.filterType},getFilter:function(){return e.filterText},getModel:function(){return e.isFilterActive()?{type:e.filterType,filter:e.filterText}:null},setModel:function(e){e?(this.setType(e.type),this.setFilter(e.filter)):this.setFilter(null)}}},e.prototype.getApi=function(){return this.api},e}();e.TextFilter=l}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Utils,i='<div><div><select class="ag-filter-select" id="filterType"><option value="1">[EQUALS]</option><option value="2">[LESS THAN]</option><option value="3">[GREATER THAN]</option></select></div><div><input class="ag-filter-filter" id="filterText" type="text" placeholder="[FILTER...]"/></div><div class="ag-filter-apply-panel" id="applyPanel"><button type="button" id="applyButton">[APPLY FILTER]</button></div></div>',o=1,n=2,r=3,s=function(){function e(){}return e.prototype.init=function(e){this.filterParams=e.filterParams,this.applyActive=this.filterParams&&1==this.filterParams.apply,this.filterChangedCallback=e.filterChangedCallback,this.filterModifiedCallback=e.filterModifiedCallback,this.localeTextFunc=e.localeTextFunc,this.valueGetter=e.valueGetter,this.createGui(),this.filterNumber=null,this.filterType=o,this.createApi()},e.prototype.onNewRowsLoaded=function(){var e=this.filterParams&&"keep"===this.filterParams.newRowsAction;e||(this.api.setType(o),this.api.setFilter(null))},e.prototype.afterGuiAttached=function(){this.eFilterTextField.focus()},e.prototype.doesFilterPass=function(e){if(null===this.filterNumber)return!0;var t=this.valueGetter(e);if(!t&&0!==t)return!1;var i;switch(i="number"==typeof t?t:parseFloat(t),this.filterType){case o:return i===this.filterNumber;case n:return i<this.filterNumber;case r:return i>this.filterNumber;default:return console.warn("invalid filter type "+this.filterType),!1}},e.prototype.getGui=function(){return this.eGui},e.prototype.isFilterActive=function(){return null!==this.filterNumber},e.prototype.createTemplate=function(){return i.replace("[FILTER...]",this.localeTextFunc("filterOoo","Filter...")).replace("[EQUALS]",this.localeTextFunc("equals","Equals")).replace("[LESS THAN]",this.localeTextFunc("lessThan","Less than")).replace("[GREATER THAN]",this.localeTextFunc("greaterThan","Greater than")).replace("[APPLY FILTER]",this.localeTextFunc("applyFilter","Apply Filter"))},e.prototype.createGui=function(){this.eGui=t.loadTemplate(this.createTemplate()),this.eFilterTextField=this.eGui.querySelector("#filterText"),this.eTypeSelect=this.eGui.querySelector("#filterType"),t.addChangeListener(this.eFilterTextField,this.onFilterChanged.bind(this)),this.eTypeSelect.addEventListener("change",this.onTypeChanged.bind(this)),this.setupApply()},e.prototype.setupApply=function(){var e=this;this.applyActive?(this.eApplyButton=this.eGui.querySelector("#applyButton"),this.eApplyButton.addEventListener("click",function(){e.filterChangedCallback()})):t.removeElement(this.eGui,"#applyPanel")},e.prototype.onTypeChanged=function(){this.filterType=parseInt(this.eTypeSelect.value),this.filterChanged()},e.prototype.filterChanged=function(){this.filterModifiedCallback(),this.applyActive||this.filterChangedCallback()},e.prototype.onFilterChanged=function(){var e=t.makeNull(this.eFilterTextField.value);e&&""===e.trim()&&(e=null);var i;i=null!==e&&void 0!==e?parseFloat(e):null,this.filterNumber!==i&&(this.filterNumber=i,this.filterChanged())},e.prototype.createApi=function(){var e=this;this.api={EQUALS:o,LESS_THAN:n,GREATER_THAN:r,setType:function(t){e.filterType=t,e.eTypeSelect.value=t},setFilter:function(i){i=t.makeNull(i),null!==i&&"number"!=typeof i&&(i=parseFloat(i)),e.filterNumber=i,e.eFilterTextField.value=i},getType:function(){return e.filterType},getFilter:function(){return e.filterNumber},getModel:function(){return e.isFilterActive()?{type:e.filterType,filter:e.filterNumber}:null},setModel:function(e){e?(this.setType(e.type),this.setFilter(e.filter)):this.setFilter(null)}}},e.prototype.getApi=function(){return this.api},e}();e.NumberFilter=s}(t=e.grid||(e.grid={}))}(ag||(ag={}));var ag;!function(e){var t;!function(e){var t=e.Utils,i=function(){function e(e,t,i,o){this.colDef=e,this.rowModel=t,this.valueGetter=i,this.doesRowPassOtherFilters=o,this.filterParams=this.colDef.filterParams,this.usingProvidedSet=this.filterParams&&this.filterParams.values,this.showingAvailableOnly=this.filterParams&&!this.filterParams.suppressRemoveEntries,this.createAllUniqueValues(),this.createAvailableUniqueValues(),this.displayedValues=this.availableUniqueValues,this.miniFilter=null,this.selectedValuesMap={},this.selectEverything()}return e.prototype.refreshAfterNewRowsLoaded=function(e,t){this.createAllUniqueValues(),this.createAvailableUniqueValues();var i=Object.keys(this.selectedValuesMap);this.selectedValuesMap={},this.processMiniFilter(),e?this.setModel(i,t):this.selectEverything()},e.prototype.refreshAfterAnyFilterChanged=function(){this.showingAvailableOnly&&(this.createAvailableUniqueValues(),this.processMiniFilter())},e.prototype.createAllUniqueValues=function(){this.allUniqueValues=t.toStrings(this.usingProvidedSet?this.filterParams.values:this.getUniqueValues(!1)),this.allUniqueValues.sort(this.colDef.comparator?this.colDef.comparator:t.defaultComparator)},e.prototype.createAvailableUniqueValues=function(){var e=!this.showingAvailableOnly||this.usingProvidedSet;return e?void(this.availableUniqueValues=this.allUniqueValues):(this.availableUniqueValues=t.toStrings(this.getUniqueValues(!0)),void this.availableUniqueValues.sort(this.colDef.comparator?this.colDef.comparator:t.defaultComparator))},e.prototype.getUniqueValues=function(e){function t(e){o.hasOwnProperty(e)||(n.push(e),o[e]=1)}var i=this,o={},n=[];return this.rowModel.forEachNode(function(o){if(!o.group){var n=i.valueGetter(o);if((""===n||void 0===n)&&(n=null),e&&!i.doesRowPassOtherFilters(o))return;if(null!=n&&Array.isArray(n))for(var r=0;r<n.length;r++)t(n[r]);else t(n)}}),n},e.prototype.setMiniFilter=function(e){return e=t.makeNull(e),this.miniFilter===e?!1:(this.miniFilter=e,this.processMiniFilter(),!0)},e.prototype.getMiniFilter=function(){return this.miniFilter},e.prototype.processMiniFilter=function(){if(null===this.miniFilter)return void(this.displayedValues=this.availableUniqueValues);this.displayedValues=[];for(var e=this.miniFilter.toUpperCase(),t=0,i=this.availableUniqueValues.length;i>t;t++){var o=this.availableUniqueValues[t];null!==o&&o.toString().toUpperCase().indexOf(e)>=0&&this.displayedValues.push(o)}},e.prototype.getDisplayedValueCount=function(){return this.displayedValues.length},e.prototype.getDisplayedValue=function(e){return this.displayedValues[e]},e.prototype.selectEverything=function(){for(var e=this.allUniqueValues.length,t=0;e>t;t++){var i=this.allUniqueValues[t];this.selectedValuesMap[i]=null}this.selectedValuesCount=e},e.prototype.isFilterActive=function(){return this.allUniqueValues.length!==this.selectedValuesCount},e.prototype.selectNothing=function(){this.selectedValuesMap={},this.selectedValuesCount=0},e.prototype.getUniqueValueCount=function(){return this.allU