@xuda.io/runtime-bundle 1.0.353 → 1.0.354

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.
@@ -28149,19 +28149,12 @@ func.UI.worker.find_job_index = function (SESSION_ID, jobNoP) {
28149
28149
  };
28150
28150
 
28151
28151
  func.UI.ds_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
28152
- // return;
28153
28152
  let _session = SESSION_OBJ[SESSION_ID];
28154
28153
 
28155
28154
  const _data_system = _session?.DS_GLB?.[0]?.data_system;
28156
28155
  if (_data_system?.SYS_GLOBAL_BOL_AJAX_BUSY) return;
28157
28156
  if (!_data_system?.SYS_GLOBAL_BOL_IDLE) return;
28158
28157
 
28159
- // for (const [key, val] of Object.entries(_data_system?.SYS_GLOBAL_OBJ_REFS || {})) {
28160
- // if (!$(`[xu-ui-id='${val?.$el.attr('xu-ui-id')}'`)?.length) {
28161
- // delete _data_system.SYS_GLOBAL_OBJ_REFS[key];
28162
- // }
28163
- // }
28164
-
28165
28158
  let abort;
28166
28159
 
28167
28160
  for (const [dsP, _ds] of Object.entries(_session.DS_GLB)) {
@@ -28208,7 +28201,7 @@ func.UI.ds_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0
28208
28201
  func.datasource.del(SESSION_ID, val);
28209
28202
  }
28210
28203
  };
