@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,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
// Provides the sap.rules.ui.ExpressionAdvanced control
|
|
9
9
|
sap.ui.define([
|
|
10
|
+
"./library",
|
|
10
11
|
"./ExpressionAdvancedRenderer",
|
|
11
12
|
"sap/base/Log",
|
|
12
13
|
"sap/m/Dialog",
|
|
@@ -18,23 +19,35 @@ sap.ui.define([
|
|
|
18
19
|
"sap/ui/layout/HorizontalLayout",
|
|
19
20
|
"sap/rules/ui/Utils",
|
|
20
21
|
"sap/ui/core/Popup",
|
|
21
|
-
"jquery
|
|
22
|
+
"sap/ui/thirdparty/jquery",
|
|
22
23
|
"sap/rules/ui/ExpressionBase",
|
|
23
24
|
"sap/ui/comp/odata/MetadataAnalyser",
|
|
24
25
|
"sap/rules/ui/providers/ValueHelpProvider",
|
|
25
26
|
"sap/ui/core/LocaleData",
|
|
26
27
|
"sap/rules/ui/Constants",
|
|
28
|
+
"sap/base/i18n/Formatting",
|
|
29
|
+
"sap/ui/core/format/DateFormat",
|
|
30
|
+
"sap/ui/core/library",
|
|
31
|
+
"sap/ui/model/json/JSONModel",
|
|
32
|
+
"sap/ui/unified/Calendar",
|
|
33
|
+
"sap/ui/model/odata/v2/ODataModel",
|
|
34
|
+
"sap/ui/comp/valuehelpdialog/ValueHelpDialog",
|
|
35
|
+
"sap/ui/comp/smartfilterbar/SmartFilterBar",
|
|
36
|
+
"sap/ui/comp/smartfilterbar/ControlConfiguration",
|
|
37
|
+
"sap/ui/table/Column",
|
|
38
|
+
"sap/m/Label",
|
|
39
|
+
"sap/ui/model/Filter",
|
|
40
|
+
"sap/ui/model/FilterOperator",
|
|
41
|
+
"sap/ui/core/Lib",
|
|
42
|
+
"sap/ui/core/BusyIndicator",
|
|
43
|
+
"sap/ui/core/Element",
|
|
44
|
+
/*"sap/rules/ui/DecisionTableCellExpressionAdvanced"*/
|
|
27
45
|
"sap/rules/ui/codemirror/lib/codemirror",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"sap/rules/ui/codemirror/addon/closeBrackets/closebrackets",
|
|
34
|
-
"sap/rules/ui/codemirror/addon/search/search"
|
|
35
|
-
|
|
36
|
-
], function(ExpressionAdvancedRenderer, Log, Dialog, Control, Button, TextArea, Text, MessageBox, HorizontalLayout, Utils, Popup, jQ, ExpressionBase, MetadataAnalyser,
|
|
37
|
-
ValueHelpProvider, LocaleData, Constants) {
|
|
46
|
+
|
|
47
|
+
], function(Library, ExpressionAdvancedRenderer, Log, Dialog, Control, Button, TextArea, Text, MessageBox, HorizontalLayout, Utils, Popup, jQ, ExpressionBase, MetadataAnalyser,
|
|
48
|
+
ValueHelpProvider, LocaleData, Constants, Formatting, DateFormat,
|
|
49
|
+
coreLibrary, JSONModel, Calendar, ODataModel, ValueHelpDialog, SmartFilterBar,
|
|
50
|
+
ControlConfiguration, Column, Label, Filter, FilterOperator, coreLib, BusyIndicator, Element/*DecisionTableCellExpressionAdvanced*/) {
|
|
38
51
|
"use strict";
|
|
39
52
|
/**
|
|
40
53
|
* Constructor for a new ExpressionAdvanced.
|
|
@@ -68,7 +81,7 @@ sap.ui.define([
|
|
|
68
81
|
*/
|
|
69
82
|
type: {
|
|
70
83
|
type: "sap.rules.ui.ExpressionType",
|
|
71
|
-
defaultValue:
|
|
84
|
+
defaultValue: Library.ExpressionType.All,
|
|
72
85
|
bindable: "bindable"
|
|
73
86
|
},
|
|
74
87
|
|
|
@@ -141,16 +154,20 @@ sap.ui.define([
|
|
|
141
154
|
|
|
142
155
|
ExpressionAdvanced.prototype.init = function() {
|
|
143
156
|
ExpressionBase.prototype.init.apply(this, arguments);
|
|
144
|
-
var codeMirrorCSS =
|
|
145
|
-
var showHintCSS =
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
var codeMirrorCSS = sap.ui.require.toUrl("sap/rules/ui/codemirror/lib") + "/codemirror.css";
|
|
158
|
+
var showHintCSS = sap.ui.require.toUrl("sap/rules/ui/codemirror/addon/hint") + "/show-hint.css";
|
|
159
|
+
sap.ui.require([
|
|
160
|
+
"sap/ui/dom/includeStylesheet"
|
|
161
|
+
], (includeStyleSheet) => {
|
|
162
|
+
includeStyleSheet(codeMirrorCSS);
|
|
163
|
+
includeStyleSheet(showHintCSS);
|
|
164
|
+
});
|
|
148
165
|
|
|
149
166
|
this.pop = new Popup(jQ('<span></span>')[0], false, false, false);
|
|
150
167
|
this.errorWidgets = [];
|
|
151
168
|
this.expressionTokens = [];
|
|
152
169
|
this._liveValue = "";
|
|
153
|
-
this.oBundle =
|
|
170
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
154
171
|
this.dataModel = this.initControlDataModel();
|
|
155
172
|
|
|
156
173
|
// Expression area
|
|
@@ -164,12 +181,12 @@ sap.ui.define([
|
|
|
164
181
|
this.bFlagForEventListener = true;
|
|
165
182
|
|
|
166
183
|
// Date instance which is used to convert the selected date from calendar control to short format
|
|
167
|
-
var oLocale =
|
|
184
|
+
var oLocale = Formatting.getLanguageTag();
|
|
168
185
|
var oLocaleData = LocaleData.getInstance(oLocale);
|
|
169
186
|
|
|
170
|
-
this.oFormatDate =
|
|
187
|
+
this.oFormatDate = DateFormat.getInstance({
|
|
171
188
|
pattern: oLocaleData.getDatePattern('short'),
|
|
172
|
-
calendarType:
|
|
189
|
+
calendarType: coreLibrary.CalendarType.Gregorian
|
|
173
190
|
},
|
|
174
191
|
oLocale
|
|
175
192
|
);
|
|
@@ -181,7 +198,7 @@ sap.ui.define([
|
|
|
181
198
|
};
|
|
182
199
|
|
|
183
200
|
ExpressionAdvanced.prototype._processValidationResult = function(result) {
|
|
184
|
-
if (result.status ===
|
|
201
|
+
if (result.status === Library.ValidationStatus.Error) {
|
|
185
202
|
var msg = Utils.parseUTFToString(result.errorDetails /* || "unknown message" */ );
|
|
186
203
|
msg = msg.replace(/\r\n/g, " ").replace(/\r/g, " ").replace(/\n/g, " ");
|
|
187
204
|
this.errorCursorPosition = result.cursorPosition;
|
|
@@ -204,7 +221,7 @@ sap.ui.define([
|
|
|
204
221
|
var expressionValue = this.codeMirror ? this.codeMirror.getValue() : this.getValue();
|
|
205
222
|
var result = {};
|
|
206
223
|
var incomingdata = {};
|
|
207
|
-
var oEL =
|
|
224
|
+
var oEL = Element.getElementById(this.getExpressionLanguage());
|
|
208
225
|
if (oEL) {
|
|
209
226
|
incomingdata = oEL.validateExpression(
|
|
210
227
|
sInput || expressionValue,
|
|
@@ -235,14 +252,14 @@ sap.ui.define([
|
|
|
235
252
|
return;
|
|
236
253
|
}
|
|
237
254
|
pop.attachClosed(function() {
|
|
238
|
-
|
|
255
|
+
jQuery(document.getElementById(thisId)).remove();
|
|
239
256
|
});
|
|
240
257
|
var dock = Popup.Dock;
|
|
241
258
|
var cssClass = 'sapMInputBaseMessage' + errorState + ' sapMFocus';
|
|
242
259
|
var T = 'sapMValueStateMessageError sapMText';
|
|
243
|
-
var r =
|
|
260
|
+
var r = coreLib.getResourceBundleFor('sap.m');
|
|
244
261
|
|
|
245
|
-
if (errorState ===
|
|
262
|
+
if (errorState === coreLibrary.ValueState.Success) {
|
|
246
263
|
cssClass = 'sapUiInvisibleText';
|
|
247
264
|
errorMessage = '';
|
|
248
265
|
}
|
|
@@ -292,7 +309,7 @@ sap.ui.define([
|
|
|
292
309
|
};
|
|
293
310
|
|
|
294
311
|
ExpressionAdvanced.prototype.initControlDataModel = function() {
|
|
295
|
-
var oDataModel = new
|
|
312
|
+
var oDataModel = new JSONModel();
|
|
296
313
|
var data = {};
|
|
297
314
|
oDataModel.setData(data);
|
|
298
315
|
return oDataModel;
|
|
@@ -431,7 +448,7 @@ sap.ui.define([
|
|
|
431
448
|
};
|
|
432
449
|
|
|
433
450
|
ExpressionAdvanced.prototype.onAliasLinkPress = function(aliasName) {
|
|
434
|
-
var expressionLanguage =
|
|
451
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
435
452
|
if (expressionLanguage) {
|
|
436
453
|
expressionLanguage.onAliasLinkPress(aliasName);
|
|
437
454
|
expressionLanguage.attachEvent("aliasDialogClosed", this.aliasClickCancel, this);
|
|
@@ -439,7 +456,7 @@ sap.ui.define([
|
|
|
439
456
|
};
|
|
440
457
|
|
|
441
458
|
ExpressionAdvanced.prototype.onCreateAliasLinkForText = function(text) {
|
|
442
|
-
var expressionLanguage =
|
|
459
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
443
460
|
if (expressionLanguage) {
|
|
444
461
|
expressionLanguage.attachEvent("aliasDialogClosed", this.replaceTextWithAlias, this);
|
|
445
462
|
expressionLanguage.onCreateAliasLinkForText(text);
|
|
@@ -456,51 +473,58 @@ sap.ui.define([
|
|
|
456
473
|
this.codeMirror.focus();
|
|
457
474
|
this.codeMirror.execCommand("goLineEnd");
|
|
458
475
|
this.fireDialog({
|
|
459
|
-
dialogStatus:
|
|
476
|
+
dialogStatus: library.ValueListDialogMode.Close
|
|
460
477
|
});
|
|
461
478
|
};
|
|
462
479
|
|
|
463
480
|
ExpressionAdvanced.prototype.onAfterRendering = function() {
|
|
464
481
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
482
|
+
sap.ui.require([
|
|
483
|
+
"sap/rules/ui/codemirror/addon/hint/show-hint",
|
|
484
|
+
"sap/rules/ui/codemirror/mode/hdf/hdf",
|
|
485
|
+
"sap/rules/ui/codemirror/addon/display/placeholder",
|
|
486
|
+
"sap/rules/ui/codemirror/addon/mh/mark-selection",
|
|
487
|
+
"sap/rules/ui/codemirror/addon/hint/hdf-hint",
|
|
488
|
+
"sap/rules/ui/codemirror/addon/closeBrackets/closebrackets"
|
|
489
|
+
], () => {
|
|
490
|
+
this.timer = null;
|
|
491
|
+
// needAutoComplete tells us whether an auto complete action is required.
|
|
492
|
+
// we need it since we execute the popup opening in a delayed manner. sometimes it should not open (case 2):
|
|
493
|
+
// case 1. press key -> ... -> delayed open of popup (need to open)
|
|
494
|
+
// case 2. press key -> ... -> press Enter (to select form list) -> ... -> delayed open of popup (need not open)
|
|
495
|
+
this.needAutoComplete = false;
|
|
496
|
+
this.endCompletion = false;
|
|
497
|
+
this._setCodeMirror();
|
|
498
|
+
this._setEditorStyle();
|
|
499
|
+
this._handleMousedown();
|
|
500
|
+
this._handleChange();
|
|
501
|
+
this._handleFocusLeave(); //blur
|
|
502
|
+
this._handleEndCodeCompletion();
|
|
503
|
+
this._handleKeyPress();
|
|
504
|
+
this._handleEditableProperty();
|
|
505
|
+
this._handleOnLoadValidation();
|
|
506
|
+
this._refreshOnNavigationEnd();
|
|
507
|
+
this._handleFocus();
|
|
508
|
+
this._handleValueListSelect();
|
|
509
|
+
this._handleCalendarChange();
|
|
510
|
+
//bug RULES-4848\5031\5030 after choose value from auto complete - popover will not closed
|
|
511
|
+
if (this.bFlagForEventListener) {
|
|
512
|
+
this.bFlagForEventListener = false;
|
|
513
|
+
this.fnMouseDownListsner = function(oEvent) {
|
|
514
|
+
this.bFlagForChangeBeforeBlur = oEvent.target.className.indexOf("CodeMirror-hint") > -1;
|
|
515
|
+
}.bind(this);
|
|
516
|
+
this.fnBlurListsner = function(oEvent) {
|
|
517
|
+
if (this.bFlagForChangeBeforeBlur) {
|
|
518
|
+
this.bFlagForChangeBeforeBlur = false;
|
|
519
|
+
oEvent.stopPropagation();
|
|
520
|
+
this.codeMirror.focus();
|
|
521
|
+
}
|
|
522
|
+
}.bind(this);
|
|
523
|
+
document.addEventListener("mousedown", this.fnMouseDownListsner, true);
|
|
524
|
+
document.getElementById(this.getId()).addEventListener("blur", this.fnBlurListsner, true);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
});
|
|
504
528
|
|
|
505
529
|
};
|
|
506
530
|
|
|
@@ -517,7 +541,7 @@ sap.ui.define([
|
|
|
517
541
|
var bAddSpace = false;
|
|
518
542
|
var that = this;
|
|
519
543
|
|
|
520
|
-
var oCalendar = new
|
|
544
|
+
var oCalendar = new Calendar({
|
|
521
545
|
width: "100%",
|
|
522
546
|
select: this.handleCalendarSelect.bind(this)
|
|
523
547
|
});
|
|
@@ -554,7 +578,7 @@ sap.ui.define([
|
|
|
554
578
|
|
|
555
579
|
// Utility function to update Modal Property of modal
|
|
556
580
|
ExpressionAdvanced.prototype._updateModal = function(modalValue) {
|
|
557
|
-
var pop =
|
|
581
|
+
var pop = Element.getElementById("popover");
|
|
558
582
|
if (pop) {
|
|
559
583
|
pop.setModal(modalValue);
|
|
560
584
|
}
|
|
@@ -583,7 +607,7 @@ sap.ui.define([
|
|
|
583
607
|
ExpressionAdvanced.prototype._raiseError = function(sError) {
|
|
584
608
|
//handling a scenario when the callback or the model are invalid
|
|
585
609
|
Log.error(sError);
|
|
586
|
-
var oBundle =
|
|
610
|
+
var oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
587
611
|
this.setValueStateText(oBundle.getText("valueHelpTechnicalError"));
|
|
588
612
|
this._showPopUp();
|
|
589
613
|
};
|
|
@@ -602,7 +626,7 @@ sap.ui.define([
|
|
|
602
626
|
valueHelpInfo = suggestions[sugg].info;
|
|
603
627
|
}
|
|
604
628
|
}
|
|
605
|
-
var expressionLanguage =
|
|
629
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
606
630
|
valueHelpInfo.expressionLanguage = expressionLanguage;
|
|
607
631
|
var callback = expressionLanguage.getValueHelpCallback();
|
|
608
632
|
this.oTextArea.setValueState("None");
|
|
@@ -620,7 +644,7 @@ sap.ui.define([
|
|
|
620
644
|
callback.call(this, valueHelpInfo);
|
|
621
645
|
// create provider
|
|
622
646
|
var oModel = valueHelpInfo[0].model;
|
|
623
|
-
if (!(oModel instanceof
|
|
647
|
+
if (!(oModel instanceof ODataModel)) {
|
|
624
648
|
this._raiseError("value help model is not an oData V2 model");
|
|
625
649
|
} else if (oModel.isMetadataLoadingFailed()) {
|
|
626
650
|
this._raiseError("model metadata loading has failed in the past");
|
|
@@ -642,7 +666,7 @@ sap.ui.define([
|
|
|
642
666
|
ExpressionAdvanced.prototype._createValueHelpProvider = function(valueHelpInfo, bReplaceWord) {
|
|
643
667
|
|
|
644
668
|
var oModel = valueHelpInfo.model;
|
|
645
|
-
this.oMetadataAnalyzer = new
|
|
669
|
+
this.oMetadataAnalyzer = new MetadataAnalyser(oModel);
|
|
646
670
|
var sAnnotationPath = valueHelpInfo.metadata.propertyPath;
|
|
647
671
|
var oValueListAnnotation = this.oMetadataAnalyzer.getValueListAnnotation(sAnnotationPath);
|
|
648
672
|
if (!oValueListAnnotation.primaryValueListAnnotation) {
|
|
@@ -688,7 +712,7 @@ sap.ui.define([
|
|
|
688
712
|
var businessDataType = valueHelpInfo.metadata.businessDataType;
|
|
689
713
|
var tokens = this.getExpressionTokens();
|
|
690
714
|
var bAddSpace = false;
|
|
691
|
-
var pop =
|
|
715
|
+
var pop = Element.getElementById("popover");
|
|
692
716
|
if (pop) {
|
|
693
717
|
pop.setModal(true);
|
|
694
718
|
}
|
|
@@ -699,7 +723,7 @@ sap.ui.define([
|
|
|
699
723
|
if (this.oDialog) {
|
|
700
724
|
this.oDialog.destroy();
|
|
701
725
|
}
|
|
702
|
-
var basePath =
|
|
726
|
+
var basePath = Element.getElementById(this.getExpressionLanguage()).getModel().sServiceUrl;
|
|
703
727
|
this._createDialog(basePath, valueHelpInfo, curPos, businessDataType, bAddSpace, bReplaceWord, bValuehelpLinkPress);
|
|
704
728
|
};
|
|
705
729
|
|
|
@@ -729,8 +753,8 @@ sap.ui.define([
|
|
|
729
753
|
attributePath = attributePath = attributePath.replace(":","%3A");
|
|
730
754
|
}
|
|
731
755
|
this.attributeName = expressionData.oData[attributePath].Name;
|
|
732
|
-
|
|
733
|
-
this.oValueHelpDialog = new
|
|
756
|
+
BusyIndicator.show(0);
|
|
757
|
+
this.oValueHelpDialog = new ValueHelpDialog({
|
|
734
758
|
supportMultiselect : false,
|
|
735
759
|
supportRanges : false,
|
|
736
760
|
horizontalScrolling : false,
|
|
@@ -762,7 +786,7 @@ sap.ui.define([
|
|
|
762
786
|
that.oValueHelpDialog.destroy();
|
|
763
787
|
that.focus(that.codeMirror);
|
|
764
788
|
that.oFilterBar.destroy();
|
|
765
|
-
|
|
789
|
+
BusyIndicator.hide();
|
|
766
790
|
}
|
|
767
791
|
});
|
|
768
792
|
};
|
|
@@ -779,7 +803,7 @@ sap.ui.define([
|
|
|
779
803
|
*/
|
|
780
804
|
ExpressionAdvanced.prototype._createSmartFilterBar = function(basePath, valueHelpInfo) {
|
|
781
805
|
var that = this;
|
|
782
|
-
this.oFilterBar = new
|
|
806
|
+
this.oFilterBar = new SmartFilterBar({
|
|
783
807
|
entitySet : valueHelpInfo.metadata.entitySet,
|
|
784
808
|
enableBasicSearch : true,
|
|
785
809
|
advancedMode : true,
|
|
@@ -793,7 +817,7 @@ sap.ui.define([
|
|
|
793
817
|
},
|
|
794
818
|
controlConfiguration : [ that._createControlConfiguration() ]
|
|
795
819
|
});
|
|
796
|
-
var oModel = new
|
|
820
|
+
var oModel = new ODataModel(basePath);
|
|
797
821
|
this.oFilterBar.setModel(oModel);
|
|
798
822
|
};
|
|
799
823
|
|
|
@@ -801,7 +825,7 @@ sap.ui.define([
|
|
|
801
825
|
* Creating the Control Configuration for the smartFilter of the valueHelp Dialog.
|
|
802
826
|
*/
|
|
803
827
|
ExpressionAdvanced.prototype._createControlConfiguration = function() {
|
|
804
|
-
var aControlConfiguration = [ new
|
|
828
|
+
var aControlConfiguration = [ new ControlConfiguration({
|
|
805
829
|
hasValueHelpDialog : true,
|
|
806
830
|
key : "Value",
|
|
807
831
|
label : "Value",
|
|
@@ -809,7 +833,7 @@ sap.ui.define([
|
|
|
809
833
|
width : "100px",
|
|
810
834
|
index : 1
|
|
811
835
|
|
|
812
|
-
}), new
|
|
836
|
+
}), new ControlConfiguration({
|
|
813
837
|
hasValueHelpDialog : true,
|
|
814
838
|
key : "Description",
|
|
815
839
|
label : "Description",
|
|
@@ -817,7 +841,7 @@ sap.ui.define([
|
|
|
817
841
|
width : "100px",
|
|
818
842
|
index : 2
|
|
819
843
|
|
|
820
|
-
}), new
|
|
844
|
+
}), new ControlConfiguration({
|
|
821
845
|
hasValueHelpDialog : true,
|
|
822
846
|
key : "VocabularyId",
|
|
823
847
|
label : "VocabularyId",
|
|
@@ -825,7 +849,7 @@ sap.ui.define([
|
|
|
825
849
|
visible : false,
|
|
826
850
|
index : 3
|
|
827
851
|
|
|
828
|
-
}), new
|
|
852
|
+
}), new ControlConfiguration({
|
|
829
853
|
hasValueHelpDialog : true,
|
|
830
854
|
key : "DataObjectId",
|
|
831
855
|
label : "DataObjectId",
|
|
@@ -834,7 +858,7 @@ sap.ui.define([
|
|
|
834
858
|
groupId : "abc",
|
|
835
859
|
index : 4
|
|
836
860
|
|
|
837
|
-
}), new
|
|
861
|
+
}), new ControlConfiguration({
|
|
838
862
|
hasValueHelpDialog : true,
|
|
839
863
|
key : "AttributeId",
|
|
840
864
|
label : "AttributeId",
|
|
@@ -843,7 +867,7 @@ sap.ui.define([
|
|
|
843
867
|
index : 5
|
|
844
868
|
|
|
845
869
|
}),
|
|
846
|
-
new
|
|
870
|
+
new ControlConfiguration({
|
|
847
871
|
hasValueHelpDialog : true,
|
|
848
872
|
key : "Version",
|
|
849
873
|
label : "Version",
|
|
@@ -884,7 +908,7 @@ sap.ui.define([
|
|
|
884
908
|
this._addValueHelpColumn(mEntities.valueHelp.properties[i], oTable);
|
|
885
909
|
}
|
|
886
910
|
|
|
887
|
-
var oModel = new
|
|
911
|
+
var oModel = new ODataModel(basePath);
|
|
888
912
|
oTable.setModel(oModel);
|
|
889
913
|
oTable.bindRows(mEntities.valueHelp.collection, null, aFilterParams);
|
|
890
914
|
oTable.getBinding("rows").attachDataReceived(this._handleRowsDataReceived, this);
|
|
@@ -904,13 +928,13 @@ sap.ui.define([
|
|
|
904
928
|
|
|
905
929
|
// Utility function to create columns for the table.
|
|
906
930
|
ExpressionAdvanced.prototype._addValueHelpColumn = function(oColumName, oTable) {
|
|
907
|
-
var oColumn = new
|
|
931
|
+
var oColumn = new Column().setLabel(new Label({
|
|
908
932
|
text : oColumName
|
|
909
933
|
}));
|
|
910
934
|
if (oColumName === this._propertyValue) {
|
|
911
935
|
oColumn.setSortProperty(oColumName);
|
|
912
936
|
}
|
|
913
|
-
oTable.addColumn(oColumn.setTemplate(new
|
|
937
|
+
oTable.addColumn(oColumn.setTemplate(new Text().bindProperty("text", oColumName)));
|
|
914
938
|
};
|
|
915
939
|
|
|
916
940
|
/*
|
|
@@ -930,9 +954,9 @@ sap.ui.define([
|
|
|
930
954
|
ExpressionAdvanced.prototype._fetchFilterParams = function(valueHelpInfo) {
|
|
931
955
|
var that = this;
|
|
932
956
|
var aSearchParams = [];
|
|
933
|
-
var aFilterParams = [ new
|
|
934
|
-
new
|
|
935
|
-
new
|
|
957
|
+
var aFilterParams = [ new Filter("AttributeId", FilterOperator.EQ, valueHelpInfo.metadata.attributeId),
|
|
958
|
+
new Filter("DataObjectId", FilterOperator.EQ, valueHelpInfo.metadata.dataObjectId),
|
|
959
|
+
new Filter("VocabularyId", FilterOperator.EQ, valueHelpInfo.metadata.vocabularyId) ];
|
|
936
960
|
|
|
937
961
|
var aFilters = this.oFilterBar.getFilters();
|
|
938
962
|
var searchParam = this.oFilterBar.getParameters();
|
|
@@ -941,8 +965,8 @@ sap.ui.define([
|
|
|
941
965
|
searchParam = this.oFilterBar.getParameters().custom.search;
|
|
942
966
|
aSearchParams = this._getSearchFilters(searchParam);
|
|
943
967
|
aFilters = that._formatFilterParams(aFilters);
|
|
944
|
-
aFilterParams.push(new
|
|
945
|
-
filters : [ new
|
|
968
|
+
aFilterParams.push(new Filter({
|
|
969
|
+
filters : [ new Filter(aFilters), new Filter(aSearchParams) ],
|
|
946
970
|
and : true
|
|
947
971
|
}));
|
|
948
972
|
} else if (!jQuery.isEmptyObject(searchParam)) {
|
|
@@ -1051,9 +1075,9 @@ sap.ui.define([
|
|
|
1051
1075
|
ExpressionAdvanced.prototype._manageParam = function(sPath, operator, value1, value2) {
|
|
1052
1076
|
var filterParam = [];
|
|
1053
1077
|
if (value1 && value2) {
|
|
1054
|
-
filterParam = new
|
|
1055
|
-
filters : [ new
|
|
1056
|
-
new
|
|
1078
|
+
filterParam = new Filter({
|
|
1079
|
+
filters : [ new Filter(sPath, FilterOperator.GT, value1),
|
|
1080
|
+
new Filter(sPath, FilterOperator.LT, value2) ],
|
|
1057
1081
|
and : true
|
|
1058
1082
|
});
|
|
1059
1083
|
}
|
|
@@ -1062,21 +1086,21 @@ sap.ui.define([
|
|
|
1062
1086
|
|
|
1063
1087
|
// Utility function to form the search filter params.
|
|
1064
1088
|
ExpressionAdvanced.prototype._getSearchFilters = function(searchParam) {
|
|
1065
|
-
return new
|
|
1066
|
-
filters : [ new
|
|
1067
|
-
new
|
|
1089
|
+
return new Filter({
|
|
1090
|
+
filters : [ new Filter(this._propertyValue, FilterOperator.EQ, searchParam),
|
|
1091
|
+
new Filter(this._propertyDescription, FilterOperator.EQ, searchParam) ],
|
|
1068
1092
|
and : false
|
|
1069
1093
|
});
|
|
1070
1094
|
};
|
|
1071
1095
|
|
|
1072
1096
|
ExpressionAdvanced.prototype.setValueStateFilter = function(oEvent) {
|
|
1073
1097
|
var sId = oEvent.getSource().sId;
|
|
1074
|
-
this._valueFieldValue =
|
|
1098
|
+
this._valueFieldValue = Element.getElementById(sId + "-filterItemControlA_-Value");
|
|
1075
1099
|
if (this._valueFieldValue) {
|
|
1076
1100
|
this._valueFieldValue.setValueState("None");
|
|
1077
1101
|
this._valueFieldValue.setValueStateText("");
|
|
1078
1102
|
}
|
|
1079
|
-
this._valueFieldDescription =
|
|
1103
|
+
this._valueFieldDescription = Element.getElementById(sId + "-filterItemControlA_-Description");
|
|
1080
1104
|
if (this._valueFieldDescription) {
|
|
1081
1105
|
this._valueFieldDescription.setValueState("None");
|
|
1082
1106
|
this._valueFieldDescription.setValueStateText("");
|
|
@@ -1092,7 +1116,7 @@ sap.ui.define([
|
|
|
1092
1116
|
if (!this.getEditable()) {
|
|
1093
1117
|
return;
|
|
1094
1118
|
}
|
|
1095
|
-
var expressionLanguage =
|
|
1119
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1096
1120
|
var callback = expressionLanguage.getValueHelpCallback();
|
|
1097
1121
|
|
|
1098
1122
|
//build valueHelpInfo
|
|
@@ -1198,7 +1222,7 @@ sap.ui.define([
|
|
|
1198
1222
|
cursorPos = this.codeMirror.findPosH(cursorPosition, sFormatedValue.length, "char", true);
|
|
1199
1223
|
this.codeMirror.setCursor(cursorPos); // set the cursor past the new selection
|
|
1200
1224
|
}
|
|
1201
|
-
var oExpressionLanguage =
|
|
1225
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1202
1226
|
this.getFormattingTokens(oExpressionLanguage);
|
|
1203
1227
|
this.ValueHelpRequested = false;
|
|
1204
1228
|
};
|
|
@@ -1209,7 +1233,7 @@ sap.ui.define([
|
|
|
1209
1233
|
if ("getAttributeInfo" in this && this.getAttributeInfo()) {
|
|
1210
1234
|
attributeInfo = this.getAttributeInfo();
|
|
1211
1235
|
}
|
|
1212
|
-
var expressionLanguage =
|
|
1236
|
+
var expressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1213
1237
|
var valueListAttribute;
|
|
1214
1238
|
if (attributeInfo) {
|
|
1215
1239
|
valueListAttribute = expressionLanguage.getValueListAttribute(attributeInfo);
|
|
@@ -1217,7 +1241,7 @@ sap.ui.define([
|
|
|
1217
1241
|
|
|
1218
1242
|
function autoComplete(cm, commandName, timeout) {
|
|
1219
1243
|
var oAdvancedExpressionEditor = cm.options.expressionEditor;
|
|
1220
|
-
if ((oAdvancedExpressionEditor.getEditable() !== false) &&
|
|
1244
|
+
if ((oAdvancedExpressionEditor.getEditable() !== false) && Element.getElementById(oAdvancedExpressionEditor.getExpressionLanguage())) {
|
|
1221
1245
|
window.clearTimeout(oAdvancedExpressionEditor.timer);
|
|
1222
1246
|
oAdvancedExpressionEditor.timer = window.setTimeout(function() {
|
|
1223
1247
|
cm.execCommand(commandName);
|
|
@@ -1233,7 +1257,7 @@ sap.ui.define([
|
|
|
1233
1257
|
window.clearTimeout(oAdvancedExpressionEditor.timer);
|
|
1234
1258
|
oAdvancedExpressionEditor.needAutoComplete = true;
|
|
1235
1259
|
oAdvancedExpressionEditor.timer = window.setTimeout(function() {
|
|
1236
|
-
if (oAdvancedExpressionEditor.needAutoComplete &&
|
|
1260
|
+
if (oAdvancedExpressionEditor.needAutoComplete && Element.getElementById(oAdvancedExpressionEditor.getExpressionLanguage())) {
|
|
1237
1261
|
cm.execCommand("autocomplete");
|
|
1238
1262
|
}
|
|
1239
1263
|
}, 500);
|
|
@@ -1382,7 +1406,7 @@ sap.ui.define([
|
|
|
1382
1406
|
}
|
|
1383
1407
|
|
|
1384
1408
|
if (this.expressionTokens.length === 0) {
|
|
1385
|
-
var oEL =
|
|
1409
|
+
var oEL = Element.getElementById(this.getExpressionLanguage());
|
|
1386
1410
|
if (oEL) {
|
|
1387
1411
|
this.getFormattingTokens(oEL);
|
|
1388
1412
|
}
|
|
@@ -1597,7 +1621,7 @@ sap.ui.define([
|
|
|
1597
1621
|
jQuery(oAdvancedExpressionEditor.codeMirror.getWrapperElement()).removeClass('sapMInputBaseStateInner sapMInputBaseErrorInner sapMInputBaseContentWrapper sapMInputBaseContentWrapperState sapMInputBaseContentWrapperError');
|
|
1598
1622
|
oAdvancedExpressionEditor._liveValue = cm.getValue();
|
|
1599
1623
|
|
|
1600
|
-
var oEL =
|
|
1624
|
+
var oEL = Element.getElementById(oAdvancedExpressionEditor.getExpressionLanguage());
|
|
1601
1625
|
if (oEL) {
|
|
1602
1626
|
oAdvancedExpressionEditor.getFormattingTokens(oEL);
|
|
1603
1627
|
}
|
|
@@ -1630,7 +1654,7 @@ sap.ui.define([
|
|
|
1630
1654
|
if (oAdvancedExpressionEditor.codeMirror.options.shouldValidate && !oAdvancedExpressionEditor.bFlagForPreventBlurWhenPopOverOpen) {
|
|
1631
1655
|
oAdvancedExpressionEditor.setValue(oAdvancedExpressionEditor.codeMirror.getValue());
|
|
1632
1656
|
//if (oAdvancedExpressionEditor.getProperty("automaticValidation")){
|
|
1633
|
-
if (!(oAdvancedExpressionEditor instanceof sap.rules.ui.DecisionTableCellExpressionAdvanced)) {
|
|
1657
|
+
if (!(oAdvancedExpressionEditor /*instanceof sap.rules.ui.DecisionTableCellExpressionAdvanced*/)) {
|
|
1634
1658
|
oAdvancedExpressionEditor.validate();
|
|
1635
1659
|
}
|
|
1636
1660
|
oAdvancedExpressionEditor._closePopUp();
|