@xuda.io/runtime-bundle 1.0.805 → 1.0.806

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.
@@ -8743,10 +8743,11 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8743
8743
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8744
8744
  },
8745
8745
  render_viewport: async function () {
8746
- const { nodeP, $divP, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP } = queue_obj?.paramsP || {};
8746
+ const { nodeP, $div, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP } = queue_obj?.paramsP || {};
8747
8747
  if (nodeP?.children?.length) {
8748
+ func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP);
8748
8749
  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
+ 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);
8750
8751
  }
8751
8752
  }
8752
8753
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
@@ -14744,7 +14745,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
14744
14745
  // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
14745
14746
  // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
14746
14747
  $div.on('inViewport', function () {
14747
- func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $divP: $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP }, null, null, paramsP.dsSessionP);
14748
+ 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
14749
  // render_child();
14749
14750
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
14750
14751
  });
@@ -14800,6 +14801,96 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
14800
14801
  }
14801
14802
  }
14802
14803
  };
14804
+
14805
+ func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP) {
14806
+ if (is_skeleton || EXP_BUSY) return;
14807
+
14808
+ var _session = SESSION_OBJ[SESSION_ID];
14809
+ var _ds = _session.DS_GLB[paramsP.dsSessionP];
14810
+
14811
+ CLIENT_ACTIVITY_TS = Date.now();
14812
+ if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
14813
+ if (!_ds) return;
14814
+ ///////// SET Attributes///////////
14815
+ let attributes = {};
14816
+ $.each($div[0].attributes, function (index, attr) {
14817
+ attributes[attr.name] = attr.value;
14818
+ });
14819
+
14820
+ SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
14821
+ //////////////////////////////////
14822
+ if (!$div.data()?.xuData) return;
14823
+ const _iterate_info = $div.data().xuData.iterate_info;
14824
+ if (_iterate_info) {
14825
+ if (_iterate_info.is_key_dynamic_field) {
14826
+ _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
14827
+ } else {
14828
+ try {
14829
+ const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
14830
+ _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
14831
+ } catch (err) {
14832
+ console.error(err);
14833
+ }
14834
+ }
14835
+
14836
+ if (_iterate_info.is_val_dynamic_field) {
14837
+ _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
14838
+ } else {
14839
+ try {
14840
+ const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
14841
+ _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
14842
+ } catch (err) {
14843
+ console.error(err);
14844
+ }
14845
+ }
14846
+ }
14847
+
14848
+ if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
14849
+ func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
14850
+ }
14851
+
14852
+ const set_value = function (field_id, value) {
14853
+ var currentRecordId = _$($div).data().xuData.currentRecordId;
14854
+
14855
+ func.UI.worker.add_to_queue(
14856
+ SESSION_ID,
14857
+ 'gui event',
14858
+ 'update_datasource',
14859
+ {
14860
+ currentRecordId,
14861
+ field_id,
14862
+ field_value: value,
14863
+ },
14864
+ null,
14865
+ null,
14866
+ paramsP.dsSessionP,
14867
+ );
14868
+ };
14869
+
14870
+ if ($div?.data()?.iterate_info) {
14871
+ var data = $div.data().xuData.iterate_info;
14872
+ if (data.iterator_key) {
14873
+ set_value(data.iterator_key, data._key);
14874
+ }
14875
+ if (data.iterator_val) {
14876
+ set_value(data.iterator_val, data._val);
14877
+ }
14878
+ }
14879
+ };
14880
+ func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
14881
+ if (is_skeleton || EXP_BUSY) return;
14882
+
14883
+ var _session = SESSION_OBJ[SESSION_ID];
14884
+ var _ds = _session.DS_GLB[paramsP.dsSessionP];
14885
+
14886
+ CLIENT_ACTIVITY_TS = Date.now();
14887
+ if (_$($container)?.data()?.xuData?.debug_info) {
14888
+ _$($container).data().xuData.debug_info.hover_item = null;
14889
+ }
14890
+ if (_ds?.data_system) {
14891
+ SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
14892
+ }
14893
+ };
14803
14894
  func.UI.component = {};
14804
14895
 
14805
14896
  func.UI.component.create_app_modal_component = function (
@@ -8744,10 +8744,11 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
8744
8744
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
8745
8745
  },
8746
8746
  render_viewport: async function () {
8747
- const { nodeP, $divP, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP } = queue_obj?.paramsP || {};
8747
+ const { nodeP, $div, parent_infoP, $root_container, jobNoP, is_skeleton, paramsP } = queue_obj?.paramsP || {};
8748
8748
  if (nodeP?.children?.length) {
8749
+ func.UI.screen.hover_in(SESSION_ID, $div, $container, paramsP);
8749
8750
  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
+ 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);
8751
8752
  }
8752
8753
  }
8753
8754
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
@@ -12452,7 +12453,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
12452
12453
  // console.log('on>>', 'inViewport_' + $div.attr('xu-ui-id'));
12453
12454
  // $div.on('inViewport_' + $div.attr('xu-ui-id'), function () {
