Skip to content

Commit 6701ab5

Browse files
authored
refactor(ui5-li-notification): rename wrap property to wrappingType (#3565)
We change the boolean "wrap" property in the Link, Label, Title to string property "wrappingType" to make it more flexible for the upcoming "hyphenated type of wrapping". The change does the same with the ui5-li-notification. BREAKING CHANGE: Replace boolean "wrap" property with string property "wrappingType", if you previously set "wrap", now use "wrapping-type='Normal'"
1 parent c29b9ef commit 6701ab5

File tree

4 files changed

+21
-18
lines changed

4 files changed

+21
-18
lines changed

packages/fiori/src/NotificationListItem.js

+9-6
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import BusyIndicator from "@ui5/webcomponents/dist/BusyIndicator.js";
99
import Link from "@ui5/webcomponents/dist/Link.js";
1010
import Icon from "@ui5/webcomponents/dist/Icon.js";
1111
import Popover from "@ui5/webcomponents/dist/Popover.js";
12+
import WrappingType from "@ui5/webcomponents/dist/types/WrappingType.js";
1213
import NotificationListItemBase from "./NotificationListItemBase.js";
1314

1415
// Texts
@@ -49,12 +50,14 @@ const metadata = {
4950
* <br><br>
5051
* <b>Note:</b> by default the <code>heading</code> and <code>decription</code>,
5152
* and a <code>ShowMore/Less</code> button would be displayed.
52-
* @type {boolean}
53-
* @defaultvalue false
53+
* @type {WrappingType}
54+
* @defaultvalue "None"
5455
* @public
56+
* @since 1.0.0-rc.16
5557
*/
56-
wrap: {
57-
type: Boolean,
58+
wrappingType: {
59+
type: WrappingType,
60+
defaultValue: WrappingType.None,
5861
},
5962

6063
/**
@@ -246,7 +249,7 @@ class NotificationListItem extends NotificationListItemBase {
246249
}
247250

248251
get hideShowMore() {
249-
if (!this.wrap && this._showMore) {
252+
if (this.wrappingType === WrappingType.None && this._showMore) {
250253
return undefined;
251254
}
252255

@@ -405,7 +408,7 @@ class NotificationListItem extends NotificationListItemBase {
405408
}
406409

407410
onResize() {
408-
if (this.wrap) {
411+
if (this.wrappingType === WrappingType.Normal) {
409412
this._showMore = false;
410413
return;
411414
}

packages/fiori/src/themes/NotificationListItem.css

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
@import "./NotificationListItemBase.css";
22
@import "./NotificationPrioIcon.css";
33

4-
:host(:not([wrap])) .ui5-nli-heading {
4+
:host([wrapping-type="None"]) .ui5-nli-heading {
55
display: -webkit-box;
66
-webkit-line-clamp: 2;
77
-webkit-box-orient: vertical;
88
overflow: hidden;
99
}
1010

11-
:host(:not([wrap])) .ui5-nli-description {
11+
:host(:not([wrapping-type="Normal"])) .ui5-nli-description {
1212
display: -webkit-box;
1313
-webkit-line-clamp: 2;
1414
-webkit-box-orient: vertical;
@@ -28,11 +28,11 @@
2828
}
2929

3030
/* IE */
31-
:host(:not([wrap])) .ui5-nli-content--ie .ui5-nli-description {
31+
:host([wrapping-type="None"]) .ui5-nli-content--ie .ui5-nli-description {
3232
max-height: 32px;
3333
}
3434

35-
:host(:not([wrap])) .ui5-nli-content--ie .ui5-nli-heading {
35+
:host([wrapping-type="None"]) .ui5-nli-content--ie .ui5-nli-heading {
3636
max-height: 32px;
3737
}
3838

packages/fiori/test/pages/NotificationListItem.html

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<h3>Properties</h3>
3030
<ul>
3131
<li>heading</li>
32-
<li>wrap (default: "false")</li>
32+
<li>wrappingType (default: "None")</li>
3333
<li>priority (default: "None")</li>
3434
<li>read (default: "false")</li>
3535
<li>show-close (default: "false")</li>
@@ -133,7 +133,7 @@ <h3>Events on ui5-list level</h3>
133133

134134
<ui5-li-notification
135135
show-close
136-
wrap
136+
wrapping-type="Normal"
137137
heading="New order (#2525) With a very long title - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc."
138138
>
139139
And with a very long description and long labels of the action buttons - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc.
@@ -147,7 +147,7 @@ <h3>Events on ui5-list level</h3>
147147

148148
<ui5-li-notification
149149
show-close
150-
wrap
150+
wrapping-type="Normal"
151151
heading="New order (#2525) With a very long title - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc."
152152
priority="High"
153153
>
@@ -159,7 +159,7 @@ <h3>Events on ui5-list level</h3>
159159
</ui5-li-notification>
160160

161161
<ui5-li-notification
162-
wrap
162+
wrapping-type="Normal"
163163
heading="New order (#2522)"
164164
priority="Low"
165165
>
@@ -172,7 +172,7 @@ <h3>Events on ui5-list level</h3>
172172

173173
<ui5-li-notification
174174
heading="New order (#2523)"
175-
wrap
175+
wrapping-type="Normal"
176176
>
177177
<div>With a very long description - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent feugiat, turpis vel scelerisque pharetra, tellus odio vehicula dolor, nec elementum lectus turpis at nunc.</div>
178178

packages/fiori/test/pages/NotificationList_test_page.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
<ui5-li-notification
109109
id="nli3"
110110
show-close
111-
wrap
111+
wrapping-type="Normal"
112112
heading="New payment #2900"
113113
priority="High"
114114
>
@@ -125,7 +125,7 @@
125125
<ui5-li-notification
126126
id="nli4"
127127
busy
128-
wrap
128+
wrapping-type="Normal"
129129
show-close
130130
heading="New payment #2901"
131131
priority="High"
@@ -150,7 +150,7 @@
150150
>
151151
<ui5-li-notification
152152
id="nli5"
153-
wrap
153+
wrapping-type="Normal"
154154
show-close
155155
heading="New payment #2900"
156156
priority="High"

0 commit comments

Comments
 (0)