@openui5/sap.ui.rta 1.98.0 → 1.101.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 (206) hide show
  1. package/THIRDPARTY.txt +6 -6
  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 +64 -50
  6. package/src/sap/ui/rta/Utils.js +4 -6
  7. package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +76 -0
  8. package/src/sap/ui/rta/appContexts/Component.js +31 -0
  9. package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +323 -0
  10. package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +22 -0
  11. package/src/sap/ui/rta/appContexts/i18n/i18n.properties +47 -0
  12. package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +23 -0
  13. package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +23 -0
  14. package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +23 -0
  15. package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +23 -0
  16. package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +23 -0
  17. package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +23 -0
  18. package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +23 -0
  19. package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +23 -0
  20. package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +23 -0
  21. package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +23 -0
  22. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +23 -0
  23. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +23 -0
  24. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +23 -0
  25. package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +23 -0
  26. package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +23 -0
  27. package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +23 -0
  28. package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +23 -0
  29. package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +23 -0
  30. package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +23 -0
  31. package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +23 -0
  32. package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +23 -0
  33. package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +23 -0
  34. package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +23 -0
  35. package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +23 -0
  36. package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +23 -0
  37. package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +23 -0
  38. package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +23 -0
  39. package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +23 -0
  40. package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +23 -0
  41. package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +23 -0
  42. package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +23 -0
  43. package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +23 -0
  44. package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +23 -0
  45. package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +23 -0
  46. package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +23 -0
  47. package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +23 -0
  48. package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +23 -0
  49. package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +23 -0
  50. package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +23 -0
  51. package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +23 -0
  52. package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +23 -0
  53. package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +23 -0
  54. package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +23 -0
  55. package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +23 -0
  56. package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +23 -0
  57. package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +23 -0
  58. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +23 -0
  59. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +23 -0
  60. package/src/sap/ui/rta/appContexts/index.html +25 -0
  61. package/src/sap/ui/rta/appContexts/manifest.json +52 -0
  62. package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +76 -0
  63. package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +103 -0
  64. package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +76 -0
  65. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +6 -3
  66. package/src/sap/ui/rta/appVariant/AppVariantManager.js +11 -11
  67. package/src/sap/ui/rta/appVariant/Feature.js +16 -6
  68. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  69. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  70. package/src/sap/ui/rta/command/AddXML.js +3 -2
  71. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -2
  72. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  73. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  74. package/src/sap/ui/rta/command/BindProperty.js +3 -2
  75. package/src/sap/ui/rta/command/Combine.js +5 -1
  76. package/src/sap/ui/rta/command/CommandFactory.js +20 -13
  77. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  78. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  79. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  80. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  81. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  82. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  83. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  84. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  85. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  86. package/src/sap/ui/rta/command/LREPSerializer.js +1 -1
  87. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  88. package/src/sap/ui/rta/command/Move.js +1 -1
  89. package/src/sap/ui/rta/command/Property.js +1 -1
  90. package/src/sap/ui/rta/command/Remove.js +1 -1
  91. package/src/sap/ui/rta/command/Rename.js +1 -1
  92. package/src/sap/ui/rta/command/Resize.js +45 -0
  93. package/src/sap/ui/rta/command/Reveal.js +1 -1
  94. package/src/sap/ui/rta/command/Settings.js +1 -1
  95. package/src/sap/ui/rta/command/Split.js +1 -1
  96. package/src/sap/ui/rta/command/Stack.js +15 -12
  97. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  98. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  99. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  100. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  101. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  102. package/src/sap/ui/rta/library.js +6 -9
  103. package/src/sap/ui/rta/messagebundle.properties +20 -11
  104. package/src/sap/ui/rta/messagebundle_ar.properties +14 -9
  105. package/src/sap/ui/rta/messagebundle_bg.properties +16 -11
  106. package/src/sap/ui/rta/messagebundle_ca.properties +15 -10
  107. package/src/sap/ui/rta/messagebundle_cs.properties +14 -9
  108. package/src/sap/ui/rta/messagebundle_cy.properties +14 -9
  109. package/src/sap/ui/rta/messagebundle_da.properties +14 -9
  110. package/src/sap/ui/rta/messagebundle_de.properties +14 -9
  111. package/src/sap/ui/rta/messagebundle_el.properties +14 -9
  112. package/src/sap/ui/rta/messagebundle_en.properties +14 -9
  113. package/src/sap/ui/rta/messagebundle_en_GB.properties +14 -9
  114. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -9
  115. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +42 -20
  116. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -9
  117. package/src/sap/ui/rta/messagebundle_es.properties +14 -9
  118. package/src/sap/ui/rta/messagebundle_es_MX.properties +15 -10
  119. package/src/sap/ui/rta/messagebundle_et.properties +14 -9
  120. package/src/sap/ui/rta/messagebundle_fi.properties +14 -9
  121. package/src/sap/ui/rta/messagebundle_fr.properties +14 -9
  122. package/src/sap/ui/rta/messagebundle_fr_CA.properties +14 -9
  123. package/src/sap/ui/rta/messagebundle_hi.properties +13 -8
  124. package/src/sap/ui/rta/messagebundle_hr.properties +14 -9
  125. package/src/sap/ui/rta/messagebundle_hu.properties +14 -9
  126. package/src/sap/ui/rta/messagebundle_id.properties +14 -9
  127. package/src/sap/ui/rta/messagebundle_it.properties +14 -9
  128. package/src/sap/ui/rta/messagebundle_iw.properties +14 -9
  129. package/src/sap/ui/rta/messagebundle_ja.properties +14 -9
  130. package/src/sap/ui/rta/messagebundle_kk.properties +14 -9
  131. package/src/sap/ui/rta/messagebundle_ko.properties +14 -9
  132. package/src/sap/ui/rta/messagebundle_lt.properties +14 -9
  133. package/src/sap/ui/rta/messagebundle_lv.properties +16 -11
  134. package/src/sap/ui/rta/messagebundle_ms.properties +14 -9
  135. package/src/sap/ui/rta/messagebundle_nl.properties +14 -9
  136. package/src/sap/ui/rta/messagebundle_no.properties +14 -9
  137. package/src/sap/ui/rta/messagebundle_pl.properties +14 -9
  138. package/src/sap/ui/rta/messagebundle_pt.properties +14 -9
  139. package/src/sap/ui/rta/messagebundle_pt_PT.properties +14 -9
  140. package/src/sap/ui/rta/messagebundle_ro.properties +14 -9
  141. package/src/sap/ui/rta/messagebundle_ru.properties +14 -9
  142. package/src/sap/ui/rta/messagebundle_sh.properties +14 -9
  143. package/src/sap/ui/rta/messagebundle_sk.properties +15 -10
  144. package/src/sap/ui/rta/messagebundle_sl.properties +14 -9
  145. package/src/sap/ui/rta/messagebundle_sv.properties +14 -9
  146. package/src/sap/ui/rta/messagebundle_th.properties +14 -9
  147. package/src/sap/ui/rta/messagebundle_tr.properties +14 -9
  148. package/src/sap/ui/rta/messagebundle_uk.properties +13 -8
  149. package/src/sap/ui/rta/messagebundle_vi.properties +14 -9
  150. package/src/sap/ui/rta/messagebundle_zh_CN.properties +14 -9
  151. package/src/sap/ui/rta/messagebundle_zh_TW.properties +15 -10
  152. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  153. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  154. package/src/sap/ui/rta/plugin/Combine.js +15 -14
  155. package/src/sap/ui/rta/plugin/ControlVariant.js +3 -3
  156. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -3
  157. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  158. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  159. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  160. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  161. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  162. package/src/sap/ui/rta/plugin/Plugin.js +32 -11
  163. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  164. package/src/sap/ui/rta/plugin/Remove.js +26 -27
  165. package/src/sap/ui/rta/plugin/Rename.js +6 -19
  166. package/src/sap/ui/rta/plugin/RenameHandler.js +21 -6
  167. package/src/sap/ui/rta/plugin/Resize.js +432 -0
  168. package/src/sap/ui/rta/plugin/Selection.js +21 -8
  169. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  170. package/src/sap/ui/rta/plugin/Split.js +5 -11
  171. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  172. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +39 -38
  173. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  174. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  175. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  176. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  177. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  178. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  179. package/src/sap/ui/rta/service/Action.js +1 -1
  180. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  181. package/src/sap/ui/rta/service/Outline.js +1 -1
  182. package/src/sap/ui/rta/service/Property.js +1 -1
  183. package/src/sap/ui/rta/service/Selection.js +1 -1
  184. package/src/sap/ui/rta/themes/base/ChangeVisualization.less +55 -75
  185. package/src/sap/ui/rta/themes/base/Overlay.less +50 -0
  186. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +5 -19
  187. package/src/sap/ui/rta/toolbar/Adaptation.js +4 -3
  188. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  189. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  190. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  191. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  192. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  193. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  194. package/src/sap/ui/rta/toolbar/translation/Translation.js +52 -31
  195. package/src/sap/ui/rta/util/PluginManager.js +9 -3
  196. package/src/sap/ui/rta/util/PopupManager.js +33 -12
  197. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  198. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +109 -60
  199. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +30 -0
  200. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +6 -5
  201. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  202. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +146 -79
  203. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +37 -0
  204. package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +25 -4
  205. package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +14 -2
  206. package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +5 -2
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  * Provides Rename handling functionality
56
56
  *
