@sapui5/sap.fe.core 1.102.2 → 1.104.1

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 (324) hide show
  1. package/package.json +6 -6
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +73 -30
  4. package/src/sap/fe/core/AppComponent.ts +65 -43
  5. package/src/sap/fe/core/AppStateHandler.js +82 -70
  6. package/src/sap/fe/core/AppStateHandler.ts +32 -37
  7. package/src/sap/fe/core/BaseController.js +11 -9
  8. package/src/sap/fe/core/BaseController.ts +15 -13
  9. package/src/sap/fe/core/CommonUtils.js +227 -126
  10. package/src/sap/fe/core/CommonUtils.ts +240 -163
  11. package/src/sap/fe/core/ExtensionAPI.js +24 -27
  12. package/src/sap/fe/core/ExtensionAPI.ts +36 -38
  13. package/src/sap/fe/core/PageController.js +4 -4
  14. package/src/sap/fe/core/PageController.ts +4 -5
  15. package/src/sap/fe/core/TemplateComponent.js +1 -1
  16. package/src/sap/fe/core/TemplateComponent.ts +6 -6
  17. package/src/sap/fe/core/TemplateModel.js +1 -1
  18. package/src/sap/fe/core/TemplateModel.ts +1 -1
  19. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
  20. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
  21. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
  23. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
  24. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
  25. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
  26. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
  27. package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
  28. package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
  29. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
  30. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
  31. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
  32. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
  33. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
  34. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
  35. package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
  36. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
  37. package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
  38. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
  39. package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
  40. package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
  41. package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
  42. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
  43. package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
  44. package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
  45. package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
  46. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
  47. package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
  48. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  49. package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
  50. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  51. package/src/sap/fe/core/controllerextensions/Share.js +170 -139
  52. package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
  56. package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
  58. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
  59. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
  60. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
  61. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
  62. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
  63. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
  64. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
  65. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
  66. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
  67. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
  68. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
  69. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
  70. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
  71. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
  72. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
  73. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
  74. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
  75. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
  76. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
  77. package/src/sap/fe/core/controls/Any.js +9 -5
  78. package/src/sap/fe/core/controls/Any.ts +10 -4
  79. package/src/sap/fe/core/controls/CommandExecution.js +11 -25
  80. package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
  81. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  82. package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
  84. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
  86. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
  87. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
  88. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
  89. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  90. package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
  91. package/src/sap/fe/core/controls/FileWrapper.js +7 -2
  92. package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
  93. package/src/sap/fe/core/controls/FilterBar.js +6 -2
  94. package/src/sap/fe/core/controls/FilterBar.ts +13 -9
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
  97. package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
  98. package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
  99. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
  100. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
  101. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
  102. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
  103. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
  104. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
  105. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
  106. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
  107. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
  108. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
  109. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
  110. package/src/sap/fe/core/converters/ConverterContext.js +26 -33
  111. package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
  112. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  113. package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
  114. package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
  115. package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
  116. package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
  117. package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
  118. package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
  119. package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
  120. package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
  121. package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
  122. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
  123. package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
  124. package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
  125. package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
  126. package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
  127. package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
  128. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
  129. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
  130. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
  131. package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
  132. package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
  133. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
  134. package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
  135. package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
  136. package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
  137. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
  138. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
  139. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
  140. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
  141. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
  142. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
  143. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
  144. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
  145. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
  146. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
  147. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
  148. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
  149. package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
  150. package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
  151. package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
  152. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
  153. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
  154. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
  155. package/src/sap/fe/core/converters/helpers/ID.js +48 -46
  156. package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
  157. package/src/sap/fe/core/converters/helpers/Key.js +7 -7
  158. package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
  159. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  160. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
  161. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
  162. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
  163. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
  164. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
  165. package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
  166. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
  167. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
  168. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
  169. package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
  170. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
  171. package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
  172. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
  173. package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
  174. package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
  175. package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
  176. package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
  177. package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
  178. package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
  179. package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
  180. package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
  181. package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
  182. package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
  183. package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
  184. package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
  185. package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
  186. package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
  187. package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
  188. package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
  189. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
  190. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
  191. package/src/sap/fe/core/helpers/EditState.js +1 -6
  192. package/src/sap/fe/core/helpers/EditState.ts +5 -10
  193. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
  194. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
  195. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  196. package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
  197. package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
  198. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
  199. package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
  200. package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
  201. package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
  202. package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
  203. package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
  204. package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
  205. package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
  206. package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
  207. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  208. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
  209. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
  210. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
  211. package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
  212. package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
  213. package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
  214. package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
  215. package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
  216. package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
  217. package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
  218. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
  219. package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
  220. package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
  221. package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
  222. package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
  223. package/src/sap/fe/core/library.js +42 -3
  224. package/src/sap/fe/core/library.ts +38 -0
  225. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
  226. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
  227. package/src/sap/fe/core/messagebundle.properties +39 -63
  228. package/src/sap/fe/core/messagebundle_ar.properties +25 -39
  229. package/src/sap/fe/core/messagebundle_bg.properties +25 -39
  230. package/src/sap/fe/core/messagebundle_ca.properties +25 -39
  231. package/src/sap/fe/core/messagebundle_cs.properties +25 -39
  232. package/src/sap/fe/core/messagebundle_cy.properties +25 -39
  233. package/src/sap/fe/core/messagebundle_da.properties +25 -39
  234. package/src/sap/fe/core/messagebundle_de.properties +25 -39
  235. package/src/sap/fe/core/messagebundle_el.properties +26 -40
  236. package/src/sap/fe/core/messagebundle_en.properties +25 -39
  237. package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
  238. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
  239. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
  240. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
  241. package/src/sap/fe/core/messagebundle_es.properties +27 -41
  242. package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
  243. package/src/sap/fe/core/messagebundle_et.properties +25 -39
  244. package/src/sap/fe/core/messagebundle_fi.properties +25 -39
  245. package/src/sap/fe/core/messagebundle_fr.properties +26 -40
  246. package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
  247. package/src/sap/fe/core/messagebundle_hi.properties +25 -39
  248. package/src/sap/fe/core/messagebundle_hr.properties +25 -39
  249. package/src/sap/fe/core/messagebundle_hu.properties +25 -39
  250. package/src/sap/fe/core/messagebundle_id.properties +25 -39
  251. package/src/sap/fe/core/messagebundle_it.properties +41 -55
  252. package/src/sap/fe/core/messagebundle_iw.properties +25 -39
  253. package/src/sap/fe/core/messagebundle_ja.properties +25 -39
  254. package/src/sap/fe/core/messagebundle_kk.properties +25 -39
  255. package/src/sap/fe/core/messagebundle_ko.properties +30 -44
  256. package/src/sap/fe/core/messagebundle_lt.properties +25 -39
  257. package/src/sap/fe/core/messagebundle_lv.properties +25 -39
  258. package/src/sap/fe/core/messagebundle_ms.properties +25 -39
  259. package/src/sap/fe/core/messagebundle_nl.properties +27 -41
  260. package/src/sap/fe/core/messagebundle_no.properties +25 -39
  261. package/src/sap/fe/core/messagebundle_pl.properties +26 -40
  262. package/src/sap/fe/core/messagebundle_pt.properties +26 -40
  263. package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
  264. package/src/sap/fe/core/messagebundle_ro.properties +25 -39
  265. package/src/sap/fe/core/messagebundle_ru.properties +25 -39
  266. package/src/sap/fe/core/messagebundle_sh.properties +25 -39
  267. package/src/sap/fe/core/messagebundle_sk.properties +25 -39
  268. package/src/sap/fe/core/messagebundle_sl.properties +25 -39
  269. package/src/sap/fe/core/messagebundle_sv.properties +25 -39
  270. package/src/sap/fe/core/messagebundle_th.properties +25 -39
  271. package/src/sap/fe/core/messagebundle_tr.properties +25 -39
  272. package/src/sap/fe/core/messagebundle_uk.properties +25 -39
  273. package/src/sap/fe/core/messagebundle_vi.properties +25 -39
  274. package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
  275. package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
  276. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  277. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
  278. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
  279. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
  280. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  281. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
  282. package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
  283. package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
  284. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  285. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
  286. package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
  287. package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
  288. package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
  289. package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
  290. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
  291. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
  292. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
  293. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
  294. package/src/sap/fe/core/support/CommonHelper.js +3 -2
  295. package/src/sap/fe/core/support/CommonHelper.ts +9 -13
  296. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  297. package/src/sap/fe/core/support/Diagnostics.ts +5 -5
  298. package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
  299. package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
  300. package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
  301. package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
  302. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
  303. package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
  304. package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
  305. package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
  306. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  307. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
  308. package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
  309. package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
  310. package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
  311. package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
  312. package/src/sap/fe/core/templating/FilterHelper.js +16 -15
  313. package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
  314. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  315. package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
  316. package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
  317. package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
  318. package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
  319. package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
  320. package/src/sap/fe/core/templating/UIFormatters.js +152 -95
  321. package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
  322. package/src/sap/fe/core/type/Email.js +2 -2
  323. package/src/sap/fe/core/type/Email.ts +2 -2
  324. package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
