-
Notifications
You must be signed in to change notification settings - Fork 87
feat: add itemLabelGenerator property to select, combo box and multi select combo box #10066
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
base: main
Are you sure you want to change the base?
Conversation
The issue linked describes combo-box and the PR is for select, should there be another issue? |
Wouldn't the feature make sense for select, combo-box and also multi-select-combo-box? |
There are many merge conflicts, looks like the change was created from an early version where |
Yes, I will rebase on latest main |
7b1e301
to
64377b6
Compare
Was easier to code from scratch again.. |
…select-combo-box Implement itemLabelGenerator function property that allows custom label generation for items. The generator function receives an item and returns a string label, taking precedence over itemLabelPath when both are defined. - Add itemLabelGenerator to vaadin-select for custom dropdown item labels - Add itemLabelGenerator to vaadin-combo-box with support for filtering by generated labels - Multi-select-combo-box inherits itemLabelGenerator for both dropdown and chip labels - Add comprehensive tests for all three components - Update dev examples to demonstrate the new feature Fixes #8333 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Add itemLabelGenerator type definition to SelectBaseMixinClass - Add itemLabelGenerator type definition to ComboBoxItemsMixinClass - MultiSelectComboBoxMixinClass inherits the type automatically via ComboBoxItemsMixinClass 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
- Follow the existing pattern of counting overflow chip in total chip count - Use getChips() helper function consistently with existing tests - Access chip labels at correct indices (skip overflow chip at [0]) - Set proper width and await nextRender for consistent chip rendering All tests now pass: - select: 6/6 tests ✅ - combo-box: 8/8 tests ✅ - multi-select-combo-box: 9/9 tests ✅ 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
d0e011f
to
b1b9607
Compare
|
Adds a new itemLabelGenerator function property to vaadin-select that allows customizing how item labels are generated from item objects. This enables users to display custom text for items without modifying the underlying data structure.
Fixes #8333
🤖 Generated with Claude Code