@xuda.io/runtime-bundle 1.0.695 → 1.0.697

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.
@@ -11760,7 +11760,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11760
11760
 
11761
11761
  func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
11762
11762
  var found, refresh_reason, refresh_details;
11763
- const validate_change = function (prog_doc, panelXuAttributes) {
11763
+ const validate_change = function (prog_doc, panelXuAttributes, skip_ui_check) {
11764
11764
  found = null;
11765
11765
  refresh_reason = null;
11766
11766
  refresh_details = null;
@@ -11801,14 +11801,15 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11801
11801
 
11802
11802
  break;
11803
11803
  }
11804
+ if (!skip_ui_check) {
11805
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
11804
11806
 
11805
- found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
11807
+ if (found) {
11808
+ refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
11809
+ refresh_details = found;
11806
11810
 
11807
- if (found) {
11808
- refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
11809
- refresh_details = found;
11810
-
11811
- break;
11811
+ break;
11812
+ }
11812
11813
  }
11813
11814
  }
11814
11815
  }
@@ -11823,13 +11824,14 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11823
11824
 
11824
11825
  break;
11825
11826
  }
11827
+ if (!skip_ui_check) {
11828
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, field_id, 'xu-for').length;
11829
+ if (found) {
11830
+ refresh_reason = `field ${field_id} in progUi xu-for changed`;
11831
+ refresh_details = found;
11826
11832
 
11827
- found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, field_id, 'xu-for').length;
11828
- if (found) {
11829
- refresh_reason = `field ${field_id} in progUi xu-for changed`;
11830
- refresh_details = found;
11831
-
11832
- break;
11833
+ break;
11834
+ }
11833
11835
  }
11834
11836
 
11835
11837
  if (found) {
@@ -11844,7 +11846,7 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11844
11846
  const _ds = _session.DS_GLB[fields_changed_datasource];
11845
11847
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
11846
11848
  if (prog_doc.progUi) {
11847
- validate_change(prog_doc);
11849
+ validate_change(prog_doc, null, true);
11848
11850
  if (found) {
11849
11851
  const $elm = $(`#container_${_ds.prog_id}_0`);
11850
11852
  if ($elm?.length) {
@@ -11853,21 +11855,22 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11853
11855
  const wrapper_data = $wrapper.data();
11854
11856
  const refreshed_ds = _ds.dsSession;
11855
11857
 
11856
- // let elm_to_delete = [];
11857
- // const ts = Date.now();
11858
- // $.each($elm.find('*'), function (key, val) {
11859
- // let xu_ui_id = $(val).attr('xu-ui-id');
11860
- // if (xu_ui_id) {
11861
- // let new_id = xu_ui_id + ts;
11862
- // elm_to_delete.push(new_id);
11858
+ let elm_to_delete = [];
11859
+ const ts = Date.now();
11860
+ $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
11861
+ let xu_ui_id = $(val).attr('xu-ui-id');
11862
+ if (xu_ui_id) {
11863
+ let new_id = xu_ui_id + ts;
11864
+ elm_to_delete.push(new_id);
11863
11865
 
11864
- // $(val).attr('xu-ui-id', new_id).removeData();
11865
- // } else {
11866
- // $(val).remove();
11867
- // }
11868
- // });
11866
+ $(val).attr('xu-ui-id', new_id).removeData();
11867
+ }
11868
+ // else {
11869
+ // $(val).remove();
11870
+ // }
11871
+ });
11869
11872
 
11870
- $elm.empty();
11873
+ // $elm.empty();
11871
11874
  if ($elm.data()) {
11872
11875
  const new_$div = await func.UI.screen.render_ui_tree(
11873
11876
  SESSION_ID,
@@ -11884,10 +11887,10 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
11884
11887
  elm_data.xuData.$root_container, // the wrapper root container
11885
11888
  );
11886
11889
 
11887
- // // remove old screen content
11888
- // $.each(elm_to_delete, async function (key, val) {
11889
- // $("[xu-ui-id='" + elm_to_delete + "']").remove();
11890
- // });
11890
+ // remove old screen content
11891
+ $.each(elm_to_delete, async function (key, val) {
11892
+ $("[xu-ui-id='" + elm_to_delete + "']").remove();
11893
+ });
11891
11894
 
11892
11895
  return;
11893
11896
  }
@@ -14193,7 +14196,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14193
14196
  if ($nav && $nav.length) {
14194
14197
  // refresh made
14195
14198
  } else {
14196
- $nav = $('<xu-nav>');
14199
+ $nav = $('<xu-nav>'); //.attr('xu-ui-id', SESSION_ID);
14197
14200
  $container.append($nav);
14198
14201
  func.UI.component.init_xu_nav($container, $nav);
14199
14202
  }
@@ -9482,7 +9482,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9482
9482
 
9483
9483
  func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr, datasource_changed, fields_changed_datasource) {
9484
9484
  var found, refresh_reason, refresh_details;
9485
- const validate_change = function (prog_doc, panelXuAttributes) {
9485
+ const validate_change = function (prog_doc, panelXuAttributes, skip_ui_check) {
9486
9486
  found = null;
9487
9487
  refresh_reason = null;
9488
9488
  refresh_details = null;
@@ -9523,14 +9523,15 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9523
9523
 
9524
9524
  break;
9525
9525
  }
9526
+ if (!skip_ui_check) {
9527
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
9526
9528
 
9527
- found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, parameter_in_field_id, 'xu-for').length;
9529
+ if (found) {
9530
+ refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
9531
+ refresh_details = found;
9528
9532
 
9529
- if (found) {
9530
- refresh_reason = `field ${field_id} in progUi xu-for parameter_in changed`;
9531
- refresh_details = found;
9532
-
9533
- break;
9533
+ break;
9534
+ }
9534
9535
  }
9535
9536
  }
9536
9537
  }
@@ -9545,13 +9546,14 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9545
9546
 
9546
9547
  break;
9547
9548
  }
