@openui5/sap.ui.core 1.93.3 → 1.96.2

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 (416) hide show
  1. package/.eslintrc.json +13 -2
  2. package/.reuse/dep5 +6 -11
  3. package/THIRDPARTY.txt +10 -16
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +5 -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/jquery.sap.stubs.js +2 -1
  11. package/src/jquery.sap.trace.js +2 -1
  12. package/src/sap/base/i18n/ResourceBundle.js +6 -2
  13. package/src/sap/base/strings/whitespaceReplacer.js +52 -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/ui/Device.js +37 -42
  56. package/src/sap/ui/Global.js +8 -7
  57. package/src/sap/ui/base/DataType.js +14 -8
  58. package/src/sap/ui/base/Event.js +1 -1
  59. package/src/sap/ui/base/EventProvider.js +1 -1
  60. package/src/sap/ui/base/ExpressionParser.js +9 -6
  61. package/src/sap/ui/base/Interface.js +3 -49
  62. package/src/sap/ui/base/ManagedObject.js +12 -7
  63. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  64. package/src/sap/ui/base/Metadata.js +1 -1
  65. package/src/sap/ui/base/Object.js +49 -4
  66. package/src/sap/ui/base/ObjectPool.js +1 -1
  67. package/src/sap/ui/base/syncXHRFix.js +2 -1
  68. package/src/sap/ui/core/.library +5 -5
  69. package/src/sap/ui/core/AppCacheBuster.js +4 -4
  70. package/src/sap/ui/core/BusyIndicator.js +1 -11
  71. package/src/sap/ui/core/Component.js +300 -140
  72. package/src/sap/ui/core/ComponentContainer.js +24 -8
  73. package/src/sap/ui/core/ComponentMetadata.js +14 -3
  74. package/src/sap/ui/core/ComponentSupport.js +1 -1
  75. package/src/sap/ui/core/Configuration.js +67 -31
  76. package/src/sap/ui/core/Control.js +1 -1
  77. package/src/sap/ui/core/Core.js +103 -25
  78. package/src/sap/ui/core/CustomData.js +1 -1
  79. package/src/sap/ui/core/CustomizingConfiguration.js +35 -260
  80. package/src/sap/ui/core/DeclarativeSupport.js +3 -2
  81. package/src/sap/ui/core/Element.js +1 -1
  82. package/src/sap/ui/core/ElementMetadata.js +4 -2
  83. package/src/sap/ui/core/EnabledPropagator.js +91 -73
  84. package/src/sap/ui/core/EventBus.js +1 -1
  85. package/src/sap/ui/core/ExtensionPoint.js +7 -14
  86. package/src/sap/ui/core/Fragment.js +30 -32
  87. package/src/sap/ui/core/HTML.js +1 -1
  88. package/src/sap/ui/core/History.js +1 -1
  89. package/src/sap/ui/core/Icon.js +7 -8
  90. package/src/sap/ui/core/IconPool.js +26 -1097
  91. package/src/sap/ui/core/IconRenderer.js +6 -6
  92. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  93. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  94. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  95. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  96. package/src/sap/ui/core/InvisibleText.js +1 -1
  97. package/src/sap/ui/core/Item.js +1 -1
  98. package/src/sap/ui/core/LabelEnablement.js +1 -1
  99. package/src/sap/ui/core/LayoutData.js +1 -1
  100. package/src/sap/ui/core/ListItem.js +1 -1
  101. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  102. package/src/sap/ui/core/Locale.js +26 -4
  103. package/src/sap/ui/core/LocaleData.js +1 -1
  104. package/src/sap/ui/core/Manifest.js +4 -61
  105. package/src/sap/ui/core/Message.js +1 -1
  106. package/src/sap/ui/core/Patcher.js +27 -3
  107. package/src/sap/ui/core/Placeholder.js +28 -15
  108. package/src/sap/ui/core/RenderManager.js +36 -6
  109. package/src/sap/ui/core/Renderer.js +13 -3
  110. package/src/sap/ui/core/ResizeHandler.js +1 -1
  111. package/src/sap/ui/core/ScrollBar.js +2 -2
  112. package/src/sap/ui/core/SeparatorItem.js +1 -1
  113. package/src/sap/ui/core/ShortcutHintsMixin.js +14 -7
  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 +42 -16
  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 +2 -2
  122. package/src/sap/ui/core/XMLCompositeMetadata.js +2 -2
  123. package/src/sap/ui/core/XMLTemplateProcessor.js +116 -41
  124. package/src/sap/ui/core/_IconRegistry.js +1148 -0
  125. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  126. package/src/sap/ui/core/delegate/ScrollEnablement.js +6 -3
  127. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  128. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  129. package/src/sap/ui/core/dnd/DragInfo.js +2 -2
  130. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  131. package/src/sap/ui/core/format/NumberFormat.js +16 -1
  132. package/src/sap/ui/core/hyphenation/Hyphenation.js +73 -221
  133. package/src/sap/ui/core/hyphenation/HyphenationTestingWords.js +11 -10
  134. package/src/sap/ui/core/library.js +3 -3
  135. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  136. package/src/sap/ui/core/message/Message.js +1 -1
  137. package/src/sap/ui/core/message/MessageManager.js +13 -15
  138. package/src/sap/ui/core/message/MessageParser.js +1 -1
  139. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  140. package/src/sap/ui/core/messagebundle_de.properties +1 -1
  141. package/src/sap/ui/core/messagebundle_fr.properties +1 -1
  142. package/src/sap/ui/core/messagebundle_it.properties +1 -1
  143. package/src/sap/ui/core/messagebundle_pl.properties +1 -1
  144. package/src/sap/ui/core/messagebundle_th.properties +2 -2
  145. package/src/sap/ui/core/mvc/Controller.js +38 -19
  146. package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +30 -32
  147. package/src/sap/ui/core/mvc/ControllerMetadata.js +18 -18
  148. package/src/sap/ui/core/mvc/HTMLView.js +2 -2
  149. package/src/sap/ui/core/mvc/JSONView.js +2 -2
  150. package/src/sap/ui/core/mvc/JSView.js +2 -2
  151. package/src/sap/ui/core/mvc/TemplateView.js +2 -2
  152. package/src/sap/ui/core/mvc/View.js +58 -85
  153. package/src/sap/ui/core/mvc/XMLView.js +2 -2
  154. package/src/sap/ui/core/mvc/XMLViewRenderer.js +17 -20
  155. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  156. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  157. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  158. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  159. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  160. package/src/sap/ui/core/routing/History.js +10 -2
  161. package/src/sap/ui/core/routing/Router.js +8 -1
  162. package/src/sap/ui/core/routing/Target.js +13 -0
  163. package/src/sap/ui/core/routing/Targets.js +13 -2
  164. package/src/sap/ui/core/routing/async/Route.js +1 -1
  165. package/src/sap/ui/core/routing/async/Target.js +353 -259
  166. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  167. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  168. package/src/sap/ui/core/service/Service.js +1 -1
  169. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  170. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  171. package/src/sap/ui/core/support/BootSupportTool.js +11 -0
  172. package/src/sap/ui/core/support/InteractionTree.css +4 -0
  173. package/src/sap/ui/core/support/Plugin.js +1 -1
  174. package/src/sap/ui/core/support/Support.js +1 -1
  175. package/src/sap/ui/core/support/ViewInfo.css +599 -0
  176. package/src/sap/ui/core/support/controls/InteractionTree.js +352 -222
  177. package/src/sap/ui/core/support/controls/ObjectViewer.js +3 -41
  178. package/src/sap/ui/core/support/controls/TimelineOverview.js +49 -24
  179. package/src/sap/ui/core/support/controls/TreeViewer.js +12 -58
  180. package/src/sap/ui/core/support/plugins/ControlTree.js +59 -68
  181. package/src/sap/ui/core/support/plugins/Debugging.js +9 -11
  182. package/src/sap/ui/core/support/plugins/Interaction.js +2 -2
  183. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  184. package/src/sap/ui/core/support/plugins/Performance.js +147 -75
  185. package/src/sap/ui/core/support/plugins/Selector.js +19 -24
  186. package/src/sap/ui/core/support/plugins/TechInfo.js +5 -5
  187. package/src/sap/ui/core/support/plugins/Trace.js +95 -32
  188. package/src/sap/ui/core/support/plugins/ViewInfo.js +9 -73
  189. package/src/sap/ui/core/support/support.css +109 -14
  190. package/src/sap/ui/core/support/support.html +6 -2
  191. package/src/sap/ui/core/support/techinfo/TechnicalInfo.fragment.xml +1 -0
  192. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +149 -72
  193. package/src/sap/ui/core/themes/base/Icon.less +9 -0
  194. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  195. package/src/sap/ui/core/theming/Parameters.js +6 -4
  196. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  197. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  198. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  199. package/src/sap/ui/core/tmpl/Template.js +10 -28
  200. package/src/sap/ui/core/tmpl/TemplateControl.js +4 -4
  201. package/src/sap/ui/core/tmpl/_parsePath.js +35 -0
  202. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  203. package/src/sap/ui/core/util/DraftEnabledMockServer.js +9 -4
  204. package/src/sap/ui/core/util/Export.js +1 -1
  205. package/src/sap/ui/core/util/ExportCell.js +1 -1
  206. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  207. package/src/sap/ui/core/util/ExportRow.js +1 -1
  208. package/src/sap/ui/core/util/ExportType.js +1 -1
  209. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  210. package/src/sap/ui/core/util/File.js +1 -1
  211. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  212. package/src/sap/ui/core/util/MockServer.js +5 -5
  213. package/src/sap/ui/core/util/MockServerAnnotationsHandler.js +3 -2
  214. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  215. package/src/sap/ui/core/util/XMLPreprocessor.js +11 -12
  216. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +136 -63
  217. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +170 -153
  218. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +424 -293
  219. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  220. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  221. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  222. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  223. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  224. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  225. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  226. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  227. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  228. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  229. package/src/sap/ui/debug/ControlTree.js +10 -4
  230. package/src/sap/ui/debug/DebugEnv.js +3 -4
  231. package/src/sap/ui/debug/Highlighter.js +8 -2
  232. package/src/sap/ui/debug/PropertyList.css +55 -0
  233. package/src/sap/ui/debug/PropertyList.js +111 -182
  234. package/src/sap/ui/model/Binding.js +174 -118
  235. package/src/sap/ui/model/ClientContextBinding.js +1 -1
  236. package/src/sap/ui/model/ClientListBinding.js +1 -3
  237. package/src/sap/ui/model/ClientModel.js +4 -4
  238. package/src/sap/ui/model/ClientPropertyBinding.js +4 -2
  239. package/src/sap/ui/model/ClientTreeBinding.js +15 -9
  240. package/src/sap/ui/model/ClientTreeBindingAdapter.js +28 -23
  241. package/src/sap/ui/model/CompositeBinding.js +98 -77
  242. package/src/sap/ui/model/CompositeDataState.js +2 -2
  243. package/src/sap/ui/model/CompositeType.js +2 -2
  244. package/src/sap/ui/model/Context.js +4 -2
  245. package/src/sap/ui/model/ContextBinding.js +6 -14
  246. package/src/sap/ui/model/DataState.js +2 -2
  247. package/src/sap/ui/model/Filter.js +255 -53
  248. package/src/sap/ui/model/FilterOperator.js +1 -1
  249. package/src/sap/ui/model/FilterProcessor.js +27 -17
  250. package/src/sap/ui/model/FilterType.js +1 -1
  251. package/src/sap/ui/model/ListBinding.js +180 -117
  252. package/src/sap/ui/model/MetaModel.js +4 -9
  253. package/src/sap/ui/model/Model.js +345 -294
  254. package/src/sap/ui/model/PropertyBinding.js +92 -58
  255. package/src/sap/ui/model/SelectionModel.js +2 -2
  256. package/src/sap/ui/model/SimpleType.js +2 -2
  257. package/src/sap/ui/model/Sorter.js +1 -1
  258. package/src/sap/ui/model/SorterProcessor.js +1 -1
  259. package/src/sap/ui/model/StaticBinding.js +1 -1
  260. package/src/sap/ui/model/TreeAutoExpandMode.js +2 -2
  261. package/src/sap/ui/model/TreeBinding.js +1 -1
  262. package/src/sap/ui/model/TreeBindingAdapter.js +251 -100
  263. package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +16 -9
  264. package/src/sap/ui/model/TreeBindingUtils.js +1 -0
  265. package/src/sap/ui/model/Type.js +1 -1
  266. package/src/sap/ui/model/analytics/AnalyticalBinding.js +8 -4
  267. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +1 -1
  268. package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +1 -1
  269. package/src/sap/ui/model/analytics/BatchResponseCollector.js +1 -1
  270. package/src/sap/ui/model/analytics/ODataModelAdapter.js +1 -1
  271. package/src/sap/ui/model/analytics/odata4analytics.js +34 -25
  272. package/src/sap/ui/model/base/ManagedObjectModel.js +4 -0
  273. package/src/sap/ui/model/json/JSONListBinding.js +8 -5
  274. package/src/sap/ui/model/json/JSONModel.js +24 -15
  275. package/src/sap/ui/model/json/JSONPropertyBinding.js +4 -3
  276. package/src/sap/ui/model/json/JSONTreeBinding.js +1 -1
  277. package/src/sap/ui/model/message/MessageListBinding.js +6 -3
  278. package/src/sap/ui/model/message/MessageModel.js +23 -15
  279. package/src/sap/ui/model/message/MessagePropertyBinding.js +2 -2
  280. package/src/sap/ui/model/odata/AnnotationHelper.js +1 -1
  281. package/src/sap/ui/model/odata/AnnotationParser.js +1 -1
  282. package/src/sap/ui/model/odata/CountMode.js +1 -1
  283. package/src/sap/ui/model/odata/Filter.js +1 -1
  284. package/src/sap/ui/model/odata/ODataAnnotations.js +2 -2
  285. package/src/sap/ui/model/odata/ODataContextBinding.js +1 -1
  286. package/src/sap/ui/model/odata/ODataListBinding.js +1 -1
  287. package/src/sap/ui/model/odata/ODataMessageParser.js +2 -2
  288. package/src/sap/ui/model/odata/ODataMetaModel.js +5 -3
  289. package/src/sap/ui/model/odata/ODataMetadata.js +2 -2
  290. package/src/sap/ui/model/odata/ODataModel.js +8 -7
  291. package/src/sap/ui/model/odata/ODataPropertyBinding.js +1 -1
  292. package/src/sap/ui/model/odata/ODataTreeBinding.js +65 -33
  293. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +1 -1
  294. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +2 -2
  295. package/src/sap/ui/model/odata/ODataUtils.js +13 -11
  296. package/src/sap/ui/model/odata/OperationMode.js +1 -1
  297. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +1 -1
  298. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  299. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  300. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  301. package/src/sap/ui/model/odata/type/Date.js +1 -1
  302. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  303. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  304. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  305. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  306. package/src/sap/ui/model/odata/type/Double.js +1 -1
  307. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  308. package/src/sap/ui/model/odata/type/Int.js +1 -1
  309. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  310. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  311. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  312. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  313. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  314. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  315. package/src/sap/ui/model/odata/type/Single.js +1 -1
  316. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  317. package/src/sap/ui/model/odata/type/String.js +1 -1
  318. package/src/sap/ui/model/odata/type/Time.js +1 -1
  319. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  320. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  321. package/src/sap/ui/model/odata/v2/Context.js +81 -9
  322. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +3 -3
  323. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +39 -49
  324. package/src/sap/ui/model/odata/v2/ODataListBinding.js +236 -73
  325. package/src/sap/ui/model/odata/v2/ODataModel.js +314 -164
  326. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +110 -97
  327. package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +129 -0
  328. package/src/sap/ui/model/odata/v4/Context.js +6 -3
  329. package/src/sap/ui/model/odata/v4/ODataBinding.js +5 -6
  330. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +117 -40
  331. package/src/sap/ui/model/odata/v4/ODataListBinding.js +95 -15
  332. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +44 -31
  333. package/src/sap/ui/model/odata/v4/ODataModel.js +86 -78
  334. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +47 -28
  335. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +11 -7
  336. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +10 -3
  337. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +8 -1
  338. package/src/sap/ui/model/odata/v4/lib/_Cache.js +24 -16
  339. package/src/sap/ui/model/odata/v4/lib/_Helper.js +32 -30
  340. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +52 -17
  341. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +2 -2
  342. package/src/sap/ui/model/resource/ResourceModel.js +6 -2
  343. package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
  344. package/src/sap/ui/model/type/Boolean.js +2 -2
  345. package/src/sap/ui/model/type/Currency.js +2 -2
  346. package/src/sap/ui/model/type/Date.js +9 -3
  347. package/src/sap/ui/model/type/DateInterval.js +4 -2
  348. package/src/sap/ui/model/type/DateTime.js +2 -2
  349. package/src/sap/ui/model/type/DateTimeInterval.js +2 -2
  350. package/src/sap/ui/model/type/FileSize.js +4 -2
  351. package/src/sap/ui/model/type/Float.js +4 -2
  352. package/src/sap/ui/model/type/Integer.js +4 -2
  353. package/src/sap/ui/model/type/String.js +2 -2
  354. package/src/sap/ui/model/type/Time.js +2 -2
  355. package/src/sap/ui/model/type/TimeInterval.js +2 -2
  356. package/src/sap/ui/model/type/Unit.js +14 -7
  357. package/src/sap/ui/model/xml/XMLListBinding.js +15 -9
  358. package/src/sap/ui/model/xml/XMLModel.js +70 -41
  359. package/src/sap/ui/model/xml/XMLPropertyBinding.js +4 -4
  360. package/src/sap/ui/model/xml/XMLTreeBinding.js +5 -4
  361. package/src/sap/ui/performance/trace/Interaction.js +30 -15
  362. package/src/sap/ui/performance/trace/initTraces.js +1 -1
  363. package/src/sap/ui/qunit/QUnitUtils.js +3 -2
  364. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  365. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +9 -11
  366. package/src/sap/ui/test/TestUtils.js +11 -4
  367. package/src/sap/ui/test/actions/Drag.js +6 -2
  368. package/src/sap/ui/test/actions/Drop.js +6 -2
  369. package/src/sap/ui/test/actions/EnterText.js +6 -0
  370. package/src/sap/ui/test/actions/Press.js +6 -0
  371. package/src/sap/ui/test/actions/Scroll.js +6 -0
  372. package/src/sap/ui/test/autowaiter/_resourceWaiter.js +4 -4
  373. package/src/sap/ui/test/launchers/componentLauncher.js +0 -4
  374. package/src/sap/ui/test/matchers/I18NText.js +29 -11
  375. package/src/sap/ui/test/opaQunit.js +5 -0
  376. package/src/sap/ui/thirdparty/crossroads.js +6 -4
  377. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly.js +1196 -0
  378. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly_Loader.js +797 -0
  379. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.asm.js +108 -127
  380. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.wasm +0 -0
  381. package/src/sap/ui/thirdparty/hyphenopoly/patterns/bg.hpb +0 -0
  382. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ca.hpb +0 -0
  383. package/src/sap/ui/thirdparty/hyphenopoly/patterns/da.hpb +0 -0
  384. package/src/sap/ui/thirdparty/hyphenopoly/patterns/de.hpb +0 -0
  385. package/src/sap/ui/thirdparty/hyphenopoly/patterns/el-monoton.hpb +0 -0
  386. package/src/sap/ui/thirdparty/hyphenopoly/patterns/en-us.hpb +0 -0
  387. package/src/sap/ui/thirdparty/hyphenopoly/patterns/es.hpb +0 -0
  388. package/src/sap/ui/thirdparty/hyphenopoly/patterns/et.hpb +0 -0
  389. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fi.hpb +0 -0
  390. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fr.hpb +0 -0
  391. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hi.hpb +0 -0
  392. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hr.hpb +0 -0
  393. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hu.hpb +0 -0
  394. package/src/sap/ui/thirdparty/hyphenopoly/patterns/it.hpb +0 -0
  395. package/src/sap/ui/thirdparty/hyphenopoly/patterns/lt.hpb +0 -0
  396. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nb-no.hpb +0 -0
  397. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nl.hpb +0 -0
  398. package/src/sap/ui/thirdparty/hyphenopoly/patterns/pt.hpb +0 -0
  399. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ru.hpb +0 -0
  400. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sl.hpb +0 -0
  401. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sv.hpb +0 -0
  402. package/src/sap/ui/thirdparty/hyphenopoly/patterns/th.hpb +0 -0
  403. package/src/sap/ui/thirdparty/hyphenopoly/patterns/tr.hpb +0 -0
  404. package/src/sap/ui/thirdparty/hyphenopoly/patterns/uk.hpb +0 -0
  405. package/src/sap/ui/thirdparty/jquery.js +9 -1
  406. package/src/sap/ui/thirdparty/qunit-2.js +1 -1
  407. package/src/sap/ui/thirdparty/qunit.js +1 -1
  408. package/src/sap/ui/util/Mobile.js +2 -20
  409. package/src/sap/ui/util/Storage.js +1 -1
  410. package/src/sap/ui/util/isCrossOriginURL.js +16 -6
  411. package/src/sap-ui-core-nojQuery.js +1 -1
  412. package/src/sap-ui-core.js +1 -1
  413. package/src/sap-ui-debug.js +3 -17
  414. package/ui5.yaml +5 -2
  415. package/src/sap/ui/core/support/plugins/MessageTest.js +0 -96
  416. package/src/sap/ui/thirdparty/hyphenopoly/hyphenopoly.bundle.js +0 -860
