@magic-xpa/gui 4.900.0-dev490.18 → 4.900.0-dev490.185
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.
- package/esm2020/src/Manager.mjs +2 -2
- package/esm2020/src/management/gui/DisplayConvertor.mjs +6 -15
- package/esm2020/src/management/gui/FieldValidator.mjs +2 -2
- package/esm2020/src/management/gui/Helps.mjs +10 -3
- package/esm2020/src/management/gui/MgControlBase.mjs +18 -18
- package/esm2020/src/management/gui/Property.mjs +2 -2
- package/esm2020/src/management/tasks/GuiTaskBase.mjs +18 -6
- package/fesm2015/magic-xpa-gui.mjs +49 -40
- package/fesm2015/magic-xpa-gui.mjs.map +1 -1
- package/fesm2020/magic-xpa-gui.mjs +49 -40
- package/fesm2020/magic-xpa-gui.mjs.map +1 -1
- package/package.json +2 -2
- package/src/management/gui/MgControlBase.d.ts +0 -2
- package/src/management/tasks/GuiTaskBase.d.ts +2 -0
|
@@ -1595,7 +1595,7 @@ class Manager {
|
|
|
1595
1595
|
return Commands.getValue(ctrl, ctrl.getDisplayLine(true));
|
|
1596
1596
|
}
|
|
1597
1597
|
static async SetReadOnlyControl(ctrl, isReadOnly) {
|
|
1598
|
-
if (ctrl.isTextControl() || ctrl.IsRepeatable) {
|
|
1598
|
+
if (ctrl.isTextControl() || ctrl.IsRepeatable || ctrl.isComboBox() || ctrl.isListBox() || ctrl.isCheckBox() || ctrl.isRadio()) {
|
|
1599
1599
|
if (UtilStrByteMode.isLocaleDefLangDBCS()) {
|
|
1600
1600
|
if (await ctrl.getForm().getTask().checkProp(PropInterface.PROP_TYPE_ALLOW_LOCATE_IN_QUERY, false))
|
|
1601
1601
|
return;
|
|
@@ -5638,25 +5638,16 @@ class DisplayConvertor {
|
|
|
5638
5638
|
case PICInterface.PIC_YY:
|
|
5639
5639
|
{
|
|
5640
5640
|
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5641
|
-
let yearStr = NString.FromChars(outVal);
|
|
5642
|
-
year = +yearStr
|
|
5643
|
-
outIdx += 2;
|
|
5644
|
-
len -= 2;
|
|
5645
|
-
}
|
|
5646
|
-
break;
|
|
5647
|
-
case PICInterface.PIC_YY:
|
|
5648
|
-
{
|
|
5649
|
-
this.int_2_a(outVal, outIdx, 2, breakParams.year, '0');
|
|
5650
|
-
let yearStr = NString.FromChars(outVal);
|
|
5651
|
-
year = +yearStr.substr(outIdx);
|
|
5641
|
+
let yearStr = NString.FromChars(outVal, outIdx, 2);
|
|
5642
|
+
year = +yearStr;
|
|
5652
5643
|
outIdx += 2;
|
|
5653
5644
|
len -= 2;
|
|
5654
5645
|
}
|
|
5655
5646
|
break;
|
|
5656
5647
|
case PICInterface.PIC_YYYY:
|
|
5657
|
-
this.int_2_a(outVal, outIdx, 4, year, '0');
|
|
5658
|
-
let yearStr = NString.FromChars(outVal);
|
|
5659
|
-
year = +yearStr
|
|
5648
|
+
this.int_2_a(outVal, outIdx, 4, breakParams.year, '0');
|
|
5649
|
+
let yearStr = NString.FromChars(outVal, outIdx, 4);
|
|
5650
|
+
year = +yearStr;
|
|
5660
5651
|
outIdx += 4;
|
|
5661
5652
|
len -= 4;
|
|
5662
5653
|
break;
|
|
@@ -9810,7 +9801,7 @@ class Property {
|
|
|
9810
9801
|
async onModifiable() {
|
|
9811
9802
|
if (this._parentType === GuiConstants.PARENT_TYPE_CONTROL) {
|
|
9812
9803
|
let ctrl = this._parentObj;
|
|
9813
|
-
if (ctrl.isTextControl()) {
|
|
9804
|
+
if (ctrl.isTextControl() || ctrl.isChoiceControl() || ctrl.isCheckBox()) {
|
|
9814
9805
|
let task = this.GetTaskByParentObject();
|
|
9815
9806
|
let readOnlyValue = !this.GetComputedValueBoolean();
|
|
9816
9807
|
if ((readOnlyValue || task.getMode() !== Constants.TASK_MODE_QUERY) && ctrl.GetCurrReadOnly() !== readOnlyValue) {
|
|
@@ -10386,7 +10377,7 @@ class FieldValidator {
|
|
|
10386
10377
|
return valDet;
|
|
10387
10378
|
}
|
|
10388
10379
|
if (ctrl.DataType !== StorageAttribute.ALPHA && ctrl.DataType !== StorageAttribute.UNICODE && ctrl.DataType !== StorageAttribute.BLOB) {
|
|
10389
|
-
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()))) {
|
|
10390
10381
|
let field = ctrl.getField();
|
|
10391
10382
|
let defaultValue = field.getDefaultValue();
|
|
10392
10383
|
let text = null;
|
|
@@ -11576,7 +11567,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
11576
11567
|
this._firstRefreshProperties = true;
|
|
11577
11568
|
this._form = null;
|
|
11578
11569
|
this._hasValidItmAndDispVal = false;
|
|
11579
|
-
this._id = -1;
|
|
11580
11570
|
this._controlIsn = -1;
|
|
11581
11571
|
this._linkedParentDitIdx = -1;
|
|
11582
11572
|
this._orgChoiceDisps = null;
|
|
@@ -11619,9 +11609,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
11619
11609
|
get Form() {
|
|
11620
11610
|
return this._form;
|
|
11621
11611
|
}
|
|
11622
|
-
get Id() {
|
|
11623
|
-
return this._id;
|
|
11624
|
-
}
|
|
11625
11612
|
get ControlIsn() {
|
|
11626
11613
|
return this._controlIsn;
|
|
11627
11614
|
}
|
|
@@ -11843,9 +11830,6 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
11843
11830
|
case XMLConstants.MG_ATTR_CONTAINER:
|
|
11844
11831
|
this.setContainer(XmlParser.getInt(valueStr));
|
|
11845
11832
|
break;
|
|
11846
|
-
case XMLConstants.MG_ATTR_ID:
|
|
11847
|
-
this._id = XmlParser.getInt(valueStr);
|
|
11848
|
-
break;
|
|
11849
11833
|
case XMLConstants.MG_ATTR_CONTROL_ISN:
|
|
11850
11834
|
this._controlIsn = XmlParser.getInt(valueStr);
|
|
11851
11835
|
break;
|
|
@@ -12058,7 +12042,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
12058
12042
|
}
|
|
12059
12043
|
getRangedValue(newVal) {
|
|
12060
12044
|
let vd;
|
|
12061
|
-
vd = this.
|
|
12045
|
+
vd = this.buildPicture(this.Value, newVal);
|
|
12062
12046
|
vd.evaluate();
|
|
12063
12047
|
this.ModifiedByUser = true;
|
|
12064
12048
|
let val = vd.getDispValue();
|
|
@@ -12068,7 +12052,7 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
12068
12052
|
let vd;
|
|
12069
12053
|
let modified = this.ModifiedByUser;
|
|
12070
12054
|
this.ModifiedByUser = true;
|
|
12071
|
-
vd = this.
|
|
12055
|
+
vd = this.buildPicture(this.Value, newVal);
|
|
12072
12056
|
vd.evaluate();
|
|
12073
12057
|
this.ModifiedByUser = modified;
|
|
12074
12058
|
if (vd.ValidationFailed)
|
|
@@ -13076,6 +13060,11 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
13076
13060
|
if (prevMustInput !== await this.checkProp(PropInterface.PROP_TYPE_MUST_INPUT, false))
|
|
13077
13061
|
Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.MustInput, !prevMustInput);
|
|
13078
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
|
+
}
|
|
13079
13068
|
if (!this.GetComputedBooleanProperty(PropInterface.PROP_TYPE_TAB_IN, true))
|
|
13080
13069
|
Commands.addOperationWithLine(CommandType.SET_PROPERTY, this, this.getDisplayLine(false), HtmlProperties.TabIndex, -1);
|
|
13081
13070
|
}
|
|
@@ -13392,15 +13381,17 @@ class MgControlBase extends GuiControlPropertyAdapter {
|
|
|
13392
13381
|
async ZoomButtonInitialization() {
|
|
13393
13382
|
if (this.isTextControl() && this.checkIfExistProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)) {
|
|
13394
13383
|
let connectedButton = this.Form.CtrlTab.GetControlByIsn((await (await this.getProp(PropInterface.PROP_TYPE_CONNECTED_ZOOM_CONTROL)).getValueInt()));
|
|
13395
|
-
|
|
13396
|
-
|
|
13397
|
-
|
|
13398
|
-
|
|
13399
|
-
|
|
13400
|
-
|
|
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;
|
|
13401
13394
|
}
|
|
13402
|
-
this.ConnectedControl = connectedButton;
|
|
13403
|
-
connectedButton.ConnectedControl = this;
|
|
13404
13395
|
}
|
|
13405
13396
|
}
|
|
13406
13397
|
}
|
|
@@ -15439,9 +15430,16 @@ class Helps {
|
|
|
15439
15430
|
initInnerObjects(foundTagName, parser) {
|
|
15440
15431
|
if (foundTagName === null)
|
|
15441
15432
|
return false;
|
|
15442
|
-
if (foundTagName === XMLConstants.MG_TAG_HELPTABLE)
|
|
15433
|
+
if (foundTagName === XMLConstants.MG_TAG_HELPTABLE) {
|
|
15434
|
+
let currrentIndex = parser.getCurrIndex();
|
|
15435
|
+
let encoded = parser.ReadContentOfCurrentElement().trim();
|
|
15436
|
+
let decoded = Base64.decode(encoded.substr(0, encoded.length).trim());
|
|
15437
|
+
let newXmlData = parser.getXMLdata().replace(encoded.trim(), decoded);
|
|
15438
|
+
parser.setXMLdata(newXmlData);
|
|
15439
|
+
parser.setCurrIndex(currrentIndex);
|
|
15443
15440
|
parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
|
|
15444
15441
|
1);
|
|
15442
|
+
}
|
|
15445
15443
|
else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
|
|
15446
15444
|
let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
|
|
15447
15445
|
if (endContext !== -1 && endContext < parser.getXMLdata().length) {
|
|
@@ -15601,16 +15599,17 @@ class GuiTaskBase {
|
|
|
15601
15599
|
constructor() {
|
|
15602
15600
|
this._flowMonitor = null;
|
|
15603
15601
|
this._keyboardMappingState = 0xFFFF0000;
|
|
15604
|
-
this._refreshType =
|
|
15602
|
+
this._refreshType = "T";
|
|
15605
15603
|
this._lastParkedCtrl = null;
|
|
15606
15604
|
this._brkLevel = null;
|
|
15607
15605
|
this._brkLevelIndex = -1;
|
|
15608
15606
|
this._mainLevel = null;
|
|
15609
|
-
this._level =
|
|
15607
|
+
this._level = "\0";
|
|
15610
15608
|
this._enteredRecLevel = false;
|
|
15611
15609
|
this._currParkedFld = null;
|
|
15612
15610
|
this.isInRecompute = false;
|
|
15613
15611
|
this.CurrentEditingControl = null;
|
|
15612
|
+
this.shouldResumeSubformLayout = true;
|
|
15614
15613
|
this.ApplicationGuid = null;
|
|
15615
15614
|
this.ProgramIsn = 0;
|
|
15616
15615
|
this.TaskIsn = 0;
|
|
@@ -15758,7 +15757,7 @@ class GuiTaskBase {
|
|
|
15758
15757
|
return this._helpTab.getHelp(idx);
|
|
15759
15758
|
}
|
|
15760
15759
|
setProp(propId, val) {
|
|
15761
|
-
this._propTab.setProp(propId, val, this,
|
|
15760
|
+
this._propTab.setProp(propId, val, this, "T");
|
|
15762
15761
|
}
|
|
15763
15762
|
setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
|
|
15764
15763
|
this._brkLevel = cBrkLevel;
|
|
@@ -15864,6 +15863,15 @@ class GuiTaskBase {
|
|
|
15864
15863
|
this.Form.InInitForm = false;
|
|
15865
15864
|
}
|
|
15866
15865
|
}
|
|
15866
|
+
ResumeSubformLayout() {
|
|
15867
|
+
if (this.Form !== null) {
|
|
15868
|
+
let subFormCtrl = this.Form.getSubFormCtrl();
|
|
15869
|
+
if (subFormCtrl !== null && this.shouldResumeSubformLayout) {
|
|
15870
|
+
Commands.addOperationWithLine(CommandType.SET_PROPERTY, subFormCtrl, 0, HtmlProperties.Visible, subFormCtrl.isVisible());
|
|
15871
|
+
this.shouldResumeSubformLayout = false;
|
|
15872
|
+
}
|
|
15873
|
+
}
|
|
15874
|
+
}
|
|
15867
15875
|
GetLastParkedCtrlName(depth) {
|
|
15868
15876
|
let ancestor = this.GetTaskAncestor(depth);
|
|
15869
15877
|
if (ancestor === null || ancestor._lastParkedCtrl === null)
|
|
@@ -15924,7 +15932,7 @@ class GuiTaskBase {
|
|
|
15924
15932
|
return this.GetExpressionStorage(expId);
|
|
15925
15933
|
}
|
|
15926
15934
|
async CalculateExpression(expId, resType, length) {
|
|
15927
|
-
return Promise.resolve(
|
|
15935
|
+
return Promise.resolve("");
|
|
15928
15936
|
}
|
|
15929
15937
|
isStarted() {
|
|
15930
15938
|
return true;
|
|
@@ -16011,7 +16019,8 @@ class GuiTaskBase {
|
|
|
16011
16019
|
this.IsParallel = XmlParser.getBoolean(valueStr);
|
|
16012
16020
|
break;
|
|
16013
16021
|
case XMLConstants.MG_ATTR_ROUTER_PATH:
|
|
16014
|
-
|
|
16022
|
+
if (valueStr.trim() != "")
|
|
16023
|
+
this.routerPath = valueStr;
|
|
16015
16024
|
break;
|
|
16016
16025
|
case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
|
|
16017
16026
|
this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);
|