@@ -29,6 +29,7 @@ import { ExampleDescription } from '@jsonforms/examples';
2929import {
3030 JsonFormsCellRendererRegistryEntry ,
3131 JsonFormsRendererRegistryEntry ,
32+ ValidationMode ,
3233} from '@jsonforms/core' ;
3334import { Tab , Tabs , TabList , TabPanel } from 'react-tabs' ;
3435import Highlight from 'react-highlight' ;
@@ -85,6 +86,9 @@ const App = ({
8586 getProps ( currentExample , cells , renderers )
8687 ) ;
8788 const [ showPanel , setShowPanel ] = useState < boolean > ( true ) ;
89+ const [ validationMode , setValidationMode ] = useState <
90+ ValidationMode | undefined
91+ > ( undefined ) ;
8892 const schemaAsString = useMemo (
8993 ( ) => JSON . stringify ( exampleProps . schema , null , 2 ) ,
9094 [ exampleProps . schema ]
@@ -145,6 +149,28 @@ const App = ({
145149 )
146150 ) }
147151 </ select >
152+ < h4 > Select ValidationMode:</ h4 >
153+ < select
154+ value = { validationMode }
155+ onChange = { ( ev ) =>
156+ setValidationMode (
157+ ev . currentTarget . value as ValidationMode | undefined
158+ )
159+ }
160+ >
161+ < option value = { undefined } label = 'Default' >
162+ Default
163+ </ option >
164+ < option value = 'NoValidation' label = 'NoValidation' >
165+ NoValidation
166+ </ option >
167+ < option value = 'ValidateAndHide' label = 'ValidateAndHide' >
168+ ValidateAndHide
169+ </ option >
170+ < option value = 'ValidateAndShow' label = 'ValidateAndShow' >
171+ ValidateAndShow
172+ </ option >
173+ </ select >
148174 </ div >
149175 < div className = 'toggle-panel' >
150176 < input
@@ -202,6 +228,7 @@ const App = ({
202228 < JsonForms
203229 key = { currentIndex }
204230 { ...exampleProps }
231+ validationMode = { validationMode }
205232 onChange = { ( { data } ) => changeData ( data ) }
206233 />
207234 </ Wrapper >
0 commit comments