reactaform 1.9.0 → 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.
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ interface DescriptionProps {
3
+ field: {
4
+ displayText?: string;
5
+ textAlign?: "left" | "center" | "right";
6
+ allowHtml?: boolean;
7
+ };
8
+ }
9
+ declare const _default: React.NamedExoticComponent<DescriptionProps>;
10
+ export default _default;
@@ -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 timing mode ('realTime' or 'onSubmission')
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='realTime'] - Validation timing mode
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
  */
@@ -1,4 +1,4 @@
1
- import type { ReactNode, CSSProperties } from 'react';
1
+ import type { ReactNode } from 'react';
2
2
  type Integer = number;
3
3
  type Float = number;
4
4
  export type FieldValueType = boolean | Integer | Float | string | Integer[] | Float[] | string[] | [number, string] | File | File[];
@@ -48,8 +48,8 @@ export interface DefinitionPropertyField {
48
48
  multiple?: boolean;
49
49
  allowRelative?: boolean;
50
50
  action?: string;
51
- buttonClassName?: string;
52
- buttonStyle?: CSSProperties;
51
+ displayText?: string;
52
+ textAlign?: 'left' | 'center' | 'right';
53
53
  }
54
54
  export interface ReactaDefinition {
55
55
  name: string;
@@ -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
- export type FieldValidationMode = 'realTime' | 'onSubmission';
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?: FieldValidationMode;
108
- displayInstanceName?: boolean;
111
+ fieldValidationMode: FieldValidationMode;
112
+ displayInstanceName: boolean;
109
113
  };
110
114
  export type ReactaFormProviderProps = {
111
115
  children: ReactNode;