@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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
// Provides this._validatecontrol sap.rules.ui.
|
|
9
9
|
sap.ui.define([
|
|
10
10
|
"sap/base/Log",
|
|
11
|
-
"jquery
|
|
11
|
+
"sap/ui/thirdparty/jquery",
|
|
12
12
|
"./library",
|
|
13
13
|
"sap/rules/ui/DecisionTableCell",
|
|
14
14
|
"sap/rules/ui/RuleBase",
|
|
@@ -33,20 +33,41 @@ sap.ui.define([
|
|
|
33
33
|
"sap/m/FlexBox",
|
|
34
34
|
"sap/m/MessageStrip",
|
|
35
35
|
"sap/rules/ui/DecisionTableSettingsOld",
|
|
36
|
+
"sap/rules/ui/DecisionTableSettings",
|
|
36
37
|
"sap/rules/ui/type/DecisionTableCell",
|
|
37
38
|
"sap/rules/ui/ast/constants/Constants",
|
|
38
39
|
"sap/rules/ui/services/AstExpressionLanguage",
|
|
39
40
|
"sap/rules/ui/ast/util/AstUtil",
|
|
40
41
|
"sap/rules/ui/Constants",
|
|
41
42
|
"sap/ui/core/LocaleData",
|
|
43
|
+
"sap/ui/model/json/JSONModel",
|
|
44
|
+
"sap/m/MessageToast",
|
|
45
|
+
"sap/m/Title",
|
|
46
|
+
"sap/m/library",
|
|
47
|
+
/*"sap/ui/model/Context",*/
|
|
48
|
+
"sap/ui/core/library",
|
|
49
|
+
"sap/ui/table/library",
|
|
50
|
+
"sap/ui/core/EventBus",
|
|
51
|
+
"sap/ui/base/Event",
|
|
52
|
+
"sap/ui/model/Sorter",
|
|
53
|
+
"sap/base/i18n/Formatting",
|
|
54
|
+
"sap/ui/core/format/DateFormat",
|
|
55
|
+
"sap/ui/core/Lib",
|
|
56
|
+
"sap/ui/core/Element",
|
|
57
|
+
"sap/ui/model/odata/v2/Context",
|
|
58
|
+
"sap/ui/table/rowmodes/Fixed",
|
|
42
59
|
"./DecisionTableRenderer"
|
|
43
60
|
|
|
44
61
|
], function (Log, jQuery, library, DecisionTableCell, RuleBase, Utils, Table, Column, OverflowToolbar, Popover, Menu, Dialog, MenuButton, Button,
|
|
45
62
|
ToolbarSpacer, Text, Input, ObjectIdentifier, Link, Label, BusyIndicator, DisplayListItem, MenuItem, FlexBox, MessageStrip,
|
|
46
|
-
DecisionTableSettingsOld, DecisionTableCellFormatter, ConstantUtils, AstExpressionLanguage, AstUtil, Constants, LocaleData,
|
|
63
|
+
DecisionTableSettingsOld, DecisionTableSettings, DecisionTableCellFormatter, ConstantUtils, AstExpressionLanguage, AstUtil, Constants, LocaleData, JSONModel,
|
|
64
|
+
MessageToast, Title, mobileLibrary, /*Context,*/ coreLibrary,
|
|
65
|
+
TableLibrary, EventBus, Event, Sorter,
|
|
66
|
+
Formatting, DateFormat, coreLib, Element, Context, RowmodesFixed, DecisionTableRenderer) {
|
|
47
67
|
|
|
48
68
|
"use strict";
|
|
49
69
|
|
|
70
|
+
var ButtonType = mobileLibrary.ButtonType;
|
|
50
71
|
/**
|
|
51
72
|
* Constructor for a new DecisionTable Control.
|
|
52
73
|
*
|
|
@@ -58,7 +79,7 @@ sap.ui.define([
|
|
|
58
79
|
* @extends Control
|
|
59
80
|
*
|
|
60
81
|
* @author SAP SE
|
|
61
|
-
* @version 1.
|
|
82
|
+
* @version 1.123.0
|
|
62
83
|
*
|
|
63
84
|
* @constructor
|
|
64
85
|
* @private
|
|
@@ -87,13 +108,16 @@ sap.ui.define([
|
|
|
87
108
|
type: "boolean",
|
|
88
109
|
defaultValue: true
|
|
89
110
|
},
|
|
111
|
+
/**
|
|
112
|
+
* @deprecated Since 1.52.8, use the attribute RuleFormat instead.
|
|
113
|
+
*/
|
|
90
114
|
cellFormat: {
|
|
91
115
|
type: "sap.rules.ui.DecisionTableCellFormat",
|
|
92
|
-
defaultValue:
|
|
116
|
+
defaultValue: library.DecisionTableCellFormat.Both
|
|
93
117
|
},
|
|
94
118
|
hitPolicies: {
|
|
95
119
|
type: "sap.rules.ui.RuleHitPolicy[]",
|
|
96
|
-
defaultValue: [
|
|
120
|
+
defaultValue: [library.RuleHitPolicy.FirstMatch, library.RuleHitPolicy.AllMatch]
|
|
97
121
|
},
|
|
98
122
|
lineActionBuffer: {
|
|
99
123
|
type: "any",
|
|
@@ -104,7 +128,7 @@ sap.ui.define([
|
|
|
104
128
|
},
|
|
105
129
|
decisionTableFormat: {
|
|
106
130
|
type: "sap.rules.ui.DecisionTableFormat",
|
|
107
|
-
defaultValue:
|
|
131
|
+
defaultValue: library.DecisionTableFormat.RuleFormat
|
|
108
132
|
},
|
|
109
133
|
threshold: {
|
|
110
134
|
type: "int",
|
|
@@ -154,7 +178,7 @@ sap.ui.define([
|
|
|
154
178
|
var oErrorLabel = new MessageStrip({
|
|
155
179
|
showCloseButton: true,
|
|
156
180
|
showIcon: true,
|
|
157
|
-
type:
|
|
181
|
+
type: coreLibrary.MessageType.Error,
|
|
158
182
|
visible: false
|
|
159
183
|
}).addStyleClass("sapUiTinyMargin");
|
|
160
184
|
this.setAggregation("_errorsText", oErrorLabel, true);
|
|
@@ -204,7 +228,7 @@ sap.ui.define([
|
|
|
204
228
|
|
|
205
229
|
_addNodeObject: function (astNode) {
|
|
206
230
|
var oNodeArray = [];
|
|
207
|
-
var oAstExpressionLanguage =
|
|
231
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
208
232
|
var oAstUtil = oAstExpressionLanguage._astBunldeInstance.ASTUtil;
|
|
209
233
|
|
|
210
234
|
var updatedAstNode = [];
|
|
@@ -232,9 +256,8 @@ sap.ui.define([
|
|
|
232
256
|
|
|
233
257
|
_addTable: function () {
|
|
234
258
|
var oTable = new Table({
|
|
235
|
-
visibleRowCount: this.VISIBLEROWCOUNT,
|
|
236
259
|
threshold: this.THRESHOLD,
|
|
237
|
-
|
|
260
|
+
rowMode:new RowmodesFixed({ rowCount:this.VISIBLEROWCOUNT, rowContentHeight:50 }),
|
|
238
261
|
selectionMode: {
|
|
239
262
|
parts: [{
|
|
240
263
|
path: "dtModel>/editable"
|
|
@@ -247,6 +270,13 @@ sap.ui.define([
|
|
|
247
270
|
enableColumnReordering: false,
|
|
248
271
|
busy: "{dtModel>/busyTableState}"
|
|
249
272
|
});
|
|
273
|
+
oTable.attachRowsUpdated(function() {
|
|
274
|
+
for (const oRow of oTable.getRows()) {
|
|
275
|
+
for (const oCell of oRow.getCells()) {
|
|
276
|
+
this._updateTableCell(oCell, oRow.getBindingContext())
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
})
|
|
250
280
|
oTable._updateTableCell = this._updateTableCell;
|
|
251
281
|
oTable.setBusyIndicatorDelay(0);
|
|
252
282
|
this.setAggregation("_table", oTable, true);
|
|
@@ -260,7 +290,7 @@ sap.ui.define([
|
|
|
260
290
|
design: "Transparent",
|
|
261
291
|
enabled: "{dtModel>/editable}"
|
|
262
292
|
});
|
|
263
|
-
var oTitle = new
|
|
293
|
+
var oTitle = new Title({
|
|
264
294
|
text: this.oBundle.getText("decisionTable"),
|
|
265
295
|
tooltip:this.oBundle.getText("decisionTable")
|
|
266
296
|
});
|
|
@@ -282,7 +312,7 @@ sap.ui.define([
|
|
|
282
312
|
text: this.oBundle.getText("deleteRow"),
|
|
283
313
|
press: [this._deleteRowWorkaround, this],
|
|
284
314
|
visible: "{dtModel>/editable}",
|
|
285
|
-
type:
|
|
315
|
+
type: ButtonType.Transparent,
|
|
286
316
|
enabled: {
|
|
287
317
|
parts: [{
|
|
288
318
|
path: "dtModel>/newTable"
|
|
@@ -296,7 +326,7 @@ sap.ui.define([
|
|
|
296
326
|
var oCopyLink = new Button({
|
|
297
327
|
text: this.oBundle.getText("copyRow"),
|
|
298
328
|
press: [this._copyRow, this],
|
|
299
|
-
type:
|
|
329
|
+
type: ButtonType.Transparent,
|
|
300
330
|
visible: {
|
|
301
331
|
parts: [{
|
|
302
332
|
path: "dtModel>/editable"
|
|
@@ -317,7 +347,7 @@ sap.ui.define([
|
|
|
317
347
|
|
|
318
348
|
var oCutLink = new Button({
|
|
319
349
|
text: this.oBundle.getText("cutRow"),
|
|
320
|
-
type:
|
|
350
|
+
type: ButtonType.Transparent,
|
|
321
351
|
press: [this._cutRow, this],
|
|
322
352
|
visible: {
|
|
323
353
|
parts: [{
|
|
@@ -339,7 +369,7 @@ sap.ui.define([
|
|
|
339
369
|
|
|
340
370
|
var oPasteLink = new MenuButton({
|
|
341
371
|
text: this.oBundle.getText("pasteRow"),
|
|
342
|
-
type:
|
|
372
|
+
type: ButtonType.Transparent,
|
|
343
373
|
visible: {
|
|
344
374
|
parts: [{
|
|
345
375
|
path: "dtModel>/editable"
|
|
@@ -447,7 +477,7 @@ sap.ui.define([
|
|
|
447
477
|
_onColumnResize: function () {
|
|
448
478
|
this.columnResized = true;
|
|
449
479
|
var obj = { "colResize" : true };
|
|
450
|
-
var oEventBus =
|
|
480
|
+
var oEventBus = EventBus.getInstance();
|
|
451
481
|
oEventBus.publish("sap.ui.rules","_onColumnResized", obj);
|
|
452
482
|
},
|
|
453
483
|
|
|
@@ -458,7 +488,7 @@ sap.ui.define([
|
|
|
458
488
|
if(this.getAstExpressionLanguage()){
|
|
459
489
|
expandPath = "Cells/DecisionTableRowCellASTs";
|
|
460
490
|
}
|
|
461
|
-
var oSorter = new
|
|
491
|
+
var oSorter = new Sorter("Sequence");
|
|
462
492
|
|
|
463
493
|
oTable.bindRows({
|
|
464
494
|
path: bindingPath,
|
|
@@ -543,7 +573,7 @@ sap.ui.define([
|
|
|
543
573
|
}.bind(this);
|
|
544
574
|
|
|
545
575
|
var submitError = function (e) {
|
|
546
|
-
|
|
576
|
+
MessageToast.show(e);
|
|
547
577
|
}.bind(this);
|
|
548
578
|
|
|
549
579
|
var callFunctionSuccess = function (response) {
|
|
@@ -600,7 +630,7 @@ sap.ui.define([
|
|
|
600
630
|
|
|
601
631
|
//Closes cell popover
|
|
602
632
|
_closePopover: function () {
|
|
603
|
-
var pop =
|
|
633
|
+
var pop = Element.getElementById("popover");
|
|
604
634
|
if (pop) {
|
|
605
635
|
pop.close();
|
|
606
636
|
}
|
|
@@ -653,8 +683,8 @@ sap.ui.define([
|
|
|
653
683
|
});
|
|
654
684
|
|
|
655
685
|
relativePath = this._getBindModelName();
|
|
656
|
-
this.firstResultColumnBound = oContext.getProperty(relativePath + "Type") ===
|
|
657
|
-
if (columnType ===
|
|
686
|
+
this.firstResultColumnBound = oContext.getProperty(relativePath + "Type") === library.DecisionTableColumn.Result;
|
|
687
|
+
if (columnType === library.DecisionTableColumn.Result) {
|
|
658
688
|
|
|
659
689
|
if (this.getAstExpressionLanguage()) {
|
|
660
690
|
column.bindProperty("visible", {
|
|
@@ -717,7 +747,7 @@ sap.ui.define([
|
|
|
717
747
|
|
|
718
748
|
_convertAndValidate: function () {
|
|
719
749
|
var ruleData = this._getRuleData();
|
|
720
|
-
var oExpressionLanguage =
|
|
750
|
+
var oExpressionLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
721
751
|
if (oExpressionLanguage) {
|
|
722
752
|
var validateResults = {};
|
|
723
753
|
if (oExpressionLanguage && ruleData) {
|
|
@@ -792,10 +822,10 @@ sap.ui.define([
|
|
|
792
822
|
}).addStyleClass("sapRULDecisionTableColumnHeaderLabel");
|
|
793
823
|
|
|
794
824
|
//Condition header text
|
|
795
|
-
if (columnType ===
|
|
825
|
+
if (columnType === library.DecisionTableColumn.Condition) {
|
|
796
826
|
sPath = oContext.getModel().createKey("/DecisionTableColumnConditions", oHeaderKey);
|
|
797
827
|
sDTColPath = oContext.getModel().createKey("/DecisionTableColumns", oHeaderKey);
|
|
798
|
-
oAstContext = new
|
|
828
|
+
oAstContext = new Context(oContext.getModel(), sPath);
|
|
799
829
|
if (this.getAstExpressionLanguage()) {
|
|
800
830
|
displayExpression = oDtControl._getExpressionFromAstNodes(oAstContext);
|
|
801
831
|
}
|
|
@@ -846,7 +876,7 @@ sap.ui.define([
|
|
|
846
876
|
});
|
|
847
877
|
|
|
848
878
|
//Result header text
|
|
849
|
-
} else if (columnType ===
|
|
879
|
+
} else if (columnType === library.DecisionTableColumn.Result) {
|
|
850
880
|
var sResultPath = oContext.getModel().createKey("/DecisionTableColumnResults", oHeaderKey);
|
|
851
881
|
headerPath = relativePath + sResultPath;
|
|
852
882
|
oText.bindText({
|
|
@@ -889,7 +919,7 @@ sap.ui.define([
|
|
|
889
919
|
formatter: function (sType, iSequence) {
|
|
890
920
|
if (iSequence === 1) {
|
|
891
921
|
return oBundle.getText("conditionIfColumn");
|
|
892
|
-
} else if (sType ===
|
|
922
|
+
} else if (sType === library.DecisionTableColumn.Result) {
|
|
893
923
|
return oBundle.getText("resultThenColumn");
|
|
894
924
|
} else {
|
|
895
925
|
return "";
|
|
@@ -913,9 +943,12 @@ sap.ui.define([
|
|
|
913
943
|
_createNewDecisionTableSettings: function () {
|
|
914
944
|
var oModel = this._getModel();
|
|
915
945
|
var oContext = this.getBindingContext();
|
|
916
|
-
var oDecisionTableSettings = new
|
|
946
|
+
var oDecisionTableSettings = new DecisionTableSettings({
|
|
917
947
|
hitPolicies: "{dtModel>/hitPolicies}",
|
|
918
948
|
newDecisionTable: this._internalModel.getProperty("/newTable"),
|
|
949
|
+
/**
|
|
950
|
+
* @deprecated Since 1.52.8, use the attribute RuleFormat instead.
|
|
951
|
+
*/
|
|
919
952
|
cellFormat: "{dtModel>/cellFormat}",
|
|
920
953
|
decisionTableFormat: this.getDecisionTableFormat(),
|
|
921
954
|
enableSettingResult: this.getEnableSettingResult()
|
|
@@ -929,7 +962,7 @@ sap.ui.define([
|
|
|
929
962
|
var settingModelDataStr = JSON.stringify(this._settingsModel.getData());
|
|
930
963
|
var settingModelData = JSON.parse(settingModelDataStr);
|
|
931
964
|
|
|
932
|
-
var settingModel = new
|
|
965
|
+
var settingModel = new JSONModel(settingModelData);
|
|
933
966
|
|
|
934
967
|
oDecisionTableSettings.setModel(settingModel);
|
|
935
968
|
|
|
@@ -979,7 +1012,7 @@ sap.ui.define([
|
|
|
979
1012
|
});
|
|
980
1013
|
this._markSelection(true);
|
|
981
1014
|
oTable.setSelectedIndex(-1);
|
|
982
|
-
|
|
1015
|
+
MessageToast.show(this.oBundle.getText(operation + "RowSuccess"));
|
|
983
1016
|
},
|
|
984
1017
|
|
|
985
1018
|
_cutRow: function () {
|
|
@@ -1030,7 +1063,7 @@ sap.ui.define([
|
|
|
1030
1063
|
},
|
|
1031
1064
|
|
|
1032
1065
|
_decideSelectionMode: function (editable) {
|
|
1033
|
-
return editable ?
|
|
1066
|
+
return editable ? TableLibrary.SelectionMode.MultiToggle : TableLibrary.SelectionMode.None;
|
|
1034
1067
|
},
|
|
1035
1068
|
|
|
1036
1069
|
_decideSettingsEnablement: function (enableSettings, editable) {
|
|
@@ -1062,7 +1095,7 @@ sap.ui.define([
|
|
|
1062
1095
|
rowPath: null,
|
|
1063
1096
|
operation: null
|
|
1064
1097
|
});
|
|
1065
|
-
|
|
1098
|
+
MessageToast.show(this.oBundle.getText("deleteRowSuccess"));
|
|
1066
1099
|
},
|
|
1067
1100
|
|
|
1068
1101
|
_deleteRowWorkaround: function () {
|
|
@@ -1086,7 +1119,7 @@ sap.ui.define([
|
|
|
1086
1119
|
|
|
1087
1120
|
_displayHeaderErrorMessages: function (headerErrorsArray, columnErrorsMap) {
|
|
1088
1121
|
var oText = this.getAggregation("_errorsText");
|
|
1089
|
-
this.oBundle =
|
|
1122
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
1090
1123
|
var errorHeaderMessage = this._concatinateHeaderErrors(headerErrorsArray);
|
|
1091
1124
|
oText.setText(this.oBundle.getText("errorInTableHeader") + errorHeaderMessage); // + "\n" + errorColumnsHeaderMessage);
|
|
1092
1125
|
oText.setVisible(true);
|
|
@@ -1223,7 +1256,7 @@ sap.ui.define([
|
|
|
1223
1256
|
|
|
1224
1257
|
_getExpressionFromAstNodes: function (oContext) {
|
|
1225
1258
|
var that = this;
|
|
1226
|
-
var oAstExpressionLanguage =
|
|
1259
|
+
var oAstExpressionLanguage = Element.getElementById(this.getAstExpressionLanguage());
|
|
1227
1260
|
var termsProvider = oAstExpressionLanguage._astBunldeInstance.TermsProvider.TermsProvider;
|
|
1228
1261
|
var displayExpression = "";
|
|
1229
1262
|
var displayTermExpression = "";
|
|
@@ -1324,7 +1357,7 @@ sap.ui.define([
|
|
|
1324
1357
|
_getOutputColumnDescription: function (oName, oLabel) {
|
|
1325
1358
|
var expLanguage;
|
|
1326
1359
|
if (this.getExpressionLanguage()) {
|
|
1327
|
-
expLanguage =
|
|
1360
|
+
expLanguage = Element.getElementById(this.getExpressionLanguage());
|
|
1328
1361
|
if (expLanguage && expLanguage._isDataExist()) {
|
|
1329
1362
|
var ResultID = this.getBindingContext().getProperty("ResultDataObjectId");
|
|
1330
1363
|
var desc = expLanguage.getResultColumnDescription(oName, ResultID, oLabel);
|
|
@@ -1480,9 +1513,9 @@ sap.ui.define([
|
|
|
1480
1513
|
this.iNumOfCondition = 0;
|
|
1481
1514
|
this.iNumOfResults = 0;
|
|
1482
1515
|
for (i = 0; i < aColumns.length; i++) {
|
|
1483
|
-
if (aColumns[i].Type ===
|
|
1516
|
+
if (aColumns[i].Type === library.DecisionTableColumn.Condition) {
|
|
1484
1517
|
this.iNumOfCondition++;
|
|
1485
|
-
} else if (aColumns[i].Type ===
|
|
1518
|
+
} else if (aColumns[i].Type === library.DecisionTableColumn.Result) {
|
|
1486
1519
|
this.iNumOfResults++;
|
|
1487
1520
|
}
|
|
1488
1521
|
}
|
|
@@ -1501,9 +1534,9 @@ sap.ui.define([
|
|
|
1501
1534
|
var vocaDataReceived = false;
|
|
1502
1535
|
var oEL;
|
|
1503
1536
|
if (this.getAstExpressionLanguage()) {
|
|
1504
|
-
oEL =
|
|
1537
|
+
oEL = Element.getElementById(this.getAstExpressionLanguage());
|
|
1505
1538
|
} else {
|
|
1506
|
-
oEL =
|
|
1539
|
+
oEL = Element.getElementById(this.getExpressionLanguage());
|
|
1507
1540
|
}
|
|
1508
1541
|
if (oEL && oEL._isDataExist()) {
|
|
1509
1542
|
vocaDataReceived = true;
|
|
@@ -1522,9 +1555,9 @@ sap.ui.define([
|
|
|
1522
1555
|
},
|
|
1523
1556
|
|
|
1524
1557
|
_initDisplayModel: function () {
|
|
1525
|
-
this._displayModel = new
|
|
1558
|
+
this._displayModel = new JSONModel();
|
|
1526
1559
|
this.setModel(this._displayModel, "displayModel");
|
|
1527
|
-
this._settingsModel = new
|
|
1560
|
+
this._settingsModel = new JSONModel();
|
|
1528
1561
|
this.setModel(this._settingsModel, "settingModel");
|
|
1529
1562
|
},
|
|
1530
1563
|
|
|
@@ -1535,6 +1568,9 @@ sap.ui.define([
|
|
|
1535
1568
|
data.sequenceExist = true;
|
|
1536
1569
|
data.busyState = true;
|
|
1537
1570
|
data.busyTableState = true;
|
|
1571
|
+
/**
|
|
1572
|
+
* @deprecated Since 1.52.8, use the attribute RuleFormat instead.
|
|
1573
|
+
*/
|
|
1538
1574
|
data.cellFormat = this.getCellFormat();
|
|
1539
1575
|
data.hitPolicies = this.getHitPolicies();
|
|
1540
1576
|
data.enableSettings = this.getEnableSettings();
|
|
@@ -1546,7 +1582,7 @@ sap.ui.define([
|
|
|
1546
1582
|
data.selectedRow = null;
|
|
1547
1583
|
data.conditionCellAstValues = [];
|
|
1548
1584
|
data.ruleBindingPath = "";
|
|
1549
|
-
this._internalModel = new
|
|
1585
|
+
this._internalModel = new JSONModel(data);
|
|
1550
1586
|
this.setModel(this._internalModel, "dtModel");
|
|
1551
1587
|
},
|
|
1552
1588
|
|
|
@@ -1562,7 +1598,7 @@ sap.ui.define([
|
|
|
1562
1598
|
if (rowPath) {
|
|
1563
1599
|
var firstVisibleRow = oTable.getFirstVisibleRow();
|
|
1564
1600
|
var rowIndex = oModel.getProperty(rowPath).Sequence - 1;
|
|
1565
|
-
if ((rowIndex - firstVisibleRow > -1) && (rowIndex - firstVisibleRow < oTable.
|
|
1601
|
+
if ((rowIndex - firstVisibleRow > -1) && (rowIndex - firstVisibleRow < oTable.getRowMode().getRowCount())) {
|
|
1566
1602
|
var oRow = oTable.getRows()[rowIndex - firstVisibleRow];
|
|
1567
1603
|
var oCells = oRow.getCells();
|
|
1568
1604
|
if (oCells) {
|
|
@@ -1598,7 +1634,7 @@ sap.ui.define([
|
|
|
1598
1634
|
var dialogState = oDialog.getState();
|
|
1599
1635
|
oDialog.destroy();
|
|
1600
1636
|
//User press on "Apply" (and not on "Cancel")
|
|
1601
|
-
if (dialogState ===
|
|
1637
|
+
if (dialogState === coreLibrary.ValueState.Success) {
|
|
1602
1638
|
this._initDisplayModel();
|
|
1603
1639
|
this._refreshBinding();
|
|
1604
1640
|
}
|
|
@@ -1621,7 +1657,7 @@ sap.ui.define([
|
|
|
1621
1657
|
columnErrorsMap = this._buildMessagesStructure(validateResults, columnErrorsMap, headerErrorsArray);
|
|
1622
1658
|
for (var cell in columnErrorsMap) {
|
|
1623
1659
|
if (columnErrorsMap.hasOwnProperty(cell) && (typeof columnErrorsMap[cell] === "string") && columnErrorsMap[cell] !== "null") {
|
|
1624
|
-
cellValueStateMap[cell] =
|
|
1660
|
+
cellValueStateMap[cell] = coreLibrary.ValueState.Error;
|
|
1625
1661
|
}
|
|
1626
1662
|
}
|
|
1627
1663
|
this._displayErrorMessages(headerErrorsArray, columnErrorsMap);
|
|
@@ -1671,10 +1707,10 @@ sap.ui.define([
|
|
|
1671
1707
|
}
|
|
1672
1708
|
oTable.setSelectedIndex(-1);
|
|
1673
1709
|
if (operation === "insertBefore" || operation === "insertAfter") {
|
|
1674
|
-
|
|
1710
|
+
MessageToast.show(this.oBundle.getText("addRowSuccess"));
|
|
1675
1711
|
}
|
|
1676
1712
|
if (operation === "paste") {
|
|
1677
|
-
|
|
1713
|
+
MessageToast.show(this.oBundle.getText("pasteSuccess"));
|
|
1678
1714
|
}
|
|
1679
1715
|
},
|
|
1680
1716
|
|
|
@@ -1692,7 +1728,7 @@ sap.ui.define([
|
|
|
1692
1728
|
if (rowBinding) {
|
|
1693
1729
|
rowBinding.refresh();
|
|
1694
1730
|
}
|
|
1695
|
-
var oEventBus =
|
|
1731
|
+
var oEventBus = EventBus.getInstance();
|
|
1696
1732
|
oEventBus.publish("sap.ui.rules", "refreshDTRuleModel");
|
|
1697
1733
|
},
|
|
1698
1734
|
|
|
@@ -1734,10 +1770,10 @@ sap.ui.define([
|
|
|
1734
1770
|
if (bNewRule) {
|
|
1735
1771
|
var oEL;
|
|
1736
1772
|
if (this.getAstExpressionLanguage()) {
|
|
1737
|
-
oEL =
|
|
1773
|
+
oEL = Element.getElementById(this.getAstExpressionLanguage());
|
|
1738
1774
|
sVersion = "2.0.0";
|
|
1739
1775
|
} else {
|
|
1740
|
-
oEL =
|
|
1776
|
+
oEL = Element.getElementById(this.getExpressionLanguage());
|
|
1741
1777
|
sVersion = oEL.getExpressionLanguageVersion();
|
|
1742
1778
|
}
|
|
1743
1779
|
oModel.setProperty("ExpressionLanguageVersion", sVersion, oContext, true);
|
|
@@ -1758,14 +1794,14 @@ sap.ui.define([
|
|
|
1758
1794
|
iVisibleRowCount = Math.min(oRowBinding.getLength(), this.VISIBLEROWCOUNT);
|
|
1759
1795
|
}
|
|
1760
1796
|
|
|
1761
|
-
var currVisibleRowCount = oTable.
|
|
1797
|
+
var currVisibleRowCount = oTable.getRowMode().getRowCount();
|
|
1762
1798
|
if (currVisibleRowCount !== iVisibleRowCount) {
|
|
1763
|
-
oTable.
|
|
1799
|
+
oTable.getRowMode().setRowCount(iVisibleRowCount);
|
|
1764
1800
|
}
|
|
1765
1801
|
if ((this.dataBucket && this.dataBucket.rows && this.dataBucket.rows.results.length === 0) || !this.getEditable()) {
|
|
1766
|
-
oTable.setSelectionMode(
|
|
1802
|
+
oTable.setSelectionMode(TableLibrary.SelectionMode.None);
|
|
1767
1803
|
} else {
|
|
1768
|
-
oTable.setSelectionMode(
|
|
1804
|
+
oTable.setSelectionMode(TableLibrary.SelectionMode.MultiToggle);
|
|
1769
1805
|
}
|
|
1770
1806
|
},
|
|
1771
1807
|
|
|
@@ -1792,7 +1828,7 @@ sap.ui.define([
|
|
|
1792
1828
|
this._internalModel.setProperty("/busyTableState", tableIsBusy);
|
|
1793
1829
|
},
|
|
1794
1830
|
|
|
1795
|
-
_updateTableCell: function (oCell, oRowContext
|
|
1831
|
+
_updateTableCell: function (oCell, oRowContext) {
|
|
1796
1832
|
//jQuery(oCell.getDomRef()).parent().parent().parent().removeClass("sapRULDecisionTableSCellMarked");
|
|
1797
1833
|
oCell.removeStyleClass("sapRULDecisionTableSCellMarked");
|
|
1798
1834
|
var path = "null";
|
|
@@ -1804,7 +1840,7 @@ sap.ui.define([
|
|
|
1804
1840
|
var rowId = oRowContext.getProperty("Id");
|
|
1805
1841
|
var ruleId = oRowContext.getProperty("RuleId");
|
|
1806
1842
|
var version = oRowContext.getProperty("Version");
|
|
1807
|
-
|
|
1843
|
+
var oModel = oRowContext.getModel();
|
|
1808
1844
|
|
|
1809
1845
|
var headerPath = '';
|
|
1810
1846
|
var rulePath = '';
|
|
@@ -1816,7 +1852,7 @@ sap.ui.define([
|
|
|
1816
1852
|
Version: version
|
|
1817
1853
|
};
|
|
1818
1854
|
var cellBindingPath = oModel.createKey("/DecisionTableRowCells", oCellProperties);
|
|
1819
|
-
var oCellContext = new
|
|
1855
|
+
var oCellContext = new Context(oModel, cellBindingPath);
|
|
1820
1856
|
|
|
1821
1857
|
//Condition path from model
|
|
1822
1858
|
var oProperties = {
|
|
@@ -1859,7 +1895,7 @@ sap.ui.define([
|
|
|
1859
1895
|
headerPath = "/" + oModel.createKey("DecisionTableColumnResults", cellKeyProperties);
|
|
1860
1896
|
rulePath = "/" + oModel.createKey("Rules", ruleKeyProperties);
|
|
1861
1897
|
oCell.setTypePath(headerPath + '/BusinessDataType');
|
|
1862
|
-
if (
|
|
1898
|
+
if (Element.getElementById(oParent.getAstExpressionLanguage())) {
|
|
1863
1899
|
var sResultDataObjectId = oParent.getModel("settingModel").getData().ResultDataObjectId;
|
|
1864
1900
|
var sAttributeId = oModel.getProperty(headerPath + '/DataObjectAttributeId');
|
|
1865
1901
|
oCell.setAttributeInfoPath("/" + sResultDataObjectId + "/" + that.getParent()._formatAttributeId(sAttributeId));
|
|
@@ -1907,7 +1943,7 @@ sap.ui.define([
|
|
|
1907
1943
|
this._initDisplayModel();
|
|
1908
1944
|
this._initDataBucket();
|
|
1909
1945
|
this.bindProperty("busy", "dtModel>/busyState");
|
|
1910
|
-
this.oBundle =
|
|
1946
|
+
this.oBundle = coreLib.getResourceBundleFor("sap.rules.ui.i18n");
|
|
1911
1947
|
this._addToolBar();
|
|
1912
1948
|
this._addTable();
|
|
1913
1949
|
this._addErrorLabel();
|
|
@@ -1967,7 +2003,7 @@ sap.ui.define([
|
|
|
1967
2003
|
if (!bindingContextPath || !oModel) {
|
|
1968
2004
|
return;
|
|
1969
2005
|
}
|
|
1970
|
-
var oContext = new
|
|
2006
|
+
var oContext = new Context(oModel, bindingContextPath);
|
|
1971
2007
|
this._internalModel.setProperty("/ruleBindingPath", bindingContextPath);
|
|
1972
2008
|
this.setBindingContext(oContext);
|
|
1973
2009
|
this._bindRule();
|
|
@@ -1978,7 +2014,7 @@ sap.ui.define([
|
|
|
1978
2014
|
/** Control's properties getters/setters */
|
|
1979
2015
|
setAstExpressionLanguage: function (value) {
|
|
1980
2016
|
this.setAssociation("astExpressionLanguage", value, true);
|
|
1981
|
-
var astExpressionLanguage = (value instanceof Object) ? value :
|
|
2017
|
+
var astExpressionLanguage = (value instanceof Object) ? value : Element.getElementById(value);
|
|
1982
2018
|
if (!astExpressionLanguage) {
|
|
1983
2019
|
return this;
|
|
1984
2020
|
}
|
|
@@ -1993,7 +2029,7 @@ sap.ui.define([
|
|
|
1993
2029
|
}
|
|
1994
2030
|
|
|
1995
2031
|
if (astExpressionLanguage._isDataExist()) {
|
|
1996
|
-
var oEvent = new
|
|
2032
|
+
var oEvent = new Event("", "", {
|
|
1997
2033
|
data: true
|
|
1998
2034
|
});
|
|
1999
2035
|
this._handleVocabularyDataChanged(oEvent);
|
|
@@ -2029,6 +2065,9 @@ sap.ui.define([
|
|
|
2029
2065
|
return this;
|
|
2030
2066
|
},
|
|
2031
2067
|
|
|
2068
|
+
/**
|
|
2069
|
+
* @deprecated Since 1.52.8, use the attribute RuleFormat instead.
|
|
2070
|
+
*/
|
|
2032
2071
|
setCellFormat: function (value) {
|
|
2033
2072
|
this.setProperty("cellFormat", value, true);
|
|
2034
2073
|
this._internalModel.setProperty("/cellFormat", value);
|
|
@@ -2068,7 +2107,7 @@ sap.ui.define([
|
|
|
2068
2107
|
setExpressionLanguage: function (value) {
|
|
2069
2108
|
this.setAssociation("expressionLanguage", value, true);
|
|
2070
2109
|
this._decisionTableCellFormatter.setExpressionLanguage(this.getExpressionLanguage());
|
|
2071
|
-
var expressionLanguage = (value instanceof Object) ? value :
|
|
2110
|
+
var expressionLanguage = (value instanceof Object) ? value : Element.getElementById(value);
|
|
2072
2111
|
if (!expressionLanguage) {
|
|
2073
2112
|
return this;
|
|
2074
2113
|
}
|
|
@@ -2083,7 +2122,7 @@ sap.ui.define([
|
|
|
2083
2122
|
}
|
|
2084
2123
|
|
|
2085
2124
|
if (expressionLanguage._isDataExist()) {
|
|
2086
|
-
var oEvent = new
|
|
2125
|
+
var oEvent = new Event("", "", {
|
|
2087
2126
|
data: true
|
|
2088
2127
|
});
|
|
2089
2128
|
this._handleVocabularyDataChanged(oEvent);
|
|
@@ -2113,13 +2152,13 @@ sap.ui.define([
|
|
|
2113
2152
|
* @private
|
|
2114
2153
|
* @param {map} mParameters? -
|
|
2115
2154
|
*/
|
|
2116
|
-
|
|
2155
|
+
oDecisionTable.prototype._saveWorkAround = function (mParameters, toastMessage) {
|
|
2117
2156
|
var oModel = this._getModel();
|
|
2118
2157
|
oModel.submitChanges(mParameters);
|
|
2119
|
-
|
|
2158
|
+
MessageToast.show(toastMessage);
|
|
2120
2159
|
};
|
|
2121
2160
|
|
|
2122
|
-
|
|
2161
|
+
oDecisionTable.prototype.includes = function (parent, str) {
|
|
2123
2162
|
var returnValue = false;
|
|
2124
2163
|
|
|
2125
2164
|
if (parent.indexOf(str) !== -1) {
|
|
@@ -2129,33 +2168,33 @@ sap.ui.define([
|
|
|
2129
2168
|
return returnValue;
|
|
2130
2169
|
};
|
|
2131
2170
|
|
|
2132
|
-
|
|
2133
|
-
var oLocale =
|
|
2171
|
+
oDecisionTable.prototype._getLocaleData = function () {
|
|
2172
|
+
var oLocale = Formatting.getLanguageTag();
|
|
2134
2173
|
return LocaleData.getInstance(oLocale);
|
|
2135
2174
|
};
|
|
2136
2175
|
|
|
2137
|
-
|
|
2176
|
+
oDecisionTable.prototype._getDateFormatter = function () {
|
|
2138
2177
|
var oLocaleData = this._getLocaleData();
|
|
2139
2178
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
2140
|
-
var dateFormatter =
|
|
2179
|
+
var dateFormatter = DateFormat.getDateInstance({
|
|
2141
2180
|
pattern: datePattern
|
|
2142
2181
|
});
|
|
2143
2182
|
return dateFormatter;
|
|
2144
2183
|
};
|
|
2145
2184
|
|
|
2146
|
-
|
|
2185
|
+
oDecisionTable.prototype._getDateTimeFormatter = function () {
|
|
2147
2186
|
var oLocaleData = this._getLocaleData();
|
|
2148
2187
|
var datePattern = oLocaleData.getDatePattern('medium');
|
|
2149
2188
|
var timePattern = oLocaleData.getTimePattern('medium');
|
|
2150
|
-
var dateTimeFormatter =
|
|
2189
|
+
var dateTimeFormatter = DateFormat.getDateTimeInstance({
|
|
2151
2190
|
pattern: datePattern + " " + timePattern
|
|
2152
2191
|
});
|
|
2153
2192
|
return dateTimeFormatter;
|
|
2154
2193
|
};
|
|
2155
2194
|
|
|
2156
|
-
|
|
2195
|
+
oDecisionTable.prototype.VISIBLEROWCOUNT = 30;
|
|
2157
2196
|
|
|
2158
|
-
|
|
2197
|
+
oDecisionTable.prototype.THRESHOLD = 30;
|
|
2159
2198
|
|
|
2160
2199
|
return oDecisionTable;
|
|
2161
2200
|
|