You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -19,14 +35,15 @@ import badgeCss from "./generated/themes/Badge.css.js";
19
35
* @class
20
36
* <h3 class="comment-api-title">Overview</h3>
21
37
*
22
-
* The <code>ui5-badge</code> is a small non-interactive component which contains text information and color chosen from a list of predefined color schemes.
23
-
* It serves the purpose to attract the user attention to some piece of information (state, quantity, condition, etc.).
38
+
* The <code>ui5-badge</code> is a component which serves
39
+
* the purpose to attract the user attention to some piece
40
+
* of information (state, quantity, condition, etc.).
41
+
* It can contain icon and text information, and its design can be chosen from specific design types.
24
42
*
25
43
* <h3>Usage Guidelines</h3>
26
44
* <ul>
27
-
* <li>If the text is longer than the width of the component, it doesn’t wrap, it shows ellipsis.</li>
28
-
* <li>When truncated, the full text is not visible, therefore, it’s recommended to make more space for longer texts to be fully displayed.</li>
29
-
* <li>Colors are not semantic and have no visual representation in High Contrast Black (sap_belize_hcb) theme.</li>
45
+
* <li>If the text is longer than the width of the component, it can wrap, or it can show ellipsis, depending on the <code>wrappingType</code> property.</li>
46
+
* <li>Colors can be semantic or not semantic.</li>
30
47
* </ul>
31
48
*
32
49
* <h3>ES6 Module Import</h3>
@@ -47,8 +64,31 @@ import badgeCss from "./generated/themes/Badge.css.js";
47
64
renderer: litRender,
48
65
template: BadgeTemplate,
49
66
styles: badgeCss,
67
+
dependencies: [
68
+
Icon,
69
+
],
50
70
})
71
+
72
+
/**
73
+
* Fired when the user clicks on an interactive badge.
74
+
* <b>Note:</b> The event will be fired if the <code>interactive</code> property is <code>true</code>
75
+
* @event sap.ui.webc.main.Badge#click
76
+
* @public
77
+
* @since 1.20
78
+
*/
79
+
@event("click")
51
80
classBadgeextendsUI5Element{
81
+
/**
82
+
* Defines the design type of the component.
83
+
* @type {string}
84
+
* @name sap.ui.webc.main.Badge.prototype.design
85
+
* @defaultvalue "Set3"
86
+
* @public
87
+
* @since 1.20
88
+
*/
89
+
@property({defaultValue: BadgeDesign.Set3})
90
+
design!: `${BadgeDesign}`;
91
+
52
92
/**
53
93
* Defines the color scheme of the component.
54
94
* There are 10 predefined schemes.
@@ -63,6 +103,44 @@ class Badge extends UI5Element {
@@ -77,6 +155,13 @@ class Badge extends UI5Element {
77
155
@property({type: Boolean})
78
156
_iconOnly!: boolean;
79
157
158
+
/**
159
+
* Defines if the badge has "Tag" design type.
160
+
* @private
161
+
*/
162
+
@property({type: Boolean})
163
+
_isTagDesign!: boolean;
164
+
80
165
/**
81
166
* Defines the text of the component.
82
167
* <br><b>Note:</b> Although this slot accepts HTML Elements, it is strongly recommended that you only use text in order to preserve the intended design.
@@ -107,8 +192,28 @@ class Badge extends UI5Element {
0 commit comments