@openui5/sap.ui.table 1.141.2 → 1.142.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 (64) hide show
  1. package/README.md +2 -2
  2. package/REUSE.toml +39 -1
  3. package/THIRDPARTY.txt +36 -3
  4. package/package.json +3 -3
  5. package/src/sap/ui/table/.library +1 -1
  6. package/src/sap/ui/table/AnalyticalColumn.js +1 -1
  7. package/src/sap/ui/table/AnalyticalColumnMenu.js +1 -1
  8. package/src/sap/ui/table/AnalyticalTable.js +1 -1
  9. package/src/sap/ui/table/Column.js +1 -1
  10. package/src/sap/ui/table/ColumnMenu.js +1 -1
  11. package/src/sap/ui/table/CreationRow.js +1 -1
  12. package/src/sap/ui/table/Row.js +1 -1
  13. package/src/sap/ui/table/RowAction.js +62 -143
  14. package/src/sap/ui/table/RowActionItem.js +61 -41
  15. package/src/sap/ui/table/RowActionRenderer.js +40 -5
  16. package/src/sap/ui/table/RowSettings.js +1 -1
  17. package/src/sap/ui/table/Table.js +62 -4
  18. package/src/sap/ui/table/TablePersoController.js +1 -1
  19. package/src/sap/ui/table/TableRenderer.js +50 -24
  20. package/src/sap/ui/table/TreeTable.js +1 -1
  21. package/src/sap/ui/table/extensions/Accessibility.js +56 -16
  22. package/src/sap/ui/table/extensions/AccessibilityRender.js +1 -1
  23. package/src/sap/ui/table/extensions/DragAndDrop.js +1 -1
  24. package/src/sap/ui/table/extensions/ExtensionBase.js +1 -1
  25. package/src/sap/ui/table/extensions/Keyboard.js +1 -1
  26. package/src/sap/ui/table/extensions/KeyboardDelegate.js +1 -1
  27. package/src/sap/ui/table/extensions/Pointer.js +1 -1
  28. package/src/sap/ui/table/extensions/Scrolling.js +1 -1
  29. package/src/sap/ui/table/extensions/ScrollingIOS.js +1 -1
  30. package/src/sap/ui/table/extensions/Synchronization.js +1 -1
  31. package/src/sap/ui/table/library.js +10 -10
  32. package/src/sap/ui/table/menus/AnalyticalTableContextMenu.js +1 -1
  33. package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +1 -1
  34. package/src/sap/ui/table/menus/ContextMenu.js +1 -1
  35. package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +1 -1
  36. package/src/sap/ui/table/messagebundle.properties +12 -0
  37. package/src/sap/ui/table/plugins/BindingSelection.js +1 -1
  38. package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +10 -2
  39. package/src/sap/ui/table/plugins/ODataV4Aggregation.js +1 -1
  40. package/src/sap/ui/table/plugins/ODataV4Hierarchy.js +1 -1
  41. package/src/sap/ui/table/plugins/ODataV4MultiLevel.js +1 -1
  42. package/src/sap/ui/table/plugins/ODataV4MultiSelection.js +1 -1
  43. package/src/sap/ui/table/plugins/ODataV4Selection.js +1 -1
  44. package/src/sap/ui/table/plugins/ODataV4SingleSelection.js +1 -1
  45. package/src/sap/ui/table/plugins/PluginBase.js +1 -1
  46. package/src/sap/ui/table/plugins/SelectionModelSelection.js +1 -1
  47. package/src/sap/ui/table/plugins/SelectionPlugin.js +1 -1
  48. package/src/sap/ui/table/rowmodes/Auto.js +1 -1
  49. package/src/sap/ui/table/rowmodes/Fixed.js +1 -1
  50. package/src/sap/ui/table/rowmodes/Interactive.js +1 -1
  51. package/src/sap/ui/table/rowmodes/RowMode.js +1 -1
  52. package/src/sap/ui/table/rowmodes/Variable.js +1 -1
  53. package/src/sap/ui/table/rules/ColumnTemplate.support.js +2 -7
  54. package/src/sap/ui/table/themes/base/Cell.less +53 -28
  55. package/src/sap/ui/table/themes/base/Scrolling.less +58 -24
  56. package/src/sap/ui/table/themes/base/library.source.less +7 -3
  57. package/src/sap/ui/table/themes/sap_hcb/base_Cell.less +54 -29
  58. package/src/sap/ui/table/themes/sap_hcb/base_Scrolling.less +49 -21
  59. package/src/sap/ui/table/themes/sap_hcb/library.source.less +7 -3
  60. package/src/sap/ui/table/utils/TableUtils.js +1 -1
  61. package/src/sap/ui/table/utils/_ColumnUtils.js +1 -1
  62. package/src/sap/ui/table/utils/_GroupingUtils.js +1 -1
  63. package/src/sap/ui/table/utils/_HookUtils.js +1 -1
  64. package/src/sap/ui/table/utils/_MenuUtils.js +1 -1
