-
Notifications
You must be signed in to change notification settings - Fork 281
feat(ui5-popover): implement resizable popover #12623
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
Open
TeodorTaushanov
wants to merge
42
commits into
main
Choose a base branch
from
popover_resize
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 36 commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
02b434b
chore: add test page
TeodorTaushanov ceab536
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 4f1068a
chore: improve test page
TeodorTaushanov 5f08774
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov d5f7f45
chore: render the resize corner icon
TeodorTaushanov d33a75f
chore: add ResizeHandlePlacement
TeodorTaushanov 438208b
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 1882499
chore: add some resizing structure
TeodorTaushanov ae3b66b
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov ef6b0cd
chore: calc resizeHandlePlacement
TeodorTaushanov a167b86
chore: improve calculations
TeodorTaushanov 7f946d3
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 6398e8e
chore: handle min sizes
TeodorTaushanov 666b5d1
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 1161353
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov bb5f509
fix: resize icon placing in rtl mode
TeodorTaushanov 1a05a21
fix: resize positioning when centered
TeodorTaushanov 98d4d7d
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov bf1d23d
fix: fix re-resizing
TeodorTaushanov 48abe1b
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 090e002
fix: clicking outside the resize handle icon
TeodorTaushanov c27c937
fix: lint error
TeodorTaushanov 99b6fe9
chore: rename props
TeodorTaushanov a49c512
chore: add tests
TeodorTaushanov 605912f
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 41cf755
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 19a4c91
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 0d7339b
chore: fix tests
TeodorTaushanov ad0f12c
chore: improve tests
TeodorTaushanov f1942bd
chore: improve tests
TeodorTaushanov 506eac9
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 27c237d
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov a3dbd62
chore: override styles like in the Dialog
TeodorTaushanov 6d543d9
chore: add public sample
TeodorTaushanov 5161217
chore: fix typo
TeodorTaushanov 5bb57bf
chore: improve public sample
TeodorTaushanov a0f162f
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov 81110fc
chore: address code comments
TeodorTaushanov d8cacf2
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov f4e2455
chore: lower the flickering during resize
TeodorTaushanov 54f49f8
Merge remote-tracking branch 'origin/main' into popover_resize
TeodorTaushanov c620987
chore: fix resizeHandlePlacement in RTL
TeodorTaushanov 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,94 @@ | ||
| <!DOCTYPE html> | ||
| <html class="popover1auto"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
| <title>Popover Resize</title> | ||
|
|
||
| <script data-ui5-config type="application/json"> | ||
| { | ||
| "language": "EN", | ||
| "libs": "sap.ui.webc.main" | ||
| } | ||
| </script> | ||
| <script src="%VITE_BUNDLE_PATH%" type="module"></script> | ||
| <link rel="stylesheet" type="text/css" href="./styles/PopoverResize.css"> | ||
| <script> | ||
| document.addEventListener('DOMContentLoaded', function () { | ||
| buttonId.onclick = function () { | ||
| popoverId.open = true; | ||
| }; | ||
|
|
||
| placementSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.placement = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| hAlignSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.horizontalAlign = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| vAlignSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.verticalAlign = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| hideArrowSwitch.addEventListener("ui5-change", event => { | ||
| popoverId.hideArrow = hideArrowSwitch.checked; | ||
| }) | ||
| }); | ||
| </script> | ||
| </head> | ||
|
|
||
| <body class="sapUiSizeCompact"> | ||
| <div class="pageContainer"> | ||
| <ui5-title level="H1">Popover Resize</ui5-title> | ||
| <div class="popoverSettings"> | ||
| <div> | ||
| <ui5-label for="placementSwitch" show-colon>Placement</ui5-label> | ||
| <ui5-segmented-button id="placementSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Start">Start</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="End" selected>End</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Top">Top</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Bottom">Bottom</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="hAlignSwitch" show-colon>Horizontal Align</ui5-label> | ||
| <ui5-segmented-button id="hAlignSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Center" selected>Center</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Start">Start</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="End">End</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Stretch">Stretch</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="vAlignSwitch" show-colon>Vertical Align</ui5-label> | ||
| <ui5-segmented-button id="vAlignSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Center" selected>Center</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Top">Top</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Bottom">Bottom</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Stretch">Stretch</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="hideArrowSwitch" show-colon>Hide Arrow</ui5-label> | ||
| <ui5-switch id="hideArrowSwitch"></ui5-switch> | ||
| </div> | ||
| </div> | ||
| <div class="popoverOpenerContainer"> | ||
| <ui5-button id="buttonId">Open Popover</ui5-button> | ||
| <ui5-popover id="popoverId" | ||
| resizable | ||
| opener="buttonId" | ||
| header-text="Popover"> | ||
| <div> | ||
| This is a Popover control. | ||
| </div> | ||
| <ui5-bar slot="footer" design="Footer"> | ||
| <ui5-button design="Emphasized" id="closeDialogStateButton" slot="endContent">OK</ui5-button> | ||
| </ui5-bar> | ||
| </ui5-popover> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </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,94 @@ | ||
| <!DOCTYPE html> | ||
| <html class="popover1auto" dir="rtl"> | ||
|
|
||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> | ||
| <title>Popover Resize in RTL mode</title> | ||
|
|
||
| <script data-ui5-config type="application/json"> | ||
| { | ||
| "language": "EN", | ||
| "libs": "sap.ui.webc.main" | ||
| } | ||
| </script> | ||
| <script src="%VITE_BUNDLE_PATH%" type="module"></script> | ||
| <link rel="stylesheet" type="text/css" href="./styles/PopoverResize.css"> | ||
| <script> | ||
| document.addEventListener('DOMContentLoaded', function () { | ||
| buttonId.onclick = function () { | ||
| popoverId.open = true; | ||
| }; | ||
|
|
||
| placementSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.placement = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| hAlignSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.horizontalAlign = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| vAlignSwitch.addEventListener("ui5-selection-change", event => { | ||
| popoverId.verticalAlign = event.detail.selectedItems[0].getAttribute("data-ui5-value"); | ||
| }); | ||
|
|
||
| hideArrowSwitch.addEventListener("ui5-change", event => { | ||
| popoverId.hideArrow = hideArrowSwitch.checked; | ||
| }) | ||
| }); | ||
| </script> | ||
| </head> | ||
|
|
||
| <body class="sapUiSizeCompact"> | ||
| <div class="pageContainer"> | ||
| <ui5-title level="H1">Popover Resize</ui5-title> | ||
| <div class="popoverSettings"> | ||
| <div> | ||
| <ui5-label for="placementSwitch" show-colon>Placement</ui5-label> | ||
| <ui5-segmented-button id="placementSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Start">Start</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="End" selected>End</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Top">Top</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Bottom">Bottom</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="hAlignSwitch" show-colon>Horizontal Align</ui5-label> | ||
| <ui5-segmented-button id="hAlignSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Center" selected>Center</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Start">Start</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="End">End</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Stretch">Stretch</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="vAlignSwitch" show-colon>Vertical Align</ui5-label> | ||
| <ui5-segmented-button id="vAlignSwitch"> | ||
| <ui5-segmented-button-item data-ui5-value="Center" selected>Center</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Top">Top</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Bottom">Bottom</ui5-segmented-button-item> | ||
| <ui5-segmented-button-item data-ui5-value="Stretch">Stretch</ui5-segmented-button-item> | ||
| </ui5-segmented-button> | ||
| </div> | ||
| <div> | ||
| <ui5-label for="hideArrowSwitch" show-colon>Hide Arrow</ui5-label> | ||
| <ui5-switch id="hideArrowSwitch"></ui5-switch> | ||
| </div> | ||
| </div> | ||
| <div class="popoverOpenerContainer"> | ||
| <ui5-button id="buttonId">Open Popover</ui5-button> | ||
| <ui5-popover id="popoverId" | ||
| resizable | ||
| opener="buttonId" | ||
| header-text="Popover"> | ||
| <div> | ||
| This is a Popover control. | ||
| </div> | ||
| <ui5-bar slot="footer" design="Footer"> | ||
| <ui5-button design="Emphasized" id="closeDialogStateButton" slot="endContent">OK</ui5-button> | ||
| </ui5-bar> | ||
| </ui5-popover> | ||
| </div> | ||
| </div> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.