@sapui5/sap.rules.ui 1.121.0 → 1.123.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.
Files changed (87) hide show
  1. package/package.json +1 -1
  2. package/src/sap/rules/ui/.library +1 -1
  3. package/src/sap/rules/ui/AstExpressionBasic.js +25 -18
  4. package/src/sap/rules/ui/AstExpressionBasicRenderer.js +6 -4
  5. package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +36 -34
  6. package/src/sap/rules/ui/BindingSpy.js +3 -4
  7. package/src/sap/rules/ui/DecisionTable.js +113 -74
  8. package/src/sap/rules/ui/DecisionTableCell.js +67 -34
  9. package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +17 -13
  10. package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +40 -32
  11. package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +21 -19
  12. package/src/sap/rules/ui/DecisionTableConfiguration.js +5 -6
  13. package/src/sap/rules/ui/DecisionTableRenderer.js +6 -5
  14. package/src/sap/rules/ui/DecisionTableSettings.js +264 -232
  15. package/src/sap/rules/ui/DecisionTableSettingsOld.js +61 -61
  16. package/src/sap/rules/ui/ExpressionAdvanced.js +135 -111
  17. package/src/sap/rules/ui/ExpressionBase.js +1 -1
  18. package/src/sap/rules/ui/ExpressionBasic.js +17 -12
  19. package/src/sap/rules/ui/InstructionRenderer.js +30 -26
  20. package/src/sap/rules/ui/RuleBase.js +2 -3
  21. package/src/sap/rules/ui/RuleBuilder.js +29 -23
  22. package/src/sap/rules/ui/TextRule.js +78 -62
  23. package/src/sap/rules/ui/TextRuleConfiguration.js +2 -3
  24. package/src/sap/rules/ui/TextRuleSettings.js +133 -116
  25. package/src/sap/rules/ui/ast/autoComplete/AutoComplete.js +4 -3
  26. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +15 -10
  27. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +14 -9
  28. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +14 -10
  29. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +15 -11
  30. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +26 -17
  31. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +75 -53
  32. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +14 -10
  33. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +14 -10
  34. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +14 -9
  35. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +14 -10
  36. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +14 -10
  37. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +14 -10
  38. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +14 -10
  39. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +14 -9
  40. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +35 -23
  41. package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +93 -73
  42. package/src/sap/rules/ui/ast/util/AggregateFunctionDialog.js +172 -157
  43. package/src/sap/rules/ui/ast/util/LoopFunctionDialog.js +186 -163
  44. package/src/sap/rules/ui/ast/util/SelectFunctionDialog.js +205 -182
  45. package/src/sap/rules/ui/ast/util/utilsBase.js +85 -0
  46. package/src/sap/rules/ui/codemirror/addon/hint/show-hint.js +8 -4
  47. package/src/sap/rules/ui/i18n/messagebundle.properties +9 -1
  48. package/src/sap/rules/ui/i18n/messagebundle_ar.properties +1 -1
  49. package/src/sap/rules/ui/i18n/messagebundle_cnr.properties +34 -34
  50. package/src/sap/rules/ui/i18n/messagebundle_en_US_saprigi.properties +285 -285
  51. package/src/sap/rules/ui/i18n/messagebundle_hu.properties +1 -1
  52. package/src/sap/rules/ui/i18n/messagebundle_mk.properties +3 -3
  53. package/src/sap/rules/ui/i18n/messagebundle_sh.properties +88 -88
  54. package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -5
  55. package/src/sap/rules/ui/library.js +6 -7
  56. package/src/sap/rules/ui/parser/businessLanguage/lib/IDPParser.js +115 -114
  57. package/src/sap/rules/ui/parser/businessLanguage/lib/antlr3_all_min.js +4 -4
  58. package/src/sap/rules/ui/parser/businessLanguage/lib/autoCompleteUtils.js +4 -3
  59. package/src/sap/rules/ui/parser/businessLanguage/lib/conversionUtils.js +10 -6
  60. package/src/sap/rules/ui/parser/businessLanguage/lib/entityModel.js +8 -7
  61. package/src/sap/rules/ui/parser/businessLanguage/lib/entityModelConstractor.js +17 -16
  62. package/src/sap/rules/ui/parser/businessLanguage/lib/parsingBackendMediator.js +10 -9
  63. package/src/sap/rules/ui/parser/businessLanguage/lib/termsUtils.js +4 -3
  64. package/src/sap/rules/ui/parser/i18n/messages_descriptions_cnr.properties +57 -57
  65. package/src/sap/rules/ui/parser/i18n/messages_descriptions_en_US_saprigi.properties +210 -210
  66. package/src/sap/rules/ui/parser/i18n/messages_descriptions_mk.properties +1 -1
  67. package/src/sap/rules/ui/parser/i18n/messages_descriptions_sh.properties +90 -90
  68. package/src/sap/rules/ui/parser/i18n/messages_descriptions_sr.properties +1 -1
  69. package/src/sap/rules/ui/parser/i18n/messages_descriptions_uk.properties +2 -2
  70. package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_cnr.properties +19 -19
  71. package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_en_US_saprigi.properties +26 -26
  72. package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_mk.properties +2 -2
  73. package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sh.properties +26 -26
  74. package/src/sap/rules/ui/parser/infrastructure/errorHandling/hrfException.js +3 -3
  75. package/src/sap/rules/ui/parser/infrastructure/locale/lib/resourceBundleContext.js +4 -3
  76. package/src/sap/rules/ui/parser/infrastructure/messageHandling/lib/responseCollector.js +8 -7
  77. package/src/sap/rules/ui/parser/ruleBody/lib/ruleBody.js +8 -7
  78. package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyConvertor.js +4 -3
  79. package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyValidator.js +9 -8
  80. package/src/sap/rules/ui/providers/ValueHelpDialogProvider.js +63 -46
  81. package/src/sap/rules/ui/providers/ValueHelpProvider.js +8 -7
  82. package/src/sap/rules/ui/services/AstExpressionLanguage.js +12 -10
  83. package/src/sap/rules/ui/services/ExpressionLanguage.js +89 -83
  84. package/src/sap/rules/ui/type/DecisionTableCell.js +2 -2
  85. package/src/sap/rules/ui/type/DecisionTableHeader.js +3 -3
  86. package/src/sap/rules/ui/type/Expression.js +3 -3
  87. package/src/sap/rules/ui/type/ExpressionAbs.js +5 -5
