@ui5/webcomponents-base 0.0.0-78035f8e7 → 0.0.0-7b7921cd9

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 (690) hide show
  1. package/.eslintignore +8 -3
  2. package/.npsrc.json +3 -0
  3. package/CHANGELOG.md +758 -0
  4. package/README.md +57 -7
  5. package/bundle.esm.js +33 -22
  6. package/config/wdio.conf.cjs +400 -0
  7. package/dist/AssetRegistry.d.ts +5 -0
  8. package/dist/AssetRegistry.js +6 -10
  9. package/dist/AssetRegistry.js.map +1 -0
  10. package/dist/Boot.d.ts +9 -0
  11. package/dist/Boot.js +71 -0
  12. package/dist/Boot.js.map +1 -0
  13. package/dist/CSP.d.ts +30 -0
  14. package/dist/CSP.js +51 -0
  15. package/dist/CSP.js.map +1 -0
  16. package/dist/CustomElementsRegistry.d.ts +5 -0
  17. package/dist/CustomElementsRegistry.js +69 -30
  18. package/dist/CustomElementsRegistry.js.map +1 -0
  19. package/dist/CustomElementsScope.d.ts +7 -0
  20. package/dist/CustomElementsScope.js +11 -0
  21. package/dist/CustomElementsScope.js.map +1 -0
  22. package/dist/CustomElementsScopeUtils.d.ts +55 -0
  23. package/dist/CustomElementsScopeUtils.js +90 -0
  24. package/dist/CustomElementsScopeUtils.js.map +1 -0
  25. package/dist/DOMObserver.d.ts +11 -0
  26. package/dist/DOMObserver.js +23 -0
  27. package/dist/DOMObserver.js.map +1 -0
  28. package/dist/Device.d.ts +12 -0
  29. package/dist/Device.js +159 -816
  30. package/dist/Device.js.map +1 -0
  31. package/dist/EventProvider.d.ts +25 -0
  32. package/dist/EventProvider.js +67 -78
  33. package/dist/EventProvider.js.map +1 -0
  34. package/dist/FeaturesRegistry.d.ts +3 -0
  35. package/dist/FeaturesRegistry.js +5 -7
  36. package/dist/FeaturesRegistry.js.map +1 -0
  37. package/dist/FontFace.d.ts +2 -0
  38. package/dist/FontFace.js +21 -69
  39. package/dist/FontFace.js.map +1 -0
  40. package/dist/IgnoreCustomElements.d.ts +27 -0
  41. package/dist/IgnoreCustomElements.js +39 -0
  42. package/dist/IgnoreCustomElements.js.map +1 -0
  43. package/dist/InitialConfiguration.d.ts +27 -0
  44. package/dist/InitialConfiguration.js +128 -103
  45. package/dist/InitialConfiguration.js.map +1 -0
  46. package/dist/Keys.d.ts +57 -0
  47. package/dist/Keys.js +174 -166
  48. package/dist/Keys.js.map +1 -0
  49. package/dist/ManagedStyles.d.ts +8 -0
  50. package/dist/ManagedStyles.js +84 -0
  51. package/dist/ManagedStyles.js.map +1 -0
  52. package/dist/MarkedEvents.d.ts +9 -0
  53. package/dist/MarkedEvents.js +15 -0
  54. package/dist/MarkedEvents.js.map +1 -0
  55. package/dist/MediaRange.d.ts +37 -0
  56. package/dist/MediaRange.js +98 -0
  57. package/dist/MediaRange.js.map +1 -0
  58. package/dist/PropertiesFileFormat.d.ts +8 -0
  59. package/dist/PropertiesFileFormat.js +85 -0
  60. package/dist/PropertiesFileFormat.js.map +1 -0
  61. package/dist/Render.d.ts +47 -0
  62. package/dist/Render.js +143 -0
  63. package/dist/Render.js.map +1 -0
  64. package/dist/RenderQueue.d.ts +19 -0
  65. package/dist/RenderQueue.js +53 -39
  66. package/dist/RenderQueue.js.map +1 -0
  67. package/dist/Runtimes.d.ts +27 -0
  68. package/dist/Runtimes.js +86 -0
  69. package/dist/Runtimes.js.map +1 -0
  70. package/dist/StaticArea.d.ts +3 -0
  71. package/dist/StaticArea.js +4 -28
  72. package/dist/StaticArea.js.map +1 -0
  73. package/dist/StaticAreaItem.d.ts +36 -0
  74. package/dist/StaticAreaItem.js +95 -98
  75. package/dist/StaticAreaItem.js.map +1 -0
  76. package/dist/SystemCSSVars.d.ts +2 -0
  77. package/dist/SystemCSSVars.js +6 -28
  78. package/dist/SystemCSSVars.js.map +1 -0
  79. package/dist/Theming.d.ts +3 -0
  80. package/dist/Theming.js +3 -2
  81. package/dist/Theming.js.map +1 -0
  82. package/dist/UI5Element.d.ts +380 -0
  83. package/dist/UI5Element.js +946 -979
  84. package/dist/UI5Element.js.map +1 -0
  85. package/dist/UI5ElementMetadata.d.ts +150 -0
  86. package/dist/UI5ElementMetadata.js +278 -174
  87. package/dist/UI5ElementMetadata.js.map +1 -0
  88. package/dist/animations/AnimationQueue.d.ts +8 -0
  89. package/dist/animations/AnimationQueue.js +31 -38
  90. package/dist/animations/AnimationQueue.js.map +1 -0
  91. package/dist/animations/animate.d.ts +14 -0
  92. package/dist/animations/animate.js +46 -51
  93. package/dist/animations/animate.js.map +1 -0
  94. package/dist/animations/scroll.d.ts +5 -0
  95. package/dist/animations/scroll.js +18 -27
  96. package/dist/animations/scroll.js.map +1 -0
  97. package/dist/animations/slideDown.d.ts +5 -0
  98. package/dist/animations/slideDown.js +53 -78
  99. package/dist/animations/slideDown.js.map +1 -0
  100. package/dist/animations/slideUp.d.ts +5 -0
  101. package/dist/animations/slideUp.js +49 -70
  102. package/dist/animations/slideUp.js.map +1 -0
  103. package/dist/api.json +1 -0
  104. package/dist/asset-registries/Icons.d.ts +38 -0
  105. package/dist/asset-registries/Icons.js +125 -31
  106. package/dist/asset-registries/Icons.js.map +1 -0
  107. package/dist/asset-registries/Illustrations.d.ts +17 -0
  108. package/dist/asset-registries/Illustrations.js +46 -0
  109. package/dist/asset-registries/Illustrations.js.map +1 -0
  110. package/dist/asset-registries/LocaleData.d.ts +7 -0
  111. package/dist/asset-registries/LocaleData.js +125 -114
  112. package/dist/asset-registries/LocaleData.js.map +1 -0
  113. package/dist/asset-registries/Themes.d.ts +11 -0
  114. package/dist/asset-registries/Themes.js +41 -76
  115. package/dist/asset-registries/Themes.js.map +1 -0
  116. package/dist/asset-registries/i18n.d.ts +23 -0
  117. package/dist/asset-registries/i18n.js +77 -82
  118. package/dist/asset-registries/i18n.js.map +1 -0
  119. package/dist/assets/Boot.34b7cea0.css +1 -0
  120. package/dist/assets/Boot.ef9171c9.js +9 -0
  121. package/dist/assets/bundle.esm.183f95f0.js +50 -0
  122. package/dist/assets-meta/IconCollectionsAlias.d.ts +31 -0
  123. package/dist/assets-meta/IconCollectionsAlias.js +38 -0
  124. package/dist/assets-meta/IconCollectionsAlias.js.map +1 -0
  125. package/dist/config/AnimationMode.d.ts +14 -0
  126. package/dist/config/AnimationMode.js +23 -10
  127. package/dist/config/AnimationMode.js.map +1 -0
  128. package/dist/config/CalendarType.d.ts +8 -0
  129. package/dist/config/CalendarType.js +13 -12
  130. package/dist/config/CalendarType.js.map +1 -0
  131. package/dist/config/FormatSettings.d.ts +15 -0
  132. package/dist/config/FormatSettings.js +15 -9
  133. package/dist/config/FormatSettings.js.map +1 -0
  134. package/dist/config/Icons.d.ts +55 -0
  135. package/dist/config/Icons.js +103 -0
  136. package/dist/config/Icons.js.map +1 -0
  137. package/dist/config/Language.d.ts +40 -0
  138. package/dist/config/Language.js +56 -29
  139. package/dist/config/Language.js.map +1 -0
  140. package/dist/config/NoConflict.d.ts +20 -0
  141. package/dist/config/NoConflict.js +41 -41
  142. package/dist/config/NoConflict.js.map +1 -0
  143. package/dist/config/RTL.d.ts +7 -0
  144. package/dist/config/RTL.js +26 -20
  145. package/dist/config/RTL.js.map +1 -0
  146. package/dist/config/Theme.d.ts +38 -0
  147. package/dist/config/Theme.js +64 -22
  148. package/dist/config/Theme.js.map +1 -0
  149. package/dist/config/ThemeRoot.d.ts +29 -0
  150. package/dist/config/ThemeRoot.js +59 -0
  151. package/dist/config/ThemeRoot.js.map +1 -0
  152. package/dist/config/Timezone.d.ts +17 -0
  153. package/dist/config/Timezone.js +30 -0
  154. package/dist/config/Timezone.js.map +1 -0
  155. package/dist/css/BusyIndicator.css +80 -0
  156. package/dist/css/FontFace.css +66 -0
  157. package/dist/css/OverrideFontFace.css +32 -0
  158. package/dist/css/SystemCSSVars.css +17 -0
  159. package/dist/decorators/customElement.d.ts +23 -0
  160. package/dist/decorators/customElement.js +37 -0
  161. package/dist/decorators/customElement.js.map +1 -0
  162. package/dist/decorators/event.d.ts +10 -0
  163. package/dist/decorators/event.js +24 -0
  164. package/dist/decorators/event.js.map +1 -0
  165. package/dist/decorators/property.d.ts +9 -0
  166. package/dist/decorators/property.js +24 -0
  167. package/dist/decorators/property.js.map +1 -0
  168. package/dist/decorators/slot.d.ts +9 -0
  169. package/dist/decorators/slot.js +37 -0
  170. package/dist/decorators/slot.js.map +1 -0
  171. package/dist/delegate/ItemNavigation.d.ts +113 -0
  172. package/dist/delegate/ItemNavigation.js +312 -278
  173. package/dist/delegate/ItemNavigation.js.map +1 -0
  174. package/dist/delegate/ResizeHandler.d.ts +25 -0
  175. package/dist/delegate/ResizeHandler.js +84 -62
  176. package/dist/delegate/ResizeHandler.js.map +1 -0
  177. package/dist/delegate/ScrollEnablement.d.ts +49 -0
  178. package/dist/delegate/ScrollEnablement.js +159 -153
  179. package/dist/delegate/ScrollEnablement.js.map +1 -0
  180. package/dist/features/F6Navigation.d.ts +19 -0
  181. package/dist/features/F6Navigation.js +151 -0
  182. package/dist/features/F6Navigation.js.map +1 -0
  183. package/dist/features/LegacyDateFormats.d.ts +18 -0
  184. package/dist/features/LegacyDateFormats.js +20 -0
  185. package/dist/features/LegacyDateFormats.js.map +1 -0
  186. package/dist/features/OpenUI5Element.d.ts +9 -0
  187. package/dist/features/OpenUI5Element.js +5 -0
  188. package/dist/features/OpenUI5Element.js.map +1 -0
  189. package/dist/features/OpenUI5Enablement.d.ts +11 -0
  190. package/dist/features/OpenUI5Enablement.js +96 -0
  191. package/dist/features/OpenUI5Enablement.js.map +1 -0
  192. package/dist/features/OpenUI5Support.d.ts +26 -0
  193. package/dist/features/OpenUI5Support.js +95 -86
  194. package/dist/features/OpenUI5Support.js.map +1 -0
  195. package/dist/generated/AssetParameters.js +3 -1
  196. package/dist/generated/VersionInfo.js +10 -0
  197. package/dist/generated/css/BusyIndicator.css.d.ts +3 -0
  198. package/dist/generated/css/BusyIndicator.css.js +7 -0
  199. package/dist/generated/css/BusyIndicator.css.js.map +1 -0
  200. package/dist/generated/css/FontFace.css.d.ts +3 -0
  201. package/dist/generated/css/FontFace.css.js +7 -0
  202. package/dist/generated/css/FontFace.css.js.map +1 -0
  203. package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
  204. package/dist/generated/css/OverrideFontFace.css.js +7 -0
  205. package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
  206. package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
  207. package/dist/generated/css/SystemCSSVars.css.js +7 -0
  208. package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
  209. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +4 -0
  210. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js +9 -0
  211. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +1 -0
  212. package/dist/getSharedResource.d.ts +11 -0
  213. package/dist/getSharedResource.js +28 -18
  214. package/dist/getSharedResource.js.map +1 -0
  215. package/dist/global.d.ts +40 -0
  216. package/dist/i18nBundle.d.ts +43 -0
  217. package/dist/i18nBundle.js +69 -42
  218. package/dist/i18nBundle.js.map +1 -0
  219. package/dist/locale/Locale.d.ts +22 -0
  220. package/dist/locale/Locale.js +75 -87
  221. package/dist/locale/Locale.js.map +1 -0
  222. package/dist/locale/RTLAwareRegistry.d.ts +4 -0
  223. package/dist/locale/RTLAwareRegistry.js +6 -11
  224. package/dist/locale/RTLAwareRegistry.js.map +1 -0
  225. package/dist/locale/applyDirection.d.ts +10 -0
  226. package/dist/locale/applyDirection.js +10 -8
  227. package/dist/locale/applyDirection.js.map +1 -0
  228. package/dist/locale/directionChange.d.ts +15 -0
  229. package/dist/locale/directionChange.js +24 -0
  230. package/dist/locale/directionChange.js.map +1 -0
  231. package/dist/locale/getEffectiveDir.d.ts +2 -0
  232. package/dist/locale/getEffectiveDir.js +24 -0
  233. package/dist/locale/getEffectiveDir.js.map +1 -0
  234. package/dist/locale/getLocale.d.ts +7 -0
  235. package/dist/locale/getLocale.js +28 -21
  236. package/dist/locale/getLocale.js.map +1 -0
  237. package/dist/locale/languageChange.d.ts +5 -0
  238. package/dist/locale/languageChange.js +8 -16
  239. package/dist/locale/languageChange.js.map +1 -0
  240. package/dist/locale/nextFallbackLocale.d.ts +8 -0
  241. package/dist/locale/nextFallbackLocale.js +15 -19
  242. package/dist/locale/nextFallbackLocale.js.map +1 -0
  243. package/dist/locale/normalizeLocale.d.ts +7 -0
  244. package/dist/locale/normalizeLocale.js +34 -41
  245. package/dist/locale/normalizeLocale.js.map +1 -0
  246. package/dist/renderer/LitRenderer.d.ts +14 -0
  247. package/dist/renderer/LitRenderer.js +36 -11
  248. package/dist/renderer/LitRenderer.js.map +1 -0
  249. package/dist/renderer/directives/style-map.js +72 -0
  250. package/dist/renderer/executeTemplate.d.ts +13 -0
  251. package/dist/renderer/executeTemplate.js +30 -0
  252. package/dist/renderer/executeTemplate.js.map +1 -0
  253. package/dist/sap/base/Log.js +240 -0
  254. package/dist/sap/base/assert.js +7 -0
  255. package/dist/sap/base/security/URLListValidator.js +159 -0
  256. package/dist/sap/base/security/encodeCSS.js +14 -0
  257. package/dist/sap/base/security/encodeXML.js +23 -0
  258. package/dist/sap/base/security/sanitizeHTML.js +16 -0
  259. package/dist/sap/base/strings/toHex.js +8 -0
  260. package/dist/sap/base/util/now.js +7 -0
  261. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +3585 -0
  262. package/dist/theming/CustomStyle.d.ts +6 -0
  263. package/dist/theming/CustomStyle.js +46 -17
  264. package/dist/theming/CustomStyle.js.map +1 -0
  265. package/dist/theming/ThemeLoaded.d.ts +5 -0
  266. package/dist/theming/ThemeLoaded.js +14 -0
  267. package/dist/theming/ThemeLoaded.js.map +1 -0
  268. package/dist/theming/ThemeRegistered.d.ts +4 -0
  269. package/dist/theming/ThemeRegistered.js +11 -0
  270. package/dist/theming/ThemeRegistered.js.map +1 -0
  271. package/dist/theming/applyTheme.d.ts +2 -0
  272. package/dist/theming/applyTheme.js +64 -69
  273. package/dist/theming/applyTheme.js.map +1 -0
  274. package/dist/theming/getConstructableStyle.d.ts +9 -0
  275. package/dist/theming/getConstructableStyle.js +15 -15
  276. package/dist/theming/getConstructableStyle.js.map +1 -0
  277. package/dist/theming/getEffectiveLinksHrefs.d.ts +3 -0
  278. package/dist/theming/getEffectiveLinksHrefs.js +17 -0
  279. package/dist/theming/getEffectiveLinksHrefs.js.map +1 -0
  280. package/dist/theming/getEffectiveStyle.d.ts +3 -0
  281. package/dist/theming/getEffectiveStyle.js +30 -13
  282. package/dist/theming/getEffectiveStyle.js.map +1 -0
  283. package/dist/theming/getStylesString.d.ts +3 -0
  284. package/dist/theming/getStylesString.js +11 -0
  285. package/dist/theming/getStylesString.js.map +1 -0
  286. package/dist/theming/getThemeDesignerTheme.d.ts +7 -0
  287. package/dist/theming/getThemeDesignerTheme.js +73 -60
  288. package/dist/theming/getThemeDesignerTheme.js.map +1 -0
  289. package/dist/theming/preloadLinks.d.ts +3 -0
  290. package/dist/theming/preloadLinks.js +19 -0
  291. package/dist/theming/preloadLinks.js.map +1 -0
  292. package/dist/thirdparty/_merge.d.ts +2 -0
  293. package/dist/thirdparty/_merge.js +7 -4
  294. package/dist/thirdparty/_merge.js.map +1 -0
  295. package/dist/thirdparty/isPlainObject.d.ts +2 -0
  296. package/dist/thirdparty/isPlainObject.js +11 -10
  297. package/dist/thirdparty/isPlainObject.js.map +1 -0
  298. package/dist/thirdparty/merge.d.ts +2 -0
  299. package/dist/thirdparty/merge.js +4 -8
  300. package/dist/thirdparty/merge.js.map +1 -0
  301. package/dist/types/AnimationMode.d.ts +32 -0
  302. package/dist/types/AnimationMode.js +33 -6
  303. package/dist/types/AnimationMode.js.map +1 -0
  304. package/dist/types/CSSColor.d.ts +15 -0
  305. package/dist/types/CSSColor.js +18 -0
  306. package/dist/types/CSSColor.js.map +1 -0
  307. package/dist/types/CalendarType.d.ts +37 -0
  308. package/dist/types/CalendarType.js +35 -18
  309. package/dist/types/CalendarType.js.map +1 -0
  310. package/dist/types/DOMReference.d.ts +17 -0
  311. package/dist/types/DOMReference.js +25 -0
  312. package/dist/types/DOMReference.js.map +1 -0
  313. package/dist/types/DataType.d.ts +25 -0
  314. package/dist/types/DataType.js +33 -14
  315. package/dist/types/DataType.js.map +1 -0
  316. package/dist/types/Float.d.ts +17 -0
  317. package/dist/types/Float.js +17 -6
  318. package/dist/types/Float.js.map +1 -0
  319. package/dist/types/Integer.d.ts +17 -0
  320. package/dist/types/Integer.js +17 -5
  321. package/dist/types/Integer.js.map +1 -0
  322. package/dist/types/InvisibleMessageMode.d.ts +25 -0
  323. package/dist/types/InvisibleMessageMode.js +27 -0
  324. package/dist/types/InvisibleMessageMode.js.map +1 -0
  325. package/dist/types/ItemNavigationBehavior.d.ts +24 -0
  326. package/dist/types/ItemNavigationBehavior.js +22 -17
  327. package/dist/types/ItemNavigationBehavior.js.map +1 -0
  328. package/dist/types/NavigationMode.d.ts +32 -0
  329. package/dist/types/NavigationMode.js +33 -6
  330. package/dist/types/NavigationMode.js.map +1 -0
  331. package/dist/types/ValueState.d.ts +42 -0
  332. package/dist/types/ValueState.js +41 -19
  333. package/dist/types/ValueState.js.map +1 -0
  334. package/dist/types.d.ts +18 -0
  335. package/dist/types.js +2 -0
  336. package/dist/types.js.map +1 -0
  337. package/dist/updateShadowRoot.d.ts +8 -0
  338. package/dist/updateShadowRoot.js +41 -0
  339. package/dist/updateShadowRoot.js.map +1 -0
  340. package/dist/util/AriaLabelHelper.d.ts +15 -0
  341. package/dist/util/AriaLabelHelper.js +171 -0
  342. package/dist/util/AriaLabelHelper.js.map +1 -0
  343. package/dist/util/Caret.d.ts +7 -0
  344. package/dist/util/Caret.js +23 -0
  345. package/dist/util/Caret.js.map +1 -0
  346. package/dist/util/ColorConversion.d.ts +30 -0
  347. package/dist/util/ColorConversion.js +337 -0
  348. package/dist/util/ColorConversion.js.map +1 -0
  349. package/dist/util/FetchHelper.d.ts +3 -0
  350. package/dist/util/FetchHelper.js +19 -25
  351. package/dist/util/FetchHelper.js.map +1 -0
  352. package/dist/util/FocusableElements.d.ts +4 -0
  353. package/dist/util/FocusableElements.js +67 -61
  354. package/dist/util/FocusableElements.js.map +1 -0
  355. package/dist/util/HTMLSanitizer.d.ts +3 -0
  356. package/dist/util/HTMLSanitizer.js +6 -0
  357. package/dist/util/HTMLSanitizer.js.map +1 -0
  358. package/dist/util/InvisibleMessage.d.ts +10 -0
  359. package/dist/util/InvisibleMessage.js +56 -0
  360. package/dist/util/InvisibleMessage.js.map +1 -0
  361. package/dist/util/PopupUtils.d.ts +7 -0
  362. package/dist/util/PopupUtils.js +74 -0
  363. package/dist/util/PopupUtils.js.map +1 -0
  364. package/dist/util/SlotsHelper.d.ts +9 -0
  365. package/dist/util/SlotsHelper.js +30 -0
  366. package/dist/util/SlotsHelper.js.map +1 -0
  367. package/dist/util/StringHelper.d.ts +3 -0
  368. package/dist/util/StringHelper.js +17 -20
  369. package/dist/util/StringHelper.js.map +1 -0
  370. package/dist/util/TabbableElements.d.ts +17 -0
  371. package/dist/util/TabbableElements.js +53 -43
  372. package/dist/util/TabbableElements.js.map +1 -0
  373. package/dist/util/arraysAreEqual.d.ts +2 -0
  374. package/dist/util/arraysAreEqual.js +13 -0
  375. package/dist/util/arraysAreEqual.js.map +1 -0
  376. package/dist/util/clamp.d.ts +9 -0
  377. package/dist/util/clamp.js +12 -0
  378. package/dist/util/clamp.js.map +1 -0
  379. package/dist/util/createLinkInHead.d.ts +7 -0
  380. package/dist/util/createLinkInHead.js +21 -0
  381. package/dist/util/createLinkInHead.js.map +1 -0
  382. package/dist/util/createStyleInHead.d.ts +8 -0
  383. package/dist/util/createStyleInHead.js +10 -10
  384. package/dist/util/createStyleInHead.js.map +1 -0
  385. package/dist/util/debounce.d.ts +2 -0
  386. package/dist/util/debounce.js +15 -0
  387. package/dist/util/debounce.js.map +1 -0
  388. package/dist/util/detectNavigatorLanguage.d.ts +2 -0
  389. package/dist/util/detectNavigatorLanguage.js +7 -10
  390. package/dist/util/detectNavigatorLanguage.js.map +1 -0
  391. package/dist/util/escapeRegex.d.ts +8 -0
  392. package/dist/util/escapeRegex.js +11 -0
  393. package/dist/util/escapeRegex.js.map +1 -0
  394. package/dist/util/formatMessage.d.ts +2 -0
  395. package/dist/util/formatMessage.js +15 -19
  396. package/dist/util/formatMessage.js.map +1 -0
  397. package/dist/util/generateHighlightedMarkup.d.ts +9 -0
  398. package/dist/util/generateHighlightedMarkup.js +41 -0
  399. package/dist/util/generateHighlightedMarkup.js.map +1 -0
  400. package/dist/util/getActiveElement.d.ts +2 -0
  401. package/dist/util/getActiveElement.js +9 -0
  402. package/dist/util/getActiveElement.js.map +1 -0
  403. package/dist/util/getClassCopy.d.ts +400 -0
  404. package/dist/util/getClassCopy.js +10 -0
  405. package/dist/util/getClassCopy.js.map +1 -0
  406. package/dist/util/getDesigntimePropertyAsArray.d.ts +2 -0
  407. package/dist/util/getDesigntimePropertyAsArray.js +4 -3
  408. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -0
  409. package/dist/util/getEffectiveContentDensity.d.ts +2 -0
  410. package/dist/util/getEffectiveContentDensity.js +4 -0
  411. package/dist/util/getEffectiveContentDensity.js.map +1 -0
  412. package/dist/util/getEffectiveScrollbarStyle.d.ts +2 -0
  413. package/dist/util/getEffectiveScrollbarStyle.js +4 -0
  414. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -0
  415. package/dist/util/getFastNavigationGroups.d.ts +2 -0
  416. package/dist/util/getFastNavigationGroups.js +51 -0
  417. package/dist/util/getFastNavigationGroups.js.map +1 -0
  418. package/{src/util/getFileExtension.js → dist/util/getFileExtension.d.ts} +3 -12
  419. package/dist/util/getFileExtension.js +9 -11
  420. package/dist/util/getFileExtension.js.map +1 -0
  421. package/dist/util/getNormalizedTarget.d.ts +7 -0
  422. package/dist/util/getNormalizedTarget.js +14 -0
  423. package/dist/util/getNormalizedTarget.js.map +1 -0
  424. package/dist/util/getSingletonElementInstance.d.ts +11 -0
  425. package/dist/util/getSingletonElementInstance.js +17 -11
  426. package/dist/util/getSingletonElementInstance.js.map +1 -0
  427. package/dist/util/isElementClickable.d.ts +2 -0
  428. package/dist/util/isElementClickable.js +16 -0
  429. package/dist/util/isElementClickable.js.map +1 -0
  430. package/dist/util/isElementHidden.d.ts +2 -0
  431. package/dist/util/isElementHidden.js +8 -0
  432. package/dist/util/isElementHidden.js.map +1 -0
  433. package/dist/util/isElementInView.d.ts +6 -0
  434. package/dist/util/isElementInView.js +12 -0
  435. package/dist/util/isElementInView.js.map +1 -0
  436. package/dist/util/isElementTabbable.d.ts +9 -0
  437. package/dist/util/isElementTabbable.js +30 -0
  438. package/dist/util/isElementTabbable.js.map +1 -0
  439. package/dist/util/isValidPropertyName.d.ts +8 -0
  440. package/dist/util/isValidPropertyName.js +18 -18
  441. package/dist/util/isValidPropertyName.js.map +1 -0
  442. package/dist/util/whenDOMReady.d.ts +2 -0
  443. package/dist/util/whenDOMReady.js +11 -10
  444. package/dist/util/whenDOMReady.js.map +1 -0
  445. package/dist/util/willShowContent.d.ts +2 -0
  446. package/dist/util/willShowContent.js +7 -0
  447. package/dist/util/willShowContent.js.map +1 -0
  448. package/dist/validateThemeRoot.d.ts +2 -0
  449. package/dist/validateThemeRoot.js +48 -0
  450. package/dist/validateThemeRoot.js.map +1 -0
  451. package/index.js +228 -2
  452. package/lib/generate-asset-parameters/index.js +11 -6
  453. package/lib/generate-styles/index.js +31 -0
  454. package/lib/generate-version-info/index.js +32 -0
  455. package/package-scripts.cjs +71 -0
  456. package/package.json +21 -13
  457. package/src/css/BusyIndicator.css +80 -0
  458. package/src/css/FontFace.css +66 -0
  459. package/src/css/OverrideFontFace.css +32 -0
  460. package/src/css/SystemCSSVars.css +17 -0
  461. package/src/renderer/directives/style-map.js +72 -0
  462. package/tsconfig.json +14 -0
  463. package/used-modules.txt +10 -0
  464. package/bundle.es5.js +0 -28
  465. package/config/rollup.config.js +0 -1
  466. package/config/wdio.conf.js +0 -1
  467. package/dist/RenderScheduler.js +0 -178
  468. package/dist/SVGIconRegistry.js +0 -62
  469. package/dist/animations/config.js +0 -5
  470. package/dist/boot.js +0 -34
  471. package/dist/compatibility/DOMObserver.js +0 -62
  472. package/dist/compatibility/patchNodeValue.js +0 -24
  473. package/dist/compatibility/whenPolyfillLoaded.js +0 -26
  474. package/dist/delegate/CustomResize.js +0 -78
  475. package/dist/delegate/NativeResize.js +0 -44
  476. package/dist/features/PropertiesFormatSupport.js +0 -8
  477. package/dist/features/browsersupport/Edge.js +0 -6
  478. package/dist/features/browsersupport/IE11.js +0 -41
  479. package/dist/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
  480. package/dist/renderer/ifDefined.js +0 -21
  481. package/dist/resources/bundle.es5.js +0 -212
  482. package/dist/resources/bundle.es5.js.map +0 -1
  483. package/dist/resources/bundle.esm.js +0 -129
  484. package/dist/resources/bundle.esm.js.map +0 -1
  485. package/dist/test-resources/assets/Themes.js +0 -13
  486. package/dist/test-resources/elements/Child.js +0 -35
  487. package/dist/test-resources/elements/Generic.js +0 -84
  488. package/dist/test-resources/elements/GenericExt.js +0 -26
  489. package/dist/test-resources/elements/NoShadowDOM.js +0 -13
  490. package/dist/test-resources/elements/Parent.js +0 -37
  491. package/dist/test-resources/elements/WithStaticArea.js +0 -76
  492. package/dist/test-resources/pages/AllTestElements.html +0 -42
  493. package/dist/test-resources/pages/Configuration.html +0 -20
  494. package/dist/test-resources/pages/ConfigurationScript.html +0 -36
  495. package/dist/test-resources/pages/assets/messagebundle_de.properties +0 -1
  496. package/dist/test-resources/pages/assets/messagebundle_en.properties +0 -1
  497. package/dist/test-resources/pages/assets/messagebundle_es.properties +0 -1
  498. package/dist/test-resources/pages/assets/messagebundle_fr.properties +0 -1
  499. package/dist/test-resources/pages/i18n.html +0 -40
  500. package/dist/test-resources/specs/ConfigurationChange.spec.js +0 -25
  501. package/dist/test-resources/specs/ConfigurationScript.spec.js +0 -61
  502. package/dist/test-resources/specs/ConfigurationURL.spec.js +0 -45
  503. package/dist/test-resources/specs/CustomTheme.spec.js +0 -25
  504. package/dist/test-resources/specs/StaticArea.spec.js +0 -34
  505. package/dist/test-resources/specs/Theming.spec.js +0 -31
  506. package/dist/test-resources/specs/UI5ElementInvalidation.js +0 -258
  507. package/dist/test-resources/specs/UI5ElementLifecycle.js +0 -93
  508. package/dist/test-resources/specs/UI5ElementListenForChildPropChanges.spec.js +0 -101
  509. package/dist/test-resources/specs/UI5ElementMetadataExt.js +0 -40
  510. package/dist/test-resources/specs/UI5ElementPropertyValidation.js +0 -12
  511. package/dist/test-resources/specs/UI5ElementPropsAndAttrs.spec.js +0 -65
  512. package/dist/test-resources/specs/UI5ElementShadowDOM.js +0 -22
  513. package/dist/test-resources/specs/UI5ElementSlots.js +0 -34
  514. package/dist/theming/CSSVarsPonyfill.js +0 -24
  515. package/dist/theming/adaptCSSForIE.js +0 -90
  516. package/dist/theming/createComponentStyleTag.js +0 -49
  517. package/dist/theming/createThemePropertiesStyleTag.js +0 -20
  518. package/dist/thirdparty/Array.from.js +0 -16
  519. package/dist/thirdparty/Array.prototype.fill.js +0 -44
  520. package/dist/thirdparty/Array.prototype.find.js +0 -46
  521. package/dist/thirdparty/Array.prototype.includes.js +0 -51
  522. package/dist/thirdparty/Element.prototype.closest.js +0 -11
  523. package/dist/thirdparty/Element.prototype.matches.js +0 -6
  524. package/dist/thirdparty/Map.prototype.keys.js +0 -9
  525. package/dist/thirdparty/Number.isInteger.js +0 -5
  526. package/dist/thirdparty/Number.isNaN.js +0 -1
  527. package/dist/thirdparty/Number.parseInt.js +0 -1
  528. package/dist/thirdparty/Object.assign.js +0 -31
  529. package/dist/thirdparty/Object.entries.js +0 -11
  530. package/dist/thirdparty/Symbol.js +0 -2
  531. package/dist/thirdparty/WeakSet.js +0 -27
  532. package/dist/thirdparty/es6-string-methods.js +0 -182
  533. package/dist/thirdparty/events-polyfills.js +0 -89
  534. package/dist/thirdparty/fetch.js +0 -1
  535. package/dist/thirdparty/template.js +0 -600
  536. package/dist/thirdparty/webcomponents-sd-ce-pf.js +0 -318
  537. package/dist/types/CSSSize.js +0 -9
  538. package/dist/types/PopupState.js +0 -37
  539. package/dist/util/findNodeOwner.js +0 -35
  540. package/dist/util/getEffectiveAriaLabelText.js +0 -28
  541. package/dist/util/isDescendantOf.js +0 -15
  542. package/dist/util/isNodeClickable.js +0 -19
  543. package/dist/util/isNodeHidden.js +0 -9
  544. package/dist/util/isNodeTabbable.js +0 -28
  545. package/dist/util/isSlot.js +0 -3
  546. package/dist/util/parseProperties.js +0 -89
  547. package/dist/util/setToArray.js +0 -10
  548. package/dist/webcomponentsjs/LICENSE.md +0 -19
  549. package/dist/webcomponentsjs/README.md +0 -229
  550. package/dist/webcomponentsjs/bundles/webcomponents-ce.js +0 -63
  551. package/dist/webcomponentsjs/bundles/webcomponents-ce.js.map +0 -1
  552. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js +0 -297
  553. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map +0 -1
  554. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js +0 -208
  555. package/dist/webcomponentsjs/bundles/webcomponents-sd-ce.js.map +0 -1
  556. package/dist/webcomponentsjs/bundles/webcomponents-sd.js +0 -166
  557. package/dist/webcomponentsjs/bundles/webcomponents-sd.js.map +0 -1
  558. package/dist/webcomponentsjs/custom-elements-es5-adapter.js +0 -15
  559. package/dist/webcomponentsjs/package.json +0 -46
  560. package/dist/webcomponentsjs/src/entrypoints/custom-elements-es5-adapter-index.js +0 -16
  561. package/dist/webcomponentsjs/src/entrypoints/webcomponents-bundle-index.js +0 -53
  562. package/dist/webcomponentsjs/src/entrypoints/webcomponents-ce-index.js +0 -17
  563. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-index.js +0 -19
  564. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-ce-pf-index.js +0 -28
  565. package/dist/webcomponentsjs/src/entrypoints/webcomponents-sd-index.js +0 -18
  566. package/dist/webcomponentsjs/webcomponents-bundle.js +0 -298
  567. package/dist/webcomponentsjs/webcomponents-bundle.js.map +0 -1
  568. package/dist/webcomponentsjs/webcomponents-loader.js +0 -185
  569. package/package-scripts.js +0 -47
  570. package/src/AssetRegistry.js +0 -10
  571. package/src/CustomElementsRegistry.js +0 -39
  572. package/src/Device.js +0 -823
  573. package/src/EventProvider.js +0 -81
  574. package/src/FeaturesRegistry.js +0 -11
  575. package/src/FontFace.js +0 -73
  576. package/src/InitialConfiguration.js +0 -131
  577. package/src/Keys.js +0 -170
  578. package/src/RenderQueue.js +0 -42
  579. package/src/RenderScheduler.js +0 -178
  580. package/src/SVGIconRegistry.js +0 -62
  581. package/src/StaticArea.js +0 -31
  582. package/src/StaticAreaItem.js +0 -105
  583. package/src/SystemCSSVars.js +0 -31
  584. package/src/Theming.js +0 -3
  585. package/src/UI5Element.js +0 -1001
  586. package/src/UI5ElementMetadata.js +0 -187
  587. package/src/animations/AnimationQueue.js +0 -42
  588. package/src/animations/animate.js +0 -53
  589. package/src/animations/config.js +0 -5
  590. package/src/animations/scroll.js +0 -28
  591. package/src/animations/slideDown.js +0 -79
  592. package/src/animations/slideUp.js +0 -71
  593. package/src/asset-registries/Icons.js +0 -31
  594. package/src/asset-registries/LocaleData.js +0 -125
  595. package/src/asset-registries/Themes.js +0 -87
  596. package/src/asset-registries/i18n.js +0 -106
  597. package/src/boot.js +0 -34
  598. package/src/compatibility/DOMObserver.js +0 -62
  599. package/src/compatibility/patchNodeValue.js +0 -24
  600. package/src/compatibility/whenPolyfillLoaded.js +0 -26
  601. package/src/config/AnimationMode.js +0 -13
  602. package/src/config/CalendarType.js +0 -18
  603. package/src/config/FormatSettings.js +0 -13
  604. package/src/config/Language.js +0 -41
  605. package/src/config/NoConflict.js +0 -51
  606. package/src/config/RTL.js +0 -31
  607. package/src/config/Theme.js +0 -28
  608. package/src/delegate/CustomResize.js +0 -78
  609. package/src/delegate/ItemNavigation.js +0 -282
  610. package/src/delegate/NativeResize.js +0 -44
  611. package/src/delegate/ResizeHandler.js +0 -65
  612. package/src/delegate/ScrollEnablement.js +0 -159
  613. package/src/features/OpenUI5Support.js +0 -90
  614. package/src/features/PropertiesFormatSupport.js +0 -8
  615. package/src/features/browsersupport/Edge.js +0 -6
  616. package/src/features/browsersupport/IE11.js +0 -41
  617. package/src/features/browsersupport/IE11WithWebComponentsPolyfill.js +0 -5
  618. package/src/getSharedResource.js +0 -30
  619. package/src/i18nBundle.js +0 -52
  620. package/src/locale/Locale.js +0 -91
  621. package/src/locale/RTLAwareRegistry.js +0 -14
  622. package/src/locale/applyDirection.js +0 -15
  623. package/src/locale/getLocale.js +0 -31
  624. package/src/locale/languageChange.js +0 -22
  625. package/src/locale/nextFallbackLocale.js +0 -28
  626. package/src/locale/normalizeLocale.js +0 -54
  627. package/src/renderer/LitRenderer.js +0 -16
  628. package/src/renderer/ifDefined.js +0 -21
  629. package/src/theming/CSSVarsPonyfill.js +0 -24
  630. package/src/theming/CustomStyle.js +0 -19
  631. package/src/theming/adaptCSSForIE.js +0 -90
  632. package/src/theming/applyTheme.js +0 -81
  633. package/src/theming/createComponentStyleTag.js +0 -49
  634. package/src/theming/createThemePropertiesStyleTag.js +0 -20
  635. package/src/theming/getConstructableStyle.js +0 -25
  636. package/src/theming/getEffectiveStyle.js +0 -15
  637. package/src/theming/getThemeDesignerTheme.js +0 -67
  638. package/src/thirdparty/Array.from.js +0 -16
  639. package/src/thirdparty/Array.prototype.fill.js +0 -44
  640. package/src/thirdparty/Array.prototype.find.js +0 -46
  641. package/src/thirdparty/Array.prototype.includes.js +0 -51
  642. package/src/thirdparty/Element.prototype.closest.js +0 -11
  643. package/src/thirdparty/Element.prototype.matches.js +0 -6
  644. package/src/thirdparty/Map.prototype.keys.js +0 -9
  645. package/src/thirdparty/Number.isInteger.js +0 -5
  646. package/src/thirdparty/Number.isNaN.js +0 -1
  647. package/src/thirdparty/Number.parseInt.js +0 -1
  648. package/src/thirdparty/Object.assign.js +0 -31
  649. package/src/thirdparty/Object.entries.js +0 -11
  650. package/src/thirdparty/Symbol.js +0 -2
  651. package/src/thirdparty/WeakSet.js +0 -27
  652. package/src/thirdparty/_merge.js +0 -32
  653. package/src/thirdparty/es6-string-methods.js +0 -182
  654. package/src/thirdparty/events-polyfills.js +0 -89
  655. package/src/thirdparty/fetch.js +0 -1
  656. package/src/thirdparty/isPlainObject.js +0 -18
  657. package/src/thirdparty/merge.js +0 -10
  658. package/src/thirdparty/template.js +0 -600
  659. package/src/thirdparty/webcomponents-sd-ce-pf.js +0 -318
  660. package/src/types/AnimationMode.js +0 -7
  661. package/src/types/CSSSize.js +0 -9
  662. package/src/types/CalendarType.js +0 -22
  663. package/src/types/DataType.js +0 -25
  664. package/src/types/Float.js +0 -10
  665. package/src/types/Integer.js +0 -9
  666. package/src/types/ItemNavigationBehavior.js +0 -21
  667. package/src/types/NavigationMode.js +0 -7
  668. package/src/types/PopupState.js +0 -37
  669. package/src/types/ValueState.js +0 -22
  670. package/src/util/FetchHelper.js +0 -31
  671. package/src/util/FocusableElements.js +0 -66
  672. package/src/util/StringHelper.js +0 -26
  673. package/src/util/TabbableElements.js +0 -47
  674. package/src/util/createStyleInHead.js +0 -18
  675. package/src/util/detectNavigatorLanguage.js +0 -13
  676. package/src/util/findNodeOwner.js +0 -35
  677. package/src/util/formatMessage.js +0 -23
  678. package/src/util/getDesigntimePropertyAsArray.js +0 -4
  679. package/src/util/getEffectiveAriaLabelText.js +0 -28
  680. package/src/util/getSingletonElementInstance.js +0 -13
  681. package/src/util/isDescendantOf.js +0 -15
  682. package/src/util/isNodeClickable.js +0 -19
  683. package/src/util/isNodeHidden.js +0 -9
  684. package/src/util/isNodeTabbable.js +0 -28
  685. package/src/util/isSlot.js +0 -3
  686. package/src/util/isValidPropertyName.js +0 -28
  687. package/src/util/parseProperties.js +0 -89
  688. package/src/util/setToArray.js +0 -10
  689. package/src/util/whenDOMReady.js +0 -13
  690. /package/{config/.eslintrc.js → .eslintrc.cjs} +0 -0
