@openui5/sap.ui.mdc 1.130.1 → 1.131.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 (162) hide show
  1. package/THIRDPARTY.txt +1 -1
  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 +62 -25
  6. package/src/sap/ui/mdc/ChartDelegate.js +17 -14
  7. package/src/sap/ui/mdc/Control.js +1 -1
  8. package/src/sap/ui/mdc/DefaultTypeMap.js +1 -1
  9. package/src/sap/ui/mdc/Element.js +1 -1
  10. package/src/sap/ui/mdc/Field.js +43 -15
  11. package/src/sap/ui/mdc/FilterBar.js +1 -1
  12. package/src/sap/ui/mdc/FilterField.js +2 -2
  13. package/src/sap/ui/mdc/Link.js +1 -1
  14. package/src/sap/ui/mdc/LinkDelegate.js +1 -1
  15. package/src/sap/ui/mdc/MultiValueField.js +3 -4
  16. package/src/sap/ui/mdc/Table.js +183 -36
  17. package/src/sap/ui/mdc/TableDelegate.js +40 -18
  18. package/src/sap/ui/mdc/ValueHelp.js +1 -1
  19. package/src/sap/ui/mdc/actiontoolbar/ActionToolbarAction.js +1 -2
  20. package/src/sap/ui/mdc/chart/ChartImplementationContainer.js +1 -1
  21. package/src/sap/ui/mdc/chart/ChartSelectionDetails.js +1 -1
  22. package/src/sap/ui/mdc/chart/PropertyHelper.js +1 -1
  23. package/src/sap/ui/mdc/chart/ToolbarControlFactory.js +1 -1
  24. package/src/sap/ui/mdc/condition/Condition.js +1 -1
  25. package/src/sap/ui/mdc/condition/ConditionConverter.js +1 -1
  26. package/src/sap/ui/mdc/condition/ConditionModel.js +1 -1
  27. package/src/sap/ui/mdc/condition/FilterConverter.js +1 -1
  28. package/src/sap/ui/mdc/condition/FilterOperatorUtil.js +361 -54
  29. package/src/sap/ui/mdc/condition/Operator.js +1 -1
  30. package/src/sap/ui/mdc/condition/OperatorDynamicDateOption.js +1 -1
  31. package/src/sap/ui/mdc/condition/RangeOperator.js +1 -1
  32. package/src/sap/ui/mdc/enums/ActionToolbarActionAlignment.js +0 -1
  33. package/src/sap/ui/mdc/enums/OperatorName.js +127 -1
  34. package/src/sap/ui/mdc/field/ConditionType.js +1 -1
  35. package/src/sap/ui/mdc/field/ConditionTypeMixin.js +1 -1
  36. package/src/sap/ui/mdc/field/ConditionsType.js +1 -1
  37. package/src/sap/ui/mdc/field/CustomFieldInfo.js +1 -1
  38. package/src/sap/ui/mdc/field/DynamicDateRangeConditionsType.js +1 -1
  39. package/src/sap/ui/mdc/field/FieldBase.js +1 -1
  40. package/src/sap/ui/mdc/field/FieldBaseDelegate.js +2 -2
  41. package/src/sap/ui/mdc/field/FieldInfoBase.js +1 -1
  42. package/src/sap/ui/mdc/field/FieldInput.js +1 -1
  43. package/src/sap/ui/mdc/field/FieldInputRenderUtil.js +1 -1
  44. package/src/sap/ui/mdc/field/FieldMultiInput.js +1 -1
  45. package/src/sap/ui/mdc/field/ListFieldHelpItem.js +1 -1
  46. package/src/sap/ui/mdc/field/MultiValueFieldDelegate.js +0 -1
  47. package/src/sap/ui/mdc/field/MultiValueFieldItem.js +1 -2
  48. package/src/sap/ui/mdc/field/TokenDisplay.js +1 -1
  49. package/src/sap/ui/mdc/field/TokenizerDisplay.js +1 -1
  50. package/src/sap/ui/mdc/filterbar/FilterBarBase.js +1 -1
  51. package/src/sap/ui/mdc/filterbar/PropertyHelper.js +1 -1
  52. package/src/sap/ui/mdc/filterbar/p13n/AdaptationFilterBar.js +1 -1
  53. package/src/sap/ui/mdc/filterbar/vh/CollectiveSearchSelect.js +4 -1
  54. package/src/sap/ui/mdc/filterbar/vh/FilterBar.js +5 -2
  55. package/src/sap/ui/mdc/flexibility/Chart.flexibility.js +1 -1
  56. package/src/sap/ui/mdc/flexibility/FilterBar.flexibility.js +1 -1
  57. package/src/sap/ui/mdc/flexibility/FilterItemFlex.js +1 -1
  58. package/src/sap/ui/mdc/flexibility/actiontoolbar/CombineAction.js +1 -2
  59. package/src/sap/ui/mdc/flexibility/actiontoolbar/SplitAction.js +1 -2
  60. package/src/sap/ui/mdc/library.js +2 -2
  61. package/src/sap/ui/mdc/link/Factory.js +1 -1
  62. package/src/sap/ui/mdc/link/LinkItem.js +1 -1
  63. package/src/sap/ui/mdc/link/Panel.js +1 -1
  64. package/src/sap/ui/mdc/link/PanelItem.js +1 -1
  65. package/src/sap/ui/mdc/link/SemanticObjectMapping.js +1 -1
  66. package/src/sap/ui/mdc/link/SemanticObjectMappingItem.js +1 -1
  67. package/src/sap/ui/mdc/link/SemanticObjectUnavailableAction.js +1 -1
  68. package/src/sap/ui/mdc/messagebundle.properties +12 -148
  69. package/src/sap/ui/mdc/messagebundle_ar.properties +6 -96
  70. package/src/sap/ui/mdc/messagebundle_bg.properties +6 -96
  71. package/src/sap/ui/mdc/messagebundle_ca.properties +6 -96
  72. package/src/sap/ui/mdc/messagebundle_cnr.properties +6 -96
  73. package/src/sap/ui/mdc/messagebundle_cs.properties +6 -96
  74. package/src/sap/ui/mdc/messagebundle_cy.properties +6 -96
  75. package/src/sap/ui/mdc/messagebundle_da.properties +6 -96
  76. package/src/sap/ui/mdc/messagebundle_de.properties +6 -96
  77. package/src/sap/ui/mdc/messagebundle_el.properties +6 -96
  78. package/src/sap/ui/mdc/messagebundle_en.properties +6 -96
  79. package/src/sap/ui/mdc/messagebundle_en_GB.properties +6 -96
  80. package/src/sap/ui/mdc/messagebundle_en_US_saprigi.properties +6 -98
  81. package/src/sap/ui/mdc/messagebundle_es.properties +7 -97
  82. package/src/sap/ui/mdc/messagebundle_es_MX.properties +6 -96
  83. package/src/sap/ui/mdc/messagebundle_et.properties +6 -96
  84. package/src/sap/ui/mdc/messagebundle_fi.properties +6 -96
  85. package/src/sap/ui/mdc/messagebundle_fr.properties +6 -96
  86. package/src/sap/ui/mdc/messagebundle_fr_CA.properties +6 -96
  87. package/src/sap/ui/mdc/messagebundle_hi.properties +6 -96
  88. package/src/sap/ui/mdc/messagebundle_hr.properties +6 -96
  89. package/src/sap/ui/mdc/messagebundle_hu.properties +6 -96
  90. package/src/sap/ui/mdc/messagebundle_id.properties +6 -96
  91. package/src/sap/ui/mdc/messagebundle_it.properties +6 -96
  92. package/src/sap/ui/mdc/messagebundle_iw.properties +6 -96
  93. package/src/sap/ui/mdc/messagebundle_ja.properties +6 -96
  94. package/src/sap/ui/mdc/messagebundle_kk.properties +6 -96
  95. package/src/sap/ui/mdc/messagebundle_ko.properties +6 -96
  96. package/src/sap/ui/mdc/messagebundle_lt.properties +6 -96
  97. package/src/sap/ui/mdc/messagebundle_lv.properties +6 -96
  98. package/src/sap/ui/mdc/messagebundle_mk.properties +6 -96
  99. package/src/sap/ui/mdc/messagebundle_ms.properties +6 -96
  100. package/src/sap/ui/mdc/messagebundle_nl.properties +7 -97
  101. package/src/sap/ui/mdc/messagebundle_no.properties +6 -96
  102. package/src/sap/ui/mdc/messagebundle_pl.properties +9 -99
  103. package/src/sap/ui/mdc/messagebundle_pt.properties +6 -96
  104. package/src/sap/ui/mdc/messagebundle_pt_PT.properties +6 -96
  105. package/src/sap/ui/mdc/messagebundle_ro.properties +6 -96
  106. package/src/sap/ui/mdc/messagebundle_ru.properties +13 -103
  107. package/src/sap/ui/mdc/messagebundle_sh.properties +6 -96
  108. package/src/sap/ui/mdc/messagebundle_sk.properties +6 -96
  109. package/src/sap/ui/mdc/messagebundle_sl.properties +6 -96
  110. package/src/sap/ui/mdc/messagebundle_sr.properties +6 -96
  111. package/src/sap/ui/mdc/messagebundle_sv.properties +6 -96
  112. package/src/sap/ui/mdc/messagebundle_th.properties +6 -96
  113. package/src/sap/ui/mdc/messagebundle_tr.properties +6 -96
  114. package/src/sap/ui/mdc/messagebundle_uk.properties +6 -96
  115. package/src/sap/ui/mdc/messagebundle_vi.properties +6 -96
  116. package/src/sap/ui/mdc/messagebundle_zh_CN.properties +6 -96
  117. package/src/sap/ui/mdc/messagebundle_zh_TW.properties +6 -96
  118. package/src/sap/ui/mdc/mixin/AdaptationMixin.js +1 -1
  119. package/src/sap/ui/mdc/mixin/DelegateMixin.js +1 -1
  120. package/src/sap/ui/mdc/mixin/FilterIntegrationMixin.js +1 -1
  121. package/src/sap/ui/mdc/mixin/PromiseMixin.js +1 -1
  122. package/src/sap/ui/mdc/mixin/PropertyHelperMixin.js +1 -1
  123. package/src/sap/ui/mdc/odata/TypeMap.js +1 -1
  124. package/src/sap/ui/mdc/odata/v4/TableDelegate.js +239 -197
  125. package/src/sap/ui/mdc/odata/v4/TypeMap.js +1 -1
  126. package/src/sap/ui/mdc/odata/v4/vizChart/ChartDelegate.js +19 -19
  127. package/src/sap/ui/mdc/p13n/PropertyHelper.js +1 -1
  128. package/src/sap/ui/mdc/p13n/panels/ChartItemPanel.js +12 -19
  129. package/src/sap/ui/mdc/table/Column.js +3 -0
  130. package/src/sap/ui/mdc/table/ColumnSettings.js +1 -1
  131. package/src/sap/ui/mdc/table/CreationRow.js +1 -1
  132. package/src/sap/ui/mdc/table/DragDropConfig.js +1 -1
  133. package/src/sap/ui/mdc/table/GridTableType.js +3 -1
  134. package/src/sap/ui/mdc/table/PropertyHelper.js +14 -1
  135. package/src/sap/ui/mdc/table/ResponsiveColumnSettings.js +1 -1
  136. package/src/sap/ui/mdc/table/RowActionItem.js +1 -1
  137. package/src/sap/ui/mdc/table/RowSettings.js +3 -2
  138. package/src/sap/ui/mdc/table/TableSettings.js +26 -3
  139. package/src/sap/ui/mdc/table/V4AnalyticsPropertyHelper.js +32 -41
  140. package/src/sap/ui/mdc/table/utils/Personalization.js +1 -1
  141. package/src/sap/ui/mdc/ushell/SemanticObjectMapping.js +1 -1
  142. package/src/sap/ui/mdc/ushell/SemanticObjectMappingItem.js +1 -1
  143. package/src/sap/ui/mdc/ushell/SemanticObjectUnavailableAction.js +1 -1
  144. package/src/sap/ui/mdc/util/InfoBar.js +2 -1
  145. package/src/sap/ui/mdc/util/PromiseCache.js +1 -1
  146. package/src/sap/ui/mdc/util/PropertyHelper.js +1 -1
  147. package/src/sap/ui/mdc/valuehelp/CollectiveSearchSelect.js +2 -10
  148. package/src/sap/ui/mdc/valuehelp/Dialog.js +1 -1
  149. package/src/sap/ui/mdc/valuehelp/FilterBar.js +1 -1
  150. package/src/sap/ui/mdc/valuehelp/Popover.js +1 -1
  151. package/src/sap/ui/mdc/valuehelp/base/Container.js +1 -1
  152. package/src/sap/ui/mdc/valuehelp/base/Content.js +1 -1
  153. package/src/sap/ui/mdc/valuehelp/base/DefineConditionPanel.js +30 -32
  154. package/src/sap/ui/mdc/valuehelp/base/DialogTab.js +1 -1
  155. package/src/sap/ui/mdc/valuehelp/base/FilterableListContent.js +1 -1
  156. package/src/sap/ui/mdc/valuehelp/base/ListContent.js +1 -1
  157. package/src/sap/ui/mdc/valuehelp/content/Bool.js +1 -1
  158. package/src/sap/ui/mdc/valuehelp/content/Conditions.js +1 -1
  159. package/src/sap/ui/mdc/valuehelp/content/FixedList.js +6 -1
  160. package/src/sap/ui/mdc/valuehelp/content/FixedListItem.js +1 -1
  161. package/src/sap/ui/mdc/valuehelp/content/MDCTable.js +1 -1
  162. package/src/sap/ui/mdc/valuehelp/content/MTable.js +17 -4
