Aaltuj / VxFormGenerator

The library contains a component, that nests itself into the Blazor EditForm instead of a wrapper around the EditForm. The component is able to generate a form based on a POCO or a ExpandoObject. Because of this architecture the library provides the developer flexibility and direct usage of the EditForm.
MIT License
119 stars 36 forks source link

Add support for .NET Standard #7

Closed sroye98 closed 3 years ago

sroye98 commented 3 years ago

This is excellent work!

Would it be possible to add support for .NET Standard? If so we could potentially use this for Blazor WASM projects as well. I took a stab at it and was able to get it to work. Here is a link my repository. I basically copied your code and simply created .NET Standard Razor Library. It works just fine within a Blazor WASM project as well as Blazor Server project.

Also would you be able to shed some light on how to implement a different type of InputText if a POCO property were to be decorated with a DataType of Password or Email?

[DataType(DataType.Password)] public string Password { get; set; }

Also would it possible for me to help you by building out other frameworks such as Bulma or Material? I think once the Layout feature is implemented this would be an amazing next step to get other CSS frameworks working with the core library.

Aaltuj commented 3 years ago

hey @sroye98 thanks! Let me take a look at the .net standard and see what the implication are. Get back to you on that. Regarding the second question: this is not implemented yet. So there needs to be an extra check on the property if it contains a extra datatype property. However it might be more scoped and clearer interface of the options if this DataType attribute is integrated into a VxFormField attribute that could contain more settings for a specific field. But this should be discussed in a separate feature issue. See #9 .

Any help would be appreciated, integrating more css frameworks. There is some stuff that needs to be fixed in .net 5 for it could really be production ready. As stated in my medium post.

At the moment of writing the EditForm component sets an valid, modified and invalid class when a input has changed and validated. This class in hard-coded so until https://github.com/dotnet/aspnetcore/pull/24835 is accepted, merged and published. We need a workaround like the one below.

For now you could take a look a the bootstrap and the article on adding support for a new CSS framework.