Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: ComponentStore

@react-form-builder/core.ComponentStore

Component settings for serialization in JSON.

Constructors

constructor

new ComponentStore(key, type)

Creates the component settings.

Parameters

NameTypeDescription
keystringthe React component key.
typestringthe component type of the form viewer.

Properties

children

Optional children: ComponentStore[]

The array of child components.


css

Optional css: Css

The component CSS styles.


events

Optional events: Record<string, ActionData[]>

The set of event handlers.


htmlAttributes

Optional htmlAttributes: HtmlAttribute[]

The set of arbitrary HTML attributes added to the component.


key

key: string = ''

The React component key.


props

props: Record<string, ComponentProperty> = {}

The component properties.


renderWhen

Optional renderWhen: ComponentProperty

The expression or function to conditionally render a component.


schema

Optional schema: BoundValueSchema

The component value validation settings.


slot

Optional slot: string

The name of the occupied component property in the parent component.


slotCondition

Optional slotCondition: string

The condition for binding a child element to a parent element.


tooltipProps

Optional tooltipProps: Record<string, ComponentProperty>

The tooltip settings.


type

type: string = ''

The component type of the form viewer.


wrapperCss

Optional wrapperCss: Css

The component wrapper CSS styles.

Methods

addEventHandler

Static addEventHandler(store, eventName, data): void

Adds the event handler for component.

Parameters

NameTypeDescription
storeComponentStorethe target ComponentStore.
eventNamestringthe target event name.
dataActionDatathe ActionData.

Returns

void


createFromObject

Static createFromObject(value): any

Correctly creates the ComponentStore from deserialized data.

Parameters

NameTypeDescription
valueanythe deserialized data.

Returns

any

the component Store.