@churchillliving/se-ui-toolkit 6.53.497 → 6.53.499
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.
- package/bundles/churchillliving-se-ui-toolkit.umd.js +41 -23
- package/bundles/churchillliving-se-ui-toolkit.umd.js.map +1 -1
- package/churchillliving-se-ui-toolkit.metadata.json +1 -1
- package/esm2015/lib/components/base/grid/grid.component.js +45 -27
- package/fesm2015/churchillliving-se-ui-toolkit.js +44 -26
- package/fesm2015/churchillliving-se-ui-toolkit.js.map +1 -1
- package/lib/components/base/grid/grid.component.d.ts +2 -0
- package/package.json +1 -1
|
@@ -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
|
*/
|
|
@@ -5972,29 +5988,30 @@
|
|
|
5972
5988
|
};
|
|
5973
5989
|
// Invoke onClick Event.
|
|
5974
5990
|
GridComponent.prototype.onClickEvent = function (column, row) {
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
|
|
5987
|
-
|
|
5988
|
-
|
|
5989
|
-
|
|
5990
|
-
|
|
5991
|
-
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5991
|
+
var _a, _b, _c, _d;
|
|
5992
|
+
if (column.type === exports.EGridColumnType.LINK && (column.editLink === false || column.editLink === undefined) && column.editable !== true && column.disabled !== true) {
|
|
5993
|
+
if (column && column.onClick && column.disabled !== true && ((_b = (_a = row[column.field + '_obj']) === null || _a === void 0 ? void 0 : _a.action) === null || _b === void 0 ? void 0 : _b.disabled) !== true) {
|
|
5994
|
+
column.onClick(row);
|
|
5995
|
+
}
|
|
5996
|
+
else {
|
|
5997
|
+
var a = document.createElement('a');
|
|
5998
|
+
a.href = (_c = row[column.field + '_obj']) === null || _c === void 0 ? void 0 : _c.hyperlink;
|
|
5999
|
+
a.target = column.target ? column.target : '_blank',
|
|
6000
|
+
a.click();
|
|
6001
|
+
}
|
|
6002
|
+
}
|
|
6003
|
+
if (column.type === exports.EGridColumnType.DATE && row[column.field]) {
|
|
6004
|
+
this.calenderPreviousValue = row[column.field];
|
|
6005
|
+
}
|
|
6006
|
+
else if (!row[column.field] &&
|
|
6007
|
+
column.type === exports.EGridColumnType.DATE &&
|
|
6008
|
+
(column.showTime || column.timeOnly) &&
|
|
6009
|
+
column.minutesInterval) {
|
|
6010
|
+
this.defaultDate = new Date(setMinutesInterval(new Date()));
|
|
6011
|
+
}
|
|
6012
|
+
if (column && column.onClick && column.disabled !== true && ((_d = row[column.field + '_obj']) === null || _d === void 0 ? void 0 : _d.disabled) !== true) {
|
|
6013
|
+
column.onClick(row);
|
|
6014
|
+
}
|
|
5998
6015
|
};
|
|
5999
6016
|
// set the select value of multi-select
|
|
6000
6017
|
GridComponent.prototype.showOption = function (column, row) {
|
|
@@ -6412,6 +6429,7 @@
|
|
|
6412
6429
|
pagination: [{ type: i0.Input }],
|
|
6413
6430
|
showCurrentPageReport: [{ type: i0.Input }],
|
|
6414
6431
|
totalRecords: [{ type: i0.Input }],
|
|
6432
|
+
aggregatedResult: [{ type: i0.Input }],
|
|
6415
6433
|
showconfirmDialog: [{ type: i0.Input }],
|
|
6416
6434
|
saveAllData: [{ type: i0.Input }],
|
|
6417
6435
|
defaultRows: [{ type: i0.Input }],
|