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

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;
@@ -5647,25 +5645,16 @@ class DisplayConvertor {
5647
5645
  case PICInterface.PIC_YY:
5648
5646
  {
5649
5647
  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);
5648
+ let yearStr = NString.FromChars(outVal, outIdx, 2);
5649
+ year = +yearStr;
5661
5650
  outIdx += 2;
5662
5651
  len -= 2;
5663
5652
  }
5664
5653
  break;
5665
5654
  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);
5655
+ this.int_2_a(outVal, outIdx, 4, breakParams.year, '0');
5656
+ let yearStr = NString.FromChars(outVal, outIdx, 4);
5657
+ year = +yearStr;
5669
5658
  outIdx += 4;
5670
5659
  len -= 4;
5671
5660
  break;
@@ -9850,7 +9839,7 @@ class Property {
9850
9839
  return __awaiter(this, void 0, void 0, function* () {
9851
9840
  if (this._parentType === GuiConstants.PARENT_TYPE_CONTROL) {
9852
9841
  let ctrl = this._parentObj;
9853
- if (ctrl.isTextControl()) {
9842
+ if (ctrl.isTextControl() || ctrl.isChoiceControl() || ctrl.isCheckBox()) {
9854
9843
  let task = this.GetTaskByParentObject();
9855
9844
  let readOnlyValue = !this.GetComputedValueBoolean();
9856
9845
  if ((readOnlyValue || task.getMode() !== Constants.TASK_MODE_QUERY) && ctrl.GetCurrReadOnly() !== readOnlyValue) {
@@ -10441,7 +10430,7 @@ class FieldValidator {
10441
10430
  return valDet;
10442
10431
  }
10443
10432
  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()))) {
10433
+ 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
10434
  let field = ctrl.getField();
10446
10435
  let defaultValue = field.getDefaultValue();
10447
10436
  let text = null;
@@ -11637,7 +11626,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11637
11626
  this._firstRefreshProperties = true;
11638
11627
  this._form = null;
11639
11628
  this._hasValidItmAndDispVal = false;
11640
- this._id = -1;
11641
11629
  this._controlIsn = -1;
11642
11630
  this._linkedParentDitIdx = -1;
11643
11631
  this._orgChoiceDisps = null;
@@ -11680,9 +11668,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11680
11668
  get Form() {
11681
11669
  return this._form;
11682
11670
  }
11683
- get Id() {
11684
- return this._id;
11685
- }
11686
11671
  get ControlIsn() {
11687
11672
  return this._controlIsn;
11688
11673
  }
@@ -11908,9 +11893,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11908
11893
  case XMLConstants.MG_ATTR_CONTAINER:
11909
11894
  this.setContainer(XmlParser.getInt(valueStr));
11910
11895
  break;
11911
- case XMLConstants.MG_ATTR_ID:
11912
- this._id = XmlParser.getInt(valueStr);
11913
- break;
11914
11896
  case XMLConstants.MG_ATTR_CONTROL_ISN:
11915
11897
  this._controlIsn = XmlParser.getInt(valueStr);
11916
11898
  break;
@@ -12123,7 +12105,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12123
12105
  }
12124
12106
  getRangedValue(newVal) {
12125
12107
  let vd;
12126
- vd = this.buildCopyPicture(this.Value, newVal);
12108
+ vd = this.buildPicture(this.Value, newVal);
12127
12109
  vd.evaluate();
12128
12110
  this.ModifiedByUser = true;
12129
12111
  let val = vd.getDispValue();
@@ -12133,7 +12115,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12133
12115
  let vd;
12134
12116
  let modified = this.ModifiedByUser;
12135
12117
  this.ModifiedByUser = true;
12136
- vd = this.buildCopyPicture(this.Value, newVal);
12118
+ vd = this.buildPicture(this.Value, newVal);
12137
12119
  vd.evaluate();
12138
12120
  this.ModifiedByUser = modified;
12139
12121
  if (vd.ValidationFailed)
@@ -12472,12 +12454,8 @@ class MgControlBase extends GuiControlPropertyAdapter {
12472
12454
  if (super.isButton()) {
12473
12455
  mlsTranslatedValue = Events.Translate(this.Value);
12474
12456
  }
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
- }
12457
+ if (this.isTextControl() || this.isButton())
12458
+ Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue);
12481
12459
  else
12482
12460
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, displayLine, HtmlProperties.Text, mlsTranslatedValue);
12483
12461
  }
@@ -13211,6 +13189,11 @@ class MgControlBase extends GuiControlPropertyAdapter {
13211
13189
  if (prevMustInput !== (yield this.checkProp(PropInterface.PROP_TYPE_MUST_INPUT, false)))
13212
13190
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, !prevMustInput);
13213
13191
  }
13192
+ else if (mustInputProperty != null) {
13193
+ let mustInputVal = this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_MUST_INPUT, false);
13194
+ if (mustInputVal)
13195
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, mustInputVal);
13196
+ }
13214
13197
  if (!this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_TAB_IN, true))
