@xuda.io/runtime-bundle 1.0.694 → 1.0.696

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,51 +11846,53 @@ 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
- const $elm = $('#container_5b1_cmp_3700419d8179_0');
11850
- const elm_data = $elm.data();
11851
- const $wrapper = $elm.parent();
11852
- const wrapper_data = $wrapper.data();
11853
- const refreshed_ds = _ds.dsSession;
11854
-
11855
- // let elm_to_delete = [];
11856
- // const ts = Date.now();
11857
- // $.each($elm.find('*'), function (key, val) {
11858
- // let xu_ui_id = $(val).attr('xu-ui-id');
11859
- // if (xu_ui_id) {
11860
- // let new_id = xu_ui_id + ts;
11861
- // elm_to_delete.push(new_id);
11862
-
11863
- // $(val).attr('xu-ui-id', new_id).removeData();
11864
- // } else {
11865
- // $(val).remove();
11866
- // }
11867
- // });
11851
+ const $elm = $(`#container_${_ds.prog_id}_0`);
11852
+ if ($elm?.length) {
11853
+ const elm_data = $elm.data();
11854
+ const $wrapper = $elm.parent();
11855
+ const wrapper_data = $wrapper.data();
11856
+ const refreshed_ds = _ds.dsSession;
11857
+
11858
+ // let elm_to_delete = [];
11859
+ // const ts = Date.now();
11860
+ // $.each($elm.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);
11865
+
11866
+ // $(val).attr('xu-ui-id', new_id).removeData();
11867
+ // } else {
11868
+ // $(val).remove();
11869
+ // }
11870
+ // });
11868
11871
 
11869
- $elm.empty();
11870
- if ($elm.data()) {
11871
- const new_$div = await func.UI.screen.render_ui_tree(
11872
- SESSION_ID,
11873
- $elm, // the wrapper
11874
- _.cloneDeep($elm.data().xuData.node), // the xu-panel node
11875
- {},
11876
- elm_data.xuData.paramsP, // the wrapper params
11877
- null,
11878
- null,
11879
- elm_data.xuData.key, // the wrapper key
11880
- refreshed_ds, // the refreshed_ds
11881
- elm_data.xuData.parent_node, // the wrapper parent node
11882
- null,
11883
- elm_data.xuData.$root_container, // the wrapper root container
11884
- );
11872
+ $elm.empty();
11873
+ if ($elm.data()) {
11874
+ const new_$div = await func.UI.screen.render_ui_tree(
11875
+ SESSION_ID,
11876
+ $elm, // the wrapper
11877
+ _.cloneDeep($elm.data().xuData.node), // the xu-panel node
11878
+ {},
11879
+ elm_data.xuData.paramsP, // the wrapper params
11880
+ null,
11881
+ null,
11882
+ elm_data.xuData.key, // the wrapper key
11883
+ refreshed_ds, // the refreshed_ds
11884
+ elm_data.xuData.parent_node, // the wrapper parent node
11885
+ null,
11886
+ elm_data.xuData.$root_container, // the wrapper root container
11887
+ );
11885
11888
 
11886
- // // remove old screen content
11887
- // $.each(elm_to_delete, async function (key, val) {
11888
- // $("[xu-ui-id='" + elm_to_delete + "']").remove();
11889
- // });
11889
+ // // remove old screen content
11890
+ // $.each(elm_to_delete, async function (key, val) {
11891
+ // $("[xu-ui-id='" + elm_to_delete + "']").remove();
11892
+ // });
11890
11893
 
11891
- return;
11894
+ return;
11895
+ }
11892
11896
  }
11893
11897
  }
11894
11898
  }
@@ -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,51 +9568,53 @@ 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
- const $elm = $('#container_5b1_cmp_3700419d8179_0');
9572
- const elm_data = $elm.data();
9573
- const $wrapper = $elm.parent();
9574
- const wrapper_data = $wrapper.data();
9575
- const refreshed_ds = _ds.dsSession;
9576
-
9577
- // let elm_to_delete = [];
9578
- // const ts = Date.now();
9579
- // $.each($elm.find('*'), function (key, val) {
9580
- // let xu_ui_id = $(val).attr('xu-ui-id');
9581
- // if (xu_ui_id) {
9582
- // let new_id = xu_ui_id + ts;
9583
- // elm_to_delete.push(new_id);
9584
-
9585
- // $(val).attr('xu-ui-id', new_id).removeData();
9586
- // } else {
9587
- // $(val).remove();
9588
- // }
9589
- // });
9573
+ const $elm = $(`#container_${_ds.prog_id}_0`);
9574
+ if ($elm?.length) {
9575
+ const elm_data = $elm.data();
9576
+ const $wrapper = $elm.parent();
9577
+ const wrapper_data = $wrapper.data();
9578
+ const refreshed_ds = _ds.dsSession;
9579
+
9580
+ // let elm_to_delete = [];
9581
+ // const ts = Date.now();
9582
+ // $.each($elm.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);
9587
+
9588
+ // $(val).attr('xu-ui-id', new_id).removeData();
9589
+ // } else {
9590
+ // $(val).remove();
9591
+ // }
9592
+ // });
9590
9593
 
9591
- $elm.empty();
9592
- if ($elm.data()) {
9593
- const new_$div = await func.UI.screen.render_ui_tree(
9594
- SESSION_ID,
9595
- $elm, // the wrapper
9596
- _.cloneDeep($elm.data().xuData.node), // the xu-panel node
9597
- {},
9598
- elm_data.xuData.paramsP, // the wrapper params
9599
- null,
9600
- null,
9601
- elm_data.xuData.key, // the wrapper key
9602
- refreshed_ds, // the refreshed_ds
9603
- elm_data.xuData.parent_node, // the wrapper parent node
9604
- null,
9605
- elm_data.xuData.$root_container, // the wrapper root container
9606
- );
9594
+ $elm.empty();
9595
+ if ($elm.data()) {
9596
+ const new_$div = await func.UI.screen.render_ui_tree(
9597
+ SESSION_ID,
9598
+ $elm, // the wrapper
9599
+ _.cloneDeep($elm.data().xuData.node), // the xu-panel node
9600
+ {},
9601
+ elm_data.xuData.paramsP, // the wrapper params
9602
+ null,
9603
+ null,
9604
+ elm_data.xuData.key, // the wrapper key
9605
+ refreshed_ds, // the refreshed_ds
9606
+ elm_data.xuData.parent_node, // the wrapper parent node
9607
+ null,
9608
+ elm_data.xuData.$root_container, // the wrapper root container
9609
+ );
9607
9610
 
9608
- // // remove old screen content
9609
- // $.each(elm_to_delete, async function (key, val) {
9610
- // $("[xu-ui-id='" + elm_to_delete + "']").remove();
9611
- // });
9611
+ // // remove old screen content
9612
+ // $.each(elm_to_delete, async function (key, val) {
9613
+ // $("[xu-ui-id='" + elm_to_delete + "']").remove();
9614
+ // });
9612
9615
 
9613
- return;
9616
+ return;
9617
+ }
9614
9618
  }
9615
9619
  }
9616
9620
  }