@helsenorge/form
Advanced tools
Comparing version 24.1.0 to 24.3.0
@@ -7,2 +7,3 @@ import * as React from 'react'; | ||
checkbox3Checked?: boolean; | ||
checkbox4Checked?: boolean; | ||
fieldsetValid?: boolean; | ||
@@ -48,2 +49,3 @@ formSubmitted?: boolean; | ||
onSubmit: () => void; | ||
toggleCheckbox4: () => void; | ||
onDraft: () => void; | ||
@@ -50,0 +52,0 @@ onCancel: () => void; |
@@ -135,2 +135,7 @@ import * as React from 'react'; | ||
}; | ||
this.toggleCheckbox4 = () => { | ||
this.setState({ | ||
checkbox4Checked: !this.state.checkbox4Checked, | ||
}); | ||
}; | ||
this.onDraft = () => { | ||
@@ -164,2 +169,3 @@ log('form has been saved as draft'); | ||
checkbox3Checked: false, | ||
checkbox4Checked: false, | ||
fieldsetValid: true, | ||
@@ -200,2 +206,3 @@ formSubmitted: false, | ||
return (React.createElement("div", null, | ||
React.createElement("h3", null, 'Ulike form-komponenter'), | ||
React.createElement("p", null, '(!) Form validering fungerer slik at imnput-komponenter wrappes i en <Validation>. De clones ved bruk av ref og berikes av valideringsmetoder. En class ref kan ikke sendes videre til en FunctionComponent. Det er derfor kun Class Components som kan wrappes i <Validation> (ikke FunctionComponent)'), | ||
@@ -233,3 +240,7 @@ React.createElement(CheckBox, { label: "Disabled", onChange: this.handleDisableButtonChange, id: "disabledcheckbox", checked: this.state.disabled }), | ||
React.createElement(Validation, null, | ||
React.createElement(RadioGroup, { id: "formRadioGroupExample", options: radioOptions, legend: "Hvilket alternativ passer best for deg?", onChange: this.handleRadioChange, selected: this.state.radioGroupValue, validator: this.validateRadioGroup, getErrorMessage: this.getRadioGroupErrorMessage, isRequired: true }))))); | ||
React.createElement(RadioGroup, { id: "formRadioGroupExample", options: radioOptions, legend: "Hvilket alternativ passer best for deg?", onChange: this.handleRadioChange, selected: this.state.radioGroupValue, validator: this.validateRadioGroup, getErrorMessage: this.getRadioGroupErrorMessage, isRequired: true }))), | ||
React.createElement("h3", null, 'Form med checkbox og validering'), | ||
React.createElement(Form, { submitButtonType: "display", action: "#", submitButtonText: 'Opprett digitalt donorkort', errorMessage: '', onSubmit: () => log('sendte inn skjema') }, | ||
React.createElement(Validation, null, | ||
React.createElement(CheckBox, { label: 'Jeg ønsker å gi bort mine organer og vev for transplantasjon ved min bortgang', onChange: this.toggleCheckbox4, id: "savebuttoncheckbox", checked: this.state.checkbox4Checked, isRequired: true, isStyleBlue: true, errorMessage: 'Du må krysse av for å gå videre' }))))); | ||
} | ||
@@ -236,0 +247,0 @@ } |
{ | ||
"name": "@helsenorge/form", | ||
"author": "Helsenorge", | ||
"version": "24.1.0", | ||
"version": "24.3.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
349565
3770