Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: Definer<T>

@react-form-builder/core.Definer

The builder class to define the metadata of the form builder component.

Type parameters

NameTypeDescription
Textends objectReact 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

NameTypeDescription
fnActionsInitializerthe 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

BuilderComponent

component metadata for the form builder and form viewer.


category

category(category): Definer<T>

Sets the category of the component.

Parameters

NameTypeDescription
categorystringthe component category.

Returns

Definer<T>

the modified Definer class instance.


css

css(css): Definer<T>

Sets the component CSS metadata.

Parameters

NameTypeDescription
cssAnnotations<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

NameTypeDescription
iconComponentTypethe component icon.

Returns

Definer<T>

the modified Definer class instance.


kind

kind(kind): Definer<T>

Sets the kind of the component.

Parameters

NameTypeDescription
kindComponentKindthe component kind.

Returns

Definer<T>

the modified Definer class instance.


name

name(name): Definer<T>

Sets the name of the component.

Parameters

NameTypeDescription
namestringthe 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

NameTypeDescription
customPreviewReactNodethe custom component.

Returns

Definer<T>

the modified Definer class instance.


props

props(properties): Definer<T>

Sets the metadata of the component's properties.

Parameters

NameTypeDescription
propertiesAnnotations<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

NameTypeDescription
typestringthe 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

NameType
Textends object

Parameters

NameTypeDescription
componentComponentType<T>the React component.
displayName?stringthe display name for the anonymous component.

Returns

Definer<T>

the instance of the Definer class.