infor-design / enterprise-wc

Enterprise-grade web component library for the Infor Design System
Apache License 2.0
27 stars 26 forks source link

General: Map Component's attributes available #2691

Open fabiojpoli opened 1 month ago

fabiojpoli commented 1 month ago

Is your feature request related to a problem or use case? Please describe. We are building a designer to allow user to add IDS component to the form by dragging and drop, and set attributes on the fly. However we need to let user know what are all the attributes he has available for each component, what is the default value and what are the available values for that attribute.

Describe the solution you'd like Put the map on IdsGlobal like this:

IdsGlobal.componentsAttributes = [
    {
      name: 'ids-button',
      attributes: {
         appearance: {
            value: 'default',
            options: ['default', 'primary', ...]
         },
         'css-class': {
            value: null
         },
         icon: {
            value: null
         },
         'icon-align': {
            value: 'start'
         },
         'tab-index': {
            value: 0
         },
         text: {
            value: null
         },
         type: {
            value: null
         },
         square: {
            value: false,
            type: 'boolean'
         },
         width: {
            value: null
         },
         'badge-position': {
            value: null
         },
         'badge-color': {
            value: null
         }
      }
   },
   {...},
   {...}
]

Describe alternatives you've considered For now we are populating our metadata object manually based on the documentation.

Additional context Screenshot 2024-08-07 at 4 28 20 PM

tmcconechy commented 1 month ago

The files vscode.html-custom-data.json and custom-elements.json are meant for this purpose. Not sure we want to hook everything on in the API or the code might get too big for some people.