UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

43 lines (38 loc) • 1.52 kB
/** * DevExtreme (cjs/__internal/grids/grid_core/adaptivity/utils.js) * Version: 26.1.6 * Build date: Fri Oct 16 2026 * * Copyright (c) 2012 - 2026 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getAdaptiveDetailRowIndex = getAdaptiveDetailRowIndex; exports.getHideableColumns = getHideableColumns; exports.resolveAdaptiveDetailRowTarget = resolveAdaptiveDetailRowTarget; var _type = require("../../../../core/utils/type"); function isHideableColumn(column) { const isGroup = ((null === column || void 0 === column ? void 0 : column.groupIndex) ?? -1) >= 0; return true === column.visible && !(0, _type.isDefined)(column.type) && !column.fixed && !isGroup } function getHideableColumns(columns) { return columns.filter(isHideableColumn) } function resolveAdaptiveDetailRowTarget(key, rowIndex, expandedRowIndex, alwaysExpanded) { const isCollapsing = !alwaysExpanded && expandedRowIndex >= 0 && expandedRowIndex === rowIndex; return isCollapsing ? { key: void 0, rowIndex: -1 } : { key: key, rowIndex: rowIndex } } function getAdaptiveDetailRowIndex(dataRowIndex) { let rowIndexDelta = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : 0; const detailRowIndex = dataRowIndex >= 0 ? dataRowIndex + 1 : dataRowIndex; return detailRowIndex - rowIndexDelta }