import { createDomElement, isNumber } from '@slickgrid-universal/utils';
import {} from '../core/index.js';
import { sumTotalsFormatter } from './sumTotalsFormatter.js';
export const sumTotalsColoredFormatter = (totals, columnDef, grid) => {
    const field = columnDef.field ?? '';
    const val = totals.sum?.[field];
    if (isNumber(val)) {
        const color = val >= 0 ? 'green' : 'red';
        const textContent = sumTotalsFormatter(totals, columnDef, grid);
        return createDomElement('span', {
            style: { color },
            textContent,
        });
    }
    return '';
};
//# sourceMappingURL=sumTotalsColoredFormatter.js.map