@openui5/sap.ui.rta 1.133.1 → 1.135.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 +0 -7
- package/THIRDPARTY.txt +2 -23
- 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 +38 -17
- package/src/sap/ui/rta/Utils.js +11 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +26 -26
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +0 -4
- package/src/sap/ui/rta/appVariant/Feature.js +85 -91
- package/src/sap/ui/rta/appVariant/Utils.js +50 -56
- package/src/sap/ui/rta/appVariant/manageApps/webapp/controller/ManageApps.controller.js +30 -30
- package/src/sap/ui/rta/appVariant/manageApps/webapp/i18n/i18n_fr_CA.properties +2 -2
- 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 +1 -1
- package/src/sap/ui/rta/command/AnnotationCommand.js +65 -5
- 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 +71 -47
- package/src/sap/ui/rta/command/CompositeCommand.js +12 -12
- 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 +1 -1
- package/src/sap/ui/rta/command/ControlVariantSetTitle.js +1 -1
- package/src/sap/ui/rta/command/ControlVariantSwitch.js +1 -1
- 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/ExtendControllerCommand.js +92 -0
- package/src/sap/ui/rta/command/FlexCommand.js +54 -43
- package/src/sap/ui/rta/command/LREPSerializer.js +23 -23
- package/src/sap/ui/rta/command/LocalReset.js +1 -1
- package/src/sap/ui/rta/command/ManifestCommand.js +112 -0
- 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 +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/command/{appDescriptor → manifest}/AddLibrary.js +10 -10
- package/src/sap/ui/rta/enablement/elementActionTest.js +1 -7
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +22 -7
- package/src/sap/ui/rta/messagebundle_ar.properties +3 -1
- package/src/sap/ui/rta/messagebundle_bg.properties +4 -2
- package/src/sap/ui/rta/messagebundle_ca.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cnr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_cs.properties +3 -1
- package/src/sap/ui/rta/messagebundle_cy.properties +3 -1
- package/src/sap/ui/rta/messagebundle_da.properties +4 -2
- package/src/sap/ui/rta/messagebundle_de.properties +3 -1
- package/src/sap/ui/rta/messagebundle_el.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_GB.properties +3 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +10 -2
- package/src/sap/ui/rta/messagebundle_es.properties +3 -1
- package/src/sap/ui/rta/messagebundle_es_MX.properties +4 -2
- package/src/sap/ui/rta/messagebundle_et.properties +3 -1
- package/src/sap/ui/rta/messagebundle_fi.properties +4 -2
- package/src/sap/ui/rta/messagebundle_fr.properties +12 -10
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +7 -5
- package/src/sap/ui/rta/messagebundle_hi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_hr.properties +34 -32
- package/src/sap/ui/rta/messagebundle_hu.properties +3 -1
- package/src/sap/ui/rta/messagebundle_id.properties +3 -1
- package/src/sap/ui/rta/messagebundle_it.properties +48 -46
- package/src/sap/ui/rta/messagebundle_iw.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ja.properties +3 -1
- package/src/sap/ui/rta/messagebundle_kk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ko.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_lv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_mk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ms.properties +3 -1
- package/src/sap/ui/rta/messagebundle_nl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_no.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt.properties +3 -1
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ro.properties +3 -1
- package/src/sap/ui/rta/messagebundle_ru.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sh.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sl.properties +3 -1
- package/src/sap/ui/rta/messagebundle_sr.properties +4 -2
- package/src/sap/ui/rta/messagebundle_sv.properties +3 -1
- package/src/sap/ui/rta/messagebundle_th.properties +3 -1
- package/src/sap/ui/rta/messagebundle_tr.properties +3 -1
- package/src/sap/ui/rta/messagebundle_uk.properties +3 -1
- package/src/sap/ui/rta/messagebundle_vi.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +3 -1
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +3 -1
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +41 -35
- package/src/sap/ui/rta/plugin/AddXMLPlugin.js +168 -0
- 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/ControlVariant.js +1 -1
- 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/ExtendControllerPlugin.js +161 -0
- package/src/sap/ui/rta/plugin/LocalReset.js +1 -1
- package/src/sap/ui/rta/plugin/Plugin.js +7 -4
- 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 +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +71 -61
- package/src/sap/ui/rta/plugin/Split.js +1 -1
- package/src/sap/ui/rta/plugin/Stretch.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +1 -1
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.fragment.xml +38 -51
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialog.js +85 -47
- package/src/sap/ui/rta/plugin/annotations/AnnotationChangeDialogController.js +97 -33
- package/src/sap/ui/rta/plugin/annotations/AnnotationPlugin.js +72 -17
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +1 -1
- package/src/sap/ui/rta/plugin/iframe/AddIFrameDialog.js +1 -1
- package/src/sap/ui/rta/service/Action.js +1 -1
- package/src/sap/ui/rta/service/ControllerExtension.js +10 -4
- package/src/sap/ui/rta/service/Outline.js +1 -1
- 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 +1 -1
- package/src/sap/ui/rta/themes/base/Toolbar.adaptation.less +5 -0
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +21 -3
- package/src/sap/ui/rta/toolbar/Adaptation.js +33 -7
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/Fiori.js +4 -3
- 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/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 +1 -1
- package/src/sap/ui/rta/util/Animation.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +1 -1
- package/src/sap/ui/rta/util/PluginManager.js +5 -7
- package/src/sap/ui/rta/util/PopupManager.js +1 -1
- package/src/sap/ui/rta/util/ReloadManager.js +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/ServiceManager.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +2 -2
- package/src/sap/ui/rta/util/isReuseComponent.js +44 -0
- package/src/sap/ui/rta/util/validateText.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNew.js +1 -1
- package/src/sap/ui/rta/util/whatsNew/WhatsNewUtils.js +12 -7
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +0 -5
- package/src/sap/ui/rta/command/AppDescriptorCommand.js +0 -114
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2025 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
sap.ui.define([
|
|
8
|
+
"sap/ui/dt/Util",
|
|
9
|
+
"sap/ui/fl/Utils",
|
|
10
|
+
"sap/ui/rta/plugin/Plugin",
|
|
11
|
+
"sap/ui/rta/util/isReuseComponent",
|
|
12
|
+
"sap/ui/rta/Utils"
|
|
13
|
+
], function(
|
|
14
|
+
DtUtil,
|
|
15
|
+
FlUtils,
|
|
16
|
+
Plugin,
|
|
17
|
+
isReuseComponent,
|
|
18
|
+
RtaUtils
|
|
19
|
+
) {
|
|
20
|
+
"use strict";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @typedef {function} sap.ui.rta.plugin.ExtendController.handlerFunction
|
|
25
|
+
* @since 1.134
|
|
26
|
+
* @param {sap.ui.dt.ElementOverlay} oOverlay - Target overlay for where XML will be added
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Constructor for a new ExtendController plugin.
|
|
30
|
+
* The controller handler <code>{@link sap.ui.rta.plugin.ExtendController.handlerFunction HandlerFunction}</code>
|
|
31
|
+
* is a callback function that needs to be passed on instantiation of the plugin or alternatively into the
|
|
32
|
+
* propertyBag when the handler function is called.
|
|
33
|
+
*
|
|
34
|
+
* @class
|
|
35
|
+
* @extends sap.ui.rta.plugin.Plugin
|
|
36
|
+
* @author SAP SE
|
|
37
|
+
* @version 1.135.0
|
|
38
|
+
* @constructor
|
|
39
|
+
* @private
|
|
40
|
+
* @since 1.134
|
|
41
|
+
* @alias sap.ui.rta.plugin.ExtendControllerPlugin
|
|
42
|
+
*/
|
|
43
|
+
const ExtendControllerPlugin = Plugin
|
|
44
|
+
.extend("sap.ui.rta.plugin.ExtendController", /** @lends sap.ui.rta.plugin.ExtendControllerPlugin.prototype */ {
|
|
45
|
+
metadata: {
|
|
46
|
+
library: "sap.ui.rta",
|
|
47
|
+
properties: {
|
|
48
|
+
handlerFunction: {
|
|
49
|
+
type: "function"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
associations: {},
|
|
53
|
+
events: {}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const FLEX_CHANGE_TYPE = "codeExt";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Check if the given overlay should be editable.
|
|
61
|
+
*
|
|
62
|
+
* @param {sap.ui.dt.ElementOverlay} oOverlay - Overlay to be checked for editable
|
|
63
|
+
* @returns {Promise<boolean>} <code>true</code> when editable wrapped in a promise
|
|
64
|
+
* @private
|
|
65
|
+
*/
|
|
66
|
+
ExtendControllerPlugin.prototype._isEditable = async function(oOverlay) {
|
|
67
|
+
const oComponent = FlUtils.getComponentForControl(oOverlay.getElement());
|
|
68
|
+
const bIsS4HanaCloud = RtaUtils.isS4HanaCloud();
|
|
69
|
+
if (
|
|
70
|
+
bIsS4HanaCloud ||
|
|
71
|
+
isReuseComponent(oComponent)
|
|
72
|
+
) {
|
|
73
|
+
return false;
|
|
74
|
+
}
|
|
75
|
+
const bHasChangeHandler = await this.hasChangeHandler(FLEX_CHANGE_TYPE, oOverlay.getElement());
|
|
76
|
+
return bHasChangeHandler;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Checks if ExtendController is enabled for the given overlays
|
|
81
|
+
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
82
|
+
* @returns {boolean} <code>true</code> if enabled
|
|
83
|
+
* @public
|
|
84
|
+
*/
|
|
85
|
+
ExtendControllerPlugin.prototype.isEnabled = function(aElementOverlays) {
|
|
86
|
+
const bEnabled = aElementOverlays.length === 1;
|
|
87
|
+
return bEnabled;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
function handleExtendControllerCommand(mExtendControllerData, oElement) {
|
|
91
|
+
const mExtendControllerSettings = {
|
|
92
|
+
codeRef: mExtendControllerData.codeRef,
|
|
93
|
+
viewId: mExtendControllerData.viewId
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
return this.getCommandFactory().getCommandFor(
|
|
97
|
+
oElement,
|
|
98
|
+
FLEX_CHANGE_TYPE,
|
|
99
|
+
mExtendControllerSettings
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Triggers the plugin execution.
|
|
105
|
+
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
106
|
+
* @param {Object} mPropertyBag - Property bag
|
|
107
|
+
* @param {sap.ui.rta.plugin.ExtentController.handlerFunction} [mPropertyBag.handlerFunction] - Handler function for controller handling. The controller handler is a callback function that needs to be passed here into the <code>propertyBag</code> or alternatively on instantiation of the plugin.
|
|
108
|
+
* @returns {Promise} Resolves when handler is executed successfully
|
|
109
|
+
*/
|
|
110
|
+
ExtendControllerPlugin.prototype.handler = async function(aElementOverlays, mPropertyBag) {
|
|
111
|
+
try {
|
|
112
|
+
const fnControllerHandler = mPropertyBag.handlerFunction || this.getHandlerFunction();
|
|
113
|
+
if (!fnControllerHandler) {
|
|
114
|
+
throw Error("Controller handler function is not available in the handler");
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const oElementOverlay = aElementOverlays[0];
|
|
118
|
+
|
|
119
|
+
const mExtendControllerData = await fnControllerHandler(oElementOverlay);
|
|
120
|
+
|
|
121
|
+
const oExtendControllerCommand = await handleExtendControllerCommand.call(
|
|
122
|
+
this,
|
|
123
|
+
mExtendControllerData,
|
|
124
|
+
oElementOverlay.getElement()
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
this.fireElementModified({
|
|
128
|
+
command: oExtendControllerCommand
|
|
129
|
+
});
|
|
130
|
+
} catch (vError) {
|
|
131
|
+
throw DtUtil.propagateError(
|
|
132
|
+
vError,
|
|
133
|
+
"ExtentController#handler",
|
|
134
|
+
"Error occurred in ExtentController handler function",
|
|
135
|
+
"sap.ui.rta"
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Retrieves the context menu item for the action.
|
|
142
|
+
* @param {sap.ui.dt.ElementOverlay[]} aElementOverlays - Target overlays
|
|
143
|
+
* @returns {object[]} Array of the items with required data
|
|
144
|
+
*/
|
|
145
|
+
ExtendControllerPlugin.prototype.getMenuItems = function(aElementOverlays) {
|
|
146
|
+
return this._getMenuItems(aElementOverlays, {
|
|
147
|
+
pluginId: "CTX_EXTEND_CONTROLLER",
|
|
148
|
+
icon: "sap-icon://create-form"
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Gets the name of the action related to this plugin.
|
|
154
|
+
* @returns {string} Action name
|
|
155
|
+
*/
|
|
156
|
+
ExtendControllerPlugin.prototype.getActionName = function() {
|
|
157
|
+
return "extendController";
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return ExtendControllerPlugin;
|
|
161
|
+
});
|
|
@@ -27,6 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
// The ranks define the order of the plugin actions in the context menu
|
|
28
28
|
const CONTEXT_MENU_RANKS = {
|
|
29
29
|
CTX_RENAME: 10,
|
|
30
|
+
CTX_ANNOTATION_CHANGE_SINGLE_LABEL: 12,
|
|
30
31
|
CTX_ADD_ELEMENTS_AS_SIBLING: 20,
|
|
31
32
|
CTX_ADD_ELEMENTS_AS_CHILD: 25,
|
|
32
33
|
CTX_ADD_ELEMENTS_CHILD_AND_SIBLING: 30,
|
|
@@ -39,12 +40,12 @@ sap.ui.define([
|
|
|
39
40
|
CTX_GROUP_FIELDS: 90,
|
|
40
41
|
CTX_UNGROUP_FIELDS: 100,
|
|
41
42
|
CTX_ADDXML_AT_EXTENSIONPOINT: 105,
|
|
43
|
+
CTX_ADDXML: 106,
|
|
44
|
+
CTX_EXTEND_CONTROLLER: 107,
|
|
42
45
|
// Settings ranks go up 1 by 1 for each setting
|
|
43
46
|
CTX_SETTINGS: 110,
|
|
44
47
|
// IFrame ranks go up 1 by 1 for each possible child target
|
|
45
48
|
CTX_CREATE_SIBLING_IFRAME: 130,
|
|
46
|
-
// Annotation ranks go up 1 by 1 for each action
|
|
47
|
-
CTX_ANNOTATION: 140,
|
|
48
49
|
// Variant types are mutually exclusive
|
|
49
50
|
CTX_VARIANT_SET_TITLE: 200,
|
|
50
51
|
CTX_COMP_VARIANT_RENAME: 200,
|
|
@@ -56,7 +57,9 @@ sap.ui.define([
|
|
|
56
57
|
CTX_COMP_VARIANT_MANAGE: 230,
|
|
57
58
|
CTX_VARIANT_SWITCH_SUBMENU: 240,
|
|
58
59
|
CTX_COMP_VARIANT_SWITCH: 240,
|
|
59
|
-
CTX_COMP_VARIANT_CONTENT: 250
|
|
60
|
+
CTX_COMP_VARIANT_CONTENT: 250,
|
|
61
|
+
// Annotation ranks go up 1 by 1 for each action
|
|
62
|
+
CTX_ANNOTATION: 300
|
|
60
63
|
};
|
|
61
64
|
|
|
62
65
|
function _handleEditableByPlugin(mPropertyBag, aPromises, oSourceElementOverlay) {
|
|
@@ -105,7 +108,7 @@ sap.ui.define([
|
|
|
105
108
|
* @extends sap.ui.dt.Plugin
|
|
106
109
|
*
|
|
107
110
|
* @author SAP SE
|
|
108
|
-
* @version 1.
|
|
111
|
+
* @version 1.135.0
|
|
109
112
|
*
|
|
110
113
|
* @constructor
|
|
111
114
|
* @private
|
|
@@ -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.135.0
|
|
47
47
|
*
|
|
48
48
|
* @constructor
|
|
49
49
|
* @private
|
|
@@ -474,4 +474,4 @@ sap.ui.define([
|
|
|
474
474
|
}
|
|
475
475
|
};
|
|
476
476
|
return RenameHandler;
|
|
477
|
-
}
|
|
477
|
+
});
|
|
@@ -31,7 +31,7 @@ sap.ui.define([
|
|
|
31
31
|
* @class The Selection plugin allows you to select or focus overlays with mouse or keyboard and navigate to others.
|
|
32
32
|
* @extends sap.ui.rta.plugin.Plugin
|
|
33
33
|
* @author SAP SE
|
|
34
|
-
* @version 1.
|
|
34
|
+
* @version 1.135.0
|
|
35
35
|
* @constructor
|
|
36
36
|
* @private
|
|
37
37
|
* @since 1.34
|
|
@@ -28,13 +28,13 @@ sap.ui.define([
|
|
|
28
28
|
* @class The Settings allows trigger change of settings operations on the overlay
|
|
29
29
|
* @extends sap.ui.rta.plugin.Plugin
|
|
30
30
|
* @author SAP SE
|
|
31
|
-
* @version 1.
|
|
31
|
+
* @version 1.135.0
|
|
32
32
|
* @constructor
|
|
33
33
|
* @private
|
|
34
34
|
* @since 1.44
|
|
35
35
|
* @alias sap.ui.rta.plugin.Settings
|
|
36
36
|
*/
|
|
37
|
-
|
|
37
|
+
const Settings = Plugin.extend("sap.ui.rta.plugin.Settings", /** @lends sap.ui.rta.plugin.Settings.prototype */ {
|
|
38
38
|
metadata: {
|
|
39
39
|
library: "sap.ui.rta",
|
|
40
40
|
associations: {},
|
|
@@ -42,7 +42,27 @@ sap.ui.define([
|
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
const sPluginId = "CTX_SETTINGS";
|
|
46
|
+
|
|
47
|
+
function getValidActions(vSettingsAction, oOverlay) {
|
|
48
|
+
if (vSettingsAction.handler) {
|
|
49
|
+
return [vSettingsAction];
|
|
50
|
+
}
|
|
51
|
+
const aSettingsActions = [];
|
|
52
|
+
Object.keys(vSettingsAction).forEach((sSettingsAction) => {
|
|
53
|
+
let oSettingsAction = vSettingsAction[sSettingsAction];
|
|
54
|
+
if (typeof oSettingsAction === "function") {
|
|
55
|
+
oSettingsAction = oSettingsAction(oOverlay.getElement());
|
|
56
|
+
}
|
|
57
|
+
if (oSettingsAction.handler) {
|
|
58
|
+
oSettingsAction.key = sSettingsAction;
|
|
59
|
+
aSettingsActions.push(oSettingsAction);
|
|
60
|
+
} else {
|
|
61
|
+
BaseLog.warning("Handler not found for settings action");
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
return aSettingsActions;
|
|
65
|
+
}
|
|
46
66
|
|
|
47
67
|
/**
|
|
48
68
|
* @param {sap.ui.dt.ElementOverlay} oOverlay overlay to be checked for editable
|
|
@@ -50,20 +70,13 @@ sap.ui.define([
|
|
|
50
70
|
* @private
|
|
51
71
|
*/
|
|
52
72
|
Settings.prototype._isEditable = function(oOverlay) {
|
|
53
|
-
|
|
73
|
+
const vSettingsAction = this.getAction(oOverlay);
|
|
54
74
|
// If no additional actions are defined in settings, a handler must be present to make it available
|
|
55
75
|
if (vSettingsAction) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
var bHandlerAndStableIdFound = Object.keys(vSettingsAction).some(function(sSettingsAction) {
|
|
61
|
-
var oSettingsAction = vSettingsAction[sSettingsAction];
|
|
62
|
-
return oSettingsAction.handler && this._checkRelevantContainerStableID(oSettingsAction, oOverlay);
|
|
63
|
-
}.bind(this));
|
|
64
|
-
if (bHandlerAndStableIdFound) {
|
|
65
|
-
return this.hasStableId(oOverlay);
|
|
66
|
-
}
|
|
76
|
+
const aSettingsActions = getValidActions(vSettingsAction, oOverlay);
|
|
77
|
+
return aSettingsActions.some((oSettingsAction) => {
|
|
78
|
+
return this._checkRelevantContainerStableID(oSettingsAction, oOverlay);
|
|
79
|
+
});
|
|
67
80
|
}
|
|
68
81
|
|
|
69
82
|
return false;
|
|
@@ -79,24 +92,27 @@ sap.ui.define([
|
|
|
79
92
|
Settings.prototype.isEnabled = function(aElementOverlays) {
|
|
80
93
|
const oElementOverlay = aElementOverlays[0];
|
|
81
94
|
const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
|
|
82
|
-
const
|
|
83
|
-
if (
|
|
84
|
-
|
|
95
|
+
const vSettingsAction = this.getAction(oResponsibleElementOverlay);
|
|
96
|
+
if (vSettingsAction) {
|
|
97
|
+
const oSettingsActions = getValidActions(vSettingsAction, oResponsibleElementOverlay);
|
|
98
|
+
return oSettingsActions.some((oSettingsAction) => {
|
|
99
|
+
if (typeof oSettingsAction.isEnabled !== "undefined") {
|
|
100
|
+
if (typeof oSettingsAction.isEnabled === "function") {
|
|
101
|
+
return oSettingsAction.isEnabled(oResponsibleElementOverlay.getElement());
|
|
102
|
+
}
|
|
103
|
+
return oSettingsAction.isEnabled;
|
|
104
|
+
}
|
|
105
|
+
return !!oSettingsAction.handler;
|
|
106
|
+
});
|
|
85
107
|
}
|
|
86
108
|
|
|
87
|
-
|
|
88
|
-
if (typeof oAction.isEnabled === "function") {
|
|
89
|
-
return oAction.isEnabled(oResponsibleElementOverlay.getElement());
|
|
90
|
-
}
|
|
91
|
-
return oAction.isEnabled;
|
|
92
|
-
}
|
|
93
|
-
return true;
|
|
109
|
+
return false;
|
|
94
110
|
};
|
|
95
111
|
|
|
96
112
|
Settings.prototype._getUnsavedChanges = function(sId, aChangeTypes) {
|
|
97
|
-
|
|
113
|
+
let sElementId;
|
|
98
114
|
|
|
99
|
-
|
|
115
|
+
const aUnsavedChanges = this.getCommandStack().getAllExecutedCommands().filter(function(oCommand) {
|
|
100
116
|
sElementId = oCommand.getElementId && oCommand.getElementId() || oCommand.getElement && oCommand.getElement().getId();
|
|
101
117
|
return sElementId === sId && aChangeTypes.indexOf(oCommand.getChangeType()) >= 0;
|
|
102
118
|
}).map(function(oCommand) {
|
|
@@ -107,12 +123,12 @@ sap.ui.define([
|
|
|
107
123
|
};
|
|
108
124
|
|
|
109
125
|
Settings.prototype._handleFlexChangeCommand = function(mChange, aSelectedOverlays, oCompositeCommand, oSettingsAction) {
|
|
110
|
-
|
|
111
|
-
|
|
126
|
+
const mChangeSpecificData = mChange.changeSpecificData;
|
|
127
|
+
let sVariantManagementReference;
|
|
112
128
|
// temporarily support both
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
129
|
+
const vSelector = mChange.selectorElement || mChange.selectorControl;
|
|
130
|
+
let sControlType;
|
|
131
|
+
let oControl;
|
|
116
132
|
|
|
117
133
|
if (vSelector.controlType) {
|
|
118
134
|
sControlType = vSelector.controlType;
|
|
@@ -134,7 +150,7 @@ sap.ui.define([
|
|
|
134
150
|
);
|
|
135
151
|
}.bind(this))
|
|
136
152
|
.then(function(oSettingsCommand) {
|
|
137
|
-
|
|
153
|
+
const bRuntimeOnly = oSettingsAction.runtimeOnly;
|
|
138
154
|
if (oSettingsCommand && bRuntimeOnly) {
|
|
139
155
|
oSettingsCommand.setRuntimeOnly(bRuntimeOnly);
|
|
140
156
|
}
|
|
@@ -142,15 +158,15 @@ sap.ui.define([
|
|
|
142
158
|
});
|
|
143
159
|
};
|
|
144
160
|
|
|
145
|
-
Settings.prototype.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
161
|
+
Settings.prototype._handleManifestChangeCommand = function(mChange, oElement, oCompositeCommand) {
|
|
162
|
+
const mChangeSpecificData = mChange.changeSpecificData;
|
|
163
|
+
const oComponent = mChange.appComponent;
|
|
164
|
+
const mManifest = oComponent.getManifest();
|
|
165
|
+
const sReference = mManifest["sap.app"].id;
|
|
150
166
|
|
|
151
167
|
return this.getCommandFactory().getCommandFor(
|
|
152
168
|
oElement,
|
|
153
|
-
"
|
|
169
|
+
"manifest",
|
|
154
170
|
{
|
|
155
171
|
reference: sReference,
|
|
156
172
|
appComponent: oComponent,
|
|
@@ -159,13 +175,13 @@ sap.ui.define([
|
|
|
159
175
|
texts: mChangeSpecificData.content.texts
|
|
160
176
|
}
|
|
161
177
|
)
|
|
162
|
-
.then(function(
|
|
163
|
-
return oCompositeCommand.addCommand(
|
|
178
|
+
.then(function(oManifestCommand) {
|
|
179
|
+
return oCompositeCommand.addCommand(oManifestCommand);
|
|
164
180
|
});
|
|
165
181
|
};
|
|
166
182
|
|
|
167
183
|
Settings.prototype._handleCompositeCommand = function(aElementOverlays, oElement, aChanges, oSettingsAction) {
|
|
168
|
-
|
|
184
|
+
let oCompositeCommand;
|
|
169
185
|
|
|
170
186
|
return this.getCommandFactory().getCommandFor(oElement, "composite")
|
|
171
187
|
|
|
@@ -175,13 +191,13 @@ sap.ui.define([
|
|
|
175
191
|
|
|
176
192
|
.then(function() {
|
|
177
193
|
return aChanges.map(function(mChange) {
|
|
178
|
-
|
|
194
|
+
const mChangeSpecificData = mChange.changeSpecificData;
|
|
179
195
|
// Flex Change
|
|
180
196
|
if (mChangeSpecificData.changeType) {
|
|
181
197
|
return () => this._handleFlexChangeCommand(mChange, aElementOverlays, oCompositeCommand, oSettingsAction);
|
|
182
|
-
//
|
|
198
|
+
// Manifest Change
|
|
183
199
|
} else if (mChangeSpecificData.appDescriptorChangeType) {
|
|
184
|
-
return () => this.
|
|
200
|
+
return () => this._handleManifestChangeCommand(mChange, oElement, oCompositeCommand);
|
|
185
201
|
}
|
|
186
202
|
return undefined;
|
|
187
203
|
}, this);
|
|
@@ -213,8 +229,8 @@ sap.ui.define([
|
|
|
213
229
|
*/
|
|
214
230
|
Settings.prototype.handler = function(aElementOverlays, mPropertyBag, oSettingsAction) {
|
|
215
231
|
mPropertyBag ||= {};
|
|
216
|
-
|
|
217
|
-
|
|
232
|
+
const oElement = aElementOverlays[0].getElement();
|
|
233
|
+
let {fnHandler} = mPropertyBag;
|
|
218
234
|
|
|
219
235
|
fnHandler ||= aElementOverlays[0].getDesignTimeMetadata().getAction("settings").handler;
|
|
220
236
|
if (!fnHandler) {
|
|
@@ -251,28 +267,22 @@ sap.ui.define([
|
|
|
251
267
|
Settings.prototype.getMenuItems = async function(aElementOverlays) {
|
|
252
268
|
const oElementOverlay = aElementOverlays[0];
|
|
253
269
|
const oResponsibleElementOverlay = this.getResponsibleElementOverlay(oElementOverlay);
|
|
254
|
-
|
|
270
|
+
const vSettingsActions = this.getAction(oResponsibleElementOverlay);
|
|
255
271
|
|
|
256
272
|
const aMenuItems = [];
|
|
257
273
|
if (vSettingsActions) {
|
|
258
274
|
const iRank = this.getRank("CTX_SETTINGS");
|
|
259
275
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
settings: vSettingsActions
|
|
263
|
-
};
|
|
264
|
-
}
|
|
276
|
+
const aSettingsActions = getValidActions(vSettingsActions, oResponsibleElementOverlay);
|
|
277
|
+
|
|
265
278
|
if (this._isEditableByPlugin(oResponsibleElementOverlay) === undefined) {
|
|
266
279
|
// The responsibleElement editableByPlugin state was not evaluated yet e.g. because it
|
|
267
280
|
// has no visible geometry, thus evaluateEditable now
|
|
268
281
|
await this.evaluateEditable([oResponsibleElementOverlay], { onRegistration: false });
|
|
269
282
|
}
|
|
270
|
-
|
|
271
|
-
aSettingsActions.forEach(function(sSettingsAction, iIndex, aActions) {
|
|
272
|
-
const oSettingsAction = vSettingsActions[sSettingsAction];
|
|
283
|
+
aSettingsActions.forEach(function(oSettingsAction, iIndex, aActions) {
|
|
273
284
|
if (
|
|
274
|
-
oSettingsAction
|
|
275
|
-
&& this._checkRelevantContainerStableID(oSettingsAction, oResponsibleElementOverlay)
|
|
285
|
+
this._checkRelevantContainerStableID(oSettingsAction, oResponsibleElementOverlay)
|
|
276
286
|
&& this.isAvailable([oResponsibleElementOverlay])
|
|
277
287
|
) {
|
|
278
288
|
const bSingleAction = aActions.length === 1;
|
|
@@ -298,7 +308,7 @@ sap.ui.define([
|
|
|
298
308
|
submenu: formatSubMenuItems(oSettingsAction.submenu)
|
|
299
309
|
});
|
|
300
310
|
} else {
|
|
301
|
-
BaseLog.warning(
|
|
311
|
+
BaseLog.warning("Action is not available or relevant container has no stable id");
|
|
302
312
|
}
|
|
303
313
|
}, this);
|
|
304
314
|
}
|
|
@@ -321,8 +331,8 @@ sap.ui.define([
|
|
|
321
331
|
}
|
|
322
332
|
|
|
323
333
|
function getActionIcon(oSettingsAction) {
|
|
324
|
-
|
|
325
|
-
|
|
334
|
+
const sDefaultSettingIcon = "sap-icon://key-user-settings";
|
|
335
|
+
const sActionIcon = oSettingsAction.icon;
|
|
326
336
|
if (!sActionIcon) {
|
|
327
337
|
return sDefaultSettingIcon;
|
|
328
338
|
}
|
|
@@ -119,7 +119,7 @@ sap.ui.define([
|
|
|
119
119
|
* @class The plugin allows to add additional elements that exist either hidden in the UI or in the OData service
|
|
120
120
|
* @extends sap.ui.rta.plugin.Plugin
|
|
121
121
|
* @author SAP SE
|
|
122
|
-
* @version 1.
|
|
122
|
+
* @version 1.135.0
|
|
123
123
|
* @constructor
|
|
124
124
|
* @private
|
|
125
125
|
* @since 1.44
|