@openui5/sap.ui.table 1.117.0 → 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
|
@@ -88,7 +88,6 @@ sap.ui.define([
|
|
|
88
88
|
|
|
89
89
|
this._bLimitReached = false;
|
|
90
90
|
this.oDeselectAllIcon = oIcon;
|
|
91
|
-
this._oNotificationPopover = null;
|
|
92
91
|
this._oRangeSelectionStartContext = null;
|
|
93
92
|
};
|
|
94
93
|
|
|
@@ -99,11 +98,6 @@ sap.ui.define([
|
|
|
99
98
|
this.oDeselectAllIcon.destroy();
|
|
100
99
|
this.oDeselectAllIcon = null;
|
|
101
100
|
}
|
|
102
|
-
|
|
103
|
-
if (this._oNotificationPopover) {
|
|
104
|
-
this._oNotificationPopover.destroy();
|
|
105
|
-
this._oNotificationPopover = null;
|
|
106
|
-
}
|
|
107
101
|
};
|
|
108
102
|
|
|
109
103
|
ODataV4Selection.prototype.onActivate = function(oTable) {
|
|
@@ -116,10 +110,6 @@ sap.ui.define([
|
|
|
116
110
|
oTable.detachFirstVisibleRowChanged(this.onFirstVisibleRowChange, this);
|
|
117
111
|
oTable.setProperty("selectionMode", TableSelectionMode.None);
|
|
118
112
|
this.clearSelection();
|
|
119
|
-
|
|
120
|
-
if (this._oNotificationPopover) {
|
|
121
|
-
this._oNotificationPopover.close();
|
|
122
|
-
}
|
|
123
113
|
};
|
|
124
114
|
|
|
125
115
|
ODataV4Selection.prototype.setSelected = function(oRow, bSelected, mConfig) {
|
|
@@ -131,19 +121,21 @@ sap.ui.define([
|
|
|
131
121
|
|
|
132
122
|
if (mConfig && mConfig.range) {
|
|
133
123
|
extendLastSelectionTo(this, oRow);
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (this.isSelected(oRow) === bSelected) {
|
|
137
128
|
return;
|
|
138
129
|
}
|
|
139
130
|
|
|
140
131
|
if (this.getSelectionMode() === SelectionMode.Single) {
|
|
141
|
-
this.
|
|
132
|
+
this._bSuppressSelectionChangeEvent = true;
|
|
133
|
+
this.clearSelection();
|
|
142
134
|
}
|
|
143
135
|
|
|
144
136
|
oContext.setSelected(bSelected);
|
|
145
137
|
this._oRangeSelectionStartContext = bSelected && this.getSelectionMode() === SelectionMode.MultiToggle ? oContext : null;
|
|
146
|
-
this.fireSelectionChange();
|
|
138
|
+
this.fireSelectionChange();
|
|
147
139
|
};
|
|
148
140
|
|
|
149
141
|
ODataV4Selection.prototype.setSelectedContexts = function(aContexts) {
|
|
@@ -207,7 +199,9 @@ sap.ui.define([
|
|
|
207
199
|
oPlugin.clearSelection();
|
|
208
200
|
} else if (oPlugin._isLimitDisabled()) {
|
|
209
201
|
var oBinding = oPlugin.getTableBinding();
|
|
210
|
-
|
|
202
|
+
if (oBinding && oBinding.getLength()) {
|
|
203
|
+
select(oPlugin, 0, oBinding.getLength() - 1);
|
|
204
|
+
}
|
|
211
205
|
}
|
|
212
206
|
}
|
|
213
207
|
|
|
@@ -292,16 +286,23 @@ sap.ui.define([
|
|
|
292
286
|
};
|
|
293
287
|
|
|
294
288
|
/**
|
|
295
|
-
*
|
|
289
|
+
* Returns <code>true</code> if the selection limit has been reached (only the last selection), <code>false</code> otherwise.
|
|
290
|
+
*
|
|
291
|
+
* @return {boolean}
|
|
292
|
+
*/
|
|
293
|
+
ODataV4Selection.prototype.isLimitReached = function() {
|
|
294
|
+
return this._bLimitReached;
|
|
295
|
+
};
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Calculates the correct start and end index for the range selection, loads the corresponding contexts and sets the selected state.
|
|
296
299
|
*
|
|
297
300
|
* @param {sap.ui.table.plugins.ODataV4Selection} oPlugin The selection plugin.
|
|
298
301
|
* @param {int} iIndexFrom The start index of the range selection.
|
|
299
302
|
* @param {int} iIndexTo The end index of the range selection.
|
|
300
|
-
* @return {Promise<{indexTo: int, indexFrom: int, contexts: sap.ui.model.odata.v4.Context[]}>}
|
|
301
|
-
* A promise that resolves with the corrected start and end index when the contexts are loaded. The Promise is rejected if the index is out of
|
|
302
|
-
* range.
|
|
303
303
|
*/
|
|
304
|
-
function
|
|
304
|
+
function select(oPlugin, iIndexFrom, iIndexTo) {
|
|
305
|
+
var oTable = oPlugin.getTable();
|
|
305
306
|
var iLimit = oPlugin.getLimit();
|
|
306
307
|
var bUpwardSelection = iIndexTo < iIndexFrom; // Indicates whether the selection is made from bottom to top.
|
|
307
308
|
var iGetContextsStartIndex = bUpwardSelection ? iIndexTo : iIndexFrom;
|
|
@@ -320,44 +321,36 @@ sap.ui.define([
|
|
|
320
321
|
|
|
321
322
|
// The table will be scrolled one row further to make it transparent for the user where the selection ends.
|
|
322
323
|
// load the extra row here to avoid additional batch request.
|
|
323
|
-
iGetContextsLength = iLimit + 1;
|
|
324
|
+
iGetContextsLength = iLimit + 1;
|
|
324
325
|
}
|
|
325
326
|
}
|
|
326
327
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
var bContextsAvailable = aContexts.length === iLength && !aContexts.includes(undefined);
|
|
335
|
-
|
|
336
|
-
if (bContextsAvailable) {
|
|
337
|
-
return Promise.resolve(aContexts);
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
return new Promise(function(resolve) {
|
|
341
|
-
oBinding.attachEventOnce("dataReceived", function() {
|
|
342
|
-
resolve(loadContexts(oBinding, iStartIndex, iLength));
|
|
343
|
-
});
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
function select(oPlugin, iIndexFrom, iIndexTo) {
|
|
348
|
-
if (iIndexFrom < 0 || iIndexTo < 0) {
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
loadLimitedContexts(oPlugin, iIndexFrom, iIndexTo).then(function(mSelectionInfo) {
|
|
353
|
-
mSelectionInfo.contexts.forEach(function(oContext) {
|
|
354
|
-
if (isContextSelectable(oContext)) {
|
|
328
|
+
var bSelectionChange = false;
|
|
329
|
+
TableUtils.loadContexts(oPlugin.getTableBinding(), iGetContextsStartIndex, iGetContextsLength).then(function(aContexts) {
|
|
330
|
+
aContexts.forEach(function(oContext) {
|
|
331
|
+
if (!isContextSelectable(oContext) || oContext.isSelected()) {
|
|
332
|
+
return;
|
|
333
|
+
}
|
|
334
|
+
if (bUpwardSelection && oContext.getIndex() >= iIndexTo || oContext.getIndex() <= iIndexTo) {
|
|
355
335
|
oContext.setSelected(true);
|
|
336
|
+
bSelectionChange = true;
|
|
337
|
+
}
|
|
338
|
+
if (oContext.getIndex() === iIndexTo) {
|
|
339
|
+
oPlugin._oRangeSelectionStartContext = oContext;
|
|
356
340
|
}
|
|
357
341
|
});
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
342
|
+
|
|
343
|
+
if (oPlugin.isLimitReached()) {
|
|
344
|
+
TableUtils.scrollTableToIndex(oTable, iIndexTo, bUpwardSelection).then(function() {
|
|
345
|
+
if (oPlugin.getEnableNotification()) {
|
|
346
|
+
TableUtils.showNotificationPopoverAtIndex(oTable, iIndexTo, oPlugin.getLimit());
|
|
347
|
+
}
|
|
348
|
+
});
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
if (bSelectionChange) {
|
|
352
|
+
oPlugin.fireSelectionChange();
|
|
353
|
+
}
|
|
361
354
|
});
|
|
362
355
|
}
|
|
363
356
|
|
|
@@ -376,9 +369,10 @@ sap.ui.define([
|
|
|
376
369
|
oContext.setSelected(false);
|
|
377
370
|
});
|
|
378
371
|
|
|
379
|
-
if (bContextDeselected) {
|
|
372
|
+
if (bContextDeselected && !this._bSuppressSelectionChangeEvent) {
|
|
380
373
|
this.fireSelectionChange();
|
|
381
374
|
}
|
|
375
|
+
this._bSuppressSelectionChangeEvent = false;
|
|
382
376
|
};
|
|
383
377
|
|
|
384
378
|
ODataV4Selection.prototype.getSelectedContexts = function() {
|
|
@@ -389,124 +383,6 @@ sap.ui.define([
|
|
|
389
383
|
}) : [];
|
|
390
384
|
};
|
|
391
385
|
|
|
392
|
-
/**
|
|
393
|
-
* If the limit is reached, the table is scrolled to the <code>iIndex</code>.
|
|
394
|
-
* If <code>bReverse</code> is true the <code>firstVisibleRow</code> property of the Table is set to <code>iIndex</code> - 1,
|
|
395
|
-
* otherwise to <code>iIndex</code> - row count + 2.
|
|
396
|
-
*
|
|
397
|
-
* @param {int} iIndex The index of the row to which to scroll to.
|
|
398
|
-
* @param {boolean} bReverse Whether the row should be displayed at the bottom of the table.
|
|
399
|
-
* @returns {Promise} A promise that resolves when the table is scrolled.
|
|
400
|
-
* @private
|
|
401
|
-
* TODO: For reuse between this plugin and MultiSelectionPlugin, move this to utils
|
|
402
|
-
*/
|
|
403
|
-
ODataV4Selection.prototype._scrollTableToIndex = function(iIndex, bReverse) {
|
|
404
|
-
var oTable = this.getParent();
|
|
405
|
-
|
|
406
|
-
if (!oTable || !this._bLimitReached) {
|
|
407
|
-
return Promise.resolve();
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
var iFirstVisibleRow = oTable.getFirstVisibleRow();
|
|
411
|
-
var mRowCounts = oTable._getRowCounts();
|
|
412
|
-
var iLastVisibleRow = iFirstVisibleRow + mRowCounts.scrollable - 1;
|
|
413
|
-
var bExpectRowsUpdatedEvent = false;
|
|
414
|
-
|
|
415
|
-
if (iIndex < iFirstVisibleRow || iIndex > iLastVisibleRow) {
|
|
416
|
-
var iNewIndex = bReverse ? iIndex - mRowCounts.fixedTop - 1 : iIndex - mRowCounts.scrollable - mRowCounts.fixedTop + 2;
|
|
417
|
-
|
|
418
|
-
bExpectRowsUpdatedEvent = oTable._setFirstVisibleRowIndex(Math.max(0, iNewIndex));
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
this._showNotificationPopoverAtIndex(iIndex);
|
|
422
|
-
|
|
423
|
-
return new Promise(function(resolve) {
|
|
424
|
-
if (bExpectRowsUpdatedEvent) {
|
|
425
|
-
oTable.attachEventOnce("rowsUpdated", resolve);
|
|
426
|
-
} else {
|
|
427
|
-
resolve();
|
|
428
|
-
}
|
|
429
|
-
});
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Displays a notification Popover beside the row selector that indicates a limited selection. The given index
|
|
434
|
-
* references the index of the data context in the binding.
|
|
435
|
-
*
|
|
436
|
-
* @param {number} iIndex - Index of the data context
|
|
437
|
-
* @private
|
|
438
|
-
* @returns {Promise} A Promise that resolves after the notification popover has been opened
|
|
439
|
-
*/
|
|
440
|
-
ODataV4Selection.prototype._showNotificationPopoverAtIndex = function(iIndex) {
|
|
441
|
-
var that = this;
|
|
442
|
-
var oPopover = this._oNotificationPopover;
|
|
443
|
-
var oTable = this.getParent();
|
|
444
|
-
var oRow = oTable.getRows()[iIndex - oTable._getFirstRenderedRowIndex()];
|
|
445
|
-
var sTitle = TableUtils.getResourceText("TBL_SELECT_LIMIT_TITLE");
|
|
446
|
-
var sMessage = TableUtils.getResourceText("TBL_SELECT_LIMIT", [this.getLimit()]);
|
|
447
|
-
|
|
448
|
-
if (!this.getEnableNotification()) {
|
|
449
|
-
return Promise.resolve();
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
return new Promise(function(resolve) {
|
|
453
|
-
sap.ui.require([
|
|
454
|
-
"sap/m/Popover", "sap/m/Bar", "sap/m/Title", "sap/m/Text", "sap/m/HBox", "sap/ui/core/library", "sap/m/library"
|
|
455
|
-
], function(Popover, Bar, Title, Text, HBox, coreLib, mLib) {
|
|
456
|
-
if (!oPopover) {
|
|
457
|
-
oPopover = new Popover(that.getId() + "-notificationPopover", {
|
|
458
|
-
customHeader: [
|
|
459
|
-
new Bar({
|
|
460
|
-
contentMiddle: [
|
|
461
|
-
new HBox({
|
|
462
|
-
items: [
|
|
463
|
-
new Icon({src: "sap-icon://message-warning", color: coreLib.IconColor.Critical})
|
|
464
|
-
.addStyleClass("sapUiTinyMarginEnd"),
|
|
465
|
-
new Title({text: sTitle, level: coreLib.TitleLevel.H2})
|
|
466
|
-
],
|
|
467
|
-
renderType: mLib.FlexRendertype.Bare,
|
|
468
|
-
justifyContent: mLib.FlexJustifyContent.Center,
|
|
469
|
-
alignItems: mLib.FlexAlignItems.Center
|
|
470
|
-
})
|
|
471
|
-
]
|
|
472
|
-
})
|
|
473
|
-
],
|
|
474
|
-
content: new Text({text: sMessage})
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
oPopover.addStyleClass("sapUiContentPadding");
|
|
478
|
-
that._oNotificationPopover = oPopover;
|
|
479
|
-
} else {
|
|
480
|
-
oPopover.getContent()[0].setText(sMessage);
|
|
481
|
-
}
|
|
482
|
-
|
|
483
|
-
oTable.detachFirstVisibleRowChanged(that.onFirstVisibleRowChange, that);
|
|
484
|
-
oTable.attachFirstVisibleRowChanged(that.onFirstVisibleRowChange, that);
|
|
485
|
-
|
|
486
|
-
var oRowSelector = oRow.getDomRefs().rowSelector;
|
|
487
|
-
|
|
488
|
-
if (oRowSelector) {
|
|
489
|
-
oPopover.attachEventOnce("afterOpen", resolve);
|
|
490
|
-
oPopover.openBy(oRowSelector);
|
|
491
|
-
} else {
|
|
492
|
-
resolve();
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
};
|
|
497
|
-
|
|
498
|
-
ODataV4Selection.prototype.onFirstVisibleRowChange = function() {
|
|
499
|
-
if (!this._oNotificationPopover) {
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
var oTable = this.getParent();
|
|
504
|
-
if (oTable) {
|
|
505
|
-
oTable.detachFirstVisibleRowChanged(this.onFirstVisibleRowChange, this);
|
|
506
|
-
}
|
|
507
|
-
this._oNotificationPopover.close();
|
|
508
|
-
};
|
|
509
|
-
|
|
510
386
|
ODataV4Selection.prototype.onThemeChanged = function() {
|
|
511
387
|
this.oDeselectAllIcon.setSrc(IconPool.getIconURI(TableUtils.ThemeParameters.clearSelectionIcon));
|
|
512
388
|
};
|
|
@@ -23,7 +23,7 @@ sap.ui.define([
|
|
|
23
23
|
*
|
|
24
24
|
* @class Implements the selection methods for a Table
|
|
25
25
|
* @extends sap.ui.table.plugins.SelectionPlugin
|
|
26
|
-
* @version 1.
|
|
26
|
+
* @version 1.118.0
|
|
27
27
|
* @constructor
|
|
28
28
|
* @private
|
|
29
29
|
* @alias sap.ui.table.plugins.SelectionModelSelection
|
|
@@ -32,7 +32,7 @@ sap.ui.define([
|
|
|
32
32
|
* @class TODO (don't forget to document fixed row count restrictions because fixed rows are set by this plugin)
|
|
33
33
|
* @extends sap.ui.table.plugins.PluginBase
|
|
34
34
|
* @author SAP SE
|
|
35
|
-
* @version 1.
|
|
35
|
+
* @version 1.118.0
|
|
36
36
|
* @private
|
|
37
37
|
* @since 1.76
|
|
38
38
|
* @experimental
|
|
@@ -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
|
"./RowMode",
|
|
10
9
|
"sap/ui/Device",
|
|
11
10
|
"sap/ui/thirdparty/jquery"
|
|
12
11
|
], function(
|
|
13
|
-
library,
|
|
14
12
|
TableUtils,
|
|
15
13
|
RowMode,
|
|
16
14
|
Device,
|
|
@@ -21,31 +19,59 @@ sap.ui.define([
|
|
|
21
19
|
var _private = TableUtils.createWeakMapFacade();
|
|
22
20
|
|
|
23
21
|
/**
|
|
24
|
-
* Constructor for a new
|
|
22
|
+
* Constructor for a new <code>Auto</code> row mode.
|
|
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
|
* @class
|
|
30
|
-
*
|
|
31
|
-
*
|
|
28
|
+
* The number of rows displayed in the table is calculated based on the space it is allowed to cover (limited by the surrounding container).
|
|
29
|
+
* The table must be rendered without siblings in the DOM. The only exception is if the table's parent element is a flexbox, and the table is a
|
|
30
|
+
* flex item allowed to grow and shrink.
|
|
31
|
+
* The number of rows to be displayed can only be determined after the layout has been completed. The data can already be requested before that.
|
|
32
|
+
* To avoid multiple data requests, the amount of initially requested data is based on the maximum number of potentially displayed rows,
|
|
33
|
+
* which takes the window size into consideration, for example.
|
|
34
|
+
* @extends module:sap/ui/table/rowmodes/RowMode
|
|
32
35
|
* @constructor
|
|
33
|
-
* @alias sap
|
|
36
|
+
* @alias module:sap/ui/table/rowmodes/Auto
|
|
34
37
|
* @private
|
|
35
|
-
* @ui5-restricted sap.ui.mdc
|
|
36
38
|
*
|
|
37
39
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
40
|
+
* @version 1.118.0
|
|
39
41
|
*/
|
|
40
|
-
var AutoRowMode = RowMode.extend("sap.ui.table.rowmodes.
|
|
42
|
+
var AutoRowMode = RowMode.extend("sap.ui.table.rowmodes.Auto", /** @lends sap.ui.table.rowmodes.Auto.prototype */ {
|
|
41
43
|
metadata: {
|
|
42
44
|
library: "sap.ui.table",
|
|
43
45
|
properties: {
|
|
46
|
+
/**
|
|
47
|
+
* The minimum number of displayed rows.
|
|
48
|
+
*/
|
|
44
49
|
minRowCount: {type: "int", defaultValue: 5, group: "Appearance"},
|
|
50
|
+
/**
|
|
51
|
+
* The maximum number of displayed rows. The <code>minRowCount</code> is ignored if the maximum is lower than the minimum.
|
|
52
|
+
*/
|
|
45
53
|
maxRowCount: {type: "int", defaultValue: -1, group: "Appearance"},
|
|
54
|
+
/**
|
|
55
|
+
* The number of rows in the fixed area at the top. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
56
|
+
* fixed rows is reduced.
|
|
57
|
+
* The table may limit the possible number of fixed rows.
|
|
58
|
+
*/
|
|
46
59
|
fixedTopRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
60
|
+
/**
|
|
61
|
+
* The number of rows in the fixed area at the bottom. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
62
|
+
* fixed rows is reduced.
|
|
63
|
+
* The table may limit the possible number of fixed rows.
|
|
64
|
+
*/
|
|
47
65
|
fixedBottomRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
66
|
+
/**
|
|
67
|
+
* The row content height in pixel. The actual row height is also influenced by other factors, such as the border width. If no value
|
|
68
|
+
* is set (includes 0), a default height is applied based on the content density configuration.
|
|
69
|
+
*/
|
|
48
70
|
rowContentHeight: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
71
|
+
/**
|
|
72
|
+
* Whether to hide empty rows.
|
|
73
|
+
* TODO: make hidden before making the class public
|
|
74
|
+
*/
|
|
49
75
|
hideEmptyRows: {type: "boolean", defaultValue: false, group: "Appearance"}
|
|
50
76
|
}
|
|
51
77
|
},
|
|
@@ -567,7 +593,7 @@ sap.ui.define([
|
|
|
567
593
|
};
|
|
568
594
|
|
|
569
595
|
/**
|
|
570
|
-
* @this sap.ui.table.rowmodes.
|
|
596
|
+
* @this sap.ui.table.rowmodes.Auto
|
|
571
597
|
*/
|
|
572
598
|
TableDelegate.onBeforeRendering = function(oEvent) {
|
|
573
599
|
var bRenderedRows = oEvent && oEvent.isMarked("renderRows");
|
|
@@ -578,7 +604,7 @@ sap.ui.define([
|
|
|
578
604
|
};
|
|
579
605
|
|
|
580
606
|
/**
|
|
581
|
-
* @this sap.ui.table.rowmodes.
|
|
607
|
+
* @this sap.ui.table.rowmodes.Auto
|
|
582
608
|
*/
|
|
583
609
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
584
610
|
var bRenderedRows = oEvent && oEvent.isMarked("renderRows");
|
|
@@ -4,42 +4,59 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"../library",
|
|
8
7
|
"./RowMode",
|
|
9
8
|
"../utils/TableUtils"
|
|
10
9
|
], function(
|
|
11
|
-
library,
|
|
12
10
|
RowMode,
|
|
13
11
|
TableUtils
|
|
14
12
|
) {
|
|
15
13
|
"use strict";
|
|
16
14
|
|
|
17
15
|
/**
|
|
18
|
-
* Constructor for a new
|
|
16
|
+
* Constructor for a new <code>Fixed</code> row mode.
|
|
19
17
|
*
|
|
20
18
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
21
19
|
* @param {object} [mSettings] initial settings for the new control
|
|
22
20
|
*
|
|
23
21
|
* @class
|
|
24
|
-
*
|
|
25
|
-
* @extends sap
|
|
22
|
+
* A fixed number of rows is displayed in the table.
|
|
23
|
+
* @extends module:sap/ui/table/rowmodes/RowMode
|
|
26
24
|
* @constructor
|
|
27
|
-
* @alias sap
|
|
25
|
+
* @alias module:sap/ui/table/rowmodes/Fixed
|
|
28
26
|
* @private
|
|
29
|
-
* @ui5-restricted sap.ui.mdc
|
|
30
27
|
*
|
|
31
28
|
* @author SAP SE
|
|
32
|
-
* @version 1.
|
|
33
|
-
*
|
|
29
|
+
* @version 1.118.0
|
|
34
30
|
*/
|
|
35
|
-
var FixedRowMode = RowMode.extend("sap.ui.table.rowmodes.
|
|
31
|
+
var FixedRowMode = RowMode.extend("sap.ui.table.rowmodes.Fixed", /** @lends sap.ui.table.rowmodes.Fixed.prototype */ {
|
|
36
32
|
metadata: {
|
|
37
33
|
library: "sap.ui.table",
|
|
38
34
|
properties: {
|
|
35
|
+
/**
|
|
36
|
+
* The number of rows displayed in the table. The number of rows in the scrollable area is reduced by the number of fixed rows.
|
|
37
|
+
*/
|
|
39
38
|
rowCount: {type: "int", defaultValue: 10, group: "Appearance"},
|
|
39
|
+
/**
|
|
40
|
+
* The number of rows in the fixed area at the top. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
41
|
+
* fixed rows is reduced.
|
|
42
|
+
* The table may limit the possible number of fixed rows.
|
|
43
|
+
*/
|
|
40
44
|
fixedTopRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
45
|
+
/**
|
|
46
|
+
* The number of rows in the fixed area at the bottom. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
47
|
+
* fixed rows is reduced.
|
|
48
|
+
* The table may limit the possible number of fixed rows.
|
|
49
|
+
*/
|
|
41
50
|
fixedBottomRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
51
|
+
/**
|
|
52
|
+
* The row content height in pixel. The actual row height is also influenced by other factors, such as the border width. If no value
|
|
53
|
+
* is set (includes 0), a default height is applied based on the content density configuration.
|
|
54
|
+
*/
|
|
42
55
|
rowContentHeight: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
56
|
+
/**
|
|
57
|
+
* Whether to hide empty rows.
|
|
58
|
+
* TODO: make hidden before making the class public
|
|
59
|
+
*/
|
|
43
60
|
hideEmptyRows: {type: "boolean", defaultValue: false, group: "Appearance"}
|
|
44
61
|
}
|
|
45
62
|
},
|
|
@@ -226,7 +243,7 @@ sap.ui.define([
|
|
|
226
243
|
};
|
|
227
244
|
|
|
228
245
|
/**
|
|
229
|
-
* @this sap.ui.table.rowmodes.
|
|
246
|
+
* @this sap.ui.table.rowmodes.Fixed
|
|
230
247
|
*/
|
|
231
248
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
232
249
|
var oTable = this.getTable();
|
|
@@ -4,47 +4,61 @@
|
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 - see LICENSE.txt.
|
|
5
5
|
*/
|
|
6
6
|
sap.ui.define([
|
|
7
|
-
"../library",
|
|
8
7
|
"./RowMode",
|
|
9
8
|
"../utils/TableUtils",
|
|
10
|
-
"sap/base/Log",
|
|
11
9
|
"sap/ui/thirdparty/jquery"
|
|
12
10
|
], function(
|
|
13
|
-
library,
|
|
14
11
|
RowMode,
|
|
15
12
|
TableUtils,
|
|
16
|
-
Log,
|
|
17
13
|
jQuery
|
|
18
14
|
) {
|
|
19
15
|
"use strict";
|
|
20
16
|
|
|
21
17
|
/**
|
|
22
|
-
* Constructor for a new
|
|
18
|
+
* Constructor for a new <code>Interactive</code> row mode.
|
|
23
19
|
*
|
|
24
20
|
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
25
21
|
* @param {object} [mSettings] initial settings for the new control
|
|
26
22
|
*
|
|
27
23
|
* @class
|
|
28
|
-
*
|
|
29
|
-
* @extends sap
|
|
24
|
+
* The user can change the number of displayed rows by dragging a resizer.
|
|
25
|
+
* @extends module:sap/ui/table/rowmodes/RowMode
|
|
30
26
|
* @constructor
|
|
31
|
-
* @alias sap
|
|
27
|
+
* @alias module:sap/ui/table/rowmodes/Interactive
|
|
32
28
|
* @private
|
|
33
|
-
* @ui5-restricted sap.ui.mdc
|
|
34
29
|
*
|
|
35
30
|
* @author SAP SE
|
|
36
|
-
* @version 1.
|
|
37
|
-
*
|
|
31
|
+
* @version 1.118.0
|
|
38
32
|
*/
|
|
39
|
-
var InteractiveRowMode = RowMode.extend("sap.ui.table.rowmodes.
|
|
33
|
+
var InteractiveRowMode = RowMode.extend("sap.ui.table.rowmodes.Interactive", /** @lends sap.ui.table.rowmodes.Interactive.prototype */ {
|
|
40
34
|
metadata: {
|
|
41
35
|
library: "sap.ui.table",
|
|
42
36
|
"final": true,
|
|
43
37
|
properties: {
|
|
38
|
+
/**
|
|
39
|
+
* The number of rows displayed in the table. The number of rows in the scrollable area is reduced by the number of fixed rows.
|
|
40
|
+
*/
|
|
44
41
|
rowCount: {type: "int", defaultValue: 10, group: "Appearance"},
|
|
42
|
+
/**
|
|
43
|
+
* The minimum number of displayed rows.
|
|
44
|
+
*/
|
|
45
45
|
minRowCount: {type: "int", defaultValue: 5, group: "Appearance"},
|
|
46
|
+
/**
|
|
47
|
+
* The number of rows in the fixed area at the top. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
48
|
+
* fixed rows is reduced.
|
|
49
|
+
* The table may limit the possible number of fixed rows.
|
|
50
|
+
*/
|
|
46
51
|
fixedTopRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
52
|
+
/**
|
|
53
|
+
* The number of rows in the fixed area at the bottom. If the number of fixed rows exceeds the number of displayed rows, the number of
|
|
54
|
+
* fixed rows is reduced.
|
|
55
|
+
* The table may limit the possible number of fixed rows.
|
|
56
|
+
*/
|
|
47
57
|
fixedBottomRowCount: {type: "int", defaultValue: 0, group: "Appearance"},
|
|
58
|
+
/**
|
|
59
|
+
* The row content height in pixel. The actual row height is also influenced by other factors, such as the border width. If no value
|
|
60
|
+
* is set (includes 0), a default height is applied based on the content density configuration.
|
|
61
|
+
*/
|
|
48
62
|
rowContentHeight: {type: "int", defaultValue: 0, group: "Appearance"}
|
|
49
63
|
}
|
|
50
64
|
},
|
|
@@ -183,13 +197,6 @@ sap.ui.define([
|
|
|
183
197
|
};
|
|
184
198
|
};
|
|
185
199
|
|
|
186
|
-
/**
|
|
187
|
-
* @inheritDoc
|
|
188
|
-
*/
|
|
189
|
-
InteractiveRowMode.prototype.getTableBottomPlaceholderStyles = function() {
|
|
190
|
-
return undefined;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
200
|
/**
|
|
194
201
|
* @inheritDoc
|
|
195
202
|
*/
|
|
@@ -233,6 +240,18 @@ sap.ui.define([
|
|
|
233
240
|
}
|
|
234
241
|
};
|
|
235
242
|
|
|
243
|
+
/**
|
|
244
|
+
* @inheritDoc
|
|
245
|
+
*/
|
|
246
|
+
InteractiveRowMode.prototype.renderInTableBottomArea = function(oRm) {
|
|
247
|
+
oRm.openStart("div", this.getTable().getId() + "-sb");
|
|
248
|
+
oRm.attr("tabindex", "-1");
|
|
249
|
+
oRm.class("sapUiTableHeightResizer");
|
|
250
|
+
oRm.style("height", "5px");
|
|
251
|
+
oRm.openEnd();
|
|
252
|
+
oRm.close("div");
|
|
253
|
+
};
|
|
254
|
+
|
|
236
255
|
/**
|
|
237
256
|
* @inheritDoc
|
|
238
257
|
*/
|
|
@@ -265,7 +284,7 @@ sap.ui.define([
|
|
|
265
284
|
};
|
|
266
285
|
|
|
267
286
|
/**
|
|
268
|
-
* @this sap.ui.table.rowmodes.
|
|
287
|
+
* @this sap.ui.table.rowmodes.Interactive
|
|
269
288
|
*/
|
|
270
289
|
TableDelegate.onBeforeRendering = function(oEvent) {
|
|
271
290
|
if (this.bLegacy) {
|
|
@@ -274,7 +293,7 @@ sap.ui.define([
|
|
|
274
293
|
};
|
|
275
294
|
|
|
276
295
|
/**
|
|
277
|
-
* @this sap.ui.table.rowmodes.
|
|
296
|
+
* @this sap.ui.table.rowmodes.Interactive
|
|
278
297
|
*/
|
|
279
298
|
TableDelegate.onAfterRendering = function(oEvent) {
|
|
280
299
|
var oTable = this.getTable();
|
|
@@ -286,7 +305,7 @@ sap.ui.define([
|
|
|
286
305
|
};
|
|
287
306
|
|
|
288
307
|
/**
|
|
289
|
-
* @this sap.ui.table.rowmodes.
|
|
308
|
+
* @this sap.ui.table.rowmodes.Interactive
|
|
290
309
|
*/
|
|
291
310
|
TableDelegate.onmousedown = function(oEvent) {
|
|
292
311
|
var oTable = this.getTable();
|
|
@@ -300,7 +319,7 @@ sap.ui.define([
|
|
|
300
319
|
* Initializes the drag&drop for resizing.
|
|
301
320
|
*
|
|
302
321
|
* @param {sap.ui.table.Table} oTable Instance of the table.
|
|
303
|
-
* @param {sap.ui.table.rowmodes.
|
|
322
|
+
* @param {sap.ui.table.rowmodes.Interactive} oMode The interactive row mode.
|
|
304
323
|
* @param {jQuery.Event} oEvent The event object.
|
|
305
324
|
*/
|
|
306
325
|
ResizeHelper.initInteractiveResizing = function(oTable, oMode, oEvent) {
|
|
@@ -342,7 +361,7 @@ sap.ui.define([
|
|
|
342
361
|
/**
|
|
343
362
|
* Drops the previous dragged horizontal splitter bar and recalculates the amount of rows to be displayed.
|
|
344
363
|
*
|
|
345
|
-
* @param {sap.ui.table.rowmodes.
|
|
364
|
+
* @param {sap.ui.table.rowmodes.Interactive} oMode The interactive row mode.
|
|
346
365
|
* @param {jQuery.Event} oEvent The event object.
|
|
347
366
|
*/
|
|
348
367
|
ResizeHelper.exitInteractiveResizing = function(oMode, oEvent) {
|