@openui5/sap.ui.core 1.94.0 → 1.97.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/.eslintrc.json +15 -4
  2. package/.reuse/dep5 +12 -12
  3. package/THIRDPARTY.txt +21 -17
  4. package/package.json +1 -1
  5. package/src/jquery.sap.global.js +1 -1
  6. package/src/jquery.sap.properties.js +1 -1
  7. package/src/jquery.sap.resources.js +2 -2
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/sap/base/i18n/ResourceBundle.js +6 -2
  11. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  12. package/src/sap/base/util/restricted/_castArray.js +1 -1
  13. package/src/sap/base/util/restricted/_compact.js +1 -1
  14. package/src/sap/base/util/restricted/_curry.js +1 -1
  15. package/src/sap/base/util/restricted/_debounce.js +1 -1
  16. package/src/sap/base/util/restricted/_difference.js +1 -1
  17. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  18. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  19. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  20. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  21. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  22. package/src/sap/base/util/restricted/_flatten.js +1 -1
  23. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_intersection.js +1 -1
  26. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  27. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  28. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  29. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  30. package/src/sap/base/util/restricted/_isNil.js +1 -1
  31. package/src/sap/base/util/restricted/_max.js +1 -1
  32. package/src/sap/base/util/restricted/_merge.js +1 -1
  33. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  34. package/src/sap/base/util/restricted/_min.js +1 -1
  35. package/src/sap/base/util/restricted/_omit.js +1 -1
  36. package/src/sap/base/util/restricted/_pick.js +1 -1
  37. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  38. package/src/sap/base/util/restricted/_throttle.js +1 -1
  39. package/src/sap/base/util/restricted/_toArray.js +1 -1
  40. package/src/sap/base/util/restricted/_union.js +1 -1
  41. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  42. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  43. package/src/sap/base/util/restricted/_uniq.js +1 -1
  44. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  45. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  46. package/src/sap/base/util/restricted/_without.js +1 -1
  47. package/src/sap/base/util/restricted/_xor.js +1 -1
  48. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  49. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  50. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  51. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  52. package/src/sap/ui/Device.js +15 -11
  53. package/src/sap/ui/Global.js +13 -17
  54. package/src/sap/ui/base/DataType.js +14 -8
  55. package/src/sap/ui/base/Event.js +1 -1
  56. package/src/sap/ui/base/EventProvider.js +1 -1
  57. package/src/sap/ui/base/Interface.js +1 -1
  58. package/src/sap/ui/base/ManagedObject.js +13 -8
  59. package/src/sap/ui/base/ManagedObjectMetadata.js +2 -2
  60. package/src/sap/ui/base/Metadata.js +1 -3
  61. package/src/sap/ui/base/Object.js +1 -1
  62. package/src/sap/ui/base/ObjectPool.js +1 -1
  63. package/src/sap/ui/core/.library +6 -32
  64. package/src/sap/ui/core/AppCacheBuster.js +8 -8
  65. package/src/sap/ui/core/BusyIndicator.js +1 -1
  66. package/src/sap/ui/core/Component.js +303 -135
  67. package/src/sap/ui/core/ComponentContainer.js +11 -7
  68. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  69. package/src/sap/ui/core/ComponentSupport.js +1 -1
  70. package/src/sap/ui/core/Configuration.js +67 -31
  71. package/src/sap/ui/core/Control.js +2 -2
  72. package/src/sap/ui/core/Core.js +79 -15
  73. package/src/sap/ui/core/CustomData.js +1 -1
  74. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  75. package/src/sap/ui/core/Element.js +2 -6
  76. package/src/sap/ui/core/ElementMetadata.js +1 -1
  77. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  78. package/src/sap/ui/core/EventBus.js +1 -1
  79. package/src/sap/ui/core/ExtensionPoint.js +6 -13
  80. package/src/sap/ui/core/Fragment.js +30 -32
  81. package/src/sap/ui/core/HTML.js +3 -3
  82. package/src/sap/ui/core/History.js +1 -1
  83. package/src/sap/ui/core/Icon.js +7 -8
  84. package/src/sap/ui/core/IconPool.js +26 -1097
  85. package/src/sap/ui/core/IconRenderer.js +6 -6
  86. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  87. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  88. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  89. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  90. package/src/sap/ui/core/InvisibleText.js +1 -1
  91. package/src/sap/ui/core/Item.js +1 -1
  92. package/src/sap/ui/core/LabelEnablement.js +1 -1
  93. package/src/sap/ui/core/LayoutData.js +1 -1
  94. package/src/sap/ui/core/ListItem.js +1 -1
  95. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  96. package/src/sap/ui/core/Locale.js +26 -4
  97. package/src/sap/ui/core/LocaleData.js +3 -3
  98. package/src/sap/ui/core/Manifest.js +2 -60
  99. package/src/sap/ui/core/Message.js +1 -1
  100. package/src/sap/ui/core/Patcher.js +27 -3
  101. package/src/sap/ui/core/Placeholder.js +4 -4
  102. package/src/sap/ui/core/RenderManager.js +38 -8
  103. package/src/sap/ui/core/Renderer.js +13 -3
  104. package/src/sap/ui/core/ResizeHandler.js +1 -1
  105. package/src/sap/ui/core/ScrollBar.js +4 -3
  106. package/src/sap/ui/core/SeparatorItem.js +1 -1
  107. package/src/sap/ui/core/ShortcutHintsMixin.js +14 -7
  108. package/src/sap/ui/core/ThemeCheck.js +2 -2
  109. package/src/sap/ui/core/Title.js +1 -1
  110. package/src/sap/ui/core/TooltipBase.js +1 -1
  111. package/src/sap/ui/core/UIArea.js +3 -3
  112. package/src/sap/ui/core/UIComponent.js +19 -11
  113. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  114. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  115. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  116. package/src/sap/ui/core/XMLComposite.js +2 -2
  117. package/src/sap/ui/core/XMLCompositeMetadata.js +2 -2
  118. package/src/sap/ui/core/XMLTemplateProcessor.js +132 -43
  119. package/src/sap/ui/core/_IconRegistry.js +1148 -0
  120. package/src/sap/ui/core/cache/LRUPersistentCache.js +4 -2
  121. package/src/sap/ui/core/date/UniversalDateUtils.js +33 -0
  122. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  123. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  124. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  125. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  126. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  127. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  128. package/src/sap/ui/core/format/NumberFormat.js +16 -1
  129. package/src/sap/ui/core/hyphenation/Hyphenation.js +61 -80
  130. package/src/sap/ui/core/library.js +5 -5
  131. package/src/sap/ui/core/message/ControlMessageProcessor.js +5 -5
  132. package/src/sap/ui/core/message/Message.js +1 -1
  133. package/src/sap/ui/core/message/MessageManager.js +13 -15
  134. package/src/sap/ui/core/message/MessageParser.js +1 -1
  135. package/src/sap/ui/core/message/MessageProcessor.js +22 -12
  136. package/src/sap/ui/core/messagebundle_de.properties +1 -1
  137. package/src/sap/ui/core/messagebundle_fr.properties +8 -8
  138. package/src/sap/ui/core/messagebundle_it.properties +1 -1
  139. package/src/sap/ui/core/messagebundle_pl.properties +1 -1
  140. package/src/sap/ui/core/messagebundle_ru.properties +21 -21
  141. package/src/sap/ui/core/messagebundle_th.properties +2 -2
  142. package/src/sap/ui/core/mvc/Controller.js +5 -5
  143. package/src/sap/ui/core/mvc/ControllerExtensionProvider.js +30 -32
  144. package/src/sap/ui/core/mvc/ControllerMetadata.js +18 -18
  145. package/src/sap/ui/core/mvc/HTMLView.js +2 -2
  146. package/src/sap/ui/core/mvc/JSONView.js +2 -2
  147. package/src/sap/ui/core/mvc/JSView.js +2 -2
  148. package/src/sap/ui/core/mvc/TemplateView.js +2 -2
  149. package/src/sap/ui/core/mvc/View.js +58 -85
  150. package/src/sap/ui/core/mvc/XMLView.js +2 -2
  151. package/src/sap/ui/core/mvc/XMLViewRenderer.js +17 -20
  152. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  153. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  154. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  155. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  156. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  157. package/src/sap/ui/core/routing/Route.js +10 -1
  158. package/src/sap/ui/core/routing/Router.js +16 -6
  159. package/src/sap/ui/core/routing/Targets.js +26 -0
  160. package/src/sap/ui/core/routing/async/Route.js +6 -3
  161. package/src/sap/ui/core/routing/async/Target.js +28 -4
  162. package/src/sap/ui/core/routing/sync/Target.js +15 -0
  163. package/src/sap/ui/core/rules/Misc.support.js +51 -1
  164. package/src/sap/ui/core/rules/Rendering.support.js +1 -4
  165. package/src/sap/ui/core/rules/View.support.js +14 -46
  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/Plugin.js +2 -2
  172. package/src/sap/ui/core/support/RuleEngineOpaExtension.js +0 -1
  173. package/src/sap/ui/core/support/Support.js +1 -1
  174. package/src/sap/ui/core/support/controls/TreeViewer.js +1 -1
  175. package/src/sap/ui/core/support/plugins/ControlTree.js +37 -43
  176. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  177. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  178. package/src/sap/ui/core/support/plugins/Performance.js +1 -2
  179. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  180. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  181. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  182. package/src/sap/ui/core/support/plugins/ViewInfo.js +2 -2
  183. package/src/sap/ui/core/support/support.css +2 -8
  184. package/src/sap/ui/core/support/techinfo/TechnicalInfo.fragment.xml +1 -0
  185. package/src/sap/ui/core/support/techinfo/TechnicalInfo.js +150 -73
  186. package/src/sap/ui/core/support/trace/E2eTraceLib.js +3 -3
  187. package/src/sap/ui/core/themes/base/Icon.less +9 -0
  188. package/src/sap/ui/core/themes/base/SAP-icons.css +2 -0
  189. package/src/sap/ui/core/themes/base/SAP-icons.less +10 -0
  190. package/src/sap/ui/core/themes/base/base.less +543 -390
  191. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  192. package/src/sap/ui/core/themes/base/global.less +38 -0
  193. package/src/sap/ui/core/themes/base/library.source.less +1 -2
  194. package/src/sap/ui/core/themes/sap_hcb/global.less +34 -0
  195. package/src/sap/ui/core/theming/Parameters.js +21 -0
  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 +1 -1
  200. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  201. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  202. package/src/sap/ui/core/util/Export.js +1 -1
  203. package/src/sap/ui/core/util/ExportCell.js +1 -1
  204. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  205. package/src/sap/ui/core/util/ExportRow.js +1 -1
  206. package/src/sap/ui/core/util/ExportType.js +1 -1
  207. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  208. package/src/sap/ui/core/util/File.js +1 -1
  209. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  210. package/src/sap/ui/core/util/MockServer.js +2 -2
  211. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  212. package/src/sap/ui/core/util/XMLPreprocessor.js +11 -12
  213. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +10 -12
  214. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +6 -3
  215. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  216. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  217. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  218. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  219. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  220. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  221. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  222. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  223. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  224. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  225. package/src/sap/ui/debug/ControlTree.js +1 -1
  226. package/src/sap/ui/debug/DebugEnv.js +1 -1
  227. package/src/sap/ui/debug/Highlighter.js +8 -2
  228. package/src/sap/ui/debug/PropertyList.js +1 -1
  229. package/src/sap/ui/model/Binding.js +174 -118
  230. package/src/sap/ui/model/ChangeReason.js +1 -1
  231. package/src/sap/ui/model/ClientContextBinding.js +1 -1
  232. package/src/sap/ui/model/ClientListBinding.js +8 -3
  233. package/src/sap/ui/model/ClientModel.js +9 -8
  234. package/src/sap/ui/model/ClientPropertyBinding.js +4 -2
  235. package/src/sap/ui/model/ClientTreeBinding.js +15 -9
  236. package/src/sap/ui/model/ClientTreeBindingAdapter.js +28 -23
  237. package/src/sap/ui/model/CompositeBinding.js +98 -77
  238. package/src/sap/ui/model/CompositeDataState.js +2 -2
  239. package/src/sap/ui/model/CompositeType.js +2 -2
  240. package/src/sap/ui/model/Context.js +4 -2
  241. package/src/sap/ui/model/ContextBinding.js +6 -14
  242. package/src/sap/ui/model/DataState.js +2 -2
  243. package/src/sap/ui/model/Filter.js +255 -53
  244. package/src/sap/ui/model/FilterOperator.js +1 -1
  245. package/src/sap/ui/model/FilterProcessor.js +27 -17
  246. package/src/sap/ui/model/FilterType.js +1 -1
  247. package/src/sap/ui/model/ListBinding.js +200 -118
  248. package/src/sap/ui/model/MetaModel.js +4 -9
  249. package/src/sap/ui/model/Model.js +349 -303
  250. package/src/sap/ui/model/PropertyBinding.js +92 -58
  251. package/src/sap/ui/model/SelectionModel.js +2 -2
  252. package/src/sap/ui/model/SimpleType.js +2 -2
  253. package/src/sap/ui/model/Sorter.js +1 -1
  254. package/src/sap/ui/model/SorterProcessor.js +1 -1
  255. package/src/sap/ui/model/StaticBinding.js +1 -1
  256. package/src/sap/ui/model/TreeAutoExpandMode.js +2 -2
  257. package/src/sap/ui/model/TreeBinding.js +1 -1
  258. package/src/sap/ui/model/TreeBindingAdapter.js +249 -100
  259. package/src/sap/ui/model/TreeBindingCompatibilityAdapter.js +16 -9
  260. package/src/sap/ui/model/TreeBindingUtils.js +3 -0
  261. package/src/sap/ui/model/Type.js +1 -1
  262. package/src/sap/ui/model/analytics/AnalyticalBinding.js +20 -10
  263. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +17 -19
  264. package/src/sap/ui/model/analytics/AnalyticalVersionInfo.js +1 -1
  265. package/src/sap/ui/model/analytics/BatchResponseCollector.js +1 -1
  266. package/src/sap/ui/model/analytics/ODataModelAdapter.js +1 -1
  267. package/src/sap/ui/model/analytics/odata4analytics.js +3 -2
  268. package/src/sap/ui/model/base/ManagedObjectModel.js +4 -0
  269. package/src/sap/ui/model/json/JSONListBinding.js +8 -5
  270. package/src/sap/ui/model/json/JSONModel.js +29 -20
  271. package/src/sap/ui/model/json/JSONPropertyBinding.js +5 -4
  272. package/src/sap/ui/model/json/JSONTreeBinding.js +1 -1
  273. package/src/sap/ui/model/message/MessageListBinding.js +6 -3
  274. package/src/sap/ui/model/message/MessageModel.js +25 -17
  275. package/src/sap/ui/model/message/MessagePropertyBinding.js +3 -3
  276. package/src/sap/ui/model/odata/AnnotationHelper.js +3 -3
  277. package/src/sap/ui/model/odata/AnnotationParser.js +5 -3
  278. package/src/sap/ui/model/odata/CountMode.js +1 -1
  279. package/src/sap/ui/model/odata/Filter.js +1 -1
  280. package/src/sap/ui/model/odata/ODataAnnotations.js +2 -2
  281. package/src/sap/ui/model/odata/ODataContextBinding.js +1 -1
  282. package/src/sap/ui/model/odata/ODataListBinding.js +62 -39
  283. package/src/sap/ui/model/odata/ODataMessageParser.js +3 -3
  284. package/src/sap/ui/model/odata/ODataMetaModel.js +6 -4
  285. package/src/sap/ui/model/odata/ODataMetadata.js +137 -86
  286. package/src/sap/ui/model/odata/ODataModel.js +443 -216
  287. package/src/sap/ui/model/odata/ODataPropertyBinding.js +8 -6
  288. package/src/sap/ui/model/odata/ODataTreeBinding.js +65 -33
  289. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +28 -18
  290. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +442 -262
  291. package/src/sap/ui/model/odata/ODataUtils.js +36 -19
  292. package/src/sap/ui/model/odata/OperationMode.js +1 -1
  293. package/src/sap/ui/model/odata/_AnnotationHelperBasics.js +2 -1
  294. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +11 -9
  295. package/src/sap/ui/model/odata/_ODataMetaModelUtils.js +6 -4
  296. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  297. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  298. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  299. package/src/sap/ui/model/odata/type/Date.js +1 -1
  300. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  301. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  302. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  303. package/src/sap/ui/model/odata/type/Decimal.js +5 -1
  304. package/src/sap/ui/model/odata/type/Double.js +1 -1
  305. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  306. package/src/sap/ui/model/odata/type/Int.js +1 -1
  307. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  308. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  309. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  310. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  311. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  312. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  313. package/src/sap/ui/model/odata/type/Single.js +1 -1
  314. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  315. package/src/sap/ui/model/odata/type/String.js +1 -1
  316. package/src/sap/ui/model/odata/type/Time.js +1 -1
  317. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  318. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  319. package/src/sap/ui/model/odata/type/UnitMixin.js +0 -1
  320. package/src/sap/ui/model/odata/v2/Context.js +98 -17
  321. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +2 -2
  322. package/src/sap/ui/model/odata/v2/ODataContextBinding.js +1 -1
  323. package/src/sap/ui/model/odata/v2/ODataListBinding.js +416 -132
  324. package/src/sap/ui/model/odata/v2/ODataModel.js +465 -250
  325. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +191 -109
  326. package/src/sap/ui/model/odata/v2/_CreatedContextsCache.js +179 -0
  327. package/src/sap/ui/model/odata/v4/Context.js +48 -7
  328. package/src/sap/ui/model/odata/v4/ODataBinding.js +60 -30
  329. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +177 -53
  330. package/src/sap/ui/model/odata/v4/ODataListBinding.js +304 -91
  331. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +32 -20
  332. package/src/sap/ui/model/odata/v4/ODataModel.js +29 -15
  333. package/src/sap/ui/model/odata/v4/ODataParentBinding.js +83 -51
  334. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +13 -9
  335. package/src/sap/ui/model/odata/v4/lib/_Cache.js +115 -19
  336. package/src/sap/ui/model/odata/v4/lib/_Helper.js +35 -5
  337. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +50 -5
  338. package/src/sap/ui/model/resource/ResourceModel.js +6 -2
  339. package/src/sap/ui/model/resource/ResourcePropertyBinding.js +1 -1
  340. package/src/sap/ui/model/type/Boolean.js +2 -2
  341. package/src/sap/ui/model/type/Currency.js +2 -2
  342. package/src/sap/ui/model/type/Date.js +9 -3
  343. package/src/sap/ui/model/type/DateInterval.js +4 -2
  344. package/src/sap/ui/model/type/DateTime.js +2 -2
  345. package/src/sap/ui/model/type/DateTimeInterval.js +2 -2
  346. package/src/sap/ui/model/type/FileSize.js +4 -2
  347. package/src/sap/ui/model/type/Float.js +4 -2
  348. package/src/sap/ui/model/type/Integer.js +4 -2
  349. package/src/sap/ui/model/type/String.js +2 -2
  350. package/src/sap/ui/model/type/Time.js +2 -2
  351. package/src/sap/ui/model/type/TimeInterval.js +2 -2
  352. package/src/sap/ui/model/type/Unit.js +14 -7
  353. package/src/sap/ui/model/xml/XMLListBinding.js +15 -9
  354. package/src/sap/ui/model/xml/XMLModel.js +74 -45
  355. package/src/sap/ui/model/xml/XMLPropertyBinding.js +5 -5
  356. package/src/sap/ui/model/xml/XMLTreeBinding.js +5 -4
  357. package/src/sap/ui/performance/trace/Interaction.js +30 -15
  358. package/src/sap/ui/qunit/QUnitUtils.js +3 -2
  359. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  360. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +9 -11
  361. package/src/sap/ui/test/TestUtils.js +11 -4
  362. package/src/sap/ui/test/actions/Action.js +9 -2
  363. package/src/sap/ui/test/actions/Press.js +28 -1
  364. package/src/sap/ui/test/generic/_EnforceSemanticRendering.js +111 -0
  365. package/src/sap/ui/test/matchers/I18NText.js +29 -11
  366. package/src/sap/ui/test/opaQunit.js +5 -0
  367. package/src/sap/ui/thirdparty/IPv6.js +2 -2
  368. package/src/sap/ui/thirdparty/SecondLevelDomains.js +2 -2
  369. package/src/sap/ui/thirdparty/URI.js +14 -5
  370. package/src/sap/ui/thirdparty/URITemplate.js +2 -2
  371. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly.js +1196 -0
  372. package/src/sap/ui/thirdparty/hyphenopoly/Hyphenopoly_Loader.js +797 -0
  373. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.asm.js +108 -127
  374. package/src/sap/ui/thirdparty/hyphenopoly/hyphenEngine.wasm +0 -0
  375. package/src/sap/ui/thirdparty/hyphenopoly/patterns/bg.hpb +0 -0
  376. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ca.hpb +0 -0
  377. package/src/sap/ui/thirdparty/hyphenopoly/patterns/da.hpb +0 -0
  378. package/src/sap/ui/thirdparty/hyphenopoly/patterns/de.hpb +0 -0
  379. package/src/sap/ui/thirdparty/hyphenopoly/patterns/el-monoton.hpb +0 -0
  380. package/src/sap/ui/thirdparty/hyphenopoly/patterns/en-us.hpb +0 -0
  381. package/src/sap/ui/thirdparty/hyphenopoly/patterns/es.hpb +0 -0
  382. package/src/sap/ui/thirdparty/hyphenopoly/patterns/et.hpb +0 -0
  383. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fi.hpb +0 -0
  384. package/src/sap/ui/thirdparty/hyphenopoly/patterns/fr.hpb +0 -0
  385. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hi.hpb +0 -0
  386. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hr.hpb +0 -0
  387. package/src/sap/ui/thirdparty/hyphenopoly/patterns/hu.hpb +0 -0
  388. package/src/sap/ui/thirdparty/hyphenopoly/patterns/it.hpb +0 -0
  389. package/src/sap/ui/thirdparty/hyphenopoly/patterns/lt.hpb +0 -0
  390. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nb-no.hpb +0 -0
  391. package/src/sap/ui/thirdparty/hyphenopoly/patterns/nl.hpb +0 -0
  392. package/src/sap/ui/thirdparty/hyphenopoly/patterns/pt.hpb +0 -0
  393. package/src/sap/ui/thirdparty/hyphenopoly/patterns/ru.hpb +0 -0
  394. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sl.hpb +0 -0
  395. package/src/sap/ui/thirdparty/hyphenopoly/patterns/sv.hpb +0 -0
  396. package/src/sap/ui/thirdparty/hyphenopoly/patterns/th.hpb +0 -0
  397. package/src/sap/ui/thirdparty/hyphenopoly/patterns/tr.hpb +0 -0
  398. package/src/sap/ui/thirdparty/hyphenopoly/patterns/uk.hpb +0 -0
  399. package/src/sap/ui/thirdparty/jquery.js +9 -1
  400. package/src/sap/ui/thirdparty/qunit-2.js +1 -1
  401. package/src/sap/ui/thirdparty/qunit.js +1 -1
  402. package/src/sap/ui/util/Mobile.js +30 -59
  403. package/src/sap/ui/util/Storage.js +1 -1
  404. package/src/sap/ui/util/isCrossOriginURL.js +16 -6
  405. package/src/ui5loader.js +6 -6
  406. package/ui5.yaml +248 -2
  407. package/src/sap/ui/core/CustomizingConfiguration.js +0 -272
  408. package/src/sap/ui/core/support/plugins/MessageTest.js +0 -96
  409. package/src/sap/ui/thirdparty/baseuri.js +0 -1
  410. package/src/sap/ui/thirdparty/es6-object-assign.js +0 -1
  411. package/src/sap/ui/thirdparty/es6-promise.js +0 -1
  412. package/src/sap/ui/thirdparty/es6-shim-nopromise.js +0 -1
  413. package/src/sap/ui/thirdparty/es6-string-methods.js +0 -1
  414. package/src/sap/ui/thirdparty/flexie.js +0 -1
  415. package/src/sap/ui/thirdparty/hyphenopoly/hyphenopoly.bundle.js +0 -860
  416. package/src/sap/ui/thirdparty/unorm.js +0 -1
  417. package/src/sap/ui/thirdparty/unormdata.js +0 -1
@@ -21,6 +21,7 @@ sap.ui.define([
21
21
  // EMPLOYEE($uid=id-1550828854217-16) -> aMatches[0] === "($uid=id-1550828854217-16)"
22
22
  // @see sap.base.util.uid
23
23
  rEndsWithTransientPredicate = /\(\$uid=[-\w]+\)$/,
24
+ rInactive = /^\$inactive\./,
24
25
  sMessagesAnnotation = "@com.sap.vocabularies.Common.v1.Messages",
25
26
  rNumber = /^-?\d+$/,
26
27
  // Matches two cases: segment with predicate or simply predicate:
@@ -140,6 +141,10 @@ sap.ui.define([
140
141
  * An entity with the ETag of the binding for which the deletion was requested. This is
141
142
  * provided if the deletion is delegated from a context binding with empty path to a list
142
143
  * binding.
144
+ * @param {boolean} [bDoNotRequestCount]
145
+ * Whether not to request the new count from the server; useful in case of
146
+ * {@link sap.ui.model.odata.v4.Context#replaceWith} where it is known that the count remains
147
+ * unchanged
143
148
  * @param {function} fnCallback
144
149
  * A function which is called after a transient entity has been deleted from the cache or
145
150
  * after the entity has been deleted from the server and from the cache; the index of the
@@ -150,7 +155,8 @@ sap.ui.define([
150
155
  *
151
156
  * @public
152
157
  */
153
- _Cache.prototype._delete = function (oGroupLock, sEditUrl, sPath, oETagEntity, fnCallback) {
158
+ _Cache.prototype._delete = function (oGroupLock, sEditUrl, sPath, oETagEntity,
159
+ bDoNotRequestCount, fnCallback) {
154
160
  var aSegments = sPath.split("/"),
155
161
  vDeleteProperty = aSegments.pop(),
156
162
  iIndex = rNumber.test(vDeleteProperty) ? Number(vDeleteProperty) : undefined,
@@ -214,6 +220,7 @@ sap.ui.define([
214
220
  [], [sEntityPath]);
215
221
  }),
216
222
  iIndex === undefined // single element or kept-alive not in list
223
+ && !bDoNotRequestCount
217
224
  && that.requestCount(oGroupLock),
218
225
  oGroupLock.unlock() // unlock when all requests have been queued
219
226
  ]);
@@ -395,6 +402,7 @@ sap.ui.define([
395
402
  if (that.fetchTypes().isRejected()) {
396
403
  throw oError;
397
404
  }
405
+ sPostGroupId = sPostGroupId.replace(rInactive, "");
398
406
  return request(sPostPath, that.oRequestor.lockGroup(
399
407
  that.oRequestor.getGroupSubmitMode(sPostGroupId) === "API" ?
400
408
  sPostGroupId : "$parked." + sPostGroupId, that, true, true));
@@ -599,7 +607,7 @@ sap.ui.define([
599
607
  vValue = vValue[vIndex];
600
608
  }
601
609
  // missing advertisement or annotation is not an error
602
- return vValue === undefined && sSegment[0] !== "#" && sSegment[0] !== "@"
610
+ return vValue === undefined && sSegment[0] !== "#" && !sSegment.includes("@")
603
611
  ? missingValue(oParentValue, sSegment, i + 1)
604
612
  : vValue;
605
613
  });
@@ -989,14 +997,23 @@ sap.ui.define([
989
997
  *
990
998
  * @param {string} sPath
991
999
  * The relative path of a binding; must not end with '/'
1000
+ * @param {boolean} [bIgnoreKeptAlive]
1001
+ * Whether to ignore changes which will not be lost by APIs like sort or filter because they
1002
+ * relate to a context which is kept alive.
992
1003
  * @returns {boolean}
993
1004
  * <code>true</code> if there are pending changes
994
1005
  *
995
1006
  * @public
996
1007
  */
997
- _Cache.prototype.hasPendingChangesForPath = function (sPath) {
1008
+ _Cache.prototype.hasPendingChangesForPath = function (sPath, bIgnoreKeptAlive) {
1009
+ var that = this;
1010
+
998
1011
  return Object.keys(this.mPatchRequests).some(function (sRequestPath) {
999
- return isSubPath(sRequestPath, sPath);
1012
+ return isSubPath(sRequestPath, sPath)
1013
+ && !(bIgnoreKeptAlive
1014
+ && that.mPatchRequests[sRequestPath].every(function (oPatchPromise) {
1015
+ return oPatchPromise.$isKeepAlive();
1016
+ }));
1000
1017
  }) || Object.keys(this.mPostRequests).some(function (sRequestPath) {
1001
1018
  return isSubPath(sRequestPath, sPath);
1002
1019
  });
@@ -1617,9 +1634,11 @@ sap.ui.define([
1617
1634
  * Path of the unit or currency for the property, relative to the entity
1618
1635
  * @param {boolean} [bPatchWithoutSideEffects]
1619
1636
  * Whether the PATCH response is ignored, except for a new ETag
1620
- * @param {function} [fnPatchSent]
1637
+ * @param {function} fnPatchSent
1621
1638
  * The function is called just before a back-end request is sent for the first time.
1622
1639
  * If no back-end request is needed, the function is not called.
1640
+ * @param {function} fnIsKeepAlive
1641
+ * A function to tell whether the entity is kept-alive
1623
1642
  * @returns {Promise}
1624
1643
  * A promise for the PATCH request (resolves with <code>undefined</code>); rejected in case of
1625
1644
  * cancellation or if no <code>fnErrorCallback</code> is given
@@ -1628,7 +1647,8 @@ sap.ui.define([
1628
1647
  * @public
1629
1648
  */
1630
1649
  _Cache.prototype.update = function (oGroupLock, sPropertyPath, vValue, fnErrorCallback,
1631
- sEditUrl, sEntityPath, sUnitOrCurrencyPath, bPatchWithoutSideEffects, fnPatchSent) {
1650
+ sEditUrl, sEntityPath, sUnitOrCurrencyPath, bPatchWithoutSideEffects, fnPatchSent,
1651
+ fnIsKeepAlive) {
1632
1652
  var oPromise,
1633
1653
  aPropertyPath = sPropertyPath.split("/"),
1634
1654
  aUnitOrCurrencyPath,
@@ -1639,11 +1659,13 @@ sap.ui.define([
1639
1659
  try {
1640
1660
  oPromise = this.fetchValue(_GroupLock.$cached, sEntityPath);
1641
1661
  } catch (oError) {
1642
- if (!oError.$cached) {
1662
+ if (!oError.$cached || this.oPromise !== null) {
1643
1663
  throw oError;
1644
1664
  }
1645
- // Note: we need a unique "entity" instance to avoid merging of PATCH requests!
1646
- oPromise = SyncPromise.resolve({"@odata.etag" : "*"});
1665
+ // data has not been read, fake it
1666
+ // Note: we need a unique "entity" instance to avoid merging of unrelated PATCH requests
1667
+ // and sharing of data across bindings - the instance is modified below!
1668
+ oPromise = this.oPromise = SyncPromise.resolve({"@odata.etag" : "*"});
1647
1669
  }
1648
1670
 
1649
1671
  return oPromise.then(function (oEntity) {
@@ -1679,9 +1701,7 @@ sap.ui.define([
1679
1701
  */
1680
1702
  function onSubmit() {
1681
1703
  oRequestLock = that.oRequestor.lockGroup(sGroupId, that, true);
1682
- if (fnPatchSent) {
1683
- fnPatchSent();
1684
- }
1704
+ fnPatchSent();
1685
1705
  }
1686
1706
 
1687
1707
  if (bPatchWithoutSideEffects) {
@@ -1691,6 +1711,7 @@ sap.ui.define([
1691
1711
  mHeaders, oUpdateData, onSubmit, onCancel, /*sMetaPath*/undefined,
1692
1712
  _Helper.buildPath(that.getOriginalResourcePath(oEntity), sEntityPath),
1693
1713
  bAtFront);
1714
+ oPatchPromise.$isKeepAlive = fnIsKeepAlive;
1694
1715
  _Helper.addByPath(that.mPatchRequests, sFullPath, oPatchPromise);
1695
1716
  return SyncPromise.all([
1696
1717
  oPatchPromise,
@@ -1761,9 +1782,10 @@ sap.ui.define([
1761
1782
  if (sTransientGroup === true) {
1762
1783
  throw new Error("No 'update' allowed while waiting for server response");
1763
1784
  }
1764
- if (sTransientGroup.startsWith("$parked.")) {
1785
+ if (sTransientGroup.startsWith("$parked.")
1786
+ || sTransientGroup.startsWith("$inactive.")) {
1765
1787
  sParkedGroup = sTransientGroup;
1766
- sTransientGroup = sTransientGroup.slice(8);
1788
+ sTransientGroup = sTransientGroup.slice(sTransientGroup.indexOf(".") + 1);
1767
1789
  }
1768
1790
  if (sTransientGroup !== sGroupId) {
1769
1791
  throw new Error("The entity will be created via group '" + sTransientGroup
@@ -2073,6 +2095,19 @@ sap.ui.define([
2073
2095
  });
2074
2096
  };
2075
2097
 
2098
+ /**
2099
+ * Replaces the old element at the given index with the given new element.
2100
+ *
2101
+ * @param {number} iIndex - The index
2102
+ * @param {object} oElement - The new element
2103
+ *
2104
+ * @public
2105
+ */
2106
+ _CollectionCache.prototype.doReplaceWith = function (iIndex, oElement) {
2107
+ this.aElements[iIndex] = oElement;
2108
+ this.addKeptElement(oElement); // maintain $byPredicate
2109
+ };
2110
+
2076
2111
  /**
2077
2112
  * Returns a promise to be resolved (synchronously if possible) with an OData object for the
2078
2113
  * requested data.
@@ -2303,6 +2338,7 @@ sap.ui.define([
2303
2338
  oKeptElement = this.aElements.$byPredicate[sPredicate];
2304
2339
  if (oKeptElement) {
2305
2340
  if (oElement["@odata.etag"] === oKeptElement["@odata.etag"]) {
2341
+ _Helper.updateNonExisting(oKeptElement, oElement);
2306
2342
  oElement = oKeptElement;
2307
2343
  } else if (this.hasPendingChangesForPath(sPredicate)) {
2308
2344
  throw new Error("Modified on client and on server: "
@@ -2456,7 +2492,9 @@ sap.ui.define([
2456
2492
  var aKeyFilters,
2457
2493
  mQueryOptions = _Helper.merge({}, that.mQueryOptions);
2458
2494
 
2459
- _Helper.aggregateExpandSelect(mQueryOptions, that.mLateQueryOptions);
2495
+ if (that.mLateQueryOptions) {
2496
+ _Helper.aggregateExpandSelect(mQueryOptions, that.mLateQueryOptions);
2497
+ }
2460
2498
  delete mQueryOptions.$count;
2461
2499
  delete mQueryOptions.$orderby;
2462
2500
  delete mQueryOptions.$search;
@@ -2588,6 +2626,7 @@ sap.ui.define([
2588
2626
  mQueryOptions,
2589
2627
  mPredicates = {}, // a set of the predicates (as map to true) to speed up the search
2590
2628
  sResourcePath,
2629
+ bSkip,
2591
2630
  mTypeForMetaPath = this.fetchTypes().getResult(),
2592
2631
  that = this;
2593
2632
 
@@ -2662,8 +2701,15 @@ sap.ui.define([
2662
2701
  + this.oRequestor.buildQueryString(this.sMetaPath, mQueryOptions, false, true);
2663
2702
 
2664
2703
  return this.oRequestor.request("GET", sResourcePath, oGroupLock, undefined, undefined,
2665
- undefined, undefined, this.sMetaPath, undefined, false, mMergeableQueryOptions
2666
- ).then(function (oResult) {
2704
+ undefined, undefined, this.sMetaPath, undefined, false, mMergeableQueryOptions,
2705
+ function (aOtherPaths) {
2706
+ if (arguments.length) {
2707
+ aPaths = aPaths.concat(aOtherPaths);
2708
+ } else {
2709
+ bSkip = true; // my GET was merged
2710
+ return aPaths;
2711
+ }
2712
+ }).then(function (oResult) {
2667
2713
  var oElement, sPredicate, i, n;
2668
2714
 
2669
2715
  function preventKeyPredicateChange(sPath) {
@@ -2674,6 +2720,10 @@ sap.ui.define([
2674
2720
  });
2675
2721
  }
2676
2722
 
2723
+ if (bSkip) {
2724
+ return;
2725
+ }
2726
+
2677
2727
  if (oResult.value.length !== aElements.length) {
2678
2728
  throw new Error("Expected " + aElements.length + " row(s), but instead saw "
2679
2729
  + oResult.value.length);
@@ -2691,6 +2741,38 @@ sap.ui.define([
2691
2741
  });
2692
2742
  };
2693
2743
 
2744
+ /**
2745
+ * Resets this cache to its initial state, but keeps certain elements and their change listeners
2746
+ * alive.
2747
+ *
2748
+ * @param {string[]} aKeptElementPredicates
2749
+ * The key predicates for all kept-alive elements
2750
+ *
2751
+ * @public
2752
+ */
2753
+ _CollectionCache.prototype.reset = function (aKeptElementPredicates) {
2754
+ var mChangeListeners = this.mChangeListeners,
2755
+ mByPredicate = this.aElements.$byPredicate,
2756
+ that = this;
2757
+
2758
+ this.mChangeListeners = {};
2759
+ this.sContext = undefined;
2760
+ this.aElements = [];
2761
+ this.aElements.$byPredicate = {};
2762
+ this.aElements.$count = undefined; // needed for setCount()
2763
+ this.aElements.$created = 0;
2764
+ this.iLimit = Infinity;
2765
+
2766
+ Object.keys(mChangeListeners).forEach(function (sPath) {
2767
+ if (aKeptElementPredicates.includes(sPath.split("/")[0])) {
2768
+ that.mChangeListeners[sPath] = mChangeListeners[sPath];
2769
+ }
2770
+ });
2771
+ aKeptElementPredicates.forEach(function (sPredicate) {
2772
+ that.aElements.$byPredicate[sPredicate] = mByPredicate[sPredicate];
2773
+ });
2774
+ };
2775
+
2694
2776
  //*********************************************************************************************
2695
2777
  // PropertyCache
2696
2778
  //*********************************************************************************************
@@ -2884,8 +2966,8 @@ sap.ui.define([
2884
2966
  if (this.bPost) {
2885
2967
  throw new Error("Cannot fetch a value before the POST request");
2886
2968
  }
2887
- this.bSentRequest = true;
2888
2969
  this.oPromise = SyncPromise.all([
2970
+ // Note: for _GroupLock.$cached, this may fail synchronously
2889
2971
  this.oRequestor.request("GET", sResourcePath, oGroupLock, undefined, undefined,
2890
2972
  fnDataRequested, undefined, this.sMetaPath),
2891
2973
  this.fetchTypes()
@@ -2893,6 +2975,7 @@ sap.ui.define([
2893
2975
  that.visitResponse(aResult[0], aResult[1]);
2894
2976
  return aResult[0];
2895
2977
  });
2978
+ this.bSentRequest = true;
2896
2979
  }
2897
2980
  return this.oPromise.then(function (oResult) {
2898
2981
  if (oResult && oResult["$ui5.deleted"]) {
@@ -3054,6 +3137,7 @@ sap.ui.define([
3054
3137
  oOldValuePromise = this.oPromise,
3055
3138
  mQueryOptions,
3056
3139
  oResult,
3140
+ bSkip,
3057
3141
  that = this;
3058
3142
 
3059
3143
  this.checkSharedRequest();
@@ -3071,7 +3155,15 @@ sap.ui.define([
3071
3155
  + this.oRequestor.buildQueryString(this.sMetaPath, mQueryOptions, false, true);
3072
3156
  oResult = SyncPromise.all([
3073
3157
  this.oRequestor.request("GET", sResourcePath, oGroupLock, undefined, undefined,
3074
- undefined, undefined, this.sMetaPath, undefined, false, mMergeableQueryOptions),
3158
+ undefined, undefined, this.sMetaPath, undefined, false, mMergeableQueryOptions,
3159
+ function (aOtherPaths) {
3160
+ if (arguments.length) {
3161
+ aPaths = aPaths.concat(aOtherPaths);
3162
+ } else {
3163
+ bSkip = true; // my GET was merged
3164
+ return aPaths;
3165
+ }
3166
+ }),
3075
3167
  this.fetchTypes(),
3076
3168
  this.fetchValue(_GroupLock.$cached, "") // Note: includes some additional checks
3077
3169
  ]).then(function (aResult) {
@@ -3082,6 +3174,10 @@ sap.ui.define([
3082
3174
  var oNewValue = aResult[0],
3083
3175
  oOldValue = aResult[2];
3084
3176
 
3177
+ if (bSkip) {
3178
+ return;
3179
+ }
3180
+
3085
3181
  // ensure that the new value has a predicate although key properties were not requested
3086
3182
  _Helper.setPrivateAnnotation(oNewValue, "predicate",
3087
3183
  _Helper.getPrivateAnnotation(oOldValue, "predicate"));
@@ -1845,7 +1845,7 @@ sap.ui.define([
1845
1845
  /**
1846
1846
  * Converts given value to an array.
1847
1847
  * <code>null</code> and <code>undefined</code> are converted to the empty array, a
1848
- * non-array value is wrapped with an array and an array is returned as it is.
1848
+ * non-array value is wrapped with an array and an array is returned as a shallow copy.
1849
1849
  *
1850
1850
  * @param {any} [vElement]
1851
1851
  * The element to be converted into an array.
@@ -1857,7 +1857,7 @@ sap.ui.define([
1857
1857
  return [];
1858
1858
  }
1859
1859
  if (Array.isArray(vElement)) {
1860
- return vElement;
1860
+ return vElement.slice();
1861
1861
  }
1862
1862
  return [vElement];
1863
1863
  },
@@ -1874,7 +1874,7 @@ sap.ui.define([
1874
1874
  * properties therein.
1875
1875
  *
1876
1876
  * Restrictions:
1877
- * - oTarget and oSource are expected to have the same structure; when there is an
1877
+ * - oTarget and oSource are expected to have the same structure: when there is an
1878
1878
  * object at a given path in either of them, the other one must have an object or
1879
1879
  * <code>null</code>.
1880
1880
  * - no change events for collection-valued properties; list bindings without own cache must
@@ -1937,7 +1937,7 @@ sap.ui.define([
1937
1937
  * advertised actions.
1938
1938
  *
1939
1939
  * Restrictions:
1940
- * - oOldObject and oNewObject are expected to have the same structure; when there is an
1940
+ * - oOldObject and oNewObject are expected to have the same structure: when there is an
1941
1941
  * object at a given path in either of them, the other one must have an object or
1942
1942
  * <code>null</code>.
1943
1943
  * - no change events for collection-valued properties
@@ -2004,6 +2004,36 @@ sap.ui.define([
2004
2004
  });
2005
2005
  },
2006
2006
 
2007
+ /**
2008
+ * Recursively adds all properties of oSource to oTarget that do not exist there yet.
2009
+ * Ensures that object references in oTarget remain unchanged.
2010
+ *
2011
+ * Restrictions:
2012
+ * - oTarget and oSource are expected to have the same structure: when there is an
2013
+ * object at a given path in either of them, the other one must have an object.
2014
+ * <code>null</code>, or no property at all.
2015
+ * - arrays are not merged in any way, they are taken either from oSource or from oTarget
2016
+ *
2017
+ * @param {object} oTarget - The target
2018
+ * @param {object} oSource - The source
2019
+ */
2020
+ updateNonExisting : function (oTarget, oSource) {
2021
+ Object.keys(oSource).forEach(function (sKey) {
2022
+ var vSourceValue = oSource[sKey],
2023
+ vTargetValue;
2024
+
2025
+ if (sKey in oTarget) {
2026
+ vTargetValue = oTarget[sKey];
2027
+ if (vSourceValue && vTargetValue
2028
+ && typeof vSourceValue === "object" && !Array.isArray(vSourceValue)) {
2029
+ _Helper.updateNonExisting(vTargetValue, vSourceValue);
2030
+ }
2031
+ } else {
2032
+ oTarget[sKey] = vSourceValue;
2033
+ }
2034
+ });
2035
+ },
2036
+
2007
2037
  /**
2008
2038
  * Updates the old value with the given new value for the selected properties (see
2009
2039
  * {@link #updateExisting}). If no selected properties are given or if "*" is contained in
@@ -2011,7 +2041,7 @@ sap.ui.define([
2011
2041
  * changed properties.
2012
2042
  *
2013
2043
  * Restrictions:
2014
- * - oOldValue and oNewValue are expected to have the same structure; when there is an
2044
+ * - oOldValue and oNewValue are expected to have the same structure: when there is an
2015
2045
  * object at a given path in either of them, the other one must have an object or
2016
2046
  * <code>null</code>.
2017
2047
  * - "*" in aSelect does not work correctly if oNewValue contains navigation properties
@@ -88,10 +88,11 @@ sap.ui.define([
88
88
  this.oModelInterface = oModelInterface;
89
89
  this.sQueryParams = _Helper.buildQuery(mQueryParams); // Used for $batch and CSRF token only
90
90
  this.mRunningChangeRequests = {}; // map from group ID to a SyncPromise[]
91
- this.oSecurityTokenPromise = null; // be nice to Chrome v8
92
91
  this.iSessionTimer = 0;
93
92
  this.iSerialNumber = 0;
94
93
  this.sServiceUrl = sServiceUrl;
94
+ this.vStatistics = mQueryParams && mQueryParams["sap-statistics"];
95
+ this.processSecurityTokenHandlers(); // sets this.oSecurityTokenPromise
95
96
  }
96
97
 
97
98
  /**
@@ -1061,7 +1062,7 @@ sap.ui.define([
1061
1062
  * Merges all GET requests that are marked as mergeable, have the same resource path and the
1062
1063
  * same query options besides $expand and $select. One request with the merged $expand and
1063
1064
  * $select is left in the queue and all merged requests get the response of this one remaining
1064
- * request.
1065
+ * request. For $mergeRequests, see parameter fnMergeRequests of {@link #request}.
1065
1066
  *
1066
1067
  * @param {object[]} aRequests The batch queue
1067
1068
  * @returns {object[]} The adjusted batch queue
@@ -1075,6 +1076,9 @@ sap.ui.define([
1075
1076
  if (oCandidate.$queryOptions && oRequest.url === oCandidate.url) {
1076
1077
  _Helper.aggregateExpandSelect(oCandidate.$queryOptions, oRequest.$queryOptions);
1077
1078
  oRequest.$resolve(oCandidate.$promise);
1079
+ if (oCandidate.$mergeRequests && oRequest.$mergeRequests) {
1080
+ oCandidate.$mergeRequests(oRequest.$mergeRequests());
1081
+ }
1078
1082
 
1079
1083
  return true;
1080
1084
  }
@@ -1287,6 +1291,38 @@ sap.ui.define([
1287
1291
  return oGroupLock;
1288
1292
  };
1289
1293
 
1294
+ /**
1295
+ * Calls the security token handlers returned by
1296
+ * {@link sap.ui.core.Configuration#getSecurityTokenHandlers} one by one with the requestor's
1297
+ * service URL. The first handler not returning <code>undefined</code> but a
1298
+ * <code>Promise</code> is used to determine the required security tokens.
1299
+ *
1300
+ * @private
1301
+ */
1302
+ _Requestor.prototype.processSecurityTokenHandlers = function () {
1303
+ var that = this;
1304
+
1305
+ this.oSecurityTokenPromise = null;
1306
+
1307
+ sap.ui.getCore().getConfiguration().getSecurityTokenHandlers().some(function (fnHandler) {
1308
+ var oSecurityTokenPromise = fnHandler(that.sServiceUrl);
1309
+
1310
+ if (oSecurityTokenPromise !== undefined) {
1311
+ that.oSecurityTokenPromise = oSecurityTokenPromise.then(function (mHeaders) {
1312
+ that.checkHeaderNames(mHeaders);
1313
+ // also overwrite this.mPredefinedRequestHeaders["X-CSRF-Token"] : "Fetch"
1314
+ Object.assign(that.mHeaders, {"X-CSRF-Token" : undefined}, mHeaders);
1315
+ that.oSecurityTokenPromise = null;
1316
+ }).catch(function (oError) {
1317
+ Log.error("An error occurred within security token handler: " + fnHandler,
1318
+ oError, sClassName);
1319
+ throw oError;
1320
+ });
1321
+ return true;
1322
+ }
1323
+ });
1324
+ };
1325
+
1290
1326
  /**
1291
1327
  * Returns a promise that will be resolved once the CSRF token has been refreshed, or rejected
1292
1328
  * if that fails. Makes sure that only one HEAD request is underway at any given time and
@@ -1512,6 +1548,10 @@ sap.ui.define([
1512
1548
  * Query options if it is allowed to merge this request with another request having the same
1513
1549
  * sResourcePath (only allowed for GET requests); the resulting resource path is the path from
1514
1550
  * sResourcePath plus the merged query options; may only contain $expand and $select
1551
+ * @param {function(string[]):string[]} [fnMergeRequests]
1552
+ * Function which is called during merging of GET requests. If a merged request has a
1553
+ * function given, this function will be called and its return value is
1554
+ * given to the one remaining request's function as a parameter.
1515
1555
  * @returns {Promise}
1516
1556
  * A promise on the outcome of the HTTP request; it will be rejected with an error having the
1517
1557
  * property <code>canceled = true</code> instead of sending a request if
@@ -1522,7 +1562,8 @@ sap.ui.define([
1522
1562
  * @public
1523
1563
  */
1524
1564
  _Requestor.prototype.request = function (sMethod, sResourcePath, oGroupLock, mHeaders, oPayload,
1525
- fnSubmit, fnCancel, sMetaPath, sOriginalResourcePath, bAtFront, mQueryOptions) {
1565
+ fnSubmit, fnCancel, sMetaPath, sOriginalResourcePath, bAtFront, mQueryOptions,
1566
+ fnMergeRequests) {
1526
1567
  var iChangeSetNo,
1527
1568
  oError,
1528
1569
  sGroupId = oGroupLock && oGroupLock.getGroupId() || "$direct",
@@ -1566,6 +1607,7 @@ sap.ui.define([
1566
1607
  that.mFinalHeaders),
1567
1608
  body : oPayload,
1568
1609
  $cancel : fnCancel,
1610
+ $mergeRequests : fnMergeRequests,
1569
1611
  $metaPath : sMetaPath,
1570
1612
  $queryOptions : mQueryOptions,
1571
1613
  $reject : fnReject,
@@ -1591,6 +1633,9 @@ sap.ui.define([
1591
1633
  return oPromise;
1592
1634
  }
1593
1635
 
1636
+ if (this.vStatistics !== undefined) {
1637
+ mQueryOptions = Object.assign({"sap-statistics" : this.vStatistics}, mQueryOptions);
1638
+ }
1594
1639
  if (mQueryOptions) {
1595
1640
  sResourcePath = that.addQueryString(sResourcePath, sMetaPath, mQueryOptions);
1596
1641
  }
@@ -1697,7 +1742,7 @@ sap.ui.define([
1697
1742
  // methods it must be possible to insert the ETag from the header
1698
1743
  vResponse = sMethod === "GET" ? null : {};
1699
1744
  }
1700
- if (sETag) {
1745
+ if (sETag && typeof vResponse === "object") {
1701
1746
  vResponse["@odata.etag"] = sETag;
1702
1747
  }
1703
1748
 
@@ -1914,4 +1959,4 @@ sap.ui.define([
1914
1959
  };
1915
1960
 
1916
1961
  return _Requestor;
1917
- }, /* bExport= */false);
1962
+ }, /* bExport= */false);
@@ -3,6 +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
+ /*eslint-disable max-len */
6
7
  /**
7
8
  * ResourceBundle-based DataBinding
8
9
  *
@@ -204,7 +205,10 @@ sap.ui.define([
204
205
  *
205
206
  * @alias sap.ui.model.resource.ResourceModel
206
207
  * @author SAP SE
207
- * @class Model implementation for resource bundles.
208
+ * @class
209
+ * Model implementation for resource bundles.
210
+ *
211
+ * This model is not prepared to be inherited from.
208
212
  *
209
213
  * This model allows to bind control properties against translatable texts. Its data is taken
210
214
  * from a {@link module:sap/base/i18n/ResourceBundle} and it only supports property bindings.
@@ -224,7 +228,7 @@ sap.ui.define([
224
228
  *
225
229
  * @extends sap.ui.model.Model
226
230
  * @public
227
- * @version 1.94.0
231
+ * @version 1.97.0
228
232
  */
229
233
  var ResourceModel = Model.extend("sap.ui.model.resource.ResourceModel", /** @lends sap.ui.model.resource.ResourceModel.prototype */ {
230
234
 
@@ -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
  // Provides the resource model implementation of a property binding
8
8
  sap.ui.define(['sap/ui/model/PropertyBinding', 'sap/ui/model/ChangeReason'],
9
9
  function(PropertyBinding, ChangeReason) {
@@ -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
  // Provides the base implementation for all model implementations
8
8
  sap.ui.define(['sap/ui/model/SimpleType', 'sap/ui/model/FormatException', 'sap/ui/model/ParseException'],
9
9
  function(SimpleType, FormatException, ParseException) {
@@ -19,7 +19,7 @@ sap.ui.define(['sap/ui/model/SimpleType', 'sap/ui/model/FormatException', 'sap/u
19
19
  * @extends sap.ui.model.SimpleType
20
20
  *
21
21
  * @author SAP SE
22
- * @version 1.94.0
22
+ * @version 1.97.0
23
23
  *
24
24
  * @public
25
25
  * @param {object} [oFormatOptions]
@@ -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
  // Provides the base implementation for all model implementations
8
8
  sap.ui.define([
9
9
  "sap/base/Log",
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @extends sap.ui.model.CompositeType
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.94.0
35
+ * @version 1.97.0
36
36
  *
37
37
  * @public
38
38
  * @param {object} [oFormatOptions]
@@ -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
  // Provides the base implementation for all model implementations
8
8
  sap.ui.define([
9
9
  "sap/base/util/each",
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.ui.model.SimpleType
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.94.0
29
+ * @version 1.97.0
30
30
  *
31
31
  * @public
32
32
  * @param {object} [oFormatOptions] Formatting options. For a list of all available options, see {@link sap.ui.core.format.DateFormat.getDateInstance DateFormat}.
@@ -80,7 +80,7 @@ sap.ui.define([
80
80
  if (oValue === "") {
81
81
  return null;
82
82
  }
83
- var oResult = this.oOutputFormat.parse(oValue);
83
+ oResult = this.oOutputFormat.parse(oValue);
84
84
  if (!oResult) {
85
85
  oBundle = sap.ui.getCore().getLibraryResourceBundle();
86
86
  throw new ParseException(oBundle.getText(this.sName + ".Invalid"));
@@ -131,6 +131,7 @@ sap.ui.define([
131
131
  aMessages.push(oBundle.getText(that.sName + ".Maximum", [sContent]));
132
132
  }
133
133
  break;
134
+ default: break;
134
135
  }
135
136
  });
136
137
  if (aViolatedConstraints.length > 0) {
@@ -176,6 +177,11 @@ sap.ui.define([
176
177
  };
177
178
 
178
179
  /**
180
+ * Returns the output pattern.
181
+ *
182
+ * @returns {string} The output pattern
183
+ *
184
+ * @see sap.ui.core.format.DateFormat.getDateInstance
179
185
  * @protected
180
186
  */
181
187
  Date1.prototype.getOutputPattern = function() {
@@ -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
  sap.ui.define([
9
9
  'sap/ui/core/format/DateFormat',
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.ui.model.CompositeType
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.94.0
36
+ * @version 1.97.0
37
37
  *
38
38
  * @public
39
39
  * @param {object} [oFormatOptions] Formatting options. For a list of all available options, see {@link sap.ui.core.format.DateFormat.getDateInstance DateFormat}.
@@ -216,6 +216,8 @@ sap.ui.define([
216
216
  aViolatedConstraints.push("maximum");
217
217
  aMessages.push(oBundle.getText("Date.Maximum", [oCompareValue]));
218
218
  }
219
+ break;
220
+ default: break;
219
221
  }
220
222
  }.bind(this));
221
223
 
@@ -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
  // Provides the base implementation for all model implementations
8
8
  sap.ui.define(['./Date', 'sap/ui/core/format/DateFormat'],
9
9
  function(Date, DateFormat) {
@@ -19,7 +19,7 @@ sap.ui.define(['./Date', 'sap/ui/core/format/DateFormat'],
19
19
  * @extends sap.ui.model.type.Date
20
20
  *
21
21
  * @author SAP SE
22
- * @version 1.94.0
22
+ * @version 1.97.0
23
23
  *
24
24
  * @public
25
25
  * @param {object} [oFormatOptions] Formatting options. For a list of all available options, see {@link sap.ui.core.format.DateFormat.getDateTimeInstance DateFormat}.