@openui5/sap.ui.layout 1.91.0 → 1.93.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.reuse/dep5 +46 -0
  2. package/THIRDPARTY.txt +59 -1
  3. package/package.json +2 -2
  4. package/src/sap/ui/layout/.library +1 -1
  5. package/src/sap/ui/layout/AlignedFlowLayout.js +1 -1
  6. package/src/sap/ui/layout/AssociativeSplitter.js +1 -1
  7. package/src/sap/ui/layout/BlockLayout.js +1 -1
  8. package/src/sap/ui/layout/BlockLayoutCell.js +1 -1
  9. package/src/sap/ui/layout/BlockLayoutCellData.js +1 -1
  10. package/src/sap/ui/layout/BlockLayoutRow.js +2 -2
  11. package/src/sap/ui/layout/DynamicSideContent.js +4 -4
  12. package/src/sap/ui/layout/FixFlex.js +1 -1
  13. package/src/sap/ui/layout/Grid.js +1 -1
  14. package/src/sap/ui/layout/GridData.js +1 -1
  15. package/src/sap/ui/layout/GridRenderer.js +1 -1
  16. package/src/sap/ui/layout/HorizontalLayout.js +1 -1
  17. package/src/sap/ui/layout/PaneContainer.js +40 -2
  18. package/src/sap/ui/layout/ResponsiveFlowLayout.js +1 -1
  19. package/src/sap/ui/layout/ResponsiveFlowLayoutData.js +1 -1
  20. package/src/sap/ui/layout/ResponsiveSplitter.js +1 -1
  21. package/src/sap/ui/layout/ResponsiveSplitterPage.js +1 -1
  22. package/src/sap/ui/layout/SplitPane.js +13 -4
  23. package/src/sap/ui/layout/Splitter.js +2 -2
  24. package/src/sap/ui/layout/SplitterLayoutData.js +6 -2
  25. package/src/sap/ui/layout/VerticalLayout.js +1 -1
  26. package/src/sap/ui/layout/changeHandler/AddFormContainer.js +49 -22
  27. package/src/sap/ui/layout/changeHandler/AddFormField.js +40 -30
  28. package/src/sap/ui/layout/changeHandler/AddSimpleFormField.js +42 -27
  29. package/src/sap/ui/layout/changeHandler/AddSimpleFormGroup.js +76 -60
  30. package/src/sap/ui/layout/changeHandler/HideSimpleForm.js +166 -92
  31. package/src/sap/ui/layout/changeHandler/MoveSimpleForm.js +185 -141
  32. package/src/sap/ui/layout/changeHandler/RenameFormContainer.js +45 -35
  33. package/src/sap/ui/layout/changeHandler/RenameSimpleForm.js +13 -9
  34. package/src/sap/ui/layout/changeHandler/UnhideSimpleForm.js +64 -49
  35. package/src/sap/ui/layout/cssgrid/CSSGrid.js +1 -1
  36. package/src/sap/ui/layout/cssgrid/GridBasicLayout.js +1 -1
  37. package/src/sap/ui/layout/cssgrid/GridBoxLayout.js +1 -1
  38. package/src/sap/ui/layout/cssgrid/GridBoxLayoutStyleHelper.js +1 -1
  39. package/src/sap/ui/layout/cssgrid/GridItemLayoutData.js +1 -1
  40. package/src/sap/ui/layout/cssgrid/GridLayoutBase.js +1 -1
  41. package/src/sap/ui/layout/cssgrid/GridLayoutDelegate.js +1 -1
  42. package/src/sap/ui/layout/cssgrid/GridResponsiveLayout.js +1 -1
  43. package/src/sap/ui/layout/cssgrid/GridSettings.js +1 -1
  44. package/src/sap/ui/layout/cssgrid/ResponsiveColumnItemLayoutData.js +1 -1
  45. package/src/sap/ui/layout/cssgrid/ResponsiveColumnLayout.js +1 -1
  46. package/src/sap/ui/layout/designtime/form/SimpleForm.designtime.js +7 -2
  47. package/src/sap/ui/layout/form/ColumnContainerData.js +1 -1
  48. package/src/sap/ui/layout/form/ColumnElementData.js +1 -1
  49. package/src/sap/ui/layout/form/ColumnLayout.js +8 -5
  50. package/src/sap/ui/layout/form/ColumnLayoutRenderer.js +4 -5
  51. package/src/sap/ui/layout/form/Form.js +3 -3
  52. package/src/sap/ui/layout/form/FormContainer.js +3 -3
  53. package/src/sap/ui/layout/form/FormElement.js +2 -4
  54. package/src/sap/ui/layout/form/FormLayout.js +61 -5
  55. package/src/sap/ui/layout/form/FormLayoutRenderer.js +30 -19
  56. package/src/sap/ui/layout/form/GridContainerData.js +1 -1
  57. package/src/sap/ui/layout/form/GridElementData.js +1 -1
  58. package/src/sap/ui/layout/form/GridLayout.js +1 -1
  59. package/src/sap/ui/layout/form/GridLayoutRenderer.js +5 -9
  60. package/src/sap/ui/layout/form/ResponsiveGridLayout.js +8 -10
  61. package/src/sap/ui/layout/form/ResponsiveLayout.js +9 -4
  62. package/src/sap/ui/layout/form/SemanticFormElement.js +53 -36
  63. package/src/sap/ui/layout/form/SimpleForm.js +12 -10
  64. package/src/sap/ui/layout/library.js +4 -2
  65. package/src/sap/ui/layout/themes/base/GridLayout.less +0 -17
  66. package/src/sap/ui/layout/themes/base/ResponsiveLayout.less +0 -10
  67. package/src/sap/ui/layout/themes/base/ResponsiveSplitter.less +4 -2
  68. package/src/sap/ui/layout/themes/base/Splitter.less +1 -9
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  *
20
20
  * @author SAP SE
