@sapui5/sap.fe.core 1.97.0 → 1.100.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (306) hide show
  1. package/package.json +7 -4
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +309 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +315 -0
  5. package/src/sap/fe/core/AppComponent.js +389 -397
  6. package/src/sap/fe/core/AppComponent.ts +403 -0
  7. package/src/sap/fe/core/AppStateHandler.js +198 -181
  8. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  9. package/src/sap/fe/core/BaseController.js +83 -58
  10. package/src/sap/fe/core/BaseController.ts +68 -0
  11. package/src/sap/fe/core/BusyLocker.js +105 -121
  12. package/src/sap/fe/core/BusyLocker.ts +98 -0
  13. package/src/sap/fe/core/CommonUtils.js +2164 -2379
  14. package/src/sap/fe/core/CommonUtils.ts +2177 -0
  15. package/src/sap/fe/core/ExtensionAPI.js +279 -266
  16. package/src/sap/fe/core/ExtensionAPI.ts +250 -0
  17. package/src/sap/fe/core/PageController.js +218 -125
  18. package/src/sap/fe/core/PageController.ts +129 -0
  19. package/src/sap/fe/core/RouterProxy.js +924 -807
  20. package/src/sap/fe/core/RouterProxy.ts +840 -0
  21. package/src/sap/fe/core/Synchronization.js +41 -35
  22. package/src/sap/fe/core/Synchronization.ts +29 -0
  23. package/src/sap/fe/core/TemplateComponent.js +173 -155
  24. package/src/sap/fe/core/TemplateComponent.ts +173 -0
  25. package/src/sap/fe/core/TemplateModel.js +79 -54
  26. package/src/sap/fe/core/TemplateModel.ts +63 -0
  27. package/src/sap/fe/core/TransactionHelper.js +1560 -1579
  28. package/src/sap/fe/core/TransactionHelper.ts +1717 -0
  29. package/src/sap/fe/core/actions/collaboration/ActivitySync.js +392 -0
  30. package/src/sap/fe/core/actions/collaboration/ActivitySync.ts +355 -0
  31. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.js +136 -0
  32. package/src/sap/fe/core/actions/collaboration/CollaborationCommon.ts +119 -0
  33. package/src/sap/fe/core/actions/collaboration/Manage.js +262 -0
  34. package/src/sap/fe/core/actions/collaboration/Manage.ts +244 -0
  35. package/src/sap/fe/core/actions/collaboration/ManageDialog.fragment.xml +103 -0
  36. package/src/sap/fe/core/actions/collaboration/UserDetails.fragment.xml +13 -0
  37. package/src/sap/fe/core/actions/draft.js +521 -581
  38. package/src/sap/fe/core/actions/draft.ts +566 -0
  39. package/src/sap/fe/core/actions/messageHandling.js +564 -511
  40. package/src/sap/fe/core/actions/messageHandling.ts +552 -0
  41. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  42. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  43. package/src/sap/fe/core/actions/operations.js +1093 -1211
  44. package/src/sap/fe/core/actions/operations.ts +1192 -0
  45. package/src/sap/fe/core/actions/sticky.js +114 -104
  46. package/src/sap/fe/core/actions/sticky.ts +119 -0
  47. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +70 -66
  48. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.ts +65 -0
  49. package/src/sap/fe/core/controllerextensions/EditFlow.js +1594 -1701
  50. package/src/sap/fe/core/controllerextensions/EditFlow.ts +1672 -0
  51. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +80 -54
  52. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.ts +61 -0
  53. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +719 -505
  54. package/src/sap/fe/core/controllerextensions/InternalEditFlow.ts +783 -0
  55. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +797 -813
  56. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.ts +803 -0
  57. package/src/sap/fe/core/controllerextensions/InternalRouting.js +1005 -973
  58. package/src/sap/fe/core/controllerextensions/InternalRouting.ts +978 -0
  59. package/src/sap/fe/core/controllerextensions/KPIManagement.js +530 -476
  60. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +137 -46
  61. package/src/sap/fe/core/controllerextensions/MassEdit.js +144 -0
  62. package/src/sap/fe/core/controllerextensions/MassEdit.ts +156 -0
  63. package/src/sap/fe/core/controllerextensions/MessageHandler.js +234 -232
  64. package/src/sap/fe/core/controllerextensions/MessageHandler.ts +225 -0
  65. package/src/sap/fe/core/controllerextensions/PageReady.js +302 -337
  66. package/src/sap/fe/core/controllerextensions/PageReady.ts +23 -17
  67. package/src/sap/fe/core/controllerextensions/Paginator.js +189 -148
  68. package/src/sap/fe/core/controllerextensions/Paginator.ts +163 -0
  69. package/src/sap/fe/core/controllerextensions/Placeholder.js +158 -146
  70. package/src/sap/fe/core/controllerextensions/Placeholder.ts +151 -0
  71. package/src/sap/fe/core/controllerextensions/Routing.js +145 -106
  72. package/src/sap/fe/core/controllerextensions/Routing.ts +132 -0
  73. package/src/sap/fe/core/controllerextensions/RoutingListener.js +8 -6
  74. package/src/sap/fe/core/controllerextensions/RoutingListener.ts +3 -0
  75. package/src/sap/fe/core/controllerextensions/Share.js +220 -244
  76. package/src/sap/fe/core/controllerextensions/Share.ts +231 -0
  77. package/src/sap/fe/core/controllerextensions/SideEffects.js +593 -634
  78. package/src/sap/fe/core/controllerextensions/SideEffects.ts +29 -27
  79. package/src/sap/fe/core/controllerextensions/ViewState.js +789 -806
  80. package/src/sap/fe/core/controllerextensions/ViewState.ts +805 -0
  81. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +4 -3
  82. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +2 -2
  83. package/src/sap/fe/core/controls/CommandExecution.js +68 -66
  84. package/src/sap/fe/core/controls/CommandExecution.ts +72 -0
  85. package/src/sap/fe/core/controls/ConditionalWrapper.js +91 -75
  86. package/src/sap/fe/core/controls/ConditionalWrapper.ts +83 -0
  87. package/src/sap/fe/core/controls/CustomQuickViewPage.js +131 -125
  88. package/src/sap/fe/core/controls/CustomQuickViewPage.ts +126 -0
  89. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +105 -110
  90. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.ts +101 -0
  91. package/src/sap/fe/core/controls/FieldWrapper.js +122 -140
  92. package/src/sap/fe/core/controls/FieldWrapper.ts +115 -0
  93. package/src/sap/fe/core/controls/FilterBar.js +163 -159
  94. package/src/sap/fe/core/controls/FilterBar.ts +143 -0
  95. package/src/sap/fe/core/controls/FormElementWrapper.js +46 -44
  96. package/src/sap/fe/core/controls/FormElementWrapper.ts +40 -0
  97. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +38 -42
  98. package/src/sap/fe/core/controls/MultiValueParameterDelegate.ts +31 -0
  99. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  100. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +127 -116
  101. package/src/sap/fe/core/controls/filterbar/FilterContainer.ts +98 -0
  102. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +242 -255
  103. package/src/sap/fe/core/controls/filterbar/VisualFilter.ts +245 -0
  104. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +151 -141
  105. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.ts +125 -0
  106. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +336 -322
  107. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.ts +337 -0
  108. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  109. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  110. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.ts +70 -0
  111. package/src/sap/fe/core/converters/ConverterContext.js +348 -367
  112. package/src/sap/fe/core/converters/ConverterContext.ts +33 -19
  113. package/src/sap/fe/core/converters/ManifestSettings.js +12 -1
  114. package/src/sap/fe/core/converters/ManifestSettings.ts +16 -1
  115. package/src/sap/fe/core/converters/ManifestWrapper.js +354 -354
  116. package/src/sap/fe/core/converters/ManifestWrapper.ts +34 -6
  117. package/src/sap/fe/core/converters/MetaModelConverter.js +72 -9
  118. package/src/sap/fe/core/converters/MetaModelConverter.ts +75 -16
  119. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  120. package/src/sap/fe/core/converters/TemplateConverter.ts +4 -3
  121. package/src/sap/fe/core/converters/annotations/DataField.js +28 -14
  122. package/src/sap/fe/core/converters/annotations/DataField.ts +38 -14
  123. package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
  124. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  125. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  126. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  127. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  128. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  129. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  130. package/src/sap/fe/core/converters/controls/Common/Form.js +21 -11
  131. package/src/sap/fe/core/converters/controls/Common/Form.ts +28 -6
  132. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  133. package/src/sap/fe/core/converters/controls/Common/KPI.ts +75 -2
  134. package/src/sap/fe/core/converters/controls/Common/Table.js +507 -408
  135. package/src/sap/fe/core/converters/controls/Common/Table.ts +618 -500
  136. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +592 -0
  137. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +718 -0
  138. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +465 -59
  139. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +462 -72
  140. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  141. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  142. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
  143. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  144. package/src/sap/fe/core/converters/helpers/Aggregation.js +118 -121
  145. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  146. package/src/sap/fe/core/converters/helpers/BindingHelper.js +20 -6
  147. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +16 -4
  148. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +12 -1
  149. package/src/sap/fe/core/converters/helpers/ConfigurableObject.ts +11 -0
  150. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  151. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  152. package/src/sap/fe/core/converters/helpers/Key.js +42 -57
  153. package/src/sap/fe/core/converters/helpers/Key.ts +1 -1
  154. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +28 -7
  155. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +23 -6
  156. package/src/sap/fe/core/converters/templates/ListReportConverter.js +20 -7
  157. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +36 -14
  158. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +7 -5
  159. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +5 -1
  160. package/src/sap/fe/core/designtime/AppComponent.designtime.js +93 -90
  161. package/src/sap/fe/core/designtime/AppComponent.designtime.ts +91 -0
  162. package/src/sap/fe/core/formatters/CollaborationFormatter.js +104 -0
  163. package/src/sap/fe/core/formatters/CollaborationFormatter.ts +60 -0
  164. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  165. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  166. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  167. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  168. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  169. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  170. package/src/sap/fe/core/formatters/TableFormatter.js +91 -29
  171. package/src/sap/fe/core/formatters/TableFormatter.ts +94 -28
  172. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  173. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  174. package/src/sap/fe/core/fpm/Component.js +51 -54
  175. package/src/sap/fe/core/fpm/Component.ts +48 -0
  176. package/src/sap/fe/core/helpers/AppStartupHelper.js +373 -0
  177. package/src/sap/fe/core/helpers/AppStartupHelper.ts +417 -0
  178. package/src/sap/fe/core/helpers/BindingExpression.js +489 -442
  179. package/src/sap/fe/core/helpers/BindingExpression.ts +486 -469
  180. package/src/sap/fe/core/helpers/ClassSupport.js +212 -76
  181. package/src/sap/fe/core/helpers/ClassSupport.ts +198 -71
  182. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +64 -59
  183. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +52 -0
  184. package/src/sap/fe/core/helpers/EditState.js +81 -84
  185. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  186. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  187. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  188. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  189. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  190. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  191. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  192. package/src/sap/fe/core/helpers/MassEditHelper.js +604 -0
  193. package/src/sap/fe/core/helpers/MassEditHelper.ts +699 -0
  194. package/src/sap/fe/core/helpers/ModelHelper.js +253 -225
  195. package/src/sap/fe/core/helpers/ModelHelper.ts +250 -0
  196. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  197. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  198. package/src/sap/fe/core/helpers/SemanticDateOperators.js +336 -313
  199. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +334 -0
  200. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  201. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  202. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  203. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  204. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  205. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  206. package/src/sap/fe/core/library.js +427 -425
  207. package/src/sap/fe/core/library.support.js +23 -27
  208. package/src/sap/fe/core/library.support.ts +23 -0
  209. package/src/sap/fe/core/library.ts +420 -0
  210. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +64 -0
  211. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +69 -0
  212. package/src/sap/fe/core/messagebundle.properties +78 -13
  213. package/src/sap/fe/core/messagebundle_ar.properties +58 -7
  214. package/src/sap/fe/core/messagebundle_bg.properties +58 -7
  215. package/src/sap/fe/core/messagebundle_ca.properties +58 -7
  216. package/src/sap/fe/core/messagebundle_cs.properties +59 -8
  217. package/src/sap/fe/core/messagebundle_cy.properties +58 -7
  218. package/src/sap/fe/core/messagebundle_da.properties +58 -7
  219. package/src/sap/fe/core/messagebundle_de.properties +58 -7
  220. package/src/sap/fe/core/messagebundle_el.properties +58 -7
  221. package/src/sap/fe/core/messagebundle_en.properties +57 -6
  222. package/src/sap/fe/core/messagebundle_en_GB.properties +57 -6
  223. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +61 -6
  224. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +58 -7
  225. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +58 -7
  226. package/src/sap/fe/core/messagebundle_es.properties +58 -7
  227. package/src/sap/fe/core/messagebundle_es_MX.properties +58 -7
  228. package/src/sap/fe/core/messagebundle_et.properties +58 -7
  229. package/src/sap/fe/core/messagebundle_fi.properties +60 -9
  230. package/src/sap/fe/core/messagebundle_fr.properties +64 -13
  231. package/src/sap/fe/core/messagebundle_fr_CA.properties +59 -8
  232. package/src/sap/fe/core/messagebundle_hi.properties +58 -7
  233. package/src/sap/fe/core/messagebundle_hr.properties +58 -7
  234. package/src/sap/fe/core/messagebundle_hu.properties +59 -8
  235. package/src/sap/fe/core/messagebundle_id.properties +61 -10
  236. package/src/sap/fe/core/messagebundle_it.properties +58 -7
  237. package/src/sap/fe/core/messagebundle_iw.properties +58 -7
  238. package/src/sap/fe/core/messagebundle_ja.properties +58 -7
  239. package/src/sap/fe/core/messagebundle_kk.properties +58 -7
  240. package/src/sap/fe/core/messagebundle_ko.properties +58 -7
  241. package/src/sap/fe/core/messagebundle_lt.properties +58 -7
  242. package/src/sap/fe/core/messagebundle_lv.properties +59 -8
  243. package/src/sap/fe/core/messagebundle_ms.properties +58 -7
  244. package/src/sap/fe/core/messagebundle_nl.properties +58 -7
  245. package/src/sap/fe/core/messagebundle_no.properties +58 -7
  246. package/src/sap/fe/core/messagebundle_pl.properties +58 -7
  247. package/src/sap/fe/core/messagebundle_pt.properties +59 -8
  248. package/src/sap/fe/core/messagebundle_pt_PT.properties +58 -7
  249. package/src/sap/fe/core/messagebundle_ro.properties +58 -7
  250. package/src/sap/fe/core/messagebundle_ru.properties +58 -7
  251. package/src/sap/fe/core/messagebundle_sh.properties +58 -7
  252. package/src/sap/fe/core/messagebundle_sk.properties +58 -7
  253. package/src/sap/fe/core/messagebundle_sl.properties +58 -7
  254. package/src/sap/fe/core/messagebundle_sv.properties +59 -8
  255. package/src/sap/fe/core/messagebundle_th.properties +58 -7
  256. package/src/sap/fe/core/messagebundle_tr.properties +60 -9
  257. package/src/sap/fe/core/messagebundle_uk.properties +58 -7
  258. package/src/sap/fe/core/messagebundle_vi.properties +58 -7
  259. package/src/sap/fe/core/messagebundle_zh_CN.properties +58 -7
  260. package/src/sap/fe/core/messagebundle_zh_TW.properties +58 -7
  261. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +45 -71
  262. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  263. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +231 -202
  264. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  265. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +67 -92
  266. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +10 -6
  267. package/src/sap/fe/core/services/NavigationServiceFactory.js +351 -300
  268. package/src/sap/fe/core/services/NavigationServiceFactory.ts +313 -0
  269. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +114 -81
  270. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +83 -0
  271. package/src/sap/fe/core/services/RoutingServiceFactory.js +927 -1152
  272. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  273. package/src/sap/fe/core/services/ShellServicesFactory.js +649 -707
  274. package/src/sap/fe/core/services/ShellServicesFactory.ts +52 -15
  275. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +569 -637
  276. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +78 -102
  277. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +429 -478
  278. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +460 -0
  279. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  280. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  281. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  282. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  283. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  284. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  285. package/src/sap/fe/core/support/CommonHelper.js +1 -1
  286. package/src/sap/fe/core/support/CommonHelper.ts +1 -1
  287. package/src/sap/fe/core/support/Diagnostics.js +36 -48
  288. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  289. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  290. package/src/sap/fe/core/templating/DataModelPathHelper.js +97 -127
  291. package/src/sap/fe/core/templating/DataModelPathHelper.ts +112 -135
  292. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  293. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  294. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  295. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  296. package/src/sap/fe/core/templating/FilterHelper.js +140 -78
  297. package/src/sap/fe/core/templating/FilterHelper.ts +149 -78
  298. package/src/sap/fe/core/templating/PropertyHelper.js +3 -3
  299. package/src/sap/fe/core/templating/PropertyHelper.ts +2 -2
  300. package/src/sap/fe/core/templating/UIFormatters.js +76 -135
  301. package/src/sap/fe/core/templating/UIFormatters.ts +76 -99
  302. package/src/sap/fe/core/type/Email.js +1 -1
  303. package/src/sap/fe/core/type/Email.ts +4 -6
  304. package/ui5.yaml +0 -3
  305. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  306. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -0,0 +1,313 @@
