test agregar slot dentro de sortable row attrs

This commit is contained in:
dehernandezm 2025-02-14 12:44:58 -06:00
parent e0c4ce0d19
commit b3ad82be5a
3 changed files with 21 additions and 4 deletions

View File

@ -364,6 +364,7 @@ var PivotTableUI = function (_React$PureComponent2) {
attrValues: {}, attrValues: {},
materializedInput: [], materializedInput: [],
hideConfiguration: false, hideConfiguration: false,
showSubtotales: false,
headerClass: '', headerClass: '',
stylesHeaders: {} stylesHeaders: {}
}; };
@ -572,7 +573,7 @@ var PivotTableUI = function (_React$PureComponent2) {
} }
}, { }, {
key: 'makeDnDCell', key: 'makeDnDCell',
value: function makeDnDCell(items, onChange, classes) { value: function makeDnDCell(items, onChange, classes, headSlot) {
var _this7 = this; var _this7 = this;
return _react2.default.createElement( return _react2.default.createElement(
@ -588,6 +589,7 @@ var PivotTableUI = function (_React$PureComponent2) {
className: classes, className: classes,
onChange: onChange onChange: onChange
}, },
headSlot && typeof headSlot === 'function' && headSlot(),
items.map(function (x) { items.map(function (x) {
return _react2.default.createElement(DraggableAttribute, { return _react2.default.createElement(DraggableAttribute, {
name: x, name: x,
@ -732,7 +734,22 @@ 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 rowAttrsCell = this.makeDnDCell(rowAttrs, this.propUpdater('rows'), 'pvtAxisContainer pvtVertList pvtRows'); var renderCheckSubtotal = function renderCheckSubtotal() {
return _react2.default.createElement(
'li',
{ className: 'pvtFilterBox', 'data-id': '[:sub-total:]' },
_react2.default.createElement(
'span',
{ className: 'pvtAttr' },
_react2.default.createElement(
'span',
{ className: 'pvtAttrTitle' },
'Mostrar Subtotales S/N'
)
)
);
};
var rowAttrsCell = this.makeDnDCell(rowAttrs, this.propUpdater('rows'), 'pvtAxisContainer pvtVertList pvtRows', renderCheckSubtotal);
console.log('render rowAttrs ', rowAttrs); console.log('render rowAttrs ', rowAttrs);
var outputCell = _react2.default.createElement( var outputCell = _react2.default.createElement(
'td', 'td',

File diff suppressed because one or more lines are too long

View File

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