@openui5/sap.ui.core 1.128.0 → 1.130.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 (432) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +1 -1
  3. package/src/jquery.sap.global.js +7 -7
  4. package/src/jquery.sap.properties.js +1 -1
  5. package/src/jquery.sap.resources.js +1 -1
  6. package/src/jquery.sap.script.js +1 -1
  7. package/src/jquery.sap.storage.js +3 -3
  8. package/src/jquery.sap.trace.js +18 -18
  9. package/src/sap/base/Event.js +1 -1
  10. package/src/sap/base/Eventing.js +1 -1
  11. package/src/sap/base/config.js +1 -1
  12. package/src/sap/base/future.js +10 -2
  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/BindingParser.js +1 -3
  59. package/src/sap/ui/base/Event.js +1 -1
  60. package/src/sap/ui/base/EventProvider.js +1 -1
  61. package/src/sap/ui/base/Interface.js +1 -1
  62. package/src/sap/ui/base/ManagedObject.js +4 -9
  63. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  64. package/src/sap/ui/base/Metadata.js +1 -1
  65. package/src/sap/ui/base/Object.js +1 -1
  66. package/src/sap/ui/base/ObjectPool.js +1 -1
  67. package/src/sap/ui/core/.library +2 -2
  68. package/src/sap/ui/core/BusyIndicator.js +1 -1
  69. package/src/sap/ui/core/Component.js +46 -122
  70. package/src/sap/ui/core/ComponentContainer.js +2 -2
  71. package/src/sap/ui/core/ComponentHooks.js +174 -0
  72. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  73. package/src/sap/ui/core/ComponentSupport.js +1 -1
  74. package/src/sap/ui/core/Configuration.js +1 -1
  75. package/src/sap/ui/core/Control.js +1 -1
  76. package/src/sap/ui/core/Core.js +8 -3
  77. package/src/sap/ui/core/CustomData.js +1 -1
  78. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  79. package/src/sap/ui/core/Element.js +6 -2
  80. package/src/sap/ui/core/ElementMetadata.js +1 -1
  81. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  82. package/src/sap/ui/core/EventBus.js +1 -1
  83. package/src/sap/ui/core/Fragment.js +6 -5
  84. package/src/sap/ui/core/HTML.js +1 -1
  85. package/src/sap/ui/core/History.js +1 -1
  86. package/src/sap/ui/core/Icon.js +2 -2
  87. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  88. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  89. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  90. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  91. package/src/sap/ui/core/InvisibleText.js +1 -1
  92. package/src/sap/ui/core/Item.js +1 -1
  93. package/src/sap/ui/core/LabelEnablement.js +2 -15
  94. package/src/sap/ui/core/LayoutData.js +1 -1
  95. package/src/sap/ui/core/ListItem.js +1 -1
  96. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  97. package/src/sap/ui/core/Locale.js +1 -1
  98. package/src/sap/ui/core/LocaleData.js +43 -37
  99. package/src/sap/ui/core/Manifest.js +2 -2
  100. package/src/sap/ui/core/Message.js +1 -1
  101. package/src/sap/ui/core/RenderManager.js +41 -32
  102. package/src/sap/ui/core/Renderer.js +1 -1
  103. package/src/sap/ui/core/ResizeHandler.js +1 -1
  104. package/src/sap/ui/core/ScrollBar.js +1 -1
  105. package/src/sap/ui/core/SeparatorItem.js +1 -1
  106. package/src/sap/ui/core/StaticArea.js +0 -1
  107. package/src/sap/ui/core/Title.js +1 -1
  108. package/src/sap/ui/core/TooltipBase.js +1 -1
  109. package/src/sap/ui/core/UIArea.js +1 -1
  110. package/src/sap/ui/core/UIComponent.js +3 -3
  111. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  112. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  113. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  114. package/src/sap/ui/core/XMLComposite.js +1 -1
  115. package/src/sap/ui/core/XMLCompositeMetadata.js +4 -4
  116. package/src/sap/ui/core/XMLTemplateProcessor.js +3 -3
  117. package/src/sap/ui/core/_IconRegistry.js +1 -1
  118. package/src/sap/ui/core/cldr/ar.json +5 -1
  119. package/src/sap/ui/core/cldr/ar_EG.json +5 -1
  120. package/src/sap/ui/core/cldr/ar_SA.json +5 -1
  121. package/src/sap/ui/core/cldr/bg.json +4 -0
  122. package/src/sap/ui/core/cldr/ca.json +4 -0
  123. package/src/sap/ui/core/cldr/cnr.json +4 -0
  124. package/src/sap/ui/core/cldr/cs.json +4 -0
  125. package/src/sap/ui/core/cldr/cy.json +4 -0
  126. package/src/sap/ui/core/cldr/da.json +4 -0
  127. package/src/sap/ui/core/cldr/de.json +4 -0
  128. package/src/sap/ui/core/cldr/de_AT.json +4 -0
  129. package/src/sap/ui/core/cldr/de_CH.json +4 -0
  130. package/src/sap/ui/core/cldr/el.json +4 -0
  131. package/src/sap/ui/core/cldr/el_CY.json +4 -0
  132. package/src/sap/ui/core/cldr/en.json +4 -0
  133. package/src/sap/ui/core/cldr/en_AU.json +4 -0
  134. package/src/sap/ui/core/cldr/en_GB.json +4 -0
  135. package/src/sap/ui/core/cldr/en_HK.json +5 -1
  136. package/src/sap/ui/core/cldr/en_IE.json +4 -0
  137. package/src/sap/ui/core/cldr/en_IN.json +5 -1
  138. package/src/sap/ui/core/cldr/en_NZ.json +4 -0
  139. package/src/sap/ui/core/cldr/en_PG.json +4 -0
  140. package/src/sap/ui/core/cldr/en_SG.json +5 -1
  141. package/src/sap/ui/core/cldr/en_ZA.json +4 -0
  142. package/src/sap/ui/core/cldr/es.json +4 -0
  143. package/src/sap/ui/core/cldr/es_AR.json +4 -0
  144. package/src/sap/ui/core/cldr/es_BO.json +4 -0
  145. package/src/sap/ui/core/cldr/es_CL.json +4 -0
  146. package/src/sap/ui/core/cldr/es_CO.json +4 -0
  147. package/src/sap/ui/core/cldr/es_MX.json +4 -0
  148. package/src/sap/ui/core/cldr/es_PE.json +4 -0
  149. package/src/sap/ui/core/cldr/es_UY.json +4 -0
  150. package/src/sap/ui/core/cldr/es_VE.json +4 -0
  151. package/src/sap/ui/core/cldr/et.json +4 -0
  152. package/src/sap/ui/core/cldr/fa.json +6 -3
  153. package/src/sap/ui/core/cldr/fi.json +4 -0
  154. package/src/sap/ui/core/cldr/fr.json +4 -0
  155. package/src/sap/ui/core/cldr/fr_BE.json +4 -0
  156. package/src/sap/ui/core/cldr/fr_CA.json +4 -0
  157. package/src/sap/ui/core/cldr/fr_CH.json +4 -0
  158. package/src/sap/ui/core/cldr/fr_LU.json +4 -0
  159. package/src/sap/ui/core/cldr/he.json +6 -3
  160. package/src/sap/ui/core/cldr/hi.json +5 -1
  161. package/src/sap/ui/core/cldr/hr.json +4 -0
  162. package/src/sap/ui/core/cldr/hu.json +4 -0
  163. package/src/sap/ui/core/cldr/id.json +5 -1
  164. package/src/sap/ui/core/cldr/it.json +4 -0
  165. package/src/sap/ui/core/cldr/it_CH.json +4 -0
  166. package/src/sap/ui/core/cldr/ja.json +5 -1
  167. package/src/sap/ui/core/cldr/kk.json +4 -0
  168. package/src/sap/ui/core/cldr/ko.json +5 -1
  169. package/src/sap/ui/core/cldr/lt.json +4 -0
  170. package/src/sap/ui/core/cldr/lv.json +4 -0
  171. package/src/sap/ui/core/cldr/mk.json +4 -0
  172. package/src/sap/ui/core/cldr/ms.json +5 -1
  173. package/src/sap/ui/core/cldr/nb.json +5 -2
  174. package/src/sap/ui/core/cldr/nl.json +4 -0
  175. package/src/sap/ui/core/cldr/nl_BE.json +4 -0
  176. package/src/sap/ui/core/cldr/pl.json +4 -0
  177. package/src/sap/ui/core/cldr/pt.json +4 -0
  178. package/src/sap/ui/core/cldr/pt_PT.json +4 -0
  179. package/src/sap/ui/core/cldr/ro.json +4 -0
  180. package/src/sap/ui/core/cldr/ru.json +4 -0
  181. package/src/sap/ui/core/cldr/ru_UA.json +4 -0
  182. package/src/sap/ui/core/cldr/sk.json +4 -0
  183. package/src/sap/ui/core/cldr/sl.json +4 -0
  184. package/src/sap/ui/core/cldr/sr.json +4 -0
  185. package/src/sap/ui/core/cldr/sr_Latn.json +6 -2
  186. package/src/sap/ui/core/cldr/sv.json +4 -0
  187. package/src/sap/ui/core/cldr/th.json +5 -1
  188. package/src/sap/ui/core/cldr/tr.json +5 -1
  189. package/src/sap/ui/core/cldr/uk.json +4 -0
  190. package/src/sap/ui/core/cldr/vi.json +4 -0
  191. package/src/sap/ui/core/cldr/zh_CN.json +5 -1
  192. package/src/sap/ui/core/cldr/zh_HK.json +6 -3
  193. package/src/sap/ui/core/cldr/zh_SG.json +6 -3
  194. package/src/sap/ui/core/cldr/zh_TW.json +5 -1
  195. package/src/sap/ui/core/date/UI5Date.js +1 -1
  196. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  197. package/src/sap/ui/core/delegate/ScrollEnablement.js +1 -1
  198. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  199. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  200. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  201. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  202. package/src/sap/ui/core/fieldhelp/FieldHelp.js +8 -10
  203. package/src/sap/ui/core/fieldhelp/FieldHelpCustomData.js +88 -0
  204. package/src/sap/ui/core/fieldhelp/FieldHelpUtil.js +22 -26
  205. package/src/sap/ui/core/format/FormatUtils.js +1 -1
  206. package/src/sap/ui/core/format/NumberFormat.js +17 -24
  207. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  208. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  209. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  210. package/src/sap/ui/core/library.js +5 -7
  211. package/src/sap/ui/core/library.support.js +10 -1
  212. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  213. package/src/sap/ui/core/message/Message.js +1 -1
  214. package/src/sap/ui/core/message/MessageManager.js +1 -1
  215. package/src/sap/ui/core/message/MessageParser.js +1 -1
  216. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  217. package/src/sap/ui/core/messagebundle.properties +6 -12
  218. package/src/sap/ui/core/messagebundle_ar.properties +3 -6
  219. package/src/sap/ui/core/messagebundle_bg.properties +3 -6
  220. package/src/sap/ui/core/messagebundle_ca.properties +3 -6
  221. package/src/sap/ui/core/messagebundle_cnr.properties +3 -6
  222. package/src/sap/ui/core/messagebundle_cs.properties +3 -6
  223. package/src/sap/ui/core/messagebundle_cy.properties +3 -6
  224. package/src/sap/ui/core/messagebundle_da.properties +3 -6
  225. package/src/sap/ui/core/messagebundle_de.properties +3 -6
  226. package/src/sap/ui/core/messagebundle_el.properties +3 -6
  227. package/src/sap/ui/core/messagebundle_en.properties +3 -6
  228. package/src/sap/ui/core/messagebundle_en_GB.properties +3 -6
  229. package/src/sap/ui/core/messagebundle_en_US_saprigi.properties +3 -6
  230. package/src/sap/ui/core/messagebundle_es.properties +3 -6
  231. package/src/sap/ui/core/messagebundle_es_MX.properties +3 -6
  232. package/src/sap/ui/core/messagebundle_et.properties +3 -6
  233. package/src/sap/ui/core/messagebundle_fi.properties +3 -6
  234. package/src/sap/ui/core/messagebundle_fr.properties +3 -6
  235. package/src/sap/ui/core/messagebundle_fr_CA.properties +3 -6
  236. package/src/sap/ui/core/messagebundle_hi.properties +3 -6
  237. package/src/sap/ui/core/messagebundle_hr.properties +3 -6
  238. package/src/sap/ui/core/messagebundle_hu.properties +3 -6
  239. package/src/sap/ui/core/messagebundle_id.properties +3 -6
  240. package/src/sap/ui/core/messagebundle_it.properties +53 -56
  241. package/src/sap/ui/core/messagebundle_iw.properties +3 -6
  242. package/src/sap/ui/core/messagebundle_ja.properties +3 -6
  243. package/src/sap/ui/core/messagebundle_kk.properties +3 -6
  244. package/src/sap/ui/core/messagebundle_ko.properties +3 -6
  245. package/src/sap/ui/core/messagebundle_lt.properties +3 -6
  246. package/src/sap/ui/core/messagebundle_lv.properties +3 -6
  247. package/src/sap/ui/core/messagebundle_mk.properties +3 -6
  248. package/src/sap/ui/core/messagebundle_ms.properties +3 -6
  249. package/src/sap/ui/core/messagebundle_nl.properties +3 -6
  250. package/src/sap/ui/core/messagebundle_no.properties +4 -7
  251. package/src/sap/ui/core/messagebundle_pl.properties +3 -6
  252. package/src/sap/ui/core/messagebundle_pt.properties +3 -6
  253. package/src/sap/ui/core/messagebundle_pt_PT.properties +3 -6
  254. package/src/sap/ui/core/messagebundle_ro.properties +3 -6
  255. package/src/sap/ui/core/messagebundle_ru.properties +3 -6
  256. package/src/sap/ui/core/messagebundle_sh.properties +3 -6
  257. package/src/sap/ui/core/messagebundle_sk.properties +3 -6
  258. package/src/sap/ui/core/messagebundle_sl.properties +3 -6
  259. package/src/sap/ui/core/messagebundle_sr.properties +3 -6
  260. package/src/sap/ui/core/messagebundle_sv.properties +3 -6
  261. package/src/sap/ui/core/messagebundle_th.properties +3 -6
  262. package/src/sap/ui/core/messagebundle_tr.properties +3 -6
  263. package/src/sap/ui/core/messagebundle_uk.properties +3 -6
  264. package/src/sap/ui/core/messagebundle_vi.properties +3 -6
  265. package/src/sap/ui/core/messagebundle_zh_CN.properties +3 -6
  266. package/src/sap/ui/core/messagebundle_zh_TW.properties +3 -6
  267. package/src/sap/ui/core/mvc/Controller.js +2 -2
  268. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  269. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  270. package/src/sap/ui/core/mvc/JSView.js +1 -1
  271. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  272. package/src/sap/ui/core/mvc/View.js +3 -3
  273. package/src/sap/ui/core/mvc/XMLView.js +2 -2
  274. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  275. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  276. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  277. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  278. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  279. package/src/sap/ui/core/routing/Route.js +4 -4
  280. package/src/sap/ui/core/routing/Router.js +5 -5
  281. package/src/sap/ui/core/routing/Targets.js +3 -3
  282. package/src/sap/ui/core/routing/async/Target.js +1 -1
  283. package/src/sap/ui/core/routing/async/Targets.js +2 -2
  284. package/src/sap/ui/core/rules/App.support.js +13 -2
  285. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  286. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  287. package/src/sap/ui/core/service/Service.js +1 -1
  288. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  289. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  290. package/src/sap/ui/core/support/Plugin.js +1 -1
  291. package/src/sap/ui/core/support/Support.js +1 -1
  292. package/src/sap/ui/core/support/ToolsAPI.js +4 -2
  293. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  294. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  295. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  296. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  297. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  298. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  299. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  300. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  301. package/src/sap/ui/core/themes/base/base.less +4238 -122
  302. package/src/sap/ui/core/themes/base/global.less +460 -7
  303. package/src/sap/ui/core/themes/base/skeleton.less +454 -3
  304. package/src/sap/ui/core/themes/sap_hcb/global.less +493 -40
  305. package/src/sap/ui/core/theming/Parameters.js +6 -6
  306. package/src/sap/ui/core/theming/ThemeHelper.js +16 -13
  307. package/src/sap/ui/core/theming/ThemeManager.js +1 -1
  308. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  309. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  310. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  311. package/src/sap/ui/core/tmpl/Template.js +1 -1
  312. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  313. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  314. package/src/sap/ui/core/util/Export.js +1 -1
  315. package/src/sap/ui/core/util/ExportCell.js +1 -1
  316. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  317. package/src/sap/ui/core/util/ExportRow.js +1 -1
  318. package/src/sap/ui/core/util/ExportType.js +1 -1
  319. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  320. package/src/sap/ui/core/util/File.js +1 -1
  321. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  322. package/src/sap/ui/core/util/MockServer.js +1 -1
  323. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  324. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +134 -148
  325. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +165 -202
  326. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +365 -468
  327. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  328. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  329. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  330. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  331. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  332. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  333. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  334. package/src/sap/ui/core/webc/WebComponent.js +1 -1
  335. package/src/sap/ui/core/webc/WebComponentMetadata.js +1 -1
  336. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  337. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  338. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  339. package/src/sap/ui/debug/ControlTree.js +1 -1
  340. package/src/sap/ui/debug/DebugEnv.js +1 -1
  341. package/src/sap/ui/debug/PropertyList.js +1 -1
  342. package/src/sap/ui/dom/findTabbable.js +13 -6
  343. package/src/sap/ui/model/ClientModel.js +1 -1
  344. package/src/sap/ui/model/CompositeDataState.js +11 -12
  345. package/src/sap/ui/model/CompositeType.js +1 -1
  346. package/src/sap/ui/model/Context.js +0 -2
  347. package/src/sap/ui/model/DataState.js +33 -5
  348. package/src/sap/ui/model/ListBinding.js +19 -0
  349. package/src/sap/ui/model/MetaModel.js +1 -1
  350. package/src/sap/ui/model/Model.js +1 -1
  351. package/src/sap/ui/model/SelectionModel.js +1 -1
  352. package/src/sap/ui/model/SimpleType.js +1 -1
  353. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  354. package/src/sap/ui/model/Type.js +1 -1
  355. package/src/sap/ui/model/_Helper.js +3 -1
  356. package/src/sap/ui/model/json/JSONModel.js +12 -1
  357. package/src/sap/ui/model/message/MessageModel.js +1 -1
  358. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  359. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  360. package/src/sap/ui/model/odata/ODataMetaModel.js +116 -35
  361. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  362. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  363. package/src/sap/ui/model/odata/ODataTreeBindingFlat.js +106 -19
  364. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  365. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  366. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  367. package/src/sap/ui/model/odata/type/Date.js +1 -1
  368. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  369. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  370. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  371. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  372. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  373. package/src/sap/ui/model/odata/type/Double.js +1 -1
  374. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  375. package/src/sap/ui/model/odata/type/Int.js +1 -1
  376. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  377. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  378. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  379. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  380. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  381. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  382. package/src/sap/ui/model/odata/type/Single.js +1 -1
  383. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  384. package/src/sap/ui/model/odata/type/String.js +1 -1
  385. package/src/sap/ui/model/odata/type/Time.js +1 -1
  386. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  387. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  388. package/src/sap/ui/model/odata/type/UnitMixin.js +14 -9
  389. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  390. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  391. package/src/sap/ui/model/odata/v2/ODataListBinding.js +21 -6
  392. package/src/sap/ui/model/odata/v2/ODataModel.js +109 -8
  393. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +1 -1
  394. package/src/sap/ui/model/odata/v4/Context.js +63 -14
  395. package/src/sap/ui/model/odata/v4/ODataBinding.js +10 -0
  396. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  397. package/src/sap/ui/model/odata/v4/ODataListBinding.js +135 -98
  398. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +20 -10
  399. package/src/sap/ui/model/odata/v4/ODataModel.js +62 -4
  400. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  401. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +141 -51
  402. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +53 -19
  403. package/src/sap/ui/model/odata/v4/lib/_Cache.js +152 -37
  404. package/src/sap/ui/model/odata/v4/lib/_Helper.js +70 -9
  405. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +44 -7
  406. package/src/sap/ui/model/odata/v4/lib/_TreeState.js +57 -40
  407. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  408. package/src/sap/ui/model/type/Boolean.js +1 -1
  409. package/src/sap/ui/model/type/Currency.js +1 -1
  410. package/src/sap/ui/model/type/Date.js +3 -2
  411. package/src/sap/ui/model/type/DateInterval.js +3 -2
  412. package/src/sap/ui/model/type/DateTime.js +1 -1
  413. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  414. package/src/sap/ui/model/type/FileSize.js +1 -1
  415. package/src/sap/ui/model/type/Float.js +1 -1
  416. package/src/sap/ui/model/type/Integer.js +1 -1
  417. package/src/sap/ui/model/type/String.js +1 -1
  418. package/src/sap/ui/model/type/Time.js +1 -1
  419. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  420. package/src/sap/ui/model/type/Unit.js +1 -1
  421. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  422. package/src/sap/ui/performance/trace/FESR.js +19 -10
  423. package/src/sap/ui/performance/trace/Interaction.js +45 -659
  424. package/src/sap/ui/performance/trace/_InteractionImpl.js +705 -0
  425. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  426. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  427. package/src/sap/ui/test/TestUtils.js +51 -24
  428. package/src/sap/ui/test/generic/TestBase.js +1 -1
  429. package/src/sap/ui/test/gherkin/opa5TestHarness.js +6 -2
  430. package/src/sap/ui/util/Storage.js +1 -1
  431. package/src/sap/ui/util/_enforceNoReturnValue.js +1 -1
  432. package/src/ui5loader.js +1 -1
@@ -7,62 +7,26 @@
7
7
  */
8
8
 
9
9
  sap.ui.define([
10
- "./BaseTreeModifier",
11
- "sap/ui/base/ManagedObject",
12
- "sap/ui/base/DataType",
13
- "sap/base/util/merge",
14
- "sap/ui/util/XMLHelper",
15
- "sap/ui/core/mvc/EventHandlerResolver",
16
- "sap/base/util/ObjectPath",
17
10
  "sap/base/util/isPlainObject",
18
- "sap/ui/core/Fragment"
11
+ "sap/base/util/merge",
12
+ "sap/ui/base/DataType",
13
+ "sap/ui/base/ManagedObject",
14
+ "sap/ui/core/util/reflection/BaseTreeModifier",
15
+ "sap/ui/core/Fragment",
16
+ "sap/ui/util/XMLHelper"
19
17
  ], function(
20
- BaseTreeModifier,
21
- ManagedObject,
22
- DataType,
23
- merge,
24
- XMLHelper,
25
- EventHandlerResolver,
26
- ObjectPath,
27
18
  isPlainObject,
28
- Fragment
19
+ merge,
20
+ DataType,
21
+ ManagedObject,
22
+ BaseTreeModifier,
23
+ Fragment,
24
+ XMLHelper
29
25
  ) {
30
26
 
31
27
  "use strict";
32
28
 
33
- var CUSTOM_DATA_NS = "http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1";
34
-
35
- async function insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode) {
36
- let oAggregationNode;
37
- if (!oFoundAggregationNode) {
38
- // named aggregation must have the same namespace as the parent
39
- const sNamespaceURI = oParent.namespaceURI;
40
- // no ids for aggregation nodes => no need to pass id or component
41
- oAggregationNode = await this.createControl(sNamespaceURI + "." + sName, undefined, oView);
42
- oParent.appendChild(oAggregationNode);
43
- } else {
44
- oAggregationNode = oFoundAggregationNode;
45
- }
46
- if (!bSkipAdjustIndex) {
47
- const aChildren = oAggregationNode.children;
48
- let iOffset = 0;
49
- const iStopIndex = (iIndex < aChildren.length) ? iIndex : aChildren.length;
50
- for (let i = 0; i < iStopIndex; i++) {
51
- if (aChildren[i].namespaceURI === "sap.ui.core" && aChildren[i].tagName.includes("ExtensionPoint")) {
52
- iOffset = iOffset + 1 - aChildren[i].children.length;
53
- }
54
- }
55
- iIndex = iIndex + iOffset;
56
- }
57
-
58
- if (iIndex >= oAggregationNode.childElementCount) {
59
- oAggregationNode.appendChild(oObject);
60
- } else {
61
- const aReferenceNodes = await this._getControlsInAggregation(oParent, oAggregationNode);
62
- oAggregationNode.insertBefore(oObject, aReferenceNodes[iIndex]);
63
- }
64
- return undefined;
65
- }
29
+ const CUSTOM_DATA_NS = "http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1";
66
30
 
67
31
  /**
68
32
  * Static utility class to access XMLNodes like ManagedObjects,
@@ -74,7 +38,7 @@ sap.ui.define([
74
38
  * @ui5-restricted
75
39
  * @since 1.56.0
76
40
  */
77
- var XmlTreeModifier = merge(
41
+ const XmlTreeModifier = merge(
78
42
  {} /* target object, to avoid changing of original modifier */,
79
43
  BaseTreeModifier,
80
44
  /** @lends sap.ui.core.util.reflection.XmlTreeModifier */{
@@ -84,7 +48,7 @@ sap.ui.define([
84
48
  /**
85
49
  * @inheritDoc
86
50
  */
87
- setVisible: function (oControl, bVisible) {
51
+ setVisible: function(oControl, bVisible) {
88
52
  if (bVisible) {
89
53
  oControl.removeAttribute("visible");
90
54
  } else {
@@ -95,14 +59,14 @@ sap.ui.define([
95
59
  /**
96
60
  * @inheritDoc
97
61
  */
98
- getVisible: function (oControl) {
62
+ getVisible: function(oControl) {
99
63
  return XmlTreeModifier.getProperty(oControl, "visible");
100
64
  },
101
65
 
102
66
  /**
103
67
  * @inheritDoc
104
68
  */
105
- setStashed: function (oControl, bStashed) {
69
+ setStashed: function(oControl, bStashed) {
106
70
  if (!bStashed) {
107
71
  oControl.removeAttribute("stashed");
108
72
  } else {
@@ -115,11 +79,11 @@ sap.ui.define([
115
79
  /**
116
80
  * @inheritDoc
117
81
  */
118
- getStashed: function (oControl) {
82
+ getStashed: function(oControl) {
119
83
  return Promise.all([
120
84
  XmlTreeModifier.getProperty(oControl, "stashed"),
121
85
  XmlTreeModifier.getProperty(oControl, "visible")
122
- ]).then(function (aProperties) {
86
+ ]).then(function(aProperties) {
123
87
  return !!aProperties[0] || !aProperties[1];
124
88
  });
125
89
  },
@@ -127,20 +91,20 @@ sap.ui.define([
127
91
  /**
128
92
  * @inheritDoc
129
93
  */
130
- bindProperty: function (oControl, sPropertyName, vBindingInfos) {
94
+ bindProperty: function(oControl, sPropertyName, vBindingInfos) {
131
95
  oControl.setAttribute(sPropertyName, "{" + vBindingInfos + "}");
132
96
  },
133
97
 
134
98
  /**
135
99
  * @inheritDoc
136
100
  */
137
- unbindProperty: function (oControl, sPropertyName) {
101
+ unbindProperty: function(oControl, sPropertyName) {
138
102
  //reset the property
139
103
  oControl.removeAttribute(sPropertyName);
140
104
  },
141
105
 
142
- _setProperty: function (oControl, sPropertyName, vPropertyValue, bEscapeBindingStrings) {
143
- var sValue = XmlTreeModifier._getSerializedValue(vPropertyValue);
106
+ _setProperty: function(oControl, sPropertyName, vPropertyValue, bEscapeBindingStrings) {
107
+ let sValue = XmlTreeModifier._getSerializedValue(vPropertyValue);
144
108
  if (bEscapeBindingStrings) {
145
109
  sValue = XmlTreeModifier._escapeCurlyBracketsInString(sValue);
146
110
  }
@@ -150,9 +114,9 @@ sap.ui.define([
150
114
  /**
151
115
  * @inheritDoc
152
116
  */
153
- setProperty: function (oControl, sPropertyName, vPropertyValue) {
117
+ setProperty: function(oControl, sPropertyName, vPropertyValue) {
154
118
  // binding strings in properties needs always to be escaped, triggered by the last parameter.
155
- // It is required to be complient with setProperty functionality in JS case. There could be
119
+ // It is required to be compliant with setProperty functionality in JS case. There could be
156
120
  // properties provided as settings with existing bindings. Use the applySettings function in this case.
157
121
  XmlTreeModifier._setProperty(oControl, sPropertyName, vPropertyValue, true);
158
122
  },
@@ -160,64 +124,55 @@ sap.ui.define([
160
124
  /**
161
125
  * @inheritDoc
162
126
  */
163
- getProperty: function (oControl, sPropertyName) {
164
- var oPropertyInfo;
165
- var oType;
166
- var vPropertyValue = oControl.getAttribute(sPropertyName);
167
- return XmlTreeModifier.getControlMetadata(oControl)
168
- .then(function (oMetadata) {
169
- oPropertyInfo = oMetadata.getProperty(sPropertyName);
170
- if (oPropertyInfo) { //not a property like aggregation
171
- oType = oPropertyInfo.getType();
172
- if (
173
- sPropertyName === "value"
174
- && XmlTreeModifier.getControlType(oControl) === "sap.ui.core.CustomData"
175
- ) {
176
- return XmlTreeModifier.getProperty(oControl, "key")
177
- .then(function (oKeyProperty) {
178
- if (oKeyProperty === "sap-ui-custom-settings") {
179
- oType = DataType.getType("object");
180
- }
181
- });
182
- }
127
+ getProperty: async function(oControl, sPropertyName) {
128
+ let oType;
129
+ let vPropertyValue = oControl.getAttribute(sPropertyName);
130
+ const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
131
+ const oPropertyInfo = oMetadata.getProperty(sPropertyName);
132
+ if (oPropertyInfo) { //not a property like aggregation
133
+ oType = oPropertyInfo.getType();
134
+ if (
135
+ sPropertyName === "value"
136
+ && XmlTreeModifier.getControlType(oControl) === "sap.ui.core.CustomData"
137
+ ) {
138
+ const oKeyProperty = await XmlTreeModifier.getProperty(oControl, "key");
139
+ if (oKeyProperty === "sap-ui-custom-settings") {
140
+ oType = DataType.getType("object");
183
141
  }
184
- return undefined;
185
- })
186
- .then(function () {
187
- if (oPropertyInfo) {
188
- if (vPropertyValue === null) {
189
- vPropertyValue = oPropertyInfo.getDefaultValue() || oType.getDefaultValue();
142
+ }
143
+
144
+ if (vPropertyValue === null) {
145
+ vPropertyValue = oPropertyInfo.getDefaultValue() || oType.getDefaultValue();
146
+ } else {
147
+ // unescape binding like XMLTemplateProcessor
148
+ const vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
149
+ // if it is a binding, return undefined as it has to be handled differently
150
+ if (isPlainObject(vUnescaped)) {
151
+ if (vUnescaped.path || vUnescaped.parts) {
152
+ vPropertyValue = undefined;
190
153
  } else {
191
- // unescape binding like XMLTemplateProcessor
192
- var vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
193
- // if it is a binding, return undefined as it has to be handled differently
194
- if (isPlainObject(vUnescaped)) {
195
- if (vUnescaped.path || vUnescaped.parts) {
196
- vPropertyValue = undefined;
197
- } else {
198
- vPropertyValue = vUnescaped;
199
- }
200
- } else {
201
- vPropertyValue = oType.parseValue(vUnescaped || vPropertyValue);
202
- }
154
+ vPropertyValue = vUnescaped;
203
155
  }
156
+ } else {
157
+ vPropertyValue = oType.parseValue(vUnescaped || vPropertyValue);
204
158
  }
205
- return vPropertyValue;
206
- });
159
+ }
160
+ }
161
+ return vPropertyValue;
207
162
  },
208
163
 
209
164
  /**
210
165
  * @inheritDoc
211
166
  */
212
- isPropertyInitial: function (oControl, sPropertyName) {
213
- var vPropertyValue = oControl.getAttribute(sPropertyName);
167
+ isPropertyInitial: function(oControl, sPropertyName) {
168
+ const vPropertyValue = oControl.getAttribute(sPropertyName);
214
169
  return (vPropertyValue == null);
215
170
  },
216
171
 
217
172
  /**
218
173
  * @inheritDoc
219
174
  */
220
- setPropertyBinding: function (oControl, sPropertyName, sPropertyBinding) {
175
+ setPropertyBinding: function(oControl, sPropertyName, sPropertyBinding) {
221
176
  if (typeof sPropertyBinding !== "string") {
222
177
  throw new Error("For XML, only strings are supported to be set as property binding.");
223
178
  }
@@ -227,10 +182,10 @@ sap.ui.define([
227
182
  /**
228
183
  * @inheritDoc
229
184
  */
230
- getPropertyBinding: function (oControl, sPropertyName) {
231
- var vPropertyValue = oControl.getAttribute(sPropertyName);
185
+ getPropertyBinding: function(oControl, sPropertyName) {
186
+ const vPropertyValue = oControl.getAttribute(sPropertyName);
232
187
  if (vPropertyValue) {
233
- var vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
188
+ const vUnescaped = ManagedObject.bindingParser(vPropertyValue, undefined, true);
234
189
  if (vUnescaped && (vUnescaped.path || vUnescaped.parts)) {
235
190
  return vUnescaped;
236
191
  }
@@ -250,7 +205,7 @@ sap.ui.define([
250
205
  * @inheritDoc
251
206
  */
252
207
  getCustomDataInfo: function(oControl, sCustomDataKey) {
253
- var oCustomData = oControl.attributes["custom.data.via.modifier:" + sCustomDataKey];
208
+ const oCustomData = oControl.attributes["custom.data.via.modifier:" + sCustomDataKey];
254
209
  if (oCustomData) {
255
210
  return {
256
211
  customData: oCustomData,
@@ -264,71 +219,62 @@ sap.ui.define([
264
219
  /**
265
220
  * @inheritDoc
266
221
  */
267
- createControl: function (sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
268
- var sId, sLocalName, oError;
222
+ createControl: async function(sClassName, oAppComponent, oView, oSelector, mSettings, bAsync) {
223
+ const sId = XmlTreeModifier.getControlIdBySelector(oSelector, oAppComponent);
269
224
  if (!XmlTreeModifier.bySelector(oSelector, oAppComponent, oView)) {
270
- var aClassNameParts = sClassName.split('.');
271
- var sNamespaceURI = "";
225
+ let sLocalName;
226
+ const aClassNameParts = sClassName.split('.');
227
+ let sNamespaceURI = "";
272
228
  if (aClassNameParts.length > 1) {
273
229
  sLocalName = aClassNameParts.pop();
274
230
  sNamespaceURI = aClassNameParts.join('.');
275
231
  }
276
232
 
277
- var oNewElementNode = oView.ownerDocument.createElementNS(sNamespaceURI, sLocalName);
233
+ const oNewElementNode = oView.ownerDocument.createElementNS(sNamespaceURI, sLocalName);
278
234
 
279
- sId = XmlTreeModifier.getControlIdBySelector(oSelector, oAppComponent);
280
235
  if (sId) {
281
236
  oNewElementNode.setAttribute("id", sId);
282
237
  }
283
- return Promise.resolve()
284
- .then(function () {
285
- if (mSettings) {
286
- return XmlTreeModifier.applySettings(oNewElementNode, mSettings);
287
- }
288
- return undefined;
289
- })
290
- .then(function () {
291
- return Promise.resolve(oNewElementNode);
292
- });
238
+ if (mSettings) {
239
+ await XmlTreeModifier.applySettings(oNewElementNode, mSettings);
240
+ }
241
+ return oNewElementNode;
293
242
  } else {
294
- oError = new Error("Can't create a control with duplicated ID " + sId);
295
- return Promise.reject(oError);
243
+ throw new Error("Can't create a control with duplicated ID " + sId);
296
244
  }
297
245
  },
298
246
 
299
247
  /**
300
248
  * @inheritDoc
301
249
  */
302
- applySettings: function(oControl, mSettings) {
303
- return XmlTreeModifier.getControlMetadata(oControl)
304
- .then(function (oMetadata) {
305
- var mMetadata = oMetadata.getJSONKeys();
306
- Object.keys(mSettings).forEach(function(sKey) {
307
- var oKeyInfo = mMetadata[sKey];
308
- var vValue = mSettings[sKey];
309
- switch (oKeyInfo._iKind) {
310
- case 0: // PROPERTY
311
- // Settings provided as property could have some bindings that needs to be resolved by the core
312
- // and therefore they shouldn't be escaped by setProperty function. In opposite to the common
313
- // setProperty functionality!
314
- XmlTreeModifier._setProperty(oControl, sKey, vValue, false);
315
- break;
316
- // case 1: // SINGLE_AGGREGATION
317
- // XmlTreeModifier.insertAggregation(oControl, sKey, vValue);
318
- case 3: // SINGLE_ASSOCIATION
319
- XmlTreeModifier.setAssociation(oControl, sKey, vValue);
320
- break;
321
- default:
322
- throw new Error("Unsupported in applySettings on XMLTreeModifier: " + sKey);
323
- }
324
- });
325
- });
250
+ applySettings: async function(oControl, mSettings) {
251
+ const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
252
+ const mMetadata = oMetadata.getJSONKeys();
253
+ Object.keys(mSettings).forEach(function(sKey) {
254
+ const oKeyInfo = mMetadata[sKey];
255
+ const vValue = mSettings[sKey];
256
+ switch (oKeyInfo._iKind) {
257
+ case 0: // PROPERTY
258
+ // Settings provided as property could have some bindings that needs to be resolved by the core
259
+ // and therefore they shouldn't be escaped by setProperty function. In opposite to the common
260
+ // setProperty functionality!
261
+ XmlTreeModifier._setProperty(oControl, sKey, vValue, false);
262
+ break;
263
+ // case 1: // SINGLE_AGGREGATION
264
+ // XmlTreeModifier.insertAggregation(oControl, sKey, vValue);
265
+ case 3: // SINGLE_ASSOCIATION
266
+ XmlTreeModifier.setAssociation(oControl, sKey, vValue);
267
+ break;
268
+ default:
269
+ throw new Error("Unsupported in applySettings on XMLTreeModifier: " + sKey);
270
+ }
271
+ });
326
272
  },
327
273
 
328
274
  /**
329
275
  * @inheritDoc
330
276
  */
331
- _byId: function (sId, oView) {
277
+ _byId: function(sId, oView) {
332
278
  // If function defined and operational use getElementById(sId) of document or view to access control
333
279
  // ... Note: oView.ownerDocument.getElementById(sId) may fail under IE 11 indicating "permission denied"
334
280
  if (oView) {
@@ -343,18 +289,18 @@ sap.ui.define([
343
289
  /**
344
290
  * @inheritDoc
345
291
  */
346
- getId: function (oControl) {
292
+ getId: function(oControl) {
347
293
  return oControl.getAttribute("id");
348
294
  },
349
295
 
350
296
  /**
351
297
  * @inheritDoc
352
298
  */
353
- getParent: function (oControl) {
354
- var oParent = oControl.parentNode;
299
+ getParent: function(oControl) {
300
+ const oParent = oControl.parentNode;
355
301
  if (oParent && !XmlTreeModifier.getId(oParent) && !XmlTreeModifier._isExtensionPoint(oParent)) {
356
302
  //go to the real control, jump over aggregation node
357
- oParent = oParent.parentNode;
303
+ return oParent.parentNode;
358
304
  }
359
305
 
360
306
  return oParent;
@@ -363,7 +309,7 @@ sap.ui.define([
363
309
  /**
364
310
  * @inheritDoc
365
311
  */
366
- _getLocalName: function (xmlElement) {
312
+ _getLocalName: function(xmlElement) {
367
313
  // localName for standard browsers, baseName for IE, nodeName in the absence of namespaces
368
314
  return xmlElement.localName || xmlElement.baseName || xmlElement.nodeName;
369
315
  },
@@ -371,14 +317,14 @@ sap.ui.define([
371
317
  /**
372
318
  * @inheritDoc
373
319
  */
374
- getControlType: function (oControl) {
320
+ getControlType: function(oControl) {
375
321
  return XmlTreeModifier._getControlTypeInXml(oControl);
376
322
  },
377
323
 
378
324
  /**
379
325
  * @inheritDoc
380
326
  */
381
- setAssociation: function (vParent, sName, sId) {
327
+ setAssociation: function(vParent, sName, sId) {
382
328
  if (typeof sId !== "string"){
383
329
  sId = XmlTreeModifier.getId(sId);
384
330
  }
@@ -388,96 +334,82 @@ sap.ui.define([
388
334
  /**
389
335
  * @inheritDoc
390
336
  */
391
- getAssociation: function (vParent, sName) {
337
+ getAssociation: function(vParent, sName) {
392
338
  return vParent.getAttribute(sName);
393
339
  },
394
340
 
395
341
  /**
396
342
  * @inheritDoc
397
343
  */
398
- getAllAggregations: function (oControl) {
399
- return XmlTreeModifier.getControlMetadata(oControl)
400
- .then(function (oControlMetadata) {
401
- return oControlMetadata.getAllAggregations();
402
- });
344
+ getAllAggregations: async function(oControl) {
345
+ const oControlMetadata = await XmlTreeModifier.getControlMetadata(oControl);
346
+ return oControlMetadata.getAllAggregations();
403
347
  },
404
348
 
405
349
  /**
406
350
  * @inheritDoc
407
351
  */
408
- getAggregation: function (oParent, sName) {
409
- var aChildren = [];
410
- var bSingleValueAggregation;
411
- return XmlTreeModifier._isSingleValueAggregation(oParent, sName)
412
- .then(function (bSingleValueAggregationReturn) {
413
- bSingleValueAggregation = bSingleValueAggregationReturn;
414
- return XmlTreeModifier._findAggregationNode(oParent, sName);
415
- })
416
- .then(function (oAggregationNode) {
417
- if (oAggregationNode) {
418
- return XmlTreeModifier._getControlsInAggregation(oParent, oAggregationNode)
419
- .then(function (aChildrenLocal) {
420
- aChildren = aChildrenLocal;
421
- });
422
- }
423
- return XmlTreeModifier._isAltTypeAggregation(oParent, sName)
424
- .then(function (isAltTypeAggregation) {
425
- if (isAltTypeAggregation && bSingleValueAggregation) {
426
- return XmlTreeModifier.getProperty(oParent, sName)
427
- .then(function (oChild) {
428
- aChildren.push(oChild);
429
- });
430
- }
431
- return undefined;
432
- });
433
- })
434
- .then(function () {
435
- if (sName === "customData") {
436
- //check namespaced attributes:
437
- var mCustomSettings;
438
- var aNewCustomData = Array.prototype.slice.call(oParent.attributes).reduce(function(aNamespacedCustomData, oAttribute) {
439
- var sLocalName = XmlTreeModifier._getLocalName(oAttribute);
440
- if (oAttribute.namespaceURI === CUSTOM_DATA_NS) {
441
- var oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
442
- oNewCustomData.setAttribute("key", sLocalName);
443
- oNewCustomData.setAttribute("value", oAttribute.value);
444
- aNamespacedCustomData.push(oNewCustomData);
445
- } else if (oAttribute.namespaceURI && oAttribute.name.indexOf("xmlns:") !== 0 ) { // other, unknown namespace and not an xml namespace alias definition
446
- if (!mCustomSettings) {
447
- mCustomSettings = {};
448
- }
449
- if (!mCustomSettings.hasOwnProperty(oAttribute.namespaceURI)) {
450
- mCustomSettings[oAttribute.namespaceURI] = {};
451
- }
452
- mCustomSettings[oAttribute.namespaceURI][sLocalName] = oAttribute.nodeValue;
453
- }
454
- return aNamespacedCustomData;
455
- }, []);
456
- aChildren = aChildren.concat(aNewCustomData);
457
- //add custom settings as custom data "sap-ui-custom-settings"
458
- if (mCustomSettings) {
459
- var oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
460
- oNewCustomData.setAttribute("key", "sap-ui-custom-settings");
461
- XmlTreeModifier.setProperty(oNewCustomData, "value", mCustomSettings);
462
- aChildren.push(oNewCustomData);
352
+ getAggregation: async function(oParent, sName) {
353
+ let aChildren = [];
354
+ const bSingleValueAggregation = await XmlTreeModifier._isSingleValueAggregation(oParent, sName);
355
+ const oAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
356
+ if (oAggregationNode) {
357
+ const aChildrenLocal = await XmlTreeModifier._getControlsInAggregation(oParent, oAggregationNode);
358
+ aChildren = aChildrenLocal;
359
+ } else {
360
+ const bIsAltTypeAggregation = await XmlTreeModifier._isAltTypeAggregation(oParent, sName);
361
+ if (bIsAltTypeAggregation && bSingleValueAggregation) {
362
+ const oChild = await XmlTreeModifier.getProperty(oParent, sName);
363
+ aChildren.push(oChild);
364
+ }
365
+ }
366
+
367
+
368
+ if (sName === "customData") {
369
+ //check namespaced attributes:
370
+ let mCustomSettings;
371
+ const aNewCustomData = Array.prototype.slice.call(oParent.attributes).reduce(function(aNamespacedCustomData, oAttribute) {
372
+ const sLocalName = XmlTreeModifier._getLocalName(oAttribute);
373
+ if (oAttribute.namespaceURI === CUSTOM_DATA_NS) {
374
+ const oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
375
+ oNewCustomData.setAttribute("key", sLocalName);
376
+ oNewCustomData.setAttribute("value", oAttribute.value);
377
+ aNamespacedCustomData.push(oNewCustomData);
378
+ } else if (oAttribute.namespaceURI && oAttribute.name.indexOf("xmlns:") !== 0 ) { // other, unknown namespace and not an xml namespace alias definition
379
+ if (!mCustomSettings) {
380
+ mCustomSettings = {};
381
+ }
382
+ if (!mCustomSettings.hasOwnProperty(oAttribute.namespaceURI)) {
383
+ mCustomSettings[oAttribute.namespaceURI] = {};
463
384
  }
385
+ mCustomSettings[oAttribute.namespaceURI][sLocalName] = oAttribute.nodeValue;
464
386
  }
465
- return bSingleValueAggregation ? aChildren[0] : aChildren;
466
- });
387
+ return aNamespacedCustomData;
388
+ }, []);
389
+ aChildren = aChildren.concat(aNewCustomData);
390
+ //add custom settings as custom data "sap-ui-custom-settings"
391
+ if (mCustomSettings) {
392
+ const oNewCustomData = oParent.ownerDocument.createElementNS("sap.ui.core","CustomData");
393
+ oNewCustomData.setAttribute("key", "sap-ui-custom-settings");
394
+ XmlTreeModifier.setProperty(oNewCustomData, "value", mCustomSettings);
395
+ aChildren.push(oNewCustomData);
396
+ }
397
+ }
398
+ return bSingleValueAggregation ? aChildren[0] : aChildren;
467
399
  },
468
400
 
469
401
  /**
470
402
  * @inheritDoc
471
403
  */
472
- insertAggregation: async function (oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex) {
404
+ insertAggregation: async function(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex) {
473
405
  const oFoundAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
474
- return insertAggregation.call(this, oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode);
406
+ return insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode);
475
407
  },
476
408
 
477
409
  /**
478
410
  * @inheritDoc
479
411
  */
480
- removeAggregation: async function (oParent, sName, oObject) {
412
+ removeAggregation: async function(oParent, sName, oObject) {
481
413
  const oAggregationNode = await XmlTreeModifier._findAggregationNode(oParent, sName);
482
414
  oAggregationNode.removeChild(oObject);
483
415
  },
@@ -490,7 +422,7 @@ sap.ui.define([
490
422
  const oTargetAggregationNode = await XmlTreeModifier._findAggregationNode(oTargetParent, sTargetAggregationName);
491
423
 
492
424
  oSourceAggregationNode.removeChild(oObject);
493
- await insertAggregation.call(this, oTargetParent, sTargetAggregationName, oObject, iIndex, oView, bSkipAdjustIndex, oTargetAggregationNode);
425
+ await insertAggregation(oTargetParent, sTargetAggregationName, oObject, iIndex, oView, bSkipAdjustIndex, oTargetAggregationNode);
494
426
  },
495
427
 
496
428
  /**
@@ -510,98 +442,80 @@ sap.ui.define([
510
442
  /**
511
443
  * @inheritDoc
512
444
  */
513
- removeAllAggregation: function (oControl, sName) {
514
- return XmlTreeModifier._findAggregationNode(oControl, sName)
515
- .then(function (oAggregationNode) {
516
- if (oControl === oAggregationNode) {
517
- return XmlTreeModifier._getControlsInAggregation(oControl, oControl)
518
- .then(function (aChildControls) {
519
- aChildControls.forEach(function(oChildControl) {
520
- oControl.removeChild(oChildControl);
521
- });
522
- });
523
- }
524
- return oControl.removeChild(oAggregationNode);
445
+ removeAllAggregation: async function(oControl, sName) {
446
+ const oAggregationNode = await XmlTreeModifier._findAggregationNode(oControl, sName);
447
+ if (oControl === oAggregationNode) {
448
+ const aChildControls = await XmlTreeModifier._getControlsInAggregation(oControl, oControl);
449
+ aChildControls.forEach(function(oChildControl) {
450
+ oControl.removeChild(oChildControl);
525
451
  });
452
+ } else {
453
+ return oControl.removeChild(oAggregationNode);
454
+ }
526
455
  },
527
456
 
528
457
  /**
529
458
  * @private
530
459
  */
531
- _findAggregationNode: function (oParent, sName) {
532
- var oAggregationNode;
533
- var aChildren = XmlTreeModifier._children(oParent);
534
- for (var i = 0; i < aChildren.length; i++) {
535
- var oNode = aChildren[i];
460
+ _findAggregationNode: async function(oParent, sName) {
461
+ let oAggregationNode;
462
+ const aChildren = XmlTreeModifier._children(oParent);
463
+ for (let i = 0; i < aChildren.length; i++) {
464
+ const oNode = aChildren[i];
536
465
  if (oNode.localName === sName) {
537
466
  oAggregationNode = oNode;
538
467
  break;
539
468
  }
540
469
  }
541
- var oPromise = Promise.resolve(oAggregationNode);
542
470
  if (!oAggregationNode) {
543
- oPromise = oPromise
544
- .then(XmlTreeModifier._isDefaultAggregation.bind(XmlTreeModifier, oParent, sName))
545
- .then(function (bIsDefaultAggregation) {
546
- if (bIsDefaultAggregation) {
547
- return oParent;
548
- }
549
- return oAggregationNode;
550
- });
471
+ const bIsDefaultAggregation = await XmlTreeModifier._isDefaultAggregation(oParent, sName);
472
+ if (bIsDefaultAggregation) {
473
+ return oParent;
474
+ }
551
475
  }
552
- return oPromise;
476
+ return oAggregationNode;
553
477
  },
554
478
 
555
479
  /**
556
480
  * @private
557
481
  */
558
- _isDefaultAggregation: function(oParent, sAggregationName) {
559
- return XmlTreeModifier.getControlMetadata(oParent)
560
- .then(function (oControlMetadata) {
561
- var oDefaultAggregation = oControlMetadata.getDefaultAggregation();
562
- return oDefaultAggregation && sAggregationName === oDefaultAggregation.name;
563
- });
482
+ _isDefaultAggregation: async function(oParent, sAggregationName) {
483
+ const oControlMetadata = await XmlTreeModifier.getControlMetadata(oParent);
484
+ const oDefaultAggregation = oControlMetadata.getDefaultAggregation();
485
+ return oDefaultAggregation && sAggregationName === oDefaultAggregation.name;
564
486
  },
565
487
 
566
488
  /**
567
489
  * @private
568
490
  */
569
- _isNotNamedAggregationNode: function(oParent, oChildNode) {
570
- return XmlTreeModifier.getAllAggregations(oParent)
571
- .then(function (mAllAggregatiosnMetadata) {
572
- var oAggregation = mAllAggregatiosnMetadata[oChildNode.localName];
573
- return oParent.namespaceURI !== oChildNode.namespaceURI || !oAggregation; //same check as in XMLTemplateProcessor (handleChild)
574
- });
491
+ _isNotNamedAggregationNode: async function(oParent, oChildNode) {
492
+ const mAllAggregationsMetadata = await XmlTreeModifier.getAllAggregations(oParent);
493
+ const oAggregation = mAllAggregationsMetadata[oChildNode.localName];
494
+ return oParent.namespaceURI !== oChildNode.namespaceURI || !oAggregation; //same check as in XMLTemplateProcessor (handleChild)
575
495
  },
576
496
 
577
497
  /**
578
498
  * @private
579
499
  */
580
- _isSingleValueAggregation: function(oParent, sAggregationName) {
581
- return XmlTreeModifier.getAllAggregations(oParent)
582
- .then(function (mAllAggregatiosnMetadata) {
583
- var oAggregationMetadata = mAllAggregatiosnMetadata[sAggregationName];
584
- return !oAggregationMetadata.multiple;
585
- });
500
+ _isSingleValueAggregation: async function(oParent, sAggregationName) {
501
+ const mAllAggregationsMetadata = await XmlTreeModifier.getAllAggregations(oParent);
502
+ const oAggregationMetadata = mAllAggregationsMetadata[sAggregationName];
503
+ return !oAggregationMetadata.multiple;
586
504
  },
587
505
 
588
506
  /**
589
507
  * @private
590
508
  */
591
- _isAltTypeAggregation: function(oParent, sAggregationName) {
592
- return XmlTreeModifier.getControlMetadata(oParent)
593
- .then(function (oControlMetadata) {
594
- return oControlMetadata.getAllAggregations()[sAggregationName];
595
- })
596
- .then(function (oAggregationMetadata) {
597
- return !!oAggregationMetadata.altTypes;
598
- });
509
+ _isAltTypeAggregation: async function(oParent, sAggregationName) {
510
+ const oControlMetadata = await XmlTreeModifier.getControlMetadata(oParent);
511
+ const oAggregationMetadata = oControlMetadata.getAllAggregations()[sAggregationName];
512
+ return !!oAggregationMetadata.altTypes;
599
513
  },
600
514
 
601
515
  /**
602
516
  * @private
603
517
  */
604
- _isExtensionPoint: function (oControl) {
518
+ _isExtensionPoint: function(oControl) {
605
519
  return XmlTreeModifier._getControlTypeInXml(oControl) === "sap.ui.core.ExtensionPoint";
606
520
  },
607
521
 
@@ -615,30 +529,26 @@ sap.ui.define([
615
529
  /**
616
530
  * @private
617
531
  */
618
- _getControlsInAggregation: function(oParent, oAggregationNode) {
619
- //convert NodeList to Array
620
- var aChildren = Array.prototype.slice.call(XmlTreeModifier._children(oAggregationNode));
621
- return Promise.all(aChildren.map(function (oChild) {
622
- return XmlTreeModifier._isNotNamedAggregationNode(oParent, oChild)
623
- .then(function (bIsNotNamedAggregationNode) {
624
- return bIsNotNamedAggregationNode ? oChild : undefined;
625
- });
626
- }))
627
- .then(function (aChildren) {
628
- return aChildren.filter(function (oChild) { return !!oChild; });
629
- });
532
+ _getControlsInAggregation: async function(oParent, oAggregationNode) {
533
+ // //convert NodeList to Array
534
+ const aXmlChildren = [].slice.call(XmlTreeModifier._children(oAggregationNode));
535
+ const aChildren = await Promise.all(aXmlChildren.map(async (oChild) => {
536
+ const bIsNotNamedAggregationNode = await XmlTreeModifier._isNotNamedAggregationNode(oParent, oChild);
537
+ return bIsNotNamedAggregationNode ? oChild : undefined;
538
+ }));
539
+ return aChildren.filter((oChild) => !!oChild);
630
540
  },
631
541
 
632
542
  /**
633
543
  * @private
634
544
  */
635
- _children: function (oParent) {
545
+ _children: function(oParent) {
636
546
  if (oParent.children) {
637
547
  return oParent.children;
638
548
  } else {
639
- var aChildren = [];
640
- for (var i = 0; i < oParent.childNodes.length; i++) {
641
- var oNode = oParent.childNodes[i];
549
+ const aChildren = [];
550
+ for (let i = 0; i < oParent.childNodes.length; i++) {
551
+ const oNode = oParent.childNodes[i];
642
552
  if (oNode.nodeType === oNode.ELEMENT_NODE) {
643
553
  aChildren.push(oNode);
644
554
  }
@@ -650,193 +560,157 @@ sap.ui.define([
650
560
  /**
651
561
  * @inheritDoc
652
562
  */
653
- getBindingTemplate: function (oControl, sAggregationName) {
654
- return XmlTreeModifier._findAggregationNode(oControl, sAggregationName)
655
- .then(function (oAggregationNode) {
656
- if (oAggregationNode) {
657
- var aChildren = XmlTreeModifier._children(oAggregationNode);
658
- if (aChildren.length === 1){
659
- return aChildren[0];
660
- }
661
- }
662
- return undefined;
663
- });
563
+ getBindingTemplate: async function(oControl, sAggregationName) {
564
+ const oAggregationNode = await XmlTreeModifier._findAggregationNode(oControl, sAggregationName);
565
+ if (oAggregationNode) {
566
+ const aChildren = XmlTreeModifier._children(oAggregationNode);
567
+ if (aChildren.length === 1){
568
+ return aChildren[0];
569
+ }
570
+ }
571
+ return undefined;
664
572
  },
665
573
 
666
574
  /**
667
575
  * @inheritDoc
668
576
  */
669
- updateAggregation: function (oControl, sAggregationName) {
577
+ updateAggregation: function(oControl, sAggregationName) {
670
578
  /*only needed in JS case to indicate binding (template) has changed, in XML case binding has not been created yet (see managed object)*/
671
579
  },
672
580
 
673
581
  /**
674
582
  * @inheritDoc
675
583
  */
676
- findIndexInParentAggregation: function (oControl) {
584
+ findIndexInParentAggregation: async function(oControl) {
677
585
  // find the parent
678
- var oParent = XmlTreeModifier.getParent(oControl);
586
+ const oParent = XmlTreeModifier.getParent(oControl);
679
587
 
680
588
  if (!oParent) {
681
- return Promise.resolve(-1);
589
+ return -1;
682
590
  }
683
591
 
684
592
  // we need the aggregation name in order to find all control nodes in the parent
685
593
  // which are relevant to this aggregation and skip all other possible nodes
686
- return XmlTreeModifier.getParentAggregationName(oControl, oParent)
687
- .then(function (sAggregationName) {
688
- // get the relevant controls from the aggregation node
689
- return XmlTreeModifier.getAggregation(oParent, sAggregationName);
690
- })
691
- .then(function (aControlsInAggregation) {
692
- // if the result from the above is array:
693
- if (Array.isArray(aControlsInAggregation)) {
694
- // to harmonize behavior with JSControlTree, where stashed controls are not added to the parent aggregation
695
- var aPromises = aControlsInAggregation.map(function (oControl) {
696
- return Promise.resolve()
697
- .then(function () {
698
- if (XmlTreeModifier._isExtensionPoint(oControl)) {
699
- return oControl;
700
- }
701
- return XmlTreeModifier.getProperty(oControl, "stashed")
702
- .then(function (oProperty) {
703
- return !oProperty ? oControl : undefined;
704
- });
705
- });
706
- });
707
- return Promise.all(aPromises)
708
- .then(function (aControlsInAggregation) {
709
- // find and return the correct index
710
- return aControlsInAggregation.filter(function (oControl) {
711
- return !!oControl;
712
- }).indexOf(oControl);
713
- });
714
- } else {
715
- // if aControlsInAggregation is not an array, then the aggregation is
716
- // of type 0..1 and aControlsInAggregation is the oControl provided
717
- // to the function initially, so its index is 0
718
- return 0;
594
+ const sAggregationName = await XmlTreeModifier.getParentAggregationName(oControl, oParent);
595
+ // get the relevant controls from the aggregation node
596
+ let aControlsInAggregation = await XmlTreeModifier.getAggregation(oParent, sAggregationName);
597
+ // if the result from the above is array:
598
+ if (Array.isArray(aControlsInAggregation)) {
599
+ // to harmonize behavior with JSControlTree, where stashed controls are not added to the parent aggregation
600
+ const aPromises = aControlsInAggregation.map(async (oControl) => {
601
+ if (XmlTreeModifier._isExtensionPoint(oControl)) {
602
+ return oControl;
719
603
  }
604
+ const oProperty = await XmlTreeModifier.getProperty(oControl, "stashed");
605
+ return !oProperty ? oControl : undefined;
720
606
  });
607
+ aControlsInAggregation = await Promise.all(aPromises);
608
+ // find and return the correct index
609
+ return aControlsInAggregation.filter((oControl) => {
610
+ return !!oControl;
611
+ }).indexOf(oControl);
612
+ } else {
613
+ // if aControlsInAggregation is not an array, then the aggregation is
614
+ // of type 0..1 and aControlsInAggregation is the oControl provided
615
+ // to the function initially, so its index is 0
616
+ return 0;
617
+ }
721
618
  },
722
619
 
723
620
  /**
724
621
  * @inheritDoc
725
622
  */
726
- getParentAggregationName: function (oControl, oParent) {
727
- return Promise.resolve()
728
- .then(function () {
729
- // check if the control is in named aggregatio node
730
- if (!oParent.isSameNode(oControl.parentNode)) {
731
- // the control is in named aggregation
732
- return false;
733
- } else {
734
- // again check just in case
735
- return XmlTreeModifier._isNotNamedAggregationNode(oParent, oControl);
736
- }
737
- })
738
- .then(function (bNotNamedAggregation) {
739
- // check if the the control is in default aggregation
740
- // and get the name of the aggregation
741
- if (bNotNamedAggregation) {
742
- // the control is in the default aggregation of the parent
743
- return XmlTreeModifier.getControlMetadata(oParent)
744
- .then(function (oMetadata) {
745
- return oMetadata.getDefaultAggregationName();
746
- });
747
- } else {
748
- // the agregation name is provided and we can simply take it from the xml node
749
- return XmlTreeModifier._getLocalName(oControl.parentNode);
750
- }
751
- });
623
+ getParentAggregationName: async function(oControl, oParent) {
624
+ // check if the control is in named aggregation node
625
+ // again check just in case
626
+ const bSameAsParentNode = oParent.isSameNode(oControl.parentNode);
627
+ const bNotNamedAggregation = await XmlTreeModifier._isNotNamedAggregationNode(oParent, oControl);
628
+ // check if the the control is in default aggregation
629
+ // and get the name of the aggregation
630
+ if (bNotNamedAggregation && bSameAsParentNode) {
631
+ // the control is in the default aggregation of the parent
632
+ const oMetadata = await XmlTreeModifier.getControlMetadata(oParent);
633
+ return oMetadata.getDefaultAggregationName();
634
+ } else {
635
+ // the aggregation name is provided and we can simply take it from the xml node
636
+ return XmlTreeModifier._getLocalName(oControl.parentNode);
637
+ }
752
638
  },
753
639
 
754
640
  /**
755
641
  * @inheritDoc
756
642
  */
757
- findAggregation: function(oControl, sAggregationName) {
758
- return XmlTreeModifier.getControlMetadata(oControl)
759
- .then(function (oMetadata) {
760
- return oMetadata.getAllAggregations();
761
- })
762
- .then(function (oAggregations) {
763
- if (oAggregations) {
764
- return oAggregations[sAggregationName];
765
- }
766
- return undefined;
767
- });
643
+ findAggregation: async function(oControl, sAggregationName) {
644
+ const oMetadata = await XmlTreeModifier.getControlMetadata(oControl);
645
+ const oAggregations = await oMetadata.getAllAggregations();
646
+ if (oAggregations) {
647
+ return oAggregations[sAggregationName];
648
+ }
649
+ return undefined;
768
650
  },
769
651
 
770
652
  /**
771
653
  * @inheritDoc
772
654
  */
773
- validateType: function(oControl, mAggregationMetadata, oParent, sFragment, iIndex) {
774
- var sTypeOrInterface = mAggregationMetadata.type;
655
+ validateType: async function(oControl, mAggregationMetadata, oParent, sFragment, iIndex) {
656
+ const sTypeOrInterface = mAggregationMetadata.type;
775
657
 
776
- return XmlTreeModifier.getAggregation(oParent, mAggregationMetadata.name)
777
- .then(function (oAggregation) {
778
- // if aggregation is not multiple and already has element inside, then it is not valid for element
779
- if (mAggregationMetadata.multiple === false && oAggregation && oAggregation.length > 0) {
780
- return false;
781
- }
782
- return Fragment.load({
783
- definition: sFragment
784
- });
785
- }).then(function(aControls) {
786
- if (!Array.isArray(aControls)) {
787
- aControls = [aControls];
788
- }
789
- var bReturn = aControls[iIndex].isA(sTypeOrInterface);
790
- aControls.forEach(function(oFragmentControl) {
791
- oFragmentControl.destroy();
792
- });
793
- return bReturn;
794
- });
658
+ const oAggregation = await XmlTreeModifier.getAggregation(oParent, mAggregationMetadata.name);
659
+ // if aggregation is not multiple and already has element inside, then it is not valid for element
660
+ if (mAggregationMetadata.multiple === false && oAggregation && oAggregation.length > 0) {
661
+ return false;
662
+ }
663
+ const vControls = await Fragment.load({
664
+ definition: sFragment
665
+ });
666
+ const aControls = !Array.isArray(vControls) ? [vControls] : vControls;
667
+ const bReturn = aControls[iIndex].isA(sTypeOrInterface);
668
+ aControls.forEach(function(oFragmentControl) {
669
+ oFragmentControl.destroy();
670
+ });
671
+ return bReturn;
795
672
  },
796
673
 
797
674
  /**
798
675
  * @inheritDoc
799
676
  */
800
- instantiateFragment: function(sFragment, sNamespace, oView) {
801
- var oFragment = XMLHelper.parse(sFragment);
802
- return XmlTreeModifier._checkAndPrefixIdsInFragment(oFragment, sNamespace)
803
- .then(function (oFragment) {
804
- var aControls;
677
+ instantiateFragment: async function(sFragment, sNamespace, oView) {
678
+ const oInitialFragment = XMLHelper.parse(sFragment);
679
+ const oFragment = await XmlTreeModifier._checkAndPrefixIdsInFragment(oInitialFragment, sNamespace);
680
+ let aControls;
805
681
 
806
- if (oFragment.localName === "FragmentDefinition") {
807
- aControls = XmlTreeModifier._getElementNodeChildren(oFragment);
808
- } else {
809
- aControls = [oFragment];
810
- }
682
+ if (oFragment.localName === "FragmentDefinition") {
683
+ aControls = XmlTreeModifier._getElementNodeChildren(oFragment);
684
+ } else {
685
+ aControls = [oFragment];
686
+ }
811
687
 
812
- // check if there is already a field with the same ID and throw error if so
813
- aControls.forEach(function(oNode) {
814
- if (XmlTreeModifier._byId(oNode.getAttribute("id"), oView)) {
815
- throw Error("The following ID is already in the view: " + oNode.getAttribute("id"));
816
- }
817
- });
688
+ // check if there is already a field with the same ID and throw error if so
689
+ aControls.forEach(function(oNode) {
690
+ if (XmlTreeModifier._byId(oNode.getAttribute("id"), oView)) {
691
+ throw Error("The following ID is already in the view: " + oNode.getAttribute("id"));
692
+ }
693
+ });
818
694
 
819
- return aControls;
820
- });
695
+ return aControls;
821
696
  },
822
697
 
823
698
  /**
824
699
  * @inheritDoc
825
700
  */
826
- templateControlFragment: function(sFragmentName, mPreprocessorSettings) {
827
- return BaseTreeModifier._templateFragment(
701
+ templateControlFragment: async function(sFragmentName, mPreprocessorSettings) {
702
+ const oFragment = await BaseTreeModifier._templateFragment(
828
703
  sFragmentName,
829
704
  mPreprocessorSettings
830
- ).then(function(oFragment) {
831
- return XmlTreeModifier._children(oFragment);
832
- });
705
+ );
706
+ return XmlTreeModifier._children(oFragment);
833
707
  },
834
708
 
835
709
  /**
836
710
  * @inheritDoc
837
711
  */
838
712
  destroy: function(oControl) {
839
- var oParent = oControl.parentNode;
713
+ const oParent = oControl.parentNode;
840
714
  if (oParent) {
841
715
  oParent.removeChild(oControl);
842
716
  }
@@ -852,63 +726,86 @@ sap.ui.define([
852
726
  /**
853
727
  * @inheritDoc
854
728
  */
855
- bindAggregation: function (oNode, sAggregationName, vBindingInfos, oView) {
856
- return Promise.resolve()
857
- .then(function () {
858
- XmlTreeModifier.bindProperty(oNode, sAggregationName, vBindingInfos.path);
859
- return XmlTreeModifier.insertAggregation(oNode, sAggregationName, vBindingInfos.template, 0, oView);
860
- });
729
+ bindAggregation: function(oNode, sAggregationName, vBindingInfos, oView) {
730
+ XmlTreeModifier.bindProperty(oNode, sAggregationName, vBindingInfos.path);
731
+ return XmlTreeModifier.insertAggregation(oNode, sAggregationName, vBindingInfos.template, 0, oView);
861
732
  },
862
733
 
863
734
  /**
864
735
  * @inheritDoc
865
736
  */
866
- unbindAggregation: function (oNode, sAggregationName) {
867
- return Promise.resolve()
868
- .then(function () {
869
- if (oNode.hasAttribute(sAggregationName)) {
870
- oNode.removeAttribute(sAggregationName);
871
- return XmlTreeModifier.removeAllAggregation(oNode, sAggregationName);
872
- }
873
- return undefined;
874
- });
737
+ unbindAggregation: function(oNode, sAggregationName) {
738
+ if (oNode.hasAttribute(sAggregationName)) {
739
+ oNode.removeAttribute(sAggregationName);
740
+ return XmlTreeModifier.removeAllAggregation(oNode, sAggregationName);
741
+ }
742
+ return Promise.resolve();
875
743
  },
876
744
 
877
745
  /**
878
746
  * @inheritDoc
879
747
  */
880
- getExtensionPointInfo: function(sExtensionPointName, oView) {
881
- return Promise.resolve()
882
- .then(function () {
883
- if (oView && sExtensionPointName) {
884
- var aExtensionPoints = Array.prototype.slice.call(oView.getElementsByTagNameNS("sap.ui.core", "ExtensionPoint"));
885
- var aFilteredExtensionPoints = aExtensionPoints.filter(function(oExtPoint) {
886
- return oExtPoint.getAttribute("name") === sExtensionPointName;
887
- });
888
- var oExtensionPoint = (aFilteredExtensionPoints.length === 1) ? aFilteredExtensionPoints[0] : undefined;
889
- if (oExtensionPoint) {
890
- var oParent = XmlTreeModifier.getParent(oExtensionPoint);
891
-
892
- return Promise.all([
893
- XmlTreeModifier.getParentAggregationName(oExtensionPoint, oParent),
894
- XmlTreeModifier.findIndexInParentAggregation(oExtensionPoint)
895
- ]).then(function (aProperties) {
896
- // increase the index by 1 to get the index behind the extension point for xml-case
897
- var oExtensionPointInfo = {
898
- parent: oParent,
899
- aggregationName: aProperties[0],
900
- index: aProperties[1] + 1,
901
- defaultContent: Array.prototype.slice.call(XmlTreeModifier._children(oExtensionPoint))
902
- };
903
- return oExtensionPointInfo;
904
- });
905
- }
906
- }
907
- return undefined;
748
+ getExtensionPointInfo: async function(sExtensionPointName, oView) {
749
+ if (oView && sExtensionPointName) {
750
+ const aExtensionPoints = Array.prototype.slice.call(oView.getElementsByTagNameNS("sap.ui.core", "ExtensionPoint"));
751
+ const aFilteredExtensionPoints = aExtensionPoints.filter(function(oExtPoint) {
752
+ return oExtPoint.getAttribute("name") === sExtensionPointName;
908
753
  });
754
+ const oExtensionPoint = (aFilteredExtensionPoints.length === 1) ? aFilteredExtensionPoints[0] : undefined;
755
+ if (oExtensionPoint) {
756
+ const oParent = XmlTreeModifier.getParent(oExtensionPoint);
757
+
758
+ const aProperties = await Promise.all([
759
+ XmlTreeModifier.getParentAggregationName(oExtensionPoint, oParent),
760
+ XmlTreeModifier.findIndexInParentAggregation(oExtensionPoint)
761
+ ]);
762
+ // increase the index by 1 to get the index behind the extension point for xml-case
763
+ const oExtensionPointInfo = {
764
+ parent: oParent,
765
+ aggregationName: aProperties[0],
766
+ index: aProperties[1] + 1,
767
+ defaultContent: Array.prototype.slice.call(XmlTreeModifier._children(oExtensionPoint))
768
+ };
769
+ return oExtensionPointInfo;
770
+ }
771
+ }
772
+ return undefined;
909
773
  }
910
774
  });
911
775
 
776
+ async function insertAggregation(oParent, sName, oObject, iIndex, oView, bSkipAdjustIndex, oFoundAggregationNode) {
777
+ let oAggregationNode;
778
+ if (!oFoundAggregationNode) {
779
+ // named aggregation must have the same namespace as the parent
780
+ const sNamespaceURI = oParent.namespaceURI;
781
+ // no ids for aggregation nodes => no need to pass id or component
782
+ oAggregationNode = await XmlTreeModifier.createControl(sNamespaceURI + "." + sName, undefined, oView);
783
+ oParent.appendChild(oAggregationNode);
784
+ } else {
785
+ oAggregationNode = oFoundAggregationNode;
786
+ }
787
+ if (!bSkipAdjustIndex) {
788
+ const aChildren = oAggregationNode.children;
789
+ let iOffset = 0;
790
+ const iStopIndex = (iIndex < aChildren.length) ? iIndex : aChildren.length;
791
+ for (let i = 0; i < iStopIndex; i++) {
792
+ if (aChildren[i].namespaceURI === "sap.ui.core" && aChildren[i].tagName.includes("ExtensionPoint")) {
793
+ iOffset = iOffset + 1 - aChildren[i].children.length;
794
+ }
795
+ }
796
+ iIndex = iIndex + iOffset;
797
+ }
798
+
799
+ if (iIndex >= oAggregationNode.childElementCount) {
800
+ oAggregationNode.appendChild(oObject);
801
+ } else {
802
+ const aReferenceNodes = await XmlTreeModifier._getControlsInAggregation(oParent, oAggregationNode);
803
+ oAggregationNode.insertBefore(oObject, aReferenceNodes[iIndex]);
804
+ }
805
+ return undefined;
806
+ }
807
+
808
+
912
809
  return XmlTreeModifier;
913
810
  },
914
811
  /* bExport= */true);