From 5db8c6135eaf55726e3ef8c0408e6ab9b37801a6 Mon Sep 17 00:00:00 2001 From: Pier-Paolo Mammi Date: Mon, 27 Apr 2026 13:15:08 +0200 Subject: [PATCH] fix form field factory usage for autocomplete fix names Co-authored-by: Copilot --- scelta-carriera/src/App.jsx | 20 ++++--------------- .../IElixFormsComponentProperties.ts | 4 +--- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/scelta-carriera/src/App.jsx b/scelta-carriera/src/App.jsx index e3af9df..beb7d03 100644 --- a/scelta-carriera/src/App.jsx +++ b/scelta-carriera/src/App.jsx @@ -8,13 +8,14 @@ import * as ElixForms from './components/ElixFormsComponent'; function App() { const [count, setCount] = useState(0) - /** @type {import('./components/ElixFormsComponent').ElixFormsReact} */ + /** @type {import('./components/ElixFormsComponent').ElixFormsComponent} */ var myElixFormsReact = new ElixForms.ElixFormsReact(); myElixFormsReact.props = { description: "This is a custom form created with ElixFormsReact component.", isDarkTheme: false, environmentMessage: "TESTING!", + /* additionalFieldsJson: JSON.stringify([ { "key": "COL0002", @@ -82,8 +83,9 @@ function App() { ] } ]), + */ customFormFieldsConfiguration: ( - /** @type {import('./components/IElixFormsComponentProperties').ICustomFormFieldFactory} */ + /** @type {import('./components/IElixFormsComponentCustomFormFieldFactory').IElixFormsComponentCustomFormFieldFactory} */ formFieldFactory ) => ( <> @@ -93,20 +95,6 @@ function App() { ) }; - // myElixFormsReact.addTextInput("name", "Name", true); - // myElixFormsReact.addTextAreaInput("description", "Description"); - // myElixFormsReact.addNumberInput("age", "Age"); - // myElixFormsReact.addDropdownInput("country", "Country", new Map([ - // [1, "Italy"], - // [2, "USA"], - // [3, "UK"] - // ])); - // myElixFormsReact.addCheckboxInput("hobbies", "Hobbies", new Map([ - // [1, "Sports"], - // [2, "Music"], - // [3, "Traveling"] - // ])); - return myElixFormsReact.render(); } diff --git a/scelta-carriera/src/components/IElixFormsComponentProperties.ts b/scelta-carriera/src/components/IElixFormsComponentProperties.ts index 5c7559e..6749ccf 100644 --- a/scelta-carriera/src/components/IElixFormsComponentProperties.ts +++ b/scelta-carriera/src/components/IElixFormsComponentProperties.ts @@ -1,8 +1,6 @@ import { JSX } from "react"; import { IElixFormsComponentCustomFormFieldFactory } from "./IElixFormsComponentCustomFormFieldFactory"; -export type ICustomFormFieldsConfiguration = (formFieldFactory: IElixFormsComponentCustomFormFieldFactory) => JSX.Element; - export interface IElixFormsComponentProperties { description: string; isDarkTheme: boolean; @@ -10,7 +8,7 @@ export interface IElixFormsComponentProperties { hasTeamsContext: boolean; userDisplayName: string; additionalFieldsJson?: string; - customFormFieldsConfiguration?: ICustomFormFieldsConfiguration; + customFormFieldsConfiguration?: (formFieldFactory: IElixFormsComponentCustomFormFieldFactory) => JSX.Element; } // Additional Fields JSON Schema