@magic-xpa/engine 4.900.0-dev490.21 → 4.900.0-dev490.211
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 +9 -4
- package/esm2020/src/CurrentClientVersion.mjs +2 -2
- package/esm2020/src/bridge/MagicBridge.mjs +3 -3
- package/esm2020/src/data/Field.mjs +3 -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 +12 -4
- package/esm2020/src/rt/RemoteDataviewHeader.mjs +10 -7
- package/esm2020/src/tasks/RemoteTaskService.mjs +3 -3
- package/esm2020/src/tasks/Task.mjs +15 -7
- package/esm2020/src/util/cookie.service.mjs +2 -2
- package/fesm2015/magic-xpa-engine.mjs +60 -30
- package/fesm2015/magic-xpa-engine.mjs.map +1 -1
- package/fesm2020/magic-xpa-engine.mjs +53 -27
- 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();
|
|
@@ -9262,8 +9263,8 @@ class Operation {
|
|
|
9262
9263
|
if (rtEvnt !== null) {
|
|
9263
9264
|
this._routeParams = rtEvnt.getRouteParamList();
|
|
9264
9265
|
if ((await rtEvnt.getArgList().getArg(0).getValue(StorageAttribute.ALPHA, 0)).trim() === this._routerPath &&
|
|
9265
|
-
((rtEvnt.getArgList().getArg(1).skipArg()) ||
|
|
9266
|
-
(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)))
|
|
9267
9268
|
canRoute = true;
|
|
9268
9269
|
if (!canRoute)
|
|
9269
9270
|
return false;
|
|
@@ -10126,7 +10127,7 @@ class CookieService {
|
|
|
10126
10127
|
var cookie = cookies[i];
|
|
10127
10128
|
var eqPos = cookie.indexOf('=');
|
|
10128
10129
|
var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
|
|
10129
|
-
if (cookieName === decodeURI(name)) {
|
|
10130
|
+
if (cookieName === NString.TrimStart(decodeURI(name))) {
|
|
10130
10131
|
document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
|
|
10131
10132
|
return true;
|
|
10132
10133
|
}
|
|
@@ -14196,7 +14197,7 @@ class ExpressionEvaluator extends GuiExpressionEvaluator {
|
|
|
14196
14197
|
}
|
|
14197
14198
|
path = args[3];
|
|
14198
14199
|
domain = args[4];
|
|
14199
|
-
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);
|
|
14200
14201
|
}
|
|
14201
14202
|
eval_op_get_cookie(cookieName, resVal) {
|
|
14202
14203
|
resVal.StrVal = CookieService.getCookie(cookieName);
|
|
@@ -16262,7 +16263,8 @@ class Field extends FieldBase {
|
|
|
16262
16263
|
}
|
|
16263
16264
|
break;
|
|
16264
16265
|
case ConstInterface.MG_ATTR_CHACHED_FLD_ID:
|
|
16265
|
-
|
|
16266
|
+
if (data[0] != "")
|
|
16267
|
+
this.CacheTableFldIdx = NNumber.Parse(data[1]);
|
|
16266
16268
|
break;
|
|
16267
16269
|
case ConstInterface.MG_ATTR_LOCATE:
|
|
16268
16270
|
this.Locate = new Boundary(this.getTask(), NNumber.Parse(data[1]), NNumber.Parse(data[0]), this.getType(), this.getSize(), this.CacheTableFldIdx);
|
|
@@ -20443,8 +20445,8 @@ class RemoteTaskService extends TaskServiceBase {
|
|
|
20443
20445
|
OwnerTransactionTask = task.DataviewManager.RemoteDataviewManager.Transaction.OwnerTask;
|
|
20444
20446
|
return OwnerTransactionTask;
|
|
20445
20447
|
}
|
|
20446
|
-
static PreparePropMainDisplay(task) {
|
|
20447
|
-
task.ComputeMainDisplay();
|
|
20448
|
+
static async PreparePropMainDisplay(task) {
|
|
20449
|
+
await task.ComputeMainDisplay();
|
|
20448
20450
|
return task.FormIsLegal() ? ReturnResult.SuccessfulResult : new ReturnResult(MsgInterface.BRKTAB_STR_ERR_FORM);
|
|
20449
20451
|
}
|
|
20450
20452
|
}
|
|
@@ -20844,15 +20846,18 @@ class RemoteDataviewHeader extends DataviewHeaderBase {
|
|
|
20844
20846
|
setAttribute(attribute, valueStr) {
|
|
20845
20847
|
switch (attribute) {
|
|
20846
20848
|
case ConstInterface.MG_ATTR_CACHED_TABLE:
|
|
20847
|
-
if (
|
|
20848
|
-
|
|
20849
|
-
|
|
20850
|
-
|
|
20851
|
-
|
|
20849
|
+
if (valueStr != "") {
|
|
20850
|
+
if (TableCacheManager.Instance.TableExists(valueStr))
|
|
20851
|
+
this._table = TableCacheManager.Instance.GetTableById(valueStr);
|
|
20852
|
+
else {
|
|
20853
|
+
this._table = new TableCache(valueStr);
|
|
20854
|
+
TableCacheManager.Instance.InsertTable(this._table);
|
|
20855
|
+
}
|
|
20852
20856
|
}
|
|
20853
20857
|
break;
|
|
20854
20858
|
case ConstInterface.MG_ATTR_IDENT:
|
|
20855
|
-
|
|
20859
|
+
if (valueStr != "")
|
|
20860
|
+
this._table.SetTableIdent(valueStr);
|
|
20856
20861
|
break;
|
|
20857
20862
|
default:
|
|
20858
20863
|
super.setAttribute(attribute, valueStr);
|
|
@@ -21946,9 +21951,17 @@ class RecomputeTable {
|
|
|
21946
21951
|
this.fillData_1(task.DataView, task, parser);
|
|
21947
21952
|
}
|
|
21948
21953
|
else
|
|
21949
|
-
|
|
21954
|
+
parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) + 1);
|
|
21950
21955
|
}
|
|
21951
21956
|
fillData_1(dataView, task, parser) {
|
|
21957
|
+
if (parser.getNextTag() == XMLConstants.MG_TAG_RECOMPUTE) {
|
|
21958
|
+
let currrentIndex = parser.getCurrIndex();
|
|
21959
|
+
let encoded = parser.ReadContentOfCurrentElement().trim();
|
|
21960
|
+
let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
|
|
21961
|
+
let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
|
|
21962
|
+
parser.setXMLdata(newXmlData);
|
|
21963
|
+
parser.setCurrIndex(currrentIndex);
|
|
21964
|
+
}
|
|
21952
21965
|
while (this.initInnerObjects(parser, parser.getNextTag(), dataView, task)) {
|
|
21953
21966
|
}
|
|
21954
21967
|
}
|
|
@@ -22694,10 +22707,12 @@ class Task extends TaskBase {
|
|
|
22694
22707
|
this.setDescriptor(valueStr);
|
|
22695
22708
|
break;
|
|
22696
22709
|
case ConstInterface.MG_ATTR_HAS_LOCATE:
|
|
22697
|
-
|
|
22710
|
+
if (+valueStr == 1)
|
|
22711
|
+
this.hasLocate = true;
|
|
22698
22712
|
break;
|
|
22699
22713
|
case ConstInterface.MG_ATTR_AS_PARENT:
|
|
22700
|
-
|
|
22714
|
+
if (+valueStr == 1)
|
|
22715
|
+
this.ModeAsParent = true;
|
|
22701
22716
|
break;
|
|
22702
22717
|
case ConstInterface.MG_ATTR_TASK_UNIQUE_SORT:
|
|
22703
22718
|
this.UniqueSort = valueStr[0];
|
|
@@ -23024,6 +23039,7 @@ class Task extends TaskBase {
|
|
|
23024
23039
|
result = await this.DataviewManager.Execute(dataViewCommand);
|
|
23025
23040
|
if (!result.Success)
|
|
23026
23041
|
return null;
|
|
23042
|
+
this.ResumeSubformLayout();
|
|
23027
23043
|
}
|
|
23028
23044
|
nonInteractiveTask = await this.StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm);
|
|
23029
23045
|
this.InStartProcess = false;
|
|
@@ -24647,16 +24663,16 @@ class Task extends TaskBase {
|
|
|
24647
24663
|
}
|
|
24648
24664
|
}
|
|
24649
24665
|
}
|
|
24650
|
-
ComputeMainDisplay() {
|
|
24666
|
+
async ComputeMainDisplay() {
|
|
24651
24667
|
let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
|
|
24652
|
-
let mainDisplayIndex = propMainDisplay.
|
|
24668
|
+
let mainDisplayIndex = await propMainDisplay.getValueInt();
|
|
24653
24669
|
mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
|
|
24654
24670
|
this._forms.InitFormFromXmlString(mainDisplayIndex);
|
|
24655
24671
|
this.EnsureValidForm();
|
|
24656
24672
|
}
|
|
24657
24673
|
async PrepareTaskForm() {
|
|
24658
24674
|
await TaskServiceBase.PreparePropOpenTaskWindow(this);
|
|
24659
|
-
return RemoteTaskService.PreparePropMainDisplay(this);
|
|
24675
|
+
return await RemoteTaskService.PreparePropMainDisplay(this);
|
|
24660
24676
|
}
|
|
24661
24677
|
FormIsLegal() {
|
|
24662
24678
|
let isFormIsLegal = super.isMainProg();
|
|
@@ -24725,7 +24741,12 @@ class Task extends TaskBase {
|
|
|
24725
24741
|
let tokensVector = XmlParser.getTokens(RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx), XMLConstants.XML_ATTR_DELIM);
|
|
24726
24742
|
let taskCacheURL = tokensVector.get_Item(1);
|
|
24727
24743
|
let refListStr = tokensVector.get_Item(3);
|
|
24728
|
-
let taskContentOriginal =
|
|
24744
|
+
let taskContentOriginal = "";
|
|
24745
|
+
if (taskCacheURL.trim() != "") {
|
|
24746
|
+
if (taskCacheURL.startsWith("./"))
|
|
24747
|
+
taskCacheURL = NString.Replace(taskCacheURL, './', './assets/cache/');
|
|
24748
|
+
taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
|
|
24749
|
+
}
|
|
24729
24750
|
let taskContentFinal = new StringBuilder(xmlData.substr(0, RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1)), taskContentOriginal.length);
|
|
24730
24751
|
let reflist = this.getReflist(refListStr, ';', true, -1);
|
|
24731
24752
|
let refListIdx = 0;
|
|
@@ -26925,7 +26946,7 @@ class EventsManager {
|
|
|
26925
26946
|
val = Manager.GetCtrlVal(ctrl);
|
|
26926
26947
|
task.CurrentEditingControl = null;
|
|
26927
26948
|
if (!task.cancelWasRaised() &&
|
|
26928
|
-
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && ctrl._field.getType() === StorageAttribute.DATE || val !== null) && typeof val != 'undefined' &&
|
|
26949
|
+
(ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && (ctrl._field.getType() === StorageAttribute.DATE || ctrl._field.getType() == StorageAttribute.NUMERIC) || val !== null) && typeof val != 'undefined' &&
|
|
26929
26950
|
!await ctrl.validateAndSetValue(val, true))) {
|
|
26930
26951
|
this.setStopExecution(true);
|
|
26931
26952
|
return false;
|
|
@@ -29517,7 +29538,7 @@ class CommandsTable {
|
|
|
29517
29538
|
}
|
|
29518
29539
|
}
|
|
29519
29540
|
|
|
29520
|
-
let CurrentClientVersion = '4.900.0-dev490.
|
|
29541
|
+
let CurrentClientVersion = '4.900.0-dev490.211';
|
|
29521
29542
|
|
|
29522
29543
|
class ClientManager {
|
|
29523
29544
|
constructor() {
|
|
@@ -29778,7 +29799,7 @@ class ClientManager {
|
|
|
29778
29799
|
}
|
|
29779
29800
|
return pic;
|
|
29780
29801
|
}
|
|
29781
|
-
static GetFormattedValue(taskId, controlName, value) {
|
|
29802
|
+
static GetFormattedValue(taskId, controlName, value, rowId) {
|
|
29782
29803
|
let pic = null;
|
|
29783
29804
|
let task = MGDataCollection.Instance.GetTaskByID(taskId);
|
|
29784
29805
|
let control = null;
|
|
@@ -29786,7 +29807,12 @@ class ClientManager {
|
|
|
29786
29807
|
if (controlName !== null && task !== null)
|
|
29787
29808
|
control = task.getForm().GetCtrl(controlName);
|
|
29788
29809
|
if (control != null && control.DataType == StorageAttribute.NUMERIC) {
|
|
29789
|
-
|
|
29810
|
+
if (control.isRepeatable() && control.getProp(PropInterface.PROP_TYPE_FORMAT).isExpression()) {
|
|
29811
|
+
let picval = control.getProp(PropInterface.PROP_TYPE_FORMAT).getPrevValue(+rowId);
|
|
29812
|
+
pic = new PIC(picval, StorageAttribute.NUMERIC, control.getForm().getTask().getCompIdx());
|
|
29813
|
+
}
|
|
29814
|
+
else
|
|
29815
|
+
pic = control.getPIC();
|
|
29790
29816
|
let dispValue = String(value);
|
|
29791
29817
|
let newPic = pic.getUnformattedNumericPic();
|
|
29792
29818
|
let num = DisplayConvertor.Instance.toNum(dispValue, newPic, 0);
|
|
@@ -29887,8 +29913,8 @@ class MagicBridge {
|
|
|
29887
29913
|
static GetControlPictureMask(taskId, controlName) {
|
|
29888
29914
|
return ClientManager.GetControlPictureMask(taskId, controlName);
|
|
29889
29915
|
}
|
|
29890
|
-
static GetFormattedValue(taskId, controlName, value) {
|
|
29891
|
-
return ClientManager.GetFormattedValue(taskId, controlName, value);
|
|
29916
|
+
static GetFormattedValue(taskId, controlName, value, rowId) {
|
|
29917
|
+
return ClientManager.GetFormattedValue(taskId, controlName, value, rowId);
|
|
29892
29918
|
}
|
|
29893
29919
|
static GetRangedValue(taskId, controlName, value) {
|
|
29894
29920
|
return ClientManager.GetRangedValue(taskId, controlName, value);
|