@xuda.io/runtime-bundle 1.0.713 → 1.0.714

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.
@@ -11189,7 +11189,7 @@ func.expression.secure_eval = async function (SESSION_ID, sourceP, val, job_id,
11189
11189
  }
11190
11190
  };
11191
11191
  func.UI.screen = {};
11192
- func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds, parameters_raw_obj) {
11192
+ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds) {
11193
11193
  if (!prog_id) return console.error('program is empty');
11194
11194
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
11195
11195
  if (!screen_ret) return console.error('program is not a screen object');
@@ -11242,7 +11242,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11242
11242
  screenInfo,
11243
11243
  call_screen_propertiesP,
11244
11244
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
11245
- parameters_raw_obj,
11246
11245
  };
11247
11246
 
11248
11247
  switch (screen_type) {
@@ -11409,7 +11408,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11409
11408
  rowIdP,
11410
11409
  jobNoP,
11411
11410
  null,
11412
- parameters_raw_obj,
11411
+ null,
11413
11412
  null,
11414
11413
  null,
11415
11414
  null,
@@ -12185,32 +12184,43 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
12185
12184
  if (!_prog) return;
12186
12185
 
12187
12186
  // get in parameters
12188
- let params_res = {},
12189
- params_raw = {};
12187
+ var params_obj = {};
12190
12188
  if (_prog?.properties?.progParams) {
12191
12189
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
12192
12190
  if (!['in', 'out'].includes(val.data.dir)) continue;
12193
12191
 
12194
12192
  if (nodeP.attributes) {
12195
12193
  if (nodeP.attributes[val.data.parameter]) {
12196
- params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
12194
+ params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
12197
12195
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
12198
12196
  if (val.data.dir == 'out') {
12199
12197
  // only reference
12200
- params_res[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
12198
+ params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
12201
12199
  } else {
12202
12200
  // in parameter
12203
12201
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
12204
- params_res[val.data.parameter] = ret.result;
12205
- params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
12202
+ params_obj[val.data.parameter] = ret.result;
12206
12203
  }
12207
12204
  }
12205
+
12206
+ // if (parameters_obj_inP?.[val.data.parameter].fx) {
12207
+ // let ret = await func.expression.get(
12208
+ // SESSION_ID,
12209
+ // parameters_obj_inP?.[val.data.parameter].fx,
12210
+ // dsSession,
12211
+ // "parameters"
12212
+ // );
12213
+ // params_obj[val.data.parameter] = ret.result;
12214
+ // } else {
12215
+ // params_obj[val.data.parameter] =
12216
+ // parameters_obj_inP?.[val.data.parameter].value;
12217
+ // }
12208
12218
  continue;
12209
12219
  }
12210
12220
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
12211
12221
  }
12212
12222
  }
12213
- return { params_res, params_raw };
12223
+ return params_obj;
12214
12224
  };
12215
12225
 
12216
12226
  func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, xu_func, $elm, val, is_init, refreshed_ds) {
@@ -12227,8 +12237,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12227
12237
  const init_program = async function () {
12228
12238
  async function render_panel() {
12229
12239
  const prog_id = val.value?.prog || val.value;
12230
- const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
12231
- let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, params_obj.params_res, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds, params_obj.params_raw);
12240
+ const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
12241
+ let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, param_obj, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds);
12232
12242
  ret = { $new_div: ret_panel };
12233
12243
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
12234
12244
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -12277,8 +12287,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12277
12287
  const program = val.value?.prog || val.value;
12278
12288
  var $wrapper = $('<div>');
12279
12289
  var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
12280
- const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
12281
- let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
12290
+ const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
12291
+ let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
12282
12292
  ret = {
12283
12293
  $new_div: ret_init,
12284
12294
  abort: true,
@@ -8911,7 +8911,7 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
8911
8911
  return elm_nodes;
8912
8912
  };
8913
8913
  func.UI.screen = {};
8914
- func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds, parameters_raw_obj) {
8914
+ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callingDataSource_objP, $callingContainerP, triggerIdP, rowIdP, jobNoP, is_panelP, parameters_obj_inP, source_functionP, call_screen_propertiesP, refreshed_ds) {
8915
8915
  if (!prog_id) return console.error('program is empty');
8916
8916
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
8917
8917
  if (!screen_ret) return console.error('program is not a screen object');
@@ -8964,7 +8964,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
8964
8964
  screenInfo,
8965
8965
  call_screen_propertiesP,
8966
8966
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
8967
- parameters_raw_obj,
8968
8967
  };
8969
8968
 
8970
8969
  switch (screen_type) {
@@ -9131,7 +9130,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
9131
9130
  rowIdP,
9132
9131
  jobNoP,
9133
9132
  null,
9134
- parameters_raw_obj,
9133
+ null,
9135
9134
  null,
9136
9135
  null,
9137
9136
  null,
@@ -9907,32 +9906,43 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
9907
9906
  if (!_prog) return;
9908
9907
 
9909
9908
  // get in parameters
9910
- let params_res = {},
9911
- params_raw = {};
9909
+ var params_obj = {};
9912
9910
  if (_prog?.properties?.progParams) {
9913
9911
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
9914
9912
  if (!['in', 'out'].includes(val.data.dir)) continue;
9915
9913
 
9916
9914
  if (nodeP.attributes) {
9917
9915
  if (nodeP.attributes[val.data.parameter]) {
9918
- params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
9916
+ params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
9919
9917
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
9920
9918
  if (val.data.dir == 'out') {
9921
9919
  // only reference
9922
- params_res[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
9920
+ params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
9923
9921
  } else {
9924
9922
  // in parameter
9925
9923
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
9926
- params_res[val.data.parameter] = ret.result;
9927
- params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
9924
+ params_obj[val.data.parameter] = ret.result;
9928
9925
  }
9929
9926
  }
9927
+
9928
+ // if (parameters_obj_inP?.[val.data.parameter].fx) {
9929
+ // let ret = await func.expression.get(
9930
+ // SESSION_ID,
9931
+ // parameters_obj_inP?.[val.data.parameter].fx,
9932
+ // dsSession,
9933
+ // "parameters"
9934
+ // );
9935
+ // params_obj[val.data.parameter] = ret.result;
9936
+ // } else {
9937
+ // params_obj[val.data.parameter] =
9938
+ // parameters_obj_inP?.[val.data.parameter].value;
9939
+ // }
9930
9940
  continue;
9931
9941
  }
9932
9942
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
9933
9943
  }
9934
9944
  }
9935
- return { params_res, params_raw };
9945
+ return params_obj;
9936
9946
  };
9937
9947
 
9938
9948
  func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, xu_func, $elm, val, is_init, refreshed_ds) {
@@ -9949,8 +9959,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
9949
9959
  const init_program = async function () {
9950
9960
  async function render_panel() {
9951
9961
  const prog_id = val.value?.prog || val.value;
9952
- const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
9953
- let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, params_obj.params_res, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds, params_obj.params_raw);
9962
+ const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
9963
+ let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, param_obj, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds);
9954
9964
  ret = { $new_div: ret_panel };
9955
9965
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
9956
9966
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -9999,8 +10009,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
9999
10009
  const program = val.value?.prog || val.value;
10000
10010
  var $wrapper = $('<div>');
10001
10011
  var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
10002
- const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
10003
- let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
10012
+ const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
10013
+ let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
10004
10014
  ret = {
10005
10015
  $new_div: ret_init,
10006
10016
  abort: true,