@openui5/sap.ui.table 1.131.1 → 1.132.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 (116) hide show
  1. package/THIRDPARTY.txt +1 -1
  2. package/package.json +3 -3
  3. package/src/sap/ui/table/.library +2 -2
  4. package/src/sap/ui/table/AnalyticalColumn.js +2 -2
  5. package/src/sap/ui/table/AnalyticalColumnMenu.js +2 -2
  6. package/src/sap/ui/table/AnalyticalTable.js +21 -33
  7. package/src/sap/ui/table/Column.js +5 -2
  8. package/src/sap/ui/table/ColumnMenu.js +2 -2
  9. package/src/sap/ui/table/CreationRow.js +2 -2
  10. package/src/sap/ui/table/CreationRowRenderer.js +1 -1
  11. package/src/sap/ui/table/Row.js +5 -3
  12. package/src/sap/ui/table/RowAction.js +2 -2
  13. package/src/sap/ui/table/RowActionItem.js +2 -2
  14. package/src/sap/ui/table/RowActionRenderer.js +1 -1
  15. package/src/sap/ui/table/RowSettings.js +2 -2
  16. package/src/sap/ui/table/Table.js +44 -44
  17. package/src/sap/ui/table/TablePersoController.js +2 -2
  18. package/src/sap/ui/table/TableRenderer.js +1 -4
  19. package/src/sap/ui/table/TreeTable.js +2 -2
  20. package/src/sap/ui/table/designtime/AnalyticalTable.designtime.js +1 -1
  21. package/src/sap/ui/table/designtime/Table.designtime.js +1 -1
  22. package/src/sap/ui/table/designtime/library.designtime.js +1 -1
  23. package/src/sap/ui/table/extensions/Accessibility.js +2 -2
  24. package/src/sap/ui/table/extensions/AccessibilityRender.js +2 -2
  25. package/src/sap/ui/table/extensions/DragAndDrop.js +2 -2
  26. package/src/sap/ui/table/extensions/ExtensionBase.js +2 -2
  27. package/src/sap/ui/table/extensions/Keyboard.js +2 -2
  28. package/src/sap/ui/table/extensions/KeyboardDelegate.js +2 -2
  29. package/src/sap/ui/table/extensions/Pointer.js +2 -2
  30. package/src/sap/ui/table/extensions/Scrolling.js +2 -2
  31. package/src/sap/ui/table/extensions/ScrollingIOS.js +2 -2
  32. package/src/sap/ui/table/extensions/Synchronization.js +2 -2
  33. package/src/sap/ui/table/library.js +12 -12
  34. package/src/sap/ui/table/library.support.js +1 -1
  35. package/src/sap/ui/table/menus/AnalyticalTableContextMenu.js +299 -0
  36. package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +2 -2
  37. package/src/sap/ui/table/menus/ContextMenu.js +154 -0
  38. package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +1 -1
  39. package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +2 -2
  40. package/src/sap/ui/table/messagebundle_ar.properties +0 -4
  41. package/src/sap/ui/table/messagebundle_bg.properties +0 -4
  42. package/src/sap/ui/table/messagebundle_ca.properties +0 -4
  43. package/src/sap/ui/table/messagebundle_cnr.properties +0 -4
  44. package/src/sap/ui/table/messagebundle_cs.properties +0 -4
  45. package/src/sap/ui/table/messagebundle_cy.properties +0 -4
  46. package/src/sap/ui/table/messagebundle_da.properties +0 -4
  47. package/src/sap/ui/table/messagebundle_de.properties +0 -4
  48. package/src/sap/ui/table/messagebundle_el.properties +0 -4
  49. package/src/sap/ui/table/messagebundle_en.properties +0 -4
  50. package/src/sap/ui/table/messagebundle_en_GB.properties +0 -4
  51. package/src/sap/ui/table/messagebundle_en_US_saptrc.properties +91 -72
  52. package/src/sap/ui/table/messagebundle_es.properties +0 -4
  53. package/src/sap/ui/table/messagebundle_es_MX.properties +0 -4
  54. package/src/sap/ui/table/messagebundle_et.properties +0 -4
  55. package/src/sap/ui/table/messagebundle_fi.properties +0 -4
  56. package/src/sap/ui/table/messagebundle_fr.properties +0 -4
  57. package/src/sap/ui/table/messagebundle_fr_CA.properties +0 -4
  58. package/src/sap/ui/table/messagebundle_hi.properties +0 -4
  59. package/src/sap/ui/table/messagebundle_hr.properties +0 -4
  60. package/src/sap/ui/table/messagebundle_hu.properties +0 -4
  61. package/src/sap/ui/table/messagebundle_id.properties +0 -4
  62. package/src/sap/ui/table/messagebundle_it.properties +0 -4
  63. package/src/sap/ui/table/messagebundle_iw.properties +0 -4
  64. package/src/sap/ui/table/messagebundle_ja.properties +0 -4
  65. package/src/sap/ui/table/messagebundle_kk.properties +0 -4
  66. package/src/sap/ui/table/messagebundle_ko.properties +0 -4
  67. package/src/sap/ui/table/messagebundle_lt.properties +0 -4
  68. package/src/sap/ui/table/messagebundle_lv.properties +0 -4
  69. package/src/sap/ui/table/messagebundle_mk.properties +0 -4
  70. package/src/sap/ui/table/messagebundle_ms.properties +0 -4
  71. package/src/sap/ui/table/messagebundle_nl.properties +0 -4
  72. package/src/sap/ui/table/messagebundle_no.properties +0 -4
  73. package/src/sap/ui/table/messagebundle_pl.properties +0 -4
  74. package/src/sap/ui/table/messagebundle_pt.properties +0 -4
  75. package/src/sap/ui/table/messagebundle_pt_PT.properties +0 -4
  76. package/src/sap/ui/table/messagebundle_ro.properties +0 -4
  77. package/src/sap/ui/table/messagebundle_ru.properties +0 -4
  78. package/src/sap/ui/table/messagebundle_sh.properties +0 -4
  79. package/src/sap/ui/table/messagebundle_sk.properties +0 -4
  80. package/src/sap/ui/table/messagebundle_sl.properties +0 -4
  81. package/src/sap/ui/table/messagebundle_sr.properties +0 -4
  82. package/src/sap/ui/table/messagebundle_sv.properties +0 -4
  83. package/src/sap/ui/table/messagebundle_th.properties +0 -4
  84. package/src/sap/ui/table/messagebundle_tr.properties +0 -4
  85. package/src/sap/ui/table/messagebundle_uk.properties +0 -4
  86. package/src/sap/ui/table/messagebundle_vi.properties +0 -4
  87. package/src/sap/ui/table/messagebundle_zh_CN.properties +0 -4
  88. package/src/sap/ui/table/messagebundle_zh_TW.properties +0 -4
  89. package/src/sap/ui/table/plugins/BindingSelection.js +2 -2
  90. package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +2 -2
  91. package/src/sap/ui/table/plugins/ODataV4Selection.js +2 -1
  92. package/src/sap/ui/table/plugins/PluginBase.js +2 -2
  93. package/src/sap/ui/table/plugins/SelectionModelSelection.js +2 -2
  94. package/src/sap/ui/table/plugins/SelectionPlugin.js +2 -2
  95. package/src/sap/ui/table/plugins/V4Aggregation.js +2 -2
  96. package/src/sap/ui/table/rowmodes/Auto.js +2 -2
  97. package/src/sap/ui/table/rowmodes/Fixed.js +2 -2
  98. package/src/sap/ui/table/rowmodes/Interactive.js +2 -2
  99. package/src/sap/ui/table/rowmodes/RowMode.js +2 -2
  100. package/src/sap/ui/table/rowmodes/Type.js +1 -1
  101. package/src/sap/ui/table/rowmodes/Variable.js +2 -2
  102. package/src/sap/ui/table/rules/Accessibility.support.js +1 -1
  103. package/src/sap/ui/table/rules/Binding.support.js +1 -1
  104. package/src/sap/ui/table/rules/ColumnTemplate.support.js +1 -1
  105. package/src/sap/ui/table/rules/Plugins.support.js +1 -1
  106. package/src/sap/ui/table/rules/Rows.support.js +1 -1
  107. package/src/sap/ui/table/rules/TableHelper.support.js +1 -1
  108. package/src/sap/ui/table/themes/base/library.source.less +1 -1
  109. package/src/sap/ui/table/themes/sap_hcb/library.source.less +1 -1
  110. package/src/sap/ui/table/utils/TableUtils.js +4 -42
  111. package/src/sap/ui/table/utils/_BindingUtils.js +2 -2
  112. package/src/sap/ui/table/utils/_ColumnUtils.js +2 -2
  113. package/src/sap/ui/table/utils/_GroupingUtils.js +2 -2
  114. package/src/sap/ui/table/utils/_HookUtils.js +2 -12
  115. package/src/sap/ui/table/utils/_MenuUtils.js +22 -106
  116. package/src/sap/ui/table/menus/GroupHeaderContextMenuAdapter.js +0 -332
