@openui5/sap.ui.table 1.120.0 → 1.120.2

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 (47) hide show
  1. package/.reuse/dep5 +1 -1
  2. package/THIRDPARTY.txt +1 -1
  3. package/package.json +3 -3
  4. package/src/sap/ui/table/.library +1 -1
  5. package/src/sap/ui/table/AnalyticalColumn.js +1 -2
  6. package/src/sap/ui/table/AnalyticalColumnMenu.js +1 -1
  7. package/src/sap/ui/table/AnalyticalTable.js +1 -1
  8. package/src/sap/ui/table/Column.js +10 -9
  9. package/src/sap/ui/table/ColumnMenu.js +1 -1
  10. package/src/sap/ui/table/CreationRow.js +1 -1
  11. package/src/sap/ui/table/Row.js +1 -1
  12. package/src/sap/ui/table/RowAction.js +1 -1
  13. package/src/sap/ui/table/RowActionItem.js +1 -1
  14. package/src/sap/ui/table/RowSettings.js +1 -1
  15. package/src/sap/ui/table/Table.js +8 -7
  16. package/src/sap/ui/table/TablePersoController.js +1 -1
  17. package/src/sap/ui/table/TreeTable.js +1 -1
  18. package/src/sap/ui/table/extensions/Accessibility.js +1 -1
  19. package/src/sap/ui/table/extensions/AccessibilityRender.js +3 -1
  20. package/src/sap/ui/table/extensions/DragAndDrop.js +1 -1
  21. package/src/sap/ui/table/extensions/ExtensionBase.js +1 -1
  22. package/src/sap/ui/table/extensions/Keyboard.js +1 -1
  23. package/src/sap/ui/table/extensions/KeyboardDelegate.js +1 -1
  24. package/src/sap/ui/table/extensions/Pointer.js +1 -1
  25. package/src/sap/ui/table/extensions/Scrolling.js +1 -1
  26. package/src/sap/ui/table/extensions/ScrollingIOS.js +1 -1
  27. package/src/sap/ui/table/extensions/Synchronization.js +1 -1
  28. package/src/sap/ui/table/library.js +11 -11
  29. package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +1 -1
  30. package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +16 -13
  31. package/src/sap/ui/table/plugins/BindingSelection.js +1 -1
  32. package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +5 -0
  33. package/src/sap/ui/table/plugins/PluginBase.js +45 -1
  34. package/src/sap/ui/table/plugins/SelectionModelSelection.js +1 -1
  35. package/src/sap/ui/table/plugins/SelectionPlugin.js +4 -8
  36. package/src/sap/ui/table/plugins/V4Aggregation.js +1 -1
  37. package/src/sap/ui/table/rowmodes/Auto.js +1 -1
  38. package/src/sap/ui/table/rowmodes/Fixed.js +1 -1
  39. package/src/sap/ui/table/rowmodes/Interactive.js +1 -1
  40. package/src/sap/ui/table/rowmodes/RowMode.js +1 -1
  41. package/src/sap/ui/table/rowmodes/Variable.js +1 -1
  42. package/src/sap/ui/table/utils/TableUtils.js +1 -1
  43. package/src/sap/ui/table/utils/_BindingUtils.js +1 -1
  44. package/src/sap/ui/table/utils/_ColumnUtils.js +1 -1
  45. package/src/sap/ui/table/utils/_GroupingUtils.js +1 -1
  46. package/src/sap/ui/table/utils/_HookUtils.js +1 -1
  47. package/src/sap/ui/table/utils/_MenuUtils.js +1 -1
package/.reuse/dep5 CHANGED
@@ -223,7 +223,7 @@ License: Apache-2.0
223
223
  Comment: these files belong to: Google-Caja JS HTML Sanitizer
224
224
 
