@openui5/sap.ui.table 1.123.0 → 1.124.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/.eslintrc.json +9 -1
- package/package.json +3 -3
- package/src/sap/ui/table/.library +1 -1
- package/src/sap/ui/table/AnalyticalColumn.js +40 -40
- package/src/sap/ui/table/AnalyticalColumnMenu.js +11 -11
- package/src/sap/ui/table/AnalyticalTable.js +107 -107
- package/src/sap/ui/table/Column.js +83 -83
- package/src/sap/ui/table/ColumnMenu.js +54 -54
- package/src/sap/ui/table/CreationRow.js +29 -29
- package/src/sap/ui/table/CreationRowRenderer.js +21 -21
- package/src/sap/ui/table/Row.js +55 -56
- package/src/sap/ui/table/RowAction.js +27 -27
- package/src/sap/ui/table/RowActionItem.js +7 -7
- package/src/sap/ui/table/RowActionRenderer.js +3 -3
- package/src/sap/ui/table/RowSettings.js +28 -37
- package/src/sap/ui/table/Table.js +263 -266
- package/src/sap/ui/table/TablePersoController.js +46 -46
- package/src/sap/ui/table/TableRenderer.js +112 -113
- package/src/sap/ui/table/TreeTable.js +16 -16
- package/src/sap/ui/table/designtime/Table.designtime.js +2 -2
- package/src/sap/ui/table/extensions/Accessibility.js +185 -181
- package/src/sap/ui/table/extensions/AccessibilityRender.js +15 -15
- package/src/sap/ui/table/extensions/DragAndDrop.js +47 -47
- package/src/sap/ui/table/extensions/ExtensionBase.js +9 -9
- package/src/sap/ui/table/extensions/Keyboard.js +40 -40
- package/src/sap/ui/table/extensions/KeyboardDelegate.js +257 -264
- package/src/sap/ui/table/extensions/Pointer.js +108 -109
- package/src/sap/ui/table/extensions/Scrolling.js +289 -285
- package/src/sap/ui/table/extensions/ScrollingIOS.js +50 -50
- package/src/sap/ui/table/extensions/Synchronization.js +32 -32
- package/src/sap/ui/table/library.js +12 -12
- package/src/sap/ui/table/menus/ColumnHeaderMenuAdapter.js +9 -9
- package/src/sap/ui/table/menus/LegacyColumnMenuAdapter.js +35 -37
- package/src/sap/ui/table/menus/MobileColumnHeaderMenuAdapter.js +23 -23
- package/src/sap/ui/table/messagebundle_sh.properties +9 -9
- package/src/sap/ui/table/plugins/BindingSelection.js +26 -25
- package/src/sap/ui/table/plugins/MultiSelectionPlugin.js +77 -32
- package/src/sap/ui/table/plugins/ODataV4Selection.js +81 -35
- package/src/sap/ui/table/plugins/PluginBase.js +12 -12
- package/src/sap/ui/table/plugins/SelectionModelSelection.js +13 -12
- package/src/sap/ui/table/plugins/SelectionPlugin.js +3 -3
- package/src/sap/ui/table/plugins/V4Aggregation.js +38 -38
- package/src/sap/ui/table/rowmodes/Auto.js +59 -61
- package/src/sap/ui/table/rowmodes/Fixed.js +18 -18
- package/src/sap/ui/table/rowmodes/Interactive.js +42 -44
- package/src/sap/ui/table/rowmodes/RowMode.js +64 -63
- package/src/sap/ui/table/rowmodes/Type.js +1 -1
- package/src/sap/ui/table/rowmodes/Variable.js +4 -4
- package/src/sap/ui/table/rules/Accessibility.support.js +15 -16
- package/src/sap/ui/table/rules/Binding.support.js +11 -11
- package/src/sap/ui/table/rules/ColumnTemplate.support.js +10 -10
- package/src/sap/ui/table/rules/Plugins.support.js +7 -7
- package/src/sap/ui/table/rules/Rows.support.js +29 -29
- package/src/sap/ui/table/rules/TableHelper.support.js +10 -10
- package/src/sap/ui/table/themes/base/library.source.less +2 -0
- package/src/sap/ui/table/utils/TableUtils.js +130 -128
- package/src/sap/ui/table/utils/_BindingUtils.js +7 -7
- package/src/sap/ui/table/utils/_ColumnUtils.js +98 -97
- package/src/sap/ui/table/utils/_GroupingUtils.js +56 -56
- package/src/sap/ui/table/utils/_HookUtils.js +26 -26
- package/src/sap/ui/table/utils/_MenuUtils.js +19 -19
|
@@ -19,7 +19,7 @@ sap.ui.define([
|
|
|
19
19
|
"use strict";
|
|
20
20
|
|
|
21
21
|
// shortcut for sap.ui.table.ResetAllMode
|
|
22
|
-
|
|
22
|
+
const ResetAllMode = Library.ResetAllMode;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Constructor for a new TablePersoController.
|
|
@@ -34,14 +34,14 @@ sap.ui.define([
|
|
|
34
34
|
* @extends sap.ui.base.ManagedObject
|
|
35
35
|
*
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.124.0
|
|
38
38
|
* @since 1.21.1
|
|
39
39
|
*
|
|
40
40
|
* @constructor
|
|
41
41
|
* @public
|
|
42
42
|
* @alias sap.ui.table.TablePersoController
|
|
43
43
|
*/
|
|
44
|
-
|
|
44
|
+
const TablePersoController = ManagedObject.extend("sap.ui.table.TablePersoController", /** @lends sap.ui.table.TablePersoController.prototype */ {
|
|
45
45
|
|
|
46
46
|
constructor: function(sId, mSettings) {
|
|
47
47
|
ManagedObject.apply(this, arguments);
|
|
@@ -149,7 +149,7 @@ sap.ui.define([
|
|
|
149
149
|
*/
|
|
150
150
|
TablePersoController.prototype.exit = function() {
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
const oTable = this._getTable();
|
|
153
153
|
|
|
154
154
|
if (oTable) {
|
|
155
155
|
this._manageTableEventHandlers(oTable, false);
|
|
@@ -176,9 +176,9 @@ sap.ui.define([
|
|
|
176
176
|
"\"getPersData\", \"setPersData\" and \"delPersData\".");
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
|
|
179
|
+
const oOldService = this.getPersoService();
|
|
180
180
|
this.setProperty("persoService", oService, true);
|
|
181
|
-
|
|
181
|
+
const oNewService = this.getPersoService();
|
|
182
182
|
|
|
183
183
|
// refresh data using new service if there was a new service set and a table was set
|
|
184
184
|
if (oNewService && oNewService !== oOldService && this._getTable() && (this.getAutoSave() || !oOldService)) {
|
|
@@ -189,9 +189,9 @@ sap.ui.define([
|
|
|
189
189
|
};
|
|
190
190
|
|
|
191
191
|
TablePersoController.prototype.setAutoSave = function(bAutoSave) {
|
|
192
|
-
|
|
192
|
+
const oOldValue = this.getAutoSave();
|
|
193
193
|
this.setProperty("autoSave", bAutoSave, true);
|
|
194
|
-
|
|
194
|
+
const oNewValue = this.getAutoSave();
|
|
195
195
|
|
|
196
196
|
// save data if autoSave is turned from false to true
|
|
197
197
|
if (oNewValue && !oOldValue) {
|
|
@@ -202,12 +202,12 @@ sap.ui.define([
|
|
|
202
202
|
};
|
|
203
203
|
|
|
204
204
|
TablePersoController.prototype.setTable = function(vTable) {
|
|
205
|
-
|
|
205
|
+
const oOldTable = this._getTable();
|
|
206
206
|
if (oOldTable) {
|
|
207
207
|
oOldTable._oPersoController = undefined; // remove the relationship to the controller
|
|
208
208
|
}
|
|
209
209
|
this.setAssociation("table", vTable, true);
|
|
210
|
-
|
|
210
|
+
const oNewTable = this._getTable();
|
|
211
211
|
if (oNewTable) {
|
|
212
212
|
oNewTable._oPersoController = this; // set the relationship to controller (debugging & performance opts)
|
|
213
213
|
}
|
|
@@ -241,9 +241,9 @@ sap.ui.define([
|
|
|
241
241
|
};
|
|
242
242
|
|
|
243
243
|
TablePersoController.prototype.setCustomDataKey = function(sCustomDataKey) {
|
|
244
|
-
|
|
244
|
+
const sOldValue = this.getCustomDataKey();
|
|
245
245
|
this.setProperty("customDataKey", sCustomDataKey, true);
|
|
246
|
-
|
|
246
|
+
const sNewValue = this.getCustomDataKey();
|
|
247
247
|
|
|
248
248
|
if (this.getResetAllMode() === ResetAllMode.Default && this._getTable()) {
|
|
249
249
|
this._oInitialPersoData = this._getCurrentTablePersoData(true);
|
|
@@ -259,8 +259,8 @@ sap.ui.define([
|
|
|
259
259
|
|
|
260
260
|
TablePersoController.prototype._manageTableEventHandlers = function(oTable, bAttach) {
|
|
261
261
|
// attach or detach the Table Event Handlers (necessary for autosave)
|
|
262
|
-
for (
|
|
263
|
-
|
|
262
|
+
for (let i = 0, l = this._aTableEvents.length; i < l; i++) {
|
|
263
|
+
const fn = oTable[(bAttach ? "attachEvent" : "detachEvent")];
|
|
264
264
|
fn.apply(oTable, [this._aTableEvents[i], this._tableEventHandler, this]);
|
|
265
265
|
}
|
|
266
266
|
};
|
|
@@ -272,12 +272,12 @@ sap.ui.define([
|
|
|
272
272
|
* @public
|
|
273
273
|
*/
|
|
274
274
|
TablePersoController.prototype.refresh = function() {
|
|
275
|
-
|
|
275
|
+
const that = this;
|
|
276
276
|
|
|
277
|
-
|
|
277
|
+
const oService = this.getPersoService();
|
|
278
278
|
if (oService) {
|
|
279
279
|
return oService.getPersData().done(function(oServiceData) {
|
|
280
|
-
|
|
280
|
+
const oData = (oServiceData && Array.isArray(oServiceData.aColumns))
|
|
281
281
|
? oServiceData
|
|
282
282
|
: that._oInitialPersoData; // use initial column definitions
|
|
283
283
|
that._adjustTable(oData);
|
|
@@ -292,7 +292,7 @@ sap.ui.define([
|
|
|
292
292
|
} else {
|
|
293
293
|
Log.error("The Personalization Service is not available!");
|
|
294
294
|
// return a dummy promise and reject it immediately
|
|
295
|
-
|
|
295
|
+
const oDeferred = jQuery.Deferred();
|
|
296
296
|
oDeferred.reject();
|
|
297
297
|
return oDeferred.promise();
|
|
298
298
|
}
|
|
@@ -305,10 +305,10 @@ sap.ui.define([
|
|
|
305
305
|
* @public
|
|
306
306
|
*/
|
|
307
307
|
TablePersoController.prototype.savePersonalizations = function() {
|
|
308
|
-
|
|
308
|
+
const oService = this.getPersoService();
|
|
309
309
|
if (oService) {
|
|
310
310
|
|
|
311
|
-
|
|
311
|
+
const oData = this._getCurrentTablePersoData();
|
|
312
312
|
oData[this._schemaProperty] = this._schemaVersion;
|
|
313
313
|
|
|
314
314
|
return oService.setPersData(oData).fail(function() {
|
|
@@ -318,29 +318,30 @@ sap.ui.define([
|
|
|
318
318
|
} else {
|
|
319
319
|
Log.error("The Personalization Service is not available!");
|
|
320
320
|
// return a dummy promise and reject it immediately
|
|
321
|
-
|
|
321
|
+
const oDeferred = jQuery.Deferred();
|
|
322
322
|
oDeferred.reject();
|
|
323
323
|
return oDeferred.promise();
|
|
324
324
|
}
|
|
325
325
|
};
|
|
326
326
|
|
|
327
327
|
TablePersoController.prototype._adjustTable = function(oData) {
|
|
328
|
-
|
|
328
|
+
const oTable = this._getTable();
|
|
329
329
|
if (!oTable || !oData || !Array.isArray(oData.aColumns)) {
|
|
330
330
|
return;
|
|
331
331
|
}
|
|
332
332
|
|
|
333
333
|
// create a persoKey to column map
|
|
334
|
-
|
|
335
|
-
|
|
334
|
+
const mColumns = {};
|
|
335
|
+
const aCols = oTable.getColumns();
|
|
336
|
+
for (let i = 0, l = aCols.length; i < l; i++) {
|
|
336
337
|
mColumns[this._getColumnPersoKey(aCols[i])] = aCols[i];
|
|
337
338
|
}
|
|
338
339
|
|
|
339
|
-
|
|
340
|
+
const aColumns = oData.aColumns;
|
|
340
341
|
|
|
341
|
-
for (
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
for (let i = 0, l = aColumns.length; i < l; i++) {
|
|
343
|
+
const oColumnInfo = aColumns[i]; // P13N info object
|
|
344
|
+
const oColumn = mColumns[oColumnInfo.id];
|
|
344
345
|
|
|
345
346
|
// only if the column is available in the table
|
|
346
347
|
// e.g. if the Table has been removed or renamed => ignore!
|
|
@@ -352,12 +353,12 @@ sap.ui.define([
|
|
|
352
353
|
oTable.insertColumn(oColumn, oColumnInfo.order);
|
|
353
354
|
}
|
|
354
355
|
|
|
355
|
-
|
|
356
|
-
for (
|
|
357
|
-
|
|
356
|
+
const oMetadata = oColumn.getMetadata();
|
|
357
|
+
for (let j = 0, lj = this._aColumnProperties.length; j < lj; j++) {
|
|
358
|
+
const sProperty = this._aColumnProperties[j];
|
|
358
359
|
if (oColumnInfo[sProperty] !== undefined) {
|
|
359
360
|
try {
|
|
360
|
-
if (oMetadata.hasProperty(sProperty) && oColumn.getProperty(sProperty)
|
|
361
|
+
if (oMetadata.hasProperty(sProperty) && oColumn.getProperty(sProperty) !== oColumnInfo[sProperty]) {
|
|
361
362
|
oColumn.setProperty(sProperty, oColumnInfo[sProperty]);
|
|
362
363
|
}
|
|
363
364
|
} catch (ex) {
|
|
@@ -378,7 +379,7 @@ sap.ui.define([
|
|
|
378
379
|
|
|
379
380
|
TablePersoController.prototype._tableEventHandler = function(oEvent) {
|
|
380
381
|
if (this.getAutoSave() && !this._iTriggerSaveTimeout) {
|
|
381
|
-
|
|
382
|
+
const that = this;
|
|
382
383
|
this._iTriggerSaveTimeout = setTimeout(function() {
|
|
383
384
|
that.savePersonalizations();
|
|
384
385
|
that._iTriggerSaveTimeout = null;
|
|
@@ -387,23 +388,22 @@ sap.ui.define([
|
|
|
387
388
|
};
|
|
388
389
|
|
|
389
390
|
TablePersoController.prototype._getCurrentTablePersoData = function(bForDialog) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
var oData = {
|
|
391
|
+
const oTable = this._getTable();
|
|
392
|
+
const aColumns = oTable.getColumns();
|
|
393
|
+
const oData = {
|
|
394
394
|
aColumns: []
|
|
395
395
|
};
|
|
396
396
|
|
|
397
|
-
for (
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
397
|
+
for (let i = 0, l = aColumns.length; i < l; i++) {
|
|
398
|
+
const oColumn = aColumns[i];
|
|
399
|
+
const sPersoKey = this._getColumnPersoKey(oColumn);
|
|
400
|
+
const oColumnInfo = {
|
|
401
401
|
id: sPersoKey,
|
|
402
402
|
order: i
|
|
403
403
|
};
|
|
404
|
-
|
|
405
|
-
for (
|
|
406
|
-
|
|
404
|
+
const oMetadata = oColumn.getMetadata();
|
|
405
|
+
for (let j = 0, lj = this._aColumnProperties.length; j < lj; j++) {
|
|
406
|
+
const sProperty = this._aColumnProperties[j];
|
|
407
407
|
if (oMetadata.hasProperty(sProperty)) {
|
|
408
408
|
oColumnInfo[sProperty] = oColumn.getProperty(sProperty);
|
|
409
409
|
}
|
|
@@ -426,7 +426,7 @@ sap.ui.define([
|
|
|
426
426
|
};
|
|
427
427
|
|
|
428
428
|
TablePersoController.prototype._getPersoKey = function(oControl) {
|
|
429
|
-
|
|
429
|
+
let sPersoKey = oControl.data(this.getCustomDataKey());
|
|
430
430
|
if (!sPersoKey) {
|
|
431
431
|
sPersoKey = oControl.getId();
|
|
432
432
|
if (sPersoKey.indexOf(ManagedObjectMetadata.getUIDPrefix()) === 0) {
|
|
@@ -448,7 +448,7 @@ sap.ui.define([
|
|
|
448
448
|
* @experimental since 1.21.2 - API might change / feature requires the sap.m library!
|
|
449
449
|
*/
|
|
450
450
|
TablePersoController.prototype.openDialog = function(mSettings) {
|
|
451
|
-
|
|
451
|
+
const that = this;
|
|
452
452
|
|
|
453
453
|
function _open() {
|
|
454
454
|
if (that._oDialog) {
|