Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function (index, TH) {
TH.removeAttribute('colspan');
removeClass(TH, 'hiddenHeader');
// header row is the index of header row counting from the top (=> positive values)
if (_this.colspanArray[headerRow][index] && _this.colspanArray[headerRow][index].colspan) {
var colspan = _this.colspanArray[headerRow][index].colspan;
var fixedColumnsLeft = _this.hot.getSettings().fixedColumnsLeft || 0;
var topLeftCornerOverlay = _this.hot.view.wt.wtOverlays.topLeftCornerOverlay;
var leftOverlay = _this.hot.view.wt.wtOverlays.leftOverlay;
var isInTopLeftCornerOverlay = topLeftCornerOverlay ? topLeftCornerOverlay.clone.wtTable.THEAD.contains(TH) : false;
var isInLeftOverlay = leftOverlay ? leftOverlay.clone.wtTable.THEAD.contains(TH) : false;
if (colspan > 1) {
TH.setAttribute('colspan', isInTopLeftCornerOverlay || isInLeftOverlay ? Math.min(colspan, fixedColumnsLeft - index) : colspan);
}
if (isInTopLeftCornerOverlay || isInLeftOverlay && index === fixedColumnsLeft - 1) {
addClass(TH, 'overlayEdge');
return function(index, TH) {
TH.removeAttribute('colspan');
removeClass(TH, 'hiddenHeader');
// header row is the index of header row counting from the top (=> positive values)
if (_this.colspanArray[headerRow][index] && _this.colspanArray[headerRow][index].colspan) {
let colspan = _this.colspanArray[headerRow][index].colspan;
let fixedColumnsLeft = _this.hot.getSettings().fixedColumnsLeft || 0;
let topLeftCornerOverlay = _this.hot.view.wt.wtOverlays.topLeftCornerOverlay;
let leftOverlay = _this.hot.view.wt.wtOverlays.leftOverlay;
let isInTopLeftCornerOverlay = topLeftCornerOverlay ? topLeftCornerOverlay.clone.wtTable.THEAD.contains(TH) : false;
let isInLeftOverlay = leftOverlay ? leftOverlay.clone.wtTable.THEAD.contains(TH) : false;
if (colspan > 1) {
TH.setAttribute('colspan', isInTopLeftCornerOverlay || isInLeftOverlay ? Math.min(colspan, fixedColumnsLeft - index) : colspan);
}
if (isInTopLeftCornerOverlay || isInLeftOverlay && index === fixedColumnsLeft - 1) {
addClass(TH, 'overlayEdge');
arrayEach(listTH, function (TH, index, array) {
if (TH === void 0) {
return false;
}
if (!selectionByHeader && level < levelLimit || selectionByHeader && !isInSelection) {
if (hasClass(TH, classHighlight)) {
removeClass(TH, classHighlight);
}
} else if (!hasClass(TH, classHighlight)) {
addClass(TH, classHighlight);
}
});
};
arrayEach(listTH, (TH, index, array) => {
if (TH === void 0) {
return false;
}
if ((!selectionByHeader && level < levelLimit) || (selectionByHeader && !isInSelection)) {
if (hasClass(TH, classHighlight)) {
removeClass(TH, classHighlight);
}
} else if (!hasClass(TH, classHighlight)) {
addClass(TH, classHighlight);
}
});
}
onAfterGetRowHeader(row, th) {
let tr = th.parentNode;
if (tr) {
if (this.isHidden(row)) {
addClass(tr, 'hide');
} else {
removeClass(tr, 'hide');
}
}
let firstSectionHidden = true;
let i = row - 1;
do {
if (!this.isHidden(i)) {
firstSectionHidden = false;
break;
}
i--;
} while (i >= 0);
if (firstSectionHidden) {
addClass(th, 'firstVisibleRow');
value: function onAfterGetColHeader(col, TH) {
var physicalColumn = this.t.toPhysicalColumn(col);
if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) {
addClass(TH, 'htFiltersActive');
} else {
removeClass(TH, 'htFiltersActive');
}
}
onAfterGetColHeader(col, TH) {
const physicalColumn = this.t.toPhysicalColumn(col);
if (this.enabled && this.conditionCollection.hasConditions(physicalColumn)) {
addClass(TH, 'htFiltersActive');
} else {
removeClass(TH, 'htFiltersActive');
}
}
value: function onAfterGetRowHeader(row, th) {
var tr = th.parentNode;
if (tr) {
if (this.isHidden(row)) {
addClass(tr, 'hide');
} else {
removeClass(tr, 'hide');
}
}
var firstSectionHidden = true;
var i = row - 1;
do {
if (!this.isHidden(i)) {
firstSectionHidden = false;
break;
}
i--;
} while (i >= 0);
if (firstSectionHidden) {
addClass(th, 'firstVisibleRow');