@xuda.io/runtime-bundle 1.0.1068 → 1.0.1069

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.
@@ -12669,12 +12669,24 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12669
12669
  const xu_ui_id = $elm.attr('xu-ui-id');
12670
12670
  let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id + xu_render_cache_id]?.$div.clone(true);
12671
12671
 
12672
- if (!new_$div || !new_$div.$div) {
12673
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id] = { paramsP };
12674
- nodeP.xu_render_xu_ui_id = xu_ui_id;
12675
- nodeP.xu_render_cache_id = xu_render_cache_id;
12676
- 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);
12677
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id].$div = new_$div.clone(true);
12672
+ if (!new_$div?.$div) {
12673
+ // validate if $div contains fields from parent ds
12674
+ const parent_fields = get_parent_ds_fields(SESSION_ID, paramsP.dsSessionP);
12675
+ const div_str = JSON.stringify(new_$div.$div.children());
12676
+ let found = false;
12677
+ for (const [key, val] of Object.entries(parent_fields)) {
12678
+ if (div_str.includes('@' + key)) {
12679
+ found = true;
12680
+ break;
12681
+ }
12682
+ }
12683
+ if (!found) {
12684
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id] = { paramsP };
12685
+ nodeP.xu_render_xu_ui_id = xu_ui_id;
12686
+ nodeP.xu_render_cache_id = xu_render_cache_id;
12687
+ 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);
12688
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id].$div = new_$div.clone(true);
12689
+ }
12678
12690
  }
12679
12691
  // append order handling
12680
12692
 
@@ -14956,25 +14968,48 @@ const get_parent_ds_fields = function (SESSION_ID, dsSessionP) {
14956
14968
  };
14957
14969
 
14958
14970
  const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP, exclude_vars = []) {
14959
- var _session = SESSION_OBJ[SESSION_ID];
14960
- var _ds = _session.DS_GLB[dsSessionP];
14971
+ const fields_obj = get_parent_ds_fields(SESSION_ID, dsSessionP);
14961
14972
 
14962
- const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
14963
- const data = _ds.data_feed.rows[idx];
14973
+ // var _session = SESSION_OBJ[SESSION_ID];
14974
+ // var _ds = _session.DS_GLB[dsSessionP];
14975
+
14976
+ // const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
14977
+ // const data = _ds.data_feed.rows[idx];
14964
14978
 
14965
14979
  let str = '';
14966
14980
 
14967
- for (const [key, val] of Object.entries(data)) {
14981
+ for (const [key, val] of Object.entries(fields_obj)) {
14968
14982
  if (exclude_vars.includes(key)) continue;
14969
14983
  str += typeof val !== 'undefined' ? JSON.stringify(val) : '';
14970
14984
  }
14971
14985
 
14972
- if (typeof _ds.parentDataSourceNo !== 'undefined') {
14973
- str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
14974
- }
14986
+ // if (typeof _ds.parentDataSourceNo !== 'undefined') {
14987
+ // str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
14988
+ // }
14975
14989
 
14976
14990
  return 'C-' + (await func.common.sha256(str));
14977
14991
  };
14992
+
14993
+ // const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP, exclude_vars = []) {
14994
+ // var _session = SESSION_OBJ[SESSION_ID];
14995
+ // var _ds = _session.DS_GLB[dsSessionP];
14996
+
14997
+ // const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
14998
+ // const data = _ds.data_feed.rows[idx];
14999
+
15000
+ // let str = '';
15001
+
15002
+ // for (const [key, val] of Object.entries(data)) {
15003
+ // if (exclude_vars.includes(key)) continue;
15004
+ // str += typeof val !== 'undefined' ? JSON.stringify(val) : '';
15005
+ // }
15006
+
15007
+ // if (typeof _ds.parentDataSourceNo !== 'undefined') {
15008
+ // str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
15009
+ // }
15010
+
15011
+ // return 'C-' + (await func.common.sha256(str));
15012
+ // };
14978
15013
  func.UI.component = {};
14979
15014
 
14980
15015
  func.UI.component.create_app_modal_component = function (
@@ -10394,12 +10394,24 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10394
10394
  const xu_ui_id = $elm.attr('xu-ui-id');
10395
10395
  let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id + xu_render_cache_id]?.$div.clone(true);
10396
10396
 
10397
- if (!new_$div || !new_$div.$div) {
10398
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id] = { paramsP };
10399
- nodeP.xu_render_xu_ui_id = xu_ui_id;
10400
- nodeP.xu_render_cache_id = xu_render_cache_id;
10401
- 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);
10402
- UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id].$div = new_$div.clone(true);
10397
+ if (!new_$div?.$div) {
10398
+ // validate if $div contains fields from parent ds
10399
+ const parent_fields = get_parent_ds_fields(SESSION_ID, paramsP.dsSessionP);
10400
+ const div_str = JSON.stringify(new_$div.$div.children());
10401
+ let found = false;
10402
+ for (const [key, val] of Object.entries(parent_fields)) {
10403
+ if (div_str.includes('@' + key)) {
10404
+ found = true;
10405
+ break;
10406
+ }
10407
+ }
10408
+ if (!found) {
10409
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id] = { paramsP };
10410
+ nodeP.xu_render_xu_ui_id = xu_ui_id;
10411
+ nodeP.xu_render_cache_id = xu_render_cache_id;
10412
+ 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);
10413
+ UI_WORKER_OBJ.xu_render_cache[xu_ui_id + xu_render_cache_id].$div = new_$div.clone(true);
10414
+ }
10403
10415
  }
