@ui5/webcomponents-base 0.0.0-96e98c995 → 0.0.0-97c4a1259

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 (439) hide show
  1. package/.eslintignore +5 -4
  2. package/.eslintrc.cjs +3 -0
  3. package/.npsrc.json +3 -0
  4. package/CHANGELOG.md +404 -0
  5. package/README.md +4 -0
  6. package/bundle.esm.js +8 -1
  7. package/config/wdio.conf.cjs +400 -0
  8. package/dist/AssetRegistry.js.map +1 -1
  9. package/dist/Boot.d.ts +4 -3
  10. package/dist/Boot.js +32 -5
  11. package/dist/Boot.js.map +1 -1
  12. package/dist/CSP.js.map +1 -1
  13. package/dist/CustomElementsRegistry.js.map +1 -1
  14. package/dist/CustomElementsScope.d.ts +2 -2
  15. package/dist/CustomElementsScope.js +2 -2
  16. package/dist/CustomElementsScope.js.map +1 -1
  17. package/dist/CustomElementsScopeUtils.d.ts +8 -1
  18. package/dist/CustomElementsScopeUtils.js +13 -1
  19. package/dist/CustomElementsScopeUtils.js.map +1 -1
  20. package/dist/DOMObserver.js.map +1 -1
  21. package/dist/Device.js +109 -34
  22. package/dist/Device.js.map +1 -1
  23. package/dist/EventProvider.js +1 -1
  24. package/dist/EventProvider.js.map +1 -1
  25. package/dist/FeaturesRegistry.js.map +1 -1
  26. package/dist/FontFace.js +1 -1
  27. package/dist/FontFace.js.map +1 -1
  28. package/dist/IgnoreCustomElements.d.ts +27 -0
  29. package/dist/IgnoreCustomElements.js +39 -0
  30. package/dist/IgnoreCustomElements.js.map +1 -0
  31. package/dist/InitialConfiguration.d.ts +6 -1
  32. package/dist/InitialConfiguration.js +12 -3
  33. package/dist/InitialConfiguration.js.map +1 -1
  34. package/dist/Keys.d.ts +5 -1
  35. package/dist/Keys.js +6 -2
  36. package/dist/Keys.js.map +1 -1
  37. package/dist/ManagedStyles.js +5 -4
  38. package/dist/ManagedStyles.js.map +1 -1
  39. package/dist/MarkedEvents.js.map +1 -1
  40. package/dist/MediaRange.js.map +1 -1
  41. package/dist/PropertiesFileFormat.js.map +1 -1
  42. package/dist/Render.js.map +1 -1
  43. package/dist/RenderQueue.js.map +1 -1
  44. package/dist/Runtimes.js.map +1 -1
  45. package/dist/StaticArea.d.ts +3 -0
  46. package/dist/StaticArea.js +4 -3
  47. package/dist/StaticArea.js.map +1 -1
  48. package/dist/StaticAreaItem.d.ts +1 -0
  49. package/dist/StaticAreaItem.js +7 -4
  50. package/dist/StaticAreaItem.js.map +1 -1
  51. package/dist/SystemCSSVars.js.map +1 -1
  52. package/dist/Theming.js.map +1 -1
  53. package/dist/UI5Element.d.ts +22 -15
  54. package/dist/UI5Element.js +24 -26
  55. package/dist/UI5Element.js.map +1 -1
  56. package/dist/UI5ElementMetadata.js.map +1 -1
  57. package/dist/animations/AnimationQueue.js.map +1 -1
  58. package/dist/animations/animate.js.map +1 -1
  59. package/dist/animations/scroll.js.map +1 -1
  60. package/dist/animations/slideDown.js.map +1 -1
  61. package/dist/animations/slideUp.js.map +1 -1
  62. package/dist/api.json +1 -1
  63. package/dist/asset-registries/Icons.d.ts +22 -13
  64. package/dist/asset-registries/Icons.js +63 -31
  65. package/dist/asset-registries/Icons.js.map +1 -1
  66. package/dist/asset-registries/Illustrations.d.ts +2 -1
  67. package/dist/asset-registries/Illustrations.js +58 -19
  68. package/dist/asset-registries/Illustrations.js.map +1 -1
  69. package/dist/asset-registries/LocaleData.js.map +1 -1
  70. package/dist/asset-registries/Themes.d.ts +1 -0
  71. package/dist/asset-registries/Themes.js +2 -0
  72. package/dist/asset-registries/Themes.js.map +1 -1
  73. package/dist/asset-registries/i18n.js +9 -3
  74. package/dist/asset-registries/i18n.js.map +1 -1
  75. package/dist/asset-registries/util/IconCollectionsAlias.d.ts +30 -0
  76. package/dist/asset-registries/util/IconCollectionsAlias.js +37 -0
  77. package/dist/asset-registries/util/IconCollectionsAlias.js.map +1 -0
  78. package/dist/asset-registries/util/IconCollectionsByTheme.d.ts +20 -0
  79. package/dist/asset-registries/util/IconCollectionsByTheme.js +42 -0
  80. package/dist/asset-registries/util/IconCollectionsByTheme.js.map +1 -0
  81. package/dist/asset-registries/util/getIconCollectionByTheme.d.ts +13 -0
  82. package/dist/asset-registries/util/getIconCollectionByTheme.js +29 -0
  83. package/dist/asset-registries/util/getIconCollectionByTheme.js.map +1 -0
  84. package/dist/assets/Boot.21ef0c87.js +9 -0
  85. package/dist/assets/Boot.34b7cea0.css +1 -0
  86. package/dist/assets/bundle.esm.818699fc.js +50 -0
  87. package/dist/config/AnimationMode.d.ts +2 -2
  88. package/dist/config/AnimationMode.js +1 -1
  89. package/dist/config/AnimationMode.js.map +1 -1
  90. package/dist/config/CalendarType.js.map +1 -1
  91. package/dist/config/FormatSettings.d.ts +5 -1
  92. package/dist/config/FormatSettings.js +5 -1
  93. package/dist/config/FormatSettings.js.map +1 -1
  94. package/dist/config/Icons.d.ts +31 -21
  95. package/dist/config/Icons.js +28 -32
  96. package/dist/config/Icons.js.map +1 -1
  97. package/dist/config/Language.d.ts +10 -1
  98. package/dist/config/Language.js +13 -1
  99. package/dist/config/Language.js.map +1 -1
  100. package/dist/config/NoConflict.js +1 -0
  101. package/dist/config/NoConflict.js.map +1 -1
  102. package/dist/config/RTL.js +3 -0
  103. package/dist/config/RTL.js.map +1 -1
  104. package/dist/config/Theme.d.ts +15 -5
  105. package/dist/config/Theme.js +25 -6
  106. package/dist/config/Theme.js.map +1 -1
  107. package/dist/config/ThemeRoot.d.ts +29 -0
  108. package/dist/config/ThemeRoot.js +59 -0
  109. package/dist/config/ThemeRoot.js.map +1 -0
  110. package/dist/config/Timezone.d.ts +17 -0
  111. package/dist/config/Timezone.js +30 -0
  112. package/dist/config/Timezone.js.map +1 -0
  113. package/dist/connectToComponent.d.ts +9 -0
  114. package/dist/connectToComponent.js +57 -0
  115. package/dist/connectToComponent.js.map +1 -0
  116. package/dist/css/FontFace.css +34 -16
  117. package/dist/decorators/customElement.d.ts +17 -2
  118. package/dist/decorators/customElement.js +26 -5
  119. package/dist/decorators/customElement.js.map +1 -1
  120. package/dist/decorators/event.js +6 -6
  121. package/dist/decorators/event.js.map +1 -1
  122. package/dist/decorators/property.js +6 -6
  123. package/dist/decorators/property.js.map +1 -1
  124. package/dist/decorators/slot.js +9 -9
  125. package/dist/decorators/slot.js.map +1 -1
  126. package/dist/delegate/ItemNavigation.js +1 -1
  127. package/dist/delegate/ItemNavigation.js.map +1 -1
  128. package/dist/delegate/ResizeHandler.d.ts +2 -1
  129. package/dist/delegate/ResizeHandler.js +7 -3
  130. package/dist/delegate/ResizeHandler.js.map +1 -1
  131. package/dist/delegate/ScrollEnablement.js.map +1 -1
  132. package/dist/features/F6Navigation.d.ts +3 -0
  133. package/dist/features/F6Navigation.js +77 -38
  134. package/dist/features/F6Navigation.js.map +1 -1
  135. package/dist/features/LegacyDateFormats.d.ts +18 -0
  136. package/dist/features/LegacyDateFormats.js +20 -0
  137. package/dist/features/LegacyDateFormats.js.map +1 -0
  138. package/dist/features/OpenUI5Element.js.map +1 -1
  139. package/dist/features/OpenUI5Enablement.js.map +1 -1
  140. package/dist/features/OpenUI5Support.d.ts +16 -3
  141. package/dist/features/OpenUI5Support.js +90 -33
  142. package/dist/features/OpenUI5Support.js.map +1 -1
  143. package/dist/generated/AssetParameters.js +3 -1
  144. package/dist/generated/VersionInfo.js +3 -3
  145. package/dist/generated/css/BusyIndicator.css.d.ts +3 -0
  146. package/dist/generated/css/BusyIndicator.css.js +7 -5
  147. package/dist/generated/css/BusyIndicator.css.js.map +1 -0
  148. package/dist/generated/css/FontFace.css.d.ts +3 -0
  149. package/dist/generated/css/FontFace.css.js +7 -5
  150. package/dist/generated/css/FontFace.css.js.map +1 -0
  151. package/dist/generated/css/OverrideFontFace.css.d.ts +3 -0
  152. package/dist/generated/css/OverrideFontFace.css.js +7 -5
  153. package/dist/generated/css/OverrideFontFace.css.js.map +1 -0
  154. package/dist/generated/css/SystemCSSVars.css.d.ts +3 -0
  155. package/dist/generated/css/SystemCSSVars.css.js +7 -5
  156. package/dist/generated/css/SystemCSSVars.css.js.map +1 -0
  157. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +4 -0
  158. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js +8 -10
  159. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +1 -0
  160. package/dist/getSharedResource.d.ts +1 -1
  161. package/dist/getSharedResource.js +16 -2
  162. package/dist/getSharedResource.js.map +1 -1
  163. package/dist/global.d.ts +2 -6
  164. package/dist/i18nBundle.d.ts +1 -1
  165. package/dist/i18nBundle.js +2 -1
  166. package/dist/i18nBundle.js.map +1 -1
  167. package/dist/locale/Locale.js.map +1 -1
  168. package/dist/locale/RTLAwareRegistry.d.ts +1 -1
  169. package/dist/locale/RTLAwareRegistry.js.map +1 -1
  170. package/dist/locale/applyDirection.js.map +1 -1
  171. package/dist/locale/directionChange.js.map +1 -1
  172. package/dist/locale/getEffectiveDir.js.map +1 -1
  173. package/dist/locale/getLocale.js.map +1 -1
  174. package/dist/locale/languageChange.js.map +1 -1
  175. package/dist/locale/nextFallbackLocale.js.map +1 -1
  176. package/dist/locale/normalizeLocale.js.map +1 -1
  177. package/dist/renderer/LitRenderer.d.ts +3 -3
  178. package/dist/renderer/LitRenderer.js.map +1 -1
  179. package/dist/renderer/executeTemplate.js +1 -1
  180. package/dist/renderer/executeTemplate.js.map +1 -1
  181. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +112 -97
  182. package/dist/theming/CustomStyle.js +7 -5
  183. package/dist/theming/CustomStyle.js.map +1 -1
  184. package/dist/theming/ThemeLoaded.js.map +1 -1
  185. package/dist/theming/ThemeRegistered.d.ts +4 -0
  186. package/dist/theming/ThemeRegistered.js +11 -0
  187. package/dist/theming/ThemeRegistered.js.map +1 -0
  188. package/dist/theming/applyTheme.js +4 -3
  189. package/dist/theming/applyTheme.js.map +1 -1
  190. package/dist/theming/getConstructableStyle.js.map +1 -1
  191. package/dist/theming/getEffectiveLinksHrefs.js.map +1 -1
  192. package/dist/theming/getEffectiveStyle.js.map +1 -1
  193. package/dist/theming/getStylesString.d.ts +1 -1
  194. package/dist/theming/getStylesString.js.map +1 -1
  195. package/dist/theming/getThemeDesignerTheme.js.map +1 -1
  196. package/dist/theming/preloadLinks.js.map +1 -1
  197. package/dist/thirdparty/_merge.js.map +1 -1
  198. package/dist/thirdparty/isPlainObject.js.map +1 -1
  199. package/dist/thirdparty/merge.js.map +1 -1
  200. package/dist/types/AnimationMode.d.ts +1 -1
  201. package/dist/types/AnimationMode.js +1 -1
  202. package/dist/types/AnimationMode.js.map +1 -1
  203. package/dist/types/CSSColor.d.ts +0 -1
  204. package/dist/types/CSSColor.js +0 -1
  205. package/dist/types/CSSColor.js.map +1 -1
  206. package/dist/types/CalendarType.d.ts +1 -1
  207. package/dist/types/CalendarType.js +1 -1
  208. package/dist/types/CalendarType.js.map +1 -1
  209. package/dist/types/DOMReference.js.map +1 -1
  210. package/dist/types/DataType.js.map +1 -1
  211. package/dist/types/Float.d.ts +0 -1
  212. package/dist/types/Float.js +0 -1
  213. package/dist/types/Float.js.map +1 -1
  214. package/dist/types/Integer.d.ts +0 -1
  215. package/dist/types/Integer.js +0 -1
  216. package/dist/types/Integer.js.map +1 -1
  217. package/dist/types/InvisibleMessageMode.d.ts +1 -1
  218. package/dist/types/InvisibleMessageMode.js +1 -1
  219. package/dist/types/InvisibleMessageMode.js.map +1 -1
  220. package/dist/types/ItemNavigationBehavior.d.ts +1 -1
  221. package/dist/types/ItemNavigationBehavior.js +1 -1
  222. package/dist/types/ItemNavigationBehavior.js.map +1 -1
  223. package/dist/types/NavigationMode.d.ts +1 -1
  224. package/dist/types/NavigationMode.js +1 -1
  225. package/dist/types/NavigationMode.js.map +1 -1
  226. package/dist/types/ValueState.d.ts +1 -1
  227. package/dist/types/ValueState.js +1 -1
  228. package/dist/types/ValueState.js.map +1 -1
  229. package/dist/types.d.ts +1 -1
  230. package/dist/types.js.map +1 -1
  231. package/dist/updateShadowRoot.js +13 -5
  232. package/dist/updateShadowRoot.js.map +1 -1
  233. package/dist/util/AriaLabelHelper.d.ts +10 -1
  234. package/dist/util/AriaLabelHelper.js +135 -8
  235. package/dist/util/AriaLabelHelper.js.map +1 -1
  236. package/dist/util/Caret.js.map +1 -1
  237. package/dist/util/ColorConversion.js.map +1 -1
  238. package/dist/util/FetchHelper.js.map +1 -1
  239. package/dist/util/FocusableElements.js +12 -2
  240. package/dist/util/FocusableElements.js.map +1 -1
  241. package/dist/util/HTMLSanitizer.js.map +1 -1
  242. package/dist/util/InvisibleMessage.d.ts +1 -1
  243. package/dist/util/InvisibleMessage.js.map +1 -1
  244. package/dist/util/PopupUtils.js +1 -1
  245. package/dist/util/PopupUtils.js.map +1 -1
  246. package/dist/util/SlotsHelper.js.map +1 -1
  247. package/dist/util/StringHelper.js.map +1 -1
  248. package/dist/util/TabbableElements.js.map +1 -1
  249. package/dist/util/arraysAreEqual.js.map +1 -1
  250. package/dist/util/clamp.js.map +1 -1
  251. package/dist/util/createLinkInHead.js.map +1 -1
  252. package/dist/util/createStyleInHead.js.map +1 -1
  253. package/dist/util/debounce.js.map +1 -1
  254. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  255. package/dist/util/escapeRegex.js.map +1 -1
  256. package/dist/util/formatMessage.js.map +1 -1
  257. package/dist/util/generateHighlightedMarkup.js.map +1 -1
  258. package/dist/util/getActiveElement.js.map +1 -1
  259. package/dist/util/getClassCopy.d.ts +10 -10
  260. package/dist/util/getClassCopy.js.map +1 -1
  261. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  262. package/dist/util/getEffectiveContentDensity.js.map +1 -1
  263. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
  264. package/dist/util/getFastNavigationGroups.js.map +1 -1
  265. package/dist/util/getFileExtension.js.map +1 -1
  266. package/dist/util/getNormalizedTarget.js.map +1 -1
  267. package/dist/util/getSingletonElementInstance.d.ts +10 -1
  268. package/dist/util/getSingletonElementInstance.js +11 -2
  269. package/dist/util/getSingletonElementInstance.js.map +1 -1
  270. package/dist/util/isElementClickable.js.map +1 -1
  271. package/dist/util/isElementHidden.js.map +1 -1
  272. package/dist/util/isElementInView.js.map +1 -1
  273. package/dist/util/isElementTabbable.js.map +1 -1
  274. package/dist/util/isValidPropertyName.js.map +1 -1
  275. package/dist/util/whenDOMReady.js.map +1 -1
  276. package/dist/util/willShowContent.js.map +1 -1
  277. package/dist/validateThemeRoot.js +14 -13
  278. package/dist/validateThemeRoot.js.map +1 -1
  279. package/index.js +227 -1
  280. package/lib/generate-asset-parameters/index.js +4 -2
  281. package/lib/generate-styles/index.js +13 -8
  282. package/lib/generate-version-info/index.js +1 -1
  283. package/{package-scripts.js → package-scripts.cjs} +11 -7
  284. package/package.json +5 -4
  285. package/src/css/FontFace.css +34 -16
  286. package/tsconfig.json +1 -0
  287. package/config/wdio.conf.js +0 -1
  288. package/dist/assets/bundle.esm.ba5d36d4.js +0 -56
  289. package/dist/assets-meta/IconCollectionsAlias.d.ts +0 -17
  290. package/dist/assets-meta/IconCollectionsAlias.js +0 -18
  291. package/dist/assets-meta/IconCollectionsAlias.js.map +0 -1
  292. package/dist/config/ThemeRoots.d.ts +0 -4
  293. package/dist/config/ThemeRoots.js +0 -28
  294. package/dist/config/ThemeRoots.js.map +0 -1
  295. package/dist/decorators/fastNavigation.d.ts +0 -7
  296. package/dist/decorators/fastNavigation.js +0 -13
  297. package/dist/decorators/fastNavigation.js.map +0 -1
  298. package/dist/decorators/languageAware.d.ts +0 -7
  299. package/dist/decorators/languageAware.js +0 -13
  300. package/dist/decorators/languageAware.js.map +0 -1
  301. package/dist/decorators/themeAware.d.ts +0 -7
  302. package/dist/decorators/themeAware.js +0 -13
  303. package/dist/decorators/themeAware.js.map +0 -1
  304. package/src/AssetRegistry.ts +0 -11
  305. package/src/Boot.ts +0 -61
  306. package/src/CSP.ts +0 -66
  307. package/src/CustomElementsRegistry.ts +0 -98
  308. package/src/CustomElementsScope.ts +0 -33
  309. package/src/CustomElementsScopeUtils.ts +0 -115
  310. package/src/DOMObserver.ts +0 -28
  311. package/src/Device.ts +0 -124
  312. package/src/EventProvider.ts +0 -87
  313. package/src/FeaturesRegistry.ts +0 -14
  314. package/src/FontFace.ts +0 -31
  315. package/src/InitialConfiguration.ts +0 -207
  316. package/src/Keys.ts +0 -295
  317. package/src/ManagedStyles.ts +0 -92
  318. package/src/MarkedEvents.ts +0 -20
  319. package/src/MediaRange.ts +0 -110
  320. package/src/PropertiesFileFormat.ts +0 -95
  321. package/src/Render.ts +0 -180
  322. package/src/RenderQueue.ts +0 -71
  323. package/src/Runtimes.ts +0 -114
  324. package/src/StaticArea.ts +0 -3
  325. package/src/StaticAreaItem.ts +0 -113
  326. package/src/SystemCSSVars.ts +0 -10
  327. package/src/Theming.ts +0 -4
  328. package/src/UI5Element.ts +0 -1155
  329. package/src/UI5ElementMetadata.ts +0 -389
  330. package/src/animations/AnimationQueue.ts +0 -43
  331. package/src/animations/animate.ts +0 -64
  332. package/src/animations/scroll.ts +0 -21
  333. package/src/animations/slideDown.ts +0 -72
  334. package/src/animations/slideUp.ts +0 -67
  335. package/src/asset-registries/Icons.ts +0 -162
  336. package/src/asset-registries/Illustrations.ts +0 -75
  337. package/src/asset-registries/LocaleData.ts +0 -172
  338. package/src/asset-registries/Themes.ts +0 -67
  339. package/src/asset-registries/i18n.ts +0 -118
  340. package/src/assets-meta/IconCollectionsAlias.ts +0 -18
  341. package/src/config/AnimationMode.ts +0 -33
  342. package/src/config/CalendarType.ts +0 -23
  343. package/src/config/FormatSettings.ts +0 -21
  344. package/src/config/Icons.ts +0 -59
  345. package/src/config/Language.ts +0 -72
  346. package/src/config/NoConflict.ts +0 -67
  347. package/src/config/RTL.ts +0 -41
  348. package/src/config/Theme.ts +0 -64
  349. package/src/config/ThemeRoots.ts +0 -41
  350. package/src/decorators/customElement.ts +0 -17
  351. package/src/decorators/event.ts +0 -28
  352. package/src/decorators/fastNavigation.ts +0 -14
  353. package/src/decorators/languageAware.ts +0 -14
  354. package/src/decorators/property.ts +0 -30
  355. package/src/decorators/slot.ts +0 -49
  356. package/src/decorators/themeAware.ts +0 -14
  357. package/src/delegate/ItemNavigation.ts +0 -393
  358. package/src/delegate/ResizeHandler.ts +0 -95
  359. package/src/delegate/ScrollEnablement.ts +0 -224
  360. package/src/features/F6Navigation.ts +0 -141
  361. package/src/features/OpenUI5Element.ts +0 -11
  362. package/src/features/OpenUI5Enablement.ts +0 -117
  363. package/src/features/OpenUI5Support.ts +0 -148
  364. package/src/getSharedResource.ts +0 -30
  365. package/src/global.d.ts +0 -44
  366. package/src/i18nBundle.ts +0 -108
  367. package/src/locale/Locale.ts +0 -101
  368. package/src/locale/RTLAwareRegistry.ts +0 -16
  369. package/src/locale/applyDirection.ts +0 -18
  370. package/src/locale/directionChange.ts +0 -34
  371. package/src/locale/getEffectiveDir.ts +0 -28
  372. package/src/locale/getLocale.ts +0 -46
  373. package/src/locale/languageChange.ts +0 -24
  374. package/src/locale/nextFallbackLocale.ts +0 -28
  375. package/src/locale/normalizeLocale.ts +0 -56
  376. package/src/renderer/LitRenderer.ts +0 -60
  377. package/src/renderer/executeTemplate.ts +0 -40
  378. package/src/theming/CustomStyle.ts +0 -62
  379. package/src/theming/ThemeLoaded.ts +0 -24
  380. package/src/theming/applyTheme.ts +0 -90
  381. package/src/theming/getConstructableStyle.ts +0 -31
  382. package/src/theming/getEffectiveLinksHrefs.ts +0 -26
  383. package/src/theming/getEffectiveStyle.ts +0 -41
  384. package/src/theming/getStylesString.ts +0 -15
  385. package/src/theming/getThemeDesignerTheme.ts +0 -101
  386. package/src/theming/preloadLinks.ts +0 -24
  387. package/src/thirdparty/_merge.ts +0 -32
  388. package/src/thirdparty/isPlainObject.ts +0 -18
  389. package/src/thirdparty/merge.ts +0 -5
  390. package/src/types/AnimationMode.ts +0 -33
  391. package/src/types/CSSColor.ts +0 -20
  392. package/src/types/CalendarType.ts +0 -38
  393. package/src/types/DOMReference.ts +0 -28
  394. package/src/types/DataType.ts +0 -51
  395. package/src/types/Float.ts +0 -25
  396. package/src/types/Integer.ts +0 -25
  397. package/src/types/InvisibleMessageMode.ts +0 -27
  398. package/src/types/ItemNavigationBehavior.ts +0 -26
  399. package/src/types/NavigationMode.ts +0 -33
  400. package/src/types/ValueState.ts +0 -47
  401. package/src/types.ts +0 -30
  402. package/src/updateShadowRoot.ts +0 -37
  403. package/src/util/AriaLabelHelper.ts +0 -63
  404. package/src/util/Caret.ts +0 -28
  405. package/src/util/ColorConversion.ts +0 -399
  406. package/src/util/FetchHelper.ts +0 -31
  407. package/src/util/FocusableElements.ts +0 -82
  408. package/src/util/HTMLSanitizer.ts +0 -9
  409. package/src/util/InvisibleMessage.ts +0 -69
  410. package/src/util/PopupUtils.ts +0 -112
  411. package/src/util/SlotsHelper.ts +0 -39
  412. package/src/util/StringHelper.ts +0 -26
  413. package/src/util/TabbableElements.ts +0 -70
  414. package/src/util/arraysAreEqual.ts +0 -15
  415. package/src/util/clamp.ts +0 -12
  416. package/src/util/createLinkInHead.ts +0 -25
  417. package/src/util/createStyleInHead.ts +0 -20
  418. package/src/util/debounce.ts +0 -18
  419. package/src/util/detectNavigatorLanguage.ts +0 -13
  420. package/src/util/escapeRegex.ts +0 -11
  421. package/src/util/formatMessage.ts +0 -24
  422. package/src/util/generateHighlightedMarkup.ts +0 -43
  423. package/src/util/getActiveElement.ts +0 -11
  424. package/src/util/getClassCopy.ts +0 -12
  425. package/src/util/getDesigntimePropertyAsArray.ts +0 -4
  426. package/src/util/getEffectiveContentDensity.ts +0 -5
  427. package/src/util/getEffectiveScrollbarStyle.ts +0 -5
  428. package/src/util/getFastNavigationGroups.ts +0 -63
  429. package/src/util/getFileExtension.ts +0 -21
  430. package/src/util/getNormalizedTarget.ts +0 -16
  431. package/src/util/getSingletonElementInstance.ts +0 -13
  432. package/src/util/isElementClickable.ts +0 -19
  433. package/src/util/isElementHidden.ts +0 -9
  434. package/src/util/isElementInView.ts +0 -15
  435. package/src/util/isElementTabbable.ts +0 -37
  436. package/src/util/isValidPropertyName.ts +0 -29
  437. package/src/util/whenDOMReady.ts +0 -13
  438. package/src/util/willShowContent.ts +0 -7
  439. package/src/validateThemeRoot.ts +0 -58
