@openui5/sap.ui.rta 1.97.1 → 1.100.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 (211) hide show
  1. package/.reuse/dep5 +25 -30
  2. package/THIRDPARTY.txt +15 -22
  3. package/package.json +6 -6
  4. package/src/sap/ui/rta/.library +1 -1
  5. package/src/sap/ui/rta/Client.js +1 -1
  6. package/src/sap/ui/rta/RuntimeAuthoring.js +224 -168
  7. package/src/sap/ui/rta/Utils.js +4 -6
  8. package/src/sap/ui/rta/appContexts/AppContextsOverviewDialog.js +76 -0
  9. package/src/sap/ui/rta/appContexts/Component.js +31 -0
  10. package/src/sap/ui/rta/appContexts/controller/ManageContexts.controller.js +323 -0
  11. package/src/sap/ui/rta/appContexts/controller/RestAPIConnector.js +22 -0
  12. package/src/sap/ui/rta/appContexts/i18n/i18n.properties +47 -0
  13. package/src/sap/ui/rta/appContexts/i18n/i18n_ar.properties +23 -0
  14. package/src/sap/ui/rta/appContexts/i18n/i18n_bg.properties +23 -0
  15. package/src/sap/ui/rta/appContexts/i18n/i18n_ca.properties +23 -0
  16. package/src/sap/ui/rta/appContexts/i18n/i18n_cs.properties +23 -0
  17. package/src/sap/ui/rta/appContexts/i18n/i18n_cy.properties +23 -0
  18. package/src/sap/ui/rta/appContexts/i18n/i18n_da.properties +23 -0
  19. package/src/sap/ui/rta/appContexts/i18n/i18n_de.properties +23 -0
  20. package/src/sap/ui/rta/appContexts/i18n/i18n_el.properties +23 -0
  21. package/src/sap/ui/rta/appContexts/i18n/i18n_en.properties +23 -0
  22. package/src/sap/ui/rta/appContexts/i18n/i18n_en_GB.properties +23 -0
  23. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_sappsd.properties +23 -0
  24. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saprigi.properties +23 -0
  25. package/src/sap/ui/rta/appContexts/i18n/i18n_en_US_saptrc.properties +23 -0
  26. package/src/sap/ui/rta/appContexts/i18n/i18n_es.properties +23 -0
  27. package/src/sap/ui/rta/appContexts/i18n/i18n_es_MX.properties +23 -0
  28. package/src/sap/ui/rta/appContexts/i18n/i18n_et.properties +23 -0
  29. package/src/sap/ui/rta/appContexts/i18n/i18n_fi.properties +23 -0
  30. package/src/sap/ui/rta/appContexts/i18n/i18n_fr.properties +23 -0
  31. package/src/sap/ui/rta/appContexts/i18n/i18n_fr_CA.properties +23 -0
  32. package/src/sap/ui/rta/appContexts/i18n/i18n_hi.properties +23 -0
  33. package/src/sap/ui/rta/appContexts/i18n/i18n_hr.properties +23 -0
  34. package/src/sap/ui/rta/appContexts/i18n/i18n_hu.properties +23 -0
  35. package/src/sap/ui/rta/appContexts/i18n/i18n_id.properties +23 -0
  36. package/src/sap/ui/rta/appContexts/i18n/i18n_it.properties +23 -0
  37. package/src/sap/ui/rta/appContexts/i18n/i18n_iw.properties +23 -0
  38. package/src/sap/ui/rta/appContexts/i18n/i18n_ja.properties +23 -0
  39. package/src/sap/ui/rta/appContexts/i18n/i18n_kk.properties +23 -0
  40. package/src/sap/ui/rta/appContexts/i18n/i18n_ko.properties +23 -0
  41. package/src/sap/ui/rta/appContexts/i18n/i18n_lt.properties +23 -0
  42. package/src/sap/ui/rta/appContexts/i18n/i18n_lv.properties +23 -0
  43. package/src/sap/ui/rta/appContexts/i18n/i18n_ms.properties +23 -0
  44. package/src/sap/ui/rta/appContexts/i18n/i18n_nl.properties +23 -0
  45. package/src/sap/ui/rta/appContexts/i18n/i18n_no.properties +23 -0
  46. package/src/sap/ui/rta/appContexts/i18n/i18n_pl.properties +23 -0
  47. package/src/sap/ui/rta/appContexts/i18n/i18n_pt.properties +23 -0
  48. package/src/sap/ui/rta/appContexts/i18n/i18n_pt_PT.properties +23 -0
  49. package/src/sap/ui/rta/appContexts/i18n/i18n_ro.properties +23 -0
  50. package/src/sap/ui/rta/appContexts/i18n/i18n_ru.properties +23 -0
  51. package/src/sap/ui/rta/appContexts/i18n/i18n_sh.properties +23 -0
  52. package/src/sap/ui/rta/appContexts/i18n/i18n_sk.properties +23 -0
  53. package/src/sap/ui/rta/appContexts/i18n/i18n_sl.properties +23 -0
  54. package/src/sap/ui/rta/appContexts/i18n/i18n_sv.properties +23 -0
  55. package/src/sap/ui/rta/appContexts/i18n/i18n_th.properties +23 -0
  56. package/src/sap/ui/rta/appContexts/i18n/i18n_tr.properties +23 -0
  57. package/src/sap/ui/rta/appContexts/i18n/i18n_uk.properties +23 -0
  58. package/src/sap/ui/rta/appContexts/i18n/i18n_vi.properties +23 -0
  59. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_CN.properties +23 -0
  60. package/src/sap/ui/rta/appContexts/i18n/i18n_zh_TW.properties +23 -0
  61. package/src/sap/ui/rta/appContexts/index.html +25 -0
  62. package/src/sap/ui/rta/appContexts/manifest.json +52 -0
  63. package/src/sap/ui/rta/appContexts/view/EditContextsDialog.fragment.xml +76 -0
  64. package/src/sap/ui/rta/appContexts/view/ManageContexts.view.xml +103 -0
  65. package/src/sap/ui/rta/appContexts/view/SaveAsContextsDialog.fragment.xml +76 -0
  66. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +6 -3
  67. package/src/sap/ui/rta/appVariant/AppVariantManager.js +11 -11
  68. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -4
  69. package/src/sap/ui/rta/appVariant/Feature.js +22 -11
  70. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  71. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  72. package/src/sap/ui/rta/command/AddXML.js +3 -2
  73. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -2
  74. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  75. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  76. package/src/sap/ui/rta/command/BindProperty.js +3 -2
  77. package/src/sap/ui/rta/command/Combine.js +5 -1
  78. package/src/sap/ui/rta/command/CommandFactory.js +17 -13
  79. package/src/sap/ui/rta/command/CompositeCommand.js +5 -5
  80. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  81. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  82. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  83. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  84. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  85. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  86. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  87. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  88. package/src/sap/ui/rta/command/LREPSerializer.js +11 -3
  89. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  90. package/src/sap/ui/rta/command/Move.js +1 -1
  91. package/src/sap/ui/rta/command/Property.js +1 -1
  92. package/src/sap/ui/rta/command/Remove.js +1 -1
  93. package/src/sap/ui/rta/command/Rename.js +1 -1
  94. package/src/sap/ui/rta/command/Reveal.js +1 -1
  95. package/src/sap/ui/rta/command/Settings.js +1 -1
  96. package/src/sap/ui/rta/command/Split.js +1 -1
  97. package/src/sap/ui/rta/command/Stack.js +22 -27
  98. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  99. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  100. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  101. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  102. package/src/sap/ui/rta/enablement/elementActionTest.js +2 -2
  103. package/src/sap/ui/rta/library.js +2 -2
  104. package/src/sap/ui/rta/messagebundle.properties +37 -17
  105. package/src/sap/ui/rta/messagebundle_ar.properties +20 -9
  106. package/src/sap/ui/rta/messagebundle_bg.properties +22 -11
  107. package/src/sap/ui/rta/messagebundle_ca.properties +20 -9
  108. package/src/sap/ui/rta/messagebundle_cs.properties +20 -9
  109. package/src/sap/ui/rta/messagebundle_cy.properties +20 -9
  110. package/src/sap/ui/rta/messagebundle_da.properties +20 -9
  111. package/src/sap/ui/rta/messagebundle_de.properties +20 -9
  112. package/src/sap/ui/rta/messagebundle_el.properties +20 -9
  113. package/src/sap/ui/rta/messagebundle_en.properties +20 -9
  114. package/src/sap/ui/rta/messagebundle_en_GB.properties +20 -9
  115. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +20 -9
  116. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +39 -20
  117. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +22 -11
  118. package/src/sap/ui/rta/messagebundle_es.properties +20 -9
  119. package/src/sap/ui/rta/messagebundle_es_MX.properties +24 -13
  120. package/src/sap/ui/rta/messagebundle_et.properties +21 -10
  121. package/src/sap/ui/rta/messagebundle_fi.properties +20 -9
  122. package/src/sap/ui/rta/messagebundle_fr.properties +20 -9
  123. package/src/sap/ui/rta/messagebundle_fr_CA.properties +20 -9
  124. package/src/sap/ui/rta/messagebundle_hi.properties +20 -9
  125. package/src/sap/ui/rta/messagebundle_hr.properties +20 -9
  126. package/src/sap/ui/rta/messagebundle_hu.properties +20 -9
  127. package/src/sap/ui/rta/messagebundle_id.properties +23 -12
  128. package/src/sap/ui/rta/messagebundle_it.properties +21 -10
  129. package/src/sap/ui/rta/messagebundle_iw.properties +20 -9
  130. package/src/sap/ui/rta/messagebundle_ja.properties +20 -9
  131. package/src/sap/ui/rta/messagebundle_kk.properties +20 -9
  132. package/src/sap/ui/rta/messagebundle_ko.properties +21 -10
  133. package/src/sap/ui/rta/messagebundle_lt.properties +20 -9
  134. package/src/sap/ui/rta/messagebundle_lv.properties +22 -11
  135. package/src/sap/ui/rta/messagebundle_ms.properties +20 -9
  136. package/src/sap/ui/rta/messagebundle_nl.properties +20 -9
  137. package/src/sap/ui/rta/messagebundle_no.properties +20 -9
  138. package/src/sap/ui/rta/messagebundle_pl.properties +20 -9
  139. package/src/sap/ui/rta/messagebundle_pt.properties +20 -9
  140. package/src/sap/ui/rta/messagebundle_pt_PT.properties +20 -9
  141. package/src/sap/ui/rta/messagebundle_ro.properties +20 -9
  142. package/src/sap/ui/rta/messagebundle_ru.properties +20 -9
  143. package/src/sap/ui/rta/messagebundle_sh.properties +20 -9
  144. package/src/sap/ui/rta/messagebundle_sk.properties +20 -9
  145. package/src/sap/ui/rta/messagebundle_sl.properties +20 -9
  146. package/src/sap/ui/rta/messagebundle_sv.properties +20 -9
  147. package/src/sap/ui/rta/messagebundle_th.properties +20 -9
  148. package/src/sap/ui/rta/messagebundle_tr.properties +20 -9
  149. package/src/sap/ui/rta/messagebundle_uk.properties +21 -10
  150. package/src/sap/ui/rta/messagebundle_vi.properties +20 -9
  151. package/src/sap/ui/rta/messagebundle_zh_CN.properties +20 -9
  152. package/src/sap/ui/rta/messagebundle_zh_TW.properties +20 -9
  153. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  154. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  155. package/src/sap/ui/rta/plugin/Combine.js +11 -4
  156. package/src/sap/ui/rta/plugin/ControlVariant.js +5 -6
  157. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  158. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  159. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  160. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  161. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  162. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  163. package/src/sap/ui/rta/plugin/Plugin.js +1 -1
  164. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  165. package/src/sap/ui/rta/plugin/Remove.js +22 -9
  166. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  167. package/src/sap/ui/rta/plugin/RenameHandler.js +1 -1
  168. package/src/sap/ui/rta/plugin/Selection.js +35 -33
  169. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  170. package/src/sap/ui/rta/plugin/Split.js +1 -1
  171. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  172. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +53 -121
  173. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  174. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +0 -67
  175. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -10
  176. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +3 -4
  177. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +17 -47
  178. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  179. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  180. package/src/sap/ui/rta/service/Action.js +1 -1
  181. package/src/sap/ui/rta/service/ControllerExtension.js +5 -6
  182. package/src/sap/ui/rta/service/Outline.js +6 -3
  183. package/src/sap/ui/rta/service/Property.js +1 -1
  184. package/src/sap/ui/rta/service/Selection.js +1 -1
  185. package/src/sap/ui/rta/themes/base/ChangeVisualization.less +44 -61
  186. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +1 -0
  187. package/src/sap/ui/rta/toolbar/Adaptation.js +12 -12
  188. package/src/sap/ui/rta/toolbar/Base.js +3 -3
  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 +2 -2
  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/DownloadTranslationDialog.fragment.xml +19 -10
  195. package/src/sap/ui/rta/toolbar/translation/Translation.js +146 -56
  196. package/src/sap/ui/rta/toolbar/translation/TranslationPopover.fragment.xml +8 -13
  197. package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +41 -0
  198. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  199. package/src/sap/ui/rta/util/PopupManager.js +37 -13
  200. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  201. package/src/sap/ui/rta/util/adaptationStarter.js +40 -2
  202. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +112 -60
  203. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +6 -5
  204. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
  205. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +87 -103
  206. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualizationUtils.js +37 -0
  207. package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +5 -2
  208. package/src/sap/ui/rta/util/changeVisualization/categories/RenameVisualization.js +14 -2
  209. package/src/sap/ui/rta/util/changeVisualization/categories/SplitVisualization.js +5 -2
  210. package/src/sap/ui/rta/util/showMessageBox.js +4 -3
  211. package/src/sap/ui/rta/util/validateFlexEnabled.js +2 -1
@@ -33,7 +33,7 @@ function(
33
33
  * @extends sap.ui.dt.plugin.ControlDragDrop
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.97.1
36
+ * @version 1.100.0
37
37
  *
38
38
  * @constructor
39
39
  * @private
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @class The EasyAdd Plugin adds an Icon to an Overlay, which allows to trigger add operations directly
26
26
  * @extends sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin
27
27
  * @author SAP SE
28
- * @version 1.97.1
28
+ * @version 1.100.0
29
29
  * @constructor
30
30
  * @private
31
31
  * @since 1.48
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @class The EasyRemove Plugin adds an Icon to an Overlay, which allows to trigger remove operations directly
24
24
  * @extends sap.ui.rta.plugin.Remove
25
25
  * @author SAP SE
26
- * @version 1.97.1
26
+ * @version 1.100.0
27
27
  * @constructor
28
28
  * @private
29
29
  * @since 1.48
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  * @class
36
36
  * @extends sap.ui.rta.plugin.Plugin
37
37
  * @author SAP SE
38
- * @version 1.97.1
38
+ * @version 1.100.0
39
39
  * @constructor
40
40
  * @private
41
41
  * @since 1.90
@@ -69,7 +69,7 @@ function(
69
69
  * @extends sap.ui.dt.Plugin
70
70
  *
71
71
  * @author SAP SE
72
- * @version 1.97.1
72
+ * @version 1.100.0
73
73
  *
74
74
  * @constructor
75
75
  * @private
@@ -35,7 +35,7 @@ function(
35
35
  * The RTAElementMover is responsible for the RTA specific adaptation of element movements.
36
36
  *
37
37
  * @author SAP SE
38
- * @version 1.97.1
38
+ * @version 1.100.0
39
39
  *
40
40
  * @constructor
41
41
  * @private
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @class The Remove allows trigger remove operations on the overlay
30
30
  * @extends sap.ui.rta.plugin.Plugin
31
31
  * @author SAP SE
32
- * @version 1.97.1
32
+ * @version 1.100.0
33
33
  * @constructor
34
34
  * @private
35
35
  * @since 1.34
@@ -114,12 +114,25 @@ sap.ui.define([
114
114
  /**
115
115
  * Checks if Overlay control has a valid parent and if it is
116
116
  * not the last visible control in the aggregation
117
+ * The removal of the last element in the aggregation can
118
+ * be defined by the parameter 'removeLastElement' in the
119
+ * designtime of the aggregation
117
120
  *
118
121
  * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - overlays to be removed
119
122
  * @return {boolean} Returns true if the control can be removed
120
123
  * @private
121
124
  */
122
125
  Remove.prototype._canBeRemovedFromAggregation = function(aElementOverlays) {
126
+ //Check if designtime allows removing last visible element
127
+ var fnCheckDesignTimeSettings = function (oOverlay) {
128
+ var oParentOverlay = oOverlay.getParentAggregationOverlay();
129
+ if (oParentOverlay) {
130
+ var oAction = this.getAction(oParentOverlay);
131
+ return !!(oAction && oAction.removeLastElement);
132
+ }
133
+ return false;
134
+ }.bind(this);
135
+
123
136
  var oOverlay = aElementOverlays[0];
124
137
  var oElement = oOverlay.getElement();
125
138
  var oParent = oElement.getParent();
@@ -130,22 +143,22 @@ sap.ui.define([
130
143
  if (!Array.isArray(aElements)) {
131
144
  return true;
132
145
  }
133
- if (aElements.length === 1) {
134
- return false;
135
- }
136
-
137
- // Fallback to 1 if no overlay is selected
146
+ // check if selected Overlays are the last visible elements in aggregation
138
147
  var iNumberOfSelectedOverlays = aElementOverlays.length;
139
148
  var aInvisibleElements = aElements.filter(function(oElement) {
140
149
  var oElementOverlay = OverlayRegistry.getOverlay(oElement);
141
150
  return !(oElementOverlay && oElementOverlay.getElementVisibility());
142
151
  });
143
- return !(aInvisibleElements.length === (aElements.length - iNumberOfSelectedOverlays));
152
+ var bIsLastVisibleElement = (aInvisibleElements.length + iNumberOfSelectedOverlays === aElements.length);
153
+ if (bIsLastVisibleElement) {
154
+ return fnCheckDesignTimeSettings(oOverlay);
155
+ }
156
+ return true;
144
157
  };
145
158
 
146
159
  /**
147
160
  * @param {sap.ui.dt.Overlay} oOverlay overlay object
148
- * @return {String} Returns the confirmation text
161
+ * @return {string} Returns the confirmation text
149
162
  * @private
150
163
  */
151
164
  Remove.prototype._getConfirmationText = function(oOverlay) {
@@ -323,4 +336,4 @@ sap.ui.define([
323
336
  };
324
337
 
325
338
  return Remove;
326
- });
339
+ });
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.ui.rta.plugin.Plugin
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.97.1
31
+ * @version 1.100.0
32
32
  *
33
33
  * @constructor
34
34
  * @private
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  * Provides Rename handling functionality
56
56
  *
57
57
  * @author SAP SE
58
- * @version 1.97.1
58
+ * @version 1.100.0
59
59
  *
60
60
  * @constructor
61
61
  * @private
@@ -9,20 +9,16 @@ sap.ui.define([
9
9
  "sap/ui/rta/Utils",
10
10
  "sap/ui/dt/OverlayRegistry",
11
11
  "sap/ui/events/KeyCodes",
12
- "sap/ui/dt/Overlay",
13
12
  "sap/base/util/restricted/_intersection",
14
- "sap/m/InstanceManager",
15
- "sap/ui/Device"
13
+ "sap/m/InstanceManager"
16
14
  ],
17
15
  function (
18
16
  Plugin,
19
17
  Utils,
20
18
  OverlayRegistry,
21
19
  KeyCodes,
22
- Overlay,
23
20
  _intersection,
24
- InstanceManager,
25
- Device
21
+ InstanceManager
26
22
  ) {
27
23
  "use strict";
28
24
 
@@ -34,7 +30,7 @@ function (
34
30
  * @class The Selection plugin allows you to select or focus overlays with mouse or keyboard and navigate to others.
35
31
  * @extends sap.ui.rta.plugin.Plugin
36
32
  * @author SAP SE
37
- * @version 1.97.1
33
+ * @version 1.100.0
38
34
  * @constructor
39
35
  * @private
40
36
  * @since 1.34
@@ -125,6 +121,18 @@ function (
125
121
  return false;
126
122
  };
127
123
 
124
+ /**
125
+ * Sets the value of the isActive property.
126
+ * When set to false, de-select all overlays.
127
+ * @param {boolean} bValue - Value to be set
128
+ */
129
+ Selection.prototype.setIsActive = function(bValue) {
130
+ this.setProperty("isActive", bValue);
131
+ if (bValue === false) {
132
+ this._deselectOverlays();
133
+ }
134
+ };
135
+
128
136
  /**
129
137
  * Register an overlay
130
138
  *
@@ -244,11 +252,14 @@ function (
244
252
  };
245
253
 
246
254
  Selection.prototype._selectOverlay = function (oEvent) {
255
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
247
256
  if (!this.getIsActive()) {
248
- 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
+ }
249
261
  return;
250
262
  }
251
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
252
263
  var bMultiSelection = oEvent.metaKey || oEvent.ctrlKey;
253
264
  var bContextMenu = oEvent.type === "contextmenu";
254
265
 
@@ -281,7 +292,11 @@ function (
281
292
  // In Visualization Mode we must prevent MouseDown-Event for Overlays
282
293
  // We have to close open PopOvers from the ChangeVisualization because they
283
294
  // should close on MouseDown
284
- 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
+ }
285
300
  InstanceManager.getOpenPopovers().forEach(function(oPopOver) {
286
301
  if (oPopOver._bOpenedByChangeIndicator) {
287
302
  oPopOver.close();
@@ -289,25 +304,6 @@ function (
289
304
  });
290
305
  return;
291
306
  }
292
- // set focus after clicking, needed only for internet explorer
293
- if (Device.browser.name === "ie") {
294
- // when the EasyAdd Button is clicked, we don't want to focus/stopPropagation.
295
- // but when the OverlayScrollContainer is the target, we want it to behave like a click on an overlay
296
- var oTarget = OverlayRegistry.getOverlay(oEvent.target.id);
297
- var bTargetIsScrollContainer = jQuery(oEvent.target).hasClass("sapUiDtOverlayScrollContainer");
298
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
299
- if (
300
- oOverlay
301
- && (bTargetIsScrollContainer || oTarget instanceof Overlay)
302
- ) {
303
- if (oOverlay.getSelectable()) {
304
- oOverlay.focus();
305
- oEvent.stopPropagation();
306
- } else {
307
- oOverlay.getDomRef().blur();
308
- }
309
- }
310
- }
311
307
  };
312
308
 
313
309
  /**
@@ -316,11 +312,14 @@ function (
316
312
  * @private
317
313
  */
318
314
  Selection.prototype._onMouseover = function(oEvent) {
315
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
319
316
  if (!this.getIsActive()) {
320
- 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
+ }
321
321
  return;
322
322
  }
323
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
324
323
  if (oOverlay.isSelectable()) {
325
324
  if (oOverlay !== this._oHoverTarget) {
326
325
  this._removePreviousHover();
@@ -337,11 +336,14 @@ function (
337
336
  * @private
338
337
  */
339
338
  Selection.prototype._onMouseleave = function(oEvent) {
339
+ var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
340
340
  if (!this.getIsActive()) {
341
- 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
+ }
342
345
  return;
343
346
  }
344
- var oOverlay = OverlayRegistry.getOverlay(oEvent.currentTarget.id);
345
347
  if (oOverlay.isSelectable()) {
346
348
  this._removePreviousHover();
347
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.97.1
28
+ * @version 1.100.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.97.1
26
+ * @version 1.100.0
27
27
  * @constructor
28
28
  * @private
29
29
  * @since 1.46
@@ -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.97.1
34
+ * @version 1.100.0
35
35
  *
36
36
  * @constructor
37
37
  * @private
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * handled by the AdditionalElements Plugin (Reveal, Add Via Delegate, Add Custom)
33
33
  *
34
34
  * @author SAP SE
35
- * @version 1.97.1
35
+ * @version 1.100.0
36
36
  * @private
37
37
  * @since 1.94
38
38
  * @experimental Since 1.94. This class is experimental and provides only limited functionality. Also the API might be changed in future.
@@ -82,12 +82,20 @@ sap.ui.define([
82
82
  function checkInvalidAddActions(bSibling, oSourceElementOverlay, oPlugin) {
83
83
  var mParents = AdditionalElementsUtils.getParents(bSibling, oSourceElementOverlay, oPlugin);
84
84
  var oDesignTimeMetadata = mParents.parentOverlay && mParents.parentOverlay.getDesignTimeMetadata();
85
- var aActions = oDesignTimeMetadata ? oDesignTimeMetadata.getActionDataFromAggregations("addODataProperty", mParents.parent) : [];
86
- if (aActions.length > 0) {
85
+ var aAddODataPropertyActions = oDesignTimeMetadata ? oDesignTimeMetadata.getActionDataFromAggregations("addODataProperty", mParents.parent) : [];
86
+ if (aAddODataPropertyActions.length > 0) {
87
87
  Log.error("Outdated addODataProperty action in designtime metadata in "
88
88
  + oDesignTimeMetadata.getData().designtimeModule
89
89
  + " or propagated or via instance specific designtime metadata.");
90
90
  }
91
+ var aAddActions = oDesignTimeMetadata ? oDesignTimeMetadata.getActionDataFromAggregations("add", mParents.parent) : [];
92
+ aAddActions.forEach(function(mAddAction) {
93
+ if (mAddAction["custom"]) {
94
+ Log.error("Outdated custom add action in designtime metadata in "
95
+ + oDesignTimeMetadata.getData().designtimeModule
96
+ + " or propagated or via instance specific designtime metadata.");
97
+ }
98
+ });
91
99
  }
92
100
 
93
101
  function getInvisibleElements (oParentOverlay, sAggregationName, oPlugin) {
@@ -224,26 +232,27 @@ sap.ui.define([
224
232
  }
225
233
 
226
234
  function checkAndEnrichReveal(mReveal, mInvisibleElement, oPlugin, sTargetAggregation) {
227
- return Promise.resolve().then(function() {
228
- var oInvisibleElement = mInvisibleElement.element;
229
- var oDesignTimeMetadata;
230
- var mRevealAction;
231
- var bRevealEnabled = false;
232
- var oHasChangeHandlerPromise = Promise.resolve();
233
- var sSourceAggregation = mInvisibleElement.sourceAggregation;
234
-
235
- var oOverlay = OverlayRegistry.getOverlay(oInvisibleElement);
236
- if (oOverlay) {
237
- oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
238
-
239
- mRevealAction = oDesignTimeMetadata && oDesignTimeMetadata.getAction("reveal", oInvisibleElement);
240
- if (mRevealAction && mRevealAction.changeType) {
241
- var oRevealSelector = oInvisibleElement;
242
- if (mRevealAction.changeOnRelevantContainer) {
243
- oRevealSelector = oOverlay.getRelevantContainer();
244
- }
235
+ var oInvisibleElement = mInvisibleElement.element;
236
+ var oDesignTimeMetadata;
237
+ var mRevealAction;
238
+ var bRevealEnabled = false;
239
+ var oHasChangeHandlerPromise = Promise.resolve(false);
240
+ var sSourceAggregation = mInvisibleElement.sourceAggregation;
241
+
242
+ var oOverlay = OverlayRegistry.getOverlay(oInvisibleElement);
243
+ if (oOverlay) {
244
+ oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
245
+
246
+ mRevealAction = oDesignTimeMetadata && oDesignTimeMetadata.getAction("reveal", oInvisibleElement);
247
+ if (mRevealAction && mRevealAction.changeType) {
248
+ var oRevealSelector = oInvisibleElement;
249
+ if (mRevealAction.changeOnRelevantContainer) {
250
+ oRevealSelector = oOverlay.getRelevantContainer();
251
+ }
245
252
 
246
- oHasChangeHandlerPromise = oPlugin.hasChangeHandler(mRevealAction.changeType, oRevealSelector).then(function(bHasChangeHandler) {
253
+ oHasChangeHandlerPromise = oPlugin.hasChangeHandler(mRevealAction.changeType, oRevealSelector).then(function(bHasChangeHandler) {
254
+ // Element can be made invalid while the check is running (e.g. destroyed during undo of split)
255
+ if (ElementUtil.isElementValid(oInvisibleElement)) {
247
256
  var mParents = AdditionalElementsUtils.getParents(true, oOverlay, oPlugin);
248
257
  if (bHasChangeHandler) {
249
258
  if (mRevealAction.changeOnRelevantContainer) {
@@ -263,32 +272,32 @@ sap.ui.define([
263
272
  return Utils.checkTargetZone(oAggregationOverlay, oOverlay, oPlugin);
264
273
  }
265
274
  }
266
- return bRevealEnabled;
267
- });
268
- }
275
+ }
276
+ return bRevealEnabled;
277
+ });
269
278
  }
279
+ }
270
280
 
271
- return oHasChangeHandlerPromise.then(function(bIncludeReveal) {
272
- if (bIncludeReveal) {
273
- mReveal.elements.push({
274
- element: oInvisibleElement,
275
- designTimeMetadata: oDesignTimeMetadata,
276
- action: mRevealAction,
277
- sourceAggregation: sSourceAggregation,
278
- targetAggregation: sTargetAggregation
279
- });
280
- var mName = oDesignTimeMetadata.getName(oInvisibleElement);
281
- if (mName) {
282
- mReveal.controlTypeNames.push(mName);
283
- }
281
+ return oHasChangeHandlerPromise.then(function(bIncludeReveal) {
282
+ if (bIncludeReveal) {
283
+ mReveal.elements.push({
284
+ element: oInvisibleElement,
285
+ designTimeMetadata: oDesignTimeMetadata,
286
+ action: mRevealAction,
287
+ sourceAggregation: sSourceAggregation,
288
+ targetAggregation: sTargetAggregation
289
+ });
290
+ var mName = oDesignTimeMetadata.getName(oInvisibleElement);
291
+ if (mName) {
292
+ mReveal.controlTypeNames.push(mName);
284
293
  }
285
- return mReveal;
286
- });
294
+ }
295
+ return mReveal;
287
296
  });
288
297
  }
289
298
 
290
299
  /**
291
- * Calculate a structure with all "add/reveal/custom" action relevant data collected per aggregation:
300
+ * Calculate a structure with all "add/reveal" action relevant data collected per aggregation:
292
301
  * <pre>
293
302
  * {
294
303
  * <aggregationName> : {
@@ -304,11 +313,6 @@ sap.ui.define([
304
313
  * sourceAggregation: <aggregation where this element is currently located>
305
314
  * }],
306
315
  * controlTypeNames : string[] <all controlTypeNames collected via designTimeMetadata>
307
- * },
308
- * addViaCustom : {
309
- * designTimeMetadata : <sap.ui.dt.ElementDesignTimeMetadata of parent>,
310
- * action : <add.custom action section from designTimeMetadata>
311
- * items : <add.custom action's array of items from the getItems() function>
312
316
  * }
313
317
  * },
314
318
  * <aggregationName2> : ...
@@ -320,7 +324,7 @@ sap.ui.define([
320
324
  * @param {sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin} oPlugin - Instance of the AdditionalElementsPlugin
321
325
  * @param {boolean} [bInvalidate] - Option to prevent cached actions to be returned
322
326
  *
323
- * @return {Promise} Resolving to a structure with all "add/reveal/custom" action relevant data collected
327
+ * @return {Promise} Resolving to a structure with all "add/reveal" action relevant data collected
324
328
  */
325
329
  ActionExtractor.getActions = function(bSibling, oSourceElementOverlay, oPlugin, bInvalidate) {
326
330
  var sSiblingOrChild = bSibling ? "asSibling" : "asChild";
@@ -330,16 +334,14 @@ sap.ui.define([
330
334
 
331
335
  var oRevealActionsPromise = this._getRevealActions(bSibling, oSourceElementOverlay, oPlugin);
332
336
  var oAddPropertyActionsPromise = this._getAddViaDelegateActions(bSibling, oSourceElementOverlay, oPlugin);
333
- var oCustomAddActionsPromise = this._getCustomAddActions(bSibling, oSourceElementOverlay, oPlugin);
334
337
 
335
338
  return Promise.all([
336
339
  oRevealActionsPromise,
337
340
  oAddPropertyActionsPromise,
338
- oCustomAddActionsPromise,
339
341
  checkInvalidAddActions(bSibling, oSourceElementOverlay, oPlugin)
340
342
  ]).then(function(aAllActions) {
341
343
  //join and condense all action data
342
- var mAllActions = merge(aAllActions[0], aAllActions[1], aAllActions[2]);
344
+ var mAllActions = merge(aAllActions[0], aAllActions[1]);
343
345
  oSourceElementOverlay._mAddActions = oSourceElementOverlay._mAddActions || {asSibling: {}, asChild: {}};
344
346
  oSourceElementOverlay._mAddActions[sSiblingOrChild] = mAllActions;
345
347
  return mAllActions;
@@ -350,7 +352,7 @@ sap.ui.define([
350
352
  * Returns the already calculated actions of an Overlay, or undefined if no actions available
351
353
  * @param {boolean} bSibling - Indicates if the elements should be added as sibling (true) or child (false) to the overlay
352
354
  * @param {sap.ui.dt.ElementOverlay} oOverlay - Elements will be added in relation (sibling/parent) to this overlay
353
- * @returns {object/undefined} - Object with all "add/reveal/custom" action relevant data collected or undefined if no actions available
355
+ * @returns {object/undefined} - Object with all "add/reveal" action relevant data collected or undefined if no actions available
354
356
  */
355
357
  ActionExtractor.getActionsOrUndef = function(bSibling, oOverlay) {
356
358
  var sSiblingOrChild = bSibling ? "asSibling" : "asChild";
@@ -431,75 +433,5 @@ sap.ui.define([
431
433
  }.bind(this));
432
434
  };
433
435
 
434
- /**
435
- * Return the CustomAdd action data (parameters + elements) for an Overlay.
436
- * @param {boolean} bSibling - If source element overlay should be sibling or parent to the newly added fields
437
- * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay where the action is triggered
438
- * @param {sap.ui.rta.plugin.additionalElements.AdditionalElementsPlugin} oPlugin - Instance of the AdditionalElementsPlugin
439
- *
440
- * @returns {Promise<object>} CustomAdd action data
441
- */
442
- ActionExtractor._getCustomAddActions = function(bSibling, oOverlay, oPlugin) {
443
- var mParents = AdditionalElementsUtils.getParents(bSibling, oOverlay, oPlugin);
444
- var oDesignTimeMetadata = mParents.parentOverlay && mParents.parentOverlay.getDesignTimeMetadata();
445
- var aActions = oDesignTimeMetadata && oDesignTimeMetadata.getActionDataFromAggregations("add", mParents.parent, undefined, "custom") || [];
446
-
447
- function getAction(mAction, oCheckElement) {
448
- var aItems = [];
449
- return Promise.resolve()
450
- .then(function () {
451
- if (mAction && typeof mAction.getItems === "function") {
452
- var oCheckElementOverlay = OverlayRegistry.getOverlay(oCheckElement);
453
- if (oPlugin.hasStableId(oCheckElementOverlay)) {
454
- return mAction.getItems(oCheckElement);
455
- }
456
- }
457
- return aItems;
458
- })
459
- .then(function (aItemsFromAction) {
460
- aItems = aItemsFromAction || [];
461
- var aChangeHandlerPromises = aItems.reduce(function (aPromises, oItem) {
462
- // adjust relevant container
463
- if (oItem.changeSpecificData.changeOnRelevantContainer) {
464
- oCheckElement = mParents.relevantContainer;
465
- }
466
- if (oItem.changeSpecificData.changeType) {
467
- aPromises.push(oPlugin.hasChangeHandler(oItem.changeSpecificData.changeType, oCheckElement));
468
- }
469
- return aPromises;
470
- }, []);
471
-
472
- return Promise.all(aChangeHandlerPromises);
473
- })
474
- .then(function (aHasChangeHandlerForCustomItems) {
475
- if (aHasChangeHandlerForCustomItems.indexOf(false) === -1) {
476
- return {
477
- aggregationName: mAction.aggregation,
478
- addViaCustom: {
479
- designTimeMetadata: oDesignTimeMetadata,
480
- action: mAction,
481
- items: aItems
482
- }
483
- };
484
- }
485
- return undefined;
486
- });
487
- }
488
-
489
- var oCheckElement = mParents.parent;
490
- return aActions.reduce(function(oPreviousPromise, oAction) {
491
- return oPreviousPromise.then(function(oReturn) {
492
- return getAction.call(this, oAction, oCheckElement).then(function(mAction) {
493
- if (mAction) {
494
- oReturn[mAction.aggregationName] = {
495
- addViaCustom: mAction.addViaCustom
496
- };
497
- }
498
- return oReturn;
499
- });
500
- }.bind(this));
501
- }.bind(this), Promise.resolve({}));
502
- };
503
-
504
436
  return ActionExtractor;
505
437
  });
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @class Context - Dialog for available Fields in Runtime Authoring
33
33
  * @extends sap.ui.base.ManagedObject
34
34
  * @author SAP SE
35
- * @version 1.97.1
35
+ * @version 1.100.0
36
36
  * @constructor
37
37
  * @private
38
38
  * @since 1.44
@@ -126,15 +126,6 @@ sap.ui.define([
126
126
  });
127
127
  }
128
128
 
129
- function _assignCustomItemIds(sParentId, oCustomItem) {
130
- oCustomItem.type = "custom";
131
- if (oCustomItem.id) {
132
- oCustomItem.itemId = sParentId + "-" + oCustomItem.id;
133
- oCustomItem.key = oCustomItem.itemId;
134
- }
135
- return oCustomItem;
136
- }
137
-
138
129
  function _oPropertyToAdditionalElementInfo (oProperty) {
139
130
  return {
140
131
  selected: false,
@@ -409,18 +400,6 @@ sap.ui.define([
409
400
  return bIncludeElement;
410
401
  }
411
402
 
412
- function _enhanceByCustomItems(oInvisibleElement, mActions, bIncludeElement, oElement) {
413
- var mCustom = mActions.addViaCustom;
414
- if (mCustom && bIncludeElement) {
415
- mCustom.items.forEach(function(oCustomItem) {
416
- _assignCustomItemIds(oElement.getParent().getId(), oCustomItem);
417
- if (oCustomItem.itemId === oInvisibleElement.getId()) {
418
- _enhanceInvisibleElement(oInvisibleElement, oCustomItem);
419
- }
420
- });
421
- }
422
- }
423
-
424
403
  function _getModelName(mAddViaDelegate) {
425
404
  //ManagedObject jsdoc tells to use undefined for default model, therefore it
426
405
  //is necessary to return undefined if modelName or whole delegateInfo is missing
@@ -462,8 +441,6 @@ sap.ui.define([
462
441
 
463
442
  var bIncludeElement = _enhanceByMetadata(oElement, sAggregationName, oInvisibleElement, mActions, aRepresentedProperties, aProperties);
464
443
 
465
- _enhanceByCustomItems(oInvisibleElement, mActions, bIncludeElement, oElement);
466
-
467
444
  if (bIncludeElement) {
468
445
  aAllElementData.push({
469
446
  element: oInvisibleElement,
@@ -518,50 +495,6 @@ sap.ui.define([
518
495
  }).then(function(aUnrepresentedProperties) {
519
496
  return aUnrepresentedProperties.map(_oPropertyToAdditionalElementInfo);
520
497
  });
521
- },
522
-
523
- getCustomAddItems: function(oElement, mAction) {
524
- return new Promise(function(fnResolve) {
525
- if (Array.isArray(mAction.items)) {
526
- // remove items already rendered
527
- fnResolve(
528
- mAction.items
529
- .map(_assignCustomItemIds.bind(null, oElement.getParent().getId()))
530
- .filter(function(oCustomItem) {
531
- if (!oCustomItem.id) {
532
- Log.error("CustomAdd item with label " + oCustomItem.label + " does not contain an 'id' property", "sap.ui.rta.plugin.AdditionalElementsAnalyzer#showAvailableElements");
533
- return false;
534
- }
535
- return !ElementUtil.getElementInstance(oCustomItem.itemId);
536
- })
537
- );
538
- } else {
539
- fnResolve();
540
- }
541
- });
542
- },
543
-
544
- getFilteredItemsList: function(aAnalyzerValues) {
545
- // promise index 0: invisible, 1: addViaOData/addViaDelegate, 2: custom
546
- var aInvisibleElements = aAnalyzerValues[0];
547
- var iCustomItemsIndex = 2;
548
- var aCustomItems = aAnalyzerValues[iCustomItemsIndex];
549
- if (aCustomItems) {
550
- var aInvisibleElementIds = aInvisibleElements.map(
551
- function (oInvisibleItem) {
552
- return oInvisibleItem.elementId;
553
- }
554
- );
555
- // filter for hidden custom items in the array
556
- aAnalyzerValues[iCustomItemsIndex] = aCustomItems
557
- .filter(function(oCustomItem) {
558
- return !oCustomItem.itemId || aInvisibleElementIds.indexOf(oCustomItem.itemId) === -1;
559
- });
560
- }
561
- return aAnalyzerValues
562
- .reduce(function (aAllElements, aAnalyzerValue) {
563
- return aAllElements.concat(aAnalyzerValue);
564
- }, []);
565
498
  }
566
499
  };
567
500
  return oAnalyzer;