File tree 7 files changed +39
-7
lines changed
7 files changed +39
-7
lines changed Original file line number Diff line number Diff line change 47
47
{{ #if this.icon }}
48
48
<ui5-icon
49
49
tabindex =" {{ this._tabIndex }} "
50
+ data-count =" {{ this.count }} "
50
51
data-ui5-notification-count =" {{ ../notificationCount }} "
51
52
data-ui5-external-action-item-id =" {{ this.refItemid }} "
52
53
class =" {{ this.classes }} "
Original file line number Diff line number Diff line change @@ -759,6 +759,7 @@ class ShellBar extends UI5Element {
759
759
return {
760
760
icon : item . icon ,
761
761
id : item . _id ,
762
+ count : item . count || undefined ,
762
763
refItemid : item . _id ,
763
764
text : item . text ,
764
765
classes : "ui5-shellbar-custom-item ui5-shellbar-button" ,
Original file line number Diff line number Diff line change @@ -22,12 +22,23 @@ const metadata = {
22
22
/**
23
23
* Defines the item text.
24
24
* @type {string }
25
- * @defaultvalue : ""
25
+ * @defaulValue ""
26
26
* @public
27
27
*/
28
28
text : {
29
29
type : String ,
30
30
} ,
31
+
32
+ /**
33
+ * Defines the count displayed in the top-right corner.
34
+ * @type {string }
35
+ * @defaultValue ""
36
+ * @since 1.0.0-rc.6
37
+ * @public
38
+ */
39
+ count : {
40
+ type : String ,
41
+ } ,
31
42
} ,
32
43
33
44
events : /** @lends sap.ui.webcomponents.fiori.ShellBarItem.prototype */ {
Original file line number Diff line number Diff line change 303
303
position : relative;
304
304
}
305
305
306
- : host ([notification-count ]) .ui5-shellbar-bell-button ::before {
307
- content : attr (data- ui5-notification -count);
306
+ : host ([notification-count ]) .ui5-shellbar-bell-button ::before ,
307
+ ui5-icon [ data -count]:: before {
308
308
position : absolute;
309
309
width : auto;
310
310
height : 1rem ;
324
324
box-sizing : border-box;
325
325
}
326
326
327
+ : host ([notification-count ]) .ui5-shellbar-bell-button ::before {
328
+ content : attr (data-ui5-notification-count);
329
+ }
330
+
331
+ ui5-icon [data-count ]::before {
332
+ content : attr (data-count);
333
+ }
334
+
327
335
.ui5-shellbar-menu-button {
328
336
margin-left : 0.5rem ;
329
337
}
Original file line number Diff line number Diff line change 8
8
9
9
< script data-ui5-config type ="application/json ">
10
10
{
11
- "rtl" : false ,
11
+ "rtl" : false
12
12
}
13
13
</ script >
14
14
63
63
class ="shellbar-example "
64
64
primary-title ="Custom Actions "
65
65
secondary-title ="Second Title "
66
+ id ="shellbarwithitems "
66
67
>
67
68
< ui5-shellbar-item icon ="accelerated " text ="Hello World! "> </ ui5-shellbar-item >
68
69
< ui5-shellbar-item icon ="accept " text ="Hello World! "> </ ui5-shellbar-item >
69
70
< ui5-shellbar-item icon ="alert " text ="Hello World! "> </ ui5-shellbar-item >
70
- < ui5-shellbar-item icon ="discussion " text ="Hello World! "> </ ui5-shellbar-item >
71
+ < ui5-shellbar-item icon ="discussion " text ="Hello World! " count =" 42 " > </ ui5-shellbar-item >
71
72
< ui5-shellbar-item icon ="error " text ="Hello World! "> </ ui5-shellbar-item >
72
73
< ui5-shellbar-item icon ="hello-world " text ="UI5 Webcomponents "> </ ui5-shellbar-item >
73
74
< ui5-shellbar-item icon ="laptop " text ="UI5 Webcomponents "> </ ui5-shellbar-item >
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ <h3>ShellBar</h3>
28
28
< ui5-button icon ="nav-back " slot ="startButton "> </ ui5-button >
29
29
30
30
< ui5-shellbar-item id ="disc " icon ="disconnected " text ="Disconnect "> </ ui5-shellbar-item >
31
- < ui5-shellbar-item id ="call " icon ="incoming-call " text ="Incoming Calls "> </ ui5-shellbar-item >
31
+ < ui5-shellbar-item id ="call " icon ="incoming-call " text ="Incoming Calls " count =" 4 " > </ ui5-shellbar-item >
32
32
33
33
< ui5-input slot ="searchField "> </ ui5-input >
34
34
@@ -77,7 +77,7 @@ <h3>ShellBar</h3>
77
77
< ui5-button icon ="nav-back " slot ="startButton "> </ ui5-button >
78
78
79
79
< ui5-shellbar-item id ="disc " icon ="disconnected " text ="Disconnect "> </ ui5-shellbar-item >
80
- < ui5-shellbar-item id ="call " icon ="incoming-call " text ="Incoming Calls "> </ ui5-shellbar-item >
80
+ < ui5-shellbar-item id ="call " icon ="incoming-call " text ="Incoming Calls " count =" 4 " > </ ui5-shellbar-item >
81
81
82
82
< ui5-input slot ="searchField "> </ ui5-input >
83
83
Original file line number Diff line number Diff line change
1
+
1
2
const assert = require ( "chai" ) . assert ;
2
3
3
4
describe ( "Component Behavior" , ( ) => {
4
5
browser . url ( "http://localhost:8081/test-resources/pages/ShellBar.html" ) ;
5
6
7
+ describe ( "ui5-shellbar-item" , ( ) => {
8
+ it ( "tests count property" , ( ) => {
9
+ const shellbar = browser . $ ( "#shellbarwithitems" ) ;
10
+ const icon = shellbar . shadow$ ( "ui5-icon[data-count]" ) ;
11
+
12
+ assert . strictEqual ( icon . getAttribute ( "data-count" ) , '42' , "Count property propagates to ui5-icon" ) ;
13
+ } )
14
+ } ) ;
15
+
6
16
describe ( "Responsiveness" , ( ) => {
7
17
8
18
it ( "tests XXL Breakpoint 1920px" , ( ) => {
You can’t perform that action at this time.
0 commit comments