import { toTitleCase } from '../../utilities/input/StringUtilities';
const defaultGridColumn = {
    headerName: '',
    field: '',
    minWidth: 80,
    autoHeight: false,
    sortable: true
};
export const VirtualTableColumnDefs = (tableDescription, actionList, columnName = 'Actions', crudTableActionRenderName = 'actionsRenderer', panelDirection = 'right') => {
    let columnDefs = (tableDescription === null || tableDescription === void 0 ? void 0 : tableDescription.reduce((defs, element) => {
        defs.push(Object.assign(Object.assign({}, defaultGridColumn), { headerName: toTitleCase((element === null || element === void 0 ? void 0 : element.name) || ''), field: element === null || element === void 0 ? void 0 : element.name }));
        return defs;
    }, [])) || [];
    columnDefs.push({
        headerName: crudTableActionRenderName === 'actionsRenderer' ? 'Actions' : columnName,
        filter: false,
        pinned: panelDirection,
        width: 150,
        maxWidth: 180,
        cellRenderer: crudTableActionRenderName,
        cellRendererParams: {
            actionList
        },
        valueGetter: (params) => params.data,
        suppressMenu: true,
        sortable: false,
        cellStyle: { display: 'flex', alignItems: 'center' }
    });
    return columnDefs;
};
export const defaultColActionsDef = {
    resizable: true,
    editable: false,
    sortable: true,
    filter: true,
    floatingFilter: false,
    enableRowGroup: true
};
//# sourceMappingURL=VirtualTableColumnDefs.js.map