@magic-xpa/engine 4.900.0-dev490.12 → 4.900.0-dev490.122
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/esm2020/src/ClientManager.mjs +10 -5
- package/esm2020/src/CurrentClientVersion.mjs +2 -2
- package/esm2020/src/bridge/MagicBridge.mjs +3 -3
- package/esm2020/src/event/EventsManager.mjs +2 -2
- package/esm2020/src/exp/ExpressionEvaluator.mjs +2 -2
- package/esm2020/src/gui/MgControl.mjs +3 -2
- package/esm2020/src/rt/Operation.mjs +3 -3
- package/esm2020/src/rt/RecomputeTable.mjs +10 -2
- package/esm2020/src/tasks/RemoteTaskService.mjs +3 -3
- package/esm2020/src/tasks/Task.mjs +13 -7
- package/esm2020/src/util/Scrambler.mjs +3 -2
- package/esm2020/src/util/cookie.service.mjs +2 -2
- package/fesm2015/magic-xpa-engine.mjs +49 -24
- package/fesm2015/magic-xpa-engine.mjs.map +1 -1
- package/fesm2020/magic-xpa-engine.mjs +42 -21
- package/fesm2020/magic-xpa-engine.mjs.map +1 -1
- package/package.json +4 -4
- package/src/ClientManager.d.ts +1 -1
- package/src/bridge/MagicBridge.d.ts +1 -1
- package/src/tasks/RemoteTaskService.d.ts +1 -1
- package/src/tasks/Task.d.ts +1 -1
|
@@ -1205,7 +1205,8 @@ class MgControl extends MgControlBase {
|
|
|
1205
1205
|
if (!isTagProcessed) {
|
|
1206
1206
|
switch (attribute) {
|
|
1207
1207
|
case ConstInterface.MG_ATTR_SUBFORM_TASK:
|
|
1208
|
-
|
|
1208
|
+
if (valueStr.trim() != "")
|
|
1209
|
+
this._subformTaskId = valueStr;
|
|
1209
1210
|
break;
|
|
1210
1211
|
case ConstInterface.MG_ATTR_REFRESHON:
|
|
1211
1212
|
this.refreshOnString = valueStr.trim();
|
|
@@ -4132,9 +4133,10 @@ class Scrambler {
|
|
|
4132
4133
|
if (high > (sqrt / 2))
|
|
4133
4134
|
high = Math.floor(sqrt / 2);
|
|
4134
4135
|
delta = (Math.random() * (high - low)) + low;
|
|
4136
|
+
delta = Math.floor(delta);
|
|
4135
4137
|
if (delta === Scrambler.XML_ILLEGAL_RANDOM)
|
|
4136
4138
|
delta++;
|
|
4137
|
-
return
|
|
4139
|
+
return delta;
|
|
4138
4140
|
}
|
|
4139
4141
|
static UnScramble(inVal, beginOffSet, endOffSet) {
|
|
4140
4142
|
if (!Scrambler.ScramblingEnabled) {
|
|
@@ -9261,8 +9263,8 @@ class Operation {
|
|
|
9261
9263
|
if (rtEvnt !== null) {
|
|
9262
9264
|
this._routeParams = rtEvnt.getRouteParamList();
|
|
9263
9265
|
if ((await rtEvnt.getArgList().getArg(0).getValue(StorageAttribute.ALPHA, 0)).trim() === this._routerPath &&
|
|
9264
|
-
((rtEvnt.getArgList().getArg(1).skipArg()) ||
|
|
9265
|
-
(await rtEvnt.getArgList().getArg(1).getValue(StorageAttribute.ALPHA, 0)).trim() === this._originalRouterOutletName))
|
|
9266
|
+
((rtEvnt.getArgList().getArg(1).skipArg() && destSubForm === this._task.getForm().DefaultRouterOutlet) ||
|
|
9267
|
+
(!rtEvnt.getArgList().getArg(1).skipArg() && (await rtEvnt.getArgList().getArg(1).getValue(StorageAttribute.ALPHA, 0)).trim() === this._originalRouterOutletName)))
|
|
9266
9268
|
canRoute = true;
|
|
9267
9269
|
if (!canRoute)
|
|
9268
9270
|
return false;
|
|
@@ -10125,7 +10127,7 @@ class CookieService {
|
|
|
10125
10127
|
var cookie = cookies[i];
|
|
10126
10128
|
var eqPos = cookie.indexOf('=');
|
|
10127
10129
|
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
10128
|
-
if (cookieName === decodeURI(name)) {
|
|
10130
|
+
if (cookieName === NString.TrimStart(decodeURI(name))) {
|
|
10129
10131
|
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
|
|
10130
10132
|
return true;
|
|
10131
10133
|
}
|
|
@@ -14195,7 +14197,7 @@ class ExpressionEvaluator extends GuiExpressionEvaluator {
|
|
|
14195
14197
|
}
|
|
14196
14198
|
path = args[3];
|
|
14197
14199
|
domain = args[4];
|
|
14198
|
-
resVal.BoolVal = CookieService.setCookie(cookieName, args[0], nativeDt, path, domain, secure, sameSite);
|
|
14200
|
+
resVal.BoolVal = CookieService.setCookie(cookieName, (args[0] != null ? args[0].toString() : ""), nativeDt, path, domain, secure, sameSite);
|
|
14199
14201
|
}
|
|
14200
14202
|
eval_op_get_cookie(cookieName, resVal) {
|
|
14201
14203
|
resVal.StrVal = CookieService.getCookie(cookieName);
|
|
@@ -20442,8 +20444,8 @@ class RemoteTaskService extends TaskServiceBase {
|
|
|
20442
20444
|
OwnerTransactionTask = task.DataviewManager.RemoteDataviewManager.Transaction.OwnerTask;
|
|
20443
20445
|
return OwnerTransactionTask;
|
|
20444
20446
|
}
|
|
20445
|
-
static PreparePropMainDisplay(task) {
|
|
20446
|
-
task.ComputeMainDisplay();
|
|
20447
|
+
static async PreparePropMainDisplay(task) {
|
|
20448
|
+
await task.ComputeMainDisplay();
|
|
20447
20449
|
return task.FormIsLegal() ? ReturnResult.SuccessfulResult : new ReturnResult(MsgInterface.BRKTAB_STR_ERR_FORM);
|
|
20448
20450
|
}
|
|
20449
20451
|
}
|
|
@@ -21948,6 +21950,14 @@ class RecomputeTable {
|
|
|
21948
21950
|
throw new ApplicationException("in RecomputeTable.fillData() invalid task id: ");
|
|
21949
21951
|
}
|
|
21950
21952
|
fillData_1(dataView, task, parser) {
|
|
21953
|
+
if (parser.getNextTag() == XMLConstants.MG_TAG_RECOMPUTE) {
|
|
21954
|
+
let currrentIndex = parser.getCurrIndex();
|
|
21955
|
+
let encoded = parser.ReadContentOfCurrentElement().trim();
|
|
21956
|
+
let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
|
|
21957
|
+
let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
|
|
21958
|
+
parser.setXMLdata(newXmlData);
|
|
21959
|
+
parser.setCurrIndex(currrentIndex);
|
|
21960
|
+
}
|
|
21951
21961
|
while (this.initInnerObjects(parser, parser.getNextTag(), dataView, task)) {
|
|
21952
21962
|
}
|
|
21953
21963
|
}
|
|
@@ -22693,10 +22703,12 @@ class Task extends TaskBase {
|
|
|
22693
22703
|
this.setDescriptor(valueStr);
|
|
22694
22704
|
break;
|
|
22695
22705
|
case ConstInterface.MG_ATTR_HAS_LOCATE:
|
|
22696
|
-
|
|
22706
|
+
if (+valueStr == 1)
|
|
22707
|
+
this.hasLocate = true;
|
|
22697
22708
|
break;
|
|
22698
22709
|
case ConstInterface.MG_ATTR_AS_PARENT:
|
|
22699
|
-
|
|
22710
|
+
if (+valueStr == 1)
|
|
22711
|
+
this.ModeAsParent = true;
|
|
22700
22712
|
break;
|
|
22701
22713
|
case ConstInterface.MG_ATTR_TASK_UNIQUE_SORT:
|
|
22702
22714
|
this.UniqueSort = valueStr[0];
|
|
@@ -23023,6 +23035,7 @@ class Task extends TaskBase {
|
|
|
23023
23035
|
result = await this.DataviewManager.Execute(dataViewCommand);
|
|
23024
23036
|
if (!result.Success)
|
|
23025
23037
|
return null;
|
|
23038
|
+
this.ResumeSubformLayout();
|
|
23026
23039
|
}
|
|
23027
23040
|
nonInteractiveTask = await this.StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm);
|
|
23028
23041
|
this.InStartProcess = false;
|
|
@@ -24646,16 +24659,16 @@ class Task extends TaskBase {
|
|
|
24646
24659
|
}
|
|
24647
24660
|
}
|
|
24648
24661
|
}
|
|
24649
|
-
ComputeMainDisplay() {
|
|
24662
|
+
async ComputeMainDisplay() {
|
|
24650
24663
|
let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
|
|
24651
|
-
let mainDisplayIndex = propMainDisplay.
|
|
24664
|
+
let mainDisplayIndex = await propMainDisplay.getValueInt();
|
|
24652
24665
|
mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
|
|
24653
24666
|
this._forms.InitFormFromXmlString(mainDisplayIndex);
|
|
24654
24667
|
this.EnsureValidForm();
|
|
24655
24668
|
}
|
|
24656
24669
|
async PrepareTaskForm() {
|
|
24657
24670
|
await TaskServiceBase.PreparePropOpenTaskWindow(this);
|
|
24658
|
-
return RemoteTaskService.PreparePropMainDisplay(this);
|
|
24671
|
+
return await RemoteTaskService.PreparePropMainDisplay(this);
|
|
24659
24672
|
}
|
|
24660
24673
|
FormIsLegal() {
|
|
24661
24674
|
let isFormIsLegal = super.isMainProg();
|
|
@@ -24724,7 +24737,10 @@ class Task extends TaskBase {
|
|
|
24724
24737
|
let tokensVector = XmlParser.getTokens(RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx), XMLConstants.XML_ATTR_DELIM);
|
|
24725
24738
|
let taskCacheURL = tokensVector.get_Item(1);
|
|
24726
24739
|
let refListStr = tokensVector.get_Item(3);
|
|
24727
|
-
let taskContentOriginal =
|
|
24740
|
+
let taskContentOriginal = "";
|
|
24741
|
+
if (taskCacheURL.trim() != "") {
|
|
24742
|
+
taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
|
|
24743
|
+
}
|
|
24728
24744
|
let taskContentFinal = new StringBuilder(xmlData.substr(0, RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1)), taskContentOriginal.length);
|
|
24729
24745
|
let reflist = this.getReflist(refListStr, ';', true, -1);
|
|
24730
24746
|
let refListIdx = 0;
|
|
@@ -26924,7 +26940,7 @@ class EventsManager {
|
|
|
26924
26940
|
val = Manager.GetCtrlVal(ctrl);
|
|
26925
26941
|
task.CurrentEditingControl = null;
|
|
26926
26942
|
if (!task.cancelWasRaised() &&
|
|
26927
|
-
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && ctrl._field.getType() === StorageAttribute.DATE || val !== null) && typeof val != 'undefined' &&
|
|
26943
|
+
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
|
|
26928
26944
|
!await ctrl.validateAndSetValue(val, true))) {
|
|
26929
26945
|
this.setStopExecution(true);
|
|
26930
26946
|
return false;
|
|
@@ -29516,7 +29532,7 @@ class CommandsTable {
|
|
|
29516
29532
|
}
|
|
29517
29533
|
}
|
|
29518
29534
|
|
|
29519
|
-
let CurrentClientVersion = '4.900.0-dev490.
|
|
29535
|
+
let CurrentClientVersion = '4.900.0-dev490.122';
|
|
29520
29536
|
|
|
29521
29537
|
class ClientManager {
|
|
29522
29538
|
constructor() {
|
|
@@ -29777,15 +29793,20 @@ class ClientManager {
|
|
|
29777
29793
|
}
|
|
29778
29794
|
return pic;
|
|
29779
29795
|
}
|
|
29780
|
-
static GetFormattedValue(taskId, controlName, value) {
|
|
29796
|
+
static GetFormattedValue(taskId, controlName, value, rowId) {
|
|
29781
29797
|
let pic = null;
|
|
29782
29798
|
let task = MGDataCollection.Instance.GetTaskByID(taskId);
|
|
29783
29799
|
let control = null;
|
|
29784
29800
|
let newValue = value;
|
|
29785
|
-
if (controlName !== null)
|
|
29801
|
+
if (controlName !== null && task !== null)
|
|
29786
29802
|
control = task.getForm().GetCtrl(controlName);
|
|
29787
29803
|
if (control != null && control.DataType == StorageAttribute.NUMERIC) {
|
|
29788
|
-
|
|
29804
|
+
if (control.isRepeatable() && control.getProp(PropInterface.PROP_TYPE_FORMAT).isExpression()) {
|
|
29805
|
+
let picval = control.getProp(PropInterface.PROP_TYPE_FORMAT).getPrevValue(+rowId);
|
|
29806
|
+
pic = new PIC(picval, StorageAttribute.NUMERIC, control.getForm().getTask().getCompIdx());
|
|
29807
|
+
}
|
|
29808
|
+
else
|
|
29809
|
+
pic = control.getPIC();
|
|
29789
29810
|
let dispValue = String(value);
|
|
29790
29811
|
let newPic = pic.getUnformattedNumericPic();
|
|
29791
29812
|
let num = DisplayConvertor.Instance.toNum(dispValue, newPic, 0);
|
|
@@ -29886,8 +29907,8 @@ class MagicBridge {
|
|
|
29886
29907
|
static GetControlPictureMask(taskId, controlName) {
|
|
29887
29908
|
return ClientManager.GetControlPictureMask(taskId, controlName);
|
|
29888
29909
|
}
|
|
29889
|
-
static GetFormattedValue(taskId, controlName, value) {
|
|
29890
|
-
return ClientManager.GetFormattedValue(taskId, controlName, value);
|
|
29910
|
+
static GetFormattedValue(taskId, controlName, value, rowId) {
|
|
29911
|
+
return ClientManager.GetFormattedValue(taskId, controlName, value, rowId);
|
|
29891
29912
|
}
|
|
29892
29913
|
static GetRangedValue(taskId, controlName, value) {
|
|
29893
29914
|
return ClientManager.GetRangedValue(taskId, controlName, value);
|