5#include <portals/form_field.hpp>
6#include <portals/ui_controls.hpp>
7#include <portals/ui_layout.hpp>
11namespace portals::ui {
23using AsyncFieldValidator = std::function<std::expected<FieldValidation, TreeError>(std::string_view, std::stop_token)>;
40 std::function<Description<Label>(
ControlStyle)> captionRecipe;
49Description<FormField> customFormField(std::string caption, Description<Widget> editor,
FormFieldOptions options);
52std::expected<FieldValidation, ManagedError> fieldValidation(
const std::shared_ptr<RefTarget> &target);
56Ref<LineEdit> fieldEditor(
const std::shared_ptr<RefTarget> &target);
59std::expected<bool, ManagedError> validateField(
const std::shared_ptr<RefTarget> &target);
64std::expected<void, ManagedError> displayField(
const std::shared_ptr<RefTarget> &target,
FieldValidation value);
77Description<FormField> formField(std::string_view caption, std::string_view initial = {},
FormFieldConfig config = {});
85 return formField(caption, initial, std::move(config)).reference(std::move(reference));
96 return detail::customFormField(std::string(caption),
detail::Access::erase(std::move(editor)), std::move(options));
Single-use owning construction recipe; no mounted widget ownership.
Definition ui_description.hpp:48
Typed Widget observation; explicit composite specializations reuse their existing weak facades.
Definition ui_ref.hpp:761
Owning paint values; no theme engine or behavior is encoded here.
Definition controls.hpp:24
Owning validation presentation; messages remain meaningful without color.
Definition form_field.hpp:25
Byte budgets for an asynchronous field request and its final message; no silent truncation.
Definition ui_form_field.hpp:14
std::size_t maxCandidateBytes
Positive UTF-8 request byte limit; editor limits remain independent.
Definition ui_form_field.hpp:15
std::size_t maxMessageBytes
Positive complete result-message byte limit.
Definition ui_form_field.hpp:16
Owning optional editor customization and confirmation policy.
Definition ui_description.hpp:34
static Description< Widget > erase(Description< T > description)
Erase only the observer type while preserving one mount transaction.
Definition ui_description.hpp:3534