57
57
  * @author SAP SE
58
- * @version 1.98.0
58
+ * @version 1.101.0
59
59
  *
60
60
  * @constructor
61
61
  * @private
@@ -109,6 +109,18 @@ sap.ui.define([
109
109
  }
110
110
 
111
111
  this._$oEditableControlDomRef = jQuery(vEditableControlDomRef); /* Text Control */
112
+ var mMutators = typeof mPropertyBag.getTextMutators === "function"
113
+ ? mPropertyBag.getTextMutators(oElement)
114
+ : {
115
+ getText: function () {
116
+ return this._$oEditableControlDomRef.text();
117
+ }.bind(this),
118
+ setText: function (sNewText) {
119
+ this._$oEditableControlDomRef.text(sNewText);
120
+ }.bind(this)
121
+ };
122
+ this._fnGetControlText = mMutators.getText;
123
+ this._fnSetControlText = mMutators.setText;
112
124
  var iWidthDifference = 0;
113
125
 
114
126
  // case where the editable control has it's own overlay
@@ -154,11 +166,12 @@ sap.ui.define([
154
166
  this._$editableField = jQuery("<div contentEditable='true'></div>").appendTo(_$oWrapper);
155
167
 
156
168
  // if label is empty, set a preliminary dummy text at the control to get an overlay
157
- if (this._$oEditableControlDomRef.text() === "") {
158
- this._$oEditableControlDomRef.text("_?_");
169
+ var sCurrentText = this._fnGetControlText();
170
+ if (sCurrentText === "") {
171
+ this._fnSetControlText("_?_");
159
172
  this._$editableField.text("");
160
173
  } else {
161
- this._$editableField.text(this._$oEditableControlDomRef.text());
174
+ this._$editableField.text(sCurrentText);
162
175
  }
163
176
 
164
177
  this.setOldValue(RenameHandler._getCurrentEditableFieldText.call(this));
@@ -284,8 +297,8 @@ sap.ui.define([
284
297
  this.setBusy(false);
285
298
 
286
299
  // exchange the dummy text at the label with the genuine empty text (see start_edit function)
287
- if (this._$oEditableControlDomRef.text() === "_?_") {
288
- this._$oEditableControlDomRef.text("");
300
+ if (this._fnGetControlText() === "_?_") {
301
+ this._fnSetControlText("");
289
302
  }
290
303
 
291
304
  this._oEditedOverlay.$().find(".sapUiRtaEditableField").remove();
@@ -305,6 +318,8 @@ sap.ui.define([
305
318
  delete this._$oEditableControlDomRef;
306
319
  delete this._oEditedOverlay;
307
320
  delete this._bBlurOrKeyDownStarted;
321
+ delete this._fnGetControlText;
322
+ delete this._fnSetControlText;
308
323
 
309
324
  sap.ui.getCore().getEventBus().publish("sap.ui.rta", sPluginMethodName, {
310
325
  overlay: oOverlay
@@ -0,0 +1,432 @@
1
+ /*!
2
+ * OpenUI5
3
+ * (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
4
+ * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
+ */
6
+
7
+ sap.ui.define([
8
+ "sap/ui/rta/plugin/Plugin",
9
+ "sap/ui/dt/Overlay",
10
+ "sap/ui/dt/OverlayRegistry",
11
+ "sap/ui/dt/util/ZIndexManager",
12
+ "sap/ui/dt/Util",
13
+ "sap/ui/core/Core"
14
+ ], function(
15
+ Plugin,
16
+ Overlay,
17
+ OverlayRegistry,
18
+ ZIndexManager,
19
+ DtUtil,
20
+ Core
21
+ ) {
22
+ "use strict";
23
+
24
+ /**
25
+ * Constructor for a new Resize plugin.
26
+ *
27
+ * @class
28
+ * @extends sap.ui.rta.plugin.Plugin
29
+ * @author SAP SE
30
+ * @version 1.101.0
31
+ * @constructor
32
+ * @private
33
+ * @since 1.101
34
+ * @alias sap.ui.rta.plugin.Resize
35
+ * @experimental Since 1.101. This class is experimental and provides only limited functionality. Also the API might be changed in future.
36
+ */
37
+ var Resize = Plugin.extend("sap.ui.rta.plugin.Resize", /** @lends sap.ui.rta.plugin.Resize.prototype */ {
38
+ metadata: {
39
+ library: "sap.ui.rta",
40
+ properties: {
41
+ // Handle used for resizing (dragging or keyboard)
42
+ handle: "object",
43
+ // Defines if resize dragging is currently happening
44
+ dragging: "boolean"
45
+ },
46
+ associations: {},
47
+ events: {}
48
+ }
49
+ });
50
+
51
+ var HANDLE_CLASS_NAME = "sapUiRtaResizeHandle";
52
+ var HANDLE_EXTENSION_CLASS_NAME = "sapUiRtaResizeHandleExtension";
53
+ var FULL_SCREEN_DIV_CLASS_NAME = "sapUiRtaFullScreenDiv";
54
+ var MINIMUM_WIDTH = 15; // px
55
+
56
+ var bRTL = Core.getConfiguration().getRTL();
57
+ var iDirectionFactor = bRTL ? -1 : 1;
58
+ var sBeginDirection = bRTL ? "right" : "left";
59
+ var iKeyboardStep = 15 * iDirectionFactor; // px
60
+
61
+ function getWidth(oOverlay) {
62
+ return oOverlay.getDomRef().offsetWidth;
63
+ }
64
+
65
+ function createFullScreenDiv() {
66
+ this._oFullScreenDiv = document.createElement("div");
67
+ this._oFullScreenDiv.className = FULL_SCREEN_DIV_CLASS_NAME;
68
+ this._oFullScreenDiv.style["z-index"] = ZIndexManager.getNextZIndex();
69
+ var oOverlayContainer = Overlay.getOverlayContainer()[0];
70
+ oOverlayContainer.append(this._oFullScreenDiv);
71
+ }
72
+
73
+ function removeFullScreenDiv() {
74
+ this._oFullScreenDiv.removeEventListener("mouseup", this._fnOnMouseUp);
75
+ this._oFullScreenDiv.removeEventListener("mousemove", this._fnOnMouseMove);
76
+ this._oFullScreenDiv.remove();
77
+ delete this._oFullScreenDiv;
78
+ }
79
+
80
+ /**
81
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
82
+ * @return {Promise.<boolean>} <code>true</code> if it's editable wrapped in a promise.
83
+ * @private
84
+ * @override
85
+ */
86
+ Resize.prototype._isEditable = function(oOverlay) {
87
+ var oAction = this.getAction(oOverlay);
88
+ if (oAction && oAction.handler) {
89
+ return Promise.resolve(this.hasStableId(oOverlay));
90
+ }
91
+ return this._checkChangeHandlerAndStableId(oOverlay);
92
+ };
93
+
94
+ Resize.prototype._createResizeCommand = function(oOverlay, mChange, oCompositeCommand) {
95
+ var sVariantManagementReference = this.getVariantManagementReference(oOverlay);
96
+
97
+ return this.getCommandFactory().getCommandFor(
98
+ mChange.selectorElement,
99
+ "resize",
100
+ mChange.changeSpecificData,
101
+ undefined,
102
+ sVariantManagementReference
103
+ )
104
+ .then(function(oResizeCommand) {
105
+ return oCompositeCommand.addCommand(oResizeCommand);
106
+ });
107
+ };
108
+
109
+ Resize.prototype._createCompositeCommand = function(oOverlay, oElement, aChanges) {
110
+ var oCompositeCommand;
111
+
112
+ return this.getCommandFactory().getCommandFor(oElement, "composite")
113
+ .then(function(_oCompositeCommand) {
114
+ oCompositeCommand = _oCompositeCommand;
115
+ return aChanges.reduce(function(oPreviousPromise, mChange) {
116
+ return oPreviousPromise.then(this._createResizeCommand.bind(this, oOverlay, mChange, oCompositeCommand));
117
+ }.bind(this), Promise.resolve());
118
+ }.bind(this))
119
+ .then(function() {
120
+ return oCompositeCommand;
121
+ });
122
+ };
123
+
124
+ Resize.prototype._createCommand = function(oOverlay, iNewWidth) {
125
+ var oElement = oOverlay.getElement();
126
+ var oAction = this.getAction(oOverlay);
127
+ var fnHandler = oAction.handler;
128
+
129
+ return Promise.resolve()
130
+ .then(function() {
131
+ if (fnHandler) {
132
+ var mPropertyBag = {
133
+ newWidth: iNewWidth
134
+ };
135
+ return fnHandler(oElement, mPropertyBag)
136
+ .then(function(aChanges) {
137
+ if (aChanges.length > 0) {
138
+ return this._createCompositeCommand(oOverlay, oElement, aChanges);
139
+ }
140
+ return undefined;
141
+ }.bind(this))
142
+ .catch(function(vError) {
143
+ throw DtUtil.propagateError(
144
+ vError,
145
+ "Resize#handler",
146
+ "Error occured during handler execution",
147
+ "sap.ui.rta.plugin"
148
+ );
149
+ });
150
+ }
151
+ // Case without handler - single command (= one change)
152
+ return this._createCompositeCommand(oOverlay, oElement, [{
153
+ changeSpecificData: {
154
+ changeType: oAction.changeType,
155
+ content: {
156
+ resizedElementId: oElement.getId(),
157
+ newWidth: iNewWidth
158
+ }
159
+ },
160
+ selectorElement: oElement
161
+ }]);
162
+ }.bind(this))
163
+ .then(function(oCompositeCommand) {
164
+ if (oCompositeCommand && oCompositeCommand.getCommands().length > 0) {
165
+ this.fireElementModified({
166
+ command: oCompositeCommand
167
+ });
168
+ }
169
+ }.bind(this));
170
+ };
171
+
172
+ Resize.prototype._onHandleMouseDown = function(oOverlay, oEvent) {
173
+ this.setBusy(true);
174
+ if (oEvent.detail === 2) {
175
+ this._onDoubleClick(oOverlay);
176
+ this.setBusy(false);
177
+ return;
178
+ }
179
+ createFullScreenDiv.call(this);
180
+ var oAction = this.getAction(oOverlay);
181
+ var oHandle = this.getHandle();
182
+ var oElement = oOverlay.getElement();
183
+ var oOverlayDomElement = oOverlay.getDomRef();
184
+ var iOverlayBoundary = Math.round(oOverlayDomElement.getBoundingClientRect()[sBeginDirection]);
185
+ var iHalfOffsetWidth = Math.round(oHandle.offsetWidth / 2);
186
+ var iMousePosition = oEvent.clientX;
187
+ var oExtension;
188
+
189
+ // Initially set the current size of the element
190
+ var iNewWidth = getWidth(oOverlay);
191
+ // Place the middle of the handle on the mouse position
192
+ oHandle.style[sBeginDirection] = (iMousePosition - iOverlayBoundary) * iDirectionFactor - iHalfOffsetWidth + "px";
193
+
194
+ this.setDragging(true);
195
+ oOverlay.focus();
196
+
197
+ this._fnOnMouseMove = onMouseMove.bind(this);
198
+ this._fnOnMouseUp = onMouseUp.bind(this);
199
+
200
+ // Create handle extension (e.g. vertical line on the handle end going through all the lines of a table)
201
+ if (oAction.getHandleExtensionHeight) {
202
+ var iHandleExtensionHeight = oAction.getHandleExtensionHeight(oElement);
203
+ oExtension = document.createElement("div");
204
+ oExtension.className = HANDLE_EXTENSION_CLASS_NAME;
205
+ oExtension.style["height"] = iHandleExtensionHeight + "px";
206
+ oExtension.style["pointer-events"] = "none";
207
+ }
208
+
209
+ // The handle position is relative to the parent Overlay
210
+ function onMouseMove(oEvent) {
211
+ if (oExtension) {
212
+ oHandle.append(oExtension);
213
+ oHandle.extension = oExtension;
214
+ }
215
+
216
+ iNewWidth = (oEvent.clientX - iOverlayBoundary) * iDirectionFactor + iHalfOffsetWidth;
217
+
218
+ iNewWidth = this._limitNewWidth(oOverlay, iNewWidth);
219
+
220
+ // The middle of the handle is on the mouse cursor
221
+ oHandle.style[sBeginDirection] = iNewWidth - oHandle.offsetWidth + "px";
222
+ }
223
+
224
+ function onMouseUp() {
225
+ this._finalizeResize(oOverlay, iNewWidth);
226
+
227
+ removeFullScreenDiv.call(this);
228
+ this.setDragging(false);
229
+ this.setBusy(false);
230
+ }
231
+
232
+ this._oFullScreenDiv.addEventListener("mousemove", this._fnOnMouseMove);
233
+ this._oFullScreenDiv.addEventListener("mouseup", this._fnOnMouseUp);
234
+ };
235
+
236
+ Resize.prototype._onDoubleClick = function(oOverlay) {
237
+ var vAction = this.getAction(oOverlay);
238
+ if (vAction.getDoubleClickWidth) {
239
+ var iNewWidth = vAction.getDoubleClickWidth(oOverlay.getElement());
240
+ this._finalizeResize(oOverlay, iNewWidth);
241
+ }
242
+ };
243
+
244
+ Resize.prototype._finalizeResize = function(oOverlay, iNewWidth) {
245
+ var iOldWidth = getWidth(oOverlay);
246
+
247
+ if (iNewWidth === iOldWidth) {
248
+ return Promise.resolve();
249
+ }
250
+
251
+ var fnRestoreEventHandler = function() {
252
+ oOverlay.setSelected(true);
253
+ oOverlay.focus();
254
+ oOverlay.detachEvent("geometryChanged", fnRestoreEventHandler, this);
255
+ oOverlay.attachEvent("geometryChanged", this._onOverlayGeometryChanged, this);
256
+ };
257
+
258
+ oOverlay.detachEvent("geometryChanged", this._onOverlayGeometryChanged, this);
259
+ oOverlay.attachEvent("geometryChanged", fnRestoreEventHandler, this);
260
+ oOverlay.setSelected(false);
261
+
262
+ return this._createCommand(oOverlay, iNewWidth)
263
+ .catch(function(vError) {
264
+ fnRestoreEventHandler.call(this);
265
+ throw DtUtil.propagateError(
266
+ vError,
267
+ "Resize",
268
+ "Error occured during resize command creation",
269
+ "sap.ui.rta.plugin"
270
+ );
271
+ }.bind(this));
272
+ };
273
+
274
+ Resize.prototype._limitNewWidth = function(oOverlay, iNewWidth) {
275
+ var vAction = this.getAction(oOverlay);
276
+ var oElement = oOverlay.getElement();
277
+ var mSizeLimits = vAction.getSizeLimits && vAction.getSizeLimits(oElement);
278
+ // Prevent resize to negative widths (minimum = 15px)
279
+ var iMinimumWidth = mSizeLimits && mSizeLimits.minimumWidth || MINIMUM_WIDTH;
280
+ var iMaximumWidth = mSizeLimits && mSizeLimits.maximumWidth;
281
+
282
+ if (iMinimumWidth && (iNewWidth < iMinimumWidth)) {
283
+ iNewWidth = iMinimumWidth;
284
+ }
285
+ if (iMaximumWidth && (iNewWidth > iMaximumWidth)) {
286
+ iNewWidth = iMaximumWidth;
287
+ }
288
+
289
+ return iNewWidth;
290
+ };
291
+
292
+ Resize.prototype._createHandle = function(oEvent) {
293
+ var oCurrentHandle = this.getHandle();
294
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.target.id);
295
+
296
+ // Mouse is over Overlay without action (e.g. child overlay)
297
+ if (!this.isEnabled([oOverlay])) {
298
+ this._removeHandle(false);
299
+ return;
300
+ }
301
+
302
+ // Create the handle and attach it to active overlay
303
+ if (!oCurrentHandle && !this.getDragging()) {
304
+ var oOverlayDomElement = oOverlay.getDomRef();
305
+ var oNewHandle = document.createElement("div");
306
+ oNewHandle.className = HANDLE_CLASS_NAME;
307
+ oOverlayDomElement.append(oNewHandle);
308
+ oNewHandle.style[sBeginDirection] = oOverlayDomElement.clientWidth - oNewHandle.clientWidth + "px";
309
+ oNewHandle.style["z-index"] = ZIndexManager.getNextZIndex();
310
+ oNewHandle.addEventListener("mousedown", this._onHandleMouseDown.bind(this, oOverlay));
311
+ this.setHandle(oNewHandle);
312
+ }
313
+ };
314
+
315
+ Resize.prototype._removeHandle = function(bIgnoreDrag) {
316
+ var oHandle = this.getHandle();
317
+ if (oHandle && (bIgnoreDrag || !this.getDragging())) {
318
+ oHandle.remove();
319
+ this.setDragging(false);
320
+ this.setHandle(null);
321
+ }
322
+ };
323
+
324
+ Resize.prototype._onOverlayMouseMove = function(oEvent) {
325
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.target.id);
326
+ if (oOverlay && oOverlay.isSelectable()) {
327
+ this._createHandle(oEvent);
328
+ }
329
+ };
330
+
331
+ Resize.prototype._onOverlayKeyDown = function(oEvent) {
332
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.target.id);
333
+ var iNewWidth;
334
+ // During drag the focus remains on the overlay
335
+ if (oEvent.key === "Escape") {
336
+ this._removeHandle(true);
337
+ if (this._oFullScreenDiv) {
338
+ removeFullScreenDiv.call(this);
339
+ }
340
+ oEvent.stopImmediatePropagation();
341
+ return;
342
+ }
343
+ // Shift + right/left to resize
344
+ if (!oEvent.shiftKey || oEvent.ctrlKey || oEvent.metaKey || oEvent.altKey) {
345
+ return;
346
+ }
347
+ var iCurrentWidth = getWidth(oOverlay);
348
+ if (oEvent.key === "ArrowLeft" || oEvent.key === "ArrowRight") {
349
+ var iDeltaWidth = oEvent.key === "ArrowLeft" ? iKeyboardStep * (-1) : iKeyboardStep;
350
+ iNewWidth = this._limitNewWidth(oOverlay, iCurrentWidth + iDeltaWidth);
351
+ this._finalizeResize(oOverlay, iNewWidth);
352
+ }
353
+ };
354
+
355
+ Resize.prototype._onOverlayMouseLeave = function() {
356
+ this._removeHandle(false);
357
+ };
358
+
359
+ // Handle selection change via keyboard - show handle without mouseover
360
+ Resize.prototype._onOverlaySelectionChange = function(oEvent) {
361
+ if (oEvent.getParameter("selected")) {
362
+ this._removeHandle(false);
363
+ // Add target.id to DT event so it can be handled like a browser event
364
+ oEvent.target = {
365
+ id: oEvent.getParameter("id")
366
+ };
367
+ this._createHandle(oEvent);
368
+ } else {
369
+ this._removeHandle();
370
+ }
371
+ };
372
+
373
+ Resize.prototype._onOverlayFocus = function(oEvent) {
374
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.target.id);
375
+ if (oOverlay.getSelected() && !this.getHandle()) {
376
+ this._createHandle(oEvent);
377
+ }
378
+ };
379
+
380
+ Resize.prototype._onOverlayGeometryChanged = function(oEvent) {
381
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.getParameter("id"));
382
+ if (oOverlay.getSelected() && oOverlay.hasFocus()) {
383
+ this._removeHandle();
384
+ this._createHandle(oEvent);
385
+ }
386
+ };
387
+
388
+ /**
389
+ * Registers the event handlers for resizing on the enabled overlays
390
+ *
391
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be registered
392
+ *
393
+ * @override
394
+ */
395
+ Resize.prototype.registerElementOverlay = function(oOverlay) {
396
+ if (this.isEnabled([oOverlay])) {
397
+ oOverlay.attachBrowserEvent("mousemove", this._onOverlayMouseMove, this);
398
+ oOverlay.attachBrowserEvent("mouseleave", this._onOverlayMouseLeave, this);
399
+ oOverlay.attachBrowserEvent("keydown", this._onOverlayKeyDown, this);
400
+ oOverlay.attachBrowserEvent("focus", this._onOverlayFocus, this);
401
+ oOverlay.attachEvent("selectionChange", this._onOverlaySelectionChange, this);
402
+ oOverlay.attachEvent("geometryChanged", this._onOverlayGeometryChanged, this);
403
+ }
404
+ Plugin.prototype.registerElementOverlay.apply(this, arguments);
405
+ };
406
+
407
+ /**
408
+ * De-registers the event handlers for resizing on the previously enabled overlays
409
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be de-registered
410
+ *
411
+ * @override
412
+ */
413
+ Resize.prototype.deregisterElementOverlay = function(oOverlay) {
414
+ oOverlay.detachBrowserEvent("mousemove", this._onOverlayMouseMove, this);
415
+ oOverlay.detachBrowserEvent("mouseleave", this._onOverlayMouseLeave, this);
416
+ oOverlay.detachBrowserEvent("keydown", this._onOverlayKeyDown, this);
417
+ oOverlay.detachBrowserEvent("focus", this._onOverlayFocus, this);
418
+ oOverlay.detachEvent("selectionChange", this._onOverlaySelectionChange, this);
419
+ oOverlay.detachEvent("geometryChanged", this._onOverlayGeometryChanged, this);
420
+ Plugin.prototype.deregisterElementOverlay.apply(this, arguments);
421
+ };
422
+
423
+ /**
424
+ * Gets the name of the action related to this plugin.
425
+ * @return {string} Action name
426
+ */
427
+ Resize.prototype.getActionName = function() {
428
+ return "resize";
429
+ };
430
+
431
+ return Resize;
432
+ });
@@ -30,7 +30,7 @@ function (
30
30
  * @class The Selection plugin allows you to select or focus overlays with mouse or keyboard and navigate to others.
31
31
  * @extends sap.ui.rta.plugin.Plugin
32
32
  * @author SAP SE
33
- * @version 1.98.0
33
+ * @version 1.101.0
34
34
  * @constructor
35
35
  * @private
36
36
  * @since 1.34
@@ -252,11 +252,14 @@ function (
252
252
  };
253
253
 
254
254
  Selection.prototype._selectOverlay = function (oEvent) {
255
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
255
256
  if (!this.getIsActive()) {
256
- preventEventDefaultAndPropagation(oEvent);
257
+ // Propagation should be stopped at the root overlay to prevent the selection of the underlying elements
258
+ if (oOverlay.isRoot()) {
259
+ preventEventDefaultAndPropagation(oEvent);
260
+ }
257
261
  return;
258
262
  }
259
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
260
263
  var bMultiSelection = oEvent.metaKey || oEvent.ctrlKey;
261
264
  var bContextMenu = oEvent.type === "contextmenu";
262
265
 
@@ -289,7 +292,11 @@ function (
289
292
  // In Visualization Mode we must prevent MouseDown-Event for Overlays
290
293
  // We have to close open PopOvers from the ChangeVisualization because they
291
294
  // should close on MouseDown
292
- preventEventDefaultAndPropagation(oEvent);
295
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
296
+ // Propagation should be stopped at the root overlay to prevent the selection of the underlying elements
297
+ if (oOverlay.isRoot()) {
298
+ preventEventDefaultAndPropagation(oEvent);
299
+ }
293
300
  InstanceManager.getOpenPopovers().forEach(function(oPopOver) {
294
301
  if (oPopOver._bOpenedByChangeIndicator) {
295
302
  oPopOver.close();
@@ -305,11 +312,14 @@ function (
305
312
  * @private
306
313
  */
307
314
  Selection.prototype._onMouseover = function(oEvent) {
315
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
308
316
  if (!this.getIsActive()) {
309
- preventEventDefaultAndPropagation(oEvent);
317
+ // Propagation should be stopped at the root overlay to prevent the selection of the underlying elements
318
+ if (oOverlay.isRoot()) {
319
+ preventEventDefaultAndPropagation(oEvent);
320
+ }
310
321
  return;
311
322
  }
312
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
313
323
  if (oOverlay.isSelectable()) {
314
324
  if (oOverlay !== this._oHoverTarget) {
315
325
  this._removePreviousHover();
@@ -326,11 +336,14 @@ function (
326
336
  * @private
327
337
  */
328
338
  Selection.prototype._onMouseleave = function(oEvent) {
339
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
329
340
  if (!this.getIsActive()) {
330
- preventEventDefaultAndPropagation(oEvent);
341
+ // Propagation should be stopped at the root overlay to prevent the selection of the underlying elements
342
+ if (oOverlay.isRoot()) {
343
+ preventEventDefaultAndPropagation(oEvent);
344
+ }
331
345
  return;
332
346
  }
333
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
334
347
  if (oOverlay.isSelectable()) {
335
348
  this._removePreviousHover();
336
349
  preventEventDefaultAndPropagation(oEvent);
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @class The Settings allows trigger change of settings operations on the overlay
26
26
  * @extends sap.ui.rta.plugin.Plugin
27
27
  * @author SAP SE
28
- * @version 1.98.0
28
+ * @version 1.101.0
29
29
  * @constructor
30
30
  * @private
31
31
  * @since 1.44
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @class
24
24
  * @extends sap.ui.rta.plugin.Plugin
25
25
  * @author SAP SE
26
- * @version 1.98.0
26
+ * @version 1.101.0
27
27
  * @constructor
28
28
  * @private
29
29
  * @since 1.46
@@ -41,21 +41,15 @@ sap.ui.define([
41
41
 
42
42
  /**
43
43
  * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
44
- * @return {Promise.<boolean>|boolean} <code>true</code> if it's editable wrapped in a promise.
44
+ * @return {Promise.<boolean>} <code>true</code> if it's editable wrapped in a promise.
45
45
  * @private
46
46
  */
47
47
  Split.prototype._isEditable = function (oOverlay) {
48
48
  var oSplitAction = this.getAction(oOverlay);
49
- if (oSplitAction && oSplitAction.changeType && oSplitAction.changeOnRelevantContainer) {
50
- var oRelevantContainer = oOverlay.getRelevantContainer();
51
- return this.hasChangeHandler(oSplitAction.changeType, oRelevantContainer)
52
- .then(function(bHasChangeHandler) {
53
- return bHasChangeHandler
54
- && this.hasStableId(oOverlay)
55
- && this._checkRelevantContainerStableID(oSplitAction, oOverlay);
56
- }.bind(this));
49
+ if (oSplitAction && oSplitAction.changeOnRelevantContainer) {
50
+ return this._checkChangeHandlerAndStableId(oOverlay);
57
51
  }
58
- return false;
52
+ return Promise.resolve(false);
59
53
  };
60
54
 
61
55
  /**
@@ -31,7 +31,7 @@ sap.ui.define([
31
31
  * @extends sap.ui.rta.plugin.Plugin
32
32
  *
33
33
  * @author SAP SE
34
- * @version 1.98.0
34
+ * @version 1.101.0
35
35
  *
36
36
  * @constructor
37
37
  * @private