@xuda.io/runtime-bundle 1.0.657 → 1.0.659

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.
@@ -12385,6 +12385,27 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12385
12385
 
12386
12386
  const field_changed = async function (e) {
12387
12387
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
12388
+
12389
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
12390
+ let arr_value_before_cast = (await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value;
12391
+ let value_from_getter = bind.getter($elm[0]);
12392
+ let value;
12393
+ if (arr_value_before_cast.includes(value_from_getter)) {
12394
+ value = arr_value_before_cast.filter((item) => item !== value_from_getter);
12395
+ } else {
12396
+ }
12397
+
12398
+ let datasource_changes = {
12399
+ [_dsP]: {
12400
+ [_ds.currentRecordId]: {
12401
+ [bind_field_id]: value,
12402
+ },
12403
+ },
12404
+ };
12405
+ debugger;
12406
+ return await func.datasource.update(SESSION_ID, datasource_changes);
12407
+ }
12408
+
12388
12409
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
12389
12410
 
12390
12411
  if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
@@ -12450,7 +12471,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12450
12471
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12451
12472
  value = _ds.data_feed.rows?.[row_idx]?.[val.value];
12452
12473
  }
12453
- if (_.isArray(value) && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
12474
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
12454
12475
  if (value.includes($elm.attr('value'))) {
12455
12476
  value = true;
12456
12477
  } else {
@@ -10107,6 +10107,27 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10107
10107
 
10108
10108
  const field_changed = async function (e) {
10109
10109
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
10110
+
10111
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
10112
+ let arr_value_before_cast = (await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value;
10113
+ let value_from_getter = bind.getter($elm[0]);
10114
+ let value;
10115
+ if (arr_value_before_cast.includes(value_from_getter)) {
10116
+ value = arr_value_before_cast.filter((item) => item !== value_from_getter);
10117
+ } else {
10118
+ }
10119
+
10120
+ let datasource_changes = {
10121
+ [_dsP]: {
10122
+ [_ds.currentRecordId]: {
10123
+ [bind_field_id]: value,
10124
+ },
10125
+ },
10126
+ };
10127
+ debugger;
10128
+ return await func.datasource.update(SESSION_ID, datasource_changes);
10129
+ }
10130
+
10110
10131
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
10111
10132
 
10112
10133
  if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
@@ -10172,7 +10193,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10172
10193
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
10173
10194
  value = _ds.data_feed.rows?.[row_idx]?.[val.value];
10174
10195
  }
10175
- if (_.isArray(value) && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
10196
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
10176
10197
  if (value.includes($elm.attr('value'))) {
10177
10198
  value = true;
10178
10199
  } else {