@ui5/webcomponents-base 0.0.0-47cc17a26 → 0.0.0-49bade48d

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (373) hide show
  1. package/AGENTS.md +195 -0
  2. package/CHANGELOG.md +362 -1
  3. package/CLAUDE.md +1 -0
  4. package/dist/.tsbuildinfobuild +1 -1
  5. package/dist/Boot.d.ts +2 -1
  6. package/dist/Boot.js +42 -14
  7. package/dist/Boot.js.map +1 -1
  8. package/dist/CustomElementsScopeUtils.d.ts +11 -4
  9. package/dist/CustomElementsScopeUtils.js +15 -5
  10. package/dist/CustomElementsScopeUtils.js.map +1 -1
  11. package/dist/FontFace.css +36 -0
  12. package/dist/InitialConfiguration.d.ts +2 -1
  13. package/dist/InitialConfiguration.js +10 -11
  14. package/dist/InitialConfiguration.js.map +1 -1
  15. package/dist/ManagedStyles.js +1 -1
  16. package/dist/ManagedStyles.js.map +1 -1
  17. package/dist/Render.d.ts +9 -1
  18. package/dist/Render.js +15 -3
  19. package/dist/Render.js.map +1 -1
  20. package/dist/Runtimes.d.ts +6 -1
  21. package/dist/Runtimes.js +25 -24
  22. package/dist/Runtimes.js.map +1 -1
  23. package/dist/SystemCSSVars.js +2 -4
  24. package/dist/SystemCSSVars.js.map +1 -1
  25. package/dist/UI5Element.d.ts +33 -7
  26. package/dist/UI5Element.js +73 -25
  27. package/dist/UI5Element.js.map +1 -1
  28. package/dist/UI5ElementMetadata.js +1 -1
  29. package/dist/UI5ElementMetadata.js.map +1 -1
  30. package/dist/asset-registries/Icons.d.ts +1 -0
  31. package/dist/asset-registries/Icons.js +1 -0
  32. package/dist/asset-registries/Icons.js.map +1 -1
  33. package/dist/asset-registries/Themes.d.ts +5 -2
  34. package/dist/asset-registries/Themes.js +3 -3
  35. package/dist/asset-registries/Themes.js.map +1 -1
  36. package/dist/config/ConfigurationSync.d.ts +16 -0
  37. package/dist/config/ConfigurationSync.js +42 -0
  38. package/dist/config/ConfigurationSync.js.map +1 -0
  39. package/dist/config/Language.js +13 -1
  40. package/dist/config/Language.js.map +1 -1
  41. package/dist/config/Theme.d.ts +13 -1
  42. package/dist/config/Theme.js +27 -2
  43. package/dist/config/Theme.js.map +1 -1
  44. package/dist/config/ThemeRoot.js +12 -7
  45. package/dist/config/ThemeRoot.js.map +1 -1
  46. package/dist/config/UrlParams.d.ts +20 -0
  47. package/dist/config/UrlParams.js +30 -0
  48. package/dist/config/UrlParams.js.map +1 -0
  49. package/dist/createReactComponent.d.ts +26 -0
  50. package/dist/createReactComponent.js +51 -0
  51. package/dist/createReactComponent.js.map +1 -0
  52. package/dist/css/OpenUI5PopupStyles.css +5 -0
  53. package/dist/css/SystemCSSVars.css +28 -3
  54. package/dist/custom-elements-internal.json +402 -309
  55. package/dist/custom-elements.json +346 -253
  56. package/dist/decorators/slot-strict.d.ts +27 -0
  57. package/dist/decorators/slot-strict.js +54 -0
  58. package/dist/decorators/slot-strict.js.map +1 -0
  59. package/dist/decorators/slot.d.ts +18 -0
  60. package/dist/decorators/slot.js +18 -0
  61. package/dist/decorators/slot.js.map +1 -1
  62. package/dist/decorators.d.ts +2 -1
  63. package/dist/decorators.js +2 -1
  64. package/dist/decorators.js.map +1 -1
  65. package/dist/features/F6Navigation.d.ts +1 -0
  66. package/dist/features/F6Navigation.js +4 -0
  67. package/dist/features/F6Navigation.js.map +1 -1
  68. package/dist/features/InputElementsFormSupport.d.ts +1 -1
  69. package/dist/features/InputElementsFormSupport.js +26 -4
  70. package/dist/features/InputElementsFormSupport.js.map +1 -1
  71. package/dist/features/OpenUI5Support.d.ts +12 -6
  72. package/dist/features/OpenUI5Support.js +55 -24
  73. package/dist/features/OpenUI5Support.js.map +1 -1
  74. package/dist/features/patchPatcher.d.ts +7 -6
  75. package/dist/features/patchPatcher.js +14 -4
  76. package/dist/features/patchPatcher.js.map +1 -1
  77. package/dist/features/patchPopup.d.ts +17 -12
  78. package/dist/features/patchPopup.js +99 -27
  79. package/dist/features/patchPopup.js.map +1 -1
  80. package/dist/generated/AssetParameters.js +1 -1
  81. package/dist/generated/AssetParameters.js.map +1 -1
  82. package/dist/generated/VersionInfo.js +3 -3
  83. package/dist/generated/VersionInfo.js.map +1 -1
  84. package/dist/generated/assets/i18n/messagebundle_ar.json +1 -0
  85. package/dist/generated/assets/i18n/messagebundle_bg.json +1 -0
  86. package/dist/generated/assets/i18n/messagebundle_ca.json +1 -0
  87. package/dist/generated/assets/i18n/messagebundle_cnr.json +1 -0
  88. package/dist/generated/assets/i18n/messagebundle_cs.json +1 -0
  89. package/dist/generated/assets/i18n/messagebundle_cy.json +1 -0
  90. package/dist/generated/assets/i18n/messagebundle_da.json +1 -0
  91. package/dist/generated/assets/i18n/messagebundle_de.json +1 -0
  92. package/dist/generated/assets/i18n/messagebundle_el.json +1 -0
  93. package/dist/generated/assets/i18n/messagebundle_en_GB.json +1 -0
  94. package/dist/generated/assets/i18n/messagebundle_es.json +1 -0
  95. package/dist/generated/assets/i18n/messagebundle_es_MX.json +1 -0
  96. package/dist/generated/assets/i18n/messagebundle_et.json +1 -0
  97. package/dist/generated/assets/i18n/messagebundle_fi.json +1 -0
  98. package/dist/generated/assets/i18n/messagebundle_fr.json +1 -0
  99. package/dist/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
  100. package/dist/generated/assets/i18n/messagebundle_hi.json +1 -0
  101. package/dist/generated/assets/i18n/messagebundle_hr.json +1 -0
  102. package/dist/generated/assets/i18n/messagebundle_hu.json +1 -0
  103. package/dist/generated/assets/i18n/messagebundle_id.json +1 -0
  104. package/dist/generated/assets/i18n/messagebundle_it.json +1 -0
  105. package/dist/generated/assets/i18n/messagebundle_iw.json +1 -0
  106. package/dist/generated/assets/i18n/messagebundle_ja.json +1 -0
  107. package/dist/generated/assets/i18n/messagebundle_kk.json +1 -0
  108. package/dist/generated/assets/i18n/messagebundle_ko.json +1 -0
  109. package/dist/generated/assets/i18n/messagebundle_lt.json +1 -0
  110. package/dist/generated/assets/i18n/messagebundle_lv.json +1 -0
  111. package/dist/generated/assets/i18n/messagebundle_mk.json +1 -0
  112. package/dist/generated/assets/i18n/messagebundle_ms.json +1 -0
  113. package/dist/generated/assets/i18n/messagebundle_nl.json +1 -0
  114. package/dist/generated/assets/i18n/messagebundle_no.json +1 -0
  115. package/dist/generated/assets/i18n/messagebundle_pl.json +1 -0
  116. package/dist/generated/assets/i18n/messagebundle_pt.json +1 -0
  117. package/dist/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
  118. package/dist/generated/assets/i18n/messagebundle_ro.json +1 -0
  119. package/dist/generated/assets/i18n/messagebundle_ru.json +1 -0
  120. package/dist/generated/assets/i18n/messagebundle_sh.json +1 -0
  121. package/dist/generated/assets/i18n/messagebundle_sk.json +1 -0
  122. package/dist/generated/assets/i18n/messagebundle_sl.json +1 -0
  123. package/dist/generated/assets/i18n/messagebundle_sr.json +1 -0
  124. package/dist/generated/assets/i18n/messagebundle_sv.json +1 -0
  125. package/dist/generated/assets/i18n/messagebundle_th.json +1 -0
  126. package/dist/generated/assets/i18n/messagebundle_tr.json +1 -0
  127. package/dist/generated/assets/i18n/messagebundle_uk.json +1 -0
  128. package/dist/generated/assets/i18n/messagebundle_vi.json +1 -0
  129. package/dist/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
  130. package/dist/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
  131. package/dist/generated/css/FontFace.css.d.ts +1 -1
  132. package/dist/generated/css/FontFace.css.js +36 -36
  133. package/dist/generated/css/FontFace.css.js.map +1 -1
  134. package/dist/generated/css/OpenUI5PopupStyles.css.d.ts +1 -1
  135. package/dist/generated/css/OpenUI5PopupStyles.css.js +1 -1
  136. package/dist/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
  137. package/dist/generated/css/SystemCSSVars.css.d.ts +1 -1
  138. package/dist/generated/css/SystemCSSVars.css.js +1 -1
  139. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  140. package/dist/index.d.ts +3 -1
  141. package/dist/index.js +4 -2
  142. package/dist/index.js.map +1 -1
  143. package/dist/prod/Boot.js +1 -1
  144. package/dist/prod/Boot.js.map +3 -3
  145. package/dist/prod/CustomElementsScopeUtils.js +1 -1
  146. package/dist/prod/CustomElementsScopeUtils.js.map +3 -3
  147. package/dist/prod/InitialConfiguration.js +1 -1
  148. package/dist/prod/InitialConfiguration.js.map +3 -3
  149. package/dist/prod/ManagedStyles.js +1 -1
  150. package/dist/prod/ManagedStyles.js.map +2 -2
  151. package/dist/prod/Render.js +1 -1
  152. package/dist/prod/Render.js.map +3 -3
  153. package/dist/prod/Runtimes.js +1 -1
  154. package/dist/prod/Runtimes.js.map +3 -3
  155. package/dist/prod/SystemCSSVars.js +1 -1
  156. package/dist/prod/SystemCSSVars.js.map +3 -3
  157. package/dist/prod/UI5Element.js +1 -1
  158. package/dist/prod/UI5Element.js.map +3 -3
  159. package/dist/prod/UI5ElementMetadata.js +1 -1
  160. package/dist/prod/UI5ElementMetadata.js.map +2 -2
  161. package/dist/prod/asset-registries/Icons.js +1 -1
  162. package/dist/prod/asset-registries/Icons.js.map +2 -2
  163. package/dist/prod/asset-registries/Themes.js +1 -1
  164. package/dist/prod/asset-registries/Themes.js.map +3 -3
  165. package/dist/prod/config/ConfigurationSync.js +2 -0
  166. package/dist/prod/config/ConfigurationSync.js.map +7 -0
  167. package/dist/prod/config/Language.js +1 -1
  168. package/dist/prod/config/Language.js.map +3 -3
  169. package/dist/prod/config/Theme.js +1 -1
  170. package/dist/prod/config/Theme.js.map +3 -3
  171. package/dist/prod/config/ThemeRoot.js +1 -1
  172. package/dist/prod/config/ThemeRoot.js.map +3 -3
  173. package/dist/prod/config/UrlParams.js +2 -0
  174. package/dist/prod/config/UrlParams.js.map +7 -0
  175. package/dist/prod/createReactComponent.js +2 -0
  176. package/dist/prod/createReactComponent.js.map +7 -0
  177. package/dist/prod/decorators/slot-strict.js +2 -0
  178. package/dist/prod/decorators/slot-strict.js.map +7 -0
  179. package/dist/prod/decorators/slot.js.map +2 -2
  180. package/dist/prod/decorators.js +1 -1
  181. package/dist/prod/decorators.js.map +3 -3
  182. package/dist/prod/features/F6Navigation.js +1 -1
  183. package/dist/prod/features/F6Navigation.js.map +2 -2
  184. package/dist/prod/features/InputElementsFormSupport.js +1 -1
  185. package/dist/prod/features/InputElementsFormSupport.js.map +3 -3
  186. package/dist/prod/features/OpenUI5Support.js +1 -1
  187. package/dist/prod/features/OpenUI5Support.js.map +3 -3
  188. package/dist/prod/features/patchPatcher.js +1 -1
  189. package/dist/prod/features/patchPatcher.js.map +3 -3
  190. package/dist/prod/features/patchPopup.js +1 -1
  191. package/dist/prod/features/patchPopup.js.map +3 -3
  192. package/dist/prod/generated/AssetParameters.js +1 -1
  193. package/dist/prod/generated/AssetParameters.js.map +2 -2
  194. package/dist/prod/generated/VersionInfo.js +1 -1
  195. package/dist/prod/generated/VersionInfo.js.map +1 -1
  196. package/dist/prod/generated/assets/i18n/messagebundle_ar.json +1 -0
  197. package/dist/prod/generated/assets/i18n/messagebundle_bg.json +1 -0
  198. package/dist/prod/generated/assets/i18n/messagebundle_ca.json +1 -0
  199. package/dist/prod/generated/assets/i18n/messagebundle_cnr.json +1 -0
  200. package/dist/prod/generated/assets/i18n/messagebundle_cs.json +1 -0
  201. package/dist/prod/generated/assets/i18n/messagebundle_cy.json +1 -0
  202. package/dist/prod/generated/assets/i18n/messagebundle_da.json +1 -0
  203. package/dist/prod/generated/assets/i18n/messagebundle_de.json +1 -0
  204. package/dist/prod/generated/assets/i18n/messagebundle_el.json +1 -0
  205. package/dist/prod/generated/assets/i18n/messagebundle_en_GB.json +1 -0
  206. package/dist/prod/generated/assets/i18n/messagebundle_es.json +1 -0
  207. package/dist/prod/generated/assets/i18n/messagebundle_es_MX.json +1 -0
  208. package/dist/prod/generated/assets/i18n/messagebundle_et.json +1 -0
  209. package/dist/prod/generated/assets/i18n/messagebundle_fi.json +1 -0
  210. package/dist/prod/generated/assets/i18n/messagebundle_fr.json +1 -0
  211. package/dist/prod/generated/assets/i18n/messagebundle_fr_CA.json +1 -0
  212. package/dist/prod/generated/assets/i18n/messagebundle_hi.json +1 -0
  213. package/dist/prod/generated/assets/i18n/messagebundle_hr.json +1 -0
  214. package/dist/prod/generated/assets/i18n/messagebundle_hu.json +1 -0
  215. package/dist/prod/generated/assets/i18n/messagebundle_id.json +1 -0
  216. package/dist/prod/generated/assets/i18n/messagebundle_it.json +1 -0
  217. package/dist/prod/generated/assets/i18n/messagebundle_iw.json +1 -0
  218. package/dist/prod/generated/assets/i18n/messagebundle_ja.json +1 -0
  219. package/dist/prod/generated/assets/i18n/messagebundle_kk.json +1 -0
  220. package/dist/prod/generated/assets/i18n/messagebundle_ko.json +1 -0
  221. package/dist/prod/generated/assets/i18n/messagebundle_lt.json +1 -0
  222. package/dist/prod/generated/assets/i18n/messagebundle_lv.json +1 -0
  223. package/dist/prod/generated/assets/i18n/messagebundle_mk.json +1 -0
  224. package/dist/prod/generated/assets/i18n/messagebundle_ms.json +1 -0
  225. package/dist/prod/generated/assets/i18n/messagebundle_nl.json +1 -0
  226. package/dist/prod/generated/assets/i18n/messagebundle_no.json +1 -0
  227. package/dist/prod/generated/assets/i18n/messagebundle_pl.json +1 -0
  228. package/dist/prod/generated/assets/i18n/messagebundle_pt.json +1 -0
  229. package/dist/prod/generated/assets/i18n/messagebundle_pt_PT.json +1 -0
  230. package/dist/prod/generated/assets/i18n/messagebundle_ro.json +1 -0
  231. package/dist/prod/generated/assets/i18n/messagebundle_ru.json +1 -0
  232. package/dist/prod/generated/assets/i18n/messagebundle_sh.json +1 -0
  233. package/dist/prod/generated/assets/i18n/messagebundle_sk.json +1 -0
  234. package/dist/prod/generated/assets/i18n/messagebundle_sl.json +1 -0
  235. package/dist/prod/generated/assets/i18n/messagebundle_sr.json +1 -0
  236. package/dist/prod/generated/assets/i18n/messagebundle_sv.json +1 -0
  237. package/dist/prod/generated/assets/i18n/messagebundle_th.json +1 -0
  238. package/dist/prod/generated/assets/i18n/messagebundle_tr.json +1 -0
  239. package/dist/prod/generated/assets/i18n/messagebundle_uk.json +1 -0
  240. package/dist/prod/generated/assets/i18n/messagebundle_vi.json +1 -0
  241. package/dist/prod/generated/assets/i18n/messagebundle_zh_CN.json +1 -0
  242. package/dist/prod/generated/assets/i18n/messagebundle_zh_TW.json +1 -0
  243. package/dist/prod/generated/css/FontFace.css.js +36 -36
  244. package/dist/prod/generated/css/FontFace.css.js.map +1 -1
  245. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js +1 -1
  246. package/dist/prod/generated/css/OpenUI5PopupStyles.css.js.map +1 -1
  247. package/dist/prod/generated/css/SystemCSSVars.css.js +1 -1
  248. package/dist/prod/generated/css/SystemCSSVars.css.js.map +1 -1
  249. package/dist/prod/index.js +1 -1
  250. package/dist/prod/index.js.map +3 -3
  251. package/dist/prod/sap/base/Log.js +15 -29
  252. package/dist/prod/sap/base/assert.js +1 -1
  253. package/dist/prod/sap/base/config/MemoryConfigurationProvider.js +1 -1
  254. package/dist/prod/sap/base/security/URLListValidator.js +9 -5
  255. package/dist/prod/sap/base/security/encodeCSS.js +1 -1
  256. package/dist/prod/sap/base/security/encodeXML.js +1 -1
  257. package/dist/prod/sap/base/security/sanitizeHTML.js +1 -1
  258. package/dist/prod/sap/base/strings/toHex.js +1 -1
  259. package/dist/prod/sap/base/util/now.js +7 -13
  260. package/dist/prod/sap/base/util/uid.js +1 -1
  261. package/dist/prod/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
  262. package/dist/prod/theming/applyTheme.js +1 -1
  263. package/dist/prod/theming/applyTheme.js.map +3 -3
  264. package/dist/prod/theming/componentStyles.js +3 -0
  265. package/dist/prod/theming/componentStyles.js.map +7 -0
  266. package/dist/prod/thirdparty/preact/preact.module.js +1 -1
  267. package/dist/prod/updateShadowRoot.js +1 -1
  268. package/dist/prod/updateShadowRoot.js.map +3 -3
  269. package/dist/prod/util/SelectionAssistant.js.map +1 -1
  270. package/dist/prod/util/createInstanceChecker.js +2 -0
  271. package/dist/prod/util/createInstanceChecker.js.map +7 -0
  272. package/dist/prod/util/createMultiInstanceChecker.js +2 -0
  273. package/dist/prod/util/createMultiInstanceChecker.js.map +7 -0
  274. package/dist/prod/util/dragAndDrop/DragRegistry.js +1 -1
  275. package/dist/prod/util/dragAndDrop/DragRegistry.js.map +3 -3
  276. package/dist/prod/util/generateHighlightedMarkupFirstMatch.js +2 -0
  277. package/dist/prod/util/generateHighlightedMarkupFirstMatch.js.map +7 -0
  278. package/dist/prod/validateThemeRoot.js +1 -1
  279. package/dist/prod/validateThemeRoot.js.map +3 -3
  280. package/dist/react18/createReactComponent.d.ts +38 -0
  281. package/dist/react18/createReactComponent.js +112 -0
  282. package/dist/react18/createReactComponent.js.map +1 -0
  283. package/dist/sap/base/Log.js +15 -29
  284. package/dist/sap/base/assert.js +1 -1
  285. package/dist/sap/base/config/MemoryConfigurationProvider.js +1 -1
  286. package/dist/sap/base/security/URLListValidator.js +9 -5
  287. package/dist/sap/base/security/encodeCSS.js +1 -1
  288. package/dist/sap/base/security/encodeXML.js +1 -1
  289. package/dist/sap/base/security/sanitizeHTML.js +1 -1
  290. package/dist/sap/base/strings/toHex.js +1 -1
  291. package/dist/sap/base/util/now.js +7 -13
  292. package/dist/sap/base/util/uid.js +1 -1
  293. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +15 -3
  294. package/dist/theming/applyTheme.js +14 -4
  295. package/dist/theming/applyTheme.js.map +1 -1
  296. package/dist/theming/componentStyles.d.ts +3 -0
  297. package/dist/theming/componentStyles.js +15 -0
  298. package/dist/theming/componentStyles.js.map +1 -0
  299. package/dist/thirdparty/preact/preact.module.js +1 -1
  300. package/dist/types.d.ts +3 -0
  301. package/dist/types.js.map +1 -1
  302. package/dist/updateShadowRoot.js +2 -1
  303. package/dist/updateShadowRoot.js.map +1 -1
  304. package/dist/util/SelectionAssistant.js.map +1 -1
  305. package/dist/util/createInstanceChecker.d.ts +2 -0
  306. package/dist/util/createInstanceChecker.js +8 -0
  307. package/dist/util/createInstanceChecker.js.map +1 -0
  308. package/dist/util/createMultiInstanceChecker.d.ts +2 -0
  309. package/dist/util/createMultiInstanceChecker.js +19 -0
  310. package/dist/util/createMultiInstanceChecker.js.map +1 -0
  311. package/dist/util/dragAndDrop/DragRegistry.d.ts +1 -1
  312. package/dist/util/dragAndDrop/DragRegistry.js +5 -1
  313. package/dist/util/dragAndDrop/DragRegistry.js.map +1 -1
  314. package/dist/util/generateHighlightedMarkupFirstMatch.d.ts +10 -0
  315. package/dist/util/generateHighlightedMarkupFirstMatch.js +36 -0
  316. package/dist/util/generateHighlightedMarkupFirstMatch.js.map +1 -0
  317. package/dist/util/getClassCopy.d.ts +2 -1
  318. package/dist/validateThemeRoot.js +18 -11
  319. package/dist/validateThemeRoot.js.map +1 -1
  320. package/dist/vscode.html-custom-data.json +1 -1
  321. package/package-scripts.cjs +6 -6
  322. package/package.json +17 -10
  323. package/src/css/OpenUI5PopupStyles.css +5 -0
  324. package/src/css/SystemCSSVars.css +28 -3
  325. package/src/i18n/messagebundle_ar.properties +2 -0
  326. package/src/i18n/messagebundle_bg.properties +2 -0
  327. package/src/i18n/messagebundle_ca.properties +2 -0
  328. package/src/i18n/messagebundle_cnr.properties +2 -0
  329. package/src/i18n/messagebundle_cs.properties +2 -0
  330. package/src/i18n/messagebundle_cy.properties +2 -0
  331. package/src/i18n/messagebundle_da.properties +2 -0
  332. package/src/i18n/messagebundle_de.properties +2 -0
  333. package/src/i18n/messagebundle_el.properties +2 -0
  334. package/src/i18n/messagebundle_en_GB.properties +2 -0
  335. package/src/i18n/messagebundle_es.properties +2 -0
  336. package/src/i18n/messagebundle_es_MX.properties +2 -0
  337. package/src/i18n/messagebundle_et.properties +2 -0
  338. package/src/i18n/messagebundle_fi.properties +2 -0
  339. package/src/i18n/messagebundle_fr.properties +2 -0
  340. package/src/i18n/messagebundle_fr_CA.properties +2 -0
  341. package/src/i18n/messagebundle_hi.properties +2 -0
  342. package/src/i18n/messagebundle_hr.properties +2 -0
  343. package/src/i18n/messagebundle_hu.properties +2 -0
  344. package/src/i18n/messagebundle_id.properties +2 -0
  345. package/src/i18n/messagebundle_it.properties +2 -0
  346. package/src/i18n/messagebundle_iw.properties +2 -0
  347. package/src/i18n/messagebundle_ja.properties +2 -0
  348. package/src/i18n/messagebundle_kk.properties +2 -0
  349. package/src/i18n/messagebundle_ko.properties +2 -0
  350. package/src/i18n/messagebundle_lt.properties +2 -0
  351. package/src/i18n/messagebundle_lv.properties +2 -0
  352. package/src/i18n/messagebundle_mk.properties +2 -0
  353. package/src/i18n/messagebundle_ms.properties +2 -0
  354. package/src/i18n/messagebundle_nl.properties +2 -0
  355. package/src/i18n/messagebundle_no.properties +2 -0
  356. package/src/i18n/messagebundle_pl.properties +2 -0
  357. package/src/i18n/messagebundle_pt.properties +2 -0
  358. package/src/i18n/messagebundle_pt_PT.properties +2 -0
  359. package/src/i18n/messagebundle_ro.properties +2 -0
  360. package/src/i18n/messagebundle_ru.properties +2 -0
  361. package/src/i18n/messagebundle_sh.properties +2 -0
  362. package/src/i18n/messagebundle_sk.properties +2 -0
  363. package/src/i18n/messagebundle_sl.properties +2 -0
  364. package/src/i18n/messagebundle_sr.properties +2 -0
  365. package/src/i18n/messagebundle_sv.properties +2 -0
  366. package/src/i18n/messagebundle_th.properties +2 -0
  367. package/src/i18n/messagebundle_tr.properties +2 -0
  368. package/src/i18n/messagebundle_uk.properties +2 -0
  369. package/src/i18n/messagebundle_vi.properties +2 -0
  370. package/src/i18n/messagebundle_zh_CN.properties +2 -0
  371. package/src/i18n/messagebundle_zh_TW.properties +2 -0
  372. package/src/react18/createReactComponent.tsx +140 -0
  373. package/src/thirdparty/preact/preact.module.js +1 -1
