Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui5-dynamic-page): add breadcrumbs responsiveness #7844

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions packages/fiori/src/DynamicPageTitle.hbs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="{{classes.root}}">
<div class="{{classes.breadcrumbs}}">
<div class="{{classes.topArea}}">
{{#if hasBreadcrumb}}
<div>
<div class="{{classes.breadcrumbs}}">
<slot name="breadcrumbs"></slot>
</div>
{{/if}}
Expand All @@ -16,9 +16,11 @@
<slot name="{{headingSlotName}}"></slot>
</div>

<div class="{{classes.content}}">
{{#if hasContent}}
<div class="{{classes.content}}"
<slot></slot>
</div>
{{/if}}

<div class="{{classes.actions}}">
<slot name="actions"></slot>
Expand Down
7 changes: 7 additions & 0 deletions packages/fiori/src/DynamicPageTitle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ class DynamicPageTitle extends UI5Element {
return !!this.breadcrumbs.length;
}

get hasContent() {
return !!this.content.length;
}

get hasHeading() {
return !!this.heading.length;
}
Expand All @@ -108,6 +112,9 @@ class DynamicPageTitle extends UI5Element {
root: {
"ui5-dynamic-page-title-root": true,
},
topArea: {
"ui5-dynamic-page-title--top-area": true,
},
breadcrumbs: {
"ui5-dynamic-page-title--breadcrumbs": true,
},
Expand Down
6 changes: 5 additions & 1 deletion packages/fiori/src/themes/DynamicPageTitle.css
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@
flex: 0 1;
}

.ui5-dynamic-page-title--breadcrumbs {
.ui5-dynamic-page-title--top-area {
display: flex;
justify-content: space-between;
align-items: center;
}

.ui5-dynamic-page-title--breadcrumbs {
width: 100%;
}
4 changes: 2 additions & 2 deletions packages/fiori/test/pages/DynamicPage.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@
</ui5-toolbar>

<ui5-toolbar slot="navigationActions">
<ui5-toolbar-button icon="edit"></ui5-toolbar-button>
<ui5-toolbar-button icon="delete"></ui5-toolbar-button>
<ui5-toolbar-button icon="full-screen"></ui5-toolbar-button>
<ui5-toolbar-button icon="decline"></ui5-toolbar-button>
</ui5-toolbar>
</ui5-dynamic-page-title>
<ui5-dynamic-page-header slot="headerArea">
Expand Down
1 change: 1 addition & 0 deletions packages/fiori/test/pages/styles/DynamicPage.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
html, body {
height: 100%;
margin: 0;
}
5 changes: 4 additions & 1 deletion packages/main/src/Breadcrumbs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import event from "@ui5/webcomponents-base/dist/decorators/event.js";
import ItemNavigation from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
import type { ITabbable } from "@ui5/webcomponents-base/dist/delegate/ItemNavigation.js";
import litRender from "@ui5/webcomponents-base/dist/renderer/LitRenderer.js";
import { renderFinished } from "@ui5/webcomponents-base/dist/Render.js";
import {
isEnter,
isSpace,
Expand Down Expand Up @@ -252,7 +253,9 @@ class Breadcrumbs extends UI5Element {
this._preprocessItems();
}

onAfterRendering() {
async onAfterRendering() {
await renderFinished();

this._cacheWidths();
this._updateOverflow();
}
Expand Down
Loading