@@ -1,30 +1,40 @@
1
- declare enum IconCollection {
2
- v4 = "SAP-icons",
3
- v5 = "SAP-icons-v5"
4
- }
1
+ type IconCollection = "SAP-icons" | "SAP-icons-v4" | "SAP-icons-v5" | "horizon" | "tnt" | "tnt-v2" | "tnt-v3" | "business-suite" | "business-suite-v1" | "business-suite-v2" | string;
5
2
  /**
6
- * Sets the default icon collection (SAP-icons font v4 or SAP-icons font v5) per theme,
7
- * which will be applied in case icon collection is not specified.
3
+ * Sets the default icon collection for a given theme.
4
+ *
5
+ * SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)
6
+ * and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: "tnt/actor", "business-suite/1x2-grid-layout", etc.
7
+ * This method allows setting another (built-in or custom) icon collection as default per theme.
8
+ *
9
+ * <b>Usage</b>
10
+ * <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
11
+ *
12
+ * <pre>
13
+ * setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
14
+ *
15
+ * <ui5-icon name="home"></ui5-icon>
16
+ * </pre>
17
+ *
18
+ * <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
19
+ *
20
+ * <pre>
21
+ * setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
22
+ *
23
+ * <ui5-icon name="custom-icon-name"></ui5-icon>
24
+ * </pre>
8
25
  *
9
- * Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
10
26
  * @public
11
- * @param {string} theme
12
- * @param {IconCollection} collectionName
27
+ * @param { string } theme
28
+ * @param { string } collectionName
13
29
  */
14
- declare const setDefaultIconCollection: (theme: string, collectionName: "horizon" | IconCollection) => void;
30
+ declare const setDefaultIconCollection: (theme: string, collectionName: IconCollection) => void;
15
31
  /**
16
- * Returns the default icon collection (v4 or v5) for given theme,
17
- * that is configured.
32
+ * Returns the configured default icon collection for a given theme.
18
33
  *
19
- * @param {string} theme
34
+ * @param { string } theme
20
35
  * @public
21
- * @returns {string | undefined}
36
+ * @returns { string | undefined }
22
37
  */
23
38
  declare const getDefaultIconCollection: (theme: string) => string | undefined;
24
- /**
25
- * Returns the effective icon collection that will be applied for icon web components
26
- * whenever namespace is not specified.
27
- * @returns {string}
28
- */
29
- declare const getEffectiveDefaultIconCollection: () => string;
30
- export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveDefaultIconCollection, };
39
+ export { setDefaultIconCollection, getDefaultIconCollection, };
40
+ export type { IconCollection, };
@@ -1,48 +1,44 @@
1
- import { getTheme, isThemeFamily } from "./Theme.js";
2
1
  const IconCollectionConfiguration = new Map();
3
- var IconCollection;
4
- (function (IconCollection) {
5
- IconCollection["v4"] = "SAP-icons";
6
- IconCollection["v5"] = "SAP-icons-v5";
7
- })(IconCollection || (IconCollection = {}));
8
2
  /**
9
- * Sets the default icon collection (SAP-icons font v4 or SAP-icons font v5) per theme,
10
- * which will be applied in case icon collection is not specified.
3
+ * Sets the default icon collection for a given theme.
4
+ *
5
+ * SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)
6
+ * and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: "tnt/actor", "business-suite/1x2-grid-layout", etc.
7
+ * This method allows setting another (built-in or custom) icon collection as default per theme.
8
+ *
9
+ * <b>Usage</b>
10
+ * <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
11
+ *
12
+ * <pre>
13
+ * setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
14
+ *
15
+ * <ui5-icon name="home"></ui5-icon>
16
+ * </pre>
17
+ *
18
+ * <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
19
+ *
20
+ * <pre>
21
+ * setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
22
+ *
23
+ * <ui5-icon name="custom-icon-name"></ui5-icon>
24
+ * </pre>
11
25
  *
12
- * Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
13
26
  * @public
14
- * @param {string} theme
15
- * @param {IconCollection} collectionName
27
+ * @param { string } theme
28
+ * @param { string } collectionName
16
29
  */
17
30
  const setDefaultIconCollection = (theme, collectionName) => {
18
- if (collectionName === "horizon") {
19
- collectionName = IconCollection.v5;
20
- }
21
31
  IconCollectionConfiguration.set(theme, collectionName);
22
32
  };
23
33
  /**
24
- * Returns the default icon collection (v4 or v5) for given theme,
25
- * that is configured.
34
+ * Returns the configured default icon collection for a given theme.
26
35
  *
27
- * @param {string} theme
36
+ * @param { string } theme
28
37
  * @public
29
- * @returns {string | undefined}
38
+ * @returns { string | undefined }
30
39
  */
31
40
  const getDefaultIconCollection = (theme) => {
32
41
  return IconCollectionConfiguration.get(theme);
33
42
  };
34
- /**
35
- * Returns the effective icon collection that will be applied for icon web components
36
- * whenever namespace is not specified.
37
- * @returns {string}
38
- */
39
- const getEffectiveDefaultIconCollection = () => {
40
- const currentTheme = getTheme();
41
- const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
42
- if (currentThemeConfiguration) {
43
- return currentThemeConfiguration;
44
- }
45
- return isThemeFamily("sap_horizon") ? IconCollection.v5 : IconCollection.v4;
46
- };
47
- export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveDefaultIconCollection, };
43
+ export { setDefaultIconCollection, getDefaultIconCollection, };
48
44
  //# sourceMappingURL=Icons.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAErD,MAAM,2BAA2B,GAAG,IAA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AK,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAsB,EAAE;IACtE,OAAO,2BAA2B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,GACxB,CAAC","sourcesContent":["const IconCollectionConfiguration = new Map<string, string>();\n\n// All supported icon collections + unknown custom ones\ntype IconCollection = \"SAP-icons\" | \"SAP-icons-v4\" | \"SAP-icons-v5\" | \"horizon\" | \"tnt\" | \"tnt-v2\" | \"tnt-v3\" | \"business-suite\" | \"business-suite-v1\" | \"business-suite-v2\" | string;\n\n/**\n * Sets the default icon collection for a given theme.\n *\n * SAP Icons is the default icon collection (that resolves to SAP-icons version 5.x in Horizon theme family and SAP-icons version 4.x in all other themes)\n * and to display icons from other collections, you have to specify the icon collection in addition to the icon name, for example: \"tnt/actor\", \"business-suite/1x2-grid-layout\", etc.\n * This method allows setting another (built-in or custom) icon collection as default per theme.\n *\n * <b>Usage</b>\n * <b>For example</b>, to make \"SAP-icons version 5.x\" the default icon collection in \"sap_fiori_3\":\n *\n * <pre>\n * setDefaultIconCollection(\"sap_fiori_3\", \"SAP-icons-v5\");\n *\n * <ui5-icon name=\"home\"></ui5-icon>\n * </pre>\n *\n * <b>For example</b>, to make a custom icon collection (with name \"my-custom-collection\") the default icon collection in \"sap_fiori_3\":\n *\n * <pre>\n * setDefaultIconCollection(\"sap_fiori_3\", \"my-custom-collection\");\n *\n * <ui5-icon name=\"custom-icon-name\"></ui5-icon>\n * </pre>\n *\n * @public\n * @param { string } theme\n * @param { string } collectionName\n */\nconst setDefaultIconCollection = (theme: string, collectionName: IconCollection) => {\n\tIconCollectionConfiguration.set(theme, collectionName);\n};\n\n/**\n * Returns the configured default icon collection for a given theme.\n *\n * @param { string } theme\n * @public\n * @returns { string | undefined }\n */\nconst getDefaultIconCollection = (theme: string): string | undefined => {\n\treturn IconCollectionConfiguration.get(theme);\n};\n\nexport {\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n};\n\nexport type {\n\tIconCollection,\n};\n"]}
@@ -13,6 +13,15 @@ declare const getLanguage: () => string | undefined;
13
13
  * @returns {Promise<void>}
14
14
  */
15
15
  declare const setLanguage: (language: string) => Promise<void>;
16
+ /**
17
+ * Returns the default languague.
18
+ *
19
+ * Note: Default language might be different than the configurated one.
20
+ *
21
+ * @public
22
+ * @returns {string}
23
+ */
24
+ declare const getDefaultLanguage: () => string;
16
25
  /**
17
26
  * Defines if the default language, that is inlined, should be
18
27
  * fetched over the network instead of using the inlined one.
@@ -28,4 +37,4 @@ declare const setFetchDefaultLanguage: (fetchDefaultLang: boolean) => void;
28
37
  * @returns {boolean}
29
38
  */
30
39
  declare const getFetchDefaultLanguage: () => boolean;
31
- export { getLanguage, setLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, };
40
+ export { getLanguage, setLanguage, getDefaultLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, };
@@ -1,6 +1,7 @@
1
1
  import { getLanguage as getConfiguredLanguage, getFetchDefaultLanguage as getConfiguredFetchDefaultLanguage, } from "../InitialConfiguration.js";
