@openui5/sap.ui.core 1.102.2 → 1.104.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 (374) hide show
  1. package/.reuse/dep5 +17 -0
  2. package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
  3. package/THIRDPARTY.txt +35 -2
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +2 -2
  6. package/src/jquery.sap.properties.js +1 -1
  7. package/src/jquery.sap.resources.js +1 -1
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/sap/base/i18n/ResourceBundle.js +2 -2
  11. package/src/sap/base/util/LoaderExtensions.js +69 -61
  12. package/src/sap/base/util/fetch.js +230 -0
  13. package/src/sap/base/util/mixedFetch.js +69 -0
  14. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  15. package/src/sap/base/util/restricted/_castArray.js +1 -1
  16. package/src/sap/base/util/restricted/_compact.js +1 -1
  17. package/src/sap/base/util/restricted/_curry.js +1 -1
  18. package/src/sap/base/util/restricted/_debounce.js +1 -1
  19. package/src/sap/base/util/restricted/_difference.js +1 -1
  20. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  22. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_flatten.js +1 -1
  26. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  28. package/src/sap/base/util/restricted/_intersection.js +1 -1
  29. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  31. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  33. package/src/sap/base/util/restricted/_isNil.js +1 -1
  34. package/src/sap/base/util/restricted/_max.js +1 -1
  35. package/src/sap/base/util/restricted/_merge.js +1 -1
  36. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  37. package/src/sap/base/util/restricted/_min.js +1 -1
  38. package/src/sap/base/util/restricted/_omit.js +1 -1
  39. package/src/sap/base/util/restricted/_pick.js +1 -1
  40. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  41. package/src/sap/base/util/restricted/_throttle.js +1 -1
  42. package/src/sap/base/util/restricted/_toArray.js +1 -1
  43. package/src/sap/base/util/restricted/_union.js +1 -1
  44. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  45. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  46. package/src/sap/base/util/restricted/_uniq.js +1 -1
  47. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  49. package/src/sap/base/util/restricted/_without.js +1 -1
  50. package/src/sap/base/util/restricted/_xor.js +1 -1
  51. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  52. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  53. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  55. package/src/sap/base/util/syncFetch.js +73 -0
  56. package/src/sap/ui/Device.js +9 -3
  57. package/src/sap/ui/Global.js +4 -4
  58. package/src/sap/ui/VersionInfo.js +12 -6
  59. package/src/sap/ui/base/Event.js +1 -1
  60. package/src/sap/ui/base/EventProvider.js +2 -2
  61. package/src/sap/ui/base/ExpressionParser.js +2 -2
  62. package/src/sap/ui/base/Interface.js +1 -1
  63. package/src/sap/ui/base/ManagedObject.js +10 -8
  64. package/src/sap/ui/base/ManagedObjectMetadata.js +21 -8
  65. package/src/sap/ui/base/Metadata.js +1 -1
  66. package/src/sap/ui/base/Object.js +1 -1
  67. package/src/sap/ui/base/ObjectPool.js +1 -1
  68. package/src/sap/ui/base/SyncPromise.js +2 -0
  69. package/src/sap/ui/core/.library +17 -90
  70. package/src/sap/ui/core/AppCacheBuster.js +69 -55
  71. package/src/sap/ui/core/BusyIndicator.js +1 -1
  72. package/src/sap/ui/core/Component.js +51 -24
  73. package/src/sap/ui/core/ComponentContainer.js +1 -1
  74. package/src/sap/ui/core/ComponentMetadata.js +2 -2
  75. package/src/sap/ui/core/ComponentSupport.js +1 -1
  76. package/src/sap/ui/core/Configuration.js +45 -22
  77. package/src/sap/ui/core/Control.js +2 -2
  78. package/src/sap/ui/core/Core.js +56 -68
  79. package/src/sap/ui/core/CustomData.js +1 -1
  80. package/src/sap/ui/core/DeclarativeSupport.js +10 -9
  81. package/src/sap/ui/core/Element.js +20 -11
  82. package/src/sap/ui/core/ElementMetadata.js +1 -1
  83. package/src/sap/ui/core/EnabledPropagator.js +4 -2
  84. package/src/sap/ui/core/EventBus.js +1 -1
  85. package/src/sap/ui/core/FocusHandler.js +58 -35
  86. package/src/sap/ui/core/Fragment.js +17 -14
  87. package/src/sap/ui/core/HTML.js +2 -2
  88. package/src/sap/ui/core/History.js +1 -1
  89. package/src/sap/ui/core/Icon.js +6 -6
  90. package/src/sap/ui/core/IconPool.js +1 -3
  91. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  92. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  93. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  94. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  95. package/src/sap/ui/core/InvisibleText.js +4 -1
  96. package/src/sap/ui/core/Item.js +1 -1
  97. package/src/sap/ui/core/LabelEnablement.js +1 -1
  98. package/src/sap/ui/core/LayoutData.js +1 -1
  99. package/src/sap/ui/core/ListItem.js +1 -1
  100. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  101. package/src/sap/ui/core/Locale.js +28 -4
  102. package/src/sap/ui/core/LocaleData.js +3 -45
  103. package/src/sap/ui/core/Manifest.js +1 -1
  104. package/src/sap/ui/core/Message.js +1 -1
  105. package/src/sap/ui/core/Popup.js +4 -2
  106. package/src/sap/ui/core/RenderManager.js +11 -21
  107. package/src/sap/ui/core/Renderer.js +1 -1
  108. package/src/sap/ui/core/ResizeHandler.js +22 -43
  109. package/src/sap/ui/core/ScrollBar.js +1 -1
  110. package/src/sap/ui/core/SeparatorItem.js +1 -1
  111. package/src/sap/ui/core/ThemeCheck.js +7 -7
  112. package/src/sap/ui/core/Title.js +1 -1
  113. package/src/sap/ui/core/TooltipBase.js +1 -1
  114. package/src/sap/ui/core/UIArea.js +8 -5
  115. package/src/sap/ui/core/UIComponent.js +2 -2
  116. package/src/sap/ui/core/UIComponentMetadata.js +2 -2
  117. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  118. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  119. package/src/sap/ui/core/XMLComposite.js +1 -1
  120. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  121. package/src/sap/ui/core/XMLTemplateProcessor.js +3 -5
  122. package/src/sap/ui/core/_IconRegistry.js +66 -55
  123. package/src/sap/ui/core/cache/CacheManager.js +18 -14
  124. package/src/sap/ui/core/cache/CacheManagerNOP.js +5 -2
  125. package/src/sap/ui/core/cache/LRUPersistentCache.js +17 -9
  126. package/src/sap/ui/core/cldr/en.json +0 -1
  127. package/src/sap/ui/core/date/Buddhist.js +15 -13
  128. package/src/sap/ui/core/date/Japanese.js +0 -6
  129. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  130. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  131. package/src/sap/ui/core/dnd/DragAndDrop.js +1 -1
  132. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  133. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  134. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  135. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  136. package/src/sap/ui/core/format/DateFormat.js +2 -2
  137. package/src/sap/ui/core/format/NumberFormat.js +3 -3
  138. package/src/sap/ui/core/format/TimezoneUtil.js +2 -2
  139. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  140. package/src/sap/ui/core/library.js +3 -3
  141. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  142. package/src/sap/ui/core/message/Message.js +1 -1
  143. package/src/sap/ui/core/message/MessageManager.js +1 -1
  144. package/src/sap/ui/core/message/MessageParser.js +2 -2
  145. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  146. package/src/sap/ui/core/messagebundle_ar.properties +54 -53
  147. package/src/sap/ui/core/messagebundle_bg.properties +54 -53
  148. package/src/sap/ui/core/messagebundle_ca.properties +28 -27
  149. package/src/sap/ui/core/messagebundle_cs.properties +37 -36
  150. package/src/sap/ui/core/messagebundle_cy.properties +56 -55
  151. package/src/sap/ui/core/messagebundle_da.properties +53 -52
  152. package/src/sap/ui/core/messagebundle_de.properties +54 -53
  153. package/src/sap/ui/core/messagebundle_el.properties +47 -46
  154. package/src/sap/ui/core/messagebundle_en_US_sappsd.properties +1 -0
  155. package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +1 -0
  156. package/src/sap/ui/core/messagebundle_en_US_saptrc.properties +1 -0
  157. package/src/sap/ui/core/messagebundle_es.properties +42 -41
  158. package/src/sap/ui/core/messagebundle_es_MX.properties +54 -53
  159. package/src/sap/ui/core/messagebundle_et.properties +51 -50
  160. package/src/sap/ui/core/messagebundle_fi.properties +48 -47
  161. package/src/sap/ui/core/messagebundle_fr.properties +36 -35
  162. package/src/sap/ui/core/messagebundle_fr_CA.properties +21 -20
  163. package/src/sap/ui/core/messagebundle_hi.properties +41 -40
  164. package/src/sap/ui/core/messagebundle_hr.properties +55 -54
  165. package/src/sap/ui/core/messagebundle_hu.properties +55 -54
  166. package/src/sap/ui/core/messagebundle_id.properties +55 -54
  167. package/src/sap/ui/core/messagebundle_it.properties +58 -57
  168. package/src/sap/ui/core/messagebundle_iw.properties +55 -54
  169. package/src/sap/ui/core/messagebundle_ja.properties +48 -47
  170. package/src/sap/ui/core/messagebundle_kk.properties +41 -40
  171. package/src/sap/ui/core/messagebundle_ko.properties +17 -16
  172. package/src/sap/ui/core/messagebundle_lt.properties +55 -54
  173. package/src/sap/ui/core/messagebundle_lv.properties +55 -54
  174. package/src/sap/ui/core/messagebundle_ms.properties +52 -51
  175. package/src/sap/ui/core/messagebundle_nl.properties +53 -52
  176. package/src/sap/ui/core/messagebundle_no.properties +53 -52
  177. package/src/sap/ui/core/messagebundle_pl.properties +52 -51
  178. package/src/sap/ui/core/messagebundle_pt.properties +54 -53
  179. package/src/sap/ui/core/messagebundle_pt_PT.properties +55 -54
  180. package/src/sap/ui/core/messagebundle_ro.properties +56 -55
  181. package/src/sap/ui/core/messagebundle_ru.properties +52 -51
  182. package/src/sap/ui/core/messagebundle_sh.properties +56 -55
  183. package/src/sap/ui/core/messagebundle_sk.properties +54 -53
  184. package/src/sap/ui/core/messagebundle_sl.properties +56 -55
  185. package/src/sap/ui/core/messagebundle_sv.properties +52 -51
  186. package/src/sap/ui/core/messagebundle_th.properties +25 -24
  187. package/src/sap/ui/core/messagebundle_tr.properties +56 -55
  188. package/src/sap/ui/core/messagebundle_uk.properties +55 -54
  189. package/src/sap/ui/core/messagebundle_vi.properties +55 -54
  190. package/src/sap/ui/core/messagebundle_zh_CN.properties +55 -54
  191. package/src/sap/ui/core/messagebundle_zh_TW.properties +55 -54
  192. package/src/sap/ui/core/mvc/ControllerExtension.js +1 -1
  193. package/src/sap/ui/core/mvc/HTMLView.js +12 -12
  194. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  195. package/src/sap/ui/core/mvc/JSView.js +1 -1
  196. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  197. package/src/sap/ui/core/mvc/View.js +1 -1
  198. package/src/sap/ui/core/mvc/XMLView.js +1 -2
  199. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  200. package/src/sap/ui/core/plugin/LessSupport.js +16 -14
  201. package/src/sap/ui/core/plugin/TemplatingSupport.js +2 -1
  202. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  203. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  204. package/src/sap/ui/core/routing/History.js +5 -3
  205. package/src/sap/ui/core/routing/Router.js +4 -2
  206. package/src/sap/ui/core/routing/Targets.js +2 -2
  207. package/src/sap/ui/core/routing/async/TargetCache.js +4 -0
  208. package/src/sap/ui/core/rules/Config.support.js +1 -1
  209. package/src/sap/ui/core/rules/View.support.js +11 -4
  210. package/src/sap/ui/core/search/OpenSearchProvider.js +24 -11
  211. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  212. package/src/sap/ui/core/service/Service.js +1 -1
  213. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  214. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  215. package/src/sap/ui/core/support/Plugin.js +1 -1
  216. package/src/sap/ui/core/support/RuleEngineOpaExtension.js +1 -1
  217. package/src/sap/ui/core/support/Support.js +2 -2
  218. package/src/sap/ui/core/support/ToolsAPI.js +4 -1
  219. package/src/sap/ui/core/support/plugins/ControlTree.js +3 -1
  220. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  221. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  222. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  223. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  224. package/src/sap/ui/core/support/plugins/TechInfo.js +46 -33
  225. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  226. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  227. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +1 -1
  228. package/src/sap/ui/core/themes/base/base.less +26 -26
  229. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  230. package/src/sap/ui/core/theming/Parameters.js +46 -40
  231. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  232. package/src/sap/ui/core/tmpl/DOMElement.js +2 -2
  233. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  234. package/src/sap/ui/core/tmpl/Template.js +5 -5
  235. package/src/sap/ui/core/tmpl/TemplateControl.js +2 -2
  236. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  237. package/src/sap/ui/core/util/Export.js +1 -1
  238. package/src/sap/ui/core/util/ExportCell.js +1 -1
  239. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  240. package/src/sap/ui/core/util/ExportRow.js +1 -1
  241. package/src/sap/ui/core/util/ExportType.js +1 -1
  242. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  243. package/src/sap/ui/core/util/File.js +1 -1
  244. package/src/sap/ui/core/util/LibraryInfo.js +61 -42
  245. package/src/sap/ui/core/util/MockServer.js +1 -1
  246. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  247. package/src/sap/ui/core/util/ResponsivePaddingsEnablement.js +2 -2
  248. package/src/sap/ui/core/util/XMLPreprocessor.js +2 -2
  249. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  250. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  251. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  252. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  253. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  254. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  255. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  256. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  257. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  258. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  259. package/src/sap/ui/debug/ControlTree.js +1 -1
  260. package/src/sap/ui/debug/DebugEnv.js +1 -1
  261. package/src/sap/ui/debug/PropertyList.js +19 -9
  262. package/src/sap/ui/dom/_ready.js +34 -0
  263. package/src/sap/ui/dom/containsOrEquals.js +2 -2
  264. package/src/sap/ui/dom/getFirstEditableInput.js +2 -2
  265. package/src/sap/ui/dom/jquery/Focusable.js +1 -1
  266. package/src/sap/ui/dom/jquery/control.js +1 -1
  267. package/src/sap/ui/events/jquery/EventExtension.js +1 -1
  268. package/src/sap/ui/events/jquery/EventSimulation.js +1 -1
  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 +2 -2
  273. package/src/sap/ui/model/MetaModel.js +1 -1
  274. package/src/sap/ui/model/Model.js +1 -1
  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/TreeBindingAdapter.js +134 -0
  279. package/src/sap/ui/model/Type.js +1 -1
  280. package/src/sap/ui/model/analytics/odata4analytics.js +2 -2
  281. package/src/sap/ui/model/json/JSONModel.js +1 -1
  282. package/src/sap/ui/model/message/MessageModel.js +1 -1
  283. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  284. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  285. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  286. package/src/sap/ui/model/odata/ODataMetadata.js +6 -3
  287. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  288. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +6 -0
  289. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +407 -91
  290. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  291. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  292. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  293. package/src/sap/ui/model/odata/type/Date.js +1 -1
  294. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  295. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  296. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  297. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  298. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  299. package/src/sap/ui/model/odata/type/Double.js +1 -1
  300. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  301. package/src/sap/ui/model/odata/type/Int.js +1 -1
  302. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  303. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  304. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  305. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  306. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  307. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  308. package/src/sap/ui/model/odata/type/Single.js +1 -1
  309. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  310. package/src/sap/ui/model/odata/type/String.js +1 -1
  311. package/src/sap/ui/model/odata/type/Time.js +1 -1
  312. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  313. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  314. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  315. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  316. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +4 -1
  317. package/src/sap/ui/model/odata/v2/ODataModel.js +112 -104
  318. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +50 -5
  319. package/src/sap/ui/model/odata/v4/Context.js +9 -10
  320. package/src/sap/ui/model/odata/v4/ODataBinding.js +16 -8
  321. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +24 -1
  322. package/src/sap/ui/model/odata/v4/ODataListBinding.js +30 -2
  323. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +5 -5
  324. package/src/sap/ui/model/odata/v4/ODataModel.js +66 -3
  325. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +30 -1
  326. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +17 -6
  327. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +6 -6
  328. package/src/sap/ui/model/odata/v4/lib/_Cache.js +203 -30
  329. package/src/sap/ui/model/odata/v4/lib/_Helper.js +52 -3
  330. package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +1 -1
  331. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +3 -7
  332. package/src/sap/ui/model/odata/v4/lib/_V2MetadataConverter.js +1 -1
  333. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  334. package/src/sap/ui/model/type/Boolean.js +1 -1
  335. package/src/sap/ui/model/type/Currency.js +1 -1
  336. package/src/sap/ui/model/type/Date.js +1 -1
  337. package/src/sap/ui/model/type/DateInterval.js +1 -1
  338. package/src/sap/ui/model/type/DateTime.js +1 -1
  339. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  340. package/src/sap/ui/model/type/FileSize.js +1 -1
  341. package/src/sap/ui/model/type/Float.js +1 -1
  342. package/src/sap/ui/model/type/Integer.js +1 -1
  343. package/src/sap/ui/model/type/String.js +1 -1
  344. package/src/sap/ui/model/type/Time.js +1 -1
  345. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  346. package/src/sap/ui/model/type/Unit.js +1 -1
  347. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  348. package/src/sap/ui/qunit/sinon-qunit-bridge.js +1 -1
  349. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  350. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  351. package/src/sap/ui/security/FrameOptions.js +4 -2
  352. package/src/sap/ui/test/Opa5.js +1 -1
  353. package/src/sap/ui/test/OpaBuilder.js +1 -1
  354. package/src/sap/ui/test/OpaPlugin.js +3 -3
  355. package/src/sap/ui/test/TestUtils.js +35 -2
  356. package/src/sap/ui/test/_ControlFinder.js +5 -4
  357. package/src/sap/ui/test/actions/Drag.js +2 -2
  358. package/src/sap/ui/test/actions/Drop.js +2 -2
  359. package/src/sap/ui/test/actions/EnterText.js +8 -8
  360. package/src/sap/ui/test/actions/Press.js +5 -5
  361. package/src/sap/ui/test/actions/Scroll.js +1 -1
  362. package/src/sap/ui/test/generic/TestBase.js +1 -1
  363. package/src/sap/ui/test/matchers/Matcher.js +9 -11
  364. package/src/sap/ui/test/opaQunit.js +4 -3
  365. package/src/sap/ui/thirdparty/IPv6.js +1 -1
  366. package/src/sap/ui/thirdparty/SecondLevelDomains.js +1 -1
  367. package/src/sap/ui/thirdparty/URI.js +8 -2
  368. package/src/sap/ui/thirdparty/URITemplate.js +1 -1
  369. package/src/sap/ui/util/Mobile.js +59 -33
  370. package/src/sap/ui/util/Storage.js +2 -2
  371. package/src/sap/ui/util/XMLHelper.js +1 -1
  372. package/src/sap/ui/util/openWindow.js +1 -1
  373. package/src/ui5loader.js +3 -3
  374. package/ui5.yaml +71 -0
