Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Class: NodeAnnotationBuilder<T>

The builder class to define the node metadata property.

Extends​

Type Parameters​

T​

T

the property type.

Constructors​

Constructor​

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

Creates a component property metadata builder.

Parameters​

editor​

string

the property editor type.

Returns​

NodeAnnotationBuilder<T>

Overrides​

AnnotationBuilder.constructor

Properties​

annotation​

annotation: PreAnnotation

Partial metadata for a component property.

Inherited from​

AnnotationBuilder.annotation


defaultEditor?​

optional defaultEditor: NodeEditorType

The default editor.


insertPredicate()?​

optional insertPredicate: (self, child) => boolean

The function that checks whether a child component can be inserted into a parent component.

Parameters​

self​

ComponentData

child​

ComponentData

Returns​

boolean


options​

options: BuilderOptions

Options for building an annotation.

Inherited from​

AnnotationBuilder.options

Accessors​

array​

Get Signature​

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

Sets the property as a "array" property.

Returns​

ArrayBuilder<T[] | undefined>

the instance of the metadata property builder.

Inherited from​

AnnotationBuilder.array


dataBound​

Get Signature​

get dataBound(): this

Returns​

this

the main property of the component that uses the form data as data (one-way data binding).

Inherited from​

AnnotationBuilder.dataBound


localize​

Get Signature​

get localize(): this

Returns​

this

the component property that can be localized.

Inherited from​

AnnotationBuilder.localize


notLocalize​

Get Signature​

get notLocalize(): this

Returns​

this

the non-localizable component property.

Inherited from​

AnnotationBuilder.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​

AnnotationBuilder.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.

Overrides​

AnnotationBuilder.build


calculable()​

calculable(calculable): NodeAnnotationBuilder<T>

Marks the component property as calculable.

Parameters​

calculable​

boolean

true if the property is calculable.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the builder.

Inherited from​

AnnotationBuilder.calculable


clone()​

clone(): this

Clones the instance of the builder.

Returns​

this

the cloned instance of the builder.

Inherited from​

AnnotationBuilder.clone


getName()​

protected getName(key): string

Returns the annotation name.

Parameters​

key​

string

the property name

Returns​

string

the annotation name.

Inherited from​

AnnotationBuilder.getName


hideEditor()​

hideEditor(): this

Hides the component property editor.

Returns​

this

the modified instance of the builder.

Inherited from​

AnnotationBuilder.hideEditor


hinted()​

hinted(hint): NodeAnnotationBuilder<T>

Adds the hint to the property name of the component.

Parameters​

hint​

ReactNode

the hint.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the builder.

Inherited from​

AnnotationBuilder.hinted


named()​

named(name): NodeAnnotationBuilder<T>

Specifies the name of the component property.

Parameters​

name​

string

the property name.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the builder.

Inherited from​

AnnotationBuilder.named


oneOf()​

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

Sets the property as a "single select" property.

Type Parameters​

U​

U extends number | string

Parameters​

values​

...U[]

the possible values for the property.

Returns​

OneOfBuilder<U>

the instance of the metadata property builder.

Inherited from​

AnnotationBuilder.oneOf


setup()​

setup(options): this

Modifies the component property metadata builder with custom options.

Parameters​

options​

BuilderSetup

the custom options.

Returns​

this

the modified instance of the builder.

Inherited from​

AnnotationBuilder.setup


someOf()​

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

Sets the property as a "multiple select" property.

Type Parameters​

U​

U extends number | string

Parameters​

values​

...U[]

the possible values for the property.

Returns​

SomeOfBuilder<U>

the instance of the metadata property builder.

Inherited from​

AnnotationBuilder.someOf


typed()​

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

Sets the field type for the component property.

Type Parameters​

T​

T extends keyof SchemaTypeMap

Parameters​

type​

T

the field type.

Returns​

TypedBuilder<SchemaTypeMap[T] | undefined>

the instance of the metadata property builder.

Inherited from​

AnnotationBuilder.typed


uncontrolledValue()​

uncontrolledValue(uncontrolledValue): NodeAnnotationBuilder<T>

Sets the value for the property that prevents uncontrolled state.

Parameters​

uncontrolledValue​

unknown

the value for the uncontrolled state.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the builder.

Inherited from​

AnnotationBuilder.uncontrolledValue


withDefaultEditor()​

withDefaultEditor(defaultEditor): NodeAnnotationBuilder<T>

Specifies the default editor for the property.

Parameters​

defaultEditor​

NodeEditorType

the default editor.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the 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​

AnnotationBuilder.withEditorProps


withInsertRestriction()​

withInsertRestriction(predicate?): NodeAnnotationBuilder<T>

Specifies a function that checks whether a child component can be inserted into a parent component.

Parameters​

predicate?​

(self, child) => boolean

the function that returns a boolean value.

Returns​

NodeAnnotationBuilder<T>

the modified instance of the builder.


withSlotConditionBuilder()​

withSlotConditionBuilder(slotConditionBuilder): this

Specifies a function that will create conditions that check if a child component can be bound to a parent slot.

Parameters​

slotConditionBuilder​

(props) => string

the function that returns a string containing the source code of the function to bind child components.

Returns​

this

the instance of the metadata property builder.


create()​

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

Creates a component property metadata builder.

Type Parameters​

T​

T

the property type.

Parameters​

editor​

string

the property editor type.

Returns​

AnnotationBuilder<T>

the component property metadata builder.

Inherited from​

AnnotationBuilder.create