@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.
@@ -1235,13 +1235,11 @@ class Commands {
1235
1235
  guiCommand.number = num;
1236
1236
  GuiCommandQueue.getInstance().addCommand(guiCommand);
1237
1237
  }
1238
- static addValueWithLine(commandType, obj, line, value, reset = false) {
1238
+ static addValueWithLine(commandType, obj, line, value) {
1239
1239
  let guiCommand = new GuiCommand(obj, commandType);
1240
1240
  guiCommand.value = value;
1241
1241
  guiCommand.line = line;
1242
1242
  if (commandType === CommandType.SET_VALUE) {
1243
- if (reset)
1244
- guiCommand.Bool1 = reset;
1245
1243
  if (obj instanceof GuiMgControl && obj.isChoiceControl()) {
1246
1244
  if (value < 0)
1247
1245
  guiCommand.value = '';
@@ -1597,7 +1595,7 @@ class Manager {
1597
1595
  return Commands.getValue(ctrl, ctrl.getDisplayLine(true));
1598
1596
  }
1599
1597
  static async SetReadOnlyControl(ctrl, isReadOnly) {
1600
- if (ctrl.isTextControl() || ctrl.IsRepeatable) {
1598
+ if (ctrl.isTextControl() || ctrl.IsRepeatable || ctrl.isComboBox() || ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isRadio()) {
1601
1599
  if (UtilStrByteMode.isLocaleDefLangDBCS()) {
1602
1600
  if (await ctrl.getForm().getTask().checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY, false))
1603
1601
  return;
@@ -5640,25 +5638,16 @@ class DisplayConvertor {
5640
5638
  case PICInterface.PIC_YY:
5641
5639
  {
5642
5640
  this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5643
- let yearStr = NString.FromChars(outVal);
5644
- year = +yearStr.substr(outIdx);
5645
- outIdx += 2;
5646
- len -= 2;
5647
- }
5648
- break;
5649
- case PICInterface.PIC_YY:
5650
- {
5651
- this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
5652
- let yearStr = NString.FromChars(outVal);
5653
- year = +yearStr.substr(outIdx);
5641
+ let yearStr = NString.FromChars(outVal, outIdx, 2);
5642
+ year = +yearStr;
5654
5643
  outIdx += 2;
5655
5644
  len -= 2;
5656
5645
  }
5657
5646
  break;
5658
5647
  case PICInterface.PIC_YYYY:
5659
- this.int_2_a(outVal, outIdx, 4, year, '0');
5660
- let yearStr = NString.FromChars(outVal);
5661
- year = +yearStr.substr(outIdx);
5648
+ this.int_2_a(outVal, outIdx, 4, breakParams.year, '0');
5649
+ let yearStr = NString.FromChars(outVal, outIdx, 4);
5650
+ year = +yearStr;
5662
5651
  outIdx += 4;
5663
5652
  len -= 4;
5664
5653
  break;
@@ -9812,7 +9801,7 @@ class Property {
9812
9801
  async onModifiable() {
9813
9802
  if (this._parentType === GuiConstants.PARENT_TYPE_CONTROL) {
9814
9803
  let ctrl = this._parentObj;
9815
- if (ctrl.isTextControl()) {
9804
+ if (ctrl.isTextControl() || ctrl.isChoiceControl() || ctrl.isCheckBox()) {
9816
9805
  let task = this.GetTaskByParentObject();
9817
9806
  let readOnlyValue = !this.GetComputedValueBoolean();
9818
9807
  if ((readOnlyValue || task.getMode() !== Constants.TASK_MODE_QUERY) && ctrl.GetCurrReadOnly() !== readOnlyValue) {
@@ -10388,7 +10377,7 @@ class FieldValidator {
10388
10377
  return valDet;
10389
10378
  }
10390
10379
  if (ctrl.DataType !== StorageAttribute.ALPHA && ctrl.DataType !== StorageAttribute.UNICODE && ctrl.DataType !== StorageAttribute.BLOB) {
10391
- if ((typeof this._newvalue === 'string' && this._newvalue.trim().length === 0) || (ctrl.DataType === StorageAttribute.DATE && (ctrl.isDateZero(this._newvalue) || this.isNullDisplayVal()))) {
10380
+ 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()))) {
10392
10381
  let field = ctrl.getField();
10393
10382
  let defaultValue = field.getDefaultValue();
10394
10383
  let text = null;
@@ -11578,7 +11567,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11578
11567
  this._firstRefreshProperties = true;
11579
11568
  this._form = null;
11580
11569
  this._hasValidItmAndDispVal = false;
11581
- this._id = -1;
11582
11570
  this._controlIsn = -1;
11583
11571
  this._linkedParentDitIdx = -1;
11584
11572
  this._orgChoiceDisps = null;
@@ -11621,9 +11609,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11621
11609
  get Form() {
11622
11610
  return this._form;
11623
11611
  }
11624
- get Id() {
11625
- return this._id;
11626
- }
11627
11612
  get ControlIsn() {
11628
11613
  return this._controlIsn;
11629
11614
  }
@@ -11845,9 +11830,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
11845
11830
  case XMLConstants.MG_ATTR_CONTAINER:
11846
11831
  this.setContainer(XmlParser.getInt(valueStr));
11847
11832
  break;
11848
- case XMLConstants.MG_ATTR_ID:
11849
- this._id = XmlParser.getInt(valueStr);
11850
- break;
11851
11833
  case XMLConstants.MG_ATTR_CONTROL_ISN:
11852
11834
  this._controlIsn = XmlParser.getInt(valueStr);
11853
11835
  break;
@@ -12060,7 +12042,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12060
12042
  }
12061
12043
  getRangedValue(newVal) {
12062
12044
  let vd;
12063
- vd = this.buildCopyPicture(this.Value, newVal);
12045
+ vd = this.buildPicture(this.Value, newVal);
12064
12046
  vd.evaluate();
12065
12047
  this.ModifiedByUser = true;
12066
12048
  let val = vd.getDispValue();
@@ -12070,7 +12052,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
12070
12052
  let vd;
12071
12053
  let modified = this.ModifiedByUser;
12072
12054
  this.ModifiedByUser = true;
12073
- vd = this.buildCopyPicture(this.Value, newVal);
12055
+ vd = this.buildPicture(this.Value, newVal);
12074
12056
  vd.evaluate();
12075
12057
  this.ModifiedByUser = modified;
12076
12058
  if (vd.ValidationFailed)
@@ -12386,12 +12368,8 @@ class MgControlBase extends GuiControlPropertyAdapter {
12386
12368
  if (super.isButton()) {
12387
12369
  mlsTranslatedValue = Events.Translate(this.Value);
12388
12370
  }
12389
- if (this.isTextControl() || this.isButton()) {
12390
- if (this.isTextControl() && this.getForm().inRefreshDisplay() && this.DataType == StorageAttribute.NUMERIC)
12391
- Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue, true);
12392
- else
12393
- Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue);
12394
- }
12371
+ if (this.isTextControl() || this.isButton())
12372
+ Commands.addValueWithLine(CommandType.SET_VALUE, this, displayLine, mlsTranslatedValue);
12395
12373
  else
12396
12374
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, displayLine, HtmlProperties.Text, mlsTranslatedValue);
12397
12375
  }
@@ -13082,6 +13060,11 @@ class MgControlBase extends GuiControlPropertyAdapter {
13082
13060
  if (prevMustInput !== await this.checkProp(PropInterface.PROP_TYPE_MUST_INPUT, false))
13083
13061
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, !prevMustInput);
13084
13062
  }
13063
+ else if (mustInputProperty != null) {
13064
+ let mustInputVal = this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_MUST_INPUT, false);
13065
+ if (mustInputVal)
13066
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, mustInputVal);
13067
+ }
13085
13068
  if (!this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_TAB_IN, true))
13086
13069
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.TabIndex, -1);
13087
13070
  }
@@ -13398,15 +13381,17 @@ class MgControlBase extends GuiControlPropertyAdapter {
13398
13381
  async ZoomButtonInitialization() {
13399
13382
  if (this.isTextControl() && this.checkIfExistProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)) {
13400
13383
  let connectedButton = this.Form.CtrlTab.GetControlByIsn((await (await this.getProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)).getValueInt()));
13401
- let imageFileName = null;
13402
- if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13403
- imageFileName = await (await connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13404
- if (!Misc.IsWebUrl(imageFileName))
13405
- imageFileName = "./assets/images/" + imageFileName;
13406
- Commands.addOperationWithLine(CommandType.SET_STYLE, this, 0, MagicProperties.ImageFile, imageFileName);
13384
+ if (connectedButton) {
13385
+ let imageFileName = null;
13386
+ if (connectedButton.IsImageButton() && connectedButton.PropertyExists(PropInterface.PROP_TYPE_IMAGE_FILENAME)) {
13387
+ imageFileName = await (await connectedButton.getProp(PropInterface.PROP_TYPE_IMAGE_FILENAME)).getValue();
13388
+ if (!Misc.IsWebUrl(imageFileName))
13389
+ imageFileName = "./assets/images/" + imageFileName;
13390
+ Commands.addOperationWithLine(CommandType.SET_STYLE, this, 0, MagicProperties.ImageFile, imageFileName);
13391
+ }
13392
+ this.ConnectedControl = connectedButton;
13393
+ connectedButton.ConnectedControl = this;
13407
13394
  }
13408
- this.ConnectedControl = connectedButton;
13409
- connectedButton.ConnectedControl = this;
13410
13395
  }
13411
13396
  }
13412
13397
  }
@@ -13955,13 +13940,8 @@ class MgFormBase extends GuiFormPropertyAdapter {
13955
13940
  if (idx >= 0 && idx < this.Rows.length)
13956
13941
  this.Rows.set_Item(idx, new Row(false, false));
13957
13942
  }
13958
- SelectRow(sendAlwaysOrRowIdx, sendAlways) {
13959
- if (arguments.length === 0)
13960
- this.SelectRow_0();
13961
- else if (arguments.length === 1)
13962
- this.SelectRow_1(sendAlwaysOrRowIdx);
13963
- else
13964
- this.SelectRow_2(sendAlwaysOrRowIdx, sendAlways);
13943
+ SelectRow() {
13944
+ this.SelectRowByIdx(this.DisplayLine);
13965
13945
  }
13966
13946
  getRowsInPage() {
13967
13947
  return this._rowsInPage;
@@ -14199,19 +14179,13 @@ class MgFormBase extends GuiFormPropertyAdapter {
14199
14179
  this.Rows.SetSize(idx + 1);
14200
14180
  this.Rows.set_Item(idx, new Row(true, true));
14201
14181
  }
14202
- SelectRow_0() {
14203
- this.SelectRow(false);
14204
- }
14205
- SelectRow_1(sendAlways) {
14206
- this.SelectRow(this.DisplayLine, sendAlways);
14207
- }
14208
- SelectRow_2(rowIdx, sendAlways) {
14182
+ SelectRowByIdx(rowIdx) {
14209
14183
  let mainControl = this.getMainControl();
14210
14184
  if (mainControl !== null && this.RefreshRepeatableAllowed) {
14211
14185
  let index = rowIdx;
14212
14186
  if (this._task.DataView.isEmptyDataview())
14213
14187
  index = GuiConstants.NO_ROW_SELECTED;
14214
- if (sendAlways || index !== this._prevSelIndex) {
14188
+ if (index !== this._prevSelIndex) {
14215
14189
  this._prevSelIndex = index;
14216
14190
  Commands.addOperationWithLine(CommandType.SET_PROPERTY, mainControl, 0, HtmlProperties.SelectedRow, index);
14217
14191
  }
@@ -15445,9 +15419,16 @@ class Helps {
15445
15419
  initInnerObjects(foundTagName, parser) {
15446
15420
  if (foundTagName === null)
15447
15421
  return false;
15448
- if (foundTagName === XMLConstants.MG_TAG_HELPTABLE)
15422
+ if (foundTagName === XMLConstants.MG_TAG_HELPTABLE) {
15423
+ let currrentIndex = parser.getCurrIndex();
15424
+ let encoded = parser.ReadContentOfCurrentElement().trim();
15425
+ let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
15426
+ let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
15427
+ parser.setXMLdata(newXmlData);
15428
+ parser.setCurrIndex(currrentIndex);
15449
15429
  parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
15450
15430
  1);
15431
+ }
15451
15432
  else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
15452
15433
  let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
15453
15434
  if (endContext !== -1 && endContext < parser.getXMLdata().length) {
@@ -15607,16 +15588,17 @@ class GuiTaskBase {
15607
15588
  constructor() {
15608
15589
  this._flowMonitor = null;
15609
15590
  this._keyboardMappingState = 0xFFFF0000;
15610
- this._refreshType = 'T';
15591
+ this._refreshType = "T";
15611
15592
  this._lastParkedCtrl = null;
15612
15593
  this._brkLevel = null;
15613
15594
  this._brkLevelIndex = -1;
15614
15595
  this._mainLevel = null;
15615
- this._level = '\0';
15596
+ this._level = "\0";
15616
15597
  this._enteredRecLevel = false;
15617
15598
  this._currParkedFld = null;
15618
15599
  this.isInRecompute = false;
15619
15600
  this.CurrentEditingControl = null;
15601
+ this.shouldResumeSubformLayout = true;
15620
15602
  this.ApplicationGuid = null;
15621
15603
  this.ProgramIsn = 0;
15622
15604
  this.TaskIsn = 0;
@@ -15764,7 +15746,7 @@ class GuiTaskBase {
15764
15746
  return this._helpTab.getHelp(idx);
15765
15747
  }
15766
15748
  setProp(propId, val) {
15767
- this._propTab.setProp(propId, val, this, 'T');
15749
+ this._propTab.setProp(propId, val, this, "T");
15768
15750
  }
15769
15751
  setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
15770
15752
  this._brkLevel = cBrkLevel;
@@ -15870,6 +15852,15 @@ class GuiTaskBase {
15870
15852
  this.Form.InInitForm = false;
15871
15853
  }
15872
15854
  }
15855
+ ResumeSubformLayout() {
15856
+ if (this.Form !== null) {
15857
+ let subFormCtrl = this.Form.getSubFormCtrl();
15858
+ if (subFormCtrl !== null && this.shouldResumeSubformLayout) {
15859
+ Commands.addOperationWithLine(CommandType.SET_PROPERTY, subFormCtrl, 0, HtmlProperties.Visible, subFormCtrl.isVisible());
15860
+ this.shouldResumeSubformLayout = false;
15861
+ }
15862
+ }
15863
+ }
15873
15864
  GetLastParkedCtrlName(depth) {
15874
15865
  let ancestor = this.GetTaskAncestor(depth);
15875
15866
  if (ancestor === null || ancestor._lastParkedCtrl === null)
@@ -15930,7 +15921,7 @@ class GuiTaskBase {
15930
15921
  return this.GetExpressionStorage(expId);
15931
15922
  }
15932
15923
  async CalculateExpression(expId, resType, length) {
15933
- return Promise.resolve('');
15924
+ return Promise.resolve("");
15934
15925
  }
15935
15926
  isStarted() {
15936
15927
  return true;
@@ -16017,7 +16008,8 @@ class GuiTaskBase {
16017
16008
  this.IsParallel = XmlParser.getBoolean(valueStr);
16018
16009
  break;
16019
16010
  case XMLConstants.MG_ATTR_ROUTER_PATH:
16020
- this.routerPath = valueStr;
16011
+ if (valueStr.trim() != "")
16012
+ this.routerPath = valueStr;
16021
16013
  break;
16022
16014
  case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
16023
16015
  this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);