@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.
@@ -34229,12 +34229,12 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34229
34229
 
34230
34230
  $div.hover(
34231
34231
  function (e) {
34232
- // hover_in();
34233
- func.UI.screen.hover_in(SESSION_ID, null, $container, paramsP, is_skeleton);
34232
+ hover_in();
34233
+ // func.UI.screen.hover_in(SESSION_ID, null, $container, paramsP, is_skeleton);
34234
34234
  },
34235
34235
  function (e) {
34236
- func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
34237
- // hover_out();
34236
+ // func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
34237
+ hover_out();
34238
34238
  },
34239
34239
  );
34240
34240
  }
@@ -34393,12 +34393,12 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34393
34393
 
34394
34394
  $div.hover(
34395
34395
  function (e) {
34396
- // hover_in($div);
34397
- func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
34396
+ hover_in($div);
34397
+ // func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
34398
34398
  },
34399
34399
  function (e) {
34400
- func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
34401
- // hover_out();
34400
+ // func.UI.screen.hover_out(SESSION_ID, $container, is_skeleton, paramsP);
34401
+ hover_out();
34402
34402
  },
34403
34403
  );
34404
34404
 
@@ -34406,7 +34406,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34406
34406
  if (ret.abort || nodeP.tagName === 'svg') return await done();
34407
34407
  // check if iterator made to prevent children render
34408
34408
 
34409
- const observer = new IntersectionObserver(
34409
+ const observer_inViewport = new IntersectionObserver(
34410
34410
  function (entries) {
34411
34411
  entries.forEach((entry) => {
34412
34412
  if (entry.isIntersecting) {
@@ -34417,7 +34417,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34417
34417
  $(entry.target).trigger('inViewport');
34418
34418
 
34419
34419
  // Optional: stop observing once triggered
34420
- observer.unobserve(entry.target);
34420
+ observer_inViewport.unobserve(entry.target);
34421
34421
  }
34422
34422
  });
34423
34423
  },
@@ -34426,6 +34426,23 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34426
34426
  },
34427
34427
  );
34428
34428
 
34429
+ const observer_outViewport = new IntersectionObserver(
34430
+ function (entries) {
34431
+ entries.forEach((entry) => {
34432
+ if (!entry.isIntersecting) {
34433
+ // Element is OUT of viewport - trigger custom event
34434
+ $(entry.target).trigger('outViewport');
34435
+
34436
+ // Optional: stop observing once triggered
34437
+ // observer_outViewport.unobserve(entry.target);
34438
+ }
34439
+ });
34440
+ },
34441
+ {
34442
+ threshold: 0, // Trigger when element is completely out of view
34443
+ },
34444
+ );
34445
+
34429
34446
  // const render_child = async function () {
34430
34447
  // await iterate_child($div, nodeP, parent_infoP, $root_container);
34431
34448
  // };
@@ -34434,13 +34451,21 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34434
34451
  // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
34435
34452
  // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
34436
34453
  $div.on('inViewport', function () {
34437
- func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
34454
+ hover_in($div);
34455
+ // func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP, is_skeleton);
34438
34456
  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);
34439
34457
  // render_child();
34440
34458
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
34459
+ observer_outViewport.observe($div[0]);
34441
34460
  });
34442
34461
 
34443
- observer.observe($div[0]);
34462
+ $div.on('outViewport', function () {
34463
+ $div.empty();
34464
+ observer_inViewport.observe($div[0]);
34465
+ });
34466
+
34467
+ observer_inViewport.observe($div[0]);
34468
+ // observer_outViewport.observe($div[0]);
34444
34469
  } else {
34445
34470
  // await render_child();
34446
34471
  await iterate_child($div, nodeP, parent_infoP, $root_container);
@@ -34492,127 +34517,127 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
34492
34517
  }
34493
34518
  };
34494
34519
 
34495
- func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
34496
- if (is_skeleton || EXP_BUSY) return;
34520
+ // func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP, is_skeleton) {
34521
+ // if (is_skeleton || EXP_BUSY) return;
34497
34522
 
