@xuda.io/runtime-bundle 1.0.712 → 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.
@@ -4897,17 +4897,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
4897
4897
  fields_changed.push(field_id);
4898
4898
 
4899
4899
  ///// REFRESH PARAMETERS IN
4900
-
4901
- for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
4902
- if (_ds.args.parameters_raw_obj) {
4903
- for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
4904
- if (exp.includes(field_id)) {
4905
- let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
4906
- _ds.in_parameters[key].value = ret.result;
4907
- }
4908
- }
4909
- }
4910
- }
4900
+ // for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
4901
+ // if (_ds.args.parameters_raw_obj) {
4902
+ // for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
4903
+ // if (exp.includes(field_id)) {
4904
+ // let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
4905
+ // _ds.in_parameters[key].value = ret.result;
4906
+ // }
4907
+ // }
4908
+ // }
4909
+ // }
4911
4910
  }
4912
4911
  if (!datasource_changed.includes(dataSource)) {
4913
4912
  datasource_changed.push(dataSource);
@@ -11190,7 +11189,7 @@ func.expression.secure_eval = async function (SESSION_ID, sourceP, val, job_id,
11190
11189
  }
11191
11190
  };
11192
11191
  func.UI.screen = {};
11193
- 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) {
11194
11193
  if (!prog_id) return console.error('program is empty');
11195
11194
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
11196
11195
  if (!screen_ret) return console.error('program is not a screen object');
@@ -11243,7 +11242,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11243
11242
  screenInfo,
11244
11243
  call_screen_propertiesP,
11245
11244
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
11246
- parameters_raw_obj,
11247
11245
  };
11248
11246
 
11249
11247
  switch (screen_type) {
@@ -11410,7 +11408,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
11410
11408
  rowIdP,
11411
11409
  jobNoP,
11412
11410
  null,
11413
- parameters_raw_obj,
11411
+ null,
11414
11412
  null,
11415
11413
  null,
11416
11414
  null,
@@ -12186,32 +12184,43 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
12186
12184
  if (!_prog) return;
12187
12185
 
12188
12186
  // get in parameters
12189
- let params_res = {},
12190
- params_raw = {};
12187
+ var params_obj = {};
12191
12188
  if (_prog?.properties?.progParams) {
12192
12189
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
12193
12190
  if (!['in', 'out'].includes(val.data.dir)) continue;
12194
12191
 
12195
12192
  if (nodeP.attributes) {
12196
12193
  if (nodeP.attributes[val.data.parameter]) {
12197
- params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
12194
+ params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
12198
12195
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
12199
12196
  if (val.data.dir == 'out') {
12200
12197
  // only reference
12201
- 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('@', '');
12202
12199
  } else {
12203
12200
  // in parameter
12204
12201
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
12205
- params_res[val.data.parameter] = ret.result;
12206
- params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
12202
+ params_obj[val.data.parameter] = ret.result;
12207
12203
  }
12208
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
+ // }
12209
12218
  continue;
12210
12219
  }
12211
12220
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
12212
12221
  }
12213
12222
  }
12214
- return { params_res, params_raw };
12223
+ return params_obj;
12215
12224
  };
12216
12225
 
12217
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) {
@@ -12228,8 +12237,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12228
12237
  const init_program = async function () {
12229
12238
  async function render_panel() {
12230
12239
  const prog_id = val.value?.prog || val.value;
12231
- const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
12232
- 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);
12233
12242
  ret = { $new_div: ret_panel };
12234
12243
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
12235
12244
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -12278,8 +12287,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12278
12287
  const program = val.value?.prog || val.value;
12279
12288
  var $wrapper = $('<div>');
12280
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, '');
12281
- const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
12282
- 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');
12283
12292
  ret = {
12284
12293
  $new_div: ret_init,
12285
12294
  abort: true,
@@ -4898,17 +4898,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
4898
4898
  fields_changed.push(field_id);
4899
4899
 
4900
4900
  ///// REFRESH PARAMETERS IN
4901
-
4902
- for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
4903
- if (_ds.args.parameters_raw_obj) {
4904
- for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
4905
- if (exp.includes(field_id)) {
4906
- let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
4907
- _ds.in_parameters[key].value = ret.result;
4908
- }
4909
- }
4910
- }
4911
- }
4901
+ // for (const [_dsSession, _ds] of Object.entries(_session.DS_GLB)) {
4902
+ // if (_ds.args.parameters_raw_obj) {
4903
+ // for (const [key, exp] of Object.entries(_ds.args.parameters_raw_obj)) {
4904
+ // if (exp.includes(field_id)) {
4905
+ // let ret = await func.expression.get(SESSION_ID, exp, _dsSession, 'parameters');
4906
+ // _ds.in_parameters[key].value = ret.result;
4907
+ // }
4908
+ // }
4909
+ // }
4910
+ // }
4912
4911
  }
