@openui5/sap.ui.rta 1.105.1 → 1.107.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 +20 -17
- package/THIRDPARTY.txt +31 -21
- 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 +652 -653
- package/src/sap/ui/rta/Utils.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantManager.js +1 -1
- package/src/sap/ui/rta/appVariant/AppVariantUtils.js +2 -0
- 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/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 +6 -5
- package/src/sap/ui/rta/command/CompositeCommand.js +7 -5
- 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/FlexCommand.js +3 -3
- package/src/sap/ui/rta/command/LREPSerializer.js +3 -2
- 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 +26 -7
- 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 +89 -15
- package/src/sap/ui/rta/library.js +2 -2
- package/src/sap/ui/rta/messagebundle.properties +31 -0
- package/src/sap/ui/rta/messagebundle_ar.properties +16 -11
- package/src/sap/ui/rta/messagebundle_bg.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ca.properties +16 -11
- package/src/sap/ui/rta/messagebundle_cs.properties +16 -11
- package/src/sap/ui/rta/messagebundle_cy.properties +16 -11
- package/src/sap/ui/rta/messagebundle_da.properties +16 -11
- package/src/sap/ui/rta/messagebundle_de.properties +17 -12
- package/src/sap/ui/rta/messagebundle_el.properties +16 -11
- package/src/sap/ui/rta/messagebundle_en.properties +7 -2
- package/src/sap/ui/rta/messagebundle_en_GB.properties +7 -2
- package/src/sap/ui/rta/messagebundle_en_US_sappsd.properties +13 -1
- package/src/sap/ui/rta/messagebundle_en_US_saprigi.properties +6 -1
- package/src/sap/ui/rta/messagebundle_en_US_saptrc.properties +6 -1
- package/src/sap/ui/rta/messagebundle_es.properties +16 -11
- package/src/sap/ui/rta/messagebundle_es_MX.properties +16 -11
- package/src/sap/ui/rta/messagebundle_et.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_fr_CA.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_hu.properties +16 -11
- package/src/sap/ui/rta/messagebundle_id.properties +16 -11
- package/src/sap/ui/rta/messagebundle_it.properties +16 -11
- package/src/sap/ui/rta/messagebundle_iw.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ja.properties +16 -11
- package/src/sap/ui/rta/messagebundle_kk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ko.properties +16 -11
- package/src/sap/ui/rta/messagebundle_lt.properties +16 -11
- package/src/sap/ui/rta/messagebundle_lv.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ms.properties +16 -11
- package/src/sap/ui/rta/messagebundle_nl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_no.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pt.properties +16 -11
- package/src/sap/ui/rta/messagebundle_pt_PT.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ro.properties +16 -11
- package/src/sap/ui/rta/messagebundle_ru.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sh.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sl.properties +16 -11
- package/src/sap/ui/rta/messagebundle_sv.properties +16 -11
- package/src/sap/ui/rta/messagebundle_th.properties +16 -11
- package/src/sap/ui/rta/messagebundle_tr.properties +16 -11
- package/src/sap/ui/rta/messagebundle_uk.properties +16 -11
- package/src/sap/ui/rta/messagebundle_vi.properties +16 -11
- package/src/sap/ui/rta/messagebundle_zh_CN.properties +16 -11
- package/src/sap/ui/rta/messagebundle_zh_TW.properties +16 -11
- package/src/sap/ui/rta/plugin/AddXMLAtExtensionPoint.js +7 -5
- package/src/sap/ui/rta/plugin/BaseCreate.js +2 -2
- package/src/sap/ui/rta/plugin/Combine.js +1 -1
- package/src/sap/ui/rta/plugin/CompVariant.js +8 -6
- package/src/sap/ui/rta/plugin/ControlVariant.js +1 -1
- package/src/sap/ui/rta/plugin/CreateContainer.js +9 -4
- 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 +3 -1
- package/src/sap/ui/rta/plugin/EasyRemove.js +3 -1
- package/src/sap/ui/rta/plugin/LocalReset.js +2 -2
- package/src/sap/ui/rta/plugin/Plugin.js +1 -1
- 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 +3 -3
- package/src/sap/ui/rta/plugin/RenameHandler.js +2 -2
- package/src/sap/ui/rta/plugin/Resize.js +3 -3
- package/src/sap/ui/rta/plugin/Selection.js +1 -1
- package/src/sap/ui/rta/plugin/Settings.js +2 -2
- package/src/sap/ui/rta/plugin/Split.js +2 -2
- package/src/sap/ui/rta/plugin/Stretch.js +3 -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/AdditionalElementsAnalyzer.js +9 -6
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsPlugin.js +9 -9
- package/src/sap/ui/rta/plugin/additionalElements/AdditionalElementsUtils.js +1 -1
- package/src/sap/ui/rta/plugin/additionalElements/CommandBuilder.js +2 -2
- package/src/sap/ui/rta/plugin/iframe/AddIFrame.js +3 -3
- 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 +1 -1
- package/src/sap/ui/rta/service/Outline.js +6 -4
- 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 +189 -0
- package/src/sap/ui/rta/service/index.js +7 -6
- package/src/sap/ui/rta/toolbar/Adaptation.fragment.xml +11 -1
- package/src/sap/ui/rta/toolbar/Adaptation.js +9 -1
- package/src/sap/ui/rta/toolbar/AdaptationRenderer.js +3 -1
- package/src/sap/ui/rta/toolbar/Base.js +1 -1
- package/src/sap/ui/rta/toolbar/BaseRenderer.js +6 -4
- 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/SaveAsContextBasedAdaptation.js +125 -0
- package/src/sap/ui/rta/toolbar/contextBased/SaveAsContextBasedAdaptationDialog.fragment.xml +79 -0
- package/src/sap/ui/rta/toolbar/translation/Translation.js +1 -5
- package/src/sap/ui/rta/toolbar/versioning/Versioning.js +1 -1
- package/src/sap/ui/rta/util/BindingsExtractor.js +97 -41
- 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 +1 -1
- package/src/sap/ui/rta/util/ServiceEventBus.js +1 -1
- package/src/sap/ui/rta/util/StylesLoader.js +3 -3
- package/src/sap/ui/rta/util/adaptationStarter.js +13 -4
- package/src/sap/ui/rta/util/changeVisualization/ChangeCategories.js +50 -0
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicator.js +44 -41
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorCategorySelection.fragment.xml +2 -2
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorPopover.fragment.xml +2 -1
- package/src/sap/ui/rta/util/changeVisualization/ChangeIndicatorRegistry.js +69 -43
- package/src/sap/ui/rta/util/changeVisualization/ChangeVisualization.js +57 -83
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/CombineVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/MoveVisualization.js +13 -10
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/RenameVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/{categories → commands}/SplitVisualization.js +1 -1
- package/src/sap/ui/rta/util/changeVisualization/commands/getCommandVisualization.js +37 -0
- package/src/sap/ui/rta/util/changeVisualization/categories/getVisualizationCategory.js +0 -35
|
@@ -16,16 +16,18 @@ function(
|
|
|
16
16
|
|
|
17
17
|
var BaseRenderer = Renderer.extend.call(HBoxRenderer, "sap.ui.rta.toolbar.BaseRenderer");
|
|
18
18
|
|
|
19
|
+
BaseRenderer.apiVersion = 1; // @todo-semantic-rendering out of order .class() and .style() calls before openStart
|
|
20
|
+
|
|
19
21
|
BaseRenderer.render = function (oRM, oControl) {
|
|
20
|
-
oRM.
|
|
21
|
-
oRM.
|
|
22
|
+
oRM.class("sapUiRtaToolbar");
|
|
23
|
+
oRM.class("color_" + oControl.getColor());
|
|
22
24
|
|
|
23
25
|
// setting type if exists
|
|
24
|
-
oControl.type && oRM.
|
|
26
|
+
oControl.type && oRM.class("type_" + oControl.type);
|
|
25
27
|
|
|
26
28
|
// setting z-index if exists
|
|
27
29
|
var iZIndex = oControl.getZIndex();
|
|
28
|
-
iZIndex && oRM.
|
|
30
|
+
iZIndex && oRM.style("z-index", iZIndex);
|
|
29
31
|
|
|
30
32
|
HBoxRenderer.render(oRM, oControl);
|
|
31
33
|
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2022 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/base/ManagedObject",
|
|
9
|
+
"sap/ui/core/Fragment",
|
|
10
|
+
"sap/ui/fl/Layer",
|
|
11
|
+
"sap/ui/fl/write/api/ContextSharingAPI",
|
|
12
|
+
"sap/ui/rta/Utils",
|
|
13
|
+
"sap/ui/model/Binding"
|
|
14
|
+
], function (
|
|
15
|
+
ManagedObject,
|
|
16
|
+
Fragment,
|
|
17
|
+
Layer,
|
|
18
|
+
ContextSharingAPI,
|
|
19
|
+
Utils,
|
|
20
|
+
Binding
|
|
21
|
+
) {
|
|
22
|
+
"use strict";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Controller for the <code>sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation</code> controls.
|
|
26
|
+
* Contains implementation of context-based-adaptation functionality.
|
|
27
|
+
*
|
|
28
|
+
* @class
|
|
29
|
+
*
|
|
30
|
+
* @author SAP SE
|
|
31
|
+
* @version 1.107.0
|
|
32
|
+
*
|
|
33
|
+
* @constructor
|
|
34
|
+
* @private
|
|
35
|
+
* @since 1.106
|
|
36
|
+
* @alias sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation
|
|
37
|
+
*/
|
|
38
|
+
var SaveAsContextBasedAdaptation = ManagedObject.extend("sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptation", {
|
|
39
|
+
metadata: {
|
|
40
|
+
properties: {
|
|
41
|
+
toolbar: {
|
|
42
|
+
type: "any" // "sap.ui.rta.toolbar.Base"
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
constructor: function () {
|
|
47
|
+
ManagedObject.prototype.constructor.apply(this, arguments);
|
|
48
|
+
this.oTextResources = this.getToolbar().getTextResources();
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
SaveAsContextBasedAdaptation.prototype.openAddAdaptationDialog = function (sLayer) {
|
|
53
|
+
if (!this._oAddAdaptationDialogPromise) {
|
|
54
|
+
this._oAddAdaptationDialogPromise = Fragment.load({
|
|
55
|
+
name: "sap.ui.rta.toolbar.contextBased.SaveAsContextBasedAdaptationDialog",
|
|
56
|
+
id: this.getToolbar().getId() + "_fragment--sapUiRta_addAdaptationDialog",
|
|
57
|
+
controller: {
|
|
58
|
+
onAdaptationTitleChange: _onAdaptationTitleChange.bind(this),
|
|
59
|
+
onSaveAsContextBasedAdaptation: _onSaveAsContextBasedAdaptation.bind(this),
|
|
60
|
+
onCancelContextBasedAdaptationDialog: _onCancelContextBasedAdaptationDialog.bind(this)
|
|
61
|
+
}
|
|
62
|
+
}).then(function (oDialog) {
|
|
63
|
+
this._oAddAdaptationDialog = oDialog;
|
|
64
|
+
oDialog.addStyleClass(Utils.getRtaStyleClassName());
|
|
65
|
+
this.getToolbar().addDependent(this._oAddAdaptationDialog);
|
|
66
|
+
createContextSharingComponent.call(this, sLayer);
|
|
67
|
+
}.bind(this));
|
|
68
|
+
} else {
|
|
69
|
+
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-title-input").setValue("");
|
|
70
|
+
}
|
|
71
|
+
return this._oAddAdaptationDialogPromise.then(function () {
|
|
72
|
+
return this._oAddAdaptationDialog.open();
|
|
73
|
+
}.bind(this));
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
function _onAdaptationTitleChange(oEvent) {
|
|
77
|
+
this.sAdaptationTitle = oEvent.getParameter("value");
|
|
78
|
+
_enableSaveAsButton.call(this);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function _onCancelContextBasedAdaptationDialog() {
|
|
82
|
+
_clearContexts.call(this);
|
|
83
|
+
this._oAddAdaptationDialog.close();
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function _onSaveAsContextBasedAdaptation() {
|
|
87
|
+
var oContextBasedAdaptation = {};
|
|
88
|
+
oContextBasedAdaptation.title = getAdaptationTitle.call(this);
|
|
89
|
+
oContextBasedAdaptation.contexts = this._oContextComponentInstance.getSelectedContexts();
|
|
90
|
+
this.getToolbar().fireEvent("saveAsContextBasedAdaptation", oContextBasedAdaptation);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function createContextSharingComponent(sLayer) {
|
|
94
|
+
var mPropertyBag = { layer: sLayer || Layer.CUSTOMER };
|
|
95
|
+
return ContextSharingAPI.createComponent(mPropertyBag).then(function (oContextSharingComponent) {
|
|
96
|
+
this._oContextComponent = oContextSharingComponent;
|
|
97
|
+
this._oContextComponentInstance = oContextSharingComponent.getComponentInstance();
|
|
98
|
+
this._oContextComponentInstance.resetSelectedContexts();
|
|
99
|
+
this._oAddAdaptationDialog.addContent(this._oContextComponent);
|
|
100
|
+
var oSelectedContextsModel = this._oContextComponentInstance.getSelectedContextsModel();
|
|
101
|
+
this.oSelectedContextsBinding = new Binding(oSelectedContextsModel, "/", oSelectedContextsModel.getContext("/"));
|
|
102
|
+
this.oSelectedContextsBinding.attachChange(_enableSaveAsButton.bind(this));
|
|
103
|
+
}.bind(this));
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function getAdaptationTitle() {
|
|
107
|
+
return this.sAdaptationTitle || "";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function _enableSaveAsButton() {
|
|
111
|
+
var bEnable = getAdaptationTitle.call(this).length > 0 && this._oContextComponentInstance.getSelectedContexts().role.length > 0;
|
|
112
|
+
this.getToolbar().getControl("addAdaptationDialog--saveContextBasedAdaptation-saveButton").setEnabled(bEnable);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function _clearContexts() {
|
|
116
|
+
if (this._oContextComponentInstance) {
|
|
117
|
+
if (this._oContextComponent.isDestroyed()) {
|
|
118
|
+
return createContextSharingComponent.call(this);
|
|
119
|
+
}
|
|
120
|
+
this._oContextComponentInstance.resetSelectedContexts();
|
|
121
|
+
this._oAddAdaptationDialog.addContent(this._oContextComponent);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return SaveAsContextBasedAdaptation;
|
|
125
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<core:FragmentDefinition
|
|
2
|
+
xmlns:form="sap.ui.layout.form"
|
|
3
|
+
xmlns="sap.m"
|
|
4
|
+
xmlns:core="sap.ui.core">
|
|
5
|
+
<Dialog id="selectContextsDialog"
|
|
6
|
+
resizable="true"
|
|
7
|
+
draggable="true"
|
|
8
|
+
title="{i18n>SAC_DIALOG_HEADER}">
|
|
9
|
+
<Panel id="saveContextBasedAdaptation-information-panel">
|
|
10
|
+
<Toolbar id="toolbar">
|
|
11
|
+
<Label id="label"
|
|
12
|
+
text="Information"
|
|
13
|
+
design="Bold">
|
|
14
|
+
</Label>
|
|
15
|
+
</Toolbar>
|
|
16
|
+
<form:Form id="saveContextBasedAdaptation-form"
|
|
17
|
+
editable="true">
|
|
18
|
+
<form:layout>
|
|
19
|
+
<form:ResponsiveGridLayout labelSpanXL="3"
|
|
20
|
+
labelSpanL="3"
|
|
21
|
+
labelSpanM="3"
|
|
22
|
+
labelSpanS="12"
|
|
23
|
+
adjustLabelSpan="false"
|
|
24
|
+
emptySpanXL="4"
|
|
25
|
+
emptySpanL="4"
|
|
26
|
+
emptySpanM="4"
|
|
27
|
+
emptySpanS="0"
|
|
28
|
+
columnsXL="1"
|
|
29
|
+
columnsL="1"
|
|
30
|
+
columnsM="1"
|
|
31
|
+
singleContainerFullSize="false"/>
|
|
32
|
+
</form:layout>
|
|
33
|
+
<form:FormContainer>
|
|
34
|
+
<form:formElements>
|
|
35
|
+
<form:FormElement >
|
|
36
|
+
<form:label>
|
|
37
|
+
<Label id="saveContextBasedAdaptation-title-label"
|
|
38
|
+
text="{i18n>APP_DIALOG_TITLE_TEXT}"
|
|
39
|
+
textAlign="Left"
|
|
40
|
+
required="true">
|
|
41
|
+
</Label>
|
|
42
|
+
</form:label>
|
|
43
|
+
<Input id="saveContextBasedAdaptation-title-input"
|
|
44
|
+
value="{/title}"
|
|
45
|
+
valueLiveUpdate="true"
|
|
46
|
+
liveChange=".onAdaptationTitleChange"
|
|
47
|
+
placeholder="{i18n>SAVE_AS_DIALOG_PLACEHOLDER_TITLE_TEXT}">
|
|
48
|
+
</Input>
|
|
49
|
+
</form:FormElement>
|
|
50
|
+
<form:FormElement >
|
|
51
|
+
<form:label>
|
|
52
|
+
<Label id="saveContextBasedAdaptation-rank-label"
|
|
53
|
+
text="{i18n>CLM_HEADER_PRIORITY}"
|
|
54
|
+
textAlign="Left"
|
|
55
|
+
required="true">
|
|
56
|
+
</Label>
|
|
57
|
+
</form:label>
|
|
58
|
+
<Select id="saveContextBasedAdaptation-rank-select"
|
|
59
|
+
selectedKey="{/selected}">
|
|
60
|
+
</Select>
|
|
61
|
+
</form:FormElement>
|
|
62
|
+
</form:formElements>
|
|
63
|
+
</form:FormContainer>
|
|
64
|
+
</form:Form>
|
|
65
|
+
</Panel>
|
|
66
|
+
<beginButton>
|
|
67
|
+
<Button id="saveContextBasedAdaptation-saveButton"
|
|
68
|
+
type="Emphasized"
|
|
69
|
+
text="{i18n>APP_VARIANT_DIALOG_SAVE}"
|
|
70
|
+
press=".onSaveAsContextBasedAdaptation"/>
|
|
71
|
+
</beginButton>
|
|
72
|
+
<endButton>
|
|
73
|
+
<Button id="saveContextBasedAdaptation-cancelButton"
|
|
74
|
+
type="Emphasized"
|
|
75
|
+
text="{i18n>SAVE_AS_APP_VARIANT_DIALOG_CANCEL}"
|
|
76
|
+
press=".onCancelContextBasedAdaptationDialog"/>
|
|
77
|
+
</endButton>
|
|
78
|
+
</Dialog>
|
|
79
|
+
</core:FragmentDefinition>
|
|
@@ -11,12 +11,10 @@ sap.ui.define([
|
|
|
11
11
|
"sap/ui/base/ManagedObject",
|
|
12
12
|
"sap/ui/core/Fragment",
|
|
13
13
|
"sap/ui/rta/Utils",
|
|
14
|
-
"sap/ui/fl/Utils",
|
|
15
14
|
"sap/ui/model/json/JSONModel",
|
|
16
15
|
"sap/m/MessageBox",
|
|
17
16
|
"sap/m/MessageToast",
|
|
18
17
|
"sap/ui/fl/write/api/TranslationAPI",
|
|
19
|
-
"sap/ui/fl/write/api/VersionsAPI",
|
|
20
18
|
"sap/ui/fl/Layer",
|
|
21
19
|
"sap/ui/core/util/File"
|
|
22
20
|
], function(
|
|
@@ -24,12 +22,10 @@ sap.ui.define([
|
|
|
24
22
|
ManagedObject,
|
|
25
23
|
Fragment,
|
|
26
24
|
Utils,
|
|
27
|
-
FlUtils,
|
|
28
25
|
JSONModel,
|
|
29
26
|
MessageBox,
|
|
30
27
|
MessageToast,
|
|
31
28
|
TranslationAPI,
|
|
32
|
-
VersionsAPI,
|
|
33
29
|
Layer,
|
|
34
30
|
FileUtil
|
|
35
31
|
) {
|
|
@@ -53,7 +49,7 @@ sap.ui.define([
|
|
|
53
49
|
* @class
|
|
54
50
|
*
|
|
55
51
|
* @author SAP SE
|
|
56
|
-
* @version 1.
|
|
52
|
+
* @version 1.107.0
|
|
57
53
|
*
|
|
58
54
|
* @constructor
|
|
59
55
|
* @private
|
|
@@ -7,12 +7,16 @@
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/dt/ElementUtil",
|
|
9
9
|
"sap/ui/dt/OverlayRegistry",
|
|
10
|
-
"sap/base/util/isPlainObject"
|
|
10
|
+
"sap/base/util/isPlainObject",
|
|
11
|
+
"sap/base/util/restricted/_uniqWith",
|
|
12
|
+
"sap/base/util/deepEqual"
|
|
11
13
|
],
|
|
12
14
|
function(
|
|
13
15
|
ElementUtil,
|
|
14
16
|
OverlayRegistry,
|
|
15
|
-
isPlainObject
|
|
17
|
+
isPlainObject,
|
|
18
|
+
_uniqWith,
|
|
19
|
+
deepEqual
|
|
16
20
|
) {
|
|
17
21
|
"use strict";
|
|
18
22
|
|
|
@@ -35,7 +39,12 @@ function(
|
|
|
35
39
|
};
|
|
36
40
|
var sAggregationName = oElement.sParentAggregationName;
|
|
37
41
|
var oParent = oElement.getParent();
|
|
38
|
-
var aBindings = BindingsExtractor.getBindings(
|
|
42
|
+
var aBindings = BindingsExtractor.getBindings({
|
|
43
|
+
element: oElement,
|
|
44
|
+
model: oModel,
|
|
45
|
+
relevantContainerElement: oRelevantContainerElement,
|
|
46
|
+
parent: oParent
|
|
47
|
+
});
|
|
39
48
|
|
|
40
49
|
if (oParent) {
|
|
41
50
|
var oDefaultAggregation = oParent.getMetadata().getAggregation();
|
|
@@ -52,7 +61,13 @@ function(
|
|
|
52
61
|
if (oTemplateDefaultAggregation) {
|
|
53
62
|
var sTemplateDefaultAggregationName = oTemplateDefaultAggregation.name;
|
|
54
63
|
var oTemplateElement = ElementUtil.getAggregation(oTemplate, sTemplateDefaultAggregationName)[iPositionOfInvisibleElement];
|
|
55
|
-
aBindings = aBindings.concat(BindingsExtractor.getBindings(
|
|
64
|
+
aBindings = aBindings.concat(BindingsExtractor.getBindings({
|
|
65
|
+
model: oModel,
|
|
66
|
+
element: oTemplateElement,
|
|
67
|
+
template: true,
|
|
68
|
+
relevantContainerElement: oRelevantContainerElement,
|
|
69
|
+
parent: oParent
|
|
70
|
+
}));
|
|
56
71
|
}
|
|
57
72
|
}
|
|
58
73
|
}
|
|
@@ -93,58 +108,85 @@ function(
|
|
|
93
108
|
|
|
94
109
|
/**
|
|
95
110
|
* Gets bindings for the whole hierarchy of children for a specified Element
|
|
96
|
-
* and filters out bindings which are not relevant (based on the
|
|
111
|
+
* and filters out bindings which are not relevant (based on the given model)
|
|
97
112
|
*
|
|
98
|
-
* @param {
|
|
99
|
-
* @param {sap.ui.
|
|
100
|
-
* @param {
|
|
101
|
-
* @param {
|
|
102
|
-
* @param {
|
|
113
|
+
* @param {object} mPropertyBag - PropertyBag
|
|
114
|
+
* @param {sap.ui.core.Control} mPropertyBag.element - Starting point of the search
|
|
115
|
+
* @param {sap.ui.model.Model} [mPropertyBag.model] - Model for filtering irrelevant binding paths
|
|
116
|
+
* @param {boolean} [mPropertyBag.template] - Whether we should consider provided element as a template or part of a template
|
|
117
|
+
* @param {string} [mPropertyBag.aggregationName] - if aggregation name is given then only for this aggregation bindings are returned, if not then all aggregations are considered
|
|
118
|
+
* @param {sap.ui.core.Control} [mPropertyBag.relevantContainerElement] - if this element is given then only bindings from element related to the relevant container are considered
|
|
119
|
+
* @param {sap.ui.core.Control} [mPropertyBag.parent] - parent of the element being evaluated; if the element is a template, the parent is the control hosting the template
|
|
103
120
|
* @returns {Array} - returns array with all relevant bindings for all properties of the element
|
|
104
121
|
*
|
|
105
122
|
* @private
|
|
106
123
|
*/
|
|
107
|
-
BindingsExtractor.getBindings = function(
|
|
124
|
+
BindingsExtractor.getBindings = function(mPropertyBag) {
|
|
125
|
+
var oElement = mPropertyBag.element;
|
|
126
|
+
var oModel = mPropertyBag.model;
|
|
127
|
+
var oParent = mPropertyBag.parent;
|
|
128
|
+
var sAggregationName = mPropertyBag.aggregationName;
|
|
129
|
+
var oRelevantContainerElement = mPropertyBag.relevantContainerElement;
|
|
108
130
|
var aBindings = [];
|
|
109
131
|
if (isElementRelatedToRelevantContainer(oElement, oRelevantContainerElement)) {
|
|
110
132
|
aBindings = (
|
|
111
|
-
|
|
112
|
-
? getBindingsFromTemplateProperties(oElement)
|
|
113
|
-
: BindingsExtractor.getBindingsFromProperties(oElement,
|
|
133
|
+
mPropertyBag.template
|
|
134
|
+
? getBindingsFromTemplateProperties(oElement, oParent, oModel)
|
|
135
|
+
: BindingsExtractor.getBindingsFromProperties(oElement, oModel)
|
|
114
136
|
);
|
|
115
137
|
}
|
|
116
138
|
var aAggregationNames = sAggregationName ? [sAggregationName] : Object.keys(oElement.getMetadata().getAllAggregations());
|
|
117
139
|
|
|
118
140
|
aAggregationNames.forEach(function (sAggregationNameInLoop) {
|
|
119
|
-
aBindings = aBindings.concat(getBindingsForAggregation(oElement,
|
|
141
|
+
aBindings = aBindings.concat(getBindingsForAggregation(oElement, oModel, mPropertyBag.template, sAggregationNameInLoop, oRelevantContainerElement));
|
|
120
142
|
});
|
|
121
143
|
|
|
122
|
-
|
|
144
|
+
// Remove duplicates
|
|
145
|
+
return _uniqWith(aBindings, deepEqual);
|
|
123
146
|
};
|
|
124
147
|
|
|
125
|
-
function getBindingsForAggregation(oElement,
|
|
148
|
+
function getBindingsForAggregation(oElement, oModel, bTemplate, sAggregationName, oRelevantContainerElement) {
|
|
126
149
|
var aBindings = [];
|
|
150
|
+
var aElements = [];
|
|
127
151
|
var oTemplate;
|
|
128
|
-
var bTemplate;
|
|
129
|
-
|
|
152
|
+
var bIsInTemplate = bTemplate;
|
|
153
|
+
var oElementModel = oElement.getModel();
|
|
154
|
+
|
|
130
155
|
var oBinding = oElement.getBindingInfo(sAggregationName);
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
156
|
+
oTemplate = oBinding && oBinding.template;
|
|
157
|
+
|
|
158
|
+
// If a template is found for a different model, we don't look inside the template
|
|
159
|
+
// e.g. a Select control whose entries are defined in an own JSON model
|
|
160
|
+
if (oTemplate && oElementModel && oElementModel !== oModel) {
|
|
161
|
+
return [];
|
|
134
162
|
}
|
|
135
|
-
var aElements = oTemplate ? [oTemplate] : ElementUtil.getAggregation(oElement, sAggregationName);
|
|
136
163
|
|
|
164
|
+
// If a template is bound to the current element on the given model,
|
|
165
|
+
// we continue the evaluation on the template (as it has no direct parent)
|
|
166
|
+
if (oTemplate) {
|
|
167
|
+
bIsInTemplate = true;
|
|
168
|
+
aElements = [oTemplate];
|
|
169
|
+
} else {
|
|
170
|
+
aElements = ElementUtil.getAggregation(oElement, sAggregationName);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Getting children of the current aggregation and iterating through all of them
|
|
137
174
|
aElements.forEach(function (oChildElement) {
|
|
138
175
|
if (oChildElement.getMetadata) {
|
|
139
176
|
if (isElementRelatedToRelevantContainer(oElement, oRelevantContainerElement)) {
|
|
140
177
|
// Fetching bindings from Element and all children of Element
|
|
141
|
-
aBindings = aBindings.concat(
|
|
142
|
-
? getBindingsFromTemplateProperties(oChildElement,
|
|
143
|
-
: BindingsExtractor.getBindingsFromProperties(oChildElement,
|
|
178
|
+
aBindings = aBindings.concat(bIsInTemplate
|
|
179
|
+
? getBindingsFromTemplateProperties(oChildElement, oElement, oModel)
|
|
180
|
+
: BindingsExtractor.getBindingsFromProperties(oChildElement, oModel));
|
|
144
181
|
}
|
|
145
|
-
// For children, templates should not be evaluated (because the delegate also does not consider them)
|
|
146
182
|
aBindings = aBindings.concat(
|
|
147
|
-
BindingsExtractor.getBindings(
|
|
183
|
+
BindingsExtractor.getBindings({
|
|
184
|
+
element: oChildElement,
|
|
185
|
+
model: oModel,
|
|
186
|
+
template: bIsInTemplate,
|
|
187
|
+
relevantContainerElement: oRelevantContainerElement,
|
|
188
|
+
parent: oElement
|
|
189
|
+
})
|
|
148
190
|
);
|
|
149
191
|
}
|
|
150
192
|
});
|
|
@@ -153,7 +195,7 @@ function(
|
|
|
153
195
|
}
|
|
154
196
|
|
|
155
197
|
/**
|
|
156
|
-
* Fetches all bindings for a specified binding model
|
|
198
|
+
* Fetches all bindings for a specified binding model, filtering out the irrelevant ones
|
|
157
199
|
*
|
|
158
200
|
* @param {sap.ui.model.PropertyBinding} oBinding - Binding model to get paths from
|
|
159
201
|
* @param {sap.ui.model.odata.XX.ODataModel} oParentDefaultModel - Data model (XX = '', v2, v4...)
|
|
@@ -162,13 +204,13 @@ function(
|
|
|
162
204
|
*
|
|
163
205
|
* @private
|
|
164
206
|
*/
|
|
165
|
-
BindingsExtractor.
|
|
207
|
+
BindingsExtractor.filterAndFlattenBindings = function(oBinding, oParentDefaultModel) {
|
|
166
208
|
var aBindings = [];
|
|
167
209
|
var sModelName = oBinding.getMetadata().getName();
|
|
168
210
|
|
|
169
211
|
if (sModelName === "sap.ui.model.CompositeBinding") {
|
|
170
212
|
oBinding.getBindings().forEach(function (oBinding) {
|
|
171
|
-
aBindings = aBindings.concat(BindingsExtractor.
|
|
213
|
+
aBindings = aBindings.concat(BindingsExtractor.filterAndFlattenBindings(oBinding, oParentDefaultModel));
|
|
172
214
|
});
|
|
173
215
|
} else if (
|
|
174
216
|
(
|
|
@@ -215,13 +257,13 @@ function(
|
|
|
215
257
|
* Retrieving all bindings from all available properties for a specified element
|
|
216
258
|
*
|
|
217
259
|
* @param {sap.ui.core.Control} oElement - element to get bindings from
|
|
218
|
-
* @param {sap.ui.model.Model}
|
|
260
|
+
* @param {sap.ui.model.Model} oModel - model to filter irrelevant bindings
|
|
219
261
|
*
|
|
220
262
|
* @return {Array} - returns found bindings
|
|
221
263
|
*
|
|
222
264
|
* @private
|
|
223
265
|
*/
|
|
224
|
-
BindingsExtractor.getBindingsFromProperties = function(oElement,
|
|
266
|
+
BindingsExtractor.getBindingsFromProperties = function(oElement, oModel) {
|
|
225
267
|
var aPropertiesKeys = Object.keys(oElement.getMetadata().getAllProperties());
|
|
226
268
|
|
|
227
269
|
return aPropertiesKeys
|
|
@@ -229,32 +271,46 @@ function(
|
|
|
229
271
|
.filter(oElement.getBinding.bind(oElement))
|
|
230
272
|
.reduce(function (aBindings, sPropertyName) {
|
|
231
273
|
return aBindings.concat(
|
|
232
|
-
BindingsExtractor.
|
|
274
|
+
BindingsExtractor.filterAndFlattenBindings(
|
|
233
275
|
oElement.getBinding(sPropertyName),
|
|
234
|
-
|
|
276
|
+
oModel
|
|
235
277
|
)
|
|
236
278
|
);
|
|
237
279
|
}, []);
|
|
238
280
|
};
|
|
239
281
|
|
|
240
282
|
/**
|
|
241
|
-
* Retrieving all bindings from all available properties for a
|
|
283
|
+
* Retrieving all bindings from all available properties for a template
|
|
284
|
+
*
|
|
285
|
+
* @param {sap.ui.core.Control} oTemplate - template being evaluated
|
|
286
|
+
* @param {sap.ui.core.Control} oTemplateParent - template "parent"; control to which it is bound
|
|
287
|
+
* @param {sap.ui.model.Modell} oModel - relevant model, usually the parent default model
|
|
242
288
|
*
|
|
243
|
-
* @param {sap.ui.core.Control} oElement - element to get bindings from
|
|
244
289
|
* @return {Array} - returns found bindings
|
|
245
290
|
* @private
|
|
246
291
|
*/
|
|
247
|
-
function getBindingsFromTemplateProperties(
|
|
248
|
-
var aPropertiesKeys = Object.keys(
|
|
292
|
+
function getBindingsFromTemplateProperties(oTemplate, oTemplateParent, oModel) {
|
|
293
|
+
var aPropertiesKeys = Object.keys(oTemplate.getMetadata().getAllProperties());
|
|
294
|
+
var bIsSameModel;
|
|
249
295
|
|
|
250
296
|
return aPropertiesKeys
|
|
251
297
|
.filter(function (sPropertyName) {
|
|
252
|
-
|
|
298
|
+
var mBindingInfo = oTemplate.mBindingInfos[sPropertyName];
|
|
299
|
+
var sModelName = mBindingInfo && mBindingInfo.parts[0] && mBindingInfo.parts[0].model;
|
|
300
|
+
bIsSameModel = oModel === oTemplateParent.getModel(sModelName);
|
|
301
|
+
if (!sModelName) {
|
|
302
|
+
var oParentDefaultModel = oTemplateParent.getDefaultModel ? oTemplateParent.getDefaultModel() : null;
|
|
303
|
+
var oTemplateDefaultModel = oTemplate.getDefaultModel ? oTemplate.getDefaultModel() : null;
|
|
304
|
+
bIsSameModel = oParentDefaultModel === oTemplateDefaultModel;
|
|
305
|
+
} else {
|
|
306
|
+
bIsSameModel = oModel === oTemplateParent.getModel(sModelName);
|
|
307
|
+
}
|
|
308
|
+
return mBindingInfo && bIsSameModel;
|
|
253
309
|
})
|
|
254
310
|
.reduce(function (aBindings, sPropertyName) {
|
|
255
311
|
return aBindings.concat(
|
|
256
312
|
flattenBindingsFromTemplate(
|
|
257
|
-
|
|
313
|
+
oTemplate.mBindingInfos[sPropertyName]
|
|
258
314
|
)
|
|
259
315
|
);
|
|
260
316
|
}, []);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/thirdparty/jquery"
|
|
9
|
-
], function(jQuery) {
|
|
8
|
+
"sap/ui/thirdparty/jquery", "sap/ui/core/Configuration"
|
|
9
|
+
], function(jQuery, Configuration) {
|
|
10
10
|
"use strict";
|
|
11
11
|
|
|
12
12
|
var module = {};
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
return jQuery.get(sap.ui.require.toUrl(('sap.ui.rta.assets.' + sFileName).replace(/\./g, "/")) + '.css')
|
|
21
21
|
.then(function (sData) {
|
|
22
22
|
// TODO: check if it's possible to use UI5 standard mechanism for styles adjustments
|
|
23
|
-
if (
|
|
23
|
+
if (Configuration.getRTL()) {
|
|
24
24
|
return sData.replace(/right/g, 'left');
|
|
25
25
|
}
|
|
26
26
|
return sData;
|