@xuda.io/runtime-bundle 1.0.406 → 1.0.408

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.
@@ -8896,7 +8896,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8896
8896
  null,
8897
8897
  queue_obj.paramsP.elem_val.$elm.data().xuData.iterate_info,
8898
8898
  );
8899
- console.log(res);
8899
+ // console.log(res);
8900
8900
  }
8901
8901
 
8902
8902
  const attr_new = attr.split('xu-exp:')[1];
@@ -9064,6 +9064,40 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9064
9064
  SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9065
9065
  }
9066
9066
  };
9067
+
9068
+ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_name) {
9069
+ let elm_node;
9070
+ const iterate_progUi = function (node) {
9071
+ for (let item of node) {
9072
+ if (!tag_name || item.tagName === tag_name) {
9073
+ if (prop) {
9074
+ if (!_.isEmpty(item.attributes)) {
9075
+ for (const [attr, val] of Object.entries(item.attributes)) {
9076
+ if (attr === `xu-exp:${prop}` || attr === prop) {
9077
+ // found = val.includes('@' + field_id);
9078
+ if (val.includes('@' + field_id)) {
9079
+ elm_node = node;
9080
+ break;
9081
+ }
9082
+ }
9083
+ }
9084
+ }
9085
+ if (elm_node) break;
9086
+
9087
+ if (item.children) {
9088
+ iterate_progUi(item.children);
9089
+ }
9090
+ } else {
9091
+ if (tag_name) {
9092
+ elm_node = node;
9093
+ }
9094
+ }
9095
+ }
9096
+ }
9097
+ };
9098
+ iterate_progUi(progUi);
9099
+ return elm_node;
9100
+ };
9067
9101
  func.events = {};
9068
9102
  func.events.validate = async function (SESSION_ID, triggerP, dsSessionP, eventIdP, sourceP, argumentsP, return_validation_onlyP) {
9069
9103
  var _session = SESSION_OBJ[SESSION_ID];
@@ -11558,7 +11592,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11558
11592
  }
11559
11593
  }
11560
11594
  }
11561
- // if (found) break;
11595
+ if (found) break;
11562
11596
 
11563
11597
  if (item.children) {
11564
11598
  await iterate_progUi(item.children, item.id);
@@ -11578,6 +11612,9 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11578
11612
  const progUi = $xu_embed_div?.data()?.xuData?.screenInfo?.progUi;
11579
11613
  if (progUi) {
11580
11614
  await iterate_field_in_progUi(progUi, field_id);
11615
+ // find invisible panels
11616
+ const elm_node = func.UI.find_field_in_progUi_attributes(progUi, field_id, null, 'xu-panel');
11617
+ console.log('elm_node', elm_node);
11581
11618
  }
11582
11619
  }
11583
11620
  // run panels
@@ -11588,8 +11625,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11588
11625
  }
11589
11626
  }
11590
11627
 
11591
- // }
11592
-
11593
11628
  func.events.delete_job(SESSION_ID, jobNoP);
11594
11629
  };
11595
11630
 
@@ -11598,28 +11633,28 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11598
11633
 
11599
11634
  const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
11600
11635
 
11601
- const find_field_in_progUi = function (progUi, field_id, prop) {
11602
- let found;
11603
- const iterate_progUi = function (node) {
11604
- for (let item of node) {
11605
- // if (item.tagName === "xu-panel") {
11606
- if (!_.isEmpty(item.attributes)) {
11607
- for (const [attr, val] of Object.entries(item.attributes)) {
11608
- if (attr === `xu-exp:${prop}`) {
11609
- found = val.includes('@' + field_id);
11610
- }
11611
- }
11612
- }
11613
- if (found) break;
11614
- // }
11615
- if (item.children) {
11616
- iterate_progUi(item.children);
11617
- }
11618
- }
11619
- };
11620
- iterate_progUi(progUi);
11621
- return found;
11622
- };
11636
+ // const find_field_in_progUi = function (progUi, field_id, prop) {
11637
+ // let found;
11638
+ // const iterate_progUi = function (node) {
11639
+ // for (let item of node) {
11640
+ // // if (item.tagName === "xu-panel") {
11641
+ // if (!_.isEmpty(item.attributes)) {
11642
+ // for (const [attr, val] of Object.entries(item.attributes)) {
11643
+ // if (attr === `xu-exp:${prop}`) {
11644
+ // found = val.includes('@' + field_id);
11645
+ // }
11646
+ // }
11647
+ // }
11648
+ // if (found) break;
11649
+ // // }
11650
+ // if (item.children) {
11651
+ // iterate_progUi(item.children);
11652
+ // }
11653
+ // }
11654
+ // };
11655
+ // iterate_progUi(progUi);
11656
+ // return found;
11657
+ // };
11623
11658
 
11624
11659
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
11625
11660
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
@@ -11656,7 +11691,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11656
11691
  found = progDataSource_str?.includes('@' + parameter_in_field_id);
11657
11692
  if (found) break;
11658
11693
 
11659
- found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
11694
+ // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
11695
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for');
11660
11696
  if (found) break;
11661
11697
  }
11662
11698
  }
@@ -11943,6 +11979,9 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
11943
11979
  // Start observing the target node for configured mutations
11944
11980
  observer.observe(targetNode, config);
11945
11981
 
11982
+ // Later, you can stop observing
11983
+ // observer.disconnect();
11984
+
11946
11985
  return {};
