@ui5/webcomponents-base 0.0.0-7d5f73b20 → 0.0.0-81513ce21

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 (392) hide show
  1. package/.eslintignore +4 -4
  2. package/.eslintrc.cjs +3 -0
  3. package/.npsrc.json +3 -0
  4. package/CHANGELOG.md +185 -0
  5. package/bundle.esm.js +5 -1
  6. package/config/wdio.conf.cjs +400 -0
  7. package/dist/AssetRegistry.js.map +1 -1
  8. package/dist/Boot.d.ts +4 -3
  9. package/dist/Boot.js +31 -4
  10. package/dist/Boot.js.map +1 -1
  11. package/dist/CSP.js.map +1 -1
  12. package/dist/CustomElementsRegistry.js.map +1 -1
  13. package/dist/CustomElementsScope.js.map +1 -1
  14. package/dist/CustomElementsScopeUtils.js.map +1 -1
  15. package/dist/DOMObserver.js.map +1 -1
  16. package/dist/Device.js +109 -34
  17. package/dist/Device.js.map +1 -1
  18. package/dist/EventProvider.js +1 -1
  19. package/dist/EventProvider.js.map +1 -1
  20. package/dist/FeaturesRegistry.js.map +1 -1
  21. package/dist/FontFace.js.map +1 -1
  22. package/dist/InitialConfiguration.d.ts +6 -1
  23. package/dist/InitialConfiguration.js +11 -2
  24. package/dist/InitialConfiguration.js.map +1 -1
  25. package/dist/Keys.js.map +1 -1
  26. package/dist/ManagedStyles.js.map +1 -1
  27. package/dist/MarkedEvents.js.map +1 -1
  28. package/dist/MediaRange.js.map +1 -1
  29. package/dist/PropertiesFileFormat.js.map +1 -1
  30. package/dist/Render.js.map +1 -1
  31. package/dist/RenderQueue.js.map +1 -1
  32. package/dist/Runtimes.js.map +1 -1
  33. package/dist/StaticArea.d.ts +3 -0
  34. package/dist/StaticArea.js +4 -3
  35. package/dist/StaticArea.js.map +1 -1
  36. package/dist/StaticAreaItem.js.map +1 -1
  37. package/dist/SystemCSSVars.js.map +1 -1
  38. package/dist/Theming.js.map +1 -1
  39. package/dist/UI5Element.d.ts +20 -14
  40. package/dist/UI5Element.js +18 -22
  41. package/dist/UI5Element.js.map +1 -1
  42. package/dist/UI5ElementMetadata.js.map +1 -1
  43. package/dist/animations/AnimationQueue.js.map +1 -1
  44. package/dist/animations/animate.js.map +1 -1
  45. package/dist/animations/scroll.js.map +1 -1
  46. package/dist/animations/slideDown.js.map +1 -1
  47. package/dist/animations/slideUp.js.map +1 -1
  48. package/dist/api.json +1 -1
  49. package/dist/asset-registries/Icons.d.ts +18 -10
  50. package/dist/asset-registries/Icons.js +44 -23
  51. package/dist/asset-registries/Icons.js.map +1 -1
  52. package/dist/asset-registries/Illustrations.d.ts +1 -1
  53. package/dist/asset-registries/Illustrations.js.map +1 -1
  54. package/dist/asset-registries/LocaleData.js.map +1 -1
  55. package/dist/asset-registries/Themes.d.ts +1 -0
  56. package/dist/asset-registries/Themes.js +2 -0
  57. package/dist/asset-registries/Themes.js.map +1 -1
  58. package/dist/asset-registries/i18n.js +9 -3
  59. package/dist/asset-registries/i18n.js.map +1 -1
  60. package/dist/assets/Boot.34b7cea0.css +1 -0
  61. package/dist/assets/Boot.de8032fc.js +9 -0
  62. package/dist/assets/bundle.esm.6ca2666f.js +50 -0
  63. package/dist/assets-meta/IconCollectionsAlias.d.ts +24 -10
  64. package/dist/assets-meta/IconCollectionsAlias.js +29 -9
  65. package/dist/assets-meta/IconCollectionsAlias.js.map +1 -1
  66. package/dist/config/AnimationMode.js.map +1 -1
  67. package/dist/config/CalendarType.js.map +1 -1
  68. package/dist/config/FormatSettings.d.ts +5 -1
  69. package/dist/config/FormatSettings.js +5 -1
  70. package/dist/config/FormatSettings.js.map +1 -1
  71. package/dist/config/Icons.d.ts +43 -18
  72. package/dist/config/Icons.js +81 -26
  73. package/dist/config/Icons.js.map +1 -1
  74. package/dist/config/Language.d.ts +10 -1
  75. package/dist/config/Language.js +13 -1
  76. package/dist/config/Language.js.map +1 -1
  77. package/dist/config/NoConflict.js +1 -0
  78. package/dist/config/NoConflict.js.map +1 -1
  79. package/dist/config/RTL.js +3 -0
  80. package/dist/config/RTL.js.map +1 -1
  81. package/dist/config/Theme.d.ts +15 -5
  82. package/dist/config/Theme.js +25 -6
  83. package/dist/config/Theme.js.map +1 -1
  84. package/dist/config/ThemeRoots.js.map +1 -1
  85. package/dist/config/Timezone.d.ts +17 -0
  86. package/dist/config/Timezone.js +30 -0
  87. package/dist/config/Timezone.js.map +1 -0
  88. package/dist/decorators/customElement.d.ts +17 -2
  89. package/dist/decorators/customElement.js +26 -5
  90. package/dist/decorators/customElement.js.map +1 -1
  91. package/dist/decorators/event.js +6 -6
  92. package/dist/decorators/event.js.map +1 -1
  93. package/dist/decorators/property.js +6 -6
  94. package/dist/decorators/property.js.map +1 -1
  95. package/dist/decorators/slot.js +9 -9
  96. package/dist/decorators/slot.js.map +1 -1
  97. package/dist/delegate/ItemNavigation.js.map +1 -1
  98. package/dist/delegate/ResizeHandler.d.ts +2 -1
  99. package/dist/delegate/ResizeHandler.js +7 -3
  100. package/dist/delegate/ResizeHandler.js.map +1 -1
  101. package/dist/delegate/ScrollEnablement.js.map +1 -1
  102. package/dist/features/F6Navigation.d.ts +3 -0
  103. package/dist/features/F6Navigation.js +77 -38
  104. package/dist/features/F6Navigation.js.map +1 -1
  105. package/dist/features/LegacyDateFormats.d.ts +18 -0
  106. package/dist/features/LegacyDateFormats.js +20 -0
  107. package/dist/features/LegacyDateFormats.js.map +1 -0
  108. package/dist/features/OpenUI5Element.js.map +1 -1
  109. package/dist/features/OpenUI5Enablement.js.map +1 -1
  110. package/dist/features/OpenUI5Support.d.ts +3 -0
  111. package/dist/features/OpenUI5Support.js +2 -0
  112. package/dist/features/OpenUI5Support.js.map +1 -1
  113. package/dist/generated/AssetParameters.js +2 -0
  114. package/dist/generated/VersionInfo.js +3 -3
  115. package/dist/generated/css/BusyIndicator.css.js.map +1 -1
  116. package/dist/generated/css/FontFace.css.js.map +1 -1
  117. package/dist/generated/css/OverrideFontFace.css.js.map +1 -1
  118. package/dist/generated/css/SystemCSSVars.css.js.map +1 -1
  119. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.d.ts +4 -0
  120. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js +8 -10
  121. package/dist/generated/templates/elements/WithComplexTemplateTemplate.lit.js.map +1 -0
  122. package/dist/getSharedResource.d.ts +1 -1
  123. package/dist/getSharedResource.js +10 -2
  124. package/dist/getSharedResource.js.map +1 -1
  125. package/dist/global.d.ts +2 -0
  126. package/dist/i18nBundle.js +2 -1
  127. package/dist/i18nBundle.js.map +1 -1
  128. package/dist/locale/Locale.js.map +1 -1
  129. package/dist/locale/RTLAwareRegistry.d.ts +1 -1
  130. package/dist/locale/RTLAwareRegistry.js.map +1 -1
  131. package/dist/locale/applyDirection.js.map +1 -1
  132. package/dist/locale/directionChange.js.map +1 -1
  133. package/dist/locale/getEffectiveDir.js.map +1 -1
  134. package/dist/locale/getLocale.js.map +1 -1
  135. package/dist/locale/languageChange.js.map +1 -1
  136. package/dist/locale/nextFallbackLocale.js.map +1 -1
  137. package/dist/locale/normalizeLocale.js.map +1 -1
  138. package/dist/renderer/LitRenderer.d.ts +3 -3
  139. package/dist/renderer/LitRenderer.js.map +1 -1
  140. package/dist/renderer/executeTemplate.js +1 -1
  141. package/dist/renderer/executeTemplate.js.map +1 -1
  142. package/dist/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
  143. package/dist/theming/CustomStyle.js +7 -5
  144. package/dist/theming/CustomStyle.js.map +1 -1
  145. package/dist/theming/ThemeLoaded.js.map +1 -1
  146. package/dist/theming/ThemeRegistered.d.ts +4 -0
  147. package/dist/theming/ThemeRegistered.js +11 -0
  148. package/dist/theming/ThemeRegistered.js.map +1 -0
  149. package/dist/theming/applyTheme.js.map +1 -1
  150. package/dist/theming/getConstructableStyle.js.map +1 -1
  151. package/dist/theming/getEffectiveLinksHrefs.js.map +1 -1
  152. package/dist/theming/getEffectiveStyle.js.map +1 -1
  153. package/dist/theming/getStylesString.d.ts +1 -1
  154. package/dist/theming/getStylesString.js.map +1 -1
  155. package/dist/theming/getThemeDesignerTheme.js.map +1 -1
  156. package/dist/theming/preloadLinks.js.map +1 -1
  157. package/dist/thirdparty/_merge.js.map +1 -1
  158. package/dist/thirdparty/isPlainObject.js.map +1 -1
  159. package/dist/thirdparty/merge.js.map +1 -1
  160. package/dist/types/AnimationMode.d.ts +1 -1
  161. package/dist/types/AnimationMode.js +1 -1
  162. package/dist/types/AnimationMode.js.map +1 -1
  163. package/dist/types/CSSColor.d.ts +0 -1
  164. package/dist/types/CSSColor.js +0 -1
  165. package/dist/types/CSSColor.js.map +1 -1
  166. package/dist/types/CalendarType.d.ts +1 -1
  167. package/dist/types/CalendarType.js +1 -1
  168. package/dist/types/CalendarType.js.map +1 -1
  169. package/dist/types/DOMReference.js.map +1 -1
  170. package/dist/types/DataType.js.map +1 -1
  171. package/dist/types/Float.d.ts +0 -1
  172. package/dist/types/Float.js +0 -1
  173. package/dist/types/Float.js.map +1 -1
  174. package/dist/types/Integer.d.ts +0 -1
  175. package/dist/types/Integer.js +0 -1
  176. package/dist/types/Integer.js.map +1 -1
  177. package/dist/types/InvisibleMessageMode.d.ts +1 -1
  178. package/dist/types/InvisibleMessageMode.js +1 -1
  179. package/dist/types/InvisibleMessageMode.js.map +1 -1
  180. package/dist/types/ItemNavigationBehavior.d.ts +1 -1
  181. package/dist/types/ItemNavigationBehavior.js +1 -1
  182. package/dist/types/ItemNavigationBehavior.js.map +1 -1
  183. package/dist/types/NavigationMode.d.ts +1 -1
  184. package/dist/types/NavigationMode.js +1 -1
  185. package/dist/types/NavigationMode.js.map +1 -1
  186. package/dist/types/ValueState.d.ts +1 -1
  187. package/dist/types/ValueState.js +1 -1
  188. package/dist/types/ValueState.js.map +1 -1
  189. package/dist/types.d.ts +1 -1
  190. package/dist/types.js.map +1 -1
  191. package/dist/updateShadowRoot.js +11 -4
  192. package/dist/updateShadowRoot.js.map +1 -1
  193. package/dist/util/AriaLabelHelper.d.ts +10 -1
  194. package/dist/util/AriaLabelHelper.js +135 -8
  195. package/dist/util/AriaLabelHelper.js.map +1 -1
  196. package/dist/util/Caret.js.map +1 -1
  197. package/dist/util/ColorConversion.js.map +1 -1
  198. package/dist/util/FetchHelper.js.map +1 -1
  199. package/dist/util/FocusableElements.js +4 -3
  200. package/dist/util/FocusableElements.js.map +1 -1
  201. package/dist/util/HTMLSanitizer.js.map +1 -1
  202. package/dist/util/InvisibleMessage.js.map +1 -1
  203. package/dist/util/PopupUtils.js.map +1 -1
  204. package/dist/util/SlotsHelper.js.map +1 -1
  205. package/dist/util/StringHelper.js.map +1 -1
  206. package/dist/util/TabbableElements.js.map +1 -1
  207. package/dist/util/arraysAreEqual.js.map +1 -1
  208. package/dist/util/clamp.js.map +1 -1
  209. package/dist/util/createLinkInHead.js.map +1 -1
  210. package/dist/util/createStyleInHead.js.map +1 -1
  211. package/dist/util/debounce.js.map +1 -1
  212. package/dist/util/detectNavigatorLanguage.js.map +1 -1
  213. package/dist/util/escapeRegex.js.map +1 -1
  214. package/dist/util/formatMessage.js.map +1 -1
  215. package/dist/util/generateHighlightedMarkup.js.map +1 -1
  216. package/dist/util/getActiveElement.js.map +1 -1
  217. package/dist/util/getClassCopy.d.ts +9 -9
  218. package/dist/util/getClassCopy.js.map +1 -1
  219. package/dist/util/getDesigntimePropertyAsArray.js.map +1 -1
  220. package/dist/util/getEffectiveContentDensity.js.map +1 -1
  221. package/dist/util/getEffectiveScrollbarStyle.js.map +1 -1
  222. package/dist/util/getFastNavigationGroups.js.map +1 -1
  223. package/dist/util/getFileExtension.js.map +1 -1
  224. package/dist/util/getNormalizedTarget.js.map +1 -1
  225. package/dist/util/getSingletonElementInstance.js.map +1 -1
  226. package/dist/util/isElementClickable.js.map +1 -1
  227. package/dist/util/isElementHidden.js.map +1 -1
  228. package/dist/util/isElementInView.js.map +1 -1
  229. package/dist/util/isElementTabbable.js.map +1 -1
  230. package/dist/util/isValidPropertyName.js.map +1 -1
  231. package/dist/util/whenDOMReady.js.map +1 -1
  232. package/dist/util/willShowContent.js.map +1 -1
  233. package/dist/validateThemeRoot.js +14 -13
  234. package/dist/validateThemeRoot.js.map +1 -1
  235. package/index.js +227 -1
  236. package/lib/generate-asset-parameters/index.js +4 -2
  237. package/lib/generate-styles/index.js +3 -3
  238. package/lib/generate-version-info/index.js +1 -1
  239. package/{package-scripts.js → package-scripts.cjs} +9 -5
  240. package/package.json +5 -4
  241. package/tsconfig.json +3 -1
  242. package/config/wdio.conf.js +0 -1
  243. package/dist/assets/bundle.esm.5c683084.js +0 -56
  244. package/dist/decorators/fastNavigation.d.ts +0 -7
  245. package/dist/decorators/fastNavigation.js +0 -13
  246. package/dist/decorators/fastNavigation.js.map +0 -1
  247. package/dist/decorators/languageAware.d.ts +0 -7
  248. package/dist/decorators/languageAware.js +0 -13
  249. package/dist/decorators/languageAware.js.map +0 -1
  250. package/dist/decorators/themeAware.d.ts +0 -7
  251. package/dist/decorators/themeAware.js +0 -13
  252. package/dist/decorators/themeAware.js.map +0 -1
  253. package/src/AssetRegistry.ts +0 -11
  254. package/src/Boot.ts +0 -61
  255. package/src/CSP.ts +0 -66
  256. package/src/CustomElementsRegistry.ts +0 -98
  257. package/src/CustomElementsScope.ts +0 -33
  258. package/src/CustomElementsScopeUtils.ts +0 -115
  259. package/src/DOMObserver.ts +0 -28
  260. package/src/Device.ts +0 -124
  261. package/src/EventProvider.ts +0 -87
  262. package/src/FeaturesRegistry.ts +0 -14
  263. package/src/FontFace.ts +0 -31
  264. package/src/InitialConfiguration.ts +0 -207
  265. package/src/Keys.ts +0 -295
  266. package/src/ManagedStyles.ts +0 -92
  267. package/src/MarkedEvents.ts +0 -20
  268. package/src/MediaRange.ts +0 -110
  269. package/src/PropertiesFileFormat.ts +0 -95
  270. package/src/Render.ts +0 -180
  271. package/src/RenderQueue.ts +0 -71
  272. package/src/Runtimes.ts +0 -114
  273. package/src/StaticArea.ts +0 -3
  274. package/src/StaticAreaItem.ts +0 -113
  275. package/src/SystemCSSVars.ts +0 -10
  276. package/src/Theming.ts +0 -4
  277. package/src/UI5Element.ts +0 -1156
  278. package/src/UI5ElementMetadata.ts +0 -389
  279. package/src/animations/AnimationQueue.ts +0 -43
  280. package/src/animations/animate.ts +0 -64
  281. package/src/animations/scroll.ts +0 -21
  282. package/src/animations/slideDown.ts +0 -72
  283. package/src/animations/slideUp.ts +0 -67
  284. package/src/asset-registries/Icons.ts +0 -162
  285. package/src/asset-registries/Illustrations.ts +0 -75
  286. package/src/asset-registries/LocaleData.ts +0 -172
  287. package/src/asset-registries/Themes.ts +0 -67
  288. package/src/asset-registries/i18n.ts +0 -118
  289. package/src/assets-meta/IconCollectionsAlias.ts +0 -18
  290. package/src/config/AnimationMode.ts +0 -33
  291. package/src/config/CalendarType.ts +0 -23
  292. package/src/config/FormatSettings.ts +0 -21
  293. package/src/config/Icons.ts +0 -59
  294. package/src/config/Language.ts +0 -72
  295. package/src/config/NoConflict.ts +0 -67
  296. package/src/config/RTL.ts +0 -41
  297. package/src/config/Theme.ts +0 -64
  298. package/src/config/ThemeRoots.ts +0 -41
  299. package/src/decorators/customElement.ts +0 -17
  300. package/src/decorators/event.ts +0 -28
  301. package/src/decorators/fastNavigation.ts +0 -14
  302. package/src/decorators/languageAware.ts +0 -14
  303. package/src/decorators/property.ts +0 -30
  304. package/src/decorators/slot.ts +0 -49
  305. package/src/decorators/themeAware.ts +0 -14
  306. package/src/delegate/ItemNavigation.ts +0 -393
  307. package/src/delegate/ResizeHandler.ts +0 -95
  308. package/src/delegate/ScrollEnablement.ts +0 -224
  309. package/src/features/F6Navigation.ts +0 -141
  310. package/src/features/OpenUI5Element.ts +0 -11
  311. package/src/features/OpenUI5Enablement.ts +0 -117
  312. package/src/features/OpenUI5Support.ts +0 -148
  313. package/src/generated/css/BusyIndicator.css.ts +0 -9
  314. package/src/generated/css/FontFace.css.ts +0 -9
  315. package/src/generated/css/OverrideFontFace.css.ts +0 -9
  316. package/src/generated/css/SystemCSSVars.css.ts +0 -9
  317. package/src/getSharedResource.ts +0 -30
  318. package/src/global.d.ts +0 -38
  319. package/src/i18nBundle.ts +0 -108
  320. package/src/locale/Locale.ts +0 -101
  321. package/src/locale/RTLAwareRegistry.ts +0 -16
  322. package/src/locale/applyDirection.ts +0 -18
  323. package/src/locale/directionChange.ts +0 -34
  324. package/src/locale/getEffectiveDir.ts +0 -28
  325. package/src/locale/getLocale.ts +0 -46
  326. package/src/locale/languageChange.ts +0 -24
  327. package/src/locale/nextFallbackLocale.ts +0 -28
  328. package/src/locale/normalizeLocale.ts +0 -56
  329. package/src/renderer/LitRenderer.ts +0 -60
  330. package/src/renderer/executeTemplate.ts +0 -40
  331. package/src/theming/CustomStyle.ts +0 -62
  332. package/src/theming/ThemeLoaded.ts +0 -24
  333. package/src/theming/applyTheme.ts +0 -90
  334. package/src/theming/getConstructableStyle.ts +0 -31
  335. package/src/theming/getEffectiveLinksHrefs.ts +0 -26
  336. package/src/theming/getEffectiveStyle.ts +0 -41
  337. package/src/theming/getStylesString.ts +0 -15
  338. package/src/theming/getThemeDesignerTheme.ts +0 -101
  339. package/src/theming/preloadLinks.ts +0 -24
  340. package/src/thirdparty/_merge.ts +0 -32
  341. package/src/thirdparty/isPlainObject.ts +0 -18
  342. package/src/thirdparty/merge.ts +0 -5
  343. package/src/types/AnimationMode.ts +0 -33
  344. package/src/types/CSSColor.ts +0 -20
  345. package/src/types/CalendarType.ts +0 -38
  346. package/src/types/DOMReference.ts +0 -28
  347. package/src/types/DataType.ts +0 -51
  348. package/src/types/Float.ts +0 -25
  349. package/src/types/Integer.ts +0 -25
  350. package/src/types/InvisibleMessageMode.ts +0 -27
  351. package/src/types/ItemNavigationBehavior.ts +0 -26
  352. package/src/types/NavigationMode.ts +0 -33
  353. package/src/types/ValueState.ts +0 -47
  354. package/src/types.ts +0 -30
  355. package/src/updateShadowRoot.ts +0 -37
  356. package/src/util/AriaLabelHelper.ts +0 -63
  357. package/src/util/Caret.ts +0 -28
  358. package/src/util/ColorConversion.ts +0 -399
  359. package/src/util/FetchHelper.ts +0 -31
  360. package/src/util/FocusableElements.ts +0 -92
  361. package/src/util/HTMLSanitizer.ts +0 -9
  362. package/src/util/InvisibleMessage.ts +0 -69
  363. package/src/util/PopupUtils.ts +0 -112
  364. package/src/util/SlotsHelper.ts +0 -39
  365. package/src/util/StringHelper.ts +0 -26
  366. package/src/util/TabbableElements.ts +0 -70
  367. package/src/util/arraysAreEqual.ts +0 -15
  368. package/src/util/clamp.ts +0 -12
  369. package/src/util/createLinkInHead.ts +0 -25
  370. package/src/util/createStyleInHead.ts +0 -20
  371. package/src/util/debounce.ts +0 -18
  372. package/src/util/detectNavigatorLanguage.ts +0 -13
  373. package/src/util/escapeRegex.ts +0 -11
  374. package/src/util/formatMessage.ts +0 -24
  375. package/src/util/generateHighlightedMarkup.ts +0 -43
  376. package/src/util/getActiveElement.ts +0 -11
  377. package/src/util/getClassCopy.ts +0 -12
  378. package/src/util/getDesigntimePropertyAsArray.ts +0 -4
  379. package/src/util/getEffectiveContentDensity.ts +0 -5
  380. package/src/util/getEffectiveScrollbarStyle.ts +0 -5
  381. package/src/util/getFastNavigationGroups.ts +0 -63
  382. package/src/util/getFileExtension.ts +0 -21
  383. package/src/util/getNormalizedTarget.ts +0 -16
  384. package/src/util/getSingletonElementInstance.ts +0 -13
  385. package/src/util/isElementClickable.ts +0 -19
  386. package/src/util/isElementHidden.ts +0 -9
  387. package/src/util/isElementInView.ts +0 -15
  388. package/src/util/isElementTabbable.ts +0 -37
  389. package/src/util/isValidPropertyName.ts +0 -29
  390. package/src/util/whenDOMReady.ts +0 -13
  391. package/src/util/willShowContent.ts +0 -7
  392. package/src/validateThemeRoot.ts +0 -58
