Interface: FormViewerProps
Form viewer React component properties.
Properties
actions?
optionalactions?:CustomActions
Custom actions for the form viewer.
componentWrapper?
optionalcomponentWrapper?:ComponentType<any>
The React component that wraps every component in a form. Internal use only.
context?
optionalcontext?:any
The arbitrary context used internally by the form viewer.
disabled?
optionaldisabled?:boolean
If true, the form is disabled.
errors?
optionalerrors?:Record<string,unknown>
The form validation errors.
errorWrapper?
optionalerrorWrapper?:ComponentType<ErrorWrapperProps>
The default error wrapper used when errorType is not specified in the form.
formName?
optionalformName?:string
The form name. Updating the value triggers the FormViewerProps.getForm function.
formOptions?
optionalformOptions?:any
The form options. Used to transfer any options to the FormViewerProps.getForm function. Updating the value triggers the FormViewerProps.getForm function.
formValidators?
optionalformValidators?:FormValidators
The set of functions that validate the form data.
getForm?
optionalgetForm?: (name?,options?) =>Promise<string> |string
Loads the form.
Parameters
name?
string
the form name.
options?
any
the form options.
Returns
Promise<string> | string
the string or Promise with the form.
initialData?
optionalinitialData?:Record<string,unknown>
The initial data of the form.
initialState?
optionalinitialState?:Record<string,unknown>
The initial user-defined state for the form. This object is set into IFormData.state when the form is initialized, this property is reactive.
language?
optionallanguage?:`${string}-${string}`
The language of the form, e.g. 'en-US'.
localizationEngine?
optionallocalizationEngine?:ILocalizationEngine
The localization engine used by the viewer.
localize?
optionallocalize?:ComponentLocalizer
The function to localize the properties of a component.
onFormDataChange?
optionalonFormDataChange?: (data) =>void
The event is called whenever a form data changes.
Parameters
data
the IFormData with all the form data.
Returns
void
readOnly?
optionalreadOnly?:boolean
If true, the form is read-only.
showAllValidationErrors?
optionalshowAllValidationErrors?:boolean
If true, all validation errors will be displayed.
userContext?
optionaluserContext?:unknown
The arbitrary context object passed to the form viewer. It is forwarded to custom actions as the third argument of the handler.
validators?
optionalvalidators?:Partial<Record<keyofSchemaTypeMap,CustomValidationRules>>
The set of metadata of validation rules, grouped by the type of value being validated.
view
view:
IView
All the metadata of the components of the form viewer.
viewerRef?
optionalviewerRef?:ForwardedRef<IFormViewer>
The reference to IFormViewer.
viewMode?
optionalviewMode?:ViewMode
Display resolution type.