Class: ComponentState
@react-form-builder/core.ComponentState
Calculates all the properties of the form view component.
Constructors
constructor
• new ComponentState(data
, store
, localizer
, computeChildren
)
Creates an instance that calculates the properties of the form viewer component.
Parameters
Name | Type | Description |
---|---|---|
data | ComponentData | the data needed to display the component. |
store | Store | the form viewer settings. |
localizer | (componentStore : ComponentStore ) => Record <string , any > | the function to localize the properties of a component, returns a Record with localized properties. |
computeChildren | ComputeChildren | the function that calculates all child properties of a component. |
Properties
computeChildren
• Readonly
computeChildren: ComputeChildren
the function that calculates all child properties of a component.
data
• Readonly
data: ComponentData
the data needed to display the component.
localizer
• Readonly
localizer: (componentStore
: ComponentStore
) => Record
<string
, any
>
Type declaration
▸ (componentStore
): Record
<string
, any
>
the function to localize the properties of a component, returns a Record with localized properties.
Parameters
Name | Type |
---|---|
componentStore | ComponentStore |
Returns
Record
<string
, any
>
store
• Readonly
store: Store
the form viewer settings.
Accessors
calculatedProps
• get
calculatedProps(): Record
<string
, any
>
Returns
Record
<string
, any
>
the values for all properties of the component, calculates the values of the calculated properties.
className
• get
className(): Object
Calculates and returns className property.
Returns
Object
the Record that contains the className property for the component.
Name | Type |
---|---|
className | string |
events
• get
events(): Record
<string
, Function
>
Returns
Record
<string
, Function
>
the component event handlers that send events to the event bus.
get
• get
get(): Record
<string
, any
>
Returns
Record
<string
, any
>
combined in order of priority component properties.
htmlAttributes
• get
htmlAttributes(): undefined
| HtmlAttribute
Returns
undefined
| HtmlAttribute
all arbitrary HTML attributes of the component.
localizedProps
• get
localizedProps(): Record
<string
, any
>
Returns
Record
<string
, any
>
component localized properties.
propsWithoutChildren
• get
propsWithoutChildren(): Record
<string
, any
>
Returns
Record
<string
, any
>
the combined properties of the components in priority order, excluding child components.
value
• get
value(): undefined
| {}
Returns
undefined
| {}
the component's field value data, if the component can have a field value.
wrapperClassName
• get
wrapperClassName(): string
Calculates and returns wrapper className property.
Returns
string
the Record that contains the className property for the wrapper of component.
Methods
children
▸ children(props
): Record
<string
, any
>
Calculates and returns all child components.
Parameters
Name | Type | Description |
---|---|---|
props | any | the React component properties. |
Returns
Record
<string
, any
>
the Record that contains the child components of a component.