2
2
  import { fireLanguageChange } from "../locale/languageChange.js";
3
3
  import { reRenderAllUI5Elements } from "../Render.js";
4
+ import { DEFAULT_LANGUAGE } from "../generated/AssetParameters.js";
4
5
  let curLanguage;
5
6
  let fetchDefaultLanguage;
6
7
  /**
@@ -30,6 +31,17 @@ const setLanguage = async (language) => {
30
31
  await fireLanguageChange(language);
31
32
  await reRenderAllUI5Elements({ languageAware: true });
32
33
  };
34
+ /**
35
+ * Returns the default languague.
36
+ *
37
+ * Note: Default language might be different than the configurated one.
38
+ *
39
+ * @public
40
+ * @returns {string}
41
+ */
42
+ const getDefaultLanguage = () => {
43
+ return DEFAULT_LANGUAGE;
44
+ };
33
45
  /**
34
46
  * Defines if the default language, that is inlined, should be
35
47
  * fetched over the network instead of using the inlined one.
@@ -52,5 +64,5 @@ const getFetchDefaultLanguage = () => {
52
64
  }
53
65
  return fetchDefaultLanguage;
54
66
  };
55
- export { getLanguage, setLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, };
67
+ export { getLanguage, setLanguage, getDefaultLanguage, setFetchDefaultLanguage, getFetchDefaultLanguage, };
56
68
  //# sourceMappingURL=Language.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Language.js","sourceRoot":"","sources":["../../src/config/Language.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,WAAW,IAAI,qBAAqB,EACpC,uBAAuB,IAAI,iCAAiC,GAC5D,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAEtD,IAAI,WAA+B,CAAC;AACpC,IAAI,oBAA6B,CAAC;AAElC;;;;GAIG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,WAAW,KAAK,SAAS,EAAE;QAC9B,WAAW,GAAG,qBAAqB,EAAE,CAAC;KACtC;IACD,OAAO,WAAW,CAAC;AACpB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,KAAK,EAAE,QAAgB,EAAiB,EAAE;IAC7D,IAAI,WAAW,KAAK,QAAQ,EAAE;QAC7B,OAAO;KACP;IAED,WAAW,GAAG,QAAQ,CAAC;IAEvB,MAAM,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACnC,MAAM,sBAAsB,CAAC,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,uBAAuB,GAAG,CAAC,gBAAyB,EAAE,EAAE;IAC7D,oBAAoB,GAAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI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AAG,gBAAgB,CAAC;AACzC,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,GAAY,EAAE;IAC7C,IAAI,oBAAoB,KAAK,SAAS,EAAE;QACvC,uBAAuB,CAAC,iCAAiC,EAAE,CAAC,CAAC;KAC7D;IAED,OAAO,oBAAoB,CAAC;AAC7B,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,GACvB,CAAC","sourcesContent":["import {\n\tgetLanguage as getConfiguredLanguage,\n\tgetFetchDefaultLanguage as getConfiguredFetchDefaultLanguage,\n} from \"../InitialConfiguration.js\";\nimport { fireLanguageChange } from \"../locale/languageChange.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport { DEFAULT_LANGUAGE } from \"../generated/AssetParameters.js\";\n\nlet curLanguage: string | undefined;\nlet fetchDefaultLanguage: boolean;\n\n/**\n * Returns the currently configured language, or the browser language as a fallback.\n * @public\n * @returns {string}\n */\nconst getLanguage = (): string | undefined => {\n\tif (curLanguage === undefined) {\n\t\tcurLanguage = getConfiguredLanguage();\n\t}\n\treturn curLanguage;\n};\n\n/**\n * Changes the current language, re-fetches all message bundles, updates all language-aware components\n * and returns a promise that resolves when all rendering is done.\n *\n * @param {string} language\n * @public\n * @returns {Promise<void>}\n */\nconst setLanguage = async (language: string): Promise<void> => {\n\tif (curLanguage === language) {\n\t\treturn;\n\t}\n\n\tcurLanguage = language;\n\n\tawait fireLanguageChange(language);\n\tawait reRenderAllUI5Elements({ languageAware: true });\n};\n\n/**\n * Returns the default languague.\n *\n * Note: Default language might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultLanguage = (): string => {\n\treturn DEFAULT_LANGUAGE;\n};\n\n/**\n * Defines if the default language, that is inlined, should be\n * fetched over the network instead of using the inlined one.\n * <b>Note:</b> By default the language will not be fetched.\n *\n * @public\n * @param {boolean} fetchDefaultLang\n */\nconst setFetchDefaultLanguage = (fetchDefaultLang: boolean) => {\n\tfetchDefaultLanguage = fetchDefaultLang;\n};\n\n/**\n * Returns if the default language, that is inlined, should be fetched over the network.\n * @public\n * @returns {boolean}\n */\nconst getFetchDefaultLanguage = (): boolean => {\n\tif (fetchDefaultLanguage === undefined) {\n\t\tsetFetchDefaultLanguage(getConfiguredFetchDefaultLanguage());\n\t}\n\n\treturn fetchDefaultLanguage;\n};\n\nexport {\n\tgetLanguage,\n\tsetLanguage,\n\tgetDefaultLanguage,\n\tsetFetchDefaultLanguage,\n\tgetFetchDefaultLanguage,\n};\n"]}
@@ -2,6 +2,7 @@ import { getNoConflict as getConfiguredNoConflict } from "../InitialConfiguratio
2
2
  // Fire these events even with noConflict: true
3
3
  const excludeList = [
4
4
  "value-changed",
5
+ "click",
5
6
  ];
6
7
  let noConflict;
