dynamic-forms / Interface

DerivationEntry

Entry representing a collected derivation from field definitions.

Created during form initialization when traversing field definitions to collect all derivation rules (both shorthand and full logic configs).

All derivations are self-targeting: the fieldKey is both where the derivation is defined AND where the computed value will be set.

Properties

NameTypeDescription
condition
boolean | ConditionalExpression

Condition that determines when this derivation applies.

Defaults to true (always apply) if not specified.

debounceMs
number | undefined

Debounce duration in milliseconds.

Only used when trigger is 'debounced'. @default 500

debugName
string | undefined

Optional debug name for easier identification in logs.

Copied from the originalConfig if provided. When set, this name appears in verbose derivation logs instead of the field key.

dependsOn
string[]

Field keys that this derivation depends on.

Extracted from conditions and expressions. Used for:

  • Cycle detection
  • Reactive dependency tracking
  • Determining evaluation order
expression
string | undefined

JavaScript expression to evaluate for the derived value.

Mutually exclusive with value and functionName.

fieldKey
string

The key of the field where this derivation is defined and targets.

Derivations always target the field they are defined on (self-targeting). For array fields, this may include a placeholder path like 'items.$.lineTotal' which is resolved to actual indices at runtime.

functionName
string | undefined

Name of a registered custom derivation function.

Mutually exclusive with value and expression.

isShorthand
boolean

Whether this derivation was created from the shorthand derivation property.

Shorthand derivations use a string expression directly on the field.

originalConfig
DerivationLogicConfig | undefined

The original logic config if this entry was created from a full logic config.

trigger
LogicTrigger

When to evaluate the derivation.

  • onChange: Evaluate immediately when dependencies change (default)
  • debounced: Evaluate after value has stabilized for debounceMs

@default 'onChange'

value
unknown

Static value to set on this field.

Mutually exclusive with expression and functionName.