@magic-xpa/engine 4.900.0 → 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.
@@ -39,7 +39,6 @@ var ClientTargetedCommandType;
39
39
  })(ClientTargetedCommandType || (ClientTargetedCommandType = {}));
40
40
 
41
41
  class ConstInterface {
42
- ;
43
42
  }
44
43
  ConstInterface.MG_TAG_CONTEXT = "context";
45
44
  ConstInterface.MG_TAG_ENV = "env";
@@ -8096,6 +8095,13 @@ class SelectProgramCommand extends ExecOperCommand {
8096
8095
  }
8097
8096
  }
8098
8097
 
8098
+ class ControlItemsRefreshCommand extends DataviewCommand {
8099
+ constructor() {
8100
+ super();
8101
+ this.Control = null;
8102
+ }
8103
+ }
8104
+
8099
8105
  class CommandFactory {
8100
8106
  static CreateEventCommand(taskTag, magicEvent) {
8101
8107
  let eventCommand = new EventCommand(magicEvent);
@@ -8114,6 +8120,13 @@ class CommandFactory {
8114
8120
  dataviewCommand.TaskTag = taskId;
8115
8121
  return dataviewCommand;
8116
8122
  }
8123
+ static CreateControlItemsRefreshCommand(taskId, control) {
8124
+ let command = new ControlItemsRefreshCommand();
8125
+ command.CommandType = DataViewCommandType.ControlItemsRefresh;
8126
+ command.TaskTag = taskId;
8127
+ command.Control = control;
8128
+ return command;
8129
+ }
8117
8130
  static CreateAddUserRangeDataviewCommand(taskId, userRange) {
8118
8131
  let addUserRangeDataviewCommand = new AddUserRangeDataviewCommand();
8119
8132
  addUserRangeDataviewCommand.TaskTag = taskId;
@@ -11091,6 +11104,11 @@ class ExpressionEvaluator extends GuiExpressionEvaluator {
11091
11104
  this.eval_op_VarDisplayName(resVal, val1);
11092
11105
  expStrTracker.resetNullResult();
11093
11106
  break;
11107
+ case ExpressionInterface.EXP_OP_CONTROL_ITEMS_REFRESH:
11108
+ val2 = valStack.pop();
11109
+ val1 = valStack.pop();
11110
+ yield this.eval_op_controlItemRefresh(val1, val2, resVal);
11111
+ break;
11094
11112
  case ExpressionInterface.EXP_OP_VARCONTROLID:
11095
11113
  val1 = valStack.pop();
11096
11114
  this.eval_op_VarControlID(resVal, val1);
@@ -13235,6 +13253,28 @@ class ExpressionEvaluator extends GuiExpressionEvaluator {
13235
13253
  resVal.StrVal = fld.VarDisplayName;
13236
13254
  }
13237
13255
  }
13256
+ eval_op_controlItemRefresh(val1, val2, resVal) {
13257
+ const _super = Object.create(null, {
13258
+ GetContextTask: { get: () => super.GetContextTask }
13259
+ });
13260
+ return __awaiter(this, void 0, void 0, function* () {
13261
+ let success = false;
13262
+ let parent = val2.MgNumVal.NUM_2_LONG();
13263
+ resVal.Attr = StorageAttribute.BOOLEAN;
13264
+ if ((parent >= 0 && parent < (this.ExpTask.getTaskDepth(false))) || parent === ExpressionEvaluator.TRIGGER_TASK) {
13265
+ let tsk = _super.GetContextTask.call(this, parent);
13266
+ if (tsk != null && tsk.getForm() != null) {
13267
+ let control = tsk.getForm().GetCtrl(val1.StrVal);
13268
+ if (control != null && control.isChoiceControl() && control.isDataCtrl()) {
13269
+ let command = CommandFactory.CreateControlItemsRefreshCommand(tsk.getTaskTag(), control);
13270
+ yield tsk.DataviewManager.CurrentDataviewManager.Execute(command);
13271
+ success = true;
13272
+ }
13273
+ }
13274
+ }
13275
+ resVal.BoolVal = success;
13276
+ });
13277
+ }
13238
13278
  eval_op_VarControlID(resVal, val1) {
13239
13279
  let ret = 0;
13240
13280
  if (val1.MgNumVal !== null) {
@@ -19831,7 +19871,11 @@ class MgForm extends MgFormBase {
19831
19871
  this.GetDataview().setTopRecIdxModified(true);
19832
19872
  try {
19833
19873
  this._suffixDone = false;
19834
- yield this.setCurrRowByDisplayLine(this.GetDataview().getCurrRecIdx() + size, true, false);
19874
+ let newDisplayLine = this.GetDataview().getCurrRecIdx() + size;
19875
+ if (unit === Constants.MOVE_UNIT_PAGE && this.isLineMode())
19876
+ if (newDisplayLine > this.GetDataview().getSize() - 1)
19877
+ visibleLine -= newDisplayLine - (this.GetDataview().getSize() - 1);
19878
+ yield this.setCurrRowByDisplayLine(newDisplayLine, true, false);
19835
19879
  this.GetDataview().setTopRecIdxModified(false);
19836
19880
  yield this.RefreshDisplay(Constants.TASK_REFRESH_FORM);
19837
19881
  }
@@ -30388,7 +30432,7 @@ class CommandsTable {
30388
30432
  }
30389
30433
  }
30390
30434
 
30391
- let CurrentClientVersion = '4.900.0';
30435
+ let CurrentClientVersion = '4.1000.0-dev000.0';
30392
30436
 
30393
30437
  class ClientManager {
30394
30438
  constructor() {
@@ -30479,6 +30523,10 @@ class ClientManager {
30479
30523
  EventsManager.Instance.addGuiTriggeredEventWithTaskAndCodeAndLine(task, InternalInterface.MG_ACT_REC_PREFIX, dvRowIdx);
30480
30524
  }
30481
30525
  break;
30526
+ case "navigateInTable":
30527
+ if (guiEvent.ControlName === "magicRow")
30528
+ this.handleNavigateInRowEvent(task, guiEvent.Value);
30529
+ break;
30482
30530
  case "close":
30483
30531
  if (task.IsRoute())
30484
30532
  EventsManager.Instance.AddRouterClosedEvent(task);
@@ -30513,6 +30561,38 @@ class ClientManager {
30513
30561
  break;
30514
30562
  }
30515
30563
  }
30564
+ handleNavigateInRowEvent(task, evt) {
30565
+ let internalEvt = InternalInterface.MG_ACT_NONE;
30566
+ evt = evt.toLowerCase();
30567
+ switch (evt) {
30568
+ case "begin-page":
30569
+ internalEvt = InternalInterface.MG_ACT_TBL_BEGPAGE;
30570
+ break;
30571
+ case "previous-page":
30572
+ internalEvt = InternalInterface.MG_ACT_TBL_PRVPAGE;
30573
+ break;
30574
+ case "end-page":
30575
+ internalEvt = InternalInterface.MG_ACT_TBL_ENDPAGE;
30576
+ break;
30577
+ case "next-page":
30578
+ internalEvt = InternalInterface.MG_ACT_TBL_NXTPAGE;
30579
+ break;
30580
+ case "previous-line":
30581
+ internalEvt = InternalInterface.MG_ACT_TBL_PRVLINE;
30582
+ break;
30583
+ case "next-line":
30584
+ internalEvt = InternalInterface.MG_ACT_TBL_NXTLINE;
30585
+ break;
30586
+ case "begin-table":
30587
+ internalEvt = InternalInterface.MG_ACT_TBL_BEGTBL;
30588
+ break;
30589
+ case "end-table":
30590
+ internalEvt = InternalInterface.MG_ACT_TBL_ENDTBL;
30591
+ break;
30592
+ }
30593
+ if (internalEvt != InternalInterface.MG_ACT_NONE)
30594
+ EventsManager.Instance.addGuiTriggeredEventWithTaskAndCode(task, internalEvt);
30595
+ }
30516
30596
  ConfirmationClosed(res) {
30517
30597
  Commands.ResolvePromise(res);
30518
30598
  }
@@ -30793,13 +30873,6 @@ class MagicBridge {
30793
30873
  }
30794
30874
  }
30795
30875
 
30796
- class ControlItemsRefreshCommand extends DataviewCommand {
30797
- constructor() {
30798
- super();
30799
- this.Control = null;
30800
- }
30801
- }
30802
-
30803
30876
  class DataViewOutputCommand extends DataviewCommand {
30804
30877
  constructor(OutputCommandType) {
30805
30878
  super();