Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: AnnotationBuilder<T>

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

Extends

Extended by

Type Parameters

T

the property type.

Constructors

new AnnotationBuilder()

new AnnotationBuilder<T>(editor): AnnotationBuilder<T>

Creates a component property metadata builder.

Parameters

editor: string

the property editor type.

Returns

AnnotationBuilder<T>

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 Signature

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 Signature

get localize(): this

Returns

this

the component property that can be localized.

Inherited from

BaseBuilder.localize


notLocalize

Get Signature

get notLocalize(): this

Returns

this

the non-localizable component property.

Inherited from

BaseBuilder.notLocalize


valued

Get Signature

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

key: string

the 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

calculable: boolean

true if the property is calculable.

Returns

AnnotationBuilder<T>

the modified instance of the builder.

Inherited from

BaseBuilder.calculable


clone()

clone(): this

Clones the instance of the builder.

Returns

this

the cloned instance of the builder.

Inherited from

BaseBuilder.clone


getName()

protected getName(key): string

Returns the annotation name.

Parameters

key: string

the property name

Returns

string

the annotation name.

Inherited from

BaseBuilder.getName


hideEditor()

hideEditor(): this

Hides the component property editor.

Returns

this

the modified instance of the builder.

Inherited from

BaseBuilder.hideEditor


hinted()

hinted(hint): AnnotationBuilder<T>

Adds the hint to the property name of the component.

Parameters

hint: ReactNode

the 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

name: string

the 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

U extends string | number

Parameters

• ...values: U[]

the possible values for the property.

Returns

OneOfBuilder<U>

the instance of the metadata property builder.


setup()

setup(options): this

Modifies the component property metadata builder with custom options.

Parameters

options: Partial<Partial<Omit<Annotation, "key">> & Pick<Annotation, "editor"> & BuilderOptions>

the custom options.

Returns

this

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

U extends string | number

Parameters

• ...values: U[]

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

T extends keyof SchemaTypeMap

Parameters

type: T

the field type.

Returns

TypedBuilder<undefined | SchemaTypeMap[T]>

the instance of the metadata property builder.


withEditorProps()

withEditorProps(props): this

Sets custom properties for the component's property editor.

Parameters

props: any

the custom properties

Returns

this

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

T

the property type.

Parameters

editor: string

the property editor type.

Returns

AnnotationBuilder<T>

the component property metadata builder.