@@ -0,0 +1,27 @@
1
+ import type { Slot, DefaultSlot } from "../UI5Element.js";
2
+ import type { Slot as SlotMetadata } from "../UI5ElementMetadata.js";
3
+ /**
4
+ * Decorator for declaring a slot in a UI5 Web Component.
5
+ * It adds the slot metadata to the component's constructor.
6
+ *
7
+ * @public
8
+ * @since 2.19.0
9
+ * @param { SlotMetadata } slotData - Optional metadata for the slot, including type and default flag.
10
+ *
11
+ * Example usage:
12
+ * ```ts
13
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
14
+ * import type { DefaultSlot, Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
15
+ *
16
+ * class MyComponent extends UI5Element {
17
+ *
18
+ * @slot()
19
+ * header!: Slot<HTMLElement>;
20
+ *
21
+ * @slot({ type: HTMLElement, default: true })
22
+ * items!: DefaultSlot<HTMLElement>;
23
+ * }
24
+ * ```
25
+ */
26
+ declare function slot<T extends Record<K, Slot<unknown> | DefaultSlot<unknown>>, K extends string>(slotData?: SlotMetadata): (target: T, prop: K) => void;
27
+ export default slot;
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Decorator for declaring a slot in a UI5 Web Component.
3
+ * It adds the slot metadata to the component's constructor.
4
+ *
5
+ * @public
6
+ * @since 2.19.0
7
+ * @param { SlotMetadata } slotData - Optional metadata for the slot, including type and default flag.
8
+ *
9
+ * Example usage:
10
+ * ```ts
11
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
12
+ * import type { DefaultSlot, Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
13
+ *
14
+ * class MyComponent extends UI5Element {
15
+ *
16
+ * @slot()
17
+ * header!: Slot<HTMLElement>;
18
+ *
19
+ * @slot({ type: HTMLElement, default: true })
20
+ * items!: DefaultSlot<HTMLElement>;
21
+ * }
22
+ * ```
23
+ */
24
+ function slot(slotData) {
25
+ return (target, slotKey) => {
26
+ const ctor = target.constructor;
27
+ if (!Object.prototype.hasOwnProperty.call(ctor, "metadata")) {
28
+ ctor.metadata = {};
29
+ }
30
+ const metadata = ctor.metadata;
31
+ if (!metadata.slots) {
32
+ metadata.slots = {};
33
+ }
34
+ const slotMetadata = metadata.slots;
35
+ if (slotData && slotData.default && slotMetadata.default) {
36
+ throw new Error("Only one slot can be the default slot.");
37
+ }
38
+ const key = slotData && slotData.default ? "default" : slotKey;
39
+ slotData = slotData || { type: HTMLElement };
40
+ if (!slotData.type) {
41
+ slotData.type = HTMLElement;
42
+ }
43
+ if (!slotMetadata[key]) {
44
+ slotMetadata[key] = slotData;
45
+ }
46
+ if (slotData.default) {
47
+ delete slotMetadata.default.default;
48
+ slotMetadata.default.propertyName = slotKey;
49
+ }
50
+ ctor.metadata.managedSlots = true;
51
+ };
52
+ }
53
+ export default slot;
54
+ //# sourceMappingURL=slot-strict.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slot-strict.js","sourceRoot":"","sources":["../../src/decorators/slot-strict.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAS,IAAI,CAGX,QAAuB;IACxB,OAAO,CAAC,MAAW,EAAE,OAAwB,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACrB,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;QACrB,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QAEpC,IAAI,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,OAAkB,CAAC;QAC3E,QAAQ,GAAG,QAAQ,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;YACpC,YAAY,CAAC,OAAO,CAAC,YAAY,GAAG,OAAiB,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC;AACH,CAAC;AAED,eAAe,IAAI,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Slot, DefaultSlot } from \"../UI5Element.js\";\nimport type { Slot as SlotMetadata } from \"../UI5ElementMetadata.js\";\n\n/**\n * Decorator for declaring a slot in a UI5 Web Component.\n * It adds the slot metadata to the component's constructor.\n *\n * @public\n * @since 2.19.0\n * @param { SlotMetadata } slotData - Optional metadata for the slot, including type and default flag.\n *\n * Example usage:\n * ```ts\n * import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\n * import type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n *\n * class MyComponent extends UI5Element {\n *\n * @slot()\n * header!: Slot<HTMLElement>;\n *\n * @slot({ type: HTMLElement, default: true })\n * items!: DefaultSlot<HTMLElement>;\n * }\n * ```\n */\nfunction slot<\n\tT extends Record<K, Slot<unknown> | DefaultSlot<unknown>>,\n\tK extends string\n>(slotData?: SlotMetadata): (target: T, prop: K) => void {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : (slotKey as string);\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n}\n\nexport default slot;\n"]}
@@ -3,6 +3,24 @@ import type { Slot } from "../UI5ElementMetadata.js";
3
3
  * Returns a slot decorator.
