@openui5/sap.ui.fl 1.118.0 → 1.119.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 (156) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +3 -3
  3. package/src/sap/ui/fl/.library +1 -1
  4. package/src/sap/ui/fl/ChangePersistence.js +1 -1
  5. package/src/sap/ui/fl/ChangePersistenceFactory.js +1 -1
  6. package/src/sap/ui/fl/FakeLrepConnectorLocalStorage.js +1 -1
  7. package/src/sap/ui/fl/FakeLrepConnectorSessionStorage.js +1 -1
  8. package/src/sap/ui/fl/FakeLrepLocalStorage.js +1 -1
  9. package/src/sap/ui/fl/FlexController.js +1 -1
  10. package/src/sap/ui/fl/FlexControllerFactory.js +1 -1
  11. package/src/sap/ui/fl/LayerUtils.js +14 -7
  12. package/src/sap/ui/fl/Utils.js +72 -172
  13. package/src/sap/ui/fl/apply/_internal/DelegateMediator.js +1 -1
  14. package/src/sap/ui/fl/apply/_internal/changes/Applier.js +8 -4
  15. package/src/sap/ui/fl/apply/_internal/changes/FlexCustomData.js +1 -1
  16. package/src/sap/ui/fl/apply/_internal/changes/Utils.js +1 -1
  17. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ApplyStrategyFactory.js +28 -8
  18. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Preprocessor.js +1 -1
  19. package/src/sap/ui/fl/apply/_internal/changes/descriptor/Registration.js +1 -1
  20. package/src/sap/ui/fl/apply/_internal/changes/descriptor/RegistrationBuild.js +1 -1
  21. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddAnnotationsToOData.js +1 -1
  22. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/AddNewInbound.js +1 -1
  23. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeDataSource.js +1 -1
  24. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/ChangeInbound.js +1 -1
  25. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/RemoveAllInboundsExceptOne.js +1 -1
  26. package/src/sap/ui/fl/apply/_internal/changes/descriptor/app/SetTitle.js +1 -1
  27. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetAbstract.js +1 -1
  28. package/src/sap/ui/fl/apply/_internal/changes/descriptor/fiori/SetRegistrationIds.js +1 -1
  29. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/AddNewCard.js +1 -1
  30. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/ChangeCard.js +1 -1
  31. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ovp/DeleteCard.js +1 -1
  32. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddComponentUsages.js +1 -1
  33. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddLibrary.js +1 -1
  34. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModel.js +1 -1
  35. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/AddNewModelEnhanceWith.js +1 -1
  36. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetFlexExtensionPointEnabled.js +1 -1
  37. package/src/sap/ui/fl/apply/_internal/changes/descriptor/ui5/SetMinUI5Version.js +1 -1
  38. package/src/sap/ui/fl/apply/_internal/connectors/ObjectStorageUtils.js +1 -1
  39. package/src/sap/ui/fl/apply/_internal/extensionPoint/Processor.js +1 -1
  40. package/src/sap/ui/fl/apply/_internal/flexObjects/AppDescriptorChange.js +1 -1
  41. package/src/sap/ui/fl/apply/_internal/flexObjects/CompVariant.js +1 -1
  42. package/src/sap/ui/fl/apply/_internal/flexObjects/ControllerExtensionChange.js +1 -1
  43. package/src/sap/ui/fl/apply/_internal/flexObjects/FlVariant.js +1 -1
  44. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObject.js +5 -1
  45. package/src/sap/ui/fl/apply/_internal/flexObjects/FlexObjectFactory.js +1 -1
  46. package/src/sap/ui/fl/apply/_internal/flexObjects/UIChange.js +1 -1
  47. package/src/sap/ui/fl/apply/_internal/flexObjects/Variant.js +1 -1
  48. package/src/sap/ui/fl/apply/_internal/flexState/FlexState.js +17 -88
  49. package/src/sap/ui/fl/apply/_internal/flexState/Loader.js +1 -1
  50. package/src/sap/ui/fl/apply/_internal/flexState/ManifestUtils.js +1 -1
  51. package/src/sap/ui/fl/apply/_internal/flexState/UI2Personalization/UI2PersonalizationState.js +1 -1
  52. package/src/sap/ui/fl/apply/_internal/flexState/changes/DependencyHandler.js +1 -1
  53. package/src/sap/ui/fl/apply/_internal/flexState/changes/ExtensionPointState.js +1 -1
  54. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/CompVariantMerger.js +2 -2
  55. package/src/sap/ui/fl/apply/_internal/flexState/compVariants/Utils.js +6 -1
  56. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/Switcher.js +1 -1
  57. package/src/sap/ui/fl/apply/_internal/flexState/controlVariants/VariantManagementState.js +96 -77
  58. package/src/sap/ui/fl/apply/_internal/preprocessors/ControllerExtension.js +1 -1
  59. package/src/sap/ui/fl/apply/_internal/preprocessors/EventHistory.js +1 -1
  60. package/src/sap/ui/fl/apply/_internal/preprocessors/RegistrationDelegator.js +1 -1
  61. package/src/sap/ui/fl/apply/_internal/preprocessors/XmlPreprocessor.js +1 -1
  62. package/src/sap/ui/fl/apply/api/ControlVariantApplyAPI.js +1 -1
  63. package/src/sap/ui/fl/changeHandler/AddIFrame.js +1 -1
  64. package/src/sap/ui/fl/changeHandler/AddXML.js +1 -1
  65. package/src/sap/ui/fl/changeHandler/AddXMLAtExtensionPoint.js +1 -1
  66. package/src/sap/ui/fl/changeHandler/Base.js +1 -1
  67. package/src/sap/ui/fl/changeHandler/BaseAddViaDelegate.js +1 -1
  68. package/src/sap/ui/fl/changeHandler/BaseAddXml.js +1 -1
  69. package/src/sap/ui/fl/changeHandler/BaseRename.js +45 -59
  70. package/src/sap/ui/fl/changeHandler/HideControl.js +1 -1
  71. package/src/sap/ui/fl/changeHandler/MoveControls.js +168 -260
  72. package/src/sap/ui/fl/changeHandler/MoveElements.js +33 -87
  73. package/src/sap/ui/fl/changeHandler/PropertyBindingChange.js +1 -1
  74. package/src/sap/ui/fl/changeHandler/PropertyChange.js +1 -1
  75. package/src/sap/ui/fl/changeHandler/StashControl.js +31 -53
  76. package/src/sap/ui/fl/changeHandler/UnhideControl.js +1 -1
  77. package/src/sap/ui/fl/changeHandler/UnstashControl.js +24 -26
  78. package/src/sap/ui/fl/changeHandler/UpdateIFrame.js +3 -5
  79. package/src/sap/ui/fl/changeHandler/common/createIFrame.js +2 -0
  80. package/src/sap/ui/fl/descriptorRelated/api/DescriptorChangeFactory.js +4 -4
  81. package/src/sap/ui/fl/descriptorRelated/api/DescriptorInlineChangeFactory.js +1 -1
  82. package/src/sap/ui/fl/descriptorRelated/api/DescriptorVariantFactory.js +1 -1
  83. package/src/sap/ui/fl/designtime/util/IFrame.designtime.js +5 -0
  84. package/src/sap/ui/fl/{write → initial}/_internal/FlexInfoSession.js +11 -3
  85. package/src/sap/ui/fl/initial/_internal/Storage.js +5 -5
  86. package/src/sap/ui/fl/initial/_internal/StorageUtils.js +1 -1
  87. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerRegistration.js +1 -1
  88. package/src/sap/ui/fl/initial/_internal/changeHandlers/ChangeHandlerStorage.js +1 -1
  89. package/src/sap/ui/fl/initial/_internal/connectors/Utils.js +1 -1
  90. package/src/sap/ui/fl/initial/_internal/storageResultDisassemble.js +1 -1
  91. package/src/sap/ui/fl/interfaces/BaseLoadConnector.js +1 -1
  92. package/src/sap/ui/fl/interfaces/Delegate.js +1 -1
  93. package/src/sap/ui/fl/library.js +43 -43
  94. package/src/sap/ui/fl/messagebundle_bg.properties +2 -2
  95. package/src/sap/ui/fl/messagebundle_en.properties +2 -2
  96. package/src/sap/ui/fl/messagebundle_ja.properties +6 -6
  97. package/src/sap/ui/fl/messagebundle_sl.properties +2 -2
  98. package/src/sap/ui/fl/messagebundle_uk.properties +1 -1
  99. package/src/sap/ui/fl/support/_internal/getChangeDependencies.js +1 -1
  100. package/src/sap/ui/fl/support/_internal/getFlexSettings.js +1 -1
  101. package/src/sap/ui/fl/support/api/SupportAPI.js +1 -1
  102. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetails.controller.js +1 -1
  103. package/src/sap/ui/fl/support/apps/contentbrowser/controller/ContentDetailsEdit.controller.js +1 -1
  104. package/src/sap/ui/fl/support/apps/contentbrowser/controller/LayerContentMaster.controller.js +1 -1
  105. package/src/sap/ui/fl/support/apps/contentbrowser/controller/Layers.controller.js +1 -1
  106. package/src/sap/ui/fl/support/apps/contentbrowser/lrepConnector/LRepConnector.js +1 -1
  107. package/src/sap/ui/fl/support/apps/contentbrowser/utils/DataUtils.js +1 -1
  108. package/src/sap/ui/fl/support/apps/contentbrowser/utils/ErrorUtils.js +1 -1
  109. package/src/sap/ui/fl/transport/TransportSelection.js +1 -1
  110. package/src/sap/ui/fl/util/IFrame.js +60 -27
  111. package/src/sap/ui/fl/util/IFrameRenderer.js +9 -1
  112. package/src/sap/ui/fl/util/ManagedObjectModel.js +1 -1
  113. package/src/sap/ui/fl/util/resolveBinding.js +1 -1
  114. package/src/sap/ui/fl/variants/VariantManagement.js +17 -18
  115. package/src/sap/ui/fl/variants/VariantModel.js +2 -1
  116. package/src/sap/ui/fl/variants/context/manifest.json +2 -2
  117. package/src/sap/ui/fl/write/_internal/Storage.js +1 -1
  118. package/src/sap/ui/fl/write/_internal/StorageFeaturesMerger.js +1 -1
  119. package/src/sap/ui/fl/write/_internal/Versions.js +3 -3
  120. package/src/sap/ui/fl/write/_internal/appVariant/AppVariant.js +1 -1
  121. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantFactory.js +1 -1
  122. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChange.js +1 -1
  123. package/src/sap/ui/fl/write/_internal/appVariant/AppVariantInlineChangeFactory.js +1 -1
  124. package/src/sap/ui/fl/write/_internal/condenser/Condenser.js +1 -1
  125. package/src/sap/ui/fl/write/_internal/condenser/UIReconstruction.js +1 -1
  126. package/src/sap/ui/fl/write/_internal/connectors/BackendConnector.js +1 -1
  127. package/src/sap/ui/fl/write/_internal/connectors/KeyUserConnector.js +2 -2
  128. package/src/sap/ui/fl/write/_internal/connectors/LrepConnector.js +1 -1
  129. package/src/sap/ui/fl/write/_internal/connectors/NeoLrepConnector.js +1 -1
  130. package/src/sap/ui/fl/write/_internal/connectors/ObjectPathConnector.js +1 -1
  131. package/src/sap/ui/fl/write/_internal/connectors/PersonalizationConnector.js +1 -1
  132. package/src/sap/ui/fl/write/_internal/connectors/Utils.js +1 -1
  133. package/src/sap/ui/fl/write/_internal/extensionPoint/Processor.js +1 -1
  134. package/src/sap/ui/fl/write/_internal/extensionPoint/Registry.js +1 -1
  135. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPAccess.js +1 -1
  136. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariant.js +1 -1
  137. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ABAPExtensibilityVariantFactory.js +1 -1
  138. package/src/sap/ui/fl/write/_internal/fieldExtensibility/MultiTenantABAPExtensibilityVariant.js +1 -1
  139. package/src/sap/ui/fl/write/_internal/fieldExtensibility/ServiceValidation.js +1 -1
  140. package/src/sap/ui/fl/write/_internal/fieldExtensibility/SingleTenantABAPExtensibilityVariant.js +1 -1
  141. package/src/sap/ui/fl/write/_internal/fieldExtensibility/UriParser.js +1 -1
  142. package/src/sap/ui/fl/write/_internal/fieldExtensibility/Utils.js +1 -1
  143. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/CAPAccess.js +1 -1
  144. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/dialog/CustomFieldCAPDialog.js +1 -1
  145. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/booleanEditor/BooleanEditor.js +1 -1
  146. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/rangeEditor/RangeEditor.js +1 -1
  147. package/src/sap/ui/fl/write/_internal/fieldExtensibility/cap/editor/propertyEditor/timeEditor/TimeEditor.js +1 -1
  148. package/src/sap/ui/fl/write/_internal/flexState/FlexObjectState.js +1 -1
  149. package/src/sap/ui/fl/write/_internal/flexState/compVariants/CompVariantState.js +63 -43
  150. package/src/sap/ui/fl/write/_internal/transport/TransportSelection.js +1 -1
  151. package/src/sap/ui/fl/write/_internal/transport/Transports.js +1 -1
  152. package/src/sap/ui/fl/write/api/ContextBasedAdaptationsAPI.js +1 -1
  153. package/src/sap/ui/fl/write/api/FieldExtensibility.js +1 -1
  154. package/src/sap/ui/fl/write/api/PersistenceWriteAPI.js +1 -1
  155. package/src/sap/ui/fl/write/api/ReloadInfoAPI.js +12 -2
  156. package/src/sap/ui/fl/write/api/connectors/ObjectStorageConnector.js +14 -11
