@openui5/sap.ui.table 1.117.1 → 1.118.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/src/sap/ui/table/.library +1 -1
- package/src/sap/ui/table/AnalyticalColumn.js +27 -25
- package/src/sap/ui/table/AnalyticalColumnMenu.js +6 -6
- package/src/sap/ui/table/AnalyticalTable.js +26 -9
- package/src/sap/ui/table/Column.js +22 -8
- package/src/sap/ui/table/ColumnMenu.js +1 -1
- package/src/sap/ui/table/CreationRow.js +1 -1
- package/src/sap/ui/table/Row.js +1 -1
- package/src/sap/ui/table/RowAction.js +1 -1
- package/src/sap/ui/table/RowActionItem.js +1 -1
- package/src/sap/ui/table/RowSettings.js +1 -1
- package/src/sap/ui/table/Table.js +93 -65
- package/src/sap/ui/table/TablePersoController.js +1 -1
- package/src/sap/ui/table/TableRenderer.js +12 -38
- package/src/sap/ui/table/TreeTable.js +4 -1
- package/src/sap/ui/table/designtime/Table.designtime.js +1 -1
- package/src/sap/ui/table/extensions/Accessibility.js +6 -5
- package/src/sap/ui/table/extensions/AccessibilityRender.js +1 -1
- package/src/sap/ui/table/extensions/DragAndDrop.js +1 -1
- package/src/sap/ui/table/extensions/ExtensionBase.js +1 -1
- package/src/sap/ui/table/extensions/Keyboard.js +1 -1
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +2 -2
- package/src/sap/ui/table/extensions/Pointer.js +3 -3
- package/src/sap/ui/table/extensions/Scrolling.js +1 -1
- package/src/sap/ui/table/extensions/ScrollingIOS.js +1 -1
- package/src/sap/ui/table/extensions/Synchronization.js +1 -1
- package/src/sap/ui/table/library.js +17 -14
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +1 -1
- package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +4 -3
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +10 -1
- package/src/sap/ui/table/plugins/BindingSelection.js +1 -1
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +24 -142
- package/src/sap/ui/table/plugins/ODataV4Selection.js +48 -172
- package/src/sap/ui/table/plugins/PluginBase.js +1 -1
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +1 -1
- package/src/sap/ui/table/plugins/SelectionPlugin.js +1 -1
- package/src/sap/ui/table/plugins/V4Aggregation.js +1 -1
- package/src/sap/ui/table/rowmodes/{AutoRowMode.js → Auto.js} +37 -11
- package/src/sap/ui/table/rowmodes/{FixedRowMode.js → Fixed.js} +28 -11
- package/src/sap/ui/table/rowmodes/{InteractiveRowMode.js → Interactive.js} +43 -24
- package/src/sap/ui/table/rowmodes/RowMode.js +42 -31
- package/src/sap/ui/table/rowmodes/Type.js +38 -0
- package/src/sap/ui/table/rowmodes/{VariableRowMode.js → Variable.js} +4 -18
- package/src/sap/ui/table/rules/Rows.support.js +3 -3
- package/src/sap/ui/table/utils/TableUtils.js +165 -4
- package/src/sap/ui/table/utils/_BindingUtils.js +1 -1
- package/src/sap/ui/table/utils/_ColumnUtils.js +1 -1
- package/src/sap/ui/table/utils/_GroupingUtils.js +2 -1
- package/src/sap/ui/table/utils/_HookUtils.js +1 -1
- package/src/sap/ui/table/utils/_MenuUtils.js +22 -14
|
@@ -4,13 +4,11 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"../library",
|
|
8
7
|
"../utils/TableUtils",
|
|
9
8
|
"sap/ui/core/Element",
|
|
10
9
|
"sap/ui/thirdparty/jquery",
|
|
11
10
|
"sap/ui/Device"
|
|
12
11
|
], function(
|
|
13
|
-
library,
|
|
14
12
|
TableUtils,
|
|
15
13
|
Element,
|
|
16
14
|
jQuery,
|
|
@@ -21,34 +19,27 @@ sap.ui.define([
|
|
|
21
19
|
var _private = TableUtils.createWeakMapFacade();
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
|
-
* Constructor for a new
|
|
22
|
+
* Constructor for a new <code>RowMode</code>.
|
|
25
23
|
*
|
|
26
24
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
27
25
|
* @param {object} [mSettings] initial settings for the new control
|
|
28
26
|
*
|
|
29
27
|
* @abstract
|
|
30
28
|
* @class
|
|
31
|
-
*
|
|
29
|
+
* Base class for row modes.
|
|
30
|
+
* Note: Do not create subclasses.
|
|
32
31
|
* @extends sap.ui.core.Element
|
|
33
32
|
* @constructor
|
|
34
|
-
* @alias sap
|
|
33
|
+
* @alias module:sap/ui/table/rowmodes/RowMode
|
|
35
34
|
* @private
|
|
36
|
-
* @ui5-restricted sap.ui.mdc
|
|
37
35
|
*
|
|
38
36
|
* @author SAP SE
|
|
39
|
-
* @version 1.
|
|
37
|
+
* @version 1.118.0
|
|
40
38
|
*/
|
|
41
39
|
var RowMode = Element.extend("sap.ui.table.rowmodes.RowMode", /** @lends sap.ui.table.rowmodes.RowMode.prototype */ {
|
|
42
40
|
metadata: {
|
|
43
41
|
library: "sap.ui.table",
|
|
44
|
-
"abstract": true
|
|
45
|
-
events: {
|
|
46
|
-
rowCountChange: {
|
|
47
|
-
parameters: {
|
|
48
|
-
count: {type: "int"}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}*/
|
|
42
|
+
"abstract": true
|
|
52
43
|
}
|
|
53
44
|
});
|
|
54
45
|
|
|
@@ -166,7 +157,7 @@ sap.ui.define([
|
|
|
166
157
|
* Gets the number of contexts that should be requested at least from the rows aggregation binding of the table.
|
|
167
158
|
*
|
|
168
159
|
* @returns {int} The minimum request length
|
|
169
|
-
* @
|
|
160
|
+
* @private
|
|
170
161
|
* @abstract
|
|
171
162
|
*/
|
|
172
163
|
RowMode.prototype.getMinRequestLength = function() {
|
|
@@ -179,7 +170,7 @@ sap.ui.define([
|
|
|
179
170
|
* The sum of <code>scrollable</code>, <code>fixedTop</code> and <code>fixedBottom</code> is equal to <code>count</code>.
|
|
180
171
|
*
|
|
181
172
|
* @returns {{count: int, scrollable: int, fixedTop: int, fixedBottom: int}} The computed counts
|
|
182
|
-
* @
|
|
173
|
+
* @private
|
|
183
174
|
* @abstract
|
|
184
175
|
*/
|
|
185
176
|
RowMode.prototype.getComputedRowCounts = function() {
|
|
@@ -191,7 +182,7 @@ sap.ui.define([
|
|
|
191
182
|
*
|
|
192
183
|
* @returns {{height: sap.ui.core.CSSSize?, minHeight: sap.ui.core.CSSSize?, maxHeight: sap.ui.core.CSSSize?}}
|
|
193
184
|
* The styles the table should have
|
|
194
|
-
* @
|
|
185
|
+
* @private
|
|
195
186
|
* @abstract
|
|
196
187
|
*/
|
|
197
188
|
RowMode.prototype.getTableStyles = function() {
|
|
@@ -204,11 +195,11 @@ sap.ui.define([
|
|
|
204
195
|
*
|
|
205
196
|
* @returns {{height: sap.ui.core.CSSSize?}|undefined}
|
|
206
197
|
* The styles the table's bottom placeholder should have
|
|
207
|
-
* @
|
|
198
|
+
* @private
|
|
208
199
|
* @abstract
|
|
209
200
|
*/
|
|
210
201
|
RowMode.prototype.getTableBottomPlaceholderStyles = function() {
|
|
211
|
-
|
|
202
|
+
return undefined;
|
|
212
203
|
};
|
|
213
204
|
|
|
214
205
|
/**
|
|
@@ -216,7 +207,7 @@ sap.ui.define([
|
|
|
216
207
|
*
|
|
217
208
|
* @returns {{height: sap.ui.core.CSSSize?, minHeight: sap.ui.core.CSSSize?, maxHeight: sap.ui.core.CSSSize?}}
|
|
218
209
|
* The styles the row container should have
|
|
219
|
-
* @
|
|
210
|
+
* @private
|
|
220
211
|
* @abstract
|
|
221
212
|
*/
|
|
222
213
|
RowMode.prototype.getRowContainerStyles = function() {
|
|
@@ -227,7 +218,7 @@ sap.ui.define([
|
|
|
227
218
|
* Gets the parent table.
|
|
228
219
|
*
|
|
229
220
|
* @returns {sap.ui.table.Table|null} The instance of the table or <code>null</code>.
|
|
230
|
-
* @
|
|
221
|
+
* @private
|
|
231
222
|
*/
|
|
232
223
|
RowMode.prototype.getTable = function() {
|
|
233
224
|
var oParent = this.getParent();
|
|
@@ -237,7 +228,7 @@ sap.ui.define([
|
|
|
237
228
|
/**
|
|
238
229
|
* Updates the table's rows aggregation according to the current computed row count, and updates the rows binding contexts.
|
|
239
230
|
*
|
|
240
|
-
* @
|
|
231
|
+
* @private
|
|
241
232
|
*/
|
|
242
233
|
RowMode.prototype.updateTable = function(sReason /* private parameter */) {
|
|
243
234
|
var oTable = this.getTable();
|
|
@@ -279,7 +270,7 @@ sap.ui.define([
|
|
|
279
270
|
*
|
|
280
271
|
* @returns {int} The base row content height in pixels.
|
|
281
272
|
* @see {@link sap.ui.table.rowmodes.RowMode#getBaseRowHeightOfTable}
|
|
282
|
-
* @
|
|
273
|
+
* @private
|
|
283
274
|
*/
|
|
284
275
|
RowMode.prototype.getBaseRowContentHeight = function() {
|
|
285
276
|
return 0;
|
|
@@ -292,7 +283,7 @@ sap.ui.define([
|
|
|
292
283
|
*
|
|
293
284
|
* @returns {int} The base row height in pixels.
|
|
294
285
|
* @see {@link sap.ui.table.rowmodes.RowMode#getBaseRowContentHeight}
|
|
295
|
-
* @
|
|
286
|
+
* @private
|
|
296
287
|
*/
|
|
297
288
|
RowMode.prototype.getBaseRowHeightOfTable = function() {
|
|
298
289
|
var oTable = this.getTable();
|
|
@@ -314,7 +305,7 @@ sap.ui.define([
|
|
|
314
305
|
* Gets total row count of the table. Returns 0 if this mode is not child of a table.
|
|
315
306
|
*
|
|
316
307
|
* @returns {int} The total row count.
|
|
317
|
-
* @
|
|
308
|
+
* @private
|
|
318
309
|
*/
|
|
319
310
|
RowMode.prototype.getTotalRowCountOfTable = function() {
|
|
320
311
|
var oTable = this.getTable();
|
|
@@ -433,7 +424,7 @@ sap.ui.define([
|
|
|
433
424
|
* @param {int} iFixedTop The fixed top row count.
|
|
434
425
|
* @param {int} iFixedBottom The fixed bottom row count.
|
|
435
426
|
* @returns {{count: int, scrollable: int, fixedTop: int, fixedBottom: int}} The standardized counts
|
|
436
|
-
* @
|
|
427
|
+
* @private
|
|
437
428
|
*/
|
|
438
429
|
RowMode.prototype.computeStandardizedRowCounts = function(iCount, iFixedTop, iFixedBottom) {
|
|
439
430
|
var mRowCountConstraints = this.getRowCountConstraints();
|
|
@@ -494,7 +485,7 @@ sap.ui.define([
|
|
|
494
485
|
* </ul>
|
|
495
486
|
*
|
|
496
487
|
* @returns {{fixedTop: (boolean|undefined), fixedBottom: (boolean|undefined)}} The row count constraints
|
|
497
|
-
* @
|
|
488
|
+
* @private
|
|
498
489
|
*/
|
|
499
490
|
RowMode.prototype.getRowCountConstraints = function() {
|
|
500
491
|
// TODO: Add a type definition for a protected type "rowCountConstraints" in the library file to document the return value
|
|
@@ -519,6 +510,26 @@ sap.ui.define([
|
|
|
519
510
|
*/
|
|
520
511
|
RowMode.prototype.renderCellContentStyles = function(oRM) {};
|
|
521
512
|
|
|
513
|
+
/**
|
|
514
|
+
* Renders something at the bottom of the table.
|
|
515
|
+
*
|
|
516
|
+
* @param {sap.ui.core.RenderManager} oRM The render manager.
|
|
517
|
+
* @private
|
|
518
|
+
*/
|
|
519
|
+
RowMode.prototype.renderInTableBottomArea = function(oRM) {
|
|
520
|
+
var mPlaceholderHeight = this.getTableBottomPlaceholderStyles();
|
|
521
|
+
|
|
522
|
+
if (mPlaceholderHeight === undefined) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
oRM.openStart("div", this.getTable().getId() + "-placeholder-bottom");
|
|
527
|
+
oRM.class("sapUiTablePlaceholder");
|
|
528
|
+
this.applyTableBottomPlaceholderStyles(oRM);
|
|
529
|
+
oRM.openEnd();
|
|
530
|
+
oRM.close("div");
|
|
531
|
+
};
|
|
532
|
+
|
|
522
533
|
/**
|
|
523
534
|
* This method can be used after a binding refresh to asynchronously create rows after the data request was sent by the binding.
|
|
524
535
|
* The rows are added to the table's rows aggregation. No binding contexts are set for the rows. If the table already has rows, no action is
|
|
@@ -712,7 +723,7 @@ sap.ui.define([
|
|
|
712
723
|
* {@link sap.ui.table.Table#getShowNoData showNoData} is set to <code>true</code>. The text is hidden if it is currently shown. Has no effect for
|
|
713
724
|
* the text that is shown when the table has no visible columns.
|
|
714
725
|
*
|
|
715
|
-
* @
|
|
726
|
+
* @private
|
|
716
727
|
*/
|
|
717
728
|
RowMode.prototype.disableNoData = function() {
|
|
718
729
|
if (this.isNoDataDisabled()) {
|
|
@@ -731,7 +742,7 @@ sap.ui.define([
|
|
|
731
742
|
* Enables the "NoData" text of the table. Whether the text is shown depends on the state of the table and its
|
|
732
743
|
* {@link sap.ui.table.Table#getShowNoData showNoData} property.
|
|
733
744
|
*
|
|
734
|
-
* @
|
|
745
|
+
* @private
|
|
735
746
|
*/
|
|
736
747
|
RowMode.prototype.enableNoData = function() {
|
|
737
748
|
if (!this.isNoDataDisabled()) {
|
|
@@ -750,7 +761,7 @@ sap.ui.define([
|
|
|
750
761
|
* Checks whether the "NoData" text of the table is disabled.
|
|
751
762
|
*
|
|
752
763
|
* @returns {boolean} Whether the "NoData" text is disabled
|
|
753
|
-
* @
|
|
764
|
+
* @private
|
|
754
765
|
*/
|
|
755
766
|
RowMode.prototype.isNoDataDisabled = function() {
|
|
756
767
|
return _private(this).bNoDataDisabled;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* OpenUI5
|
|
3
|
+
* (c) Copyright 2009-2023 SAP SE or an SAP affiliate company.
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
|
+
*/
|
|
6
|
+
sap.ui.define(function() {
|
|
7
|
+
"use strict";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Defines the row mode.
|
|
11
|
+
*
|
|
12
|
+
* @enum {string}
|
|
13
|
+
* @alias sap.ui.table.rowmodes.Type
|
|
14
|
+
* @private
|
|
15
|
+
*/
|
|
16
|
+
var Type = {
|
|
17
|
+
/**
|
|
18
|
+
* Equivalent to the default configuration of {@link module:sap/ui/table/rowmodes/Fixed}
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
Fixed: "Fixed",
|
|
23
|
+
/**
|
|
24
|
+
* Equivalent to the default configuration of {@link module:sap/ui/table/rowmodes/Auto}
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
28
|
+
Auto: "Auto",
|
|
29
|
+
/**
|
|
30
|
+
* Equivalent to the default configuration of {@link module:sap/ui/table/rowmodes/Interactive}
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
Interactive: "Interactive"
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
return Type;
|
|
38
|
+
}, /* bExport= */ true);
|
|
@@ -20,17 +20,17 @@ sap.ui.define([
|
|
|
20
20
|
*
|
|
21
21
|
* @class
|
|
22
22
|
* // TODO: Class description
|
|
23
|
-
* @extends sap
|
|
23
|
+
* @extends module:sap/ui/table/rowmodes/RowMode
|
|
24
24
|
*
|
|
25
25
|
* @author SAP SE
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.118.0
|
|
27
27
|
*
|
|
28
28
|
* @constructor
|
|
29
29
|
* @private
|
|
30
30
|
* @experimental
|
|
31
|
-
* @alias sap
|
|
31
|
+
* @alias module:sap/ui/table/rowmodes/Variable
|
|
32
32
|
*/
|
|
33
|
-
var VariableRowMode = RowMode.extend("sap.ui.table.rowmodes.
|
|
33
|
+
var VariableRowMode = RowMode.extend("sap.ui.table.rowmodes.Variable", {
|
|
34
34
|
metadata: {
|
|
35
35
|
library: "sap.ui.table",
|
|
36
36
|
properties: {
|
|
@@ -64,20 +64,6 @@ sap.ui.define([
|
|
|
64
64
|
};
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
/**
|
|
68
|
-
* @inheritDoc
|
|
69
|
-
*/
|
|
70
|
-
VariableRowMode.prototype.getComputedRowCounts = function() {
|
|
71
|
-
var iTotalRowCount = this.getTotalRowCountOfTable();
|
|
72
|
-
var iRowCount = this.getHideEmptyRows() ? Math.min(this.getRowCount(), iTotalRowCount) : this.getRowCount();
|
|
73
|
-
|
|
74
|
-
return {
|
|
75
|
-
count: iRowCount,
|
|
76
|
-
fixedTopCount: this.getFixedTopRowCount(),
|
|
77
|
-
fixedBottomCount: this.getFixedBottomRowCount()
|
|
78
|
-
};
|
|
79
|
-
};
|
|
80
|
-
|
|
81
67
|
/**
|
|
82
68
|
* @inheritDoc
|
|
83
69
|
*/
|
|
@@ -164,12 +164,12 @@ sap.ui.define([
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
function checkConfiguration(oTable, oDynamicPage) {
|
|
167
|
-
if (oTable._getRowMode().isA("sap.ui.table.rowmodes.
|
|
167
|
+
if (oTable._getRowMode().isA("sap.ui.table.rowmodes.Auto") && !oDynamicPage.getFitContent()) {
|
|
168
168
|
SupportHelper.reportIssue(oIssueManager,
|
|
169
169
|
"A table with an auto row mode is placed inside a sap.f.DynamicPage with fitContent=\"false\"",
|
|
170
170
|
Severity.High, oTable.getId());
|
|
171
|
-
} else if ((oTable._getRowMode().isA("sap.ui.table.rowmodes.
|
|
172
|
-
|| oTable._getRowMode().isA("sap.ui.table.rowmodes.
|
|
171
|
+
} else if ((oTable._getRowMode().isA("sap.ui.table.rowmodes.Fixed")
|
|
172
|
+
|| oTable._getRowMode().isA("sap.ui.table.rowmodes.Interactive"))
|
|
173
173
|
&& oDynamicPage.getFitContent()) {
|
|
174
174
|
SupportHelper.reportIssue(oIssueManager,
|
|
175
175
|
"A table with a fixed or interactive row mode is placed inside a sap.f.DynamicPage with fitContent=\"true\"",
|
|
@@ -16,9 +16,11 @@ sap.ui.define([
|
|
|
16
16
|
"sap/ui/core/ResizeHandler",
|
|
17
17
|
"sap/ui/core/library",
|
|
18
18
|
"sap/ui/core/theming/Parameters",
|
|
19
|
+
"sap/ui/core/Icon",
|
|
19
20
|
"sap/ui/model/ChangeReason",
|
|
20
21
|
"sap/ui/thirdparty/jquery",
|
|
21
|
-
"sap/base/util/restricted/_throttle"
|
|
22
|
+
"sap/base/util/restricted/_throttle",
|
|
23
|
+
"sap/base/Log"
|
|
22
24
|
], function(
|
|
23
25
|
GroupingUtils,
|
|
24
26
|
ColumnUtils,
|
|
@@ -30,9 +32,11 @@ sap.ui.define([
|
|
|
30
32
|
ResizeHandler,
|
|
31
33
|
coreLibrary,
|
|
32
34
|
ThemeParameters,
|
|
35
|
+
Icon,
|
|
33
36
|
ChangeReason,
|
|
34
37
|
jQuery,
|
|
35
|
-
throttle
|
|
38
|
+
throttle,
|
|
39
|
+
Log
|
|
36
40
|
) {
|
|
37
41
|
"use strict";
|
|
38
42
|
|
|
@@ -203,7 +207,7 @@ sap.ui.define([
|
|
|
203
207
|
* Static collection of utility functions related to the sap.ui.table.Table, ...
|
|
204
208
|
*
|
|
205
209
|
* @author SAP SE
|
|
206
|
-
* @version 1.
|
|
210
|
+
* @version 1.118.0
|
|
207
211
|
* @namespace
|
|
208
212
|
* @alias sap.ui.table.utils.TableUtils
|
|
209
213
|
* @private
|
|
@@ -337,7 +341,7 @@ sap.ui.define([
|
|
|
337
341
|
* @returns {boolean} Whether the no data text is shown.
|
|
338
342
|
*/
|
|
339
343
|
isNoDataVisible: function(oTable) {
|
|
340
|
-
return oTable.getShowNoData() && !oTable._getRowMode().isNoDataDisabled() && !TableUtils.hasData(oTable)
|
|
344
|
+
return oTable.getShowNoData() && (oTable._getRowMode() && !oTable._getRowMode().isNoDataDisabled()) && !TableUtils.hasData(oTable)
|
|
341
345
|
|| TableUtils.getVisibleColumnCount(oTable) === 0;
|
|
342
346
|
},
|
|
343
347
|
|
|
@@ -578,6 +582,138 @@ sap.ui.define([
|
|
|
578
582
|
}
|
|
579
583
|
},
|
|
580
584
|
|
|
585
|
+
/**
|
|
586
|
+
* Scrolls the table to the <code>iIndex</code>.
|
|
587
|
+
* If <code>bReverse</code> is true the <code>firstVisibleRow</code> property of the Table is set to <code>iIndex</code> - 1,
|
|
588
|
+
* otherwise to <code>iIndex</code> - row count + 2.
|
|
589
|
+
*
|
|
590
|
+
* @param {sap.ui.table.Table} oTable Instance of the table.
|
|
591
|
+
* @param {int} iIndex The index of the row to which to scroll to.
|
|
592
|
+
* @param {boolean} bReverse Whether the row should be displayed at the bottom of the table.
|
|
593
|
+
* @returns {Promise} A promise that resolves when the table is scrolled.
|
|
594
|
+
*/
|
|
595
|
+
scrollTableToIndex: function(oTable, iIndex, bReverse) {
|
|
596
|
+
if (!oTable) {
|
|
597
|
+
return Promise.resolve();
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
var iFirstVisibleRow = oTable.getFirstVisibleRow();
|
|
601
|
+
var mRowCounts = oTable._getRowCounts();
|
|
602
|
+
var iLastVisibleRow = iFirstVisibleRow + mRowCounts.scrollable - 1;
|
|
603
|
+
var bExpectRowsUpdatedEvent = false;
|
|
604
|
+
|
|
605
|
+
if (iIndex < iFirstVisibleRow || iIndex > iLastVisibleRow) {
|
|
606
|
+
var iNewIndex = bReverse ? iIndex - mRowCounts.fixedTop - 1 : iIndex - mRowCounts.scrollable - mRowCounts.fixedTop + 2;
|
|
607
|
+
|
|
608
|
+
bExpectRowsUpdatedEvent = oTable._setFirstVisibleRowIndex(Math.max(0, iNewIndex));
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
return new Promise(function(resolve) {
|
|
612
|
+
if (bExpectRowsUpdatedEvent) {
|
|
613
|
+
oTable.attachEventOnce("rowsUpdated", resolve);
|
|
614
|
+
} else {
|
|
615
|
+
resolve();
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
},
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* Displays a notification Popover beside the row selector that indicates a limited selection. The given index
|
|
622
|
+
* references the index of the data context in the binding.
|
|
623
|
+
*
|
|
624
|
+
* @param {sap.ui.table.Table} oTable Instance of the table.
|
|
625
|
+
* @param {number} iIndex Index of the data context
|
|
626
|
+
* @param {number} iLimit Maximum number of rows that can be selected at once
|
|
627
|
+
* @returns {Promise} A Promise that resolves after the notification popover has been opened
|
|
628
|
+
*/
|
|
629
|
+
showNotificationPopoverAtIndex: function(oTable, iIndex, iLimit) {
|
|
630
|
+
var oPopover = oTable._oNotificationPopover;
|
|
631
|
+
var oRow = oTable.getRows()[iIndex - oTable._getFirstRenderedRowIndex()];
|
|
632
|
+
var sTitle = TableUtils.getResourceText("TBL_SELECT_LIMIT_TITLE");
|
|
633
|
+
var sMessage = TableUtils.getResourceText("TBL_SELECT_LIMIT", [iLimit]);
|
|
634
|
+
|
|
635
|
+
return new Promise(function(resolve) {
|
|
636
|
+
sap.ui.require([
|
|
637
|
+
"sap/m/Popover", "sap/m/Bar", "sap/m/Title", "sap/m/Text", "sap/m/HBox", "sap/ui/core/library", "sap/m/library"
|
|
638
|
+
], function(Popover, Bar, Title, Text, HBox, coreLib, mLib) {
|
|
639
|
+
if (!oPopover) {
|
|
640
|
+
oPopover = new Popover(oTable.getId() + "-notificationPopover", {
|
|
641
|
+
customHeader: [
|
|
642
|
+
new Bar({
|
|
643
|
+
contentMiddle: [
|
|
644
|
+
new HBox({
|
|
645
|
+
items: [
|
|
646
|
+
new Icon({src: "sap-icon://message-warning", color: coreLib.IconColor.Critical})
|
|
647
|
+
.addStyleClass("sapUiTinyMarginEnd"),
|
|
648
|
+
new Title({text: sTitle, level: coreLib.TitleLevel.H2})
|
|
649
|
+
],
|
|
650
|
+
renderType: mLib.FlexRendertype.Bare,
|
|
651
|
+
justifyContent: mLib.FlexJustifyContent.Center,
|
|
652
|
+
alignItems: mLib.FlexAlignItems.Center
|
|
653
|
+
})
|
|
654
|
+
]
|
|
655
|
+
})
|
|
656
|
+
],
|
|
657
|
+
content: new Text({text: sMessage})
|
|
658
|
+
});
|
|
659
|
+
|
|
660
|
+
oPopover.addStyleClass("sapUiContentPadding");
|
|
661
|
+
oTable._oNotificationPopover = oPopover;
|
|
662
|
+
oTable.addAggregation("_hiddenDependents", oTable._oNotificationPopover);
|
|
663
|
+
} else {
|
|
664
|
+
oPopover.getContent()[0].setText(sMessage);
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
oTable.detachFirstVisibleRowChanged(this.onFirstVisibleRowChange, this);
|
|
668
|
+
oTable.attachFirstVisibleRowChanged(this.onFirstVisibleRowChange, this);
|
|
669
|
+
|
|
670
|
+
var oRowSelector = oRow.getDomRefs().rowSelector;
|
|
671
|
+
|
|
672
|
+
if (oRowSelector) {
|
|
673
|
+
oPopover.attachEventOnce("afterOpen", resolve);
|
|
674
|
+
oPopover.openBy(oRowSelector);
|
|
675
|
+
} else {
|
|
676
|
+
resolve();
|
|
677
|
+
}
|
|
678
|
+
}.bind(this));
|
|
679
|
+
}.bind(this));
|
|
680
|
+
},
|
|
681
|
+
|
|
682
|
+
onFirstVisibleRowChange: function(oEvent) {
|
|
683
|
+
var oTable = oEvent.getSource();
|
|
684
|
+
if (!oTable._oNotificationPopover) {
|
|
685
|
+
return;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
if (oTable) {
|
|
689
|
+
oTable.detachFirstVisibleRowChanged(this.onFirstVisibleRowChange, oTable);
|
|
690
|
+
}
|
|
691
|
+
oTable._oNotificationPopover.close();
|
|
692
|
+
},
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Loads <code>iLength</code> binding contexts starting from index <code>iStartIndex</code>.
|
|
696
|
+
*
|
|
697
|
+
* @param {object} oBinding The binding
|
|
698
|
+
* @param {int} iStartIndex The starting index
|
|
699
|
+
* @param {int} iLength The length
|
|
700
|
+
* @returns {Promise<sap.ui.model.Context[]>} Promise that resolves with the row contexts once they are loaded.
|
|
701
|
+
*/
|
|
702
|
+
loadContexts: function(oBinding, iStartIndex, iLength) {
|
|
703
|
+
var aContexts = oBinding.getContexts(iStartIndex, iLength, 0, true);
|
|
704
|
+
var bContextsAvailable = aContexts.length === Math.min(iLength, oBinding.getLength()) && !aContexts.includes(undefined);
|
|
705
|
+
|
|
706
|
+
if (bContextsAvailable) {
|
|
707
|
+
return Promise.resolve(aContexts);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
return new Promise(function(resolve) {
|
|
711
|
+
oBinding.attachEventOnce("dataReceived", function() {
|
|
712
|
+
resolve(this.loadContexts(oBinding, iStartIndex, iLength));
|
|
713
|
+
}.bind(this));
|
|
714
|
+
}.bind(this));
|
|
715
|
+
},
|
|
716
|
+
|
|
581
717
|
/**
|
|
582
718
|
* The following rules apply for the cell information.
|
|
583
719
|
* <ul>
|
|
@@ -1421,6 +1557,31 @@ sap.ui.define([
|
|
|
1421
1557
|
|
|
1422
1558
|
return oWeakMap.get(oKey);
|
|
1423
1559
|
};
|
|
1560
|
+
},
|
|
1561
|
+
|
|
1562
|
+
/**
|
|
1563
|
+
* Returns the active Table helper.
|
|
1564
|
+
*
|
|
1565
|
+
* @param {boolean} bCallByAPI Whether the call is initiated by an API setting
|
|
1566
|
+
* @throws Error when no Table helper can be found.
|
|
1567
|
+
* @returns {object} Table helper
|
|
1568
|
+
*/
|
|
1569
|
+
_getTableTemplateHelper: function(bCallByAPI) {
|
|
1570
|
+
var sMessage = "An automatic control and template generation for the sap.ui.table.Table is not supported " +
|
|
1571
|
+
"anymore for the aggragations footer and title and the aggregations label and template of " +
|
|
1572
|
+
"the sap.ui.table.Columns. Use concrete controls for those aggregations instead of altType string.";
|
|
1573
|
+
|
|
1574
|
+
/**
|
|
1575
|
+
* @deprecated As of version 1.118
|
|
1576
|
+
*/
|
|
1577
|
+
if (library.TableHelper) {
|
|
1578
|
+
if (!bCallByAPI) {
|
|
1579
|
+
Log.warning(sMessage);
|
|
1580
|
+
}
|
|
1581
|
+
return library.TableHelper;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
throw new Error(sMessage);
|
|
1424
1585
|
}
|
|
1425
1586
|
};
|
|
1426
1587
|
|
|
@@ -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.
|
|
17
|
+
* @version 1.118.0
|
|
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.
|
|
21
|
+
* @version 1.118.0
|
|
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.
|
|
26
|
+
* @version 1.118.0
|
|
27
27
|
* @namespace
|
|
28
28
|
* @alias sap.ui.table.utils._GroupingUtils
|
|
29
29
|
* @private
|
|
@@ -425,6 +425,7 @@ sap.ui.define([
|
|
|
425
425
|
* Initializes the experimental grouping for sap.ui.table.Table.
|
|
426
426
|
*
|
|
427
427
|
* @param {sap.ui.table.Table} oTable Instance of the table.
|
|
428
|
+
* @deprecated As of version 1.118.
|
|
428
429
|
*/
|
|
429
430
|
setupExperimentalGrouping: function(oTable) {
|
|
430
431
|
if (!oTable.getEnableGrouping()) {
|
|
@@ -22,7 +22,7 @@ sap.ui.define(["sap/ui/base/DataType"], function(DataType) {
|
|
|
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.
|
|
25
|
+
* @version 1.118.0
|
|
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.
|
|
42
|
+
* @version 1.118.0
|
|
43
43
|
* @namespace
|
|
44
44
|
* @alias sap.ui.table.utils._MenuUtils
|
|
45
45
|
* @private
|
|
@@ -103,6 +103,9 @@ sap.ui.define([
|
|
|
103
103
|
oRowBindingContext = oRow.getBindingContext(oRowBindingInfo.model);
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/**
|
|
107
|
+
* @deprecated As of version 1.21.0
|
|
108
|
+
*/
|
|
106
109
|
if (iColumnIndex >= 0) {
|
|
107
110
|
bExecuteDefault = oTable.fireCellContextmenu({
|
|
108
111
|
rowIndex: oRow.getIndex(),
|
|
@@ -114,21 +117,26 @@ sap.ui.define([
|
|
|
114
117
|
});
|
|
115
118
|
}
|
|
116
119
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated As of version 1.21.0
|
|
122
|
+
*/
|
|
123
|
+
if (!bExecuteDefault) {
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
120
126
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
127
|
+
// fire beforeOpenContextMenu event
|
|
128
|
+
var oRowContextMenu = oTable.getContextMenu();
|
|
124
129
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
columnIndex: oRowColCell.column ? iColumnIndex : null,
|
|
128
|
-
contextMenu: oRowContextMenu
|
|
129
|
-
});
|
|
130
|
+
if (oRowContextMenu && oRowBindingInfo) {
|
|
131
|
+
oRowContextMenu.setBindingContext(oRowBindingContext, oRowBindingInfo.model);
|
|
130
132
|
}
|
|
131
133
|
|
|
134
|
+
bExecuteDefault = oTable.fireBeforeOpenContextMenu({
|
|
135
|
+
rowIndex: oRow.getIndex(),
|
|
136
|
+
columnIndex: oRowColCell.column ? iColumnIndex : null,
|
|
137
|
+
contextMenu: oRowContextMenu
|
|
138
|
+
});
|
|
139
|
+
|
|
132
140
|
if (bExecuteDefault) {
|
|
133
141
|
return MenuUtils._openContentCellContextMenu(oTable, oCell, oEvent);
|
|
134
142
|
} else {
|
|
@@ -287,7 +295,7 @@ sap.ui.define([
|
|
|
287
295
|
*/
|
|
288
296
|
_closeCustomContentCellContextMenu: function(oTable) {
|
|
289
297
|
var oCustomMenu = oTable.getContextMenu();
|
|
290
|
-
var bCustomContextMenuOpen = oCustomMenu ? oCustomMenu.
|
|
298
|
+
var bCustomContextMenuOpen = oCustomMenu ? oCustomMenu.isOpen() : false;
|
|
291
299
|
|
|
292
300
|
if (bCustomContextMenuOpen) {
|
|
293
301
|
oCustomMenu.close();
|
|
@@ -302,7 +310,7 @@ sap.ui.define([
|
|
|
302
310
|
*/
|
|
303
311
|
_closeDefaultContentCellContextMenu: function(oTable) {
|
|
304
312
|
var oDefaultMenu = oTable._oCellContextMenu;
|
|
305
|
-
var bDefaultMenuOpen = oDefaultMenu ? oDefaultMenu.
|
|
313
|
+
var bDefaultMenuOpen = oDefaultMenu ? oDefaultMenu.isOpen() : false;
|
|
306
314
|
|
|
307
315
|
if (bDefaultMenuOpen) {
|
|
308
316
|
oDefaultMenu.close();
|