@openui5/sap.ui.mdc 1.100.0 → 1.101.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.
Files changed (204) hide show
  1. package/THIRDPARTY.txt +5 -5
  2. package/package.json +4 -4
  3. package/src/sap/ui/mdc/.library +1 -1
  4. package/src/sap/ui/mdc/ActionToolbar.js +1 -1
  5. package/src/sap/ui/mdc/Chart.js +28 -46
  6. package/src/sap/ui/mdc/ChartDelegate.js +10 -0
  7. package/src/sap/ui/mdc/Control.js +1 -1
  8. package/src/sap/ui/mdc/Element.js +1 -1
  9. package/src/sap/ui/mdc/Field.js +2 -2
  10. package/src/sap/ui/mdc/FilterBar.js +1 -1
  11. package/src/sap/ui/mdc/FilterField.js +2 -2
  12. package/src/sap/ui/mdc/Link.js +1 -1
  13. package/src/sap/ui/mdc/LinkDelegate.js +7 -5
  14. package/src/sap/ui/mdc/MultiValueField.js +1 -1
  15. package/src/sap/ui/mdc/Table.js +255 -284
  16. package/src/sap/ui/mdc/TableDelegate.js +96 -23
  17. package/src/sap/ui/mdc/ValueHelp.js +131 -624
  18. package/src/sap/ui/mdc/ValueHelpDelegate.js +152 -6
  19. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  20. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  21. package/src/sap/ui/mdc/chart/ChartToolbar.js +5 -3
  22. package/src/sap/ui/mdc/chart/ChartTypeButton.js +11 -2
  23. package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +2 -0
  24. package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
  25. package/src/sap/ui/mdc/condition/Condition.js +14 -9
  26. package/src/sap/ui/mdc/condition/ConditionConverter.js +58 -6
  27. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  28. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  29. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +6 -2
  30. package/src/sap/ui/mdc/condition/Operator.js +11 -1
  31. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
  32. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  33. package/src/sap/ui/mdc/designtime/filterbar/FilterBar.designtime.js +3 -1
  34. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +1 -1
  35. package/src/sap/ui/mdc/enum/PropagationReason.js +43 -0
  36. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  37. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  38. package/src/sap/ui/mdc/field/ConditionType.js +28 -8
  39. package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
  40. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  41. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  42. package/src/sap/ui/mdc/field/DefineConditionPanel.js +1 -1
  43. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +1 -1
  44. package/src/sap/ui/mdc/field/FieldBase.js +12 -10
  45. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +41 -19
  46. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  47. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  48. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  49. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  50. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  51. package/src/sap/ui/mdc/field/FieldValueHelp.js +6 -4
  52. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  53. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +1 -1
  54. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +1 -1
  55. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
  56. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +1 -1
  57. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  58. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  59. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  60. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  61. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  62. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  63. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  64. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  65. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +90 -69
  66. package/src/sap/ui/mdc/filterbar/IFilterContainer.js +5 -0
  67. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  68. package/src/sap/ui/mdc/filterbar/aligned/FilterContainer.js +1 -0
  69. package/src/sap/ui/mdc/filterbar/aligned/FilterItemLayout.js +1 -0
  70. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +21 -11
  71. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -5
  72. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +4 -41
  73. package/src/sap/ui/mdc/flexibility/ChartTypeFlex.js +54 -0
  74. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +2 -2
  75. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  76. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  77. package/src/sap/ui/mdc/library.js +19 -23
  78. package/src/sap/ui/mdc/link/ContactDetails.js +107 -23
  79. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  80. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  81. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  82. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  83. package/src/sap/ui/mdc/link/ContactDetailsRenderer.js +26 -0
  84. package/src/sap/ui/mdc/link/Factory.js +1 -1
  85. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  86. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  87. package/src/sap/ui/mdc/link/Panel.js +197 -22
  88. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  89. package/src/sap/ui/mdc/link/PanelRenderer.js +26 -0
  90. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  91. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  92. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  93. package/src/sap/ui/mdc/messagebundle.properties +8 -4
  94. package/src/sap/ui/mdc/messagebundle_ar.properties +6 -4
  95. package/src/sap/ui/mdc/messagebundle_bg.properties +6 -4
  96. package/src/sap/ui/mdc/messagebundle_ca.properties +6 -4
  97. package/src/sap/ui/mdc/messagebundle_cs.properties +6 -4
  98. package/src/sap/ui/mdc/messagebundle_cy.properties +6 -4
  99. package/src/sap/ui/mdc/messagebundle_da.properties +6 -4
  100. package/src/sap/ui/mdc/messagebundle_de.properties +6 -4
  101. package/src/sap/ui/mdc/messagebundle_el.properties +5 -3
  102. package/src/sap/ui/mdc/messagebundle_en.properties +6 -4
  103. package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -4
  104. package/src/sap/ui/mdc/messagebundle_en_US_sappsd.properties +6 -4
  105. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +7 -5
  106. package/src/sap/ui/mdc/messagebundle_en_US_saptrc.properties +7 -5
  107. package/src/sap/ui/mdc/messagebundle_es.properties +6 -4
  108. package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -4
  109. package/src/sap/ui/mdc/messagebundle_et.properties +6 -4
  110. package/src/sap/ui/mdc/messagebundle_fi.properties +6 -4
  111. package/src/sap/ui/mdc/messagebundle_fr.properties +6 -4
  112. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +6 -4
  113. package/src/sap/ui/mdc/messagebundle_hi.properties +6 -4
  114. package/src/sap/ui/mdc/messagebundle_hr.properties +6 -4
  115. package/src/sap/ui/mdc/messagebundle_hu.properties +6 -4
  116. package/src/sap/ui/mdc/messagebundle_id.properties +6 -4
  117. package/src/sap/ui/mdc/messagebundle_it.properties +6 -4
  118. package/src/sap/ui/mdc/messagebundle_iw.properties +5 -3
  119. package/src/sap/ui/mdc/messagebundle_ja.properties +7 -5
  120. package/src/sap/ui/mdc/messagebundle_kk.properties +6 -4
  121. package/src/sap/ui/mdc/messagebundle_ko.properties +5 -3
  122. package/src/sap/ui/mdc/messagebundle_lt.properties +6 -4
  123. package/src/sap/ui/mdc/messagebundle_lv.properties +6 -4
  124. package/src/sap/ui/mdc/messagebundle_ms.properties +6 -4
  125. package/src/sap/ui/mdc/messagebundle_nl.properties +6 -4
  126. package/src/sap/ui/mdc/messagebundle_no.properties +6 -4
  127. package/src/sap/ui/mdc/messagebundle_pl.properties +6 -4
  128. package/src/sap/ui/mdc/messagebundle_pt.properties +7 -5
  129. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -4
  130. package/src/sap/ui/mdc/messagebundle_ro.properties +6 -4
  131. package/src/sap/ui/mdc/messagebundle_ru.properties +6 -4
  132. package/src/sap/ui/mdc/messagebundle_sh.properties +9 -7
  133. package/src/sap/ui/mdc/messagebundle_sk.properties +6 -4
  134. package/src/sap/ui/mdc/messagebundle_sl.properties +7 -5
  135. package/src/sap/ui/mdc/messagebundle_sv.properties +7 -5
  136. package/src/sap/ui/mdc/messagebundle_th.properties +6 -4
  137. package/src/sap/ui/mdc/messagebundle_tr.properties +7 -5
  138. package/src/sap/ui/mdc/messagebundle_uk.properties +6 -4
  139. package/src/sap/ui/mdc/messagebundle_vi.properties +6 -4
  140. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +6 -4
  141. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -4
  142. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +4 -11
  143. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  144. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
  145. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  146. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +7 -1
  147. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +1 -1
  148. package/src/sap/ui/mdc/odata/v4/FieldBaseDelegate.js +8 -6
  149. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +18 -33
  150. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +63 -3
  151. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +57 -0
  152. package/src/sap/ui/mdc/p13n/Engine.js +147 -51
  153. package/src/sap/ui/mdc/p13n/FlexUtil.js +26 -14
  154. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  155. package/src/sap/ui/mdc/p13n/StateUtil.js +30 -51
  156. package/src/sap/ui/mdc/p13n/UIManager.js +6 -2
  157. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +0 -178
  158. package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +2 -2
  159. package/src/sap/ui/mdc/p13n/modules/xConfigAPI.js +219 -0
  160. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +73 -14
  161. package/src/sap/ui/mdc/p13n/subcontroller/AggregateController.js +2 -2
  162. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +30 -2
  163. package/src/sap/ui/mdc/p13n/subcontroller/ChartTypeController.js +46 -0
  164. package/src/sap/ui/mdc/p13n/subcontroller/ColumnWidthController.js +37 -6
  165. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +24 -6
  166. package/src/sap/ui/mdc/p13n/subcontroller/GroupController.js +9 -2
  167. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
  168. package/src/sap/ui/mdc/table/Column.js +271 -132
  169. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  170. package/src/sap/ui/mdc/table/PropertyHelper.js +59 -90
  171. package/src/sap/ui/mdc/table/ResponsiveTableType.js +35 -27
  172. package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
  173. package/src/sap/ui/mdc/table/RowSettings.js +1 -1
  174. package/src/sap/ui/mdc/table/TableSettings.js +10 -22
  175. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +1 -1
  176. package/src/sap/ui/mdc/table/menu/Item.js +78 -0
  177. package/src/sap/ui/mdc/table/menu/ItemContainer.js +60 -0
  178. package/src/sap/ui/mdc/table/menu/QuickActionContainer.js +151 -0
  179. package/src/sap/ui/mdc/themes/base/Chart.less +4 -0
  180. package/src/sap/ui/mdc/ui/Container.js +0 -0
  181. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  182. package/src/sap/ui/mdc/util/IdentifierUtil.js +3 -3
  183. package/src/sap/ui/mdc/util/PromiseCache.js +6 -2
  184. package/src/sap/ui/mdc/util/PropertyHelper.js +5 -1
  185. package/src/sap/ui/mdc/valuehelp/Dialog.js +234 -44
  186. package/src/sap/ui/mdc/valuehelp/Popover.js +3 -2
  187. package/src/sap/ui/mdc/valuehelp/base/Container.js +63 -48
  188. package/src/sap/ui/mdc/valuehelp/base/Content.js +35 -16
  189. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  190. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +158 -281
  191. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +4 -4
  192. package/src/sap/ui/mdc/valuehelp/content/Bool.js +4 -4
  193. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +4 -4
  194. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +4 -4
  195. package/src/sap/ui/mdc/valuehelp/content/ListCollection.js +205 -0
  196. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +59 -57
  197. package/src/sap/ui/mdc/valuehelp/content/MTable.js +89 -182
  198. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -3
  199. package/test/sap/ui/mdc/testutils/opa/chartNew/TestObjects.js +2 -3
  200. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +17 -3
  201. package/src/sap/ui/mdc/link/ContactDetails.control.xml +0 -29
  202. package/src/sap/ui/mdc/link/Panel.control.xml +0 -36
  203. package/src/sap/ui/mdc/link/PanelListItem.control.xml +0 -24
  204. package/src/sap/ui/mdc/link/PanelListItem.js +0 -101
