qlik-oss / nebula.js

Product and framework agnostic integration APIs for Qlik's Associative Engine
https://qlik.dev/extend/set-up-nebula-environment/
MIT License
78 stars 56 forks source link

refactor: generalize selection styling logic #1563

Closed haxxmaxx closed 3 months ago

haxxmaxx commented 3 months ago

Motivation

I'm working on adding theme support for selection colors in listbox. Given that there will be even more logic to get the correct background and font colors, I have "prefactored" the logic to be more general. All 5 different selection states maps really well to the prop names on sprout, the layout, and the theme (except for palette.selected.main...)

To me this is as readable as before, but more compact and easier to change the logic later.

Requirements checklist

When build and tests have passed:

veinfors commented 3 months ago

Would be nice with some test case (maybe a rendering test) for this functionality...