@ui5/webcomponents-base 0.0.0-934b4df24 → 0.0.0-9c26e8e4f

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 (356) hide show
  1. package/.eslintignore +3 -0
  2. package/CHANGELOG.md +362 -0
  3. package/README.md +53 -7
  4. package/bundle.esm.js +23 -16
  5. package/dist/AssetRegistry.js +8 -7
  6. package/dist/Boot.js +59 -0
  7. package/dist/CSP.js +59 -0
  8. package/dist/CustomElementsRegistry.js +79 -7
  9. package/dist/CustomElementsScope.js +30 -0
  10. package/dist/CustomElementsScopeUtils.js +108 -0
  11. package/dist/DOMObserver.js +65 -0
  12. package/dist/Device.js +71 -773
  13. package/dist/EventProvider.js +38 -26
  14. package/dist/FeaturesRegistry.js +4 -1
  15. package/dist/FontFace.js +19 -62
  16. package/dist/InitialConfiguration.js +43 -8
  17. package/dist/Keys.js +136 -2
  18. package/dist/ManagedStyles.js +83 -0
  19. package/dist/MediaRange.js +109 -0
  20. package/dist/PropertiesFileFormat.js +95 -0
  21. package/dist/Render.js +175 -0
  22. package/dist/RenderQueue.js +41 -17
  23. package/dist/RenderScheduler.js +24 -126
  24. package/dist/Runtimes.js +107 -0
  25. package/dist/StaticArea.js +1 -39
  26. package/dist/StaticAreaItem.js +58 -62
  27. package/dist/SystemCSSVars.js +10 -0
  28. package/dist/Theming.js +2 -1
  29. package/dist/UI5Element.js +425 -318
  30. package/dist/UI5ElementMetadata.js +173 -17
  31. package/dist/asset-registries/Icons.js +125 -14
  32. package/dist/asset-registries/Illustrations.js +30 -0
  33. package/dist/asset-registries/LocaleData.js +105 -66
  34. package/dist/asset-registries/Themes.js +29 -34
  35. package/dist/asset-registries/i18n.js +73 -29
  36. package/dist/assets/bundle.esm.eb35c35a.js +43 -0
  37. package/dist/assets-meta/IconCollectionsAlias.js +18 -0
  38. package/dist/config/AnimationMode.js +11 -1
  39. package/dist/config/Icons.js +52 -0
  40. package/dist/config/Language.js +58 -2
  41. package/dist/config/Theme.js +25 -0
  42. package/dist/css/BusyIndicator.css +80 -0
  43. package/dist/css/FontFace.css +75 -0
  44. package/dist/css/OverrideFontFace.css +32 -0
  45. package/dist/css/SystemCSSVars.css +17 -0
  46. package/dist/delegate/ItemNavigation.js +249 -171
  47. package/dist/delegate/ResizeHandler.js +78 -38
  48. package/dist/delegate/ScrollEnablement.js +49 -20
  49. package/dist/features/F6Navigation.js +110 -0
  50. package/dist/features/OpenUI5Enablement.js +119 -0
  51. package/dist/features/OpenUI5Support.js +42 -7
  52. package/dist/generated/AssetParameters.js +1 -1
  53. package/dist/generated/VersionInfo.js +10 -0
  54. package/dist/generated/css/BusyIndicator.css.js +5 -0
  55. package/dist/generated/css/FontFace.css.js +5 -0
  56. package/dist/generated/css/OverrideFontFace.css.js +5 -0
  57. package/dist/generated/css/SystemCSSVars.css.js +5 -0
  58. package/dist/getSharedResource.js +30 -0
  59. package/dist/i18nBundle.js +58 -5
  60. package/dist/locale/RTLAwareRegistry.js +14 -0
  61. package/dist/locale/applyDirection.js +17 -0
  62. package/dist/locale/directionChange.js +32 -0
  63. package/dist/locale/getEffectiveDir.js +28 -0
  64. package/dist/locale/getLocale.js +12 -2
  65. package/dist/locale/languageChange.js +22 -0
  66. package/dist/renderer/LitRenderer.js +44 -7
  67. package/dist/renderer/directives/style-map.js +72 -0
  68. package/dist/renderer/executeTemplate.js +34 -0
  69. package/dist/sap/base/Log.js +241 -0
  70. package/dist/sap/base/assert.js +8 -0
  71. package/dist/sap/base/security/URLListValidator.js +148 -0
  72. package/dist/sap/base/security/encodeCSS.js +14 -0
  73. package/dist/sap/base/security/encodeXML.js +23 -0
  74. package/dist/sap/base/security/sanitizeHTML.js +16 -0
  75. package/dist/sap/base/strings/toHex.js +8 -0
  76. package/dist/sap/base/util/now.js +7 -0
  77. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3585 -0
  78. package/dist/theming/CustomStyle.js +47 -6
  79. package/dist/theming/ThemeLoaded.js +22 -0
  80. package/dist/theming/applyTheme.js +13 -15
  81. package/dist/theming/getConstructableStyle.js +15 -10
  82. package/dist/theming/getEffectiveLinksHrefs.js +27 -0
  83. package/dist/theming/getEffectiveStyle.js +32 -8
  84. package/dist/theming/getStylesString.js +15 -0
  85. package/dist/theming/getThemeDesignerTheme.js +25 -5
  86. package/dist/theming/preloadLinks.js +23 -0
  87. package/dist/types/CSSColor.js +9 -0
  88. package/dist/types/CalendarType.js +1 -1
  89. package/dist/types/DataType.js +13 -1
  90. package/dist/types/Float.js +14 -0
  91. package/dist/types/Integer.js +4 -0
  92. package/dist/types/InvisibleMessageMode.js +30 -0
  93. package/dist/types/ItemNavigationBehavior.js +2 -7
  94. package/dist/types/NavigationMode.js +1 -0
  95. package/dist/types/PopupState.js +1 -1
  96. package/dist/types/ValueState.js +1 -1
  97. package/dist/updateShadowRoot.js +29 -0
  98. package/dist/util/AriaLabelHelper.js +41 -0
  99. package/dist/util/Caret.js +32 -0
  100. package/dist/util/ColorConversion.js +398 -0
  101. package/dist/util/FocusableElements.js +30 -11
  102. package/dist/util/HTMLSanitizer.js +7 -0
  103. package/dist/util/InvisibleMessage.js +69 -0
  104. package/dist/util/PopupUtils.js +93 -0
  105. package/dist/util/SlotsHelper.js +43 -0
  106. package/dist/util/TabbableElements.js +5 -1
  107. package/dist/util/arraysAreEqual.js +15 -0
  108. package/dist/util/clamp.js +12 -0
  109. package/dist/util/createLinkInHead.js +19 -0
  110. package/dist/util/debounce.js +17 -0
  111. package/dist/util/escapeRegex.js +10 -0
  112. package/dist/util/generateHighlightedMarkup.js +42 -0
  113. package/dist/util/getActiveElement.js +11 -0
  114. package/dist/util/getClassCopy.js +10 -0
  115. package/dist/util/getEffectiveContentDensity.js +5 -0
  116. package/dist/util/getNormalizedTarget.js +16 -0
  117. package/dist/util/getSingletonElementInstance.js +13 -0
  118. package/dist/util/isDefaultSlotProvided.js +11 -0
  119. package/dist/util/isElementInView.js +15 -0
  120. package/dist/util/isNodeHidden.js +1 -5
  121. package/dist/util/isNodeTabbable.js +4 -4
  122. package/dist/util/isValidPropertyName.js +9 -3
  123. package/dist/util/setToArray.js +10 -0
  124. package/hash.txt +1 -0
  125. package/index.js +1 -1
  126. package/lib/generate-asset-parameters/index.js +8 -5
  127. package/lib/generate-styles/index.js +26 -0
  128. package/lib/generate-version-info/index.js +32 -0
  129. package/package-scripts.js +37 -28
  130. package/package.json +20 -13
  131. package/src/AssetRegistry.js +8 -7
  132. package/src/Boot.js +59 -0
  133. package/src/CSP.js +59 -0
  134. package/src/CustomElementsRegistry.js +79 -7
  135. package/src/CustomElementsScope.js +30 -0
  136. package/src/CustomElementsScopeUtils.js +108 -0
  137. package/src/DOMObserver.js +65 -0
  138. package/src/Device.js +71 -773
  139. package/src/EventProvider.js +38 -26
  140. package/src/FeaturesRegistry.js +4 -1
  141. package/src/FontFace.js +19 -62
  142. package/src/InitialConfiguration.js +43 -8
  143. package/src/Keys.js +136 -2
  144. package/src/ManagedStyles.js +83 -0
  145. package/src/MediaRange.js +109 -0
  146. package/src/PropertiesFileFormat.js +95 -0
  147. package/src/Render.js +175 -0
  148. package/src/RenderQueue.js +41 -17
  149. package/src/RenderScheduler.js +24 -126
  150. package/src/Runtimes.js +107 -0
  151. package/src/StaticArea.js +1 -39
  152. package/src/StaticAreaItem.js +58 -62
  153. package/src/SystemCSSVars.js +10 -0
  154. package/src/Theming.js +2 -1
  155. package/src/UI5Element.js +425 -318
  156. package/src/UI5ElementMetadata.js +173 -17
  157. package/src/asset-registries/Icons.js +125 -14
  158. package/src/asset-registries/Illustrations.js +30 -0
  159. package/src/asset-registries/LocaleData.js +105 -66
  160. package/src/asset-registries/Themes.js +29 -34
  161. package/src/asset-registries/i18n.js +73 -29
  162. package/src/assets-meta/IconCollectionsAlias.js +18 -0
  163. package/src/config/AnimationMode.js +11 -1
  164. package/src/config/Icons.js +52 -0
  165. package/src/config/Language.js +58 -2
  166. package/src/config/Theme.js +25 -0
  167. package/src/css/BusyIndicator.css +80 -0
  168. package/src/css/FontFace.css +75 -0
  169. package/src/css/OverrideFontFace.css +32 -0
  170. package/src/css/SystemCSSVars.css +17 -0
  171. package/src/delegate/ItemNavigation.js +249 -171
  172. package/src/delegate/ResizeHandler.js +78 -38
  173. package/src/delegate/ScrollEnablement.js +49 -20
  174. package/src/features/F6Navigation.js +110 -0
  175. package/src/features/OpenUI5Enablement.js +119 -0
  176. package/src/features/OpenUI5Support.js +42 -7
  177. package/src/getSharedResource.js +30 -0
  178. package/src/i18nBundle.js +58 -5
  179. package/src/locale/RTLAwareRegistry.js +14 -0
  180. package/src/locale/applyDirection.js +17 -0
  181. package/src/locale/directionChange.js +32 -0
  182. package/src/locale/getEffectiveDir.js +28 -0
  183. package/src/locale/getLocale.js +12 -2
  184. package/src/locale/languageChange.js +22 -0
  185. package/src/renderer/LitRenderer.js +44 -7
  186. package/src/renderer/directives/style-map.js +72 -0
  187. package/src/renderer/executeTemplate.js +34 -0
  188. package/src/theming/CustomStyle.js +47 -6
  189. package/src/theming/ThemeLoaded.js +22 -0
  190. package/src/theming/applyTheme.js +13 -15
  191. package/src/theming/getConstructableStyle.js +15 -10
  192. package/src/theming/getEffectiveLinksHrefs.js +27 -0
  193. package/src/theming/getEffectiveStyle.js +32 -8
  194. package/src/theming/getStylesString.js +15 -0
  195. package/src/theming/getThemeDesignerTheme.js +25 -5
  196. package/src/theming/preloadLinks.js +23 -0
  197. package/src/types/CSSColor.js +9 -0
  198. package/src/types/CalendarType.js +1 -1
  199. package/src/types/DataType.js +13 -1
  200. package/src/types/Float.js +14 -0
  201. package/src/types/Integer.js +4 -0
  202. package/src/types/InvisibleMessageMode.js +30 -0
  203. package/src/types/ItemNavigationBehavior.js +2 -7
  204. package/src/types/NavigationMode.js +1 -0
  205. package/src/types/PopupState.js +1 -1
  206. package/src/types/ValueState.js +1 -1
  207. package/src/updateShadowRoot.js +29 -0
  208. package/src/util/AriaLabelHelper.js +41 -0
  209. package/src/util/Caret.js +32 -0
  210. package/src/util/ColorConversion.js +398 -0
  211. package/src/util/FocusableElements.js +30 -11
  212. package/src/util/HTMLSanitizer.js +7 -0
  213. package/src/util/InvisibleMessage.js +69 -0
  214. package/src/util/PopupUtils.js +93 -0
  215. package/src/util/SlotsHelper.js +43 -0
  216. package/src/util/TabbableElements.js +5 -1
  217. package/src/util/arraysAreEqual.js +15 -0
  218. package/src/util/clamp.js +12 -0
  219. package/src/util/createLinkInHead.js +19 -0
  220. package/src/util/debounce.js +17 -0
  221. package/src/util/escapeRegex.js +10 -0
  222. package/src/util/generateHighlightedMarkup.js +42 -0
  223. package/src/util/getActiveElement.js +11 -0
  224. package/src/util/getClassCopy.js +10 -0
  225. package/src/util/getEffectiveContentDensity.js +5 -0
  226. package/src/util/getNormalizedTarget.js +16 -0
  227. package/src/util/getSingletonElementInstance.js +13 -0
  228. package/src/util/isDefaultSlotProvided.js +11 -0
  229. package/src/util/isElementInView.js +15 -0
  230. package/src/util/isNodeHidden.js +1 -5
  231. package/src/util/isNodeTabbable.js +4 -4
  232. package/src/util/isValidPropertyName.js +9 -3
  233. package/src/util/setToArray.js +10 -0
  234. package/used-modules.txt +10 -0
  235. package/bundle.es5.js +0 -28
  236. package/config/.eslintrc.js +0 -3
  237. package/config/rollup.config.js +0 -1
  238. package/dist/SVGIconRegistry.js +0 -60
  239. package/dist/boot.js +0 -32
  240. package/dist/compatibility/DOMObserver.js +0 -62
  241. package/dist/compatibility/patchNodeValue.js +0 -24
  242. package/dist/compatibility/whenPolyfillLoaded.js +0 -26
  243. package/dist/delegate/CustomResize.js +0 -78
  244. package/dist/delegate/NativeResize.js +0 -44
  245. package/dist/features/browsersupport/Edge.js +0 -6
  246. package/dist/features/browsersupport/IE11.js +0 -41
  247. package/dist/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
  248. package/dist/renderer/ifDefined.js +0 -21
  249. package/dist/resources/bundle.es5.js +0 -212
  250. package/dist/resources/bundle.es5.js.map +0 -1
  251. package/dist/resources/bundle.esm.js +0 -129
  252. package/dist/resources/bundle.esm.js.map +0 -1
  253. package/dist/test-resources/assets/Themes.js +0 -13
  254. package/dist/test-resources/elements/Child.js +0 -35
  255. package/dist/test-resources/elements/Generic.js +0 -84
  256. package/dist/test-resources/elements/GenericExt.js +0 -26
  257. package/dist/test-resources/elements/NoShadowDOM.js +0 -13
  258. package/dist/test-resources/elements/Parent.js +0 -37
  259. package/dist/test-resources/elements/WithStaticArea.js +0 -76
  260. package/dist/test-resources/pages/AllTestElements.html +0 -42
  261. package/dist/test-resources/pages/Configuration.html +0 -20
  262. package/dist/test-resources/pages/ConfigurationScript.html +0 -36
  263. package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -25
  264. package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -61
  265. package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -45
  266. package/dist/test-resources/specs/CustomTheme.spec.js +0 -25
  267. package/dist/test-resources/specs/StaticArea.spec.js +0 -34
  268. package/dist/test-resources/specs/Theming.spec.js +0 -31
  269. package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -258
  270. package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -93
  271. package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -101
  272. package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -40
  273. package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -12
  274. package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -65
  275. package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -22
  276. package/dist/test-resources/specs/UI5ElementSlots.js +0 -34
  277. package/dist/theming/CSSVarsPonyfill.js +0 -24
  278. package/dist/theming/adaptCSSForIE.js +0 -90
  279. package/dist/theming/createComponentStyleTag.js +0 -49
  280. package/dist/theming/createThemePropertiesStyleTag.js +0 -20
  281. package/dist/thirdparty/Array.from.js +0 -16
  282. package/dist/thirdparty/Array.prototype.fill.js +0 -44
  283. package/dist/thirdparty/Array.prototype.find.js +0 -46
  284. package/dist/thirdparty/Array.prototype.includes.js +0 -51
  285. package/dist/thirdparty/Element.prototype.closest.js +0 -11
  286. package/dist/thirdparty/Element.prototype.matches.js +0 -6
  287. package/dist/thirdparty/Map.prototype.keys.js +0 -9
  288. package/dist/thirdparty/Number.isInteger.js +0 -5
  289. package/dist/thirdparty/Number.isNaN.js +0 -1
  290. package/dist/thirdparty/Number.parseInt.js +0 -1
  291. package/dist/thirdparty/Object.assign.js +0 -31
  292. package/dist/thirdparty/Object.entries.js +0 -11
  293. package/dist/thirdparty/Symbol.js +0 -2
  294. package/dist/thirdparty/WeakSet.js +0 -27
  295. package/dist/thirdparty/es6-string-methods.js +0 -182
  296. package/dist/thirdparty/events-polyfills.js +0 -89
  297. package/dist/thirdparty/fetch.js +0 -1
  298. package/dist/thirdparty/template.js +0 -600
  299. package/dist/thirdparty/webcomponents-sd-ce-pf.js +0 -318
  300. package/dist/util/isSlot.js +0 -3
  301. package/dist/webcomponentsjs/LICENSE.md +0 -19
  302. package/dist/webcomponentsjs/README.md +0 -229
  303. package/dist/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
  304. package/dist/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
  305. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -297
  306. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
  307. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -208
  308. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
  309. package/dist/webcomponentsjs/bundles/webcomponents-sd.js +0 -166
  310. package/dist/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
  311. package/dist/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
  312. package/dist/webcomponentsjs/package.json +0 -46
  313. package/dist/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
  314. package/dist/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -53
  315. package/dist/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
  316. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
  317. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -28
  318. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
  319. package/dist/webcomponentsjs/webcomponents-bundle.js +0 -298
  320. package/dist/webcomponentsjs/webcomponents-bundle.js.map +0 -1
  321. package/dist/webcomponentsjs/webcomponents-loader.js +0 -185
  322. package/src/SVGIconRegistry.js +0 -60
  323. package/src/boot.js +0 -32
  324. package/src/compatibility/DOMObserver.js +0 -62
  325. package/src/compatibility/patchNodeValue.js +0 -24
  326. package/src/compatibility/whenPolyfillLoaded.js +0 -26
  327. package/src/delegate/CustomResize.js +0 -78
  328. package/src/delegate/NativeResize.js +0 -44
  329. package/src/features/browsersupport/Edge.js +0 -6
  330. package/src/features/browsersupport/IE11.js +0 -41
  331. package/src/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
  332. package/src/renderer/ifDefined.js +0 -21
  333. package/src/theming/CSSVarsPonyfill.js +0 -24
  334. package/src/theming/adaptCSSForIE.js +0 -90
  335. package/src/theming/createComponentStyleTag.js +0 -49
  336. package/src/theming/createThemePropertiesStyleTag.js +0 -20
  337. package/src/thirdparty/Array.from.js +0 -16
  338. package/src/thirdparty/Array.prototype.fill.js +0 -44
  339. package/src/thirdparty/Array.prototype.find.js +0 -46
  340. package/src/thirdparty/Array.prototype.includes.js +0 -51
  341. package/src/thirdparty/Element.prototype.closest.js +0 -11
  342. package/src/thirdparty/Element.prototype.matches.js +0 -6
  343. package/src/thirdparty/Map.prototype.keys.js +0 -9
  344. package/src/thirdparty/Number.isInteger.js +0 -5
  345. package/src/thirdparty/Number.isNaN.js +0 -1
  346. package/src/thirdparty/Number.parseInt.js +0 -1
  347. package/src/thirdparty/Object.assign.js +0 -31
  348. package/src/thirdparty/Object.entries.js +0 -11
  349. package/src/thirdparty/Symbol.js +0 -2
  350. package/src/thirdparty/WeakSet.js +0 -27
  351. package/src/thirdparty/es6-string-methods.js +0 -182
  352. package/src/thirdparty/events-polyfills.js +0 -89
  353. package/src/thirdparty/fetch.js +0 -1
  354. package/src/thirdparty/template.js +0 -600
  355. package/src/thirdparty/webcomponents-sd-ce-pf.js +0 -318
  356. package/src/util/isSlot.js +0 -3
