Skip to content
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

refactor(ui5-segmented-button): rename mode to selectionMode #8761

Merged
merged 6 commits into from
Apr 24, 2024

Conversation

tsanislavgatev
Copy link
Contributor

@tsanislavgatev tsanislavgatev commented Apr 15, 2024

Change the enum name from SegmentedButtonMode to SegmentedButtonSelectionMode.
The options in the enum are changed from SingleSelect and MultiSelect to Single and Multiple.
The mode property of SegmentedButton is changed to selectionMode.
Also deleted deprecated getter - selectedItem and deprecated event detail selectedItem.

BREAKING CHANGE: The mode property is changed to SelectionMode and the values it take from SingleSelect and MultiSelect to Single and Multiple. Also deleted deprecated getter - selectedItem and deprecated event detail selectedItem and now can be used with the selectedItems getter and selectedItems event detail.

Previously the application developers could set the selection mode as follows:

<ui5-segmented-button id="segButtonMulti" mode="MultiSelect">
  <ui5-segmented-button-item>Item</ui5-segmented-button-item>
  <ui5-segmented-button-item>Item</ui5-segmented-button-item>
  <ui5-segmented-button-item>Click</ui5-segmented-button-item>
  <ui5-segmented-button-item>SegmentedButtonItem</ui5-segmented-button-item>
</ui5-segmented-button>

Now the application developers could set the selection mode as follows:

<ui5-segmented-button id="segButtonMulti" selection-mode="Multiple">
  <ui5-segmented-button-item>Item</ui5-segmented-button-item>
  <ui5-segmented-button-item>Item</ui5-segmented-button-item>
  <ui5-segmented-button-item>Click</ui5-segmented-button-item>
  <ui5-segmented-button-item>SegmentedButtonItem</ui5-segmented-button-item>
</ui5-segmented-button>

Related to: #8461

@tsanislavgatev tsanislavgatev marked this pull request as draft April 15, 2024 12:32
@unazko unazko self-requested a review April 18, 2024 07:44
@tsanislavgatev tsanislavgatev changed the title refactor(ui5-segmentedbutton): rename api refactor(ui5-segmented-button): rename api Apr 18, 2024
@tsanislavgatev tsanislavgatev changed the title refactor(ui5-segmented-button): rename api refactor(ui5-segmented-button): rename mode to selectionMode Apr 22, 2024
@unazko
Copy link
Contributor

unazko commented Apr 22, 2024

The breaking change would be about the changing the name of the selection property to selectionMode and the type it takes.
It has to be adjusted in the PR message.

@unazko unazko marked this pull request as ready for review April 24, 2024 04:38
@tsanislavgatev tsanislavgatev merged commit 4be1540 into main Apr 24, 2024
9 checks passed
@tsanislavgatev tsanislavgatev deleted the segm-button-api-rename branch April 24, 2024 12:30
@ilhan007
Copy link
Member

Hi @tsanislavgatev
shouldn't you also update the oficial samples, the MultiSelect sample is currently broken after this change:
https://sap.github.io/ui5-webcomponents/nightly/components/SegmentedButton/#selection-modes

@ilhan007
Copy link
Member

The issue will be fixed in https://github.com/SAP/ui5-webcomponents/pull/8869/files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants