File tree 6 files changed +102
-31
lines changed
6 files changed +102
-31
lines changed Original file line number Diff line number Diff line change 1
- <div class =" ui5-bar-root" aria-label =" {{ accInfo.label }} "
2
- role =" toolbar" >
1
+ <div
2
+ class =" ui5-bar-root"
3
+ aria-label =" {{ accInfo.label }} "
4
+ role =" toolbar"
5
+ part =" bar"
6
+ >
3
7
<div class =" ui5-bar-content-container ui5-bar-startcontent-container" >
4
8
<slot name =" startContent" ></slot >
5
9
</div >
9
13
<div class =" ui5-bar-content-container ui5-bar-endcontent-container" >
10
14
<slot name =" endContent" ></slot >
11
15
</div >
12
- </div >
16
+ </div >
Original file line number Diff line number Diff line change @@ -87,6 +87,15 @@ const metadata = {
87
87
* The middleContent will be centered in the available space between the startContent and the endContent areas,
88
88
* therefore it might not always be centered in the entire bar.
89
89
*
90
+ * <h3>CSS Shadow Parts</h3>
91
+ *
92
+ * <ui5-link target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/CSS/::part">CSS Shadow Parts</ui5-link> allow developers to style elements inside the Shadow DOM.
93
+ * <br>
94
+ * The <code>ui5-bar</code> exposes the following CSS Shadow Parts:
95
+ * <ul>
96
+ * <li>bar - Used to style the wrapper of the content of the component</li>
97
+ * </ul>
98
+ *
90
99
* <h3>ES6 Module Import</h3>
91
100
*
92
101
* <code>import "@ui5/webcomponents-fiori/dist/Bar.js";</code>
Original file line number Diff line number Diff line change 1
1
import UI5Element from "@ui5/webcomponents-base/dist/UI5Element.js" ;
2
2
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js" ;
3
+ import ResizeHandler from "@ui5/webcomponents-base/dist/delegate/ResizeHandler.js" ;
4
+ import MediaRange from "@ui5/webcomponents-base/dist/MediaRange.js" ;
3
5
import PageBackgroundDesign from "./types/PageBackgroundDesign.js" ;
4
6
5
7
// Template
@@ -71,6 +73,17 @@ const metadata = {
71
73
hideFooter : {
72
74
type : Boolean ,
73
75
} ,
76
+
77
+ /**
78
+ * Defines the current media query size.
79
+ *
80
+ * @type {string }
81
+ * @private
82
+ * @since 1.0.0-rc.15
83
+ */
84
+ mediaRange : {
85
+ type : String ,
86
+ } ,
74
87
} ,
75
88
76
89
slots : /** @lends sap.ui.webcomponents.fiori.Page.prototype */ {
@@ -163,6 +176,24 @@ class Page extends UI5Element {
163
176
return PageTemplate ;
164
177
}
165
178
179
+ constructor ( ) {
180
+ super ( ) ;
181
+
182
+ this . _updateMediaRange = this . updateMediaRange . bind ( this ) ;
183
+ }
184
+
185
+ onEnterDOM ( ) {
186
+ ResizeHandler . register ( this , this . _updateMediaRange ) ;
187
+ }
188
+
189
+ onExitDOM ( ) {
190
+ ResizeHandler . deregister ( this , this . _updateMediaRange ) ;
191
+ }
192
+
193
+ updateMediaRange ( ) {
194
+ this . mediaRange = MediaRange . getCurrentRange ( MediaRange . RANGESETS . RANGE_4STEPS , this . getDomRef ( ) . offsetWidth ) ;
195
+ }
196
+
166
197
get _contentBottom ( ) {
167
198
return ! this . floatingFooter && ! this . hideFooter ? "2.75rem" : "0" ;
168
199
}
Original file line number Diff line number Diff line change 29
29
}
30
30
31
31
.ui5-page-footer-root {
32
+ width : 100% ;
33
+ box-sizing : border-box;
32
34
position : absolute;
33
35
bottom : 0 ;
34
36
left : 0 ;
35
37
z-index : 2 ;
36
38
width : 100% ;
37
39
}
38
40
39
- : host ([disable-scrolling ]) .ui5-page-content-root {
40
- overflow : hidden;
41
- }
42
-
43
41
: host ([floating-footer ]) .ui5-page-footer-root {
44
- left : 0.5rem ;
45
- right : 0.5rem ;
46
- width : auto;
47
42
opacity : 1 ;
48
43
bottom : 0.5rem ;
49
44
}
45
+ /*** Responsive paddings ***/
46
+
47
+ : host ([media-range = "S" ]) .ui5-page-content-root ,
48
+ : host ([media-range = "S" ][floating-footer ]) .ui5-page-footer-root {
49
+ padding : 0 1rem ;
50
+ }
51
+
52
+ : host ([media-range = "S" ]) ::slotted ([ui5-bar ][slot = "header" ]) {
53
+ box-sizing : border-box;
54
+ padding : 0 .25rem ;
55
+ }
56
+
57
+ : host ([media-range = "M" ]) .ui5-page-content-root ,
58
+ : host ([media-range = "L" ]) .ui5-page-content-root ,
59
+ : host ([media-range = "M" ][floating-footer ]) .ui5-page-footer-root ,
60
+ : host ([media-range = "L" ][floating-footer ]) .ui5-page-footer-root {
61
+ padding : 0 2rem ;
62
+ }
63
+
64
+ : host ([media-range = "M" ]) ::slotted ([ui5-bar ][slot = "header" ]),
65
+ : host ([media-range = "L" ]) ::slotted ([ui5-bar ][slot = "header" ]) {
66
+ box-sizing : border-box;
67
+ padding : 0 1.25rem ;
68
+ }
69
+
70
+ : host ([media-range = "XL" ]) .ui5-page-content-root ,
71
+ : host ([media-range = "XL" ][floating-footer ]) .ui5-page-footer-root {
72
+ padding : 0 3rem ;
73
+ }
74
+
75
+ : host ([media-range = "XL" ]) ::slotted ([ui5-bar ][slot = "header" ]) {
76
+ box-sizing : border-box;
77
+ padding : 0 2.25rem ;
78
+ }
79
+
80
+ : host ([disable-scrolling ]) .ui5-page-content-root {
81
+ overflow : hidden;
82
+ }
50
83
51
84
: host ([hide-footer ]: not ([floating-footer ])) .ui5-page-footer-root {
52
85
display : none;
Original file line number Diff line number Diff line change 28
28
29
29
< body style ="background-color: var(--sapBackgroundColor); "> </ body >
30
30
< ui5-page id ="page " background-design ="List " floating-footer show-footer >
31
- < div slot ="header ">
32
- < ui5-bar design ="Header ">
33
- < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
34
- < ui5-label slot ="middleContent "> Title</ ui5-label >
35
- < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
36
- </ ui5-bar >
37
- </ div >
31
+ < ui5-bar design ="Header " slot ="header ">
32
+ < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
33
+ < ui5-label slot ="middleContent "> Title</ ui5-label >
34
+ < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
35
+ </ ui5-bar >
38
36
39
37
< div >
40
38
< div style ="width: 100%; ">
Original file line number Diff line number Diff line change 20
20
< h3 > Page with floating footer</ h3 >
21
21
< div class ="snippet ">
22
22
< ui5-page id ="page " style ="height: 700px; width: 500px " background-design ="List " floating-footer show-footer >
23
- < div slot ="header ">
24
- < ui5-bar design ="Header ">
25
- < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
26
- < ui5-label slot ="middleContent "> Title</ ui5-label >
27
- < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
28
- </ ui5-bar >
29
- </ div >
23
+ < ui5-bar design ="Header " slot ="header ">
24
+ < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
25
+ < ui5-label slot ="middleContent "> Title</ ui5-label >
26
+ < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
27
+ </ ui5-bar >
30
28
31
29
< div >
32
30
< p class ="content-paragraph ">
@@ -81,13 +79,11 @@ <h3>Page with floating footer</h3>
81
79
</ div >
82
80
< pre class ="prettyprint lang-html "> < xmp >
83
81
< ui5-page id ="page " background-design ="List " floating-footer show-footer >
84
- < div slot ="header ">
85
- < ui5-bar design ="Header ">
86
- < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
87
- < ui5-label slot ="middleContent "> Title</ ui5-label >
88
- < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
89
- </ ui5-bar >
90
- </ div >
82
+ < ui5-bar design ="Header " slot ="header ">
83
+ < ui5-button icon ="home " title ="Go home " slot ="startContent "> </ ui5-button >
84
+ < ui5-label slot ="middleContent "> Title</ ui5-label >
85
+ < ui5-button icon ="action-settings " title ="Go to settings " slot ="endContent "> </ ui5-button >
86
+ </ ui5-bar >
91
87
92
88
< div >
93
89
< p >
You can’t perform that action at this time.
0 commit comments