@xuda.io/runtime-bundle 1.0.675 → 1.0.677

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.
@@ -27807,39 +27807,27 @@ func.UI.worker.execute = async function (SESSION_ID, queue_obj) {
27807
27807
  return done();
27808
27808
  },
27809
27809
  execute_xu_for: async function () {
27810
- var $elm = queue_obj?.paramsP?.elem_val?.$elm; // $(SESSION_OBJ[SESSION_ID].root_element).find(`[xu-ui-id=${queue_obj.paramsP.elem_key}]`)
27810
+ try {
27811
+ var $elm = queue_obj?.paramsP?.elem_val?.$elm; // $(SESSION_OBJ[SESSION_ID].root_element).find(`[xu-ui-id=${queue_obj.paramsP.elem_key}]`)
27811
27812
 
27812
- if (!$elm?.length) {
27813
- return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
27814
- }
27813
+ if (!$elm?.length) {
27814
+ return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
27815
+ }
27815
27816
 
27816
- // $elm.empty();
27817
+ // $elm.empty();
27817
27818
 
27818
- $.each($elm.children(), (key, val) => {
27819
- if (!$(val)?.data()?.xuData) return true;
27819
+ $.each($elm.children(), (key, val) => {
27820
+ if (!$(val)?.data()?.xuData) return true;
27820
27821
 
27821
- if ($(val).data().xuData.nodeid === queue_obj?.paramsP?.xu_for_item_id) {
27822
- $(val).remove();
27823
- }
27824
- });
27825
-
27826
- let _data = queue_obj.paramsP.elem_val.$elm.data();
27827
- const node_to_render = _data.xuData.node_org.children?.find((e) => e.id === queue_obj?.paramsP?.xu_for_item_id);
27828
- func.UI.screen.render_ui_tree(
27829
- queue_obj.paramsP.SESSION_ID,
27830
- queue_obj.paramsP.elem_val.$elm,
27831
- node_to_render, //_data.xuData.node_org.children[0], //_data?.xuData?.node?.children?.length ? _data.xuData.node.children[0] : _data.xuData.node,
27832
- null,
27833
- _data.xuData.paramsP,
27834
- queue_obj.jobNoP,
27835
- null,
27836
- _data.xuData.key,
27837
- null,
27838
- _data.xuData.parent_node,
27839
- null,
27840
- _data.xuData.$root_container,
27841
- );
27822
+ if ($(val).data().xuData.nodeid === queue_obj?.paramsP?.xu_for_item_id) {
27823
+ $(val).remove();
27824
+ }
27825
+ });
27842
27826
 
27827
+ let _data = queue_obj.paramsP.elem_val.$elm.data();
27828
+ const node_to_render = _data.xuData.node_org.children?.find((e) => e.id === queue_obj?.paramsP?.xu_for_item_id);
27829
+ func.UI.screen.render_ui_tree(queue_obj.paramsP.SESSION_ID, queue_obj.paramsP.elem_val.$elm, node_to_render, null, _data.xuData.paramsP, queue_obj.jobNoP, null, _data.xuData.key, null, _data.xuData.parent_node, null, _data.xuData.$root_container);
27830
+ } catch (error) {}
27843
27831
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
27844
27832
  },
27845
27833
  };
@@ -31203,24 +31191,6 @@ func.UI.screen.refresh_xu_attributes = async function (SESSION_ID, fields_arr, j
31203
31191
  .filter(function () {
31204
31192
  // // look if the changed field include in the calling in parameters
31205
31193
  let parameter_in_filed_id;
31206
- // const _$callingContainer = $(this).data()?.xuData?.paramsP?.$callingContainerP;
31207
- // if (_$callingContainer) {
31208
- // const _source_xuAttributes = _$callingContainer.data()?.xuAttributes;
31209
- // if (_source_xuAttributes) {
31210
- // for (const [attr, value] of Object.entries(_source_xuAttributes)) {
31211
- // if (value && typeof value === 'string' && value.includes(val_field)) {
31212
- // const pattern = /xu-exp:(\w+)/;
31213
- // const match = attr.match(pattern);
31214
- // if (match) {
31215
- // parameter_in_filed_id = attr.split(':')[1];
31216
- // } else {
31217
- // parameter_in_filed_id = attr;
31218
- // }
31219
- // break;
31220
- // }
31221
- // }
31222
- // }
31223
- // }
31224
31194
 
31225
31195
  let attr = [];
31226
31196
 
@@ -31998,7 +31968,6 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
31998
31968
  'xu-bind': async function ($elm, val) {
31999
31969
  if (is_skeleton) return;
32000
31970
 
32001
- // let view_field_id = val.value;
32002
31971
  let val_is_reference_field = false;
32003
31972
 
32004
31973
  let _prog_id = $elm.data().xuData.paramsP.prog_id;
@@ -32092,17 +32061,9 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32092
32061
  return await func.datasource.update(SESSION_ID, datasource_changes);
32093
32062
  }
32094
32063
 
32095
- // update array for checkbox that not in xu-for
32064
+ // update array for radio that not in xu-for
32096
32065
  if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'radio' && val_is_reference_field) {
32097
- let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
32098
32066
  let value_from_getter = bind.getter($elm[0]);
32099
- // let value;
32100
- // if (arr_value_before_cast.includes(value_from_getter)) {
32101
- // value = arr_value_before_cast.filter((item) => !_.isEqual(item, value_from_getter));
32102
- // } else {
32103
- // arr_value_before_cast.push(value_from_getter);
32104
- // value = arr_value_before_cast;
32105
- // }
32106
32067
 
32107
32068
  let datasource_changes = {
32108
32069
  [_dsP]: {
@@ -32563,6 +32524,11 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32563
32524
  const trigger = val.key.split('xu-on:')[1].toLowerCase();
32564
32525
  $elm.on(trigger, async function (evt) {
32565
32526
  for await (const [key, val] of Object.entries($elm.data().xuAttributes['xu-on:' + evt.type])) {
32527
+ if (!_.isEmpty(val.props.condition)) {
32528
+ const expCond = await func.expression.get(SESSION_ID, val.props.condition, paramsP.dsSessionP, 'condition', paramsP.recordid); // execute expression
32529
+ if (!expCond.result) continue;
32530
+ }
32531
+
32566
32532
  if (val.event_modifiers && evt[val.event_modifiers]) {
32567
32533
  evt[val.event_modifiers]();
32568
32534
  }