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