@sapui5/sap.fe.core 1.93.3 → 1.97.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 (193) 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 +8 -40
  4. package/src/sap/fe/core/BusyLocker.js +12 -0
  5. package/src/sap/fe/core/CommonUtils.js +224 -48
  6. package/src/sap/fe/core/ExtensionAPI.js +1 -1
  7. package/src/sap/fe/core/PageController.js +13 -2
  8. package/src/sap/fe/core/RouterProxy.js +52 -64
  9. package/src/sap/fe/core/TemplateComponent.js +8 -2
  10. package/src/sap/fe/core/TransactionHelper.js +210 -180
  11. package/src/sap/fe/core/actions/draft.js +13 -1
  12. package/src/sap/fe/core/actions/messageHandling.js +80 -4
  13. package/src/sap/fe/core/actions/operations.js +207 -68
  14. package/src/sap/fe/core/controllerextensions/EditFlow.js +82 -55
  15. package/src/sap/fe/core/controllerextensions/InternalEditFlow.js +13 -6
  16. package/src/sap/fe/core/controllerextensions/InternalIntentBasedNavigation.js +132 -23
  17. package/src/sap/fe/core/controllerextensions/InternalRouting.js +203 -214
  18. package/src/sap/fe/core/controllerextensions/KPIManagement.js +834 -170
  19. package/src/sap/fe/core/controllerextensions/KPIManagement.ts +890 -189
  20. package/src/sap/fe/core/controllerextensions/MessageHandler.js +222 -102
  21. package/src/sap/fe/core/controllerextensions/PageReady.js +48 -33
  22. package/src/sap/fe/core/controllerextensions/PageReady.ts +49 -14
  23. package/src/sap/fe/core/controllerextensions/Paginator.js +150 -0
  24. package/src/sap/fe/core/controllerextensions/Placeholder.js +133 -270
  25. package/src/sap/fe/core/controllerextensions/Share.js +12 -9
  26. package/src/sap/fe/core/controllerextensions/SideEffects.js +5 -6
  27. package/src/sap/fe/core/controllerextensions/SideEffects.ts +13 -12
  28. package/src/sap/fe/core/controllerextensions/ViewState.js +202 -8
  29. package/src/sap/fe/core/controls/ActionParameterDialog.fragment.xml +39 -34
  30. package/src/sap/fe/core/controls/ActionParameterDialogValueHelp.fragment.xml +35 -0
  31. package/src/sap/fe/core/controls/ActionPartial.fragment.xml +1 -1
  32. package/src/sap/fe/core/controls/CustomQuickViewPage.js +109 -108
  33. package/src/sap/fe/core/controls/MultiValueParameterDelegate.js +45 -0
  34. package/src/sap/fe/core/controls/filterbar/FilterContainer.js +15 -4
  35. package/src/sap/fe/core/controls/filterbar/VisualFilter.js +250 -94
  36. package/src/sap/fe/core/controls/filterbar/VisualFilterContainer.js +129 -135
  37. package/src/sap/fe/core/controls/filterbar/utils/VisualFilterUtils.js +325 -0
  38. package/src/sap/fe/core/controls/filterbar.d.js +8 -0
  39. package/src/sap/fe/core/controls/filterbar.d.ts +0 -0
  40. package/src/sap/fe/core/converters/ConverterContext.js +19 -5
  41. package/src/sap/fe/core/converters/ConverterContext.ts +13 -3
  42. package/src/sap/fe/core/converters/ManifestSettings.js +2 -1
  43. package/src/sap/fe/core/converters/ManifestSettings.ts +13 -3
  44. package/src/sap/fe/core/converters/ManifestWrapper.js +9 -9
  45. package/src/sap/fe/core/converters/MetaModelConverter.js +867 -871
  46. package/src/sap/fe/core/converters/MetaModelConverter.ts +772 -827
  47. package/src/sap/fe/core/converters/TemplateConverter.js +4 -4
  48. package/src/sap/fe/core/converters/annotations/DataField.js +57 -7
  49. package/src/sap/fe/core/converters/annotations/DataField.ts +52 -2
  50. package/src/sap/fe/core/converters/common/AnnotationConverter.js +146 -85
  51. package/src/sap/fe/core/converters/controls/Common/Action.js +61 -56
  52. package/src/sap/fe/core/converters/controls/Common/Action.ts +54 -39
  53. package/src/sap/fe/core/converters/controls/Common/Chart.js +101 -9
  54. package/src/sap/fe/core/converters/controls/Common/Chart.ts +100 -5
  55. package/src/sap/fe/core/converters/controls/Common/Criticality.js +1 -1
  56. package/src/sap/fe/core/converters/controls/Common/DataVisualization.js +15 -16
  57. package/src/sap/fe/core/converters/controls/Common/DataVisualization.ts +16 -30
  58. package/src/sap/fe/core/converters/controls/Common/Form.js +77 -29
  59. package/src/sap/fe/core/converters/controls/Common/Form.ts +79 -21
  60. package/src/sap/fe/core/converters/controls/Common/KPI.js +287 -109
  61. package/src/sap/fe/core/converters/controls/Common/KPI.ts +314 -139
  62. package/src/sap/fe/core/converters/controls/Common/Table.js +521 -166
  63. package/src/sap/fe/core/converters/controls/Common/Table.ts +519 -115
  64. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.js +487 -0
  65. package/src/sap/fe/core/converters/controls/ListReport/FilterBar.ts +541 -0
  66. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.js +364 -0
  67. package/src/sap/fe/core/converters/controls/ListReport/VisualFilters.ts +338 -0
  68. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.js +74 -0
  69. package/src/sap/fe/core/converters/controls/ObjectPage/Avatar.ts +50 -0
  70. package/src/sap/fe/core/converters/controls/ObjectPage/HeaderFacet.js +11 -11
  71. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.js +47 -35
  72. package/src/sap/fe/core/converters/controls/ObjectPage/SubSection.ts +45 -29
  73. package/src/sap/fe/core/converters/helpers/Aggregation.js +31 -32
  74. package/src/sap/fe/core/converters/helpers/Aggregation.ts +26 -27
  75. package/src/sap/fe/core/converters/helpers/BindingHelper.js +27 -2
  76. package/src/sap/fe/core/converters/helpers/BindingHelper.ts +22 -2
  77. package/src/sap/fe/core/converters/helpers/ConfigurableObject.js +1 -1
  78. package/src/sap/fe/core/converters/helpers/ID.js +9 -3
  79. package/src/sap/fe/core/converters/helpers/ID.ts +6 -3
  80. package/src/sap/fe/core/converters/helpers/IssueManager.js +5 -4
  81. package/src/sap/fe/core/converters/helpers/IssueManager.ts +4 -3
  82. package/src/sap/fe/core/converters/helpers/Key.js +3 -3
  83. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.js +11 -6
  84. package/src/sap/fe/core/converters/helpers/SelectionVariantHelper.ts +9 -5
  85. package/src/sap/fe/core/converters/objectPage/FormMenuActions.js +18 -5
  86. package/src/sap/fe/core/converters/objectPage/FormMenuActions.ts +14 -14
  87. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.js +91 -20
  88. package/src/sap/fe/core/converters/objectPage/HeaderAndFooterAction.ts +77 -5
  89. package/src/sap/fe/core/converters/templates/ListReportConverter.js +87 -714
  90. package/src/sap/fe/core/converters/templates/ListReportConverter.ts +85 -812
  91. package/src/sap/fe/core/converters/templates/ObjectPageConverter.js +106 -17
  92. package/src/sap/fe/core/converters/templates/ObjectPageConverter.ts +121 -16
  93. package/src/sap/fe/core/designtime/AppComponent.designtime.js +2 -1
  94. package/src/sap/fe/core/formatters/CriticalityFormatter.js +1 -1
  95. package/src/sap/fe/core/formatters/FPMFormatter.js +1 -1
  96. package/src/sap/fe/core/formatters/FPMFormatter.ts +8 -3
  97. package/src/sap/fe/core/formatters/KPIFormatter.js +1 -1
  98. package/src/sap/fe/core/formatters/TableFormatter.js +27 -4
  99. package/src/sap/fe/core/formatters/TableFormatter.ts +20 -3
  100. package/src/sap/fe/core/formatters/TableFormatterTypes.js +1 -1
  101. package/src/sap/fe/core/formatters/ValueFormatter.js +1 -1
  102. package/src/sap/fe/core/fpm/Component.js +1 -1
  103. package/src/sap/fe/core/helpers/AnnotationEnum.js +3 -3
  104. package/src/sap/fe/core/helpers/BindingExpression.js +6 -6
  105. package/src/sap/fe/core/helpers/ClassSupport.js +4 -4
  106. package/src/sap/fe/core/helpers/ExcelFormatHelper.js +0 -2
  107. package/src/sap/fe/core/helpers/KeepAliveHelper.js +211 -0
  108. package/src/sap/fe/core/helpers/KeepAliveHelper.ts +202 -0
  109. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.js +32 -0
  110. package/src/sap/fe/core/helpers/KeepAliveRefreshTypes.ts +36 -0
  111. package/src/sap/fe/core/helpers/ModelHelper.js +78 -0
  112. package/src/sap/fe/core/helpers/PasteHelper.js +6 -0
  113. package/src/sap/fe/core/helpers/SemanticKeyHelper.js +2 -2
  114. package/src/sap/fe/core/helpers/StableIdHelper.js +1 -1
  115. package/src/sap/fe/core/helpers/StableIdHelper.ts +1 -1
  116. package/src/sap/fe/core/jsx-runtime/jsx.js +2 -2
  117. package/src/sap/fe/core/jsx-runtime/jsxs.js +1 -1
  118. package/src/sap/fe/core/library.js +1 -1
  119. package/src/sap/fe/core/messagebundle.properties +45 -2
  120. package/src/sap/fe/core/messagebundle_ar.properties +53 -1
  121. package/src/sap/fe/core/messagebundle_bg.properties +52 -0
  122. package/src/sap/fe/core/messagebundle_ca.properties +54 -2
  123. package/src/sap/fe/core/messagebundle_cs.properties +52 -0
  124. package/src/sap/fe/core/messagebundle_cy.properties +52 -0
  125. package/src/sap/fe/core/messagebundle_da.properties +53 -1
  126. package/src/sap/fe/core/messagebundle_de.properties +55 -3
  127. package/src/sap/fe/core/messagebundle_el.properties +53 -1
  128. package/src/sap/fe/core/messagebundle_en.properties +52 -0
  129. package/src/sap/fe/core/messagebundle_en_GB.properties +53 -1
  130. package/src/sap/fe/core/messagebundle_en_US_sappsd.properties +49 -1
  131. package/src/sap/fe/core/messagebundle_en_US_saprigi.properties +53 -1
  132. package/src/sap/fe/core/messagebundle_en_US_saptrc.properties +53 -1
  133. package/src/sap/fe/core/messagebundle_es.properties +60 -8
  134. package/src/sap/fe/core/messagebundle_es_MX.properties +55 -3
  135. package/src/sap/fe/core/messagebundle_et.properties +52 -0
  136. package/src/sap/fe/core/messagebundle_fi.properties +52 -0
  137. package/src/sap/fe/core/messagebundle_fr.properties +61 -9
  138. package/src/sap/fe/core/messagebundle_fr_CA.properties +52 -0
  139. package/src/sap/fe/core/messagebundle_hi.properties +53 -1
  140. package/src/sap/fe/core/messagebundle_hr.properties +53 -1
  141. package/src/sap/fe/core/messagebundle_hu.properties +52 -0
  142. package/src/sap/fe/core/messagebundle_id.properties +54 -2
  143. package/src/sap/fe/core/messagebundle_it.properties +53 -1
  144. package/src/sap/fe/core/messagebundle_iw.properties +54 -2
  145. package/src/sap/fe/core/messagebundle_ja.properties +62 -10
  146. package/src/sap/fe/core/messagebundle_kk.properties +53 -1
  147. package/src/sap/fe/core/messagebundle_ko.properties +53 -1
  148. package/src/sap/fe/core/messagebundle_lt.properties +53 -1
  149. package/src/sap/fe/core/messagebundle_lv.properties +53 -1
  150. package/src/sap/fe/core/messagebundle_ms.properties +53 -1
  151. package/src/sap/fe/core/messagebundle_nl.properties +57 -5
  152. package/src/sap/fe/core/messagebundle_no.properties +54 -2
  153. package/src/sap/fe/core/messagebundle_pl.properties +53 -1
  154. package/src/sap/fe/core/messagebundle_pt.properties +54 -2
  155. package/src/sap/fe/core/messagebundle_pt_PT.properties +53 -1
  156. package/src/sap/fe/core/messagebundle_ro.properties +53 -1
  157. package/src/sap/fe/core/messagebundle_ru.properties +53 -1
  158. package/src/sap/fe/core/messagebundle_sh.properties +53 -1
  159. package/src/sap/fe/core/messagebundle_sk.properties +52 -0
  160. package/src/sap/fe/core/messagebundle_sl.properties +53 -1
  161. package/src/sap/fe/core/messagebundle_sv.properties +53 -1
  162. package/src/sap/fe/core/messagebundle_th.properties +52 -0
  163. package/src/sap/fe/core/messagebundle_tr.properties +52 -0
  164. package/src/sap/fe/core/messagebundle_uk.properties +52 -0
  165. package/src/sap/fe/core/messagebundle_vi.properties +53 -1
  166. package/src/sap/fe/core/messagebundle_zh_CN.properties +53 -1
  167. package/src/sap/fe/core/messagebundle_zh_TW.properties +53 -1
  168. package/src/sap/fe/core/services/AsyncComponentServiceFactory.js +5 -5
  169. package/src/sap/fe/core/services/EnvironmentServiceFactory.js +5 -5
  170. package/src/sap/fe/core/services/RoutingServiceFactory.js +154 -78
  171. package/src/sap/fe/core/services/ShellServicesFactory.js +9 -9
  172. package/src/sap/fe/core/services/SideEffectsServiceFactory.js +11 -12
  173. package/src/sap/fe/core/services/TemplatedViewServiceFactory.js +12 -2
  174. package/src/sap/fe/core/support/AnnotationIssue.support.js +2 -4
  175. package/src/sap/fe/core/support/CollectionFacetMissingID.support.js +2 -4
  176. package/src/sap/fe/core/support/CollectionFacetUnsupportedLevel.support.js +2 -4
  177. package/src/sap/fe/core/support/CommonHelper.js +2 -4
  178. package/src/sap/fe/core/support/Diagnostics.js +1 -1
  179. package/src/sap/fe/core/templating/CriticalityFormatters.js +4 -4
  180. package/src/sap/fe/core/templating/DataFieldFormatters.js +1 -1
  181. package/src/sap/fe/core/templating/DataModelPathHelper.js +54 -6
  182. package/src/sap/fe/core/templating/DataModelPathHelper.ts +54 -4
  183. package/src/sap/fe/core/templating/EntitySetHelper.js +86 -3
  184. package/src/sap/fe/core/templating/EntitySetHelper.ts +44 -0
  185. package/src/sap/fe/core/templating/FieldControlHelper.js +1 -1
  186. package/src/sap/fe/core/templating/FilterHelper.js +23 -5
  187. package/src/sap/fe/core/templating/FilterHelper.ts +15 -1
  188. package/src/sap/fe/core/templating/FilterTemplating.js +1 -1
  189. package/src/sap/fe/core/templating/PropertyFormatters.js +1 -1
  190. package/src/sap/fe/core/templating/PropertyHelper.js +8 -8
  191. package/src/sap/fe/core/templating/UIFormatters.js +72 -4
  192. package/src/sap/fe/core/templating/UIFormatters.ts +98 -3
  193. package/src/sap/fe/core/type/Email.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.fe.core",
3
- "version": "1.93.3",
3
+ "version": "1.97.0",
4
4
  "description": "SAPUI5 Library sap.fe.core",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -10,9 +10,9 @@
10
10
  "build-local": "tsc --project tsconfig-local.json && copyfiles -u 6 \"../../node_modules/@sap-ux/annotation-converter/ui5-dist/**/*.js\" dist-local/src && copyfiles ui5.yaml dist-local",
11
11
  "copy-dependency": "copyfiles -u 6 \"../../node_modules/@sap-ux/annotation-converter/ui5-dist/**/*.js\" target/classes/META-INF/resources",
12
12
  "prepare-npm-sources": "copyfiles -u 6 \"../../node_modules/@sap-ux/annotation-converter/ui5-dist/**/*.js\" target/npm-sources/src && babel target/npm-sources/src --out-dir target/npm-sources/src --extensions \".ts\" --config-file ../../.babelrc",
13
- "test": "jest --detectOpenHandles --forceExit",
14
- "test-refs": "jest --detectOpenHandles --forceExit --config jest.config-refs.js",
15
- "test-updateSnapshots": "jest --detectOpenHandles --forceExit -u",
13
+ "test": "jest",
14
+ "test-refs": "jest --config jest.config-refs.js",
15
+ "test-updateSnapshots": "jest -u",
16
16
  "watch-local": "npm run build-local && tsc --project tsconfig-local.json --watch"
17
17
  },
18
18
  "keywords": [
@@ -20,8 +20,8 @@
20
20
  "ui5"
21
21
  ],
22
22
  "devDependencies": {
23
- "@babel/cli": "7.8.4",
24
- "@ui5/cli": "^2.10.0",
23
+ "@babel/cli": "^7.14.8",
24
+ "@ui5/cli": "^2.14.0",
25
25
  "copyfiles": "2.2.0"
26
26
  }
27
27
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>SAP UI development toolkit for HTML5 (SAPUI5)
7
7
  (c) Copyright 2009-2021 SAP SE. All rights reserved
8
8
  </copyright>
9
- <version>1.93.3</version>
9
+ <version>1.97.0</version>
10
10
 
11
11
  <documentation>UI5 library: sap.fe.core</documentation>
12
12
 
@@ -17,7 +17,6 @@ sap.ui.define(
17
17
  "sap/ui/model/json/JSONModel",
18
18
  "sap/fe/core/library",
19
19
  "sap/fe/core/helpers/SemanticDateOperators",
20
- "sap/ui/core/CustomizingConfiguration",
21
20
  "sap/ui/core/Component",
22
21
  "sap/fe/core/TemplateComponent",
23
22
  "sap/fe/core/helpers/ModelHelper",
@@ -34,7 +33,6 @@ sap.ui.define(
34
33
  JSONModel,
35
34
  library,
36
35
  SemanticDateOperators,
37
- CustomizingConfiguration,
38
36
  Component,
39
37
  TemplateComponent,
40
38
  ModelHelper,
@@ -43,34 +41,6 @@ sap.ui.define(
43
41
  ) {
44
42
  "use strict";
45
43
 
46
- // ----- <Remove> -----
47
- // Can be removed once core change is merged
48
-
49
- // monkey patch the sap.ui.core.CustomizingConfiguration#getControllerExtension:
50
- var fGetControllerExtension = CustomizingConfiguration.getControllerExtension;
51
- CustomizingConfiguration.getControllerExtension = function(sControllerName, vObject) {
52
- var oComponent = getAppComponent(vObject),
53
- sComponentId = oComponent && oComponent.getId(),
54
- oResultConfig = fGetControllerExtension.call(CustomizingConfiguration, sControllerName, sComponentId);
55
- return oResultConfig;
56
- };
57
-
58
- function getAppComponent(vObject) {
59
- // check whether a context is given and determine a componentId from it
60
- // - either it is a string, then this is the pre-processor use case and the string is a component id
61
- // - or it is a view or fragment and the Id of the owner component should be used
62
- var sComponentId = vObject && typeof vObject === "string" ? vObject : vObject && Component.getOwnerIdFor(vObject);
63
- // retrieve the component (if an Id is known)
64
- var oComponent = sComponentId && Component.get(sComponentId);
65
- // only when it inherits from TemplateComponent, ask for the AppComponent instead
66
- if (oComponent instanceof TemplateComponent) {
67
- oComponent = oComponent.oAppComponent;
68
- }
69
- // return the AppComponent
70
- return oComponent;
71
- }
72
- // ----- </Remove> -----
73
-
74
44
  var NAVCONF = {
75
45
  FCL: {
76
46
  VIEWNAME: "sap.fe.templates.RootContainer.view.Fcl",
@@ -389,16 +359,6 @@ sap.ui.define(
389
359
  ValueListHelper.initializeCachedValueHelp();
390
360
 
391
361
  delete AppComponent.prototype.instanceMap[this.getId()];
392
- var sCurrentComponentName = this.getMetadata().getName();
393
- var bHasOtherComponent = false;
394
- Object.keys(AppComponent.prototype.instanceMap).forEach(function(instanceID) {
395
- if (AppComponent.prototype.instanceMap[instanceID].getMetadata().getName() === sCurrentComponentName) {
396
- bHasOtherComponent = true;
397
- }
398
- });
399
- if (!bHasOtherComponent) {
400
- sap.ui.fl.apply._internal.flexState.FlexState.clearState(sCurrentComponentName);
401
- }
402
362
 
403
363
  // var oRegistry = sap.ui.mdc.p13n.Engine.getInstance()._getRegistry();
404
364
  // Object.keys(oRegistry).forEach(function(sKey) {
@@ -424,6 +384,14 @@ sap.ui.define(
424
384
  var oComponentData = this.getComponentData();
425
385
  var oStartUpParameters = (oComponentData && oComponentData.startupParameters) || {};
426
386
  return Promise.resolve(oStartUpParameters);
387
+ },
388
+ restore: function() {
389
+ // called by FLP when app sap-keep-alive is enabled and app is restored
390
+ this.getRootViewController().viewState.onRestore();
391
+ },
392
+ suspend: function() {
393
+ // called by FLP when app sap-keep-alive is enabled and app is suspended
394
+ this.getRootViewController().viewState.onSuspend();
427
395
  }
428
396
  });
429
397
 
@@ -90,10 +90,22 @@ sap.ui.define(["sap/base/Log"], function(Log) {
90
90
  }
91
91
 
92
92
  return {
93
+ /**
94
+ *
95
+ * @param oModelOrControl
96
+ * @param [sPath]
97
+ * @returns {boolean}
98
+ */
93
99
  lock: function(oModelOrControl, sPath) {
94
100
  return this._updateLock(oModelOrControl, sPath, 1);
95
101
  },
96
102
 
103
+ /**
104
+ *
105
+ * @param oModelOrControl
106
+ * @param [sPath]
107
+ * @returns {boolean}
108
+ */
97
109
  unlock: function(oModelOrControl, sPath) {
98
110
  return this._updateLock(oModelOrControl, sPath, -1);
99
111
  },
@@ -77,9 +77,31 @@ sap.ui.define(
77
77
  ];
78
78
 
79
79
  /**
80
- * Returns the actual property type of a given datafield or property.
80
+ * Method to split the search term on spaces and wrap each word in double quotes.
81
81
  *
82
- * @param {sap.ui.model.Context} oNavigationContext The metamodel context
82
+ * @param {string} sSearchTerm The search term
83
+ * @returns {string|undefined} The normalized search term, undefined if empty
84
+ */
85
+ function normalizeSearchTerm(sSearchTerm) {
86
+ if (!sSearchTerm) {
87
+ return undefined;
88
+ }
89
+
90
+ return sSearchTerm
91
+ .replace(/"/g, " ")
92
+ .split(/\s+/)
93
+ .reduce(function(sNormalized, sCurrentWord) {
94
+ if (sCurrentWord !== "") {
95
+ sNormalized = (sNormalized ? sNormalized + " " : "") + '"' + sCurrentWord + '"';
96
+ }
97
+ return sNormalized;
98
+ }, undefined);
99
+ }
100
+
101
+ /**
102
+ * Returns the actual property type of a given data field or property.
103
+ *
104
+ * @param {sap.ui.model.Context} oNavigationContext The MetaModel context
83
105
  * @returns {string} The name of the actual data type
84
106
  */
85
107
  function getPropertyDataType(oNavigationContext) {
@@ -693,14 +715,24 @@ sap.ui.define(
693
715
  return aOutAttributes;
694
716
  }
695
717
 
718
+ function _fnCheckIsMatch(oObject, oKeysToCheck) {
719
+ for (var sKey in oKeysToCheck) {
720
+ if (oKeysToCheck[sKey] !== oObject[sKey]) {
721
+ return false;
722
+ }
723
+ }
724
+ return true;
725
+ }
726
+
696
727
  /**
697
728
  * Method to get metadata of entityset properties.
698
729
  *
699
730
  * @param {object} oMetaModel MetaModel for annotations
700
731
  * @param {string} sContextPath ContextPath for properities
732
+ * @param {object} oFilter Filter for the properties
701
733
  * @returns {object} The entity type properties
702
734
  */
703
- function fnGetContextPathProperties(oMetaModel, sContextPath) {
735
+ function fnGetContextPathProperties(oMetaModel, sContextPath, oFilter) {
704
736
  var oEntityType = oMetaModel.getObject(sContextPath + "/") || {},
705
737
  oProperties = {};
706
738
 
@@ -709,7 +741,7 @@ sap.ui.define(
709
741
  oEntityType.hasOwnProperty(sKey) &&
710
742
  !/^\$/i.test(sKey) &&
711
743
  oEntityType[sKey].$kind &&
712
- oEntityType[sKey].$kind === "Property"
744
+ _fnCheckIsMatch(oEntityType[sKey], oFilter || { $kind: "Property" })
713
745
  ) {
714
746
  oProperties[sKey] = oEntityType[sKey];
715
747
  }
@@ -787,7 +819,7 @@ sap.ui.define(
787
819
  params: oParams
788
820
  })
789
821
  .then(function(aLink) {
790
- oIBNAction.setVisible(aLink && aLink.length === 1);
822
+ oIBNAction.setVisible(oIBNAction.getVisible() && aLink && aLink.length === 1);
791
823
  })
792
824
  .catch(function(oError) {
793
825
  Log.error("Cannot retrieve the links from the shell service", oError);
@@ -815,8 +847,8 @@ sap.ui.define(
815
847
  *
816
848
  * @param {string} sFrameworkKey Current key.
817
849
  * @param {object} oResourceBundle Contains the local resource bundle
818
- * @param {object} oParams Parameter object for the resource value
819
- * @param {object} sEntitySetName EntitySet name of the control where the resource is being used
850
+ * @param {object} [oParams] Parameter object for the resource value
851
+ * @param {string} [sEntitySetName] EntitySet name of the control where the resource is being used
820
852
  * @returns {string} The translated text
821
853
  */
822
854
  function getTranslatedText(sFrameworkKey, oResourceBundle, oParams, sEntitySetName) {
@@ -929,8 +961,93 @@ sap.ui.define(
929
961
  return oTextAnnotation ? "DescriptionValue" : "Value";
930
962
  }
931
963
 
964
+ function _getEntityType(oContext) {
965
+ var oMetaModel = oContext.getModel().getMetaModel();
966
+ return oMetaModel.getObject(oMetaModel.getMetaPath(oContext.getPath()) + "/$Type");
967
+ }
968
+
969
+ function _requestObject(sAction, oSelectedContext, sProperty) {
970
+ var oContext = oSelectedContext,
971
+ nBracketIndex = sAction.indexOf("(");
972
+
973
+ if (nBracketIndex > -1) {
974
+ var sTargetType = sAction.slice(nBracketIndex + 1, -1),
975
+ sCurrentType = _getEntityType(oContext);
976
+
977
+ while (sCurrentType !== sTargetType) {
978
+ // Find parent binding context and retrieve entity type
979
+ oContext = oContext.getBinding().getContext();
980
+ if (oContext) {
981
+ sCurrentType = _getEntityType(oContext);
982
+ } else {
983
+ Log.warn("Cannot determine target type to request property value for bound action invocation");
984
+ return Promise.resolve(undefined);
985
+ }
986
+ }
987
+ }
988
+
989
+ return oContext.requestObject(sProperty);
990
+ }
991
+
992
+ function _requestProperty(oSelectedContext, sAction, sProperty, sDynamicActionEnabledPath) {
993
+ var oPromise =
994
+ sProperty && sProperty.indexOf("/") === 0
995
+ ? requestSingletonProperty(sProperty, oSelectedContext.getModel())
996
+ : _requestObject(sAction, oSelectedContext, sProperty);
997
+
998
+ return oPromise.then(function(vPropertyValue) {
999
+ return Promise.resolve({
1000
+ vPropertyValue: vPropertyValue,
1001
+ oSelectedContext: oSelectedContext,
1002
+ sAction: sAction,
1003
+ sDynamicActionEnabledPath: sDynamicActionEnabledPath
1004
+ });
1005
+ });
1006
+ }
1007
+
1008
+ function _setContextsBasedOnOperationAvailable(oInternalModelContext, aRequestPromises) {
1009
+ return Promise.all(aRequestPromises)
1010
+ .then(function(aResults) {
1011
+ if (aResults.length) {
1012
+ var aApplicableContexts = [],
1013
+ aNotApplicableContexts = [];
1014
+ aResults.forEach(function(aResult) {
1015
+ if (aResult) {
1016
+ if (aResult.vPropertyValue) {
1017
+ oInternalModelContext.getModel().setProperty(aResult.sDynamicActionEnabledPath, true);
1018
+ aApplicableContexts.push(aResult.oSelectedContext);
1019
+ } else {
1020
+ aNotApplicableContexts.push(aResult.oSelectedContext);
1021
+ }
1022
+ }
1023
+ });
1024
+ _setDynamicActionContexts(oInternalModelContext, aResults[0].sAction, aApplicableContexts, aNotApplicableContexts);
1025
+ }
1026
+ })
1027
+ .catch(function(oError) {
1028
+ Log.trace("Cannot retrieve property value from path", oError);
1029
+ });
1030
+ }
1031
+
1032
+ function _setDynamicActionContexts(oInternalModelContext, sAction, aApplicable, aNotApplicable) {
1033
+ var sDynamicActionPathPrefix = oInternalModelContext.getPath() + "/dynamicActions/" + sAction,
1034
+ oInternalModel = oInternalModelContext.getModel();
1035
+ oInternalModel.setProperty(sDynamicActionPathPrefix + "/aApplicable", aApplicable);
1036
+ oInternalModel.setProperty(sDynamicActionPathPrefix + "/aNotApplicable", aNotApplicable);
1037
+ }
1038
+
1039
+ /**
1040
+ * Sets the 'enabled' property along with the applicable selected contexts of dynamic actions.
1041
+ *
1042
+ * @param oInternalModelContext The instance of the internal model context
1043
+ * @param oActionOperationAvailableMap The collection of action names and properties configured as Core.OperationAvailable paths
1044
+ * @param aSelectedContexts The array of selected contexts in the table
1045
+ * @returns {Promise} A promise that sets the 'enabled' property for all dynamic actions
1046
+ */
932
1047
  function setActionEnablement(oInternalModelContext, oActionOperationAvailableMap, aSelectedContexts) {
1048
+ var aPromises = [];
933
1049
  for (var sAction in oActionOperationAvailableMap) {
1050
+ // Reset all properties before computation
934
1051
  oInternalModelContext.setProperty("dynamicActions/" + sAction, {
935
1052
  bEnabled: false,
936
1053
  aApplicable: [],
@@ -940,8 +1057,10 @@ sap.ui.define(
940
1057
  // one or more are selected and the second part of the condition in the templating
941
1058
  // is then undefined and thus the button takes the default enabling, which is true!
942
1059
  var aApplicable = [],
943
- aNotApplicable = [];
944
- var sProperty = oActionOperationAvailableMap[sAction];
1060
+ aNotApplicable = [],
1061
+ sProperty = oActionOperationAvailableMap[sAction],
1062
+ sDynamicActionEnabledPath = oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/bEnabled";
1063
+
945
1064
  if (typeof sProperty === "object" && sProperty !== null && sProperty !== undefined) {
946
1065
  for (var i = 0; i < aSelectedContexts.length; i++) {
947
1066
  var oSelectedContext = aSelectedContexts[i];
@@ -958,45 +1077,38 @@ sap.ui.define(
958
1077
  );
959
1078
  var sResult = BindingExpression.compileBinding(oTransformedBinding);
960
1079
  if (sResult === "true") {
961
- oInternalModelContext
962
- .getModel()
963
- .setProperty(oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/bEnabled", true);
1080
+ oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
964
1081
  aApplicable.push(oSelectedContext);
965
1082
  } else {
966
1083
  aNotApplicable.push(oSelectedContext);
967
1084
  }
968
1085
  }
969
1086
  }
1087
+ _setDynamicActionContexts(oInternalModelContext, sAction, aApplicable, aNotApplicable);
970
1088
  } else {
1089
+ var aRequestPromises = [];
971
1090
  for (var i = 0; i < aSelectedContexts.length; i++) {
972
1091
  var oSelectedContext = aSelectedContexts[i];
973
1092
  if (oSelectedContext) {
974
1093
  var oContextData = oSelectedContext.getObject();
975
1094
  if (sProperty === null && !!oContextData["#" + sAction]) {
976
1095
  //look for action advertisement if present and its value is not null
977
- oInternalModelContext
978
- .getModel()
979
- .setProperty(oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/bEnabled", true);
1096
+ oInternalModelContext.getModel().setProperty(sDynamicActionEnabledPath, true);
980
1097
  break;
981
- } else if (oSelectedContext.getObject(sProperty)) {
982
- oInternalModelContext
983
- .getModel()
984
- .setProperty(oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/bEnabled", true);
985
- aApplicable.push(oSelectedContext);
986
1098
  } else {
987
- aNotApplicable.push(oSelectedContext);
1099
+ // Collect promises to retrieve singleton or normal property value asynchronously
1100
+ aRequestPromises.push(_requestProperty(oSelectedContext, sAction, sProperty, sDynamicActionEnabledPath));
988
1101
  }
989
1102
  }
990
1103
  }
991
- }
992
1104
 
993
- oInternalModelContext
994
- .getModel()
995
- .setProperty(oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/aApplicable", aApplicable);
996
- oInternalModelContext
997
- .getModel()
998
- .setProperty(oInternalModelContext.getPath() + "/dynamicActions/" + sAction + "/aNotApplicable", aNotApplicable);
1105
+ // When all property values have been retrieved, set
1106
+ // The applicable and not-applicable selected contexts for each action and
1107
+ // The enabled property of the dynamic action in internal model context.
1108
+ aPromises.push(_setContextsBasedOnOperationAvailable(oInternalModelContext, aRequestPromises));
1109
+ }
999
1110
  }
1111
+ return Promise.all(aPromises);
1000
1112
  }
1001
1113
 
1002
1114
  function _getDefaultOperators(oRealProperty) {
@@ -1358,14 +1470,13 @@ sap.ui.define(
1358
1470
  * @param {object} oSelectionVariant Instance of {@link sap.fe.navigation.SelectionVariant} SelectionVariant to be used.
1359
1471
  * @param {object} mFilters Conditons to be added to the SelectionVariant
1360
1472
  * @param {object} oTargetInfo Object returned after selection variant from the table is prepared.
1361
- * @param {object} oFilterInfo Object containing the converted FilterBar filters
1362
1473
  * @returns {object} Instance of {@link sap.fe.navigation.SelectionVariant} SelectionVariant with the conditions.
1363
1474
  * @private
1364
1475
  * @ui5-restricted
1365
1476
  * @example <code>
1366
1477
  * </code>
1367
1478
  */
1368
- function addExternalStateFiltersToSelectionVariant(oSelectionVariant, mFilters, oTargetInfo, oFilterInfo) {
1479
+ function addExternalStateFiltersToSelectionVariant(oSelectionVariant, mFilters, oTargetInfo) {
1369
1480
  var sFilter,
1370
1481
  sLow = "",
1371
1482
  sHigh = null;
@@ -1396,10 +1507,6 @@ sap.ui.define(
1396
1507
  case "EQ":
1397
1508
  oSelectOptionState.option = sOperator;
1398
1509
  break;
1399
- case "TODAY":
1400
- case "DATE":
1401
- oSelectOptionState.option = "EQ";
1402
- break;
1403
1510
  case "EEQ":
1404
1511
  oSelectOptionState.option = "EQ";
1405
1512
  break;
@@ -1459,13 +1566,6 @@ sap.ui.define(
1459
1566
  var oFilter = aFilters[item];
1460
1567
  sLow = (oFilter.values[0] && oFilter.values[0].toString()) || "";
1461
1568
  sHigh = (oFilter.values[1] && oFilter.values[1].toString()) || null;
1462
- if (oFilter.operator === "TODAY" || oFilter.operator === "DATE") {
1463
- var aFilter = oFilterInfo[0].aFilters.filter(function(oFilter) {
1464
- return oFilter.sPath === sFilter;
1465
- });
1466
- sLow = aFilter[0].oValue1 || "";
1467
- sHigh = null;
1468
- }
1469
1569
  var oSelectOptionValues = fnGetSignAndOption(oFilter.operator, sLow, sHigh);
1470
1570
  if (oSelectOptionValues.option) {
1471
1571
  oSelectionVariant.addSelectOption(
@@ -1567,32 +1667,37 @@ sap.ui.define(
1567
1667
  }
1568
1668
 
1569
1669
  /**
1570
- * Sets the FLP user defaults.
1670
+ * Defines the user default settings for the SAP Fiori Launchpad.
1571
1671
  *
1572
1672
  * @function
1573
1673
  * @name sap.fe.core.CommonUtils.setUserDefaults
1574
1674
  * @memberof sap.fe.core.CommonUtils
1575
1675
  * @param {object} [oAppComponent] The AppComponent
1576
1676
  * @param {Array} [aParameters] Parameters in the dialog
1577
- * @param {object} [oModel] Model to which the default value has to be set
1677
+ * @param {object} [oModel] Model for which the default value has to be set
1578
1678
  * @param {boolean} [bIsAction] `true` if aParameters contains action parameters
1679
+ * @param {boolean} [bIsCreate] `true` if preferredMode is 'create'
1680
+ * @param {object} [oActionDefaultValues] Inbound Create Parameters from the Manifest
1579
1681
  * @returns {Promise}
1580
1682
  * @ui5-restricted
1581
1683
  * @final
1582
1684
  **/
1583
- function setUserDefaults(oAppComponent, aParameters, oModel, bIsAction) {
1685
+ function setUserDefaults(oAppComponent, aParameters, oModel, bIsAction, bIsCreate, oActionDefaultValues) {
1584
1686
  return new Promise(function(resolve, reject) {
1585
1687
  var oComponentData = oAppComponent.getComponentData(),
1586
1688
  oStartupParameters = (oComponentData && oComponentData.startupParameters) || {},
1587
1689
  oShellServices = oAppComponent.getShellServices();
1588
-
1589
1690
  if (!oShellServices.hasUShell()) {
1590
1691
  aParameters.map(function(oParameter) {
1591
1692
  var sPropertyName = bIsAction
1592
1693
  ? "/" + oParameter.$Name
1593
1694
  : oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
1594
1695
  var sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
1595
- if (oStartupParameters[sParameterName]) {
1696
+ if (oActionDefaultValues && bIsCreate) {
1697
+ if (oActionDefaultValues[sParameterName]) {
1698
+ oModel.setProperty(sPropertyName, oActionDefaultValues[sParameterName]);
1699
+ }
1700
+ } else if (oStartupParameters[sParameterName]) {
1596
1701
  oModel.setProperty(sPropertyName, oStartupParameters[sParameterName][0]);
1597
1702
  }
1598
1703
  });
@@ -1606,7 +1711,11 @@ sap.ui.define(
1606
1711
  ? "/" + oParameter.$Name
1607
1712
  : oParameter.getPath().slice(oParameter.getPath().lastIndexOf("/") + 1);
1608
1713
  var sParameterName = bIsAction ? sPropertyName.slice(1) : sPropertyName;
1609
- if (oStartupParameters[sParameterName]) {
1714
+ if (oActionDefaultValues && bIsCreate) {
1715
+ if (oActionDefaultValues[sParameterName]) {
1716
+ oModel.setProperty(sPropertyName, oActionDefaultValues[sParameterName]);
1717
+ }
1718
+ } else if (oStartupParameters[sParameterName]) {
1610
1719
  oModel.setProperty(sPropertyName, oStartupParameters[sParameterName][0]);
1611
1720
  } else if (aExtendedParameters.length > 0) {
1612
1721
  for (var i in aExtendedParameters) {
@@ -1625,6 +1734,24 @@ sap.ui.define(
1625
1734
  });
1626
1735
  }
1627
1736
 
1737
+ function getAdditionalParamsForCreate(oStartupParameters, oInboundParameters) {
1738
+ var oInbounds = oInboundParameters,
1739
+ aCreateParameters = oInbounds
1740
+ ? Object.keys(oInbounds).filter(function(sParameter) {
1741
+ return oInbounds[sParameter].useForCreate;
1742
+ })
1743
+ : [],
1744
+ oRet;
1745
+ for (var i = 0; i < aCreateParameters.length; i++) {
1746
+ var sCreateParameter = aCreateParameters[i];
1747
+ var aValues = oStartupParameters && oStartupParameters[sCreateParameter];
1748
+ if (aValues && aValues.length === 1) {
1749
+ oRet = oRet || Object.create(null);
1750
+ oRet[sCreateParameter] = aValues[0];
1751
+ }
1752
+ }
1753
+ return oRet;
1754
+ }
1628
1755
  /**
1629
1756
  * Gets semantic object mappings defined in app descriptor outbounds.
1630
1757
  *
@@ -2132,6 +2259,52 @@ sap.ui.define(
2132
2259
  return Promise.resolve(null);
2133
2260
  }
2134
2261
 
2262
+ /**
2263
+ * Add binding event listener.
2264
+ *
2265
+ * @param {object} oControl Control instance
2266
+ * @param {object} sEventName Event name
2267
+ * @param {object} fHandler Handler to be called
2268
+ * @private
2269
+ * @ui5-restricted
2270
+ */
2271
+ function addEventToBindingInfo(oControl, sEventName, fHandler) {
2272
+ var oBindingInfo;
2273
+ var setBindingInfo = function() {
2274
+ if (oBindingInfo) {
2275
+ if (!oBindingInfo.events) {
2276
+ oBindingInfo.events = {};
2277
+ }
2278
+ if (!oBindingInfo.events[sEventName]) {
2279
+ oBindingInfo.events[sEventName] = fHandler;
2280
+ } else {
2281
+ var fOriginalHandler = oBindingInfo.events[sEventName];
2282
+ oBindingInfo.events[sEventName] = function() {
2283
+ fHandler.apply(this, arguments);
2284
+ fOriginalHandler.apply(this, arguments);
2285
+ };
2286
+ }
2287
+ }
2288
+ };
2289
+ if (oControl.isA("sap.ui.mdc.ChartNew")) {
2290
+ oControl
2291
+ .innerChartBound()
2292
+ .then(function() {
2293
+ oBindingInfo = oControl
2294
+ .getControlDelegate()
2295
+ ._getChart(oControl)
2296
+ .getBindingInfo("data");
2297
+ setBindingInfo();
2298
+ })
2299
+ .catch(function(sError) {
2300
+ Log.error(sError);
2301
+ });
2302
+ } else {
2303
+ oBindingInfo = oControl.data("rowsBindingInfo");
2304
+ setBindingInfo();
2305
+ }
2306
+ }
2307
+
2135
2308
  function loadMacroLibrary() {
2136
2309
  return new Promise(function(resolve, reject) {
2137
2310
  sap.ui.require(["sap/fe/macros/macroLibrary"], function(/*macroLibrary*/) {
@@ -2182,8 +2355,10 @@ sap.ui.define(
2182
2355
  getSearchRestrictions: getSearchRestrictions,
2183
2356
  getFilterRestrictionsByPath: getFilterRestrictionsByPath,
2184
2357
  getSpecificAllowedExpression: getSpecificAllowedExpression,
2358
+ getAdditionalParamsForCreate: getAdditionalParamsForCreate,
2185
2359
  requestSingletonProperty: requestSingletonProperty,
2186
2360
  templateControlFragment: templateControlFragment,
2361
+ addEventToBindingInfo: addEventToBindingInfo,
2187
2362
  FilterRestrictions: {
2188
2363
  REQUIRED_PROPERTIES: "RequiredProperties",
2189
2364
  NON_FILTERABLE_PROPERTIES: "NonFilterableProperties",
@@ -2197,7 +2372,8 @@ sap.ui.define(
2197
2372
  "SearchExpression",
2198
2373
  "MultiRangeOrSearchExpression"
2199
2374
  ],
2200
- fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation
2375
+ fnProcessDataLossOrDraftDiscardConfirmation: fnProcessDataLossOrDraftDiscardConfirmation,
2376
+ normalizeSearchTerm: normalizeSearchTerm
2201
2377
  };
2202
2378
 
2203
2379
  return CommonUtils;
@@ -100,7 +100,7 @@ sap.ui.define(
100
100
  * <li>undefined: the undefined model returns the SAPUI5 OData V4 model bound to this page</li>
101
101
  * <li>i18n / further data models defined in the manifest</li>
102
102
  * <li>ui: returns a SAPUI5 JSON model containing UI information.
103
- * Only the following properties are public and supported,
103
+ * Only the following properties are public and supported:
104
104
  * <ul>
105
105
  * <li>editMode: contains either 'Editable' or 'Display'</li>
106
106
  * </ul>
@@ -15,7 +15,9 @@ sap.ui.define(
15
15
  "sap/fe/core/controllerextensions/IntentBasedNavigation",
16
16
  "sap/fe/core/controllerextensions/InternalIntentBasedNavigation",
17
17
  "sap/fe/core/controllerextensions/Share",
18
- "sap/fe/core/controllerextensions/ViewState"
18
+ "sap/fe/core/controllerextensions/ViewState",
19
+ "sap/fe/core/controllerextensions/Paginator",
20
+ "sap/fe/core/controllerextensions/Placeholder"
19
21
  ],
20
22
  function(
21
23
  Controller,
@@ -29,7 +31,9 @@ sap.ui.define(
29
31
  IntentBasedNavigation,
30
32
  InternalIntentBasedNavigation,
31
33
  Share,
32
- ViewState
34
+ ViewState,
35
+ Paginator,
36
+ Placeholder
33
37
  ) {
34
38
  "use strict";
35
39
 
@@ -53,7 +57,9 @@ sap.ui.define(
53
57
  pageReady: PageReady,
54
58
  messageHandler: MessageHandler,
55
59
  share: Share,
60
+ paginator: Paginator,
56
61
  viewState: ViewState,
62
+ placeholder: Placeholder,
57
63
  /**
58
64
  * @private
59
65
  * @name sap.fe.core.PageController.getMetadata
@@ -98,6 +104,11 @@ sap.ui.define(
98
104
  this.getView().setModel(oInternalModel, "internal");
99
105
  },
100
106
 
107
+ onBeforeRendering: function() {
108
+ if (this.placeholder.attachHideCallback) {
109
+ this.placeholder.attachHideCallback();
110
+ }
111
+ },
101
112
  getExtensionAPI: function() {
102
113
  if (!this.extensionAPI) {
103
114
  this.extensionAPI = new ExtensionAPI(this);