@magic-xpa/gui 4.900.0-dev491.7 → 4.1000.0-dev000.0

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.
@@ -1599,7 +1599,7 @@ class Manager {
1599
1599
  }
1600
1600
  static SetReadOnlyControl(ctrl, isReadOnly) {
1601
1601
  return __awaiter(this, void 0, void 0, function* () {
1602
- if (ctrl.isTextControl() || ctrl.IsRepeatable) {
1602
+ if (ctrl.isTextControl() || ctrl.IsRepeatable || ctrl.isComboBox() || ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isRadio()) {
1603
1603
  if (UtilStrByteMode.isLocaleDefLangDBCS()) {
1604
1604
  if (yield ctrl.getForm().getTask().checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY, false))
1605
1605
  return;
@@ -2030,6 +2030,7 @@ class PIC {
2030
2030
  this._maskChars = 0;
2031
2031
  this._maskSize = 0;
2032
2032
  this._mixed = false;
2033
+ this._formatExp = false;
2033
2034
  this._msk = null;
2034
2035
  this._needLength = false;
2035
2036
  this._negative = false;
@@ -2117,6 +2118,12 @@ class PIC {
2117
2118
  decInFirstPos() {
2118
2119
  return this._decPointIsFirst;
2119
2120
  }
2121
+ setFormatExp(val) {
2122
+ this._formatExp = val;
2123
+ }
2124
+ isFormatExp() {
2125
+ return this._formatExp;
2126
+ }
2120
2127
  getPosPref_() {
2121
2128
  return this._posPref.ToString();
2122
2129
  }
@@ -5645,25 +5652,16 @@ class DisplayConvertor {
5645
5652
  case PICInterface.PIC_YY:
5646
5653
  {
5647
5654
  this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5648
- let yearStr = NString.FromChars(outVal);
5649
- year = +yearStr.substr(outIdx);
5650
- outIdx += 2;
5651
- len -= 2;
5652
- }
5653
- break;
5654
- case PICInterface.PIC_YY:
5655
- {
5656
- this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5657
- let yearStr = NString.FromChars(outVal);
5658
- year = +yearStr.substr(outIdx);
5655
+ let yearStr = NString.FromChars(outVal, outIdx, 2);
5656
+ year = +yearStr;
5659
5657
  outIdx += 2;
5660
5658
  len -= 2;
5661
5659
  }
5662
5660
  break;
5663
5661
  case PICInterface.PIC_YYYY:
5664
- this.int_2_a(outVal, outIdx, 4, year, '0');
5665
- let yearStr = NString.FromChars(outVal);
5666
- 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;
5667
5665
  outIdx += 4;
5668
5666
  len -= 4;
5669
5667
  break;
@@ -7090,7 +7088,7 @@ class RecordUtils {
7090
7088
  case StorageAttribute.TIME:
7091
7089
  itemVal = !toBase64
7092
7090
  ? itemVal.substr(0, significantNumSize)
7093
- : Base64.encode(this.byteStreamToString(itemVal.substr(0, significantNumSize)), GuiEnvironment.Environment.GetEncoding());
7091
+ : Base64.encode(this.byteStreamToString(itemVal.substr(0, significantNumSize)));
7094
7092
  break;
7095
7093
  case StorageAttribute.ALPHA:
7096
7094
  case StorageAttribute.UNICODE:
@@ -7173,7 +7171,7 @@ class RecordUtils {
7173
7171
  itemVal = itemVal.substr(pos, (fldValLen) - (pos));
7174
7172
  itemVal = !toBase64
7175
7173
  ? StrUtil.stringToHexaDump(itemVal, 4)
7176
- : Base64.encode(itemVal, GuiEnvironment.Environment.GetEncoding());
7174
+ : Base64.encode(itemVal);
7177
7175
  pos = fldValLen;
7178
7176
  }
7179
7177
  else {
@@ -7182,7 +7180,7 @@ class RecordUtils {
7182
7180
  if (!toBase64)
7183
7181
  tmpBuf.Append(StrUtil.stringToHexaDump(itemVal.substr(pos, 0x7FFF), 4));
7184
7182
  else
7185
- tmpBuf.Append(Base64.encode(itemVal.substr(pos, 0x7FFF), GuiEnvironment.Environment.GetEncoding()));
7183
+ tmpBuf.Append(Base64.encode(itemVal.substr(pos, 0x7FFF)));
7186
7184
  tmpBuf.Append("0000");
7187
7185
  pos += 0x7FFF;
7188
7186
  }
@@ -9848,7 +9846,7 @@ class Property {
9848
9846
  return __awaiter(this, void 0, void 0, function* () {
9849
9847
  if (this._parentType === GuiConstants.PARENT_TYPE_CONTROL) {
9850
9848
  let ctrl = this._parentObj;
9851
- if (ctrl.isTextControl()) {
9849
+ if (ctrl.isTextControl() || ctrl.isChoiceControl() || ctrl.isCheckBox()) {
9852
9850
  let task = this.GetTaskByParentObject();
9853
9851
  let readOnlyValue = !this.GetComputedValueBoolean();
9854
9852
  if ((readOnlyValue || task.getMode() !== Constants.TASK_MODE_QUERY) && ctrl.GetCurrReadOnly() !== readOnlyValue) {
@@ -10439,7 +10437,7 @@ class FieldValidator {
10439
10437
  return valDet;
10440
10438
  }
10441
10439
  if (ctrl.DataType !== StorageAttribute.ALPHA && ctrl.DataType !== StorageAttribute.UNICODE && ctrl.DataType !== StorageAttribute.BLOB) {
10442
- 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()))) {
10443
10441
  let field = ctrl.getField();
10444
10442
  let defaultValue = field.getDefaultValue();
10445
10443
  let text = null;
@@ -11635,7 +11633,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11635
11633
  this._firstRefreshProperties = true;
11636
11634
  this._form = null;
11637
11635
  this._hasValidItmAndDispVal = false;
11638
- this._id = -1;
11639
11636
  this._controlIsn = -1;
11640
11637
  this._linkedParentDitIdx = -1;
11641
11638
  this._orgChoiceDisps = null;
@@ -11678,9 +11675,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11678
11675
  get Form() {
11679
11676
  return this._form;
11680
11677
  }
11681
- get Id() {
11682
- return this._id;
11683
- }
11684
11678
  get ControlIsn() {
11685
11679
  return this._controlIsn;
11686
11680
  }
@@ -11906,9 +11900,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11906
11900
  case XMLConstants.MG_ATTR_CONTAINER:
11907
11901
  this.setContainer(XmlParser.getInt(valueStr));
11908
11902
  break;
11909
- case XMLConstants.MG_ATTR_ID:
11910
- this._id = XmlParser.getInt(valueStr);
11911
- break;
11912
11903
  case XMLConstants.MG_ATTR_CONTROL_ISN:
11913
11904
  this._controlIsn = XmlParser.getInt(valueStr);
11914
11905
  break;
@@ -12043,6 +12034,8 @@ class MgControlBase extends GuiControlPropertyAdapter {
12043
12034
  }
12044
12035
  }
12045
12036
  getPIC() {
12037
+ if (this._picExpExists)
12038
+ this._pic.setFormatExp(this._picExpExists);
12046
12039
  return this._pic;
12047
12040
  }
12048
12041
  getParent() {
@@ -12121,7 +12114,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12121
12114
  }
12122
12115
  getRangedValue(newVal) {
12123
12116
  let vd;
12124
- vd = this.buildCopyPicture(this.Value, newVal);
12117
+ vd = this.buildPicture(this.Value, newVal);
12125
12118
  vd.evaluate();
12126
12119
  this.ModifiedByUser = true;
12127
12120
  let val = vd.getDispValue();
@@ -12131,7 +12124,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12131
12124
  let vd;
12132
12125
  let modified = this.ModifiedByUser;
12133
12126
  this.ModifiedByUser = true;
12134
- vd = this.buildCopyPicture(this.Value, newVal);
12127
+ vd = this.buildPicture(this.Value, newVal);
12135
12128
  vd.evaluate();
12136
12129
  this.ModifiedByUser = modified;
12137
12130
  if (vd.ValidationFailed)
@@ -13205,6 +13198,11 @@ class MgControlBase extends GuiControlPropertyAdapter {
13205
13198
  if (prevMustInput !== (yield this.checkProp(PropInterface.PROP_TYPE_MUST_INPUT, false)))
13206
13199
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, !prevMustInput);
13207
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
+ }
13208
13206
  if (!this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_TAB_IN, true))
13209
13207
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.TabIndex, -1);
13210
13208
  }
@@ -13553,15 +13551,17 @@ class MgControlBase extends GuiControlPropertyAdapter {
13553
13551
  return __awaiter(this, void 0, void 0, function* () {
13554
13552
  if (this.isTextControl() && this.checkIfExistProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)) {
13555
13553
  let connectedButton = this.Form.CtrlTab.GetControlByIsn((yield (yield this.getProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)).getValueInt()));
13556
- let imageFileName = null;
13557
- if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13558
- imageFileName = yield (yield connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13559
- if (!Misc.IsWebUrl(imageFileName))
13560
- imageFileName = "./assets/images/" + imageFileName;
13561
- 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;
13562
13564
  }
13563
- this.ConnectedControl = connectedButton;
13564
- connectedButton.ConnectedControl = this;
13565
13565
  }
13566
13566
  });
13567
13567
  }
@@ -14123,13 +14123,8 @@ class MgFormBase extends GuiFormPropertyAdapter {
14123
14123
  if (idx >= 0 && idx < this.Rows.length)
14124
14124
  this.Rows.set_Item(idx, new Row(false, false));
14125
14125
  }
14126
- SelectRow(sendAlwaysOrRowIdx, sendAlways) {
14127
- if (arguments.length === 0)
14128
- this.SelectRow_0();
14129
- else if (arguments.length === 1)
14130
- this.SelectRow_1(sendAlwaysOrRowIdx);
14131
- else
14132
- this.SelectRow_2(sendAlwaysOrRowIdx, sendAlways);
14126
+ SelectRow() {
14127
+ this.SelectRowByIdx(this.DisplayLine);
14133
14128
  }
14134
14129
  getRowsInPage() {
14135
14130
  return this._rowsInPage;
@@ -14369,19 +14364,13 @@ class MgFormBase extends GuiFormPropertyAdapter {
14369
14364
  this.Rows.SetSize(idx + 1);
14370
14365
  this.Rows.set_Item(idx, new Row(true, true));
14371
14366
  }
14372
- SelectRow_0() {
14373
- this.SelectRow(false);
14374
- }
14375
- SelectRow_1(sendAlways) {
14376
- this.SelectRow(this.DisplayLine, sendAlways);
14377
- }
14378
- SelectRow_2(rowIdx, sendAlways) {
14367
+ SelectRowByIdx(rowIdx) {
14379
14368
  let mainControl = this.getMainControl();
14380
14369
  if (mainControl !== null && this.RefreshRepeatableAllowed) {
14381
14370
  let index = rowIdx;
14382
14371
  if (this._task.DataView.isEmptyDataview())
14383
14372
  index = GuiConstants.NO_ROW_SELECTED;
14384
- if (sendAlways || index !== this._prevSelIndex) {
14373
+ if (index !== this._prevSelIndex) {
14385
14374
  this._prevSelIndex = index;
14386
14375
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, mainControl, 0, HtmlProperties.SelectedRow, index);
14387
14376
  }
@@ -15228,6 +15217,7 @@ ExpressionInterface.EXP_OP_CLIENT_DB_DISCONNECT = 636;
15228
15217
  ExpressionInterface.EXP_OP_DATAVIEW_TO_DATASOURCE = 637;
15229
15218
  ExpressionInterface.EXP_OP_CLIENT_DB_DEL = 638;
15230
15219
  ExpressionInterface.EXP_OP_VARDISPLAYNAME = 647;
15220
+ ExpressionInterface.EXP_OP_CONTROL_ITEMS_REFRESH = 649;
15231
15221
  ExpressionInterface.EXP_OP_VARCONTROLID = 650;
15232
15222
  ExpressionInterface.EXP_OP_CONTROLITEMSLIST = 651;
15233
15223
  ExpressionInterface.EXP_OP_CONTROLDISPLAYLIST = 652;
@@ -15615,9 +15605,16 @@ class Helps {
15615
15605
  initInnerObjects(foundTagName, parser) {
15616
15606
  if (foundTagName === null)
15617
15607
  return false;
15618
- if (foundTagName === XMLConstants.MG_TAG_HELPTABLE)
15608
+ if (foundTagName === XMLConstants.MG_TAG_HELPTABLE) {
15609
+ let currrentIndex = parser.getCurrIndex();
15610
+ let encoded = parser.ReadContentOfCurrentElement().trim();
15611
+ let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
15612
+ let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
15613
+ parser.setXMLdata(newXmlData);
15614
+ parser.setCurrIndex(currrentIndex);
15619
15615
  parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
15620
15616
  1);
15617
+ }
15621
15618
  else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
15622
15619
  let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
15623
15620
  if (endContext !== -1 && endContext < parser.getXMLdata().length) {
@@ -15777,16 +15774,17 @@ class GuiTaskBase {
15777
15774
  constructor() {
15778
15775
  this._flowMonitor = null;
15779
15776
  this._keyboardMappingState = 0xFFFF0000;
15780
- this._refreshType = 'T';
15777
+ this._refreshType = "T";
15781
15778
  this._lastParkedCtrl = null;
15782
15779
  this._brkLevel = null;
15783
15780
  this._brkLevelIndex = -1;
15784
15781
  this._mainLevel = null;
15785
- this._level = '\0';
15782
+ this._level = "\0";
15786
15783
  this._enteredRecLevel = false;
15787
15784
  this._currParkedFld = null;
15788
15785
  this.isInRecompute = false;
15789
15786
  this.CurrentEditingControl = null;
15787
+ this.shouldResumeSubformLayout = true;
15790
15788
  this.ApplicationGuid = null;
15791
15789
  this.ProgramIsn = 0;
15792
15790
  this.TaskIsn = 0;
@@ -15936,7 +15934,7 @@ class GuiTaskBase {
15936
15934
  return this._helpTab.getHelp(idx);
15937
15935
  }
15938
15936
  setProp(propId, val) {
15939
- this._propTab.setProp(propId, val, this, 'T');
15937
+ this._propTab.setProp(propId, val, this, "T");
15940
15938
  }
15941
15939
  setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
15942
15940
  this._brkLevel = cBrkLevel;
@@ -16044,6 +16042,15 @@ class GuiTaskBase {
16044
16042
  }
16045
16043
  });
16046
16044
  }
16045
+ ResumeSubformLayout() {
16046
+ if (this.Form !== null) {
16047
+ let subFormCtrl = this.Form.getSubFormCtrl();
16048
+ if (subFormCtrl !== null && this.shouldResumeSubformLayout) {
16049
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, subFormCtrl, 0, HtmlProperties.Visible, subFormCtrl.isVisible());
16050
+ this.shouldResumeSubformLayout = false;
16051
+ }
16052
+ }
16053
+ }
16047
16054
  GetLastParkedCtrlName(depth) {
16048
16055
  let ancestor = this.GetTaskAncestor(depth);
16049
16056
  if (ancestor === null || ancestor._lastParkedCtrl === null)
@@ -16107,7 +16114,7 @@ class GuiTaskBase {
16107
16114
  }
16108
16115
  CalculateExpression(expId, resType, length) {
16109
16116
  return __awaiter(this, void 0, void 0, function* () {
16110
- return Promise.resolve('');
16117
+ return Promise.resolve("");
16111
16118
  });
16112
16119
  }
16113
16120
  isStarted() {
@@ -16195,7 +16202,8 @@ class GuiTaskBase {
16195
16202
  this.IsParallel = XmlParser.getBoolean(valueStr);
16196
16203
  break;
16197
16204
  case XMLConstants.MG_ATTR_ROUTER_PATH:
16198
- this.routerPath = valueStr;
16205
+ if (valueStr.trim() != "")
16206
+ this.routerPath = valueStr;
16199
16207
  break;
16200
16208
  case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
16201
16209
  this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);