7
8
  const shouldFireOriginalEvent = (eventName) => {
@@ -1 +1 @@
1
- {"version":3,"file":"NoConflict.js","sourceRoot":"","sources":["../../src/config/NoConflict.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,IAAI,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAEtF,+CAA+C;AAC/C,MAAM,WAAW,GAAG;IACnB,eAAe;CACf,CAAC;AAIF,IAAI,UAA0B,CAAC;AAE/B,MAAM,uBAAuB,GAAG,CAAC,SAAiB,EAAE,EAAE;IACrD,OAAO,WAAW,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AACxC,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,CAAC,SAAiB,EAAE,EAAE;IACxD,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IAC3B,8EAA8E;IAC9E,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,SAAS,IAAI,EAAE,CAAC,MAAM,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACvG,CAAC,CAAC;AAEF;;;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I,EAAE,CAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;AACvG,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,aAAa,GAAG,GAAmB,EAAE;IAC1C,IAAI,UAAU,KAAK,SAAS,EAAE;QAC7B,UAAU,GAAG,uBAAuB,EAAE,CAAC;KACvC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,aAAa,GAAG,CAAC,cAA8B,EAAE,EAAE;IACxD,UAAU,GAAG,cAAc,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,CAAC,SAAiB,EAAE,EAAE;IAC/C,MAAM,EAAE,GAAG,aAAa,EAAE,CAAC;IAE3B,2BAA2B;IAC3B,IAAI,uBAAuB,CAAC,SAAS,CAAC,EAAE;QACvC,OAAO,KAAK,CAAC;KACb;IAED,8BAA8B;IAC9B,IAAI,EAAE,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACZ;IAED,OAAO,CAAC,0BAA0B,CAAC,SAAS,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,OAAO,EACN,aAAa,EACb,aAAa,EACb,iBAAiB,GACjB,CAAC","sourcesContent":["import { getNoConflict as getConfiguredNoConflict } from \"../InitialConfiguration.js\";\n\n// Fire these events even with noConflict: true\nconst excludeList = [\n\t\"value-changed\",\n\t\"click\",\n];\n\ntype NoConflictData = boolean | { events: Array<string>};\n\nlet noConflict: NoConflictData;\n\nconst shouldFireOriginalEvent = (eventName: string) => {\n\treturn excludeList.includes(eventName);\n};\n\nconst shouldNotFireOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\t// return !(nc.events && nc.events.includes && nc.events.includes(eventName));\n\treturn !(typeof nc !== \"boolean\" && nc.events && nc.events.includes && nc.events.includes(eventName));\n};\n\n/**\n * Returns if the \"noConflict\" configuration is set.\n * @public\n * @returns { NoConflictData }\n */\nconst getNoConflict = (): NoConflictData => {\n\tif (noConflict === undefined) {\n\t\tnoConflict = getConfiguredNoConflict();\n\t}\n\n\treturn noConflict;\n};\n\n/**\n * Sets the \"noConflict\" mode.\n * - When \"false\" (default value), all custom events are fired with and without the \"ui5-\" prefix.\n * - When \"true\", all custom events are fired with the \"ui5-\" prefix only.\n * - When an object is supplied, just the specified events will be fired with the \"ui5-\" prefix.\n * @public\n * @param { NoConflictData } noConflictData\n */\nconst setNoConflict = (noConflictData: NoConflictData) => {\n\tnoConflict = noConflictData;\n};\n\nconst skipOriginalEvent = (eventName: string) => {\n\tconst nc = getNoConflict();\n\n\t// Always fire these events\n\tif (shouldFireOriginalEvent(eventName)) {\n\t\treturn false;\n\t}\n\n\t// Read from the configuration\n\tif (nc === true) {\n\t\treturn true;\n\t}\n\n\treturn !shouldNotFireOriginalEvent(eventName);\n};\n\nexport {\n\tgetNoConflict,\n\tsetNoConflict,\n\tskipOriginalEvent,\n};\n"]}
@@ -24,6 +24,9 @@ const impliesRTL = (language) => {
24
24
  * @returns {boolean} whether RTL should be used
25
25
  */
26
26
  const getRTL = () => {
27
+ if (typeof document === "undefined") {
28
+ return false;
29
+ }
27
30
  const configurationRTL = getConfiguredRTL();
28
31
  if (configurationRTL !== undefined) {
29
32
  return !!configurationRTL;
@@ -1 +1 @@
1
- {"version":3,"file":"RTL.js","sourceRoot":"","sources":["../../src/config/RTL.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,4BAA4B,MAAM,yCAAyC,CAAC;AACnF,OAAO,uBAAuB,MAAM,oCAAoC,CAAC;AAEzE,MAAM,mBAAmB,GAAG;IAC3B,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;IACV,IAAI,EAAE,IAAI;CACV,CA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C,CAAC,CAAC,IAAI,QAAQ,CAAC;IAEvG,OAAO,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC7C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,GAAG,GAAY,EAAE;IAC5B,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;QACpC,OAAO,KAAK,CAAC;KACb;IAED,MAAM,gBAAgB,GAAG,gBAAgB,EAAE,CAAC;IAE5C,IAAI,gBAAgB,KAAK,SAAS,EAAE;QACnC,OAAO,CAAC,CAAC,gBAAgB,CAAC;KAC1B;IAED,OAAO,UAAU,CAAC,WAAW,EAAE,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC/D,CAAC,CAAC;AAEF,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,sBAAsB","sourcesContent":["import { getRTL as getConfiguredRTL } from \"../InitialConfiguration.js\";\nimport { getLanguage } from \"./Language.js\";\nimport getDesigntimePropertyAsArray from \"../util/getDesigntimePropertyAsArray.js\";\nimport detectNavigatorLanguage from \"../util/detectNavigatorLanguage.js\";\n\nconst M_ISO639_OLD_TO_NEW = {\n\t\"iw\": \"he\",\n\t\"ji\": \"yi\",\n\t\"in\": \"id\",\n\t\"sh\": \"sr\",\n};\n\nconst A_RTL_LOCALES = getDesigntimePropertyAsArray(\"$cldr-rtl-locales:ar,fa,he$\") || [];\n\n/**\n * Checks whether the language is using RTL\n * @param {string} language\n * @returns {boolean} whether the language is using RTL\n */\nconst impliesRTL = (language: string) => {\n\tlanguage = (language && M_ISO639_OLD_TO_NEW[language as keyof typeof M_ISO639_OLD_TO_NEW]) || language;\n\n\treturn A_RTL_LOCALES.indexOf(language) >= 0;\n};\n\n/**\n * Gets the effective RTL setting by first checking the configuration\n * and if not set using the currently set language or the navigator language if the language is not explicitly set.\n * @returns {boolean} whether RTL should be used\n */\nconst getRTL = (): boolean => {\n\tif (typeof document === \"undefined\") {\n\t\treturn false;\n\t}\n\n\tconst configurationRTL = getConfiguredRTL();\n\n\tif (configurationRTL !== undefined) {\n\t\treturn !!configurationRTL;\n\t}\n\n\treturn impliesRTL(getLanguage() || detectNavigatorLanguage());\n};\n\nexport { getRTL }; // eslint-disable-line\n"]}
@@ -11,6 +11,15 @@ declare const getTheme: () => string;
11
11
  * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM
12
12
  */
13
13
  declare const setTheme: (theme: string) => Promise<void>;
14
+ /**
15
+ * Returns the default theme.
16
+ *
17
+ * Note: Default theme might be different than the configurated one.
18
+ *
19
+ * @public
20
+ * @returns {string}
21
+ */
22
+ declare const getDefaultTheme: () => string;
14
23
  /**
15
24
  * Returns if the given theme name is the one currently applied.
16
25
  * @private
@@ -19,10 +28,11 @@ declare const setTheme: (theme: string) => Promise<void>;
19
28
  */
20
29
  declare const isTheme: (theme: string) => boolean;
21
30
  /**
22
- * Returns if the current theme is part of given theme family.
31
+ * Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
32
+ * <b>Note</b>: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
33
+ *
23
34
  * @private
24
- * @param {string} theme the theme family
25
- * @returns {boolean}
35
+ * @returns { boolean }
26
36
  */
27
- declare const isThemeFamily: (theme: string) => boolean;
28
- export { getTheme, setTheme, isTheme, isThemeFamily, };
37
+ declare const isLegacyThemeFamily: () => boolean;
38
+ export { getTheme, setTheme, isTheme, isLegacyThemeFamily, getDefaultTheme, };
@@ -1,6 +1,8 @@
1
1
  import { getTheme as getConfiguredTheme } from "../InitialConfiguration.js";
2
2
  import { reRenderAllUI5Elements } from "../Render.js";
3
3
  import applyTheme from "../theming/applyTheme.js";
4
+ import getThemeDesignerTheme from "../theming/getThemeDesignerTheme.js";
5
+ import { DEFAULT_THEME, SUPPORTED_THEMES } from "../generated/AssetParameters.js";
4
6
  let curTheme;
5
7
  /**
6
8
  * Returns the current theme.
@@ -28,6 +30,17 @@ const setTheme = async (theme) => {
28
30
  await applyTheme(curTheme);
29
31
  await reRenderAllUI5Elements({ themeAware: true });
30
32
  };
33
+ /**
34
+ * Returns the default theme.
35
+ *
36
+ * Note: Default theme might be different than the configurated one.
37
+ *
38
+ * @public
39
+ * @returns {string}
40
+ */
41
+ const getDefaultTheme = () => {
42
+ return DEFAULT_THEME;
43
+ };
31
44
  /**
32
45
  * Returns if the given theme name is the one currently applied.
33
46
  * @private
@@ -39,13 +52,19 @@ const isTheme = (theme) => {
39
52
  return currentTheme === theme || currentTheme === `${theme}_exp`;
40
53
  };
41
54
  /**
42
- * Returns if the current theme is part of given theme family.
55
+ * Returns if the currently set theme is part of legacy theme families ("sap_belize" or "sap_fiori_3").
56
+ * <b>Note</b>: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.
57
+ *
43
58
  * @private
44
- * @param {string} theme the theme family
45
- * @returns {boolean}
59
+ * @returns { boolean }
46
60
  */
47
- const isThemeFamily = (theme) => {
48
- return getTheme().startsWith(theme);
61
+ const isLegacyThemeFamily = () => {
62
+ const currentTheme = getTheme();
63
+ if (!isKnownTheme(currentTheme)) {
64
+ return !getThemeDesignerTheme()?.baseThemeName?.startsWith("sap_horizon");
65
+ }
66
+ return !currentTheme.startsWith("sap_horizon");
49
67
  };
50
- export { getTheme, setTheme, isTheme, isThemeFamily, };
68
+ const isKnownTheme = (theme) => SUPPORTED_THEMES.includes(theme);
69
+ export { getTheme, setTheme, isTheme, isLegacyThemeFamily, getDefaultTheme, };
51
70
  //# sourceMappingURL=Theme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Theme.js","sourceRoot":"","sources":["../../src/config/Theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,UAAU,MAAM,0BAA0B,CAAC;AAElD,IAAI,QAAgB,CAAC;AAErB;;;;GAIG;AACH,MAAM,QAAQ,GAAG,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EACnB,eAAe,GACf,CAAC","sourcesContent":["import { getTheme as getConfiguredTheme } from \"../InitialConfiguration.js\";\nimport { reRenderAllUI5Elements } from \"../Render.js\";\nimport applyTheme from \"../theming/applyTheme.js\";\nimport getThemeDesignerTheme from \"../theming/getThemeDesignerTheme.js\";\nimport { DEFAULT_THEME, SUPPORTED_THEMES } from \"../generated/AssetParameters.js\";\n\nlet curTheme: string;\n\n/**\n * Returns the current theme.\n * @public\n * @returns {string} the current theme name\n */\nconst getTheme = (): string => {\n\tif (curTheme === undefined) {\n\t\tcurTheme = getConfiguredTheme();\n\t}\n\n\treturn curTheme;\n};\n\n/**\n * Applies a new theme after fetching its assets from the network.\n * @public\n * @param {string} theme the name of the new theme\n * @returns {Promise<void>} a promise that is resolved when the new theme assets have been fetched and applied to the DOM\n */\nconst setTheme = async (theme: string): Promise<void> => {\n\tif (curTheme === theme) {\n\t\treturn;\n\t}\n\n\tcurTheme = theme;\n\n\t// Update CSS Custom Properties\n\tawait applyTheme(curTheme);\n\tawait reRenderAllUI5Elements({ themeAware: true });\n};\n\n/**\n * Returns the default theme.\n *\n * Note: Default theme might be different than the configurated one.\n *\n * @public\n * @returns {string}\n */\nconst getDefaultTheme = (): string => {\n\treturn DEFAULT_THEME;\n};\n\n/**\n * Returns if the given theme name is the one currently applied.\n * @private\n * @param {string} theme\n * @returns {boolean}\n */\nconst isTheme = (theme: string) => {\n\tconst currentTheme = getTheme();\n\treturn currentTheme === theme || currentTheme === `${theme}_exp`;\n};\n\n/**\n * Returns if the currently set theme is part of legacy theme families (\"sap_belize\" or \"sap_fiori_3\").\n * <b>Note</b>: in addition, the method checks the base theme of a custom theme, built via the ThemeDesigner.\n *\n * @private\n * @returns { boolean }\n */\nconst isLegacyThemeFamily = () => {\n\tconst currentTheme = getTheme();\n\n\tif (!isKnownTheme(currentTheme)) {\n\t\treturn !getThemeDesignerTheme()?.baseThemeName?.startsWith(\"sap_horizon\");\n\t}\n\n\treturn !currentTheme.startsWith(\"sap_horizon\");\n};\n\nconst isKnownTheme = (theme: string) => SUPPORTED_THEMES.includes(theme);\n\nexport {\n\tgetTheme,\n\tsetTheme,\n\tisTheme,\n\tisLegacyThemeFamily,\n\tgetDefaultTheme,\n};\n"]}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Returns the current theme root.
3
+ *
4
+ * @public
5
+ * @since 1.14.0
6
+ * @returns { string } the current theme root
7
+ */
8
+ declare const getThemeRoot: () => string | undefined;
9
+ /**
10
+ * Sets theme root for the current theme.
11
+ * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.
12
+ *
13
+ * <b>Note:</b> The feature is specific to custom themes, created with the `UI Theme Designer`.
14
+ * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.
15
+ *
16
+ * <br/>
17
+ *
18
+ * <b>Note:</b> Certain security restrictions will apply before fetching the theme assets.
19
+ * Absolute URLs to a different origin than the current page will result in using the current page as an origin.
20
+ * To allow specific origins, use &lt;meta name="sap-allowedThemeOrigins" content="https://my-example-host.com/"&gt; tag inside the &lt;head&gt; of the page.
21
+ *
22
+ * @public
23
+ * @since 1.14.0
24
+ * @param { string } themeRoot the new theme root
25
+ * @returns { Promise<void> }
26
+ */
27
+ declare const setThemeRoot: (themeRoot: string) => Promise<void> | undefined;
28
+ declare const attachCustomThemeStylesToHead: (theme: string) => Promise<void>;
29
+ export { getThemeRoot, setThemeRoot, attachCustomThemeStylesToHead, };
@@ -0,0 +1,59 @@
1
+ import createLinkInHead from "../util/createLinkInHead.js";
2
+ import validateThemeRoot from "../validateThemeRoot.js";
3
+ import { getThemeRoot as getConfiguredThemeRoot } from "../InitialConfiguration.js";
4
+ import { getTheme } from "./Theme.js";
5
+ let currThemeRoot;
6
+ /**
7
+ * Returns the current theme root.
8
+ *
9
+ * @public
10
+ * @since 1.14.0
11
+ * @returns { string } the current theme root
12
+ */
13
+ const getThemeRoot = () => {
14
+ if (currThemeRoot === undefined) {
15
+ currThemeRoot = getConfiguredThemeRoot();
16
+ }
17
+ return currThemeRoot;
18
+ };
19
+ /**
20
+ * Sets theme root for the current theme.
21
+ * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.
22
+ *
23
+ * <b>Note:</b> The feature is specific to custom themes, created with the `UI Theme Designer`.
24
+ * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.
25
+ *
26
+ * <br/>
27
+ *
28
+ * <b>Note:</b> Certain security restrictions will apply before fetching the theme assets.
29
+ * Absolute URLs to a different origin than the current page will result in using the current page as an origin.
30
+ * To allow specific origins, use &lt;meta name="sap-allowedThemeOrigins" content="https://my-example-host.com/"&gt; tag inside the &lt;head&gt; of the page.
31
+ *
32
+ * @public
33
+ * @since 1.14.0
34
+ * @param { string } themeRoot the new theme root
35
+ * @returns { Promise<void> }
36
+ */
37
+ const setThemeRoot = (themeRoot) => {
38
+ if (currThemeRoot === themeRoot) {
39
+ return;
40
+ }
41
+ currThemeRoot = themeRoot;
42
+ if (!validateThemeRoot(themeRoot)) {
43
+ console.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the "setThemeRoot" description.`); // eslint-disable-line
44
+ return;
45
+ }
46
+ return attachCustomThemeStylesToHead(getTheme());
47
+ };
48
+ const formatThemeLink = (theme) => {
49
+ return `${getThemeRoot()}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.
50
+ };
51
+ const attachCustomThemeStylesToHead = async (theme) => {
52
+ const link = document.querySelector(`[sap-ui-webcomponents-theme="${theme}"]`);
53
+ if (link) {
54
+ document.head.removeChild(link);
55
+ }
56
+ await createLinkInHead(formatThemeLink(theme), { "sap-ui-webcomponents-theme": theme });
57
+ };
58
+ export { getThemeRoot, setThemeRoot, attachCustomThemeStylesToHead, };
59
+ //# sourceMappingURL=ThemeRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeRoot.js","sourceRoot":"","sources":["../../src/config/ThemeRoot.ts"],"names":[],"mappings":"AAAA,OAAO,gBAA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AAC;AACzF,CAAC,CAAC;AAEF,OAAO,EACN,YAAY,EACZ,YAAY,EACZ,6BAA6B,GAC7B,CAAC","sourcesContent":["import createLinkInHead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\nimport { getTheme } from \"./Theme.js\";\n\nlet currThemeRoot: string | undefined;\n\n/**\n * Returns the current theme root.\n *\n * @public\n * @since 1.14.0\n * @returns { string } the current theme root\n */\nconst getThemeRoot = (): string | undefined => {\n\tif (currThemeRoot === undefined) {\n\t\tcurrThemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn currThemeRoot;\n};\n\n/**\n * Sets theme root for the current theme.\n * When set, the framework will validate the theme root and fetch the theme styles (CSS variables) from this location.\n *\n * <b>Note:</b> The feature is specific to custom themes, created with the `UI Theme Designer`.\n * The provided theme root is used only as a base to construct the actual location of the theme styles: `{themeRoot}/.../css_variables.css`.\n *\n * <br/>\n *\n * <b>Note:</b> Certain security restrictions will apply before fetching the theme assets.\n * Absolute URLs to a different origin than the current page will result in using the current page as an origin.\n * To allow specific origins, use &lt;meta name=\"sap-allowedThemeOrigins\" content=\"https://my-example-host.com/\"&gt; tag inside the &lt;head&gt; of the page.\n *\n * @public\n * @since 1.14.0\n * @param { string } themeRoot the new theme root\n * @returns { Promise<void> }\n */\nconst setThemeRoot = (themeRoot: string): Promise<void> | undefined => {\n\tif (currThemeRoot === themeRoot) {\n\t\treturn;\n\t}\n\n\tcurrThemeRoot = themeRoot;\n\n\tif (!validateThemeRoot(themeRoot)) {\n\t\tconsole.warn(`The ${themeRoot} is not valid. Check the allowed origins as suggested in the \"setThemeRoot\" description.`); // eslint-disable-line\n\t\treturn;\n\t}\n\n\treturn attachCustomThemeStylesToHead(getTheme());\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set at this point.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string): Promise<void> => {\n\tconst link = document.querySelector(`[sap-ui-webcomponents-theme=\"${theme}\"]`);\n\n\tif (link) {\n\t\tdocument.head.removeChild(link);\n\t}\n\n\tawait createLinkInHead(formatThemeLink(theme), { \"sap-ui-webcomponents-theme\": theme });\n};\n\nexport {\n\tgetThemeRoot,\n\tsetThemeRoot,\n\tattachCustomThemeStylesToHead,\n};\n"]}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Returns the configured IANA timezone ID.
3
+ *
4
+ * @private
5
+ * @returns {string}
6
+ */
7
+ declare const getTimezone: () => string | undefined;
8
+ /**
9
+ * Sets the IANA timezone ID.
10
+ * <b>For example:</b> "America/New_York", "Europe/London", "Australia/Sydney", "Asia/Bishkek", etc.
11
+ *>
12
+ * @param {string} timezone
13
+ * @private
14
+ * @returns { Promise<void> }
15
+ */
16
+ declare const setTimezone: (timezone: string) => void;
17
+ export { getTimezone, setTimezone, };
@@ -0,0 +1,30 @@
1
+ import { getTimezone as getConfiguredTimezone } from "../InitialConfiguration.js";
2
+ let currTimezone;
3
+ /**
4
+ * Returns the configured IANA timezone ID.
5
+ *
6
+ * @private
7
+ * @returns {string}
8
+ */
9
+ const getTimezone = () => {
10
+ if (currTimezone === undefined) {
11
+ currTimezone = getConfiguredTimezone();
12
+ }
13
+ return currTimezone;
14
+ };
15
+ /**
16
+ * Sets the IANA timezone ID.
17
+ * <b>For example:</b> "America/New_York", "Europe/London", "Australia/Sydney", "Asia/Bishkek", etc.
18
+ *>
19
+ * @param {string} timezone
20
+ * @private
21
+ * @returns { Promise<void> }
22
+ */
23
+ const setTimezone = (timezone) => {
24
+ if (currTimezone === timezone) {
25
+ return;
26
+ }
27
+ currTimezone = timezone;
28
+ };
29
+ export { getTimezone, setTimezone, };
30
+ //# sourceMappingURL=Timezone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timezone.js","sourceRoot":"","sources":["../../src/config/Timezone.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,IAAI,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAElF,IAAI,YAAgC,CAAC;AAErC;;;;;GAKG;AACH,MAAM,WAAW,GAAG,GAAuB,EAAE;IAC5C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,qBAAqB,EAAE,CAAC;KACvC;IACD,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,WAAW,GAAG,CAAC,QAAgB,EAAE,EAAE;IACxC,IAAI,YAAY,KAAK,QAAQ,EAAE;QAC9B,OAAO;KACP;IAED,YAAY,GAAG,QAAQ,CAAC;AACzB,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,WAAW,GACX,CAAC","sourcesContent":["import { getTimezone as getConfiguredTimezone } from \"../InitialConfiguration.js\";\n\nlet currTimezone: string | undefined;\n\n/**\n * Returns the configured IANA timezone ID.\n *\n * @private\n * @returns {string}\n */\nconst getTimezone = (): string | undefined => {\n\tif (currTimezone === undefined) {\n\t\tcurrTimezone = getConfiguredTimezone();\n\t}\n\treturn currTimezone;\n};\n\n/**\n * Sets the IANA timezone ID.\n * <b>For example:</b> \"America/New_York\", \"Europe/London\", \"Australia/Sydney\", \"Asia/Bishkek\", etc.\n *>\n * @param {string} timezone\n * @private\n * @returns { Promise<void> }\n */\nconst setTimezone = (timezone: string) => {\n\tif (currTimezone === timezone) {\n\t\treturn;\n\t}\n\n\tcurrTimezone = timezone;\n};\n\nexport {\n\tgetTimezone,\n\tsetTimezone,\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import type UI5Element from "./UI5Element.js";
2
+ type ConnectOptions = {
3
+ host: UI5Element;
4
+ propName: string;
5
+ onConnect?: (friend: HTMLElement) => void;
6
+ onDisconnect?: (friend: HTMLElement) => void;
7
+ };
8
+ declare const connectToComponent: (options: ConnectOptions) => HTMLElement | undefined;
9
+ export default connectToComponent;
@@ -0,0 +1,57 @@
1
+ import { renderDeferred } from "./Render.js";
2
+ const MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements
3
+ const connections = new Map();
4
+ const intervals = new Map();
5
+ const connectToComponent = (options) => {
6
+ const host = options.host;
7
+ const propName = options.propName;
8
+ const friend = host[propName];
9
+ let connectedTo;
10
+ if (friend === undefined || friend === "") {
11
+ connectedTo = undefined; // do not return early even if a "menu" property is not set - it may have been set before and cleanup must run
12
+ }
13
+ else if (friend instanceof HTMLElement) {
14
+ connectedTo = friend;
15
+ }
16
+ else {
17
+ connectedTo = host.getRootNode().getElementById(friend) || undefined;
18
+ }
19
+ const key = `${host._id}-${propName}`;
20
+ const prevConnectedTo = connections.get(key);
21
+ // Not connected - return undefined
22
+ if (!connectedTo) {
23
+ if (prevConnectedTo) { // but first disconnect, if needed
24
+ options.onDisconnect && options.onDisconnect(prevConnectedTo);
25
+ connections.delete(key);
26
+ }
27
+ // if friend element not in DOM yet, start polling
28
+ if (typeof friend === "string" && friend && !intervals.has(key)) {
29
+ const interval = setInterval(() => {
30
+ const found = host.getRootNode().getElementById(friend);
31
+ if (found) {
32
+ clearInterval(intervals.get(key));
33
+ intervals.delete(key);
34
+ renderDeferred(host);
35
+ }
36
+ }, MISSING_ELEMENT_POLL_TIMEOUT);
37
+ intervals.set(key, interval);
38
+ }
39
+ return;
40
+ }
41
+ // If connected, but still polling, stop polling
42
+ if (intervals.has(key)) {
43
+ clearInterval(intervals.get(key));
44
+ intervals.delete(key);
45
+ }
46
+ // Connected - either for the first time, or to something else
47
+ if (prevConnectedTo !== connectedTo) {
48
+ if (prevConnectedTo) {
49
+ options.onDisconnect && options.onDisconnect(prevConnectedTo);
50
+ }
51
+ options.onConnect && options.onConnect(connectedTo);
52
+ connections.set(key, connectedTo);
53
+ }
54
+ return connections.get(key);
55
+ };
56
+ export default connectToComponent;
57
+ //# sourceMappingURL=connectToComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connectToComponent.js","sourceRoot":"","sources":["../src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AQ,GAAG,WAAW,CAAC,GAAG,EAAE;gBACjC,MAAM,KAAK,GAAI,IAAI,CAAC,WAAW,EAAe,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;gBACtE,IAAI,KAAK,EAAE;oBACV,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;oBAClC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;oBACtB,cAAc,CAAC,IAAI,CAAC,CAAC;iBACrB;YACF,CAAC,EAAE,4BAA4B,CAAC,CAAC;YACjC,SAAS,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;SAC7B;QAED,OAAO;KACP;IAED,gDAAgD;IAChD,IAAI,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;QACvB,aAAa,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QAClC,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;KACtB;IAED,8DAA8D;IAC9D,IAAI,eAAe,KAAK,WAAW,EAAE;QACpC,IAAI,eAAe,EAAE;YACpB,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,YAAY,CAAC,eAAe,CAAC,CAAC;SAC9D;QACD,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;QACpD,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;KAClC;IAED,OAAO,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import type UI5Element from \"./UI5Element.js\";\nimport { renderDeferred } from \"./Render.js\";\nimport { Interval } from \"./types.js\";\n\nconst MISSING_ELEMENT_POLL_TIMEOUT = 500; // how often to poll for not-yet-in-DOM friend elements\nconst connections = new Map<string, HTMLElement>();\nconst intervals = new Map<string, Interval>();\n\ntype ConnectOptions = {\n\thost: UI5Element;\n\tpropName: string;\n\tonConnect?: (friend: HTMLElement) => void;\n\tonDisconnect?: (friend: HTMLElement) => void;\n}\n\nconst connectToComponent = (options: ConnectOptions): HTMLElement | undefined => {\n\tconst host = options.host;\n\tconst propName = options.propName;\n\tconst friend = host[propName as keyof typeof host] as HTMLElement | string | undefined;\n\n\tlet connectedTo: HTMLElement | undefined;\n\tif (friend === undefined || friend === \"\") {\n\t\tconnectedTo = undefined; // do not return early even if a \"menu\" property is not set - it may have been set before and cleanup must run\n\t} else if (friend instanceof HTMLElement) {\n\t\tconnectedTo = friend;\n\t} else {\n\t\tconnectedTo = (host.getRootNode() as Document).getElementById(friend) || undefined;\n\t}\n\n\tconst key = `${host._id}-${propName}`;\n\tconst prevConnectedTo = connections.get(key);\n\n\t// Not connected - return undefined\n\tif (!connectedTo) {\n\t\tif (prevConnectedTo) { // but first disconnect, if needed\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t\tconnections.delete(key);\n\t\t}\n\n\t\t// if friend element not in DOM yet, start polling\n\t\tif (typeof friend === \"string\" && friend && !intervals.has(key)) {\n\t\t\tconst interval = setInterval(() => {\n\t\t\t\tconst found = (host.getRootNode() as Document).getElementById(friend);\n\t\t\t\tif (found) {\n\t\t\t\t\tclearInterval(intervals.get(key));\n\t\t\t\t\tintervals.delete(key);\n\t\t\t\t\trenderDeferred(host);\n\t\t\t\t}\n\t\t\t}, MISSING_ELEMENT_POLL_TIMEOUT);\n\t\t\tintervals.set(key, interval);\n\t\t}\n\n\t\treturn;\n\t}\n\n\t// If connected, but still polling, stop polling\n\tif (intervals.has(key)) {\n\t\tclearInterval(intervals.get(key));\n\t\tintervals.delete(key);\n\t}\n\n\t// Connected - either for the first time, or to something else\n\tif (prevConnectedTo !== connectedTo) {\n\t\tif (prevConnectedTo) {\n\t\t\toptions.onDisconnect && options.onDisconnect(prevConnectedTo);\n\t\t}\n\t\toptions.onConnect && options.onConnect(connectedTo);\n\t\tconnections.set(key, connectedTo);\n\t}\n\n\treturn connections.get(key);\n};\n\nexport default connectToComponent;\n"]}