@sapui5/sap.fe.core 1.97.0 → 1.100.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 (306) hide show
  1. package/package.json +7 -4
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +309 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +315 -0
  5. package/src/sap/fe/core/AppComponent.js +389 -397
  6. package/src/sap/fe/core/AppComponent.ts +403 -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 +68 -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 +2164 -2379
  14. package/src/sap/fe/core/CommonUtils.ts +2177 -0
  15. package/src/sap/fe/core/ExtensionAPI.js +279 -266
  16. package/src/sap/fe/core/ExtensionAPI.ts +250 -0
  17. package/src/sap/fe/core/PageController.js +218 -125
  18. package/src/sap/fe/core/PageController.ts +129 -0
  19. package/src/sap/fe/core/RouterProxy.js +924 -807
  20. package/src/sap/fe/core/RouterProxy.ts +840 -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 +173 -155
  24. package/src/sap/fe/core/TemplateComponent.ts +173 -0
  25. package/src/sap/fe/core/TemplateModel.js +79 -54
  26. package/src/sap/fe/core/TemplateModel.ts +63 -0
  27. package/src/sap/fe/core/TransactionHelper.js +1560 -1579
  28. package/src/sap/fe/core/TransactionHelper.ts +1717 -0
  29. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
  30. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
  31. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
  32. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
  33. package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
  34. package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
  35. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
  36. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  37. package/src/sap/fe/core/actions/draft.js +521 -581
  38. package/src/sap/fe/core/actions/draft.ts +566 -0
  39. package/src/sap/fe/core/actions/messageHandling.js +564 -511
  40. package/src/sap/fe/core/actions/messageHandling.ts +552 -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 -1211
  44. package/src/sap/fe/core/actions/operations.ts +1192 -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/controllerextensions/ControllerExtensionMetadata.js +70 -66
  48. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
  49. package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
  50. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
  51. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
  52. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
  53. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
  54. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
  55. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
  56. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
  57. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
  58. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
  59. package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
  60. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
  61. package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
  62. package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
  63. package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
  64. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
  65. package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
  66. package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
  67. package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
  68. package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
  69. package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
  70. package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
  71. package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
  72. package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
  73. package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
  74. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  75. package/src/sap/fe/core/controllerextensions/Share.js +220 -244
  76. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  77. package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
  78. package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
  79. package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
  80. package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
  81. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
  82. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  83. package/src/sap/fe/core/controls/CommandExecution.js +68 -66
  84. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  85. package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
  86. package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
  87. package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
  88. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
  89. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
  90. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
  91. package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
  92. package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
  93. package/src/sap/fe/core/controls/FilterBar.js +163 -159
  94. package/src/sap/fe/core/controls/FilterBar.ts +143 -0
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
  97. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
  98. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  99. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  100. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
  101. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
  102. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
  103. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
  104. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
  105. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  106. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
  107. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  108. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  109. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  110. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
  111. package/src/sap/fe/core/converters/ConverterContext.js +348 -367
  112. package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
  113. package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
  114. package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
  115. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
  116. package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
  117. package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
  118. package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
  119. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  120. package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
  121. package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
  122. package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
  123. package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
  124. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  125. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  126. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  127. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  128. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  129. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  130. package/src/sap/fe/core/converters/controls/Common/Form.js +21 -11
  131. package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
  132. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  133. package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
  134. package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
  135. package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
  136. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
  137. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
  138. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
  139. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
  140. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  141. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  142. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
  143. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  144. package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
  145. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  146. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  147. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  148. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  149. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  150. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  151. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  152. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  153. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  154. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
  155. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
  156. package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
  157. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
  158. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
  159. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
  160. package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
  161. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  162. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  163. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  164. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  165. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  166. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  167. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  168. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  169. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  170. package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
  171. package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
  172. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  173. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  174. package/src/sap/fe/core/fpm/Component.js +51 -54
  175. package/src/sap/fe/core/fpm/Component.ts +48 -0
  176. package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
  177. package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
  178. package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
  179. package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
  180. package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
  181. package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
  182. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
  183. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
  184. package/src/sap/fe/core/helpers/EditState.js +81 -84
  185. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  186. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  187. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  188. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  189. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  190. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  191. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  192. package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
  193. package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
  194. package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
  195. package/src/sap/fe/core/helpers/ModelHelper.ts +250 -0
  196. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  197. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  198. package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
  199. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -0
  200. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  201. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  202. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  203. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  204. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  205. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  206. package/src/sap/fe/core/library.js +427 -425
  207. package/src/sap/fe/core/library.support.js +23 -27
  208. package/src/sap/fe/core/library.support.ts +23 -0
  209. package/src/sap/fe/core/library.ts +420 -0
  210. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
  211. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
  212. package/src/sap/fe/core/messagebundle.properties +78 -13
  213. package/src/sap/fe/core/messagebundle_ar.properties +58 -7
  214. package/src/sap/fe/core/messagebundle_bg.properties +58 -7
  215. package/src/sap/fe/core/messagebundle_ca.properties +58 -7
  216. package/src/sap/fe/core/messagebundle_cs.properties +59 -8
  217. package/src/sap/fe/core/messagebundle_cy.properties +58 -7
  218. package/src/sap/fe/core/messagebundle_da.properties +58 -7
  219. package/src/sap/fe/core/messagebundle_de.properties +58 -7
  220. package/src/sap/fe/core/messagebundle_el.properties +58 -7
  221. package/src/sap/fe/core/messagebundle_en.properties +57 -6
  222. package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
  223. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
  224. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
  225. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
  226. package/src/sap/fe/core/messagebundle_es.properties +58 -7
  227. package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
  228. package/src/sap/fe/core/messagebundle_et.properties +58 -7
  229. package/src/sap/fe/core/messagebundle_fi.properties +60 -9
  230. package/src/sap/fe/core/messagebundle_fr.properties +64 -13
  231. package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
  232. package/src/sap/fe/core/messagebundle_hi.properties +58 -7
  233. package/src/sap/fe/core/messagebundle_hr.properties +58 -7
  234. package/src/sap/fe/core/messagebundle_hu.properties +59 -8
  235. package/src/sap/fe/core/messagebundle_id.properties +61 -10
  236. package/src/sap/fe/core/messagebundle_it.properties +58 -7
  237. package/src/sap/fe/core/messagebundle_iw.properties +58 -7
  238. package/src/sap/fe/core/messagebundle_ja.properties +58 -7
  239. package/src/sap/fe/core/messagebundle_kk.properties +58 -7
  240. package/src/sap/fe/core/messagebundle_ko.properties +58 -7
  241. package/src/sap/fe/core/messagebundle_lt.properties +58 -7
  242. package/src/sap/fe/core/messagebundle_lv.properties +59 -8
  243. package/src/sap/fe/core/messagebundle_ms.properties +58 -7
  244. package/src/sap/fe/core/messagebundle_nl.properties +58 -7
  245. package/src/sap/fe/core/messagebundle_no.properties +58 -7
  246. package/src/sap/fe/core/messagebundle_pl.properties +58 -7
  247. package/src/sap/fe/core/messagebundle_pt.properties +59 -8
  248. package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
  249. package/src/sap/fe/core/messagebundle_ro.properties +58 -7
  250. package/src/sap/fe/core/messagebundle_ru.properties +58 -7
  251. package/src/sap/fe/core/messagebundle_sh.properties +58 -7
  252. package/src/sap/fe/core/messagebundle_sk.properties +58 -7
  253. package/src/sap/fe/core/messagebundle_sl.properties +58 -7
  254. package/src/sap/fe/core/messagebundle_sv.properties +59 -8
  255. package/src/sap/fe/core/messagebundle_th.properties +58 -7
  256. package/src/sap/fe/core/messagebundle_tr.properties +60 -9
  257. package/src/sap/fe/core/messagebundle_uk.properties +58 -7
  258. package/src/sap/fe/core/messagebundle_vi.properties +58 -7
  259. package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
  260. package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
  261. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
  262. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  263. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
  264. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  265. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
  266. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
  267. package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
  268. package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
  269. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
  270. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
  271. package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
  272. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  273. package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
  274. package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
  275. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
  276. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
  277. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
  278. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -0
  279. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  280. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  281. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  282. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  283. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  284. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  285. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  286. package/src/sap/fe/core/support/CommonHelper.ts +1 -1
  287. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  288. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  289. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  290. package/src/sap/fe/core/templating/DataModelPathHelper.js +97 -127
  291. package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
  292. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  293. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  294. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  295. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  296. package/src/sap/fe/core/templating/FilterHelper.js +140 -78
  297. package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
  298. package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
  299. package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
  300. package/src/sap/fe/core/templating/UIFormatters.js +76 -135
  301. package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
  302. package/src/sap/fe/core/type/Email.js +1 -1
  303. package/src/sap/fe/core/type/Email.ts +4 -6
  304. package/ui5.yaml +0 -3
  305. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  306. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -0,0 +1,803 @@
