@xuda.io/runtime-bundle 1.0.974 → 1.0.976

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.
@@ -31390,7 +31390,7 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31390
31390
  if (attr === 'xu-exp:xu-for' || attr === 'xu-for') {
31391
31391
  if (val?.includes(field_id)) {
31392
31392
  const parent_element_ui_id = node_id;
31393
-
31393
+ debugger;
31394
31394
  let _$elem = $(`[xu-ui-id^=${parent_element_ui_id}]`);
31395
31395
 
31396
31396
  const _elem_key = parent_element_ui_id;
@@ -31767,7 +31767,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31767
31767
  // };
31768
31768
  const program = val.value?.prog || val.value;
31769
31769
  var $wrapper = $('<div>');
31770
- 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, '');
31771
31771
  const params_obj = await get_params_obj_new(SESSION_ID, program, nodeP, paramsP.dsSessionP);
31772
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);
31773
31773
  ret = {
@@ -33090,7 +33090,7 @@ func.UI.screen.panel_post_render_handler = async function (
33090
33090
  return jobNoP;
33091
33091
  };
33092
33092
 
33093
- 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) {
33094
33094
  const _paramsP = _.cloneDeep(paramsP);
33095
33095
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_paramsP.dsSessionP];
33096
33096
  var $appendTo = $container;
@@ -33161,7 +33161,29 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
33161
33161
  // $div = $(`<${div} ${attr_str ? attr_str : ""} ${svg_attributes_str}>`);
33162
33162
  // } else {
33163
33163
  // $div = $(`<${div} ${attr_str ? attr_str : ""}>`);
33164
- $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
+ function hash32hex(str) {
33180
+ return (hash32(str) >>> 0).toString(16).padStart(8, '0');
33181
+ }
33182
+
33183
+ // const new_ui_id = await generateHash(ui_id);
33184
+ const new_ui_id = hash32hex(ui_id);
33185
+
33186
+ $div.attr('xu-ui-id', new_ui_id).data({
33165
33187
  xuData: {
33166
33188
  prog_id: _paramsP.prog_id,
33167
33189
  nodeid: nodeP.id,
@@ -33178,7 +33200,7 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
33178
33200
  node: nodeP,
33179
33201
  node_org: _.cloneDeep(nodeP),
33180
33202
  is_panelP: _paramsP.is_panelP,
33181
- ui_id,
33203
+ ui_id: new_ui_id,
33182
33204
  elem_prop: elem_propP,
33183
33205
  debug_info: {
33184
33206
  id: nodeP.id,
@@ -33852,7 +33874,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
33852
33874
  var exist_elm_obj = get_element_info();
33853
33875
  var $div = exist_elm_obj.div;
33854
33876
  if (!exist_elm_obj.div) {
33855
- $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);
33877
+ $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);
33856
33878
 
33857
33879
  //////////////////////////
33858
33880
 
@@ -34054,7 +34076,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34054
34076
 
34055
34077
  if (!exist_elm_obj.div) {
34056
34078
  var $wrapper = $('<div>');
34057
- $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, 'div', $wrapper, '');
34079
+ $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, '');
34058
34080
 
34059
34081
  if (!$div) return;
34060
34082
 
@@ -34194,7 +34216,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34194
34216
  };
34195
34217
 
34196
34218
  var $wrapper = $('<div>');
34197
- $div = func.UI.screen.create_container(SESSION_ID, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, prop, null, null, null, $wrapper, '');
34219
+ $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, '');
34198
34220
 
34199
34221
  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);
34200
34222
  if (ret.abort) {
@@ -34224,7 +34246,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34224
34246
  if (!element || element === 'script') return await done();
34225
34247
  let str = '';
34226
34248
 
34227
- 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);
34249
+ 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);
34228
34250
 
34229
34251
  $div.hover(
34230
34252
  function (e) {