package/THIRDPARTY.txt CHANGED
@@ -401,7 +401,7 @@ License: MIT
401
401
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
402
402
  Contained in: src/sap.ui.integration/src/sap/ui/integration/thirdparty/adaptive-expressions.js
403
403
 
404
- Component: Markdown-it, version: 12.2.0
404
+ Component: Markdown-it, version: 12.3.2
405
405
  Copyright: 2014 Vitaly Puzrin, Alex Kocharin
406
406
  License: MIT
407
407
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/MIT.txt
@@ -466,7 +466,7 @@ License: Apache-2.0
466
466
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
467
467
  Contained in: lib/jsdoc/ui5/plugin.js
468
468
 
469
- Component: SAP Theming Base Content, version: 11.4.2
469
+ Component: SAP Theming Base Content, version: 11.6.8
470
470
  Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
471
471
  License: Apache-2.0
472
472
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.fl",
3
- "version": "1.118.0",
3
+ "version": "1.119.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.fl",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.118.0",
18
- "@openui5/sap.ui.core": "1.118.0"
17
+ "@openui5/sap.m": "1.119.0",
18
+ "@openui5/sap.ui.core": "1.119.0"
19
19
  }
20
20
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.118.0</version>
9
+ <version>1.119.0</version>
10
10
 
11
11
  <documentation>SAPUI5 library with sap.ui.fl controls.</documentation>
