Archived
generated from mitchell/rust_template
remove fd and fs from builder
This commit is contained in:
+6
-6
@@ -78,7 +78,7 @@ impl<FD: FormToolData> IntoView for Form<FD> {
|
||||
///
|
||||
/// This trait defines a function that can be used to build all the data needed
|
||||
/// to physically lay out a form, and how that data should be parsed and validated.
|
||||
pub trait FormToolData: Default + Clone + 'static {
|
||||
pub trait FormToolData: Clone + 'static {
|
||||
type Style: FormStyle;
|
||||
|
||||
/// Defines how the form should be layed out and how the data should be parsed and validated.
|
||||
@@ -97,9 +97,9 @@ pub trait FormToolData: Default + Clone + 'static {
|
||||
/// component. Call [`get_action_form`]\() to get the
|
||||
/// [`ActionForm`](leptos_router::ActionForm) version.
|
||||
fn get_form(self, action: impl ToString, style: Self::Style) -> Form<Self> {
|
||||
let builder = FormBuilder::new(self, style);
|
||||
let builder = FormBuilder::new();
|
||||
let builder = Self::build_form(builder);
|
||||
builder.build_plain_form(action.to_string())
|
||||
builder.build_plain_form(action.to_string(), self, style)
|
||||
}
|
||||
|
||||
/// Constructs a [`Form`] for this [`FormToolData`] type.
|
||||
@@ -118,9 +118,9 @@ pub trait FormToolData: Default + Clone + 'static {
|
||||
<<ServFn::Client as Client<ServFn::Error>>::Request as ClientReq<ServFn::Error>>::FormData:
|
||||
From<FormData>,
|
||||
{
|
||||
let builder = FormBuilder::new(self, style);
|
||||
let builder = FormBuilder::new();
|
||||
let builder = Self::build_form(builder);
|
||||
builder.build_action_form(action)
|
||||
builder.build_action_form(action, self, style)
|
||||
}
|
||||
|
||||
/// Gets a [`Validator`] for this [`ToolFormData`].
|
||||
@@ -132,7 +132,7 @@ pub trait FormToolData: Default + Clone + 'static {
|
||||
/// However, the code to render the views are not configured out, it
|
||||
/// simply doesn't run, so the view needs to compile even on the server.
|
||||
fn get_validator() -> FormValidator<Self> {
|
||||
let builder = FormBuilder::new(Self::default(), Self::Style::default());
|
||||
let builder = FormBuilder::new();
|
||||
let builder = Self::build_form(builder);
|
||||
builder.validator()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user