dynamic-forms / Interface

CrossFieldValidatorEntry

Cross-field validator entry. Represents a validator that references formValue.* and needs form-level execution.

Supports two types of validators:

  1. Custom validators with cross-field expressions (e.g., formValue.password === formValue.confirmPassword)
  2. Built-in validators with cross-field when conditions (e.g., required when country === 'USA')

Properties

NameTypeDescription
category"validator"

The category of this cross-field entry

config
ValidatorConfig

The validator configuration. For custom validators, this contains the expression. For built-in validators, this contains the type, value, and when condition.

dependsOn
inherited from BaseCrossFieldEntry
string[]

Field keys that this configuration depends on (extracted from expressions)

sourceFieldKey
inherited from BaseCrossFieldEntry
string

The key of the field where this configuration was originally defined

validatorType
"email" | "customAsync" | "required" | "min" | "max" | "minLength" | "maxLength" | "pattern" | "customHttp" | "custom" | undefined

For built-in validators with dynamic expressions, this contains the validator type (min, max, pattern, etc.)