feat: update checkbox component to use open-ended structures

Commit also includes changes to other components that make unused props optional.
This commit is contained in:
alphafetus committed 2025-09-25 12:31:47 -04:00
1 parent b460c3b3fd
commit 059f904f5d
7 files changed
+80 -40

No files matched your search

+6 -8
View File
@@ -8,7 +8,7 @@ pub fn OutlinedTextField(
#[prop(optional, into)] placeholder: String,
// #[prop()] value: Subfield<TStore, TInner, ValueType>,
#[prop(into)] data_member: String, // should this be an RwSignal??
#[prop(optional)] data_map: RwSignal<HashMap<String, ValueType>>,
#[prop()] data_map: RwSignal<HashMap<String, ValueType>>,
#[prop(optional)] value: RwSignal<ValueType>,
#[prop(default = "text".to_owned(), into)] input_type: String,
#[prop(optional)] disabled: RwSignal<bool>,
@@ -86,13 +86,11 @@ pub fn OutlinedTextField(
disabled={disabled}
placeholder={placeholder}
prop:name=name
prop:value={
data_map
.get() // HashMap
.get(&data_member) // Option<ValueType>
.unwrap_or(&ValueType::String(None)) // ValueType
.to_string()
}
prop:value=move || data_map
.get() // HashMap
.get(&data_member) // Option<ValueType>
.unwrap_or(&ValueType::String(None)) // ValueType
.to_string()
on:input=on_input
/>
<div