@openui5/sap.ui.table 1.119.1 → 1.120.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 (58) hide show
  1. package/THIRDPARTY.txt +6 -6
  2. package/package.json +3 -3
  3. package/src/sap/ui/table/.library +1 -1
  4. package/src/sap/ui/table/AnalyticalColumn.js +25 -15
  5. package/src/sap/ui/table/AnalyticalColumnMenu.js +6 -5
  6. package/src/sap/ui/table/AnalyticalTable.js +25 -38
  7. package/src/sap/ui/table/Column.js +135 -95
  8. package/src/sap/ui/table/ColumnMenu.js +1 -1
  9. package/src/sap/ui/table/CreationRow.js +1 -1
  10. package/src/sap/ui/table/Row.js +1 -1
  11. package/src/sap/ui/table/RowAction.js +1 -1
  12. package/src/sap/ui/table/RowActionItem.js +1 -1
  13. package/src/sap/ui/table/RowSettings.js +1 -1
  14. package/src/sap/ui/table/Table.js +206 -186
  15. package/src/sap/ui/table/TablePersoController.js +1 -1
  16. package/src/sap/ui/table/TableRenderer.js +35 -11
  17. package/src/sap/ui/table/TreeTable.js +1 -1
  18. package/src/sap/ui/table/designtime/Table.designtime.js +21 -2
  19. package/src/sap/ui/table/extensions/Accessibility.js +18 -8
  20. package/src/sap/ui/table/extensions/AccessibilityRender.js +3 -1
  21. package/src/sap/ui/table/extensions/DragAndDrop.js +1 -1
  22. package/src/sap/ui/table/extensions/ExtensionBase.js +1 -1
  23. package/src/sap/ui/table/extensions/Keyboard.js +1 -1
  24. package/src/sap/ui/table/extensions/KeyboardDelegate.js +24 -10
  25. package/src/sap/ui/table/extensions/Pointer.js +1 -1
  26. package/src/sap/ui/table/extensions/Scrolling.js +1 -1
  27. package/src/sap/ui/table/extensions/ScrollingIOS.js +1 -1
  28. package/src/sap/ui/table/extensions/Synchronization.js +1 -1
  29. package/src/sap/ui/table/library.js +25 -16
  30. package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +1 -1
  31. package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +26 -13
  32. package/src/sap/ui/table/messagebundle_mk.properties +126 -0
  33. package/src/sap/ui/table/messagebundle_sh.properties +16 -16
  34. package/src/sap/ui/table/plugins/BindingSelection.js +10 -5
  35. package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +9 -3
  36. package/src/sap/ui/table/plugins/ODataV4Selection.js +9 -4
  37. package/src/sap/ui/table/plugins/PluginBase.js +1 -1
  38. package/src/sap/ui/table/plugins/SelectionModelSelection.js +10 -5
  39. package/src/sap/ui/table/plugins/SelectionPlugin.js +17 -3
  40. package/src/sap/ui/table/plugins/V4Aggregation.js +1 -1
  41. package/src/sap/ui/table/rowmodes/Auto.js +5 -5
  42. package/src/sap/ui/table/rowmodes/Fixed.js +5 -5
  43. package/src/sap/ui/table/rowmodes/Interactive.js +1 -1
  44. package/src/sap/ui/table/rowmodes/RowMode.js +11 -1
  45. package/src/sap/ui/table/rowmodes/Variable.js +1 -1
  46. package/src/sap/ui/table/rules/Plugins.support.js +23 -21
  47. package/src/sap/ui/table/rules/Rows.support.js +24 -5
  48. package/src/sap/ui/table/themes/base/Cell.less +1 -1
  49. package/src/sap/ui/table/themes/base/Grouping.less +1 -1
  50. package/src/sap/ui/table/themes/base/Table.less +1 -1
  51. package/src/sap/ui/table/themes/base/library.source.less +0 -3
  52. package/src/sap/ui/table/themes/sap_hcb/library.source.less +0 -3
  53. package/src/sap/ui/table/utils/TableUtils.js +10 -12
  54. package/src/sap/ui/table/utils/_BindingUtils.js +1 -1
  55. package/src/sap/ui/table/utils/_ColumnUtils.js +1 -1
  56. package/src/sap/ui/table/utils/_GroupingUtils.js +1 -1
  57. package/src/sap/ui/table/utils/_HookUtils.js +34 -3
  58. package/src/sap/ui/table/utils/_MenuUtils.js +1 -1
