@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.
@@ -2899,7 +2899,7 @@ func.datasource.create = async function (
2899
2899
  rowIdP,
2900
2900
  jobNoP,
2901
2901
  calling_trigger_prop,
2902
- screen_param,
2902
+ parameters_raw_obj,
2903
2903
  NA_isInitP,
2904
2904
  NA_callingSourceP,
2905
2905
  calling_jobP,
@@ -2932,6 +2932,7 @@ func.datasource.create = async function (
2932
2932
  parameters_obj_inP,
2933
2933
  static_refreshP,
2934
2934
  worker_id,
2935
+ parameters_raw_obj,
2935
2936
  };
2936
2937
 
2937
2938
  var IS_DATASOURCE_REFRESH = null;
@@ -9373,7 +9374,7 @@ func.events.execute = async function (
9373
9374
  var params_obj = {};
9374
9375
  if (_prog?.properties?.progParams) {
9375
9376
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
9376
- if (!val.data.dir === 'in') continue;
9377
+ if (val.data.dir !== 'in') continue;
9377
9378
  if (typeof args.parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
9378
9379
  if (args.parameters_obj_inP?.[val.data.parameter].fx) {
9379
9380
  let ret = await func.expression.get(SESSION_ID, args.parameters_obj_inP?.[val.data.parameter].fx, dsSession, 'parameters');
@@ -11161,7 +11162,7 @@ func.expression.secure_eval = async function (SESSION_ID, sourceP, val, job_id,
11161
11162
  }
11162
11163
  };
11163
11164
  func.UI.screen = {};
11164
- 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) {
11165
+ 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) {
11165
11166
  if (!prog_id) return console.error('program is empty');
11166
11167
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
11167
11168
  if (!screen_ret) return console.error('program is not a screen object');
@@ -11214,6 +11215,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11214
11215
  screenInfo,
11215
11216
  call_screen_propertiesP,
11216
11217
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
11218
+ parameters_raw_obj,
11217
11219
  };
11218
11220
 
11219
11221
  switch (screen_type) {
@@ -11380,7 +11382,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11380
11382
  rowIdP,
11381
11383
  jobNoP,
11382
11384
  null,
11383
- null,
11385
+ parameters_raw_obj,
11384
11386
  null,
11385
11387
  null,
11386
11388
  null,
@@ -11893,6 +11895,13 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11893
11895
  // $("[xu-ui-id='" + elm_to_delete + "']").remove();
11894
11896
  // });
11895
11897
 
11898
+ if (_session.engine_mode === 'live_preview') {
11899
+ console.info('========= refresh main info ==============');
11900
+ console.info('reason:', refresh_reason);
11901
+ console.info('element:', $elm);
11902
+ console.info('==========================================');
11903
+ }
11904
+
11896
11905
  return;
11897
11906
  }
11898
11907
  }
@@ -12149,43 +12158,32 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
12149
12158
  if (!_prog) return;
12150
12159
 
12151
12160
  // get in parameters
12152
- var params_obj = {};
12161
+ let params_res = {},
12162
+ params_raw = {};
12153
12163
  if (_prog?.properties?.progParams) {
12154
12164
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
12155
12165
  if (!['in', 'out'].includes(val.data.dir)) continue;
12156
12166
 
12157
12167
  if (nodeP.attributes) {
12158
12168
  if (nodeP.attributes[val.data.parameter]) {
12159
- params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
12169
+ params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
12160
12170
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
12161
12171
  if (val.data.dir == 'out') {
12162
12172
  // only reference
12163
- params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
12173
+ params_res[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
12164
12174
  } else {
12165
12175
  // in parameter
12166
12176
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
12167
- params_obj[val.data.parameter] = ret.result;
12177
+ params_res[val.data.parameter] = ret.result;
12178
+ params_raw[val.data.parameter] = `xu-exp:${val.data.parameter}`;
12168
12179
  }
12169
12180
  }
12170
-
12171
- // if (parameters_obj_inP?.[val.data.parameter].fx) {
12172
- // let ret = await func.expression.get(
12173
- // SESSION_ID,
12174
- // parameters_obj_inP?.[val.data.parameter].fx,
12175
- // dsSession,
12176
- // "parameters"
12177
- // );
12178
- // params_obj[val.data.parameter] = ret.result;
12179
- // } else {
12180
- // params_obj[val.data.parameter] =
12181
- // parameters_obj_inP?.[val.data.parameter].value;
12182
- // }
12183
12181
  continue;
12184
12182
  }
12185
12183
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
12186
12184
  }
12187
12185
  }
12188
- return params_obj;
12186
+ return { params_res, params_raw };
12189
12187
  };
12190
12188
 
12191
12189
  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) {
@@ -12202,8 +12200,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12202
12200
  const init_program = async function () {
12203
12201
  async function render_panel() {
12204
12202
  const prog_id = val.value?.prog || val.value;
12205
- const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
12206
- 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);
12203
+ const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
12204
+ 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);
12207
12205
  ret = { $new_div: ret_panel };
12208
12206
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
12209
12207
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -12252,8 +12250,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12252
12250
  const program = val.value?.prog || val.value;
12253
12251
  var $wrapper = $('<div>');
12254
12252
  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, '');