12
12
 
@@ -76,7 +76,7 @@ sap.ui.define([
76
76
  *
77
77
  * @constructor
78
78
  * @author SAP SE
79
- * @version 1.118.0
79
+ * @version 1.119.0
80
80
  * @since 1.25.0
81
81
  * @private
82
82
  * @param {object} mComponent - Component data to initiate <code>ChangePersistence</code> instance
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @alias sap.ui.fl.ChangePersistenceFactory
20
20
  * @since 1.27.0
21
21
  * @author SAP SE
22
- * @version 1.118.0
22
+ * @version 1.119.0
23
23
  * @private
24
24
  * @ui5-restricted sap.ui.fl
25
25
  */
@@ -20,7 +20,7 @@ function(
20
20
  * @namespace
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.118.0
23
+ * @version 1.119.0
24
24
  *
25
25
  * @private
26
26
  * @since 1.48
@@ -20,7 +20,7 @@ function(
20
20
  * @namespace
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.118.0
23
+ * @version 1.119.0
24
24
  *
25
25
  * @private
26
26
  * @since 1.58
@@ -17,7 +17,7 @@ sap.ui.define([
17
17
  * @namespace
18
18
  *
19
19
  * @author SAP SE
20
- * @version 1.118.0
20
+ * @version 1.119.0
21
21
  *
22
22
  * @private
23
23
  * @since 1.48
@@ -75,7 +75,7 @@ sap.ui.define([
75
75
  * @since 1.27.0
76
76
  * @private
77
77
  * @author SAP SE
78
- * @version 1.118.0
78
+ * @version 1.119.0
79
79
  */
80
80
  var FlexController = function(sComponentName) {
81
81
  this._oChangePersistence = undefined;
@@ -22,7 +22,7 @@ sap.ui.define([
22
22
  * @alias sap.ui.fl.FlexControllerFactory
23
23
  * @since 1.27.0
24
24
  * @author SAP SE
25
- * @version 1.118.0
25
+ * @version 1.119.0
26
26
  *
27
27
  * @private
28
28
  * @ui5-restricted sap.ui.fl
@@ -7,11 +7,13 @@
7
7
  sap.ui.define([
8
8
  "sap/base/util/UriParameters",
9
9
  "sap/ui/thirdparty/hasher",
10
- "sap/ui/fl/Layer"
10
+ "sap/ui/fl/Layer",
11
+ "sap/ui/fl/initial/_internal/FlexInfoSession"
11
12
  ], function(
12
13
  UriParameters,
13
14
  hasher,
14
- Layer
15
+ Layer,
16
+ FlexInfoSession
15
17
  ) {
16
18
  "use strict";
17
19
 
@@ -41,7 +43,7 @@ sap.ui.define([
41
43
  *
42
44
  * @namespace sap.ui.fl.LayerUtils
43
45
  * @author SAP SE
44
- * @version 1.118.0
46
+ * @version 1.119.0
45
47
  */
46
48
  var LayerUtils = {
47
49
  _mLayersIndex: mLayersIndex,
@@ -113,6 +115,7 @@ sap.ui.define([
113
115
  * @ui5-restricted sap.ui.fl.apply._internal.Connector
114
116
  * @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
115
117
  * @return {string} maxLayer
118
+ * @deprecated Since version 1.118
116
119
  */
117
120
  getMaxLayer(oURLParsingService) {
118
121
  var sParseMaxLayer = LayerUtils.getMaxLayerTechnicalParameter(hasher.getHash(), oURLParsingService);
@@ -135,7 +138,7 @@ sap.ui.define([
135
138
  * @param {string} sLayer Layer name to be evaluated
136
139
  * @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
137
140
  * @returns {boolean} <code>true</code> if input layer is higher than max layer, otherwise <code>false</code>
138
- * @public
141
+ * @deprecated Since version 1.118
139
142
  */
140
143
  isOverMaxLayer(sLayer, oURLParsingService) {
141
144
  return this.isOverLayer(sLayer, this.getMaxLayer(oURLParsingService));
@@ -177,11 +180,13 @@ sap.ui.define([
177
180
  * Determines if filtering of changes based on layer is required.
178
181
  *
179
182
  * @returns {boolean} <code>true</code> if the top layer is also the max layer, otherwise <code>false</code>
180
- * @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
183
+ * @param {string} sReference - Reference of the application
181
184
  * @public
182
185
  */
183
- isLayerFilteringRequired(oURLParsingService) {
184
- return this._sTopLayer !== this.getMaxLayer(oURLParsingService);
186
+ isLayerFilteringRequired(sReference) {
187
+ var oFlexInfoSession = FlexInfoSession.getByReference(sReference);
188
+ var sMaxLayer = oFlexInfoSession && oFlexInfoSession.maxLayer ? oFlexInfoSession.maxLayer : LayerUtils._sTopLayer;
189
+ return this._sTopLayer !== sMaxLayer;
185
190
  },
186
191
 
187
192
  /**
@@ -211,6 +216,7 @@ sap.ui.define([
211
216
  * @param {object[]} aChangeDefinitions - Array of change definitions
212
217
  * @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
213
218
  * @returns {object[]} Array of filtered change definitions
219
+ * @deprecated Since version 1.118
214
220
  */
215
221
  filterChangeDefinitionsByMaxLayer(aChangeDefinitions, oURLParsingService) {
216
222
  return aChangeDefinitions.filter(function(oChangeDefinition) {
@@ -242,6 +248,7 @@ sap.ui.define([
242
248
  * @param {string} sHash Hash value
243
249
  * @param {sap.ui.core.service.Service} oURLParsingService Unified Shell URL Parsing Service
244
250
  * @returns {string|undefined} Max layer parameter value, if available
251
+ * @deprecated Since version 1.118
245
252
  */
246
253
  getMaxLayerTechnicalParameter(sHash, oURLParsingService) {
247
254
  if (oURLParsingService) {
@@ -9,6 +9,7 @@ sap.ui.define([
9
9
  "sap/base/util/isPlainObject",
10
10
  "sap/base/util/uid",
11
11
  "sap/base/util/UriParameters",
12
+ "sap/base/util/restricted/_isEqual",
12
13
  "sap/base/Log",
13
14
  "sap/ui/base/SyncPromise",
14
15
  "sap/ui/base/ManagedObject",
@@ -23,6 +24,7 @@ sap.ui.define([
23
24
  isPlainObject,
24
25
  uid,
25
26
  UriParameters,
27
+ isEqual,
26
28
  Log,
27
29
  SyncPromise,
28
30
  ManagedObject,
@@ -42,19 +44,17 @@ sap.ui.define([
42
44
  */
43
45
  function getComponentType(oManifest) {
44
46
  // manifest instance
45
- if (oManifest && oManifest.getEntry) {
46
- return oManifest.getEntry("sap.app") && oManifest.getEntry("sap.app").type;
47
+ if (oManifest?.getEntry) {
48
+ return oManifest.getEntry?.("sap.app")?.type;
47
49
  }
48
50
 
49
51
  // raw manifest
50
- return oManifest && oManifest["sap.app"] && oManifest["sap.app"].type;
52
+ return oManifest?.["sap.app"]?.type;
51
53
  }
52
54
 
53
55
  function getStartUpParameter(oComponentData, sParameterName) {
54
- if (oComponentData && oComponentData.startupParameters && sParameterName) {
55
- if (Array.isArray(oComponentData.startupParameters[sParameterName])) {
56
- return oComponentData.startupParameters[sParameterName][0];
57
- }
56
+ if (oComponentData?.startupParameters && sParameterName && Array.isArray(oComponentData.startupParameters[sParameterName])) {
57
+ return oComponentData.startupParameters[sParameterName][0];
58
58
  }
59
59
  }
60
60
 
@@ -64,21 +64,18 @@ sap.ui.define([
64
64
  * @namespace
65
65
  * @alias sap.ui.fl.Utils
66
66
  * @author SAP SE
67
- * @version 1.118.0
67
+ * @version 1.119.0
68
68
  *
69
69
  * @private
70
70
  * @ui5-restricted sap.ui.fl, sap.ui.rta
71
71
  */
72
- var Utils = {
72
+ const Utils = {
73
73
  isVariantByStartupParameter(oControl) {
74
74
  // determine UI5 component out of given control
75
- if (oControl) {
76
- var oAppComponent = this.getAppComponentForControl(oControl);
77
- if (oAppComponent && oAppComponent.getComponentData) {
78
- return !!getStartUpParameter(oAppComponent.getComponentData(), "sap-app-id");
79
- }
75
+ const oAppComponent = this.getAppComponentForControl(oControl);
76
+ if (oAppComponent?.getComponentData) {
77
+ return !!getStartUpParameter(oAppComponent.getComponentData(), "sap-app-id");
80
78
  }
81
-
82
79
  return false;
83
80
  },
84
81
 
@@ -94,18 +91,7 @@ sap.ui.define([
94
91
  * @ui5-restricted sap.ui.fl, sap.ui.rta
95
92
  */
96
93
  getAppDescriptor(oControl) {
97
- // determine UI5 component out of given control
98
- if (oControl) {
99
- var oComponent = this.getAppComponentForControl(oControl);
100
-
101
- // determine manifest out of found component
102
- if (oComponent && oComponent.getMetadata) {
103
- var oComponentMetaData = oComponent.getMetadata();
104
- if (oComponentMetaData && oComponentMetaData.getManifestObject) {
105
- return oComponentMetaData.getManifestObject().getJson();
106
- }
107
- }
108
- }
94
+ return this.getAppComponentForControl(oControl)?.getMetadata?.()?.getManifestObject?.().getJson();
109
95
  },
110
96
 
111
97
  /**
@@ -149,10 +135,10 @@ sap.ui.define([
149
135
  */
150
136
  getComponentForControl(oControl) {
151
137
  function getComponentIdForControl(oControl) {
152
- var sComponentId = Component.getOwnerIdFor(oControl);
138
+ const sComponentId = Component.getOwnerIdFor(oControl);
153
139
  if (!sComponentId) {
154
- if (oControl && typeof oControl.getParent === "function") {
155
- var oParent = oControl.getParent();
140
+ if (typeof oControl?.getParent === "function") {
141
+ const oParent = oControl.getParent();
156
142
  if (oParent) {
157
143
  return getComponentIdForControl(oParent);
158
144
  }
@@ -163,7 +149,7 @@ sap.ui.define([
163
149
 
164
150
  // determine UI5 component out of given control
165
151
  if (oControl) {
166
- var sComponentId = getComponentIdForControl(oControl);
152
+ const sComponentId = getComponentIdForControl(oControl);
167
153
  if (sComponentId) {
168
154
  return Component.get(sComponentId);
169
155
  }
@@ -180,22 +166,22 @@ sap.ui.define([
180
166
  * @ui5-restricted sap.ui.fl
181
167
  */
182
168
  getAppComponentForControl(oControl) {
183
- var oComponent = oControl instanceof Component ? oControl : Utils.getComponentForControl(oControl);
169
+ let oComponent = oControl instanceof Component ? oControl : Utils.getComponentForControl(oControl);
184
170
 
185
171
  // special case for Fiori Elements to reach the real appComponent
186
- if (oComponent && oComponent.getAppComponent && oComponent.getAppComponent() instanceof Component) {
172
+ if (oComponent?.getAppComponent?.() instanceof Component) {
187
173
  return oComponent.getAppComponent();
188
174
  }
189
175
 
190
176
  // special case for OVP
191
- if (oComponent && oComponent.oComponentData && oComponent.oComponentData.appComponent) {
177
+ if (oComponent?.oComponentData?.appComponent) {
192
178
  return oComponent.oComponentData.appComponent;
193
179
  }
194
180
 
195
- if (oComponent && oComponent.getManifestEntry) {
181
+ if (oComponent?.getManifestEntry) {
196
182
  var oSapApp = oComponent.getManifestEntry("sap.app");
197
183
 
198
- if (oSapApp && oSapApp.type && oSapApp.type !== "application") {
184
+ if (oSapApp?.type && oSapApp.type !== "application") {
199
185
  if (oComponent instanceof Component) {
200
186
  // we need to call this method only when the component is an instance of Component in order to walk up the tree
201
187
  // returns owner app component
@@ -238,7 +224,7 @@ sap.ui.define([
238
224
  return oControl;
239
225
  }
240
226
 
241
- if (oControl && typeof oControl.getParent === "function") {
227
+ if (typeof oControl?.getParent === "function") {
242
228
  oControl = oControl.getParent();
243
229
  return Utils.getViewForControl(oControl);
244
230
  }
@@ -255,20 +241,13 @@ sap.ui.define([
255
241
  * @ui5-restricted sap.ui.fl.write._internal.transport.Transport
256
242
  */
257
243
  getClient() {
258
- var oUriParams;
259
- var sClient;
260
- oUriParams = UriParameters.fromQuery(window.location.search);
261
- sClient = oUriParams.get("sap-client");
262
- return sClient || undefined;
244
+ return UriParameters.fromQuery(window.location.search).get("sap-client");
263
245
  },
264
246
 
265
247
  getLrepUrl() {
266
- var aFlexibilityServices = Configuration.getFlexibilityServices();
267
- var oLrepConfiguration = aFlexibilityServices.find(function(oServiceConfig) {
268
- return oServiceConfig.connector === "LrepConnector";
269
- });
270
-
271
- return oLrepConfiguration ? oLrepConfiguration.url : "";
248
+ const aFlexibilityServices = Configuration.getFlexibilityServices();
249
+ const oLrepConfiguration = aFlexibilityServices.find((oServiceConfig) => oServiceConfig.connector === "LrepConnector");
250
+ return oLrepConfiguration?.url || "";
272
251
  },
273
252
 
274
253
  /**
@@ -280,12 +259,12 @@ sap.ui.define([
280
259
  * @ui5-restricted sap.ui.fl
281
260
  */
282
261
  getCurrentLanguage() {
283
- var sLanguage = Configuration.getLanguage();
284
- if (!sLanguage || typeof sLanguage !== "string") {
262
+ const sLanguage = Configuration.getLanguage();
263
+ if (typeof sLanguage !== "string") {
285
264
  return "";
286
265
  }
287
266
 
288
- var nIndex = sLanguage.indexOf("-");
267
+ const nIndex = sLanguage.indexOf("-");
289
268
  if ((nIndex < 0) && (sLanguage.length <= 2)) {
290
269
  return sLanguage.toUpperCase();
291
270
  }
@@ -304,13 +283,7 @@ sap.ui.define([
304
283
  * @private
305
284
  */
306
285
  getControlType(oControl) {
307
- var oMetadata;
308
- if (oControl && typeof oControl.getMetadata === "function") {
309
- oMetadata = oControl.getMetadata();
310
- if (oMetadata && typeof oMetadata.getElementName === "function") {
311
- return oMetadata.getElementName();
312
- }
313
- }
286
+ return oControl?.getMetadata?.()?.getElementName?.();
314
287
  },
315
288
 
316
289
  /**
@@ -336,10 +309,7 @@ sap.ui.define([
336
309
  * @returns {object} Returns the parsed URL hash object or an empty object if ushell container is not available
337
310
  */
338
311
  getParsedURLHash(oURLParsingService) {
339
- if (oURLParsingService) {
340
- return oURLParsingService.parseShellHash(hasher.getHash()) || {};
341
- }
342
- return {};
312
+ return oURLParsingService?.parseShellHash(hasher.getHash()) || {};
343
313
  },
344
314
 
345
315
  /**
@@ -364,21 +334,14 @@ sap.ui.define([
364
334
  },
365
335
 
366
336
  createDefaultFileName(sNameAddition) {
367
- var sFileName = uid().replace(/-/g, "_");
368
- if (sNameAddition) {
369
- sFileName += `_${sNameAddition}`;
370
- }
371
- return sFileName;
337
+ const sFileName = uid().replace(/-/g, "_");
338
+ return sNameAddition ? `${sFileName}_${sNameAddition}` : sFileName;
372
339
  },
373
340
 
374
341
  createNamespace(oPropertyBag, sFileType) {
375
- var sSubfolder = "changes";
376
- if (sFileType === "ctrl_variant") {
377
- sSubfolder = "variants";
378
- }
379
- var sReferenceName = oPropertyBag.reference.replace(".Component", "");
380
- var sNamespace = `apps/${sReferenceName}/${sSubfolder}/`;
381
- return sNamespace;
342
+ const sSubfolder = sFileType === "ctrl_variant" ? "variants" : "changes";
343
+ const sReferenceName = oPropertyBag.reference.replace(".Component", "");
344
+ return `apps/${sReferenceName}/${sSubfolder}/`;
382
345
  },
383
346
 
384
347
  /**
@@ -391,42 +354,30 @@ sap.ui.define([
391
354
  * @returns {string} Returns the root LRep namespace
392
355
  */
393
356
  buildLrepRootNamespace(sBaseId, sScenario, sProjectId) {
394
- var sRootNamespace = "apps/";
395
- var oError = new Error("Error in sap.ui.fl.Utils#buildLrepRootNamespace: ");
357
+ const sRootNamespace = "apps";
358
+ const sBaseErrorMessage = "Error in sap.ui.fl.Utils#buildLrepRootNamespace:";
359
+
396
360
  if (!sBaseId) {
397
- oError.message += "for every scenario you need a base ID";
398
- throw oError;
361
+ throw new Error(`${sBaseErrorMessage} for every scenario you need a base ID`);
399
362
  }
400
363
 
401
364
  switch (sScenario) {
402
365
  case Scenario.VersionedAppVariant:
403
- if (!sProjectId) {
404
- oError.message += "in a versioned app variant scenario you additionally need a project ID";
405
- throw oError;
406
- }
407
- sRootNamespace += `${sBaseId}/appVariants/${sProjectId}/`;
408
- break;
409
366
  case Scenario.AppVariant:
410
367
  if (!sProjectId) {
411
- oError.message += "in an app variant scenario you additionally need a project ID";
412
- throw oError;
368
+ throw new Error(`${sBaseErrorMessage} in the ${sScenario} scenario you additionally need a project ID`);
413
369
  }
414
- sRootNamespace += `${sBaseId}/appVariants/${sProjectId}/`;
415
- break;
370
+ return `${sRootNamespace}/${sBaseId}/appVariants/${sProjectId}/`;
416
371
  case Scenario.AdaptationProject:
417
372
  if (!sProjectId) {
418
- oError.message += "in a adaptation project scenario you additionally need a project ID";
419
- throw oError;
373
+ throw new Error(`${sBaseErrorMessage} in the ${sScenario} scenario you additionally need a project ID`);
420
374
  }
421
- sRootNamespace += `${sBaseId}/adapt/${sProjectId}/`;
422
- break;
375
+ return `${sRootNamespace}/${sBaseId}/adapt/${sProjectId}/`;
423
376
  case Scenario.FioriElementsFromScratch:
424
377
  case Scenario.UiAdaptation:
425
378
  default:
426
- sRootNamespace += `${sBaseId}/`;
379
+ return `${sRootNamespace}/${sBaseId}/`;
427
380
  }
428
-
429
- return sRootNamespace;
430
381
  },
431
382
 
432
383
  /** Returns <code>true</code> if the passed manifest object is of type "application".
@@ -437,8 +388,7 @@ sap.ui.define([
437
388
  * @ui5-restricted sap.ui.fl
438
389
  */
439
390
  isApplication(oManifest) {
440
- var sComponentType = getComponentType(oManifest);
441
- return sComponentType === "application";
391
+ return getComponentType(oManifest) === "application";
442
392
  },
443
393
 
444
394
  /** Returns <code>true</code> if the passed component is an application component.
@@ -460,7 +410,7 @@ sap.ui.define([
460
410
  * @ui5-restricted sap.ui.fl
461
411
  */
462
412
  isEmbeddedComponent(oComponent) {
463
- var oAppComponent = Utils.getAppComponentForControl(oComponent);
413
+ const oAppComponent = Utils.getAppComponentForControl(oComponent);
464
414
  return !!(
465
415
  oComponent instanceof Component
466
416
  && getComponentType(oComponent.getManifestObject()) === "component"
@@ -482,33 +432,9 @@ sap.ui.define([
482
432
  * @ui5-restricted sap.ui.fl
483
433
  */
484
434
  indexOfObject(aArray, oObject) {
485
- var iObjectIndex = -1;
486
- aArray.some(function(oArrayObject, iIndex) {
487
- var aKeysArray;
488
- var aKeysObject;
489
- if (!oArrayObject) {
490
- aKeysArray = [];
491
- } else {
492
- aKeysArray = Object.keys(oArrayObject);
493
- }
494
-
495
- if (!oObject) {
496
- aKeysObject = [];
497
- } else {
498
- aKeysObject = Object.keys(oObject);
499
- }
500
- var bSameNumberOfAttributes = aKeysArray.length === aKeysObject.length;
501
- var bContains = bSameNumberOfAttributes && !aKeysArray.some(function(sKey) {
502
- return oArrayObject[sKey] !== oObject[sKey];
503
- });
504
-
505
- if (bContains) {
506
- iObjectIndex = iIndex;
507
- }
508
-
509
- return bContains;
435
+ return aArray.findIndex((oArrayObject) => {
436
+ return isEqual(oArrayObject, oObject);
510
437
  });
511
- return iObjectIndex;
512
438
  },
513
439
 
514
440
  /**
@@ -649,16 +575,13 @@ sap.ui.define([
649
575
  * @returns {sap.ui.fl.apply._internal.flexObjects.FlexObject | undefined} Returns the change if it is in the map, otherwise undefined
650
576
  */
651
577
  getChangeFromChangesMap(mChanges, sChangeId) {
652
- var oResult;
653
- Object.keys(mChanges).forEach(function(sControlId) {
654
- mChanges[sControlId].some(function(oChange) {
655
- if (oChange.getId() === sChangeId) {
656
- oResult = oChange;
657
- return true;
658
- }
659
- });
578
+ let oMatch;
579
+ Object.values(mChanges).some((aControlChanges) => {
580
+ oMatch = aControlChanges.find((oChange) => oChange.getId() === sChangeId);
581
+ return oMatch;
660
582
  });
661
- return oResult;
583
+
584
+ return oMatch;
662
585
  },
663
586
 
664
587
  /**
@@ -671,11 +594,11 @@ sap.ui.define([
671
594
  * @returns {string} The modified URL
672
595
  */
673
596
  handleUrlParameters(sParameters, sParameterName, sParameterValue, oURLParsingService) {
674
- if (this.hasParameterAndValue(sParameterName, sParameterValue, oURLParsingService)) {
597
+ if (Utils.hasParameterAndValue(sParameterName, sParameterValue, oURLParsingService)) {
675
598
  if (sParameters.startsWith("?")) {
676
599
  sParameters = sParameters.substr(1, sParameters.length);
677
600
  }
678
- var aFilterUrl = sParameters.split("&").filter(function(sParameter) {
601
+ const aFilterUrl = sParameters.split("&").filter((sParameter) => {
679
602
  return sParameter !== `${sParameterName}=${sParameterValue}`;
680
603
  });
681
604
  sParameters = "";
@@ -697,7 +620,7 @@ sap.ui.define([
697
620
  * @returns {boolean} <code>true</code> if the parameter and the given value are in the URL
698
621
  */
699
622
  hasParameterAndValue(sParameterName, sParameterValue, oURLParsingService) {
700
- return this.getParameter(sParameterName, oURLParsingService) === sParameterValue;
623
+ return Utils.getParameter(sParameterName, oURLParsingService) === sParameterValue;
701
624
  },
702
625
 
703
626
  /**
@@ -708,13 +631,7 @@ sap.ui.define([
708
631
  * @returns {string} The value of the given parameter or undefined
709
632
  */
710
633
  getParameter(sParameterName, oURLParsingService) {
711
- if (oURLParsingService) {
712
- var mParsedHash = Utils.getParsedURLHash(oURLParsingService);
713
- return mParsedHash.params &&
714
- mParsedHash.params[sParameterName] &&
715
- mParsedHash.params[sParameterName][0];
716
- }
717
- return Utils.getUrlParameter(sParameterName);
634
+ return Utils.getParsedURLHash(oURLParsingService)?.params?.[sParameterName]?.[0] || Utils.getUrlParameter(sParameterName);
718
635
  },
719
636
 
720
637
  /**
@@ -724,16 +641,7 @@ sap.ui.define([
724
641
  * @returns {object} Aggregation metadata
725
642
  */
726
643
  findAggregation(oControl, sAggregationName) {
727
- if (oControl) {
728
- if (oControl.getMetadata) {
729
- var oMetadata = oControl.getMetadata();
730
- var oAggregations = oMetadata.getAllAggregations();
731
- if (oAggregations) {
732
- return oAggregations[sAggregationName];
733
- }
734
- }
735
- }
736
- return undefined;
644
+ return oControl?.getMetadata?.()?.getAllAggregations?.()?.[sAggregationName];
737
645
  },
738
646
 
739
647
  /**
@@ -743,7 +651,7 @@ sap.ui.define([
743
651
  * @returns {sap.ui.base.ManagedObject[]|Element[]} Aggregation content
744
652
  */
745
653
  getAggregation(oParent, sAggregationName) {
746
- var oAggregation = Utils.findAggregation(oParent, sAggregationName);
654
+ const oAggregation = Utils.findAggregation(oParent, sAggregationName);
747
655
  if (oAggregation) {
748
656
  return oParent[oAggregation._sGetter]();
749
657
  }
@@ -757,12 +665,8 @@ sap.ui.define([
757
665
  * @returns {any} Value of the property
758
666
  */
759
667
  getProperty(oControl, sPropertyName) {
760
- var oMetadata = oControl.getMetadata().getPropertyLikeSetting(sPropertyName);
761
- if (oMetadata) {
762
- var sPropertyGetter = oMetadata._sGetter;
763
- return oControl[sPropertyGetter]();
764
- }
765
- return undefined;
668
+ const sPropertyGetter = oControl.getMetadata().getPropertyLikeSetting(sPropertyName)?._sGetter;
669
+ return oControl[sPropertyGetter]();
766
670
  },
767
671
 
768
672
  /**
@@ -773,7 +677,7 @@ sap.ui.define([
773
677
  */
774
678
  getUShellService(sServiceName) {
775
679
  if (sServiceName) {
776
- var oUShellContainer = this.getUshellContainer();
680
+ const oUShellContainer = this.getUshellContainer();
777
681
  if (oUShellContainer) {
778
682
  return oUShellContainer.getServiceAsync(sServiceName);
779
683
  }
@@ -786,18 +690,14 @@ sap.ui.define([
786
690
  * @param {array} aServiceNames - List of service names
787
691
  * @returns {Promise<object>} Resolves to an object with the requested ushell services
788
692
  */
789
- getUShellServices(aServiceNames) {
790
- var aServicePromises = aServiceNames.map(function(sServiceName) {
791
- return this.getUShellService(sServiceName);
792
- }.bind(this));
793
- return Promise.all(aServicePromises).then(function(aServices) {
794
- return aServiceNames.reduce(function(mServices, sService, iIndex) {
795
- mServices[sService] = aServices && aServices[iIndex];
796
- return mServices;
797
- }, {});
798
- });
693
+ async getUShellServices(aServiceNames) {
694
+ const mServices = {};
695
+ for (const sServiceName of aServiceNames) {
696
+ mServices[sServiceName] = await this.getUShellService(sServiceName);
697
+ }
698
+ return mServices;
799
699
  }
800
700
 
801
701
  };
802
702
  return Utils;
803
- }, true);
703
+ });