package/src/UI5Element.js DELETED
@@ -1,1001 +0,0 @@
1
- import merge from "./thirdparty/merge.js";
2
- import boot from "./boot.js";
3
- import UI5ElementMetadata from "./UI5ElementMetadata.js";
4
- import StaticAreaItem from "./StaticAreaItem.js";
5
- import RenderScheduler from "./RenderScheduler.js";
6
- import { registerTag, isTagRegistered, recordTagRegistrationFailure } from "./CustomElementsRegistry.js";
7
- import DOMObserver from "./compatibility/DOMObserver.js";
8
- import { skipOriginalEvent } from "./config/NoConflict.js";
9
- import { getRTL } from "./config/RTL.js";
10
- import getConstructableStyle from "./theming/getConstructableStyle.js";
11
- import createComponentStyleTag from "./theming/createComponentStyleTag.js";
12
- import getEffectiveStyle from "./theming/getEffectiveStyle.js";
13
- import Integer from "./types/Integer.js";
14
- import Float from "./types/Float.js";
15
- import { kebabToCamelCase, camelToKebabCase } from "./util/StringHelper.js";
16
- import isValidPropertyName from "./util/isValidPropertyName.js";
17
- import isSlot from "./util/isSlot.js";
18
- import { markAsRtlAware } from "./locale/RTLAwareRegistry.js";
19
-
20
- const metadata = {
21
- events: {
22
- "_property-change": {},
23
- },
24
- };
25
-
26
- let autoId = 0;
27
-
28
- const elementTimeouts = new Map();
29
-
30
- const GLOBAL_CONTENT_DENSITY_CSS_VAR = "--_ui5_content_density";
31
- const GLOBAL_DIR_CSS_VAR = "--_ui5_dir";
32
-
33
- /**
34
- * Base class for all UI5 Web Components
35
- *
36
- * @class
37
- * @constructor
38
- * @author SAP SE
39
- * @alias sap.ui.webcomponents.base.UI5Element
40
- * @extends HTMLElement
41
- * @public
42
- */
43
- class UI5Element extends HTMLElement {
44
- constructor() {
45
- super();
46
- this._initializeState();
47
- this._upgradeAllProperties();
48
- this._initializeContainers();
49
- this._upToDate = false;
50
-
51
- let deferredResolve;
52
- this._domRefReadyPromise = new Promise(resolve => {
53
- deferredResolve = resolve;
54
- });
55
- this._domRefReadyPromise._deferredResolve = deferredResolve;
56
-
57
- this._monitoredChildProps = new Map();
58
- this._firePropertyChange = false;
59
- }
60
-
61
- /**
62
- * Returns a unique ID for this UI5 Element
63
- *
64
- * @deprecated - This property is not guaranteed in future releases
65
- * @protected
66
- */
67
- get _id() {
68
- if (!this.__id) {
69
- this.__id = `ui5wc_${++autoId}`;
70
- }
71
-
72
- return this.__id;
73
- }
74
-
75
- /**
76
- * @private
77
- */
78
- _initializeContainers() {
79
- const needsShadowDOM = this.constructor._needsShadowDOM();
80
- const needsStaticArea = this.constructor._needsStaticArea();
81
-
82
- // Init Shadow Root
83
- if (needsShadowDOM) {
84
- this.attachShadow({ mode: "open" });
85
-
86
- // IE11, Edge
87
- if (window.ShadyDOM) {
88
- createComponentStyleTag(this.constructor);
89
- }
90
-
91
- // Chrome
92
- if (document.adoptedStyleSheets) {
93
- const style = getConstructableStyle(this.constructor);
94
- this.shadowRoot.adoptedStyleSheets = [style];
95
- }
96
- }
97
-
98
- // Init StaticAreaItem only if needed
99
- if (needsStaticArea) {
100
- this.staticAreaItem = new StaticAreaItem(this);
101
- }
102
- }
103
-
104
- /**
105
- * Do not call this method from derivatives of UI5Element, use "onEnterDOM" only
106
- * @private
107
- */
108
- async connectedCallback() {
109
- const needsShadowDOM = this.constructor._needsShadowDOM();
110
- const slotsAreManaged = this.constructor.getMetadata().slotsAreManaged();
111
-
112
- // Render the Shadow DOM
113
- if (needsShadowDOM) {
114
- if (slotsAreManaged) {
115
- // always register the observer before yielding control to the main thread (await)
116
- this._startObservingDOMChildren();
117
- await this._processChildren();
118
- }
119
-
120
- if (!this.shadowRoot) { // Workaround for Firefox74 bug
121
- await Promise.resolve();
122
- }
123
-
124
- RenderScheduler.register(this);
125
- await RenderScheduler.renderImmediately(this);
126
- this._domRefReadyPromise._deferredResolve();
127
- if (typeof this.onEnterDOM === "function") {
128
- this.onEnterDOM();
129
- }
130
- }
131
- }
132
-
133
- /**
134
- * Do not call this method from derivatives of UI5Element, use "onExitDOM" only
135
- * @private
136
- */
137
- disconnectedCallback() {
138
- const needsShadowDOM = this.constructor._needsShadowDOM();
139
- const needsStaticArea = this.constructor._needsStaticArea();
140
- const slotsAreManaged = this.constructor.getMetadata().slotsAreManaged();
141
-
142
- if (needsShadowDOM) {
143
- if (slotsAreManaged) {
144
- this._stopObservingDOMChildren();
145
- }
146
-
147
- RenderScheduler.deregister(this);
148
- if (typeof this.onExitDOM === "function") {
149
- this.onExitDOM();
150
- }
151
- }
152
-
153
- if (needsStaticArea) {
154
- this.staticAreaItem._removeFragmentFromStaticArea();
155
- }
156
- }
157
-
158
- /**
159
- * @private
160
- */
161
- _startObservingDOMChildren() {
162
- const shouldObserveChildren = this.constructor.getMetadata().hasSlots();
163
- if (!shouldObserveChildren) {
164
- return;
165
- }
166
-
167
- const canSlotText = this.constructor.getMetadata().canSlotText();
168
- const mutationObserverOptions = {
169
- childList: true,
170
- subtree: canSlotText,
171
- characterData: true,
172
- };
173
- DOMObserver.observeDOMNode(this, this._processChildren.bind(this), mutationObserverOptions);
174
- }
175
-
176
- /**
177
- * @private
178
- */
179
- _stopObservingDOMChildren() {
180
- DOMObserver.unobserveDOMNode(this);
181
- }
182
-
183
- /**
184
- * Note: this method is also manually called by "compatibility/patchNodeValue.js"
185
- * @private
186
- */
187
- async _processChildren() {
188
- const hasSlots = this.constructor.getMetadata().hasSlots();
189
- if (hasSlots) {
190
- await this._updateSlots();
191
- }
192
- }
193
-
194
- /**
195
- * @private
196
- */
197
- async _updateSlots() {
198
- const slotsMap = this.constructor.getMetadata().getSlots();
199
- const canSlotText = this.constructor.getMetadata().canSlotText();
200
- const domChildren = Array.from(canSlotText ? this.childNodes : this.children);
201
-
202
- // Init the _state object based on the supported slots
203
- for (const [slotName, slotData] of Object.entries(slotsMap)) { // eslint-disable-line
204
- this._clearSlot(slotName, slotData);
205
- }
206
-
207
- const autoIncrementMap = new Map();
208
- const slottedChildrenMap = new Map();
209
-
210
- const allChildrenUpgraded = domChildren.map(async (child, idx) => {
211
- // Determine the type of the child (mainly by the slot attribute)
212
- const slotName = this.constructor._getSlotName(child);
213
- const slotData = slotsMap[slotName];
214
-
215
- // Check if the slotName is supported
216
- if (slotData === undefined) {
217
- const validValues = Object.keys(slotsMap).join(", ");
218
- console.warn(`Unknown slotName: ${slotName}, ignoring`, child, `Valid values are: ${validValues}`); // eslint-disable-line
219
- return;
220
- }
221
-
222
- // For children that need individual slots, calculate them
223
- if (slotData.individualSlots) {
224
- const nextIndex = (autoIncrementMap.get(slotName) || 0) + 1;
225
- autoIncrementMap.set(slotName, nextIndex);
226
- child._individualSlot = `${slotName}-${nextIndex}`;
227
- }
228
-
229
- // Await for not-yet-defined custom elements
230
- if (child instanceof HTMLElement) {
231
- const localName = child.localName;
232
- const isCustomElement = localName.includes("-");
233
- if (isCustomElement) {
234
- const isDefined = window.customElements.get(localName);
235
- if (!isDefined) {
236
- const whenDefinedPromise = window.customElements.whenDefined(localName); // Class registered, but instances not upgraded yet
237
- let timeoutPromise = elementTimeouts.get(localName);
238
- if (!timeoutPromise) {
239
- timeoutPromise = new Promise(resolve => setTimeout(resolve, 1000));
240
- elementTimeouts.set(localName, timeoutPromise);
241
- }
242
- await Promise.race([whenDefinedPromise, timeoutPromise]);
243
- }
244
- window.customElements.upgrade(child);
245
- }
246
- }
247
-
248
- child = this.constructor.getMetadata().constructor.validateSlotValue(child, slotData);
249
-
250
- if (child.isUI5Element && slotData.listenFor) {
251
- this._attachChildPropertyUpdated(child, slotData.listenFor);
252
- }
253
-
254
- if (isSlot(child)) {
255
- this._attachSlotChange(child);
256
- }
257
-
258
- const propertyName = slotData.propertyName || slotName;
259
-
260
- if (slottedChildrenMap.has(propertyName)) {
261
- slottedChildrenMap.get(propertyName).push({ child, idx });
262
- } else {
263
- slottedChildrenMap.set(propertyName, [{ child, idx }]);
264
- }
265
- });
266
-
267
- await Promise.all(allChildrenUpgraded);
268
-
269
- // Distribute the child in the _state object, keeping the Light DOM order,
270
- // not the order elements are defined.
271
- slottedChildrenMap.forEach((children, slot) => {
272
- this._state[slot] = children.sort((a, b) => a.idx - b.idx).map(_ => _.child);
273
- });
274
- this._invalidate("slots");
275
- }
276
-
277
- /**
278
- * Removes all children from the slot and detaches listeners, if any
279
- * @private
280
- */
281
- _clearSlot(slotName, slotData) {
282
- const propertyName = slotData.propertyName || slotName;
283
-
284
- let children = this._state[propertyName];
285
- if (!Array.isArray(children)) {
286
- children = [children];
287
- }
288
-
289
- children.forEach(child => {
290
- if (child && child.isUI5Element) {
291
- this._detachChildPropertyUpdated(child);
292
- }
293
-
294
- if (isSlot(child)) {
295
- this._detachSlotChange(child);
296
- }
297
- });
298
-
299
- this._state[propertyName] = [];
300
- this._invalidate(propertyName, []);
301
- }
302
-
303
- /**
304
- * Do not override this method in derivatives of UI5Element
305
- * @private
306
- */
307
- attributeChangedCallback(name, oldValue, newValue) {
308
- const properties = this.constructor.getMetadata().getProperties();
309
- const realName = name.replace(/^ui5-/, "");
310
- const nameInCamelCase = kebabToCamelCase(realName);
311
- if (properties.hasOwnProperty(nameInCamelCase)) { // eslint-disable-line
312
- const propertyTypeClass = properties[nameInCamelCase].type;
313
- if (propertyTypeClass === Boolean) {
314
- newValue = newValue !== null;
315
- }
316
- if (propertyTypeClass === Integer) {
317
- newValue = parseInt(newValue);
318
- }
319
- if (propertyTypeClass === Float) {
320
- newValue = parseFloat(newValue);
321
- }
322
- this[nameInCamelCase] = newValue;
323
- }
324
- }
325
-
326
- /**
327
- * @private
328
- */
329
- _updateAttribute(name, newValue) {
330
- if (!this.constructor.getMetadata().hasAttribute(name)) {
331
- return;
332
- }
333
-
334
- if (typeof newValue === "object") {
335
- return;
336
- }
337
-
338
- const attrName = camelToKebabCase(name);
339
- const attrValue = this.getAttribute(attrName);
340
- if (typeof newValue === "boolean") {
341
- if (newValue === true && attrValue === null) {
342
- this.setAttribute(attrName, "");
343
- } else if (newValue === false && attrValue !== null) {
344
- this.removeAttribute(attrName);
345
- }
346
- } else if (attrValue !== newValue) {
347
- this.setAttribute(attrName, newValue);
348
- }
349
- }
350
-
351
- /**
352
- * @private
353
- */
354
- _upgradeProperty(prop) {
355
- if (this.hasOwnProperty(prop)) { // eslint-disable-line
356
- const value = this[prop];
357
- delete this[prop];
358
- this[prop] = value;
359
- }
360
- }
361
-
362
- /**
363
- * @private
364
- */
365
- _upgradeAllProperties() {
366
- const allProps = this.constructor.getMetadata().getPropertiesList();
367
- allProps.forEach(this._upgradeProperty, this);
368
- }
369
-
370
- /**
371
- * @private
372
- */
373
- _initializeState() {
374
- const defaultState = this.constructor._getDefaultState();
375
- this._state = Object.assign({}, defaultState);
376
- }
377
-
378
- /**
379
- * @private
380
- */
381
- _attachChildPropertyUpdated(child, listenFor) {
382
- const childMetadata = child.constructor.getMetadata(),
383
- slotName = this.constructor._getSlotName(child), // all slotted children have the same configuration
384
- childProperties = childMetadata.getProperties();
385
-
386
- let observedProps = [],
387
- notObservedProps = [];
388
-
389
- if (Array.isArray(listenFor)) {
390
- observedProps = listenFor;
391
- } else {
392
- observedProps = Array.isArray(listenFor.props) ? listenFor.props : Object.keys(childProperties);
393
- notObservedProps = Array.isArray(listenFor.exclude) ? listenFor.exclude : [];
394
- }
395
-
396
- if (!this._monitoredChildProps.has(slotName)) {
397
- this._monitoredChildProps.set(slotName, { observedProps, notObservedProps });
398
- }
399
-
400
- child.addEventListener("_property-change", this._invalidateParentOnPropertyUpdate);
401
- child._firePropertyChange = true;
402
- }
403
-
404
- /**
405
- * @private
406
- */
407
- _detachChildPropertyUpdated(child) {
408
- child.removeEventListener("_property-change", this._invalidateParentOnPropertyUpdate);
409
- child._firePropertyChange = false;
410
- }
411
-
412
- /**
413
- * @private
414
- */
415
- _propertyChange(name, value) {
416
- this._updateAttribute(name, value);
417
-
418
- if (this._firePropertyChange) {
419
- this.dispatchEvent(new CustomEvent("_property-change", {
420
- detail: { name, newValue: value },
421
- composed: false,
422
- bubbles: true,
423
- }));
424
- }
425
- }
426
-
427
- /**
428
- * @private
429
- */
430
- _invalidateParentOnPropertyUpdate(prop) {
431
- // The web component to be invalidated
432
- const parentNode = this.parentNode;
433
- if (!parentNode) {
434
- return;
435
- }
436
-
437
- const slotName = parentNode.constructor._getSlotName(this);
438
- const propsMetadata = parentNode._monitoredChildProps.get(slotName);
439
-
440
- if (!propsMetadata) {
441
- return;
442
- }
443
- const { observedProps, notObservedProps } = propsMetadata;
444
-
445
- if (observedProps.includes(prop.detail.name) && !notObservedProps.includes(prop.detail.name)) {
446
- parentNode._invalidate("_parent_", this);
447
- }
448
- }
449
-
450
- /**
451
- * @private
452
- */
453
- _attachSlotChange(child) {
454
- if (!this._invalidateOnSlotChange) {
455
- this._invalidateOnSlotChange = () => {
456
- this._invalidate("slotchange");
457
- };
458
- }
459
- child.addEventListener("slotchange", this._invalidateOnSlotChange);
460
- }
461
-
462
- /**
463
- * @private
464
- */
465
- _detachSlotChange(child) {
466
- child.removeEventListener("slotchange", this._invalidateOnSlotChange);
467
- }
468
-
469
- /**
470
- * Asynchronously re-renders an already rendered web component
471
- * @private
472
- */
473
- _invalidate() {
474
- if (!this._upToDate) {
475
- // console.log("already invalidated", this, ...arguments);
476
- return;
477
- }
478
-
479
- if (this.getDomRef() && !this._suppressInvalidation) {
480
- this._upToDate = false;
481
- // console.log("INVAL", this, ...arguments);
482
- RenderScheduler.renderDeferred(this);
483
- }
484
- }
485
-
486
- /**
487
- * Do not call this method directly, only intended to be called by RenderScheduler.js
488
- * @protected
489
- */
490
- _render() {
491
- const hasIndividualSlots = this.constructor.getMetadata().hasIndividualSlots();
492
-
493
- // suppress invalidation to prevent state changes scheduling another rendering
494
- this._suppressInvalidation = true;
495
-
496
- if (typeof this.onBeforeRendering === "function") {
497
- this.onBeforeRendering();
498
- }
499
-
500
- // Intended for framework usage only. Currently ItemNavigation updates tab indexes after the component has updated its state but before the template is rendered
501
- if (this._onComponentStateFinalized) {
502
- this._onComponentStateFinalized();
503
- }
504
-
505
- // resume normal invalidation handling
506
- delete this._suppressInvalidation;
507
-
508
- // Update the shadow root with the render result
509
- // console.log(this.getDomRef() ? "RE-RENDER" : "FIRST RENDER", this);
510
- this._upToDate = true;
511
- this._updateShadowRoot();
512
-
513
- if (this._shouldUpdateFragment()) {
514
- this.staticAreaItem._updateFragment(this);
515
- }
516
-
517
- // Safari requires that children get the slot attribute only after the slot tags have been rendered in the shadow DOM
518
- if (hasIndividualSlots) {
519
- this._assignIndividualSlotsToChildren();
520
- }
521
-
522
- // Call the onAfterRendering hook
523
- if (typeof this.onAfterRendering === "function") {
524
- this.onAfterRendering();
525
- }
526
- }
527
-
528
- /**
529
- * @private
530
- */
531
- _updateShadowRoot() {
532
- if (!this.constructor._needsShadowDOM()) {
533
- return;
534
- }
535
-
536
- let styleToPrepend;
537
- const renderResult = this.constructor.template(this);
538
-
539
- if (!document.adoptedStyleSheets && !window.ShadyDOM) {
540
- styleToPrepend = getEffectiveStyle(this.constructor);
541
- }
542
- this.constructor.render(renderResult, this.shadowRoot, styleToPrepend, { eventContext: this });
543
- }
544
-
545
- /**
546
- * @private
547
- */
548
- _assignIndividualSlotsToChildren() {
549
- const domChildren = Array.from(this.children);
550
-
551
- domChildren.forEach(child => {
552
- if (child._individualSlot) {
553
- child.setAttribute("slot", child._individualSlot);
554
- }
555
- });
556
- }
557
-
558
- /**
559
- * @private
560
- */
561
- _waitForDomRef() {
562
- return this._domRefReadyPromise;
563
- }
564
-
565
- /**
566
- * Returns the DOM Element inside the Shadow Root that corresponds to the opening tag in the UI5 Web Component's template
567
- * Use this method instead of "this.shadowRoot" to read the Shadow DOM, if ever necessary
568
- * @public
569
- */
570
- getDomRef() {
571
- if (!this.shadowRoot || this.shadowRoot.children.length === 0) {
572
- return;
573
- }
574
-
575
- return this.shadowRoot.children.length === 1
576
- ? this.shadowRoot.children[0] : this.shadowRoot.children[1];
577
- }
578
-
579
- /**
580
- * Returns the DOM Element marked with "data-sap-focus-ref" inside the template.
581
- * This is the element that will receive the focus by default.
582
- * @public
583
- */
584
- getFocusDomRef() {
585
- const domRef = this.getDomRef();
586
- if (domRef) {
587
- const focusRef = domRef.querySelector("[data-sap-focus-ref]");
588
- return focusRef || domRef;
589
- }
590
- }
591
-
592
- /**
593
- * Use this method in order to get a reference to element in the shadow root of a web component
594
- * @public
595
- * @param {String} refName Defines the name of the stable DOM ref
596
- */
597
- getStableDomRef(refName) {
598
- return this.getDomRef().querySelector(`[data-ui5-stable=${refName}]`);
599
- }
600
-
601
- /**
602
- * Set the focus to the element, returned by "getFocusDomRef()" (marked by "data-sap-focus-ref")
603
- * @public
604
- */
605
- async focus() {
606
- await this._waitForDomRef();
607
-
608
- const focusDomRef = this.getFocusDomRef();
609
-
610
- if (focusDomRef && typeof focusDomRef.focus === "function") {
611
- focusDomRef.focus();
612
- }
613
- }
614
-
615
- /**
616
- *
617
- * @public
618
- * @param name - name of the event
619
- * @param data - additional data for the event
620
- * @param cancelable - true, if the user can call preventDefault on the event object
621
- * @returns {boolean} false, if the event was cancelled (preventDefault called), true otherwise
622
- */
623
- fireEvent(name, data, cancelable) {
624
- const eventResult = this._fireEvent(name, data, cancelable);
625
- const camelCaseEventName = kebabToCamelCase(name);
626
-
627
- if (camelCaseEventName !== name) {
628
- return eventResult && this._fireEvent(camelCaseEventName, data, cancelable);
629
- }
630
-
631
- return eventResult;
632
- }
633
-
634
- _fireEvent(name, data, cancelable) {
635
- let compatEventResult = true; // Initialized to true, because if the event is not fired at all, it should be considered "not-prevented"
636
-
637
- const noConflictEvent = new CustomEvent(`ui5-${name}`, {
638
- detail: data,
639
- composed: false,
640
- bubbles: true,
641
- cancelable,
642
- });
643
-
644
- // This will be false if the compat event is prevented
645
- compatEventResult = this.dispatchEvent(noConflictEvent);
646
-
647
- if (skipOriginalEvent(name)) {
648
- return compatEventResult;
649
- }
650
-
651
- const customEvent = new CustomEvent(name, {
652
- detail: data,
653
- composed: false,
654
- bubbles: true,
655
- cancelable,
656
- });
657
-
658
- // This will be false if the normal event is prevented
659
- const normalEventResult = this.dispatchEvent(customEvent);
660
-
661
- // Return false if any of the two events was prevented (its result was false).
662
- return normalEventResult && compatEventResult;
663
- }
664
-
665
- /**
666
- * Returns the actual children, associated with a slot.
667
- * Useful when there are transitive slots in nested component scenarios and you don't want to get a list of the slots, but rather of their content.
668
- * @public
669
- */
670
- getSlottedNodes(slotName) {
671
- const reducer = (acc, curr) => {
672
- if (!isSlot(curr)) {
673
- return acc.concat([curr]);
674
- }
675
- return acc.concat(curr.assignedNodes({ flatten: true }).filter(item => item instanceof HTMLElement));
676
- };
677
-
678
- return this[slotName].reduce(reducer, []);
679
- }
680
-
681
- get isCompact() {
682
- return getComputedStyle(this).getPropertyValue(GLOBAL_CONTENT_DENSITY_CSS_VAR) === "compact";
683
- }
684
-
685
- /**
686
- * Determines whether the component should be rendered in RTL mode or not.
687
- * Returns: "rtl", "ltr" or undefined
688
- *
689
- * @public
690
- * @returns {String|undefined}
691
- */
692
- get effectiveDir() {
693
- markAsRtlAware(this.constructor); // if a UI5 Element calls this method, it's considered to be rtl-aware
694
-
695
- const doc = window.document;
696
- const dirValues = ["ltr", "rtl"]; // exclude "auto" and "" from all calculations
697
- const locallyAppliedDir = getComputedStyle(this).getPropertyValue(GLOBAL_DIR_CSS_VAR);
698
-
699
- // In that order, inspect the CSS Var (for modern browsers), the element itself, html and body (for IE fallback)
700
- if (dirValues.includes(locallyAppliedDir)) {
701
- return locallyAppliedDir;
702
- }
703
- if (dirValues.includes(this.dir)) {
704
- return this.dir;
705
- }
706
- if (dirValues.includes(doc.documentElement.dir)) {
707
- return doc.documentElement.dir;
708
- }
709
- if (dirValues.includes(doc.body.dir)) {
710
- return doc.body.dir;
711
- }
712
-
713
- // Finally, check the configuration for explicitly set RTL or language-implied RTL
714
- return getRTL() ? "rtl" : undefined;
715
- }
716
-
717
- updateStaticAreaItemContentDensity() {
718
- if (this.staticAreaItem) {
719
- this.staticAreaItem._updateContentDensity(this.isCompact);
720
- }
721
- }
722
-
723
- /**
724
- * Used to duck-type UI5 elements without using instanceof
725
- * @returns {boolean}
726
- * @public
727
- */
728
- get isUI5Element() {
729
- return true;
730
- }
731
-
732
- /**
733
- * Do not override this method in derivatives of UI5Element, use metadata properties instead
734
- * @private
735
- */
736
- static get observedAttributes() {
737
- return this.getMetadata().getAttributesList();
738
- }
739
-
740
- /**
741
- * @private
742
- */
743
- static _getSlotName(child) {
744
- // Text nodes can only go to the default slot
745
- if (!(child instanceof HTMLElement)) {
746
- return "default";
747
- }
748
-
749
- // Discover the slot based on the real slot name (f.e. footer => footer, or content-32 => content)
750
- const slot = child.getAttribute("slot");
751
- if (slot) {
752
- const match = slot.match(/^(.+?)-\d+$/);
753
- return match ? match[1] : slot;
754
- }
755
-
756
- // Use default slot as a fallback
757
- return "default";
758
- }
759
-
760
- /**
761
- * @private
762
- */
763
- static _needsShadowDOM() {
764
- return !!this.template;
765
- }
766
-
767
- _shouldUpdateFragment() {
768
- return this.constructor._needsStaticArea() && this.staticAreaItem.isRendered();
769
- }
770
-
771
- /**
772
- * @private
773
- */
774
- static _needsStaticArea() {
775
- return typeof this.staticAreaTemplate === "function";
776
- }
777
-
778
- /**
779
- * @public
780
- */
781
- getStaticAreaItemDomRef() {
782
- return this.staticAreaItem.getDomRef();
783
- }
784
-
785
- /**
786
- * @private
787
- */
788
- static _getDefaultState() {
789
- if (this._defaultState) {
790
- return this._defaultState;
791
- }
792
-
793
- const MetadataClass = this.getMetadata();
794
- const defaultState = {};
795
- const slotsAreManaged = MetadataClass.slotsAreManaged();
796
-
797
- // Initialize properties
798
- const props = MetadataClass.getProperties();
799
- for (const propName in props) { // eslint-disable-line
800
- const propType = props[propName].type;
801
- const propDefaultValue = props[propName].defaultValue;
802
-
803
- if (propType === Boolean) {
804
- defaultState[propName] = false;
805
-
806
- if (propDefaultValue !== undefined) {
807
- console.warn("The 'defaultValue' metadata key is ignored for all booleans properties, they would be initialized with 'false' by default"); // eslint-disable-line
808
- }
809
- } else if (props[propName].multiple) {
810
- defaultState[propName] = [];
811
- } else if (propType === Object) {
812
- defaultState[propName] = "defaultValue" in props[propName] ? props[propName].defaultValue : {};
813
- } else if (propType === String) {
814
- defaultState[propName] = "defaultValue" in props[propName] ? props[propName].defaultValue : "";
815
- } else {
816
- defaultState[propName] = propDefaultValue;
817
- }
818
- }
819
-
820
- // Initialize slots
821
- if (slotsAreManaged) {
822
- const slots = MetadataClass.getSlots();
823
- for (const [slotName, slotData] of Object.entries(slots)) { // eslint-disable-line
824
- const propertyName = slotData.propertyName || slotName;
825
- defaultState[propertyName] = [];
826
- }
827
- }
828
-
829
- this._defaultState = defaultState;
830
- return defaultState;
831
- }
832
-
833
- /**
834
- * @private
835
- */
836
- static _generateAccessors() {
837
- const proto = this.prototype;
838
- const slotsAreManaged = this.getMetadata().slotsAreManaged();
839
-
840
- // Properties
841
- const properties = this.getMetadata().getProperties();
842
- for (const [prop, propData] of Object.entries(properties)) { // eslint-disable-line
843
- if (!isValidPropertyName(prop)) {
844
- throw new Error(`"${prop}" is not a valid property name. Use a name that does not collide with DOM APIs`);
845
- }
846
-
847
- if (propData.type === Boolean && propData.defaultValue) {
848
- throw new Error(`Cannot set a default value for property "${prop}". All booleans are false by default.`);
849
- }
850
-
851
- if (propData.type === Array) {
852
- throw new Error(`Wrong type for property "${prop}". Properties cannot be of type Array - use "multiple: true" and set "type" to the single value type, such as "String", "Object", etc...`);
853
- }
854
-
855
- if (propData.type === Object && propData.defaultValue) {
856
- throw new Error(`Cannot set a default value for property "${prop}". All properties of type "Object" are empty objects by default.`);
857
- }
858
-
859
- if (propData.multiple && propData.defaultValue) {
860
- throw new Error(`Cannot set a default value for property "${prop}". All multiple properties are empty arrays by default.`);
861
- }
862
-
863
- Object.defineProperty(proto, prop, {
864
- get() {
865
- if (this._state[prop] !== undefined) {
866
- return this._state[prop];
867
- }
868
-
869
- const propDefaultValue = propData.defaultValue;
870
-
871
- if (propData.type === Boolean) {
872
- return false;
873
- } else if (propData.type === String) { // eslint-disable-line
874
- return propDefaultValue;
875
- } else if (propData.multiple) { // eslint-disable-line
876
- return [];
877
- } else {
878
- return propDefaultValue;
879
- }
880
- },
881
- set(value) {
882
- value = this.constructor.getMetadata().constructor.validatePropertyValue(value, propData);
883
-
884
- const oldState = this._state[prop];
885
-
886
- if (oldState !== value) {
887
- this._state[prop] = value;
888
- this._invalidate(prop, value);
889
- this._propertyChange(prop, value);
890
- }
891
- },
892
- });
893
- }
894
-
895
- // Slots
896
- if (slotsAreManaged) {
897
- const slots = this.getMetadata().getSlots();
898
- for (const [slotName, slotData] of Object.entries(slots)) { // eslint-disable-line
899
- if (!isValidPropertyName(slotName)) {
900
- throw new Error(`"${slotName}" is not a valid property name. Use a name that does not collide with DOM APIs`);
901
- }
902
-
903
- const propertyName = slotData.propertyName || slotName;
904
- Object.defineProperty(proto, propertyName, {
905
- get() {
906
- if (this._state[propertyName] !== undefined) {
907
- return this._state[propertyName];
908
- }
909
- return [];
910
- },
911
- set() {
912
- throw new Error("Cannot set slots directly, use the DOM APIs");
913
- },
914
- });
915
- }
916
- }
917
- }
918
-
919
- /**
920
- * Returns the metadata object for this UI5 Web Component Class
921
- * @protected
922
- */
923
- static get metadata() {
924
- return metadata;
925
- }
926
-
927
- /**
928
- * Returns the CSS for this UI5 Web Component Class
929
- * @protected
930
- */
931
- static get styles() {
932
- return "";
933
- }
934
-
935
- /**
936
- * Returns the Static Area CSS for this UI5 Web Component Class
937
- * @protected
938
- */
939
- static get staticAreaStyles() {
940
- return "";
941
- }
942
-
943
- /**
944
- * Registers a UI5 Web Component in the browser window object
945
- * @public
946
- * @returns {Promise<UI5Element>}
947
- */
948
- static async define() {
949
- await boot();
950
-
951
- if (this.onDefine) {
952
- await this.onDefine();
953
- }
954
-
955
- const tag = this.getMetadata().getTag();
956
- const altTag = this.getMetadata().getAltTag();
957
-
958
- const definedLocally = isTagRegistered(tag);
959
- const definedGlobally = customElements.get(tag);
960
-
961
- if (definedGlobally && !definedLocally) {
962
- recordTagRegistrationFailure(tag);
963
- } else if (!definedGlobally) {
964
- this._generateAccessors();
965
- registerTag(tag);
966
- window.customElements.define(tag, this);
967
-
968
- if (altTag && !customElements.get(altTag)) {
969
- class oldClassName extends this {}
970
- registerTag(altTag);
971
- window.customElements.define(altTag, oldClassName);
972
- }
973
- }
974
- return this;
975
- }
976
-
977
- /**
978
- * Returns an instance of UI5ElementMetadata.js representing this UI5 Web Component's full metadata (its and its parents')
979
- * Note: not to be confused with the "get metadata()" method, which returns an object for this class's metadata only
980
- * @public
981
- * @returns {UI5ElementMetadata}
982
- */
983
- static getMetadata() {
984
- if (this.hasOwnProperty("_metadata")) { // eslint-disable-line
985
- return this._metadata;
986
- }
987
-
988
- const metadataObjects = [this.metadata];
989
- let klass = this; // eslint-disable-line
990
- while (klass !== UI5Element) {
991
- klass = Object.getPrototypeOf(klass);
992
- metadataObjects.unshift(klass.metadata);
993
- }
994
- const mergedMetadata = merge({}, ...metadataObjects);
995
-
996
- this._metadata = new UI5ElementMetadata(mergedMetadata);
997
- return this._metadata;
998
- }
999
- }
1000
-
1001
- export default UI5Element;