@sapui5/sap.fe.test 1.99.0 → 1.101.1
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/fe/test/.library +1 -1
- package/src/sap/fe/test/BaseArrangements.js +65 -18
- package/src/sap/fe/test/FeMocks.js +3 -3
- package/src/sap/fe/test/FeMocks.ts +11 -11
- package/src/sap/fe/test/FlexibleColumnLayout.js +148 -141
- package/src/sap/fe/test/JestTemplatingHelper.js +19 -14
- package/src/sap/fe/test/JestTemplatingHelper.ts +59 -54
- package/src/sap/fe/test/ListReport.js +71 -68
- package/src/sap/fe/test/ObjectPage.js +79 -119
- package/src/sap/fe/test/TemplatePage.js +43 -27
- package/src/sap/fe/test/UI5MockHelper.js +128 -205
- package/src/sap/fe/test/UI5MockHelper.ts +17 -2
- package/src/sap/fe/test/api/APIHelper.js +26 -15
- package/src/sap/fe/test/api/DialogActions.js +3 -1
- package/src/sap/fe/test/api/DialogMessageActions.js +78 -64
- package/src/sap/fe/test/api/FilterBarAPI.js +9 -1
- package/src/sap/fe/test/api/HeaderActions.js +229 -226
- package/src/sap/fe/test/api/TableActions.js +57 -69
- package/src/sap/fe/test/builder/MacroFieldBuilder.js +3 -0
- package/src/sap/fe/test/builder/MdcTableBuilder.js +160 -181
- package/src/sap/fe/test/library.js +26 -35
- package/src/sap/fe/test/library.ts +28 -0
|
@@ -16,7 +16,7 @@ sap.ui.define(
|
|
|
16
16
|
"sap/ui/core/SortOrder",
|
|
17
17
|
"sap/ui/test/actions/EnterText"
|
|
18
18
|
],
|
|
19
|
-
function(
|
|
19
|
+
function (
|
|
20
20
|
Opa5,
|
|
21
21
|
OpaBuilder,
|
|
22
22
|
FEBuilder,
|
|
@@ -62,7 +62,7 @@ sap.ui.define(
|
|
|
62
62
|
function _getColumnIndex(vColumn, oMdcTable) {
|
|
63
63
|
var iIndex = Number(vColumn);
|
|
64
64
|
return Number.isNaN(iIndex)
|
|
65
|
-
? oMdcTable.getColumns().findIndex(function(oColumn) {
|
|
65
|
+
? oMdcTable.getColumns().findIndex(function (oColumn) {
|
|
66
66
|
return oColumn.getHeader() === vColumn || oColumn.getDataProperty() === vColumn;
|
|
67
67
|
})
|
|
68
68
|
: iIndex;
|
|
@@ -119,7 +119,7 @@ sap.ui.define(
|
|
|
119
119
|
function _getButtonsForInlineActions(vColumn, oRow) {
|
|
120
120
|
var iIndex = Number(vColumn);
|
|
121
121
|
if (Number.isNaN(iIndex)) {
|
|
122
|
-
return oRow.getCells().reduce(function(aPrev, oCell) {
|
|
122
|
+
return oRow.getCells().reduce(function (aPrev, oCell) {
|
|
123
123
|
return aPrev.concat(_getCellButtonsForInlineAction(oCell, vColumn));
|
|
124
124
|
}, []);
|
|
125
125
|
}
|
|
@@ -128,7 +128,7 @@ sap.ui.define(
|
|
|
128
128
|
|
|
129
129
|
function _getRowNavigationIconOnGridTable(oRow) {
|
|
130
130
|
var oRowAction = oRow.getRowAction();
|
|
131
|
-
return oRowAction.getItems().reduce(function(oIcon, oActionItem, iIndex) {
|
|
131
|
+
return oRowAction.getItems().reduce(function (oIcon, oActionItem, iIndex) {
|
|
132
132
|
if (!oIcon && oActionItem.getType() === RowActionType.Navigation) {
|
|
133
133
|
oIcon = oRowAction.getAggregation("_icons")[iIndex];
|
|
134
134
|
}
|
|
@@ -153,7 +153,7 @@ sap.ui.define(
|
|
|
153
153
|
|
|
154
154
|
function _createTableInternalButtonBuilder(oTableBuilder, sButtonSuffix, vAction, sButtonType) {
|
|
155
155
|
sButtonType = sButtonType || "sap.m.Button";
|
|
156
|
-
return oTableBuilder.doOpenOverflow().success(function(oTable) {
|
|
156
|
+
return oTableBuilder.doOpenOverflow().success(function (oTable) {
|
|
157
157
|
return OpaBuilder.create()
|
|
158
158
|
.hasType(sButtonType)
|
|
159
159
|
.hasId(RegExp(Utils.formatMessage("-{0}$", sButtonSuffix)))
|
|
@@ -165,12 +165,12 @@ sap.ui.define(
|
|
|
165
165
|
|
|
166
166
|
function _createColumnWrapper(oColumn, bGridTable) {
|
|
167
167
|
return {
|
|
168
|
-
getHeader: function() {
|
|
168
|
+
getHeader: function () {
|
|
169
169
|
return bGridTable
|
|
170
170
|
? (oColumn.getLabel() && oColumn.getLabel().getText()) || oColumn.getName()
|
|
171
171
|
: oColumn.getHeader() && oColumn.getHeader().getText();
|
|
172
172
|
},
|
|
173
|
-
getDataProperty: function() {
|
|
173
|
+
getDataProperty: function () {
|
|
174
174
|
return "$data property not available$";
|
|
175
175
|
}
|
|
176
176
|
};
|
|
@@ -180,22 +180,22 @@ sap.ui.define(
|
|
|
180
180
|
var bGridTable = oInnerTable.isA("sap.ui.table.Table"),
|
|
181
181
|
oWrapper = {
|
|
182
182
|
_oTable: oInnerTable,
|
|
183
|
-
isA: function(sName) {
|
|
183
|
+
isA: function (sName) {
|
|
184
184
|
return sName === "sap.ui.mdc.Table";
|
|
185
185
|
},
|
|
186
|
-
getType: function() {
|
|
186
|
+
getType: function () {
|
|
187
187
|
return {
|
|
188
|
-
isA: function(sName) {
|
|
188
|
+
isA: function (sName) {
|
|
189
189
|
return sName === (bGridTable ? "sap.ui.mdc.table.GridTableType" : "sap.ui.mdc.table.ResponsiveTableType");
|
|
190
190
|
}
|
|
191
191
|
};
|
|
192
192
|
},
|
|
193
|
-
getColumns: function() {
|
|
194
|
-
return oInnerTable.getColumns().map(function(oColumn) {
|
|
193
|
+
getColumns: function () {
|
|
194
|
+
return oInnerTable.getColumns().map(function (oColumn) {
|
|
195
195
|
return _createColumnWrapper(oColumn, bGridTable);
|
|
196
196
|
});
|
|
197
197
|
},
|
|
198
|
-
getRowBinding: function() {
|
|
198
|
+
getRowBinding: function () {
|
|
199
199
|
return oInnerTable.getBinding(_getRowAggregationName(oWrapper));
|
|
200
200
|
}
|
|
201
201
|
};
|
|
@@ -203,22 +203,22 @@ sap.ui.define(
|
|
|
203
203
|
return oWrapper;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
var TableBuilder = function() {
|
|
206
|
+
var TableBuilder = function () {
|
|
207
207
|
return FEBuilder.apply(this, arguments).hasType("sap.ui.mdc.Table");
|
|
208
208
|
};
|
|
209
209
|
|
|
210
|
-
TableBuilder.create = function(oOpaInstance) {
|
|
210
|
+
TableBuilder.create = function (oOpaInstance) {
|
|
211
211
|
return new TableBuilder(oOpaInstance);
|
|
212
212
|
};
|
|
213
213
|
|
|
214
|
-
TableBuilder.createWrapper = function(oOpaInstance, sTableType, vTableMatcher) {
|
|
214
|
+
TableBuilder.createWrapper = function (oOpaInstance, sTableType, vTableMatcher) {
|
|
215
215
|
var oBuilder = new TableBuilder(oOpaInstance).hasType(sTableType);
|
|
216
216
|
|
|
217
217
|
if (vTableMatcher) {
|
|
218
218
|
oBuilder.has(vTableMatcher);
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
return oBuilder.has(function(oTable) {
|
|
221
|
+
return oBuilder.has(function (oTable) {
|
|
222
222
|
return _createTableWrapper(oTable);
|
|
223
223
|
});
|
|
224
224
|
};
|
|
@@ -226,26 +226,22 @@ sap.ui.define(
|
|
|
226
226
|
TableBuilder.prototype = Object.create(FEBuilder.prototype);
|
|
227
227
|
TableBuilder.prototype.constructor = TableBuilder;
|
|
228
228
|
|
|
229
|
-
TableBuilder.prototype.getStatesMatcher = function(mState) {
|
|
229
|
+
TableBuilder.prototype.getStatesMatcher = function (mState) {
|
|
230
230
|
return TableBuilder.Matchers.states(mState);
|
|
231
231
|
};
|
|
232
232
|
|
|
233
|
-
TableBuilder.prototype.hasColumns = function(mColumnMap, bIgnoreColumnState) {
|
|
233
|
+
TableBuilder.prototype.hasColumns = function (mColumnMap, bIgnoreColumnState) {
|
|
234
234
|
if (!mColumnMap || Object.keys(mColumnMap).length === 0) {
|
|
235
235
|
return this;
|
|
236
236
|
}
|
|
237
237
|
return this.has(TableBuilder.Matchers.columnsMatcher(mColumnMap, bIgnoreColumnState));
|
|
238
238
|
};
|
|
239
239
|
|
|
240
|
-
TableBuilder.prototype.hasTitle = function(sTitle) {
|
|
241
|
-
return this.hasChildren(
|
|
242
|
-
FEBuilder.create(this)
|
|
243
|
-
.hasType("sap.m.Title")
|
|
244
|
-
.hasProperties({ text: sTitle })
|
|
245
|
-
);
|
|
240
|
+
TableBuilder.prototype.hasTitle = function (sTitle) {
|
|
241
|
+
return this.hasChildren(FEBuilder.create(this).hasType("sap.m.Title").hasProperties({ text: sTitle }));
|
|
246
242
|
};
|
|
247
243
|
|
|
248
|
-
TableBuilder.prototype.hasSearchField = function(sSearchText, mState) {
|
|
244
|
+
TableBuilder.prototype.hasSearchField = function (sSearchText, mState) {
|
|
249
245
|
var aArguments = Utils.parseArguments([String, Object], arguments);
|
|
250
246
|
mState = aArguments[1];
|
|
251
247
|
var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).hasConditional(
|
|
@@ -262,7 +258,7 @@ sap.ui.define(
|
|
|
262
258
|
return this.doOpenOverflow().success(oSuccessBuilder);
|
|
263
259
|
};
|
|
264
260
|
|
|
265
|
-
TableBuilder.prototype.hasRows = function(vRowMatcher, bReturnAggregationItems) {
|
|
261
|
+
TableBuilder.prototype.hasRows = function (vRowMatcher, bReturnAggregationItems) {
|
|
266
262
|
vRowMatcher = _getRowMatcher(vRowMatcher);
|
|
267
263
|
|
|
268
264
|
return bReturnAggregationItems
|
|
@@ -270,7 +266,7 @@ sap.ui.define(
|
|
|
270
266
|
: this.has(TableBuilder.Matchers.rowsMatcher(vRowMatcher));
|
|
271
267
|
};
|
|
272
268
|
|
|
273
|
-
TableBuilder.prototype.doOnRows = function(vRowMatcher, vRowAction) {
|
|
269
|
+
TableBuilder.prototype.doOnRows = function (vRowMatcher, vRowAction) {
|
|
274
270
|
if (arguments.length === 1) {
|
|
275
271
|
vRowAction = vRowMatcher;
|
|
276
272
|
vRowMatcher = undefined;
|
|
@@ -281,11 +277,11 @@ sap.ui.define(
|
|
|
281
277
|
return this.hasRows(vRowMatcher, true).do(OpaBuilder.Actions.executor(vRowAction));
|
|
282
278
|
};
|
|
283
279
|
|
|
284
|
-
TableBuilder.prototype.doClickOnCell = function(vRowMatcher, vColumn) {
|
|
280
|
+
TableBuilder.prototype.doClickOnCell = function (vRowMatcher, vColumn) {
|
|
285
281
|
return this.doOnRows(vRowMatcher, TableBuilder.Row.Actions.onCell(vColumn, OpaBuilder.Actions.press()));
|
|
286
282
|
};
|
|
287
|
-
TableBuilder.prototype.doClickOnRow = function(vRowMatcher) {
|
|
288
|
-
return this.doOnRows(vRowMatcher, function(oRow) {
|
|
283
|
+
TableBuilder.prototype.doClickOnRow = function (vRowMatcher) {
|
|
284
|
+
return this.doOnRows(vRowMatcher, function (oRow) {
|
|
289
285
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
290
286
|
var oTable = oRow.getParent(),
|
|
291
287
|
oRowIndex = oTable.indexOfRow(oRow);
|
|
@@ -295,8 +291,8 @@ sap.ui.define(
|
|
|
295
291
|
});
|
|
296
292
|
};
|
|
297
293
|
|
|
298
|
-
TableBuilder.prototype.doScroll = function(sDirection) {
|
|
299
|
-
return this.do(function(oTable) {
|
|
294
|
+
TableBuilder.prototype.doScroll = function (sDirection) {
|
|
295
|
+
return this.do(function (oTable) {
|
|
300
296
|
switch (sDirection) {
|
|
301
297
|
case "up":
|
|
302
298
|
oTable.scrollToIndex(0);
|
|
@@ -309,7 +305,7 @@ sap.ui.define(
|
|
|
309
305
|
});
|
|
310
306
|
};
|
|
311
307
|
|
|
312
|
-
TableBuilder.prototype.doPressKeyboardShortcut = function(sShortcut, vRowMatcher, vColumn) {
|
|
308
|
+
TableBuilder.prototype.doPressKeyboardShortcut = function (sShortcut, vRowMatcher, vColumn) {
|
|
313
309
|
// All arguments are passed -> shortcut will be executed on cell level
|
|
314
310
|
if (vRowMatcher && vColumn) {
|
|
315
311
|
return this.doOnRows(
|
|
@@ -321,22 +317,25 @@ sap.ui.define(
|
|
|
321
317
|
return this.do(FEBuilder.Actions.keyboardShortcut(sShortcut, true));
|
|
322
318
|
};
|
|
323
319
|
|
|
324
|
-
TableBuilder.prototype.doEditValues = function(vRowMatcher, mColumnValueMap) {
|
|
320
|
+
TableBuilder.prototype.doEditValues = function (vRowMatcher, mColumnValueMap, bInputNotFinalized) {
|
|
325
321
|
if (arguments.length === 1) {
|
|
326
322
|
mColumnValueMap = vRowMatcher;
|
|
327
323
|
vRowMatcher = undefined;
|
|
328
324
|
}
|
|
329
|
-
return this.hasColumns(mColumnValueMap, true).doOnRows(
|
|
325
|
+
return this.hasColumns(mColumnValueMap, true).doOnRows(
|
|
326
|
+
vRowMatcher,
|
|
327
|
+
TableBuilder.Row.Actions.editCells(mColumnValueMap, bInputNotFinalized)
|
|
328
|
+
);
|
|
330
329
|
};
|
|
331
330
|
|
|
332
|
-
TableBuilder.prototype.doEditCreationRowValues = function(mColumnValueMap) {
|
|
331
|
+
TableBuilder.prototype.doEditCreationRowValues = function (mColumnValueMap, bInputNotFinalized) {
|
|
333
332
|
return this.hasColumns(mColumnValueMap, true)
|
|
334
333
|
.has(OpaBuilder.Matchers.aggregation("creationRow"))
|
|
335
|
-
.do(TableBuilder.Row.Actions.editCells(mColumnValueMap));
|
|
334
|
+
.do(TableBuilder.Row.Actions.editCells(mColumnValueMap, bInputNotFinalized));
|
|
336
335
|
};
|
|
337
336
|
|
|
338
|
-
TableBuilder.prototype.doSelect = function(vRowMatcher) {
|
|
339
|
-
return this.doOnRows(vRowMatcher, function(oRow) {
|
|
337
|
+
TableBuilder.prototype.doSelect = function (vRowMatcher) {
|
|
338
|
+
return this.doOnRows(vRowMatcher, function (oRow) {
|
|
340
339
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
341
340
|
var oTable = oRow.getParent(),
|
|
342
341
|
oRowIndex = oTable.indexOfRow(oRow);
|
|
@@ -345,8 +344,8 @@ sap.ui.define(
|
|
|
345
344
|
return OpaBuilder.Actions.press().executeOn(oRow.getMultiSelectControl() || oRow.getSingleSelectControl());
|
|
346
345
|
});
|
|
347
346
|
};
|
|
348
|
-
TableBuilder.prototype.doSelectAll = function() {
|
|
349
|
-
return this.do(function(oTable) {
|
|
347
|
+
TableBuilder.prototype.doSelectAll = function () {
|
|
348
|
+
return this.do(function (oTable) {
|
|
350
349
|
var bIsGridTable = _isGridTable(oTable);
|
|
351
350
|
if (bIsGridTable) {
|
|
352
351
|
return OpaBuilder.Actions.press("selall").executeOn(oTable.getAggregation("_content"));
|
|
@@ -355,8 +354,8 @@ sap.ui.define(
|
|
|
355
354
|
});
|
|
356
355
|
};
|
|
357
356
|
|
|
358
|
-
TableBuilder.prototype.doNavigate = function(vRowMatcher) {
|
|
359
|
-
return this.doOnRows(vRowMatcher, function(oRow) {
|
|
357
|
+
TableBuilder.prototype.doNavigate = function (vRowMatcher) {
|
|
358
|
+
return this.doOnRows(vRowMatcher, function (oRow) {
|
|
360
359
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
361
360
|
return OpaBuilder.Actions.press().executeOn(_getRowNavigationIconOnGridTable(oRow));
|
|
362
361
|
}
|
|
@@ -364,13 +363,11 @@ sap.ui.define(
|
|
|
364
363
|
});
|
|
365
364
|
};
|
|
366
365
|
|
|
367
|
-
TableBuilder.prototype.doPressColumnHeader = function(vColumn) {
|
|
368
|
-
return this.has(TableBuilder.Matchers.columnControl(vColumn))
|
|
369
|
-
.has(FEBuilder.Matchers.singleElement())
|
|
370
|
-
.doPress();
|
|
366
|
+
TableBuilder.prototype.doPressColumnHeader = function (vColumn) {
|
|
367
|
+
return this.has(TableBuilder.Matchers.columnControl(vColumn)).has(FEBuilder.Matchers.singleElement()).doPress();
|
|
371
368
|
};
|
|
372
369
|
|
|
373
|
-
TableBuilder.prototype.doColumnHeaderAction = function(vColumn, sActionIconName, sFieldName) {
|
|
370
|
+
TableBuilder.prototype.doColumnHeaderAction = function (vColumn, sActionIconName, sFieldName) {
|
|
374
371
|
var oSortPopoverBuilder = OpaBuilder.create()
|
|
375
372
|
.isDialogElement()
|
|
376
373
|
.hasType(sFieldName ? "sap.m.ToggleButton" : "sap.m.Button")
|
|
@@ -379,17 +376,13 @@ sap.ui.define(
|
|
|
379
376
|
|
|
380
377
|
if (sFieldName) {
|
|
381
378
|
oSortPopoverBuilder.success(
|
|
382
|
-
OpaBuilder.create()
|
|
383
|
-
.isDialogElement()
|
|
384
|
-
.hasType("sap.m.StandardListItem")
|
|
385
|
-
.hasProperties({ title: sFieldName })
|
|
386
|
-
.doPress()
|
|
379
|
+
OpaBuilder.create().isDialogElement().hasType("sap.m.StandardListItem").hasProperties({ title: sFieldName }).doPress()
|
|
387
380
|
);
|
|
388
381
|
}
|
|
389
382
|
return this.doPressColumnHeader(vColumn).success(oSortPopoverBuilder);
|
|
390
383
|
};
|
|
391
384
|
|
|
392
|
-
TableBuilder.prototype.doSortByColumn = function(vColumn, sFieldName, bDescending) {
|
|
385
|
+
TableBuilder.prototype.doSortByColumn = function (vColumn, sFieldName, bDescending) {
|
|
393
386
|
var sIcon = "sap-icon://sort-ascending";
|
|
394
387
|
if (bDescending) {
|
|
395
388
|
sIcon = "sap-icon://sort-descending";
|
|
@@ -397,15 +390,15 @@ sap.ui.define(
|
|
|
397
390
|
return this.doColumnHeaderAction(vColumn, sIcon, sFieldName);
|
|
398
391
|
};
|
|
399
392
|
|
|
400
|
-
TableBuilder.prototype.doGroupByColumn = function(vColumn, sFieldName) {
|
|
393
|
+
TableBuilder.prototype.doGroupByColumn = function (vColumn, sFieldName) {
|
|
401
394
|
return this.doColumnHeaderAction(vColumn, "sap-icon://group-2", sFieldName);
|
|
402
395
|
};
|
|
403
396
|
|
|
404
|
-
TableBuilder.prototype.doAggregateByColumn = function(vColumn, sFieldName) {
|
|
397
|
+
TableBuilder.prototype.doAggregateByColumn = function (vColumn, sFieldName) {
|
|
405
398
|
return this.doColumnHeaderAction(vColumn, "sap-icon://sum", sFieldName);
|
|
406
399
|
};
|
|
407
400
|
|
|
408
|
-
TableBuilder.prototype.doChangeSearch = function(sSearchText) {
|
|
401
|
+
TableBuilder.prototype.doChangeSearch = function (sSearchText) {
|
|
409
402
|
var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).doOnChildren(
|
|
410
403
|
OpaBuilder.create(this)
|
|
411
404
|
.hasType("sap.fe.macros.table.BasicSearch")
|
|
@@ -415,7 +408,7 @@ sap.ui.define(
|
|
|
415
408
|
return this.doOpenOverflow().success(oSuccessBuilder);
|
|
416
409
|
};
|
|
417
410
|
|
|
418
|
-
TableBuilder.prototype.doResetSearch = function() {
|
|
411
|
+
TableBuilder.prototype.doResetSearch = function () {
|
|
419
412
|
var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).doOnChildren(
|
|
420
413
|
OpaBuilder.create(this)
|
|
421
414
|
.hasType("sap.fe.macros.table.BasicSearch")
|
|
@@ -425,7 +418,7 @@ sap.ui.define(
|
|
|
425
418
|
return this.doOpenOverflow().success(oSuccessBuilder);
|
|
426
419
|
};
|
|
427
420
|
|
|
428
|
-
TableBuilder.prototype.checkColumnHeaderAction = function(vColumn, sActionIconName, sFieldName, iExpectedNumber) {
|
|
421
|
+
TableBuilder.prototype.checkColumnHeaderAction = function (vColumn, sActionIconName, sFieldName, iExpectedNumber) {
|
|
429
422
|
var oHeaderPopoverBuilder;
|
|
430
423
|
|
|
431
424
|
if (!sFieldName) {
|
|
@@ -494,36 +487,36 @@ sap.ui.define(
|
|
|
494
487
|
return this.doPressColumnHeader(vColumn).success(oHeaderPopoverBuilder);
|
|
495
488
|
};
|
|
496
489
|
|
|
497
|
-
TableBuilder.prototype.hasGroupByColumn = function(vColumn, sFieldName, iExpectedNumber) {
|
|
490
|
+
TableBuilder.prototype.hasGroupByColumn = function (vColumn, sFieldName, iExpectedNumber) {
|
|
498
491
|
return this.checkColumnHeaderAction(vColumn, "sap-icon://group-2", sFieldName, iExpectedNumber);
|
|
499
492
|
};
|
|
500
493
|
|
|
501
|
-
TableBuilder.prototype.hasAggregationColumn = function(vColumn, sFieldName, iExpectedNumber) {
|
|
494
|
+
TableBuilder.prototype.hasAggregationColumn = function (vColumn, sFieldName, iExpectedNumber) {
|
|
502
495
|
return this.checkColumnHeaderAction(vColumn, "sap-icon://sum", sFieldName, iExpectedNumber);
|
|
503
496
|
};
|
|
504
497
|
|
|
505
|
-
TableBuilder.prototype.doExpand = function(vRowMatcher) {
|
|
506
|
-
return this.doOnRows(vRowMatcher, function(oRow) {
|
|
498
|
+
TableBuilder.prototype.doExpand = function (vRowMatcher) {
|
|
499
|
+
return this.doOnRows(vRowMatcher, function (oRow) {
|
|
507
500
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
508
501
|
oRow.expand();
|
|
509
502
|
}
|
|
510
503
|
});
|
|
511
504
|
};
|
|
512
505
|
|
|
513
|
-
TableBuilder.prototype.doCollapse = function(vRowMatcher) {
|
|
514
|
-
return this.doOnRows(vRowMatcher, function(oRow) {
|
|
506
|
+
TableBuilder.prototype.doCollapse = function (vRowMatcher) {
|
|
507
|
+
return this.doOnRows(vRowMatcher, function (oRow) {
|
|
515
508
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
516
509
|
oRow.collapse();
|
|
517
510
|
}
|
|
518
511
|
});
|
|
519
512
|
};
|
|
520
513
|
|
|
521
|
-
TableBuilder.prototype.hasOverlay = function(bHasOverlay) {
|
|
514
|
+
TableBuilder.prototype.hasOverlay = function (bHasOverlay) {
|
|
522
515
|
return this.has(TableBuilder.Matchers.overlay(bHasOverlay));
|
|
523
516
|
};
|
|
524
517
|
|
|
525
|
-
TableBuilder.prototype.hasNumberOfRows = function(iNumberOfRows) {
|
|
526
|
-
return this.has(function(oTable) {
|
|
518
|
+
TableBuilder.prototype.hasNumberOfRows = function (iNumberOfRows) {
|
|
519
|
+
return this.has(function (oTable) {
|
|
527
520
|
var oRowBinding = oTable.getRowBinding(),
|
|
528
521
|
// when having an overlay, the table is dirty and the rows do not reflect the actual table state
|
|
529
522
|
bHasOverlay = TableBuilder.Matchers.overlay(true)(oTable);
|
|
@@ -536,8 +529,8 @@ sap.ui.define(
|
|
|
536
529
|
});
|
|
537
530
|
};
|
|
538
531
|
|
|
539
|
-
TableBuilder.prototype.hasQuickFilterItems = function(iNumberOfItems) {
|
|
540
|
-
return this.has(function(oTable) {
|
|
532
|
+
TableBuilder.prototype.hasQuickFilterItems = function (iNumberOfItems) {
|
|
533
|
+
return this.has(function (oTable) {
|
|
541
534
|
var oQuickFilter = oTable.getQuickFilter();
|
|
542
535
|
if (oQuickFilter) {
|
|
543
536
|
var aItems = oQuickFilter.getSelector().getItems();
|
|
@@ -550,13 +543,13 @@ sap.ui.define(
|
|
|
550
543
|
});
|
|
551
544
|
};
|
|
552
545
|
|
|
553
|
-
TableBuilder.prototype.doSelectQuickFilter = function(oItemMatcher) {
|
|
554
|
-
return this.has(function(oTable) {
|
|
546
|
+
TableBuilder.prototype.doSelectQuickFilter = function (oItemMatcher) {
|
|
547
|
+
return this.has(function (oTable) {
|
|
555
548
|
return oTable.getQuickFilter().getSelector();
|
|
556
549
|
})
|
|
557
550
|
.doConditional(FEBuilder.Matchers.state("controlType", "sap.m.Select"), OpaBuilder.Actions.press())
|
|
558
551
|
.success(
|
|
559
|
-
function(oQFControl) {
|
|
552
|
+
function (oQFControl) {
|
|
560
553
|
return FEBuilder.create(this)
|
|
561
554
|
|
|
562
555
|
.hasId([].concat(oQFControl)[0].getId())
|
|
@@ -566,26 +559,23 @@ sap.ui.define(
|
|
|
566
559
|
);
|
|
567
560
|
};
|
|
568
561
|
|
|
569
|
-
TableBuilder.prototype.doPressMore = function() {
|
|
562
|
+
TableBuilder.prototype.doPressMore = function () {
|
|
570
563
|
return this.do(
|
|
571
|
-
function(oTable) {
|
|
572
|
-
return FEBuilder.create(this)
|
|
573
|
-
.hasId(oTable._oTable.getId("trigger"))
|
|
574
|
-
.do(OpaBuilder.Actions.press())
|
|
575
|
-
.execute();
|
|
564
|
+
function (oTable) {
|
|
565
|
+
return FEBuilder.create(this).hasId(oTable._oTable.getId("trigger")).do(OpaBuilder.Actions.press()).execute();
|
|
576
566
|
}.bind(this)
|
|
577
567
|
);
|
|
578
568
|
};
|
|
579
569
|
|
|
580
|
-
TableBuilder.prototype.doOpenOverflow = function() {
|
|
570
|
+
TableBuilder.prototype.doOpenOverflow = function () {
|
|
581
571
|
return OverflowToolbarBuilder.openOverflow(this, "toolbar");
|
|
582
572
|
};
|
|
583
573
|
|
|
584
|
-
TableBuilder.prototype.doCloseOverflow = function() {
|
|
574
|
+
TableBuilder.prototype.doCloseOverflow = function () {
|
|
585
575
|
return OverflowToolbarBuilder.closeOverflow(this, "toolbar");
|
|
586
576
|
};
|
|
587
577
|
|
|
588
|
-
TableBuilder.prototype.doExecuteAction = function(vActionMatcher) {
|
|
578
|
+
TableBuilder.prototype.doExecuteAction = function (vActionMatcher) {
|
|
589
579
|
var oSuccessBuilder = new TableBuilder(this.getOpaInstance(), this.build()).doOnAggregation(
|
|
590
580
|
"actions/action",
|
|
591
581
|
vActionMatcher,
|
|
@@ -594,8 +584,8 @@ sap.ui.define(
|
|
|
594
584
|
return this.doOpenOverflow().success(oSuccessBuilder);
|
|
595
585
|
};
|
|
596
586
|
|
|
597
|
-
TableBuilder.prototype.doClickOnMessageStripFilter = function() {
|
|
598
|
-
return this.do(function(oMdcTable) {
|
|
587
|
+
TableBuilder.prototype.doClickOnMessageStripFilter = function () {
|
|
588
|
+
return this.do(function (oMdcTable) {
|
|
599
589
|
var oLink = oMdcTable.getDataStateIndicator()._oLink;
|
|
600
590
|
return OpaBuilder.create()
|
|
601
591
|
.hasType("sap.m.Link")
|
|
@@ -606,18 +596,16 @@ sap.ui.define(
|
|
|
606
596
|
});
|
|
607
597
|
};
|
|
608
598
|
|
|
609
|
-
TableBuilder.prototype.hasShowHideDetails = function() {
|
|
599
|
+
TableBuilder.prototype.hasShowHideDetails = function () {
|
|
610
600
|
return _createTableInternalButtonBuilder(this, "showHideDetails", false);
|
|
611
601
|
};
|
|
612
602
|
|
|
613
|
-
TableBuilder.prototype.doShowHideDetails = function(bShowDetails) {
|
|
614
|
-
return this.doOpenOverflow().success(function(oMdcTable) {
|
|
603
|
+
TableBuilder.prototype.doShowHideDetails = function (bShowDetails) {
|
|
604
|
+
return this.doOpenOverflow().success(function (oMdcTable) {
|
|
615
605
|
if (_isGridTable(oMdcTable)) {
|
|
616
606
|
return;
|
|
617
607
|
}
|
|
618
|
-
var oRb = Opa5.getWindow()
|
|
619
|
-
.sap.ui.getCore()
|
|
620
|
-
.getLibraryResourceBundle("sap.ui.mdc"),
|
|
608
|
+
var oRb = Opa5.getWindow().sap.ui.getCore().getLibraryResourceBundle("sap.ui.mdc"),
|
|
621
609
|
sExpectedText;
|
|
622
610
|
if (bShowDetails !== undefined) {
|
|
623
611
|
sExpectedText = bShowDetails ? oRb.getText("table.SHOWDETAILS_TEXT") : oRb.getText("table.HIDEDETAILS_TEXT");
|
|
@@ -626,7 +614,7 @@ sap.ui.define(
|
|
|
626
614
|
.hasType("sap.m.Button")
|
|
627
615
|
.hasId(/-showHideDetails$/)
|
|
628
616
|
.has(OpaBuilder.Matchers.ancestor(oMdcTable))
|
|
629
|
-
.doConditional(function(oButton) {
|
|
617
|
+
.doConditional(function (oButton) {
|
|
630
618
|
// only press button if currently in expected state
|
|
631
619
|
return !sExpectedText || oButton.getText() === sExpectedText;
|
|
632
620
|
}, OpaBuilder.Actions.press())
|
|
@@ -634,19 +622,19 @@ sap.ui.define(
|
|
|
634
622
|
});
|
|
635
623
|
};
|
|
636
624
|
|
|
637
|
-
TableBuilder.prototype.hasColumnAdaptation = function() {
|
|
625
|
+
TableBuilder.prototype.hasColumnAdaptation = function () {
|
|
638
626
|
return _createTableInternalButtonBuilder(this, "settings", false);
|
|
639
627
|
};
|
|
640
628
|
|
|
641
|
-
TableBuilder.prototype.doOpenColumnAdaptation = function() {
|
|
629
|
+
TableBuilder.prototype.doOpenColumnAdaptation = function () {
|
|
642
630
|
return _createTableInternalButtonBuilder(this, "settings", OpaBuilder.Actions.press());
|
|
643
631
|
};
|
|
644
632
|
|
|
645
|
-
TableBuilder.prototype.hasColumnSorting = function() {
|
|
633
|
+
TableBuilder.prototype.hasColumnSorting = function () {
|
|
646
634
|
return _createTableInternalButtonBuilder(this, "settings", false);
|
|
647
635
|
};
|
|
648
636
|
|
|
649
|
-
TableBuilder.prototype.doOpenColumnSorting = function() {
|
|
637
|
+
TableBuilder.prototype.doOpenColumnSorting = function () {
|
|
650
638
|
return _createTableInternalButtonBuilder(this, "settings", OpaBuilder.Actions.press()).success(
|
|
651
639
|
OpaBuilder.create(this.getOpaInstance())
|
|
652
640
|
.isDialogElement()
|
|
@@ -663,11 +651,11 @@ sap.ui.define(
|
|
|
663
651
|
);
|
|
664
652
|
};
|
|
665
653
|
|
|
666
|
-
TableBuilder.prototype.hasColumnFiltering = function() {
|
|
654
|
+
TableBuilder.prototype.hasColumnFiltering = function () {
|
|
667
655
|
return _createTableInternalButtonBuilder(this, "filter", false);
|
|
668
656
|
};
|
|
669
657
|
|
|
670
|
-
TableBuilder.prototype.doOpenColumnFiltering = function() {
|
|
658
|
+
TableBuilder.prototype.doOpenColumnFiltering = function () {
|
|
671
659
|
return _createTableInternalButtonBuilder(this, "settings", OpaBuilder.Actions.press()).success(
|
|
672
660
|
OpaBuilder.create(this.getOpaInstance())
|
|
673
661
|
.isDialogElement()
|
|
@@ -684,32 +672,32 @@ sap.ui.define(
|
|
|
684
672
|
);
|
|
685
673
|
};
|
|
686
674
|
|
|
687
|
-
TableBuilder.prototype.hasColumnExport = function() {
|
|
675
|
+
TableBuilder.prototype.hasColumnExport = function () {
|
|
688
676
|
return _createTableInternalButtonBuilder(this, "export", false, "sap.m.MenuButton");
|
|
689
677
|
};
|
|
690
678
|
|
|
691
|
-
TableBuilder.prototype.hasPaste = function() {
|
|
679
|
+
TableBuilder.prototype.hasPaste = function () {
|
|
692
680
|
return _createTableInternalButtonBuilder(this, "paste", false, "sap.m.MenuButton");
|
|
693
681
|
};
|
|
694
682
|
|
|
695
|
-
TableBuilder.prototype.doExecuteInlineAction = function(vRowMatcher, vColumn) {
|
|
683
|
+
TableBuilder.prototype.doExecuteInlineAction = function (vRowMatcher, vColumn) {
|
|
696
684
|
return this.doOnRows(vRowMatcher, TableBuilder.Row.Actions.pressInlineAction(vColumn));
|
|
697
685
|
};
|
|
698
686
|
|
|
699
|
-
TableBuilder.prototype.doPasteData = function(aData) {
|
|
700
|
-
return this.do(function(oMdcTable) {
|
|
687
|
+
TableBuilder.prototype.doPasteData = function (aData) {
|
|
688
|
+
return this.do(function (oMdcTable) {
|
|
701
689
|
oMdcTable.firePaste({ data: aData });
|
|
702
690
|
});
|
|
703
691
|
};
|
|
704
692
|
|
|
705
|
-
TableBuilder.createAdaptationDialogBuilder = function(oOpaInstance) {
|
|
693
|
+
TableBuilder.createAdaptationDialogBuilder = function (oOpaInstance) {
|
|
706
694
|
return DialogBuilder.create(oOpaInstance).hasSome(
|
|
707
695
|
OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "table.SETTINGS_COLUMN"),
|
|
708
696
|
OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS")
|
|
709
697
|
);
|
|
710
698
|
};
|
|
711
699
|
|
|
712
|
-
TableBuilder.createSortingDialogBuilder = function(oOpaInstance) {
|
|
700
|
+
TableBuilder.createSortingDialogBuilder = function (oOpaInstance) {
|
|
713
701
|
return DialogBuilder.create(oOpaInstance)
|
|
714
702
|
.has(OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS"))
|
|
715
703
|
.hasChildren(
|
|
@@ -719,7 +707,7 @@ sap.ui.define(
|
|
|
719
707
|
);
|
|
720
708
|
};
|
|
721
709
|
|
|
722
|
-
TableBuilder.createFilteringDialogBuilder = function(oOpaInstance) {
|
|
710
|
+
TableBuilder.createFilteringDialogBuilder = function (oOpaInstance) {
|
|
723
711
|
return DialogBuilder.create(oOpaInstance)
|
|
724
712
|
.has(OpaBuilder.Matchers.resourceBundle("title", "sap.ui.mdc", "p13nDialog.VIEW_SETTINGS"))
|
|
725
713
|
.hasChildren(
|
|
@@ -731,18 +719,18 @@ sap.ui.define(
|
|
|
731
719
|
|
|
732
720
|
TableBuilder.Cell = {
|
|
733
721
|
Matchers: {
|
|
734
|
-
state: function(sName, vValue) {
|
|
722
|
+
state: function (sName, vValue) {
|
|
735
723
|
switch (sName) {
|
|
736
724
|
case "editor":
|
|
737
725
|
case "editors":
|
|
738
|
-
return function(oCell) {
|
|
726
|
+
return function (oCell) {
|
|
739
727
|
return MacroFieldBuilder.Matchers.states(vValue)(oCell);
|
|
740
728
|
};
|
|
741
729
|
default:
|
|
742
730
|
return FEBuilder.Matchers.state(sName, vValue);
|
|
743
731
|
}
|
|
744
732
|
},
|
|
745
|
-
states: function(mStateMap) {
|
|
733
|
+
states: function (mStateMap) {
|
|
746
734
|
return FEBuilder.Matchers.states(mStateMap, TableBuilder.Cell.Matchers.state);
|
|
747
735
|
}
|
|
748
736
|
}
|
|
@@ -750,24 +738,24 @@ sap.ui.define(
|
|
|
750
738
|
|
|
751
739
|
TableBuilder.Column = {
|
|
752
740
|
Matchers: {
|
|
753
|
-
state: function(sName, vValue) {
|
|
741
|
+
state: function (sName, vValue) {
|
|
754
742
|
switch (sName) {
|
|
755
743
|
case "sortOrder":
|
|
756
744
|
return TableBuilder.Column.Matchers.sortOrder(vValue);
|
|
757
745
|
case "template":
|
|
758
746
|
case "creationTemplate":
|
|
759
|
-
return function(oColumn) {
|
|
747
|
+
return function (oColumn) {
|
|
760
748
|
return MacroFieldBuilder.Matchers.states(vValue)(oColumn.getAggregation(sName));
|
|
761
749
|
};
|
|
762
750
|
default:
|
|
763
751
|
return FEBuilder.Matchers.state(sName, vValue);
|
|
764
752
|
}
|
|
765
753
|
},
|
|
766
|
-
states: function(mStateMap) {
|
|
754
|
+
states: function (mStateMap) {
|
|
767
755
|
return FEBuilder.Matchers.states(mStateMap, TableBuilder.Column.Matchers.state);
|
|
768
756
|
},
|
|
769
|
-
sortOrder: function(sSortOrder) {
|
|
770
|
-
return function(oMdcColumn) {
|
|
757
|
+
sortOrder: function (sSortOrder) {
|
|
758
|
+
return function (oMdcColumn) {
|
|
771
759
|
var oMdcTable = oMdcColumn.getParent(),
|
|
772
760
|
bIsGridTable = _isGridTable(oMdcTable),
|
|
773
761
|
mProperties = {};
|
|
@@ -793,14 +781,14 @@ sap.ui.define(
|
|
|
793
781
|
|
|
794
782
|
TableBuilder.Row = {
|
|
795
783
|
Matchers: {
|
|
796
|
-
cell: function(vColumn) {
|
|
797
|
-
return function(oRow) {
|
|
784
|
+
cell: function (vColumn) {
|
|
785
|
+
return function (oRow) {
|
|
798
786
|
var iColumn = _getCellIndex(vColumn, oRow);
|
|
799
787
|
return _getCell(oRow, iColumn);
|
|
800
788
|
};
|
|
801
789
|
},
|
|
802
|
-
cellValue: function(vColumn, vExpectedValue) {
|
|
803
|
-
return function(oRow) {
|
|
790
|
+
cellValue: function (vColumn, vExpectedValue) {
|
|
791
|
+
return function (oRow) {
|
|
804
792
|
var oCellField = TableBuilder.Row.Matchers.cell(vColumn)(oRow);
|
|
805
793
|
while (oCellField.isA("sap.fe.macros.MacroAPI")) {
|
|
806
794
|
oCellField = oCellField.getContent();
|
|
@@ -809,18 +797,18 @@ sap.ui.define(
|
|
|
809
797
|
return MacroFieldBuilder.Matchers.value(vExpectedValue)(oCellField);
|
|
810
798
|
};
|
|
811
799
|
},
|
|
812
|
-
cellValues: function(mColumnValueMap) {
|
|
800
|
+
cellValues: function (mColumnValueMap) {
|
|
813
801
|
if (!mColumnValueMap) {
|
|
814
802
|
return OpaBuilder.Matchers.TRUE;
|
|
815
803
|
}
|
|
816
804
|
return FEBuilder.Matchers.match(
|
|
817
|
-
Object.keys(mColumnValueMap).map(function(sColumnName) {
|
|
805
|
+
Object.keys(mColumnValueMap).map(function (sColumnName) {
|
|
818
806
|
return TableBuilder.Row.Matchers.cellValue(sColumnName, mColumnValueMap[sColumnName]);
|
|
819
807
|
})
|
|
820
808
|
);
|
|
821
809
|
},
|
|
822
|
-
emptyCell: function(sColumnName) {
|
|
823
|
-
return function(oRow) {
|
|
810
|
+
emptyCell: function (sColumnName) {
|
|
811
|
+
return function (oRow) {
|
|
824
812
|
var oCellField = TableBuilder.Row.Matchers.cell(sColumnName)(oRow);
|
|
825
813
|
while (oCellField.isA("sap.fe.macros.MacroAPI")) {
|
|
826
814
|
oCellField = oCellField.getContent();
|
|
@@ -829,18 +817,18 @@ sap.ui.define(
|
|
|
829
817
|
return MacroFieldBuilder.Matchers.empty(oCellField);
|
|
830
818
|
};
|
|
831
819
|
},
|
|
832
|
-
emptyCells: function(vColumn) {
|
|
820
|
+
emptyCells: function (vColumn) {
|
|
833
821
|
if (!vColumn || vColumn.length === 0) {
|
|
834
822
|
return OpaBuilder.Matchers.TRUE;
|
|
835
823
|
}
|
|
836
824
|
return FEBuilder.Matchers.match(
|
|
837
|
-
vColumn.map(function(sColumnName) {
|
|
825
|
+
vColumn.map(function (sColumnName) {
|
|
838
826
|
return TableBuilder.Row.Matchers.emptyCell(sColumnName);
|
|
839
827
|
})
|
|
840
828
|
);
|
|
841
829
|
},
|
|
842
|
-
cellProperty: function(vColumn, oExpectedState) {
|
|
843
|
-
return function(oRow) {
|
|
830
|
+
cellProperty: function (vColumn, oExpectedState) {
|
|
831
|
+
return function (oRow) {
|
|
844
832
|
var oCell = TableBuilder.Row.Matchers.cell(vColumn)(oRow);
|
|
845
833
|
while (oCell.isA("sap.fe.macros.MacroAPI")) {
|
|
846
834
|
oCell = oCell.getContent();
|
|
@@ -848,18 +836,18 @@ sap.ui.define(
|
|
|
848
836
|
return TableBuilder.Cell.Matchers.states(oExpectedState)(oCell);
|
|
849
837
|
};
|
|
850
838
|
},
|
|
851
|
-
cellProperties: function(mCellStateMap) {
|
|
839
|
+
cellProperties: function (mCellStateMap) {
|
|
852
840
|
if (!mCellStateMap) {
|
|
853
841
|
return OpaBuilder.Matchers.TRUE;
|
|
854
842
|
}
|
|
855
843
|
return FEBuilder.Matchers.match(
|
|
856
|
-
Object.keys(mCellStateMap).map(function(sColumnName) {
|
|
844
|
+
Object.keys(mCellStateMap).map(function (sColumnName) {
|
|
857
845
|
return TableBuilder.Row.Matchers.cellProperty(sColumnName, mCellStateMap[sColumnName]);
|
|
858
846
|
})
|
|
859
847
|
);
|
|
860
848
|
},
|
|
861
|
-
selected: function(bSelected) {
|
|
862
|
-
return function(oRow) {
|
|
849
|
+
selected: function (bSelected) {
|
|
850
|
+
return function (oRow) {
|
|
863
851
|
var oTable = oRow.getParent(),
|
|
864
852
|
oMdcTable = oTable.getParent(),
|
|
865
853
|
bIsGridTable = _isGridTable(oMdcTable),
|
|
@@ -870,8 +858,8 @@ sap.ui.define(
|
|
|
870
858
|
return bSelected ? bRowIsSelected : !bRowIsSelected;
|
|
871
859
|
};
|
|
872
860
|
},
|
|
873
|
-
navigated: function(bNavigated) {
|
|
874
|
-
return function(oRow) {
|
|
861
|
+
navigated: function (bNavigated) {
|
|
862
|
+
return function (oRow) {
|
|
875
863
|
var bRowIsNavigated;
|
|
876
864
|
|
|
877
865
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
@@ -882,8 +870,8 @@ sap.ui.define(
|
|
|
882
870
|
return bNavigated ? bRowIsNavigated : !bRowIsNavigated;
|
|
883
871
|
};
|
|
884
872
|
},
|
|
885
|
-
focused: function() {
|
|
886
|
-
return function(oRow) {
|
|
873
|
+
focused: function () {
|
|
874
|
+
return function (oRow) {
|
|
887
875
|
var aElementsToCheck = [oRow];
|
|
888
876
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
889
877
|
aElementsToCheck.push(_getRowNavigationIconOnGridTable(oRow));
|
|
@@ -891,8 +879,8 @@ sap.ui.define(
|
|
|
891
879
|
return aElementsToCheck.some(OpaBuilder.Matchers.focused(true));
|
|
892
880
|
};
|
|
893
881
|
},
|
|
894
|
-
highlighted: function(sHighlight) {
|
|
895
|
-
return function(oRow) {
|
|
882
|
+
highlighted: function (sHighlight) {
|
|
883
|
+
return function (oRow) {
|
|
896
884
|
var sRowHighlight;
|
|
897
885
|
|
|
898
886
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
@@ -903,12 +891,12 @@ sap.ui.define(
|
|
|
903
891
|
return sHighlight === sRowHighlight;
|
|
904
892
|
};
|
|
905
893
|
},
|
|
906
|
-
states: function(mStateMap) {
|
|
894
|
+
states: function (mStateMap) {
|
|
907
895
|
if (!Utils.isOfType(mStateMap, Object)) {
|
|
908
896
|
return OpaBuilder.Matchers.TRUE;
|
|
909
897
|
}
|
|
910
898
|
return FEBuilder.Matchers.match(
|
|
911
|
-
Object.keys(mStateMap).map(function(sProperty) {
|
|
899
|
+
Object.keys(mStateMap).map(function (sProperty) {
|
|
912
900
|
switch (sProperty) {
|
|
913
901
|
case "selected":
|
|
914
902
|
return TableBuilder.Row.Matchers.selected(mStateMap.selected);
|
|
@@ -924,8 +912,8 @@ sap.ui.define(
|
|
|
924
912
|
})
|
|
925
913
|
);
|
|
926
914
|
},
|
|
927
|
-
visualGroup: function(iLevel, sTitle) {
|
|
928
|
-
return function(oRow) {
|
|
915
|
+
visualGroup: function (iLevel, sTitle) {
|
|
916
|
+
return function (oRow) {
|
|
929
917
|
if (oRow.getMetadata().getName() === "sap.ui.table.Row") {
|
|
930
918
|
return oRow.getLevel() === iLevel && oRow.getTitle() === sTitle;
|
|
931
919
|
} else {
|
|
@@ -935,8 +923,8 @@ sap.ui.define(
|
|
|
935
923
|
}
|
|
936
924
|
},
|
|
937
925
|
Actions: {
|
|
938
|
-
onCell: function(vColumn, vCellAction) {
|
|
939
|
-
return function(oRow) {
|
|
926
|
+
onCell: function (vColumn, vCellAction) {
|
|
927
|
+
return function (oRow) {
|
|
940
928
|
var iColumn = _getCellIndex(vColumn, oRow),
|
|
941
929
|
oCellControl = _getCell(oRow, iColumn);
|
|
942
930
|
|
|
@@ -949,18 +937,9 @@ sap.ui.define(
|
|
|
949
937
|
}
|
|
950
938
|
if (oCellControl.isA("sap.m.VBox")) {
|
|
951
939
|
oCellControl =
|
|
952
|
-
oCellControl
|
|
953
|
-
.getItems()[0]
|
|
954
|
-
.getContent()
|
|
955
|
-
.getEditMode() === "Display"
|
|
956
|
-
? oCellControl
|
|
957
|
-
.getItems()[0]
|
|
958
|
-
.getContent()
|
|
959
|
-
.getContentDisplay()
|
|
960
|
-
: oCellControl
|
|
961
|
-
.getItems()[0]
|
|
962
|
-
.getContent()
|
|
963
|
-
.getContentEdit()[0];
|
|
940
|
+
oCellControl.getItems()[0].getContent().getEditMode() === "Display"
|
|
941
|
+
? oCellControl.getItems()[0].getContent().getContentDisplay()
|
|
942
|
+
: oCellControl.getItems()[0].getContent().getContentEdit()[0];
|
|
964
943
|
}
|
|
965
944
|
if (oCellControl.isA("sap.fe.core.controls.ConditionalWrapper")) {
|
|
966
945
|
oCellControl = oCellControl.getCondition() ? oCellControl.getContentTrue() : oCellControl.getContentFalse();
|
|
@@ -973,41 +952,41 @@ sap.ui.define(
|
|
|
973
952
|
}
|
|
974
953
|
};
|
|
975
954
|
},
|
|
976
|
-
editCell: function(vColumn, vValue) {
|
|
955
|
+
editCell: function (vColumn, vValue, bInputNotFinalized) {
|
|
977
956
|
return TableBuilder.Row.Actions.onCell(
|
|
978
957
|
vColumn,
|
|
979
958
|
new EnterText({
|
|
980
959
|
text: vValue,
|
|
981
960
|
clearTextFirst: true,
|
|
982
|
-
keepFocus: false,
|
|
961
|
+
keepFocus: bInputNotFinalized ? true : false,
|
|
983
962
|
idSuffix: null,
|
|
984
|
-
pressEnterKey: true
|
|
963
|
+
pressEnterKey: bInputNotFinalized ? false : true
|
|
985
964
|
})
|
|
986
965
|
);
|
|
987
966
|
},
|
|
988
|
-
editCells: function(mColumnValueMap) {
|
|
989
|
-
return Object.keys(mColumnValueMap).map(function(sColumnName) {
|
|
990
|
-
return TableBuilder.Row.Actions.editCell(sColumnName, mColumnValueMap[sColumnName]);
|
|
967
|
+
editCells: function (mColumnValueMap, bInputNotFinalized) {
|
|
968
|
+
return Object.keys(mColumnValueMap).map(function (sColumnName) {
|
|
969
|
+
return TableBuilder.Row.Actions.editCell(sColumnName, mColumnValueMap[sColumnName], bInputNotFinalized);
|
|
991
970
|
});
|
|
992
971
|
},
|
|
993
|
-
onCellInlineAction: function(vColumn, vCellAction) {
|
|
994
|
-
return function(oRow) {
|
|
972
|
+
onCellInlineAction: function (vColumn, vCellAction) {
|
|
973
|
+
return function (oRow) {
|
|
995
974
|
var aButtons = _getButtonsForInlineActions(vColumn, oRow);
|
|
996
975
|
return OpaBuilder.Actions.executor(vCellAction)(aButtons);
|
|
997
976
|
};
|
|
998
977
|
},
|
|
999
|
-
pressInlineAction: function(vColumn) {
|
|
978
|
+
pressInlineAction: function (vColumn) {
|
|
1000
979
|
return TableBuilder.Row.Actions.onCellInlineAction(vColumn, OpaBuilder.Actions.press());
|
|
1001
980
|
}
|
|
1002
981
|
}
|
|
1003
982
|
};
|
|
1004
983
|
|
|
1005
984
|
TableBuilder.Matchers = {
|
|
1006
|
-
isGridTable: function() {
|
|
985
|
+
isGridTable: function () {
|
|
1007
986
|
return _isGridTable;
|
|
1008
987
|
},
|
|
1009
|
-
rows: function(vRowMatcher) {
|
|
1010
|
-
return function(oMdcTable) {
|
|
988
|
+
rows: function (vRowMatcher) {
|
|
989
|
+
return function (oMdcTable) {
|
|
1011
990
|
// when having an overlay, the table is dirty and the rows do not reflect the actual table state
|
|
1012
991
|
if (TableBuilder.Matchers.overlay(true)(oMdcTable)) {
|
|
1013
992
|
return [];
|
|
@@ -1015,21 +994,21 @@ sap.ui.define(
|
|
|
1015
994
|
return OpaBuilder.Matchers.aggregation(_getRowAggregationName(oMdcTable), vRowMatcher)(oMdcTable._oTable);
|
|
1016
995
|
};
|
|
1017
996
|
},
|
|
1018
|
-
rowsMatcher: function(vRowMatcher) {
|
|
997
|
+
rowsMatcher: function (vRowMatcher) {
|
|
1019
998
|
var fnMatchRows = TableBuilder.Matchers.rows(vRowMatcher);
|
|
1020
|
-
return function(oMdcTable) {
|
|
999
|
+
return function (oMdcTable) {
|
|
1021
1000
|
return fnMatchRows(oMdcTable).length > 0;
|
|
1022
1001
|
};
|
|
1023
1002
|
},
|
|
1024
|
-
columnControl: function(vColumn) {
|
|
1025
|
-
return function(oMdcTable) {
|
|
1003
|
+
columnControl: function (vColumn) {
|
|
1004
|
+
return function (oMdcTable) {
|
|
1026
1005
|
var iColumnIndex = _getColumnIndex(vColumn, oMdcTable),
|
|
1027
1006
|
oInnerTable = _getInnerTable(oMdcTable);
|
|
1028
1007
|
return oInnerTable.getColumns()[iColumnIndex];
|
|
1029
1008
|
};
|
|
1030
1009
|
},
|
|
1031
|
-
column: function(vColumn, mStates) {
|
|
1032
|
-
return function(oMdcTable) {
|
|
1010
|
+
column: function (vColumn, mStates) {
|
|
1011
|
+
return function (oMdcTable) {
|
|
1033
1012
|
var iColumnIndex = _getColumnIndex(vColumn, oMdcTable),
|
|
1034
1013
|
aColumns = Utils.getAggregation(oMdcTable, "columns");
|
|
1035
1014
|
if (iColumnIndex === -1) {
|
|
@@ -1046,9 +1025,9 @@ sap.ui.define(
|
|
|
1046
1025
|
return false;
|
|
1047
1026
|
};
|
|
1048
1027
|
},
|
|
1049
|
-
columns: function(mColumnsStatesMaps, bIgnoreColumnState) {
|
|
1050
|
-
return function(oMdcTable) {
|
|
1051
|
-
return Object.keys(mColumnsStatesMaps).reduce(function(aResult, vColumn) {
|
|
1028
|
+
columns: function (mColumnsStatesMaps, bIgnoreColumnState) {
|
|
1029
|
+
return function (oMdcTable) {
|
|
1030
|
+
return Object.keys(mColumnsStatesMaps).reduce(function (aResult, vColumn) {
|
|
1052
1031
|
var oColumn = TableBuilder.Matchers.column(
|
|
1053
1032
|
vColumn,
|
|
1054
1033
|
bIgnoreColumnState ? undefined : mColumnsStatesMaps[vColumn]
|
|
@@ -1060,22 +1039,22 @@ sap.ui.define(
|
|
|
1060
1039
|
}, []);
|
|
1061
1040
|
};
|
|
1062
1041
|
},
|
|
1063
|
-
columnsMatcher: function(mColumnMatchers, bIgnoreColumnState) {
|
|
1042
|
+
columnsMatcher: function (mColumnMatchers, bIgnoreColumnState) {
|
|
1064
1043
|
var fnMatchColumns = TableBuilder.Matchers.columns(mColumnMatchers, bIgnoreColumnState);
|
|
1065
|
-
return function(oMdcTable) {
|
|
1044
|
+
return function (oMdcTable) {
|
|
1066
1045
|
return fnMatchColumns(oMdcTable).length === Object.keys(mColumnMatchers).length;
|
|
1067
1046
|
};
|
|
1068
1047
|
},
|
|
1069
|
-
overlay: function(bHasOverlay) {
|
|
1048
|
+
overlay: function (bHasOverlay) {
|
|
1070
1049
|
if (bHasOverlay === undefined) {
|
|
1071
1050
|
bHasOverlay = true;
|
|
1072
1051
|
}
|
|
1073
|
-
return function(oMdcTable) {
|
|
1052
|
+
return function (oMdcTable) {
|
|
1074
1053
|
oMdcTable = oMdcTable._feMdcTableWrapper || oMdcTable;
|
|
1075
1054
|
return oMdcTable && oMdcTable._oTable.getShowOverlay() === bHasOverlay;
|
|
1076
1055
|
};
|
|
1077
1056
|
},
|
|
1078
|
-
state: function(sName, vValue) {
|
|
1057
|
+
state: function (sName, vValue) {
|
|
1079
1058
|
switch (sName) {
|
|
1080
1059
|
case "overlay":
|
|
1081
1060
|
return TableBuilder.Matchers.overlay(vValue);
|
|
@@ -1083,7 +1062,7 @@ sap.ui.define(
|
|
|
1083
1062
|
return FEBuilder.Matchers.state(sName, vValue);
|
|
1084
1063
|
}
|
|
1085
1064
|
},
|
|
1086
|
-
states: function(mStateMap) {
|
|
1065
|
+
states: function (mStateMap) {
|
|
1087
1066
|
return FEBuilder.Matchers.states(mStateMap, TableBuilder.Matchers.state);
|
|
1088
1067
|
}
|
|
1089
1068
|
};
|