@magic-xpa/engine 4.900.0-dev490.9 → 4.900.0-dev490.92
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 +2 -2
- package/esm2020/src/CurrentClientVersion.mjs +2 -2
- 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 +8 -6
- package/esm2020/src/util/Scrambler.mjs +3 -2
- package/esm2020/src/util/cookie.service.mjs +2 -2
- package/fesm2015/magic-xpa-engine.mjs +35 -19
- package/fesm2015/magic-xpa-engine.mjs.map +1 -1
- package/fesm2020/magic-xpa-engine.mjs +28 -16
- package/fesm2020/magic-xpa-engine.mjs.map +1 -1
- package/package.json +4 -4
- 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];
|
|
@@ -24646,16 +24658,16 @@ class Task extends TaskBase {
|
|
|
24646
24658
|
}
|
|
24647
24659
|
}
|
|
24648
24660
|
}
|
|
24649
|
-
ComputeMainDisplay() {
|
|
24661
|
+
async ComputeMainDisplay() {
|
|
24650
24662
|
let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
|
|
24651
|
-
let mainDisplayIndex = propMainDisplay.
|
|
24663
|
+
let mainDisplayIndex = await propMainDisplay.getValueInt();
|
|
24652
24664
|
mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
|
|
24653
24665
|
this._forms.InitFormFromXmlString(mainDisplayIndex);
|
|
24654
24666
|
this.EnsureValidForm();
|
|
24655
24667
|
}
|
|
24656
24668
|
async PrepareTaskForm() {
|
|
24657
24669
|
await TaskServiceBase.PreparePropOpenTaskWindow(this);
|
|
24658
|
-
return RemoteTaskService.PreparePropMainDisplay(this);
|
|
24670
|
+
return await RemoteTaskService.PreparePropMainDisplay(this);
|
|
24659
24671
|
}
|
|
24660
24672
|
FormIsLegal() {
|
|
24661
24673
|
let isFormIsLegal = super.isMainProg();
|
|
@@ -26924,7 +26936,7 @@ class EventsManager {
|
|
|
26924
26936
|
val = Manager.GetCtrlVal(ctrl);
|
|
26925
26937
|
task.CurrentEditingControl = null;
|
|
26926
26938
|
if (!task.cancelWasRaised() &&
|
|
26927
|
-
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && ctrl._field.getType() === StorageAttribute.DATE || val !== null) && typeof val != 'undefined' &&
|
|
26939
|
+
(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
26940
|
!await ctrl.validateAndSetValue(val, true))) {
|
|
26929
26941
|
this.setStopExecution(true);
|
|
26930
26942
|
return false;
|
|
@@ -29516,7 +29528,7 @@ class CommandsTable {
|
|
|
29516
29528
|
}
|
|
29517
29529
|
}
|
|
29518
29530
|
|
|
29519
|
-
let CurrentClientVersion = '4.900.0-dev490.
|
|
29531
|
+
let CurrentClientVersion = '4.900.0-dev490.92';
|
|
29520
29532
|
|
|
29521
29533
|
class ClientManager {
|
|
29522
29534
|
constructor() {
|
|
@@ -29782,7 +29794,7 @@ class ClientManager {
|
|
|
29782
29794
|
let task = MGDataCollection.Instance.GetTaskByID(taskId);
|
|
29783
29795
|
let control = null;
|
|
29784
29796
|
let newValue = value;
|
|
29785
|
-
if (controlName !== null)
|
|
29797
|
+
if (controlName !== null && task !== null)
|
|
29786
29798
|
control = task.getForm().GetCtrl(controlName);
|
|
29787
29799
|
if (control != null && control.DataType == StorageAttribute.NUMERIC) {
|
|
29788
29800
|
pic = control.getPIC();
|