10404
10416
  // append order handling
10405
10417
 
@@ -12681,25 +12693,48 @@ const get_parent_ds_fields = function (SESSION_ID, dsSessionP) {
12681
12693
  };
12682
12694
 
12683
12695
  const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP, exclude_vars = []) {
12684
- var _session = SESSION_OBJ[SESSION_ID];
12685
- var _ds = _session.DS_GLB[dsSessionP];
12696
+ const fields_obj = get_parent_ds_fields(SESSION_ID, dsSessionP);
12686
12697
 
12687
- const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12688
- const data = _ds.data_feed.rows[idx];
12698
+ // var _session = SESSION_OBJ[SESSION_ID];
12699
+ // var _ds = _session.DS_GLB[dsSessionP];
12700
+
12701
+ // const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12702
+ // const data = _ds.data_feed.rows[idx];
12689
12703
 
12690
12704
  let str = '';
12691
12705
 
12692
- for (const [key, val] of Object.entries(data)) {
12706
+ for (const [key, val] of Object.entries(fields_obj)) {
12693
12707
  if (exclude_vars.includes(key)) continue;
12694
12708
  str += typeof val !== 'undefined' ? JSON.stringify(val) : '';
12695
12709
  }
12696
12710
 
12697
- if (typeof _ds.parentDataSourceNo !== 'undefined') {
12698
- str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
12699
- }
12711
+ // if (typeof _ds.parentDataSourceNo !== 'undefined') {
12712
+ // str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
12713
+ // }
12700
12714
 
12701
12715
  return 'C-' + (await func.common.sha256(str));
12702
12716
  };
12717
+
12718
+ // const get_xu_render_cache_str = async function (SESSION_ID, dsSessionP, exclude_vars = []) {
12719
+ // var _session = SESSION_OBJ[SESSION_ID];
12720
+ // var _ds = _session.DS_GLB[dsSessionP];
12721
+
12722
+ // const idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12723
+ // const data = _ds.data_feed.rows[idx];
12724
+
12725
+ // let str = '';
12726
+
12727
+ // for (const [key, val] of Object.entries(data)) {
12728
+ // if (exclude_vars.includes(key)) continue;
12729
+ // str += typeof val !== 'undefined' ? JSON.stringify(val) : '';
12730
+ // }
12731
+
12732
+ // if (typeof _ds.parentDataSourceNo !== 'undefined') {
12733
+ // str += await get_xu_render_cache_str(SESSION_ID, _ds.parentDataSourceNo);
12734
+ // }
12735
+
12736
+ // return 'C-' + (await func.common.sha256(str));
12737
+ // };
12703
12738
  func.UI.component = {};
12704
12739
 
12705
12740
  func.UI.component.create_app_modal_component = function (