sfxcode / formkit-primevue

PrimeVue (v4, v3) support for the FormKit validation Framwork
https://sfxcode.github.io/formkit-primevue
MIT License
103 stars 9 forks source link

No templating and customizing #5

Closed PolyAtomicIon closed 1 year ago

sfxcode commented 1 year ago

Hi, can you explain in what direction templating / customizing is missing ? Some example is needed to understand your point.

Greetings,

Tom

PolyAtomicIon commented 1 year ago

Hi, for example, I would like to make a custom dropdown component, https://www.primefaces.org/primevue/dropdown PrimeVue provides slots for templating, from the documentation: In addition value, option group, header, footer, empty filter, and empty slots are provided for further customization.

But, your formkit-primevue blocks this option as I understood, maybe you will also provide slots to customize/extend PrimeVue components regarding slots that are provided by PrimeVue.

So, After facing the problem of extending PrimeVue components directly, I tried to use a simple dropdown type, as shown in this document, https://formkit.com/inputs/dropdown, I got an error message, that says dropdown is the wrong type, and we should always use PrimeDropdown type.

By the end, I decided to not use formkit and write my own form :(

So, probably I lack some skills in using your module and I would ask for extra details about customizing PrimeVue components through templating slots.

Or we should add slots in wrapper components so that we could extend/customize them. And final option will be to allow users to use basic types, such as type="dropdown" without errors

Best wishes, I am a newbie in opening issues and leaving comments, so do not mind if I am doing something wrong

PolyAtomicIon commented 1 year ago

Here we do not have slots. https://github.com/sfxcode/formkit-primevue/blob/main/src/formkit/PrimeDropdown.vue

Here, for example, how can I provide props, such as min-date, max-date, time, etc.? How to use it efficiently with FormKitSchema? https://github.com/sfxcode/formkit-primevue/blob/main/src/formkit/PrimeCalendar.vue

sfxcode commented 1 year ago

Hi, first of all thank you for your explanation. Slots are a problem, because formkit schema form generation is a configuration based way, to define your input. So everything should be passed by the option object in your definition. For me that is the biggest point to choose formkit in only building same small option object. If you need more styling and individual slots, formkit may not be the proper solution for you. But i will think about the problem and maybe find some workaround, at the moment if i have to use a dropdown with individual content, i would make a custom formkit input maybe be extending an existing one.

Thanks for your input, Tom