style: automatic rustfmt run

This commit is contained in:
alphafetus committed 2026-01-15 07:30:32 -05:00
1 parent 9eacc9a618
commit 4e8f4a3c5e
12 files changed
+309 -300

No files matched your search

+11 -6
View File
@@ -121,19 +121,24 @@ pub fn RadioList(
.into_iter()
.map(|item| {
let item = RwSignal::new(item);
let checked_signal = Signal::derive(move || {
selected_value.get() == item.get()
});
let on_change = move || {
// on_change only runs when the radio button is checked, not when unchecked.
// Change the selected value to the new one.
selected_value.set(item.get());
error.set(validate(selected_value.get_untracked(), required.get_untracked()));
error
.set(
validate(
selected_value.get_untracked(),
required.get_untracked(),
),
);
dirty.set(true);
};
// on_change only runs when the radio button is checked, not when unchecked.
// Change the selected value to the new one.
view! {
<Radio
checked=checked_signal
@@ -152,7 +157,7 @@ pub fn RadioList(
{move || {
match error.get() {
ValidationState::Invalid(msg) => msg,
_ => "There is no error - should not see this message.".to_string()
_ => "There is no error - should not see this message.".to_string(),
}
}}
</div>
+14 -11
View File
@@ -93,9 +93,9 @@ pub fn Select(
<span class="ml-1.5 mb-0 font-bold">{label}</span>
<select
class="relative flex-1 border-2 m-1.5 mt-0 p-1.5 rounded-md
transition-border duration-150
border-red-700 bg-transparent
disabled:border-gray-600 disabled:pointer-events-none disabled:bg-gray-600/33"
transition-border duration-150
border-red-700 bg-transparent
disabled:border-gray-600 disabled:pointer-events-none disabled:bg-gray-600/33"
on:change:target=on_change
disabled=disabled
>
@@ -104,15 +104,18 @@ pub fn Select(
value=""
disabled
hidden
selected={move || raw_value.get().is_empty()}
>"Select one..."</option>
selected=move || raw_value.get().is_empty()
>
"Select one..."
</option>
{move || {
value_list.iter().map(
move |value| {
value_list
.iter()
.map(move |value| {
let display = value.to_owned();
view! { <option value={display}>{display.clone()}</option> }
}
).collect::<Vec<_>>()
view! { <option value=display>{display.clone()}</option> }
})
.collect::<Vec<_>>()
}}
</select>
</label>
@@ -122,7 +125,7 @@ pub fn Select(
{move || {
match error.get() {
ValidationState::Invalid(msg) => msg,
_ => "There is no error - should not see this message.".to_string()
_ => "There is no error - should not see this message.".to_string(),
}
}}
</div>