Files
2026-08-07 21:39:30 +02:00

32 lines
1.5 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.shouldCellShowRightBorder = exports.shouldCellShowLeftBorder = void 0;
var _constants = require("../internals/constants");
const shouldCellShowRightBorder = (pinnedPosition, indexInSection, sectionLength, showCellVerticalBorderRootProp, gridHasFiller, pinnedColumnsSectionSeparatorRootProp) => {
const isSectionLastCell = indexInSection === sectionLength - 1;
if (pinnedColumnsSectionSeparatorRootProp?.startsWith('border') && pinnedPosition === _constants.PinnedColumnPosition.LEFT && isSectionLastCell) {
return true;
}
if (showCellVerticalBorderRootProp) {
if (pinnedPosition === _constants.PinnedColumnPosition.LEFT) {
return true;
}
if (pinnedPosition === _constants.PinnedColumnPosition.RIGHT) {
return !isSectionLastCell;
}
// pinnedPosition === undefined, middle section
return !isSectionLastCell || gridHasFiller;
}
return false;
};
exports.shouldCellShowRightBorder = shouldCellShowRightBorder;
const shouldCellShowLeftBorder = (pinnedPosition, indexInSection, showCellVerticalBorderRootProp, pinnedColumnsSectionSeparatorRootProp) => {
if (pinnedColumnsSectionSeparatorRootProp?.startsWith('border')) {
return pinnedPosition === _constants.PinnedColumnPosition.RIGHT && indexInSection === 0;
}
return showCellVerticalBorderRootProp && pinnedPosition === _constants.PinnedColumnPosition.RIGHT && indexInSection === 0;
};
exports.shouldCellShowLeftBorder = shouldCellShowLeftBorder;