@openui5/sap.ui.rta 1.140.0 → 1.141.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 (105) hide show
  1. package/THIRDPARTY.txt +2 -2
  2. package/package.json +6 -6
  3. package/src/sap/ui/rta/.library +1 -1
  4. package/src/sap/ui/rta/Client.js +1 -1
  5. package/src/sap/ui/rta/RuntimeAuthoring.js +1 -1
  6. package/src/sap/ui/rta/Utils.js +1 -1
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  8. package/src/sap/ui/rta/command/AddIFrame.js +6 -8
  9. package/src/sap/ui/rta/command/AddProperty.js +2 -2
  10. package/src/sap/ui/rta/command/AddXML.js +3 -3
  11. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +17 -19
  12. package/src/sap/ui/rta/command/AnnotationCommand.js +1 -1
  13. package/src/sap/ui/rta/command/BaseCommand.js +3 -4
  14. package/src/sap/ui/rta/command/BindProperty.js +4 -4
  15. package/src/sap/ui/rta/command/Combine.js +4 -4
  16. package/src/sap/ui/rta/command/CommandFactory.js +55 -77
  17. package/src/sap/ui/rta/command/CompositeCommand.js +19 -39
  18. package/src/sap/ui/rta/command/ControlVariantConfigure.js +16 -20
  19. package/src/sap/ui/rta/command/ControlVariantSave.js +19 -28
  20. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +38 -43
  21. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +15 -26
  22. package/src/sap/ui/rta/command/ControlVariantSwitch.js +29 -50
  23. package/src/sap/ui/rta/command/CreateContainer.js +3 -3
  24. package/src/sap/ui/rta/command/CustomAdd.js +2 -2
  25. package/src/sap/ui/rta/command/ExtendControllerCommand.js +2 -4
  26. package/src/sap/ui/rta/command/FlexCommand.js +34 -44
  27. package/src/sap/ui/rta/command/LREPSerializer.js +20 -23
  28. package/src/sap/ui/rta/command/LocalReset.js +3 -3
  29. package/src/sap/ui/rta/command/ManifestCommand.js +1 -1
  30. package/src/sap/ui/rta/command/Move.js +5 -5
  31. package/src/sap/ui/rta/command/Property.js +3 -3
  32. package/src/sap/ui/rta/command/Remove.js +4 -4
  33. package/src/sap/ui/rta/command/Rename.js +3 -3
  34. package/src/sap/ui/rta/command/Resize.js +2 -2
  35. package/src/sap/ui/rta/command/Reveal.js +3 -3
  36. package/src/sap/ui/rta/command/Settings.js +2 -2
  37. package/src/sap/ui/rta/command/Split.js +3 -3
  38. package/src/sap/ui/rta/command/Stack.js +51 -55
  39. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +10 -10
  40. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +4 -4
  41. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +2 -2
  42. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +11 -11
  43. package/src/sap/ui/rta/command/manifest/AddLibrary.js +4 -8
  44. package/src/sap/ui/rta/enablement/elementActionTest.js +21 -9
  45. package/src/sap/ui/rta/library.js +2 -2
  46. package/src/sap/ui/rta/messagebundle_da.properties +1 -1
  47. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +1 -1
  48. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  49. package/src/sap/ui/rta/plugin/AddXMLPlugin.js +1 -1
  50. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  51. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  52. package/src/sap/ui/rta/plugin/ControlVariant.js +65 -87
  53. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  54. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  55. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  56. package/src/sap/ui/rta/plugin/ExtendControllerPlugin.js +1 -1
  57. package/src/sap/ui/rta/plugin/LocalReset.js +26 -35
  58. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  59. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  60. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  61. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  62. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  63. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  64. package/src/sap/ui/rta/plugin/Split.js +1 -1
  65. package/src/sap/ui/rta/plugin/Stretch.js +7 -6
  66. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  67. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  68. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +17 -5
  69. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  70. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  71. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  72. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +1 -1
  73. package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +1 -1
  74. package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +1 -1
  75. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  76. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  77. package/src/sap/ui/rta/plugin/rename/Rename.js +1 -1
  78. package/src/sap/ui/rta/plugin/rename/RenameDialog.js +2 -4
  79. package/src/sap/ui/rta/service/Action.js +1 -1
  80. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  81. package/src/sap/ui/rta/service/Outline.js +1 -1
  82. package/src/sap/ui/rta/service/Property.js +1 -1
  83. package/src/sap/ui/rta/service/Selection.js +1 -1
  84. package/src/sap/ui/rta/service/SupportTools.js +1 -1
  85. package/src/sap/ui/rta/toolbar/Adaptation.js +1 -1
  86. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  87. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  88. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  89. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  90. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  91. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  92. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  93. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
  94. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  95. package/src/sap/ui/rta/util/PopupManager.js +3 -3
  96. package/src/sap/ui/rta/util/ReloadManager.js +1 -1
  97. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  98. package/src/sap/ui/rta/util/ServiceManager.js +1 -1
  99. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
  100. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  101. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +1 -1
  102. package/src/sap/ui/rta/util/changeVisualization/resolveBinding.js +1 -1
  103. package/src/sap/ui/rta/util/guidedTour/GuidedTour.js +1 -1
  104. package/src/sap/ui/rta/util/guidedTour/content/GeneralTour.js +1 -1
  105. package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
