pub struct DetailField {
pub label: String,
pub value: String,
pub input: ComponentNode,
}Expand description
A single field row within a DetailFormProps.
Rendered as <div><dt>{label}</dt><dd>…</dd></div> in both modes.
In View mode, <dd> shows the escaped value as plain text.
In Edit mode, <dd> renders the input ComponentNode via the
normal component dispatch — making any form-field component (Input,
Select, Textarea, Switch, Checkbox, plugin) usable inside.
Authoring rule (Option A). When input is an Input / Select /
Textarea / Checkbox / Switch component, the caller MUST set its
label prop to an empty string. The <dt> already provides the
visible label; a non-empty input label produces duplicate UI text.
DetailForm does not mutate caller-supplied props.
Fields§
§label: StringDescription term shown in both modes as the field label.
value: StringDisplay string shown in View mode (plain text, html_escape’d at render).
input: ComponentNodeComponent rendered in Edit mode in place of value.
Implementations§
Source§impl DetailField
impl DetailField
Sourcepub fn new(
label: impl Into<String>,
value: impl Into<String>,
input: ComponentNode,
) -> Self
pub fn new( label: impl Into<String>, value: impl Into<String>, input: ComponentNode, ) -> Self
Convenience constructor mirroring ComponentNode::input ergonomics.
Trait Implementations§
Source§impl Clone for DetailField
impl Clone for DetailField
Source§fn clone(&self) -> DetailField
fn clone(&self) -> DetailField
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DetailField
impl Debug for DetailField
Source§impl<'de> Deserialize<'de> for DetailField
impl<'de> Deserialize<'de> for DetailField
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for DetailField
impl PartialEq for DetailField
Source§fn eq(&self, other: &DetailField) -> bool
fn eq(&self, other: &DetailField) -> bool
self and other values to be equal, and is used by ==.