@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,31 +1,29 @@
1
- import { NavigationProperty, Property } from "@sap-ux/annotation-converter";
2
- import { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types";
3
- import { PathAnnotationExpression } from "@sap-ux/vocabularies-types/types/Edm";
4
- import { UIAnnotationTypes } from "@sap-ux/vocabularies-types/types/generated/UI";
1
+ import type { NavigationProperty, PathAnnotationExpression, Property } from "@sap-ux/vocabularies-types";
2
+ import type { DataFieldAbstractTypes } from "@sap-ux/vocabularies-types/vocabularies/UI";
3
+ import { UIAnnotationTypes } from "@sap-ux/vocabularies-types/vocabularies/UI";
5
4
  import { singletonPathVisitor, UI } from "sap/fe/core/converters/helpers/BindingHelper";
6
5
  import { convertMetaModelContext, getInvolvedDataModelObjects } from "sap/fe/core/converters/MetaModelConverter";
7
6
  import valueFormatters from "sap/fe/core/formatters/ValueFormatter";
7
+ import type { BindingToolkitExpression, CompiledBindingToolkitExpression, PathInModelExpression } from "sap/fe/core/helpers/BindingToolkit";
8
8
  import {
9
9
  addTypeInformation,
10
10
  and,
11
- annotationExpression,
12
- bindingExpression,
13
- BindingExpression,
14
- BindingExpressionExpression,
15
- compileBinding,
11
+ compileExpression,
16
12
  constant,
17
13
  equal,
18
- Expression,
19
- ExpressionOrPrimitive,
20
14
  formatResult,
15
+ getExpressionFromAnnotation,
21
16
  ifElse,
22
17
  isConstant,
23
18
  isTruthy,
24
19
  not,
25
- or
26
- } from "sap/fe/core/helpers/BindingExpression";
20
+ notEqual,
21
+ or,
22
+ pathInModel
23
+ } from "sap/fe/core/helpers/BindingToolkit";
27
24
  import {
28
25
  DataModelObjectPath,
26
+ getContextRelativeTargetObjectPath,
29
27
  getPathRelativeLocation,
30
28
  getTargetObjectPath,
31
29
  isPathUpdatable
@@ -47,7 +45,7 @@ import {
47
45
  isPathExpression,
48
46
  isProperty
49
47
  } from "sap/fe/core/templating/PropertyHelper";
50
- import Context from "sap/ui/model/odata/v4/Context";
48
+ import type Context from "sap/ui/model/odata/v4/Context";
51
49
 
52
50
  // Import-export method used by the converter to use them in the templating through the UIFormatters.
53
51
  export type DisplayMode = DisplayModeFormatter.DisplayMode;
@@ -90,28 +88,41 @@ export type configType = {
90
88
  export const getDisplayMode = function (oDataModelObjectPath: DataModelObjectPath): DisplayMode {
91
89
  return DisplayModeFormatter.getDisplayMode(oDataModelObjectPath.targetObject, oDataModelObjectPath);
92
90
  };
93
-
91
+ export const getEditableExpressionAsObject = function (
92
+ oPropertyPath: PropertyOrPath<Property>,
93
+ oDataFieldConverted: any = null,
94
+ oDataModelObjectPath: DataModelObjectPath,
95
+ isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
96
+ ): BindingToolkitExpression<boolean> {
97
+ return getEditableExpression(
98
+ oPropertyPath,
99
+ oDataFieldConverted,
100
+ oDataModelObjectPath,
101
+ true,
102
+ isEditable
103
+ ) as BindingToolkitExpression<boolean>;
104
+ };
94
105
  /**
95
106
  * Create the expression to generate an "editable" boolean value.
96
107
  *
97
- * @param {PropertyPath} oPropertyPath The input property
98
- * @param {object} oDataFieldConverted The DataFieldConverted object to read the fieldControl annotation
99
- * @param {DataModelObjectPath} oDataModelObjectPath The path to this property object
100
- * @param {boolean} bAsObject Whether or not this should be returned as an object or a binding string
101
- * @param {boolean} isEditable Whether or not UI.IsEditable be considered.
102
- * @returns {string} The binding expression used to determine if a property is editable or not
108
+ * @param oPropertyPath The input property
109
+ * @param oDataFieldConverted The DataFieldConverted object to read the fieldControl annotation
110
+ * @param oDataModelObjectPath The path to this property object
111
+ * @param bAsObject Whether or not this should be returned as an object or a binding string
112
+ * @param isEditable Whether or not UI.IsEditable be considered.
113
+ * @returns The binding expression used to determine if a property is editable or not
103
114
  */
104
115
  export const getEditableExpression = function (
105
116
  oPropertyPath: PropertyOrPath<Property>,
106
117
  oDataFieldConverted: any = null,
107
118
  oDataModelObjectPath: DataModelObjectPath,
108
119
  bAsObject: boolean = false,
109
- isEditable: ExpressionOrPrimitive<boolean> = UI.IsEditable
110
- ): BindingExpression<boolean> | ExpressionOrPrimitive<boolean> {
120
+ isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
121
+ ): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
111
122
  if (!oPropertyPath || typeof oPropertyPath === "string") {
112
- return compileBinding(false);
123
+ return compileExpression(false);
113
124
  }
114
- let dataFieldEditableExpression: BindingExpression<boolean> | ExpressionOrPrimitive<boolean> = true;
125
+ let dataFieldEditableExpression: BindingToolkitExpression<boolean> = constant(true);
115
126
  if (oDataFieldConverted !== null) {
116
127
  dataFieldEditableExpression = ifElse(isNonEditableExpression(oDataFieldConverted), false, isEditable);
117
128
  }
@@ -146,38 +157,46 @@ export const getEditableExpression = function (
146
157
  if (bAsObject) {
147
158
  return and(editableExpression, dataFieldEditableExpression);
148
159
  }
149
- return compileBinding(and(editableExpression, dataFieldEditableExpression));
160
+ return compileExpression(and(editableExpression, dataFieldEditableExpression));
150
161
  };
151
162
 
152
- export const getCollaborationExpression = function (dataModelObjectPath: DataModelObjectPath, formatter: any): BindingExpression<any> {
163
+ export const getCollaborationExpression = function (
164
+ dataModelObjectPath: DataModelObjectPath,
165
+ formatter: any
166
+ ): BindingToolkitExpression<any> {
153
167
  const objectPath = getTargetObjectPath(dataModelObjectPath);
154
- const activityExpression = bindingExpression("/collaboration/activities" + objectPath, "internal");
168
+ const activityExpression = pathInModel(`/collaboration/activities${objectPath}`, "internal");
155
169
  const keys = dataModelObjectPath?.targetEntityType?.keys;
156
- const keysExpressions: BindingExpressionExpression<any>[] = [];
170
+ const keysExpressions: BindingToolkitExpression<any>[] = [];
157
171
  keys?.forEach(function (key) {
158
- const keyExpression = bindingExpression(key.name) as BindingExpressionExpression<any>;
172
+ const keyExpression = pathInModel(key.name);
159
173
  keysExpressions.push(keyExpression);
160
174
  });
161
175
  return formatResult([activityExpression, ...keysExpressions], formatter);
162
176
  };
163
-
177
+ export const getEnabledExpressionAsObject = function (
178
+ oPropertyPath: PropertyOrPath<Property>,
179
+ oDataFieldConverted?: any
180
+ ): BindingToolkitExpression<boolean> {
181
+ return getEnabledExpression(oPropertyPath, oDataFieldConverted, true) as BindingToolkitExpression<boolean>;
182
+ };
164
183
  /**
165
184
  * Create the expression to generate an "enabled" boolean value.
166
185
  *
167
- * @param {PropertyPath} oPropertyPath The input property
168
- * @param {any} oDataFieldConverted The DataFieldConverted Object to read the fieldControl annotation
169
- * @param {boolean} bAsObject Whether or not this should be returned as an object or a binding string
170
- * @returns {string} The binding expression to determine if a property is enabled or not
186
+ * @param oPropertyPath The input property
187
+ * @param oDataFieldConverted The DataFieldConverted Object to read the fieldControl annotation
188
+ * @param bAsObject Whether or not this should be returned as an object or a binding string
189
+ * @returns The binding expression to determine if a property is enabled or not
171
190
  */
172
191
  export const getEnabledExpression = function (
173
192
  oPropertyPath: PropertyOrPath<Property>,
174
193
  oDataFieldConverted?: any,
175
194
  bAsObject: boolean = false
176
- ): BindingExpression<boolean> | ExpressionOrPrimitive<boolean> {
195
+ ): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
177
196
  if (!oPropertyPath || typeof oPropertyPath === "string") {
178
- return compileBinding(true);
197
+ return compileExpression(true);
179
198
  }
180
- let dataFieldEnabledExpression: BindingExpression<boolean> | ExpressionOrPrimitive<boolean> = true;
199
+ let dataFieldEnabledExpression: BindingToolkitExpression<boolean> = constant(true);
181
200
  if (oDataFieldConverted !== null) {
182
201
  dataFieldEnabledExpression = ifElse(isDisabledExpression(oDataFieldConverted), false, true);
183
202
  }
@@ -189,19 +208,19 @@ export const getEnabledExpression = function (
189
208
  if (bAsObject) {
190
209
  return and(enabledExpression, dataFieldEnabledExpression);
191
210
  }
192
- return compileBinding(and(enabledExpression, dataFieldEnabledExpression));
211
+ return compileExpression(and(enabledExpression, dataFieldEnabledExpression));
193
212
  };
194
213
 
195
214
  /**
196
215
  * Create the expression to generate an "editMode" enum value.
197
216
  *
198
- * @param {PropertyPath} oPropertyPath The input property
199
- * @param {DataModelObjectPath} oDataModelObjectPath The list of data model objects that are involved to reach that property
200
- * @param {boolean} bMeasureReadOnly Whether we should set UoM / currency field mode to read only
201
- * @param {boolean} bAsObject Whether we should return this as an expression or as a string
202
- * @param {object} oDataFieldConverted The dataField object
203
- * @param {boolean} isEditable Whether or not UI.IsEditable be considered.
204
- * @returns {BindingExpression<string> | ExpressionOrPrimitive<string>} The binding expression representing the current property edit mode, compliant with the MDC Field definition of editMode.
217
+ * @param oPropertyPath The input property
218
+ * @param oDataModelObjectPath The list of data model objects that are involved to reach that property
219
+ * @param bMeasureReadOnly Whether we should set UoM / currency field mode to read only
220
+ * @param bAsObject Whether we should return this as an expression or as a string
221
+ * @param oDataFieldConverted The dataField object
222
+ * @param isEditable Whether or not UI.IsEditable be considered.
223
+ * @returns The binding expression representing the current property edit mode, compliant with the MDC Field definition of editMode.
205
224
  */
206
225
  export const getEditMode = function (
207
226
  oPropertyPath: PropertyOrPath<Property>,
@@ -209,8 +228,8 @@ export const getEditMode = function (
209
228
  bMeasureReadOnly: boolean = false,
210
229
  bAsObject: boolean = false,
211
230
  oDataFieldConverted: any = null,
212
- isEditable: ExpressionOrPrimitive<boolean> = UI.IsEditable
213
- ): BindingExpression<string> | ExpressionOrPrimitive<string> {
231
+ isEditable: BindingToolkitExpression<boolean> = UI.IsEditable
232
+ ): CompiledBindingToolkitExpression | BindingToolkitExpression<string> {
214
233
  if (!oPropertyPath || typeof oPropertyPath === "string") {
215
234
  return "Display";
216
235
  }
@@ -221,22 +240,17 @@ export const getEditMode = function (
221
240
  // If there is an associated unit, and it has a field control also use consider the following
222
241
  // if the unit field control is readonly -> EditableReadOnly
223
242
  // otherwise -> Editable
224
- const editableExpression = getEditableExpression(
225
- oPropertyPath,
226
- oDataFieldConverted,
227
- oDataModelObjectPath,
228
- true,
229
- isEditable
230
- ) as ExpressionOrPrimitive<boolean>;
243
+ const editableExpression = getEditableExpressionAsObject(oPropertyPath, oDataFieldConverted, oDataModelObjectPath, isEditable);
231
244
 
232
- const enabledExpression = getEnabledExpression(oPropertyPath, oDataFieldConverted, true) as ExpressionOrPrimitive<boolean>;
245
+ const enabledExpression = getEnabledExpressionAsObject(oPropertyPath, oDataFieldConverted);
233
246
  const associatedCurrencyProperty = getAssociatedCurrencyProperty(oProperty);
234
247
  const unitProperty = associatedCurrencyProperty || getAssociatedUnitProperty(oProperty);
235
- let resultExpression: ExpressionOrPrimitive<string> = "Editable";
248
+ let resultExpression: BindingToolkitExpression<string> = constant("Editable");
236
249
  if (unitProperty) {
250
+ const isUnitReadOnly = isReadOnlyExpression(unitProperty);
237
251
  resultExpression = ifElse(
238
- or(isReadOnlyExpression(unitProperty), isComputed(unitProperty), bMeasureReadOnly),
239
- "EditableReadOnly",
252
+ or(isUnitReadOnly, isComputed(unitProperty), bMeasureReadOnly),
253
+ ifElse(!isConstant(isUnitReadOnly) && isUnitReadOnly, "EditableReadOnly", "EditableDisplay"),
240
254
  "Editable"
241
255
  );
242
256
  }
@@ -256,54 +270,57 @@ export const getEditMode = function (
256
270
  if (bAsObject) {
257
271
  return editModeExpression;
258
272
  }
259
- return compileBinding(editModeExpression);
273
+ return compileExpression(editModeExpression);
260
274
  };
261
275
 
262
- export const hasValidAnalyticalCurrencyOrUnit = function (oPropertyDataModelObjectPath: DataModelObjectPath): BindingExpression<string> {
276
+ export const hasValidAnalyticalCurrencyOrUnit = function (
277
+ oPropertyDataModelObjectPath: DataModelObjectPath
278
+ ): CompiledBindingToolkitExpression {
263
279
  const oPropertyDefinition = oPropertyDataModelObjectPath.targetObject as Property;
264
280
  const currency = oPropertyDefinition.annotations?.Measures?.ISOCurrency;
265
281
  const measure = currency ? currency : oPropertyDefinition.annotations?.Measures?.Unit;
266
282
  if (measure) {
267
- return compileBinding(or(isTruthy(annotationExpression(measure) as Expression<string>), not(UI.IsTotal)));
283
+ return compileExpression(or(isTruthy(getExpressionFromAnnotation(measure) as BindingToolkitExpression<string>), not(UI.IsTotal)));
268
284
  } else {
269
- return compileBinding(constant(true));
285
+ return compileExpression(constant(true));
270
286
  }
271
287
  };
272
288
 
273
289
  export const ifUnitEditable = function (
274
290
  oPropertyPath: PropertyOrPath<Property>,
275
- sEditableValue: ExpressionOrPrimitive<string>,
276
- sNonEditableValue: ExpressionOrPrimitive<string>
277
- ): BindingExpression<string> {
291
+ sEditableValue: BindingToolkitExpression<string> | string,
292
+ sNonEditableValue: BindingToolkitExpression<string> | string
293
+ ): CompiledBindingToolkitExpression {
278
294
  const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
279
295
  const unitProperty = getAssociatedCurrencyProperty(oProperty) || getAssociatedUnitProperty(oProperty);
280
296
  if (!unitProperty) {
281
- return compileBinding(sNonEditableValue);
297
+ return compileExpression(sNonEditableValue);
282
298
  }
283
- const editableExpression = and(not(isReadOnlyExpression(unitProperty)), not(isComputed(unitProperty)));
284
- return compileBinding(ifElse(editableExpression, sEditableValue, sNonEditableValue));
299
+ const isUnitReadOnly = isReadOnlyExpression(unitProperty);
300
+ const editableExpression = and(or(!isConstant(isUnitReadOnly), not(isUnitReadOnly)), not(isComputed(unitProperty)));
301
+ return compileExpression(ifElse(editableExpression, sEditableValue, sNonEditableValue));
285
302
  };
286
303
 
287
304
  export const getFieldDisplay = function (
288
305
  oPropertyPath: PropertyOrPath<Property>,
289
306
  sTargetDisplayMode: string,
290
- oComputedEditMode: ExpressionOrPrimitive<string>
291
- ): BindingExpression<string> {
307
+ oComputedEditMode: BindingToolkitExpression<string>
308
+ ): CompiledBindingToolkitExpression {
292
309
  const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
293
310
 
294
311
  return hasValueHelp(oProperty)
295
- ? compileBinding(sTargetDisplayMode)
296
- : compileBinding(ifElse(equal(oComputedEditMode, "Editable"), "Value", sTargetDisplayMode));
312
+ ? compileExpression(sTargetDisplayMode)
313
+ : compileExpression(ifElse(equal(oComputedEditMode, "Editable"), "Value", sTargetDisplayMode));
297
314
  };
298
315
 
299
316
  export const formatWithTypeInformation = function (
300
317
  oProperty: Property,
301
- propertyBindingExpression: Expression<string>,
318
+ propertyBindingExpression: BindingToolkitExpression<string>,
302
319
  ignoreConstraints?: boolean
303
- ): Expression<string> {
304
- const outExpression: BindingExpressionExpression<any> = propertyBindingExpression as BindingExpressionExpression<any>;
320
+ ): BindingToolkitExpression<string> {
321
+ const outExpression: PathInModelExpression<any> = propertyBindingExpression as PathInModelExpression<any>;
305
322
  if (oProperty._type === "Property") {
306
- const oTargetMapping = EDM_TYPE_MAPPING[(oProperty as Property).type];
323
+ const oTargetMapping = EDM_TYPE_MAPPING[oProperty.type];
307
324
  if (oTargetMapping) {
308
325
  outExpression.type = oTargetMapping.type;
309
326
  if (oTargetMapping.constraints && !ignoreConstraints) {
@@ -403,7 +420,7 @@ export const getTypeConfig = function (oProperty: Property | DataFieldAbstractTy
403
420
  isDigitSequence:
404
421
  propertyTypeConfig.type === "sap.ui.model.odata.type.String" &&
405
422
  oTargetMapping.constraints?.["@com.sap.vocabularies.Common.v1.IsDigitSequence"] &&
406
- (oProperty as Property).annotations?.Common?.IsDigitSequence
423
+ oProperty.annotations?.Common?.IsDigitSequence
407
424
  ? true
408
425
  : undefined,
409
426
  V4: oTargetMapping.constraints?.$V4 ? true : undefined
@@ -427,9 +444,10 @@ export const getTypeConfig = function (oProperty: Property | DataFieldAbstractTy
427
444
 
428
445
  export const getBindingWithUnitOrCurrency = function (
429
446
  oPropertyDataModelPath: DataModelObjectPath,
430
- propertyBindingExpression: Expression<string>,
431
- ignoreUnitConstraint?: boolean
432
- ): Expression<string> {
447
+ propertyBindingExpression: BindingToolkitExpression<string>,
448
+ ignoreUnitConstraint?: boolean,
449
+ formatOptions?: any
450
+ ): BindingToolkitExpression<string> {
433
451
  const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
434
452
  let unit = oPropertyDefinition.annotations?.Measures?.Unit;
435
453
  const relativeLocation = getPathRelativeLocation(
@@ -441,24 +459,57 @@ export const getBindingWithUnitOrCurrency = function (
441
459
  return formatResult([propertyBindingExpression], valueFormatters.formatWithPercentage);
442
460
  }
443
461
  const complexType = unit ? "sap.ui.model.odata.type.Unit" : "sap.ui.model.odata.type.Currency";
444
- unit = unit ? unit : oPropertyDefinition.annotations?.Measures?.ISOCurrency;
462
+ unit = unit ? unit : (oPropertyDefinition.annotations?.Measures?.ISOCurrency as any);
445
463
  const unitBindingExpression = (unit as any).$target
446
464
  ? formatWithTypeInformation(
447
465
  (unit as any).$target,
448
- annotationExpression(unit, relativeLocation) as Expression<string>,
466
+ getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>,
449
467
  ignoreUnitConstraint
450
468
  )
451
- : (annotationExpression(unit, relativeLocation) as Expression<string>);
469
+ : (getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>);
452
470
 
453
- return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType);
471
+ return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType, undefined, formatOptions);
454
472
  };
455
473
 
474
+ export const getBindingForUnitOrCurrency = function (
475
+ oPropertyDataModelPath: DataModelObjectPath
476
+ ): BindingToolkitExpression<string> | string {
477
+ const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
478
+
479
+ let unit = oPropertyDefinition.annotations?.Measures?.Unit;
480
+ if (unit?.toString() === "%") {
481
+ return constant("%");
482
+ }
483
+ const relativeLocation = getPathRelativeLocation(
484
+ oPropertyDataModelPath.contextLocation,
485
+ oPropertyDataModelPath.navigationProperties
486
+ ).map((np) => np.name);
487
+
488
+ const complexType = unit ? "sap.ui.model.odata.type.Unit" : "sap.ui.model.odata.type.Currency";
489
+ unit = unit ? unit : (oPropertyDefinition.annotations?.Measures?.ISOCurrency as any);
490
+ const unitBindingExpression = (unit as any).$target
491
+ ? formatWithTypeInformation(
492
+ (unit as any).$target,
493
+ getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>
494
+ )
495
+ : (getExpressionFromAnnotation(unit, relativeLocation) as BindingToolkitExpression<string>);
496
+
497
+ let propertyBindingExpression = pathInModel(
498
+ getContextRelativeTargetObjectPath(oPropertyDataModelPath)
499
+ ) as BindingToolkitExpression<string>;
500
+ propertyBindingExpression = formatWithTypeInformation(oPropertyDefinition, propertyBindingExpression, true);
501
+ return addTypeInformation([propertyBindingExpression, unitBindingExpression], complexType, undefined, {
502
+ parseKeepsEmptyString: true,
503
+ emptyString: "",
504
+ showNumber: false
505
+ });
506
+ };
456
507
  export const getBindingWithTimezone = function (
457
508
  oPropertyDataModelPath: DataModelObjectPath,
458
- propertyBindingExpression: Expression<string>,
509
+ propertyBindingExpression: BindingToolkitExpression<string>,
459
510
  ignoreUnitConstraint?: boolean,
460
511
  hideTimezoneForEmptyValues?: boolean
461
- ): Expression<string> {
512
+ ): BindingToolkitExpression<string> {
462
513
  const oPropertyDefinition = oPropertyDataModelPath.targetObject as Property;
463
514
  const timezone = oPropertyDefinition.annotations?.Common?.Timezone;
464
515
  const relativeLocation = getPathRelativeLocation(
@@ -471,10 +522,10 @@ export const getBindingWithTimezone = function (
471
522
  const unitBindingExpression = (timezone as any).$target
472
523
  ? formatWithTypeInformation(
473
524
  (timezone as any).$target,
474
- annotationExpression(timezone, relativeLocation) as Expression<string>,
525
+ getExpressionFromAnnotation(timezone, relativeLocation) as BindingToolkitExpression<string>,
475
526
  ignoreUnitConstraint
476
527
  )
477
- : (annotationExpression(timezone, relativeLocation) as Expression<string>);
528
+ : (getExpressionFromAnnotation(timezone, relativeLocation) as BindingToolkitExpression<string>);
478
529
  let formatOptions;
479
530
  if (hideTimezoneForEmptyValues) {
480
531
  formatOptions = {
@@ -485,19 +536,19 @@ export const getBindingWithTimezone = function (
485
536
  };
486
537
 
487
538
  export const getAlignmentExpression = function (
488
- oComputedEditMode: Expression<string>,
539
+ oComputedEditMode: BindingToolkitExpression<string>,
489
540
  sAlignDisplay: string = "Begin",
490
541
  sAlignEdit: string = "Begin"
491
- ): BindingExpression<string> | Expression<string> {
492
- return compileBinding(ifElse(equal(oComputedEditMode, "Display"), sAlignDisplay, sAlignEdit));
542
+ ): CompiledBindingToolkitExpression | BindingToolkitExpression<string> {
543
+ return compileExpression(ifElse(equal(oComputedEditMode, "Display"), sAlignDisplay, sAlignEdit));
493
544
  };
494
545
 
495
546
  /**
496
547
  * Formatter helper to retrieve the converterContext from the metamodel context.
497
548
  *
498
- * @param {Context} oContext The original metamodel context
499
- * @param {ComputedAnnotationInterface} oInterface The current templating context
500
- * @returns {object} The ConverterContext representing that object
549
+ * @param oContext The original metamodel context
550
+ * @param oInterface The current templating context
551
+ * @returns The ConverterContext representing that object
501
552
  */
502
553
  export const getConverterContext = function (oContext: MetaModelContext, oInterface: ComputedAnnotationInterface): object | null {
503
554
  if (oInterface && oInterface.context) {
@@ -510,9 +561,9 @@ getConverterContext.requiresIContext = true;
510
561
  /**
511
562
  * Formatter helper to retrieve the data model objects that are involved from the metamodel context.
512
563
  *
513
- * @param {Context} oContext The original ODataMetaModel context
514
- * @param {ComputedAnnotationInterface} oInterface The current templating context
515
- * @returns {object[]} An array of entitysets and navproperties that are involved to get to a specific object in the metamodel
564
+ * @param oContext The original ODataMetaModel context
565
+ * @param oInterface The current templating context
566
+ * @returns An array of entitysets and navproperties that are involved to get to a specific object in the metamodel
516
567
  */
517
568
  export const getDataModelObjectPath = function (
518
569
  oContext: MetaModelContext,
@@ -525,16 +576,6 @@ export const getDataModelObjectPath = function (
525
576
  };
526
577
  getDataModelObjectPath.requiresIContext = true;
527
578
 
528
- /**
529
- * Retrieves the expressionBinding created out of a binding expression.
530
- *
531
- * @param {Expression<any>} expression The expression which needs to be compiled
532
- * @returns {BindingExpression<string>} The expression-binding string
533
- */
534
- export const getExpressionBinding = function (expression: Expression<any>): BindingExpression<string> {
535
- return compileBinding(expression);
536
- };
537
-
538
579
  export const isCollectionField = function (oDataModelPath: DataModelObjectPath): boolean {
539
580
  if (oDataModelPath.navigationProperties?.length) {
540
581
  const hasOneToManyNavigation =
@@ -558,39 +599,71 @@ export const isCollectionField = function (oDataModelPath: DataModelObjectPath):
558
599
  }
559
600
  return false;
560
601
  };
561
-
602
+ export const getRequiredExpressionAsObject = function (
603
+ oPropertyPath: PropertyOrPath<Property>,
604
+ oDataFieldConverted?: any,
605
+ forceEditMode: boolean = false
606
+ ): BindingToolkitExpression<boolean> {
607
+ return getRequiredExpression(oPropertyPath, oDataFieldConverted, forceEditMode, true) as BindingToolkitExpression<boolean>;
608
+ };
562
609
  export const getRequiredExpression = function (
563
610
  oPropertyPath: PropertyOrPath<Property>,
564
611
  oDataFieldConverted?: any,
565
612
  forceEditMode: boolean = false,
566
- bAsObject: boolean = false
567
- ): BindingExpression<boolean> | ExpressionOrPrimitive<boolean> {
613
+ bAsObject: boolean = false,
614
+ oRequiredProperties: any = {}
615
+ ): CompiledBindingToolkitExpression | BindingToolkitExpression<boolean> {
616
+ let returnExpression: BindingToolkitExpression<boolean>;
617
+ const aRequiredPropertiesFromInsertRestrictions = oRequiredProperties.requiredPropertiesFromInsertRestrictions || [];
618
+ const aRequiredPropertiesFromUpdateRestrictions = oRequiredProperties.requiredPropertiesFromUpdateRestrictions || [];
568
619
  if (!oPropertyPath || typeof oPropertyPath === "string") {
569
- return compileBinding(false);
570
- }
571
-
572
- let dataFieldRequiredExpression: BindingExpression<boolean> | ExpressionOrPrimitive<boolean> = true;
573
- if (oDataFieldConverted !== null) {
574
- dataFieldRequiredExpression = isRequiredExpression(oDataFieldConverted);
620
+ returnExpression = constant(false);
621
+ } else {
622
+ let dataFieldRequiredExpression: BindingToolkitExpression<boolean> = constant(true);
623
+ if (oDataFieldConverted !== null) {
624
+ dataFieldRequiredExpression = isRequiredExpression(oDataFieldConverted);
625
+ }
626
+ let requiredPropertyFromInsertRestrictionsExpression: BindingToolkitExpression<boolean> = constant(false);
627
+ let requiredPropertyFromUpdateRestrictionsExpression: BindingToolkitExpression<boolean> = constant(false);
628
+
629
+ const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
630
+ // Enablement depends on the field control expression
631
+ // If the Field control is statically in Inapplicable (disabled) -> not enabled
632
+ const requiredExpression = isRequiredExpression(oProperty);
633
+ const editMode = forceEditMode || UI.IsEditable;
634
+ if (
635
+ aRequiredPropertiesFromInsertRestrictions.length &&
636
+ aRequiredPropertiesFromInsertRestrictions.includes((oPropertyPath as any).name)
637
+ ) {
638
+ requiredPropertyFromInsertRestrictionsExpression = and(constant(true), UI.IsCreateMode);
639
+ }
640
+ if (
641
+ aRequiredPropertiesFromUpdateRestrictions.length &&
642
+ aRequiredPropertiesFromUpdateRestrictions.includes((oPropertyPath as any).name)
643
+ ) {
644
+ requiredPropertyFromUpdateRestrictionsExpression = and(constant(true), notEqual(UI.IsCreateMode, true));
645
+ }
646
+ returnExpression = or(
647
+ and(or(requiredExpression, dataFieldRequiredExpression), editMode),
648
+ requiredPropertyFromInsertRestrictionsExpression,
649
+ requiredPropertyFromUpdateRestrictionsExpression
650
+ );
575
651
  }
576
652
 
577
- const oProperty: Property = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
578
- // Enablement depends on the field control expression
579
- // If the Field control is statically in Inapplicable (disabled) -> not enabled
580
- const requiredExpression = isRequiredExpression(oProperty);
581
- const editMode = forceEditMode || UI.IsEditable;
582
653
  if (bAsObject) {
583
- return and(or(requiredExpression, dataFieldRequiredExpression), editMode);
654
+ return returnExpression;
584
655
  }
585
- return compileBinding(and(or(requiredExpression, dataFieldRequiredExpression), editMode));
656
+ return compileExpression(returnExpression);
586
657
  };
587
658
 
588
- export const getRequiredExpressionForConnectedDataField = function (dataFieldObjectPath: DataModelObjectPath): BindingExpression<string> {
659
+ export const getRequiredExpressionForConnectedDataField = function (
660
+ dataFieldObjectPath: DataModelObjectPath
661
+ ): CompiledBindingToolkitExpression {
589
662
  const data = dataFieldObjectPath?.targetObject?.$target?.Data;
590
663
  const keys: Array<string> = Object.keys(data);
591
664
  const dataFields = [];
592
665
  let propertyPath;
593
- const isRequiredExpressions: (BindingExpression<boolean> | ExpressionOrPrimitive<boolean>)[] | undefined = [];
666
+ const isRequiredExpressions: (CompiledBindingToolkitExpression | BindingToolkitExpression<boolean>)[] | undefined = [];
594
667
  for (const key of keys) {
595
668
  if (data[key]["$Type"] && data[key]["$Type"].indexOf("DataField") > -1) {
596
669
  dataFields.push(data[key]);
@@ -624,8 +697,9 @@ export const getRequiredExpressionForConnectedDataField = function (dataFieldObj
624
697
  }
625
698
  }
626
699
  break;
700
+ // no default
627
701
  }
628
- isRequiredExpressions.push(getRequiredExpression(propertyPath, dataField, false, true));
702
+ isRequiredExpressions.push(getRequiredExpressionAsObject(propertyPath, dataField, false));
629
703
  }
630
- return compileBinding(or(...(isRequiredExpressions as ExpressionOrPrimitive<boolean>[])));
704
+ return compileExpression(or(...(isRequiredExpressions as BindingToolkitExpression<boolean>[])));
631
705
  };
@@ -2,7 +2,7 @@
2
2
  * SAP UI development toolkit for HTML5 (SAPUI5)
3
3
  * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
  */
5
- sap.ui.define(["sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/model/ValidateException", "sap/fe/core/helpers/ClassSupport"], function (Core, ODataStringType, ValidateException, ClassSupport) {
5
+ sap.ui.define(["sap/fe/core/helpers/ClassSupport", "sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/model/ValidateException"], function (ClassSupport, Core, ODataStringType, ValidateException) {
6
6
  "use strict";
7
7
 
8
8
  var _dec, _class;
@@ -35,4 +35,4 @@ sap.ui.define(["sap/ui/core/Core", "sap/ui/model/odata/type/String", "sap/ui/mod
35
35
  }(ODataStringType)) || _class);
36
36
  return EmailType;
37
37
  }, false);
38
- //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkVtYWlsLnRzIl0sIm5hbWVzIjpbImVtYWlsVzNDUmVnZXhwIiwiRW1haWxUeXBlIiwiZGVmaW5lVUk1Q2xhc3MiLCJ2YWxpZGF0ZVZhbHVlIiwic1ZhbHVlIiwidGVzdCIsIlZhbGlkYXRlRXhjZXB0aW9uIiwiQ29yZSIsImdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZSIsImdldFRleHQiLCJPRGF0YVN0cmluZ1R5cGUiXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7OztBQUlBLE1BQU1BLGNBQWMsR0FBRyxxRUFBdkI7TUFFTUMsUyxXQURMQyxjQUFjLENBQUMsd0JBQUQsQzs7Ozs7Ozs7O1dBRWRDLGEsR0FBQSx1QkFBY0MsTUFBZCxFQUE4QjtBQUM3QixVQUFJLENBQUNKLGNBQWMsQ0FBQ0ssSUFBZixDQUFvQkQsTUFBcEIsQ0FBTCxFQUFrQztBQUNqQyxjQUFNLElBQUlFLGlCQUFKLENBQXVCQyxJQUFELENBQWlCQyx3QkFBakIsQ0FBMEMsYUFBMUMsRUFBeURDLE9BQXpELENBQWlFLDJCQUFqRSxDQUF0QixDQUFOO0FBQ0E7O0FBQ0QsaUNBQU1OLGFBQU4sWUFBb0JDLE1BQXBCO0FBQ0EsSzs7O0lBTnNCTSxlO1NBUVRULFMiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBDb3JlIGZyb20gXCJzYXAvdWkvY29yZS9Db3JlXCI7XG5pbXBvcnQgT0RhdGFTdHJpbmdUeXBlIGZyb20gXCJzYXAvdWkvbW9kZWwvb2RhdGEvdHlwZS9TdHJpbmdcIjtcbmltcG9ydCB7IENvcmVFeCB9IGZyb20gXCJ0eXBlcy9leHRlbnNpb25fdHlwZXNcIjtcbmltcG9ydCBWYWxpZGF0ZUV4Y2VwdGlvbiBmcm9tIFwic2FwL3VpL21vZGVsL1ZhbGlkYXRlRXhjZXB0aW9uXCI7XG5pbXBvcnQgeyBkZWZpbmVVSTVDbGFzcyB9IGZyb20gXCJzYXAvZmUvY29yZS9oZWxwZXJzL0NsYXNzU3VwcG9ydFwiO1xuXG5jb25zdCBlbWFpbFczQ1JlZ2V4cCA9IC9eW2EtekEtWjAtOS4hIyQlJuKAmSorLz0/Xl9ge3x9fi1dK0BbYS16QS1aMC05LV0rKD86LlthLXpBLVowLTktXSspKiQvO1xuQGRlZmluZVVJNUNsYXNzKFwic2FwLmZlLmNvcmUudHlwZS5FbWFpbFwiKVxuY2xhc3MgRW1haWxUeXBlIGV4dGVuZHMgT0RhdGFTdHJpbmdUeXBlIHtcblx0dmFsaWRhdGVWYWx1ZShzVmFsdWU6IHN0cmluZykge1xuXHRcdGlmICghZW1haWxXM0NSZWdleHAudGVzdChzVmFsdWUpKSB7XG5cdFx0XHR0aHJvdyBuZXcgVmFsaWRhdGVFeGNlcHRpb24oKENvcmUgYXMgQ29yZUV4KS5nZXRMaWJyYXJ5UmVzb3VyY2VCdW5kbGUoXCJzYXAuZmUuY29yZVwiKS5nZXRUZXh0KFwiVF9FTUFJTFRZUEVfSU5WQUxJRF9WQUxVRVwiKSk7XG5cdFx0fVxuXHRcdHN1cGVyLnZhbGlkYXRlVmFsdWUoc1ZhbHVlKTtcblx0fVxufVxuZXhwb3J0IGRlZmF1bHQgRW1haWxUeXBlO1xuIl19
38
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkVtYWlsLnRzIl0sIm5hbWVzIjpbImVtYWlsVzNDUmVnZXhwIiwiRW1haWxUeXBlIiwiZGVmaW5lVUk1Q2xhc3MiLCJ2YWxpZGF0ZVZhbHVlIiwic1ZhbHVlIiwidGVzdCIsIlZhbGlkYXRlRXhjZXB0aW9uIiwiQ29yZSIsImdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZSIsImdldFRleHQiLCJPRGF0YVN0cmluZ1R5cGUiXSwibWFwcGluZ3MiOiI7QUFBQTtBQUNBO0FBQ0E7Ozs7Ozs7Ozs7OztBQUlBLE1BQU1BLGNBQWMsR0FBRyxxRUFBdkI7TUFFTUMsUyxXQURMQyxjQUFjLENBQUMsd0JBQUQsQzs7Ozs7Ozs7O1dBRWRDLGEsR0FBQSx1QkFBY0MsTUFBZCxFQUE4QjtBQUM3QixVQUFJLENBQUNKLGNBQWMsQ0FBQ0ssSUFBZixDQUFvQkQsTUFBcEIsQ0FBTCxFQUFrQztBQUNqQyxjQUFNLElBQUlFLGlCQUFKLENBQXVCQyxJQUFELENBQWlCQyx3QkFBakIsQ0FBMEMsYUFBMUMsRUFBeURDLE9BQXpELENBQWlFLDJCQUFqRSxDQUF0QixDQUFOO0FBQ0E7O0FBQ0QsaUNBQU1OLGFBQU4sWUFBb0JDLE1BQXBCO0FBQ0EsSzs7O0lBTnNCTSxlO1NBUVRULFMiLCJzb3VyY2VSb290IjoiLiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGRlZmluZVVJNUNsYXNzIH0gZnJvbSBcInNhcC9mZS9jb3JlL2hlbHBlcnMvQ2xhc3NTdXBwb3J0XCI7XG5pbXBvcnQgQ29yZSBmcm9tIFwic2FwL3VpL2NvcmUvQ29yZVwiO1xuaW1wb3J0IE9EYXRhU3RyaW5nVHlwZSBmcm9tIFwic2FwL3VpL21vZGVsL29kYXRhL3R5cGUvU3RyaW5nXCI7XG5pbXBvcnQgVmFsaWRhdGVFeGNlcHRpb24gZnJvbSBcInNhcC91aS9tb2RlbC9WYWxpZGF0ZUV4Y2VwdGlvblwiO1xuaW1wb3J0IHR5cGUgeyBDb3JlRXggfSBmcm9tIFwidHlwZXMvZXh0ZW5zaW9uX3R5cGVzXCI7XG5cbmNvbnN0IGVtYWlsVzNDUmVnZXhwID0gL15bYS16QS1aMC05LiEjJCUm4oCZKisvPT9eX2B7fH1+LV0rQFthLXpBLVowLTktXSsoPzouW2EtekEtWjAtOS1dKykqJC87XG5AZGVmaW5lVUk1Q2xhc3MoXCJzYXAuZmUuY29yZS50eXBlLkVtYWlsXCIpXG5jbGFzcyBFbWFpbFR5cGUgZXh0ZW5kcyBPRGF0YVN0cmluZ1R5cGUge1xuXHR2YWxpZGF0ZVZhbHVlKHNWYWx1ZTogc3RyaW5nKSB7XG5cdFx0aWYgKCFlbWFpbFczQ1JlZ2V4cC50ZXN0KHNWYWx1ZSkpIHtcblx0XHRcdHRocm93IG5ldyBWYWxpZGF0ZUV4Y2VwdGlvbigoQ29yZSBhcyBDb3JlRXgpLmdldExpYnJhcnlSZXNvdXJjZUJ1bmRsZShcInNhcC5mZS5jb3JlXCIpLmdldFRleHQoXCJUX0VNQUlMVFlQRV9JTlZBTElEX1ZBTFVFXCIpKTtcblx0XHR9XG5cdFx0c3VwZXIudmFsaWRhdGVWYWx1ZShzVmFsdWUpO1xuXHR9XG59XG5leHBvcnQgZGVmYXVsdCBFbWFpbFR5cGU7XG4iXX0=
@@ -1,8 +1,8 @@
1
+ import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
1
2
  import Core from "sap/ui/core/Core";
2
3
  import ODataStringType from "sap/ui/model/odata/type/String";
3
- import { CoreEx } from "types/extension_types";
4
4
  import ValidateException from "sap/ui/model/ValidateException";
5
- import { defineUI5Class } from "sap/fe/core/helpers/ClassSupport";
5
+ import type { CoreEx } from "types/extension_types";
6
6
 
7
7
  const emailW3CRegexp = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$/;
8
8
  @defineUI5Class("sap.fe.core.type.Email")