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

feat(ui5-popup): аdd default responsive paddings #4567

Merged
merged 33 commits into from
Feb 15, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
c197f2f
feature(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 12, 2022
373563e
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Jan 13, 2022
5f18e7f
feature(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 13, 2022
cc17c09
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 17, 2022
bb765f8
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 17, 2022
e0a1f79
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 17, 2022
b709f1f
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 19, 2022
0d3cf4e
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 24, 2022
5b1b1cf
feat(ui5-popup): Add default responsive paddings
LidiyaGeorgieva Jan 24, 2022
0907621
"part" atribute added to the Header and Footer of the Dialog
LidiyaGeorgieva Jan 25, 2022
f4fb306
ViewSettingsDialog unwanted shadow removed
LidiyaGeorgieva Jan 25, 2022
88c211e
ViewSettingsDialog.css - declaration moved
LidiyaGeorgieva Jan 25, 2022
36a07ce
ValueStateMessage min height fixed
LidiyaGeorgieva Jan 25, 2022
38b56a9
in CSS: some selectors changed from tag to attribute
LidiyaGeorgieva Jan 26, 2022
49e12ed
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Jan 27, 2022
ce1fb17
- SuggestionPopover paddings on mobile fixed with experimental attrib…
LidiyaGeorgieva Jan 27, 2022
3fef673
Resizable Dialog positioning when resize fixed.
LidiyaGeorgieva Jan 28, 2022
b7947e8
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Jan 28, 2022
d2d6e26
- ViewSettingsDialog, Dialog and Suggestion popover styles adjusted
LidiyaGeorgieva Jan 31, 2022
f99e83b
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Jan 31, 2022
2cff4f2
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 3, 2022
a559ead
"no-padding" attribute removed since is not needed anymore
LidiyaGeorgieva Feb 3, 2022
fa9bf77
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 3, 2022
f8a733b
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 4, 2022
7ed52b8
- hash is edited
LidiyaGeorgieva Feb 4, 2022
ba219bd
ResponsivePopover header fixed
LidiyaGeorgieva Feb 7, 2022
1efe1fe
Typo fixed
LidiyaGeorgieva Feb 7, 2022
887d4b1
MultiInput's tokenizer's dialog paddings removed from header and foot…
LidiyaGeorgieva Feb 7, 2022
7aec376
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 7, 2022
b4a1a0b
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 8, 2022
e586d45
Merge branch 'master' of https://github.com/SAP/ui5-webcomponents int…
LidiyaGeorgieva Feb 14, 2022
23a2c61
ColorPalettePopover and BarcodeScanner paddings in header and footer …
LidiyaGeorgieva Feb 14, 2022
a486b91
- TokenizerPopover.css file created
LidiyaGeorgieva Feb 15, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/fiori/src/WizardPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
@ui5-after-close={{_afterClosePopover}}
content-only-on-desktop
LidiyaGeorgieva marked this conversation as resolved.
Show resolved Hide resolved
prevent-focus-restore
with-padding
_hide-header
>
<ul class="ui5-wizard-responsive-popover-list">
Expand Down
6 changes: 6 additions & 0 deletions packages/fiori/src/themes/ViewSettingsDialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

.ui5-vsd-header > [ui5-bar] {
height: 4rem;
box-shadow: none;
}

.ui5-vsd-title {
Expand Down Expand Up @@ -54,3 +55,8 @@
overflow: hidden;
}

ui5-dialog::part(content) {
margin-left: -1rem;
margin-right: -1rem;
}

1 change: 0 additions & 1 deletion packages/main/src/BreadcrumbsPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
content-only-on-desktop
placement-type="Bottom"
horizontal-align="Left"
with-padding
_hide-header
@keydown="{{_onkeydown}}">
<ui5-list mode="SingleSelect"
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/DatePickerPopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
horizontal-align="Left"
?disable-scrolling="{{_isIE}}"
hide-arrow
with-padding
?_hide-header={{_shouldHideHeader}}
@keydown="{{_onkeydown}}"
@ui5-after-close="{{onResponsivePopoverAfterClose}}"
Expand Down
5 changes: 3 additions & 2 deletions packages/main/src/Dialog.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
id="ui5-popup-header"
tabindex="{{_headerTabIndex}}"
@keydown="{{_onDragOrResizeKeyDown}}"
@mousedown="{{_onDragMouseDown}}">
@mousedown="{{_onDragMouseDown}}"
part="header">
{{#if header.length }}
<slot name="header"></slot>
{{else}}
Expand All @@ -19,7 +20,7 @@

{{#*inline "afterContent"}}
{{#if footer.length }}
<footer class="ui5-popup-footer-root">
<footer class="ui5-popup-footer-root" part="footer">
<slot name="footer"></slot>
</footer>
{{/if}}
Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,10 @@ class Dialog extends Popup {
this._isRTL = this.effectiveDir === "rtl";
this.onPhone = isPhone();
this.onDesktop = isDesktop();
this._detachResizeHandlers();
}

onAfterRendering() {
onEnterDOM() {
super.onEnterDOM();
this._attachResizeHandlers();
}

Expand Down
4 changes: 2 additions & 2 deletions packages/main/src/Popover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<span class="ui5-popover-arrow" style="{{styles.arrow}}"></span>

{{#if _displayHeader}}
<header class="ui5-popup-header-root" id="ui5-popup-header">
<header class="ui5-popup-header-root" id="ui5-popup-header" part="header">
{{#if header.length }}
<slot name="header"></slot>
{{else}}
Expand All @@ -17,7 +17,7 @@
{{#*inline "afterContent"}}
{{#if _displayFooter}}
{{#if footer.length }}
<footer class="ui5-popup-footer-root">
<footer class="ui5-popup-footer-root" part="footer">
<slot name="footer"></slot>
</footer>
{{/if}}
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/Popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,12 @@ class Popover extends Popup {
}

onEnterDOM() {
super.onEnterDOM();
ResizeHandler.register(this, this._handleResize);
}

onExitDOM() {
super.onExitDOM();
ResizeHandler.deregister(this, this._handleResize);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/Popup.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

{{> beforeContent}}

<div style="{{styles.content}}" class="{{classes.content}}" @scroll="{{_scroll}}">
<div style="{{styles.content}}" class="{{classes.content}}" @scroll="{{_scroll}}" part="content">
<slot></slot>
</div>

Expand Down
26 changes: 26 additions & 0 deletions packages/main/src/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/Ari
import { hasStyle, createStyle } from "@ui5/webcomponents-base/dist/ManagedStyles.js";
import { isTabPrevious } from "@ui5/webcomponents-base/dist/Keys.js";
import { getNextZIndex, getFocusedElement, isFocusedElementWithinNode } from "@ui5/webcomponents-base/dist/util/PopupUtils.js";
import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js";
import MediaRange from "@ui5/webcomponents-base/dist/MediaRange.js";
import PopupTemplate from "./generated/templates/PopupTemplate.lit.js";
import PopupBlockLayer from "./generated/templates/PopupBlockLayerTemplate.lit.js";
import { addOpenedPopup, removeOpenedPopup } from "./popup-utils/OpenedPopupsRegistry.js";
Expand Down Expand Up @@ -94,6 +96,16 @@ const metadata = {
defaultValue: "",
},

/**
* Defines the current media query size.
*
* @type {string}
* @private
*/
mediaRange: {
type: String,
},

/**
* @private
*/
Expand Down Expand Up @@ -200,6 +212,12 @@ const bodyScrollingBlockers = new Set();
* @public
*/
class Popup extends UI5Element {
constructor() {
super();

this._resizeHandler = this._resize.bind(this);
}

static get metadata() {
return metadata;
}
Expand Down Expand Up @@ -228,19 +246,27 @@ class Popup extends UI5Element {
if (!this.isOpen()) {
this._blockLayerHidden = true;
}

ResizeHandler.register(this, this._resizeHandler);
}

onExitDOM() {
if (this.isOpen()) {
Popup.unblockBodyScrolling(this);
this._removeOpenedPopup();
}

ResizeHandler.deregister(this, this._resizeHandler);
}

get _displayProp() {
return "block";
}

_resize() {
this.mediaRange = MediaRange.getCurrentRange(MediaRange.RANGESETS.RANGE_4STEPS, this.getDomRef().offsetWidth);
}

/**
* Prevents the user from interacting with the content under the block layer
*/
Expand Down
1 change: 0 additions & 1 deletion packages/main/src/ResponsivePopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<ui5-dialog
accessible-name={{accessibleName}}
accessible-name-ref={{accessibleNameRef}}
?with-padding={{withPadding}}
stretch
_disable-initial-focus
@ui5-before-open="{{_propagateDialogEvent}}"
Expand Down
9 changes: 0 additions & 9 deletions packages/main/src/ResponsivePopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ import ResponsivePopoverCss from "./generated/themes/ResponsivePopover.css.js";
const metadata = {
tag: "ui5-responsive-popover",
properties: /** @lends sap.ui.webcomponents.main.ResponsivePopover.prototype */ {

/**
* Defines if padding would be added around the content.
* @private
*/
withPadding: {
type: Boolean,
},

/**
* Defines if only the content would be displayed (without header and footer) in the popover on Desktop.
* By default both the header and footer would be displayed.
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/TabContainer.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
</div>

{{#*inline "contentArea"}}
<div class="{{classes.content}}">
<div class="{{classes.content}}" part="content">
{{#each items}}
{{#unless this.isSeparator}}
<div
Expand Down
6 changes: 5 additions & 1 deletion packages/main/src/themes/ColorPalettePopover.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,8 @@
margin: 0.1875rem 1rem;
margin-left: 0.5rem;
margin-right: 0.5rem;
}
}

ui5-responsive-popover::part(content) {
padding: 0;
}
4 changes: 4 additions & 0 deletions packages/main/src/themes/DatePickerPopover.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,7 @@
display: flex;
justify-content: center;
}

ui5-responsive-popover::part(content) {
padding: 0;
}
7 changes: 2 additions & 5 deletions packages/main/src/themes/Dialog.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
border-radius: 0;
}

.ui5-popup-header-root {
background: var(--sapPageHeader_Background);
}

:host([draggable]) .ui5-popup-header-root,
:host([draggable]) ::slotted([slot="header"]) {
cursor: move;
Expand Down Expand Up @@ -67,4 +63,5 @@
left: -0.25rem;
right: unset;
cursor: sw-resize;
}
}

1 change: 0 additions & 1 deletion packages/main/src/themes/MultiComboBox.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

:host(:not([hidden])) {
display: inline-block;
--_ui5_popup_content_padding: 0;
}

.ui5-multi-combobox-root {
Expand Down
2 changes: 1 addition & 1 deletion packages/main/src/themes/Popover.css
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@

.ui5-popover-root {
min-width: 6.25rem;
}
}
47 changes: 46 additions & 1 deletion packages/main/src/themes/PopupsCommon.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
overflow: auto;

/* Consider how to make this top level */
padding: var(--_ui5_popup_content_padding);
box-sizing: border-box;
}

Expand Down Expand Up @@ -85,3 +84,49 @@
:host([disable-scrolling]) .ui5-popup-content {
overflow: hidden;
}

/*** Responsive paddings for the content***/
:host([media-range="S"]) .ui5-popup-content {
padding: 1rem var(--_ui5_popup_content_padding_s);
LidiyaGeorgieva marked this conversation as resolved.
Show resolved Hide resolved
}

:host([media-range="M"]) .ui5-popup-content,
:host([media-range="L"]) .ui5-popup-content {
padding: 1rem var(--_ui5_popup_content_padding_m_l);
}

:host([media-range="XL"]) .ui5-popup-content {
padding: 1rem var(--_ui5_popup_content_padding_xl);
}

.ui5-popup-footer-root {
min-height: 2.5rem;
justify-content: end;
}

.ui5-popup-header-root {
background: var(--sapPageHeader_Background);
min-height: 2.5rem;
justify-content: start;
}

/*** Responsive paddings for the Header and Footer ***/
:host([media-range="S"]) .ui5-popup-header-root,
:host([media-range="S"]) .ui5-popup-footer-root {
padding-left: var(--_ui5_popup_header_footer_padding_s);
padding-right: var(--_ui5_popup_header_footer_padding_s);
}

:host([media-range="M"]) .ui5-popup-header-root,
:host([media-range="L"]) .ui5-popup-header-root,
:host([media-range="M"]) .ui5-popup-footer-root,
:host([media-range="L"]) .ui5-popup-footer-root {
padding-left: var(--_ui5_popup_header_footer_padding_m_l);
padding-right: var(--_ui5_popup_header_footer_padding_m_l);
}

:host([media-range="XL"]) .ui5-popup-header-root,
:host([media-range="XL"]) .ui5-popup-footer-root {
padding-left: var(--_ui5_popup_header_footer_padding_xl);
padding-right: var(--_ui5_popup_header_footer_padding_xl);
}
4 changes: 0 additions & 4 deletions packages/main/src/themes/ResponsivePopover.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
min-height: 2rem;
}

:host(:not([with-padding])) {
--_ui5_popup_content_padding: 0;
}

:host([opened]) {
display: inline-block;
}
Expand Down
2 changes: 2 additions & 0 deletions packages/main/src/themes/ResponsivePopoverCommon.css
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,5 @@
position: absolute;
right: 1rem;
}


6 changes: 5 additions & 1 deletion packages/main/src/themes/SelectPopover.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,8 @@
.ui5-select-popover [ui5-li]:last-child::part(native-li)::after {
border-bottom-left-radius: var(--_ui5_select_option_focus_border_radius);
border-bottom-right-radius: var(--_ui5_select_option_focus_border_radius);
}
}

.ui5-select-popover::part(content) {
padding: 0;
}
6 changes: 5 additions & 1 deletion packages/main/src/themes/Suggestions.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@
.ui5-tokenizer-list [ui5-li][focused]:last-child::part(native-li)::after {
border-bottom-left-radius: var(--_ui5_suggestions_item_focus_border_radius);
border-bottom-right-radius: var(--_ui5_suggestions_item_focus_border_radius);
}
}

.ui5-suggestions-popover::part(content) {
padding: 0;
}
6 changes: 5 additions & 1 deletion packages/main/src/themes/TabInOverflow.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,8 @@
.ui5-tab-container-responsive-popover [ui5-li-custom][focused]:last-child::part(native-li)::after {
border-bottom-left-radius: var(--_ui5_tc_overflowItem_focus_border);
border-bottom-right-radius: var(--_ui5_tc_overflowItem_focus_border);
}
}

.ui5-tab-container-responsive-popover::part(content) {
padding: 0;
}
4 changes: 4 additions & 0 deletions packages/main/src/themes/TimePickerPopover.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@
margin: 1%;
min-width: 20%;
}

.ui5-time-picker-popover::part(content) {
padding: 0;
}
13 changes: 13 additions & 0 deletions packages/main/src/themes/ValueStateMessage.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,16 @@
outline: var(--sapContent_FocusWidth) var(--sapContent_FocusStyle) var(--sapContent_FocusColor);
border-radius: var(--_ui5_value_state_message_focus_border_radius);
}

.ui5-valuestatemessage-popover::part(header),
.ui5-valuestatemessage-popover::part(content) {
padding: 0;
LidiyaGeorgieva marked this conversation as resolved.
Show resolved Hide resolved
}

.ui5-valuestatemessage-popover::part(header) {
min-height: 0;
}

.ui5-valuestatemessage-popover::part(footer) {
min-height: 0;
}
Loading