1
+ import ControllerExtension from "sap/ui/core/mvc/ControllerExtension";
2
+ import OverrideExecution from "sap/ui/core/mvc/OverrideExecution";
3
+ import SelectionVariant from "sap/fe/navigation/SelectionVariant";
4
+ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
5
+ import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
6
+ import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
7
+ import Fragment from "sap/ui/core/Fragment";
8
+ import JSONModel from "sap/ui/model/json/JSONModel";
9
+ import Log from "sap/base/Log";
10
+ import CommonUtils from "sap/fe/core/CommonUtils";
11
+ import KeepAliveHelper from "sap/fe/core/helpers/KeepAliveHelper";
12
+ import mergeObjects from "sap/base/util/merge";
13
+ import { Extensible, Final, Override, Private, Public, UI5Class } from "sap/fe/core/helpers/ClassSupport";
14
+ import ControllerExtensionMetadata from "sap/fe/core/controllerextensions/ControllerExtensionMetadata";
15
+ import AppComponent from "sap/fe/core/AppComponent";
16
+ import ODataMetaModel from "sap/ui/model/odata/v4/ODataMetaModel";
17
+ import View from "sap/ui/core/mvc/View";
18
+ import PageController from "sap/fe/core/PageController";
19
+ import { NavigationService } from "sap/fe/core/services/NavigationServiceFactory";
20
+ import Context from "sap/ui/model/Context";
21
+ import Dialog from "sap/m/Dialog";
22
+ import ResourceBundle from "sap/base/i18n/ResourceBundle";
23
+
24
+ /**
25
+ * {@link sap.ui.core.mvc.ControllerExtension Controller extension}
26
+ *
27
+ * @namespace
28
+ * @alias sap.fe.core.controllerextensions.InternalInternalBasedNavigation
29
+ *
30
+ * @private
31
+ * @since 1.84.0
32
+ */
33
+ @UI5Class("sap.fe.core.controllerextensions.InternalInternalBasedNavigation", ControllerExtensionMetadata)
34
+ class InternalIntentBasedNavigation extends ControllerExtension {
35
+ private base!: PageController;
36
+ private _oAppComponent!: AppComponent;
37
+ private _oMetaModel!: ODataMetaModel;
38
+ private _oNavigationService!: NavigationService;
39
+ private _oView!: View;
40
+ @Override()
41
+ onInit() {
42
+ this._oAppComponent = this.base.getAppComponent();
43
+ this._oMetaModel = this._oAppComponent.getModel().getMetaModel() as ODataMetaModel;
44
+ this._oNavigationService = this._oAppComponent.getNavigationService();
45
+ this._oView = this.base.getView();
46
+ }
47
+
48
+ /**
49
+ * Enables intent-based navigation (SemanticObject-Action) with the provided context.
50
+ * If semantic object mapping is provided, this is also applied to the selection variant after the adaptation by a consumer.
51
+ * This takes care of removing any technical parameters and determines if an explace or inplace navigation should take place.
52
+ *
53
+ * @param {string} sSemanticObject Semantic object for the target app
54
+ * @param {string} sAction Action for the target app
55
+ * @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
56
+ * @param {Array|object} [mNavigationParameters.navigationContexts] Uses one of the following to be passed to the intent:
57
+ * a single instance of {@link sap.ui.model.odata.v4.Context}
58
+ * multiple instances of {@link sap.ui.model.odata.v4.Context}
59
+ * an object or an array of objects
60
+ * If an array of objects is passed, the context is used to determine the metaPath and to remove any sensitive data
61
+ * If an array of objects is passed, the following format ix expected:
62
+ * {
63
+ * data: {
64
+ * ProductID: 7634,
65
+ * Name: "Laptop"
66
+ * },
67
+ * metaPath: "/SalesOrderManage"
68
+ * }
69
+ * @param {string | object} [mNavigationParameters.semanticObjectMapping] String representation of the SemanticObjectMapping or SemanticObjectMapping that applies to this navigation
70
+ * @param {object} [mNavigationParameters.defaultRefreshStrategy] Default refresh strategy to be used in case no refresh strategy is specified for the intent in the view.
71
+ * @param {object} [mNavigationParameters.refreshStrategies]
72
+ * @param {object} [mNavigationParameters.additionalNavigationParameters] Additional navigation parameters configured in the crossAppNavigation outbound parameters.
73
+ **/
74
+ @Public
75
+ @Final
76
+ navigate(
77
+ sSemanticObject: string,
78
+ sAction: string,
79
+ mNavigationParameters:
80
+ | {
81
+ navigationContexts?: object | any[] | undefined;
82
+ semanticObjectMapping?: string | object | undefined;
83
+ defaultRefreshStrategy?: object | undefined;
84
+ refreshStrategies?: any;
85
+ additionalNavigationParameters?: object | undefined;
86
+ }
87
+ | undefined
88
+ ) {
89
+ const _doNavigate = (oContext?: any) => {
90
+ const vNavigationContexts = mNavigationParameters && mNavigationParameters.navigationContexts,
91
+ aNavigationContexts =
92
+ vNavigationContexts && !Array.isArray(vNavigationContexts) ? [vNavigationContexts] : vNavigationContexts,
93
+ vSemanticObjectMapping = mNavigationParameters && mNavigationParameters.semanticObjectMapping,
94
+ vOutboundParams = mNavigationParameters && mNavigationParameters.additionalNavigationParameters,
95
+ oTargetInfo: any = {
96
+ semanticObject: sSemanticObject,
97
+ action: sAction
98
+ },
99
+ oView = this.base.getView(),
100
+ oController = oView.getController() as PageController;
101
+
102
+ if (oContext) {
103
+ this._oView.setBindingContext(oContext);
104
+ }
105
+
106
+ if (sSemanticObject && sAction) {
107
+ let aSemanticAttributes: any[] = [],
108
+ oSelectionVariant = new SelectionVariant();
109
+ // 1. get SemanticAttributes for navigation
110
+ if (aNavigationContexts && aNavigationContexts.length) {
111
+ aNavigationContexts.map((oNavigationContext: any) => {
112
+ // 1.1.a if navigation context is instance of sap.ui.mode.odata.v4.Context
113
+ // else check if navigation context is of type object
114
+ if (oNavigationContext.isA && oNavigationContext.isA("sap.ui.model.odata.v4.Context")) {
115
+ // 1.1.b remove sensitive data
116
+ let oSemanticAttributes = oNavigationContext.getObject();
117
+ const sMetaPath = this._oMetaModel.getMetaPath(oNavigationContext.getPath());
118
+ // TODO: also remove sensitive data from navigation properties
119
+ oSemanticAttributes = this.removeSensitiveData(oSemanticAttributes, sMetaPath);
120
+ const oNavContext = this.prepareContextForExternalNavigation(oSemanticAttributes, oNavigationContext);
121
+ oTargetInfo["propertiesWithoutConflict"] = oNavContext.propertiesWithoutConflict;
122
+ aSemanticAttributes.push(oNavContext.semanticAttributes);
123
+ } else if (
124
+ !(oNavigationContext && Array.isArray(oNavigationContext.data)) &&
125
+ typeof oNavigationContext === "object"
126
+ ) {
127
+ // 1.1.b remove sensitive data from object
128
+ aSemanticAttributes.push(this.removeSensitiveData(oNavigationContext.data, oNavigationContext.metaPath));
129
+ } else if (oNavigationContext && Array.isArray(oNavigationContext.data)) {
130
+ // oNavigationContext.data can be array already ex : [{Customer: "10001"}, {Customer: "10091"}]
131
+ // hence assigning it to the aSemanticAttributes
132
+ aSemanticAttributes = this.removeSensitiveData(oNavigationContext.data, oNavigationContext.metaPath);
133
+ }
134
+ });
135
+ }
136
+ // 2.1 Merge base selection variant and sanitized semantic attributes into one SelectionVariant
137
+ if (aSemanticAttributes && aSemanticAttributes.length) {
138
+ oSelectionVariant = this._oNavigationService.mixAttributesAndSelectionVariant(
139
+ aSemanticAttributes,
140
+ oSelectionVariant.toJSONString()
141
+ );
142
+ }
143
+
144
+ // 3. Add filterContextUrl to SV so the NavigationHandler can remove any sensitive data based on view entitySet
145
+ const oModel = this._oView.getModel(),
146
+ sEntitySet = this.getEntitySet(),
147
+ sContextUrl = sEntitySet ? this._oNavigationService.constructContextUrl(sEntitySet, oModel) : undefined;
148
+ if (sContextUrl) {
149
+ oSelectionVariant.setFilterContextUrl(sContextUrl);
150
+ }
151
+
152
+ // Apply Outbound Parameters to the SV
153
+ if (vOutboundParams) {
154
+ this._applyOutboundParams(oSelectionVariant, vOutboundParams);
155
+ }
156
+
157
+ // 4. give an opportunity for the application to influence the SelectionVariant
158
+ oController.intentBasedNavigation.adaptNavigationContext(oSelectionVariant, oTargetInfo);
159
+
160
+ // 5. Apply semantic object mappings to the SV
161
+ if (vSemanticObjectMapping) {
162
+ this._applySemanticObjectMappings(oSelectionVariant, vSemanticObjectMapping);
163
+ }
164
+
165
+ // 6. remove technical parameters from Selection Variant
166
+ this._removeTechnicalParameters(oSelectionVariant);
167
+
168
+ // 7. check if programming model is sticky and page is editable
169
+ const sNavMode = oController._intentBasedNavigation.getNavigationMode();
170
+
171
+ // 8. Updating refresh strategy in internal model
172
+ const mRefreshStrategies = (mNavigationParameters && mNavigationParameters.refreshStrategies) || {},
173
+ oInternalModel = oView.getModel("internal") as JSONModel;
174
+ if (oInternalModel) {
175
+ if ((oView && (oView.getViewData() as any)).refreshStrategyOnAppRestore) {
176
+ const mViewRefreshStrategies = (oView.getViewData() as any).refreshStrategyOnAppRestore || {};
177
+ mergeObjects(mRefreshStrategies, mViewRefreshStrategies);
178
+ }
179
+ const mRefreshStrategy = KeepAliveHelper.getRefreshStrategyForIntent(mRefreshStrategies, sSemanticObject, sAction);
180
+ if (mRefreshStrategy) {
181
+ oInternalModel.setProperty("/refreshStrategyOnAppRestore", mRefreshStrategy);
182
+ }
183
+ }
184
+
185
+ // 9. Navigate via NavigationHandler
186
+ const onError = function() {
187
+ sap.ui.require(["sap/m/MessageBox"], function(MessageBox: any) {
188
+ const oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.fe.core") as ResourceBundle;
189
+ MessageBox.show(oResourceBundle.getText("C_COMMON_HELPER_NAVIGATION_ERROR_MESSAGE"), {
190
+ title: oResourceBundle.getText("C_COMMON_NAVIGATION_ERROR_TITLE")
191
+ });
192
+ });
193
+ };
194
+ this._oNavigationService.navigate(
195
+ sSemanticObject,
196
+ sAction,
197
+ (oSelectionVariant as any).toJSONString(),
198
+ undefined,
199
+ onError,
200
+ undefined,
201
+ sNavMode
202
+ );
203
+ } else {
204
+ throw new Error("Semantic Object/action is not provided");
205
+ }
206
+ };
207
+ const oBindingContext = this.base.getView().getBindingContext();
208
+ const oMetaModel = oBindingContext && (oBindingContext.getModel().getMetaModel() as ODataMetaModel);
209
+ if (
210
+ (this.getView().getViewData() as any).converterType === "ObjectPage" &&
211
+ oMetaModel &&
212
+ !ModelHelper.isStickySessionSupported(oMetaModel)
213
+ ) {
214
+ CommonUtils.fnProcessDataLossOrDraftDiscardConfirmation(
215
+ _doNavigate.bind(this),
216
+ Function.prototype,
217
+ this.base.getView().getBindingContext(),
218
+ this.base.getView().getController()
219
+ );
220
+ } else {
221
+ _doNavigate();
222
+ }
223
+ }
224
+
225
+ /**
226
+ * Prepare attributes to be passed to external navigation.
227
+ * @param {object} oSemanticAttributes Context data after removing all sensitive information.
228
+ * @param {object} oContext Actual context from which the semanticAttributes were derived.
229
+ * @returns {object} Object of prepared attributes for external navigation and no conflict properties.
230
+ */
231
+ @Public
232
+ @Final
233
+ prepareContextForExternalNavigation(oSemanticAttributes: any, oContext: Context) {
234
+ // 1. Find all distinct keys in the object SemanticAttributes
235
+ // Store meta path for each occurence of the key
236
+ const oDistinctKeys: any = {},
237
+ sContextPath = oContext.getPath(),
238
+ oMetaModel = oContext.getModel().getMetaModel() as ODataMetaModel,
239
+ sMetaPath = oMetaModel.getMetaPath(sContextPath),
240
+ aMetaPathParts = sMetaPath.split("/").filter(Boolean);
241
+
242
+ function _findDistinctKeysInObject(LookUpObject: any, sLookUpObjectMetaPath: any) {
243
+ for (const sKey in LookUpObject) {
244
+ // null case??
245
+ if (LookUpObject[sKey] === null || typeof LookUpObject[sKey] !== "object") {
246
+ if (!oDistinctKeys[sKey]) {
247
+ // if key is found for the first time then create array
248
+ oDistinctKeys[sKey] = [];
249
+ }
250
+ // push path to array
251
+ oDistinctKeys[sKey].push(sLookUpObjectMetaPath);
252
+ } else {
253
+ // if a nested object is found
254
+ const oNewLookUpObject = LookUpObject[sKey];
255
+ _findDistinctKeysInObject(oNewLookUpObject, sLookUpObjectMetaPath + "/" + sKey);
256
+ }
257
+ }
258
+ }
259
+
260
+ _findDistinctKeysInObject(oSemanticAttributes, sMetaPath);
261
+
262
+ // 2. Determine distinct key value and add conflicted paths to semantic attributes
263
+ const sMainEntitySetName = aMetaPathParts[0],
264
+ sMainEntityTypeName = oMetaModel.getObject("/" + sMainEntitySetName + "/@sapui.name"),
265
+ oPropertiesWithoutConflict: any = {};
266
+ let sMainEntityValuePath, sCurrentValuePath, sLastValuePath;
267
+ for (const sDistinctKey in oDistinctKeys) {
268
+ const aConflictingPaths = oDistinctKeys[sDistinctKey];
269
+ let sWinnerValuePath;
270
+ // Find winner value for each distinct key in case of conflict by the following rule:
271
+
272
+ // -> A. if any meta path for a distinct key is the same as main entity take that as the value
273
+ // -> B. if A is not met keep the value from the current context (sMetaPath === path of distince key)
274
+ // -> C. if A, B or C are not met take the last path for value
275
+ if (aConflictingPaths.length > 1) {
276
+ // conflict
277
+ for (let i = 0; i <= aConflictingPaths.length - 1; i++) {
278
+ const sPath = aConflictingPaths[i];
279
+ let sPathInContext = sPath.replace(sPath === sMetaPath ? sMetaPath : sMetaPath + "/", "");
280
+ sPathInContext = (sPathInContext === "" ? sPathInContext : sPathInContext + "/") + sDistinctKey;
281
+ const sEntityTypeName = oMetaModel.getObject(sPath + "/@sapui.name");
282
+ // rule A
283
+
284
+ // rule A
285
+ if (sEntityTypeName === sMainEntityTypeName) {
286
+ sMainEntityValuePath = sPathInContext;
287
+ }
288
+
289
+ // rule B
290
+ if (sPath === sMetaPath) {
291
+ sCurrentValuePath = sPathInContext;
292
+ }
293
+
294
+ // rule C
295
+ sLastValuePath = sPathInContext;
296
+
297
+ // add conflicted path to semantic attributes
298
+ // check if the current path points to main entity and prefix attribute names accordingly
299
+ oSemanticAttributes[
300
+ (sMetaPath + "/" + sPathInContext)
301
+ .split("/")
302
+ .filter(function(sValue: string) {
303
+ return sValue != "";
304
+ })
305
+ .join(".")
306
+ ] = oContext.getProperty(sPathInContext);
307
+ }
308
+ // A || B || C
309
+ sWinnerValuePath = sMainEntityValuePath || sCurrentValuePath || sLastValuePath;
310
+ oSemanticAttributes[sDistinctKey] = oContext.getProperty(sWinnerValuePath);
311
+ sMainEntityValuePath = undefined;
312
+ sCurrentValuePath = undefined;
313
+ sLastValuePath = undefined;
314
+ } else {
315
+ // no conflict, add distinct key without adding paths
316
+ const sPath = aConflictingPaths[0]; // because there is only one and hence no conflict
317
+ let sPathInContext = sPath.replace(sPath === sMetaPath ? sMetaPath : sMetaPath + "/", "");
318
+ sPathInContext = (sPathInContext === "" ? sPathInContext : sPathInContext + "/") + sDistinctKey;
319
+ oSemanticAttributes[sDistinctKey] = oContext.getProperty(sPathInContext);
320
+ oPropertiesWithoutConflict[sDistinctKey] = (sMetaPath + "/" + sPathInContext)
321
+ .split("/")
322
+ .filter(function(sValue: string) {
323
+ return sValue != "";
324
+ })
325
+ .join(".");
326
+ }
327
+ }
328
+ // 3. Remove all Navigation properties
329
+ for (const sProperty in oSemanticAttributes) {
330
+ if (oSemanticAttributes[sProperty] !== null && typeof oSemanticAttributes[sProperty] === "object") {
331
+ delete oSemanticAttributes[sProperty];
332
+ }
333
+ }
334
+ return {
335
+ semanticAttributes: oSemanticAttributes,
336
+ propertiesWithoutConflict: oPropertiesWithoutConflict
337
+ };
338
+ }
339
+ /**
340
+ * Prepare filter conditions to be passed to external navigation.
341
+ * @param {object} oFilterBarConditions Filter conditions.
342
+ * @param {string} sRootPath Root path of the application.
343
+ * @param {Array} aParameters Names of parameters to be considered.
344
+ * @returns {object} Object of prepared filter conditions for external navigation and no conflict filters.
345
+ */
346
+ @Public
347
+ @Final
348
+ prepareFiltersForExternalNavigation(oFilterBarConditions: any, sRootPath: string, aParameters?: any[]) {
349
+ let sPath;
350
+ const oDistinctKeys: any = {};
351
+ const oFilterConditionsWithoutConflict: any = {};
352
+ let sMainEntityValuePath, sCurrentValuePath, sFullContextPath, sWinnerValuePath, sPathInContext;
353
+
354
+ function _findDistinctKeysInObject(LookUpObject: any) {
355
+ let sLookUpObjectMetaPath;
356
+ for (let sKey in LookUpObject) {
357
+ if (LookUpObject[sKey]) {
358
+ if (sKey.includes("/")) {
359
+ sLookUpObjectMetaPath = sKey; // "/SalesOrdermanage/_Item/Material"
360
+ const aPathParts = sKey.split("/");
361
+ sKey = aPathParts[aPathParts.length - 1];
362
+ } else {
363
+ sLookUpObjectMetaPath = sRootPath;
364
+ }
365
+ if (!oDistinctKeys[sKey]) {
366
+ // if key is found for the first time then create array
367
+ oDistinctKeys[sKey] = [];
368
+ }
369
+
370
+ // push path to array
371
+ oDistinctKeys[sKey].push(sLookUpObjectMetaPath);
372
+ }
373
+ }
374
+ }
375
+
376
+ _findDistinctKeysInObject(oFilterBarConditions);
377
+ for (const sDistinctKey in oDistinctKeys) {
378
+ const aConflictingPaths = oDistinctKeys[sDistinctKey];
379
+
380
+ if (aConflictingPaths.length > 1) {
381
+ // conflict
382
+ for (let i = 0; i <= aConflictingPaths.length - 1; i++) {
383
+ sPath = aConflictingPaths[i];
384
+ if (sPath === sRootPath) {
385
+ sFullContextPath = sRootPath + "/" + sDistinctKey;
386
+ sPathInContext = sDistinctKey;
387
+ sMainEntityValuePath = sDistinctKey;
388
+ if (aParameters && aParameters.includes(sDistinctKey)) {
389
+ oFilterBarConditions["$Parameter." + sDistinctKey] = oFilterBarConditions[sDistinctKey];
390
+ }
391
+ } else {
392
+ sPathInContext = sPath;
393
+ sFullContextPath = ((sRootPath + "/" + sPath) as any).replaceAll(/\*/g, "");
394
+ sCurrentValuePath = sPath;
395
+ }
396
+ oFilterBarConditions[
397
+ sFullContextPath
398
+ .split("/")
399
+ .filter(function(sValue: any) {
400
+ return sValue != "";
401
+ })
402
+ .join(".")
403
+ ] = oFilterBarConditions[sPathInContext];
404
+ delete oFilterBarConditions[sPath];
405
+ }
406
+
407
+ sWinnerValuePath = sMainEntityValuePath || sCurrentValuePath;
408
+ oFilterBarConditions[sDistinctKey] = oFilterBarConditions[sWinnerValuePath];
409
+ } else {
410
+ // no conflict, add distinct key without adding paths
411
+ sPath = aConflictingPaths[0];
412
+ sFullContextPath =
413
+ sPath === sRootPath ? sRootPath + "/" + sDistinctKey : ((sRootPath + "/" + sPath) as any).replaceAll("*", "");
414
+ oFilterConditionsWithoutConflict[sDistinctKey] = sFullContextPath
415
+ .split("/")
416
+ .filter(function(sValue: any) {
417
+ return sValue != "";
418
+ })
419
+ .join(".");
420
+ if (aParameters && aParameters.includes(sDistinctKey)) {
421
+ oFilterBarConditions["$Parameter." + sDistinctKey] = oFilterBarConditions[sDistinctKey];
422
+ }
423
+ }
424
+ }
425
+
426
+ return {
427
+ filterConditions: oFilterBarConditions,
428
+ filterConditionsWithoutConflict: oFilterConditionsWithoutConflict
429
+ };
430
+ }
431
+
432
+ /**
433
+ * Get Navigation mode.
434
+ *
435
+ * @returns {string}
436
+ */
437
+ @Public
438
+ @Extensible(OverrideExecution.Instead)
439
+ getNavigationMode() {
440
+ return undefined;
441
+ }
442
+ /**
443
+ * Allows for navigation to a given intent (SemanticObject-Action) with the provided context, using a dialog that shows the contexts which cannot be passed
444
+ * If semantic object mapping is provided, this setting is also applied to the selection variant after adaptation by a consumer.
445
+ * This setting also removes any technical parameters and determines if an inplace or explace navigation should take place.
446
+ *
447
+ * @param {string} sSemanticObject Semantic object for the target app
448
+ * @param {string} sAction Action for the target app
449
+ * @param {object} [mNavigationParameters] Optional parameters to be passed to the external navigation
450
+ * @param {string} [mNavigationParameters.label]
451
+ * @param {Array|object} [mNavigationParameters.navigationContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent.
452
+ * @param {Array|object} [mNavigationParameters.applicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, to be passed to the intent and for which the IBN button is enabled
453
+ * @param {Array|object} [mNavigationParameters.notApplicableContexts] Single instance or multiple instances of {@link sap.ui.model.odata.v4.Context}, or alternatively an object or array of objects, which cannot be passed to the intent.
454
+ * if an array of contexts is passed the context is used to determine the meta path and accordingly remove the sensitive data
455
+ * If an array of objects is passed, the following format is expected:
456
+ * {
457
+ * data: {
458
+ * ProductID: 7634,
459
+ * Name: "Laptop"
460
+ * },
461
+ * metaPath: "/SalesOrderManage"
462
+ * }
463
+ * The metaPath is used to remove any sensitive data.
464
+ * @param {string | object} [mNavigationParameters.semanticObjectMapping] String representation of SemanticObjectMapping or SemanticObjectMapping that applies to this navigation
465
+ **/
466
+ @Public
467
+ @Final
468
+ navigateWithConfirmationDialog(
469
+ sSemanticObject: string,
470
+ sAction: string,
471
+ mNavigationParameters?: {
472
+ navigationContexts?: object | any[];
473
+ applicableContexts?: object | any[];
474
+ notApplicableContexts?: any;
475
+ label?: string;
476
+ semanticObjectMapping?: string | object;
477
+ }
478
+ ) {
479
+ if (mNavigationParameters?.notApplicableContexts && mNavigationParameters.notApplicableContexts?.length >= 1) {
480
+ let oApplicableContextDialog: Dialog;
481
+ const oController = {
482
+ onClose: function() {
483
+ // User cancels action
484
+ oApplicableContextDialog.close();
485
+ },
486
+ onContinue: () => {
487
+ // Users continues the action with the bound contexts
488
+ mNavigationParameters.navigationContexts = mNavigationParameters.applicableContexts;
489
+ oApplicableContextDialog.close();
490
+ this.navigate(sSemanticObject, sAction, mNavigationParameters);
491
+ }
492
+ };
493
+ const fnOpenAndFillDialog = function() {
494
+ let oDialogContent;
495
+ const nNotApplicable = mNavigationParameters.notApplicableContexts.length,
496
+ aNotApplicableItems = [];
497
+ for (let i = 0; i < mNavigationParameters.notApplicableContexts.length; i++) {
498
+ oDialogContent = mNavigationParameters.notApplicableContexts[i].getObject();
499
+ aNotApplicableItems.push(oDialogContent);
500
+ }
501
+ const oNotApplicableItemsModel = new JSONModel(aNotApplicableItems);
502
+ const oTotals = new JSONModel({ total: nNotApplicable, label: mNavigationParameters.label });
503
+ oApplicableContextDialog.setModel(oNotApplicableItemsModel, "notApplicable");
504
+ oApplicableContextDialog.setModel(oTotals, "totals");
505
+ oApplicableContextDialog.open();
506
+ };
507
+ // Show the contexts that are not applicable and will not therefore be processed
508
+ const sFragmentName = "sap.fe.core.controls.ActionPartial";
509
+ const oDialogFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
510
+ const oModel = this._oView.getModel();
511
+ const oMetaModel = oModel.getMetaModel();
512
+ const sCanonicalPath = mNavigationParameters.notApplicableContexts[0].getCanonicalPath();
513
+ const sEntitySet = sCanonicalPath.substr(0, sCanonicalPath.indexOf("(")) + "/";
514
+ Promise.resolve(
515
+ XMLPreprocessor.process(
516
+ oDialogFragment,
517
+ { name: sFragmentName },
518
+ {
519
+ bindingContexts: {
520
+ entityType: oMetaModel.createBindingContext(sEntitySet)
521
+ },
522
+ models: {
523
+ entityType: oMetaModel,
524
+ metaModel: oMetaModel
525
+ }
526
+ }
527
+ )
528
+ )
529
+ .then(function(oFragment: any) {
530
+ return Fragment.load({ definition: oFragment, controller: oController });
531
+ })
532
+ .then((oPopover: any) => {
533
+ oApplicableContextDialog = oPopover;
534
+ this.getView().addDependent(oPopover);
535
+ fnOpenAndFillDialog();
536
+ })
537
+ .catch(function() {
538
+ Log.error("Error");
539
+ });
540
+ } else {
541
+ this.navigate(sSemanticObject, sAction, mNavigationParameters);
542
+ }
543
+ }
544
+ _removeTechnicalParameters(oSelectionVariant: any) {
545
+ oSelectionVariant.removeSelectOption("@odata.context");
546
+ oSelectionVariant.removeSelectOption("@odata.metadataEtag");
547
+ oSelectionVariant.removeSelectOption("SAP__Messages");
548
+ }
549
+ /**
550
+ * Get targeted Entity set.
551
+ *
552
+ * @returns {string} Entity set name
553
+ *
554
+ *
555
+ */
556
+ @Private
557
+ getEntitySet() {
558
+ return (this._oView.getViewData() as any).entitySet;
559
+ }
560
+ /**
561
+ * Removes sensitive data from the semantic attribute with respect to entitySet.
562
+ *
563
+ * @param {object} oAttributes Context data
564
+ * @param {string} sMetaPath Meta path to reach the entityset in the MetaModel
565
+ * @returns {Array} Array of semantic Attributes
566
+ * @private
567
+ **/
568
+ // TO-DO add unit tests for this function in the controller extension qunit.
569
+ @Public
570
+ @Final
571
+ removeSensitiveData(oAttributes: any, sMetaPath: string) {
572
+ const aProperties = Object.keys(oAttributes);
573
+ if (aProperties.length) {
574
+ delete oAttributes["@odata.context"];
575
+ delete oAttributes["@odata.metadataEtag"];
576
+ delete oAttributes["SAP__Messages"];
577
+ for (let j = 0; j < aProperties.length; j++) {
578
+ if (oAttributes[aProperties[j]] && typeof oAttributes[aProperties[j]] === "object") {
579
+ this.removeSensitiveData(oAttributes[aProperties[j]], sMetaPath + "/" + aProperties[j]);
580
+ }
581
+ const sProp = aProperties[j],
582
+ aPropertyAnnotations = this._oMetaModel.getObject(sMetaPath + "/" + sProp + "@");
583
+ if (aPropertyAnnotations) {
584
+ if (
585
+ aPropertyAnnotations["@com.sap.vocabularies.PersonalData.v1.IsPotentiallySensitive"] ||
586
+ aPropertyAnnotations["@com.sap.vocabularies.UI.v1.ExcludeFromNavigationContext"] ||
587
+ aPropertyAnnotations["@com.sap.vocabularies.Analytics.v1.Measure"]
588
+ ) {
589
+ delete oAttributes[sProp];
590
+ } else if (aPropertyAnnotations["@com.sap.vocabularies.Common.v1.FieldControl"]) {
591
+ const oFieldControl = aPropertyAnnotations["@com.sap.vocabularies.Common.v1.FieldControl"];
592
+ if (oFieldControl["$EnumMember"] && oFieldControl["$EnumMember"].split("/")[1] === "Inapplicable") {
593
+ delete oAttributes[sProp];
594
+ } else if (oFieldControl["$Path"] && this._isFieldControlPathInapplicable(oFieldControl["$Path"], oAttributes)) {
595
+ delete oAttributes[sProp];
596
+ }
597
+ }
598
+ }
599
+ }
600
+ }
601
+ return oAttributes;
602
+ }
603
+
604
+ /**
605
+ * Check if Path based FieldControl Evaluates to inapplicable.
606
+ *
607
+ * @param {string} sFieldControlPath Field control path
608
+ * @param {object} oAttribute SemanticAttributes
609
+ * @returns {boolean} `true` if inapplicable
610
+ *
611
+ */
612
+ _isFieldControlPathInapplicable(sFieldControlPath: string, oAttribute: any) {
613
+ let bInapplicable = false;
614
+ const aParts = sFieldControlPath.split("/");
615
+ // sensitive data is removed only if the path has already been resolved.
616
+ if (aParts.length > 1) {
617
+ bInapplicable =
618
+ oAttribute[aParts[0]] && oAttribute[aParts[0]].hasOwnProperty(aParts[1]) && oAttribute[aParts[0]][aParts[1]] === 0;
619
+ } else {
620
+ bInapplicable = oAttribute[sFieldControlPath] === 0;
621
+ }
622
+ return bInapplicable;
623
+ }
624
+ /**
625
+ * Method to replace Local Properties with Semantic Object mappings.
626
+ *
627
+ * @param {object} oSelectionVariant SelectionVariant consisting of filterbar, Table and Page Context
628
+ * @param {object | string} vMappings A string representation of semantic object mapping
629
+ * @returns {object} - Modified SelectionVariant with LocalProperty replaced with SemanticObjectProperties.
630
+ */
631
+ _applySemanticObjectMappings(oSelectionVariant: SelectionVariant, vMappings: object | string) {
632
+ const oMappings = typeof vMappings === "string" ? JSON.parse(vMappings) : vMappings;
633
+ for (let i = 0; i < oMappings.length; i++) {
634
+ const sLocalProperty =
635
+ (oMappings[i]["LocalProperty"] && oMappings[i]["LocalProperty"]["$PropertyPath"]) ||
636
+ (oMappings[i]["@com.sap.vocabularies.Common.v1.LocalProperty"] &&
637
+ oMappings[i]["@com.sap.vocabularies.Common.v1.LocalProperty"]["$Path"]);
638
+ const sSemanticObjectProperty =
639
+ oMappings[i]["SemanticObjectProperty"] || oMappings[i]["@com.sap.vocabularies.Common.v1.SemanticObjectProperty"];
640
+ if (oSelectionVariant.getSelectOption(sLocalProperty)) {
641
+ const oSelectOption = oSelectionVariant.getSelectOption(sLocalProperty);
642
+
643
+ //Create a new SelectOption with sSemanticObjectProperty as the property Name and remove the older one
644
+ oSelectionVariant.removeSelectOption(sLocalProperty);
645
+ oSelectionVariant.massAddSelectOption(sSemanticObjectProperty, oSelectOption);
646
+ }
647
+ }
648
+ return oSelectionVariant;
649
+ }
650
+ /**
651
+ * Navigates to an Outbound provided in the manifest.
652
+ * @function
653
+ * @param {string} sOutbound Identifier to location the outbound in the manifest
654
+ * @param {object} mNavigationParameters Optional map containing key/value pairs to be passed to the intent
655
+ * @alias sap.fe.core.controllerextensions.IntentBasedNavigation#navigateOutbound
656
+ * @since 1.86.0
657
+ **/
658
+ @Public
659
+ @Final
660
+ navigateOutbound(sOutbound: string, mNavigationParameters: any) {
661
+ let aNavParams: any[] | undefined;
662
+ const oManifestEntry = this.base.getAppComponent().getManifestEntry("sap.app"),
663
+ oOutbound = oManifestEntry.crossNavigation && oManifestEntry.crossNavigation.outbounds[sOutbound];
664
+ if (!oOutbound) {
665
+ Log.error("Outbound is not defined in manifest!!");
666
+ return;
667
+ }
668
+ const sSemanticObject = oOutbound.semanticObject,
669
+ sAction = oOutbound.action,
670
+ outboundParams = oOutbound.parameters && this.getOutboundParams(oOutbound.parameters);
671
+
672
+ if (mNavigationParameters) {
673
+ aNavParams = [];
674
+ Object.keys(mNavigationParameters).forEach(function(key: string) {
675
+ let oParams: any;
676
+ if (Array.isArray(mNavigationParameters[key])) {
677
+ const aValues = mNavigationParameters[key];
678
+ for (let i = 0; i < aValues.length; i++) {
679
+ oParams = {};
680
+ oParams[key] = aValues[i];
681
+ aNavParams?.push(oParams);
682
+ }
683
+ } else {
684
+ oParams = {};
685
+ oParams[key] = mNavigationParameters[key];
686
+ aNavParams?.push(oParams);
687
+ }
688
+ });
689
+ }
690
+ if (aNavParams || outboundParams) {
691
+ mNavigationParameters = {
692
+ navigationContexts: {
693
+ data: aNavParams || outboundParams
694
+ }
695
+ };
696
+ }
697
+ this.base._intentBasedNavigation.navigate(sSemanticObject, sAction, mNavigationParameters);
698
+ }
699
+
700
+ /**
701
+ * Method to apply outbound parameters defined in the manifest.
702
+ * @param {object} oSelectionVariant SelectionVariant consisting of a filter bar, a table, and a page context
703
+ * @param {object} vOutboundParams Outbound Properties defined in the manifest
704
+ * @returns {object} - The modified SelectionVariant with outbound parameters.
705
+ */
706
+ _applyOutboundParams(oSelectionVariant: SelectionVariant, vOutboundParams: any) {
707
+ const aParameters = Object.keys(vOutboundParams);
708
+ const aSelectProperties = oSelectionVariant.getSelectOptionsPropertyNames();
709
+ aParameters.forEach(function(key: string) {
710
+ if (!aSelectProperties.includes(key)) {
711
+ oSelectionVariant.addSelectOption(key, "I", "EQ", vOutboundParams[key]);
712
+ }
713
+ });
714
+ return oSelectionVariant;
715
+ }
716
+ /**
717
+ * Method to get the outbound parameters defined in the manifest.
718
+ *
719
+ * @function
720
+ * @param {object} oOutboundParams Parameters defined in the outbounds. Only "plain" is supported
721
+ * @returns {Array} Parameters with the key-Value pair
722
+ **/
723
+ @Public
724
+ @Final
725
+ getOutboundParams(oOutboundParams: any) {
726
+ const oParamsMapping: any = {};
727
+ if (oOutboundParams) {
728
+ const aParameters = Object.keys(oOutboundParams) || [];
729
+ if (aParameters.length > 0) {
730
+ aParameters.forEach(function(key: string) {
731
+ const oMapping = oOutboundParams[key];
732
+ if (oMapping.value && oMapping.value.value && oMapping.value.format === "plain") {
733
+ if (!oParamsMapping[key]) {
734
+ oParamsMapping[key] = oMapping.value.value;
735
+ }
736
+ }
737
+ });
738
+ }
739
+ }
740
+ return oParamsMapping;
741
+ }
742
+
743
+ /**
744
+ * Triggers an outbound navigation when a user chooses the chevron.
745
+ *
746
+ * @param {object} oController
747
+ * @param {string} sOutboundTarget Name of the outbound target (needs to be defined in the manifest)
748
+ * @param {sap.ui.model.odata.v4.Context} oContext The context that contains the data for the target app
749
+ * @param {string} sCreatePath Create path when the chevron is created.
750
+ * @returns {Promise} Promise which is resolved once the navigation is triggered
751
+ */
752
+
753
+ @Public
754
+ @Final
755
+ onChevronPressNavigateOutBound(oController: PageController, sOutboundTarget: string, oContext: any, sCreatePath: string) {
756
+ const oOutbounds = (oController.getAppComponent() as any).getRoutingService().getOutbounds();
757
+ const oDisplayOutbound = oOutbounds[sOutboundTarget];
758
+ let additionalNavigationParameters;
759
+ if (oDisplayOutbound && oDisplayOutbound.semanticObject && oDisplayOutbound.action) {
760
+ const oRefreshStrategies: any = {
761
+ intents: {}
762
+ };
763
+ const oDefaultRefreshStrategy: any = {};
764
+ let sMetaPath;
765
+
766
+ if (oContext) {
767
+ if (oContext.isA && oContext.isA("sap.ui.model.odata.v4.Context")) {
768
+ sMetaPath = ModelHelper.getMetaPathForContext(oContext);
769
+ oContext = [oContext];
770
+ } else {
771
+ sMetaPath = ModelHelper.getMetaPathForContext(oContext[0]);
772
+ }
773
+ oDefaultRefreshStrategy[sMetaPath] = "self";
774
+ oRefreshStrategies["_feDefault"] = oDefaultRefreshStrategy;
775
+ }
776
+
777
+ if (sCreatePath) {
778
+ const sKey = oDisplayOutbound.semanticObject + "-" + oDisplayOutbound.action;
779
+ oRefreshStrategies.intents[sKey] = {};
780
+ oRefreshStrategies.intents[sKey][sCreatePath] = "self";
781
+ }
782
+ if (oDisplayOutbound && oDisplayOutbound.parameters) {
783
+ const oParams = oDisplayOutbound.parameters && this.getOutboundParams(oDisplayOutbound.parameters);
784
+ if (Object.keys(oParams).length > 0) {
785
+ additionalNavigationParameters = oParams;
786
+ }
787
+ }
788
+
789
+ oController._intentBasedNavigation.navigate(oDisplayOutbound.semanticObject, oDisplayOutbound.action, {
790
+ navigationContexts: oContext,
791
+ refreshStrategies: oRefreshStrategies,
792
+ additionalNavigationParameters: additionalNavigationParameters
793
+ });
794
+
795
+ //TODO: check why returning a promise is required
796
+ return Promise.resolve();
797
+ } else {
798
+ throw new Error("outbound target " + sOutboundTarget + " not found in cross navigation definition of manifest");
799
+ }
800
+ }
801
+ }
802
+
803
+ export default InternalIntentBasedNavigation;