@xuda.io/runtime-bundle 1.0.1423 → 1.0.1425

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.
@@ -35083,10 +35083,11 @@ func.runtime.render.bind_xu_event = function (options) {
35083
35083
  evt[val.event_modifiers]();
35084
35084
  }
35085
35085
 
35086
- if (val.workflow) {
35087
- const workflow_keys = Object.keys(val.workflow);
35086
+ const workflow = val.workflow || val.event;
35087
+ if (workflow) {
35088
+ const workflow_keys = Object.keys(workflow);
35088
35089
  for (let workflow_index = 0; workflow_index < workflow_keys.length; workflow_index++) {
35089
- const val2 = val.workflow[workflow_keys[workflow_index]];
35090
+ const val2 = workflow[workflow_keys[workflow_index]];
35090
35091
  if (!val2.data.enabled) continue;
35091
35092
 
35092
35093
  func.events.add_to_queue(
@@ -35798,7 +35799,7 @@ func.runtime.render.normalize_node_attributes = function (nodeP) {
35798
35799
  {
35799
35800
  handler: 'custom',
35800
35801
  props: {},
35801
- event: [
35802
+ workflow: [
35802
35803
  {
35803
35804
  id: Date.now(),
35804
35805
  data: {
@@ -41513,6 +41514,25 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
41513
41514
 
41514
41515
  // var split = [];
41515
41516
  var var_Arr = [];
41517
+ const get_iterate_value_ret = function (fieldIdP) {
41518
+ if (!iterate_info || (iterate_info.iterator_key !== fieldIdP && iterate_info.iterator_val !== fieldIdP)) {
41519
+ return null;
41520
+ }
41521
+
41522
+ const iter_value = iterate_info.iterator_key === fieldIdP ? iterate_info._key : iterate_info._val;
41523
+ const iter_type = typeof iter_value !== 'undefined' ? {}.toString.call(iter_value).match(/\s([a-zA-Z]+)/)[1].toLowerCase() : 'string';
41524
+
41525
+ return {
41526
+ ret: {
41527
+ value: iter_value,
41528
+ type: iter_type,
41529
+ prop: ['array', 'object'].includes(iter_type) ? iter_value : null,
41530
+ },
41531
+ fieldIdP,
41532
+ currentRecordId: rowIdP,
41533
+ found: typeof iter_value !== 'undefined',
41534
+ };
41535
+ };
41516
41536
  const split = func.expression.parse(ret) || [];
41517
41537
  // console.log(valP, split);
41518
41538
  const split_entries = Object.entries(split);
@@ -41609,7 +41629,7 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
41609
41629
  } // put default
41610
41630
  fields[val.fieldId] = var_Arr[key].value;
41611
41631
 
41612
- const ret = await func.datasource.get_value(SESSION_ID, val.fieldId, dsSessionP, rowIdP); // find field in dataSources
41632
+ const ret = get_iterate_value_ret(val.fieldId) || (await func.datasource.get_value(SESSION_ID, val.fieldId, dsSessionP, rowIdP)); // find field in dataSources
41613
41633
 
41614
41634
  await replace_value_in_string(ret.ret, ret.fieldIdP);
41615
41635
  }