@xuda.io/runtime-bundle 1.0.830 → 1.0.832

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.
@@ -8759,7 +8759,7 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8759
8759
  render_viewport: async function () {
8760
8760
  const { nodeP, $div, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP, $container } = queue_obj?.paramsP || {};
8761
8761
  if (nodeP?.children?.length) {
8762
- func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
8762
+ // func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
8763
8763
  // setTimeout(async () => {
8764
8764
  for await (const [key, val] of Object.entries(nodeP.children)) {
8765
8765
  const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $div, nodeP.children[key], parent_infoP, paramsP, jobNoP, is_skeleton, Number(key), null, nodeP, null, $root_container);
@@ -8767,9 +8767,9 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8767
8767
  // return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8768
8768
  // }, 1000);
8769
8769
  }
8770
- setTimeout(async () => {
8771
- return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8772
- }, 10000);
8770
+ // setTimeout(async () => {
8771
+ return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8772
+ // }, 10000);
8773
8773
  },
8774
8774
  };
8775
8775
 
@@ -12270,12 +12270,12 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12270
12270
 
12271
12271
  $div.hover(
12272
12272
  function (e) {
12273
- // hover_in();
12274
- func.UI.screen.hover_in(SESSION_ID, null, $container, paramsP, is_skeleton);
12273
+ hover_in();
12274
+ // func.UI.screen.hover_in(SESSION_ID, null, $container, paramsP, is_skeleton);
12275
12275
  },
12276
12276
  function (e) {
12277
- func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
12278
- // hover_out();
12277
+ // func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
12278
+ hover_out();
12279
12279
  },
12280
12280
  );
12281
12281
  }
@@ -12434,12 +12434,12 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12434
12434
 
12435
12435
  $div.hover(
12436
12436
  function (e) {
12437
- // hover_in($div);
12438
- func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
12437
+ hover_in($div);
12438
+ // func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
12439
12439
  },
12440
12440
  function (e) {
12441
- func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
12442
- // hover_out();
12441
+ // func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
12442
+ hover_out();
12443
12443
  },
12444
12444
  );
12445
12445
 
@@ -12447,7 +12447,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12447
12447
  if (ret.abort || nodeP.tagName === 'svg') return await done();
12448
12448
  // check if iterator made to prevent children render
12449
12449
 
12450
- const observer = new IntersectionObserver(
12450
+ const observer_inViewport = new IntersectionObserver(
12451
12451
  function (entries) {
12452
12452
  entries.forEach((entry) => {
12453
12453
  if (entry.isIntersecting) {
@@ -12458,7 +12458,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12458
12458
  $(entry.target).trigger('inViewport');
12459
12459
 
12460
12460
  // Optional: stop observing once triggered
12461
- observer.unobserve(entry.target);
12461
+ observer_inViewport.unobserve(entry.target);
12462
12462
  }
12463
12463
  });
12464
12464
  },
@@ -12467,6 +12467,23 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12467
12467
  },
12468
12468
  );
12469
12469
 
12470
+ const observer_outViewport = new IntersectionObserver(
12471
+ function (entries) {
12472
+ entries.forEach((entry) => {
12473
+ if (!entry.isIntersecting) {
12474
+ // Element is OUT of viewport - trigger custom event
12475
+ $(entry.target).trigger('outViewport');
12476
+
12477
+ // Optional: stop observing once triggered
12478
+ observer_outViewport.unobserve(entry.target);
12479
+ }
12480
+ });
12481
+ },
12482
+ {
12483
+ threshold: 0, // Trigger when element is completely out of view
12484
+ },
12485
+ );
12486
+
12470
12487
  // const render_child = async function () {
12471
12488
  // await iterate_child($div, nodeP, parent_infoP, $root_container);
12472
12489
  // };
@@ -12475,13 +12492,20 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12475
12492
  // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
12476
12493
  // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
12477
12494
  $div.on('inViewport', function () {
12478
- func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
12495
+ hover_in($div);
12496
+ // func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
12479
12497
  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, $container }, null, null, paramsP.dsSessionP);
