@openui5/sap.ui.core 1.91.0 → 1.93.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 (373) hide show
  1. package/.eslintrc.json +37 -0
  2. package/.reuse/dep5 +46 -0
  3. package/THIRDPARTY.txt +59 -1
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +6 -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 +7 -4
  10. package/src/jquery.sap.stubs.js +0 -1
  11. package/src/sap/base/i18n/ResourceBundle.js +2 -2
  12. package/src/sap/base/security/encodeCSS.js +1 -0
  13. package/src/sap/base/security/encodeJS.js +1 -0
  14. package/src/sap/base/security/encodeURL.js +1 -0
  15. package/src/sap/base/security/encodeXML.js +2 -0
  16. package/src/sap/base/util/LoaderExtensions.js +1 -1
  17. package/src/sap/base/util/Properties.js +4 -1
  18. package/src/sap/base/util/isEmptyObject.js +1 -2
  19. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  20. package/src/sap/base/util/restricted/_castArray.js +1 -1
  21. package/src/sap/base/util/restricted/_compact.js +1 -1
  22. package/src/sap/base/util/restricted/_curry.js +1 -1
  23. package/src/sap/base/util/restricted/_debounce.js +1 -1
  24. package/src/sap/base/util/restricted/_difference.js +1 -1
  25. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  26. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  27. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  28. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  29. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  30. package/src/sap/base/util/restricted/_flatten.js +1 -1
  31. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  32. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  33. package/src/sap/base/util/restricted/_intersection.js +1 -1
  34. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  35. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  36. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  37. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  38. package/src/sap/base/util/restricted/_isNil.js +1 -1
  39. package/src/sap/base/util/restricted/_max.js +1 -1
  40. package/src/sap/base/util/restricted/_merge.js +1 -1
  41. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  42. package/src/sap/base/util/restricted/_min.js +1 -1
  43. package/src/sap/base/util/restricted/_omit.js +1 -1
  44. package/src/sap/base/util/restricted/_pick.js +1 -1
  45. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  46. package/src/sap/base/util/restricted/_throttle.js +1 -1
  47. package/src/sap/base/util/restricted/_toArray.js +1 -1
  48. package/src/sap/base/util/restricted/_union.js +1 -1
  49. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  50. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  51. package/src/sap/base/util/restricted/_uniq.js +1 -1
  52. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  53. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  54. package/src/sap/base/util/restricted/_without.js +1 -1
  55. package/src/sap/base/util/restricted/_xor.js +1 -1
  56. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  57. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  58. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  59. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  60. package/src/sap/ui/Device.js +10 -10
  61. package/src/sap/ui/Global.js +4 -4
  62. package/src/sap/ui/VersionInfo.js +1 -0
  63. package/src/sap/ui/base/DataType.js +1 -0
  64. package/src/sap/ui/base/Event.js +1 -1
  65. package/src/sap/ui/base/EventProvider.js +1 -1
  66. package/src/sap/ui/base/Interface.js +1 -1
  67. package/src/sap/ui/base/ManagedObject.js +121 -18
  68. package/src/sap/ui/base/ManagedObjectMetadata.js +13 -4
  69. package/src/sap/ui/base/Metadata.js +1 -1
  70. package/src/sap/ui/base/Object.js +1 -1
  71. package/src/sap/ui/base/ObjectPool.js +1 -1
  72. package/src/sap/ui/core/.library +4 -2
  73. package/src/sap/ui/core/BusyIndicator.js +1 -1
  74. package/src/sap/ui/core/BusyIndicatorUtils.js +4 -1
  75. package/src/sap/ui/core/Component.js +144 -43
  76. package/src/sap/ui/core/ComponentContainer.js +51 -2
  77. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  78. package/src/sap/ui/core/ComponentSupport.js +1 -1
  79. package/src/sap/ui/core/Configuration.js +2 -1
  80. package/src/sap/ui/core/Control.js +1 -1
  81. package/src/sap/ui/core/Core.js +20 -22
  82. package/src/sap/ui/core/CustomData.js +1 -1
  83. package/src/sap/ui/core/CustomizingConfiguration.js +2 -2
  84. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  85. package/src/sap/ui/core/Element.js +1 -1
  86. package/src/sap/ui/core/ElementMetadata.js +1 -3
  87. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  88. package/src/sap/ui/core/EventBus.js +1 -1
  89. package/src/sap/ui/core/ExtensionPoint.js +59 -16
  90. package/src/sap/ui/core/Fragment.js +3 -3
  91. package/src/sap/ui/core/HTML.js +1 -1
  92. package/src/sap/ui/core/History.js +1 -1
  93. package/src/sap/ui/core/Icon.js +1 -1
  94. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  95. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  96. package/src/sap/ui/core/InvisibleMessage.js +9 -1
  97. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  98. package/src/sap/ui/core/InvisibleText.js +1 -1
  99. package/src/sap/ui/core/Item.js +1 -1
  100. package/src/sap/ui/core/LabelEnablement.js +1 -1
  101. package/src/sap/ui/core/LayoutData.js +1 -1
  102. package/src/sap/ui/core/ListItem.js +1 -1
  103. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  104. package/src/sap/ui/core/Locale.js +1 -1
  105. package/src/sap/ui/core/LocaleData.js +15 -1328
  106. package/src/sap/ui/core/Manifest.js +124 -69
  107. package/src/sap/ui/core/Message.js +1 -1
  108. package/src/sap/ui/core/Patcher.js +143 -153
  109. package/src/sap/ui/core/Placeholder.js +173 -0
  110. package/src/sap/ui/core/Popup.js +29 -5
  111. package/src/sap/ui/core/RenderManager.js +344 -104
  112. package/src/sap/ui/core/Renderer.js +1 -1
  113. package/src/sap/ui/core/ResizeHandler.js +1 -1
  114. package/src/sap/ui/core/ScrollBar.js +1 -1
  115. package/src/sap/ui/core/SeparatorItem.js +1 -1
  116. package/src/sap/ui/core/ThemeCheck.js +14 -62
  117. package/src/sap/ui/core/Title.js +1 -1
  118. package/src/sap/ui/core/TooltipBase.js +1 -1
  119. package/src/sap/ui/core/UIArea.js +6 -3
  120. package/src/sap/ui/core/UIComponent.js +46 -23
  121. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  122. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  123. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  124. package/src/sap/ui/core/XMLComposite.js +3 -5
  125. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  126. package/src/sap/ui/core/XMLTemplateProcessor.js +5 -6
  127. package/src/sap/ui/core/cldr/en.json +1 -0
  128. package/src/sap/ui/core/date/UniversalDate.js +4 -2
  129. package/src/sap/ui/core/delegate/ItemNavigation.js +4 -4
  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 +2 -9
  133. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  134. package/src/sap/ui/core/dnd/DragInfo.js +41 -1
  135. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  136. package/src/sap/ui/core/format/DateFormat.js +4 -2
  137. package/src/sap/ui/core/format/NumberFormat.js +3 -0
  138. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  139. package/src/sap/ui/core/library.js +26 -4
  140. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  141. package/src/sap/ui/core/message/Message.js +1 -1
  142. package/src/sap/ui/core/message/MessageManager.js +4 -2
  143. package/src/sap/ui/core/message/MessageParser.js +1 -1
  144. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  145. package/src/sap/ui/core/messagebundle_cs.properties +1 -1
  146. package/src/sap/ui/core/messagebundle_ms.properties +1 -1
  147. package/src/sap/ui/core/messagebundle_pt.properties +6 -6
  148. package/src/sap/ui/core/messagebundle_tr.properties +1 -1
  149. package/src/sap/ui/core/mvc/Controller.js +146 -8
  150. package/src/sap/ui/core/mvc/HTMLView.js +3 -1
  151. package/src/sap/ui/core/mvc/JSONView.js +7 -5
  152. package/src/sap/ui/core/mvc/JSView.js +4 -2
  153. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  154. package/src/sap/ui/core/mvc/View.js +145 -68
  155. package/src/sap/ui/core/mvc/ViewType.js +2 -0
  156. package/src/sap/ui/core/mvc/XMLView.js +13 -9
  157. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  158. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  159. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  160. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  161. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  162. package/src/sap/ui/core/routing/HashChangerBase.js +9 -2
  163. package/src/sap/ui/core/routing/History.js +188 -87
  164. package/src/sap/ui/core/routing/Route.js +10 -1
  165. package/src/sap/ui/core/routing/Router.js +8 -5
  166. package/src/sap/ui/core/routing/RouterHashChanger.js +26 -16
  167. package/src/sap/ui/core/routing/TargetCache.js +19 -8
  168. package/src/sap/ui/core/routing/Targets.js +29 -3
  169. package/src/sap/ui/core/routing/async/Route.js +9 -1
  170. package/src/sap/ui/core/routing/async/Target.js +249 -85
  171. package/src/sap/ui/core/routing/async/TargetCache.js +9 -7
  172. package/src/sap/ui/core/routing/async/Targets.js +4 -2
  173. package/src/sap/ui/core/routing/sync/Target.js +15 -0
  174. package/src/sap/ui/core/rules/App.support.js +36 -2
  175. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  176. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  177. package/src/sap/ui/core/service/Service.js +1 -1
  178. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  179. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  180. package/src/sap/ui/core/support/InteractionTree.css +0 -14
  181. package/src/sap/ui/core/support/Plugin.js +1 -1
  182. package/src/sap/ui/core/support/RuleEngineOpaExtension.js +0 -2
  183. package/src/sap/ui/core/support/Support.js +1 -1
  184. package/src/sap/ui/core/support/TimelineOverview.css +0 -35
  185. package/src/sap/ui/core/support/controls/ObjectViewer.js +5 -9
  186. package/src/sap/ui/core/support/controls/TreeViewer.js +0 -1
  187. package/src/sap/ui/core/support/interactionSlider.css +0 -3
  188. package/src/sap/ui/core/support/plugins/ControlTree.js +2 -2
  189. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  190. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  191. package/src/sap/ui/core/support/plugins/MessageTest.js +1 -1
  192. package/src/sap/ui/core/support/plugins/Performance.js +2 -1
  193. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  194. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  195. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  196. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -3
  197. package/src/sap/ui/core/support/support.css +4 -164
  198. package/src/sap/ui/core/support/trace/E2eTraceLib.js +3 -3
  199. package/src/sap/ui/core/support/usage/EventBroadcaster.js +0 -22
  200. package/src/sap/ui/core/themes/base/BlindLayer.less +0 -2
  201. package/src/sap/ui/core/themes/base/BrowserScrollbar.less +0 -9
  202. package/src/sap/ui/core/themes/base/LocalBusyIndicator.less +5 -5
  203. package/src/sap/ui/core/themes/base/SAP-icons.css +2 -0
  204. package/src/sap/ui/core/themes/base/SAP-icons.less +10 -0
  205. package/src/sap/ui/core/themes/base/TechnicalInfo.less +0 -1
  206. package/src/sap/ui/core/themes/base/base.less +569 -414
  207. package/src/sap/ui/core/themes/base/global.less +38 -0
  208. package/src/sap/ui/core/themes/base/library.source.less +1 -2
  209. package/src/sap/ui/core/themes/base/shared.less +1 -1
  210. package/src/sap/ui/core/themes/sap_hcb/global.less +34 -0
  211. package/src/sap/ui/core/theming/Parameters.js +222 -60
  212. package/src/sap/ui/core/theming/ThemeHelper.js +94 -0
  213. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  214. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  215. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  216. package/src/sap/ui/core/tmpl/Template.js +2 -1
  217. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  218. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  219. package/src/sap/ui/core/util/Export.js +1 -1
  220. package/src/sap/ui/core/util/ExportCell.js +1 -1
  221. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  222. package/src/sap/ui/core/util/ExportRow.js +1 -1
  223. package/src/sap/ui/core/util/ExportType.js +1 -1
  224. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  225. package/src/sap/ui/core/util/File.js +1 -1
  226. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  227. package/src/sap/ui/core/util/MockServer.js +27 -7
  228. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  229. package/src/sap/ui/core/util/XMLPreprocessor.js +2 -2
  230. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +18 -0
  231. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  232. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  233. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  234. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  235. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  236. package/src/sap/ui/core/util/serializer/delegate/HTML.js +2 -2
  237. package/src/sap/ui/core/util/serializer/delegate/XML.js +2 -2
  238. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  239. package/src/sap/ui/core/ws/SapPcpWebSocket.js +2 -1
  240. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  241. package/src/sap/ui/debug/ControlTree.js +1 -1
  242. package/src/sap/ui/debug/DebugEnv.js +1 -1
  243. package/src/sap/ui/debug/PropertyList.js +1 -1
  244. package/src/sap/ui/dom/jquery/zIndex.js +3 -3
  245. package/src/sap/ui/events/jquery/EventSimulation.js +7 -6
  246. package/src/sap/ui/events/jquery/EventTriggerHook.js +1 -1
  247. package/src/sap/ui/model/Binding.js +7 -3
  248. package/src/sap/ui/model/ClientModel.js +1 -1
  249. package/src/sap/ui/model/CompositeBinding.js +1 -1
  250. package/src/sap/ui/model/CompositeDataState.js +1 -1
  251. package/src/sap/ui/model/CompositeType.js +1 -1
  252. package/src/sap/ui/model/Context.js +31 -11
  253. package/src/sap/ui/model/DataState.js +1 -1
  254. package/src/sap/ui/model/ListBinding.js +19 -0
  255. package/src/sap/ui/model/MetaModel.js +1 -1
  256. package/src/sap/ui/model/Model.js +3 -3
  257. package/src/sap/ui/model/SelectionModel.js +5 -1
  258. package/src/sap/ui/model/SimpleType.js +1 -1
  259. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  260. package/src/sap/ui/model/Type.js +1 -1
  261. package/src/sap/ui/model/analytics/AnalyticalBinding.js +36 -45
  262. package/src/sap/ui/model/analytics/odata4analytics.js +31 -31
  263. package/src/sap/ui/model/base/ManagedObjectModel.js +11 -1
  264. package/src/sap/ui/model/json/JSONModel.js +1 -1
  265. package/src/sap/ui/model/message/MessageModel.js +1 -1
  266. package/src/sap/ui/model/odata/AnnotationParser.js +23 -18
  267. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  268. package/src/sap/ui/model/odata/ODataListBinding.js +1 -0
  269. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  270. package/src/sap/ui/model/odata/ODataMetaModel.js +52 -40
  271. package/src/sap/ui/model/odata/ODataMetadata.js +3 -3
  272. package/src/sap/ui/model/odata/ODataModel.js +6 -6
  273. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +1 -1
  274. package/src/sap/ui/model/odata/ODataUtils.js +126 -0
  275. package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +30 -27
  276. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  277. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  278. package/src/sap/ui/model/odata/type/Currency.js +7 -2
  279. package/src/sap/ui/model/odata/type/Date.js +1 -1
  280. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  281. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  282. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  283. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  284. package/src/sap/ui/model/odata/type/Double.js +1 -1
  285. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  286. package/src/sap/ui/model/odata/type/Int.js +1 -1
  287. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  288. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  289. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  290. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  291. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  292. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  293. package/src/sap/ui/model/odata/type/Single.js +1 -1
  294. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  295. package/src/sap/ui/model/odata/type/String.js +3 -1
  296. package/src/sap/ui/model/odata/type/Time.js +1 -1
  297. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  298. package/src/sap/ui/model/odata/type/Unit.js +7 -2
  299. package/src/sap/ui/model/odata/type/UnitMixin.js +20 -7
  300. package/src/sap/ui/model/odata/v2/Context.js +165 -0
  301. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  302. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +19 -5
  303. package/src/sap/ui/model/odata/v2/ODataListBinding.js +20 -79
  304. package/src/sap/ui/model/odata/v2/ODataModel.js +75 -53
  305. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +55 -41
  306. package/src/sap/ui/model/odata/v4/Context.js +48 -15
  307. package/src/sap/ui/model/odata/v4/ODataBinding.js +89 -9
  308. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +87 -21
  309. package/src/sap/ui/model/odata/v4/ODataListBinding.js +72 -50
  310. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +8 -8
  311. package/src/sap/ui/model/odata/v4/ODataModel.js +109 -171
  312. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +34 -67
  313. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +18 -9
  314. package/src/sap/ui/model/odata/v4/ODataUtils.js +1 -1
  315. package/src/sap/ui/model/odata/v4/SubmitMode.js +3 -3
  316. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
  317. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +17 -16
  318. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +5 -1
  319. package/src/sap/ui/model/odata/v4/lib/_Cache.js +86 -117
  320. package/src/sap/ui/model/odata/v4/lib/{_GrandTotalHelper.js → _ConcatHelper.js} +34 -27
  321. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +2 -2
  322. package/src/sap/ui/model/odata/v4/lib/_Helper.js +122 -7
  323. package/src/sap/ui/model/odata/v4/lib/_MetadataConverter.js +4 -4
  324. package/src/sap/ui/model/odata/v4/lib/_MetadataRequestor.js +2 -2
  325. package/src/sap/ui/model/odata/v4/lib/_MinMaxHelper.js +25 -74
  326. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +49 -12
  327. package/src/sap/ui/model/odata/v4/lib/_V2Requestor.js +7 -7
  328. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  329. package/src/sap/ui/model/type/Boolean.js +1 -1
  330. package/src/sap/ui/model/type/Currency.js +1 -1
  331. package/src/sap/ui/model/type/Date.js +1 -1
  332. package/src/sap/ui/model/type/DateInterval.js +3 -3
  333. package/src/sap/ui/model/type/DateTime.js +1 -1
  334. package/src/sap/ui/model/type/DateTimeInterval.js +3 -3
  335. package/src/sap/ui/model/type/FileSize.js +1 -1
  336. package/src/sap/ui/model/type/Float.js +1 -1
  337. package/src/sap/ui/model/type/Integer.js +1 -1
  338. package/src/sap/ui/model/type/String.js +1 -1
  339. package/src/sap/ui/model/type/Time.js +1 -1
  340. package/src/sap/ui/model/type/TimeInterval.js +3 -3
  341. package/src/sap/ui/model/type/Unit.js +1 -1
  342. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  343. package/src/sap/ui/performance/Measurement.js +3 -5
  344. package/src/sap/ui/performance/trace/FESR.js +2 -1
  345. package/src/sap/ui/performance/trace/Interaction.js +11 -9
  346. package/src/sap/ui/qunit/QUnitUtils.js +1 -1
  347. package/src/sap/ui/qunit/qunit-coverage.js +1 -0
  348. package/src/sap/ui/qunit/qunit-junit.js +1 -0
  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 +2 -1
  352. package/src/sap/ui/test/Opa5.js +1 -1
  353. package/src/sap/ui/test/OpaBuilder.js +1 -0
  354. package/src/sap/ui/test/TestUtils.js +17 -30
  355. package/src/sap/ui/test/_BrowserLogCollector.js +1 -0
  356. package/src/sap/ui/test/actions/Action.js +1 -1
  357. package/src/sap/ui/test/launchers/componentLauncher.js +2 -1
  358. package/src/sap/ui/test/opaQunit.js +6 -9
  359. package/src/sap/ui/test/pipelines/MatcherPipeline.js +1 -1
  360. package/src/sap/ui/test/selectors/_ControlSelectorGenerator.js +4 -4
  361. package/src/sap/ui/test/starter/_utils.js +6 -0
  362. package/src/sap/ui/test/starter/createSuite.js +1 -1
  363. package/src/sap/ui/thirdparty/IPv6.js +2 -2
  364. package/src/sap/ui/thirdparty/SecondLevelDomains.js +2 -2
  365. package/src/sap/ui/thirdparty/URI.js +14 -5
  366. package/src/sap/ui/thirdparty/URITemplate.js +2 -2
  367. package/src/sap/ui/thirdparty/caja-html-sanitizer.js +1 -1
  368. package/src/sap/ui/thirdparty/crossroads.js +10 -2
  369. package/src/sap/ui/util/Mobile.js +10 -7
  370. package/src/sap/ui/util/Storage.js +1 -1
  371. package/src/ui5loader-autoconfig.js +1 -1
  372. package/src/ui5loader.js +24 -6
  373. package/src/sap/ui/model/odata/v4/.eslintrc +0 -6
