dynamic-forms / Interface

FieldWithValidation

No documentation has been provided.

Properties

NameTypeDescription
derivation
r
string | undefined

Shorthand for simple computed/derived fields.

The expression is evaluated whenever its dependencies change, and the result is set as this field's value.

Has access to formValue object containing all form values. Uses the same secure AST-based parser as other expressions.

For conditional derivations or derivations targeting other fields, use the full logic array with { type: 'derivation', ... }.

Example usage
// Compute total from quantity and price
{
  key: 'total',
  type: 'number',
  derivation: 'formValue.quantity * formValue.unitPrice'
}

// Concatenate names
{
  key: 'fullName',
  type: 'input',
  derivation: 'formValue.firstName + " " + formValue.lastName'
}

// Calculate discounted price
{
  key: 'discountedPrice',
  type: 'number',
  derivation: 'formValue.price * (1 - formValue.discountPercent / 100)'
}
email
r
boolean | undefined
logic
r
LogicConfig[] | undefined
max
r
number | undefined
maxLength
r
number | undefined
min
r
number | undefined
minLength
r
number | undefined
pattern
r
string | RegExp | undefined
required
r
boolean | undefined
schemas
r
SchemaApplicationConfig[] | undefined
validationMessages
r
ValidationMessages | undefined
validators
r
ValidatorConfig[] | undefined