@ag-grid-enterprise/status-bar
Advanced tools
Comparing version 26.0.0 to 26.1.0
@@ -82,3 +82,3 @@ "use strict"; | ||
}; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\"></div>\n </div>"; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\" role=\"status\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\" role=\"status\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\" role=\"status\"></div>\n </div>"; | ||
__decorate([ | ||
@@ -85,0 +85,0 @@ core_1.Autowired('gridOptions') |
@@ -80,3 +80,3 @@ var __extends = (this && this.__extends) || (function () { | ||
}; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\"></div>\n </div>"; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\" role=\"status\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\" role=\"status\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\" role=\"status\"></div>\n </div>"; | ||
__decorate([ | ||
@@ -83,0 +83,0 @@ Autowired('gridOptions') |
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -131,3 +131,3 @@ ' * @license Commercial | ||
}; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\"></div>\n </div>"; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\" role=\"status\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\" role=\"status\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\" role=\"status\"></div>\n </div>"; | ||
__decorate$1([ | ||
@@ -134,0 +134,0 @@ core.Autowired('gridOptions') |
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -8,6 +8,6 @@ ' * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
' * @license Commercial | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},i=function(t){function o(){var e=t.call(this)||this;return e.allComponents={},e}return n(o,t),o.prototype.registerStatusPanel=function(t,e){this.allComponents[t]=e},o.prototype.getStatusPanel=function(t){return this.allComponents[t]},o=r([e.Bean("statusBarService")],o)}(e.BeanStub),a=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),s=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},p=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return a(o,t),o.prototype.postConstruct=function(){if(this.gridOptions.statusBar&&this.gridOptions.statusBar.statusPanels){var t=this.gridOptions.statusBar.statusPanels.filter((function(t){return"left"===t.align}));this.createAndRenderComponents(t,this.eStatusBarLeft);var e=this.gridOptions.statusBar.statusPanels.filter((function(t){return"center"===t.align}));this.createAndRenderComponents(e,this.eStatusBarCenter);var o=this.gridOptions.statusBar.statusPanels.filter((function(t){return!t.align||"right"===t.align}));this.createAndRenderComponents(o,this.eStatusBarRight)}else this.setDisplayed(!1)},o.prototype.createAndRenderComponents=function(t,o){var n=this,r=[];t.forEach((function(t){var e={api:n.gridOptionsWrapper.getApi(),columnApi:n.gridOptionsWrapper.getColumnApi(),context:n.gridOptionsWrapper.getContext()},o=n.userComponentFactory.newStatusPanelComponent(t,e);o&&r.push({key:t.key||t.statusPanel,promise:o})})),e.AgPromise.all(r.map((function(t){return t.promise}))).then((function(){r.forEach((function(t){t.promise.then((function(e){var r=function(){n.getContext().destroyBean(e)};n.isAlive()?(n.statusBarService.registerStatusPanel(t.key,e),o.appendChild(e.getGui()),n.addDestroyFunc(r)):r()}))}))}))},o.TEMPLATE='<div class="ag-status-bar">\n <div ref="eStatusBarLeft" class="ag-status-bar-left"></div>\n <div ref="eStatusBarCenter" class="ag-status-bar-center"></div>\n <div ref="eStatusBarRight" class="ag-status-bar-right"></div>\n </div>',s([e.Autowired("gridOptions")],o.prototype,"gridOptions",void 0),s([e.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),s([e.Autowired("statusBarService")],o.prototype,"statusBarService",void 0),s([e.RefSelector("eStatusBarLeft")],o.prototype,"eStatusBarLeft",void 0),s([e.RefSelector("eStatusBarCenter")],o.prototype,"eStatusBarCenter",void 0),s([e.RefSelector("eStatusBarRight")],o.prototype,"eStatusBarRight",void 0),s([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),u=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),c=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},l=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return u(o,t),o.prototype.setLabel=function(t,e){this.setDisplayed(!1);var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eLabel.innerHTML=o(t,e)},o.prototype.setValue=function(t){this.eValue.innerHTML=t},o.TEMPLATE='<div class="ag-status-name-value">\n <span ref="eLabel"></span>: \n <span ref="eValue" class="ag-status-name-value-value"></span>\n </div>',c([e.RefSelector("eLabel")],o.prototype,"eLabel",void 0),c([e.RefSelector("eValue")],o.prototype,"eValue",void 0),o}(e.Component),g=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),d=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},f=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return g(o,t),o.prototype.postConstruct=function(){"clientSide"===this.gridApi.getModel().getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){var t=e._.formatNumberCommas(this.getFilteredRowCountValue()),o=e._.formatNumberCommas(this.getTotalRowCount());if(t===o)this.setValue(t);else{var n=this.gridOptionsWrapper.getLocaleTextFunc();this.setValue(t+" "+n("of","of")+" "+o)}},o.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||t++})),t},o.prototype.getTotalRowCount=function(){var t=0;return this.gridApi.forEachNode((function(e){e.group||t++})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},d([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),d([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),h=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),y=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},v=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return h(o,t),o.prototype.postConstruct=function(){if(this.setLabel("filteredRows","Filtered"),"clientSide"===this.gridApi.getModel().getType()){this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);var t=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,t)}else console.warn("AG Grid: agFilteredRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){var t=this.getTotalRowCountValue(),o=this.getFilteredRowCountValue();this.setValue(e._.formatNumberCommas(o)),this.setDisplayed(t!==o)},o.prototype.getTotalRowCountValue=function(){var t=0;return this.gridApi.forEachNode((function(e){return t+=1})),t},o.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||(t+=1)})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},y([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),y([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),m=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},A=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return m(o,t),o.prototype.postConstruct=function(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.gridApi.getModel().getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){this.setValue(e._.formatNumberCommas(this.getRowCountValue()))},o.prototype.getRowCountValue=function(){var t=0;return this.gridApi.forEachLeafNode((function(e){return t+=1})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},C([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),C([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),w=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),_=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},R=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return w(o,t),o.prototype.postConstruct=function(){if(this.isValidRowModel()){this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count");var t=this.gridApi.getSelectedRows().length;this.setValue(e._.formatNumberCommas(t)),this.setDisplayed(t>0);var o=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,o),this.addManagedListener(this.eventService,e.Events.EVENT_SELECTION_CHANGED,o)}else console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.")},o.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},o.prototype.onRowSelectionChanged=function(){var t=this.gridApi.getSelectedRows().length;this.setValue(e._.formatNumberCommas(t)),this.setDisplayed(t>0)},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},_([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),_([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),O=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},P=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return b(o,t),o.prototype.destroy=function(){t.prototype.destroy.call(this)},o.prototype.postConstruct=function(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,e.Events.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")},o.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},o.prototype.init=function(){},o.prototype.setAggregationComponentValue=function(t,o,n){var r=this.getAggregationValueComponent(t);e._.exists(r)&&r&&(r.setValue(e._.formatNumberTwoDecimalPlacesAndCommas(o)),r.setDisplayed(n))},o.prototype.getAggregationValueComponent=function(t){var o=t+"AggregationComp",n=null,r=e._.exists(this.gridOptions.statusBar)&&this.gridOptions.statusBar?e._.find(this.gridOptions.statusBar.statusPanels,(function(t){return"agAggregationComponent"===t.statusPanel})):null;return e._.exists(r)&&r?(!e._.exists(r.statusPanelParams)||e._.exists(r.statusPanelParams)&&e._.exists(r.statusPanelParams.aggFuncs)&&e._.exists(e._.find(r.statusPanelParams.aggFuncs,(function(e){return e===t}))))&&(n=this[o]):n=this[o],n},o.prototype.onRangeSelectionChanged=function(){var t=this,o=this.rangeService?this.rangeService.getCellRanges():void 0,n=0,r=0,i=0,a=null,s=null,p={};o&&!e._.missingOrEmpty(o)&&o.forEach((function(o){for(var u=t.rangeService.getRangeStartRow(o),c=t.rangeService.getRangeEndRow(o);;){if(e._.missing(u)||!u||t.rowPositionUtils.before(c,u)||!u||!o.columns)break;o.columns.forEach((function(o){if(null!==u){var c=t.cellPositionUtils.createId({rowPinned:u.rowPinned,column:o,rowIndex:u.rowIndex});if(!p[c]){p[c]=!0;var l=t.rowRenderer.getRowNode(u);if(!e._.missing(l)){var g=t.valueService.getValue(o,l);e._.missing(g)||""===g||(g.value&&(g=g.value),"string"==typeof g&&(g=Number(g)),"number"!=typeof g||isNaN(g)||(n+=g,(null===s||g>s)&&(s=g),(null===a||g<a)&&(a=g),i++),r++)}}}})),u=t.cellNavigationService.getRowBelow(u)}}));var u=r>1,c=i>1;this.setAggregationComponentValue("count",r,u),this.setAggregationComponentValue("sum",n,c),this.setAggregationComponentValue("min",a,c),this.setAggregationComponentValue("max",s,c),this.setAggregationComponentValue("avg",n/i,c)},o.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n <ag-name-value ref="avgAggregationComp"></ag-name-value>\n <ag-name-value ref="countAggregationComp"></ag-name-value>\n <ag-name-value ref="minAggregationComp"></ag-name-value>\n <ag-name-value ref="maxAggregationComp"></ag-name-value>\n <ag-name-value ref="sumAggregationComp"></ag-name-value>\n </div>',O([e.Optional("rangeService")],o.prototype,"rangeService",void 0),O([e.Autowired("valueService")],o.prototype,"valueService",void 0),O([e.Autowired("cellNavigationService")],o.prototype,"cellNavigationService",void 0),O([e.Autowired("rowRenderer")],o.prototype,"rowRenderer",void 0),O([e.Autowired("gridOptions")],o.prototype,"gridOptions",void 0),O([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),O([e.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),O([e.Autowired("rowPositionUtils")],o.prototype,"rowPositionUtils",void 0),O([e.RefSelector("sumAggregationComp")],o.prototype,"sumAggregationComp",void 0),O([e.RefSelector("countAggregationComp")],o.prototype,"countAggregationComp",void 0),O([e.RefSelector("minAggregationComp")],o.prototype,"minAggregationComp",void 0),O([e.RefSelector("maxAggregationComp")],o.prototype,"maxAggregationComp",void 0),O([e.RefSelector("avgAggregationComp")],o.prototype,"avgAggregationComp",void 0),O([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),S={moduleName:e.ModuleNames.StatusBarModule,beans:[i],agStackComponents:[{componentName:"AgStatusBar",componentClass:p},{componentName:"AgNameValue",componentClass:l}],userComponents:[{componentName:"agAggregationComponent",componentClass:P},{componentName:"agSelectedRowCountComponent",componentClass:R},{componentName:"agTotalRowCountComponent",componentClass:A},{componentName:"agFilteredRowCountComponent",componentClass:v},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:f}],dependantModules:[o.EnterpriseCoreModule]};exports.StatusBarModule=S; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e=require("@ag-grid-community/core"),o=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}),r=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},i=function(t){function o(){var e=t.call(this)||this;return e.allComponents={},e}return n(o,t),o.prototype.registerStatusPanel=function(t,e){this.allComponents[t]=e},o.prototype.getStatusPanel=function(t){return this.allComponents[t]},o=r([e.Bean("statusBarService")],o)}(e.BeanStub),a=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),s=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},u=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return a(o,t),o.prototype.postConstruct=function(){if(this.gridOptions.statusBar&&this.gridOptions.statusBar.statusPanels){var t=this.gridOptions.statusBar.statusPanels.filter((function(t){return"left"===t.align}));this.createAndRenderComponents(t,this.eStatusBarLeft);var e=this.gridOptions.statusBar.statusPanels.filter((function(t){return"center"===t.align}));this.createAndRenderComponents(e,this.eStatusBarCenter);var o=this.gridOptions.statusBar.statusPanels.filter((function(t){return!t.align||"right"===t.align}));this.createAndRenderComponents(o,this.eStatusBarRight)}else this.setDisplayed(!1)},o.prototype.createAndRenderComponents=function(t,o){var n=this,r=[];t.forEach((function(t){var e={api:n.gridOptionsWrapper.getApi(),columnApi:n.gridOptionsWrapper.getColumnApi(),context:n.gridOptionsWrapper.getContext()},o=n.userComponentFactory.newStatusPanelComponent(t,e);o&&r.push({key:t.key||t.statusPanel,promise:o})})),e.AgPromise.all(r.map((function(t){return t.promise}))).then((function(){r.forEach((function(t){t.promise.then((function(e){var r=function(){n.getContext().destroyBean(e)};n.isAlive()?(n.statusBarService.registerStatusPanel(t.key,e),o.appendChild(e.getGui()),n.addDestroyFunc(r)):r()}))}))}))},o.TEMPLATE='<div class="ag-status-bar">\n <div ref="eStatusBarLeft" class="ag-status-bar-left" role="status"></div>\n <div ref="eStatusBarCenter" class="ag-status-bar-center" role="status"></div>\n <div ref="eStatusBarRight" class="ag-status-bar-right" role="status"></div>\n </div>',s([e.Autowired("gridOptions")],o.prototype,"gridOptions",void 0),s([e.Autowired("userComponentFactory")],o.prototype,"userComponentFactory",void 0),s([e.Autowired("statusBarService")],o.prototype,"statusBarService",void 0),s([e.RefSelector("eStatusBarLeft")],o.prototype,"eStatusBarLeft",void 0),s([e.RefSelector("eStatusBarCenter")],o.prototype,"eStatusBarCenter",void 0),s([e.RefSelector("eStatusBarRight")],o.prototype,"eStatusBarRight",void 0),s([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),p=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),c=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},l=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return p(o,t),o.prototype.setLabel=function(t,e){this.setDisplayed(!1);var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eLabel.innerHTML=o(t,e)},o.prototype.setValue=function(t){this.eValue.innerHTML=t},o.TEMPLATE='<div class="ag-status-name-value">\n <span ref="eLabel"></span>: \n <span ref="eValue" class="ag-status-name-value-value"></span>\n </div>',c([e.RefSelector("eLabel")],o.prototype,"eLabel",void 0),c([e.RefSelector("eValue")],o.prototype,"eValue",void 0),o}(e.Component),g=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),d=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},f=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return g(o,t),o.prototype.postConstruct=function(){"clientSide"===this.gridApi.getModel().getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){var t=e._.formatNumberCommas(this.getFilteredRowCountValue()),o=e._.formatNumberCommas(this.getTotalRowCount());if(t===o)this.setValue(t);else{var n=this.gridOptionsWrapper.getLocaleTextFunc();this.setValue(t+" "+n("of","of")+" "+o)}},o.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||t++})),t},o.prototype.getTotalRowCount=function(){var t=0;return this.gridApi.forEachNode((function(e){e.group||t++})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},d([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),d([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),h=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),y=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},v=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return h(o,t),o.prototype.postConstruct=function(){if(this.setLabel("filteredRows","Filtered"),"clientSide"===this.gridApi.getModel().getType()){this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);var t=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,t)}else console.warn("AG Grid: agFilteredRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){var t=this.getTotalRowCountValue(),o=this.getFilteredRowCountValue();this.setValue(e._.formatNumberCommas(o)),this.setDisplayed(t!==o)},o.prototype.getTotalRowCountValue=function(){var t=0;return this.gridApi.forEachNode((function(e){return t+=1})),t},o.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||(t+=1)})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},y([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),y([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),m=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),C=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},A=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return m(o,t),o.prototype.postConstruct=function(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.gridApi.getModel().getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalRowCountComponent should only be used with the client side row model.")},o.prototype.onDataChanged=function(){this.setValue(e._.formatNumberCommas(this.getRowCountValue()))},o.prototype.getRowCountValue=function(){var t=0;return this.gridApi.forEachLeafNode((function(e){return t+=1})),t},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},C([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),C([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),w=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),_=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},R=function(t){function o(){return null!==t&&t.apply(this,arguments)||this}return w(o,t),o.prototype.postConstruct=function(){if(this.isValidRowModel()){this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count");var t=this.gridApi.getSelectedRows().length;this.setValue(e._.formatNumberCommas(t)),this.setDisplayed(t>0);var o=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,o),this.addManagedListener(this.eventService,e.Events.EVENT_SELECTION_CHANGED,o)}else console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.")},o.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},o.prototype.onRowSelectionChanged=function(){var t=this.gridApi.getSelectedRows().length;this.setValue(e._.formatNumberCommas(t)),this.setDisplayed(t>0)},o.prototype.init=function(){},o.prototype.destroy=function(){t.prototype.destroy.call(this)},_([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),_([e.PostConstruct],o.prototype,"postConstruct",null),o}(l),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),O=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},P=function(t){function o(){return t.call(this,o.TEMPLATE)||this}return b(o,t),o.prototype.destroy=function(){t.prototype.destroy.call(this)},o.prototype.postConstruct=function(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,e.Events.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,e.Events.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")},o.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},o.prototype.init=function(){},o.prototype.setAggregationComponentValue=function(t,o,n){var r=this.getAggregationValueComponent(t);e._.exists(r)&&r&&(r.setValue(e._.formatNumberTwoDecimalPlacesAndCommas(o)),r.setDisplayed(n))},o.prototype.getAggregationValueComponent=function(t){var o=t+"AggregationComp",n=null,r=e._.exists(this.gridOptions.statusBar)&&this.gridOptions.statusBar?e._.find(this.gridOptions.statusBar.statusPanels,(function(t){return"agAggregationComponent"===t.statusPanel})):null;return e._.exists(r)&&r?(!e._.exists(r.statusPanelParams)||e._.exists(r.statusPanelParams)&&e._.exists(r.statusPanelParams.aggFuncs)&&e._.exists(e._.find(r.statusPanelParams.aggFuncs,(function(e){return e===t}))))&&(n=this[o]):n=this[o],n},o.prototype.onRangeSelectionChanged=function(){var t=this,o=this.rangeService?this.rangeService.getCellRanges():void 0,n=0,r=0,i=0,a=null,s=null,u={};o&&!e._.missingOrEmpty(o)&&o.forEach((function(o){for(var p=t.rangeService.getRangeStartRow(o),c=t.rangeService.getRangeEndRow(o);;){if(e._.missing(p)||!p||t.rowPositionUtils.before(c,p)||!p||!o.columns)break;o.columns.forEach((function(o){if(null!==p){var c=t.cellPositionUtils.createId({rowPinned:p.rowPinned,column:o,rowIndex:p.rowIndex});if(!u[c]){u[c]=!0;var l=t.rowRenderer.getRowNode(p);if(!e._.missing(l)){var g=t.valueService.getValue(o,l);e._.missing(g)||""===g||(g.value&&(g=g.value),"string"==typeof g&&(g=Number(g)),"number"!=typeof g||isNaN(g)||(n+=g,(null===s||g>s)&&(s=g),(null===a||g<a)&&(a=g),i++),r++)}}}})),p=t.cellNavigationService.getRowBelow(p)}}));var p=r>1,c=i>1;this.setAggregationComponentValue("count",r,p),this.setAggregationComponentValue("sum",n,c),this.setAggregationComponentValue("min",a,c),this.setAggregationComponentValue("max",s,c),this.setAggregationComponentValue("avg",n/i,c)},o.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n <ag-name-value ref="avgAggregationComp"></ag-name-value>\n <ag-name-value ref="countAggregationComp"></ag-name-value>\n <ag-name-value ref="minAggregationComp"></ag-name-value>\n <ag-name-value ref="maxAggregationComp"></ag-name-value>\n <ag-name-value ref="sumAggregationComp"></ag-name-value>\n </div>',O([e.Optional("rangeService")],o.prototype,"rangeService",void 0),O([e.Autowired("valueService")],o.prototype,"valueService",void 0),O([e.Autowired("cellNavigationService")],o.prototype,"cellNavigationService",void 0),O([e.Autowired("rowRenderer")],o.prototype,"rowRenderer",void 0),O([e.Autowired("gridOptions")],o.prototype,"gridOptions",void 0),O([e.Autowired("gridApi")],o.prototype,"gridApi",void 0),O([e.Autowired("cellPositionUtils")],o.prototype,"cellPositionUtils",void 0),O([e.Autowired("rowPositionUtils")],o.prototype,"rowPositionUtils",void 0),O([e.RefSelector("sumAggregationComp")],o.prototype,"sumAggregationComp",void 0),O([e.RefSelector("countAggregationComp")],o.prototype,"countAggregationComp",void 0),O([e.RefSelector("minAggregationComp")],o.prototype,"minAggregationComp",void 0),O([e.RefSelector("maxAggregationComp")],o.prototype,"maxAggregationComp",void 0),O([e.RefSelector("avgAggregationComp")],o.prototype,"avgAggregationComp",void 0),O([e.PostConstruct],o.prototype,"postConstruct",null),o}(e.Component),S={moduleName:e.ModuleNames.StatusBarModule,beans:[i],agStackComponents:[{componentName:"AgStatusBar",componentClass:u},{componentName:"AgNameValue",componentClass:l}],userComponents:[{componentName:"agAggregationComponent",componentClass:P},{componentName:"agSelectedRowCountComponent",componentClass:R},{componentName:"agTotalRowCountComponent",componentClass:A},{componentName:"agFilteredRowCountComponent",componentClass:v},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:f}],dependantModules:[o.EnterpriseCoreModule]};exports.StatusBarModule=S; |
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -127,3 +127,3 @@ ' * @license Commercial | ||
}; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\"></div>\n </div>"; | ||
StatusBar.TEMPLATE = "<div class=\"ag-status-bar\">\n <div ref=\"eStatusBarLeft\" class=\"ag-status-bar-left\" role=\"status\"></div>\n <div ref=\"eStatusBarCenter\" class=\"ag-status-bar-center\" role=\"status\"></div>\n <div ref=\"eStatusBarRight\" class=\"ag-status-bar-right\" role=\"status\"></div>\n </div>"; | ||
__decorate$1([ | ||
@@ -130,0 +130,0 @@ Autowired('gridOptions') |
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
@@ -8,6 +8,6 @@ ' * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.0.0 | ||
* @ag-grid-enterprise/status-bar - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.1.0 | ||
* @link http://www.ag-grid.com/ | ||
' * @license Commercial | ||
*/ | ||
import{Bean as t,BeanStub as e,AgPromise as o,Autowired as n,RefSelector as r,PostConstruct as i,Component as a,Events as s,_ as p,Optional as u,ModuleNames as c}from"@ag-grid-community/core";import{EnterpriseCoreModule as l}from"@ag-grid-enterprise/core";var g,d=(g=function(t,e){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),f=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},h=function(e){function o(){var t=e.call(this)||this;return t.allComponents={},t}return d(o,e),o.prototype.registerStatusPanel=function(t,e){this.allComponents[t]=e},o.prototype.getStatusPanel=function(t){return this.allComponents[t]},o=f([t("statusBarService")],o)}(e),y=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),m=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},v=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return y(e,t),e.prototype.postConstruct=function(){if(this.gridOptions.statusBar&&this.gridOptions.statusBar.statusPanels){var t=this.gridOptions.statusBar.statusPanels.filter((function(t){return"left"===t.align}));this.createAndRenderComponents(t,this.eStatusBarLeft);var e=this.gridOptions.statusBar.statusPanels.filter((function(t){return"center"===t.align}));this.createAndRenderComponents(e,this.eStatusBarCenter);var o=this.gridOptions.statusBar.statusPanels.filter((function(t){return!t.align||"right"===t.align}));this.createAndRenderComponents(o,this.eStatusBarRight)}else this.setDisplayed(!1)},e.prototype.createAndRenderComponents=function(t,e){var n=this,r=[];t.forEach((function(t){var e={api:n.gridOptionsWrapper.getApi(),columnApi:n.gridOptionsWrapper.getColumnApi(),context:n.gridOptionsWrapper.getContext()},o=n.userComponentFactory.newStatusPanelComponent(t,e);o&&r.push({key:t.key||t.statusPanel,promise:o})})),o.all(r.map((function(t){return t.promise}))).then((function(){r.forEach((function(t){t.promise.then((function(o){var r=function(){n.getContext().destroyBean(o)};n.isAlive()?(n.statusBarService.registerStatusPanel(t.key,o),e.appendChild(o.getGui()),n.addDestroyFunc(r)):r()}))}))}))},e.TEMPLATE='<div class="ag-status-bar">\n <div ref="eStatusBarLeft" class="ag-status-bar-left"></div>\n <div ref="eStatusBarCenter" class="ag-status-bar-center"></div>\n <div ref="eStatusBarRight" class="ag-status-bar-right"></div>\n </div>',m([n("gridOptions")],e.prototype,"gridOptions",void 0),m([n("userComponentFactory")],e.prototype,"userComponentFactory",void 0),m([n("statusBarService")],e.prototype,"statusBarService",void 0),m([r("eStatusBarLeft")],e.prototype,"eStatusBarLeft",void 0),m([r("eStatusBarCenter")],e.prototype,"eStatusBarCenter",void 0),m([r("eStatusBarRight")],e.prototype,"eStatusBarRight",void 0),m([i],e.prototype,"postConstruct",null),e}(a),C=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),A=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},w=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return C(e,t),e.prototype.setLabel=function(t,e){this.setDisplayed(!1);var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eLabel.innerHTML=o(t,e)},e.prototype.setValue=function(t){this.eValue.innerHTML=t},e.TEMPLATE='<div class="ag-status-name-value">\n <span ref="eLabel"></span>: \n <span ref="eValue" class="ag-status-name-value-value"></span>\n </div>',A([r("eLabel")],e.prototype,"eLabel",void 0),A([r("eValue")],e.prototype,"eValue",void 0),e}(a),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),O=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.postConstruct=function(){"clientSide"===this.gridApi.getModel().getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=p.formatNumberCommas(this.getFilteredRowCountValue()),e=p.formatNumberCommas(this.getTotalRowCount());if(t===e)this.setValue(t);else{var o=this.gridOptionsWrapper.getLocaleTextFunc();this.setValue(t+" "+o("of","of")+" "+e)}},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||t++})),t},e.prototype.getTotalRowCount=function(){var t=0;return this.gridApi.forEachNode((function(e){e.group||t++})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},O([n("gridApi")],e.prototype,"gridApi",void 0),O([i],e.prototype,"postConstruct",null),e}(w),R=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),P=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.postConstruct=function(){if(this.setLabel("filteredRows","Filtered"),"clientSide"===this.gridApi.getModel().getType()){this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);var t=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,t)}else console.warn("AG Grid: agFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=this.getTotalRowCountValue(),e=this.getFilteredRowCountValue();this.setValue(p.formatNumberCommas(e)),this.setDisplayed(t!==e)},e.prototype.getTotalRowCountValue=function(){var t=0;return this.gridApi.forEachNode((function(e){return t+=1})),t},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||(t+=1)})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},P([n("gridApi")],e.prototype,"gridApi",void 0),P([i],e.prototype,"postConstruct",null),e}(w),E=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),T=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype.postConstruct=function(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.gridApi.getModel().getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){this.setValue(p.formatNumberCommas(this.getRowCountValue()))},e.prototype.getRowCountValue=function(){var t=0;return this.gridApi.forEachLeafNode((function(e){return t+=1})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},T([n("gridApi")],e.prototype,"gridApi",void 0),T([i],e.prototype,"postConstruct",null),e}(w),D=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),V=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return D(e,t),e.prototype.postConstruct=function(){if(this.isValidRowModel()){this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count");var t=this.gridApi.getSelectedRows().length;this.setValue(p.formatNumberCommas(t)),this.setDisplayed(t>0);var e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,s.EVENT_SELECTION_CHANGED,e)}else console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.onRowSelectionChanged=function(){var t=this.gridApi.getSelectedRows().length;this.setValue(p.formatNumberCommas(t)),this.setDisplayed(t>0)},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},V([n("gridApi")],e.prototype,"gridApi",void 0),V([i],e.prototype,"postConstruct",null),e}(w),N=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),M=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},B=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return N(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.postConstruct=function(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,s.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.init=function(){},e.prototype.setAggregationComponentValue=function(t,e,o){var n=this.getAggregationValueComponent(t);p.exists(n)&&n&&(n.setValue(p.formatNumberTwoDecimalPlacesAndCommas(e)),n.setDisplayed(o))},e.prototype.getAggregationValueComponent=function(t){var e=t+"AggregationComp",o=null,n=p.exists(this.gridOptions.statusBar)&&this.gridOptions.statusBar?p.find(this.gridOptions.statusBar.statusPanels,(function(t){return"agAggregationComponent"===t.statusPanel})):null;return p.exists(n)&&n?(!p.exists(n.statusPanelParams)||p.exists(n.statusPanelParams)&&p.exists(n.statusPanelParams.aggFuncs)&&p.exists(p.find(n.statusPanelParams.aggFuncs,(function(e){return e===t}))))&&(o=this[e]):o=this[e],o},e.prototype.onRangeSelectionChanged=function(){var t=this,e=this.rangeService?this.rangeService.getCellRanges():void 0,o=0,n=0,r=0,i=null,a=null,s={};e&&!p.missingOrEmpty(e)&&e.forEach((function(e){for(var u=t.rangeService.getRangeStartRow(e),c=t.rangeService.getRangeEndRow(e);;){if(p.missing(u)||!u||t.rowPositionUtils.before(c,u)||!u||!e.columns)break;e.columns.forEach((function(e){if(null!==u){var c=t.cellPositionUtils.createId({rowPinned:u.rowPinned,column:e,rowIndex:u.rowIndex});if(!s[c]){s[c]=!0;var l=t.rowRenderer.getRowNode(u);if(!p.missing(l)){var g=t.valueService.getValue(e,l);p.missing(g)||""===g||(g.value&&(g=g.value),"string"==typeof g&&(g=Number(g)),"number"!=typeof g||isNaN(g)||(o+=g,(null===a||g>a)&&(a=g),(null===i||g<i)&&(i=g),r++),n++)}}}})),u=t.cellNavigationService.getRowBelow(u)}}));var u=n>1,c=r>1;this.setAggregationComponentValue("count",n,u),this.setAggregationComponentValue("sum",o,c),this.setAggregationComponentValue("min",i,c),this.setAggregationComponentValue("max",a,c),this.setAggregationComponentValue("avg",o/r,c)},e.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n <ag-name-value ref="avgAggregationComp"></ag-name-value>\n <ag-name-value ref="countAggregationComp"></ag-name-value>\n <ag-name-value ref="minAggregationComp"></ag-name-value>\n <ag-name-value ref="maxAggregationComp"></ag-name-value>\n <ag-name-value ref="sumAggregationComp"></ag-name-value>\n </div>',M([u("rangeService")],e.prototype,"rangeService",void 0),M([n("valueService")],e.prototype,"valueService",void 0),M([n("cellNavigationService")],e.prototype,"cellNavigationService",void 0),M([n("rowRenderer")],e.prototype,"rowRenderer",void 0),M([n("gridOptions")],e.prototype,"gridOptions",void 0),M([n("gridApi")],e.prototype,"gridApi",void 0),M([n("cellPositionUtils")],e.prototype,"cellPositionUtils",void 0),M([n("rowPositionUtils")],e.prototype,"rowPositionUtils",void 0),M([r("sumAggregationComp")],e.prototype,"sumAggregationComp",void 0),M([r("countAggregationComp")],e.prototype,"countAggregationComp",void 0),M([r("minAggregationComp")],e.prototype,"minAggregationComp",void 0),M([r("maxAggregationComp")],e.prototype,"maxAggregationComp",void 0),M([r("avgAggregationComp")],e.prototype,"avgAggregationComp",void 0),M([i],e.prototype,"postConstruct",null),e}(a),x={moduleName:c.StatusBarModule,beans:[h],agStackComponents:[{componentName:"AgStatusBar",componentClass:v},{componentName:"AgNameValue",componentClass:w}],userComponents:[{componentName:"agAggregationComponent",componentClass:B},{componentName:"agSelectedRowCountComponent",componentClass:j},{componentName:"agTotalRowCountComponent",componentClass:L},{componentName:"agFilteredRowCountComponent",componentClass:S},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:_}],dependantModules:[l]};export{x as StatusBarModule}; | ||
import{Bean as t,BeanStub as e,AgPromise as o,Autowired as n,RefSelector as r,PostConstruct as i,Component as a,Events as s,_ as p,Optional as u,ModuleNames as l}from"@ag-grid-community/core";import{EnterpriseCoreModule as c}from"@ag-grid-enterprise/core";var g,d=(g=function(t,e){return(g=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function o(){this.constructor=t}g(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),f=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},h=function(e){function o(){var t=e.call(this)||this;return t.allComponents={},t}return d(o,e),o.prototype.registerStatusPanel=function(t,e){this.allComponents[t]=e},o.prototype.getStatusPanel=function(t){return this.allComponents[t]},o=f([t("statusBarService")],o)}(e),y=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),m=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},v=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return y(e,t),e.prototype.postConstruct=function(){if(this.gridOptions.statusBar&&this.gridOptions.statusBar.statusPanels){var t=this.gridOptions.statusBar.statusPanels.filter((function(t){return"left"===t.align}));this.createAndRenderComponents(t,this.eStatusBarLeft);var e=this.gridOptions.statusBar.statusPanels.filter((function(t){return"center"===t.align}));this.createAndRenderComponents(e,this.eStatusBarCenter);var o=this.gridOptions.statusBar.statusPanels.filter((function(t){return!t.align||"right"===t.align}));this.createAndRenderComponents(o,this.eStatusBarRight)}else this.setDisplayed(!1)},e.prototype.createAndRenderComponents=function(t,e){var n=this,r=[];t.forEach((function(t){var e={api:n.gridOptionsWrapper.getApi(),columnApi:n.gridOptionsWrapper.getColumnApi(),context:n.gridOptionsWrapper.getContext()},o=n.userComponentFactory.newStatusPanelComponent(t,e);o&&r.push({key:t.key||t.statusPanel,promise:o})})),o.all(r.map((function(t){return t.promise}))).then((function(){r.forEach((function(t){t.promise.then((function(o){var r=function(){n.getContext().destroyBean(o)};n.isAlive()?(n.statusBarService.registerStatusPanel(t.key,o),e.appendChild(o.getGui()),n.addDestroyFunc(r)):r()}))}))}))},e.TEMPLATE='<div class="ag-status-bar">\n <div ref="eStatusBarLeft" class="ag-status-bar-left" role="status"></div>\n <div ref="eStatusBarCenter" class="ag-status-bar-center" role="status"></div>\n <div ref="eStatusBarRight" class="ag-status-bar-right" role="status"></div>\n </div>',m([n("gridOptions")],e.prototype,"gridOptions",void 0),m([n("userComponentFactory")],e.prototype,"userComponentFactory",void 0),m([n("statusBarService")],e.prototype,"statusBarService",void 0),m([r("eStatusBarLeft")],e.prototype,"eStatusBarLeft",void 0),m([r("eStatusBarCenter")],e.prototype,"eStatusBarCenter",void 0),m([r("eStatusBarRight")],e.prototype,"eStatusBarRight",void 0),m([i],e.prototype,"postConstruct",null),e}(a),C=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),A=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},w=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return C(e,t),e.prototype.setLabel=function(t,e){this.setDisplayed(!1);var o=this.gridOptionsWrapper.getLocaleTextFunc();this.eLabel.innerHTML=o(t,e)},e.prototype.setValue=function(t){this.eValue.innerHTML=t},e.TEMPLATE='<div class="ag-status-name-value">\n <span ref="eLabel"></span>: \n <span ref="eValue" class="ag-status-name-value-value"></span>\n </div>',A([r("eLabel")],e.prototype,"eLabel",void 0),A([r("eValue")],e.prototype,"eValue",void 0),e}(a),b=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),O=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},_=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return b(e,t),e.prototype.postConstruct=function(){"clientSide"===this.gridApi.getModel().getType()?(this.setLabel("totalAndFilteredRows","Rows"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-and-filtered-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalAndFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=p.formatNumberCommas(this.getFilteredRowCountValue()),e=p.formatNumberCommas(this.getTotalRowCount());if(t===e)this.setValue(t);else{var o=this.gridOptionsWrapper.getLocaleTextFunc();this.setValue(t+" "+o("of","of")+" "+e)}},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||t++})),t},e.prototype.getTotalRowCount=function(){var t=0;return this.gridApi.forEachNode((function(e){e.group||t++})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},O([n("gridApi")],e.prototype,"gridApi",void 0),O([i],e.prototype,"postConstruct",null),e}(w),R=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),P=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},S=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return R(e,t),e.prototype.postConstruct=function(){if(this.setLabel("filteredRows","Filtered"),"clientSide"===this.gridApi.getModel().getType()){this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-filtered-row-count"),this.setDisplayed(!0);var t=this.onDataChanged.bind(this);this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,t)}else console.warn("AG Grid: agFilteredRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){var t=this.getTotalRowCountValue(),e=this.getFilteredRowCountValue();this.setValue(p.formatNumberCommas(e)),this.setDisplayed(t!==e)},e.prototype.getTotalRowCountValue=function(){var t=0;return this.gridApi.forEachNode((function(e){return t+=1})),t},e.prototype.getFilteredRowCountValue=function(){var t=0;return this.gridApi.forEachNodeAfterFilter((function(e){e.group||(t+=1)})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},P([n("gridApi")],e.prototype,"gridApi",void 0),P([i],e.prototype,"postConstruct",null),e}(w),E=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),T=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},L=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return E(e,t),e.prototype.postConstruct=function(){this.setLabel("totalRows","Total Rows"),"clientSide"===this.gridApi.getModel().getType()?(this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-total-row-count"),this.setDisplayed(!0),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onDataChanged.bind(this))):console.warn("AG Grid: agTotalRowCountComponent should only be used with the client side row model.")},e.prototype.onDataChanged=function(){this.setValue(p.formatNumberCommas(this.getRowCountValue()))},e.prototype.getRowCountValue=function(){var t=0;return this.gridApi.forEachLeafNode((function(e){return t+=1})),t},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},T([n("gridApi")],e.prototype,"gridApi",void 0),T([i],e.prototype,"postConstruct",null),e}(w),D=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),V=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},j=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return D(e,t),e.prototype.postConstruct=function(){if(this.isValidRowModel()){this.setLabel("selectedRows","Selected"),this.addCssClass("ag-status-panel"),this.addCssClass("ag-status-panel-selected-row-count");var t=this.gridApi.getSelectedRows().length;this.setValue(p.formatNumberCommas(t)),this.setDisplayed(t>0);var e=this.onRowSelectionChanged.bind(this);this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,e),this.addManagedListener(this.eventService,s.EVENT_SELECTION_CHANGED,e)}else console.warn("AG Grid: agSelectedRowCountComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.onRowSelectionChanged=function(){var t=this.gridApi.getSelectedRows().length;this.setValue(p.formatNumberCommas(t)),this.setDisplayed(t>0)},e.prototype.init=function(){},e.prototype.destroy=function(){t.prototype.destroy.call(this)},V([n("gridApi")],e.prototype,"gridApi",void 0),V([i],e.prototype,"postConstruct",null),e}(w),N=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function n(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(n.prototype=o.prototype,new n)}}(),M=function(t,e,o,n){var r,i=arguments.length,a=i<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(i<3?r(a):i>3?r(e,o,a):r(e,o))||a);return i>3&&a&&Object.defineProperty(e,o,a),a},B=function(t){function e(){return t.call(this,e.TEMPLATE)||this}return N(e,t),e.prototype.destroy=function(){t.prototype.destroy.call(this)},e.prototype.postConstruct=function(){this.isValidRowModel()?(this.avgAggregationComp.setLabel("avg","Average"),this.countAggregationComp.setLabel("count","Count"),this.minAggregationComp.setLabel("min","Min"),this.maxAggregationComp.setLabel("max","Max"),this.sumAggregationComp.setLabel("sum","Sum"),this.addManagedListener(this.eventService,s.EVENT_RANGE_SELECTION_CHANGED,this.onRangeSelectionChanged.bind(this)),this.addManagedListener(this.eventService,s.EVENT_MODEL_UPDATED,this.onRangeSelectionChanged.bind(this))):console.warn("AG Grid: agAggregationComponent should only be used with the client and server side row model.")},e.prototype.isValidRowModel=function(){var t=this.gridApi.getModel().getType();return"clientSide"===t||"serverSide"===t},e.prototype.init=function(){},e.prototype.setAggregationComponentValue=function(t,e,o){var n=this.getAggregationValueComponent(t);p.exists(n)&&n&&(n.setValue(p.formatNumberTwoDecimalPlacesAndCommas(e)),n.setDisplayed(o))},e.prototype.getAggregationValueComponent=function(t){var e=t+"AggregationComp",o=null,n=p.exists(this.gridOptions.statusBar)&&this.gridOptions.statusBar?p.find(this.gridOptions.statusBar.statusPanels,(function(t){return"agAggregationComponent"===t.statusPanel})):null;return p.exists(n)&&n?(!p.exists(n.statusPanelParams)||p.exists(n.statusPanelParams)&&p.exists(n.statusPanelParams.aggFuncs)&&p.exists(p.find(n.statusPanelParams.aggFuncs,(function(e){return e===t}))))&&(o=this[e]):o=this[e],o},e.prototype.onRangeSelectionChanged=function(){var t=this,e=this.rangeService?this.rangeService.getCellRanges():void 0,o=0,n=0,r=0,i=null,a=null,s={};e&&!p.missingOrEmpty(e)&&e.forEach((function(e){for(var u=t.rangeService.getRangeStartRow(e),l=t.rangeService.getRangeEndRow(e);;){if(p.missing(u)||!u||t.rowPositionUtils.before(l,u)||!u||!e.columns)break;e.columns.forEach((function(e){if(null!==u){var l=t.cellPositionUtils.createId({rowPinned:u.rowPinned,column:e,rowIndex:u.rowIndex});if(!s[l]){s[l]=!0;var c=t.rowRenderer.getRowNode(u);if(!p.missing(c)){var g=t.valueService.getValue(e,c);p.missing(g)||""===g||(g.value&&(g=g.value),"string"==typeof g&&(g=Number(g)),"number"!=typeof g||isNaN(g)||(o+=g,(null===a||g>a)&&(a=g),(null===i||g<i)&&(i=g),r++),n++)}}}})),u=t.cellNavigationService.getRowBelow(u)}}));var u=n>1,l=r>1;this.setAggregationComponentValue("count",n,u),this.setAggregationComponentValue("sum",o,l),this.setAggregationComponentValue("min",i,l),this.setAggregationComponentValue("max",a,l),this.setAggregationComponentValue("avg",o/r,l)},e.TEMPLATE='<div class="ag-status-panel ag-status-panel-aggregations">\n <ag-name-value ref="avgAggregationComp"></ag-name-value>\n <ag-name-value ref="countAggregationComp"></ag-name-value>\n <ag-name-value ref="minAggregationComp"></ag-name-value>\n <ag-name-value ref="maxAggregationComp"></ag-name-value>\n <ag-name-value ref="sumAggregationComp"></ag-name-value>\n </div>',M([u("rangeService")],e.prototype,"rangeService",void 0),M([n("valueService")],e.prototype,"valueService",void 0),M([n("cellNavigationService")],e.prototype,"cellNavigationService",void 0),M([n("rowRenderer")],e.prototype,"rowRenderer",void 0),M([n("gridOptions")],e.prototype,"gridOptions",void 0),M([n("gridApi")],e.prototype,"gridApi",void 0),M([n("cellPositionUtils")],e.prototype,"cellPositionUtils",void 0),M([n("rowPositionUtils")],e.prototype,"rowPositionUtils",void 0),M([r("sumAggregationComp")],e.prototype,"sumAggregationComp",void 0),M([r("countAggregationComp")],e.prototype,"countAggregationComp",void 0),M([r("minAggregationComp")],e.prototype,"minAggregationComp",void 0),M([r("maxAggregationComp")],e.prototype,"maxAggregationComp",void 0),M([r("avgAggregationComp")],e.prototype,"avgAggregationComp",void 0),M([i],e.prototype,"postConstruct",null),e}(a),x={moduleName:l.StatusBarModule,beans:[h],agStackComponents:[{componentName:"AgStatusBar",componentClass:v},{componentName:"AgNameValue",componentClass:w}],userComponents:[{componentName:"agAggregationComponent",componentClass:B},{componentName:"agSelectedRowCountComponent",componentClass:j},{componentName:"agTotalRowCountComponent",componentClass:L},{componentName:"agFilteredRowCountComponent",componentClass:S},{componentName:"agTotalAndFilteredRowCountComponent",componentClass:_}],dependantModules:[c]};export{x as StatusBarModule}; |
{ | ||
"name": "@ag-grid-enterprise/status-bar", | ||
"version": "26.0.0", | ||
"version": "26.1.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -45,4 +45,4 @@ "main": "./dist/cjs/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "~26.0.0", | ||
"@ag-grid-enterprise/core": "~26.0.0" | ||
"@ag-grid-community/core": "~26.1.0", | ||
"@ag-grid-enterprise/core": "~26.1.0" | ||
}, | ||
@@ -49,0 +49,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
322000
3015
0
+ Added@ag-grid-community/core@26.1.0(transitive)
+ Added@ag-grid-enterprise/core@26.1.0(transitive)
- Removed@ag-grid-community/core@26.0.0(transitive)
- Removed@ag-grid-enterprise/core@26.0.0(transitive)