eclipsesource / eclipsesource/jsonforms

Support different classes for different controls

Open
#2,239 8 comments 0 reactions 0 assignees View on GitHub
help wanted vanilla vue
Dominant language
TypeScript
Stars
2.7k
Forks
424
Avg merge
17d 8h
Merged PRs (30d)
1

Description

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

I cannot use the Bootstrap classes with the Vanilla renderer because the Vanilla renderer only lets you set one class for all `input` control types.

In Bootstrap the inputs should have the `form-control` class but for checkboxes it should be `form-check-input` instead.

### Describe the solution you'd like

A way to configure different CSS classes for different input types.
https://github.com/eclipsesource/jsonforms/blob/master/packages/vue-vanilla/src/styles/defaultStyles.ts

Perhaps:
```javascript
control: {
root: 'control',
wrapper: 'wrapper',
label: 'label',
description: 'description',
input: 'input',
error: 'error',
textarea: 'text-area',
select: 'select',
option: 'option',
},
```

could be:
```javascript
control: {
root: 'control',
wrapper: 'wrapper',
label: 'label',
description: 'description',
input: {
color: 'form-control form-control-color',
checkbox: 'form-input-check',
radio: 'form-input-check',
default: 'form-control'
},
error: 'error',
textarea: 'text-area',
select: 'select',
option: 'option',
},
```

### Describe alternatives you've considered

Fork the Vanilla renderer.

### Framework

Vue 3

### RendererSet

Vanilla

### Additional context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.