225
225
  Files: src/sap.ui.core/src/sap/ui/core/cldr/*
226
- Copyright: 1991-2014 Unicode, Inc.
226
+ Copyright: 1991-2023 Unicode, Inc.
227
227
  License: Unicode-DFS-2015
228
228
  Comment: these files belong to: Unicode Common Locale Data Repository
229
229
 
package/THIRDPARTY.txt CHANGED
@@ -180,7 +180,7 @@ License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Apache-2.0.txt
180
180
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/caja-html-sanitizer.js
181
181
 
182
182
  Component: Unicode Common Locale Data Repository, version: 43
183
- Copyright: 1991-2014 Unicode, Inc.
183
+ Copyright: 1991-2023 Unicode, Inc.
184
184
  License: Unicode-DFS-2015
185
185
  License Text: https://github.com/SAP/openui5/blob/master/LICENSES/Unicode-DFS-2015.txt
186
186
  Contained in: src/sap.ui.core/src/sap/ui/core/cldr/*
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.table",
3
- "version": "1.120.0",
3
+ "version": "1.120.2",
4
4
  "description": "OpenUI5 UI Library sap.ui.table",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -14,7 +14,7 @@
14
14
  "url": "https://github.com/SAP/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.ui.core": "1.120.0",
18
- "@openui5/sap.ui.unified": "1.120.0"
17
+ "@openui5/sap.ui.core": "1.120.2",
18
+ "@openui5/sap.ui.unified": "1.120.2"
19
19
  }
20
20
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.120.0</version>
9
+ <version>1.120.2</version>
10
10
 
11
11
  <documentation>Table-like controls, mainly for desktop scenarios.</documentation>
12
12
 
@@ -47,7 +47,7 @@ sap.ui.define([
47
47
  * @extends sap.ui.table.Column
48
48
  *
49
49
  * @author SAP SE
50
- * @version 1.120.0
50
+ * @version 1.120.2
51
51
  *
52
52
  * @constructor
53
53
  * @public
@@ -124,7 +124,6 @@ sap.ui.define([
124
124
  var oParent = this.getParent();
125
125
 
126
126
  if (isInstanceOfAnalyticalTable(oParent)) {
127
- oParent._bContextsAvailable = false;
128
127
  if (bGrouped) {
129
128
  oParent._addGroupedColumn(this.getId());
130
129
  } else {
@@ -20,7 +20,7 @@ sap.ui.define(['./ColumnMenu', "sap/ui/unified/MenuRenderer", './utils/TableUtil
20
20
  * @extends sap.ui.table.ColumnMenu
21
21
  *
22
22
  * @author SAP SE
23
- * @version 1.120.0
23
+ * @version 1.120.2
24
24
  *
25
25
  * @constructor
26
26
  * @public
@@ -54,7 +54,7 @@ sap.ui.define([
54
54
  * @see https://github.com/SAP/odata-vocabularies/blob/main/docs/v2-annotations.md
55
55
  *
56
56
  * @extends sap.ui.table.Table
57
- * @version 1.120.0
57
+ * @version 1.120.2
58
58
  *
59
59
  * @constructor
60
60
  * @public
@@ -63,7 +63,7 @@ sap.ui.define([
63
63
  * @class
64
64
  * The column allows you to define column specific properties that will be applied when rendering the table.
65
65
  * @extends sap.ui.core.Element
66
- * @version 1.120.0
66
+ * @version 1.120.2
67
67
  *
68
68
  * @constructor
69
69
  * @public
@@ -664,8 +664,9 @@ sap.ui.define([
664
664
  Column.prototype.setSorted = function(bSorted) {
665
665
  this.setProperty("sorted", bSorted, true);
666
666
 
667
- if (bSorted && this.getSortOrder() === SortOrder.None) {
667
+ if (bSorted && this.getSortOrder() === SortOrder.None && !this.isBound("sortOrder")) {
668
668
  this.setSortOrder(SortOrder.Ascending); // "Ascending" was the default value of "sortOrder" before "sorted" was deprecated.
669
+ return this;
669
670
  }
670
671
 
671
672
  this._updateIcons();
@@ -763,16 +764,10 @@ sap.ui.define([
763
764
  Column.prototype._sort = function(sSortOrder, bAdd) {
764
765
  var oTable = this._getTable();
765
766
 
766
- if (!oTable) {
767
+ if (!oTable || this.getSortProperty() === "") {
767
768
  return;
768
769
  }
769
770
 
770
- if (sSortOrder === SortOrder.None) {
771
- oTable._removeSortedColumn(this);
772
- } else {
773
- oTable.pushSortedColumn(this, bAdd);
774
- }
775
-
776
771
  var bExecuteDefault = oTable.fireSort({
777
772
  column: this,
778
773
  sortOrder: sSortOrder,
@@ -783,6 +778,12 @@ sap.ui.define([
783
778
  return;
784
779
  }
785
780
 
781
+ if (sSortOrder === SortOrder.None) {
782
+ oTable._removeSortedColumn(this);
783
+ } else {
784
+ oTable.pushSortedColumn(this, bAdd);
785
+ }
786
+
786
787
  /** @deprecated As of version 1.120 */