@@ -0,0 +1,107 @@
1
+ import VersionInfo from "./generated/VersionInfo.js";
2
+ import getSharedResource from "./getSharedResource.js";
3
+
4
+ let currentRuntimeIndex;
5
+ let currentRuntimeAlias = "";
6
+
7
+ const compareCache = new Map();
8
+
9
+ /**
10
+ * Central registry where all runtimes register themselves by pushing an object.
11
+ * The index in the registry servers as an ID for the runtime.
12
+ * @type {*}
13
+ */
14
+ const Runtimes = getSharedResource("Runtimes", []);
15
+
16
+ /**
17
+ * Registers the current runtime in the shared runtimes resource registry
18
+ */
19
+ const registerCurrentRuntime = () => {
20
+ if (currentRuntimeIndex === undefined) {
21
+ currentRuntimeIndex = Runtimes.length;
22
+ Runtimes.push({
23
+ ...VersionInfo,
24
+ alias: currentRuntimeAlias,
25
+ description: `Runtime ${currentRuntimeIndex} - ver ${VersionInfo.version}${currentRuntimeAlias ? ` (${currentRuntimeAlias})` : ""}`,
26
+ });
27
+ }
28
+ };
29
+
30
+ /**
31
+ * Returns the index of the current runtime's object in the shared runtimes resource registry
32
+ * @returns {*}
33
+ */
34
+ const getCurrentRuntimeIndex = () => {
35
+ return currentRuntimeIndex;
36
+ };
37
+
38
+ /**
39
+ * Compares two runtimes and returns 1 if the first is of a bigger version, -1 if the second is of a bigger version, and 0 if equal
40
+ * @param index1 The index of the first runtime to compare
41
+ * @param index2 The index of the second runtime to compare
42
+ * @returns {number}
43
+ */
44
+ const compareRuntimes = (index1, index2) => {
45
+ const cacheIndex = `${index1},${index2}`;
46
+ if (compareCache.has(cacheIndex)) {
47
+ return compareCache.get(cacheIndex);
48
+ }
49
+
50
+ const runtime1 = Runtimes[index1];
51
+ const runtime2 = Runtimes[index2];
52
+
53
+ if (!runtime1 || !runtime2) {
54
+ throw new Error("Invalid runtime index supplied");
55
+ }
56
+
57
+ // If any of the two is a next version, bigger buildTime wins
58
+ if (runtime1.isNext || runtime2.isNext) {
59
+ return runtime1.buildTime - runtime2.buildTime;
60
+ }
61
+
62
+ // If major versions differ, bigger one wins
63
+ const majorDiff = runtime1.major - runtime2.major;
64
+ if (majorDiff) {
65
+ return majorDiff;
66
+ }
67
+
68
+ // If minor versions differ, bigger one wins
69
+ const minorDiff = runtime1.minor - runtime2.minor;
70
+ if (minorDiff) {
71
+ return minorDiff;
72
+ }
73
+
74
+ // If patch versions differ, bigger one wins
75
+ const patchDiff = runtime1.patch - runtime2.patch;
76
+ if (patchDiff) {
77
+ return patchDiff;
78
+ }
79
+
80
+ // Bigger suffix wins, f.e. rc10 > rc9
81
+ // Important: suffix is alphanumeric, must use natural compare
82
+ const collator = new Intl.Collator(undefined, { numeric: true, sensitivity: "base" });
83
+ const result = collator.compare(runtime1.suffix, runtime2.suffix);
84
+
85
+ compareCache.set(cacheIndex, result);
86
+ return result;
87
+ };
88
+
89
+ /**
90
+ * Set an alias for the the current app/library/microfrontend which will appear in debug messages and console warnings
91
+ * @param alias
92
+ */
93
+ const setRuntimeAlias = alias => {
94
+ currentRuntimeAlias = alias;
95
+ };
96
+
97
+ const getAllRuntimes = () => {
98
+ return Runtimes;
99
+ };
100
+
101
+ export {
102
+ getCurrentRuntimeIndex,
103
+ registerCurrentRuntime,
104
+ compareRuntimes,
105
+ setRuntimeAlias,
106
+ getAllRuntimes,
107
+ };
@@ -1,41 +1,3 @@
1
- const getStaticAreaInstance = () => {
2
- let staticArea = document.querySelector("ui5-static-area");
3
-
4
- if (staticArea) {
5
- return staticArea;
6
- }
7
-
8
- // Create static area if it is not present
9
- const bodyElement = document.body;
10
- staticArea = document.createElement("ui5-static-area");
11
-
12
- return bodyElement.insertBefore(staticArea, bodyElement.firstChild);
13
- };
14
-
15
- const removeStaticArea = () => {
16
- getStaticAreaInstance().destroy();
17
- };
18
-
19
- class StaticAreaElement extends HTMLElement {
20
- constructor() {
21
- super();
22
- }
23
-
24
- get isUI5Element() {
25
- return true;
26
- }
27
-
28
- destroy() {
29
- const staticAreaDomRef = document.querySelector(this.tagName.toLowerCase());
30
- staticAreaDomRef.parentElement.removeChild(staticAreaDomRef);
31
- }
32
- }
33
-
34
1
  if (!customElements.get("ui5-static-area")) {
35
- customElements.define("ui5-static-area", StaticAreaElement);
2
+ customElements.define("ui5-static-area", class extends HTMLElement {});
36
3
  }
