/*! * SAPUI5 * Copyright (c) 2025 SAP SE or an SAP affiliate company. All rights reserved. */ import type ShellBarSearch from "sap/f/gen/ui5/webcomponents_fiori/dist/ShellBarSearch"; import Lib from "sap/ui/core/Lib"; export interface SearchApi { getSearchField: () => Promise; getConfigValue(path: string); } export default class SearchShellLoader { constructor(searchApi: SearchApi) { this.initAsync(searchApi); } async initAsync(searchApi: SearchApi) { const searchField = await searchApi.getSearchField(); const ushell_FF_useWebComponentsSearchInput = searchApi.getConfigValue( "features.useWebComponentsSearchInput" ); // feature flag from ushell (can be adjusted in ABAP stack by customer) to enable search input field webcomponents await Lib.load({ name: "sap.esh.search.ui" }); sap.ui.require(["sap/esh/search/ui/SearchShellHelper"], function (SearchShellHelper) { SearchShellHelper.init({ searchField, ushell_FF_useWebComponentsSearchInput, }); }); } }