Class: QuantifierBuilder<T>
@react-form-builder/core.QuantifierBuilder
The abstract builder class to define the metadata property of the form builder component. Used for properties where the property value can be selected from predefined values.
Type parameters
Name | Description |
---|---|
T | the property type. |
Hierarchy
TypedBuilder
<T
>↳
QuantifierBuilder
↳↳
OneOfBuilder
↳↳
OneOfBuilder
Constructors
constructor
• new QuantifierBuilder<T
>()
Type parameters
Name |
---|
T |
Inherited from
Properties
annotation
• annotation: PreAnnotation
Partial metadata for a component property.
Inherited from
labels
• Optional
labels: string
[]
Labels for the possible values of the property.
options
• options: BuilderOptions
Options for building an annotation.
Inherited from
values
• values: (string
| number
)[]
Possible values for the property.
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
required
• get
required(): QuantifierBuilder
<NonNullable
<T
>>
Marks the component property as required.
Returns
QuantifierBuilder
<NonNullable
<T
>>
the modified instance of the builder.
Overrides
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.
Overrides
calculable
▸ calculable(calculable
): QuantifierBuilder
<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(): QuantifierBuilder
<T
>
Clones the instance of the builder.
Returns
the cloned instance of the builder.
Inherited from
default
▸ default(value
): QuantifierBuilder
<T
>
Sets the default value for the component property.
Parameters
Name | Type | Description |
---|---|---|
value | T | T [] | the default value, can be an array of values. |
Returns
the modified instance of the builder.
Overrides
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
): QuantifierBuilder
<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
labeled
▸ labeled(...labels
): QuantifierBuilder
<T
>
Sets the labels for predefined values.
Parameters
Name | Type | Description |
---|---|---|
...labels | string [] | the labels. |
Returns
the modified instance of the builder.
named
▸ named(name
): QuantifierBuilder
<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
setup
▸ setup(options
): QuantifierBuilder
<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
validated
▸ validated(validator
, errorMap
): QuantifierBuilder
<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
the modified instance of the builder.
Inherited from
withEditorProps
▸ withEditorProps(props
): QuantifierBuilder
<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.