import { h } from "@stencil/core";
import { TableClasses } from '../table.utils';
import { Td } from '../cell/td';
import { Tr } from '../fn-html/tr';
import { concatClasses } from '../../../utils/utils';
import { ColumnRenderer } from '../column/column.renderer';
export const Row = ({ columns, offsets, pinBoundaries, renderer, row, rowIndex, cellRenderers }, children) => [
    h(Tr, { classList: TableClasses.row }, columns.map((column, columnIndex) => {
        const props = {
            classList: concatClasses(ColumnRenderer.columnCellClasses(column), ColumnRenderer.pinnedBorderClass(columnIndex, pinBoundaries)),
            column,
            columnIndex,
            offset: offsets[columnIndex],
            renderer,
            row,
            rowIndex
        };
        return column.internal ? h(Td, Object.assign({}, props)) : cellRenderers.find(r => r.when(column, rowIndex, columnIndex)).cell(props);
    })),
    children
];
