MCPcopy Create free account
hub / github.com/UI5/webcomponents / init

Method init

packages/base/src/features/OpenUI5Support.ts:121–158  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

119 }
120
121 static init() {
122 if (!OpenUI5Support.isOpenUI5Detected()) {
123 return OpenUI5Support.awaitForOpenUI5();
124 }
125
126 if (!OpenUI5Support.initPromise) {
127 OpenUI5Support.initPromise = new Promise<void>(resolve => {
128 window.sap.ui.require(["sap/ui/core/Core"], async (Core: OpenUI5Core) => {
129 const callback = () => {
130 let deps: Array<string> = ["sap/ui/core/Popup", "sap/m/Dialog", "sap/ui/core/Patcher", "sap/ui/core/LocaleData"];
131 if (OpenUI5Support.isAtLeastVersion(116)) { // for versions since 1.116.0 and onward, use the modular core
132 deps = [
133 ...deps,
134 "sap/base/i18n/Formatting",
135 "sap/base/i18n/Localization",
136 "sap/ui/core/ControlBehavior",
137 "sap/ui/core/Theming",
138 "sap/ui/core/date/CalendarUtils",
139 ];
140 }
141 window.sap.ui.require(deps, (Popup: OpenUI5PopupClass, Dialog: OpenUI5DialogClass, Patcher: OpenUI5Patcher) => {
142 patchPatcher(Patcher);
143 patchPopup(Popup, Dialog);
144 resolve();
145 });
146 };
147 if (OpenUI5Support.isAtLeastVersion(116)) {
148 await Core.ready();
149 callback();
150 } else {
151 Core.attachInit(callback);
152 }
153 });
154 });
155 }
156
157 return OpenUI5Support.initPromise;
158 }
159
160 static getConfigurationSettingsObject() {
161 if (!OpenUI5Support.isOpenUI5Detected()) {

Callers 1

OpenUI5SupportClass · 0.45

Calls 4

callbackFunction · 0.85
isOpenUI5DetectedMethod · 0.80
awaitForOpenUI5Method · 0.80
isAtLeastVersionMethod · 0.80

Tested by

no test coverage detected