34498
- var _session = SESSION_OBJ[SESSION_ID];
34499
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
34523
+ // var _session = SESSION_OBJ[SESSION_ID];
34524
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
34500
34525
 
34501
- const _$ = function ($elm) {
34502
- try {
34503
- const id = $elm.attr('xu-ui-id');
34504
- if (!id) return $elm;
34505
- const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
34526
+ // const _$ = function ($elm) {
34527
+ // try {
34528
+ // const id = $elm.attr('xu-ui-id');
34529
+ // if (!id) return $elm;
34530
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
34506
34531
 
34507
- if ($el.length > 1) {
34508
- console.warn('Multiple elements for xu-ui-id: ' + id, $el);
34509
- }
34532
+ // if ($el.length > 1) {
34533
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
34534
+ // }
34510
34535
 
34511
- return $($el[0]);
34512
- } catch (e) {
34513
- console.error(e);
34514
- }
34515
- };
34536
+ // return $($el[0]);
34537
+ // } catch (e) {
34538
+ // console.error(e);
34539
+ // }
34540
+ // };
34516
34541
 
34517
- CLIENT_ACTIVITY_TS = Date.now();
34518
- if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
34519
- if (!_ds) return;
34520
- ///////// SET Attributes///////////
34521
- let attributes = {};
34522
- $.each($div[0].attributes, function (index, attr) {
34523
- attributes[attr.name] = attr.value;
34524
- });
34542
+ // CLIENT_ACTIVITY_TS = Date.now();
34543
+ // if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
34544
+ // if (!_ds) return;
34545
+ // ///////// SET Attributes///////////
34546
+ // let attributes = {};
34547
+ // $.each($div[0].attributes, function (index, attr) {
34548
+ // attributes[attr.name] = attr.value;
34549
+ // });
34525
34550
 
34526
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
34527
- //////////////////////////////////
34528
- if (!$div.data()?.xuData) return;
34529
- const _iterate_info = $div.data().xuData.iterate_info;
34530
- if (_iterate_info) {
34531
- if (_iterate_info.is_key_dynamic_field) {
34532
- _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
34533
- } else {
34534
- try {
34535
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
34536
- _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
34537
- } catch (err) {
34538
- console.error(err);
34539
- }
34540
- }
34551
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
34552
+ // //////////////////////////////////
34553
+ // if (!$div.data()?.xuData) return;
34554
+ // const _iterate_info = $div.data().xuData.iterate_info;
34555
+ // if (_iterate_info) {
34556
+ // if (_iterate_info.is_key_dynamic_field) {
34557
+ // _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
34558
+ // } else {
34559
+ // try {
34560
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
34561
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
34562
+ // } catch (err) {
34563
+ // console.error(err);
34564
+ // }
34565
+ // }
34541
34566
 
34542
- if (_iterate_info.is_val_dynamic_field) {
34543
- _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
34544
- } else {
34545
- try {
34546
- const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
34547
- _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
34548
- } catch (err) {
34549
- console.error(err);
34550
- }
34551
- }
34552
- }
34567
+ // if (_iterate_info.is_val_dynamic_field) {
34568
+ // _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
34569
+ // } else {
34570
+ // try {
34571
+ // const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
34572
+ // _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
34573
+ // } catch (err) {
34574
+ // console.error(err);
34575
+ // }
34576
+ // }
34577
+ // }
34553
34578
 
34554
- if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
34555
- func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
34556
- }
34579
+ // if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
34580
+ // func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
34581
+ // }
34557
34582
 