12454
12455
  $div.on('inViewport', function () {
12455
- func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'render_viewport', { $divP: $div, nodeP, parent_infoP, $root_container, paramsP, jobNoP, is_skeleton, keyP, refreshed_ds, parent_nodeP, check_existP }, null, null, paramsP.dsSessionP);
12456
+ 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
12457
  // render_child();
12457
12458
  // iterate_child($div, nodeP, parent_infoP, null, $root_container);
12458
12459
  });
@@ -12508,6 +12509,96 @@ func.UI.screen.refresh_document_changes_for_realtime_update = async function (SE
12508
12509
  }
12509
12510
  }
12510
12511
  };
12512
+
12513
+ func.UI.screen.hover_in = function (SESSION_ID, $div, $container, paramsP) {
12514
+ if (is_skeleton || EXP_BUSY) return;
12515
+
12516
+ var _session = SESSION_OBJ[SESSION_ID];
12517
+ var _ds = _session.DS_GLB[paramsP.dsSessionP];
12518
+
12519
+ CLIENT_ACTIVITY_TS = Date.now();
12520
+ if (_$($container)?.data()?.xuData?.debug_info) _$($container).data().xuData.debug_info.hover_item = $div.attr('xu-ui-id');
12521
+ if (!_ds) return;
12522
+ ///////// SET Attributes///////////
12523
+ let attributes = {};
12524
+ $.each($div[0].attributes, function (index, attr) {
12525
+ attributes[attr.name] = attr.value;
12526
+ });
12527
+
12528
+ SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = attributes;
12529
+ //////////////////////////////////
12530
+ if (!$div.data()?.xuData) return;
12531
+ const _iterate_info = $div.data().xuData.iterate_info;
12532
+ if (_iterate_info) {
12533
+ if (_iterate_info.is_key_dynamic_field) {
12534
+ _ds.dynamic_fields[_iterate_info.iterator_key].value = _iterate_info._key;
12535
+ } else {
12536
+ try {
12537
+ const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12538
+ _ds.data_feed.rows[row_idx][_iterate_info.iterator_key] = _iterate_info._key;
12539
+ } catch (err) {
12540
+ console.error(err);
12541
+ }
12542
+ }
12543
+
12544
+ if (_iterate_info.is_val_dynamic_field) {
12545
+ _ds.dynamic_fields[_iterate_info.iterator_val].value = _iterate_info._val;
12546
+ } else {
12547
+ try {
12548
+ const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12549
+ _ds.data_feed.rows[row_idx][_iterate_info.iterator_val] = _iterate_info._val;
12550
+ } catch (err) {
12551
+ console.error(err);
12552
+ }
12553
+ }
12554
+ }
12555
+
12556
+ if ($div && _$($div) && _ds && paramsP.renderType === 'grid') {
12557
+ func.UI.worker.add_to_queue(SESSION_ID, 'gui event', 'update_datasource', { currentRecordId: _$($div).data().xuData.currentRecordId }, null, null, paramsP.dsSessionP);
12558
+ }
12559
+
12560
+ const set_value = function (field_id, value) {
12561
+ var currentRecordId = _$($div).data().xuData.currentRecordId;
12562
+
12563
+ func.UI.worker.add_to_queue(
12564
+ SESSION_ID,
12565
+ 'gui event',
12566
+ 'update_datasource',
12567
+ {
12568
+ currentRecordId,
12569
+ field_id,
12570
+ field_value: value,
12571
+ },
12572
+ null,
12573
+ null,
12574
+ paramsP.dsSessionP,
12575
+ );
12576
+ };
12577
+
12578
+ if ($div?.data()?.iterate_info) {
12579
+ var data = $div.data().xuData.iterate_info;
12580
+ if (data.iterator_key) {
12581
+ set_value(data.iterator_key, data._key);
12582
+ }
12583
+ if (data.iterator_val) {
12584
+ set_value(data.iterator_val, data._val);
12585
+ }
12586
+ }
12587
+ };
12588
+ func.UI.screen.hover_out = function (SESSION_ID, $container, is_skeleton, paramsP) {
12589
+ if (is_skeleton || EXP_BUSY) return;
12590
+
12591
+ var _session = SESSION_OBJ[SESSION_ID];
12592
+ var _ds = _session.DS_GLB[paramsP.dsSessionP];
12593
+
12594
+ CLIENT_ACTIVITY_TS = Date.now();
12595
+ if (_$($container)?.data()?.xuData?.debug_info) {
12596
+ _$($container).data().xuData.debug_info.hover_item = null;
12597
+ }
12598
+ if (_ds?.data_system) {
12599
+ SESSION_OBJ[SESSION_ID].DS_GLB[0].data_system.SYS_OBJ_WIN_ELEMENT_HOVERED_ATTRIBUTES = {};
12600
+ }
12601
+ };
12511
12602
  func.UI.component = {};
12512
12603
 
12513
12604
  func.UI.component.create_app_modal_component = function (