Ressourcen: Dachtypen-Tab (Schicht-Editor wie Wand/Decke)

Dachaufbauten sind jetzt im Ressourcen-Manager anleg-/editier-/löschbar
(RoofStylesTab auf dem LayeredStylesTab-Rumpf, Ressource roofTypes):
Schichtliste mit Bauteil/Dicke/Fugen-Linienstil, Löschen geschützt solange
ein Dach den Typ referenziert. Host-/App-Handler (patch/add/deleteRoofType)
+ i18n de/en. Vervollständigt die Dach-Schichtlogik (3a986ec) um die UI.
This commit is contained in:
2026-07-10 18:35:34 +02:00
parent b029ce0139
commit 83abc1d87b
6 changed files with 106 additions and 0 deletions
+48
View File
@@ -20,6 +20,7 @@ import { useEffect, useMemo, useRef, useState } from "react";
import type { PointerEvent as ReactPointerEvent } from "react";
import type {
CeilingType,
RoofType,
Component,
ComponentMaterial,
DoorType,
@@ -1893,6 +1894,39 @@ function CeilingStylesTab({
);
}
/**
* Tab „Dachtypen" — das geneigte Gegenstück zu {@link CeilingStylesTab}: gleicher
* {@link LayeredStylesTab}-Rumpf (Schichtaufbau aussen/Eindeckung → innen/
* Verkleidung), Ressource `roofTypes`. Vorschau in Decken-Orientierung
* (gestapelt) — für die Schichtreihenfolge/-dicken ausreichend.
*/
function RoofStylesTab({
project,
onPatchRoofType,
onAddRoofType,
onDeleteRoofType,
}: {
project: Project;
onPatchRoofType: (id: string, patch: Partial<RoofType>) => void;
onAddRoofType: () => void;
onDeleteRoofType: (id: string) => void;
}) {
return (
<LayeredStylesTab
project={project}
types={project.roofTypes ?? []}
orientation="ceiling"
hintKey="resources.roofStyles.hint"
emptyKey="resources.roofStyles.empty"
placeholderKey="resources.roofStyles.placeholder"
deleteKeyPrefix="resources.delete.roofType"
onPatch={onPatchRoofType}
onAdd={onAddRoofType}
onDelete={onDeleteRoofType}
/>
);
}
/**
* Datei-Import-Schaltfläche (verstecktes <input type=file>). Liest die gewählte
* Datei als Text und reicht ihn nach oben. Für .lin/.pat-Import.
@@ -2957,6 +2991,7 @@ export type TabId =
| "lines"
| "wallStyles"
| "ceilingStyles"
| "roofStyles"
| "doorStyles"
| "windowStyles"
| "stairStyles"
@@ -2969,6 +3004,7 @@ const TABS: { id: TabId; labelKey: string }[] = [
{ id: "lines", labelKey: "resources.tab.lines" },
{ id: "wallStyles", labelKey: "resources.tab.wallStyles" },
{ id: "ceilingStyles", labelKey: "resources.tab.ceilingStyles" },
{ id: "roofStyles", labelKey: "resources.tab.roofStyles" },
{ id: "doorStyles", labelKey: "resources.tab.doorStyles" },
{ id: "windowStyles", labelKey: "resources.tab.windowStyles" },
{ id: "stairStyles", labelKey: "resources.tab.stairStyles" },
@@ -2995,6 +3031,10 @@ export interface ResourceManagerHandlers {
onPatchCeilingType: (id: string, patch: Partial<CeilingType>) => void;
onAddCeilingType: () => void;
onDeleteCeilingType: (id: string) => void;
/** Dachtypen (Dachaufbauten): immutable Änderung/Anlage/Löschung. */
onPatchRoofType: (id: string, patch: Partial<RoofType>) => void;
onAddRoofType: () => void;
onDeleteRoofType: (id: string) => void;
/** Import: fügt fertige (id-lose) Linienstile/Schraffuren hinzu (.lin/.pat). */
onImportLineStyles: (styles: Omit<LineStyle, "id">[]) => void;
onImportHatches: (hatches: Omit<HatchStyle, "id">[]) => void;
@@ -3219,6 +3259,14 @@ export function ResourceManager({
onDeleteCeilingType={handlers.onDeleteCeilingType}
/>
)}
{tab === "roofStyles" && (
<RoofStylesTab
project={project}
onPatchRoofType={handlers.onPatchRoofType}
onAddRoofType={handlers.onAddRoofType}
onDeleteRoofType={handlers.onDeleteRoofType}
/>
)}
{tab === "doorStyles" && (
<DoorStylesTab
project={project}