@@ -3,14 +3,33 @@ sap.ui.define([
3
3
  "sap/m/List",
4
4
  "sap/ui/model/json/JSONModel",
5
5
  "sap/rules/ui/ast/constants/Constants",
6
- "sap/rules/ui/ast/provider/TermsProvider"
7
-
8
- ], function (Control, List, JSONModel, Constants, TermsProvider) {
6
+ "sap/rules/ui/ast/provider/TermsProvider",
7
+ "sap/ui/layout/GridData",
8
+ "sap/m/Select",
9
+ "sap/ui/core/ListItem",
10
+ "sap/m/ColumnListItem",
11
+ "sap/ui/layout/HorizontalLayout",
12
+ "sap/m/Button",
13
+ "sap/m/library",
14
+ "sap/ui/core/IconPool",
15
+ "sap/m/TextArea",
16
+ "sap/m/Table",
17
+ "sap/m/Column",
18
+ /*"sap/ui/layout/form/GridContainerData",*/
19
+ "sap/ui/layout/form/SimpleForm",
20
+ "sap/m/Label",
21
+ "sap/m/Dialog",
22
+ "sap/ui/core/Lib",
23
+ "sap/m/Text",
24
+ "sap/ui/core/Element"
25
+
26
+ ], function (Control, List, JSONModel, Constants, TermsProvider, GridData, Select, ListItem, ColumnListItem, HorizontalLayout, Button,
27
+ mobileLibrary, IconPool, TextArea, Table, Column, /*GridContainerData, */SimpleForm, Label, Dialog, coreLib, Text, Element) {
9
28
  "use strict";
10
29
 
11
30
  var instance;
12
31
  var LoopFunctionDialog = function () {
13
- this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
32
+ this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
14
33
  this.functionLabelDisplay = "";
15
34
  this.functionLabel = "";
16
35
  this._loopFunctionSelected = "";
@@ -55,14 +74,14 @@ sap.ui.define([
55
74
  };
56
75
  LoopFunctionDialog.prototype._createLoopFunctionDropDown = function (loopFunction, sAriaValue) {
57
76
  var that = this;
58
- var model = new sap.ui.model.json.JSONModel(loopFunction);
77
+ var model = new JSONModel(loopFunction);
59
78
 
60
- this.functionLoop = new sap.m.Select({
79
+ this.functionLoop = new Select({
61
80
  width: "200px",
62
81
  selectedKey: this._loopFunctionSelected,
63
82
  forceSelection: false,
64
83
  showSecondaryValues: true,
65
- layoutData: new sap.ui.layout.GridData({
84
+ layoutData: new GridData({
66
85
  span: "L3 M3 S3"
67
86
  }),
68
87
  ariaLabelledBy: sAriaValue,
@@ -90,7 +109,7 @@ sap.ui.define([
90
109
  this.functionLoop.setModel(model);
91
110
  this.functionLoop.bindItems({
92
111
  path: "/loop",
93
- template: new sap.ui.core.ListItem({
112
+ template: new ListItem({
94
113
  text: "{name}",
95
114
  key: "{name}",
96
115
  additionalText: "{label}"
@@ -100,9 +119,9 @@ sap.ui.define([
100
119
  return this.functionLoop;
101
120
  };
102
121
 
103
- LoopFunctionDialog.prototype._getOperationAstExpressionBasic = function (bindingContext, sAriaValue) {
122
+ LoopFunctionDialog.prototype._getOperationAstExpressionBasic = function (sAriaValue, AstExpressionBasic) {
104
123
  var that = this;
105
- this.astExpressionBasicForOperation = new sap.rules.ui.AstExpressionBasic({
124
+ this.astExpressionBasicForOperation = new AstExpressionBasic({
106
125
  astExpressionLanguage: this._oAstExpressionLanguage,
107
126
  value: "{operationSelected}",
108
127
  conditionContext: false,
@@ -132,15 +151,15 @@ sap.ui.define([
132
151
  return this.astExpressionBasicForOperation;
133
152
  };
134
153
 
135
- LoopFunctionDialog.prototype._tableColumnsFactory = function (sId, oContext) {
154
+ LoopFunctionDialog.prototype._tableColumnsFactory = function (AstExpressionBasic, sId, oContext) {
136
155
  var that = this;
137
- var itemTemplate = new sap.m.ColumnListItem({
138
- cells: [that._getOperationAstExpressionBasic("loopOperationsLabelId"),
139
- new sap.ui.layout.HorizontalLayout({
156
+ var itemTemplate = new ColumnListItem({
157
+ cells: [that._getOperationAstExpressionBasic("loopOperationsLabelId", AstExpressionBasic),
158
+ new HorizontalLayout({
140
159
  content: [
141
- new sap.m.Button({
142
- type: sap.m.ButtonType.Transparent,
143
- icon: sap.ui.core.IconPool.getIconURI("sys-cancel"),
160
+ new Button({
161
+ type: mobileLibrary.ButtonType.Transparent,
162
+ icon:IconPool.getIconURI("sys-cancel"),
144
163
  visible: "{cancelButton}",
145
164
  enabled: "{/enabledData/enabled}",
146
165
  press: function (oEvent) {
@@ -153,9 +172,9 @@ sap.ui.define([
153
172
 
154
173
  }.bind(this)
155
174
  }),
156
- new sap.m.Button({
157
- type: sap.m.ButtonType.Transparent,
158
- icon: sap.ui.core.IconPool.getIconURI("add"),
175
+ new Button({
176
+ type: mobileLibrary.ButtonType.Transparent,
177
+ icon: IconPool.getIconURI("add"),
159
178
  visible: "{addButton}",
160
179
  enabled: "{/enabledData/enabled}",
161
180
  press: function (oEvent) {
@@ -242,9 +261,9 @@ sap.ui.define([
242
261
  var that = this;
243
262
  var autoSuggestion = this._getSuggestionsForTheGivenInput("");
244
263
  var aVocabulary = this._filterloopFunctionVocabulary(autoSuggestion.autoComplete.categories.terms);
245
- var model = new sap.ui.model.json.JSONModel(aVocabulary);
264
+ var model = new JSONModel(aVocabulary);
246
265
 
247
- this.vocabularySelect = new sap.m.Select({
266
+ this.vocabularySelect = new Select({
248
267
  width: "100%",
249
268
  selectedKey: this.dataObjectIdSelected,
250
269
  forceSelection: false,
@@ -290,7 +309,7 @@ sap.ui.define([
290
309
  this.vocabularySelect.setModel(model);
291
310
  this.vocabularySelect.bindItems({
292
311
  path: "/terms",
293
- template: new sap.ui.core.ListItem({
312
+ template: new ListItem({
294
313
  text: "{label}",
295
314
  key: "{id}"
296
315
  })
@@ -298,7 +317,7 @@ sap.ui.define([
298
317
  // Add Rules to the same path so that the dataobjects list contain rules as well
299
318
  var vocabularyRules = autoSuggestion.autoComplete.categories.vocabularyRules;
300
319
  for (var entry in vocabularyRules) {
301
- var item = new sap.ui.core.ListItem({
320
+ var item = new ListItem({
302
321
  text: vocabularyRules[entry].label,
303
322
  key: vocabularyRules[entry].id
304
323
  })
@@ -309,7 +328,7 @@ sap.ui.define([
309
328
  };
310
329
 
311
330
  LoopFunctionDialog.prototype._bindOperations = function () {
312
- this.oModel = new sap.ui.model.json.JSONModel();
331
+ this.oModel = new JSONModel();
313
332
  this.oModel.setData({
314
333
  selectionData: this.selectedData,
315
334
  enabledData: this.enabledData,
@@ -317,9 +336,9 @@ sap.ui.define([
317
336
  });
318
337
  this.conditionsTable.setModel(this.oModel);
319
338
  };
320
- LoopFunctionDialog.prototype._createWhereAstExpressionBasic = function (sAriaValue) {
339
+ LoopFunctionDialog.prototype._createWhereAstExpressionBasic = function (sAriaValue, AstExpressionBasic) {
321
340
  var that = this;
322
- this.astExpressionBasicForWhere = new sap.rules.ui.AstExpressionBasic({
341
+ this.astExpressionBasicForWhere = new AstExpressionBasic({
323
342
  astExpressionLanguage: this._oAstExpressionLanguage,
324
343
  enableAggregateFunctionWhereClause: true,
325
344
  value: this._whereExpressionId,
@@ -358,7 +377,7 @@ sap.ui.define([
358
377
  };
359
378
 
360
379
  LoopFunctionDialog.prototype._createFunctionLabel = function () {
361
- this.functionLabelField = new sap.m.TextArea({
380
+ this.functionLabelField = new TextArea({
362
381
  value: this.functionLabelDisplay,
363
382
  enabled: false,
364
383
  width: "100%"
@@ -390,27 +409,27 @@ sap.ui.define([
390
409
  };
391
410
  }
392
411
 
393
- LoopFunctionDialog.prototype._createTable = function () {
412
+ LoopFunctionDialog.prototype._createTable = function (AstExpressionBasic) {
394
413
  var that = this;
395
- this.conditionsTable = new sap.m.Table({
396
- backgroundDesign: sap.m.BackgroundDesign.Solid,
397
- showSeparators: sap.m.ListSeparators.None,
398
- layoutData: new sap.ui.layout.form.GridContainerData({
414
+ this.conditionsTable = new Table({
415
+ backgroundDesign: mobileLibrary.BackgroundDesign.Solid,
416
+ showSeparators: mobileLibrary.ListSeparators.None,
417
+ /*layoutData: new sap.ui.layout.form.GridContainerData({
399
418
  halfGrid: false
400
- }),
419
+ }),*/
401
420
  columns: [
402
- new sap.m.Column({
421
+ new Column({
403
422
  width: "89%"
404
423
  }).setStyleClass("sapAstOperationColumn"),
405
424
 
406
- new sap.m.Column({
425
+ new Column({
407
426
  width: "11%"
408
427
  })
409
428
  ]
410
429
  }).addStyleClass("sapAstOperationTable");
411
430
 
412
431
  this._bindOperations();
413
- var itemTemplate = that._tableColumnsFactory();
432
+ var itemTemplate = that._tableColumnsFactory(AstExpressionBasic);
414
433
  this.conditionsTable.bindItems("/selectionData", itemTemplate);
415
434
 
416
435
  return this.conditionsTable;
@@ -427,137 +446,141 @@ sap.ui.define([
427
446
  var that = this;
428
447
  var sequence = 0;
429
448
  this._clearData();
430
- this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
449
+ this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
431
450
  this._oAstExpressionLanguage = AstExpressionLanguage;
432
451
  this._loopFunctionSelected = Constants.FOREACH;
433
- if (jsonData) {
434
- this._loopFunctionSelected = jsonData.function;
435
- this._whereExpressionId = jsonData.filter;
436
- this.dataObjectId = jsonData.dataObject;
437
- this.functionLabel = jsonData.functionLabel;
438
- this.dataObjectIdSelected = jsonData.dataObject.replace("/", "");
439
- this.operationArray = jsonData.actions;
440
- that.functionLabelDisplay = this._convertFunctionLabelToText(jsonData.dataObject, jsonData.functionLabel);;
441
- if (this.dataObjectId) {
442
- this.dataObjectIdData.dataObjectId = this.dataObjectId;
443
- this.enabledData.enabled = true;
444
- this.termsProvider = this._oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
445
- this.dataObjectLabel = this.termsProvider.getTermNameFromASTNodeReference(this.dataObjectId);
446
- }
447
- if (this.operationArray && this.operationArray.length > 0) {
448
- this.selectedData = [];
449
- for (var index = 0; index < this.operationArray.length; index++) {
450
- var newjson = {
451
- operationSelected: "",
452
- preSuggestionContext: "",
453
- cancelButton: true,
454
- addButton: true,
455
- }
456
- newjson.operationSelected = this.operationArray[index];
457
- this.selectedData.push(newjson);
458
- sequence++;
459
- }
460
- if (sequence === 1) {
461
- this.selectedData[0].cancelButton = false;
462
- }
463
- if (!this._whereExpressionId) {
464
- that.selectedData[0].preSuggestionContext = this._loopFunctionSelected + "(" + this.dataObjectId + ",";
465
- } else {
466
- that.selectedData[0].preSuggestionContext = this._loopFunctionSelected + "(" + Constants.FILTER + "(" + this.dataObjectId + "," +
467
- that._whereExpressionId + ") ,";
468
- }
469
- that._setPreSuggestionContextChange(0);
470
- }
471
-
472
- }
473
-
474
- var functionLoop = that._createLoopFunctionDropDown(data, "LoopFuntionLabelId");
475
- var oVocabularyText = new sap.m.Text({
476
- text: that.oBundle.getText("vocabulary"),
477
- tooltip: that.oBundle.getText("vocabulary"),
478
- textAlign: "End",
479
- layoutData: new sap.ui.layout.GridData({
480
- span: "L2 M2 S2"
481
- })
482
- });
483
- var operationTable = that._createTable();
484
- var oWhereControl = that._createWhereAstExpressionBasic("loopWhereLabelId");
485
- var oFunctionLabelControl = that._createFunctionLabel();
486
-
487
- var verticalLayoutForLoopFunction = new sap.ui.layout.form.SimpleForm({
488
- layout: sap.ui.layout.form.SimpleFormLayout.ResponsiveGridLayout,
489
- editable: true,
490
- content: [
491
- new sap.m.Label("loopFunctionSelectionLabelId", {
492
- text: that.oBundle.getText("function"),
493
- tooltip: that.oBundle.getText("function"),
494
- labelFor: functionLoop.getId()
495
- }), functionLoop,
496
- oVocabularyText,
497
- that._createVocabularyDropDown(oVocabularyText.getId()),
498
- new sap.m.Label("loopWhereLabelId", {
499
- text: that.oBundle.getText("where"),
500
- tooltip: that.oBundle.getText("where"),
501
- labelFor: oWhereControl.getId()
502
- }),
503
- oWhereControl,
504
- new sap.m.Label("loopOperationsLabelId", {
505
- text: "",
506
- tooltip: "",
507
- labelFor: operationTable.getId()
508
- }).addStyleClass(""),
509
- operationTable,
510
- new sap.m.Label({
511
- text: that.oBundle.getText("function_label"),
512
- tooltip: that.oBundle.getText("function_label"),
513
- labelFor: oFunctionLabelControl.getId()
514
- }),
515
- oFunctionLabelControl
516
- ]
517
- });
518
-
519
- var loopFunctionsDialog = new sap.m.Dialog({
520
- title: this.oBundle.getText("loopFunctionTitle"),
521
- contentWidth: "800px",
522
- showHeader: true,
523
- draggable: true,
524
- beforeClose: function () {
525
- dialogOpenedCallbackReference(false);
526
- },
527
- content: [verticalLayoutForLoopFunction],
528
- buttons: [
529
- this.applyButton = new sap.m.Button({
530
- text: this.oBundle.getText("apply"),
531
- tooltip: this.oBundle.getText("applyChangesBtnTooltip"),
532
- press: function (event) {
533
- var loopFunctionData = that._createJson()
534
- event.getSource().mProperties = {
535
- value: that.functionLabel,
536
- jsonData: loopFunctionData
537
- };
538
- callBack(event);
539
- that._setModal(false);
540
- loopFunctionsDialog.close();
541
- loopFunctionsDialog.destroy();
542
- }
543
- }),
544
- new sap.m.Button({
545
- text: this.oBundle.getText("cancel"),
546
- tooltip: this.oBundle.getText("cancelBtnTooltip"),
547
- press: function (event) {
548
- that._setModal(false);
549
- loopFunctionsDialog.close();
550
- loopFunctionsDialog.destroy();
551
- }
552
- })
553
- ]
554
- }).addStyleClass("sapUiSizeCompact");;
555
- that._setModal(true);
556
- loopFunctionsDialog.open();
452
+ sap.ui.require([
453
+ "sap/rules/ui/AstExpressionBasic"
454
+ ], (AstExpressionBasic) => {
455
+ if (jsonData) {
456
+ this._loopFunctionSelected = jsonData.function;
457
+ this._whereExpressionId = jsonData.filter;
458
+ this.dataObjectId = jsonData.dataObject;
459
+ this.functionLabel = jsonData.functionLabel;
460
+ this.dataObjectIdSelected = jsonData.dataObject.replace("/", "");
461
+ this.operationArray = jsonData.actions;
462
+ that.functionLabelDisplay = this._convertFunctionLabelToText(jsonData.dataObject, jsonData.functionLabel);;
463
+ if (this.dataObjectId) {
464
+ this.dataObjectIdData.dataObjectId = this.dataObjectId;
465
+ this.enabledData.enabled = true;
466
+ this.termsProvider = this._oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
467
+ this.dataObjectLabel = this.termsProvider.getTermNameFromASTNodeReference(this.dataObjectId);
468
+ }
469
+ if (this.operationArray && this.operationArray.length > 0) {
470
+ this.selectedData = [];
471
+ for (var index = 0; index < this.operationArray.length; index++) {
472
+ var newjson = {
473
+ operationSelected: "",
474
+ preSuggestionContext: "",
475
+ cancelButton: true,
476
+ addButton: true,
477
+ }
478
+ newjson.operationSelected = this.operationArray[index];
479
+ this.selectedData.push(newjson);
480
+ sequence++;
481
+ }
482
+ if (sequence === 1) {
483
+ this.selectedData[0].cancelButton = false;
484
+ }
485
+ if (!this._whereExpressionId) {
486
+ that.selectedData[0].preSuggestionContext = this._loopFunctionSelected + "(" + this.dataObjectId + ",";
487
+ } else {
488
+ that.selectedData[0].preSuggestionContext = this._loopFunctionSelected + "(" + Constants.FILTER + "(" + this.dataObjectId + "," +
489
+ that._whereExpressionId + ") ,";
490
+ }
491
+ that._setPreSuggestionContextChange(0);
492
+ }
493
+
494
+ }
495
+
496
+ var functionLoop = that._createLoopFunctionDropDown(data, "LoopFuntionLabelId");
497
+ var oVocabularyText = new Text({
498
+ text: that.oBundle.getText("vocabulary"),
499
+ tooltip: that.oBundle.getText("vocabulary"),
500
+ textAlign: "End",
501
+ layoutData: new GridData({
502
+ span: "L2 M2 S2"
503
+ })
504
+ });
505
+ var operationTable = that._createTable(AstExpressionBasic);
506
+ var oWhereControl = that._createWhereAstExpressionBasic("loopWhereLabelId", AstExpressionBasic);
507
+ var oFunctionLabelControl = that._createFunctionLabel();
508
+
509
+ var verticalLayoutForLoopFunction = new SimpleForm({
510
+ layout: "ResponsiveGridLayout",
511
+ editable: true,
512
+ content: [
513
+ new Label("loopFunctionSelectionLabelId", {
514
+ text: that.oBundle.getText("function"),
515
+ tooltip: that.oBundle.getText("function"),
516
+ labelFor: functionLoop.getId()
517
+ }), functionLoop,
518
+ oVocabularyText,
519
+ that._createVocabularyDropDown(oVocabularyText.getId()),
520
+ new Label("loopWhereLabelId", {
521
+ text: that.oBundle.getText("where"),
522
+ tooltip: that.oBundle.getText("where"),
523
+ labelFor: oWhereControl.getId()
524
+ }),
525
+ oWhereControl,
526
+ new Label("loopOperationsLabelId", {
527
+ text: "",
528
+ tooltip: "",
529
+ labelFor: operationTable.getId()
530
+ }).addStyleClass(""),
531
+ operationTable,
532
+ new Label({
533
+ text: that.oBundle.getText("function_label"),
534
+ tooltip: that.oBundle.getText("function_label"),
535
+ labelFor: oFunctionLabelControl.getId()
536
+ }),
537
+ oFunctionLabelControl
538
+ ]
539
+ });
540
+
541
+ var loopFunctionsDialog = new Dialog({
542
+ title: this.oBundle.getText("loopFunctionTitle"),
543
+ contentWidth: "800px",
544
+ showHeader: true,
545
+ draggable: true,
546
+ beforeClose: function () {
547
+ dialogOpenedCallbackReference(false);
548
+ },
549
+ content: [verticalLayoutForLoopFunction],
550
+ buttons: [
551
+ this.applyButton = new Button({
552
+ text: this.oBundle.getText("apply"),
553
+ tooltip: this.oBundle.getText("applyChangesBtnTooltip"),
554
+ press: function (event) {
555
+ var loopFunctionData = that._createJson()
556
+ event.getSource().mProperties = {
557
+ value: that.functionLabel,
558
+ jsonData: loopFunctionData
559
+ };
560
+ callBack(event);
561
+ that._setModal(false);
562
+ loopFunctionsDialog.close();
563
+ loopFunctionsDialog.destroy();
564
+ }
565
+ }),
566
+ new Button({
567
+ text: this.oBundle.getText("cancel"),
568
+ tooltip: this.oBundle.getText("cancelBtnTooltip"),
569
+ press: function (event) {
570
+ that._setModal(false);
571
+ loopFunctionsDialog.close();
572
+ loopFunctionsDialog.destroy();
573
+ }
574
+ })
575
+ ]
576
+ }).addStyleClass("sapUiSizeCompact");;
577
+ that._setModal(true);
578
+ loopFunctionsDialog.open();
579
+ });
557
580
  };
558
581
 
559
582
  LoopFunctionDialog.prototype._setModal = function (value) {
560
- var pop = sap.ui.getCore().byId("popover");
583
+ var pop = Element.getElementById("popover");
561
584
  if (pop) {
562
585
  pop.setModal(value);
563
586
  }