11947
11986
  },
11948
11987
  'xu-bind': async function ($elm, val) {
@@ -8897,7 +8897,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8897
8897
  null,
8898
8898
  queue_obj.paramsP.elem_val.$elm.data().xuData.iterate_info,
8899
8899
  );
8900
- console.log(res);
8900
+ // console.log(res);
8901
8901
  }
8902
8902
 
8903
8903
  const attr_new = attr.split('xu-exp:')[1];
@@ -9065,6 +9065,40 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
9065
9065
  SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
9066
9066
  }
9067
9067
  };
9068
+
9069
+ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop, tag_name) {
9070
+ let elm_node;
9071
+ const iterate_progUi = function (node) {
9072
+ for (let item of node) {
9073
+ if (!tag_name || item.tagName === tag_name) {
9074
+ if (prop) {
9075
+ if (!_.isEmpty(item.attributes)) {
9076
+ for (const [attr, val] of Object.entries(item.attributes)) {
9077
+ if (attr === `xu-exp:${prop}` || attr === prop) {
9078
+ // found = val.includes('@' + field_id);
9079
+ if (val.includes('@' + field_id)) {
9080
+ elm_node = node;
9081
+ break;
9082
+ }
9083
+ }
9084
+ }
9085
+ }
9086
+ if (elm_node) break;
9087
+
9088
+ if (item.children) {
9089
+ iterate_progUi(item.children);
9090
+ }
9091
+ } else {
9092
+ if (tag_name) {
9093
+ elm_node = node;
9094
+ }
9095
+ }
9096
+ }
9097
+ }
9098
+ };
9099
+ iterate_progUi(progUi);
9100
+ return elm_node;
9101
+ };
9068
9102
  func.UI.screen = {};
9069
9103
  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) {
9070
9104
  if (!prog_id) return console.error('program is empty');
@@ -9631,7 +9665,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9631
9665
  }
9632
9666
  }
9633
9667
  }
9634
- // if (found) break;
9668
+ if (found) break;
9635
9669
 
9636
9670
  if (item.children) {
9637
9671
  await iterate_progUi(item.children, item.id);
@@ -9651,6 +9685,9 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9651
9685
  const progUi = $xu_embed_div?.data()?.xuData?.screenInfo?.progUi;
9652
9686
  if (progUi) {
9653
9687
  await iterate_field_in_progUi(progUi, field_id);
9688
+ // find invisible panels
9689
+ const elm_node = func.UI.find_field_in_progUi_attributes(progUi, field_id, null, 'xu-panel');
9690
+ console.log('elm_node', elm_node);
9654
9691
  }
9655
9692
  }
9656
9693
  // run panels
@@ -9661,8 +9698,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9661
9698
  }
9662
9699
  }
9663
9700
 
9664
- // }
9665
-
9666
9701
  func.events.delete_job(SESSION_ID, jobNoP);
9667
9702
  };
9668
9703
 
@@ -9671,28 +9706,28 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9671
9706
 
9672
9707
  const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
9673
9708
 
9674
- const find_field_in_progUi = function (progUi, field_id, prop) {
9675
- let found;
9676
- const iterate_progUi = function (node) {
9677
- for (let item of node) {
9678
- // if (item.tagName === "xu-panel") {
9679
- if (!_.isEmpty(item.attributes)) {
9680
- for (const [attr, val] of Object.entries(item.attributes)) {
9681
- if (attr === `xu-exp:${prop}`) {
9682
- found = val.includes('@' + field_id);
9683
- }
9684
- }
9685
- }
9686
- if (found) break;
9687
- // }
9688
- if (item.children) {
9689
- iterate_progUi(item.children);
9690
- }
9691
- }
9692
- };
9693
- iterate_progUi(progUi);
9694
- return found;
9695
- };
9709
+ // const find_field_in_progUi = function (progUi, field_id, prop) {
9710
+ // let found;
9711
+ // const iterate_progUi = function (node) {
9712
+ // for (let item of node) {
9713
+ // // if (item.tagName === "xu-panel") {
9714
+ // if (!_.isEmpty(item.attributes)) {
9715
+ // for (const [attr, val] of Object.entries(item.attributes)) {
9716
+ // if (attr === `xu-exp:${prop}`) {
9717
+ // found = val.includes('@' + field_id);
9718
+ // }
9719
+ // }
9720
+ // }
9721
+ // if (found) break;
9722
+ // // }
9723
+ // if (item.children) {
9724
+ // iterate_progUi(item.children);
9725
+ // }
9726
+ // }
9727
+ // };
9728
+ // iterate_progUi(progUi);
9729
+ // return found;
9730
+ // };
9696
9731
 
9697
9732
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
9698
9733
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
@@ -9729,7 +9764,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9729
9764
  found = progDataSource_str?.includes('@' + parameter_in_field_id);
9730
9765
  if (found) break;
9731
9766
 
9732
- found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
9767
+ // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
9768
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for');
9733
9769
  if (found) break;
9734
9770
  }
9735
9771
  }
@@ -10016,6 +10052,9 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10016
10052
  // Start observing the target node for configured mutations
10017
10053
  observer.observe(targetNode, config);
10018
10054
 
10055
+ // Later, you can stop observing
10056
+ // observer.disconnect();
10057
+
10019
10058
  return {};
10020
10059
  },
10021
10060
  'xu-bind': async function ($elm, val) {