Skip to content

Commit cff8fd4

Browse files
authored
fix(ui5-link): rename wrap property to wrappingType (#3380)
Part of #3107 BREAKING_CHANGE: The boolean property `wrap` has been renamed to the string property `wrappingType`. If you previously used `wrap`, now you have to set `wrap="Normal"`
1 parent d43de85 commit cff8fd4

File tree

8 files changed

+20
-17
lines changed

8 files changed

+20
-17
lines changed

packages/fiori/src/NotificationAction.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const metadata = {
5757
* Defines the <code>icon</code> source URI.
5858
* <br><br>
5959
* <b>Note:</b>
60-
* SAP-icons font provides numerous buil-in icons. To find all the available icons, see the
60+
* SAP-icons font provides numerous built-in icons. To find all the available icons, see the
6161
* <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
6262
*
6363
* @type {string}

packages/main/src/Link.js

+14-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
33
import { getEffectiveAriaLabelText } from "@ui5/webcomponents-base/dist/util/AriaLabelHelper.js";
44
import { fetchI18nBundle, getI18nBundle } from "@ui5/webcomponents-base/dist/i18nBundle.js";
55
import LinkDesign from "./types/LinkDesign.js";
6+
import WrappingType from "./types/WrappingType.js";
67

78
// Template
89
import LinkRederer from "./generated/templates/LinkTemplate.lit.js";
@@ -84,17 +85,20 @@ const metadata = {
8485
},
8586

8687
/**
87-
* Defines whether the component text should wrap
88-
* when there is no sufficient space.
89-
* <br><br>
90-
* <b>Note:</b> The text is truncated by default.
88+
* Defines how the text of a component will be displayed when there is not enough space.
89+
* Available options are:
90+
* <ul>
91+
* <li><code>None</code> - The text will be truncated with an ellipsis.</li>
92+
* <li><code>Normal</code> - The text will wrap. The words will not be broken based on hyphenation.</li>
93+
* </ul>
9194
*
92-
* @type {boolean}
93-
* @defaultvalue false
95+
* @type {WrappingType}
96+
* @defaultvalue "None"
9497
* @public
9598
*/
96-
wrap: {
97-
type: Boolean,
99+
wrappingType: {
100+
type: WrappingType,
101+
defaultValue: WrappingType.None,
98102
},
99103

100104
/**
@@ -174,13 +178,13 @@ const metadata = {
174178
* by using the <code>design</code> property.
175179
* <br><br>
176180
* If the <code>href</code> property is set, the link behaves as the HTML
177-
* anchor tag (<code>&lt;a>&lt;a/></code>) and opens the specified URL in the given target frame (<code>target</code> property).
181+
* anchor tag (<code>&lt;a&gt;&lt;a&#47;&gt;</code>) and opens the specified URL in the given target frame (<code>target</code> property).
178182
* To specify where the linked content is opened, you can use the <code>target</code> property.
179183
*
180184
* <h3>Responsive behavior</h3>
181185
*
182186
* If there is not enough space, the text of the <code>ui5-link</code> becomes truncated.
183-
* If the <code>wrap</code> property is set to <code>true</code>, the text is displayed
187+
* If the <code>wrappingType</code> property is set to <code>"Normal"</code>, the text is displayed
184188
* on several lines instead of being truncated.
185189
*
186190
* <h3>ES6 Module Import</h3>

packages/main/src/Option.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const metadata = {
3535
* Defines the <code>icon</code> source URI.
3636
* <br><br>
3737
* <b>Note:</b>
38-
* SAP-icons font provides numerous buil-in icons. To find all the available icons, see the
38+
* SAP-icons font provides numerous built-in icons. To find all the available icons, see the
3939
* <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
4040
*
4141
* @type {string}

packages/main/src/StandardListItem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const metadata = {
2626
* Defines the <code>icon</code> source URI.
2727
* <br><br>
2828
* <b>Note:</b>
29-
* SAP-icons font provides numerous buil-in icons. To find all the available icons, see the
29+
* SAP-icons font provides numerous built-in icons. To find all the available icons, see the
3030
* <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
3131
*
3232
* @type {string}

packages/main/src/SuggestionItem.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const metadata = {
5353
* Defines the <code>icon</code> source URI.
5454
* <br><br>
5555
* <b>Note:</b>
56-
* SAP-icons font provides numerous buil-in icons. To find all the available icons, see the
56+
* SAP-icons font provides numerous built-in icons. To find all the available icons, see the
5757
* <ui5-link target="_blank" href="https://openui5.hana.ondemand.com/test-resources/sap/m/demokit/iconExplorer/webapp/index.html" class="api-table-content-cell-link">Icon Explorer</ui5-link>.
5858
*
5959
* @type {string}

packages/main/src/themes/Link.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
color: var(--sapLinkColor);
4444
}
4545

46-
:host([wrap]) .ui5-link-root {
46+
:host([wrapping-type="Normal"]) .ui5-link-root {
4747
white-space: normal;
4848
word-wrap: break-word;
4949
}

packages/main/test/pages/Link.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ <h2>Disabled link</h2>
6464

6565
<section class="group">
6666
<h2>Wrapping link</h2>
67-
<ui5-link style="width: 100px" id="wrapping-link" wrap>Eu enim consectetur do amet elit.</ui5-link>
67+
<ui5-link style="width: 100px" id="wrapping-link" wrapping-type="Normal">Eu enim consectetur do amet elit.</ui5-link>
6868
<ui5-link style="width: 100px" id="non-wrapping-link">Eu enim consectetur do amet elit.</ui5-link>
6969
</section>
7070

packages/main/test/specs/Components.spec.js

-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ describe("General assertions", () => {
4747
assertBooleanProperty(label, "required");
4848

4949
//Link
50-
assertBooleanProperty(link, "wrap");
5150
assertBooleanProperty(link, "disabled");
5251

5352
// Input

0 commit comments

Comments
 (0)