@xuda.io/runtime-bundle 1.0.406 → 1.0.407

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.
@@ -28246,6 +28246,33 @@ func.UI.update_xu_ref = function (SESSION_ID, dsSessionP, ref_field_id, $elm) {
28246
28246
  SYS_GLOBAL_OBJ_REFS[ref_field_id].xu_ui_id = $elm.attr('xu-ui-id');
28247
28247
  }
28248
28248
  };
28249
+
28250
+ func.UI.find_field_in_progUi_attributes = function (progUi, field_id, prop) {
28251
+ let elm_node;
28252
+ const iterate_progUi = function (node) {
28253
+ for (let item of node) {
28254
+ // if (item.tagName === "xu-panel") {
28255
+ if (!_.isEmpty(item.attributes)) {
28256
+ for (const [attr, val] of Object.entries(item.attributes)) {
28257
+ if (attr === `xu-exp:${prop}` || attr === prop) {
28258
+ // found = val.includes('@' + field_id);
28259
+ if (val.includes('@' + field_id)) {
28260
+ elm_node = node;
28261
+ break;
28262
+ }
28263
+ }
28264
+ }
28265
+ }
28266
+ if (elm_node) break;
28267
+
28268
+ if (item.children) {
28269
+ iterate_progUi(item.children);
28270
+ }
28271
+ }
28272
+ };
28273
+ iterate_progUi(progUi);
28274
+ return elm_node;
28275
+ };
28249
28276
  func.datasource = {};
28250
28277
  func.datasource.create = async function (
28251
28278
  SESSION_ID,
@@ -31590,7 +31617,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31590
31617
  }
31591
31618
  }
31592
31619
  }
31593
- // if (found) break;
31620
+ if (found) break;
31594
31621
 
31595
31622
  if (item.children) {
31596
31623
  await iterate_progUi(item.children, item.id);
@@ -31610,6 +31637,9 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31610
31637
  const progUi = $xu_embed_div?.data()?.xuData?.screenInfo?.progUi;
31611
31638
  if (progUi) {
31612
31639
  await iterate_field_in_progUi(progUi, field_id);
31640
+ // find invisible panels
31641
+ const elm_node = func.UI.find_field_in_progUi_attributes(progUi, field_id, 'xu-panel');
31642
+ console.log('elm_node', elm_node);
31613
31643
  }
31614
31644
  }
31615
31645
  // run panels
@@ -31620,8 +31650,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31620
31650
  }
31621
31651
  }
31622
31652
 
31623
- // }
31624
-
31625
31653
  func.events.delete_job(SESSION_ID, jobNoP);
31626
31654
  };
31627
31655
 
@@ -31630,28 +31658,28 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31630
31658
 
31631
31659
  const panels_obj = func.UI.utils.get_panels_from_dom(SESSION_ID, false);
31632
31660
 
31633
- const find_field_in_progUi = function (progUi, field_id, prop) {
31634
- let found;
31635
- const iterate_progUi = function (node) {
31636
- for (let item of node) {
31637
- // if (item.tagName === "xu-panel") {
31638
- if (!_.isEmpty(item.attributes)) {
31639
- for (const [attr, val] of Object.entries(item.attributes)) {
31640
- if (attr === `xu-exp:${prop}`) {
31641
- found = val.includes('@' + field_id);
31642
- }
31643
- }
31644
- }
31645
- if (found) break;
31646
- // }
31647
- if (item.children) {
31648
- iterate_progUi(item.children);
31649
- }
31650
- }
31651
- };
31652
- iterate_progUi(progUi);
31653
- return found;
31654
- };
31661
+ // const find_field_in_progUi = function (progUi, field_id, prop) {
31662
+ // let found;
31663
+ // const iterate_progUi = function (node) {
31664
+ // for (let item of node) {
31665
+ // // if (item.tagName === "xu-panel") {
31666
+ // if (!_.isEmpty(item.attributes)) {
31667
+ // for (const [attr, val] of Object.entries(item.attributes)) {
31668
+ // if (attr === `xu-exp:${prop}`) {
31669
+ // found = val.includes('@' + field_id);
31670
+ // }
31671
+ // }
31672
+ // }
31673
+ // if (found) break;
31674
+ // // }
31675
+ // if (item.children) {
31676
+ // iterate_progUi(item.children);
31677
+ // }
31678
+ // }
31679
+ // };
31680
+ // iterate_progUi(progUi);
31681
+ // return found;
31682
+ // };
31655
31683
 
31656
31684
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
31657
31685
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
@@ -31688,7 +31716,8 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31688
31716
  found = progDataSource_str?.includes('@' + parameter_in_field_id);
31689
31717
  if (found) break;
31690
31718
 
31691
- found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
31719
+ // found = find_field_in_progUi(prog_doc.progUi, parameter_in_field_id, 'xu-for');
31720
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for');
31692
31721
  if (found) break;
31693
31722
  }
31694
31723
  }
@@ -31975,6 +32004,9 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31975
32004
  // Start observing the target node for configured mutations
31976
32005
  observer.observe(targetNode, config);
31977
32006
 
32007
+ // Later, you can stop observing
32008
+ // observer.disconnect();
32009
+
31978
32010
  return {};
31979
32011
  },
31980
32012
  'xu-bind': async function ($elm, val) {