).getItemMetadata?.(row);
if (itemMetadata && itemMetadata.cssClasses) {
rowCss += " " + itemMetadata.cssClasses;
}
const rowTag = ``;
sbCenter.push(rowTag);
if (frozenPinned.pinnedStartLast >= 0) {
sbStart.push(rowTag);
}
if (frozenPinned.pinnedEndFirst != Infinity) {
sbEnd.push(rowTag);
}
let colspan: number | "*", col: Column;
for (let cell = 0, colCount = cols.length; cell < colCount; cell++) {
let colMetadata: ColumnMetadata = null;
col = cols[cell];
colspan = 1;
if (itemMetadata && itemMetadata.columns) {
colMetadata = itemMetadata.columns[col.id] || itemMetadata.columns[cell];
colspan = (colMetadata && colMetadata.colspan) || 1;
if (colspan === "*") {
colspan = colCount - cell;
}
}
const pinnedStart = cell <= pinnedStartLast;
const pinnedEnd = cell >= pinnedEndFirst;
// Do not render cells outside of the viewport.
if (pinnedStart || pinnedEnd || colRight[Math.min(colCount - 1, cell + colspan - 1)] > range.leftPx) {
if (!(pinnedStart || pinnedEnd) && colLeft[cell] > range.rightPx) {
// All columns to the right are outside the range.
if (pinnedEndFirst != Infinity)
break;
cell = pinnedEndFirst - 1;
continue;
}
const cellArgs = args as unknown as CellRenderArgs;
cellArgs.cell = cell;
cellArgs.colspan = colspan;
cellArgs.colMetadata = colMetadata;
cellArgs.sb = pinnedStart ? sbStart : pinnedEnd ? sbEnd : sbCenter;
renderCell(cellArgs);
}
if (colspan > 1) {
cell += (colspan - 1);
}
}
sbCenter.push("
");
if (pinnedStartLast >= 0) {
sbStart.push("");
}
if (pinnedEndFirst != Infinity) {
sbEnd.push("");
}
}