@colisweb/rescript-toolkit 5.41.0 → 5.41.1
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/package.json +1 -1
- package/src/form/Reform.res +9 -0
package/package.json
CHANGED
package/src/form/Reform.res
CHANGED
|
@@ -81,6 +81,7 @@ module Make = (Config: Config) => {
|
|
|
81
81
|
isDirty: bool,
|
|
82
82
|
isValid: bool,
|
|
83
83
|
setFormState: formState => unit,
|
|
84
|
+
hasValidationErrors: unit => bool,
|
|
84
85
|
}
|
|
85
86
|
|
|
86
87
|
type onSubmitAPI = {
|
|
@@ -527,6 +528,14 @@ module Make = (Config: Config) => {
|
|
|
527
528
|
isDirty: state.formState == Dirty,
|
|
528
529
|
isValid: state.formState == Valid,
|
|
529
530
|
setFormState: formState => send(SetFormState(formState)),
|
|
531
|
+
hasValidationErrors: () => {
|
|
532
|
+
let recordState = ReSchema.validate(~i18n, state.values, schema)
|
|
533
|
+
|
|
534
|
+
switch recordState {
|
|
535
|
+
| Valid => false
|
|
536
|
+
| _ => true
|
|
537
|
+
}
|
|
538
|
+
},
|
|
530
539
|
}
|
|
531
540
|
|
|
532
541
|
interface
|