morph 0.1.0
Asynchronous bridge between GUI thread and business models
Loading...
Searching...
No Matches
morph::forms::VisibleWhen< V, A, Cond > Struct Template Reference

Presentation rule: the listed field is shown only while Cond holds. Never gates allRulesSatisfied — while hidden, the field's current draft value still travels in the payload (hiding never clears it), exactly like a static x-hidden field. More...

#include <forms.hpp>

Public Member Functions

constexpr bool test (const A &action) const noexcept
 Always true: presentation rules never gate submission. A renderer inspects when directly (not this method) to decide the field's visibility.
glz::generic_u64 emitNode () const
 Emits this rule's x-rules JSON node.

Public Attributes

V A::* field
 Pointer to the member whose visibility this rule controls.
Cond when
 The condition that, when true, makes field visible.

Static Public Attributes

static constexpr detail::RuleKind kind = detail::RuleKind::VisibleWhen
 The wire "kind" this rule emits: "visibleWhen".
static constexpr bool isPresentation = true
 Presentation rule: never participates in the gate.

Detailed Description

template<typename V, typename A, typename Cond>
struct morph::forms::VisibleWhen< V, A, Cond >

Presentation rule: the listed field is shown only while Cond holds. Never gates allRulesSatisfied — while hidden, the field's current draft value still travels in the payload (hiding never clears it), exactly like a static x-hidden field.

Template Parameters
VField member type.
AAction type the field belongs to.
CondCondition node type.

Definition at line 1636 of file forms.hpp.

Member Function Documentation

◆ test()

template<typename V, typename A, typename Cond>
bool morph::forms::VisibleWhen< V, A, Cond >::test ( const A & action) const
inlinenodiscardconstexprnoexcept

Always true: presentation rules never gate submission. A renderer inspects when directly (not this method) to decide the field's visibility.

Parameters
actionUnused (kept for interface uniformity with every other rule node).
Returns
true, unconditionally.

Definition at line 1652 of file forms.hpp.

◆ emitNode()

template<typename V, typename A, typename Cond>
glz::generic_u64 morph::forms::VisibleWhen< V, A, Cond >::emitNode ( ) const
inlinenodiscard

Emits this rule's x-rules JSON node.

Returns
{"kind":"visibleWhen","fields":["<wire name>"],"when":{...}}.

Definition at line 1659 of file forms.hpp.

Member Data Documentation

◆ field

template<typename V, typename A, typename Cond>
V A::* morph::forms::VisibleWhen< V, A, Cond >::field

Pointer to the member whose visibility this rule controls.

Definition at line 1638 of file forms.hpp.

◆ when

template<typename V, typename A, typename Cond>
Cond morph::forms::VisibleWhen< V, A, Cond >::when

The condition that, when true, makes field visible.

Definition at line 1640 of file forms.hpp.

◆ kind

template<typename V, typename A, typename Cond>
detail::RuleKind morph::forms::VisibleWhen< V, A, Cond >::kind = detail::RuleKind::VisibleWhen
staticconstexpr

The wire "kind" this rule emits: "visibleWhen".

Definition at line 1642 of file forms.hpp.

◆ isPresentation

template<typename V, typename A, typename Cond>
bool morph::forms::VisibleWhen< V, A, Cond >::isPresentation = true
staticconstexpr

Presentation rule: never participates in the gate.

Definition at line 1644 of file forms.hpp.


The documentation for this struct was generated from the following file: