@sapui5/sap.rules.ui 1.106.0 → 1.108.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 +27 -6
- package/src/sap/rules/ui/AstExpressionBasicRenderer.js +71 -55
- package/src/sap/rules/ui/AutoCompleteSuggestionContent.js +5 -3
- package/src/sap/rules/ui/AutoCompleteSuggestionContentRenderer.js +39 -40
- package/src/sap/rules/ui/BindingSpy.js +1 -1
- package/src/sap/rules/ui/DecisionTable.js +2157 -2154
- package/src/sap/rules/ui/DecisionTableCell.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellAstExpressionBasicRenderer.js +5 -3
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvanced.js +238 -236
- package/src/sap/rules/ui/DecisionTableCellExpressionAdvancedRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasic.js +7 -4
- package/src/sap/rules/ui/DecisionTableCellExpressionBasicRenderer.js +6 -4
- package/src/sap/rules/ui/DecisionTableCellRenderer.js +10 -10
- package/src/sap/rules/ui/DecisionTableConfiguration.js +1 -1
- package/src/sap/rules/ui/DecisionTableRenderer.js +163 -161
- package/src/sap/rules/ui/DecisionTableSettings.js +6 -4
- package/src/sap/rules/ui/DecisionTableSettingsOld.js +963 -961
- package/src/sap/rules/ui/DecisionTableSettingsOldRenderer.js +9 -10
- package/src/sap/rules/ui/DecisionTableSettingsRenderer.js +9 -10
- package/src/sap/rules/ui/ExpressionAdvanced.js +1726 -1724
- package/src/sap/rules/ui/ExpressionAdvancedRenderer.js +8 -8
- package/src/sap/rules/ui/ExpressionBase.js +1 -1
- package/src/sap/rules/ui/ExpressionBasic.js +7 -4
- package/src/sap/rules/ui/ExpressionBasicRenderer.js +8 -7
- package/src/sap/rules/ui/InstructionRenderer.js +73 -33
- package/src/sap/rules/ui/RuleBase.js +1 -1
- package/src/sap/rules/ui/RuleBuilder.js +433 -430
- package/src/sap/rules/ui/RuleBuilderRenderer.js +8 -9
- package/src/sap/rules/ui/TextRule.js +7 -4
- package/src/sap/rules/ui/TextRuleConfiguration.js +1 -1
- package/src/sap/rules/ui/TextRuleRenderer.js +45 -44
- package/src/sap/rules/ui/TextRuleSettings.js +6 -4
- package/src/sap/rules/ui/TextRuleSettingsRenderer.js +9 -9
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAdvancedFunctionPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionAggregateFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionArrayOperatorPanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanel.js +109 -107
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionComparisionOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanel.js +5 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionDateAndTimePanelRenderer.js +10 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanel.js +840 -838
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFixedValuePanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionFunctionalOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanel.js +112 -110
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLogicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanel.js +100 -98
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionLoopFunctionPanelRenderer.js +9 -10
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanel.js +122 -119
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMathematicalOperatorPanelRenderer.js +39 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanel.js +5 -2
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionMiscellaneousOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionOperationsPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanel.js +4 -3
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionRangeOperatorPanelRenderer.js +10 -11
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanel.js +108 -106
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionSelectFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanel.js +254 -252
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionTimeAndDurationFunctionPanelRenderer.js +40 -40
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanel.js +631 -629
- package/src/sap/rules/ui/ast/autoCompleteContent/AutoSuggestionVocabularyPanelRenderer.js +40 -40
- package/src/sap/rules/ui/library.js +31 -10
- package/src/sap/rules/ui/type/ExpressionAbs.js +1 -1
|
@@ -17,10 +17,11 @@ sap.ui.define([
|
|
|
17
17
|
"sap/rules/ui/ast/constants/Constants",
|
|
18
18
|
"sap/rules/ui/services/AstExpressionLanguage",
|
|
19
19
|
"sap/rules/ui/ast/util/AstUtil",
|
|
20
|
-
"sap/ui/core/LocaleData"
|
|
20
|
+
"sap/ui/core/LocaleData",
|
|
21
|
+
"./DecisionTableCellRenderer"
|
|
21
22
|
],
|
|
22
23
|
function (jQuery, library, DecisionTableCellExpressionAdvanced, DecisionTableCellFormatter, DecisionTableCellExpressionBasic, Popover,
|
|
23
|
-
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData) {
|
|
24
|
+
Constants, ConstantUtils, AstExpressionLanguage, AstUtil, LocaleData, DecisionTableCellRenderer) {
|
|
24
25
|
"use strict";
|
|
25
26
|
|
|
26
27
|
/**
|
|
@@ -34,7 +35,7 @@ sap.ui.define([
|
|
|
34
35
|
* @extends sap.ui.core.Control
|
|
35
36
|
*
|
|
36
37
|
* @author SAP SE
|
|
37
|
-
* @version 1.
|
|
38
|
+
* @version 1.108.0
|
|
38
39
|
*
|
|
39
40
|
* @constructor
|
|
40
41
|
* @public
|
|
@@ -206,7 +207,9 @@ sap.ui.define([
|
|
|
206
207
|
singularName: "astExpressionLanguage"
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
|
-
}
|
|
210
|
+
},
|
|
211
|
+
|
|
212
|
+
renderer: DecisionTableCellRenderer
|
|
210
213
|
});
|
|
211
214
|
|
|
212
215
|
DecisionTableCell.prototype._addNodeObject = function (astNode) {
|
|
@@ -11,8 +11,9 @@ sap.ui.define([
|
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/Utils",
|
|
13
13
|
"sap/rules/ui/AstExpressionBasic",
|
|
14
|
-
"sap/rules/ui/Constants"
|
|
15
|
-
|
|
14
|
+
"sap/rules/ui/Constants",
|
|
15
|
+
"./DecisionTableCellAstExpressionBasicRenderer"
|
|
16
|
+
], function (jQuery, library, Utils, AstExpressionBasic, Constants, DecisionTableCellAstExpressionBasicRenderer) {
|
|
16
17
|
"use strict";
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -26,7 +27,7 @@ sap.ui.define([
|
|
|
26
27
|
* @extends sap.rules.ui.AstExpressionBasic
|
|
27
28
|
*
|
|
28
29
|
* @author SAP SE
|
|
29
|
-
* @version 1.
|
|
30
|
+
* @version 1.108.0
|
|
30
31
|
*
|
|
31
32
|
* @constructor
|
|
32
33
|
* @private
|
|
@@ -60,7 +61,9 @@ sap.ui.define([
|
|
|
60
61
|
bindable: "bindable"
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
}
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
renderer: DecisionTableCellAstExpressionBasicRenderer
|
|
64
67
|
});
|
|
65
68
|
|
|
66
69
|
DecisionTableCellAstExpressionBasic.prototype.validateExpression = function () {
|
|
@@ -5,16 +5,18 @@
|
|
|
5
5
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
sap.ui.define(['
|
|
8
|
+
sap.ui.define(['sap/rules/ui/AstExpressionBasicRenderer'],
|
|
9
9
|
|
|
10
|
-
function (
|
|
10
|
+
function (sapRulesUiAstExpressionBasicRenderer) {
|
|
11
11
|
"use strict";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* DecisionTableCellExpressionAdvanced renderer.
|
|
15
15
|
* @namespace
|
|
16
16
|
*/
|
|
17
|
-
var DecisionTableCellAstExpressionBasicRenderer = {
|
|
17
|
+
var DecisionTableCellAstExpressionBasicRenderer = {
|
|
18
|
+
apiVersion: 2
|
|
19
|
+
};
|
|
18
20
|
/**
|
|
19
21
|
* Renders the HTML for the given control, using the provided
|
|
20
22
|
* {@link sap.ui.core.RenderManager}.
|
|
@@ -1,240 +1,242 @@
|
|
|
1
|
-
/*!
|
|
1
|
+
/*!
|
|
2
2
|
* SAP UI development toolkit for HTML5 (SAPUI5)
|
|
3
3
|
|
|
4
4
|
(c) Copyright 2009-2016 SAP SE. All rights reserved
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
// Provides control sap.rules.ui.ExpressionAdvanced.
|
|
9
|
-
sap.ui.define([
|
|
10
|
-
"jquery.sap.global",
|
|
11
|
-
"./library",
|
|
12
|
-
"sap/rules/ui/Utils",
|
|
13
|
-
"sap/rules/ui/ExpressionAdvanced",
|
|
14
|
-
"sap/rules/ui/Constants"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* @param {
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
* @
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @
|
|
33
|
-
* @
|
|
34
|
-
* @
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
this.codeMirror.options.
|
|
87
|
-
this.
|
|
88
|
-
this.
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
var
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
dtModel.setProperty(valueStatePath.slice(8), sap.ui.core.ValueState.
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
this.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
var
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
this.
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
5
|
+
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
// Provides control sap.rules.ui.ExpressionAdvanced.
|
|
9
|
+
sap.ui.define([
|
|
10
|
+
"jquery.sap.global",
|
|
11
|
+
"./library",
|
|
12
|
+
"sap/rules/ui/Utils",
|
|
13
|
+
"sap/rules/ui/ExpressionAdvanced",
|
|
14
|
+
"sap/rules/ui/Constants",
|
|
15
|
+
"./DecisionTableCellExpressionAdvancedRenderer"
|
|
16
|
+
], function(jQuery, library, Utils, ExpressionAdvanced, Constants, DecisionTableCellExpressionAdvancedRenderer) {
|
|
17
|
+
"use strict";
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Constructor for a new DecisionTableCellExpressionAdvanced sap.rules.ui.ExpressionAdvanced.
|
|
21
|
+
*
|
|
22
|
+
* @param {string} [sId] id for the new control, generated automatically if no id is given
|
|
23
|
+
* @param {object} [mSettings] initial settings for the new control
|
|
24
|
+
*
|
|
25
|
+
* @class
|
|
26
|
+
* The <code>sap.rules.ui.DecisionTableCellExpressionAdvanced</code> control provides the ability to define expressions for complex rules in a decision table.
|
|
27
|
+
* @extends sap.rules.ui.ExpressionAdvanced
|
|
28
|
+
*
|
|
29
|
+
* @author SAP SE
|
|
30
|
+
* @version 1.108.0
|
|
31
|
+
*
|
|
32
|
+
* @constructor
|
|
33
|
+
* @private
|
|
34
|
+
* @alias sap.rules.ui.DecisionTableCellExpressionAdvanced
|
|
35
|
+
* @ui5-metamodel This control/element also will be described in the UI5 (legacy) designtime metamodel
|
|
36
|
+
*/
|
|
37
|
+
var DecisionTableCellExpressionAdvanced = ExpressionAdvanced.extend("sap.rules.ui.DecisionTableCellExpressionAdvanced", {
|
|
38
|
+
metadata: {
|
|
39
|
+
|
|
40
|
+
library: "sap.rules.ui",
|
|
41
|
+
properties: {
|
|
42
|
+
/**
|
|
43
|
+
* Defines the header value of the control.
|
|
44
|
+
*/
|
|
45
|
+
headerValue: {
|
|
46
|
+
type: "string",
|
|
47
|
+
defaultValue: "",
|
|
48
|
+
bindable: "bindable"
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Defines the fixed operator value of the control.
|
|
52
|
+
*/
|
|
53
|
+
fixedOperator: {
|
|
54
|
+
type: "string",
|
|
55
|
+
defaultValue: "",
|
|
56
|
+
bindable: "bindable"
|
|
57
|
+
},
|
|
58
|
+
type: {
|
|
59
|
+
type: "sap.rules.ui.ExpressionType",
|
|
60
|
+
defaultValue: sap.rules.ui.ExpressionType.BooleanEnhanced,
|
|
61
|
+
bindable: "bindable"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
renderer: DecisionTableCellExpressionAdvancedRenderer
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
DecisionTableCellExpressionAdvanced.prototype.validateExpression = function() {
|
|
69
|
+
var expressionValue = this.codeMirror ? this.codeMirror.getValue() : this.getValue();
|
|
70
|
+
if (expressionValue) {
|
|
71
|
+
var sValue = this.getHeaderValue() + " " + this.getFixedOperator() + " " + expressionValue;
|
|
72
|
+
sap.rules.ui.ExpressionAdvanced.prototype.validateExpression.apply(this, [sValue]);
|
|
73
|
+
} else {
|
|
74
|
+
this.setValueStateText("");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
DecisionTableCellExpressionAdvanced.prototype.init = function() {
|
|
80
|
+
sap.rules.ui.ExpressionAdvanced.prototype.init.apply(this, arguments);
|
|
81
|
+
this.bFlagForChangeBeforeBlur = false;
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
DecisionTableCellExpressionAdvanced.prototype.onAfterRendering = function() {
|
|
85
|
+
sap.rules.ui.ExpressionAdvanced.prototype.onAfterRendering.apply(this, arguments);
|
|
86
|
+
this.codeMirror.options.fixedOperator = this.getFixedOperator();
|
|
87
|
+
this.codeMirror.options.headerValue = this.getHeaderValue();
|
|
88
|
+
this.codeMirror.options.filterOutStructuredCond = true; //Structured conditions should not appear in decision table. (e.g "any of the following...")
|
|
89
|
+
this.oDecisionTableCell = (this.getParent() && this.getParent().getParent()) ? this.getParent().getParent() : null;
|
|
90
|
+
this._handleValidation();
|
|
91
|
+
if (jQuery.sap.byId(this.getId()).closest('td').next().width()) {
|
|
92
|
+
this._showPopUp();
|
|
93
|
+
}
|
|
94
|
+
if (this.oDecisionTableCell) {
|
|
95
|
+
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
96
|
+
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
97
|
+
var oDisplayedControl = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
98
|
+
if (oDisplayedControl) {
|
|
99
|
+
dtModel.setProperty(valueStatePath.slice(8), sap.ui.core.ValueState.None);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
this.createEventListeners();
|
|
103
|
+
|
|
104
|
+
;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
DecisionTableCellExpressionAdvanced.prototype._handleValidation = function() {
|
|
108
|
+
this.validateExpression();
|
|
109
|
+
this._showErrorMessage();
|
|
110
|
+
if (this.getProperty("valueStateText") && this.codeMirror) {
|
|
111
|
+
this.codeMirror.options.expressionEditor._showPopUp();
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
DecisionTableCellExpressionAdvanced.prototype._processValidationResult = function(result){
|
|
116
|
+
sap.rules.ui.ExpressionAdvanced.prototype._processValidationResult.apply(this, arguments);
|
|
117
|
+
if (this.oDecisionTableCell) {
|
|
118
|
+
var valueStateTextPath = this.oDecisionTableCell.getValueStateTextPath();
|
|
119
|
+
var valueStatePath = this.oDecisionTableCell.getValueStatePath();
|
|
120
|
+
var dtModel = this.oDecisionTableCell.getModel("dtModel");
|
|
121
|
+
var oDisplayedControl = this.oDecisionTableCell.getAggregation("_displayedControl");
|
|
122
|
+
if (oDisplayedControl && result.status === sap.rules.ui.ValidationStatus.Error ) {
|
|
123
|
+
var errorDetails = this.getValueStateText();
|
|
124
|
+
dtModel.setProperty(valueStateTextPath.slice(8), errorDetails);
|
|
125
|
+
if (!this.oDecisionTableCell._oPopover || !this.oDecisionTableCell._oPopover.isOpen()) {
|
|
126
|
+
dtModel.setProperty(valueStatePath.slice(8), sap.ui.core.ValueState.Error);
|
|
127
|
+
} else {
|
|
128
|
+
dtModel.setProperty(valueStatePath.slice(8), sap.ui.core.ValueState.None);
|
|
129
|
+
}
|
|
130
|
+
this.setProperty("valueStateText", errorDetails);
|
|
131
|
+
} else if (oDisplayedControl) {
|
|
132
|
+
dtModel.setProperty(valueStateTextPath.slice(8), "null");
|
|
133
|
+
dtModel.setProperty(valueStatePath.slice(8), sap.ui.core.ValueState.None);
|
|
134
|
+
this.setProperty("valueStateText", "");
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
DecisionTableCellExpressionAdvanced.prototype.exit = function() {
|
|
140
|
+
sap.rules.ui.ExpressionAdvanced.prototype.exit.apply(this, arguments);
|
|
141
|
+
this._handleValidation();
|
|
142
|
+
this._closePopUp();
|
|
143
|
+
this.pop = null;
|
|
144
|
+
var oCodeMirror = this.codeMirror;
|
|
145
|
+
// bug RULES-4391 only in FF after choose hints with mouse sometimes the popover will close and auto complete will stay open
|
|
146
|
+
if (oCodeMirror && oCodeMirror.state.completionActive) {
|
|
147
|
+
oCodeMirror.state.completionActive.onClose();
|
|
148
|
+
}
|
|
149
|
+
// bug RULES-4833 if we pressed escape - we need to focus cell (dotted border)
|
|
150
|
+
if (this.bFocusCellAfterEscape && this.oDecisionTableCell) {
|
|
151
|
+
var oHTMLParent = this.oDecisionTableCell.getDomRef().parentElement.parentElement;
|
|
152
|
+
if (oHTMLParent) {
|
|
153
|
+
jQuery(oHTMLParent).focus();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
DecisionTableCellExpressionAdvanced.prototype.getFormattingTokens = function (oExpressionLanguage) {
|
|
160
|
+
var sExpression = this._liveValue;
|
|
161
|
+
var sHeader = this.getHeaderValue();
|
|
162
|
+
var sFixOperator = this.getFixedOperator();
|
|
163
|
+
var sType = "All";
|
|
164
|
+
|
|
165
|
+
// If the cell is of result section - set a header and fixed operator
|
|
166
|
+
if (oExpressionLanguage._hasValueSource && sHeader === "" && sFixOperator === "") {
|
|
167
|
+
this.attributeId = this.mProperties.attributeInfo;
|
|
168
|
+
this.valueListAttrInfo = oExpressionLanguage.getValueListAttribute(this.attributeId);
|
|
169
|
+
if (this.valueListAttrInfo) {
|
|
170
|
+
sHeader = this.valueListAttrInfo.navPath;
|
|
171
|
+
sFixOperator = Constants.IS_EQUAL_TO;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
var result = oExpressionLanguage.getDecisionTableCellTokens(sHeader, sFixOperator, sExpression, sType);
|
|
176
|
+
var expressionTokens;
|
|
177
|
+
if (result.tokens && result.tokens.cell) {
|
|
178
|
+
expressionTokens = result.tokens.cell;
|
|
179
|
+
this.setExpressionTokens(expressionTokens);
|
|
180
|
+
}
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Event Listeners for integration between [Code Mirror - ExpressionAdvanced - popover - DTCell] to work together in all browsers and OS
|
|
184
|
+
DecisionTableCellExpressionAdvanced.prototype.createEventListeners = function() {
|
|
185
|
+
|
|
186
|
+
document.getElementById(this.getId()).addEventListener("keydown", function(oEvent){
|
|
187
|
+
var key = oEvent.keyCode || oEvent.charCode;
|
|
188
|
+
if ( key === 8 ) { //fix bug - after press backspace and choose autocomplete - popover will not closed
|
|
189
|
+
this.bFlagForChangeBeforeBlur = true;
|
|
190
|
+
} else if (key === 27 ) { // bug RULES-4833 if we pressed escape - we need to focus cell (dotted border)
|
|
191
|
+
this.bFocusCellAfterEscape = true;
|
|
192
|
+
}
|
|
193
|
+
}.bind(this), true);
|
|
194
|
+
|
|
195
|
+
// bug 4848 - touch screen laptops close popover after select autocomplete (trigger touch event)
|
|
196
|
+
var click = ('ontouchstart' in document.documentElement) ? 'touchstart' : 'mousedown';
|
|
197
|
+
|
|
198
|
+
if (click === 'touchstart') { //if hybrid device
|
|
199
|
+
document.addEventListener("mousedown", function(oEvent) {
|
|
200
|
+
if (oEvent.target.className.includes("CodeMirror-hint")) {//if click the auto complete
|
|
201
|
+
oEvent.stopPropagation();
|
|
202
|
+
}
|
|
203
|
+
}.bind(this), true);
|
|
204
|
+
document.addEventListener("touchstart", function(oEvent) {
|
|
205
|
+
if (oEvent.target.className.includes("CodeMirror-hint")) {//if tap the auto complete
|
|
206
|
+
oEvent.stopPropagation();
|
|
207
|
+
}
|
|
208
|
+
}.bind(this), true);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
// EventListeners for IE
|
|
212
|
+
if (!(window.ActiveXObject) && "ActiveXObject" in window) { //if browser IE
|
|
213
|
+
// bug RULES-4810 only in IE Code Mirror blur called validate even popover open - not damaged in other browsers and OS
|
|
214
|
+
this.codeMirror.on("blur", function (cm, oEvent) {
|
|
215
|
+
this.bFlagForPreventBlurWhenPopOverOpen = true;
|
|
216
|
+
}.bind(this));
|
|
217
|
+
|
|
218
|
+
//bug RULES-2641 only in IE blur called twice - not damaged in other browsers and OS
|
|
219
|
+
document.getElementById(this.getId()).addEventListener("mousedown", function(oEvent){
|
|
220
|
+
this.bFlagForChangeBeforeBlur = true;
|
|
221
|
+
}.bind(this), true);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
// EventListeners for FF
|
|
225
|
+
if ((navigator.userAgent.toLowerCase().indexOf('firefox') > -1)){
|
|
226
|
+
// bug RULES-4391 only in FF after choose hints with mouse sometimes the popover will close
|
|
227
|
+
document.addEventListener("mousedown", function(oEvent){
|
|
228
|
+
this.bIsClickedOnTheAutoComplete = oEvent.target.className.includes("CodeMirror-hint");
|
|
229
|
+
}.bind(this), true);
|
|
230
|
+
|
|
231
|
+
document.addEventListener("blur", function(oEvent){
|
|
232
|
+
if (this.bIsClickedOnTheAutoComplete || this.ValueHelpRequested === true) {
|
|
233
|
+
this.bIsClickedOnTheAutoComplete = false;
|
|
234
|
+
oEvent.stopPropagation();
|
|
235
|
+
}
|
|
236
|
+
}.bind(this), true);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
return DecisionTableCellExpressionAdvanced;
|
|
241
|
+
|
|
240
242
|
}, /* bExport= */ true);
|
|
@@ -6,16 +6,18 @@
|
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
sap.ui.define(['
|
|
9
|
+
sap.ui.define(['sap/rules/ui/ExpressionAdvancedRenderer'],
|
|
10
10
|
|
|
11
|
-
function(
|
|
11
|
+
function(sapRulesUiExpressionAdvancedRenderer) {
|
|
12
12
|
"use strict";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* DecisionTableCellExpressionAdvanced renderer.
|
|
16
16
|
* @namespace
|
|
17
17
|
*/
|
|
18
|
-
var DecisionTableCellExpressionAdvancedRenderer = {
|
|
18
|
+
var DecisionTableCellExpressionAdvancedRenderer = {
|
|
19
|
+
apiVersion: 2
|
|
20
|
+
};
|
|
19
21
|
/**
|
|
20
22
|
* Renders the HTML for the given control, using the provided
|
|
21
23
|
* {@link sap.ui.core.RenderManager}.
|
|
@@ -32,7 +34,7 @@ sap.ui.define(['jquery.sap.global', 'sap/rules/ui/ExpressionAdvancedRenderer'],
|
|
|
32
34
|
return;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
oRm.
|
|
37
|
+
oRm.class("sapRULTDecisionTableCellExpressionAdvanced");
|
|
36
38
|
|
|
37
39
|
sapRulesUiExpressionAdvancedRenderer.render(oRm, oControl);
|
|
38
40
|
};
|
|
@@ -10,8 +10,9 @@ sap.ui.define([
|
|
|
10
10
|
"jquery.sap.global",
|
|
11
11
|
"./library",
|
|
12
12
|
"sap/rules/ui/ExpressionBasic",
|
|
13
|
-
"sap/rules/ui/InstructionRenderer"
|
|
14
|
-
|
|
13
|
+
"sap/rules/ui/InstructionRenderer",
|
|
14
|
+
"./DecisionTableCellExpressionBasicRenderer"
|
|
15
|
+
], function(jQuery, library, ExpressionBasic, InstructionRenderer, DecisionTableCellExpressionBasicRenderer) {
|
|
15
16
|
"use strict";
|
|
16
17
|
|
|
17
18
|
/**
|
|
@@ -25,7 +26,7 @@ sap.ui.define([
|
|
|
25
26
|
* @extends sap.rules.ui.ExpressionBasic
|
|
26
27
|
*
|
|
27
28
|
* @author SAP SE
|
|
28
|
-
* @version 1.
|
|
29
|
+
* @version 1.108.0
|
|
29
30
|
*
|
|
30
31
|
* @constructor
|
|
31
32
|
* @private
|
|
@@ -150,7 +151,9 @@ sap.ui.define([
|
|
|
150
151
|
},
|
|
151
152
|
_onChangeByIndex: function(instructionIndex, sPrefix) {
|
|
152
153
|
sap.rules.ui.ExpressionBasic.prototype._onChangeByIndex.apply(this, [this.offSet + instructionIndex, this.sHeaderValue + this.FixedOperatorValue, instructionIndex]);
|
|
153
|
-
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
renderer: DecisionTableCellExpressionBasicRenderer
|
|
154
157
|
});
|
|
155
158
|
|
|
156
159
|
DecisionTableCellExpressionBasic.prototype.init = function() {
|