@openui5/sap.ui.core 1.139.0 → 1.141.0

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 (372) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +1 -1
  3. package/src/jquery.sap.global.js +1 -1
  4. package/src/jquery.sap.mobile.js +0 -8
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  9. package/src/sap/base/Event.js +1 -1
  10. package/src/sap/base/Eventing.js +1 -1
  11. package/src/sap/base/config.js +1 -1
  12. package/src/sap/base/i18n/Formatting.js +1 -1
  13. package/src/sap/base/i18n/LanguageTag.js +9 -9
  14. package/src/sap/base/i18n/Localization.js +2 -2
  15. package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
  16. package/src/sap/base/security/URLListValidator.js +7 -3
  17. package/src/sap/base/security/encodeURL.js +1 -1
  18. package/src/sap/base/util/resolveReference.js +3 -1
  19. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  20. package/src/sap/base/util/restricted/_castArray.js +1 -1
  21. package/src/sap/base/util/restricted/_compact.js +1 -1
  22. package/src/sap/base/util/restricted/_curry.js +1 -1
  23. package/src/sap/base/util/restricted/_debounce.js +1 -1
  24. package/src/sap/base/util/restricted/_difference.js +1 -1
  25. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  26. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  27. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  28. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  29. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  30. package/src/sap/base/util/restricted/_flatten.js +1 -1
  31. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  32. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  33. package/src/sap/base/util/restricted/_intersection.js +1 -1
  34. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  35. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  36. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  37. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  38. package/src/sap/base/util/restricted/_isNil.js +1 -1
  39. package/src/sap/base/util/restricted/_max.js +1 -1
  40. package/src/sap/base/util/restricted/_merge.js +1 -1
  41. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  42. package/src/sap/base/util/restricted/_min.js +1 -1
  43. package/src/sap/base/util/restricted/_omit.js +1 -1
  44. package/src/sap/base/util/restricted/_pick.js +1 -1
  45. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  46. package/src/sap/base/util/restricted/_throttle.js +1 -1
  47. package/src/sap/base/util/restricted/_toArray.js +1 -1
  48. package/src/sap/base/util/restricted/_union.js +1 -1
  49. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  50. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  51. package/src/sap/base/util/restricted/_uniq.js +1 -1
  52. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  53. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  54. package/src/sap/base/util/restricted/_without.js +1 -1
  55. package/src/sap/base/util/restricted/_xor.js +1 -1
  56. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  57. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  58. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  59. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  60. package/src/sap/ui/Device.js +3 -3
  61. package/src/sap/ui/Global.js +3 -3
  62. package/src/sap/ui/base/BindingParser.js +22 -5
  63. package/src/sap/ui/base/DataType.js +1 -1
  64. package/src/sap/ui/base/Event.js +1 -1
  65. package/src/sap/ui/base/EventProvider.js +1 -1
  66. package/src/sap/ui/base/ExpressionParser.js +5 -1
  67. package/src/sap/ui/base/Interface.js +1 -1
  68. package/src/sap/ui/base/ManagedObject.js +1 -1
  69. package/src/sap/ui/base/ManagedObjectMetadata.js +3 -3
  70. package/src/sap/ui/base/Metadata.js +1 -1
  71. package/src/sap/ui/base/Object.js +1 -1
  72. package/src/sap/ui/base/ObjectPool.js +1 -1
  73. package/src/sap/ui/base/SyncPromise.js +3 -2
  74. package/src/sap/ui/core/.library +3 -3
  75. package/src/sap/ui/core/BusyIndicator.js +1 -1
  76. package/src/sap/ui/core/Component.js +1 -1
  77. package/src/sap/ui/core/ComponentContainer.js +2 -2
  78. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  79. package/src/sap/ui/core/ComponentSupport.js +3 -3
  80. package/src/sap/ui/core/Configuration.js +4 -4
  81. package/src/sap/ui/core/Control.js +1 -1
  82. package/src/sap/ui/core/Core.js +2 -11
  83. package/src/sap/ui/core/CustomData.js +1 -1
  84. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  85. package/src/sap/ui/core/Element.js +3 -3
  86. package/src/sap/ui/core/ElementMetadata.js +1 -1
  87. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  88. package/src/sap/ui/core/EventBus.js +1 -1
  89. package/src/sap/ui/core/Fragment.js +1 -1
  90. package/src/sap/ui/core/HTML.js +1 -1
  91. package/src/sap/ui/core/History.js +1 -1
  92. package/src/sap/ui/core/Icon.js +1 -1
  93. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  94. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  95. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  96. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  97. package/src/sap/ui/core/InvisibleText.js +1 -1
  98. package/src/sap/ui/core/Item.js +1 -1
  99. package/src/sap/ui/core/LabelEnablement.js +1 -1
  100. package/src/sap/ui/core/LayoutData.js +1 -1
  101. package/src/sap/ui/core/Lib.js +50 -140
  102. package/src/sap/ui/core/ListItem.js +1 -1
  103. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  104. package/src/sap/ui/core/Locale.js +7 -7
  105. package/src/sap/ui/core/LocaleData.js +7 -4
  106. package/src/sap/ui/core/Manifest.js +1 -1
  107. package/src/sap/ui/core/Message.js +1 -1
  108. package/src/sap/ui/core/RenderManager.js +1 -1
  109. package/src/sap/ui/core/Renderer.js +1 -1
  110. package/src/sap/ui/core/ResizeHandler.js +1 -1
  111. package/src/sap/ui/core/ScrollBar.js +1 -1
  112. package/src/sap/ui/core/SeparatorItem.js +1 -1
  113. package/src/sap/ui/core/Theming.js +145 -76
  114. package/src/sap/ui/core/Title.js +1 -1
  115. package/src/sap/ui/core/TooltipBase.js +1 -1
  116. package/src/sap/ui/core/UIArea.js +1 -1
  117. package/src/sap/ui/core/UIComponent.js +16 -7
  118. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  119. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  120. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  121. package/src/sap/ui/core/XMLComposite.js +1 -1
  122. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  123. package/src/sap/ui/core/XMLTemplateProcessor.js +1 -1
  124. package/src/sap/ui/core/_IconRegistry.js +19 -39
  125. package/src/sap/ui/core/date/UI5Date.js +1 -1
  126. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  127. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  128. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  129. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  130. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  131. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  132. package/src/sap/ui/core/format/FormatUtils.js +1 -1
  133. package/src/sap/ui/core/format/NumberFormat.js +2 -2
  134. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  135. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  136. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  137. package/src/sap/ui/core/library.js +3 -3
  138. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  139. package/src/sap/ui/core/message/Message.js +1 -1
  140. package/src/sap/ui/core/message/MessageManager.js +1 -1
  141. package/src/sap/ui/core/message/MessageParser.js +1 -1
  142. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  143. package/src/sap/ui/core/messagebundle_ar.properties +26 -11
  144. package/src/sap/ui/core/messagebundle_bg.properties +21 -6
  145. package/src/sap/ui/core/messagebundle_ca.properties +24 -9
  146. package/src/sap/ui/core/messagebundle_cnr.properties +23 -8
  147. package/src/sap/ui/core/messagebundle_cs.properties +24 -9
  148. package/src/sap/ui/core/messagebundle_cy.properties +24 -9
  149. package/src/sap/ui/core/messagebundle_da.properties +21 -6
  150. package/src/sap/ui/core/messagebundle_de.properties +16 -1
  151. package/src/sap/ui/core/messagebundle_el.properties +26 -11
  152. package/src/sap/ui/core/messagebundle_en.properties +24 -9
  153. package/src/sap/ui/core/messagebundle_en_GB.properties +24 -9
  154. package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +24 -9
  155. package/src/sap/ui/core/messagebundle_es.properties +21 -6
  156. package/src/sap/ui/core/messagebundle_es_MX.properties +24 -9
  157. package/src/sap/ui/core/messagebundle_et.properties +31 -16
  158. package/src/sap/ui/core/messagebundle_fi.properties +20 -5
  159. package/src/sap/ui/core/messagebundle_fr.properties +22 -7
  160. package/src/sap/ui/core/messagebundle_fr_CA.properties +20 -5
  161. package/src/sap/ui/core/messagebundle_hi.properties +24 -9
  162. package/src/sap/ui/core/messagebundle_hr.properties +20 -5
  163. package/src/sap/ui/core/messagebundle_hu.properties +23 -8
  164. package/src/sap/ui/core/messagebundle_id.properties +20 -5
  165. package/src/sap/ui/core/messagebundle_it.properties +23 -8
  166. package/src/sap/ui/core/messagebundle_iw.properties +21 -6
  167. package/src/sap/ui/core/messagebundle_ja.properties +19 -4
  168. package/src/sap/ui/core/messagebundle_kk.properties +22 -7
  169. package/src/sap/ui/core/messagebundle_ko.properties +20 -5
  170. package/src/sap/ui/core/messagebundle_lt.properties +20 -5
  171. package/src/sap/ui/core/messagebundle_lv.properties +20 -5
  172. package/src/sap/ui/core/messagebundle_mk.properties +25 -10
  173. package/src/sap/ui/core/messagebundle_ms.properties +24 -9
  174. package/src/sap/ui/core/messagebundle_nl.properties +22 -7
  175. package/src/sap/ui/core/messagebundle_no.properties +22 -7
  176. package/src/sap/ui/core/messagebundle_pl.properties +19 -4
  177. package/src/sap/ui/core/messagebundle_pt.properties +20 -5
  178. package/src/sap/ui/core/messagebundle_pt_PT.properties +18 -3
  179. package/src/sap/ui/core/messagebundle_ro.properties +22 -7
  180. package/src/sap/ui/core/messagebundle_ru.properties +19 -4
  181. package/src/sap/ui/core/messagebundle_sh.properties +23 -8
  182. package/src/sap/ui/core/messagebundle_sk.properties +23 -8
  183. package/src/sap/ui/core/messagebundle_sl.properties +20 -5
  184. package/src/sap/ui/core/messagebundle_sr.properties +23 -8
  185. package/src/sap/ui/core/messagebundle_sv.properties +23 -8
  186. package/src/sap/ui/core/messagebundle_th.properties +20 -5
  187. package/src/sap/ui/core/messagebundle_tr.properties +20 -5
  188. package/src/sap/ui/core/messagebundle_uk.properties +22 -7
  189. package/src/sap/ui/core/messagebundle_vi.properties +18 -3
  190. package/src/sap/ui/core/messagebundle_zh_CN.properties +24 -9
  191. package/src/sap/ui/core/messagebundle_zh_TW.properties +20 -5
  192. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  193. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  194. package/src/sap/ui/core/mvc/JSView.js +1 -1
  195. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  196. package/src/sap/ui/core/mvc/View.js +2 -2
  197. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  198. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  199. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  200. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  201. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  202. package/src/sap/ui/core/routing/History.js +14 -5
  203. package/src/sap/ui/core/routing/Route.js +1 -1
  204. package/src/sap/ui/core/routing/Router.js +19 -1
  205. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  206. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  207. package/src/sap/ui/core/service/Service.js +1 -1
  208. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  209. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  210. package/src/sap/ui/core/support/Plugin.js +1 -1
  211. package/src/sap/ui/core/support/Support.js +1 -1
  212. package/src/sap/ui/core/support/ViewInfo.css +12 -12
  213. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  214. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  215. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  216. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  217. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  218. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  219. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  220. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  221. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +1 -3
  222. package/src/sap/ui/core/support/trace/E2eTraceLib.js +13 -7
  223. package/src/sap/ui/core/themes/base/BrowserScrollbar.less +0 -28
  224. package/src/sap/ui/core/themes/base/ScrollBar.less +4 -0
  225. package/src/sap/ui/core/themes/base/base.less +80 -31
  226. package/src/sap/ui/core/themes/base/global.less +5 -0
  227. package/src/sap/ui/core/themes/base/shared.less +4 -1
  228. package/src/sap/ui/core/themes/base/skeleton.less +7 -3
  229. package/src/sap/ui/core/themes/sap_hcb/LocalBusyIndicator.less +4 -0
  230. package/src/sap/ui/core/themes/sap_hcb/base_LocalBusyIndicator.less +4 -0
  231. package/src/sap/ui/core/themes/sap_hcb/base_ScrollBar.less +4 -0
  232. package/src/sap/ui/core/theming/Parameters.js +729 -754
  233. package/src/sap/ui/core/theming/ThemeHelper.js +0 -77
  234. package/src/sap/ui/core/theming/ThemeManager.js +536 -526
  235. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  236. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  237. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  238. package/src/sap/ui/core/tmpl/Template.js +1 -1
  239. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  240. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  241. package/src/sap/ui/core/util/DraftEnabledMockServer.js +47 -43
  242. package/src/sap/ui/core/util/Export.js +1 -1
  243. package/src/sap/ui/core/util/ExportCell.js +1 -1
  244. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  245. package/src/sap/ui/core/util/ExportRow.js +1 -1
  246. package/src/sap/ui/core/util/ExportType.js +1 -1
  247. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  248. package/src/sap/ui/core/util/File.js +1 -1
  249. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  250. package/src/sap/ui/core/util/MockServer.js +1 -1
  251. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  252. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  253. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  254. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  255. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  256. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  257. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  258. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  259. package/src/sap/ui/core/webc/WebComponent.js +93 -45
  260. package/src/sap/ui/core/webc/WebComponentMetadata.js +40 -6
  261. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  262. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  263. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  264. package/src/sap/ui/debug/ControlTree.js +1 -1
  265. package/src/sap/ui/debug/DebugEnv.js +1 -1
  266. package/src/sap/ui/debug/PropertyList.js +1 -1
  267. package/src/sap/ui/dom/includeStylesheet.js +4 -1
  268. package/src/sap/ui/events/F6Navigation.js +11 -3
  269. package/src/sap/ui/model/ClientModel.js +1 -1
  270. package/src/sap/ui/model/CompositeDataState.js +1 -1
  271. package/src/sap/ui/model/CompositeType.js +1 -1
  272. package/src/sap/ui/model/DataState.js +1 -1
  273. package/src/sap/ui/model/MetaModel.js +1 -1
  274. package/src/sap/ui/model/Model.js +7 -7
  275. package/src/sap/ui/model/SelectionModel.js +1 -1
  276. package/src/sap/ui/model/SimpleType.js +1 -1
  277. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  278. package/src/sap/ui/model/Type.js +1 -1
  279. package/src/sap/ui/model/json/JSONModel.js +1 -1
  280. package/src/sap/ui/model/json/TypedJSONContext.js +16 -0
  281. package/src/sap/ui/model/json/TypedJSONModel.js +16 -0
  282. package/src/sap/ui/model/message/MessageModel.js +1 -1
  283. package/src/sap/ui/model/odata/AnnotationHelper.js +1 -1
  284. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  285. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  286. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  287. package/src/sap/ui/model/odata/ODataMetadata.js +4 -4
  288. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  289. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +33 -80
  290. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +2 -2
  291. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  292. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  293. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  294. package/src/sap/ui/model/odata/type/Date.js +1 -1
  295. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  296. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  297. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  298. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  299. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  300. package/src/sap/ui/model/odata/type/Double.js +1 -1
  301. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  302. package/src/sap/ui/model/odata/type/Int.js +1 -1
  303. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  304. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  305. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  306. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  307. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  308. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  309. package/src/sap/ui/model/odata/type/Single.js +1 -1
  310. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  311. package/src/sap/ui/model/odata/type/String.js +1 -1
  312. package/src/sap/ui/model/odata/type/Time.js +1 -1
  313. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  314. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  315. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  316. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  317. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +2 -2
  318. package/src/sap/ui/model/odata/v2/ODataListBinding.js +2 -2
  319. package/src/sap/ui/model/odata/v2/ODataModel.js +63 -67
  320. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +84 -70
  321. package/src/sap/ui/model/odata/v4/AnnotationHelper.js +11 -7
  322. package/src/sap/ui/model/odata/v4/Context.js +27 -27
  323. package/src/sap/ui/model/odata/v4/ODataBinding.js +44 -28
  324. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +16 -15
  325. package/src/sap/ui/model/odata/v4/ODataListBinding.js +35 -23
  326. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +81 -53
  327. package/src/sap/ui/model/odata/v4/ODataModel.js +40 -24
  328. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +50 -19
  329. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +3 -3
  330. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +14 -14
  331. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +68 -18
  332. package/src/sap/ui/model/odata/v4/lib/_Batch.js +10 -7
  333. package/src/sap/ui/model/odata/v4/lib/_Cache.js +64 -74
  334. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +1 -1
  335. package/src/sap/ui/model/odata/v4/lib/_Helper.js +15 -15
  336. package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +35 -4
  337. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +29 -16
  338. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +2 -2
  339. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  340. package/src/sap/ui/model/type/Boolean.js +1 -1
  341. package/src/sap/ui/model/type/Currency.js +1 -1
  342. package/src/sap/ui/model/type/Date.js +1 -1
  343. package/src/sap/ui/model/type/DateInterval.js +1 -1
  344. package/src/sap/ui/model/type/DateTime.js +1 -1
  345. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  346. package/src/sap/ui/model/type/FileSize.js +1 -1
  347. package/src/sap/ui/model/type/Float.js +1 -1
  348. package/src/sap/ui/model/type/Integer.js +1 -1
  349. package/src/sap/ui/model/type/String.js +1 -1
  350. package/src/sap/ui/model/type/Time.js +1 -1
  351. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  352. package/src/sap/ui/model/type/Unit.js +19 -5
  353. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  354. package/src/sap/ui/performance/XHRInterceptor.js +14 -9
  355. package/src/sap/ui/performance/trace/FESR.js +4 -11
  356. package/src/sap/ui/performance/trace/Passport.js +3 -10
  357. package/src/sap/ui/performance/trace/_InteractionImpl.js +4 -10
  358. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -2
  359. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  360. package/src/sap/ui/test/TestUtils.js +27 -15
  361. package/src/sap/ui/test/generic/TestBase.js +1 -1
  362. package/src/sap/ui/test/generic/Utils.js +6 -6
  363. package/src/sap/ui/test/gherkin/dataTableUtils.js +2 -2
  364. package/src/sap/ui/test/opaQunit.js +3 -0
  365. package/src/sap/ui/thirdparty/caja-html-sanitizer.js +8 -2
  366. package/src/sap/ui/thirdparty/qunit-2.js +4 -1
  367. package/src/sap/ui/util/Mobile.js +0 -9
  368. package/src/sap/ui/util/Storage.js +1 -1
  369. package/src/sap/ui/util/isCrossOriginURL.js +1 -1
  370. package/src/ui5loader.js +1 -1
  371. package/ui5.yaml +0 -1
  372. package/src/sap/ui/core/plugin/LessSupport.js +0 -542
