test prevent error ordenar con elemento subtotales en lisa de atributos filas, agregar input checkbox para bandera mostrar subtotales
This commit is contained in:
parent
b3ad82be5a
commit
a35cbaa5f2
@ -573,16 +573,22 @@ var PivotTableUI = function (_React$PureComponent2) {
|
|||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
key: 'makeDnDCell',
|
key: 'makeDnDCell',
|
||||||
value: function makeDnDCell(items, onChange, classes, headSlot) {
|
value: function makeDnDCell(items, _onChange, classes, headSlot) {
|
||||||
var _this7 = this;
|
var _this7 = this;
|
||||||
|
|
||||||
|
var onChange = function onChange(newArr) {
|
||||||
|
var _resultArr = newArr.filter(function (item) {
|
||||||
|
return item !== '[:sub-total:]';
|
||||||
|
});
|
||||||
|
_onChange(_resultArr);
|
||||||
|
};
|
||||||
return _react2.default.createElement(
|
return _react2.default.createElement(
|
||||||
_reactSortablejs2.default,
|
_reactSortablejs2.default,
|
||||||
{
|
{
|
||||||
options: {
|
options: {
|
||||||
group: 'shared',
|
group: 'shared',
|
||||||
ghostClass: 'pvtPlaceholder',
|
ghostClass: 'pvtPlaceholder',
|
||||||
filter: '.pvtFilterBox',
|
filter: '.pvtFilterBox, .pvtSubtotalCheck',
|
||||||
preventOnFilter: false
|
preventOnFilter: false
|
||||||
},
|
},
|
||||||
tag: 'td',
|
tag: 'td',
|
||||||
@ -734,23 +740,34 @@ var PivotTableUI = function (_React$PureComponent2) {
|
|||||||
var rowAttrs = this.props.rows.filter(function (e) {
|
var rowAttrs = this.props.rows.filter(function (e) {
|
||||||
return !_this8.props.hiddenAttributes.includes(e) && !_this8.props.hiddenFromDragDrop.includes(e);
|
return !_this8.props.hiddenAttributes.includes(e) && !_this8.props.hiddenFromDragDrop.includes(e);
|
||||||
});
|
});
|
||||||
|
var toggleSubTotales = function toggleSubTotales() {
|
||||||
|
var _showSubt = _this8.props.showSubtotales;
|
||||||
|
_this8.propUpdater('rowOrder')(!_showSubt);
|
||||||
|
};
|
||||||
var renderCheckSubtotal = function renderCheckSubtotal() {
|
var renderCheckSubtotal = function renderCheckSubtotal() {
|
||||||
return _react2.default.createElement(
|
return _react2.default.createElement(
|
||||||
'li',
|
'li',
|
||||||
{ className: 'pvtFilterBox', 'data-id': '[:sub-total:]' },
|
{ className: 'pvtSubtotalCheck cursor-default', 'data-id': '[:sub-total:]' },
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'span',
|
'span',
|
||||||
{ className: 'pvtAttr' },
|
{ className: 'pvtAttr' },
|
||||||
_react2.default.createElement(
|
_react2.default.createElement(
|
||||||
'span',
|
'span',
|
||||||
{ className: 'pvtAttrTitle' },
|
{ className: 'pvtAttrTitle' },
|
||||||
'Mostrar Subtotales S/N'
|
'Subtotales'
|
||||||
)
|
),
|
||||||
|
_react2.default.createElement('input', {
|
||||||
|
type: 'checkbox',
|
||||||
|
checked: _this8.props.showSubtotales,
|
||||||
|
className: 'via-checkbox h-5 w-5 cursor-pointer',
|
||||||
|
onChange: function onChange(e) {
|
||||||
|
toggleSubTotales();
|
||||||
|
}
|
||||||
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
var rowAttrsCell = this.makeDnDCell(rowAttrs, this.propUpdater('rows'), 'pvtAxisContainer pvtVertList pvtRows', renderCheckSubtotal);
|
var rowAttrsCell = this.makeDnDCell(rowAttrs, this.propUpdater('rows'), 'pvtAxisContainer pvtVertList pvtRows', renderCheckSubtotal);
|
||||||
console.log('render rowAttrs ', rowAttrs);
|
|
||||||
var outputCell = _react2.default.createElement(
|
var outputCell = _react2.default.createElement(
|
||||||
'td',
|
'td',
|
||||||
{ className: 'pvtOutput' },
|
{ className: 'pvtOutput' },
|
||||||
|
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "v-react-pivottable",
|
"name": "v-react-pivottable",
|
||||||
"version": "0.11.60",
|
"version": "0.11.61",
|
||||||
"description": "A React-based pivot table",
|
"description": "A React-based pivot table",
|
||||||
"main": "PivotTableUI.js",
|
"main": "PivotTableUI.js",
|
||||||
"files": [
|
"files": [
|
||||||
|
Loading…
Reference in New Issue
Block a user