@@ -22,20 +22,20 @@ sap.ui.define(function () {
22
22
  * {@link sap.ui.model.odata.v4.ODataModel#submitBatch}.
23
23
  * @public
24
24
  */
25
- API: "API",
25
+ API : "API",
26
26
 
27
27
  /**
28
28
  * Requests associated with the group ID are sent in a batch request which is triggered
29
29
  * automatically before rendering.
30
30
  * @public
31
31
  */
32
- Auto: "Auto",
32
+ Auto : "Auto",
33
33
 
34
34
  /**
35
35
  * Requests associated with the group ID are sent directly without batch.
36
36
  * @public
37
37
  */
38
- Direct: "Direct"
38
+ Direct : "Direct"
39
39
  };
40
40
 
41
41
  return SubmitMode;
@@ -290,7 +290,7 @@ sap.ui.define([
290
290
  * Returns the string representation of the given parameter value.
291
291
  * @param {object} oParameterValue the parameter value
292
292
  * @param {boolean} bComplex whether the result is a complex binding or a simple binding
293
- * @param {boolean} [bRaw=false] whether the result will contain the raw value
293
+ * @param {boolean} [bRaw] whether the result will contain the raw value
294
294
  */
295
295
  function toString(oParameterValue, bComplex, bRaw) {
296
296
  return Basics.resultToString(Expression.wrapExpression(oParameterValue), true,
@@ -8,13 +8,13 @@
8
8
  sap.ui.define([
9
9
  "./_AggregationHelper",
10
10
  "./_Cache",
11
- "./_GrandTotalHelper",
11
+ "./_ConcatHelper",
12
12
  "./_GroupLock",
13
13
  "./_Helper",
14
14
  "./_MinMaxHelper",
15
15
  "sap/base/Log",
16
16
  "sap/ui/base/SyncPromise"
17
- ], function (_AggregationHelper, _Cache, _GrandTotalHelper, _GroupLock, _Helper, _MinMaxHelper,
17
+ ], function (_AggregationHelper, _Cache, _ConcatHelper, _GroupLock, _Helper, _MinMaxHelper,
18
18
  Log, SyncPromise) {
19
19
  "use strict";
20
20
 
@@ -48,7 +48,8 @@ sap.ui.define([
48
48
  */
49
49
  function _AggregationCache(oRequestor, sResourcePath, oAggregation, mQueryOptions,
50
50
  bHasGrandTotal) {
51
- var fnLeaves = null,
51
+ var fnCount = function () {}, // no specific handling needed for "UI5__count" here
52
+ fnLeaves = null,
52
53
  that = this;
53
54
 
54
55
  _Cache.call(this, oRequestor, sResourcePath, mQueryOptions, true);
@@ -74,7 +75,7 @@ sap.ui.define([
74
75
  this.oGrandTotalPromise = undefined;
75
76
  if (bHasGrandTotal) {
76
77
  this.oGrandTotalPromise = new SyncPromise(function (resolve) {
77
- _GrandTotalHelper.enhanceCacheWithGrandTotal(that.oFirstLevel, oAggregation,
78
+ _ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves,
78
79
  function (oGrandTotal) {
79
80
  var oGrandTotalCopy;
80
81
 
@@ -96,11 +97,10 @@ sap.ui.define([
96
97
  _Helper.setPrivateAnnotation(oGrandTotal, "predicate", "()");
97
98
 
98
99
  resolve(oGrandTotal);
99
- }, fnLeaves);
100
+ }, fnCount]);
100
101
  });
101
102
  } else if (fnLeaves) {
102
- _GrandTotalHelper.enhanceCacheWithGrandTotal(that.oFirstLevel, oAggregation, null,
103
- fnLeaves);
103
+ _ConcatHelper.enhanceCache(that.oFirstLevel, oAggregation, [fnLeaves, fnCount]);
104
104
  }
105
105
  }
106
106
 
@@ -219,15 +219,14 @@ sap.ui.define([
219
219
  *
220
220
  * @param {object} [oGroupNode]
221
221
  * The group node or <code>undefined</code> for the first level cache
222
- * @param {boolean} [bHasGrandTotalHelper]
223
- * Whether the _GrandTotalHelper is involved (use only for the first level cache!)
222
+ * @param {boolean} [bHasConcatHelper]
223
+ * Whether the _ConcatHelper is involved (use only for the first level cache!)
224
224
  * @returns {sap.ui.model.odata.v4.lib._CollectionCache}
225
225
  * The group level cache
226
226
  *
227
227
  * @private
228
228
  */
229
- _AggregationCache.prototype.createGroupLevelCache = function (oGroupNode,
230
- bHasGrandTotalHelper) {
229
+ _AggregationCache.prototype.createGroupLevelCache = function (oGroupNode, bHasConcatHelper) {
231
230
  var oAggregation = this.oAggregation,
232
231
  aAllProperties = _AggregationHelper.getAllProperties(oAggregation),
233
232
  oCache, aGroupBy, bLeaf, iLevel, mQueryOptions, bTotal;
@@ -251,8 +250,8 @@ sap.ui.define([
251
250
  ? " and (" + mQueryOptions.$$filterBeforeAggregate + ")"
252
251
  : "");
253
252
  }
254
- if (!bHasGrandTotalHelper) {
255
- // Note: UI5__count currently handled only by _GrandTotalHelper!
253
+ if (!bHasConcatHelper) {
254
+ // Note: UI5__count currently handled only by _ConcatHelper!
256
255
  delete mQueryOptions.$count;
257
256
  mQueryOptions = _AggregationHelper.buildApply(oAggregation, mQueryOptions, iLevel);
258
257
  }
@@ -783,11 +782,13 @@ sap.ui.define([
783
782
  bHasGroupLevels = !!oAggregation.groupLevels.length;
784
783
  bHasMinOrMax = _AggregationHelper.hasMinOrMax(oAggregation.aggregate);
785
784
 
786
- if (bHasGrandTotal && mQueryOptions.$filter && !oAggregation["grandTotal like 1.84"]) {
785
+ if (mQueryOptions.$filter
786
+ && (bHasGrandTotal && !oAggregation["grandTotal like 1.84"]
787
+ || bHasGroupLevels)) {
787
788
  throw new Error("Unsupported system query option: $filter");
788
789
  }
789
- if (bHasGroupLevels && mQueryOptions.$filter) {
790
- throw new Error("Unsupported system query option: $filter");
790
+ if (mQueryOptions.$search && (bHasGrandTotal || bHasGroupLevels)) {
791
+ throw new Error("Unsupported system query option: $search");
791
792
  }
792
793
  if (bHasMinOrMax) {
793
794
  if (bHasGrandTotal) {
@@ -32,6 +32,7 @@ sap.ui.define([
32
32
  }
33
33
  },
34
34
  groupLevels : ["string"],
35
+ search : "string",
35
36
  subtotalsAtBottomOnly : "boolean"
36
37
  },
37
38
  rComma = /,|%2C|%2c/,
@@ -317,6 +318,9 @@ sap.ui.define([
317
318
  sApply = "concat(" + sLeaves + "," + sApply + ")";
318
319
  }
319
320
  }
321
+ if (oAggregation.search) {
322
+ sApply = "search(" + oAggregation.search + ")/" + sApply;
323
+ }
320
324
  if (mQueryOptions.$$filterBeforeAggregate) {
321
325
  sApply = "filter(" + mQueryOptions.$$filterBeforeAggregate + ")/" + sApply;
322
326
  delete mQueryOptions.$$filterBeforeAggregate;
@@ -367,7 +371,7 @@ sap.ui.define([
367
371
  _AggregationHelper.checkTypeof(vValue[sKey], vType[bIsMap ? "*" : sKey],
368
372
  sPath + "/" + sKey);
369
373
  });
370
- } else if (typeof vValue !== vType) {
374
+ } else if (typeof vValue !== vType) { // eslint-disable-line valid-typeof
371
375
  throw new Error("Not a " + vType + " value for '" + sPath + "'");
372
376
  }
373
377
  },
@@ -11,8 +11,9 @@ sap.ui.define([
11
11
  "./_Requestor",
12
12
  "sap/base/Log",
13
13
  "sap/base/util/isEmptyObject",
14
- "sap/ui/base/SyncPromise"
15
- ], function (_GroupLock, _Helper, _Requestor, Log, isEmptyObject, SyncPromise) {
14
+ "sap/ui/base/SyncPromise",
15
+ "sap/ui/model/odata/ODataUtils"
16
+ ], function (_GroupLock, _Helper, _Requestor, Log, isEmptyObject, SyncPromise, ODataUtils) {
16
17
  "use strict";
17
18
 
18
19
  var sClassName = "sap.ui.model.odata.v4.lib._Cache",
@@ -85,7 +86,7 @@ sap.ui.define([
85
86
  * A resource path relative to the service URL
86
87
  * @param {object} [mQueryOptions]
87
88
  * A map of key-value pairs representing the query string
88
- * @param {boolean} [bSortExpandSelect=false]
89
+ * @param {boolean} [bSortExpandSelect]
89
90
  * Whether the paths in $expand and $select shall be sorted in the cache's query string;
90
91
  * note that this flag can safely be ignored for all "new" features (after 1.47) which
91
92
  * should just sort always
@@ -93,7 +94,7 @@ sap.ui.define([
93
94
  * A function that returns the cache's original resource path to be used to build the target
94
95
  * path for bound messages; if it is not given or returns nothing, <code>sResourcePath</code>
95
96
  * is used instead. See {@link #getOriginalResourcePath}.
96
- * @param {boolean} [bSharedRequest=false]
97
+ * @param {boolean} [bSharedRequest]
97
98
  * If this parameter is set, the cache is read-only and modifying calls lead to an error.
98
99
  *
99
100
  * @alias sap.ui.model.odata.v4.lib._Cache
@@ -1045,7 +1046,7 @@ sap.ui.define([
1045
1046
  * The function is called just before the back-end request is sent.
1046
1047
  * If no back-end request is needed, the function is not called.
1047
1048
  * @returns {sap.ui.base.SyncPromise}
1048
- * A promise which resolves with the new entity when it is updated in the cache.
1049
+ * A promise which resolves without a defined result when it is updated in the cache.
1049
1050
  * @throws {Error} If the cache is shared
1050
1051
  *
1051
1052
  * @public
@@ -1087,8 +1088,6 @@ sap.ui.define([
1087
1088
  var oElement = aResult[0];
1088
1089
 
1089
1090
  that.replaceElement(aElements, iIndex, sPredicate, oElement, aResult[1], sPath);
1090
-
1091
- return oElement;
1092
1091
  });
1093
1092
  });
1094
1093
  };
@@ -1609,7 +1608,7 @@ sap.ui.define([
1609
1608
  * Path of the entity, relative to the cache (as used by change listeners)
1610
1609
  * @param {string} [sUnitOrCurrencyPath]
1611
1610
  * Path of the unit or currency for the property, relative to the entity
1612
- * @param {boolean} [bPatchWithoutSideEffects=false]
1611
+ * @param {boolean} [bPatchWithoutSideEffects]
1613
1612
  * Whether the PATCH response is ignored, except for a new ETag
1614
1613
  * @param {function} [fnPatchSent]
1615
1614
  * The function is called just before a back-end request is sent for the first time.
@@ -2002,11 +2001,11 @@ sap.ui.define([
2002
2001
  * A resource path relative to the service URL
2003
2002
  * @param {object} [mQueryOptions]
2004
2003
  * A map of key-value pairs representing the query string
2005
- * @param {boolean} [bSortExpandSelect=false]
2004
+ * @param {boolean} [bSortExpandSelect]
2006
2005
  * Whether the paths in $expand and $select shall be sorted in the cache's query string
2007
2006
  * @param {string} [sDeepResourcePath=sResourcePath]
2008
2007
  * The deep resource path to be used to build the target path for bound messages
2009
- * @param {boolean} [bSharedRequest=false]
2008
+ * @param {boolean} [bSharedRequest]
2010
2009
  * If this parameter is set, the cache is read-only and modifying calls lead to an error.
2011
2010
  *
2012
2011
  * @alias sap.ui.model.odata.v4.lib._CollectionCache
@@ -2218,56 +2217,6 @@ sap.ui.define([
2218
2217
  return sQueryString;
2219
2218
  };
2220
2219
 
2221
- /**
2222
- * Calculates the index range to be read for the given start, length and prefetch length.
2223
- * Checks if <code>aElements</code> entries are available for half the prefetch length left and
2224
- * right to it. If not, the full prefetch length is added to this side.
2225
- *
2226
- * @param {number} iStart
2227
- * The start index for the data request
2228
- * @param {number} iLength
2229
- * The number of requested entries
2230
- * @param {number} iPrefetchLength
2231
- * The number of entries to prefetch before and after the given range; <code>Infinity</code>
2232
- * is supported
2233
- * @returns {object}
2234
- * Returns an object with a member <code>start</code> for the start index for the next
2235
- * read and <code>length</code> for the number of entries to be read.
2236
- *
2237
- * @private
2238
- */
2239
- _CollectionCache.prototype.getReadRange = function (iStart, iLength, iPrefetchLength) {
2240
- var aElements = this.aElements;
2241
-
2242
- // Checks whether aElements contains at least one <code>undefined</code> entry within the
2243
- // given start (inclusive) and end (exclusive).
2244
- function isDataMissing(iStart, iEnd) {
2245
- var i;
2246
- for (i = iStart; i < iEnd; i += 1) {
2247
- if (aElements[i] === undefined) {
2248
- return true;
2249
- }
2250
- }
2251
- return false;
2252
- }
2253
-
2254
- if (isDataMissing(iStart + iLength, iStart + iLength + iPrefetchLength / 2)) {
2255
- iLength += iPrefetchLength;
2256
- }
2257
- if (isDataMissing(Math.max(iStart - iPrefetchLength / 2, 0), iStart)) {
2258
- iLength += iPrefetchLength;
2259
- iStart -= iPrefetchLength;
2260
- if (iStart < 0) {
2261
- iLength += iStart; // Note: Infinity + -Infinity === NaN
2262
- if (isNaN(iLength)) {
2263
- iLength = Infinity;
2264
- }
2265
- iStart = 0;
2266
- }
2267
- }
2268
- return {length : iLength, start : iStart};
2269
- };
2270
-
2271
2220
  /**
2272
2221
  * Returns the resource path including the query string with $skip and $top if needed.
2273
2222
  *
@@ -2346,8 +2295,7 @@ sap.ui.define([
2346
2295
  if (sPredicate) {
2347
2296
  oKeptElement = this.aElements.$byPredicate[sPredicate];
2348
2297
  if (oKeptElement) {
2349
- if (oElement["@odata.etag"]
2350
- && oElement["@odata.etag"] === oKeptElement["@odata.etag"]) {
2298
+ if (oElement["@odata.etag"] === oKeptElement["@odata.etag"]) {
2351
2299
  oElement = oKeptElement;
2352
2300
  } else if (this.hasPendingChangesForPath(sPredicate)) {
2353
2301
  throw new Error("Modified on client and on server: "
@@ -2429,11 +2377,8 @@ sap.ui.define([
2429
2377
  _CollectionCache.prototype.read = function (iIndex, iLength, iPrefetchLength, oGroupLock,
2430
2378
  fnDataRequested) {
2431
2379
  var aElementsRange,
2432
- iEnd,
2433
- iGapStart = -1,
2434
2380
  oPromise = this.oPendingRequestsPromise || this.aElements.$tail,
2435
- oRange,
2436
- i, n, that = this;
2381
+ that = this;
2437
2382
 
2438
2383
  if (iIndex < 0) {
2439
2384
  throw new Error("Illegal index " + iIndex + ", must be >= 0");
@@ -2448,34 +2393,23 @@ sap.ui.define([
2448
2393
  });
2449
2394
  }
2450
2395
 
2451
- oRange = this.getReadRange(iIndex, iLength, this.bServerDrivenPaging ? 0 : iPrefetchLength);
2452
- iEnd = Math.min(oRange.start + oRange.length, this.aElements.$created + this.iLimit);
2453
- n = Math.min(iEnd, Math.max(oRange.start, this.aElements.length) + 1);
2454
-
2455
- for (i = oRange.start; i < n; i += 1) {
2456
- if (this.aElements[i] !== undefined) {
2457
- if (iGapStart >= 0) {
2458
- this.requestElements(iGapStart, i, oGroupLock.getUnlockedCopy(),
2459
- fnDataRequested);
2460
- fnDataRequested = undefined;
2461
- iGapStart = -1;
2462
- }
2463
- } else if (iGapStart < 0) {
2464
- iGapStart = i;
2465
- }
2466
- }
2467
- if (iGapStart >= 0) {
2468
- this.requestElements(iGapStart, iEnd, oGroupLock.getUnlockedCopy(), fnDataRequested);
2469
- }
2396
+ ODataUtils._getReadIntervals(this.aElements, iIndex, iLength,
2397
+ this.bServerDrivenPaging ? 0 : iPrefetchLength,
2398
+ this.aElements.$created + this.iLimit)
2399
+ .forEach(function (oInterval) {
2400
+ that.requestElements(oInterval.start, oInterval.end, oGroupLock.getUnlockedCopy(),
2401
+ fnDataRequested);
2402
+ fnDataRequested = undefined;
2403
+ });
2470
2404
 
2471
2405
  oGroupLock.unlock();
2472
2406
 
2473
- aElementsRange = this.aElements.slice(iIndex, iEnd);
2474
- if (this.aElements.$tail) { // Note: if available, it must be ours!
2407
+ aElementsRange = this.aElements.slice(iIndex, iIndex + iLength + iPrefetchLength);
2408
+ if (this.aElements.$tail && iIndex + iLength > this.aElements.length) {
2475
2409
  aElementsRange.push(this.aElements.$tail);
2476
2410
  }
2477
2411
  return SyncPromise.all(aElementsRange).then(function () {
2478
- var aElements = that.aElements.slice(iIndex, iEnd);
2412
+ var aElements = that.aElements.slice(iIndex, iIndex + iLength);
2479
2413
 
2480
2414
  aElements.$count = that.aElements.$count;
2481
2415
 
@@ -2801,7 +2735,7 @@ sap.ui.define([
2801
2735
  };
2802
2736
 
2803
2737
  /**
2804
- * Returns a promise to be resolved with an OData object for the requested property value.
2738
+ * Returns a promise to be resolved with the requested property value.
2805
2739
  *
2806
2740
  * @param {sap.ui.model.odata.v4.lib._GroupLock} oGroupLock
2807
2741
  * A lock for the group to associate the request with
@@ -2839,11 +2773,10 @@ sap.ui.define([
2839
2773
  fnDataRequested, undefined, this.sMetaPath));
2840
2774
  }
2841
2775
  return this.oPromise.then(function (oResult) {
2842
- // for a null value, null is returned due to "204 No Content". But it is expected in the
2843
- // value property of an object
2844
- oResult = oResult || {value : null};
2845
2776
  that.registerChange("", oListener);
2846
- return oResult.value;
2777
+ // Note: For a null value, null is returned due to "204 No Content". For $count,
2778
+ // "a simple primitive integer value with media type text/plain" is returned.
2779
+ return oResult && typeof oResult === "object" ? oResult.value : oResult;
2847
2780
  });
2848
2781
  };
2849
2782
 
@@ -2873,9 +2806,9 @@ sap.ui.define([
2873
2806
  * A resource path relative to the service URL
2874
2807
  * @param {object} [mQueryOptions]
2875
2808
  * A map of key-value pairs representing the query string
2876
- * @param {boolean} [bSortExpandSelect=false]
2809
+ * @param {boolean} [bSortExpandSelect]
2877
2810
  * Whether the paths in $expand and $select shall be sorted in the cache's query string
2878
- * @param {boolean} [bSharedRequest=false]
2811
+ * @param {boolean} [bSharedRequest]
2879
2812
  * If this parameter is set, the cache is read-only and modifying calls lead to an error.
2880
2813
  * @param {function} [fnGetOriginalResourcePath]
2881
2814
  * A function that returns the cache's original resource path to be used to build the target
@@ -2992,7 +2925,14 @@ sap.ui.define([
2992
2925
  * The entity which contains the ETag to be sent as "If-Match" header with the POST request.
2993
2926
  * @param {boolean} [bIgnoreETag]
2994
2927
  * Whether the entity's ETag should be actively ignored (If-Match:*); used only in case an
2995
- * entity is given
2928
+ * entity is given and an ETag is present
2929
+ * @param {function} [fnOnStrictHandlingFailed]
2930
+ * If this callback is given, then the preference "handling=strict" is applied.
2931
+ * If the request fails with an error having <code>oError.strictHandlingFailed</code> set,
2932
+ * this error is passed to the callback which returns a promise. If this promise resolves with
2933
+ * <code>true</code> the action is repeated w/o the preference, otherwise this function's
2934
+ * result promise is rejected with an <code>Error</code> instance <code>oError</code> where
2935
+ * <code>oError.canceled === true</code>.
2996
2936
  * @returns {sap.ui.base.SyncPromise}
2997
2937
  * A promise to be resolved with the result of the request.
2998
2938
  * @throws {Error}
@@ -3001,11 +2941,48 @@ sap.ui.define([
3001
2941
  *
3002
2942
  * @public
3003
2943
  */
3004
- _SingleCache.prototype.post = function (oGroupLock, oData, oEntity, bIgnoreETag) {
2944
+ _SingleCache.prototype.post = function (oGroupLock, oData, oEntity, bIgnoreETag,
2945
+ fnOnStrictHandlingFailed) {
3005
2946
  var sGroupId,
2947
+ mHeaders = oEntity
2948
+ ? {"If-Match" : bIgnoreETag && "@odata.etag" in oEntity ? "*" : oEntity}
2949
+ : {},
3006
2950
  sHttpMethod = "POST",
3007
2951
  that = this;
3008
2952
 
2953
+ function post(oGroupLock0) {
2954
+ that.bPosting = true;
2955
+
2956
+ // BEWARE! Avoid finally here! BCP: 2070200175
2957
+ return SyncPromise.all([
2958
+ that.oRequestor.request(sHttpMethod,
2959
+ that.sResourcePath + that.sQueryString, oGroupLock0, mHeaders, oData),
2960
+ that.fetchTypes()
2961
+ ]).then(function (aResult) {
2962
+ that.visitResponse(aResult[0], aResult[1]);
2963
+ that.bPosting = false;
2964
+
2965
+ return aResult[0];
2966
+ }, function (oError) {
2967
+ that.bPosting = false;
2968
+ if (fnOnStrictHandlingFailed && oError.strictHandlingFailed) {
2969
+ return fnOnStrictHandlingFailed(oError).then(function (bConfirm) {
2970
+ var oCanceledError;
2971
+
2972
+ if (bConfirm) {
2973
+ delete mHeaders["Prefer"];
2974
+ return post(oGroupLock0.getUnlockedCopy());
2975
+ }
2976
+
2977
+ oCanceledError = Error("Action canceled due to strict handling");
2978
+ oCanceledError.canceled = true;
2979
+ throw oCanceledError;
2980
+ });
2981
+ }
2982
+ throw oError;
2983
+ });
2984
+ }
2985
+
3009
2986
  this.checkSharedRequest();
3010
2987
  if (!this.bPost) {
3011
2988
  throw new Error("POST request not allowed");
@@ -3031,22 +3008,11 @@ sap.ui.define([
3031
3008
  }
3032
3009
  }
3033
3010
 
3034
- this.bPosting = true;
3035
3011
  this.bSentRequest = true;
3036
- this.oPromise = SyncPromise.all([
3037
- this.oRequestor.request(sHttpMethod, this.sResourcePath + this.sQueryString, oGroupLock,
3038
- oEntity && {"If-Match" : bIgnoreETag ? "*" : oEntity}, oData),
3039
- this.fetchTypes()
3040
- ]).then(function (aResult) {
3041
- that.visitResponse(aResult[0], aResult[1]);
3042
- that.bPosting = false;
3043
-
3044
- return aResult[0];
3045
- }, function (oError) {
3046
- // BEWARE! Avoid finally here! BCP: 2070200175
3047
- that.bPosting = false;
3048
- throw oError;
3049
- });
3012
+ if (fnOnStrictHandlingFailed) {
3013
+ mHeaders["Prefer"] = "handling=strict";
3014
+ }
3015
+ this.oPromise = post(oGroupLock);
3050
3016
 
3051
3017
  return this.oPromise;
3052
3018
  };
@@ -3109,6 +3075,9 @@ sap.ui.define([
3109
3075
  var oNewValue = aResult[0],
3110
3076
  oOldValue = aResult[2];
3111
3077
 
3078
+ // ensure that the new value has a predicate although key properties were not requested
3079
+ _Helper.setPrivateAnnotation(oNewValue, "predicate",
3080
+ _Helper.getPrivateAnnotation(oOldValue, "predicate"));
3112
3081
  // visit response to report the messages
3113
3082
  that.visitResponse(oNewValue, aResult[1]);
3114
3083
  _Helper.updateAll(that.mChangeListeners, "", oOldValue, oNewValue, function (sPath) {
@@ -3142,11 +3111,11 @@ sap.ui.define([
3142
3111
  * Examples:
3143
3112
  * {foo : "bar", "bar" : "baz"} results in the query string "foo=bar&bar=baz"
3144
3113
  * {foo : ["bar", "baz"]} results in the query string "foo=bar&foo=baz"
3145
- * @param {boolean} [bSortExpandSelect=false]
3114
+ * @param {boolean} [bSortExpandSelect]
3146
3115
  * Whether the paths in $expand and $select shall be sorted in the cache's query string
3147
3116
  * @param {string} [sDeepResourcePath=sResourcePath]
3148
3117
  * The deep resource path to be used to build the target path for bound messages
3149
- * @param {boolean} [bSharedRequest=false]
3118
+ * @param {boolean} [bSharedRequest]
3150
3119
  * If this parameter is set, multiple requests for a cache using the same resource path will
3151
3120
  * always return the same, shared cache. This cache is read-only, modifying calls lead to an
3152
3121
  * error.
@@ -3238,9 +3207,9 @@ sap.ui.define([
3238
3207
  * Examples:
3239
3208
  * {foo : "bar", "bar" : "baz"} results in the query string "foo=bar&bar=baz"
3240
3209
  * {foo : ["bar", "baz"]} results in the query string "foo=bar&foo=baz"
3241
- * @param {boolean} [bSortExpandSelect=false]
3210
+ * @param {boolean} [bSortExpandSelect]
3242
3211
  * Whether the paths in $expand and $select shall be sorted in the cache's query string
3243
- * @param {boolean} [bSharedRequest=false]
3212
+ * @param {boolean} [bSharedRequest]
3244
3213
  * If this parameter is set, multiple requests for a cache using the same resource path might
3245
3214
  * always return the same, shared cache. This cache is read-only, modifying calls lead to an
3246
3215
  * error.
@@ -3329,4 +3298,4 @@ sap.ui.define([
3329
3298
  };
3330
3299
 
3331
3300
  return _Cache;
3332
- }, /* bExport= */false);
3301
+ }, /* bExport= */false);
@@ -4,7 +4,7 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
 
7
- //Provides class sap.ui.model.odata.v4.lib._GrandTotalHelper
7
+ //Provides class sap.ui.model.odata.v4.lib._ConcatHelper
8
8
  sap.ui.define([
9
9
  "./_AggregationHelper"
10
10
  ], function (_AggregationHelper) {
@@ -12,8 +12,9 @@ sap.ui.define([
12
12
 
13
13
  return {
14
14
  /**
15
- * Enhances the given cache, so that the (leaf) count and/or grand total are requested
16
- * together with the first request. Subsequent requests remain unchanged.
15
+ * Enhances the given cache, so that additional rows are requested together with the first
16
+ * request using "concat"; this means that $count needs to be requested as "UI5__count"
17
+ * instead, in a separate row. Subsequent requests remain unchanged.
17
18
  *
18
19
  * @param {sap.ui.model.odata.v4.lib._CollectionCache} oCache
19
20
  * The cache to be enhanced
@@ -22,19 +23,22 @@ sap.ui.define([
22
23
  * <a href="http://docs.oasis-open.org/odata/odata-data-aggregation-ext/v4.0/">OData
23
24
  * Extension for Data Aggregation Version 4.0</a>; must already be normalized by
24
25
  * {@link _AggregationHelper.buildApply}
25
- * @param {function} [fnGrandTotal]
26
- * Callback for the grand total response
27
- * @param {function} [fnLeaves]
28
- * Callback for the leaf count response
26
+ * @param {function[]} [aAdditionalRowHandlers]
27
+ * Handlers for the additional response rows (which are automatically scanned for
28
+ * "UI5__count"); if a handler is missing, the corresponding row is assumed to be missing
29
+ * as well
30
+ * @param {object} [mAlias2MeasureAndMethod]
31
+ * A map which is filled by {@link _AggregationHelper.buildApply} in case an aggregatable
32
+ * property requests minimum or maximum values.
29
33
  */
30
- enhanceCacheWithGrandTotal : function (oCache, oAggregation, fnGrandTotal, fnLeaves) {
34
+ enhanceCache : function (oCache, oAggregation, aAdditionalRowHandlers,
35
+ mAlias2MeasureAndMethod) {
31
36
  var bFollowUp;
32
37
 
33
38
  /**
34
39
  * Returns the resource path including the query string with "$apply" which includes the
35
- * aggregation functions for (leaf) count and grand total and "skip()/top()" as
36
- * transformations. Follow-up requests do not aggregate the (leaf) count and grand
37
- * total again.
40
+ * aggregation functions for additional rows and thus uses "skip()/top()" as
41
+ * transformations. Follow-up requests do not aggregate these additional rows again.
38
42
  *
39
43
  * This function is used to replace <code>getResourcePathWithQuery</code> of the first
40
44
  * level cache and needs to be called on the first level cache.
@@ -43,16 +47,17 @@ sap.ui.define([
43
47
  * The start index of the range
44
48
  * @param {number} iEnd
45
49
  * The index after the last element
46
- * @returns {string} The resource path including the query string
50
+ * @returns {string}
51
+ * The resource path including the query string
47
52
  */
48
53
  // @override sap.ui.model.odata.v4.lib._CollectionCache#getResourcePathWithQuery
49
- // Note: same as in _MinMaxHelper
50
54
  oCache.getResourcePathWithQuery = function (iStart, iEnd) {
55
+ // Note: ignore existing mQueryOptions.$apply, e.g. from ODLB#updateAnalyticalInfo
51
56
  var mQueryOptionsWithApply = _AggregationHelper.buildApply(oAggregation,
52
57
  Object.assign({}, this.mQueryOptions, {
53
58
  $skip : iStart,
54
59
  $top : iEnd - iStart
55
- }), 1, bFollowUp);
60
+ }), 1, bFollowUp, mAlias2MeasureAndMethod);
56
61
 
57
62
  bFollowUp = true; // next request is a follow-up
58
63
 
@@ -61,28 +66,30 @@ sap.ui.define([
61
66
  };
62
67
 
63
68
  /**
64
- * Handles a GET response wich may contain grand total or (leaf) count, each in a row of
65
- * its own.
69
+ * Handles a GET response wich contains additional rows.
66
70
  *
67
71
  * @param {number} iStart
68
72
  * The index of the first element to request ($skip)
69
73
  * @param {number} iEnd
70
74
  * The index after the last element to request ($skip + $top)
71
- * @param {object} oResult The result of the GET request
72
- * @param {object} mTypeForMetaPath A map from meta path to the entity type (as
73
- * delivered by {@link #fetchTypes})
75
+ * @param {object} oResult
76
+ * The result of the GET request
77
+ * @param {object} mTypeForMetaPath
78
+ * A map from meta path to the entity type (as delivered by {@link #fetchTypes})
74
79
  */
75
80
  // @override sap.ui.model.odata.v4.lib._CollectionCache#handleResponse
76
81
  oCache.handleResponse = function (iStart, iEnd, oResult, mTypeForMetaPath) {
77
- if (fnLeaves) {
78
- fnLeaves(oResult.value.shift());
79
- }
80
- if (fnGrandTotal) {
81
- fnGrandTotal(oResult.value.shift());
82
- }
82
+ aAdditionalRowHandlers.forEach(function (fnHandler) {
83
+ var oAdditionalRow;
83
84
 
84
- // Note: drop row with UI5__count only
85
- oResult["@odata.count"] = oResult.value.shift().UI5__count;
85
+ if (fnHandler) {
86
+ oAdditionalRow = oResult.value.shift();
87
+ if ("UI5__count" in oAdditionalRow) {
88
+ oResult["@odata.count"] = oAdditionalRow.UI5__count;
89
+ }
90
+ fnHandler(oAdditionalRow);
91
+ }
92
+ });
86
93
 
87
94
  // revert to prototype and call it
88
95
  delete this.handleResponse;
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * The group ID
20
20
  * @param {object} oOwner
21
21
  * The lock's owner for debugging
22
- * @param {boolean} [bLocked=false]
22
+ * @param {boolean} [bLocked]
23
23
  * Whether the lock is locked
24
24
  * @param {boolean} [bModifying]
25
25
  * Whether the reason for the group lock is a modifying request
@@ -158,7 +158,7 @@ sap.ui.define([
158
158
  /**
159
159
  * Unlocks the lock. Resolves all promises returned by {@link #waitFor}.
160
160
  *
161
- * @param {boolean} [bForce=false]
161
+ * @param {boolean} [bForce]
162
162
  * Whether unlock may be called multiple times.
163
163
  * @throws {Error}
164
164
  * If unlock is called a second time without <code>bForce</code>