@@ -1,29 +1,33 @@
1
- import {
2
- ConverterOutput,
3
- EntitySet as _EntitySet,
4
- EntityType as _EntityType,
5
- NavigationProperty as _NavigationProperty,
6
- Singleton as _Singleton
7
- } from "@sap-ux/annotation-converter";
8
- import { Annotation, AnnotationList, AnnotationRecord, Expression, ParserOutput } from "@sap-ux/vocabularies-types";
9
- import {
10
- Action,
11
- ComplexType,
12
- EntityContainer,
1
+ // This file is retrieved from @sap-ux/annotation-converter, shared code with tool suite
2
+
3
+ import type {
4
+ Annotation,
5
+ AnnotationList,
6
+ AnnotationRecord,
7
+ ConvertedMetadata,
13
8
  EntitySet,
14
9
  EntityType,
10
+ Expression,
11
+ NavigationProperty,
15
12
  Property,
13
+ RawAction,
14
+ RawComplexType,
15
+ RawEntityContainer,
16
+ RawEntitySet,
17
+ RawEntityType,
18
+ RawMetadata,
19
+ RawProperty,
20
+ RawSingleton,
21
+ RawTypeDefinition,
22
+ RawV4NavigationProperty,
16
23
  Reference,
17
24
  ReferentialConstraint,
18
- Singleton,
19
- TypeDefinition,
20
- V4NavigationProperty
21
- } from "@sap-ux/vocabularies-types/dist/Parser";
22
- // This file is retrieved from @sap-ux/annotation-converter, shared code with tool suite
25
+ Singleton
26
+ } from "@sap-ux/vocabularies-types";
23
27
  import { AnnotationConverter } from "sap/fe/core/converters/common";
