Sortieren und Filtern wie in Excel in jeder Tabelle, Ansichten je Benutzer (0.13.0)
Some checks failed
Prüfung / tests (push) Has been cancelled
Prüfung / container (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-20 07:47:06 +00:00
parent d5f861318b
commit 6d0c5f238b
19 changed files with 966 additions and 157 deletions

View File

@@ -186,17 +186,6 @@ export async function bearbeiten(pfad: string, titel: string, felder: Feld[], ze
/** Hinweis, der nach dem nächsten Neuaufbau der Seite oben steht */
export const hinweis = { text: "" };
export function tabelle(spalten: { titel: string; wert: (z: Zeile) => string; klasse?: string }[], zeilen: Zeile[], klick?: (z: Zeile) => void): HTMLTableElement {
const t = document.createElement("table");
t.innerHTML = `<thead><tr>${spalten.map((s) => `<th class="${s.klasse ?? ""}">${esc(s.titel)}</th>`).join("")}</tr></thead>
<tbody>${zeilen.map((z, i) => `<tr data-i="${i}" class="${klick ? "klickbar" : ""}">${spalten.map((s) => `<td class="${s.klasse ?? ""}">${s.wert(z)}</td>`).join("")}</tr>`).join("")}</tbody>`;
if (klick) t.addEventListener("click", (ev) => {
const tr = (ev.target as HTMLElement).closest("tr[data-i]") as HTMLElement | null;
if (tr) klick(zeilen[Number(tr.dataset.i)]!);
});
return t;
}
// Kopf wie bei Plancraft: Titel links, Hauptknopf rechts; darunter eine Leiste für Filter
export function seite(titel: string, knopf?: { text: string; aktion: () => void }): HTMLElement {
inhalt.innerHTML = `<div class="kopf"><h1>${esc(titel)}</h1></div>${hinweis.text ? `<div class="warnung">${esc(hinweis.text)}</div>` : ""}`;