4
4
  *
5
5
  * @param { Slot } slotData
6
+ * @deprecated since 2.19.0, please use the `@ui5/webcomponents-base/dist/decorators/slot-strict.js` decorator instead.
7
+ * For Example:
8
+ * ```ts
9
+ * // If you previously used the `slot` decorator:
10
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
11
+ *
12
+ * // Now use `slot-strict` decorator + `DefaultSlot` and `Slot` types for slot members:
13
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
14
+ * import type { DefaultSlot, Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
15
+ *
16
+ * class MyComponent extends UI5Element {
17
+ * @slot()
18
+ * header!: Slot<T> // Array<T> -> Slot<T>
19
+ *
20
+ * @slot({ type: HTMLElement, default: true })
21
+ * items!: DefaultSlot<T>; // Array<T> -> DefaultSlot<T>
22
+ * }
23
+ * ```
6
24
  * @returns { PropertyDecorator }
7
25
  */
8
26
  declare const slot: (slotData?: Slot) => PropertyDecorator;
@@ -2,6 +2,24 @@
2
2
  * Returns a slot decorator.
3
3
  *
4
4
  * @param { Slot } slotData
5
+ * @deprecated since 2.19.0, please use the `@ui5/webcomponents-base/dist/decorators/slot-strict.js` decorator instead.
6
+ * For Example:
7
+ * ```ts
8
+ * // If you previously used the `slot` decorator:
9
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot.js";
10
+ *
11
+ * // Now use `slot-strict` decorator + `DefaultSlot` and `Slot` types for slot members:
12
+ * import slot from "@ui5/webcomponents-base/dist/decorators/slot-strict.js";
13
+ * import type { DefaultSlot, Slot } from "@ui5/webcomponents-base/dist/UI5Element.js";
14
+ *
15
+ * class MyComponent extends UI5Element {
16
+ * @slot()
17
+ * header!: Slot<T> // Array<T> -> Slot<T>
18
+ *
19
+ * @slot({ type: HTMLElement, default: true })
20
+ * items!: DefaultSlot<T>; // Array<T> -> DefaultSlot<T>
21
+ * }
22
+ * ```
5
23
  * @returns { PropertyDecorator }