@@ -4,874 +4,849 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- 'sap/ui/core/Lib',
8
7
  'sap/ui/core/Theming',
9
- 'sap/ui/thirdparty/URI',
10
8
  '../Element',
11
9
  'sap/base/future',
12
10
  'sap/base/Log',
13
- 'sap/base/util/extend',
14
11
  'sap/base/util/syncFetch',
15
- 'sap/ui/core/theming/ThemeManager',
16
- './ThemeHelper'
17
- ],
18
- function(Library, Theming, URI, Element, future, Log, extend, syncFetch, ThemeManager, ThemeHelper) {
12
+ 'sap/ui/base/OwnStatics',
13
+ './ThemeManager'
14
+ ], function(
15
+ Theming,
16
+ Element,
17
+ future,
18
+ Log,
19
+ syncFetch,
20
+ OwnStatics,
21
+ ThemeManager
22
+ ) {
19
23
  "use strict";
20
24
 
21
- var syncCallBehavior = sap.ui.loader._.getSyncCallBehavior();
22
-
23
- /**
24
- * A helper used for (read-only) access to CSS parameters at runtime.
25
- *
26
- * @author SAP SE
27
- * @namespace
28
- *
29
- * @public
30
- * @alias sap.ui.core.theming.Parameters
31
- */
32
- var Parameters = {};
33
-
34
- var mParameters = null;
35
- var sTheme = null;
36
-
37
- var aParametersToLoad = [];
38
-
39
- var aCallbackRegistry = [];
40
-
41
- var sBootstrapOrigin = new URI(sap.ui.require.toUrl(""), document.baseURI).origin();
42
- var mOriginsNeedingCredentials = {};
43
-
44
- // match a CSS url
45
- var rCssUrl = /url[\s]*\('?"?([^\'")]*)'?"?\)/;
46
-
47
- var bUseInlineParameters = new URLSearchParams(window.location.search).get("sap-ui-xx-no-inline-theming-parameters") !== "true";
48
-
49
- /**
50
- * Resolves relative URLs in parameter values.
51
- * Only for inline-parameters.
52
- *
53
- * Parameters containing CSS URLs will automatically be resolved to the theme-specific location they originate from.
54
- *
55
- * Example:
56
- * A parameter for the "sap_horizon" theme will be resolved to a libraries "[library path...]/themes/sap_horizon" folder.
57
- * Relative URLs can resolve backwards, too, so given the sample above, a parameter value of <code>url('../my_logo.jpeg')</code>
58
- * will resolve to the "[library path...]/themes" folder.
59
- *
60
- * @param {string} sUrl the relative URL to resolve
61
- * @param {string} sThemeBaseUrl the theme base URL, pointing to the library that contains the parameter
62
- * @returns {string} the resolved URL in CSS URL notation
63
- */
64
- function checkAndResolveRelativeUrl(sUrl, sThemeBaseUrl) {
65
- var aMatch = rCssUrl.exec(sUrl);
66
- if (aMatch) {
67
- var oUri = new URI(aMatch[1]);
68
- if (oUri.is("relative")) {
69
- // Rewrite relative URLs based on the theme base url
70
- // Otherwise they would be relative to the HTML page which is incorrect
71
- var sNormalizedUrl = oUri.absoluteTo(sThemeBaseUrl).normalize().toString();
72
- sUrl = "url('" + sNormalizedUrl + "')";
73
- }
25
+ const syncCallBehavior = sap.ui.loader._.getSyncCallBehavior();
26
+ const { attachChange } = OwnStatics.get(Theming);
27
+ const { getAllLibraryInfoObjects } = OwnStatics.get(ThemeManager);
28
+
29
+ /**
30
+ * A helper used for (read-only) access to CSS parameters at runtime.
31
+ *
32
+ * @author SAP SE
33
+ * @namespace
34
+ *
35
+ * @public
36
+ * @alias sap.ui.core.theming.Parameters
37
+ */
38
+ var Parameters = {};
39
+
40
+ var mParameters = null;
41
+ var sTheme = null;
42
+
43
+ var aParametersToLoad = [...getAllLibraryInfoObjects().keys()];
44
+
45
+ var aCallbackRegistry = [];
46
+
47
+ var sBootstrapOrigin = new URL(sap.ui.require.toUrl(""), document.baseURI).origin;
48
+ var mOriginsNeedingCredentials = {};
49
+
50
+ // match a CSS url
51
+ var rCssUrl = /url[\s]*\('?"?([^\'")]*)'?"?\)/;
52
+
53
+ /**
54
+ * Resolves relative URLs in parameter values.
55
+ * Only for inline-parameters.
56
+ *
57
+ * Parameters containing CSS URLs will automatically be resolved to the theme-specific location they originate from.
58
+ *
59
+ * Example:
60
+ * A parameter for the "sap_horizon" theme will be resolved to a libraries "[library path...]/themes/sap_horizon" folder.
61
+ * Relative URLs can resolve backwards, too, so given the sample above, a parameter value of <code>url('../my_logo.jpeg')</code>
62
+ * will resolve to the "[library path...]/themes" folder.
63
+ *
64
+ * @param {string} sUrl the relative URL to resolve
65
+ * @param {string} sThemeBaseUrl the theme base URL, pointing to the library that contains the parameter
66
+ * @returns {string} the resolved URL in CSS URL notation
67
+ */
68
+ function checkAndResolveRelativeUrl(sUrl, sThemeBaseUrl) {
69
+ function isRelativeUrl(sUrl) {
70
+ if (sUrl.startsWith('//') || /^[a-z][a-z0-9+.-]*:/i.test(sUrl)) {
71
+ return false; // URL definitiv absolut
74
72
  }
75
73
 
76
- return sUrl;
74
+ return true; // URL is relative
77
75
  }
78
76
 
79
- function mergeParameterSet(mCurrent, mNew, sThemeBaseUrl) {
80
- for (var sParam in mNew) {
81
- if (typeof mCurrent[sParam] === "undefined") {
82
- mCurrent[sParam] = checkAndResolveRelativeUrl(mNew[sParam], sThemeBaseUrl);
83
- }
77
+ const aMatch = rCssUrl.exec(sUrl);
78
+ if (aMatch) {
79
+ const oUrl = new URL(aMatch[1], sThemeBaseUrl);
80
+ if (isRelativeUrl(aMatch[1])) {
81
+ // Rewrite relative URLs based on the theme base url
82
+ const sNormalizedUrl = oUrl.href;
83
+ sUrl = "url('" + sNormalizedUrl + "')";
84
84
  }
85
- return mCurrent;
86
85
  }
87
86
 
88
- function mergeParameters(mNewParameters, sThemeBaseUrl) {
87
+ return sUrl;
88
+ }
89
89
 
90
- // normalize parameter maps
91
- // scoped themes like sap_belize already provide nested objects:
92
- if (typeof mNewParameters["default"] !== "object") {
93
- mNewParameters = {
94
- "default": mNewParameters,
95
- "scopes": {}
96
- };
90
+ function mergeParameterSet(mCurrent, mNew, sThemeBaseUrl) {
91
+ for (var sParam in mNew) {
92
+ if (typeof mCurrent[sParam] === "undefined") {
93
+ mCurrent[sParam] = checkAndResolveRelativeUrl(mNew[sParam], sThemeBaseUrl);
97
94
  }
95
+ }
96
+ return mCurrent;
97
+ }
98
98
 
99
- // ensure parameters objects
100
- mParameters = mParameters || {};
101
- mParameters["default"] = mParameters["default"] || {};
102
- mParameters["scopes"] = mParameters["scopes"] || {};
103
-
104
- // merge default parameters
105
- mergeParameterSet(mParameters["default"], mNewParameters["default"], sThemeBaseUrl);
106
-
107
- // merge scopes
108
- if (typeof mNewParameters["scopes"] === "object") {
109
- for (var sScopeName in mNewParameters["scopes"]) {
110
- // ensure scope object
111
- mParameters["scopes"][sScopeName] = mParameters["scopes"][sScopeName] || {};
112
- // merge scope set
113
- mergeParameterSet(mParameters["scopes"][sScopeName], mNewParameters["scopes"][sScopeName], sThemeBaseUrl);
114
- }
99
+ function mergeParameters(mNewParameters, sThemeBaseUrl) {
100
+
101
+ // normalize parameter maps
102
+ // scoped themes like sap_belize already provide nested objects:
103
+ if (typeof mNewParameters["default"] !== "object") {
104
+ mNewParameters = {
105
+ "default": mNewParameters,
106
+ "scopes": {}
107
+ };
108
+ }
109
+
110
+ // ensure parameters objects
111
+ mParameters = mParameters || {};
112
+ mParameters["default"] = mParameters["default"] || {};
113
+ mParameters["scopes"] = mParameters["scopes"] || {};
114
+
115
+ // merge default parameters
116
+ mergeParameterSet(mParameters["default"], mNewParameters["default"], sThemeBaseUrl);
117
+
118
+ // merge scopes
119
+ if (typeof mNewParameters["scopes"] === "object") {
120
+ for (var sScopeName in mNewParameters["scopes"]) {
121
+ // ensure scope object
122
+ mParameters["scopes"][sScopeName] = mParameters["scopes"][sScopeName] || {};
123
+ // merge scope set
124
+ mergeParameterSet(mParameters["scopes"][sScopeName], mNewParameters["scopes"][sScopeName], sThemeBaseUrl);
115
125
  }
116
126
  }
127
+ }
117
128
 
118
- function forEachStyleSheet(fnCallback) {
119
- document.querySelectorAll("link[id^=sap-ui-theme-]").forEach(function(linkNode) {
120
- fnCallback(linkNode.getAttribute("id"));
121
- });
129
+ function forEachStyleSheet(fnCallback) {
130
+ for (const [libId, libInfo] of getAllLibraryInfoObjects()) {
131
+ fnCallback(libId, libInfo);
122
132
  }
133
+ }
123
134
 
124
- function parseParameters(sId, bAsync) {
125
- var oUrl = getThemeBaseUrlForId(sId);
135
+ function parseParameters(libInfo, bAsync) {
136
+ var oUrl = getThemeBaseUrlForId(libInfo);
126
137
 
127
- var bThemeApplied = ThemeHelper.checkAndRemoveStyle({ id: sId });
138
+ var bThemeApplied = libInfo.finishedLoading;
128
139
 
129
- if (!bThemeApplied && !bAsync) {
130
- Log.warning("Parameters have been requested but theme is not applied, yet.", "sap.ui.core.theming.Parameters");
131
- }
140
+ if (!bThemeApplied && !bAsync) {
141
+ Log.warning("Parameters have been requested but theme is not applied, yet.", "sap.ui.core.theming.Parameters");
142
+ }
132
143
 
133
- // In some browsers (e.g. Safari) it might happen that after switching the theme or adopting the <link>'s href,
134
- // the parameters from the previous stylesheet are taken. This can be prevented by checking whether the theme is applied.
135
- if (bThemeApplied && bUseInlineParameters) {
136
- var oLink = document.getElementById(sId);
137
- var sDataUri = window.getComputedStyle(oLink).getPropertyValue("background-image");
138
- var aParams = /\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(sDataUri);
139
- if (aParams && aParams.length >= 2) {
140
- var sParams = aParams[1];
141
- // decode only if necessary
142
- if (sParams.charAt(0) !== "{" && sParams.charAt(sParams.length - 1) !== "}") {
143
- try {
144
- sParams = decodeURIComponent(sParams);
145
- } catch (ex) {
146
- future.warningThrows("Could not decode theme parameters URI from " + oUrl.styleSheetUrl, { cause: ex });
147
- }
148
- }
144
+ // In some browsers (e.g. Safari) it might happen that after switching the theme or adopting the <link>'s href,
145
+ // the parameters from the previous stylesheet are taken. This can be prevented by checking whether the theme is applied.
146
+ if (bThemeApplied) {
147
+ var oLink = document.getElementById(libInfo.linkId);
148
+ var sDataUri = window.getComputedStyle(oLink).getPropertyValue("background-image");
149
+ var aParams = /\(["']?data:text\/plain;utf-8,(.*?)['"]?\)$/i.exec(sDataUri);
150
+ if (aParams && aParams.length >= 2) {
151
+ var sParams = aParams[1];
152
+ // decode only if necessary
153
+ if (sParams.charAt(0) !== "{" && sParams.charAt(sParams.length - 1) !== "}") {
149
154
  try {
150
- var oParams = JSON.parse(sParams);
151
- mergeParameters(oParams, oUrl.themeBaseUrl);
152
- return true; // parameters successfully parsed
155
+ sParams = decodeURIComponent(sParams);
153
156
  } catch (ex) {
154
- future.warningThrows("Could not parse theme parameters from " + oUrl.styleSheetUrl + ".", { cause: ex , suffix: "Loading library-parameters.json as fallback solution." });
157
+ future.warningThrows("Could not decode theme parameters URI from " + oUrl.styleSheetUrl, { cause: ex });
155
158
  }
156
159
  }
160
+ try {
161
+ var oParams = JSON.parse(sParams);
162
+ mergeParameters(oParams, oUrl.themeBaseUrl);
163
+ return true; // parameters successfully parsed
164
+ } catch (ex) {
165
+ future.warningThrows("Could not parse theme parameters from " + oUrl.styleSheetUrl + ".", { cause: ex , suffix: "Loading library-parameters.json as fallback solution." });
166
+ }
157
167
  }
158
- // sync: return false if parameter could not be parsed OR theme is not applied OR library has no parameters
159
- // For sync path this triggers a sync library-parameters.json request as fallback
160
- // async: always return bThemeApplied. Issues during parsing are not relevant for further processing because
161
- // there is no fallback as in the sync case
162
- return bAsync ? bThemeApplied : false;
163
168
  }
169
+ // sync: return false if parameter could not be parsed OR theme is not applied OR library has no parameters
170
+ // For sync path this triggers a sync library-parameters.json request as fallback
171
+ // async: always return bThemeApplied. Issues during parsing are not relevant for further processing because
172
+ // there is no fallback as in the sync case
173
+ return bAsync ? bThemeApplied : false;
174
+ }
175
+
176
+ /**
177
+ * Load parameters for a library/theme combination as identified by the URL of the library.css
178
+ * @param {object} libInfo Library info object from ThemeManager
179
+ */
180
+ function loadParameters(libInfo) {
181
+ var oUrl = getThemeBaseUrlForId(libInfo);
182
+
183
+ // try to parse the inline-parameters for the given library
184
+ // this may fail for a number of reasons, see below
185
+ if (!parseParameters(libInfo)) {
186
+ // derive parameter file URL from CSS file URL
187
+ // $1: name of library (incl. variants)
188
+ // $2: additional parameters, e.g. for sap-ui-merged, version/sap-ui-dist-version
189
+ var sUrl = oUrl.styleSheetUrl.replace(/\/(?:css_variables|library)([^\/.]*)\.(?:css|less)($|[?#])/, function($0, $1, $2) {
190
+ return "/library-parameters.json" + ($2 ? $2 : "");
191
+ });
164
192
 
165
- /**
166
- * Load parameters for a library/theme combination as identified by the URL of the library.css
167
- * @param {string} sId the library name for which parameters might be loaded
168
- */
169
- function loadParameters(sId) {
170
- var oUrl = getThemeBaseUrlForId(sId);
171
-
172
- // try to parse the inline-parameters for the given library
173
- // this may fail for a number of reasons, see below
174
- if (!parseParameters(sId)) {
175
- // derive parameter file URL from CSS file URL
176
- // $1: name of library (incl. variants)
177
- // $2: additional parameters, e.g. for sap-ui-merged, version/sap-ui-dist-version
178
- var sUrl = oUrl.styleSheetUrl.replace(/\/(?:css_variables|library)([^\/.]*)\.(?:css|less)($|[?#])/, function($0, $1, $2) {
179
- return "/library-parameters.json" + ($2 ? $2 : "");
180
- });
181
-
182
- if (syncCallBehavior === 2) {
183
- Log.error("[nosync] Loading library-parameters.json ignored", sUrl, "sap.ui.core.theming.Parameters");
184
- return;
185
- } else if (syncCallBehavior === 1) {
186
- Log.error("[nosync] Loading library-parameters.json with sync XHR", sUrl, "sap.ui.core.theming.Parameters");
187
- }
193
+ if (syncCallBehavior === 2) {
194
+ Log.error("[nosync] Loading library-parameters.json ignored", sUrl, "sap.ui.core.theming.Parameters");
195
+ return;
196
+ } else if (syncCallBehavior === 1) {
197
+ Log.error("[nosync] Loading library-parameters.json with sync XHR", sUrl, "sap.ui.core.theming.Parameters");
198
+ }
188
199
 
189
- // check if we need to send credentials
190
- var sThemeOrigin = new URI(oUrl.themeBaseUrl).origin();
191
- var bWithCredentials = mOriginsNeedingCredentials[sThemeOrigin];
192
- var aWithCredentials = [];
193
-
194
- // initially we don't have any information if the target origin needs credentials or not ...
195
- if (bWithCredentials === undefined) {
196
- // ... so we assume that for all cross-origins except the UI5 bootstrap we need credentials.
197
- // Setting the XHR's "withCredentials" flag does not do anything for same origin requests.
198
- if (sUrl.startsWith(sBootstrapOrigin)) {
199
- aWithCredentials = [false, true];
200
- } else {
201
- aWithCredentials = [true, false];
202
- }
200
+ // check if we need to send credentials
201
+ // Note: sThemeBaseUrl must always be absolute, as it's derived from libInfo.getUrl().baseUrl which returns absolute URLs.
202
+ // If this fails, there's an error in the URL construction logic upstream.
203
+ const sThemeOrigin = new URL(oUrl.themeBaseUrl).origin;
204
+ var bWithCredentials = mOriginsNeedingCredentials[sThemeOrigin];
205
+ var aWithCredentials = [];
206
+
207
+ // initially we don't have any information if the target origin needs credentials or not ...
208
+ if (bWithCredentials === undefined) {
209
+ // ... so we assume that for all cross-origins except the UI5 bootstrap we need credentials.
210
+ // Setting the XHR's "withCredentials" flag does not do anything for same origin requests.
211
+ if (sUrl.startsWith(sBootstrapOrigin)) {
212
+ aWithCredentials = [false, true];
203
213
  } else {
204
- aWithCredentials = [bWithCredentials];
214
+ aWithCredentials = [true, false];
205
215
  }
206
-
207
- // trigger a sync. loading of the parameters.json file
208
- loadParametersJSON(sUrl, oUrl.themeBaseUrl, aWithCredentials);
216
+ } else {
217
+ aWithCredentials = [bWithCredentials];
209
218
  }
219
+
220
+ // trigger a sync. loading of the parameters.json file
221
+ loadParametersJSON(sUrl, oUrl.themeBaseUrl, aWithCredentials);
210
222
  }
223
+ }
211
224
 
212
- function getThemeBaseUrlForId (sId) {
213
- // read inline parameters from css style rule
214
- // (can be switched off for testing purposes via private URI parameter "sap-ui-xx-no-inline-theming-parameters=true")
215
- var oLink = document.getElementById(sId);
225
+ function getThemeBaseUrlForId (libInfo) {
226
+ if (!libInfo.getUrl().url && !libInfo.cssLinkElement) {
227
+ future.warningThrows(`sap.ui.core.theming.Parameters: Could not find stylesheet element with ID "${libInfo.id}"`);
228
+ return undefined;
229
+ }
216
230
 
217
- if (!oLink) {
218
- future.warningThrows(`sap.ui.core.theming.Parameters: Could not find stylesheet element with ID "${sId}"`);
219
- return undefined;
220
- }
231
+ var sStyleSheetUrl = libInfo.getUrl().url || libInfo.cssLinkElement?.getAttribute("href");
232
+ // The baseUrl from libInfo.getUrl() returns an absolute URL without query parameters or fragments.
233
+ // To derive the theme base directory, we only need to remove the filename portion after the last "/"
234
+ // (e.g., "https://example.com/resources/sap/ui/core/themes/base/library.css" → "https://example.com/resources/sap/ui/core/themes/base/")
235
+ const sThemeBaseUrl = libInfo.getUrl().baseUrl.replace(/\/[^\/]*$/, '/');
221
236
 
222
- var sStyleSheetUrl = oLink.href;
237
+ // Remove CSS file name and query to create theme base url (to resolve relative urls)
238
+ return {
239
+ themeBaseUrl: sThemeBaseUrl,
240
+ styleSheetUrl : sStyleSheetUrl
241
+ };
242
+ }
243
+
244
+ /**
245
+ * Loads a parameters.json file from given URL.
246
+ * @param {string} sUrl URL
247
+ * @param {string} sThemeBaseUrl Base URL
248
+ * @param {boolean[]} aWithCredentials probing values for requesting with or without credentials
249
+ */
250
+ function loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials) {
251
+ var oHeaders = {
252
+ Accept: syncFetch.ContentTypes.JSON
253
+ };
223
254
 
224
- // Remove CSS file name and query to create theme base url (to resolve relative urls)
225
- return {
226
- themeBaseUrl: new URI(sStyleSheetUrl).filename("").query("").toString(),
227
- styleSheetUrl : sStyleSheetUrl
228
- };
255
+ var bCurrentWithCredentials = aWithCredentials.shift();
256
+ if (bCurrentWithCredentials) {
257
+ // the X-Requested-With Header is essential for the Theming-Service to determine if a GET request will be handled
258
+ // This forces a preflight request which should give us valid Allow headers:
259
+ // Access-Control-Allow-Origin: ... fully qualified requestor origin ...
260
+ // Access-Control-Allow-Credentials: true
261
+ oHeaders["X-Requested-With"] = "XMLHttpRequest";
229
262
  }
230
263
 
231
- /**
232
- * Loads a parameters.json file from given URL.
233
- * @param {string} sUrl URL
234
- * @param {string} sThemeBaseUrl Base URL
235
- * @param {boolean[]} aWithCredentials probing values for requesting with or without credentials
236
- */
237
- function loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials) {
238
- var oHeaders = {
239
- Accept: syncFetch.ContentTypes.JSON
240
- };
241
-
242
- var bCurrentWithCredentials = aWithCredentials.shift();
243
- if (bCurrentWithCredentials) {
244
- // the X-Requested-With Header is essential for the Theming-Service to determine if a GET request will be handled
245
- // This forces a preflight request which should give us valid Allow headers:
246
- // Access-Control-Allow-Origin: ... fully qualified requestor origin ...
247
- // Access-Control-Allow-Credentials: true
248
- oHeaders["X-Requested-With"] = "XMLHttpRequest";
249
- }
250
-
251
- function fnErrorCallback(error) {
252
- // ignore failure at least temporarily as long as there are libraries built using outdated tools which produce no json file
253
- future.errorThrows("Could not load theme parameters from: " + sUrl, { cause: error }); // could be an error as well, but let's avoid more CSN messages...
254
-
255
- if (aWithCredentials.length > 0) {
256
- // In a CORS scenario, IF we have sent credentials on the first try AND the request failed,
257
- // we expect that a service could have answered with the following Allow header:
258
- // Access-Control-Allow-Origin: *
259
- // In this case we must not send credentials, otherwise the service would have answered with:
260
- // Access-Control-Allow-Origin: https://...
261
- // Access-Control-Allow-Credentials: true
262
- // Due to security constraints, the browser does not hand out any more information in a CORS scenario,
263
- // so now we try again without credentials.
264
- Log.warning("Initial library-parameters.json request failed ('withCredentials=" + bCurrentWithCredentials + "'; sUrl: '" + sUrl + "').\n" +
265
- "Retrying with 'withCredentials=" + !bCurrentWithCredentials + "'.", "sap.ui.core.theming.Parameters");
266
- loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials);
267
- }
264
+ function fnErrorCallback(error) {
265
+ // ignore failure at least temporarily as long as there are libraries built using outdated tools which produce no json file
266
+ future.errorThrows("Could not load theme parameters from: " + sUrl, { cause: error }); // could be an error as well, but let's avoid more CSN messages...
267
+
268
+ if (aWithCredentials.length > 0) {
269
+ // In a CORS scenario, IF we have sent credentials on the first try AND the request failed,
270
+ // we expect that a service could have answered with the following Allow header:
271
+ // Access-Control-Allow-Origin: *
272
+ // In this case we must not send credentials, otherwise the service would have answered with:
273
+ // Access-Control-Allow-Origin: https://...
274
+ // Access-Control-Allow-Credentials: true
275
+ // Due to security constraints, the browser does not hand out any more information in a CORS scenario,
276
+ // so now we try again without credentials.
277
+ Log.warning("Initial library-parameters.json request failed ('withCredentials=" + bCurrentWithCredentials + "'; sUrl: '" + sUrl + "').\n" +
278
+ "Retrying with 'withCredentials=" + !bCurrentWithCredentials + "'.", "sap.ui.core.theming.Parameters");
279
+ loadParametersJSON(sUrl, sThemeBaseUrl, aWithCredentials);
268
280
  }
281
+ }
269
282
 
270
- // load and evaluate parameter file
271
- try {
272
- var response = syncFetch(sUrl, {
273
- credentials: bCurrentWithCredentials ? "include" : "omit",
274
- headers: oHeaders
275
- });
276
- if (response.ok) {
277
- var data = response.json();
278
- // Once we have a successful request we track the credentials setting for this origin
279
- var sThemeOrigin = new URI(sThemeBaseUrl).origin();
280
- mOriginsNeedingCredentials[sThemeOrigin] = bCurrentWithCredentials;
281
-
282
- if (Array.isArray(data)) {
283
- // in the sap-ui-merged use case, multiple JSON files are merged into and transferred as a single JSON array
284
- for (var j = 0; j < data.length; j++) {
285
- var oParams = data[j];
286
- mergeParameters(oParams, sThemeBaseUrl);
287
- }
288
- } else {
289
- mergeParameters(data, sThemeBaseUrl);
283
+ // load and evaluate parameter file
284
+ try {
285
+ var response = syncFetch(sUrl, {
286
+ credentials: bCurrentWithCredentials ? "include" : "omit",
287
+ headers: oHeaders
288
+ });
289
+ if (response.ok) {
290
+ var data = response.json();
291
+ // Note: sThemeBaseUrl must always be absolute, as it's derived from libInfo.getUrl().baseUrl which returns absolute URLs.
292
+ // If this fails, there's an error in the URL construction logic upstream.
293
+ const sThemeOrigin = new URL(sThemeBaseUrl).origin;
294
+ // Once we have a successful request we track the credentials setting for this origin
295
+ mOriginsNeedingCredentials[sThemeOrigin] = bCurrentWithCredentials;
296
+
297
+ if (Array.isArray(data)) {
298
+ // in the sap-ui-merged use case, multiple JSON files are merged into and transferred as a single JSON array
299
+ for (var j = 0; j < data.length; j++) {
300
+ var oParams = data[j];
301
+ mergeParameters(oParams, sThemeBaseUrl);
290
302
  }
291
303
  } else {
292
- throw new Error(response.statusText || response.status);
304
+ mergeParameters(data, sThemeBaseUrl);
293
305
  }
294
-
295
- } catch (error) {
296
- fnErrorCallback(error);
297
- }
298
- }
299
-
300
- /**
301
- * Retrieves a map containing all inline-parameters.
302
- *
303
- * @param {boolean} bAsync=undefined whether to load and parse the parameters asynchronously, default sync
304
- * @returns {object} a map of all parameters
305
- */
306
- function getParameters(bAsync) {
307
- // Initial loading
308
- if (!mParameters) {
309
- // Merge an empty parameter set to initialize the internal object
310
- mergeParameters({}, "");
311
-
312
- forEachStyleSheet(function (sId) {
313
- if (bAsync) {
314
- if (!parseParameters(sId, bAsync)) {
315
- aParametersToLoad.push(sId);
316
- }
317
- } else {
318
- loadParameters(sId);
319
- }
320
- });
306
+ } else {
307
+ throw new Error(response.statusText || response.status);
321
308
  }
322
309
 
323
- return mParameters;
310
+ } catch (error) {
311
+ fnErrorCallback(error);
324
312
  }
325
-
326
- function parsePendingLibraryParameters() {
327
- var aPendingThemes = [];
328
-
329
- aParametersToLoad.forEach(function (sId) {
330
- // Try to parse parameters (in case theme is already applied). Else keep parameter ID for later
331
- if (!parseParameters(sId, /*bAsync=*/true)) {
332
- aPendingThemes.push(sId);
313
+ }
314
+
315
+ /**
316
+ * Retrieves a map containing all inline-parameters.
317
+ *
318
+ * @param {boolean} bAsync=undefined whether to load and parse the parameters asynchronously, default sync
319
+ * @returns {object} a map of all parameters
320
+ */
321
+ function getParameters(bAsync) {
322
+ // Initial loading
323
+ if (!mParameters) {
324
+ // Merge an empty parameter set to initialize the internal object
325
+ mergeParameters({}, "");
326
+
327
+ forEachStyleSheet(function (libId, libInfo) {
328
+ if (bAsync) {
329
+ if (!parseParameters(libInfo, bAsync)) {
330
+ aParametersToLoad.push(libId);
331
+ }
332
+ } else {
333
+ loadParameters(libInfo);
333
334
  }
334
335
  });
335
-
336
- // Keep theme IDs which are not ready for later
337
- aParametersToLoad = aPendingThemes;
338
336
  }
339
337
 
340
- /**
341
- * Loads library-parameters.json files if some libraries are missing.
342
- */
343
- function loadPendingLibraryParameters() {
344
- // lazy loading of further library parameters
345
- aParametersToLoad.forEach(loadParameters);
346
-
347
- // clear queue
348
- aParametersToLoad = [];
349
- }
338
+ return mParameters;
339
+ }
350
340
 
351
- /**
352
- * Called by the Core when a new library and its stylesheet have been loaded.
353
- * Must be called AFTER a link-tag (with id: "sap-ui-theme" + sLibName) for the theme has been created.
354
- * @param {string} sLibId id of theme link-tag
355
- * @private
356
- */
357
- Parameters._addLibraryTheme = function(sLibId) {
358
- // only queue new libraries if some have been loaded already
359
- // otherwise they will be loaded when the first one requests a parameter
360
- // see "Parameters.get" for lazy loading of queued library parameters
361
- if (mParameters) {
362
- aParametersToLoad.push("sap-ui-theme-" + sLibId);
363
- }
364
- };
341
+ function parsePendingLibraryParameters() {
342
+ var aPendingThemes = [];
365
343
 
366
- /**
367
- * Returns parameter value from given map and handles legacy parameter names
368
- *
369
- * @param {object} mOptions options map
370
- * @param {string} mOptions.parameterName Parameter name / key
371
- * @param {string} mOptions.scopeName Scope name
372
- * @param {boolean} mOptions.loadPendingParameters If set to "true" and no parameter value is found,
373
- * all pending parameters will be loaded (see Parameters._addLibraryTheme)
374
- * @param {boolean} mOptions.async whether the parameter value should be retrieved asynchronous
375
- * @returns {string|undefined} parameter value or undefined
376
- * @private
377
- */
378
- function getParam(mOptions) {
379
- var bAsync = mOptions.async, oParams = getParameters(bAsync);
380
- if (mOptions.scopeName) {
381
- oParams = oParams["scopes"][mOptions.scopeName];
382
- } else {
383
- oParams = oParams["default"];
344
+ aParametersToLoad.forEach(function (sId) {
345
+ // Try to parse parameters (in case theme is already applied). Else keep parameter ID for later
346
+ if (!parseParameters(getAllLibraryInfoObjects(sId), /*bAsync=*/true)) {
347
+ aPendingThemes.push(sId);
384
348
  }
349
+ });
350
+
351
+ // Keep theme IDs which are not ready for later
352
+ aParametersToLoad = aPendingThemes;
353
+ }
354
+
355
+ /**
356
+ * Loads library-parameters.json files if some libraries are missing.
357
+ */
358
+ function loadPendingLibraryParameters() {
359
+ // lazy loading of further library parameters
360
+ aParametersToLoad.map((id) => getAllLibraryInfoObjects(id)).forEach(loadParameters);
361
+
362
+ // clear queue
363
+ aParametersToLoad = [];
364
+ }
365
+
366
+ /**
367
+ * Called by the Core when a new library and its stylesheet have been loaded.
368
+ * Must be called AFTER a link-tag (with id: "sap-ui-theme" + sLibName) for the theme has been created.
369
+ * @param {string} sLibId id of theme link-tag
370
+ * @private
371
+ */
372
+ Parameters._addLibraryTheme = function(sLibId) {
373
+ aParametersToLoad.push(sLibId);
374
+ };
375
+
376
+ /**
377
+ * Returns parameter value from given map and handles legacy parameter names
378
+ *
379
+ * @param {object} mOptions options map
380
+ * @param {string} mOptions.parameterName Parameter name / key
381
+ * @param {string} mOptions.scopeName Scope name
382
+ * @param {boolean} mOptions.loadPendingParameters If set to "true" and no parameter value is found,
383
+ * all pending parameters will be loaded (see Parameters._addLibraryTheme)
384
+ * @param {boolean} mOptions.async whether the parameter value should be retrieved asynchronous
385
+ * @returns {string|undefined} parameter value or undefined
386
+ * @private
387
+ */
388
+ function getParam(mOptions) {
389
+ var bAsync = mOptions.async, oParams = getParameters(bAsync);
390
+ if (mOptions.scopeName) {
391
+ oParams = oParams["scopes"][mOptions.scopeName];
392
+ } else {
393
+ oParams = oParams["default"];
394
+ }
385
395
 
386
- var sParamValue = oParams[mOptions.parameterName];
396
+ var sParamValue = oParams[mOptions.parameterName];
387
397
 
388
- // [Compatibility]: if a parameter contains a prefix, we cut off the ":" and try again
389
- // e.g. "my.lib:paramName"
390
- if (!sParamValue) {
391
- var iIndex = mOptions.parameterName.indexOf(":");
392
- if (iIndex != -1) {
393
- var sParamNameWithoutColon = mOptions.parameterName.substr(iIndex + 1);
394
- sParamValue = oParams[sParamNameWithoutColon];
395
- }
398
+ // [Compatibility]: if a parameter contains a prefix, we cut off the ":" and try again
399
+ // e.g. "my.lib:paramName"
400
+ if (!sParamValue) {
401
+ var iIndex = mOptions.parameterName.indexOf(":");
402
+ if (iIndex != -1) {
403
+ var sParamNameWithoutColon = mOptions.parameterName.substr(iIndex + 1);
404
+ sParamValue = oParams[sParamNameWithoutColon];
396
405
  }
406
+ }
397
407
 
398
- // Sync: Fallback path for when parameter could not be found so far, library.css MIGHT be not loaded
399
- if (mOptions.loadPendingParameters && typeof sParamValue === "undefined" && !bAsync) {
400
- // Include library theme in case it's not already done, since link tag for library
401
- // is added asynchronous after initLibrary has been executed
402
- var aAllLibrariesRequireCss = Library.getAllInstancesRequiringCss();
403
- aAllLibrariesRequireCss.forEach(function (oLibThemingInfo) {
404
- ThemeManager._includeLibraryThemeAndEnsureThemeRoot(oLibThemingInfo);
405
- });
406
-
407
- loadPendingLibraryParameters();
408
- sParamValue = getParam({
409
- parameterName: mOptions.parameterName,
410
- scopeName: mOptions.scopeName,
411
- loadPendingParameters: false // prevent recursion
412
- });
413
- }
408
+ // Sync: Fallback path for when parameter could not be found so far, library.css MIGHT be not loaded
409
+ if (mOptions.loadPendingParameters && typeof sParamValue === "undefined" && !bAsync) {
410
+ loadPendingLibraryParameters();
414
411
 
415
- return sParamValue;
412
+ sParamValue = getParam({
413
+ parameterName: mOptions.parameterName,
414
+ scopeName: mOptions.scopeName,
415
+ loadPendingParameters: false // prevent recursion
416
+ });
416
417
  }
417
418
 
418
- function getParamForActiveScope(sParamName, oElement, bAsync) {
419
- // check for scopes and try to find the classes in Control Tree
420
- var aScopeChain = Parameters.getActiveScopesFor(oElement, bAsync);
419
+ return sParamValue;
420
+ }
421
421
 
422
- var aFilteredScopeChain = aScopeChain.flat().reduce(function (aResult, sScope) {
423
- if (aResult.indexOf(sScope) === -1) {
424
- aResult.push(sScope);
425
- }
426
- return aResult;
427
- }, []);
422
+ function getParamForActiveScope(sParamName, oElement, bAsync) {
423
+ // check for scopes and try to find the classes in Control Tree
424
+ var aScopeChain = Parameters.getActiveScopesFor(oElement, bAsync);
428
425
 
429
- for (var i = 0; i < aFilteredScopeChain.length; i++) {
430
- var sScopeName = aFilteredScopeChain[i];
426
+ var aFilteredScopeChain = aScopeChain.flat().reduce(function (aResult, sScope) {
427
+ if (aResult.indexOf(sScope) === -1) {
428
+ aResult.push(sScope);
429
+ }
430
+ return aResult;
431
+ }, []);
431
432
 
432
- var sParamValue = getParam({
433
- parameterName: sParamName,
434
- scopeName: sScopeName,
435
- async: bAsync
436
- });
433
+ for (var i = 0; i < aFilteredScopeChain.length; i++) {
434
+ var sScopeName = aFilteredScopeChain[i];
437
435
 
438
- if (sParamValue) {
439
- return sParamValue;
440
- }
441
- }
442
- // if no matching scope was found return the default parameter
443
- return getParam({
436
+ var sParamValue = getParam({
444
437
  parameterName: sParamName,
438
+ scopeName: sScopeName,
445
439
  async: bAsync
446
440
  });
447
- }
448
441
 
449
- /**
450
- * Returns the scopes from current theming parameters.
451
- *
452
- * @private
453
- * @ui5-restricted sap.ui.core
454
- * @param {boolean} [bAvoidLoading] Whether loading of parameters should be avoided
455
- * @param {boolean} [bAsync] Whether loading of parameters should be asynchronous
456
- * @return {string[]|undefined} Scope names
457
- */
458
- Parameters._getScopes = function(bAvoidLoading, bAsync) {
459
- if ( bAvoidLoading && !mParameters ) {
460
- return;
442
+ if (sParamValue) {
443
+ return sParamValue;
444
+ }
445
+ }
446
+ // if no matching scope was found return the default parameter
447
+ return getParam({
448
+ parameterName: sParamName,
449
+ async: bAsync
450
+ });
451
+ }
452
+
453
+ /**
454
+ * Returns the scopes from current theming parameters.
455
+ *
456
+ * @private
457
+ * @ui5-restricted sap.ui.core
458
+ * @param {boolean} [bAvoidLoading] Whether loading of parameters should be avoided
459
+ * @param {boolean} [bAsync] Whether loading of parameters should be asynchronous
460
+ * @return {string[]|undefined} Scope names
461
+ */
462
+ Parameters._getScopes = function(bAvoidLoading, bAsync) {
463
+ if ( bAvoidLoading && !mParameters ) {
464
+ return undefined;
465
+ }
466
+ var oParams = getParameters(bAsync);
467
+ var aScopes = Object.keys(oParams["scopes"]);
468
+ return aScopes;
469
+ };
470
+
471
+ /**
472
+ * Returns the active scope(s) for a given control by looking up the hierarchy.
473
+ *
474
+ * The lookup navigates the DOM hierarchy if it's available. Otherwise if controls aren't rendered yet,
475
+ * it navigates the control hierarchy. By navigating the control hierarchy, inner-html elements
476
+ * with the respective scope classes can't get recognized as the Custom Style Class API does only for
477
+ * root elements.
478
+ *
479
+ * @private
480
+ * @ui5-restricted sap.viz
481
+ * @param {object} oElement element/control instance
482
+ * @param {boolean} bAsync Whether the scope should be retrieved asynchronous
483
+ * @return {Array.<Array.<string>>} Two dimensional array with scopes in bottom up order
484
+ */
485
+ Parameters.getActiveScopesFor = function(oElement, bAsync) {
486
+ var aScopeChain = [];
487
+
488
+ if (oElement instanceof Element) {
489
+ var domRef = oElement.getDomRef();
490
+
491
+ // make sure to first load all pending parameters
492
+ // doing it later (lazy) might change the behavior in case a scope is initially not defined
493
+ if (bAsync) {
494
+ parsePendingLibraryParameters();
495
+ } else {
496
+ loadPendingLibraryParameters();
461
497
  }
462
- var oParams = getParameters(bAsync);
463
- var aScopes = Object.keys(oParams["scopes"]);
464
- return aScopes;
465
- };
466
-
467
- /**
468
- * Returns the active scope(s) for a given control by looking up the hierarchy.
469
- *
470
- * The lookup navigates the DOM hierarchy if it's available. Otherwise if controls aren't rendered yet,
471
- * it navigates the control hierarchy. By navigating the control hierarchy, inner-html elements
472
- * with the respective scope classes can't get recognized as the Custom Style Class API does only for
473
- * root elements.
474
- *
475
- * @private
476
- * @ui5-restricted sap.viz
477
- * @param {object} oElement element/control instance
478
- * @param {boolean} bAsync Whether the scope should be retrieved asynchronous
479
- * @return {Array.<Array.<string>>} Two dimensional array with scopes in bottom up order
480
- */
481
- Parameters.getActiveScopesFor = function(oElement, bAsync) {
482
- var aScopeChain = [];
483
498
 
484
- if (oElement instanceof Element) {
485
- var domRef = oElement.getDomRef();
499
+ // check for scopes and try to find the classes in parent chain
500
+ var aScopes = this._getScopes(undefined, bAsync);
486
501
 
487
- // make sure to first load all pending parameters
488
- // doing it later (lazy) might change the behavior in case a scope is initially not defined
489
- if (bAsync) {
490
- parsePendingLibraryParameters();
491
- } else {
492
- loadPendingLibraryParameters();
493
- }
502
+ if (aScopes.length) {
503
+ if (domRef) {
504
+ var fnNodeHasStyleClass = function(sScopeName) {
505
+ var scopeList = domRef.classList;
506
+ return scopeList && scopeList.contains(sScopeName);
507
+ };
494
508
 
495
- // check for scopes and try to find the classes in parent chain
496
- var aScopes = this._getScopes(undefined, bAsync);
497
-
498
- if (aScopes.length) {
499
- if (domRef) {
500
- var fnNodeHasStyleClass = function(sScopeName) {
501
- var scopeList = domRef.classList;
502
- return scopeList && scopeList.contains(sScopeName);
503
- };
504
-
505
- while (domRef) {
506
- var aFoundScopeClasses = aScopes.filter(fnNodeHasStyleClass);
507
- if (aFoundScopeClasses.length > 0) {
508
- aScopeChain.push(aFoundScopeClasses);
509
- }
510
- domRef = domRef.parentNode;
509
+ while (domRef) {
510
+ const aFoundScopeClasses = aScopes.filter(fnNodeHasStyleClass);
511
+ if (aFoundScopeClasses.length > 0) {
512
+ aScopeChain.push(aFoundScopeClasses);
511
513
  }
512
- } else {
513
- var fnControlHasStyleClass = function(sScopeName) {
514
- return typeof oElement.hasStyleClass === "function" && oElement.hasStyleClass(sScopeName);
515
- };
516
-
517
- while (oElement) {
518
- var aFoundScopeClasses = aScopes.filter(fnControlHasStyleClass);
519
- if (aFoundScopeClasses.length > 0) {
520
- aScopeChain.push(aFoundScopeClasses);
521
- }
522
- oElement = typeof oElement.getParent === "function" && oElement.getParent();
514
+ domRef = domRef.parentNode;
515
+ }
516
+ } else {
517
+ var fnControlHasStyleClass = function(sScopeName) {
518
+ return typeof oElement.hasStyleClass === "function" && oElement.hasStyleClass(sScopeName);
519
+ };
520
+
521
+ while (oElement) {
522
+ const aFoundScopeClasses = aScopes.filter(fnControlHasStyleClass);
523
+ if (aFoundScopeClasses.length > 0) {
524
+ aScopeChain.push(aFoundScopeClasses);
523
525
  }
526
+ oElement = typeof oElement.getParent === "function" && oElement.getParent();
524
527
  }
525
528
  }
526
529
  }
527
- return aScopeChain;
528
- };
529
-
530
- /**
531
- *
532
- * Theming Parameter Value
533
- *
534
- * @typedef {(string|Object<string,string>|undefined)} sap.ui.core.theming.Parameters.Value
535
- * @public
536
- */
530
+ }
531
+ return aScopeChain;
532
+ };
533
+
534
+ /**
535
+ *
536
+ * Theming Parameter Value
537
+ *
538
+ * @typedef {(string|Object<string,string>|undefined)} sap.ui.core.theming.Parameters.Value
539
+ * @public
540
+ */
541
+
542
+ /**
543
+ * <p>
544
+ * Returns the current value for one or more theming parameters, depending on the given arguments.
545
+ * The synchronous usage of this API has been deprecated and only the asynchronous usage should still be used
546
+ * (see the 4th bullet point and the code examples below).
547
+ * </p>
548
+ *
549
+ * <p>
550
+ * The theming parameters are immutable and cannot be changed at runtime.
551
+ * Multiple <code>Parameters.get()</code> API calls for the same parameter name will always result in the same parameter value.
552
+ * </p>
553
+ *
554
+ * <p>
555
+ * The following API variants are available (see also the below examples):
556
+ * <ul>
557
+ * <li> <b>(deprecated since 1.92)</b> If no parameter is given a key-value map containing all parameters is returned</li>
558
+ * <li> <b>(deprecated since 1.94)</b> If a <code>string</code> is given as first parameter the value is returned as a <code>string</code></li>
559
+ * <li> <b>(deprecated since 1.94)</b> If an <code>array</code> is given as first parameter a key-value map containing all parameters from the <code>array</code> is returned</li>
560
+ * <li>If an <code>object</code> is given as first parameter the result is returned immediately in case all parameters are loaded and available or within the callback in case not all CSS files are already loaded.
561
+ * This is the <b>only asynchronous</b> API variant. This variant is the preferred way to retrieve theming parameters.
562
+ * The structure of the return value is the same as listed above depending on the type of the name property within the <code>object</code>.</li>
563
+ * </ul>
564
+ * </p>
565
+ *
566
+ * <p>The returned key-value maps are a copy so changing values in the map does not have any effect</p>
567
+ *
568
+ * <p>
569
+ * Please see the examples below for a detailed guide on how to use the <b>asynchronous variant</b> of the API.
570
+ * </p>
571
+ *
572
+ * @example <caption>Scenario 1: Parameters are already available</caption>
573
+ * // "sapUiParam1", "sapUiParam2", "sapUiParam3" are already available
574
+ * Parameters.get({
575
+ * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
576
+ * callback: function(mParams) {
577
+ * // callback is not called, since all Parameters are available synchronously
578
+ * }
579
+ * });
580
+ * // As described above, returns a map with key-value pairs corresponding to the parameters:
581
+ * // mParams = {sapUiParam1: '...value...', sapUiParam2: '...value...', sapUiParam3: '...value...'}
582
+ *
583
+ * @example <caption>Scenario 2: Some Parameters are missing </caption>
584
+ * // "sapUiParam1", "sapUiParam2" are already available
585
+ * // "sapUiParam3" is not yet available
586
+ * Parameters.get({
587
+ * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
588
+ * callback: function(mParams) {
589
+ * // Parameters.get() callback gets the same map with key-value pairs as in "Scenario 1".
590
+ * // mParams = {sapUiParam1: '...value...', sapUiParam2: '...value...', sapUiParam3: '...value...'}
591
+ * }
592
+ * });
593
+ * // return-value is undefined, since not all Parameters are yet available synchronously
594
+ *
595
+ * @example <caption>Scenario 3: Default values</caption>
596
+ * // Scenario 1 (all parameters are available): the returned parameter map can be used to merge with a map of default values.
597
+ * // Scenario 2 (one or more parameters are missing): the returned undefined value does not change the default parameters
598
+ * // This allows you to always retrieve a consistent set of parameters, either synchronously via the return-value or asynchronously via the provided callback.
599
+ * var mMyParams = Object.assign({
600
+ * sapUiParam1: "1rem",
601
+ * sapUiParam2: "#FF0000",
602
+ * sapUiParam3: "16px"
603
+ * }, Parameters.get({
604
+ * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
605
+ * callback: function(mParams) {
606
+ * // merge the current parameters with the actual parameters in case they are retrieved asynchronously
607
+ * Object.assign(mMyParams, mParams);
608
+ * }
609
+ * }));
610
+ *
611
+ * @param {string | string[] | object} vName the (array with) CSS parameter name(s) or an object containing the (array with) CSS parameter name(s),
612
+ * the scopeElement and a callback for async retrieval of parameters.
613
+ * @param {string | string[]} vName.name the (array with) CSS parameter name(s)
614
+ * @param {sap.ui.core.Element} [vName.scopeElement]
615
+ * Element / control instance to take into account when looking for a parameter value.
616
+ * This can make a difference when a parameter value is overridden in a theme scope set via a CSS class.
617
+ * @param {function(sap.ui.core.theming.Parameters.Value)} [vName.callback] If given, the callback is only executed in case there are still parameters pending and one or more of the requested parameters is missing.
618
+ * @param {sap.ui.core.Element} [oElement]
619
+ * Element / control instance to take into account when looking for a parameter value.
620
+ * This can make a difference when a parameter value is overridden in a theme scope set via a CSS class.
621
+ * @returns {sap.ui.core.theming.Parameters.Value} the CSS parameter value(s) or <code>undefined</code> if the parameters could not be retrieved.
622
+ *
623
+ * @public
624
+ */
625
+ Parameters.get = function(vName, oElement) {
626
+ let sParamName, fnAsyncCallback, bAsync, aNames, iIndex;
627
+
628
+ // Whether parameters containing CSS URLs should be parsed into regular URL strings,
629
+ // e.g. a parameter value of url('https://myapp.sample/image.jpeg') will be returned as "https://myapp.sample/image.jpeg".
630
+ // Empty strings as well as the special CSS value 'none' will be parsed to null.
631
+ let bParseUrls;
632
+
633
+ var findRegisteredCallback = function (oCallbackInfo) { return oCallbackInfo.callback === fnAsyncCallback; };
634
+
635
+ if (!sTheme) {
636
+ sTheme = Theming.getTheme();
637
+ }
537
638
 
538
639
  /**
539
- * <p>
540
- * Returns the current value for one or more theming parameters, depending on the given arguments.
541
- * The synchronous usage of this API has been deprecated and only the asynchronous usage should still be used
542
- * (see the 4th bullet point and the code examples below).
543
- * </p>
544
- *
545
- * <p>
546
- * The theming parameters are immutable and cannot be changed at runtime.
547
- * Multiple <code>Parameters.get()</code> API calls for the same parameter name will always result in the same parameter value.
548
- * </p>
549
- *
550
- * <p>
551
- * The following API variants are available (see also the below examples):
552
- * <ul>
553
- * <li> <b>(deprecated since 1.92)</b> If no parameter is given a key-value map containing all parameters is returned</li>
554
- * <li> <b>(deprecated since 1.94)</b> If a <code>string</code> is given as first parameter the value is returned as a <code>string</code></li>
555
- * <li> <b>(deprecated since 1.94)</b> If an <code>array</code> is given as first parameter a key-value map containing all parameters from the <code>array</code> is returned</li>
556
- * <li>If an <code>object</code> is given as first parameter the result is returned immediately in case all parameters are loaded and available or within the callback in case not all CSS files are already loaded.
557
- * This is the <b>only asynchronous</b> API variant. This variant is the preferred way to retrieve theming parameters.
558
- * The structure of the return value is the same as listed above depending on the type of the name property within the <code>object</code>.</li>
559
- * </ul>
560
- * </p>
561
- *
562
- * <p>The returned key-value maps are a copy so changing values in the map does not have any effect</p>
563
- *
564
- * <p>
565
- * Please see the examples below for a detailed guide on how to use the <b>asynchronous variant</b> of the API.
566
- * </p>
567
- *
568
- * @example <caption>Scenario 1: Parameters are already available</caption>
569
- * // "sapUiParam1", "sapUiParam2", "sapUiParam3" are already available
570
- * Parameters.get({
571
- * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
572
- * callback: function(mParams) {
573
- * // callback is not called, since all Parameters are available synchronously
574
- * }
575
- * });
576
- * // As described above, returns a map with key-value pairs corresponding to the parameters:
577
- * // mParams = {sapUiParam1: '...value...', sapUiParam2: '...value...', sapUiParam3: '...value...'}
578
- *
579
- * @example <caption>Scenario 2: Some Parameters are missing </caption>
580
- * // "sapUiParam1", "sapUiParam2" are already available
581
- * // "sapUiParam3" is not yet available
582
- * Parameters.get({
583
- * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
584
- * callback: function(mParams) {
585
- * // Parameters.get() callback gets the same map with key-value pairs as in "Scenario 1".
586
- * // mParams = {sapUiParam1: '...value...', sapUiParam2: '...value...', sapUiParam3: '...value...'}
587
- * }
588
- * });
589
- * // return-value is undefined, since not all Parameters are yet available synchronously
590
- *
591
- * @example <caption>Scenario 3: Default values</caption>
592
- * // Scenario 1 (all parameters are available): the returned parameter map can be used to merge with a map of default values.
593
- * // Scenario 2 (one or more parameters are missing): the returned undefined value does not change the default parameters
594
- * // This allows you to always retrieve a consistent set of parameters, either synchronously via the return-value or asynchronously via the provided callback.
595
- * var mMyParams = Object.assign({
596
- * sapUiParam1: "1rem",
597
- * sapUiParam2: "#FF0000",
598
- * sapUiParam3: "16px"
599
- * }, Parameters.get({
600
- * name: ["sapUiParam1", "sapUiParam2", "sapUiParam3"],
601
- * callback: function(mParams) {
602
- * // merge the current parameters with the actual parameters in case they are retrieved asynchronously
603
- * Object.assign(mMyParams, mParams);
604
- * }
605
- * }));
606
- *
607
- * @param {string | string[] | object} vName the (array with) CSS parameter name(s) or an object containing the (array with) CSS parameter name(s),
608
- * the scopeElement and a callback for async retrieval of parameters.
609
- * @param {string | string[]} vName.name the (array with) CSS parameter name(s)
610
- * @param {sap.ui.core.Element} [vName.scopeElement]
611
- * Element / control instance to take into account when looking for a parameter value.
612
- * This can make a difference when a parameter value is overridden in a theme scope set via a CSS class.
613
- * @param {function(sap.ui.core.theming.Parameters.Value)} [vName.callback] If given, the callback is only executed in case there are still parameters pending and one or more of the requested parameters is missing.
614
- * @param {sap.ui.core.Element} [oElement]
615
- * Element / control instance to take into account when looking for a parameter value.
616
- * This can make a difference when a parameter value is overridden in a theme scope set via a CSS class.
617
- * @returns {sap.ui.core.theming.Parameters.Value} the CSS parameter value(s) or <code>undefined</code> if the parameters could not be retrieved.
618
- *
619
- * @public
640
+ * Parameters.get() without arguments returns
641
+ * copy of complete default parameter set
642
+ * @deprecated As of Version 1.120
620
643
  */
621
- Parameters.get = function(vName, oElement) {
622
- let sParamName, fnAsyncCallback, bAsync, aNames, iIndex;
623
-
624
- // Whether parameters containing CSS URLs should be parsed into regular URL strings,
625
- // e.g. a parameter value of url('https://myapp.sample/image.jpeg') will be returned as "https://myapp.sample/image.jpeg".
626
- // Empty strings as well as the special CSS value 'none' will be parsed to null.
627
- let bParseUrls;
644
+ if (arguments.length === 0) {
645
+ Log.warning(
646
+ "[FUTURE FATAL] Legacy variant usage of sap.ui.core.theming.Parameters.get API detected. Do not use the Parameters.get() API to retrieve ALL theming parameters, " +
647
+ "as this will lead to unwanted synchronous requests. " +
648
+ "Use the asynchronous API variant instead and retrieve a fixed set of parameters.",
649
+ "LegacyParametersGet",
650
+ "sap.ui.support",
651
+ function() { return { type: "LegacyParametersGet" }; }
652
+ );
653
+
654
+ // retrieve parameters
655
+ // optionally might also trigger a sync JSON request, if a library was loaded but not parsed yet
656
+ var oParams = getParameters();
657
+ return Object.assign({}, oParams["default"]);
658
+ }
628
659
 
629
- var findRegisteredCallback = function (oCallbackInfo) { return oCallbackInfo.callback === fnAsyncCallback; };
660
+ if (!vName) {
661
+ return undefined;
662
+ }
630
663
 
631
- if (!sTheme) {
632
- sTheme = Theming.getTheme();
664
+ if (vName instanceof Object && !Array.isArray(vName)) {
665
+ // async variant of Parameters.get
666
+ if (!vName.name) {
667
+ future.warningThrows("sap.ui.core.theming.Parameters: Get was called with an object argument without one or more parameter names.");
668
+ return undefined;
633
669
  }
634
-
635
- /**
636
- * Parameters.get() without arguments returns
637
- * copy of complete default parameter set
638
- * @deprecated As of Version 1.120
639
- */
640
- if (arguments.length === 0) {
641
- Log.warning(
642
- "[FUTURE FATAL] Legacy variant usage of sap.ui.core.theming.Parameters.get API detected. Do not use the Parameters.get() API to retrieve ALL theming parameters, " +
643
- "as this will lead to unwanted synchronous requests. " +
644
- "Use the asynchronous API variant instead and retrieve a fixed set of parameters.",
645
- "LegacyParametersGet",
646
- "sap.ui.support",
647
- function() { return { type: "LegacyParametersGet" }; }
648
- );
649
-
650
- // first try to load all pending parameters
651
- loadPendingLibraryParameters();
652
-
653
- // retrieve parameters
654
- // optionally might also trigger a sync JSON request, if a library was loaded but not parsed yet
655
- var oParams = getParameters();
656
- return Object.assign({}, oParams["default"]);
670
+ oElement = vName.scopeElement;
671
+ fnAsyncCallback = vName.callback;
672
+ bParseUrls = vName._restrictedParseUrls || false;
673
+ aNames = typeof vName.name === "string" ? [vName.name] : vName.name;
674
+ bAsync = true;
675
+ } else {
676
+ // legacy variant
677
+ if (typeof vName === "string") {
678
+ aNames = [vName];
679
+ } else { // vName is Array
680
+ aNames = vName;
657
681
  }
658
682
 
659
- if (!vName) {
660
- return undefined;
661
- }
683
+ Log.warning(
684
+ "[FUTURE FATAL] Legacy variant usage of sap.ui.core.theming.Parameters.get API detected for parameter(s): '" + aNames.join(", ") +
685
+ "'. This could lead to bad performance and additional synchronous XHRs, as parameters might not be available yet. Use asynchronous variant instead.",
686
+ "LegacyParametersGet",
687
+ "sap.ui.support",
688
+ function() { return { type: "LegacyParametersGet" }; }
689
+ );
690
+ }
662
691
 
663
- if (vName instanceof Object && !Array.isArray(vName)) {
664
- // async variant of Parameters.get
665
- if (!vName.name) {
666
- future.warningThrows("sap.ui.core.theming.Parameters: Get was called with an object argument without one or more parameter names.");
667
- return undefined;
668
- }
669
- oElement = vName.scopeElement;
670
- fnAsyncCallback = vName.callback;
671
- bParseUrls = vName._restrictedParseUrls || false;
672
- aNames = typeof vName.name === "string" ? [vName.name] : vName.name;
673
- bAsync = true;
692
+ var resolveWithParameter;
693
+ var lookForParameter = function (sName) {
694
+ if (oElement instanceof Element) {
695
+ return getParamForActiveScope(sName, oElement, bAsync);
674
696
  } else {
675
- // legacy variant
676
- if (typeof vName === "string") {
677
- aNames = [vName];
678
- } else { // vName is Array
679
- aNames = vName;
697
+ if (bAsync) {
698
+ parsePendingLibraryParameters();
680
699
  }
681
-
682
- Log.warning(
683
- "[FUTURE FATAL] Legacy variant usage of sap.ui.core.theming.Parameters.get API detected for parameter(s): '" + aNames.join(", ") +
684
- "'. This could lead to bad performance and additional synchronous XHRs, as parameters might not be available yet. Use asynchronous variant instead.",
685
- "LegacyParametersGet",
686
- "sap.ui.support",
687
- function() { return { type: "LegacyParametersGet" }; }
688
- );
700
+ return getParam({
701
+ parameterName: sName,
702
+ loadPendingParameters: !bAsync,
703
+ async: bAsync
704
+ });
689
705
  }
706
+ };
690
707
 
691
- var resolveWithParameter;
692
- var lookForParameter = function (sName) {
693
- if (oElement instanceof Element) {
694
- return getParamForActiveScope(sName, oElement, bAsync);
695
- } else {
696
- if (bAsync) {
697
- parsePendingLibraryParameters();
698
- }
699
- return getParam({
700
- parameterName: sName,
701
- loadPendingParameters: !bAsync,
702
- async: bAsync
703
- });
704
- }
705
- };
706
-
707
- const mResult = {};
708
+ const mResult = {};
708
709
 
709
- for (var i = 0; i < aNames.length; i++) {
710
- sParamName = aNames[i];
711
- var sParamValue = lookForParameter(sParamName);
712
- if (!bAsync || sParamValue) {
713
- mResult[sParamName] = sParamValue;
714
- }
710
+ for (var i = 0; i < aNames.length; i++) {
711
+ sParamName = aNames[i];
712
+ var sParamValue = lookForParameter(sParamName);
713
+ if (!bAsync || sParamValue) {
714
+ mResult[sParamName] = sParamValue;
715
715
  }
716
+ }
716
717
 
717
- if (bAsync && fnAsyncCallback && Object.keys(mResult).length !== aNames.length) {
718
- resolveWithParameter = function () {
719
- Theming.detachApplied(resolveWithParameter);
720
- var vParams = this.get({ // Don't pass callback again
721
- name: vName.name,
722
- scopeElement: vName.scopeElement
723
- });
724
-
725
- if (!vParams || (typeof vParams === "object" && (Object.keys(vParams).length !== aNames.length))) {
726
- Log.error(`sap.ui.core.theming.Parameters: The following parameters could not be found: "${aNames.length === 1 ? aNames[0] : aNames.filter((n) => vParams && !Object.hasOwn(vParams, n))}"`);
727
- }
728
-
729
- fnAsyncCallback(vParams);
730
- aCallbackRegistry.splice(aCallbackRegistry.findIndex(findRegisteredCallback), 1);
731
- }.bind(this);
718
+ if (bAsync && fnAsyncCallback && Object.keys(mResult).length !== aNames.length) {
719
+ resolveWithParameter = function () {
720
+ Theming.detachApplied(resolveWithParameter);
721
+ var vParams = this.get({ // Don't pass callback again
722
+ name: vName.name,
723
+ scopeElement: vName.scopeElement
724
+ });
732
725
 
733
- // Check if identical callback is already registered and reregister with current parameters
734
- iIndex = aCallbackRegistry.findIndex(findRegisteredCallback);
735
- if (iIndex >= 0) {
736
- Theming.detachApplied(aCallbackRegistry[iIndex].eventHandler);
737
- aCallbackRegistry[iIndex].eventHandler = resolveWithParameter;
738
- } else {
739
- aCallbackRegistry.push({ callback: fnAsyncCallback, eventHandler: resolveWithParameter });
726
+ if (!vParams || (typeof vParams === "object" && (Object.keys(vParams).length !== aNames.length))) {
727
+ Log.error(`sap.ui.core.theming.Parameters: The following parameters could not be found: "${aNames.length === 1 ? aNames[0] : aNames.filter((n) => vParams && !Object.hasOwn(vParams, n))}"`);
740
728
  }
741
- Theming.attachApplied(resolveWithParameter);
742
- return undefined; // Don't return partial result in case we expect applied event.
743
- }
744
-
745
- // parse CSS URL strings
746
- // The URLs itself have been resolved at this point
747
- if (bParseUrls) {
748
- parseUrls(mResult);
749
- }
750
729
 
751
- // if only 1 parameter is requests we unwrap the results array
752
- return aNames.length === 1 ? mResult[aNames[0]] : mResult;
753
- };
730
+ fnAsyncCallback(vParams);
731
+ aCallbackRegistry.splice(aCallbackRegistry.findIndex(findRegisteredCallback), 1);
732
+ }.bind(this);
754
733
 
755
- /**
756
- * Checks the given map of parameters for CSS URLs and parses them to a regular string.
757
- * Modifies the mParams argument in place.
758
- *
759
- * In order to only retrieve resolved URL strings and not the CSS URL strings, we expose a restricted Parameters.get() option <code>_restrictedParseUrls</code>.
760
- *
761
- * A URL parameter value of '' (empty string) or "none" (standard CSS value) will result in <code>null</code>.
762
- * As with any other <code>Parameters.get()</code> call, a non-existent parameter will result in <code>undefined</code>.
763
- *
764
- * Usage in controls:
765
- *
766
- * @example <caption>Scenario 4: Parsing CSS URLs</caption>
767
- * const sUrl = Parameters.get({
768
- * name: ["sapUiUrlParam"],
769
- * _restrictedParseUrls: true
770
- * }) ?? "https://my.bootstrap.url/resource/my/lib/images/fallback.jpeg"; // fallback via nullish coalescing operator
771
- *
772
- * @param {object<string,string|undefined>} mParams a set of parameters that should be parsed for CSS URLs
773
- */
774
- function parseUrls(mParams) {
775
- for (const sKey in mParams) {
776
- if (Object.hasOwn(mParams, sKey)) {
777
- let sValue = mParams[sKey];
778
- const match = rCssUrl.exec(sValue);
779
- if (match) {
780
- sValue = match[1];
781
- } else if (sValue === "''" || sValue === "none") {
782
- sValue = null;
783
- }
784
- mParams[sKey] = sValue;
785
- }
734
+ // Check if identical callback is already registered and reregister with current parameters
735
+ iIndex = aCallbackRegistry.findIndex(findRegisteredCallback);
736
+ if (iIndex >= 0) {
737
+ Theming.detachApplied(aCallbackRegistry[iIndex].eventHandler);
738
+ aCallbackRegistry[iIndex].eventHandler = resolveWithParameter;
739
+ } else {
740
+ aCallbackRegistry.push({ callback: fnAsyncCallback, eventHandler: resolveWithParameter });
786
741
  }
742
+ Theming.attachApplied(resolveWithParameter);
743
+ return undefined; // Don't return partial result in case we expect applied event.
787
744
  }
788
745
 
789
- /**
790
- *
791
- * Uses the parameters provide to re-set the parameters map or
792
- * reloads them as usually.
793
- *
794
- * @param {Object} mLibraryParameters
795
- * @private
796
- */
797
- Parameters._setOrLoadParameters = function(mLibraryParameters) {
746
+ // parse CSS URL strings
747
+ // The URLs itself have been resolved at this point
748
+ if (bParseUrls) {
749
+ parseUrls(mResult);
750
+ }
798
751
 
799
- // don't use this.reset(), as it will set the variable to null
800
- mParameters = {
801
- "default": {},
802
- "scopes": {}
803
- };
804
- sTheme = Theming.getTheme();
805
- forEachStyleSheet(function(sId) {
806
- var sLibname = sId.substr(13); // length of sap-ui-theme-
807
- if (mLibraryParameters[sLibname]) {
808
- // if parameters are already provided for this lib, use them (e.g. from LessSupport)
809
- extend(mParameters["default"], mLibraryParameters[sLibname]);
810
- } else {
811
- // otherwise use inline-parameters or library-parameters.json
812
- loadParameters(sId);
752
+ // if only 1 parameter is requests we unwrap the results array
753
+ return aNames.length === 1 ? mResult[aNames[0]] : mResult;
754
+ };
755
+
756
+ /**
757
+ * Checks the given map of parameters for CSS URLs and parses them to a regular string.
758
+ * Modifies the mParams argument in place.
759
+ *
760
+ * In order to only retrieve resolved URL strings and not the CSS URL strings, we expose a restricted Parameters.get() option <code>_restrictedParseUrls</code>.
761
+ *
762
+ * A URL parameter value of '' (empty string) or "none" (standard CSS value) will result in <code>null</code>.
763
+ * As with any other <code>Parameters.get()</code> call, a non-existent parameter will result in <code>undefined</code>.
764
+ *
765
+ * Usage in controls:
766
+ *
767
+ * @example <caption>Scenario 4: Parsing CSS URLs</caption>
768
+ * const sUrl = Parameters.get({
769
+ * name: ["sapUiUrlParam"],
770
+ * _restrictedParseUrls: true
771
+ * }) ?? "https://my.bootstrap.url/resource/my/lib/images/fallback.jpeg"; // fallback via nullish coalescing operator
772
+ *
773
+ * @param {object<string,string|undefined>} mParams a set of parameters that should be parsed for CSS URLs
774
+ */
775
+ function parseUrls(mParams) {
776
+ for (const sKey in mParams) {
777
+ if (Object.hasOwn(mParams, sKey)) {
778
+ let sValue = mParams[sKey];
779
+ const match = rCssUrl.exec(sValue);
780
+ if (match) {
781
+ sValue = match[1];
782
+ } else if (sValue === "''" || sValue === "none") {
783
+ sValue = null;
813
784
  }
814
- });
815
- };
816
-
817
- /**
818
- * Resets the CSS parameters which finally will reload the parameters
819
- * the next time they are queried via the method <code>get</code>.
820
- *
821
- * @public
822
- * @deprecated As of version 1.92 without a replacement. Application code should
823
- * not be able to interfere with the automated determination of theme parameters.
824
- * Resetting the parameters unnecessarily could impact performance. Please use
825
- * the (potentially async) API to get parameter values and rely on the framework
826
- * to update parameter values when the theme changes.
827
- */
828
- Parameters.reset = function() {
829
- this._reset.apply(this, arguments);
830
- };
831
-
832
- /**
833
- * Resets the CSS parameters which finally will reload the parameters
834
- * the next time they are queried via the method <code>get</code>.
835
- *
836
- * @private
837
- * @ui5-restricted sap.ui.core.theming
838
- */
839
- Parameters._reset = function() {
840
- // hidden parameter {boolean} bOnlyWhenNecessary
841
- var bOnlyWhenNecessary = arguments[0] === true;
842
- if ( !bOnlyWhenNecessary || Theming.getTheme() !== sTheme ) {
843
- sTheme = Theming.getTheme();
844
- aParametersToLoad = [];
845
- mParameters = null;
785
+ mParams[sKey] = sValue;
846
786
  }
847
- };
848
-
787
+ }
788
+ }
789
+
790
+ /**
791
+ * Resets the CSS parameters which finally will reload the parameters
792
+ * the next time they are queried via the method <code>get</code>.
793
+ *
794
+ * @public
795
+ * @deprecated As of version 1.92 without a replacement. Application code should
796
+ * not be able to interfere with the automated determination of theme parameters.
797
+ * Resetting the parameters unnecessarily could impact performance. Please use
798
+ * the (potentially async) API to get parameter values and rely on the framework
799
+ * to update parameter values when the theme changes.
800
+ */
801
+ Parameters.reset = function() {
802
+ reset(true);
803
+ };
804
+
805
+ /**
806
+ * Resets the CSS parameters which finally will reload the parameters
807
+ * the next time they are queried via the method <code>get</code>.
808
+ */
809
+ function reset() {
849
810
  /**
850
- * Helper function to get an image URL based on a given theme parameter.
851
- *
852
- * @private
853
- * @param {string} sParamName the theme parameter which contains the logo definition. If nothing is defined the parameter 'sapUiGlobalLogo' is used.
854
- * @param {boolean} bForce whether a valid URL should be returned even if there is no logo defined.
811
+ * hidden parameter {boolean} bForce
855
812
  * @deprecated
856
813
  */
857
- Parameters._getThemeImage = function(sParamName, bForce) {
858
- sParamName = sParamName || "sapUiGlobalLogo";
859
- var logo = Parameters.get(sParamName);
860
- if (logo) {
861
- var match = rCssUrl.exec(logo);
862
- if (match) {
863
- logo = match[1];
864
- } else if (logo === "''" || logo === "none") {
865
- logo = null;
866
- }
814
+ const bForce = arguments[0] === true;
815
+ if ( bForce || Theming.getTheme() !== sTheme ) {
816
+ sTheme = Theming.getTheme();
817
+ aParametersToLoad = [...getAllLibraryInfoObjects().keys()];
818
+ mParameters = null;
819
+ }
820
+ }
821
+
822
+ /**
823
+ * Helper function to get an image URL based on a given theme parameter.
824
+ *
825
+ * @private
826
+ * @param {string} sParamName the theme parameter which contains the logo definition. If nothing is defined the parameter 'sapUiGlobalLogo' is used.
827
+ * @param {boolean} bForce whether a valid URL should be returned even if there is no logo defined.
828
+ * @deprecated
829
+ */
830
+ Parameters._getThemeImage = function(sParamName, bForce) {
831
+ sParamName = sParamName || "sapUiGlobalLogo";
832
+ var logo = Parameters.get(sParamName);
833
+ if (logo) {
834
+ var match = rCssUrl.exec(logo);
835
+ if (match) {
836
+ logo = match[1];
837
+ } else if (logo === "''" || logo === "none") {
838
+ logo = null;
867
839
  }
840
+ }
868
841
 
869
- if (bForce && !logo) {
870
- return sap.ui.require.toUrl('sap/ui/core/themes/base/img/1x1.gif');
871
- }
842
+ if (bForce && !logo) {
843
+ return sap.ui.require.toUrl('sap/ui/core/themes/base/img/1x1.gif');
844
+ }
872
845
 
873
- return logo;
874
- };
846
+ return logo;
847
+ };
848
+
849
+ attachChange(reset);
875
850
 
876
851
  return Parameters;
877
852