9549
+ if (!skip_ui_check) {
9550
+ found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, field_id, 'xu-for').length;
9551
+ if (found) {
9552
+ refresh_reason = `field ${field_id} in progUi xu-for changed`;
9553
+ refresh_details = found;
9548
9554
 
9549
- found = func.UI.find_field_in_progUi_attributes(prog_doc.progUi, field_id, 'xu-for').length;
9550
- if (found) {
9551
- refresh_reason = `field ${field_id} in progUi xu-for changed`;
9552
- refresh_details = found;
9553
-
9554
- break;
9555
+ break;
9556
+ }
9555
9557
  }
9556
9558
 
9557
9559
  if (found) {
@@ -9566,7 +9568,7 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9566
9568
  const _ds = _session.DS_GLB[fields_changed_datasource];
9567
9569
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, _ds.prog_id);
9568
9570
  if (prog_doc.progUi) {
9569
- validate_change(prog_doc);
9571
+ validate_change(prog_doc, null, true);
9570
9572
  if (found) {
9571
9573
  const $elm = $(`#container_${_ds.prog_id}_0`);
9572
9574
  if ($elm?.length) {
@@ -9575,21 +9577,22 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9575
9577
  const wrapper_data = $wrapper.data();
9576
9578
  const refreshed_ds = _ds.dsSession;
9577
9579
 
9578
- // let elm_to_delete = [];
9579
- // const ts = Date.now();
9580
- // $.each($elm.find('*'), function (key, val) {
9581
- // let xu_ui_id = $(val).attr('xu-ui-id');
9582
- // if (xu_ui_id) {
9583
- // let new_id = xu_ui_id + ts;
9584
- // elm_to_delete.push(new_id);
9580
+ let elm_to_delete = [];
9581
+ const ts = Date.now();
9582
+ $.each($elm.find('xu-root-component-' + SESSION_ID).find('*'), function (key, val) {
9583
+ let xu_ui_id = $(val).attr('xu-ui-id');
9584
+ if (xu_ui_id) {
9585
+ let new_id = xu_ui_id + ts;
9586
+ elm_to_delete.push(new_id);
9585
9587
 
9586
- // $(val).attr('xu-ui-id', new_id).removeData();
9587
- // } else {
9588
- // $(val).remove();
9589
- // }
9590
- // });
9588
+ $(val).attr('xu-ui-id', new_id).removeData();
9589
+ }
9590
+ // else {
9591
+ // $(val).remove();
9592
+ // }
9593
+ });
9591
9594
 
9592
- $elm.empty();
9595
+ // $elm.empty();
9593
9596
  if ($elm.data()) {
9594
9597
  const new_$div = await func.UI.screen.render_ui_tree(
9595
9598
  SESSION_ID,
@@ -9606,10 +9609,10 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
9606
9609
  elm_data.xuData.$root_container, // the wrapper root container
9607
9610
  );
9608
9611
 
9609
- // // remove old screen content
9610
- // $.each(elm_to_delete, async function (key, val) {
9611
- // $("[xu-ui-id='" + elm_to_delete + "']").remove();
9612
- // });
9612
+ // remove old screen content
9613
+ $.each(elm_to_delete, async function (key, val) {
9614
+ $("[xu-ui-id='" + elm_to_delete + "']").remove();
9615
+ });
9613
9616
 
9614
9617
  return;
9615
9618
  }
@@ -11915,7 +11918,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
11915
11918
  if ($nav && $nav.length) {
11916
11919
  // refresh made
11917
11920
  } else {
11918
- $nav = $('<xu-nav>');
11921
+ $nav = $('<xu-nav>'); //.attr('xu-ui-id', SESSION_ID);
11919
11922
  $container.append($nav);
11920
11923
  func.UI.component.init_xu_nav($container, $nav);
11921
11924
  }