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