validar si aggregator.format es una funcion

This commit is contained in:
dehernandezm 2025-02-14 10:19:52 -06:00
parent dccd627f1b
commit 84c65f2b8d
3 changed files with 4 additions and 6 deletions

View File

@ -290,7 +290,7 @@ function makeRenderer() {
var getFormatedValue = function getFormatedValue(aggregator) {
var valToFormat = aggregator.value();
var resultValue = aggregator.format(valToFormat);
var resultValue = typeof aggregator.format === 'function' ? aggregator.format(valToFormat) : valToFormat;
var keyColumnaCalculo = isNotNullish(_this2.props.vals) && _this2.props.vals.length ? _this2.props.vals[0] : null;
if (_this2.props.aggregatorName === 'Conteo') {
resultValue = isNotNullish(_this2.props.functions) ? _this2.props.functions.formatedValue(valToFormat, '0,0', 'number', false) : resultValue;
@ -460,9 +460,7 @@ function makeRenderer() {
);
}),
colKeys.map(function (colKey, j) {
var aggregator = isSubTotal ? { value: function value() {
return 0;
} } : pivotData.getAggregator(rowKey, colKey); // getSubAggregator(rowKey, colKey);
var aggregator = getSubAggregator(rowKey, colKey);
return _react2.default.createElement(
'td',
{

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "v-react-pivottable",
"version": "0.11.55",
"version": "0.11.56",
"description": "A React-based pivot table",
"main": "PivotTableUI.js",
"files": [