@openui5/sap.ui.table 1.96.2 → 1.98.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/.reuse/dep5 +26 -31
- package/THIRDPARTY.txt +15 -21
- package/package.json +3 -3
- package/src/sap/ui/table/.library +2 -2
- package/src/sap/ui/table/AnalyticalColumn.js +2 -2
- package/src/sap/ui/table/AnalyticalColumnMenu.js +2 -2
- package/src/sap/ui/table/AnalyticalColumnMenuRenderer.js +1 -1
- package/src/sap/ui/table/AnalyticalTable.js +13 -26
- package/src/sap/ui/table/AnalyticalTableRenderer.js +1 -1
- package/src/sap/ui/table/Column.js +21 -3
- package/src/sap/ui/table/ColumnMenu.js +2 -2
- package/src/sap/ui/table/ColumnMenuRenderer.js +1 -1
- package/src/sap/ui/table/CreationRow.js +8 -4
- package/src/sap/ui/table/CreationRowRenderer.js +1 -1
- package/src/sap/ui/table/Row.js +2 -2
- package/src/sap/ui/table/RowAction.js +2 -2
- package/src/sap/ui/table/RowActionItem.js +2 -2
- package/src/sap/ui/table/RowActionRenderer.js +1 -1
- package/src/sap/ui/table/RowSettings.js +2 -2
- package/src/sap/ui/table/Table.js +126 -150
- package/src/sap/ui/table/TablePersoController.js +2 -2
- package/src/sap/ui/table/TableRenderer.js +25 -37
- package/src/sap/ui/table/TreeTable.js +26 -10
- package/src/sap/ui/table/TreeTableRenderer.js +1 -1
- package/src/sap/ui/table/designtime/AnalyticalTable.designtime.js +1 -1
- package/src/sap/ui/table/designtime/Table.designtime.js +1 -1
- package/src/sap/ui/table/designtime/library.designtime.js +1 -1
- package/src/sap/ui/table/extensions/Accessibility.js +9 -4
- package/src/sap/ui/table/extensions/AccessibilityRender.js +2 -2
- package/src/sap/ui/table/extensions/DragAndDrop.js +2 -2
- package/src/sap/ui/table/extensions/ExtensionBase.js +2 -2
- package/src/sap/ui/table/extensions/Keyboard.js +7 -3
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +5 -5
- package/src/sap/ui/table/extensions/Pointer.js +2 -2
- package/src/sap/ui/table/extensions/Scrolling.js +13 -50
- package/src/sap/ui/table/extensions/ScrollingIOS.js +14 -62
- package/src/sap/ui/table/extensions/Synchronization.js +3 -3
- package/src/sap/ui/table/library.js +11 -11
- package/src/sap/ui/table/library.support.js +1 -1
- package/src/sap/ui/table/messagebundle_it.properties +8 -8
- package/src/sap/ui/table/messagebundle_pl.properties +1 -1
- package/src/sap/ui/table/plugins/BindingSelection.js +2 -2
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +1 -1
- package/src/sap/ui/table/plugins/PluginBase.js +2 -2
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +10 -18
- package/src/sap/ui/table/plugins/SelectionPlugin.js +2 -2
- package/src/sap/ui/table/plugins/V4Aggregation.js +3 -5
- package/src/sap/ui/table/rowmodes/AutoRowMode.js +6 -8
- package/src/sap/ui/table/rowmodes/FixedRowMode.js +3 -3
- package/src/sap/ui/table/rowmodes/InteractiveRowMode.js +3 -3
- package/src/sap/ui/table/rowmodes/RowMode.js +5 -11
- package/src/sap/ui/table/rowmodes/VariableRowMode.js +2 -2
- package/src/sap/ui/table/rules/Accessibility.support.js +1 -1
- package/src/sap/ui/table/rules/Binding.support.js +1 -1
- package/src/sap/ui/table/rules/ColumnTemplate.support.js +1 -1
- package/src/sap/ui/table/rules/Plugins.support.js +1 -1
- package/src/sap/ui/table/rules/Rows.support.js +1 -1
- package/src/sap/ui/table/rules/TableHelper.support.js +1 -1
- package/src/sap/ui/table/themes/base/Scrolling.less +18 -38
- package/src/sap/ui/table/themes/base/ScrollingIOS.less +11 -19
- package/src/sap/ui/table/themes/base/library.source.less +1 -1
- package/src/sap/ui/table/themes/sap_hcb/library.source.less +1 -1
- package/src/sap/ui/table/utils/TableUtils.js +2 -30
- package/src/sap/ui/table/utils/_BindingUtils.js +2 -2
- package/src/sap/ui/table/utils/_ColumnUtils.js +2 -2
- package/src/sap/ui/table/utils/_GroupingUtils.js +3 -3
- package/src/sap/ui/table/utils/_HookUtils.js +2 -2
- package/src/sap/ui/table/utils/_MenuUtils.js +15 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
sap.ui.define([
|
|
9
9
|
'sap/ui/Device',
|
|
10
10
|
'sap/ui/core/Control',
|
|
11
|
-
'sap/ui/core/IconPool',
|
|
12
11
|
'sap/ui/core/util/PasteHelper',
|
|
13
12
|
'sap/ui/model/ChangeReason',
|
|
14
13
|
'sap/ui/model/Filter',
|
|
@@ -35,7 +34,6 @@ sap.ui.define([
|
|
|
35
34
|
function(
|
|
36
35
|
Device,
|
|
37
36
|
Control,
|
|
38
|
-
IconPool,
|
|
39
37
|
PasteHelper,
|
|
40
38
|
ChangeReason,
|
|
41
39
|
Filter,
|
|
@@ -94,7 +92,7 @@ sap.ui.define([
|
|
|
94
92
|
* the data model and binding being used.
|
|
95
93
|
* </p>
|
|
96
94
|
* @extends sap.ui.core.Control
|
|
97
|
-
* @version 1.
|
|
95
|
+
* @version 1.98.0
|
|
98
96
|
*
|
|
99
97
|
* @constructor
|
|
100
98
|
* @public
|
|
@@ -910,8 +908,6 @@ sap.ui.define([
|
|
|
910
908
|
// BASIC CONTROL API
|
|
911
909
|
// =============================================================================
|
|
912
910
|
|
|
913
|
-
IconPool.insertFontFaceStyle();
|
|
914
|
-
|
|
915
911
|
/**
|
|
916
912
|
* Initialization of the Table control
|
|
917
913
|
* @private
|
|
@@ -1430,6 +1426,7 @@ sap.ui.define([
|
|
|
1430
1426
|
}
|
|
1431
1427
|
|
|
1432
1428
|
this._updateTableSizes(TableUtils.RowsUpdateReason.Render, true);
|
|
1429
|
+
this._adjustFirstVisibleRowToTotalRowCount(); // The number of rendered rows might have changed.
|
|
1433
1430
|
TableUtils.registerResizeHandler(this, "Table", this._onTableResize.bind(this));
|
|
1434
1431
|
|
|
1435
1432
|
this._bFirstRendering = false;
|
|
@@ -1640,6 +1637,24 @@ sap.ui.define([
|
|
|
1640
1637
|
// FOCUS
|
|
1641
1638
|
// =============================================================================
|
|
1642
1639
|
|
|
1640
|
+
/**
|
|
1641
|
+
* Sets the focus to the stored focus DOM reference.
|
|
1642
|
+
*
|
|
1643
|
+
* If {@param oFocusInfo.targetInfo} is of type {@type sap.ui.core.message.Message},
|
|
1644
|
+
* the focus will be set as accurately as possible according to the information provided by {@type sap.ui.core.message.Message}.
|
|
1645
|
+
*
|
|
1646
|
+
* @param {object} [oFocusInfo={}] Options for setting the focus
|
|
1647
|
+
* @param {boolean} [oFocusInfo.preventScroll=false] @since 1.60 If set to <code>true</code>, the focused
|
|
1648
|
+
* element won't be moved into the viewport if it's not completely visible before the focus is set
|
|
1649
|
+
* @param {any} [oFocusInfo.targetInfo] @since 1.98 Further control-specific setting of the focus target within the control
|
|
1650
|
+
* @public
|
|
1651
|
+
*/
|
|
1652
|
+
Table.prototype.focus = function(oFocusInfo) {
|
|
1653
|
+
this._oFocusInfo = oFocusInfo;
|
|
1654
|
+
Control.prototype.focus.apply(this, arguments);
|
|
1655
|
+
delete this._oFocusInfo;
|
|
1656
|
+
};
|
|
1657
|
+
|
|
1643
1658
|
/*
|
|
1644
1659
|
* @see JSDoc generated by SAPUI5 control
|
|
1645
1660
|
*/
|
|
@@ -1664,7 +1679,6 @@ sap.ui.define([
|
|
|
1664
1679
|
return this;
|
|
1665
1680
|
};
|
|
1666
1681
|
|
|
1667
|
-
|
|
1668
1682
|
// =============================================================================
|
|
1669
1683
|
// PUBLIC TABLE API
|
|
1670
1684
|
// =============================================================================
|
|
@@ -1920,6 +1934,7 @@ sap.ui.define([
|
|
|
1920
1934
|
|
|
1921
1935
|
// Temporary fix for the Support Assistant hacks. Support Assistant should implement a selection plugin.
|
|
1922
1936
|
// TODO: Before we recommend to implement a selection plugin -> Complete BLI CPOUIFTEAMB-1464
|
|
1937
|
+
// TODO: Delete binding change listener after hacks are removed from Support Assistant
|
|
1923
1938
|
Table._addBindingListener(oBindingInfo, "change", function() {
|
|
1924
1939
|
this._onBindingChange.apply(this, arguments);
|
|
1925
1940
|
}.bind(this));
|
|
@@ -1938,14 +1953,13 @@ sap.ui.define([
|
|
|
1938
1953
|
this._bRowsBeingBound = false;
|
|
1939
1954
|
};
|
|
1940
1955
|
|
|
1941
|
-
|
|
1942
|
-
* This function will be called
|
|
1943
|
-
*
|
|
1944
|
-
* @
|
|
1956
|
+
/*
|
|
1957
|
+
* This function will be called either by {@link sap.ui.base.ManagedObject#bindAggregation} or {@link sap.ui.base.ManagedObject#setModel}.
|
|
1958
|
+
* If only the model has been changed, ManagedObject only calls _bindAggregation, while bindAggregation / bindRows is not called.
|
|
1959
|
+
* @see sap.ui.base.ManagedObject#_bindAggregation
|
|
1945
1960
|
*/
|
|
1946
1961
|
Table.prototype._bindAggregation = function(sName, oBindingInfo) {
|
|
1947
1962
|
if (sName === "rows") {
|
|
1948
|
-
// If only the model has been changed, the ManagedObject only calls _bindAggregation while bindAggregation / bindRows is not called.
|
|
1949
1963
|
resetBindingFlags(this);
|
|
1950
1964
|
this._bRowsBeingBound = true;
|
|
1951
1965
|
}
|
|
@@ -2086,13 +2100,7 @@ sap.ui.define([
|
|
|
2086
2100
|
* @param {sap.ui.base.Event} oEvent change event
|
|
2087
2101
|
* @private
|
|
2088
2102
|
*/
|
|
2089
|
-
Table.prototype._onBindingChange = function(oEvent) {
|
|
2090
|
-
var sReason = oEvent.getParameter("reason");
|
|
2091
|
-
|
|
2092
|
-
if (sReason === ChangeReason.Sort || sReason === ChangeReason.Filter) {
|
|
2093
|
-
this.setFirstVisibleRow(0);
|
|
2094
|
-
}
|
|
2095
|
-
};
|
|
2103
|
+
Table.prototype._onBindingChange = function(oEvent) {};
|
|
2096
2104
|
|
|
2097
2105
|
/*
|
|
2098
2106
|
* @see JSDoc generated by SAPUI5 control API generator
|
|
@@ -2288,160 +2296,104 @@ sap.ui.define([
|
|
|
2288
2296
|
};
|
|
2289
2297
|
|
|
2290
2298
|
/**
|
|
2291
|
-
* Requests
|
|
2292
|
-
*
|
|
2299
|
+
* Requests all contexts from the binding which are required to display the data in the current viewport.
|
|
2300
|
+
*
|
|
2301
|
+
* @param {int} [iRequestLength]
|
|
2302
|
+
* The amount of contexts to request.
|
|
2303
|
+
* The default is the row count computed by the row mode, see {@link sap.ui.table.rowmodes.RowMode#getComputedRowCounts}.
|
|
2304
|
+
* The minimum request length is determined by the row mode, see {@link sap.ui.table.rowmodes.RowMode#getMinRequestLength}.
|
|
2305
|
+
* @returns {sap.ui.model.Context[]} Array of row contexts.
|
|
2293
2306
|
* @private
|
|
2294
2307
|
*/
|
|
2295
|
-
Table.prototype.
|
|
2308
|
+
Table.prototype._getRowContexts = function(iRequestLength) {
|
|
2309
|
+
var oBinding = this.getBinding();
|
|
2296
2310
|
var mRowCounts = this._getRowCounts();
|
|
2297
|
-
var
|
|
2311
|
+
var iThreshold = this.getThreshold();
|
|
2298
2312
|
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2313
|
+
iRequestLength = iRequestLength == null ? mRowCounts.count : iRequestLength;
|
|
2314
|
+
|
|
2315
|
+
// If the threshold is not explicitly disabled by setting it to 0, the threshold should be at least the number of scrollable rows.
|
|
2316
|
+
if (iThreshold !== 0) {
|
|
2317
|
+
iThreshold = Math.max(iRequestLength - mRowCounts.fixedTop - mRowCounts.fixedBottom, iThreshold);
|
|
2318
|
+
}
|
|
2319
|
+
|
|
2320
|
+
iRequestLength = Math.max(iRequestLength, this._getRowMode().getMinRequestLength(), 0);
|
|
2321
|
+
|
|
2322
|
+
if (!oBinding || iRequestLength === 0) {
|
|
2302
2323
|
return [];
|
|
2303
2324
|
}
|
|
2325
|
+
|
|
2326
|
+
// Data can be requested with a single getContexts call if the fixed and the scrollable rows overlap.
|
|
2327
|
+
// Because of the AnalyticalTable, the fixed bottom rows can only be requested separately.
|
|
2328
|
+
|
|
2329
|
+
var iFirstRenderedRowIndex = this._getFirstRenderedRowIndex();
|
|
2330
|
+
var aContexts = [];
|
|
2331
|
+
|
|
2332
|
+
if (mRowCounts.fixedTop > 0 && iFirstRenderedRowIndex > 0) {
|
|
2333
|
+
// If there is a gap between the first visible row and fixed top rows, the fixed top rows need to be requested separately.
|
|
2334
|
+
// The first visible row always starts at index 0 in the scrollable part, no matter how many fixed top rows there are.
|
|
2335
|
+
mergeContextArrays(aContexts, this._getFixedTopRowContexts(), 0);
|
|
2336
|
+
mergeContextArrays(aContexts, this._getContexts(iFirstRenderedRowIndex + mRowCounts.fixedTop, iRequestLength - mRowCounts.fixedBottom - mRowCounts.fixedTop, iThreshold), mRowCounts.fixedTop);
|
|
2337
|
+
} else {
|
|
2338
|
+
mergeContextArrays(aContexts, this._getContexts(iFirstRenderedRowIndex, iRequestLength - mRowCounts.fixedBottom, iThreshold), 0);
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
if (mRowCounts.fixedBottom > 0) {
|
|
2342
|
+
mergeContextArrays(aContexts, this._getFixedBottomRowContexts(),
|
|
2343
|
+
Math.min(mRowCounts.fixedTop + mRowCounts.scrollable, Math.max(this._getTotalRowCount() - mRowCounts.fixedBottom, 0)));
|
|
2344
|
+
}
|
|
2345
|
+
|
|
2346
|
+
return aContexts;
|
|
2304
2347
|
};
|
|
2305
2348
|
|
|
2349
|
+
function mergeContextArrays(aTarget, aSource, iStartIndex) {
|
|
2350
|
+
for (var i = 0; i < aSource.length; i++) {
|
|
2351
|
+
aTarget[iStartIndex + i] = aSource[i];
|
|
2352
|
+
}
|
|
2353
|
+
}
|
|
2354
|
+
|
|
2306
2355
|
/**
|
|
2307
|
-
*
|
|
2308
|
-
*
|
|
2356
|
+
* Gets contexts for the fixed top rows from the binding.
|
|
2357
|
+
*
|
|
2358
|
+
* @returns {sap.ui.model.Context[]} Array of contexts.
|
|
2309
2359
|
* @private
|
|
2310
2360
|
*/
|
|
2311
|
-
Table.prototype.
|
|
2361
|
+
Table.prototype._getFixedTopRowContexts = function() {
|
|
2312
2362
|
var mRowCounts = this._getRowCounts();
|
|
2313
|
-
|
|
2314
|
-
if (mRowCounts.fixedTop > 0) {
|
|
2315
|
-
return this._getContexts(0, mRowCounts.fixedTop, 0, true);
|
|
2316
|
-
} else {
|
|
2317
|
-
return [];
|
|
2318
|
-
}
|
|
2363
|
+
return mRowCounts.fixedTop > 0 ? this._getContexts(0, mRowCounts.fixedTop, 0, true) : [];
|
|
2319
2364
|
};
|
|
2320
2365
|
|
|
2321
2366
|
/**
|
|
2322
|
-
* Gets contexts
|
|
2367
|
+
* Gets contexts for the fixed bottom rows from the binding.
|
|
2323
2368
|
*
|
|
2324
|
-
* @
|
|
2325
|
-
* @param {int} [iLength] The requested amount of contexts.
|
|
2326
|
-
* @param {int} [iThreshold] The threshold value.
|
|
2327
|
-
* @param {boolean} [bKeepCurrent] Whether this call keeps the result of {@link sap.ui.model.ListBinding#getCurrentContexts} untouched.
|
|
2328
|
-
* @returns {sap.ui.model.Context[]} The requested contexts.
|
|
2329
|
-
* @see sap.ui.model.ListBinding#getContexts
|
|
2369
|
+
* @returns {sap.ui.model.Context[]} Array of contexts.
|
|
2330
2370
|
* @private
|
|
2331
2371
|
*/
|
|
2332
|
-
Table.prototype.
|
|
2333
|
-
var
|
|
2372
|
+
Table.prototype._getFixedBottomRowContexts = function() {
|
|
2373
|
+
var mRowCounts = this._getRowCounts();
|
|
2374
|
+
var iTotalRowCount = getTotalRowCount(this, true);
|
|
2334
2375
|
|
|
2335
|
-
if (
|
|
2336
|
-
return
|
|
2376
|
+
if (mRowCounts.fixedBottom > 0 && mRowCounts.count - mRowCounts.fixedBottom < iTotalRowCount) {
|
|
2377
|
+
return this._getContexts(iTotalRowCount - mRowCounts.fixedBottom, mRowCounts.fixedBottom, 0, true);
|
|
2337
2378
|
} else {
|
|
2338
2379
|
return [];
|
|
2339
2380
|
}
|
|
2340
2381
|
};
|
|
2341
2382
|
|
|
2342
2383
|
/**
|
|
2343
|
-
*
|
|
2384
|
+
* Gets contexts from the binding.
|
|
2344
2385
|
*
|
|
2345
|
-
* @param {int}
|
|
2346
|
-
* @param {
|
|
2347
|
-
* @param {
|
|
2348
|
-
*
|
|
2349
|
-
* @returns {
|
|
2386
|
+
* @param {int} iStartIndex Start of the index range.
|
|
2387
|
+
* @param {int} iLength Length of the index range.
|
|
2388
|
+
* @param {int} iThreshold The number of contexts to load in addition to the requested range.
|
|
2389
|
+
* @param {boolean} [bKeepCurrent] Whether this call keeps the result of {@link sap.ui.model.ListBinding#getCurrentContexts} untouched.
|
|
2390
|
+
* @returns {sap.ui.model.Context[]} Array of contexts.
|
|
2350
2391
|
* @private
|
|
2392
|
+
* @see sap.ui.model.ListBinding#getContexts
|
|
2351
2393
|
*/
|
|
2352
|
-
Table.prototype.
|
|
2394
|
+
Table.prototype._getContexts = function(iStartIndex, iLength, iThreshold, bKeepCurrent) {
|
|
2353
2395
|
var oBinding = this.getBinding();
|
|
2354
|
-
|
|
2355
|
-
var iThreshold = this.getThreshold();
|
|
2356
|
-
|
|
2357
|
-
iRequestLength = iRequestLength == null ? iRowCount : iRequestLength;
|
|
2358
|
-
|
|
2359
|
-
// If the threshold is not explicitly disabled by setting it to 0, the default threshold should be the number of rows.
|
|
2360
|
-
iThreshold = iThreshold > 0 ? Math.max(iRequestLength, iThreshold) : 0;
|
|
2361
|
-
|
|
2362
|
-
iRequestLength = Math.max(iRequestLength, this._getRowMode().getMinRequestLength());
|
|
2363
|
-
|
|
2364
|
-
if (!oBinding || iRequestLength <= 0) {
|
|
2365
|
-
// Without binding there are no contexts to be retrieved.
|
|
2366
|
-
return [];
|
|
2367
|
-
}
|
|
2368
|
-
|
|
2369
|
-
bSuppressAdjustToBindingLength = bSuppressAdjustToBindingLength === true;
|
|
2370
|
-
bSecondCall = bSecondCall === true;
|
|
2371
|
-
|
|
2372
|
-
var iFirstRenderedRowIndex = this._getFirstRenderedRowIndex();
|
|
2373
|
-
var mRowCounts = this._getRowCounts();
|
|
2374
|
-
var aContexts = [];
|
|
2375
|
-
var aTmpContexts;
|
|
2376
|
-
|
|
2377
|
-
// because of the analytical table the fixed bottom row must always be requested separately as it is the grand
|
|
2378
|
-
// total row for the table.
|
|
2379
|
-
var iLength = iRequestLength - mRowCounts.fixedBottom;
|
|
2380
|
-
var iMergeOffsetScrollRows = 0;
|
|
2381
|
-
var iMergeOffsetBottomRow = iLength;
|
|
2382
|
-
|
|
2383
|
-
// data can be requested with a single getContexts call if the fixed rows and the scrollable rows overlap.
|
|
2384
|
-
var iStartIndex = iFirstRenderedRowIndex;
|
|
2385
|
-
|
|
2386
|
-
var fnMergeArrays = function(aTarget, aSource, iStartIndex) {
|
|
2387
|
-
for (var i = 0; i < aSource.length; i++) {
|
|
2388
|
-
aTarget[iStartIndex + i] = aSource[i];
|
|
2389
|
-
}
|
|
2390
|
-
};
|
|
2391
|
-
|
|
2392
|
-
if (mRowCounts.fixedTop > 0 && iFirstRenderedRowIndex > 0) {
|
|
2393
|
-
// since there is a gap between first visible row and fixed rows it must be requested separately
|
|
2394
|
-
// the first visible row always starts counting with 0 in the scroll part of the table no matter
|
|
2395
|
-
// how many fixed rows there are.
|
|
2396
|
-
iStartIndex = iFirstRenderedRowIndex + mRowCounts.fixedTop;
|
|
2397
|
-
// length must be reduced by number of fixed rows since they were just requested separately
|
|
2398
|
-
iLength -= mRowCounts.fixedTop;
|
|
2399
|
-
iMergeOffsetScrollRows = mRowCounts.fixedTop;
|
|
2400
|
-
// retrieve fixed rows separately
|
|
2401
|
-
aTmpContexts = this._getFixedRowContexts();
|
|
2402
|
-
aContexts = aContexts.concat(aTmpContexts);
|
|
2403
|
-
}
|
|
2404
|
-
|
|
2405
|
-
// request scroll part contexts but may include fixed rows depending on scroll and length settings
|
|
2406
|
-
// if this is done before requesting fixed bottom rows, it saves some performance for the analytical table
|
|
2407
|
-
// since the tree gets only build once (as result of getContexts call). If first the fixed bottom row would
|
|
2408
|
-
// be requested the analytical binding would build the tree twice.
|
|
2409
|
-
aTmpContexts = this._getContexts(iStartIndex, iLength, iThreshold);
|
|
2410
|
-
|
|
2411
|
-
if (!bSuppressAdjustToBindingLength) {
|
|
2412
|
-
this._adjustToTotalRowCount();
|
|
2413
|
-
}
|
|
2414
|
-
|
|
2415
|
-
var iTotalRowCount = this._getTotalRowCount();
|
|
2416
|
-
|
|
2417
|
-
// get the binding length after getContext call to make sure that for TreeBindings the client tree was correctly rebuilt
|
|
2418
|
-
// this step can be moved to an earlier point when the TreeBindingAdapters all implement tree invalidation in case of getLength calls
|
|
2419
|
-
fnMergeArrays(aContexts, aTmpContexts, iMergeOffsetScrollRows);
|
|
2420
|
-
|
|
2421
|
-
// request binding length after getContexts call to make sure that in case of tree binding and analytical binding
|
|
2422
|
-
// the tree gets only built once (by getContexts call).
|
|
2423
|
-
iMergeOffsetBottomRow = Math.min(iMergeOffsetBottomRow, Math.max(iTotalRowCount - mRowCounts.fixedBottom, 0));
|
|
2424
|
-
if (mRowCounts.fixedBottom > 0) {
|
|
2425
|
-
// retrieve fixed bottom rows separately
|
|
2426
|
-
// instead of just concatenating them to the existing contexts it must be made sure that they are put
|
|
2427
|
-
// to the correct row index otherwise they would flip into the scroll area in case data gets requested for
|
|
2428
|
-
// the scroll part.
|
|
2429
|
-
aTmpContexts = this._getFixedBottomRowContexts();
|
|
2430
|
-
fnMergeArrays(aContexts, aTmpContexts, iMergeOffsetBottomRow);
|
|
2431
|
-
}
|
|
2432
|
-
|
|
2433
|
-
// If the Binding#getContexts call triggers recalculation of the binding length, the first visible row index needs to be corrected and a new
|
|
2434
|
-
// context range needs to be requested.
|
|
2435
|
-
|
|
2436
|
-
var iMaxRowIndex = this._getMaxFirstRenderedRowIndex();
|
|
2437
|
-
if (iMaxRowIndex < iFirstRenderedRowIndex && this._bContextsAvailable && !bSecondCall) {
|
|
2438
|
-
this._setFirstVisibleRowIndex(this.getFirstVisibleRow(), {
|
|
2439
|
-
onlySetProperty: true
|
|
2440
|
-
});
|
|
2441
|
-
aContexts = this._getRowContexts(iRequestLength, bSuppressAdjustToBindingLength, true);
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
return aContexts;
|
|
2396
|
+
return oBinding ? oBinding.getContexts(iStartIndex, iLength, iThreshold, bKeepCurrent) : [];
|
|
2445
2397
|
};
|
|
2446
2398
|
|
|
2447
2399
|
/**
|
|
@@ -2455,10 +2407,20 @@ sap.ui.define([
|
|
|
2455
2407
|
if (this._iBindingLength !== iTotalRowCount) {
|
|
2456
2408
|
this._iBindingLength = iTotalRowCount;
|
|
2457
2409
|
this._updateFixedBottomRows();
|
|
2410
|
+
this._adjustFirstVisibleRowToTotalRowCount();
|
|
2458
2411
|
TableUtils.Hook.call(this, Hook.TotalRowCountChanged);
|
|
2459
2412
|
}
|
|
2460
2413
|
};
|
|
2461
2414
|
|
|
2415
|
+
Table.prototype._adjustFirstVisibleRowToTotalRowCount = function() {
|
|
2416
|
+
var iCurrentIndex = this.getFirstVisibleRow();
|
|
2417
|
+
var iMaxIndex = this._getMaxFirstVisibleRowIndex();
|
|
2418
|
+
|
|
2419
|
+
if (iMaxIndex < iCurrentIndex && this._bContextsAvailable) {
|
|
2420
|
+
this._setFirstVisibleRowIndex(iMaxIndex, {onlySetProperty: true});
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
|
|
2462
2424
|
/**
|
|
2463
2425
|
* Notifies about a binding refresh - called internally by the <code>ManagedObject</code> when the binding fires a "refresh" event.
|
|
2464
2426
|
* Only relevant for server-side bindings. The table is expected to call <code>Binding#getContexts</code>, which triggers a data request. The
|
|
@@ -2504,6 +2466,12 @@ sap.ui.define([
|
|
|
2504
2466
|
}
|
|
2505
2467
|
|
|
2506
2468
|
this._bContextsAvailable = true;
|
|
2469
|
+
|
|
2470
|
+
if (sReason === ChangeReason.Sort || sReason === ChangeReason.Filter) {
|
|
2471
|
+
this.setFirstVisibleRow(0);
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
this._adjustToTotalRowCount();
|
|
2507
2475
|
triggerRowsUpdate(this, sReason);
|
|
2508
2476
|
};
|
|
2509
2477
|
|
|
@@ -2773,7 +2741,9 @@ sap.ui.define([
|
|
|
2773
2741
|
/**
|
|
2774
2742
|
* Returns the number of rows the <code>rows</code> aggregation is bound to.
|
|
2775
2743
|
*
|
|
2776
|
-
*
|
|
2744
|
+
* <b>Note: Returns a cached binding length if the binding is being refreshed.</b>
|
|
2745
|
+
*
|
|
2746
|
+
* @returns {int} The total number of rows.
|
|
2777
2747
|
* @private
|
|
2778
2748
|
*/
|
|
2779
2749
|
Table.prototype._getTotalRowCount = function() {
|
|
@@ -2814,10 +2784,9 @@ sap.ui.define([
|
|
|
2814
2784
|
}
|
|
2815
2785
|
|
|
2816
2786
|
/**
|
|
2817
|
-
* Returns the maximum row index to which can be scrolled to.
|
|
2818
|
-
* than the actual maximum.
|
|
2787
|
+
* Returns the maximum row index to which can be scrolled to.
|
|
2819
2788
|
*
|
|
2820
|
-
* @returns {int} The maximum
|
|
2789
|
+
* @returns {int} The maximum first visible row index.
|
|
2821
2790
|
* @private
|
|
2822
2791
|
*/
|
|
2823
2792
|
Table.prototype._getMaxFirstVisibleRowIndex = function() {
|
|
@@ -3034,6 +3003,15 @@ sap.ui.define([
|
|
|
3034
3003
|
return this.getDomRef("noDataCnt");
|
|
3035
3004
|
}
|
|
3036
3005
|
|
|
3006
|
+
var bHasMessage = this._oFocusInfo && this._oFocusInfo.targetInfo && TableUtils.isA(this._oFocusInfo.targetInfo, "sap.ui.core.message.Message");
|
|
3007
|
+
if (bHasMessage && this.getColumnHeaderVisible()) {
|
|
3008
|
+
var oFirstVisibleColumn = this._getVisibleColumns()[0];
|
|
3009
|
+
|
|
3010
|
+
if (oFirstVisibleColumn) {
|
|
3011
|
+
return oFirstVisibleColumn.getDomRef();
|
|
3012
|
+
}
|
|
3013
|
+
}
|
|
3014
|
+
|
|
3037
3015
|
var oFocusedItemInfo = TableUtils.getFocusedItemInfo(this);
|
|
3038
3016
|
if (oFocusedItemInfo && oFocusedItemInfo.domRef) {
|
|
3039
3017
|
return oFocusedItemInfo.domRef;
|
|
@@ -3938,8 +3916,6 @@ sap.ui.define([
|
|
|
3938
3916
|
};
|
|
3939
3917
|
|
|
3940
3918
|
/*
|
|
3941
|
-
* Prevents re-rendering, when enabling/disabling busy indicator.
|
|
3942
|
-
* Avoids the request delays.
|
|
3943
3919
|
* @see JSDoc generated by SAPUI5 control API generator
|
|
3944
3920
|
*/
|
|
3945
3921
|
Table.prototype.setEnableBusyIndicator = function(bValue) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -30,7 +30,7 @@ sap.ui.define([
|
|
|
30
30
|
* @extends sap.ui.base.ManagedObject
|
|
31
31
|
*
|
|
32
32
|
* @author SAP SE
|
|
33
|
-
* @version 1.
|
|
33
|
+
* @version 1.98.0
|
|
34
34
|
* @since 1.21.1
|
|
35
35
|
*
|
|
36
36
|
* @constructor
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -278,11 +278,6 @@ sap.ui.define(['sap/ui/core/Control', 'sap/ui/Device', './library', "./Column",
|
|
|
278
278
|
this.renderTabElement(rm, "sapUiTableCtrlAfter", bHasRows ? "0" : "-1");
|
|
279
279
|
this.renderTabElement(rm, null, "-1", oTable.getId() + "-focusDummy");
|
|
280
280
|
|
|
281
|
-
if (!oTable._getScrollExtension().isVerticalScrollbarExternal()) {
|
|
282
|
-
this.renderVSbBackground(rm, oTable);
|
|
283
|
-
this.renderVSb(rm, oTable);
|
|
284
|
-
}
|
|
285
|
-
|
|
286
281
|
var oCreationRow = oTable.getCreationRow();
|
|
287
282
|
if (!oCreationRow || !oCreationRow.getVisible()) {
|
|
288
283
|
this.renderHSbBackground(rm, oTable);
|
|
@@ -295,6 +290,10 @@ sap.ui.define(['sap/ui/core/Control', 'sap/ui/Device', './library', "./Column",
|
|
|
295
290
|
this.renderRowHdr(rm, oTable);
|
|
296
291
|
this.renderRowActions(rm, oTable);
|
|
297
292
|
|
|
293
|
+
if (!oTable._getScrollExtension().isVerticalScrollbarExternal()) {
|
|
294
|
+
this.renderVSb(rm, oTable);
|
|
295
|
+
}
|
|
296
|
+
|
|
298
297
|
rm.openStart("div", oTable.getId() + "-noDataCnt");
|
|
299
298
|
rm.class("sapUiTableCtrlEmpty");
|
|
300
299
|
rm.attr("tabindex", "0");
|
|
@@ -1204,65 +1203,54 @@ sap.ui.define(['sap/ui/core/Control', 'sap/ui/Device', './library', "./Column",
|
|
|
1204
1203
|
};
|
|
1205
1204
|
|
|
1206
1205
|
TableRenderer.renderVSb = function(rm, oTable, mConfig) {
|
|
1206
|
+
var oScrollExtension = oTable._getScrollExtension();
|
|
1207
|
+
var mRowCounts = oTable._getRowCounts();
|
|
1208
|
+
|
|
1207
1209
|
mConfig = Object.assign({
|
|
1208
|
-
|
|
1209
|
-
tabIndex: true,
|
|
1210
|
-
hidden: true
|
|
1210
|
+
tabIndex: true
|
|
1211
1211
|
}, mConfig);
|
|
1212
|
-
mConfig.id = oTable.getId() + "-vsb";
|
|
1213
|
-
|
|
1214
|
-
var oScrollExtension = oTable._getScrollExtension();
|
|
1215
1212
|
|
|
1216
|
-
rm.openStart("div"
|
|
1217
|
-
rm.class(
|
|
1218
|
-
if (
|
|
1213
|
+
rm.openStart("div");
|
|
1214
|
+
rm.class("sapUiTableVSbContainer");
|
|
1215
|
+
if (!oScrollExtension.isVerticalScrollbarRequired()) {
|
|
1219
1216
|
rm.class("sapUiTableHidden");
|
|
1220
1217
|
}
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
}
|
|
1224
|
-
rm.style("max-height", oScrollExtension.getVerticalScrollbarHeight() + "px");
|
|
1218
|
+
rm.class(mConfig.cssClass);
|
|
1219
|
+
rm.openEnd();
|
|
1225
1220
|
|
|
1226
|
-
|
|
1221
|
+
rm.openStart("div", oTable.getId() + "-vsb");
|
|
1222
|
+
rm.class("sapUiTableVSb");
|
|
1223
|
+
rm.style("max-height", oScrollExtension.getVerticalScrollbarHeight() + "px");
|
|
1227
1224
|
if (mRowCounts.fixedTop > 0) {
|
|
1228
|
-
|
|
1229
|
-
|
|
1225
|
+
rm.style("top", mRowCounts.fixedTop * oTable._getBaseRowHeight() - 1 + "px");
|
|
1226
|
+
}
|
|
1227
|
+
if (mConfig.tabIndex) {
|
|
1228
|
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=1069739
|
|
1229
|
+
// Avoid focusing of the scrollbar in Firefox with tab.
|
|
1230
|
+
rm.attr("tabindex", "-1");
|
|
1230
1231
|
}
|
|
1231
|
-
|
|
1232
1232
|
rm.openEnd();
|
|
1233
|
-
|
|
1234
|
-
rm.openStart("div", mConfig.id + "-content");
|
|
1233
|
+
rm.openStart("div");
|
|
1235
1234
|
rm.class("sapUiTableVSbContent");
|
|
1236
1235
|
rm.style("height", oScrollExtension.getVerticalScrollHeight() + "px");
|
|
1237
1236
|
rm.openEnd();
|
|
1238
1237
|
rm.close("div");
|
|
1238
|
+
rm.close("div");
|
|
1239
1239
|
|
|
1240
1240
|
rm.close("div");
|
|
1241
1241
|
};
|
|
1242
1242
|
|
|
1243
1243
|
TableRenderer.renderVSbExternal = function(rm, oTable) {
|
|
1244
1244
|
if (ExtensionBase.isEnrichedWith(oTable, "sap.ui.table.extensions.Synchronization")) {
|
|
1245
|
-
rm.openStart("div");
|
|
1246
|
-
rm.style("position", "relative");
|
|
1247
|
-
rm.openEnd();
|
|
1248
|
-
|
|
1249
1245
|
this.renderVSb(rm, oTable, {
|
|
1250
1246
|
cssClass: "sapUiTableVSbExternal",
|
|
1251
1247
|
tabIndex: false
|
|
1252
1248
|
});
|
|
1253
|
-
|
|
1254
|
-
rm.close("div");
|
|
1255
1249
|
} else {
|
|
1256
1250
|
Log.error("This method can only be used with synchronization enabled.", oTable, "TableRenderer.renderVSbExternal");
|
|
1257
1251
|
}
|
|
1258
1252
|
};
|
|
1259
1253
|
|
|
1260
|
-
TableRenderer.renderVSbBackground = function(rm, oTable) {
|
|
1261
|
-
rm.openStart("div", oTable.getId() + "-vsb-bg");
|
|
1262
|
-
rm.class("sapUiTableVSbBg");
|
|
1263
|
-
rm.openEnd().close("div");
|
|
1264
|
-
};
|
|
1265
|
-
|
|
1266
1254
|
TableRenderer.renderHSb = function(rm, oTable, mConfig) {
|
|
1267
1255
|
mConfig = Object.assign({
|
|
1268
1256
|
id: oTable.getId() + "-hsb",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright 2009-
|
|
3
|
+
* (c) Copyright 2009-2022 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
|
|
@@ -40,7 +40,7 @@ sap.ui.define([
|
|
|
40
40
|
* @class
|
|
41
41
|
* The TreeTable control provides a comprehensive set of features to display hierarchical data.
|
|
42
42
|
* @extends sap.ui.table.Table
|
|
43
|
-
* @version 1.
|
|
43
|
+
* @version 1.98.0
|
|
44
44
|
*
|
|
45
45
|
* @constructor
|
|
46
46
|
* @public
|
|
@@ -376,17 +376,33 @@ sap.ui.define([
|
|
|
376
376
|
}
|
|
377
377
|
};
|
|
378
378
|
|
|
379
|
-
TreeTable.prototype._getRowContexts = function() {
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
379
|
+
TreeTable.prototype._getRowContexts = function(iRequestLength) {
|
|
380
|
+
return getRowContexts(this, iRequestLength);
|
|
381
|
+
};
|
|
382
|
+
|
|
383
|
+
function getRowContexts(oTable, iRequestLength, bSecondCall) {
|
|
384
|
+
var iOldTotalRowCount = oTable._getTotalRowCount();
|
|
385
|
+
var aRowContexts = Table.prototype._getRowContexts.call(oTable, iRequestLength);
|
|
386
|
+
|
|
387
|
+
if (bSecondCall === true) {
|
|
388
|
+
return aRowContexts;
|
|
389
|
+
}
|
|
383
390
|
|
|
384
|
-
|
|
385
|
-
|
|
391
|
+
var iNewTotalRowCount = oTable._getTotalRowCount();
|
|
392
|
+
var iFirstVisibleRow = oTable._getFirstRenderedRowIndex();
|
|
393
|
+
var iMaxRowIndex = oTable._getMaxFirstRenderedRowIndex();
|
|
394
|
+
|
|
395
|
+
oTable._adjustToTotalRowCount();
|
|
396
|
+
|
|
397
|
+
if (iMaxRowIndex < iFirstVisibleRow && oTable._bContextsAvailable) {
|
|
398
|
+
// Get the contexts again, this time with the maximum possible value for the first visible row.
|
|
399
|
+
aRowContexts = getRowContexts(oTable, iRequestLength, true);
|
|
400
|
+
} else if (iOldTotalRowCount !== iNewTotalRowCount) {
|
|
401
|
+
aRowContexts = getRowContexts(oTable, iRequestLength, true);
|
|
386
402
|
}
|
|
387
403
|
|
|
388
404
|
return aRowContexts;
|
|
389
|
-
}
|
|
405
|
+
}
|
|
390
406
|
|
|
391
407
|
TreeTable.prototype._onGroupHeaderChanged = function(iRowIndex, bExpanded) {
|
|
392
408
|
this.fireToggleOpenState({
|
|
@@ -528,7 +544,7 @@ sap.ui.define([
|
|
|
528
544
|
* Invisible nodes (collapsed child nodes) will not be regarded.
|
|
529
545
|
*
|
|
530
546
|
* Please also take notice of the fact, that "addSelectionInterval" does not change any other selection.
|
|
531
|
-
* To override the current selection, please use "
|
|
547
|
+
* To override the current selection, please use "setSelectionInterval" or for a single entry use "setSelectedIndex".
|
|
532
548
|
*
|
|
533
549
|
* @param {int} iIndexFrom Index from which the selection should start
|
|
534
550
|
* @param {int} iIndexTo Index up to which to select
|