@sapui5/sap.rules.ui 1.120.1 → 1.122.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/sap/rules/ui/.library +1 -1
- package/src/sap/rules/ui/AstExpressionBasic.js +25 -18
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +36 -34
- package/src/sap/rules/ui/BindingSpy.js +3 -4
- package/src/sap/rules/ui/DecisionTable.js +101 -74
- package/src/sap/rules/ui/DecisionTableCell.js +63 -33
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +17 -13
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +40 -32
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +21 -19
- package/src/sap/rules/ui/DecisionTableConfiguration.js +5 -6
- package/src/sap/rules/ui/DecisionTableRenderer.js +6 -5
- package/src/sap/rules/ui/DecisionTableSettings.js +254 -225
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +59 -59
- package/src/sap/rules/ui/ExpressionAdvanced.js +135 -111
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +17 -12
- package/src/sap/rules/ui/InstructionRenderer.js +1 -2
- package/src/sap/rules/ui/RuleBase.js +2 -3
- package/src/sap/rules/ui/RuleBuilder.js +23 -23
- package/src/sap/rules/ui/TextRule.js +70 -54
- package/src/sap/rules/ui/TextRuleConfiguration.js +2 -3
- package/src/sap/rules/ui/TextRuleSettings.js +133 -116
- package/src/sap/rules/ui/ast/autoComplete/AutoComplete.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +15 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +15 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +26 -17
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +75 -53
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +14 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +14 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +35 -23
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +93 -73
- package/src/sap/rules/ui/ast/util/AggregateFunctionDialog.js +172 -157
- package/src/sap/rules/ui/ast/util/LoopFunctionDialog.js +186 -163
- package/src/sap/rules/ui/ast/util/SelectFunctionDialog.js +205 -182
- package/src/sap/rules/ui/ast/util/utilsBase.js +85 -0
- package/src/sap/rules/ui/codemirror/addon/hint/show-hint.js +8 -4
- package/src/sap/rules/ui/i18n/messagebundle_ar.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_cnr.properties +301 -0
- package/src/sap/rules/ui/i18n/messagebundle_en_US_saprigi.properties +285 -285
- package/src/sap/rules/ui/i18n/messagebundle_hu.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_mk.properties +252 -252
- package/src/sap/rules/ui/i18n/messagebundle_sh.properties +108 -108
- package/src/sap/rules/ui/i18n/messagebundle_sr.properties +301 -0
- package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -5
- package/src/sap/rules/ui/library.js +6 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/IDPParser.js +115 -114
- package/src/sap/rules/ui/parser/businessLanguage/lib/antlr3_all_min.js +4 -4
- package/src/sap/rules/ui/parser/businessLanguage/lib/autoCompleteUtils.js +4 -3
- package/src/sap/rules/ui/parser/businessLanguage/lib/conversionUtils.js +10 -6
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModel.js +8 -7
- package/src/sap/rules/ui/parser/businessLanguage/lib/entityModelConstractor.js +17 -16
- package/src/sap/rules/ui/parser/businessLanguage/lib/parsingBackendMediator.js +10 -9
- package/src/sap/rules/ui/parser/businessLanguage/lib/termsUtils.js +4 -3
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_cnr.properties +213 -0
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_en_US_saprigi.properties +210 -210
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_mk.properties +210 -210
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sh.properties +123 -123
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sr.properties +213 -0
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_uk.properties +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_cnr.properties +50 -0
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_en_US_saprigi.properties +26 -26
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_mk.properties +26 -26
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sh.properties +26 -26
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sr.properties +50 -0
- package/src/sap/rules/ui/parser/infrastructure/errorHandling/hrfException.js +3 -3
- package/src/sap/rules/ui/parser/infrastructure/locale/lib/resourceBundleContext.js +4 -3
- package/src/sap/rules/ui/parser/infrastructure/messageHandling/lib/responseCollector.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBody.js +8 -7
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyConvertor.js +4 -3
- package/src/sap/rules/ui/parser/ruleBody/lib/ruleBodyValidator.js +9 -8
- package/src/sap/rules/ui/providers/ValueHelpDialogProvider.js +63 -46
- package/src/sap/rules/ui/providers/ValueHelpProvider.js +8 -7
- package/src/sap/rules/ui/services/AstExpressionLanguage.js +12 -10
- package/src/sap/rules/ui/services/ExpressionLanguage.js +89 -83
- package/src/sap/rules/ui/type/DecisionTableCell.js +2 -2
- package/src/sap/rules/ui/type/DecisionTableHeader.js +3 -3
- package/src/sap/rules/ui/type/Expression.js +3 -3
- package/src/sap/rules/ui/type/ExpressionAbs.js +5 -5
|
@@ -6,13 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
sap.ui.define([
|
|
9
|
-
"jquery
|
|
9
|
+
"sap/ui/thirdparty/jquery",
|
|
10
10
|
"./library",
|
|
11
11
|
"sap/ui/core/Control",
|
|
12
12
|
"sap/rules/ui/InstructionRenderer",
|
|
13
13
|
"sap/rules/ui/ExpressionBase",
|
|
14
|
+
"sap/base/i18n/Formatting",
|
|
15
|
+
"sap/ui/core/format/DateFormat",
|
|
16
|
+
"sap/ui/core/format/NumberFormat",
|
|
17
|
+
"sap/ui/comp/odata/MetadataAnalyser",
|
|
18
|
+
"sap/ui/core/Element",
|
|
14
19
|
"./ExpressionBasicRenderer"
|
|
15
|
-
], function(jQuery, library, Control, InstructionRenderer, ExpressionBase, ExpressionBasicRenderer) {
|
|
20
|
+
], function(jQuery, library, Control, InstructionRenderer, ExpressionBase, Formatting, DateFormat, NumberFormat, MetadataAnalyser, Element, ExpressionBasicRenderer) {
|
|
16
21
|
"use strict";
|
|
17
22
|
|
|
18
23
|
/**
|
|
@@ -26,7 +31,7 @@ sap.ui.define([
|
|
|
26
31
|
* @extends Control
|
|
27
32
|
*
|
|
28
33
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
34
|
+
* @version 1.122.0
|
|
30
35
|
*
|
|
31
36
|
* @constructor
|
|
32
37
|
* @private
|
|
@@ -76,8 +81,8 @@ sap.ui.define([
|
|
|
76
81
|
}
|
|
77
82
|
this._removeFurtherInstructions(iOriginalIndex);
|
|
78
83
|
updatedExpression = oInstructionsRenderer.getExpression();
|
|
79
|
-
var expressionLanguage =
|
|
80
|
-
var suggestionsPart =
|
|
84
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
85
|
+
var suggestionsPart = library.SuggestionsPart;
|
|
81
86
|
var suggestions;
|
|
82
87
|
var updatedInstruction;
|
|
83
88
|
|
|
@@ -177,9 +182,9 @@ sap.ui.define([
|
|
|
177
182
|
}
|
|
178
183
|
|
|
179
184
|
//bug 5339 - remove separators from number
|
|
180
|
-
if (suggestion.BDT ===
|
|
181
|
-
var oLocale =
|
|
182
|
-
var oFloatFormat =
|
|
185
|
+
if (suggestion.BDT === library.ExpressionType.Number) {
|
|
186
|
+
var oLocale = Formatting.getLanguageTag();
|
|
187
|
+
var oFloatFormat = NumberFormat.getFloatInstance(oLocale);
|
|
183
188
|
var fnFormatFloat = function (number) {
|
|
184
189
|
number = oFloatFormat.parse(number);
|
|
185
190
|
if (isNaN(number)) {
|
|
@@ -209,7 +214,7 @@ sap.ui.define([
|
|
|
209
214
|
if (suggestion.valueListObject) {
|
|
210
215
|
var model = [suggestion.valueListObject];
|
|
211
216
|
instruction.valueListObject = suggestion.valueListObject;
|
|
212
|
-
var expressionLanguage =
|
|
217
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
213
218
|
instruction.expressionLanguage = expressionLanguage;
|
|
214
219
|
if (model && model instanceof Array && !model[0].metadata.HasValueSource) {
|
|
215
220
|
instruction.valueListObject = model[0];
|
|
@@ -219,7 +224,7 @@ sap.ui.define([
|
|
|
219
224
|
var callback = expressionLanguage.getValueHelpCallback();
|
|
220
225
|
callback.call(this, model);
|
|
221
226
|
var tempModel = instruction.valueListObject.model;
|
|
222
|
-
var oMetadataAnalyzer = new
|
|
227
|
+
var oMetadataAnalyzer = new MetadataAnalyser(tempModel);
|
|
223
228
|
var sAnnotationPath = instruction.valueListObject.metadata.propertyPath;
|
|
224
229
|
var oValueListAnnotation = oMetadataAnalyzer.getValueListAnnotation(sAnnotationPath);
|
|
225
230
|
instructions.forEach(function(instruction) {
|
|
@@ -249,7 +254,7 @@ sap.ui.define([
|
|
|
249
254
|
},
|
|
250
255
|
_reload: function() {
|
|
251
256
|
this.shouldReload = false;
|
|
252
|
-
var suggestions =
|
|
257
|
+
var suggestions = Element.getElementById(this.getExpressionLanguage())._getBasicSuggestions(this.getValue());
|
|
253
258
|
if (this._checkForValueHelpSuggestions(suggestions)) {
|
|
254
259
|
return;
|
|
255
260
|
}
|
|
@@ -298,7 +303,7 @@ sap.ui.define([
|
|
|
298
303
|
|
|
299
304
|
|
|
300
305
|
|
|
301
|
-
|
|
306
|
+
this.$().on("change", null, function(event) {
|
|
302
307
|
|
|
303
308
|
this.focus();
|
|
304
309
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
sap.ui.define([
|
|
2
2
|
"sap/ui/core/Control",
|
|
3
3
|
"sap/ui/core/Item",
|
|
4
|
-
"sap/ui/core/ValueState",
|
|
5
4
|
"sap/m/Select",
|
|
6
5
|
"sap/m/Input",
|
|
7
6
|
"sap/m/Button",
|
|
@@ -24,7 +23,7 @@ sap.ui.define([
|
|
|
24
23
|
"sap/rules/ui/providers/ValueHelpDialogProvider",
|
|
25
24
|
"sap/ui/core/LocaleData",
|
|
26
25
|
"sap/rules/ui/Constants"
|
|
27
|
-
], function(Control, CoreItem,
|
|
26
|
+
], function(Control, CoreItem, Select, Input, Button, SelectDialog, StandardListItem, Text, DatePicker,
|
|
28
27
|
TypeFloat, TypeDate, TypeTime, TypeDateTime, HTML, JSONModel, Filter, FilterOperator, Utils, DateTimePicker,
|
|
29
28
|
TimePicker, ValueHelpProvider, ValueHelpDialogProvider, LocaleData, Constants) {
|
|
30
29
|
"use strict";
|
|
@@ -7,10 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery.sap.global",
|
|
11
10
|
"./library",
|
|
12
11
|
"sap/ui/core/Control"
|
|
13
|
-
], function(
|
|
12
|
+
], function(library, Control) {
|
|
14
13
|
"use strict";
|
|
15
14
|
|
|
16
15
|
/**
|
|
@@ -24,7 +23,7 @@ sap.ui.define([
|
|
|
24
23
|
* @extends Control
|
|
25
24
|
*
|
|
26
25
|
* @author SAP SE
|
|
27
|
-
* @version 1.
|
|
26
|
+
* @version 1.122.0
|
|
28
27
|
*
|
|
29
28
|
* @constructor
|
|
30
29
|
* @private
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery.sap.global",
|
|
11
10
|
"./library",
|
|
12
11
|
"sap/ui/core/Control",
|
|
13
12
|
"sap/m/Select",
|
|
@@ -15,12 +14,13 @@ sap.ui.define([
|
|
|
15
14
|
"sap/rules/ui/DecisionTable",
|
|
16
15
|
"sap/rules/ui/DecisionTableConfiguration",
|
|
17
16
|
"sap/rules/ui/TextRuleConfiguration",
|
|
18
|
-
"sap/rules/ui/RuleType",
|
|
19
|
-
"sap/rules/ui/RuleFormat",
|
|
20
17
|
"sap/rules/ui/TextRule",
|
|
18
|
+
"sap/ui/core/Lib",
|
|
19
|
+
"sap/ui/model/json/JSONModel",
|
|
20
|
+
"sap/m/ComboBox",
|
|
21
|
+
"sap/ui/model/Context",
|
|
21
22
|
"./RuleBuilderRenderer"
|
|
22
|
-
], function(
|
|
23
|
-
RuleFormat, TextRule, RuleBuilderRenderer) {
|
|
23
|
+
], function(library, Control, Select, Item, DecisionTable, DecisionTableConfiguration, TextRuleConfiguration, TextRule, coreLib, JSONModel, ComboBox, Context, RuleBuilderRenderer) {
|
|
24
24
|
"use strict";
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -34,7 +34,7 @@ sap.ui.define([
|
|
|
34
34
|
* @extends sap.ui.core.Control
|
|
35
35
|
*
|
|
36
36
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
37
|
+
* @version 1.122.0
|
|
38
38
|
*
|
|
39
39
|
* @constructor
|
|
40
40
|
* @public
|
|
@@ -53,7 +53,7 @@ sap.ui.define([
|
|
|
53
53
|
*/
|
|
54
54
|
types: {
|
|
55
55
|
type: "sap.rules.ui.RuleType[]",
|
|
56
|
-
defaultValue: [
|
|
56
|
+
defaultValue: [library.RuleType.DecisionTable, library.RuleType.TextRule]
|
|
57
57
|
},
|
|
58
58
|
/**
|
|
59
59
|
* Name of the rule's ODataModel (optional).
|
|
@@ -158,7 +158,7 @@ sap.ui.define([
|
|
|
158
158
|
},
|
|
159
159
|
|
|
160
160
|
init: function() {
|
|
161
|
-
this.oBundle =
|
|
161
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
162
162
|
this.needCreateDisplayedControl = true;
|
|
163
163
|
|
|
164
164
|
this.needRebind = true;
|
|
@@ -183,7 +183,7 @@ sap.ui.define([
|
|
|
183
183
|
decisionTableConfiguration: {},
|
|
184
184
|
textRuleConfiguration: {}
|
|
185
185
|
};
|
|
186
|
-
var oModel = new
|
|
186
|
+
var oModel = new JSONModel();
|
|
187
187
|
oModel.setData(data);
|
|
188
188
|
return oModel;
|
|
189
189
|
},
|
|
@@ -200,7 +200,7 @@ sap.ui.define([
|
|
|
200
200
|
var bindingContextPath = this.getBindingContextPath();
|
|
201
201
|
var model = this._getModel();
|
|
202
202
|
|
|
203
|
-
var oContext = new
|
|
203
|
+
var oContext = new Context(model, bindingContextPath);
|
|
204
204
|
this.setBindingContext(oContext);
|
|
205
205
|
},
|
|
206
206
|
|
|
@@ -212,11 +212,11 @@ sap.ui.define([
|
|
|
212
212
|
// get DT configuration object, or create it if it doesn't exists
|
|
213
213
|
var oTextRuleConfiguration = this.getTextRuleConfiguration();
|
|
214
214
|
if (!oTextRuleConfiguration) {
|
|
215
|
-
oTextRuleConfiguration = new
|
|
215
|
+
oTextRuleConfiguration = new TextRuleConfiguration();
|
|
216
216
|
this.setTextRuleConfiguration(oTextRuleConfiguration);
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
var oTextRule = new
|
|
219
|
+
var oTextRule = new TextRule({
|
|
220
220
|
bindingContextPath: {
|
|
221
221
|
path: "ruleBuilderInternalModel>/bindingContextPath"
|
|
222
222
|
},
|
|
@@ -248,14 +248,14 @@ sap.ui.define([
|
|
|
248
248
|
// get DT configuration object, or create it if it doesn't exists
|
|
249
249
|
var oDecisionTableConfiguration = this.getDecisionTableConfiguration();
|
|
250
250
|
if (!oDecisionTableConfiguration) {
|
|
251
|
-
oDecisionTableConfiguration = new
|
|
251
|
+
oDecisionTableConfiguration = new DecisionTableConfiguration();
|
|
252
252
|
this.setDecisionTableConfiguration(oDecisionTableConfiguration);
|
|
253
253
|
};
|
|
254
254
|
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
DecisionTable.prototype.VISIBLEROWCOUNT = this.getDecisionTableConfiguration().getVisibleRowCount();
|
|
256
|
+
DecisionTable.prototype.THRESHOLD = this.getDecisionTableConfiguration().getThreshold();
|
|
257
257
|
// create DT
|
|
258
|
-
var oDT = new
|
|
258
|
+
var oDT = new DecisionTable({
|
|
259
259
|
bindingContextPath: {
|
|
260
260
|
path: "ruleBuilderInternalModel>/bindingContextPath"
|
|
261
261
|
},
|
|
@@ -290,13 +290,13 @@ sap.ui.define([
|
|
|
290
290
|
_createDisplayedControl: function(sDisplayedControlType) {
|
|
291
291
|
var oDisplayedControl;
|
|
292
292
|
switch (sDisplayedControlType) {
|
|
293
|
-
case
|
|
293
|
+
case library.RuleType.DecisionTable:
|
|
294
294
|
oDisplayedControl = this._createDecisionTable();
|
|
295
295
|
break;
|
|
296
|
-
case "
|
|
296
|
+
case "library.RuleType.Ruleset":
|
|
297
297
|
oDisplayedControl = this._createRuleset();
|
|
298
298
|
break;
|
|
299
|
-
case
|
|
299
|
+
case library.RuleType.TextRule:
|
|
300
300
|
oDisplayedControl = this._createTextRule();
|
|
301
301
|
break;
|
|
302
302
|
default:
|
|
@@ -311,18 +311,18 @@ sap.ui.define([
|
|
|
311
311
|
|
|
312
312
|
this.oBundle.getText('decisionTable');
|
|
313
313
|
|
|
314
|
-
var oRuleTypesModel = new
|
|
314
|
+
var oRuleTypesModel = new JSONModel({
|
|
315
315
|
items: [{
|
|
316
|
-
key:
|
|
316
|
+
key: library.RuleType.DecisionTable,
|
|
317
317
|
text: this.oBundle.getText('decisionTable')
|
|
318
318
|
}]
|
|
319
319
|
});
|
|
320
320
|
|
|
321
|
-
var oRuleTypeSelector = new
|
|
321
|
+
var oRuleTypeSelector = new ComboBox({
|
|
322
322
|
width: "25%",
|
|
323
323
|
items: {
|
|
324
324
|
path: 'ruleTypes>/items',
|
|
325
|
-
template: new
|
|
325
|
+
template: new Item({
|
|
326
326
|
text: "{ruleTypes>text}",
|
|
327
327
|
key: "{ruleTypes>key}"
|
|
328
328
|
})
|