@xuda.io/runtime-bundle 1.0.701 → 1.0.703

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.
@@ -28008,7 +28008,7 @@ func.datasource.create = async function (
28008
28008
  rowIdP,
28009
28009
  jobNoP,
28010
28010
  calling_trigger_prop,
28011
- screen_param,
28011
+ parameters_raw_obj,
28012
28012
  NA_isInitP,
28013
28013
  NA_callingSourceP,
28014
28014
  calling_jobP,
@@ -28041,6 +28041,7 @@ func.datasource.create = async function (
28041
28041
  parameters_obj_inP,
28042
28042
  static_refreshP,
28043
28043
  worker_id,
28044
+ parameters_raw_obj,
28044
28045
  };
28045
28046
 
28046
28047
  var IS_DATASOURCE_REFRESH = null;
@@ -30842,7 +30843,7 @@ func.datasource.get_args_property_value = async function (SESSION_ID, dsSession,
30842
30843
  return _value;
30843
30844
  };
30844
30845
  func.UI.screen = {};
30845
- 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) {
30846
+ 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) {
30846
30847
  if (!prog_id) return console.error('program is empty');
30847
30848
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
30848
30849
  if (!screen_ret) return console.error('program is not a screen object');
@@ -30895,6 +30896,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
30895
30896
  screenInfo,
30896
30897
  call_screen_propertiesP,
30897
30898
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
30899
+ parameters_raw_obj,
30898
30900
  };
30899
30901
 
30900
30902
  switch (screen_type) {
@@ -31061,7 +31063,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
31061
31063
  rowIdP,
31062
31064
  jobNoP,
31063
31065
  null,
31064
- null,
31066
+ parameters_raw_obj,
31065
31067
  null,
31066
31068
  null,
31067
31069
  null,
@@ -31574,6 +31576,13 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31574
31576
  // $("[xu-ui-id='" + elm_to_delete + "']").remove();
31575
31577
  // });
31576
31578
 
31579
+ if (_session.engine_mode === 'live_preview') {
31580
+ console.info('========= refresh main info ==============');
31581
+ console.info('reason:', refresh_reason);
31582
+ console.info('element:', $elm);
31583
+ console.info('==========================================');
31584
+ }
31585
+
31577
31586
  return;
31578
31587
  }
31579
31588
  }
@@ -31830,43 +31839,32 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
31830
31839
  if (!_prog) return;
31831
31840
 
31832
31841
  // get in parameters
31833
- var params_obj = {};
31842
+ let params_res = {},
31843
+ params_raw = {};
31834
31844
  if (_prog?.properties?.progParams) {
31835
31845
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
31836
31846
  if (!['in', 'out'].includes(val.data.dir)) continue;
31837
31847
 
31838
31848
  if (nodeP.attributes) {
31839
31849
  if (nodeP.attributes[val.data.parameter]) {
31840
- params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
31850
+ params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
31841
31851
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
31842
31852
  if (val.data.dir == 'out') {
31843
31853
  // only reference
31844
- params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
31854
+ params_res[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
31845
31855
  } else {
31846
31856
  // in parameter
31847
31857
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
31848
- params_obj[val.data.parameter] = ret.result;
31858
+ params_res[val.data.parameter] = ret.result;
31859
+ params_raw[val.data.parameter] = `xu-exp:${val.data.parameter}`;
31849
31860
  }
31850
31861
  }
31851
-
31852
- // if (parameters_obj_inP?.[val.data.parameter].fx) {
31853
- // let ret = await func.expression.get(
31854
- // SESSION_ID,
31855
- // parameters_obj_inP?.[val.data.parameter].fx,
31856
- // dsSession,
31857
- // "parameters"
31858
- // );
31859
- // params_obj[val.data.parameter] = ret.result;
31860
- // } else {
31861
- // params_obj[val.data.parameter] =
31862
- // parameters_obj_inP?.[val.data.parameter].value;
31863
- // }
31864
31862
  continue;
31865
31863
  }
31866
31864
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
31867
31865
  }
31868
31866
  }
31869
- return params_obj;
31867
+ return { params_res, params_raw };
31870
31868
  };
31871
31869
 
31872
31870
  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) {
@@ -31883,8 +31881,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31883
31881
  const init_program = async function () {
31884
31882
  async function render_panel() {
31885
31883
  const prog_id = val.value?.prog || val.value;
31886
- const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
31887
- 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);
31884
+ const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
31885
+ let ret_panel = await func.UI.screen.init(SESSION_ID, prog_id, paramsP.screenId, _ds, $elm, null, _ds.currentRecordId, null, true, params_obj.param_res, 'initXu_panel', undefined, prog_id !== _ds.prog_id ? null : refreshed_ds, params_obj.param_raw);
31888
31886
  ret = { $new_div: ret_panel };
31889
31887
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
31890
31888
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -31933,8 +31931,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31933
31931
  const program = val.value?.prog || val.value;
31934
31932
  var $wrapper = $('<div>');
31935
31933
  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, '');
31936
- const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
31937
- let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
31934
+ const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
31935
+ let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.param_res, 'alterXu_panel', undefined, undefined, params_obj.param_raw);
31938
31936
  ret = {
31939
31937
  $new_div: ret_init,
31940
31938
  abort: true,
@@ -36379,7 +36377,7 @@ func.events.execute = async function (
36379
36377
  var params_obj = {};
36380
36378
  if (_prog?.properties?.progParams) {
36381
36379
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
36382
- if (!val.data.dir === 'in') continue;
36380
+ if (val.data.dir !== 'in') continue;
36383
36381
  if (typeof args.parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
36384
36382
  if (args.parameters_obj_inP?.[val.data.parameter].fx) {
36385
36383
  let ret = await func.expression.get(SESSION_ID, args.parameters_obj_inP?.[val.data.parameter].fx, dsSession, 'parameters');