@sapui5/sap.fe.core 1.97.0 → 1.99.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 (249) hide show
  1. package/package.json +5 -4
  2. package/src/sap/fe/core/.library +1 -1
  3. package/src/sap/fe/core/AnnotationHelper.js +377 -405
  4. package/src/sap/fe/core/AnnotationHelper.ts +385 -0
  5. package/src/sap/fe/core/AppComponent.js +6 -3
  6. package/src/sap/fe/core/AppStateHandler.js +229 -181
  7. package/src/sap/fe/core/AppStateHandler.ts +171 -0
  8. package/src/sap/fe/core/BaseController.js +3 -2
  9. package/src/sap/fe/core/BusyLocker.js +105 -121
  10. package/src/sap/fe/core/BusyLocker.ts +98 -0
  11. package/src/sap/fe/core/CommonUtils.js +2073 -2379
  12. package/src/sap/fe/core/CommonUtils.ts +2078 -0
  13. package/src/sap/fe/core/ExtensionAPI.js +16 -7
  14. package/src/sap/fe/core/PageController.js +84 -119
  15. package/src/sap/fe/core/PageController.ts +101 -0
  16. package/src/sap/fe/core/RouterProxy.js +986 -807
  17. package/src/sap/fe/core/RouterProxy.ts +838 -0
  18. package/src/sap/fe/core/Synchronization.js +51 -35
  19. package/src/sap/fe/core/Synchronization.ts +29 -0
  20. package/src/sap/fe/core/TemplateComponent.js +173 -155
  21. package/src/sap/fe/core/TemplateComponent.ts +166 -0
  22. package/src/sap/fe/core/TemplateModel.js +97 -54
  23. package/src/sap/fe/core/TemplateModel.ts +64 -0
  24. package/src/sap/fe/core/TransactionHelper.js +1576 -1579
  25. package/src/sap/fe/core/TransactionHelper.ts +1706 -0
  26. package/src/sap/fe/core/actions/draft.js +560 -581
  27. package/src/sap/fe/core/actions/draft.ts +594 -0
  28. package/src/sap/fe/core/actions/messageHandling.js +545 -511
  29. package/src/sap/fe/core/actions/messageHandling.ts +532 -0
  30. package/src/sap/fe/core/actions/nonDraft.js +17 -19
  31. package/src/sap/fe/core/actions/nonDraft.ts +12 -0
  32. package/src/sap/fe/core/actions/operations.js +1074 -1211
  33. package/src/sap/fe/core/actions/operations.ts +1162 -0
  34. package/src/sap/fe/core/actions/sticky.js +102 -105
  35. package/src/sap/fe/core/actions/sticky.ts +102 -0
  36. package/src/sap/fe/core/controllerextensions/ControllerExtensionMetadata.js +3 -2
  37. package/src/sap/fe/core/controllerextensions/EditFlow.js +229 -260
  38. package/src/sap/fe/core/controllerextensions/IntentBasedNavigation.js +3 -2
  39. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +288 -13
  40. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +27 -23
  41. package/src/sap/fe/core/controllerextensions/InternalRouting.js +82 -46
  42. package/src/sap/fe/core/controllerextensions/KPIManagement.js +113 -25
  43. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +135 -44
  44. package/src/sap/fe/core/controllerextensions/MassEdit.js +172 -0
  45. package/src/sap/fe/core/controllerextensions/MessageHandler.js +22 -9
  46. package/src/sap/fe/core/controllerextensions/PageReady.js +3 -3
  47. package/src/sap/fe/core/controllerextensions/PageReady.ts +12 -8
  48. package/src/sap/fe/core/controllerextensions/Paginator.js +37 -9
  49. package/src/sap/fe/core/controllerextensions/Placeholder.js +8 -4
  50. package/src/sap/fe/core/controllerextensions/Routing.js +25 -5
  51. package/src/sap/fe/core/controllerextensions/RoutingListener.js +3 -2
  52. package/src/sap/fe/core/controllerextensions/Share.js +22 -8
  53. package/src/sap/fe/core/controllerextensions/SideEffects.js +9 -9
  54. package/src/sap/fe/core/controllerextensions/SideEffects.ts +22 -21
  55. package/src/sap/fe/core/controllerextensions/ViewState.js +3 -2
  56. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +2 -1
  57. package/src/sap/fe/core/controls/CommandExecution.js +3 -2
  58. package/src/sap/fe/core/controls/ConditionalWrapper.js +3 -2
  59. package/src/sap/fe/core/controls/CustomQuickViewPage.js +3 -2
  60. package/src/sap/fe/core/controls/DataLossOrDraftDiscard/DataLossOrDraftDiscardHandler.js +9 -5
  61. package/src/sap/fe/core/controls/FieldWrapper.js +18 -23
  62. package/src/sap/fe/core/controls/FilterBar.js +3 -2
  63. package/src/sap/fe/core/controls/FormElementWrapper.js +3 -7
  64. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +3 -2
  65. package/src/sap/fe/core/controls/NonComputedVisibleKeyFieldsDialog.fragment.xml +2 -1
  66. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +3 -2
  67. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +5 -4
  68. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +3 -2
  69. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +3 -2
  70. package/src/sap/fe/core/controls/massEdit/MassEditDialog.fragment.xml +106 -0
  71. package/src/sap/fe/core/controls/massEdit/MassEditHandlers.js +79 -0
  72. package/src/sap/fe/core/converters/ConverterContext.js +14 -2
  73. package/src/sap/fe/core/converters/ConverterContext.ts +14 -3
  74. package/src/sap/fe/core/converters/ManifestSettings.js +1 -1
  75. package/src/sap/fe/core/converters/ManifestSettings.ts +4 -0
  76. package/src/sap/fe/core/converters/ManifestWrapper.js +56 -32
  77. package/src/sap/fe/core/converters/ManifestWrapper.ts +24 -6
  78. package/src/sap/fe/core/converters/MetaModelConverter.js +67 -6
  79. package/src/sap/fe/core/converters/MetaModelConverter.ts +70 -14
  80. package/src/sap/fe/core/converters/TemplateConverter.js +1 -1
  81. package/src/sap/fe/core/converters/TemplateConverter.ts +2 -2
  82. package/src/sap/fe/core/converters/annotations/DataField.js +3 -3
  83. package/src/sap/fe/core/converters/annotations/DataField.ts +1 -1
  84. package/src/sap/fe/core/converters/common/AnnotationConverter.js +33 -21
  85. package/src/sap/fe/core/converters/controls/Common/Action.js +11 -2
  86. package/src/sap/fe/core/converters/controls/Common/Action.ts +8 -2
  87. package/src/sap/fe/core/converters/controls/Common/Chart.js +5 -3
  88. package/src/sap/fe/core/converters/controls/Common/Chart.ts +11 -3
  89. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +3 -3
  90. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +2 -2
  91. package/src/sap/fe/core/converters/controls/Common/Form.js +20 -10
  92. package/src/sap/fe/core/converters/controls/Common/Form.ts +24 -4
  93. package/src/sap/fe/core/converters/controls/Common/KPI.js +69 -4
  94. package/src/sap/fe/core/converters/controls/Common/KPI.ts +72 -0
  95. package/src/sap/fe/core/converters/controls/Common/Table.js +390 -398
  96. package/src/sap/fe/core/converters/controls/Common/Table.ts +497 -484
  97. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.js +527 -0
  98. package/src/sap/fe/core/converters/controls/Common/table/StandardActions.ts +655 -0
  99. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +489 -37
  100. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +506 -58
  101. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +2 -2
  102. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +1 -1
  103. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +17 -9
  104. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +24 -9
  105. package/src/sap/fe/core/converters/helpers/Aggregation.js +18 -3
  106. package/src/sap/fe/core/converters/helpers/Aggregation.ts +28 -5
  107. package/src/sap/fe/core/converters/helpers/IssueManager.js +7 -1
  108. package/src/sap/fe/core/converters/helpers/IssueManager.ts +6 -0
  109. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +4 -4
  110. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +3 -3
  111. package/src/sap/fe/core/converters/templates/ListReportConverter.js +13 -6
  112. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +26 -15
  113. package/src/sap/fe/core/designtime/AppComponent.designtime.js +11 -2
  114. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  115. package/src/sap/fe/core/formatters/CriticalityFormatter.ts +1 -1
  116. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  117. package/src/sap/fe/core/formatters/FPMFormatter.ts +4 -10
  118. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  119. package/src/sap/fe/core/formatters/KPIFormatter.ts +3 -1
  120. package/src/sap/fe/core/formatters/TableFormatter.js +39 -28
  121. package/src/sap/fe/core/formatters/TableFormatter.ts +43 -28
  122. package/src/sap/fe/core/formatters/ValueFormatter.js +30 -5
  123. package/src/sap/fe/core/formatters/ValueFormatter.ts +30 -7
  124. package/src/sap/fe/core/fpm/Component.js +3 -2
  125. package/src/sap/fe/core/helpers/AppStartupHelper.js +359 -0
  126. package/src/sap/fe/core/helpers/AppStartupHelper.ts +391 -0
  127. package/src/sap/fe/core/helpers/BindingExpression.js +484 -437
  128. package/src/sap/fe/core/helpers/BindingExpression.ts +480 -463
  129. package/src/sap/fe/core/helpers/ClassSupport.js +27 -15
  130. package/src/sap/fe/core/helpers/ClassSupport.ts +31 -20
  131. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.js +63 -59
  132. package/src/sap/fe/core/helpers/DynamicAnnotationPathHelper.ts +56 -0
  133. package/src/sap/fe/core/helpers/EditState.js +81 -84
  134. package/src/sap/fe/core/helpers/EditState.ts +81 -0
  135. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +62 -48
  136. package/src/sap/fe/core/helpers/ExcelFormatHelper.ts +49 -0
  137. package/src/sap/fe/core/helpers/FPMHelper.js +52 -56
  138. package/src/sap/fe/core/helpers/FPMHelper.ts +62 -0
  139. package/src/sap/fe/core/helpers/KeepAliveHelper.js +4 -5
  140. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +10 -10
  141. package/src/sap/fe/core/helpers/MassEditHelper.js +687 -0
  142. package/src/sap/fe/core/helpers/ModelHelper.js +229 -225
  143. package/src/sap/fe/core/helpers/ModelHelper.ts +227 -0
  144. package/src/sap/fe/core/helpers/PasteHelper.js +210 -132
  145. package/src/sap/fe/core/helpers/PasteHelper.ts +196 -0
  146. package/src/sap/fe/core/helpers/SemanticDateOperators.js +332 -313
  147. package/src/sap/fe/core/helpers/SemanticDateOperators.ts +330 -0
  148. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +66 -67
  149. package/src/sap/fe/core/helpers/SemanticKeyHelper.ts +73 -0
  150. package/src/sap/fe/core/helpers/StableIdHelper.js +4 -7
  151. package/src/sap/fe/core/helpers/StableIdHelper.ts +2 -6
  152. package/src/sap/fe/core/jsx-runtime/jsx.js +1 -1
  153. package/src/sap/fe/core/jsx-runtime/jsx.ts +1 -1
  154. package/src/sap/fe/core/library.js +30 -3
  155. package/src/sap/fe/core/library.support.js +12 -5
  156. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.js +62 -0
  157. package/src/sap/fe/core/manifestMerger/ChangePageConfiguration.ts +66 -0
  158. package/src/sap/fe/core/messagebundle.properties +61 -13
  159. package/src/sap/fe/core/messagebundle_ar.properties +33 -2
  160. package/src/sap/fe/core/messagebundle_bg.properties +33 -2
  161. package/src/sap/fe/core/messagebundle_ca.properties +33 -2
  162. package/src/sap/fe/core/messagebundle_cs.properties +34 -3
  163. package/src/sap/fe/core/messagebundle_cy.properties +33 -2
  164. package/src/sap/fe/core/messagebundle_da.properties +33 -2
  165. package/src/sap/fe/core/messagebundle_de.properties +33 -2
  166. package/src/sap/fe/core/messagebundle_el.properties +33 -2
  167. package/src/sap/fe/core/messagebundle_en.properties +32 -1
  168. package/src/sap/fe/core/messagebundle_en_GB.properties +32 -1
  169. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +36 -1
  170. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +33 -2
  171. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +33 -2
  172. package/src/sap/fe/core/messagebundle_es.properties +33 -2
  173. package/src/sap/fe/core/messagebundle_es_MX.properties +33 -2
  174. package/src/sap/fe/core/messagebundle_et.properties +33 -2
  175. package/src/sap/fe/core/messagebundle_fi.properties +34 -3
  176. package/src/sap/fe/core/messagebundle_fr.properties +38 -7
  177. package/src/sap/fe/core/messagebundle_fr_CA.properties +33 -2
  178. package/src/sap/fe/core/messagebundle_hi.properties +33 -2
  179. package/src/sap/fe/core/messagebundle_hr.properties +33 -2
  180. package/src/sap/fe/core/messagebundle_hu.properties +34 -3
  181. package/src/sap/fe/core/messagebundle_id.properties +36 -5
  182. package/src/sap/fe/core/messagebundle_it.properties +33 -2
  183. package/src/sap/fe/core/messagebundle_iw.properties +33 -2
  184. package/src/sap/fe/core/messagebundle_ja.properties +33 -2
  185. package/src/sap/fe/core/messagebundle_kk.properties +33 -2
  186. package/src/sap/fe/core/messagebundle_ko.properties +33 -2
  187. package/src/sap/fe/core/messagebundle_lt.properties +33 -2
  188. package/src/sap/fe/core/messagebundle_lv.properties +33 -2
  189. package/src/sap/fe/core/messagebundle_ms.properties +33 -2
  190. package/src/sap/fe/core/messagebundle_nl.properties +33 -2
  191. package/src/sap/fe/core/messagebundle_no.properties +33 -2
  192. package/src/sap/fe/core/messagebundle_pl.properties +33 -2
  193. package/src/sap/fe/core/messagebundle_pt.properties +34 -3
  194. package/src/sap/fe/core/messagebundle_pt_PT.properties +33 -2
  195. package/src/sap/fe/core/messagebundle_ro.properties +33 -2
  196. package/src/sap/fe/core/messagebundle_ru.properties +33 -2
  197. package/src/sap/fe/core/messagebundle_sh.properties +33 -2
  198. package/src/sap/fe/core/messagebundle_sk.properties +33 -2
  199. package/src/sap/fe/core/messagebundle_sl.properties +33 -2
  200. package/src/sap/fe/core/messagebundle_sv.properties +34 -3
  201. package/src/sap/fe/core/messagebundle_th.properties +33 -2
  202. package/src/sap/fe/core/messagebundle_tr.properties +33 -2
  203. package/src/sap/fe/core/messagebundle_uk.properties +33 -2
  204. package/src/sap/fe/core/messagebundle_vi.properties +33 -2
  205. package/src/sap/fe/core/messagebundle_zh_CN.properties +33 -2
  206. package/src/sap/fe/core/messagebundle_zh_TW.properties +33 -2
  207. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +2 -2
  208. package/src/sap/fe/core/services/AsyncComponentServiceFactory.ts +3 -1
  209. package/src/sap/fe/core/services/CacheHandlerServiceFactory.js +269 -202
  210. package/src/sap/fe/core/services/CacheHandlerServiceFactory.ts +212 -0
  211. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +4 -3
  212. package/src/sap/fe/core/services/EnvironmentServiceFactory.ts +9 -5
  213. package/src/sap/fe/core/services/NavigationServiceFactory.js +406 -300
  214. package/src/sap/fe/core/services/NavigationServiceFactory.ts +316 -0
  215. package/src/sap/fe/core/services/ResourceModelServiceFactory.js +149 -81
  216. package/src/sap/fe/core/services/ResourceModelServiceFactory.ts +80 -0
  217. package/src/sap/fe/core/services/RoutingServiceFactory.js +987 -1152
  218. package/src/sap/fe/core/services/RoutingServiceFactory.ts +898 -0
  219. package/src/sap/fe/core/services/ShellServicesFactory.js +31 -2
  220. package/src/sap/fe/core/services/ShellServicesFactory.ts +45 -11
  221. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +42 -85
  222. package/src/sap/fe/core/services/SideEffectsServiceFactory.ts +57 -100
  223. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +461 -478
  224. package/src/sap/fe/core/services/TemplatedViewServiceFactory.ts +453 -0
  225. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.js +10 -8
  226. package/src/sap/fe/core/services/view/TemplatingErrorPage.controller.ts +8 -0
  227. package/src/sap/fe/core/support/AnnotationIssue.support.js +15 -3
  228. package/src/sap/fe/core/support/AnnotationIssue.support.ts +16 -2
  229. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -2
  230. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.ts +1 -1
  231. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.js +38 -0
  232. package/src/sap/fe/core/support/InvalidAnnotationColumnKey.support.ts +18 -0
  233. package/src/sap/fe/core/templating/DataModelPathHelper.js +10 -48
  234. package/src/sap/fe/core/templating/DataModelPathHelper.ts +14 -46
  235. package/src/sap/fe/core/templating/DisplayModeFormatter.js +114 -0
  236. package/src/sap/fe/core/templating/DisplayModeFormatter.ts +86 -0
  237. package/src/sap/fe/core/templating/FieldControlHelper.js +8 -8
  238. package/src/sap/fe/core/templating/FieldControlHelper.ts +25 -7
  239. package/src/sap/fe/core/templating/FilterHelper.js +139 -70
  240. package/src/sap/fe/core/templating/FilterHelper.ts +140 -70
  241. package/src/sap/fe/core/templating/PropertyHelper.js +2 -2
  242. package/src/sap/fe/core/templating/PropertyHelper.ts +1 -1
  243. package/src/sap/fe/core/templating/UIFormatters.js +45 -110
  244. package/src/sap/fe/core/templating/UIFormatters.ts +39 -75
  245. package/src/sap/fe/core/type/Email.js +1 -1
  246. package/src/sap/fe/core/type/Email.ts +4 -6
  247. package/ui5.yaml +0 -3
  248. package/src/sap/fe/core/controls/filterbar.d.js +0 -8
  249. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
@@ -0,0 +1,385 @@
1
+ import ODataModelAnnotationHelper from "sap/ui/model/odata/v4/AnnotationHelper";
2
+ import CommonUtils from "sap/fe/core/CommonUtils";
3
+ import mLibrary from "sap/m/library";
4
+ import { generate } from "sap/fe/core/helpers/StableIdHelper";
5
+ import ModelHelper from "sap/fe/core/helpers/ModelHelper";
6
+ import { compileBinding, fn, ref } from "sap/fe/core/helpers/BindingExpression";
7
+ import { UIAnnotationTerms, UIAnnotationTypes } from "@sap-ux/vocabularies-types";
8
+ const ButtonType = mLibrary.ButtonType;
9
+ const AnnotationHelper = {
10
+ /* this helper can be activated to debug template processing
11
+ debug: function (oContext) {
12
+ //debugger;
13
+ },
14
+ */
15
+
16
+ getTargetContext: function(oTarget: any) {
17
+ const sTarget = oTarget.getObject(oTarget.getPath()),
18
+ sNavigationPath = ODataModelAnnotationHelper.getNavigationPath(oTarget.getPath());
19
+ return sNavigationPath + "/" + sTarget;
20
+ },
21
+
22
+ getNavigationContext: function(oContext: any) {
23
+ return ODataModelAnnotationHelper.getNavigationPath(oContext.getPath());
24
+ },
25
+
26
+ /**
27
+ * Checks if the navigation collection is insertable.
28
+ *
29
+ * @function
30
+ * @static
31
+ * @name sap.fe.core.AnnotationHelper.getNavigationInsertableRestrictions
32
+ * @memberof sap.fe.core.AnnotationHelper
33
+ * @param oCollection
34
+ * @param {string} sCurrentCollectionName The name of the navigation collection
35
+ * @param {Array} aRestrictedProperties Array of RestrictedProperties of NavigationRestrictions of the root collection
36
+ * @param {boolean} bInsertable Insertable value of the navigation collection
37
+ * @param bCreationRow
38
+ * @returns {string} Expression if insertable or insertable path, false otherwise
39
+ * @private
40
+ * @ui5-restricted
41
+ */
42
+ getNavigationInsertableRestrictions: function(
43
+ oCollection: any,
44
+ sCurrentCollectionName: string,
45
+ aRestrictedProperties: any[],
46
+ bInsertable: boolean | any,
47
+ bCreationRow: any
48
+ ) {
49
+ // If insertable = true via NavigationRestriction of root collection, navigation collection is insertable
50
+ // If NOT insertable via NavigationRestriction of root collection, navigation collection is NOT insertable
51
+ // If insertable property is undefined for the NavigationRestrictions of the root collection,
52
+ // then insertable property of the navigation collection is considered.
53
+ // If insertable = true, navigation collection is insertable
54
+ // If insertable = false, navigation collection is NOT insertable
55
+ // If Insertable is undefined via navigation restriction of root collection
56
+ // and Insertable is undefined at navigation collection,
57
+ // then navigation collection is insertable.
58
+ let i,
59
+ oNavigationProperty,
60
+ sPath = "";
61
+ for (i in aRestrictedProperties) {
62
+ oNavigationProperty = aRestrictedProperties[i];
63
+ if (
64
+ oNavigationProperty.NavigationProperty.$NavigationPropertyPath === sCurrentCollectionName &&
65
+ oNavigationProperty.InsertRestrictions
66
+ ) {
67
+ if (oNavigationProperty.InsertRestrictions.Insertable && oNavigationProperty.InsertRestrictions.Insertable.$Path) {
68
+ if (bCreationRow) {
69
+ sPath = oCollection.$Partner + "/";
70
+ }
71
+ return (
72
+ "{= ${" + sPath + oNavigationProperty.InsertRestrictions.Insertable.$Path + "} && ${ui>/editMode} === 'Editable' }"
73
+ );
74
+ }
75
+ return oNavigationProperty.InsertRestrictions.Insertable ? "{= ${ui>/editMode} === 'Editable' }" : false;
76
+ }
77
+ }
78
+ if (bInsertable && bInsertable.$Path && bInsertable.$Path.indexOf("/") > -1) {
79
+ const aSplitInsertablePath = bInsertable.$Path.split("/");
80
+ const sNavigationPath = aSplitInsertablePath[0];
81
+ const sPartner = oCollection.$Partner;
82
+ if (sNavigationPath !== sPartner) {
83
+ // check for parent property
84
+ return "{= ${ui>/editMode} === 'Editable'}";
85
+ }
86
+ if (bCreationRow) {
87
+ sCurrentCollectionName = "";
88
+ } else {
89
+ sCurrentCollectionName = sCurrentCollectionName + "/";
90
+ }
91
+ return "{= ${ui>/editMode} === 'Editable' && ${" + sCurrentCollectionName + bInsertable.$Path + "}}";
92
+ }
93
+ return "{= " + (bInsertable !== false) + " && ${ui>/editMode} === 'Editable'}";
94
+ },
95
+ /**
96
+ * Checks if the footer is visible or not.
97
+ *
98
+ * @function
99
+ * @static
100
+ * @name sap.fe.core.AnnotationHelper.showFooter
101
+ * @memberof sap.fe.core.AnnotationHelper
102
+ * @param {Array} aDataFields Array of DataFields in the identification
103
+ * @param {boolean} bConsiderEditable Whether the edit mode binding is required or not
104
+ * @returns {string} An expression if all the actions are ui.hidden, true otherwise
105
+ * @private
106
+ * @ui5-restricted
107
+ **/
108
+ showFooter: function(aDataFields: any[], bConsiderEditable: boolean) {
109
+ let sHiddenExpression = "";
110
+ let sSemiHiddenExpression;
111
+ const aHiddenActionPath = [];
112
+
113
+ for (const i in aDataFields) {
114
+ const oDataField = aDataFields[i];
115
+ if (oDataField.$Type === UIAnnotationTypes.DataFieldForAction && oDataField.Determining === true) {
116
+ const hiddenExpression = oDataField[`@${UIAnnotationTerms.Hidden}`];
117
+ if (!hiddenExpression) {
118
+ return true;
119
+ } else if (hiddenExpression.$Path) {
120
+ if (aHiddenActionPath.indexOf(hiddenExpression.$Path) === -1) {
121
+ aHiddenActionPath.push(hiddenExpression.$Path);
122
+ }
123
+ }
124
+ }
125
+ }
126
+
127
+ if (aHiddenActionPath.length) {
128
+ for (let index = 0; index < aHiddenActionPath.length; index++) {
129
+ if (aHiddenActionPath[index]) {
130
+ sSemiHiddenExpression = "(%{" + aHiddenActionPath[index] + "} === true ? false : true )";
131
+ }
132
+ if (index == aHiddenActionPath.length - 1) {
133
+ sHiddenExpression = sHiddenExpression + sSemiHiddenExpression;
134
+ } else {
135
+ sHiddenExpression = sHiddenExpression + sSemiHiddenExpression + "||";
136
+ }
137
+ }
138
+ return (
139
+ "{= " +
140
+ (bConsiderEditable ? "(" : "") +
141
+ sHiddenExpression +
142
+ (bConsiderEditable ? " || ${ui>/editMode} === 'Editable') " : " ") +
143
+ "&& ${internal>isCreateDialogOpen} !== true}"
144
+ );
145
+ } else {
146
+ return "{= " + (bConsiderEditable ? "${ui>/editMode} === 'Editable' && " : "") + "${internal>isCreateDialogOpen} !== true}";
147
+ }
148
+ },
149
+
150
+ /**
151
+ * Returns the metamodel path correctly for bound actions. For unbound actions,
152
+ * an incorrect path is returned, but is ignored during templating.
153
+ *
154
+ * For example, for the bound action someNameSpace.SomeBoundAction of the entity set SomeEntitySet,
155
+ * the string "/SomeEntitySet/someNameSpace.SomeBoundAction" is returned.
156
+ *
157
+ * @function
158
+ * @static
159
+ * @name sap.fe.core.AnnotationHelper.getActionContext
160
+ * @memberof sap.fe.core.AnnotationHelper
161
+ * @param {object} oAction The context object for the action
162
+ * @returns {string} Correct metamodel path for bound and incorrect path for unbound actions
163
+ * @private
164
+ * @ui5-restricted
165
+ **/
166
+ getActionContext: function(oAction: object) {
167
+ return CommonUtils.getActionPath(oAction, true);
168
+ },
169
+ /**
170
+ * Returns the metamodel path correctly for overloaded bound actions. For unbound actions,
171
+ * incorrect path is returned but during templating it is ignored.
172
+ * e.g. for bound action someNameSpace.SomeBoundAction of entity set SomeEntitySet,
173
+ * the string "/SomeEntitySet/someNameSpace.SomeBoundAction/@$ui5.overload/0" is returned.
174
+ *
175
+ * @function
176
+ * @static
177
+ * @name sap.fe.core.AnnotationHelper.getPathToBoundActionOverload
178
+ * @memberof sap.fe.core.AnnotationHelper
179
+ * @param {object} oAction The context object for the action
180
+ * @returns {string} Correct metamodel path for bound action overload and incorrect path for unbound actions
181
+ * @private
182
+ * @ui5-restricted
183
+ **/
184
+ getPathToBoundActionOverload: function(oAction: object) {
185
+ const sPath = CommonUtils.getActionPath(oAction, true);
186
+ return sPath + "/@$ui5.overload/0";
187
+ },
188
+ /**
189
+ * Returns an expression to determine Emphasized button type based on Criticality across all actions
190
+ * If critical action is rendered, its considered to be the primary action. Hence template's default primary action is set back to Default.
191
+ *
192
+ * @function
193
+ * @static
194
+ * @name sap.fe.core.AnnotationHelper.buildEmphasizedButtonExpression
195
+ * @memberof sap.fe.core.AnnotationHelper
196
+ * @param {Array} aIdentification Array of all the DataFields in Identification
197
+ * @returns {string} An expression to deduce if button type is Default or Emphasized
198
+ * @private
199
+ * @ui5-restricted
200
+ **/
201
+ buildEmphasizedButtonExpression: function(aIdentification?: any[]) {
202
+ if (!aIdentification) {
203
+ return ButtonType.Emphasized;
204
+ }
205
+ let sFormatEmphasizedExpression: string | undefined;
206
+ let bIsAlwaysDefault: boolean,
207
+ sHiddenSimplePath,
208
+ sHiddenExpression = "";
209
+ aIdentification.forEach(function(oDataField: any) {
210
+ const oCriticalityProperty = oDataField.Criticality;
211
+ const oDataFieldHidden = oDataField["@com.sap.vocabularies.UI.v1.Hidden"];
212
+ if (oDataField.$Type === "com.sap.vocabularies.UI.v1.DataFieldForAction" && !bIsAlwaysDefault && oCriticalityProperty) {
213
+ if (!sFormatEmphasizedExpression && oDataFieldHidden === true) {
214
+ // if DataField is set to hidden, we can skip other checks and return Default button type
215
+ sFormatEmphasizedExpression = ButtonType.Emphasized;
216
+ return;
217
+ }
218
+ if (oDataFieldHidden && oDataFieldHidden.$Path) {
219
+ // when visibility of critical button is based on path, collect all paths for expression
220
+ sHiddenSimplePath = oDataFieldHidden.$Path;
221
+ if (sHiddenExpression) {
222
+ sHiddenExpression = sHiddenExpression + " && ";
223
+ }
224
+ sHiddenExpression = sHiddenExpression + "%{" + sHiddenSimplePath + "} === true";
225
+ sFormatEmphasizedExpression = "{= (" + sHiddenExpression + ") ? 'Emphasized' : 'Default' }";
226
+ }
227
+ switch (oCriticalityProperty.$EnumMember) {
228
+ // supported criticality are [Positive/3/'3'] and [Negative/1/'1']
229
+ case "com.sap.vocabularies.UI.v1.CriticalityType/Negative":
230
+ case "com.sap.vocabularies.UI.v1.CriticalityType/Positive":
231
+ case "1":
232
+ case 1:
233
+ case "3":
234
+ case 3:
235
+ if (!oDataFieldHidden) {
236
+ sFormatEmphasizedExpression = ButtonType.Default;
237
+ bIsAlwaysDefault = true;
238
+ }
239
+ sFormatEmphasizedExpression = sFormatEmphasizedExpression || ButtonType.Default;
240
+ break;
241
+ default:
242
+ sFormatEmphasizedExpression = ButtonType.Emphasized;
243
+ }
244
+ if (oCriticalityProperty.$Path) {
245
+ // when Criticality is set using a path, use the path for deducing the Emphsized type for default Primary Action
246
+ const sCombinedHiddenExpression = sHiddenExpression ? "!(" + sHiddenExpression + ") && " : "";
247
+ sFormatEmphasizedExpression =
248
+ "{= " +
249
+ sCombinedHiddenExpression +
250
+ "((${" +
251
+ oCriticalityProperty.$Path +
252
+ "} === 'com.sap.vocabularies.UI.v1.CriticalityType/Negative') || (${" +
253
+ oCriticalityProperty.$Path +
254
+ "} === '1') || (${" +
255
+ oCriticalityProperty.$Path +
256
+ "} === 1) " +
257
+ "|| (${" +
258
+ oCriticalityProperty.$Path +
259
+ "} === 'com.sap.vocabularies.UI.v1.CriticalityType/Positive') || (${" +
260
+ oCriticalityProperty.$Path +
261
+ "} === '3') || (${" +
262
+ oCriticalityProperty.$Path +
263
+ "} === 3)) ? " +
264
+ "'Default'" +
265
+ " : " +
266
+ "'Emphasized'" +
267
+ " }";
268
+ }
269
+ }
270
+ });
271
+ return sFormatEmphasizedExpression || ButtonType.Emphasized;
272
+ },
273
+ /**
274
+ * Method to determine if the programming model is sticky.
275
+ *
276
+ * @function
277
+ * @name isStickySessionSupported
278
+ * @param {object} [vCollectionOrMetaModel] The collection or the metadata model
279
+ * @param {object} [oInterface] Contains the context, used in oDataContext
280
+ * @returns {boolean} `true` if sticky, `false` otherwise
281
+ */
282
+ isStickySessionSupported: function(vCollectionOrMetaModel: object | undefined, oInterface: any | undefined) {
283
+ let oMetaModel;
284
+ if (oInterface) {
285
+ oMetaModel = oInterface.context.getModel();
286
+ } else {
287
+ oMetaModel = vCollectionOrMetaModel;
288
+ }
289
+ return ModelHelper.isStickySessionSupported(oMetaModel);
290
+ },
291
+ /**
292
+ * Method returns Whether the action type is manifest or not.
293
+ *
294
+ * @function
295
+ * @name isManifestActionVisible
296
+ * @param {object} oAction The action object
297
+ * @returns {boolean} `true` if action is coming from manifest, `false` otherwise
298
+ */
299
+ isManifestAction: function(oAction: any) {
300
+ const aActions = [
301
+ "Primary",
302
+ "DefaultApply",
303
+ "Secondary",
304
+ "ForAction",
305
+ "ForNavigation",
306
+ "SwitchToActiveObject",
307
+ "SwitchToDraftObject"
308
+ ];
309
+ return aActions.indexOf(oAction.type) < 0;
310
+ },
311
+ /**
312
+ * Method returns whether footer is visible or not on object / sub object page.
313
+ *
314
+ * @function
315
+ * @name getFooterVisible
316
+ * @param {Array} oFooterActions The footer action object coming from convertor
317
+ * @param {Array} aDataFields Data field array for normal footer visiblity processing
318
+ * @returns {boolean} `true` if custom actions are present otherwise call function showFooter
319
+ */
320
+ getFooterVisible: function(oFooterActions: any[], aDataFields: any[]) {
321
+ let bCustomActionFlag = false;
322
+ oFooterActions.forEach(function(action: any) {
323
+ const isCustomAction = AnnotationHelper.isManifestAction(action);
324
+ if (isCustomAction) {
325
+ bCustomActionFlag = true;
326
+ }
327
+ });
328
+ if (bCustomActionFlag) {
329
+ return true;
330
+ } else {
331
+ return this.showFooter(aDataFields, true);
332
+ }
333
+ },
334
+ /**
335
+ * Build an expression calling an action handler via the FPM helper's actionWrapper function
336
+ *
337
+ * This function assumes that the 'FPM.actionWrapper()' function is available at runtime.
338
+ *
339
+ * @param {object} oAction Action metadata
340
+ * @param {string} oAction.handlerModule Module containing the action handler method
341
+ * @param {string} oAction.handlerMethod Action handler method name
342
+ * @param {object} [oThis] `this` (if the function is called from a macro)
343
+ * @param {string} oThis.id The table's ID
344
+ * @returns {string} The action wrapper binding expression
345
+ */
346
+ buildActionWrapper: function(oAction: { handlerModule: string; handlerMethod: string }, oThis: { id: string } | undefined) {
347
+ const aParams: any[] = [ref("$event"), oAction.handlerModule, oAction.handlerMethod];
348
+
349
+ if (oThis && oThis.id) {
350
+ const oAdditionalParams = {
351
+ contexts: ref("${internal>selectedContexts}")
352
+ };
353
+ aParams.push(oAdditionalParams);
354
+ }
355
+ return compileBinding(fn("FPM.actionWrapper", aParams));
356
+ },
357
+
358
+ /**
359
+ * Method returns an VariantBackReference expression based on variantManagement and oConverterContext value.
360
+ *
361
+ * @function
362
+ * @name getVariantBackReference
363
+ * @param {object} oViewData Object Containing View Data
364
+ * @param {object} oConverterContext Object containing converted context
365
+ * @returns {string}
366
+ */
367
+ getVariantBackReference: function(oViewData: any, oConverterContext: any) {
368
+ if (oViewData && oViewData.variantManagement === "Page") {
369
+ return "fe::PageVariantManagement";
370
+ }
371
+ if (oViewData && oViewData.variantManagement === "Control") {
372
+ return generate([oConverterContext.filterBarId, "VariantManagement"]);
373
+ }
374
+ return undefined;
375
+ },
376
+ getDefaultPath: function(aViews: any) {
377
+ for (let i = 0; i < aViews.length; i++) {
378
+ if (aViews[i].defaultPath) {
379
+ return aViews[i].defaultPath;
380
+ }
381
+ }
382
+ }
383
+ };
384
+
385
+ export default AnnotationHelper;
@@ -1,6 +1,7 @@
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
  */
5
6
 
6
7
  // ----------------------------------------------------------------------------------
@@ -286,7 +287,8 @@ sap.ui.define(
286
287
  }
287
288
 
288
289
  // Adding Semantic Date Operators
289
- SemanticDateOperators.addSemanticDateOperators();
290
+ // Commenting since it is not needed for SingleRange
291
+ // SemanticDateOperators.addSemanticDateOperators();
290
292
 
291
293
  // the init function configures the routing according to the settings above
292
294
  // it will call the createContent function to instantiate the RootView and add it to the UIComponent aggregations
@@ -377,6 +379,7 @@ sap.ui.define(
377
379
  var oMainModel = this.oModels[undefined];
378
380
  var oHeaders = jQuery.extend({}, oMainModel.oRequestor.mHeaders);
379
381
  // As we need to cleanup the application / handle the dirty object we need to call our cleanup before the models are destroyed
382
+ this.getRoutingService().beforeExit();
380
383
  UIComponent.prototype.destroy.apply(this, arguments);
381
384
  oMainModel.oRequestor.mHeaders = oHeaders;
382
385
  },