Class: Definer<T>
@react-form-builder/core.Definer
The builder class to define the metadata of the form builder component.
Type parameters
Name | Type | Description |
---|---|---|
T | extends object | React component property type. |
Properties
data
• data: DefinerData
<T
>
Definer class data.
Template
React component property type.
Methods
actions
▸ actions(fn
): Definer
<T
>
Adds the metadata of the component's actions. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
fn | ActionsInitializer | the function that initializes an actions on a component. |
Returns
Definer
<T
>
the modified Definer class instance.
build
▸ build(): BuilderComponent
Creates component metadata for the form builder and form viewer.
Returns
component metadata for the form builder and form viewer.
category
▸ category(category
): Definer
<T
>
Sets the category of the component.
Parameters
Name | Type | Description |
---|---|---|
category | string | the component category. |
Returns
Definer
<T
>
the modified Definer class instance.
css
▸ css(css
): Definer
<T
>
Sets the component CSS metadata.
Parameters
Name | Type | Description |
---|---|---|
css | Annotations <CSSObject > | the component CSS metadata. |
Returns
Definer
<T
>
the modified Definer class instance.
getType
▸ getType(): string
Returns
string
the component type name.
icon
▸ icon(icon
): Definer
<T
>
Sets the icon of the component.
Parameters
Name | Type | Description |
---|---|---|
icon | ComponentType | the component icon. |
Returns
Definer
<T
>
the modified Definer class instance.
kind
▸ kind(kind
): Definer
<T
>
Sets the kind of the component.
Parameters
Name | Type | Description |
---|---|---|
kind | ComponentKind | the component kind. |
Returns
Definer
<T
>
the modified Definer class instance.
name
▸ name(name
): Definer
<T
>
Sets the name of the component.
Parameters
Name | Type | Description |
---|---|---|
name | string | the component name. |
Returns
Definer
<T
>
the modified Definer class instance.
preview
▸ preview(customPreview
): Definer
<T
>
Adds the custom component to be displayed in the component list. Internal use only.
Parameters
Name | Type | Description |
---|---|---|
customPreview | ReactNode | the custom component. |
Returns
Definer
<T
>
the modified Definer class instance.
props
▸ props(properties
): Definer
<T
>
Sets the metadata of the component's properties.
Parameters
Name | Type | Description |
---|---|---|
properties | Annotations <T > | the metadata of the component's properties. |
Returns
Definer
<T
>
the modified Definer class instance.
type
▸ type(type
): this
Sets the type of the component.
Parameters
Name | Type | Description |
---|---|---|
type | string | the component type. |
Returns
this
the modified Definer class instance.
define
▸ Static
define<T
>(component
, displayName?
): Definer
<T
>
Static method to create an instance of the component's metadata builder class.
Type parameters
Name | Type |
---|---|
T | extends object |
Parameters
Name | Type | Description |
---|---|---|
component | ComponentType <T > | the React component. |
displayName? | string | the display name for the anonymous component. |
Returns
Definer
<T
>
the instance of the Definer class.