@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
@@ -8,33 +8,25 @@ sap.ui.define([
8
8
  'sap/ui/mdc/util/loadModules',
9
9
  'sap/ui/mdc/valuehelp/base/ListContent',
10
10
  'sap/ui/mdc/condition/Condition',
11
- 'sap/ui/mdc/condition/FilterConverter',
12
11
  'sap/ui/mdc/enum/ConditionValidated',
13
- 'sap/base/util/deepEqual',
14
- 'sap/ui/mdc/util/Common',
15
- 'sap/ui/model/base/ManagedObjectModel',
16
- 'sap/m/MessageToast'
12
+ 'sap/ui/mdc/util/Common'
17
13
  ], function(
18
14
  loadModules,
19
15
  ListContent,
20
16
  Condition,
21
- FilterConverter,
22
17
  ConditionValidated,
23
- deepEqual,
24
- Common,
25
- ManagedObjectModel,
26
- MessageToast
18
+ Common
27
19
  ) {
28
20
  "use strict";
29
21
 
30
22
  /**
31
23
  * Constructor for a new <code>FilterableListContent</code>.
32
24
  *
33
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
34
- * @param {object} [mSettings] Initial settings for the new control
35
- * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element.
25
+ * @param {string} [sId] ID for the new element, generated automatically if no ID is given
26
+ * @param {object} [mSettings] Initial settings for the new element
27
+ * @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element.
36
28
  * @extends sap.ui.mdc.valuehelp.base.ListContent
37
- * @version 1.100.0
29
+ * @version 1.101.0
38
30
  * @constructor
39
31
  * @abstract
40
32
  * @private
@@ -84,23 +76,10 @@ sap.ui.define([
84
76
  type: "string",
85
77
  defaultValue: ""
86
78
  },
87
- /**
88
- * Internal property to allow to bind the conditions created by InParameters to content
89
- */
90
- inConditions: {
91
- type: "object",
92
- defaultValue: {},
93
- byValue: true//,
94
- //visibility: "hidden"
95
- },
96
- /**
97
- * Internal property to allow to bind the paths used by OutParameters to content
98
- */
99
- outParameterNames: {
100
- type: "string[]",
101
- defaultValue: [],
102
- byValue: true//,
103
- //visibility: "hidden"
79
+
80
+ group: {
81
+ type: "string",
82
+ defaultValue: ""
104
83
  }
105
84
  },
106
85
  aggregations: {
@@ -128,6 +107,12 @@ sap.ui.define([
128
107
  visibility: "hidden"
129
108
  }
130
109
  },
110
+ associations: {
111
+ filters: {
112
+ type: "sap.ui.mdc.IFilter",
113
+ multiple: true
114
+ }
115
+ },
131
116
  events: {
132
117
  }
133
118
  }
@@ -140,12 +125,8 @@ sap.ui.define([
140
125
  this._oResourceBundle = sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc");
141
126
 
142
127
  this._oObserver.observe(this, {
143
- aggregations: ["_defaultFilterBar", "filterBar"],
144
- properties: ["inConditions"]
128
+ aggregations: ["_defaultFilterBar", "filterBar"]
145
129
  });
146
-
147
- this.bindProperty("inConditions", { path: "/_inConditions", model: "$valueHelp"}); // inherit from ValueHelp
148
- this.bindProperty("outParameterNames", { path: "/_outParameters", model: "$valueHelp"}); // inherit from ValueHelp
149
130
  };
150
131
 
151
132
  FilterableListContent.prototype._handleFilterValueUpdate = function (oChanges) {
@@ -155,8 +136,14 @@ sap.ui.define([
155
136
  }
156
137
  };
157
138
 
158
- FilterableListContent.prototype.applyFilters = function (sSearch) {
139
+ FilterableListContent.prototype._reduceIFilterConditions = function (oConditions) {
140
+ var oDelegate = this._getValueHelpDelegate();
141
+ var oPayload = this._getValueHelpDelegatePayload();
142
+ return oDelegate ? oDelegate.reduceIFilterConditions(oPayload, this, oConditions) : oConditions;
143
+ };
159
144
 
145
+ FilterableListContent.prototype.applyFilters = function (sSearch) {
146
+ this.applyFilterConditions();
160
147
  };
161
148
 
162
149
 
@@ -200,65 +187,42 @@ sap.ui.define([
200
187
  var sDescriptionPath = (oOptions && oOptions.descriptionPath) || this.getDescriptionPath();
201
188
  var vKey;
202
189
  var sDescription;
203
- var sPath;
190
+ //var sPath;
204
191
 
205
192
  if (!sKeyPath) {
206
193
  throw new Error("KeyPath missing"); // as we cannot determine key without keyPath
207
194
  }
208
195
 
209
- var aInParameters = oOptions && oOptions.inParameters || [];
210
- if (aInParameters.length === 0) {
211
- for (sPath in this.getProperty("inConditions")) {
212
- aInParameters.push(sPath);
213
- }
214
- }
215
-
216
- var aOutParameters = oOptions && oOptions.outParameters || this.getProperty("outParameterNames");
217
- var oInParameters = aInParameters.length > 0 ? {} : null;
218
- var oOutParameters = aOutParameters.length > 0 ? {} : null;
219
-
220
196
  if (oBindingContext) {
221
197
  vKey = sKeyPath ? oBindingContext.getProperty(sKeyPath) : undefined;
222
198
  sDescription = sDescriptionPath ? oBindingContext.getProperty(sDescriptionPath) : undefined;
223
- var i = 0;
224
- for (i = 0; i < aInParameters.length; i++) {
225
- sPath = aInParameters[i];
226
- oInParameters[sPath] = oBindingContext.getProperty(sPath);
227
- }
228
- for (i = 0; i < aOutParameters.length; i++) {
229
- sPath = aOutParameters[i];
230
- oOutParameters[sPath] = oBindingContext.getProperty(sPath);
231
- }
232
199
  }
233
200
 
234
201
  if (vKey === null || vKey === undefined) {
235
202
  return false;
236
203
  }
237
204
 
238
- return {key: vKey, description: sDescription, inParameters: oInParameters, outParameters: oOutParameters};
239
- };
205
+ var oPayload = this._createConditionPayload([vKey, sDescription], oBindingContext);
240
206
 
241
- FilterableListContent.prototype._isItemSelected = function (oItem, aConditions) {
242
207
 
243
- var oContext = oItem && oItem.getBindingContext();
244
- var oItemData = this._getItemFromContext(oContext);
208
+ return {key: vKey, description: sDescription, payload: oPayload};
209
+ };
245
210
 
246
- for (var i = 0; i < aConditions.length; i++) {
247
- var oCondition = aConditions[i];
248
- if (oCondition.validated === ConditionValidated.Validated && oItemData.key === oCondition.values[0]) { // TODO: check for specific EQ operator
249
- //check for inParameters and outParameters
250
- if (oCondition.inParameters && oItemData.inParameters && !deepEqual(oCondition.inParameters, oItemData.inParameters)) {
251
- continue;
252
- }
253
- if (oCondition.outParameters && oItemData.outParameters && !deepEqual(oCondition.outParameters, oItemData.outParameters)) {
254
- continue;
255
- }
256
- return true;
257
- }
258
- }
211
+ FilterableListContent.prototype._createConditionPayload = function(aValues, vContext) {
212
+ var oConditionPayload;
213
+ var oDelegate = this._getValueHelpDelegate();
259
214
 
260
- return false;
215
+ if (oDelegate) {
216
+ var oDelegatePayload = this._getValueHelpDelegatePayload();
217
+ oConditionPayload = {};
218
+ oConditionPayload = oDelegate.createConditionPayload(oDelegatePayload, this, aValues, vContext);
219
+ }
220
+ return oConditionPayload;
221
+ };
261
222
 
223
+ FilterableListContent.prototype._isItemSelected = function (oItem, aConditions) {
224
+ var oDelegate = this._isValueHelpDelegateInitialized() && this._getValueHelpDelegate();
225
+ return oDelegate ? oDelegate.isFilterableListItemSelected(this._getValueHelpDelegatePayload(), this, oItem, aConditions) : false;
262
226
  };
263
227
 
264
228
  FilterableListContent.prototype._createDefaultFilterBar = function() {
@@ -270,92 +234,55 @@ sap.ui.define([
270
234
  liveMode: false, // !oWrapper.isSuspended(), // if suspended, no live search
271
235
  showGoButton: false
272
236
  });
237
+ _setBasicSearch.call(this, oFilterBar);
273
238
  this.setAggregation("_defaultFilterBar", oFilterBar, true);
274
239
  return oFilterBar;
275
240
  }.bind(this));
276
241
  };
277
242
 
278
- FilterableListContent.prototype._assignCollectiveSearch = function(bInitializeKey) {
279
- bInitializeKey = typeof bInitializeKey !== "undefined" ? bInitializeKey : !this._oCollectiveSearchSelect;
280
- _createCollectiveSearch.call(this, bInitializeKey).then(function(oCollectiveSearchSelect) {
281
- var oFilterBar = this._getPriorityFilterBar();
282
- if (oFilterBar.setCollectiveSearch) {
283
- oFilterBar.setCollectiveSearch(oCollectiveSearchSelect);
284
- }
285
- }.bind(this));
243
+ FilterableListContent.prototype._handleSearch = function (oEvent) {
244
+ // to be implemented by MTable and MDCTable
286
245
  };
287
246
 
288
- function _createCollectiveSearch(bInitializeKey) {
289
-
290
- return loadModules([
291
- "sap/ui/mdc/filterbar/vh/CollectiveSearchSelect",
292
- "sap/ui/core/Item"
293
- ]).then(function(aModules) {
294
- var CollectiveSearchSelect = aModules[0];
295
- var Item = aModules[1];
296
-
297
- _createCollectiveSearchSelect.call(this, CollectiveSearchSelect, Item);
298
-
299
- var aCollectiveSearchItems = this.getCollectiveSearchItems();
300
- if (aCollectiveSearchItems.length <= 1) {
301
- return null;
302
- } else {
303
- if (bInitializeKey) {
304
- this._oCollectiveSearchSelect.setSelectedItemKey(aCollectiveSearchItems[0].getKey());
305
- }
306
- return this._oCollectiveSearchSelect;
247
+ function _setBasicSearch(oFilterBar) {
248
+ var oExistingBasicSearchField = oFilterBar.getBasicSearchField();
249
+ var sFilterFields = this.getFilterFields();
250
+ if (!oExistingBasicSearchField && sFilterFields) { // TODO: use isSearchSupported but here Delegate needs to be loaded
251
+ if (!this._oSearchField) {
252
+ return loadModules([
253
+ "sap/ui/mdc/FilterField"
254
+ ]).then(function (aModules){
255
+ if (!oFilterBar.bIsDestroyed) {
256
+ var FilterField = aModules[0];
257
+ this._oSearchField = new FilterField(this.getId() + "-search", {
258
+ conditions: "{$filters>/conditions/" + sFilterFields + "}",
259
+ placeholder:"{$i18n>filterbar.SEARCH}",
260
+ label:"{$i18n>filterbar.SEARCH}", // TODO: do we want a label?
261
+ maxConditions: 1,
262
+ width: "50%"
263
+ });
264
+ this._oSearchField._bCreatedByValueHelp = true;
265
+ _setBasicSearch.call(this, oFilterBar);
266
+ }
267
+ }.bind(this));
307
268
  }
308
- }.bind(this));
309
-
310
- }
311
-
312
- function _handleCollectiveSearchSelect(oEvent) {
313
-
314
- var sKey = oEvent.getParameter("key");
315
- MessageToast.show("ColSearch: " + sKey);
316
-
317
- this.fireRequestDelegateContent();
318
- }
319
-
320
- function _createCollectiveSearchSelect(CollectiveSearchSelect, Item) {
321
-
322
- if (!this._oCollectiveSearchSelect) {
323
-
324
- this._oObserver.observe(this, {
325
- properties: ["filterFields"],
326
- aggregations: ["collectiveSearchItems"]
327
- });
328
-
329
- this._oManagedObjectModel = new ManagedObjectModel(this);
330
- this.setModel(this._oManagedObjectModel, "$contenthelp");
331
-
332
- var oItemTemplate = new Item(this.getId() + "-collSearchItem", {
333
- key: "{$contenthelp>key}",
334
- text: "{$contenthelp>text}",
335
- enabled: "{$contenthelp>enabled}",
336
- textDirection: "{$contenthelp>textDirection}"
337
- });
338
-
339
- this._oCollectiveSearchSelect = new CollectiveSearchSelect(this.getId() + "-collSearch", {
340
- title: "{$i18n>COL_SEARCH_SEL_TITLE}",
341
- items: {path: "$contenthelp>/collectiveSearchItems", template: oItemTemplate},
342
- select: _handleCollectiveSearchSelect.bind(this)
343
- });
269
+ oFilterBar.setBasicSearchField(this._oSearchField);
270
+ } else if (oExistingBasicSearchField) {
271
+ oExistingBasicSearchField.setConditions([]);
344
272
  }
345
-
346
- return this._oCollectiveSearchSelect;
347
-
348
273
  }
349
274
 
350
275
  FilterableListContent.prototype.onShow = function () {
351
276
  ListContent.prototype.onShow.apply(this, arguments);
352
277
 
353
- var oListBinding = this._getListBinding();
278
+ var oListBinding = this.getListBinding();
354
279
  var oListBindingInfo = this._getListBindingInfo();
355
280
 
356
281
  var bBindingSuspended = oListBinding && oListBinding.isSuspended();
357
282
  var bBindingWillBeSuspended = !oListBinding && oListBindingInfo && oListBindingInfo.suspended;
358
283
 
284
+ this._applyInitialConditions(this._getPriorityFilterBar()); // to set incomming condition on FilterBar
285
+
359
286
  if ((bBindingSuspended || bBindingWillBeSuspended) && !this.isTypeahead()) {
360
287
  return; // in dialog case do not resume suspended table on opening
361
288
  }
@@ -363,50 +290,10 @@ sap.ui.define([
363
290
  this.applyFilters(this.getFilterValue());
364
291
  };
365
292
 
366
- FilterableListContent.prototype._formatConditions = function(aConditions) {
367
- // map in/outParameters to help paths
368
-
369
- var aInParameters = this.getModel("$valueHelp").getProperty("/inParameters");
370
- var aOutParameters = this.getModel("$valueHelp").getProperty("/outParameters");
371
-
372
- for (var i = 0; i < aConditions.length; i++) {
373
- var oCondition = aConditions[i];
374
- if (oCondition.inParameters) {
375
- oCondition.inParameters = _mapParametersToHelp.call(this, oCondition.inParameters, aInParameters);
376
- }
377
- if (oCondition.outParameters) {
378
- oCondition.outParameters = _mapParametersToHelp.call(this, oCondition.outParameters, aOutParameters);
379
- }
380
- }
381
-
382
- return aConditions;
383
-
293
+ FilterableListContent.prototype.onHide = function () {
294
+ ListContent.prototype.onHide.apply(this, arguments);
384
295
  };
385
296
 
386
- function _mapParametersToHelp(oParameters, aParameters) {
387
-
388
- var oHelpParameters;
389
-
390
- if (aParameters.length > 0) {
391
- for (var sMyFieldPath in oParameters) {
392
- for (var i = 0; i < aParameters.length; i++) {
393
- var oParameter = aParameters[i];
394
- var sHelpPath = oParameter.getHelpPath();
395
- var sFieldPath = oParameter.getFieldPath();
396
- if (sFieldPath && (sFieldPath === sMyFieldPath || sFieldPath === "conditions/" + sMyFieldPath) && sHelpPath) { // support also old saved conditions without "conditions/" in name
397
- if (!oHelpParameters) {
398
- oHelpParameters = {};
399
- }
400
- oHelpParameters[sHelpPath] = oParameters[sMyFieldPath];
401
- }
402
- }
403
- }
404
- }
405
-
406
- return oHelpParameters;
407
-
408
- }
409
-
410
297
  FilterableListContent.prototype._getPriorityFilterBar = function () {
411
298
  return this.getFilterBar() || this.getAggregation("_defaultFilterBar");
412
299
  };
@@ -414,74 +301,53 @@ sap.ui.define([
414
301
  FilterableListContent.prototype._observeChanges = function (oChanges) {
415
302
  if (oChanges.object == this) {
416
303
 
417
- if (oChanges.name === "collectiveSearchItems") {
304
+ /* if (oChanges.name === "collectiveSearchItems") {
418
305
  this._assignCollectiveSearch(true);
419
- }
420
- if (oChanges.name === "inConditions") {
421
- _addInParameterToFilterBar.call(this, this._getPriorityFilterBar(), oChanges.current);
422
- }
306
+ } */
423
307
 
424
308
  if (["_defaultFilterBar", "filterBar"].indexOf(oChanges.name) !== -1) {
425
309
  var oFilterBar = oChanges.child;
426
- var oExistingBasicSearchField = oFilterBar.getBasicSearchField();
310
+ var oDefaultFilterBar;
427
311
  if (oChanges.mutation === "insert") {
428
- var sFilterFields = this.getFilterFields();
429
- if (!oExistingBasicSearchField && sFilterFields) { // TODO: use isSearchSupported but here Delegate needs to be loaded
430
- return loadModules([
431
- "sap/ui/mdc/FilterField"
432
- ]).then(function (aModules){
433
- if (!oFilterBar.bIsDestroyed) {
434
- var FilterField = aModules[0];
435
- var oSearchField = new FilterField(this.getId() + "-search", {
436
- conditions: "{$filters>/conditions/" + sFilterFields + "}",
437
- placeholder:"{$i18n>filterbar.SEARCH}",
438
- label:"{$i18n>filterbar.SEARCH}", // TODO: do we want a label?
439
- maxConditions: 1,
440
- width: "50%"
441
- });
442
- oSearchField._bCreatedByValueHelp = true;
443
- oFilterBar.setBasicSearchField(oSearchField);
444
- }
445
- }.bind(this));
446
- } else if (oExistingBasicSearchField) {
447
- oExistingBasicSearchField.setConditions([]);
312
+ _setBasicSearch.call(this, oFilterBar);
313
+ this._assignCollectiveSearchSelect();
314
+
315
+ if (oChanges.name !== "_defaultFilterBar" || !this.getFilterBar()) { // DefaultFilterBar only used if no other FilterBar assigned
316
+ oFilterBar.attachSearch(this._handleSearch, this);
448
317
  }
449
- this._assignCollectiveSearch();
450
- _addInParameterToFilterBar.call(this, oFilterBar, this.getProperty("inConditions"));
451
- _addFilterValueToFilterBar.call(this, oFilterBar, this.getFilterValue());
452
- } else if (oChanges.name === "filterBar") {
318
+ if (oChanges.name === "filterBar") {
319
+ oDefaultFilterBar = this.getAggregation("_defaultFilterBar");
320
+ if (oDefaultFilterBar) {
321
+ oDefaultFilterBar.detachSearch(this._handleSearch, this);
322
+ }
323
+ }
324
+ } else { // remove case
325
+ var oExistingBasicSearchField = oFilterBar.getBasicSearchField();
453
326
  if (oExistingBasicSearchField && oExistingBasicSearchField._bCreatedByValueHelp) {
454
- oExistingBasicSearchField.destroy(); // TODO: reuse for default FilterBar?
327
+ oFilterBar.setBasicSearchField(); // remove to reuse on other FilterBar
328
+ }
329
+
330
+ oFilterBar.detachSearch(this._handleSearch, this);
331
+
332
+ if (oChanges.name === "filterBar") {
333
+ oDefaultFilterBar = this.getAggregation("_defaultFilterBar");
334
+ if (oDefaultFilterBar) {
335
+ oDefaultFilterBar.attachSearch(this._handleSearch, this);
336
+ } else {
337
+ this._createDefaultFilterBar();
338
+ }
455
339
  }
456
- this._createDefaultFilterBar();
457
340
  }
458
341
  }
459
342
  }
460
343
  ListContent.prototype._observeChanges.apply(this, arguments);
461
344
  };
462
345
 
463
- FilterableListContent.prototype.exit = function () {
464
-
465
- Common.cleanup(this, [
466
- "_oCollectiveSearchSelect","_oManagedObjectModel"
467
- ]);
468
-
469
- ListContent.prototype.exit.apply(this, arguments);
470
- };
471
-
472
346
  FilterableListContent.prototype.getCollectiveSearchKey = function () {
473
347
  return this._oCollectiveSearchSelect && this._oCollectiveSearchSelect.getSelectedItemKey();
474
348
  };
475
349
 
476
- FilterableListContent.prototype._getFiltersForFilterBar = function () {
477
- var oFilterBar = this._getPriorityFilterBar();
478
- var oCurrentFilterBarConditions = oFilterBar.getConditions();
479
- var oConditionTypes = this._getTypesForConditions(oCurrentFilterBarConditions);
480
- var oCreatedFBFilters = oCurrentFilterBarConditions && oConditionTypes && FilterConverter.createFilters(oCurrentFilterBarConditions, oConditionTypes, undefined, this.getCaseSensitive());
481
- return oCreatedFBFilters ? [].concat(oCreatedFBFilters) : [];
482
- };
483
-
484
- FilterableListContent.prototype._getListBinding = function () {
350
+ FilterableListContent.prototype.getListBinding = function () {
485
351
  throw new Error("FilterableListContent: Every filterable listcontent must implement this method.");
486
352
  };
487
353
 
@@ -490,51 +356,11 @@ sap.ui.define([
490
356
  };
491
357
 
492
358
  FilterableListContent.prototype._getTypesForConditions = function (oConditions) {
493
-
494
- var oFilterBar = this._getPriorityFilterBar();
495
- var aInParameters = this.getInParameters();
496
- var oConditionTypes;
497
- var sFieldPath;
498
-
499
- if (oFilterBar) {
500
- oConditionTypes = FilterConverter.createConditionTypesMapFromFilterBar( oConditions, oFilterBar);
501
- } else {
502
- // collect condition Fieldpaths here
503
- oConditionTypes = {};
504
- for (sFieldPath in oConditions) {
505
- oConditionTypes[sFieldPath] = {type: null};
506
- }
507
- }
508
-
509
- // try to find missing type from InParameter
510
- for (sFieldPath in oConditionTypes) {
511
- if (!oConditionTypes[sFieldPath].type) {
512
- for (var i = 0; i < aInParameters.length; i++) {
513
- var oInParameter = aInParameters[i];
514
- if (oInParameter.getHelpPath() === sFieldPath) {
515
- oConditionTypes[sFieldPath].type = oInParameter.getDataType();
516
- break;
517
- }
518
- }
519
- }
520
- }
521
-
522
- return oConditionTypes;
523
-
359
+ var oDelegate = this._getValueHelpDelegate();
360
+ var oDelegatePayload = this._getValueHelpDelegatePayload();
361
+ return oDelegate ? oDelegate.getTypesForConditions(oDelegatePayload, this, oConditions) : {};
524
362
  };
525
363
 
526
- function _addInParameterToFilterBar(oFilterBar, oInConditions) {
527
- if (oFilterBar) {
528
- // add inParameters to FilterBar
529
- var oConditions = oFilterBar.getInternalConditions();
530
- for ( var sFilterPath in oInConditions) {
531
- oConditions[sFilterPath] = oInConditions[sFilterPath];
532
- }
533
- oFilterBar.setInternalConditions(oConditions); // TODO: remove on hide?
534
- }
535
-
536
- }
537
-
538
364
  function _addFilterValueToFilterBar(oFilterBar, sFilterValue) {
539
365
  var sFilterFields = this.getFilterFields();
540
366
 
@@ -567,17 +393,68 @@ sap.ui.define([
567
393
 
568
394
  FilterableListContent.prototype.isSearchSupported = function () {
569
395
 
570
- var sFilterFields = this.getFilterFields();
396
+ var sFilterFields = this.getFilterFields();
571
397
  var bSearchSupported = !!sFilterFields;
572
398
  if (sFilterFields === "$search") {
573
- var oListBinding = this._getListBinding();
399
+ var oListBinding = this.getListBinding();
574
400
  var oDelegate = this._getValueHelpDelegate();
575
401
  var oDelegatePayload = this._getValueHelpDelegatePayload();
576
402
  bSearchSupported = oDelegate && oDelegate.isSearchSupported(oDelegatePayload, this, oListBinding);
577
403
  }
578
404
 
579
405
  return bSearchSupported;
406
+ };
407
+
408
+ FilterableListContent.prototype.setCollectiveSearchSelect = function (oDropdown) {
409
+ this._oCollectiveSearchSelect = oDropdown;
410
+ this._assignCollectiveSearchSelect();
411
+ };
412
+
413
+ FilterableListContent.prototype._assignCollectiveSearchSelect = function () {
414
+ var oFilterBar = this._getPriorityFilterBar();
415
+ if (oFilterBar.setCollectiveSearch && this._oCollectiveSearchSelect) {
416
+ oFilterBar.setCollectiveSearch(this._oCollectiveSearchSelect);
417
+ }
418
+ };
419
+
420
+ FilterableListContent.prototype.onBeforeShow = function() {
421
+ var oDelegate = this._getValueHelpDelegate();
422
+ return Promise.resolve(oDelegate && oDelegate.getInitialFilterConditions(this._getValueHelpDelegatePayload(), this, this._getControl())).then(function (oConditions) {
423
+ this._oInitialFilterConditions = oConditions;
424
+ }.bind(this));
425
+ };
426
+
427
+ FilterableListContent.prototype._applyInitialConditions = function (oFilterBar) {
428
+ return oFilterBar && oFilterBar.setInternalConditions(this._oInitialFilterConditions);
429
+ };
430
+
431
+ FilterableListContent.prototype._fireSelect = function (oChange) {
432
+ var oDelegate = this._getValueHelpDelegate();
433
+ var oDelegatePayload = this._getValueHelpDelegatePayload();
434
+ var oModifiedSelectionChange = oDelegate && oDelegate.modifySelectionBehaviour ? oDelegate.modifySelectionBehaviour(oDelegatePayload, this, oChange) : oChange;
435
+ if (oModifiedSelectionChange) {
436
+ this.fireSelect(oModifiedSelectionChange);
437
+ }
438
+ };
439
+
440
+ FilterableListContent.prototype.exit = function () {
441
+
442
+ Common.cleanup(this, [
443
+ "_oCollectiveSearchSelect", "_oInitialFilterConditions"
444
+ ]);
445
+
446
+ if (this._oSearchField && !this._oSearchField.getParent()) {
447
+ this._oSearchField.destroy();
448
+ delete this._oSearchField;
449
+ }
450
+
451
+ ListContent.prototype.exit.apply(this, arguments);
452
+ };
580
453
 
454
+ FilterableListContent.prototype.getCount = function (aConditions, sGroup) {
455
+ var oDelegate = this._isValueHelpDelegateInitialized() && this._getValueHelpDelegate();
456
+ var oDelegatePayload = oDelegate && this._getValueHelpDelegatePayload();
457
+ return oDelegate && oDelegate.getCount ? oDelegate.getCount(oDelegatePayload, this, aConditions, sGroup) : ListContent.prototype.getCount.apply(this, arguments);
581
458
  };
582
459
 
583
460
  return FilterableListContent;
@@ -16,11 +16,11 @@ sap.ui.define([
16
16
  /**
17
17
  * Constructor for a new <code>ListContent</code>.
18
18
  *
19
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
20
- * @param {object} [mSettings] Initial settings for the new control
21
- * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element.
19
+ * @param {string} [sId] ID for the new element, generated automatically if no ID is given
20
+ * @param {object} [mSettings] Initial settings for the new element
21
+ * @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element.
22
22
  * @extends sap.ui.mdc.valuehelp.base.Content
23
- * @version 1.100.0
23
+ * @version 1.101.0
24
24
  * @constructor
25
25
  * @abstract
26
26
  * @private
@@ -18,11 +18,11 @@ sap.ui.define([
18
18
  /**
19
19
  * Constructor for a new <code>Bool</code> content.
20
20
  *
21
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
22
- * @param {object} [mSettings] Initial settings for the new control
23
- * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element to provide a value help for boolean fields.
21
+ * @param {string} [sId] ID for the new element, generated automatically if no ID is given
22
+ * @param {object} [mSettings] Initial settings for the new element
23
+ * @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element to provide a value help for boolean fields.
24
24
  * @extends sap.ui.mdc.valuehelp.content.FixedList
25
- * @version 1.100.0
25
+ * @version 1.101.0
26
26
  * @constructor
27
27
  * @abstract
28
28
  * @private
@@ -21,11 +21,11 @@ sap.ui.define([
21
21
  /**
22
22
  * Constructor for a new <code>Conditions</code> content.
23
23
  *
24
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
25
- * @param {object} [mSettings] Initial settings for the new control
26
- * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element showing a condition panel.
24
+ * @param {string} [sId] ID for the new element, generated automatically if no ID is given
25
+ * @param {object} [mSettings] Initial settings for the new element
26
+ * @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element showing a condition panel.
27
27
  * @extends sap.ui.mdc.valuehelp.base.Content
28
- * @version 1.100.0
28
+ * @version 1.101.0
29
29
  * @constructor
30
30
  * @abstract
31
31
  * @private
@@ -22,11 +22,11 @@ sap.ui.define([
22
22
  /**
23
23
  * Constructor for a new <code>FixedList</code> content.
24
24
  *
25
- * @param {string} [sId] ID for the new control, generated automatically if no ID is given
26
- * @param {object} [mSettings] Initial settings for the new control
27
- * @class Content for the <code>sap.ui.mdc.valuehelp.base.Container</code> element showing a list with fix values.
25
+ * @param {string} [sId] ID for the new element, generated automatically if no ID is given
26
+ * @param {object} [mSettings] Initial settings for the new element
27
+ * @class Content for the {@link sap.ui.mdc.valuehelp.base.Container Container} element showing a list with fix values.
28
28
  * @extends sap.ui.mdc.valuehelp.base.ListContent
29
- * @version 1.100.0
29
+ * @version 1.101.0
30
30
  * @constructor
31
31
  * @abstract
32
32
  * @private