import { FormSchema } from "../../../types"; import React from "react"; /** * Props mapping for the GenericForm component. */ interface GenericFormProps { /** * The structural schema definition containing sections and form fields. * If null or undefined, the form renders nothing. */ schema: FormSchema | null | undefined; /** * Indicates if the form submission or data fetching is loading. */ isLoading?: boolean; /** * An optional external error object (e.g. from an API request) to display. */ error?: Error | null; /** * Callback triggered when form values pass validation and are submitted. */ onSubmit: (data: T) => void | Promise; /** * Callback triggered when the cancel button is clicked. */ onCancel?: () => void; /** * Default initial values for the form fields. */ initialData?: T; /** * Disables all interactive fields within the form. */ disabled?: boolean; /** * If true, renders the default form footer actions (Cancel and Submit). * Set this to false when embedding in modals or external layouts. */ renderActions?: boolean; /** * Identifiant posé sur le `
`. Permet à un bouton rendu hors du formulaire * (pied d'une dialog, barre d'actions) de le soumettre via `form=""`. */ id?: string; /** * The default column span (1 to 4) for fields that do not explicitly declare a layout.cols property. * Defaults to 4 (full width). */ defaultCols?: 1 | 2 | 3 | 4; } /** * A highly dynamic, Zod-validated generic form generator. * Builds responsive input layouts automatically based on a structured FormSchema definition. */ export declare const GenericForm: ({ schema, isLoading, error, onSubmit, onCancel, initialData, disabled, renderActions, id, defaultCols, }: GenericFormProps) => React.ReactElement | null; export {}; //# sourceMappingURL=GenericForm.d.ts.map