UNPKG

devextreme

Version:

JavaScript/TypeScript Component Suite for Responsive Web Development

35 lines (33 loc) • 1.27 kB
/** * DevExtreme (esm/__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/ */ import { isDefined } from "../../../../core/utils/type"; function isHideableColumn(column) { const isGroup = ((null === column || void 0 === column ? void 0 : column.groupIndex) ?? -1) >= 0; return true === column.visible && !isDefined(column.type) && !column.fixed && !isGroup } export function getHideableColumns(columns) { return columns.filter(isHideableColumn) } export function resolveAdaptiveDetailRowTarget(key, rowIndex, expandedRowIndex, alwaysExpanded) { const isCollapsing = !alwaysExpanded && expandedRowIndex >= 0 && expandedRowIndex === rowIndex; return isCollapsing ? { key: void 0, rowIndex: -1 } : { key: key, rowIndex: rowIndex } } export 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 }