28211
- func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0], re_check) {
28204
+ func.UI.refs_garbage_collector = function (SESSION_ID = Object.keys(SESSION_OBJ)[0]) {
28212
28205
  let _session = SESSION_OBJ[SESSION_ID];
28213
28206
  const _data_system = _session?.DS_GLB?.[0]?.data_system;
28214
28207
 
@@ -31947,16 +31940,19 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31947
31940
 
31948
31941
  const common_fx = {
31949
31942
  'xu-ref': async function ($elm, val) {
31950
- // console.log('xu-ref', $elm, val);
31951
31943
  const _session = SESSION_OBJ[SESSION_ID];
31952
31944
  let _ds_0 = _session.DS_GLB[0];
31953
- // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
31954
- // _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
31955
- // }
31956
- // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val]) {
31945
+
31957
31946
  const _ds = _session.DS_GLB[paramsP.dsSessionP];
31958
- _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data: _ds?.data_feed?.rows || {}, props: $elm?.data()?.xuData?.properties };
31959
- // }
31947
+
31948
+ const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
31949
+ const data = _ds?.data_feed?.rows?.[row_idx] || {};
31950
+
31951
+ const props = _ds.in_parameters || {};
31952
+ const attributes = $elm?.data()?.xuData?.properties || {};
31953
+
31954
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val.value] = { $el: $elm, ds: _ds, data, attributes, props };
31955
+
31960
31956
  return {};
31961
31957
  },
31962
31958
  'xu-bind': async function ($elm, val) {
@@ -32289,14 +32285,12 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32289
32285
  if (!custom_iterator_key) {
32290
32286
  is_key_dynamic_field = true;
32291
32287
 
32292
- // iterator_key = $elm.data().xuData.node_org.id.replaceAll("-", "_") + "_FOR_KEY";
32293
32288
  iterator_key = '_FOR_KEY';
32294
32289
  }
32295
32290
 
32296
32291
  if (!custom_iterator_val) {
32297
32292
  is_val_dynamic_field = true;
32298
32293
 
32299
- // iterator_val = $elm.data().xuData.node_org.id.replaceAll("-", "_") + "_FOR_VAL";
32300
32294
  iterator_val = '_FOR_VAL';
32301
32295
  }
32302
32296
 
@@ -32343,13 +32337,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32343
32337
  };
32344
32338
  let _parent_info = _.cloneDeep(parent_infoP) || {};
32345
32339
  _parent_info.iterate_info = iterate_info;
32346
- // if (parent_infoP) {
32347
- // _parent_info = iterate_info;
32348
- // } else {
32349
- // _parent_info = {
32350
- // iterate_info,
32351
- // };
32352
- // }
32340
+
32353
32341
  const $divP = await func.UI.screen.render_ui_tree(
32354
32342
  SESSION_ID,
32355
32343
  $container,
@@ -32415,13 +32403,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32415
32403
  },
32416
32404
  'xu-exp': async function ($elm, val) {
32417
32405
  let exp = val.value === null ? true : val.value;
32418
- // if (val.value.includes("@_FOR_KEY")) {
32419
- // exp = exp.replaceAll("@_FOR_KEY", "@" + $elm.data().xuData.iterate_info.iterator_key);
32420
- // }
32421
-
32422
- // if (val.value.includes("@_FOR_VAL")) {
32423
- // exp = exp.replaceAll("@_FOR_VAL", "@" + $elm.data().xuData.iterate_info.iterator_val);
32424
- // }
32425
32406
 
32426
32407
  let exp_ret = await func.expression.get(SESSION_ID, exp, paramsP.dsSessionP, 'UI Attr EXP', SESSION_OBJ[SESSION_ID].DS_GLB[paramsP.dsSessionP].currentRecordId);
32427
32408
 
@@ -32830,10 +32811,6 @@ func.UI.screen.set_attributes_new = async function (SESSION_ID, is_skeleton, $ro
32830
32811
  _ret = _.assignIn(_ret, ret);
32831
32812
  }
32832
32813
 
32833
- // if (nodeP.tagName === "svg") {
32834
- // console.log(svg_attributes_str);
32835
- // }
32836
-
32837
32814
  // EXP for
32838
32815
 
32839
32816
  for await (const [key, val] of Object.entries(nodeP.attributes)) {
@@ -32942,20 +32919,6 @@ func.UI.screen.panel_post_render_handler = async function (
32942
32919
  if ($old_panel_div?.length) {
32943
32920
  $($old_panel_div[0]).after($wrapper.children());
32944
32921
  } else {
32945
- // $container.append($wrapper.children());
32946
-
32947
- // find existing xurender
32948
- // $.each($wrapper.children(), function (key, val) {
32949
- // console.log(">", `[xu-ui-id=${$(val).attr("xu-ui-id")}]`);
32950
- // const $elm = $container.find(`[xu-ui-id=${$(val).attr("xu-ui-id")}]`);
32951
- // if (
32952
- // // $(val).data().xuData.key_path === cloned_$div.data().xuData.key_path
32953
- // $elm.length
32954
- // ) {
32955
- // $elm.remove();
32956
- // }
32957
- // $container.append($(val));
32958
- // });
32959
32922
  $.each($wrapper.children(), function (key, child) {
32960
32923
  $.each($container.children(), function (key, elm) {
32961
32924
  if ($(elm).data().xuData.elem_key === $(child).data().xuData.elem_key) {
@@ -33083,59 +33046,7 @@ func.UI.screen.create_container = function (SESSION_ID, $root_container, nodeP,
33083
33046
  },
33084
33047
  xuAttributes: {},
33085
33048
  });
33086
- // }
33087
-
33088
- // $div.appendTo($appendTo);
33089
33049
 
33090
- ////////////////////////
33091
-
33092
- // let svg_attributes_str = ""
33093
- // if (div_typeP === "svg") {
33094
- // for (const [key, val] of Object.entries(nodeP.attributes)) {
33095
- // svg_attributes_str += `${key}="${val}" `
33096
- // }
33097
- // }
33098
-
33099
- // var $div =
33100
- // // $(`<${div} ${attr_str ? attr_str : ""} ${svg_attributes_str}>`)
33101
- // $(`<${div} ${attr_str ? attr_str : ""}>`)
33102
- // .attr("xu-ui-id", ui_id)
33103
- // .data({
33104
- // xuData: {
33105
- // prog_id: _paramsP.prog_id,
33106
- // nodeid: nodeP.id,
33107
- // ui_type: nodeP.tagName,
33108
- // xu_id: xu_id,
33109
- // recordid: currentRecordId,
33110
- // paramsP: _paramsP,
33111
- // key: keyP,
33112
- // key_path, //:($container?.data()?.xuData?.key || "0") + "-" + (keyP || "0"),
33113
- // screenId: _paramsP.screenId,
33114
- // parent_container: $container?.attr("id"),
33115
- // elem_key,
33116
- // ui_id,
33117
- // properties: prop,
33118
- // node: nodeP,
33119
- // node_org: _.cloneDeep(nodeP),
33120
- // is_panelP: _paramsP.is_panelP,
33121
-
33122
- // elem_prop: elem_propP,
33123
- // debug_info: {
33124
- // id: nodeP.id,
33125
- // parent_id: $container?.data()?.xuData?.ui_id,
33126
- // items: items,
33127
- // },
33128
- // parent_node: parent_nodeP,
33129
- // currentRecordId: currentRecordId,
33130
- // $root_container: $root_container,
33131
- // parent_element_ui_id: $container?.data()?.xuData?.ui_id,
33132
- // },
33133
- // xuAttributes: {},
33134
- // })
33135
-
33136
- // if (div_typeP === "svg") {
33137
- // $div.removeAttr("xu-ui-id")
33138
- // }
33139
33050
  if (div_typeP !== 'svg') {
33140
33051
  $div.appendTo($appendTo);
33141
33052
  }
@@ -33698,20 +33609,8 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
33698
33609
  await func.UI.component.create_app_page_component(SESSION_ID, paramsP.dsSessionP);
33699
33610
  const page = new UI_FRAMEWORK_PLUGIN.page();
33700
33611
  await set_call_screen_properties_values(page);
33701
- await page.create(
33702
- params,
33703
- // SESSION_ID,
33704
- // paramsP.dsSessionP,
33705
- // nav,
33706
- // $nav.data().xuData.nav_params[paramsP.dsSessionP]
33707
- );
33708
- await page.init(
33709
- params,
33710
- // SESSION_ID,
33711
- // paramsP.dsSessionP,
33712
- // nav,
33713
- // $nav.data().xuData.nav_params[paramsP.dsSessionP]
33714
- );
33612
+ await page.create(params);
33613
+ await page.init(params);
33715
33614
  nav.push(component_name, { params });
33716
33615
  } else {
33717
33616
  debugger;
@@ -33947,20 +33846,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
33947
33846
  } catch (err) {
33948
33847
  func.utils.debug_report(SESSION_ID, `${plugin_name} widget`, err.message, 'E');
33949
33848
  }
33950
-
33951
- // glb.lifecycle.plugins[plugin_name] = {
33952
- // plugin_script: fx,
33953
- // setup_data: plugin_setup_ret.data,
33954
- // fields,
33955
- // params,
33956
- // };
33957
-
33958
- // await glb.lifecycle.execute(SESSION_ID, "initialized");
33959
- // await glb.lifecycle.execute(SESSION_ID, method);
33960
-
33961
- // } catch (err) {
33962
- // report_error(err);
33963
- // }
33964
33849
  }
33965
33850
  return $div;
33966
33851
  },
@@ -34004,107 +33889,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34004
33889
  $container.data().xuAttributes[key] = _.cloneDeep(val);
34005
33890
  });
34006
33891
 
34007
- // var $div_content = $div.children();
34008
-
34009
- // $.each($div_content, function (key, val) {
34010
- // $(val).data().xuData.parent_container =
34011
- // $div.data().xuData.parent_container;
34012
- // });
34013
-
34014
33892
  return await render_screen_type($div);
34015
-
34016
- // if (paramsP.is_mobile_modal) {
34017
- // return await open_modal($div);
34018
- // }
34019
- // if (paramsP.is_mobile_popover) {
34020
- // open_popover($div);
34021
- // func.UI.utils.screen_blocker(
34022
- // false,
34023
- // paramsP.prog_id + "_" + paramsP.sourceScreenP
34024
- // );
34025
- // return;
34026
- // }
34027
-
34028
- // if (paramsP.is_mobile_page) {
34029
- // const $nav = $(SESSION_OBJ[SESSION_ID].root_element).find("xu-nav");
34030
- // const nav = $nav[0];
34031
-
34032
- // var params = {
34033
- // div: $div_content,
34034
- // name: paramsP.screenInfo.properties?.menuTitle,
34035
- // screenId: paramsP.screenId,
34036
- // $container: $container,
34037
- // // icon: $div.data().xuData.paramsP.screenInfo.rICN,
34038
- // dsSession: paramsP.dsSessionP,
34039
- // };
34040
- // var component_name = "xu-page-component-" + paramsP.dsSessionP;
34041
- // if (!$(nav).data().xuData.nav_params) {
34042
- // $(nav).data().xuData.nav_params = {};
34043
- // }
34044
-
34045
- // //restore validate
34046
- // if ($(nav)?.data()?.xuData?.params?.[paramsP.dsSessionP]) {
34047
- // params.$container.data().xuData.validate_screen_ready = $(nav)
34048
- // .data()
34049
- // .xuData.params[
34050
- // paramsP.dsSessionP
34051
- // ].$container.data().xuData.validate_screen_ready;
34052
- // }
34053
-
34054
- // if (!$(nav)?.data()?.xuData) return;
34055
- // $(nav).data().xuData.nav_params[paramsP.dsSessionP] = params;
34056
- // if (!$(component_name).length) {
34057
- // await func.UI.component.create_app_page_component(
34058
- // SESSION_ID,
34059
- // paramsP.dsSessionP
34060
- // );
34061
- // const page = new UI_FRAMEWORK_PLUGIN.page();
34062
- // await page.create(
34063
- // SESSION_ID,
34064
- // paramsP.dsSessionP,
34065
- // nav,
34066
- // $nav.data().xuData.nav_params[paramsP.dsSessionP]
34067
- // );
34068
- // await page.init(
34069
- // SESSION_ID,
34070
- // paramsP.dsSessionP,
34071
- // nav,
34072
- // $nav.data().xuData.nav_params[paramsP.dsSessionP]
34073
- // );
34074
- // nav.push(component_name, { params });
34075
- // } else {
34076
- // debugger;
34077
- // $(component_name).empty();
34078
-
34079
- // await UI_FRAMEWORK_PLUGIN.page(SESSION_ID, paramsP.dsSessionP);
34080
- // }
34081
- // $div.data().xuData.paramsP = $container.data().xuData.paramsP;
34082
-
34083
- // return $div;
34084
- // }
34085
-
34086
- // if (
34087
- // !paramsP.is_mobile_page &&
34088
- // !paramsP.is_mobile_modal &&
34089
- // !paramsP.is_mobile_popover &&
34090
- // !paramsP.is_panelP
34091
- // ) {
34092
- // var $nav = $(SESSION_OBJ[SESSION_ID].root_element).find("xu-nav");
34093
- // if ($nav && $nav.length) {
34094
- // // refresh made
34095
- // } else {
34096
- // $nav = $("<xu-nav>");
34097
- // $container.append($nav);
34098
- // func.UI.component.init_xu_nav($container, $nav);
34099
- // }
34100
-
34101
- // $nav.data().xuData.$div = $div_content; // set data to nav to use in the component
34102
-
34103
- // await $nav[0].setRoot("xu-root-component-" + SESSION_ID);
34104
- // } else {
34105
- // $container.append($div_content);
34106
- // }
34107
- // return $container;
34108
33893
  },
34109
33894
  [`xu-multi-view`]: async function () {
34110
33895
  var $div = $container;
@@ -34140,41 +33925,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34140
33925
  return $div;
34141
33926
  };
34142
33927
  await func.UI.screen.set_attributes_new(SESSION_ID, is_skeleton, $root_container, nodeP, $container, paramsP, parent_infoP, jobNoP, keyP, parent_nodeP, $container, true);
34143
- // var $div_content = $div.children();
34144
-
34145
- // if (continuous_idx !== null || !prop.app_items_per_page) {
34146
- // $.each($div.data().xuData, function (key, val) {
34147
- // $container.data().xuData[key] = val;
34148
- // });
34149
- // $.each($div.data().xuAttributes, function (key, val) {
34150
- // $container.data().xuAttributes[key] = val;
34151
- // });
34152
-
34153
- // if (!$container.data().xuData.node) {
34154
- // $container.data().xuData.node = {};
34155
- // }
34156
-
34157
- // $container.data().xuData.node.children = [];
34158
-
34159
- // $.each($div_content, function (key, val) {
34160
- // if (!$(val)?.data()?.xuData) return;
34161
- // if (
34162
- // continuous_idx === null ||
34163
- // (continuous_idx && key > continuous_idx)
34164
- // ) {
34165
- // $(val).data().xuData.parent_container =
34166
- // $div.data().xuData.parent_container;
34167
- // $container
34168
- // .data()
34169
- // .xuData.node.children.push($(val).data().xuData.node);
34170
- // }
34171
- // });
34172
- // }
34173
33928
 
34174
- // if (continuous_idx !== null) {
34175
- // if (glb.CURRENT_APP_LOADING === 1) glb.CURRENT_APP_LOADING = 0; // re-activate loader
34176
- // return;
34177
- // }
34178
33929
  return await render_screen_type($div);
34179
33930
  };
34180
33931
 
@@ -34208,38 +33959,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34208
33959
  const ret = await func.UI.screen.render_ui_tree(SESSION_ID, $container, empty_result_node, parent_infoP, paramsP, jobNoP, null, 0, null, nodeP, null, $root_container);
34209
33960
  await func.events.validate(SESSION_ID, 'record_not_found', paramsP.dsSessionP);
34210
33961
  return await done(null);
34211
-
34212
- // var text = "";
34213
- // if (prop?.app_empty_result_text !== "undefined") {
34214
- // text = prop.app_empty_result_text;
34215
- // }
34216
- // if (
34217
- // prop.app_empty_result_text_EXP &&
34218
- // prop.app_empty_result_text_EXP !== "undefined"
34219
- // ) {
34220
- // let exp = prop.app_empty_result_text_EXP;
34221
- // if (exp && exp !== "undefined") {
34222
- // var res = func.expression.get(
34223
- // SESSION_ID,
34224
- // exp,
34225
- // paramsP.dsSessionP,
34226
- // "app_empty_result_text_EXP",
34227
- // _ds.currentRecordId
34228
- // );
34229
- // text = res.result;
34230
- // }
34231
- // }
34232
- // if (icon || text) {
34233
- // $container.append(
34234
- // `<div style="width: 100%;" >${img}<h6 style="text-align: center;">${text}</h6></div>`
34235
- // );
34236
- // }
34237
- // await func.events.validate(
34238
- // SESSION_ID,
34239
- // "record_not_found",
34240
- // paramsP.dsSessionP
34241
- // );
34242
- // return await done(null);
34243
33962
  };
