@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.
- 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 +113 -74
- package/src/sap/rules/ui/DecisionTableCell.js +67 -34
- 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 +264 -232
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +61 -61
- 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 +30 -26
- package/src/sap/rules/ui/RuleBase.js +2 -3
- package/src/sap/rules/ui/RuleBuilder.js +29 -23
- package/src/sap/rules/ui/TextRule.js +78 -62
- 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.properties +9 -1
- package/src/sap/rules/ui/i18n/messagebundle_ar.properties +1 -1
- package/src/sap/rules/ui/i18n/messagebundle_cnr.properties +34 -34
- 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 +3 -3
- package/src/sap/rules/ui/i18n/messagebundle_sh.properties +88 -88
- package/src/sap/rules/ui/i18n/messagebundle_uk.properties +5 -5
- package/src/sap/rules/ui/library.js +6 -7
- 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 +57 -57
- 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 +1 -1
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sh.properties +90 -90
- package/src/sap/rules/ui/parser/i18n/messages_descriptions_sr.properties +1 -1
- 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 +19 -19
- 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 +2 -2
- package/src/sap/rules/ui/parser/i18n/op_messages_descriptions_sh.properties +26 -26
- 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,22 @@ 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/ui/core/Control",
|
|
22
|
+
"sap/m/Input",
|
|
23
|
+
"sap/ui/model/Context",
|
|
24
|
+
"sap/ui/core/library",
|
|
25
|
+
"sap/base/i18n/Formatting",
|
|
26
|
+
"sap/ui/core/format/DateFormat",
|
|
27
|
+
"sap/ui/core/EventBus",
|
|
28
|
+
"sap/ui/core/Lib",
|
|
29
|
+
"sap/ui/core/Element",
|
|
30
|
+
"sap/ui/core/Fragment",
|
|
31
|
+
"sap/rules/ui/DecisionTableCellAstExpressionBasic",
|
|
21
32
|
"./DecisionTableCellRenderer"
|
|
22
33
|
],
|
|
23
34
|
function (jQuery, library, DecisionTableCellExpressionAdvanced, DecisionTableCellFormatter, DecisionTableCellExpressionBasic, Popover,
|
|
24
|
-
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData,
|
|
35
|
+
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData, Control, Input, Context, coreLibrary, Formatting,
|
|
36
|
+
DateFormat, EventBus, coreLib, Element, Fragment, DecisionTableCellAstExpressionBasic, DecisionTableCellRenderer) {
|
|
25
37
|
"use strict";
|
|
26
38
|
|
|
27
39
|
/**
|
|
@@ -35,14 +47,14 @@ sap.ui.define([
|
|
|
35
47
|
* @extends sap.ui.core.Control
|
|
36
48
|
*
|
|
37
49
|
* @author SAP SE
|
|
38
|
-
* @version 1.
|
|
50
|
+
* @version 1.123.0
|
|
39
51
|
*
|
|
40
52
|
* @constructor
|
|
41
53
|
* @public
|
|
42
54
|
* @alias sap.rules.ui.DecisionTableCellExpressionAdvanced
|
|
43
55
|
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
44
56
|
*/
|
|
45
|
-
var DecisionTableCell =
|
|
57
|
+
var DecisionTableCell = Control.extend("sap.rules.ui.DecisionTableCell", {
|
|
46
58
|
metadata: {
|
|
47
59
|
library: "sap.rules.ui",
|
|
48
60
|
properties: {
|
|
@@ -135,7 +147,7 @@ sap.ui.define([
|
|
|
135
147
|
* Define the DecisionTableCell type/formatter.
|
|
136
148
|
*/
|
|
137
149
|
decisionTableCellType: {
|
|
138
|
-
type: "
|
|
150
|
+
type: "any",
|
|
139
151
|
multiple: false
|
|
140
152
|
},
|
|
141
153
|
/**
|
|
@@ -151,7 +163,7 @@ sap.ui.define([
|
|
|
151
163
|
*/
|
|
152
164
|
decisionTableFormat: {
|
|
153
165
|
type: "sap.rules.ui.DecisionTableFormat",
|
|
154
|
-
defaultValue:
|
|
166
|
+
defaultValue: library.DecisionTableFormat.RuleFormat
|
|
155
167
|
},
|
|
156
168
|
/**
|
|
157
169
|
* Contains the key properties of cell : RowId,ColId,RuleId, Version needed for binding context
|
|
@@ -222,7 +234,7 @@ sap.ui.define([
|
|
|
222
234
|
|
|
223
235
|
DecisionTableCell.prototype._addNodeObject = function (astNode) {
|
|
224
236
|
var oNodeArray = [];
|
|
225
|
-
var oAstExpressionLanguage =
|
|
237
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
226
238
|
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
227
239
|
|
|
228
240
|
var updatedAstNode = [];
|
|
@@ -346,7 +358,7 @@ sap.ui.define([
|
|
|
346
358
|
if (oDisplayedControl) {
|
|
347
359
|
oDisplayedControl.destroy();
|
|
348
360
|
}
|
|
349
|
-
oDisplayedControl = new
|
|
361
|
+
oDisplayedControl = new Input({
|
|
350
362
|
ariaLabelledBy:this.getAriaLabelledBy(),
|
|
351
363
|
editable: false,
|
|
352
364
|
|
|
@@ -375,7 +387,7 @@ sap.ui.define([
|
|
|
375
387
|
var valuePath = this.getValuePath();
|
|
376
388
|
var expression;
|
|
377
389
|
var sPath = "/" + valuePath.split("/")[1];
|
|
378
|
-
var oCellContext = new
|
|
390
|
+
var oCellContext = new Context(this.getModel(), sPath);
|
|
379
391
|
if (this.getExpressionLanguage()) {
|
|
380
392
|
valuePath = this.getDisplayModelName() + ">" + valuePath;
|
|
381
393
|
}
|
|
@@ -434,9 +446,9 @@ sap.ui.define([
|
|
|
434
446
|
oDisplayedControl.bindProperty("valueState", {
|
|
435
447
|
path: valueStatePath,
|
|
436
448
|
formatter: function (sValue) {
|
|
437
|
-
var valueState =
|
|
438
|
-
if (sValue ===
|
|
439
|
-
valueState =
|
|
449
|
+
var valueState = coreLibrary.ValueState.None;
|
|
450
|
+
if (sValue === coreLibrary.ValueState.Error) {
|
|
451
|
+
valueState = coreLibrary.ValueState.Error;
|
|
440
452
|
}
|
|
441
453
|
return valueState;
|
|
442
454
|
}.bind(this)
|
|
@@ -447,14 +459,14 @@ sap.ui.define([
|
|
|
447
459
|
};
|
|
448
460
|
|
|
449
461
|
DecisionTableCell.prototype._getLocaleData = function () {
|
|
450
|
-
var oLocale =
|
|
462
|
+
var oLocale = Formatting.getLanguageTag();
|
|
451
463
|
return LocaleData.getInstance(oLocale);
|
|
452
464
|
};
|
|
453
465
|
|
|
454
466
|
DecisionTableCell.prototype._getDateFormatter = function () {
|
|
455
467
|
var oLocaleData = this._getLocaleData();
|
|
456
468
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
457
|
-
var dateFormatter =
|
|
469
|
+
var dateFormatter = DateFormat.getDateInstance({
|
|
458
470
|
pattern: datePattern
|
|
459
471
|
});
|
|
460
472
|
return dateFormatter;
|
|
@@ -464,7 +476,7 @@ sap.ui.define([
|
|
|
464
476
|
var oLocaleData = this._getLocaleData();
|
|
465
477
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
466
478
|
var timePattern = oLocaleData.getTimePattern('medium');
|
|
467
|
-
var dateTimeFormatter =
|
|
479
|
+
var dateTimeFormatter = DateFormat.getDateTimeInstance({
|
|
468
480
|
pattern: datePattern + " " + timePattern
|
|
469
481
|
});
|
|
470
482
|
return dateTimeFormatter;
|
|
@@ -472,7 +484,7 @@ sap.ui.define([
|
|
|
472
484
|
|
|
473
485
|
DecisionTableCell.prototype._getExpressionFromAstNodes = function (oContext, bInputField) {
|
|
474
486
|
var that = this;
|
|
475
|
-
var oAstExpressionLanguage =
|
|
487
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
476
488
|
var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
477
489
|
var displayExpression = "";
|
|
478
490
|
var displayTermExpression = "";
|
|
@@ -582,17 +594,17 @@ sap.ui.define([
|
|
|
582
594
|
|
|
583
595
|
DecisionTableCell.prototype.init = function () {
|
|
584
596
|
this.astUtil = new AstUtil();
|
|
585
|
-
this.oBundle =
|
|
597
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
586
598
|
};
|
|
587
599
|
|
|
588
600
|
DecisionTableCell.prototype.onAfterRendering = function () {
|
|
589
601
|
this.bColumnResized = false;
|
|
590
|
-
var oEventBus =
|
|
602
|
+
var oEventBus = EventBus.getInstance();
|
|
591
603
|
oEventBus.unsubscribe("sap.ui.rules","_onColumnResized",this._setColumnResized,this);
|
|
592
604
|
};
|
|
593
605
|
|
|
594
606
|
DecisionTableCell.prototype.onBeforeRendering = function () {
|
|
595
|
-
var oEventBus =
|
|
607
|
+
var oEventBus = EventBus.getInstance();
|
|
596
608
|
oEventBus.subscribeOnce("sap.ui.rules","_onColumnResized",this._setColumnResized,this);
|
|
597
609
|
if (!this.bColumnResized) {
|
|
598
610
|
this._setDisplayedControl();
|
|
@@ -603,7 +615,7 @@ sap.ui.define([
|
|
|
603
615
|
this.bColumnResized = true;
|
|
604
616
|
};
|
|
605
617
|
|
|
606
|
-
DecisionTableCell.prototype.onFocusIn = function () {
|
|
618
|
+
DecisionTableCell.prototype.onFocusIn = async function () {
|
|
607
619
|
var fnAfterPopOverOpen = function (oEvent) {
|
|
608
620
|
var oDecisionTableCellExpression = oEvent.getSource().getAggregation('content')[1];
|
|
609
621
|
oDecisionTableCellExpression.setVisible(true);
|
|
@@ -619,12 +631,12 @@ sap.ui.define([
|
|
|
619
631
|
var fnAfterPopOverClose = function (oEvent) {
|
|
620
632
|
if (this._oPopover) {
|
|
621
633
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
622
|
-
if (oDecisionTableCellExpression
|
|
634
|
+
if (oDecisionTableCellExpression.isA("sap.rules.ui.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
635
|
if (oDecisionTableCellExpression.codeMirror) {
|
|
624
636
|
var sExpression = oDecisionTableCellExpression.codeMirror.getValue();
|
|
625
637
|
oDecisionTableCellExpression.setValue(sExpression);
|
|
626
638
|
}
|
|
627
|
-
} else if (oDecisionTableCellExpression
|
|
639
|
+
} else if (oDecisionTableCellExpression.isA("sap.rules.ui.AstExpressionBasic")) {
|
|
628
640
|
//While making changes in one cell and focusing into another cell, _fireChange is not called from
|
|
629
641
|
//AstExpressionBasic._handlePopupFocusOut
|
|
630
642
|
oDecisionTableCellExpression._fireChange(oDecisionTableCellExpression._input.text())
|
|
@@ -643,29 +655,44 @@ sap.ui.define([
|
|
|
643
655
|
var sValueRuleFormat = this.getModel().getProperty(this.getRuleFormatPath());
|
|
644
656
|
var sdecisionTableFormat = this.getDecisionTableFormat();
|
|
645
657
|
//destroy if the popover is not destroyed during close of popover.
|
|
646
|
-
if (
|
|
647
|
-
|
|
658
|
+
if (Element.getElementById("popover")) {
|
|
659
|
+
Element.getElementById("popover").destroy();
|
|
648
660
|
}
|
|
649
661
|
// when the decisionTableFormat is set to type sap.rules.ui.DecisionTableFormat.RuleFormat then we Render the cells based on the
|
|
650
662
|
// Rule Format
|
|
651
663
|
if (this.getAstExpressionLanguage()) {
|
|
652
|
-
this._oPopover =
|
|
653
|
-
|
|
664
|
+
this._oPopover = await Fragment.load({
|
|
665
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellAstExpressionBasic',
|
|
666
|
+
controller: this
|
|
667
|
+
})
|
|
668
|
+
this._oPopover.setTooltip(this.oBundle.getText("ctrlSpaceCue"));
|
|
654
669
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
655
670
|
oDecisionTableCellExpression.setAstExpressionLanguage(this.getAstExpressionLanguage());
|
|
656
|
-
oDecisionTableCellExpression.attachChange(
|
|
671
|
+
oDecisionTableCellExpression.attachChange(DecisionTableCellAstExpressionBasic.prototype._changeValue);
|
|
657
672
|
} else {
|
|
658
|
-
if (sdecisionTableFormat ===
|
|
659
|
-
if (sValueRuleFormat.toUpperCase() ===
|
|
660
|
-
this._oPopover =
|
|
673
|
+
if (sdecisionTableFormat === library.DecisionTableFormat.RuleFormat) {
|
|
674
|
+
if (sValueRuleFormat.toUpperCase() === library.RuleFormat.Advanced) {
|
|
675
|
+
this._oPopover = await Fragment.load({
|
|
676
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionAdvanced',
|
|
677
|
+
controller: this
|
|
678
|
+
})
|
|
661
679
|
} else {
|
|
662
|
-
this._oPopover =
|
|
680
|
+
this._oPopover = await Fragment.load({
|
|
681
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionBasic',
|
|
682
|
+
controller: this
|
|
683
|
+
})
|
|
663
684
|
}
|
|
664
685
|
} else if (bValueOnly) { // When the decisionTableFormat is set to the default value or pf type
|
|
665
686
|
// sap.rules.ui.DecisionTableFormat.RuleFormat then we render the cells based on ValueOnly
|
|
666
|
-
this._oPopover =
|
|
687
|
+
this._oPopover = await Fragment.load({
|
|
688
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellExpressionBasic',
|
|
689
|
+
controller: this
|
|
690
|
+
})
|
|
667
691
|
} else {
|
|
668
|
-
this._oPopover =
|
|
692
|
+
this._oPopover = await Fragment.load({
|
|
693
|
+
name: 'sap.rules.ui.fragments.DecisionTableCellAstExpressionBasic',
|
|
694
|
+
controller: this
|
|
695
|
+
})
|
|
669
696
|
}
|
|
670
697
|
var oDecisionTableCellExpression = this._oPopover.getAggregation('content')[1];
|
|
671
698
|
oDecisionTableCellExpression.setExpressionLanguage(this.getExpressionLanguage());
|
|
@@ -676,7 +703,7 @@ sap.ui.define([
|
|
|
676
703
|
this._oPopover.attachAfterClose(fnAfterPopOverClose);
|
|
677
704
|
this.addDependent(this._oPopover);
|
|
678
705
|
|
|
679
|
-
var num = jQuery.
|
|
706
|
+
var num = jQuery(document.getElementById(this.getId())).closest('td').width() * 0.93;
|
|
680
707
|
var sWidth = num + "px";
|
|
681
708
|
var oScrollContainer = this._oPopover.getAggregation('content')[0];
|
|
682
709
|
oScrollContainer.setWidth(sWidth);
|
|
@@ -702,6 +729,12 @@ sap.ui.define([
|
|
|
702
729
|
return returnValue;
|
|
703
730
|
};
|
|
704
731
|
|
|
732
|
+
DecisionTableCell.prototype.setDecisionTableCellType = function (value) {
|
|
733
|
+
if(value != null && value.isA("sap.rules.ui.type.DecisionTableCell")) {
|
|
734
|
+
this.setProperty("decisionTableCellType", value);
|
|
735
|
+
}
|
|
736
|
+
};
|
|
737
|
+
|
|
705
738
|
return DecisionTableCell;
|
|
706
739
|
|
|
707
740
|
}, /* bExport= */ true);
|
|
@@ -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.123.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.123.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.123.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
|
}
|