DataContext.Provider
is the context provider that has to wrap the features if components like DataInput and DataValue is to be used with s common source instead of distributing values and events individually..
Boolean - Checkbox
‌ Send
Code Editor < DataContext.Provider
data = { testdata }
onChange = { ( data ) => console . log ( 'onChange' , data ) }
onPathChange = { ( path , value ) => console . log ( 'onPathChange' , path , value ) }
onSubmit = { ( data ) => console . log ( 'onSubmit' , data ) }
onSubmitRequest = { ( ) => console . log ( 'onSubmitRequest' ) }
>
< Layout.Section >
< Layout.Card >
< Layout.Column divider = " line " spacing = " small " >
< DataInput.String
path = " /requiredString "
label = " Required string "
required
/>
< DataInput.String path = " /hmm " label = " Invalid path " />
< DataInput.String path = " /string " label = " String value " />
< DataInput.String path = " /string " label = " String value (copy) " />
< DataInput.Number path = " /number " label = " Number value " />
< DataInput.String path = " /number " label = " Number with StringInput " />
< DataInput.Boolean
path = " /boolean "
label = " Boolean - Checkbox "
variant = " checkbox "
/>
< DataInput.Boolean
path = " /boolean "
label = " Boolean - Toggle "
variant = " toggle-button "
/>
< div >
< DataInput.String
path = " /nested/nestedText "
label = " Nested text "
/>
< DataInput.Number
path = " /nested/nestedNumber "
label = " Nested number (minimum 50) "
minimum = { 50 }
/>
</ div >
< div className = " hmm " >
< Layout.Row >
< DataInput.String path = " /list/0/itemText " label = " Item text " />
< DataInput.Number
path = " /list/0/itemNumber "
label = " Item number "
/>
</ Layout.Row >
< Layout.Row >
< DataInput.String path = " /list/1/itemText " label = " Item text " />
< DataInput.Number
path = " /list/1/itemNumber "
label = " Item number "
/>
</ Layout.Row >
</ div >
< Layout.ButtonRow >
< DataContext.SubmitButton />
</ Layout.ButtonRow >
</ Layout.Column >
</ Layout.Card >
</ Layout.Section >
</ DataContext.Provider >
Boolean - Checkbox
‌ Send
Code Editor < DataContext.Provider
data = { testdata }
schema = { TestdataSchema }
onChange = { ( data ) => console . log ( 'onChange' , data ) }
onPathChange = { ( path , value ) => console . log ( 'onPathChange' , path , value ) }
onSubmit = { ( data ) => console . log ( 'onSubmit' , data ) }
onSubmitRequest = { ( ) => console . log ( 'onSubmitRequest' ) }
>
< Layout.Section >
< Layout.Card >
< Layout.Column divider = " line " spacing = " small " >
< DataInput.String path = " /requiredString " label = " Required string " />
< DataInput.String path = " /hmm " label = " Invalid path " />
< DataInput.String path = " /string " label = " String value " />
< DataInput.String path = " /string " label = " String value (copy) " />
< DataInput.Number path = " /number " label = " Number value " />
< DataInput.String path = " /number " label = " Number with StringInput " />
< DataInput.Boolean
path = " /boolean "
label = " Boolean - Checkbox "
variant = " checkbox "
/>
< DataInput.Boolean
path = " /boolean "
label = " Boolean - Toggle "
variant = " toggle-button "
/>
< div >
< DataInput.String
path = " /nested/nestedText "
label = " Nested text "
/>
< DataInput.Number
path = " /nested/nestedNumber "
label = " Nested number "
/>
</ div >
< div className = " hmm " >
< Layout.Row >
< DataInput.String path = " /list/0/itemText " label = " Item text " />
< DataInput.Number
path = " /list/0/itemNumber "
label = " Item number "
/>
</ Layout.Row >
< Layout.Row >
< DataInput.String path = " /list/1/itemText " label = " Item text " />
< DataInput.Number
path = " /list/1/itemNumber "
label = " Item number "
/>
</ Layout.Row >
</ div >
< Layout.ButtonRow >
< DataContext.SubmitButton />
</ Layout.ButtonRow >
</ Layout.Column >
</ Layout.Card >
</ Layout.Section >
</ DataContext.Provider >
Property Type Description data
object
(required) Source data.schema
object
(optional) JSON Schema for validation of the data set.scrollTopOnSubmit
boolean
(optional) True for the UI to scroll to the top of the page when data is submitted.children
React.Node
(required) Contents.
Event Description onChange
(optional) Will be called when a value of any input component inside was changed by the user, with the data set (including the changed value) as argument.onPathChange
(optional) Will be called when a value of any input component inside was changed by the user, with the path
(JSON Pointer) and new value
as arguments.onSubmit
(optional) Will be called when the user submit the form (i.e by clicking a SubmitButton component inside), with the data set as argument.onSubmitRequest
(optional) Will be called when the user tries to submit, but errors stop the data from being submitted.