@openui5/sap.ui.table 1.143.0 → 1.144.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/THIRDPARTY.txt +1 -1
- 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/AnalyticalTable.js +2 -2
- package/src/sap/ui/table/Column.js +2 -2
- package/src/sap/ui/table/ColumnMenu.js +2 -2
- package/src/sap/ui/table/CreationRow.js +2 -2
- package/src/sap/ui/table/CreationRowRenderer.js +2 -2
- package/src/sap/ui/table/HeaderSelector.js +90 -0
- package/src/sap/ui/table/HeaderSelectorRenderer.js +88 -0
- 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 +37 -60
- package/src/sap/ui/table/TablePersoController.js +2 -2
- package/src/sap/ui/table/TableRenderer.js +1624 -718
- package/src/sap/ui/table/TreeTable.js +2 -2
- package/src/sap/ui/table/designtime/AnalyticalTable.designtime.js +5 -1
- package/src/sap/ui/table/designtime/Table.designtime.js +5 -1
- package/src/sap/ui/table/designtime/library.designtime.js +1 -1
- package/src/sap/ui/table/designtime/messagebundle.properties +6 -0
- package/src/sap/ui/table/extensions/Accessibility.js +28 -53
- package/src/sap/ui/table/extensions/AccessibilityRender.js +3 -4
- 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 +5 -31
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +2 -2
- package/src/sap/ui/table/extensions/Pointer.js +2 -2
- package/src/sap/ui/table/extensions/Scrolling.js +2 -10
- package/src/sap/ui/table/extensions/ScrollingIOS.js +2 -2
- package/src/sap/ui/table/extensions/Synchronization.js +16 -18
- package/src/sap/ui/table/library.js +11 -11
- package/src/sap/ui/table/library.support.js +1 -1
- package/src/sap/ui/table/menus/AnalyticalTableContextMenu.js +2 -2
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +2 -2
- package/src/sap/ui/table/menus/ContextMenu.js +2 -2
- package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +1 -1
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +2 -2
- package/src/sap/ui/table/plugins/BindingSelection.js +27 -13
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +63 -52
- package/src/sap/ui/table/plugins/ODataV4Aggregation.js +2 -2
- package/src/sap/ui/table/plugins/ODataV4Hierarchy.js +2 -2
- package/src/sap/ui/table/plugins/ODataV4MultiLevel.js +2 -2
- package/src/sap/ui/table/plugins/ODataV4MultiSelection.js +78 -71
- package/src/sap/ui/table/plugins/ODataV4Selection.js +2 -2
- package/src/sap/ui/table/plugins/ODataV4SingleSelection.js +2 -2
- package/src/sap/ui/table/plugins/PluginBase.js +2 -2
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +26 -13
- package/src/sap/ui/table/plugins/SelectionPlugin.js +16 -14
- package/src/sap/ui/table/rowmodes/Auto.js +5 -13
- package/src/sap/ui/table/rowmodes/Fixed.js +3 -4
- package/src/sap/ui/table/rowmodes/Interactive.js +21 -27
- package/src/sap/ui/table/rowmodes/RowMode.js +20 -88
- package/src/sap/ui/table/rowmodes/Type.js +1 -1
- package/src/sap/ui/table/rowmodes/Variable.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/Cell.less +26 -16
- package/src/sap/ui/table/themes/base/CheckBox.less +51 -0
- package/src/sap/ui/table/themes/base/HeaderSelector.less +61 -0
- package/src/sap/ui/table/themes/base/RowSelection.less +9 -138
- package/src/sap/ui/table/themes/base/library.source.less +3 -1
- package/src/sap/ui/table/themes/sap_hcb/base_Cell.less +1 -1
- package/src/sap/ui/table/themes/sap_hcb/base_RowSelection.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 -2
- package/src/sap/ui/table/utils/_ColumnUtils.js +2 -2
- package/src/sap/ui/table/utils/_GroupingUtils.js +2 -2
- package/src/sap/ui/table/utils/_HookUtils.js +2 -2
- package/src/sap/ui/table/utils/_MenuUtils.js +2 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -8,14 +8,12 @@ sap.ui.define([
|
|
|
8
8
|
"./PluginBase",
|
|
9
9
|
"../utils/TableUtils",
|
|
10
10
|
"../library",
|
|
11
|
-
"sap/ui/core/Icon",
|
|
12
11
|
"sap/ui/core/IconPool"
|
|
13
12
|
], function(
|
|
14
13
|
ODataV4Selection,
|
|
15
14
|
PluginBase,
|
|
16
15
|
TableUtils,
|
|
17
16
|
library,
|
|
18
|
-
Icon,
|
|
19
17
|
IconPool
|
|
20
18
|
) {
|
|
21
19
|
"use strict";
|
|
@@ -41,7 +39,7 @@ sap.ui.define([
|
|
|
41
39
|
* @extends sap.ui.table.plugins.SelectionPlugin
|
|
42
40
|
*
|
|
43
41
|
* @author SAP SE
|
|
44
|
-
* @version 1.
|
|
42
|
+
* @version 1.144.0
|
|
45
43
|
*
|
|
46
44
|
* @public
|
|
47
45
|
* @since 1.140
|
|
@@ -88,9 +86,6 @@ sap.ui.define([
|
|
|
88
86
|
* Hide the header selector.
|
|
89
87
|
*/
|
|
90
88
|
hideHeaderSelector: {type: "boolean", group: "Appearance", defaultValue: false}
|
|
91
|
-
},
|
|
92
|
-
aggregations: {
|
|
93
|
-
icon: {type: "sap.ui.core.Icon", multiple: false, visibility: "hidden"}
|
|
94
89
|
}
|
|
95
90
|
}
|
|
96
91
|
});
|
|
@@ -103,10 +98,6 @@ sap.ui.define([
|
|
|
103
98
|
ODataV4MultiSelection.prototype.init = function() {
|
|
104
99
|
ODataV4Selection.prototype.init.apply(this, arguments);
|
|
105
100
|
|
|
106
|
-
const oIcon = new Icon({src: IconPool.getIconURI(TableUtils.ThemeParameters.checkboxIcon), useIconTooltip: false});
|
|
107
|
-
oIcon.addStyleClass("sapUiTableSelectClear");
|
|
108
|
-
this.setAggregation("icon", oIcon, true);
|
|
109
|
-
|
|
110
101
|
_private(this).bLimitReached = false;
|
|
111
102
|
_private(this).oRangeSelectionStartContext = null;
|
|
112
103
|
};
|
|
@@ -115,10 +106,19 @@ sap.ui.define([
|
|
|
115
106
|
* @inheritDoc
|
|
116
107
|
*/
|
|
117
108
|
ODataV4MultiSelection.prototype.onActivate = function(oTable) {
|
|
109
|
+
const oBinding = oTable.getBinding();
|
|
110
|
+
|
|
118
111
|
ODataV4Selection.prototype.onActivate.apply(this, arguments);
|
|
119
112
|
oTable.setProperty("selectionMode", library.SelectionMode.MultiToggle);
|
|
120
|
-
|
|
113
|
+
|
|
114
|
+
if (oBinding) {
|
|
115
|
+
attachToBinding(this, oBinding);
|
|
116
|
+
} else {
|
|
117
|
+
updateHeaderSelector(this);
|
|
118
|
+
}
|
|
119
|
+
|
|
121
120
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.RowsBound, onTableRowsBound, this);
|
|
121
|
+
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.TotalRowCountChanged, onTotalRowCountChanged, this);
|
|
122
122
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.UpdateRows, clearSelectionCache, this);
|
|
123
123
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.UnbindRows, clearSelectionCache, this);
|
|
124
124
|
};
|
|
@@ -133,6 +133,7 @@ sap.ui.define([
|
|
|
133
133
|
_private(this).oRangeSelectionStartContext = null;
|
|
134
134
|
detachFromBinding(this, oTable.getBinding());
|
|
135
135
|
TableUtils.Hook.deregister(oTable, TableUtils.Hook.Keys.Table.RowsBound, onTableRowsBound, this);
|
|
136
|
+
TableUtils.Hook.deregister(oTable, TableUtils.Hook.Keys.Table.TotalRowCountChanged, onTotalRowCountChanged, this);
|
|
136
137
|
TableUtils.Hook.deregister(oTable, TableUtils.Hook.Keys.Table.UpdateRows, clearSelectionCache, this);
|
|
137
138
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.UnbindRows, clearSelectionCache, this);
|
|
138
139
|
clearSelectionCache.call(this);
|
|
@@ -192,10 +193,6 @@ sap.ui.define([
|
|
|
192
193
|
return 0;
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
if (_private(oPlugin).iSelectableCount != null) {
|
|
196
|
-
return _private(oPlugin).iSelectableCount;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
196
|
if (oBinding.getAggregation()) {
|
|
200
197
|
/* In case of data aggregation with visual grouping and sum rows, we cannot determine the number of selectable contexts.
|
|
201
198
|
* The expected behavior is that if all visible selectable rows are selected, the state changes to "everything is selected". For example,
|
|
@@ -227,58 +224,47 @@ sap.ui.define([
|
|
|
227
224
|
iSelectableCount = oBinding.getLength();
|
|
228
225
|
} // The count is not requested and not all data is loaded.
|
|
229
226
|
|
|
230
|
-
_private(oPlugin).iSelectableCount = iSelectableCount;
|
|
231
227
|
return iSelectableCount;
|
|
232
228
|
}
|
|
233
229
|
|
|
234
230
|
/**
|
|
235
|
-
*
|
|
231
|
+
* Updates the HeaderSelector control based on the current selection state.
|
|
236
232
|
*
|
|
237
|
-
* @param {sap.ui.table.plugins.ODataV4MultiSelection} oPlugin The plugin to
|
|
233
|
+
* @param {sap.ui.table.plugins.ODataV4MultiSelection} oPlugin The plugin to update the header selector for.
|
|
238
234
|
*/
|
|
239
|
-
function
|
|
240
|
-
|
|
235
|
+
function updateHeaderSelector(oPlugin) {
|
|
236
|
+
const oHeaderSelector = oPlugin._getHeaderSelector();
|
|
237
|
+
|
|
238
|
+
if (!oPlugin.isActive() || !oHeaderSelector) {
|
|
241
239
|
return;
|
|
242
240
|
}
|
|
243
241
|
|
|
244
|
-
|
|
242
|
+
const sType = oPlugin._isLimitDisabled() ? "CheckBox" : "Icon";
|
|
243
|
+
const iSelectableCount = getSelectableCount(oPlugin);
|
|
244
|
+
const iSelectedCount = oPlugin.getSelectedCount();
|
|
245
|
+
const bAllRowsSelected = areAllRowsSelected(iSelectableCount, iSelectedCount);
|
|
246
|
+
let sTooltip = null;
|
|
247
|
+
let sIcon = "";
|
|
245
248
|
|
|
246
|
-
if (
|
|
247
|
-
|
|
248
|
-
sIconURI = IconPool.getIconURI(TableUtils.ThemeParameters.allSelectedIcon);
|
|
249
|
-
} else {
|
|
250
|
-
sIconURI = IconPool.getIconURI(TableUtils.ThemeParameters.clearSelectionIcon);
|
|
251
|
-
}
|
|
249
|
+
if (sType === "Icon") { // Default tooltip is used for type CheckBox.
|
|
250
|
+
sTooltip = iSelectedCount === 0 ? TableUtils.getResourceText("TBL_SELECT_ALL") : TableUtils.getResourceText("TBL_DESELECT_ALL");
|
|
252
251
|
}
|
|
253
252
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
ODataV4MultiSelection.prototype.getRenderConfig = function() {
|
|
261
|
-
if (!this.isActive()) {
|
|
262
|
-
return ODataV4Selection.prototype.getRenderConfig.apply(this, arguments);
|
|
253
|
+
if (bAllRowsSelected) {
|
|
254
|
+
sIcon = IconPool.getIconURI(TableUtils.ThemeParameters.allSelectedIcon);
|
|
255
|
+
} else if (iSelectedCount > 0) {
|
|
256
|
+
sIcon = IconPool.getIconURI(TableUtils.ThemeParameters.clearSelectionIcon);
|
|
257
|
+
} else {
|
|
258
|
+
sIcon = IconPool.getIconURI(TableUtils.ThemeParameters.checkboxIcon);
|
|
263
259
|
}
|
|
264
260
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
enabled: getSelectableCount(this) !== 0,
|
|
273
|
-
selected: areAllRowsSelected(this),
|
|
274
|
-
tooltip: this.getSelectedCount() === 0
|
|
275
|
-
? TableUtils.getResourceText("TBL_SELECT_ALL")
|
|
276
|
-
: TableUtils.getResourceText("TBL_DESELECT_ALL")
|
|
277
|
-
}
|
|
278
|
-
};
|
|
279
|
-
|
|
280
|
-
return mRenderConfig;
|
|
281
|
-
};
|
|
261
|
+
oHeaderSelector.setVisible(!oPlugin.getHideHeaderSelector());
|
|
262
|
+
oHeaderSelector.setEnabled(iSelectableCount !== 0);
|
|
263
|
+
oHeaderSelector.setType(sType);
|
|
264
|
+
oHeaderSelector.setCheckBoxSelected(bAllRowsSelected);
|
|
265
|
+
oHeaderSelector.setTooltip(sTooltip);
|
|
266
|
+
oHeaderSelector.setIcon(sIcon);
|
|
267
|
+
}
|
|
282
268
|
|
|
283
269
|
/**
|
|
284
270
|
* Selects all rows if not all are already selected, otherwise the selection is cleared.
|
|
@@ -287,7 +273,7 @@ sap.ui.define([
|
|
|
287
273
|
* @returns {boolean} The state of selection. true - all selected, false - all cleared, undefined - no action
|
|
288
274
|
*/
|
|
289
275
|
function toggleSelectAll(oPlugin) {
|
|
290
|
-
if (areAllRowsSelected(oPlugin)) {
|
|
276
|
+
if (areAllRowsSelected(getSelectableCount(oPlugin), oPlugin.getSelectedCount())) {
|
|
291
277
|
oPlugin.clearSelection();
|
|
292
278
|
return false;
|
|
293
279
|
} else if (oPlugin._isLimitDisabled()) {
|
|
@@ -303,16 +289,16 @@ sap.ui.define([
|
|
|
303
289
|
/**
|
|
304
290
|
* Checks if all rows are selected.
|
|
305
291
|
*
|
|
306
|
-
* @param {
|
|
292
|
+
* @param {int} iSelectableCount The number of selectable rows.
|
|
293
|
+
* @param {int} iSelectedCount The number of selected rows.
|
|
307
294
|
* @returns {boolean} Whether all rows are selected.
|
|
308
295
|
*/
|
|
309
|
-
function areAllRowsSelected(
|
|
310
|
-
const iSelectableCount = getSelectableCount(oPlugin);
|
|
296
|
+
function areAllRowsSelected(iSelectableCount, iSelectedCount) {
|
|
311
297
|
/* Fails to return the correct information if there are selected invisible contexts. For example, if a context is selected and after
|
|
312
298
|
* filtering the table contains 1 row with a different, unselected context -> 1 === 1.
|
|
313
299
|
* We would have to load all contexts and check if all selectable contexts are selected. This would significantly impact performance.
|
|
314
300
|
*/
|
|
315
|
-
return iSelectableCount > 0 && iSelectableCount ===
|
|
301
|
+
return iSelectableCount > 0 && iSelectableCount === iSelectedCount;
|
|
316
302
|
}
|
|
317
303
|
|
|
318
304
|
/**
|
|
@@ -321,20 +307,16 @@ sap.ui.define([
|
|
|
321
307
|
ODataV4MultiSelection.prototype.onHeaderSelectorPress = function() {
|
|
322
308
|
ODataV4Selection.prototype.onHeaderSelectorPress.apply(this, arguments);
|
|
323
309
|
|
|
324
|
-
|
|
325
|
-
return;
|
|
326
|
-
}
|
|
310
|
+
const oHeaderSelector = this._getHeaderSelector();
|
|
327
311
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
if (!mRenderConfig.headerSelector.visible || !mRenderConfig.headerSelector.enabled) {
|
|
312
|
+
if (!oHeaderSelector.getVisible() || !oHeaderSelector.getEnabled()) {
|
|
331
313
|
return;
|
|
332
314
|
}
|
|
333
315
|
|
|
334
|
-
if (
|
|
316
|
+
if (oHeaderSelector.getType() === "CheckBox") {
|
|
335
317
|
toggleSelectAll(this);
|
|
336
|
-
|
|
337
|
-
|
|
318
|
+
} else if (oHeaderSelector.getType() === "Icon") {
|
|
319
|
+
if (this.getSelectedCount() > 0) {
|
|
338
320
|
this.clearSelection();
|
|
339
321
|
} else {
|
|
340
322
|
const oBinding = this.getControl().getBinding();
|
|
@@ -370,8 +352,10 @@ sap.ui.define([
|
|
|
370
352
|
};
|
|
371
353
|
|
|
372
354
|
ODataV4MultiSelection.prototype.setLimit = function(iLimit) {
|
|
373
|
-
this.setProperty("limit", iLimit);
|
|
355
|
+
this.setProperty("limit", iLimit, true);
|
|
374
356
|
_private(this).bLimitReached = false;
|
|
357
|
+
// Full update of the header selector is needed when switching the type. Type checkbox and custom have a different selectable count.
|
|
358
|
+
updateHeaderSelector(this);
|
|
375
359
|
return this;
|
|
376
360
|
};
|
|
377
361
|
|
|
@@ -379,17 +363,32 @@ sap.ui.define([
|
|
|
379
363
|
attachToBinding(this, oBinding);
|
|
380
364
|
}
|
|
381
365
|
|
|
366
|
+
function onTotalRowCountChanged() {
|
|
367
|
+
updateHeaderSelector(this);
|
|
368
|
+
}
|
|
369
|
+
|
|
382
370
|
function attachToBinding(oPlugin, oBinding) {
|
|
371
|
+
const oSelectionCountBinding = oBinding.getModel().bindProperty("$selectionCount", oBinding.getHeaderContext());
|
|
372
|
+
|
|
373
|
+
oSelectionCountBinding.attachChange(() => {
|
|
374
|
+
updateHeaderSelector(oPlugin);
|
|
375
|
+
});
|
|
376
|
+
oSelectionCountBinding.initialize();
|
|
377
|
+
|
|
378
|
+
_private(oPlugin).oSelectionCountBinding = oSelectionCountBinding;
|
|
379
|
+
|
|
383
380
|
oBinding?.attachEvent("selectionChanged", clearSelectionCache, oPlugin);
|
|
384
381
|
}
|
|
385
382
|
|
|
386
383
|
function detachFromBinding(oPlugin, oBinding) {
|
|
384
|
+
_private(oPlugin).oSelectionCountBinding?.destroy();
|
|
385
|
+
delete _private(oPlugin).oSelectionCountBinding;
|
|
386
|
+
|
|
387
387
|
oBinding?.detachEvent("selectionChanged", clearSelectionCache, oPlugin);
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
function clearSelectionCache() {
|
|
391
391
|
delete _private(this).aSelectedContexts; // Delete the cached selected contexts to force a recalculation.
|
|
392
|
-
delete _private(this).iSelectableCount; // Delete the cached selectable count to force a recalculation.
|
|
393
392
|
}
|
|
394
393
|
|
|
395
394
|
/**
|
|
@@ -402,6 +401,12 @@ sap.ui.define([
|
|
|
402
401
|
return this.getLimit() === 0;
|
|
403
402
|
};
|
|
404
403
|
|
|
404
|
+
ODataV4MultiSelection.prototype.setHideHeaderSelector = function(bHide) {
|
|
405
|
+
this.setProperty("hideHeaderSelector", bHide, true);
|
|
406
|
+
this._getHeaderSelector()?.setVisible(!bHide);
|
|
407
|
+
return this;
|
|
408
|
+
};
|
|
409
|
+
|
|
405
410
|
/**
|
|
406
411
|
* Calculates the correct start and end index for the range selection, loads the corresponding contexts and sets the selected state.
|
|
407
412
|
*
|
|
@@ -473,7 +478,9 @@ sap.ui.define([
|
|
|
473
478
|
};
|
|
474
479
|
|
|
475
480
|
ODataV4MultiSelection.prototype.onThemeChanged = function() {
|
|
476
|
-
|
|
481
|
+
// Full update of the header selector is needed, because the required icon name needs to be calculated and cannot be determined from the
|
|
482
|
+
// current state of the header selector.
|
|
483
|
+
updateHeaderSelector(this);
|
|
477
484
|
};
|
|
478
485
|
|
|
479
486
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -35,7 +35,7 @@ sap.ui.define([
|
|
|
35
35
|
* @extends sap.ui.table.plugins.SelectionPlugin
|
|
36
36
|
*
|
|
37
37
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
38
|
+
* @version 1.144.0
|
|
39
39
|
*
|
|
40
40
|
* @private
|
|
41
41
|
* @alias sap.ui.table.plugins.ODataV4Selection
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -36,7 +36,7 @@ sap.ui.define([
|
|
|
36
36
|
* @extends sap.ui.table.plugins.SelectionPlugin
|
|
37
37
|
*
|
|
38
38
|
* @author SAP SE
|
|
39
|
-
* @version 1.
|
|
39
|
+
* @version 1.144.0
|
|
40
40
|
*
|
|
41
41
|
* @public
|
|
42
42
|
* @since 1.140
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
* @extends sap.ui.core.Element
|
|
20
20
|
*
|
|
21
21
|
* @author SAP SE
|
|
22
|
-
* @version 1.
|
|
22
|
+
* @version 1.144.0
|
|
23
23
|
*
|
|
24
24
|
* @private
|
|
25
25
|
* @experimental Since 1.75
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -26,7 +26,7 @@ sap.ui.define([
|
|
|
26
26
|
* @extends sap.ui.table.plugins.SelectionPlugin
|
|
27
27
|
*
|
|
28
28
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
29
|
+
* @version 1.144.0
|
|
30
30
|
*
|
|
31
31
|
* @private
|
|
32
32
|
* @alias sap.ui.table.plugins.SelectionModelSelection
|
|
@@ -82,6 +82,7 @@ sap.ui.define([
|
|
|
82
82
|
SelectionPlugin.prototype.onActivate.apply(this, arguments);
|
|
83
83
|
this.oSelectionModel.attachSelectionChanged(onSelectionChange, this);
|
|
84
84
|
attachToBinding(this, oTable.getBinding());
|
|
85
|
+
updateHeaderSelector(this);
|
|
85
86
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.TotalRowCountChanged, onTotalRowCountChanged, this);
|
|
86
87
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.UnbindRows, onTableUnbindRows, this);
|
|
87
88
|
TableUtils.Hook.register(oTable, TableUtils.Hook.Keys.Table.RowsBound, onTableRowsBound, this);
|
|
@@ -124,17 +125,25 @@ sap.ui.define([
|
|
|
124
125
|
};
|
|
125
126
|
|
|
126
127
|
/**
|
|
127
|
-
*
|
|
128
|
+
* Updates the header selector based on the current selection state.
|
|
129
|
+
*
|
|
130
|
+
* @param {sap.ui.table.plugins.SelectionModelSelection} oPlugin The plugin instance
|
|
131
|
+
* @private
|
|
128
132
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
function updateHeaderSelector(oPlugin) {
|
|
134
|
+
const oHeaderSelector = oPlugin._getHeaderSelector();
|
|
135
|
+
|
|
136
|
+
if (!oPlugin.isActive() || !oHeaderSelector) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const iSelectableCount = oPlugin.getSelectableCount();
|
|
141
|
+
|
|
142
|
+
oHeaderSelector.setVisible(TableUtils.hasSelectAll(oPlugin.getControl()));
|
|
143
|
+
oHeaderSelector.setEnabled(true);
|
|
144
|
+
oHeaderSelector.setType("CheckBox");
|
|
145
|
+
oHeaderSelector.setCheckBoxSelected(iSelectableCount > 0 && iSelectableCount === oPlugin.getSelectedCount());
|
|
146
|
+
}
|
|
138
147
|
|
|
139
148
|
function toggleSelectAll(oPlugin) {
|
|
140
149
|
const oTable = oPlugin.getControl();
|
|
@@ -166,7 +175,7 @@ sap.ui.define([
|
|
|
166
175
|
* @private
|
|
167
176
|
*/
|
|
168
177
|
SelectionModelSelection.prototype.onHeaderSelectorPress = function() {
|
|
169
|
-
if (this.
|
|
178
|
+
if (this._getHeaderSelector().getVisible()) {
|
|
170
179
|
toggleSelectAll(this);
|
|
171
180
|
}
|
|
172
181
|
};
|
|
@@ -331,6 +340,8 @@ sap.ui.define([
|
|
|
331
340
|
this.oSelectionModel.setSelectionMode(getSelectionModelSelectionMode(this.getSelectionMode()));
|
|
332
341
|
}
|
|
333
342
|
|
|
343
|
+
updateHeaderSelector(this);
|
|
344
|
+
|
|
334
345
|
return this;
|
|
335
346
|
};
|
|
336
347
|
|
|
@@ -363,6 +374,8 @@ sap.ui.define([
|
|
|
363
374
|
const aRowIndices = oEvent.getParameter("rowIndices");
|
|
364
375
|
const bSelectAll = oEvent.getParameter("selectAll");
|
|
365
376
|
|
|
377
|
+
updateHeaderSelector(this);
|
|
378
|
+
|
|
366
379
|
if (!this._bSuppressSelectionChangeEvent) {
|
|
367
380
|
this.fireSelectionChange({
|
|
368
381
|
rowIndices: aRowIndices,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -21,7 +21,7 @@ sap.ui.define([
|
|
|
21
21
|
* @extends sap.ui.core.Element
|
|
22
22
|
*
|
|
23
23
|
* @author SAP SE
|
|
24
|
-
* @version 1.
|
|
24
|
+
* @version 1.144.0
|
|
25
25
|
*
|
|
26
26
|
* @public
|
|
27
27
|
* @since 1.64
|
|
@@ -61,28 +61,30 @@ sap.ui.define([
|
|
|
61
61
|
SelectionPlugin.prototype.setParent = function(oParent) {
|
|
62
62
|
const oOldParent = this.getParent();
|
|
63
63
|
|
|
64
|
-
PluginBase.prototype.setParent.apply(this, arguments);
|
|
65
|
-
|
|
66
64
|
oOldParent?._onSelectionPluginChange();
|
|
67
65
|
if (oOldParent !== oParent) {
|
|
68
66
|
oParent?._onSelectionPluginChange();
|
|
69
67
|
}
|
|
70
68
|
|
|
69
|
+
PluginBase.prototype.setParent.apply(this, arguments);
|
|
70
|
+
|
|
71
71
|
return this;
|
|
72
72
|
};
|
|
73
73
|
|
|
74
|
+
SelectionPlugin.prototype.onDeactivate = function() {
|
|
75
|
+
PluginBase.prototype.onDeactivate.apply(this, arguments);
|
|
76
|
+
this._getHeaderSelector()?.setVisible(false);
|
|
77
|
+
};
|
|
78
|
+
|
|
74
79
|
/**
|
|
75
|
-
*
|
|
80
|
+
* Returns the table's header selector control if available.
|
|
81
|
+
* Only the table's main selection plugin can access the table's header selector.
|
|
76
82
|
*
|
|
77
|
-
* @returns {
|
|
83
|
+
* @returns {sap.ui.table.HeaderSelector|undefined}
|
|
78
84
|
* @private
|
|
79
85
|
*/
|
|
80
|
-
SelectionPlugin.prototype.
|
|
81
|
-
return
|
|
82
|
-
headerSelector: {
|
|
83
|
-
type: "none"
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
+
SelectionPlugin.prototype._getHeaderSelector = function() {
|
|
87
|
+
return this.isMainSelectionPlugin ? this.getControl()?._getHeaderSelector() : undefined;
|
|
86
88
|
};
|
|
87
89
|
|
|
88
90
|
/**
|
|
@@ -91,7 +93,7 @@ sap.ui.define([
|
|
|
91
93
|
*
|
|
92
94
|
* @private
|
|
93
95
|
*/
|
|
94
|
-
SelectionPlugin.prototype.onHeaderSelectorPress = function() {};
|
|
96
|
+
SelectionPlugin.prototype.onHeaderSelectorPress = function() { };
|
|
95
97
|
|
|
96
98
|
/**
|
|
97
99
|
* This hook is called when a keyboard shortcut relevant for selection is pressed.
|
|
@@ -102,7 +104,7 @@ sap.ui.define([
|
|
|
102
104
|
* @param {sap.ui.base.Event} oEvent The emitted event.
|
|
103
105
|
* @private
|
|
104
106
|
*/
|
|
105
|
-
SelectionPlugin.prototype.onKeyboardShortcut = function(sType, oEvent) {};
|
|
107
|
+
SelectionPlugin.prototype.onKeyboardShortcut = function(sType, oEvent) { };
|
|
106
108
|
|
|
107
109
|
/**
|
|
108
110
|
* Changes the selection state of a row.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -38,7 +38,7 @@ sap.ui.define([
|
|
|
38
38
|
* @public
|
|
39
39
|
*
|
|
40
40
|
* @author SAP SE
|
|
41
|
-
* @version 1.
|
|
41
|
+
* @version 1.144.0
|
|
42
42
|
*/
|
|
43
43
|
const AutoRowMode = RowMode.extend("sap.ui.table.rowmodes.Auto", /** @lends sap.ui.table.rowmodes.Auto.prototype */ {
|
|
44
44
|
metadata: {
|
|
@@ -550,7 +550,7 @@ sap.ui.define([
|
|
|
550
550
|
}
|
|
551
551
|
|
|
552
552
|
if (iOldComputedRowCount !== iNewComputedRowCount) {
|
|
553
|
-
this.
|
|
553
|
+
this.invalidate();
|
|
554
554
|
} else {
|
|
555
555
|
// TODO: The check for reason=Zoom can be removed once the table is changed to a div-based layout.
|
|
556
556
|
if (oOldRowCount !== iNewRowCount || sReason === TableUtils.RowsUpdateReason.Zoom) {
|
|
@@ -630,11 +630,7 @@ sap.ui.define([
|
|
|
630
630
|
* @this sap.ui.table.rowmodes.Auto
|
|
631
631
|
*/
|
|
632
632
|
TableDelegate.onBeforeRendering = function(oEvent) {
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
if (!bRenderedRows) {
|
|
636
|
-
this.stopAutoRowMode();
|
|
637
|
-
}
|
|
633
|
+
this.stopAutoRowMode();
|
|
638
634
|
};
|
|
639
635
|
|
|
640
636
|
/**
|
|
@@ -642,11 +638,7 @@ sap.ui.define([
|
|
|
642
638
|
* @this sap.ui.table.rowmodes.Auto
|
|
643
639
|
*/
|
|
644
640
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
if (!bRenderedRows) {
|
|
648
|
-
this.startAutoRowMode();
|
|
649
|
-
}
|
|
641
|
+
this.startAutoRowMode();
|
|
650
642
|
};
|
|
651
643
|
|
|
652
644
|
function signalStartTableUpdate(oRowMode) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
* OpenUI5
|
|
3
|
-
* (c) Copyright
|
|
3
|
+
* (c) Copyright 2026 SAP SE or an SAP affiliate company.
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
@@ -27,7 +27,7 @@ sap.ui.define([
|
|
|
27
27
|
* @public
|
|
28
28
|
*
|
|
29
29
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
30
|
+
* @version 1.144.0
|
|
31
31
|
*/
|
|
32
32
|
const FixedRowMode = RowMode.extend("sap.ui.table.rowmodes.Fixed", /** @lends sap.ui.table.rowmodes.Fixed.prototype */ {
|
|
33
33
|
metadata: {
|
|
@@ -275,9 +275,8 @@ sap.ui.define([
|
|
|
275
275
|
*/
|
|
276
276
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
277
277
|
const oTable = this.getTable();
|
|
278
|
-
const bRenderedRows = oEvent && oEvent.isMarked("renderRows");
|
|
279
278
|
|
|
280
|
-
if (
|
|
279
|
+
if (oTable.getRows().length > 0) {
|
|
281
280
|
this.fireRowsUpdated(TableUtils.RowsUpdateReason.Render);
|
|
282
281
|
}
|
|
283
282
|
};
|