@sapui5/sap.fe.core 1.102.2 → 1.104.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (324) hide show
  1. package/package.json +6 -6
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AppComponent.js +73 -30
  4. package/src/sap/fe/core/AppComponent.ts +65 -43
  5. package/src/sap/fe/core/AppStateHandler.js +82 -70
  6. package/src/sap/fe/core/AppStateHandler.ts +32 -37
  7. package/src/sap/fe/core/BaseController.js +11 -9
  8. package/src/sap/fe/core/BaseController.ts +15 -13
  9. package/src/sap/fe/core/CommonUtils.js +227 -126
  10. package/src/sap/fe/core/CommonUtils.ts +240 -163
  11. package/src/sap/fe/core/ExtensionAPI.js +24 -27
  12. package/src/sap/fe/core/ExtensionAPI.ts +36 -38
  13. package/src/sap/fe/core/PageController.js +4 -4
  14. package/src/sap/fe/core/PageController.ts +4 -5
  15. package/src/sap/fe/core/TemplateComponent.js +1 -1
  16. package/src/sap/fe/core/TemplateComponent.ts +6 -6
  17. package/src/sap/fe/core/TemplateModel.js +1 -1
  18. package/src/sap/fe/core/TemplateModel.ts +1 -1
  19. package/src/sap/fe/core/buildingBlocks/AttributeModel.js +1 -1
  20. package/src/sap/fe/core/buildingBlocks/AttributeModel.ts +1 -1
  21. package/src/sap/fe/core/buildingBlocks/BuildingBlock.js +181 -43
  22. package/src/sap/fe/core/buildingBlocks/BuildingBlock.ts +150 -24
  23. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.js +585 -210
  24. package/src/sap/fe/core/buildingBlocks/BuildingBlockRuntime.ts +246 -96
  25. package/src/sap/fe/core/buildingBlocks/TraceInfo.js +30 -30
  26. package/src/sap/fe/core/buildingBlocks/TraceInfo.ts +32 -29
  27. package/src/sap/fe/core/controllerextensions/EditFlow.js +379 -330
  28. package/src/sap/fe/core/controllerextensions/EditFlow.ts +253 -245
  29. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +9 -9
  30. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +10 -10
  31. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +101 -74
  32. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +69 -79
  33. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +67 -67
  34. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +76 -76
  35. package/src/sap/fe/core/controllerextensions/InternalRouting.js +85 -77
  36. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +103 -99
  37. package/src/sap/fe/core/controllerextensions/KPIManagement.js +66 -68
  38. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +106 -123
  39. package/src/sap/fe/core/controllerextensions/MassEdit.js +9 -9
  40. package/src/sap/fe/core/controllerextensions/MassEdit.ts +20 -27
  41. package/src/sap/fe/core/controllerextensions/MessageHandler.js +20 -12
  42. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +21 -14
  43. package/src/sap/fe/core/controllerextensions/PageReady.js +97 -25
  44. package/src/sap/fe/core/controllerextensions/PageReady.ts +98 -34
  45. package/src/sap/fe/core/controllerextensions/Paginator.js +21 -22
  46. package/src/sap/fe/core/controllerextensions/Paginator.ts +24 -25
  47. package/src/sap/fe/core/controllerextensions/Placeholder.js +4 -6
  48. package/src/sap/fe/core/controllerextensions/Placeholder.ts +12 -14
  49. package/src/sap/fe/core/controllerextensions/Routing.js +10 -11
  50. package/src/sap/fe/core/controllerextensions/Routing.ts +12 -13
  51. package/src/sap/fe/core/controllerextensions/Share.js +170 -139
  52. package/src/sap/fe/core/controllerextensions/Share.ts +117 -118
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +46 -50
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +56 -60
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +200 -131
  56. package/src/sap/fe/core/controllerextensions/ViewState.ts +141 -148
  57. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.js +5 -5
  58. package/src/sap/fe/core/controllerextensions/collaboration/ActivityBase.ts +8 -7
  59. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.js +11 -10
  60. package/src/sap/fe/core/controllerextensions/collaboration/ActivitySync.ts +17 -20
  61. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.js +2 -2
  62. package/src/sap/fe/core/controllerextensions/collaboration/CollaborationCommon.ts +4 -4
  63. package/src/sap/fe/core/controllerextensions/collaboration/Manage.js +7 -9
  64. package/src/sap/fe/core/controllerextensions/collaboration/Manage.ts +18 -19
  65. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.js +190 -141
  66. package/src/sap/fe/core/controllerextensions/editFlow/TransactionHelper.ts +258 -210
  67. package/src/sap/fe/core/controllerextensions/editFlow/draft.js +183 -125
  68. package/src/sap/fe/core/controllerextensions/editFlow/draft.ts +213 -156
  69. package/src/sap/fe/core/controllerextensions/editFlow/operations.js +164 -140
  70. package/src/sap/fe/core/controllerextensions/editFlow/operations.ts +180 -150
  71. package/src/sap/fe/core/controllerextensions/editFlow/sticky.js +24 -26
  72. package/src/sap/fe/core/controllerextensions/editFlow/sticky.ts +35 -33
  73. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.js +71 -41
  74. package/src/sap/fe/core/controllerextensions/messageHandler/messageHandling.ts +102 -82
  75. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.js +61 -71
  76. package/src/sap/fe/core/controllerextensions/routing/RouterProxy.ts +56 -64
  77. package/src/sap/fe/core/controls/Any.js +9 -5
  78. package/src/sap/fe/core/controls/Any.ts +10 -4
  79. package/src/sap/fe/core/controls/CommandExecution.js +11 -25
  80. package/src/sap/fe/core/controls/CommandExecution.ts +11 -25
  81. package/src/sap/fe/core/controls/ConditionalWrapper.js +2 -2
  82. package/src/sap/fe/core/controls/ConditionalWrapper.ts +3 -3
  83. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.js +22 -22
  84. package/src/sap/fe/core/controls/CustomFilterFieldContentWrapper.ts +25 -24
  85. package/src/sap/fe/core/controls/CustomQuickViewPage.js +2 -2
  86. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +2 -2
  87. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +3 -3
  88. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +5 -5
  89. package/src/sap/fe/core/controls/FieldWrapper.js +2 -2
  90. package/src/sap/fe/core/controls/FieldWrapper.ts +3 -3
  91. package/src/sap/fe/core/controls/FileWrapper.js +7 -2
  92. package/src/sap/fe/core/controls/FileWrapper.ts +15 -11
  93. package/src/sap/fe/core/controls/FilterBar.js +6 -2
  94. package/src/sap/fe/core/controls/FilterBar.ts +13 -9
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +1 -1
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +2 -2
  97. package/src/sap/fe/core/controls/MassEditSelect.js +1 -1
  98. package/src/sap/fe/core/controls/MassEditSelect.ts +0 -4
  99. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +3 -3
  100. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +16 -12
  101. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +20 -22
  102. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -3
  103. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +8 -8
  104. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +49 -49
  105. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +54 -54
  106. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +8 -2
  107. package/src/sap/fe/core/controls/massEdit/MassEditField.fragment.xml +22 -35
  108. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +89 -88
  109. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +107 -106
  110. package/src/sap/fe/core/converters/ConverterContext.js +26 -33
  111. package/src/sap/fe/core/converters/ConverterContext.ts +52 -61
  112. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  113. package/src/sap/fe/core/converters/ManifestSettings.ts +17 -15
  114. package/src/sap/fe/core/converters/ManifestWrapper.js +59 -45
  115. package/src/sap/fe/core/converters/ManifestWrapper.ts +55 -45
  116. package/src/sap/fe/core/converters/MetaModelConverter.js +64 -35
  117. package/src/sap/fe/core/converters/MetaModelConverter.ts +154 -129
  118. package/src/sap/fe/core/converters/TemplateConverter.js +21 -20
  119. package/src/sap/fe/core/converters/TemplateConverter.ts +27 -24
  120. package/src/sap/fe/core/converters/annotations/DataField.js +58 -35
  121. package/src/sap/fe/core/converters/annotations/DataField.ts +102 -76
  122. package/src/sap/fe/core/converters/common/AnnotationConverter.js +1911 -1495
  123. package/src/sap/fe/core/converters/controls/Common/Action.js +50 -41
  124. package/src/sap/fe/core/converters/controls/Common/Action.ts +56 -46
  125. package/src/sap/fe/core/converters/controls/Common/Chart.js +14 -14
  126. package/src/sap/fe/core/converters/controls/Common/Chart.ts +26 -33
  127. package/src/sap/fe/core/converters/controls/Common/Criticality.js +3 -3
  128. package/src/sap/fe/core/converters/controls/Common/Criticality.ts +4 -4
  129. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +30 -28
  130. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +60 -61
  131. package/src/sap/fe/core/converters/controls/Common/Form.js +27 -28
  132. package/src/sap/fe/core/converters/controls/Common/Form.ts +44 -57
  133. package/src/sap/fe/core/converters/controls/Common/KPI.js +11 -11
  134. package/src/sap/fe/core/converters/controls/Common/KPI.ts +49 -52
  135. package/src/sap/fe/core/converters/controls/Common/Table.js +181 -197
  136. package/src/sap/fe/core/converters/controls/Common/Table.ts +251 -280
  137. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +119 -119
  138. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +144 -141
  139. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +45 -41
  140. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +65 -59
  141. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +28 -26
  142. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +46 -43
  143. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +9 -9
  144. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +14 -13
  145. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +67 -64
  146. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.ts +69 -66
  147. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +77 -73
  148. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +101 -97
  149. package/src/sap/fe/core/converters/helpers/Aggregation.js +2 -4
  150. package/src/sap/fe/core/converters/helpers/Aggregation.ts +12 -15
  151. package/src/sap/fe/core/converters/helpers/BindingHelper.js +31 -31
  152. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +30 -29
  153. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +4 -4
  154. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +9 -9
  155. package/src/sap/fe/core/converters/helpers/ID.js +48 -46
  156. package/src/sap/fe/core/converters/helpers/ID.ts +26 -25
  157. package/src/sap/fe/core/converters/helpers/Key.js +7 -7
  158. package/src/sap/fe/core/converters/helpers/Key.ts +7 -7
  159. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +1 -1
  160. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +4 -5
  161. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +6 -6
  162. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +10 -10
  163. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +46 -62
  164. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +54 -82
  165. package/src/sap/fe/core/converters/templates/ListReportConverter.js +55 -42
  166. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +81 -66
  167. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +39 -38
  168. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +52 -61
  169. package/src/sap/fe/core/designtime/AppComponent.designtime.js +4 -4
  170. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +4 -4
  171. package/src/sap/fe/core/formatters/CollaborationFormatter.js +2 -2
  172. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +3 -3
  173. package/src/sap/fe/core/formatters/FPMFormatter.js +5 -5
  174. package/src/sap/fe/core/formatters/FPMFormatter.ts +10 -10
  175. package/src/sap/fe/core/formatters/KPIFormatter.js +7 -7
  176. package/src/sap/fe/core/formatters/KPIFormatter.ts +10 -10
  177. package/src/sap/fe/core/formatters/StandardFormatter.js +96 -0
  178. package/src/sap/fe/core/formatters/StandardFormatter.ts +70 -0
  179. package/src/sap/fe/core/formatters/TableFormatter.js +11 -11
  180. package/src/sap/fe/core/formatters/TableFormatter.ts +12 -12
  181. package/src/sap/fe/core/formatters/ValueFormatter.js +8 -8
  182. package/src/sap/fe/core/formatters/ValueFormatter.ts +9 -9
  183. package/src/sap/fe/core/helpers/AppStartupHelper.js +15 -15
  184. package/src/sap/fe/core/helpers/AppStartupHelper.ts +37 -40
  185. package/src/sap/fe/core/helpers/BindingToolkit.js +1832 -0
  186. package/src/sap/fe/core/helpers/{BindingExpression.ts → BindingToolkit.ts} +396 -269
  187. package/src/sap/fe/core/helpers/ClassSupport.js +49 -12
  188. package/src/sap/fe/core/helpers/ClassSupport.ts +37 -10
  189. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +2 -2
  190. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +1 -1
  191. package/src/sap/fe/core/helpers/EditState.js +1 -6
  192. package/src/sap/fe/core/helpers/EditState.ts +5 -10
  193. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +2 -2
  194. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +4 -4
  195. package/src/sap/fe/core/helpers/FPMHelper.js +1 -1
  196. package/src/sap/fe/core/helpers/FPMHelper.ts +2 -2
  197. package/src/sap/fe/core/helpers/KeepAliveHelper.js +31 -31
  198. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +52 -56
  199. package/src/sap/fe/core/helpers/MassEditHelper.js +306 -280
  200. package/src/sap/fe/core/helpers/MassEditHelper.ts +380 -360
  201. package/src/sap/fe/core/helpers/MessageStrip.js +81 -0
  202. package/src/sap/fe/core/helpers/MessageStrip.ts +79 -0
  203. package/src/sap/fe/core/helpers/ModelHelper.js +25 -25
  204. package/src/sap/fe/core/helpers/ModelHelper.ts +34 -32
  205. package/src/sap/fe/core/helpers/PasteHelper.js +3 -10
  206. package/src/sap/fe/core/helpers/PasteHelper.ts +20 -25
  207. package/src/sap/fe/core/helpers/SemanticDateOperators.js +1 -1
  208. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +11 -11
  209. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +3 -3
  210. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +8 -8
  211. package/src/sap/fe/core/helpers/StableIdHelper.js +12 -12
  212. package/src/sap/fe/core/helpers/StableIdHelper.ts +12 -12
  213. package/src/sap/fe/core/helpers/ToES6Promise.js +32 -0
  214. package/src/sap/fe/core/helpers/ToES6Promise.ts +19 -0
  215. package/src/sap/fe/core/jsx-runtime/Fragment.js +16 -0
  216. package/src/sap/fe/core/jsx-runtime/Fragment.ts +3 -0
  217. package/src/sap/fe/core/jsx-runtime/jsx-control.js +99 -0
  218. package/src/sap/fe/core/jsx-runtime/jsx-control.ts +82 -0
  219. package/src/sap/fe/core/jsx-runtime/jsx-xml.js +105 -0
  220. package/src/sap/fe/core/jsx-runtime/jsx-xml.ts +89 -0
  221. package/src/sap/fe/core/jsx-runtime/jsx.js +12 -90
  222. package/src/sap/fe/core/jsx-runtime/jsx.ts +24 -85
  223. package/src/sap/fe/core/library.js +42 -3
  224. package/src/sap/fe/core/library.ts +38 -0
  225. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +3 -3
  226. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +2 -2
  227. package/src/sap/fe/core/messagebundle.properties +39 -63
  228. package/src/sap/fe/core/messagebundle_ar.properties +25 -39
  229. package/src/sap/fe/core/messagebundle_bg.properties +25 -39
  230. package/src/sap/fe/core/messagebundle_ca.properties +25 -39
  231. package/src/sap/fe/core/messagebundle_cs.properties +25 -39
  232. package/src/sap/fe/core/messagebundle_cy.properties +25 -39
  233. package/src/sap/fe/core/messagebundle_da.properties +25 -39
  234. package/src/sap/fe/core/messagebundle_de.properties +25 -39
  235. package/src/sap/fe/core/messagebundle_el.properties +26 -40
  236. package/src/sap/fe/core/messagebundle_en.properties +25 -39
  237. package/src/sap/fe/core/messagebundle_en_GB.properties +25 -39
  238. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +25 -39
  239. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +25 -39
  240. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +26 -18
  241. package/src/sap/fe/core/messagebundle_es.properties +27 -41
  242. package/src/sap/fe/core/messagebundle_es_MX.properties +25 -39
  243. package/src/sap/fe/core/messagebundle_et.properties +25 -39
  244. package/src/sap/fe/core/messagebundle_fi.properties +25 -39
  245. package/src/sap/fe/core/messagebundle_fr.properties +26 -40
  246. package/src/sap/fe/core/messagebundle_fr_CA.properties +25 -39
  247. package/src/sap/fe/core/messagebundle_hi.properties +25 -39
  248. package/src/sap/fe/core/messagebundle_hr.properties +25 -39
  249. package/src/sap/fe/core/messagebundle_hu.properties +25 -39
  250. package/src/sap/fe/core/messagebundle_id.properties +25 -39
  251. package/src/sap/fe/core/messagebundle_it.properties +41 -55
  252. package/src/sap/fe/core/messagebundle_iw.properties +25 -39
  253. package/src/sap/fe/core/messagebundle_ja.properties +25 -39
  254. package/src/sap/fe/core/messagebundle_kk.properties +25 -39
  255. package/src/sap/fe/core/messagebundle_ko.properties +30 -44
  256. package/src/sap/fe/core/messagebundle_lt.properties +25 -39
  257. package/src/sap/fe/core/messagebundle_lv.properties +25 -39
  258. package/src/sap/fe/core/messagebundle_ms.properties +25 -39
  259. package/src/sap/fe/core/messagebundle_nl.properties +27 -41
  260. package/src/sap/fe/core/messagebundle_no.properties +25 -39
  261. package/src/sap/fe/core/messagebundle_pl.properties +26 -40
  262. package/src/sap/fe/core/messagebundle_pt.properties +26 -40
  263. package/src/sap/fe/core/messagebundle_pt_PT.properties +25 -39
  264. package/src/sap/fe/core/messagebundle_ro.properties +25 -39
  265. package/src/sap/fe/core/messagebundle_ru.properties +25 -39
  266. package/src/sap/fe/core/messagebundle_sh.properties +25 -39
  267. package/src/sap/fe/core/messagebundle_sk.properties +25 -39
  268. package/src/sap/fe/core/messagebundle_sl.properties +25 -39
  269. package/src/sap/fe/core/messagebundle_sv.properties +25 -39
  270. package/src/sap/fe/core/messagebundle_th.properties +25 -39
  271. package/src/sap/fe/core/messagebundle_tr.properties +25 -39
  272. package/src/sap/fe/core/messagebundle_uk.properties +25 -39
  273. package/src/sap/fe/core/messagebundle_vi.properties +25 -39
  274. package/src/sap/fe/core/messagebundle_zh_CN.properties +25 -39
  275. package/src/sap/fe/core/messagebundle_zh_TW.properties +25 -39
  276. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  277. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +5 -5
  278. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +97 -69
  279. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +68 -69
  280. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +1 -1
  281. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +3 -2
  282. package/src/sap/fe/core/services/NavigationServiceFactory.js +61 -49
  283. package/src/sap/fe/core/services/NavigationServiceFactory.ts +63 -52
  284. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +2 -2
  285. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +4 -4
  286. package/src/sap/fe/core/services/RoutingServiceFactory.js +55 -55
  287. package/src/sap/fe/core/services/RoutingServiceFactory.ts +67 -65
  288. package/src/sap/fe/core/services/ShellServicesFactory.js +92 -76
  289. package/src/sap/fe/core/services/ShellServicesFactory.ts +95 -82
  290. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +61 -61
  291. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +102 -92
  292. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +224 -198
  293. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +138 -139
  294. package/src/sap/fe/core/support/CommonHelper.js +3 -2
  295. package/src/sap/fe/core/support/CommonHelper.ts +9 -13
  296. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  297. package/src/sap/fe/core/support/Diagnostics.ts +5 -5
  298. package/src/sap/fe/core/templating/CommonFormatters.js +84 -0
  299. package/src/sap/fe/core/templating/CommonFormatters.ts +86 -0
  300. package/src/sap/fe/core/templating/CriticalityFormatters.js +31 -31
  301. package/src/sap/fe/core/templating/CriticalityFormatters.ts +42 -40
  302. package/src/sap/fe/core/templating/DataFieldFormatters.js +8 -8
  303. package/src/sap/fe/core/templating/DataFieldFormatters.ts +13 -10
  304. package/src/sap/fe/core/templating/DataModelPathHelper.js +16 -15
  305. package/src/sap/fe/core/templating/DataModelPathHelper.ts +42 -32
  306. package/src/sap/fe/core/templating/DisplayModeFormatter.js +1 -1
  307. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +2 -3
  308. package/src/sap/fe/core/templating/EntitySetHelper.js +7 -7
  309. package/src/sap/fe/core/templating/EntitySetHelper.ts +6 -8
  310. package/src/sap/fe/core/templating/FieldControlHelper.js +35 -34
  311. package/src/sap/fe/core/templating/FieldControlHelper.ts +29 -46
  312. package/src/sap/fe/core/templating/FilterHelper.js +16 -15
  313. package/src/sap/fe/core/templating/FilterHelper.ts +18 -18
  314. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  315. package/src/sap/fe/core/templating/FilterTemplating.ts +3 -3
  316. package/src/sap/fe/core/templating/PropertyFormatters.js +7 -7
  317. package/src/sap/fe/core/templating/PropertyFormatters.ts +21 -19
  318. package/src/sap/fe/core/templating/PropertyHelper.js +25 -25
  319. package/src/sap/fe/core/templating/PropertyHelper.ts +25 -26
  320. package/src/sap/fe/core/templating/UIFormatters.js +152 -95
  321. package/src/sap/fe/core/templating/UIFormatters.ts +202 -128
  322. package/src/sap/fe/core/type/Email.js +2 -2
  323. package/src/sap/fe/core/type/Email.ts +2 -2
  324. package/src/sap/fe/core/helpers/BindingExpression.js +0 -1732
