Skip to main content

Introducing Workflow Engine, try for FREE workflowengine.io.

Interface: IValidationBuilder

Interface for defining validation rules for a component.

Extends​

Methods​

args()​

args(val): IComponentBuilder

Specifies the arguments for the validation rule.

Parameters​

val​

any

the validation arguments.

Returns​

IComponentBuilder

the component builder for method chaining.


children()​

children(childrenBuilder): IComponentBuilder

Adds child components inside this component.

Parameters​

childrenBuilder​

(builder) => IFormJsonBuilder

the function that builds the child components.

Returns​

IComponentBuilder

the component builder for method chaining.

Inherited from​

IComponentBuilder.children


component()​

component(key, type): IComponentBuilder

Adds a component to the form.

Parameters​

key​

string

the unique identifier of the component.

type​

string

the type of the component.

Returns​

IComponentBuilder

the component builder for further configuration.

Inherited from​

IComponentBuilder.component


computedProp()​

computedProp(key, value): IComponentBuilder

Sets a computed property on the component.

Parameters​

key​

string

the name of the property.

value​

string

the code of the function for calculating the property value.

Returns​

IComponentBuilder

the component builder for method chaining.

Inherited from​

IComponentBuilder.computedProp


event()​

event(eventName): IEventHandlerBuilder

Starts configuring an event handler for the given event name.

Parameters​

eventName​

string

the name of the event (e.g., "onClick", "onChange").

Returns​

IEventHandlerBuilder

the event handler builder.

Inherited from​

IComponentBuilder.event


json()​

json(): string

Serializes the current state of the form into a JSON string.

Returns​

string

JSON representation of the form.

Inherited from​

IComponentBuilder.json


localizedProp()​

localizedProp(key, language, value): IComponentBuilder

Sets a localized property on the component.

Parameters​

key​

string

the name of the property.

language​

`${string}-${string}`

the localized code, e.g. 'en-US'.

value​

any

the localized value of the property.

Returns​

IComponentBuilder

the component builder for method chaining.

Inherited from​

IComponentBuilder.localizedProp


prop()​

prop(key, value): IComponentBuilder

Sets a property on the component.

Parameters​

key​

string

the name of the property.

value​

any

the value of the property.

Returns​

IComponentBuilder

the component builder for method chaining.

Inherited from​

IComponentBuilder.prop


style()​

style(value, device?): IComponentBuilder

Applies styles to the component, optionally per device.

Parameters​

value​

CSSProperties | string

the style string (e.g., "color: red") or object with style properties.

device?​

Device

the optional device-specific styling.

Returns​

IComponentBuilder

the component builder for method chaining.

Inherited from​

IComponentBuilder.style


validation()​

validation(key): IValidationBuilder

Starts configuring validation rules for the specified field.

Parameters​

key​

string

the name of the validation rule.

Returns​

IValidationBuilder

the validation builder for defining arguments.

Inherited from​

IComponentBuilder.validation