@xuda.io/xuda-worker-bundle-min 1.3.2437 → 1.3.2439

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.
Files changed (2) hide show
  1. package/index.js +40 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -563,7 +563,7 @@ func.runtime.bind.build_datasource_changes = function (dsSessionP, currentRecord
563
563
  },
564
564
  };
565
565
  };
566
- func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id) {
566
+ func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSessionP, field_id, iterate_info) {
567
567
  let _prog_id = prog_id;
568
568
  let _dsP = dsSessionP;
569
569
  let is_dynamic_field = false;
@@ -579,7 +579,20 @@ func.runtime.bind.resolve_field = async function (SESSION_ID, prog_id, dsSession
579
579
 
580
580
  if (['_FOR_VAL', '_FOR_KEY'].includes(field_id)) {
581
581
  is_dynamic_field = true;
582
- field_prop = SESSION_OBJ[SESSION_ID]?.DS_GLB?.[_dsP]?.dynamic_fields?.[field_id];
582
+ if (iterate_info && (iterate_info.iterator_val === field_id || iterate_info.iterator_key === field_id)) {
583
+ const iter_value = iterate_info.iterator_val === field_id ? iterate_info._val : iterate_info._key;
584
+ const toType = function (obj) {
585
+ return {}.toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
586
+ };
587
+ field_prop = {
588
+ id: field_id,
589
+ data: { type: 'virtual', field_id },
590
+ props: { fieldType: typeof iter_value !== 'undefined' ? toType(iter_value) : 'string' },
591
+ value: iter_value,
592
+ };
593
+ } else {
594
+ field_prop = SESSION_OBJ[SESSION_ID]?.DS_GLB?.[_dsP]?.dynamic_fields?.[field_id];
595
+ }
583
596
  } else {
584
597
  field_prop = await find_in_view(field_id, _prog_id);
585
598
  if (!field_prop) {
@@ -663,7 +676,7 @@ func.runtime.bind.update_reference_source_array = async function (options) {
663
676
  if (field_type === 'object' && options.val_is_reference_field) {
664
677
  let obj_item = new_arr[arr_idx];
665
678
  let e_exp = options.expression_value.replace(options.bind_field_id, 'obj_item');
666
- eval(e_exp + (options.input_field_type === 'string' ? `="${options.value}"` : `=${options.value}`));
679
+ eval(e_exp + `=${JSON.stringify(options.value)}`);
667
680
  new_arr[arr_idx] = obj_item;
668
681
  } else {
669
682
  new_arr[arr_idx] = options.value;
@@ -2657,6 +2670,23 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2657
2670
  let prog_obj = await func.utils.VIEWS_OBJ.get(SESSION_ID, _ds.prog_id);
2658
2671
 
2659
2672
  const callback_datasource = async function () {
2673
+ const run_on_load_events = async function () {
2674
+ if (!(await func.datasource.get_view_events_count(SESSION_ID, dataSourceSession, 'on_load'))) {
2675
+ return false;
2676
+ }
2677
+ await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'on_load');
2678
+ return true;
2679
+ };
2680
+ const schedule_panel_on_load_events = function () {
2681
+ setTimeout(async function () {
2682
+ try {
2683
+ await run_on_load_events();
2684
+ } catch (error) {
2685
+ console.error(error);
2686
+ }
2687
+ }, 0);
2688
+ };
2689
+
2660
2690
  if (typeof IS_WORKER === 'undefined' && typeof IS_DOCKER === 'undefined' && typeof IS_PROCESS_SERVER === 'undefined' && _ds.viewSourceProp === 'globals') {
2661
2691
  if (!['main'].includes(_session.opt.app_computing_mode)) {
2662
2692
  await func.index.call_worker(SESSION_ID, {
@@ -2666,10 +2696,13 @@ func.datasource.execute = async function (SESSION_ID, dataSourceSession, IS_DATA
2666
2696
  }
2667
2697
  }
2668
2698
 
2669
- if (await func.datasource.get_view_events_count(SESSION_ID, dataSourceSession, 'on_load')) {
2670
- await func.datasource.execute_view_events(SESSION_ID, dataSourceSession, 'on_load');
2699
+ if (args.is_panelP) {
2700
+ const callback_ret = await func.datasource.callback(SESSION_ID, dataSourceSession, args.rowIdP, args.jobNoP, _ds.prog_id);
2701
+ schedule_panel_on_load_events();
2702
+ return callback_ret;
2671
2703
  }
2672
- // }
2704
+
2705
+ await run_on_load_events();
2673
2706
  return await func.datasource.callback(SESSION_ID, dataSourceSession, args.rowIdP, args.jobNoP, _ds.prog_id);
2674
2707
  };
2675
2708
 
@@ -4207,6 +4240,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
4207
4240
  dsSession_changed: findMin(datasource_changed),
4208
4241
  avoid_xu_for_refresh,
4209
4242
  trigger,
4243
+ ignore_screen_blocker: true,
4210
4244
  });
4211
4245
  // await removed from the below function cause to dead lock Mar 3 25
4212
4246
  await func.runtime.ui.refresh_screen({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.2437",
3
+ "version": "1.3.2439",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {