@sapui5/sap.suite.ui.generic.template 1.84.16 → 1.84.19

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 (42) hide show
  1. package/package.json +1 -1
  2. package/src/sap/suite/ui/generic/template/.library +1 -1
  3. package/src/sap/suite/ui/generic/template/changeHandler/AddFilterItem.js +1 -1
  4. package/src/sap/suite/ui/generic/template/changeHandler/AddFooterActionButton.js +1 -1
  5. package/src/sap/suite/ui/generic/template/changeHandler/AddGroup.js +1 -1
  6. package/src/sap/suite/ui/generic/template/changeHandler/AddGroupElement.js +1 -1
  7. package/src/sap/suite/ui/generic/template/changeHandler/AddHeaderActionButton.js +1 -1
  8. package/src/sap/suite/ui/generic/template/changeHandler/AddHeaderFacet.js +1 -1
  9. package/src/sap/suite/ui/generic/template/changeHandler/AddSection.js +1 -1
  10. package/src/sap/suite/ui/generic/template/changeHandler/AddSubSection.js +1 -1
  11. package/src/sap/suite/ui/generic/template/changeHandler/AddTableColumn.js +1 -1
  12. package/src/sap/suite/ui/generic/template/changeHandler/AddToolbarActionButton.js +1 -1
  13. package/src/sap/suite/ui/generic/template/changeHandler/MoveFilterItems.js +1 -1
  14. package/src/sap/suite/ui/generic/template/changeHandler/MoveGroup.js +1 -1
  15. package/src/sap/suite/ui/generic/template/changeHandler/MoveGroupElement.js +1 -1
  16. package/src/sap/suite/ui/generic/template/changeHandler/MoveHeaderAndFooterActionButton.js +1 -1
  17. package/src/sap/suite/ui/generic/template/changeHandler/MoveHeaderFacet.js +1 -1
  18. package/src/sap/suite/ui/generic/template/changeHandler/MoveSection.js +1 -1
  19. package/src/sap/suite/ui/generic/template/changeHandler/MoveSubSection.js +1 -1
  20. package/src/sap/suite/ui/generic/template/changeHandler/MoveTableColumns.js +1 -1
  21. package/src/sap/suite/ui/generic/template/changeHandler/MoveToolbarActionButtons.js +1 -1
  22. package/src/sap/suite/ui/generic/template/changeHandler/RemoveFilterItem.js +1 -1
  23. package/src/sap/suite/ui/generic/template/changeHandler/RemoveGroup.js +1 -1
  24. package/src/sap/suite/ui/generic/template/changeHandler/RemoveGroupElement.js +1 -1
  25. package/src/sap/suite/ui/generic/template/changeHandler/RemoveHeaderAndFooterActionButton.js +1 -1
  26. package/src/sap/suite/ui/generic/template/changeHandler/RemoveHeaderFacet.js +1 -1
  27. package/src/sap/suite/ui/generic/template/changeHandler/RemoveSection.js +1 -1
  28. package/src/sap/suite/ui/generic/template/changeHandler/RemoveSubSection.js +1 -1
  29. package/src/sap/suite/ui/generic/template/changeHandler/RemoveTableColumn.js +1 -1
  30. package/src/sap/suite/ui/generic/template/changeHandler/RemoveToolbarActionButton.js +1 -1
  31. package/src/sap/suite/ui/generic/template/changeHandler/RevealFilterItem.js +1 -1
  32. package/src/sap/suite/ui/generic/template/changeHandler/RevealHeaderFacet.js +1 -1
  33. package/src/sap/suite/ui/generic/template/changeHandler/RevealTableColumn.js +1 -1
  34. package/src/sap/suite/ui/generic/template/changeHandler/RevealToolbarActionButton.js +1 -1
  35. package/src/sap/suite/ui/generic/template/changeHandler/generic/AddElement.js +1 -1
  36. package/src/sap/suite/ui/generic/template/changeHandler/generic/MoveElements.js +1 -1
  37. package/src/sap/suite/ui/generic/template/changeHandler/generic/RemoveElement.js +1 -1
  38. package/src/sap/suite/ui/generic/template/changeHandler/generic/RevealElement.js +1 -1
  39. package/src/sap/suite/ui/generic/template/changeHandler/util/AnnotationPropertyCommand.js +1 -1
  40. package/src/sap/suite/ui/generic/template/lib/navigation/NavigationController.js +5 -4
  41. package/src/sap/suite/ui/generic/template/lib/navigation/jsonHelper.js +190 -0
  42. package/src/sap/suite/ui/generic/template/library.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sapui5/sap.suite.ui.generic.template",
3
- "version": "1.84.16",
3
+ "version": "1.84.19",
4
4
  "description": "SAPUI5 Library sap.suite.ui.generic.template",
5
5
  "homepage": "https://sap.github.io/ui5-tooling/pages/SAPUI5/",
6
6
  "author": "SAP SE (https://www.sap.com)",
@@ -7,7 +7,7 @@
7
7
 
8
8
  (c) Copyright 2009-2015 SAP SE. All rights reserved
9
9
  </copyright>
10
- <version>1.84.16</version>
10
+ <version>1.84.19</version>
11
11
 
12
12
  <documentation>Library with generic Suite UI templates.</documentation>
13
13
 
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  *
31
31
  * @alias sap.suite.ui.generic.template.changeHandler.AddFilterItem
32
32
  * @author SAP SE
33
- * @version 1.84.16
33
+ * @version 1.84.19
34
34
  * @experimental
35
35
  */
36
36
  var AddFilterItem = {};
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.AddFooterActionButton
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  * @experimental
22
22
  */
23
23
  var AddFooterActionButton = {};
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  *
15
15
  * @alias sap.suite.ui.generic.template.changeHandler.AddGroup
16
16
  * @author SAP SE
17
- * @version 1.84.16
17
+ * @version 1.84.19
18
18
  * @experimental
19
19
  */
20
20
  var AddGroup = {};
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  * Change handler for adding a group element in a SmartForm group.
16
16
  *
17
17
  * @author SAP SE
18
- * @version 1.84.16
18
+ * @version 1.84.19
19
19
  * @experimental
20
20
  */
21
21
  var DATAFIELD = "com.sap.vocabularies.UI.v1.DataField";
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.AddHeaderActionButton
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  * @experimental
22
22
  */
23
23
  var AddHeaderActionButton = {};
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.AddHeaderFacet
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var AddHeaderFacet = {};
@@ -14,7 +14,7 @@ sap.ui.define([
14
14
  *
15
15
  * @alias sap.suite.ui.generic.template.changeHandler.AddSection **
16
16
  * @author SAP SE
17
- * @version 1.84.16
17
+ * @version 1.84.19
18
18
  * @experimental
19
19
  */
20
20
  var AddSection = {};
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.suite.ui.generic.template.changeHandler.Add SubSection **
20
20
  * @author SAP SE
21
- * @version 1.84.16
21
+ * @version 1.84.19
22
22
  * @experimental
23
23
  */
24
24
  var AddSubSection = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.AddTableColumn
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var AddTableColumn = {};
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.AddToolbarActionButton
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  * @experimental
22
22
  */
23
23
  var AddToolbarActionButton = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.MoveFilterItem
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var MoveFilterItems = {};
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.MoveGroup
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var MoveGroup = {},
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  * Change handler for moving a form group element.
16
16
  *
17
17
  * @author SAP SE
18
- * @version 1.84.16
18
+ * @version 1.84.19
19
19
  * @experimental
20
20
  */
21
21
  var MoveGroupElement = {};
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @alias sap.suite.ui.generic.template.changeHandler.MoveHeaderAndFooterActionButton
22
22
  * @author SAP SE
23
- * @version 1.84.16
23
+ * @version 1.84.19
24
24
  * @experimental
25
25
  */
26
26
  var MoveHeaderAndFooterActionButton = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.MoveHeaderFacet
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var MoveHeaderFacet = {},
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.MoveGroup
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var MoveSection = {};
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.MoveSubSection
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var MoveSubSection = {},
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.MoveTableColumns
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var MoveTableColumns = {};
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @alias sap.suite.ui.generic.template.changeHandler.MoveToolbarActionButtons
23
23
  * @author SAP SE
24
- * @version 1.84.16
24
+ * @version 1.84.19
25
25
  * @experimental
26
26
  */
27
27
  var MoveToolbarActionButtons = {};
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveFilterItem
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  */
22
22
 
23
23
  var RemoveFilterItem = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveGroup
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var RemoveGroup = {};
@@ -13,7 +13,7 @@ sap.ui.define([
13
13
  * Change handler for removing a form group element.
14
14
  *
15
15
  * @author SAP SE
16
- * @version 1.84.16
16
+ * @version 1.84.19
17
17
  * @experimental
18
18
  */
19
19
  var FIELDGROUP = "com.sap.vocabularies.UI.v1.FieldGroup";
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  *
16
16
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveHeaderAndFooterActionButton
17
17
  * @author SAP SE
18
- * @version 1.84.16
18
+ * @version 1.84.19
19
19
  * @experimental
20
20
  */
21
21
  var RemoveHeaderAndFooterActionButton = {};
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveHeaderFacet **
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  * @experimental
22
22
  */
23
23
  var RemoveHeaderFacet = {};
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  *
18
18
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveSection **
19
19
  * @author SAP SE
20
- * @version 1.84.16
20
+ * @version 1.84.19
21
21
  * @experimental
22
22
  */
23
23
  var RemoveSection = {};
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  *
19
19
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveSection **
20
20
  * @author SAP SE
21
- * @version 1.84.16
21
+ * @version 1.84.19
22
22
  * @experimental
23
23
  */
24
24
  var RemoveSubSection = {};
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  *
16
16
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveTableColumn
17
17
  * @author SAP SE
18
- * @version 1.84.16
18
+ * @version 1.84.19
19
19
  */
20
20
 
21
21
  var RemoveTableColumn = {};
@@ -15,7 +15,7 @@ sap.ui.define([
15
15
  *
16
16
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveToolbarActionButton
17
17
  * @author SAP SE
18
- * @version 1.84.16
18
+ * @version 1.84.19
19
19
  * @experimental
20
20
  */
21
21
 
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.RevealFilterItem
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var RevealFilterItem = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.RevealHeaderFacet
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
  var RevealHeaderFacet = {};
@@ -16,7 +16,7 @@ sap.ui.define([
16
16
  *
17
17
  * @alias sap.suite.ui.generic.template.changeHandler.RevealTableColumn
18
18
  * @author SAP SE
19
- * @version 1.84.16
19
+ * @version 1.84.19
20
20
  * @experimental
21
21
  */
22
22
  var RevealTableColumn = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.RevealToolbarActionButton
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  * @experimental
24
24
  */
25
25
 
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @alias sap.suite.ui.generic.template.changeHandler.AddElement
22
22
  * @author SAP SE
23
- * @version 1.84.16
23
+ * @version 1.84.19
24
24
  * @experimental
25
25
  */
26
26
  var AddElement = {};
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.MoveElements
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  */
24
24
 
25
25
  var MoveElements = {},
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @alias sap.suite.ui.generic.template.changeHandler.RemoveElement
21
21
  * @author SAP SE
22
- * @version 1.84.16
22
+ * @version 1.84.19
23
23
  */
24
24
 
25
25
  var RemoveElement = {};
@@ -20,7 +20,7 @@ sap.ui.define([
20
20
  *
21
21
  * @alias sap.suite.ui.generic.template.changeHandler.RevealElements
22
22
  * @author SAP SE
23
- * @version 1.84.16
23
+ * @version 1.84.19
24
24
  * @experimental
25
25
  */
26
26
  var RevealElement = {};
@@ -30,7 +30,7 @@ sap.ui.define([
30
30
  * @class
31
31
  * @extends sap.ui.rta.command.FlexCommand
32
32
  * @author SAP SE
33
- * @version 1.84.16
33
+ * @version 1.84.19
34
34
  * @constructor
35
35
  * @private
36
36
  * @alias sap.suite.ui.generic.template.changeHandler.util.AnnotationPropertyCommand
@@ -64,6 +64,7 @@ sap.ui.define(["sap/ui/base/Object",
64
64
  "sap/suite/ui/generic/template/lib/CRUDHelper",
65
65
  "sap/suite/ui/generic/template/lib/ProcessObserver",
66
66
  "sap/suite/ui/generic/template/lib/Queue",
67
+ "sap/suite/ui/generic/template/lib/navigation/jsonHelper",
67
68
  "sap/suite/ui/generic/template/lib/navigation/routingHelper",
68
69
  "sap/suite/ui/generic/template/lib/TemplateComponent",
69
70
  "sap/suite/ui/generic/template/lib/testableHelper",
@@ -74,7 +75,7 @@ sap.ui.define(["sap/ui/base/Object",
74
75
  "sap/base/util/isEmptyObject",
75
76
  "sap/base/util/UriParameters",
76
77
  "sap/suite/ui/generic/template/lib/FeError"
77
- ], function(BaseObject, ComponentContainer, HashChanger, History, coreLibrary, CRUDHelper, ProcessObserver, Queue, routingHelper,
78
+ ], function(BaseObject, ComponentContainer, HashChanger, History, coreLibrary, CRUDHelper, ProcessObserver, Queue, jsonHelper, routingHelper,
78
79
  TemplateComponent, testableHelper, ControlPersonalizationAPI, FeLogger, merge, extend, isEmptyObject, UriParameters, FeError) {
79
80
  "use strict";
80
81
  var sClassName = "lib.navigation.NavigationController";
@@ -1246,7 +1247,7 @@ sap.ui.define(["sap/ui/base/Object",
1246
1247
  var sPredefinedKey;
1247
1248
  if (vPredefinedValues){
1248
1249
  var oAppState = oCrossAppNavigator.createEmptyAppState(oTemplateContract.oAppComponent);
1249
- oAppState.setData(vPredefinedValues);
1250
+ oAppState.setData(jsonHelper.getStringifiable(vPredefinedValues));
1250
1251
  oAppState.save();
1251
1252
  sPredefinedKey = oAppState.getKey();
1252
1253
  }
@@ -1779,7 +1780,7 @@ sap.ui.define(["sap/ui/base/Object",
1779
1780
  return oPredefinedValuesPromise.then(function(oAppStateData){
1780
1781
  oRegistryEntry.nonDraftCreateContext = oPredefinedCreateContext ||
1781
1782
  oRegistryEntry.nonDraftCreateContext ||
1782
- CRUDHelper.createNonDraft(oParentContext, sBindingPath, oModel, oAppStateData && oAppStateData.getData(), oTemplateContract.oApplicationProxy.mustRequireRequestsCanonical());
1783
+ CRUDHelper.createNonDraft(oParentContext, sBindingPath, oModel, oAppStateData && jsonHelper.deStringify(oAppStateData.getData()), oTemplateContract.oApplicationProxy.mustRequireRequestsCanonical());
1783
1784
  oPredefinedCreateContext = null;
1784
1785
  return fnPerformActivation(oRegistryEntry.nonDraftCreateContext.getPath());
1785
1786
  });
@@ -2351,7 +2352,7 @@ sap.ui.define(["sap/ui/base/Object",
2351
2352
  * @param {sap.suite.ui.generic.template.lib.AppComponent} oAppComponent The AppComponent instance
2352
2353
  * @public
2353
2354
  * @extends sap.ui.base.Object
2354
- * @version 1.84.16
2355
+ * @version 1.84.19
2355
2356
  * @since 1.30.0
2356
2357
  * @alias sap.suite.ui.generic.template.lib.NavigationController
2357
2358
  */
@@ -0,0 +1,190 @@
1
+ sap.ui.define([], function() {
2
+ "use strict";
3
+
4
+ var sVersionPropertyName = "sap.suite.ui.generic.template.genericUtils.jsonHelper.versionInfo";
5
+
6
+ // Helper function for getStringifiable which adds replacement infos for a subtree
7
+ // vObject is a nested subobject of the original object and aPath is the property path that has taken us to vObject
8
+ // aReplaces is the array which accumulates the replace operations
9
+ function fnAccumulateReplaceInfo(vObject, aReplaces, aPath){
10
+ // Following cases need to be considered:
11
+ // 1. vObject is undefined -> create a replacement for undefined and we are done
12
+ // 2. vObject is an instance of Date -> create a replacement for the Date and we are done
13
+ // 3. vObject is any other object -> recursively check the properties of vObject for replacements
14
+ // 4. vObject is neither an object nor undefined -> vObject does not create any need for replacements
15
+ if (typeof vObject !== "object"){ // case 1 or 4
16
+ if (vObject === undefined){ // case 1
17
+ aReplaces.push({
18
+ type: "undefined",
19
+ path: aPath
20
+ });
21
+ }
22
+ return;
23
+ }
24
+ if (vObject instanceof Date){ // case 2
25
+ var oReplacement = {
26
+ type: "Date",
27
+ milliseconds: vObject.getTime(),
28
+ path: aPath
29
+ };
30
+ // Edge case: Even instances of Date may have properties. These will not be serialized by JSON.stringify.
31
+ // -> In order to be able to restore the properties of vObject they need to be stored within oReplacement, too.
32
+ // This is done by adding the representation provided by getStringifiable(), since this can be restored most easily.
33
+ // Thus a map: <property name> -> getStringifiable(<property value>) is created and added to oReplacement (in case it is not empty) as property 'childProps'.
34
+ var oChildProps = Object.create(null);
35
+ for (var sProperty in vObject){
36
+ oChildProps[sProperty] = getStringifiable(vObject[sProperty]);
37
+ oReplacement.childProps = oChildProps; // Note that this is only effective when being called the first time
38
+ }
39
+ aReplaces.push(oReplacement);
40
+ return;
41
+ }
42
+ // case 3
43
+ for (var sProperty in vObject){
44
+ var vPart = vObject[sProperty];
45
+ var aPathToProperty = aPath.concat(sProperty);
46
+ fnAccumulateReplaceInfo(vPart, aReplaces, aPathToProperty);
47
+ }
48
+ }
49
+
50
+ /*
51
+ * This function is intended to work together with function fnDeStringify (see below).
52
+ * The usage of these two functions allow to serialize/deserialize java script object containing instances of Date and undefined values without data loss.
53
+ * To achieve this goal the functions should be used together with the standard serialization/deseriazation methods JSON.stringify/parse.
54
+ * Note that when using those standard functions there might be a data loss if the object to be serialized contains instances of Date or properties which have value undefined.
55
+ * In order to achieve this the following mimic should be used:
56
+ * Before serializing a given java script object vObject1 pass it to this function.
57
+ * The returned value will be an object vObject2 which might be identical to vObject1 or have a pointer to vObject1 (so do not modify vObject1 or one of its components before the next step).
58
+ * Now serialize vObject2 via JSON.stringify or any other service which internally uses a logic similar to JSON.stringify.
59
+ * When you want to obtain again a deserialized version of your object, take the serialized version you have received and deserialize it with JSON.parse resp. any other service which inverts the serialization applied beforehand.
60
+ * This will provide another javascript object vObject3.
61
+ * Pass vObject3 to fnDeStringify and receive another object vObject4.
62
+ * vObject4 will be a cloned version of vObject1.
63
+ * The following remarks apply:
64
+ * - Any other restriction of the serialization/deserialization process implemented by JSON.stringify/parse still apply. In particular function objects will get lost by this process and trying to serialize a circular structure may fail.
65
+ * - In order to be as robust as possible against a process which has missed to apply the getStringifiable function on the object to be serialized (meaning vObject2 will be taken as vObject1 in the description above) the following additional rules apply:
66
+ * # vObject2 will only differ from vObject1 if it contains (possibly nested) an object of type Date or an undefined value or it mimics to be a result of getStringifiable itself.
67
+ * # fnDeStringify will handle all kinds of objects. If the object passed to it cannot be identified as being a result of a process as described above it will simply return the instance passed to it
68
+ * - The last step may perform changes on vObject3. vObject4 might be identical to vObject3 or have a reference to one of its components. Therefore, it is recommended to skip any reference to vObject3 after vObject4 has been obtained.
69
+ */
70
+ function getStringifiable(vObject){
71
+ if (vObject !== undefined && (!vObject || typeof vObject !== "object")){ // in all these cases JSON.stringify/parse does the job
72
+ return vObject;
73
+ }
74
+ // In aReplaces we accumulate all necessary replacement operations that need to be applied in fnDeStringify.
75
+ // Each entry contains properties:
76
+ // - type: describes the type of replacement to be done (current values are 'Date' and 'undefined')
77
+ // - path: an array of strings that describes how to step down to the property where the replacement needs to be done
78
+ // - additional properties might be used depending on the replacement type
79
+ var aReplaces = [];
80
+ fnAccumulateReplaceInfo(vObject, aReplaces, []);
81
+ if (aReplaces.length === 0 && !vObject[sVersionPropertyName]){ // if no replacement is necessary the current object could still be an object that mimics to be a result of getStringifiable itself. Otherwise we can use the object itself.
82
+ return vObject;
83
+ }
84
+ var oRet = { // If a replacement is necessary we put together the object itself and the replacement information
85
+ data: vObject,
86
+ replaces: aReplaces
87
+ };
88
+ oRet[sVersionPropertyName] = 1; // mark oRet as an object that is created by getStringifiable
89
+ return oRet;
90
+ }
91
+
92
+ // See documentation of getStringifiable
93
+ function fnDeStringify(vObject){
94
+ if (!vObject || typeof vObject !== "object" || vObject[sVersionPropertyName] !== 1 || !Array.isArray(vObject.replaces)){
95
+ return vObject; // in these cases either vObject is not a result of getStringifiable() or it is an object for which getStringifiable() acts as identity function
96
+ }
97
+ var aReplacers = []; // build an array of functions that execute the necessary replacements on vObject
98
+ var oRootReplacement; // The replacement for vObject itself (if it exists)
99
+ var bError = vObject.replaces.some(function(oReplaceInfo){ // bError will be true if any memeber of vObject.replaces proves that vObject is not "a valid vObject3" (see above)
100
+ if (typeof oReplaceInfo !== "object" || !Array.isArray(oReplaceInfo.path)){
101
+ return true; // oReplaceInfo is not a valid replacement description
102
+ }
103
+ if (oReplaceInfo.path.length === 0){ // oReplaceInfo defines a replacement for vObject itself -> vObject either represents undefined or a Date
104
+ oRootReplacement = oReplaceInfo;
105
+ return vObject.replaces.length > 1; // if vObject is either udefined or a Date there should be no other replacement info
106
+ }
107
+ var fnReplacer; // a function that executes the replacements defined by oReplaceInfo
108
+ var vCurrent = vObject.data; // current position in vObject-data while navigating according to the path specified by oReplaceInfo.path
109
+ var bRet = oReplaceInfo.path.some(function(sProp, i){ // navigate down in vObject.data. bRet will indicate whether something was found that indicates the oReplaceInfo is not valid
110
+ if (typeof vCurrent !== "object" || typeof sProp !== "string"){ // vCurrent should be an object that possesses a property with name sProp
111
+ return true;
112
+ }
113
+ if (i === oReplaceInfo.path.length - 1){ // do not step down the last step in hierarchy, since we want to do a replacement for that property
114
+ switch (oReplaceInfo.type){
115
+ case "undefined":
116
+ if (vCurrent.hasOwnProperty(sProp)){ // oReplaceInfo states that this property has value undefined -> JSON.stringify will have ignored it
117
+ return true; // In case the property is there anyway oReplaceInfo cannot be valid (for vObject.data)
118
+ }
119
+ // looks ok -> Create a function that sets the property to undefined in vCurrent
120
+ fnReplacer = function(){
121
+ vCurrent[sProp] = undefined;
122
+ };
123
+ return false;
124
+ case "Date":
125
+ if (Number.isInteger(oReplaceInfo.milliseconds)){ // Check whether oReplaceInfo is really a replacement info for a Date
126
+ var dReplace = new Date(oReplaceInfo.milliseconds); // This is the Date which should be put at vCurrent[sProp]
127
+ if (JSON.stringify(dReplace) !== '"' + vCurrent[sProp] + '"'){
128
+ return true; // dReplace and the current value do not fit to each other
129
+ }
130
+ if (oReplaceInfo.childProps && typeof oReplaceInfo.childProps !== "object"){
131
+ return true; // The childProps property is there but does not have the expected structure
132
+ }
133
+ fnReplacer = function(){
134
+ if (oReplaceInfo.childProps){
135
+ for (var sChildProp in oReplaceInfo.childProps){
136
+ dReplace[sChildProp] = fnDeStringify(oReplaceInfo.childProps[sChildProp]);
137
+ }
138
+ }
139
+ vCurrent[sProp] = dReplace;
140
+ };
141
+ return false; // everything looks fine -> a replacer implementing the defined replacement could be created
142
+ }
143
+ return true; // oReplaceInfo cannot be a valid replacement for a Date
144
+ default: return true; // unknown type of ReplacementInfo
145
+ }
146
+ }
147
+ // in any othe step then the last just move down the hierarchy
148
+ vCurrent = vCurrent[sProp];
149
+ });
150
+ aReplacers.push(fnReplacer); // add the created replacer function to the list (might be undefined if bRet is true, but then it will be ignored anyway)
151
+ return bRet;
152
+ });
153
+ if (bError){ // if vObject is not valid for vObject3, return it unchanged according to the contract
154
+ return vObject;
155
+ }
156
+ if (oRootReplacement){ // there is just one replacement info and that applies to the root itself -> The instance to be created is either undefined or a Date
157
+ if (oRootReplacement.type === "undefined"){
158
+ return undefined;
159
+ } else if (oRootReplacement.type === "Date" && Number.isInteger(oRootReplacement.milliseconds)){
160
+ var dRet = new Date(oRootReplacement.milliseconds); // the Date object to be returned
161
+ if (JSON.stringify(dRet) === '"' + vObject.data + '"'){ // If dRet is consistent with the string representation expected in vObject.data
162
+ if (oRootReplacement.childProps){ // if there are child properties to be added
163
+ if (typeof oRootReplacement.childProps !== "object"){ // that would not be a valid childProps -> oRootReplacement would not be valid
164
+ return vObject;
165
+ }
166
+ // add the properties to dRet as defined in oRootReplacement.childProps
167
+ for (var sChildProp in oRootReplacement.childProps){
168
+ dRet[sChildProp] = fnDeStringify(oRootReplacement.childProps[sChildProp]);
169
+ }
170
+ }
171
+ return dRet; // return the Date which was created as decribed in oRootReplacement
172
+ }
173
+ }
174
+ return vObject; // oRootReplacement is not a valid replacement
175
+ }
176
+ // vObject.data is the right object, but it needs to be adjusted by calling the collected replacers
177
+ aReplacers.forEach(function(fnReplace){
178
+ fnReplace();
179
+ });
180
+ // return the adjusted instance
181
+ return vObject.data;
182
+ }
183
+
184
+ var oJsonHelper = {
185
+ getStringifiable: getStringifiable,
186
+ deStringify: fnDeStringify
187
+ };
188
+
189
+ return oJsonHelper;
190
+ });
@@ -36,7 +36,7 @@ sap.ui.define(['sap/ui/core/library'
36
36
  interfaces: [],
37
37
  controls: [],
38
38
  elements: [],
39
- version: "1.84.16",
39
+ version: "1.84.19",
40
40
  extensions: {
41
41
  //Configuration used for rule loading of Support Assistant
42
42
  "sap.ui.support": {