@@ -49,6 +49,20 @@ const metadata = {
49
49
avatar : {
50
50
type : HTMLElement ,
51
51
} ,
52
+
53
+ /**
54
+ * Defines an action, displayed in the right most part of the header.
55
+ * <br><br>
56
+ * <b>Note:</b> If set, the <code>status</code> text will not be displayed,
57
+ * you can either have <code>action</code>, or <code>status</code>.
58
+ * @type {HTMLElement[] }
59
+ * @slot
60
+ * @public
61
+ * @since 1.0.0-rc.8
62
+ */
63
+ action : {
64
+ type : HTMLElement ,
65
+ } ,
52
66
} ,
53
67
properties : /** @lends sap.ui.webcomponents.main.Card.prototype */ {
54
68
@@ -74,6 +88,9 @@ const metadata = {
74
88
75
89
/**
76
90
* Defines the status displayed in the <code>ui5-card</code> header.
91
+ * <br><br>
92
+ * <b>Note:</b> If the <code>action</code> slot is set, the <code>status</code> will not be displayed,
93
+ * you can either have <code>action</code>, or <code>status</code>.
77
94
* @type {string }
78
95
* @defaultvalue ""
79
96
* @public
@@ -120,10 +137,8 @@ const metadata = {
120
137
* The <code>ui5-card</code> is a component that represents information in the form of a
121
138
* tile with separate header and content areas.
122
139
* The content area of a <code>ui5-card</code> can be arbitrary HTML content.
123
- * The header can be used through several properties, such as:
124
- * <code>heading</code>, <code>subheading</code>, <code>status</code>
125
- * and a slot:
126
- * <code>avatar</code>.
140
+ * The header can be used through several properties, such as: <code>heading</code>, <code>subheading</code>, <code>status</code>
141
+ * and two slots: <code>avatar</code> and <code>action</code>.
127
142
*
128
143
* <h3>Keyboard handling</h3>
129
144
* In case you enable <code>headerInteractive</code> property, you can press the <code>ui5-card</code> header by Space and Enter keys.
@@ -193,7 +208,7 @@ class Card extends UI5Element {
193
208
}
194
209
195
210
get hasHeader ( ) {
196
- return ! ! ( this . heading || this . subheading || this . status || this . avatar ) ;
211
+ return ! ! ( this . heading || this . subheading || this . status || this . hasAction || this . avatar ) ;
197
212
}
198
213
199
214
get ariaCardRoleDescription ( ) {
@@ -216,6 +231,10 @@ class Card extends UI5Element {
216
231
return ! ! this . avatar . length ;
217
232
}
218
233
234
+ get hasAction ( ) {
235
+ return ! ! this . action . length ;
236
+ }
237
+
219
238
static async onDefine ( ) {
220
239
await Promise . all ( [
221
240
Icon . define ( ) ,
0 commit comments