@@ -165,9 +165,9 @@ sap.ui.define([
165
165
  * @property {boolean} [isKey=false]
166
166
  * Defines whether a property is a key or part of a key in the data.
167
167
  * @property {string} [unit]
168
- * Key of the unit property that is related to this property.
168
+ * Key of the unit property that is related to this property. A property must not have both a unit and a text.
169
169
  * @property {string} [text]
170
- * Key of the text property that is related to this property in a 1:1 relation.
170
+ * Key of the text property that is related to this property in a 1:1 relation. A property must not have both a unit and a text.
171
171
  * @property {object} [exportSettings]
172
172
  * Object that contains information about the export settings, see {@link sap.ui.export.Spreadsheet}.
173
173
  * @property {object} [clipboardSettings]
@@ -201,6 +201,8 @@ sap.ui.define([
201
201
  * @public
202
202
  */
203
203
 
204
+ // TODO: The extension in PropertyInfo has been discarded as a general concept in MDC, therefore it might be justified to move this typedef to
205
+ // sap.ui.mdc.odata.v4.TableDelegate. They are tightly coupled and other MDC controls also won't contain multiple PropertyInfo definitions.
204
206
  /**
205
207
  * @typedef {sap.ui.mdc.table.PropertyInfo} sap.ui.mdc.odata.v4.TablePropertyInfo
206
208
  *
@@ -235,6 +237,8 @@ sap.ui.define([
235
237
  * <li><code>propertyInfos</code> (all referenced properties must be specified)</li>
236
238
  * </ul>
237
239
  *
240
+ * @property {boolean} [isKey=false]
241
+ * Defines whether a property is a key or part of a key in the data. A key property must be technically groupable.
238
242
  * @property {boolean} [aggregatable=false]
239
243
  * Defines whether the property is aggregatable. A property can only be declared aggregatable if there is a <code>CustomAggregate</code> whose
240
244
  * <code>Qualifier</code> is equal to the property key.
@@ -250,7 +254,8 @@ sap.ui.define([
250
254
  * <code>aggregatable</code>.
251
255
  * @property {string[]} [extension.additionalProperties]
252
256
  * Properties that are loaded in addition if this property is loaded. These properties must be technically groupable, otherwise they can't be
253
- * loaded.
257
+ * loaded. All nested additional properties must be listed at root level. For example, if property A references B and B references C, A must
258
+ * also reference C.
254
259
  * This attribute is only taken into account if the <code>Aggregate</code> or <code>Group</code> <code>p13nMode</code> is enabled and the
255
260
  * table type is {@link sap.ui.mdc.table.GridTableType GridTable}.
256
261
  * These properties are not considered for any other functionality, such as export or column width calculation, for example.
@@ -994,7 +999,9 @@ sap.ui.define([
994
999
  this._setPropertyHelperClass(PropertyHelper);
995
1000
  this._setupPropertyInfoStore("propertyInfo");
996
1001
 
997
- this._oManagedObjectModel = new ManagedObjectModel(this);
1002
+ this._oManagedObjectModel = new ManagedObjectModel(this, {
1003
+ hasGrandTotal: false
1004
+ });
998
1005
  this._oManagedObjectModel.setDefaultBindingMode(BindingMode.OneWay);
999
1006
  this.setModel(this._oManagedObjectModel, "$sap.ui.mdc.Table");
1000
1007
  };
@@ -2313,29 +2320,72 @@ sap.ui.define([
2313
2320
  });
2314
2321
  };
2315
2322
 
2316
- Table.prototype._isCollapseAllEnabled = function() {
2317
- return this.isControlDelegateInitialized() && this.getControlDelegate().getSupportedFeatures(this).collapseAllRows;
2323
+ Table.prototype.setSelectionMode = function(sSelectionMode) {
2324
+ const sOldSelectionMode = this.getSelectionMode();
2325
+
2326
+ this.setProperty("selectionMode", sSelectionMode, true);
2327
+
2328
+ if (sOldSelectionMode !== sSelectionMode) {
2329
+ this._updateExpandAllButton(true);
2330
+ this._updateCollapseAllButton(true);
2331
+ }
2332
+
2333
+ return this;
2334
+ };
2335
+
2336
+ /**
2337
+ * Checks if collapse capabilities are enabled.
2338
+ *
2339
+ * @returns {boolean} whether collapse capabilities are enabled
2340
+ */
2341
+ Table.prototype._isCollapseEnabled = async function() {
2342
+ if (!this.isControlDelegateInitialized()) {
2343
+ return false;
2344
+ }
2345
+ const oConfig = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
2346
+ let bAvailable = false;
2347
+
2348
+ if ("collapseAll" in oConfig) {
2349
+ if (typeof oConfig.collapseAll !== "function") {
2350
+ throw new Error("TableDelegate#collapseAll: collapseAll needs to be a function");
2351
+ }
2352
+ bAvailable = true;
2353
+ }
2354
+
2355
+ if ("collapseAllFromNode" in oConfig && "isNodeExpanded" in oConfig) {
2356
+ if (typeof oConfig.collapseAllFromNode !== "function") {
2357
+ throw new Error("TableDelegate#fetchExpandAndCollapseConfiguration: collapseAllFromNode needs to be a function");
2358
+ }
2359
+
2360
+ if (typeof oConfig.isNodeExpanded !== "function") {
2361
+ throw new Error("TableDelegate#isNodeExpanded: isNodeExpanded needs to be a function");
2362
+ }
2363
+
2364
+ bAvailable = true;
2365
+ }
2366
+
2367
+ return bAvailable;
2318
2368
  };
2319
2369
 
2320
2370
  /**
2321
2371
  * Retrieves the "Collapse All" button. Creates the button if necessary.
2322
2372
  *
2323
- * @returns {sap.m.MenuButton} button for "Expand All"
2373
+ * @param {boolean} bRecreate Whether the button should be recreated
2324
2374
  * @private
2325
2375
  */
2326
- Table.prototype._updateCollapseAllButton = function() {
2327
- const bNeedCollapseAllButton = this._oToolbar != null && this._isCollapseAllEnabled();
2376
+ Table.prototype._updateCollapseAllButton = async function(bRecreate) {
2377
+ const bCollapseAllAvailable = await this._isCollapseEnabled();
2378
+ const bNeedCollapseAllButton = this._oToolbar != null && bCollapseAllAvailable;
2328
2379
 
2329
- if (bNeedCollapseAllButton && !this._oCollapseAllButton) {
2330
- this._oCollapseAllButton = TableSettings.createExpandCollapseAllButton(this.getId(), [
2331
- function() {
2332
- try {
2333
- this.getControlDelegate().collapseAllRows(this);
2334
- } catch (oError) {
2335
- Log.error("CollapseAll could not be performed", oError, this);
2336
- }
2337
- }, this
2338
- ], false);
2380
+ if (bNeedCollapseAllButton && (!this._oCollapseAllButton || bRecreate)) {
2381
+ if (this._oCollapseAllButton) {
2382
+ if (this._oToolbar && this._oToolbar.getEnd().includes(this._oCollapseAllButton)) {
2383
+ this._oToolbar.removeEnd(this._oCollapseAllButton);
2384
+ }
2385
+ this._oCollapseAllButton.destroy();
2386
+ this._oCollapseAllButton = null;
2387
+ }
2388
+ this._oCollapseAllButton = await this._createCollapseButton();
2339
2389
  }
2340
2390
 
2341
2391
  if (!this._oCollapseAllButton) {
@@ -2347,32 +2397,62 @@ sap.ui.define([
2347
2397
  }
2348
2398
 
2349
2399
  this._oCollapseAllButton.setEnabled(!MTableUtil.isEmpty(this.getRowBinding()));
2350
- this._oCollapseAllButton.setVisible(this._isCollapseAllEnabled());
2400
+ this._oCollapseAllButton.setVisible(bCollapseAllAvailable);
2351
2401
  };
2352
2402
 
2353
- Table.prototype._isExpandAllEnabled = function() {
2354
- return this.isControlDelegateInitialized() && this.getControlDelegate().getSupportedFeatures(this).expandAllRows;
2403
+ /**
2404
+ * Checks if expand capabilities are enabled.
2405
+ *
2406
+ * @returns {boolean} whether expand capabilities are enabled
2407
+ */
2408
+ Table.prototype._isExpandEnabled = async function() {
2409
+ if (!this.isControlDelegateInitialized()) {
2410
+ return false;
2411
+ }
2412
+ const oConfig = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
2413
+ let bAvailable = false;
2414
+
2415
+ if ("expandAll" in oConfig) {
2416
+ if (typeof oConfig.expandAll !== "function") {
2417
+ throw new Error("TableDelegate#expandAll: expandAll needs to be a function");
2418
+ }
2419
+ bAvailable = true;
2420
+ }
2421
+
2422
+ if ("expandAllFromNode" in oConfig && "isNodeExpanded" in oConfig) {
2423
+ if (typeof oConfig.expandAllFromNode !== "function") {
2424
+ throw new Error("TableDelegate#fetchExpandAndCollapseConfiguration: expandAllFromNode needs to be a function");
2425
+ }
2426
+
2427
+ if (typeof oConfig.isNodeExpanded !== "function") {
2428
+ throw new Error("TableDelegate#isNodeExpanded: isNodeExpanded needs to be a function");
2429
+ }
2430
+
2431
+ bAvailable = true;
2432
+ }
2433
+
2434
+ return bAvailable;
2355
2435
  };
2356
2436
 
2357
2437
  /**
2358
2438
  * Retrieves the "Collapse All" button. Creates the button if necessary.
2359
2439
  *
2360
- * @returns {sap.m.MenuButton} button for "Expand All"
2440
+ * @param {boolean} bRecreate Whether the button should be recreated
2361
2441
  * @private
2362
2442
  */
2363
- Table.prototype._updateExpandAllButton = function() {
2364
- const bNeedExpandAllButton = this._oToolbar != null && this._isExpandAllEnabled();
2443
+ Table.prototype._updateExpandAllButton = async function(bRecreate) {
2444
+ const bExpandAllAvailable = await this._isExpandEnabled();
2445
+ const bNeedExpandAllButton = this._oToolbar != null && bExpandAllAvailable;
2365
2446
 
2366
- if (bNeedExpandAllButton && !this._oExpandAllButton) {
2367
- this._oExpandAllButton = TableSettings.createExpandCollapseAllButton(this.getId(), [
2368
- function() {
2369
- try {
2370
- this.getControlDelegate().expandAllRows(this);
2371
- } catch (oError) {
2372
- Log.error("ExpandAll could not be performed", oError, this);
2373
- }
2374
- }, this
2375
- ], true);
2447
+ if (bNeedExpandAllButton && (!this._oExpandAllButton || bRecreate)) {
2448
+ if (this._oExpandAllButton) {
2449
+ if (this._oToolbar && this._oToolbar.getEnd().includes(this._oExpandAllButton)) {
2450
+ this._oToolbar.removeEnd(this._oExpandAllButton);
2451
+ }
2452
+ this._oExpandAllButton.destroy();
2453
+ this._oExpandAllButton = null;
2454
+ }
2455
+ this._oExpandAllButton = await this._createExpandButton();
2376
2456
  }
2377
2457
 
2378
2458
  if (!this._oExpandAllButton) {
@@ -2384,7 +2464,74 @@ sap.ui.define([
2384
2464
  }
2385
2465
 
2386
2466
  this._oExpandAllButton.setEnabled(!MTableUtil.isEmpty(this.getRowBinding()));
2387
- this._oExpandAllButton.setVisible(this._isExpandAllEnabled());
2467
+ this._oExpandAllButton.setVisible(bExpandAllAvailable);
2468
+ };
2469
+
2470
+ /**
2471
+ * Create an expand button for the toolbar.
2472
+ *
2473
+ * @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
2474
+ */
2475
+ Table.prototype._createExpandButton = async function() {
2476
+ const oConfiguration = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
2477
+ return this._createExpandCollapseButton(true, {
2478
+ tree: oConfiguration.expandAll,
2479
+ node: oConfiguration.expandAllFromNode,
2480
+ isExpanded: oConfiguration.isNodeExpanded
2481
+ });
2482
+ };
2483
+
2484
+ /**
2485
+ * Create a collapse button for the toolbar.
2486
+ *
2487
+ * @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
2488
+ */
2489
+ Table.prototype._createCollapseButton = async function() {
2490
+ const oConfiguration = await this.getControlDelegate().fetchExpandAndCollapseConfiguration(this);
2491
+ return this._createExpandCollapseButton(false, {
2492
+ tree: oConfiguration.collapseAll,
2493
+ node: oConfiguration.collapseAllFromNode,
2494
+ isExpanded: oConfiguration.isNodeExpanded
2495
+ });
2496
+ };
2497
+
2498
+ /**
2499
+ * Creates either an expand or collapse button as button or menu button.
2500
+ *
2501
+ * @param {*} bIsExpand whether the button should expand or collapse
2502
+ * @param {object} mConfig configuration map that contains the expand/collapse methods
2503
+ * @param {function} mConfig.tree method to expand/collapse the whole tree
2504
+ * @param {function} mConfig.node method to expand/collapse a single node
2505
+ * @param {function} mConfig.isExpanded method to check if a node is expanded
2506
+ *
2507
+ * @returns {sap.m.Button|sap.m.MenuButton} either a button or a menu button
2508
+ * @private
2509
+ */
2510
+ Table.prototype._createExpandCollapseButton = function(bIsExpand, mConfig) {
2511
+ const { tree: fnTree, node: fnNode, isExpanded: fnIsExpanded } = mConfig;
2512
+
2513
+ if (this.getSelectionMode() === "None" || typeof fnNode !== "function" || typeof fnIsExpanded !== "function") {
2514
+ return TableSettings.createExpandCollapseButton(this.getId(), bIsExpand, () => fnTree(this));
2515
+ }
2516
+
2517
+ const oMenuButton = TableSettings.createExpandCollapseMenuButton(this.getId(), bIsExpand, {
2518
+ "tree": () => fnTree(this),
2519
+ "node": () => {
2520
+ const aContexts = this.getSelectedContexts();
2521
+ return aContexts.length === 1 && fnNode(this, aContexts[0]);
2522
+ }
2523
+ });
2524
+
2525
+ oMenuButton.attachBeforeMenuOpen(() => {
2526
+ const aContexts = this.getSelectedContexts();
2527
+ // Node needs to be expanded to collapse it and vice versa
2528
+ const bShowNodeOption = aContexts.length === 1 && fnIsExpanded(this, aContexts[0]) === !bIsExpand;
2529
+
2530
+ oMenuButton.getMenu().getItems()[0].setEnabled(fnTree != undefined);
2531
+ oMenuButton.getMenu().getItems()[1].setEnabled(bShowNodeOption);
2532
+ });
2533
+
2534
+ return oMenuButton;
2388
2535
  };
2389
2536
 
2390
2537
  /**
@@ -113,6 +113,18 @@ sap.ui.define([
113
113
  * @protected
114
114
  */
115
115
 
116
+ /**
117
+ * Represents the expand and collapse configuration object.
118
+ *
119
+ * @typedef {object} sap.ui.mdc.TableDelegate.ExpandAndCollapseConfiguration
120
+ *
121
+ * @property {function(sap.ui.mdc.Table): void} [expandAll] Function to expand all rows
122
+ * @property {function(sap.ui.mdc.Table): void} [collapseAll] Function to collapse all rows
123
+ * @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [expandAllFromNode] Function to expand all rows from a specific node
124
+ * @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [collapseAllFromNode] Function to collapse all rows from a specific node
125
+ * @property {function(sap.ui.mdc.Table, sap.ui.model.Context): void} [isNodeExpanded] Function to check if a specific node is expanded
126
+ */
127
+
116
128
  /**
117
129
  * Updates the binding info object that is used to bind the table in {@link module:sap/ui/mdc/TableDelegate.updateBinding updateBinding}.
118
130
  *
@@ -342,25 +354,37 @@ sap.ui.define([
342
354
  };
343
355
 
344
356
  /**
345
- * Expands all rows.
357
+ * Returns the feature set for expanding or collapsing in the table.
346
358
  *
347
- * @param {sap.ui.mdc.Table} oTable Instance of the table
348
- * @throws {Error} If the delegate does not support this operation
349
- * @protected
350
- */
351
- TableDelegate.expandAllRows = function(oTable) {
352
- throw Error("Unsupported operation: TableDelegate.expandAllRows");
353
- };
354
-
355
- /**
356
- * Collapses all rows.
359
+ * By default, this method returns an empty object.
357
360
  *
358
- * @param {sap.ui.mdc.Table} oTable Instance of the table
359
- * @throws {Error} If the delegate does not support this operation
361
+ * The configuration object needs to contain the following functions to enable specific functionalities:
362
+ * <ul>
363
+ * <li>To enable the <b>expand all</b> functionality, you need to implement the <code>expandAll</code> function in the configuration object.</li>
364
+ * <li>To enable the <b>collapse all</b> functionality, you need to implement the <code>collapseAll</code> function in the configuration object.</li>
365
+ * <li>To enable the <b>expand all from a specific node</b> functionality, you need to implement the <code>expandAllFromNode</code> and the <code>isNodeExpanded</code> function in the configuration object.</li>
366
+ * <li>To enable the <b>collapse all from a specific node</b> functionality, you need to implement the <code>collapseAllFromNode</code> and the <code>isNodeExpanded</code> function in the configuration object.</li>
367
+ * <ul>
368
+ *
369
+ * <b>Note:</b> Expand and collapse all from a specific node is only supported, if the table rows are selectable.
370
+ *
371
+ * @example
372
+ * TableDelegate.fetchExpandAndCollapseConfiguration = function(oTable) {
373
+ * return Promise.resolve({
374
+ * expandAll: function(oTable) {
375
+ * // Implement expandAll functionality
376
+ * },
377
+ * collapseAll: function(oTable) {
378
+ * // Implement collapseAll functionality
379
+ * }
380
+ * });
381
+ * }
382
+ * @param {sap.ui.mdc.Table} oTable table instance
383
+ * @returns {Promise<sap.ui.mdc.TableDelegate.ExpandAndCollapseConfiguration>} A <code>Promise</code> that resolves with an object containing the expand and collapse functions
360
384
  * @protected
361
385
  */
362
- TableDelegate.collapseAllRows = function(oTable) {
363
- throw Error("Unsupported operation: TableDelegate.collapseAllRows");
386
+ TableDelegate.fetchExpandAndCollapseConfiguration = function(oTable) {
387
+ return Promise.resolve({});
364
388
  };
365
389
 
366
390
  /**
@@ -381,9 +405,7 @@ sap.ui.define([
381
405
 
382
406
  return {
383
407
  p13nModes: aSupportedP13nModes,
384
- "export": true,
385
- expandAllRows: false,
386
- collapseAllRows: false
408
+ "export": true
387
409
  };
388
410
  };
389
411
 
@@ -67,7 +67,7 @@ sap.ui.define([
67
67
  * and {@link sap.ui.mdc.FilterField FilterField} controls using the <code>valueHelp</code> association. One <code>ValueHelp</code> element instance can be
68
68
  * assigned to multiple fields (like in different table rows). It should be placed in the control tree on the container holding the fields.
69
69
  * @extends sap.ui.mdc.Element
70
- * @version 1.130.1
70
+ * @version 1.131.0
71
71
  * @constructor
72
72
  * @abstract
73
73
  * @public
@@ -20,11 +20,10 @@ sap.ui.define([
20
20
  * The action for an {@link sap.ui.mdc.ActionToolbar ActionToolbar} control with given layout information that determines where the wrapped control is displayed on the <code>ActionToolbar</code>.
21
21
  * @extends sap.ui.core.Control
22
22
  * @author SAP SE
23
- * @version 1.130.1
23
+ * @version 1.131.0
24
24
  * @constructor
25
25
  * @since 1.58
26
26
  * @private
27
- * @experimental
28
27
  * @alias sap.ui.mdc.actiontoolbar.ActionToolbarAction
29
28
  */
30
29
  const ActionToolbarAction = Control.extend("sap.ui.mdc.actiontoolbar.ActionToolbarAction", {
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  * @class The <code>ChartImplementationContainer</code> creates a container for the <code>content</code> (chart) and <code>noDataContent</code>. Based on the <code>showNoDataStruct</code> the <code>content</code> or <code>noDataContent</code> will be shown.
22
22
  * @extends sap.ui.core.Control
23
23
  * @author SAP SE
24
- * @version 1.130.1
24
+ * @version 1.131.0
25
25
  * @constructor
26
26
  *
27
27
  * @public
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @class The <code>ChartSelectionDetails</code> control creates a <code>sap.m.SelectionDetails</code> popover based on metadata and the configuration specified.
39
39
  * @extends sap.m.SelectionDetails
40
40
  * @author SAP SE
41
- * @version 1.130.1
41
+ * @version 1.131.0
42
42
  * @constructor
43
43
  * @public
44
44
  * @experimental As of version 1.88
@@ -26,7 +26,7 @@ sap.ui.define([
26
26
  * @extends sap.ui.mdc.util.PropertyHelper
27
27
  *
28
28
  * @author SAP SE
29
- * @version 1.130.1
29
+ * @version 1.131.0
30
30
  *
31
31
  * @private
32
32
  * @since 1.83
@@ -49,7 +49,7 @@ sap.ui.define([
49
49
  * @namespace
50
50
  * @alias sap.ui.mdc.chart.ToolbarControlFactory
51
51
  * @author SAP SE
52
- * @version 1.130.1
52
+ * @version 1.131.0
53
53
  * @since 1.123
54
54
  * @experimental
55
55
  * @private
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  *
34
34
  * @namespace
35
35
  * @author SAP SE
36
- * @version 1.130.1
36
+ * @version 1.131.0
37
37
  * @since 1.61.0
38
38
  * @alias sap.ui.mdc.condition.Condition
39
39
  *
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @namespace
26
26
  * @author SAP SE
27
- * @version 1.130.1
27
+ * @version 1.131.0
28
28
  * @private
29
29
  * @ui5-restricted sap.ui.mdc
30
30
  * @since 1.74.0
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.ui.model.json.JSONModel
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.130.1
36
+ * @version 1.131.0
37
37
  * @since 1.48.0
38
38
  * @alias sap.ui.mdc.condition.ConditionModel
39
39
  *
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  *
25
25
  * @namespace
26
26
  * @author SAP SE
27
- * @version 1.130.1
27
+ * @version 1.131.0
28
28
  * @since 1.78.0
29
29
  * @alias sap.ui.mdc.condition.FilterConverter
30
30
  *