@xuda.io/runtime-bundle 1.0.1058 → 1.0.1060

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.
@@ -4654,6 +4654,14 @@ func.datasource.del = function (SESSION_ID, dsP) {
4654
4654
  delete SCREEN_BLOCKER_OBJ[SESSION_OBJ[SESSION_ID].DS_GLB[dsP].screenId + '_' + SESSION_OBJ[SESSION_ID].DS_GLB[dsP].callingScreenId];
4655
4655
 
4656
4656
  delete_pending_jobs();
4657
+
4658
+ for (const [ui_cache_key, ui_cache_val] of Object.entries(UI_WORKER_OBJ.xu_render_cache)) {
4659
+ for (const [cache_key, cache_val] of Object.entries(ui_cache_val)) {
4660
+ if (cache_val.paramsP.dsSession === dsP) {
4661
+ delete UI_WORKER_OBJ.xu_render_cache[ui_cache_key][cache_key];
4662
+ }
4663
+ }
4664
+ }
4657
4665
  }
4658
4666
  if ($(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav').length) {
4659
4667
  var ds_obj = $(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav')?.data()?.xuData.nav_params;
@@ -12657,8 +12665,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12657
12665
  const xu_ui_id = $elm.attr('xu-ui-id');
12658
12666
  let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id]?.[xu_render_cache_id]?.$div.clone(true);
12659
12667
 
12660
- if (!new_$div) {
12661
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = {};
12668
+ if (!new_$div || !new_$div.$div) {
12669
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { paramsP };
12662
12670
  nodeP.xu_render_xu_ui_id = xu_ui_id;
12663
12671
  nodeP.xu_render_cache_id = xu_render_cache_id;
12664
12672
  new_$div = await func.UI.screen.render_ui_tree(SESSION_ID, $container, nodeP, parent_infoP, paramsP, jobNoP, null, keyP, null, parent_nodeP, null, $root_container);
@@ -12670,14 +12678,18 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12670
12678
  new_$div.appendTo($container);
12671
12679
  } else {
12672
12680
  // iterate the container node
12673
- let $last_elm_found;
12681
+ let $last_elm_found = [];
12674
12682
  $.each($container.data().xuData.node.children, (item_key, item_val) => {
12675
12683
  const $elm = $(`[xu-node-id="${item_val.id}"]`);
12676
12684
  if ($elm.length) {
12677
12685
  $last_elm_found = $elm;
12678
12686
  }
12679
12687
  if (keyP == item_key) {
12680
- debugger;
12688
+ if ($last_elm_found.length) {
12689
+ new_$div.after($last_elm_found);
12690
+ } else {
12691
+ $container.prepend(new_$div);
12692
+ }
12681
12693
  }
12682
12694
  });
12683
12695
  }
@@ -14706,7 +14718,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14706
14718
  UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
14707
14719
  }
14708
14720
  const xu_render_cache_id = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
14709
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { $div: $div.clone(true) };
14721
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { $div: $div.clone(true), paramsP };
14710
14722
  nodeP.xu_render_xu_ui_id = xu_ui_id;
14711
14723
  nodeP.xu_render_cache_id = xu_render_cache_id;
14712
14724
  if (ret.xu_render_in_process) {
@@ -4655,6 +4655,14 @@ func.datasource.del = function (SESSION_ID, dsP) {
4655
4655
  delete SCREEN_BLOCKER_OBJ[SESSION_OBJ[SESSION_ID].DS_GLB[dsP].screenId + '_' + SESSION_OBJ[SESSION_ID].DS_GLB[dsP].callingScreenId];
4656
4656
 
4657
4657
  delete_pending_jobs();
4658
+
4659
+ for (const [ui_cache_key, ui_cache_val] of Object.entries(UI_WORKER_OBJ.xu_render_cache)) {
4660
+ for (const [cache_key, cache_val] of Object.entries(ui_cache_val)) {
4661
+ if (cache_val.paramsP.dsSession === dsP) {
4662
+ delete UI_WORKER_OBJ.xu_render_cache[ui_cache_key][cache_key];
4663
+ }
4664
+ }
4665
+ }
4658
4666
  }
4659
4667
  if ($(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav').length) {
4660
4668
  var ds_obj = $(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav')?.data()?.xuData.nav_params;
@@ -10382,8 +10390,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10382
10390
  const xu_ui_id = $elm.attr('xu-ui-id');
10383
10391
  let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id]?.[xu_render_cache_id]?.$div.clone(true);
10384
10392
 
10385
- if (!new_$div) {
10386
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = {};
10393
+ if (!new_$div || !new_$div.$div) {
10394
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { paramsP };
10387
10395
  nodeP.xu_render_xu_ui_id = xu_ui_id;
10388
10396
  nodeP.xu_render_cache_id = xu_render_cache_id;
10389
10397
  new_$div = await func.UI.screen.render_ui_tree(SESSION_ID, $container, nodeP, parent_infoP, paramsP, jobNoP, null, keyP, null, parent_nodeP, null, $root_container);
@@ -10395,14 +10403,18 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10395
10403
  new_$div.appendTo($container);
10396
10404
  } else {
10397
10405
  // iterate the container node
10398
- let $last_elm_found;
10406
+ let $last_elm_found = [];
10399
10407
  $.each($container.data().xuData.node.children, (item_key, item_val) => {
10400
10408
  const $elm = $(`[xu-node-id="${item_val.id}"]`);
10401
10409
  if ($elm.length) {
10402
10410
  $last_elm_found = $elm;
10403
10411
  }
10404
10412
  if (keyP == item_key) {
10405
- debugger;
10413
+ if ($last_elm_found.length) {
10414
+ new_$div.after($last_elm_found);
10415
+ } else {
10416
+ $container.prepend(new_$div);
10417
+ }
10406
10418
  }
10407
10419
  });
10408
10420
  }
@@ -12431,7 +12443,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12431
12443
  UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
12432
12444
  }
12433
12445
  const xu_render_cache_id = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
12434
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { $div: $div.clone(true) };
12446
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { $div: $div.clone(true), paramsP };
12435
12447
  nodeP.xu_render_xu_ui_id = xu_ui_id;
12436
12448
  nodeP.xu_render_cache_id = xu_render_cache_id;
12437
12449
  if (ret.xu_render_in_process) {