12480
12498
  // render_child();
12481
12499
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
12482
12500
  });
12483
12501
 
12484
- observer.observe($div[0]);
12502
+ $div.on('outViewport', function () {
12503
+ $div.empty();
12504
+ observer_inViewport.observe($div[0]);
12505
+ });
12506
+
12507
+ observer_inViewport.observe($div[0]);
12508
+ observer_outViewport.observe($div[0]);
12485
12509
  } else {
12486
12510
  // await render_child();
12487
12511
  await iterate_child($div, nodeP, parent_infoP, $root_container);
@@ -12533,127 +12557,127 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
12533
12557
  }
12534
12558
  };
12535
12559
 
12536
- func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
12537
- if (is_skeleton || EXP_BUSY) return;
12560
+ // func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
12561
+ // if (is_skeleton || EXP_BUSY) return;
12538
12562
 
12539
- var _session = SESSION_OBJ[SESSION_ID];
12540
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
12563
+ // var _session = SESSION_OBJ[SESSION_ID];
12564
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
12541
12565
 
12542
- const _$ = function ($elm) {
12543
- try {
12544
- const id = $elm.attr('xu-ui-id');
12545
- if (!id) return $elm;
12546
- const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12547
-
12548
- if ($el.length > 1) {
12549
- console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12550
- }
12566
+ // const _$ = function ($elm) {
12567
+ // try {
12568
+ // const id = $elm.attr('xu-ui-id');
12569
+ // if (!id) return $elm;
12570
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12551
12571
 
12552
- return $($el[0]);
12553
- } catch (e) {
12554
- console.error(e);
12555
- }
12556
- };
12572
+ // if ($el.length > 1) {
12573
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12574
+ // }
12557
12575
 
12558
- CLIENT_ACTIVITY_TS = Date.now();
12559
- if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
12560
- if (!_ds) return;
12561
- ///////// SET Attributes///////////
12562
- let attributes = {};
12563
- $.each($div[0].attributes, function (index, attr) {
12564
- attributes[attr.name] = attr.value;
12565
- });
12576
+ // return $($el[0]);
12577
+ // } catch (e) {
12578
+ // console.error(e);
12579
+ // }
12580
+ // };
12566
12581
 
12567
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
12568
- //////////////////////////////////
12569
- if (!$div.data()?.xuData) return;
12570
- const _iterate_info = $div.data().xuData.iterate_info;
12571
- if (_iterate_info) {
12572
- if (_iterate_info.is_key_dynamic_field) {
12573
- _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
12574
- } else {
12575
- try {
12576
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12577
- _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
12578
- } catch (err) {
12579
- console.error(err);
12580
- }
12581
- }
12582
+ // CLIENT_ACTIVITY_TS = Date.now();
12583
+ // if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
12584
+ // if (!_ds) return;
12585
+ // ///////// SET Attributes///////////
12586
+ // let attributes = {};
12587
+ // $.each($div[0].attributes, function (index, attr) {
12588
+ // attributes[attr.name] = attr.value;
12589
+ // });
12582
12590
 
12583
- if (_iterate_info.is_val_dynamic_field) {
12584
- _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
12585
- } else {
12586
- try {
12587
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12588
- _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
12589
- } catch (err) {
12590
- console.error(err);
12591
- }
12592
- }
12593
- }
12591
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
12592
+ // //////////////////////////////////
12593
+ // if (!$div.data()?.xuData) return;
12594
+ // const _iterate_info = $div.data().xuData.iterate_info;
12595
+ // if (_iterate_info) {
12596
+ // if (_iterate_info.is_key_dynamic_field) {
12597
+ // _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
12598
+ // } else {
12599
+ // try {
12600
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12601
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
12602
+ // } catch (err) {
12603
+ // console.error(err);
12604
+ // }
12605
+ // }
12594
12606
 
12595
- if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
12596
- func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
12597
- }
12607
+ // if (_iterate_info.is_val_dynamic_field) {
12608
+ // _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
12609
+ // } else {
12610
+ // try {
12611
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12612
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
12613
+ // } catch (err) {
12614
+ // console.error(err);
12615
+ // }
12616
+ // }
12617
+ // }
12598
12618
 
