Skip to main content

Module validation

Module validation 

Source
Expand description

Form-field validation driver.

Recomputes the is_valid flag on every entity carrying a Validation component and mirrors the result into PropertyStore under the valid:<lumen-id> global key.

Supported matchers:

  • required: trimmed text must be non-empty; the slider value must be > 0; the toggle must be checked.
  • pattern: content must contain the configured literal substring, or match a named shape when the pattern starts with shape: (see matches_pattern).
  • min / max: numeric range applied to slider values and to input text when it parses as a number.

Structs§

ValidationPlugin
Plugin: registers apply_validation in TickStage::Systems so validation runs after author-side tick logic has settled.

Functions§

apply_validation
Walk every entity whose validation input changed this tick. Pick the most relevant content source (TextContent -> slider -> toggle), apply the rules, write the result back to Validation::is_valid, and mirror into PropertyStore[Global("valid:<id>")] when the entity has a stable LumenId.
evaluate
Pure validation function - handy for tests and any author-side script-bridge that wants to validate a value without spawning an entity. Pass the relevant slot for the entity’s kind; the other slots stay None.
matches_pattern
Apply a pattern rule to one value.