@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
@@ -7,7 +7,7 @@
7
7
 
8
8
  // Provides control sap.rules.ui.
9
9
  sap.ui.define([
10
- "jquery.sap.global",
10
+ "sap/ui/thirdparty/jquery",
11
11
  "sap/rules/ui/library",
12
12
  "sap/ui/core/Control",
13
13
  "sap/ui/layout/form/SimpleForm",
@@ -28,10 +28,27 @@ sap.ui.define([
28
28
  "sap/rules/ui/Constants",
29
29
  "sap/rules/ui/AstExpressionBasic",
30
30
  "sap/rules/ui/services/AstExpressionLanguage",
31
+ "sap/ui/core/library",
32
+ "sap/ui/model/odata/v2/ODataModel",
33
+ "sap/ui/model/Context",
34
+ "sap/m/library",
35
+ "sap/m/MessageStrip",
36
+ "sap/ui/layout/HorizontalLayout",
37
+ "sap/ui/core/Item",
38
+ /*"sap/ui/layout/form/GridContainerData",*/
39
+ "sap/ui/layout/ResponsiveFlowLayoutData",
40
+ "sap/ui/core/IconPool",
41
+ "sap/ui/model/json/JSONModel",
42
+ "sap/m/ColumnListItem",
43
+ "sap/ui/core/EventBus",
44
+ "sap/ui/core/Lib",
45
+ "sap/ui/core/Element",
46
+ "sap/m/MessageToast",
31
47
  "./TextRuleSettingsRenderer"
32
48
  ],
33
49
  function (jQuery, library, Control, SimpleForm, Label, Switch, Select, MessageBox, Table, Column, Text, Input, Button, ComboBox,
34
- ExpressionAdvanced, VerticalLayout, ExpressionType, AstYamlConverter, Constants, ASTExpressionBasic, AstExpressionLanguage, TextRuleSettingsRenderer) {
50
+ ExpressionAdvanced, VerticalLayout, ExpressionType, AstYamlConverter, Constants, ASTExpressionBasic, AstExpressionLanguage, coreLibrary, ODataModel,
51
+ Context, mobileLibrary, MessageStrip, HorizontalLayout, Item, /*GridContainerData,*/ ResponsiveFlowLayoutData, IconPool, JSONModel, ColumnListItem, EventBus, coreLib, Element, MessageToast, TextRuleSettingsRenderer) {
35
52
  "use strict";
36
53
 
37
54
  /**
@@ -45,7 +62,7 @@ sap.ui.define([
45
62
  * @extends Control
46
63
  *
47
64
  * @author SAP SE
48
- * @version 1.121.0
65
+ * @version 1.123.0
49
66
  *
50
67
  * @constructor
51
68
  * @private
@@ -94,9 +111,9 @@ sap.ui.define([
94
111
  renderer: TextRuleSettingsRenderer
95
112
  });
96
113
 
97
- sap.rules.ui.TextRuleSettings.prototype._addNodeObject = function (astNode) {
114
+ oTextRuleSettings.prototype._addNodeObject = function (astNode) {
98
115
  var oNodeArray = [];
99
- var oAstExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
116
+ var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
100
117
  var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
101
118
 
102
119
  var updatedAstNode = [];
@@ -124,17 +141,17 @@ sap.ui.define([
124
141
  oAstUtil.createNode(updatedAstNode);
125
142
  };
126
143
 
127
- sap.rules.ui.TextRuleSettings.prototype._bindPredefinedTable = function (sPath, sKey) {
144
+ oTextRuleSettings.prototype._bindPredefinedTable = function (sPath, sKey) {
128
145
  var that = this;
129
146
  this.oPredefinedTable.destroyItems();
130
147
  var oModel = this.getModel("oDataModel");
131
148
  var oExpressionLanguage;
132
149
  if (this.getExpressionLanguage()) {
133
- oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
150
+ oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
134
151
  } else {
135
- oExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
152
+ oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
136
153
  }
137
- var vocabularyModel = new sap.ui.model.odata.v2.ODataModel(oExpressionLanguage.getModel().sServiceUrl);
154
+ var vocabularyModel = new ODataModel(oExpressionLanguage.getModel().sServiceUrl);
138
155
  var sBindingPath;
139
156
  var oHeaderKey;
140
157
  var oContext;
@@ -151,7 +168,7 @@ sap.ui.define([
151
168
  RuleVersion: oAttributes[i].RuleVersion
152
169
  };
153
170
  sBindingPath = oModel.createKey(sKey, oHeaderKey);
154
- oContext = new sap.ui.model.Context(oModel, sBindingPath);
171
+ oContext = new Context(oModel, sBindingPath);
155
172
  } else {
156
173
  oHeaderKey = {
157
174
  DataObjectId: oAttributes[i].DataObjectId,
@@ -161,7 +178,7 @@ sap.ui.define([
161
178
  AttributeId: oAttributes[i].AttributeId
162
179
  };
163
180
  sBindingPath = vocabularyModel.createKey(sKey, oHeaderKey);
164
- oContext = new sap.ui.model.Context(vocabularyModel, sBindingPath);
181
+ oContext = new Context(vocabularyModel, sBindingPath);
165
182
  }
166
183
 
167
184
  that.oPredefinedTable.addItem(that._predefinedFactory("col-" + i, oContext));
@@ -187,7 +204,7 @@ sap.ui.define([
187
204
  MessageBox.error(
188
205
  oError.responseText, {
189
206
  title: that.oBundle.getText("ERROR_DIALOG"),
190
- actions: [sap.m.MessageBox.Action.OK]
207
+ actions: [MessageBox.Action.OK]
191
208
 
192
209
  }
193
210
  );
@@ -199,7 +216,7 @@ sap.ui.define([
199
216
  };
200
217
 
201
218
  //Function Import for refresh before Apply
202
- sap.rules.ui.TextRuleSettings.prototype._callRefreshResultsFunctionImport = function () {
219
+ oTextRuleSettings.prototype._callRefreshResultsFunctionImport = function () {
203
220
  var that = this;
204
221
  var odataModel = this.getModel("oDataModel");
205
222
  var modelData = this.getModel("TextRuleModel").getData();
@@ -213,7 +230,7 @@ sap.ui.define([
213
230
  MessageBox.error(
214
231
  response.__batchResponses[0].response.body, {
215
232
  title: that.oBundle.getText("refreshFailed"),
216
- actions: [sap.m.MessageBox.Action.OK]
233
+ actions: [MessageBox.Action.OK]
217
234
 
218
235
  }
219
236
  );
@@ -252,12 +269,12 @@ sap.ui.define([
252
269
  };
253
270
 
254
271
  //creates a message strip
255
- sap.rules.ui.TextRuleSettings.prototype._createInfoMessageStrip = function (textstr, elementID) {
256
- var oMsgStrip = new sap.m.MessageStrip({
272
+ oTextRuleSettings.prototype._createInfoMessageStrip = function (textstr, elementID) {
273
+ var oMsgStrip = new MessageStrip({
257
274
  visible: true, // boolean
258
275
  id: elementID,
259
276
  text: textstr, // string
260
- type: sap.ui.core.MessageType.Information, // sap.ui.core.MessageType
277
+ type: coreLibrary.MessageType.Information, // sap.ui.core.MessageType
261
278
  showIcon: true, // boolean
262
279
  showCloseButton: true
263
280
  }).addStyleClass("sapTextRuleSettingsMessageStrip");
@@ -265,7 +282,7 @@ sap.ui.define([
265
282
  };
266
283
 
267
284
  //Creates the formlayout inside the Settings dialog
268
- sap.rules.ui.TextRuleSettings.prototype._createLayout = function () {
285
+ oTextRuleSettings.prototype._createLayout = function () {
269
286
  if (!this.oForm) {
270
287
  this._destroyElements();
271
288
  this.oForm = new SimpleForm("_formLayout", {
@@ -280,14 +297,14 @@ sap.ui.define([
280
297
  text: this.oBundle.getText("output")
281
298
  }).setTooltip(this.oBundle.getText("output")),
282
299
 
283
- new sap.ui.layout.HorizontalLayout({
300
+ new HorizontalLayout({
284
301
  content: [
285
302
  new Select("__resultSelect", {
286
303
 
287
304
  width: "220px",
288
305
  items: {
289
306
  path: "settingModel>/results/resultsEnumeration",
290
- template: new sap.ui.core.Item({
307
+ template: new Item({
291
308
  key: "{settingModel>id}",
292
309
  text: "{settingModel>label}"
293
310
  })
@@ -339,32 +356,32 @@ sap.ui.define([
339
356
  };
340
357
 
341
358
  //Creates predefined table in the settings dialog
342
- sap.rules.ui.TextRuleSettings.prototype._createPredefinedTable = function () {
359
+ oTextRuleSettings.prototype._createPredefinedTable = function () {
343
360
  if (!this.oPredefinedTable) {
344
361
  this.oPredefinedTable = new Table("idPredefinedTable", {
345
- backgroundDesign: sap.m.BackgroundDesign.Solid,
346
- showSeparators: sap.m.ListSeparators.All,
347
- swipeDirection: sap.m.SwipeDirection.Both,
348
- layoutData: new sap.ui.layout.form.GridContainerData({
362
+ backgroundDesign: mobileLibrary.BackgroundDesign.Solid,
363
+ showSeparators: mobileLibrary.ListSeparators.All,
364
+ swipeDirection: mobileLibrary.SwipeDirection.Both,
365
+ /*layoutData: new GridContainerData({
349
366
  halfGrid: false
350
- }),
367
+ }),*/
351
368
  columns: [new Column({
352
369
  width: "45%",
353
- header: new sap.m.Label({
370
+ header: new Label({
354
371
  text: this.oBundle.getText("PredefinedResultColumnHeaderText"),
355
- design: sap.m.LabelDesign.Bold
372
+ design: mobileLibrary.LabelDesign.Bold
356
373
  })
357
374
  }), new Column({
358
375
  width: "25%",
359
- header: new sap.m.Label({
376
+ header: new Label({
360
377
  text: this.oBundle.getText("PredefinedAccessColumnHeaderText"),
361
- design: sap.m.LabelDesign.Bold
378
+ design: mobileLibrary.LabelDesign.Bold
362
379
  })
363
380
  }), new Column({
364
381
  width: "45%",
365
- header: new sap.m.Label({
382
+ header: new Label({
366
383
  text: this.oBundle.getText("PredefinedValuesColumnHeaderText"),
367
- design: sap.m.LabelDesign.Bold
384
+ design: mobileLibrary.LabelDesign.Bold
368
385
  })
369
386
  })]
370
387
  });
@@ -387,28 +404,28 @@ sap.ui.define([
387
404
  };
388
405
 
389
406
  //handle visibility for predefined results section
390
- sap.rules.ui.TextRuleSettings.prototype._handleVisibilityForPredefinedResults = function () {
407
+ oTextRuleSettings.prototype._handleVisibilityForPredefinedResults = function () {
391
408
  if (this.getModel() && !this.getModel().getProperty("/ResultDataObjectId")){
392
409
  this.oPredefinedTable.setVisible(false);
393
- if (sap.ui.getCore().byId("id_HiddenAccessMessageStrip")) {
394
- sap.ui.getCore().byId("id_HiddenAccessMessageStrip").setVisible(false);
410
+ if (Element.getElementById("id_HiddenAccessMessageStrip")) {
411
+ Element.getElementById("id_HiddenAccessMessageStrip").setVisible(false);
395
412
  }
396
- if (sap.ui.getCore().byId("id_EditableAccessMessageStrip")) {
397
- sap.ui.getCore().byId("id_EditableAccessMessageStrip").setVisible(false);
413
+ if (Element.getElementById("id_EditableAccessMessageStrip")) {
414
+ Element.getElementById("id_EditableAccessMessageStrip").setVisible(false);
398
415
  }
399
416
  } else{
400
417
  this.oPredefinedTable.setVisible(true);
401
- if (sap.ui.getCore().byId("id_HiddenAccessMessageStrip")) {
402
- sap.ui.getCore().byId("id_HiddenAccessMessageStrip").setVisible(true);
418
+ if (Element.getElementById("id_HiddenAccessMessageStrip")) {
419
+ Element.getElementById("id_HiddenAccessMessageStrip").setVisible(true);
403
420
  }
404
- if (sap.ui.getCore().byId("id_EditableAccessMessageStrip")) {
405
- sap.ui.getCore().byId("id_EditableAccessMessageStrip").setVisible(true);
421
+ if (Element.getElementById("id_EditableAccessMessageStrip")) {
422
+ Element.getElementById("id_EditableAccessMessageStrip").setVisible(true);
406
423
  }
407
424
  }
408
425
  };
409
426
 
410
427
  //Created Refresh button and handles press event
411
- sap.rules.ui.TextRuleSettings.prototype._createRefreshButton = function () {
428
+ oTextRuleSettings.prototype._createRefreshButton = function () {
412
429
  var _calcStatisticsMessage = function () { //returns null if no changes => we'll disable refresh button
413
430
  this._internalModel.setProperty("/refreshButtonEnabled", true, null, true);
414
431
  return this.oBundle.getText("textRuleRefreshWarning");
@@ -424,9 +441,9 @@ sap.ui.define([
424
441
  MessageBox.warning(
425
442
  dialogStatisticsMessage, {
426
443
  title: this.oBundle.getText("refeshResultWarningTitle"),
427
- actions: [sap.m.MessageBox.Action.OK, sap.m.MessageBox.Action.CANCEL],
444
+ actions: [MessageBox.Action.OK, MessageBox.Action.CANCEL],
428
445
  onClose: function (oAction) {
429
- if (oAction === sap.m.MessageBox.Action.OK) {
446
+ if (oAction === MessageBox.Action.OK) {
430
447
  _handleRefreshConfirmed();
431
448
  }
432
449
  }
@@ -434,12 +451,12 @@ sap.ui.define([
434
451
  }.bind(this);
435
452
 
436
453
  var oRefreshButton = new Button({
437
- layoutData: new sap.ui.layout.ResponsiveFlowLayoutData({
454
+ layoutData: new ResponsiveFlowLayoutData({
438
455
  weight: 1
439
456
  }),
440
- icon: sap.ui.core.IconPool.getIconURI("synchronize"),
457
+ icon: IconPool.getIconURI("synchronize"),
441
458
  width: "3rem",
442
- type: sap.m.ButtonType.Transparent,
459
+ type: mobileLibrary.ButtonType.Transparent,
443
460
  text: "",
444
461
  press: _handleRefreshPress,
445
462
  visible: true,
@@ -449,8 +466,8 @@ sap.ui.define([
449
466
  return oRefreshButton;
450
467
  };
451
468
 
452
- sap.rules.ui.TextRuleSettings.prototype._createVerticalLayout = function () {
453
- var verticalLayout = new sap.ui.layout.VerticalLayout("verticalLayout", {
469
+ oTextRuleSettings.prototype._createVerticalLayout = function () {
470
+ var verticalLayout = new VerticalLayout("verticalLayout", {
454
471
  content: [
455
472
  this._createInfoMessageStrip(this.oBundle.getText("TRPredefinedMessageStripHiddenAccessInfoText"), "id_HiddenAccessMessageStrip"),
456
473
  this._createInfoMessageStrip(this.oBundle.getText("TRPredefinedMessageStripEditableAccessInfoText"),
@@ -461,29 +478,29 @@ sap.ui.define([
461
478
  return verticalLayout;
462
479
  };
463
480
 
464
- sap.rules.ui.TextRuleSettings.prototype._destroyElements = function () {
465
- if (sap.ui.getCore().byId("_formLayout")) {
466
- sap.ui.getCore().byId("_formLayout").destroy();
481
+ oTextRuleSettings.prototype._destroyElements = function () {
482
+ if (Element.getElementById("_formLayout")) {
483
+ Element.getElementById("_formLayout").destroy();
467
484
  }
468
- if (sap.ui.getCore().byId("__elseCheckBox")) {
469
- sap.ui.getCore().byId("__elseCheckBox").destroy();
485
+ if (Element.getElementById("__elseCheckBox")) {
486
+ Element.getElementById("__elseCheckBox").destroy();
470
487
  }
471
- if (sap.ui.getCore().byId("__resultSelect")) {
472
- sap.ui.getCore().byId("__resultSelect").destroy();
488
+ if (Element.getElementById("__resultSelect")) {
489
+ Element.getElementById("__resultSelect").destroy();
473
490
  }
474
- if (sap.ui.getCore().byId("id_HiddenAccessMessageStrip")) {
475
- sap.ui.getCore().byId("id_HiddenAccessMessageStrip").destroy();
491
+ if (Element.getElementById("id_HiddenAccessMessageStrip")) {
492
+ Element.getElementById("id_HiddenAccessMessageStrip").destroy();
476
493
  }
477
- if (sap.ui.getCore().byId("id_EditableAccessMessageStrip")) {
478
- sap.ui.getCore().byId("id_EditableAccessMessageStrip").destroy();
494
+ if (Element.getElementById("id_EditableAccessMessageStrip")) {
495
+ Element.getElementById("id_EditableAccessMessageStrip").destroy();
479
496
  }
480
- if (sap.ui.getCore().byId("idPredefinedTable")) {
481
- sap.ui.getCore().byId("idPredefinedTable").destroy();
497
+ if (Element.getElementById("idPredefinedTable")) {
498
+ Element.getElementById("idPredefinedTable").destroy();
482
499
  }
483
500
  };
484
501
 
485
502
  // Add Decision table specific data for converting the data to code to display and viceVersa.
486
- sap.rules.ui.TextRuleSettings.prototype._formRuleData = function (oContext, expression) {
503
+ oTextRuleSettings.prototype._formRuleData = function (oContext, expression) {
487
504
  var oRuleId = oContext.getProperty("RuleId");
488
505
  var oVersion = oContext.getProperty("Version");
489
506
 
@@ -539,7 +556,7 @@ sap.ui.define([
539
556
  };
540
557
 
541
558
  //Returns the Access Modes
542
- sap.rules.ui.TextRuleSettings.prototype._getAccessOptions = function () {
559
+ oTextRuleSettings.prototype._getAccessOptions = function () {
543
560
  var oAccessOptions = {
544
561
  accessEnumration: [{
545
562
  key: Constants.KEY_EDITABLE,
@@ -552,11 +569,11 @@ sap.ui.define([
552
569
  return oAccessOptions;
553
570
  };
554
571
 
555
- sap.rules.ui.TextRuleSettings.prototype._getASTExpressionBasic = function (oContext, expressionID, expression, businessDataType,
572
+ oTextRuleSettings.prototype._getASTExpressionBasic = function (oContext, expressionID, expression, businessDataType,
556
573
  attributeId, astNodes) {
557
574
  var that = this;
558
- var oAstExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
559
- var sbusinessDataType = businessDataType ? businessDataType : sap.rules.ui.ExpressionType.NonComparison;
575
+ var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
576
+ var sbusinessDataType = businessDataType ? businessDataType : library.ExpressionType.NonComparison;
560
577
  var sAstExpression = this._getExpressionFromAstNodes(oContext, astNodes);
561
578
  var attributeData = oContext.getObject(oContext.getPath());
562
579
  var sAttributeId = attributeData.DataObjectAttributeId ? attributeData.DataObjectAttributeId : attributeData.Id;
@@ -591,7 +608,7 @@ sap.ui.define([
591
608
  };
592
609
 
593
610
  //Reads the selected ResultDataObject from Rule
594
- sap.rules.ui.TextRuleSettings.prototype._getCurrentResult = function () {
611
+ oTextRuleSettings.prototype._getCurrentResult = function () {
595
612
  var modelData = this.getModel().getData();
596
613
  var textRuleModel = this.getModel("TextRuleModel").getData();
597
614
  var oHeaderKey = {
@@ -610,7 +627,7 @@ sap.ui.define([
610
627
  }
611
628
  };
612
629
 
613
- sap.rules.ui.TextRuleSettings.prototype._getExpressionFieldForPredefined = function (oContext, expressionID, expression,
630
+ oTextRuleSettings.prototype._getExpressionFieldForPredefined = function (oContext, expressionID, expression,
614
631
  businessDataType, attributeId, astNodes) {
615
632
  var oExpressionControl;
616
633
  if (this.getAstExpressionLanguage()) {
@@ -621,9 +638,9 @@ sap.ui.define([
621
638
  return oExpressionControl;
622
639
  };
623
640
 
624
- sap.rules.ui.TextRuleSettings.prototype._getExpressionFromAstNodes = function (oContext, astNodes) {
641
+ oTextRuleSettings.prototype._getExpressionFromAstNodes = function (oContext, astNodes) {
625
642
  var that = this;
626
- var oAstExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
643
+ var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
627
644
  var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
628
645
  var displayExpression = "";
629
646
  var sPath = oContext.getPath();
@@ -651,10 +668,10 @@ sap.ui.define([
651
668
 
652
669
  //Returns the expression advanced field
653
670
  // eslint-disable-next-line
654
- sap.rules.ui.TextRuleSettings.prototype._getPredefinedExpressionAdvanced = function (oContext, expressionID, expression,
671
+ oTextRuleSettings.prototype._getPredefinedExpressionAdvanced = function (oContext, expressionID, expression,
655
672
  businessDataType, attributeId) {
656
- var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
657
- var sbusinessDataType = businessDataType ? businessDataType : sap.rules.ui.ExpressionType.NonComparison;
673
+ var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
674
+ var sbusinessDataType = businessDataType ? businessDataType : library.ExpressionType.NonComparison;
658
675
  var that = this;
659
676
  return new ExpressionAdvanced({
660
677
  expressionLanguage: oExpressionLanguage,
@@ -705,8 +722,8 @@ sap.ui.define([
705
722
  }).setBindingContext(oContext);
706
723
  };
707
724
 
708
- sap.rules.ui.TextRuleSettings.prototype._getConvertedExpression = function (expression, isCodeText, oContext) {
709
- var oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
725
+ oTextRuleSettings.prototype._getConvertedExpression = function (expression, isCodeText, oContext) {
726
+ var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
710
727
  var oRuleData = this._formRuleData(oContext, expression);
711
728
  var oResult;
712
729
  if (isCodeText) {
@@ -720,7 +737,7 @@ sap.ui.define([
720
737
  };
721
738
 
722
739
  //Returns the attribute's access mode
723
- sap.rules.ui.TextRuleSettings.prototype._getSelectedVisibilityStatus = function (sAccess) {
740
+ oTextRuleSettings.prototype._getSelectedVisibilityStatus = function (sAccess) {
724
741
  if (sAccess === Constants.HIDDEN) {
725
742
  return Constants.KEY_HIDDEN;
726
743
  } else {
@@ -729,23 +746,23 @@ sap.ui.define([
729
746
  };
730
747
 
731
748
  //Initialises the settings model for TextRuleSettings
732
- sap.rules.ui.TextRuleSettings.prototype._initSettingsModel = function (oResultData) {
749
+ oTextRuleSettings.prototype._initSettingsModel = function (oResultData) {
733
750
  var initialData = {};
734
751
  initialData.predefinedResults = [];
735
752
  initialData.results = oResultData;
736
753
  initialData.accessOptions = this._getAccessOptions();
737
- this._internalModel = new sap.ui.model.json.JSONModel(initialData);
754
+ this._internalModel = new JSONModel(initialData);
738
755
  this.setModel(this._internalModel, "settingModel");
739
756
  };
740
757
 
741
758
  //Reads the DataObjects from vocabulary model for the result dropdown
742
- sap.rules.ui.TextRuleSettings.prototype._getResultsData = function (bnewRule) {
759
+ oTextRuleSettings.prototype._getResultsData = function (bnewRule) {
743
760
  var oExpressionLanguage;
744
761
  var oResultsData = {
745
762
  resultsEnumeration: []
746
763
  };
747
764
  if (this.getExpressionLanguage()) {
748
- oExpressionLanguage = sap.ui.getCore().byId(this.getExpressionLanguage());
765
+ oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
749
766
  oResultsData = {
750
767
  resultsEnumeration: oExpressionLanguage.getResults()
751
768
  };
@@ -755,7 +772,7 @@ sap.ui.define([
755
772
  label: ""
756
773
  });
757
774
  } else {
758
- oExpressionLanguage = sap.ui.getCore().byId(this.getAstExpressionLanguage());
775
+ oExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
759
776
  oResultsData = {
760
777
  resultsEnumeration: oExpressionLanguage.getResults()
761
778
  };
@@ -784,7 +801,7 @@ sap.ui.define([
784
801
  };
785
802
 
786
803
  //Factory function for creating predefined table on first load
787
- sap.rules.ui.TextRuleSettings.prototype._predefinedFactory = function (sId, oContext) {
804
+ oTextRuleSettings.prototype._predefinedFactory = function (sId, oContext) {
788
805
  var colId = sId.split("-")[1];
789
806
  var expressionID = "exp" + colId;
790
807
  var label = oContext.getProperty("DataObjectAttributeLabel") ? oContext.getProperty("DataObjectAttributeLabel") : oContext.getProperty(
@@ -839,24 +856,24 @@ sap.ui.define([
839
856
  returnColListItem = true;
840
857
  }
841
858
  if (returnColListItem) {
842
- return new sap.m.ColumnListItem({
859
+ return new ColumnListItem({
843
860
  visible: true,
844
861
  cells: [
845
- new sap.m.Label({
862
+ new Label({
846
863
  visible: true, // boolean
847
- design: sap.m.LabelDesign.Standard, // sap.m.LabelDesign
864
+ design: mobileLibrary.LabelDesign.Standard, // sap.m.LabelDesign
848
865
  text: displayText,
849
866
  labelFor: expressionID,
850
- textAlign: sap.ui.core.TextAlign.Begin, // sap.ui.core.TextAlign
851
- textDirection: sap.ui.core.TextDirection.Inherit // sap.ui.core.TextDirection
867
+ textAlign: coreLibrary.TextAlign.Begin, // sap.ui.core.TextAlign
868
+ textDirection: coreLibrary.TextDirection.Inherit // sap.ui.core.TextDirection
852
869
  }).setBindingContext(oContext),
853
870
 
854
- new sap.m.Select({
871
+ new Select({
855
872
  width: "65%",
856
873
  id: "select" + colId,
857
874
  items: {
858
875
  path: "settingModel>/accessOptions/accessEnumration",
859
- template: new sap.ui.core.Item({
876
+ template: new Item({
860
877
  key: "{settingModel>key}",
861
878
  text: "{settingModel>value}"
862
879
  })
@@ -876,7 +893,7 @@ sap.ui.define([
876
893
  };
877
894
 
878
895
  //Sets default Result if it is a new rule
879
- sap.rules.ui.TextRuleSettings.prototype._setDefaultResult = function () {
896
+ oTextRuleSettings.prototype._setDefaultResult = function () {
880
897
  var modelData = this.getModel().getData();
881
898
  var resultsEnumeration = this._internalModel.getProperty("/results/resultsEnumeration");
882
899
  if (resultsEnumeration.length > 0) {
@@ -897,10 +914,10 @@ sap.ui.define([
897
914
  };
898
915
 
899
916
  //Changes the AccessMode for attribute and value state of corresponding expression advanced
900
- sap.rules.ui.TextRuleSettings.prototype._setColumnAccessMode = function (oContext, oEvent) {
917
+ oTextRuleSettings.prototype._setColumnAccessMode = function (oContext, oEvent) {
901
918
  var oSelect = oEvent.getSource();
902
919
  var expId = "exp" + oEvent.getSource().sId.split("select")[1];
903
- this.expressionControl = sap.ui.getCore().byId(expId);
920
+ this.expressionControl = Element.getElementById(expId);
904
921
  var sSelectedMode = oSelect.getSelectedKey();
905
922
  if (this.expressionControl instanceof ExpressionAdvanced) {
906
923
  if (sSelectedMode === Constants.KEY_HIDDEN) {
@@ -921,7 +938,7 @@ sap.ui.define([
921
938
  "expId": expId
922
939
  };
923
940
 
924
- var oEventBus = sap.ui.getCore().getEventBus();
941
+ var oEventBus = EventBus.getInstance();
925
942
  oEventBus.publish("sap.ui.rules", "_onHiddenSelected", obj);
926
943
  this._updateResultAttributeJSON(oContext, Constants.HIDDEN, null, null, null, false, false);
927
944
  } else {
@@ -933,7 +950,7 @@ sap.ui.define([
933
950
  };
934
951
 
935
952
  // Function to enable /disable Apply based on hidden attributes
936
- sap.rules.ui.TextRuleSettings.prototype._updateApplyBtnActions = function() {
953
+ oTextRuleSettings.prototype._updateApplyBtnActions = function() {
937
954
  if (this._internalModel) {
938
955
  var predefinedResults = this._internalModel.oData.predefinedResults;
939
956
  var hiddenAttributeWithNoExpression = false;
@@ -951,15 +968,15 @@ sap.ui.define([
951
968
  }
952
969
  }
953
970
  if (hiddenAttributeWithNoExpression) {
954
- sap.ui.getCore().byId("ApplyBtn").setEnabled(false);
971
+ Element.getElementById("ApplyBtn").setEnabled(false);
955
972
  } else {
956
- sap.ui.getCore().byId("ApplyBtn").setEnabled(true);
973
+ Element.getElementById("ApplyBtn").setEnabled(true);
957
974
  }
958
975
  }
959
976
  };
960
977
 
961
978
  //Reads DataObjectAttributes from the model for the new result DO
962
- sap.rules.ui.TextRuleSettings.prototype._updatePredefinedTable = function (oResultData) {
979
+ oTextRuleSettings.prototype._updatePredefinedTable = function (oResultData) {
963
980
  if (this._internalModel.getProperty("/resultDataObjectChanged")) {
964
981
  this._internalModel.setProperty("/predefinedResults", []);
965
982
  }
@@ -973,7 +990,7 @@ sap.ui.define([
973
990
  return this.oPredefinedTable;
974
991
  };
975
992
 
976
- sap.rules.ui.TextRuleSettings.prototype._updateRefreshFlags = function (needRefresh, isEnabled, bButtonClicked) {
993
+ oTextRuleSettings.prototype._updateRefreshFlags = function (needRefresh, isEnabled, bButtonClicked) {
977
994
  this._internalModel.setProperty("/needToRefresh", needRefresh);
978
995
  this._internalModel.setProperty("/refreshButtonEnabled", isEnabled, null, true);
979
996
  /////////////////// Non ABAP Requires Predefined results table. Hence, calling function import before Apply/////////
@@ -983,7 +1000,7 @@ sap.ui.define([
983
1000
  };
984
1001
 
985
1002
  //Updates the array of DataObjectAttributes with properties when result/AccessMode/Expression is changed
986
- sap.rules.ui.TextRuleSettings.prototype._updateResultAttributeJSON = function (oContext, sAccessMode, sExpression, sAst, astNodes,
1003
+ oTextRuleSettings.prototype._updateResultAttributeJSON = function (oContext, sAccessMode, sExpression, sAst, astNodes,
987
1004
  bResultChanged, isRefreshed) {
988
1005
  var sAttributeId = oContext.getProperty("DataObjectAttributeId") ? oContext.getProperty("DataObjectAttributeId") : oContext.getProperty(
989
1006
  "Id");
@@ -1084,7 +1101,7 @@ sap.ui.define([
1084
1101
  };
1085
1102
 
1086
1103
  //Returns the Buttons for the Settings Dialog
1087
- sap.rules.ui.TextRuleSettings.prototype.getButtons = function (oDialog) {
1104
+ oTextRuleSettings.prototype.getButtons = function (oDialog) {
1088
1105
  var aButtons = [];
1089
1106
 
1090
1107
  //Create cancel button
@@ -1097,7 +1114,7 @@ sap.ui.define([
1097
1114
  }, this);
1098
1115
 
1099
1116
  //Create apply button
1100
- var oApplyBtn = sap.ui.getCore().byId("ApplyBtn");
1117
+ var oApplyBtn = Element.getElementById("ApplyBtn");
1101
1118
  if (!oApplyBtn) {
1102
1119
  oApplyBtn = new Button({
1103
1120
  text: this.oBundle.getText("applyChangesBtn"),
@@ -1119,8 +1136,8 @@ sap.ui.define([
1119
1136
  return aButtons;
1120
1137
  };
1121
1138
 
1122
- sap.rules.ui.TextRuleSettings.prototype.init = function () {
1123
- this.oBundle = sap.ui.getCore().getLibraryResourceBundle("sap.rules.ui.i18n");
1139
+ oTextRuleSettings.prototype.init = function () {
1140
+ this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
1124
1141
  this.needCreateLayout = true; //Checks if layout already exists
1125
1142
  this.firstLoad = true; //Checks if dialog has been opened before for the rule
1126
1143
  this.setBusyIndicatorDelay(0);
@@ -1129,7 +1146,7 @@ sap.ui.define([
1129
1146
  };
1130
1147
 
1131
1148
  //Execution starts here (after init method)
1132
- sap.rules.ui.TextRuleSettings.prototype.onBeforeRendering = function () {
1149
+ oTextRuleSettings.prototype.onBeforeRendering = function () {
1133
1150
  if (this.firstLoad) {
1134
1151
  var bnewRule = this.getProperty("newTextRule");
1135
1152
  this._getResultsData(bnewRule);
@@ -1138,7 +1155,7 @@ sap.ui.define([
1138
1155
  };
1139
1156
 
1140
1157
  //In case of reference object we will have attribues with ":" which should be replace by /
1141
- sap.rules.ui.TextRuleSettings.prototype._formatAttributeId = function (attributeId) {
1158
+ oTextRuleSettings.prototype._formatAttributeId = function (attributeId) {
1142
1159
  var formattedAttributeId = attributeId;
1143
1160
  if(formattedAttributeId && formattedAttributeId.indexOf(":") > -1) {
1144
1161
  formattedAttributeId = formattedAttributeId.replace(/:/g, "/");
@@ -1149,7 +1166,7 @@ sap.ui.define([
1149
1166
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1150
1167
  ////////////// Closure - this code is relevant only when pressing "apply" ////////////////////
1151
1168
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
1152
- sap.rules.ui.TextRuleSettings.prototype._applySettingsModelChangesToOData = function (oDialog) {
1169
+ oTextRuleSettings.prototype._applySettingsModelChangesToOData = function (oDialog) {
1153
1170
  var that = this;
1154
1171
  var _displayModel = this.getModel();
1155
1172
  var oDataModel = this.getModel("oDataModel");
@@ -1181,7 +1198,7 @@ sap.ui.define([
1181
1198
  success: function () {
1182
1199
  oDialog.setBusy(false);
1183
1200
  oTextRuleModel.setProperty("/resultChanged", bResultChanged);
1184
- oDialog.setState(sap.ui.core.ValueState.Success);
1201
+ oDialog.setState(coreLibrary.ValueState.Success);
1185
1202
  oDialog.close();
1186
1203
  return;
1187
1204
  }
@@ -1189,7 +1206,7 @@ sap.ui.define([
1189
1206
  } else {
1190
1207
  oDialog.setBusy(false);
1191
1208
  oTextRuleModel.setProperty("/resultChanged", bResultChanged);
1192
- oDialog.setState(sap.ui.core.ValueState.Success);
1209
+ oDialog.setState(coreLibrary.ValueState.Success);
1193
1210
  oDialog.close();
1194
1211
  }
1195
1212
  }
@@ -1210,9 +1227,9 @@ sap.ui.define([
1210
1227
  } else {
1211
1228
  oDialog.setBusy(false);
1212
1229
  oTextRuleModel.setProperty("/resultChanged", bResultChanged);
1213
- oDialog.setState(sap.ui.core.ValueState.Success);
1230
+ oDialog.setState(coreLibrary.ValueState.Success);
1214
1231
  oDialog.close();
1215
- sap.m.MessageToast.show(that.oBundle.getText("settingsApplySuccess"));
1232
+ MessageToast.show(that.oBundle.getText("settingsApplySuccess"));
1216
1233
  }
1217
1234
 
1218
1235
  };
@@ -1284,7 +1301,7 @@ sap.ui.define([
1284
1301
  };
1285
1302
 
1286
1303
  var sPath = oDataModel.createKey("/TextRuleResults", oTextRuleResultData);
1287
- var oContext = new sap.ui.model.Context(oDataModel, sPath);
1304
+ var oContext = new Context(oDataModel, sPath);
1288
1305
  oDataModel.deleteCreatedEntry(oContext);
1289
1306
 
1290
1307
  var aResultExpressions = oTextRuleModel.getProperty("/textRuleResultExpressions");
@@ -1297,7 +1314,7 @@ sap.ui.define([
1297
1314
  ConditionId: aResultExpressions[i].ConditionId
1298
1315
  };
1299
1316
  sPath = oDataModel.createKey("/TextRuleResultExpressions", oTextRuleResultExpression);
1300
- oContext = new sap.ui.model.Context(oDataModel, sPath);
1317
+ oContext = new Context(oDataModel, sPath);
1301
1318
  oDataModel.deleteCreatedEntry(oContext);
1302
1319
  }
1303
1320
  }
@@ -1314,7 +1331,7 @@ sap.ui.define([
1314
1331
  };
1315
1332
  var sTextRulePath = oDataModel.createKey("/TextRules", oTextRule);
1316
1333
 
1317
- if (!oDataModel.getData(sTextRulePath)) {
1334
+ if (!oDataModel.getProperty(sTextRulePath)) {
1318
1335
  //CreateEntry TextRule
1319
1336
  mParameters.properties = oTextRule;
1320
1337
  oDataModel.createEntry("/TextRules", mParameters);
@@ -1452,10 +1469,10 @@ sap.ui.define([
1452
1469
  return;
1453
1470
  }
1454
1471
  } else if (!bRefreshed && !bResultChanged && !bAttributeChanged) {
1455
- oDialog.setState(sap.ui.core.ValueState.Success);
1472
+ oDialog.setState(coreLibrary.ValueState.Success);
1456
1473
  oDialog.setBusy(false);
1457
1474
  oDialog.close();
1458
- sap.m.MessageToast.show(this.oBundle.getText("settingsApplySuccess"));
1475
+ MessageToast.show(this.oBundle.getText("settingsApplySuccess"));
1459
1476
  }
1460
1477
  };
1461
1478