mod grid_form; use std::rc::Rc; use crate::{ controls::{ button::ButtonData, checkbox::CheckboxData, heading::HeadingData, hidden::HiddenData, output::OutputData, radio_buttons::RadioButtonsData, select::SelectData, slider::SliderData, spacer::SpacerData, stepper::StepperData, submit::SubmitData, text_area::TextAreaData, text_input::TextInputData, ControlData, ControlRenderData, }, FormToolData, }; use leptos::{RwSignal, Signal, View}; pub use grid_form::{GridFormStyle, GridFormStylingAttributes}; pub trait FormStyle: 'static { type StylingAttributes; /// Render any containing components for the form. /// /// This allows you to wrap all the form components /// in another component if neccisary. /// /// Do NOT wrap it in an actual `form` element; any /// wrapping should be done with `div` or similar elements. fn form_frame(&self, form: ControlRenderData) -> View; fn heading(&self, control: Rc>) -> View; fn hidden( &self, control: Rc>, value_getter: Option>, ) -> View; fn text_input( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn text_area( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn radio_buttons( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn select( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn button( &self, control: Rc>>, data_signal: RwSignal, ) -> View; fn checkbox( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, ) -> View; fn stepper( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn output( &self, control: Rc>, value_getter: Option>, ) -> View; fn slider( &self, control: Rc>, value_getter: Signal<::ReturnType>, value_setter: Rc::ReturnType)>, validation_state: Signal>, ) -> View; fn submit(&self, control: Rc>) -> View; fn custom_component(&self, view: View) -> View; fn group(&self, group: Rc>) -> View; fn spacer(&self, control: Rc>) -> View; }