Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: TypedBuilder<T>

@react-form-builder/core.TypedBuilder

The builder class to define the metadata property of the form builder component. Used for properties where the property value can be validated.

Type parameters

NameDescription
Tthe property type.

Hierarchy

Constructors

constructor

new TypedBuilder<T>()

Type parameters

Name
T

Inherited from

BaseBuilder.constructor

Properties

annotation

annotation: PreAnnotation

Partial metadata for a component property.

Inherited from

BaseBuilder.annotation


options

options: BuilderOptions

Options for building an annotation.

Inherited from

BaseBuilder.options

Accessors

localize

get localize(): this

Returns

this

the component property that can be localized.

Inherited from

BaseBuilder.localize


notLocalize

get notLocalize(): this

Returns

this

the non-localizable component property.

Inherited from

BaseBuilder.notLocalize


required

get required(): TypedBuilder<NonNullable<T>>

Marks the component property as required.

Returns

TypedBuilder<NonNullable<T>>

the modified instance of the builder.


valued

get valued(): this

Returns

this

the main component property that is used as form data and for validation rules.

Inherited from

BaseBuilder.valued

Methods

build

build(key): Annotation

Creates component property metadata for the form builder.

Parameters

NameTypeDescription
keystringthe unique key of the component property.

Returns

Annotation

the instance of the component property metadata for the form builder.

Inherited from

BaseBuilder.build


calculable

calculable(calculable): TypedBuilder<T>

Marks the component property as calculable.

Parameters

NameTypeDescription
calculablebooleantrue if the property is calculable.

Returns

TypedBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.calculable


clone

clone(): TypedBuilder<T>

Clones the instance of the builder.

Returns

TypedBuilder<T>

the cloned instance of the builder.

Inherited from

BaseBuilder.clone


default

default(value): TypedBuilder<T>

Sets the default value for the component property.

Parameters

NameTypeDescription
valueTthe default value.

Returns

TypedBuilder<T>

the modified instance of the builder.


getName

Protected getName(key): string

Returns the annotation name.

Parameters

NameTypeDescription
keystringthe property name

Returns

string

the annotation name.

Inherited from

BaseBuilder.getName


hinted

hinted(hint): TypedBuilder<T>

Adds the hint to the property name of the component.

Parameters

NameTypeDescription
hintReactNodethe hint.

Returns

TypedBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.hinted


named

named(name): TypedBuilder<T>

Specifies the name of the component property.

Parameters

NameTypeDescription
namestringthe property name.

Returns

TypedBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.named


setup

setup(options): TypedBuilder<T>

Modifies the component property metadata builder with custom options.

Parameters

NameTypeDescription
optionsPartial<Partial<Omit<Annotation, "key">> & Pick<Annotation, "editor"> & BuilderOptions>the custom options.

Returns

TypedBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.setup


validated

validated(validator, errorMap): TypedBuilder<T>

Modifies the component property metadata builder with validation properties.

Parameters

NameTypeDescription
validatorRuleValidator<T>the validation function.
errorMapErrorMapthe validation error settings.

Returns

TypedBuilder<T>

the modified instance of the builder.


withEditorProps

withEditorProps(props): TypedBuilder<T>

Sets custom properties for the component's property editor.

Parameters

NameTypeDescription
propsanythe custom properties

Returns

TypedBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.withEditorProps