6
24
  */
7
25
  const slot = (slotData) => {
@@ -1 +1 @@
1
- {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/decorators/slot.ts"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,MAAM,IAAI,GAAG,CAAC,QAAe,EAAqB,EAAE;IACnD,OAAO,CAAC,MAAW,EAAE,OAAwB,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACrB,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;QACrB,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QAEpC,IAAI,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAiB,CAAC;QACzE,QAAQ,GAAG,QAAQ,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;YACpC,YAAY,CAAC,OAAO,CAAC,YAAY,GAAG,OAAiB,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Slot } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a slot decorator.\n *\n * @param { Slot } slotData\n * @returns { PropertyDecorator }\n */\nconst slot = (slotData?: Slot): PropertyDecorator => {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : slotKey as string;\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n};\n\nexport default slot;\n"]}
1
+ {"version":3,"file":"slot.js","sourceRoot":"","sources":["../../src/decorators/slot.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,IAAI,GAAG,CAAC,QAAe,EAAqB,EAAE;IACnD,OAAO,CAAC,MAAW,EAAE,OAAwB,EAAE,EAAE;QAChD,MAAM,IAAI,GAAG,MAAM,CAAC,WAAgC,CAAC;QAErD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,EAAE,CAAC;YAC7D,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACpB,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;YACrB,QAAQ,CAAC,KAAK,GAAG,EAAE,CAAC;QACrB,CAAC;QAED,MAAM,YAAY,GAAG,QAAQ,CAAC,KAAK,CAAC;QAEpC,IAAI,QAAQ,IAAI,QAAQ,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YAC1D,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC3D,CAAC;QAED,MAAM,GAAG,GAAG,QAAQ,IAAI,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAiB,CAAC;QACzE,QAAQ,GAAG,QAAQ,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;QAE7C,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YACpB,QAAQ,CAAC,IAAI,GAAG,WAAW,CAAC;QAC7B,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC9B,CAAC;QAED,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,OAAO,YAAY,CAAC,OAAO,CAAC,OAAO,CAAC;YACpC,YAAY,CAAC,OAAO,CAAC,YAAY,GAAG,OAAiB,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,QAAQ,CAAC,YAAY,GAAG,IAAI,CAAC;IACnC,CAAC,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\nimport type { Slot } from \"../UI5ElementMetadata.js\";\n\n/**\n * Returns a slot decorator.\n *\n * @param { Slot } slotData\n * @deprecated since 2.19.0, please use the `@ui5/webcomponents-base/dist/decorators/slot-strict.js` decorator instead.\n * For Example:\n * ```ts\n * // If you previously used the `slot` decorator:\n * import slot from \"@ui5/webcomponents-base/dist/decorators/slot.js\";\n *\n * // Now use `slot-strict` decorator + `DefaultSlot` and `Slot` types for slot members:\n * import slot from \"@ui5/webcomponents-base/dist/decorators/slot-strict.js\";\n * import type { DefaultSlot, Slot } from \"@ui5/webcomponents-base/dist/UI5Element.js\";\n *\n * class MyComponent extends UI5Element {\n * @slot()\n * header!: Slot<T> // Array<T> -> Slot<T>\n *\n * @slot({ type: HTMLElement, default: true })\n * items!: DefaultSlot<T>; // Array<T> -> DefaultSlot<T>\n * }\n * ```\n * @returns { PropertyDecorator }\n */\nconst slot = (slotData?: Slot): PropertyDecorator => {\n\treturn (target: any, slotKey: string | symbol) => {\n\t\tconst ctor = target.constructor as typeof UI5Element;\n\n\t\tif (!Object.prototype.hasOwnProperty.call(ctor, \"metadata\")) {\n\t\t\tctor.metadata = {};\n\t\t}\n\n\t\tconst metadata = ctor.metadata;\n\t\tif (!metadata.slots) {\n\t\t\tmetadata.slots = {};\n\t\t}\n\n\t\tconst slotMetadata = metadata.slots;\n\n\t\tif (slotData && slotData.default && slotMetadata.default) {\n\t\t\tthrow new Error(\"Only one slot can be the default slot.\");\n\t\t}\n\n\t\tconst key = slotData && slotData.default ? \"default\" : slotKey as string;\n\t\tslotData = slotData || { type: HTMLElement };\n\n\t\tif (!slotData.type) {\n\t\t\tslotData.type = HTMLElement;\n\t\t}\n\n\t\tif (!slotMetadata[key]) {\n\t\t\tslotMetadata[key] = slotData;\n\t\t}\n\n\t\tif (slotData.default) {\n\t\t\tdelete slotMetadata.default.default;\n\t\t\tslotMetadata.default.propertyName = slotKey as string;\n\t\t}\n\n\t\tctor.metadata.managedSlots = true;\n\t};\n};\n\nexport default slot;\n"]}
@@ -3,6 +3,7 @@ import event from "./decorators/event.js";
3
3
  import eventStrict from "./decorators/event-strict.js";