1
+ import Service from "sap/ui/core/service/Service";
2
+ import ServiceFactory from "sap/ui/core/service/ServiceFactory";
3
+ import { ServiceContext } from "sap/ui/core/service";
4
+ import { NavigationHandler } from "sap/fe/navigation";
5
+ import SelectionVariant from "sap/fe/navigation/SelectionVariant";
6
+
7
+ type NavigationServiceSettings = {};
8
+ export class NavigationService extends Service<NavigationServiceSettings> {
9
+ initPromise!: Promise<any>;
10
+ oNavHandler!: NavigationHandler;
11
+ init() {
12
+ const oContext = this.getContext(),
13
+ oComponent = oContext && oContext.scopeObject;
14
+
15
+ this.oNavHandler = new NavigationHandler(oComponent);
16
+ this.oNavHandler.setModel(oComponent.getModel());
17
+ this.initPromise = Promise.resolve(this);
18
+ }
19
+ exit() {
20
+ this.oNavHandler.destroy();
21
+ }
22
+
23
+ /**
24
+ * Triggers a cross-app navigation after saving the inner and the cross-app states.
25
+ * @private
26
+ * @ui5-restricted
27
+ * @param {string} sSemanticObject Semantic object of the target app
28
+ * @param {string} sActionName Action of the target app
29
+ * @param {object | string } [vNavigationParameters] Navigation parameters as an object with key/value pairs or as a string representation of
30
+ * such an object. If passed as an object, the properties are not checked against the <code>IsPotentialSensitive</code> or
31
+ * <code>Measure</code> type.
32
+ * @param {object} [oInnerAppData] Object for storing current state of the app
33
+ * @param {Function} [fnOnError] Callback that is called if an error occurs during navigation <br>
34
+ * @param {object} [oExternalAppData] Object for storing the state which will be forwarded to the target component.
35
+ * @param {string} [sNavMode] Argument is used to overwrite the FLP-configured target for opening a URL. If used, only the
36
+ * <code>explace</code> or <code>inplace</code> values are allowed. Any other value will lead to an exception
37
+ * <code>NavigationHandler.INVALID_NAV_MODE</code>.
38
+ **/
39
+ navigate(
40
+ sSemanticObject: string,
41
+ sActionName: string,
42
+ vNavigationParameters?: string | object,
43
+ oInnerAppData?: object,
44
+ fnOnError?: Function,
45
+ oExternalAppData?: object,
46
+ sNavMode?: string
47
+ ) {
48
+ // TODO: Navigation Handler does not handle navigation without a context
49
+ // but in v4 DataFieldForIBN with requiresContext false can trigger a navigation without any context
50
+ // This should be handled
51
+ this.oNavHandler.navigate(
52
+ sSemanticObject,
53
+ sActionName,
54
+ vNavigationParameters,
55
+ oInnerAppData,
56
+ fnOnError,
57
+ oExternalAppData,
58
+ sNavMode
59
+ );
60
+ }
61
+ /**
62
+ * Parses the incoming URL and returns a Promise.
63
+ * @returns {object} A Promise object which returns the
64
+ * extracted app state, the startup parameters, and the type of navigation when execution is successful,
65
+ * @private
66
+ * @ui5-restricted
67
+ **/
68
+ parseNavigation() {
69
+ return this.oNavHandler.parseNavigation();
70
+ }
71
+ /**
72
+ * Processes navigation-related tasks related to beforePopoverOpens event handling for the SmartLink control and returns a Promise object.
73
+ *
74
+ * @param {object} oTableEventParameters The parameters made available by the SmartTable control when the SmartLink control has been clicked,
75
+ * an instance of a PopOver object
76
+ * @param {string} sSelectionVariant Stringified JSON object as returned, for example, from getDataSuiteFormat() of the SmartFilterBar control
77
+ * @param {object} [mInnerAppData] Object containing the current state of the app. If provided, opening the Popover is deferred until the
78
+ * inner app data is saved in a consistent way.
79
+ * @returns {Promise} A Promise object to monitor when all actions of the function have been executed; if the execution is successful, the
80
+ * modified oTableEventParameters is returned; if an error occurs, an error object of type
81
+ * {@link sap.fe.navigation.NavError} is returned
82
+ * @private
83
+ */
84
+ _processBeforeSmartLinkPopoverOpens(oTableEventParameters: object, sSelectionVariant: string, mInnerAppData: object | undefined) {
85
+ return this.oNavHandler.processBeforeSmartLinkPopoverOpens(oTableEventParameters, sSelectionVariant, mInnerAppData);
86
+ }
87
+
88
+ /**
89
+ * Processes selectionVariant string and returns a Promise object (semanticAttributes and AppStateKey).
90
+ * @param {string} sSelectionVariant Stringified JSON object
91
+ * @returns {object} A Promise object to monitor when all actions of the function have been executed; if the execution is successful, the
92
+ * semanticAttributes as well as the appStateKey are returned; if an error occurs, an error object of type
93
+ * {@link sap.fe.navigation.NavError} is returned
94
+ * <br>
95
+ * @example <code>
96
+ *
97
+ * var oSelectionVariant = new sap.fe.navigation.SelectionVariant();
98
+ * oSelectionVariant.addSelectOption("CompanyCode", "I", "EQ", "0001");
99
+ * oSelectionVariant.addSelectOption("Customer", "I", "EQ", "C0001");
100
+ * var sSelectionVariant= oSelectionVariant.toJSONString();
101
+ *
102
+ * var oNavigationHandler = new sap.fe.navigation.NavigationHandler(oController);
103
+ * var oPromiseObject = oNavigationHandler._getAppStateKeyAndUrlParameters(sSelectionVariant);
104
+ *
105
+ * oPromiseObject.done(function(oSemanticAttributes, sAppStateKey){
106
+ * // here you can add coding that should run after all app state and the semantic attributes have been returned.
107
+ * });
108
+ *
109
+ * oPromiseObject.fail(function(oError){
110
+ * //some error handling
111
+ * });
112
+ *
113
+ * </code>
114
+ * @private
115
+ * @ui5-restricted
116
+ */
117
+ getAppStateKeyAndUrlParameters(sSelectionVariant: string) {
118
+ return this.oNavHandler._getAppStateKeyAndUrlParameters(sSelectionVariant);
119
+ }
120
+
121
+ /**
122
+ * Gets the application specific technical parameters.
123
+ * @returns {Array} Containing the technical parameters.
124
+ * @private
125
+ * @ui5-restricted
126
+ */
127
+ getTechnicalParameters() {
128
+ return this.oNavHandler.getTechnicalParameters();
129
+ }
130
+ /**
131
+ * Sets the application specific technical parameters. Technical parameters will not be added to the selection variant passed to the
132
+ * application.
133
+ * As a default sap-system, sap-ushell-defaultedParameterNames and hcpApplicationId are considered as technical parameters.
134
+ * @param {Array} aTechnicalParameters List of parameter names to be considered as technical parameters. <code>null</code> or
135
+ * <code>undefined</code> may be used to reset the complete list.
136
+ * @private
137
+ * @ui5-restricted
138
+ */
139
+ setTechnicalParameters(aTechnicalParameters: any[]) {
140
+ this.oNavHandler.setTechnicalParameters(aTechnicalParameters);
141
+ }
142
+ /**
143
+ * Sets the model that is used for verification of sensitive information. If the model is not set, the unnamed component model is used for the
144
+ * verification of sensitive information.
145
+ * @private
146
+ * @ui5-restricted
147
+ * @param {sap.ui.model.odata.v2.ODataModel} oModel Model For checking sensitive information
148
+ */
149
+ setModel(oModel: any) {
150
+ this.oNavHandler.setModel(oModel);
151
+ }
152
+ /**
153
+ * Changes the URL according to the current app state and stores the app state for later retrieval.
154
+ * @private
155
+ * @ui5-restricted
156
+ * @param {object} mInnerAppData Object containing the current state of the app
157
+ * @returns {object} A Promise object to monitor when all the actions of the function have been executed; if the execution is successful, the
158
+ * app state key is returned; if an error occurs, an object of type {@link sap.fe.navigation.NavError} is
159
+ * returned
160
+ **/
161
+ storeInnerAppState(mInnerAppData: object) {
162
+ return this.oNavHandler.storeInnerAppState(mInnerAppData);
163
+ }
164
+ /**
165
+ * Changes the URL according to the current app state and stores the app state for later retrieval.
166
+ * @private
167
+ * @ui5-restricted
168
+ * @param {object} mInnerAppData Object containing the current state of the app
169
+ * @param {boolean} [bImmediateHashReplace=false] If set to false, the inner app hash will not be replaced until storing is successful; do not
170
+ * @param bNotLegacy
171
+
172
+ * @returns {object} An object containing the appStateId and a promise object to monitor when all the actions of the function have been
173
+ * executed; Please note that the appStateKey may be undefined or empty.
174
+ */
175
+ storeInnerAppStateWithImmediateReturn(mInnerAppData: object, bImmediateHashReplace: boolean | undefined, bNotLegacy: any) {
176
+ return this.oNavHandler.storeInnerAppStateWithImmediateReturn(mInnerAppData, bImmediateHashReplace, bNotLegacy);
177
+ }
178
+ /**
179
+ * Changes the URL according to the current sAppStateKey. As an reaction route change event will be triggered.
180
+ * @private
181
+ * @ui5-restricted
182
+ * @param {string} sAppStateKey The new app state key.
183
+ */
184
+ replaceHash(sAppStateKey: string) {
185
+ this.oNavHandler.replaceHash(sAppStateKey);
186
+ }
187
+ replaceInnerAppStateKey(sAppHash: any, sAppStateKey: any) {
188
+ return this.oNavHandler._replaceInnerAppStateKey(sAppHash, sAppStateKey);
189
+ }
190
+ /**
191
+ * Get single values from SelectionVariant for url parameters.
192
+ *
193
+ * @private
194
+ * @ui5-restricted
195
+ * @param {object | string } [vSelectionVariant]
196
+ * @param {object} [vSelectionVariant.oUrlParamaters]
197
+ * @returns {pbject}
198
+ */
199
+ getUrlParametersFromSelectionVariant(vSelectionVariant: string | object | undefined) {
200
+ return this.oNavHandler._getURLParametersFromSelectionVariant(vSelectionVariant);
201
+ }
202
+
203
+ /**
204
+ * Save app state and return immediately without waiting for response.
205
+ *
206
+ * @private
207
+ * @ui5-restricted
208
+ * @param {object} oInSelectionVariant Instance of sap.fe.navigation.SelectionVariant
209
+ * @returns {string} AppState key
210
+ */
211
+ saveAppStateWithImmediateReturn(oInSelectionVariant: SelectionVariant) {
212
+ if (oInSelectionVariant) {
213
+ const sSelectionVariant = oInSelectionVariant.toJSONString(), // create an SV for app state in string format
214
+ oSelectionVariant = JSON.parse(sSelectionVariant), // convert string into JSON to store in AppState
215
+ oXAppStateObject = {
216
+ selectionVariant: oSelectionVariant
217
+ },
218
+ oReturn = this.oNavHandler._saveAppStateWithImmediateReturn(oXAppStateObject);
219
+ return oReturn.appStateKey ? oReturn.appStateKey : "";
220
+ }
221
+ }
222
+
223
+ /**
224
+ * Mix Attributes and selectionVariant.
225
+ *
226
+ * @param {object|Array} vSemanticAttributes Object/(Array of Objects) containing key/value pairs
227
+ * @param {string} sSelectionVariant The selection variant in string format as provided by the SmartFilterBar control
228
+ * @param {int} [iSuppressionBehavior=sap.fe.navigation.SuppressionBehavior.standard] Indicates whether semantic
229
+ * attributes with special values (see {@link sap.fe.navigation.SuppressionBehavior suppression behavior}) must be
230
+ * suppressed before they are combined with the selection variant; several
231
+ * {@link sap.fe.navigation.SuppressionBehavior suppression behaviors} can be combined with the bitwise OR operator
232
+ * (|)
233
+ * @returns {object} Instance of {@link sap.fe.navigation.SelectionVariant}
234
+ */
235
+ mixAttributesAndSelectionVariant(vSemanticAttributes: object | any[], sSelectionVariant: string, iSuppressionBehavior?: number) {
236
+ return this.oNavHandler.mixAttributesAndSelectionVariant(vSemanticAttributes, sSelectionVariant, iSuppressionBehavior);
237
+ }
238
+
239
+ /**
240
+ * The method creates a context url based on provided data. This context url can either be used as.
241
+ *
242
+ * @param {string} sEntitySetName Used for url determination
243
+ * @param [oModel] The ODataModel used for url determination. If omitted, the NavigationHandler model is used.
244
+ * @returns {string} The context url for the given entities
245
+ */
246
+ constructContextUrl(sEntitySetName: string, oModel: any) {
247
+ return this.oNavHandler.constructContextUrl(sEntitySetName, oModel);
248
+ }
249
+ getInterface() {
250
+ return this;
251
+ }
252
+ }
253
+ function fnGetEmptyObject() {
254
+ return {};
255
+ }
256
+
257
+ function fnGetPromise() {
258
+ return Promise.resolve({});
259
+ }
260
+
261
+ function fnGetJQueryPromise() {
262
+ const oMyDeffered = jQuery.Deferred();
263
+ oMyDeffered.resolve({}, {}, "initial");
264
+ return oMyDeffered.promise();
265
+ }
266
+
267
+ function fnGetEmptyString() {
268
+ return "";
269
+ }
270
+ export class NavigationServicesMock {
271
+ initPromise: Promise<any>;
272
+ constructor() {
273
+ this.initPromise = Promise.resolve(this);
274
+ }
275
+
276
+ getInterface() {
277
+ return this;
278
+ }
279
+
280
+ // return empty object
281
+ createEmptyAppState = fnGetEmptyObject;
282
+ storeInnerAppStateWithImmediateReturn = fnGetEmptyObject;
283
+ mixAttributesAndSelectionVariant = fnGetEmptyObject;
284
+
285
+ // return promise
286
+ getAppState = fnGetPromise;
287
+ getStartupAppState = fnGetPromise;
288
+ parseNavigation = fnGetJQueryPromise;
289
+
290
+ // return empty string
291
+ constructContextUrl = fnGetEmptyString;
292
+
293
+ replaceInnerAppStateKey(sAppHash: any) {
294
+ return sAppHash ? sAppHash : "";
295
+ }
296
+
297
+ navigate() {
298
+ // Don't do anything
299
+ }
300
+ }
301
+
302
+ class NavigationServiceFactory extends ServiceFactory<NavigationServiceSettings> {
303
+ createInstance(oServiceContext: ServiceContext<NavigationServiceSettings>) {
304
+ const oNavigationService =
305
+ sap.ushell && sap.ushell.Container ? new NavigationService(oServiceContext) : new NavigationServicesMock();
306
+ // Wait For init
307
+ return oNavigationService.initPromise.then(function(oService: any) {
308
+ return oService;
309
+ });
310
+ }
311
+ }
312
+
313
+ export default NavigationServiceFactory;
@@ -1,83 +1,116 @@
1
1
  /*!
2
- * SAPUI5
3
- * (c) Copyright 2009-2021 SAP SE. All rights reserved.
2
+ * SAP UI development toolkit for HTML5 (SAPUI5)
3
+ * (c) Copyright 2009-2021 SAP SE. All rights reserved
4
4
  */
5
- sap.ui.define(
6
- [
7
- "sap/ui/core/service/Service",
8
- "sap/ui/core/service/ServiceFactory",
9
- "sap/ui/model/resource/ResourceModel",
10
- "sap/base/i18n/ResourceBundle"
11
- ],
12
- function(Service, ServiceFactory, ResourceModel, ResourceBundle) {
13
- "use strict";
14
-
15
- var ResourceModelService = Service.extend("sap.fe.core.services.ResourceModelService", {
16
- initPromise: Promise.resolve(),
17
- init: function() {
18
- var oContext = this.getContext();
19
- var mSettings = oContext.settings;
20
- this.oFactory = oContext.factory;
21
-
22
- // When enhancing i18n keys the value in the last resource bundle takes precedence
23
- // hence arrange various resource bundles so that enhanceI18n provided by the application is the last.
24
- // The following order is used :
25
- // 1. sap.fe bundle - sap.fe.core.messagebundle (passed with mSettings.bundles)
26
- // 2. sap.fe bundle - sap.fe.templates.messagebundle (passed with mSettings.bundles)
27
- // 3. Multiple bundles passed by the application as part of enhanceI18n
28
- var aBundles = mSettings.bundles.concat(mSettings.enhanceI18n || []).map(function(vI18n) {
29
- // if value passed for enhanceI18n is a Resource Model, return the associated bundle
30
- // else the value is a bundleUrl, return Resource Bundle configuration so that a bundle can be created
31
- return typeof vI18n.isA === "function" && vI18n.isA("sap.ui.model.resource.ResourceModel")
32
- ? vI18n.getResourceBundle()
33
- : { bundleName: vI18n.replace(/\//g, ".") };
34
- });
35
-
36
- this.oResourceModel = new ResourceModel({
37
- bundleName: aBundles[0].bundleName,
38
- enhanceWith: aBundles.slice(1),
39
- async: true
40
- });
41
-
42
- if (oContext.scopeType === "component") {
43
- var oComponent = oContext.scopeObject;
44
- oComponent.setModel(this.oResourceModel, mSettings.modelName);
45
- }
46
-
47
- this.initPromise = this.oResourceModel.getResourceBundle().then(
48
- function(oBundle) {
49
- this.oResourceModel.__bundle = oBundle;
50
- return this;
51
- }.bind(this)
52
- );
53
- },
54
-
55
- getResourceModel: function() {
56
- return this.oResourceModel;
57
- },
58
- exit: function() {
59
- // Deregister global instance
60
- this.oFactory.removeGlobalInstance();
61
- }
62
- });
63
-
64
- return ServiceFactory.extend("sap.fe.core.services.ResourceModelServiceFactory", {
65
- _oInstances: {},
66
- createInstance: function(oServiceContext) {
67
- var sKey =
68
- oServiceContext.settings.bundles.join(",") +
69
- (oServiceContext.settings.enhanceI18n ? "," + oServiceContext.settings.enhanceI18n.join(",") : "");
70
-
71
- if (!this._oInstances[sKey]) {
72
- this._oInstances[sKey] = new ResourceModelService(Object.assign({ factory: this }, oServiceContext));
73
- }
74
-
75
- return this._oInstances[sKey].initPromise;
76
- },
77
- removeGlobalInstance: function() {
78
- this._oInstances = {};
79
- }
80
- });
81
- },
82
- true
83
- );
5
+ sap.ui.define(["sap/ui/core/service/Service", "sap/ui/core/service/ServiceFactory", "sap/ui/model/resource/ResourceModel"], function (Service, ServiceFactory, ResourceModel) {
6
+ "use strict";
7
+
8
+ var _exports = {};
9
+
10
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
11
+
12
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13
+
14
+ var ResourceModelService = /*#__PURE__*/function (_Service) {
15
+ _inherits(ResourceModelService, _Service);
16
+
17
+ function ResourceModelService() {
18
+ return _Service.apply(this, arguments) || this;
19
+ }
20
+
21
+ _exports.ResourceModelService = ResourceModelService;
22
+ var _proto = ResourceModelService.prototype;
23
+
24
+ _proto.init = function init() {
25
+ var _this = this;
26
+
27
+ var oContext = this.getContext();
28
+ var mSettings = oContext.settings;
29
+ this.oFactory = oContext.factory; // When enhancing i18n keys the value in the last resource bundle takes precedence
30
+ // hence arrange various resource bundles so that enhanceI18n provided by the application is the last.
31
+ // The following order is used :
32
+ // 1. sap.fe bundle - sap.fe.core.messagebundle (passed with mSettings.bundles)
33
+ // 2. sap.fe bundle - sap.fe.templates.messagebundle (passed with mSettings.bundles)
34
+ // 3. Multiple bundles passed by the application as part of enhanceI18n
35
+
36
+ var aBundles = mSettings.bundles.concat(mSettings.enhanceI18n || []).map(function (vI18n) {
37
+ // if value passed for enhanceI18n is a Resource Model, return the associated bundle
38
+ // else the value is a bundleUrl, return Resource Bundle configuration so that a bundle can be created
39
+ return typeof vI18n.isA === "function" && vI18n.isA("sap.ui.model.resource.ResourceModel") ? vI18n.getResourceBundle() : {
40
+ bundleName: vI18n.replace(/\//g, ".")
41
+ };
42
+ });
43
+ this.oResourceModel = new ResourceModel({
44
+ bundleName: aBundles[0].bundleName,
45
+ enhanceWith: aBundles.slice(1),
46
+ async: true
47
+ });
48
+
49
+ if (oContext.scopeType === "component") {
50
+ var oComponent = oContext.scopeObject;
51
+ oComponent.setModel(this.oResourceModel, mSettings.modelName);
52
+ }
53
+
54
+ this.initPromise = Promise.all([this.oResourceModel.getResourceBundle(), this.oResourceModel._pEnhanced || Promise.resolve()]).then(function (oBundle) {
55
+ _this.oResourceModel.__bundle = oBundle[0];
56
+ return _this;
57
+ });
58
+ };
59
+
60
+ _proto.getResourceModel = function getResourceModel() {
61
+ return this.oResourceModel;
62
+ };
63
+
64
+ _proto.getInterface = function getInterface() {
65
+ return this;
66
+ };
67
+
68
+ _proto.exit = function exit() {
69
+ // Deregister global instance
70
+ this.oFactory.removeGlobalInstance();
71
+ };
72
+
73
+ return ResourceModelService;
74
+ }(Service);
75
+
76
+ _exports.ResourceModelService = ResourceModelService;
77
+
78
+ var ResourceModelServiceFactory = /*#__PURE__*/function (_ServiceFactory) {
79
+ _inherits(ResourceModelServiceFactory, _ServiceFactory);
80
+
81
+ function ResourceModelServiceFactory() {
82
+ var _this2;
83
+
84
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
85
+ args[_key] = arguments[_key];
86
+ }
87
+
88
+ _this2 = _ServiceFactory.call.apply(_ServiceFactory, [this].concat(args)) || this;
89
+ _this2._oInstances = {};
90
+ return _this2;
91
+ }
92
+
93
+ var _proto2 = ResourceModelServiceFactory.prototype;
94
+
95
+ _proto2.createInstance = function createInstance(oServiceContext) {
96
+ var sKey = oServiceContext.settings.bundles.join(",") + (oServiceContext.settings.enhanceI18n ? "," + oServiceContext.settings.enhanceI18n.join(",") : "");
97
+
98
+ if (!this._oInstances[sKey]) {
99
+ this._oInstances[sKey] = new ResourceModelService(Object.assign({
100
+ factory: this
101
+ }, oServiceContext));
102
+ }
103
+
104
+ return this._oInstances[sKey].initPromise;
105
+ };
106
+
107
+ _proto2.removeGlobalInstance = function removeGlobalInstance() {
108
+ this._oInstances = {};
109
+ };
110
+
111
+ return ResourceModelServiceFactory;
112
+ }(ServiceFactory);
113
+
114
+ return ResourceModelServiceFactory;
115
+ }, false);
116
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlJlc291cmNlTW9kZWxTZXJ2aWNlRmFjdG9yeS50cyJdLCJuYW1lcyI6WyJSZXNvdXJjZU1vZGVsU2VydmljZSIsImluaXQiLCJvQ29udGV4dCIsImdldENvbnRleHQiLCJtU2V0dGluZ3MiLCJzZXR0aW5ncyIsIm9GYWN0b3J5IiwiZmFjdG9yeSIsImFCdW5kbGVzIiwiYnVuZGxlcyIsImNvbmNhdCIsImVuaGFuY2VJMThuIiwibWFwIiwidkkxOG4iLCJpc0EiLCJnZXRSZXNvdXJjZUJ1bmRsZSIsImJ1bmRsZU5hbWUiLCJyZXBsYWNlIiwib1Jlc291cmNlTW9kZWwiLCJSZXNvdXJjZU1vZGVsIiwiZW5oYW5jZVdpdGgiLCJzbGljZSIsImFzeW5jIiwic2NvcGVUeXBlIiwib0NvbXBvbmVudCIsInNjb3BlT2JqZWN0Iiwic2V0TW9kZWwiLCJtb2RlbE5hbWUiLCJpbml0UHJvbWlzZSIsIlByb21pc2UiLCJhbGwiLCJfcEVuaGFuY2VkIiwicmVzb2x2ZSIsInRoZW4iLCJvQnVuZGxlIiwiX19idW5kbGUiLCJnZXRSZXNvdXJjZU1vZGVsIiwiZ2V0SW50ZXJmYWNlIiwiZXhpdCIsInJlbW92ZUdsb2JhbEluc3RhbmNlIiwiU2VydmljZSIsIlJlc291cmNlTW9kZWxTZXJ2aWNlRmFjdG9yeSIsIl9vSW5zdGFuY2VzIiwiY3JlYXRlSW5zdGFuY2UiLCJvU2VydmljZUNvbnRleHQiLCJzS2V5Iiwiam9pbiIsIk9iamVjdCIsImFzc2lnbiIsIlNlcnZpY2VGYWN0b3J5Il0sIm1hcHBpbmdzIjoiO0FBQUE7QUFDQTtBQUNBOzs7Ozs7Ozs7O01BT2FBLG9COzs7Ozs7Ozs7O1dBSVpDLEksR0FBQSxnQ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29udGV4dDogU2VydmljZUNvbnRleHQ8UmVzb3VyY2VNb2RlbFNlcnZpY2VTZXR0aW5ncz4pIHtcblx0XHRjb25zdCBzS2V5ID1cblx0XHRcdG9TZXJ2aWNlQ29udGV4dC5zZXR0aW5ncy5idW5kbGVzLmpvaW4oXCIsXCIpICtcblx0XHRcdChvU2VydmljZUNvbnRleHQuc2V0dGluZ3MuZW5oYW5jZUkxOG4gPyBcIixcIiArIG9TZXJ2aWNlQ29udGV4dC5zZXR0aW5ncy5lbmhhbmNlSTE4bi5qb2luKFwiLFwiKSA6IFwiXCIpO1xuXG5cdFx0aWYgKCF0aGlzLl9vSW5zdGFuY2VzW3NLZXldKSB7XG5cdFx0XHR0aGlzLl9vSW5zdGFuY2VzW3NLZXldID0gbmV3IFJlc291cmNlTW9kZWxTZXJ2aWNlKE9iamVjdC5hc3NpZ24oeyBmYWN0b3J5OiB0aGlzIH0sIG9TZXJ2aWNlQ29udGV4dCkpO1xuXHRcdH1cblxuXHRcdHJldHVybiB0aGlzLl9vSW5zdGFuY2VzW3NLZXldLmluaXRQcm9taXNlO1xuXHR9XG5cdHJlbW92ZUdsb2JhbEluc3RhbmNlKCkge1xuXHRcdHRoaXMuX29JbnN0YW5jZXMgPSB7fTtcblx0fVxufVxuXG5leHBvcnQgZGVmYXVsdCBSZXNvdXJjZU1vZGVsU2VydmljZUZhY3Rvcnk7XG4iXX0=
@@ -0,0 +1,83 @@
1
+ import Service from "sap/ui/core/service/Service";
2
+ import ServiceFactory from "sap/ui/core/service/ServiceFactory";
3
+ import ResourceModel from "sap/ui/model/resource/ResourceModel";
4
+ import ResourceBundle from "sap/base/i18n/ResourceBundle";
5
+ import { ServiceContext } from "sap/ui/core/service";
6
+ type ResourceModelServiceSettings = {
7
+ bundles: ResourceBundle[];
8
+ enhanceI18n: string[];
9
+ };
10
+ export class ResourceModelService extends Service<ResourceModelServiceSettings> {
11
+ initPromise!: Promise<any>;
12
+ oFactory!: ResourceModelServiceFactory;
13
+ oResourceModel!: ResourceModel;
14
+ init() {
15
+ const oContext = this.getContext();
16
+ const mSettings = oContext.settings;
17
+ this.oFactory = oContext.factory;
18
+
19
+ // When enhancing i18n keys the value in the last resource bundle takes precedence
20
+ // hence arrange various resource bundles so that enhanceI18n provided by the application is the last.
21
+ // The following order is used :
22
+ // 1. sap.fe bundle - sap.fe.core.messagebundle (passed with mSettings.bundles)
23
+ // 2. sap.fe bundle - sap.fe.templates.messagebundle (passed with mSettings.bundles)
24
+ // 3. Multiple bundles passed by the application as part of enhanceI18n
25
+ const aBundles = mSettings.bundles.concat(mSettings.enhanceI18n || []).map(function(vI18n: any) {
26
+ // if value passed for enhanceI18n is a Resource Model, return the associated bundle
27
+ // else the value is a bundleUrl, return Resource Bundle configuration so that a bundle can be created
28
+ return typeof vI18n.isA === "function" && vI18n.isA("sap.ui.model.resource.ResourceModel")
29
+ ? vI18n.getResourceBundle()
30
+ : { bundleName: vI18n.replace(/\//g, ".") };
31
+ });
32
+
33
+ this.oResourceModel = new ResourceModel({
34
+ bundleName: aBundles[0].bundleName,
35
+ enhanceWith: aBundles.slice(1),
36
+ async: true
37
+ });
38
+
39
+ if (oContext.scopeType === "component") {
40
+ const oComponent = oContext.scopeObject;
41
+ oComponent.setModel(this.oResourceModel, mSettings.modelName);
42
+ }
43
+
44
+ this.initPromise = Promise.all([
45
+ this.oResourceModel.getResourceBundle() as Promise<ResourceBundle>,
46
+ (this.oResourceModel as any)._pEnhanced || Promise.resolve()
47
+ ]).then((oBundle: any[]) => {
48
+ (this.oResourceModel as any).__bundle = oBundle[0];
49
+ return this;
50
+ });
51
+ }
52
+
53
+ getResourceModel() {
54
+ return this.oResourceModel;
55
+ }
56
+ getInterface(): any {
57
+ return this;
58
+ }
59
+ exit() {
60
+ // Deregister global instance
61
+ this.oFactory.removeGlobalInstance();
62
+ }
63
+ }
64
+
65
+ class ResourceModelServiceFactory extends ServiceFactory<ResourceModelServiceSettings> {
66
+ _oInstances: Record<string, ResourceModelService> = {};
67
+ createInstance(oServiceContext: ServiceContext<ResourceModelServiceSettings>) {
68
+ const sKey =
69
+ oServiceContext.settings.bundles.join(",") +
70
+ (oServiceContext.settings.enhanceI18n ? "," + oServiceContext.settings.enhanceI18n.join(",") : "");
71
+
72
+ if (!this._oInstances[sKey]) {
73
+ this._oInstances[sKey] = new ResourceModelService(Object.assign({ factory: this }, oServiceContext));
74
+ }
75
+
76
+ return this._oInstances[sKey].initPromise;
77
+ }
78
+ removeGlobalInstance() {
79
+ this._oInstances = {};
80
+ }
81
+ }
82
+
83
+ export default ResourceModelServiceFactory;