@helsenorge/form
Advanced tools
Comparing version 26.3.2 to 26.4.0
@@ -58,2 +58,3 @@ import * as React from 'react'; | ||
validationTestId?: string; | ||
onFieldsNotCorrectlyFilledOut?: () => void; | ||
} | ||
@@ -60,0 +61,0 @@ export interface FormState { |
@@ -17,11 +17,10 @@ import * as React from 'react'; | ||
this.areAllFieldsValid = () => { | ||
for (let i = 0; i < this.state.formComponents.length; i++) { | ||
const child = this.state.formComponents[i]; | ||
for (const child of this.state.formComponents) { | ||
const childToValidate = child && child.getWrappedInstance ? child.getWrappedInstance() : child; | ||
if (childToValidate && childToValidate.props && childToValidate.props.isValid && !childToValidate.props.isValid()) { | ||
const childToValidateIsValid = childToValidate && childToValidate.isValid && !childToValidate.isValid() ? true : false; | ||
const childToValidatePropsIsValid = childToValidate && childToValidate.props && childToValidate.props.isValid && !childToValidate.props.isValid() ? true : false; | ||
if (childToValidateIsValid || childToValidatePropsIsValid) { | ||
this.props.onFieldsNotCorrectlyFilledOut && this.props.onFieldsNotCorrectlyFilledOut(); | ||
return false; | ||
} | ||
else if (childToValidate && childToValidate.isValid && !childToValidate.isValid()) { | ||
return false; | ||
} | ||
} | ||
@@ -28,0 +27,0 @@ return true; |
import * as React from 'react'; | ||
declare type sizes = 'small' | 'medium' | 'large' | 'maxlength'; | ||
type sizes = 'small' | 'medium' | 'large' | 'maxlength'; | ||
interface SafeTextareaExampleState { | ||
@@ -4,0 +4,0 @@ isValid: boolean; |
import * as React from 'react'; | ||
declare type sizes = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge'; | ||
type sizes = 'xSmall' | 'small' | 'medium' | 'large' | 'xLarge'; | ||
interface HTMLMarkup { | ||
@@ -4,0 +4,0 @@ __html: string; |
{ | ||
"name": "@helsenorge/form", | ||
"author": "Helsenorge", | ||
"version": "26.3.2", | ||
"version": "26.4.0", | ||
"main": "./index.js", | ||
@@ -6,0 +6,0 @@ "license": "ISC", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
348528