@openui5/sap.ui.rta 1.99.1 → 1.102.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 (223) hide show
  1. package/THIRDPARTY.txt +5 -5
  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 +146 -92
  6. package/src/sap/ui/rta/Utils.js +3 -5
  7. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  8. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +2 -2
  9. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +0 -17
  10. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n.properties +0 -4
  11. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ar.properties +0 -2
  12. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +0 -2
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ca.properties +0 -2
  14. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_cs.properties +0 -2
  15. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_cy.properties +0 -2
  16. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_da.properties +0 -2
  17. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_de.properties +0 -2
  18. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_el.properties +0 -2
  19. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en.properties +0 -2
  20. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_GB.properties +0 -2
  21. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_sappsd.properties +0 -2
  22. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +0 -2
  23. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saptrc.properties +0 -2
  24. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_es.properties +0 -2
  25. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_es_MX.properties +0 -2
  26. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +0 -2
  27. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +0 -2
  28. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +0 -2
  29. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +0 -2
  30. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hi.properties +0 -2
  31. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hr.properties +0 -2
  32. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_hu.properties +0 -2
  33. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_id.properties +0 -2
  34. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_it.properties +0 -2
  35. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_iw.properties +0 -2
  36. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ja.properties +0 -2
  37. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +0 -2
  38. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ko.properties +0 -2
  39. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lt.properties +0 -2
  40. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +0 -2
  41. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ms.properties +0 -2
  42. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_nl.properties +0 -2
  43. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_no.properties +0 -2
  44. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pl.properties +0 -2
  45. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pt.properties +0 -2
  46. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_pt_PT.properties +0 -2
  47. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ro.properties +0 -2
  48. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +0 -2
  49. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sh.properties +0 -2
  50. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sk.properties +0 -2
  51. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sl.properties +0 -2
  52. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_sv.properties +0 -2
  53. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +0 -2
  54. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_tr.properties +0 -2
  55. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_uk.properties +0 -2
  56. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_vi.properties +0 -2
  57. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_zh_CN.properties +0 -2
  58. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_zh_TW.properties +0 -2
  59. package/src/sap/ui/rta/appVariant/manageApps/webapp/view/ManageApps.view.xml +0 -1
  60. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  61. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  62. package/src/sap/ui/rta/command/AddXML.js +3 -2
  63. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -2
  64. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  65. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  66. package/src/sap/ui/rta/command/BindProperty.js +3 -2
  67. package/src/sap/ui/rta/command/Combine.js +1 -1
  68. package/src/sap/ui/rta/command/CommandFactory.js +10 -4
  69. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  70. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  71. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  72. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +1 -1
  73. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  74. package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
  75. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  76. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  77. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  78. package/src/sap/ui/rta/command/LREPSerializer.js +3 -3
  79. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  80. package/src/sap/ui/rta/command/Move.js +1 -1
  81. package/src/sap/ui/rta/command/Property.js +1 -1
  82. package/src/sap/ui/rta/command/Remove.js +1 -1
  83. package/src/sap/ui/rta/command/Rename.js +1 -1
  84. package/src/sap/ui/rta/command/Resize.js +45 -0
  85. package/src/sap/ui/rta/command/Reveal.js +1 -1
  86. package/src/sap/ui/rta/command/Settings.js +1 -1
  87. package/src/sap/ui/rta/command/Split.js +1 -1
  88. package/src/sap/ui/rta/command/Stack.js +15 -12
  89. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  90. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +82 -0
  91. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  92. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  93. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  94. package/src/sap/ui/rta/enablement/elementActionTest.js +1 -1
  95. package/src/sap/ui/rta/library.js +6 -9
  96. package/src/sap/ui/rta/messagebundle.properties +24 -8
  97. package/src/sap/ui/rta/messagebundle_ar.properties +14 -6
  98. package/src/sap/ui/rta/messagebundle_bg.properties +16 -8
  99. package/src/sap/ui/rta/messagebundle_ca.properties +15 -7
  100. package/src/sap/ui/rta/messagebundle_cs.properties +14 -6
  101. package/src/sap/ui/rta/messagebundle_cy.properties +14 -6
  102. package/src/sap/ui/rta/messagebundle_da.properties +14 -6
  103. package/src/sap/ui/rta/messagebundle_de.properties +14 -6
  104. package/src/sap/ui/rta/messagebundle_el.properties +14 -6
  105. package/src/sap/ui/rta/messagebundle_en.properties +14 -6
  106. package/src/sap/ui/rta/messagebundle_en_GB.properties +14 -6
  107. package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +14 -6
  108. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +14 -6
  109. package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +14 -6
  110. package/src/sap/ui/rta/messagebundle_es.properties +14 -6
  111. package/src/sap/ui/rta/messagebundle_es_MX.properties +14 -6
  112. package/src/sap/ui/rta/messagebundle_et.properties +14 -6
  113. package/src/sap/ui/rta/messagebundle_fi.properties +14 -6
  114. package/src/sap/ui/rta/messagebundle_fr.properties +14 -6
  115. package/src/sap/ui/rta/messagebundle_fr_CA.properties +14 -6
  116. package/src/sap/ui/rta/messagebundle_hi.properties +13 -5
  117. package/src/sap/ui/rta/messagebundle_hr.properties +14 -6
  118. package/src/sap/ui/rta/messagebundle_hu.properties +14 -6
  119. package/src/sap/ui/rta/messagebundle_id.properties +14 -6
  120. package/src/sap/ui/rta/messagebundle_it.properties +14 -6
  121. package/src/sap/ui/rta/messagebundle_iw.properties +14 -6
  122. package/src/sap/ui/rta/messagebundle_ja.properties +14 -6
  123. package/src/sap/ui/rta/messagebundle_kk.properties +14 -6
  124. package/src/sap/ui/rta/messagebundle_ko.properties +14 -6
  125. package/src/sap/ui/rta/messagebundle_lt.properties +14 -6
  126. package/src/sap/ui/rta/messagebundle_lv.properties +14 -6
  127. package/src/sap/ui/rta/messagebundle_ms.properties +14 -6
  128. package/src/sap/ui/rta/messagebundle_nl.properties +14 -6
  129. package/src/sap/ui/rta/messagebundle_no.properties +14 -6
  130. package/src/sap/ui/rta/messagebundle_pl.properties +14 -6
  131. package/src/sap/ui/rta/messagebundle_pt.properties +14 -6
  132. package/src/sap/ui/rta/messagebundle_pt_PT.properties +14 -6
  133. package/src/sap/ui/rta/messagebundle_ro.properties +14 -6
  134. package/src/sap/ui/rta/messagebundle_ru.properties +14 -6
  135. package/src/sap/ui/rta/messagebundle_sh.properties +14 -6
  136. package/src/sap/ui/rta/messagebundle_sk.properties +14 -6
  137. package/src/sap/ui/rta/messagebundle_sl.properties +14 -6
  138. package/src/sap/ui/rta/messagebundle_sv.properties +14 -6
  139. package/src/sap/ui/rta/messagebundle_th.properties +14 -6
  140. package/src/sap/ui/rta/messagebundle_tr.properties +14 -6
  141. package/src/sap/ui/rta/messagebundle_uk.properties +14 -6
  142. package/src/sap/ui/rta/messagebundle_vi.properties +14 -6
  143. package/src/sap/ui/rta/messagebundle_zh_CN.properties +14 -6
  144. package/src/sap/ui/rta/messagebundle_zh_TW.properties +15 -7
  145. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +1 -1
  146. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  147. package/src/sap/ui/rta/plugin/Combine.js +6 -12
  148. package/src/sap/ui/rta/plugin/CompVariant.js +85 -66
  149. package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
  150. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -3
  151. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  152. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  153. package/src/sap/ui/rta/plugin/EasyAdd.js +1 -1
  154. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  155. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  156. package/src/sap/ui/rta/plugin/Plugin.js +32 -11
  157. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  158. package/src/sap/ui/rta/plugin/Remove.js +25 -26
  159. package/src/sap/ui/rta/plugin/Rename.js +6 -19
  160. package/src/sap/ui/rta/plugin/RenameHandler.js +23 -6
  161. package/src/sap/ui/rta/plugin/Resize.js +432 -0
  162. package/src/sap/ui/rta/plugin/Selection.js +1 -1
  163. package/src/sap/ui/rta/plugin/Settings.js +1 -1
  164. package/src/sap/ui/rta/plugin/Split.js +5 -11
  165. package/src/sap/ui/rta/plugin/Stretch.js +1 -1
  166. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  167. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  168. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsAnalyzer.js +20 -10
  169. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +1 -1
  170. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  171. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
  172. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
  173. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
  174. package/src/sap/ui/rta/service/Action.js +1 -1
  175. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  176. package/src/sap/ui/rta/service/Outline.js +1 -1
  177. package/src/sap/ui/rta/service/Property.js +1 -1
  178. package/src/sap/ui/rta/service/Selection.js +1 -1
  179. package/src/sap/ui/rta/themes/base/AddIFrame.less +37 -29
  180. package/src/sap/ui/rta/themes/base/ChangeVisualization.less +63 -69
  181. package/src/sap/ui/rta/themes/base/ContextMenu.less +25 -0
  182. package/src/sap/ui/rta/themes/base/Dialogs.less +79 -0
  183. package/src/sap/ui/rta/themes/base/FieldRepository.less +14 -61
  184. package/src/sap/ui/rta/themes/base/Overlay.less +96 -98
  185. package/src/sap/ui/rta/themes/base/OverlayWithScrollbar.less +7 -1
  186. package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +178 -36
  187. package/src/sap/ui/rta/themes/base/Toolbar.base.less +23 -154
  188. package/src/sap/ui/rta/themes/base/Toolbar.fiori.less +2 -21
  189. package/src/sap/ui/rta/themes/base/Toolbar.personalization.less +3 -14
  190. package/src/sap/ui/rta/themes/base/Toolbar.standalone.less +0 -9
  191. package/src/sap/ui/rta/themes/base/library.source.less +2 -0
  192. package/src/sap/ui/rta/themes/sap_hcb/ChangeVisualization.less +7 -0
  193. package/src/sap/ui/rta/themes/sap_hcb/ContextMenu.less +5 -0
  194. package/src/sap/ui/rta/themes/sap_hcb/Dialogs.less +28 -0
  195. package/src/sap/ui/rta/themes/sap_hcb/FieldRepository.less +18 -0
  196. package/src/sap/ui/rta/themes/sap_hcb/Overlay.less +52 -12
  197. package/src/sap/ui/rta/themes/sap_hcb/Toolbar.adaptation.less +38 -0
  198. package/src/sap/ui/rta/themes/sap_hcb/Toolbar.base.less +14 -2
  199. package/src/sap/ui/rta/themes/sap_hcb/Toolbar.personalization.less +8 -2
  200. package/src/sap/ui/rta/themes/sap_hcb/library.source.less +5 -2
  201. package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +33 -32
  202. package/src/sap/ui/rta/toolbar/Adaptation.js +68 -24
  203. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  204. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  205. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  206. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  207. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  208. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  209. package/src/sap/ui/rta/toolbar/VersionHistory.fragment.xml +2 -1
  210. package/src/sap/ui/rta/toolbar/translation/DownloadTranslationDialog.fragment.xml +20 -17
  211. package/src/sap/ui/rta/toolbar/translation/Translation.js +104 -98
  212. package/src/sap/ui/rta/toolbar/translation/UploadTranslationDialog.fragment.xml +4 -2
  213. package/src/sap/ui/rta/util/PluginManager.js +10 -4
  214. package/src/sap/ui/rta/util/PopupManager.js +33 -12
  215. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  216. package/src/sap/ui/rta/util/adaptationStarter.js +102 -80
  217. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +11 -4
  218. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +30 -0
  219. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +1 -1
  220. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -6
  221. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +108 -32
  222. package/src/sap/ui/rta/util/changeVisualization/categories/MoveVisualization.js +25 -7
  223. package/src/sap/ui/rta/themes/sap_hcb/Toolbar.standalone.less +0 -9