12599
- const set_value = function (field_id, value) {
12600
- var currentRecordId = _$($div).data().xuData.currentRecordId;
12619
+ // if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
12620
+ // func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
12621
+ // }
12601
12622
 
12602
- func.UI.worker.add_to_queue(
12603
- SESSION_ID,
12604
- 'gui event',
12605
- 'update_datasource',
12606
- {
12607
- currentRecordId,
12608
- field_id,
12609
- field_value: value,
12610
- },
12611
- null,
12612
- null,
12613
- paramsP.dsSessionP,
12614
- );
12615
- };
12623
+ // const set_value = function (field_id, value) {
12624
+ // var currentRecordId = _$($div).data().xuData.currentRecordId;
12625
+
12626
+ // func.UI.worker.add_to_queue(
12627
+ // SESSION_ID,
12628
+ // 'gui event',
12629
+ // 'update_datasource',
12630
+ // {
12631
+ // currentRecordId,
12632
+ // field_id,
12633
+ // field_value: value,
12634
+ // },
12635
+ // null,
12636
+ // null,
12637
+ // paramsP.dsSessionP,
12638
+ // );
12639
+ // };
12616
12640
 
12617
- if ($div?.data()?.iterate_info) {
12618
- var data = $div.data().xuData.iterate_info;
12619
- if (data.iterator_key) {
12620
- set_value(data.iterator_key, data._key);
12621
- }
12622
- if (data.iterator_val) {
12623
- set_value(data.iterator_val, data._val);
12624
- }
12625
- }
12626
- };
12627
- func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
12628
- if (is_skeleton || EXP_BUSY) return;
12641
+ // if ($div?.data()?.iterate_info) {
12642
+ // var data = $div.data().xuData.iterate_info;
12643
+ // if (data.iterator_key) {
12644
+ // set_value(data.iterator_key, data._key);
12645
+ // }
12646
+ // if (data.iterator_val) {
12647
+ // set_value(data.iterator_val, data._val);
12648
+ // }
12649
+ // }
12650
+ // };
12651
+ // func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
12652
+ // if (is_skeleton || EXP_BUSY) return;
12629
12653
 
12630
- var _session = SESSION_OBJ[SESSION_ID];
12631
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
12654
+ // var _session = SESSION_OBJ[SESSION_ID];
12655
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
12632
12656
 
12633
- const _$ = function ($elm) {
12634
- try {
12635
- const id = $elm.attr('xu-ui-id');
12636
- if (!id) return $elm;
12637
- const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12657
+ // const _$ = function ($elm) {
12658
+ // try {
12659
+ // const id = $elm.attr('xu-ui-id');
12660
+ // if (!id) return $elm;
12661
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12638
12662
 
12639
- if ($el.length > 1) {
12640
- console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12641
- }
12663
+ // if ($el.length > 1) {
12664
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12665
+ // }
12642
12666
 
12643
- return $($el[0]);
12644
- } catch (e) {
12645
- console.error(e);
12646
- }
12647
- };
12667
+ // return $($el[0]);
12668
+ // } catch (e) {
12669
+ // console.error(e);
12670
+ // }
12671
+ // };
12648
12672
 
12649
- CLIENT_ACTIVITY_TS = Date.now();
12650
- if (_$($container)?.data()?.xuData?.debug_info) {
12651
- _$($container).data().xuData.debug_info.hover_item = null;
12652
- }
12653
- if (_ds?.data_system) {
12654
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
12655
- }
12656
- };
12673
+ // CLIENT_ACTIVITY_TS = Date.now();
12674
+ // if (_$($container)?.data()?.xuData?.debug_info) {
12675
+ // _$($container).data().xuData.debug_info.hover_item = null;
12676
+ // }
12677
+ // if (_ds?.data_system) {
12678
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
12679
+ // }
12680
+ // };
12657
12681
  func.UI.component = {};
12658
12682
 
12659
12683
  func.UI.component.create_app_modal_component = function (