@@ -1,18 +1,38 @@
1
1
  /**
2
- * Supported icon collection names and aliases.
2
+ * Supported icon collection aliases.
3
3
  *
4
4
  * Users might specify a collection, using both the key and the value in the following key-value pairs,
5
5
  * e.g the following pairs are completely exchangeable:
6
- * "SAP-icons-TNT/actor" and "tnt/actor", "BusinessSuiteInAppSymbols/3d" and "business-suite/3d",
7
- * "SAP-icons-v5/accept" and "horizon/accept".
8
6
  *
9
- * Note: technically, in the code we maintain the collections under the "value" name - "tnt", "business-suite",
10
- * SAP-icons-v5" and "SAP-icons"(which does not have an alias).
7
+ * - "SAP-icons/accept" and "SAP-icons-v4/accept"
8
+ * - "horizon/accept" and "SAP-icons-v5/accept"
9
+ * - "SAP-icons-TNT/actor" and "tnt/actor"
10
+ * - "BusinessSuiteInAppSymbols/3d" and "business-suite/3d"
11
11
  */
12
- const IconCollectionsAlias = {
13
- "SAP-icons-TNT": "tnt",
14
- "BusinessSuiteInAppSymbols": "business-suite",
15
- "horizon": "SAP-icons-v5",
12
+ var IconCollectionsAlias;
13
+ (function (IconCollectionsAlias) {
14
+ IconCollectionsAlias["SAP-icons"] = "SAP-icons-v4";
15
+ IconCollectionsAlias["horizon"] = "SAP-icons-v5";
16
+ IconCollectionsAlias["SAP-icons-TNT"] = "tnt";
17
+ IconCollectionsAlias["BusinessSuiteInAppSymbols"] = "business-suite";
18
+ })(IconCollectionsAlias || (IconCollectionsAlias = {}));
19
+ /**
20
+ * Returns the mapped collection name for a given alias.
21
+ *
22
+ * <b>For example</b>:
23
+ * - "SAP-icons-TNT"resolves to "tnt"
24
+ * - "BusinessSuiteInAppSymbols" resolves to "business-suite"
25
+ * - "horizon" resolves to "SAP-icons-v5"
26
+ *
27
+ * @param { string } collectionName
28
+ * @return { string } the normalized collection name
29
+ */
30
+ const getIconCollectionByAlias = (collectionName) => {
31
+ if (IconCollectionsAlias[collectionName]) {
32
+ return IconCollectionsAlias[collectionName];
33
+ }
34
+ return collectionName;
16
35
  };
17
36
  export default IconCollectionsAlias;
37
+ export { getIconCollectionByAlias, };
18
38
  //# sourceMappingURL=IconCollectionsAlias.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../src/assets-meta/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,MAAM,oBAAoB,GAAG;IAC5B,eAAe,EAAE,KAAK;IACtB,2BAA2B,EAAE,gBAAgB;IAC7C,SAAS,EAAE,cAAc;CACzB,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"IconCollectionsAlias.js","sourceRoot":"","sources":["../../src/assets-meta/IconCollectionsAlias.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,IAAK,oBAKJ;AALD,WAAK,oBAAoB;IACxB,kDAA4B,CAAA;IAC5B,gDAA0B,CAAA;IAC1B,6CAAuB,CAAA;IACvB,oEAA8C,CAAA;AAC/C,CAAC,EALI,oBAAoB,KAApB,oBAAoB,QAKxB;AAED;;;;;;;;;;GAUG;AACH,MAAM,wBAAwB,GAAG,CAAC,cAAsB,EAAE,EAAE;IAC3D,IAAI,oBAAoB,CAAC,cAAmD,CAAC,EAAE;QAC9E,OAAO,oBAAoB,CAAC,cAAmD,CAAC,CAAC;KACjF;IAED,OAAO,cAAc,CAAC;AACvB,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC;AACpC,OAAO,EACN,wBAAwB,GACxB,CAAC","sourcesContent":["/**\n * Supported icon collection aliases.\n *\n * Users might specify a collection, using both the key and the value in the following key-value pairs,\n * e.g the following pairs are completely exchangeable:\n *\n * - \"SAP-icons/accept\" and \"SAP-icons-v4/accept\"\n * - \"horizon/accept\" and \"SAP-icons-v5/accept\"\n * - \"SAP-icons-TNT/actor\" and \"tnt/actor\"\n * - \"BusinessSuiteInAppSymbols/3d\" and \"business-suite/3d\"\n */\nenum IconCollectionsAlias {\n\t\"SAP-icons\" = \"SAP-icons-v4\",\n\t\"horizon\" = \"SAP-icons-v5\",\n\t\"SAP-icons-TNT\" = \"tnt\",\n\t\"BusinessSuiteInAppSymbols\" = \"business-suite\",\n}\n\n/**\n * Returns the mapped collection name for a given alias.\n *\n * <b>For example</b>:\n * - \"SAP-icons-TNT\"resolves to \"tnt\"\n * - \"BusinessSuiteInAppSymbols\" resolves to \"business-suite\"\n * - \"horizon\" resolves to \"SAP-icons-v5\"\n *\n * @param { string } collectionName\n * @return { string } the normalized collection name\n */\nconst getIconCollectionByAlias = (collectionName: string) => {\n\tif (IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias]) {\n\t\treturn IconCollectionsAlias[collectionName as keyof typeof IconCollectionsAlias];\n\t}\n\n\treturn collectionName;\n};\n\nexport default IconCollectionsAlias;\nexport {\n\tgetIconCollectionByAlias,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AnimationMode.js","sourceRoot":"","sources":["../../src/config/AnimationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,IAAI,gBAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,GAAkB,EAAE;IAC5C,IAAI,gBAAgB,KAAK,SAAS,EAAE;QACnC,gBAAgB,GAAG,0BAA0B,EAAE,CAAC;KAChD;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,aAA4B,EAAE,EAAE;IACzD,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;QACzD,gBAAgB,GAAG,aAAa,CAAC;KACjC;AACF,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,CAAC"}
1
+ {"version":3,"file":"AnimationMode.js","sourceRoot":"","sources":["../../src/config/AnimationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,IAAI,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,aAAa,MAAM,2BAA2B,CAAC;AAEtD,IAAI,gBAA+B,CAAC;AAEpC;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,GAAkB,EAAE;IAC5C,IAAI,gBAAgB,KAAK,SAAS,EAAE;QACnC,gBAAgB,GAAG,0BAA0B,EAAE,CAAC;KAChD;IAED,OAAO,gBAAgB,CAAC;AACzB,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,CAAC,aAA4B,EAAE,EAAE;IACzD,IAAI,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;QACzD,gBAAgB,GAAG,aAAa,CAAC;KACjC;AACF,CAAC,CAAC;AAEF,OAAO,EACN,gBAAgB,EAChB,gBAAgB,GAChB,CAAC","sourcesContent":["import { getAnimationMode as getConfiguredAnimationMode } from \"../InitialConfiguration.js\";\nimport AnimationMode from \"../types/AnimationMode.js\";\n\nlet curAnimationMode: AnimationMode;\n\n/**\n * Returns the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @returns { AnimationMode }\n */\nconst getAnimationMode = (): AnimationMode => {\n\tif (curAnimationMode === undefined) {\n\t\tcurAnimationMode = getConfiguredAnimationMode();\n\t}\n\n\treturn curAnimationMode;\n};\n\n/**\n * Sets the animation mode - \"full\", \"basic\", \"minimal\" or \"none\".\n * @public\n * @param { AnimationMode } animationMode\n */\nconst setAnimationMode = (animationMode: AnimationMode) => {\n\tif (Object.values(AnimationMode).includes(animationMode)) {\n\t\tcurAnimationMode = animationMode;\n\t}\n};\n\nexport {\n\tgetAnimationMode,\n\tsetAnimationMode,\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,IAAI,YAAsC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,eAAe,GAAG,GAAiB,EAAE;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,yBAAyB,EAAE,CAAC;KAC3C;IAED,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE;QACjD,OAAO,YAAY,CAAC;KACpB;IAED,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,sBAAsB"}
1
+ {"version":3,"file":"CalendarType.js","sourceRoot":"","sources":["../../src/config/CalendarType.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,eAAe,IAAI,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAE1F,IAAI,YAAsC,CAAC;AAE3C;;;;GAIG;AACH,MAAM,eAAe,GAAG,GAAiB,EAAE;IAC1C,IAAI,YAAY,KAAK,SAAS,EAAE;QAC/B,YAAY,GAAG,yBAAyB,EAAE,CAAC;KAC3C;IAED,IAAI,YAAY,IAAI,YAAY,IAAI,YAAY,EAAE;QACjD,OAAO,YAAY,CAAC;KACpB;IAED,OAAO,YAAY,CAAC,SAAS,CAAC;AAC/B,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC,CAAC,sBAAsB","sourcesContent":["import CalendarType from \"../types/CalendarType.js\";\nimport { getCalendarType as getConfiguredCalendarType } from \"../InitialConfiguration.js\";\n\nlet calendarType: CalendarType | undefined;\n\n/**\n * Returns the configured or default calendar type.\n * @public\n * @returns { CalendarType } the effective calendar type\n */\nconst getCalendarType = (): CalendarType => {\n\tif (calendarType === undefined) {\n\t\tcalendarType = getConfiguredCalendarType();\n\t}\n\n\tif (calendarType && calendarType in CalendarType) {\n\t\treturn calendarType;\n\t}\n\n\treturn CalendarType.Gregorian;\n};\n\nexport { getCalendarType }; // eslint-disable-line\n"]}
@@ -1,5 +1,8 @@
1
+ import LegacyDateFormats from "../features/LegacyDateFormats.js";
2
+ import type { LegacyDateCalendarCustomizing } from "../features/LegacyDateFormats.js";
1
3
  type FormatSettings = {
2
4
  firstDayOfWeek?: number;
5
+ legacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing;
3
6
  };
4
7
  /**
5
8
  * Returns the first day of the week from the configured format settings or based on the current locale.
@@ -7,5 +10,6 @@ type FormatSettings = {
7
10
  * @returns {Number} 0 (Sunday) through 6 (Saturday)
8
11
  */
9
12
  declare const getFirstDayOfWeek: () => number | undefined;
10
- export { getFirstDayOfWeek };
13
+ declare const getLegacyDateCalendarCustomizing: typeof LegacyDateFormats.getLegacyDateCalendarCustomizing;
14
+ export { getFirstDayOfWeek, getLegacyDateCalendarCustomizing, };
11
15
  export type { FormatSettings };
@@ -1,4 +1,6 @@
1
+ import LegacyDateFormats from "../features/LegacyDateFormats.js";
1
2
  import { getFormatSettings } from "../InitialConfiguration.js";
3
+ import { getFeature } from "../FeaturesRegistry.js";
2
4
  let formatSettings;
3
5
  /**
4
6
  * Returns the first day of the week from the configured format settings or based on the current locale.
@@ -11,5 +13,7 @@ const getFirstDayOfWeek = () => {
11
13
  }
12
14
  return formatSettings.firstDayOfWeek;
13
15
  };
14
- export { getFirstDayOfWeek }; // eslint-disable-line
16
+ const legacyDateFormats = getFeature("LegacyDateFormats");
17
+ const getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };
18
+ export { getFirstDayOfWeek, getLegacyDateCalendarCustomizing, };
15
19
  //# sourceMappingURL=FormatSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAI/D,IAAI,cAA8B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;KACrC;IAED,OAAO,cAAc,CAAC,cAAc,CAAC;AACtC,CAAC,CAAC;AAEF,OAAO,EAAE,iBAAiB,EAAE,CAAC,CAAC,sBAAsB"}
1
+ {"version":3,"file":"FormatSettings.js","sourceRoot":"","sources":["../../src/config/FormatSettings.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,kCAAkC,CAAC;AAEjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAOpD,IAAI,cAA8B,CAAC;AAEnC;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,cAAc,KAAK,SAAS,EAAE;QACjC,cAAc,GAAG,iBAAiB,EAAE,CAAC;KACrC;IAED,OAAO,cAAc,CAAC,cAAc,CAAC;AACtC,CAAC,CAAC;AAEF,MAAM,iBAAiB,GAAG,UAAU,CAA2B,mBAAmB,CAAC,CAAC;AAEpF,MAAM,gCAAgC,GAAG,iBAAiB,CAAC,CAAC,CAAC,iBAAiB,CAAC,gCAAgC,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;AAEvI,OAAO,EACN,iBAAiB,EACjB,gCAAgC,GAChC,CAAC","sourcesContent":["import LegacyDateFormats from \"../features/LegacyDateFormats.js\";\nimport type { LegacyDateCalendarCustomizing } from \"../features/LegacyDateFormats.js\";\nimport { getFormatSettings } from \"../InitialConfiguration.js\";\nimport { getFeature } from \"../FeaturesRegistry.js\";\n\ntype FormatSettings = {\n\tfirstDayOfWeek?: number,\n\tlegacyDateCalendarCustomizing?: LegacyDateCalendarCustomizing,\n};\n\nlet formatSettings: FormatSettings;\n\n/**\n * Returns the first day of the week from the configured format settings or based on the current locale.\n * @public\n * @returns {Number} 0 (Sunday) through 6 (Saturday)\n */\nconst getFirstDayOfWeek = (): number | undefined => {\n\tif (formatSettings === undefined) {\n\t\tformatSettings = getFormatSettings();\n\t}\n\n\treturn formatSettings.firstDayOfWeek;\n};\n\nconst legacyDateFormats = getFeature<typeof LegacyDateFormats>(\"LegacyDateFormats\");\n\nconst getLegacyDateCalendarCustomizing = legacyDateFormats ? LegacyDateFormats.getLegacyDateCalendarCustomizing : () => { return []; };\n\nexport {\n\tgetFirstDayOfWeek,\n\tgetLegacyDateCalendarCustomizing,\n};\n\nexport type { FormatSettings };\n"]}
@@ -1,30 +1,55 @@
1
- declare enum IconCollection {
2
- v4 = "SAP-icons",
3
- v5 = "SAP-icons-v5"
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;
2
+ declare enum RegisteredIconCollection {
3
+ SAPIconsV4 = "SAP-icons-v4",
4
+ SAPIconsV5 = "SAP-icons-v5",
5
+ SAPIconsTNTV2 = "tnt-v2",
6
+ SAPIconsTNTV3 = "tnt-v3",
7
+ SAPBSIconsV1 = "business-suite-v1",
8
+ SAPBSIconsV2 = "business-suite-v2"
4
9
  }
5
10
  /**
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.
11
+ * Sets the default icon collection for a given theme.
12
+ *
13
+ * 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)
14
+ * 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.
15
+ * This method allows setting another (built-in or custom) icon collection as default per theme.
16
+ *
17
+ * <b>Usage</b>
18
+ * <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
19
+ *
20
+ * <pre>
21
+ * setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
22
+ *
23
+ * <ui5-icon name="home"></ui5-icon>
24
+ * </pre>
25
+ *
26
+ * <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
27
+ *
28
+ * <pre>
29
+ * setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
30
+ *
31
+ * <ui5-icon name="custom-icon-name"></ui5-icon>
32
+ * </pre>
8
33
  *
9
- * Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
10
34
  * @public
11
- * @param {string} theme
12
- * @param {IconCollection} collectionName
35
+ * @param { string } theme
36
+ * @param { string } collectionName
13
37
  */
14
- declare const setDefaultIconCollection: (theme: string, collectionName: "horizon" | IconCollection) => void;
38
+ declare const setDefaultIconCollection: (theme: string, collectionName: IconCollection) => void;
15
39
  /**
16
- * Returns the default icon collection (v4 or v5) for given theme,
17
- * that is configured.
40
+ * Returns the configured default icon collection for a given theme.
18
41
  *
19
- * @param {string} theme
42
+ * @param { string } theme
20
43
  * @public
21
- * @returns {string | undefined}
44
+ * @returns { string | undefined }
22
45
  */
23
46
  declare const getDefaultIconCollection: (theme: string) => string | undefined;
24
47
  /**
25
- * Returns the effective icon collection that will be applied for icon web components
26
- * whenever namespace is not specified.
27
- * @returns {string}
48
+ * Returns the effective icon collection,
49
+ * based on the default icon collection configuration and the current theme:
50
+ * @param { IconCollection } collectionName
51
+ * @returns { IconCollection } the effective collection name
28
52
  */
29
- declare const getEffectiveDefaultIconCollection: () => string;
30
- export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveDefaultIconCollection, };
53
+ declare const getEffectiveIconCollection: (collectionName?: IconCollection) => IconCollection;
54
+ export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
55
+ export type { IconCollection, };
@@ -1,48 +1,103 @@
1
- import { getTheme, isThemeFamily } from "./Theme.js";
1
+ import { getTheme, isLegacyThemeFamily } from "./Theme.js";
2
+ import { getIconCollectionByAlias } from "../assets-meta/IconCollectionsAlias.js";
2
3
  const IconCollectionConfiguration = new Map();
3
- var IconCollection;
4
- (function (IconCollection) {
5
- IconCollection["v4"] = "SAP-icons";
6
- IconCollection["v5"] = "SAP-icons-v5";
7
- })(IconCollection || (IconCollection = {}));
4
+ // All registered icon collections - all icon collections resolves to these options at the end
5
+ var RegisteredIconCollection;
6
+ (function (RegisteredIconCollection) {
7
+ RegisteredIconCollection["SAPIconsV4"] = "SAP-icons-v4";
8
+ RegisteredIconCollection["SAPIconsV5"] = "SAP-icons-v5";
9
+ RegisteredIconCollection["SAPIconsTNTV2"] = "tnt-v2";
10
+ RegisteredIconCollection["SAPIconsTNTV3"] = "tnt-v3";
11
+ RegisteredIconCollection["SAPBSIconsV1"] = "business-suite-v1";
12
+ RegisteredIconCollection["SAPBSIconsV2"] = "business-suite-v2";
13
+ })(RegisteredIconCollection || (RegisteredIconCollection = {}));
8
14
  /**
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.
15
+ * Sets the default icon collection for a given theme.
16
+ *
17
+ * 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)
18
+ * 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.
19
+ * This method allows setting another (built-in or custom) icon collection as default per theme.
20
+ *
21
+ * <b>Usage</b>
22
+ * <b>For example</b>, to make "SAP-icons version 5.x" the default icon collection in "sap_fiori_3":
23
+ *
24
+ * <pre>
25
+ * setDefaultIconCollection("sap_fiori_3", "SAP-icons-v5");
26
+ *
27
+ * <ui5-icon name="home"></ui5-icon>
28
+ * </pre>
29
+ *
30
+ * <b>For example</b>, to make a custom icon collection (with name "my-custom-collection") the default icon collection in "sap_fiori_3":
31
+ *
32
+ * <pre>
33
+ * setDefaultIconCollection("sap_fiori_3", "my-custom-collection");
34
+ *
35
+ * <ui5-icon name="custom-icon-name"></ui5-icon>
36
+ * </pre>
11
37
  *
12
- * Note: by default SAP-icons-v5 is used in all SAP Horizon variants and SAP-icons-v4 for all the rest.
13
38
  * @public
14
- * @param {string} theme
15
- * @param {IconCollection} collectionName
39
+ * @param { string } theme
40
+ * @param { string } collectionName
16
41
  */
17
42
  const setDefaultIconCollection = (theme, collectionName) => {
18
- if (collectionName === "horizon") {
19
- collectionName = IconCollection.v5;
20
- }
21
43
  IconCollectionConfiguration.set(theme, collectionName);
22
44
  };
23
45
  /**
24
- * Returns the default icon collection (v4 or v5) for given theme,
25
- * that is configured.
46
+ * Returns the configured default icon collection for a given theme.
26
47
  *
27
- * @param {string} theme
48
+ * @param { string } theme
28
49
  * @public
29
- * @returns {string | undefined}
50
+ * @returns { string | undefined }
30
51
  */
31
52
  const getDefaultIconCollection = (theme) => {
32
53
  return IconCollectionConfiguration.get(theme);
33
54
  };
34
55
  /**
35
- * Returns the effective icon collection that will be applied for icon web components
36
- * whenever namespace is not specified.
37
- * @returns {string}
56
+ * Returns the effective icon collection,
57
+ * based on the default icon collection configuration and the current theme:
58
+ * @param { IconCollection } collectionName
59
+ * @returns { IconCollection } the effective collection name
38
60
  */
39
- const getEffectiveDefaultIconCollection = () => {
61
+ const getEffectiveIconCollection = (collectionName) => {
40
62
  const currentTheme = getTheme();
41
63
  const currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);
42
- if (currentThemeConfiguration) {
43
- return currentThemeConfiguration;
64
+ // when no collection is set and default collection is configured - return the configured icon collection
65
+ if (!collectionName && currentThemeConfiguration) {
66
+ return getIconCollectionByAlias(currentThemeConfiguration);
67
+ }
68
+ // when collection is set - return the theme dependant icon collection
69
+ // when collection is not set and there is no default icon collection configured - return theme dependant icon collection
70
+ return getIconCollectionByTheme(collectionName);
71
+ };
72
+ /**
73
+ * Returns the icon theme dependant collection, based on the collection name and current theme as follows:
74
+ *
75
+ * - "no collection" resolves to "SAP-icons-v4" in "Quartz" and "Belize", and to "SAP-icons-v5" in "Horizon" (or as confugred via setDefaultIconCollection)
76
+ * - "SAP-icons-v4" (and its alias "SAP-icons") forces "SAP-icons v4" in any theme and resolves to itself "SAP-icons-v4"
77
+ * - "SAP-icons-v5" (and its alias "horizon") forces "SAP-icons v5" in any theme and resolves to itself "SAP-icons-v5"
78
+ * - "tnt" (and its alias "SAP-icons-TNT") resolves to "tnt-v2" in "Quartz", "Belize", and resolves to "tnt-v3" in "Horizon"
79
+ * - "tnt-v2" forces "TNT icons v2" in any theme and resolves to itself "tnt-v2"
80
+ * - "tnt-v3" forces "TNT icons v3" in any theme and resolves to itself "tnt-v3"
81
+ * - "business-suite" (and its alias "BusinessSuiteInAppSymbols") resolves to "business-suite-v1" in "Quartz", "Belize", and resolves to "business-suite-v2" in "Horizon"
82
+ * - "business-suite-v1" forces "Business Suite icons v1" in any theme and resolves to itself "business-suite-v1"
83
+ * - "business-suite-v2" forces "Business Suite icons v2" in any theme and resolves to itself "business-suite-v2"
84
+ *
85
+ * <b>Note:</b> "SAP-icons-v4", "SAP-icons-v5", "tnt-v2", "tnt-v3", "business-suite-v1" and "business-suite-v2" are just returned
86
+ * @param { IconCollection } collectionName
87
+ * @returns { RegisteredIconCollection } the registered collection name
88
+ */
89
+ const getIconCollectionByTheme = (collectionName) => {
90
+ const legacyThemeFamily = isLegacyThemeFamily();
91
+ if (!collectionName) {
92
+ return legacyThemeFamily ? RegisteredIconCollection.SAPIconsV4 : RegisteredIconCollection.SAPIconsV5;
93
+ }
94
+ if (collectionName === "tnt") {
95
+ return legacyThemeFamily ? RegisteredIconCollection.SAPIconsTNTV2 : RegisteredIconCollection.SAPIconsTNTV3;
96
+ }
97
+ if (collectionName === "business-suite") {
98
+ return legacyThemeFamily ? RegisteredIconCollection.SAPBSIconsV1 : RegisteredIconCollection.SAPBSIconsV2;
44
99
  }
45
- return isThemeFamily("sap_horizon") ? IconCollection.v5 : IconCollection.v4;
100
+ return collectionName;
46
101
  };
47
- export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveDefaultIconCollection, };
102
+ export { setDefaultIconCollection, getDefaultIconCollection, getEffectiveIconCollection, RegisteredIconCollection, };
48
103
  //# 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,IAAI,GAAG,EAAkB,CAAC;AAE9D,IAAK,cAGJ;AAHD,WAAK,cAAc;IAClB,kCAAgB,CAAA;IAChB,qCAAmB,CAAA;AACpB,CAAC,EAHI,cAAc,KAAd,cAAc,QAGlB;AAED;;;;;;;;GAQG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAE,cAA0C,EAAE,EAAE;IAC9F,IAAI,cAAc,KAAK,SAAS,EAAE;QACjC,cAAc,GAAG,cAAc,CAAC,EAAE,CAAC;KACnC;IAED,2BAA2B,CAAC,GAAG,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;AACxD,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,wBAAwB,GAAG,CAAC,KAAa,EAAsB,EAAE;IACtE,OAAO,2BAA2B,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,iCAAiC,GAAG,GAAG,EAAE;IAC9C,MAAM,YAAY,GAAG,QAAQ,EAAE,CAAC;IAChC,MAAM,yBAAyB,GAAG,2BAA2B,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IAEhF,IAAI,yBAAyB,EAAE;QAC9B,OAAO,yBAAyB,CAAC;KACjC;IAED,OAAO,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE,CAAC;AAC7E,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,EACxB,iCAAiC,GACjC,CAAC"}
1
+ {"version":3,"file":"Icons.js","sourceRoot":"","sources":["../../src/config/Icons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;A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BAAiB,CAAC,CAAC,CAAC,wBAAwB,CAAC,UAAU,CAAC,CAAC,CAAC,wBAAwB,CAAC,UAAU,CAAC;KACrG;IAED,IAAI,cAAc,KAAK,KAAK,EAAE;QAC7B,OAAO,iBAAiB,CAAC,CAAC,CAAC,wBAAwB,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAwB,CAAC,aAAa,CAAC;KAC3G;IAED,IAAI,cAAc,KAAK,gBAAgB,EAAE;QACxC,OAAO,iBAAiB,CAAC,CAAC,CAAC,wBAAwB,CAAC,YAAY,CAAC,CAAC,CAAC,wBAAwB,CAAC,YAAY,CAAC;KACzG;IAED,OAAO,cAA0C,CAAC;AACnD,CAAC,CAAC;AAEF,OAAO,EACN,wBAAwB,EACxB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,GACxB,CAAC","sourcesContent":["import { getTheme, isLegacyThemeFamily } from \"./Theme.js\";\nimport { getIconCollectionByAlias } from \"../assets-meta/IconCollectionsAlias.js\";\n\nconst 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// All registered icon collections - all icon collections resolves to these options at the end\nenum RegisteredIconCollection {\n\tSAPIconsV4 = \"SAP-icons-v4\",\n\tSAPIconsV5 = \"SAP-icons-v5\",\n\tSAPIconsTNTV2 = \"tnt-v2\",\n\tSAPIconsTNTV3 = \"tnt-v3\",\n\tSAPBSIconsV1 = \"business-suite-v1\",\n\tSAPBSIconsV2 = \"business-suite-v2\",\n}\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\n/**\n * Returns the effective icon collection,\n * based on the default icon collection configuration and the current theme:\n * @param { IconCollection } collectionName\n * @returns { IconCollection } the effective collection name\n */\nconst getEffectiveIconCollection = (collectionName?: IconCollection): IconCollection => {\n\tconst currentTheme = getTheme();\n\tconst currentThemeConfiguration = IconCollectionConfiguration.get(currentTheme);\n\n\t// when no collection is set and default collection is configured - return the configured icon collection\n\tif (!collectionName && currentThemeConfiguration) {\n\t\treturn getIconCollectionByAlias(currentThemeConfiguration);\n\t}\n\n\t// when collection is set - return the theme dependant icon collection\n\t// when collection is not set and there is no default icon collection configured - return theme dependant icon collection\n\treturn getIconCollectionByTheme(collectionName);\n};\n\n/**\n * Returns the icon theme dependant collection, based on the collection name and current theme as follows:\n *\n * - \"no collection\" resolves to \"SAP-icons-v4\" in \"Quartz\" and \"Belize\", and to \"SAP-icons-v5\" in \"Horizon\" (or as confugred via setDefaultIconCollection)\n * - \"SAP-icons-v4\" (and its alias \"SAP-icons\") forces \"SAP-icons v4\" in any theme and resolves to itself \"SAP-icons-v4\"\n * - \"SAP-icons-v5\" (and its alias \"horizon\") forces \"SAP-icons v5\" in any theme and resolves to itself \"SAP-icons-v5\"\n * - \"tnt\" (and its alias \"SAP-icons-TNT\") resolves to \"tnt-v2\" in \"Quartz\", \"Belize\", and resolves to \"tnt-v3\" in \"Horizon\"\n * - \"tnt-v2\" forces \"TNT icons v2\" in any theme and resolves to itself \"tnt-v2\"\n * - \"tnt-v3\" forces \"TNT icons v3\" in any theme and resolves to itself \"tnt-v3\"\n * - \"business-suite\" (and its alias \"BusinessSuiteInAppSymbols\") resolves to \"business-suite-v1\" in \"Quartz\", \"Belize\", and resolves to \"business-suite-v2\" in \"Horizon\"\n * - \"business-suite-v1\" forces \"Business Suite icons v1\" in any theme and resolves to itself \"business-suite-v1\"\n * - \"business-suite-v2\" forces \"Business Suite icons v2\" in any theme and resolves to itself \"business-suite-v2\"\n *\n * <b>Note:</b> \"SAP-icons-v4\", \"SAP-icons-v5\", \"tnt-v2\", \"tnt-v3\", \"business-suite-v1\" and \"business-suite-v2\" are just returned\n * @param { IconCollection } collectionName\n * @returns { RegisteredIconCollection } the registered collection name\n */\nconst getIconCollectionByTheme = (collectionName?: IconCollection): RegisteredIconCollection => {\n\tconst legacyThemeFamily = isLegacyThemeFamily();\n\n\tif (!collectionName) {\n\t\treturn legacyThemeFamily ? RegisteredIconCollection.SAPIconsV4 : RegisteredIconCollection.SAPIconsV5;\n\t}\n\n\tif (collectionName === \"tnt\") {\n\t\treturn legacyThemeFamily ? RegisteredIconCollection.SAPIconsTNTV2 : RegisteredIconCollection.SAPIconsTNTV3;\n\t}\n\n\tif (collectionName === \"business-suite\") {\n\t\treturn legacyThemeFamily ? RegisteredIconCollection.SAPBSIconsV1 : RegisteredIconCollection.SAPBSIconsV2;\n\t}\n\n\treturn collectionName as RegisteredIconCollection;\n};\n\nexport {\n\tsetDefaultIconCollection,\n\tgetDefaultIconCollection,\n\tgetEffectiveIconCollection,\n\tRegisteredIconCollection,\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,oBAAoB,KAAK,SAAS,EAAE;QACvC,uBAAuB,CA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;;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;;;;GAIG;AACH,MAAM,aAAa,GAAG,GAAmB,EAAE;I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,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,CAAC;AAEF,MAAM,aAAa,GAAG,4BAA4B,CAAC,6B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O,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,GAAW,EAAE;IAC7B,IAAI,QAAQ,KAAK,SAAS,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iguredTheme } 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"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeRoots.js","sourceRoot":"","sources":["../../src/config/ThemeRoots.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,iBAAiB,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,YAAY,IAAI,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,IAAI,SAA6B,CAAC;AAElC,MAAM,YAAY,GAAG,GAAuB,EAAE;IAC7C,IAAI,SAAS,KAAK,SAAS,EAAE;QAC5B,SAAS,GAAG,sBAAsB,EAAE,CAAC;KACrC;IAED,OAAO,SAAS,CAAC;AAClB,CAAC,CAAC;AAEF,MAAM,YAAY,GAAG,CAAC,KAAa,EAAE,YAAoB,EAAE,EAAE;IAC5D,SAAS,GAAG,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAE5C,IAAI,SAAS,EAAE;QACd,6BAA6B,CAAC,KAAK,CAAC,CAAC;KACrC;AACF,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE;IACzC,OAAO,GAAG,YAAY,EAAG,gBAAgB,KAAK,oBAAoB,CAAC,CAAC,4BAA4B;AACjG,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,KAAK,EAAE,KAAa,EAAE,EAAE;IAC7D,MAAM,IAAI,GAAG,QAAQ,CAAC,aAAa,CAAC,gCAAgC,KAAK,IAAI,CAAC,CAAC;IAE/E,IAAI,IAAI,EAAE;QACT,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;KAChC;IAED,MAAM,gBAAgB,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,EAAE,4BAA4B,EAAE,KAAK,EAAE,CAAC,CAAC;AACzF,CAAC,CAAC;AAEF,OAAO,EACN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ead from \"../util/createLinkInHead.js\";\nimport validateThemeRoot from \"../validateThemeRoot.js\";\nimport { getThemeRoot as getConfiguredThemeRoot } from \"../InitialConfiguration.js\";\n\nlet themeRoot: string | undefined;\n\nconst getThemeRoot = (): string | undefined => {\n\tif (themeRoot === undefined) {\n\t\tthemeRoot = getConfiguredThemeRoot();\n\t}\n\n\treturn themeRoot;\n};\n\nconst setThemeRoot = (theme: string, newThemeRoot: string) => {\n\tthemeRoot = validateThemeRoot(newThemeRoot);\n\n\tif (themeRoot) {\n\t\tattachCustomThemeStylesToHead(theme);\n\t}\n};\n\nconst formatThemeLink = (theme: string) => {\n\treturn `${getThemeRoot()!}Base/baseLib/${theme}/css_variables.css`; // theme root is always set.\n};\n\nconst attachCustomThemeStylesToHead = async (theme: string) => {\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, };