4
4
  import property from "./decorators/property.js";
5
5
  import slot from "./decorators/slot.js";
6
+ import slotStrict from "./decorators/slot-strict.js";
6
7
  import bound from "./decorators/bound.js";
7
8
  import i18n from "./decorators/i18n.js";
8
- export { customElement, event, eventStrict, property, slot, bound, i18n, };
9
+ export { customElement, event, eventStrict, property, slot, slotStrict, bound, i18n, };
@@ -3,7 +3,8 @@ import event from "./decorators/event.js";
3
3
  import eventStrict from "./decorators/event-strict.js";
4
4
  import property from "./decorators/property.js";
5
5
  import slot from "./decorators/slot.js";
6
+ import slotStrict from "./decorators/slot-strict.js";
6
7
  import bound from "./decorators/bound.js";
7
8
  import i18n from "./decorators/i18n.js";
8
- export { customElement, event, eventStrict, property, slot, bound, i18n, };
9
+ export { customElement, event, eventStrict, property, slot, slotStrict, bound, i18n, };
9
10
  //# sourceMappingURL=decorators.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport eventStrict from \"./decorators/event-strict.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport bound from \"./decorators/bound.js\";\nimport i18n from \"./decorators/i18n.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\teventStrict,\n\tproperty,\n\tslot,\n\tbound,\n\ti18n,\n};\n"]}
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../src/decorators.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,MAAM,+BAA+B,CAAC;AAC1D,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,WAAW,MAAM,8BAA8B,CAAC;AACvD,OAAO,QAAQ,MAAM,0BAA0B,CAAC;AAChD,OAAO,IAAI,MAAM,sBAAsB,CAAC;AACxC,OAAO,UAAU,MAAM,6BAA6B,CAAC;AACrD,OAAO,KAAK,MAAM,uBAAuB,CAAC;AAC1C,OAAO,IAAI,MAAM,sBAAsB,CAAC;AAExC,OAAO,EACN,aAAa,EACb,KAAK,EACL,WAAW,EACX,QAAQ,EACR,IAAI,EACJ,UAAU,EACV,KAAK,EACL,IAAI,GACJ,CAAC","sourcesContent":["import customElement from \"./decorators/customElement.js\";\nimport event from \"./decorators/event.js\";\nimport eventStrict from \"./decorators/event-strict.js\";\nimport property from \"./decorators/property.js\";\nimport slot from \"./decorators/slot.js\";\nimport slotStrict from \"./decorators/slot-strict.js\";\nimport bound from \"./decorators/bound.js\";\nimport i18n from \"./decorators/i18n.js\";\n\nexport {\n\tcustomElement,\n\tevent,\n\teventStrict,\n\tproperty,\n\tslot,\n\tslotStrict,\n\tbound,\n\ti18n,\n};\n"]}
@@ -16,5 +16,6 @@ declare class F6Navigation {
16
16
  destroy(): void;
17
17
  get _ui5RuntimeIndex(): number;
18
18
  static init(): void;
19
+ static destroy(): void;
19
20
  }
20
21
  export default F6Navigation;
@@ -188,6 +188,10 @@ class F6Navigation {
188
188
  f6Registry.instance = new F6Navigation();
189
189
  }
190
190
  }
191
+ static destroy() {
192
+ const f6Registry = getSharedResource("F6Registry", {});
193
+ f6Registry.instance?.destroy();
194
+ }
191
195
  }
192
196
  registerFeature("F6Navigation", F6Navigation);
193
197
  export default F6Navigation;