4913
4912
  if (!datasource_changed.includes(dataSource)) {
4914
4913
  datasource_changed.push(dataSource);
@@ -8912,7 +8911,7 @@ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_
8912
8911
  return elm_nodes;
8913
8912
  };
8914
8913
  func.UI.screen = {};
8915
- 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) {
8916
8915
  if (!prog_id) return console.error('program is empty');
8917
8916
  let screen_ret = await func.utils.get_screen_obj(SESSION_ID, prog_id);
8918
8917
  if (!screen_ret) return console.error('program is not a screen object');
@@ -8965,7 +8964,6 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
8965
8964
  screenInfo,
8966
8965
  call_screen_propertiesP,
8967
8966
  parentDataSourceNoP: _session.DS_GLB?.[callingDataSource_objP?.dsSession]?.dsSession || callingDataSource_objP?.parentDataSourceNo || 0,
8968
- parameters_raw_obj,
8969
8967
  };
8970
8968
 
8971
8969
  switch (screen_type) {
@@ -9132,7 +9130,7 @@ func.UI.screen.init = async function (SESSION_ID, prog_id, sourceScreenP, callin
9132
9130
  rowIdP,
9133
9131
  jobNoP,
9134
9132
  null,
9135
- parameters_raw_obj,
9133
+ null,
9136
9134
  null,
9137
9135
  null,
9138
9136
  null,
@@ -9908,32 +9906,43 @@ const get_params_obj_new = async function (SESSION_ID, prog_id, nodeP, dsSession
9908
9906
  if (!_prog) return;
9909
9907
 
9910
9908
  // get in parameters
9911
- let params_res = {},
9912
- params_raw = {};
9909
+ var params_obj = {};
9913
9910
  if (_prog?.properties?.progParams) {
9914
9911
  for await (const [key, val] of Object.entries(_prog.properties.progParams)) {
9915
9912
  if (!['in', 'out'].includes(val.data.dir)) continue;
9916
9913
 
9917
9914
  if (nodeP.attributes) {
9918
9915
  if (nodeP.attributes[val.data.parameter]) {
9919
- params_res[val.data.parameter] = nodeP.attributes[val.data.parameter];
9916
+ params_obj[val.data.parameter] = nodeP.attributes[val.data.parameter];
9920
9917
  } else if (nodeP.attributes[`xu-exp:${val.data.parameter}`]) {
9921
9918
  if (val.data.dir == 'out') {
9922
9919
  // only reference
9923
- 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('@', '');
9924
9921
  } else {
9925
9922
  // in parameter
9926
9923
  let ret = await func.expression.get(SESSION_ID, nodeP.attributes[`xu-exp:${val.data.parameter}`], dsSession, 'parameters');
9927
- params_res[val.data.parameter] = ret.result;
9928
- params_raw[val.data.parameter] = nodeP.attributes[`xu-exp:${val.data.parameter}`];
9924
+ params_obj[val.data.parameter] = ret.result;
9929
9925
  }
9930
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
+ // }
9931
9940
  continue;
9932
9941
  }
9933
9942
  console.warn(`Warning: Program ${_prog.properties.menuName} expected In parameter: ${val.data.parameter} but received null instead`);
9934
9943
  }
9935
9944
  }
9936
- return { params_res, params_raw };
9945
+ return params_obj;
9937
9946
  };
9938
9947
 
9939
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) {
@@ -9950,8 +9959,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
9950
9959
  const init_program = async function () {
9951
9960
  async function render_panel() {
9952
9961
  const prog_id = val.value?.prog || val.value;
9953
- const params_obj = await get_params_obj_new(SESSION_ID, prog_id, nodeP, paramsP.dsSessionP);
9954
- 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);
9955
9964
  ret = { $new_div: ret_panel };
9956
9965
  $container.data().xuData.xuPanelProps = $elm.data().xuAttributes;
9957
9966
  $container.data().xuData.xuPanelData = ret_panel.data();
@@ -10000,8 +10009,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10000
10009
  const program = val.value?.prog || val.value;
10001
10010
  var $wrapper = $('<div>');
10002
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, '');
10003
- const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
10004
- 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');
10005
10014
  ret = {
10006
10015
  $new_div: ret_init,
10007
10016
  abort: true,