@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
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.DecisionTableCell.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery
|
|
10
|
+
"sap/ui/thirdparty/jquery",
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/DecisionTableCellExpressionAdvanced",
|
|
13
13
|
"sap/rules/ui/type/DecisionTableCell",
|
|
@@ -18,10 +18,25 @@ sap.ui.define([
|
|
|
18
18
|
"sap/rules/ui/services/AstExpressionLanguage",
|
|
19
19
|
"sap/rules/ui/ast/util/AstUtil",
|
|
20
20
|
"sap/ui/core/LocaleData",
|
|
21
|
+
"sap/rules/ui/ExpressionAdvanced",
|
|
22
|
+
"sap/rules/ui/AstExpressionBasic",
|
|
23
|
+
"sap/ui/core/Control",
|
|
24
|
+
"sap/m/Input",
|
|
25
|
+
"sap/ui/model/Context",
|
|
26
|
+
"sap/ui/core/library",
|
|
27
|
+
"sap/base/i18n/Formatting",
|
|
28
|
+
"sap/ui/core/format/DateFormat",
|
|
29
|
+
"sap/ui/core/EventBus",
|
|
30
|
+
"sap/ui/core/Lib",
|
|
31
|
+
"sap/ui/core/Element",
|
|
32
|
+
"sap/ui/core/Fragment",
|
|
33
|
+
"sap/rules/ui/DecisionTableCellAstExpressionBasic",
|
|
21
34
|
"./DecisionTableCellRenderer"
|
|
22
35
|
],
|
|
23
36
|
function (jQuery, library, DecisionTableCellExpressionAdvanced, DecisionTableCellFormatter, DecisionTableCellExpressionBasic, Popover,
|
|
24
|
-
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData,
|
|
37
|
+
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData, ExpressionAdvanced,
|
|
38
|
+
AstExpressionBasic, Control, Input, Context, coreLibrary, Formatting,
|
|
39
|
+
DateFormat, EventBus, coreLib, Element, Fragment, DecisionTableCellAstExpressionBasic, DecisionTableCellRenderer) {
|
|
25
40
|
"use strict";
|
|
26
41
|
|
|
27
42
|
/**
|
|
@@ -35,14 +50,14 @@ sap.ui.define([
|
|
|
35
50
|
* @extends sap.ui.core.Control
|
|
36
51
|
*
|
|
37
52
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
53
|
+
* @version 1.122.0
|
|
39
54
|
*
|
|
40
55
|
* @constructor
|
|
41
56
|
* @public
|
|
42
57
|
* @alias sap.rules.ui.DecisionTableCellExpressionAdvanced
|
|
43
58
|
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
44
59
|
*/
|
|
45
|
-
var DecisionTableCell =
|
|
60
|
+
var DecisionTableCell = Control.extend("sap.rules.ui.DecisionTableCell", {
|
|
46
61
|
metadata: {
|
|
47
62
|
library: "sap.rules.ui",
|
|
48
63
|
properties: {
|
|
@@ -151,7 +166,7 @@ sap.ui.define([
|
|
|
151
166
|
*/
|
|
152
167
|
decisionTableFormat: {
|
|
153
168
|
type: "sap.rules.ui.DecisionTableFormat",
|
|
154
|
-
defaultValue:
|
|
169
|
+
defaultValue: library.DecisionTableFormat.CellFormat
|
|
155
170
|
},
|
|
156
171
|
/**
|
|
157
172
|
* Contains the key properties of cell : RowId,ColId,RuleId, Version needed for binding context
|
|
@@ -222,7 +237,7 @@ sap.ui.define([
|
|
|
222
237
|
|
|
223
238
|
DecisionTableCell.prototype._addNodeObject = function (astNode) {
|
|
224
239
|
var oNodeArray = [];
|
|
225
|
-
var oAstExpressionLanguage =
|
|
240
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
226
241
|
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
227
242
|
|
|
228
243
|
var updatedAstNode = [];
|
|
@@ -346,7 +361,7 @@ sap.ui.define([
|
|
|
346
361
|
if (oDisplayedControl) {
|
|
347
362
|
oDisplayedControl.destroy();
|
|
348
363
|
}
|
|
349
|
-
oDisplayedControl = new
|
|
364
|
+
oDisplayedControl = new Input({
|
|
350
365
|
ariaLabelledBy:this.getAriaLabelledBy(),
|
|
351
366
|
editable: false,
|
|
352
367
|
|
|
@@ -375,7 +390,7 @@ sap.ui.define([
|
|
|
375
390
|
var valuePath = this.getValuePath();
|
|
376
391
|
var expression;
|
|
377
392
|
var sPath = "/" + valuePath.split("/")[1];
|
|
378
|
-
var oCellContext = new
|
|
393
|
+
var oCellContext = new Context(this.getModel(), sPath);
|
|
379
394
|
if (this.getExpressionLanguage()) {
|
|
380
395
|
valuePath = this.getDisplayModelName() + ">" + valuePath;
|
|
381
396
|
}
|
|
@@ -434,9 +449,9 @@ sap.ui.define([
|
|
|
434
449
|
oDisplayedControl.bindProperty("valueState", {
|
|
435
450
|
path: valueStatePath,
|
|
436
451
|
formatter: function (sValue) {
|
|
437
|
-
var valueState =
|
|
438
|
-
if (sValue ===
|
|
439
|
-
valueState =
|
|
452
|
+
var valueState = coreLibrary.ValueState.None;
|
|
453
|
+
if (sValue === coreLibrary.ValueState.Error) {
|
|
454
|
+
valueState = coreLibrary.ValueState.Error;
|
|
440
455
|
}
|
|
441
456
|
return valueState;
|
|
442
457
|
}.bind(this)
|
|
@@ -447,14 +462,14 @@ sap.ui.define([
|
|
|
447
462
|
};
|
|
448
463
|
|
|
449
464
|
DecisionTableCell.prototype._getLocaleData = function () {
|
|
450
|
-
var oLocale =
|
|
465
|
+
var oLocale = Formatting.getLanguageTag();
|
|
451
466
|
return LocaleData.getInstance(oLocale);
|
|
452
467
|
};
|
|
453
468
|
|
|
454
469
|
DecisionTableCell.prototype._getDateFormatter = function () {
|
|
455
470
|
var oLocaleData = this._getLocaleData();
|
|
456
471
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
457
|
-
var dateFormatter =
|
|
472
|
+
var dateFormatter = DateFormat.getDateInstance({
|
|
458
473
|
pattern: datePattern
|
|
459
474
|
});
|
|
460
475
|
return dateFormatter;
|
|
@@ -464,7 +479,7 @@ sap.ui.define([
|
|
|
464
479
|
var oLocaleData = this._getLocaleData();
|
|
465
480
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
466
481
|
var timePattern = oLocaleData.getTimePattern('medium');
|
|
467
|
-
var dateTimeFormatter =
|
|
482
|
+
var dateTimeFormatter = DateFormat.getDateTimeInstance({
|
|
468
483
|
pattern: datePattern + " " + timePattern
|
|
469
484
|
});
|
|
470
485
|
return dateTimeFormatter;
|
|
@@ -472,7 +487,7 @@ sap.ui.define([
|
|
|
472
487
|
|
|
473
488
|
DecisionTableCell.prototype._getExpressionFromAstNodes = function (oContext, bInputField) {
|
|
474
489
|
var that = this;
|
|
475
|
-
var oAstExpressionLanguage =
|
|
490
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
476
491
|
var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
477
492
|
var displayExpression = "";
|
|
478
493
|
var displayTermExpression = "";
|
|
@@ -582,17 +597,17 @@ sap.ui.define([
|
|
|
582
597
|
|
|
583
598
|
DecisionTableCell.prototype.init = function () {
|
|
584
599
|
this.astUtil = new AstUtil();
|
|
585
|
-
this.oBundle =
|
|
600
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
586
601
|
};
|
|
587
602
|
|
|
588
603
|
DecisionTableCell.prototype.onAfterRendering = function () {
|
|
589
604
|
this.bColumnResized = false;
|
|
590
|
-
var oEventBus =
|
|
605
|
+
var oEventBus = EventBus.getInstance();
|
|
591
606
|
oEventBus.unsubscribe("sap.ui.rules","_onColumnResized",this._setColumnResized,this);
|
|
592
607
|
};
|
|
593
608
|
|
|
594
609
|
DecisionTableCell.prototype.onBeforeRendering = function () {
|
|
595
|
-
var oEventBus =
|
|
610
|
+
var oEventBus = EventBus.getInstance();
|
|
596
611
|
oEventBus.subscribeOnce("sap.ui.rules","_onColumnResized",this._setColumnResized,this);
|
|
597
612
|
if (!this.bColumnResized) {
|
|
598
613
|
this._setDisplayedControl();
|
|
@@ -603,7 +618,7 @@ sap.ui.define([
|
|
|
603
618
|
this.bColumnResized = true;
|
|
604
619
|
};
|
|
605
620
|
|
|
606
|
-
DecisionTableCell.prototype.onFocusIn = function () {
|
|
621
|
+
DecisionTableCell.prototype.onFocusIn = async function () {
|
|
607
622
|
var fnAfterPopOverOpen = function (oEvent) {
|
|
608
623
|
var oDecisionTableCellExpression = oEvent.getSource().getAggregation('content')[1];
|
|
609
624
|
oDecisionTableCellExpression.setVisible(true);
|
|
@@ -619,12 +634,12 @@ sap.ui.define([
|
|
|
619
634
|
var fnAfterPopOverClose = function (oEvent) {
|
|
620
635
|
if (this._oPopover) {
|
|
621
636
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
622
|
-
if (oDecisionTableCellExpression instanceof
|
|
637
|
+
if (oDecisionTableCellExpression instanceof ExpressionAdvanced) { //after choose hint popover close, we fix it with focus in DecisionTableCellExpressionAdvanced so we need to copy the value from the code mirror to the expression advanced value
|
|
623
638
|
if (oDecisionTableCellExpression.codeMirror) {
|
|
624
639
|
var sExpression = oDecisionTableCellExpression.codeMirror.getValue();
|
|
625
640
|
oDecisionTableCellExpression.setValue(sExpression);
|
|
626
641
|
}
|
|
627
|
-
} else if (oDecisionTableCellExpression instanceof
|
|
642
|
+
} else if (oDecisionTableCellExpression instanceof AstExpressionBasic) {
|
|
628
643
|
//While making changes in one cell and focusing into another cell, _fireChange is not called from
|
|
629
644
|
//AstExpressionBasic._handlePopupFocusOut
|
|
630
645
|
oDecisionTableCellExpression._fireChange(oDecisionTableCellExpression._input.text())
|
|
@@ -643,29 +658,44 @@ sap.ui.define([
|
|
|
643
658
|
var sValueRuleFormat = this.getModel().getProperty(this.getRuleFormatPath());
|
|
644
659
|
var sdecisionTableFormat = this.getDecisionTableFormat();
|
|
645
660
|
//destroy if the popover is not destroyed during close of popover.
|
|
646
|
-
if (
|
|
647
|
-
|
|
661
|
+
if (Element.getElementById("popover")) {
|
|
662
|
+
Element.getElementById("popover").destroy();
|
|
648
663
|
}
|
|
649
664
|
// when the decisionTableFormat is set to type sap.rules.ui.DecisionTableFormat.RuleFormat then we Render the cells based on the
|
|
650
665
|
// Rule Format
|
|
651
666
|
if (this.getAstExpressionLanguage()) {
|
|
652
|
-
this._oPopover =
|
|
653
|
-
|
|
667
|
+
this._oPopover = await Fragment.load({
|
|
668
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellAstExpressionBasic',
|
|
669
|
+
controller: this
|
|
670
|
+
})
|
|
671
|
+
this._oPopover.setTooltip(this.oBundle.getText("ctrlSpaceCue"));
|
|
654
672
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
655
673
|
oDecisionTableCellExpression.setAstExpressionLanguage(this.getAstExpressionLanguage());
|
|
656
|
-
oDecisionTableCellExpression.attachChange(
|
|
674
|
+
oDecisionTableCellExpression.attachChange(DecisionTableCellAstExpressionBasic.prototype._changeValue);
|
|
657
675
|
} else {
|
|
658
|
-
if (sdecisionTableFormat ===
|
|
659
|
-
if (sValueRuleFormat.toUpperCase() ===
|
|
660
|
-
this._oPopover =
|
|
676
|
+
if (sdecisionTableFormat === library.DecisionTableFormat.RuleFormat) {
|
|
677
|
+
if (sValueRuleFormat.toUpperCase() === library.RuleFormat.Advanced) {
|
|
678
|
+
this._oPopover = await Fragment.load({
|
|
679
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionAdvanced',
|
|
680
|
+
controller: this
|
|
681
|
+
})
|
|
661
682
|
} else {
|
|
662
|
-
this._oPopover =
|
|
683
|
+
this._oPopover = await Fragment.load({
|
|
684
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionBasic',
|
|
685
|
+
controller: this
|
|
686
|
+
})
|
|
663
687
|
}
|
|
664
688
|
} else if (bValueOnly) { // When the decisionTableFormat is set to the default value or pf type
|
|
665
689
|
// sap.rules.ui.DecisionTableFormat.RuleFormat then we render the cells based on ValueOnly
|
|
666
|
-
this._oPopover =
|
|
690
|
+
this._oPopover = await Fragment.load({
|
|
691
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionBasic',
|
|
692
|
+
controller: this
|
|
693
|
+
})
|
|
667
694
|
} else {
|
|
668
|
-
this._oPopover =
|
|
695
|
+
this._oPopover = await Fragment.load({
|
|
696
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellAstExpressionBasic',
|
|
697
|
+
controller: this
|
|
698
|
+
})
|
|
669
699
|
}
|
|
670
700
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
671
701
|
oDecisionTableCellExpression.setExpressionLanguage(this.getExpressionLanguage());
|
|
@@ -676,7 +706,7 @@ sap.ui.define([
|
|
|
676
706
|
this._oPopover.attachAfterClose(fnAfterPopOverClose);
|
|
677
707
|
this.addDependent(this._oPopover);
|
|
678
708
|
|
|
679
|
-
var num = jQuery.
|
|
709
|
+
var num = jQuery(document.getElementById(this.getId())).closest('td').width() * 0.93;
|
|
680
710
|
var sWidth = num + "px";
|
|
681
711
|
var oScrollContainer = this._oPopover.getAggregation('content')[0];
|
|
682
712
|
oScrollContainer.setWidth(sWidth);
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.AstExpressionBasic.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery
|
|
10
|
+
"sap/ui/thirdparty/jquery",
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/Utils",
|
|
13
13
|
"sap/rules/ui/AstExpressionBasic",
|
|
14
14
|
"sap/rules/ui/Constants",
|
|
15
|
+
"sap/ui/core/library",
|
|
16
|
+
"sap/ui/core/EventBus",
|
|
17
|
+
"sap/ui/core/Lib",
|
|
18
|
+
"sap/ui/core/Element",
|
|
15
19
|
"./DecisionTableCellAstExpressionBasicRenderer"
|
|
16
|
-
], function (jQuery, library, Utils, AstExpressionBasic, Constants, DecisionTableCellAstExpressionBasicRenderer) {
|
|
20
|
+
], function (jQuery, library, Utils, AstExpressionBasic, Constants, coreLibrary, EventBus, coreLib, Element, DecisionTableCellAstExpressionBasicRenderer) {
|
|
17
21
|
"use strict";
|
|
18
22
|
|
|
19
23
|
/**
|
|
@@ -27,7 +31,7 @@ sap.ui.define([
|
|
|
27
31
|
* @extends sap.rules.ui.AstExpressionBasic
|
|
28
32
|
*
|
|
29
33
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
34
|
+
* @version 1.122.0
|
|
31
35
|
*
|
|
32
36
|
* @constructor
|
|
33
37
|
* @private
|
|
@@ -57,7 +61,7 @@ sap.ui.define([
|
|
|
57
61
|
},
|
|
58
62
|
type: {
|
|
59
63
|
type: "sap.rules.ui.ExpressionType",
|
|
60
|
-
defaultValue:
|
|
64
|
+
defaultValue: library.ExpressionType.BooleanEnhanced,
|
|
61
65
|
bindable: "bindable"
|
|
62
66
|
}
|
|
63
67
|
}
|
|
@@ -77,18 +81,18 @@ sap.ui.define([
|
|
|
77
81
|
};
|
|
78
82
|
|
|
79
83
|
DecisionTableCellAstExpressionBasic.prototype.init = function () {
|
|
80
|
-
|
|
84
|
+
AstExpressionBasic.prototype.init.apply(this, arguments);
|
|
81
85
|
this.bFlagForChangeBeforeBlur = false;
|
|
82
|
-
this.oBundle =
|
|
86
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
83
87
|
};
|
|
84
88
|
|
|
85
89
|
DecisionTableCellAstExpressionBasic.prototype.onAfterRendering = function () {
|
|
86
90
|
var that = this;
|
|
87
|
-
this._oAstExpressionLanguage =
|
|
88
|
-
|
|
91
|
+
this._oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
92
|
+
AstExpressionBasic.prototype.onAfterRendering.apply(this, arguments);
|
|
89
93
|
this.oDecisionTableCell = (this.getParent() && this.getParent().getParent()) ? this.getParent().getParent() : null;
|
|
90
94
|
this._handleValidation();
|
|
91
|
-
if (jQuery.
|
|
95
|
+
if (jQuery(document.getElementById(this.getId())).closest('td').next().width()) {
|
|
92
96
|
this._showPopUp();
|
|
93
97
|
}
|
|
94
98
|
if (this.oDecisionTableCell) {
|
|
@@ -97,7 +101,7 @@ sap.ui.define([
|
|
|
97
101
|
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
98
102
|
var oDisplayedControl = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
99
103
|
if (oDisplayedControl) {
|
|
100
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
104
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
101
105
|
}
|
|
102
106
|
}
|
|
103
107
|
};
|
|
@@ -224,7 +228,7 @@ sap.ui.define([
|
|
|
224
228
|
DecisionTableCellAstExpressionBasic.prototype._removeAndUpdateExisitingNodes = function (oModel, oData, sPath, astNodes,sCellContentPath) {
|
|
225
229
|
var sGroupId = oData.RowId + "," + oData.ColId;
|
|
226
230
|
oModel.setDeferredGroups([sGroupId]);
|
|
227
|
-
var oEventBus =
|
|
231
|
+
var oEventBus = EventBus.getInstance();
|
|
228
232
|
oModel.update(sPath, {
|
|
229
233
|
"Content": oModel.getProperty(sCellContentPath)
|
|
230
234
|
}, {
|
|
@@ -246,14 +250,14 @@ sap.ui.define([
|
|
|
246
250
|
var oData = {};
|
|
247
251
|
if (this.oDecisionTableCell) {
|
|
248
252
|
var oSource = oEvent.getSource();
|
|
249
|
-
var oEventBus =
|
|
253
|
+
var oEventBus = EventBus.getInstance();
|
|
250
254
|
var sValue = oEvent.getParameter("newValue");
|
|
251
255
|
oSource.setValue(sValue);
|
|
252
256
|
var dtInput = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
253
257
|
dtInput.setValue(oEvent.getParameter("displayText"));
|
|
254
258
|
dtInput.JSON = this.getJsonData();
|
|
255
259
|
dtInput.relString = this.relString;
|
|
256
|
-
var oAstExpressionLanguage =
|
|
260
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
257
261
|
var oModel = this.getBindingContext().getModel();
|
|
258
262
|
oData = this.oDecisionTableCell.getKeyProperties();
|
|
259
263
|
var astNodes = oEvent.getParameter("astNodes");
|
|
@@ -7,13 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.ExpressionAdvanced.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery
|
|
10
|
+
"sap/ui/thirdparty/jquery",
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/Utils",
|
|
13
13
|
"sap/rules/ui/ExpressionAdvanced",
|
|
14
14
|
"sap/rules/ui/Constants",
|
|
15
|
+
"sap/ui/core/library",
|
|
15
16
|
"./DecisionTableCellExpressionAdvancedRenderer"
|
|
16
|
-
], function(jQuery, library, Utils, ExpressionAdvanced, Constants, DecisionTableCellExpressionAdvancedRenderer) {
|
|
17
|
+
], function(jQuery, library, Utils, ExpressionAdvanced, Constants, coreLibrary, DecisionTableCellExpressionAdvancedRenderer) {
|
|
17
18
|
"use strict";
|
|
18
19
|
|
|
19
20
|
/**
|
|
@@ -27,7 +28,7 @@ sap.ui.define([
|
|
|
27
28
|
* @extends sap.rules.ui.ExpressionAdvanced
|
|
28
29
|
*
|
|
29
30
|
* @author SAP SE
|
|
30
|
-
* @version 1.
|
|
31
|
+
* @version 1.122.0
|
|
31
32
|
*
|
|
32
33
|
* @constructor
|
|
33
34
|
* @private
|
|
@@ -57,7 +58,7 @@ sap.ui.define([
|
|
|
57
58
|
},
|
|
58
59
|
type: {
|
|
59
60
|
type: "sap.rules.ui.ExpressionType",
|
|
60
|
-
defaultValue:
|
|
61
|
+
defaultValue: library.ExpressionType.BooleanEnhanced,
|
|
61
62
|
bindable: "bindable"
|
|
62
63
|
}
|
|
63
64
|
}
|
|
@@ -69,7 +70,7 @@ sap.ui.define([
|
|
|
69
70
|
var expressionValue = this.codeMirror ? this.codeMirror.getValue() : this.getValue();
|
|
70
71
|
if (expressionValue) {
|
|
71
72
|
var sValue = this.getHeaderValue() + " " + this.getFixedOperator() + " " + expressionValue;
|
|
72
|
-
|
|
73
|
+
ExpressionAdvanced.prototype.validateExpression.apply(this, [sValue]);
|
|
73
74
|
} else {
|
|
74
75
|
this.setValueStateText("");
|
|
75
76
|
}
|
|
@@ -77,31 +78,38 @@ sap.ui.define([
|
|
|
77
78
|
};
|
|
78
79
|
|
|
79
80
|
DecisionTableCellExpressionAdvanced.prototype.init = function() {
|
|
80
|
-
|
|
81
|
+
ExpressionAdvanced.prototype.init.apply(this, arguments);
|
|
81
82
|
this.bFlagForChangeBeforeBlur = false;
|
|
82
83
|
};
|
|
83
84
|
|
|
84
85
|
DecisionTableCellExpressionAdvanced.prototype.onAfterRendering = function() {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
86
|
+
ExpressionAdvanced.prototype.onAfterRendering.apply(this, arguments);
|
|
87
|
+
sap.ui.require([
|
|
88
|
+
"sap/rules/ui/codemirror/addon/hint/show-hint",
|
|
89
|
+
"sap/rules/ui/codemirror/mode/hdf/hdf",
|
|
90
|
+
"sap/rules/ui/codemirror/addon/display/placeholder",
|
|
91
|
+
"sap/rules/ui/codemirror/addon/mh/mark-selection",
|
|
92
|
+
"sap/rules/ui/codemirror/addon/hint/hdf-hint",
|
|
93
|
+
"sap/rules/ui/codemirror/addon/closeBrackets/closebrackets"
|
|
94
|
+
], () => {
|
|
95
|
+
this.codeMirror.options.fixedOperator = this.getFixedOperator();
|
|
96
|
+
this.codeMirror.options.headerValue = this.getHeaderValue();
|
|
97
|
+
this.codeMirror.options.filterOutStructuredCond = true; //Structured conditions should not appear in decision table. (e.g "any of the following...")
|
|
98
|
+
this.oDecisionTableCell = (this.getParent() && this.getParent().getParent()) ? this.getParent().getParent() : null;
|
|
99
|
+
this._handleValidation();
|
|
100
|
+
if (jQuery(document.getElementById(this.getId())).closest('td').next().width()) {
|
|
101
|
+
this._showPopUp();
|
|
102
|
+
}
|
|
103
|
+
if (this.oDecisionTableCell) {
|
|
104
|
+
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
105
|
+
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
106
|
+
var oDisplayedControl = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
107
|
+
if (oDisplayedControl) {
|
|
108
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
this.createEventListeners();
|
|
112
|
+
});
|
|
105
113
|
}
|
|
106
114
|
|
|
107
115
|
DecisionTableCellExpressionAdvanced.prototype._handleValidation = function() {
|
|
@@ -113,31 +121,31 @@ sap.ui.define([
|
|
|
113
121
|
};
|
|
114
122
|
|
|
115
123
|
DecisionTableCellExpressionAdvanced.prototype._processValidationResult = function(result){
|
|
116
|
-
|
|
124
|
+
ExpressionAdvanced.prototype._processValidationResult.apply(this, arguments);
|
|
117
125
|
if (this.oDecisionTableCell) {
|
|
118
126
|
var valueStateTextPath = this.oDecisionTableCell.getValueStateTextPath();
|
|
119
127
|
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
120
128
|
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
121
129
|
var oDisplayedControl = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
122
|
-
if (oDisplayedControl && result.status ===
|
|
130
|
+
if (oDisplayedControl && result.status === library.ValidationStatus.Error ) {
|
|
123
131
|
var errorDetails = this.getValueStateText();
|
|
124
132
|
dtModel.setProperty(valueStateTextPath.slice(8), errorDetails);
|
|
125
133
|
if (!this.oDecisionTableCell._oPopover || !this.oDecisionTableCell._oPopover.isOpen()) {
|
|
126
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
134
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.Error);
|
|
127
135
|
} else {
|
|
128
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
136
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
129
137
|
}
|
|
130
138
|
this.setProperty("valueStateText", errorDetails);
|
|
131
139
|
} else if (oDisplayedControl) {
|
|
132
140
|
dtModel.setProperty(valueStateTextPath.slice(8), "null");
|
|
133
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
141
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
134
142
|
this.setProperty("valueStateText", "");
|
|
135
143
|
}
|
|
136
144
|
}
|
|
137
145
|
};
|
|
138
146
|
|
|
139
147
|
DecisionTableCellExpressionAdvanced.prototype.exit = function() {
|
|
140
|
-
|
|
148
|
+
ExpressionAdvanced.prototype.exit.apply(this, arguments);
|
|
141
149
|
this._handleValidation();
|
|
142
150
|
this._closePopUp();
|
|
143
151
|
this.pop = null;
|
|
@@ -7,12 +7,14 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides control sap.rules.ui.ExpressionBasic.
|
|
9
9
|
sap.ui.define([
|
|
10
|
-
"jquery
|
|
10
|
+
"sap/ui/thirdparty/jquery",
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/ExpressionBasic",
|
|
13
13
|
"sap/rules/ui/InstructionRenderer",
|
|
14
|
+
"sap/ui/core/library",
|
|
15
|
+
"sap/ui/core/Element",
|
|
14
16
|
"./DecisionTableCellExpressionBasicRenderer"
|
|
15
|
-
], function(jQuery, library, ExpressionBasic, InstructionRenderer, DecisionTableCellExpressionBasicRenderer) {
|
|
17
|
+
], function(jQuery, library, ExpressionBasic, InstructionRenderer, coreLibrary, Element, DecisionTableCellExpressionBasicRenderer) {
|
|
16
18
|
"use strict";
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -26,7 +28,7 @@ sap.ui.define([
|
|
|
26
28
|
* @extends sap.rules.ui.ExpressionBasic
|
|
27
29
|
*
|
|
28
30
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
31
|
+
* @version 1.122.0
|
|
30
32
|
*
|
|
31
33
|
* @constructor
|
|
32
34
|
* @private
|
|
@@ -64,7 +66,7 @@ sap.ui.define([
|
|
|
64
66
|
},
|
|
65
67
|
type: {
|
|
66
68
|
type: "sap.rules.ui.ExpressionType",
|
|
67
|
-
defaultValue:
|
|
69
|
+
defaultValue: library.ExpressionType.BooleanEnhanced,
|
|
68
70
|
bindable: "bindable"
|
|
69
71
|
}
|
|
70
72
|
}
|
|
@@ -94,11 +96,11 @@ sap.ui.define([
|
|
|
94
96
|
this.sCellValue = this.getValue();
|
|
95
97
|
this.sValueFromSettings = (this.sHeaderValue + " " + this.FixedOperatorValue);
|
|
96
98
|
this.sValue = (this.sValueFromSettings + this.sCellValue).trim();
|
|
97
|
-
var expressionLanguage =
|
|
99
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
98
100
|
var suggestions;
|
|
99
101
|
if (!this.sHeaderValue && !this.FixedOperatorValue) {
|
|
100
102
|
this.setProperty("value", this.sValue);
|
|
101
|
-
|
|
103
|
+
ExpressionBasic.prototype._reload.apply(this, arguments);
|
|
102
104
|
return;
|
|
103
105
|
} else {
|
|
104
106
|
//need only right part
|
|
@@ -150,7 +152,7 @@ sap.ui.define([
|
|
|
150
152
|
}
|
|
151
153
|
},
|
|
152
154
|
_onChangeByIndex: function(instructionIndex, sPrefix) {
|
|
153
|
-
|
|
155
|
+
ExpressionBasic.prototype._onChangeByIndex.apply(this, [this.offSet + instructionIndex, this.sHeaderValue + this.FixedOperatorValue, instructionIndex]);
|
|
154
156
|
},
|
|
155
157
|
|
|
156
158
|
renderer: DecisionTableCellExpressionBasicRenderer
|
|
@@ -169,24 +171,24 @@ sap.ui.define([
|
|
|
169
171
|
};
|
|
170
172
|
|
|
171
173
|
DecisionTableCellExpressionBasic.prototype.onAfterRendering = function() {
|
|
172
|
-
|
|
174
|
+
ExpressionBasic.prototype.onAfterRendering.apply(this, arguments);
|
|
173
175
|
this._calculateOffSet();
|
|
174
176
|
this.oDecisionTableCell = (this.getParent() && this.getParent().getParent()) ? this.getParent().getParent() : null;
|
|
175
177
|
if (this.oDecisionTableCell) {
|
|
176
178
|
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
177
179
|
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
178
180
|
this.setProperty("valueStateText", "");
|
|
179
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
181
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
180
182
|
this.createEventListeners();
|
|
181
183
|
}
|
|
182
184
|
};
|
|
183
185
|
|
|
184
186
|
DecisionTableCellExpressionBasic.prototype.onBeforeRendering = function() {
|
|
185
|
-
|
|
187
|
+
ExpressionBasic.prototype.onBeforeRendering.apply(this, arguments);
|
|
186
188
|
};
|
|
187
189
|
|
|
188
190
|
DecisionTableCellExpressionBasic.prototype._getSubExpression = function(expression) {
|
|
189
|
-
var oExpressionLanguage =
|
|
191
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
190
192
|
return oExpressionLanguage._getSubExpressions(null, "dummy " + expression);
|
|
191
193
|
};
|
|
192
194
|
|
|
@@ -201,7 +203,7 @@ sap.ui.define([
|
|
|
201
203
|
} else {
|
|
202
204
|
expressionValue = sHeaderValue + " " + FixedOperatorValue + " " + sCellValue;
|
|
203
205
|
}
|
|
204
|
-
var expressionLanguage =
|
|
206
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
205
207
|
if (expressionValue) {
|
|
206
208
|
var oResult = expressionLanguage.validateExpression(expressionValue);
|
|
207
209
|
if (oResult.deferredResult) {
|
|
@@ -210,19 +212,19 @@ sap.ui.define([
|
|
|
210
212
|
var valueStateTextPath = this.oDecisionTableCell.getValueStateTextPath();
|
|
211
213
|
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
212
214
|
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
213
|
-
if (oResult.status ===
|
|
215
|
+
if (oResult.status === library.ValidationStatus.Error) {
|
|
214
216
|
errorDetails = oResult.errorDetails.replace(/\r\n/g, " ").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
215
217
|
dtModel.setProperty(valueStateTextPath.slice(8), errorDetails);
|
|
216
218
|
if (!this.oDecisionTableCell._oPopover || !this.oDecisionTableCell._oPopover.isOpen()) {
|
|
217
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
219
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.Error);
|
|
218
220
|
} else {
|
|
219
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
221
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
220
222
|
}
|
|
221
223
|
this.setProperty("valueStateText", errorDetails);
|
|
222
224
|
} else {
|
|
223
225
|
this.setProperty("valueStateText", "");
|
|
224
226
|
dtModel.setProperty(valueStateTextPath.slice(8), "null");
|
|
225
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
227
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
230
|
}.bind(this));
|
|
@@ -231,15 +233,15 @@ sap.ui.define([
|
|
|
231
233
|
var valueStateTextPath = this.oDecisionTableCell.getValueStateTextPath();
|
|
232
234
|
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
233
235
|
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
234
|
-
if (oResult.status ===
|
|
236
|
+
if (oResult.status === library.ValidationStatus.Error) {
|
|
235
237
|
errorDetails = oResult.errorDetails.replace(/\r\n/g, " ").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
236
238
|
this.setProperty("valueStateText", errorDetails);
|
|
237
239
|
dtModel.setProperty(valueStateTextPath.slice(8), errorDetails);
|
|
238
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
240
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.Error);
|
|
239
241
|
} else {
|
|
240
242
|
this.setProperty("valueStateText", "");
|
|
241
243
|
dtModel.setProperty(valueStateTextPath.slice(8), "null");
|
|
242
|
-
dtModel.setProperty(valueStatePath.slice(8),
|
|
244
|
+
dtModel.setProperty(valueStatePath.slice(8), coreLibrary.ValueState.None);
|
|
243
245
|
}
|
|
244
246
|
}
|
|
245
247
|
}
|