Class: BaseBuilder<T>
@react-form-builder/core.BaseBuilder
The base builder class to define the metadata property of the form builder component.
Type parameters
Name | Description |
---|---|
T | the property type. |
Hierarchy
BaseBuilder
Constructors
constructor
• new BaseBuilder<T
>()
Type parameters
Name |
---|
T |
Properties
annotation
• annotation: PreAnnotation
Partial metadata for a component property.
options
• options: BuilderOptions
Options for building an annotation.
Accessors
localize
• get
localize(): this
Returns
this
the component property that can be localized.
notLocalize
• get
notLocalize(): this
Returns
this
the non-localizable component property.
valued
• get
valued(): this
Returns
this
the main component property that is used as form data and for validation rules.
Methods
build
▸ build(key
): Annotation
Creates component property metadata for the form builder.
Parameters
Name | Type | Description |
---|---|---|
key | string | the unique key of the component property. |
Returns
the instance of the component property metadata for the form builder.
calculable
▸ calculable(calculable
): BaseBuilder
<T
>
Marks the component property as calculable.
Parameters
Name | Type | Description |
---|---|---|
calculable | boolean | true if the property is calculable. |
Returns
BaseBuilder
<T
>
the modified instance of the builder.
clone
▸ clone(): BaseBuilder
<T
>
Clones the instance of the builder.
Returns
BaseBuilder
<T
>
the cloned instance of the builder.
getName
▸ Protected
getName(key
): string
Returns the annotation name.
Parameters
Name | Type | Description |
---|---|---|
key | string | the property name |
Returns
string
the annotation name.
hinted
▸ hinted(hint
): BaseBuilder
<T
>
Adds the hint to the property name of the component.
Parameters
Name | Type | Description |
---|---|---|
hint | ReactNode | the hint. |
Returns
BaseBuilder
<T
>
the modified instance of the builder.
named
▸ named(name
): BaseBuilder
<T
>
Specifies the name of the component property.
Parameters
Name | Type | Description |
---|---|---|
name | string | the property name. |
Returns
BaseBuilder
<T
>
the modified instance of the builder.
setup
▸ setup(options
): BaseBuilder
<T
>
Modifies the component property metadata builder with custom options.
Parameters
Name | Type | Description |
---|---|---|
options | Partial <Partial <Omit <Annotation , "key" >> & Pick <Annotation , "editor" > & BuilderOptions > | the custom options. |
Returns
BaseBuilder
<T
>
the modified instance of the builder.
withEditorProps
▸ withEditorProps(props
): BaseBuilder
<T
>
Sets custom properties for the component's property editor.
Parameters
Name | Type | Description |
---|---|---|
props | any | the custom properties |
Returns
BaseBuilder
<T
>
the modified instance of the builder.