Class: ArrayBuilder<T>
@react-form-builder/core.ArrayBuilder
The builder class to define the metadata property of the form builder component. Used for properties where the property value is an array.
Type parameters
Name | Description |
---|---|
T | the property type. |
Hierarchy
TypedBuilder
<T
>↳
ArrayBuilder
Constructors
constructor
• new ArrayBuilder<T
>()
Type parameters
Name |
---|
T |
Inherited from
Properties
annotation
• annotation: PreAnnotation
Partial metadata for a component property.
Inherited from
options
• options: BuilderOptions
Options for building an annotation.
Inherited from
subType
• Optional
subType: keyof SchemaTypeMap
Accessors
localize
• get
localize(): this
Returns
this
the component property that can be localized.
Inherited from
TypedBuilder.localize
notLocalize
• get
notLocalize(): this
Returns
this
the non-localizable component property.
Inherited from
TypedBuilder.notLocalize
ofObject
• get
ofObject(): ArrayBuilder
<undefined
| object
[]>
Sets the component's value type to an array of objects.
Returns
ArrayBuilder
<undefined
| object
[]>
the modified instance of the builder.
ofString
• get
ofString(): ArrayBuilder
<undefined
| string
[]>
Sets the component's value type to an array of strings.
Returns
ArrayBuilder
<undefined
| string
[]>
the modified instance of the builder.
required
• get
required(): TypedBuilder
<NonNullable
<T
>>
Marks the component property as required.
Returns
TypedBuilder
<NonNullable
<T
>>
the modified instance of the builder.
Inherited from
TypedBuilder.required
valued
• get
valued(): this
Returns
this
the main component property that is used as form data and for validation rules.
Inherited from
TypedBuilder.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
): ArrayBuilder
<T
>
Marks the component property as calculable.
Parameters
Name | Type | Description |
---|---|---|
calculable | boolean | true if the property is calculable. |
Returns
ArrayBuilder
<T
>
the modified instance of the builder.
Inherited from
clone
▸ clone(): ArrayBuilder
<T
>
Clones the instance of the builder.
Returns
ArrayBuilder
<T
>
the cloned instance of the builder.
Inherited from
default
▸ default(value
): ArrayBuilder
<T
>
Sets the default value for the component property.
Parameters
Name | Type | Description |
---|---|---|
value | T | the default value. |
Returns
ArrayBuilder
<T
>
the modified 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
): ArrayBuilder
<T
>
Adds the hint to the property name of the component.
Parameters
Name | Type | Description |
---|---|---|
hint | ReactNode | the hint. |
Returns
ArrayBuilder
<T
>
the modified instance of the builder.
Inherited from
named
▸ named(name
): ArrayBuilder
<T
>
Specifies the name of the component property.
Parameters
Name | Type | Description |
---|---|---|
name | string | the property name. |
Returns
ArrayBuilder
<T
>
the modified instance of the builder.
Inherited from
setup
▸ setup(options
): ArrayBuilder
<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
ArrayBuilder
<T
>
the modified instance of the builder.
Inherited from
validated
▸ validated(validator
, errorMap
): ArrayBuilder
<T
>
Modifies the component property metadata builder with validation properties.
Parameters
Name | Type | Description |
---|---|---|
validator | RuleValidator <T > | the validation function. |
errorMap | ErrorMap | the validation error settings. |
Returns
ArrayBuilder
<T
>
the modified instance of the builder.
Inherited from
withEditorProps
▸ withEditorProps(props
): ArrayBuilder
<T
>
Sets custom properties for the component's property editor.
Parameters
Name | Type | Description |
---|---|---|
props | any | the custom properties |
Returns
ArrayBuilder
<T
>
the modified instance of the builder.