@xuda.io/runtime-bundle 1.0.973 → 1.0.975

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.
@@ -27675,29 +27675,31 @@ func.UI.worker.add_to_queue = async function (SESSION_ID, source, functionP, par
27675
27675
  return;
27676
27676
  }
27677
27677
  }
27678
- calling_job = false;
27679
- if (calling_job) {
27680
- var job_index = func.UI.worker.find_job_index(SESSION_ID, calling_job);
27681
27678
 
27682
- if (job_index === null || typeof job_index === 'undefined') return;
27679
+ // if (calling_job) {
27680
+ // var job_index = func.UI.worker.find_job_index(SESSION_ID, calling_job);
27683
27681
 
27684
- try {
27685
- if (!UI_WORKER_OBJ.jobs[job_index].splice_count) {
27686
- UI_WORKER_OBJ.jobs[job_index].splice_count = 0;
27687
- }
27688
- UI_WORKER_OBJ.jobs[job_index].splice_count++;
27689
- UI_WORKER_OBJ.jobs.splice(job_index + UI_WORKER_OBJ.jobs[job_index].splice_count, 0, obj);
27690
- // }
27691
- } catch (e) {
27692
- console.error('bug');
27693
- // UI_WORKER_OBJ.jobs.splice(0, 0, obj);
27694
- }
27695
- } else {
27696
- // check case of xu-render if queue has child node of the element then delete job
27697
- // check case of execute attributes that queue not contain the element then add to parallel queue
27682
+ // if (job_index === null || typeof job_index === 'undefined') return;
27698
27683
 
27699
- UI_WORKER_OBJ.jobs.push(obj);
27700
- }
27684
+ // try {
27685
+ // if (!UI_WORKER_OBJ.jobs[job_index].splice_count) {
27686
+ // UI_WORKER_OBJ.jobs[job_index].splice_count = 0;
27687
+ // }
27688
+ // UI_WORKER_OBJ.jobs[job_index].splice_count++;
27689
+ // UI_WORKER_OBJ.jobs.splice(job_index + UI_WORKER_OBJ.jobs[job_index].splice_count, 0, obj);
27690
+ // // }
27691
+ // } catch (e) {
27692
+ // console.error('bug');
27693
+ // // UI_WORKER_OBJ.jobs.splice(0, 0, obj);
27694
+ // }
27695
+ // } else {
27696
+ // // check case of xu-render if queue has child node of the element then delete job
27697
+ // // check case of execute attributes that queue not contain the element then add to parallel queue
27698
+
27699
+ // UI_WORKER_OBJ.jobs.push(obj);
27700
+ // }
27701
+
27702
+ UI_WORKER_OBJ.jobs.push(obj);
27701
27703
 
27702
27704
  UI_WORKER_OBJ.num++;
27703
27705
  return UI_WORKER_OBJ.num - 1;
@@ -31765,7 +31767,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31765
31767
  // };
31766
31768
  const program = val.value?.prog || val.value;
31767
31769
  var $wrapper = $('<div>');
31768
- var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
31770
+ var $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, nodeP.attributes, null, null, null, $wrapper, '');
31769
31771
  const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
31770
31772
  let ret_init = await func.UI.screen.init(SESSION_ID, program, paramsP.screenId, _ds, $div, null, _ds.currentRecordId, jobNoP, true, params_obj.params_res, 'alterXu_panel', undefined, undefined, params_obj.params_raw);
31771
31773
  ret = {
@@ -32135,6 +32137,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32135
32137
  let $xurender = $('<xurender>')
32136
32138
  // .attr('xu-ui-id', nodeP.id + '_' + $elm.data().xuData.recordid)
32137
32139
  .attr('xu-ui-id', $elm.attr('xu-ui-id'))
32140
+ .attr('hidden', true)
32138
32141
  .appendTo($container)
32139
32142
  .hide();
32140
32143
  let original_data_obj = {
@@ -33087,7 +33090,7 @@ func.UI.screen.panel_post_render_handler = async function (
33087
33090
  return jobNoP;
33088
33091
  };
33089
33092
 
33090
- func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
33093
+ func.UI.screen.create_container = async function (SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, classP, elem_propP, div_typeP, $appendToP, attr_str) {
33091
33094
  const _paramsP = _.cloneDeep(paramsP);
33092
33095
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
33093
33096
  var $appendTo = $container;
@@ -33158,7 +33161,24 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
33158
33161
  // $div = $(`<${div} ${attr_str ? attr_str : ""} ${svg_attributes_str}>`);
33159
33162
  // } else {
33160
33163
  // $div = $(`<${div} ${attr_str ? attr_str : ""}>`);
33161
- $div.attr('xu-ui-id', ui_id).data({
33164
+
33165
+ async function generateHash(str, algorithm = 'SHA-256') {
33166
+ // Encode the string as UTF-8
33167
+ const msgBuffer = new TextEncoder().encode(str);
33168
+
33169
+ // Hash the string
33170
+ const hashBuffer = await crypto.subtle.digest(algorithm, msgBuffer);
33171
+
33172
+ // Convert to hex string
33173
+ const hashArray = Array.from(new Uint8Array(hashBuffer));
33174
+ const hashHex = hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
33175
+
33176
+ return hashHex;
33177
+ }
33178
+
33179
+ const new_ui_id = await generateHash(ui_id);
33180
+
33181
+ $div.attr('xu-ui-id', new_ui_id).data({
33162
33182
  xuData: {
33163
33183
  prog_id: _paramsP.prog_id,
33164
33184
  nodeid: nodeP.id,
@@ -33175,7 +33195,7 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
33175
33195
  node: nodeP,
33176
33196
  node_org: _.cloneDeep(nodeP),
33177
33197
  is_panelP: _paramsP.is_panelP,
33178
- ui_id,
33198
+ ui_id: new_ui_id,
33179
33199
  elem_prop: elem_propP,
33180
33200
  debug_info: {
33181
33201
  id: nodeP.id,
@@ -33849,7 +33869,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
33849
33869
  var exist_elm_obj = get_element_info();
33850
33870
  var $div = exist_elm_obj.div;
33851
33871
  if (!exist_elm_obj.div) {
33852
- $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
33872
+ $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, 'widget_wrapper', null, null, null, null);
33853
33873
 
33854
33874
  //////////////////////////
33855
33875
 
@@ -34051,7 +34071,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34051
34071
 
34052
34072
  if (!exist_elm_obj.div) {
34053
34073
  var $wrapper = $('<div>');
34054
- $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
34074
+ $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
34055
34075
 
34056
34076
  if (!$div) return;
34057
34077
 
@@ -34191,7 +34211,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34191
34211
  };
34192
34212
 
34193
34213
  var $wrapper = $('<div>');
34194
- $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
34214
+ $div = await func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
34195
34215
 
34196
34216
  let ret = await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $div.clone(true), true, undefined, refreshed_ds);
34197
34217
  if (ret.abort) {
@@ -34221,7 +34241,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34221
34241
  if (!element || element === 'script') return await done();
34222
34242
  let str = '';
34223
34243
 
34224
- var $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, element, null, str);
34244
+ var $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, str);
34225
34245
 
34226
34246
  $div.hover(
34227
34247
  function (e) {