@churchillliving/se-ui-toolkit 6.53.497 → 6.53.498

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3898,6 +3898,8 @@
3898
3898
  this.pagination = false;
3899
3899
  // Optional prop to handle show CurrentPage Report
3900
3900
  this.showCurrentPageReport = false;
3901
+ // Displays aggregate that fetch from records
3902
+ this.aggregatedResult = [];
3901
3903
  this.showconfirmDialog = true;
3902
3904
  this.saveAllData = false;
3903
3905
  this.columnActions = [];
@@ -5430,6 +5432,7 @@
5430
5432
  var columnType = col.type;
5431
5433
  if (columnType === exports.EGridAggregate.COUNT) {
5432
5434
  var count = _this.rowsData.length;
5435
+ count = _this.setFetchAggregatedValue(column, count, 1);
5433
5436
  col.aggrValue = _this.setAggregateFooterText(col, count, 'Count');
5434
5437
  }
5435
5438
  if (columnType === exports.EGridAggregate.SUM ||
@@ -5438,10 +5441,12 @@
5438
5441
  if (colValues && colValues.length > 0) {
5439
5442
  var sum = colValues.reduce(function (acc, cur) { return acc + cur; }, 0);
5440
5443
  if (columnType === exports.EGridAggregate.SUM) {
5444
+ sum = _this.setFetchAggregatedValue(column, sum, 2);
5441
5445
  col.aggrValue = _this.setAggregateFooterText(col, sum, 'Sum');
5442
5446
  }
5443
5447
  if (columnType === exports.EGridAggregate.AVERAGE) {
5444
5448
  var average = sum / colValues.length || 0;
5449
+ average = _this.setFetchAggregatedValue(column, sum, 3);
5445
5450
  col.aggrValue = _this.setAggregateFooterText(col, average, 'Avg');
5446
5451
  }
5447
5452
  }
@@ -5453,6 +5458,17 @@
5453
5458
  });
5454
5459
  }
5455
5460
  };
5461
+ // set the aggregataion value that coming from fetch
5462
+ GridComponent.prototype.setFetchAggregatedValue = function (column, aggregateValue, aggregateAction) {
5463
+ var _a;
5464
+ if (((_a = this.aggregatedResult) === null || _a === void 0 ? void 0 : _a.length) > 0) {
5465
+ var aggregatedColumn = this.aggregatedResult.find(function (aggregate) { var _a, _b; return ((_a = aggregate.field) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = column.field) === null || _b === void 0 ? void 0 : _b.toLowerCase()) && aggregate.aggregationOperation === aggregateAction; });
5466
+ if (aggregatedColumn) {
5467
+ aggregateValue = aggregatedColumn === null || aggregatedColumn === void 0 ? void 0 : aggregatedColumn.value;
5468
+ }
5469
+ }
5470
+ return aggregateValue;
5471
+ };
5456
5472
  /**
5457
5473
  * set grid Aggregate values
5458
5474
  */
@@ -6412,6 +6428,7 @@
6412
6428
  pagination: [{ type: i0.Input }],
6413
6429
  showCurrentPageReport: [{ type: i0.Input }],
6414
6430
  totalRecords: [{ type: i0.Input }],
6431
+ aggregatedResult: [{ type: i0.Input }],
6415
6432
  showconfirmDialog: [{ type: i0.Input }],
6416
6433
  saveAllData: [{ type: i0.Input }],
6417
6434
  defaultRows: [{ type: i0.Input }],