Skip to content

Support different classes for different controls #2239

Open
@vanillajonathan

Description

@vanillajonathan

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:

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

could be:

  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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions