feat(ui5-option-group): add support for grouped options#13467
Open
plamenivanov91 wants to merge 1 commit intomainfrom
Open
feat(ui5-option-group): add support for grouped options#13467plamenivanov91 wants to merge 1 commit intomainfrom
plamenivanov91 wants to merge 1 commit intomainfrom
Conversation
Introduces the `ui5-option-group` component, allowing options inside `ui5-select` to be organized into labeled groups. - New `ui5-option-group` component extending `ListItemGroup`, with a custom template that renders a `role="group"` container to keep group headers out of the List navigation flat array (prevents double-focus on arrow navigation) - `Select._flatOptions` getter transparently flattens grouped and non-grouped options for all internal selection/navigation logic - Per-group `aria-setsize`/`aria-posinset` injected onto options via `_forcedSetsize`/`_forcedPosinset` properties and `ListItemBaseTemplate` `injectedProps`, scoped per group as required by the ARIA spec - Invisible live-region span (`aria-describedby` on trigger) announces group count when groups are present (e.g. "4 results available in 2 groups") - New `themes/OptionGroup.css` with SAP design token-based group header styling (`--sapList_GroupHeaderBackground`, `--sapFontHeader6Size`, etc.) - New i18n key `SELECT_OPTIONS_IN_GROUPS` added to `messagebundle.properties` - Cypress tests covering: rendering, click/keyboard selection, arrow navigation across group boundaries, Home/End keys, ARIA role/label on group container, per-group aria-setsize/posinset, group count aria-describedby, and non-grouped regression Fixes for-of lint errors in `_flatOptions` and `_applyGroupAriaPositions` by switching to `flatMap` and chained `filter/forEach`.
Collaborator
|
🚀 Deployed on https://pr-13467--ui5-webcomponents-preview.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces the
ui5-option-groupcomponent, allowing options insideui5-selectto be organized into labeled groups.ui5-option-groupcomponent extendingListItemGroup, with a custom template that renders arole="group"container to keep group headers out of the List navigation flat array (prevents double-focus on arrow navigation)Select._flatOptionsgetter transparently flattens grouped and non-grouped options for all internal selection/navigation logicaria-setsize/aria-posinsetinjected onto options via_forcedSetsize/_forcedPosinsetproperties andListItemBaseTemplateinjectedProps, scoped per group as required by the ARIA specaria-describedbyon trigger) announces group count when groups are present (e.g. "4 results available in 2 groups")themes/OptionGroup.csswith SAP design token-based group header styling (--sapList_GroupHeaderBackground,--sapFontHeader6Size, etc.)SELECT_OPTIONS_IN_GROUPSadded tomessagebundle.propertiesFixes for-of lint errors in
_flatOptionsand_applyGroupAriaPositionsby switching toflatMapand chainedfilter/forEach.