@@ -1,332 +0,0 @@
1
- /*!
2
- * OpenUI5
3
- * (c) Copyright 2009-2024 SAP SE or an SAP affiliate company.
4
- * Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
5
- */
6
-
7
- sap.ui.define([
8
- "../library",
9
- "sap/ui/base/Object",
10
- "sap/ui/core/library",
11
- "sap/ui/table/utils/TableUtils",
12
- "sap/ui/unified/Menu",
13
- "sap/ui/unified/MenuItem"
14
- ], function(Library, BaseObject, CoreLibrary, TableUtils, Menu, MenuItem) {
15
- "use strict";
16
-
17
- const GroupEventType = Library.GroupEventType;
18
- const mDefaultItems = [
19
- "ungroup",
20
- "collapse",
21
- "expand"
22
- ];
23
-
24
- /**
25
- * Constructor for a new GroupHeaderContextMenuAdapter.
26
- *
27
- * @class
28
- * Class that provides methods to map and reuse the group header menu items.
29
- *
30
- * @extends sap.ui.base.Object
31
- * @author SAP SE
32
- * @version 1.131.1
33
- * @private
34
- * @alias sap.ui.table.menus.GroupHeaderContextMenuAdapter
35
- */
36
- const GroupHeaderContextMenuAdapter = BaseObject.extend("sap.ui.table.menus.GroupHeaderContextMenuAdapter", {
37
- constructor: function(oTable) {
38
- this._oTable = oTable;
39
- this._mItems = new Map();
40
- }
41
- });
42
-
43
- /**
44
- * Adds the predefined <code>MenuItems</code> to the given <code>Menu</code>. If no predefined <code>MenuItem</code> instances exist yet,
45
- * they are created. The predefined <code>MenuItem</code> instances will be updated according to the current state of the table.
46
- *
47
- * @param {sap.ui.unified.Menu} oMenu <code>Menu</code> to which the predefined <code>MenuItem</code> instances are added
48
- * @param {boolean} bExtended Flag that defines whether the menu is extended with additional items
49
- * @public
50
- */
51
- GroupHeaderContextMenuAdapter.prototype.addItemsTo = function(oMenu, bExtended) {
52
- if (!this._mItems.size) {
53
- this._createItems();
54
- }
55
-
56
- for (const [sKey, oMenuItem] of this._mItems.entries()) {
57
- if (!mDefaultItems.includes(sKey)) {
58
- oMenuItem.setVisible(!!bExtended);
59
- }
60
-
61
- if (!oMenu.getItems().includes(oMenuItem)) {
62
- oMenu.addItem(oMenuItem);
63
- }
64
- }
65
-
66
- if (!bExtended) {
67
- return;
68
- }
69
-
70
- const {column: oColumn, index: iIndex} = this._getGroupedColumnInfo();
71
- const [oMoveUp, oMoveDown] = this._mItems.get("move").getSubmenu().getItems();
72
- const oVisibilityItem = this._mItems.get("visibility");
73
-
74
- if (oColumn) {
75
- if (oColumn.getShowIfGrouped()) {
76
- oVisibilityItem.setText(TableUtils.getResourceText("TBL_HIDE_COLUMN"));
77
- } else {
78
- oVisibilityItem.setText(TableUtils.getResourceText("TBL_SHOW_COLUMN"));
79
- }
80
- oMoveUp.setEnabled(iIndex > 0);
81
- oMoveDown.setEnabled(iIndex < this._oTable._aGroupedColumns.length - 1);
82
- } else {
83
- oMoveUp.setEnabled(true);
84
- oMoveDown.setEnabled(true);
85
- }
86
- };
87
-
88
- /**
89
- * Removes all predefined <code>MenuItem</code> instances from the given <code>Menu</code>.
90
- *
91
- * @param {sap.ui.unified.Menu} oMenu <code>Menu</code> from which the predefined <code>MenuItem</code> instances are removed
92
- * @public
93
- */
94
- GroupHeaderContextMenuAdapter.prototype.removeItemsFrom = function(oMenu) {
95
- if (!this._mItems.size) {
96
- return;
97
- }
98
-
99
- for (const oMenuItem of this._mItems.values()) {
100
- oMenu.removeItem(oMenuItem);
101
- }
102
- };
103
-
104
- /**
105
- * Destroys the instance of the <code>GroupHeaderContextMenuAdapter</code>.
106
- *
107
- * @public
108
- */
109
- GroupHeaderContextMenuAdapter.prototype.destroy = function() {
110
- this._mItems?.forEach((oMenuItem) => oMenuItem.destroy());
111
- this._mItems?.clear();
112
- this._mItems = null;
113
- this._oTable = null;
114
- };
115
-
116
- /**
117
- * Creates predefined <code>MenuItem</code> instances for the group header context menu.
118
- *
119
- * @private
120
- */
121
- GroupHeaderContextMenuAdapter.prototype._createItems = function() {
122
- const oTable = this._oTable;
123
-
124
- this._mItems.set("ungroup", new MenuItem({
125
- text: TableUtils.getResourceText("TBL_UNGROUP"),
126
- submenu: [
127
- new Menu({
128
- items: [
129
- new MenuItem({
130
- text: TableUtils.getResourceText("TBL_UNGROUP_LEVEL"),
131
- select: () => {
132
- const {column: oColumn} = this._getGroupedColumnInfo();
133
-
134
- if (oColumn) {
135
- oColumn.setGrouped(false);
136
- oTable.fireGroup({
137
- column: oColumn,
138
- groupedColumns: oTable._aGroupedColumns,
139
- type: GroupEventType.ungroup
140
- });
141
- }
142
- }
143
- }),
144
- new MenuItem({
145
- text: TableUtils.getResourceText("TBL_UNGROUP_ALL"),
146
- select: () => {
147
- oTable.suspendUpdateAnalyticalInfo();
148
-
149
- for (const oColumn of oTable.getColumns()) {
150
- oColumn.setGrouped(false);
151
- }
152
-
153
- oTable.resumeUpdateAnalyticalInfo();
154
- oTable.fireGroup({column: undefined, groupedColumns: [], type: GroupEventType.ungroupAll});
155
- }
156
- })
157
- ]
158
- })
159
- ]
160
- }));
161
-
162
- this._mItems.set("collapse", new MenuItem({
163
- text: TableUtils.getResourceText("TBL_COLLAPSE"),
164
- icon: "sap-icon://collapse-all",
165
- submenu: [
166
- new Menu({
167
- items: [
168
- new MenuItem({
169
- text: TableUtils.getResourceText("TBL_COLLAPSE_LEVEL"),
170
- select: () => {
171
- // Why -1? Because the "Collapse Level" Menu Entry should collapse TO the given level - 1
172
- // So collapsing level 1 means actually all nodes up TO level 0 will be collapsed.
173
- // Potential negative values are handled by the binding.
174
- oTable.getBinding().collapseToLevel(oTable._iGroupedLevel - 1);
175
- oTable.setFirstVisibleRow(0); //scroll to top after collapsing (so no rows vanish)
176
- oTable._getSelectionPlugin().clearSelection();
177
- }
178
- }),
179
- new MenuItem({
180
- text: TableUtils.getResourceText("TBL_COLLAPSE_ALL"),
181
- select: () => {
182
- oTable.getBinding().collapseToLevel(0);
183
- oTable.setFirstVisibleRow(0); //scroll to top after collapsing (so no rows vanish)
184
- oTable._getSelectionPlugin().clearSelection();
185
- }
186
- })
187
- ]
188
- })
189
- ]
190
- }));
191
-
192
- this._mItems.set("expand", new MenuItem({
193
- text: TableUtils.getResourceText("TBL_EXPAND"),
194
- icon: "sap-icon://expand-all",
195
- submenu: [
196
- new Menu({
197
- items: [
198
- new MenuItem({
199
- text: TableUtils.getResourceText("TBL_EXPAND_LEVEL"),
200
- select: () => {
201
- oTable.getBinding().expandToLevel(oTable._iGroupedLevel);
202
- oTable.setFirstVisibleRow(0);
203
- oTable._getSelectionPlugin().clearSelection();
204
- }
205
- }),
206
- new MenuItem({
207
- text: TableUtils.getResourceText("TBL_EXPAND_ALL"),
208
- select: () => {
209
- oTable.expandAll();
210
- }
211
- })
212
- ]
213
- })
214
- ]
215
- }));
216
-
217
- this._mItems.set("visibility", new MenuItem({
218
- text: TableUtils.getResourceText("TBL_SHOW_COLUMN"),
219
- select: () => {
220
- const {column: oColumn} = this._getGroupedColumnInfo();
221
-
222
- if (oColumn) {
223
- const bShowIfGrouped = oColumn.getShowIfGrouped();
224
- oColumn.setShowIfGrouped(!bShowIfGrouped);
225
-
226
- oTable.fireGroup({
227
- column: oColumn,
228
- groupedColumns: oTable._aGroupedColumns,
229
- type: (!bShowIfGrouped ? GroupEventType.showGroupedColumn : GroupEventType.hideGroupedColumn)
230
- });
231
- }
232
- }
233
- }));
234
-
235
- this._mItems.set("move", new MenuItem({
236
- text: TableUtils.getResourceText("TBL_MOVE"),
237
- submenu: [
238
- new Menu({
239
- items: [
240
- new MenuItem({
241
- text: TableUtils.getResourceText("TBL_MOVE_UP"),
242
- icon: "sap-icon://arrow-top",
243
- select: () => {
244
- const {column: oColumn, index: iIndex} = this._getGroupedColumnInfo();
245
-
246
- if (oColumn && iIndex > 0) {
247
- oTable._aGroupedColumns[iIndex] =
248
- oTable._aGroupedColumns.splice(iIndex - 1, 1, oTable._aGroupedColumns[iIndex])[0];
249
-
250
- oTable.updateAnalyticalInfo();
251
- oTable.fireGroup({
252
- column: oColumn,
253
- groupedColumns: oTable._aGroupedColumns,
254
- type: GroupEventType.moveUp
255
- });
256
- }
257
- }
258
- }),
259
- new MenuItem({
260
- text: TableUtils.getResourceText("TBL_MOVE_DOWN"),
261
- icon: "sap-icon://arrow-bottom",
262
- select: () => {
263
- const {column: oColumn, index: iIndex} = this._getGroupedColumnInfo();
264
-
265
- if (oColumn && (iIndex < oTable._aGroupedColumns.length)) {
266
- oTable._aGroupedColumns[iIndex] =
267
- oTable._aGroupedColumns.splice(iIndex + 1, 1, oTable._aGroupedColumns[iIndex])[0];
268
-
269
- oTable.updateAnalyticalInfo();
270
- oTable.fireGroup({
271
- column: oColumn,
272
- groupedColumns: oTable._aGroupedColumns,
273
- type: GroupEventType.moveDown
274
- });
275
- }
276
- }
277
- })
278
- ]
279
- })
280
- ]
281
- }));
282
-
283
- this._mItems.set("sort", new MenuItem({
284
- text: TableUtils.getResourceText("TBL_SORT"),
285
- icon: "sap-icon://sort",
286
- submenu: [
287
- new Menu({
288
- items: [
289
- new MenuItem({
290
- text: TableUtils.getResourceText("TBL_SORT_ASC"),
291
- icon: "sap-icon://sort-ascending",
292
- select: () => {
293
- this._getGroupedColumnInfo().column?._sort(CoreLibrary.SortOrder.Ascending);
294
- }
295
- }),
296
- new MenuItem({
297
- text: TableUtils.getResourceText("TBL_SORT_DESC"),
298
- icon: "sap-icon://sort-descending",
299
- select: () => {
300
- this._getGroupedColumnInfo().column?._sort(CoreLibrary.SortOrder.Descending);
301
- }
302
- })
303
- ]
304
- })
305
- ]
306
- }));
307
- };
308
-
309
- /**
310
- * Identifies the level of the grouped column and returns an object with the index and the <code>Column</code> instance of the grouped column.
311
- *
312
- * @returns {object}
313
- * An object containing the <code>Column</code> and index of the grouped column. If no grouped column is found, the properties <code>column</code>
314
- * and <code>index</code> are <code>undefined</code>.
315
- */
316
- GroupHeaderContextMenuAdapter.prototype._getGroupedColumnInfo = function() {
317
- const oTable = this._oTable;
318
- const iIndex = oTable._iGroupedLevel - 1;
319
-
320
- const oGroupedColumn = oTable.getColumns().find(function(oColumn) {
321
- return oTable._aGroupedColumns[iIndex] === oColumn.getId();
322
- });
323
-
324
- return {
325
- column: oGroupedColumn,
326
- index: iIndex
327
- };
328
-
329
- };
330
-
331
- return GroupHeaderContextMenuAdapter;
332
- });