From b89727cb031d405b93eb9b2dae2898935a28003a Mon Sep 17 00:00:00 2001 From: Dobrin Dimchev Date: Thu, 21 Aug 2025 10:01:21 +0300 Subject: [PATCH 1/2] fix(ui5-toolbar): extend search field type --- packages/fiori/src/ShellBar.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/fiori/src/ShellBar.ts b/packages/fiori/src/ShellBar.ts index b901901454da..0dbaffeaaac3 100644 --- a/packages/fiori/src/ShellBar.ts +++ b/packages/fiori/src/ShellBar.ts @@ -49,6 +49,7 @@ import getActiveElement from "@ui5/webcomponents-base/dist/util/getActiveElement import type ShellBarItem from "./ShellBarItem.js"; import type { ShellBarItemAccessibilityAttributes } from "./ShellBarItem.js"; import type ShellBarBranding from "./ShellBarBranding.js"; +import type ShellBarSearch from "./ShellBarSearch.js"; // Templates import ShellBarTemplate from "./ShellBarTemplate.js"; @@ -521,7 +522,7 @@ class ShellBar extends UI5Element { type: HTMLElement, invalidateOnChildChange: true, }) - searchField!: Array; + searchField!: Array; /** * Defines a `ui5-button` in the bar that will be placed in the beginning. From f58b9c93e3c725ebd6dfa7949f4e38ad52f2b5b5 Mon Sep 17 00:00:00 2001 From: Dobrin Dimchev Date: Thu, 11 Sep 2025 12:59:44 +0300 Subject: [PATCH 2/2] chore: samples --- packages/fiori/src/ShellBar.ts | 9 +- .../fiori/src/ShellBarPopoverTemplate.tsx | 1 + packages/fiori/src/ShellBarTemplate.tsx | 2 +- .../ShellBar_content_button_overflow.html | 288 ++++++++++++++++++ .../ShellBar_shellbar_item_overflow.html | 267 ++++++++++++++++ 5 files changed, 565 insertions(+), 2 deletions(-) create mode 100644 packages/fiori/test/pages/ShellBar_content_button_overflow.html create mode 100644 packages/fiori/test/pages/ShellBar_shellbar_item_overflow.html diff --git a/packages/fiori/src/ShellBar.ts b/packages/fiori/src/ShellBar.ts index 0dbaffeaaac3..b7b782bc8f49 100644 --- a/packages/fiori/src/ShellBar.ts +++ b/packages/fiori/src/ShellBar.ts @@ -956,6 +956,13 @@ class ShellBar extends UI5Element { item.classList.add("ui5-shellbar-hidden-button"); } + if (hiddenItems.length === 1) { + return { + itemsInfo: this._itemsInfo, + contentInfo: this._contentInfo, + }; + } + if (hiddenItems.length === 1 && !this.showSearchField) { const nextItemToHide = hidableDomElements[++lastHiddenIndex]; if (nextItemToHide) { @@ -1226,7 +1233,7 @@ class ShellBar extends UI5Element { const bIndex = PREDEFINED_PLACE_ACTIONS.indexOf(b.icon || ""); return aIndex - bIndex; }).map((item: ShellBarItem) => { - item._getRealDomRef = () => this.getDomRef()!.querySelector(`*[data-ui5-stable=${item.stableDomRef}]`)!; + item._getRealDomRef = () => this.shadowRoot!.querySelector(`*[data-ui5-stable=${item.stableDomRef}]`)!; // check if included for lean mode const show = !!item.icon || false; return { diff --git a/packages/fiori/src/ShellBarPopoverTemplate.tsx b/packages/fiori/src/ShellBarPopoverTemplate.tsx index a97604a13117..b32f7491d225 100644 --- a/packages/fiori/src/ShellBarPopoverTemplate.tsx +++ b/packages/fiori/src/ShellBarPopoverTemplate.tsx @@ -32,6 +32,7 @@ export default function PopoversTemplate(this: ShellBar) { key={index} data-count={icon.count} data-ui5-external-action-item-id={icon.refItemid} + data-ui5-stable={icon.stableDomRef} icon={icon.icon ? icon.icon : ""} type="Active" onui5-_press={icon.press} diff --git a/packages/fiori/src/ShellBarTemplate.tsx b/packages/fiori/src/ShellBarTemplate.tsx index 2c57ea234a67..3b69dc799bef 100644 --- a/packages/fiori/src/ShellBarTemplate.tsx +++ b/packages/fiori/src/ShellBarTemplate.tsx @@ -215,7 +215,7 @@ export default function ShellBarTemplate(this: ShellBar) { tooltip={item.tooltip} data-ui5-notifications-count={this.notificationsCount} data-ui5-external-action-item-id={item.refItemid} - data-ui5-stable={item.stableDomRef} + data-ui5-stable={item.icon && !this.isIconHidden(item.icon) ? item.stableDomRef : undefined} onClick={item.press} accessibilityAttributes={item.accessibilityAttributes} > diff --git a/packages/fiori/test/pages/ShellBar_content_button_overflow.html b/packages/fiori/test/pages/ShellBar_content_button_overflow.html new file mode 100644 index 000000000000..9795b40b9082 --- /dev/null +++ b/packages/fiori/test/pages/ShellBar_content_button_overflow.html @@ -0,0 +1,288 @@ + + + + + + Shell Bar - Content Button Overflow + + + + + + + + + + + + + +
+ Hidden Items +
+ +
+
+
+ + + + + + + + + + + + + + + Analytics Dashboard + + + + + + + + North + America + + Refresh + + Filters + +
+ Live Updates + +
+ + Actions + + Export + + + +
+ Report Date: + +
+ + + + + + + + + +
+ +
+
+ ShellBar Content Button Overflow Management + Uses a button in the content area that appears when items are hidden. Resize the browser + window to see how overflow management works. +
+ All items visible +
+
+
+ + + + + + diff --git a/packages/fiori/test/pages/ShellBar_shellbar_item_overflow.html b/packages/fiori/test/pages/ShellBar_shellbar_item_overflow.html new file mode 100644 index 000000000000..8cf256c22b19 --- /dev/null +++ b/packages/fiori/test/pages/ShellBar_shellbar_item_overflow.html @@ -0,0 +1,267 @@ + + + + + + Shell Bar - ShellBar Item Overflow + + + + + + + + + + + + + +
+ Hidden Items +
+ +
+
+
+ + + + + + + + + + + + Project Management + + + + + + + + Project + Alpha + + New Task + + Kanban View + +
+ High Priority + 5 +
+ + Team + + Reports + + + +
+ Deadline: + +
+ + + + + +
+ +
+
+ ShellBar Item Overflow Management + Uses a ui5-shellbar-item that appears when content items are hidden. This provides a more + integrated look in the actions area. +
+ All items visible +
+
+
+ + + + + +