devextreme
Version:
JavaScript/TypeScript Component Suite for Responsive Web Development
32 lines (29 loc) • 1.21 kB
JavaScript
/**
* DevExtreme (cjs/__internal/grids/data_grid/summary/utils.js)
* Version: 25.2.7
* Build date: Tue May 05 2026
*
* Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED
* Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/
*/
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getColumnFromMap = getColumnFromMap;
exports.getSummaryCellIndex = getSummaryCellIndex;
var _type = require("../../../../core/utils/type");
function getSummaryCellIndex(column, prevColumn) {
let isGroupRow = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : false;
const cellIndex = column.index ?? -1;
if (!isGroupRow) {
return cellIndex
}
if ("groupExpand" === (null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.type) || "groupExpand" === column.type) {
return (null === prevColumn || void 0 === prevColumn ? void 0 : prevColumn.index) ?? -1
}
return !(0, _type.isDefined)(column.groupIndex) ? cellIndex : -1
}
function getColumnFromMap(identifier, columnMap) {
return void 0 !== identifier ? columnMap.get(identifier) : void 0
}