37
-
38
- export {
39
- getStaticAreaInstance,
40
- removeStaticArea,
41
- };
@@ -1,77 +1,67 @@
1
- import { getStaticAreaInstance, removeStaticArea } from "./StaticArea.js";
2
- import RenderScheduler from "./RenderScheduler.js";
1
+ import "./StaticArea.js";
2
+ import updateShadowRoot from "./updateShadowRoot.js";
3
+ import { renderFinished } from "./Render.js";
4
+ import getEffectiveContentDensity from "./util/getEffectiveContentDensity.js";
5
+ import { getEffectiveScopingSuffixForTag } from "./CustomElementsScopeUtils.js";
6
+ import getEffectiveDir from "./locale/getEffectiveDir.js";
3
7
 
4
8
  /**
9
+ *
5
10
  * @class
6
11
  * @author SAP SE
7
12
  * @private
8
- * Defines and takes care of ui5-static-are-item items
9
13
  */
10
- class StaticAreaItem {
11
- constructor(_ui5ElementContext) {
12
- this.ui5ElementContext = _ui5ElementContext;
14
+ class StaticAreaItem extends HTMLElement {
15
+ constructor() {
16
+ super();
13
17
  this._rendered = false;
14
- }
15
-
16
- isRendered() {
17
- return this._rendered;
18
+ this.attachShadow({ mode: "open" });
18
19
  }
19
20
 
20
21
  /**
21
22
  * @protected
23
+ * @param ownerElement The UI5Element instance that owns this static area item
22
24
  */
23
- _updateFragment() {
24
- const renderResult = this.ui5ElementContext.constructor.staticAreaTemplate(this.ui5ElementContext),
25
- stylesToAdd = window.ShadyDOM ? false : this.ui5ElementContext.constructor.staticAreaStyles;
26
-
27
- if (!this.staticAreaItemDomRef) {
28
- // Initial rendering of fragment
29
-
30
- this.staticAreaItemDomRef = document.createElement("ui5-static-area-item");
31
- this.staticAreaItemDomRef.attachShadow({ mode: "open" });
32
- this.staticAreaItemDomRef.classList.add(this.ui5ElementContext._id); // used for getting the popover in the tests
33
-
34
- getStaticAreaInstance().appendChild(this.staticAreaItemDomRef);
35
- this._rendered = true;
25
+ setOwnerElement(ownerElement) {
26
+ this.ownerElement = ownerElement;
27
+ this.classList.add(this.ownerElement._id); // used for getting the popover in the tests
28
+ if (this.ownerElement.hasAttribute("data-ui5-static-stable")) {
29
+ this.setAttribute("data-ui5-stable", this.ownerElement.getAttribute("data-ui5-static-stable")); // stable selector
36
30
  }
37
-
38
- this.ui5ElementContext.constructor.render(renderResult, this.staticAreaItemDomRef.shadowRoot, stylesToAdd, { eventContext: this.ui5ElementContext });
39
31
  }
40
32
 
41
33
  /**
34
+ * Updates the shadow root of the static area item with the latest state, if rendered
42
35
  * @protected
43
36
  */
44
- _removeFragmentFromStaticArea() {
45
- if (!this.staticAreaItemDomRef) {
46
- return;
47
- }
48
-
49
- const staticArea = getStaticAreaInstance();
50
-
51
- staticArea.removeChild(this.staticAreaItemDomRef);
52
-
53
- this.staticAreaItemDomRef = null;
54
-
55
- // remove static area
56
- if (staticArea.childElementCount < 1) {
57
- removeStaticArea();
37
+ update() {
38
+ if (this._rendered) {
39
+ this._updateContentDensity();
40
+ this._updateDirection();
41
+ updateShadowRoot(this.ownerElement, true);
58
42
  }
59
43
  }
60
44
 
61
45
  /**
62
- * @protected
46
+ * Sets the correct content density based on the owner element's state
47
+ * @private
63
48
  */
64
- _updateContentDensity(isCompact) {
65
- if (!this.staticAreaItemDomRef) {
66
- return;
49
+ _updateContentDensity() {
50
+ if (getEffectiveContentDensity(this.ownerElement) === "compact") {
51
+ this.classList.add("sapUiSizeCompact");
52
+ this.classList.add("ui5-content-density-compact");
53
+ } else {
54
+ this.classList.remove("sapUiSizeCompact");
55
+ this.classList.remove("ui5-content-density-compact");
67
56
  }
57
+ }
68
58
 
69
- if (isCompact) {
70
- this.staticAreaItemDomRef.classList.add("sapUiSizeCompact");
71
- this.staticAreaItemDomRef.classList.add("ui5-content-density-compact");
59
+ _updateDirection() {
60
+ const dir = getEffectiveDir(this.ownerElement);
61
+ if (dir) {
62
+ this.setAttribute("dir", dir);
72
63
  } else {
73
- this.staticAreaItemDomRef.classList.remove("sapUiSizeCompact");
74
- this.staticAreaItemDomRef.classList.remove("ui5-content-density-compact");
64
+ this.removeAttribute("dir");
75
65
  }
76
66
  }
77
67
 
@@ -80,26 +70,32 @@ class StaticAreaItem {
80
70
  * Returns reference to the DOM element where the current fragment is added.
81
71
  */
82
72
  async getDomRef() {
83
- if (!this._rendered || !this.staticAreaItemDomRef) {
84
- this._updateFragment();
73
+ this._updateContentDensity();
74
+ if (!this._rendered) {
75
+ this._rendered = true;
76
+ updateShadowRoot(this.ownerElement, true);
85
77
  }
86
- await RenderScheduler.whenDOMUpdated(); // Wait for the content of the ui5-static-area-item to be rendered
87
- return this.staticAreaItemDomRef.shadowRoot;
78
+ await renderFinished(); // Wait for the content of the ui5-static-area-item to be rendered
79
+ return this.shadowRoot;
88
80
  }
89
- }
90
81
 
91
- class StaticAreaItemElement extends HTMLElement {
92
- constructor() {
93
- super();
94
- }
82
+ static getTag() {
83
+ const pureTag = "ui5-static-area-item";
84
+ const suffix = getEffectiveScopingSuffixForTag(pureTag);
85
+ if (!suffix) {
86
+ return pureTag;
87
+ }
95
88
 
96
- get isUI5Element() {
97
- return true;
89
+ return `${pureTag}-${suffix}`;
98
90
  }
99
- }
100
91
 
101
- if (!customElements.get("ui5-static-area-item")) {
102
- customElements.define("ui5-static-area-item", StaticAreaItemElement);
92
+ static createInstance() {
93
+ if (!customElements.get(StaticAreaItem.getTag())) {
94
+ customElements.define(StaticAreaItem.getTag(), StaticAreaItem);
95
+ }
96
+
97
+ return document.createElement(this.getTag());
98
+ }
103
99
  }
104
100
 
105
101
  export default StaticAreaItem;
@@ -0,0 +1,10 @@
1
+ import { hasStyle, createStyle } from "./ManagedStyles.js";
2
+ import systemCSSVars from "./generated/css/SystemCSSVars.css.js";
3
+
4
+ const insertSystemCSSVars = () => {
5
+ if (!hasStyle("data-ui5-system-css-vars")) {
6
+ createStyle(systemCSSVars, "data-ui5-system-css-vars");
7
+ }
8
+ };
9
+
10
+ export default insertSystemCSSVars;
package/dist/Theming.js CHANGED
@@ -1,3 +1,4 @@
1
1
  import { addCustomCSS } from "./theming/CustomStyle.js";
2
+ import { attachThemeLoaded, detachThemeLoaded } from "./theming/ThemeLoaded.js";
2
3
 
3
- export { addCustomCSS }; // eslint-disable-line
4
+ export { addCustomCSS, attachThemeLoaded, detachThemeLoaded };