@xuda.io/runtime-bundle 1.0.1054 → 1.0.1055

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.
@@ -32326,112 +32326,44 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32326
32326
  const init_render = async function () {
32327
32327
  nodeP.xu_render_made = value;
32328
32328
  if (!value) {
32329
- // const cloned_$div = $elm.clone(true);
32330
-
32331
- // const xu_ui_id = await generate_xu_ui_id(SESSION_ID, nodeP, $container, paramsP, keyP);
32332
-
32333
- // let $xurender = $('<xurender>').attr('xu-ui-id', xu_ui_id).attr('hidden', true).appendTo($container).hide();
32334
- // let original_data_obj = {
32335
- // force_render: true,
32336
- // $container: cloned_$div,
32337
- // nodeP: _.cloneDeep(nodeP),
32338
- // parent_infoP,
32339
- // paramsP,
32340
- // keyP,
32341
- // parent_nodeP,
32342
- // $root_container,
32343
- // };
32344
- // $xurender.data('xuData', cloned_$div.data().xuData);
32345
- // $xurender.data().xuData.original_data_obj = original_data_obj;
32346
- // $xurender.data().xuData.xurender_node = cloned_$div;
32347
- // $xurender.data().xuAttributes = nodeP.attributes || {};
32348
- // $xurender.hide();
32349
-
32350
- // $elm.remove();
32351
- // nodeP.xu_render_made = true;
32352
-
32353
32329
  return { has_xu_render_attribute: true, xu_render_in_process: true };
32354
32330
  }
32355
32331
  return { has_xu_render_attribute: true };
32356
32332
  };
32357
32333
 
