@openui5/sap.ui.layout 1.103.1 → 1.106.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/.eslintrc.json +2 -3
- package/.reuse/dep5 +35 -15
- package/LICENSES/LicenseRef-tzdata-PublicDomain.txt +5 -0
- package/THIRDPARTY.txt +64 -21
- package/package.json +2 -2
- package/src/sap/ui/layout/.library +1 -1
- package/src/sap/ui/layout/AlignedFlowLayout.js +1 -1
- package/src/sap/ui/layout/AssociativeSplitter.js +3 -4
- package/src/sap/ui/layout/BlockLayout.js +1 -1
- package/src/sap/ui/layout/BlockLayoutCell.js +2 -3
- package/src/sap/ui/layout/BlockLayoutCellData.js +1 -1
- package/src/sap/ui/layout/BlockLayoutRow.js +1 -1
- package/src/sap/ui/layout/DynamicSideContent.js +1 -1
- package/src/sap/ui/layout/FixFlex.js +1 -1
- package/src/sap/ui/layout/Grid.js +1 -1
- package/src/sap/ui/layout/GridData.js +1 -1
- package/src/sap/ui/layout/GridRenderer.js +1 -1
- package/src/sap/ui/layout/HorizontalLayout.js +1 -1
- package/src/sap/ui/layout/PaneContainer.js +1 -1
- package/src/sap/ui/layout/ResponsiveFlowLayout.js +1 -1
- package/src/sap/ui/layout/ResponsiveFlowLayoutData.js +1 -1
- package/src/sap/ui/layout/ResponsiveSplitter.js +1 -1
- package/src/sap/ui/layout/ResponsiveSplitterPage.js +1 -1
- package/src/sap/ui/layout/SplitPane.js +1 -1
- package/src/sap/ui/layout/Splitter.js +1 -1
- package/src/sap/ui/layout/SplitterLayoutData.js +1 -1
- package/src/sap/ui/layout/VerticalLayout.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddFormContainer.js +24 -34
- package/src/sap/ui/layout/changeHandler/AddFormField.js +1 -1
- package/src/sap/ui/layout/changeHandler/AddSimpleFormField.js +5 -3
- package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +32 -36
- package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +22 -13
- package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +16 -19
- package/src/sap/ui/layout/changeHandler/RenameFormContainer.js +8 -19
- package/src/sap/ui/layout/changeHandler/RenameSimpleForm.js +18 -20
- package/src/sap/ui/layout/changeHandler/UnhideSimpleForm.js +13 -13
- package/src/sap/ui/layout/cssgrid/CSSGrid.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridBasicLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridBoxLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridItemLayoutData.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridLayoutBase.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridLayoutDelegate.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridResponsiveLayout.js +1 -1
- package/src/sap/ui/layout/cssgrid/GridSettings.js +1 -1
- package/src/sap/ui/layout/cssgrid/ResponsiveColumnItemLayoutData.js +1 -1
- package/src/sap/ui/layout/cssgrid/ResponsiveColumnLayout.js +1 -1
- package/src/sap/ui/layout/designtime/form/Form.designtime.js +3 -0
- package/src/sap/ui/layout/designtime/form/FormContainer.designtime.js +4 -1
- package/src/sap/ui/layout/designtime/form/SimpleForm.designtime.js +4 -1
- package/src/sap/ui/layout/form/ColumnContainerData.js +1 -1
- package/src/sap/ui/layout/form/ColumnElementData.js +1 -1
- package/src/sap/ui/layout/form/ColumnLayout.js +1 -1
- package/src/sap/ui/layout/form/Form.js +1 -1
- package/src/sap/ui/layout/form/FormContainer.js +1 -1
- package/src/sap/ui/layout/form/FormElement.js +1 -1
- package/src/sap/ui/layout/form/FormLayout.js +1 -1
- package/src/sap/ui/layout/form/GridContainerData.js +1 -1
- package/src/sap/ui/layout/form/GridElementData.js +1 -1
- package/src/sap/ui/layout/form/GridLayout.js +1 -1
- package/src/sap/ui/layout/form/ResponsiveGridLayout.js +1 -1
- package/src/sap/ui/layout/form/ResponsiveLayout.js +1 -1
- package/src/sap/ui/layout/form/SemanticFormElement.js +1 -1
- package/src/sap/ui/layout/form/SimpleForm.js +1 -1
- package/src/sap/ui/layout/library.js +2 -2
- package/src/sap/ui/layout/rules/Form.support.js +32 -32
|
@@ -6,14 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/changeHandler/Base",
|
|
9
|
-
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
10
|
-
"sap/base/Log",
|
|
11
|
-
"sap/ui/thirdparty/jquery"
|
|
9
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
12
10
|
], function(
|
|
13
11
|
Base,
|
|
14
|
-
JsControlTreeModifier
|
|
15
|
-
Log,
|
|
16
|
-
jQuery
|
|
12
|
+
JsControlTreeModifier
|
|
17
13
|
) {
|
|
18
14
|
"use strict";
|
|
19
15
|
|
|
@@ -21,7 +17,7 @@ sap.ui.define([
|
|
|
21
17
|
* Change handler for adding a form group.
|
|
22
18
|
* @alias sap.ui.layout.changeHandler.AddFormContainer
|
|
23
19
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
20
|
+
* @version 1.106.0
|
|
25
21
|
* @experimental Since 1.48.0
|
|
26
22
|
*/
|
|
27
23
|
var AddGroup = { };
|
|
@@ -42,18 +38,21 @@ sap.ui.define([
|
|
|
42
38
|
var oModifier = mPropertyBag.modifier;
|
|
43
39
|
var oAppComponent = mPropertyBag.appComponent;
|
|
44
40
|
var oView = mPropertyBag.view;
|
|
45
|
-
var
|
|
41
|
+
var oContent = oChange.getContent();
|
|
42
|
+
var oTexts = oChange.getTexts();
|
|
46
43
|
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
&&
|
|
50
|
-
&&
|
|
51
|
-
&&
|
|
52
|
-
&&
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var
|
|
56
|
-
var
|
|
44
|
+
if (
|
|
45
|
+
oTexts
|
|
46
|
+
&& oTexts.groupLabel
|
|
47
|
+
&& oTexts.groupLabel.value
|
|
48
|
+
&& oContent
|
|
49
|
+
&& oContent.group
|
|
50
|
+
&& (oContent.group.selector || oContent.group.id)
|
|
51
|
+
) {
|
|
52
|
+
var sTitleText = oTexts.groupLabel.value;
|
|
53
|
+
var iInsertIndex = oContent.group.index;
|
|
54
|
+
var mNewGroupSelector = oContent.group.selector || { id : oContent.group.id };
|
|
55
|
+
var mNewTitleSelector = Object.assign({}, mNewGroupSelector);
|
|
57
56
|
|
|
58
57
|
mNewTitleSelector.id = mNewTitleSelector.id + "--title"; //same as FormRenderer does it
|
|
59
58
|
oChange.setRevertData({newGroupSelector: mNewGroupSelector});
|
|
@@ -81,12 +80,6 @@ sap.ui.define([
|
|
|
81
80
|
.then(oModifier.insertAggregation.bind(oModifier, oForm, "formContainers", oGroup, iInsertIndex, oView));
|
|
82
81
|
});
|
|
83
82
|
} else {
|
|
84
|
-
Log.error("Change does not contain sufficient information to be applied: ["
|
|
85
|
-
+ oChangeDefinition.layer + "]"
|
|
86
|
-
+ oChangeDefinition.namespace + "/"
|
|
87
|
-
+ oChangeDefinition.fileName + "."
|
|
88
|
-
+ oChangeDefinition.fileType);
|
|
89
|
-
//however subsequent changes should be applied
|
|
90
83
|
return Promise.resolve();
|
|
91
84
|
}
|
|
92
85
|
};
|
|
@@ -103,32 +96,29 @@ sap.ui.define([
|
|
|
103
96
|
* @public
|
|
104
97
|
*/
|
|
105
98
|
AddGroup.completeChangeContent = function(oChange, oSpecificChangeInfo, mPropertyBag) {
|
|
106
|
-
var oChangeDefinition = oChange.getDefinition();
|
|
107
99
|
var oAppComponent = mPropertyBag.appComponent;
|
|
108
100
|
|
|
109
101
|
if (oSpecificChangeInfo.newLabel) {
|
|
110
|
-
|
|
102
|
+
oChange.setText("groupLabel", oSpecificChangeInfo.newLabel, "XFLD");
|
|
111
103
|
} else {
|
|
112
104
|
throw new Error("Cannot create a new group: oSpecificChangeInfo.groupLabel attribute required");
|
|
113
105
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
if (!oChangeDefinition.content.group) {
|
|
118
|
-
oChangeDefinition.content.group = {};
|
|
119
|
-
}
|
|
106
|
+
var oContent = {
|
|
107
|
+
group: {}
|
|
108
|
+
};
|
|
120
109
|
|
|
121
110
|
if (oSpecificChangeInfo.index === undefined) {
|
|
122
111
|
throw new Error("Cannot create a new group: oSpecificChangeInfo.index attribute required");
|
|
123
112
|
} else {
|
|
124
|
-
|
|
113
|
+
oContent.group.index = oSpecificChangeInfo.index;
|
|
125
114
|
}
|
|
126
115
|
|
|
127
116
|
if ( oSpecificChangeInfo.newControlId ){
|
|
128
|
-
|
|
117
|
+
oContent.group.selector = JsControlTreeModifier.getSelector(oSpecificChangeInfo.newControlId, oAppComponent);
|
|
129
118
|
} else {
|
|
130
119
|
throw new Error("Cannot create a new group: oSpecificChangeInfo.newControlId attribute required");
|
|
131
120
|
}
|
|
121
|
+
oChange.setContent(oContent);
|
|
132
122
|
};
|
|
133
123
|
|
|
134
124
|
/**
|
|
@@ -91,7 +91,7 @@ sap.ui.define([
|
|
|
91
91
|
*
|
|
92
92
|
* @author SAP SE
|
|
93
93
|
*
|
|
94
|
-
* @version 1.
|
|
94
|
+
* @version 1.106.0
|
|
95
95
|
*
|
|
96
96
|
* @experimental Since 1.49.0 This class is experimental and provides only limited functionality. Also the API might be
|
|
97
97
|
* changed in future.
|
|
@@ -108,9 +108,10 @@ sap.ui.define([
|
|
|
108
108
|
var aContentClone;
|
|
109
109
|
|
|
110
110
|
var oChange = mPropertyBag.change;
|
|
111
|
-
// as the label is stored independent of the field and will not be destroyed by destroying the field,
|
|
111
|
+
// as the label is stored independent of the field and will not be destroyed by destroying the field, it needs to be remembered
|
|
112
112
|
var oRevertData = oChange.getRevertData();
|
|
113
113
|
oRevertData.labelSelector = oModifier.getSelector(mInnerControls.label, oAppComponent);
|
|
114
|
+
oChange.setRevertData(oRevertData);
|
|
114
115
|
|
|
115
116
|
return Promise.resolve()
|
|
116
117
|
.then(oModifier.getAggregation.bind(oModifier, oSimpleForm, "content"))
|
|
@@ -175,7 +176,8 @@ sap.ui.define([
|
|
|
175
176
|
var oRevertData = oChange.getRevertData();
|
|
176
177
|
if (oRevertData && oRevertData.labelSelector) {
|
|
177
178
|
return {
|
|
178
|
-
affectedControls: [JsControlTreeModifier.bySelector(oRevertData.labelSelector, oAppComponent).
|
|
179
|
+
affectedControls: [JsControlTreeModifier.bySelector(oRevertData.labelSelector, oAppComponent).getId()],
|
|
180
|
+
hasParentWithUnstableId: true
|
|
179
181
|
};
|
|
180
182
|
}
|
|
181
183
|
return {
|
|
@@ -6,12 +6,10 @@
|
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
8
|
"sap/ui/fl/changeHandler/Base",
|
|
9
|
-
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
10
|
-
"sap/base/Log"
|
|
9
|
+
"sap/ui/core/util/reflection/JsControlTreeModifier"
|
|
11
10
|
], function (
|
|
12
11
|
Base,
|
|
13
|
-
JsControlTreeModifier
|
|
14
|
-
Log
|
|
12
|
+
JsControlTreeModifier
|
|
15
13
|
) {
|
|
16
14
|
"use strict";
|
|
17
15
|
|
|
@@ -19,7 +17,7 @@ sap.ui.define([
|
|
|
19
17
|
* Change handler for adding a simple form group.
|
|
20
18
|
* @alias sap.ui.layout.changeHandler.AddSimpleFormGroup
|
|
21
19
|
* @author SAP SE
|
|
22
|
-
* @version 1.
|
|
20
|
+
* @version 1.106.0
|
|
23
21
|
* @experimental Since 1.27.0
|
|
24
22
|
*/
|
|
25
23
|
var AddSimpleFormGroup = {};
|
|
@@ -94,11 +92,14 @@ sap.ui.define([
|
|
|
94
92
|
var oAppComponent = mPropertyBag.appComponent;
|
|
95
93
|
var iInsertIndex;
|
|
96
94
|
|
|
97
|
-
var
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
95
|
+
var oTexts = oChangeWrapper.getTexts();
|
|
96
|
+
var oContent = oChangeWrapper.getContent();
|
|
97
|
+
if (
|
|
98
|
+
oTexts && oTexts.groupLabel && oTexts.groupLabel.value
|
|
99
|
+
&& oContent && oContent.group &&
|
|
100
|
+
(oContent.group.selector || oContent.group.id)
|
|
101
|
+
) {
|
|
102
|
+
var oGroupSelector = oContent.group.selector;
|
|
102
103
|
var sGroupId;
|
|
103
104
|
if (oGroupSelector) {
|
|
104
105
|
if (oGroupSelector.idIsLocal) {
|
|
@@ -107,21 +108,21 @@ sap.ui.define([
|
|
|
107
108
|
sGroupId = oGroupSelector.id;
|
|
108
109
|
}
|
|
109
110
|
} else {
|
|
110
|
-
sGroupId =
|
|
111
|
+
sGroupId = oContent.group.id;
|
|
111
112
|
}
|
|
112
113
|
oChangeWrapper.setRevertData({groupId: sGroupId});
|
|
113
|
-
var sLabelText =
|
|
114
|
+
var sLabelText = oTexts.groupLabel.value;
|
|
114
115
|
var iRelativeIndex;
|
|
115
116
|
return Promise.resolve()
|
|
116
117
|
.then(function(){
|
|
117
118
|
return oModifier.getAggregation(oForm, AddSimpleFormGroup.CONTENT_AGGREGATION);
|
|
118
119
|
})
|
|
119
120
|
.then(function(aContent){
|
|
120
|
-
if (typeof
|
|
121
|
+
if (typeof oContent.group.index === "number") {
|
|
121
122
|
// The old code support
|
|
122
|
-
return
|
|
123
|
+
return oContent.group.index;
|
|
123
124
|
} else {
|
|
124
|
-
iRelativeIndex =
|
|
125
|
+
iRelativeIndex = oContent.group.relativeIndex;
|
|
125
126
|
return fnMapGroupIndexToContentAggregationIndex(oModifier,
|
|
126
127
|
["sap.ui.core.Title", "sap.m.Title", "sap.m.Toolbar", "sap.m.OverflowToolbar"],
|
|
127
128
|
aContent, iRelativeIndex);
|
|
@@ -139,17 +140,13 @@ sap.ui.define([
|
|
|
139
140
|
oModifier.setProperty(oTitle, "text", sLabelText);
|
|
140
141
|
return oModifier.insertAggregation(oForm, "content", oTitle, iInsertIndex, oView);
|
|
141
142
|
});
|
|
142
|
-
|
|
143
|
-
} else {
|
|
144
|
-
Log.error("Change does not contain sufficient information to be applied: [" + oChange.layer + "]" + oChange.namespace + "/" + oChange.fileName + "." + oChange.fileType);
|
|
145
|
-
//however subsequent changes should be applied
|
|
146
143
|
}
|
|
147
144
|
};
|
|
148
145
|
|
|
149
146
|
/**
|
|
150
147
|
* Completes the change by adding change handler specific content
|
|
151
148
|
*
|
|
152
|
-
* @param {sap.ui.fl.Change}
|
|
149
|
+
* @param {sap.ui.fl.Change} oChange Change wrapper object to be completed
|
|
153
150
|
* @param {object} oSpecificChangeInfo with attributes "groupLabel", the group label to be included in the change and "newControlId", the control ID for the control to be added
|
|
154
151
|
* @param {object} mPropertyBag Property bag containing the modifier, the appComponent and the view
|
|
155
152
|
* @param {object} mPropertyBag.modifier Modifier for the controls
|
|
@@ -157,23 +154,19 @@ sap.ui.define([
|
|
|
157
154
|
* @param {object} mPropertyBag.view Application view
|
|
158
155
|
* @public
|
|
159
156
|
*/
|
|
160
|
-
AddSimpleFormGroup.completeChangeContent = function (
|
|
161
|
-
var oChange = oChangeWrapper.getDefinition();
|
|
157
|
+
AddSimpleFormGroup.completeChangeContent = function (oChange, oSpecificChangeInfo, mPropertyBag) {
|
|
162
158
|
var oAppComponent = mPropertyBag.appComponent;
|
|
159
|
+
var oContent = {
|
|
160
|
+
group: {}
|
|
161
|
+
};
|
|
163
162
|
|
|
164
163
|
if (oSpecificChangeInfo.newLabel) {
|
|
165
|
-
|
|
164
|
+
oChange.setText("groupLabel", oSpecificChangeInfo.newLabel, "XFLD");
|
|
166
165
|
} else {
|
|
167
166
|
throw new Error("oSpecificChangeInfo.newLabel attribute required");
|
|
168
167
|
}
|
|
169
|
-
if (!oChange.content) {
|
|
170
|
-
oChange.content = {};
|
|
171
|
-
}
|
|
172
|
-
if (!oChange.content.group) {
|
|
173
|
-
oChange.content.group = {};
|
|
174
|
-
}
|
|
175
168
|
if (oSpecificChangeInfo.newControlId) {
|
|
176
|
-
|
|
169
|
+
oContent.group.selector = JsControlTreeModifier.getSelector(oSpecificChangeInfo.newControlId, oAppComponent);
|
|
177
170
|
} else {
|
|
178
171
|
throw new Error("oSpecificChangeInfo.newControlId attribute required");
|
|
179
172
|
}
|
|
@@ -181,8 +174,10 @@ sap.ui.define([
|
|
|
181
174
|
if (oSpecificChangeInfo.index === undefined) {
|
|
182
175
|
throw new Error("oSpecificChangeInfo.index attribute required");
|
|
183
176
|
} else {
|
|
184
|
-
|
|
177
|
+
oContent.group.relativeIndex = oSpecificChangeInfo.index;
|
|
185
178
|
}
|
|
179
|
+
|
|
180
|
+
oChange.setContent(oContent);
|
|
186
181
|
};
|
|
187
182
|
|
|
188
183
|
/**
|
|
@@ -195,8 +190,8 @@ sap.ui.define([
|
|
|
195
190
|
AddSimpleFormGroup.getControlIdFromChangeContent = function (oChange) {
|
|
196
191
|
var sControlId;
|
|
197
192
|
|
|
198
|
-
if (oChange && oChange.
|
|
199
|
-
sControlId = oChange.
|
|
193
|
+
if (oChange && oChange.getContent()) {
|
|
194
|
+
sControlId = oChange.getContent().group.id;
|
|
200
195
|
}
|
|
201
196
|
|
|
202
197
|
return sControlId;
|
|
@@ -233,10 +228,11 @@ sap.ui.define([
|
|
|
233
228
|
};
|
|
234
229
|
|
|
235
230
|
AddSimpleFormGroup.getChangeVisualizationInfo = function(oChange, oAppComponent) {
|
|
236
|
-
var oSelector = oChange.
|
|
237
|
-
var oAffectedGroup = JsControlTreeModifier.bySelector(oSelector, oAppComponent).
|
|
231
|
+
var oSelector = oChange.getContent().group.selector;
|
|
232
|
+
var oAffectedGroup = JsControlTreeModifier.bySelector(oSelector, oAppComponent).getId();
|
|
238
233
|
return {
|
|
239
|
-
affectedControls: [oAffectedGroup]
|
|
234
|
+
affectedControls: [oAffectedGroup],
|
|
235
|
+
hasParentWithUnstableId: true
|
|
240
236
|
};
|
|
241
237
|
};
|
|
242
238
|
|
|
@@ -17,7 +17,7 @@ sap.ui.define([
|
|
|
17
17
|
* Change handler for hiding of a control.
|
|
18
18
|
* @alias sap.ui.fl.changeHandler.HideControl
|
|
19
19
|
* @author SAP SE
|
|
20
|
-
* @version 1.
|
|
20
|
+
* @version 1.106.0
|
|
21
21
|
* @experimental Since 1.27.0
|
|
22
22
|
*/
|
|
23
23
|
var HideForm = { };
|
|
@@ -44,6 +44,10 @@ sap.ui.define([
|
|
|
44
44
|
return mPropertyBag.modifier.targets === "xmlTree";
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
function getGroupHeader(oElement) {
|
|
48
|
+
return oElement.getTitle() || oElement.getToolbar();
|
|
49
|
+
}
|
|
50
|
+
|
|
47
51
|
/**
|
|
48
52
|
* Hides a control.
|
|
49
53
|
*
|
|
@@ -58,7 +62,6 @@ sap.ui.define([
|
|
|
58
62
|
var oView = mPropertyBag.view;
|
|
59
63
|
var oAppComponent = mPropertyBag.appComponent;
|
|
60
64
|
|
|
61
|
-
var oChangeDefinition = oChange.getDefinition();
|
|
62
65
|
|
|
63
66
|
// in case of custom fields the application needs to be on JS.
|
|
64
67
|
// In the other case the visuality of the hidden control will be overriden by the custom field binding afterwards
|
|
@@ -66,8 +69,9 @@ sap.ui.define([
|
|
|
66
69
|
return Promise.reject(Error("Change cannot be applied in XML. Retrying in JS."));
|
|
67
70
|
}
|
|
68
71
|
|
|
72
|
+
var oContent = oChange.getContent();
|
|
69
73
|
// !important : sHideId was used in 1.40, do not remove for compatibility!
|
|
70
|
-
var oRemovedElement = oModifier.bySelector(
|
|
74
|
+
var oRemovedElement = oModifier.bySelector(oContent.elementSelector || oContent.sHideId, oAppComponent, oView);
|
|
71
75
|
var aContent;
|
|
72
76
|
|
|
73
77
|
return this._getState(oControl, oModifier, oAppComponent)
|
|
@@ -88,7 +92,8 @@ sap.ui.define([
|
|
|
88
92
|
})
|
|
89
93
|
.then(function() {
|
|
90
94
|
var iStart = -1;
|
|
91
|
-
|
|
95
|
+
var sChangeType = oChange.getChangeType();
|
|
96
|
+
if (sChangeType === "hideSimpleFormField") {
|
|
92
97
|
aContent.some(function (oField, index) {
|
|
93
98
|
if (oField === oRemovedElement) {
|
|
94
99
|
iStart = index;
|
|
@@ -104,7 +109,7 @@ sap.ui.define([
|
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
});
|
|
107
|
-
} else if (
|
|
112
|
+
} else if (sChangeType === "removeSimpleFormGroup") {
|
|
108
113
|
var aPromises = [];
|
|
109
114
|
var oTitleOrToolbar = fnGetFirstToolbarOrTitle(aContent, oModifier);
|
|
110
115
|
var bFirstContainerWithoutTitle = oTitleOrToolbar && !oRemovedElement;
|
|
@@ -161,7 +166,7 @@ sap.ui.define([
|
|
|
161
166
|
}
|
|
162
167
|
return Promise.resolve();
|
|
163
168
|
})
|
|
164
|
-
.
|
|
169
|
+
.catch(function(oError) {
|
|
165
170
|
oChange.resetRevertData();
|
|
166
171
|
Log.error(oError.message || oError.name);
|
|
167
172
|
});
|
|
@@ -192,10 +197,11 @@ sap.ui.define([
|
|
|
192
197
|
* @public
|
|
193
198
|
*/
|
|
194
199
|
HideForm.completeChangeContent = function(oChangeWrapper, oSpecificChangeInfo, mPropertyBag) {
|
|
195
|
-
var oChange = oChangeWrapper.getDefinition();
|
|
196
200
|
if (oSpecificChangeInfo.removedElement && oSpecificChangeInfo.removedElement.id) {
|
|
197
201
|
var oStableElement = this._getStableElement(sap.ui.getCore().byId(oSpecificChangeInfo.removedElement.id));
|
|
198
|
-
|
|
202
|
+
oChangeWrapper.setContent({
|
|
203
|
+
elementSelector: JsControlTreeModifier.getSelector(oStableElement, mPropertyBag.appComponent)
|
|
204
|
+
});
|
|
199
205
|
oChangeWrapper.addDependentControl(oStableElement, "elementSelector", mPropertyBag);
|
|
200
206
|
} else {
|
|
201
207
|
throw new Error("oSpecificChangeInfo.removedElement.id attribute required");
|
|
@@ -268,14 +274,17 @@ sap.ui.define([
|
|
|
268
274
|
};
|
|
269
275
|
|
|
270
276
|
HideForm.getChangeVisualizationInfo = function(oChange, oAppComponent) {
|
|
271
|
-
var oSelector = oChange.
|
|
277
|
+
var oSelector = oChange.getContent().elementSelector;
|
|
272
278
|
var oElement = JsControlTreeModifier.bySelector(oSelector, oAppComponent);
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
279
|
+
// to show the change indicator on the correct position a stable id needs to be passed to the ChangeIndicatorRegistry
|
|
280
|
+
var oStableElementId = oChange.getChangeType() === "hideSimpleFormField"
|
|
281
|
+
? getGroupHeader(oElement.getParent().getParent()).getId()
|
|
282
|
+
: oElement.getId();
|
|
283
|
+
|
|
276
284
|
return {
|
|
277
285
|
affectedControls: [oSelector],
|
|
278
|
-
displayControls: [
|
|
286
|
+
displayControls: [oStableElementId],
|
|
287
|
+
hasParentWithUnstableId: true
|
|
279
288
|
};
|
|
280
289
|
};
|
|
281
290
|
|
|
@@ -20,7 +20,7 @@ sap.ui.define([
|
|
|
20
20
|
*
|
|
21
21
|
* @alias sap.ui.layout.changeHandler.MoveSimpleForm
|
|
22
22
|
* @author SAP SE
|
|
23
|
-
* @version 1.
|
|
23
|
+
* @version 1.106.0
|
|
24
24
|
* @experimental Since 1.34.0
|
|
25
25
|
*/
|
|
26
26
|
var MoveSimpleForm = {};
|
|
@@ -168,12 +168,8 @@ sap.ui.define([
|
|
|
168
168
|
return aResult;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
function getGroupHeader(
|
|
172
|
-
|
|
173
|
-
if (!oResult) {
|
|
174
|
-
oResult = oHeader.getToolbar();
|
|
175
|
-
}
|
|
176
|
-
return oResult;
|
|
171
|
+
function getGroupHeader(oElement) {
|
|
172
|
+
return oElement.getTitle() || oElement.getToolbar();
|
|
177
173
|
}
|
|
178
174
|
|
|
179
175
|
function moveFormContainer(oSimpleForm, mMovedElement, mPropertyBag) {
|
|
@@ -410,11 +406,13 @@ sap.ui.define([
|
|
|
410
406
|
Log.error("Element not found. This may be caused by an unstable id!");
|
|
411
407
|
}
|
|
412
408
|
|
|
413
|
-
var
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
409
|
+
var oContent = {
|
|
410
|
+
targetSelector: mStableChangeInfo.targetSelector,
|
|
411
|
+
movedElements: mStableChangeInfo.movedElements,
|
|
412
|
+
// legacy changes had only a string with <appComponentId>---<uid>
|
|
413
|
+
newControlId: oModifier.getSelector(oView.createId(uid()), oAppComponent)
|
|
414
|
+
};
|
|
415
|
+
oChange.setContent(oContent);
|
|
418
416
|
|
|
419
417
|
if (mStableChangeInfo.source && mStableChangeInfo.target){
|
|
420
418
|
oChange.addDependentControl(mStableChangeInfo.source, "sourceParent", mPropertyBag);
|
|
@@ -467,14 +465,12 @@ sap.ui.define([
|
|
|
467
465
|
var oTargetParentContainer;
|
|
468
466
|
var oMovedElement = oChange.getContent().movedElements[0];
|
|
469
467
|
var oGroupSelector = oMovedElement.source.groupSelector;
|
|
470
|
-
var oAffectedControlSelector = JsControlTreeModifier.bySelector(oMovedElement.elementSelector, oAppComponent).
|
|
468
|
+
var oAffectedControlSelector = JsControlTreeModifier.bySelector(oMovedElement.elementSelector, oAppComponent).getId();
|
|
471
469
|
if (oChange.getChangeType() === MoveSimpleForm.CHANGE_TYPE_MOVE_FIELD) {
|
|
472
|
-
var
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
oSourceParentContainer = oChange.getDependentControl("sourceParent", mPropertyBag).getParent().getId();
|
|
477
|
-
oTargetParentContainer = oChange.getDependentControl("targetParent", mPropertyBag).getParent().getId();
|
|
470
|
+
var oSourceParentTitleElement = JsControlTreeModifier.bySelector(oMovedElement.source.groupSelector, oAppComponent);
|
|
471
|
+
var oTargetParentTitleElement = JsControlTreeModifier.bySelector(oMovedElement.target.groupSelector, oAppComponent);
|
|
472
|
+
oSourceParentContainer = oSourceParentTitleElement ? oSourceParentTitleElement.getParent().getId() : null;
|
|
473
|
+
oTargetParentContainer = oTargetParentTitleElement ? oTargetParentTitleElement.getParent().getId() : null;
|
|
478
474
|
oGroupSelector = {
|
|
479
475
|
id: oSourceParentContainer
|
|
480
476
|
};
|
|
@@ -486,6 +482,7 @@ sap.ui.define([
|
|
|
486
482
|
? oGroupSelector
|
|
487
483
|
: oChange.getContent().targetSelector
|
|
488
484
|
],
|
|
485
|
+
hasParentWithUnstableId: true,
|
|
489
486
|
payload: {
|
|
490
487
|
sourceParentContainer: oSourceParentContainer,
|
|
491
488
|
targetParentContainer: oTargetParentContainer
|
|
@@ -5,11 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
sap.ui.define([
|
|
8
|
-
"sap/ui/fl/changeHandler/Base",
|
|
9
|
-
"sap/base/Log"
|
|
10
8
|
], function(
|
|
11
|
-
BaseChangeHandler,
|
|
12
|
-
Log
|
|
13
9
|
) {
|
|
14
10
|
"use strict";
|
|
15
11
|
|
|
@@ -18,7 +14,7 @@ sap.ui.define([
|
|
|
18
14
|
*
|
|
19
15
|
* @alias sap.ui.layout.changeHandler.RenameFormContainer
|
|
20
16
|
* @author SAP SE
|
|
21
|
-
* @version 1.
|
|
17
|
+
* @version 1.106.0
|
|
22
18
|
* @since 1.48
|
|
23
19
|
* @private
|
|
24
20
|
* @experimental Since 1.48. This class is experimental and provides only limited functionality. Also the API might be changed in future.
|
|
@@ -42,7 +38,7 @@ sap.ui.define([
|
|
|
42
38
|
*/
|
|
43
39
|
RenameFormContainer.applyChange = function(oChangeWrapper, oControl, mPropertyBag) {
|
|
44
40
|
var oModifier = mPropertyBag.modifier,
|
|
45
|
-
|
|
41
|
+
oTexts = oChangeWrapper.getTexts(),
|
|
46
42
|
oRenamedElement = oChangeWrapper.getDependentControl(_CONSTANTS.TARGET_ALIAS, mPropertyBag);
|
|
47
43
|
|
|
48
44
|
return Promise.resolve()
|
|
@@ -50,9 +46,8 @@ sap.ui.define([
|
|
|
50
46
|
return oModifier.getAggregation(oRenamedElement, "title");
|
|
51
47
|
})
|
|
52
48
|
.then(function(oTitle) {
|
|
53
|
-
if (
|
|
54
|
-
|
|
55
|
-
var sValue = oChangeDefinition.texts.formText.value;
|
|
49
|
+
if (oTexts && oTexts.formText && this._isProvided(oTexts.formText.value)) {
|
|
50
|
+
var sValue = oTexts.formText.value;
|
|
56
51
|
var oRevertDataPromise;
|
|
57
52
|
if (typeof oTitle === "string") {
|
|
58
53
|
oRevertDataPromise = Promise.resolve(oModifier.getProperty(oRenamedElement, "title")).then(function(sTitle) {
|
|
@@ -66,9 +61,6 @@ sap.ui.define([
|
|
|
66
61
|
});
|
|
67
62
|
}
|
|
68
63
|
return oRevertDataPromise;
|
|
69
|
-
} else {
|
|
70
|
-
Log.error("Change does not contain sufficient information to be applied: [" + oChangeDefinition.layer + "]" + oChangeDefinition.namespace + "/" + oChangeDefinition.fileName + "." + oChangeDefinition.fileType);
|
|
71
|
-
//however subsequent changes should be applied
|
|
72
64
|
}
|
|
73
65
|
}.bind(this));
|
|
74
66
|
};
|
|
@@ -76,14 +68,12 @@ sap.ui.define([
|
|
|
76
68
|
/**
|
|
77
69
|
* Completes the change by adding change handler specific content
|
|
78
70
|
*
|
|
79
|
-
* @param {sap.ui.fl.Change}
|
|
71
|
+
* @param {sap.ui.fl.Change} oChange Change wrapper object to be completed
|
|
80
72
|
* @param {object} oSpecificChangeInfo With attribute fieldLabel, the new field label to be included in the change
|
|
81
73
|
* @param {object} mPropertyBag Map containing the application component
|
|
82
74
|
* @private
|
|
83
75
|
*/
|
|
84
|
-
RenameFormContainer.completeChangeContent = function(
|
|
85
|
-
var oChangeDefinition = oChangeWrapper.getDefinition();
|
|
86
|
-
|
|
76
|
+
RenameFormContainer.completeChangeContent = function(oChange, oSpecificChangeInfo, mPropertyBag) {
|
|
87
77
|
if (!(oSpecificChangeInfo.renamedElement && oSpecificChangeInfo.renamedElement.id)) {
|
|
88
78
|
throw new Error("Rename of the group cannot be executed: oSpecificChangeInfo.renamedElement attribute required");
|
|
89
79
|
}
|
|
@@ -92,9 +82,8 @@ sap.ui.define([
|
|
|
92
82
|
throw new Error("Rename of the group cannot be executed: oSpecificChangeInfo.value attribute required");
|
|
93
83
|
}
|
|
94
84
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
85
|
+
oChange.addDependentControl(oSpecificChangeInfo.renamedElement.id, _CONSTANTS.TARGET_ALIAS, mPropertyBag);
|
|
86
|
+
oChange.setText("formText", oSpecificChangeInfo.value, "XGRP");
|
|
98
87
|
};
|
|
99
88
|
|
|
100
89
|
/**
|