package/THIRDPARTY.txt CHANGED
@@ -379,7 +379,7 @@ License: MIT
379
379
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
380
380
  Contained in: src/sap.ui.integration/src/sap/ui/integration/thirdparty/adaptive-expressions.js
381
381
 
382
- Component: Markdown-it, version: 12.3.2
382
+ Component: Markdown-it, version: 14.1.0
383
383
  Copyright: 2014 Vitaly Puzrin, Alex Kocharin
384
384
  License: MIT
385
385
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
@@ -444,7 +444,7 @@ License: Apache-2.0
444
444
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
445
445
  Contained in: lib/jsdoc/ui5/plugin.js
446
446
 
447
- Component: SAP Theming Base Content, version: 11.31.1
447
+ Component: SAP Theming Base Content, version: 11.32.2-20250827135846+79bb30d311678435d61b21db26ecbe07d6b05079
448
448
  Copyright: SAP SE or an SAP affiliate company and Theming Base Content contributors
449
449
  License: Apache-2.0
450
450
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.rta",
3
- "version": "1.140.0",
3
+ "version": "1.141.0",
4
4
  "description": "OpenUI5 UI Library sap.ui.rta",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,10 +14,10 @@
14
14
  "url": "https://github.com/UI5/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.m": "1.140.0",
18
- "@openui5/sap.ui.core": "1.140.0",
19
- "@openui5/sap.ui.dt": "1.140.0",
20
- "@openui5/sap.ui.fl": "1.140.0",
21
- "@openui5/sap.ui.layout": "1.140.0"
17
+ "@openui5/sap.m": "1.141.0",
18
+ "@openui5/sap.ui.core": "1.141.0",
19
+ "@openui5/sap.ui.dt": "1.141.0",
20
+ "@openui5/sap.ui.fl": "1.141.0",
21
+ "@openui5/sap.ui.layout": "1.141.0"
22
22
  }
23
23
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2025 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.140.0</version>
9
+ <version>1.141.0</version>
10
10
 
11
11
  <documentation>SAPUI5 library with RTA controls.</documentation>
12
12
 
