@xuda.io/runtime-bundle 1.0.340 → 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.
@@ -3552,6 +3552,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
3552
3552
  _ds.data_system['SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO'] = _session.SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO;
3553
3553
 
3554
3554
  _ds.data_system['SYS_GLOBAL_OBJ_CLIENT_INFO'] = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
3555
+ _ds.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
3555
3556
  };
3556
3557
  if (!SESSION_OBJ[SESSION_ID].DS_GLB) return;
3557
3558
 
@@ -5135,8 +5136,9 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5135
5136
  continue;
5136
5137
  }
5137
5138
 
5138
- try {
5139
- const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5139
+ // try {
5140
+ const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5141
+ if (_ds.data_feed.rows[row_idx][field_id] !== value) {
5140
5142
  _ds.data_feed.rows[row_idx][field_id] = value;
5141
5143
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5142
5144
 
@@ -5170,21 +5172,23 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5170
5172
  }
5171
5173
  }
5172
5174
  }
5173
- } catch (err) {
5174
- console.error(err);
5175
- }
5176
5175
 
5177
- if (!fields_changed.includes(field_id)) {
5178
- fields_changed.push(field_id);
5179
- }
5180
- if (!datasource_changed.includes(dataSource)) {
5181
- datasource_changed.push(dataSource);
5182
- }
5176
+ // } catch (err) {
5177
+ // console.error(err);
5178
+ // }
5183
5179
 
5184
- if (!_ds.data_feed.rows_changed) {
5185
- _ds.data_feed.rows_changed = [];
5180
+ if (!fields_changed.includes(field_id)) {
5181
+ fields_changed.push(field_id);
5182
+ }
5183
+ if (!datasource_changed.includes(dataSource)) {
5184
+ datasource_changed.push(dataSource);
5185
+ }
5186
+
5187
+ if (!_ds.data_feed.rows_changed) {
5188
+ _ds.data_feed.rows_changed = [];
5189
+ }
5190
+ if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5186
5191
  }
5187
- if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5188
5192
  } else if (fields_data === 'set') {
5189
5193
  _ds.currentRecordId = record_id;
5190
5194
  }
@@ -12195,6 +12199,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
12195
12199
  const common_fx = {
12196
12200
  'xu-ref': async function ($elm, val) {
12197
12201
  console.log('xu-ref', $elm, val);
12202
+ let _ds_0 = _session.DS_GLB[0];
12203
+ if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
12204
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
12205
+ }
12206
+ // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val]) {
12207
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val] = { $el: $elm };
12208
+ // }
12198
12209
  return {};
12199
12210
  },
12200
12211
  'xu-bind': async function ($elm, val) {
@@ -3553,6 +3553,7 @@ func.datasource.prepare = async function (SESSION_ID, prog_id, dataSourceNoP, pa
3553
3553
  _ds.data_system['SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO'] = _session.SYS_GLOBAL_OBJ_FIREBASE_AUTH_INFO;
3554
3554
 
3555
3555
  _ds.data_system['SYS_GLOBAL_OBJ_CLIENT_INFO'] = _session.SYS_GLOBAL_OBJ_CLIENT_INFO;
3556
+ _ds.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
3556
3557
  };
3557
3558
  if (!SESSION_OBJ[SESSION_ID].DS_GLB) return;
3558
3559
 
@@ -5136,8 +5137,9 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5136
5137
  continue;
5137
5138
  }
5138
5139
 
5139
- try {
5140
- const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5140
+ // try {
5141
+ const row_idx = func.common.find_ROWID_idx(_ds, record_id);
5142
+ if (_ds.data_feed.rows[row_idx][field_id] !== value) {
5141
5143
  _ds.data_feed.rows[row_idx][field_id] = value;
5142
5144
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5143
5145
 
@@ -5171,21 +5173,23 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5171
5173
  }
5172
5174
  }
5173
5175
  }
5174
- } catch (err) {
5175
- console.error(err);
5176
- }
5177
5176
 
5178
- if (!fields_changed.includes(field_id)) {
5179
- fields_changed.push(field_id);
5180
- }
5181
- if (!datasource_changed.includes(dataSource)) {
5182
- datasource_changed.push(dataSource);
5183
- }
5177
+ // } catch (err) {
5178
+ // console.error(err);
5179
+ // }
5184
5180
 
5185
- if (!_ds.data_feed.rows_changed) {
5186
- _ds.data_feed.rows_changed = [];
5181
+ if (!fields_changed.includes(field_id)) {
5182
+ fields_changed.push(field_id);
5183
+ }
5184
+ if (!datasource_changed.includes(dataSource)) {
5185
+ datasource_changed.push(dataSource);
5186
+ }
5187
+
5188
+ if (!_ds.data_feed.rows_changed) {
5189
+ _ds.data_feed.rows_changed = [];
5190
+ }
5191
+ if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5187
5192
  }
5188
- if (!_ds.data_feed.rows_changed.includes(record_id)) _ds.data_feed.rows_changed.push(record_id);
5189
5193
  } else if (fields_data === 'set') {
5190
5194
  _ds.currentRecordId = record_id;
5191
5195
  }
@@ -10261,6 +10265,13 @@ func.UI.screen.execute_xu_functions = async function (SESSION_ID, is_skeleton, $
10261
10265
  const common_fx = {
10262
10266
  'xu-ref': async function ($elm, val) {
10263
10267
  console.log('xu-ref', $elm, val);
10268
+ let _ds_0 = _session.DS_GLB[0];
10269
+ if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS']) {
10270
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'] = {};
10271
+ }
10272
+ // if (!_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val]) {
10273
+ _ds_0.data_system['SYS_GLOBAL_OBJ_REFS'][val] = { $el: $elm };
10274
+ // }
10264
10275
  return {};
10265
10276
  },
10266
10277
  'xu-bind': async function ($elm, val) {