major refactor

rename classes
added props configuration for custom fields

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
2026-04-27 12:42:18 +02:00
co-authored by Copilot
parent 798c5d69f9
commit 58a7ce20a7
10 changed files with 197 additions and 81 deletions
@@ -0,0 +1,23 @@
import React, { JSX } from "react";
// Class to encapsulate the label and input elements
export class ElixFormsElement {
label: JSX.Element;
input: JSX.Element;
separator: string;
constructor(labelElement: React.ReactElement, inputElement: React.ReactElement, separator: string = "")
{
if (!labelElement || !inputElement) {
throw new Error("labelElement and inputElement are required.");
}
this.label = labelElement;
this.input = inputElement;
this.separator = separator;
}
// Optional: render both elements together
render() : JSX.Element {
return (<>{this.label}{this.separator}{this.input}</>);
}
}