@@ -3,7 +3,7 @@
3
3
  * (c) Copyright 2009-2021 SAP SE or an SAP affiliate company.
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
-
6
+ /*eslint-disable max-len */
7
7
  /**
8
8
  * OData-based DataBinding
9
9
  *
@@ -14,6 +14,7 @@
14
14
 
15
15
  //Provides class sap.ui.model.odata.v2.ODataModel
16
16
  sap.ui.define([
17
+ "./_CreatedContextsCache",
17
18
  "./Context",
18
19
  "./ODataAnnotations",
19
20
  "./ODataContextBinding",
@@ -31,6 +32,7 @@ sap.ui.define([
31
32
  "sap/base/util/merge",
32
33
  "sap/base/util/uid",
33
34
  "sap/base/util/UriParameters",
35
+ "sap/ui/base/SyncPromise",
34
36
  "sap/ui/core/library",
35
37
  "sap/ui/core/message/Message",
36
38
  "sap/ui/core/message/MessageParser",
@@ -48,13 +50,14 @@ sap.ui.define([
48
50
  "sap/ui/model/odata/OperationMode",
49
51
  "sap/ui/model/odata/UpdateMethod",
50
52
  "sap/ui/thirdparty/datajs",
51
- "sap/ui/thirdparty/URI"
52
- ], function(Context, ODataAnnotations, ODataContextBinding, ODataListBinding, ODataTreeBinding,
53
- assert, Log, encodeURL, deepEqual, deepExtend, each, extend, isEmptyObject, isPlainObject,
54
- merge, uid, UriParameters, coreLibrary, Message, MessageParser, BindingMode, BaseContext,
55
- FilterProcessor, Model, CountMode, MessageScope, ODataMetadata, ODataMetaModel,
56
- ODataMessageParser, ODataPropertyBinding, ODataUtils, OperationMode, UpdateMethod, OData,
57
- URI
53
+ "sap/ui/thirdparty/URI",
54
+ "sap/ui/util/isCrossOriginURL"
55
+ ], function(_CreatedContextsCache, Context, ODataAnnotations, ODataContextBinding, ODataListBinding,
56
+ ODataTreeBinding, assert, Log, encodeURL, deepEqual, deepExtend, each, extend,
57
+ isEmptyObject, isPlainObject, merge, uid, UriParameters, SyncPromise, coreLibrary, Message,
58
+ MessageParser, BindingMode, BaseContext, FilterProcessor, Model, CountMode, MessageScope,
59
+ ODataMetadata, ODataMetaModel, ODataMessageParser, ODataPropertyBinding, ODataUtils,
60
+ OperationMode, UpdateMethod, OData, URI, isCrossOriginURL
58
61
  ) {
59
62
 
60
63
  "use strict";
@@ -195,8 +198,10 @@ sap.ui.define([
195
198
  * See chapter {@link topic:6c47b2b39db9404582994070ec3d57a2 OData V2 Model} for a general
196
199
  * introduction.
197
200
  *
201
+ * This model is not prepared to be inherited from.
202
+ *
198
203
  * @author SAP SE
199
- * @version 1.93.3
204
+ * @version 1.96.2
200
205
  *
201
206
  * @public
202
207
  * @alias sap.ui.model.odata.v2.ODataModel
@@ -339,6 +344,7 @@ sap.ui.define([
339
344
  this.mChangedEntities4checkUpdate = {};
340
345
  this.bPersistTechnicalMessages = bPersistTechnicalMessages === undefined
341
346
  ? undefined : !!bPersistTechnicalMessages;
347
+ this.oCreatedContextsCache = new _CreatedContextsCache();
342
348
 
343
349
  if (oMessageParser) {
344
350
  oMessageParser.setProcessor(this);
@@ -487,6 +493,13 @@ sap.ui.define([
487
493
  this.oHeaders["MaxDataServiceVersion"] = this.sMaxDataServiceVersion;
488
494
  }
489
495
 
496
+ // "XMLHttpRequest" indicates that a data request is performed.
497
+ // Gets only applied to non-crossOrigin requests because cross origin requests could
498
+ // result in unwanted preflight requests if this header is set.
499
+ // This behaviour is in sync with jQuery.ajax which is used by OData V4.
500
+ if (!this.mCustomHeaders["X-Requested-With"] && !isCrossOriginURL(this.sServiceUrl)) {
501
+ this.oHeaders["X-Requested-With"] = "XMLHttpRequest";
502
+ }
490
503
  },
491
504
  metadata : {
492
505
  publicMethods : ["read", "create", "update", "remove", "submitChanges", "getServiceMetadata", "metadataLoaded",
@@ -1953,6 +1966,12 @@ sap.ui.define([
1953
1966
  * @param {Object<string,string>} [mParameters.custom] Optional map of custom query parameters (name/value pairs); names of custom parameters must not start with <code>$</code>
1954
1967
  * @param {sap.ui.model.odata.CountMode} [mParameters.countMode] Count mode for this binding;
1955
1968
  * if not specified, the default count mode for this model is used
1969
+ * @param {string} [mParameters.createdEntitiesKey=""]
1970
+ * A key used in combination with the resolved path of the binding to identify the entities
1971
+ * created via the binding's {@link #create} method.
1972
+ *
1973
+ * <b>Note:</b> Different controls or control aggregation bindings to the same collection must
1974
+ * have different <code>createdEntitiesKey</code> values.
1956
1975
  * @param {sap.ui.model.odata.OperationMode} [mParameters.operationMode] Operation mode for this binding;
1957
1976
  * if not specified, the default operation mode of this model is used
1958
1977
  * @param {boolean} [mParameters.faultTolerant] Turns on the fault tolerance mode, data is not reset if a backend request returns an error
@@ -2822,9 +2841,10 @@ sap.ui.define([
2822
2841
  * attributes, use <code>{select: "*"}</code> instead.
2823
2842
  *
2824
2843
  * <b>Note:</b> If <code>mParameters.select</code> is given and not all selected properties are
2825
- * available, this method returns <code>undefined</code> instead of incomplete data. If
2826
- * <code>mParameters.select</code> is not given, all properties available on the client are
2827
- * returned.
2844
+ * available, this method returns <code>undefined</code> instead of incomplete data.
2845
+ *
2846
+ * <b>Note:</b> If <code>mParameters.select</code> is not given, all properties and navigation
2847
+ * properties available on the client are returned.
2828
2848
  *
2829
2849
  * Example:<br>
2830
2850
  * With <code>mParameters</code> given as
@@ -3578,7 +3598,7 @@ sap.ui.define([
3578
3598
  for (var i = 0; i < oRequest.parts.length; i++) {
3579
3599
  fnError = oRequest.parts[i].fnError;
3580
3600
  if (!oRequest.parts[i].request._aborted && fnError) {
3581
- fnError(oAbortedError);
3601
+ fnError(ODataModel._createAbortedError());
3582
3602
  }
3583
3603
  }
3584
3604
  }
@@ -3595,7 +3615,7 @@ sap.ui.define([
3595
3615
  }
3596
3616
  });
3597
3617
  if (fnError && !bSuppressErrorHandlerCall) {
3598
- fnError(oAbortedError);
3618
+ fnError(ODataModel._createAbortedError());
3599
3619
  }
3600
3620
  oBatchRequestHandle.abort();
3601
3621
  }
@@ -4205,12 +4225,11 @@ sap.ui.define([
4205
4225
  // rewrite context for new path
4206
4226
  var oContext = this.getContext("/" + oRequest.key);
4207
4227
  sDeepPath = oRequest.deepPath;
4208
- if (oContext.bCreated && sDeepPath.endsWith(")")) {
4228
+ if (oContext.isTransient() && sDeepPath.endsWith(")")) {
4209
4229
  oRequest.deepPath = sDeepPath.slice(0, sDeepPath.lastIndexOf("("))
4210
4230
  + sKey.slice(sKey.indexOf("("));
4211
4231
  }
4212
4232
  this._updateContext(oContext, '/' + sKey, oRequest.deepPath);
4213
- oContext.bCreated = false;
4214
4233
  oContext.setUpdated(true);
4215
4234
  // register function to reset updated flag call as callAfterUpdate
4216
4235
  this.callAfterUpdate(function() {
@@ -4297,14 +4316,6 @@ sap.ui.define([
4297
4316
 
4298
4317
  };
4299
4318
 
4300
- var oAbortedError = {
4301
- message: "Request aborted",
4302
- statusCode: 0,
4303
- statusText: "abort",
4304
- headers: {},
4305
- responseText: ""
4306
- };
4307
-
4308
4319
  /**
4309
4320
  * Process request response for aborted requests.
4310
4321
  *
@@ -4313,23 +4324,23 @@ sap.ui.define([
4313
4324
  * @param {boolean} bBatch Process success for single/batch request
4314
4325
  * @private
4315
4326
  */
