Class: AnnotationBuilder<T>
@react-form-builder/core.AnnotationBuilder
The builder class to define the metadata property of the form builder component.
Type parameters
Name | Description |
---|---|
T | the property type. |
Hierarchy
BaseBuilder
<T
>↳
AnnotationBuilder
Constructors
constructor
• new AnnotationBuilder<T
>(editor
)
Creates a component property metadata builder.
Type parameters
Name | Description |
---|---|
T | the property type. |
Parameters
Name | Type | Description |
---|---|---|
editor | string | the property editor type. |
Overrides
Properties
annotation
• annotation: PreAnnotation
Partial metadata for a component property.
Inherited from
options
• options: BuilderOptions
Options for building an annotation.
Inherited from
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
Name | Type | Description |
---|---|---|
key | string | the unique key of the component property. |
Returns
the instance of the component property metadata for the form builder.
Inherited from
calculable
▸ calculable(calculable
): AnnotationBuilder
<T
>
Marks the component property as calculable.
Parameters
Name | Type | Description |
---|---|---|
calculable | boolean | true if the property is calculable. |
Returns
the modified instance of the builder.
Inherited from
clone
▸ clone(): AnnotationBuilder
<T
>
Clones the instance of the builder.
Returns
the cloned instance of the builder.
Inherited from
getName
▸ Protected
getName(key
): string
Returns the annotation name.
Parameters
Name | Type | Description |
---|---|---|
key | string | the property name |
Returns
string
the annotation name.
Inherited from
hinted
▸ hinted(hint
): AnnotationBuilder
<T
>
Adds the hint to the property name of the component.
Parameters
Name | Type | Description |
---|---|---|
hint | ReactNode | the hint. |
Returns
the modified instance of the builder.
Inherited from
named
▸ named(name
): AnnotationBuilder
<T
>
Specifies the name of the component property.
Parameters
Name | Type | Description |
---|---|---|
name | string | the property name. |
Returns
the modified instance of the builder.
Inherited from
oneOf
▸ oneOf<U
>(...values
): OneOfBuilder
<U
>
Sets the property as a "single select" property.
Type parameters
Name | Type |
---|---|
U | extends string | number |
Parameters
Name | Type | Description |
---|---|---|
...values | U [] | 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
Name | Type | Description |
---|---|---|
options | Partial <Partial <Omit <Annotation , "key" >> & Pick <Annotation , "editor" > & BuilderOptions > | the custom options. |
Returns
the modified instance of the builder.
Inherited from
someOf
▸ someOf<U
>(...values
): SomeOfBuilder
<U
>
Sets the property as a "multiple select" property.
Type parameters
Name | Type |
---|---|
U | extends string | number |
Parameters
Name | Type | Description |
---|---|---|
...values | U [] | the possible values for the property. |
Returns
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
Name | Type |
---|---|
T | extends keyof SchemaTypeMap |
Parameters
Name | Type | Description |
---|---|---|
type | T | the 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
Name | Type | Description |
---|---|---|
props | any | the custom properties |
Returns
the modified instance of the builder.
Inherited from
create
▸ Static
create<T
>(editor
): AnnotationBuilder
<T
>
Creates a component property metadata builder.
Type parameters
Name | Description |
---|---|
T | the property type. |
Parameters
Name | Type | Description |
---|---|---|
editor | string | the property editor type. |
Returns
the component property metadata builder.