Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Interface: FormViewerProps

Form viewer React component properties.

Properties​

actions?​

optional actions?: CustomActions

Custom actions for the form viewer.


componentWrapper?​

optional componentWrapper?: ComponentType<any>

The React component that wraps every component in a form. Internal use only.


context?​

optional context?: any

The arbitrary context used internally by the form viewer.


disabled?​

optional disabled?: boolean

If true, the form is disabled.


errors?​

optional errors?: Record<string, unknown>

The form validation errors.


errorWrapper?​

optional errorWrapper?: ComponentType<ErrorWrapperProps>

The default error wrapper used when errorType is not specified in the form.


formName?​

optional formName?: string

The form name. Updating the value triggers the FormViewerProps.getForm function.


formOptions?​

optional formOptions?: any

The form options. Used to transfer any options to the FormViewerProps.getForm function. Updating the value triggers the FormViewerProps.getForm function.


formValidators?​

optional formValidators?: FormValidators

The set of functions that validate the form data.


getForm?​

optional getForm?: (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?​

optional initialData?: Record<string, unknown>

The initial data of the form.


initialState?​

optional initialState?: 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?​

optional language?: `${string}-${string}`

The language of the form, e.g. 'en-US'.


localizationEngine?​

optional localizationEngine?: ILocalizationEngine

The localization engine used by the viewer.


localize?​

optional localize?: ComponentLocalizer

The function to localize the properties of a component.


onFormDataChange?​

optional onFormDataChange?: (data) => void

The event is called whenever a form data changes.

Parameters​

data​

IFormData

the IFormData with all the form data.

Returns​

void


readOnly?​

optional readOnly?: boolean

If true, the form is read-only.


showAllValidationErrors?​

optional showAllValidationErrors?: boolean

If true, all validation errors will be displayed.


userContext?​

optional userContext?: unknown

The arbitrary context object passed to the form viewer. It is forwarded to custom actions as the third argument of the handler.


validators?​

optional validators?: Partial<Record<keyof SchemaTypeMap, 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?​

optional viewerRef?: ForwardedRef<IFormViewer>

The reference to IFormViewer.


viewMode?​

optional viewMode?: ViewMode

Display resolution type.