34558
- const set_value = function (field_id, value) {
34559
- var currentRecordId = _$($div).data().xuData.currentRecordId;
34583
+ // const set_value = function (field_id, value) {
34584
+ // var currentRecordId = _$($div).data().xuData.currentRecordId;
34560
34585
 
34561
- func.UI.worker.add_to_queue(
34562
- SESSION_ID,
34563
- 'gui event',
34564
- 'update_datasource',
34565
- {
34566
- currentRecordId,
34567
- field_id,
34568
- field_value: value,
34569
- },
34570
- null,
34571
- null,
34572
- paramsP.dsSessionP,
34573
- );
34574
- };
34586
+ // func.UI.worker.add_to_queue(
34587
+ // SESSION_ID,
34588
+ // 'gui event',
34589
+ // 'update_datasource',
34590
+ // {
34591
+ // currentRecordId,
34592
+ // field_id,
34593
+ // field_value: value,
34594
+ // },
34595
+ // null,
34596
+ // null,
34597
+ // paramsP.dsSessionP,
34598
+ // );
34599
+ // };
34575
34600
 
34576
- if ($div?.data()?.iterate_info) {
34577
- var data = $div.data().xuData.iterate_info;
34578
- if (data.iterator_key) {
34579
- set_value(data.iterator_key, data._key);
34580
- }
34581
- if (data.iterator_val) {
34582
- set_value(data.iterator_val, data._val);
34583
- }
34584
- }
34585
- };
34586
- func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
34587
- if (is_skeleton || EXP_BUSY) return;
34601
+ // if ($div?.data()?.iterate_info) {
34602
+ // var data = $div.data().xuData.iterate_info;
34603
+ // if (data.iterator_key) {
34604
+ // set_value(data.iterator_key, data._key);
34605
+ // }
34606
+ // if (data.iterator_val) {
34607
+ // set_value(data.iterator_val, data._val);
34608
+ // }
34609
+ // }
34610
+ // };
34611
+ // func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
34612
+ // if (is_skeleton || EXP_BUSY) return;
34588
34613
 
34589
- var _session = SESSION_OBJ[SESSION_ID];
34590
- var _ds = _session.DS_GLB[paramsP.dsSessionP];
34614
+ // var _session = SESSION_OBJ[SESSION_ID];
34615
+ // var _ds = _session.DS_GLB[paramsP.dsSessionP];
34591
34616
 
34592
- const _$ = function ($elm) {
34593
- try {
34594
- const id = $elm.attr('xu-ui-id');
34595
- if (!id) return $elm;
34596
- const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
34617
+ // const _$ = function ($elm) {
34618
+ // try {
34619
+ // const id = $elm.attr('xu-ui-id');
34620
+ // if (!id) return $elm;
34621
+ // const $el = $(`[xu-ui-id="${id}"]`); // $("#" + id);
34597
34622
 
34598
- if ($el.length > 1) {
34599
- console.warn('Multiple elements for xu-ui-id: ' + id, $el);
34600
- }
34623
+ // if ($el.length > 1) {
34624
+ // console.warn('Multiple elements for xu-ui-id: ' + id, $el);
34625
+ // }
34601
34626
 
34602
- return $($el[0]);
34603
- } catch (e) {
34604
- console.error(e);
34605
- }
34606
- };
34627
+ // return $($el[0]);
34628
+ // } catch (e) {
34629
+ // console.error(e);
34630
+ // }
34631
+ // };
34607
34632
 
34608
- CLIENT_ACTIVITY_TS = Date.now();
34609
- if (_$($container)?.data()?.xuData?.debug_info) {
34610
- _$($container).data().xuData.debug_info.hover_item = null;
34611
- }
34612
- if (_ds?.data_system) {
34613
- SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
34614
- }
34615
- };
34633
+ // CLIENT_ACTIVITY_TS = Date.now();
34634
+ // if (_$($container)?.data()?.xuData?.debug_info) {
34635
+ // _$($container).data().xuData.debug_info.hover_item = null;
34636
+ // }
34637
+ // if (_ds?.data_system) {
34638
+ // SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
34639
+ // }
34640
+ // };
34616
34641
  func.UI.component = {};
34617
34642
 
34618
34643
  func.UI.component.create_app_modal_component = function (