jsonforms icon indicating copy to clipboard operation
jsonforms copied to clipboard

Support icon classes

Open vanillajonathan opened this issue 1 year ago • 3 comments

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

The add, remove, move-up and move-down buttons are rather ugly with just a textual + and - sign.

Describe the solution you'd like

I would like to be able configure the Vanilla renderer to use icon classes so I can use the icons from Bootstap Icons or Font Awesome.

Describe alternatives you've considered

Fork the Vanilla renderer.

Framework

Vue 3

RendererSet

Vanilla

Additional context

No response

vanillajonathan avatar Jan 03 '24 18:01 vanillajonathan

Thanks for the suggestion. Definitely makes sense. We should use an iconClass if it's customized. When there is none, we should fallback to the textual approach.

sdirix avatar Jan 04 '24 13:01 sdirix

Hi,

it seems this affects the ArrayListRenderer and ArrayListElement. The buttons already have a class in both components, so you can already access them. You just can't access the text content yet.

      <button
        :disabled="!deleteEnabled"
        :class="styles.arrayList.itemDelete"
        type="button"
        @click="deleteClicked"
      >
        🗙
      </button>

What do you think about controlling the text via translations, like in the OneOfRenderer. So it can be changed and cleared from outside.

        <button
          ref="confirm"
          :onclick="onConfirm"
          :class="styles.dialog.buttonPrimary"
        >
          {{ control.translations.clearDialogAccept }}
        </button>

davewwww avatar Feb 09 '24 09:02 davewwww

Control the dialog via translations would be nice, but there should be a way to insert a DOM element too, not just a text string.

I need:

<button
  :disabled="!deleteEnabled"
  :class="styles.arrayList.itemDelete"
  type="button"
  @click="deleteClicked"
>
  <i class="bi bi-x-lg"></i> <!-- this one -->
</button>

vanillajonathan avatar Feb 09 '24 13:02 vanillajonathan