24
- import { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
25
- import Context from "sap/ui/model/Context";
26
- import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
28
+ import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
29
+ import type Context from "sap/ui/model/Context";
30
+ import type ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
27
31
  import { generate } from "../helpers/StableIdHelper";
28
32
 
29
33
  const VOCABULARY_ALIAS: any = {
@@ -80,7 +84,7 @@ function parsePropertyValue(
80
84
  oCapabilities: EnvironmentCapabilities
81
85
  ): any {
82
86
  let value;
83
- const currentPropertyTarget: string = currentTarget + "/" + propertyKey;
87
+ const currentPropertyTarget: string = `${currentTarget}/${propertyKey}`;
84
88
  const typeOfAnnotation = typeof annotationObject;
85
89
  if (annotationObject === null) {
86
90
  value = { type: "Null", Null: null };
@@ -96,7 +100,7 @@ function parsePropertyValue(
96
100
  Collection: annotationObject.map((subAnnotationObject, subAnnotationObjectIndex) =>
97
101
  parseAnnotationObject(
98
102
  subAnnotationObject,
99
- currentPropertyTarget + "/" + subAnnotationObjectIndex,
103
+ `${currentPropertyTarget}/${subAnnotationObjectIndex}`,
100
104
  annotationsLists,
101
105
  oCapabilities
102
106
  )
@@ -180,7 +184,7 @@ function parsePropertyValue(
180
184
  } else if (annotationObject.$EnumMember !== undefined) {
181
185
  value = {
182
186
  type: "EnumMember",
183
- EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0]) + "/" + annotationObject.$EnumMember.split("/")[1]
187
+ EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
184
188
  };
185
189
  } else if (annotationObject.$Type) {
186
190
  value = {
@@ -208,7 +212,7 @@ function mapNameToAlias(annotationName: string): string {
208
212
  pathPart += "@";
209
213
  }
210
214
  const lastDot = annoPart.lastIndexOf(".");
211
- return pathPart + VOCABULARY_ALIAS[annoPart.substr(0, lastDot)] + "." + annoPart.substr(lastDot + 1);
215
+ return `${pathPart + VOCABULARY_ALIAS[annoPart.substr(0, lastDot)]}.${annoPart.substr(lastDot + 1)}`;
212
216
  }
213
217
  function parseAnnotationObject(
214
218
  annotationObject: any,
@@ -264,50 +268,50 @@ function parseAnnotationObject(
264
268
  } else if (annotationObject.$EnumMember !== undefined) {
265
269
  parsedAnnotationObject = {
266
270
  type: "EnumMember",
267
- EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0]) + "/" + annotationObject.$EnumMember.split("/")[1]
271
+ EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
268
272
  };
269
273
  } else if (Array.isArray(annotationObject)) {
270
- const parsedAnnotationCollection = parsedAnnotationObject as any;
274
+ const parsedAnnotationCollection = parsedAnnotationObject;
271
275
  parsedAnnotationCollection.collection = annotationObject.map((subAnnotationObject, subAnnotationIndex) =>
272
- parseAnnotationObject(subAnnotationObject, currentObjectTarget + "/" + subAnnotationIndex, annotationsLists, oCapabilities)
276
+ parseAnnotationObject(subAnnotationObject, `${currentObjectTarget}/${subAnnotationIndex}`, annotationsLists, oCapabilities)
273
277
  );
274
278
  if (annotationObject.length > 0) {
275
279
  if (annotationObject[0].hasOwnProperty("$PropertyPath")) {
276
- (parsedAnnotationCollection.collection as any).type = "PropertyPath";
280
+ parsedAnnotationCollection.collection.type = "PropertyPath";
277
281
  } else if (annotationObject[0].hasOwnProperty("$Path")) {
278
- (parsedAnnotationCollection.collection as any).type = "Path";
282
+ parsedAnnotationCollection.collection.type = "Path";
279
283
  } else if (annotationObject[0].hasOwnProperty("$NavigationPropertyPath")) {
280
- (parsedAnnotationCollection.collection as any).type = "NavigationPropertyPath";
284
+ parsedAnnotationCollection.collection.type = "NavigationPropertyPath";
281
285
  } else if (annotationObject[0].hasOwnProperty("$AnnotationPath")) {
282
- (parsedAnnotationCollection.collection as any).type = "AnnotationPath";
286
+ parsedAnnotationCollection.collection.type = "AnnotationPath";
283
287
  } else if (annotationObject[0].hasOwnProperty("$Type")) {
284
- (parsedAnnotationCollection.collection as any).type = "Record";
288
+ parsedAnnotationCollection.collection.type = "Record";
285
289
  } else if (annotationObject[0].hasOwnProperty("$If")) {
286
- (parsedAnnotationCollection.collection as any).type = "If";
290
+ parsedAnnotationCollection.collection.type = "If";
287
291
  } else if (annotationObject[0].hasOwnProperty("$And")) {
288
- (parsedAnnotationCollection.collection as any).type = "And";
292
+ parsedAnnotationCollection.collection.type = "And";
289
293
  } else if (annotationObject[0].hasOwnProperty("$Or")) {
290
- (parsedAnnotationCollection.collection as any).type = "Or";
294
+ parsedAnnotationCollection.collection.type = "Or";
291
295
  } else if (annotationObject[0].hasOwnProperty("$Eq")) {
292
- (parsedAnnotationCollection.collection as any).type = "Eq";
296
+ parsedAnnotationCollection.collection.type = "Eq";
293
297
  } else if (annotationObject[0].hasOwnProperty("$Ne")) {
294
- (parsedAnnotationCollection.collection as any).type = "Ne";
298
+ parsedAnnotationCollection.collection.type = "Ne";
295
299
  } else if (annotationObject[0].hasOwnProperty("$Not")) {
296
- (parsedAnnotationCollection.collection as any).type = "Not";
300
+ parsedAnnotationCollection.collection.type = "Not";
297
301
  } else if (annotationObject[0].hasOwnProperty("$Gt")) {
298
- (parsedAnnotationCollection.collection as any).type = "Gt";
302
+ parsedAnnotationCollection.collection.type = "Gt";
299
303
  } else if (annotationObject[0].hasOwnProperty("$Ge")) {
300
- (parsedAnnotationCollection.collection as any).type = "Ge";
304
+ parsedAnnotationCollection.collection.type = "Ge";
301
305
  } else if (annotationObject[0].hasOwnProperty("$Lt")) {
302
- (parsedAnnotationCollection.collection as any).type = "Lt";
306
+ parsedAnnotationCollection.collection.type = "Lt";
303
307
  } else if (annotationObject[0].hasOwnProperty("$Le")) {
304
- (parsedAnnotationCollection.collection as any).type = "Le";
308
+ parsedAnnotationCollection.collection.type = "Le";
305
309
  } else if (annotationObject[0].hasOwnProperty("$Apply")) {
306
- (parsedAnnotationCollection.collection as any).type = "Apply";
310
+ parsedAnnotationCollection.collection.type = "Apply";
307
311
  } else if (typeof annotationObject[0] === "object") {
308
- (parsedAnnotationCollection.collection as any).type = "Record";
312
+ parsedAnnotationCollection.collection.type = "Record";
309
313
  } else {
310
- (parsedAnnotationCollection.collection as any).type = "String";
314
+ parsedAnnotationCollection.collection.type = "String";
311
315
  }
312
316
  }
313
317
  } else {
@@ -446,7 +450,7 @@ function createAnnotationLists(
446
450
  const annotationOfAnnotationSplit = annotationKey.split("@");
447
451
  if (annotationOfAnnotationSplit.length > 2) {
448
452
  currentOutAnnotationObject = getOrCreateAnnotationList(
449
- annotationTarget + "@" + annotationOfAnnotationSplit[1],
453
+ `${annotationTarget}@${annotationOfAnnotationSplit[1]}`,
450
454
  annotationLists
451
455
  );
452
456
  annotationKey = annotationOfAnnotationSplit[2];
@@ -462,9 +466,9 @@ function createAnnotationLists(
462
466
  term: `${annotationKey}`,
463
467
  qualifier: qualifier
464
468
  };
465
- let currentAnnotationTarget = annotationTarget + "@" + parsedAnnotationObject.term;
469
+ let currentAnnotationTarget = `${annotationTarget}@${parsedAnnotationObject.term}`;
466
470
  if (qualifier) {
467
- currentAnnotationTarget += "#" + qualifier;
471
+ currentAnnotationTarget += `#${qualifier}`;
468
472
  }
469
473
  let isCollection = false;
470
474
  const typeofAnnotation = typeof annotationObject;
@@ -510,55 +514,55 @@ function createAnnotationLists(
510
514
  } else if (annotationObject.$EnumMember !== undefined) {
511
515
  parsedAnnotationObject.value = {
512
516
  type: "EnumMember",
513
- EnumMember: mapNameToAlias(annotationObject.$EnumMember.split("/")[0]) + "/" + annotationObject.$EnumMember.split("/")[1]
517
+ EnumMember: `${mapNameToAlias(annotationObject.$EnumMember.split("/")[0])}/${annotationObject.$EnumMember.split("/")[1]}`
514
518
  };
515
519
  } else if (Array.isArray(annotationObject)) {
516
520
  isCollection = true;
517
521
  parsedAnnotationObject.collection = annotationObject.map((subAnnotationObject, subAnnotationIndex) =>
518
522
  parseAnnotationObject(
519
523
  subAnnotationObject,
520
- currentAnnotationTarget + "/" + subAnnotationIndex,
524
+ `${currentAnnotationTarget}/${subAnnotationIndex}`,
521
525
  annotationLists,
522
526
  oCapabilities
523
527
  )
524
528
  );
525
529
  if (annotationObject.length > 0) {
526
530
  if (annotationObject[0].hasOwnProperty("$PropertyPath")) {
527
- (parsedAnnotationObject.collection as any).type = "PropertyPath";
531
+ parsedAnnotationObject.collection.type = "PropertyPath";
528
532
  } else if (annotationObject[0].hasOwnProperty("$Path")) {
529
- (parsedAnnotationObject.collection as any).type = "Path";
533
+ parsedAnnotationObject.collection.type = "Path";
530
534
  } else if (annotationObject[0].hasOwnProperty("$NavigationPropertyPath")) {
531
- (parsedAnnotationObject.collection as any).type = "NavigationPropertyPath";
535
+ parsedAnnotationObject.collection.type = "NavigationPropertyPath";
532
536
  } else if (annotationObject[0].hasOwnProperty("$AnnotationPath")) {
533
- (parsedAnnotationObject.collection as any).type = "AnnotationPath";
537
+ parsedAnnotationObject.collection.type = "AnnotationPath";
534
538
  } else if (annotationObject[0].hasOwnProperty("$Type")) {
535
- (parsedAnnotationObject.collection as any).type = "Record";
539
+ parsedAnnotationObject.collection.type = "Record";
536
540
  } else if (annotationObject[0].hasOwnProperty("$If")) {
537
- (parsedAnnotationObject.collection as any).type = "If";
541
+ parsedAnnotationObject.collection.type = "If";
538
542
  } else if (annotationObject[0].hasOwnProperty("$Or")) {
539
- (parsedAnnotationObject.collection as any).type = "Or";
543
+ parsedAnnotationObject.collection.type = "Or";
540
544
  } else if (annotationObject[0].hasOwnProperty("$Eq")) {
541
- (parsedAnnotationObject.collection as any).type = "Eq";
545
+ parsedAnnotationObject.collection.type = "Eq";
542
546
  } else if (annotationObject[0].hasOwnProperty("$Ne")) {
543
- (parsedAnnotationObject.collection as any).type = "Ne";
547
+ parsedAnnotationObject.collection.type = "Ne";
544
548
  } else if (annotationObject[0].hasOwnProperty("$Not")) {
545
- (parsedAnnotationObject.collection as any).type = "Not";
549
+ parsedAnnotationObject.collection.type = "Not";
546
550
  } else if (annotationObject[0].hasOwnProperty("$Gt")) {
547
- (parsedAnnotationObject.collection as any).type = "Gt";
551
+ parsedAnnotationObject.collection.type = "Gt";
548
552
  } else if (annotationObject[0].hasOwnProperty("$Ge")) {
549
- (parsedAnnotationObject.collection as any).type = "Ge";
553
+ parsedAnnotationObject.collection.type = "Ge";
550
554
  } else if (annotationObject[0].hasOwnProperty("$Lt")) {
551
- (parsedAnnotationObject.collection as any).type = "Lt";
555
+ parsedAnnotationObject.collection.type = "Lt";
552
556
  } else if (annotationObject[0].hasOwnProperty("$Le")) {
553
- (parsedAnnotationObject.collection as any).type = "Le";
557
+ parsedAnnotationObject.collection.type = "Le";
554
558
  } else if (annotationObject[0].hasOwnProperty("$And")) {
555
- (parsedAnnotationObject.collection as any).type = "And";
559
+ parsedAnnotationObject.collection.type = "And";
556
560
  } else if (annotationObject[0].hasOwnProperty("$Apply")) {
557
- (parsedAnnotationObject.collection as any).type = "Apply";
561
+ parsedAnnotationObject.collection.type = "Apply";
558
562
  } else if (typeof annotationObject[0] === "object") {
559
- (parsedAnnotationObject.collection as any).type = "Record";
563
+ parsedAnnotationObject.collection.type = "Record";
560
564
  } else {
561
- (parsedAnnotationObject.collection as any).type = "String";
565
+ parsedAnnotationObject.collection.type = "String";
562
566
  }
563
567
  }
564
568
  } else {
@@ -599,8 +603,8 @@ function createAnnotationLists(
599
603
  }
600
604
  }
601
605
 
602
- function prepareProperty(propertyDefinition: any, entityTypeObject: EntityType | ComplexType, propertyName: string): Property {
603
- const propertyObject: Property = {
606
+ function prepareProperty(propertyDefinition: any, entityTypeObject: RawEntityType | RawComplexType, propertyName: string): RawProperty {
607
+ const propertyObject: RawProperty = {
604
608
  _type: "Property",
605
609
  name: propertyName,
606
610
  fullyQualifiedName: `${entityTypeObject.fullyQualifiedName}/${propertyName}`,
@@ -615,9 +619,9 @@ function prepareProperty(propertyDefinition: any, entityTypeObject: EntityType |
615
619
 
616
620
  function prepareNavigationProperty(
617
621
  navPropertyDefinition: any,
618
- entityTypeObject: EntityType | ComplexType,
622
+ entityTypeObject: RawEntityType | RawComplexType,
619
623
  navPropertyName: string
620
- ): V4NavigationProperty {
624
+ ): RawV4NavigationProperty {
621
625
  let referentialConstraint: ReferentialConstraint[] = [];
622
626
  if (navPropertyDefinition.$ReferentialConstraint) {
623
627
  referentialConstraint = Object.keys(navPropertyDefinition.$ReferentialConstraint).map((sourcePropertyName) => {
@@ -629,7 +633,7 @@ function prepareNavigationProperty(
629
633
  };
630
634
  });
631
635
  }
632
- const navigationProperty: V4NavigationProperty = {
636
+ const navigationProperty: RawV4NavigationProperty = {
633
637
  _type: "NavigationProperty",
634
638
  name: navPropertyName,
635
639
  fullyQualifiedName: `${entityTypeObject.fullyQualifiedName}/${navPropertyName}`,
@@ -643,8 +647,8 @@ function prepareNavigationProperty(
643
647
  return navigationProperty;
644
648
  }
645
649
 
646
- function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entityContainerName: string): EntitySet {
647
- const entitySetObject: EntitySet = {
650
+ function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entityContainerName: string): RawEntitySet {
651
+ const entitySetObject: RawEntitySet = {
648
652
  _type: "EntitySet",
649
653
  name: entitySetName,
650
654
  navigationPropertyBinding: {},
@@ -654,31 +658,31 @@ function prepareEntitySet(entitySetDefinition: any, entitySetName: string, entit
654
658
  return entitySetObject;
655
659
  }
656
660
 
657
- function prepareSingleton(singletonDefinition: any, singletonName: string, entityContainerName: string): Singleton {
661
+ function prepareSingleton(singletonDefinition: any, singletonName: string, entityContainerName: string): RawSingleton {
658
662
  return {
659
663
  _type: "Singleton",
660
664
  name: singletonName,
661
665
  navigationPropertyBinding: {},
662
- typeName: singletonDefinition.$Type,
666
+ entityTypeName: singletonDefinition.$Type,
663
667
  fullyQualifiedName: `${entityContainerName}/${singletonName}`,
664
668
  nullable: true
665
- } as Singleton;
669
+ };
666
670
  }
667
671
 
668
- function prepareTypeDefinition(typeDefinition: any, typeName: string, namespace: string): TypeDefinition {
669
- const typeObject: TypeDefinition = {
672
+ function prepareTypeDefinition(typeDefinition: any, typeName: string, namespace: string): RawTypeDefinition {
673
+ const typeObject: RawTypeDefinition = {
670
674
  _type: "TypeDefinition",
671
- name: typeName.replace(namespace + ".", ""),
675
+ name: typeName.replace(`${namespace}.`, ""),
672
676
  fullyQualifiedName: typeName,
673
677
  underlyingType: typeDefinition.$UnderlyingType
674
678
  };
675
679
  return typeObject;
676
680
  }
677
681
 
678
- function prepareComplexType(complexTypeDefinition: any, complexTypeName: string, namespace: string): ComplexType {
679
- const complexTypeObject: ComplexType = {
682
+ function prepareComplexType(complexTypeDefinition: any, complexTypeName: string, namespace: string): RawComplexType {
683
+ const complexTypeObject: RawComplexType = {
680
684
  _type: "ComplexType",
681
- name: complexTypeName.replace(namespace + ".", ""),
685
+ name: complexTypeName.replace(`${namespace}.`, ""),
682
686
  fullyQualifiedName: complexTypeName,
683
687
  properties: [],
684
688
  navigationProperties: []
@@ -717,16 +721,17 @@ function prepareEntityKeys(entityTypeDefinition: any, oMetaModelData: any): any
717
721
  return entityTypeDefinition.$Key || []; //handling of entity types without key as well as basetype
718
722
  }
719
723
 
720
- function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, namespace: string, metaModelData: any): EntityType {
724
+ function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, namespace: string, metaModelData: any): RawEntityType {
721
725
  const entityKeys: any = prepareEntityKeys(entityTypeDefinition, metaModelData);
722
726
 
723
- const entityTypeObject: EntityType = {
727
+ const entityTypeObject: RawEntityType = {
724
728
  _type: "EntityType",
725
- name: entityTypeName.replace(namespace + ".", ""),
729
+ name: entityTypeName.replace(`${namespace}.`, ""),
726
730
  fullyQualifiedName: entityTypeName,
727
731
  keys: [],
728
732
  entityProperties: [],
729
- navigationProperties: []
733
+ navigationProperties: [],
734
+ actions: {}
730
735
  };
731
736
 
732
737
  const entityProperties = Object.keys(entityTypeDefinition)
@@ -750,14 +755,14 @@ function prepareEntityType(entityTypeDefinition: any, entityTypeName: string, na
750
755
  });
751
756
 
752
757
  entityTypeObject.keys = entityKeys
753
- .map((entityKey: string) => entityProperties.find((property: Property) => property.name === entityKey))
758
+ .map((entityKey: string) => entityProperties.find((property: RawProperty) => property.name === entityKey))
754
759
  .filter((property: Property) => property !== undefined);
755
760
  entityTypeObject.entityProperties = entityProperties;
756
761
  entityTypeObject.navigationProperties = navigationProperties;
757
762
 
758
763
  return entityTypeObject;
759
764
  }
760
- function prepareAction(actionName: string, actionRawData: MetaModelAction, namespace: string, entityContainerName: string): Action {
765
+ function prepareAction(actionName: string, actionRawData: MetaModelAction, namespace: string, entityContainerName: string): RawAction {
761
766
  let actionEntityType: string = "";
762
767
  let actionFQN = `${actionName}`;
763
768
  const actionShortName = actionName.substr(namespace.length + 1);
@@ -786,6 +791,8 @@ function prepareAction(actionName: string, actionRawData: MetaModelAction, names
786
791
  _type: "ActionParameter",
787
792
  isEntitySet: param.$Type === actionRawData.$EntitySetPath,
788
793
  fullyQualifiedName: `${actionFQN}/${param.$Name}`,
794
+ isCollection: param.$isCollection ?? false,
795
+ name: param.$Name,
789
796
  type: param.$Type
790
797
  };
791
798
  })
@@ -794,14 +801,14 @@ function prepareAction(actionName: string, actionRawData: MetaModelAction, names
794
801
  export function prepareEntityTypes(
795
802
  oMetaModel: ODataMetaModel,
796
803
  oCapabilities: EnvironmentCapabilities = DefaultEnvironmentCapabilities
797
- ): ParserOutput {
804
+ ): RawMetadata {
798
805
  const oMetaModelData = oMetaModel.getObject("/$");
799
806
  const annotationLists: Record<string, AnnotationList> = {};
800
- const entityTypes: EntityType[] = [];
801
- const entitySets: EntitySet[] = [];
802
- const singletons: Singleton[] = [];
803
- const complexTypes: ComplexType[] = [];
804
- const typeDefinitions: TypeDefinition[] = [];
807
+ const entityTypes: RawEntityType[] = [];
808
+ const entitySets: RawEntitySet[] = [];
809
+ const singletons: RawSingleton[] = [];
810
+ const complexTypes: RawComplexType[] = [];
811
+ const typeDefinitions: RawTypeDefinition[] = [];
805
812
  const entityContainerName = oMetaModelData.$EntityContainer;
806
813
  let namespace = "";
807
814
  const schemaKeys = Object.keys(oMetaModelData).filter((metamodelKey) => oMetaModelData[metamodelKey].$kind === "Schema");
@@ -873,10 +880,15 @@ export function prepareEntityTypes(
873
880
  }
874
881
  });
875
882
 
876
- let entityContainer: EntityContainer = {};
883
+ let entityContainer: RawEntityContainer = {
884
+ _type: "EntityContainer",
885
+ name: "",
886
+ fullyQualifiedName: ""
887
+ };
877
888
  if (entityContainerName) {
878
889
  entityContainer = {
879
- name: entityContainerName.replace(namespace + ".", ""),
890
+ _type: "EntityContainer",
891
+ name: entityContainerName.replace(`${namespace}.`, ""),
880
892
  fullyQualifiedName: entityContainerName
881
893
  };
882
894
  }
@@ -892,13 +904,13 @@ export function prepareEntityTypes(
892
904
  }
893
905
  });
894
906
 
895
- const actions: Action[] = Object.keys(oMetaModelData)
907
+ const actions: RawAction[] = Object.keys(oMetaModelData)
896
908
  .filter((key) => {
897
909
  return Array.isArray(oMetaModelData[key]) && oMetaModelData[key].length > 0 && oMetaModelData[key][0].$kind === "Action";
898
910
  })
899
- .reduce((outActions: Action[], actionName) => {
900
- const actions = oMetaModelData[actionName];
901
- actions.forEach((action: MetaModelAction) => {
911
+ .reduce((outActions: RawAction[], actionName) => {
912
+ const innerActions = oMetaModelData[actionName];
913
+ innerActions.forEach((action: MetaModelAction) => {
902
914
  outActions.push(prepareAction(actionName, action, namespace, entityContainerName));
903
915
  });
904
916
  return outActions;
@@ -935,26 +947,34 @@ export function prepareEntityTypes(
935
947
  };
936
948
  }
937
949
 
938
- const mMetaModelMap: Record<string, ParserOutput> = {};
950
+ const mMetaModelMap: Record<string, ConvertedMetadata> = {};
939
951
 
940
952
  /**
941
953
  * Convert the ODataMetaModel into another format that allow for easy manipulation of the annotations.
942
954
  *
943
- * @param {ODataMetaModel} oMetaModel The current oDataMetaModel
955
+ * @param oMetaModel The ODataMetaModel
944
956
  * @param oCapabilities The current capabilities
945
- * @returns {ConverterOutput} An object containing object like annotation
957
+ * @returns An object containing object-like annotations
946
958
  */
947
- export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities): ConverterOutput {
959
+ export function convertTypes(oMetaModel: ODataMetaModel, oCapabilities?: EnvironmentCapabilities): ConvertedMetadata {
948
960
  const sMetaModelId = (oMetaModel as any).id;
949
961
  if (!mMetaModelMap.hasOwnProperty(sMetaModelId)) {
950
962
  const parsedOutput = prepareEntityTypes(oMetaModel, oCapabilities);
951
963
  try {
952
- mMetaModelMap[sMetaModelId] = AnnotationConverter.convertTypes(parsedOutput);
964
+ mMetaModelMap[sMetaModelId] = AnnotationConverter.convert(parsedOutput);
953
965
  } catch (oError) {
954
966
  throw new Error(oError as any);
955
967
  }
956
968
  }
957
- return mMetaModelMap[sMetaModelId] as any as ConverterOutput;
969
+ return mMetaModelMap[sMetaModelId] as any as ConvertedMetadata;
970
+ }
971
+
972
+ export function getConvertedTypes(oContext: Context) {
973
+ const oMetaModel = oContext.getModel() as unknown as ODataMetaModel;
974
+ if (!oMetaModel.isA("sap.ui.model.odata.v4.ODataMetaModel")) {
975
+ throw new Error("This should only be called on a ODataMetaModel");
976
+ }
977
+ return convertTypes(oMetaModel);
958
978
  }
959
979
 
960
980
  export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
@@ -962,17 +982,23 @@ export function deleteModelCacheData(oMetaModel: ODataMetaModel) {
962
982
  }
963
983
 
964
984
  export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisitedObjects: boolean = false): any {
965
- const oConverterOutput = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
985
+ const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
966
986
  const sPath = oMetaModelContext.getPath();
967
987
 
968
988
  const aPathSplit = sPath.split("/");
969
- let targetEntitySet: _EntitySet | _Singleton = oConverterOutput.entitySets.find(
970
- (entitySet) => entitySet.name === aPathSplit[1]
971
- ) as _EntitySet;
989
+ let firstPart = aPathSplit[1];
990
+ let beginIndex = 2;
991
+ if (oConvertedMetadata.entityContainer.fullyQualifiedName === firstPart) {
992
+ firstPart = aPathSplit[2];
993
+ beginIndex++;
994
+ }
995
+ let targetEntitySet: EntitySet | Singleton = oConvertedMetadata.entitySets.find(
996
+ (entitySet) => entitySet.name === firstPart
997
+ ) as EntitySet;
972
998
  if (!targetEntitySet) {
973
- targetEntitySet = oConverterOutput.singletons.find((singleton) => singleton.name === aPathSplit[1]) as _Singleton;
999
+ targetEntitySet = oConvertedMetadata.singletons.find((singleton) => singleton.name === firstPart) as Singleton;
974
1000
  }
975
- let relativePath = aPathSplit.slice(2).join("/");
1001
+ let relativePath = aPathSplit.slice(beginIndex).join("/");
976
1002
 
977
1003
  const localObjects: any[] = [targetEntitySet];
978
1004
  while (relativePath && relativePath.length > 0 && relativePath.startsWith("$NavigationPropertyBinding")) {
@@ -1041,10 +1067,9 @@ export function convertMetaModelContext(oMetaModelContext: Context, bIncludeVisi
1041
1067
  const action = actions[relativeSplit[0]];
1042
1068
  if (relativeSplit[1] && action.parameters) {
1043
1069
  const parameterName = relativeSplit[1];
1044
- const targetParameter = action.parameters.find((parameter) => {
1045
- return parameter.fullyQualifiedName.endsWith("/" + parameterName);
1070
+ return action.parameters.find((parameter) => {
1071
+ return parameter.fullyQualifiedName.endsWith(`/${parameterName}`);
1046
1072
  });
1047
- return targetParameter;
1048
1073
  } else if (relativePath.length === 1) {
1049
1074
  return action;
1050
1075
  }
@@ -1072,18 +1097,18 @@ export type ResolvedTarget = {
1072
1097
  };
1073
1098
 
1074
1099
  export function getInvolvedDataModelObjects(oMetaModelContext: Context, oEntitySetMetaModelContext?: Context): DataModelObjectPath {
1075
- const oConverterOutput = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
1100
+ const oConvertedMetadata = convertTypes(oMetaModelContext.getModel() as ODataMetaModel);
1076
1101
  const metaModelContext = convertMetaModelContext(oMetaModelContext, true);
1077
1102
  let targetEntitySetLocation;
1078
1103
  if (oEntitySetMetaModelContext && oEntitySetMetaModelContext.getPath() !== "/") {
1079
1104
  targetEntitySetLocation = getInvolvedDataModelObjects(oEntitySetMetaModelContext);
1080
1105
  }
1081
- return getInvolvedDataModelObjectFromPath(metaModelContext, oConverterOutput, targetEntitySetLocation);
1106
+ return getInvolvedDataModelObjectFromPath(metaModelContext, oConvertedMetadata, targetEntitySetLocation);
1082
1107
  }
1083
1108
 
1084
1109
  export function getInvolvedDataModelObjectFromPath(
1085
1110
  metaModelContext: ResolvedTarget,
1086
- convertedTypes: ConverterOutput,
1111
+ convertedTypes: ConvertedMetadata,
1087
1112
  targetEntitySetLocation?: DataModelObjectPath
1088
1113
  ): DataModelObjectPath {
1089
1114
  const dataModelObjects = metaModelContext.visitedObjects.filter(
@@ -1092,11 +1117,11 @@ export function getInvolvedDataModelObjectFromPath(
1092
1117
  if (metaModelContext.target && metaModelContext.target.hasOwnProperty("_type") && metaModelContext.target._type !== "EntityType") {
1093
1118
  dataModelObjects.push(metaModelContext.target);
1094
1119
  }
1095
- const navigationProperties: _NavigationProperty[] = [];
1096
- const rootEntitySet: _EntitySet = dataModelObjects[0] as _EntitySet;
1120
+ const navigationProperties: NavigationProperty[] = [];
1121
+ const rootEntitySet: EntitySet = dataModelObjects[0] as EntitySet;
1097
1122
  // currentEntitySet can be undefined.
1098
- let currentEntitySet: _EntitySet | undefined = rootEntitySet as _EntitySet;
1099
- let currentEntityType: _EntityType = rootEntitySet.entityType;
1123
+ let currentEntitySet: EntitySet | undefined = rootEntitySet;
1124
+ let currentEntityType: EntityType = rootEntitySet.entityType;
1100
1125
  let i = 1;
1101
1126
  let currentObject;
1102
1127
  let navigatedPaths = [];
@@ -1104,17 +1129,17 @@ export function getInvolvedDataModelObjectFromPath(
1104
1129
  currentObject = dataModelObjects[i++];
1105
1130
  if (currentObject._type === "NavigationProperty") {
1106
1131
  navigatedPaths.push(currentObject.name);
1107
- navigationProperties.push(currentObject as _NavigationProperty);
1108
- currentEntityType = (currentObject as _NavigationProperty).targetType;
1132
+ navigationProperties.push(currentObject as NavigationProperty);
1133
+ currentEntityType = (currentObject as NavigationProperty).targetType;
1109
1134
  if (currentEntitySet && currentEntitySet.navigationPropertyBinding.hasOwnProperty(navigatedPaths.join("/"))) {
1110
- currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name];
1135
+ currentEntitySet = currentEntitySet.navigationPropertyBinding[currentObject.name] as EntitySet;
1111
1136
  navigatedPaths = [];
1112
1137
  } else {
1113
1138
  currentEntitySet = undefined;
1114
1139
  }
1115
1140
  }
1116
1141
  if (currentObject._type === "EntitySet") {
1117
- currentEntitySet = currentObject as _EntitySet;
1142
+ currentEntitySet = currentObject as EntitySet;
1118
1143
  currentEntityType = currentEntitySet.entityType;
1119
1144
  }
1120
1145
  }
@@ -1129,7 +1154,7 @@ export function getInvolvedDataModelObjectFromPath(
1129
1154
  targetEntitySetLocation.startingEntitySet = rootEntitySet;
1130
1155
  targetEntitySetLocation.navigationProperties = requiredDataModelObjects
1131
1156
  .filter((object: any) => object._type === "NavigationProperty")
1132
- .concat(targetEntitySetLocation.navigationProperties) as _NavigationProperty[];
1157
+ .concat(targetEntitySetLocation.navigationProperties) as NavigationProperty[];
1133
1158
  }
1134
1159
  }
1135
1160
  const outDataModelPath = {