@@ -30,7 +30,8 @@ sap.ui.define([
30
30
  "./plugins/SelectionModelSelection",
31
31
  "sap/ui/thirdparty/jquery",
32
32
  "sap/base/Log",
33
- "sap/ui/core/Configuration"
33
+ "sap/ui/core/Configuration",
34
+ "sap/ui/core/library"
34
35
  ], function(
35
36
  Device,
36
37
  Control,
@@ -57,7 +58,8 @@ sap.ui.define([
57
58
  SelectionModelSelectionPlugin,
58
59
  jQuery,
59
60
  Log,
60
- Configuration
61
+ Configuration,
62
+ CoreLibrary
61
63
  ) {
62
64
  "use strict";
63
65
 
@@ -65,7 +67,7 @@ sap.ui.define([
65
67
  var NavigationMode = library.NavigationMode;
66
68
  var SelectionMode = library.SelectionMode;
67
69
  var SelectionBehavior = library.SelectionBehavior;
68
- var SortOrder = library.SortOrder;
70
+ var SortOrder = CoreLibrary.SortOrder;
69
71
  var VisibleRowCountMode = library.VisibleRowCountMode;
70
72
  var Hook = TableUtils.Hook.Keys.Table;
71
73
  var _private = TableUtils.createWeakMapFacade();
@@ -94,7 +96,7 @@ sap.ui.define([
94
96
  * the data model and binding being used.
95
97
  * </p>
96
98
  * @extends sap.ui.core.Control
97
- * @version 1.119.1
99
+ * @version 1.120.1
98
100
  *
99
101
  * @constructor
100
102
  * @public
@@ -168,7 +170,9 @@ sap.ui.define([
168
170
  * When the selection mode is changed, the current selection is removed.
169
171
  * <b>Note:</b> Since the group header visualization relies on the row selectors, the row selectors are always shown if the grouping
170
172
  * functionality (depends on table type) is enabled, even if <code>sap.ui.table.SelectionMode.None</code> is set.
171
- * <b>Note:</b> If a selection plugin is applied to the table, the selection mode is controlled by the plugin.
173
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
174
+ * it is recommended to use a selection plugin instead.
175
+ * <b>Note:</b> If a selection plugin is used with the table, the selection mode is controlled by the plugin.
172
176
  */
173
177
  selectionMode: {type: "sap.ui.table.SelectionMode", group: "Behavior", defaultValue: SelectionMode.MultiToggle},
174
178
 
@@ -440,7 +444,7 @@ sap.ui.define([
440
444
  rows: {type: "sap.ui.table.Row", multiple: true, singularName: "row", bindable: "bindable", selector: "#{id}-tableCCnt", dnd: true},
441
445
 
442
446
  /**
443
- * Defines how the table handles the rows.
447
+ * Defines how the table handles the rows. By default, the table operates in {@link sap.ui.table.rowmodes.Type Fixed} mode.
444
448
  *
445
449
  * @since 1.119
446
450
  */
@@ -506,16 +510,12 @@ sap.ui.define([
506
510
  /**
507
511
  * Plugin section of the table. Multiple plugins are possible, but always only <b>one</b> of a certain type.
508
512
  *
509
- * The following restrictions apply:
510
- * <ul>
511
- * <li>If a selection plugin is applied to the table, the table's selection API must not be used. Instead, use the API of the
512
- * plugin.</li>
513
- * <li>Only one MultiSelectionPlugin can be applied. No other plugins can be applied.</li>
514
- * </ul>
513
+ * If a selection plugin is used, the table's selection API must not be used. Instead, use the API of the plugin.
515
514
  *
516
515
  * @since 1.64
516
+ * @deprecated As of version 1.120. Please add plugins to the <code>dependents</code> aggregation instead.
517
517
  */
518
- plugins: {type: "sap.ui.table.plugins.SelectionPlugin", multiple: true, singularName: "plugin"},
518
+ plugins: {type: "sap.ui.table.plugins.SelectionPlugin", multiple: true, singularName: "plugin", deprecated: true},
519
519
 
520
520
  /**
521
521
  * Defines the message strip to display binding-related messages.
@@ -552,10 +552,15 @@ sap.ui.define([
552
552
  events: {
553
553
 
554
554
  /**
555
- * fired when the row selection of the table has been changed (the event parameters can be used to determine
556
- * selection changes - to find out the selected rows you should better use the table selection API)
555
+ * Fired if the row selection of the table has been changed.
557
556
  *
558
- * <b>Note:</b> If a selection plugin is applied to the table, this event won't be fired.
557
+ * The event parameters can be used to determine selection changes. To find the selected rows, you should
558
+ * use {@link sap.ui.table.Table#getSelectedIndices} or the related function of the used selection plugin
559
+ * if it exists.
560
+ *
561
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
562
+ * it is recommended to use a selection plugin instead.
563
+ * <b>Note:</b> If a selection plugin is used with the table, this event won't be fired.
559
564
  */
560
565
  rowSelectionChange: {
561
566
  parameters: {
@@ -590,6 +595,7 @@ sap.ui.define([
590
595
 
591
596
  /**
592
597
  * fired when a column of the table has been selected
598
+ * @deprecated As of version 1.117
593
599
  */
594
600
  columnSelect: {
595
601
  allowPreventDefault: true,
@@ -652,19 +658,18 @@ sap.ui.define([
652
658
  sort: {
653
659
  allowPreventDefault: true,
654
660
  parameters: {
655
-
656
661
  /**
657
- * sorted column.
662
+ * The column for which the sorting is changed
658
663
  */
659
664
  column: {type: "sap.ui.table.Column"},
660
665
 
661
666
  /**
662
- * Sort Order
667
+ * The new sort order
663
668
  */
664
- sortOrder: {type: "sap.ui.table.SortOrder"},
669
+ sortOrder: {type: "sap.ui.core.SortOrder"},
665
670
 
666
671
  /**
667
- * If column was added to sorter this is true. If new sort is started this is set to false
672
+ * Indicates that the column is added to the list of sorted columns
668
673
  */
669
674
  columnAdded: {type: "boolean"}
670
675
  }
@@ -1045,12 +1050,16 @@ sap.ui.define([
1045
1050
  Table.prototype.applySettings = function(mSettings, oScope) {
1046
1051
  // The threshold and firstVisibleRow must be set before the OData binding for the "rows" aggregation is initialized. If the metadata is
1047
1052
  // already loaded, a getContexts call may be triggered immediately with the default values instead of the one in the settings.
1048
- // Some settings might rely on the existence of a row mode or plugin. If row modes and plugins are in the settings and applied before
1049
- // other settings, initialization of default row modes and legacy selection plugins can be avoided.
1053
+ // Some settings might rely on the existence of a row mode.
1050
1054
  if (mSettings) {
1051
- var aEarlySettings = ["threshold", "firstVisibleRow", "rowMode", "plugins"];
1055
+ var aEarlySettings = ["threshold", "firstVisibleRow", "rowMode"];
1052
1056
  var mEarlySettings = {};
1053
1057
 
1058
+ /**
1059
+ * @deprecated As of version 1.120
1060
+ */
1061
+ aEarlySettings.push("plugins");
1062
+
1054
1063
  for (var i = 0; i < aEarlySettings.length; i++) {
1055
1064
  var sSetting = aEarlySettings[i];
1056
1065
 
@@ -1065,9 +1074,8 @@ sap.ui.define([
1065
1074
  }
1066
1075
  }
1067
1076
 
1068
- this._initDefaultRowMode();
1069
- this._initLegacySelectionPlugin();
1070
-
1077
+ this._initLegacySelectionPlugin(); // Doing it at the end can eliminate the need to create a legacy selection plugin.
1078
+ initDefaultRowMode(this);
1071
1079
  Control.prototype.applySettings.call(this, mSettings, oScope);
1072
1080
  };
1073
1081
 
@@ -1156,7 +1164,7 @@ sap.ui.define([
1156
1164
  * Localization changed
1157
1165
  * @private
1158
1166
  */
1159
- Table.prototype.onlocalizationChanged = function(oEvent) {
1167
+ Table.prototype.onLocalizationChanged = function(oEvent) {
1160
1168
  var oChanges = oEvent.changes || {};
1161
1169
  var bRtlChanged = oChanges.hasOwnProperty("rtl");
1162
1170
  var bLangChanged = oChanges.hasOwnProperty("language");
@@ -1165,6 +1173,11 @@ sap.ui.define([
1165
1173
  }.bind(this)).catch(function() {});
1166
1174
  };
1167
1175
 
1176
+ /**
1177
+ * @deprecated As of version 1.120
1178
+ */
1179
+ Table.prototype.onlocalizationChanged = Table.prototype.onLocalizationChanged;
1180
+
1168
1181
  /**
1169
1182
  * Adapts the table to localization changes. Re-rendering or invalidation of the table needs to be taken care of by the caller.
1170
1183
  *
@@ -1770,6 +1783,9 @@ sap.ui.define([
1770
1783
  * @param {sap.ui.table.SelectionMode} sSelectionMode the selection mode, see sap.ui.table.SelectionMode
1771
1784
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
1772
1785
  * @public
1786
+ *
1787
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
1788
+ * it is recommended to use a selection plugin instead.
1773
1789
  */
1774
1790
  Table.prototype.setSelectionMode = function(sSelectionMode) {
1775
1791
  if (sSelectionMode === SelectionMode.Multi) {
@@ -1782,7 +1798,7 @@ sap.ui.define([
1782
1798
  Log.error("If a selection plugin is applied to the table, the selection mode is controlled by the plugin.", this);
1783
1799
  } else {
1784
1800
  this.setProperty("selectionMode", sSelectionMode);
1785
- this._oLegacySelectionPlugin.setSelectionMode(sSelectionMode);
1801
+ this._getSelectionPlugin().setSelectionMode(sSelectionMode);
1786
1802
  }
1787
1803
 
1788
1804
  return this;
@@ -2152,52 +2168,52 @@ sap.ui.define([
2152
2168
  Table.prototype._onBindingChange = function(oEvent) {};
2153
2169
 
2154
2170
  Table.prototype.setRowMode = function(vRowMode) {
2155
- this._destroyDefaultRowMode();
2171
+ destroyDefaultRowMode(this);
2156
2172
  this.setAggregation("rowMode", vRowMode);
2157
- this._initDefaultRowMode();
2173
+ initDefaultRowMode(this);
2158
2174
  return this;
2159
2175
  };
2160
2176
 
2161
2177
  Table.prototype.destroyRowMode = function() {
2162
2178
  this.destroyAggregation("rowMode");
2163
2179
 
2164
- if (!this._oDefaultRowMode) {
2165
- this._initDefaultRowMode();
2180
+ if (!_private(this).oDefaultRowMode) {
2181
+ initDefaultRowMode(this);
2166
2182
  }
2167
2183
 
2168
2184
  return this;
2169
2185
  };
2170
2186
 
2171
2187
  /**
2172
- * Gets the row mode of the table. If no row mode instance is set, a default row mode is returned.
2188
+ * Gets the row mode of the table. This is either the applied row mode instance, or the default row mode instance if it was already created.
2173
2189
  *
2174
- * @returns {sap.ui.table.rowmodes.RowMode} The row mode of the table.
2175
- * @private
2190
+ * @param {sap.ui.table.Table} oTable The table from which to get the row mode.
2191
+ * @returns {sap.ui.table.rowmodes.RowMode | undefined} The row mode of the table.
2176
2192
  */
2177
- Table.prototype._getRowMode = function() {
2178
- var vRowMode = this.getRowMode();
2193
+ function getRowMode(oTable) {
2194
+ var vRowMode = oTable.getRowMode();
2179
2195
 
2180
2196
  /**
2181
2197
  * @deprecated As of version 1.119
2182
2198
  */
2183
- if (!this.isDestroyStarted() && !TableUtils.isA(vRowMode, "sap.ui.table.rowmodes.RowMode") && !this._oDefaultRowMode) {
2184
- this._initDefaultRowMode();
2199
+ if (!oTable.isDestroyStarted() && !TableUtils.isA(vRowMode, "sap.ui.table.rowmodes.RowMode") && !_private(oTable).oDefaultRowMode) {
2200
+ initDefaultRowMode(oTable);
2185
2201
  }
2186
2202
 
2187
- return TableUtils.isA(vRowMode, "sap.ui.table.rowmodes.RowMode") ? vRowMode : this._oDefaultRowMode;
2188
- };
2203
+ return TableUtils.isA(vRowMode, "sap.ui.table.rowmodes.RowMode") ? vRowMode : _private(oTable).oDefaultRowMode;
2204
+ }
2189
2205
 
2190
2206
  /**
2191
2207
  * Initializes a row mode instance with default settings if no row mode instance exists.
2192
2208
  *
2193
- * @private
2209
+ * @param {sap.ui.table.Table} oTable The table for which to create a default row mode instance.
2194
2210
  */
2195
- Table.prototype._initDefaultRowMode = function() {
2196
- const vRowMode = this.getRowMode();
2211
+ function initDefaultRowMode(oTable) {
2212
+ const vRowMode = oTable.getRowMode();
2197
2213
  const sRowMode = TableUtils.isA(vRowMode, "sap.ui.table.rowmodes.RowMode") ? undefined : vRowMode || RowModeType.Fixed;
2198
2214
 
2199
2215
  // If row mode is an instance, a default is not needed.
2200
- if (sRowMode === undefined || this._oDefaultRowMode) {
2216
+ if (sRowMode === undefined || _private(oTable).oDefaultRowMode) {
2201
2217
  return;
2202
2218
  }
2203
2219
 
@@ -2205,47 +2221,52 @@ sap.ui.define([
2205
2221
  * @deprecated As of version 1.119
2206
2222
  */
2207
2223
  if (vRowMode === null) {
2208
- switch (this.getVisibleRowCountMode()) {
2224
+ switch (oTable.getVisibleRowCountMode()) {
2209
2225
  case RowModeType.Fixed:
2210
- this._oDefaultRowMode = new FixedRowMode(true);
2226
+ _private(oTable).oDefaultRowMode = new FixedRowMode(true);
2211
2227
  break;
2212
2228
  case RowModeType.Interactive:
2213
- this._oDefaultRowMode = new InteractiveRowMode(true);
2229
+ _private(oTable).oDefaultRowMode = new InteractiveRowMode(true);
2214
2230
  break;
2215
2231
  case RowModeType.Auto:
2216
- this._oDefaultRowMode = new AutoRowMode(true);
2232
+ _private(oTable).oDefaultRowMode = new AutoRowMode(true);
2217
2233
  break;
2218
2234
  default:
2219
2235
  throw new Error("Default row mode could not be created");
2220
2236
  }
2221
2237
 
2222
- this.addAggregation("_hiddenDependents", this._oDefaultRowMode);
2238
+ oTable.addAggregation("_hiddenDependents", _private(oTable).oDefaultRowMode);
2223
2239
  return;
2224
2240
  }
2225
2241
 
2226
2242
  switch (sRowMode) {
2227
2243
  case RowModeType.Fixed:
2228
- this._oDefaultRowMode = new FixedRowMode();
2244
+ _private(oTable).oDefaultRowMode = new FixedRowMode();
2229
2245
  break;
2230
2246
  case RowModeType.Interactive:
2231
- this._oDefaultRowMode = new InteractiveRowMode();
2247
+ _private(oTable).oDefaultRowMode = new InteractiveRowMode();
2232
2248
  break;
2233
2249
  case RowModeType.Auto:
2234
- this._oDefaultRowMode = new AutoRowMode();
2250
+ _private(oTable).oDefaultRowMode = new AutoRowMode();
2235
2251
  break;
2236
2252
  default:
2237
2253
  throw new Error("Default row mode could not be created");
2238
2254
  }
2239
2255
 
2240
- this.addAggregation("_hiddenDependents", this._oDefaultRowMode);
2241
- };
2256
+ oTable.addAggregation("_hiddenDependents", _private(oTable).oDefaultRowMode);
2257
+ }
2242
2258
 
2243
- Table.prototype._destroyDefaultRowMode = function() {
2244
- if (this._oDefaultRowMode) {
2245
- this._oDefaultRowMode.destroy();
2246
- delete this._oDefaultRowMode;
2259
+ /**
2260
+ * Destroys the default row mode instance.
2261
+ *
2262
+ * @param {sap.ui.table.Table} oTable The table whose default row mode instance to destroy.
2263
+ */
2264
+ function destroyDefaultRowMode(oTable) {
2265
+ if (_private(oTable).oDefaultRowMode) {
2266
+ _private(oTable).oDefaultRowMode.destroy();
2267
+ delete _private(oTable).oDefaultRowMode;
2247
2268
  }
2248
- };
2269
+ }
2249
2270
 
2250
2271
  /**
2251
2272
  * Gets the numbers of scrollable and fixed rows as they are currently computed by the row mode that is applied to the table.
@@ -2254,7 +2275,7 @@ sap.ui.define([
2254
2275
  * @private
2255
2276
  */
2256
2277
  Table.prototype._getRowCounts = function() {
2257
- var mRowCounts = this._getRowMode().getComputedRowCounts();
2278
+ var mRowCounts = getRowMode(this).getComputedRowCounts();
2258
2279
 
2259
2280
  // TODO: Enhance the RowMode interface and move these calculations to the row modes that support variable row heights.
2260
2281
  // TableUtils.isVariableRowHeightEnabled can't be used because it calls this method, which causes infinite recursion.
@@ -2269,6 +2290,15 @@ sap.ui.define([
2269
2290
  return mRowCounts;
2270
2291
  };
2271
2292
 
2293
+ /**
2294
+ * Returns whether showing the NoData element is disabled. It can, for example, be disabled with the <code>showNoData</code> property.
2295
+ *
2296
+ * @returns {boolean} Whether showing the NoData element is disabled.
2297
+ */
2298
+ Table.prototype._isNoDataDisabled = function() {
2299
+ return !this.getShowNoData() || (getRowMode(this)?.isNoDataDisabled() ?? false);
2300
+ };
2301
+
2272
2302
  Table.prototype.setVisibleRowCountMode = function(sVisibleRowCountMode) {
2273
2303
  if (this.getRowMode()) {
2274
2304
  Log.warning("If the \"rowMode\" aggregation is set, setting the \"visibleRowCountMode\" has no effect");
@@ -2280,8 +2310,8 @@ sap.ui.define([
2280
2310
  var sNewVisibleRowCountMode = this.getVisibleRowCountMode();
2281
2311
 
2282
2312
  if (sNewVisibleRowCountMode !== sOldVisibleRowCountMode) {
2283
- this._destroyDefaultRowMode();
2284
- this._initDefaultRowMode();
2313
+ destroyDefaultRowMode(this);
2314
+ initDefaultRowMode(this);
2285
2315
  }
2286
2316
 
2287
2317
  return this;
@@ -2382,7 +2412,7 @@ sap.ui.define([
2382
2412
  iThreshold = Math.max(iRequestLength - mRowCounts.fixedTop - mRowCounts.fixedBottom, iThreshold);
2383
2413
  }
2384
2414
 
2385
- iRequestLength = Math.max(iRequestLength, this._getRowMode().getMinRequestLength(), 0);
2415
+ iRequestLength = Math.max(iRequestLength, getRowMode(this).getMinRequestLength(), 0);
2386
2416
 
2387
2417
  if (!oBinding || iRequestLength === 0) {
2388
2418
  return [];
@@ -3091,7 +3121,7 @@ sap.ui.define([
3091
3121
  * Pushes the sorted column to array.
3092
3122
  *
3093
3123
  * @param {sap.ui.table.Column} oColumn Column to be sorted
3094
- * @param {boolean} bAdd Set to true to add the new sort criterion to the existing sort criteria
3124
+ * @param {boolean} [bAdd = false] Set to true to add the new sort criterion to the existing sort criteria
3095
3125
  * @private
3096
3126
  */
3097
3127
  Table.prototype.pushSortedColumn = function(oColumn, bAdd) {
@@ -3113,8 +3143,7 @@ sap.ui.define([
3113
3143
 
3114
3144
  /**
3115
3145
  * Gets the sorted columns in the order in which sorting was performed through the {@link sap.ui.table.Table#sort} method and menus.
3116
- * Does not reflect sorting at binding level or the columns sort visualization set with {@link sap.ui.table.Column#setSorted} and
3117
- * {@link sap.ui.table.Column#setSortOrder}.
3146
+ * Does not reflect sorting at binding level or the columns sort visualization set with {@link sap.ui.table.Column#setSortOrder}.
3118
3147
  *
3119
3148
  * @see sap.ui.table.Table#sort
3120
3149
  * @returns {sap.ui.table.Column[]} Array of sorted columns
@@ -3126,31 +3155,31 @@ sap.ui.define([
3126
3155
  };
3127
3156
 
3128
3157
  /**
3129
- * Sorts the given column ascending or descending.
3158
+ * Changes or removes sorting from the table.
3130
3159
  *
3131
- * @param {sap.ui.table.Column | undefined} oColumn Column to be sorted or undefined to clear sorting
3132
- * @param {sap.ui.table.SortOrder} oSortOrder Sort order of the column (if undefined the default will be ascending)
3133
- * @param {boolean} bAdd Set to true to add the new sort criterion to the existing sort criteria
3160
+ * @param {sap.ui.table.Column} [oColumn] Column to be sorted or undefined to clear sorting
3161
+ * @param {sap.ui.core.SortOrder} [sSortOrder = sap.ui.core.SortOrder.Ascending] Sort order of the column
3162
+ * @param {boolean} [bAdd = false]
3163
+ * Set to <code>true</code> to add the new sort criterion to the existing sort criteria, otherwise to replace it. If the sort order is
3164
+ * <code>sap.ui.core.SortOrder.None</code>, this parameter has no effect, and only the sort criterion for this column is removed from the
3165
+ * sort criteria.
3134
3166
  * @public
3135
3167
  */
3136
- Table.prototype.sort = function(oColumn, oSortOrder, bAdd) {
3168
+ Table.prototype.sort = function(oColumn, sSortOrder, bAdd) {
3137
3169
  if (!oColumn) {
3138
- // mimic the list binding sort API, if no column is provided, just restore the default sorting
3139
- // make sure to also update the sorted property to correctly indicate sorted columns
3140
- for (var i = 0; i < this._aSortedColumns.length; i++) {
3141
- this._aSortedColumns[i].setSorted(false);
3142
- }
3143
-
3144
- var oBinding = this.getBinding();
3145
- if (oBinding) {
3146
- oBinding.sort();
3147
- }
3148
-
3170
+ // Mimic the list binding sort API. If no column is provided, restore the default sorting.
3171
+ // Make sure to also update the "sortOrder" property to correctly indicate sorted columns.
3172
+ this._aSortedColumns.forEach((oColumn) => {
3173
+ /** @deprecated As of version 1.120 */
3174
+ oColumn.setSorted(false);
3175
+ oColumn.setSortOrder(SortOrder.None);
3176
+ });
3177
+ this.getBinding()?.sort();
3149
3178
  this._aSortedColumns = [];
3150
3179
  }
3151
3180
 
3152
3181
  if (this.getColumns().indexOf(oColumn) >= 0) {
3153
- oColumn._sort(oSortOrder === SortOrder.Descending, bAdd);
3182
+ oColumn._sort(sSortOrder ?? SortOrder.Ascending, bAdd);
3154
3183
  }
3155
3184
  };
3156
3185
 
@@ -3355,6 +3384,9 @@ sap.ui.define([
3355
3384
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3356
3385
  * @throws {Error} If a selection plugin is applied
3357
3386
  * @public
3387
+ *
3388
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3389
+ * it is recommended to use a selection plugin instead.
3358
3390
  */
3359
3391
  Table.prototype.setSelectedIndex = function(iIndex) {
3360
3392
  if (this._hasSelectionPlugin()) {
@@ -3371,6 +3403,9 @@ sap.ui.define([
3371
3403
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3372
3404
  * @throws {Error} If a selection plugin is applied
3373
3405
  * @public
3406
+ *
3407
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3408
+ * it is recommended to use a selection plugin instead.
3374
3409
  */
3375
3410
  Table.prototype.clearSelection = function() {
3376
3411
  if (this._hasSelectionPlugin()) {
@@ -3390,6 +3425,9 @@ sap.ui.define([
3390
3425
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3391
3426
  * @throws {Error} If a selection plugin is applied
3392
3427
  * @public
3428
+ *
3429
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3430
+ * it is recommended to use a selection plugin instead.
3393
3431
  */
3394
3432
  Table.prototype.selectAll = function() {
3395
3433
  if (this._hasSelectionPlugin()) {
@@ -3409,6 +3447,9 @@ sap.ui.define([
3409
3447
  * @returns {int[]} Selected indices
3410
3448
  * @throws {Error} If a selection plugin is applied
3411
3449
  * @public
3450
+ *
3451
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3452
+ * it is recommended to use a selection plugin instead.
3412
3453
  */
3413
3454
  Table.prototype.getSelectedIndices = function() {
3414
3455
  if (this._hasSelectionPlugin()) {
@@ -3426,6 +3467,9 @@ sap.ui.define([
3426
3467
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3427
3468
  * @throws {Error} If a selection plugin is applied
3428
3469
  * @public
3470
+ *
3471
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3472
+ * it is recommended to use a selection plugin instead.
3429
3473
  */
3430
3474
  Table.prototype.addSelectionInterval = function(iIndexFrom, iIndexTo) {
3431
3475
  if (this._hasSelectionPlugin()) {
@@ -3444,6 +3488,9 @@ sap.ui.define([
3444
3488
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3445
3489
  * @throws {Error} If a selection plugin is applied
3446
3490
  * @public
3491
+ *
3492
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3493
+ * it is recommended to use a selection plugin instead.
3447
3494
  */
3448
3495
  Table.prototype.setSelectionInterval = function(iIndexFrom, iIndexTo) {
3449
3496
  if (this._hasSelectionPlugin()) {
@@ -3462,6 +3509,9 @@ sap.ui.define([
3462
3509
  * @returns {this} Reference to <code>this</code> in order to allow method chaining
3463
3510
  * @throws {Error} If a selection plugin is applied
3464
3511
  * @public
3512
+ *
3513
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3514
+ * it is recommended to use a selection plugin instead.
3465
3515
  */
3466
3516
  Table.prototype.removeSelectionInterval = function(iIndexFrom, iIndexTo) {
3467
3517
  if (this._hasSelectionPlugin()) {
@@ -3479,6 +3529,9 @@ sap.ui.define([
3479
3529
  * @returns {boolean} Whether the index is selected
3480
3530
  * @throws {Error} If a selection plugin is applied
3481
3531
  * @public
3532
+ *
3533
+ * <b>Note:</b> The built-in selection API has limited functionality, especially when it is combined with paging (e.g. OData). Therefore,
3534
+ * it is recommended to use a selection plugin instead.
3482
3535
  */
3483
3536
  Table.prototype.isIndexSelected = function(iIndex) {
3484
3537
  if (this._hasSelectionPlugin()) {
@@ -3795,7 +3848,7 @@ sap.ui.define([
3795
3848
  * @private
3796
3849
  */
3797
3850
  Table.prototype._getBaseRowHeight = function() {
3798
- var iBaseRowContentHeight = this._getRowMode().getBaseRowContentHeight();
3851
+ var iBaseRowContentHeight = getRowMode(this).getBaseRowContentHeight();
3799
3852
 
3800
3853
  if (iBaseRowContentHeight > 0) {
3801
3854
  return iBaseRowContentHeight + TableUtils.RowHorizontalFrameSize;
@@ -3947,7 +4000,7 @@ sap.ui.define([
3947
4000
  };
3948
4001
 
3949
4002
  /**
3950
- *
4003
+ * @deprecated As of version 1.115
3951
4004
  * @private
3952
4005
  */
3953
4006
  Table.prototype._onPersoApplied = function() {
@@ -3957,7 +4010,7 @@ sap.ui.define([
3957
4010
  var aSorters = [];//, aFilters = [];
3958
4011
  for (var i = 0, l = aColumns.length; i < l; i++) {
3959
4012
  var oColumn = aColumns[i];
3960
- if (oColumn.getSorted()) {
4013
+ if (oColumn.getSorted() && oColumn.getSortOrder() !== SortOrder.None) {
3961
4014
  aSorters.push(new Sorter(oColumn.getSortProperty(), oColumn.getSortOrder() === SortOrder.Descending));
3962
4015
  }
3963
4016
  }
@@ -4086,86 +4139,6 @@ sap.ui.define([
4086
4139
  return this;
4087
4140
  };
4088
4141
 
4089
- /*
4090
- * @see JSDoc generated by SAPUI5 control API generator
4091
- */
4092
- Table.prototype.addPlugin = function(oPlugin) {
4093
- this.addAggregation("plugins", oPlugin);
4094
-
4095
- if (TableUtils.isA(oPlugin, "sap.ui.table.plugins.SelectionPlugin")) {
4096
- this._initSelectionPlugin();
4097
- }
4098
-
4099
- return this;
4100
- };
4101
-
4102
- /*
4103
- * @see JSDoc generated by SAPUI5 control API generator
4104
- */
4105
- Table.prototype.insertPlugin = function(oPlugin, iIndex) {
4106
- this.insertAggregation("plugins", oPlugin, iIndex);
4107
-
4108
- if (TableUtils.isA(oPlugin, "sap.ui.table.plugins.SelectionPlugin")) {
4109
- this._initSelectionPlugin();
4110
- }
4111
-
4112
- return this;
4113
- };
4114
-
4115
- /*
4116
- * @see JSDoc generated by SAPUI5 control API generator
4117
- */
4118
- Table.prototype.removePlugin = function(oPlugin) {
4119
- var oRemovedPlugin = this.removeAggregation("plugins", oPlugin);
4120
-
4121
- if (TableUtils.isA(oRemovedPlugin, "sap.ui.table.plugins.SelectionPlugin")) {
4122
- this._initSelectionPlugin();
4123
- }
4124
-
4125
- return oRemovedPlugin;
4126
- };
4127
-
4128
- /*
4129
- * @see JSDoc generated by SAPUI5 control API generator
4130
- */
4131
- Table.prototype.removeAllPlugins = function() {
4132
- var aPlugins = this.removeAllAggregation("plugins");
4133
- this._initSelectionPlugin();
4134
- return aPlugins;
4135
- };
4136
-
4137
- /*
4138
- * @see JSDoc generated by SAPUI5 control API generator
4139
- */
4140
- Table.prototype.destroyPlugins = function() {
4141
- this.destroyAggregation('plugins');
4142
- this._initSelectionPlugin();
4143
- return this;
4144
- };
4145
-
4146
- /**
4147
- * Gets the first plugin of a certain type.
4148
- *
4149
- * @param {string} sType The type of the plugin.
4150
- * @returns {sap.ui.table.plugins.SelectionPlugin|null} The first plugin of a certain type, or <code>null</code> if no plugin of this type exists.
4151
- * @private
4152
- */
4153
- Table.prototype.getPlugin = function(sType) {
4154
- if (typeof sType !== "string") {
4155
- return null;
4156
- }
4157
-
4158
- var aPlugins = this.getPlugins();
4159
-
4160
- for (var i = 0; i < aPlugins.length; i++) {
4161
- if (aPlugins[i].isA(sType)) {
4162
- return aPlugins[i];
4163
- }
4164
- }
4165
-
4166
- return null;
4167
- };
4168
-
4169
4142
  /**
4170
4143
  * Gets the selection plugin. If no selection plugin is applied to the table, a legacy selection plugin is returned.
4171
4144
  *
@@ -4175,12 +4148,6 @@ sap.ui.define([
4175
4148
  Table.prototype._getSelectionPlugin = function() {
4176
4149
  var oSelectionPlugin = this._oSelectionPlugin || this._oLegacySelectionPlugin;
4177
4150
 
4178
- if (!oSelectionPlugin) {
4179
- // To avoid null checks everywhere if the selection plugin is accessed after destroying the table.
4180
- this._initLegacySelectionPlugin();
4181
- oSelectionPlugin = this._oLegacySelectionPlugin;
4182
- }
4183
-
4184
4151
  // Temporary fix for the Support Assistant hacks. Support Assistant should implement a selection plugin.
4185
4152
  // TODO: Before we recommend to implement a selection plugin -> Complete BLI CPOUIFTEAMB-1464
4186
4153
  if (typeof this._getSelectedIndicesCount === "function" && oSelectionPlugin.getSelectedCount !== this._getSelectedIndicesCount) {
@@ -4205,15 +4172,26 @@ sap.ui.define([
4205
4172
  return this._oSelectionPlugin != null;
4206
4173
  };
4207
4174
 
4175
+ function getMainSelectionPlugin(oTable) {
4176
+ var aSelectionPlugins = oTable.getDependents().filter((oPlugin) => oPlugin.isA("sap.ui.table.plugins.SelectionPlugin"));
4177
+
4178
+ /**
4179
+ * @deprecated As of version 1.120
4180
+ */
4181
+ aSelectionPlugins.unshift(...oTable.getPlugins());
4182
+
4183
+ return aSelectionPlugins[0];
4184
+ }
4185
+
4208
4186
  /**
4209
- * Initializes the selection plugin used by the table. Attaches event listeners and forwards binding information to the plugin.
4187
+ * Initializes the selection plugin used by the table. Attaches event listeners.
4210
4188
  * The first plugin of type <code>sap.ui.table.plugins.SelectionPlugin</code> in the <code>plugins</code> aggregation is used by the table. If no
4211
4189
  * selection plugin is applied, a legacy selection plugin is created.
4212
4190
  *
4213
4191
  * @private
4214
4192
  */
4215
4193
  Table.prototype._initSelectionPlugin = function() {
4216
- var oSelectionPlugin = this.getPlugin("sap.ui.table.plugins.SelectionPlugin");
4194
+ var oSelectionPlugin = getMainSelectionPlugin(this);
4217
4195
 
4218
4196
  if (this.isDestroyed() || this.isDestroyStarted()) {
4219
4197
  return;
@@ -4221,12 +4199,9 @@ sap.ui.define([
4221
4199
 
4222
4200
  if (oSelectionPlugin) {
4223
4201
  this._destroyLegacySelectionPlugin();
4224
-
4225
- if (oSelectionPlugin !== this._oSelectionPlugin) {
4226
- detachSelectionPlugin(this, this._oSelectionPlugin);
4227
- attachSelectionPlugin(this, oSelectionPlugin);
4228
- this._oSelectionPlugin = oSelectionPlugin;
4229
- }
4202
+ detachSelectionPlugin(this, this._oSelectionPlugin);
4203
+ attachSelectionPlugin(this, oSelectionPlugin);
4204
+ this._oSelectionPlugin = oSelectionPlugin;
4230
4205
  } else {
4231
4206
  this._initLegacySelectionPlugin();
4232
4207
  detachSelectionPlugin(this, this._oSelectionPlugin);
@@ -4235,12 +4210,12 @@ sap.ui.define([
4235
4210
  };
4236
4211
 
4237
4212
  /**
4238
- * Initializes a legacy selection plugin, if no selection plugin is set in the <code>plugins</code> aggregation.
4213
+ * Initializes a legacy selection plugin, if no selection plugin is set.
4239
4214
  *
4240
4215
  * @private
4241
4216
  */
4242
4217
  Table.prototype._initLegacySelectionPlugin = function() {
4243
- if (this._oLegacySelectionPlugin || this.getPlugin("sap.ui.table.plugins.SelectionPlugin")) {
4218
+ if (this._oLegacySelectionPlugin || getMainSelectionPlugin(this)) {
4244
4219
  // No legacy selection plugin needs to be created if it already exists, or if a selection plugin is set.
4245
4220
  return;
4246
4221
  }
@@ -4251,7 +4226,7 @@ sap.ui.define([
4251
4226
  };
4252
4227
 
4253
4228
  Table.prototype._destroyLegacySelectionPlugin = function() {
4254
- if (this._oLegacySelectionPlugin) {
4229
+ if (this._oLegacySelectionPlugin && !this._oLegacySelectionPlugin.isDestroyStarted()) {
4255
4230
  this._oLegacySelectionPlugin.destroy();
4256
4231
  delete this._oLegacySelectionPlugin;
4257
4232
  }
@@ -4505,6 +4480,51 @@ sap.ui.define([
4505
4480
  this.setProperty("rowCountConstraints", mConstraints);
4506
4481
  };
4507
4482
 
4508
- return Table;
4483
+ function excludeHiddenDepdendents(oTable, aAggregatedObjects) {
4484
+ const aHiddenDependents = oTable.getAggregation("_hiddenDependents") || [];
4485
+ return aAggregatedObjects.filter((oObject) => !aHiddenDependents.includes(oObject));
4486
+ }
4509
4487
 
4488
+ /**
4489
+ * @inheritDoc
4490
+ */
4491
+ Table.prototype.findAggregatedObjects = function() {
4492
+ return excludeHiddenDepdendents(this, Control.prototype.findAggregatedObjects.apply(this, arguments));
4493
+ };
4494
+
4495
+ /**
4496
+ * @inheritDoc
4497
+ */
4498
+ Table.prototype.findElements = function() {
4499
+ return excludeHiddenDepdendents(this, Control.prototype.findElements.apply(this, arguments));
4500
+ };
4501
+
4502
+ /**
4503
+ * Returns the first applied plugin for the given plugin type.
4504
+ *
4505
+ * @param {string} sType The full class name of the plugin
4506
+ * @returns {sap.ui.table.plugins.SelectionPlugin|undefined} The found plugin instance, or <code>undefined</code> if not found
4507
+ * @throws {Error} If the type to search for is not in <code>sap.ui.table.plugins</code>
4508
+ * @private
4509
+ * @deprecated As of version 1.120
4510
+ */
4511
+ Table.prototype.getPlugin = function(sType) {
4512
+ if (!sType || !sType.startsWith("sap.ui.table.plugins.")) {
4513
+ throw new Error("This method can only be used to get plugins of the sap.ui.table library");
4514
+ }
4515
+
4516
+ var oFoundPlugin = this.getDependents().find((oDependent) => {
4517
+ return oDependent.isA(sType);
4518
+ });
4519
+
4520
+ if (!oFoundPlugin) {
4521
+ oFoundPlugin = this.getPlugins().find((oPlugin) => {
4522
+ return oPlugin.isA(sType);
4523
+ });
4524
+ }
4525
+
4526
+ return oFoundPlugin;
4527
+ };
4528
+
4529
+ return Table;
4510
4530
  });