@xuda.io/runtime-bundle 1.0.801 → 1.0.803

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.
@@ -8742,6 +8742,15 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8742
8742
  } catch (error) {}
8743
8743
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8744
8744
  },
8745
+ render_viewport: async function () {
8746
+ const { nodeP, $divP, parent_infoP, $root_container, jobNoP, is_skeleton } = queue_obj?.paramsP || {};
8747
+ if (nodeP?.children?.length) {
8748
+ for await (const [key, val] of Object.entries(nodeP.children)) {
8749
+ const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $divP, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
8750
+ }
8751
+ }
8752
+ return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8753
+ },
8745
8754
  };
8746
8755
 
8747
8756
  return await fx[queue_obj.functionP]();
@@ -14027,7 +14036,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14027
14036
  });
14028
14037
  });
14029
14038
  };
14030
- const iterate_child = async function ($divP, nodeP, parent_infoP, countP, $root_container, before_record_function) {
14039
+ const iterate_child = async function ($divP, nodeP, parent_infoP, $root_container, before_record_function) {
14031
14040
  if (!is_mobile && nodeP.busy) return;
14032
14041
  nodeP.busy = true;
14033
14042
  const done = async function ($divP) {
@@ -14542,7 +14551,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14542
14551
  );
14543
14552
  }
14544
14553
 
14545
- const ret = await iterate_child($div, nodeP, null, null, $div);
14554
+ const ret = await iterate_child($div, nodeP, null, $div);
14546
14555
  if (_.isEmpty($container.data().xuAttributes)) {
14547
14556
  await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $container, true);
14548
14557
  }
@@ -14637,7 +14646,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14637
14646
  var node = JSON.parse(JSON.stringify(nodeP));
14638
14647
 
14639
14648
  _ds.currentRecordId = val._ROWID;
14640
- const ret = await iterate_child($div, node, { continuous_idx }, null, $root_container);
14649
+ const ret = await iterate_child($div, node, { continuous_idx }, $root_container);
14641
14650
 
14642
14651
  if (_.isEmpty($container.data().xuAttributes)) {
14643
14652
  await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $container, true);
@@ -14712,8 +14721,10 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14712
14721
  entries.forEach((entry) => {
14713
14722
  if (entry.isIntersecting) {
14714
14723
  // Element is in viewport - trigger custom event
14715
- console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
14716
- $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
14724
+ // console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
14725
+
14726
+ // $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
14727
+ $(entry.target).trigger('inViewport');
14717
14728
 
14718
14729
  // Optional: stop observing once triggered
14719
14730
  observer.unobserve(entry.target);
@@ -14726,13 +14737,15 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14726
14737
  );
14727
14738
 
14728
14739
  const render_child = async function () {
14729
- await iterate_child($div, nodeP, parent_infoP, null, $root_container);
14740
+ await iterate_child($div, nodeP, parent_infoP, $root_container);
14730
14741
  };
14731
14742
 
14732
14743
  if (nodeP?.attributes?.['xu-viewport'] == 'true') {
14733
- console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
14734
- $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
14735
- render_child();
14744
+ // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
14745
+ // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
14746
+ $div.on('inViewport', function () {
14747
+ func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP }, null, null, paramsP.dsSessionP);
14748
+ // render_child();
14736
14749
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
14737
14750
  });
14738
14751
 
@@ -8743,6 +8743,15 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8743
8743
  } catch (error) {}
8744
8744
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8745
8745
  },
8746
+ render_viewport: async function () {
8747
+ const { nodeP, $divP, parent_infoP, $root_container, jobNoP, is_skeleton } = queue_obj?.paramsP || {};
8748
+ if (nodeP?.children?.length) {
8749
+ for await (const [key, val] of Object.entries(nodeP.children)) {
8750
+ const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $divP, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
8751
+ }
8752
+ }
8753
+ return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8754
+ },
8746
8755
  };
8747
8756
 
8748
8757
  return await fx[queue_obj.functionP]();
@@ -11735,7 +11744,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
11735
11744
  });
11736
11745
  });
11737
11746
  };
11738
- const iterate_child = async function ($divP, nodeP, parent_infoP, countP, $root_container, before_record_function) {
11747
+ const iterate_child = async function ($divP, nodeP, parent_infoP, $root_container, before_record_function) {
11739
11748
  if (!is_mobile && nodeP.busy) return;
11740
11749
  nodeP.busy = true;
11741
11750
  const done = async function ($divP) {
@@ -12250,7 +12259,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12250
12259
  );
12251
12260
  }
12252
12261
 
12253
- const ret = await iterate_child($div, nodeP, null, null, $div);
12262
+ const ret = await iterate_child($div, nodeP, null, $div);
12254
12263
  if (_.isEmpty($container.data().xuAttributes)) {
12255
12264
  await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $container, true);
12256
12265
  }
@@ -12345,7 +12354,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12345
12354
  var node = JSON.parse(JSON.stringify(nodeP));
12346
12355
 
12347
12356
  _ds.currentRecordId = val._ROWID;
12348
- const ret = await iterate_child($div, node, { continuous_idx }, null, $root_container);
12357
+ const ret = await iterate_child($div, node, { continuous_idx }, $root_container);
12349
12358
 
12350
12359
  if (_.isEmpty($container.data().xuAttributes)) {
12351
12360
  await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $container, true);
@@ -12420,8 +12429,10 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12420
12429
  entries.forEach((entry) => {
12421
12430
  if (entry.isIntersecting) {
12422
12431
  // Element is in viewport - trigger custom event
12423
- console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
12424
- $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
12432
+ // console.log('trigger>>', 'inViewport_' + $(entry.target).attr('xu-ui-id'));
12433
+
12434
+ // $(entry.target).trigger('inViewport_' + $(entry.target).attr('xu-ui-id'));
12435
+ $(entry.target).trigger('inViewport');
12425
12436
 
12426
12437
  // Optional: stop observing once triggered
12427
12438
  observer.unobserve(entry.target);
@@ -12434,13 +12445,15 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12434
12445
  );
12435
12446
 
12436
12447
  const render_child = async function () {
12437
- await iterate_child($div, nodeP, parent_infoP, null, $root_container);
12448
+ await iterate_child($div, nodeP, parent_infoP, $root_container);
12438
12449
  };
12439
12450
 
12440
12451
  if (nodeP?.attributes?.['xu-viewport'] == 'true') {
12441
- console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
12442
- $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
12443
- render_child();
12452
+ // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
12453
+ // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
12454
+ $div.on('inViewport', function () {
12455
+ func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP }, null, null, paramsP.dsSessionP);
12456
+ // render_child();
12444
12457
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
12445
12458
  });
12446
12459