787
788
  this.setProperty("sorted", sSortOrder !== SortOrder.None, true);
788
789
  this.setProperty("sortOrder", sSortOrder, true);
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * @class
40
40
  * The column menu provides all common actions that can be performed on a column.
41
41
  * @extends sap.ui.unified.Menu
42
- * @version 1.120.0
42
+ * @version 1.120.2
43
43
  *
44
44
  * @constructor
45
45
  * @public
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * <code>sap.ui.commons</code> library.
33
33
  * @extends sap.ui.core.Control
34
34
  * @author SAP SE
35
- * @version 1.120.0
35
+ * @version 1.120.2
36
36
  *
37
37
  * @constructor
38
38
  * @private
@@ -135,7 +135,7 @@ sap.ui.define([
135
135
  * @class
136
136
  * The row.
137
137
  * @extends sap.ui.core.Element
138
- * @version 1.120.0
138
+ * @version 1.120.2
139
139
  *
140
140
  * @constructor
141
141
  * @public
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  * If more action items are available as the available space allows to display an overflow mechanism is provided.
36
36
  * This control must only be used in the context of the <code>sap.ui.table.Table</code> control to define row actions.
37
37
  * @extends sap.ui.core.Control
38
- * @version 1.120.0
38
+ * @version 1.120.2
39
39
  *
40
40
  * @constructor
41
41
  * @public
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * @extends sap.ui.core.Element
25
25
  *
26
26
  * @author SAP SE
27
- * @version 1.120.0
27
+ * @version 1.120.2
28
28
  * @since 1.45
29
29
  *
30
30
  * @constructor
@@ -24,7 +24,7 @@ sap.ui.define([
24
24
  * The <code>RowSettings</code> control allows you to configure a row.
25
25
  * You can only use this control in the context of the <code>sap.ui.table.Table</code> control to define row settings.
26
26
  * @extends sap.ui.core.Element
27
- * @version 1.120.0
27
+ * @version 1.120.2
28
28
  *
29
29
  * @constructor
30
30
  * @public
@@ -96,7 +96,7 @@ sap.ui.define([
96
96
  * the data model and binding being used.
97
97
  * </p>
98
98
  * @extends sap.ui.core.Control
99
- * @version 1.120.0
99
+ * @version 1.120.2
100
100
  *
101
101
  * @constructor
102
102
  * @public
@@ -1164,7 +1164,7 @@ sap.ui.define([
1164
1164
  * Localization changed
1165
1165
  * @private
1166
1166
  */
1167
- Table.prototype.onlocalizationChanged = function(oEvent) {
1167
+ Table.prototype.onLocalizationChanged = function(oEvent) {
1168
1168
  var oChanges = oEvent.changes || {};
1169
1169
  var bRtlChanged = oChanges.hasOwnProperty("rtl");
1170
1170
  var bLangChanged = oChanges.hasOwnProperty("language");
@@ -1173,6 +1173,11 @@ sap.ui.define([
1173
1173
  }.bind(this)).catch(function() {});
1174
1174
  };
1175
1175
 
1176
+ /**
1177
+ * @deprecated As of version 1.120
1178
+ */
1179
+ Table.prototype.onlocalizationChanged = Table.prototype.onLocalizationChanged;
1180
+
1176
1181
  /**
1177
1182
  * Adapts the table to localization changes. Re-rendering or invalidation of the table needs to be taken care of by the caller.
1178
1183
  *
@@ -2766,11 +2771,7 @@ sap.ui.define([
2766
2771
  }
2767
2772
 
2768
2773
  if (!this._bReorderInProcess) {
2769
- var iIndexInSortedColumns = this._aSortedColumns.indexOf(oColumn);
2770
-
2771
- if (iIndexInSortedColumns >= 0) {
2772
- this._aSortedColumns.splice(iIndexInSortedColumns, 1);
2773
- }
2774
+ this._removeSortedColumn(oColumn);
2774
2775
  }
2775
2776
 
2776
2777
  onColumnsAggregationChange(this);
@@ -33,7 +33,7 @@ sap.ui.define([
33
33
  * @extends sap.ui.base.ManagedObject
34
34
  *
35
35
  * @author SAP SE
36
- * @version 1.120.0
36
+ * @version 1.120.2
37
37
  * @since 1.21.1
38
38
  *
39
39
  * @constructor
@@ -42,7 +42,7 @@ sap.ui.define([
42
42
  * @class
43
43
  * The TreeTable control provides a comprehensive set of features to display hierarchical data.
44
44
  * @extends sap.ui.table.Table
45
- * @version 1.120.0
45
+ * @version 1.120.2
46
46
  *
47
47
  * @constructor
48
48
  * @public
@@ -964,7 +964,7 @@ sap.ui.define([
964
964
  * @class Extension for sap.ui.table.Table which handles ACC related things.
965
965
  * @extends sap.ui.table.extensions.ExtensionBase
966
966
  * @author SAP SE
967
- * @version 1.120.0
967
+ * @version 1.120.2
968
968
  * @constructor
969
969
  * @private
970
970
  * @alias sap.ui.table.extensions.Accessibility
@@ -28,6 +28,8 @@ sap.ui.define([
28
28
  oRm.openEnd();
29
29
  if (sText) {
30
30
  oRm.text(sText);
31
+ } else {
32
+ oRm.text("-");
31
33
  }
32
34
  oRm.close("span");
33
35
  };
@@ -42,7 +44,7 @@ sap.ui.define([
42
44
  * @class Extension for sap.ui.table.TableRenderer which handles ACC related things.
43
45
  * @extends sap.ui.table.extensions.ExtensionBase
44
46
  * @author SAP SE
45
- * @version 1.120.0
47
+ * @version 1.120.2
46
48
  * @constructor
47
49
  * @private
48
50
  * @alias sap.ui.table.extensions.AccessibilityRender
@@ -274,7 +274,7 @@ sap.ui.define([
274
274
  *
275
275
  * @extends sap.ui.table.extensions.ExtensionBase
276
276
  * @author SAP SE
277
- * @version 1.120.0
277
+ * @version 1.120.2
278
278
  * @constructor
279
279
  * @private
280
280
  * @alias sap.ui.table.extensions.DragAndDrop
@@ -19,7 +19,7 @@ sap.ui.define([
19
19
  * @abstract
20
20
  * @extends sap.ui.base.Object
21
21
  * @author SAP SE
22
- * @version 1.120.0
22
+ * @version 1.120.2
23
23
  * @constructor
24
24
  * @private
25
25
  * @alias sap.ui.table.extensions.ExtensionBase
@@ -267,7 +267,7 @@ sap.ui.define([
267
267
  * @class Extension for sap.ui.table.Table which handles keyboard related things.
268
268
  * @extends sap.ui.table.extensions.ExtensionBase
269
269
  * @author SAP SE
270
- * @version 1.120.0
270
+ * @version 1.120.2
271
271
  * @constructor
272
272
  * @private
273
273
  * @alias sap.ui.table.extensions.Keyboard
@@ -65,7 +65,7 @@ sap.ui.define([
65
65
  *
66
66
  * @extends sap.ui.base.Object
67
67
  * @author SAP SE
68
- * @version 1.120.0
68
+ * @version 1.120.2
69
69
  * @constructor
70
70
  * @private
71
71
  * @alias sap.ui.table.extensions.KeyboardDelegate
@@ -770,7 +770,7 @@ sap.ui.define([
770
770
  * @class Extension for sap.ui.table.Table which handles mouse and touch related things.
771
771
  * @extends sap.ui.table.extensions.ExtensionBase
772
772
  * @author SAP SE
773
- * @version 1.120.0
773
+ * @version 1.120.2
774
774
  * @constructor
775
775
  * @private
776
776
  * @alias sap.ui.table.extensions.Pointer
@@ -2256,7 +2256,7 @@ sap.ui.define([
2256
2256
  * @class Extension for sap.ui.table.Table which handles scrolling.
2257
2257
  * @extends sap.ui.table.extensions.ExtensionBase
2258
2258
  * @author SAP SE
2259
- * @version 1.120.0
2259
+ * @version 1.120.2
2260
2260
  * @constructor
2261
2261
  * @private
2262
2262
  * @alias sap.ui.table.extensions.Scrolling
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @class Extension for sap.ui.table.Table which handles the scrollbar on iOS.
28
28
  * @extends sap.ui.table.extensions.ExtensionBase
29
29
  * @author SAP SE
30
- * @version 1.120.0
30
+ * @version 1.120.2
31
31
  * @constructor
32
32
  * @private
33
33
  * @alias sap.ui.table.extensions.ScrollingIOS
@@ -181,7 +181,7 @@ sap.ui.define([
181
181
  * @class Extension for sap.ui.table.Table that allows synchronization with a table.
182
182
  * @extends sap.ui.table.extensions.ExtensionBase
183
183
  * @author SAP SE
184
- * @version 1.120.0
184
+ * @version 1.120.2
185
185
  * @constructor
186
186
  * @private
187
187
  * @alias sap.ui.table.extensions.Synchronization
@@ -26,13 +26,13 @@ sap.ui.define([
26
26
  * @namespace
27
27
  * @alias sap.ui.table
28
28
  * @author SAP SE
29
- * @version 1.120.0
29
+ * @version 1.120.2
30
30
  * @since 0.8
31
31
  * @public
32
32
  */
33
33
  var thisLib = sap.ui.getCore().initLibrary({
34
34
  name: "sap.ui.table",
35
- version: "1.120.0",
35
+ version: "1.120.2",
36
36
  dependencies: ["sap.ui.core", "sap.ui.unified"],
37
37
  designtime: "sap/ui/table/designtime/library.designtime",
38
38
  types: [
@@ -92,7 +92,7 @@ sap.ui.define([
92
92
  /**
93
93
  * Navigation mode of the table
94
94
  *
95
- * @version 1.120.0
95
+ * @version 1.120.2
96
96
  * @enum {string}
97
97
  * @public
98
98
  */
@@ -119,7 +119,7 @@ sap.ui.define([
119
119
  /**
120
120
  * Row Action types.
121
121
  *
122
- * @version 1.120.0
122
+ * @version 1.120.2
123
123
  * @enum {string}
124
124
  * @public
125
125
  */
@@ -148,7 +148,7 @@ sap.ui.define([
148
148
  /**
149
149
  * Selection behavior of the table
150
150
  *
151
- * @version 1.120.0
151
+ * @version 1.120.2
152
152
  * @enum {string}
153
153
  * @public
154
154
  */
@@ -177,7 +177,7 @@ sap.ui.define([
177
177
  /**
178
178
  * Selection mode of the table
179
179
  *
180
- * @version 1.120.0
180
+ * @version 1.120.2
181
181
  * @enum {string}
182
182
  * @public
183
183
  */
@@ -213,7 +213,7 @@ sap.ui.define([
213
213
  /**
214
214
  * Sort order of a column
215
215
  *
216
- * @version 1.120.0
216
+ * @version 1.120.2
217
217
  * @enum {string}
218
218
  * @public
219
219
  * @deprecated As of version 1.120, replaced with <code>sap.ui.core.SortOrder</code>
@@ -237,7 +237,7 @@ sap.ui.define([
237
237
  /**
238
238
  * VisibleRowCountMode of the table
239
239
  *
240
- * @version 1.120.0
240
+ * @version 1.120.2
241
241
  * @enum {string}
242
242
  * @public
243
243
  */
@@ -268,7 +268,7 @@ sap.ui.define([
268
268
  *
269
269
  * Contains IDs of shared DOM references, which should be accessible to inheriting controls via getDomRef() function.
270
270
  *
271
- * @version 1.120.0
271
+ * @version 1.120.2
272
272
  * @enum {string}
273
273
  * @public
274
274
  */
@@ -366,7 +366,7 @@ sap.ui.define([
366
366
  *
367
367
  * This is an alias for {@link sap.ui.model.TreeAutoExpandMode} and kept for compatibility reasons.
368
368
  *
369
- * @version 1.120.0
369
+ * @version 1.120.2
370
370
  * @typedef {sap.ui.model.TreeAutoExpandMode}
371
371
  * @public
372
372
  * @deprecated As of version 1.120
@@ -380,7 +380,7 @@ sap.ui.define([
380
380
  /**
381
381
  * Mode of a selection plugin
382
382
  *
383
- * @version 1.120.0
383
+ * @version 1.120.2
384
384
  * @enum {string}
385
385
  * @private
386
386
  */
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  *
36
36
  * @extends sap.ui.base.Object
37
37
  * @author SAP SE
38
- * @version 1.120.0
38
+ * @version 1.120.2
39
39
  * @private
40
40
  * @alias sap.ui.table.menus.ColumnHeaderMenuAdapter
41
41
  */
@@ -59,7 +59,7 @@ sap.ui.define([
59
59
  *
60
60
  * @extends sap.ui.table.menus.ColumnHeaderMenuAdapter
61
61
  * @author SAP SE
62
- * @version 1.120.0
62
+ * @version 1.120.2
63
63
  * @private
64
64
  * @alias sap.ui.table.menus.MobileColumnHeaderMenuAdapter
65
65
  */
@@ -276,23 +276,26 @@ sap.ui.define([
276
276
  items: new QuickGroupItem(),
277
277
  change: [function(oEvent) {
278
278
  var bGrouped = oEvent.getParameter("item").getGrouped();
279
+ var oColumn = this._oColumn;
280
+ var oTable = oColumn._getTable();
279
281
 
280
- if (bGrouped && (!this._oColumn.getShowIfGrouped || !this._oColumn.getShowIfGrouped())) {
281
- var oTable = this._oColumn._getTable();
282
- var oDomRef;
282
+ this._oMenu.attachEventOnce("afterClose", function() {
283
+ if (bGrouped && (!oColumn.getShowIfGrouped || !oColumn.getShowIfGrouped())) {
284
+ var oDomRef;
283
285
 
284
- if (TableUtils.isNoDataVisible(oTable)) {
285
- oDomRef = oTable.getDomRef("noDataCnt");
286
- } else {
287
- oDomRef = oTable.getDomRef("rowsel0");
288
- }
286
+ if (TableUtils.isNoDataVisible(oTable)) {
287
+ oDomRef = oTable.getDomRef("noDataCnt");
288
+ } else {
289
+ oDomRef = oTable.getDomRef("rowsel0");
290
+ }
289
291
 
290
- if (oDomRef) {
291
- oDomRef.focus();
292
+ if (oDomRef) {
293
+ oDomRef.focus();
294
+ }
292
295
  }
293
- }
294
296
 
295
- this._oColumn._setGrouped(bGrouped);
297
+ oColumn._setGrouped(bGrouped);
298
+ });
296
299
  }, this]
297
300
  });
298
301
  };
@@ -21,7 +21,7 @@ sap.ui.define([
21
21
  *
22
22
  * @class Implements the selection methods for TreeTable and AnalyticalTable
23
23
  * @extends sap.ui.table.plugins.SelectionPlugin
24
- * @version 1.120.0
24
+ * @version 1.120.2
25
25
  * @constructor
26
26
  * @private
27
27
  * @alias sap.ui.table.plugins.BindingSelection
@@ -5,6 +5,7 @@
5
5
  */
6
6
  sap.ui.define([
7
7
  "./SelectionPlugin",
8
+ "./PluginBase",
8
9
  "../library",
9
10
  "../utils/TableUtils",
10
11
  "sap/ui/core/Icon",
@@ -12,6 +13,7 @@ sap.ui.define([
12
13
  "sap/base/Log"
13
14
  ], function(
14
15
  SelectionPlugin,
16
+ PluginBase,
15
17
  library,
16
18
  TableUtils,
17
19
  Icon,
@@ -47,6 +49,7 @@ sap.ui.define([
47
49
  * @since 1.64
48
50
  * @author SAP SE
49
51
  * @alias sap.ui.table.plugins.MultiSelectionPlugin
52
+ * @borrows module:sap/ui/table/plugins/PluginBase.findOn as findOn
50
53
  */
51
54
  var MultiSelectionPlugin = SelectionPlugin.extend("sap.ui.table.plugins.MultiSelectionPlugin", {metadata: {
52
55
  library: "sap.ui.table",
@@ -109,6 +112,8 @@ sap.ui.define([
109
112
  }
110
113
  }});
111
114
 
115
+ MultiSelectionPlugin.findOn = PluginBase.findOn;
116
+
112
117
  MultiSelectionPlugin.prototype.init = function() {
113
118
  SelectionPlugin.prototype.init.apply(this, arguments);
114
119
 
@@ -28,7 +28,7 @@ sap.ui.define([
28
28
  * @extends sap.ui.core.Element
29
29
  *
30
30
  * @author SAP SE
31
- * @version 1.120.0
31
+ * @version 1.120.2
32
32
  *
33
33
  * @private
34
34
  * @experimental Since 1.75
@@ -42,6 +42,50 @@ sap.ui.define([
42
42
  }
43
43
  });
44
44
 
45
+ /**
46
+ * Searches a control plugin with a given type in the aggregations of the given <code>Element</code> instance.
47
+ * The first plugin that is found is returned.
48
+ *
49
+ * @param {sap.ui.core.Element} oElement The <code>Element</code> instance to check for
50
+ * @param {string|function} [vPlugin] The full name or the constructor of the plugin name; if nothing is given, <code>PluginBase</code> is used
51
+ * @return {sap.ui.core.Element|undefined} The found plugin instance or <code>undefined</code> if not found
52
+ * @private
53
+ * @static
54
+ */
55
+ PluginBase.getPlugin = function(oElement, vPlugin = PluginBase) {
56
+ // Keep this function in sync with sap.m.plugins.PluginBase.getPlugin
57
+ // until the library dependencies are cleaned up and a reuse can happen!
58
+
59
+ if (!oElement) {
60
+ return;
61
+ }
62
+
63
+ if (typeof vPlugin === "function" && vPlugin.getMetadata) {
64
+ vPlugin = vPlugin.getMetadata().getName();
65
+ }
66
+
67
+ const fnCheck = function(oElem) {
68
+ /* TBD Cleanup sap.m and sap.ui.table plugins should be aligned in future.*/
69
+ return oElem.isA(vPlugin) && (
70
+ oElem.isA(["sap.m.plugins.PluginBase", "sap.ui.table.plugins.PluginBase"]));
71
+ };
72
+
73
+ return oElement.getDependents().find(fnCheck) || oElement.findElements(false, fnCheck)[0];
74
+ };
75
+
76
+ /**
77
+ * Searches a plugin of the corresponding type in the aggregations of the given <code>Table</code> instance.
78
+ * The first plugin that is found is returned.
79
+ *
80
+ * @param {sap.ui.table.Table} oTable The <code>Table</code> instance to check for
81
+ * @return {sap.ui.core.Element|undefined} The found plugin instance or <code>undefined</code> if not found
82
+ * @public
83
+ * @static
84
+ */
85
+ PluginBase.findOn = function(oElement) {
86
+ return PluginBase.getPlugin(oElement, this);
87
+ };
88
+
45
89
  /**
46
90
  * @override
47
91
  * @inheritDoc
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  *
24
24
  * @class Implements the selection methods for a Table
25
25
  * @extends sap.ui.table.plugins.SelectionPlugin
26
- * @version 1.120.0
26
+ * @version 1.120.2
27
27
  * @constructor
28
28
  * @private
29
29
  * @alias sap.ui.table.plugins.SelectionModelSelection
@@ -26,13 +26,14 @@ sap.ui.define([
26
26
  * @class Implements the selection methods for a table.
27
27
  * @extends sap.ui.core.Element
28
28
  * @author SAP SE
29
- * @version 1.120.0
29
+ * @version 1.120.2
30
30
  * @public
31
31
  * @since 1.64
32
32
  * @experimental As of version 1.64
33
33
  * @alias sap.ui.table.plugins.SelectionPlugin
34
+ * @borrows module:sap/ui/table/plugins/PluginBase.findOn as findOn
34
35
  */
35
- var SelectionPlugin = Element.extend("sap.ui.table.plugins.SelectionPlugin", {metadata: {
36
+ var SelectionPlugin = PluginBase.extend("sap.ui.table.plugins.SelectionPlugin", {metadata: {
36
37
  "abstract": true,
37
38
  library: "sap.ui.table",
38
39
  properties: {
@@ -52,12 +53,7 @@ sap.ui.define([
52
53
  }
53
54
  }});
54
55
 
55
- // PluginBase is currently private and can therefore not be extended by the SelectionPlugin class that is the type of a public aggregation.
56
- for (var sProp in PluginBase.prototype) {
57
- if (!SelectionPlugin.prototype.hasOwnProperty(sProp)) {
58
- SelectionPlugin.prototype[sProp] = PluginBase.prototype[sProp];
59
- }
60
- }
56
+ SelectionPlugin.findOn = PluginBase.findOn;
61
57
 
62
58
  SelectionPlugin.prototype.setParent = function(oParent) {
63
59
  var oTable = this.getTable();
@@ -32,7 +32,7 @@ sap.ui.define([
32
32
  * @class TODO (don't forget to document fixed row count restrictions because fixed rows are set by this plugin)
33
33
  * @extends sap.ui.table.plugins.PluginBase
34
34
  * @author SAP SE
35
- * @version 1.120.0
35
+ * @version 1.120.2
36
36
  * @private
37
37
  * @since 1.76
38
38
  * @experimental
@@ -38,7 +38,7 @@ sap.ui.define([
38
38
  * @public
39
39
  *
40
40
  * @author SAP SE
41
- * @version 1.120.0
41
+ * @version 1.120.2
42
42
  */
43
43
  var AutoRowMode = RowMode.extend("sap.ui.table.rowmodes.Auto", /** @lends sap.ui.table.rowmodes.Auto.prototype */ {
44
44
  metadata: {
@@ -27,7 +27,7 @@ sap.ui.define([
27
27
  * @public
28
28
  *
29
29
  * @author SAP SE
30
- * @version 1.120.0
30
+ * @version 1.120.2
31
31
  */
32
32
  var FixedRowMode = RowMode.extend("sap.ui.table.rowmodes.Fixed", /** @lends sap.ui.table.rowmodes.Fixed.prototype */ {
33
33
  metadata: {
@@ -29,7 +29,7 @@ sap.ui.define([
29
29
  * @public
30
30
  *
31
31
  * @author SAP SE
32
- * @version 1.120.0
32
+ * @version 1.120.2
33
33
  */
34
34
  var InteractiveRowMode = RowMode.extend("sap.ui.table.rowmodes.Interactive", /** @lends sap.ui.table.rowmodes.Interactive.prototype */ {
35
35
  metadata: {
@@ -35,7 +35,7 @@ sap.ui.define([
35
35
  * @public
36
36
  *
37
37
  * @author SAP SE
38
- * @version 1.120.0
38
+ * @version 1.120.2
39
39
  */
40
40
  var RowMode = Element.extend("sap.ui.table.rowmodes.RowMode", /** @lends sap.ui.table.rowmodes.RowMode.prototype */ {
41
41
  metadata: {
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * @extends sap.ui.table.rowmodes.RowMode
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.120.0
26
+ * @version 1.120.2
27
27
  *
28
28
  * @constructor
29
29
  * @private
@@ -209,7 +209,7 @@ sap.ui.define([
209
209
  * Static collection of utility functions related to the sap.ui.table.Table, ...
210
210
  *
211
211
  * @author SAP SE
212
- * @version 1.120.0
212
+ * @version 1.120.2
213
213
  * @namespace
214
214
  * @alias sap.ui.table.utils.TableUtils
215
215
  * @private
@@ -14,7 +14,7 @@ sap.ui.define([], function() {
14
14
  * Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Binding...</code>
15
15
  *
16
16
  * @author SAP SE
17
- * @version 1.120.0
17
+ * @version 1.120.2
18
18
  * @namespace
19
19
  * @alias sap.ui.table.utils._BindingUtils
20
20
  * @private
@@ -18,7 +18,7 @@ sap.ui.define([
18
18
  * Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Column...</code>
19
19
  *
20
20
  * @author SAP SE
21
- * @version 1.120.0
21
+ * @version 1.120.2
22
22
  * @namespace
23
23
  * @alias sap.ui.table.utils._ColumnUtils
24
24
  * @private
@@ -23,7 +23,7 @@ sap.ui.define([
23
23
  * Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Grouping...</code>
24
24
  *
25
25
  * @author SAP SE
26
- * @version 1.120.0
26
+ * @version 1.120.2
27
27
  * @namespace
28
28
  * @alias sap.ui.table.utils._GroupingUtils
29
29
  * @private
@@ -22,7 +22,7 @@ sap.ui.define(["sap/ui/base/DataType", "sap/ui/model/ChangeReason"], function(Da
22
22
  * - There is no concept for public or protected hooks. Never expose a hook directly, only indirectly as can be seen in the examples.
23
23
  *
24
24
  * @author SAP SE
25
- * @version 1.120.0
25
+ * @version 1.120.2
26
26
  * @namespace
27
27
  * @alias sap.ui.table.utils._HookUtils
28
28
  *
@@ -39,7 +39,7 @@ sap.ui.define([
39
39
  * Note: Do not access the functions of this helper directly, but via <code>sap.ui.table.utils.TableUtils.Menu...</code>
40
40
  *
41
41
  * @author SAP SE
42
- * @version 1.120.0
42
+ * @version 1.120.2
43
43
  * @namespace
44
44
  * @alias sap.ui.table.utils._MenuUtils
45
45
  * @private