package/.reuse/dep5 CHANGED
@@ -137,6 +137,11 @@ Copyright: jQuery Foundation and other contributors
137
137
  License: MIT
138
138
  Comment: these files belong to: QUnit 2
139
139
 
140
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
141
+ Copyright: jQuery Foundation and other contributors
142
+ License: MIT
143
+ Comment: these files belong to: QUnit 2.18
144
+
140
145
  Files: src/sap.ui.core/src/sap/ui/thirdparty/jquery-compat.js
141
146
  Copyright: OpenJS Foundation and other contributors
142
147
  License: MIT
@@ -234,6 +239,11 @@ Copyright: 2010-2017, Christian Johansen, christian@cjohansen.no
234
239
  License: BSD-3-Clause
235
240
  Comment: these files belong to: SinonJS
236
241
 
242
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
243
+ Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
244
+ License: BSD-3-Clause
245
+ Comment: these files belong to: SinonJS 14
246
+
237
247
  Files: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
238
248
  Copyright: 2010-2011, Christian Johansen
239
249
  License: BSD-3-Clause
@@ -339,6 +349,13 @@ Copyright:
339
349
  License: Apache-2.0 and ISC
340
350
  Comment: these files contain content from SAP and node-lru-cache: LRUPersistentCache.js is overall written by SAP, but portions ('Least Recently Used' logic) are taken from the node-lru-cache project (see https://github.com/isaacs/node-lru-cache/blob/v2.7.3/README.md) and modified.
341
351
 
352
+ Files: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
353
+ Copyright:
354
+ 2009-2022 SAP SE or an SAP affiliate company and OpenUI5 contributors
355
+ Arthur David Olson, Paul Eggert and other contributors
356
+ License: Apache-2.0 and LicenseRef-tzdata-PublicDomain
357
+ Comment: these files contain content from SAP and Time Zone Database: _timezones.js is overall written by SAP, but the list of IANA timezone IDs is taken from the Timezone Database
358
+
342
359
 
343
360
  # Library: sap.ui.documentation:
344
361
 
@@ -0,0 +1,5 @@
1
+ Unless specified below, all files in the tz code and data (including
2
+ this LICENSE file) are in the public domain.
3
+
4
+ If the files date.c, newstrftime.3, and strftime.c are present, they
5
+ contain material derived from BSD and use the BSD 3-clause license.
package/THIRDPARTY.txt CHANGED
@@ -76,6 +76,12 @@ License: MIT
76
76
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
77
77
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/qunit-2.*
78
78
 
79
+ Component: QUnit 2.18, version: 2.18.0
80
+ Copyright: jQuery Foundation and other contributors
81
+ License: MIT
82
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
83
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/qunit-2.18.*
84
+
79
85
  Component: jQuery-Migrate, version: 3.3.1
80
86
  Copyright: OpenJS Foundation and other contributors
81
87
  License: MIT
@@ -191,13 +197,19 @@ License: BSD-3-Clause
191
197
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
192
198
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-4.js
193
199
 
200
+ Component: SinonJS 14, version: 14.0.0
201
+ Copyright: 2010-2022, Christian Johansen, christian@cjohansen.no
202
+ License: BSD-3-Clause
203
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
204
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/thirdparty/sinon-14.0.*
205
+
194
206
  Component: Sinon-qunit, version: 2.0.0
195
207
  Copyright: 2010-2011, Christian Johansen
196
208
  License: BSD-3-Clause
197
209
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/BSD-3-Clause.txt
198
210
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/sinon-qunit.js
199
211
 
200
- Component: URI.js, version: 1.19.10
212
+ Component: URI.js, version: 1.19.11
201
213
  Copyright: Rodney Rehm
202
214
  License: MIT
203
215
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
@@ -315,6 +327,12 @@ License: ISC
315
327
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/ISC.txt
316
328
  Contained in: src/sap.ui.core/src/sap/ui/core/cache/LRUPersistentCache.js
317
329
 
330
+ Component: Time Zone Database, version: 2022a
331
+ Copyright: Arthur David Olson, Paul Eggert and other contributors
332
+ License: LicenseRef-tzdata-PublicDomain
333
+ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/LicenseRef-tzdata-PublicDomain.txt
334
+ Contained in: src/sap.ui.core/test/sap/ui/core/qunit/i18n/helper/_timezones.js
335
+
318
336
 
319
337
  Library: sap.ui.documentation:
320
338
 
@@ -450,7 +468,7 @@ License: Apache-2.0
450
468
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
451
469
  Contained in: lib/jsdoc/ui5/plugin.js
452
470
 
453
- Component: SAP Theming Base Content, version: 11.1.39
471
+ Component: SAP Theming Base Content, version: 11.1.40
454
472
  Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
455
473
  License: Apache-2.0
456
474
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
@@ -980,6 +998,21 @@ END of license: LicenseRef-JSONinJSPublicDomain
980
998
  =================================
981
999
 
982
1000
 
1001
+ =================================
1002
+ BEGIN of license: LicenseRef-tzdata-PublicDomain
1003
+ =================================
1004
+
1005
+ Unless specified below, all files in the tz code and data (including
1006
+ this LICENSE file) are in the public domain.
1007
+
1008
+ If the files date.c, newstrftime.3, and strftime.c are present, they
1009
+ contain material derived from BSD and use the BSD 3-clause license.
1010
+
1011
+ =================================
1012
+ END of license: LicenseRef-tzdata-PublicDomain
1013
+ =================================
1014
+
1015
+
983
1016
  =================================
984
1017
  BEGIN of license: MIT
985
1018
  =================================
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.core",
3
- "version": "1.102.2",
3
+ "version": "1.104.0",
4
4
  "description": "OpenUI5 Core Library sap.ui.core",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -368,7 +368,7 @@ sap.ui.define([
368
368
  /**
369
369
  * Root Namespace for the jQuery plug-in provided by SAP SE.
370
370
  *
371
- * @version 1.102.2
371
+ * @version 1.104.0
372
372
  * @namespace
373
373
  * @public
374
374
  * @static
@@ -542,7 +542,7 @@ sap.ui.define([
542
542
  * (and depending on the browser, if cookies are enabled, even though cookies are not used).
543
543
  *
544
544
  * @param {string} sRebootUrl the URL to sap-ui-core.js, from which the application should load UI5 on next restart; undefined clears the restart URL
545
- * @returns {string} the current reboot URL or undefined in case of an error or when the reboot URL has been cleared
545
+ * @returns {string|undefined} the current reboot URL or undefined in case of an error or when the reboot URL has been cleared
546
546
  *
547
547
  * @private
548
548
  * @function
@@ -67,7 +67,7 @@ sap.ui.define(['jquery.sap.global', 'sap/base/util/Properties'],
67
67
  * {@link #setProperty} to store or change a value for a key and {@link #getKeys}
68
68
  * can be used to retrieve an array of all keys that are currently stored in the collection.
69
69
  *
70
- * @version 1.102.2
70
+ * @version 1.104.0
71
71
  * @since 0.9.0
72
72
  * @name jQuery.sap.util.Properties
73
73
  * @public
@@ -99,7 +99,7 @@ sap.ui.define([
99
99
  * Exception: Fallback for "zh_HK" is "zh_TW" before zh.
100
100
  *
101
101
  * @author SAP SE
102
- * @version 1.102.2
102
+ * @version 1.104.0
103
103
  * @since 0.9.0
104
104
  * @name jQuery.sap.util.ResourceBundle
105
105
  * @public
@@ -267,7 +267,7 @@ sap.ui.define([
267
267
  * Use {@link jQuery.sap.getUriParameters} to create an instance of jQuery.sap.util.UriParameters.
268
268
  *
269
269
  * @author SAP SE
270
- * @version 1.102.2
270
+ * @version 1.104.0
271
271
  * @since 0.9.0
272
272
  * @name jQuery.sap.util.UriParameters
273
273
  * @public
@@ -37,7 +37,7 @@ sap.ui.define([
37
37
  * @param {string} [sIdPrefix] Prefix used for the Ids. If not set a default prefix is used.
38
38
  * @returns {jQuery.sap.storage.Storage}
39
39
  *
40
- * @version 1.102.2
40
+ * @version 1.104.0
41
41
  * @since 0.11.0
42
42
  * @namespace
43
43
  * @public
@@ -97,7 +97,7 @@ sap.ui.define([
97
97
  * should be deleted the method {@link #removeAll} should be used.
98
98
  *
99
99
  * @author SAP SE
100
- * @version 1.102.2
100
+ * @version 1.104.0
101
101
  * @since 0.11.0
102
102
  * @public
103
103
  * @name jQuery.sap.storage.Storage
@@ -201,7 +201,7 @@ sap.ui.define([
201
201
  * Enumeration of the storage types supported by {@link jQuery.sap.storage.Storage}
202
202
  * @enum {string}
203
203
  * @public
204
- * @version 1.102.2
204
+ * @version 1.104.0
205
205
  * @since 0.11.0
206
206
  */
207
207
  jQuery.sap.storage.Type = Storage.Type;
@@ -85,7 +85,7 @@ sap.ui.define([
85
85
  * @param {string} sLocale Locale to normalize
86
86
  * @param {boolean} [bPreserveLanguage=false] Whether to keep the language untouched, otherwise
87
87
  * the language is mapped from modern to legacy ISO639 codes, e.g. "sr" to "sh"
88
- * @returns {string} Normalized locale or undefined if the locale can't be normalized
88
+ * @returns {string|undefined} Normalized locale or <code>undefined</code> if the locale can't be normalized
89
89
  * @private
90
90
  */
91
91
  function normalize(sLocale, bPreserveLanguage) {
@@ -186,7 +186,7 @@ sap.ui.define([
186
186
  *
187
187
  * @param {string} sLocale locale to convert
188
188
  * @param {boolean} bConvertToModern whether to convert to modern language
189
- * @returns {string} Normalized locale or undefined if the locale can't be normalized
189
+ * @returns {string|undefined} Normalized locale or <code>undefined</code> if the locale can't be normalized
190
190
  */
191
191
  function convertLocaleToBCP47(sLocale, bConvertToModern) {
192
192
  var m;
@@ -5,15 +5,17 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- 'sap/ui/thirdparty/jquery',
8
+ 'sap/ui/util/XMLHelper',
9
9
  'sap/base/Log',
10
10
  'sap/base/assert',
11
- 'sap/base/util/extend'
11
+ 'sap/base/util/extend',
12
+ 'sap/base/util/mixedFetch'
12
13
  ], function(
13
- jQuery,
14
+ XMLHelper,
14
15
  Log,
15
16
  assert,
16
- extend
17
+ extend,
18
+ mixedFetch
17
19
  ) {
18
20
  "use strict";
19
21
 
@@ -246,9 +248,7 @@ sap.ui.define([
246
248
  var sType,
247
249
  oData,
248
250
  sUrl,
249
- oError,
250
- oDeferred,
251
- fnDone,
251
+ fnDone = function() {},
252
252
  iSyncCallBehavior;
253
253
 
254
254
  if (LoaderExtensions.notifyResourceLoading) {
@@ -271,44 +271,30 @@ sap.ui.define([
271
271
 
272
272
  assert(/^(xml|html|json|text)$/.test(sType), "type must be one of xml, html, json or text");
273
273
 
274
- oDeferred = mOptions.async ? new jQuery.Deferred() : null;
275
-
276
- function handleData(d, e) {
277
- if (d == null && mOptions.failOnError) {
278
- oError = e || new Error("no data returned for " + sResourceName);
279
- if (mOptions.async) {
280
- oDeferred.reject(oError);
281
- Log.error(oError);
282
- }
283
- if (fnDone) {
284
- fnDone();
285
- }
286
- return null;
287
- }
288
-
289
- if (mOptions.async) {
290
- oDeferred.resolve(d);
291
- }
292
- if (fnDone) {
293
- fnDone();
294
- }
295
- return d;
296
- }
297
-
298
274
  function convertData(d) {
299
- var vConverter = jQuery.ajaxSettings.converters["text " + sType];
300
- if (typeof vConverter === "function") {
301
- d = vConverter(d);
302
- }
303
- return handleData(d);
275
+ switch (sType) {
276
+ case "json":
277
+ return JSON.parse(d);
278
+ case "xml":
279
+ return XMLHelper.parse(d);
280
+ default:
281
+ return d;
282
+ }
304
283
  }
305
284
 
306
285
  oData = sap.ui.loader._.getModuleContent(sResourceName, mOptions.url);
307
286
 
308
287
  if (oData != undefined) {
288
+ // data available
309
289
  oData = convertData(oData);
310
- } else {
311
290
 
291
+ if (mOptions.async) {
292
+ return Promise.resolve(oData);
293
+ } else {
294
+ return oData;
295
+ }
296
+ } else {
297
+ // load data
312
298
  iSyncCallBehavior = sap.ui.loader._.getSyncCallBehavior();
313
299
  if (!mOptions.async && iSyncCallBehavior) {
314
300
  if (iSyncCallBehavior >= 1) { // temp. raise a warning only
@@ -318,34 +304,56 @@ sap.ui.define([
318
304
  }
319
305
  }
320
306
 
321
- jQuery.ajax({
322
- url: sUrl = mOptions.url || sap.ui.loader._.getResourcePath(sResourceName),
323
- async: mOptions.async,
324
- dataType: sType,
325
- headers: mOptions.headers,
326
- success: function(data, textStatus, xhr) {
327
- oData = handleData(data);
328
- },
329
- error: function(xhr, textStatus, error) {
330
- oError = new Error("resource " + sResourceName + " could not be loaded from " + sUrl + ". Check for 'file not found' or parse errors. Reason: " + error);
331
- oError.status = textStatus;
332
- oError.error = error;
333
- oError.statusCode = xhr.status;
334
- oData = handleData(null, oError);
335
- }
336
- });
307
+ var oHeaders = {};
308
+ if (sType) {
309
+ oHeaders["Accept"] = mixedFetch.ContentTypes[sType.toUpperCase()];
310
+ }
337
311
 
338
- }
312
+ sUrl = mOptions.url || sap.ui.loader._.getResourcePath(sResourceName);
313
+
314
+ var pResponse = mixedFetch(sUrl, {
315
+ headers: Object.assign(oHeaders, mOptions.headers)
316
+ }, !mOptions.async)
317
+ .then(function(response) {
318
+ if (response.ok) {
319
+ return response.text().then(function(responseText) {
320
+ return {
321
+ data: convertData(responseText)
322
+ };
323
+ });
324
+ } else {
325
+ var oError = new Error("resource " + sResourceName + " could not be loaded from " + sUrl +
326
+ ". Check for 'file not found' or parse errors. Reason: " + response.statusText || response.status);
327
+ oError.status = response.statusText;
328
+ oError.statusCode = response.status;
329
+ throw oError;
330
+ }
331
+ })
332
+ .catch(function(error) {
333
+ return {
334
+ data: null,
335
+ error: error
336
+ };
337
+ })
338
+ .then(function(oInfo) {
339
+ fnDone();
339
340
 
340
- if (mOptions.async) {
341
- return Promise.resolve(oDeferred);
342
- }
341
+ if (oInfo.data !== null) {
342
+ return oInfo.data;
343
+ } else if (mOptions.failOnError) {
344
+ Log.error(oInfo.error);
345
+ throw oInfo.error;
346
+ } else {
347
+ return null;
348
+ }
349
+ });
343
350
 
344
- if (oError != null && mOptions.failOnError) {
345
- throw oError;
351
+ if (mOptions.async) {
352
+ return pResponse;
353
+ } else {
354
+ return pResponse.unwrap();
355
+ }
346
356
  }
347
-
348
- return oData;
349
357
  };
350
358
 
351
359
  /**
@@ -0,0 +1,230 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+ sap.ui.define([], function () {
7
+ "use strict";
8
+
9
+ function parseHeaders(sAllResponseHeaders) {
10
+ var result = new Headers();
11
+ sAllResponseHeaders.trim().split("\r\n").forEach(function (sHeader) {
12
+ if (sHeader) {
13
+ var pos = sHeader.indexOf(": ");
14
+ if (pos > 0) {
15
+ result.append(sHeader.slice(0, pos), sHeader.slice(pos + 2));
16
+ } else {
17
+ result.append(sHeader, "");
18
+ }
19
+ }
20
+ });
21
+ return result;
22
+ }
23
+
24
+ /**
25
+ * Represents the response object to a {@link module:sap/base/util/fetch} request and {@link module:sap/base/util/syncFetch} request.
26
+ * The implementation is based on the Response interface of the global <code>fetch()</code> method,
27
+ * but brings a much reduced set of properties and methods.
28
+ *
29
+ * The properties that are provided:
30
+ * <ul>
31
+ * <li>The <code>headers</code> property containing the <code>Headers</code> object</li>
32
+ * <li>The <code>ok</code> property containing a boolean stating whether the response was successful</li>
33
+ * <li>The <code>status</code> property containing the HTTP status code</li>
34
+ * <li>The <code>statusText</code> property containing an HTTP status message</li>
35
+ * </ul>
36
+ *
37
+ * The methods that are provided:
38
+ * <ul>
39
+ * <li>The <code>json()</code> method returns a promise that resolves with the result of parsing the XHR response text as JSON</li>
40
+ * <li>The <code>text()</code> method returns a promise that resolves with the XHR response text as String</li>
41
+ * </ul>
42
+ *
43
+ * In case of a response to a synchronous <code>sap.base.util.syncFetch</code> request,
44
+ * all methods will return the XHR response directly, according to the respective output format.
45
+ *
46
+ *
47
+ * @param {XMLHttpRequest} xhr The XMLHttpRequest object
48
+ * @param {Promise|sap.ui.base.SyncPromise} PromiseImpl A Promise for asynchronous requests, and
49
+ * an <code>sap.ui.base.SyncPromise</code> for synchronous requests.
50
+ * @interface
51
+ * @alias sap.base.util.SimpleResponse
52
+ * @private
53
+ * @ui5-restricted SAPUI5 Dist
54
+ */
55
+ function SimpleResponse(xhr, PromiseImpl) {
56
+ this.xhr = xhr;
57
+
58
+ var headers = parseHeaders(this.xhr.getAllResponseHeaders());
59
+ Object.defineProperties(this, {
60
+ headers: {
61
+ value: headers
62
+ },
63
+ ok: {
64
+ value: this.xhr.status >= 200 && this.xhr.status < 300
65
+ },
66
+ status: {
67
+ value: this.xhr.status
68
+ },
69
+ statusText: {
70
+ value: this.xhr.statusText
71
+ }
72
+ });
73
+
74
+ this.json = function() {
75
+ if (this.xhr.responseType === "json") {
76
+ return PromiseImpl.resolve(this.xhr.response);
77
+ } else {
78
+ try {
79
+ var oData = JSON.parse(this.xhr.responseText);
80
+ return PromiseImpl.resolve(oData);
81
+ } catch (err) {
82
+ return PromiseImpl.reject(err);
83
+ }
84
+ }
85
+ };
86
+
87
+ this.text = function() {
88
+ return PromiseImpl.resolve(this.xhr.responseText);
89
+ };
90
+ }
91
+
92
+ // Allowed request credentials
93
+ var ALLOWED_CREDENTIALS = ["include", "omit", "same-origin"];
94
+
95
+ /**
96
+ * Performs an asynchronous XMLHttpRequest (XHR) with the provided resource URL and request settings.
97
+ * It returns a Promise that resolves with an <code>sap.base.util.SimpleResponse</code> object, which is
98
+ * a simplified implementation of the global Response interface, representing the response of the XHR.
99
+ *
100
+ * If the request encounters network failures, the returned promise will be rejected with a <code>TypeError</code>.
101
+ * In case of an HTTP error status (e.g. error status 404), the returned promise will resolve instead.
102
+ * The <code>response.ok</code> or <code>response.status</code> flags can be used to distinguish
103
+ * a success status from an error status.
104
+ *
105
+ * The Promise will reject with a <code>DOMException</code> if the request gets aborted.
106
+ * To abort a request, an instance of the global <code>AbortSignal</code> must be provided to the settings via property <code>init.signal</code>.
107
+ * An abort signal can be created via an instance of the <code>AbortController</code>, and then using
108
+ * the <code>AbortController.signal</code> property. The signal associates the abort controller with the request
109
+ * and allows it to abort the XHR by calling <code>AbortController.abort()</code>.
110
+ *
111
+ * Although the usage of this method is very similar to the native <code>fetch()</code> method,
112
+ * it allows a much reduced set of request settings (in the <code>init</code> argument).
113
+ *
114
+ * @param {string} resource A string containing the URL to which the request is sent
115
+ * @param {object} [init] A set of key/value pairs that configure the request.
116
+ * @param {any} [init.body] Any body that you want to add to your request: this can be a Blob, BufferSource, FormData, URLSearchParams, string, or ReadableStream object.
117
+ * Note that a request using the GET or HEAD method cannot have a body.
118
+ * @param {"omit"|"same-origin"|"include"} [init.credentials='same-origin'] Controls what browsers do with credentials.
119
+ * Must be either 'omit', 'same-origin' or 'include'.
120
+ * @param {Headers|object} [init.headers] A Headers object or an object with key/value pairs containing the request headers
121
+ * @param {string} [init.method='GET'] The request method, e.g. 'GET', 'POST'
122
+ * @param {AbortSignal} [init.signal] An AbortSignal object instance which allows to abort the request
123
+ * @return {Promise<sap.base.util.SimpleResponse>} Returns a Promise resolving with <code>sap.base.util.SimpleResponse</code>
124
+ *
125
+ * @alias module:sap/base/util/fetch
126
+ * @private
127
+ * @ui5-restricted SAPUI5 Dist
128
+ */
129
+ function fetch(resource, init, _mImplementations) {
130
+ /**
131
+ * see "https://developer.mozilla.org/en-US/docs/Web/API/Request/Request"
132
+ * regarding default values
133
+ */
134
+ init = Object.assign({
135
+ body: null,
136
+ credentials: "same-origin",
137
+ method: "GET",
138
+ signal: new AbortController().signal
139
+ // mode: "cors",
140
+ // redirect: "follow",
141
+ // referrer: "about:client"
142
+ }, init);
143
+
144
+ // "sap/base/util/syncFetch" might pass a SyncPromise implementation
145
+ var PromiseImpl = (_mImplementations && _mImplementations.promiseImpl) || Promise;
146
+
147
+ return new PromiseImpl(function(resolve, reject) {
148
+ // check for credentials in the resource URL
149
+ var oUrl = new URL(resource, document.baseURI);
150
+ if (oUrl.username || oUrl.password) {
151
+ reject(new TypeError("Failed to execute 'fetch': Request cannot be constructed from a URL that includes credentials:" + resource));
152
+ }
153
+
154
+ if (init.body !== null && (init.method == "GET" || init.method == "HEAD")) {
155
+ reject(new TypeError("Failed to execute 'fetch': Request with GET/HEAD method cannot have body."));
156
+ }
157
+
158
+ var xhr = new XMLHttpRequest();
159
+ // event listener
160
+ xhr.addEventListener("load", function() {
161
+ var oResponse = new SimpleResponse(xhr, PromiseImpl);
162
+
163
+ if (_mImplementations && _mImplementations.responseMixin) {
164
+ _mImplementations.responseMixin.apply(oResponse);
165
+ }
166
+ resolve(oResponse);
167
+ });
168
+ xhr.addEventListener("error", function() {
169
+ reject(new TypeError("Failed to fetch."));
170
+ });
171
+
172
+ xhr.open(init.method, resource, _mImplementations ? false : true);
173
+
174
+ // see https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort
175
+ init.signal.addEventListener("abort", function () {
176
+ xhr.abort();
177
+ reject(new DOMException("The user aborted a request.", "AbortError"));
178
+ });
179
+
180
+ // set request headers
181
+ var oHeaders;
182
+ if (init.headers instanceof Headers) {
183
+ oHeaders = Object.fromEntries(init.headers);
184
+ } else {
185
+ oHeaders = init.headers || {};
186
+ }
187
+ Object.keys(oHeaders).forEach(function(key) {
188
+ xhr.setRequestHeader(key, oHeaders[key]);
189
+ });
190
+
191
+ // request credentials
192
+ if (ALLOWED_CREDENTIALS.includes(init.credentials)) {
193
+ // set credentials
194
+ if (init.credentials === "omit") {
195
+ xhr.withCredentials = false;
196
+ } else if (init.credentials === "include") {
197
+ xhr.withCredentials = true;
198
+ }
199
+ } else {
200
+ reject(new TypeError("Failed to execute 'fetch': Failed to read the 'credentials' property from 'RequestInit': The provided value " + init.credentials
201
+ + " is not a valid enum value of type RequestCredentials."));
202
+ }
203
+
204
+ // send request
205
+ try {
206
+ xhr.send(init.body);
207
+ } catch (error) {
208
+ reject(new TypeError(error.message));
209
+ }
210
+ });
211
+ }
212
+
213
+ /**
214
+ * Header values that can be used with the "Accept" and "Content-Type" headers
215
+ * in the fetch call or the response object.
216
+ *
217
+ * @type {Object}
218
+ * @private
219
+ * @ui5-restricted SAPUI5 Dist
220
+ *
221
+ */
222
+ fetch.ContentTypes = {
223
+ TEXT: "text/plain",
224
+ HTML: "text/html",
225
+ XML: "application/xml, text/xml",
226
+ JSON: "application/json, text/javascript"
227
+ };
228
+
229
+ return fetch;
230
+ });