@xuda.io/runtime-bundle 1.0.831 → 1.0.833

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.
@@ -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,21 @@ 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);
12500
+ observer_outViewport.observe($div[0]);
12482
12501
  });
12483
12502
 
12484
- observer.observe($div[0]);
12503
+ $div.on('outViewport', function () {
12504
+ $div.empty();
12505
+ observer_inViewport.observe($div[0]);
12506
+ });
12507
+
12508
+ observer_inViewport.observe($div[0]);
12509
+ // observer_outViewport.observe($div[0]);
12485
12510
  } else {
12486
12511
  // await render_child();
12487
12512
  await iterate_child($div, nodeP, parent_infoP, $root_container);
@@ -12533,127 +12558,127 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
12533
12558
  }
12534
12559
  };
12535
12560
 
12536
- func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
12537
- if (is_skeleton || EXP_BUSY) return;
12561
+ // func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
12562
+ // if (is_skeleton || EXP_BUSY) return;
12538
12563
 
12539
- var _session = SESSION_OBJ[SESSION_ID];
12540
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
12564
+ // var _session = SESSION_OBJ[SESSION_ID];
12565
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
12541
12566
 
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
- }
12567
+ // const _$ = function ($elm) {
12568
+ // try {
12569
+ // const id = $elm.attr('xu-ui-id');
12570
+ // if (!id) return $elm;
12571
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12551
12572
 
12552
- return $($el[0]);
12553
- } catch (e) {
12554
- console.error(e);
12555
- }
12556
- };
12573
+ // if ($el.length > 1) {
12574
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12575
+ // }
12557
12576
 
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
- });
12577
+ // return $($el[0]);
12578
+ // } catch (e) {
12579
+ // console.error(e);
12580
+ // }
12581
+ // };
12566
12582
 
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
- }
12583
+ // CLIENT_ACTIVITY_TS = Date.now();
12584
+ // if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
12585
+ // if (!_ds) return;
12586
+ // ///////// SET Attributes///////////
12587
+ // let attributes = {};
12588
+ // $.each($div[0].attributes, function (index, attr) {
12589
+ // attributes[attr.name] = attr.value;
12590
+ // });
12582
12591
 
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
- }
12592
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
12593
+ // //////////////////////////////////
12594
+ // if (!$div.data()?.xuData) return;
12595
+ // const _iterate_info = $div.data().xuData.iterate_info;
12596
+ // if (_iterate_info) {
12597
+ // if (_iterate_info.is_key_dynamic_field) {
12598
+ // _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
12599
+ // } else {
12600
+ // try {
12601
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12602
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
12603
+ // } catch (err) {
12604
+ // console.error(err);
12605
+ // }
12606
+ // }
12594
12607
 
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
- }
12608
+ // if (_iterate_info.is_val_dynamic_field) {
12609
+ // _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
12610
+ // } else {
12611
+ // try {
12612
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12613
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
12614
+ // } catch (err) {
12615
+ // console.error(err);
12616
+ // }
12617
+ // }
12618
+ // }
12598
12619
 
12599
- const set_value = function (field_id, value) {
12600
- var currentRecordId = _$($div).data().xuData.currentRecordId;
12620
+ // if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
12621
+ // func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
12622
+ // }
12601
12623
 
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
- };
12624
+ // const set_value = function (field_id, value) {
12625
+ // var currentRecordId = _$($div).data().xuData.currentRecordId;
12626
+
12627
+ // func.UI.worker.add_to_queue(
12628
+ // SESSION_ID,
12629
+ // 'gui event',
12630
+ // 'update_datasource',
12631
+ // {
12632
+ // currentRecordId,
12633
+ // field_id,
12634
+ // field_value: value,
12635
+ // },
12636
+ // null,
12637
+ // null,
12638
+ // paramsP.dsSessionP,
12639
+ // );
12640
+ // };
12616
12641
 
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;
12642
+ // if ($div?.data()?.iterate_info) {
12643
+ // var data = $div.data().xuData.iterate_info;
12644
+ // if (data.iterator_key) {
12645
+ // set_value(data.iterator_key, data._key);
12646
+ // }
12647
+ // if (data.iterator_val) {
12648
+ // set_value(data.iterator_val, data._val);
12649
+ // }
12650
+ // }
12651
+ // };
12652
+ // func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
12653
+ // if (is_skeleton || EXP_BUSY) return;
12629
12654
 
12630
- var _session = SESSION_OBJ[SESSION_ID];
12631
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
12655
+ // var _session = SESSION_OBJ[SESSION_ID];
12656
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
12632
12657
 
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);
12658
+ // const _$ = function ($elm) {
12659
+ // try {
12660
+ // const id = $elm.attr('xu-ui-id');
12661
+ // if (!id) return $elm;
12662
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
12638
12663
 
12639
- if ($el.length > 1) {
12640
- console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12641
- }
12664
+ // if ($el.length > 1) {
12665
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
12666
+ // }
12642
12667
 
12643
- return $($el[0]);
12644
- } catch (e) {
12645
- console.error(e);
12646
- }
12647
- };
12668
+ // return $($el[0]);
12669
+ // } catch (e) {
12670
+ // console.error(e);
12671
+ // }
12672
+ // };
12648
12673
 
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
- };
12674
+ // CLIENT_ACTIVITY_TS = Date.now();
12675
+ // if (_$($container)?.data()?.xuData?.debug_info) {
12676
+ // _$($container).data().xuData.debug_info.hover_item = null;
12677
+ // }
12678
+ // if (_ds?.data_system) {
12679
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
12680
+ // }
12681
+ // };
12657
12682
  func.UI.component = {};
12658
12683
 
12659
12684
  func.UI.component.create_app_modal_component = function (