Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: View

@react-form-builder/core.View

Represents all the metadata of the form viewer components.

Hierarchy

Constructors

constructor

new View(models?)

Creates an instance of the View.

Parameters

NameTypeDefault valueDescription
modelsModel<any>[][]the components metadata.

Accessors

viewerWrappers

get viewerWrappers(): FormViewerWrapper[]

Retrieves the viewer wrappers array.

Returns

FormViewerWrapper[]

the viewer wrappers array.

Methods

all

all(): Model<any>[]

Returns

Model<any>[]

all component metadata for the form viewer.


define

define(model): void

Defines the component's metadata for the form viewer.

Parameters

NameTypeDescription
modelModel<any>the component's metadata.

Returns

void


find

find(type): undefined | Model<any>

Returns the component's metadata for the form viewer for the specified type.

Parameters

NameTypeDescription
typestringthe component type.

Returns

undefined | Model<any>

the component metadata for the form viewer for the specified type or undefined.


get

get(type): Model<any>

Returns the component's metadata for the form viewer for the specified type.

Parameters

NameTypeDescription
typestringthe component type.

Returns

Model<any>

the component metadata for the form viewer for the specified type.


getCssLoaders

getCssLoaders(biDi): () => Promise<void>[]

Retrieves the CSS loaders for a given BiDi.

Parameters

NameTypeDescription
biDiBiDithe BiDi object for which to retrieve the CSS loaders.

Returns

() => Promise<void>[]

the array containing the CSS loaders for the specified BiDi.


withCssLoader

withCssLoader(cssLoaderType, loader): View

Applies the given CSS loader to the component based on the BiDi layout.

Parameters

NameTypeDescription
cssLoaderTypeCssLoaderTypethe BiDi layout type, either 'common', 'ltr', or 'rtl'.
loader() => Promise<void>the function that returns a Promise to load CSS or other required localization resources.

Returns

View

the View instance.


withViewerWrapper

withViewerWrapper(wrapper): this

Adds a wrapper to the list of viewers for this viewer wrapper.

Parameters

NameTypeDescription
wrapperFormViewerWrapperthe viewer wrapper to be added. The wrapper is a component that wraps the form viewer.

Returns

this

the View instance.


create

Static create(models): View

Static wrapper for the View constructor.

Parameters

NameTypeDescription
modelsModel<any>[]the components metadata.

Returns

View

the View instance.