package/README.md CHANGED
@@ -4,13 +4,13 @@
4
4
  Runtime resources of the [OpenUI5](https://github.com/UI5/openui5) UI Library **sap.ui.table**.
5
5
 
6
6
  ## Usage
7
- Add this library as a dependency to your UI5 project by using [UI5 Tooling](https://sap.github.io/ui5-tooling/):
7
+ Add this library as a dependency to your UI5 project by using [UI5 CLI](https://ui5.github.io/cli/):
8
8
 
9
9
  ```
10
10
  ui5 add sap.ui.table
11
11
  ```
12
12
 
13
- For more information, please refer to our documentation on [Consuming OpenUI5 Libraries](https://sap.github.io/ui5-tooling/pages/OpenUI5/).
13
+ For more information, please refer to our documentation on [Consuming OpenUI5 Libraries](https://ui5.github.io/cli/pages/OpenUI5/).
14
14
 
15
15
  ## License
16
16
  OpenUI5 is licensed under [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE.txt](LICENSE.txt).
package/REUSE.toml CHANGED
@@ -21,6 +21,44 @@ SPDX-License-Identifier = "Apache-2.0"
21
21
  #
22
22
 
23
23
 
24
+ # Library: sap.f:
25
+
26
+ [[annotations]]
27
+ path = "src/sap.f/src/sap/f/thirdparty/**"
28
+ precedence = "aggregate"
29
+ SPDX-FileCopyrightText = "SAP"
30
+ SPDX-License-Identifier = "Apache-2.0"
31
+ SPDX-FileComment = "these files belong to: UI5 Web Components"
32
+
33
+ [[annotations]]
34
+ path = "src/sap.f/src/sap/f/thirdparty/**"
35
+ precedence = "aggregate"
36
+ SPDX-FileCopyrightText = "SAP"
37
+ SPDX-License-Identifier = "Apache-2.0"
38
+ SPDX-FileComment = "these files belong to: UI5 Web Components Fiori"
39
+
40
+ [[annotations]]
41
+ path = "src/sap.f/src/sap/f/thirdparty/**"
42
+ precedence = "aggregate"
43
+ SPDX-FileCopyrightText = "SAP"
44
+ SPDX-License-Identifier = "Apache-2.0"
45
+ SPDX-FileComment = "these files belong to: UI5 Web Components Icons"
46
+
47
+ [[annotations]]
48
+ path = "src/sap.f/src/sap/f/thirdparty/**"
49
+ precedence = "aggregate"
50
+ SPDX-FileCopyrightText = "SAP"
51
+ SPDX-License-Identifier = "Apache-2.0"
52
+ SPDX-FileComment = "these files belong to: UI5 Web Components Icons Business Suite"
53
+
54
+ [[annotations]]
55
+ path = "src/sap.f/src/sap/f/thirdparty/**"
56
+ precedence = "aggregate"
57
+ SPDX-FileCopyrightText = "SAP"
58
+ SPDX-License-Identifier = "Apache-2.0"
59
+ SPDX-FileComment = "these files belong to: UI5 Web Components Icons TNT"
60
+
61
+
24
62
  # Library: sap.m:
25
63
 
26
64
  [[annotations]]
@@ -347,7 +385,7 @@ SPDX-FileComment = "these files belong to: handlebars"
347
385
  [[annotations]]
348
386
  path = "src/sap.ui.core/src/sap/ui/thirdparty/require.js"
349
387
  precedence = "aggregate"
350
- SPDX-FileCopyrightText = "2010-2012, The Dojo Foundation"
388
+ SPDX-FileCopyrightText = "2010-2024, jQuery Foundation and other contributors"
351
389
  SPDX-License-Identifier = "MIT"
352
390
  SPDX-FileComment = "these files belong to: requireJS"
353
391
 
package/THIRDPARTY.txt CHANGED
@@ -4,6 +4,39 @@ each subcomponent.
4
4
  The full text of all referenced licenses is appended at the end of this file.
5
5
 
6
6
 
7
+ Library: sap.f:
8
+
9
+ Component: UI5 Web Components, version: 2.15.0
10
+ Copyright: SAP
11
+ License: Apache-2.0
12
+ License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
13
+ Contained in: src/sap.f/src/sap/f/thirdparty/**
14
+
15
+ Component: UI5 Web Components Fiori, version: 2.15.0
16
+ Copyright: SAP
17
+ License: Apache-2.0
18
+ License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
19
+ Contained in: src/sap.f/src/sap/f/thirdparty/**
20
+
21
+ Component: UI5 Web Components Icons, version: 2.15.0
22
+ Copyright: SAP
23
+ License: Apache-2.0
24
+ License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
25
+ Contained in: src/sap.f/src/sap/f/thirdparty/**
26
+
27
+ Component: UI5 Web Components Icons Business Suite, version: 2.15.0
28
+ Copyright: SAP
29
+ License: Apache-2.0
30
+ License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
31
+ Contained in: src/sap.f/src/sap/f/thirdparty/**
32
+
33
+ Component: UI5 Web Components Icons TNT, version: 2.15.0
34
+ Copyright: SAP
35
+ License: Apache-2.0
36
+ License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
37
+ Contained in: src/sap.f/src/sap/f/thirdparty/**
38
+
39
+
7
40
  Library: sap.m:
8
41
 
9
42
  Component: purify.js, version: 3.2.4
@@ -221,8 +254,8 @@ License: MIT
221
254
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
222
255
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/handlebars.js
223
256
 
224
- Component: requireJS, version: 2.1.8
225
- Copyright: 2010-2012, The Dojo Foundation
257
+ Component: requireJS, version: 2.3.7
258
+ Copyright: 2010-2024, jQuery Foundation and other contributors
226
259
  License: MIT
227
260
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/MIT.txt
228
261
  Contained in: src/sap.ui.core/src/sap/ui/thirdparty/require.js
@@ -354,7 +387,7 @@ Contained in: src/sap.ui.documentation/src/sap/ui/documentation/sdk/thirdparty/D
354
387
 
355
388
  Library: sap.ui.integration:
356
389
 
357
- Component: UI5 Web Components, version: 1.7.0
390
+ Component: UI5 Web Components, version: 2.15.0
358
391
  Copyright: SAP
359
392
  License: Apache-2.0
360
393
  License Text: https://github.com/UI5/openui5/blob/master/LICENSES/Apache-2.0.txt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openui5/sap.ui.table",
3
- "version": "1.141.2",
3
+ "version": "1.142.1",
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/UI5/openui5.git"
15
15
  },
16
16
  "dependencies": {
17
- "@openui5/sap.ui.core": "1.141.2",
18
- "@openui5/sap.ui.unified": "1.141.2"
17
+ "@openui5/sap.ui.core": "1.142.1",
18
+ "@openui5/sap.ui.unified": "1.142.1"
19
19
  }
20
20
  }
@@ -6,7 +6,7 @@
6
6
  <copyright>OpenUI5
7
7
  * (c) Copyright 2025 SAP SE or an SAP affiliate company.
8
8
  * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.</copyright>
9
- <version>1.141.2</version>
9
+ <version>1.142.1</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.141.2
50
+ * @version 1.142.1
51
51
  *
52
52
  * @constructor
53
53
  * @public
@@ -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.141.2
23
+ * @version 1.142.1
24
24
  *
25
25
  * @constructor
26
26
  * @public
@@ -52,7 +52,7 @@ sap.ui.define([
52
52
  * @see {@link topic:148892ff9aea4a18b912829791e38f3e Tables: Which One Should I Choose?}
53
53
  *
54
54
  * @extends sap.ui.table.Table
55
- * @version 1.141.2
55
+ * @version 1.142.1
56
56
  *
57
57
  * @constructor
58
58
  * @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.141.2
66
+ * @version 1.142.1
67
67
  *
68
68
  * @constructor
69
69
  * @public
@@ -40,7 +40,7 @@ sap.ui.define([
40
40
  * @class
41
41
  * The column menu provides all common actions that can be performed on a column.
42
42
  * @extends sap.ui.unified.Menu
43
- * @version 1.141.2
43
+ * @version 1.142.1
44
44
  *
45
45
  * @constructor
46
46
  * @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.141.2
35
+ * @version 1.142.1
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.141.2
138
+ * @version 1.142.1
139
139
  *
140
140
  * @constructor
141
141
  * @public
@@ -6,21 +6,21 @@
6
6
 
7
7
  // Provides control sap.ui.table.RowAction
8
8
  sap.ui.define([
9
- "./library",
10
9
  "./utils/TableUtils",
11
10
  "./RowActionRenderer",
12
11
  "sap/ui/core/Control",
13
12
  "sap/ui/core/Icon",
14
- "sap/ui/unified/Menu",
15
- "sap/ui/core/Popup"
13
+ "sap/ui/core/IconPool",
14
+ "sap/ui/core/Popup",
15
+ "sap/ui/unified/Menu"
16
16
  ], function(
17
- library,
18
17
  TableUtils,
19
18
  RowActionRenderer,
20
19
  Control,
21
20
  Icon,
22
- Menu,
23
- Popup
21
+ IconPool,
22
+ Popup,
23
+ Menu
24
24
  ) {
25
25
  "use strict";
26
26
 
@@ -34,8 +34,12 @@ sap.ui.define([
34
34
  * The <code>RowAction</code> control allows to display multiple action items which can be selected by the user.
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
+ *
38
+ * <b>Note</b>: The <code>RowActionItem</code> of type <code>Navigation</code> has a special role and is shown as the rightmost icon independent
39
+ * of the order in the <code>items</code> aggregation.
40
+ *
37
41
  * @extends sap.ui.core.Control
38
- * @version 1.141.2
42
+ * @version 1.142.1
39
43
  *
40
44
  * @constructor
41
45
  * @public
@@ -56,117 +60,13 @@ sap.ui.define([
56
60
  /**
57
61
  * The action items which should be displayed.
58
62
  */
59
- items: {type: "sap.ui.table.RowActionItem", multiple: true},
60
-
61
- /*
62
- * Hidden aggregation for the internally used icon controls.
63
- */
64
- _icons: {type: "sap.ui.core.Icon", multiple: true, visibility: "hidden"},
65
-
66
- /*
67
- * Hidden aggregation for the internally used menu control.
68
- */
69
- _menu: {type: "sap.ui.unified.Menu", multiple: false, visibility: "hidden"}
63
+ items: {type: "sap.ui.table.RowActionItem", multiple: true}
70
64
  },
71
65
  events: {}
72
66
  },
73
67
  renderer: RowActionRenderer
74
68
  });
75
69
 
76
- RowAction.prototype.init = function() {
77
- /*
78
- * Enables or disables the fixed layout.
79
- * If enabled, the position of the icons is stable.
80
- *
81
- * @type {boolean}
82
- */
83
- this._bFixedLayout = true;
84
-
85
- this._aActions = ["", ""];
86
- this._iLastCloseTime = 0;
87
-
88
- this.addAggregation("_icons", new Icon(this.getId() + "-icon0", {
89
- decorative: false,
90
- press: [this._onIconPress, this]
91
- })
92
- .addStyleClass("sapUiTableActionIcon"))
93
- .addDelegate({
94
- onAfterRendering: function() {
95
- const oIconDomRef = this.getAggregation("_icons")[0].getDomRef();
96
-
97
- if (this._aActions[0] === "menu") {
98
- oIconDomRef.setAttribute("aria-haspopup", "menu");
99
- } else {
100
- oIconDomRef.removeAttribute("aria-haspopup");
101
- }
102
- }
103
- }, this);
104
-
105
- this.addAggregation("_icons", new Icon(this.getId() + "-icon1", {
106
- decorative: false,
107
- press: [this._onIconPress, this]
108
- })
109
- .addStyleClass("sapUiTableActionIcon"))
110
- .addDelegate({
111
- onAfterRendering: function() {
112
- const oIconDomRef = this.getAggregation("_icons")[1].getDomRef();
113
-
114
- if (this._aActions[1] === "menu") {
115
- oIconDomRef.setAttribute("aria-haspopup", "menu");
116
- } else {
117
- oIconDomRef.removeAttribute("aria-haspopup");
118
- }
119
- }
120
- }, this);
121
- };
122
-
123
- RowAction.prototype.onBeforeRendering = function() {
124
- const oRow = this.getRow();
125
- const oTable = oRow ? oRow.getTable() : null;
126
- const aIcons = this.getAggregation("_icons");
127
- const aItems = this.getItems();
128
- const aVisibleItems = this._getVisibleItems();
129
- const iVisibleItems = aVisibleItems.length;
130
- const iSize = this._getSize();
131
- const sHeaderLabelId = oTable ? oTable.getId() + "-rowacthdr" : "";
132
-
133
- if (this._bFixedLayout && iVisibleItems === 1 && iSize === 2 && aItems.length > 1 && aVisibleItems[0] === aItems[1]) {
134
- aVisibleItems[0]._syncIcon(aIcons[1]);
135
- this._aActions = ["", "action_fixed"];
136
- } else if (iVisibleItems === 0 || iSize === 0) {
137
- this._aActions = ["", ""];
138
- } else if (iVisibleItems === 1 && iSize > 0) {
139
- aVisibleItems[0]._syncIcon(aIcons[0]);
140
- this._aActions = ["action", ""];
141
- } else if (iVisibleItems === 2 && iSize === 2) {
142
- aVisibleItems[0]._syncIcon(aIcons[0]);
143
- aVisibleItems[1]._syncIcon(aIcons[1]);
144
- this._aActions = ["action", "action"];
145
- } else if (iVisibleItems > 2 && iSize === 2) {
146
- aVisibleItems[0]._syncIcon(aIcons[0]);
147
- aIcons[1].setSrc("sap-icon://overflow");
148
- aIcons[1].setTooltip(TableUtils.getResourceText("TBL_ROW_ACTION_MORE"));
149
- this._aActions = ["action", "menu"];
150
- } else { // iVisibleItems > 2 && iSize === 1
151
- aIcons[0].setSrc("sap-icon://overflow");
152
- aIcons[0].setTooltip(TableUtils.getResourceText("TBL_ROW_ACTION_MORE"));
153
- this._aActions = ["menu", ""];
154
- }
155
-
156
- aIcons.forEach(function(oIcon, iIndex) {
157
- oIcon.removeAllAriaLabelledBy();
158
- oIcon.removeStyleClass("sapUiTableActionHidden");
159
-
160
- if (sHeaderLabelId) {
161
- oIcon.addAriaLabelledBy(sHeaderLabelId);
162
- }
163
-
164
- if (this._aActions[iIndex] === "") {
165
- oIcon.addStyleClass("sapUiTableActionHidden");
166
- }
167
- }.bind(this));
168
- };
169
-
170
70
  /*
171
71
  * @override
172
72
  * @inheritDoc
@@ -226,48 +126,67 @@ sap.ui.define([
226
126
  RowAction.prototype._getSize = function() {
227
127
  const oRow = this.getRow();
228
128
  const oTable = oRow ? oRow.getTable() : null;
229
- return oTable ? oTable.getRowActionCount() : 2;
129
+
130
+ return oTable ? oTable.getRowActionCount() : 3;
230
131
  };
231
132
 
232
133
  /**
233
- * Press Event handler for the inner icons.
134
+ * Returns an overflow icon which opens a menu containing the overflowing items.
234
135
  *
235
- * @param {sap.ui.base.Event} oEvent The press event of the icon
136
+ * @param {sap.ui.table.RowActionItem[]} aItems The visible action items (excluding navigation items)
137
+ * @param {sap.ui.table.RowActionItem[]} aNavigationItems The visible navigation action items
138
+ * @param {int} iItemsBeforeOverflow The number of items which are displayed before the overflow
139
+ *
140
+ * @returns {sap.ui.core.Icon} The overflow icon.
236
141
  * @private
237
142
  */
238
- RowAction.prototype._onIconPress = function(oEvent) {
239
- const oIcon = oEvent.getSource();
240
- const iIconIndex = this.indexOfAggregation("_icons", oIcon);
241
- const sAction = this._aActions[iIconIndex];
143
+ RowAction.prototype._getOverflowIcon = function(aItems, aNavigationItems, iItemsBeforeOverflow) {
144
+ if (!this._oOverflowIcon) {
145
+ this._oOverflowIcon = new Icon({
146
+ src: IconPool.getIconURI("overflow"),
147
+ decorative: false
148
+ }).addStyleClass("sapUiTableActionIcon");
149
+
150
+ this._oOverflowIcon.addDelegate({
151
+ onAfterRendering: function() {
152
+ this._oOverflowIcon.getDomRef().setAttribute("aria-haspopup", "Menu");
153
+ }
154
+ }, this);
155
+ this.addDependent(this._oOverflowIcon);
156
+ } else {
157
+ this._oOverflowIcon.detachPress(fnPress, this);
158
+ }
242
159
 
243
- if (sAction === "action") {
244
- this._getVisibleItems()[iIconIndex]._firePress();
245
- } else if (sAction === "action_fixed") {
246
- this._getVisibleItems()[0]._firePress();
247
- } else if (sAction === "menu") {
248
- let oMenu = this.getAggregation("_menu");
249
- if (!oMenu) {
250
- oMenu = new Menu();
251
- this.setAggregation("_menu", oMenu, true);
252
- oMenu.getPopup().attachClosed(function() {
253
- this._iLastCloseTime = Date.now();
254
- }, this);
255
- }
256
- oMenu.removeAllItems();
160
+ this._oOverflowIcon.attachPress({aItems, aNavigationItems, iItemsBeforeOverflow}, fnPress, this);
257
161
 
258
- if (Date.now() - this._iLastCloseTime < 500) {
259
- //Skip menu opening when the menu was closed directly before
260
- return;
261
- }
162
+ return this._oOverflowIcon;
163
+ };
262
164
 
263
- const aItems = this.getItems();
264
- for (let i = iIconIndex; i < aItems.length; i++) {
265
- oMenu.addItem(aItems[i]._getMenuItem());
266
- }
165
+ function fnPress(oEvent, mParameters) {
166
+ const aItems = mParameters.aItems;
167
+ const aNavigationItems = mParameters.aNavigationItems;
168
+ const iItemsBeforeOverflow = mParameters.iItemsBeforeOverflow;
169
+ const oTable = this.getRow().getTable();
267
170
 
268
- oMenu.open(null, oIcon, Popup.Dock.EndTop, Popup.Dock.EndBottom, oIcon);
171
+ if (!oTable._oRowActionOverflowMenu) {
172
+ oTable._oRowActionOverflowMenu = new Menu();
173
+ oTable.addAggregation("_hiddenDependents", oTable._oRowActionOverflowMenu);
174
+ } else {
175
+ oTable._oRowActionOverflowMenu.removeAllItems();
269
176
  }
270
- };
177
+
178
+ for (let i = iItemsBeforeOverflow; i < aItems.length; i++) {
179
+ oTable._oRowActionOverflowMenu.addItem(aItems[i]._getOverflowMenuItem());
180
+ }
181
+
182
+ if (aNavigationItems.length >= this._getSize()) {
183
+ for (let i = 0; i < aNavigationItems.length - this._getSize(); i++) {
184
+ oTable._oRowActionOverflowMenu.addItem(aNavigationItems[i]._getOverflowMenuItem());
185
+ }
186
+ }
187
+
188
+ oTable._oRowActionOverflowMenu.open(true, oEvent.getSource(), Popup.Dock.CenterTop, Popup.Dock.CenterBottom, oEvent.getSource().getDomRef());
189
+ }
271
190
 
272
191
  return RowAction;
273
192
  });
