Altinn / app-frontend-react

Altinn application React frontend
BSD 3-Clause "New" or "Revised" License
18 stars 31 forks source link

`Option` component (presentation component similar to `Text`, `Number` and `Date`) #2752

Open olemartinorg opened 5 days ago

olemartinorg commented 5 days ago

Description

In the same vein as the other presentation components, we should have one for displaying a single option value (given an expression that returns an option value that matches one entry in the option list).

This should include both the option label, description and helptext button (configurable, but should probably default to show everything if given in an option list).

If we need support for showing multiple selected options in the future, we could probably call such a component Options (but that would possibly require support for lists/arrays in the expression language).

Example usage (in a table): Image

Example usage in vertical mode below a Text component (with all text resource bindings - which does not make sense, probably): Image

Example usage in vertical mode (with fewer text resource bindings): Image

Additional Information

Related:

{
  "type": "Option",
  "value": ["dataModel", "some.path"],
  "optionId": "categories"
}
olemartinorg commented 3 days ago

We had a meeting about this. Notes here: