@openui5/sap.ui.rta 1.120.6 → 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.
- package/.reuse/dep5 +23 -21
- package/THIRDPARTY.txt +6 -43
- package/package.json +6 -6
- package/src/sap/ui/rta/.library +1 -1
- package/src/sap/ui/rta/Client.js +1 -1
- package/src/sap/ui/rta/RuntimeAuthoring.js +507 -759
- package/src/sap/ui/rta/Utils.js +1 -146
- package/src/sap/ui/rta/appVariant/AppVariantDialog.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +3 -3
- package/src/sap/ui/rta/appVariant/Utils.js +3 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +5 -3
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_bg.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_en_US_saprigi.properties +27 -27
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_et.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fi.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_kk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_lv.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_mk.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_ru.properties +1 -1
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_th.properties +1 -1
- package/src/sap/ui/rta/command/AddIFrame.js +1 -1
- package/src/sap/ui/rta/command/AddProperty.js +1 -1
- package/src/sap/ui/rta/command/AddXML.js +1 -1
- package/src/sap/ui/rta/command/AddXMLAtExtensionPoint.js +3 -3
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +1 -1
- package/src/sap/ui/rta/command/BaseCommand.js +1 -1
- package/src/sap/ui/rta/command/BindProperty.js +1 -1
- package/src/sap/ui/rta/command/Combine.js +1 -1
- package/src/sap/ui/rta/command/CommandFactory.js +1 -1
- package/src/sap/ui/rta/command/CompositeCommand.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantConfigure.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSave.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSaveAs.js +7 -5
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +10 -4
- package/src/sap/ui/rta/command/CreateContainer.js +1 -1
- package/src/sap/ui/rta/command/CustomAdd.js +1 -1
- package/src/sap/ui/rta/command/FlexCommand.js +1 -1
- package/src/sap/ui/rta/command/LREPSerializer.js +4 -3
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/Move.js +1 -1
- package/src/sap/ui/rta/command/Property.js +1 -1
- package/src/sap/ui/rta/command/Remove.js +1 -1
- package/src/sap/ui/rta/command/Rename.js +1 -1
- package/src/sap/ui/rta/command/Resize.js +1 -1
- package/src/sap/ui/rta/command/Reveal.js +1 -1
- package/src/sap/ui/rta/command/Settings.js +1 -1
- package/src/sap/ui/rta/command/Split.js +1 -1
- package/src/sap/ui/rta/command/Stack.js +23 -1
- package/src/sap/ui/rta/command/appDescriptor/AddLibrary.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantContent.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSaveAs.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantSwitch.js +1 -1
- package/src/sap/ui/rta/command/compVariant/CompVariantUpdate.js +1 -1
- package/src/sap/ui/rta/enablement/elementActionTest.js +180 -258
- package/src/sap/ui/rta/library.js +3 -2
- package/src/sap/ui/rta/messagebundle.properties +8 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +4 -0
- package/src/sap/ui/rta/messagebundle_bg.properties +5 -1
- package/src/sap/ui/rta/messagebundle_ca.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cnr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_cs.properties +4 -0
- package/src/sap/ui/rta/messagebundle_cy.properties +8 -4
- package/src/sap/ui/rta/messagebundle_da.properties +4 -0
- package/src/sap/ui/rta/messagebundle_de.properties +5 -1
- package/src/sap/ui/rta/messagebundle_el.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_GB.properties +4 -0
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +322 -318
- package/src/sap/ui/rta/messagebundle_es.properties +4 -0
- package/src/sap/ui/rta/messagebundle_es_MX.properties +5 -1
- package/src/sap/ui/rta/messagebundle_et.properties +6 -2
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_fr.properties +5 -1
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_hr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_hu.properties +4 -0
- package/src/sap/ui/rta/messagebundle_id.properties +5 -1
- package/src/sap/ui/rta/messagebundle_it.properties +10 -6
- package/src/sap/ui/rta/messagebundle_iw.properties +9 -5
- package/src/sap/ui/rta/messagebundle_ja.properties +4 -0
- package/src/sap/ui/rta/messagebundle_kk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ko.properties +4 -0
- package/src/sap/ui/rta/messagebundle_lt.properties +5 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +11 -7
- package/src/sap/ui/rta/messagebundle_mk.properties +15 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +5 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +4 -0
- package/src/sap/ui/rta/messagebundle_no.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pl.properties +5 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +4 -0
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +4 -0
- package/src/sap/ui/rta/messagebundle_ro.properties +8 -4
- package/src/sap/ui/rta/messagebundle_ru.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +5 -1
- package/src/sap/ui/rta/messagebundle_sk.properties +4 -0
- package/src/sap/ui/rta/messagebundle_sl.properties +7 -3
- package/src/sap/ui/rta/messagebundle_sr.properties +6 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +4 -0
- package/src/sap/ui/rta/messagebundle_th.properties +9 -5
- package/src/sap/ui/rta/messagebundle_tr.properties +7 -3
- package/src/sap/ui/rta/messagebundle_uk.properties +5 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +4 -0
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +5 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +6 -2
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +16 -11
- package/src/sap/ui/rta/plugin/BaseCreate.js +1 -1
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +43 -1
- package/src/sap/ui/rta/plugin/ControlVariant.js +3 -2
- package/src/sap/ui/rta/plugin/CreateContainer.js +1 -1
- package/src/sap/ui/rta/plugin/CutPaste.js +1 -1
- package/src/sap/ui/rta/plugin/DragDrop.js +1 -1
- package/src/sap/ui/rta/plugin/EasyAdd.js +2 -2
- package/src/sap/ui/rta/plugin/EasyRemove.js +1 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +18 -10
- package/src/sap/ui/rta/plugin/RTAElementMover.js +1 -1
- package/src/sap/ui/rta/plugin/Remove.js +1 -1
- package/src/sap/ui/rta/plugin/Rename.js +1 -1
- package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +1 -1
- package/src/sap/ui/rta/plugin/Selection.js +24 -9
- package/src/sap/ui/rta/plugin/Settings.js +17 -15
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +14 -13
- package/src/sap/ui/rta/plugin/additionalElements/ActionExtractor.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AddElementsDialog.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +134 -67
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +6 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.fragment.xml +57 -47
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +21 -8
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialogController.js +56 -41
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +1 -1
- package/src/sap/ui/rta/service/Outline.js +22 -18
- package/src/sap/ui/rta/service/Property.js +1 -1
- package/src/sap/ui/rta/service/Selection.js +1 -1
- package/src/sap/ui/rta/service/SupportTools.js +23 -19
- package/src/sap/ui/rta/toolbar/Adaptation.js +16 -18
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +1 -1
- package/src/sap/ui/rta/toolbar/FioriLike.js +1 -1
- package/src/sap/ui/rta/toolbar/OverflowToolbarButton.js +1 -1
- package/src/sap/ui/rta/toolbar/Personalization.js +1 -1
- package/src/sap/ui/rta/toolbar/Standalone.js +1 -1
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsAdaptation.js +1 -1
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -1
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +12 -5
- package/src/sap/ui/rta/util/PluginManager.js +1 -1
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +19 -59
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +193 -0
- package/src/sap/ui/rta/util/adaptationStarter.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +90 -45
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +32 -25
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +98 -132
- package/LICENSES/BSD-2-Clause.txt +0 -22
|
@@ -41,6 +41,10 @@ sap.ui.define([
|
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
function isCompVariant(oElement) {
|
|
45
|
+
return oElement.getMetadata().getName() === "sap.ui.comp.smartvariants.SmartVariantManagement";
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
function createCommandAndFireEvent(oOverlay, aCommandNames, mProperties, oElement) {
|
|
45
49
|
var oDesignTimeMetadata = oOverlay.getDesignTimeMetadata();
|
|
46
50
|
var oTargetElement = oElement || oOverlay.getElement();
|
|
@@ -89,6 +93,43 @@ sap.ui.define([
|
|
|
89
93
|
this.startEdit(aOverlays[0]);
|
|
90
94
|
}
|
|
91
95
|
|
|
96
|
+
/**
|
|
97
|
+
* @override
|
|
98
|
+
*/
|
|
99
|
+
CompVariant.prototype.setDesignTime = function(oDesignTime) {
|
|
100
|
+
RenameHandler._setDesignTime.call(this, oDesignTime);
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Checks if variant rename is available for the overlay.
|
|
105
|
+
*
|
|
106
|
+
* @param {sap.ui.dt.ElementOverlay} oElementOverlay - Overlay object
|
|
107
|
+
* @return {boolean} <code>true</code> if available
|
|
108
|
+
* @public
|
|
109
|
+
*/
|
|
110
|
+
CompVariant.prototype.isRenameAvailable = function(oElementOverlay) {
|
|
111
|
+
const oVariantManagementControl = oElementOverlay.getElement();
|
|
112
|
+
if (isCompVariant(oVariantManagementControl)) {
|
|
113
|
+
const aVariants = getAllVariants(oElementOverlay);
|
|
114
|
+
const oCurrentVariant = aVariants.find(function(oVariant) {
|
|
115
|
+
return oVariant.getVariantId() === oVariantManagementControl.getPresentVariantId();
|
|
116
|
+
});
|
|
117
|
+
const sLayer = this.getCommandFactory().getFlexSettings().layer;
|
|
118
|
+
return oCurrentVariant.isRenameEnabled(sLayer);
|
|
119
|
+
}
|
|
120
|
+
return false;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Checks if variant rename is enabled for the overlays.
|
|
125
|
+
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
126
|
+
* @return {boolean} <code>true</code> if available
|
|
127
|
+
* @public
|
|
128
|
+
*/
|
|
129
|
+
CompVariant.prototype.isRenameEnabled = function(aElementOverlays) {
|
|
130
|
+
return this.isRenameAvailable(aElementOverlays[0]);
|
|
131
|
+
};
|
|
132
|
+
|
|
92
133
|
CompVariant.prototype.startEdit = function(oOverlay) {
|
|
93
134
|
var vDomRef = oOverlay.getDesignTimeMetadata().getData().variantRenameDomRef;
|
|
94
135
|
RenameHandler.startEdit.call(this, {
|
|
@@ -189,7 +230,8 @@ sap.ui.define([
|
|
|
189
230
|
MessageBox.Action.CANCEL
|
|
190
231
|
],
|
|
191
232
|
emphasizedAction: oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
192
|
-
styleClass: Utils.getRtaStyleClassName()
|
|
233
|
+
styleClass: Utils.getRtaStyleClassName(),
|
|
234
|
+
id: "compVariantWarningDialog"
|
|
193
235
|
});
|
|
194
236
|
} else {
|
|
195
237
|
createCommandAndFireEvent.call(this, oVariantManagementOverlay, ["compVariantSwitch"], {
|
|
@@ -51,7 +51,7 @@ sap.ui.define([
|
|
|
51
51
|
* @class The ControlVariant allows propagation of variantManagement key
|
|
52
52
|
* @extends sap.ui.rta.plugin.Plugin
|
|
53
53
|
* @author SAP SE
|
|
54
|
-
* @version 1.
|
|
54
|
+
* @version 1.121.0
|
|
55
55
|
* @constructor
|
|
56
56
|
* @private
|
|
57
57
|
* @since 1.50
|
|
@@ -428,7 +428,8 @@ sap.ui.define([
|
|
|
428
428
|
MessageBox.Action.CANCEL
|
|
429
429
|
],
|
|
430
430
|
emphasizedAction: oLibraryBundle.getText("BTN_MODIFIED_VARIANT_SAVE"),
|
|
431
|
-
styleClass: Utils.getRtaStyleClassName()
|
|
431
|
+
styleClass: Utils.getRtaStyleClassName(),
|
|
432
|
+
id: "controlVariantWarningDialog"
|
|
432
433
|
});
|
|
433
434
|
} else {
|
|
434
435
|
getCommandForSwitch.call(this, oTargetOverlay, sNewVariantReference, sCurrentVariantReference)
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The CreateContainer allows trigger CreateContainer operations on the overlay
|
|
26
26
|
* @extends sap.ui.rta.plugin.BaseCreate
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.121.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.34
|
|
@@ -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.
|
|
28
|
+
* @version 1.121.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.48
|
|
@@ -160,7 +160,7 @@ sap.ui.define([
|
|
|
160
160
|
* @private
|
|
161
161
|
*/
|
|
162
162
|
EasyAdd.prototype._addButton = function(oOverlay, fnCallback, oOverlayDom, sControlName, bOverlayIsSibling) {
|
|
163
|
-
var bIsEditable = oOverlay.getEditableByPlugins()
|
|
163
|
+
var bIsEditable = !!oOverlay.getEditableByPlugins()[this._retrievePluginName(bOverlayIsSibling)];
|
|
164
164
|
var oTextResources = Lib.getResourceBundleFor("sap.ui.rta");
|
|
165
165
|
|
|
166
166
|
var sId = `${oOverlay.getId()}-AddButton`;
|
|
@@ -25,7 +25,7 @@ sap.ui.define([
|
|
|
25
25
|
* @class The EasyRemove Plugin adds an Icon to an Overlay, which allows to trigger remove operations directly
|
|
26
26
|
* @extends sap.ui.rta.plugin.Remove
|
|
27
27
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
28
|
+
* @version 1.121.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.48
|
|
@@ -70,7 +70,7 @@ sap.ui.define([
|
|
|
70
70
|
* @extends sap.ui.dt.Plugin
|
|
71
71
|
*
|
|
72
72
|
* @author SAP SE
|
|
73
|
-
* @version 1.
|
|
73
|
+
* @version 1.121.0
|
|
74
74
|
*
|
|
75
75
|
* @constructor
|
|
76
76
|
* @private
|
|
@@ -292,8 +292,7 @@ sap.ui.define([
|
|
|
292
292
|
|
|
293
293
|
BasePlugin.prototype._isEditableByPlugin = function(oOverlay, bSibling) {
|
|
294
294
|
var sPluginName = this._retrievePluginName(bSibling);
|
|
295
|
-
|
|
296
|
-
return aPluginList.indexOf(sPluginName) > -1;
|
|
295
|
+
return !!oOverlay.getEditableByPlugins()[sPluginName];
|
|
297
296
|
};
|
|
298
297
|
|
|
299
298
|
BasePlugin.prototype.registerElementOverlay = function(oOverlay) {
|
|
@@ -365,18 +364,27 @@ sap.ui.define([
|
|
|
365
364
|
};
|
|
366
365
|
|
|
367
366
|
BasePlugin.prototype.removeFromPluginsList = function(oOverlay, bSibling) {
|
|
368
|
-
|
|
369
|
-
oOverlay.
|
|
370
|
-
|
|
367
|
+
const sName = this._retrievePluginName(bSibling);
|
|
368
|
+
const mEditableByPlugins = oOverlay.getEditableByPlugins();
|
|
369
|
+
oOverlay.setEditableByPlugins({
|
|
370
|
+
...mEditableByPlugins,
|
|
371
|
+
[sName]: false
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
// If there are no more plugins registered on the overlay, set editable to false
|
|
375
|
+
if (!Object.values(oOverlay.getEditableByPlugins()).some(Boolean)) {
|
|
371
376
|
oOverlay.setEditable(false);
|
|
372
377
|
}
|
|
373
378
|
};
|
|
374
379
|
|
|
375
380
|
BasePlugin.prototype.addToPluginsList = function(oOverlay, bSibling) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
if (
|
|
379
|
-
oOverlay.
|
|
381
|
+
const sName = this._retrievePluginName(bSibling);
|
|
382
|
+
const mEditableByPlugins = oOverlay.getEditableByPlugins();
|
|
383
|
+
if (!mEditableByPlugins[sName]) {
|
|
384
|
+
oOverlay.setEditableByPlugins({
|
|
385
|
+
...mEditableByPlugins,
|
|
386
|
+
[sName]: true
|
|
387
|
+
});
|
|
380
388
|
oOverlay.setEditable(true);
|
|
381
389
|
}
|
|
382
390
|
};
|
|
@@ -43,7 +43,7 @@ sap.ui.define([
|
|
|
43
43
|
* Provides Rename handling functionality
|
|
44
44
|
*
|
|
45
45
|
* @author SAP SE
|
|
46
|
-
* @version 1.
|
|
46
|
+
* @version 1.121.0
|
|
47
47
|
*
|
|
48
48
|
* @constructor
|
|
49
49
|
* @private
|
|
@@ -96,7 +96,7 @@ sap.ui.define([
|
|
|
96
96
|
var oEditableControlDomRef = oDesignTimeMetadata.getAssociatedDomRef(oElement, mPropertyBag.domRef);
|
|
97
97
|
|
|
98
98
|
// if the Control is currently not visible on the screen, we have to scroll it into view
|
|
99
|
-
if (!
|
|
99
|
+
if (!DOMUtil.isElementInViewport(oEditableControlDomRef)) {
|
|
100
100
|
oEditableControlDomRef.get(0).scrollIntoView();
|
|
101
101
|
}
|
|
102
102
|
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/base/util/restricted/_intersection",
|
|
9
8
|
"sap/m/InstanceManager",
|
|
10
|
-
"sap/ui/
|
|
9
|
+
"sap/ui/core/Element",
|
|
11
10
|
"sap/ui/dt/OverlayRegistry",
|
|
12
11
|
"sap/ui/dt/OverlayUtil",
|
|
13
12
|
"sap/ui/events/KeyCodes",
|
|
14
13
|
"sap/ui/rta/plugin/Plugin",
|
|
15
14
|
"sap/ui/rta/Utils"
|
|
16
|
-
],
|
|
17
|
-
function(
|
|
18
|
-
_intersection,
|
|
15
|
+
], function(
|
|
19
16
|
InstanceManager,
|
|
20
|
-
|
|
17
|
+
Element,
|
|
21
18
|
OverlayRegistry,
|
|
22
19
|
OverlayUtil,
|
|
23
20
|
KeyCodes,
|
|
@@ -34,7 +31,7 @@ function(
|
|
|
34
31
|
* @class The Selection plugin allows you to select or focus overlays with mouse or keyboard and navigate to others.
|
|
35
32
|
* @extends sap.ui.rta.plugin.Plugin
|
|
36
33
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
34
|
+
* @version 1.121.0
|
|
38
35
|
* @constructor
|
|
39
36
|
* @private
|
|
40
37
|
* @since 1.34
|
|
@@ -74,7 +71,9 @@ function(
|
|
|
74
71
|
var aSharedMultiSelectionPlugins = aMultiSelectionRequiredPlugins.slice();
|
|
75
72
|
|
|
76
73
|
aElementOverlays.forEach(function(oElementOverlay) {
|
|
77
|
-
aSharedMultiSelectionPlugins =
|
|
74
|
+
aSharedMultiSelectionPlugins = aSharedMultiSelectionPlugins.filter(function(sPlugin) {
|
|
75
|
+
return oElementOverlay.getEditableByPlugins()[sPlugin];
|
|
76
|
+
});
|
|
78
77
|
});
|
|
79
78
|
|
|
80
79
|
return aSharedMultiSelectionPlugins.length > 0;
|
|
@@ -201,6 +200,22 @@ function(
|
|
|
201
200
|
}
|
|
202
201
|
};
|
|
203
202
|
|
|
203
|
+
/**
|
|
204
|
+
* Returns the focused overlay
|
|
205
|
+
*
|
|
206
|
+
* @returns {sap.ui.dt.ElementOverlay} Overlay object
|
|
207
|
+
* @private
|
|
208
|
+
*/
|
|
209
|
+
Selection.prototype._getFocusedOverlay = function() {
|
|
210
|
+
if (document.activeElement) {
|
|
211
|
+
var oElement = Element.getElementById(document.activeElement.id);
|
|
212
|
+
if (oElement && oElement.isA("sap.ui.dt.ElementOverlay")) {
|
|
213
|
+
return oElement;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return undefined;
|
|
217
|
+
};
|
|
218
|
+
|
|
204
219
|
/**
|
|
205
220
|
* Handle keydown event
|
|
206
221
|
*
|
|
@@ -211,7 +226,7 @@ function(
|
|
|
211
226
|
if (!this.getIsActive()) {
|
|
212
227
|
return;
|
|
213
228
|
}
|
|
214
|
-
var oOverlay =
|
|
229
|
+
var oOverlay = this._getFocusedOverlay();
|
|
215
230
|
if (oEvent.keyCode === KeyCodes.ENTER) {
|
|
216
231
|
this._selectOverlay(oEvent);
|
|
217
232
|
} else if (oEvent.keyCode === KeyCodes.ARROW_UP && oEvent.shiftKey === false && oEvent.altKey === false) {
|
|
@@ -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.
|
|
28
|
+
* @version 1.121.0
|
|
29
29
|
* @constructor
|
|
30
30
|
* @private
|
|
31
31
|
* @since 1.44
|
|
@@ -79,15 +79,16 @@ sap.ui.define([
|
|
|
79
79
|
* @public
|
|
80
80
|
*/
|
|
81
81
|
Settings.prototype.isEnabled = function(aElementOverlays) {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
const oElementOverlay = aElementOverlays[0];
|
|
83
|
+
const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
|
|
84
|
+
const oAction = this.getAction(oResponsibleElementOverlay);
|
|
84
85
|
if (!oAction) {
|
|
85
86
|
return false;
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
if (typeof oAction.isEnabled !== "undefined") {
|
|
89
90
|
if (typeof oAction.isEnabled === "function") {
|
|
90
|
-
return oAction.isEnabled(
|
|
91
|
+
return oAction.isEnabled(oResponsibleElementOverlay.getElement());
|
|
91
92
|
}
|
|
92
93
|
return oAction.isEnabled;
|
|
93
94
|
}
|
|
@@ -248,32 +249,33 @@ sap.ui.define([
|
|
|
248
249
|
* @return {object[]} array of the items with required data
|
|
249
250
|
*/
|
|
250
251
|
Settings.prototype.getMenuItems = function(aElementOverlays) {
|
|
251
|
-
|
|
252
|
-
|
|
252
|
+
const oElementOverlay = aElementOverlays[0];
|
|
253
|
+
const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
|
|
254
|
+
let vSettingsActions = this.getAction(oResponsibleElementOverlay);
|
|
253
255
|
|
|
254
|
-
|
|
256
|
+
const aMenuItems = [];
|
|
255
257
|
if (vSettingsActions) {
|
|
256
|
-
|
|
258
|
+
const iRank = 110;
|
|
257
259
|
|
|
258
260
|
if (vSettingsActions.handler) {
|
|
259
261
|
vSettingsActions = {
|
|
260
262
|
settings: vSettingsActions
|
|
261
263
|
};
|
|
262
264
|
}
|
|
263
|
-
|
|
265
|
+
const aSettingsActions = Object.keys(vSettingsActions);
|
|
264
266
|
aSettingsActions.forEach(function(sSettingsAction, iIndex, aActions) {
|
|
265
|
-
|
|
267
|
+
const oSettingsAction = vSettingsActions[sSettingsAction];
|
|
266
268
|
if (
|
|
267
269
|
oSettingsAction.handler
|
|
268
|
-
&& this._checkRelevantContainerStableID(oSettingsAction,
|
|
269
|
-
&& this.isAvailable([
|
|
270
|
+
&& this._checkRelevantContainerStableID(oSettingsAction, oResponsibleElementOverlay)
|
|
271
|
+
&& this.isAvailable([oResponsibleElementOverlay])
|
|
270
272
|
) {
|
|
271
|
-
|
|
273
|
+
const bSingleAction = aActions.length === 1;
|
|
272
274
|
|
|
273
275
|
aMenuItems.push({
|
|
274
276
|
id: bSingleAction ? sPluginId : sPluginId + iIndex,
|
|
275
277
|
rank: bSingleAction ? iRank : iRank + iIndex,
|
|
276
|
-
text: this.getActionText(
|
|
278
|
+
text: this.getActionText(oResponsibleElementOverlay, oSettingsAction, sPluginId),
|
|
277
279
|
icon: getActionIcon(oSettingsAction),
|
|
278
280
|
enabled: (
|
|
279
281
|
typeof oSettingsAction.isEnabled === "function"
|
|
@@ -281,7 +283,7 @@ sap.ui.define([
|
|
|
281
283
|
return oSettingsAction.isEnabled(aElementOverlays[0].getElement());
|
|
282
284
|
}
|
|
283
285
|
|| oSettingsAction.isEnabled
|
|
284
|
-
|| this.isEnabled([
|
|
286
|
+
|| this.isEnabled([oResponsibleElementOverlay])
|
|
285
287
|
),
|
|
286
288
|
handler: function(fnHandler, aElementOverlays, mPropertyBag) {
|
|
287
289
|
mPropertyBag ||= {};
|
|
@@ -9,13 +9,11 @@ sap.ui.define([
|
|
|
9
9
|
"sap/ui/rta/plugin/Plugin",
|
|
10
10
|
"sap/ui/dt/OverlayRegistry",
|
|
11
11
|
"sap/ui/dt/OverlayUtil",
|
|
12
|
-
"sap/base/util/includes",
|
|
13
12
|
"sap/base/util/restricted/_debounce"
|
|
14
13
|
], function(
|
|
15
14
|
Plugin,
|
|
16
15
|
OverlayRegistry,
|
|
17
16
|
OverlayUtil,
|
|
18
|
-
includes,
|
|
19
17
|
_debounce
|
|
20
18
|
) {
|
|
21
19
|
"use strict";
|
|
@@ -31,7 +29,7 @@ sap.ui.define([
|
|
|
31
29
|
* @extends sap.ui.rta.plugin.Plugin
|
|
32
30
|
*
|
|
33
31
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
32
|
+
* @version 1.121.0
|
|
35
33
|
*
|
|
36
34
|
* @constructor
|
|
37
35
|
* @private
|
|
@@ -74,7 +72,6 @@ sap.ui.define([
|
|
|
74
72
|
oElement.removeStyleClass(Stretch.STRETCHSTYLECLASS);
|
|
75
73
|
}
|
|
76
74
|
} else {
|
|
77
|
-
// TODO: replace when Overlay.getAssociatedDomRef() does not return jQuery any more
|
|
78
75
|
var oElementDomRef = oOverlay.getAssociatedDomRef() && oOverlay.getAssociatedDomRef().get(0);
|
|
79
76
|
if (oElementDomRef) {
|
|
80
77
|
if (bAddClass) {
|
|
@@ -127,7 +124,8 @@ sap.ui.define([
|
|
|
127
124
|
}
|
|
128
125
|
|
|
129
126
|
/**
|
|
130
|
-
* Checks all the decendants for an editable child. Stops as soon as an editable is found
|
|
127
|
+
* Checks all the decendants for an editable child. Stops as soon as an editable is found
|
|
128
|
+
* or the children don't have the same size anymore.
|
|
131
129
|
*
|
|
132
130
|
* @param {sap.ui.dt.ElementOverlay} oReferenceOverlay - overlay object
|
|
133
131
|
* @param {sap.ui.dt.ElementOverlay[]} aChildOverlays - array of child overlay objects
|
|
@@ -184,7 +182,7 @@ sap.ui.define([
|
|
|
184
182
|
|
|
185
183
|
Stretch.prototype.addStretchCandidate = function(oOverlay) {
|
|
186
184
|
var oElement = oOverlay.getElement();
|
|
187
|
-
if (!
|
|
185
|
+
if (!this.getStretchCandidates().includes(oElement.getId())) {
|
|
188
186
|
this.addAssociation("stretchCandidates", oElement);
|
|
189
187
|
}
|
|
190
188
|
};
|
|
@@ -253,7 +251,7 @@ sap.ui.define([
|
|
|
253
251
|
|
|
254
252
|
this._aOverlaysCollected ||= [];
|
|
255
253
|
|
|
256
|
-
if (!
|
|
254
|
+
if (!this._aOverlaysCollected.includes(oOverlay)) {
|
|
257
255
|
this._aOverlaysCollected.push(oOverlay);
|
|
258
256
|
this.fnDebounced();
|
|
259
257
|
}
|
|
@@ -279,7 +277,8 @@ sap.ui.define([
|
|
|
279
277
|
};
|
|
280
278
|
|
|
281
279
|
/**
|
|
282
|
-
* When editable changes on an overlay, all parent-overlays and the overlay itself,
|
|
280
|
+
* When editable changes on an overlay, all parent-overlays and the overlay itself,
|
|
281
|
+
* who are already stretch candidates, have to be reevaluated
|
|
283
282
|
*
|
|
284
283
|
* @param {sap.ui.base.Event} oEvent event object
|
|
285
284
|
*/
|
|
@@ -302,7 +301,9 @@ sap.ui.define([
|
|
|
302
301
|
var aRelevantOverlays = this._getRelevantOverlays(oOverlay);
|
|
303
302
|
var fnDebounced = _debounce(function() {
|
|
304
303
|
if (!this.bIsDestroyed && !oOverlay.bIsDestroyed) {
|
|
305
|
-
var aNewStretchCandidates =
|
|
304
|
+
var aNewStretchCandidates =
|
|
305
|
+
this._getNewStretchCandidates(aRelevantOverlays)
|
|
306
|
+
.concat(this._getRelevantOverlaysOnEditableChange(oOverlay));
|
|
306
307
|
aNewStretchCandidates = aNewStretchCandidates.filter(function(sId, iPosition, aAllCandidates) {
|
|
307
308
|
return aAllCandidates.indexOf(sId) === iPosition;
|
|
308
309
|
});
|
|
@@ -328,7 +329,7 @@ sap.ui.define([
|
|
|
328
329
|
};
|
|
329
330
|
|
|
330
331
|
Stretch.prototype._getRelevantOverlaysOnEditableChange = function(oOverlay) {
|
|
331
|
-
var aRelevantElements =
|
|
332
|
+
var aRelevantElements = this.getStretchCandidates().includes(oOverlay.getElement().getId()) ? [oOverlay.getElement().getId()] : [];
|
|
332
333
|
var oParentAggregationOverlay = oOverlay.getParentAggregationOverlay();
|
|
333
334
|
if (!oParentAggregationOverlay) {
|
|
334
335
|
return aRelevantElements;
|
|
@@ -358,12 +359,13 @@ sap.ui.define([
|
|
|
358
359
|
return aReturn;
|
|
359
360
|
}
|
|
360
361
|
|
|
361
|
-
if (!
|
|
362
|
+
if (!this.getStretchCandidates().includes(oOverlay.getElement().getId())) {
|
|
362
363
|
return aReturn;
|
|
363
364
|
}
|
|
364
365
|
|
|
365
366
|
aReturn.push(oOverlay.getElement().getId());
|
|
366
367
|
}
|
|
368
|
+
return aReturn;
|
|
367
369
|
};
|
|
368
370
|
|
|
369
371
|
Stretch.prototype._getNewStretchCandidates = function(aOverlays) {
|
|
@@ -379,7 +381,6 @@ sap.ui.define([
|
|
|
379
381
|
|
|
380
382
|
Stretch.prototype._reevaluateStretching = function(oOverlay) {
|
|
381
383
|
if (!oOverlay.bIsDestroyed) {
|
|
382
|
-
// TODO: replace when getAssociatedDomRef does not return jQuery any more
|
|
383
384
|
var oElementDomRef = oOverlay.getAssociatedDomRef() && oOverlay.getAssociatedDomRef().get(0);
|
|
384
385
|
if (oElementDomRef) {
|
|
385
386
|
var bIsStretched = oElementDomRef.classList.contains(Stretch.STRETCHSTYLECLASS);
|
|
@@ -392,11 +393,11 @@ sap.ui.define([
|
|
|
392
393
|
}
|
|
393
394
|
}
|
|
394
395
|
}
|
|
396
|
+
return false;
|
|
395
397
|
};
|
|
396
398
|
|
|
397
399
|
Stretch.prototype._checkParentAndAddToStretchCandidates = function(oOverlay) {
|
|
398
400
|
var oParentOverlay = oOverlay.getParentElementOverlay();
|
|
399
|
-
// TODO: replace when getAssociatedDomRef does not return jQuery any more
|
|
400
401
|
var oParentElementDOM = oParentOverlay && oParentOverlay.getAssociatedDomRef() && oParentOverlay.getAssociatedDomRef().get(0);
|
|
401
402
|
if (oParentElementDOM) {
|
|
402
403
|
if (startAtSamePosition(oParentOverlay, oOverlay)) {
|