@@ -1 +1 @@
1
- {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAM3D,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YA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,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;aAAM,IAAI,YAAY,CAAC,UAAU,CAAC,QAAQ,EAAE,gBAAgB,CAAC,EAAE,CAAC;YAChE,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC;YAC/B,UAAU,CAAC,QAAQ,GAAG,IAAI,YAAY,EAAE,CAAC;QAC1C,CAAC;IACF,CAAC;CACD;AAED,eAAe,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tif (nextElement) {\n\t\t\tif (isElementClickable(nextElement)) {\n\t\t\t\treturn nextElement;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);\n\t\t\t\tlet distanceToNextGroup = 1;\n\n\t\t\t\tfor (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {\n\t\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);\n\n\t\t\t\t\tif (firstFocusable === currentGroupFocusable) {\n\t\t\t\t\t\tdistanceToNextGroup++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex -= distanceToNextGroup;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
1
+ {"version":3,"file":"F6Navigation.js","sourceRoot":"","sources":["../../src/features/F6Navigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpD,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AACzE,OAAO,kBAAkB,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AAExD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAM3D,MAAM,mBAAmB,GAAG,sBAAsB,EAAE,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,YAAgC,EAAE,EAAE;IACzD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACb,CAAC;IACD,OAAO,eAAe,CAAC,mBAAmB,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,2FAA2F;AAC7J,CAAC,CAAC;AAEF,MAAM,YAAY;IAKjB;QAHA,kBAAa,GAAuB,IAAI,CAAC;QACzC,WAAM,GAAuB,EAAE,CAAC;QAG/B,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAmC,CAAC;QACxF,IAAI,CAAC,oBAAoB,EAAE,CAAC;IAC7B,CAAC;IAED,oBAAoB;QACnB,QAAQ,CAAC,gBAAgB,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AE,YAAY,CAAC,CAAC;AAE9C,eAAe,YAAY,CAAC","sourcesContent":["import { getFeature, registerFeature } from \"../FeaturesRegistry.js\";\nimport { isF6Next, isF6Previous } from \"../Keys.js\";\nimport { getFirstFocusableElement } from \"../util/FocusableElements.js\";\nimport getFastNavigationGroups from \"../util/getFastNavigationGroups.js\";\nimport isElementClickable from \"../util/isElementClickable.js\";\nimport { getCurrentRuntimeIndex, compareRuntimes } from \"../Runtimes.js\";\nimport getSharedResource from \"../getSharedResource.js\";\nimport type OpenUI5Support from \"./OpenUI5Support.js\";\nimport getParentElement from \"../util/getParentElement.js\";\n\ntype F6Registry = {\n\tinstance?: F6Navigation,\n}\n\nconst currentRuntimeINdex = getCurrentRuntimeIndex();\n\nconst shouldUpdate = (runtimeIndex: number | undefined) => {\n\tif (runtimeIndex === undefined) {\n\t\treturn true;\n\t}\n\treturn compareRuntimes(currentRuntimeINdex, runtimeIndex) === 1; // 1 means the current is newer, 0 means the same, -1 means the resource's runtime is newer\n};\n\nclass F6Navigation {\n\tkeydownHandler: (event: KeyboardEvent) => void;\n\tselectedGroup: HTMLElement | null = null;\n\tgroups: Array<HTMLElement> = [];\n\n\tconstructor() {\n\t\tthis.keydownHandler = this._keydownHandler.bind(this) as (event: KeyboardEvent) => void;\n\t\tthis.attachEventListeners();\n\t}\n\n\tattachEventListeners() {\n\t\tdocument.addEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tremoveEventListeners() {\n\t\tdocument.removeEventListener(\"keydown\", this.keydownHandler);\n\t}\n\n\tasync groupElementToFocus(nextElement: HTMLElement) {\n\t\tif (nextElement) {\n\t\t\tif (isElementClickable(nextElement)) {\n\t\t\t\treturn nextElement;\n\t\t\t}\n\n\t\t\tconst elementToFocus = await getFirstFocusableElement(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\treturn elementToFocus;\n\t\t\t}\n\t\t}\n\t}\n\n\tasync findNextFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > -1) {\n\t\t\t\tif (currentIndex + 1 >= this.groups.length) {\n\t\t\t\t\tcurrentIndex = 0;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t} else {\n\t\t\t\t\tcurrentIndex += 1;\n\t\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcurrentIndex = 0;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync findPreviousFocusableGroupElement(currentIndex: number) {\n\t\tlet elementToFocus;\n\n\t\t/* eslint-disable no-await-in-loop */\n\t\tfor (let index = 0; index < this.groups.length; index++) {\n\t\t\tlet nextElement;\n\n\t\t\tif (currentIndex > 0) {\n\t\t\t\t// Handle the situation where the first focusable element of two neighbor groups is the same\n\t\t\t\t// For example:\n\t\t\t\t// <ui5-flexible-column-layout>\n\t\t\t\t// <ui5-list>\n\t\t\t\t// <ui5-li>List Item</ui5-li>\n\t\t\t\t// </ui5-list>\n\t\t\t\t// </ui5-flexible-column-layout>\n\t\t\t\t// Here for both FCL & List the firstFoccusableElement is the same (the ui5-li)\n\t\t\t\tconst currentGroupFocusable = await this.groupElementToFocus(this.groups[currentIndex]);\n\t\t\t\tlet distanceToNextGroup = 1;\n\n\t\t\t\tfor (let distanceIndex = 1; distanceIndex < this.groups.length; distanceIndex++) {\n\t\t\t\t\tconst firstFocusable = await this.groupElementToFocus(this.groups[currentIndex - distanceIndex]);\n\n\t\t\t\t\tif (firstFocusable === currentGroupFocusable) {\n\t\t\t\t\t\tdistanceToNextGroup++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tcurrentIndex -= distanceToNextGroup;\n\n\t\t\t\tif (currentIndex < 0) {\n\t\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\t}\n\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t} else {\n\t\t\t\tcurrentIndex = this.groups.length - 1;\n\t\t\t\tnextElement = this.groups[currentIndex];\n\t\t\t}\n\n\t\t\telementToFocus = await this.groupElementToFocus(nextElement);\n\n\t\t\tif (elementToFocus) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t/* eslint-enable no-await-in-loop */\n\n\t\treturn elementToFocus;\n\t}\n\n\tasync _keydownHandler(event: KeyboardEvent) {\n\t\tconst openUI5Support = getFeature<typeof OpenUI5Support>(\"OpenUI5Support\");\n\t\tconst isOpenUI5Detected = openUI5Support && openUI5Support.isOpenUI5Detected();\n\n\t\tif (isOpenUI5Detected) {\n\t\t\tthis.destroy();\n\t\t\treturn;\n\t\t}\n\n\t\tconst forward = isF6Next(event);\n\t\tconst backward = isF6Previous(event);\n\t\tif (!(forward || backward)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.updateGroups();\n\n\t\tif (this.groups.length < 1) {\n\t\t\treturn;\n\t\t}\n\n\t\tevent.preventDefault();\n\n\t\tlet elementToFocus;\n\n\t\tif (this.groups.length === 0) {\n\t\t\telementToFocus = await this.groupElementToFocus(this.groups[0]);\n\n\t\t\treturn elementToFocus?.focus();\n\t\t}\n\n\t\tlet currentIndex = -1;\n\n\t\tif (this.selectedGroup) {\n\t\t\tcurrentIndex = this.groups.indexOf(this.selectedGroup);\n\t\t}\n\n\t\tif (forward) {\n\t\t\telementToFocus = await this.findNextFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\tif (backward) {\n\t\t\telementToFocus = await this.findPreviousFocusableGroupElement(currentIndex);\n\t\t}\n\n\t\telementToFocus?.focus();\n\t}\n\n\tupdateGroups() {\n\t\tconst container = this.findContainer();\n\n\t\tthis.setSelectedGroup();\n\t\tthis.groups = getFastNavigationGroups(container);\n\t}\n\n\tfindContainer() {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element = this.deepActive(window.document);\n\n\t\twhile (element && element !== htmlElement) {\n\t\t\tconst closestScopeEl = element.closest<HTMLElement>(\"[data-sap-ui-fastnavgroup-container='true']\");\n\n\t\t\tif (closestScopeEl) {\n\t\t\t\treturn closestScopeEl;\n\t\t\t}\n\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\treturn document.body;\n\t}\n\n\tsetSelectedGroup(root: DocumentOrShadowRoot = window.document) {\n\t\tconst htmlElement = window.document.querySelector(\"html\");\n\t\tlet element: Element | null = this.deepActive(root);\n\n\t\twhile (element && element.getAttribute(\"data-sap-ui-fastnavgroup\") !== \"true\" && element !== htmlElement) {\n\t\t\telement = getParentElement(element);\n\t\t}\n\n\t\tthis.selectedGroup = element as HTMLElement;\n\t}\n\n\tdeepActive(root: DocumentOrShadowRoot): Element | null {\n\t\tif (root?.activeElement?.shadowRoot?.activeElement) {\n\t\t\treturn this.deepActive(root.activeElement.shadowRoot);\n\t\t}\n\n\t\treturn root.activeElement;\n\t}\n\n\tdestroy() {\n\t\tthis.removeEventListeners();\n\t}\n\n\tget _ui5RuntimeIndex() {\n\t\treturn currentRuntimeINdex;\n\t}\n\n\tstatic init() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\n\t\tif (!f6Registry.instance) {\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t} else if (shouldUpdate(f6Registry.instance?._ui5RuntimeIndex)) {\n\t\t\tf6Registry.instance?.destroy();\n\t\t\tf6Registry.instance = new F6Navigation();\n\t\t}\n\t}\n\n\tstatic destroy() {\n\t\tconst f6Registry = getSharedResource<F6Registry>(\"F6Registry\", {});\n\t\tf6Registry.instance?.destroy();\n\t}\n}\n\nregisterFeature(\"F6Navigation\", F6Navigation);\n\nexport default F6Navigation;\n"]}
@@ -9,7 +9,7 @@ interface IFormInputElement extends UI5Element {
9
9
  declare const updateFormValue: (element: IFormInputElement | UI5Element) => void;
10
10
  declare const setFormValue: (element: IFormInputElement) => void;
11
11
  declare const setFormValidity: (element: IFormInputElement) => Promise<void>;
12
- declare const submitForm: (element: UI5Element) => void;
12
+ declare const submitForm: (element: UI5Element) => Promise<void>;
13
13
  declare const resetForm: (element: UI5Element) => void;
14
14
  export { updateFormValue, setFormValue, setFormValidity, submitForm, resetForm, };
15
15
  export type { IFormInputElement, };
@@ -1,3 +1,16 @@
1
+ /**
2
+ * Gets the associated form for an element.
3
+ * If the element has a `form` attribute, it looks up the form by ID.
4
+ * Otherwise, it falls back to the form associated via ElementInternals.
5
+ */
6
+ const getAssociatedForm = (element) => {
7
+ const formAttribute = element.getAttribute("form");
8
+ if (formAttribute) {
9
+ const form = document.getElementById(formAttribute);
10
+ return form instanceof HTMLFormElement ? form : null;
11
+ }
12
+ return element._internals?.form ?? null;
13
+ };
1
14
  const updateFormValue = (element) => {
2
15
  if (isInputElement(element)) {
3
16
  setFormValue(element);
@@ -15,9 +28,11 @@ const setFormValue = (element) => {
15
28
  element._internals.setFormValue(element.formFormattedValue);
16
29
  };
17
30
  const setFormValidity = async (element) => {
18
- if (!element._internals?.form) {
31
+ if (!element.isUI5Element || !element._internals?.form) {
19
32
  return;
20
33
  }
34
+ element._internals.setValidity({ customError: true }, " "); // treat the form as invalid until CLDR and message bundles are loaded
35
+ await element.definePromise;
21
36
  if (element.formValidity && Object.keys(element.formValidity).some(key => key)) {
22
37
  const focusRef = await element.formElementAnchor?.();
23
38
  element._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);
@@ -26,11 +41,18 @@ const setFormValidity = async (element) => {
26
41
  element._internals.setValidity({});
27
42
  }
28
43
  };
29
- const submitForm = (element) => {
30
- element._internals?.form?.requestSubmit();
44
+ const submitForm = async (element) => {
45
+ const form = getAssociatedForm(element);
46
+ if (!form) {
47
+ return;
48
+ }
49
+ const elements = [...form.elements];
50
+ await Promise.all(elements.map(el => { return isInputElement(el) ? setFormValidity(el) : Promise.resolve(); }));
51
+ form.requestSubmit();
31
52
  };
32
53
  const resetForm = (element) => {
33
- element._internals?.form?.reset();
54
+ const form = getAssociatedForm(element);
55
+ form?.reset();
34
56
  };
35
57
  const isInputElement = (element) => {
36
58
  return "formFormattedValue" in element && "name" in element;
@@ -1 +1 @@
1
- {"version":3,"file":"InputElementsFormSupport.js","sourceRoot":"","sources":["../../src/features/InputElementsFormSupport.ts"],"names":[],"mappings":"AAUA,MAAM,eAAe,GAAG,CAAC,OAAuC,EAAE,EAAE;IACnE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,YAAY,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA0B,EAAE,EAAE;IACnD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;IAED,eAAe,CAAC,OAAO,CAAC,CAAC;IAEzB,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC;QACnB,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,IAAI,CAAC,CAAC;QACvC,OAAO;IACR,CAAC;IAED,OAAO,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAC7D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,KAAK,EAAE,OAA0B,EAAE,EAAE;IAC5D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC;QAC/B,OAAO;IACR,CAAC;IACD,IAAI,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;QAChF,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACrD,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,mBAAmB,EAAE,QAAQ,CAAC,CAAC;IAC7F,CAAC;SAAM,CAAC;QACP,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,OAAmB,EAAE,EAAE;IAC1C,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,OAAmB,EAAE,EAAE;IACzC,OAAO,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAuC,EAAgC,EAAE;IAChG,OAAO,oBAAoB,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,CAAC;AAC7D,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,YAAY,EACZ,eAAe,EACf,UAAU,EACV,SAAS,GACT,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ninterface IFormInputElement extends UI5Element {\n\tname?: string;\n\tformFormattedValue: FormData | string | null;\n\tformValidityMessage?: string;\n\tformValidity?: ValidityStateFlags;\n\tformElementAnchor?: () => HTMLElement | undefined | Promise<HTMLElement | undefined>;\n}\n\nconst updateFormValue = (element: IFormInputElement | UI5Element) => {\n\tif (isInputElement(element)) {\n\t\tsetFormValue(element);\n\t}\n};\n\nconst setFormValue = (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\n\tsetFormValidity(element);\n\n\tif (!element.name) {\n\t\telement._internals?.setFormValue(null);\n\t\treturn;\n\t}\n\n\telement._internals.setFormValue(element.formFormattedValue);\n};\n\nconst setFormValidity = async (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\tif (element.formValidity && Object.keys(element.formValidity).some(key => key)) {\n\t\tconst focusRef = await element.formElementAnchor?.();\n\t\telement._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);\n\t} else {\n\t\telement._internals.setValidity({});\n\t}\n};\n\nconst submitForm = (element: UI5Element) => {\n\telement._internals?.form?.requestSubmit();\n};\n\nconst resetForm = (element: UI5Element) => {\n\telement._internals?.form?.reset();\n};\n\nconst isInputElement = (element: IFormInputElement | UI5Element): element is IFormInputElement => {\n\treturn \"formFormattedValue\" in element && \"name\" in element;\n};\n\nexport {\n\tupdateFormValue,\n\tsetFormValue,\n\tsetFormValidity,\n\tsubmitForm,\n\tresetForm,\n};\n\nexport type {\n\tIFormInputElement,\n};\n"]}
1
+ {"version":3,"file":"InputElementsFormSupport.js","sourceRoot":"","sources":["../../src/features/InputElementsFormSupport.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,CAAC,OAAmB,EAA0B,EAAE;IACzE,MAAM,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAEnD,IAAI,aAAa,EAAE,CAAC;QACnB,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;QACpD,OAAO,IAAI,YAAY,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IAED,OAAO,OAAO,CAAC,UAAU,EAAE,IAAI,IAAI,IAAI,CAAC;AACzC,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,OAAuC,EAAE,EAAE;IACnE,IAAI,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QAC7B,YAAY,CAAC,OAAO,CAAC,CAAC;IACvB,CAAC;AACF,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,OAA0B,EAAE,EAAE;IACnD,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,IAAI,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MAAM,QAAQ,GAAG,CAAC,GAAG,IAAI,CAAC,QAAQ,CAA0C,CAAC;IAE7E,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAEhH,IAAI,CAAC,aAAa,EAAE,CAAC;AACtB,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,OAAmB,EAAE,EAAE;IACzC,MAAM,IAAI,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IACxC,IAAI,EAAE,KAAK,EAAE,CAAC;AACf,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAuC,EAAgC,EAAE;IAChG,OAAO,oBAAoB,IAAI,OAAO,IAAI,MAAM,IAAI,OAAO,CAAC;AAC7D,CAAC,CAAC;AAEF,OAAO,EACN,eAAe,EACf,YAAY,EACZ,eAAe,EACf,UAAU,EACV,SAAS,GACT,CAAC","sourcesContent":["import type UI5Element from \"../UI5Element.js\";\n\ninterface IFormInputElement extends UI5Element {\n\tname?: string;\n\tformFormattedValue: FormData | string | null;\n\tformValidityMessage?: string;\n\tformValidity?: ValidityStateFlags;\n\tformElementAnchor?: () => HTMLElement | undefined | Promise<HTMLElement | undefined>;\n}\n\n/**\n * Gets the associated form for an element.\n * If the element has a `form` attribute, it looks up the form by ID.\n * Otherwise, it falls back to the form associated via ElementInternals.\n */\nconst getAssociatedForm = (element: UI5Element): HTMLFormElement | null => {\n\tconst formAttribute = element.getAttribute(\"form\");\n\n\tif (formAttribute) {\n\t\tconst form = document.getElementById(formAttribute);\n\t\treturn form instanceof HTMLFormElement ? form : null;\n\t}\n\n\treturn element._internals?.form ?? null;\n};\n\nconst updateFormValue = (element: IFormInputElement | UI5Element) => {\n\tif (isInputElement(element)) {\n\t\tsetFormValue(element);\n\t}\n};\n\nconst setFormValue = (element: IFormInputElement) => {\n\tif (!element._internals?.form) {\n\t\treturn;\n\t}\n\n\tsetFormValidity(element);\n\n\tif (!element.name) {\n\t\telement._internals?.setFormValue(null);\n\t\treturn;\n\t}\n\n\telement._internals.setFormValue(element.formFormattedValue);\n};\n\nconst setFormValidity = async (element: IFormInputElement) => {\n\tif (!element.isUI5Element || !element._internals?.form) {\n\t\treturn;\n\t}\n\n\telement._internals.setValidity({ customError: true }, \" \"); // treat the form as invalid until CLDR and message bundles are loaded\n\tawait element.definePromise;\n\n\tif (element.formValidity && Object.keys(element.formValidity).some(key => key)) {\n\t\tconst focusRef = await element.formElementAnchor?.();\n\t\telement._internals.setValidity(element.formValidity, element.formValidityMessage, focusRef);\n\t} else {\n\t\telement._internals.setValidity({});\n\t}\n};\n\nconst submitForm = async (element: UI5Element) => {\n\tconst form = getAssociatedForm(element);\n\n\tif (!form) {\n\t\treturn;\n\t}\n\n\tconst elements = [...form.elements] as Array<IFormInputElement | UI5Element>;\n\n\tawait Promise.all(elements.map(el => { return isInputElement(el) ? setFormValidity(el) : Promise.resolve(); }));\n\n\tform.requestSubmit();\n};\n\nconst resetForm = (element: UI5Element) => {\n\tconst form = getAssociatedForm(element);\n\tform?.reset();\n};\n\nconst isInputElement = (element: IFormInputElement | UI5Element): element is IFormInputElement => {\n\treturn \"formFormattedValue\" in element && \"name\" in element;\n};\n\nexport {\n\tupdateFormValue,\n\tsetFormValue,\n\tsetFormValidity,\n\tsubmitForm,\n\tresetForm,\n};\n\nexport type {\n\tIFormInputElement,\n};\n"]}
@@ -2,10 +2,16 @@ import type { PopupInfo } from "./patchPopup.js";
2
2
  import type { CLDRData } from "../asset-registries/LocaleData.js";
3
3
  import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
4
4
  declare class OpenUI5Support {
5
- static isAtLeastVersion116(): boolean;
5
+ static enablePolling: boolean;
6
+ static isAtLeastVersion(minor: number): boolean;
6
7
  static isOpenUI5Detected(): boolean;
7
8
  static initPromise?: Promise<void>;
8
- static init(): Promise<void>;
9
+ /**
10
+ * Important - if OpenUI5 is loaded after UI5 Web Components, configuration is not synchronized and it's up to the app to initialize OpenUI5 with the same settings as UI5 Web Components for consistency.
11
+ */
12
+ static OpenUI5DelayedInit: () => Promise<void>;
13
+ static awaitForOpenUI5(): void;
14
+ static init(): void | Promise<void>;
9
15
  static getConfigurationSettingsObject(): {
10
16
  animationMode?: undefined;
11
17
  language?: undefined;
@@ -19,9 +25,9 @@ declare class OpenUI5Support {
19
25
  animationMode: string;
20
26
  language: string;
21
27
  theme: string;
22
- themeRoot: string;
28
+ themeRoot: string | undefined;
23
29
  rtl: string;
24
- timezone: string;
30
+ timezone: string | undefined;
25
31
  calendarType: string;
26
32
  formatSettings: {
27
33
  firstDayOfWeek: number | undefined;
@@ -30,10 +36,10 @@ declare class OpenUI5Support {
30
36
  };
31
37
  static getLocaleDataObject(): CLDRData | undefined;
32
38
  static _listenForThemeChange(): void;
33
- static attachListeners(): void;
39
+ static attachListeners(): boolean;
34
40
  static cssVariablesLoaded(): boolean | undefined;
35
41
  static addOpenedPopup(popupInfo: PopupInfo): void;
36
42
  static removeOpenedPopup(popup: object): void;
37
- static getTopmostPopup(): object;
43
+ static getTopmostPopup(): object | null;
38
44
  }
39
45
  export default OpenUI5Support;
@@ -1,9 +1,12 @@
1
+ var _a;
1
2
  import patchPatcher from "./patchPatcher.js";
2
3
  import { patchPopup, addOpenedPopup, removeOpenedPopup, getTopmostPopup, } from "./patchPopup.js";
3
4
  import { registerFeature } from "../FeaturesRegistry.js";
4
5
  import { setTheme } from "../config/Theme.js";
6
+ import { secondaryBoot } from "../Boot.js";
7
+ const OPENUI5_POLLING_INTERVAL = 100;
5
8
  class OpenUI5Support {
6
- static isAtLeastVersion116() {
9
+ static isAtLeastVersion(minor) {
7
10
  if (!window.sap.ui.version) {
8
11
  return true; // sap.ui.version will be removed in newer OpenUI5 versions
9
12
  }
@@ -12,21 +15,36 @@ class OpenUI5Support {
12
15
  if (!parts || parts.length < 2) {
13
16
  return false;
14
17
  }
15
- return parseInt(parts[0]) > 1 || parseInt(parts[1]) >= 116;
18
+ return parseInt(parts[0]) > 1 || parseInt(parts[1]) >= minor;
16
19
  }
17
20
  static isOpenUI5Detected() {
18
21
  return typeof window.sap?.ui?.require === "function";
19
22
  }
23
+ static awaitForOpenUI5() {
24
+ if (_a.enablePolling) {
25
+ const interval = setInterval(() => {
26
+ if (_a.isOpenUI5Detected()) {
27
+ clearInterval(interval);
28
+ _a.OpenUI5DelayedInit();
29
+ }
30
+ }, OPENUI5_POLLING_INTERVAL);
31
+ }
32
+ else {
33
+ document.addEventListener("sap-ui-core-ready", () => {
34
+ _a.OpenUI5DelayedInit();
35
+ });
36
+ }
37
+ }
20
38
  static init() {
21
- if (!OpenUI5Support.isOpenUI5Detected()) {
22
- return Promise.resolve();
39
+ if (!_a.isOpenUI5Detected()) {
40
+ return _a.awaitForOpenUI5();
23
41
  }
24
- if (!OpenUI5Support.initPromise) {
25
- OpenUI5Support.initPromise = new Promise(resolve => {
42
+ if (!_a.initPromise) {
43
+ _a.initPromise = new Promise(resolve => {
26
44
  window.sap.ui.require(["sap/ui/core/Core"], async (Core) => {
27
45
  const callback = () => {
28
- let deps = ["sap/ui/core/Popup", "sap/m/Dialog", "sap/m/Popover", "sap/ui/core/Patcher", "sap/ui/core/LocaleData"];
29
- if (OpenUI5Support.isAtLeastVersion116()) { // for versions since 1.116.0 and onward, use the modular core
46
+ let deps = ["sap/ui/core/Popup", "sap/m/Dialog", "sap/ui/core/Patcher", "sap/ui/core/LocaleData"];
47
+ if (_a.isAtLeastVersion(116)) { // for versions since 1.116.0 and onward, use the modular core
30
48
  deps = [
31
49
  ...deps,
32
50
  "sap/base/i18n/Formatting",
@@ -36,13 +54,13 @@ class OpenUI5Support {
36
54
  "sap/ui/core/date/CalendarUtils",
37
55
  ];
38
56
  }
39
- window.sap.ui.require(deps, (Popup, Dialog, Popover, Patcher) => {
57
+ window.sap.ui.require(deps, (Popup, Dialog, Patcher) => {
40
58
  patchPatcher(Patcher);
41
- patchPopup(Popup, Dialog, Popover);
59
+ patchPopup(Popup, Dialog);
42
60
  resolve();
43
61
  });
44
62
  };
45
- if (OpenUI5Support.isAtLeastVersion116()) {
63
+ if (_a.isAtLeastVersion(116)) {
46
64
  await Core.ready();
47
65
  callback();
48
66
  }
@@ -52,13 +70,13 @@ class OpenUI5Support {
52
70
  });
53
71
  });
54
72
  }
55
- return OpenUI5Support.initPromise;
73
+ return _a.initPromise;
56
74
  }
57
75
  static getConfigurationSettingsObject() {
58
- if (!OpenUI5Support.isOpenUI5Detected()) {
76
+ if (!_a.isOpenUI5Detected()) {
59
77
  return {};
60
78
  }
61
- if (OpenUI5Support.isAtLeastVersion116()) {
79
+ if (_a.isAtLeastVersion(116)) {
62
80
  const ControlBehavior = window.sap.ui.require("sap/ui/core/ControlBehavior");
63
81
  const Localization = window.sap.ui.require("sap/base/i18n/Localization");
64
82
  const Theming = window.sap.ui.require("sap/ui/core/Theming");
@@ -86,9 +104,9 @@ class OpenUI5Support {
86
104
  animationMode: config.getAnimationMode(),
87
105
  language: config.getLanguage(),
88
106
  theme: config.getTheme(),
89
- themeRoot: config.getThemeRoot(),
107
+ themeRoot: typeof config.getThemeRoot === "function" ? config.getThemeRoot() : undefined,
90
108
  rtl: config.getRTL(),
91
- timezone: config.getTimezone(),
109
+ timezone: typeof config.getTimezone === "function" ? config.getTimezone() : undefined,
92
110
  calendarType: config.getCalendarType(),
93
111
  formatSettings: {
94
112
  firstDayOfWeek: LocaleData ? LocaleData.getInstance(config.getLocale()).getFirstDayOfWeek() : undefined,
@@ -97,11 +115,11 @@ class OpenUI5Support {
97
115
  };
98
116
  }
99
117
  static getLocaleDataObject() {
100
- if (!OpenUI5Support.isOpenUI5Detected()) {
118
+ if (!_a.isOpenUI5Detected()) {
101
119
  return;
102
120
  }
103
121
  const LocaleData = window.sap.ui.require("sap/ui/core/LocaleData");
104
- if (OpenUI5Support.isAtLeastVersion116()) {
122
+ if (_a.isAtLeastVersion(116)) {
105
123
  const Localization = window.sap.ui.require("sap/base/i18n/Localization");
106
124
  return LocaleData.getInstance(Localization.getLanguageTag())._get();
107
125
  }
@@ -110,7 +128,7 @@ class OpenUI5Support {
110
128
  return LocaleData.getInstance(config.getLocale())._get();
111
129
  }
112
130
  static _listenForThemeChange() {
113
- if (OpenUI5Support.isAtLeastVersion116()) {
131
+ if (_a.isAtLeastVersion(116)) {
114
132
  const Theming = window.sap.ui.require("sap/ui/core/Theming");
115
133
  Theming.attachApplied(() => {
116
134
  setTheme(Theming.getTheme());
@@ -125,13 +143,14 @@ class OpenUI5Support {
125
143
  }
126
144
  }
127
145
  static attachListeners() {
128
- if (!OpenUI5Support.isOpenUI5Detected()) {
129
- return;
146
+ if (!_a.isOpenUI5Detected()) {
147
+ return false;
130
148
  }
131
- OpenUI5Support._listenForThemeChange();
149
+ _a._listenForThemeChange();
150
+ return true;
132
151
  }
133
152
  static cssVariablesLoaded() {
134
- if (!OpenUI5Support.isOpenUI5Detected()) {
153
+ if (!_a.isOpenUI5Detected()) {
135
154
  return;
136
155
  }
137
156
  const link = [...document.head.children].find(el => el.id === "sap-ui-theme-sap.ui.core"); // more reliable than querySelector early
@@ -139,7 +158,10 @@ class OpenUI5Support {
139
158
  return false;
140
159
  }
141
160
  // The file name is "css_variables.css" until 1.127 and "library.css" from 1.127 onwards
142
- return !!link.href.match(/\/css(-|_)variables\.css/) || !!link.href.match(/\/library\.css/);
161
+ if (_a.isAtLeastVersion(127)) {
162
+ return !!link.href.match(/\/css(-|_)variables\.css/) || !!link.href.match(/\/library\.css/);
163
+ }
164
+ return !!link.href.match(/\/css(-|_)variables\.css/);
143
165
  }
144
166
  static addOpenedPopup(popupInfo) {
145
167
  addOpenedPopup(popupInfo);
@@ -151,6 +173,15 @@ class OpenUI5Support {
151
173
  return getTopmostPopup();
152
174
  }
153
175
  }
176
+ _a = OpenUI5Support;
177
+ OpenUI5Support.enablePolling = false; // set to true for old OpenUI5 versions
178
+ /**
179
+ * Important - if OpenUI5 is loaded after UI5 Web Components, configuration is not synchronized and it's up to the app to initialize OpenUI5 with the same settings as UI5 Web Components for consistency.
180
+ */
181
+ OpenUI5Support.OpenUI5DelayedInit = async () => {
182
+ _a.init(); // This ensures patchPopover and patchPatcher are called; and from this point OpenUI5 CSS vars start being detected
183
+ await secondaryBoot(); // Re-run the parts of boot that were skipped due to OpenUI5 not having been loaded
184
+ };
154
185
  registerFeature("OpenUI5Support", OpenUI5Support);
155
186
  export default OpenUI5Support;
156
187
  //# sourceMappingURL=OpenUI5Support.js.map