[95] Fenster/Türen: Schiebe-, Hebeschiebe-, Pendeltür, Oberlicht-Einteilung, Typen-Bibliothek
Türtyp kind hebeschiebe/pendel neu, schiebe wird gezeichnet (Grundriss nach SIA, Schnitt, Ansicht, 3D, IFC-OperationType). Tür-Oberlicht in der Ansicht. Fenster transomSashes (Pfosten/Riegel im Oberlicht) in Ansicht und 3D. Vorlagen in opening_presets.rs, in den Ressourcen-Tabs über „Aus Bibliothek…“.
This commit is contained in:
27 files changed
+874
-124
No files matched your search
@@ -582,6 +582,8 @@ export const de = {
|
||||
"oed.cornerJoin.horizontal": "Riegel durchlaufend",
|
||||
"oed.cornerJoin.gehrung": "Gehrung",
|
||||
"oed.f.transomHeight": "Oberlichthöhe (m)",
|
||||
"oed.f.transomFields": "Oberlicht-Felder",
|
||||
"oed.f.transomOpening": "Oberlicht-Öffnung",
|
||||
"oed.f.mullionRows": "Kämpfer-/Sprossenzeilen",
|
||||
"oed.f.mullionCols": "Sprossen-Spalten",
|
||||
"oed.f.sillLineFaces": "Auf-/Untersicht-Linie",
|
||||
@@ -628,6 +630,8 @@ export const de = {
|
||||
"oed.door.kassette": "Kassette",
|
||||
"oed.door.glas": "Glas",
|
||||
"oed.door.wandoeffnung": "Wandöffnung",
|
||||
"oed.door.hebeschiebe": "Hebeschiebetür",
|
||||
"oed.door.pendel": "Pendeltür",
|
||||
"objinfo.stair.type": "Typ",
|
||||
"objinfo.type.none": "(kein Typ)",
|
||||
"objinfo.opening.kind": "Art",
|
||||
@@ -1012,6 +1016,21 @@ export const de = {
|
||||
"Wiederverwendbare Fenstertypen mit Öffnungsart, Verglasung und Standardmaßen für neu platzierte Fenster.",
|
||||
"resources.windowTypes.empty": "Noch keine Fenstertypen.",
|
||||
"resources.windowTypes.placeholder": "Fenstertyp",
|
||||
"resources.addPreset": "Aus Bibliothek…",
|
||||
"resources.addPreset.hint": "Übliche Bauart als Vorlage übernehmen",
|
||||
"preset.fe-dk-1": "Dreh-Kipp 1-flügelig",
|
||||
"preset.fe-dk-2": "Dreh-Kipp 2-flügelig (Stulp)",
|
||||
"preset.fe-fest": "Festverglasung",
|
||||
"preset.fe-oberlicht": "Dreh-Kipp mit Kipp-Oberlicht",
|
||||
"preset.fe-pfosten-riegel": "Pfosten-Riegel 3-teilig",
|
||||
"preset.fe-schiebe": "Schiebefenster 2-teilig",
|
||||
"preset.tu-zimmer": "Zimmertür (Zarge)",
|
||||
"preset.tu-zimmer-2": "Zimmertür 2-flügelig",
|
||||
"preset.tu-schiebe": "Schiebetür vor der Wand",
|
||||
"preset.tu-hebeschiebe": "Hebeschiebetür",
|
||||
"preset.tu-pendel": "Pendeltür",
|
||||
"preset.tu-haus": "Haustür mit Oberlicht",
|
||||
"preset.tu-wand": "Wandöffnung",
|
||||
"resources.stairTypes.hint":
|
||||
"Wiederverwendbare Treppentypen mit Tragart, Stufenausbildung und Geländer für neu platzierte Treppen.",
|
||||
"resources.stairTypes.empty": "Noch keine Treppentypen.",
|
||||
@@ -1058,6 +1077,8 @@ export const de = {
|
||||
|
||||
"resources.doorKind.dreh": "Drehflügel",
|
||||
"resources.doorKind.schiebe": "Schiebe",
|
||||
"resources.doorKind.hebeschiebe": "Hebeschiebe",
|
||||
"resources.doorKind.pendel": "Pendel",
|
||||
"resources.doorKind.wandoeffnung": "Wandöffnung",
|
||||
"resources.leafCount.1": "1-flügelig",
|
||||
"resources.leafCount.2": "2-flügelig",
|
||||
|
||||
@@ -581,6 +581,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"oed.cornerJoin.horizontal": "Rails through",
|
||||
"oed.cornerJoin.gehrung": "Mitre",
|
||||
"oed.f.transomHeight": "Transom height (m)",
|
||||
"oed.f.transomFields": "Transom fields",
|
||||
"oed.f.transomOpening": "Transom opening",
|
||||
"oed.f.mullionRows": "Transom/muntin rows",
|
||||
"oed.f.mullionCols": "Muntin columns",
|
||||
"oed.f.sillLineFaces": "Top-/bottom-view line",
|
||||
@@ -627,6 +629,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
"oed.door.kassette": "Panelled",
|
||||
"oed.door.glas": "Glass",
|
||||
"oed.door.wandoeffnung": "Wall opening",
|
||||
"oed.door.hebeschiebe": "Lift-and-slide door",
|
||||
"oed.door.pendel": "Swing door (double-acting)",
|
||||
"objinfo.stair.type": "Type",
|
||||
"objinfo.type.none": "(no type)",
|
||||
"objinfo.opening.kind": "Type",
|
||||
@@ -1006,6 +1010,21 @@ export const en: Record<TranslationKey, string> = {
|
||||
"Reusable window types with opening style, glazing and default dimensions for newly placed windows.",
|
||||
"resources.windowTypes.empty": "No window types yet.",
|
||||
"resources.windowTypes.placeholder": "Window type",
|
||||
"resources.addPreset": "From library…",
|
||||
"resources.addPreset.hint": "Add a common construction as a template",
|
||||
"preset.fe-dk-1": "Tilt-and-turn, single sash",
|
||||
"preset.fe-dk-2": "Tilt-and-turn, double sash",
|
||||
"preset.fe-fest": "Fixed glazing",
|
||||
"preset.fe-oberlicht": "Tilt-and-turn with tilting transom",
|
||||
"preset.fe-pfosten-riegel": "Mullion-transom, 3 bays",
|
||||
"preset.fe-schiebe": "Sliding window, 2 parts",
|
||||
"preset.tu-zimmer": "Interior door (frame)",
|
||||
"preset.tu-zimmer-2": "Interior door, double leaf",
|
||||
"preset.tu-schiebe": "Surface sliding door",
|
||||
"preset.tu-hebeschiebe": "Lift-and-slide door",
|
||||
"preset.tu-pendel": "Double-acting swing door",
|
||||
"preset.tu-haus": "Entrance door with transom",
|
||||
"preset.tu-wand": "Wall opening",
|
||||
"resources.stairTypes.hint":
|
||||
"Reusable stair types with structure, tread style and railing for newly placed stairs.",
|
||||
"resources.stairTypes.empty": "No stair types yet.",
|
||||
@@ -1052,6 +1071,8 @@ export const en: Record<TranslationKey, string> = {
|
||||
|
||||
"resources.doorKind.dreh": "Hinged",
|
||||
"resources.doorKind.schiebe": "Sliding",
|
||||
"resources.doorKind.hebeschiebe": "Lift-and-slide",
|
||||
"resources.doorKind.pendel": "Double-acting",
|
||||
"resources.doorKind.wandoeffnung": "Wall opening",
|
||||
"resources.leafCount.1": "Single-leaf",
|
||||
"resources.leafCount.2": "Double-leaf",
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { instantiatePreset, openingTypePresets } from "./openingPresets";
|
||||
import { de } from "../i18n/de";
|
||||
import { en } from "../i18n/en";
|
||||
|
||||
describe("openingTypePresets ([95])", () => {
|
||||
it("liefert Fenster- und Türvorlagen mit übersetzten Namen", () => {
|
||||
const { windowTypes, doorTypes } = openingTypePresets();
|
||||
expect(windowTypes.length).toBeGreaterThanOrEqual(5);
|
||||
expect(doorTypes.map((d) => d.kind)).toEqual(expect.arrayContaining(["schiebe", "hebeschiebe", "pendel"]));
|
||||
for (const t of [...windowTypes, ...doorTypes]) {
|
||||
expect((de as Record<string, string>)[`preset.${t.id}`]).toBeTruthy();
|
||||
expect((en as Record<string, string>)[`preset.${t.id}`]).toBeTruthy();
|
||||
}
|
||||
expect(windowTypes.some((w) => (w.transomSashes ?? []).length > 1)).toBe(true);
|
||||
});
|
||||
|
||||
it("instantiatePreset kopiert tief und setzt id/Name", () => {
|
||||
const w = openingTypePresets().windowTypes.find((t) => t.sashes)!;
|
||||
const c = instantiatePreset(w, "ft-neu", "Neu");
|
||||
expect(c.id).toBe("ft-neu");
|
||||
expect(c.name).toBe("Neu");
|
||||
c.sashes![0].opening = "fest";
|
||||
expect(w.sashes![0].opening).not.toBe("fest");
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,31 @@
|
||||
// Fenster-/Türtyp-Bibliothek ([95]) — dünne Fassade über die Vorlagen des Rust-Kerns
|
||||
// (`src-tauri/core/src/opening_presets.rs`). Die Vorlagen kommen ohne Projekt-ids; wer eine
|
||||
// übernimmt, vergibt eine neue id (`instantiatePreset`).
|
||||
|
||||
import { core } from "../engine/coreWasm";
|
||||
import type { DoorType, WindowType } from "./types";
|
||||
|
||||
export interface OpeningTypePresets {
|
||||
windowTypes: WindowType[];
|
||||
doorTypes: DoorType[];
|
||||
}
|
||||
|
||||
let cache: OpeningTypePresets | null = null;
|
||||
|
||||
/** Alle Vorlagen (einmal aus dem Kern gelesen). `id` ist die stabile Vorlagen-id (i18n `preset.<id>`). */
|
||||
export function openingTypePresets(): OpeningTypePresets {
|
||||
if (!cache) {
|
||||
try {
|
||||
const parsed = JSON.parse(core().opening_type_presets_json()) as Partial<OpeningTypePresets>;
|
||||
cache = { windowTypes: parsed.windowTypes ?? [], doorTypes: parsed.doorTypes ?? [] };
|
||||
} catch {
|
||||
cache = { windowTypes: [], doorTypes: [] };
|
||||
}
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
||||
/** Kopie einer Vorlage mit neuer id und Namen (tiefe Kopie, damit Flügellisten nicht geteilt werden). */
|
||||
export function instantiatePreset<T extends { id: string; name: string }>(preset: T, id: string, name: string): T {
|
||||
return { ...(JSON.parse(JSON.stringify(preset)) as T), id, name };
|
||||
}
|
||||
@@ -500,7 +500,7 @@ export type DoorType = {
|
||||
* Bauart: normaler Drehflügel, reine Wandöffnung (kein Blatt/Schwenk),
|
||||
* Schiebetür. Ersetzt/ergänzt das Inline-Feld `Opening.doorType`.
|
||||
*/
|
||||
kind: "dreh" | "schiebe" | "wandoeffnung";
|
||||
kind: "dreh" | "schiebe" | "wandoeffnung" | "hebeschiebe" | "pendel";
|
||||
/** Anzahl Türblätter (1 = einflügelig, 2 = zweiflügelig). */
|
||||
leafCount: 1 | 2;
|
||||
/** Blatt-Ausführung (3D/Detail): glatt, Kassette, Glasfüllung. */
|
||||
@@ -2852,6 +2852,11 @@ export type WindowType = {
|
||||
* (Meter), abgeteilt durch einen Kämpfer. 0/fehlt ⇒ kein Oberlicht.
|
||||
*/
|
||||
transomHeight?: number;
|
||||
/**
|
||||
* Einteilung des Oberlichts über dem Riegel (Pfosten/Riegel, [95]): Felder und Pfosten wie
|
||||
* {@link sashes}, je Feld fest oder öffenbar (meist Kipp). Fehlt ⇒ ein festes Feld (bisher).
|
||||
*/
|
||||
transomSashes?: Array<SashDef>;
|
||||
/**
|
||||
* Auf-/Untersicht-Andeutung im Grundriss (mittel/fein): eine Referenzlinie an
|
||||
* der gewählten Fläche(n) — sinnvoll, wenn die Öffnung die Schnittebene NICHT
|
||||
|
||||
@@ -13,6 +13,7 @@ import { addItems, fieldOps, patchItem, removeItems } from "../core";
|
||||
import type { CoreOp } from "../core";
|
||||
import { t } from "../i18n";
|
||||
import { uniqueId } from "../tools/types";
|
||||
import { instantiatePreset } from "../model/openingPresets";
|
||||
import type {
|
||||
CeilingType,
|
||||
ContextObject,
|
||||
@@ -208,8 +209,10 @@ export function useProjectActions(
|
||||
// (kein eigener Slice). Löschen ist geschützt, solange ein Element den Typ
|
||||
// per `typeId` referenziert. Defaults orientieren sich an den Element-Inline-
|
||||
// Werten (Tür 0.9×2.0, Fenster 1.2×1.4 Brüstung 0.9).
|
||||
const addDoorType = () =>
|
||||
const addDoorType = (preset?: DoorType) =>
|
||||
applyChange(() => {
|
||||
// Aus der Typen-Bibliothek ([95]): Kopie der Vorlage mit neuer id.
|
||||
if (preset) return addItems("doorTypes", [instantiatePreset(preset, uniqueId("dt"), preset.name)]);
|
||||
const dt: DoorType = {
|
||||
id: uniqueId("dt"),
|
||||
name: t("default.doorTypeName"),
|
||||
@@ -234,8 +237,9 @@ export function useProjectActions(
|
||||
}
|
||||
return removeItems(p, "doorTypes", [id]);
|
||||
});
|
||||
const addWindowType = () =>
|
||||
const addWindowType = (preset?: WindowType) =>
|
||||
applyChange(() => {
|
||||
if (preset) return addItems("windowTypes", [instantiatePreset(preset, uniqueId("ft"), preset.name)]);
|
||||
const wt: WindowType = {
|
||||
id: uniqueId("ft"),
|
||||
name: t("default.windowTypeName"),
|
||||
|
||||
@@ -291,6 +291,8 @@ const DOOR_KIND_OPTS = (): { value: DoorKind; label: string }[] => [
|
||||
{ value: "dreh", label: t("oed.kind.dreh") },
|
||||
{ value: "schiebe", label: t("oed.kind.schiebe") },
|
||||
{ value: "wandoeffnung", label: t("oed.door.wandoeffnung") },
|
||||
{ value: "hebeschiebe", label: t("oed.door.hebeschiebe") },
|
||||
{ value: "pendel", label: t("oed.door.pendel") },
|
||||
];
|
||||
|
||||
function BasisPanel({
|
||||
@@ -557,6 +559,23 @@ function cornerJoinOptions(): { value: FrameCornerJoin; label: string }[] {
|
||||
];
|
||||
}
|
||||
|
||||
/** Oberlicht-Einteilung ([95]): Anzahl Felder und Öffnungsart des ersten Felds. */
|
||||
function transomFields(wt: WindowType): { count: number; opening: OpeningKind } {
|
||||
const fields = (wt.transomSashes ?? []).filter((s) => s.kind === "fluegel");
|
||||
return { count: Math.max(1, fields.length), opening: fields[0]?.opening ?? "fest" };
|
||||
}
|
||||
|
||||
/** Gleichmässige Oberlicht-Einteilung: `count` Felder, dazwischen Pfosten; ein festes Feld = keine Liste. */
|
||||
function transomSashes(count: number, opening: OpeningKind): SashDef[] | undefined {
|
||||
if (count <= 1 && opening === "fest") return undefined;
|
||||
const out: SashDef[] = [];
|
||||
for (let i = 0; i < count; i++) {
|
||||
if (i > 0) out.push({ kind: "pfosten", postWidth: 0.06 });
|
||||
out.push({ kind: "fluegel", autoWidth: true, opening, hingeSide: i % 2 === 0 ? "left" : "right" });
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/** Flügeleinteilung: Tabelle mit Flügel/Pfosten, Öffnungsart + Anschlag je Zeile. */
|
||||
function FluegelPanel({
|
||||
wt,
|
||||
@@ -589,6 +608,27 @@ function FluegelPanel({
|
||||
min={0}
|
||||
onCommit={(n) => patchWt({ transomHeight: n || undefined })}
|
||||
/>
|
||||
{(wt.transomHeight ?? 0) > 0 && (
|
||||
<>
|
||||
<NumField
|
||||
label={t("oed.f.transomFields")}
|
||||
value={transomFields(wt).count}
|
||||
step={1}
|
||||
min={1}
|
||||
onCommit={(n) => patchWt({ transomSashes: transomSashes(Math.max(1, Math.min(6, Math.round(n))), transomFields(wt).opening) })}
|
||||
/>
|
||||
<SelField<OpeningKind>
|
||||
label={t("oed.f.transomOpening")}
|
||||
value={transomFields(wt).opening}
|
||||
options={[
|
||||
{ value: "fest", label: t("oed.kind.fest") },
|
||||
{ value: "kipp", label: t("oed.kind.kipp") },
|
||||
{ value: "dreh", label: t("oed.kind.dreh") },
|
||||
]}
|
||||
onChange={(v) => patchWt({ transomSashes: transomSashes(transomFields(wt).count, v) })}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
<NumField
|
||||
label={t("oed.f.mullionRows")}
|
||||
value={wt.mullionRows ?? 1}
|
||||
|
||||
@@ -126,10 +126,10 @@ export interface ResourceManagerHandlers {
|
||||
* Deckentypen. Optional, damit ältere Einbettungen ohne diesen Handler
|
||||
* weiter kompilieren; ohne Handler bleiben die Tabs verborgen.
|
||||
*/
|
||||
onAddDoorType?: () => void;
|
||||
onAddDoorType?: (preset?: DoorType) => void;
|
||||
onPatchDoorType?: (id: string, patch: Partial<DoorType>) => void;
|
||||
onDeleteDoorType?: (id: string) => void;
|
||||
onAddWindowType?: () => void;
|
||||
onAddWindowType?: (preset?: WindowType) => void;
|
||||
onPatchWindowType?: (id: string, patch: Partial<WindowType>) => void;
|
||||
onDeleteWindowType?: (id: string) => void;
|
||||
onAddStairType?: () => void;
|
||||
|
||||
@@ -6,6 +6,7 @@ import { t } from "../../i18n";
|
||||
import { FieldRow, NumberField, Segmented, SelectField } from "./fields";
|
||||
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
|
||||
import { ElevationPreview } from "../ElevationPreview";
|
||||
import { openingTypePresets } from "../../model/openingPresets";
|
||||
|
||||
/**
|
||||
* Synthetische Öffnungs-Instanz NUR für die Vorschau — s. WindowStylesTab.
|
||||
@@ -30,6 +31,8 @@ const DOOR_KIND_OPTIONS: { value: DoorType["kind"]; labelKey: string }[] = [
|
||||
{ value: "dreh", labelKey: "resources.doorKind.dreh" },
|
||||
{ value: "schiebe", labelKey: "resources.doorKind.schiebe" },
|
||||
{ value: "wandoeffnung", labelKey: "resources.doorKind.wandoeffnung" },
|
||||
{ value: "hebeschiebe", labelKey: "resources.doorKind.hebeschiebe" },
|
||||
{ value: "pendel", labelKey: "resources.doorKind.pendel" },
|
||||
];
|
||||
|
||||
const DOOR_LEAF_STYLE_OPTIONS: { value: DoorType["leafStyle"]; labelKey: string }[] = [
|
||||
@@ -50,7 +53,7 @@ export function DoorStylesTab({
|
||||
onDeleteDoorType,
|
||||
}: {
|
||||
project: Project;
|
||||
onAddDoorType?: () => void;
|
||||
onAddDoorType?: (preset?: DoorType) => void;
|
||||
onPatchDoorType?: (id: string, patch: Partial<DoorType>) => void;
|
||||
onDeleteDoorType?: (id: string) => void;
|
||||
}) {
|
||||
@@ -61,7 +64,12 @@ export function DoorStylesTab({
|
||||
emptyKey="resources.doorTypes.empty"
|
||||
placeholderKey="resources.doorTypes.placeholder"
|
||||
deleteKeyPrefix="resources.delete.doorType"
|
||||
onAdd={onAddDoorType}
|
||||
onAdd={() => onAddDoorType?.()}
|
||||
presets={openingTypePresets().doorTypes.map((p) => ({ id: p.id, label: t(`preset.${p.id}`) }))}
|
||||
onAddPreset={(id) => {
|
||||
const p = openingTypePresets().doorTypes.find((x) => x.id === id);
|
||||
if (p) onAddDoorType?.({ ...p, name: t(`preset.${p.id}`) });
|
||||
}}
|
||||
onPatch={onPatchDoorType}
|
||||
onDelete={onDeleteDoorType}
|
||||
renderFields={(door, patch) => (
|
||||
|
||||
@@ -26,6 +26,8 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
|
||||
placeholderKey,
|
||||
deleteKeyPrefix,
|
||||
onAdd,
|
||||
presets,
|
||||
onAddPreset,
|
||||
onPatch,
|
||||
onDelete,
|
||||
renderFields,
|
||||
@@ -36,6 +38,9 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
|
||||
placeholderKey: string;
|
||||
deleteKeyPrefix: string;
|
||||
onAdd?: () => void;
|
||||
/** Vorlagen aus der Typen-Bibliothek ([95]); Auswahl legt eine Kopie an. */
|
||||
presets?: { id: string; label: string }[];
|
||||
onAddPreset?: (presetId: string) => void;
|
||||
onPatch?: (id: string, patch: Partial<T>) => void;
|
||||
onDelete?: (id: string) => void;
|
||||
renderFields: (item: T, onPatch: (patch: Partial<T>) => void) => React.ReactNode;
|
||||
@@ -64,6 +69,21 @@ export function TypeLibraryTab<T extends { id: string; name: string }>({
|
||||
<button className="res-add" onClick={() => onAdd?.()}>
|
||||
<span className="res-add-plus">+</span> {t("resources.add")}
|
||||
</button>
|
||||
{presets && presets.length > 0 && onAddPreset && (
|
||||
<select
|
||||
className="res-input res-add-preset"
|
||||
value=""
|
||||
title={t("resources.addPreset.hint")}
|
||||
onChange={(e) => e.target.value && onAddPreset(e.target.value)}
|
||||
>
|
||||
<option value="">{t("resources.addPreset")}</option>
|
||||
{presets.map((p) => (
|
||||
<option key={p.id} value={p.id}>
|
||||
{p.label}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="res-md-detail">
|
||||
|
||||
@@ -6,6 +6,7 @@ import { t } from "../../i18n";
|
||||
import { FieldRow, NumberField, SelectField } from "./fields";
|
||||
import { INSET_FACE_OPTIONS, TypeLibraryTab } from "./TypeLibraryTab";
|
||||
import { ElevationPreview } from "../ElevationPreview";
|
||||
import { openingTypePresets } from "../../model/openingPresets";
|
||||
|
||||
/**
|
||||
* Synthetische Öffnungs-Instanz NUR für die Vorschau: `ElevationPreview`
|
||||
@@ -56,7 +57,7 @@ export function WindowStylesTab({
|
||||
onDeleteWindowType,
|
||||
}: {
|
||||
project: Project;
|
||||
onAddWindowType?: () => void;
|
||||
onAddWindowType?: (preset?: WindowType) => void;
|
||||
onPatchWindowType?: (id: string, patch: Partial<WindowType>) => void;
|
||||
onDeleteWindowType?: (id: string) => void;
|
||||
}) {
|
||||
@@ -67,7 +68,12 @@ export function WindowStylesTab({
|
||||
emptyKey="resources.windowTypes.empty"
|
||||
placeholderKey="resources.windowTypes.placeholder"
|
||||
deleteKeyPrefix="resources.delete.windowType"
|
||||
onAdd={onAddWindowType}
|
||||
onAdd={() => onAddWindowType?.()}
|
||||
presets={openingTypePresets().windowTypes.map((p) => ({ id: p.id, label: t(`preset.${p.id}`) }))}
|
||||
onAddPreset={(id) => {
|
||||
const p = openingTypePresets().windowTypes.find((x) => x.id === id);
|
||||
if (p) onAddWindowType?.({ ...p, name: t(`preset.${p.id}`) });
|
||||
}}
|
||||
onPatch={onPatchWindowType}
|
||||
onDelete={onDeleteWindowType}
|
||||
renderFields={(win, patch) => (
|
||||
|
||||
Reference in new issue
Block a user