@magic-xpa/gui 4.900.0-dev490.28 → 4.900.0-dev490.281

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.
@@ -1238,13 +1238,11 @@ class Commands {
1238
1238
  guiCommand.number = num;
1239
1239
  GuiCommandQueue.getInstance().addCommand(guiCommand);
1240
1240
  }
1241
- static addValueWithLine(commandType, obj, line, value, reset = false) {
1241
+ static addValueWithLine(commandType, obj, line, value) {
1242
1242
  let guiCommand = new GuiCommand(obj, commandType);
1243
1243
  guiCommand.value = value;
1244
1244
  guiCommand.line = line;
1245
1245
  if (commandType === CommandType.SET_VALUE) {
1246
- if (reset)
1247
- guiCommand.Bool1 = reset;
1248
1246
  if (obj instanceof GuiMgControl && obj.isChoiceControl()) {
1249
1247
  if (value < 0)
1250
1248
  guiCommand.value = '';
@@ -1601,7 +1599,7 @@ class Manager {
1601
1599
  }
1602
1600
  static SetReadOnlyControl(ctrl, isReadOnly) {
1603
1601
  return __awaiter(this, void 0, void 0, function* () {
1604
- if (ctrl.isTextControl() || ctrl.IsRepeatable) {
1602
+ if (ctrl.isTextControl() || ctrl.IsRepeatable || ctrl.isComboBox() || ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isRadio()) {
1605
1603
  if (UtilStrByteMode.isLocaleDefLangDBCS()) {
1606
1604
  if (yield ctrl.getForm().getTask().checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY, false))
1607
1605
  return;
@@ -2032,6 +2030,7 @@ class PIC {
2032
2030
  this._maskChars = 0;
2033
2031
  this._maskSize = 0;
2034
2032
  this._mixed = false;
2033
+ this._formatExp = false;
2035
2034
  this._msk = null;
2036
2035
  this._needLength = false;
2037
2036
  this._negative = false;
@@ -2119,6 +2118,12 @@ class PIC {
2119
2118
  decInFirstPos() {
2120
2119
  return this._decPointIsFirst;
2121
2120
  }
2121
+ setFormatExp(val) {
2122
+ this._formatExp = val;
2123
+ }
2124
+ isFormatExp() {
2125
+ return this._formatExp;
2126
+ }
2122
2127
  getPosPref_() {
2123
2128
  return this._posPref.ToString();
2124
2129
  }
@@ -5647,25 +5652,16 @@ class DisplayConvertor {
5647
5652
  case PICInterface.PIC_YY:
5648
5653
  {
5649
5654
  this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5650
- let yearStr = NString.FromChars(outVal);
5651
- year = +yearStr.substr(outIdx);
5652
- outIdx += 2;
5653
- len -= 2;
5654
- }
5655
- break;
5656
- case PICInterface.PIC_YY:
5657
- {
5658
- this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5659
- let yearStr = NString.FromChars(outVal);
5660
- year = +yearStr.substr(outIdx);
5655
+ let yearStr = NString.FromChars(outVal, outIdx, 2);
5656
+ year = +yearStr;
5661
5657
  outIdx += 2;
5662
5658
  len -= 2;
5663
5659
  }
5664
5660
  break;
5665
5661
  case PICInterface.PIC_YYYY:
5666
- this.int_2_a(outVal, outIdx, 4, year, '0');
5667
- let yearStr = NString.FromChars(outVal);
5668
- year = +yearStr.substr(outIdx);
5662
+ this.int_2_a(outVal, outIdx, 4, breakParams.year, '0');
5663
+ let yearStr = NString.FromChars(outVal, outIdx, 4);
5664
+ year = +yearStr;
5669
5665
  outIdx += 4;
5670
5666
  len -= 4;
5671
5667
  break;
@@ -9850,7 +9846,7 @@ class Property {
9850
9846
  return __awaiter(this, void 0, void 0, function* () {
9851
9847
  if (this._parentType === GuiConstants.PARENT_TYPE_CONTROL) {
9852
9848
  let ctrl = this._parentObj;
9853
- if (ctrl.isTextControl()) {
9849
+ if (ctrl.isTextControl() || ctrl.isChoiceControl() || ctrl.isCheckBox()) {
9854
9850
  let task = this.GetTaskByParentObject();
9855
9851
  let readOnlyValue = !this.GetComputedValueBoolean();
9856
9852
  if ((readOnlyValue || task.getMode() !== Constants.TASK_MODE_QUERY) && ctrl.GetCurrReadOnly() !== readOnlyValue) {
@@ -10441,7 +10437,7 @@ class FieldValidator {
10441
10437
  return valDet;
10442
10438
  }
10443
10439
  if (ctrl.DataType !== StorageAttribute.ALPHA && ctrl.DataType !== StorageAttribute.UNICODE && ctrl.DataType !== StorageAttribute.BLOB) {
10444
- if ((typeof this._newvalue === 'string' && this._newvalue.trim().length === 0) || (ctrl.DataType === StorageAttribute.DATE && (ctrl.isDateZero(this._newvalue) || this.isNullDisplayVal()))) {
10440
+ if ((typeof this._newvalue === 'string' && this._newvalue.trim().length === 0) || (ctrl.DataType == StorageAttribute.NUMERIC && this._newvalue == null) || (ctrl.DataType === StorageAttribute.DATE && (ctrl.isDateZero(this._newvalue) || this.isNullDisplayVal()))) {
10445
10441
  let field = ctrl.getField();
10446
10442
  let defaultValue = field.getDefaultValue();
10447
10443
  let text = null;
@@ -11637,7 +11633,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11637
11633
  this._firstRefreshProperties = true;
11638
11634
  this._form = null;
11639
11635
  this._hasValidItmAndDispVal = false;
11640
- this._id = -1;
11641
11636
  this._controlIsn = -1;
11642
11637
  this._linkedParentDitIdx = -1;
11643
11638
  this._orgChoiceDisps = null;
@@ -11680,9 +11675,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11680
11675
  get Form() {
11681
11676
  return this._form;
11682
11677
  }
11683
- get Id() {
11684
- return this._id;
11685
- }
11686
11678
  get ControlIsn() {
11687
11679
  return this._controlIsn;
11688
11680
  }
@@ -11908,9 +11900,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11908
11900
  case XMLConstants.MG_ATTR_CONTAINER:
11909
11901
  this.setContainer(XmlParser.getInt(valueStr));
11910
11902
  break;
11911
- case XMLConstants.MG_ATTR_ID:
11912
- this._id = XmlParser.getInt(valueStr);
11913
- break;
11914
11903
  case XMLConstants.MG_ATTR_CONTROL_ISN:
11915
11904
  this._controlIsn = XmlParser.getInt(valueStr);
11916
11905
  break;
@@ -12045,6 +12034,8 @@ class MgControlBase extends GuiControlPropertyAdapter {
12045
12034
  }
12046
12035
  }
12047
12036
  getPIC() {
12037
+ if (this._picExpExists)
12038
+ this._pic.setFormatExp(this._picExpExists);
12048
12039
  return this._pic;
12049
12040
  }
12050
12041
  getParent() {
@@ -12123,7 +12114,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12123
12114
  }
12124
12115
  getRangedValue(newVal) {
12125
12116
  let vd;
12126
- vd = this.buildCopyPicture(this.Value, newVal);
12117
+ vd = this.buildPicture(this.Value, newVal);
12127
12118
  vd.evaluate();
12128
12119
  this.ModifiedByUser = true;
12129
12120
  let val = vd.getDispValue();
@@ -12133,7 +12124,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12133
12124
  let vd;
12134
12125
  let modified = this.ModifiedByUser;
12135
12126
  this.ModifiedByUser = true;
12136
- vd = this.buildCopyPicture(this.Value, newVal);
12127
+ vd = this.buildPicture(this.Value, newVal);
12137
12128
  vd.evaluate();
12138
12129
  this.ModifiedByUser = modified;
12139
12130
  if (vd.ValidationFailed)
@@ -12472,12 +12463,8 @@ class MgControlBase extends GuiControlPropertyAdapter {
12472
12463
  if (super.isButton()) {
12473
12464
  mlsTranslatedValue = Events.Translate(this.Value);
12474
12465
  }
12475
- if (this.isTextControl() || this.isButton()) {
12476
- if (this.isTextControl() && this.getForm().inRefreshDisplay() && this.DataType == StorageAttribute.NUMERIC)
12477
- Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue, true);
12478
- else
12479
- Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue);
12480
- }
12466
+ if (this.isTextControl() || this.isButton())
12467
+ Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue);
12481
12468
  else
12482
12469
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, displayLine, HtmlProperties.Text, mlsTranslatedValue);
12483
12470
  }
@@ -13211,6 +13198,11 @@ class MgControlBase extends GuiControlPropertyAdapter {
13211
13198
  if (prevMustInput !== (yield this.checkProp(PropInterface.PROP_TYPE_MUST_INPUT, false)))
13212
13199
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, !prevMustInput);
13213
13200
  }
13201
+ else if (mustInputProperty != null) {
13202
+ let mustInputVal = this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_MUST_INPUT, false);
13203
+ if (mustInputVal)
13204
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, mustInputVal);
13205
+ }
13214
13206
  if (!this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_TAB_IN, true))
13215
13207
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.TabIndex, -1);
13216
13208
  }
@@ -13559,15 +13551,17 @@ class MgControlBase extends GuiControlPropertyAdapter {
13559
13551
  return __awaiter(this, void 0, void 0, function* () {
13560
13552
  if (this.isTextControl() && this.checkIfExistProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)) {
13561
13553
  let connectedButton = this.Form.CtrlTab.GetControlByIsn((yield (yield this.getProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)).getValueInt()));
13562
- let imageFileName = null;
13563
- if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13564
- imageFileName = yield (yield connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13565
- if (!Misc.IsWebUrl(imageFileName))
13566
- imageFileName = "./assets/images/" + imageFileName;
13567
- Commands.addOperationWithLine(CommandType.SET_STYLE, this, 0, MagicProperties.ImageFile, imageFileName);
13554
+ if (connectedButton) {
13555
+ let imageFileName = null;
13556
+ if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13557
+ imageFileName = yield (yield connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13558
+ if (!Misc.IsWebUrl(imageFileName))
13559
+ imageFileName = "./assets/images/" + imageFileName;
13560
+ Commands.addOperationWithLine(CommandType.SET_STYLE, this, 0, MagicProperties.ImageFile, imageFileName);
13561
+ }
13562
+ this.ConnectedControl = connectedButton;
13563
+ connectedButton.ConnectedControl = this;
13568
13564
  }
13569
- this.ConnectedControl = connectedButton;
13570
- connectedButton.ConnectedControl = this;
13571
13565
  }
13572
13566
  });
13573
13567
  }
@@ -14129,13 +14123,8 @@ class MgFormBase extends GuiFormPropertyAdapter {
14129
14123
  if (idx >= 0 && idx < this.Rows.length)
14130
14124
  this.Rows.set_Item(idx, new Row(false, false));
14131
14125
  }
14132
- SelectRow(sendAlwaysOrRowIdx, sendAlways) {
14133
- if (arguments.length === 0)
14134
- this.SelectRow_0();
14135
- else if (arguments.length === 1)
14136
- this.SelectRow_1(sendAlwaysOrRowIdx);
14137
- else
14138
- this.SelectRow_2(sendAlwaysOrRowIdx, sendAlways);
14126
+ SelectRow() {
14127
+ this.SelectRowByIdx(this.DisplayLine);
14139
14128
  }
14140
14129
  getRowsInPage() {
14141
14130
  return this._rowsInPage;
@@ -14375,19 +14364,13 @@ class MgFormBase extends GuiFormPropertyAdapter {
14375
14364
  this.Rows.SetSize(idx + 1);
14376
14365
  this.Rows.set_Item(idx, new Row(true, true));
14377
14366
  }
14378
- SelectRow_0() {
14379
- this.SelectRow(false);
14380
- }
14381
- SelectRow_1(sendAlways) {
14382
- this.SelectRow(this.DisplayLine, sendAlways);
14383
- }
14384
- SelectRow_2(rowIdx, sendAlways) {
14367
+ SelectRowByIdx(rowIdx) {
14385
14368
  let mainControl = this.getMainControl();
14386
14369
  if (mainControl !== null && this.RefreshRepeatableAllowed) {
14387
14370
  let index = rowIdx;
14388
14371
  if (this._task.DataView.isEmptyDataview())
14389
14372
  index = GuiConstants.NO_ROW_SELECTED;
14390
- if (sendAlways || index !== this._prevSelIndex) {
14373
+ if (index !== this._prevSelIndex) {
14391
14374
  this._prevSelIndex = index;
14392
14375
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, mainControl, 0, HtmlProperties.SelectedRow, index);
14393
14376
  }
@@ -15621,9 +15604,16 @@ class Helps {
15621
15604
  initInnerObjects(foundTagName, parser) {
15622
15605
  if (foundTagName === null)
15623
15606
  return false;
15624
- if (foundTagName === XMLConstants.MG_TAG_HELPTABLE)
15607
+ if (foundTagName === XMLConstants.MG_TAG_HELPTABLE) {
15608
+ let currrentIndex = parser.getCurrIndex();
15609
+ let encoded = parser.ReadContentOfCurrentElement().trim();
15610
+ let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
15611
+ let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
15612
+ parser.setXMLdata(newXmlData);
15613
+ parser.setCurrIndex(currrentIndex);
15625
15614
  parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
15626
15615
  1);
15616
+ }
15627
15617
  else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
15628
15618
  let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
15629
15619
  if (endContext !== -1 && endContext < parser.getXMLdata().length) {
@@ -15783,16 +15773,17 @@ class GuiTaskBase {
15783
15773
  constructor() {
15784
15774
  this._flowMonitor = null;
15785
15775
  this._keyboardMappingState = 0xFFFF0000;
15786
- this._refreshType = 'T';
15776
+ this._refreshType = "T";
15787
15777
  this._lastParkedCtrl = null;
15788
15778
  this._brkLevel = null;
15789
15779
  this._brkLevelIndex = -1;
15790
15780
  this._mainLevel = null;
15791
- this._level = '\0';
15781
+ this._level = "\0";
15792
15782
  this._enteredRecLevel = false;
15793
15783
  this._currParkedFld = null;
15794
15784
  this.isInRecompute = false;
15795
15785
  this.CurrentEditingControl = null;
15786
+ this.shouldResumeSubformLayout = true;
15796
15787
  this.ApplicationGuid = null;
15797
15788
  this.ProgramIsn = 0;
15798
15789
  this.TaskIsn = 0;
@@ -15942,7 +15933,7 @@ class GuiTaskBase {
15942
15933
  return this._helpTab.getHelp(idx);
15943
15934
  }
15944
15935
  setProp(propId, val) {
15945
- this._propTab.setProp(propId, val, this, 'T');
15936
+ this._propTab.setProp(propId, val, this, "T");
15946
15937
  }
15947
15938
  setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
15948
15939
  this._brkLevel = cBrkLevel;
@@ -16050,6 +16041,15 @@ class GuiTaskBase {
16050
16041
  }
16051
16042
  });
16052
16043
  }
16044
+ ResumeSubformLayout() {
16045
+ if (this.Form !== null) {
16046
+ let subFormCtrl = this.Form.getSubFormCtrl();
16047
+ if (subFormCtrl !== null && this.shouldResumeSubformLayout) {
16048
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, subFormCtrl, 0, HtmlProperties.Visible, subFormCtrl.isVisible());
16049
+ this.shouldResumeSubformLayout = false;
16050
+ }
16051
+ }
16052
+ }
16053
16053
  GetLastParkedCtrlName(depth) {
16054
16054
  let ancestor = this.GetTaskAncestor(depth);
16055
16055
  if (ancestor === null || ancestor._lastParkedCtrl === null)
@@ -16113,7 +16113,7 @@ class GuiTaskBase {
16113
16113
  }
16114
16114
  CalculateExpression(expId, resType, length) {
16115
16115
  return __awaiter(this, void 0, void 0, function* () {
16116
- return Promise.resolve('');
16116
+ return Promise.resolve("");
16117
16117
  });
16118
16118
  }
16119
16119
  isStarted() {
@@ -16201,7 +16201,8 @@ class GuiTaskBase {
16201
16201
  this.IsParallel = XmlParser.getBoolean(valueStr);
16202
16202
  break;
16203
16203
  case XMLConstants.MG_ATTR_ROUTER_PATH:
16204
- this.routerPath = valueStr;
16204
+ if (valueStr.trim() != "")
16205
+ this.routerPath = valueStr;
16205
16206
  break;
16206
16207
  case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
16207
16208
  this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);