|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
#include <form.hpp>
Public Member Functions | |
| FormField (std::string field_path, T initial=T{}) | |
| Construct from (field_path, initial). | |
| const std::string & | field_path () const noexcept |
| FormField & | rule (typename Validator< T >::Rule r, std::string rule_id_value={}) |
| template<std::predicate< const T & > P> | |
| FormField & | must (P &&predicate, std::string message, std::string rule_id_value={}) |
| FormField & | required (std::string message="required") |
| FormField & | min_length (std::size_t n, std::string message) |
| void | reset (T v=T{}) |
Public Attributes | |
| Property< T > | value |
| Validator< T > | validator |
| Property< bool > | is_valid {true} |
| Property< std::string > | error {""} |
| First-error message string for trivial UI binding. | |
| Property< std::optional<::aria::Error > > | error_full {std::nullopt} |
| Full first-error record. | |
| Property< bool > | touched {false} |
| Property< bool > | dirty {false} |
|
inlineexplicit |
Construct from (field_path, initial).
The path flows into the owned Validator so every emitted Error is keyed by it.
|
inlinenodiscardnoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| Property<T> aria::binding::FormField< T >::value |
| Validator<T> aria::binding::FormField< T >::validator |
| Property<bool> aria::binding::FormField< T >::is_valid {true} |
| Property<std::string> aria::binding::FormField< T >::error {""} |
First-error message string for trivial UI binding.
For full provenance use error_full or validator.state().
| Property<std::optional<::aria::Error> > aria::binding::FormField< T >::error_full {std::nullopt} |
Full first-error record.
Carries the same message as error when present, plus kind / key / severity.
| Property<bool> aria::binding::FormField< T >::touched {false} |
| Property<bool> aria::binding::FormField< T >::dirty {false} |