32358
32334
  const post_render = async function () {
32335
+ // always come from refresh
32359
32336
  let nodeP = $container.data().xuData.node.children[keyP];
32360
32337
  nodeP.xu_render_made = value;
32361
32338
  if (value) {
32362
32339
  try {
32363
- // // abort if already rended
32364
- // if ($elm[0].tagName !== 'XURENDER' && $elm?.length) {
32365
- // return func.events.delete_job(SESSION_ID, jobNoP);
32366
- // }
32367
-
32368
- // let original_data_obj = $elm.data().xuData.original_data_obj;
32369
-
32370
- // if (!original_data_obj) {
32371
- // func.events.delete_job(SESSION_ID, jobNoP);
32372
- // return { delete_job: jobNoP };
32373
- // }
32374
-
32375
- ////////////
32376
32340
  const xu_render_cache_id = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
32377
32341
  const xu_ui_id = $elm.attr('xu-ui-id');
32378
32342
  let new_$div = UI_WORKER_OBJ?.xu_render_cache?.[xu_ui_id]?.[xu_render_cache_id]?.$div.clone(true);
32379
32343
 
32380
- /////////////
32381
- // let new_$div = original_data_obj.$container.clone(true);
32382
-
32383
32344
  if (!new_$div) {
32384
- new_$div = await func.UI.screen.render_ui_tree(
32385
- SESSION_ID,
32386
- $container, //original_data_obj.$container,
32387
- nodeP,
32388
- parent_infoP,
32389
- paramsP,
32390
- jobNoP,
32391
- null,
32392
- keyP,
32393
- null,
32394
- parent_nodeP,
32395
- null,
32396
- $root_container,
32397
- );
32398
-
32399
32345
  UI_WORKER_OBJ.xu_render_cache[xu_ui_id][xu_render_cache_id] = { $div: new_$div.clone(true) };
32400
32346
  nodeP.xu_render_xu_ui_id = xu_ui_id;
32401
32347
  nodeP.xu_render_cache_id = xu_render_cache_id;
32348
+ new_$div = await func.UI.screen.render_ui_tree(SESSION_ID, $container, nodeP, parent_infoP, paramsP, jobNoP, null, keyP, null, parent_nodeP, null, $root_container);
32349
+ }
32350
+ // append order handling
32351
+
32352
+ if (!$container.children()) {
32353
+ new_$div.appendTo($container);
32354
+ } else {
32355
+ // iterate the container node
32356
+ let $last_elm_found;
32357
+ $.each($container.data().xuData.node.children, (item_key, item_val) => {
32358
+ const $elm = $(`[xu-node-id="${item_val.id}"]`);
32359
+ if ($elm.length) {
32360
+ $last_elm_found = $elm;
32361
+ }
32362
+ if (key == item_key) {
32363
+ debugger;
32364
+ }
32365
+ });
32402
32366
  }
32403
- new_$div.appendTo($container);
32404
- // ////////////
32405
- // if (!UI_WORKER_OBJ.xu_render_cache[xu_ui_id]) {
32406
- // UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
32407
- // }
32408
- // UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = original_data_obj;
32409
- // //////////////
32410
- // new_$div.data().xuData.original_data_obj = original_data_obj;
32411
- // new_$div.data().xuData.xurender_node = $elm.clone(true);
32412
- // new_$div.data().xuAttributes = $elm.data().xuAttributes || {};
32413
-
32414
- // const replace = async function () {
32415
- // $elm.replaceWith(new_$div);
32416
- // if (from_panel) {
32417
- // const xuPanelWrapper = _.clone(new_$div.data().xuPanelWrapper);
32418
- // $elm.parent().data().xuPanelWrapper = xuPanelWrapper;
32419
- // $elm.replaceWith(new_$div.children());
32420
- // }
32421
-
32422
- // if (val.fields_arr) {
32423
- // return await func.UI.screen.refresh_xu_attributes(SESSION_ID, val.fields_arr, val.jobNoP, new_$div);
32424
- // }
32425
- // func.events.delete_job(SESSION_ID, jobNoP);
32426
- // };
32427
-
32428
- // if ($elm && func.UI.utils.find_in_element_data('xuData', $(SESSION_OBJ[SESSION_ID].root_element), 'xu_id', $elm.data().xuData.xu_id).length) {
32429
- // if (new_$div.data().xuData.paramsP) {
32430
- // return await replace();
32431
- // }
32432
-
32433
- // func.events.delete_job(SESSION_ID, jobNoP);
32434
- // }
32435
32367
  } catch (error) {
32436
32368
  func.events.delete_job(SESSION_ID, jobNoP);
32437
32369
  }
@@ -32448,58 +32380,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32448
32380
  UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = { $div: $elm.clone(true) };
32449
32381
  $elm.remove();
32450
32382
  func.events.delete_job(SESSION_ID, jobNoP);
32451
-
32452
- // if ($elm.prop('tagName') === 'XURENDER') {
32453
- // func.events.delete_job(SESSION_ID, jobNoP);
32454
- // return;
32455
- // }
32456
-
32457
- // let tmp_$div = $('<div>');
32458
- // // const xu_ui_id = $elm.attr('xu-ui-id');
32459
- // const xu_ui_id = await generate_xu_ui_id(SESSION_ID, nodeP, $container, paramsP, keyP);
32460
-
32461
- // let $xurender = $('<xurender>').attr('xu-ui-id', xu_ui_id).appendTo(tmp_$div).hide();
32462
- // // // was true before
32463
- // // if ($elm.data().xuData.xurender_node) {
32464
- // // $xurender.data({
32465
- // // xuAttributes: $elm.data().xuData.xurender_node.data().xuAttributes || {},
32466
- // // xuData: $elm.data().xuData.xurender_node.data().xuData || {},
32467
- // // });
32468
- // // } else {
32469
- // // default new state
32470
-
32471
- // $xurender.data({
32472
- // xuAttributes: $elm.data().xuAttributes || {},
32473
- // xuData: $elm.data().xuData || {},
32474
- // });
32475
- // // const original_data_obj = {
32476
- // // nodeP: _.cloneDeep($elm.data().xuData.node_org),
32477
- // // paramsP: $elm.data().xuData.paramsP,
32478
- // // $container: $elm.clone(true),
32479
- // // parent_infoP: parent_infoP,
32480
- // // };
32481
- // const cloned_$div = $elm.clone(true);
32482
- // let original_data_obj = {
32483
- // force_render: false,
32484
- // $container: cloned_$div,
32485
- // nodeP: cloned_$div.data().xuData.node_org,
32486
- // parent_infoP,
32487
- // paramsP,
32488
- // keyP,
32489
- // parent_nodeP, //:cloned_$div.data().xuData.original_data_obj.parent_nodeP,
32490
- // $root_container,
32491
- // };
32492
-
32493
- // $xurender.data().xuData.original_data_obj = original_data_obj;
32494
-
32495
- // const cache_str = await get_xu_render_cache_str(SESSION_ID, paramsP.dsSessionP);
32496
- // if (!UI_WORKER_OBJ.xu_render_cache[xu_ui_id]) {
32497
- // UI_WORKER_OBJ.xu_render_cache[xu_ui_id] = {};
32498
- // }
32499
- // UI_WORKER_OBJ.xu_render_cache[xu_ui_id][cache_str] = original_data_obj;
32500
- // // }
32501
- // $elm.replaceWith(tmp_$div.children());
32502
- // func.events.delete_job(SESSION_ID, jobNoP);
32503
32383
  };
32504
32384
  if (is_init) {
32505
32385
  return await init_render();