Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: AnnotationBuilder<T>

@react-form-builder/core.AnnotationBuilder

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

Type parameters

NameDescription
Tthe property type.

Hierarchy

Constructors

constructor

new AnnotationBuilder<T>(editor)

Creates a component property metadata builder.

Type parameters

NameDescription
Tthe property type.

Parameters

NameTypeDescription
editorstringthe property editor type.

Overrides

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

array

get array(): ArrayBuilder<undefined | T[]>

Sets the property as a "array" property.

Returns

ArrayBuilder<undefined | T[]>

the instance of the metadata property builder.


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


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): AnnotationBuilder<T>

Marks the component property as calculable.

Parameters

NameTypeDescription
calculablebooleantrue if the property is calculable.

Returns

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.calculable


clone

clone(): AnnotationBuilder<T>

Clones the instance of the builder.

Returns

AnnotationBuilder<T>

the cloned instance of the builder.

Inherited from

BaseBuilder.clone


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): AnnotationBuilder<T>

Adds the hint to the property name of the component.

Parameters

NameTypeDescription
hintReactNodethe hint.

Returns

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.hinted


named

named(name): AnnotationBuilder<T>

Specifies the name of the component property.

Parameters

NameTypeDescription
namestringthe property name.

Returns

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.named


oneOf

oneOf<U>(...values): OneOfBuilder<U>

Sets the property as a "single select" property.

Type parameters

NameType
Uextends string | number

Parameters

NameTypeDescription
...valuesU[]the possible values for the property.

Returns

OneOfBuilder<U>

the instance of the metadata property builder.


setup

setup(options): AnnotationBuilder<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

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.setup


someOf

someOf<U>(...values): SomeOfBuilder<U>

Sets the property as a "multiple select" property.

Type parameters

NameType
Uextends string | number

Parameters

NameTypeDescription
...valuesU[]the possible values for the property.

Returns

SomeOfBuilder<U>

the instance of the metadata property builder.


typed

typed<T>(type): TypedBuilder<undefined | SchemaTypeMap[T]>

Sets the field type for the component property.

Type parameters

NameType
Textends keyof SchemaTypeMap

Parameters

NameTypeDescription
typeTthe field type.

Returns

TypedBuilder<undefined | SchemaTypeMap[T]>

the instance of the metadata property builder.


withEditorProps

withEditorProps(props): AnnotationBuilder<T>

Sets custom properties for the component's property editor.

Parameters

NameTypeDescription
propsanythe custom properties

Returns

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.withEditorProps


create

Static create<T>(editor): AnnotationBuilder<T>

Creates a component property metadata builder.

Type parameters

NameDescription
Tthe property type.

Parameters

NameTypeDescription
editorstringthe property editor type.

Returns

AnnotationBuilder<T>

the component property metadata builder.