// Eigenschaften der gewählten Blatt-Tabelle ([111]): Quelle, Spaltenwahl, Schrift/Textstil, Zeilenhöhe, Linien, // Rahmen (Position/Breite/Höhe), Fortsetzung in einem weiteren Rahmen. Reine Eingabe-Hülle: jede Änderung geht als // Teil-Patch an `onPatch` (ein Undo-Schritt je Änderung, gleiche Eingaben fassen sich zusammen). import type { LayoutTable, LayoutTableSource, Project } from "../model/types"; import { t } from "../i18n"; import { tableCatalog, tableSourceLabel, TABLE_SOURCES } from "../core"; import type { TableOut } from "../core"; type Patch = Partial>; function NumberField({ label, value, onChange, min = 0, step = 1, placeholder }: { label: string; value: number | undefined; onChange: (v: number | undefined) => void; min?: number; step?: number; placeholder?: string }) { return ( ); } export function SheetTableHud({ project, table, others, out, onPatch, onRemove, }: { project: Project; table: LayoutTable; /** Die übrigen Tabellen des Blatts (Auswahl der Fortsetzung). */ others: readonly LayoutTable[]; out: TableOut | undefined; onPatch: (patch: Patch) => void; onRemove: () => void; }) { const cat = tableCatalog(project).sources[table.source] ?? []; const selected = table.columns ?? cat.filter((c) => c.default).map((c) => c.id); const toggle = (id: string) => { const next = selected.includes(id) ? selected.filter((x) => x !== id) : cat.map((c) => c.id).filter((x) => x === id || selected.includes(x)); if (next.length > 0) onPatch({ columns: next }); }; const styles = project.textStyles ?? []; const sel = (v: string | undefined) => v ?? ""; return (
{t("sheetTable.title")}
{table.source === "openings" && ( )}
{t("sheetTable.columns")}
{cat.map((c) => ( ))}
onPatch({ fontSizePt: v })} /> onPatch({ rowHeightMm: v })} /> v !== undefined && onPatch({ xMm: v })} /> v !== undefined && onPatch({ yMm: v })} /> v !== undefined && onPatch({ widthMm: v })} /> onPatch({ heightMm: v })} /> {out && out.hidden > 0 && (
{t("sheetTable.hidden", { n: out.hidden })}
)} {out &&
{t("sheetTable.rows", { shown: out.shown, total: out.total })}
}
); }