@magic-xpa/engine 4.900.0-dev490.24 → 4.900.0-dev490.241

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.
@@ -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
- this._subformTaskId = valueStr;
1208
+ if (valueStr.trim() != "")
1209
+ this._subformTaskId = valueStr;
1209
1210
  break;
1210
1211
  case ConstInterface.MG_ATTR_REFRESHON:
1211
1212
  this.refreshOnString = valueStr.trim();
@@ -6136,6 +6137,8 @@ class LanguageData {
6136
6137
  }
6137
6138
  }
6138
6139
  else if (this._mlsFileUrl != null) {
6140
+ if (this._mlsFileUrl.startsWith("./"))
6141
+ this._mlsFileUrl = NString.Replace(this._mlsFileUrl, './', './assets/cache/');
6139
6142
  let contentStr = await CommandsProcessorManager.GetContent(this._mlsFileUrl, true);
6140
6143
  let buffer = contentStr;
6141
6144
  if (buffer != null && buffer.length > 0) {
@@ -10126,7 +10129,7 @@ class CookieService {
10126
10129
  var cookie = cookies[i];
10127
10130
  var eqPos = cookie.indexOf('=');
10128
10131
  var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
10129
- if (cookieName === decodeURI(name)) {
10132
+ if (cookieName === NString.TrimStart(decodeURI(name))) {
10130
10133
  document.cookie = name + '=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
10131
10134
  return true;
10132
10135
  }
@@ -14196,7 +14199,7 @@ class ExpressionEvaluator extends GuiExpressionEvaluator {
14196
14199
  }
14197
14200
  path = args[3];
14198
14201
  domain = args[4];
14199
- resVal.BoolVal = CookieService.setCookie(cookieName, args[0], nativeDt, path, domain, secure, sameSite);
14202
+ resVal.BoolVal = CookieService.setCookie(cookieName, (args[0] != null ? args[0].toString() : ""), nativeDt, path, domain, secure, sameSite);
14200
14203
  }
14201
14204
  eval_op_get_cookie(cookieName, resVal) {
14202
14205
  resVal.StrVal = CookieService.getCookie(cookieName);
@@ -16262,7 +16265,8 @@ class Field extends FieldBase {
16262
16265
  }
16263
16266
  break;
16264
16267
  case ConstInterface.MG_ATTR_CHACHED_FLD_ID:
16265
- this.CacheTableFldIdx = NNumber.Parse(data[1]);
16268
+ if (data[0] != "")
16269
+ this.CacheTableFldIdx = NNumber.Parse(data[1]);
16266
16270
  break;
16267
16271
  case ConstInterface.MG_ATTR_LOCATE:
16268
16272
  this.Locate = new Boundary(this.getTask(), NNumber.Parse(data[1]), NNumber.Parse(data[0]), this.getType(), this.getSize(), this.CacheTableFldIdx);
@@ -20443,8 +20447,8 @@ class RemoteTaskService extends TaskServiceBase {
20443
20447
  OwnerTransactionTask = task.DataviewManager.RemoteDataviewManager.Transaction.OwnerTask;
20444
20448
  return OwnerTransactionTask;
20445
20449
  }
20446
- static PreparePropMainDisplay(task) {
20447
- task.ComputeMainDisplay();
20450
+ static async PreparePropMainDisplay(task) {
20451
+ await task.ComputeMainDisplay();
20448
20452
  return task.FormIsLegal() ? ReturnResult.SuccessfulResult : new ReturnResult(MsgInterface.BRKTAB_STR_ERR_FORM);
20449
20453
  }
20450
20454
  }
@@ -20844,15 +20848,18 @@ class RemoteDataviewHeader extends DataviewHeaderBase {
20844
20848
  setAttribute(attribute, valueStr) {
20845
20849
  switch (attribute) {
20846
20850
  case ConstInterface.MG_ATTR_CACHED_TABLE:
20847
- if (TableCacheManager.Instance.TableExists(valueStr))
20848
- this._table = TableCacheManager.Instance.GetTableById(valueStr);
20849
- else {
20850
- this._table = new TableCache(valueStr);
20851
- TableCacheManager.Instance.InsertTable(this._table);
20851
+ if (valueStr != "") {
20852
+ if (TableCacheManager.Instance.TableExists(valueStr))
20853
+ this._table = TableCacheManager.Instance.GetTableById(valueStr);
20854
+ else {
20855
+ this._table = new TableCache(valueStr);
20856
+ TableCacheManager.Instance.InsertTable(this._table);
20857
+ }
20852
20858
  }
20853
20859
  break;
20854
20860
  case ConstInterface.MG_ATTR_IDENT:
20855
- this._table.SetTableIdent(valueStr);
20861
+ if (valueStr != "")
20862
+ this._table.SetTableIdent(valueStr);
20856
20863
  break;
20857
20864
  default:
20858
20865
  super.setAttribute(attribute, valueStr);
@@ -21946,9 +21953,17 @@ class RecomputeTable {
21946
21953
  this.fillData_1(task.DataView, task, parser);
21947
21954
  }
21948
21955
  else
21949
- throw new ApplicationException("in RecomputeTable.fillData() invalid task id: ");
21956
+ parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) + 1);
21950
21957
  }
21951
21958
  fillData_1(dataView, task, parser) {
21959
+ if (parser.getNextTag() == XMLConstants.MG_TAG_RECOMPUTE) {
21960
+ let currrentIndex = parser.getCurrIndex();
21961
+ let encoded = parser.ReadContentOfCurrentElement().trim();
21962
+ let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
21963
+ let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
21964
+ parser.setXMLdata(newXmlData);
21965
+ parser.setCurrIndex(currrentIndex);
21966
+ }
21952
21967
  while (this.initInnerObjects(parser, parser.getNextTag(), dataView, task)) {
21953
21968
  }
21954
21969
  }
@@ -22694,10 +22709,12 @@ class Task extends TaskBase {
22694
22709
  this.setDescriptor(valueStr);
22695
22710
  break;
22696
22711
  case ConstInterface.MG_ATTR_HAS_LOCATE:
22697
- this.hasLocate = true;
22712
+ if (+valueStr == 1)
22713
+ this.hasLocate = true;
22698
22714
  break;
22699
22715
  case ConstInterface.MG_ATTR_AS_PARENT:
22700
- this.ModeAsParent = true;
22716
+ if (+valueStr == 1)
22717
+ this.ModeAsParent = true;
22701
22718
  break;
22702
22719
  case ConstInterface.MG_ATTR_TASK_UNIQUE_SORT:
22703
22720
  this.UniqueSort = valueStr[0];
@@ -23024,6 +23041,7 @@ class Task extends TaskBase {
23024
23041
  result = await this.DataviewManager.Execute(dataViewCommand);
23025
23042
  if (!result.Success)
23026
23043
  return null;
23044
+ this.ResumeSubformLayout();
23027
23045
  }
23028
23046
  nonInteractiveTask = await this.StartSubTasks(moveToFirstControl, nonInteractiveTask, callByDestSubForm);
23029
23047
  this.InStartProcess = false;
@@ -24647,16 +24665,16 @@ class Task extends TaskBase {
24647
24665
  }
24648
24666
  }
24649
24667
  }
24650
- ComputeMainDisplay() {
24668
+ async ComputeMainDisplay() {
24651
24669
  let propMainDisplay = this.getProp(PropInterface.PROP_TYPE_MAIN_DISPLAY);
24652
- let mainDisplayIndex = propMainDisplay.GetComputedValueInteger();
24670
+ let mainDisplayIndex = await propMainDisplay.getValueInt();
24653
24671
  mainDisplayIndex = this.GetRealMainDisplayIndexOnCurrentTask(mainDisplayIndex);
24654
24672
  this._forms.InitFormFromXmlString(mainDisplayIndex);
24655
24673
  this.EnsureValidForm();
24656
24674
  }
24657
24675
  async PrepareTaskForm() {
24658
24676
  await TaskServiceBase.PreparePropOpenTaskWindow(this);
24659
- return RemoteTaskService.PreparePropMainDisplay(this);
24677
+ return await RemoteTaskService.PreparePropMainDisplay(this);
24660
24678
  }
24661
24679
  FormIsLegal() {
24662
24680
  let isFormIsLegal = super.isMainProg();
@@ -24725,7 +24743,12 @@ class Task extends TaskBase {
24725
24743
  let tokensVector = XmlParser.getTokens(RuntimeContextBase.Instance.Parser.getXMLsubstring(endTaskUrlIdx), XMLConstants.XML_ATTR_DELIM);
24726
24744
  let taskCacheURL = tokensVector.get_Item(1);
24727
24745
  let refListStr = tokensVector.get_Item(3);
24728
- let taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
24746
+ let taskContentOriginal = "";
24747
+ if (taskCacheURL.trim() != "") {
24748
+ if (taskCacheURL.startsWith("./"))
24749
+ taskCacheURL = NString.Replace(taskCacheURL, './', './assets/cache/');
24750
+ taskContentOriginal = await Task.CommandsProcessor.GetContent(taskCacheURL, true);
24751
+ }
24729
24752
  let taskContentFinal = new StringBuilder(xmlData.substr(0, RuntimeContextBase.Instance.Parser.getCurrIndex() - (ConstInterface.MG_TAG_TASKURL.length + 1)), taskContentOriginal.length);
24730
24753
  let reflist = this.getReflist(refListStr, ';', true, -1);
24731
24754
  let refListIdx = 0;
@@ -26925,7 +26948,7 @@ class EventsManager {
26925
26948
  val = Manager.GetCtrlVal(ctrl);
26926
26949
  task.CurrentEditingControl = null;
26927
26950
  if (!task.cancelWasRaised() &&
26928
- (ctrl.Type !== MgControlType.CTRL_TYPE_BROWSER && (!isNullOrUndefined(ctrl._field) && ctrl._field.getType() === StorageAttribute.DATE || val !== null) && typeof val != 'undefined' &&
26951
+ (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
26952
  !await ctrl.validateAndSetValue(val, true))) {
26930
26953
  this.setStopExecution(true);
26931
26954
  return false;
@@ -29517,7 +29540,7 @@ class CommandsTable {
29517
29540
  }
29518
29541
  }
29519
29542
 
29520
- let CurrentClientVersion = '4.900.0-dev490.24';
29543
+ let CurrentClientVersion = '4.900.0-dev490.241';
29521
29544
 
29522
29545
  class ClientManager {
29523
29546
  constructor() {
@@ -29778,7 +29801,7 @@ class ClientManager {
29778
29801
  }
29779
29802
  return pic;
29780
29803
  }
29781
- static GetFormattedValue(taskId, controlName, value) {
29804
+ static GetFormattedValue(taskId, controlName, value, rowId) {
29782
29805
  let pic = null;
29783
29806
  let task = MGDataCollection.Instance.GetTaskByID(taskId);
29784
29807
  let control = null;
@@ -29786,7 +29809,12 @@ class ClientManager {
29786
29809
  if (controlName !== null && task !== null)
29787
29810
  control = task.getForm().GetCtrl(controlName);
29788
29811
  if (control != null && control.DataType == StorageAttribute.NUMERIC) {
29789
- pic = control.getPIC();
29812
+ if (control.isRepeatable() && control.getProp(PropInterface.PROP_TYPE_FORMAT).isExpression()) {
29813
+ let picval = control.getProp(PropInterface.PROP_TYPE_FORMAT).getPrevValue(+rowId);
29814
+ pic = new PIC(picval, StorageAttribute.NUMERIC, control.getForm().getTask().getCompIdx());
29815
+ }
29816
+ else
29817
+ pic = control.getPIC();
29790
29818
  let dispValue = String(value);
29791
29819
  let newPic = pic.getUnformattedNumericPic();
29792
29820
  let num = DisplayConvertor.Instance.toNum(dispValue, newPic, 0);
@@ -29887,8 +29915,8 @@ class MagicBridge {
29887
29915
  static GetControlPictureMask(taskId, controlName) {
29888
29916
  return ClientManager.GetControlPictureMask(taskId, controlName);
29889
29917
  }
29890
- static GetFormattedValue(taskId, controlName, value) {
29891
- return ClientManager.GetFormattedValue(taskId, controlName, value);
29918
+ static GetFormattedValue(taskId, controlName, value, rowId) {
29919
+ return ClientManager.GetFormattedValue(taskId, controlName, value, rowId);
29892
29920
  }
29893
29921
  static GetRangedValue(taskId, controlName, value) {
29894
29922
  return ClientManager.GetRangedValue(taskId, controlName, value);