Skip to content

Make ControlWrapper configurable in vue-vanilla #1927

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dzikoysk opened this issue May 3, 2022 · 2 comments
Open

Make ControlWrapper configurable in vue-vanilla #1927

dzikoysk opened this issue May 3, 2022 · 2 comments

Comments

@dzikoysk
Copy link

dzikoysk commented May 3, 2022

Is your feature request related to a problem? Please describe.

We'd like to modify the the way how JsonForms Vanilla for Vue 3 renders controls, to e.g. sth like:


Label
Description
[ Control ]


Unfortunately, all built-in control renderers use ControlWrapper under the hood that defines this behavior, but it's simply just a hardcoded component that we cannot modify:

<template>
<div v-if="visible" :class="styles.control.root" :id="id">
<label :for="id + '-input'" :class="styles.control.label">
{{ computedLabel }}
</label>
<div :class="styles.control.wrapper">
<slot></slot>
</div>
<div :class="errors ? styles.control.error : styles.control.description">
{{ errors ? errors : showDescription ? description : null }}
</div>
</div>
</template>

Describe the solution you'd like

Would be great if ControlWrapper could be provided by user in configuration or as a renderer, e.g. ControlWrapperRenderer just like any other wrapper.

Describe alternatives you've considered

At this point, we're forced to make a fork to provide desired functionality as it's probably the only way atm.

unknown-141

~ https://github.com/reposilite-playground/jsonforms

Framework

Vue 3

RendererSet

Vanilla

Additional context

No response

@sdirix
Copy link
Member

sdirix commented May 11, 2022

Hi @dzikoysk,

Thanks for the suggestion. I think this makes sense. In the renderers we could inject the control wrapper instead of hard coding it, falling back to the default control wrapper if none is injected. Then you can easily provide the wrapper from outside of JSON Forms.

Would you be able to contribute this?

@dzikoysk
Copy link
Author

dzikoysk commented May 11, 2022

Unfortunately I'm not that experienced with JsonForms & TypeScript to provide convenient solution - it took me a while to apply some hardcoded changes to the codebase, and I'd lie if I'd tell that all of them even work 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants