@openui5/sap.ui.core 1.127.1 → 1.129.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 (285) hide show
  1. package/.eslintrc.json +3 -1
  2. package/THIRDPARTY.txt +1 -1
  3. package/package.json +1 -1
  4. package/src/jquery.sap.global.js +1 -1
  5. package/src/jquery.sap.properties.js +1 -1
  6. package/src/jquery.sap.resources.js +1 -1
  7. package/src/jquery.sap.script.js +1 -1
  8. package/src/jquery.sap.storage.js +3 -3
  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/i18n/LanguageTag.js +1 -1
  13. package/src/sap/base/i18n/date/TimezoneUtils.js +1 -1
  14. package/src/sap/base/util/restricted/_CancelablePromise.js +1 -1
  15. package/src/sap/base/util/restricted/_castArray.js +1 -1
  16. package/src/sap/base/util/restricted/_compact.js +1 -1
  17. package/src/sap/base/util/restricted/_curry.js +1 -1
  18. package/src/sap/base/util/restricted/_debounce.js +1 -1
  19. package/src/sap/base/util/restricted/_difference.js +1 -1
  20. package/src/sap/base/util/restricted/_differenceBy.js +1 -1
  21. package/src/sap/base/util/restricted/_differenceWith.js +1 -1
  22. package/src/sap/base/util/restricted/_flatMap.js +1 -1
  23. package/src/sap/base/util/restricted/_flatMapDeep.js +1 -1
  24. package/src/sap/base/util/restricted/_flatMapDepth.js +1 -1
  25. package/src/sap/base/util/restricted/_flatten.js +1 -1
  26. package/src/sap/base/util/restricted/_flattenDeep.js +1 -1
  27. package/src/sap/base/util/restricted/_flattenDepth.js +1 -1
  28. package/src/sap/base/util/restricted/_intersection.js +1 -1
  29. package/src/sap/base/util/restricted/_intersectionBy.js +1 -1
  30. package/src/sap/base/util/restricted/_intersectionWith.js +1 -1
  31. package/src/sap/base/util/restricted/_isEqual.js +1 -1
  32. package/src/sap/base/util/restricted/_isEqualWith.js +1 -1
  33. package/src/sap/base/util/restricted/_isNil.js +1 -1
  34. package/src/sap/base/util/restricted/_max.js +1 -1
  35. package/src/sap/base/util/restricted/_merge.js +1 -1
  36. package/src/sap/base/util/restricted/_mergeWith.js +1 -1
  37. package/src/sap/base/util/restricted/_min.js +1 -1
  38. package/src/sap/base/util/restricted/_omit.js +1 -1
  39. package/src/sap/base/util/restricted/_pick.js +1 -1
  40. package/src/sap/base/util/restricted/_pickBy.js +1 -1
  41. package/src/sap/base/util/restricted/_throttle.js +1 -1
  42. package/src/sap/base/util/restricted/_toArray.js +1 -1
  43. package/src/sap/base/util/restricted/_union.js +1 -1
  44. package/src/sap/base/util/restricted/_unionBy.js +1 -1
  45. package/src/sap/base/util/restricted/_unionWith.js +1 -1
  46. package/src/sap/base/util/restricted/_uniq.js +1 -1
  47. package/src/sap/base/util/restricted/_uniqBy.js +1 -1
  48. package/src/sap/base/util/restricted/_uniqWith.js +1 -1
  49. package/src/sap/base/util/restricted/_without.js +1 -1
  50. package/src/sap/base/util/restricted/_xor.js +1 -1
  51. package/src/sap/base/util/restricted/_xorBy.js +1 -1
  52. package/src/sap/base/util/restricted/_xorWith.js +1 -1
  53. package/src/sap/base/util/restricted/_zipObject.js +1 -1
  54. package/src/sap/base/util/restricted/_zipObjectDeep.js +1 -1
  55. package/src/sap/ui/Device.js +3 -3
  56. package/src/sap/ui/Global.js +3 -3
  57. package/src/sap/ui/base/BindingParser.js +38 -4
  58. package/src/sap/ui/base/Event.js +1 -1
  59. package/src/sap/ui/base/EventProvider.js +1 -1
  60. package/src/sap/ui/base/Interface.js +1 -1
  61. package/src/sap/ui/base/ManagedObject.js +1 -1
  62. package/src/sap/ui/base/ManagedObjectMetadata.js +1 -1
  63. package/src/sap/ui/base/Metadata.js +1 -1
  64. package/src/sap/ui/base/Object.js +1 -1
  65. package/src/sap/ui/base/ObjectPool.js +1 -1
  66. package/src/sap/ui/core/.library +1 -1
  67. package/src/sap/ui/core/BusyIndicator.js +1 -1
  68. package/src/sap/ui/core/Component.js +28 -6
  69. package/src/sap/ui/core/ComponentContainer.js +1 -1
  70. package/src/sap/ui/core/ComponentMetadata.js +1 -1
  71. package/src/sap/ui/core/ComponentSupport.js +1 -1
  72. package/src/sap/ui/core/Configuration.js +1 -1
  73. package/src/sap/ui/core/Control.js +1 -1
  74. package/src/sap/ui/core/Core.js +28 -15
  75. package/src/sap/ui/core/CustomData.js +1 -1
  76. package/src/sap/ui/core/DeclarativeSupport.js +1 -1
  77. package/src/sap/ui/core/Element.js +1 -1
  78. package/src/sap/ui/core/ElementMetadata.js +1 -1
  79. package/src/sap/ui/core/EnabledPropagator.js +1 -1
  80. package/src/sap/ui/core/EventBus.js +1 -1
  81. package/src/sap/ui/core/Fragment.js +1 -1
  82. package/src/sap/ui/core/HTML.js +1 -1
  83. package/src/sap/ui/core/History.js +1 -1
  84. package/src/sap/ui/core/Icon.js +2 -2
  85. package/src/sap/ui/core/IndicationColorSupport.js +1 -1
  86. package/src/sap/ui/core/IntervalTrigger.js +1 -1
  87. package/src/sap/ui/core/InvisibleMessage.js +1 -1
  88. package/src/sap/ui/core/InvisibleRenderer.js +1 -1
  89. package/src/sap/ui/core/InvisibleText.js +1 -1
  90. package/src/sap/ui/core/Item.js +1 -1
  91. package/src/sap/ui/core/LabelEnablement.js +1 -1
  92. package/src/sap/ui/core/LayoutData.js +1 -1
  93. package/src/sap/ui/core/Lib.js +1 -0
  94. package/src/sap/ui/core/ListItem.js +1 -1
  95. package/src/sap/ui/core/LocalBusyIndicator.js +1 -1
  96. package/src/sap/ui/core/Locale.js +1 -1
  97. package/src/sap/ui/core/LocaleData.js +1 -1
  98. package/src/sap/ui/core/Manifest.js +1 -1
  99. package/src/sap/ui/core/Message.js +1 -1
  100. package/src/sap/ui/core/RenderManager.js +1 -1
  101. package/src/sap/ui/core/Renderer.js +1 -1
  102. package/src/sap/ui/core/ResizeHandler.js +1 -1
  103. package/src/sap/ui/core/ScrollBar.js +1 -1
  104. package/src/sap/ui/core/SeparatorItem.js +1 -1
  105. package/src/sap/ui/core/Title.js +1 -1
  106. package/src/sap/ui/core/TooltipBase.js +1 -1
  107. package/src/sap/ui/core/UIArea.js +1 -1
  108. package/src/sap/ui/core/UIComponent.js +1 -1
  109. package/src/sap/ui/core/UIComponentMetadata.js +1 -1
  110. package/src/sap/ui/core/ValueStateSupport.js +1 -1
  111. package/src/sap/ui/core/VariantLayoutData.js +1 -1
  112. package/src/sap/ui/core/XMLComposite.js +1 -1
  113. package/src/sap/ui/core/XMLCompositeMetadata.js +4 -4
  114. package/src/sap/ui/core/XMLTemplateProcessor.js +55 -33
  115. package/src/sap/ui/core/boot/FieldHelpEndpoint.js +70 -0
  116. package/src/sap/ui/core/date/UI5Date.js +1 -1
  117. package/src/sap/ui/core/delegate/ItemNavigation.js +1 -1
  118. package/src/sap/ui/core/delegate/ScrollEnablement.js +3 -2
  119. package/src/sap/ui/core/dnd/DragDropBase.js +1 -1
  120. package/src/sap/ui/core/dnd/DragDropInfo.js +1 -1
  121. package/src/sap/ui/core/dnd/DragInfo.js +1 -1
  122. package/src/sap/ui/core/dnd/DropInfo.js +1 -1
  123. package/src/sap/ui/core/fieldhelp/FieldHelp.js +3 -3
  124. package/src/sap/ui/core/format/FormatUtils.js +1 -1
  125. package/src/sap/ui/core/format/NumberFormat.js +6 -2
  126. package/src/sap/ui/core/format/TimezoneUtil.js +1 -1
  127. package/src/sap/ui/core/getCompatibilityVersion.js +1 -1
  128. package/src/sap/ui/core/hyphenation/Hyphenation.js +1 -1
  129. package/src/sap/ui/core/library.js +4 -4
  130. package/src/sap/ui/core/message/ControlMessageProcessor.js +1 -1
  131. package/src/sap/ui/core/message/Message.js +1 -1
  132. package/src/sap/ui/core/message/MessageManager.js +1 -1
  133. package/src/sap/ui/core/message/MessageParser.js +1 -1
  134. package/src/sap/ui/core/message/MessageProcessor.js +1 -1
  135. package/src/sap/ui/core/mvc/HTMLView.js +1 -1
  136. package/src/sap/ui/core/mvc/JSONView.js +1 -1
  137. package/src/sap/ui/core/mvc/JSView.js +1 -1
  138. package/src/sap/ui/core/mvc/TemplateView.js +1 -1
  139. package/src/sap/ui/core/mvc/View.js +1 -1
  140. package/src/sap/ui/core/mvc/XMLView.js +1 -1
  141. package/src/sap/ui/core/plugin/DeclarativeSupport.js +1 -1
  142. package/src/sap/ui/core/plugin/LessSupport.js +1 -1
  143. package/src/sap/ui/core/plugin/TemplatingSupport.js +1 -1
  144. package/src/sap/ui/core/postmessage/Bus.js +1 -1
  145. package/src/sap/ui/core/postmessage/confirmationDialog.js +1 -1
  146. package/src/sap/ui/core/search/OpenSearchProvider.js +1 -1
  147. package/src/sap/ui/core/search/SearchProvider.js +1 -1
  148. package/src/sap/ui/core/service/Service.js +1 -1
  149. package/src/sap/ui/core/service/ServiceFactory.js +1 -1
  150. package/src/sap/ui/core/service/ServiceFactoryRegistry.js +1 -1
  151. package/src/sap/ui/core/support/Plugin.js +1 -1
  152. package/src/sap/ui/core/support/Support.js +1 -1
  153. package/src/sap/ui/core/support/ToolsAPI.js +4 -2
  154. package/src/sap/ui/core/support/plugins/ControlTree.js +1 -1
  155. package/src/sap/ui/core/support/plugins/Interaction.js +1 -1
  156. package/src/sap/ui/core/support/plugins/LocalStorage.js +1 -1
  157. package/src/sap/ui/core/support/plugins/Performance.js +1 -1
  158. package/src/sap/ui/core/support/plugins/Selector.js +1 -1
  159. package/src/sap/ui/core/support/plugins/TechInfo.js +1 -1
  160. package/src/sap/ui/core/support/plugins/Trace.js +1 -1
  161. package/src/sap/ui/core/support/plugins/ViewInfo.js +1 -1
  162. package/src/sap/ui/core/themes/base/base.less +4238 -122
  163. package/src/sap/ui/core/themes/base/global.less +460 -7
  164. package/src/sap/ui/core/themes/base/skeleton.less +454 -3
  165. package/src/sap/ui/core/themes/sap_hcb/global.less +493 -40
  166. package/src/sap/ui/core/theming/Parameters.js +3 -3
  167. package/src/sap/ui/core/tmpl/DOMAttribute.js +1 -1
  168. package/src/sap/ui/core/tmpl/DOMElement.js +1 -1
  169. package/src/sap/ui/core/tmpl/HandlebarsTemplate.js +1 -1
  170. package/src/sap/ui/core/tmpl/Template.js +1 -1
  171. package/src/sap/ui/core/tmpl/TemplateControl.js +1 -1
  172. package/src/sap/ui/core/util/AsyncHintsHelper.js +1 -1
  173. package/src/sap/ui/core/util/Export.js +1 -1
  174. package/src/sap/ui/core/util/ExportCell.js +1 -1
  175. package/src/sap/ui/core/util/ExportColumn.js +1 -1
  176. package/src/sap/ui/core/util/ExportRow.js +1 -1
  177. package/src/sap/ui/core/util/ExportType.js +1 -1
  178. package/src/sap/ui/core/util/ExportTypeCSV.js +1 -1
  179. package/src/sap/ui/core/util/File.js +1 -1
  180. package/src/sap/ui/core/util/LibraryInfo.js +1 -1
  181. package/src/sap/ui/core/util/MockServer.js +1 -1
  182. package/src/sap/ui/core/util/PasteHelper.js +1 -1
  183. package/src/sap/ui/core/util/reflection/BaseTreeModifier.js +134 -148
  184. package/src/sap/ui/core/util/reflection/JsControlTreeModifier.js +165 -202
  185. package/src/sap/ui/core/util/reflection/XmlTreeModifier.js +365 -468
  186. package/src/sap/ui/core/util/serializer/HTMLViewSerializer.js +1 -1
  187. package/src/sap/ui/core/util/serializer/Serializer.js +1 -1
  188. package/src/sap/ui/core/util/serializer/ViewSerializer.js +1 -1
  189. package/src/sap/ui/core/util/serializer/XMLViewSerializer.js +1 -1
  190. package/src/sap/ui/core/util/serializer/delegate/Delegate.js +1 -1
  191. package/src/sap/ui/core/util/serializer/delegate/HTML.js +1 -1
  192. package/src/sap/ui/core/util/serializer/delegate/XML.js +1 -1
  193. package/src/sap/ui/core/webc/WebComponent.js +1 -1
  194. package/src/sap/ui/core/webc/WebComponentMetadata.js +1 -1
  195. package/src/sap/ui/core/webc/WebComponentRenderer.js +7 -2
  196. package/src/sap/ui/core/ws/ReadyState.js +1 -1
  197. package/src/sap/ui/core/ws/SapPcpWebSocket.js +1 -1
  198. package/src/sap/ui/core/ws/WebSocket.js +1 -1
  199. package/src/sap/ui/debug/ControlTree.js +1 -1
  200. package/src/sap/ui/debug/DebugEnv.js +1 -1
  201. package/src/sap/ui/debug/PropertyList.js +1 -1
  202. package/src/sap/ui/dom/findTabbable.js +3 -5
  203. package/src/sap/ui/model/ClientModel.js +1 -1
  204. package/src/sap/ui/model/CompositeDataState.js +11 -12
  205. package/src/sap/ui/model/CompositeType.js +1 -1
  206. package/src/sap/ui/model/DataState.js +33 -5
  207. package/src/sap/ui/model/MetaModel.js +1 -1
  208. package/src/sap/ui/model/Model.js +1 -1
  209. package/src/sap/ui/model/SelectionModel.js +1 -1
  210. package/src/sap/ui/model/SimpleType.js +1 -1
  211. package/src/sap/ui/model/TreeAutoExpandMode.js +1 -1
  212. package/src/sap/ui/model/Type.js +1 -1
  213. package/src/sap/ui/model/_Helper.js +3 -1
  214. package/src/sap/ui/model/json/JSONModel.js +1 -1
  215. package/src/sap/ui/model/message/MessageModel.js +1 -1
  216. package/src/sap/ui/model/odata/ODataAnnotations.js +1 -1
  217. package/src/sap/ui/model/odata/ODataMessageParser.js +1 -1
  218. package/src/sap/ui/model/odata/ODataMetaModel.js +116 -35
  219. package/src/sap/ui/model/odata/ODataMetadata.js +1 -1
  220. package/src/sap/ui/model/odata/ODataModel.js +1 -1
  221. package/src/sap/ui/model/odata/type/Boolean.js +1 -1
  222. package/src/sap/ui/model/odata/type/Byte.js +1 -1
  223. package/src/sap/ui/model/odata/type/Currency.js +1 -1
  224. package/src/sap/ui/model/odata/type/Date.js +1 -1
  225. package/src/sap/ui/model/odata/type/DateTime.js +1 -1
  226. package/src/sap/ui/model/odata/type/DateTimeBase.js +1 -1
  227. package/src/sap/ui/model/odata/type/DateTimeOffset.js +1 -1
  228. package/src/sap/ui/model/odata/type/DateTimeWithTimezone.js +1 -1
  229. package/src/sap/ui/model/odata/type/Decimal.js +1 -1
  230. package/src/sap/ui/model/odata/type/Double.js +1 -1
  231. package/src/sap/ui/model/odata/type/Guid.js +1 -1
  232. package/src/sap/ui/model/odata/type/Int.js +1 -1
  233. package/src/sap/ui/model/odata/type/Int16.js +1 -1
  234. package/src/sap/ui/model/odata/type/Int32.js +1 -1
  235. package/src/sap/ui/model/odata/type/Int64.js +1 -1
  236. package/src/sap/ui/model/odata/type/ODataType.js +1 -1
  237. package/src/sap/ui/model/odata/type/Raw.js +1 -1
  238. package/src/sap/ui/model/odata/type/SByte.js +1 -1
  239. package/src/sap/ui/model/odata/type/Single.js +1 -1
  240. package/src/sap/ui/model/odata/type/Stream.js +1 -1
  241. package/src/sap/ui/model/odata/type/String.js +1 -1
  242. package/src/sap/ui/model/odata/type/Time.js +1 -1
  243. package/src/sap/ui/model/odata/type/TimeOfDay.js +1 -1
  244. package/src/sap/ui/model/odata/type/Unit.js +1 -1
  245. package/src/sap/ui/model/odata/type/UnitMixin.js +14 -9
  246. package/src/sap/ui/model/odata/v2/Context.js +1 -1
  247. package/src/sap/ui/model/odata/v2/ODataAnnotations.js +1 -1
  248. package/src/sap/ui/model/odata/v2/ODataModel.js +185 -54
  249. package/src/sap/ui/model/odata/v2/ODataTreeBinding.js +29 -10
  250. package/src/sap/ui/model/odata/v4/Context.js +65 -16
  251. package/src/sap/ui/model/odata/v4/ODataBinding.js +6 -0
  252. package/src/sap/ui/model/odata/v4/ODataContextBinding.js +1 -1
  253. package/src/sap/ui/model/odata/v4/ODataListBinding.js +113 -41
  254. package/src/sap/ui/model/odata/v4/ODataMetaModel.js +1 -1
  255. package/src/sap/ui/model/odata/v4/ODataModel.js +42 -6
  256. package/src/sap/ui/model/odata/v4/ODataPropertyBinding.js +1 -1
  257. package/src/sap/ui/model/odata/v4/_AnnotationHelperExpression.js +1 -1
  258. package/src/sap/ui/model/odata/v4/lib/_AggregationCache.js +112 -55
  259. package/src/sap/ui/model/odata/v4/lib/_AggregationHelper.js +40 -15
  260. package/src/sap/ui/model/odata/v4/lib/_Cache.js +118 -80
  261. package/src/sap/ui/model/odata/v4/lib/_Helper.js +10 -7
  262. package/src/sap/ui/model/odata/v4/lib/_Requestor.js +29 -4
  263. package/src/sap/ui/model/odata/v4/lib/_TreeState.js +64 -14
  264. package/src/sap/ui/model/resource/ResourceModel.js +1 -1
  265. package/src/sap/ui/model/type/Boolean.js +1 -1
  266. package/src/sap/ui/model/type/Currency.js +1 -1
  267. package/src/sap/ui/model/type/Date.js +1 -1
  268. package/src/sap/ui/model/type/DateInterval.js +1 -1
  269. package/src/sap/ui/model/type/DateTime.js +1 -1
  270. package/src/sap/ui/model/type/DateTimeInterval.js +1 -1
  271. package/src/sap/ui/model/type/FileSize.js +1 -1
  272. package/src/sap/ui/model/type/Float.js +1 -1
  273. package/src/sap/ui/model/type/Integer.js +1 -1
  274. package/src/sap/ui/model/type/String.js +1 -1
  275. package/src/sap/ui/model/type/Time.js +1 -1
  276. package/src/sap/ui/model/type/TimeInterval.js +1 -1
  277. package/src/sap/ui/model/type/Unit.js +1 -1
  278. package/src/sap/ui/model/xml/XMLModel.js +1 -1
  279. package/src/sap/ui/qunit/utils/ControlIterator.js +1 -1
  280. package/src/sap/ui/qunit/utils/MemoryLeakCheck.js +1 -1
  281. package/src/sap/ui/test/Opa5.js +2 -1
  282. package/src/sap/ui/test/TestUtils.js +107 -43
  283. package/src/sap/ui/test/generic/TestBase.js +1 -1
  284. package/src/sap/ui/util/Storage.js +1 -1
  285. package/src/ui5loader.js +38 -13
@@ -7,26 +7,39 @@
7
7
  */
8
8
 
9
9
  sap.ui.define([
10
- "sap/ui/base/BindingParser",
11
- "./BaseTreeModifier",
12
- "./XmlTreeModifier",
13
- "sap/base/util/ObjectPath",
14
- "sap/ui/util/XMLHelper",
15
10
  "sap/base/util/merge",
11
+ "sap/base/util/ObjectPath",
12
+ "sap/ui/base/BindingParser",
13
+ "sap/ui/core/util/reflection/BaseTreeModifier",
14
+ "sap/ui/core/util/reflection/XmlTreeModifier",
16
15
  "sap/ui/core/Element",
17
- "sap/ui/core/Fragment"
18
- ], function (
16
+ "sap/ui/core/Fragment",
17
+ "sap/ui/util/XMLHelper"
18
+ ], function(
19
+ merge,
20
+ ObjectPath,
19
21
  BindingParser,
20
22
  BaseTreeModifier,
21
23
  XmlTreeModifier,
22
- ObjectPath,
23
- XMLHelper,
24
- merge,
25
24
  Element,
26
- Fragment
25
+ Fragment,
26
+ XMLHelper
27
27
  ) {
28
28
 
29
29
  "use strict";
30
+
31
+ function requireClass(sClassName) {
32
+ return new Promise(function(fnResolve, fnReject) {
33
+ sap.ui.require([sClassName],
34
+ function(oClassObject) { fnResolve(oClassObject); },
35
+ function() {
36
+ fnReject(new Error("Required control '" + sClassName
37
+ + "' couldn't be created asynchronously"));
38
+ }
39
+ );
40
+ });
41
+ }
42
+
30
43
  /**
31
44
  * Static utility class to access ManagedObjects in a harmonized way with XMLNodes.
32
45
  *
@@ -36,14 +49,13 @@ sap.ui.define([
36
49
  * @ui5-restricted
37
50
  * @since 1.56.0
38
51
  */
39
- var JsControlTreeModifier = /** @lends sap.ui.core.util.reflection.JsControlTreeModifier */ {
40
-
52
+ const JsControlTreeModifier = /** @lends sap.ui.core.util.reflection.JsControlTreeModifier */ {
41
53
  targets: "jsControlTree",
42
54
 
43
55
  /**
44
56
  * @inheritDoc
45
57
  */
46
- setVisible: function (oControl, bVisible) {
58
+ setVisible: function(oControl, bVisible) {
47
59
  if (oControl.setVisible) {
48
60
  this.unbindProperty(oControl, "visible");
49
61
  oControl.setVisible(bVisible);
@@ -55,7 +67,7 @@ sap.ui.define([
55
67
  /**
56
68
  * @inheritDoc
57
69
  */
58
- getVisible: function (oControl) {
70
+ getVisible: function(oControl) {
59
71
  if (oControl.getVisible) {
60
72
  return Promise.resolve(oControl.getVisible());
61
73
  } else {
@@ -66,7 +78,7 @@ sap.ui.define([
66
78
  /**
67
79
  * @inheritDoc
68
80
  */
69
- setStashed: async function (oControl, bStashed) {
81
+ setStashed: async function(oControl, bStashed) {
70
82
  bStashed = !!bStashed;
71
83
  if (oControl.unstash) {
72
84
  // check if the control is stashed and should be unstashed
@@ -88,30 +100,28 @@ sap.ui.define([
88
100
  /**
89
101
  * @inheritDoc
90
102
  */
91
- getStashed: function (oControl) {
103
+ getStashed: async function(oControl) {
92
104
  if (oControl.isStashed) {
93
105
  if (oControl.isStashed()) {
94
- return Promise.resolve(true);
106
+ return true;
95
107
  }
96
- return this.getVisible(oControl)
97
- .then(function (bIsVisible) {
98
- return !bIsVisible;
99
- });
108
+ const bIsVisible = await this.getVisible(oControl);
109
+ return !bIsVisible;
100
110
  }
101
- return Promise.reject(new Error("Provided control instance has no isStashed method"));
111
+ throw new Error("Provided control instance has no isStashed method");
102
112
  },
103
113
 
104
114
  /**
105
115
  * @inheritDoc
106
116
  */
107
- bindProperty: function (oControl, sPropertyName, vBindingInfos) {
117
+ bindProperty: function(oControl, sPropertyName, vBindingInfos) {
108
118
  oControl.bindProperty(sPropertyName, vBindingInfos);
109
119
  },
110
120
 
111
121
  /**
112
122
  * @inheritDoc
113
123
  */
114
- unbindProperty: function (oControl, sPropertyName) {
124
+ unbindProperty: function(oControl, sPropertyName) {
115
125
  if (oControl) {
116
126
  oControl.unbindProperty(sPropertyName, /*bSuppressReset = */true);
117
127
  }
@@ -120,10 +130,10 @@ sap.ui.define([
120
130
  /**
121
131
  * @inheritDoc
122
132
  */
123
- setProperty: function (oControl, sPropertyName, vPropertyValue) {
124
- var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
125
- var oBindingParserResult;
126
- var bError;
133
+ setProperty: function(oControl, sPropertyName, vPropertyValue) {
134
+ const oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
135
+ let oBindingParserResult;
136
+ let bError;
127
137
 
128
138
  this.unbindProperty(oControl, sPropertyName);
129
139
 
@@ -139,7 +149,7 @@ sap.ui.define([
139
149
  if (oBindingParserResult && typeof oBindingParserResult === "object" || bError) {
140
150
  vPropertyValue = this._escapeCurlyBracketsInString(vPropertyValue);
141
151
  }
142
- var sPropertySetter = oMetadata._sMutator;
152
+ const sPropertySetter = oMetadata._sMutator;
143
153
  oControl[sPropertySetter](vPropertyValue);
144
154
  } else {
145
155
  throw new TypeError("Value cannot be stringified", "sap.ui.core.util.reflection.JsControlTreeModifier");
@@ -150,11 +160,11 @@ sap.ui.define([
150
160
  /**
151
161
  * @inheritDoc
152
162
  */
153
- getProperty: function (oControl, sPropertyName) {
154
- var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
155
- var oProperty;
163
+ getProperty: function(oControl, sPropertyName) {
164
+ const oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
165
+ let oProperty;
156
166
  if (oMetadata) {
157
- var sPropertyGetter = oMetadata._sGetter;
167
+ const sPropertyGetter = oMetadata._sGetter;
158
168
  oProperty = oControl[sPropertyGetter]();
159
169
  }
160
170
  return Promise.resolve(oProperty);
@@ -163,16 +173,16 @@ sap.ui.define([
163
173
  /**
164
174
  * @inheritDoc
165
175
  */
166
- isPropertyInitial: function (oControl, sPropertyName) {
176
+ isPropertyInitial: function(oControl, sPropertyName) {
167
177
  return oControl.isPropertyInitial(sPropertyName);
168
178
  },
169
179
 
170
180
  /**
171
181
  * @inheritDoc
172
182
  */
173
- setPropertyBinding: function (oControl, sPropertyName, oPropertyBinding) {
183
+ setPropertyBinding: function(oControl, sPropertyName, oPropertyBinding) {
174
184
  this.unbindProperty(oControl, sPropertyName);
175
- var mSettings = {};
185
+ const mSettings = {};
176
186
  mSettings[sPropertyName] = oPropertyBinding;
177
187
  return oControl.applySettings(mSettings);
178
188
  },
@@ -180,27 +190,25 @@ sap.ui.define([
180
190
  /**
181
191
  * @inheritDoc
182
192
  */
183
- getPropertyBinding: function (oControl, sPropertyName) {
193
+ getPropertyBinding: function(oControl, sPropertyName) {
184
194
  return oControl.getBindingInfo(sPropertyName);
185
195
  },
186
196
 
187
197
  /**
188
198
  * @inheritDoc
189
199
  */
190
- createAndAddCustomData: function(oControl, sCustomDataKey, sValue, oAppComponent) {
191
- return this.createControl("sap.ui.core.CustomData", oAppComponent)
192
- .then(function (oCustomData) {
193
- this.setProperty(oCustomData, "key", sCustomDataKey);
194
- this.setProperty(oCustomData, "value", sValue);
195
- return this.insertAggregation(oControl, "customData", oCustomData, 0);
196
- }.bind(this));
200
+ createAndAddCustomData: async function(oControl, sCustomDataKey, sValue, oAppComponent) {
201
+ const oCustomData = await this.createControl("sap.ui.core.CustomData", oAppComponent);
202
+ this.setProperty(oCustomData, "key", sCustomDataKey);
203
+ this.setProperty(oCustomData, "value", sValue);
204
+ return this.insertAggregation(oControl, "customData", oCustomData, 0);
197
205
  },
198
206
 
199
207
  /**
200
208
  * @inheritDoc
201
209
  */
202
210
  getCustomDataInfo: function(oControl, sCustomDataKey) {
203
- var oCustomData;
211
+ let oCustomData;
204
212
  if (oControl.getCustomData) {
205
213
  oControl.getCustomData().some(function(oCurrentCustomData) {
206
214
  if (oCurrentCustomData.getKey() === sCustomDataKey) {
@@ -223,34 +231,16 @@ sap.ui.define([
223
231
  /**
224
232
  * @inheritDoc
225
233
  */
226
- createControl: function (sClassName, oAppComponent, oView, oSelector, mSettings) {
234
+ createControl: async function(sClassName, oAppComponent, oView, oSelector, mSettings) {
227
235
  sClassName = sClassName.replace(/\./g,"/");
228
236
  if (this.bySelector(oSelector, oAppComponent)) {
229
- var sErrorMessage = "Can't create a control with duplicated ID " + (oSelector.id || oSelector);
237
+ const sErrorMessage = "Can't create a control with duplicated ID " + (oSelector.id || oSelector);
230
238
  return Promise.reject(sErrorMessage);
231
239
  }
232
240
 
233
- var oPromise;
234
- var oClassObject = sap.ui.require(sClassName);
235
- if (oClassObject) {
236
- oPromise = Promise.resolve(oClassObject);
237
- } else {
238
- oPromise = new Promise(function(fnResolve, fnReject) {
239
- sap.ui.require([sClassName],
240
- function(oClassObject) { fnResolve(oClassObject); },
241
- function() {
242
- fnReject(new Error("Required control '" + sClassName
243
- + "' couldn't be created asynchronously"));
244
- }
245
- );
246
- });
247
- }
248
-
249
- return oPromise
250
- .then(function(ClassObject) {
251
- var sId = this.getControlIdBySelector(oSelector, oAppComponent);
252
- return new ClassObject(sId, mSettings);
253
- }.bind(this));
241
+ const ClassObject = sap.ui.require(sClassName) || await requireClass(sClassName);
242
+ const sId = this.getControlIdBySelector(oSelector, oAppComponent);
243
+ return new ClassObject(sId, mSettings);
254
244
  },
255
245
 
256
246
  /**
@@ -263,78 +253,76 @@ sap.ui.define([
263
253
  /**
264
254
  * @inheritDoc
265
255
  */
266
- _byId: function (sId) {
256
+ _byId: function(sId) {
267
257
  return Element.getElementById(sId);
268
258
  },
269
259
 
270
260
  /**
271
261
  * @inheritDoc
272
262
  */
273
- getId: function (oControl) {
263
+ getId: function(oControl) {
274
264
  return oControl.getId();
275
265
  },
276
266
 
277
267
  /**
278
268
  * @inheritDoc
279
269
  */
280
- getParent: function (oControl) {
281
- return oControl.getParent && oControl.getParent();
270
+ getParent: function(oControl) {
271
+ return oControl.getParent?.();
282
272
  },
283
273
 
284
274
  /**
285
275
  * @inheritDoc
286
276
  */
287
- getControlMetadata: function (oControl) {
288
- return Promise.resolve(oControl && oControl.getMetadata());
277
+ getControlMetadata: function(oControl) {
278
+ return Promise.resolve(oControl?.getMetadata());
289
279
  },
290
280
 
291
281
  /**
292
282
  * @inheritDoc
293
283
  */
294
- getControlType: function (oControl) {
295
- return oControl && oControl.getMetadata().getName();
284
+ getControlType: function(oControl) {
285
+ return oControl?.getMetadata().getName();
296
286
  },
297
287
 
298
288
  /**
299
289
  * @inheritDoc
300
290
  */
301
- setAssociation: function (vParent, sName, sId) {
302
- var oMetadata = vParent.getMetadata().getAssociation(sName);
291
+ setAssociation: function(vParent, sName, sId) {
292
+ const oMetadata = vParent.getMetadata().getAssociation(sName);
303
293
  oMetadata.set(vParent, sId);
304
294
  },
305
295
 
306
296
  /**
307
297
  * @inheritDoc
308
298
  */
309
- getAssociation: function (vParent, sName) {
310
- var oMetadata = vParent.getMetadata().getAssociation(sName);
299
+ getAssociation: function(vParent, sName) {
300
+ const oMetadata = vParent.getMetadata().getAssociation(sName);
311
301
  return oMetadata.get(vParent);
312
302
  },
313
303
 
314
304
  /**
315
305
  * @inheritDoc
316
306
  */
317
- getAllAggregations: function (oParent) {
307
+ getAllAggregations: function(oParent) {
318
308
  return Promise.resolve(oParent.getMetadata().getAllAggregations());
319
309
  },
320
310
 
321
311
  /**
322
312
  * @inheritDoc
323
313
  */
324
- getAggregation: function (oParent, sName) {
325
- return this.findAggregation(oParent, sName)
326
- .then(function (oAggregation) {
327
- if (oAggregation) {
328
- return oParent[oAggregation._sGetter]();
329
- }
330
- return undefined;
331
- });
314
+ getAggregation: async function(oParent, sName) {
315
+ const oAggregation = await this.findAggregation(oParent, sName);
316
+ if (oAggregation) {
317
+ return oParent[oAggregation._sGetter]();
318
+ }
319
+ return undefined;
332
320
  },
333
321
 
334
322
  /**
335
323
  * @inheritDoc
336
324
  */
337
- insertAggregation: async function (oParent, sName, oObject, iIndex) {
325
+ insertAggregation: async function(oParent, sName, oObject, iIndex) {
338
326
  //special handling without invalidation for customData
339
327
  if (sName === "customData") {
340
328
  oParent.insertAggregation(sName, oObject, iIndex, /*bSuppressInvalidate=*/true);
@@ -354,7 +342,7 @@ sap.ui.define([
354
342
  /**
355
343
  * @inheritDoc
356
344
  */
357
- removeAggregation: async function (oParent, sName, oObject) {
345
+ removeAggregation: async function(oParent, sName, oObject) {
358
346
  //special handling without invalidation for customData
359
347
  if (sName === "customData") {
360
348
  oParent.removeAggregation(sName, oObject, /*bSuppressInvalidate=*/true);
@@ -409,75 +397,66 @@ sap.ui.define([
409
397
  /**
410
398
  * @inheritDoc
411
399
  */
412
- removeAllAggregation: function (oControl, sName) {
400
+ removeAllAggregation: async function(oControl, sName) {
413
401
  //special handling without invalidation for customData
414
402
  if (sName === "customData") {
415
403
  oControl.removeAllAggregation(sName, /*bSuppressInvalidate=*/true);
416
- return Promise.resolve();
404
+ } else {
405
+ const oAggregation = await this.findAggregation(oControl, sName);
406
+ if (oAggregation) {
407
+ oControl[oAggregation._sRemoveAllMutator]();
408
+ }
417
409
  }
418
- return this.findAggregation(oControl, sName)
419
- .then(function (oAggregation) {
420
- if (oAggregation) {
421
- oControl[oAggregation._sRemoveAllMutator]();
422
- }
423
- });
424
410
  },
425
411
 
426
412
  /**
427
413
  * @inheritDoc
428
414
  */
429
- getBindingTemplate: function (oControl, sAggregationName) {
430
- var oBinding = oControl.getBindingInfo(sAggregationName);
431
- return Promise.resolve(oBinding && oBinding.template);
415
+ getBindingTemplate: function(oControl, sAggregationName) {
416
+ const oBinding = oControl.getBindingInfo(sAggregationName);
417
+ return Promise.resolve(oBinding?.template);
432
418
  },
433
419
 
434
420
  /**
435
421
  * @inheritDoc
436
422
  */
437
- updateAggregation: function (oControl, sAggregationName) {
438
- return this.findAggregation(oControl, sAggregationName)
439
- .then(function (oAggregation) {
440
- if (oAggregation && oControl.getBinding(sAggregationName)) {
441
- oControl[oAggregation._sDestructor]();
442
- oControl.updateAggregation(sAggregationName);
443
- }
444
- });
423
+ updateAggregation: async function(oControl, sAggregationName) {
424
+ const oAggregation = await this.findAggregation(oControl, sAggregationName);
425
+ if (oAggregation && oControl.getBinding(sAggregationName)) {
426
+ oControl[oAggregation._sDestructor]();
427
+ oControl.updateAggregation(sAggregationName);
428
+ }
445
429
  },
446
430
 
447
431
  /**
448
432
  * @inheritDoc
449
433
  */
450
- findIndexInParentAggregation: function(oControl) {
451
- var oParent = this.getParent(oControl);
434
+ findIndexInParentAggregation: async function(oControl) {
435
+ const oParent = this.getParent(oControl);
452
436
 
453
437
  if (!oParent) {
454
- return Promise.resolve(-1);
438
+ return -1;
455
439
  }
456
440
 
457
- return this.getParentAggregationName(oControl)
458
- .then(function (sParentAggregationName) {
459
- // we need all controls in the aggregation
460
- return this.getAggregation(oParent, sParentAggregationName);
461
- }.bind(this))
462
- .then(function (aControlsInAggregation) {
463
- // if aControls is an array:
464
- if (Array.isArray(aControlsInAggregation)) {
465
- // then the aggregtion is multiple and we can find the index of
466
- // oControl in the array
467
- return aControlsInAggregation.indexOf(oControl);
468
- } else {
469
- // if aControlsInAggregation is not an array, then the aggregation is
470
- // of type 0..1 and aControlsInAggregation is the oControl provided
471
- // to the function initially, so its index is 0
472
- return 0;
473
- }
474
- });
441
+ const sParentAggregationName = await this.getParentAggregationName(oControl);
442
+ // we need all controls in the aggregation
443
+ const aControlsInAggregation = await this.getAggregation(oParent, sParentAggregationName);
444
+ // if aControls is an array:
445
+ if (Array.isArray(aControlsInAggregation)) {
446
+ // then the aggregation is multiple and we can find the index of oControl in the array
447
+ return aControlsInAggregation.indexOf(oControl);
448
+ } else {
449
+ // if aControlsInAggregation is not an array, then the aggregation is
450
+ // of type 0..1 and aControlsInAggregation is the oControl provided
451
+ // to the function initially, so its index is 0
452
+ return 0;
453
+ }
475
454
  },
476
455
 
477
456
  /**
478
457
  * @inheritDoc
479
458
  */
480
- getParentAggregationName: function (oControl) {
459
+ getParentAggregationName: function(oControl) {
481
460
  return Promise.resolve(oControl.sParentAggregationName);
482
461
  },
483
462
 
@@ -485,71 +464,57 @@ sap.ui.define([
485
464
  * @inheritDoc
486
465
  */
487
466
  findAggregation: function(oControl, sAggregationName) {
488
- return new Promise(function (resolve, reject) {
489
- if (oControl) {
490
- if (oControl.getMetadata) {
491
- var oMetadata = oControl.getMetadata();
492
- var oAggregations = oMetadata.getAllAggregations();
493
- if (oAggregations) {
494
- resolve(oAggregations[sAggregationName]);
495
- return;
496
- }
497
- }
498
- }
499
- resolve();
500
- });
467
+ if (oControl?.getMetadata) {
468
+ const oMetadata = oControl.getMetadata();
469
+ const oAggregations = oMetadata.getAllAggregations();
470
+ return Promise.resolve(oAggregations[sAggregationName]);
471
+ }
472
+ return Promise.resolve(undefined);
501
473
  },
502
474
 
503
475
  /**
504
476
  * @inheritDoc
505
477
  */
506
- validateType: function(oControl, oAggregationMetadata, oParent, sFragment) {
507
- var sTypeOrInterface = oAggregationMetadata.type;
478
+ validateType: async function(oControl, oAggregationMetadata, oParent, sFragment) {
479
+ const sTypeOrInterface = oAggregationMetadata.type;
508
480
 
509
- return this.getAggregation(oParent, oAggregationMetadata.name)
510
- .then(function (oAggregation) {
511
- // if aggregation is not multiple and already has element inside, then it is not valid for element
512
- if (oAggregationMetadata.multiple === false && oAggregation && oAggregation.length > 0) {
513
- return false;
514
- }
515
- return oControl.isA(sTypeOrInterface);
516
- });
481
+ const oAggregation = await this.getAggregation(oParent, oAggregationMetadata.name);
482
+ // if aggregation is not multiple and already has element inside, then it is not valid for element
483
+ if (oAggregationMetadata.multiple === false && oAggregation && oAggregation.length > 0) {
484
+ return false;
485
+ }
486
+ return oControl.isA(sTypeOrInterface);
517
487
  },
518
488
 
519
489
  /**
520
490
  * @inheritDoc
521
491
  */
522
- instantiateFragment: function(sFragment, sNamespace, oView) {
523
- var oFragment = XMLHelper.parse(sFragment);
524
-
525
- return this._checkAndPrefixIdsInFragment(oFragment, sNamespace)
526
- .then(function (oFragment) {
527
- return Fragment.load({
528
- definition: oFragment,
529
- sId: oView && oView.getId(),
530
- controller: oView.getController()
531
- });
532
- }).then(function(vNewControls) {
533
- if (vNewControls && !Array.isArray(vNewControls)) {
534
- vNewControls = [vNewControls];
535
- }
536
- return vNewControls || [];
537
- });
492
+ instantiateFragment: async function(sFragment, sNamespace, oView) {
493
+ const oInputFragment = XMLHelper.parse(sFragment);
494
+ const oFragment = await this._checkAndPrefixIdsInFragment(oInputFragment, sNamespace);
495
+ const vNewControls = await Fragment.load({
496
+ definition: oFragment,
497
+ sId: oView && oView.getId(),
498
+ controller: oView.getController()
499
+ });
500
+ if (vNewControls && !Array.isArray(vNewControls)) {
501
+ return [vNewControls];
502
+ }
503
+ return vNewControls || [];
538
504
  },
539
505
 
540
506
  /**
541
507
  * @inheritDoc
542
508
  */
543
- templateControlFragment: function(sFragmentName, mPreprocessorSettings, oView) {
544
- return BaseTreeModifier._templateFragment(
509
+ templateControlFragment: async function(sFragmentName, mPreprocessorSettings, oView) {
510
+ const oFragment = await BaseTreeModifier._templateFragment(
545
511
  sFragmentName,
546
512
  mPreprocessorSettings
547
- ).then(function(oFragment) {
548
- var oController = (oView && oView.getController()) || undefined;
549
- return Fragment.load({
550
- definition: oFragment,
551
- controller: oController
552
- });
513
+ );
514
+ const oController = oView?.getController();
515
+ return Fragment.load({
516
+ definition: oFragment,
517
+ controller: oController
553
518
  });
554
519
  },
555
520
 
@@ -561,7 +526,7 @@ sap.ui.define([
561
526
  },
562
527
 
563
528
  _getFlexCustomData: function(oControl, sType) {
564
- var oCustomData = typeof oControl === "object"
529
+ const oCustomData = typeof oControl === "object"
565
530
  && typeof oControl.data === "function"
566
531
  && oControl.data("sap-ui-custom-settings");
567
532
  return ObjectPath.get(["sap.ui.fl", sType], oCustomData);
@@ -570,14 +535,14 @@ sap.ui.define([
570
535
  /**
571
536
  * @inheritDoc
572
537
  */
573
- bindAggregation: function (oControl, sAggregationName, oBindingInfo) {
538
+ bindAggregation: function(oControl, sAggregationName, oBindingInfo) {
574
539
  return Promise.resolve(oControl.bindAggregation(sAggregationName, oBindingInfo));
575
540
  },
576
541
 
577
542
  /**
578
543
  * @inheritDoc
579
544
  */
580
- unbindAggregation: function (oControl, sAggregationName) {
545
+ unbindAggregation: function(oControl, sAggregationName) {
581
546
  // bSuppressReset is not supported
582
547
  return Promise.resolve(oControl.unbindAggregation(sAggregationName));
583
548
  },
@@ -585,25 +550,23 @@ sap.ui.define([
585
550
  /**
586
551
  * @inheritDoc
587
552
  */
588
- getExtensionPointInfo: function(sExtensionPointName, oView) {
589
- var oViewNode = (oView._xContent) ? oView._xContent : oView;
590
- return XmlTreeModifier.getExtensionPointInfo(sExtensionPointName, oViewNode)
591
- .then(function (oExtensionPointInfo) {
592
- if (oExtensionPointInfo) {
593
- // decrease the index by 1 to get the index of the extension point itself for js-case
594
- oExtensionPointInfo.index--;
595
- oExtensionPointInfo.parent = oExtensionPointInfo.parent && this._byId(oView.createId(oExtensionPointInfo.parent.getAttribute("id")));
596
- oExtensionPointInfo.defaultContent = oExtensionPointInfo.defaultContent
597
- .map(function (oNode) {
598
- var sId = oView.createId(oNode.getAttribute("id"));
599
- return this._byId(sId);
600
- }.bind(this))
601
- .filter(function (oControl) {
602
- return !!oControl;
603
- });
604
- }
605
- return oExtensionPointInfo;
606
- }.bind(this));
553
+ getExtensionPointInfo: async function(sExtensionPointName, oView) {
554
+ const oViewNode = (oView._xContent) ? oView._xContent : oView;
555
+ const oExtensionPointInfo = await XmlTreeModifier.getExtensionPointInfo(sExtensionPointName, oViewNode);
556
+ if (oExtensionPointInfo) {
557
+ // decrease the index by 1 to get the index of the extension point itself for js-case
558
+ oExtensionPointInfo.index--;
559
+ oExtensionPointInfo.parent = oExtensionPointInfo.parent && this._byId(oView.createId(oExtensionPointInfo.parent.getAttribute("id")));
560
+ oExtensionPointInfo.defaultContent = oExtensionPointInfo.defaultContent
561
+ .map((oNode) => {
562
+ const sId = oView.createId(oNode.getAttribute("id"));
563
+ return this._byId(sId);
564
+ })
565
+ .filter((oControl) => {
566
+ return !!oControl;
567
+ });
568
+ }
569
+ return oExtensionPointInfo;
607
570
  }
608
571
  };
609
572