12255
- const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
12256
- let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
12253
+ const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
12254
+ 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);
12257
12255
  ret = {
12258
12256
  $new_div: ret_init,
12259
12257
  abort: true,
@@ -2900,7 +2900,7 @@ func.datasource.create = async function (
2900
2900
  rowIdP,
2901
2901
  jobNoP,
2902
2902
  calling_trigger_prop,
2903
- screen_param,
2903
+ parameters_raw_obj,
2904
2904
  NA_isInitP,
2905
2905
  NA_callingSourceP,
2906
2906
  calling_jobP,
@@ -2933,6 +2933,7 @@ func.datasource.create = async function (
2933
2933
  parameters_obj_inP,
2934
2934
  static_refreshP,
2935
2935
  worker_id,
2936
+ parameters_raw_obj,
2936
2937
  };
2937
2938
 
2938
2939
  var IS_DATASOURCE_REFRESH = null;
@@ -8883,7 +8884,7 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
8883
8884
  return elm_nodes;
8884
8885
  };
8885
8886
  func.UI.screen = {};
8886
- 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) {
8887
+ 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) {
8887
8888
  if (!prog_id) return console.error('program is empty');
8888
8889
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
8889
8890
  if (!screen_ret) return console.error('program is not a screen object');
@@ -8936,6 +8937,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
8936
8937
  screenInfo,
8937
8938
  call_screen_propertiesP,
8938
8939
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
8940
+ parameters_raw_obj,
8939
8941
  };
8940
8942
 
8941
8943
  switch (screen_type) {
@@ -9102,7 +9104,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
9102
9104
  rowIdP,
9103
9105
  jobNoP,
9104
9106
  null,
9105
- null,
9107
+ parameters_raw_obj,
9106
9108
  null,
9107
9109
  null,
9108
9110
  null,
@@ -9615,6 +9617,13 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9615
9617
  // $("[xu-ui-id='" + elm_to_delete + "']").remove();
9616
9618
  // });
9617
9619
 
9620
+ if (_session.engine_mode === 'live_preview') {
9621
+ console.info('========= refresh main info ==============');
9622
+ console.info('reason:', refresh_reason);
9623
+ console.info('element:', $elm);
9624
+ console.info('==========================================');
9625
+ }
9626
+
9618
9627
  return;
9619
9628
  }
9620
9629
  }
@@ -9871,43 +9880,32 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
9871
9880
  if (!_prog) return;
9872
9881
 
9873
9882
  // get in parameters
9874
- var params_obj = {};
9883
+ let params_res = {},
9884
+ params_raw = {};
9875
9885
  if (_prog?.properties?.progParams) {
9876
9886
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
9877
9887
  if (!['in', 'out'].includes(val.data.dir)) continue;
9878
9888
 
9879
9889
  if (nodeP.attributes) {
9880
9890
  if (nodeP.attributes[val.data.parameter]) {
9881
- params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
9891
+ params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
9882
9892
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
9883
9893
  if (val.data.dir == 'out') {
9884
9894
  // only reference
9885
- params_obj[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
9895
+ params_res[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`].replaceAll('@', '');
9886
9896
  } else {
9887
9897
  // in parameter
9888
9898
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
9889
- params_obj[val.data.parameter] = ret.result;
9899
+ params_res[val.data.parameter] = ret.result;
9900
+ params_raw[val.data.parameter] = `xu-exp:${val.data.parameter}`;
9890
9901
  }
9891
9902
  }
9892
-
9893
- // if (parameters_obj_inP?.[val.data.parameter].fx) {
9894
- // let ret = await func.expression.get(
9895
- // SESSION_ID,
9896
- // parameters_obj_inP?.[val.data.parameter].fx,
9897
- // dsSession,
9898
- // "parameters"
9899
- // );
9900
- // params_obj[val.data.parameter] = ret.result;
9901
- // } else {
9902
- // params_obj[val.data.parameter] =
9903
- // parameters_obj_inP?.[val.data.parameter].value;
9904
- // }
9905
9903
  continue;
9906
9904
  }
9907
9905
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
9908
9906
  }
9909
9907
  }
9910
- return params_obj;
9908
+ return { params_res, params_raw };
9911
9909
  };
9912
9910
 
9913
9911
  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) {
@@ -9924,8 +9922,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
9924
9922
  const init_program = async function () {
9925
9923
  async function render_panel() {
9926
9924
  const prog_id = val.value?.prog || val.value;
9927
- const param_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
9928
- 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);
9925
+ const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
9926
+ 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);
9929
9927
  ret = { $new_div: ret_panel };
9930
9928
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
9931
9929
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -9974,8 +9972,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
9974
9972
  const program = val.value?.prog || val.value;
9975
9973
  var $wrapper = $('<div>');
9976
9974
  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, '');
9977
- const param_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
9978
- let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, param_obj, 'alterXu_panel');
9975
+ const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
9976
+ 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);
9979
9977
  ret = {
9980
9978
  $new_div: ret_init,
9981
9979
  abort: true,
@@ -13466,7 +13464,7 @@ func.events.execute = async function (
13466
13464
  var params_obj = {};
13467
13465
  if (_prog?.properties?.progParams) {
13468
13466
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
13469
- if (!val.data.dir === 'in') continue;
13467
+ if (val.data.dir !== 'in') continue;
13470
13468
  if (typeof args.parameters_obj_inP?.[val.data.parameter] !== 'undefined') {
13471
13469
  if (args.parameters_obj_inP?.[val.data.parameter].fx) {
13472
13470
  let ret = await func.expression.get(SESSION_ID, args.parameters_obj_inP?.[val.data.parameter].fx, dsSession, 'parameters');