@magic-xpa/gui 4.900.0-dev491.7 → 4.1000.0-dev4100.1
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 +20 -18
- package/esm2020/src/management/gui/MgFormBase.mjs +5 -16
- package/esm2020/src/management/gui/PIC.mjs +8 -1
- package/esm2020/src/management/gui/Property.mjs +2 -2
- package/esm2020/src/management/tasks/GuiTaskBase.mjs +18 -6
- package/fesm2015/magic-xpa-gui.mjs +62 -55
- package/fesm2015/magic-xpa-gui.mjs.map +1 -1
- package/fesm2020/magic-xpa-gui.mjs +62 -55
- 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/gui/MgFormBase.d.ts +1 -5
- package/src/management/gui/PIC.d.ts +3 -0
- package/src/management/tasks/GuiTaskBase.d.ts +2 -0
|
@@ -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
|
|
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
|
|
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;
|
|
@@ -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.
|
|
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.
|
|
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
|
-
|
|
13557
|
-
|
|
13558
|
-
|
|
13559
|
-
|
|
13560
|
-
|
|
13561
|
-
|
|
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(
|
|
14127
|
-
|
|
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
|
-
|
|
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 (
|
|
14373
|
+
if (index !== this._prevSelIndex) {
|
|
14385
14374
|
this._prevSelIndex = index;
|
|
14386
14375
|
Commands.addOperationWithLine(CommandType.SET_PROPERTY, mainControl, 0, HtmlProperties.SelectedRow, index);
|
|
14387
14376
|
}
|
|
@@ -15615,9 +15604,16 @@ class Helps {
|
|
|
15615
15604
|
initInnerObjects(foundTagName, parser) {
|
|
15616
15605
|
if (foundTagName === null)
|
|
15617
15606
|
return false;
|
|
15618
|
-
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);
|
|
15619
15614
|
parser.setCurrIndex(parser.getXMLdata().indexOf(XMLConstants.TAG_CLOSE, parser.getCurrIndex()) +
|
|
15620
15615
|
1);
|
|
15616
|
+
}
|
|
15621
15617
|
else if (foundTagName === XMLConstants.MG_TAG_HELPITEM) {
|
|
15622
15618
|
let endContext = parser.getXMLdata().indexOf(XMLConstants.TAG_TERM, parser.getCurrIndex());
|
|
15623
15619
|
if (endContext !== -1 && endContext < parser.getXMLdata().length) {
|
|
@@ -15777,16 +15773,17 @@ class GuiTaskBase {
|
|
|
15777
15773
|
constructor() {
|
|
15778
15774
|
this._flowMonitor = null;
|
|
15779
15775
|
this._keyboardMappingState = 0xFFFF0000;
|
|
15780
|
-
this._refreshType =
|
|
15776
|
+
this._refreshType = "T";
|
|
15781
15777
|
this._lastParkedCtrl = null;
|
|
15782
15778
|
this._brkLevel = null;
|
|
15783
15779
|
this._brkLevelIndex = -1;
|
|
15784
15780
|
this._mainLevel = null;
|
|
15785
|
-
this._level =
|
|
15781
|
+
this._level = "\0";
|
|
15786
15782
|
this._enteredRecLevel = false;
|
|
15787
15783
|
this._currParkedFld = null;
|
|
15788
15784
|
this.isInRecompute = false;
|
|
15789
15785
|
this.CurrentEditingControl = null;
|
|
15786
|
+
this.shouldResumeSubformLayout = true;
|
|
15790
15787
|
this.ApplicationGuid = null;
|
|
15791
15788
|
this.ProgramIsn = 0;
|
|
15792
15789
|
this.TaskIsn = 0;
|
|
@@ -15936,7 +15933,7 @@ class GuiTaskBase {
|
|
|
15936
15933
|
return this._helpTab.getHelp(idx);
|
|
15937
15934
|
}
|
|
15938
15935
|
setProp(propId, val) {
|
|
15939
|
-
this._propTab.setProp(propId, val, this,
|
|
15936
|
+
this._propTab.setProp(propId, val, this, "T");
|
|
15940
15937
|
}
|
|
15941
15938
|
setBrkLevel(cBrkLevel, NewBrkLevelIndex) {
|
|
15942
15939
|
this._brkLevel = cBrkLevel;
|
|
@@ -16044,6 +16041,15 @@ class GuiTaskBase {
|
|
|
16044
16041
|
}
|
|
16045
16042
|
});
|
|
16046
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
|
+
}
|
|
16047
16053
|
GetLastParkedCtrlName(depth) {
|
|
16048
16054
|
let ancestor = this.GetTaskAncestor(depth);
|
|
16049
16055
|
if (ancestor === null || ancestor._lastParkedCtrl === null)
|
|
@@ -16107,7 +16113,7 @@ class GuiTaskBase {
|
|
|
16107
16113
|
}
|
|
16108
16114
|
CalculateExpression(expId, resType, length) {
|
|
16109
16115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
16110
|
-
return Promise.resolve(
|
|
16116
|
+
return Promise.resolve("");
|
|
16111
16117
|
});
|
|
16112
16118
|
}
|
|
16113
16119
|
isStarted() {
|
|
@@ -16195,7 +16201,8 @@ class GuiTaskBase {
|
|
|
16195
16201
|
this.IsParallel = XmlParser.getBoolean(valueStr);
|
|
16196
16202
|
break;
|
|
16197
16203
|
case XMLConstants.MG_ATTR_ROUTER_PATH:
|
|
16198
|
-
|
|
16204
|
+
if (valueStr.trim() != "")
|
|
16205
|
+
this.routerPath = valueStr;
|
|
16199
16206
|
break;
|
|
16200
16207
|
case XMLConstants.MG_ATTR_IN_DEFAULT_ROUTER_OUTLET:
|
|
16201
16208
|
this.inDefaultRouterOutlet = XmlParser.getBoolean(valueStr);
|