13215
13198
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.TabIndex, -1);
13216
13199
  }
@@ -13559,15 +13542,17 @@ class MgControlBase extends GuiControlPropertyAdapter {
13559
13542
  return __awaiter(this, void 0, void 0, function* () {
13560
13543
  if (this.isTextControl() && this.checkIfExistProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)) {
13561
13544
  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);
13545
+ if (connectedButton) {
13546
+ let imageFileName = null;
13547
+ if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13548
+ imageFileName = yield (yield connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13549
+ if (!Misc.IsWebUrl(imageFileName))
13550
+ imageFileName = "./assets/images/" + imageFileName;
13551
+ Commands.addOperationWithLine(CommandType.SET_STYLE, this, 0, MagicProperties.ImageFile, imageFileName);
13552
+ }
13553
+ this.ConnectedControl = connectedButton;
13554
+ connectedButton.ConnectedControl = this;
13568
13555
  }
13569
- this.ConnectedControl = connectedButton;
13570
- connectedButton.ConnectedControl = this;
13571
13556
  }
13572
13557
  });
13573
13558
  }
@@ -14129,13 +14114,8 @@ class MgFormBase extends GuiFormPropertyAdapter {
14129
14114
  if (idx >= 0 && idx < this.Rows.length)
14130
14115
  this.Rows.set_Item(idx, new Row(false, false));
14131
14116
  }
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);
14117
+ SelectRow() {
14118
+ this.SelectRowByIdx(this.DisplayLine);
14139
14119
  }
