-
Notifications
You must be signed in to change notification settings - Fork 279
feat(ui5-segmented-button): add api which controls items width behavior #12415
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
4000845
feat: implement content fit
GDamyanov f6d0127
feat: truncate long texts in contentFit mode
GDamyanov 091083a
feat: dynamic text truncation
GDamyanov 384debc
chore: add todo
GDamyanov 23f7c47
refactor: make code productive
GDamyanov fb4ffb9
Merge branch 'main' into segmented-button-width-poc
GDamyanov cb46f22
Merge branch 'segmented-button-width-poc' of https://github.com/UI5/w…
GDamyanov f34a084
refactor: remove unused import
GDamyanov 850ed64
refactor: add jsdoc
GDamyanov 05d36c0
test: add cypress tests
GDamyanov 0ced16b
Merge branch 'main' into segmented-button-width-poc
GDamyanov f7cd891
refactor: add jsdoc
GDamyanov 0cd64c6
Merge branch 'main' into segmented-button-width-poc
GDamyanov 9032538
Merge branch 'main' into segmented-button-width-poc
GDamyanov 1a99f0d
Update packages/main/src/types/SegmentedButtonContentMode.ts
GDamyanov a6a3988
Merge branch 'main' into segmented-button-width-poc
GDamyanov 5e8a555
Merge branch 'main' into segmented-button-width-poc
hinzzx 81f7845
feat: add sample in playground
GDamyanov cfeaca9
Merge branch 'main' into segmented-button-width-poc
GDamyanov 0b0e558
fix: import sample
GDamyanov 0109951
Merge branch 'segmented-button-width-poc' of https://github.com/UI5/w…
GDamyanov f722aa0
Merge branch 'main' into segmented-button-width-poc
GDamyanov c638232
fix: refactor jsdocs
GDamyanov cc7f212
refactor: extract class in template
GDamyanov abab751
Merge branch 'main' into segmented-button-width-poc
GDamyanov 152c7cd
Merge branch 'main' into segmented-button-width-poc
GDamyanov e9439c0
Merge branch 'main' into segmented-button-width-poc
GDamyanov d934e39
Merge branch 'main' into segmented-button-width-poc
GDamyanov d409c43
Merge branch 'main' into segmented-button-width-poc
GDamyanov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* Different SegmentedButton items sizing modes. | ||
* @public | ||
*/ | ||
enum SegmentedButtonContentMode { | ||
/** | ||
* Each item is sized to fit its content, with any extra space placed after the last item. | ||
* @public | ||
*/ | ||
ContentFit = "ContentFit", | ||
/** | ||
* All items are sized equally to fill the available space. | ||
* @public | ||
*/ | ||
EqualSized = "EqualSized", | ||
} | ||
|
||
export default SegmentedButtonContentMode; |
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
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
4 changes: 4 additions & 0 deletions
4
packages/website/docs/_samples/main/SegmentedButton/ContentModes/ContentModes.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import html from '!!raw-loader!./sample.html'; | ||
import js from '!!raw-loader!./main.js'; | ||
|
||
<Editor html={html} js={js} /> |
6 changes: 6 additions & 0 deletions
6
packages/website/docs/_samples/main/SegmentedButton/ContentModes/main.js
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import "@ui5/webcomponents/dist/SegmentedButton.js"; | ||
import "@ui5/webcomponents/dist/SegmentedButtonItem.js"; | ||
import "@ui5/webcomponents-icons/dist/bold-text.js"; | ||
import "@ui5/webcomponents-icons/dist/underline-text.js"; | ||
import "@ui5/webcomponents-icons/dist/italic-text.js"; | ||
import "@ui5/webcomponents/dist/Title.js"; |
38 changes: 38 additions & 0 deletions
38
packages/website/docs/_samples/main/SegmentedButton/ContentModes/sample.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!-- playground-fold --> | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Sample</title> | ||
</head> | ||
|
||
<body style="background-color: var(--sapBackgroundColor)"> | ||
<!-- playground-fold-end --> | ||
<ui5-title>Content Mode: ContentFit</ui5-title> | ||
<br> | ||
<ui5-segmented-button accessible-name="Font style" content-mode="ContentFit"> | ||
<ui5-segmented-button-item selected>Map</ui5-segmented-button-item> | ||
<ui5-segmented-button-item>Some Big Satellite</ui5-segmented-button-item> | ||
<ui5-segmented-button-item>Terrain</ui5-segmented-button-item> | ||
<ui5-segmented-button-item tooltip="Italic" icon="italic-text"></ui5-segmented-button-item> | ||
</ui5-segmented-button> | ||
|
||
<br><br> | ||
|
||
<ui5-title>Content Mode: EqualSized</ui5-title> | ||
<br> | ||
<ui5-segmented-button accessible-name="Font style" content-mode="EqualSized"> | ||
<ui5-segmented-button-item selected>Map</ui5-segmented-button-item> | ||
<ui5-segmented-button-item>Some Big Satellite</ui5-segmented-button-item> | ||
<ui5-segmented-button-item>Terrain</ui5-segmented-button-item> | ||
<ui5-segmented-button-item tooltip="Italic" icon="italic-text"></ui5-segmented-button-item> | ||
</ui5-segmented-button> | ||
|
||
<!-- playground-fold --> | ||
<script type="module" src="main.js"></script> | ||
</body> | ||
|
||
</html> | ||
<!-- playground-fold-end --> |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing closing brace for the if statement. The code block should be properly closed.
Copilot uses AI. Check for mistakes.