@xuda.io/runtime-bundle 1.0.1252 → 1.0.1254

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.
@@ -36370,7 +36370,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36370
36370
  };
36371
36371
 
36372
36372
  const render_screen_type = async function ($div) {
36373
- const set_call_screen_properties_values = async function (ui_framework) {
36373
+ const set_call_screen_properties_values = async function (ui_framework, params) {
36374
36374
  params.properties = {};
36375
36375
 
36376
36376
  const get_values = async function (property) {
@@ -36409,7 +36409,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36409
36409
 
36410
36410
  let $ret = $div;
36411
36411
  const $nav = $(SESSION_OBJ[SESSION_ID].root_element).find('xu-nav');
36412
- let params;
36413
36412
 
36414
36413
  switch (paramsP.screen_type) {
36415
36414
  case 'modal':
@@ -36423,7 +36422,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36423
36422
 
36424
36423
  let controller_params = $(xu_modal_controller).data('xuControllerParams') || {};
36425
36424
 
36426
- params = {
36425
+ const modalParams = {
36427
36426
  screenId: paramsP.screenId,
36428
36427
  $dialogDiv: $div.children(),
36429
36428
  $container: $container,
@@ -36434,40 +36433,40 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36434
36433
  paramsP,
36435
36434
  };
36436
36435
 
36437
- controller_params[modal_id] = params;
36436
+ controller_params[modal_id] = modalParams;
36438
36437
  $(xu_modal_controller).data('xuControllerParams', controller_params);
36439
36438
 
36440
36439
  const modalController = new UI_FRAMEWORK_PLUGIN.modal();
36441
- await set_call_screen_properties_values(modalController);
36440
+ await set_call_screen_properties_values(modalController, modalParams);
36442
36441
 
36443
36442
  if (!APP_MODAL_OBJ[modal_id]) {
36444
- APP_MODAL_OBJ[modal_id] = await modalController.create(params);
36443
+ APP_MODAL_OBJ[modal_id] = await modalController.create(modalParams);
36445
36444
  } else {
36446
36445
  $(modal_id).empty();
36447
36446
  }
36448
- await modalController.init(params);
36447
+ await modalController.init(modalParams);
36449
36448
  break;
36450
36449
 
36451
36450
  case 'popover':
36452
36451
  const xu_popover_controller = func.UI.component.create_app_popover_component(SESSION_ID);
36453
- params = {
36452
+ const popoverParams = {
36454
36453
  menuTitle: paramsP.screenInfo.properties?.menuTitle,
36455
36454
  screenId: paramsP.screenId,
36456
36455
  $dialogDiv: $div.children(),
36457
36456
  $container: $container,
36458
36457
  };
36459
36458
 
36460
- $(xu_popover_controller).data('xuControllerParams', params);
36459
+ $(xu_popover_controller).data('xuControllerParams', popoverParams);
36461
36460
  const popover = new UI_FRAMEWORK_PLUGIN.popover(SESSION_ID);
36462
- await set_call_screen_properties_values(popover);
36463
- await popover.open(params);
36461
+ await set_call_screen_properties_values(popover, popoverParams);
36462
+ await popover.open(popoverParams);
36464
36463
  CURRENT_APP_POPOVER = popover;
36465
36464
  func.UI.utils.screen_blocker(false, `${paramsP.prog_id}_${paramsP.sourceScreenP}`);
36466
36465
  break;
36467
36466
 
36468
36467
  case 'page':
36469
36468
  const nav = $nav[0];
36470
- params = {
36469
+ const pageParams = {
36471
36470
  div: $div_content,
36472
36471
  name: paramsP.screenInfo.properties?.menuTitle,
36473
36472
  screenId: paramsP.screenId,
@@ -36487,19 +36486,19 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36487
36486
 
36488
36487
  // Restore validate
36489
36488
  if (navXuData.params?.[paramsP.dsSessionP]) {
36490
- params.$container.data().xuData.validate_screen_ready = navXuData.params[paramsP.dsSessionP].$container.data().xuData.validate_screen_ready;
36489
+ pageParams.$container.data().xuData.validate_screen_ready = navXuData.params[paramsP.dsSessionP].$container.data().xuData.validate_screen_ready;
36491
36490
  }
36492
36491
 
36493
36492
  if (!navXuData) return;
36494
- navXuData.nav_params[paramsP.dsSessionP] = params;
36493
+ navXuData.nav_params[paramsP.dsSessionP] = pageParams;
36495
36494
 
36496
36495
  if (!$(component_name).length) {
36497
36496
  await func.UI.component.create_app_page_component(SESSION_ID, paramsP.dsSessionP);
36498
36497
  const page = new UI_FRAMEWORK_PLUGIN.page();
36499
- await set_call_screen_properties_values(page);
36500
- await page.create(params);
36501
- await page.init(params);
36502
- nav.push(component_name, { params });
36498
+ await set_call_screen_properties_values(page, pageParams);
36499
+ await page.create(pageParams);
36500
+ await page.init(pageParams);
36501
+ nav.push(component_name, { params: pageParams });
36503
36502
  } else {
36504
36503
  $(component_name).empty();
36505
36504
  await UI_FRAMEWORK_PLUGIN.page(SESSION_ID, paramsP.dsSessionP);
@@ -36514,9 +36513,9 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36514
36513
 
36515
36514
  default:
36516
36515
  if (!$nav?.length) {
36517
- $nav = $('<xu-nav>');
36518
- $container.append($nav);
36519
- func.UI.component.init_xu_nav($container, $nav);
36516
+ const $newNav = $('<xu-nav>');
36517
+ $container.append($newNav);
36518
+ func.UI.component.init_xu_nav($container, $newNav);
36520
36519
  }
36521
36520
 
36522
36521
  $nav.data().xuData.$div = $div_content;
@@ -36937,6 +36936,93 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
36937
36936
  return await fx[nodeTag]();
36938
36937
  }
36939
36938
 
36939
+ // Old rendering path (when glb.new_xu_render is false)
36940
+ const draw_html_element_org = async function (element) {
36941
+ const done = async function (ret = {}) {
36942
+ return $div;
36943
+ };
36944
+
36945
+ if (!element || element === 'script') return await done();
36946
+
36947
+ const $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, '');
36948
+
36949
+ $div.hover(
36950
+ (e) => hover_in($div, e),
36951
+ (e) => hover_out(),
36952
+ );
36953
+
36954
+ if (paramsP.paramsP === 'grid' || parent_infoP?.iterate_info) {
36955
+ $div.on('click contextmenu', (e) => hover_in($div, e));
36956
+ }
36957
+
36958
+ const ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div, true);
36959
+
36960
+ if (ret.abort || nodeTag === 'svg' || !_.isEmpty(nodeP?.attributes?.['xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-html']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-text']) || !_.isEmpty(nodeP?.attributes?.['xu-exp:xu-html'])) {
36961
+ return await done(ret);
36962
+ }
36963
+
36964
+ if (nodeP?.attributes?.['xu-viewport'] === 'true') {
36965
+ const xu_viewport = function () {
36966
+ const observer_inViewport = new IntersectionObserver(
36967
+ (entries) => {
36968
+ entries.forEach((entry) => {
36969
+ if (entry.isIntersecting) {
36970
+ $(entry.target).trigger('inViewport');
36971
+ observer_inViewport.unobserve(entry.target);
36972
+ }
36973
+ });
36974
+ },
36975
+ { threshold: 0.1 },
36976
+ );
36977
+
36978
+ const observer_outViewport = new IntersectionObserver(
36979
+ (entries) => {
36980
+ entries.forEach((entry) => {
36981
+ if (!entry.isIntersecting) {
36982
+ $(entry.target).trigger('outViewport');
36983
+ }
36984
+ });
36985
+ },
36986
+ { threshold: 0 },
36987
+ );
36988
+
36989
+ let ui_job_id;
36990
+
36991
+ $div.on('inViewport', function () {
36992
+ if ($div.children().length) {
36993
+ $div.removeClass('skeleton');
36994
+ return;
36995
+ }
36996
+
36997
+ hover_in($div);
36998
+ ui_job_id = 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);
36999
+ observer_outViewport.observe($div[0]);
37000
+ });
37001
+
37002
+ $div.on('outViewport', function () {
37003
+ func.UI.worker.delete_job(SESSION_ID, ui_job_id);
37004
+
37005
+ if ($div.children().length) {
37006
+ $div.empty();
37007
+ const height = $div?.data()?.xuData?.viewport_height || 10;
37008
+ if (height !== undefined) {
37009
+ $div.css('height', height);
37010
+ }
37011
+ }
37012
+ observer_inViewport.observe($div[0]);
37013
+ });
37014
+
37015
+ $div.addClass('skeleton');
37016
+ observer_inViewport.observe($div[0]);
37017
+ };
37018
+ xu_viewport();
37019
+ } else {
37020
+ await iterate_child($div, nodeP, parent_infoP, $root_container);
37021
+ }
37022
+
37023
+ return await done(ret);
37024
+ };
37025
+
36940
37026
  // Render HTML element
36941
37027
  if (!glb.new_xu_render) {
36942
37028
  return await draw_html_element_org(nodeTag);