Skip to content

Commit ddc1e39

Browse files
feat(ui5-popup): аdd default responsive paddings (#4567)
* feat(ui5-popup): Add default responsive paddings Default responsive paddings for the content are added for all popups. In the controls that they are not needed they are removed. In addition for Dialog's Header and Footer are added responsive paddings. Sample with way to remove the paddings by the user added in the test pages. Example with removed TabContainer's content paddings added. Fixes: #4402 * "part" atribute added to the Header and Footer of the Dialog * ViewSettingsDialog unwanted shadow removed Header styles of Dialog moved to PopupsCommon * ViewSettingsDialog.css - declaration moved * ValueStateMessage min height fixed * in CSS: some selectors changed from tag to attribute * - SuggestionPopover paddings on mobile fixed with experimental attribute "exportparts" - Test page for Popups fixed - ResizeHandlers reworked for Dialog and Popover - Min height removed for Header and Footer removed as it causes issues * Resizable Dialog positioning when resize fixed. * ViewSettingsDialog, Dialog and Suggestion popover styles adjusted * "no-padding" attribute removed since is not needed anymore * hash is edited * ResponsivePopover header fixed * Typo fixed * MultiInput's tokenizer's dialog paddings removed from header and footer (for mobile and desktop) * ColorPalettePopover and BarcodeScanner paddings in header and footer adjusted * - TokenizerPopover.css file created - Some styles and tests adjusted
1 parent cf45552 commit ddc1e39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+402
-92
lines changed

packages/fiori/src/WizardPopover.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
@ui5-after-close={{_afterClosePopover}}
77
content-only-on-desktop
88
prevent-focus-restore
9-
with-padding
109
_hide-header
1110
>
1211
<ul class="ui5-wizard-responsive-popover-list">

packages/fiori/src/themes/BarcodeScannerDialog.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@
1414
display: flex;
1515
justify-content: flex-end;
1616
width: 100%;
17-
padding: 0 0.5rem 0 0;
18-
}
19-
20-
[dir="rtl"] .ui5-barcode-scanner-dialog-footer {
21-
padding: 0 0 0 0.5rem;
2217
}
2318

2419
/* busy indicator */

packages/fiori/src/themes/ViewSettingsDialog.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99

1010
.ui5-vsd-header > [ui5-bar] {
1111
height: 4rem;
12+
box-shadow: none;
13+
}
14+
15+
.ui5-vsd-content {
16+
margin: 0 -1rem;
1217
}
1318

1419
.ui5-vsd-title {
@@ -54,3 +59,8 @@
5459
overflow: hidden;
5560
}
5661

62+
[ui5-dialog]::part(content) {
63+
padding-top: 0;
64+
padding-bottom: 0;
65+
}
66+

packages/fiori/src/themes/WizardPopover.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515

1616
.ui5-wizard-dialog .ui5-wizard-responsive-popover-list [ui5-button] {
1717
width: 100%;
18-
}
18+
}

packages/fiori/test/pages/styles/Wizard_test.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,7 @@ html, body {
5656
background-color: red;
5757
display: none;
5858
}
59+
60+
#dialog::part(content) {
61+
padding: 0;
62+
}

packages/main/src/BreadcrumbsPopover.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
content-only-on-desktop
44
placement-type="Bottom"
55
horizontal-align="Left"
6-
with-padding
76
_hide-header
87
@keydown="{{_onkeydown}}">
98
<ui5-list mode="SingleSelect"

packages/main/src/ComboBoxPopover.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@
102102
skip-registry-update
103103
_disable-initial-focus
104104
prevent-focus-restore
105-
no-padding
106105
hide-arrow
107106
class="ui5-valuestatemessage-popover"
108107
horizontal-align="{{_valueStatePopoverHorizontalAlign}}"

packages/main/src/DatePickerPopover.hbs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
horizontal-align="Left"
66
?disable-scrolling="{{_isIE}}"
77
hide-arrow
8-
no-padding
98
?_hide-header={{_shouldHideHeader}}
109
@keydown="{{_onkeydown}}"
1110
@ui5-after-close="{{onResponsivePopoverAfterClose}}"

packages/main/src/Dialog.hbs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
id="ui5-popup-header"
88
tabindex="{{_headerTabIndex}}"
99
@keydown="{{_onDragOrResizeKeyDown}}"
10-
@mousedown="{{_onDragMouseDown}}">
10+
@mousedown="{{_onDragMouseDown}}"
11+
part="header">
1112
{{#if header.length }}
1213
<slot name="header"></slot>
1314
{{else}}
@@ -19,7 +20,7 @@
1920

2021
{{#*inline "afterContent"}}
2122
{{#if footer.length }}
22-
<footer class="ui5-popup-footer-root">
23+
<footer class="ui5-popup-footer-root" part="footer">
2324
<slot name="footer"></slot>
2425
</footer>
2526
{{/if}}

packages/main/src/Dialog.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,10 @@ class Dialog extends Popup {
269269
this._isRTL = this.effectiveDir === "rtl";
270270
this.onPhone = isPhone();
271271
this.onDesktop = isDesktop();
272-
this._detachResizeHandlers();
273272
}
274273

275-
onAfterRendering() {
274+
onEnterDOM() {
275+
super.onEnterDOM();
276276
this._attachResizeHandlers();
277277
}
278278

@@ -281,15 +281,26 @@ class Dialog extends Popup {
281281
this._detachResizeHandlers();
282282
}
283283

284+
/**
285+
* @override
286+
*/
287+
_resize() {
288+
super._resize();
289+
290+
if (this._resizeHandlersAttached) {
291+
this._center();
292+
}
293+
}
294+
284295
_attachResizeHandlers() {
285-
ResizeHandler.register(this, this._screenResizeHandler);
286-
ResizeHandler.register(document.body, this._screenResizeHandler);
287-
this._resizeHandlersAttached = true;
296+
if (!this._resizeHandlersAttached) {
297+
ResizeHandler.register(document.body, this._screenResizeHandler);
298+
this._resizeHandlersAttached = true;
299+
}
288300
}
289301

290302
_detachResizeHandlers() {
291303
if (this._resizeHandlersAttached) {
292-
ResizeHandler.deregister(this, this._screenResizeHandler);
293304
ResizeHandler.deregister(document.body, this._screenResizeHandler);
294305
this._resizeHandlersAttached = false;
295306
}

0 commit comments

Comments
 (0)