@openui5/sap.ui.core 1.136.2 → 1.138.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 (320) hide show
  1. package/.eslintrc.json +3 -3
  2. package/REUSE.toml +0 -28
  3. package/THIRDPARTY.txt +0 -24
  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 +1 -1
  8. package/src/jquery.sap.script.js +1 -1
  9. package/src/jquery.sap.storage.js +3 -3
  10. package/src/sap/base/Event.js +1 -1
  11. package/src/sap/base/Eventing.js +1 -1
  12. package/src/sap/base/config.js +1 -1
  13. package/src/sap/base/i18n/LanguageTag.js +1 -1
  14. package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
  15. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  16. package/src/sap/base/util/restricted/_castArray.js +1 -1
  17. package/src/sap/base/util/restricted/_compact.js +1 -1
  18. package/src/sap/base/util/restricted/_curry.js +1 -1
  19. package/src/sap/base/util/restricted/_debounce.js +1 -1
  20. package/src/sap/base/util/restricted/_difference.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  22. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  25. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  26. package/src/sap/base/util/restricted/_flatten.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  28. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  29. package/src/sap/base/util/restricted/_intersection.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  31. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  33. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  34. package/src/sap/base/util/restricted/_isNil.js +1 -1
  35. package/src/sap/base/util/restricted/_max.js +1 -1
  36. package/src/sap/base/util/restricted/_merge.js +1 -1
  37. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  38. package/src/sap/base/util/restricted/_min.js +1 -1
  39. package/src/sap/base/util/restricted/_omit.js +1 -1
  40. package/src/sap/base/util/restricted/_pick.js +1 -1
  41. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  42. package/src/sap/base/util/restricted/_throttle.js +1 -1
  43. package/src/sap/base/util/restricted/_toArray.js +1 -1
  44. package/src/sap/base/util/restricted/_union.js +1 -1
  45. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  46. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  47. package/src/sap/base/util/restricted/_uniq.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  49. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  50. package/src/sap/base/util/restricted/_without.js +1 -1
  51. package/src/sap/base/util/restricted/_xor.js +1 -1
  52. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  53. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  55. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  56. package/src/sap/ui/Device.js +3 -3
  57. package/src/sap/ui/Global.js +3 -3
  58. package/src/sap/ui/base/BindingInfo.js +12 -8
  59. package/src/sap/ui/base/BindingParser.js +13 -6
  60. package/src/sap/ui/base/Event.js +1 -1
  61. package/src/sap/ui/base/EventProvider.js +1 -8
  62. package/src/sap/ui/base/Interface.js +1 -1
  63. package/src/sap/ui/base/ManagedObject.js +15 -42
  64. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  65. package/src/sap/ui/base/Metadata.js +1 -1
  66. package/src/sap/ui/base/Object.js +1 -1
  67. package/src/sap/ui/base/ObjectPool.js +1 -1
  68. package/src/sap/ui/base/_runWithOwner.js +43 -0
  69. package/src/sap/ui/core/.library +3 -30
  70. package/src/sap/ui/core/BusyIndicator.js +8 -8
  71. package/src/sap/ui/core/Component.js +61 -73
  72. package/src/sap/ui/core/ComponentContainer.js +22 -2
  73. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  74. package/src/sap/ui/core/ComponentSupport.js +1 -1
  75. package/src/sap/ui/core/Configuration.js +1 -1
  76. package/src/sap/ui/core/Control.js +1 -1
  77. package/src/sap/ui/core/Core.js +2 -2
  78. package/src/sap/ui/core/CustomData.js +1 -1
  79. package/src/sap/ui/core/DeclarativeSupport.js +13 -11
  80. package/src/sap/ui/core/Element.js +1 -3
  81. package/src/sap/ui/core/ElementMetadata.js +1 -1
  82. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  83. package/src/sap/ui/core/EventBus.js +1 -1
  84. package/src/sap/ui/core/ExtensionPoint.js +4 -4
  85. package/src/sap/ui/core/Fragment.js +4 -2
  86. package/src/sap/ui/core/HTML.js +1 -1
  87. package/src/sap/ui/core/History.js +1 -1
  88. package/src/sap/ui/core/Icon.js +1 -1
  89. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  90. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  91. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  92. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  93. package/src/sap/ui/core/InvisibleText.js +1 -1
  94. package/src/sap/ui/core/Item.js +1 -1
  95. package/src/sap/ui/core/LabelEnablement.js +1 -1
  96. package/src/sap/ui/core/LayoutData.js +1 -1
  97. package/src/sap/ui/core/ListItem.js +1 -1
  98. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  99. package/src/sap/ui/core/Locale.js +1 -1
  100. package/src/sap/ui/core/LocaleData.js +1 -1
  101. package/src/sap/ui/core/Manifest.js +1 -1
  102. package/src/sap/ui/core/Message.js +1 -1
  103. package/src/sap/ui/core/Popup.js +65 -180
  104. package/src/sap/ui/core/RenderManager.js +1 -1
  105. package/src/sap/ui/core/Renderer.js +1 -1
  106. package/src/sap/ui/core/ResizeHandler.js +1 -1
  107. package/src/sap/ui/core/ScrollBar.js +1 -1
  108. package/src/sap/ui/core/SeparatorItem.js +1 -1
  109. package/src/sap/ui/core/Theming.js +2 -2
  110. package/src/sap/ui/core/Title.js +1 -1
  111. package/src/sap/ui/core/TooltipBase.js +1 -1
  112. package/src/sap/ui/core/UIArea.js +1 -1
  113. package/src/sap/ui/core/UIComponent.js +11 -56
  114. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  115. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  116. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  117. package/src/sap/ui/core/XMLComposite.js +1 -1
  118. package/src/sap/ui/core/XMLCompositeMetadata.js +1 -1
  119. package/src/sap/ui/core/XMLTemplateProcessor.js +5 -1
  120. package/src/sap/ui/core/_IconRegistry.js +2 -0
  121. package/src/sap/ui/core/date/UI5Date.js +1 -1
  122. package/src/sap/ui/core/delegate/ItemNavigation.js +2 -2
  123. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  124. package/src/sap/ui/core/dnd/DragDropBase.js +12 -2
  125. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  126. package/src/sap/ui/core/dnd/DragInfo.js +5 -3
  127. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  128. package/src/sap/ui/core/format/FormatUtils.js +1 -1
  129. package/src/sap/ui/core/format/NumberFormat.js +19 -43
  130. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  131. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  132. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  133. package/src/sap/ui/core/i18n/interaction_ar.xml +1 -1
  134. package/src/sap/ui/core/library.js +3 -3
  135. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  136. package/src/sap/ui/core/message/Message.js +1 -1
  137. package/src/sap/ui/core/message/MessageManager.js +1 -1
  138. package/src/sap/ui/core/message/MessageParser.js +1 -1
  139. package/src/sap/ui/core/message/MessageProcessor.js +6 -6
  140. package/src/sap/ui/core/messagebundle_fr_CA.properties +4 -4
  141. package/src/sap/ui/core/messagebundle_hr.properties +7 -7
  142. package/src/sap/ui/core/messagebundle_ja.properties +4 -4
  143. package/src/sap/ui/core/messagebundle_sv.properties +2 -2
  144. package/src/sap/ui/core/mvc/Controller.js +3 -1
  145. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  146. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  147. package/src/sap/ui/core/mvc/JSView.js +1 -1
  148. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  149. package/src/sap/ui/core/mvc/View.js +12 -181
  150. package/src/sap/ui/core/mvc/XMLView.js +2 -1
  151. package/src/sap/ui/core/mvc/_ViewFactory.js +192 -0
  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 +197 -13
  158. package/src/sap/ui/core/routing/Router.js +19 -8
  159. package/src/sap/ui/core/routing/RouterHashChanger.js +12 -3
  160. package/src/sap/ui/core/routing/Target.js +714 -61
  161. package/src/sap/ui/core/routing/TargetCache.js +205 -25
  162. package/src/sap/ui/core/routing/Targets.js +162 -67
  163. package/src/sap/ui/core/routing/Views.js +1 -0
  164. package/src/sap/ui/core/routing/sync/Route.js +1 -1
  165. package/src/sap/ui/core/routing/sync/Target.js +11 -1
  166. package/src/sap/ui/core/routing/sync/TargetCache.js +3 -3
  167. package/src/sap/ui/core/routing/sync/Targets.js +1 -1
  168. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  169. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  170. package/src/sap/ui/core/service/Service.js +1 -48
  171. package/src/sap/ui/core/service/ServiceFactory.js +44 -4
  172. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  173. package/src/sap/ui/core/support/Plugin.js +1 -1
  174. package/src/sap/ui/core/support/Support.js +356 -353
  175. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  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 -1
  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 +4 -2
  183. package/src/sap/ui/core/themes/base/fonts/SAP-icons.ttf +0 -0
  184. package/src/sap/ui/core/themes/base/fonts/SAP-icons.woff2 +0 -0
  185. package/src/sap/ui/core/themes/base/global.less +4 -0
  186. package/src/sap/ui/core/theming/ThemeHelper.js +1 -18
  187. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  188. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  189. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +4 -4
  190. package/src/sap/ui/core/tmpl/Template.js +1 -1
  191. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  192. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  193. package/src/sap/ui/core/util/Export.js +1 -1
  194. package/src/sap/ui/core/util/ExportCell.js +1 -1
  195. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  196. package/src/sap/ui/core/util/ExportRow.js +1 -1
  197. package/src/sap/ui/core/util/ExportType.js +1 -1
  198. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  199. package/src/sap/ui/core/util/File.js +1 -1
  200. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  201. package/src/sap/ui/core/util/MockServer.js +1 -1
  202. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  203. package/src/sap/ui/core/util/XMLPreprocessor.js +8 -1
  204. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +4 -4
  205. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  206. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  207. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  208. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  209. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  210. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  211. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  212. package/src/sap/ui/core/webc/WebComponent.js +71 -3
  213. package/src/sap/ui/core/webc/WebComponentMetadata.js +2 -3
  214. package/src/sap/ui/core/webc/WebComponentRenderer.js +1 -1
  215. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  216. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  217. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  218. package/src/sap/ui/debug/ControlTree.js +1 -1
  219. package/src/sap/ui/debug/DebugEnv.js +1 -1
  220. package/src/sap/ui/debug/PropertyList.js +1 -1
  221. package/src/sap/ui/model/ClientModel.js +1 -1
  222. package/src/sap/ui/model/CompositeDataState.js +1 -1
  223. package/src/sap/ui/model/CompositeType.js +1 -1
  224. package/src/sap/ui/model/DataState.js +1 -1
  225. package/src/sap/ui/model/MetaModel.js +1 -1
  226. package/src/sap/ui/model/Model.js +1 -1
  227. package/src/sap/ui/model/SelectionModel.js +1 -1
  228. package/src/sap/ui/model/SimpleType.js +1 -1
  229. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  230. package/src/sap/ui/model/Type.js +1 -1
  231. package/src/sap/ui/model/analytics/AnalyticalBinding.js +2 -1
  232. package/src/sap/ui/model/analytics/AnalyticalTreeBindingAdapter.js +2 -1
  233. package/src/sap/ui/model/analytics/ODataModelAdapter.js +2 -1
  234. package/src/sap/ui/model/analytics/odata4analytics.js +2 -1
  235. package/src/sap/ui/model/json/JSONModel.js +1 -1
  236. package/src/sap/ui/model/message/MessageModel.js +1 -1
  237. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  238. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  239. package/src/sap/ui/model/odata/ODataMetaModel.js +1 -1
  240. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  241. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  242. package/src/sap/ui/model/odata/ODataTreeBindingAdapter.js +2 -1
  243. package/src/sap/ui/model/odata/_AnnotationHelperExpression.js +3 -3
  244. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  245. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  246. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  247. package/src/sap/ui/model/odata/type/Date.js +1 -1
  248. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  249. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  250. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  251. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  252. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  253. package/src/sap/ui/model/odata/type/Double.js +1 -1
  254. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  255. package/src/sap/ui/model/odata/type/Int.js +1 -1
  256. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  257. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  258. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  259. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  260. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  261. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  262. package/src/sap/ui/model/odata/type/Single.js +1 -1
  263. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  264. package/src/sap/ui/model/odata/type/String.js +1 -1
  265. package/src/sap/ui/model/odata/type/Time.js +1 -1
  266. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  267. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  268. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  269. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  270. package/src/sap/ui/model/odata/v2/ODataModel.js +1 -1
  271. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  272. package/src/sap/ui/model/odata/v4/Context.js +2 -3
  273. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  274. package/src/sap/ui/model/odata/v4/ODataListBinding.js +9 -9
  275. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +57 -19
  276. package/src/sap/ui/model/odata/v4/ODataModel.js +8 -7
  277. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  278. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +3 -3
  279. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +86 -90
  280. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +29 -0
  281. package/src/sap/ui/model/odata/v4/lib/_Cache.js +15 -11
  282. package/src/sap/ui/model/odata/v4/lib/_GroupLock.js +10 -4
  283. package/src/sap/ui/model/odata/v4/lib/_Helper.js +5 -3
  284. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +47 -16
  285. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  286. package/src/sap/ui/model/type/Boolean.js +1 -1
  287. package/src/sap/ui/model/type/Currency.js +1 -1
  288. package/src/sap/ui/model/type/Date.js +1 -1
  289. package/src/sap/ui/model/type/DateInterval.js +1 -1
  290. package/src/sap/ui/model/type/DateTime.js +1 -1
  291. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  292. package/src/sap/ui/model/type/FileSize.js +1 -1
  293. package/src/sap/ui/model/type/Float.js +1 -1
  294. package/src/sap/ui/model/type/Integer.js +1 -1
  295. package/src/sap/ui/model/type/String.js +1 -1
  296. package/src/sap/ui/model/type/Time.js +1 -1
  297. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  298. package/src/sap/ui/model/type/Unit.js +1 -1
  299. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  300. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  301. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  302. package/src/sap/ui/test/Opa.js +14 -2
  303. package/src/sap/ui/test/Opa5.js +61 -10
  304. package/src/sap/ui/test/TestUtils.js +6 -2
  305. package/src/sap/ui/test/generic/TestBase.js +1 -1
  306. package/src/sap/ui/thirdparty/datajs.js +13 -10
  307. package/src/sap/ui/util/Storage.js +1 -1
  308. package/src/ui5loader-autoconfig.js +1 -18
  309. package/src/ui5loader.js +1 -1
  310. package/src/sap/ui/core/routing/async/Route.js +0 -186
  311. package/src/sap/ui/core/routing/async/Target.js +0 -712
  312. package/src/sap/ui/core/routing/async/TargetCache.js +0 -196
  313. package/src/sap/ui/core/routing/async/Targets.js +0 -130
  314. package/src/sap/ui/thirdparty/iscroll-lite.js +0 -603
  315. package/src/sap/ui/thirdparty/iscroll.js +0 -1104
  316. package/src/sap/ui/thirdparty/mobiscroll/css/mobiscroll-core.css +0 -416
  317. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-core.js +0 -127
  318. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-datetime.js +0 -818
  319. package/src/sap/ui/thirdparty/mobiscroll/js/mobiscroll-scroller.js +0 -1264
  320. package/src/sap/ui/thirdparty/swipe-view.js +0 -560
@@ -6,23 +6,34 @@
6
6
 
7
7
 
8
8
  sap.ui.define([
9
- 'sap/ui/core/Element',
10
- 'sap/ui/base/EventProvider',
11
- 'sap/ui/core/mvc/View',
12
- 'sap/ui/core/routing/async/Target',
13
- 'sap/ui/core/routing/sync/Target',
14
- "sap/base/Log"
9
+ "sap/base/Log",
10
+ "sap/base/future",
11
+ "sap/ui/base/EventProvider",
12
+ "sap/ui/base/ManagedObjectMetadata",
13
+ "sap/ui/core/ComponentContainer",
14
+ "sap/ui/core/Element",
15
+ "sap/ui/core/Placeholder",
16
+ "sap/ui/core/library",
17
+ "sap/ui/core/mvc/View",
18
+ "sap/ui/core/routing/sync/Target"
15
19
  ],
16
20
  function(
17
- Element,
21
+ Log,
22
+ future,
18
23
  EventProvider,
24
+ ManagedObjectMetadata,
25
+ ComponentContainer,
26
+ Element,
27
+ Placeholder,
28
+ coreLib,
19
29
  View,
20
- asyncTarget,
21
- syncTarget,
22
- Log
30
+ SyncTarget
23
31
  ) {
24
32
  "use strict";
25
33
 
34
+ // shortcut for sap.ui.core.ComponentLifecycle
35
+ var ComponentLifecycle = coreLib.ComponentLifecycle;
36
+
26
37
  /**
27
38
  * This class resolves the property binding of the 'title' option.
28
39
  *
@@ -246,6 +257,7 @@ sap.ui.define([
246
257
  * @since 1.28.1
247
258
  * @extends sap.ui.base.EventProvider
248
259
  * @alias sap.ui.core.routing.Target
260
+ * @ui5-transform-hint replace-param oOptions._async true
249
261
  */
250
262
  var Target = EventProvider.extend("sap.ui.core.routing.Target", /** @lends sap.ui.core.routing.Target.prototype */ {
251
263
 
@@ -282,10 +294,10 @@ sap.ui.define([
282
294
  });
283
295
  }
284
296
 
285
- // branch by abstraction
286
- var TargetStub = this._oOptions._async ? asyncTarget : syncTarget;
287
- for (var fn in TargetStub) {
288
- this[fn] = TargetStub[fn];
297
+ if (!oOptions._async) {
298
+ for (const fn in SyncTarget) {
299
+ this[fn] = SyncTarget[fn];
300
+ }
289
301
  }
290
302
 
291
303
  this._bIsDisplayed = false;
@@ -312,29 +324,6 @@ sap.ui.define([
312
324
  return this;
313
325
  },
314
326
 
315
- /**
316
- * Creates a view and puts it in an aggregation of a control that has been defined in the {@link sap.ui.core.routing.Target#constructor}.
317
- *
318
- * @name sap.ui.core.routing.Target#display
319
- * @function
320
- * @param {object} [vData] an object that will be passed to the display event in the data property. If the target has parents, the data will also be passed to them.
321
- * @return {Promise<{name: string, view: sap.ui.core.mvc.View, control: sap.ui.core.Control}>} resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise it resolves with {name: *, error: *}
322
- * @public
323
- */
324
-
325
- /**
326
- * Suspends the object which is loaded by the target.
327
- *
328
- * Currently this function stops the router of the component when the object which is loaded by this target
329
- * is an instance of UIComponent. This is done only when the target is already loaded. When the target is
330
- * not loaded yet or still being loaded, the router of the component isn't stopped.
331
- *
332
- * @return {sap.ui.core.routing.Target} The 'this' to chain the call
333
- * @name sap.ui.core.routing.Target#suspend
334
- * @function
335
- * @public
336
- */
337
-
338
327
  /**
339
328
  * Will be fired when a target is displayed
340
329
  *
@@ -496,38 +485,34 @@ sap.ui.define([
496
485
 
497
486
  _updateOptions: function (oOrigOptions) {
498
487
  var oOptions = Object.assign({}, oOrigOptions);
488
+ /** @ui5-transform-hint replace-local true */
489
+ const bAsync = oOptions._async;
499
490
  // convert the legacy syntax to the new one
500
491
  // if "viewName" is set, it's converted to "type" and "name"
501
492
  // meanwhile, the "viewPath" is also set to "path" and the
502
493
  // "viewId" is also set to "id"
503
- if (oOptions.viewName) {
504
- // if the target's name is given under the "name" property,
505
- // copy it to "_name" before overwritting it with the "viewName"
506
- if (oOptions.name) {
507
- oOptions._name = oOptions.name;
508
- }
509
- oOptions.type = "View";
510
- oOptions.name = oOptions.viewName;
511
- // sync Target still only works with the legacy options
512
- if (oOptions._async) {
494
+
495
+ if (bAsync) {
496
+ if (oOptions.viewName) {
497
+ // if the target's name is given under the "name" property,
498
+ // copy it to "_name" before overwritting it with the "viewName"
499
+ if (oOptions.name) {
500
+ oOptions._name = oOptions.name;
501
+ }
502
+ oOptions.type = "View";
503
+ oOptions.name = oOptions.viewName;
513
504
  delete oOptions.viewName;
514
- }
515
- if (oOptions.viewPath) {
516
- oOptions.path = oOptions.viewPath;
517
- // sync Target still only works with the legacy options
518
- if (oOptions._async) {
505
+ if (oOptions.viewPath) {
506
+ oOptions.path = oOptions.viewPath;
519
507
  delete oOptions.viewPath;
520
508
  }
521
- }
522
509
 
523
- if (oOptions.viewId) {
524
- oOptions.id = oOptions.viewId;
525
- // sync Target still only works with the legacy options
526
- if (oOptions._async) {
510
+ if (oOptions.viewId) {
511
+ oOptions.id = oOptions.viewId;
527
512
  delete oOptions.viewId;
528
513
  }
529
514
  }
530
- } else if (!oOptions._async && oOptions.type) {
515
+ } else if (oOptions.type){
531
516
  // sync target still only works with the legacy option
532
517
  // and an error is logged here when sync routing uses the new options
533
518
  Log.error("Sync Target '" + oOptions._name + "' uses the new options which are only supported by async Target.");
@@ -577,25 +562,693 @@ sap.ui.define([
577
562
  */
578
563
  _beforePlacingViewIntoContainer : function(mArguments) {},
579
564
 
565
+ /**
566
+ * Creates a view and puts it in an aggregation of a control that has been defined in the {@link #constructor}.
567
+ *
568
+ * This method can be used to display a target without changing the browser hash. If the browser hash should be changed,
569
+ * the {@link sap.ui.core.routing.Router#navTo} method should be used instead
570
+ *
571
+ * @param {object} [vData] an object that will be passed to the display event in the data property. If the target has parents, the data will also be passed to them.
572
+ * @return {Promise<{name: string, view: sap.ui.core.mvc.View, control: sap.ui.core.Control}>} resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise it resolves with {name: *, error: *}
573
+ * @public
574
+ */
575
+ display: function (vData) {
576
+ // Create an immediately resolving promise for parentless Target
577
+ var oSequencePromise = Promise.resolve();
578
+ return this._display(vData, oSequencePromise);
579
+ },
580
+
581
+ /**
582
+ * Creates a view and puts it in an aggregation of a control that has been defined in the {@link #constructor}.
583
+ *
584
+ * @param {*} [vData] An object that will be passed to the display event in the data property. If the target has parents, the data will also be passed to them.
585
+ * @param {Promise} oSequencePromise Promise chain for resolution in the correct order
586
+ * @param {object} [oTargetCreateInfo] Additional information for the component creation.
587
+ * @returns {Promise} Resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise it rejects with error information
588
+ * @private
589
+ */
590
+ _display: function (vData, oSequencePromise, oTargetCreateInfo) {
591
+ if (this._oParent) {
592
+ oSequencePromise = this._oParent._display(vData, oSequencePromise, Object.assign({}, oTargetCreateInfo));
593
+ }
594
+ return this._place(vData, oSequencePromise, oTargetCreateInfo);
595
+ },
596
+
597
+
598
+ /**
599
+ * Suspends the object which is loaded by the target.
600
+ *
601
+ * Currently this function stops the router of the component when the object which is loaded by this target
602
+ * is an instance of UIComponent. This is done only when the target is already loaded. When the target is
603
+ * not loaded yet or still being loaded, the router of the component isn't stopped.
604
+ *
605
+ * @return {sap.ui.core.routing.Target} The 'this' to chain the call
606
+ * @public
607
+ */
608
+ suspend: function() {
609
+ if (this._oParent) {
610
+ this._oParent.suspend();
611
+ }
612
+
613
+ if (this._isLoaded()) {
614
+ var oObject = this._get(),
615
+ oRouter;
616
+
617
+ if (oObject.isA("sap.ui.core.UIComponent") && (oRouter = oObject.getRouter()) && oObject.hasNativeRouter()) {
618
+ oRouter.stop();
619
+ }
620
+ } else {
621
+ Log.warning("The target with name '" + this._oOptions._name + "' can't be suspended because it's being loaded or not loaded yet");
622
+ }
623
+
624
+ return this;
625
+ },
626
+
627
+ /**
628
+ * Resumes the object which is loaded by the target.
629
+ *
630
+ * Currently this function initializes the router of the component without parsing the current hash when
631
+ * the object which is loaded by this target is an instance of
632
+ * UIComponent.
633
+ *
634
+ * @return {sap.ui.core.routing.Target} The 'this' to chain the call
635
+ * @private
636
+ */
637
+ resume: function() {
638
+ if (this._oParent) {
639
+ this._oParent.resume();
640
+ }
641
+
642
+ if (this._isLoaded()) {
643
+ var oObject = this._get(),
644
+ oRouter;
645
+
646
+ if (oObject.isA("sap.ui.core.UIComponent") && (oRouter = oObject.getRouter()) && oObject.hasNativeRouter()) {
647
+ oRouter.initialize(true);
648
+ }
649
+ }
650
+
651
+ return this;
652
+ },
653
+
654
+ /**
655
+ * Checks whether the object which this Target loads is already loaded
656
+ *
657
+ * @return {boolean} Whether the object which this Target loads is already loaded
658
+ * @private
659
+ */
660
+ _isLoaded: function() {
661
+ return this._bIsLoaded;
662
+ },
663
+
664
+ /**
665
+ * Retrieves additional target creation info based on the target type.
666
+ *
667
+ * @return {object} Merged target creation info object
668
+ */
669
+ _getCreateOptions: function() {
670
+ var sName = this._getEffectiveObjectName(this._oOptions.name),
671
+ oOptions = this._oOptions,
672
+ oCreateOptions;
673
+
674
+ switch (oOptions.type) {
675
+ case "View":
676
+ oCreateOptions = {
677
+ name: sName,
678
+ id: oOptions.id,
679
+ async: true
680
+ };
681
+
682
+ if (!sName.startsWith("module:")) {
683
+ oCreateOptions.type = oOptions.viewType;
684
+ }
685
+ break;
686
+ case "Component":
687
+ oOptions.id = oOptions.id || ManagedObjectMetadata.uid("uicomponent");
688
+
689
+ oCreateOptions = { id: oOptions.id };
690
+
691
+ if (oOptions.usage) {
692
+ oCreateOptions.usage = oOptions.usage;
693
+ } else {
694
+ oCreateOptions.name = sName;
695
+ }
696
+
697
+ oCreateOptions = Object.assign({}, oOptions.options || {}, oCreateOptions);
698
+ break;
699
+ default:
700
+ throw new Error("The given type " + oOptions.type + " isn't support by sap.ui.core.routing.Target");
701
+ }
702
+
703
+ return oCreateOptions;
704
+ },
705
+
706
+ /**
707
+ * Get the target instance from the TargetCache.
708
+ *
709
+ * The difference between this function and the "_load" function is that this function returns the target
710
+ * instance directly if it's already loaded and returns a Promise during the loading of the target instance
711
+ * while the "_load" function always returns a promise no matter whether the target instance is loaded or not.
712
+ *
713
+ * @param {object} [oTargetCreateInfo] Additional information for the component creation.
714
+ * @returns {sap.ui.core.mvc.View|sap.ui.core.UIComponent|Promise} The target instance when it's already loaded
715
+ * or a promise which resolves with the target instance during the loading of the target instance
716
+ * @private
717
+ */
718
+ _get: function(oTargetCreateInfo) {
719
+ var oCreateOptions = this._getCreateOptions();
720
+
721
+
722
+ return this._oCache._get(oCreateOptions, this._oOptions.type,
723
+ // Hook in the route for deprecated global view id, it has to be supported to stay compatible
724
+ this._bUseRawViewId, oTargetCreateInfo);
725
+ },
726
+
727
+ /**
728
+ * Loads the object from TargetCache.
729
+ *
730
+ * @param {object} [oTargetCreateInfo] Additional information for the component creation.
731
+ * @return {Promise} A promise which resolves with the loaded object of this Target
732
+ * @private
733
+ */
734
+ _load: function(oTargetCreateInfo) {
735
+ var oObject = this._get(oTargetCreateInfo),
736
+ pLoaded;
737
+
738
+ if (!(oObject instanceof Promise)) {
739
+ if (oObject.isA("sap.ui.core.mvc.View")) {
740
+ pLoaded = oObject.loaded();
741
+ } else {
742
+ pLoaded = Promise.resolve(oObject);
743
+ }
744
+ } else {
745
+ pLoaded = oObject;
746
+ }
747
+
748
+ return pLoaded.then(function(oObject) {
749
+ this._bIsLoaded = true;
750
+ return oObject;
751
+ }.bind(this));
752
+ },
753
+
754
+ /**
755
+ * Load the target and wait for the first <code>routeMatched</code> event if it's a Component target
756
+ *
757
+ * @param {object} oTargetCreateInfo The additional information for the component target creation.
758
+ * @return {Promise} Promise resolving with the loaded target object and the promise that waits for the
759
+ * <code>routeMatched</code> event in case of a Component target
760
+ * @private
761
+ */
762
+ load: function(oTargetCreateInfo) {
763
+ return this._load(oTargetCreateInfo)
764
+ .then(function(oLoadedTarget) {
765
+ return {
766
+ object: oLoadedTarget,
767
+ nestedComponentReady: this.waitForComponentTarget({
768
+ target: oLoadedTarget,
769
+ createInfo: oTargetCreateInfo
770
+ })
771
+ };
772
+ }.bind(this));
773
+ },
774
+
775
+ /**
776
+ * Wait for the next <code>routeMatched</code> event from the Component target
777
+ *
778
+ * @param {object} mTargetOptions The option object that contains the loaded target object and the corresponding
779
+ * target create info.
780
+ * @return {Promise} Promise resolving when the first <code>routeMatched</code> event is fired when the target
781
+ * has type "Component" otherwise the Promise resolves immediately
782
+ * @private
783
+ */
784
+ waitForComponentTarget: function(mTargetOptions) {
785
+ return new Promise(function(resolve, reject) {
786
+ var oLoadedTarget = mTargetOptions.target;
787
+ var oTargetCreateInfo = mTargetOptions.createInfo;
788
+ var bInstantResolve = true;
789
+
790
+ if (oLoadedTarget.isA("sap.ui.core.UIComponent")) {
791
+ var oRouter = oLoadedTarget.getRouter();
792
+ if (oRouter && oLoadedTarget.hasNativeRouter()) {
793
+ var sHash = oRouter.getHashChanger().getHash();
794
+ var oRoute = oRouter.getRouteByHash(sHash);
795
+ var bIgnoreInitialHash = oTargetCreateInfo && oTargetCreateInfo.ignoreInitialHash;
796
+
797
+ /**
798
+ * @deprecated
799
+ */
800
+ if (!oRouter._oConfig.async){
801
+ throw new Error("The router of component '" + oLoadedTarget.getId() +
802
+ "' which is loaded via the target '" + this._oOptions._name +
803
+ "' is defined as synchronous which is not supported using as a nested component.");
804
+ }
805
+
806
+ if (oRouter._oOwner && oTargetCreateInfo) {
807
+ // update the flag once the component is displayed again after it's already loaded
808
+ oRouter._oOwner._bRoutingPropagateTitle = oTargetCreateInfo.propagateTitle;
809
+ }
810
+
811
+ // TODO: offer getter for target info
812
+ //
813
+ // The router is normally initialized in the UIComponent.prototype.init function and the
814
+ // init function should be already called before it reaches this place which means that the
815
+ // router is initialized in most of the cases. If a router is already initialized, we still
816
+ // need to check whether the route match process is finished. If it's not finished, we are
817
+ // sure that there will be a "routeMatched" event fired and we can wait for it.
818
+ if (!bIgnoreInitialHash && (!oRouter.isInitialized() || oRouter._bMatchingProcessStarted) && oRoute && oRoute._oConfig.target) {
819
+ bInstantResolve = false;
820
+ oRouter.attachRouteMatched(resolve);
821
+ }
822
+ if (oRouter.isStopped()) {
823
+ // initialize the router in nested component
824
+ // if it has been previously stopped
825
+ oRouter.initialize(bIgnoreInitialHash);
826
+ }
827
+ }
828
+ }
829
+
830
+ if (bInstantResolve) {
831
+ resolve();
832
+ }
833
+ }.bind(this));
834
+ },
835
+
836
+ /**
837
+ * Find the container control in the following order:
838
+ * <ul>
839
+ * <li>Within the parent target in case <code>oParentInfo</code> is given</li>
840
+ * <li>Within the root view of the owner component</li>
841
+ * <li>Using the given control ID in the global scope</li>
842
+ * </ul>
843
+ *
844
+ * @param {object} [oParentInfo] The view information from the displayed parent target
845
+ * @return {Promise} Promise resolving with the container control
846
+ * @private
847
+ */
848
+ resolveContainerControl: function(oParentInfo) {
849
+ // use a Promise.resovle() to delay the container resolve to occur after the current call stack because the
850
+ // oOptions.rootView can be available after the current call stack.
851
+ return Promise.resolve().then(function() {
852
+ oParentInfo = oParentInfo || {};
853
+
854
+ var oOptions = this._oOptions;
855
+ var vValid = this._isValid(oParentInfo);
856
+ var sErrorMessage;
857
+
858
+ // validate config and log errors if necessary
859
+ if (vValid !== true) {
860
+ sErrorMessage = vValid;
861
+ return this._refuseInvalidTarget(oOptions._name, sErrorMessage);
862
+ }
863
+
864
+ var oViewContainingTheControl = oParentInfo.view,
865
+ oControl = oParentInfo.control,
866
+ pViewContainingTheControl,
867
+ pContainerControl;
868
+
869
+ // if the parent target loads a component, the oViewContainingTheControl is an instance of
870
+ // ComponentContainer. The root control of the component should be retrieved and set as
871
+ // oViewContainingTheControl
872
+ if (oViewContainingTheControl && oViewContainingTheControl.isA("sap.ui.core.ComponentContainer")) {
873
+ oViewContainingTheControl = oViewContainingTheControl.getComponentInstance().getRootControl();
874
+ }
875
+
876
+ //no parent view - see if container can be found by using oOptions.controlId under oOptions.rootView
877
+ if (!oViewContainingTheControl && oOptions.rootView) {
878
+ // oOptions.rootView can be either an id or a promise that resolves with the id
879
+ pViewContainingTheControl = Promise.resolve(oOptions.rootView)
880
+ .then(function(oRootViewId) {
881
+ var oView;
882
+
883
+ if (oRootViewId) {
884
+ oView = Element.getElementById(oRootViewId);
885
+ oOptions.rootView = oRootViewId;
886
+ }
887
+
888
+ if (!oView) {
889
+ sErrorMessage = "Did not find the root view with the id " + oOptions.rootView;
890
+ return this._refuseInvalidTarget(oOptions._name, sErrorMessage);
891
+ } else {
892
+ return oView;
893
+ }
894
+ }.bind(this));
895
+ } else {
896
+ pViewContainingTheControl = Promise.resolve(oViewContainingTheControl);
897
+ }
898
+
899
+ pViewContainingTheControl = pViewContainingTheControl.then(function(oView) {
900
+ if (oView && oView.isA("sap.ui.core.mvc.View")) {
901
+ return oView.loaded();
902
+ } else {
903
+ return oView;
904
+ }
905
+ });
906
+
907
+ if (oOptions.controlId) {
908
+ pContainerControl = pViewContainingTheControl.then(function(oContainerView) {
909
+ var oContainerControl;
910
+
911
+ if (oContainerView) {
912
+ oContainerControl = oContainerView.byId(oOptions.controlId);
913
+ }
914
+
915
+ if (!oContainerControl) {
916
+ //Test if control exists in core (without prefix) since it was not found in the parent or root view
917
+ oContainerControl = Element.getElementById(oOptions.controlId);
918
+ }
919
+
920
+ return oContainerControl;
921
+ });
922
+ } else {
923
+ pContainerControl = Promise.resolve(oControl);
924
+ }
925
+
926
+ return pContainerControl.then(function(oContainerControl) {
927
+ if (!oContainerControl) {
928
+ sErrorMessage = "Control with ID " + oOptions.controlId + " could not be found";
929
+ return this._refuseInvalidTarget(oOptions._name, sErrorMessage);
930
+ } else {
931
+ return oContainerControl;
932
+ }
933
+ }.bind(this));
934
+ }.bind(this));
935
+ },
936
+
937
+ /**
938
+ * Create and display the placeholder on the respective container
939
+ *
940
+ * @param {object} oTargetCreateInfo Object containing the target create info
941
+ * @param {object} oContainerControl The container control
942
+ * @returns {object} the view info object
943
+ * @private
944
+ */
945
+ displayPlaceholder: function(oTargetCreateInfo, oContainerControl) {
946
+ var oObject,
947
+ oOptions = this._oOptions,
948
+ bIsComponentTarget = oOptions.type === "Component",
949
+ bHasPlaceholderConfig = false,
950
+ oPlaceholderConfig = oTargetCreateInfo.placeholder || oOptions.placeholder || {},
951
+ pPlaceholder = Promise.resolve();
952
+
953
+ if (Placeholder.hasProviders()) {
954
+ Object.assign(oPlaceholderConfig, Placeholder.getPlaceholderFromProviders({
955
+ name: oOptions.name,
956
+ type: oOptions.type
957
+ }));
958
+ }
959
+
960
+ if (Object.keys(oPlaceholderConfig).length > 0) {
961
+ if (oPlaceholderConfig.autoClose === undefined) {
962
+ oPlaceholderConfig.autoClose = true;
963
+ }
964
+ bHasPlaceholderConfig = true;
965
+ }
966
+
967
+ if (bIsComponentTarget) {
968
+ var oOwnerComponent = this._oCache._oComponent;
969
+ var sComponentContainerId = oOptions.id + "-container";
970
+
971
+ oObject = (oOwnerComponent && oOwnerComponent.byId(sComponentContainerId))
972
+ || Element.getElementById(sComponentContainerId);
973
+
974
+ if (!oObject) {
975
+ // defaults mixed in with configured settings
976
+ var oContainerOptions = Object.assign({
977
+ height: "100%",
978
+ width: "100%",
979
+ lifecycle: ComponentLifecycle.Application
980
+ }, oOptions.containerOptions);
981
+
982
+ if (oOwnerComponent) {
983
+ oOwnerComponent.runAsOwner(function() {
984
+ oObject = new ComponentContainer(oOwnerComponent.createId(sComponentContainerId), oContainerOptions);
985
+ });
986
+ } else {
987
+ oObject = new ComponentContainer(sComponentContainerId, oContainerOptions);
988
+ }
989
+ }
990
+
991
+ // set container object only if placeholder config is available
992
+ if (bHasPlaceholderConfig) {
993
+ oPlaceholderConfig.container = oObject;
994
+ }
995
+ }
996
+
997
+ // for view targets use container control to display placeholder
998
+ if (bHasPlaceholderConfig && oContainerControl.isA("sap.ui.core.IPlaceholderSupport")) {
999
+ oPlaceholderConfig.container = oContainerControl;
1000
+ }
1001
+
1002
+ // Placeholder creation
1003
+ if (oPlaceholderConfig.container && !oTargetCreateInfo.repeatedRoute) {
1004
+ oPlaceholderConfig.aggregation = this._oOptions.controlAggregation;
1005
+
1006
+ var oCreateOptions = this._getCreateOptions();
1007
+ var oCachedObject = this._oCache.fetch(oCreateOptions, this._oOptions.type);
1008
+
1009
+ if (oCachedObject && bIsComponentTarget) {
1010
+ // for type "Component", the object that is saved in the placeholder config should be
1011
+ // the component container instead of the component
1012
+ oPlaceholderConfig.object = oObject;
1013
+ } else {
1014
+ oPlaceholderConfig.object = oCachedObject;
1015
+ }
1016
+
1017
+ if (oPlaceholderConfig.html) {
1018
+ oPlaceholderConfig.placeholder = new Placeholder({
1019
+ html: oPlaceholderConfig.html
1020
+ });
1021
+ }
1022
+
1023
+ if (oPlaceholderConfig.placeholder && Placeholder.isEnabled()) {
1024
+ pPlaceholder = this.showPlaceholder(oPlaceholderConfig);
1025
+ }
1026
+ }
1027
+
1028
+ // wait for placeholder to load
1029
+ return pPlaceholder.then(function(sPlaceholderContent) {
1030
+ // returning view info object
1031
+ return {
1032
+ containerControl: oContainerControl,
1033
+ object: oObject,
1034
+ placeholderConfig: oPlaceholderConfig,
1035
+ placeholderShown: !!sPlaceholderContent
1036
+ };
1037
+ });
1038
+ },
1039
+
580
1040
  /**
581
1041
  * Here the magic happens - recursion + placement + view creation needs to be refactored
582
1042
  *
583
- * @name sap.ui.core.routing.Target#_place
584
1043
  * @param {object} [vData] an object that will be passed to the display event in the data property. If the
585
1044
  * target has parents, the data will also be passed to them.
586
1045
  * @param {Promise} oSequencePromise Promise chain for resolution in the correct order
1046
+ * @param {object} oTargetCreateInfo Additional information for the component creation.
587
1047
  * @return {Promise} resolves with {name: *, view: *, control: *} if the target can be successfully displayed otherwise it rejects with an error message
588
1048
  * @private
589
1049
  */
1050
+ _place: function (vData, oSequencePromise, oTargetCreateInfo) {
1051
+ var oOptions = this._oOptions,
1052
+ that = this,
1053
+ sErrorMessage,
1054
+ bIsComponentTarget = oOptions.type === "Component";
1055
+
1056
+ var pLoaded, /* target is loaded and promise for waiting on "routeMatched" event in nested component is ready*/
1057
+ pContainerReady; /* container control and placeholder ready */
1058
+
1059
+ if (vData instanceof Promise) {
1060
+ oTargetCreateInfo = oSequencePromise;
1061
+ oSequencePromise = vData;
1062
+ vData = undefined;
1063
+ }
1064
+
1065
+ oTargetCreateInfo = oTargetCreateInfo || {};
1066
+
1067
+ if ((oOptions.name || oOptions.usage) && oOptions.type) {
1068
+ // target loading
1069
+ pLoaded = this.load(oTargetCreateInfo);
1070
+
1071
+ // Either if parent available, then we need to wait until the parent got displayed or
1072
+ // if no target info is given, then we need to wait for the oSequencePromise to be resolved
1073
+ if (this._oParent || oTargetCreateInfo.legacy) {
1074
+ // resolve container control and placeholder creation
1075
+ pContainerReady = oSequencePromise.then(this.resolveContainerControl.bind(this));
1076
+ } else {
1077
+ // no need to wait for oSequencePromise, resolve container control in parallel
1078
+ pContainerReady = this.resolveContainerControl();
1079
+ }
1080
+
1081
+ pContainerReady = pContainerReady.then(this.displayPlaceholder.bind(this, oTargetCreateInfo));
1082
+
1083
+ // when target information is given
1084
+ oSequencePromise = Promise.all([pLoaded, pContainerReady, oSequencePromise])
1085
+ // prepareTitleProvider
1086
+ .then(function(aArguments) {
1087
+ var oObject = aArguments[0].object,
1088
+ oViewInfo = aArguments[1],
1089
+ oView, oRootControl;
1090
+
1091
+ oViewInfo.nestedComponentReady = aArguments[0].nestedComponentReady;
1092
+
1093
+ if (bIsComponentTarget) {
1094
+ var fnOriginalDestroy = oObject.destroy;
1095
+ oObject.destroy = function () {
1096
+ if (fnOriginalDestroy) {
1097
+ fnOriginalDestroy.apply(this);
1098
+ }
1099
+ // destroy the component container when the component is destroyed
1100
+ oViewInfo.object.destroy();
1101
+ };
1102
+ oViewInfo.object.setComponent(oObject);
1103
+
1104
+ oRootControl = oObject.getRootControl();
1105
+ if (oRootControl && oRootControl.isA("sap.ui.core.mvc.View")) {
1106
+ oView = oRootControl;
1107
+ }
1108
+ } else {
1109
+ // view
1110
+ oViewInfo.object = oObject;
1111
+ oView = oObject;
1112
+ }
1113
+
1114
+ that._bindTitleInTitleProvider(oView);
1115
+ that._addTitleProviderAsDependent(oView);
1116
+
1117
+ return oViewInfo;
1118
+ })
1119
+ // placing the view or component into container
1120
+ .then(function(oViewInfo) {
1121
+ var oContainerControl = oViewInfo.containerControl,
1122
+ oObject = oViewInfo.object;
1123
+
1124
+ // adapt the container before placing the view into it to make the rendering occur together with the next
1125
+ // aggregation modification.
1126
+ that._beforePlacingViewIntoContainer({
1127
+ container: oContainerControl,
1128
+ view: oObject,
1129
+ data: vData
1130
+ });
1131
+
1132
+ var oAggregationInfo = oContainerControl.getMetadata().getJSONKeys()[oOptions.controlAggregation];
1133
+
1134
+ if (!oAggregationInfo) {
1135
+ sErrorMessage = "Control " + oOptions.controlId +
1136
+ " does not have an aggregation called " + oOptions.controlAggregation;
1137
+ return that._refuseInvalidTarget(oOptions._name, sErrorMessage);
1138
+ }
1139
+
1140
+ if (oOptions.clearControlAggregation === true) {
1141
+ oContainerControl[oAggregationInfo._sRemoveAllMutator]();
1142
+ }
1143
+
1144
+ Log.info("Did place the " + oOptions.type.toLowerCase() +
1145
+ " target '" + (oOptions.name ? that._getEffectiveObjectName(oOptions.name) : oOptions.usage) +
1146
+ "' with the id '" + oObject.getId() + "' into the aggregation '" + oOptions.controlAggregation +
1147
+ "' of a control with the id '" + oContainerControl.getId() + "'", that);
1148
+
1149
+ // add oObject to oContainerControl's aggregation
1150
+ oContainerControl[oAggregationInfo._sMutator](oObject);
1151
+
1152
+ return {
1153
+ name: oOptions._name,
1154
+ view: oObject,
1155
+ control: oContainerControl,
1156
+ nestedComponentReady: oViewInfo.nestedComponentReady,
1157
+ placeholderConfig: oViewInfo.placeholderConfig,
1158
+ placeholderShown: oViewInfo.placeholderShown
1159
+ };
1160
+ });
1161
+ } else {
1162
+ oSequencePromise = oSequencePromise.then(function() {
1163
+ return {
1164
+ name: oOptions._name
1165
+ };
1166
+ });
1167
+ }
1168
+
1169
+ return oSequencePromise.then(function(oParams) {
1170
+ var pNestedComponentReady = oParams.nestedComponentReady || Promise.resolve();
1171
+ return pNestedComponentReady.then(function() {
1172
+ var oContainerControl = oParams.control,
1173
+ oObject = oParams.view,
1174
+ oPlaceholderConfig = oParams.placeholderConfig;
1175
+
1176
+ if (oContainerControl && oObject) {
1177
+ that.fireDisplay({
1178
+ view : oObject.isA("sap.ui.core.mvc.View") ? oObject : undefined,
1179
+ object: oObject,
1180
+ control : oContainerControl,
1181
+ data: vData,
1182
+ routeRelevant: oTargetCreateInfo.routeRelevant
1183
+ });
1184
+ }
1185
+
1186
+ if (oPlaceholderConfig && oPlaceholderConfig.container &&
1187
+ oPlaceholderConfig.autoClose && that.hidePlaceholder) {
1188
+ that.hidePlaceholder(oPlaceholderConfig);
1189
+ }
1190
+
1191
+ return oParams;
1192
+ });
1193
+ });
1194
+ },
1195
+
1196
+ showPlaceholder: function(mSettings) {
1197
+ if (mSettings.container && mSettings.container.showPlaceholder) {
1198
+ return mSettings.container.showPlaceholder(mSettings);
1199
+ } else {
1200
+ return Promise.resolve();
1201
+ }
1202
+ },
1203
+
1204
+ hidePlaceholder: function(mSettings) {
1205
+ if (mSettings.container.hidePlaceholder) {
1206
+ mSettings.container.hidePlaceholder();
1207
+ }
1208
+ },
590
1209
 
591
1210
  /**
592
1211
  * Validates the target options, will also be called from the route but route will not log errors
593
1212
  *
594
- * @name sap.ui.core.routing.Target#._isValid
595
- * @param oParentInfo
1213
+ * @param {object} oParentInfo The parent info {name: *, view: *, control: *}
596
1214
  * @returns {boolean|string} returns true if it's valid otherwise the error message
597
1215
  * @private
598
1216
  */
1217
+ _isValid : function (oParentInfo) {
1218
+ var oOptions = this._oOptions,
1219
+ oControl = oParentInfo && oParentInfo.control,
1220
+ bHasTargetControl = (oControl || oOptions.controlId),
1221
+ bIsValid = true,
1222
+ sLogMessage = "";
1223
+
1224
+ if (!bHasTargetControl) {
1225
+ sLogMessage = "The target " + oOptions._name + " has no controlId set and no parent so the target cannot be displayed.";
1226
+ bIsValid = false;
1227
+ }
1228
+
1229
+ if (!oOptions.controlAggregation) {
1230
+ sLogMessage = "The target " + oOptions._name + " has a control id or a parent but no 'controlAggregation' was set, so the target could not be displayed.";
1231
+ bIsValid = false;
1232
+ }
1233
+
1234
+ if (sLogMessage) {
1235
+ future.errorThrows(`${this}: ${sLogMessage}`);
1236
+ }
1237
+
1238
+ return bIsValid || sLogMessage;
1239
+ },
1240
+
1241
+ /**
1242
+ * Refuses the target with the name <code>sName</code> by throwing an error asynchronously
1243
+ *
1244
+ * @param {string} sName The name of the target
1245
+ * @param {string} sMessage The error message with more insights why the target is invalid
1246
+ * @returns {Promise} The rejected promise
1247
+ * @private
1248
+ */
1249
+ _refuseInvalidTarget : function(sName, sMessage) {
1250
+ return Promise.reject(new Error(sMessage + " - Target: " + sName));
1251
+ },
599
1252
 
600
1253
  M_EVENTS : {
601
1254
  DISPLAY : "display",