Skip to content

Commit e235d7d

Browse files
authored
fix(ui5-bar): rename middleContent slot (#3440)
Part of #3107 BREAKING_CHANGE: The 'middleContent' slot is deprecated in favour of 'default' slot
1 parent 4a4c5bc commit e235d7d

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

packages/fiori/src/Bar.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<slot name="startContent"></slot>
99
</div>
1010
<div class="ui5-bar-content-container ui5-bar-midcontent-container">
11-
<slot name="middleContent"></slot>
11+
<slot></slot>
1212
</div>
1313
<div class="ui5-bar-content-container ui5-bar-endcontent-container">
1414
<slot name="endContent"></slot>

packages/fiori/src/Bar.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,18 @@ const metadata = {
4545
startContent: {
4646
type: HTMLElement,
4747
},
48+
4849
/**
4950
* Defines the content in the middle of the bar
5051
* @type {HTMLElement[]}
5152
* @slot
5253
* @public
5354
*/
54-
middleContent: {
55+
"default": {
5556
type: HTMLElement,
57+
propertyName: "middleContent",
5658
},
59+
5760
/**
5861
* Defines the content at the end of the bar
5962
* @type {HTMLElement[]}
@@ -75,7 +78,7 @@ const metadata = {
7578
* <h3 class="comment-api-title">Overview</h3>
7679
* The Bar is a container which is primarily used to hold titles, buttons and input elements
7780
* and its design and functionality is the basis for page headers and footers.
78-
* The component consists of three areas to hold its content - startContent, middleContent and endContent.
81+
* The component consists of three areas to hold its content - startContent slot, default slot and endContent slot.
7982
* It has the capability to center content, such as a title, while having other components on the left and right side.
8083
*
8184
* <h3>Usage</h3>
@@ -84,7 +87,7 @@ const metadata = {
8487
* <b>Note:</b> Do not place a Bar inside another Bar or inside any bar-like component. Doing so may cause unpredictable behavior.
8588
*
8689
* <h3>Responsive Behavior</h3>
87-
* The middleContent will be centered in the available space between the startContent and the endContent areas,
90+
* The default slot will be centered in the available space between the startContent and the endContent areas,
8891
* therefore it might not always be centered in the entire bar.
8992
*
9093
* <h3>CSS Shadow Parts</h3>

packages/fiori/test/pages/Bar.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
<ui5-title level="3">Header design</ui5-title>
2626
<ui5-bar design="Header">
2727
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
28-
<ui5-label slot="middleContent">Title</ui5-label>
28+
<ui5-label>Title</ui5-label>
2929
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
3030
</ui5-bar>
3131
<br>
@@ -38,8 +38,8 @@
3838
<ui5-label>Basic Label</ui5-label>
3939
</div>
4040

41-
<ui5-button slot="middleContent">Middle1 Button</ui5-button>
42-
<ui5-button slot="middleContent">Middle2 Button</ui5-button>
41+
<ui5-button>Middle1 Button</ui5-button>
42+
<ui5-button>Middle2 Button</ui5-button>
4343

4444
<ui5-label slot="endContent">Basic Label</ui5-label>
4545
<ui5-button slot="endContent">End Button</ui5-button>

packages/fiori/test/pages/Page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
<ui5-page id="page" background-design="List" floating-footer show-footer>
3131
<ui5-bar design="Header" slot="header">
3232
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
33-
<ui5-label slot="middleContent">Title</ui5-label>
33+
<ui5-label>Title</ui5-label>
3434
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
3535
</ui5-bar>
3636

packages/fiori/test/samples/Bar.sample.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ <h3>Header Bar</h3>
1414
<div class="snippet">
1515
<ui5-bar design="Header">
1616
<ui5-button icon="home" title="Go home" design="Transparent" slot="startContent"></ui5-button>
17-
<ui5-label id="basic-label" slot="middleContent">Header Title</ui5-label>
17+
<ui5-label id="basic-label">Header Title</ui5-label>
1818
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
1919
</ui5-bar>
2020
</div>
2121
<pre class="prettyprint lang-html"><xmp>
2222
<ui5-bar design="Header">
2323
<ui5-button icon="home" title="Go home" design="Transparent" slot="startContent"></ui5-button>
24-
<ui5-label slot="middleContent">Header Title</ui5-label>
24+
<ui5-label>Header Title</ui5-label>
2525
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
2626
</ui5-bar>
2727
</xmp></pre>
@@ -31,14 +31,14 @@ <h3>Subheader Bar</h3>
3131
<div class="snippet">
3232
<ui5-bar design="Subheader">
3333
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
34-
<ui5-label id="basic-label" slot="middleContent">Subheader Title</ui5-label>
34+
<ui5-label id="basic-label">Subheader Title</ui5-label>
3535
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
3636
</ui5-bar>
3737
</div>
3838
<pre class="prettyprint lang-html"><xmp>
3939
<ui5-bar design="Subheader">
4040
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
41-
<ui5-label slot="middleContent">Subheader Title</ui5-label>
41+
<ui5-label>Subheader Title</ui5-label>
4242
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
4343
</ui5-bar>
4444
</xmp></pre>

packages/fiori/test/samples/Page.sample.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ <h3>Page with floating footer</h3>
2222
<ui5-page id="page" style="height: 700px; width: 500px" background-design="List" floating-footer show-footer>
2323
<ui5-bar design="Header" slot="header">
2424
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
25-
<ui5-label slot="middleContent">Title</ui5-label>
25+
<ui5-label>Title</ui5-label>
2626
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
2727
</ui5-bar>
2828

@@ -81,7 +81,7 @@ <h3>Page with floating footer</h3>
8181
<ui5-page id="page" background-design="List" floating-footer show-footer>
8282
<ui5-bar design="Header" slot="header">
8383
<ui5-button icon="home" title="Go home" slot="startContent"></ui5-button>
84-
<ui5-label slot="middleContent">Title</ui5-label>
84+
<ui5-label>Title</ui5-label>
8585
<ui5-button icon="action-settings" title="Go to settings" slot="endContent"></ui5-button>
8686
</ui5-bar>
8787

0 commit comments

Comments
 (0)