From 749ccc272b3f422db4692519a7b43e115aa2cde3 Mon Sep 17 00:00:00 2001 From: Mitchell M Date: Wed, 5 Jun 2024 16:32:31 -0500 Subject: [PATCH] remove todos in favor of issues. Fmt --- src/controls/mod.rs | 2 - src/styles/grid_form.rs | 181 +++++++++++++++++++--------------------- 2 files changed, 84 insertions(+), 99 deletions(-) diff --git a/src/controls/mod.rs b/src/controls/mod.rs index f05ebc2..fc114ea 100644 --- a/src/controls/mod.rs +++ b/src/controls/mod.rs @@ -38,8 +38,6 @@ impl RenderFn for F where { } -// TODO: vanity signals should have an optional getter. - /// A trait for the data needed to render an read-only control. pub trait VanityControlData: 'static { /// Builds the control, returning the [`View`] that was built. diff --git a/src/styles/grid_form.rs b/src/styles/grid_form.rs index f605c18..08b7b94 100644 --- a/src/styles/grid_form.rs +++ b/src/styles/grid_form.rs @@ -7,19 +7,6 @@ use crate::controls::{ use leptos::*; use std::rc::Rc; -// TODO: move validation from happening on set, to happening on get -// I think. -// That might fix some issues where the field updates but the validation doesn't -/// I don't know if that will cause any loops or not... - -// TODO: send the server fn directly instead of parsing from form data perhaps. -// This would need a note in the docs about graceful degration. - -// TODO: some components dont have validation functions. They should not be able -// to specify one in the builder. - -// TODO: add button - pub enum GridFormStylingAttributes { Width(u32), } @@ -31,20 +18,12 @@ impl FormStyle for GridFormStyle { type StylingAttributes = GridFormStylingAttributes; fn form_frame(&self, children: View) -> View { - view! { -
- {children} -
- } + view! {
{children}
} .into_view() } fn heading(&self, control: ControlRenderData) -> View { - view! { -

- {&control.data.title} -

- } + view! {

{&control.data.title}

} .into_view() } @@ -66,25 +45,24 @@ impl FormStyle for GridFormStyle { view! {
-
- +
} .into_view() @@ -117,31 +95,26 @@ impl FormStyle for GridFormStyle { view! {
- {control.data.label} - {move || validation_state.get().err()} - + {control.data.label} + {move || validation_state.get().err()} +
} .into_view() } fn submit(&self, control: ControlRenderData) -> View { - view! { - - } + view! { } .into_view() } @@ -154,17 +127,18 @@ impl FormStyle for GridFormStyle { ) -> View { view! {
- {move || format!("{:?}", validation_state.get())} - +
} .into_view() @@ -179,9 +153,7 @@ impl FormStyle for GridFormStyle { _control: ControlRenderData, value_getter: Signal, ) -> View { - view! { - - } + view! { } .into_view() } @@ -213,13 +185,21 @@ impl FormStyle for GridFormStyle { let o_clone1 = o.clone(); let o_clone2 = o.clone(); view! { - - + /> +
} }) @@ -228,14 +208,15 @@ impl FormStyle for GridFormStyle { view! {
-
-
+
{buttons_view}
@@ -258,7 +239,7 @@ impl FormStyle for GridFormStyle { view! {
-
@@ -298,18 +280,21 @@ impl FormStyle for GridFormStyle { view! {
-
-
@@ -321,9 +306,7 @@ impl FormStyle for GridFormStyle { _control: ControlRenderData, value_getter: Signal, ) -> View { - view! { -
{move || value_getter.get()}
- } + view! {
{move || value_getter.get()}
} .into_view() } @@ -344,14 +327,17 @@ impl FormStyle for GridFormStyle { view! {
-
- ().ok(); @@ -359,6 +345,7 @@ impl FormStyle for GridFormStyle { value_setter(value); } } + class="form_input" />