remover parametros que no se utilizan, quitar texto en nulo, aplicar formato a totales

This commit is contained in:
dehernandezm 2025-01-24 13:19:55 -06:00
parent 12aa058e95
commit 49b567ca2d
3 changed files with 9 additions and 10 deletions

View File

@ -263,7 +263,7 @@ function makeRenderer() {
};
};
var getFormatedValue = function getFormatedValue(aggregator, rowKey, colKey) {
var getFormatedValue = function getFormatedValue(aggregator) {
var valToFormat = aggregator.value();
var resultValue = aggregator.format(valToFormat);
var keyColumnaCalculo = isNotNullish(_this2.props.vals) && _this2.props.vals.length ? _this2.props.vals[0] : null;
@ -271,9 +271,9 @@ function makeRenderer() {
var _definition = _this2.props.headersDefinitions[keyColumnaCalculo];
if (isNotNullish(_definition) && isNotNullish(_definition.value)) {
if (_definition.value.startsWith('count_') || _definition.value.startsWith('countd_')) {
resultValue = isNotNullish(_this2.props.functions) ? _this2.props.functions.formatedValue(valToFormat, '0,0', 'number', true, '') : resultValue;
resultValue = isNotNullish(_this2.props.functions) ? _this2.props.functions.formatedValue(valToFormat, '0,0', 'number', false) : resultValue;
} else if (isNotNullish(_definition.format) && _definition.format !== '') {
resultValue = isNotNullish(_this2.props.chartFunctions) ? _this2.props.chartFunctions.formatedValue(valToFormat, getFinalFormat(_definition), _definition.type, true, '', getLocaleConfig(_definition)) : resultValue;
resultValue = isNotNullish(_this2.props.chartFunctions) ? _this2.props.chartFunctions.formatedValue(valToFormat, getFinalFormat(_definition), _definition.type, false, null, getLocaleConfig(_definition)) : resultValue;
}
}
}
@ -376,8 +376,7 @@ function makeRenderer() {
onClick: getClickHandler && getClickHandler(aggregator.value(), rowKey, colKey),
style: valueCellColors(rowKey, colKey, aggregator.value())
},
!(j < 10) && aggregator.format(aggregator.value()),
j < 10 && getFormatedValue(aggregator, rowKey, colKey)
getFormatedValue(aggregator)
);
}),
_react2.default.createElement(
@ -387,7 +386,7 @@ function makeRenderer() {
onClick: getClickHandler && getClickHandler(totalAggregator.value(), rowKey, [null]),
style: colTotalColors(totalAggregator.value())
},
totalAggregator.format(totalAggregator.value())
getFormatedValue(totalAggregator)
)
);
}),
@ -413,7 +412,7 @@ function makeRenderer() {
onClick: getClickHandler && getClickHandler(totalAggregator.value(), [null], colKey),
style: rowTotalColors(totalAggregator.value())
},
totalAggregator.format(totalAggregator.value())
getFormatedValue(totalAggregator)
);
}),
_react2.default.createElement(
@ -422,7 +421,7 @@ function makeRenderer() {
onClick: getClickHandler && getClickHandler(grandTotalAggregator.value(), [null], [null]),
className: 'pvtGrandTotal'
},
grandTotalAggregator.format(grandTotalAggregator.value())
getFormatedValue(grandTotalAggregator)
)
)
)

File diff suppressed because one or more lines are too long

View File

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