(function () { function isFilled(cell) { return cell !== null && cell !== undefined && String(cell).trim() !== ""; } function escapeText(value) { return String(value ?? "") .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } window.WorkbenchExcelPreview = { filledRows(rows) { return rows.filter(row => Array.isArray(row) && row.some(isFilled)); }, render(containerId, headers, rows) { const container = document.getElementById(containerId); if (!container) return; if (!rows || rows.length === 0) { container.innerHTML = '
Keine Excel-Daten geladen.
'; return; } const headerHtml = headers .map(header => `${escapeText(header)}`) .join(""); const bodyHtml = rows .map(row => `${headers.map((_, index) => `${escapeText(row[index])}`).join("")}`) .join(""); container.innerHTML = `
${headerHtml}${bodyHtml}
${rows.length} Zeilen geladen
`; }, rowsToObjects(headers, rows) { return rows.map(row => { const obj = {}; headers.forEach((header, index) => { obj[header] = row[index] || ""; }); return obj; }); } }; })();