@xuda.io/runtime-bundle 1.0.339 → 1.0.341

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.
@@ -28805,6 +28805,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
28805
28805
  _ds.data_system['SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO'] = _session.SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO;
28806
28806
 
28807
28807
  _ds.data_system['SYS_GLOBAL_OBJ_CLIENT_INFO'] = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
28808
+ _ds.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
28808
28809
  };
28809
28810
  if (!SESSION_OBJ[SESSION_ID].DS_GLB) return;
28810
28811
 
@@ -30388,8 +30389,9 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
30388
30389
  continue;
30389
30390
  }
30390
30391
 
30391
- try {
30392
- const row_idx = func.common.find_ROWID_idx(_ds, record_id);
30392
+ // try {
30393
+ const row_idx = func.common.find_ROWID_idx(_ds, record_id);
30394
+ if (_ds.data_feed.rows[row_idx][field_id] !== value) {
30393
30395
  _ds.data_feed.rows[row_idx][field_id] = value;
30394
30396
  await set_fieldComputed_dependencies(dataSource, field_id, null);
30395
30397
 
@@ -30423,21 +30425,23 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
30423
30425
  }
30424
30426
  }
30425
30427
  }
30426
- } catch (err) {
30427
- console.error(err);
30428
- }
30429
30428
 
30430
- if (!fields_changed.includes(field_id)) {
30431
- fields_changed.push(field_id);
30432
- }
30433
- if (!datasource_changed.includes(dataSource)) {
30434
- datasource_changed.push(dataSource);
30435
- }
30429
+ // } catch (err) {
30430
+ // console.error(err);
30431
+ // }
30436
30432
 
30437
- if (!_ds.data_feed.rows_changed) {
30438
- _ds.data_feed.rows_changed = [];
30433
+ if (!fields_changed.includes(field_id)) {
30434
+ fields_changed.push(field_id);
30435
+ }
30436
+ if (!datasource_changed.includes(dataSource)) {
30437
+ datasource_changed.push(dataSource);
30438
+ }
30439
+
30440
+ if (!_ds.data_feed.rows_changed) {
30441
+ _ds.data_feed.rows_changed = [];
30442
+ }
30443
+ if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
30439
30444
  }
30440
- if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
30441
30445
  } else if (fields_data === 'set') {
30442
30446
  _ds.currentRecordId = record_id;
30443
30447
  }
@@ -31888,34 +31892,6 @@ func.UI.screen.refresh_screen = async function (SESSION_ID, fields_changed_arr,
31888
31892
  return found;
31889
31893
  };
31890
31894
 
31891
- // // set panels_obj
31892
- // for await (const [elem_key, elem_val] of Object.entries($elm)) {
31893
- // if (elem_key === "length") break;
31894
- // var $div = $(elem_val);
31895
- // let xuData = $div.data().xuData;
31896
-
31897
- // if (!$div.data().xuPanelData) continue;
31898
-
31899
- // let dsSession = xuData.paramsP.dsSessionP;
31900
- // var _session = SESSION_OBJ[SESSION_ID];
31901
- // let _ds = _session?.DS_GLB[dsSession];
31902
- // if (!_ds) continue;
31903
-
31904
- // if (_ds.tree_obj.disableAutoRefresh) {
31905
- // continue;
31906
- // }
31907
-
31908
- // const parent_element_ui_id = $div.data().xuPanelData.parent_element_ui_id;
31909
- // if (!panels_obj[parent_element_ui_id]) {
31910
- // panels_obj[parent_element_ui_id] = {
31911
- // _ds,
31912
- // $div,
31913
- // ids: [],
31914
- // };
31915
- // }
31916
- // panels_obj[parent_element_ui_id].ids.push($div.attr("xu-ui-id"));
31917
- // }
31918
-
31919
31895
  for await (const [parent_element_ui_id, panel_val] of Object.entries(panels_obj)) {
31920
31896
  const prog_doc = await func.utils.DOCS_OBJ.get(SESSION_ID, panel_val._ds.prog_id);
31921
31897
  const progDataSource_str = JSON.stringify(prog_doc.progDataSource);
@@ -32247,6 +32223,14 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
32247
32223
 
32248
32224
  const common_fx = {
32249
32225
  'xu-ref': async function ($elm, val) {
32226
+ console.log('xu-ref', $elm, val);
32227
+ let _ds_0 = _session.DS_GLB[0];
32228
+ if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
32229
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
32230
+ }
32231
+ // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val]) {
32232
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val] = { $el: $elm };
32233
+ // }
32250
32234
  return {};
32251
32235
  },
32252
32236
  'xu-bind': async function ($elm, val) {