@openui5/sap.ui.rta 1.120.7 → 1.121.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 (164) hide show
  1. package/.reuse/dep5 +23 -21
  2. package/THIRDPARTY.txt +6 -43
  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 +507 -759
  7. package/src/sap/ui/rta/Utils.js +1 -146
  8. package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
  9. package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
  10. package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
  11. package/src/sap/ui/rta/appVariant/Utils.js +3 -3
  12. package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
  13. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
  14. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
  15. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
  16. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
  17. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
  18. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
  19. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
  20. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
  21. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
  22. package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
  23. package/src/sap/ui/rta/command/AddIFrame.js +1 -1
  24. package/src/sap/ui/rta/command/AddProperty.js +1 -1
  25. package/src/sap/ui/rta/command/AddXML.js +1 -1
  26. package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
  27. package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
  28. package/src/sap/ui/rta/command/BaseCommand.js +1 -1
  29. package/src/sap/ui/rta/command/BindProperty.js +1 -1
  30. package/src/sap/ui/rta/command/Combine.js +1 -1
  31. package/src/sap/ui/rta/command/CommandFactory.js +1 -1
  32. package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
  33. package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
  34. package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
  35. package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -5
  36. package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
  37. package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
  38. package/src/sap/ui/rta/command/CreateContainer.js +1 -1
  39. package/src/sap/ui/rta/command/CustomAdd.js +1 -1
  40. package/src/sap/ui/rta/command/FlexCommand.js +1 -1
  41. package/src/sap/ui/rta/command/LREPSerializer.js +4 -3
  42. package/src/sap/ui/rta/command/LocalReset.js +1 -1
  43. package/src/sap/ui/rta/command/Move.js +1 -1
  44. package/src/sap/ui/rta/command/Property.js +1 -1
  45. package/src/sap/ui/rta/command/Remove.js +1 -1
  46. package/src/sap/ui/rta/command/Rename.js +1 -1
  47. package/src/sap/ui/rta/command/Resize.js +1 -1
  48. package/src/sap/ui/rta/command/Reveal.js +1 -1
  49. package/src/sap/ui/rta/command/Settings.js +1 -1
  50. package/src/sap/ui/rta/command/Split.js +1 -1
  51. package/src/sap/ui/rta/command/Stack.js +23 -1
  52. package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
  53. package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
  54. package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
  55. package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
  56. package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
  57. package/src/sap/ui/rta/enablement/elementActionTest.js +180 -258
  58. package/src/sap/ui/rta/library.js +3 -2
  59. package/src/sap/ui/rta/messagebundle.properties +8 -0
  60. package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
  61. package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
  62. package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
  63. package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
  64. package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
  65. package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
  66. package/src/sap/ui/rta/messagebundle_da.properties +4 -0
  67. package/src/sap/ui/rta/messagebundle_de.properties +5 -1
  68. package/src/sap/ui/rta/messagebundle_el.properties +4 -0
  69. package/src/sap/ui/rta/messagebundle_en.properties +4 -0
  70. package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
  71. package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
  72. package/src/sap/ui/rta/messagebundle_es.properties +4 -0
  73. package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
  74. package/src/sap/ui/rta/messagebundle_et.properties +6 -2
  75. package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
  76. package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
  77. package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
  78. package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
  79. package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
  80. package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
  81. package/src/sap/ui/rta/messagebundle_id.properties +5 -1
  82. package/src/sap/ui/rta/messagebundle_it.properties +10 -6
  83. package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
  84. package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
  85. package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
  86. package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
  87. package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
  88. package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
  89. package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
  90. package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
  91. package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
  92. package/src/sap/ui/rta/messagebundle_no.properties +4 -0
  93. package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
  94. package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
  95. package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
  96. package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
  97. package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
  98. package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
  99. package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
  100. package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
  101. package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
  102. package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
  103. package/src/sap/ui/rta/messagebundle_th.properties +9 -5
  104. package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
  105. package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
  106. package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
  107. package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
  108. package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
  109. package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
  110. package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
  111. package/src/sap/ui/rta/plugin/Combine.js +1 -1
  112. package/src/sap/ui/rta/plugin/CompVariant.js +43 -1
  113. package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
  114. package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
  115. package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
  116. package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
  117. package/src/sap/ui/rta/plugin/EasyAdd.js +2 -2
  118. package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
  119. package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
  120. package/src/sap/ui/rta/plugin/Plugin.js +18 -10
  121. package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
  122. package/src/sap/ui/rta/plugin/Remove.js +1 -1
  123. package/src/sap/ui/rta/plugin/Rename.js +1 -1
  124. package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
  125. package/src/sap/ui/rta/plugin/Resize.js +1 -1
  126. package/src/sap/ui/rta/plugin/Selection.js +24 -9
  127. package/src/sap/ui/rta/plugin/Settings.js +17 -15
  128. package/src/sap/ui/rta/plugin/Split.js +1 -1
  129. package/src/sap/ui/rta/plugin/Stretch.js +14 -13
  130. package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
  131. package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
  132. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +134 -67
  133. package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
  134. package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
  135. package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
  136. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
  137. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
  138. package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
  139. package/src/sap/ui/rta/service/Action.js +1 -1
  140. package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
  141. package/src/sap/ui/rta/service/Outline.js +22 -18
  142. package/src/sap/ui/rta/service/Property.js +1 -1
  143. package/src/sap/ui/rta/service/Selection.js +1 -1
  144. package/src/sap/ui/rta/service/SupportTools.js +23 -19
  145. package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
  146. package/src/sap/ui/rta/toolbar/Base.js +1 -1
  147. package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
  148. package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
  149. package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
  150. package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
  151. package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
  152. package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
  153. package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
  154. package/src/sap/ui/rta/toolbar/versioning/Versioning.js +12 -5
  155. package/src/sap/ui/rta/util/PluginManager.js +1 -1
  156. package/src/sap/ui/rta/util/PopupManager.js +1 -1
  157. package/src/sap/ui/rta/util/ReloadManager.js +19 -59
  158. package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
  159. package/src/sap/ui/rta/util/ServiceManager.js +193 -0
  160. package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
  161. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
  162. package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
  163. package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
  164. package/LICENSES/BSD-2-Clause.txt +0 -22