@@ -59,7 +59,7 @@ sap.ui.define([
59
59
  * @alias sap.ui.rta.Client
60
60
  * @author SAP SE
61
61
  * @since 1.56.0
62
- * @version 1.140.0
62
+ * @version 1.141.0
63
63
  * @private
64
64
  * @ui5-restricted
65
65
  */
@@ -114,7 +114,7 @@ sap.ui.define([
114
114
  * @class The runtime authoring allows to adapt the fields of a running application.
115
115
  * @extends sap.ui.base.ManagedObject
116
116
  * @author SAP SE
117
- * @version 1.140.0
117
+ * @version 1.141.0
118
118
  * @constructor
119
119
  * @private
120
120
  * @since 1.30
@@ -46,7 +46,7 @@ sap.ui.define([
46
46
  *
47
47
  * @namespace
48
48
  * @author SAP SE
49
- * @version 1.140.0
49
+ * @version 1.141.0
50
50
  *
51
51
  * @private
52
52
  * @since 1.30
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.base.ManagedObject
26
26
  * @author SAP SE
27
- * @version 1.140.0
27
+ * @version 1.141.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.53
@@ -16,13 +16,13 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.140.0
19
+ * @version 1.141.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.75
23
23
  * @alias sap.ui.rta.command.AddIFrame
24
24
  */
25
- var AddIFrame = FlexCommand.extend("sap.ui.rta.command.AddIFrame", {
25
+ const AddIFrame = FlexCommand.extend("sap.ui.rta.command.AddIFrame", {
26
26
  metadata: {
27
27
  library: "sap.ui.rta",
28
28
  properties: {
@@ -72,12 +72,10 @@ sap.ui.define([
72
72
  // Override to avoid url to be 'bound'
73
73
  AddIFrame.prototype.applySettings = function(...aArgs) {
74
74
  const mSettings = aArgs[0];
75
- var mSettingsWithoutUrl = {};
75
+ const mSettingsWithoutUrl = {};
76
76
  Object.keys(mSettings)
77
- .filter(function(sSettingName) {
78
- return sSettingName !== "url";
79
- })
80
- .forEach(function(sSettingName) {
77
+ .filter((sSettingName) => sSettingName !== "url")
78
+ .forEach((sSettingName) => {
81
79
  mSettingsWithoutUrl[sSettingName] = mSettings[sSettingName];
82
80
  });
83
81
  aArgs[0] = mSettingsWithoutUrl;
@@ -86,7 +84,7 @@ sap.ui.define([
86
84
  };
87
85
 
88
86
  AddIFrame.prototype._getChangeSpecificData = function() {
89
- var mChangeSpecificData = FlexCommand.prototype._getChangeSpecificData.call(this);
87
+ const mChangeSpecificData = FlexCommand.prototype._getChangeSpecificData.call(this);
90
88
  const { title: sTitle, ...oContent } = mChangeSpecificData.content;
91
89
  return {
92
90
  changeType: mChangeSpecificData.changeType,
@@ -14,13 +14,13 @@ sap.ui.define([
14
14
  * @class
15
15
  * @extends sap.ui.rta.command.FlexCommand
16
16
  * @author SAP SE
17
- * @version 1.140.0
17
+ * @version 1.141.0
18
18
  * @constructor
19
19
  * @private
20
20
  * @since 1.78
21
21
  * @alias sap.ui.rta.command.AddProperty
22
22
  */
23
- var AddProperty = FlexCommand.extend("sap.ui.rta.command.AddProperty", {
23
+ const AddProperty = FlexCommand.extend("sap.ui.rta.command.AddProperty", {
24
24
  metadata: {
25
25
  library: "sap.ui.rta",
26
26
  properties: {
@@ -16,13 +16,13 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.140.0
19
+ * @version 1.141.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.54
23
23
  * @alias sap.ui.rta.command.AddXML
24
24
  */
25
- var AddXML = FlexCommand.extend("sap.ui.rta.command.AddXML", {
25
+ const AddXML = FlexCommand.extend("sap.ui.rta.command.AddXML", {
26
26
  metadata: {
27
27
  library: "sap.ui.rta",
28
28
  properties: {
@@ -72,7 +72,7 @@ sap.ui.define([
72
72
  AddXML.prototype._applyChange = function(...aArgs) {
73
73
  const vChange = aArgs[0];
74
74
  // preload the module to be applicable in this session
75
- var mModulePreloads = {};
75
+ const mModulePreloads = {};
76
76
  mModulePreloads[vChange.getFlexObjectMetadata().moduleName] = this.getFragment();
77
77
  sap.ui.require.preload(mModulePreloads);
78
78
 
@@ -24,13 +24,13 @@ sap.ui.define([
24
24
  * @class
25
25
  * @extends sap.ui.rta.command.FlexCommand
26
26
  * @author SAP SE
27
- * @version 1.140.0
27
+ * @version 1.141.0
28
28
  * @constructor
29
29
  * @private
30
30
  * @since 1.76
31
31
  * @alias sap.ui.rta.command.AddXMLAtExtensionPoint
32
32
  */
33
- var AddXMLAtExtensionPoint = FlexCommand.extend("sap.ui.rta.command.AddXMLAtExtensionPoint", {
33
+ const AddXMLAtExtensionPoint = FlexCommand.extend("sap.ui.rta.command.AddXMLAtExtensionPoint", {
34
34
  metadata: {
35
35
  library: "sap.ui.rta",
36
36
  properties: {
@@ -65,7 +65,7 @@ sap.ui.define([
65
65
  };
66
66
 
67
67
  AddXMLAtExtensionPoint.prototype.getAppComponent = function() {
68
- var oView = this.getSelector().view;
68
+ const oView = this.getSelector().view;
69
69
  return Utils.getAppComponentForControl(oView);
70
70
  };
71
71
 
@@ -74,35 +74,33 @@ sap.ui.define([
74
74
  * When first applying a change we need to do the same.
75
75
  * @override
76
76
  */
77
- AddXMLAtExtensionPoint.prototype._applyChange = function(vChange) {
77
+ AddXMLAtExtensionPoint.prototype._applyChange = async function(vChange) {
78
78
  // preload the module to be applicable in this session
79
- var mModulePreloads = {};
79
+ const mModulePreloads = {};
80
80
  mModulePreloads[vChange.getFlexObjectMetadata().moduleName] = this.getFragment();
81
81
  sap.ui.require.preload(mModulePreloads);
82
82
 
83
- var oChange = vChange.change || vChange;
84
- var oAppComponent = this.getAppComponent();
85
- var oSelector = oChange.getSelector();
86
- var oView = JsControlTreeModifier.bySelector(oSelector.viewSelector, oAppComponent);
87
- var oExtensionPointInfo = ExtensionPointRegistryAPI.getExtensionPointInfo({
83
+ const oChange = vChange.change || vChange;
84
+ const oAppComponent = this.getAppComponent();
85
+ const oSelector = oChange.getSelector();
86
+ const oView = JsControlTreeModifier.bySelector(oSelector.viewSelector, oAppComponent);
87
+ const oExtensionPointInfo = ExtensionPointRegistryAPI.getExtensionPointInfo({
88
88
  name: oSelector.name,
89
89
  view: oView
90
90
  });
91
- var oSelectorElement = oExtensionPointInfo.targetControl;
91
+ const oSelectorElement = oExtensionPointInfo.targetControl;
92
92
  oChange.setExtensionPointInfo(oExtensionPointInfo);
93
93
 
94
- var mPropertyBag = {
94
+ const mPropertyBag = {
95
95
  modifier: JsControlTreeModifier,
96
96
  appComponent: oAppComponent,
97
97
  view: oView
98
98
  };
99
- return ChangesWriteAPI.apply({ change: oChange, element: oSelectorElement, ...mPropertyBag })
100
- .then(function(oResult) {
101
- if (!oResult.success) {
102
- return Promise.reject(oResult.error);
103
- }
104
- return undefined;
105
- });
99
+ const oResult = await ChangesWriteAPI.apply({ change: oChange, element: oSelectorElement, ...mPropertyBag });
100
+ if (!oResult.success) {
101
+ throw Error(oResult.error);
102
+ }
103
+ return oResult;
106
104
  };
107
105
 
108
106
  return AddXMLAtExtensionPoint;
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @extends sap.ui.rta.command.FlexCommand
30
30
  *
31
31
  * @author SAP SE
32
- * @version 1.140.0
32
+ * @version 1.141.0
33
33
  *
34
34
  * @constructor
35
35
  * @private
@@ -16,14 +16,14 @@ sap.ui.define([
16
16
  * @extends sap.ui.base.ManagedObject
17
17
  *
18
18
  * @author SAP SE
19
- * @version 1.140.0
19
+ * @version 1.141.0
20
20
  *
21
21
  * @constructor
22
22
  * @private
23
23
  * @since 1.34
24
24
  * @alias sap.ui.rta.command.BaseCommand
25
25
  */
26
- var BaseCommand = ManagedObject.extend("sap.ui.rta.command.BaseCommand", {
26
+ const BaseCommand = ManagedObject.extend("sap.ui.rta.command.BaseCommand", {
27
27
  metadata: {
28
28
  library: "sap.ui.rta",
29
29
  properties: {
@@ -56,8 +56,7 @@ sap.ui.define([
56
56
  * @override
57
57
  */
58
58
  BaseCommand.prototype.getElement = function() {
59
- var sId = this.getAssociation("element");
60
- return Element.getElementById(sId);
59
+ return Element.getElementById(this.getAssociation("element"));
61
60
  };
62
61
 
63
62
  /**
@@ -26,13 +26,13 @@ sap.ui.define([
26
26
  * @class
27
27
  * @extends sap.ui.rta.command.FlexCommand
28
28
  * @author SAP SE
29
- * @version 1.140.0
29
+ * @version 1.141.0
30
30
  * @constructor
31
31
  * @private
32
32
  * @since 1.38
33
33
  * @alias sap.ui.rta.command.BindProperty
34
34
  */
35
- var BindProperty = FlexCommand.extend("sap.ui.rta.command.BindProperty", {
35
+ const BindProperty = FlexCommand.extend("sap.ui.rta.command.BindProperty", {
36
36
  metadata: {
37
37
  library: "sap.ui.rta",
38
38
  properties: {
@@ -65,9 +65,9 @@ sap.ui.define([
65
65
  };
66
66
 
67
67
  BindProperty.prototype._getChangeSpecificData = function() {
68
- var oElement = this.getElement();
68
+ const oElement = this.getElement();
69
69
  // general format
70
- var mSpecificChangeInfo = {
70
+ const mSpecificChangeInfo = {
71
71
  changeType: this.getChangeType(),
72
72
  selector: {
73
73
  id: oElement.getId(),
@@ -16,13 +16,13 @@ sap.ui.define([
16
16
  * @class
17
17
  * @extends sap.ui.rta.command.FlexCommand
18
18
  * @author SAP SE
19
- * @version 1.140.0
19
+ * @version 1.141.0
20
20
  * @constructor
21
21
  * @private
22
22
  * @since 1.46
23
23
  * @alias sap.ui.rta.command.Combine
24
24
  */
25
- var Combine = FlexCommand.extend("sap.ui.rta.command.Combine", {
25
+ const Combine = FlexCommand.extend("sap.ui.rta.command.Combine", {
26
26
  metadata: {
27
27
  library: "sap.ui.rta",
28
28
  properties: {
@@ -48,11 +48,11 @@ sap.ui.define([
48
48
  * @override
49
49
  */
50
50
  Combine.prototype._getChangeSpecificData = function() {
51
- var aFieldIds = [];
51
+ const aFieldIds = [];
52
52
  this.getCombineElements().forEach(function(oField) {
53
53
  aFieldIds.push(oField.getId());
54
54
  });
55
- var mSpecificInfo = {
55
+ const mSpecificInfo = {
56
56
  changeType: this.getChangeType(),
57
57
  content: {
58
58
  newElementId: this.getNewElementId(),
@@ -102,13 +102,9 @@ sap.ui.define([
102
102
  }
103
103
 
104
104
  function configureAddXmlCommand(oElement, mSettings, oDesignTimeMetadata) {
105
- let vAction;
106
- if (oDesignTimeMetadata) {
107
- vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
108
- }
109
105
  // the change type is not configurable via designtime
110
106
  // it can also not be disabled with 'not-adaptable' or null
111
- const oAction = vAction || {};
107
+ const oAction = oDesignTimeMetadata?.getAction(mSettings.name, oElement) || {};
112
108
  Object.assign(oAction, {
113
109
  changeType: mSettings.name
114
110
  });
@@ -116,13 +112,9 @@ sap.ui.define([
116
112
  }
117
113
 
118
114
  function configureExtendControllerCommand(oElement, mSettings, oDesignTimeMetadata) {
119
- var vAction;
120
- if (oDesignTimeMetadata) {
121
- vAction = oDesignTimeMetadata.getAction(mSettings.name, oElement);
122
- }
123
115
  // the change type is not configurable via designtime
124
116
  // it can also not be disabled with 'not-adaptable' or null
125
- var oAction = vAction || {};
117
+ const oAction = oDesignTimeMetadata?.getAction(mSettings.name, oElement) || {};
126
118
  Object.assign(oAction, {
127
119
  changeType: mSettings.name
128
120
  });
@@ -188,10 +180,8 @@ sap.ui.define([
188
180
  }
189
181
 
190
182
  function configureRemoveCommand(oElement, mSettings, oDesignTimeMetadata) {
191
- let oRemovedElement = mSettings.removedElement;
192
- if (!oRemovedElement) {
193
- oRemovedElement = oElement;
194
- } else if (!(oRemovedElement instanceof ManagedObject)) {
183
+ const oRemovedElement = mSettings.removedElement || oElement;
184
+ if (!(oRemovedElement instanceof ManagedObject)) {
195
185
  throw new Error("No valid 'removedElement' found");
196
186
  }
197
187
  const oAction = oDesignTimeMetadata.getAction("remove", oRemovedElement);
@@ -252,9 +242,7 @@ sap.ui.define([
252
242
  }
253
243
 
254
244
  function configureRevealCommand(oElement, mSettings, oDesignTimeMetadata) {
255
- const oRevealedElement = mSettings.element;
256
- const oAction = oDesignTimeMetadata.getAction("reveal", oRevealedElement);
257
- return oAction;
245
+ return oDesignTimeMetadata.getAction("reveal", mSettings.element);
258
246
  }
259
247
 
260
248
  function adjustRevealCommand(mSettings) {
@@ -285,7 +273,8 @@ sap.ui.define([
285
273
  }
286
274
 
287
275
  function configureAddIFrame(oElement, mSettings, oDesignTimeMetadata) {
288
- return oDesignTimeMetadata.getAction("addIFrame", mSettings.element) || oDesignTimeMetadata.getActionDataFromAggregations("addIFrame", mSettings.element)[0];
276
+ return oDesignTimeMetadata.getAction("addIFrame", mSettings.element)
277
+ || oDesignTimeMetadata.getActionDataFromAggregations("addIFrame", mSettings.element)[0];
289
278
  }
290
279
 
291
280
  function configureBindPropertyCommand() {
@@ -429,85 +418,74 @@ sap.ui.define([
429
418
  }
430
419
  };
431
420
 
432
- function getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings, sVariantManagementReference) {
433
- let oCommand;
434
- sCommand = sCommand[0].toLowerCase() + sCommand.slice(1); // first char of command name is lower case
435
- const mCommand = mCommands[sCommand];
436
- let mAllFlexSettings = mFlexSettings;
437
-
438
- if (!mCommand) {
439
- return Promise.reject(DtUtil.createError("CommandFactory#getCommandFor", `Command '${sCommand}' doesn't exist, check typing`, "sap.ui.rta"));
440
- }
441
-
421
+ function requireModule(mCommand) {
442
422
  return new Promise(function(fnResolve) {
443
423
  const sClassName = mCommand.clazz;
444
424
  sap.ui.require([sClassName], function(Command) {
445
425
  fnResolve(Command);
446
426
  });
447
- })
427
+ });
428
+ }
448
429
 
449
- .then(function(Command) {
450
- const bIsUiElement = vElement instanceof ManagedObject;
430
+ async function getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings, sVariantManagementReference) {
431
+ const sAdjustedCommandName = sCommand[0].toLowerCase() + sCommand.slice(1); // first char of command name is lower case
432
+ const mCommand = mCommands[sAdjustedCommandName];
433
+ let mAllFlexSettings = mFlexSettings;
451
434
 
452
- // only sap.ui.rta.command.FlexCommand requires a selector property
453
- if (!mCommand.noSelector && !bIsUiElement) {
454
- mSettings = { ...mSettings, selector: vElement };
455
- }
435
+ if (!mCommand) {
436
+ return DtUtil.createError("CommandFactory#getCommandFor", `Command '${sAdjustedCommandName}' doesn't exist, check typing`, "sap.ui.rta");
437
+ }
456
438
 
457
- mSettings = {
458
- ...mSettings,
459
- element: bIsUiElement ? vElement : undefined,
460
- name: sCommand
461
- };
439
+ const Command = await requireModule(mCommand);
462
440
 
463
- let oAction;
464
- if (mCommand.configure) {
465
- oAction = mCommand.configure(vElement, mSettings, oDesignTimeMetadata);
466
- }
441
+ const bIsUiElement = vElement instanceof ManagedObject;
467
442
 
468
- let oElementOverlay;
469
- if (bIsUiElement) {
470
- oElementOverlay = OverlayRegistry.getOverlay(vElement);
471
- }
443
+ // only sap.ui.rta.command.FlexCommand requires a selector property
444
+ if (!mCommand.noSelector && !bIsUiElement) {
445
+ mSettings = { ...mSettings, selector: vElement };
446
+ }
472
447
 
473
- if (oAction && oAction.changeOnRelevantContainer) {
474
- Object.assign(mSettings, {
475
- element: oElementOverlay.getRelevantContainer()
476
- });
477
- vElement = mSettings.element;
478
- oElementOverlay = OverlayRegistry.getOverlay(vElement);
479
- }
448
+ mSettings = {
449
+ ...mSettings,
450
+ element: bIsUiElement ? vElement : undefined,
451
+ name: sAdjustedCommandName
452
+ };
480
453
 
481
- let mTemplateSettings;
482
- if (oElementOverlay && vElement.sParentAggregationName) {
483
- mTemplateSettings = evaluateTemplateBinding(oElementOverlay);
484
- }
454
+ const oAction = mCommand.configure ? mCommand.configure(vElement, mSettings, oDesignTimeMetadata) : undefined;
455
+
456
+ let oElementOverlay = bIsUiElement ? OverlayRegistry.getOverlay(vElement) : undefined;
457
+
458
+ if (oAction?.changeOnRelevantContainer) {
459
+ Object.assign(mSettings, {
460
+ element: oElementOverlay.getRelevantContainer()
461
+ });
462
+ vElement = mSettings.element;
463
+ oElementOverlay = OverlayRegistry.getOverlay(vElement);
464
+ }
485
465
 
466
+ if (oElementOverlay && vElement.sParentAggregationName) {
467
+ const mTemplateSettings = evaluateTemplateBinding(oElementOverlay);
486
468
  if (mTemplateSettings) {
487
469
  if (mCommand.adjustForBinding) {
488
470
  mCommand.adjustForBinding(mSettings);
489
471
  }
490
472
  mAllFlexSettings = merge(mTemplateSettings, mAllFlexSettings);
491
473
  }
474
+ }
492
475
 
493
- oCommand = new Command(mSettings);
476
+ const oCommand = new Command(mSettings);
494
477
 
495
- let bSuccessfullyConfigured = true; // configuration is optional
496
- if (mCommand.configure) {
497
- bSuccessfullyConfigured = configureActionCommand(oCommand, oAction);
498
- }
478
+ // configuration is optional
479
+ const bSuccessfullyConfigured = mCommand.configure ? configureActionCommand(oCommand, oAction) : true;
499
480
 
500
- if (bSuccessfullyConfigured) {
501
- return oCommand.prepare(mAllFlexSettings, sVariantManagementReference, sCommand);
502
- }
503
- return undefined;
504
- }).then(function(bPrepareStatus) {
481
+ if (bSuccessfullyConfigured) {
482
+ const bPrepareStatus = await oCommand.prepare(mAllFlexSettings, sVariantManagementReference, sAdjustedCommandName);
505
483
  if (bPrepareStatus) {
506
484
  return oCommand;
507
485
  }
508
- oCommand.destroy();
509
- return undefined;
510
- });
486
+ }
487
+ oCommand.destroy();
488
+ return undefined;
511
489
  }
512
490
 
513
491
  /**
@@ -517,7 +495,7 @@ sap.ui.define([
517
495
  * @extends sap.ui.base.ManagedObject
518
496
  *
519
497
  * @author SAP SE
520
- * @version 1.140.0
498
+ * @version 1.141.0
521
499
  *
522
500
  * @constructor
523
501
  * @private
@@ -568,7 +546,7 @@ sap.ui.define([
568
546
  * Static method for generating command
569
547
  * @param {sap.ui.core.Element|string} vElement - Could be either an element or a selector for the element for which the command is to be created
570
548
  * @param {string} sCommand - Command type
571
- * @param {object} mSettings - Initial settings for the new command (command specific settings, looks different for each and every command)
549
+ * @param {object} mSettings - Initial settings for the new command (command specific settings, looks different for each and every command)
572
550
  * @param {sap.ui.dt.DesignTimeMetadata} oDesignTimeMetadata - Contains the action used in the command
573
551
  * @param {object} [mFlexSettings] - Property bag
574
552
  * @param {string} [mFlexSettings.layer] - The Layer in which RTA should be started. Default: "CUSTOMER"
@@ -586,9 +564,9 @@ sap.ui.define([
586
564
  };
587
565
 
588
566
  if (mFlexSettings.scenario || mFlexSettings.baseId) {
589
- const sLRepRootNamespace = FlexUtils.buildLrepRootNamespace(mFlexSettings.baseId, mFlexSettings.scenario, mFlexSettings.projectId);
590
- mFlexSettings.rootNamespace = sLRepRootNamespace;
591
- mFlexSettings.namespace = `${sLRepRootNamespace}changes/`;
567
+ const sLRepNamespace = FlexUtils.buildLrepRootNamespace(mFlexSettings.baseId, mFlexSettings.scenario, mFlexSettings.projectId);
568
+ mFlexSettings.rootNamespace = sLRepNamespace;
569
+ mFlexSettings.namespace = `${sLRepNamespace}changes/`;
592
570
  }
593
571
 
594
572
  return getCommandFor(vElement, sCommand, mSettings, oDesignTimeMetadata, mFlexSettings);