* Registers a UI5 Web Component in the browser window object * @public
()
| 1412 | * @public |
| 1413 | */ |
| 1414 | static define(): typeof UI5Element { |
| 1415 | const defineSequence = async () => { |
| 1416 | await boot(); // boot must finish first, because it initializes configuration |
| 1417 | const result = await Promise.all([ |
| 1418 | this.fetchI18nBundles(), // uses configuration |
| 1419 | this.fetchCLDR(), |
| 1420 | this.onDefine(), |
| 1421 | ]); |
| 1422 | const [i18nBundles] = result; |
| 1423 | Object.entries(this.getMetadata().getI18n()).forEach((pair, index) => { |
| 1424 | const bundleName = pair[1].bundleName; |
| 1425 | this.i18nBundleStorage[bundleName] = i18nBundles[index]; |
| 1426 | }); |
| 1427 | this.asyncFinished = true; |
| 1428 | }; |
| 1429 | this._definePromise = defineSequence(); |
| 1430 | |
| 1431 | const tag = this.getMetadata().getTag(); |
| 1432 | |
| 1433 | const definedLocally = isTagRegistered(tag); |
| 1434 | const definedGlobally = customElements.get(tag); |
| 1435 | |
| 1436 | if (definedGlobally && !definedLocally) { |
| 1437 | recordTagRegistrationFailure(tag); |
| 1438 | } else if (!definedGlobally) { |
| 1439 | this._generateAccessors(); |
| 1440 | registerTag(tag); |
| 1441 | customElements.define(tag, this as unknown as CustomElementConstructor); |
| 1442 | } |
| 1443 | |
| 1444 | return this; |
| 1445 | } |
| 1446 | |
| 1447 | /** |
| 1448 | * Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents') |
nothing calls this directly
no test coverage detected
searching dependent graphs…