@xuda.io/runtime-bundle 1.0.673 → 1.0.675

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,23 +27807,17 @@ 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 = func.UI.utils.find_in_element_data(
27811
- // "xuData",
27812
- // $(SESSION_OBJ[SESSION_ID].root_element),
27813
- // "xu_id",
27814
- // queue_obj.paramsP.elem_key
27815
- // );
27816
-
27817
27810
  var $elm = queue_obj?.paramsP?.elem_val?.$elm; // $(SESSION_OBJ[SESSION_ID].root_element).find(`[xu-ui-id=${queue_obj.paramsP.elem_key}]`)
27818
27811
 
27819
27812
  if (!$elm?.length) {
27820
- // return func.events.delete_job(SESSION_ID, queue_obj.jobNoP);
27821
27813
  return func.UI.worker.delete_job(SESSION_ID, queue_obj.job_num);
27822
27814
  }
27823
27815
 
27824
27816
  // $elm.empty();
27825
27817
 
27826
27818
  $.each($elm.children(), (key, val) => {
27819
+ if (!$(val)?.data()?.xuData) return true;
27820
+
27827
27821
  if ($(val).data().xuData.nodeid === queue_obj?.paramsP?.xu_for_item_id) {
27828
27822
  $(val).remove();
27829
27823
  }
@@ -32076,7 +32070,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32076
32070
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
32077
32071
 
32078
32072
  // update array for checkbox that not in xu-for
32079
- if (field_prop.props.fieldType === 'array' && ($elm.attr('type') === 'checkbox' || $elm.attr('type') === 'radio') && val_is_reference_field) {
32073
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
32080
32074
  let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
32081
32075
  let value_from_getter = bind.getter($elm[0]);
32082
32076
  let value;
@@ -32098,6 +32092,29 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32098
32092
  return await func.datasource.update(SESSION_ID, datasource_changes);
32099
32093
  }
32100
32094
 
32095
+ // update array for checkbox that not in xu-for
32096
+ 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
+ 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
+
32107
+ let datasource_changes = {
32108
+ [_dsP]: {
32109
+ [_ds.currentRecordId]: {
32110
+ [bind_field_id]: [value_from_getter],
32111
+ },
32112
+ },
32113
+ };
32114
+
32115
+ return await func.datasource.update(SESSION_ID, datasource_changes);
32116
+ }
32117
+
32101
32118
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
32102
32119
 
32103
32120
  if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {