@sapui5/sap.fe.core 1.98.0 → 1.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/package.json +8 -5
  2. package/src/sap/fe/core/.library +2 -3
  3. package/src/sap/fe/core/AnnotationHelper.js +328 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +321 -0
  5. package/src/sap/fe/core/AppComponent.js +382 -399
  6. package/src/sap/fe/core/AppComponent.ts +397 -0
  7. package/src/sap/fe/core/AppStateHandler.js +198 -181
  8. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  9. package/src/sap/fe/core/BaseController.js +83 -58
  10. package/src/sap/fe/core/BaseController.ts +67 -0
  11. package/src/sap/fe/core/BusyLocker.js +105 -121
  12. package/src/sap/fe/core/BusyLocker.ts +98 -0
  13. package/src/sap/fe/core/CommonUtils.js +2221 -2399
  14. package/src/sap/fe/core/CommonUtils.ts +2248 -0
  15. package/src/sap/fe/core/ExtensionAPI.js +280 -274
  16. package/src/sap/fe/core/ExtensionAPI.ts +242 -0
  17. package/src/sap/fe/core/PageController.js +219 -131
  18. package/src/sap/fe/core/PageController.ts +129 -0
  19. package/src/sap/fe/core/RouterProxy.js +936 -823
  20. package/src/sap/fe/core/RouterProxy.ts +854 -0
  21. package/src/sap/fe/core/Synchronization.js +41 -35
  22. package/src/sap/fe/core/Synchronization.ts +29 -0
  23. package/src/sap/fe/core/TemplateComponent.js +248 -164
  24. package/src/sap/fe/core/TemplateComponent.ts +161 -0
  25. package/src/sap/fe/core/TemplateModel.js +77 -54
  26. package/src/sap/fe/core/TemplateModel.ts +63 -0
  27. package/src/sap/fe/core/TransactionHelper.js +1575 -1664
  28. package/src/sap/fe/core/TransactionHelper.ts +1736 -0
  29. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +406 -0
  30. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +362 -0
  31. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +146 -0
  32. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +129 -0
  33. package/src/sap/fe/core/actions/collaboration/Manage.js +264 -0
  34. package/src/sap/fe/core/actions/collaboration/Manage.ts +246 -0
  35. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +100 -0
  36. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  37. package/src/sap/fe/core/actions/draft.js +663 -608
  38. package/src/sap/fe/core/actions/draft.ts +669 -0
  39. package/src/sap/fe/core/actions/messageHandling.js +576 -514
  40. package/src/sap/fe/core/actions/messageHandling.ts +562 -0
  41. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  42. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  43. package/src/sap/fe/core/actions/operations.js +1093 -1215
  44. package/src/sap/fe/core/actions/operations.ts +1193 -0
  45. package/src/sap/fe/core/actions/sticky.js +114 -104
  46. package/src/sap/fe/core/actions/sticky.ts +119 -0
  47. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +60 -0
  48. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +37 -0
  49. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +165 -0
  50. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +178 -0
  51. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +707 -0
  52. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +628 -0
  53. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +436 -0
  54. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +431 -0
  55. package/src/sap/fe/core/controllerextensions/EditFlow.js +1855 -1827
  56. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1792 -0
  57. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
  58. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +60 -0
  59. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +717 -512
  60. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +785 -0
  61. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -815
  62. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +810 -0
  63. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1057 -1004
  64. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +1001 -0
  65. package/src/sap/fe/core/controllerextensions/KPIManagement.js +498 -533
  66. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +36 -32
  67. package/src/sap/fe/core/controllerextensions/MassEdit.js +142 -77
  68. package/src/sap/fe/core/controllerextensions/MassEdit.ts +155 -0
  69. package/src/sap/fe/core/controllerextensions/MessageHandler.js +222 -236
  70. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +215 -0
  71. package/src/sap/fe/core/controllerextensions/PageReady.js +312 -345
  72. package/src/sap/fe/core/controllerextensions/PageReady.ts +63 -55
  73. package/src/sap/fe/core/controllerextensions/Paginator.js +189 -175
  74. package/src/sap/fe/core/controllerextensions/Paginator.ts +169 -0
  75. package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -149
  76. package/src/sap/fe/core/controllerextensions/Placeholder.ts +149 -0
  77. package/src/sap/fe/core/controllerextensions/Routing.js +145 -121
  78. package/src/sap/fe/core/controllerextensions/Routing.ts +131 -0
  79. package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
  80. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  81. package/src/sap/fe/core/controllerextensions/Share.js +231 -268
  82. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  83. package/src/sap/fe/core/controllerextensions/SideEffects.js +603 -644
  84. package/src/sap/fe/core/controllerextensions/SideEffects.ts +79 -79
  85. package/src/sap/fe/core/controllerextensions/ViewState.js +775 -806
  86. package/src/sap/fe/core/controllerextensions/ViewState.ts +796 -0
  87. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -2
  88. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  89. package/src/sap/fe/core/controls/Any.js +28 -0
  90. package/src/sap/fe/core/controls/Any.ts +30 -0
  91. package/src/sap/fe/core/controls/CommandExecution.js +93 -68
  92. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  93. package/src/sap/fe/core/controls/ConditionalWrapper.js +166 -79
  94. package/src/sap/fe/core/controls/ConditionalWrapper.ts +74 -0
  95. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +366 -0
  96. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +278 -0
  97. package/src/sap/fe/core/controls/CustomQuickViewPage.js +168 -125
  98. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +116 -0
  99. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossDraft.fragment.xml +44 -5
  100. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +164 -122
  101. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +155 -0
  102. package/src/sap/fe/core/controls/FieldWrapper.js +213 -153
  103. package/src/sap/fe/core/controls/FieldWrapper.ts +104 -0
  104. package/src/sap/fe/core/controls/FileWrapper.js +313 -0
  105. package/src/sap/fe/core/controls/FileWrapper.ts +169 -0
  106. package/src/sap/fe/core/controls/FilterBar.js +198 -159
  107. package/src/sap/fe/core/controls/FilterBar.ts +148 -0
  108. package/src/sap/fe/core/controls/FormElementWrapper.js +101 -39
  109. package/src/sap/fe/core/controls/FormElementWrapper.ts +37 -0
  110. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
  111. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  112. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +1 -0
  113. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +148 -115
  114. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +102 -0
  115. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +301 -265
  116. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +252 -0
  117. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +186 -140
  118. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  119. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
  120. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  121. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +37 -42
  122. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +76 -74
  123. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +71 -0
  124. package/src/sap/fe/core/converters/ConverterContext.js +348 -379
  125. package/src/sap/fe/core/converters/ConverterContext.ts +23 -19
  126. package/src/sap/fe/core/converters/ManifestSettings.js +13 -1
  127. package/src/sap/fe/core/converters/ManifestSettings.ts +18 -2
  128. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -365
  129. package/src/sap/fe/core/converters/ManifestWrapper.ts +19 -0
  130. package/src/sap/fe/core/converters/MetaModelConverter.js +16 -11
  131. package/src/sap/fe/core/converters/MetaModelConverter.ts +21 -18
  132. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  133. package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
  134. package/src/sap/fe/core/converters/annotations/DataField.js +26 -13
  135. package/src/sap/fe/core/converters/annotations/DataField.ts +40 -17
  136. package/src/sap/fe/core/converters/common/AnnotationConverter.js +17 -13
  137. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -11
  138. package/src/sap/fe/core/converters/controls/Common/Action.ts +22 -21
  139. package/src/sap/fe/core/converters/controls/Common/Chart.js +12 -10
  140. package/src/sap/fe/core/converters/controls/Common/Chart.ts +23 -14
  141. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  142. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  143. package/src/sap/fe/core/converters/controls/Common/Form.js +9 -7
  144. package/src/sap/fe/core/converters/controls/Common/Form.ts +23 -5
  145. package/src/sap/fe/core/converters/controls/Common/KPI.js +1 -1
  146. package/src/sap/fe/core/converters/controls/Common/KPI.ts +2 -2
  147. package/src/sap/fe/core/converters/controls/Common/Table.js +562 -218
  148. package/src/sap/fe/core/converters/controls/Common/Table.ts +670 -320
  149. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +218 -94
  150. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +265 -159
  151. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +495 -77
  152. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +535 -130
  153. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +6 -6
  154. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +20 -18
  155. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +10 -7
  156. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +13 -16
  157. package/src/sap/fe/core/converters/helpers/Aggregation.js +117 -127
  158. package/src/sap/fe/core/converters/helpers/Aggregation.ts +20 -5
  159. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  160. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  161. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  162. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  163. package/src/sap/fe/core/converters/helpers/IssueManager.js +4 -1
  164. package/src/sap/fe/core/converters/helpers/IssueManager.ts +3 -0
  165. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  166. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  167. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +1 -1
  168. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +0 -4
  169. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +54 -30
  170. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +69 -43
  171. package/src/sap/fe/core/converters/templates/ListReportConverter.js +52 -28
  172. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +111 -74
  173. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +11 -9
  174. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +8 -8
  175. package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -98
  176. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  177. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  178. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  179. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  180. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  181. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  182. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  183. package/src/sap/fe/core/formatters/KPIFormatter.js +3 -12
  184. package/src/sap/fe/core/formatters/KPIFormatter.ts +4 -1
  185. package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
  186. package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
  187. package/src/sap/fe/core/formatters/ValueFormatter.js +4 -4
  188. package/src/sap/fe/core/formatters/ValueFormatter.ts +5 -7
  189. package/src/sap/fe/core/fpm/Component.js +81 -55
  190. package/src/sap/fe/core/fpm/Component.ts +43 -0
  191. package/src/sap/fe/core/helpers/AppStartupHelper.js +324 -310
  192. package/src/sap/fe/core/helpers/AppStartupHelper.ts +370 -341
  193. package/src/sap/fe/core/helpers/BindingExpression.js +319 -360
  194. package/src/sap/fe/core/helpers/BindingExpression.ts +323 -397
  195. package/src/sap/fe/core/helpers/ClassSupport.js +321 -168
  196. package/src/sap/fe/core/helpers/ClassSupport.ts +362 -158
  197. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
  198. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
  199. package/src/sap/fe/core/helpers/EditState.js +81 -84
  200. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  201. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  202. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  203. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  204. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  205. package/src/sap/fe/core/helpers/KeepAliveHelper.js +3 -4
  206. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +9 -9
  207. package/src/sap/fe/core/helpers/MassEditHelper.js +736 -676
  208. package/src/sap/fe/core/helpers/MassEditHelper.ts +803 -0
  209. package/src/sap/fe/core/helpers/ModelHelper.js +281 -225
  210. package/src/sap/fe/core/helpers/ModelHelper.ts +273 -0
  211. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  212. package/src/sap/fe/core/helpers/PasteHelper.ts +197 -0
  213. package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
  214. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +336 -0
  215. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  216. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  217. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -10
  218. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -10
  219. package/src/sap/fe/core/jsx-runtime/jsx.js +35 -5
  220. package/src/sap/fe/core/jsx-runtime/jsx.ts +23 -9
  221. package/src/sap/fe/core/library.js +426 -451
  222. package/src/sap/fe/core/library.support.js +23 -33
  223. package/src/sap/fe/core/library.support.ts +23 -0
  224. package/src/sap/fe/core/library.ts +420 -0
  225. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +5 -3
  226. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +5 -5
  227. package/src/sap/fe/core/messagebundle.properties +63 -18
  228. package/src/sap/fe/core/messagebundle_ar.properties +37 -6
  229. package/src/sap/fe/core/messagebundle_bg.properties +37 -6
  230. package/src/sap/fe/core/messagebundle_ca.properties +37 -6
  231. package/src/sap/fe/core/messagebundle_cs.properties +38 -7
  232. package/src/sap/fe/core/messagebundle_cy.properties +37 -6
  233. package/src/sap/fe/core/messagebundle_da.properties +37 -6
  234. package/src/sap/fe/core/messagebundle_de.properties +37 -6
  235. package/src/sap/fe/core/messagebundle_el.properties +37 -6
  236. package/src/sap/fe/core/messagebundle_en.properties +37 -6
  237. package/src/sap/fe/core/messagebundle_en_GB.properties +37 -6
  238. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +37 -6
  239. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +37 -6
  240. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +37 -6
  241. package/src/sap/fe/core/messagebundle_es.properties +37 -6
  242. package/src/sap/fe/core/messagebundle_es_MX.properties +37 -6
  243. package/src/sap/fe/core/messagebundle_et.properties +37 -6
  244. package/src/sap/fe/core/messagebundle_fi.properties +38 -7
  245. package/src/sap/fe/core/messagebundle_fr.properties +43 -12
  246. package/src/sap/fe/core/messagebundle_fr_CA.properties +45 -14
  247. package/src/sap/fe/core/messagebundle_hi.properties +43 -12
  248. package/src/sap/fe/core/messagebundle_hr.properties +43 -12
  249. package/src/sap/fe/core/messagebundle_hu.properties +37 -6
  250. package/src/sap/fe/core/messagebundle_id.properties +38 -7
  251. package/src/sap/fe/core/messagebundle_it.properties +37 -6
  252. package/src/sap/fe/core/messagebundle_iw.properties +37 -6
  253. package/src/sap/fe/core/messagebundle_ja.properties +36 -5
  254. package/src/sap/fe/core/messagebundle_kk.properties +43 -12
  255. package/src/sap/fe/core/messagebundle_ko.properties +37 -6
  256. package/src/sap/fe/core/messagebundle_lt.properties +37 -6
  257. package/src/sap/fe/core/messagebundle_lv.properties +44 -13
  258. package/src/sap/fe/core/messagebundle_ms.properties +42 -11
  259. package/src/sap/fe/core/messagebundle_nl.properties +37 -6
  260. package/src/sap/fe/core/messagebundle_no.properties +37 -6
  261. package/src/sap/fe/core/messagebundle_pl.properties +37 -6
  262. package/src/sap/fe/core/messagebundle_pt.properties +38 -7
  263. package/src/sap/fe/core/messagebundle_pt_PT.properties +37 -6
  264. package/src/sap/fe/core/messagebundle_ro.properties +37 -6
  265. package/src/sap/fe/core/messagebundle_ru.properties +37 -6
  266. package/src/sap/fe/core/messagebundle_sh.properties +39 -8
  267. package/src/sap/fe/core/messagebundle_sk.properties +37 -6
  268. package/src/sap/fe/core/messagebundle_sl.properties +43 -12
  269. package/src/sap/fe/core/messagebundle_sv.properties +38 -7
  270. package/src/sap/fe/core/messagebundle_th.properties +36 -5
  271. package/src/sap/fe/core/messagebundle_tr.properties +39 -8
  272. package/src/sap/fe/core/messagebundle_uk.properties +37 -6
  273. package/src/sap/fe/core/messagebundle_vi.properties +37 -6
  274. package/src/sap/fe/core/messagebundle_zh_CN.properties +37 -6
  275. package/src/sap/fe/core/messagebundle_zh_TW.properties +43 -12
  276. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +47 -73
  277. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  278. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
  279. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +211 -0
  280. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +70 -96
  281. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -8
  282. package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
  283. package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
  284. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
  285. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
  286. package/src/sap/fe/core/services/RoutingServiceFactory.js +963 -899
  287. package/src/sap/fe/core/services/RoutingServiceFactory.ts +907 -0
  288. package/src/sap/fe/core/services/ShellServicesFactory.js +694 -741
  289. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -40
  290. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +572 -643
  291. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +67 -96
  292. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -487
  293. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +449 -0
  294. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +48 -8
  295. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +11 -0
  296. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  297. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  298. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  299. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  300. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  301. package/src/sap/fe/core/support/CommonHelper.ts +1 -4
  302. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  303. package/src/sap/fe/core/templating/DataModelPathHelper.js +91 -90
  304. package/src/sap/fe/core/templating/DataModelPathHelper.ts +126 -123
  305. package/src/sap/fe/core/templating/DisplayModeFormatter.js +23 -3
  306. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +26 -5
  307. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  308. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  309. package/src/sap/fe/core/templating/FilterHelper.js +138 -79
  310. package/src/sap/fe/core/templating/FilterHelper.ts +148 -79
  311. package/src/sap/fe/core/templating/PropertyHelper.js +16 -2
  312. package/src/sap/fe/core/templating/PropertyHelper.ts +31 -24
  313. package/src/sap/fe/core/templating/UIFormatters.js +179 -43
  314. package/src/sap/fe/core/templating/UIFormatters.ts +190 -61
  315. package/src/sap/fe/core/type/Email.js +26 -8
  316. package/src/sap/fe/core/type/Email.ts +10 -11
  317. package/ui5.yaml +0 -3
  318. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +0 -74
@@ -16,13 +16,21 @@ import {
16
16
  not,
17
17
  notEqual,
18
18
  or,
19
- greaterThan
19
+ greaterThan,
20
+ formatResult
20
21
  } from "sap/fe/core/helpers/BindingExpression";
21
- import { CreationMode, NavigationSettingsConfiguration, TemplateType, ViewPathConfiguration } from "../../../ManifestSettings";
22
+ import { CreationMode, TemplateType, ViewPathConfiguration } from "../../../ManifestSettings";
22
23
  import { singletonPathVisitor, UI } from "../../../helpers/BindingHelper";
23
24
  import { PropertyAnnotationValue } from "@sap-ux/vocabularies-types";
24
25
  import { getTargetObjectPath, isPathDeletable, isPathInsertable, isPathUpdatable } from "sap/fe/core/templating/DataModelPathHelper";
25
26
  import { TableControlConfiguration } from "../Table";
27
+ import tableFormatters from "sap/fe/core/formatters/TableFormatter";
28
+
29
+ enum AnnotationHiddenProperty {
30
+ CreateHidden = "CreateHidden",
31
+ DeleteHidden = "DeleteHidden",
32
+ UpdateHidden = "UpdateHidden"
33
+ }
26
34
 
27
35
  export type StandardActionConfigType = {
28
36
  isTemplated?: BindingExpression<boolean>;
@@ -32,7 +40,7 @@ export type StandardActionConfigType = {
32
40
 
33
41
  type ExpressionRestrictionsType = {
34
42
  expression: Expression<boolean>;
35
- isOnlyCurrentEntityExpression: boolean;
43
+ navigationExpression: Expression<boolean>;
36
44
  };
37
45
  type StandardActionsRestrictionsType = Record<string, ExpressionRestrictionsType>;
38
46
 
@@ -43,7 +51,7 @@ export type StandardActionsContext = {
43
51
  "delete": Expression<boolean>;
44
52
  update: Expression<boolean>;
45
53
  };
46
- isExternalCreateConfigured: boolean;
54
+ creationMode: CreationMode;
47
55
  isDraftOrStickySupported: boolean;
48
56
  isViewWithMultipleVisualizations: boolean;
49
57
  newAction?: {
@@ -55,29 +63,28 @@ export type StandardActionsContext = {
55
63
  };
56
64
 
57
65
  /**
58
- * Generates context for the standard actions.
66
+ * Generates the context for the standard actions.
59
67
  *
60
68
  * @param {ConverterContext} converterContext
61
- * @param {NavigationSettingsConfiguration} navigationSettings
69
+ * @param {NavigationSettingsConfiguration} creationMode
62
70
  * @param {TableControlConfiguration} tableManifestConfiguration
63
71
  * @param {ViewPathConfiguration} viewConfiguration
64
72
  * @returns The context for table actions
65
73
  */
66
-
67
74
  export function generateStandardActionsContext(
68
75
  converterContext: ConverterContext,
69
- navigationSettings: NavigationSettingsConfiguration,
76
+ creationMode: CreationMode,
70
77
  tableManifestConfiguration: TableControlConfiguration,
71
78
  viewConfiguration?: ViewPathConfiguration
72
79
  ): StandardActionsContext {
73
80
  return {
74
81
  collectionPath: getTargetObjectPath(converterContext.getDataModelObjectPath()),
75
82
  hiddenAnnotation: {
76
- create: isActionAnnotatedHidden(converterContext, "CreateHidden"),
77
- "delete": isActionAnnotatedHidden(converterContext, "DeleteHidden"),
78
- update: isActionAnnotatedHidden(converterContext, "UpdateHidden")
83
+ create: isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.CreateHidden),
84
+ "delete": isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.DeleteHidden),
85
+ update: isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.UpdateHidden)
79
86
  },
80
- isExternalCreateConfigured: isExternalCreateConfigured(navigationSettings),
87
+ creationMode: creationMode,
81
88
  isDraftOrStickySupported: isDraftOrStickySupported(converterContext),
82
89
  isViewWithMultipleVisualizations: viewConfiguration
83
90
  ? converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration)
@@ -89,14 +96,23 @@ export function generateStandardActionsContext(
89
96
  }
90
97
 
91
98
  /**
92
- * Checks if an external created is configured for the navigation.
99
+ * Checks if draft is supported.
93
100
  *
94
- * @param {NavigationSettingsConfiguration} navigationSettings
101
+ * @param {ConverterContext} converterContext
95
102
  * @returns {boolean}
96
103
  */
97
- export function isExternalCreateConfigured(navigationSettings: NavigationSettingsConfiguration): boolean {
98
- const navigation = navigationSettings?.create;
99
- return (navigation && navigation.outbound && navigation.outboundDetail) !== undefined;
104
+ export function isDraftSupported(converterContext: ConverterContext): boolean {
105
+ const currentEntitySet = converterContext.getEntitySet();
106
+ const bIsDraftRoot = currentEntitySet && currentEntitySet.annotations?.Common?.DraftRoot ? true : false;
107
+ const bIsDraftNode = currentEntitySet && currentEntitySet.annotations?.Common?.DraftNode ? true : false;
108
+ const bIsDraftParentEntityForContainment =
109
+ converterContext.getDataModelObjectPath().targetObject?.containsTarget &&
110
+ (converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftRoot ||
111
+ converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftNode)
112
+ ? true
113
+ : false;
114
+
115
+ return bIsDraftRoot || bIsDraftNode || (!converterContext.getEntitySet() && bIsDraftParentEntityForContainment);
100
116
  }
101
117
 
102
118
  /**
@@ -106,26 +122,13 @@ export function isExternalCreateConfigured(navigationSettings: NavigationSetting
106
122
  * @returns {boolean}
107
123
  */
108
124
  export function isDraftOrStickySupported(converterContext: ConverterContext): boolean {
109
- const currentEntitySet = converterContext.getEntitySet();
125
+ const bIsDraftSupported = isDraftSupported(converterContext);
110
126
  const bIsStickySessionSupported = converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Session
111
127
  ?.StickySessionSupported
112
128
  ? true
113
129
  : false;
114
- const bIsDraftRoot = currentEntitySet && currentEntitySet.annotations?.Common?.DraftRoot ? true : false;
115
- const bIsDraftNode = currentEntitySet && currentEntitySet.annotations?.Common?.DraftNode ? true : false;
116
- const bIsDraftParentEntityForContainment =
117
- converterContext.getDataModelObjectPath().targetObject?.containsTarget &&
118
- (converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftRoot ||
119
- converterContext.getDataModelObjectPath().startingEntitySet?.annotations?.Common?.DraftNode)
120
- ? true
121
- : false;
122
130
 
123
- return (
124
- bIsDraftRoot ||
125
- bIsDraftNode ||
126
- bIsStickySessionSupported ||
127
- (!converterContext.getEntitySet() && bIsDraftParentEntityForContainment)
128
- );
131
+ return bIsDraftSupported || bIsStickySessionSupported;
129
132
  }
130
133
 
131
134
  /**
@@ -152,32 +155,37 @@ export function getNewAction(converterContext: ConverterContext): any {
152
155
  }
153
156
 
154
157
  /**
155
- * Gets binding expression for the action visibility configured into annotation.
158
+ * Gets the binding expression for the action visibility configured into annotation.
156
159
  *
157
160
  * @param {ConverterContext} converterContext
158
161
  * @param {string} sAnnotationTerm
162
+ * @param {boolean} bWithNavigationPath
159
163
  * @returns {Expression<boolean>}
160
164
  */
161
- export function isActionAnnotatedHidden(converterContext: ConverterContext, sAnnotationTerm: string): Expression<boolean> {
165
+ export function isActionAnnotatedHidden(
166
+ converterContext: ConverterContext,
167
+ sAnnotationTerm: string,
168
+ bWithNavigationPath = true
169
+ ): Expression<boolean> {
162
170
  const currentEntitySet = converterContext.getEntitySet();
163
171
  const dataModelObjectPath = converterContext.getDataModelObjectPath();
164
172
  // Consider only the last level of navigation. The others are already considered in the element binding of the page.
165
173
  const visitedNavigationPaths =
166
- dataModelObjectPath.navigationProperties.length > 0
174
+ dataModelObjectPath.navigationProperties.length > 0 && bWithNavigationPath
167
175
  ? [dataModelObjectPath.navigationProperties[dataModelObjectPath.navigationProperties.length - 1].name]
168
176
  : [];
177
+ const actionAnnotationValue =
178
+ ((currentEntitySet?.annotations.UI as any)?.[sAnnotationTerm] as PropertyAnnotationValue<boolean>) || false;
179
+
169
180
  return currentEntitySet
170
- ? annotationExpression(
171
- ((currentEntitySet?.annotations.UI as any)?.[sAnnotationTerm] as PropertyAnnotationValue<boolean>) || false,
172
- visitedNavigationPaths,
173
- undefined,
174
- (path: string) => singletonPathVisitor(path, converterContext, visitedNavigationPaths)
181
+ ? annotationExpression(actionAnnotationValue, visitedNavigationPaths, undefined, (path: string) =>
182
+ singletonPathVisitor(path, converterContext.getConvertedTypes(), visitedNavigationPaths)
175
183
  )
176
184
  : constant(false);
177
185
  }
178
186
 
179
187
  /**
180
- * Gets annotated restrictions for actions.
188
+ * Gets the annotated restrictions for the actions.
181
189
  *
182
190
  * @param {ConverterContext} converterContext
183
191
  * @returns {StandardActionsRestrictionsType}
@@ -202,9 +210,22 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
202
210
  restrictionsDef.forEach(function(def) {
203
211
  const defFunction = def["function"];
204
212
  result[def.key] = {
205
- expression: defFunction.apply(null, [dataModelObjectPath]),
206
- isOnlyCurrentEntityExpression: !!(defFunction.apply(null, [dataModelObjectPath, undefined, true]) as any)
207
- ?.currentEntityRestriction
213
+ expression: defFunction.apply(null, [
214
+ dataModelObjectPath,
215
+ {
216
+ pathVisitor: (path: string, navigationPaths: string[]) =>
217
+ singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths)
218
+ }
219
+ ]),
220
+ navigationExpression: defFunction.apply(null, [
221
+ dataModelObjectPath,
222
+ {
223
+ ignoreTargetCollection: true,
224
+ authorizeUnresolvable: true,
225
+ pathVisitor: (path: string, navigationPaths: string[]) =>
226
+ singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths)
227
+ }
228
+ ])
208
229
  };
209
230
  });
210
231
  return result;
@@ -214,20 +235,20 @@ export function getRestrictions(converterContext: ConverterContext): StandardAct
214
235
  * Checks if templating for insert/update actions is mandatory.
215
236
  *
216
237
  * @param {StandardActionsContext} standardActionsContext
217
- * @param {boolean} isDraftOrStickySupported
238
+ * @param {boolean} isDraftOrSticky
218
239
  * @param {boolean} isCreateAlwaysHidden
219
240
  * @returns {boolean}
220
241
  */
221
242
  export function getInsertUpdateActionsTemplating(
222
243
  standardActionsContext: StandardActionsContext,
223
- isDraftOrStickySupported: boolean,
244
+ isDraftOrSticky: boolean,
224
245
  isCreateAlwaysHidden: boolean
225
246
  ): boolean {
226
- return (isDraftOrStickySupported || standardActionsContext.isExternalCreateConfigured) && !isCreateAlwaysHidden;
247
+ return (isDraftOrSticky || standardActionsContext.creationMode === CreationMode.External) && !isCreateAlwaysHidden;
227
248
  }
228
249
 
229
250
  /**
230
- * Gets binding expressions for the properties of the action Create.
251
+ * Gets the binding expressions for the properties of the action Create.
231
252
  *
232
253
  * @param {ConverterContext} converterContext
233
254
  * @param {StandardActionsContext} standardActionsContext
@@ -246,7 +267,7 @@ export function getStandardActionCreate(
246
267
  }
247
268
 
248
269
  /**
249
- * Gets binding expressions for the properties of the action Delete.
270
+ * Gets the binding expressions for the properties of the action Delete.
250
271
  *
251
272
  * @param {ConverterContext} converterContext
252
273
  * @param {StandardActionsContext} standardActionsContext
@@ -266,112 +287,120 @@ export function getStandardActionDelete(
266
287
  }
267
288
 
268
289
  /**
269
- * Gets binding expressions for the properties of the action Paste.
290
+ * @param converterContext
291
+ * @param standardActionsContext
292
+ * @returns StandardActionConfigType
293
+ */
294
+ export function getCreationRow(
295
+ converterContext: ConverterContext,
296
+ standardActionsContext: StandardActionsContext
297
+ ): StandardActionConfigType {
298
+ const creationRowVisibility = getCreateVisibility(converterContext, standardActionsContext, true);
299
+
300
+ return {
301
+ isTemplated: compileBinding(getCreateTemplating(standardActionsContext, creationRowVisibility, true)),
302
+ visible: compileBinding(creationRowVisibility),
303
+ enabled: compileBinding(getCreationRowEnablement(converterContext, standardActionsContext, creationRowVisibility))
304
+ };
305
+ }
306
+
307
+ /**
308
+ * Gets the binding expressions for the properties of the action Paste.
270
309
  *
271
310
  * @param {ConverterContext} converterContext
272
311
  * @param {StandardActionsContext} standardActionsContext
312
+ * @param {boolean} isInsertUpdateActionsTemplated
273
313
  * @returns {StandardActionConfigType}
274
314
  */
275
315
  export function getStandardActionPaste(
276
316
  converterContext: ConverterContext,
277
- standardActionsContext: StandardActionsContext
317
+ standardActionsContext: StandardActionsContext,
318
+ isInsertUpdateActionsTemplated: boolean
278
319
  ): StandardActionConfigType {
279
320
  const createVisibility = getCreateVisibility(converterContext, standardActionsContext);
280
- const pasteVisibility = getPasteVisibility(converterContext, standardActionsContext, createVisibility);
281
-
321
+ const createEnablement = getCreateEnablement(converterContext, standardActionsContext, createVisibility);
322
+ const pasteVisibility = getPasteVisibility(converterContext, standardActionsContext, createVisibility, isInsertUpdateActionsTemplated);
282
323
  return {
283
- isTemplated: compileBinding(getDefaultTemplating(pasteVisibility)),
284
324
  visible: compileBinding(pasteVisibility),
285
- enabled: compileBinding(pasteVisibility)
325
+ enabled: compileBinding(getPasteEnablement(pasteVisibility, createEnablement))
286
326
  };
287
327
  }
288
328
 
289
329
  /**
290
- * Gets binding expressions for the properties of the action MassEdit.
330
+ * Gets the binding expressions for the properties of the action MassEdit.
291
331
  *
292
332
  * @param {ConverterContext} converterContext
293
333
  * @param {StandardActionsContext} standardActionsContext
294
- * @param {string | undefined} selectionMode
295
334
  * @returns {StandardActionConfigType}
296
335
  */
297
336
  export function getStandardActionMassEdit(
298
337
  converterContext: ConverterContext,
299
- standardActionsContext: StandardActionsContext,
300
- selectionMode: string | undefined
338
+ standardActionsContext: StandardActionsContext
301
339
  ): StandardActionConfigType {
302
- const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext, selectionMode);
340
+ const massEditVisibility = getMassEditVisibility(converterContext, standardActionsContext);
303
341
 
304
342
  return {
305
343
  isTemplated: compileBinding(getDefaultTemplating(massEditVisibility)),
306
344
  visible: compileBinding(massEditVisibility),
307
- enabled: compileBinding(getMassEditEnablement(standardActionsContext, massEditVisibility))
345
+ enabled: compileBinding(getMassEditEnablement(converterContext, standardActionsContext, massEditVisibility))
308
346
  };
309
347
  }
310
348
 
311
349
  /**
312
- * Gets binding expressions for the templating of the action Create.
350
+ * Gets the binding expression for the templating of the action Create.
313
351
  *
314
352
  * @param {StandardActionsContext} standardActionsContext
315
353
  * @param {Expression<boolean>} createVisibility
354
+ * @param {boolean} isForCreationRow
316
355
  * @returns {Expression<boolean> }
317
356
  */
318
357
  export function getCreateTemplating(
319
358
  standardActionsContext: StandardActionsContext,
320
- createVisibility: Expression<boolean>
359
+ createVisibility: Expression<boolean>,
360
+ isForCreationRow = false
321
361
  ): Expression<boolean> {
322
- const isCreationRow = standardActionsContext.tableManifestConfiguration.creationMode === CreationMode.CreationRow;
323
- const newAction = standardActionsContext.newAction;
324
- const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
325
-
326
362
  //Templating of Create Button is not done:
327
- // - If Button is never visible or CreationMode is on CreationRow
328
- // - Otherwise If new action is configured and never available
329
- // - Otherwise If delete restrictions coming from NavigationRestrictions are constantly false
330
- // - Otherwise If there is no external create action
331
- // - Otherwise if there is delete restrictions on the current entitySet set to false
363
+ // - If Button is never visible(covered the External create button, new Action)
364
+ // - or CreationMode is on CreationRow for Create Button
365
+ // - or CreationMode is not on CreationRow for CreationRow Button
332
366
 
333
- return ifElse(
334
- or(and(isConstant(createVisibility), equal(createVisibility, false)), isCreationRow),
335
- false,
336
- ifElse(
337
- and(isConstant(newAction?.available), equal(newAction?.available, false)),
338
- false,
339
- ifElse(
340
- and(not(standardActionsContext.restrictions.isInsertable.isOnlyCurrentEntityExpression), isConstant(isInsertable)),
341
- isInsertable,
342
- ifElse(
343
- standardActionsContext.isExternalCreateConfigured,
344
- true,
345
- not(and(isConstant(isInsertable), equal(isInsertable, constant(false))))
346
- )
347
- )
348
- )
367
+ return and(
368
+ //XNOR gate
369
+ or(
370
+ and(isForCreationRow, standardActionsContext.creationMode === CreationMode.CreationRow),
371
+ and(!isForCreationRow, standardActionsContext.creationMode !== CreationMode.CreationRow)
372
+ ),
373
+ or(not(isConstant(createVisibility)), createVisibility)
349
374
  );
350
375
  }
351
376
 
352
377
  /**
353
- * Gets binding expressions for the templating of the non-Create actions.
378
+ * Gets the binding expression for the templating of the non-Create actions.
354
379
  *
355
380
  * @param {Expression<boolean>} actionVisibility
356
381
  * @returns {Expression<boolean> }
357
382
  */
358
383
  export function getDefaultTemplating(actionVisibility: Expression<boolean>): Expression<boolean> {
359
- return not(and(isConstant(actionVisibility), equal(actionVisibility, false)));
384
+ return or(not(isConstant(actionVisibility)), actionVisibility);
360
385
  }
361
386
 
362
387
  /**
363
- * Gets binding expressions for the property visible of the action Create.
388
+ * Gets the binding expression for the property visible of the action Create.
364
389
  *
365
390
  * @param {ConverterContext} converterContext
366
391
  * @param {StandardActionsContext} standardActionsContext
392
+ * @param {boolean} isForCreationRow
367
393
  * @returns {Expression<boolean> }
368
394
  */
369
395
  export function getCreateVisibility(
370
396
  converterContext: ConverterContext,
371
- standardActionsContext: StandardActionsContext
397
+ standardActionsContext: StandardActionsContext,
398
+ isForCreationRow = false
372
399
  ): Expression<boolean> {
373
400
  const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
374
- const isCreateHidden = standardActionsContext.hiddenAnnotation.create;
401
+ const isCreateHidden = isForCreationRow
402
+ ? isActionAnnotatedHidden(converterContext, AnnotationHiddenProperty.CreateHidden, false)
403
+ : standardActionsContext.hiddenAnnotation.create;
375
404
  const newAction = standardActionsContext.newAction;
376
405
 
377
406
  //Create Button is visible:
@@ -385,12 +414,8 @@ export function getCreateVisibility(
385
414
  // - Otherwise
386
415
  // - This depends on the value of the the UI.IsEditable
387
416
  return ifElse(
388
- standardActionsContext.isExternalCreateConfigured,
389
- ifElse(
390
- converterContext.getTemplateType() === TemplateType.ListReport,
391
- not(isCreateHidden),
392
- and(not(isCreateHidden), UI.IsEditable)
393
- ),
417
+ standardActionsContext.creationMode === CreationMode.External,
418
+ and(not(isCreateHidden), or(converterContext.getTemplateType() === TemplateType.ListReport, UI.IsEditable)),
394
419
  ifElse(
395
420
  or(
396
421
  and(isConstant(newAction?.available), equal(newAction?.available, false)),
@@ -402,7 +427,7 @@ export function getCreateVisibility(
402
427
  false,
403
428
  ifElse(
404
429
  converterContext.getTemplateType() === TemplateType.ListReport,
405
- ifElse(isBinding(isCreateHidden), not(isCreateHidden), true),
430
+ or(not(isBinding(isCreateHidden)), not(isCreateHidden)),
406
431
  and(not(isCreateHidden), UI.IsEditable)
407
432
  )
408
433
  )
@@ -410,7 +435,7 @@ export function getCreateVisibility(
410
435
  }
411
436
 
412
437
  /**
413
- * Gets binding expressions for the property visible of the action Delete.
438
+ * Gets the binding expression for the property visible of the action Delete.
414
439
  *
415
440
  * @param {ConverterContext} converterContext
416
441
  * @param {StandardActionsContext} standardActionsContext
@@ -421,7 +446,7 @@ export function getDeleteVisibility(
421
446
  standardActionsContext: StandardActionsContext
422
447
  ): Expression<boolean> {
423
448
  const isDeleteHidden = standardActionsContext.hiddenAnnotation.delete;
424
- const isPathDeletable = standardActionsContext.restrictions.isDeletable.expression;
449
+ const pathDeletableExpression = standardActionsContext.restrictions.isDeletable.expression;
425
450
 
426
451
  //Delete Button is visible:
427
452
  // Prerequisites:
@@ -431,7 +456,7 @@ export function getDeleteVisibility(
431
456
  // - Otherwise
432
457
  // - If UI.DeleteHidden is true -> not visible
433
458
  // - Otherwise
434
- // - If we're on OP -> depending of the editMode and restrictions on deletable
459
+ // - If we're on OP -> depending if UI is editable and restrictions on deletable
435
460
  // - Otherwise
436
461
  // - If UI.DeleteHidden points to a property path -> provide a negated binding to this path
437
462
  // - Otherwise, delete is visible
@@ -440,15 +465,15 @@ export function getDeleteVisibility(
440
465
  or(standardActionsContext.isViewWithMultipleVisualizations, converterContext.getTemplateType() === TemplateType.AnalyticalListPage),
441
466
  false,
442
467
  ifElse(
443
- and(isConstant(isPathDeletable), equal(isPathDeletable, false)),
468
+ and(isConstant(pathDeletableExpression), equal(pathDeletableExpression, false)),
444
469
  false,
445
470
  ifElse(
446
471
  and(isConstant(isDeleteHidden), equal(isDeleteHidden, constant(true))),
447
472
  false,
448
473
  ifElse(
449
474
  converterContext.getTemplateType() !== TemplateType.ListReport,
450
- and(not(isDeleteHidden), equal(bindingExpression("/editMode", "ui"), "Editable")),
451
- ifElse(isBinding(isDeleteHidden), not(isDeleteHidden), true)
475
+ and(not(isDeleteHidden), UI.IsEditable),
476
+ not(and(isBinding(isDeleteHidden), isDeleteHidden))
452
477
  )
453
478
  )
454
479
  )
@@ -456,47 +481,50 @@ export function getDeleteVisibility(
456
481
  }
457
482
 
458
483
  /**
459
- * Gets binding expressions for the property visible of the action Paste.
484
+ * Gets the binding expression for the property visible of the action Paste.
460
485
  *
461
486
  * @param {ConverterContext} converterContext
462
487
  * @param {StandardActionsContext} standardActionsContext
463
488
  * @param {Expression<boolean>} createVisibility
489
+ * @param {boolean} isInsertUpdateActionsTemplated
464
490
  * @returns {Expression<boolean> }
465
491
  */
466
492
  export function getPasteVisibility(
467
493
  converterContext: ConverterContext,
468
494
  standardActionsContext: StandardActionsContext,
469
- createVisibility: Expression<boolean>
495
+ createVisibility: Expression<boolean>,
496
+ isInsertUpdateActionsTemplated: boolean
470
497
  ): Expression<boolean> {
471
- // If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates, button will be visible according to insertable restrictions and create visibility
498
+ // If Create is visible, enablePaste is not disabled into manifest and we are on OP/blocks outside Fiori elements templates
499
+ // Then button will be visible according to insertable restrictions and create visibility
472
500
  // Otherwise it's not visible
473
- return ifElse(
474
- and(notEqual(standardActionsContext.tableManifestConfiguration.enablePaste, false), equal(createVisibility, true)),
475
- [TemplateType.ListReport, TemplateType.AnalyticalListPage].indexOf(converterContext.getTemplateType()) === -1 &&
476
- standardActionsContext.restrictions.isInsertable.expression,
477
- false
501
+ return and(
502
+ notEqual(standardActionsContext.tableManifestConfiguration.enablePaste, false),
503
+ createVisibility,
504
+ isInsertUpdateActionsTemplated,
505
+ [TemplateType.ListReport, TemplateType.AnalyticalListPage].indexOf(converterContext.getTemplateType()) === -1,
506
+ standardActionsContext.restrictions.isInsertable.expression
478
507
  );
479
508
  }
480
509
 
481
510
  /**
482
- * Gets binding expressions for the property visible of the action MassEdit.
511
+ * Gets the binding expression for the property visible of the action MassEdit.
483
512
  *
484
513
  * @param {ConverterContext} converterContext
485
514
  * @param {StandardActionsContext} standardActionsContext
486
- * @param {string | undefined} selectionMode
487
515
  * @returns {Expression<boolean> }
488
516
  */
489
517
  export function getMassEditVisibility(
490
518
  converterContext: ConverterContext,
491
- standardActionsContext: StandardActionsContext,
492
- selectionMode: string | undefined
519
+ standardActionsContext: StandardActionsContext
493
520
  ): Expression<boolean> {
494
521
  const isUpdateHidden = standardActionsContext.hiddenAnnotation.update,
495
- isPathUpdatable = standardActionsContext.restrictions.isUpdatable.expression,
496
- bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false,
497
- iSelectionLimit: number = standardActionsContext.tableManifestConfiguration?.selectionLimit;
498
- const bIsRelevantSelectionMode: boolean = !((selectionMode && selectionMode === "Single") || (iSelectionLimit && iSelectionLimit < 2));
499
-
522
+ pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression,
523
+ bMassEditEnabledInManifest: boolean = standardActionsContext.tableManifestConfiguration?.enableMassEdit || false;
524
+ const templateBindingExpression =
525
+ converterContext.getTemplateType() === TemplateType.ObjectPage
526
+ ? UI.IsEditable
527
+ : converterContext.getTemplateType() === TemplateType.ListReport;
500
528
  //MassEdit is visible
501
529
  // If
502
530
  // - there is no static restrictions set to false
@@ -504,19 +532,64 @@ export function getMassEditVisibility(
504
532
  // - and the selectionMode is relevant
505
533
  // Then MassEdit is always visible in LR or dynamically visible in OP according to ui>Editable and hiddenAnnotation
506
534
  // Button is hidden for all other cases
507
- return ifElse(
508
- and(not(and(isConstant(isPathUpdatable), equal(isPathUpdatable, false))), bIsRelevantSelectionMode, bMassEditEnabledInManifest),
509
- ifElse(
510
- converterContext.getTemplateType() === TemplateType.ObjectPage,
511
- and(equal(UI.IsEditable, true), not(isUpdateHidden)),
512
- converterContext.getTemplateType() === TemplateType.ListReport
513
- ),
514
- false
535
+ return and(
536
+ not(and(isConstant(pathUpdatableExpression), equal(pathUpdatableExpression, false))),
537
+ bMassEditEnabledInManifest,
538
+ templateBindingExpression,
539
+ not(isUpdateHidden)
515
540
  );
516
541
  }
517
542
 
518
543
  /**
519
- * Gets binding expressions for the property enabled of the action Create.
544
+ * Gets the binding expression for the property enabled of the creationRow.
545
+ *
546
+ * @param {ConverterContext} converterContext
547
+ * @param {StandardActionsContext} standardActionsContext
548
+ * @param {Expression<boolean>} creationRowVisibility
549
+ * @returns {Expression<boolean> }
550
+ */
551
+ export function getCreationRowEnablement(
552
+ converterContext: ConverterContext,
553
+ standardActionsContext: StandardActionsContext,
554
+ creationRowVisibility: Expression<boolean>
555
+ ): Expression<boolean> {
556
+ const restrictionsInsertable = isPathInsertable(converterContext.getDataModelObjectPath(), {
557
+ ignoreTargetCollection: true,
558
+ authorizeUnresolvable: true,
559
+ pathVisitor: (path: string, navigationPaths: string[]) => {
560
+ if (path.indexOf("/") === 0) {
561
+ path = singletonPathVisitor(path, converterContext.getConvertedTypes(), navigationPaths);
562
+ return path;
563
+ }
564
+ const navigationProperties = converterContext.getDataModelObjectPath().navigationProperties;
565
+ if (navigationProperties) {
566
+ const partner = navigationProperties[navigationProperties.length - 1].partner;
567
+ if (partner) {
568
+ path = `${partner}/${path}`;
569
+ }
570
+ }
571
+ return path;
572
+ }
573
+ });
574
+ const isInsertable =
575
+ restrictionsInsertable._type === "Unresolvable"
576
+ ? isPathInsertable(converterContext.getDataModelObjectPath(), {
577
+ pathVisitor: (path: string) => singletonPathVisitor(path, converterContext.getConvertedTypes(), [])
578
+ })
579
+ : restrictionsInsertable;
580
+
581
+ return and(
582
+ creationRowVisibility,
583
+ isInsertable,
584
+ or(
585
+ !standardActionsContext.tableManifestConfiguration.disableAddRowButtonForEmptyData,
586
+ formatResult([bindingExpression("creationRowFieldValidity", "internal")], tableFormatters.validateCreationRowFields)
587
+ )
588
+ );
589
+ }
590
+
591
+ /**
592
+ * Gets the binding expression for the property enabled of the action Create.
520
593
  *
521
594
  * @param {ConverterContext} converterContext
522
595
  * @param {StandardActionsContext} standardActionsContext
@@ -531,21 +604,16 @@ export function getCreateEnablement(
531
604
  const isInsertable = standardActionsContext.restrictions.isInsertable.expression;
532
605
  const CollectionType = converterContext.resolveAbsolutePath<any>(standardActionsContext.collectionPath).target?._type;
533
606
  return and(
534
- not(equal(createVisibility, constant(false))),
535
- ifElse(
607
+ createVisibility,
608
+ or(
536
609
  CollectionType === "EntitySet",
537
- true,
538
- ifElse(
539
- converterContext.getTemplateType() !== TemplateType.ObjectPage,
540
- isInsertable,
541
- and(isInsertable, equal(bindingExpression("/editMode", "ui"), "Editable"))
542
- )
610
+ and(isInsertable, or(converterContext.getTemplateType() !== TemplateType.ObjectPage, UI.IsEditable))
543
611
  )
544
612
  );
545
613
  }
546
614
 
547
615
  /**
548
- * Gets binding expressions for the property enabled of the action Delete.
616
+ * Gets the binding expression for the property enabled of the action Delete.
549
617
  *
550
618
  * @param {ConverterContext} converterContext
551
619
  * @param {StandardActionsContext} standardActionsContext
@@ -559,22 +627,21 @@ export function getDeleteEnablement(
559
627
  ): Expression<boolean> {
560
628
  const isDeletable = standardActionsContext.restrictions.isDeletable.expression;
561
629
  const isOnlyDynamicOnCurrentEntity =
562
- standardActionsContext.restrictions.isDeletable.isOnlyCurrentEntityExpression && !isConstant(isDeletable);
630
+ !isConstant(isDeletable) && standardActionsContext.restrictions.isDeletable.navigationExpression._type === "Unresolvable";
563
631
  const numberOfSelectedContexts = bindingExpression("numberOfSelectedContexts", "internal");
564
632
  const numberOfDeletableContexts = bindingExpression("deletableContexts", "internal");
565
633
  const numberOfUnSavedContexts = bindingExpression("unSavedContexts", "internal");
566
634
 
567
635
  return and(
568
- not(equal(deleteVisibility, constant(false))),
636
+ deleteVisibility,
569
637
  ifElse(
570
638
  or(converterContext.getTemplateType() !== TemplateType.ObjectPage, isOnlyDynamicOnCurrentEntity),
571
- ifElse(
639
+ and(
572
640
  or(
573
641
  and(notEqual(numberOfDeletableContexts, undefined), greaterThan(length(numberOfDeletableContexts), 0)),
574
642
  and(notEqual(numberOfUnSavedContexts, undefined), greaterThan(length(numberOfUnSavedContexts), 0))
575
643
  ),
576
- bindingExpression("deleteEnabled", "internal"),
577
- false
644
+ bindingExpression("deleteEnabled", "internal")
578
645
  ),
579
646
  and(notEqual(numberOfSelectedContexts, 0), isDeletable)
580
647
  )
@@ -582,28 +649,67 @@ export function getDeleteEnablement(
582
649
  }
583
650
 
584
651
  /**
585
- * Gets binding expressions for the property enabled of the action MassEdit.
652
+ * Gets the binding expression for the property enabled of the action Paste.
653
+ *
654
+ * @param {Expression<boolean>} pasteVisibility
655
+ * @param {Expression<boolean>} createEnablement
656
+ * @returns {Expression<boolean> }
657
+ */
658
+ export function getPasteEnablement(pasteVisibility: Expression<boolean>, createEnablement: Expression<boolean>): Expression<boolean> {
659
+ return and(pasteVisibility, createEnablement);
660
+ }
661
+
662
+ /**
663
+ * Gets the binding expression for the property enabled of the action MassEdit.
586
664
  *
665
+ * @param {ConverterContext} converterContext
587
666
  * @param {StandardActionsContext} standardActionsContext
588
667
  * @param {Expression<boolean>} massEditVisibility
589
668
  * @returns {Expression<boolean> }
590
669
  */
591
670
  export function getMassEditEnablement(
671
+ converterContext: ConverterContext,
592
672
  standardActionsContext: StandardActionsContext,
593
673
  massEditVisibility: Expression<boolean>
594
674
  ): Expression<boolean> {
595
- const isPathUpdatable = standardActionsContext.restrictions.isUpdatable.expression;
675
+ const pathUpdatableExpression = standardActionsContext.restrictions.isUpdatable.expression;
596
676
  const isOnlyDynamicOnCurrentEntity: any =
597
- standardActionsContext.restrictions.isUpdatable.isOnlyCurrentEntityExpression && !isConstant(isPathUpdatable);
598
- const numberOfSelectedContexts = greaterOrEqual(bindingExpression("numberOfSelectedContexts", "internal"), 2);
599
- const numberOfUpdatableContexts = greaterOrEqual(length(bindingExpression("updatableContexts", "internal")), 2);
600
-
601
- return and(
602
- not(equal(massEditVisibility, constant(false))),
603
- ifElse(
604
- isOnlyDynamicOnCurrentEntity,
605
- and(numberOfSelectedContexts, numberOfUpdatableContexts),
606
- and(numberOfSelectedContexts, isPathUpdatable)
607
- )
677
+ !isConstant(pathUpdatableExpression) &&
678
+ standardActionsContext.restrictions.isUpdatable.navigationExpression._type === "Unresolvable";
679
+ const numberOfSelectedContexts = greaterOrEqual(bindingExpression("numberOfSelectedContexts", "internal"), 1);
680
+ const numberOfUpdatableContexts = greaterOrEqual(length(bindingExpression("updatableContexts", "internal")), 1);
681
+ const bIsDraftSupported = isDraftSupported(converterContext);
682
+ const bDisplayMode = isInDisplayMode(converterContext);
683
+
684
+ // numberOfUpdatableContexts needs to be added to the binding in case
685
+ // 1. Update is dependent on current entity property (isOnlyDynamicOnCurrentEntity is true).
686
+ // 2. The table is read only and draft enabled(like LR), in this case only active contexts can be mass edited.
687
+ // So, update depends on 'IsActiveEntity' value which needs to be checked runtime.
688
+ const runtimeBinding = ifElse(
689
+ or(and(bDisplayMode, bIsDraftSupported), isOnlyDynamicOnCurrentEntity),
690
+ and(numberOfSelectedContexts, numberOfUpdatableContexts),
691
+ and(numberOfSelectedContexts)
608
692
  );
693
+
694
+ return and(massEditVisibility, ifElse(isOnlyDynamicOnCurrentEntity, runtimeBinding, and(runtimeBinding, pathUpdatableExpression)));
695
+ }
696
+
697
+ /**
698
+ * Tells if the table in template is in display mode.
699
+ *
700
+ * @param {ConverterContext} converterContext
701
+ * @param {ViewPathConfiguration} viewConfiguration
702
+ * @returns {boolean}
703
+ */
704
+ export function isInDisplayMode(converterContext: ConverterContext, viewConfiguration?: ViewPathConfiguration): boolean {
705
+ const templateType = converterContext.getTemplateType();
706
+ if (
707
+ templateType === TemplateType.ListReport ||
708
+ templateType === TemplateType.AnalyticalListPage ||
709
+ (viewConfiguration && converterContext.getManifestWrapper().hasMultipleVisualizations(viewConfiguration))
710
+ ) {
711
+ return true;
712
+ }
713
+ // updatable will be handled at the property level
714
+ return false;
609
715
  }