@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
@@ -1,7 +1,7 @@
1
- import { EntitySet, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
2
- import { annotationExpression, constant, equal, Expression } from "sap/fe/core/helpers/BindingExpression";
1
+ import { ConverterOutput, EntitySet, EntityType, NavigationProperty, Property } from "@sap-ux/annotation-converter";
2
+ import { annotationExpression, constant, equal, Expression, unresolveableExpression } from "sap/fe/core/helpers/BindingExpression";
3
3
  import { NavigationPropertyRestrictionTypes } from "@sap-ux/vocabularies-types/dist/generated/Capabilities";
4
- import { PropertyOrPath } from "sap/fe/core/templating/UIFormatters";
4
+ import { PropertyOrPath } from "sap/fe/core/templating/DisplayModeFormatter";
5
5
  import { isAnnotationPathExpression, isPathExpression } from "sap/fe/core/templating/PropertyHelper";
6
6
  import {
7
7
  FilterExpressionRestrictionTypeTypes,
@@ -20,6 +20,14 @@ export type DataModelObjectPath = {
20
20
  targetEntitySet?: EntitySet;
21
21
  targetEntityType: EntityType;
22
22
  targetObject: any;
23
+ convertedTypes: ConverterOutput;
24
+ };
25
+
26
+ type ExtractionParametersOnPath = {
27
+ propertyPath?: PropertyOrPath<Property>;
28
+ pathVisitor?: Function;
29
+ ignoreTargetCollection?: boolean;
30
+ authorizeUnresolvable?: boolean;
23
31
  };
24
32
 
25
33
  export const getPathRelativeLocation = function(
@@ -28,51 +36,49 @@ export const getPathRelativeLocation = function(
28
36
  ): NavigationProperty[] {
29
37
  if (!contextPath) {
30
38
  return visitedNavProps;
39
+ } else if (visitedNavProps.length >= contextPath.navigationProperties.length) {
40
+ let remainingNavProps: NavigationProperty[] = [];
41
+ contextPath.navigationProperties.forEach((navProp, navIndex) => {
42
+ if (visitedNavProps[navIndex] !== navProp) {
43
+ remainingNavProps.push(visitedNavProps[navIndex]);
44
+ }
45
+ });
46
+ remainingNavProps = remainingNavProps.concat(visitedNavProps.slice(contextPath.navigationProperties.length));
47
+ // Clean up NavProp -> Owner
48
+ let currentIdx = 0;
49
+ while (remainingNavProps.length > 1 && currentIdx != remainingNavProps.length - 1) {
50
+ const currentNav = remainingNavProps[currentIdx];
51
+ const nextNavProp = remainingNavProps[currentIdx + 1];
52
+ if (currentNav.partner === nextNavProp.name) {
53
+ remainingNavProps.splice(0, 2);
54
+ } else {
55
+ currentIdx++;
56
+ }
57
+ }
58
+ return remainingNavProps;
31
59
  } else {
32
- if (visitedNavProps.length >= contextPath.navigationProperties.length) {
33
- let remainingNavProps: NavigationProperty[] = [];
34
- contextPath.navigationProperties.forEach((navProp, navIndex) => {
35
- if (visitedNavProps[navIndex] !== navProp) {
36
- remainingNavProps.push(visitedNavProps[navIndex]);
37
- }
38
- });
39
- remainingNavProps = remainingNavProps.concat(visitedNavProps.slice(contextPath.navigationProperties.length));
40
- // Clean up NavProp -> Owner
41
- let currentIdx = 0;
42
- while (remainingNavProps.length > 1 && currentIdx != remainingNavProps.length - 1) {
43
- const currentNav = remainingNavProps[currentIdx];
44
- const nextNavProp = remainingNavProps[currentIdx + 1];
45
- if (currentNav.partner === nextNavProp.name) {
46
- remainingNavProps.splice(0, 2);
47
- } else {
48
- currentIdx++;
49
- }
60
+ let extraNavProp: NavigationProperty[] = [];
61
+ visitedNavProps.forEach((navProp, navIndex) => {
62
+ if (contextPath.navigationProperties[navIndex] !== navProp) {
63
+ extraNavProp.push(visitedNavProps[navIndex]);
50
64
  }
51
- return remainingNavProps;
52
- } else {
53
- let extraNavProp: NavigationProperty[] = [];
54
- visitedNavProps.forEach((navProp, navIndex) => {
55
- if (contextPath.navigationProperties[navIndex] !== navProp) {
56
- extraNavProp.push(visitedNavProps[navIndex]);
57
- }
58
- });
59
- extraNavProp = extraNavProp.concat(contextPath.navigationProperties.slice(visitedNavProps.length));
60
- // Clean up NavProp -> Owner
61
- let currentIdx = 0;
62
- while (extraNavProp.length > 1 && currentIdx != extraNavProp.length - 1) {
63
- const currentNav = extraNavProp[currentIdx];
64
- const nextNavProp = extraNavProp[currentIdx + 1];
65
- if (currentNav.partner === nextNavProp.name) {
66
- extraNavProp.splice(0, 2);
67
- } else {
68
- currentIdx++;
69
- }
65
+ });
66
+ extraNavProp = extraNavProp.concat(contextPath.navigationProperties.slice(visitedNavProps.length));
67
+ // Clean up NavProp -> Owner
68
+ let currentIdx = 0;
69
+ while (extraNavProp.length > 1 && currentIdx != extraNavProp.length - 1) {
70
+ const currentNav = extraNavProp[currentIdx];
71
+ const nextNavProp = extraNavProp[currentIdx + 1];
72
+ if (currentNav.partner === nextNavProp.name) {
73
+ extraNavProp.splice(0, 2);
74
+ } else {
75
+ currentIdx++;
70
76
  }
71
- extraNavProp = extraNavProp.map(navProp => {
72
- return navProp.targetType.navigationProperties.find(np => np.name === navProp.partner) as NavigationProperty;
73
- });
74
- return extraNavProp;
75
77
  }
78
+ extraNavProp = extraNavProp.map(navProp => {
79
+ return navProp.targetType.navigationProperties.find(np => np.name === navProp.partner) as NavigationProperty;
80
+ });
81
+ return extraNavProp;
76
82
  }
77
83
  };
78
84
 
@@ -122,57 +128,24 @@ export const enhanceDataModelPath = function(
122
128
  contextLocation: dataModelObjectPath.contextLocation,
123
129
  targetEntitySet: currentEntitySet,
124
130
  targetEntityType: currentEntityType,
125
- targetObject: oTarget
131
+ targetObject: oTarget,
132
+ convertedTypes: dataModelObjectPath.convertedTypes
126
133
  };
127
134
  };
128
135
 
129
- export const getTargetEntitySetPath = function(dataModelObjectPath: DataModelObjectPath, bRelative: boolean = false): string {
130
- let targetEntitySetPath: string = "";
131
- if (!bRelative) {
132
- targetEntitySetPath += `/${dataModelObjectPath.startingEntitySet.name}`;
133
- }
134
- let currentEntitySet =
135
- bRelative && dataModelObjectPath.contextLocation?.targetEntitySet
136
- ? dataModelObjectPath.contextLocation.targetEntitySet
137
- : dataModelObjectPath.startingEntitySet;
138
- let navigatedPaths: string[] = [];
139
- dataModelObjectPath.navigationProperties.forEach(navProp => {
140
- if (
141
- !bRelative ||
142
- !dataModelObjectPath.contextLocation ||
143
- !dataModelObjectPath.contextLocation?.navigationProperties.some(
144
- contextNavProp => contextNavProp.fullyQualifiedName === navProp.fullyQualifiedName
145
- )
146
- ) {
147
- // in case of relative entitySetPath we don't consider navigationPath that are already in the context
148
- navigatedPaths.push(navProp.name);
149
- }
150
- if (currentEntitySet && currentEntitySet.navigationPropertyBinding.hasOwnProperty(navigatedPaths.join("/"))) {
151
- if (bRelative) {
152
- targetEntitySetPath += `${navigatedPaths.join("/")}`;
153
- } else {
154
- targetEntitySetPath += `/$NavigationPropertyBinding/${navigatedPaths.join("/")}/$`;
155
- }
156
- currentEntitySet = currentEntitySet.navigationPropertyBinding[navigatedPaths.join("/")];
157
- navigatedPaths = [];
158
- }
159
- });
160
- return targetEntitySetPath;
161
- };
162
-
163
- export const getTargetEntitySetNavigation = function(dataModelObjectPath: DataModelObjectPath): NavigationProperty[] {
164
- const visitedNavigationProperties: NavigationProperty[] = [];
136
+ export const getTargetEntitySetPath = function(dataModelObjectPath: DataModelObjectPath): string {
137
+ let targetEntitySetPath: string = `/${dataModelObjectPath.startingEntitySet.name}`;
165
138
  let currentEntitySet = dataModelObjectPath.startingEntitySet;
166
139
  let navigatedPaths: string[] = [];
167
140
  dataModelObjectPath.navigationProperties.forEach(navProp => {
168
141
  navigatedPaths.push(navProp.name);
169
142
  if (currentEntitySet && currentEntitySet.navigationPropertyBinding.hasOwnProperty(navigatedPaths.join("/"))) {
170
- visitedNavigationProperties.push(navProp);
143
+ targetEntitySetPath += `/$NavigationPropertyBinding/${navigatedPaths.join("/")}/$`;
171
144
  currentEntitySet = currentEntitySet.navigationPropertyBinding[navigatedPaths.join("/")];
172
145
  navigatedPaths = [];
173
146
  }
174
147
  });
175
- return visitedNavigationProperties;
148
+ return targetEntitySetPath;
176
149
  };
177
150
 
178
151
  export const getTargetObjectPath = function(dataModelObjectPath: DataModelObjectPath, bRelative: boolean = false): string {
@@ -251,59 +224,53 @@ export const getContextRelativeTargetObjectPath = function(
251
224
 
252
225
  export const isPathUpdatable = function(
253
226
  dataModelObjectPath: DataModelObjectPath | undefined,
254
- propertyPath?: PropertyOrPath<Property>,
255
- bTableCase?: boolean
227
+ extractionParametersOnPath?: ExtractionParametersOnPath
256
228
  ): Expression<boolean> {
257
229
  return checkOnPath(
258
230
  dataModelObjectPath,
259
- (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities | EntityTypeAnnotations_Capabilities) => {
231
+ (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities) => {
260
232
  return annotationObject?.UpdateRestrictions?.Updatable;
261
233
  },
262
- propertyPath,
263
- bTableCase
234
+ extractionParametersOnPath
264
235
  );
265
236
  };
266
237
 
267
238
  export const isPathSearchable = function(
268
239
  dataModelObjectPath: DataModelObjectPath | undefined,
269
- propertyPath?: PropertyOrPath<Property>,
270
- bTableCase?: boolean
240
+ extractionParametersOnPath?: ExtractionParametersOnPath
271
241
  ): Expression<boolean> {
272
242
  return checkOnPath(
273
243
  dataModelObjectPath,
274
244
  (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities) => {
275
245
  return annotationObject?.SearchRestrictions?.Searchable;
276
246
  },
277
- propertyPath,
278
- bTableCase
247
+ extractionParametersOnPath
279
248
  );
280
249
  };
281
250
 
282
251
  export const isPathDeletable = function(
283
252
  dataModelObjectPath: DataModelObjectPath | undefined,
284
- propertyPath?: PropertyOrPath<Property>,
285
- bTableCase?: boolean
253
+ extractionParametersOnPath?: ExtractionParametersOnPath
286
254
  ): Expression<boolean> {
287
255
  return checkOnPath(
288
256
  dataModelObjectPath,
289
- (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities | EntityTypeAnnotations_Capabilities) => {
257
+ (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities) => {
290
258
  return annotationObject?.DeleteRestrictions?.Deletable;
291
259
  },
292
- propertyPath,
293
- bTableCase
260
+ extractionParametersOnPath
294
261
  );
295
262
  };
296
263
 
297
264
  export const isPathInsertable = function(
298
265
  dataModelObjectPath: DataModelObjectPath | undefined,
299
- propertyPath?: PropertyOrPath<Property>
266
+ extractionParametersOnPath?: ExtractionParametersOnPath
300
267
  ): Expression<boolean> {
301
268
  return checkOnPath(
302
269
  dataModelObjectPath,
303
- (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities | EntityTypeAnnotations_Capabilities) => {
270
+ (annotationObject: NavigationPropertyRestriction | EntitySetAnnotations_Capabilities) => {
304
271
  return annotationObject?.InsertRestrictions?.Insertable;
305
272
  },
306
- propertyPath
273
+ extractionParametersOnPath
307
274
  );
308
275
  };
309
276
 
@@ -335,13 +302,13 @@ export const checkFilterExpressionRestrictions = function(
335
302
  export const checkOnPath = function(
336
303
  dataModelObjectPath: DataModelObjectPath | undefined,
337
304
  checkFunction: Function,
338
- propertyPath?: PropertyOrPath<Property>,
339
- bTableCase?: boolean
305
+ extractionParametersOnPath?: ExtractionParametersOnPath
340
306
  ): Expression<boolean> {
341
307
  if (!dataModelObjectPath || !dataModelObjectPath.startingEntitySet) {
342
308
  return constant(true);
343
309
  }
344
- dataModelObjectPath = enhanceDataModelPath(dataModelObjectPath, propertyPath);
310
+
311
+ dataModelObjectPath = enhanceDataModelPath(dataModelObjectPath, extractionParametersOnPath?.propertyPath);
345
312
 
346
313
  let currentEntitySet: EntitySet | null = dataModelObjectPath.startingEntitySet;
347
314
  let parentEntitySet: EntitySet | null = null;
@@ -379,11 +346,11 @@ export const checkOnPath = function(
379
346
  });
380
347
 
381
348
  // At this point we have navigated down all the nav prop and we should have
382
- // The target entityset pointing to either null (in case of containment navprop a last part), or the actual target (non containment as target)
383
- // The parent entitySet pointing to the previous entityset used in the path
349
+ // The target entitySet pointing to either null (in case of containment navprop a last part), or the actual target (non containment as target)
350
+ // The parent entitySet pointing to the previous entitySet used in the path
384
351
  // VisitedNavigationPath should contain the path up to this property
385
352
 
386
- // Restrictions should then be evaluated as ParentEntitySet.NavRestrictions[NavpropertyPath] || TargetEntitySet.Restrictions
353
+ // Restrictions should then be evaluated as ParentEntitySet.NavRestrictions[NavPropertyPath] || TargetEntitySet.Restrictions
387
354
  const fullNavigationPath = visitedNavigationPropsName.join("/");
388
355
  let restrictions, visitedNavProps;
389
356
  if (parentEntitySet !== null) {
@@ -396,18 +363,19 @@ export const checkOnPath = function(
396
363
  const _allVisitedNavigationProps = allVisitedNavigationProps.slice(0, -1);
397
364
  if (targetEntitySet !== null) {
398
365
  visitedNavProps = _allVisitedNavigationProps;
366
+ } else if (_allVisitedNavigationProps.length === 0) {
367
+ visitedNavProps = allVisitedNavigationProps.slice(0);
399
368
  } else {
400
- if (_allVisitedNavigationProps.length === 0) {
401
- visitedNavProps = allVisitedNavigationProps.slice(0);
402
- } else {
403
- visitedNavProps = _allVisitedNavigationProps;
404
- }
369
+ visitedNavProps = _allVisitedNavigationProps;
405
370
  }
371
+ const pathRelativeLocation = getPathRelativeLocation(dataModelObjectPath?.contextLocation, visitedNavProps).map(
372
+ np => np.name
373
+ );
374
+ const pathVisitorFunction = extractionParametersOnPath?.pathVisitor
375
+ ? getPathVisitorForSingleton(extractionParametersOnPath.pathVisitor, pathRelativeLocation)
376
+ : undefined; // send pathVisitor function only when it is defined and only send function or defined as a parameter
406
377
  restrictions = equal(
407
- annotationExpression(
408
- restrictionDefinition,
409
- getPathRelativeLocation(dataModelObjectPath?.contextLocation, visitedNavProps).map(np => np.name)
410
- ),
378
+ annotationExpression(restrictionDefinition, pathRelativeLocation, undefined, pathVisitorFunction),
411
379
  true
412
380
  );
413
381
  }
@@ -416,25 +384,34 @@ export const checkOnPath = function(
416
384
  );
417
385
  }
418
386
  let targetRestrictions;
419
- let restrictionDefinition = checkFunction(targetEntitySet?.annotations?.Capabilities);
420
- if (targetEntitySet === null && restrictionDefinition === undefined) {
421
- restrictionDefinition = checkFunction(targetEntityType?.annotations?.Capabilities);
422
- }
423
- if (restrictionDefinition !== undefined) {
424
- targetRestrictions = equal(
425
- annotationExpression(
426
- restrictionDefinition,
427
- getPathRelativeLocation(dataModelObjectPath.contextLocation, allVisitedNavigationProps).map(np => np.name)
428
- ),
429
- true
430
- );
431
- }
432
- //object page table case in path based scenario's fallback to exisiting approach
433
- if (bTableCase && !restrictions && restrictionDefinition?.path) {
434
- const oResult: any = {
435
- "currentEntityRestriction": targetRestrictions
436
- };
437
- return oResult;
387
+ if (!extractionParametersOnPath?.ignoreTargetCollection) {
388
+ let restrictionDefinition = checkFunction(targetEntitySet?.annotations?.Capabilities);
389
+ if (targetEntitySet === null && restrictionDefinition === undefined) {
390
+ restrictionDefinition = checkFunction(targetEntityType?.annotations?.Capabilities);
391
+ }
392
+ if (restrictionDefinition !== undefined) {
393
+ const pathRelativeLocation = getPathRelativeLocation(dataModelObjectPath.contextLocation, allVisitedNavigationProps).map(
394
+ np => np.name
395
+ );
396
+ const pathVisitorFunction = extractionParametersOnPath?.pathVisitor
397
+ ? getPathVisitorForSingleton(extractionParametersOnPath.pathVisitor, pathRelativeLocation)
398
+ : undefined;
399
+ targetRestrictions = equal(
400
+ annotationExpression(restrictionDefinition, pathRelativeLocation, undefined, pathVisitorFunction),
401
+ true
402
+ );
403
+ }
438
404
  }
439
- return restrictions || targetRestrictions || constant(true);
405
+
406
+ return (
407
+ restrictions || targetRestrictions || (extractionParametersOnPath?.authorizeUnresolvable ? unresolveableExpression : constant(true))
408
+ );
409
+ };
410
+ // This helper method is used to add relative path location argument to singletonPathVisitorFunction i.e. pathVisitor
411
+ // pathVisitor method is used later to get the correct bindings for singleton entity
412
+ // method is invoked later in bindingExpression() method to get the correct binding.
413
+ const getPathVisitorForSingleton = function(pathVisitor: Function, pathRelativeLocation: string[]) {
414
+ return function(path: string) {
415
+ return pathVisitor(path, pathRelativeLocation);
416
+ };
440
417
  };
@@ -0,0 +1,114 @@
1
+ /*!
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
+ */
5
+ sap.ui.define(["sap/fe/core/templating/PropertyHelper"], function (PropertyHelper) {
6
+ "use strict";
7
+
8
+ var _exports = {};
9
+ var isPathExpression = PropertyHelper.isPathExpression;
10
+
11
+ var EDM_TYPE_MAPPING = {
12
+ "Edm.Boolean": {
13
+ type: "sap.ui.model.odata.type.Boolean"
14
+ },
15
+ "Edm.Byte": {
16
+ type: "sap.ui.model.odata.type.Byte"
17
+ },
18
+ "Edm.Date": {
19
+ type: "sap.ui.model.odata.type.Date"
20
+ },
21
+ "Edm.DateTimeOffset": {
22
+ constraints: {
23
+ "$Precision": "precision"
24
+ },
25
+ type: "sap.ui.model.odata.type.DateTimeOffset"
26
+ },
27
+ "Edm.Decimal": {
28
+ constraints: {
29
+ "@Org.OData.Validation.V1.Minimum/$Decimal": "minimum",
30
+ "@Org.OData.Validation.V1.Minimum@Org.OData.Validation.V1.Exclusive": "minimumExclusive",
31
+ "@Org.OData.Validation.V1.Maximum/$Decimal": "maximum",
32
+ "@Org.OData.Validation.V1.Maximum@Org.OData.Validation.V1.Exclusive": "maximumExclusive",
33
+ "$Precision": "precision",
34
+ "$Scale": "scale"
35
+ },
36
+ type: "sap.ui.model.odata.type.Decimal"
37
+ },
38
+ "Edm.Double": {
39
+ type: "sap.ui.model.odata.type.Double"
40
+ },
41
+ "Edm.Guid": {
42
+ type: "sap.ui.model.odata.type.Guid"
43
+ },
44
+ "Edm.Int16": {
45
+ type: "sap.ui.model.odata.type.Int16"
46
+ },
47
+ "Edm.Int32": {
48
+ type: "sap.ui.model.odata.type.Int32"
49
+ },
50
+ "Edm.Int64": {
51
+ type: "sap.ui.model.odata.type.Int64"
52
+ },
53
+ "Edm.SByte": {
54
+ type: "sap.ui.model.odata.type.SByte"
55
+ },
56
+ "Edm.Single": {
57
+ type: "sap.ui.model.odata.type.Single"
58
+ },
59
+ "Edm.Stream": {
60
+ type: "sap.ui.model.odata.type.Stream"
61
+ },
62
+ "Edm.Binary": {
63
+ type: "sap.ui.model.odata.type.Stream"
64
+ },
65
+ "Edm.String": {
66
+ constraints: {
67
+ "@com.sap.vocabularies.Common.v1.IsDigitSequence": "isDigitSequence",
68
+ "$MaxLength": "maxLength",
69
+ "$Nullable": "nullable"
70
+ },
71
+ type: "sap.ui.model.odata.type.String"
72
+ },
73
+ "Edm.TimeOfDay": {
74
+ constraints: {
75
+ "$Precision": "precision"
76
+ },
77
+ type: "sap.ui.model.odata.type.TimeOfDay"
78
+ }
79
+ };
80
+ _exports.EDM_TYPE_MAPPING = EDM_TYPE_MAPPING;
81
+
82
+ var getDisplayMode = function (oPropertyPath, oDataModelObjectPath) {
83
+ var _oProperty$annotation, _oProperty$annotation2, _oTextAnnotation$anno, _oTextAnnotation$anno2, _oTextAnnotation$anno3, _oEntityType$annotati, _oEntityType$annotati2, _oEntityType$annotati3, _oEntityType$annotati4, _oEntityType$annotati5, _oEntityType$annotati6;
84
+
85
+ if (!oPropertyPath || typeof oPropertyPath === "string") {
86
+ return "Value";
87
+ }
88
+
89
+ var oProperty = isPathExpression(oPropertyPath) && oPropertyPath.$target || oPropertyPath;
90
+ var oEntityType = oDataModelObjectPath && oDataModelObjectPath.targetEntityType;
91
+ var oTextAnnotation = (_oProperty$annotation = oProperty.annotations) === null || _oProperty$annotation === void 0 ? void 0 : (_oProperty$annotation2 = _oProperty$annotation.Common) === null || _oProperty$annotation2 === void 0 ? void 0 : _oProperty$annotation2.Text;
92
+ var oTextArrangementAnnotation = typeof oTextAnnotation !== "string" && (oTextAnnotation === null || oTextAnnotation === void 0 ? void 0 : (_oTextAnnotation$anno = oTextAnnotation.annotations) === null || _oTextAnnotation$anno === void 0 ? void 0 : (_oTextAnnotation$anno2 = _oTextAnnotation$anno.UI) === null || _oTextAnnotation$anno2 === void 0 ? void 0 : (_oTextAnnotation$anno3 = _oTextAnnotation$anno2.TextArrangement) === null || _oTextAnnotation$anno3 === void 0 ? void 0 : _oTextAnnotation$anno3.toString()) || (oEntityType === null || oEntityType === void 0 ? void 0 : (_oEntityType$annotati = oEntityType.annotations) === null || _oEntityType$annotati === void 0 ? void 0 : (_oEntityType$annotati2 = _oEntityType$annotati.UI) === null || _oEntityType$annotati2 === void 0 ? void 0 : (_oEntityType$annotati3 = _oEntityType$annotati2.TextArrangement) === null || _oEntityType$annotati3 === void 0 ? void 0 : _oEntityType$annotati3.toString());
93
+ var sDisplayValue = oTextAnnotation ? "DescriptionValue" : "Value";
94
+
95
+ if (oTextAnnotation && oTextArrangementAnnotation || oEntityType !== null && oEntityType !== void 0 && (_oEntityType$annotati4 = oEntityType.annotations) !== null && _oEntityType$annotati4 !== void 0 && (_oEntityType$annotati5 = _oEntityType$annotati4.UI) !== null && _oEntityType$annotati5 !== void 0 && (_oEntityType$annotati6 = _oEntityType$annotati5.TextArrangement) !== null && _oEntityType$annotati6 !== void 0 && _oEntityType$annotati6.toString()) {
96
+ if (oTextArrangementAnnotation === "UI.TextArrangementType/TextOnly") {
97
+ sDisplayValue = "Description";
98
+ } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextLast") {
99
+ sDisplayValue = "ValueDescription";
100
+ } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextSeparate") {
101
+ sDisplayValue = "Value";
102
+ } else {
103
+ //Default should be TextFirst if there is a Text annotation and neither TextOnly nor TextLast are set
104
+ sDisplayValue = "DescriptionValue";
105
+ }
106
+ }
107
+
108
+ return sDisplayValue;
109
+ };
110
+
111
+ _exports.getDisplayMode = getDisplayMode;
112
+ return _exports;
113
+ }, false);
114
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkRpc3BsYXlNb2RlRm9ybWF0dGVyLnRzIl0sIm5hbWVzIjpbIkVETV9UWVBFX01BUFBJTkciLCJ0eXBlIiwiY29uc3RyYWludHMiLCJnZXREaXNwbGF5TW9kZSIsIm9Qcm9wZXJ0eVBhdGgiLCJvRGF0YU1vZGVsT2JqZWN0UGF0aCIsIm9Qcm9wZXJ0eSIsImlzUGF0aEV4cHJlc3Npb24iLCIkdGFyZ2V0Iiwib0VudGl0eVR5cGUiLCJ0YXJnZXRFbnRpdHlUeXBlIiwib1RleHRBbm5vdGF0aW9uIiwiYW5ub3RhdGlvbnMiLCJDb21tb24iLCJUZXh0Iiwib1RleHRBcnJhbmdlbWVudEFubm90YXRpb24iLCJVSSIsIlRleHRBcnJhbmdlbWVudCIsInRvU3RyaW5nIiwic0Rpc3BsYXlWYWx1ZSJdLCJtYXBwaW5ncyI6IjtBQUFBO0FBQ0E7QUFDQTs7Ozs7OztBQVdPLE1BQU1BLGdCQUFxQyxHQUFHO0FBQ3BELG1CQUFlO0FBQUVDLE1BQUFBLElBQUksRUFBRTtBQUFSLEtBRHFDO0FBRXBELGdCQUFZO0FBQUVBLE1BQUFBLElBQUksRUFBRTtBQUFSLEtBRndDO0FBR3BELGdCQUFZO0FBQUVBLE1BQUFBLElBQUksRUFBRTtBQUFSLEtBSHdDO0FBSXBELDBCQUFzQjtBQUNyQkMsTUFBQUEsV0FBVyxFQUFFO0FBQ1osc0JBQWM7QUFERixPQURRO0FBSXJCRCxNQUFBQSxJQUFJLEVBQUU7QUFKZSxLQUo4QjtBQVVwRCxtQkFBZTtBQUNkQyxNQUFBQSxXQUFXL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ZXh0QXJyYW5nZW1lbnRUeXBlL1RleHRPbmx5XCIpIHtcblx0XHRcdHNEaXNwbGF5VmFsdWUgPSBcIkRlc2NyaXB0aW9uXCI7XG5cdFx0fSBlbHNlIGlmIChvVGV4dEFycmFuZ2VtZW50QW5ub3RhdGlvbiA9PT0gXCJVSS5UZXh0QXJyYW5nZW1lbnRUeXBlL1RleHRMYXN0XCIpIHtcblx0XHRcdHNEaXNwbGF5VmFsdWUgPSBcIlZhbHVlRGVzY3JpcHRpb25cIjtcblx0XHR9IGVsc2UgaWYgKG9UZXh0QXJyYW5nZW1lbnRBbm5vdGF0aW9uID09PSBcIlVJLlRleHRBcnJhbmdlbWVudFR5cGUvVGV4dFNlcGFyYXRlXCIpIHtcblx0XHRcdHNEaXNwbGF5VmFsdWUgPSBcIlZhbHVlXCI7XG5cdFx0fSBlbHNlIHtcblx0XHRcdC8vRGVmYXVsdCBzaG91bGQgYmUgVGV4dEZpcnN0IGlmIHRoZXJlIGlzIGEgVGV4dCBhbm5vdGF0aW9uIGFuZCBuZWl0aGVyIFRleHRPbmx5IG5vciBUZXh0TGFzdCBhcmUgc2V0XG5cdFx0XHRzRGlzcGxheVZhbHVlID0gXCJEZXNjcmlwdGlvblZhbHVlXCI7XG5cdFx0fVxuXHR9XG5cdHJldHVybiBzRGlzcGxheVZhbHVlIGFzIERpc3BsYXlNb2RlO1xufTtcbiJdfQ==
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Separating these methods from the UIFormatters as they are used also in the converter.
3
+ * These methods must NOT used any dependency from the UI5 runtime.
4
+ * When consumed outside of converters, you should call them via UIFormatters.
5
+ */
6
+
7
+ import { Property } from "@sap-ux/annotation-converter";
8
+ import { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
9
+ import { isPathExpression } from "sap/fe/core/templating/PropertyHelper";
10
+ import { PathAnnotationExpression } from "@sap-ux/vocabularies-types/types/Edm";
11
+
12
+ export type PropertyOrPath<P> = string | P | PathAnnotationExpression<P>;
13
+
14
+ export const EDM_TYPE_MAPPING: Record<string, any> = {
15
+ "Edm.Boolean": { type: "sap.ui.model.odata.type.Boolean" },
16
+ "Edm.Byte": { type: "sap.ui.model.odata.type.Byte" },
17
+ "Edm.Date": { type: "sap.ui.model.odata.type.Date" },
18
+ "Edm.DateTimeOffset": {
19
+ constraints: {
20
+ "$Precision": "precision"
21
+ },
22
+ type: "sap.ui.model.odata.type.DateTimeOffset"
23
+ },
24
+ "Edm.Decimal": {
25
+ constraints: {
26
+ "@Org.OData.Validation.V1.Minimum/$Decimal": "minimum",
27
+ "@Org.OData.Validation.V1.Minimum@Org.OData.Validation.V1.Exclusive": "minimumExclusive",
28
+ "@Org.OData.Validation.V1.Maximum/$Decimal": "maximum",
29
+ "@Org.OData.Validation.V1.Maximum@Org.OData.Validation.V1.Exclusive": "maximumExclusive",
30
+ "$Precision": "precision",
31
+ "$Scale": "scale"
32
+ },
33
+ type: "sap.ui.model.odata.type.Decimal"
34
+ },
35
+ "Edm.Double": { type: "sap.ui.model.odata.type.Double" },
36
+ "Edm.Guid": { type: "sap.ui.model.odata.type.Guid" },
37
+ "Edm.Int16": { type: "sap.ui.model.odata.type.Int16" },
38
+ "Edm.Int32": { type: "sap.ui.model.odata.type.Int32" },
39
+ "Edm.Int64": { type: "sap.ui.model.odata.type.Int64" },
40
+ "Edm.SByte": { type: "sap.ui.model.odata.type.SByte" },
41
+ "Edm.Single": { type: "sap.ui.model.odata.type.Single" },
42
+ "Edm.Stream": { type: "sap.ui.model.odata.type.Stream" },
43
+ "Edm.Binary": { type: "sap.ui.model.odata.type.Stream" },
44
+ "Edm.String": {
45
+ constraints: {
46
+ "@com.sap.vocabularies.Common.v1.IsDigitSequence": "isDigitSequence",
47
+ "$MaxLength": "maxLength",
48
+ "$Nullable": "nullable"
49
+ },
50
+ type: "sap.ui.model.odata.type.String"
51
+ },
52
+ "Edm.TimeOfDay": {
53
+ constraints: {
54
+ "$Precision": "precision"
55
+ },
56
+ type: "sap.ui.model.odata.type.TimeOfDay"
57
+ }
58
+ };
59
+
60
+ export type DisplayMode = "Value" | "Description" | "DescriptionValue" | "ValueDescription";
61
+ export const getDisplayMode = function(oPropertyPath: PropertyOrPath<Property>, oDataModelObjectPath?: DataModelObjectPath): DisplayMode {
62
+ if (!oPropertyPath || typeof oPropertyPath === "string") {
63
+ return "Value";
64
+ }
65
+ const oProperty = (isPathExpression(oPropertyPath) && oPropertyPath.$target) || (oPropertyPath as Property);
66
+ const oEntityType = oDataModelObjectPath && oDataModelObjectPath.targetEntityType;
67
+ const oTextAnnotation = oProperty.annotations?.Common?.Text;
68
+ const oTextArrangementAnnotation =
69
+ (typeof oTextAnnotation !== "string" && oTextAnnotation?.annotations?.UI?.TextArrangement?.toString()) ||
70
+ oEntityType?.annotations?.UI?.TextArrangement?.toString();
71
+
72
+ let sDisplayValue = oTextAnnotation ? "DescriptionValue" : "Value";
73
+ if ((oTextAnnotation && oTextArrangementAnnotation) || oEntityType?.annotations?.UI?.TextArrangement?.toString()) {
74
+ if (oTextArrangementAnnotation === "UI.TextArrangementType/TextOnly") {
75
+ sDisplayValue = "Description";
76
+ } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextLast") {
77
+ sDisplayValue = "ValueDescription";
78
+ } else if (oTextArrangementAnnotation === "UI.TextArrangementType/TextSeparate") {
79
+ sDisplayValue = "Value";
80
+ } else {
81
+ //Default should be TextFirst if there is a Text annotation and neither TextOnly nor TextLast are set
82
+ sDisplayValue = "DescriptionValue";
83
+ }
84
+ }
85
+ return sDisplayValue as DisplayMode;
86
+ };