@@ -53,7 +53,7 @@ sap.ui.define([
53
53
  * When clicking anywhere on the application, the menu must close
54
54
  */
55
55
  function _onClick() {
56
- var oPopover = this.getPopover();
56
+ const oPopover = this.getPopover();
57
57
  if (oPopover && oPopover.isOpen()) {
58
58
  oPopover.close();
59
59
  }
@@ -64,12 +64,12 @@ sap.ui.define([
64
64
  }
65
65
 
66
66
  function _determineElementOverlay(oElementId, oAffectedElementId) {
67
- var oOverlay = OverlayRegistry.getOverlay(oElementId);
67
+ let oOverlay = OverlayRegistry.getOverlay(oElementId);
68
68
  if (!oOverlay) {
69
69
  // When the element has no Overlay, check if there is a relevant container Overlay
70
70
  // e.g. change on a SmartForm group (Element: parent Form; Relevant Container: SmartForm)
71
- var oElementOverlay = OverlayRegistry.getOverlay(oAffectedElementId);
72
- var oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
71
+ const oElementOverlay = OverlayRegistry.getOverlay(oAffectedElementId);
72
+ const oRelevantContainer = oElementOverlay && oElementOverlay.getRelevantContainer();
73
73
  if (oRelevantContainer) {
74
74
  oOverlay = OverlayRegistry.getOverlay(oRelevantContainer);
75
75
  }
@@ -86,10 +86,10 @@ sap.ui.define([
86
86
  * @alias sap.ui.rta.util.changeVisualization.ChangeVisualization
87
87
  * @author SAP SE
88
88
  * @since 1.84.0
89
- * @version 1.120.7
89
+ * @version 1.121.0
90
90
  * @private
91
91
  */
92
- var ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
92
+ const ChangeVisualization = Control.extend("sap.ui.rta.util.changeVisualization.ChangeVisualization", {
93
93
  metadata: {
94
94
  library: "sap.ui.rta",
95
95
  properties: {
@@ -214,14 +214,14 @@ sap.ui.define([
214
214
  });
215
215
  }
216
216
  // Array of all Hidden Changes
217
- var aHiddenChanges = [];
217
+ const aHiddenChanges = [];
218
218
  // Array of all Visualized Changes
219
- var aVisualizedChanges = [];
219
+ const aVisualizedChanges = [];
220
220
 
221
- var bHasDraftChanges = false;
222
- var bHasDirtyChanges = false;
221
+ let bHasDraftChanges = false;
222
+ let bHasDirtyChanges = false;
223
223
 
224
- var aAllRelevantChangeIds = aAllRelevantChanges.map(function(oChange) {
224
+ const aAllRelevantChangeIds = aAllRelevantChanges.map(function(oChange) {
225
225
  return oChange.id;
226
226
  });
227
227
 
@@ -233,7 +233,7 @@ sap.ui.define([
233
233
  bHasDraftChanges = true;
234
234
  }
235
235
 
236
- var oOverlay = _determineElementOverlay(
236
+ const oOverlay = _determineElementOverlay(
237
237
  oChange.visualizationInfo.displayElementIds[0],
238
238
  oChange.visualizationInfo.affectedElementIds[0]
239
239
  );
@@ -246,8 +246,8 @@ sap.ui.define([
246
246
  aVisualizedChanges.push(oChange);
247
247
  }
248
248
  });
249
- var aRelevantHiddenChanges = filterRelevantChanges(aHiddenChanges);
250
- var aRelevantVisualizedChanges = filterRelevantChanges(aVisualizedChanges);
249
+ const aRelevantHiddenChanges = filterRelevantChanges(aHiddenChanges);
250
+ const aRelevantVisualizedChanges = filterRelevantChanges(aVisualizedChanges);
251
251
  return {
252
252
  relevantHiddenChanges: aRelevantHiddenChanges,
253
253
  relevantVisualizedChanges: aRelevantVisualizedChanges,
@@ -258,27 +258,27 @@ sap.ui.define([
258
258
 
259
259
  ChangeVisualization.prototype._updateVisualizationModelMenuData = function() {
260
260
  // Get selected change state and change category
261
- var sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
261
+ const sVisualizedChangeState = this._oChangeVisualizationModel.getData().changeState;
262
262
 
263
263
  // Get all registered and relevant change ids
264
- var aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
265
- var aAllRelevantChanges = this._oChangeIndicatorRegistry.getRelevantChangesWithSelector();
264
+ const aAllRegisteredChanges = this._oChangeIndicatorRegistry.getAllRegisteredChanges();
265
+ const aAllRelevantChanges = this._oChangeIndicatorRegistry.getRelevantChangesWithSelector();
266
266
 
267
267
  // Filter allRegisteredChanges for independent changes and get the ids
268
- var aRegisteredIndependentChanges = aAllRegisteredChanges.filter(function(oChange) {
268
+ const aRegisteredIndependentChanges = aAllRegisteredChanges.filter(function(oChange) {
269
269
  if (!oChange.dependent) {
270
270
  return true;
271
271
  }
272
272
  return false;
273
273
  });
274
274
 
275
- var oSortedChanges = this._determineChangeVisibility(
275
+ const oSortedChanges = this._determineChangeVisibility(
276
276
  aRegisteredIndependentChanges,
277
277
  aAllRelevantChanges,
278
278
  sVisualizedChangeState
279
279
  );
280
- var aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
281
- var sTitle = this._getChangeCategoryLabel(
280
+ const aCommandData = Object.keys(ChangeCategories.getCategories()).map(function(sChangeCategoryName) {
281
+ const sTitle = this._getChangeCategoryLabel(
282
282
  sChangeCategoryName,
283
283
  this._getChangesForChangeCategory(sChangeCategoryName, oSortedChanges.relevantVisualizedChanges).length
284
284
  );
@@ -321,19 +321,19 @@ sap.ui.define([
321
321
  };
322
322
 
323
323
  ChangeVisualization.prototype._getChangeCategoryLabel = function(sChangeCategoryName, iChangesCount) {
324
- var sLabelKey = `TXT_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
324
+ const sLabelKey = `TXT_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
325
325
  return this._oTextBundle.getText(sLabelKey, [iChangesCount]);
326
326
  };
327
327
 
328
328
  ChangeVisualization.prototype._getChangeCategoryButton = function(sChangeCategoryName) {
329
- var sButtonKey = `BTN_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
329
+ const sButtonKey = `BTN_CHANGEVISUALIZATION_OVERVIEW_${sChangeCategoryName.toUpperCase()}`;
330
330
  return this._oTextBundle.getText(sButtonKey);
331
331
  };
332
332
 
333
333
  ChangeVisualization.prototype.openChangeCategorySelectionPopover = function(oEvent) {
334
334
  // Event bubbled through the toolbar, get original source
335
335
  this._oToolbarButton ||= Element.getElementById(oEvent.getParameter("id"));
336
- var oPopover = this.getPopover();
336
+ const oPopover = this.getPopover();
337
337
 
338
338
  if (!oPopover) {
339
339
  Fragment.load({
@@ -369,19 +369,19 @@ sap.ui.define([
369
369
  * @param {event} oEvent - Event
370
370
  */
371
371
  ChangeVisualization.prototype.onChangeCategorySelection = function(oEvent) {
372
- var sSelectedChangeCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
372
+ const sSelectedChangeCategory = oEvent.getSource().getBindingContext("visualizationModel").getObject().key;
373
373
  this._selectChangeCategory(sSelectedChangeCategory);
374
374
  };
375
375
 
376
376
  ChangeVisualization.prototype.onVersioningCategoryChange = function(oEvent) {
377
- var sSelectedChangeState = oEvent.getSource().getSelectedKey();
377
+ const sSelectedChangeState = oEvent.getSource().getSelectedKey();
378
378
  this._selectChangeState(sSelectedChangeState);
379
379
  };
380
380
 
381
381
  ChangeVisualization.prototype._selectChangeCategory = function(sSelectedChangeCategory) {
382
382
  this._sSelectedChangeCategory = sSelectedChangeCategory;
383
383
 
384
- var sChangeCategoryText = this._getChangeCategoryButton(sSelectedChangeCategory);
384
+ const sChangeCategoryText = this._getChangeCategoryButton(sSelectedChangeCategory);
385
385
 
386
386
  this._updateVisualizationModel({
387
387
  changeCategory: sSelectedChangeCategory,
@@ -404,7 +404,7 @@ sap.ui.define([
404
404
  };
405
405
 
406
406
  ChangeVisualization.prototype._getCommandForChange = function(oChange) {
407
- var sCommand = oChange.getSupportInformation().command;
407
+ const sCommand = oChange.getSupportInformation().command;
408
408
  if (sCommand) {
409
409
  return sCommand;
410
410
  }
@@ -413,17 +413,17 @@ sap.ui.define([
413
413
  return false;
414
414
  }
415
415
 
416
- var oComponent = this._getComponent();
417
- var oSelectorControl = JsControlTreeModifier.bySelector(oChange.getSelector(), oComponent);
418
- var oLastDependentSelector = oChange.getDependentSelectorList().slice(-1)[0];
419
- var oLastDependentSelectorControl = JsControlTreeModifier.bySelector(oLastDependentSelector, oComponent);
416
+ const oComponent = this._getComponent();
417
+ const oSelectorControl = JsControlTreeModifier.bySelector(oChange.getSelector(), oComponent);
418
+ const oLastDependentSelector = oChange.getDependentSelectorList().slice(-1)[0];
419
+ const oLastDependentSelectorControl = JsControlTreeModifier.bySelector(oLastDependentSelector, oComponent);
420
420
 
421
421
  // Recursively search through parent element structure
422
422
  // This is necessary to make sure that elements that were created during runtime
423
423
  // (e.g. for SimpleForms) are considered.
424
424
  function searchForCommand(oOverlay, sAggregationName) {
425
- var oControl = oOverlay.getElement();
426
- var sCommand = oOverlay.getDesignTimeMetadata().getCommandName(
425
+ const oControl = oOverlay.getElement();
426
+ const sCommand = oOverlay.getDesignTimeMetadata().getCommandName(
427
427
  oChange.getChangeType(),
428
428
  oControl,
429
429
  sAggregationName
@@ -432,8 +432,8 @@ sap.ui.define([
432
432
  return sCommand;
433
433
  }
434
434
 
435
- var oParentOverlay = oOverlay.getParentElementOverlay();
436
- var oParentAggregationOverlay = oOverlay.getParentAggregationOverlay();
435
+ const oParentOverlay = oOverlay.getParentElementOverlay();
436
+ const oParentAggregationOverlay = oOverlay.getParentAggregationOverlay();
437
437
  if (
438
438
  oOverlay.getElement().getId() === oSelectorControl.getId()
439
439
  || !oParentOverlay
@@ -452,8 +452,8 @@ sap.ui.define([
452
452
  };
453
453
 
454
454
  ChangeVisualization.prototype._collectChanges = function() {
455
- var oComponent = this._getComponent();
456
- var mPropertyBag = {
455
+ const oComponent = this._getComponent();
456
+ const mPropertyBag = {
457
457
  selector: oComponent,
458
458
  invalidateCache: false,
459
459
  includeCtrlVariants: true,
@@ -474,23 +474,23 @@ sap.ui.define([
474
474
  if (this._oChangeVisualizationModel.getData().displayedVersion !== "0") {
475
475
  this._oChangeIndicatorRegistry.reset();
476
476
  }
477
- var aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
478
- var oCurrentChanges = aChanges
477
+ const aRegisteredChangeIds = this._oChangeIndicatorRegistry.getRegisteredChangeIds();
478
+ const oCurrentChanges = aChanges
479
479
  .reduce(function(oChanges, oChange) {
480
480
  oChanges[oChange.getId()] = oChange;
481
481
  return oChanges;
482
482
  }, {});
483
- var aCurrentChangeIds = Object.keys(oCurrentChanges);
483
+ const aCurrentChangeIds = Object.keys(oCurrentChanges);
484
484
 
485
485
  // Remove registered changes which no longer exist
486
486
  difference(aRegisteredChangeIds, aCurrentChangeIds).forEach(function(sChangeIdToRemove) {
487
487
  this._oChangeIndicatorRegistry.removeRegisteredChange(sChangeIdToRemove);
488
488
  }.bind(this));
489
- var aPromises = [];
489
+ const aPromises = [];
490
490
  // Register missing changes
491
491
  difference(aCurrentChangeIds, aRegisteredChangeIds).forEach(function(sChangeIdToAdd) {
492
- var oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
493
- var sCommandName = this._getCommandForChange(oChangeToAdd);
492
+ const oChangeToAdd = oCurrentChanges[sChangeIdToAdd];
493
+ const sCommandName = this._getCommandForChange(oChangeToAdd);
494
494
  aPromises.push(this._oChangeIndicatorRegistry.registerChange(oChangeToAdd, sCommandName, this.oVersionsModel));
495
495
  }.bind(this));
496
496
  return Promise.all(aPromises);
@@ -498,14 +498,14 @@ sap.ui.define([
498
498
  };
499
499
 
500
500
  ChangeVisualization.prototype.selectChange = function(oEvent) {
501
- var sChangeId = oEvent.getParameter("changeId");
501
+ const sChangeId = oEvent.getParameter("changeId");
502
502
  this._selectChange(sChangeId);
503
503
  };
504
504
 
505
505
  ChangeVisualization.prototype._selectChange = function(sChangeId) {
506
- var aDependentElements = this._oChangeIndicatorRegistry.getRegisteredChange(sChangeId).visualizationInfo.dependentElementIds;
506
+ const aDependentElements = this._oChangeIndicatorRegistry.getRegisteredChange(sChangeId).visualizationInfo.dependentElementIds;
507
507
  aDependentElements.forEach(function(sElementId) {
508
- var oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
508
+ const oOverlayDomRef = OverlayRegistry.getOverlay(sElementId).getDomRef();
509
509
  oOverlayDomRef.scrollIntoView({
510
510
  block: "nearest"
511
511
  });
@@ -525,31 +525,33 @@ sap.ui.define([
525
525
  };
526
526
 
527
527
  ChangeVisualization.prototype._updateChangeIndicators = function() {
528
- var oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
529
- var oIndicators = {};
528
+ const oSelectors = this._oChangeIndicatorRegistry.getSelectorsWithRegisteredChanges();
529
+ const oIndicators = {};
530
530
  this._mDisplayElementsKeyMap = {};
531
+ const oConnectedElements = this._oDesignTime?.getSelectionManager?.().getConnectedElements();
531
532
  Object.keys(oSelectors).forEach(function(sSelectorId) {
532
- var aChangesOnIndicator = oSelectors[sSelectorId];
533
- var aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
534
- var oOverlay = _determineElementOverlay(sSelectorId, aChangesOnIndicator[0].affectedElementId);
533
+ const aChangesOnIndicator = oSelectors[sSelectorId];
534
+ const aRelevantChanges = this._filterRelevantChanges(oSelectors[sSelectorId]);
535
+ const oOverlay = _determineElementOverlay(sSelectorId, aChangesOnIndicator[0].affectedElementId);
535
536
 
536
537
  if (_isOverlayInvisible(oOverlay)) {
537
538
  // Change is not visible
538
539
  return undefined;
539
540
  }
540
- var oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
541
+ const oOverlayPosition = oOverlay.getDomRef().getClientRects()[0] || { left: 0, top: 0 };
541
542
  oIndicators[sSelectorId] = {
542
543
  posX: parseInt(oOverlayPosition.left),
543
544
  posY: parseInt(oOverlayPosition.top),
544
545
  changes: aRelevantChanges
545
546
  };
546
547
 
547
- var oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
548
- var sOverlayId = oOverlay.getId();
548
+ const oChangeIndicator = this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
549
+ const sOverlayId = oOverlay.getId();
550
+ const oConnectedElement = oConnectedElements?.[oOverlay.getAssociation("element")];
549
551
  if (!oChangeIndicator) {
550
- this._createChangeIndicator(oOverlay, sSelectorId);
552
+ this._createChangeIndicator(oOverlay, sSelectorId, oConnectedElement);
551
553
  // Assumption: all changes on an indicator affect the same elements
552
- var sDisplayElementsKey = aChangesOnIndicator[0].displayElementsKey;
554
+ const sDisplayElementsKey = aChangesOnIndicator[0].displayElementsKey;
553
555
  // This map is built to collect indicators with the same display elements (e.g. OP Section & AnchorBar)
554
556
  if (!this._mDisplayElementsKeyMap[sDisplayElementsKey]) {
555
557
  this._mDisplayElementsKeyMap[sDisplayElementsKey] = [sSelectorId];
@@ -563,8 +565,6 @@ sap.ui.define([
563
565
  return undefined;
564
566
  }.bind(this));
565
567
 
566
- this._registerIndicatorBrowserEvents();
567
-
568
568
  if (
569
569
  !deepEqual(
570
570
  oIndicators,
@@ -577,51 +577,11 @@ sap.ui.define([
577
577
  }
578
578
  };
579
579
 
580
- // Multiple indicators can refer to the same control (e.g. OP Section + AnchorBar),
581
- // so when one of them is hovered/focused the other must also react to show the connection between them
582
- ChangeVisualization.prototype._registerIndicatorBrowserEvents = function() {
583
- Object.keys(this._mDisplayElementsKeyMap).forEach(function(sDisplayElementsKey) {
584
- var aIndicators = this._mDisplayElementsKeyMap[sDisplayElementsKey].map(function(sSelectorId) {
585
- return this._oChangeIndicatorRegistry.getChangeIndicator(sSelectorId);
586
- }.bind(this));
587
-
588
- function onIndicatorInteraction(bActivate, oEvent) {
589
- aIndicators.forEach(function(oIndicator) {
590
- if (oIndicator.getVisible()) {
591
- oIndicator.onIndicatorBrowserInteraction(bActivate, oEvent);
592
- }
593
- });
594
- }
595
-
596
- // When the detail popover is opened all connected overlays should be selected
597
- function onDetailPopoverOpened(oEvent) {
598
- aIndicators.forEach(function(oIndicator) {
599
- if (oIndicator.getVisible()) {
600
- oIndicator.onDetailPopoverOpened(oEvent);
601
- }
602
- });
603
- }
604
-
605
- aIndicators.forEach(function(oIndicator) {
606
- oIndicator.attachBrowserEvent("mouseover", onIndicatorInteraction.bind(this, true));
607
- oIndicator.attachBrowserEvent("focusin", onIndicatorInteraction.bind(this, true));
608
- oIndicator.attachBrowserEvent("mouseout", onIndicatorInteraction.bind(this, false));
609
- oIndicator.attachBrowserEvent("focusout", onIndicatorInteraction.bind(this, false));
610
- oIndicator.attachDetailPopoverOpened(onDetailPopoverOpened.bind(this));
611
-
612
- var oOverlay = Element.getElementById(oIndicator.getOverlayId());
613
- // De-selection of connected overlays must happen when the hover/focus leaves the overlay
614
- oOverlay.attachBrowserEvent("mouseout", onIndicatorInteraction.bind(this, false));
615
- oOverlay.attachBrowserEvent("focusout", onIndicatorInteraction.bind(this, false));
616
- });
617
- }.bind(this));
618
- };
619
-
620
580
  ChangeVisualization.prototype._filterRelevantChanges = function(aChangeVizInfo) {
621
581
  if (!Array.isArray(aChangeVizInfo)) {
622
582
  return aChangeVizInfo;
623
583
  }
624
- var oRootData = this._oChangeVisualizationModel.getData();
584
+ const oRootData = this._oChangeVisualizationModel.getData();
625
585
 
626
586
  return aChangeVizInfo.filter(function(oChangeVizInfo) {
627
587
  return (
@@ -640,15 +600,16 @@ sap.ui.define([
640
600
  });
641
601
  };
642
602
 
643
- ChangeVisualization.prototype._createChangeIndicator = function(oOverlay, sSelectorId) {
644
- var oChangeIndicator = new ChangeIndicator({
603
+ ChangeVisualization.prototype._createChangeIndicator = function(oOverlay, sSelectorId, oConnectedElementId) {
604
+ const oChangeIndicator = new ChangeIndicator({
645
605
  changes: "{changes}",
646
606
  posX: "{posX}",
647
607
  posY: "{posY}",
648
608
  visible: "{= ${/active} && (${changes} || []).length > 0}",
649
609
  overlayId: oOverlay.getId(),
650
610
  selectorId: sSelectorId,
651
- selectChange: this.selectChange.bind(this)
611
+ selectChange: this.selectChange.bind(this),
612
+ connectedElementId: oConnectedElementId
652
613
  });
653
614
  oChangeIndicator.setModel(this._oChangeVisualizationModel);
654
615
  oChangeIndicator.bindElement(`/content/${sSelectorId}`);
@@ -660,42 +621,44 @@ sap.ui.define([
660
621
  // Sort the Indicators according XY-Position
661
622
  // Set the tabindex according the sorting
662
623
  // Focus the first visible indicator
663
- Core.applyChanges();
664
-
665
- var aVisibleIndicators = this._oChangeIndicatorRegistry.getChangeIndicators()
666
- .filter(function(oIndicator) {
667
- return oIndicator.getVisible();
668
- })
669
- .sort(function(oIndicator1, oIndicator2) {
670
- var iDeltaY = oIndicator1.getPosY() - oIndicator2.getPosY();
671
- var iDeltaX = oIndicator1.getPosX() - oIndicator2.getPosX();
672
- // Only consider x value if y is the same
673
- return iDeltaY || iDeltaX;
674
- });
624
+ this._oChangeIndicatorRegistry.waitForIndicatorRendering()
625
+ .then(() => {
626
+ const aVisibleIndicators = this._oChangeIndicatorRegistry.getChangeIndicators().filter((oIndicator) => {
627
+ // As setting the focus happens asynchronously after rendering,
628
+ // the overlay can be gone by the time this code is executed
629
+ return oIndicator.getVisible() && OverlayRegistry.getOverlay(oIndicator.getOverlayId());
630
+ })
631
+ .sort(function(oIndicator1, oIndicator2) {
632
+ const iDeltaY = oIndicator1.getPosY() - oIndicator2.getPosY();
633
+ const iDeltaX = oIndicator1.getPosX() - oIndicator2.getPosX();
634
+ // Only consider x value if y is the same
635
+ return iDeltaY || iDeltaX;
636
+ });
675
637
 
676
- if (aVisibleIndicators.length === 0) {
677
- return;
678
- }
638
+ if (aVisibleIndicators.length === 0) {
639
+ return;
640
+ }
679
641
 
680
- var aVisibleIndicatorsOnScrollPosition = [];
681
- aVisibleIndicators.forEach(function(oIndicator, iIndex) {
682
- oIndicator.getDomRef().tabIndex = iIndex + 2;
683
- // Indicators with posY < 0 are outside of the current scroll position
684
- if (oIndicator.getPosY() > 0) {
685
- aVisibleIndicatorsOnScrollPosition.push(oIndicator);
642
+ const aVisibleIndicatorsOnScrollPosition = [];
643
+ aVisibleIndicators.forEach(function(oIndicator, iIndex) {
644
+ oIndicator.getDomRef().tabIndex = iIndex + 2;
645
+ // Indicators with posY < 0 are outside of the current scroll position
646
+ if (oIndicator.getPosY() > 0) {
647
+ aVisibleIndicatorsOnScrollPosition.push(oIndicator);
648
+ }
649
+ });
650
+ if (aVisibleIndicatorsOnScrollPosition.length > 0) {
651
+ // Indicators visible with the current scroll position get focus
652
+ // to avoid unexpected scrolling when visualization is started
653
+ aVisibleIndicatorsOnScrollPosition[0].focus();
654
+ } else {
655
+ aVisibleIndicators[0].focus();
686
656
  }
687
657
  });
688
- if (aVisibleIndicatorsOnScrollPosition.length > 0) {
689
- // Indicators visible with the current scroll position get focus
690
- // to avoid unexpected scrolling when visualization is started
691
- aVisibleIndicatorsOnScrollPosition[0].focus();
692
- } else {
693
- aVisibleIndicators[0].focus();
694
- }
695
658
  };
696
659
 
697
660
  ChangeVisualization.prototype._toggleRootOverlayClickHandler = function(bEnable) {
698
- var oRootOverlayDomRef = this.oRootOverlay && this.oRootOverlay.getDomRef();
661
+ const oRootOverlayDomRef = this.oRootOverlay && this.oRootOverlay.getDomRef();
699
662
  if (oRootOverlayDomRef) {
700
663
  if (bEnable) {
701
664
  oRootOverlayDomRef.addEventListener(
@@ -755,6 +718,9 @@ sap.ui.define([
755
718
  oToolbar.adjustToolbarSectionWidths();
756
719
 
757
720
  this._updateVisualizationModelMenuData();
721
+ return this._oChangeIndicatorRegistry.waitForIndicatorRendering();
722
+ }.bind(this))
723
+ .then(function() {
758
724
  oToolbar.setModel(this._oChangeVisualizationModel, "visualizationModel");
759
725
  }.bind(this));
760
726
  };
@@ -1,22 +0,0 @@
1
- Copyright (c) <year> <owner>. All rights reserved.
2
-
3
- Redistribution and use in source and binary forms, with or without modification,
4
- are permitted provided that the following conditions are met:
5
-
6
- 1. Redistributions of source code must retain the above copyright notice,
7
- this list of conditions and the following disclaimer.
8
-
9
- 2. Redistributions in binary form must reproduce the above copyright notice,
10
- this list of conditions and the following disclaimer in the documentation
11
- and/or other materials provided with the distribution.
12
-
13
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
14
- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
17
- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
19
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
20
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
21
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
22
- USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.