@@ -1,9 +1,19 @@
1
1
  import Log from "sap/base/Log";
2
2
  import CommonUtils from "sap/fe/core/CommonUtils";
3
- import { BindingExpression, ExpressionOrPrimitive } from "sap/fe/core/helpers/BindingExpression";
3
+ import {
4
+ BindingToolkitExpression,
5
+ CompiledBindingToolkitExpression,
6
+ compileExpression,
7
+ constant,
8
+ ifElse,
9
+ not,
10
+ or,
11
+ pathInModel
12
+ } from "sap/fe/core/helpers/BindingToolkit";
4
13
  import FELibrary from "sap/fe/core/library";
5
14
  import type PageController from "sap/fe/core/PageController";
6
- import { DataModelObjectPath, enhanceDataModelPath } from "sap/fe/core/templating/DataModelPathHelper";
15
+ import type { DataModelObjectPath } from "sap/fe/core/templating/DataModelPathHelper";
16
+ import { enhanceDataModelPath } from "sap/fe/core/templating/DataModelPathHelper";
7
17
  import {
8
18
  getAssociatedUnitProperty,
9
19
  getAssociatedUnitPropertyPath,
@@ -13,7 +23,7 @@ import {
13
23
  hasValueHelpWithFixedValues
14
24
  } from "sap/fe/core/templating/PropertyHelper";
15
25
  import { getTextBinding, setEditStyleProperties } from "sap/fe/macros/field/FieldTemplating";
16
- import { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
26
+ import type { FieldProperties } from "sap/fe/macros/internal/Field.metadata";
17
27
  import Button from "sap/m/Button";
18
28
  import Dialog from "sap/m/Dialog";
19
29
  import MessageToast from "sap/m/MessageToast";
@@ -22,16 +32,17 @@ import Fragment from "sap/ui/core/Fragment";
22
32
  import XMLPreprocessor from "sap/ui/core/util/XMLPreprocessor";
23
33
  import XMLTemplateProcessor from "sap/ui/core/XMLTemplateProcessor";
24
34
  import EditMode from "sap/ui/mdc/enum/EditMode";
25
- import Table from "sap/ui/mdc/Table";
35
+ import type Table from "sap/ui/mdc/Table";
26
36
  import JSONModel from "sap/ui/model/json/JSONModel";
27
- import Context from "sap/ui/model/odata/v4/Context";
28
- import ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
29
- import { CoreEx } from "types/extension_types";
30
- import Any, { AnyType } from "../controls/Any";
37
+ import type Context from "sap/ui/model/odata/v4/Context";
38
+ import type ODataListBinding from "sap/ui/model/odata/v4/ODataListBinding";
39
+ import type { CoreEx } from "types/extension_types";
40
+ import type { AnyType } from "../controls/Any";
41
+ import Any from "../controls/Any";
31
42
  import { convertMetaModelContext, getInvolvedDataModelObjects } from "../converters/MetaModelConverter";
32
43
  import { isReadOnlyExpression } from "../templating/FieldControlHelper";
33
44
  import { getEditMode, getRequiredExpression, isCollectionField } from "../templating/UIFormatters";
34
- import { InternalModelContext } from "./ModelHelper";
45
+ import type { InternalModelContext } from "./ModelHelper";
35
46
 
36
47
  /* This class contains helpers to be used for mass edit functionality */
37
48
  type TextArrangementInfo = {
@@ -54,9 +65,9 @@ const MassEditHelper = {
54
65
  * Initializes the value at final or deepest level path with a blank array.
55
66
  * Return an empty array pointing to the final or deepest level path.
56
67
  *
57
- * @param {string} sPath Property path
58
- * @param {Array} aValues Array instance where the default data needs to be added
59
- * @returns {Array}
68
+ * @param sPath Property path
69
+ * @param aValues Array instance where the default data needs to be added
70
+ * @returns The final path
60
71
  */
61
72
  initLastLevelOfPropertyPath: function (sPath: string, aValues: any /*, transCtx: Context */) {
62
73
  let aFinalPath: any;
@@ -70,7 +81,7 @@ const MassEditHelper = {
70
81
  sFullPath = sFullPath + sPropertyPath;
71
82
  index++;
72
83
  } else if (!aFinalPath[sPropertyPath]) {
73
- sFullPath = sFullPath + "/" + sPropertyPath;
84
+ sFullPath = `${sFullPath}/${sPropertyPath}`;
74
85
  if (sFullPath !== sPath) {
75
86
  aFinalPath[sPropertyPath] = {};
76
87
  aFinalPath = aFinalPath[sPropertyPath];
@@ -85,10 +96,10 @@ const MassEditHelper = {
85
96
  /**
86
97
  * Method to get unique values for given array values.
87
98
  *
88
- * @param {string} sValue Property value
89
- * @param {number} index Index of the property value
90
- * @param {Array} self Instance of the array
91
- * @returns {boolean}
99
+ * @param sValue Property value
100
+ * @param index Index of the property value
101
+ * @param self Instance of the array
102
+ * @returns The unique value
92
103
  */
93
104
  getUniqueValues: function (sValue: string, index: number, self: any[]) {
94
105
  if (sValue != undefined && sValue != null) {
@@ -100,9 +111,9 @@ const MassEditHelper = {
100
111
  * Gets the property value for a multi-level path (for example: _Materials/Material_Details gets the value of Material_Details under _Materials Object).
101
112
  * Returns the propertyValue, which can be of any type (string, number, etc..).
102
113
  *
103
- * @param {string} sDataPropertyPath Property path
104
- * @param {object} oValues Object of property values
105
- * @returns {*}
114
+ * @param sDataPropertyPath Property path
115
+ * @param oValues Object of property values
116
+ * @returns The property value
106
117
  */
107
118
  getValueForMultiLevelPath: function (sDataPropertyPath: string, oValues: any) {
108
119
  if (sDataPropertyPath && sDataPropertyPath.indexOf("/") > 0) {
@@ -122,9 +133,9 @@ const MassEditHelper = {
122
133
  * => If propertyValue for all selected contexts is empty, then < Leave Blank > is preselected.
123
134
  *
124
135
  *
125
- * @param {Array} aContexts Contexts for mass edit
126
- * @param {string} sDataPropertyPath Data property path
127
- * @returns {string}
136
+ * @param aContexts Contexts for mass edit
137
+ * @param sDataPropertyPath Data property path
138
+ * @returns The key path
128
139
  */
129
140
  getDefaultSelectionPathComboBox: function (aContexts: any[], sDataPropertyPath: string) {
130
141
  if (sDataPropertyPath && aContexts.length > 0) {
@@ -140,11 +151,11 @@ const MassEditHelper = {
140
151
  });
141
152
  const aUniquePropertyValues = aPropertyValues.filter(MassEditHelper.getUniqueValues);
142
153
  if (aUniquePropertyValues.length > 1) {
143
- return "Default/" + sDataPropertyPath;
154
+ return `Default/${sDataPropertyPath}`;
144
155
  } else if (aUniquePropertyValues.length === 0) {
145
- return "Empty/" + sDataPropertyPath;
156
+ return `Empty/${sDataPropertyPath}`;
146
157
  } else if (aUniquePropertyValues.length === 1) {
147
- return sDataPropertyPath + "/" + aUniquePropertyValues[0];
158
+ return `${sDataPropertyPath}/${aUniquePropertyValues[0]}`;
148
159
  }
149
160
  }
150
161
  },
@@ -152,9 +163,9 @@ const MassEditHelper = {
152
163
  /**
153
164
  * Checks hidden annotation value [both static and path based] for table's selected context.
154
165
  *
155
- * @param {*} hiddenValue Hidden annotation value / path for field
156
- * @param {Array} aContexts Contexts for mass edit
157
- * @returns {boolean}
166
+ * @param hiddenValue Hidden annotation value / path for field
167
+ * @param aContexts Contexts for mass edit
168
+ * @returns The hidden annotation value
158
169
  */
159
170
  getHiddenValueForContexts: function (hiddenValue: any, aContexts: any[]) {
160
171
  if (hiddenValue && hiddenValue.$Path) {
@@ -194,10 +205,10 @@ const MassEditHelper = {
194
205
  /**
195
206
  * Get text path for the mass edit field.
196
207
  *
197
- * @param {string} property Property path
198
- * @param {any} textBinding Text Binding Info
199
- * @param {string} displayMode Display mode
200
- * @returns {string | undefined} Text Property Path if it exists
208
+ * @param property Property path
209
+ * @param textBinding Text Binding Info
210
+ * @param displayMode Display mode
211
+ * @returns Text Property Path if it exists
201
212
  */
202
213
  getTextPath: function (property: string, textBinding: any, displayMode: string): string | undefined {
203
214
  let descriptionPath;
@@ -218,16 +229,16 @@ const MassEditHelper = {
218
229
  /**
219
230
  * Initializes a JSON Model for properties of dialog fields [label, visiblity, dataproperty, etc.].
220
231
  *
221
- * @param {object} oTable Instance of Table
222
- * @param {Array} aContexts Contexts for mass edit
223
- * @param {Array} aDataArray Array containing data related to the dialog used by both the static and the runtime model
224
- * @returns {object}
232
+ * @param oTable Instance of Table
233
+ * @param aContexts Contexts for mass edit
234
+ * @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
235
+ * @returns The model
225
236
  */
226
237
  prepareDataForDialog: function (oTable: Table, aContexts: any[], aDataArray: any[]) {
227
238
  const oMetaModel = oTable && (oTable.getModel().getMetaModel() as any),
228
239
  sCurrentEntitySetName = oTable.data("metaPath"),
229
240
  aTableFields = MassEditHelper.getTableFields(oTable),
230
- oEntityTypeContext = oMetaModel.getContext(sCurrentEntitySetName + "/@"),
241
+ oEntityTypeContext = oMetaModel.getContext(`${sCurrentEntitySetName}/@`),
231
242
  oEntitySetContext = oMetaModel.getContext(sCurrentEntitySetName),
232
243
  oDataModelObjectPath = getInvolvedDataModelObjects(oEntityTypeContext);
233
244
 
@@ -247,6 +258,7 @@ const MassEditHelper = {
247
258
  oColumnInfo.label ||
248
259
  (oPropertyInfo && oPropertyInfo["@com.sap.vocabularies.Common.v1.Label"]) ||
249
260
  oColumnInfo.dataProperty;
261
+
250
262
  if (oDataModelObjectPath) {
251
263
  oDataModelObjectPath.targetObject = oDataModelObjectPath.targetEntityType.entityProperties.filter(function (
252
264
  oProperty: any
@@ -258,7 +270,7 @@ const MassEditHelper = {
258
270
  oTextBinding = getTextBinding(oDataModelObjectPath, {}, true) || {};
259
271
  const oFieldContext = oMetaModel.getContext(oColumnInfo.annotationPath),
260
272
  oDataFieldConverted = convertMetaModelContext(oFieldContext),
261
- oPropertyContext = oMetaModel.getContext(sCurrentEntitySetName + "/" + sDataPropertyPath + "@"),
273
+ oPropertyContext = oMetaModel.getContext(`${sCurrentEntitySetName}/${sDataPropertyPath}@`),
262
274
  oInterface = oPropertyContext && oPropertyContext.getInterface();
263
275
 
264
276
  let oDataModelPath = getInvolvedDataModelObjects(oFieldContext, oEntitySetContext);
@@ -277,7 +289,7 @@ const MassEditHelper = {
277
289
  return oInterface.getModel();
278
290
  },
279
291
  getPath: function () {
280
- return sCurrentEntitySetName + "/" + sDataPropertyPath;
292
+ return `${sCurrentEntitySetName}/${sDataPropertyPath}`;
281
293
  }
282
294
  };
283
295
  oPropertyInfo =
@@ -297,18 +309,19 @@ const MassEditHelper = {
297
309
 
298
310
  // ValueHelp properties
299
311
  bValueHelpEnabled = hasValueHelp(oPropertyInfo);
300
- sUnitPropertyPath = (hasCurrency(oPropertyInfo) || hasUnit(oPropertyInfo)) && getAssociatedUnitPropertyPath(oPropertyInfo);
312
+ sUnitPropertyPath =
313
+ ((hasCurrency(oPropertyInfo) || hasUnit(oPropertyInfo)) && getAssociatedUnitPropertyPath(oPropertyInfo)) || "";
301
314
  const unitPropertyInfo = sUnitPropertyPath && getAssociatedUnitProperty(oPropertyInfo);
302
315
  bValueHelpEnabledForUnit = unitPropertyInfo && hasValueHelp(unitPropertyInfo);
303
316
 
304
317
  // EditMode and InputType
305
318
  const propertyForFieldControl = oPropertyInfo && oPropertyInfo.Value ? oPropertyInfo.Value : oPropertyInfo;
306
- const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, true);
319
+ const expBinding = getEditMode(propertyForFieldControl, oDataModelPath, false, false, oDataFieldConverted, constant(true));
307
320
  const editModeValues = Object.keys(EditMode);
308
321
  const editModeIsStatic = !!expBinding && editModeValues.includes(expBinding as EditMode);
309
322
  const editable = !!expBinding && ((editModeIsStatic && expBinding === EditMode.Editable) || !editModeIsStatic);
310
-
311
- if (!editable) {
323
+ const navPropertyWithValueHelp = sDataPropertyPath.includes("/") && bValueHelpEnabled;
324
+ if (!editable || navPropertyWithValueHelp) {
312
325
  return;
313
326
  }
314
327
 
@@ -321,8 +334,9 @@ const MassEditHelper = {
321
334
  "label": sLabelText,
322
335
  "dataProperty": sDataPropertyPath,
323
336
  "isValueHelpEnabled": bValueHelpEnabled ? bValueHelpEnabled : false,
324
- "unitProperty": sUnitPropertyPath ? sUnitPropertyPath : false,
325
- "isValueHelpEnabledForUnit": bValueHelpEnabledForUnit ? bValueHelpEnabledForUnit : false,
337
+ "unitProperty": sUnitPropertyPath && !sDataPropertyPath.includes("/") ? sUnitPropertyPath : false,
338
+ "isValueHelpEnabledForUnit":
339
+ bValueHelpEnabledForUnit && !sUnitPropertyPath.includes("/") ? bValueHelpEnabledForUnit : false,
326
340
  "propertyPathForValueHelp": `${sCurrentEntitySetName}/${sDataPropertyPath}`,
327
341
  "propertyPathForValueHelpUnit": sUnitPropertyPath && `${sCurrentEntitySetName}/${sUnitPropertyPath}`,
328
342
  "isFieldRequired": getRequiredExpression(oPropertyInfo, oDataFieldConverted, true),
@@ -381,15 +395,17 @@ const MassEditHelper = {
381
395
  ? oResourceBundle.getText("C_MASS_EDIT_SAVE_BUTTON_TEXT")
382
396
  : oResourceBundle.getText("C_MASS_EDIT_APPLY_BUTTON_TEXT"),
383
397
  "useValueHelpValue": "< Use Value Help >",
384
- "cancelButtonText": oResourceBundle.getText("C_MASS_EDIT_CANCEL_BUTTON_TEXT")
398
+ "cancelButtonText": oResourceBundle.getText("C_COMMON_OBJECT_PAGE_CANCEL"),
399
+ "noFields": oResourceBundle.getText("C_MASS_EDIT_NO_EDITABLE_FIELDS"),
400
+ "okButtonText": oResourceBundle.getText("C_COMMON_DIALOG_OK")
385
401
  };
386
402
  },
387
403
 
388
404
  /**
389
405
  * Adds a suffix to the 'keep existing' property of the comboBox.
390
406
  *
391
- * @param {string} sInputType InputType of the field
392
- * @returns {string}
407
+ * @param sInputType InputType of the field
408
+ * @returns The modified string
393
409
  */
394
410
  // getSuffixForKeepExisiting: function (sInputType: string) {
395
411
  // let sResult = "Values";
@@ -411,24 +427,23 @@ const MassEditHelper = {
411
427
  /**
412
428
  * Adds default values to the model [Keep Existing Values, Leave Blank].
413
429
  *
414
- * @param {Array} aValues Array instance where the default data needs to be added
415
- * @param {Array} aContexts Contexts for mass edit
416
- * @param {object} oDefaultValues Default values from Application Manifest
417
- * @param {object} oPropertyInfo Property information
418
- * @param {boolean} bUOMField
430
+ * @param aValues Array instance where the default data needs to be added
431
+ * @param oDefaultValues Default values from Application Manifest
432
+ * @param oPropertyInfo Property information
433
+ * @param bUOMField
419
434
  */
420
- setDefaultValuesToDialog: function (aValues: any, aContexts: any[], oDefaultValues: any, oPropertyInfo: any, bUOMField?: boolean) {
435
+ setDefaultValuesToDialog: function (aValues: any, oDefaultValues: any, oPropertyInfo: any, bUOMField?: boolean) {
421
436
  const sPropertyPath = bUOMField ? oPropertyInfo.unitProperty : oPropertyInfo.dataProperty,
422
437
  sInputType = oPropertyInfo.inputType,
423
438
  bPropertyRequired = oPropertyInfo.isFieldRequired;
424
439
  // const sSuffixForKeepExisting = MassEditHelper.getSuffixForKeepExisiting(sInputType);
425
440
  const sSuffixForKeepExisting = "Values";
426
441
  aValues.defaultOptions = aValues.defaultOptions || [];
427
- //TODO - Add <<Use Value Help or control implmentation>> and related key by checking if value help is enabled for property or Unit.
428
- //TODO - Add option Apply to Empty Fields only for Both Value Help and controls.
429
- const bValueExistsForPropertyPath = aContexts.some(function (oSelectedContext: any) {
430
- return oSelectedContext.getObject(sPropertyPath);
431
- });
442
+ const selectOptionsExist = aValues.selectOptions && aValues.selectOptions.length > 0;
443
+ const keepEntry = {
444
+ text: `${oDefaultValues.keepExistingPrefix} ${sSuffixForKeepExisting} >`,
445
+ key: `Default/${sPropertyPath}`
446
+ };
432
447
 
433
448
  if (sInputType === "CheckBox") {
434
449
  const falseEntry = { text: "No", key: `${sPropertyPath}/false`, textInfo: { value: false } };
@@ -437,43 +452,38 @@ const MassEditHelper = {
437
452
  aValues.defaultOptions.unshift(falseEntry);
438
453
  aValues.unshift(truthyEntry);
439
454
  aValues.defaultOptions.unshift(truthyEntry);
440
- }
441
-
442
- if (oPropertyInfo.isValueHelpEnabled || (oPropertyInfo.isValueHelpEnabledForUnit && bUOMField)) {
443
- const vhdEntry = { text: oDefaultValues.useValueHelpValue, key: "UseValueHelpValue/" + sPropertyPath };
444
- aValues.unshift(vhdEntry);
445
- aValues.defaultOptions.unshift(vhdEntry);
446
- }
447
-
448
- if (sInputType != "CheckBox") {
449
- if (bValueExistsForPropertyPath) {
455
+ aValues.unshift(keepEntry);
456
+ aValues.defaultOptions.unshift(keepEntry);
457
+ } else {
458
+ if (oPropertyInfo.isValueHelpEnabled || (oPropertyInfo.isValueHelpEnabledForUnit && bUOMField)) {
459
+ const vhdEntry = { text: oDefaultValues.useValueHelpValue, key: `UseValueHelpValue/${sPropertyPath}` };
460
+ aValues.unshift(vhdEntry);
461
+ aValues.defaultOptions.unshift(vhdEntry);
462
+ }
463
+ if (selectOptionsExist) {
450
464
  if (bPropertyRequired !== "true" && !bUOMField) {
451
465
  const clearEntry = { text: oDefaultValues.clearFieldValue, key: `ClearFieldValue/${sPropertyPath}` };
452
466
  aValues.unshift(clearEntry);
453
467
  aValues.defaultOptions.unshift(clearEntry);
454
468
  }
469
+ aValues.unshift(keepEntry);
470
+ aValues.defaultOptions.unshift(keepEntry);
455
471
  } else {
456
- const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `Empty/${sPropertyPath}` };
472
+ const emptyEntry = { text: oDefaultValues.leaveBlankValue, key: `Default/${sPropertyPath}` };
457
473
  aValues.unshift(emptyEntry);
458
474
  aValues.defaultOptions.unshift(emptyEntry);
459
475
  }
460
476
  }
461
- const keepEntry = {
462
- text: oDefaultValues.keepExistingPrefix + " " + sSuffixForKeepExisting + " >",
463
- key: "Default/" + sPropertyPath
464
- };
465
- aValues.unshift(keepEntry);
466
- aValues.defaultOptions.unshift(keepEntry);
467
477
  },
468
478
 
469
479
  /**
470
480
  * Get text arrangement info for a context property.
471
481
  *
472
- * @param {string} property Property Path
473
- * @param {string} descriptionPath Path to text association of the property
474
- * @param {string} displayMode Display mode of the property and text association
475
- * @param {Context} selectedContext Context to find the full text
476
- * @returns {TextArrangementInfo}
482
+ * @param property Property Path
483
+ * @param descriptionPath Path to text association of the property
484
+ * @param displayMode Display mode of the property and text association
485
+ * @param selectedContext Context to find the full text
486
+ * @returns The text arrangement
477
487
  */
478
488
  getTextArrangementInfo: function (
479
489
  property: string,
@@ -497,15 +507,15 @@ const MassEditHelper = {
497
507
  case "ValueDescription":
498
508
  value = selectedContext.getObject(property) || "";
499
509
  descriptionValue = selectedContext.getObject(descriptionPath) || "";
500
- fullText = value + (descriptionValue && " (" + descriptionValue + ")");
510
+ fullText = descriptionValue ? `${value} (${descriptionValue})` : value;
501
511
  break;
502
512
  case "DescriptionValue":
503
513
  value = selectedContext.getObject(property) || "";
504
514
  descriptionValue = selectedContext.getObject(descriptionPath) || "";
505
- fullText = descriptionValue ? descriptionValue + " (" + value + ")" : value;
515
+ fullText = descriptionValue ? `${descriptionValue} (${value})` : value;
506
516
  break;
507
517
  default:
508
- Log.info("Display Property not applicable: " + property);
518
+ Log.info(`Display Property not applicable: ${property}`);
509
519
  break;
510
520
  }
511
521
  }
@@ -523,8 +533,8 @@ const MassEditHelper = {
523
533
  /**
524
534
  * Return the visibility valuue for the ManagedObject Any.
525
535
  *
526
- * @param {AnyType} any The ManagedObject Any to be used to calculate the visible value of the binding.
527
- * @returns {boolean} Returns true if the mass edit field is editable.
536
+ * @param any The ManagedObject Any to be used to calculate the visible value of the binding.
537
+ * @returns Returns true if the mass edit field is editable.
528
538
  */
529
539
  isEditable: function (any: AnyType): boolean {
530
540
  const binding = any.getBinding("any");
@@ -535,25 +545,25 @@ const MassEditHelper = {
535
545
  /**
536
546
  * Calculate and update the visibility of mass edit field on change of the ManagedObject Any binding.
537
547
  *
538
- * @param {JSONModel} oDialogDataModel Model to be used runtime.
539
- * @param {string} dataProperty Field name.
548
+ * @param oDialogDataModel Model to be used runtime.
549
+ * @param dataProperty Field name.
540
550
  */
541
551
  onContextEditableChange: function (oDialogDataModel: JSONModel, dataProperty: string): void {
542
- const objectsForVisibility = oDialogDataModel.getProperty("/values/" + dataProperty + "/objectsForVisibility") || [];
552
+ const objectsForVisibility = oDialogDataModel.getProperty(`/values/${dataProperty}/objectsForVisibility`) || [];
543
553
  const editable = objectsForVisibility.some(MassEditHelper.isEditable);
544
554
 
545
555
  if (editable) {
546
- oDialogDataModel.setProperty("/values/" + dataProperty + "/visible", editable);
556
+ oDialogDataModel.setProperty(`/values/${dataProperty}/visible`, editable);
547
557
  }
548
558
  },
549
559
 
550
560
  /**
551
561
  * Update Managed Object Any for visibility of the mass edit fields.
552
562
  *
553
- * @param {AnyType} mOToUse The ManagedObject Any to be used to calculate the visible value of the binding.
554
- * @param {JSONModel} oDialogDataModel Model to be used runtime.
555
- * @param {string} dataProperty Field name.
556
- * @param {any} values Values of the field.
563
+ * @param mOToUse The ManagedObject Any to be used to calculate the visible value of the binding.
564
+ * @param oDialogDataModel Model to be used runtime.
565
+ * @param dataProperty Field name.
566
+ * @param values Values of the field.
557
567
  */
558
568
  updateOnContextChange: function (mOToUse: AnyType, oDialogDataModel: JSONModel, dataProperty: string, values: any) {
559
569
  const binding = mOToUse.getBinding("any");
@@ -567,11 +577,11 @@ const MassEditHelper = {
567
577
  /**
568
578
  * Get bound object to calculate the visibility of contexts.
569
579
  *
570
- * @param {BindingExpression<boolean> | ExpressionOrPrimitive<boolean>} expBinding Binding String object.
571
- * @param {object} context Context the binding value.
572
- * @returns {AnyType} The ManagedObject Any to be used to calculate the visible value of the binding.
580
+ * @param expBinding Binding String object.
581
+ * @param context Context the binding value.
582
+ * @returns The ManagedObject Any to be used to calculate the visible value of the binding.
573
583
  */
574
- getBoundObject: function (expBinding: BindingExpression<string> | ExpressionOrPrimitive<string>, context: Context): AnyType {
584
+ getBoundObject: function (expBinding: CompiledBindingToolkitExpression, context: Context): AnyType {
575
585
  const mOToUse = new Any({ any: expBinding });
576
586
  const model = context.getModel();
577
587
  mOToUse.setModel(model);
@@ -583,15 +593,15 @@ const MassEditHelper = {
583
593
  /**
584
594
  * Get the visibility of the field.
585
595
  *
586
- * @param {BindingExpression<boolean> | ExpressionOrPrimitive<boolean>} expBinding Binding String object.
587
- * @param {JSONModel} oDialogDataModel Model to be used runtime.
588
- * @param {string} dataProperty Field name.
589
- * @param {any} values Values of the field.
590
- * @param {object} context Context the binding value.
591
- * @returns {boolean} Returns true if the mass edit field is editable.
596
+ * @param expBinding Binding String object.
597
+ * @param oDialogDataModel Model to be used runtime.
598
+ * @param dataProperty Field name.
599
+ * @param values Values of the field.
600
+ * @param context Context the binding value.
601
+ * @returns Returns true if the mass edit field is editable.
592
602
  */
593
603
  getFieldVisiblity: function (
594
- expBinding: BindingExpression<string> | ExpressionOrPrimitive<string>,
604
+ expBinding: CompiledBindingToolkitExpression,
595
605
  oDialogDataModel: JSONModel,
596
606
  dataProperty: string,
597
607
  values: any,
@@ -611,11 +621,11 @@ const MassEditHelper = {
611
621
  * => The model consists of values shown in the comboBox of the dialog (Leave Blank, Keep Existing Values, or any property value for the selected context, etc.)
612
622
  * => The model will capture runtime changes in the results property (the value entered in the comboBox).
613
623
  *
614
- * @param {Array} aContexts Contexts for mass edit
615
- * @param {Array} aDataArray Array containing data related to the dialog used by both the static and the runtime model
616
- * @param {object} oDefaultValues Default values from i18n
617
- * @param {Context} dialogContext Transient context for mass edit dialog.
618
- * @returns {object}
624
+ * @param aContexts Contexts for mass edit
625
+ * @param aDataArray Array containing data related to the dialog used by both the static and the runtime model
626
+ * @param oDefaultValues Default values from i18n
627
+ * @param dialogContext Transient context for mass edit dialog.
628
+ * @returns The runtime model
619
629
  */
620
630
  setRuntimeModelOnDialog: function (aContexts: any[], aDataArray: any[], oDefaultValues: any, dialogContext: Context) {
621
631
  const aValues: any[] = [];
@@ -627,27 +637,28 @@ const MassEditHelper = {
627
637
  "unitData": aUnitData,
628
638
  "results": aResults,
629
639
  "readablePropertyData": aReadOnlyFieldInfo,
630
- "selectedKey": undefined
640
+ "selectedKey": undefined,
641
+ "noFields": oDefaultValues.noFields
631
642
  };
632
643
  const oDialogDataModel = new JSONModel(oData);
633
- aDataArray.forEach(function (oData: any) {
644
+ aDataArray.forEach(function (oInData: any) {
634
645
  let oTextInfo;
635
646
  let sPropertyKey;
636
647
  let sUnitPropertyName;
637
648
  const oDistinctValueMap: any = {};
638
649
  const oDistinctUnitMap: any = {};
639
- if (oData.dataProperty && oData.dataProperty.indexOf("/") > -1) {
640
- const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(oData.dataProperty, aValues /*, dialogContext */);
641
- const aPropertyPaths = oData.dataProperty.split("/");
650
+ if (oInData.dataProperty && oInData.dataProperty.indexOf("/") > -1) {
651
+ const aFinalPath = MassEditHelper.initLastLevelOfPropertyPath(oInData.dataProperty, aValues /*, dialogContext */);
652
+ const aPropertyPaths = oInData.dataProperty.split("/");
642
653
 
643
654
  for (const context of aContexts) {
644
- const sMultiLevelPathValue = context.getObject(oData.dataProperty);
645
- sPropertyKey = oData.dataProperty + "/" + sMultiLevelPathValue;
655
+ const sMultiLevelPathValue = context.getObject(oInData.dataProperty);
656
+ sPropertyKey = `${oInData.dataProperty}/${sMultiLevelPathValue}`;
646
657
  if (!oDistinctValueMap[sPropertyKey] && aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]]) {
647
658
  oTextInfo = MassEditHelper.getTextArrangementInfo(
648
- oData.dataProperty,
649
- oData.descriptionPath,
650
- oData.display,
659
+ oInData.dataProperty,
660
+ oInData.descriptionPath,
661
+ oInData.display,
651
662
  context
652
663
  );
653
664
  aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].push({
@@ -663,157 +674,166 @@ const MassEditHelper = {
663
674
  // }
664
675
 
665
676
  aFinalPath[aPropertyPaths[aPropertyPaths.length - 1]].textInfo = {
666
- descriptionPath: oData.descriptionPath,
667
- valuePath: oData.dataProperty,
668
- displayMode: oData.display
677
+ descriptionPath: oInData.descriptionPath,
678
+ valuePath: oInData.dataProperty,
679
+ displayMode: oInData.display
669
680
  };
670
681
  } else {
671
- aValues[oData.dataProperty] = aValues[oData.dataProperty] || [];
672
- aValues[oData.dataProperty]["selectOptions"] = aValues[oData.dataProperty]["selectOptions"] || [];
673
- if (oData.unitProperty) {
674
- aUnitData[oData.unitProperty] = aUnitData[oData.unitProperty] || [];
675
- aUnitData[oData.unitProperty]["selectOptions"] = aUnitData[oData.unitProperty]["selectOptions"] || [];
682
+ aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
683
+ aValues[oInData.dataProperty]["selectOptions"] = aValues[oInData.dataProperty]["selectOptions"] || [];
684
+ if (oInData.unitProperty) {
685
+ aUnitData[oInData.unitProperty] = aUnitData[oInData.unitProperty] || [];
686
+ aUnitData[oInData.unitProperty]["selectOptions"] = aUnitData[oInData.unitProperty]["selectOptions"] || [];
676
687
  }
677
688
  for (const context of aContexts) {
678
689
  const oDataObject = context.getObject();
679
- sPropertyKey = oData.dataProperty + "/" + oDataObject[oData.dataProperty];
680
- if (oData.dataProperty && oDataObject[oData.dataProperty] && !oDistinctValueMap[sPropertyKey]) {
681
- if (oData.inputType != "CheckBox") {
690
+ sPropertyKey = `${oInData.dataProperty}/${oDataObject[oInData.dataProperty]}`;
691
+ if (oInData.dataProperty && oDataObject[oInData.dataProperty] && !oDistinctValueMap[sPropertyKey]) {
692
+ if (oInData.inputType != "CheckBox") {
682
693
  oTextInfo = MassEditHelper.getTextArrangementInfo(
683
- oData.dataProperty,
684
- oData.descriptionPath,
685
- oData.display,
694
+ oInData.dataProperty,
695
+ oInData.descriptionPath,
696
+ oInData.display,
686
697
  context
687
698
  );
688
699
  const entry = {
689
- "text": (oTextInfo && oTextInfo.fullText) || oDataObject[oData.dataProperty],
700
+ "text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.dataProperty],
690
701
  "key": sPropertyKey,
691
702
  "textInfo": oTextInfo
692
703
  };
693
- aValues[oData.dataProperty].push(entry);
694
- aValues[oData.dataProperty]["selectOptions"].push(entry);
704
+ aValues[oInData.dataProperty].push(entry);
705
+ aValues[oInData.dataProperty]["selectOptions"].push(entry);
695
706
  }
696
- oDistinctValueMap[sPropertyKey] = oDataObject[oData.dataProperty];
707
+ oDistinctValueMap[sPropertyKey] = oDataObject[oInData.dataProperty];
697
708
  }
698
- if (oData.unitProperty && oDataObject[oData.unitProperty]) {
699
- sUnitPropertyName = oData.unitProperty + "/" + oDataObject[oData.unitProperty];
709
+ if (oInData.unitProperty && oDataObject[oInData.unitProperty]) {
710
+ sUnitPropertyName = `${oInData.unitProperty}/${oDataObject[oInData.unitProperty]}`;
700
711
  if (!oDistinctUnitMap[sUnitPropertyName]) {
701
- if (oData.inputType != "CheckBox") {
712
+ if (oInData.inputType != "CheckBox") {
702
713
  oTextInfo = MassEditHelper.getTextArrangementInfo(
703
- oData.unitProperty,
704
- oData.descriptionPath,
705
- oData.display,
714
+ oInData.unitProperty,
715
+ oInData.descriptionPath,
716
+ oInData.display,
706
717
  context
707
718
  );
708
719
  const unitEntry = {
709
- "text": (oTextInfo && oTextInfo.fullText) || oDataObject[oData.unitProperty],
720
+ "text": (oTextInfo && oTextInfo.fullText) || oDataObject[oInData.unitProperty],
710
721
  "key": sUnitPropertyName,
711
722
  "textInfo": oTextInfo
712
723
  };
713
- aUnitData[oData.unitProperty].push(unitEntry);
714
- aUnitData[oData.unitProperty]["selectOptions"].push(unitEntry);
724
+ aUnitData[oInData.unitProperty].push(unitEntry);
725
+ aUnitData[oInData.unitProperty]["selectOptions"].push(unitEntry);
715
726
  }
716
- oDistinctUnitMap[sUnitPropertyName] = oDataObject[oData.unitProperty];
727
+ oDistinctUnitMap[sUnitPropertyName] = oDataObject[oInData.unitProperty];
717
728
  }
718
729
  }
719
730
  }
720
- aValues[oData.dataProperty].textInfo = {
721
- descriptionPath: oData.descriptionPath,
722
- valuePath: oData.dataProperty,
723
- displayMode: oData.display
731
+ aValues[oInData.dataProperty].textInfo = {
732
+ descriptionPath: oInData.descriptionPath,
733
+ valuePath: oInData.dataProperty,
734
+ displayMode: oInData.display
724
735
  };
725
- }
726
- if (Object.keys(oDistinctValueMap).length === 1) {
727
- dialogContext.setProperty(oData.dataProperty, sPropertyKey && oDistinctValueMap[sPropertyKey]);
728
- }
729
- if (Object.keys(oDistinctUnitMap).length === 1) {
730
- dialogContext.setProperty(oData.unitProperty, sUnitPropertyName && oDistinctUnitMap[sUnitPropertyName]);
736
+ if (Object.keys(oDistinctValueMap).length === 1) {
737
+ dialogContext.setProperty(oInData.dataProperty, sPropertyKey && oDistinctValueMap[sPropertyKey]);
738
+ }
739
+ if (Object.keys(oDistinctUnitMap).length === 1) {
740
+ dialogContext.setProperty(oInData.unitProperty, sUnitPropertyName && oDistinctUnitMap[sUnitPropertyName]);
741
+ }
731
742
  }
732
743
  });
733
- aDataArray.forEach(function (oData: any) {
744
+ aDataArray.forEach(function (oInData: any) {
734
745
  let values: any = {};
735
- if (oData.dataProperty.indexOf("/") > -1) {
736
- const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(oData.dataProperty, aValues);
746
+ if (oInData.dataProperty.indexOf("/") > -1) {
747
+ const sMultiLevelPropPathValue = MassEditHelper.getValueForMultiLevelPath(oInData.dataProperty, aValues);
737
748
  if (!sMultiLevelPropPathValue) {
738
- sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key: "Empty/" + oData.dataProperty });
749
+ sMultiLevelPropPathValue.push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
739
750
  } else {
740
- MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue, aContexts, oDefaultValues, oData);
751
+ MassEditHelper.setDefaultValuesToDialog(sMultiLevelPropPathValue, oDefaultValues, oInData);
741
752
  }
742
753
  values = sMultiLevelPropPathValue;
743
- } else if (aValues[oData.dataProperty]) {
744
- aValues[oData.dataProperty] = aValues[oData.dataProperty] || [];
745
- MassEditHelper.setDefaultValuesToDialog(aValues[oData.dataProperty], aContexts, oDefaultValues, oData);
746
- values = aValues[oData.dataProperty];
754
+ } else if (aValues[oInData.dataProperty]) {
755
+ aValues[oInData.dataProperty] = aValues[oInData.dataProperty] || [];
756
+ MassEditHelper.setDefaultValuesToDialog(aValues[oInData.dataProperty], oDefaultValues, oInData);
757
+ values = aValues[oInData.dataProperty];
747
758
  }
748
759
 
749
- if (aUnitData[oData.unitProperty] && aUnitData[oData.unitProperty].length) {
750
- MassEditHelper.setDefaultValuesToDialog(aUnitData[oData.unitProperty], aContexts, oDefaultValues, oData, true);
751
- aUnitData[oData.unitProperty].textInfo = {};
752
- aUnitData[oData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oData.unitProperty);
753
- aUnitData[oData.unitProperty].inputType = oData.inputType;
760
+ if (aUnitData[oInData.unitProperty] && aUnitData[oInData.unitProperty].length) {
761
+ MassEditHelper.setDefaultValuesToDialog(aUnitData[oInData.unitProperty], oDefaultValues, oInData, true);
762
+ aUnitData[oInData.unitProperty].textInfo = {};
763
+ aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
764
+ aContexts,
765
+ oInData.unitProperty
766
+ );
767
+ aUnitData[oInData.unitProperty].inputType = oInData.inputType;
754
768
  } else if (
755
- (oData.dataProperty && aValues[oData.dataProperty] && !aValues[oData.dataProperty].length) ||
756
- (oData.unitProperty && aUnitData[oData.unitProperty] && !aUnitData[oData.unitProperty].length)
769
+ (oInData.dataProperty && aValues[oInData.dataProperty] && !aValues[oInData.dataProperty].length) ||
770
+ (oInData.unitProperty && aUnitData[oInData.unitProperty] && !aUnitData[oInData.unitProperty].length)
757
771
  ) {
758
772
  const bClearFieldOrBlankValueExists =
759
- aValues[oData.dataProperty] &&
760
- aValues[oData.dataProperty].some(function (obj: any) {
773
+ aValues[oInData.dataProperty] &&
774
+ aValues[oInData.dataProperty].some(function (obj: any) {
761
775
  return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
762
776
  });
763
- if (oData.dataProperty && !bClearFieldOrBlankValueExists) {
764
- aValues[oData.dataProperty].push({ text: oDefaultValues.leaveBlankValue, key: "Empty/" + oData.dataProperty });
777
+ if (oInData.dataProperty && !bClearFieldOrBlankValueExists) {
778
+ aValues[oInData.dataProperty].push({ text: oDefaultValues.leaveBlankValue, key: `Empty/${oInData.dataProperty}` });
765
779
  }
766
780
  const bClearFieldOrBlankUnitValueExists =
767
- aUnitData[oData.unitProperty] &&
768
- aUnitData[oData.unitProperty].some(function (obj: any) {
781
+ aUnitData[oInData.unitProperty] &&
782
+ aUnitData[oInData.unitProperty].some(function (obj: any) {
769
783
  return obj.text === "< Clear Values >" || obj.text === "< Leave Blank >";
770
784
  });
771
- if (oData.unitProperty) {
785
+ if (oInData.unitProperty) {
772
786
  if (!bClearFieldOrBlankUnitValueExists) {
773
- aUnitData[oData.unitProperty].push({
787
+ aUnitData[oInData.unitProperty].push({
774
788
  text: oDefaultValues.leaveBlankValue,
775
- key: "Empty/" + oData.unitProperty
789
+ key: `Empty/${oInData.unitProperty}`
776
790
  });
777
791
  }
778
- aUnitData[oData.unitProperty].textInfo = {};
779
- aUnitData[oData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
792
+ aUnitData[oInData.unitProperty].textInfo = {};
793
+ aUnitData[oInData.unitProperty].selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(
780
794
  aContexts,
781
- oData.unitProperty
795
+ oInData.unitProperty
782
796
  );
783
- aUnitData[oData.unitProperty].inputType = oData.inputType;
797
+ aUnitData[oInData.unitProperty].inputType = oInData.inputType;
784
798
  }
785
799
  }
786
- if (oData.isPropertyReadOnly && typeof oData.isPropertyReadOnly === "boolean") {
787
- aReadOnlyFieldInfo.push({ "property": oData.dataProperty, value: oData.isPropertyReadOnly, type: "Default" });
800
+ if (oInData.isPropertyReadOnly && typeof oInData.isPropertyReadOnly === "boolean") {
801
+ aReadOnlyFieldInfo.push({ "property": oInData.dataProperty, value: oInData.isPropertyReadOnly, type: "Default" });
788
802
  } else if (
789
- oData.isPropertyReadOnly &&
790
- oData.isPropertyReadOnly.operands &&
791
- oData.isPropertyReadOnly.operands[0] &&
792
- oData.isPropertyReadOnly.operands[0].operand1 &&
793
- oData.isPropertyReadOnly.operands[0].operand2
803
+ oInData.isPropertyReadOnly &&
804
+ oInData.isPropertyReadOnly.operands &&
805
+ oInData.isPropertyReadOnly.operands[0] &&
806
+ oInData.isPropertyReadOnly.operands[0].operand1 &&
807
+ oInData.isPropertyReadOnly.operands[0].operand2
794
808
  ) {
795
809
  // This needs to be refactored in accordance with the ReadOnlyExpression change
796
810
  aReadOnlyFieldInfo.push({
797
- "property": oData.dataProperty,
798
- propertyPath: oData.isPropertyReadOnly.operands[0].operand1.path,
799
- propertyValue: oData.isPropertyReadOnly.operands[0].operand2.value,
811
+ "property": oInData.dataProperty,
812
+ propertyPath: oInData.isPropertyReadOnly.operands[0].operand1.path,
813
+ propertyValue: oInData.isPropertyReadOnly.operands[0].operand2.value,
800
814
  type: "Path"
801
815
  });
802
816
  }
803
817
 
804
818
  // Setting visbility of the mass edit field.
805
- if (oData.editMode) {
819
+ if (oInData.editMode) {
806
820
  values.visible =
807
- oData.editMode === EditMode.Editable ||
821
+ oInData.editMode === EditMode.Editable ||
808
822
  aContexts.some(
809
- MassEditHelper.getFieldVisiblity.bind(MassEditHelper, oData.editMode, oDialogDataModel, oData.dataProperty, values)
823
+ MassEditHelper.getFieldVisiblity.bind(
824
+ MassEditHelper,
825
+ oInData.editMode,
826
+ oDialogDataModel,
827
+ oInData.dataProperty,
828
+ values
829
+ )
810
830
  );
811
831
  } else {
812
832
  values.visible = true;
813
833
  }
814
- values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oData.dataProperty);
815
- values.inputType = oData.inputType;
816
- values.unitProperty = oData.unitProperty;
834
+ values.selectedKey = MassEditHelper.getDefaultSelectionPathComboBox(aContexts, oInData.dataProperty);
835
+ values.inputType = oInData.inputType;
836
+ values.unitProperty = oInData.unitProperty;
817
837
  });
818
838
 
819
839
  return oDialogDataModel;
@@ -821,9 +841,9 @@ const MassEditHelper = {
821
841
  /**
822
842
  * Gets transient context for dialog.
823
843
  *
824
- * @param {Table} table Instance of Table.
825
- * @param {Dialog} dialog Mass Edit Dialog.
826
- * @returns {object} Promise returning instance of dialog.
844
+ * @param table Instance of Table.
845
+ * @param dialog Mass Edit Dialog.
846
+ * @returns Promise returning instance of dialog.
827
847
  */
828
848
  getDialogContext: function (table: Table, dialog?: Dialog): Context {
829
849
  let transCtx: Context = (dialog && dialog.getBindingContext()) as Context;
@@ -852,12 +872,12 @@ const MassEditHelper = {
852
872
  /**
853
873
  * Create the mass edit dialog.
854
874
  *
855
- * @param {object} oTable Instance of Table
856
- * @param {Array} aContexts Contexts for mass edit
857
- * @param {object} oController Controller for the view
858
- * @returns {object} Promise returning instance of dialog.
875
+ * @param oTable Instance of Table
876
+ * @param aContexts Contexts for mass edit
877
+ * @param oController Controller for the view
878
+ * @returns Promise returning instance of dialog.
859
879
  */
860
- createDialog: function (oTable: Table, aContexts: any[], oController: PageController) {
880
+ createDialog: async function (oTable: Table, aContexts: any[], oController: PageController): Promise<any> {
861
881
  const sFragmentName = "sap/fe/core/controls/massEdit/MassEditDialog",
862
882
  aDataArray: any[] = [],
863
883
  oResourceBundle = (Core as CoreEx).getLibraryResourceBundle("sap.fe.core"),
@@ -866,159 +886,159 @@ const MassEditHelper = {
866
886
  dialogContext = MassEditHelper.getDialogContext(oTable),
867
887
  oDialogDataModel = MassEditHelper.setRuntimeModelOnDialog(aContexts, aDataArray, oDefaultValues, dialogContext);
868
888
 
869
- return new Promise(function (resolve: (value: any) => void, reject: (reason?: any) => void) {
870
- const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
871
- return Promise.resolve(
872
- XMLPreprocessor.process(
873
- oFragment,
874
- { name: sFragmentName },
875
- {
876
- bindingContexts: {
877
- dataFieldModel: oDataFieldModel.createBindingContext("/")
878
- },
879
- models: {
880
- dataFieldModel: oDataFieldModel
881
- }
889
+ const oFragment = XMLTemplateProcessor.loadTemplate(sFragmentName, "fragment");
890
+ const oCreatedFragment = await Promise.resolve(
891
+ XMLPreprocessor.process(
892
+ oFragment,
893
+ { name: sFragmentName },
894
+ {
895
+ bindingContexts: {
896
+ dataFieldModel: oDataFieldModel.createBindingContext("/")
897
+ },
898
+ models: {
899
+ dataFieldModel: oDataFieldModel
882
900
  }
883
- )
901
+ }
884
902
  )
885
- .then(function (oFragment: any) {
886
- return Fragment.load({ definition: oFragment }).then(function (oDialogContent: any) {
887
- const DraftStatus = FELibrary.DraftStatus;
888
- const oDialog = new Dialog({
889
- title: oDefaultValues.massEditTitle,
890
- content: [oDialogContent],
891
- afterOpen: MassEditHelper.onDialogOpen,
892
- beginButton: new Button({
893
- text: oDefaultValues.applyButtonText,
894
- type: "Emphasized",
895
- press: function (oEvent: any) {
896
- (oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
897
- "skipPatchHandlers",
898
- true
899
- );
900
- const oDialog = oEvent.getSource().getParent();
901
- const oModel = oDialog.getModel("fieldsInfo");
902
- const aResults = oModel.getProperty("/results");
903
- const aPropertyReadableInfo = oModel.getProperty("/readablePropertyData");
904
- const changePromise: any[] = [];
905
- let bReadOnlyField = false;
906
- let groupId;
907
- //let index = 0;
908
- let errorValues: any[] = [];
909
- aContexts.forEach(function (oSelectedContext: any, idx: number) {
910
- aResults.forEach(function (oResult: any) {
911
- //TODO - Add save implementation for Value Help.
912
- if (aPropertyReadableInfo) {
913
- bReadOnlyField = aPropertyReadableInfo.some(function (oPropertyInfo: any) {
914
- if (oResult.keyValue === oPropertyInfo.property) {
915
- if (oPropertyInfo.type === "Default") {
916
- return oPropertyInfo.value === true;
917
- } else if (
918
- oPropertyInfo.type === "Path" &&
919
- oPropertyInfo.propertyValue &&
920
- oPropertyInfo.propertyPath
921
- ) {
922
- return (
923
- oSelectedContext.getObject(oPropertyInfo.propertyPath) ===
924
- oPropertyInfo.propertyValue
925
- );
926
- }
927
- }
928
- });
929
- }
930
- groupId = "$auto." + idx;
931
- //index += 1;
932
- oController._editFlow.setDraftStatus(DraftStatus.Saving);
933
- //let promiseCount = 0;
934
- if (oResult.keyValue && oResult.value !== "Default" && !bReadOnlyField) {
935
- changePromise.push(
936
- oSelectedContext
937
- .setProperty(oResult.keyValue, oResult.value, groupId)
938
- .then(function () {
939
- return oSelectedContext;
940
- })
941
- .catch(function (oError: any) {
942
- errorValues.push(oSelectedContext.getObject());
943
- Log.error("Mass Edit: Something went wrong in updating entries.", oError);
944
- })
945
- );
946
- }
947
- });
948
- });
949
-
950
- (Promise as any).allSettled(changePromise).then(function () {
951
- const oListBinding = oTable.getRowBinding();
952
- const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
953
- return oExtensionAPI.refresh(oListBinding.getPath()).then(function () {
954
- let subtitleColumn = CommonUtils.getMessageColumn(oTable);
955
- let messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
956
- let boundTransitionErrorContexts = [] as any;
957
- messages.forEach(function (message: any, idx: any) {
958
- const messageTargets = message.getTargets();
959
- if (
960
- messageTargets &&
961
- messageTargets.length === 1 &&
962
- messageTargets[0].length &&
963
- message.persistent === true
964
- ) {
965
- let boundTransitionErrorContext = aContexts.find(function (oContext: any) {
966
- return message.getTarget().indexOf(oContext.getPath()) !== -1;
967
- });
968
- boundTransitionErrorContexts.push(boundTransitionErrorContext);
969
- message.additionalText = boundTransitionErrorContext
970
- ? boundTransitionErrorContext.getObject()[subtitleColumn]
971
- : undefined;
972
- }
973
- });
974
- if (boundTransitionErrorContexts.length === 0 && errorValues.length === 0) {
975
- oController._editFlow.setDraftStatus(DraftStatus.Saved);
976
- const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
977
- MessageToast.show(successToast);
978
- } else {
979
- if (
980
- errorValues.length + boundTransitionErrorContexts.length <
981
- (oTable as any).getSelectedContexts().length
982
- ) {
983
- oController._editFlow.setDraftStatus(DraftStatus.Saved);
984
- } else if (
985
- errorValues.length + boundTransitionErrorContexts.length ===
986
- (oTable as any).getSelectedContexts().length
987
- ) {
988
- oController._editFlow.setDraftStatus(DraftStatus.Clear);
989
- }
990
- }
991
- oController._editFlow.getMessageHandler().showMessages();
992
- if (oDialog.isOpen()) {
993
- oDialog.close();
994
- oDialog.destroy();
995
- (oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
996
- "skipPatchHandlers",
997
- false
998
- );
999
- }
1000
- });
1001
- });
1002
- }
1003
- }),
1004
- endButton: new Button({
1005
- text: oDefaultValues.cancelButtonText,
1006
- press: function (oEvent: any) {
1007
- const oDialog = oEvent.getSource().getParent();
1008
- oDialog.close();
1009
- oDialog.destroy();
1010
- }
1011
- })
903
+ );
904
+ const oDialogContent = await Fragment.load({ definition: oCreatedFragment });
905
+ const DraftStatus = FELibrary.DraftStatus;
906
+ const oDialog = new Dialog({
907
+ resizable: true,
908
+ title: oDefaultValues.massEditTitle,
909
+ content: [oDialogContent as any],
910
+ afterOpen: MassEditHelper.onDialogOpen,
911
+ beginButton: new Button({
912
+ text: MassEditHelper.helpers.getExpBindingForApplyButtonTxt(oDefaultValues, oDataFieldModel.getObject("/")),
913
+ type: "Emphasized",
914
+ press: async function (oEvent: any) {
915
+ (oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty("skipPatchHandlers", true);
916
+ const oInDialog = oEvent.getSource().getParent();
917
+ const oModel = oInDialog.getModel("fieldsInfo");
918
+ const aResults = oModel.getProperty("/results");
919
+ const aPropertyReadableInfo = oModel.getProperty("/readablePropertyData");
920
+ const changePromise: any[] = [];
921
+ let bReadOnlyField = false;
922
+ let groupId;
923
+ const errorValues: any[] = [];
924
+ aContexts.forEach(function (oSelectedContext: any, idx: number) {
925
+ aResults.forEach(function (oResult: any) {
926
+ //TODO - Add save implementation for Value Help.
927
+ if (aPropertyReadableInfo) {
928
+ bReadOnlyField = aPropertyReadableInfo.some(function (oPropertyInfo: any) {
929
+ if (oResult.keyValue === oPropertyInfo.property) {
930
+ if (oPropertyInfo.type === "Default") {
931
+ return oPropertyInfo.value === true;
932
+ } else if (
933
+ oPropertyInfo.type === "Path" &&
934
+ oPropertyInfo.propertyValue &&
935
+ oPropertyInfo.propertyPath
936
+ ) {
937
+ return oSelectedContext.getObject(oPropertyInfo.propertyPath) === oPropertyInfo.propertyValue;
938
+ }
939
+ }
940
+ });
941
+ }
942
+ groupId = `$auto.${idx}`;
943
+ //index += 1;
944
+ oController._editFlow.setDraftStatus(DraftStatus.Saving);
945
+ //let promiseCount = 0;
946
+ if (oResult.keyValue && oResult.value !== "Default" && !bReadOnlyField) {
947
+ changePromise.push(
948
+ oSelectedContext
949
+ .setProperty(oResult.keyValue, oResult.value, groupId)
950
+ .then(function () {
951
+ return oSelectedContext;
952
+ })
953
+ .catch(function (oError: any) {
954
+ errorValues.push(oSelectedContext.getObject());
955
+ Log.error("Mass Edit: Something went wrong in updating entries.", oError);
956
+ })
957
+ );
958
+ }
1012
959
  });
1013
- const model = oTable.getModel();
1014
- oDialog.setModel(oDialogDataModel, "fieldsInfo");
1015
- oDialog.setModel(model);
1016
- oDialog.setBindingContext(dialogContext);
1017
- resolve(oDialog);
1018
960
  });
1019
- })
1020
- .catch(reject);
961
+
962
+ await (Promise as any).allSettled(changePromise);
963
+
964
+ const oListBinding = oTable.getRowBinding();
965
+ const oExtensionAPI = oController && (oController.getExtensionAPI() as any);
966
+ await oExtensionAPI.refresh(oListBinding.getPath());
967
+
968
+ const subtitleColumn = CommonUtils.getMessageColumn(oTable);
969
+ const messages = sap.ui.getCore().getMessageManager().getMessageModel().getData();
970
+ const boundTransitionErrorContexts = [] as any;
971
+ messages.forEach(function (message: any) {
972
+ const messageTargets = message.getTargets();
973
+ if (messageTargets && messageTargets.length === 1 && messageTargets[0].length && message.persistent === true) {
974
+ const boundTransitionErrorContext = aContexts.find(function (oContext: any) {
975
+ return message.getTarget().indexOf(oContext.getPath()) !== -1;
976
+ });
977
+ boundTransitionErrorContexts.push(boundTransitionErrorContext);
978
+ message.additionalText = boundTransitionErrorContext
979
+ ? boundTransitionErrorContext.getObject()[subtitleColumn]
980
+ : undefined;
981
+ }
982
+ });
983
+ if (aResults.length > 0 && boundTransitionErrorContexts.length === 0 && errorValues.length === 0) {
984
+ oController._editFlow.setDraftStatus(DraftStatus.Saved);
985
+ const successToast = oResourceBundle.getText("C_MASS_EDIT_SUCCESS_TOAST");
986
+ MessageToast.show(successToast);
987
+ } else if (errorValues.length + boundTransitionErrorContexts.length < (oTable as any).getSelectedContexts().length) {
988
+ oController._editFlow.setDraftStatus(DraftStatus.Saved);
989
+ } else if (errorValues.length + boundTransitionErrorContexts.length === (oTable as any).getSelectedContexts().length) {
990
+ oController._editFlow.setDraftStatus(DraftStatus.Clear);
991
+ }
992
+ oController._editFlow.getMessageHandler().showMessages();
993
+ if (oInDialog.isOpen()) {
994
+ oInDialog.close();
995
+ oInDialog.destroy();
996
+ (oController.getView()?.getBindingContext("internal") as InternalModelContext)?.setProperty(
997
+ "skipPatchHandlers",
998
+ false
999
+ );
1000
+ }
1001
+ }
1002
+ }),
1003
+ endButton: new Button({
1004
+ text: oDefaultValues.cancelButtonText,
1005
+ visible: MassEditHelper.helpers.hasEditableFieldsBinding(oDataFieldModel.getObject("/"), true) as any,
1006
+ press: function (oEvent: any) {
1007
+ const oInDialog = oEvent.getSource().getParent();
1008
+ oInDialog.close();
1009
+ oInDialog.destroy();
1010
+ }
1011
+ })
1021
1012
  });
1013
+ const model = oTable.getModel();
1014
+ oDialog.setModel(oDialogDataModel, "fieldsInfo");
1015
+ oDialog.setModel(model);
1016
+ oDialog.setBindingContext(dialogContext);
1017
+ return oDialog;
1018
+ },
1019
+
1020
+ helpers: {
1021
+ getBindingExpForHasEditableFields: (fields: any, editable: boolean) => {
1022
+ const totalExp = fields.reduce(
1023
+ (expression: any, field: any) =>
1024
+ or(
1025
+ expression,
1026
+ pathInModel("/values/" + field.dataProperty + "/visible", "fieldsInfo") as BindingToolkitExpression<boolean>
1027
+ ),
1028
+ constant(false)
1029
+ );
1030
+ return editable ? totalExp : not(totalExp);
1031
+ },
1032
+
1033
+ getExpBindingForApplyButtonTxt: (defaultValues: any, fields: boolean) => {
1034
+ const editableExp = MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, true);
1035
+ const totalExp = ifElse(editableExp, constant(defaultValues.applyButtonText), constant(defaultValues.okButtonText));
1036
+ return compileExpression(totalExp);
1037
+ },
1038
+
1039
+ hasEditableFieldsBinding: (fields: any, editable: boolean) => {
1040
+ return compileExpression(MassEditHelper.helpers.getBindingExpForHasEditableFields(fields, editable));
1041
+ }
1022
1042
  }
1023
1043
  };
1024
1044