File tree 14 files changed +54
-74
lines changed
test/sap/ui/webcomponents/main
14 files changed +54
-74
lines changed Original file line number Diff line number Diff line change 30
30
id =" {{ _id }} -popover"
31
31
allow-target-overlap =" {{ _popover.allowTargetOverlap }} "
32
32
placement-type =" {{ _popover.placementType }} "
33
- no-header
34
33
no-arrow
35
34
horizontal-align =" {{ _popover.horizontalAlign }} "
36
35
stay-open-on-scroll =" {{ _popover.stayOpenOnScroll }} "
Original file line number Diff line number Diff line change
1
+ {{> include " ./Popup.hbs" }}
2
+
1
3
<span class =" {{ classes.frame }} " >
2
4
<span id =" {{ _id }} -firstfe" tabindex =" 0" ></span >
3
5
<div style =" {{ zindex }} " class =" {{ classes.dialogParent }} " >
16
18
<span id =" {{ _id }} -lastfe" tabindex =" 0" ></span >
17
19
<div tabindex =" 0" id =" {{ _id }} -blocklayer" style =" {{ blockLayer }} " class =" {{ classes.blockLayer }} " ></div >
18
20
</span >
19
-
20
- {{ #*inline " header" }}
21
- {{ #unless noHeader }}
22
- <header >
23
- {{ #if header.length }}
24
- <div role =" heading" class =" ui5-popup-wrapper-header" >
25
- <slot name =" header" ></slot >
26
- </div >
27
- {{ else }}
28
- <h2 role =" heading" class =" ui5-popup-wrapper-header ui5-popup-wrapper-headerText" >{{ headerText }} </h2 >
29
- {{ /if }}
30
- </header >
31
- {{ /unless }}
32
- {{ /inline }}
33
-
34
- {{ #*inline " footer" }}
35
- {{ #if footer.length }}
36
- <footer >
37
- <div class =" ui5-popup-wrapper-footer" >
38
- <slot name =" footer" ></slot >
39
- </div >
40
- </footer >
41
- {{ /if }}
42
- {{ /inline }}
Original file line number Diff line number Diff line change 32
32
{{ #if showSuggestions }}
33
33
<ui5-popover
34
34
placement-type =" Bottom"
35
- no-header
36
35
no-arrow
37
36
horizontal-align =" Stretch"
38
37
initial-focus =" {{ _id }} -inner" >
Original file line number Diff line number Diff line change 36
36
<ui5-popover
37
37
class =" ui5-multi-combobox-selected-items--popover"
38
38
horizontal-align =" Stretch"
39
- no-header
40
39
?no-arrow ={{ editable }}
41
40
placement-type =" Bottom" >
42
41
<ui5-list separators =" None" mode =" {{ selectedItemsListMode }} "
51
50
52
51
<ui5-popover class =" ui5-multi-combobox-all-items--popover"
53
52
no-arrow
54
- no-header
55
53
horizontal-align =" Stretch"
56
54
initial-focus =" ui5-multi-combobox--input"
57
55
horizontal-align =" Left"
Original file line number Diff line number Diff line change
1
+ {{> include " ./Popup.hbs" }}
2
+
1
3
<span class =" {{ classes.frame }} " @focusin =" {{ onfocusin }} " >
2
4
<span id =" {{ _id }} -firstfe" tabindex =" 0" @focusin ={{ focusHelper.forwardToLast }} ></span >
3
5
<div style =" {{ styles.main }} " role =" dialog" aria-labelledby =" {{ headerId }} " tabindex =" -1" class =" {{ classes.main }} " >
13
15
<span id =" {{ _id }} -lastfe" tabindex =" 0" @focusin ={{ focusHelper.forwardToFirst }} ></span >
14
16
<div tabindex =" 0" id =" {{ _id }} -blocklayer" style =" {{ styles.blockLayer }} " class =" {{ classes.blockLayer }} " ></div >
15
17
</span >
16
-
17
- {{ #*inline " header" }}
18
- {{ #unless noHeader }}
19
- <header >
20
- {{ #if header.length }}
21
- <div role =" toolbar" class =" ui5-popup-wrapper-header" >
22
- <slot name =" header" ></slot >
23
- </div >
24
- {{ else }}
25
- <h2 role =" toolbar" class =" ui5-popup-wrapper-header ui5-popup-wrapper-headerText" >{{ headerText }} </h2 >
26
- {{ /if }}
27
- </header >
28
- {{ /unless }}
29
- {{ /inline }}
30
-
31
- {{ #*inline " footer" }}
32
- {{ #if footer.length }}
33
- <footer >
34
- <div class =" ui5-popup-wrapper-footer" >
35
- <slot name =" footer" ></slot >
36
- </div >
37
- </footer >
38
- {{ /if }}
39
- {{ /inline }}
Original file line number Diff line number Diff line change @@ -467,7 +467,7 @@ class Popover extends Popup {
467
467
468
468
let maxContentHeight = Math . round ( maxHeight ) ;
469
469
470
- if ( ! this . noHeader ) {
470
+ if ( this . hasHeader ) {
471
471
const headerDomRef = this . getPopupDomRef ( ) . querySelector ( ".ui5-popup-wrapper-header" ) ;
472
472
if ( headerDomRef ) {
473
473
maxContentHeight = Math . round ( maxHeight - headerDomRef . offsetHeight ) ;
@@ -645,7 +645,7 @@ class Popover extends Popup {
645
645
}
646
646
647
647
get headerId ( ) {
648
- return this . noHeader ? undefined : `${ this . _id } -header` ;
648
+ return this . hasHeader ? `${ this . _id } -header` : undefined ;
649
649
}
650
650
651
651
get focusHelper ( ) {
@@ -654,6 +654,10 @@ class Popover extends Popup {
654
654
forwardToFirst : this . _focusElementsHandlers . forwardToFirst ,
655
655
} ;
656
656
}
657
+
658
+ get role ( ) {
659
+ return "toolbar" ;
660
+ }
657
661
}
658
662
659
663
Popover . define ( ) ;
Original file line number Diff line number Diff line change
1
+ {{ #*inline " header" }}
2
+ {{ #if hasHeader }}
3
+ <header >
4
+ {{ #if header.length }}
5
+ <div role =" {{ role }} " class =" ui5-popup-wrapper-header" >
6
+ <slot name =" header" ></slot >
7
+ </div >
8
+ {{ else }}
9
+ <h2 role =" {{ role }} " class =" ui5-popup-wrapper-header ui5-popup-wrapper-headerText" >{{ headerText }} </h2 >
10
+ {{ /if }}
11
+ </header >
12
+ {{ /if }}
13
+ {{ /inline }}
14
+
15
+ {{ #*inline " footer" }}
16
+ {{ #if hasFooter }}
17
+ <footer >
18
+ <div class =" ui5-popup-wrapper-footer" >
19
+ <slot name =" footer" ></slot >
20
+ </div >
21
+ </footer >
22
+ {{ /if }}
23
+ {{ /inline }}
Original file line number Diff line number Diff line change @@ -57,16 +57,7 @@ const metadata = {
57
57
type : String ,
58
58
association : true ,
59
59
} ,
60
- /**
61
- * Defines whether the header is hidden.
62
- *
63
- * @type {Boolean }
64
- * @defaultvalue false
65
- * @public
66
- */
67
- noHeader : {
68
- type : Boolean ,
69
- } ,
60
+
70
61
/**
71
62
* Defines the header text.
72
63
* <br><b>Note:</b> If <code>header</code> slot is provided, the <code>headerText</code> is ignored.
@@ -443,6 +434,18 @@ class Popup extends UI5Element {
443
434
onExitDOM ( ) {
444
435
removeBodyStyles ( ) ;
445
436
}
437
+
438
+ get hasHeader ( ) {
439
+ return ! ! ( this . headerText . length || this . header . length ) ;
440
+ }
441
+
442
+ get hasFooter ( ) {
443
+ return ! ! this . footer . length ;
444
+ }
445
+
446
+ get role ( ) {
447
+ return "heading" ;
448
+ }
446
449
}
447
450
448
451
export default Popup ;
Original file line number Diff line number Diff line change 15
15
<ui5-popover
16
16
id =" ui5-select--popover"
17
17
placement-type =" Bottom"
18
- no-header
19
18
no-arrow
20
19
horizontal-align =" Stretch"
21
20
@ui5-afterOpen =" {{ _applyFocusAfterOpen }} "
Original file line number Diff line number Diff line change 28
28
</button >
29
29
{{ /if }}
30
30
31
- <ui5-popover class =" sapWCShellBarMenuPopover" no-header placement-type =" Bottom" >
31
+ <ui5-popover class =" sapWCShellBarMenuPopover" placement-type =" Bottom" >
32
32
<ui5-list separators =" None" mode =" SingleSelect" @ui5-itemPress ={{ _menuItemPress }} >
33
33
<slot name =" menuItems" ></slot >
34
34
</ui5-list >
75
75
</div >
76
76
</div >
77
77
78
- <ui5-popover class =" sapWCShellBarOverflowPopover" placement-type =" Bottom" horizontal-align =" {{ popoverHorizontalAlign }} " no-header no- arrow>
78
+ <ui5-popover class =" sapWCShellBarOverflowPopover" placement-type =" Bottom" horizontal-align =" {{ popoverHorizontalAlign }} " no-arrow>
79
79
<ui5-list separators =" None" @ui5-itemPress =" {{ _actionList.itemPress }} " >
80
80
{{ #each _hiddenIcons }}
81
81
<ui5-li
Original file line number Diff line number Diff line change 73
73
<ui5-popover
74
74
id =" {{ _id }} -overflowMenu"
75
75
no-arrow
76
- no-header
77
76
placement-type =" Bottom"
78
77
horizontal-align =" Right" >
79
78
<ui5-list @ui5-itemPress =" {{ _onOverflowListItemSelect }} " >
Original file line number Diff line number Diff line change 66
66
< content id ="popover "> </ content >
67
67
</ div >
68
68
69
- < ui5-popover placement-type ="Bottom " horizontal-align ="Stretch " no-arrow no-header initial-focus ="input1 " class ="wcPopoverWithList ">
69
+ < ui5-popover placement-type ="Bottom " horizontal-align ="Stretch " no-arrow initial-focus ="input1 " class ="wcPopoverWithList ">
70
70
< ui5-list id ="myList " inset separators ="Inner " mode ="MultiSelect " footer-text ="Copyright " no-data-text ="No data ">
71
71
<!-- Header -->
72
72
< div style ="display: flex; align-items: center; " slot ="header ">
Original file line number Diff line number Diff line change 132
132
< ui5-li slot ="menuItems "> Application 5</ ui5-li >
133
133
</ ui5-shellbar >
134
134
135
- < ui5-popover id ="popover " no-header placement-type ="Bottom ">
135
+ < ui5-popover id ="popover " placement-type ="Bottom ">
136
136
< div class ="popover-header ">
137
137
< ui5-title style ="padding: 0.25rem 1rem 0rem 1rem "> John Doe</ ui5-title >
138
138
</ div >
148
148
</ div >
149
149
</ ui5-popover >
150
150
151
- < ui5-popover id ="app-list-popover " no-header placement-type ="Bottom ">
151
+ < ui5-popover id ="app-list-popover " placement-type ="Bottom ">
152
152
< ui5-list separators ="None ">
153
153
< ui5-li > Application 1</ ui5-li >
154
154
< ui5-li > Application 2</ ui5-li >
158
158
</ ui5-list >
159
159
</ ui5-popover >
160
160
161
- < ui5-popover id ="custom-item-popover " no-header placement-type ="Bottom ">
161
+ < ui5-popover id ="custom-item-popover " placement-type ="Bottom ">
162
162
< ui5-list separators ="None ">
163
163
< ui5-li id ="custom-item-1 " type ="Active "> Custom Popover Item 1</ ui5-li >
164
164
< ui5-li type ="Active "> Custom Popover Item 2</ ui5-li >
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ <h3>ShellBar</h3>
75
75
< ui5-li slot ="menuItems "> Application 5</ ui5-li >
76
76
</ ui5-shellbar >
77
77
78
- < ui5-popover id ="action-popover " no-header placement-type ="Bottom ">
78
+ < ui5-popover id ="action-popover " placement-type ="Bottom ">
79
79
< div class ="action-popover-header ">
80
80
< ui5-title style ="padding: 0.25rem 1rem 0rem 1rem "> An Kimura</ ui5-title >
81
81
</ div >
@@ -128,7 +128,7 @@ <h3>ShellBar</h3>
128
128
129
129
</ ui5-shellbar >
130
130
131
- < ui5-popover id ="popover " no-header placement-type ="Bottom ">
131
+ < ui5-popover id ="popover " placement-type ="Bottom ">
132
132
< div class ="popover-header ">
133
133
< ui5-title style ="padding: 0.25rem 1rem 0rem 1rem "> An Kimura</ ui5-title >
134
134
</ div >
You can’t perform that action at this time.
0 commit comments