@@ -25,7 +25,7 @@ sap.ui.define([
25
25
  * @class
26
26
  * @extends sap.ui.rta.plugin.Plugin
27
27
  * @author SAP SE
28
- * @version 1.99.1
28
+ * @version 1.102.0
29
29
  * @constructor
30
30
  * @private
31
31
  * @since 1.46
@@ -44,21 +44,15 @@ sap.ui.define([
44
44
  /**
45
45
  * Check if the given overlay is editable.
46
46
  * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
47
- * @returns {Promise.<boolean>|boolean} <code>true</code> when editable wrapped in a promise.
47
+ * @returns {Promise.<boolean>} <code>true</code> when editable wrapped in a promise.
48
48
  * @private
49
49
  */
50
50
  Combine.prototype._isEditable = function (oOverlay) {
51
51
  var oCombineAction = this.getAction(oOverlay);
52
- if (!oOverlay.isRoot() && oCombineAction && oCombineAction.changeType && oCombineAction.changeOnRelevantContainer) {
53
- var oRelevantContainer = oOverlay.getRelevantContainer();
54
- return this.hasChangeHandler(oCombineAction.changeType, oRelevantContainer)
55
- .then(function(bHasChangeHandler) {
56
- return bHasChangeHandler &&
57
- this.hasStableId(oOverlay) &&
58
- this._checkRelevantContainerStableID(oCombineAction, oOverlay);
59
- }.bind(this));
52
+ if (!oOverlay.isRoot() && oCombineAction && oCombineAction.changeOnRelevantContainer) {
53
+ return this._checkChangeHandlerAndStableId(oOverlay);
60
54
  }
61
- return false;
55
+ return Promise.resolve(false);
62
56
  };
63
57
 
64
58
  Combine.prototype._checkForSameRelevantContainer = function(aElementOverlays) {
@@ -159,7 +153,7 @@ sap.ui.define([
159
153
  /**
160
154
  * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - specified overlays
161
155
  * @param {sap.ui.core.Element} oCombineElement - element where the combine was triggered
162
- * @returns {promise} Promise
156
+ * @returns {Promise} Promise
163
157
  */
164
158
  Combine.prototype.handleCombine = function(aElementOverlays, oCombineElement) {
165
159
  var oCombineElementOverlay;
@@ -36,13 +36,9 @@ sap.ui.define([
36
36
  }
37
37
  });
38
38
 
39
- function isVariantManagementControl(oOverlay) {
40
- return oOverlay.getElement().getMetadata().getName() === "sap.ui.comp.smartvariants.SmartVariantManagement";
41
- }
42
-
43
- function createCommandAndFireEvent(oOverlay, sName, mProperties) {
39
+ function createCommandAndFireEvent(oOverlay, sName, mProperties, oElement) {
44
40
  var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
45
- var oTargetElement = oOverlay.getElement();
41
+ var oTargetElement = oElement || oOverlay.getElement();
46
42
 
47
43
  return this.getCommandFactory().getCommandFor(oTargetElement, sName, mProperties, oDesignTimeMetadata)
48
44
 
@@ -167,83 +163,106 @@ sap.ui.define([
167
163
  }.bind(this), oContextSharingComponentContainer);
168
164
  }
169
165
 
166
+ // ------ change content ------
167
+ function changeContent(aOverlays) {
168
+ var oControl = aOverlays[0].getElementInstance();
169
+ var oAction = this.getAction(aOverlays[0]);
170
+ oAction.handler(oControl, {styleClass: Utils.getRtaStyleClassName()}).then(function(aData) {
171
+ createCommandAndFireEvent.call(this, aOverlays[0], "compVariantContent", {
172
+ variantId: aData[0].changeSpecificData.content.key,
173
+ newContent: aData[0].changeSpecificData.content.content,
174
+ persistencyKey: aData[0].changeSpecificData.content.persistencyKey
175
+ }, oControl.getVariantManagement());
176
+ }.bind(this));
177
+ }
178
+
170
179
  CompVariant.prototype._isEditable = function(oOverlay) {
171
- return isVariantManagementControl(oOverlay) && this.hasStableId(oOverlay);
180
+ return this.hasStableId(oOverlay) && !!this.getAction(oOverlay);
172
181
  };
173
182
 
174
183
  CompVariant.prototype.getMenuItems = function(aElementOverlays) {
175
184
  var oElementOverlay = aElementOverlays[0];
176
185
  var oVariantManagementControl = oElementOverlay.getElement();
177
186
  var aMenuItems = [];
187
+ if (this.isAvailable([oElementOverlay])) {
188
+ if (this.getAction(oElementOverlay).changeType === "variantContent") {
189
+ aMenuItems.push({
190
+ id: "CTX_COMP_VARIANT_CONTENT",
191
+ text: this.getActionText(oElementOverlay, this.getAction(oElementOverlay)),
192
+ handler: changeContent.bind(this),
193
+ enabled: true,
194
+ rank: 250,
195
+ icon: "sap-icon://key-user-settings"
196
+ });
197
+ } else {
198
+ var sLayer = this.getCommandFactory().getFlexSettings().layer;
199
+ var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
200
+ var aVariants = getAllVariants(oElementOverlay);
201
+ var oCurrentVariant = aVariants.find(function(oVariant) {
202
+ return oVariant.getId() === oVariantManagementControl.getPresentVariantId();
203
+ });
178
204
 
179
- if (this._isEditable(oElementOverlay)) {
180
- var sLayer = this.getCommandFactory().getFlexSettings().layer;
181
- var oLibraryBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.rta");
182
- var aVariants = getAllVariants(oElementOverlay);
183
- var oCurrentVariant = aVariants.find(function(oVariant) {
184
- return oVariant.getId() === oVariantManagementControl.getPresentVariantId();
185
- });
205
+ if (oCurrentVariant.isRenameEnabled(sLayer)) {
206
+ aMenuItems.push({
207
+ id: "CTX_COMP_VARIANT_RENAME",
208
+ text: oLibraryBundle.getText("CTX_RENAME"),
209
+ handler: renameVariant.bind(this),
210
+ enabled: true,
211
+ rank: 210,
212
+ icon: "sap-icon://edit"
213
+ });
214
+ }
215
+
216
+ if (oCurrentVariant.isEditEnabled(sLayer)) {
217
+ aMenuItems.push({
218
+ id: "CTX_COMP_VARIANT_SAVE",
219
+ text: oLibraryBundle.getText("CTX_VARIANT_SAVE"),
220
+ handler: saveVariant.bind(this),
221
+ enabled: isSaveEnabled,
222
+ rank: 220,
223
+ icon: "sap-icon://save"
224
+ });
225
+ }
186
226
 
187
- if (oCurrentVariant.isRenameEnabled(sLayer)) {
188
227
  aMenuItems.push({
189
- id: "CTX_COMP_VARIANT_RENAME",
190
- text: oLibraryBundle.getText("CTX_RENAME"),
191
- handler: renameVariant.bind(this),
228
+ id: "CTX_COMP_VARIANT_SAVE_AS",
229
+ text: oLibraryBundle.getText("CTX_VARIANT_SAVEAS"),
230
+ handler: saveAsNewVariant.bind(this),
192
231
  enabled: true,
193
- rank: 210,
194
- icon: "sap-icon://edit"
232
+ rank: 230,
233
+ icon: "sap-icon://duplicate"
195
234
  });
196
- }
197
235
 
198
- if (oCurrentVariant.isEditEnabled(sLayer)) {
199
236
  aMenuItems.push({
200
- id: "CTX_COMP_VARIANT_SAVE",
201
- text: oLibraryBundle.getText("CTX_VARIANT_SAVE"),
202
- handler: saveVariant.bind(this),
203
- enabled: isSaveEnabled,
204
- rank: 220,
205
- icon: "sap-icon://save"
237
+ id: "CTX_COMP_VARIANT_MANAGE",
238
+ text: oLibraryBundle.getText("CTX_VARIANT_MANAGE"),
239
+ handler: configureVariants.bind(this),
240
+ enabled: true,
241
+ rank: 240,
242
+ icon: "sap-icon://action-settings"
206
243
  });
207
- }
208
-
209
- aMenuItems.push({
210
- id: "CTX_COMP_VARIANT_SAVE_AS",
211
- text: oLibraryBundle.getText("CTX_VARIANT_SAVEAS"),
212
- handler: saveAsNewVariant.bind(this),
213
- enabled: true,
214
- rank: 230,
215
- icon: "sap-icon://duplicate"
216
- });
217
-
218
- aMenuItems.push({
219
- id: "CTX_COMP_VARIANT_MANAGE",
220
- text: oLibraryBundle.getText("CTX_VARIANT_MANAGE"),
221
- handler: configureVariants.bind(this),
222
- enabled: true,
223
- rank: 240,
224
- icon: "sap-icon://action-settings"
225
- });
226
244
 
227
- var aSubmenuItems = aVariants.map(function(oVariant) {
228
- var bCurrentItem = oVariantManagementControl.getPresentVariantId() === oVariant.getId();
229
- var oItem = {
230
- id: oVariant.getId(),
231
- text: oVariant.getText("variantName"),
232
- icon: bCurrentItem ? "sap-icon://accept" : "blank",
233
- enabled: !bCurrentItem
234
- };
235
- return oItem;
236
- });
245
+ var aSubmenuItems = aVariants.map(function(oVariant) {
246
+ var bCurrentItem = oVariantManagementControl.getPresentVariantId() === oVariant.getId();
247
+ var oItem = {
248
+ id: oVariant.getId(),
249
+ text: oVariant.getText("variantName"),
250
+ icon: bCurrentItem ? "sap-icon://accept" : "blank",
251
+ enabled: !bCurrentItem
252
+ };
253
+ return oItem;
254
+ });
237
255
 
238
- aMenuItems.push({
239
- id: "CTX_COMP_VARIANT_SWITCH",
240
- text: oLibraryBundle.getText("CTX_VARIANT_SWITCH"),
241
- handler: switchVariant.bind(this),
242
- enabled: isSwitchEnabled,
243
- submenu: aSubmenuItems,
244
- rank: 250,
245
- icon: "sap-icon://switch-views"
246
- });
256
+ aMenuItems.push({
257
+ id: "CTX_COMP_VARIANT_SWITCH",
258
+ text: oLibraryBundle.getText("CTX_VARIANT_SWITCH"),
259
+ handler: switchVariant.bind(this),
260
+ enabled: isSwitchEnabled,
261
+ submenu: aSubmenuItems,
262
+ rank: 250,
263
+ icon: "sap-icon://switch-views"
264
+ });
265
+ }
247
266
  }
248
267
 
249
268
  return aMenuItems;
@@ -43,7 +43,7 @@ sap.ui.define([
43
43
  * @class The ControlVariant allows propagation of variantManagement key
44
44
  * @extends sap.ui.rta.plugin.Plugin
45
45
  * @author SAP SE
46
- * @version 1.99.1
46
+ * @version 1.102.0
47
47
  * @constructor
48
48
  * @private
49
49
  * @since 1.50
@@ -7,13 +7,11 @@
7
7
  sap.ui.define([
8
8
  "sap/ui/rta/plugin/BaseCreate",
9
9
  "sap/ui/fl/Utils",
10
- "sap/ui/rta/Utils",
11
10
  "sap/ui/dt/Util",
12
11
  "sap/base/util/uid"
13
12
  ], function(
14
13
  BaseCreate,
15
14
  FlexUtils,
16
- RtaUtils,
17
15
  DtUtil,
18
16
  uid
19
17
  ) {
@@ -27,7 +25,7 @@ sap.ui.define([
27
25
  * @class The CreateContainer allows trigger CreateContainer operations on the overlay
28
26
  * @extends sap.ui.rta.plugin.BaseCreate
29
27
  * @author SAP SE
30
- * @version 1.99.1
28
+ * @version 1.102.0
31
29
  * @constructor
32
30
  * @private
33
31
  * @since 1.34
@@ -31,7 +31,7 @@ function(
31
31
  * @extends sap.ui.dt.plugin.CutPaste
32
32
  *
33
33
  * @author SAP SE
34
- * @version 1.99.1
34
+ * @version 1.102.0
35
35
  *
36
36
  * @constructor
37
37
  * @private
@@ -33,7 +33,7 @@ function(
33
33
  * @extends sap.ui.dt.plugin.ControlDragDrop
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.99.1
36
+ * @version 1.102.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.99.1
28
+ * @version 1.102.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.99.1
26
+ * @version 1.102.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.99.1
38
+ * @version 1.102.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.99.1
72
+ * @version 1.102.0
73
73
  *
74
74
  * @constructor
75
75
  * @private
@@ -168,16 +168,20 @@ function(
168
168
  BasePlugin.prototype._getRelevantOverlays = function(oOverlay, sAggregationName) {
169
169
  var aAlreadyDefinedRelevantOverlays = oOverlay.getRelevantOverlays();
170
170
  if (aAlreadyDefinedRelevantOverlays.length === 0) {
171
- var aRelevantOverlays = OverlayUtil.findAllOverlaysInContainer(oOverlay);
172
-
173
- // if an aggregation name is given, those overlays are added without checking the relevant container
174
- if (sAggregationName) {
175
- var oAggregationOverlay = oOverlay.getAggregationOverlay(sAggregationName);
176
- var aAggregationChildren = oAggregationOverlay ? oAggregationOverlay.getChildren() : [];
177
- aAggregationChildren = aAggregationChildren.filter(function(oChildOverlay) {
178
- return aRelevantOverlays.indexOf(oChildOverlay) === -1;
179
- });
180
- aRelevantOverlays = aRelevantOverlays.concat(aAggregationChildren);
171
+ var aRelevantOverlays = [];
172
+ // Overlays in aggregation binding templates are not relevant
173
+ if (!oOverlay.getIsPartOfTemplate()) {
174
+ aRelevantOverlays = OverlayUtil.findAllOverlaysInContainer(oOverlay);
175
+
176
+ // if an aggregation name is given, those overlays are added without checking the relevant container
177
+ if (sAggregationName) {
178
+ var oAggregationOverlay = oOverlay.getAggregationOverlay(sAggregationName);
179
+ var aAggregationChildren = oAggregationOverlay ? oAggregationOverlay.getChildren() : [];
180
+ aAggregationChildren = aAggregationChildren.filter(function(oChildOverlay) {
181
+ return aRelevantOverlays.indexOf(oChildOverlay) === -1;
182
+ });
183
+ aRelevantOverlays = aRelevantOverlays.concat(aAggregationChildren);
184
+ }
181
185
  }
182
186
 
183
187
  oOverlay.setRelevantOverlays(aRelevantOverlays);
@@ -370,5 +374,22 @@ function(
370
374
  return true;
371
375
  };
372
376
 
377
+ BasePlugin.prototype._checkChangeHandlerAndStableId = function(oElementOverlay) {
378
+ var oAction = this.getAction(oElementOverlay);
379
+ if (oAction && oAction.changeType) {
380
+ var oElement = oAction.changeOnRelevantContainer ?
381
+ oElementOverlay.getRelevantContainer() :
382
+ oElementOverlay.getElement();
383
+
384
+ return this.hasChangeHandler(oAction.changeType, oElement)
385
+ .then(function(bHasChangeHandler) {
386
+ return bHasChangeHandler
387
+ && this._checkRelevantContainerStableID(oAction, oElementOverlay)
388
+ && this.hasStableId(oElementOverlay);
389
+ }.bind(this));
390
+ }
391
+ return Promise.resolve(false);
392
+ };
393
+
373
394
  return BasePlugin;
374
395
  });
@@ -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.99.1
38
+ * @version 1.102.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.99.1
32
+ * @version 1.102.0
33
33
  * @constructor
34
34
  * @private
35
35
  * @since 1.34
@@ -59,26 +59,12 @@ sap.ui.define([
59
59
  };
60
60
 
61
61
  /**
62
- * @param {sap.ui.dt.ElementOverlay} oElementOverlay - Overlay to be checked for editable
63
- * @return {Promise.<boolean>|boolean} <code>true</code> if it's editable wrapped in a promise.
62
+ * @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
63
+ * @return {Promise.<boolean>} <code>true</code> if it's editable wrapped in a promise.
64
64
  * @private
65
65
  */
66
- Remove.prototype._isEditable = function (oElementOverlay) {
67
- var oElement = oElementOverlay.getElement();
68
-
69
- var oRemoveAction = this.getAction(oElementOverlay);
70
- if (oRemoveAction && oRemoveAction.changeType) {
71
- if (oRemoveAction.changeOnRelevantContainer) {
72
- oElement = oElementOverlay.getRelevantContainer();
73
- }
74
- return this.hasChangeHandler(oRemoveAction.changeType, oElement)
75
- .then(function(bHasChangeHandler) {
76
- return bHasChangeHandler
77
- && this._checkRelevantContainerStableID(oRemoveAction, oElementOverlay)
78
- && this.hasStableId(oElementOverlay);
79
- }.bind(this));
80
- }
81
- return false;
66
+ Remove.prototype._isEditable = function (oOverlay) {
67
+ return this._checkChangeHandlerAndStableId(oOverlay);
82
68
  };
83
69
 
84
70
  /**
@@ -114,12 +100,25 @@ sap.ui.define([
114
100
  /**
115
101
  * Checks if Overlay control has a valid parent and if it is
116
102
  * not the last visible control in the aggregation
103
+ * The removal of the last element in the aggregation can
104
+ * be defined by the parameter 'removeLastElement' in the
105
+ * designtime of the aggregation
117
106
  *
118
107
  * @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - overlays to be removed
119
108
  * @return {boolean} Returns true if the control can be removed
120
109
  * @private
121
110
  */
122
111
  Remove.prototype._canBeRemovedFromAggregation = function(aElementOverlays) {
112
+ //Check if designtime allows removing last visible element
113
+ var fnCheckDesignTimeSettings = function (oOverlay) {
114
+ var oParentOverlay = oOverlay.getParentAggregationOverlay();
115
+ if (oParentOverlay) {
116
+ var oAction = this.getAction(oParentOverlay);
117
+ return !!(oAction && oAction.removeLastElement);
118
+ }
119
+ return false;
120
+ }.bind(this);
121
+
123
122
  var oOverlay = aElementOverlays[0];
124
123
  var oElement = oOverlay.getElement();
125
124
  var oParent = oElement.getParent();
@@ -130,17 +129,17 @@ sap.ui.define([
130
129
  if (!Array.isArray(aElements)) {
131
130
  return true;
132
131
  }
133
- if (aElements.length === 1) {
134
- return false;
135
- }
136
-
137
- // Fallback to 1 if no overlay is selected
132
+ // check if selected Overlays are the last visible elements in aggregation
138
133
  var iNumberOfSelectedOverlays = aElementOverlays.length;
139
134
  var aInvisibleElements = aElements.filter(function(oElement) {
140
135
  var oElementOverlay = OverlayRegistry.getOverlay(oElement);
141
136
  return !(oElementOverlay && oElementOverlay.getElementVisibility());
142
137
  });
143
- return !(aInvisibleElements.length === (aElements.length - iNumberOfSelectedOverlays));
138
+ var bIsLastVisibleElement = (aInvisibleElements.length + iNumberOfSelectedOverlays === aElements.length);
139
+ if (bIsLastVisibleElement) {
140
+ return fnCheckDesignTimeSettings(oOverlay);
141
+ }
142
+ return true;
144
143
  };
145
144
 
146
145
  /**
@@ -323,4 +322,4 @@ sap.ui.define([
323
322
  };
324
323
 
325
324
  return Remove;
326
- });
325
+ });
@@ -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.99.1
31
+ * @version 1.102.0
32
32
  *
33
33
  * @constructor
34
34
  * @private
@@ -76,12 +76,12 @@ sap.ui.define([
76
76
  };
77
77
 
78
78
  Rename.prototype.startEdit = function (oOverlay) {
79
- var oElement = oOverlay.getElement();
80
- var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
81
- var vDomRef = oDesignTimeMetadata.getAction("rename", oElement).domRef;
79
+ var vDomRef = this.getAction(oOverlay).domRef;
80
+ var fnGetTextMutators = this.getAction(oOverlay).getTextMutators;
82
81
  RenameHandler.startEdit.call(this, {
83
82
  overlay: oOverlay,
84
83
  domRef: vDomRef,
84
+ getTextMutators: fnGetTextMutators,
85
85
  pluginMethodName: "plugin.Rename.startEdit"
86
86
  });
87
87
  };
@@ -162,20 +162,7 @@ sap.ui.define([
162
162
  * @private
163
163
  */
164
164
  Rename.prototype._isEditable = function(oOverlay) {
165
- var oElement = oOverlay.getElement();
166
- var oRenameAction = this.getAction(oOverlay);
167
- if (oRenameAction && oRenameAction.changeType) {
168
- if (oRenameAction.changeOnRelevantContainer) {
169
- oElement = oOverlay.getRelevantContainer();
170
- }
171
- return this.hasChangeHandler(oRenameAction.changeType, oElement)
172
- .then(function(bHasChangeHandler) {
173
- return bHasChangeHandler
174
- && this._checkRelevantContainerStableID(oRenameAction, oOverlay)
175
- && this.hasStableId(oOverlay);
176
- }.bind(this));
177
- }
178
- return false;
165
+ return this._checkChangeHandlerAndStableId(oOverlay);
179
166
  };
180
167
 
181
168
  /**
@@ -194,7 +181,7 @@ sap.ui.define([
194
181
  */
195
182
  Rename.prototype._emitLabelChangeEvent = function() {
196
183
  var sText = RenameHandler._getCurrentEditableFieldText.call(this);
197
- this._$oEditableControlDomRef.text(sText);
184
+ this._fnSetControlText(sText);
198
185
 
199
186
  var oResponsibleElementOverlay = this.getResponsibleElementOverlay(this._oEditedOverlay);
200
187
  var oRenamedElement = oResponsibleElementOverlay.getElement();
@@ -55,7 +55,7 @@ sap.ui.define([
55
55
  * Provides Rename handling functionality
56
56
  *
57
57
  * @author SAP SE
58
- * @version 1.99.1
58
+ * @version 1.102.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));
@@ -172,6 +185,8 @@ sap.ui.define([
172
185
  "-webkit-user-modify": "read-write",
173
186
  "-ms-user-modify": "read-write",
174
187
  "user-modify": "read-write",
188
+ "user-select": "text",
189
+ "-webkit-user-select": "text",
175
190
  "text-overflow": "clip",
176
191
  "white-space": "nowrap"
177
192
  });
@@ -284,8 +299,8 @@ sap.ui.define([
284
299
  this.setBusy(false);
285
300
 
286
301
  // 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("");
302
+ if (this._fnGetControlText() === "_?_") {
303
+ this._fnSetControlText("");
289
304
  }
290
305
 
291
306
  this._oEditedOverlay.$().find(".sapUiRtaEditableField").remove();
@@ -305,6 +320,8 @@ sap.ui.define([
305
320
  delete this._$oEditableControlDomRef;
306
321
  delete this._oEditedOverlay;
307
322
  delete this._bBlurOrKeyDownStarted;
323
+ delete this._fnGetControlText;
324
+ delete this._fnSetControlText;
308
325
 
309
326
  sap.ui.getCore().getEventBus().publish("sap.ui.rta", sPluginMethodName, {
310
327
  overlay: oOverlay