@xuda.io/runtime-bundle 1.0.672 → 1.0.674

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.
@@ -12395,7 +12395,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12395
12395
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
12396
12396
 
12397
12397
  // update array for checkbox that not in xu-for
12398
- if (field_prop.props.fieldType === 'array' && ['checkbox', 'radio'].includes($elm.attr('type')) && val_is_reference_field) {
12398
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
12399
12399
  let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
12400
12400
  let value_from_getter = bind.getter($elm[0]);
12401
12401
  let value;
@@ -12417,6 +12417,29 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12417
12417
  return await func.datasource.update(SESSION_ID, datasource_changes);
12418
12418
  }
12419
12419
 
12420
+ // update array for checkbox that not in xu-for
12421
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'radio' && val_is_reference_field) {
12422
+ let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
12423
+ let value_from_getter = bind.getter($elm[0]);
12424
+ // let value;
12425
+ // if (arr_value_before_cast.includes(value_from_getter)) {
12426
+ // value = arr_value_before_cast.filter((item) => !_.isEqual(item, value_from_getter));
12427
+ // } else {
12428
+ // arr_value_before_cast.push(value_from_getter);
12429
+ // value = arr_value_before_cast;
12430
+ // }
12431
+
12432
+ let datasource_changes = {
12433
+ [_dsP]: {
12434
+ [_ds.currentRecordId]: {
12435
+ [bind_field_id]: [value_from_getter],
12436
+ },
12437
+ },
12438
+ };
12439
+
12440
+ return await func.datasource.update(SESSION_ID, datasource_changes);
12441
+ }
12442
+
12420
12443
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
12421
12444
 
12422
12445
  if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
@@ -12482,13 +12505,21 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12482
12505
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
12483
12506
  value = _ds.data_feed.rows?.[row_idx]?.[val.value];
12484
12507
  }
12485
- if (field_prop.props.fieldType === 'array' && ['checkbox', 'radio'].includes($elm.attr('type')) && $elm.attr('value')) {
12508
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
12486
12509
  if (value.includes($elm.attr('value'))) {
12487
12510
  value = true;
12488
12511
  } else {
12489
12512
  value = false;
12490
12513
  }
12491
12514
  }
12515
+
12516
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'radio' && $elm.attr('value')) {
12517
+ if (value.includes($elm.attr('value'))) {
12518
+ value = $elm.attr('value');
12519
+ } else {
12520
+ value = false;
12521
+ }
12522
+ }
12492
12523
  } else {
12493
12524
  value = val.value;
12494
12525
  }
@@ -10117,7 +10117,7 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10117
10117
  var _ds = SESSION_OBJ[SESSION_ID].DS_GLB[_dsP];
10118
10118
 
10119
10119
  // update array for checkbox that not in xu-for
10120
- if (field_prop.props.fieldType === 'array' && ['checkbox', 'radio'].includes($elm.attr('type')) && val_is_reference_field) {
10120
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && val_is_reference_field) {
10121
10121
  let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
10122
10122
  let value_from_getter = bind.getter($elm[0]);
10123
10123
  let value;
@@ -10139,6 +10139,29 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10139
10139
  return await func.datasource.update(SESSION_ID, datasource_changes);
10140
10140
  }
10141
10141
 
10142
+ // update array for checkbox that not in xu-for
10143
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'radio' && val_is_reference_field) {
10144
+ let arr_value_before_cast = _.clone((await func.datasource.get_value(SESSION_ID, bind_field_id, _dsP, _ds.currentRecordId)).ret.value);
10145
+ let value_from_getter = bind.getter($elm[0]);
10146
+ // let value;
10147
+ // if (arr_value_before_cast.includes(value_from_getter)) {
10148
+ // value = arr_value_before_cast.filter((item) => !_.isEqual(item, value_from_getter));
10149
+ // } else {
10150
+ // arr_value_before_cast.push(value_from_getter);
10151
+ // value = arr_value_before_cast;
10152
+ // }
10153
+
10154
+ let datasource_changes = {
10155
+ [_dsP]: {
10156
+ [_ds.currentRecordId]: {
10157
+ [bind_field_id]: [value_from_getter],
10158
+ },
10159
+ },
10160
+ };
10161
+
10162
+ return await func.datasource.update(SESSION_ID, datasource_changes);
10163
+ }
10164
+
10142
10165
  var value = await func.common.get_cast_val(SESSION_ID, 'xu-bind', 'value', field_prop.props.fieldType, bind.getter($elm[0]));
10143
10166
 
10144
10167
  if (field_prop.props.fieldType === 'object' && !val_is_reference_field) {
@@ -10204,13 +10227,21 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10204
10227
  const row_idx = func.common.find_ROWID_idx(_ds, _ds.currentRecordId);
10205
10228
  value = _ds.data_feed.rows?.[row_idx]?.[val.value];
10206
10229
  }
10207
- if (field_prop.props.fieldType === 'array' && ['checkbox', 'radio'].includes($elm.attr('type')) && $elm.attr('value')) {
10230
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'checkbox' && $elm.attr('value')) {
10208
10231
  if (value.includes($elm.attr('value'))) {
10209
10232
  value = true;
10210
10233
  } else {
10211
10234
  value = false;
10212
10235
  }
10213
10236
  }
10237
+
10238
+ if (field_prop.props.fieldType === 'array' && $elm.attr('type') === 'radio' && $elm.attr('value')) {
10239
+ if (value.includes($elm.attr('value'))) {
10240
+ value = $elm.attr('value');
10241
+ } else {
10242
+ value = false;
10243
+ }
10244
+ }
10214
10245
  } else {
10215
10246
  value = val.value;
10216
10247
  }