-
Notifications
You must be signed in to change notification settings - Fork 56
Feat: Group for each color swatch #921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: Group for each color swatch #921
Conversation
|
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for the team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
|
|
I think we could handle grouping inside I tried something like this following, but then each swatch wasn't selectable because it isn't a direct child. And something like this would make it possible to make one selection in each group, but isolated from each other. @iOvergaard do you have any suggestion how we eventually can group swatches without having e.g. 50 |
…to feature/color-swatches-grouped # Conflicts: # packages/uui-color-swatches/lib/uui-color-swatches.story.ts
|
|
Hi @bjarnef We aim not to make to implementation specific code in the UI Library. In other words I think this is perfectly possible already. But is a question of the implementations reactivity and layout. The solution I think would be fine, is having a uui-color-swatches for each group. By sharing the same value of the implementation they would be 'connected' in the sense that once a user clicks a swatch of another group, the value would be changed, meaning the other groups swatches is then no longer be selected. But reading the code of uui-color-swatches it seems to me like the component is not reactive, a simple test would be: change the value, programmatically(NOT via clicking a swatch, but changing the value of the swatches component) after the elements have been appended as children. — From looking at the code it seems like changing the value does not change what is selected visually. So this is needed for this to work and for other things to work as well. So we should have that fixed, and then this would not be needed but completely up to each implementation to group/layout swatches as they want. |



Description
This PR add a group property to each color swatch, so
uui-color-swatchesshow color swatches grouped if any.Currently multi selection is possible as in render a
uui-color-swatchescomponent per group. We may need to consider this or if all should be grouped inside component?The
uui-color-swatchesas slotted content, which may be useful, but could it has default slotted content based on the array of swatches and just pass to in to a property?Types of changes
Motivation and context
How to test?
Screenshots (if appropriate)
Checklist