21
21
  *
22
- * @version 1.91.0
22
+ * @version 1.93.2
23
23
  *
24
24
  * @experimental Since 1.50.0 This class is experimental and provides only limited functionality. Also the API might be
25
25
  * changed in future.
@@ -37,37 +37,47 @@ sap.ui.define([
37
37
  var mFieldSelector = mChangeContent.newFieldSelector;
38
38
 
39
39
  var oCreatedFormElement;
40
+ var oParentFormContainer;
40
41
 
41
- // "layoutControl" property is present only when the control is returned from Delegate.createLayout()
42
- if (!mInnerControls.layoutControl) {
43
- oCreatedFormElement = oModifier.createControl(
44
- "sap.ui.layout.form.FormElement",
45
- oAppComponent,
46
- oView,
47
- mFieldSelector
48
- );
49
- oModifier.insertAggregation(oCreatedFormElement, "label", mInnerControls.label, 0, oView);
50
- oModifier.insertAggregation(oCreatedFormElement, "fields", mInnerControls.control, 0, oView);
51
- } else {
52
- oCreatedFormElement = mInnerControls.control;
53
- }
42
+ return Promise.resolve()
43
+ .then(function(){
44
+ // "layoutControl" property is present only when the control is returned from Delegate.createLayout()
45
+ if (!mInnerControls.layoutControl) {
46
+ return Promise.resolve()
47
+ .then(oModifier.createControl.bind(oModifier, "sap.ui.layout.form.FormElement", oAppComponent, oView, mFieldSelector))
48
+ .then(function(oCreatedControl) {
49
+ oCreatedFormElement = oCreatedControl;
50
+ return Promise.all([
51
+ oModifier.insertAggregation(oCreatedFormElement, "label", mInnerControls.label, 0, oView),
52
+ oModifier.insertAggregation(oCreatedFormElement, "fields", mInnerControls.control, 0, oView)
53
+ ]);
54
+ });
55
+ }
56
+ oCreatedFormElement = mInnerControls.control;
57
+ return undefined;
58
+ })
59
+ .then(function(){
60
+ oParentFormContainer = oChange.getDependentControl("parentFormContainer", mPropertyBag);
61
+ return oModifier.insertAggregation(oParentFormContainer,
62
+ "formElements",
63
+ oCreatedFormElement,
64
+ iIndex,
65
+ oView
66
+ );
67
+ })
68
+ .then(function(){
69
+ if (mInnerControls.valueHelp) {
70
+ return oModifier.insertAggregation(
71
+ oParentFormContainer,
72
+ "dependents",
73
+ mInnerControls.valueHelp,
74
+ 0,
75
+ oView
76
+ );
77
+ }
78
+ return undefined;
79
+ });
54
80
 
55
- var oParentFormContainer = oChange.getDependentControl("parentFormContainer", mPropertyBag);
56
- oModifier.insertAggregation(oParentFormContainer,
57
- "formElements",
58
- oCreatedFormElement,
59
- iIndex,
60
- oView
61
- );
62
- if (mInnerControls.valueHelp) {
63
- oModifier.insertAggregation(
64
- oParentFormContainer,
65
- "dependents",
66
- mInnerControls.valueHelp,
67
- 0,
68
- oView
69
- );
70
- }
71
81
  },
72
82
  aggregationName: "formElements",
73
83
  parentAlias: "parentFormContainer",
@@ -67,15 +67,17 @@ sap.ui.define([
67
67
  }
68
68
 
69
69
  function recreateContentAggregation(oSimpleForm, aContentClone, oModifier, mPropertyBag) {
70
- oModifier.removeAllAggregation(oSimpleForm, "content");
71
- for (var i = 0; i < aContentClone.length; ++i) {
72
- oModifier.insertAggregation(oSimpleForm,
73
- "content",
74
- aContentClone[i],
75
- i,
76
- mPropertyBag.view
77
- );
78
- }
70
+ return aContentClone.reduce(function(oPreviousPromise, oContentClone, iIndex) {
71
+ return oPreviousPromise
72
+ .then(function() {
73
+ return oModifier.insertAggregation(oSimpleForm,
74
+ "content",
75
+ oContentClone,
76
+ iIndex,
77
+ mPropertyBag.view
78
+ );
79
+ });
80
+ }, Promise.resolve());
79
81
  }
80
82
 
81
83
  /**
@@ -87,7 +89,7 @@ sap.ui.define([
87
89
  *
88
90
  * @author SAP SE
89
91
  *
90
- * @version 1.91.0
92
+ * @version 1.93.2
91
93
  *
92
94
  * @experimental Since 1.49.0 This class is experimental and provides only limited functionality. Also the API might be
93
95
  * changed in future.
@@ -99,27 +101,38 @@ sap.ui.define([
99
101
  var mInnerControls = mPropertyBag.innerControls;
100
102
  var oModifier = mPropertyBag.modifier;
101
103
  var oAppComponent = mPropertyBag.appComponent;
104
+ var aContent;
105
+ var iNewIndex;
106
+ var aContentClone;
102
107
 
103
108
  var oChange = mPropertyBag.change;
104
109
  // as the label is stored independent of the field and will not be destroyed by destroying the field, is needs to be remembered
105
110
  var oRevertData = oChange.getRevertData();
106
111
  oRevertData.labelSelector = oModifier.getSelector(mInnerControls.label, oAppComponent);
107
112
 
108
- var aContent = oModifier.getAggregation(oSimpleForm, "content");
109
- var iNewIndex = getIndex(aContent, mPropertyBag);
110
- var aContentClone = insertLabelAndField(aContent, iNewIndex, mInnerControls);
111
-
112
- recreateContentAggregation(oSimpleForm, aContentClone, oModifier, mPropertyBag);
113
-
114
- if (mInnerControls.valueHelp) {
115
- oModifier.insertAggregation(
116
- oSimpleForm,
117
- "dependents",
118
- mInnerControls.valueHelp,
119
- 0,
120
- mPropertyBag.view
121
- );
122
- }
113
+ return Promise.resolve()
114
+ .then(oModifier.getAggregation.bind(oModifier, oSimpleForm, "content"))
115
+ .then(function(aAggregationContent) {
116
+ aContent = aAggregationContent;
117
+ iNewIndex = getIndex(aContent, mPropertyBag);
118
+ aContentClone = insertLabelAndField(aContent, iNewIndex, mInnerControls);
119
+ return oModifier.removeAllAggregation(oSimpleForm, "content");
120
+ })
121
+ .then(function() {
122
+ return recreateContentAggregation(oSimpleForm, aContentClone, oModifier, mPropertyBag);
123
+ })
124
+ .then(function() {
125
+ if (mInnerControls.valueHelp) {
126
+ return oModifier.insertAggregation(
127
+ oSimpleForm,
128
+ "dependents",
129
+ mInnerControls.valueHelp,
130
+ 0,
131
+ mPropertyBag.view
132
+ );
133
+ }
134
+ return undefined;
135
+ });
123
136
  },
124
137
  revertAdditionalControls : function(mPropertyBag) {
125
138
  var oSimpleForm = mPropertyBag.control;
@@ -130,9 +143,11 @@ sap.ui.define([
130
143
  var mLabelSelector = oChange.getRevertData().labelSelector;
131
144
  if (mLabelSelector) {
132
145
  var oLabel = oModifier.bySelector(mLabelSelector, oAppComponent);
133
- oModifier.removeAggregation(oSimpleForm, "content", oLabel);
134
- oModifier.destroy(oLabel);
146
+ return Promise.resolve()
147
+ .then(oModifier.removeAggregation.bind(oModifier, oSimpleForm, "content", oLabel))
148
+ .then(oModifier.destroy.bind(oModifier, oLabel));
135
149
  }
150
+ return Promise.resolve();
136
151
  },
137
152
  aggregationName: "content",
138
153
  mapParentIdIntoChange: function (oChange, mSpecificChangeInfo, mPropertyBag) {
@@ -6,7 +6,7 @@
6
6
 
7
7
  sap.ui.define([
8
8
  "sap/ui/fl/changeHandler/Base",
9
- "sap/ui/fl/changeHandler/JsControlTreeModifier",
9
+ "sap/ui/core/util/reflection/JsControlTreeModifier",
10
10
  "sap/base/Log"
11
11
  ], function (
12
12
  Base,
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * Change handler for adding a simple form group.
20
20
  * @alias sap.ui.layout.changeHandler.AddSimpleFormGroup
21
21
  * @author SAP SE
22
- * @version 1.91.0
22
+ * @version 1.93.2
23
23
  * @experimental Since 1.27.0
24
24
  */
25
25
  var AddSimpleFormGroup = {};
@@ -27,16 +27,25 @@ sap.ui.define([
27
27
  AddSimpleFormGroup.CONTENT_AGGREGATION = "content";
28
28
 
29
29
  var fnFirstGroupWithoutTitle = function(oModifier, aStopToken, aContent) {
30
- for (var i = 0; i < aContent.length; i++) {
31
- var sType = oModifier.getControlType(aContent[i]);
32
- if (aStopToken.indexOf(sType) === -1) {
33
- if (oModifier.getVisible(aContent[i])) {
34
- return true;
35
- }
36
- } else {
37
- return false;
38
- }
39
- }
30
+ return aContent.reduce(function(oPreviousPromise, oContent){
31
+ return oPreviousPromise
32
+ .then(function(bReturnValue){
33
+ if (bReturnValue !== undefined) {
34
+ return bReturnValue;
35
+ }
36
+ var sType = oModifier.getControlType(oContent);
37
+ if (aStopToken.indexOf(sType) === -1) {
38
+ return Promise.resolve()
39
+ .then(oModifier.getVisible.bind(oModifier, oContent))
40
+ .then(function(bVisible){
41
+ return bVisible || undefined;
42
+ });
43
+ } else {
44
+ return false;
45
+ }
46
+ });
47
+ }, Promise.resolve());
48
+
40
49
  };
41
50
 
42
51
  var fnMapGroupIndexToContentAggregationIndex = function(oModifier, aStopToken, aContent, iGroupIndex) {
@@ -47,22 +56,24 @@ sap.ui.define([
47
56
  if (iGroupIndex === 0) {
48
57
  return iGroupIndex;
49
58
  }
59
+ return fnFirstGroupWithoutTitle(oModifier, aStopToken, aContent)
60
+ .then(function(bFirstGroupWithoutName){
61
+ if (bFirstGroupWithoutName) {
62
+ iCurrentGroupIndex++;
63
+ }
50
64
 
51
- if (fnFirstGroupWithoutTitle(oModifier, aStopToken, aContent)) {
52
- iCurrentGroupIndex++;
53
- }
54
-
55
- for (var i = 0; i < aContent.length; i++) {
56
- var sType = oModifier.getControlType(aContent[i]);
57
- if (aStopToken.indexOf(sType) > -1) {
58
- iCurrentGroupIndex++;
59
- if (iCurrentGroupIndex === iGroupIndex) {
60
- oResult = aContent[i];
61
- return aContent.indexOf(oResult);
65
+ for (var i = 0; i < aContent.length; i++) {
66
+ var sType = oModifier.getControlType(aContent[i]);
67
+ if (aStopToken.indexOf(sType) > -1) {
68
+ iCurrentGroupIndex++;
69
+ if (iCurrentGroupIndex === iGroupIndex) {
70
+ oResult = aContent[i];
71
+ return aContent.indexOf(oResult);
72
+ }
73
+ }
62
74
  }
63
- }
64
- }
65
- return aContent.length;
75
+ return aContent.length;
76
+ });
66
77
  };
67
78
 
68
79
  /**
@@ -74,14 +85,14 @@ sap.ui.define([
74
85
  * @param {object} mPropertyBag.modifier Modifier for the controls
75
86
  * @param {object} mPropertyBag.appComponent Component in which the change should be applied
76
87
  * @param {object} mPropertyBag.view Application view
77
- * @return {boolean} True if successful
88
+ * @return {Promise} Promise resolving when change is applied successfully
78
89
  * @public
79
90
  */
80
91
  AddSimpleFormGroup.applyChange = function (oChangeWrapper, oForm, mPropertyBag) {
81
92
  var oModifier = mPropertyBag.modifier;
82
93
  var oView = mPropertyBag.view;
83
- var oAppComponent = mPropertyBag.appComponent,
84
- oTitle;
94
+ var oAppComponent = mPropertyBag.appComponent;
95
+ var iInsertIndex;
85
96
 
86
97
  var oChange = oChangeWrapper.getDefinition();
87
98
  if (oChange.texts && oChange.texts.groupLabel && oChange.texts.groupLabel.value &&
@@ -100,37 +111,39 @@ sap.ui.define([
100
111
  }
101
112
  oChangeWrapper.setRevertData({groupId: sGroupId});
102
113
  var sLabelText = oChange.texts.groupLabel.value;
103
-
104
- var aContent = oModifier.getAggregation(oForm, AddSimpleFormGroup.CONTENT_AGGREGATION);
105
-
106
- var iInsertIndex;
107
114
  var iRelativeIndex;
108
-
109
- if (typeof oChange.content.group.index === "number") {
110
- // The old code support
111
- iInsertIndex = oChange.content.group.index;
112
- } else {
113
- iRelativeIndex = oChange.content.group.relativeIndex;
114
- iInsertIndex = fnMapGroupIndexToContentAggregationIndex(oModifier,
115
- ["sap.ui.core.Title", "sap.m.Title", "sap.m.Toolbar", "sap.m.OverflowToolbar"],
116
- aContent, iRelativeIndex);
117
- }
118
-
119
- // Check if the change is applicable
120
- if (oModifier.bySelector(sGroupId, oAppComponent)) {
121
- return Base.markAsNotApplicable("Control to be created already exists:" + sGroupId);
122
- }
123
- oTitle = oModifier.createControl("sap.ui.core.Title", oAppComponent, oView, sGroupId);
124
-
125
- oModifier.setProperty(oTitle, "text", sLabelText);
126
- oModifier.insertAggregation(oForm, "content", oTitle, iInsertIndex, oView);
115
+ return Promise.resolve()
116
+ .then(function(){
117
+ return oModifier.getAggregation(oForm, AddSimpleFormGroup.CONTENT_AGGREGATION);
118
+ })
119
+ .then(function(aContent){
120
+ if (typeof oChange.content.group.index === "number") {
121
+ // The old code support
122
+ return oChange.content.group.index;
123
+ } else {
124
+ iRelativeIndex = oChange.content.group.relativeIndex;
125
+ return fnMapGroupIndexToContentAggregationIndex(oModifier,
126
+ ["sap.ui.core.Title", "sap.m.Title", "sap.m.Toolbar", "sap.m.OverflowToolbar"],
127
+ aContent, iRelativeIndex);
128
+ }
129
+ })
130
+ .then(function(iReturnedInsertIndex) {
131
+ iInsertIndex = iReturnedInsertIndex;
132
+ // Check if the change is applicable
133
+ if (oModifier.bySelector(sGroupId, oAppComponent)) {
134
+ return Base.markAsNotApplicable("Control to be created already exists:" + sGroupId);
135
+ }
136
+ return oModifier.createControl("sap.ui.core.Title", oAppComponent, oView, sGroupId);
137
+ })
138
+ .then(function(oTitle) {
139
+ oModifier.setProperty(oTitle, "text", sLabelText);
140
+ return oModifier.insertAggregation(oForm, "content", oTitle, iInsertIndex, oView);
141
+ });
127
142
 
128
143
  } else {
129
144
  Log.error("Change does not contain sufficient information to be applied: [" + oChange.layer + "]" + oChange.namespace + "/" + oChange.fileName + "." + oChange.fileType);
130
145
  //however subsequent changes should be applied
131
146
  }
132
-
133
- return true;
134
147
  };
135
148
 
136
149
  /**
@@ -198,7 +211,7 @@ sap.ui.define([
198
211
  * @param {object} mPropertyBag.modifier Modifier for the controls
199
212
  * @param {object} mPropertyBag.appComponent Component in which the change should be applied
200
213
  * @param {object} mPropertyBag.view Application view
201
- * @return {boolean} True if successful
214
+ * @return {Promise} Promise resolving when change is successfully reverted
202
215
  * @public
203
216
  */
204
217
  AddSimpleFormGroup.revertChange = function (oChangeWrapper, oForm, mPropertyBag) {
@@ -209,11 +222,14 @@ sap.ui.define([
209
222
 
210
223
  var oGroupSelector = oModifier.getSelector(sGroupId, oAppComponent);
211
224
  var oGroup = oModifier.bySelector(oGroupSelector, oAppComponent, oView);
212
- oModifier.removeAggregation(oForm, AddSimpleFormGroup.CONTENT_AGGREGATION, oGroup);
213
- oModifier.destroy(oGroup);
214
- oChangeWrapper.resetRevertData();
215
-
216
- return true;
225
+ return Promise.resolve()
226
+ .then(function() {
227
+ return oModifier.removeAggregation(oForm, AddSimpleFormGroup.CONTENT_AGGREGATION, oGroup);
228
+ })
229
+ .then(function() {
230
+ oModifier.destroy(oGroup);
231
+ oChangeWrapper.resetRevertData();
232
+ });
217
233
  };
218
234
 
219
235
  AddSimpleFormGroup.getChangeVisualizationInfo = function(oChange, oAppComponent) {