reactaform 1.9.1 → 1.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -9,7 +9,7 @@ import type { ReactaFormProps } from "../../core/reactaFormTypes";
|
|
|
9
9
|
* @param {string} [props.className] - Additional CSS class names
|
|
10
10
|
* @param {string} [props.theme] - Theme name ('light' or 'dark')
|
|
11
11
|
* @param {React.CSSProperties} [props.style] - Inline styles
|
|
12
|
-
* @param {FieldValidationMode} [props.fieldValidationMode] - Validation
|
|
12
|
+
* @param {FieldValidationMode} [props.fieldValidationMode] - Field Validation mode ('onEdit' or 'onSubmission' or 'realTime')
|
|
13
13
|
* @param {boolean} [props.displayInstanceName] - Whether to display the instance name
|
|
14
14
|
*/
|
|
15
15
|
declare const ReactaForm: React.FC<ReactaFormProps>;
|
|
@@ -9,7 +9,7 @@ import '../../styles/reactaform.css';
|
|
|
9
9
|
* @param {string} [props.defaultLanguage='en'] - Default language code for translations
|
|
10
10
|
* @param {string} [props.defaultTheme='light'] - Default theme name
|
|
11
11
|
* @param {string} [props.defaultLocalizeName] - Name of custom localization file
|
|
12
|
-
* @param {FieldValidationMode} [props.defaultFieldValidationMode='
|
|
12
|
+
* @param {FieldValidationMode} [props.defaultFieldValidationMode='onEdit'] - Field Validation mode
|
|
13
13
|
* @param {string} [props.className='reactaform-container'] - CSS class name for the container
|
|
14
14
|
* @param {boolean} [props.displayInstanceName] - Whether to display the instance name
|
|
15
15
|
*/
|
|
@@ -79,8 +79,12 @@ export interface ReactaFormProps {
|
|
|
79
79
|
onValidation?: FormValidationHandler;
|
|
80
80
|
}
|
|
81
81
|
export type TranslationFunction = (text: string, ...args: unknown[]) => string;
|
|
82
|
-
/** Validation mode controls where validation is performed.
|
|
83
|
-
|
|
82
|
+
/** Validation mode controls where validation is performed.
|
|
83
|
+
* 'onEdit' (default) - Validate fields as they are edited, showing errors immediately.
|
|
84
|
+
* 'onSubmission' - Validate only when the form is submitted, showing errors after submission attempt.
|
|
85
|
+
* 'realTime' - deprecated, use 'onEdit' instead.
|
|
86
|
+
*/
|
|
87
|
+
export type FieldValidationMode = 'onEdit' | 'onSubmission' | 'realTime';
|
|
84
88
|
export type FieldCustomValidationHandler = (fieldName: string, value: FieldValueType | unknown, t: TranslationFunction) => string | undefined;
|
|
85
89
|
export type FieldTypeValidationHandler = (field: DefinitionPropertyField, input: FieldValueType, t: TranslationFunction) => string | undefined;
|
|
86
90
|
export type FormValidationHandler = (valuesMap: Record<string, FieldValueType | unknown>, t: TranslationFunction) => string[] | Promise<string[] | undefined> | undefined;
|
|
@@ -104,8 +108,8 @@ export type ReactaFormContextType = {
|
|
|
104
108
|
};
|
|
105
109
|
fieldStyle: Record<string, unknown>;
|
|
106
110
|
t: TranslationFunction;
|
|
107
|
-
fieldValidationMode
|
|
108
|
-
displayInstanceName
|
|
111
|
+
fieldValidationMode: FieldValidationMode;
|
|
112
|
+
displayInstanceName: boolean;
|
|
109
113
|
};
|
|
110
114
|
export type ReactaFormProviderProps = {
|
|
111
115
|
children: ReactNode;
|