@@ -12,12 +12,12 @@ sap.ui.define([
12
12
  "sap/ui/mdc/p13n/modification/FlexModificationHandler",
13
13
  "sap/m/MessageStrip",
14
14
  "sap/ui/core/library",
15
- "sap/ui/mdc/p13n/StateUtil",
16
15
  "sap/ui/core/Element",
17
16
  "sap/ui/mdc/p13n/modules/DefaultProviderRegistry",
18
17
  "sap/ui/mdc/p13n/UIManager",
19
- "sap/ui/mdc/p13n/modules/StateHandlerRegistry"
20
- ], function (AdaptationProvider, merge, Log, PropertyHelper, FlexModificationHandler, MessageStrip, coreLibrary, StateUtil, Element, DefaultProviderRegistry, UIManager, StateHandlerRegistry) {
18
+ "sap/ui/mdc/p13n/modules/StateHandlerRegistry",
19
+ "sap/ui/mdc/p13n/modules/xConfigAPI"
20
+ ], function (AdaptationProvider, merge, Log, PropertyHelper, FlexModificationHandler, MessageStrip, coreLibrary, Element, DefaultProviderRegistry, UIManager, StateHandlerRegistry, xConfigAPI) {
21
21
  "use strict";
22
22
 
23
23
  var ERROR_INSTANCING = "Engine: This class is a singleton. Please use the getInstance() method instead.";
@@ -41,7 +41,7 @@ sap.ui.define([
41
41
  * @extends sap.ui.mdc.p13n.AdaptationProvider
42
42
  *
43
43
  * @author SAP SE
44
- * @version 1.100.0
44
+ * @version 1.101.0
45
45
  *
46
46
  * @private
47
47
  * @ui5-restricted sap.ui.mdc
@@ -161,6 +161,19 @@ sap.ui.define([
161
161
  this._getRegistryEntry(vControl).modification = oModificationSetting;
162
162
  };
163
163
 
164
+ var fnQueue = function(oControl, fTask) {
165
+ var fCleanupPromiseQueue = function(pOriginalPromise) {
166
+ if (oControl._pModificationQueue === pOriginalPromise){
167
+ delete oControl._pModificationQueue;
168
+ }
169
+ };
170
+
171
+ oControl._pModificationQueue = oControl._pModificationQueue instanceof Promise ? oControl._pModificationQueue.then(fTask) : fTask();
172
+ oControl._pModificationQueue.then(fCleanupPromiseQueue.bind(null, oControl._pModificationQueue));
173
+
174
+ return oControl._pModificationQueue;
175
+ };
176
+
164
177
  /**
165
178
  * <code>Engine#createChanges</code> can be used to programmatically trigger the creation
166
179
  * of a set of changes based on the current control state and the provided state.
@@ -172,54 +185,67 @@ sap.ui.define([
172
185
  * @param {string} mDiffParameters.key The key used to retrieve the corresponding Controller.
173
186
  * @param {object} mDiffParameters.state The state which should be applied on the provided control instance
174
187
  * @param {boolean} [mDiffParameters.applyAbsolute] Decides whether unmentioned entries should be affected,
188
+ * @param {boolean} [mDiffParameters.stateBefore] In case the state should be diffed manually
175
189
  * for example if "A" is existing in the control state, but not mentioned in the new state provided in the
176
190
  * mDiffParameters.state then the absolute appliance decides whether to remove "A" or to keep it.
177
191
  * @param {boolean} [mDiffParameters.suppressAppliance] Decides whether the change should be applied directly.
192
+ * @param {boolean} [mDiffParameters.applySequentially] Decides whether the appliance should be queued or processed in parallel.
178
193
  * Controller
179
194
  *
180
195
  * @returns {Promise} A Promise resolving in the according delta changes.
181
196
  */
182
197
  Engine.prototype.createChanges = function(mDiffParameters) {
183
198
 
184
- var vControl = mDiffParameters.control;
185
199
  var sKey = mDiffParameters.key;
186
200
  var aNewState = mDiffParameters.state;
187
201
  var bApplyAbsolute = !!mDiffParameters.applyAbsolute;
188
202
  var bSuppressCallback = !!mDiffParameters.suppressAppliance;
189
- if (!sKey || !vControl || !aNewState) {
203
+ var bApplySequentially = !!mDiffParameters.applySequentially;
204
+
205
+ if (!sKey || !mDiffParameters.control || !aNewState) {
190
206
  throw new Error("To create changes via Engine, atleast a 1)Control 2)Key and 3)State needs to be provided.");
191
207
  }
192
208
 
193
- return this.initAdaptation(vControl, sKey).then(function(){
209
+ var oControl = Engine.getControlInstance(mDiffParameters.control);
194
210
 
195
- var oController = this.getController(vControl, sKey);
196
- var mChangeOperations = oController.getChangeOperations();
197
-
198
- var oRegistryEntry = this._getRegistryEntry(vControl);
199
- var oCurrentState = oController.getCurrentState();
200
- var oPriorState = merge(oCurrentState instanceof Array ? [] : {}, oCurrentState);
201
-
202
- var mDeltaConfig = {
203
- existingState: oPriorState,
204
- applyAbsolute: bApplyAbsolute,
205
- changedState: aNewState,
206
- control: oController.getAdaptationControl(),
207
- changeOperations: mChangeOperations,
208
- deltaAttributes: ["name"],
209
- propertyInfo: oRegistryEntry.helper.getProperties().map(function(a){return {name: a.name};})
210
- };
211
-
212
- //Only execute change calculation in case there is a difference (--> example: press 'Ok' without a difference)
213
- var aChanges = oController.getDelta(mDeltaConfig);
214
-
215
- if (!bSuppressCallback) {
216
- this._processChanges(vControl, aChanges);
217
- }
211
+ var fDeltaHandling = function() {
212
+ return this.initAdaptation(oControl, sKey).then(function(){
218
213
 
219
- return aChanges || [];
214
+ var oController = this.getController(oControl, sKey);
215
+ var mChangeOperations = oController.getChangeOperations();
220
216
 
221
- }.bind(this));
217
+ var oRegistryEntry = this._getRegistryEntry(oControl);
218
+ var oCurrentState = oController.getCurrentState();
219
+ var oPriorState = merge(oCurrentState instanceof Array ? [] : {}, oCurrentState);
220
+
221
+ var mDeltaConfig = {
222
+ existingState: mDiffParameters.stateBefore || oPriorState,
223
+ applyAbsolute: bApplyAbsolute,
224
+ changedState: aNewState,
225
+ control: oController.getAdaptationControl(),
226
+ changeOperations: mChangeOperations,
227
+ deltaAttributes: ["name"],
228
+ propertyInfo: oRegistryEntry.helper.getProperties().map(function(a){return {name: a.name};})
229
+ };
230
+
231
+ //Only execute change calculation in case there is a difference (--> example: press 'Ok' without a difference)
232
+ var aChanges = oController.getDelta(mDeltaConfig);
233
+
234
+ if (!bSuppressCallback) {
235
+ return this._processChanges(oControl, aChanges);
236
+ }
237
+
238
+ return aChanges || [];
239
+
240
+ }.bind(this));
222
241
 
242
+ }.bind(this);
243
+
244
+ if (bApplySequentially) {
245
+ return fnQueue(oControl, fDeltaHandling);
246
+ } else {
247
+ return fDeltaHandling.apply(this);
248
+ }
223
249
  };
224
250
 
225
251
  /**
@@ -303,9 +329,6 @@ sap.ui.define([
303
329
  .then(function(aChanges){
304
330
  var oControl = Engine.getControlInstance(vControl);
305
331
  this.stateHandlerRegistry.fireChange(oControl);
306
- if (oControl._onChangeAppliance instanceof Function) {
307
- oControl._onChangeAppliance.call(oControl);
308
- }
309
332
  return aChanges;
310
333
  }.bind(this));
311
334
  } else {
@@ -337,19 +360,19 @@ sap.ui.define([
337
360
  return Promise.reject("Please do not use a PeristenceProvider in RTA.");
338
361
  }
339
362
 
340
- var oModificationHandler = this.getModificationHandler(oControl);
341
- var fnInitialAppliance = oModificationHandler.processChanges;
363
+ var oOriginalModifHandler = this.getModificationHandler(oControl);
364
+ var oTemporaryRTAHandler = new FlexModificationHandler();
342
365
 
343
366
  var oRTAPromise = new Promise(function(resolve, reject){
344
367
  fResolveRTA = resolve;
345
368
  });
346
369
 
347
- oModificationHandler.processChanges = function(aChanges) {
370
+ oTemporaryRTAHandler.processChanges = function(aChanges) {
348
371
  fResolveRTA(aChanges);
349
372
  return Promise.resolve(aChanges);
350
373
  };
351
374
 
352
- this._setModificationHandler(oControl, oModificationHandler);
375
+ this._setModificationHandler(oControl, oTemporaryRTAHandler);
353
376
 
354
377
  this.uimanager.show(oControl, aKeys).then(function(oContainer){
355
378
  var oCustomHeader = oContainer.getCustomHeader();
@@ -363,8 +386,9 @@ sap.ui.define([
363
386
  });
364
387
 
365
388
  oRTAPromise.then(function(){
366
- oModificationHandler.processChanges = fnInitialAppliance;
367
- });
389
+ this._setModificationHandler(oControl, oOriginalModifHandler);
390
+ oTemporaryRTAHandler.destroy();
391
+ }.bind(this));
368
392
 
369
393
  return oRTAPromise;
370
394
 
@@ -393,15 +417,14 @@ sap.ui.define([
393
417
 
394
418
  return Promise.resolve()
395
419
  .then(function() {
396
- var oModificationHandler = this.getModificationHandler(vControl);
397
- return oModificationHandler.enhanceConfig(oControl, mEnhanceConfig)
420
+ return xConfigAPI.enhanceConfig(oControl, mEnhanceConfig)
398
421
  .then(function(oConfig){
399
422
  if (oRegistryEntry) {
400
423
  //to simplify debugging
401
424
  oRegistryEntry.xConfig = oConfig;
402
425
  }
403
426
  });
404
- }.bind(this));
427
+ });
405
428
  };
406
429
 
407
430
  /**
@@ -410,16 +433,56 @@ sap.ui.define([
410
433
  * @param {sap.ui.core.Element} vControl The according element which should be checked
411
434
  * @param {object} [mEnhanceConfig] An object providing a modification handler specific payload
412
435
  * @param {object} [mEnhanceConfig.propertyBag] Optional propertybag for different modification handler derivations
413
- * @param {boolean} [bSync] If the method should be executed synchronously; e.g. for the Table
414
436
  *
415
- * @returns {Promise<object>} Promise resolving with the adapted xConfig object
437
+ * @returns {Promise<object>|object}
438
+ * A promise that resolves with the xConfig, the xConfig directly if it is already available, or <code>null</code> if there is no xConfig
416
439
  */
417
- Engine.prototype.readXConfig = function(vControl, mEnhanceConfig, bSync) {
440
+ Engine.prototype.readXConfig = function(vControl, mEnhanceConfig) {
418
441
 
419
442
  var oControl = Engine.getControlInstance(vControl);
420
- var oModificationHandler = this.getModificationHandler(vControl);
421
- return oModificationHandler.readConfig(oControl, mEnhanceConfig, bSync) || Promise.resolve({});
443
+ return xConfigAPI.readConfig(oControl, mEnhanceConfig) || {};
444
+ };
445
+
446
+ /**
447
+ * The Engine is processing state via the internal key registry.
448
+ * The external state representation might differ from the internal registration.
449
+ * <b>Note:</b> This will only replace the keys to the external StateUtil representation, but not transform the state content itself.
450
+ *
451
+ * @private
452
+ * @param {string|sap.ui.mdc.Control} vControl The registered control instance
453
+ * @param {object} oInternalState The internal state
454
+ * @returns {object} The externalized state
455
+ */
456
+ Engine.prototype.externalizeKeys = function(vControl, oInternalState) {
457
+ var oExternalState = {};
458
+ Object.keys(oInternalState).forEach(function(sInternalKey){
459
+ var oController = this.getController(Engine.getControlInstance(vControl), sInternalKey);
460
+ if (oController) {
461
+ oExternalState[oController.getStateKey()] = oInternalState[sInternalKey];
462
+ }
463
+ }.bind(this));
464
+ return oExternalState;
465
+ };
422
466
 
467
+ /**
468
+ * The Engine is processing state via the internal key registry.
469
+ * The external state representation might differ from the internal registration.
470
+ * <b>Note:</b> This will only replace the keys to the internal Engine registry, but not transform the state content itself.
471
+ *
472
+ * @private
473
+ * @param {string|sap.ui.mdc.Control} vControl The registered control instance
474
+ * @param {object} oExternalState The external state
475
+ * @returns {object} The internalized state
476
+ */
477
+ Engine.prototype.internalizeKeys = function (vControl, oExternalState) {
478
+ var aControllerKeys = this.getRegisteredControllers(vControl), oInternalState = {};
479
+ aControllerKeys.forEach(function(sInternalRegistryKey){
480
+ var sExternalStateKey = this.getController(vControl, sInternalRegistryKey).getStateKey();
481
+ if (oExternalState.hasOwnProperty(sExternalStateKey)) {
482
+ oInternalState[sInternalRegistryKey] = oExternalState[sExternalStateKey];
483
+ }
484
+ }.bind(this));
485
+ return oInternalState;
423
486
  };
424
487
 
425
488
  /**
@@ -444,7 +507,7 @@ sap.ui.define([
444
507
  var aStatePromise = [], aChanges = [], mInfoState = {};
445
508
 
446
509
  if (oControl.validateState instanceof Function) {
447
- mInfoState = oControl.validateState(StateUtil._externalizeKeys(oState));
510
+ mInfoState = oControl.validateState(this.externalizeKeys(oControl, oState));
448
511
  }
449
512
 
450
513
  if (mInfoState.validation === MessageType.Error){
@@ -483,6 +546,39 @@ sap.ui.define([
483
546
  }.bind(this));
484
547
  };
485
548
 
549
+ Engine.prototype.diffState = function(oControl, oOld, oNew) {
550
+
551
+ var aDiffCreation = [], oDiffState = {};
552
+ oOld = merge({}, oOld);
553
+ oNew = merge({}, oNew);
554
+
555
+ this.getRegisteredControllers(oControl).forEach(function(sKey){
556
+
557
+ aDiffCreation.push(this.createChanges({
558
+ control: oControl,
559
+ stateBefore: oOld[sKey],
560
+ state: oNew[sKey],
561
+ applyAbsolute: true,
562
+ key: sKey,
563
+ suppressAppliance: true
564
+ }));
565
+
566
+ }.bind(this));
567
+
568
+ return Promise.all(aDiffCreation)
569
+ .then(function(aChanges){
570
+ this.getRegisteredControllers(oControl).forEach(function(sKey, i){
571
+
572
+ var aState = this.getController(oControl, sKey).changesToState(aChanges[i], oOld[sKey], oNew[sKey]);
573
+ oDiffState[sKey] = aState;
574
+
575
+ }.bind(this));
576
+
577
+ return oDiffState;
578
+
579
+ }.bind(this));
580
+ };
581
+
486
582
  /**
487
583
  * Retrieves the externalized state for a given control instance.
488
584
  * The retrieved state is equivalent to the "getCurrentState" API for the given Control,
@@ -910,7 +1006,7 @@ sap.ui.define([
910
1006
  if (oController.model2State instanceof Function) {
911
1007
  oTheoreticalState[sKey] = oController.model2State();
912
1008
 
913
- var mInfoState = oControl.validateState(StateUtil._externalizeKeys(oTheoreticalState), sKey);
1009
+ var mInfoState = oControl.validateState(this.externalizeKeys(oControl, oTheoreticalState), sKey);
914
1010
 
915
1011
  var oMessageStrip;
916
1012
 
@@ -4,8 +4,8 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- 'sap/base/util/array/diff', 'sap/base/util/deepEqual','sap/ui/mdc/condition/FilterOperatorUtil', 'sap/base/Log'
8
- ], function (diff, deepEqual, FilterOperatorUtil, Log) {
7
+ 'sap/base/util/merge', 'sap/base/util/deepEqual','sap/ui/mdc/condition/FilterOperatorUtil', 'sap/base/Log'
8
+ ], function (merge, deepEqual, FilterOperatorUtil, Log) {
9
9
  "use strict";
10
10
 
11
11
  var FlexUtil = {
@@ -78,6 +78,7 @@ sap.ui.define([
78
78
  * @param {object} mDeltaInfo.control Control instance which is being used to generate the changes
79
79
  * @param {object} mDeltaInfo.changeOperations Map containing the changeOperations for the given Control instance
80
80
  * @param {string} mDeltaInfo.changeOperations.add Name of the control specific 'add' changehandler
81
+ * @param {boolean} mDeltaInfo.applyAbsolute Indicates whether the appliance should also implicitly remove entries in case they are not provided in the new state
81
82
  * @param {string} mDeltaInfo.changeOperations.remove Name of the control specific 'remove' changehandler
82
83
  * @param {string} [mDeltaInfo.changeOperations.move] Name of the control specific 'move' changehandler
83
84
  * @param {string} [mDeltaInfo.generator] Name of the change generator (E.g. the namespace of the UI creating the change object)
@@ -90,6 +91,7 @@ sap.ui.define([
90
91
  var mNewConditionState = mDeltaInfo.changedState;
91
92
  var mPreviousConditionState = mDeltaInfo.existingState;
92
93
  var oAdaptationControl = mDeltaInfo.control;
94
+ var bAbsoluteAppliance = mDeltaInfo.hasOwnProperty("applyAbsolute") ? mDeltaInfo.applyAbsolute : true;
93
95
  var aPropertyInfo = mDeltaInfo.propertyInfo;
94
96
 
95
97
  for (var sFieldPath in mNewConditionState) {
@@ -99,7 +101,7 @@ sap.ui.define([
99
101
  continue;
100
102
  }
101
103
 
102
- var aFilterConditionChanges = FlexUtil._diffConditionPath(sFieldPath, mNewConditionState[sFieldPath], mPreviousConditionState[sFieldPath], oAdaptationControl);
104
+ var aFilterConditionChanges = FlexUtil._diffConditionPath(sFieldPath, mNewConditionState[sFieldPath], mPreviousConditionState[sFieldPath], oAdaptationControl, bAbsoluteAppliance);
103
105
  aConditionChanges = aConditionChanges.concat(aFilterConditionChanges);
104
106
  }
105
107
 
@@ -123,16 +125,17 @@ sap.ui.define([
123
125
  *
124
126
  * @public
125
127
  * @param {array} sFieldPath The relevant fieldPath
126
- * @param {array} aOrigConditions The conditions after they have been changed
128
+ * @param {array} aConditions The conditions after they have been changed
127
129
  * @param {function} aOrigShadowConditions The conditions before they have been changed
128
130
  * @param {object} oControl Control instance which is being used to generate the changes
131
+ * @param {boolean} [bAbsoluteAppliance] Indicates whether the appliance should also implicitly remove entries in case they are not provided in the new state
129
132
  *
130
133
  * @returns {array} Array containing the delta based created changes
131
134
  */
132
- _diffConditionPath: function(sFieldPath, aOrigConditions, aOrigShadowConditions, oControl){
135
+ _diffConditionPath: function(sFieldPath, aConditions, aOrigShadowConditions, oControl, bAbsoluteAppliance){
133
136
  var oChange, aChanges = [];
134
- var aConditions = aOrigConditions;
135
- var aShadowConditions = aOrigShadowConditions ? aOrigShadowConditions : [];
137
+ var aOrigConditions = merge([], aConditions);
138
+ var aShadowConditions = aOrigShadowConditions ? merge([], aOrigShadowConditions) : [];
136
139
 
137
140
 
138
141
  if (deepEqual(aConditions, aShadowConditions)) {
@@ -147,11 +150,16 @@ sap.ui.define([
147
150
 
148
151
  for (var i = 0; i < aConditions.length; i++) {
149
152
 
150
- var nConditionIdx = FilterOperatorUtil.indexOfCondition(aConditions[i], aShadowConditions);
153
+ var oNewCondition = aConditions[i];
154
+ var nConditionIdx = FilterOperatorUtil.indexOfCondition(oNewCondition, aShadowConditions);
151
155
  if (nConditionIdx > -1) {
152
156
 
153
157
  aConditions.splice(i, 1);
154
- aShadowConditions.splice(nConditionIdx, 1);
158
+
159
+ if (bAbsoluteAppliance) {
160
+ aShadowConditions.splice(nConditionIdx, 1);
161
+ }
162
+
155
163
  bRunAgain = true;
156
164
  break;
157
165
  }
@@ -164,15 +172,18 @@ sap.ui.define([
164
172
  if ((aConditions.length > 0) || (aShadowConditions.length > 0)) {
165
173
 
166
174
  aShadowConditions.forEach(function(oCondition) {
167
- oChange = FlexUtil.createConditionChange("removeCondition", oControl, sFieldPath, oCondition);
168
- if (oChange) {
175
+ //In case of absolute appliance always remove, in case of explicit appliance only remove if explicitly given in the new state via filtered=false
176
+ var iNewCondition = FilterOperatorUtil.indexOfCondition(oCondition, aOrigConditions);
177
+ var bNewConditionExplicitlyRemoved = iNewCondition > -1 && aOrigConditions[iNewCondition].filtered === false;
178
+ if (bAbsoluteAppliance || bNewConditionExplicitlyRemoved) {
179
+ oChange = FlexUtil.createConditionChange("removeCondition", oControl, sFieldPath, oCondition);
169
180
  aChanges.push(oChange);
170
181
  }
171
182
  });
172
183
 
173
184
  aConditions.forEach(function(oCondition) {
174
- oChange = FlexUtil.createConditionChange("addCondition", oControl, sFieldPath, oCondition);
175
- if (oChange) {
185
+ if (bAbsoluteAppliance || (!oCondition.hasOwnProperty("filtered") || oCondition.filtered !== false)) {
186
+ oChange = FlexUtil.createConditionChange("addCondition", oControl, sFieldPath, oCondition);
176
187
  aChanges.push(oChange);
177
188
  }
178
189
  });
@@ -194,6 +205,7 @@ sap.ui.define([
194
205
  },
195
206
 
196
207
  createConditionChange: function(sChangeType, oControl, sFieldPath, oCondition) {
208
+ delete oCondition.filtered;
197
209
  var oConditionChange = {
198
210
  selectorElement: oControl,
199
211
  changeSpecificData: {
@@ -261,4 +273,4 @@ sap.ui.define([
261
273
  }
262
274
  };
263
275
  return FlexUtil;
264
- });
276
+ });
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @extends sap.ui.mdc.util.PropertyHelper
30
30
  *
31
31
  * @author SAP SE
32
- * @version 1.100.0
32
+ * @version 1.101.0
33
33
  *
34
34
  * @private
35
35
  * @experimental
@@ -4,7 +4,8 @@
4
4
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
5
  */
6
6
  sap.ui.define([
7
- ], function() {
7
+ "sap/ui/mdc/p13n/Engine"
8
+ ], function(Engine) {
8
9
  "use strict";
9
10
 
10
11
  /**
@@ -51,7 +52,7 @@ sap.ui.define([
51
52
  * @ui5-restricted sap.fe
52
53
  * @MDC_PUBLIC_CANDIDATE
53
54
  *
54
- * @param {object} oControl The control that is used to create changes and to which changes are made
55
+ * @param {sap.ui.mdc.Control} oControl The control that is used to create changes and to which changes are made
55
56
  * @param {object} oState The state in which the control is represented
56
57
  *
57
58
  * @example
@@ -99,7 +100,8 @@ sap.ui.define([
99
100
  * @returns {Promise} <code>Promise</code> that resolves after all changes have been applied
100
101
  */
101
102
  applyExternalState: function(oControl, oState){
102
- return oControl.getEngine().applyState(oControl, StateUtil._internalizeKeys(oState));
103
+ var oInternalState = Engine.getInstance().internalizeKeys(oControl, oState);
104
+ return Engine.getInstance().applyState(oControl, oInternalState);
103
105
  },
104
106
 
105
107
  /**
@@ -112,13 +114,33 @@ sap.ui.define([
112
114
  * @private
113
115
  * @ui5-restricted sap.fe
114
116
  * @MDC_PUBLIC_CANDIDATE
115
- * @param {object} oControl The control instance implementing IxState to retrieve the externalized state
117
+ * @param {sap.ui.mdc.Control} oControl The control instance implementing IxState to retrieve the externalized state
116
118
  *
117
119
  * @returns {Promise} <code>Promise</code> that resolves after the current state has been retrieved
118
120
  */
119
121
  retrieveExternalState: function(oControl) {
120
- return oControl.getEngine().retrieveState(oControl).then(function(oEngineState){
121
- return StateUtil._externalizeKeys(oEngineState);
122
+ return Engine.getInstance().retrieveState(oControl).then(function(oEngineState){
123
+ return Engine.getInstance().externalizeKeys(oControl, oEngineState);
124
+ });
125
+ },
126
+
127
+ /**
128
+ * Creates a delta between two states.
129
+ *
130
+ * @private
131
+ * @ui5-restricted sap.fe
132
+ *
133
+ * @MDC_PUBLIC_CANDIDATE
134
+ * @param {sap.ui.mdc.Control} oControl The control instance implementing IxState
135
+ * @param {object} oOldState The prior state
136
+ * @param {object} oNewState The new state
137
+ *
138
+ * @returns {Promise} <code>Promise</code> that resolves after the current state has been diffed
139
+ */
140
+ diffState: function(oControl, oOldState, oNewState) {
141
+ return sap.ui.mdc.p13n.Engine.getInstance().diffState(oControl, Engine.getInstance().internalizeKeys(oControl, oOldState), Engine.getInstance().internalizeKeys(oControl, oNewState))
142
+ .then(function(oEngineStateDiff){
143
+ return Engine.getInstance().externalizeKeys(oControl, oEngineStateDiff);
122
144
  });
123
145
  },
124
146
 
@@ -132,7 +154,7 @@ sap.ui.define([
132
154
  * @param {function} fnListener fnFunction The handler function to call when the event occurs
133
155
  */
134
156
  attachStateChange: function(fnListener) {
135
- sap.ui.mdc.p13n.Engine.getInstance().stateHandlerRegistry.attachChange(fnListener);
157
+ Engine.getInstance().stateHandlerRegistry.attachChange(fnListener);
136
158
  },
137
159
 
138
160
  /**
@@ -145,50 +167,7 @@ sap.ui.define([
145
167
  * @param {function} fnListener fnFunction The handler function to detach from the event
146
168
  */
147
169
  detachStateChange: function(fnListener) {
148
- sap.ui.mdc.p13n.Engine.getInstance().stateHandlerRegistry.detachChange(fnListener);
149
- },
150
-
151
- _externalizeKeys: function(oInternalState) {
152
- var mKeysForState = {
153
- Sort: "sorters",
154
- Group: "groupLevels",
155
- Aggregate: "aggregations",
156
- Filter: "filter",
157
- Item: "items",
158
- Column: "items",
159
- ColumnWidth: "supplementaryConfig"
160
- };
161
- var oTransformedState = {};
162
-
163
- Object.keys(oInternalState).forEach(function(sProvidedEngineKey){
164
- var sExternalKey = mKeysForState[sProvidedEngineKey];
165
- var sTransformedKey = sExternalKey || sProvidedEngineKey;//no external key --> provide internal key
166
- oTransformedState[sTransformedKey] = oInternalState[sProvidedEngineKey];
167
- });
168
- return oTransformedState;
169
- },
170
-
171
- _internalizeKeys: function(oExternalState) {
172
- var mKeysForEngine = {
173
- sorters: ["Sort"],
174
- groupLevels: ["Group"],
175
- aggregations: ["Aggregate"],
176
- filter: ["Filter"],
177
- items: ["Item", "Column"],
178
- supplementaryConfig: ["ColumnWidth"]
179
- };
180
-
181
- var oTransformedState = {};
182
-
183
- Object.keys(oExternalState).forEach(function(sProvidedEngineKey){
184
- if (mKeysForEngine[sProvidedEngineKey]) {
185
- mKeysForEngine[sProvidedEngineKey].forEach(function(sTransformedKey){
186
- oTransformedState[sTransformedKey] = oExternalState[sProvidedEngineKey];
187
- });
188
- }
189
- });
190
-
191
- return oTransformedState;
170
+ Engine.getInstance().stateHandlerRegistry.detachChange(fnListener);
192
171
  }
193
172
 
194
173
  };
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.ui.base.Object
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.100.0
36
+ * @version 1.101.0
37
37
  *
38
38
  * @private
39
39
  * @ui5-restricted sap.ui.mdc
@@ -208,7 +208,11 @@ sap.ui.define([
208
208
  }.bind(this));
209
209
 
210
210
  return Promise.all(aPAdaptationUI).then(function(aUIs){
211
- var oPopupContent = bUseP13nContainer ? new P13nContainer() : aUIs[0].panel;
211
+ var oPopupContent = bUseP13nContainer ? new P13nContainer({
212
+ afterViewSwitch: function(oEvt) {
213
+ this.oAdaptationProvider.validateP13n(oControl, oEvt.getParameter("target"), oEvt.getSource().getCurrentViewContent());
214
+ }.bind(this)
215
+ }) : aUIs[0].panel;
212
216
  if (bUseP13nContainer) {
213
217
  aUIs.forEach(function(mUI){
214
218
  if (mUI.panel) {