Fixed UI misalignments

This commit is contained in:
2026-10-26 19:57:32 +02:00
parent 80c798e5e6
commit 9f132eeb29
22 changed files with 860 additions and 214 deletions
@@ -146,6 +146,10 @@ export async function exportToSpreadsheet<T>(options: ExportOptions<T>): Promise
} else {
formatted = rawVal ?? '';
}
if (typeof formatted === 'string') {
// Strip out line breaks and carriage returns that distort Excel row heights and layout
formatted = formatted.replace(/\r\n|\r|\n/g, ' ').replace(/\s{2,}/g, ' ').trim();
}
rowObj[col.header] = formatted;
});
return rowObj;
@@ -166,9 +170,10 @@ export async function exportToSpreadsheet<T>(options: ExportOptions<T>): Promise
} else {
formatted = String(rawVal ?? '');
}
formatted = formatted.replace(/\r\n|\r|\n/g, ' ').replace(/\s{2,}/g, ' ').trim();
return Math.max(max, formatted.length);
}, headerLen);
return { wch: Math.min(Math.max(maxDataLen + 4, 12), 50) };
return { wch: Math.min(Math.max(maxDataLen + 4, 12), 45) };
});
worksheet['!cols'] = colWidths;