Class: ComponentStore
@react-form-builder/core.ComponentStore
Component settings for serialization in JSON.
Constructors
constructor
• new ComponentStore(key
, type
)
Creates the component settings.
Parameters
Name | Type | Description |
---|---|---|
key | string | the React component key. |
type | string | the 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
Name | Type | Description |
---|---|---|
store | ComponentStore | the target ComponentStore. |
eventName | string | the target event name. |
data | ActionData | the ActionData. |
Returns
void
createFromObject
▸ Static
createFromObject(value
): any
Correctly creates the ComponentStore from deserialized data.
Parameters
Name | Type | Description |
---|---|---|
value | any | the deserialized data. |
Returns
any
the component Store.