MitchellMarinoDev / leptos_form_tool

A declarative way to create forms for leptos.
Other
4 stars 2 forks source link

Select Options Based on Form Data #14

Closed MitchellMarinoDev closed 2 months ago

MitchellMarinoDev commented 2 months ago

Renamed build_control to render_control in the ControlData traits.

Select options can now be based on other form data fields.

To do this, I could to do something similar to the button and create a SelectBuilder struct because with the normal ControlBuilder, you don't have access to the FormToolData (FD) signal.

Instead of having the button and select be exceptions, I changed it to be the rule. The render_control (formerly build_control) method of the ControlData traits now takes the form data signal. This means the select and button controls are no longer exceptions to the rule.

An unfortunate side effect is that the ControlData traits now needs to be generic on FD.

MitchellMarinoDev commented 2 months ago

fixes #11