@xuda.io/runtime-bundle 1.0.942 → 1.0.944

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.
@@ -4860,7 +4860,11 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
4860
4860
  }
4861
4861
  ///// REFRESH SCREEN
4862
4862
  if (fields_changed.length) {
4863
- await func.UI.screen.refresh_xu_attributes(SESSION_ID, _.cloneDeep(fields_changed), null, null, null, avoid_xu_for_refresh);
4863
+ function findMin(arr) {
4864
+ return Math.min(...arr.map(Number));
4865
+ }
4866
+
4867
+ await func.UI.screen.refresh_xu_attributes(SESSION_ID, _.cloneDeep(fields_changed), null, null, findMin(datasource_changed), avoid_xu_for_refresh);
4864
4868
  // await removed from the below function cause to dead lock Mar 3 25
4865
4869
  await func.UI.screen.refresh_screen(
4866
4870
  SESSION_ID,
@@ -11322,11 +11326,11 @@ func.UI.screen.call_embed = function (SESSION_ID, prog) {
11322
11326
  });
11323
11327
  func.UI.main.embed_prog_execute(SESSION_ID, prog);
11324
11328
  };
11325
- func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession, avoid_xu_for_refresh) {
11329
+ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession_changed, avoid_xu_for_refresh) {
11326
11330
  if (!_.isEmpty(SCREEN_BLOCKER_OBJ)) {
11327
11331
  // let dom to finish
11328
11332
  setTimeout(() => {
11329
- func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession);
11333
+ func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession_changed);
11330
11334
  }, 100);
11331
11335
  return;
11332
11336
  }
@@ -11444,8 +11448,12 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11444
11448
 
11445
11449
  get_selectors();
11446
11450
  // console.log('selectors>>>>', selectors);
11451
+ let children_items_ignore_list = [];
11447
11452
  for await (let [elem_key, elem_val] of Object.entries(selectors)) {
11448
11453
  if (elem_key === 'length') break;
11454
+ const xu_ui_id = $(elem_val.$elm).attr('xu-ui-id');
11455
+ if (!xu_ui_id) continue;
11456
+ if (children_items_ignore_list.includes(xu_ui_id)) continue;
11449
11457
 
11450
11458
  const add_execute_queue = async function (type) {
11451
11459
  if (!elem_val.$elm?.data?.()?.xuData) return;
@@ -11482,6 +11490,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11482
11490
  }
11483
11491
 
11484
11492
  if (!elem_val?.$elm?.data()?.xuData?.ui_type) continue;
11493
+
11485
11494
  const obj = {
11486
11495
  ui_type: elem_val.$elm.data().xuData.ui_type,
11487
11496
  SESSION_ID,
@@ -11493,6 +11502,12 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11493
11502
  new_job = jobNoP;
11494
11503
  new_job = await func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'execute_xu_render_attributes', obj, new_job, elem_val.$elm, elem_val.$elm.data().xuData.paramsP.dsSessionP);
11495
11504
  performed_render = true;
11505
+
11506
+ // mark children items ignore list
11507
+ $.each(elem_val.$elm.find('*'), function (key, val) {
11508
+ children_items_ignore_list.push($(val).attr('xu-ui-id'));
11509
+ });
11510
+
11496
11511
  if (glb.DEBUG_MODE) {
11497
11512
  console.info('execute_xu_render_attributes', obj);
11498
11513
  }
@@ -11501,6 +11516,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
11501
11516
  if (performed_render || elem_val.$elm[0].tagName === 'XURENDER') continue; // bypass job
11502
11517
 
11503
11518
  if (elem_val.attributes.includes('xu-exp:xu-for') || elem_val.attributes.includes('xu-for')) continue;
11519
+
11504
11520
  add_execute_queue('execute_xu_all_attributes');
11505
11521
  }
11506
11522
 
@@ -12306,7 +12322,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12306
12322
  var cloned_$div = $elm.clone(true);
12307
12323
 
12308
12324
  let $xurender = $('<xurender>')
12309
- .attr('xu-ui-id', nodeP.id + '_' + $elm.data().xuData.recordid)
12325
+ // .attr('xu-ui-id', nodeP.id + '_' + $elm.data().xuData.recordid)
12326
+ .attr('xu-ui-id', $elm.attr('xu-ui-id'))
12310
12327
  .appendTo($container)
12311
12328
  .hide();
12312
12329
  let original_data_obj = {
@@ -12394,7 +12411,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12394
12411
  let tmp_$div = $('<div>');
12395
12412
 
12396
12413
  let $xurender = $('<xurender>')
12397
- .attr('xu-ui-id', $elm.data().xuData.node.id + '_' + $elm.data().xuData.recordid)
12414
+ // .attr('xu-ui-id', $elm.data().xuData.node.id + '_' + $elm.data().xuData.recordid)
12415
+ .attr('xu-ui-id', $elm.attr('xu-ui-id'))
12398
12416
  .appendTo(tmp_$div)
12399
12417
  .hide();
12400
12418
  // was true before
@@ -4861,7 +4861,11 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
4861
4861
  }
4862
4862
  ///// REFRESH SCREEN
4863
4863
  if (fields_changed.length) {
4864
- await func.UI.screen.refresh_xu_attributes(SESSION_ID, _.cloneDeep(fields_changed), null, null, null, avoid_xu_for_refresh);
4864
+ function findMin(arr) {
4865
+ return Math.min(...arr.map(Number));
4866
+ }
4867
+
4868
+ await func.UI.screen.refresh_xu_attributes(SESSION_ID, _.cloneDeep(fields_changed), null, null, findMin(datasource_changed), avoid_xu_for_refresh);
4865
4869
  // await removed from the below function cause to dead lock Mar 3 25
4866
4870
  await func.UI.screen.refresh_screen(
4867
4871
  SESSION_ID,
@@ -9049,11 +9053,11 @@ func.UI.screen.call_embed = function (SESSION_ID, prog) {
9049
9053
  });
9050
9054
  func.UI.main.embed_prog_execute(SESSION_ID, prog);
9051
9055
  };
9052
- func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession, avoid_xu_for_refresh) {
9056
+ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession_changed, avoid_xu_for_refresh) {
9053
9057
  if (!_.isEmpty(SCREEN_BLOCKER_OBJ)) {
9054
9058
  // let dom to finish
9055
9059
  setTimeout(() => {
9056
- func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession);
9060
+ func.UI.screen.refresh_xu_attributes(SESSION_ID, fields_arr, jobNoP, $elm_to_search, dsSession_changed);
9057
9061
  }, 100);
9058
9062
  return;
9059
9063
  }
@@ -9171,8 +9175,12 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9171
9175
 
9172
9176
  get_selectors();
9173
9177
  // console.log('selectors>>>>', selectors);
9178
+ let children_items_ignore_list = [];
9174
9179
  for await (let [elem_key, elem_val] of Object.entries(selectors)) {
9175
9180
  if (elem_key === 'length') break;
9181
+ const xu_ui_id = $(elem_val.$elm).attr('xu-ui-id');
9182
+ if (!xu_ui_id) continue;
9183
+ if (children_items_ignore_list.includes(xu_ui_id)) continue;
9176
9184
 
9177
9185
  const add_execute_queue = async function (type) {
9178
9186
  if (!elem_val.$elm?.data?.()?.xuData) return;
@@ -9209,6 +9217,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9209
9217
  }
9210
9218
 
9211
9219
  if (!elem_val?.$elm?.data()?.xuData?.ui_type) continue;
9220
+
9212
9221
  const obj = {
9213
9222
  ui_type: elem_val.$elm.data().xuData.ui_type,
9214
9223
  SESSION_ID,
@@ -9220,6 +9229,12 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9220
9229
  new_job = jobNoP;
9221
9230
  new_job = await func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'execute_xu_render_attributes', obj, new_job, elem_val.$elm, elem_val.$elm.data().xuData.paramsP.dsSessionP);
9222
9231
  performed_render = true;
9232
+
9233
+ // mark children items ignore list
9234
+ $.each(elem_val.$elm.find('*'), function (key, val) {
9235
+ children_items_ignore_list.push($(val).attr('xu-ui-id'));
9236
+ });
9237
+
9223
9238
  if (glb.DEBUG_MODE) {
9224
9239
  console.info('execute_xu_render_attributes', obj);
9225
9240
  }
@@ -9228,6 +9243,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
9228
9243
  if (performed_render || elem_val.$elm[0].tagName === 'XURENDER') continue; // bypass job
9229
9244
 
9230
9245
  if (elem_val.attributes.includes('xu-exp:xu-for') || elem_val.attributes.includes('xu-for')) continue;
9246
+
9231
9247
  add_execute_queue('execute_xu_all_attributes');
9232
9248
  }
9233
9249
 
@@ -10033,7 +10049,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10033
10049
  var cloned_$div = $elm.clone(true);
10034
10050
 
10035
10051
  let $xurender = $('<xurender>')
10036
- .attr('xu-ui-id', nodeP.id + '_' + $elm.data().xuData.recordid)
10052
+ // .attr('xu-ui-id', nodeP.id + '_' + $elm.data().xuData.recordid)
10053
+ .attr('xu-ui-id', $elm.attr('xu-ui-id'))
10037
10054
  .appendTo($container)
10038
10055
  .hide();
10039
10056
  let original_data_obj = {
@@ -10121,7 +10138,8 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10121
10138
  let tmp_$div = $('<div>');
10122
10139
 
10123
10140
  let $xurender = $('<xurender>')
10124
- .attr('xu-ui-id', $elm.data().xuData.node.id + '_' + $elm.data().xuData.recordid)
10141
+ // .attr('xu-ui-id', $elm.data().xuData.node.id + '_' + $elm.data().xuData.recordid)
10142
+ .attr('xu-ui-id', $elm.attr('xu-ui-id'))
10125
10143
  .appendTo(tmp_$div)
10126
10144
  .hide();
10127
10145
  // was true before