@@ -6,8 +6,20 @@
6
6
 
7
7
  // Provides control sap.ui.table.RowActionItem.
8
8
  sap.ui.define([
9
- "./library", "./utils/TableUtils", "sap/ui/core/Element", "sap/ui/unified/MenuItem", "sap/ui/core/IconPool"
10
- ], function(library, TableUtils, Element, MenuItem, IconPool) {
9
+ "./library",
10
+ "./utils/TableUtils",
11
+ "sap/ui/core/Element",
12
+ "sap/ui/core/Icon",
13
+ "sap/ui/core/IconPool",
14
+ "sap/ui/unified/MenuItem"
15
+ ], function(
16
+ library,
17
+ TableUtils,
18
+ Element,
19
+ Icon,
20
+ IconPool,
21
+ MenuItem
22
+ ) {
11
23
  "use strict";
12
24
 
13
25
  const RowActionType = library.RowActionType;
@@ -24,7 +36,7 @@ sap.ui.define([
24
36
  * @extends sap.ui.core.Element
25
37
  *
26
38
  * @author SAP SE
27
- * @version 1.141.2
39
+ * @version 1.142.1
28
40
  * @since 1.45
29
41
  *
30
42
  * @constructor
@@ -77,17 +89,6 @@ sap.ui.define([
77
89
  }
78
90
  });
79
91
 
80
- Item.prototype.init = function() {
81
- this._oMenuItem = null;
82
- };
83
-
84
- Item.prototype.exit = function() {
85
- if (this._oMenuItem) {
86
- this._oMenuItem.destroy();
87
- this._oMenuItem = null;
88
- }
89
- };
90
-
91
92
  /**
92
93
  * Gets the instance of the row action this control belongs to.
93
94
  *
@@ -99,6 +100,22 @@ sap.ui.define([
99
100
  return TableUtils.isA(oParent, "sap.ui.table.RowAction") ? oParent : null;
100
101
  };
101
102
 
103
+ Item.prototype.setIcon = function(sIcon) {
104
+ this.setProperty("icon", sIcon, true);
105
+ if (this._oIcon) {
106
+ this._oIcon.setSrc(this._getIconUri());
107
+ }
108
+ return this;
109
+ };
110
+
111
+ Item.prototype.setText = function(sText) {
112
+ this.setProperty("text", sText, true);
113
+ if (this._oIcon) {
114
+ this._oIcon.setTooltip(sText);
115
+ }
116
+ return this;
117
+ };
118
+
102
119
  /**
103
120
  * Fires the press event of this item with the relevant parameters.
104
121
  *
@@ -114,30 +131,12 @@ sap.ui.define([
114
131
  };
115
132
 
116
133
  /**
117
- * Creates, updates and returns the corresponding menu item.
118
- *
119
- * @returns {sap.ui.unified.MenuItem} The corresponding menu item
120
- * @private
121
- */
122
- Item.prototype._getMenuItem = function() {
123
- if (!this._oMenuItem) {
124
- this._oMenuItem = new MenuItem({
125
- select: [this._firePress, this]
126
- });
127
- }
128
- this._oMenuItem.setIcon(this._getIcon());
129
- this._oMenuItem.setVisible(this.getVisible());
130
- this._oMenuItem.setText(this._getText(false));
131
- return this._oMenuItem;
132
- };
133
-
134
- /**
135
- * Computes which icon should be used for this item.
134
+ * Computes which icon should be used for this action item.
136
135
  *
137
136
  * @returns {string} The name of the icon in the icon font.
138
137
  * @private
139
138
  */
140
- Item.prototype._getIcon = function() {
139
+ Item.prototype._getIconUri = function() {
141
140
  const oIcon = this.getIcon();
142
141
  if (oIcon) {
143
142
  return oIcon;
@@ -152,7 +151,26 @@ sap.ui.define([
152
151
  };
153
152
 
154
153
  /**
155
- * Computes which text should be used for this item.
154
+ * Returns an icon control which represents this action item.
155
+ * @returns {sap.ui.core.Icon} The icon control.
156
+ * @private
157
+ */
158
+ Item.prototype._getIcon = function() {
159
+ if (!this._oIcon) {
160
+ this._oIcon = new Icon({
161
+ src: this._getIconUri(),
162
+ decorative: false,
163
+ tooltip: this._getText(),
164
+ press: [this._firePress, this]
165
+ });
166
+ this.addDependent(this._oIcon);
167
+ }
168
+
169
+ return this._oIcon;
170
+ };
171
+
172
+ /**
173
+ * Computes which text should be used for this actionitem.
156
174
  *
157
175
  * @param {boolean} bPreferTooltip Whether the tooltip or text is preferred
158
176
  * @returns {string} The item text
@@ -173,14 +191,16 @@ sap.ui.define([
173
191
  };
174
192
 
175
193
  /**
176
- * Updates the given icon control with the property values of this item.
177
- *
178
- * @param {sap.ui.core.Icon} oIcon The icon control to update
194
+ * Returns a menu item representing this action item.
195
+ * @returns {sap.ui.unified.MenuItem} A menu item representing this action item
179
196
  * @private
180
197
  */
181
- Item.prototype._syncIcon = function(oIcon) {
182
- oIcon.setSrc(this._getIcon());
183
- oIcon.setTooltip(this._getText(true));
198
+ Item.prototype._getOverflowMenuItem = function() {
199
+ return new MenuItem({
200
+ text: this._getText(),
201
+ icon: this._getIconUri(),
202
+ select: [this._firePress, this]
203
+ });
184
204
  };
185
205
 
186
206
  return Item;