14140
14120
  getRowsInPage() {
14141
14121
  return this._rowsInPage;
@@ -14375,19 +14355,13 @@ class MgFormBase extends GuiFormPropertyAdapter {
14375
14355
  this.Rows.SetSize(idx + 1);
14376
14356
  this.Rows.set_Item(idx, new Row(true, true));
14377
14357
  }
14378
- SelectRow_0() {
14379
- this.SelectRow(false);
14380
- }
14381
- SelectRow_1(sendAlways) {
14382
- this.SelectRow(this.DisplayLine, sendAlways);
14383
- }
14384
- SelectRow_2(rowIdx, sendAlways) {
14358
+ SelectRowByIdx(rowIdx) {
14385
14359
  let mainControl = this.getMainControl();
14386
14360
  if (mainControl !== null && this.RefreshRepeatableAllowed) {
14387
14361
  let index = rowIdx;
14388
14362
  if (this._task.DataView.isEmptyDataview())
14389
14363
  index = GuiConstants.NO_ROW_SELECTED;
14390
- if (sendAlways || index !== this._prevSelIndex) {
14364
+ if (index !== this._prevSelIndex) {
14391
14365
  this._prevSelIndex = index;
14392
14366
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, mainControl, 0, HtmlProperties.SelectedRow, index);
14393
14367
  }
@@ -15621,9 +15595,16 @@ class Helps {
15621
15595
  initInnerObjects(foundTagName, parser) {
15622
15596
  if (foundTagName === null)
15623
15597
  return false;
15624
- if (foundTagName === XMLConstants.MG_TAG_HELPTABLE)
15598
+ if (foundTagName === XMLConstants.MG_TAG_HELPTABLE) {
15599
+ let currrentIndex = parser.getCurrIndex();
15600
+ let encoded = parser.ReadContentOfCurrentElement().trim();
15601
+ let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
15602
+ let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
15603
+ parser.setXMLdata(newXmlData);
15604
+ parser.setCurrIndex(currrentIndex);
15625
15605
  parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
15626
15606
  1);
15607
+ }
15627
15608
  else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
15628
15609
  let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
15629
15610
  if (endContext !== -1 && endContext < parser.getXMLdata().length) {
@@ -15783,16 +15764,17 @@ class GuiTaskBase {
15783
15764
  constructor() {
15784
15765
  this._flowMonitor = null;
15785
15766
  this._keyboardMappingState = 0xFFFF0000;
15786
- this._refreshType = 'T';
15767
+ this._refreshType = "T";
15787
15768
  this._lastParkedCtrl = null;
15788
15769
  this._brkLevel = null;
15789
15770
  this._brkLevelIndex = -1;
15790
15771
  this._mainLevel = null;
15791
- this._level = '\0';
15772
+ this._level = "\0";
15792
15773
  this._enteredRecLevel = false;
15793
15774
  this._currParkedFld = null;
15794
15775
  this.isInRecompute = false;
15795
15776
  this.CurrentEditingControl = null;
15777
+ this.shouldResumeSubformLayout = true;
15796
15778
  this.ApplicationGuid = null;
15797
15779
  this.ProgramIsn = 0;
15798
15780
  this.TaskIsn = 0;
@@ -15942,7 +15924,7 @@ class GuiTaskBase {
15942
15924
  return this._helpTab.getHelp(idx);
15943
15925
  }
15944
15926
  setProp(propId, val) {
15945
- this._propTab.setProp(propId, val, this, 'T');
15927
+ this._propTab.setProp(propId, val, this, "T");
15946
15928
  }
15947
15929
  setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
15948
15930
  this._brkLevel = cBrkLevel;
@@ -16050,6 +16032,15 @@ class GuiTaskBase {
16050
16032
  }
16051
16033
  });
16052
16034
  }
16035
+ ResumeSubformLayout() {
16036
+ if (this.Form !== null) {
16037
+ let subFormCtrl = this.Form.getSubFormCtrl();
16038
+ if (subFormCtrl !== null && this.shouldResumeSubformLayout) {
16039
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, subFormCtrl, 0, HtmlProperties.Visible, subFormCtrl.isVisible());
16040
+ this.shouldResumeSubformLayout = false;
16041
+ }
16042
+ }
16043
+ }
16053
16044
  GetLastParkedCtrlName(depth) {
16054
16045
  let ancestor = this.GetTaskAncestor(depth);
16055
16046
  if (ancestor === null || ancestor._lastParkedCtrl === null)
@@ -16113,7 +16104,7 @@ class GuiTaskBase {
16113
16104
  }
16114
16105
  CalculateExpression(expId, resType, length) {
16115
16106
  return __awaiter(this, void 0, void 0, function* () {
16116
- return Promise.resolve('');
16107
+ return Promise.resolve("");
16117
16108
  });
16118
16109
  }
16119
16110
  isStarted() {
@@ -16201,7 +16192,8 @@ class GuiTaskBase {
16201
16192
  this.IsParallel = XmlParser.getBoolean(valueStr);
16202
16193
  break;
16203
16194
  case XMLConstants.MG_ATTR_ROUTER_PATH:
16204
- this.routerPath = valueStr;
16195
+ if (valueStr.trim() != "")
16196
+ this.routerPath = valueStr;
16205
16197
  break;
16206
16198
  case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
16207
16199
  this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);