@openui5/sap.ui.mdc 1.99.0 → 1.100.1

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 (173) hide show
  1. package/THIRDPARTY.txt +2 -2
  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 +50 -32
  6. package/src/sap/ui/mdc/ChartDelegate.js +66 -21
  7. package/src/sap/ui/mdc/ChartRenderer.js +1 -1
  8. package/src/sap/ui/mdc/Control.js +11 -6
  9. package/src/sap/ui/mdc/Element.js +10 -6
  10. package/src/sap/ui/mdc/Field.js +19 -4
  11. package/src/sap/ui/mdc/FilterBar.js +1 -1
  12. package/src/sap/ui/mdc/FilterBarDelegate.js +26 -0
  13. package/src/sap/ui/mdc/FilterField.js +41 -3
  14. package/src/sap/ui/mdc/Link.js +3 -3
  15. package/src/sap/ui/mdc/MultiValueField.js +11 -1
  16. package/src/sap/ui/mdc/Table.js +73 -39
  17. package/src/sap/ui/mdc/TableDelegate.js +28 -1
  18. package/src/sap/ui/mdc/ValueHelp.js +8 -3
  19. package/src/sap/ui/mdc/ValueHelpDelegate.js +2 -1
  20. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -1
  21. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarActionRenderer.js +1 -1
  22. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  23. package/src/sap/ui/mdc/chart/ChartToolbar.js +13 -6
  24. package/src/sap/ui/mdc/chart/DrillBreadcrumbs.js +7 -7
  25. package/src/sap/ui/mdc/chart/DrillStackHandler.js +6 -6
  26. package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
  27. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  28. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  29. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  30. package/src/sap/ui/mdc/condition/FilterConverter.js +4 -2
  31. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +133 -25
  32. package/src/sap/ui/mdc/condition/Operator.js +4 -2
  33. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +78 -24
  34. package/src/sap/ui/mdc/condition/RangeOperator.js +5 -5
  35. package/src/sap/ui/mdc/designtime/Util.js +63 -0
  36. package/src/sap/ui/mdc/designtime/actiontoolbar/ActionToolbar.designtime.js +23 -30
  37. package/src/sap/ui/mdc/designtime/chart/Chart.designtime.js +3 -0
  38. package/src/sap/ui/mdc/designtime/link/PanelItem.designtime.js +3 -1
  39. package/src/sap/ui/mdc/designtime/table/Table.designtime.js +39 -52
  40. package/src/sap/ui/mdc/field/BoolFieldHelp.js +1 -1
  41. package/src/sap/ui/mdc/field/ConditionFieldHelp.js +1 -1
  42. package/src/sap/ui/mdc/field/ConditionType.js +15 -4
  43. package/src/sap/ui/mdc/field/ConditionsType.js +2 -1
  44. package/src/sap/ui/mdc/field/CustomFieldHelp.js +1 -1
  45. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  46. package/src/sap/ui/mdc/field/DefineConditionPanel.js +16 -5
  47. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +76 -19
  48. package/src/sap/ui/mdc/field/FieldBase.js +62 -11
  49. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +1 -1
  50. package/src/sap/ui/mdc/field/FieldHelpBase.js +1 -1
  51. package/src/sap/ui/mdc/field/FieldInfoBase.js +2 -1
  52. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  53. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  54. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  55. package/src/sap/ui/mdc/field/FieldValueHelp.js +4 -1
  56. package/src/sap/ui/mdc/field/FieldValueHelpContentWrapperBase.js +1 -1
  57. package/src/sap/ui/mdc/field/FieldValueHelpDelegate.js +1 -1
  58. package/src/sap/ui/mdc/field/FieldValueHelpMTableWrapper.js +5 -4
  59. package/src/sap/ui/mdc/field/FieldValueHelpMdcTableWrapper.js +5 -3
  60. package/src/sap/ui/mdc/field/FieldValueHelpTableWrapperBase.js +1 -1
  61. package/src/sap/ui/mdc/field/FieldValueHelpUITableWrapper.js +7 -7
  62. package/src/sap/ui/mdc/field/InParameter.js +1 -1
  63. package/src/sap/ui/mdc/field/ListFieldHelp.js +1 -1
  64. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  65. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -1
  66. package/src/sap/ui/mdc/field/OutParameter.js +1 -1
  67. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  68. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  69. package/src/sap/ui/mdc/field/ValueHelpPanel.js +1 -1
  70. package/src/sap/ui/mdc/field/content/ContentFactory.js +5 -1
  71. package/src/sap/ui/mdc/field/content/DateContent.js +27 -19
  72. package/src/sap/ui/mdc/field/content/DateTimeContent.js +0 -6
  73. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +76 -208
  74. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +27 -2
  75. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +127 -57
  76. package/src/sap/ui/mdc/filterbar/p13n/FilterColumnLayout.js +2 -2
  77. package/src/sap/ui/mdc/filterbar/p13n/GroupContainer.js +7 -3
  78. package/src/sap/ui/mdc/filterbar/p13n/TableContainer.js +52 -14
  79. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +37 -19
  80. package/src/sap/ui/mdc/filterbar/vh/FilterContainer.js +1 -1
  81. package/src/sap/ui/mdc/flexibility/AggregationConfigFlex.js +48 -31
  82. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  83. package/src/sap/ui/mdc/flexibility/ChartItemFlex.js +36 -0
  84. package/src/sap/ui/mdc/flexibility/ConditionFlex.js +47 -10
  85. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  86. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  87. package/src/sap/ui/mdc/flexibility/ItemBaseFlex.js +0 -1
  88. package/src/sap/ui/mdc/flexibility/PropertyInfoFlex.js +2 -85
  89. package/src/sap/ui/mdc/library.js +11 -4
  90. package/src/sap/ui/mdc/link/ContactDetails.js +1 -1
  91. package/src/sap/ui/mdc/link/ContactDetailsAddressItem.js +1 -1
  92. package/src/sap/ui/mdc/link/ContactDetailsEmailItem.js +1 -1
  93. package/src/sap/ui/mdc/link/ContactDetailsItem.js +1 -1
  94. package/src/sap/ui/mdc/link/ContactDetailsPhoneItem.js +1 -1
  95. package/src/sap/ui/mdc/link/Factory.js +1 -1
  96. package/src/sap/ui/mdc/link/FakeFlpConnector.js +1 -1
  97. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  98. package/src/sap/ui/mdc/link/Panel.js +1 -1
  99. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  100. package/src/sap/ui/mdc/link/PanelListItem.js +1 -1
  101. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  102. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  103. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  104. package/src/sap/ui/mdc/messagebundle.properties +2 -1
  105. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +20 -19
  106. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -141
  107. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -9
  108. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  109. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +348 -0
  110. package/src/sap/ui/mdc/odata/TypeUtil.js +1 -1
  111. package/src/sap/ui/mdc/odata/v4/ChartPropertyHelper.js +70 -3
  112. package/src/sap/ui/mdc/odata/v4/FilterBarDelegate.js +116 -20
  113. package/src/sap/ui/mdc/odata/v4/ODataMetaModelUtil.js +2 -2
  114. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +11 -33
  115. package/src/sap/ui/mdc/odata/v4/TypeUtil.js +2 -4
  116. package/src/sap/ui/mdc/odata/v4/ValueHelpDelegate.js +1 -1
  117. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +281 -263
  118. package/src/sap/ui/mdc/p13n/AdaptationProvider.js +1 -1
  119. package/src/sap/ui/mdc/p13n/Engine.js +21 -18
  120. package/src/sap/ui/mdc/p13n/FlexUtil.js +0 -5
  121. package/src/sap/ui/mdc/p13n/PropertyHelper.js +2 -2
  122. package/src/sap/ui/mdc/p13n/StateUtil.js +4 -0
  123. package/src/sap/ui/mdc/p13n/UIManager.js +16 -13
  124. package/src/sap/ui/mdc/p13n/modification/ModificationHandler.js +18 -14
  125. package/src/sap/ui/mdc/p13n/modules/DefaultProviderRegistry.js +1 -1
  126. package/src/sap/ui/mdc/p13n/panels/ActionToolbarPanel.js +6 -6
  127. package/src/sap/ui/mdc/p13n/panels/AdaptFiltersPanel.js +49 -27
  128. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +4 -3
  129. package/src/sap/ui/mdc/p13n/panels/FilterPanel.js +136 -0
  130. package/src/sap/ui/mdc/p13n/panels/GroupView.js +53 -28
  131. package/src/sap/ui/mdc/p13n/panels/LinkSelectionPanel.js +54 -18
  132. package/src/sap/ui/mdc/p13n/subcontroller/ActionToolbarController.js +4 -7
  133. package/src/sap/ui/mdc/p13n/subcontroller/AdaptFiltersController.js +1 -2
  134. package/src/sap/ui/mdc/p13n/subcontroller/BaseController.js +1 -1
  135. package/src/sap/ui/mdc/p13n/subcontroller/FilterController.js +8 -4
  136. package/src/sap/ui/mdc/p13n/subcontroller/LinkPanelController.js +1 -0
  137. package/src/sap/ui/mdc/p13n/subcontroller/SortController.js +2 -2
  138. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  139. package/src/sap/ui/mdc/table/GridTableType.js +75 -27
  140. package/src/sap/ui/mdc/table/PropertyHelper.js +20 -13
  141. package/src/sap/ui/mdc/table/ResponsiveTableType.js +86 -13
  142. package/src/sap/ui/mdc/table/RowActionItem.js +119 -0
  143. package/src/sap/ui/mdc/table/RowSettings.js +42 -1
  144. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +2 -2
  145. package/src/sap/ui/mdc/themes/base/Chart.less +2 -0
  146. package/src/sap/ui/mdc/themes/base/ValueHelpDialog.less +1 -0
  147. package/src/sap/ui/mdc/util/DateUtil.js +32 -7
  148. package/src/sap/ui/mdc/util/FilterUtil.js +1 -1
  149. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  150. package/src/sap/ui/mdc/util/PropertyHelper.js +201 -76
  151. package/src/sap/ui/mdc/util/TypeUtil.js +1 -1
  152. package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
  153. package/src/sap/ui/mdc/valuehelp/Popover.js +5 -3
  154. package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
  155. package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
  156. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  157. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +4 -4
  158. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
  159. package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
  160. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
  161. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +13 -10
  162. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +4 -10
  163. package/src/sap/ui/mdc/valuehelp/content/MTable.js +6 -4
  164. package/test/sap/ui/mdc/testutils/opa/chart/TestObjects.js +2 -0
  165. package/test/sap/ui/mdc/testutils/opa/filterbar/TestObjects.js +0 -1
  166. package/test/sap/ui/mdc/testutils/opa/p13n/Actions.js +8 -6
  167. package/src/sap/ui/mdc/filterbar/vh/GenericFilterBarDelegate.js +0 -150
  168. package/src/sap/ui/mdc/p13n/panels/BasePanel.js +0 -721
  169. package/src/sap/ui/mdc/p13n/panels/ListView.js +0 -408
  170. package/src/sap/ui/mdc/p13n/panels/SelectionPanel.js +0 -92
  171. package/src/sap/ui/mdc/p13n/panels/SortPanel.js +0 -150
  172. package/src/sap/ui/mdc/ui/Container.js +0 -240
  173. package/src/sap/ui/mdc/ui/ContainerItem.js +0 -79
@@ -28,14 +28,6 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
28
28
  delete this.fnRejectDelegate;
29
29
  };
30
30
 
31
- /**
32
- * @namespace
33
- * @name sap.ui.mdc.mixin
34
- * @private
35
- * @experimental As of version 1.82.0
36
- * @ui5-restricted sap.ui.mdc
37
- */
38
-
39
31
  /**
40
32
  * Enhances a given control prototype with consolidated asynchronous handling for delegate modules and their initialization.
41
33
  *
@@ -69,7 +61,7 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
69
61
  * </ul>
70
62
  *
71
63
  * @author SAP SE
72
- * @version 1.99.0
64
+ * @version 1.100.1
73
65
  * @alias sap.ui.mdc.mixin.DelegateMixin
74
66
  * @namespace
75
67
  * @since 1.76.0
@@ -90,13 +82,6 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
90
82
  this.fnRejectDelegate = reject;
91
83
  }.bind(this));
92
84
 
93
- this._oPropertyHelper = null;
94
- this._bPropertyHelperIsBeingInitialized = false;
95
- this._pInitPropertyHelper = new Promise(function(resolve, reject) {
96
- this._fnResolveInitPropertyHelper = resolve;
97
- this._fnRejectInitPropertyHelper = reject;
98
- }.bind(this));
99
-
100
85
  if (fnInit) {
101
86
  fnInit.apply(this, arguments);
102
87
  }
@@ -208,119 +193,6 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
208
193
  return this._oDelegateInitialized;
209
194
  };
210
195
 
211
- /**
212
- * Loads and initializes the property helper related to the enhanced control.
213
- *
214
- * @protected
215
- * @param {sap.ui.mdc.util.PropertyHelper} [CustomPropertyHelper] Custom property helper class
216
- * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
217
- */
218
- DelegateMixin.initPropertyHelper = function(CustomPropertyHelper) {
219
- if (CustomPropertyHelper && (!CustomPropertyHelper.getMetadata || !CustomPropertyHelper.getMetadata().isA("sap.ui.mdc.util.PropertyHelper"))) {
220
- throw new Error("The custom property helper class must be sap.ui.mdc.util.PropertyHelper or a subclass of it.");
221
- }
222
-
223
- if (!this.bIsDestroyed && !this._oPropertyHelper && !this._bPropertyHelperIsBeingInitialized) {
224
- this._bPropertyHelperIsBeingInitialized = true;
225
- this.awaitControlDelegate().then(function(oDelegate) {
226
- if (this.bIsDestroyed) {
227
- return null;
228
- }
229
- return initPropertyHelper(this, oDelegate, CustomPropertyHelper);
230
- }.bind(this)).catch(function(oError) {
231
- this._fnRejectInitPropertyHelper(oError);
232
- }.bind(this));
233
- }
234
-
235
- return this._pInitPropertyHelper;
236
- };
237
-
238
- function initPropertyHelper(oControl, oDelegate, CustomPropertyHelper) {
239
- return Promise.all([
240
- oDelegate.fetchProperties(oControl)
241
- ]).then(function(aResult) {
242
- if (oControl.bIsDestroyed) {
243
- return [];
244
- }
245
-
246
- if (typeof oDelegate.fetchPropertyExtensions === "function") {
247
- return oDelegate.fetchPropertyExtensions(oControl, aResult[0]).then(function(mExtensions) {
248
- return aResult.concat(mExtensions);
249
- });
250
- }
251
-
252
- return aResult.concat(undefined);
253
- }).then(function(aResult) {
254
- if (oControl.bIsDestroyed) {
255
- return [];
256
- }
257
-
258
- return fetchPropertyHelper(oControl, oDelegate, CustomPropertyHelper, aResult[0], aResult[1]).then(function(PropertyHelper) {
259
- return aResult.concat(PropertyHelper);
260
- });
261
- }).then(function(aResult) {
262
- if (oControl.bIsDestroyed) {
263
- return;
264
- }
265
-
266
- var aProperties = aResult[0];
267
- var mExtensions = aResult[1];
268
- var PropertyHelper = aResult[2];
269
- var bPropertyHelperIsInstance = !!PropertyHelper.isA;
270
-
271
- oControl._oPropertyHelper = bPropertyHelperIsInstance ? PropertyHelper : new PropertyHelper(aProperties, mExtensions, oControl);
272
- oControl._bPropertyHelperIsBeingInitialized = false;
273
- oControl._fnResolveInitPropertyHelper(oControl._oPropertyHelper);
274
- });
275
- }
276
-
277
- function fetchPropertyHelper(oControl, oDelegate, CustomPropertyHelper, aProperties, mExtensions) {
278
- if (typeof oDelegate.fetchPropertyHelper === "function") {
279
- return oDelegate.fetchPropertyHelper(oControl, aProperties, mExtensions).then(function(PropertyHelper) {
280
- var sBaseClass = CustomPropertyHelper ? CustomPropertyHelper.getMetadata().getName() : "sap.ui.mdc.util.PropertyHelper";
281
-
282
- if (!PropertyHelper || !PropertyHelper.getMetadata || !PropertyHelper.getMetadata().isA(sBaseClass)) {
283
- throw new Error("The property helper must be a class or instance of type " + sBaseClass + " or a subclass of it.");
284
- }
285
-
286
- return PropertyHelper;
287
- });
288
- }
289
-
290
- if (CustomPropertyHelper) {
291
- return Promise.resolve(CustomPropertyHelper);
292
- }
293
-
294
- return loadModules("sap/ui/mdc/util/PropertyHelper").then(function(aResult) {
295
- return aResult[0];
296
- });
297
- }
298
-
299
- /**
300
- * Provides access to the property helper initialization <code>Promise</code>.
301
- *
302
- * @protected
303
- * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
304
- */
305
- DelegateMixin.awaitPropertyHelper = function() {
306
- return this._pInitPropertyHelper;
307
- };
308
-
309
- /**
310
- * Returns the property helper instance, if available.
311
- *
312
- * @protected
313
- * @returns {sap.ui.mdc.util.PropertyHelper} The property helper
314
- * @throws Throws an error if the property helper is not available
315
- */
316
- DelegateMixin.getPropertyHelper = function() {
317
- if (!this._oPropertyHelper) {
318
- throw new Error("A property helper is not (yet) available. You must first initialize the delegate and the property helper.");
319
- }
320
-
321
- return this._oPropertyHelper;
322
- };
323
-
324
196
  DelegateMixin.exit = function (fnExit) {
325
197
  return function () {
326
198
  this.fnResolveDelegate = null;
@@ -334,15 +206,6 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
334
206
  this._oPayload = null;
335
207
  this._oTypeUtil = null;
336
208
 
337
- if (this._oPropertyHelper && !this._oPropertyHelper.bIsDestroyed) {
338
- this._oPropertyHelper.destroy();
339
- }
340
- this._oPropertyHelper = null;
341
- this._fnResolveInitPropertyHelper = null;
342
- this._fnRejectInitPropertyHelper = null;
343
- this._bPropertyHelperIsBeingInitialized = false;
344
- this._pInitPropertyHelper = null;
345
-
346
209
  if (fnExit) {
347
210
  fnExit.apply(this, arguments);
348
211
  }
@@ -362,9 +225,6 @@ sap.ui.define(["sap/ui/mdc/util/loadModules", "sap/base/Log"], function (loadMod
362
225
  this.getPayload = DelegateMixin.getPayload;
363
226
  this.getTypeUtil = DelegateMixin.getTypeUtil;
364
227
  this.initControlDelegate = DelegateMixin.initControlDelegate;
365
- this.initPropertyHelper = DelegateMixin.initPropertyHelper;
366
- this.awaitPropertyHelper = DelegateMixin.awaitPropertyHelper;
367
- this.getPropertyHelper = DelegateMixin.getPropertyHelper;
368
228
  };
369
229
 
370
230
  });
@@ -9,14 +9,6 @@ sap.ui.define([
9
9
  ], function (Core) {
10
10
  "use strict";
11
11
 
12
- /**
13
- * @namespace
14
- * @name sap.ui.mdc.mixin
15
- * @private
16
- * @experimental As of version 1.82.0
17
- * @ui5-restricted sap.ui.mdc
18
- */
19
-
20
12
  /**
21
13
  * Enhances a given control prototype with consolidated handling for external IFilter integration
22
14
  *
@@ -51,7 +43,7 @@ sap.ui.define([
51
43
  * </ul>
52
44
  *
53
45
  * @author SAP SE
54
- * @version 1.99.0
46
+ * @version 1.100.1
55
47
  * @alias sap.ui.mdc.mixin.FilterIntegrationMixin
56
48
  * @namespace
57
49
  * @since 1.82.0
@@ -13,7 +13,7 @@ sap.ui.define(
13
13
  * Calling any of the enhanced methods after control exit will result in a no-op.
14
14
  *
15
15
  * @author SAP SE
16
- * @version 1.99.0
16
+ * @version 1.100.1
17
17
  * @alias sap.ui.mdc.mixin.PromiseMixin
18
18
  * @namespace
19
19
  * @since 1.85.0
@@ -0,0 +1,348 @@
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(["sap/base/util/Deferred", "sap/ui/mdc/util/loadModules", "sap/base/Log"], function (Deferred, loadModules, Log) {
8
+ "use strict";
9
+
10
+ /**
11
+ * Enhances a given control prototype with consolidated asynchronous handling for providing a PropertyHelper
12
+ *
13
+ * The following methods are available:
14
+ *
15
+ * <ul>
16
+ * <li><code>initPropertyHelper</code> - Loads and initializes the property helper related to the enhanced control.</li>
17
+ * <li><code>awaitPropertyHelper</code> - Provides access to the property helper initialization <code>Promise</code>.</li>
18
+ * <li><code>finalizePropertyHelper</code> - Finalizes the propertyHelper fetching all available propertyInfo via a given control delegate.</li>
19
+ * <li><code>isPropertyHelperFinal</code> - Indicates if the propertyHelper for this control allready contains all available propertyInfo.</li>
20
+ * <li><code>getPropertyHelper</code> - Returns the property helper instance, if available.</li>
21
+ * </ul>
22
+ *
23
+ * Additionally, the following methods are wrapped:
24
+ *
25
+ * <ul>
26
+ * <li><code>applySettings</code></li>
27
+ * <li><code>exit</code></li>
28
+ * <li><code>init</code></li>
29
+ * </ul>
30
+ *
31
+ * @author SAP SE
32
+ * @version 1.100.1
33
+ * @alias sap.ui.mdc.mixin.PropertyHelperMixin
34
+ * @namespace
35
+ * @since 1.100.0
36
+ * @private
37
+ * @experimental
38
+ * @ui5-restricted sap.ui.mdc
39
+ */
40
+ var PropertyHelperMixin = {};
41
+
42
+ PropertyHelperMixin.init = function (fnInit) {
43
+ return function () {
44
+
45
+ this._oPropertyHelper = null;
46
+ this._oPropertyHelperDeferred = new Deferred();
47
+ this._oApplySettingsDeferred = new Deferred();
48
+
49
+ this._bPropertyHelperFinal = false;
50
+ this._bPropertyHelperInitializing = false;
51
+ this._sPropertyInfoStore = null;
52
+
53
+ if (fnInit) {
54
+ fnInit.apply(this, arguments);
55
+ }
56
+
57
+ };
58
+ };
59
+
60
+ PropertyHelperMixin.applySettings = function (fnApplySettings) {
61
+ return function () {
62
+ if (fnApplySettings) {
63
+ fnApplySettings.apply(this, arguments);
64
+ }
65
+ this._oApplySettingsDeferred.resolve(this); // We want to make sure all other initial properties are set before initializing propertyHelper (e.g. delegate)
66
+ return this;
67
+ };
68
+ };
69
+
70
+ /**
71
+ * Loads and initializes the property helper related to the enhanced control.
72
+ *
73
+ * @protected
74
+ * @param {sap.ui.mdc.util.PropertyHelper} [PropertyHelperClass] Custom property helper class
75
+ * @param {object[]} [aProperties] optional set of initial properties
76
+ * @param {object[]} [bFinal] flag for mark the propertyHelper as final
77
+ * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
78
+ */
79
+ PropertyHelperMixin.initPropertyHelper = function(PropertyHelperClass, aProperties, bFinal) {
80
+ if (PropertyHelperClass) {
81
+ this._setPropertyHelperClass(PropertyHelperClass);
82
+ }
83
+
84
+ return _createOrUpdatePropertyHelper.call(this, aProperties, bFinal);
85
+ };
86
+
87
+ /**
88
+ * Provide a new set of properties for the propertyHelper.
89
+ *
90
+ * @protected
91
+ * @param {object[]} [aProperties] optional set of initial properties
92
+ * @param {object[]} [bFinal] flag for mark the propertyHelper as final
93
+ * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
94
+ * @throws exception if propertyHelper is already marked as final
95
+ */
96
+ PropertyHelperMixin.updatePropertyHelper = function(aProperties, bFinal) {
97
+ return _createOrUpdatePropertyHelper.call(this, aProperties, bFinal);
98
+ };
99
+
100
+ /**
101
+ * Finalize the propertyHelper using the control's delegate.
102
+ *
103
+ * @protected
104
+ * @param {object[]} [aProperties] optional set of initial properties
105
+ * @param {object[]} [bFinal] flag for mark the propertyHelper as final
106
+ * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
107
+ */
108
+ PropertyHelperMixin.finalizePropertyHelper = function() {
109
+ this._pHelperFinalizationPromise = this._pHelperFinalizationPromise || _getDelegateProperties(this).then(function (aResult) {
110
+ return _createOrUpdatePropertyHelper.call(this, aResult, true);
111
+ }.bind(this));
112
+ return this._pHelperFinalizationPromise;
113
+ };
114
+
115
+ /**
116
+ * Indicates if the control's propertyHelper already contains all available properties
117
+ *
118
+ * @protected
119
+ * @returns {boolean} Returns a <code>boolean</code> indicating the propertyHelper's final state
120
+ */
121
+ PropertyHelperMixin.isPropertyHelperFinal = function() {
122
+ return this._bPropertyHelperFinal;
123
+ };
124
+
125
+ /**
126
+ * Provides access to the property helper initialization <code>Promise</code>.
127
+ *
128
+ * @protected
129
+ * @returns {Promise<sap.ui.mdc.util.PropertyHelper>} Returns a <code>Promise</code> that resolves with the property helper
130
+ */
131
+ PropertyHelperMixin.awaitPropertyHelper = function() {
132
+ return this._oPropertyHelperDeferred.promise;
133
+ };
134
+
135
+ /**
136
+ * Returns the property helper instance, if available.
137
+ *
138
+ * @protected
139
+ * @returns {sap.ui.mdc.util.PropertyHelper} The property helper
140
+ */
141
+ PropertyHelperMixin.getPropertyHelper = function() {
142
+ return this._oPropertyHelper;
143
+ };
144
+
145
+ PropertyHelperMixin.exit = function (fnExit) {
146
+ return function () {
147
+ this._oPropertyHelper = null;
148
+ this._oPropertyHelperDeferred = null;
149
+ this._oApplySettingsDeferred = null;
150
+ this._bPropertyHelperFinal = null;
151
+ this._bPropertyHelperInitializing = null;
152
+ this._pHelperFinalizationPromise = null;
153
+ this._oPropertyHelperClass = null;
154
+ this._sPropertyInfoStore = null;
155
+
156
+ if (this._oPropertyInfoStoreMutatorOverride) {
157
+ this[this._oPropertyInfoStoreMutatorOverride.key] = this._oPropertyInfoStoreMutatorOverride.mutator;
158
+ this._oPropertyInfoStoreMutatorOverride = null;
159
+ }
160
+
161
+ if (fnExit) {
162
+ fnExit.apply(this, arguments);
163
+ }
164
+ };
165
+ };
166
+
167
+ /**
168
+ * Controls may provide a property identifier representing a propertyInfo store for this control.
169
+ * This should be called as early as possible as the given property's mutator is overriden.
170
+ * @private
171
+ * @param {string} sPropertyName Name of the property containing propertyInfo for this control
172
+ *
173
+ */
174
+ PropertyHelperMixin._setupPropertyInfoStore = function(sPropertyName) {
175
+ var oProperties = this.getMetadata().getAllProperties();
176
+ var oPropertyInfoProperty = oProperties && oProperties[sPropertyName];
177
+ if (!oPropertyInfoProperty) {
178
+ throw new Error("PropertyHelperMixin: Property '" + sPropertyName + "' not found.");
179
+ }
180
+ var oJSONKeys = this.getMetadata().getJSONKeys()[sPropertyName];
181
+ this._oPropertyInfoStoreMutatorOverride = {key: oJSONKeys._sMutator, mutator: this[oJSONKeys._sMutator]};
182
+
183
+ this[oJSONKeys._sMutator] = function () {
184
+ this._oPropertyInfoStoreMutatorOverride.mutator.apply(this, arguments);
185
+ if (!this._bPropertyHelperFinal) {
186
+ _createOrUpdatePropertyHelper.call(this, this[oJSONKeys._sGetter](), false);
187
+ }
188
+ return this;
189
+ };
190
+ this._sPropertyInfoStore = sPropertyName;
191
+ };
192
+
193
+ // Should ideally be called already during init for controls featuring a propertyInfo property (auto-initalization of PH after applySettings).
194
+ PropertyHelperMixin._setPropertyHelperClass = function (PropertyHelperClass) {
195
+ if (this._oPropertyHelper || this._bPropertyHelperInitializing) {
196
+ throw new Error("PropertyHelper already initializing/ed.");
197
+ }
198
+
199
+ if (PropertyHelperClass && (!PropertyHelperClass.getMetadata || !PropertyHelperClass.getMetadata().isA("sap.ui.mdc.util.PropertyHelper"))) {
200
+ throw new Error("The custom property helper class must be sap.ui.mdc.util.PropertyHelper or a subclass of it.");
201
+ }
202
+ this._oPropertyHelperClass = PropertyHelperClass;
203
+ };
204
+
205
+ PropertyHelperMixin._getPropertyByName = function(sName) {
206
+ return this._oPropertyHelper && this._oPropertyHelper.getProperty(sName);
207
+ };
208
+
209
+ PropertyHelperMixin._getPropertyByNameAsync = function(sName) {
210
+ var oProperty = this._oPropertyHelper && this._oPropertyHelper.getProperty(sName);
211
+
212
+ if (!oProperty) {
213
+ return this.finalizePropertyHelper().then(function (oPropertyHelper) {
214
+ return oPropertyHelper.getProperty(sName);
215
+ });
216
+ }
217
+ return Promise.resolve(oProperty);
218
+ };
219
+
220
+ function _createOrUpdatePropertyHelper(aProperties, bFinal) {
221
+ if (!this.bIsDestroyed) {
222
+ if (this._bPropertyHelperInitializing && typeof aProperties !== "undefined") {
223
+ return this._oPropertyHelperDeferred.promise.then(function () {
224
+ return _updatePropertyHelper.call(this, aProperties, bFinal);
225
+ }.bind(this));
226
+ }
227
+
228
+ if (this._oPropertyHelper && typeof aProperties !== "undefined") {
229
+ _updatePropertyHelper.call(this, aProperties, bFinal);
230
+ }
231
+ if (!this._oPropertyHelper) {
232
+ _createPropertyHelper.call(this, aProperties, bFinal);
233
+ }
234
+ }
235
+ return this._oPropertyHelperDeferred && this._oPropertyHelperDeferred.promise;
236
+ }
237
+
238
+ function _createPropertyHelper (aProperties, bFinal) {
239
+ this._bPropertyHelperInitializing = true;
240
+
241
+ if (bFinal || !aProperties) { // also fall back to delegate if no initial properties given
242
+ bFinal = true;
243
+ this._pHelperFinalizationPromise = this._oPropertyHelperDeferred.promise;
244
+ }
245
+
246
+ var oDelegate;
247
+
248
+ // we need to initialize the delegate for extensions or ph overrides first
249
+ return this._oApplySettingsDeferred.promise.then(function () {
250
+ return this.initControlDelegate();
251
+ }.bind(this)).then(function (oControlDelegate) {
252
+ oDelegate = oControlDelegate;
253
+ return bFinal ? _getDelegateProperties(this) : aProperties;
254
+ }.bind(this)).then(function(aProperties) {
255
+ if (this.bIsDestroyed) {
256
+ return [];
257
+ }
258
+ var aResult = [aProperties];
259
+ if (oDelegate && typeof oDelegate.fetchPropertyExtensions === "function") {
260
+ return oDelegate.fetchPropertyExtensions(this, aProperties).then(function(mExtensions) {
261
+ return aResult.concat(mExtensions);
262
+ });
263
+ }
264
+ return aResult.concat(undefined);
265
+ }.bind(this)).then(function(aResult) {
266
+ if (this.bIsDestroyed) {
267
+ return [];
268
+ }
269
+ return fetchPropertyHelperClass(this, oDelegate, aResult[0], aResult[1]).then(function(PropertyHelper) {
270
+ return aResult.concat(PropertyHelper);
271
+ });
272
+ }.bind(this)).then(function(aResult) {
273
+ if (this.bIsDestroyed) {
274
+ return undefined;
275
+ }
276
+
277
+ var aProperties = aResult[0];
278
+ var mExtensions = aResult[1];
279
+ var PropertyHelper = aResult[2];
280
+ this._oPropertyHelper = new PropertyHelper(aProperties, mExtensions, this, undefined, undefined);
281
+ this._bPropertyHelperInitializing = false;
282
+ if (bFinal) {
283
+ this._bPropertyHelperFinal = true;
284
+ }
285
+ return this._oPropertyHelperDeferred.resolve(this._oPropertyHelper);
286
+ }.bind(this)).catch(function (oError) {
287
+ return this._oPropertyHelperDeferred && this._oPropertyHelperDeferred.reject(oError);
288
+ }.bind(this));
289
+ }
290
+
291
+ function _updatePropertyHelper(aProperties, bFinal) {
292
+ if (this._bPropertyHelperFinal) {
293
+ throw new Error("This property helper is already final and cannot be updated further.");
294
+ }
295
+ this._oPropertyHelper.setProperties(aProperties);
296
+ this._bPropertyHelperFinal = bFinal || this._bPropertyHelperFinal;
297
+ return this._oPropertyHelper;
298
+ }
299
+
300
+ // use delegate for final properties
301
+ function _getDelegateProperties (oControl) {
302
+ return oControl.initControlDelegate().then(function () {
303
+ return oControl.getControlDelegate(oControl).fetchProperties(oControl); // not using arg as some unit tests override "getControlDelegate"
304
+
305
+
306
+ });
307
+ }
308
+
309
+ function fetchPropertyHelperClass(oControl, oDelegate, aProperties) {
310
+ if (oDelegate && typeof oDelegate.getPropertyHelperClass === "function") {
311
+ var oDelegatePropertyHelperClass = oDelegate.getPropertyHelperClass();
312
+ var sBaseClass = oControl._oPropertyHelperClass ? oControl._oPropertyHelperClass.getMetadata().getName() : "sap.ui.mdc.util.PropertyHelper";
313
+
314
+ if (!oDelegatePropertyHelperClass || !oDelegatePropertyHelperClass.getMetadata || !oDelegatePropertyHelperClass.getMetadata().isA(sBaseClass)) {
315
+ throw new Error("The property helper class must be " + sBaseClass + " or a subclass of it.");
316
+ }
317
+ return Promise.resolve(oDelegatePropertyHelperClass);
318
+ }
319
+
320
+ if (oControl._oPropertyHelperClass) {
321
+ return Promise.resolve(oControl._oPropertyHelperClass);
322
+ }
323
+
324
+ return loadModules("sap/ui/mdc/util/PropertyHelper").then(function(aResult) {
325
+ return aResult[0];
326
+ });
327
+ }
328
+
329
+ return function () {
330
+ this.init = PropertyHelperMixin.init(this.init);
331
+ this.exit = PropertyHelperMixin.exit(this.exit);
332
+ this.applySettings = PropertyHelperMixin.applySettings(this.applySettings);
333
+
334
+
335
+ this.initPropertyHelper = PropertyHelperMixin.initPropertyHelper;
336
+ this.awaitPropertyHelper = PropertyHelperMixin.awaitPropertyHelper;
337
+ this.getPropertyHelper = PropertyHelperMixin.getPropertyHelper;
338
+
339
+ this.finalizePropertyHelper = PropertyHelperMixin.finalizePropertyHelper;
340
+ this.isPropertyHelperFinal = PropertyHelperMixin.isPropertyHelperFinal;
341
+
342
+ this._getPropertyByName = PropertyHelperMixin._getPropertyByName;
343
+ this._getPropertyByNameAsync = PropertyHelperMixin._getPropertyByNameAsync;
344
+ this._setPropertyHelperClass = PropertyHelperMixin._setPropertyHelperClass;
345
+ this._setupPropertyInfoStore = PropertyHelperMixin._setupPropertyInfoStore;
346
+
347
+ };
348
+ });
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  *
30
30
  * Falls back to 'object' if type cannot be found.
31
31
  *
32
- * @param {string} sType Given model specific type
32
+ * @param {string} sDataType Given model specific type
33
33
  * @returns {string} primitive type name
34
34
  */
35
35
  getPrimitiveType: function (sDataType) {
@@ -5,9 +5,11 @@
5
5
  */
6
6
 
7
7
  sap.ui.define([
8
- "sap/ui/mdc/chart/PropertyHelper"
8
+ "sap/ui/mdc/chart/PropertyHelper",
9
+ "sap/ui/mdc/library"
9
10
  ], function(
10
- PropertyHelperBase
11
+ PropertyHelperBase,
12
+ MDCLib
11
13
  ) {
12
14
  "use strict";
13
15
 
@@ -25,7 +27,7 @@ sap.ui.define([
25
27
  * @extends sap.ui.mdc.chart.PropertyHelper
26
28
  *
27
29
  * @author SAP SE
28
- * @version 1.99.0
30
+ * @version 1.100.1
29
31
  *
30
32
  * @private
31
33
  * @experimental
@@ -35,5 +37,70 @@ sap.ui.define([
35
37
  */
36
38
  var PropertyHelper = PropertyHelperBase.extend("sap.ui.mdc.odata.v4.ChartPropertyHelper");
37
39
 
40
+
41
+ /**
42
+ * Applies defaults and resolves property references.
43
+ *
44
+ * @param {object} oProperty The property to prepare
45
+ * @protected
46
+ */
47
+ PropertyHelper.prototype.prepareProperty = function(oProperty) {
48
+
49
+ if (oProperty.groupable) {
50
+ oProperty.availableRoles = this._getLayoutOptionsForType("groupable");
51
+ oProperty.kind = "Groupable";
52
+ } else if (oProperty.aggregatable) {
53
+ oProperty.availableRoles = this._getLayoutOptionsForType("aggregatable");
54
+ oProperty.kind = "Aggregatable";
55
+ }
56
+
57
+ if (!oProperty.typeConfig && oProperty.dataType){
58
+ var oFormatOptions = oProperty.formatOptions ? oProperty.formatOptions : null;
59
+ var oConstraints = oProperty.constraints ? oProperty.constraints : {};
60
+
61
+ oProperty.typeConfig = this.getParent().getControlDelegate().getTypeUtil().getTypeConfig(oProperty.dataType, oFormatOptions, oConstraints);
62
+ }
63
+
64
+ PropertyHelperBase.prototype.prepareProperty.apply(this, arguments);
65
+
66
+ };
67
+
68
+ /**
69
+ * This returns the layout options for a specific type of Item (measure/dimension,groupable/aggregatable)
70
+ * It is used by p13n to determine which layout options to show in the p13n panel
71
+ * @param {string} sType the type for which the layout options are requested
72
+ */
73
+ PropertyHelper.prototype._getLayoutOptionsForType = function(sType){
74
+ var MDCRb = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
75
+ var oAvailableRoles = {
76
+ groupable: [
77
+ {
78
+ key: MDCLib.ChartItemRoleType.category,
79
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY')
80
+ }, {
81
+ key: MDCLib.ChartItemRoleType.category2,
82
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_CATEGORY2')
83
+ }, {
84
+ key: MDCLib.ChartItemRoleType.series,
85
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_SERIES')
86
+ }
87
+ ],
88
+ aggregatable: [
89
+ {
90
+ key: MDCLib.ChartItemRoleType.axis1,
91
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS1')
92
+ }, {
93
+ key: MDCLib.ChartItemRoleType.axis2,
94
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS2')
95
+ }, {
96
+ key: MDCLib.ChartItemRoleType.axis3,
97
+ text: MDCRb.getText('chart.PERSONALIZATION_DIALOG_CHARTROLE_AXIS3')
98
+ }
99
+ ]
100
+ };
101
+ return oAvailableRoles[sType];
102
+ };
103
+
104
+
38
105
  return PropertyHelper;
39
106
  });