Skip to main content

Module validator

Module validator 

Source
Expand description

Validation pipeline shared by TextInputField and the composites that render its feedback (TextInput, DateEdit, TimeEdit, DateTimeEdit).

§Pipeline shape

  1. The user commits the field (Enter, Tab-out, focus loss).
  2. The field’s ValidatorFn runs on the current text.
  3. The validator returns one of three outcomes:
  4. The field writes the resolved ValidationFeedback to its published signal so composites can render the inline strip.

§Why ValidationOutcome and ValidationFeedback are separate

The outcome is what the validator returns (input → categorized result). The feedback is what observers see (categorized result plus a since timestamp for time-based UI decay). Splitting the types keeps validators stateless and lets the field own the lifecycle (decay, reset on re-edit) without leaking timing concerns into validator code.

Enums§

ValidationFeedback
What composites render. Distinct from ValidationOutcome: the outcome is the validator’s return value (no time concept); the feedback adds a since instant so the visual layer can decay an auto-correction announcement after a window without re-running the validator.
ValidationOutcome
What a validator returns for a given commit attempt.

Type Aliases§

ValidatorFn
The closure signature the field calls on every commit. Stateless — the field owns the pre-edit text and reverts on Invalid itself.