diff --git a/packages/fiori/cypress/specs/Search.cy.tsx b/packages/fiori/cypress/specs/Search.cy.tsx index ad96b2cba5d0..0a2fccc75bf0 100644 --- a/packages/fiori/cypress/specs/Search.cy.tsx +++ b/packages/fiori/cypress/specs/Search.cy.tsx @@ -13,6 +13,10 @@ import Avatar from "@ui5/webcomponents/dist/Avatar.js"; import AvatarSize from "@ui5/webcomponents/dist/types/AvatarSize.js"; import type ResponsivePopover from "@ui5/webcomponents/dist/ResponsivePopover.js"; import { SEARCH_ITEM_SHOW_MORE_COUNT, SEARCH_ITEM_SHOW_MORE_NO_COUNT } from "../../src/generated/i18n/i18n-defaults.js"; +import favorite from "@ui5/webcomponents-icons/dist/favorite.js"; +import edit from "@ui5/webcomponents-icons/dist/edit.js"; +import share from "@ui5/webcomponents-icons/dist/share.js"; +import copy from "@ui5/webcomponents-icons/dist/copy.js"; describe("Properties", () => { it("items slot with groups", () => { @@ -509,6 +513,188 @@ describe("Properties", () => { .find(".ui5-search-item-selected-delete") .should("not.exist"); }); + + it("displays action buttons in actions slot", () => { + cy.mount( + + + - } +
+ {this.hasActions && +
+ +
+ } + + {this.deletable && + + } +
diff --git a/packages/fiori/src/themes/SearchItem.css b/packages/fiori/src/themes/SearchItem.css index 00eb8f3a0e6d..deef749c5ed5 100644 --- a/packages/fiori/src/themes/SearchItem.css +++ b/packages/fiori/src/themes/SearchItem.css @@ -24,15 +24,35 @@ flex: 1; } +.ui5-search-item-actions-container { + display: flex; + align-items: center; + gap: 0.125rem; +} + :host([desktop]) .ui5-search-item-selected-delete { display: none; } +:host([desktop]) .ui5-search-item-actions { + display: none; +} + :host(:hover), :host(:focus-within) { .ui5-search-item-selected-delete { display: inline-block; } + + .ui5-search-item-actions { + display: flex; + } +} + +.ui5-search-item-actions { + display: flex; + align-items: center; + gap: 0.25rem; } .ui5-search-item-text { @@ -85,4 +105,4 @@ white-space: nowrap; overflow: hidden; text-overflow: ellipsis; -} \ No newline at end of file +} diff --git a/packages/fiori/test/pages/Search.html b/packages/fiori/test/pages/Search.html index 475006aebff2..6c914b80b5b7 100644 --- a/packages/fiori/test/pages/Search.html +++ b/packages/fiori/test/pages/Search.html @@ -182,6 +182,28 @@ +
+ Search with Actions - Example of flexible action slot + + + + + + + + + + + + + Important + + + + Hover over search items to see secondary actions. Use Tab/Shift+Tab to navigate between action buttons and delete button. + +
+
Search with Suggestions - Filter by typing