34244
33963
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[paramsP.dsSessionP];
34245
33964
 
@@ -34252,25 +33971,7 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34252
33971
  var i = 0;
34253
33972
  for await (const [key, val] of Object.entries(_ds.data_feed.rows)) {
34254
33973
  var node = JSON.parse(JSON.stringify(nodeP));
34255
- // TO FIX
34256
- // if (
34257
- // continuous_idx === null &&
34258
- // prop.app_items_per_page &&
34259
- // i >= Number(prop.app_items_per_page)
34260
- // ) {
34261
- // continuous_idx = i;
34262
- // await done(null);
34263
-
34264
- // setTimeout(async function () {
34265
- // await run_item(continuous_idx);
34266
- // if (!glb.CURRENT_APP_LOADING) {
34267
- // glb.CURRENT_APP_LOADING = 1;
34268
- // } // deactivate loader
34269
- // }, 1000);
34270
-
34271
- // continue;
34272
- // }
34273
- ////////
33974
+
34274
33975
  _ds.currentRecordId = val._ROWID;
34275
33976
  const ret = await iterate_child($div, node, { continuous_idx }, null, $root_container);
34276
33977
 
@@ -34322,46 +34023,6 @@ func.UI.screen.render_ui_tree = async function (SESSION_ID, $container, nodeP, p
34322
34023
  };
34323
34024
  if (!element || element === 'script') return await done();
34324
34025
  let str = '';
34325
- // var $div
34326
- // const draw_svg = function () {
34327
- // const get_tag_str = function (element, prop, val) {
34328
- // let class_str = "";
34329
- // let attr_str = "";
34330
- // for (const [key, val] of Object.entries(prop)) {
34331
- // if (key.substr(0, 2) !== "xu") {
34332
- // attr_str += ` ${key}="${val}" `;
34333
- // }
34334
- // }
34335
- // if (element === "svg") {
34336
- // return `<${element} ${attr_str} > `;
34337
- // }
34338
- // let ret = "";
34339
- // if (val?.children?.length) {
34340
- // ret = iterate_svg(val);
34341
- // }
34342
-
34343
- // return `<${element} ${class_str} ${attr_str} > ${ret} </${element}>`;
34344
- // };
34345
- // let svg_str = get_tag_str(element, prop);
34346
- // let inner_str = "";
34347
- // const iterate_svg = function (node) {
34348
- // let ret = "";
34349
- // if (node.children) {
34350
- // for (let val of node.children) {
34351
- // let prop = val.attributes;
34352
- // ret += get_tag_str(val.tagName, prop, val);
34353
- // }
34354
- // }
34355
- // return ret;
34356
- // };
34357
- // inner_str = iterate_svg(nodeP);
34358
-
34359
- // $div = $(svg_str + inner_str + "</svg>").appendTo($container);
34360
- // };
34361
- // if (element === "svg") {
34362
- // draw_svg();
34363
- // // return await done();
34364
- // }
34365
34026
 
34366
34027
  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);
34367
34028