Expand description
Validation pipeline shared by TextInputField and the composites
that render its feedback (TextInput, DateEdit, TimeEdit,
DateTimeEdit).
§Pipeline shape
- The user commits the field (Enter, Tab-out, focus loss).
- The field’s
ValidatorFnruns on the current text. - The validator returns one of three outcomes:
ValidationOutcome::Valid— keep the text as-is.ValidationOutcome::Corrected— replace the text with a normalized form, surface a polite announcement.ValidationOutcome::Invalid— revert to the pre-edit value, surface an assertive error.
- The field writes the resolved
ValidationFeedbackto 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§
- Validation
Feedback - What composites render. Distinct from
ValidationOutcome: the outcome is the validator’s return value (no time concept); the feedback adds asinceinstant so the visual layer can decay an auto-correction announcement after a window without re-running the validator. - Validation
Outcome - What a validator returns for a given commit attempt.
Type Aliases§
- Validator
Fn - The closure signature the field calls on every commit. Stateless —
the field owns the pre-edit text and reverts on
Invaliditself.