@micromerce/formbuilder-react 1.0.989 → 1.0.990

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.
package/README.md CHANGED
@@ -30,6 +30,12 @@ Then run `npm rum watch` to start the formbuilder-react (and changes are automat
30
30
  The other service should now have access to the local lib.<br>
31
31
  Warning `...is not a module.` will be displayed, but can be ignored.
32
32
 
33
+ ## Validation
34
+
35
+ The form checks itself on submit and shows the error below every invalid field. The browser's
36
+ own check (its "Please fill out this field" bubble) is off (`noValidate`); turn it on with
37
+ `<FormBuilder config={config} browserValidation />`.
38
+
33
39
  ## Styling from outside
34
40
 
35
41
  The formbuilder is styled through CSS custom properties (`--fb-*`, "fb" for formbuilder). Their
@@ -21,10 +21,12 @@ export interface IProps {
21
21
  onChange?: (fieldId: string, value: string | string[]) => void;
22
22
  themePreset?: FormBuilderThemePreset;
23
23
  theme?: FormBuilderTheme;
24
+ browserValidation?: boolean;
24
25
  }
25
- declare const FormBuilder: ({ config, controlProps, customControls, fileUploaderConfig, iconType, state, resolveUrl, onSubmit, onValidationFail, postGenAiMessage, onChange, themePreset, theme, }: IProps) => React.JSX.Element | undefined;
26
+ declare const FormBuilder: ({ config, controlProps, customControls, fileUploaderConfig, iconType, state, resolveUrl, onSubmit, onValidationFail, postGenAiMessage, onChange, themePreset, theme, browserValidation, }: IProps) => React.JSX.Element | undefined;
26
27
  interface FormProps {
27
28
  method: string;
29
+ browserValidation?: boolean;
28
30
  formSubmitted: boolean;
29
31
  state?: FormState | "";
30
32
  error?: string;