4316
- ODataModel.prototype._processAborted = function(oRequest, oResponse, bBatch) {
4317
- var sPath;
4327
+ ODataModel.prototype._processAborted = function (oRequest, oResponse, bBatch) {
4328
+ var oEventInfo, sPath;
4329
+
4318
4330
  if (!bBatch) {
4319
4331
  // decrease laundering
4320
4332
  sPath = '/' + this.getKey(oRequest.data);
4321
4333
  this.decreaseLaundering(sPath, oRequest.data);
4322
4334
  this._decreaseDeferredRequestCount(oRequest);
4323
4335
  }
4324
-
4325
4336
  // If no response is contained, request was never sent and completes event can be omitted
4326
4337
  if (oResponse) {
4327
- var oEventInfo = this._createEventInfo(oRequest, oAbortedError);
4338
+ oEventInfo = this._createEventInfo(oRequest, ODataModel._createAbortedError());
4328
4339
  oEventInfo.success = false;
4329
4340
  if (bBatch) {
4330
4341
  this.fireBatchRequestCompleted(oEventInfo);
4331
4342
  } else {
4332
- this.fireRequestCompleted(oEventInfo);
4343
+ this.fireRequestCompleted(oEventInfo);
4333
4344
  }
4334
4345
  }
4335
4346
  };
@@ -4755,36 +4766,44 @@ sap.ui.define([
4755
4766
  };
4756
4767
 
4757
4768
  /**
4758
- * Executes the passed process request method when the metadata is available and takes care
4759
- * of properly wrapping the response handler and allow request abortion
4769
+ * Executes the passed process request method when the metadata is available, takes care of
4770
+ * properly wrapping the response handler to allow request abortion, and processes the request
4771
+ * queue asynchronously.
4760
4772
  *
4761
- * @param {function} [fnProcessRequest] Function to prepare the request and add it to the request queue
4762
- * @return {object} An object which has an <code>abort</code> function to abort the current request.
4773
+ * @param {function} fnProcessRequest
4774
+ * Function to prepare the request and add it to the request queue; it is called with the
4775
+ * request handle object returned by {@link #_processRequest}
4776
+ * @param {function} [fnError]
4777
+ * Error callback which is called when the request is aborted
4778
+ * @param {boolean} [bDeferred]
4779
+ * Whether the request belongs to a deferred group
4780
+ * @returns {object}
4781
+ * A request handle object which has an <code>abort</code> function to abort the current
4782
+ * request
4783
+ * @private
4763
4784
  */
4764
- ODataModel.prototype._processRequest = function(fnProcessRequest, fnError, bDeferred) {
4765
- var oRequestHandle, oRequest,
4785
+ ODataModel.prototype._processRequest = function (fnProcessRequest, fnError, bDeferred) {
4786
+ var oRequest, oRequestHandle,
4766
4787
  bAborted = false,
4767
4788
  that = this;
4768
4789
 
4769
4790
  if (this.bWarmup) {
4770
- return {
4771
- abort: function() {}
4772
- };
4791
+ return {abort : function () {}};
4773
4792
  }
4774
4793
 
4775
- if (bDeferred){
4776
- this.iPendingDeferredRequests++;
4794
+ if (bDeferred) {
4795
+ this.iPendingDeferredRequests += 1;
4777
4796
  }
4778
-
4779
4797
  oRequestHandle = {
4780
- abort: function() {
4798
+ abort : function () {
4781
4799
  if (bDeferred && !bAborted){
4782
- // Since in some scenarios no request object was created yet, the counter is decreased manually.
4783
- that.iPendingDeferredRequests--;
4800
+ // Since in some scenarios no request object was created yet, the counter is
4801
+ // decreased manually
4802
+ that.iPendingDeferredRequests -= 1;
4784
4803
  }
4785
4804
  // Call error handler synchronously
4786
4805
  if (!bAborted && fnError) {
4787
- fnError(oAbortedError);
4806
+ fnError(ODataModel._createAbortedError());
4788
4807
  }
4789
4808
  if (oRequest) {
4790
4809
  oRequest._aborted = true;
@@ -4792,25 +4811,20 @@ sap.ui.define([
4792
4811
  oRequest._handle.abort();
4793
4812
  }
4794
4813
  }
4795
-
4796
4814
  bAborted = true;
4797
4815
  }
4798
4816
  };
4799
-
4800
- this.oMetadata.loaded().then(function() {
4801
-
4817
+ this.oMetadata.loaded().then(function () {
4802
4818
  oRequest = fnProcessRequest(oRequestHandle);
4803
-
4804
4819
  if (oRequest) {
4805
4820
  oRequest.deferred = !!bDeferred;
4806
4821
  }
4807
-
4808
4822
  that._processRequestQueueAsync(that.mRequests);
4809
-
4810
4823
  if (bAborted) {
4811
4824
  oRequestHandle.abort();
4812
4825
  }
4813
4826
  });
4827
+
4814
4828
  return oRequestHandle;
4815
4829
  };
4816
4830
 
@@ -4980,43 +4994,60 @@ sap.ui.define([
4980
4994
  };
4981
4995
 
4982
4996
  /**
4983
- * Trigger a <code>DELETE</code> request to the OData service that was specified in the model constructor.
4997
+ * Trigger a <code>DELETE</code> request to the OData service that was specified in the model
4998
+ * constructor.
4984
4999
  *
4985
- * @param {string} sPath A string containing the path to the data that should be removed.
4986
- * The path is concatenated to the service URL which was specified in the model constructor.
4987
- * @param {object} [mParameters] Optional, can contain the following attributes:
4988
- * @param {object} [mParameters.context] If specified, <code>sPath</code> has to be relative to the path given with the context.
4989
- * @param {function} [mParameters.success] A callback function which is called when the data has been successfully retrieved.
4990
- * The handler can have the following parameters: <code>oData</code> and <code>response</code>.
4991
- * @param {function} [mParameters.error] A callback function which is called when the request failed.
4992
- * The handler can have the parameter: <code>oError</code> which contains additional error information.
4993
- * @param {string} [mParameters.eTag] If specified, the <code>If-Match</code> header will be set to this ETag.
4994
- * @param {Object<string,string>} [mParameters.urlParameters] A map containing the parameters that will be passed as query strings
4995
- * @param {Object<string,string>} [mParameters.headers] A map of headers for this request
4996
- * @param {string} [mParameters.batchGroupId] Deprecated - use <code>groupId</code> instead
4997
- * @param {string} [mParameters.groupId] ID of a request group; requests belonging to the same group will be bundled in one batch request
4998
- * @param {string} [mParameters.changeSetId] ID of the <code>ChangeSet</code> that this request should belong to
4999
- * @param {boolean} [mParameters.refreshAfterChange] Since 1.46; defines whether to update all bindings after submitting this change operation. See {@link #setRefreshAfterChange}
5000
- If given, this overrules the model-wide <code>refreshAfterChange</code> flag for this operation only.
5000
+ * @param {string} sPath
5001
+ * A string containing the path to the data that should be removed. The path is concatenated
5002
+ * to the service URL which was specified in the model constructor.
5003
+ * @param {object} [mParameters]
5004
+ * Optional, can contain the following attributes:
5005
+ * @param {object} [mParameters.context]
5006
+ * If specified, <code>sPath</code> has to be relative to the path given with the context.
5007
+ * @param {function} [mParameters.success]
5008
+ * A callback function which is called when the data has been successfully retrieved. The
5009
+ * handler can have the following parameters: <code>oData</code> and <code>response</code>.
5010
+ * @param {function} [mParameters.error]
5011
+ * A callback function which is called when the request failed. The handler can have the
5012
+ * parameter: <code>oError</code> which contains additional error information.
5013
+ * @param {string} [mParameters.eTag]
5014
+ * If specified, the <code>If-Match</code> header will be set to this ETag.
5015
+ * @param {Object<string,string>} [mParameters.urlParameters]
5016
+ * A map containing the parameters that will be passed as query strings
5017
+ * @param {Object<string,string>} [mParameters.headers]
5018
+ * A map of headers for this request
5019
+ * @param {string} [mParameters.batchGroupId]
5020
+ * Deprecated - use <code>groupId</code> instead
5021
+ * @param {string} [mParameters.groupId]
5022
+ * ID of a request group; requests belonging to the same group will be bundled in one batch
5023
+ * request
5024
+ * @param {string} [mParameters.changeSetId]
5025
+ * ID of the <code>ChangeSet</code> that this request should belong to
5026
+ * @param {boolean} [mParameters.refreshAfterChange]
5027
+ * Since 1.46; defines whether to update all bindings after submitting this change operation,
5028
+ * see {@link #setRefreshAfterChange}. If given, this overrules the model-wide
5029
+ * <code>refreshAfterChange</code> flag for this operation only.
5001
5030
  *
5002
- * @return {object} An object which has an <code>abort</code> function to abort the current request.
5031
+ * @return {object} An object which has an <code>abort</code> function to abort the current
5032
+ * request.
5003
5033
  *
5004
5034
  * @public
5005
5035
  */
5006
5036
  ODataModel.prototype.remove = function(sPath, mParameters) {
5007
- var oContext, sKey, fnSuccess, fnError, oRequest, sUrl, sGroupId,
5008
- sChangeSetId, sETag, bRefreshAfterChange,
5009
- mUrlParams, mHeaders, aUrlParams, sMethod, mRequests,
5010
- bDeferred, that = this, sNormalizedPath, sDeepPath, bCanonical = this.bCanonicalRequests;
5037
+ var sChangeSetId, oContext, oContextToRemove, sDeepPath, bDeferred, fnError, sETag,
5038
+ sGroupId, mHeaders, sKey, sMethod, sNormalizedPath, bRefreshAfterChange, oRequest,
5039
+ mRequests, fnSuccess, sUrl, aUrlParams, mUrlParams,
5040
+ bCanonical = this.bCanonicalRequests,
5041
+ that = this;
5011
5042
 
5012
5043
  if (mParameters) {
5013
5044
  sGroupId = mParameters.groupId || mParameters.batchGroupId;
5014
5045
  sChangeSetId = mParameters.changeSetId;
5015
- oContext = mParameters.context;
5046
+ oContext = mParameters.context;
5016
5047
  fnSuccess = mParameters.success;
5017
- fnError = mParameters.error;
5018
- sETag = mParameters.eTag;
5019
- mHeaders = mParameters.headers;
5048
+ fnError = mParameters.error;
5049
+ sETag = mParameters.eTag;
5050
+ mHeaders = mParameters.headers;
5020
5051
  mUrlParams = mParameters.urlParameters;
5021
5052
  bRefreshAfterChange = mParameters.refreshAfterChange;
5022
5053
  bCanonical = mParameters.canonicalRequest;
@@ -5037,20 +5068,23 @@ sap.ui.define([
5037
5068
  sDeepPath = this.resolveDeep(sPath, oContext);
5038
5069
 
5039
5070
  function handleSuccess(oData, oResponse) {
5040
- sKey = sUrl.substr(sUrl.lastIndexOf('/') + 1);
5041
- //remove query params if any
5042
- if (sKey.indexOf('?') !== -1) {
5043
- sKey = sKey.substr(0, sKey.indexOf('?'));
5044
- }
5045
5071
  that._removeEntity(sKey);
5046
-
5072
+ if (oContextToRemove && oContextToRemove.isTransient() === false) {
5073
+ that.oCreatedContextsCache.findAndRemoveContext(oContextToRemove);
5074
+ }
5047
5075
  if (fnSuccess) {
5048
5076
  fnSuccess(oData, oResponse);
5049
5077
  }
5050
5078
  }
5051
5079
 
5052
5080
  return this._processRequest(function(requestHandle) {
5053
- sUrl = that._createRequestUrlWithNormalizedPath(sNormalizedPath, aUrlParams, that.bUseBatch);
5081
+ sUrl = that._createRequestUrlWithNormalizedPath(sNormalizedPath, aUrlParams,
5082
+ that.bUseBatch);
5083
+ sKey = sUrl.substr(sUrl.lastIndexOf('/') + 1);
5084
+ //remove query params if any
5085
+ sKey = sKey.split("?")[0];
5086
+ oContextToRemove = that.mContexts["/" + sKey];
5087
+
5054
5088
  oRequest = that._createRequest(sUrl, sDeepPath, sMethod, mHeaders, undefined, sETag,
5055
5089
  undefined, true);
5056
5090
 
@@ -5059,7 +5093,8 @@ sap.ui.define([
5059
5093
  mRequests = that.mDeferredRequests;
5060
5094
  }
5061
5095
 
5062
- that._pushToRequestQueue(mRequests, sGroupId, sChangeSetId, oRequest, handleSuccess, fnError, requestHandle, bRefreshAfterChange);
5096
+ that._pushToRequestQueue(mRequests, sGroupId, sChangeSetId, oRequest, handleSuccess,
5097
+ fnError, requestHandle, bRefreshAfterChange);
5063
5098
 
5064
5099
  return oRequest;
5065
5100
  }, fnError, bDeferred);
@@ -5923,97 +5958,144 @@ sap.ui.define([
5923
5958
  };
5924
5959
 
5925
5960
  /**
5926
- * Resets changes that have been collected.
5961
+ * Discards the changes for the given entity key, that means aborts internal requests, removes
5962
+ * the changes from the shadow cache, and removes all messages for that entity.
5927
5963
  *
5928
- * By default, only client data changes triggered through:
5929
- * {@link #createEntry}
5930
- * {@link #setProperty}
5931
- * are taken into account.
5964
+ * If <code>bDeleteCreatedEntities</code> is set, remove the entry also from the data cache and
5965
+ * the corresponding context from the context cache, if the entity has been created
5966
+ * <ul>
5967
+ * <li>via {@link #createEntry} and it is not yet persisted in the back end, or</li>
5968
+ * <li>via {@link #callFunction}.</li>
5969
+ * </ul>
5932
5970
  *
5933
- * If <code>bAll</code> is set to <code>true</code>, also deferred requests triggered through:
5934
- * {@link #create}
5935
- * {@link #update}
5936
- * {@link #remove}
5937
- * are taken into account.
5971
+ * @param {string} sKey
5972
+ * The entity key
5973
+ * @param {boolean} [bDeleteCreatedEntities=false]
5974
+ * Whether to delete the entities created via {@link #createEntry} or {@link #callFunction}
5975
+ * @param {object} [oEntityMetadata]
5976
+ * The entity metadata
5977
+ * @returns {Promise}
5978
+ * Resolves when all changes have been discarded
5979
+ * @private
5980
+ */
5981
+ ODataModel.prototype._discardEntityChanges = function (sKey, bDeleteCreatedEntities,
5982
+ oEntityMetadata) {
5983
+ var // created either via #createEntry or via #callFunction
5984
+ oCreated = oEntityMetadata && oEntityMetadata.created,
5985
+ bExcludePersistent = true,
5986
+ // determine group synchronously otherwise #_resolveGroup might return a different group
5987
+ // if for example the entity has been deleted already
5988
+ sGroupId = this._resolveGroup(sKey).groupId,
5989
+ pMetaDataLoaded = this.oMetadata.loaded(),
5990
+ that = this;
5991
+
5992
+ pMetaDataLoaded.then(function () {
5993
+ that.abortInternalRequest(sGroupId, {requestKey : sKey});
5994
+ });
5995
+ if (bDeleteCreatedEntities && oCreated) {
5996
+ this._removeEntity(sKey);
5997
+ if (oCreated.abort) {
5998
+ oCreated.abort(ODataModel._createAbortedError());
5999
+ }
6000
+ bExcludePersistent = false;
6001
+ } else {
6002
+ delete this.mChangedEntities[sKey];
6003
+ }
6004
+ sap.ui.getCore().getMessageManager().removeMessages(this.getMessagesByEntity(sKey,
6005
+ bExcludePersistent));
6006
+
6007
+ return pMetaDataLoaded;
6008
+ };
6009
+
6010
+ /**
6011
+ * Resets pending changes and aborts corresponding requests.
6012
+ *
6013
+ * By default, only changes triggered through {@link #createEntry} or {@link #setProperty} are
6014
+ * taken into account. If <code>bAll</code> is set, also deferred requests triggered through
6015
+ * {@link #create}, {@link #update} or {@link #remove} are taken into account.
6016
+ *
6017
+ * If <code>bDeleteCreatedEntities</code> is set, the entity is completely removed, provided it
6018
+ * has been created
6019
+ * <ul>
6020
+ * <li>via {@link #createEntry} and it is not yet persisted in the back end, or</li>
6021
+ * <li>via {@link #callFunction}.</li>
6022
+ * </ul>
5938
6023
  *
5939
- * @param {array} [aPath] Array of paths that should be reset.
5940
- * If no array is passed, all changes will be reset.
5941
- * @param {boolean}[bAll=false] If set to true, also deferred requests are taken into account.
5942
- * @returns {Promise} Resolves when all regarded changes have been reset.
6024
+ * @param {array} [aPath]
6025
+ * Paths to be be reset; if no array is passed, all changes are reset
6026
+ * @param {boolean} [bAll=false]
6027
+ * Whether also deferred requests are taken into account
6028
+ * @param {boolean} [bDeleteCreatedEntities=false]
6029
+ * Whether to delete the entities created via {@link #createEntry} or {@link #callFunction};
6030
+ * since 1.95.0
6031
+ * @returns {Promise}
6032
+ * Resolves when all regarded changes have been reset.
5943
6033
  * @public
5944
6034
  */
5945
- ODataModel.prototype.resetChanges = function(aPath, bAll) {
5946
- var that = this, aParts, oEntityInfo = {}, oChangeObject, oEntityMetadata;
6035
+ ODataModel.prototype.resetChanges = function (aPath, bAll, bDeleteCreatedEntities) {
6036
+ var pMetaDataLoaded = this.oMetadata.loaded(),
6037
+ that = this;
5947
6038
 
5948
6039
  if (bAll) {
5949
- if (aPath) {
5950
- aPath.forEach(function(sPath){
5951
- that.oMetadata.loaded().then(function () {
5952
- each(that.mDeferredGroups, function (sGroupId) {
5953
- that.abortInternalRequest(sGroupId, {path: sPath.substring(1)});
6040
+ pMetaDataLoaded.then(function () {
6041
+ each(that.mDeferredGroups, function (sGroupId) {
6042
+ if (aPath) {
6043
+ aPath.forEach(function(sPath) {
6044
+ that.abortInternalRequest(sGroupId, {path : sPath.substring(1)});
5954
6045
  });
5955
- });
5956
- });
5957
- } else {
5958
- this.oMetadata.loaded().then(function () {
5959
- each(that.mDeferredGroups, function (sGroupId) {
6046
+ } else {
5960
6047
  that.abortInternalRequest(sGroupId);
5961
- });
6048
+ }
5962
6049
  });
5963
- }
6050
+ });
5964
6051
  }
5965
6052
  if (aPath) {
5966
6053
  each(aPath, function (iIndex, sPath) {
5967
- that.getEntityByPath(sPath, null, oEntityInfo);
5968
- if (oEntityInfo && oEntityInfo.propertyPath !== undefined){
5969
- aParts = oEntityInfo.propertyPath.split("/");
5970
- var sKey = oEntityInfo.key;
5971
- oChangeObject = that.mChangedEntities[sKey];
5972
- for (var i = 0; i < aParts.length - 1; i++) {
5973
- if (oChangeObject.hasOwnProperty(aParts[i])) {
5974
- oChangeObject = oChangeObject[aParts[i]];
5975
- } else {
5976
- oChangeObject = undefined;
6054
+ var oChangedEntity, oEntityMetadata, i, sKey, sLastSegment, aPathSegments,
6055
+ oEntityInfo = {};
6056
+
6057
+ if (that.getEntityByPath(sPath, null, oEntityInfo)) {
6058
+ aPathSegments = oEntityInfo.propertyPath.split("/");
6059
+ sLastSegment = aPathSegments[aPathSegments.length - 1];
6060
+ sKey = oEntityInfo.key;
6061
+ oChangedEntity = that.mChangedEntities[sKey];
6062
+ if (oChangedEntity) {
6063
+ // follow path to the object containing the property to reset
6064
+ for (i = 0; i < aPathSegments.length - 1; i += 1) {
6065
+ if (oChangedEntity && oChangedEntity.hasOwnProperty(aPathSegments[i])) {
6066
+ oChangedEntity = oChangedEntity[aPathSegments[i]];
6067
+ } else {
6068
+ // path may point to a property of a complex type and complex type
6069
+ // might not be set; there is no property to reset
6070
+ oChangedEntity = undefined;
6071
+ break;
6072
+ }
6073
+ }
6074
+ if (oChangedEntity && oChangedEntity.hasOwnProperty(sLastSegment)) {
6075
+ delete oChangedEntity[sLastSegment];
5977
6076
  }
5978
- }
5979
-
5980
- if (oChangeObject) {
5981
- delete oChangeObject[aParts[aParts.length - 1]];
5982
- }
5983
6077
 
5984
- if (that.mChangedEntities[sKey]) {
5985
- //delete metadata to check if object has changes
6078
+ // delete metadata to check if object has changes
5986
6079
  oEntityMetadata = that.mChangedEntities[sKey].__metadata;
5987
6080
  delete that.mChangedEntities[sKey].__metadata;
5988
- if (isEmptyObject(that.mChangedEntities[sKey]) || !oEntityInfo.propertyPath) {
5989
- that.oMetadata.loaded().then(function () {
5990
- that.abortInternalRequest(that._resolveGroup(sKey).groupId, {requestKey: sKey});
5991
- });
5992
- delete that.mChangedEntities[sKey];
5993
- //cleanup Messages for created Entry
5994
- sap.ui.getCore().getMessageManager().removeMessages(that.getMessagesByEntity(sKey, true));
6081
+ if (isEmptyObject(that.mChangedEntities[sKey])
6082
+ || !oEntityInfo.propertyPath) {
6083
+ that._discardEntityChanges(sKey, bDeleteCreatedEntities,
6084
+ oEntityMetadata);
5995
6085
  } else {
5996
6086
  that.mChangedEntities[sKey].__metadata = oEntityMetadata;
5997
6087
  }
5998
- } else {
5999
- Log.warning(that + " - resetChanges: " + sPath + " is not changed");
6000
6088
  }
6001
6089
  }
6002
6090
  });
6003
6091
  } else {
6004
- each(this.mChangedEntities, function (sKey, oObject) {
6005
- that.oMetadata.loaded().then(function () {
6006
- that.abortInternalRequest(that._resolveGroup(sKey).groupId, {requestKey: sKey});
6007
- });
6008
- delete that.mChangedEntities[sKey];
6009
- //cleanup Messages for created Entry
6010
- sap.ui.getCore().getMessageManager().removeMessages(that.getMessagesByEntity(sKey, true));
6092
+ each(this.mChangedEntities, function (sKey, oChangedEntity) {
6093
+ that._discardEntityChanges(sKey, bDeleteCreatedEntities, oChangedEntity.__metadata);
6011
6094
  });
6012
-
6013
6095
  }
6014
6096
  this.checkUpdate(true);
6015
6097
 
6016
- return this.oMetadata.loaded();
6098
+ return pMetaDataLoaded;
6017
6099
  };
6018
6100
 
6019
6101
  /**
@@ -6361,10 +6443,16 @@ sap.ui.define([
6361
6443
 
6362
6444
  /**
6363
6445
  * Deletes a created entry from the request queue and from the model.
6446
+ *
6447
+ * <b>Note:</b> Controls are not updated. Use {@link #resetChanges} instead to update also the
6448
+ * controls, for example:<br />
6449
+ * <code>oModel.resetChanges([oContext.getPath()], undefined, true);</code>
6450
+ *
6364
6451
  * @param {sap.ui.model.Context} oContext The context object pointing to the created entry
6365
6452
  * @public
6453
+ * @deprecated since 1.95.0; use {@link #resetChanges} instead
6366
6454
  */
6367
- ODataModel.prototype.deleteCreatedEntry = function(oContext) {
6455
+ ODataModel.prototype.deleteCreatedEntry = function (oContext) {
6368
6456
  var that = this, sKey, sGroupId;
6369
6457
  if (oContext) {
6370
6458
  var sKey = oContext.getPath().substr(1);
@@ -6384,8 +6472,13 @@ sap.ui.define([
6384
6472
  * against the newly created object.
6385
6473
  *
6386
6474
  * For each created entry a request is created and stored in a request queue.
6387
- * The request queue can be submitted by calling {@link #submitChanges}. To delete a created
6388
- * entry from the request queue call {@link #deleteCreatedEntry}.
6475
+ * The request queue can be submitted by calling {@link #submitChanges}. As long as the context
6476
+ * is transient (see {@link sap.ui.model.odata.v2.Context#isTransient}),
6477
+ * {@link sap.ui.model.odata.v2.ODataModel#resetChanges} with the
6478
+ * <code>bDeleteCreatedEntities</code> parameter set to <code>true</code> can be used to delete
6479
+ * the created entity again.
6480
+ *
6481
+ * If the creation of the entity on the server failed, it is repeated automatically.
6389
6482
  *
6390
6483
  * The optional parameter <code>mParameters.properties</code> can be used as follows:
6391
6484
  * <ul>
@@ -6400,8 +6493,8 @@ sap.ui.define([
6400
6493
  *
6401
6494
  * If there are no values specified, the properties will have <code>undefined</code> values.
6402
6495
  *
6403
- * Please note that deep creates (including data defined by navigation properties) are not
6404
- * supported.
6496
+ * The <code>properties</code> can be modified via property bindings relative to the returned
6497
+ * context instance.
6405
6498
  *
6406
6499
  * The parameter <code>expand</code> is supported since 1.78.0. If this parameter is set, the
6407
6500
  * given navigation properties are expanded automatically with the same $batch request in which
@@ -6428,6 +6521,14 @@ sap.ui.define([
6428
6521
  * </li>
6429
6522
  * </ul>
6430
6523
  *
6524
+ * Note: If a server requires a property in the request, you must supply this property in the
6525
+ * initial data, for example if the server requires a unit for an amount. This also applies if
6526
+ * this property has a default value.
6527
+ *
6528
+ * Note: A deep create (including data defined by navigation properties) is not supported. The
6529
+ * dependent entity has to be created using a second list binding, after this entity has been
6530
+ * saved successfully in the back-end system.
6531
+ *
6431
6532
  * @param {string} sPath
6432
6533
  * The path to the EntitySet
6433
6534
  * @param {object} mParameters
@@ -6482,10 +6583,11 @@ sap.ui.define([
6482
6583
  * If the <code>expand</code> parameter is used but the batch mode is disabled
6483
6584
  * @public
6484
6585
  */
6485
- ODataModel.prototype.createEntry = function(sPath, mParameters) {
6486
- var bCanonical, sChangeSetId, oContext, fnCreated, sDeepPath, fnError, sETag, sExpand,
6487
- sGroupId, mHeaders, sKey, sNormalizedPath, vProperties, bRefreshAfterChange, oRequest,
6488
- mRequests, fnSuccess, sUrl, aUrlParams, mUrlParams,
6586
+ ODataModel.prototype.createEntry = function (sPath, mParameters) {
6587
+ var bCanonical, sChangeSetId, oContext, fnCreated, pCreate, fnCreatedPromiseResolve,
6588
+ sDeepPath, fnError, sETag, sExpand, sGroupId, mHeaders, sKey, sNormalizedPath,
6589
+ vProperties, bRefreshAfterChange, oRequest, mRequests, fnSuccess, sUrl, aUrlParams,
6590
+ mUrlParams,
6489
6591
  oEntity = {},
6490
6592
  sMethod = "POST",
6491
6593
  that = this;
@@ -6595,6 +6697,7 @@ sap.ui.define([
6595
6697
  oData = Object.assign({}, oCreateData, oData);
6596
6698
  fnSuccessFromParameters(oData, oCreateResponse);
6597
6699
  }
6700
+ fnCreatedPromiseResolve();
6598
6701
  };
6599
6702
  fnError = function (oError) {
6600
6703
  if (oCreateData) {
@@ -6607,6 +6710,8 @@ sap.ui.define([
6607
6710
  if (fnSuccessFromParameters) {
6608
6711
  fnSuccessFromParameters(oCreateData, oCreateResponse);
6609
6712
  }
6713
+ fnCreatedPromiseResolve();
6714
+
6610
6715
  return;
6611
6716
  }
6612
6717
  if (!bCreateFailed) {
@@ -6625,12 +6730,19 @@ sap.ui.define([
6625
6730
  bCreateFailed = false;
6626
6731
  }
6627
6732
  };
6733
+ } else {
6734
+ fnSuccess = function (oData, oCreateResponse) {
6735
+ if (fnSuccessFromParameters) {
6736
+ fnSuccessFromParameters(oData, oCreateResponse);
6737
+ }
6738
+ fnCreatedPromiseResolve();
6739
+ };
6628
6740
  }
6629
6741
  oEntity.__metadata = {
6630
6742
  type: "" + oEntityMetadata.entityType,
6631
6743
  uri: that.sServiceUrl + '/' + sKey,
6632
- created: {//store path for later POST
6633
- key: sNormalizedPath.substring(1),
6744
+ created: {
6745
+ key: sNormalizedPath.substring(1), //store path for later POST
6634
6746
  success: fnSuccess,
6635
6747
  error: fnError,
6636
6748
  headers: mHeaders,
@@ -6641,6 +6753,13 @@ sap.ui.define([
6641
6753
  },
6642
6754
  deepPath: sDeepPath
6643
6755
  };
6756
+ pCreate = new SyncPromise(function (resolve, reject) {
6757
+ fnCreatedPromiseResolve = resolve;
6758
+ oEntity.__metadata.created.abort = reject;
6759
+ });
6760
+ pCreate.catch(function () {
6761
+ // avoid uncaught in promise if the caller of #createEntry does not use the promise
6762
+ });
6644
6763
 
6645
6764
  sKey = that._addEntity(merge({}, oEntity));
6646
6765
  that.mChangedEntities[sKey] = oEntity;
@@ -6659,8 +6778,8 @@ sap.ui.define([
6659
6778
  oEntity.__metadata.created.expandRequest = oExpandRequest;
6660
6779
  oEntity.__metadata.created.contentID = sUID;
6661
6780
  }
6662
- oCreatedContext = that.getContext("/" + sKey, sDeepPath); // context wants a path
6663
- oCreatedContext.bCreated = true;
6781
+
6782
+ oCreatedContext = that.getContext("/" + sKey, sDeepPath, pCreate);
6664
6783
 
6665
6784
  oRequest.key = sKey;
6666
6785
  oRequest.created = true;
@@ -7582,15 +7701,17 @@ sap.ui.define([
7582
7701
  * The absolute path
7583
7702
  * @param {string} [sDeepPath]
7584
7703
  * The absolute deep path representing the same data as the given <code>sPath</code>
7704
+ * @param {sap.ui.base.SyncPromise} [oCreatePromise]
7705
+ * A created promise as specified in the constructor of {@link sap.ui.model.odata.v2.Context}
7585
7706
  * @returns {sap.ui.model.odata.v2.Context}
7586
7707
  * The ODate V2 context for the given path
7587
7708
  * @private
7588
7709
  */
7589
- ODataModel.prototype.getContext = function (sPath, sDeepPath) {
7710
+ ODataModel.prototype.getContext = function (sPath, sDeepPath, oCreatePromise) {
7590
7711
  var oContext = this.mContexts[sPath];
7591
7712
 
7592
7713
  if (!oContext) {
7593
- oContext = this.mContexts[sPath] = new Context(this, sPath, sDeepPath);
7714
+ oContext = this.mContexts[sPath] = new Context(this, sPath, sDeepPath, oCreatePromise);
7594
7715
  } else {
7595
7716
  oContext.setDeepPath(sDeepPath || oContext.getDeepPath() || sPath);
7596
7717
  }
@@ -7847,5 +7968,34 @@ sap.ui.define([
7847
7968
  return this.sMetadataUrl;
7848
7969
  };
7849
7970
 
7971
+ /**
7972
+ * Creates an error object for an aborted request.
7973
+ *
7974
+ * @returns {object} An error object for an aborted request
7975
+ * @private
7976
+ */
7977
+ ODataModel._createAbortedError = function () {
7978
+ return {
7979
+ aborted : true,
7980
+ headers : {},
7981
+ message : "Request aborted",
7982
+ responseText : "",
7983
+ statusCode : 0,
7984
+ statusText : "abort"
7985
+ };
7986
+ };
7987
+
7988
+ /**
7989
+ * Gets the cache for contexts of entities created via
7990
+ * {@link sap.ui.model.odata.v2.ODataListBinding#create}.
7991
+ *
7992
+ * @returns {sap.ui.model.odata.v2._CreatedContextsCache} The created entities cache
7993
+ *
7994
+ * @private
7995
+ */
7996
+ ODataModel.prototype._getCreatedContextsCache = function () {
7997
+ return this.oCreatedContextsCache;
7998
+ };
7999
+
7850
8000
  return ODataModel;
7851
8001
  });